@charcoal-ui/react 6.0.0-beta.1 → 6.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 (87) hide show
  1. package/dist/components/Icon/index.d.ts +14 -1
  2. package/dist/components/Icon/index.d.ts.map +1 -1
  3. package/dist/components/Pagination/index.d.ts.map +1 -1
  4. package/dist/index.cjs +2 -2
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.css +161 -155
  7. package/dist/index.js +2 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/layered.css +161 -155
  10. package/dist/layered.css.map +1 -1
  11. package/package.json +5 -5
  12. package/src/__tests__/css-output.test.ts +1 -2
  13. package/src/__tests__/css-variables.test.ts +66 -0
  14. package/src/components/Button/__snapshots__/index.css.snap +30 -30
  15. package/src/components/Button/index.css +30 -30
  16. package/src/components/Button/index.story.tsx +18 -0
  17. package/src/components/Checkbox/CheckboxInput/index.css +10 -10
  18. package/src/components/Checkbox/__snapshots__/index.css.snap +1 -1
  19. package/src/components/Checkbox/index.css +1 -1
  20. package/src/components/Checkbox/index.story.tsx +18 -0
  21. package/src/components/Clickable/index.story.tsx +14 -0
  22. package/src/components/DropdownSelector/DropdownMenuItem/index.css +3 -3
  23. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +2 -0
  24. package/src/components/DropdownSelector/ListItem/index.css +1 -1
  25. package/src/components/DropdownSelector/MenuItemGroup/index.css +1 -1
  26. package/src/components/DropdownSelector/Popover/index.css +2 -2
  27. package/src/components/DropdownSelector/__snapshots__/index.css.snap +6 -6
  28. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +26 -13
  29. package/src/components/DropdownSelector/index.css +6 -6
  30. package/src/components/DropdownSelector/index.story.tsx +49 -0
  31. package/src/components/FieldLabel/__snapshots__/index.css.snap +3 -3
  32. package/src/components/FieldLabel/index.css +3 -3
  33. package/src/components/HintText/__snapshots__/index.css.snap +3 -3
  34. package/src/components/HintText/__snapshots__/index.story.storyshot +4 -0
  35. package/src/components/HintText/index.css +3 -3
  36. package/src/components/HintText/index.story.tsx +12 -0
  37. package/src/components/Icon/__snapshots__/index.story.storyshot +2 -0
  38. package/src/components/Icon/index.browser.test.tsx +280 -0
  39. package/src/components/Icon/index.test.tsx +94 -0
  40. package/src/components/Icon/index.tsx +49 -4
  41. package/src/components/IconButton/__snapshots__/index.css.snap +16 -16
  42. package/src/components/IconButton/__snapshots__/index.story.storyshot +6 -0
  43. package/src/components/IconButton/index.css +16 -16
  44. package/src/components/IconButton/index.story.tsx +15 -0
  45. package/src/components/LoadingSpinner/__snapshots__/index.css.snap +7 -7
  46. package/src/components/LoadingSpinner/index.css +7 -7
  47. package/src/components/LoadingSpinner/index.story.tsx +13 -0
  48. package/src/components/Modal/Dialog/index.css +1 -1
  49. package/src/components/Modal/ModalPlumbing.css +1 -1
  50. package/src/components/Modal/__snapshots__/index.css.snap +2 -2
  51. package/src/components/Modal/__snapshots__/index.story.storyshot +12 -2
  52. package/src/components/Modal/index.css +2 -2
  53. package/src/components/Modal/index.story.tsx +20 -0
  54. package/src/components/MultiSelect/__snapshots__/index.css.snap +10 -10
  55. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +32 -0
  56. package/src/components/MultiSelect/index.css +10 -10
  57. package/src/components/MultiSelect/index.story.tsx +50 -0
  58. package/src/components/MultiSelect/index.tsx +1 -1
  59. package/src/components/Pagination/Pagination.story.tsx +11 -0
  60. package/src/components/Pagination/__snapshots__/index.css.snap +12 -15
  61. package/src/components/Pagination/index.css +12 -14
  62. package/src/components/Pagination/index.tsx +2 -1
  63. package/src/components/Radio/RadioInput/index.css +10 -10
  64. package/src/components/Radio/__snapshots__/index.css.snap +1 -1
  65. package/src/components/Radio/index.css +1 -1
  66. package/src/components/Radio/index.story.tsx +40 -0
  67. package/src/components/SegmentedControl/__snapshots__/index.css.snap +4 -4
  68. package/src/components/SegmentedControl/index.css +4 -4
  69. package/src/components/SegmentedControl/index.story.tsx +20 -0
  70. package/src/components/Switch/SwitchInput/index.css +9 -9
  71. package/src/components/Switch/__snapshots__/index.css.snap +1 -1
  72. package/src/components/Switch/index.css +1 -1
  73. package/src/components/Switch/index.story.tsx +19 -0
  74. package/src/components/TagItem/__snapshots__/index.css.snap +5 -4
  75. package/src/components/TagItem/__snapshots__/index.story.storyshot +2 -0
  76. package/src/components/TagItem/index.css +5 -4
  77. package/src/components/TagItem/index.story.tsx +17 -0
  78. package/src/components/TextArea/TextArea.story.tsx +30 -0
  79. package/src/components/TextArea/__snapshots__/index.css.snap +7 -5
  80. package/src/components/TextArea/index.css +8 -5
  81. package/src/components/TextEllipsis/__snapshots__/index.css.snap +3 -0
  82. package/src/components/TextEllipsis/index.css +4 -0
  83. package/src/components/TextField/AssistiveText/index.css +2 -2
  84. package/src/components/TextField/TextField.story.tsx +30 -0
  85. package/src/components/TextField/__snapshots__/TextField.story.storyshot +2 -0
  86. package/src/components/TextField/__snapshots__/index.css.snap +6 -6
  87. package/src/components/TextField/index.css +6 -6
@@ -9,11 +9,14 @@
9
9
  }
10
10
 
11
11
  .charcoal-text-area-container {
12
+ /* Runtime variable overridden by the React component. */
13
+ --charcoal-text-area-rows: 4;
14
+
12
15
  position: relative;
13
16
  overflow: hidden;
14
17
 
15
- color: var(--charcoal-text2);
16
- background-color: var(--charcoal-surface3);
18
+ color: var(--charcoal-color-text-secondary-default);
19
+ background-color: var(--charcoal-color-container-secondary-default-a);
17
20
  border-radius: 4px;
18
21
  transition:
19
22
  0.2s background-color,
@@ -30,7 +33,7 @@
30
33
  }
31
34
 
32
35
  &:not([aria-disabled='true']):hover {
33
- background-color: var(--charcoal-surface3-hover);
36
+ background-color: var(--charcoal-color-container-secondary-hover-a);
34
37
  }
35
38
 
36
39
  &[aria-invalid='true']:focus-within {
@@ -66,7 +69,7 @@
66
69
  }
67
70
 
68
71
  &::placeholder {
69
- color: var(--charcoal-text3);
72
+ color: var(--charcoal-color-text-placeholder-default);
70
73
  }
71
74
  }
72
75
 
@@ -77,5 +80,5 @@
77
80
 
78
81
  line-height: 22px;
79
82
  font-size: 14px;
80
- color: var(--charcoal-text3);
83
+ color: var(--charcoal-color-text-tertiary-default);
81
84
  }
@@ -1,4 +1,7 @@
1
1
  .charcoal-text-ellipsis {
2
+ /* Runtime variables overridden by the React component. */
3
+ --charcoal-text-ellipsis-line-limit: 1;
4
+ --charcoal-text-ellipsis-line-height: inherit;
2
5
  overflow: hidden;
3
6
  overflow-wrap: break-word;
4
7
  display: -webkit-box;
@@ -1,4 +1,8 @@
1
1
  .charcoal-text-ellipsis {
2
+ /* Runtime variables overridden by the React component. */
3
+ --charcoal-text-ellipsis-line-limit: 1;
4
+ --charcoal-text-ellipsis-line-height: inherit;
5
+
2
6
  overflow: hidden;
3
7
  overflow-wrap: break-word;
4
8
  display: -webkit-box;
@@ -2,9 +2,9 @@
2
2
  font-size: 14px;
3
3
  line-height: 22px;
4
4
  margin: 0;
5
- color: var(--charcoal-text2);
5
+ color: var(--charcoal-color-text-secondary-default);
6
6
  }
7
7
 
8
8
  .charcoal-text-field-assistive-text[data-invalid='true'] {
9
- color: var(--charcoal-assertive);
9
+ color: var(--charcoal-color-text-negative-default);
10
10
  }
@@ -79,6 +79,36 @@ export const Invalid: StoryObj<typeof TextField> = {
79
79
  },
80
80
  }
81
81
 
82
+ export const TokenV2: StoryObj<typeof TextField> = {
83
+ parameters: {
84
+ tokenVersion: 'v2',
85
+ },
86
+ render() {
87
+ return (
88
+ <div style={{ display: 'grid', gap: 24, width: 320 }}>
89
+ <TextField
90
+ label="Label"
91
+ showLabel
92
+ required
93
+ requiredText="*必須"
94
+ subLabel={<Clickable>Text Link</Clickable>}
95
+ placeholder="Placeholder"
96
+ assistiveText="説明が入ります"
97
+ showCount
98
+ maxLength={100}
99
+ />
100
+ <TextField
101
+ label="Invalid"
102
+ invalid
103
+ placeholder="Placeholder"
104
+ assistiveText="エラーメッセージ"
105
+ />
106
+ <TextField label="Disabled" disabled value="Disabled value" />
107
+ </div>
108
+ )
109
+ },
110
+ }
111
+
82
112
  export const ReadOnly: StoryObj<typeof TextField> = {
83
113
  render() {
84
114
  return <TextField label="Label" readOnly value="読み取り専用" />
@@ -424,7 +424,9 @@ exports[`Storybook Tests > react/TextField > Prefix 1`] = `
424
424
  style="display: flex; align-items: center;"
425
425
  >
426
426
  <pixiv-icon
427
+ class="charcoal-icon"
427
428
  name="16/Search"
429
+ style="--charcoal-icon-size: 16px;"
428
430
  />
429
431
  </div>
430
432
  </div>
@@ -13,8 +13,8 @@
13
13
  height: 40px;
14
14
  transition: 0.2s background-color,
15
15
  0.2s box-shadow;
16
- color: var(--charcoal-text2);
17
- background-color: var(--charcoal-surface3);
16
+ color: var(--charcoal-color-text-secondary-default);
17
+ background-color: var(--charcoal-color-container-secondary-default-a);
18
18
  border-radius: 4px;
19
19
  padding: 0 8px;
20
20
  line-height: 22px;
@@ -26,7 +26,7 @@
26
26
  }
27
27
 
28
28
  .charcoal-text-field-container:not([aria-disabled='true']):hover {
29
- background-color: var(--charcoal-surface3-hover);
29
+ background-color: var(--charcoal-color-container-secondary-hover-a);
30
30
  }
31
31
 
32
32
  .charcoal-text-field-container:not([aria-disabled='true']):focus-within {
@@ -77,16 +77,16 @@
77
77
  /* Display box-shadow for iOS Safari */
78
78
  appearance: none;
79
79
  background: transparent;
80
- color: var(--charcoal-text2);
80
+ color: var(--charcoal-color-text-secondary-default);
81
81
  }
82
82
 
83
83
  .charcoal-text-field-input::placeholder {
84
- color: var(--charcoal-text3);
84
+ color: var(--charcoal-color-text-placeholder-default);
85
85
  }
86
86
 
87
87
  .charcoal-text-field-line-counter {
88
88
  line-height: 22px;
89
89
  font-size: 14px;
90
- color: var(--charcoal-text3);
90
+ color: var(--charcoal-color-text-tertiary-default);
91
91
  }
92
92
 
@@ -14,8 +14,8 @@
14
14
  transition:
15
15
  0.2s background-color,
16
16
  0.2s box-shadow;
17
- color: var(--charcoal-text2);
18
- background-color: var(--charcoal-surface3);
17
+ color: var(--charcoal-color-text-secondary-default);
18
+ background-color: var(--charcoal-color-container-secondary-default-a);
19
19
  border-radius: 4px;
20
20
  padding: 0 8px;
21
21
  line-height: 22px;
@@ -26,7 +26,7 @@
26
26
  }
27
27
 
28
28
  &:not([aria-disabled='true']):hover {
29
- background-color: var(--charcoal-surface3-hover);
29
+ background-color: var(--charcoal-color-container-secondary-hover-a);
30
30
  }
31
31
 
32
32
  &:not([aria-disabled='true']):focus-within {
@@ -79,15 +79,15 @@
79
79
  appearance: none;
80
80
  background: transparent;
81
81
 
82
- color: var(--charcoal-text2);
82
+ color: var(--charcoal-color-text-secondary-default);
83
83
 
84
84
  &::placeholder {
85
- color: var(--charcoal-text3);
85
+ color: var(--charcoal-color-text-placeholder-default);
86
86
  }
87
87
  }
88
88
 
89
89
  .charcoal-text-field-line-counter {
90
90
  line-height: 22px;
91
91
  font-size: 14px;
92
- color: var(--charcoal-text3);
92
+ color: var(--charcoal-color-text-tertiary-default);
93
93
  }