@charcoal-ui/react 2.0.1 → 2.2.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 (72) 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.d.ts.map +1 -1
  20. package/dist/components/LoadingSpinner/index.story.d.ts +9 -9
  21. package/dist/components/Modal/ModalPlumbing.d.ts +4 -4
  22. package/dist/components/Modal/index.d.ts +41 -17
  23. package/dist/components/Modal/index.d.ts.map +1 -1
  24. package/dist/components/Modal/index.story.d.ts +32 -32
  25. package/dist/components/MultiSelect/context.d.ts +13 -13
  26. package/dist/components/MultiSelect/index.d.ts +23 -23
  27. package/dist/components/MultiSelect/index.story.d.ts +74 -74
  28. package/dist/components/MultiSelect/index.test.d.ts +1 -1
  29. package/dist/components/Radio/index.d.ts +23 -23
  30. package/dist/components/Radio/index.d.ts.map +1 -1
  31. package/dist/components/Radio/index.story.d.ts +33 -33
  32. package/dist/components/Radio/index.test.d.ts +1 -1
  33. package/dist/components/SegmentedControl/RadioGroupContext.d.ts +8 -8
  34. package/dist/components/SegmentedControl/index.d.ts +19 -19
  35. package/dist/components/SegmentedControl/index.story.d.ts +10 -10
  36. package/dist/components/Switch/index.d.ts +15 -15
  37. package/dist/components/Switch/index.story.d.ts +13 -13
  38. package/dist/components/TagItem/index.d.ts +25 -0
  39. package/dist/components/TagItem/index.d.ts.map +1 -0
  40. package/dist/components/TagItem/index.story.d.ts +26 -0
  41. package/dist/components/TagItem/index.story.d.ts.map +1 -0
  42. package/dist/components/TextField/index.d.ts +43 -43
  43. package/dist/components/TextField/index.story.d.ts +29 -29
  44. package/dist/components/a11y.test.d.ts +1 -1
  45. package/dist/core/ComponentAbstraction.d.ts +23 -23
  46. package/dist/core/OverlayProvider.d.ts +2 -0
  47. package/dist/core/OverlayProvider.d.ts.map +1 -0
  48. package/dist/core/SSRProvider.d.ts +1 -1
  49. package/dist/index.cjs +3341 -3297
  50. package/dist/index.cjs.map +1 -1
  51. package/dist/index.d.ts +18 -16
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +4409 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/styled.d.ts +92 -92
  56. package/package.json +16 -14
  57. package/src/components/Checkbox/index.tsx +1 -1
  58. package/src/components/DropdownSelector/Listbox.tsx +2 -1
  59. package/src/components/DropdownSelector/index.tsx +6 -2
  60. package/src/components/LoadingSpinner/index.tsx +7 -6
  61. package/src/components/Modal/index.tsx +24 -0
  62. package/src/components/MultiSelect/index.tsx +1 -1
  63. package/src/components/Radio/index.tsx +4 -3
  64. package/src/components/Switch/index.tsx +2 -1
  65. package/src/components/TagItem/index.story.tsx +188 -0
  66. package/src/components/TagItem/index.tsx +176 -0
  67. package/src/core/OverlayProvider.tsx +1 -0
  68. package/src/index.ts +2 -0
  69. package/dist/index.modern.js +0 -4685
  70. package/dist/index.modern.js.map +0 -1
  71. package/dist/index.module.js +0 -4371
  72. 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.1",
3
+ "version": "2.2.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,20 +40,21 @@
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.1",
52
- "@charcoal-ui/styled": "^2.0.1",
53
- "@charcoal-ui/theme": "^2.0.1",
54
- "@charcoal-ui/utils": "^2.0.1",
55
- "@react-aria/button": "^3.6.2",
53
+ "@charcoal-ui/icons": "^2.2.0",
54
+ "@charcoal-ui/styled": "^2.2.0",
55
+ "@charcoal-ui/theme": "^2.2.0",
56
+ "@charcoal-ui/utils": "^2.2.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",
@@ -84,5 +86,5 @@
84
86
  "url": "https://github.com/pixiv/charcoal.git",
85
87
  "directory": "packages/react"
86
88
  },
87
- "gitHead": "0e44e748ea47f54d7ddf6717d0abfd631d8705d6"
89
+ "gitHead": "d68878ef133ffc28dd29e0a7dc497594e71da417"
88
90
  }
@@ -118,5 +118,5 @@ const CheckboxInputOverlay = styled.div<{ checked?: boolean }>`
118
118
  `
119
119
 
120
120
  const InputLabel = styled.div`
121
- ${theme((o) => [o.typography(14)])}
121
+ ${theme((o) => [o.typography(14), o.font.text2])}
122
122
  `
@@ -114,6 +114,7 @@ const OptionRoot = styled.li<{ mode?: ListMode }>`
114
114
  `
115
115
  const OptionCheckIcon = styled(Icon)<{ isSelected: boolean }>`
116
116
  visibility: hidden;
117
+ ${theme((o) => [o.font.text2])}
117
118
 
118
119
  ${({ isSelected }) =>
119
120
  isSelected &&
@@ -123,5 +124,5 @@ const OptionCheckIcon = styled(Icon)<{ isSelected: boolean }>`
123
124
  `
124
125
  const OptionText = styled.span`
125
126
  display: block;
126
- ${theme((o) => [o.typography(14)])}
127
+ ${theme((o) => [o.typography(14), o.font.text2])}
127
128
  `
@@ -121,7 +121,7 @@ const DropdownSelector = <T extends Record<string, unknown>>({
121
121
  : props.placeholder}
122
122
  </DropdownButtonText>
123
123
 
124
- <Icon name="16/Menu" />
124
+ <DropdownButtonIcon name="16/Menu" />
125
125
  </DropdownButton>
126
126
  {state.isOpen && (
127
127
  <DropdownPopover open={state.isOpen} onClose={() => state.close()}>
@@ -196,12 +196,16 @@ const DropdownButtonText = styled.span`
196
196
  ${theme((o) => [o.typography(14), o.font.text2])}
197
197
  `
198
198
 
199
+ const DropdownButtonIcon = styled(Icon)`
200
+ ${theme((o) => [o.font.text2])}
201
+ `
202
+
199
203
  const AssertiveText = styled.div<{ invalid: boolean }>`
200
204
  ${({ invalid }) =>
201
205
  theme((o) => [
202
206
  o.typography(14),
203
207
  o.margin.top(8),
204
- invalid && o.font.assertive,
208
+ invalid ? o.font.assertive : o.font.text2,
205
209
  ])}
206
210
  `
207
211
 
@@ -1,6 +1,6 @@
1
- import { transparentize } from 'polished'
2
1
  import React, { useImperativeHandle, useRef } from 'react'
3
2
  import styled, { keyframes } from 'styled-components'
3
+ import { theme } from '../../styled'
4
4
 
5
5
  export default function LoadingSpinner({
6
6
  size = 48,
@@ -25,11 +25,12 @@ const LoadingSpinnerRoot = styled.div.attrs({ role: 'progressbar' })<{
25
25
  font-size: ${(props) => props.size}px;
26
26
  width: ${(props) => props.size}px;
27
27
  height: ${(props) => props.size}px;
28
- background-color: ${({ theme, transparent }) =>
29
- transparent
30
- ? 'transparent'
31
- : transparentize(0.32, theme.color.background1)};
32
- color: ${({ theme }) => theme.color.text4};
28
+ opacity: 0.84;
29
+ ${({ transparent }) =>
30
+ theme((o) => [
31
+ o.font.text4,
32
+ transparent ? o.bg.transparent : o.bg.background1,
33
+ ])}
33
34
  `
34
35
 
35
36
  const scaleout = keyframes`
@@ -36,6 +36,30 @@ export type ModalProps = AriaModalOverlayProps &
36
36
 
37
37
  const DEFAULT_Z_INDEX = 10
38
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
+ */
39
63
  export default function Modal({
40
64
  children,
41
65
  zIndex = DEFAULT_Z_INDEX,
@@ -93,7 +93,7 @@ const MultiSelectRoot = styled.label`
93
93
  const MultiSelectLabel = styled.div`
94
94
  display: flex;
95
95
  align-items: center;
96
- ${theme((o) => [o.typography(14), o.font.text1])}
96
+ ${theme((o) => [o.typography(14), o.font.text2])}
97
97
  `
98
98
 
99
99
  const MultiSelectInput = styled.input.attrs({ type: 'checkbox' })<{
@@ -76,6 +76,7 @@ export const RadioInput = styled.input.attrs({ type: 'radio' })<{
76
76
  display: block;
77
77
  box-sizing: border-box;
78
78
 
79
+ margin: 0;
79
80
  padding: 6px;
80
81
 
81
82
  width: 20px;
@@ -84,14 +85,14 @@ export const RadioInput = styled.input.attrs({ type: 'radio' })<{
84
85
  ${({ hasError = false }) =>
85
86
  theme((o) => [
86
87
  o.borderRadius('oval'),
87
- o.bg.text5.hover.press,
88
+ o.bg.surface1.hover.press,
88
89
  hasError && o.outline.assertive,
89
90
  ])};
90
91
 
91
92
  &:not(:checked) {
92
93
  border-width: 2px;
93
94
  border-style: solid;
94
- border-color: ${({ theme }) => theme.color.text4};
95
+ border-color: ${({ theme }) => theme.color.text3};
95
96
  }
96
97
 
97
98
  &:checked {
@@ -113,7 +114,7 @@ export const RadioInput = styled.input.attrs({ type: 'radio' })<{
113
114
  `
114
115
 
115
116
  const RadioLabel = styled.div`
116
- ${theme((o) => [o.typography(14)])}
117
+ ${theme((o) => [o.typography(14), o.font.text2])}
117
118
  `
118
119
 
119
120
  export type RadioGroupProps = React.PropsWithChildren<{
@@ -58,6 +58,7 @@ export default function SwitchCheckbox(props: SwitchProps) {
58
58
  const Label = styled.label`
59
59
  display: inline-grid;
60
60
  grid-template-columns: auto 1fr;
61
+ align-items: center;
61
62
  gap: ${({ theme }) => px(theme.spacing[4])};
62
63
  cursor: pointer;
63
64
  outline: 0;
@@ -70,7 +71,7 @@ const Label = styled.label`
70
71
  `
71
72
 
72
73
  const LabelInner = styled.div`
73
- ${theme((o) => o.typography(14))}
74
+ ${theme((o) => [o.typography(14), o.font.text2])}
74
75
  `
75
76
 
76
77
  const SwitchInput = styled.input.attrs({
@@ -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
+ }