@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
@@ -0,0 +1 @@
1
+ export { Loading } from './loading';
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ size?: 'small' | 'medium' | 'large';
4
+ position?: 'fixed' | 'absolute' | 'static';
5
+ height?: string;
6
+ };
7
+ export declare function Loading({ size, position, height }: Props): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ export { Modal } from './modal';
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ primaryButtonLabel: string;
4
+ secondaryButtonLabel: string;
5
+ onClickPrimaryButton: () => void;
6
+ onClickSecondaryButton: () => void;
7
+ isDanger?: boolean;
8
+ isNoBorder?: boolean;
9
+ } & ({
10
+ isWithCheckbox?: boolean;
11
+ checkboxLabel?: string;
12
+ isChecked?: boolean;
13
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
14
+ subButtonLabel?: never;
15
+ onClickSubButton?: never;
16
+ } | {
17
+ isWithCheckbox?: never;
18
+ checkboxLabel?: never;
19
+ isChecked?: never;
20
+ onChange?: never;
21
+ subButtonLabel?: string;
22
+ onClickSubButton?: () => void;
23
+ });
24
+ export declare function ModalButtonTab({ primaryButtonLabel, secondaryButtonLabel, onClickPrimaryButton, onClickSecondaryButton, isDanger, isNoBorder, isWithCheckbox, checkboxLabel, isChecked, onChange, subButtonLabel, onClickSubButton, }: Props): import("react").JSX.Element;
25
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ type ModalReturnType = {
3
+ size?: 'small' | 'medium' | 'large' | 'x-large';
4
+ setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
5
+ };
6
+ export declare const ModalContext: import("react").Context<ModalReturnType>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ children: ReactNode;
4
+ isNoBorder?: boolean;
5
+ isNoCloseButton?: boolean;
6
+ };
7
+ export declare function ModalHeader({ children, isNoBorder, isNoCloseButton }: Props): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ tabItems: {
4
+ id: string;
5
+ label: string;
6
+ }[];
7
+ selectedTab: string;
8
+ setSelectedTab: React.Dispatch<React.SetStateAction<string>>;
9
+ };
10
+ export declare function ModalTab({ tabItems, selectedTab, setSelectedTab }: Props): import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,22 @@
1
+ import { CSSProperties, MutableRefObject, ReactElement, ReactNode } from 'react';
2
+ import { ModalButtonTab } from './modal-button-tab';
3
+ import { ModalHeader } from './modal-header';
4
+ import { ModalTab } from './modal-tab';
5
+ type Props = {
6
+ children?: ReactNode;
7
+ size?: 'small' | 'medium' | 'large' | 'x-large';
8
+ height?: CSSProperties['height'];
9
+ isOpen: boolean;
10
+ setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
11
+ portalTargetRef?: MutableRefObject<HTMLElement | null>;
12
+ headerElement?: ReactElement;
13
+ tabElement?: ReactElement;
14
+ buttonTabElement?: ReactElement;
15
+ };
16
+ export declare function Modal({ children, size, height, isOpen, setIsOpen, portalTargetRef, headerElement, tabElement, buttonTabElement, }: Props): import("react").ReactPortal;
17
+ export declare namespace Modal {
18
+ var Header: typeof ModalHeader;
19
+ var Tab: typeof ModalTab;
20
+ var ButtonTab: typeof ModalButtonTab;
21
+ }
22
+ export {};
@@ -0,0 +1 @@
1
+ export { NotificationInline } from './notification-inline';
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ state?: 'success' | 'warning' | 'information' | 'attention' | 'default';
4
+ size?: 'small' | 'medium';
5
+ children?: ReactNode;
6
+ } & ({
7
+ showClose?: false;
8
+ } | {
9
+ showClose: true;
10
+ onClickClose: () => void;
11
+ });
12
+ export declare function NotificationInline({ state, size, ...props }: Props): import("react").JSX.Element;
13
+ export {};
@@ -0,0 +1 @@
1
+ export { Radio } from './radio';
@@ -0,0 +1,12 @@
1
+ import { ChangeEvent } from 'react';
2
+ type Props = {
3
+ name?: string;
4
+ value?: string;
5
+ id?: string;
6
+ label?: string;
7
+ isChecked?: boolean;
8
+ isDisabled?: boolean;
9
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
10
+ };
11
+ export declare function Radio({ name, value, id, label, isChecked, isDisabled, onChange }: Props): import("react").JSX.Element;
12
+ export {};
@@ -0,0 +1 @@
1
+ export { Search } from './search';
@@ -0,0 +1,11 @@
1
+ import { ChangeEvent, FormEvent } from 'react';
2
+ type Props = {
3
+ placeholder?: string;
4
+ width?: string;
5
+ value?: string;
6
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
7
+ onSubmit?: (e: FormEvent<HTMLFormElement>) => void;
8
+ onClickSearchModal?: () => void;
9
+ };
10
+ export declare const Search: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Select } from './select';
2
+ export type * from './type';
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { SelectOption } from './type';
3
+ type UseSelectReturnType = {
4
+ size?: 'x-small' | 'small' | 'medium' | 'large';
5
+ placeholder?: string;
6
+ selectedOption?: SelectOption | null;
7
+ setIsOptionListOpen: React.Dispatch<React.SetStateAction<boolean>>;
8
+ onChange?: (option: SelectOption | null) => void;
9
+ variant?: 'text' | 'outline';
10
+ };
11
+ export declare const SelectContext: import("react").Context<UseSelectReturnType>;
12
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { SelectOption } from './type';
3
+ type Props = {
4
+ option: SelectOption;
5
+ };
6
+ export declare function SelectItem({ option }: Props): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ type Props = {
3
+ children: ReactNode;
4
+ maxHeight?: CSSProperties['height'];
5
+ };
6
+ export declare function SelectList({ children, maxHeight }: Props): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,21 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { IconName } from '@zenkigen-inc/component-icons';
3
+ import { SelectItem } from './select-item';
4
+ import type { SelectOption } from './type';
5
+ type Props = {
6
+ children: ReactNode;
7
+ size?: 'x-small' | 'small' | 'medium' | 'large';
8
+ variant?: 'outline' | 'text';
9
+ width?: CSSProperties['width'];
10
+ placeholder?: string;
11
+ placeholderIcon?: IconName;
12
+ selectedOption?: SelectOption | null;
13
+ optionListMaxHeight?: CSSProperties['height'];
14
+ isDisabled?: boolean;
15
+ onChange?: (option: SelectOption | null) => void;
16
+ };
17
+ export declare function Select({ children, size, variant, width, placeholder, placeholderIcon, selectedOption, isDisabled, onChange, optionListMaxHeight, }: Props): import("react").JSX.Element;
18
+ export declare namespace Select {
19
+ var Option: typeof SelectItem;
20
+ }
21
+ export {};
@@ -0,0 +1,7 @@
1
+ import { IconName } from '@zenkigen-inc/component-icons';
2
+ export type SelectOption = {
3
+ id: string;
4
+ value: string;
5
+ label: string;
6
+ icon?: IconName;
7
+ };
@@ -0,0 +1,2 @@
1
+ export { SelectSort } from './select-sort';
2
+ export type * from './type';
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ children: ReactNode;
4
+ isSortKey: boolean;
5
+ onClickItem: () => void;
6
+ };
7
+ export declare function SelectItem({ children, isSortKey, onClickItem }: Props): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import type { SortOrder } from './type';
3
+ type Props = {
4
+ size: 'x-small' | 'small' | 'medium' | 'large';
5
+ variant: 'text' | 'outline';
6
+ sortOrder: SortOrder;
7
+ onClickItem: (value: SortOrder) => void;
8
+ onClickDeselect?: () => void;
9
+ };
10
+ export declare function SelectList({ size, variant, sortOrder, onClickItem, onClickDeselect }: Props): import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,15 @@
1
+ import { CSSProperties } from 'react';
2
+ import type { SortOrder } from './type';
3
+ type Props = {
4
+ size?: 'x-small' | 'small' | 'medium' | 'large';
5
+ variant?: 'outline' | 'text';
6
+ width?: CSSProperties['width'];
7
+ label: string;
8
+ sortOrder: SortOrder;
9
+ isDisabled?: boolean;
10
+ isSortKey?: boolean;
11
+ onChange?: (value: SortOrder) => void;
12
+ onClickDeselect?: () => void;
13
+ };
14
+ export declare function SelectSort({ size, variant, width, label, sortOrder, isDisabled, isSortKey, onChange, onClickDeselect, }: Props): import("react").JSX.Element;
15
+ export {};
@@ -0,0 +1 @@
1
+ export type SortOrder = 'ascend' | 'descend' | null;
@@ -0,0 +1,2 @@
1
+ export { Tab } from './tab';
2
+ export { TabItem } from './tab-item';
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ id: string;
4
+ isSelected?: boolean;
5
+ isDisabled?: boolean;
6
+ children?: ReactNode;
7
+ onClick: (id: string) => void;
8
+ };
9
+ export declare const TabItem: (props: Props) => import("react").JSX.Element;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ children?: ReactNode;
4
+ };
5
+ export declare function Tab({ children }: Props): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ export { TableContainer } from './table-container';
2
+ export { TableRowContainer } from './table-row-container';
3
+ export { TableCell } from './table-cell';
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ children?: ReactNode;
4
+ className?: string;
5
+ };
6
+ export declare function TableCell({ children, className }: Props): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { CSSProperties, PropsWithChildren } from 'react';
2
+ type Props = {
3
+ width?: CSSProperties['width'];
4
+ rows?: CSSProperties['gridTemplateRows'];
5
+ columns?: CSSProperties['gridTemplateColumns'];
6
+ };
7
+ export declare function TableContainer({ width, rows, columns, children }: PropsWithChildren<Props>): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ children?: ReactNode;
4
+ isHoverBackgroundVisible?: boolean;
5
+ };
6
+ export declare function TableRowContainer({ children, isHoverBackgroundVisible }: Props): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { ColorVariant, TagColor } from './type';
3
+ type Props = {
4
+ color?: TagColor;
5
+ variant?: ColorVariant;
6
+ onClick?: () => void;
7
+ };
8
+ export declare const DeleteIcon: ({ color, variant, onClick }: Props) => import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Tag } from './tag';
2
+ export type * from './type';
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { ColorVariant, TagColor } from './type';
3
+ type Props = {
4
+ id: string;
5
+ children: string;
6
+ color: TagColor;
7
+ variant?: ColorVariant;
8
+ size?: 'x-small' | 'small' | 'medium';
9
+ } & ({
10
+ isEditable: true;
11
+ onDelete: (id: string) => void;
12
+ } | {
13
+ isEditable?: undefined;
14
+ onDelete?: never;
15
+ });
16
+ export declare function Tag({ id, children, color, variant, size, isEditable, onDelete }: Props): import("react").JSX.Element;
17
+ export {};
@@ -0,0 +1,3 @@
1
+ import { tagLightColors } from '@zenkigen-inc/component-theme';
2
+ export type TagColor = keyof typeof tagLightColors;
3
+ export type ColorVariant = 'normal' | 'light';
@@ -0,0 +1,2 @@
1
+ export * from './toast';
2
+ export * from './toast-provider';
@@ -0,0 +1,13 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { ToastState } from './type';
3
+ type AddToastArgs = {
4
+ message: string;
5
+ state: ToastState;
6
+ };
7
+ type ToastProviderProps = {
8
+ addToast: (args: AddToastArgs) => void;
9
+ removeToast: (id: number) => void;
10
+ };
11
+ export declare const ToastProvider: ({ children }: PropsWithChildren) => import("react").JSX.Element;
12
+ export declare const useToast: () => ToastProviderProps;
13
+ export {};
@@ -0,0 +1,12 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { ToastState } from './type';
3
+ type Props = {
4
+ state?: ToastState;
5
+ width?: CSSProperties['width'];
6
+ isAutoClose?: boolean;
7
+ isAnimation?: boolean;
8
+ children?: ReactNode;
9
+ onClickClose: () => void;
10
+ };
11
+ export declare function Toast({ state, width, isAutoClose, isAnimation, children, onClickClose, }: Props): import("react").JSX.Element;
12
+ export {};
@@ -0,0 +1 @@
1
+ export type ToastState = 'success' | 'error' | 'warning' | 'information';
@@ -0,0 +1 @@
1
+ export { Toggle } from './toggle';
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ id: string;
4
+ size: 'small' | 'medium';
5
+ isChecked: boolean;
6
+ onChange: () => void;
7
+ label?: ReactNode;
8
+ labelPosition?: 'left' | 'right';
9
+ isDisabled?: boolean;
10
+ };
11
+ export declare function Toggle({ id, size, isChecked, onChange, label, labelPosition, isDisabled, }: Props): import("react").JSX.Element;
12
+ export {};
@@ -0,0 +1 @@
1
+ export { Tooltip } from './tooltip';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { TooltipHorizontalAlign, TooltipSize, TooltipVerticalPosition } from './type';
3
+ type Props = {
4
+ size: TooltipSize;
5
+ verticalPosition: TooltipVerticalPosition;
6
+ horizontalAlign: TooltipHorizontalAlign;
7
+ };
8
+ export declare const TailIcon: (props: Props) => import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,13 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { TooltipHorizontalAlign, TooltipSize, TooltipVerticalPosition } from './type';
3
+ type Props = {
4
+ children: ReactNode;
5
+ content: string;
6
+ size?: TooltipSize;
7
+ maxWidth?: CSSProperties['width'];
8
+ verticalPosition?: TooltipVerticalPosition;
9
+ horizontalAlign?: TooltipHorizontalAlign;
10
+ isDisabledHover?: boolean;
11
+ };
12
+ export declare function Tooltip({ children, content, size, maxWidth, verticalPosition, horizontalAlign, isDisabledHover, }: Props): import("react").JSX.Element;
13
+ export {};
@@ -0,0 +1,3 @@
1
+ export type TooltipSize = 'small' | 'medium';
2
+ export type TooltipVerticalPosition = 'top' | 'bottom';
3
+ export type TooltipHorizontalAlign = 'left' | 'center' | 'right';
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@zenkigen-inc/component-ui",
3
+ "version": "1.0.0",
4
+ "repository": "https://github.com/zenkigen/zenkigen-component",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "source": "./src/index.ts",
10
+ "main": "./dist/index.js",
11
+ "module": "./dist/index.esm.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": "./dist/index.js",
14
+ "scripts": {
15
+ "type-check": "tsc --noEmit",
16
+ "generate-component": "hygen generator components",
17
+ "build": "rimraf dist && microbundle --no-compress -f modern,esm,cjs --jsx React.createElement --jsxFragment React.Fragment --jsxImportSource react --globals react/jsx-runtime=jsx --tsconfig tsconfig.build.json"
18
+ },
19
+ "devDependencies": {
20
+ "hygen": "6.2.11",
21
+ "microbundle": "0.15.1",
22
+ "typescript": "5.1.6"
23
+ },
24
+ "peerDependencies": {
25
+ "@types/react": "^18.0.0",
26
+ "react": "^18.0.0"
27
+ },
28
+ "dependencies": {
29
+ "@zenkigen-inc/component-icons": "1.0.0",
30
+ "@zenkigen-inc/component-theme": "1.0.0",
31
+ "clsx": "2.0.0"
32
+ }
33
+ }