@charcoal-ui/react 4.0.0-beta.7 → 4.0.0-rc.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 (148) hide show
  1. package/dist/_lib/compat.d.ts +0 -12
  2. package/dist/_lib/compat.d.ts.map +1 -1
  3. package/dist/_lib/createDivComponent.d.ts +2 -2
  4. package/dist/_lib/createDivComponent.d.ts.map +1 -1
  5. package/dist/components/Button/index.d.ts +2 -6
  6. package/dist/components/Button/index.d.ts.map +1 -1
  7. package/dist/components/Clickable/index.d.ts +4 -7
  8. package/dist/components/Clickable/index.d.ts.map +1 -1
  9. package/dist/components/DropdownSelector/Divider/index.d.ts +3 -0
  10. package/dist/components/DropdownSelector/Divider/index.d.ts.map +1 -0
  11. package/dist/components/DropdownSelector/DropdownMenuItem/index.d.ts +8 -0
  12. package/dist/components/DropdownSelector/DropdownMenuItem/index.d.ts.map +1 -0
  13. package/dist/components/DropdownSelector/DropdownPopover.d.ts.map +1 -1
  14. package/dist/components/DropdownSelector/ListItem/index.d.ts +5 -13
  15. package/dist/components/DropdownSelector/ListItem/index.d.ts.map +1 -1
  16. package/dist/components/DropdownSelector/MenuItem/index.d.ts +10 -3
  17. package/dist/components/DropdownSelector/MenuItem/index.d.ts.map +1 -1
  18. package/dist/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.d.ts +1 -1
  19. package/dist/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.d.ts.map +1 -1
  20. package/dist/components/DropdownSelector/MenuItemGroup/index.d.ts +1 -3
  21. package/dist/components/DropdownSelector/MenuItemGroup/index.d.ts.map +1 -1
  22. package/dist/components/DropdownSelector/MenuList/index.d.ts +1 -4
  23. package/dist/components/DropdownSelector/MenuList/index.d.ts.map +1 -1
  24. package/dist/components/DropdownSelector/Popover/index.d.ts +1 -0
  25. package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
  26. package/dist/components/DropdownSelector/index.d.ts +3 -1
  27. package/dist/components/DropdownSelector/index.d.ts.map +1 -1
  28. package/dist/components/IconButton/index.d.ts +1 -2
  29. package/dist/components/IconButton/index.d.ts.map +1 -1
  30. package/dist/components/Modal/Dialog/index.d.ts +1 -1
  31. package/dist/components/Modal/Dialog/index.d.ts.map +1 -1
  32. package/dist/components/Modal/ModalPlumbing.d.ts +6 -6
  33. package/dist/components/Modal/ModalPlumbing.d.ts.map +1 -1
  34. package/dist/components/Modal/index.d.ts.map +1 -1
  35. package/dist/components/Modal/useCustomModalOverlay.d.ts +1 -0
  36. package/dist/components/Modal/useCustomModalOverlay.d.ts.map +1 -1
  37. package/dist/components/Radio/RadioGroup/index.d.ts +20 -0
  38. package/dist/components/Radio/RadioGroup/index.d.ts.map +1 -0
  39. package/dist/components/Radio/RadioGroupContext.d.ts +11 -0
  40. package/dist/components/Radio/RadioGroupContext.d.ts.map +1 -0
  41. package/dist/components/Radio/RadioInput/index.d.ts +10 -0
  42. package/dist/components/Radio/RadioInput/index.d.ts.map +1 -0
  43. package/dist/components/Radio/index.d.ts +1 -12
  44. package/dist/components/Radio/index.d.ts.map +1 -1
  45. package/dist/components/TagItem/index.d.ts +2 -6
  46. package/dist/components/TagItem/index.d.ts.map +1 -1
  47. package/dist/components/TextArea/index.d.ts +1 -1
  48. package/dist/components/TextArea/index.d.ts.map +1 -1
  49. package/dist/components/TextField/AssistiveText/index.d.ts +2 -2
  50. package/dist/components/TextField/AssistiveText/index.d.ts.map +1 -1
  51. package/dist/components/TextField/index.d.ts +3 -3
  52. package/dist/components/TextField/index.d.ts.map +1 -1
  53. package/dist/core/CharcoalProvider.d.ts +4 -11
  54. package/dist/core/CharcoalProvider.d.ts.map +1 -1
  55. package/dist/index.cjs.js +356 -399
  56. package/dist/index.cjs.js.map +1 -1
  57. package/dist/index.css +176 -27
  58. package/dist/index.css.map +1 -1
  59. package/dist/index.d.ts +2 -2
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.esm.js +322 -363
  62. package/dist/index.esm.js.map +1 -1
  63. package/dist/layered.css +1214 -0
  64. package/dist/layered.css.map +1 -0
  65. package/package.json +17 -13
  66. package/src/README.mdx +68 -0
  67. package/src/SSR.mdx +67 -0
  68. package/src/_lib/compat.ts +0 -11
  69. package/src/_lib/index.ts +1 -1
  70. package/src/components/Button/__snapshots__/index.story.storyshot +9 -9
  71. package/src/components/Button/index.tsx +4 -10
  72. package/src/components/Checkbox/CheckboxInput/__snapshots__/index.story.storyshot +5 -5
  73. package/src/components/Checkbox/CheckboxInput/index.css +4 -5
  74. package/src/components/Checkbox/__snapshots__/index.story.storyshot +6 -6
  75. package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -2
  76. package/src/components/Clickable/index.story.tsx +1 -1
  77. package/src/components/Clickable/index.tsx +7 -12
  78. package/src/components/DropdownSelector/Divider/index.css +11 -0
  79. package/src/components/DropdownSelector/Divider/index.tsx +5 -0
  80. package/src/components/DropdownSelector/DropdownMenuItem/index.css +20 -0
  81. package/src/components/DropdownSelector/DropdownMenuItem/index.tsx +34 -0
  82. package/src/components/DropdownSelector/DropdownPopover.tsx +16 -9
  83. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +41 -99
  84. package/src/components/DropdownSelector/ListItem/index.css +24 -0
  85. package/src/components/DropdownSelector/ListItem/index.story.tsx +11 -5
  86. package/src/components/DropdownSelector/ListItem/index.tsx +14 -53
  87. package/src/components/DropdownSelector/MenuItem/index.tsx +17 -12
  88. package/src/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.tsx +2 -2
  89. package/src/components/DropdownSelector/MenuItemGroup/index.css +19 -0
  90. package/src/components/DropdownSelector/MenuItemGroup/index.tsx +6 -28
  91. package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +162 -416
  92. package/src/components/DropdownSelector/MenuList/index.css +4 -0
  93. package/src/components/DropdownSelector/MenuList/index.tsx +4 -12
  94. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +1 -1
  95. package/src/components/DropdownSelector/Popover/index.css +11 -0
  96. package/src/components/DropdownSelector/Popover/index.tsx +6 -15
  97. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +403 -1181
  98. package/src/components/DropdownSelector/index.css +84 -0
  99. package/src/components/DropdownSelector/index.story.tsx +0 -4
  100. package/src/components/DropdownSelector/index.tsx +40 -102
  101. package/src/components/Icon/__snapshots__/index.story.storyshot +1 -1
  102. package/src/components/IconButton/__snapshots__/index.story.storyshot +3 -3
  103. package/src/components/IconButton/index.tsx +3 -6
  104. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +4 -4
  105. package/src/components/Modal/Dialog/index.tsx +2 -1
  106. package/src/components/Modal/__snapshots__/index.story.storyshot +118 -437
  107. package/src/components/Modal/index.story.tsx +26 -11
  108. package/src/components/Modal/index.tsx +5 -6
  109. package/src/components/Modal/useCustomModalOverlay.tsx +20 -0
  110. package/src/components/Radio/RadioGroup/index.css +5 -0
  111. package/src/components/Radio/RadioGroup/index.tsx +80 -0
  112. package/src/components/Radio/RadioGroupContext.ts +23 -0
  113. package/src/components/Radio/RadioInput/index.css +82 -0
  114. package/src/components/Radio/RadioInput/index.tsx +41 -0
  115. package/src/components/Radio/__snapshots__/index.story.storyshot +76 -95
  116. package/src/components/Radio/index.css +2 -81
  117. package/src/components/Radio/index.story.tsx +30 -13
  118. package/src/components/Radio/index.test.tsx +22 -28
  119. package/src/components/Radio/index.tsx +7 -89
  120. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +2 -2
  121. package/src/components/Switch/__snapshots__/index.story.storyshot +4 -4
  122. package/src/components/TagItem/__snapshots__/index.story.storyshot +8 -8
  123. package/src/components/TagItem/index.tsx +4 -8
  124. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +11 -11
  125. package/src/components/TextField/TextField.story.tsx +8 -9
  126. package/src/components/TextField/__snapshots__/TextField.story.storyshot +20 -26
  127. package/src/components/TextField/index.tsx +2 -2
  128. package/src/core/CharcoalProvider.tsx +5 -29
  129. package/src/index.ts +2 -11
  130. package/src/type.d.ts +2 -13
  131. package/dist/components/DropdownSelector/Divider.d.ts +0 -7
  132. package/dist/components/DropdownSelector/Divider.d.ts.map +0 -1
  133. package/dist/components/DropdownSelector/DropdownMenuItem.d.ts +0 -7
  134. package/dist/components/DropdownSelector/DropdownMenuItem.d.ts.map +0 -1
  135. package/dist/components/Modal/__stories__/InternalScrollStory.d.ts +0 -4
  136. package/dist/components/Modal/__stories__/InternalScrollStory.d.ts.map +0 -1
  137. package/dist/core/ComponentAbstraction.d.ts +0 -24
  138. package/dist/core/ComponentAbstraction.d.ts.map +0 -1
  139. package/dist/styled.d.ts +0 -95
  140. package/dist/styled.d.ts.map +0 -1
  141. package/src/components/Button/__snapshots__/index.test.tsx.snap +0 -11
  142. package/src/components/Button/index.test.tsx +0 -32
  143. package/src/components/DropdownSelector/Divider.tsx +0 -16
  144. package/src/components/DropdownSelector/DropdownMenuItem.tsx +0 -43
  145. package/src/components/Modal/__stories__/InternalScrollStory.tsx +0 -75
  146. package/src/components/a11y.test.tsx +0 -99
  147. package/src/core/ComponentAbstraction.tsx +0 -48
  148. package/src/styled.ts +0 -3
@@ -1,24 +0,0 @@
1
- import * as React from 'react';
2
- export type LinkProps = {
3
- /**
4
- * リンクのURL
5
- */
6
- to: string;
7
- } & Omit<React.ComponentPropsWithoutRef<'a'>, 'href'>;
8
- export declare const DefaultLink: React.ForwardRefExoticComponent<{
9
- /**
10
- * リンクのURL
11
- */
12
- to: string;
13
- } & Omit<Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | "css" | keyof React.AnchorHTMLAttributes<HTMLAnchorElement>>, "href"> & React.RefAttributes<HTMLAnchorElement>>;
14
- export interface Components {
15
- Link: React.ComponentType<React.ComponentPropsWithRef<typeof DefaultLink>>;
16
- }
17
- interface Props {
18
- children: React.ReactNode;
19
- components: Partial<Components>;
20
- }
21
- export default function ComponentAbstraction({ children, components }: Props): JSX.Element;
22
- export declare function useComponentAbstraction(): Components;
23
- export {};
24
- //# sourceMappingURL=ComponentAbstraction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComponentAbstraction.d.ts","sourceRoot":"","sources":["../../src/core/ComponentAbstraction.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;CACX,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAA;AAErD,eAAO,MAAM,WAAW;IANtB;;OAEG;QACC,MAAM;gOAWX,CAAA;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,WAAW,CAAC,CAAC,CAAA;CAC3E;AAQD,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;CAChC;AAED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,eAQ3E;AAED,wBAAgB,uBAAuB,eAEtC"}
package/dist/styled.d.ts DELETED
@@ -1,95 +0,0 @@
1
- export declare const theme: (specFn: (o: Record<string, unknown> & Readonly<{
2
- bg: Record<string, unknown> & {
3
- readonly assertive: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
4
- readonly border: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
5
- readonly transparent: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
6
- readonly background1: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
7
- readonly background2: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
8
- readonly surface1: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
9
- readonly surface2: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
10
- readonly surface3: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
11
- readonly surface4: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
12
- readonly surface6: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
13
- readonly surface7: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
14
- readonly surface8: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
15
- readonly surface9: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
16
- readonly surface10: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
17
- readonly link1: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
18
- readonly link2: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
19
- readonly text1: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
20
- readonly text2: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
21
- readonly text3: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
22
- readonly text4: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
23
- readonly text5: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
24
- readonly icon6: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
25
- readonly brand: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
26
- readonly warning: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
27
- readonly success: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
28
- readonly updatedItem: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
29
- } & {
30
- readonly surface5: (direction: "to top" | "to bottom" | "to left" | "to right") => import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
31
- readonly callToAction: (direction: "to top" | "to bottom" | "to left" | "to right") => import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
32
- };
33
- font: {
34
- readonly assertive: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
35
- readonly border: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
36
- readonly transparent: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
37
- readonly background1: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
38
- readonly background2: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
39
- readonly surface1: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
40
- readonly surface2: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
41
- readonly surface3: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
42
- readonly surface4: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
43
- readonly surface6: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
44
- readonly surface7: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
45
- readonly surface8: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
46
- readonly surface9: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
47
- readonly surface10: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
48
- readonly link1: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
49
- readonly link2: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
50
- readonly text1: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
51
- readonly text2: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
52
- readonly text3: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
53
- readonly text4: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
54
- readonly text5: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
55
- readonly icon6: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
56
- readonly brand: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
57
- readonly warning: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
58
- readonly success: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
59
- readonly updatedItem: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
60
- };
61
- }> & {
62
- readonly typography: (size: keyof import("@charcoal-ui/theme").Typography) => import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "bold" | "monospace" | "preserveHalfLeading">;
63
- } & {
64
- readonly margin: import("@charcoal-ui/styled/dist/factories/lib").MethodChain<import("@charcoal-ui/styled/dist/internals").Internal, "horizontal" | "vertical" | "all" | "bottom" | "left" | "right" | "top", [0 | "auto" | 4 | 8 | 16 | 40 | 24 | 64 | 104 | 168 | 272 | 440]>;
65
- readonly padding: import("@charcoal-ui/styled/dist/factories/lib").MethodChain<import("@charcoal-ui/styled/dist/internals").Internal, "horizontal" | "vertical" | "all" | "bottom" | "left" | "right" | "top", [0 | "auto" | 4 | 8 | 16 | 40 | 24 | 64 | 104 | 168 | 272 | 440]>;
66
- } & {
67
- readonly height: Readonly<{
68
- px: (size: 0 | "auto" | 4 | 8 | 16 | 40 | 24 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled/dist/internals").Internal;
69
- column: (span: number) => import("@charcoal-ui/styled/dist/internals").Internal;
70
- auto: import("@charcoal-ui/styled/dist/internals").Internal;
71
- full: import("@charcoal-ui/styled/dist/internals").Internal;
72
- }>;
73
- readonly width: Readonly<{
74
- px: (size: 0 | "auto" | 4 | 8 | 16 | 40 | 24 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled/dist/internals").Internal;
75
- column: (span: number) => import("@charcoal-ui/styled/dist/internals").Internal;
76
- auto: import("@charcoal-ui/styled/dist/internals").Internal;
77
- full: import("@charcoal-ui/styled/dist/internals").Internal;
78
- }>;
79
- } & import("@charcoal-ui/styled/dist/internals").Internal & {
80
- readonly hover: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "press" | "disabled">;
81
- readonly press: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "disabled">;
82
- readonly disabled: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "hover" | "press">;
83
- } & Readonly<{
84
- border: {
85
- readonly default: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "bottom" | "left" | "right" | "top">;
86
- };
87
- }> & Readonly<{
88
- borderRadius: (radius: "none" | 4 | 8 | 16 | 24 | "oval") => import("@charcoal-ui/styled/dist/internals").Internal;
89
- }> & Readonly<{
90
- outline: {
91
- readonly assertive: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "focus">;
92
- readonly default: import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "focus">;
93
- };
94
- }>) => import("@charcoal-ui/styled/dist/util").ArrayOrSingle<import("@charcoal-ui/styled/dist/internals").Internal | (false | null | undefined)>) => import("@charcoal-ui/styled").ThemeProp<import("styled-components").DefaultTheme>;
95
- //# sourceMappingURL=styled.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../src/styled.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sOAAsB,CAAA"}
@@ -1,11 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`<Button /> componentAs props are passed to the data-as attribute 1`] = `
4
- <a
5
- className="charcoal-button"
6
- data-as="componentAs"
7
- data-full-width={true}
8
- href="/"
9
- target="_blank"
10
- />
11
- `;
@@ -1,32 +0,0 @@
1
- import 'jest-styled-components'
2
-
3
- import renderer from 'react-test-renderer'
4
- import Button from '.'
5
-
6
- function Link({
7
- as,
8
- children,
9
- ...props
10
- }: { as: string; children: React.ReactNode } & React.ComponentProps<'a'>) {
11
- return (
12
- <a {...props} data-as={as}>
13
- {children}
14
- </a>
15
- )
16
- }
17
-
18
- describe('<Button />', () => {
19
- test('componentAs props are passed to the data-as attribute', () => {
20
- expect(
21
- renderer.create(
22
- <Button
23
- href="/"
24
- target="_blank"
25
- fullWidth
26
- as={Link}
27
- componentAs="componentAs"
28
- />
29
- )
30
- ).toMatchSnapshot()
31
- })
32
- })
@@ -1,16 +0,0 @@
1
- import styled from 'styled-components'
2
-
3
- /**
4
- * 水平方向の直線
5
- */
6
- export const Divider = styled.div.attrs({ role: 'separator' })`
7
- display: flex;
8
-
9
- &:before {
10
- content: '';
11
- display: block;
12
- width: 100%;
13
- height: 1px;
14
- background: #00000014;
15
- }
16
- `
@@ -1,43 +0,0 @@
1
- import styled from 'styled-components'
2
- import MenuItem, { MenuItemProps } from './MenuItem'
3
- import { MenuListContext } from './MenuList/MenuListContext'
4
- import { useContext } from 'react'
5
- import Icon from '../Icon'
6
-
7
- export type DropdownMenuItemProps = Omit<MenuItemProps<'div'>, 'as'>
8
-
9
- /**
10
- * DropdownSelectorの選択肢として使うMenuItem
11
- */
12
- export default function DropdownMenuItem(props: DropdownMenuItemProps) {
13
- const { value: ctxValue } = useContext(MenuListContext)
14
- const isSelected = props.value === ctxValue
15
- const { children, ...rest } = props
16
-
17
- return (
18
- <MenuItem {...rest}>
19
- {isSelected && <Text2ColorIcon name="16/Check" />}
20
- <StyledSpan isSelected={isSelected}>{props.children}</StyledSpan>
21
- </MenuItem>
22
- )
23
- }
24
-
25
- /**
26
- * アイコンがない時を考慮して20px(16pxのwidthと4pxのgap)の余白をとる
27
- */
28
- const StyledSpan = styled.span<{ isSelected?: boolean }>`
29
- font-size: 14px;
30
- line-height: 22px;
31
- color: var(--charcoal-text2);
32
- padding: 9px 0;
33
-
34
- display: flex;
35
- align-items: center;
36
- width: 100%;
37
- margin-left: ${({ isSelected }) => (isSelected === true ? 0 : 20)}px;
38
- `
39
-
40
- const Text2ColorIcon = styled(Icon)`
41
- color: var(--charcoal-text2);
42
- padding-right: 4px;
43
- `
@@ -1,75 +0,0 @@
1
- import { Story } from '../../../_lib/compat'
2
- import Modal, { BottomSheet, ModalProps } from '..'
3
- import { OverlayProvider } from '@react-aria/overlays'
4
- import { useOverlayTriggerState } from 'react-stately'
5
- import Button from '../../Button'
6
- import { ModalBody, ModalButtons, ModalHeader } from '../ModalPlumbing'
7
- import styled, { css } from 'styled-components'
8
- import { maxWidth } from '@charcoal-ui/utils'
9
-
10
- export const InternalScrollStory: Story<ModalProps> = (args: ModalProps) => {
11
- const state = useOverlayTriggerState({})
12
- return (
13
- <OverlayProvider>
14
- <Button onClick={() => state.open()}>Open Modal</Button>
15
-
16
- <Modal {...args} isOpen={state.isOpen} onClose={() => state.close()}>
17
- <ModalHeader />
18
- <ModalBody>
19
- <ModalBodyOverflowDiv $offset={56} $bottomSheet={args.bottomSheet}>
20
- <div
21
- style={{
22
- height: 1000,
23
- background: `linear-gradient(#e66465, #9198e5)`,
24
- }}
25
- ></div>
26
- </ModalBodyOverflowDiv>
27
- <TopBorderButtons>
28
- <Button fullWidth onClick={() => state.close()}>
29
- Close
30
- </Button>
31
- </TopBorderButtons>
32
- </ModalBody>
33
- </Modal>
34
- </OverlayProvider>
35
- )
36
- }
37
-
38
- // underlay padding-top: 40px (desktop)
39
- // underlay padding-bottom: 40px (desktop)
40
- // modal header: 64px (desktop)
41
- // modal header: 48px (mobile-bottom-sheet)
42
- // modal padding-bottom: 40px
43
- // button and space: 56px
44
- const MAX_HEIGHT_OFFSET = 64 + 40 + 40 + 40
45
- const MAX_HEIGHT_OFFSET_MOBILE = MAX_HEIGHT_OFFSET - 40 * 2 - 16
46
- const ModalBodyOverflowDiv = styled.div<{
47
- $offset: number
48
- $bottomSheet?: BottomSheet
49
- }>`
50
- overflow: auto;
51
- max-height: calc(
52
- 100vh - ${MAX_HEIGHT_OFFSET}px - ${({ $offset }) => $offset}px
53
- );
54
- ${({ $bottomSheet, $offset }) =>
55
- ($bottomSheet === true || $bottomSheet === 'full') &&
56
- css`
57
- @media ${({ theme }) => maxWidth(theme.breakpoint.screen1)} {
58
- max-height: calc(100vh - ${MAX_HEIGHT_OFFSET_MOBILE}px - ${$offset}px);
59
- }
60
- `}
61
- `
62
-
63
- const TopBorderButtons = styled(ModalButtons)`
64
- position: relative;
65
- &::before {
66
- content: '';
67
- pointer-events: none;
68
- border-top: 1px solid ${({ theme }) => theme.border.default.color};
69
- position: absolute;
70
- left: 0;
71
- top: 0;
72
- width: 100%;
73
- height: 100%;
74
- }
75
- `
@@ -1,99 +0,0 @@
1
- import path from 'path'
2
- import * as glob from 'glob'
3
- import { axe, toHaveNoViolations } from 'jest-axe'
4
- import { render } from '@testing-library/react'
5
- import { ThemeProvider } from 'styled-components'
6
- import { Story } from '../_lib/compat'
7
- import ComponentAbstraction, { DefaultLink } from '../core/ComponentAbstraction'
8
- import { light, dark } from '@charcoal-ui/theme'
9
-
10
- expect.extend(toHaveNoViolations)
11
-
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- interface StoryWithMetadata<ArgsType = any> {
14
- filename: string
15
- name: string
16
- story: Story<ArgsType>
17
- args: ArgsType
18
- }
19
-
20
- const stories: StoryWithMetadata[] = glob
21
- .sync(path.resolve(__dirname, '**/*.story.tsx'))
22
- .flatMap((filePath) => {
23
- // eslint-disable-next-line @typescript-eslint/no-var-requires
24
- const exports = require(`./${path.relative(
25
- __dirname,
26
- filePath
27
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
- )}`) as Record<string, any>
29
-
30
- return Object.entries(exports)
31
- .filter(
32
- ([exportName, exportValue]) =>
33
- exportName !== 'default' && typeof exportValue === 'function'
34
- )
35
- .map(([exportName, exportValue]) => ({
36
- filename: path.relative(__dirname, filePath),
37
- name: exportName,
38
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
- story: exportValue as Story<any>,
40
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
41
- args: { ...exports.default.args, ...exportValue.args },
42
- }))
43
- })
44
-
45
- const themes = Object.entries({
46
- light,
47
- dark,
48
- })
49
-
50
- const links = Object.entries({
51
- DefaultLink,
52
- })
53
-
54
- const div = document.body.appendChild(document.createElement('div'))
55
-
56
- beforeEach(() => {
57
- global.IntersectionObserver = jest.fn().mockImplementation(() => ({
58
- observe() {
59
- return null
60
- },
61
- disconnect() {
62
- return null
63
- },
64
- }))
65
-
66
- global.matchMedia = jest.fn().mockImplementation(() => ({
67
- matches: true,
68
- media: '(max-width: 600px)',
69
- addEventListener() {
70
- // Do Nothing
71
- },
72
- removeEventListener() {
73
- // Do Nothing
74
- },
75
- }))
76
- })
77
-
78
- describe.each(themes)('using %s theme', (_name, theme) => {
79
- describe.each(links)('using %s component', (_name, link) => {
80
- describe.each(stories)(
81
- 'storiesOf($filename).add($name)',
82
- ({ story: Story, args }) => {
83
- it('has no accessibility violations', async () => {
84
- expect(() => {
85
- render(
86
- <ThemeProvider theme={theme}>
87
- <ComponentAbstraction components={{ Link: link }}>
88
- <Story {...args} />
89
- </ComponentAbstraction>
90
- </ThemeProvider>
91
- )
92
- }).not.toThrow()
93
-
94
- expect(await axe(div)).toHaveNoViolations()
95
- })
96
- }
97
- )
98
- })
99
- })
@@ -1,48 +0,0 @@
1
- import { useContext } from 'react'
2
- import * as React from 'react'
3
-
4
- export type LinkProps = {
5
- /**
6
- * リンクのURL
7
- */
8
- to: string
9
- } & Omit<React.ComponentPropsWithoutRef<'a'>, 'href'>
10
-
11
- export const DefaultLink = React.forwardRef<HTMLAnchorElement, LinkProps>(
12
- function DefaultLink({ to, children, ...rest }, ref) {
13
- return (
14
- <a href={to} ref={ref} {...rest}>
15
- {children}
16
- </a>
17
- )
18
- }
19
- )
20
-
21
- export interface Components {
22
- Link: React.ComponentType<React.ComponentPropsWithRef<typeof DefaultLink>>
23
- }
24
-
25
- const DefaultValue: Components = {
26
- Link: DefaultLink,
27
- }
28
-
29
- const ComponentAbstractionContext = React.createContext(DefaultValue)
30
-
31
- interface Props {
32
- children: React.ReactNode
33
- components: Partial<Components>
34
- }
35
-
36
- export default function ComponentAbstraction({ children, components }: Props) {
37
- return (
38
- <ComponentAbstractionContext.Provider
39
- value={{ ...DefaultValue, ...components }}
40
- >
41
- {children}
42
- </ComponentAbstractionContext.Provider>
43
- )
44
- }
45
-
46
- export function useComponentAbstraction() {
47
- return useContext(ComponentAbstractionContext)
48
- }
package/src/styled.ts DELETED
@@ -1,3 +0,0 @@
1
- import styled from 'styled-components'
2
- import { createTheme } from '@charcoal-ui/styled'
3
- export const theme = createTheme(styled)