Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include type information in the package. Partial review of comments #142

Merged
merged 7 commits into from
Nov 18, 2024

Conversation

8845musign
Copy link
Collaborator

@8845musign 8845musign commented Nov 15, 2024

Changes

  • Extracts the information of the props into JSON using react-docgen during build
    • react-docgen can get values in more detail than react-docgen-typescript, which was used in Vitals
    • Since react-docgen cannot extract information from built packages, it extracts it from the source before building
  • I reviewed the prop comments
  • prop fix (no change in behavior)

Check

  • Browser verification (minimum) Android Chrome/iOS Safari(375px-)
  • CSS not affected by inheritance
  • Layout does not break even if there is an overflow
  • Layout does not break when wraps
  • Added new Component
    • Added data-* prop and id prop
  • Updated Ubie Vitals or Added an update issue(if needed)

@@ -65,7 +65,6 @@ type BaseProps = {
open?: boolean;
/**
* openを無視してモーダルを開いたままにするかどうか。アニメーションライブラリとの連携で、ActionHalfModal自身が開閉に関与しない場合に使用
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean props with a default value of false are more about turning an option on than setting a value,
so I've decided to unify the direction of not writing default values.

@@ -52,10 +49,9 @@ type Props = {
* 幅を指定。fullは後方互換のために残している
* デフォルト<Flex>は横幅いっぱいを専有する。しかし例えば、フレックスコンテナの子要素として配置した場合、横幅が自身の子に合わせて小さくなる。これが不都合の場合に100%とする
*/
width?: 'full' | Width;
width?: 'full' | CSSWitdh;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content is the same. I've changed it to use the direct type.

/**
* 無効状態かどうか
* @default false
*/
disabled?: boolean;
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'children' | 'onChange'> &
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'children'> &
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had redefined the props to write an explanation of onChange, but I stopped.

| CSSLengthPercentage
| 'min-content'
| 'max-content'
| 'fit-content'
| `fit-content(${CSSLengthPercentage})`
| CSSVariable;

export type CSSMinWidth =
| 'auto'
export type CSSMaxWidth =
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initial value of max-width is none, not auto.
https://developer.mozilla.org/ja/docs/Web/CSS/max-width

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type is incorrect, and the default value for the implementation is none

@8845musign 8845musign self-assigned this Nov 15, 2024
@8845musign 8845musign marked this pull request as ready for review November 15, 2024 05:40
@takanorip takanorip merged commit adf3a7b into ubie-oss:main Nov 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants