@zenkigen-inc/component-ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +40 -0
  2. package/dist/avatar/avatar.d.ts +11 -0
  3. package/dist/avatar/index.d.ts +1 -0
  4. package/dist/breadcrumb/breadcrumb-item.d.ts +7 -0
  5. package/dist/breadcrumb/breadcrumb.d.ts +6 -0
  6. package/dist/breadcrumb/index.d.ts +1 -0
  7. package/dist/button/button.d.ts +21 -0
  8. package/dist/button/index.d.ts +1 -0
  9. package/dist/checkbox/checkbox.d.ts +14 -0
  10. package/dist/checkbox/checked-icon.d.ts +2 -0
  11. package/dist/checkbox/index.d.ts +1 -0
  12. package/dist/checkbox/minus-icon.d.ts +2 -0
  13. package/dist/dropdown/dropdown-context.d.ts +13 -0
  14. package/dist/dropdown/dropdown-item.d.ts +8 -0
  15. package/dist/dropdown/dropdown-menu.d.ts +11 -0
  16. package/dist/dropdown/dropdown.d.ts +26 -0
  17. package/dist/dropdown/index.d.ts +2 -0
  18. package/dist/dropdown/type.d.ts +9 -0
  19. package/dist/evaluation-star/evaluation-star.d.ts +9 -0
  20. package/dist/evaluation-star/index.d.ts +1 -0
  21. package/dist/heading/heading.d.ts +10 -0
  22. package/dist/heading/index.d.ts +1 -0
  23. package/dist/hooks/use-outside-click.d.ts +2 -0
  24. package/dist/icon/icon.d.ts +13 -0
  25. package/dist/icon/index.d.ts +1 -0
  26. package/dist/icon-button/icon-button.d.ts +20 -0
  27. package/dist/icon-button/index.d.ts +1 -0
  28. package/dist/index.d.ts +22 -0
  29. package/dist/index.esm.js +32471 -0
  30. package/dist/index.esm.js.map +1 -0
  31. package/dist/index.js +32420 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/loading/index.d.ts +1 -0
  34. package/dist/loading/loading.d.ts +8 -0
  35. package/dist/modal/index.d.ts +1 -0
  36. package/dist/modal/modal-button-tab.d.ts +25 -0
  37. package/dist/modal/modal-context.d.ts +7 -0
  38. package/dist/modal/modal-header.d.ts +8 -0
  39. package/dist/modal/modal-tab.d.ts +11 -0
  40. package/dist/modal/modal.d.ts +22 -0
  41. package/dist/notification-inline/index.d.ts +1 -0
  42. package/dist/notification-inline/notification-inline.d.ts +13 -0
  43. package/dist/radio/index.d.ts +1 -0
  44. package/dist/radio/radio.d.ts +12 -0
  45. package/dist/search/index.d.ts +1 -0
  46. package/dist/search/search.d.ts +11 -0
  47. package/dist/select/index.d.ts +2 -0
  48. package/dist/select/select-context.d.ts +12 -0
  49. package/dist/select/select-item.d.ts +7 -0
  50. package/dist/select/select-list.d.ts +7 -0
  51. package/dist/select/select.d.ts +21 -0
  52. package/dist/select/type.d.ts +7 -0
  53. package/dist/select-sort/index.d.ts +2 -0
  54. package/dist/select-sort/select-item.d.ts +8 -0
  55. package/dist/select-sort/select-list.d.ts +11 -0
  56. package/dist/select-sort/select-sort.d.ts +15 -0
  57. package/dist/select-sort/type.d.ts +1 -0
  58. package/dist/tab/index.d.ts +2 -0
  59. package/dist/tab/tab-item.d.ts +10 -0
  60. package/dist/tab/tab.d.ts +6 -0
  61. package/dist/table/index.d.ts +3 -0
  62. package/dist/table/table-cell.d.ts +7 -0
  63. package/dist/table/table-container.d.ts +8 -0
  64. package/dist/table/table-row-container.d.ts +7 -0
  65. package/dist/tag/delete-icon.d.ts +9 -0
  66. package/dist/tag/index.d.ts +2 -0
  67. package/dist/tag/tag.d.ts +17 -0
  68. package/dist/tag/type.d.ts +3 -0
  69. package/dist/toast/index.d.ts +2 -0
  70. package/dist/toast/toast-provider.d.ts +13 -0
  71. package/dist/toast/toast.d.ts +12 -0
  72. package/dist/toast/type.d.ts +1 -0
  73. package/dist/toggle/index.d.ts +1 -0
  74. package/dist/toggle/toggle.d.ts +12 -0
  75. package/dist/tooltip/index.d.ts +1 -0
  76. package/dist/tooltip/tail-icon.d.ts +9 -0
  77. package/dist/tooltip/tooltip.d.ts +13 -0
  78. package/dist/tooltip/type.d.ts +3 -0
  79. package/package.json +33 -0
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # @zenkigen-inc/components
2
+
3
+ ## インストール
4
+
5
+ ```bash
6
+ yarn add @zenkigen-inc/components
7
+ ```
8
+
9
+ ## 利用方法
10
+
11
+ ```tsx
12
+ import { Button } from 'zenkigen-component';
13
+
14
+ const Component = () => {
15
+ return <Button>ボタン</Button>;
16
+ };
17
+ ```
18
+
19
+ ## 開発者向け
20
+
21
+ ### コンポーネントの雛形を生成する
22
+
23
+ hygen で雛形を生成することができるので、必ずこのコマンドから生成されたファイルを元に実装を始めてください。
24
+
25
+ ```bash
26
+ yarn generate-component
27
+ ```
28
+
29
+ ### 実装したコンポーネントを export する
30
+
31
+ 使用する側の import を簡略化させるため root にある [packages/component-ui/src/index.ts](https://github.com/zenkigen/zenkigen-component/blob/main/packages/components/src/index.ts) に実装したコンポーネントを export してください。
32
+
33
+ ### コーディングガイドライン(社内のみ)
34
+
35
+ 開発する際は以下を参照してください。
36
+ https://www.notion.so/zenkigen/5d4ebd0d93b74124a533cf167b852ec0
37
+
38
+ ## ライセンス
39
+
40
+ @zenkigen-inc/components は MIT ライセンスに基づいています。
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export declare const isAsciiString: (str: string) => boolean;
3
+ type Props = {
4
+ size?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large';
5
+ userId?: number;
6
+ firstName: string;
7
+ lastName: string;
8
+ isDisabled?: boolean;
9
+ };
10
+ export declare function Avatar({ size, ...props }: Props): import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1 @@
1
+ export { Avatar } from './avatar';
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ isLast: boolean;
4
+ children?: ReactNode;
5
+ };
6
+ export declare const BreadcrumbItem: ({ children, isLast }: Props) => import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ children: ReactNode[];
4
+ };
5
+ export declare const Breadcrumb: ({ children }: Props) => import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1 @@
1
+ export * from './breadcrumb';
@@ -0,0 +1,21 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ type Size = 'small' | 'medium' | 'large';
3
+ type Variant = 'fill' | 'fillDanger' | 'outline' | 'text';
4
+ type Props = {
5
+ size?: Size;
6
+ width?: CSSProperties['width'];
7
+ isDisabled?: boolean;
8
+ variant?: Variant;
9
+ before?: ReactNode;
10
+ after?: ReactNode;
11
+ children: ReactNode;
12
+ } & ({
13
+ isAnchor: true;
14
+ href: string;
15
+ target?: HTMLAnchorElement['target'];
16
+ } | {
17
+ isAnchor?: false;
18
+ onClick?: () => void;
19
+ });
20
+ export declare function Button({ size, variant, ...props }: Props): import("react").JSX.Element;
21
+ export {};
@@ -0,0 +1 @@
1
+ export { Button } from './button';
@@ -0,0 +1,14 @@
1
+ import { ChangeEvent } from 'react';
2
+ type Props = {
3
+ name?: string;
4
+ value?: string;
5
+ id?: string;
6
+ isChecked?: boolean;
7
+ color?: 'default' | 'gray' | 'error';
8
+ isIndeterminate?: boolean;
9
+ isDisabled?: boolean;
10
+ label?: string;
11
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
12
+ };
13
+ export declare function Checkbox({ name, value, id, isChecked, isIndeterminate, isDisabled, onChange, label, color, }: Props): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const CheckedIcon: () => import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export { Checkbox } from './checkbox';
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const MinusIcon: () => import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ type UseDropdownReturnType = {
3
+ isVisible: boolean;
4
+ setIsVisible: React.Dispatch<React.SetStateAction<boolean>>;
5
+ isDisabled: boolean;
6
+ targetDimensions: {
7
+ width: number;
8
+ height: number;
9
+ };
10
+ variant: 'text' | 'outline';
11
+ };
12
+ export declare const DropdownContext: import("react").Context<UseDropdownReturnType>;
13
+ export {};
@@ -0,0 +1,8 @@
1
+ import { MouseEvent, ReactNode } from 'react';
2
+ type Props = {
3
+ children: ReactNode;
4
+ color?: 'gray' | 'red';
5
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
6
+ };
7
+ export declare function DropdownItem({ children, color, onClick }: Props): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { DropdownHorizontalAlign, DropdownVerticalPosition } from './type';
3
+ type Props = {
4
+ children: ReactNode;
5
+ maxHeight?: CSSProperties['height'];
6
+ isNoPadding?: boolean;
7
+ verticalPosition?: DropdownVerticalPosition;
8
+ horizontalAlign?: DropdownHorizontalAlign;
9
+ };
10
+ export declare function DropdownMenu({ children, maxHeight, isNoPadding, verticalPosition, horizontalAlign, }: Props): false | import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,26 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { IconName } from '@zenkigen-inc/component-icons';
3
+ import { DropdownItem } from './dropdown-item';
4
+ import { DropdownMenu } from './dropdown-menu';
5
+ type Props = {
6
+ size?: 'x-small' | 'small' | 'medium' | 'large';
7
+ variant?: 'text' | 'outline';
8
+ title?: string;
9
+ isDisabled?: boolean;
10
+ isArrowHidden?: boolean;
11
+ children: ReactNode;
12
+ } & ({
13
+ target: ReactElement;
14
+ label?: never;
15
+ icon?: never;
16
+ } | {
17
+ target?: undefined;
18
+ label: string;
19
+ icon?: IconName;
20
+ });
21
+ export declare function Dropdown({ children, target, label, icon, size, variant, title, isDisabled, isArrowHidden, }: Props): import("react").JSX.Element;
22
+ export declare namespace Dropdown {
23
+ var Menu: typeof DropdownMenu;
24
+ var Item: typeof DropdownItem;
25
+ }
26
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Dropdown } from './dropdown';
2
+ export type * from './type';
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ export type DropdownItemType = {
3
+ id: string;
4
+ content: ReactNode;
5
+ color?: 'gray' | 'red';
6
+ onClick?: () => void;
7
+ };
8
+ export type DropdownVerticalPosition = 'top' | 'bottom';
9
+ export type DropdownHorizontalAlign = 'left' | 'center' | 'right';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ value: number;
4
+ isEditable?: boolean;
5
+ onChangeRating?: (newRating: number) => void | null;
6
+ size?: 'medium' | 'large';
7
+ };
8
+ export declare function EvaluationStar({ value, isEditable, onChangeRating, size }: Props): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1 @@
1
+ export { EvaluationStar } from './evaluation-star';
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ type Level = 1 | 2 | 3 | 4 | 5;
3
+ type Props = {
4
+ level: Level;
5
+ before?: ReactNode;
6
+ after?: ReactNode;
7
+ children?: ReactNode;
8
+ };
9
+ export declare function Heading(props: Props): import("react").JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ export { Heading } from './heading';
@@ -0,0 +1,2 @@
1
+ import { RefObject } from 'react';
2
+ export declare const useOutsideClick: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: (event: Event) => void, enabled?: boolean) => void;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { IconName } from '@zenkigen-inc/component-icons';
3
+ import { iconColors } from '@zenkigen-inc/component-theme';
4
+ type Size = 'x-small' | 'small' | 'medium' | 'large' | 'x-large';
5
+ type Color = keyof typeof iconColors;
6
+ type Props = {
7
+ name: IconName;
8
+ size?: Size;
9
+ color?: Color;
10
+ isDisabled?: boolean;
11
+ };
12
+ export declare const Icon: ({ size, ...props }: Props) => import("react").JSX.Element;
13
+ export {};
@@ -0,0 +1 @@
1
+ export * from './icon';
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import { IconName } from '@zenkigen-inc/component-icons';
3
+ type Size = 'small' | 'medium' | 'large';
4
+ type Variant = 'outline' | 'text';
5
+ type Props = {
6
+ icon: IconName;
7
+ size?: Size;
8
+ isDisabled?: boolean;
9
+ isNoPadding?: boolean;
10
+ variant?: Variant;
11
+ } & ({
12
+ isAnchor: true;
13
+ href: string;
14
+ target?: HTMLAnchorElement['target'];
15
+ } | {
16
+ isAnchor?: false;
17
+ onClick?: () => void;
18
+ });
19
+ export declare function IconButton({ size, variant, ...props }: Props): import("react").JSX.Element;
20
+ export {};
@@ -0,0 +1 @@
1
+ export { IconButton } from './icon-button';
@@ -0,0 +1,22 @@
1
+ export * from './avatar';
2
+ export * from './breadcrumb';
3
+ export * from './button';
4
+ export * from './checkbox';
5
+ export * from './dropdown';
6
+ export * from './evaluation-star';
7
+ export * from './heading';
8
+ export * from './icon';
9
+ export * from './icon-button';
10
+ export * from './loading';
11
+ export * from './modal';
12
+ export * from './notification-inline';
13
+ export * from './radio';
14
+ export * from './search';
15
+ export * from './select';
16
+ export * from './select-sort';
17
+ export * from './tab';
18
+ export * from './table';
19
+ export * from './tag';
20
+ export * from './toast';
21
+ export * from './toggle';
22
+ export * from './tooltip';