@charcoal-ui/react 3.10.1-beta.1 → 4.0.0-beta.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 (31) hide show
  1. package/dist/_lib/useClassNames.d.ts +5 -0
  2. package/dist/_lib/useClassNames.d.ts.map +1 -0
  3. package/dist/components/Button/index.d.ts +13 -10
  4. package/dist/components/Button/index.d.ts.map +1 -1
  5. package/dist/components/Button/index.story.d.ts +9 -4
  6. package/dist/components/Button/index.story.d.ts.map +1 -1
  7. package/dist/index.cjs.js +314 -357
  8. package/dist/index.cjs.js.map +1 -1
  9. package/dist/index.css +118 -0
  10. package/dist/index.css.map +1 -0
  11. package/dist/index.esm.js +208 -251
  12. package/dist/index.esm.js.map +1 -1
  13. package/dist/styled.d.ts +4 -4
  14. package/package.json +17 -11
  15. package/src/_lib/useClassNames.ts +14 -0
  16. package/src/components/Button/__snapshots__/index.story.storyshot +22 -1754
  17. package/src/components/Button/index.css +125 -0
  18. package/src/components/Button/index.story.tsx +1 -95
  19. package/src/components/Button/index.tsx +36 -42
  20. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +4 -111
  21. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +2 -105
  22. package/src/components/Modal/__snapshots__/index.story.storyshot +569 -1621
  23. package/dist/components/Button/StyledButton.d.ts +0 -13
  24. package/dist/components/Button/StyledButton.d.ts.map +0 -1
  25. package/dist/components/Button/lib/variantToBackground.d.ts +0 -3
  26. package/dist/components/Button/lib/variantToBackground.d.ts.map +0 -1
  27. package/dist/components/Button/lib/variantToFont.d.ts +0 -3
  28. package/dist/components/Button/lib/variantToFont.d.ts.map +0 -1
  29. package/src/components/Button/StyledButton.tsx +0 -71
  30. package/src/components/Button/lib/variantToBackground.tsx +0 -19
  31. package/src/components/Button/lib/variantToFont.tsx +0 -19
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Join two class names if propsClassName is defined.
3
+ */
4
+ export declare function useClassNames(defaultClassName: string, propsClassName?: string): string;
5
+ //# sourceMappingURL=useClassNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useClassNames.d.ts","sourceRoot":"","sources":["../../src/_lib/useClassNames.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,aAAa,CAC3B,gBAAgB,EAAE,MAAM,EACxB,cAAc,CAAC,EAAE,MAAM,UAMxB"}
@@ -1,12 +1,15 @@
1
- import { ClickableElement, ClickableProps } from '../Clickable';
2
- export type Variant = 'Primary' | 'Default' | 'Overlay' | 'Danger' | 'Navigation';
3
- export type Size = 'S' | 'M';
4
- export type ButtonProps = Partial<{
5
- variant: Variant;
6
- size: Size;
7
- fullWidth: boolean;
8
- isActive: boolean;
9
- }> & ClickableProps;
10
- declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<ClickableElement>>;
1
+ import './index.css';
2
+ import React, { ReactNode } from 'react';
3
+ type Variant = 'Primary' | 'Default' | 'Overlay' | 'Danger' | 'Navigation';
4
+ type Size = 'S' | 'M';
5
+ export type ButtonProps<T extends React.ElementType = 'button'> = {
6
+ children?: ReactNode;
7
+ variant?: Variant;
8
+ size?: Size;
9
+ fullWidth?: boolean;
10
+ isActive?: boolean;
11
+ as?: T;
12
+ } & Omit<React.ComponentPropsWithRef<T>, 'children'>;
13
+ declare const Button: <T extends React.ElementType<any> = "button">(p: ButtonProps<T>) => JSX.Element;
11
14
  export default Button;
12
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAK/D,MAAM,MAAM,OAAO,GACf,SAAS,GACT,SAAS,GACT,SAAS,GACT,QAAQ,GACR,YAAY,CAAA;AAEhB,MAAM,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,CAAA;AAE5B,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,IAAI,CAAA;IACV,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAC,GACA,cAAc,CAAA;AAEhB,QAAA,MAAM,MAAM,0GA0BV,CAAA;AAEF,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,EAAgB,SAAS,EAAuB,MAAM,OAAO,CAAA;AAI3E,KAAK,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,CAAA;AAE1E,KAAK,IAAI,GAAG,GAAG,GAAG,GAAG,CAAA;AAErB,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI;IAChE,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,EAAE,CAAC,EAAE,CAAC,CAAA;CACP,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAA;AAEpD,QAAA,MAAM,MAAM,sEAyByD,WAAW,CAAA;AAChF,eAAe,MAAM,CAAA"}
@@ -1,7 +1,13 @@
1
- import { ClickableElement } from '../Clickable';
2
- import Button, { ButtonProps } from '.';
1
+ import Button from '.';
3
2
  import { StoryObj } from '@storybook/react';
4
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, ButtonProps & import("react").RefAttributes<ClickableElement>>;
3
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, {
4
+ children?: import("react").ReactNode;
5
+ variant?: ("Primary" | "Default" | "Overlay" | "Danger" | "Navigation") | undefined;
6
+ size?: ("S" | "M") | undefined;
7
+ fullWidth?: boolean | undefined;
8
+ isActive?: boolean | undefined;
9
+ as?: import("react").ElementType<any> | undefined;
10
+ } & Omit<any, "children">>;
5
11
  export default _default;
6
12
  export declare const Default: StoryObj<typeof Button>;
7
13
  export declare const Primary: StoryObj<typeof Button>;
@@ -15,5 +21,4 @@ export declare const Active: StoryObj<typeof Button>;
15
21
  export declare const Link: StoryObj<typeof Button>;
16
22
  export declare const Nihongo: StoryObj<typeof Button>;
17
23
  export declare const Focus: StoryObj<typeof Button>;
18
- export declare const LayoutExample: StoryObj<typeof Button>;
19
24
  //# sourceMappingURL=index.story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.story.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,CAAA;AACvC,OAAO,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;;AAEjD,wBAkBwB;AAExB,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,OAAO,MAAM,CAAM,CAAA;AAElD,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,OAAO,MAAM,CAI3C,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,MAAM,CAI9C,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,OAAO,MAAM,CAI3C,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,OAAO,MAAM,CAI1C,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,QAAQ,CAAC,OAAO,MAAM,CAIzC,CAAA;AAED,eAAO,MAAM,KAAK,E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