@zenkigen-inc/component-ui 1.15.1 → 1.15.2

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 (97) hide show
  1. package/dist/index.d.mts +434 -0
  2. package/dist/index.d.ts +434 -27
  3. package/dist/index.js +1602 -1701
  4. package/dist/index.mjs +1915 -0
  5. package/package.json +18 -8
  6. package/tsup.config.ts +13 -0
  7. package/vitest.config.ts +11 -0
  8. package/vitest.setup.ts +1 -0
  9. package/dist/avatar/avatar.d.ts +0 -10
  10. package/dist/avatar/index.d.ts +0 -1
  11. package/dist/breadcrumb/breadcrumb-item.d.ts +0 -2
  12. package/dist/breadcrumb/breadcrumb.d.ts +0 -5
  13. package/dist/breadcrumb/index.d.ts +0 -1
  14. package/dist/button/button.d.ts +0 -22
  15. package/dist/button/index.d.ts +0 -1
  16. package/dist/checkbox/checkbox.d.ts +0 -14
  17. package/dist/checkbox/checked-icon.d.ts +0 -1
  18. package/dist/checkbox/index.d.ts +0 -1
  19. package/dist/checkbox/minus-icon.d.ts +0 -1
  20. package/dist/dropdown/dropdown-context.d.ts +0 -14
  21. package/dist/dropdown/dropdown-item.d.ts +0 -7
  22. package/dist/dropdown/dropdown-menu.d.ts +0 -10
  23. package/dist/dropdown/dropdown.d.ts +0 -26
  24. package/dist/dropdown/index.d.ts +0 -2
  25. package/dist/dropdown/type.d.ts +0 -9
  26. package/dist/evaluation-star/evaluation-star.d.ts +0 -8
  27. package/dist/evaluation-star/index.d.ts +0 -1
  28. package/dist/heading/heading.d.ts +0 -10
  29. package/dist/heading/index.d.ts +0 -1
  30. package/dist/hooks/index.d.ts +0 -1
  31. package/dist/hooks/use-outside-click.d.ts +0 -2
  32. package/dist/icon/icon.d.ts +0 -13
  33. package/dist/icon/index.d.ts +0 -1
  34. package/dist/icon-button/icon-button.d.ts +0 -19
  35. package/dist/icon-button/index.d.ts +0 -1
  36. package/dist/index.esm.js +0 -2147
  37. package/dist/index.esm.js.map +0 -1
  38. package/dist/index.js.map +0 -1
  39. package/dist/loading/index.d.ts +0 -1
  40. package/dist/loading/loading.d.ts +0 -7
  41. package/dist/modal/body-scroll-lock.d.ts +0 -27
  42. package/dist/modal/index.d.ts +0 -1
  43. package/dist/modal/modal-body.d.ts +0 -2
  44. package/dist/modal/modal-context.d.ts +0 -5
  45. package/dist/modal/modal-footer.d.ts +0 -7
  46. package/dist/modal/modal-header.d.ts +0 -6
  47. package/dist/modal/modal.d.ts +0 -18
  48. package/dist/notification-inline/index.d.ts +0 -1
  49. package/dist/notification-inline/notification-inline.d.ts +0 -13
  50. package/dist/pagination/index.d.ts +0 -1
  51. package/dist/pagination/pagination-button.d.ts +0 -6
  52. package/dist/pagination/pagination-context.d.ts +0 -6
  53. package/dist/pagination/pagination.d.ts +0 -12
  54. package/dist/pagination-select/index.d.ts +0 -1
  55. package/dist/pagination-select/pagination-select.d.ts +0 -22
  56. package/dist/radio/index.d.ts +0 -1
  57. package/dist/radio/radio.d.ts +0 -12
  58. package/dist/search/index.d.ts +0 -1
  59. package/dist/search/search.d.ts +0 -12
  60. package/dist/select/index.d.ts +0 -2
  61. package/dist/select/select-context.d.ts +0 -11
  62. package/dist/select/select-item.d.ts +0 -6
  63. package/dist/select/select-list.d.ts +0 -6
  64. package/dist/select/select.d.ts +0 -22
  65. package/dist/select/type.d.ts +0 -7
  66. package/dist/select-sort/index.d.ts +0 -2
  67. package/dist/select-sort/select-item.d.ts +0 -7
  68. package/dist/select-sort/select-list.d.ts +0 -10
  69. package/dist/select-sort/select-sort.d.ts +0 -15
  70. package/dist/select-sort/type.d.ts +0 -1
  71. package/dist/tab/index.d.ts +0 -2
  72. package/dist/tab/tab-item.d.ts +0 -10
  73. package/dist/tab/tab.d.ts +0 -15
  74. package/dist/table/index.d.ts +0 -3
  75. package/dist/table/table-cell.d.ts +0 -8
  76. package/dist/table/table-row.d.ts +0 -7
  77. package/dist/table/table.d.ts +0 -16
  78. package/dist/tag/delete-icon.d.ts +0 -8
  79. package/dist/tag/index.d.ts +0 -2
  80. package/dist/tag/tag.d.ts +0 -17
  81. package/dist/tag/type.d.ts +0 -3
  82. package/dist/text-area/index.d.ts +0 -1
  83. package/dist/text-area/text-area.d.ts +0 -8
  84. package/dist/text-input/index.d.ts +0 -1
  85. package/dist/text-input/text-input.d.ts +0 -7
  86. package/dist/toast/index.d.ts +0 -2
  87. package/dist/toast/toast-provider.d.ts +0 -13
  88. package/dist/toast/toast.d.ts +0 -12
  89. package/dist/toast/type.d.ts +0 -1
  90. package/dist/toggle/index.d.ts +0 -1
  91. package/dist/toggle/toggle.d.ts +0 -12
  92. package/dist/tooltip/index.d.ts +0 -1
  93. package/dist/tooltip/tail-icon.d.ts +0 -8
  94. package/dist/tooltip/tooltip-content.d.ts +0 -11
  95. package/dist/tooltip/tooltip.d.ts +0 -13
  96. package/dist/tooltip/tooltip.hook.d.ts +0 -11
  97. package/dist/tooltip/type.d.ts +0 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenkigen-inc/component-ui",
3
- "version": "1.15.1",
3
+ "version": "1.15.2",
4
4
  "repository": "https://github.com/zenkigen/zenkigen-component",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -8,18 +8,28 @@
8
8
  },
9
9
  "source": "./src/index.ts",
10
10
  "main": "./dist/index.js",
11
- "module": "./dist/index.esm.js",
11
+ "module": "./dist/index.mjs",
12
12
  "types": "./dist/index.d.ts",
13
- "exports": "./dist/index.js",
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/index.mjs",
16
+ "require": "./dist/index.js"
17
+ }
18
+ },
14
19
  "scripts": {
15
20
  "type-check": "tsc --noEmit",
16
21
  "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 --external none",
18
- "build-lib": "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"
22
+ "build": "rimraf dist && tsup",
23
+ "build-lib": "rimraf dist && tsup",
24
+ "test": "vitest",
25
+ "test:ci": "vitest run"
19
26
  },
20
27
  "devDependencies": {
28
+ "@testing-library/jest-dom": "6.4.0",
29
+ "@testing-library/react": "15.0.0",
30
+ "@testing-library/user-event": "14.6.1",
21
31
  "hygen": "6.2.11",
22
- "microbundle": "0.15.1",
32
+ "tsup": "8.5.0",
23
33
  "typescript": "5.8.3"
24
34
  },
25
35
  "peerDependencies": {
@@ -27,8 +37,8 @@
27
37
  "react-dom": "^18.0.0 || ^19.0.0"
28
38
  },
29
39
  "dependencies": {
30
- "@zenkigen-inc/component-icons": "1.15.1",
31
- "@zenkigen-inc/component-theme": "1.15.1",
40
+ "@zenkigen-inc/component-icons": "1.15.2",
41
+ "@zenkigen-inc/component-theme": "1.15.2",
32
42
  "clsx": "2.1.1"
33
43
  }
34
44
  }
package/tsup.config.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { defineConfig } from 'tsup';
2
+
3
+ export default defineConfig({
4
+ entry: ['src/index.ts'],
5
+ format: ['cjs', 'esm'],
6
+ dts: true,
7
+ external: ['react', 'react-dom', '@zenkigen-inc/component-icons', '@zenkigen-inc/component-theme'],
8
+ clean: true,
9
+ esbuildOptions: (options) => {
10
+ options.jsx = 'automatic';
11
+ options.jsxImportSource = 'react';
12
+ },
13
+ });
@@ -0,0 +1,11 @@
1
+ import react from '@vitejs/plugin-react';
2
+ import { defineConfig } from 'vitest/config';
3
+
4
+ export default defineConfig({
5
+ plugins: [react()],
6
+ test: {
7
+ environment: 'jsdom',
8
+ setupFiles: ['./vitest.setup.ts'],
9
+ globals: true,
10
+ },
11
+ });
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -1,10 +0,0 @@
1
- export declare const isAsciiString: (str: string) => boolean;
2
- type Props = {
3
- size?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large';
4
- userId?: number;
5
- firstName: string;
6
- lastName: string;
7
- isDisabled?: boolean;
8
- };
9
- export declare function Avatar({ size, ...props }: Props): import("react").JSX.Element;
10
- export {};
@@ -1 +0,0 @@
1
- export { Avatar } from './avatar';
@@ -1,2 +0,0 @@
1
- import type { PropsWithChildren } from 'react';
2
- export declare const BreadcrumbItem: ({ children }: PropsWithChildren) => import("react").JSX.Element;
@@ -1,5 +0,0 @@
1
- import type { PropsWithChildren } from 'react';
2
- export declare function Breadcrumb({ children }: PropsWithChildren): import("react").JSX.Element;
3
- export declare namespace Breadcrumb {
4
- var Item: ({ children }: PropsWithChildren) => import("react").JSX.Element;
5
- }
@@ -1 +0,0 @@
1
- export * from './breadcrumb';
@@ -1,22 +0,0 @@
1
- import type { ComponentPropsWithoutRef, CSSProperties, ElementType, PropsWithChildren, ReactNode } from 'react';
2
- type Size = 'small' | 'medium' | 'large';
3
- type Variant = 'fill' | 'fillDanger' | 'outline' | 'text';
4
- type JustifyContent = 'start' | 'center';
5
- export type ElementAs = ElementType;
6
- export type AsProp<T extends ElementAs> = {
7
- elementAs?: T;
8
- };
9
- export type PolymorphicPropsWithoutRef<T extends ElementAs, P extends object> = PropsWithChildren<P> & ComponentPropsWithoutRef<T> & AsProp<T>;
10
- type Props<T extends ElementAs> = PolymorphicPropsWithoutRef<T, {
11
- size?: Size;
12
- width?: CSSProperties['width'];
13
- isSelected?: boolean;
14
- isDisabled?: boolean;
15
- variant?: Variant;
16
- before?: ReactNode;
17
- after?: ReactNode;
18
- borderRadius?: CSSProperties['borderRadius'];
19
- justifyContent?: JustifyContent;
20
- }>;
21
- export declare const Button: <T extends ElementAs = "button">({ size, variant, isDisabled, isSelected, width, borderRadius, justifyContent, before, after, elementAs, children, ...props }: Props<T>) => import("react").JSX.Element;
22
- export {};
@@ -1 +0,0 @@
1
- export { Button } from './button';
@@ -1,14 +0,0 @@
1
- import type { 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 {};
@@ -1 +0,0 @@
1
- export declare const CheckedIcon: () => import("react").JSX.Element;
@@ -1 +0,0 @@
1
- export { Checkbox } from './checkbox';
@@ -1 +0,0 @@
1
- export declare const MinusIcon: () => import("react").JSX.Element;
@@ -1,14 +0,0 @@
1
- import type { MutableRefObject } from 'react';
2
- type UseDropdownReturnType = {
3
- isVisible: boolean;
4
- setIsVisible: React.Dispatch<React.SetStateAction<boolean>>;
5
- isDisabled: boolean;
6
- portalTargetRef?: MutableRefObject<HTMLElement | null>;
7
- targetDimensions: {
8
- width: number;
9
- height: number;
10
- };
11
- variant: 'text' | 'outline';
12
- };
13
- export declare const DropdownContext: import("react").Context<UseDropdownReturnType>;
14
- export {};
@@ -1,7 +0,0 @@
1
- import type { MouseEvent, PropsWithChildren } from 'react';
2
- type Props = {
3
- color?: 'gray' | 'red';
4
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
5
- };
6
- export declare function DropdownItem({ children, color, onClick }: PropsWithChildren<Props>): import("react").JSX.Element;
7
- export {};
@@ -1,10 +0,0 @@
1
- import type { CSSProperties, PropsWithChildren } from 'react';
2
- import type { DropdownHorizontalAlign, DropdownVerticalPosition } from './type';
3
- type Props = {
4
- maxHeight?: CSSProperties['height'];
5
- isNoPadding?: boolean;
6
- verticalPosition?: DropdownVerticalPosition;
7
- horizontalAlign?: DropdownHorizontalAlign;
8
- };
9
- export declare function DropdownMenu({ children, maxHeight, isNoPadding, verticalPosition, horizontalAlign, }: PropsWithChildren<Props>): false | import("react").JSX.Element;
10
- export {};
@@ -1,26 +0,0 @@
1
- import type { IconName } from '@zenkigen-inc/component-icons';
2
- import type { MutableRefObject, PropsWithChildren, ReactElement } from 'react';
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
- portalTargetRef?: MutableRefObject<HTMLElement | null>;
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, portalTargetRef, }: PropsWithChildren<Props>): import("react").JSX.Element;
22
- export declare namespace Dropdown {
23
- var Menu: typeof DropdownMenu;
24
- var Item: typeof DropdownItem;
25
- }
26
- export {};
@@ -1,2 +0,0 @@
1
- export { Dropdown } from './dropdown';
2
- export type * from './type';
@@ -1,9 +0,0 @@
1
- import type { 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';
@@ -1,8 +0,0 @@
1
- type Props = {
2
- value: number;
3
- isEditable?: boolean;
4
- onChangeRating?: (newRating: number) => void | null;
5
- size?: 'medium' | 'large';
6
- };
7
- export declare function EvaluationStar({ value, isEditable, onChangeRating, size }: Props): import("react").JSX.Element;
8
- export {};
@@ -1 +0,0 @@
1
- export { EvaluationStar } from './evaluation-star';
@@ -1,10 +0,0 @@
1
- import type { 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 {};
@@ -1 +0,0 @@
1
- export { Heading } from './heading';
@@ -1 +0,0 @@
1
- export * from './use-outside-click';
@@ -1,2 +0,0 @@
1
- import type { RefObject } from 'react';
2
- export declare const useOutsideClick: <T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, handler: (event: Event) => void, enabled?: boolean) => void;
@@ -1,13 +0,0 @@
1
- import type { IconName } from '@zenkigen-inc/component-icons';
2
- import { iconColors } from '@zenkigen-inc/component-theme';
3
- type Size = 'x-small' | 'small' | 'medium' | 'large' | 'x-large';
4
- type Color = keyof typeof iconColors;
5
- type Props = {
6
- name: IconName;
7
- size?: Size;
8
- color?: Color;
9
- isDisabled?: boolean;
10
- className?: string;
11
- };
12
- export declare const Icon: ({ size, isDisabled, ...props }: Props) => import("react").JSX.Element;
13
- export {};
@@ -1 +0,0 @@
1
- export * from './icon';
@@ -1,19 +0,0 @@
1
- import type { IconName } from '@zenkigen-inc/component-icons';
2
- type Size = 'small' | 'medium' | 'large';
3
- type Variant = 'outline' | 'text';
4
- type Props = {
5
- icon: IconName;
6
- size?: Size;
7
- isDisabled?: boolean;
8
- isNoPadding?: boolean;
9
- variant?: Variant;
10
- } & ({
11
- isAnchor: true;
12
- href: string;
13
- target?: HTMLAnchorElement['target'];
14
- } | {
15
- isAnchor?: false;
16
- onClick?: () => void;
17
- });
18
- export declare function IconButton({ size, variant, isNoPadding, isDisabled, ...props }: Props): import("react").JSX.Element;
19
- export {};
@@ -1 +0,0 @@
1
- export { IconButton } from './icon-button';