@charcoal-ui/react 2.0.0 → 2.1.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 (64) hide show
  1. package/dist/_lib/compat.d.ts +13 -13
  2. package/dist/_lib/index.d.ts +25 -25
  3. package/dist/components/Button/index.d.ts +21 -21
  4. package/dist/components/Button/index.story.d.ts +35 -35
  5. package/dist/components/Checkbox/index.d.ts +20 -20
  6. package/dist/components/Checkbox/index.story.d.ts +15 -15
  7. package/dist/components/Clickable/index.d.ts +18 -18
  8. package/dist/components/Clickable/index.story.d.ts +8 -8
  9. package/dist/components/DropdownSelector/Listbox.d.ts +9 -9
  10. package/dist/components/DropdownSelector/Popover.d.ts +9 -9
  11. package/dist/components/DropdownSelector/index.d.ts +31 -31
  12. package/dist/components/DropdownSelector/index.story.d.ts +21 -21
  13. package/dist/components/FieldLabel/index.d.ts +10 -10
  14. package/dist/components/Icon/index.d.ts +11 -11
  15. package/dist/components/Icon/index.story.d.ts +23 -23
  16. package/dist/components/IconButton/index.d.ts +13 -13
  17. package/dist/components/IconButton/index.story.d.ts +28 -28
  18. package/dist/components/LoadingSpinner/index.d.ts +14 -14
  19. package/dist/components/LoadingSpinner/index.story.d.ts +9 -9
  20. package/dist/components/Modal/ModalPlumbing.d.ts +4 -4
  21. package/dist/components/Modal/index.d.ts +41 -15
  22. package/dist/components/Modal/index.d.ts.map +1 -1
  23. package/dist/components/Modal/index.story.d.ts +32 -32
  24. package/dist/components/MultiSelect/context.d.ts +13 -13
  25. package/dist/components/MultiSelect/index.d.ts +23 -23
  26. package/dist/components/MultiSelect/index.story.d.ts +74 -74
  27. package/dist/components/MultiSelect/index.test.d.ts +1 -1
  28. package/dist/components/Radio/index.d.ts +23 -23
  29. package/dist/components/Radio/index.story.d.ts +33 -33
  30. package/dist/components/Radio/index.test.d.ts +1 -1
  31. package/dist/components/SegmentedControl/RadioGroupContext.d.ts +8 -8
  32. package/dist/components/SegmentedControl/index.d.ts +19 -19
  33. package/dist/components/SegmentedControl/index.story.d.ts +10 -10
  34. package/dist/components/Switch/index.d.ts +15 -15
  35. package/dist/components/Switch/index.story.d.ts +13 -13
  36. package/dist/components/TagItem/index.d.ts +25 -0
  37. package/dist/components/TagItem/index.d.ts.map +1 -0
  38. package/dist/components/TagItem/index.story.d.ts +26 -0
  39. package/dist/components/TagItem/index.story.d.ts.map +1 -0
  40. package/dist/components/TextField/index.d.ts +43 -43
  41. package/dist/components/TextField/index.story.d.ts +29 -29
  42. package/dist/components/a11y.test.d.ts +1 -1
  43. package/dist/core/ComponentAbstraction.d.ts +23 -23
  44. package/dist/core/OverlayProvider.d.ts +2 -0
  45. package/dist/core/OverlayProvider.d.ts.map +1 -0
  46. package/dist/core/SSRProvider.d.ts +1 -1
  47. package/dist/index.cjs +3334 -3290
  48. package/dist/index.cjs.map +1 -1
  49. package/dist/index.d.ts +18 -16
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +4401 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/styled.d.ts +92 -92
  54. package/package.json +17 -15
  55. package/src/components/Modal/index.story.tsx +5 -5
  56. package/src/components/Modal/index.tsx +51 -7
  57. package/src/components/TagItem/index.story.tsx +188 -0
  58. package/src/components/TagItem/index.tsx +176 -0
  59. package/src/core/OverlayProvider.tsx +1 -0
  60. package/src/index.ts +2 -0
  61. package/dist/index.modern.js +0 -4677
  62. package/dist/index.modern.js.map +0 -1
  63. package/dist/index.module.js +0 -4363
  64. package/dist/index.module.js.map +0 -1
package/dist/styled.d.ts CHANGED
@@ -1,93 +1,93 @@
1
- export declare const theme: (spec: (o: Record<string, unknown> & Readonly<{
2
- bg: Record<string, unknown> & {
3
- readonly transparent: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
4
- readonly background1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
5
- readonly background2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
6
- readonly surface1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
7
- readonly surface2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
8
- readonly surface3: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
9
- readonly surface4: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
10
- readonly surface6: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
11
- readonly surface7: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
12
- readonly surface8: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
13
- readonly surface9: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
14
- readonly surface10: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
15
- readonly link1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
16
- readonly link2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
17
- readonly text1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
18
- readonly text2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
19
- readonly text3: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
20
- readonly text4: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
21
- readonly text5: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
22
- readonly icon6: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
23
- readonly brand: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
24
- readonly assertive: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
25
- readonly warning: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
26
- readonly success: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
27
- readonly updatedItem: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
28
- readonly border: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
29
- } & {
30
- readonly surface5: (direction: "to top" | "to bottom" | "to left" | "to right") => import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
31
- readonly callToAction: (direction: "to top" | "to bottom" | "to left" | "to right") => import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
32
- };
33
- font: {
34
- readonly transparent: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
35
- readonly background1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
36
- readonly background2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
37
- readonly surface1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
38
- readonly surface2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
39
- readonly surface3: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
40
- readonly surface4: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
41
- readonly surface6: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
42
- readonly surface7: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
43
- readonly surface8: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
44
- readonly surface9: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
45
- readonly surface10: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
46
- readonly link1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
47
- readonly link2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
48
- readonly text1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
49
- readonly text2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
50
- readonly text3: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
51
- readonly text4: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
52
- readonly text5: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
53
- readonly icon6: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
54
- readonly brand: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
55
- readonly assertive: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
56
- readonly warning: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
57
- readonly success: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
58
- readonly updatedItem: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
59
- readonly border: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
60
- };
61
- }> & {
62
- readonly typography: (size: keyof import("@charcoal-ui/theme").Typography) => import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, "bold" | "monospace" | "preserveHalfLeading">;
63
- } & {
64
- readonly margin: import("@charcoal-ui/styled").ModifiedArgumented<import("@charcoal-ui/styled").Internal, "left" | "right" | "top" | "bottom" | "horizontal" | "vertical" | "all", [0 | "auto" | 4 | 8 | 16 | 24 | 40 | 64 | 104 | 168 | 272 | 440]>;
65
- readonly padding: import("@charcoal-ui/styled").ModifiedArgumented<import("@charcoal-ui/styled").Internal, "left" | "right" | "top" | "bottom" | "horizontal" | "vertical" | "all", [0 | "auto" | 4 | 8 | 16 | 24 | 40 | 64 | 104 | 168 | 272 | 440]>;
66
- } & {
67
- readonly width: Readonly<{
68
- px: (size: 0 | "auto" | 4 | 8 | 16 | 24 | 40 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled").Internal;
69
- column: (span: number) => import("@charcoal-ui/styled").Internal;
70
- auto: import("@charcoal-ui/styled").Internal;
71
- full: import("@charcoal-ui/styled").Internal;
72
- }>;
73
- readonly height: Readonly<{
74
- px: (size: 0 | "auto" | 4 | 8 | 16 | 24 | 40 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled").Internal;
75
- column: (span: number) => import("@charcoal-ui/styled").Internal;
76
- auto: import("@charcoal-ui/styled").Internal;
77
- full: import("@charcoal-ui/styled").Internal;
78
- }>;
79
- } & import("@charcoal-ui/styled").Internal & {
80
- readonly disabled: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, never>;
81
- } & Readonly<{
82
- border: {
83
- readonly default: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, "left" | "right" | "top" | "bottom">;
84
- };
85
- }> & Readonly<{
86
- borderRadius: (radius: "none" | 4 | 8 | 16 | 24 | "oval") => import("@charcoal-ui/styled").Internal;
87
- }> & Readonly<{
88
- outline: {
89
- readonly default: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, "focus">;
90
- readonly assertive: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, "focus">;
91
- };
92
- }>) => import("@charcoal-ui/styled").Internal | (false | null | undefined) | (import("@charcoal-ui/styled").Internal | (false | null | undefined))[]) => import("@charcoal-ui/styled").ThemeProp<import("styled-components").DefaultTheme>;
1
+ export declare const theme: (spec: (o: Record<string, unknown> & Readonly<{
2
+ bg: Record<string, unknown> & {
3
+ readonly transparent: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
4
+ readonly background1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
5
+ readonly background2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
6
+ readonly surface1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
7
+ readonly surface2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
8
+ readonly surface3: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
9
+ readonly surface4: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
10
+ readonly surface6: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
11
+ readonly surface7: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
12
+ readonly surface8: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
13
+ readonly surface9: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
14
+ readonly surface10: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
15
+ readonly link1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
16
+ readonly link2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
17
+ readonly text1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
18
+ readonly text2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
19
+ readonly text3: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
20
+ readonly text4: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
21
+ readonly text5: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
22
+ readonly icon6: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
23
+ readonly brand: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
24
+ readonly assertive: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
25
+ readonly warning: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
26
+ readonly success: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
27
+ readonly updatedItem: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
28
+ readonly border: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
29
+ } & {
30
+ readonly surface5: (direction: "to top" | "to bottom" | "to left" | "to right") => import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
31
+ readonly callToAction: (direction: "to top" | "to bottom" | "to left" | "to right") => import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
32
+ };
33
+ font: {
34
+ readonly transparent: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
35
+ readonly background1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
36
+ readonly background2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
37
+ readonly surface1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
38
+ readonly surface2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
39
+ readonly surface3: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
40
+ readonly surface4: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
41
+ readonly surface6: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
42
+ readonly surface7: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
43
+ readonly surface8: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
44
+ readonly surface9: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
45
+ readonly surface10: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
46
+ readonly link1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
47
+ readonly link2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
48
+ readonly text1: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
49
+ readonly text2: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
50
+ readonly text3: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
51
+ readonly text4: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
52
+ readonly text5: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
53
+ readonly icon6: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
54
+ readonly brand: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
55
+ readonly assertive: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
56
+ readonly warning: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
57
+ readonly success: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
58
+ readonly updatedItem: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
59
+ readonly border: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, keyof import("@charcoal-ui/theme").ThemeEffect>;
60
+ };
61
+ }> & {
62
+ readonly typography: (size: keyof import("@charcoal-ui/theme").Typography) => import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, "bold" | "monospace" | "preserveHalfLeading">;
63
+ } & {
64
+ readonly margin: import("@charcoal-ui/styled").ModifiedArgumented<import("@charcoal-ui/styled").Internal, "horizontal" | "vertical" | "all" | "left" | "right" | "top" | "bottom", [0 | "auto" | 4 | 8 | 16 | 24 | 40 | 64 | 104 | 168 | 272 | 440]>;
65
+ readonly padding: import("@charcoal-ui/styled").ModifiedArgumented<import("@charcoal-ui/styled").Internal, "horizontal" | "vertical" | "all" | "left" | "right" | "top" | "bottom", [0 | "auto" | 4 | 8 | 16 | 24 | 40 | 64 | 104 | 168 | 272 | 440]>;
66
+ } & {
67
+ readonly width: Readonly<{
68
+ px: (size: 0 | "auto" | 4 | 8 | 16 | 24 | 40 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled").Internal;
69
+ column: (span: number) => import("@charcoal-ui/styled").Internal;
70
+ auto: import("@charcoal-ui/styled").Internal;
71
+ full: import("@charcoal-ui/styled").Internal;
72
+ }>;
73
+ readonly height: Readonly<{
74
+ px: (size: 0 | "auto" | 4 | 8 | 16 | 24 | 40 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled").Internal;
75
+ column: (span: number) => import("@charcoal-ui/styled").Internal;
76
+ auto: import("@charcoal-ui/styled").Internal;
77
+ full: import("@charcoal-ui/styled").Internal;
78
+ }>;
79
+ } & import("@charcoal-ui/styled").Internal & {
80
+ readonly disabled: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, never>;
81
+ } & Readonly<{
82
+ border: {
83
+ readonly default: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, "left" | "right" | "top" | "bottom">;
84
+ };
85
+ }> & Readonly<{
86
+ borderRadius: (radius: "none" | 4 | 8 | 16 | 24 | "oval") => import("@charcoal-ui/styled").Internal;
87
+ }> & Readonly<{
88
+ outline: {
89
+ readonly default: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, "focus">;
90
+ readonly assertive: import("@charcoal-ui/styled").Modified<import("@charcoal-ui/styled").Internal, "focus">;
91
+ };
92
+ }>) => import("@charcoal-ui/styled").Internal | (false | null | undefined) | (import("@charcoal-ui/styled").Internal | (false | null | undefined))[]) => import("@charcoal-ui/styled").ThemeProp<import("styled-components").DefaultTheme>;
93
93
  //# sourceMappingURL=styled.d.ts.map
package/package.json CHANGED
@@ -1,21 +1,22 @@
1
1
  {
2
2
  "name": "@charcoal-ui/react",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
- "source": "./src/index.ts",
7
6
  "main": "./dist/index.cjs",
8
- "module": "./dist/index.module.js",
7
+ "module": "./dist/index.js",
9
8
  "exports": {
10
9
  "require": "./dist/index.cjs",
11
- "default": "./dist/index.modern.js"
10
+ "default": "./dist/index.js"
12
11
  },
13
12
  "types": "./dist/index.d.ts",
14
13
  "sideEffects": false,
15
14
  "scripts": {
16
- "build": "microbundle --compress=false -f modern,esm,cjs --tsconfig tsconfig.build.json --jsx React.createElement --jsxFragment React.Fragment",
17
- "typecheck": "tsc --noEmit --project tsconfig.build.json",
18
- "clean": "rimraf dist"
15
+ "build": "run-p --print-label 'build:*'",
16
+ "build:bundle": "FORCE_COLOR=1 tsup",
17
+ "build:dts": "tsc --project tsconfig.build.json --pretty --emitDeclarationOnly",
18
+ "typecheck": "tsc --project tsconfig.build.json --pretty --noEmit",
19
+ "clean": "rimraf dist .tsbuildinfo"
19
20
  },
20
21
  "devDependencies": {
21
22
  "@react-types/switch": "^3.1.2",
@@ -39,24 +40,25 @@
39
40
  "@types/warning": "^3.0.0",
40
41
  "jest-axe": "^5.0.1",
41
42
  "jest-styled-components": "^7.0.8",
42
- "microbundle": "^0.14.2",
43
+ "npm-run-all": "^4.1.5",
43
44
  "react": "^17.0.2",
44
45
  "react-dom": "^17.0.2",
45
46
  "react-router-dom": "^6.2.1",
46
47
  "rimraf": "^3.0.2",
47
48
  "styled-components": "^5.3.3",
49
+ "tsup": "^6.5.0",
48
50
  "typescript": "^4.5.5"
49
51
  },
50
52
  "dependencies": {
51
- "@charcoal-ui/icons": "^2.0.0",
52
- "@charcoal-ui/styled": "^2.0.0",
53
- "@charcoal-ui/theme": "^2.0.0",
54
- "@charcoal-ui/utils": "^2.0.0",
55
- "@react-aria/button": "^3.6.2",
53
+ "@charcoal-ui/icons": "^2.1.0",
54
+ "@charcoal-ui/styled": "^2.1.0",
55
+ "@charcoal-ui/theme": "^2.1.0",
56
+ "@charcoal-ui/utils": "^2.1.0",
57
+ "@react-aria/button": "^3.6.3",
56
58
  "@react-aria/checkbox": "^3.2.3",
57
59
  "@react-aria/dialog": "^3.2.1",
58
60
  "@react-aria/focus": "^3.6.1",
59
- "@react-aria/overlays": "3.9.1",
61
+ "@react-aria/overlays": "^3.12.1",
60
62
  "@react-aria/radio": "^3.4.0",
61
63
  "@react-aria/select": "^3.8.2",
62
64
  "@react-aria/ssr": "^3.3.0",
@@ -84,5 +86,5 @@
84
86
  "url": "https://github.com/pixiv/charcoal.git",
85
87
  "directory": "packages/react"
86
88
  },
87
- "gitHead": "db7ac924cf629faa2913b68e9df440c0127d3d7c"
89
+ "gitHead": "ad3c5f816dfc2ad8b5d6e3a4102fc664db1d9606"
88
90
  }
@@ -46,10 +46,10 @@ const DefaultStory = (args: ModalProps) => {
46
46
  <Button onClick={() => state.open()}>Open Modal</Button>
47
47
 
48
48
  <Modal
49
+ {...args}
49
50
  isOpen={state.isOpen}
50
51
  onClose={() => state.close()}
51
52
  isDismissable
52
- {...args}
53
53
  >
54
54
  <ModalHeader />
55
55
  <ModalBody>
@@ -109,11 +109,11 @@ const FullBottomSheetStory = (args: ModalProps) => {
109
109
  <Button onClick={() => state.open()}>Open Modal</Button>
110
110
 
111
111
  <Modal
112
- isOpen={state.isOpen}
113
- onClose={() => state.close()}
112
+ {...args}
114
113
  isDismissable
115
114
  bottomSheet="full"
116
- {...args}
115
+ isOpen={state.isOpen}
116
+ onClose={() => state.close()}
117
117
  >
118
118
  <ModalHeader />
119
119
  <ModalBody>
@@ -164,11 +164,11 @@ const BottomSheetStory = (args: ModalProps) => {
164
164
  <Button onClick={() => state.open()}>Open Modal</Button>
165
165
 
166
166
  <Modal
167
+ {...args}
167
168
  isOpen={state.isOpen}
168
169
  onClose={() => state.close()}
169
170
  bottomSheet
170
171
  isDismissable
171
- {...args}
172
172
  >
173
173
  <ModalHeader />
174
174
  <ModalBody>
@@ -1,8 +1,8 @@
1
1
  import React, { useContext, useRef } from 'react'
2
2
  import {
3
- OverlayContainer,
4
- OverlayProps,
5
- useModal,
3
+ AriaModalOverlayProps,
4
+ Overlay,
5
+ useModalOverlay,
6
6
  useOverlay,
7
7
  usePreventScroll,
8
8
  } from '@react-aria/overlays'
@@ -19,13 +19,15 @@ import { animated, useTransition, easings } from 'react-spring'
19
19
  import Button, { ButtonProps } from '../Button'
20
20
  import IconButton from '../IconButton'
21
21
 
22
- export type ModalProps = OverlayProps &
22
+ export type ModalProps = AriaModalOverlayProps &
23
23
  AriaDialogProps & {
24
24
  children: React.ReactNode
25
25
  zIndex?: number
26
26
  title: string
27
27
  size?: 'S' | 'M' | 'L'
28
28
  bottomSheet?: boolean | 'full'
29
+ isOpen: boolean
30
+ onClose: () => void
29
31
 
30
32
  // NOTICE: デフォルト値を与えてはならない
31
33
  // (たとえば document.body をデフォルト値にすると SSR できなくなる)
@@ -34,6 +36,30 @@ export type ModalProps = OverlayProps &
34
36
 
35
37
  const DEFAULT_Z_INDEX = 10
36
38
 
39
+ /**
40
+ * モーダルコンポーネント。
41
+ *
42
+ * @example アプリケーションルートで `<OverlayProvider>` で囲った上で利用する
43
+ * ```tsx
44
+ * import {
45
+ * OverlayProvider,
46
+ * Modal,
47
+ * ModalHeader,
48
+ * ModalBody,
49
+ * ModalButtons
50
+ * } from '@charcoal-ui/react'
51
+ *
52
+ * <OverlayProvider>
53
+ * <App>
54
+ * <Modal isOpen={state.isOpen} onClose={() => state.close()} isDismissable>
55
+ * <ModalHeader />
56
+ * <ModalBody>...</ModalBody>
57
+ * <ModalButtons>...</ModalButtons>
58
+ * </Modal>
59
+ * </App>
60
+ * </OverlayProvider>
61
+ * ```
62
+ */
37
63
  export default function Modal({
38
64
  children,
39
65
  zIndex = DEFAULT_Z_INDEX,
@@ -53,7 +79,25 @@ export default function Modal({
53
79
  const { overlayProps, underlayProps } = useOverlay(props, ref)
54
80
 
55
81
  usePreventScroll()
56
- const { modalProps } = useModal()
82
+ const { modalProps } = useModalOverlay(
83
+ props,
84
+ {
85
+ close: onClose,
86
+ isOpen: isOpen,
87
+ // these props are not used actually.
88
+ // https://github.com/adobe/react-spectrum/blob/df14e3fb129b94b310f0397a701b83f006b51dfe/packages/%40react-aria/overlays/src/useModalOverlay.ts
89
+ open: () => {
90
+ // nope
91
+ },
92
+ setOpen: () => {
93
+ // nope
94
+ },
95
+ toggle: () => {
96
+ // nope
97
+ },
98
+ },
99
+ ref
100
+ )
57
101
 
58
102
  const { dialogProps, titleProps } = useDialog(props, ref)
59
103
 
@@ -82,7 +126,7 @@ export default function Modal({
82
126
  return transition(
83
127
  ({ backgroundColor, transform }, item) =>
84
128
  item && (
85
- <OverlayContainer portalContainer={portalContainer}>
129
+ <Overlay>
86
130
  <ModalBackground
87
131
  zIndex={zIndex}
88
132
  {...underlayProps}
@@ -113,7 +157,7 @@ export default function Modal({
113
157
  </ModalDialog>
114
158
  </FocusScope>
115
159
  </ModalBackground>
116
- </OverlayContainer>
160
+ </Overlay>
117
161
  )
118
162
  )
119
163
  }
@@ -0,0 +1,188 @@
1
+ import { action } from '@storybook/addon-actions'
2
+ import React from 'react'
3
+ import styled from 'styled-components'
4
+ import TagItem, { TagItemProps } from '.'
5
+ import { Story } from '../../_lib/compat'
6
+
7
+ export default {
8
+ title: 'TagItem',
9
+ component: TagItem,
10
+ argTypes: {
11
+ bgColor: {
12
+ control: {
13
+ type: 'color',
14
+ },
15
+ },
16
+ },
17
+ }
18
+
19
+ export const Default: Story<TagItemProps> = (props) => {
20
+ return <TagItem {...props} onClick={action('click')} />
21
+ }
22
+ Default.args = {
23
+ label: '#女の子',
24
+ bgColor: '#7ACCB1',
25
+ href: '',
26
+ rel: '',
27
+ target: '',
28
+ }
29
+
30
+ export const Playground: Story<TagItemProps> = ({
31
+ bgColor,
32
+ label,
33
+ translatedLabel,
34
+ }) => {
35
+ return (
36
+ <div>
37
+ <Container>
38
+ <div>
39
+ <TagItem
40
+ label={label}
41
+ size="M"
42
+ status="default"
43
+ bgColor={bgColor}
44
+ onClick={action('click')}
45
+ />
46
+ </div>
47
+ <div />
48
+ <div>
49
+ <TagItem
50
+ label={label}
51
+ translatedLabel={translatedLabel}
52
+ size="M"
53
+ status="default"
54
+ bgColor={bgColor}
55
+ onClick={action('click')}
56
+ />
57
+ </div>
58
+ <div />
59
+ </Container>
60
+ <Container>
61
+ <div>
62
+ <TagItem
63
+ label={label}
64
+ size="M"
65
+ status="active"
66
+ bgColor={bgColor}
67
+ onClick={action('click')}
68
+ />
69
+ </div>
70
+ <div />
71
+ <div>
72
+ <TagItem
73
+ label={label}
74
+ translatedLabel={translatedLabel}
75
+ size="M"
76
+ status="active"
77
+ bgColor={bgColor}
78
+ onClick={action('click')}
79
+ />
80
+ </div>
81
+ <div />
82
+ </Container>
83
+ <Container>
84
+ <div>
85
+ <TagItem
86
+ label={label}
87
+ size="M"
88
+ status="inactive"
89
+ bgColor={bgColor}
90
+ onClick={action('click')}
91
+ />
92
+ </div>
93
+ <div>
94
+ <TagItem
95
+ label={label}
96
+ size="M"
97
+ status="inactive"
98
+ disabled
99
+ bgColor={bgColor}
100
+ onClick={action('click')}
101
+ />
102
+ </div>
103
+ <div>
104
+ <TagItem
105
+ label={label}
106
+ translatedLabel={translatedLabel}
107
+ size="M"
108
+ status="inactive"
109
+ bgColor={bgColor}
110
+ onClick={action('click')}
111
+ />
112
+ </div>
113
+ <div>
114
+ <TagItem
115
+ label={label}
116
+ translatedLabel={translatedLabel}
117
+ size="M"
118
+ status="inactive"
119
+ disabled
120
+ bgColor={bgColor}
121
+ onClick={action('click')}
122
+ />
123
+ </div>
124
+ </Container>
125
+ <Container>
126
+ <div>
127
+ <TagItem
128
+ label={label}
129
+ size="S"
130
+ status="default"
131
+ bgColor={bgColor}
132
+ onClick={action('click')}
133
+ />
134
+ </div>
135
+ </Container>
136
+ <Container>
137
+ <div>
138
+ <TagItem
139
+ label={label}
140
+ size="S"
141
+ status="active"
142
+ bgColor={bgColor}
143
+ onClick={action('click')}
144
+ />
145
+ </div>
146
+ </Container>
147
+ <Container>
148
+ <div>
149
+ <TagItem
150
+ label={label}
151
+ size="S"
152
+ status="inactive"
153
+ bgColor={bgColor}
154
+ onClick={action('click')}
155
+ />
156
+ </div>
157
+ <div>
158
+ <TagItem
159
+ label={label}
160
+ size="S"
161
+ status="inactive"
162
+ disabled
163
+ bgColor={bgColor}
164
+ onClick={action('click')}
165
+ />
166
+ </div>
167
+ </Container>
168
+ </div>
169
+ )
170
+ }
171
+
172
+ const Container = styled.div`
173
+ display: grid;
174
+ grid-template-columns: repeat(4, 1fr);
175
+
176
+ & > div {
177
+ display: flex;
178
+ align-items: center;
179
+ justify-content: center;
180
+ padding: 1em;
181
+ }
182
+ `
183
+
184
+ Playground.args = {
185
+ label: '#女の子',
186
+ translatedLabel: 'girl',
187
+ bgColor: '#7ACCB1',
188
+ }