@seed-design/react 1.1.16 → 1.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 (189) hide show
  1. package/lib/components/AspectRatio/AspectRatio.cjs +53 -0
  2. package/lib/components/AspectRatio/AspectRatio.d.ts +11 -0
  3. package/lib/components/AspectRatio/AspectRatio.d.ts.map +1 -0
  4. package/lib/components/AspectRatio/AspectRatio.js +30 -0
  5. package/lib/components/AspectRatio/index.cjs +9 -0
  6. package/lib/components/AspectRatio/index.d.ts +2 -0
  7. package/lib/components/AspectRatio/index.d.ts.map +1 -0
  8. package/lib/components/AspectRatio/index.js +1 -0
  9. package/lib/components/Avatar/Avatar.cjs +4 -10
  10. package/lib/components/Avatar/Avatar.d.ts +4 -4
  11. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  12. package/lib/components/Avatar/Avatar.js +4 -10
  13. package/lib/components/Checkbox/Checkbox.cjs +10 -0
  14. package/lib/components/Checkbox/Checkbox.d.ts +4 -0
  15. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  16. package/lib/components/Checkbox/Checkbox.js +10 -1
  17. package/lib/components/Checkbox/Checkbox.namespace.cjs +1 -0
  18. package/lib/components/Checkbox/Checkbox.namespace.d.ts +1 -1
  19. package/lib/components/Checkbox/Checkbox.namespace.d.ts.map +1 -1
  20. package/lib/components/Checkbox/Checkbox.namespace.js +1 -1
  21. package/lib/components/Checkbox/index.cjs +1 -0
  22. package/lib/components/Checkbox/index.d.ts +1 -1
  23. package/lib/components/Checkbox/index.d.ts.map +1 -1
  24. package/lib/components/Checkbox/index.js +1 -1
  25. package/lib/components/ChipTabs/ChipTabs.cjs +23 -4
  26. package/lib/components/ChipTabs/ChipTabs.d.ts.map +1 -1
  27. package/lib/components/ChipTabs/ChipTabs.js +23 -4
  28. package/lib/components/Dialog/Dialog.d.ts.map +1 -1
  29. package/lib/components/Fieldset/Fieldset.cjs +86 -0
  30. package/lib/components/Fieldset/Fieldset.d.ts +30 -0
  31. package/lib/components/Fieldset/Fieldset.d.ts.map +1 -0
  32. package/lib/components/Fieldset/Fieldset.js +75 -0
  33. package/lib/components/Fieldset/Fieldset.namespace.cjs +16 -0
  34. package/lib/components/Fieldset/Fieldset.namespace.d.ts +2 -0
  35. package/lib/components/Fieldset/Fieldset.namespace.d.ts.map +1 -0
  36. package/lib/components/Fieldset/Fieldset.namespace.js +1 -0
  37. package/lib/components/Fieldset/index.cjs +18 -0
  38. package/lib/components/Fieldset/index.d.ts +3 -0
  39. package/lib/components/Fieldset/index.d.ts.map +1 -0
  40. package/lib/components/Fieldset/index.js +3 -0
  41. package/lib/components/Grid/Grid.cjs +56 -0
  42. package/lib/components/Grid/Grid.d.ts +41 -0
  43. package/lib/components/Grid/Grid.d.ts.map +1 -0
  44. package/lib/components/Grid/Grid.js +33 -0
  45. package/lib/components/Grid/index.cjs +9 -0
  46. package/lib/components/Grid/index.d.ts +2 -0
  47. package/lib/components/Grid/index.d.ts.map +1 -0
  48. package/lib/components/Grid/index.js +1 -0
  49. package/lib/components/GridItem/GridItem.cjs +45 -0
  50. package/lib/components/GridItem/GridItem.d.ts +35 -0
  51. package/lib/components/GridItem/GridItem.d.ts.map +1 -0
  52. package/lib/components/GridItem/GridItem.js +22 -0
  53. package/lib/components/GridItem/index.cjs +9 -0
  54. package/lib/components/GridItem/index.d.ts +2 -0
  55. package/lib/components/GridItem/index.d.ts.map +1 -0
  56. package/lib/components/GridItem/index.js +1 -0
  57. package/lib/components/HelpBubble/HelpBubble.cjs +5 -0
  58. package/lib/components/HelpBubble/HelpBubble.d.ts +3 -0
  59. package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
  60. package/lib/components/HelpBubble/HelpBubble.js +5 -1
  61. package/lib/components/HelpBubble/HelpBubble.namespace.cjs +1 -0
  62. package/lib/components/HelpBubble/HelpBubble.namespace.d.ts +1 -1
  63. package/lib/components/HelpBubble/HelpBubble.namespace.d.ts.map +1 -1
  64. package/lib/components/HelpBubble/HelpBubble.namespace.js +1 -1
  65. package/lib/components/HelpBubble/index.cjs +1 -0
  66. package/lib/components/HelpBubble/index.d.ts +1 -1
  67. package/lib/components/HelpBubble/index.d.ts.map +1 -1
  68. package/lib/components/HelpBubble/index.js +1 -1
  69. package/lib/components/ImageFrame/ImageFrame.cjs +157 -0
  70. package/lib/components/ImageFrame/ImageFrame.d.ts +51 -0
  71. package/lib/components/ImageFrame/ImageFrame.d.ts.map +1 -0
  72. package/lib/components/ImageFrame/ImageFrame.js +129 -0
  73. package/lib/components/ImageFrame/index.cjs +14 -0
  74. package/lib/components/ImageFrame/index.d.ts +2 -0
  75. package/lib/components/ImageFrame/index.d.ts.map +1 -0
  76. package/lib/components/ImageFrame/index.js +1 -0
  77. package/lib/components/MenuSheet/MenuSheet.cjs +60 -24
  78. package/lib/components/MenuSheet/MenuSheet.d.ts +12 -0
  79. package/lib/components/MenuSheet/MenuSheet.d.ts.map +1 -1
  80. package/lib/components/MenuSheet/MenuSheet.js +57 -25
  81. package/lib/components/MenuSheet/MenuSheet.namespace.cjs +4 -0
  82. package/lib/components/MenuSheet/MenuSheet.namespace.d.ts +1 -1
  83. package/lib/components/MenuSheet/MenuSheet.namespace.d.ts.map +1 -1
  84. package/lib/components/MenuSheet/MenuSheet.namespace.js +1 -1
  85. package/lib/components/MenuSheet/index.cjs +4 -0
  86. package/lib/components/MenuSheet/index.d.ts +1 -1
  87. package/lib/components/MenuSheet/index.d.ts.map +1 -1
  88. package/lib/components/MenuSheet/index.js +1 -1
  89. package/lib/components/RadioGroup/RadioGroup.cjs +4 -1
  90. package/lib/components/RadioGroup/RadioGroup.d.ts +3 -2
  91. package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  92. package/lib/components/RadioGroup/RadioGroup.js +4 -1
  93. package/lib/components/RadioGroupField/RadioGroupField.cjs +79 -0
  94. package/lib/components/RadioGroupField/RadioGroupField.d.ts +30 -0
  95. package/lib/components/RadioGroupField/RadioGroupField.d.ts.map +1 -0
  96. package/lib/components/RadioGroupField/RadioGroupField.js +68 -0
  97. package/lib/components/RadioGroupField/RadioGroupField.namespace.cjs +16 -0
  98. package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts +2 -0
  99. package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts.map +1 -0
  100. package/lib/components/RadioGroupField/RadioGroupField.namespace.js +1 -0
  101. package/lib/components/RadioGroupField/index.cjs +18 -0
  102. package/lib/components/RadioGroupField/index.d.ts +3 -0
  103. package/lib/components/RadioGroupField/index.d.ts.map +1 -0
  104. package/lib/components/RadioGroupField/index.js +3 -0
  105. package/lib/components/SelectBox/CheckSelectBox.cjs +117 -8
  106. package/lib/components/SelectBox/CheckSelectBox.d.ts +38 -10
  107. package/lib/components/SelectBox/CheckSelectBox.d.ts.map +1 -1
  108. package/lib/components/SelectBox/CheckSelectBox.js +113 -10
  109. package/lib/components/SelectBox/CheckSelectBox.namespace.cjs +6 -0
  110. package/lib/components/SelectBox/CheckSelectBox.namespace.d.ts +1 -1
  111. package/lib/components/SelectBox/CheckSelectBox.namespace.d.ts.map +1 -1
  112. package/lib/components/SelectBox/CheckSelectBox.namespace.js +1 -1
  113. package/lib/components/SelectBox/RadioSelectBox.cjs +112 -9
  114. package/lib/components/SelectBox/RadioSelectBox.d.ts +31 -7
  115. package/lib/components/SelectBox/RadioSelectBox.d.ts.map +1 -1
  116. package/lib/components/SelectBox/RadioSelectBox.js +109 -10
  117. package/lib/components/SelectBox/RadioSelectBox.namespace.cjs +5 -1
  118. package/lib/components/SelectBox/RadioSelectBox.namespace.d.ts +1 -1
  119. package/lib/components/SelectBox/RadioSelectBox.namespace.d.ts.map +1 -1
  120. package/lib/components/SelectBox/RadioSelectBox.namespace.js +1 -1
  121. package/lib/components/SelectBox/index.cjs +11 -1
  122. package/lib/components/SelectBox/index.d.ts +2 -2
  123. package/lib/components/SelectBox/index.d.ts.map +1 -1
  124. package/lib/components/SelectBox/index.js +2 -2
  125. package/lib/components/Switch/Switch.cjs +10 -5
  126. package/lib/components/Switch/Switch.d.ts +3 -3
  127. package/lib/components/Switch/Switch.d.ts.map +1 -1
  128. package/lib/components/Switch/Switch.js +10 -5
  129. package/lib/components/TagGroup/TagGroup.cjs +25 -9
  130. package/lib/components/TagGroup/TagGroup.d.ts +5 -1
  131. package/lib/components/TagGroup/TagGroup.d.ts.map +1 -1
  132. package/lib/components/TagGroup/TagGroup.js +25 -10
  133. package/lib/components/TagGroup/TagGroup.namespace.cjs +1 -0
  134. package/lib/components/TagGroup/TagGroup.namespace.d.ts +1 -1
  135. package/lib/components/TagGroup/TagGroup.namespace.d.ts.map +1 -1
  136. package/lib/components/TagGroup/TagGroup.namespace.js +1 -1
  137. package/lib/components/TagGroup/index.cjs +1 -0
  138. package/lib/components/TagGroup/index.d.ts +1 -1
  139. package/lib/components/TagGroup/index.d.ts.map +1 -1
  140. package/lib/components/TagGroup/index.js +1 -1
  141. package/lib/components/index.cjs +53 -1
  142. package/lib/components/index.d.ts +6 -0
  143. package/lib/components/index.d.ts.map +1 -1
  144. package/lib/components/index.js +16 -6
  145. package/lib/index.cjs +53 -1
  146. package/lib/index.js +16 -6
  147. package/lib/utils/styled.cjs +11 -5
  148. package/lib/utils/styled.d.ts +6 -0
  149. package/lib/utils/styled.d.ts.map +1 -1
  150. package/lib/utils/styled.js +11 -5
  151. package/package.json +6 -3
  152. package/src/components/AspectRatio/AspectRatio.tsx +38 -0
  153. package/src/components/AspectRatio/index.ts +1 -0
  154. package/src/components/Avatar/Avatar.tsx +7 -14
  155. package/src/components/Checkbox/Checkbox.namespace.ts +2 -0
  156. package/src/components/Checkbox/Checkbox.tsx +24 -0
  157. package/src/components/Checkbox/index.ts +2 -0
  158. package/src/components/ChipTabs/ChipTabs.tsx +25 -4
  159. package/src/components/Dialog/Dialog.tsx +6 -0
  160. package/src/components/Fieldset/Fieldset.namespace.ts +17 -0
  161. package/src/components/Fieldset/Fieldset.tsx +101 -0
  162. package/src/components/Fieldset/index.ts +19 -0
  163. package/src/components/Grid/Grid.tsx +79 -0
  164. package/src/components/Grid/index.ts +1 -0
  165. package/src/components/GridItem/GridItem.tsx +70 -0
  166. package/src/components/GridItem/index.ts +1 -0
  167. package/src/components/HelpBubble/HelpBubble.namespace.ts +3 -0
  168. package/src/components/HelpBubble/HelpBubble.tsx +7 -2
  169. package/src/components/HelpBubble/index.ts +2 -0
  170. package/src/components/ImageFrame/ImageFrame.tsx +227 -0
  171. package/src/components/ImageFrame/index.ts +14 -0
  172. package/src/components/MenuSheet/MenuSheet.namespace.ts +8 -0
  173. package/src/components/MenuSheet/MenuSheet.tsx +82 -34
  174. package/src/components/MenuSheet/index.ts +8 -0
  175. package/src/components/RadioGroup/RadioGroup.tsx +8 -2
  176. package/src/components/RadioGroupField/RadioGroupField.namespace.ts +18 -0
  177. package/src/components/RadioGroupField/RadioGroupField.tsx +114 -0
  178. package/src/components/RadioGroupField/index.ts +2 -0
  179. package/src/components/SelectBox/CheckSelectBox.namespace.ts +12 -0
  180. package/src/components/SelectBox/CheckSelectBox.tsx +229 -24
  181. package/src/components/SelectBox/RadioSelectBox.namespace.ts +10 -2
  182. package/src/components/SelectBox/RadioSelectBox.tsx +210 -16
  183. package/src/components/SelectBox/index.ts +22 -2
  184. package/src/components/Switch/Switch.tsx +16 -7
  185. package/src/components/TagGroup/TagGroup.namespace.ts +2 -0
  186. package/src/components/TagGroup/TagGroup.tsx +33 -9
  187. package/src/components/TagGroup/index.ts +2 -0
  188. package/src/components/index.ts +6 -0
  189. package/src/utils/styled.tsx +23 -5
@@ -1,29 +1,153 @@
1
- import { selectBox } from "@seed-design/css/recipes/select-box";
2
- import { selectBoxGroup } from "@seed-design/css/recipes/select-box-group";
1
+ import { composeRefs } from "@radix-ui/react-compose-refs";
2
+ import { selectBox, type SelectBoxVariantProps } from "@seed-design/css/recipes/select-box";
3
+ import {
4
+ selectBoxGroup,
5
+ type SelectBoxGroupVariantProps,
6
+ } from "@seed-design/css/recipes/select-box-group";
7
+ import {
8
+ Collapsible,
9
+ CollapsibleProvider,
10
+ useCollapsible,
11
+ useCollapsibleContext,
12
+ } from "@seed-design/react-collapsible";
3
13
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
4
14
  import {
5
15
  RadioGroup as RadioGroupPrimitive,
6
16
  useRadioGroupItemContext,
7
17
  } from "@seed-design/react-radio-group";
8
- import { createRecipeContext } from "../../utils/createRecipeContext";
18
+ import {
19
+ createContext,
20
+ forwardRef,
21
+ useCallback,
22
+ useContext,
23
+ useState,
24
+ type PropsWithChildren,
25
+ } from "react";
9
26
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
10
27
  import { createWithStateProps } from "../../utils/createWithStateProps";
28
+ import clsx from "clsx";
29
+
30
+ const { PropsProvider, ClassNamesProvider, withContext, useProps, useClassNames } =
31
+ createSlotRecipeContext(selectBox);
11
32
 
12
- const { withContext: withGroupContext } = createRecipeContext(selectBoxGroup);
13
- const { withContext, withProvider } = createSlotRecipeContext(selectBox);
14
33
  const withStateProps = createWithStateProps([useRadioGroupItemContext]);
15
34
 
16
- export interface RadioSelectBoxRootProps extends RadioGroupPrimitive.RootProps {}
35
+ const FooterContext = createContext<{
36
+ isFooterRendered: boolean;
37
+ footerRef: (node: HTMLDivElement | null) => void;
38
+ footerVisibility: Exclude<NonNullable<RadioSelectBoxItemProps["footerVisibility"]>, "always">;
39
+ } | null>(null);
40
+
41
+ export interface RadioSelectBoxGroupProps
42
+ extends SelectBoxGroupVariantProps,
43
+ PrimitiveProps,
44
+ React.HTMLAttributes<HTMLDivElement> {
45
+ /**
46
+ * Number of columns in the grid layout. When bigger than 1, child `RadioSelectBoxItem` will have a default layout of "vertical".
47
+ * @default 1
48
+ */
49
+ columns?: number;
50
+ }
17
51
 
18
- export const RadioSelectBoxRoot = withGroupContext<HTMLDivElement, RadioSelectBoxRootProps>(
19
- RadioGroupPrimitive.Root,
52
+ export const RadioSelectBoxGroup = forwardRef<HTMLDivElement, RadioSelectBoxGroupProps>(
53
+ ({ columns = 1, className, style, ...props }, ref) => {
54
+ const [variantProps, otherProps] = selectBoxGroup.splitVariantProps(props);
55
+ const recipeClassName = selectBoxGroup(variantProps);
56
+ const layout = columns === 1 ? "horizontal" : "vertical";
57
+
58
+ return (
59
+ <PropsProvider value={{ layout }}>
60
+ <Primitive.div
61
+ ref={ref}
62
+ data-columns={columns}
63
+ className={clsx(recipeClassName, className)}
64
+ style={
65
+ {
66
+ ...style,
67
+ "--seed-select-box-group--columns": columns,
68
+ } as React.CSSProperties
69
+ }
70
+ {...otherProps}
71
+ />
72
+ </PropsProvider>
73
+ );
74
+ },
20
75
  );
21
76
 
22
- export interface RadioSelectBoxItemProps extends RadioGroupPrimitive.ItemProps {}
77
+ function FooterVisibilityProvider({
78
+ children,
79
+ footerVisibility,
80
+ }: PropsWithChildren<{
81
+ footerVisibility: Exclude<NonNullable<RadioSelectBoxItemProps["footerVisibility"]>, "always">;
82
+ }>) {
83
+ const { checked } = useRadioGroupItemContext();
84
+
85
+ const collapsible = useCollapsible({
86
+ open: {
87
+ "when-selected": checked,
88
+ "when-not-selected": !checked,
89
+ }[footerVisibility],
90
+ });
91
+
92
+ const [isFooterRendered, setIsFooterRendered] = useState(false);
93
+ const footerRef = useCallback((node: HTMLDivElement | null) => {
94
+ setIsFooterRendered(!!node);
95
+ }, []);
96
+
97
+ return (
98
+ <CollapsibleProvider value={collapsible}>
99
+ <FooterContext.Provider value={{ isFooterRendered, footerRef, footerVisibility }}>
100
+ {children}
101
+ </FooterContext.Provider>
102
+ </CollapsibleProvider>
103
+ );
104
+ }
105
+
106
+ export interface RadioSelectBoxItemProps
107
+ extends SelectBoxVariantProps,
108
+ RadioGroupPrimitive.ItemProps {
109
+ /**
110
+ * Controls when the footer is visible.
111
+ * @default "when-selected"
112
+ */
113
+ footerVisibility?: "when-selected" | "when-not-selected" | "always";
114
+ }
23
115
 
24
- export const RadioSelectBoxItem = withProvider<HTMLLabelElement, RadioSelectBoxItemProps>(
25
- RadioGroupPrimitive.Item,
26
- "root",
116
+ export const RadioSelectBoxItem = forwardRef<HTMLLabelElement, RadioSelectBoxItemProps>(
117
+ ({ footerVisibility = "when-selected", className, children, ...props }, ref) => {
118
+ const [variantProps, otherProps] = selectBox.splitVariantProps(props);
119
+ const classNames = selectBox({
120
+ ...useProps(),
121
+ ...variantProps,
122
+ });
123
+
124
+ return (
125
+ <ClassNamesProvider value={classNames}>
126
+ <RadioGroupPrimitive.Item
127
+ ref={ref}
128
+ className={clsx(classNames.root, className)}
129
+ {...otherProps}
130
+ >
131
+ {footerVisibility === "always" ? (
132
+ children
133
+ ) : (
134
+ <FooterVisibilityProvider footerVisibility={footerVisibility}>
135
+ {children}
136
+ </FooterVisibilityProvider>
137
+ )}
138
+ </RadioGroupPrimitive.Item>
139
+ </ClassNamesProvider>
140
+ );
141
+ },
142
+ );
143
+
144
+ export interface RadioSelectBoxTriggerProps
145
+ extends PrimitiveProps,
146
+ React.HTMLAttributes<HTMLDivElement> {}
147
+
148
+ export const RadioSelectBoxTrigger = withContext<HTMLDivElement, RadioSelectBoxTriggerProps>(
149
+ withStateProps(Primitive.div),
150
+ "trigger",
27
151
  );
28
152
 
29
153
  export interface RadioSelectBoxContentProps
@@ -35,20 +159,90 @@ export const RadioSelectBoxContent = withContext<HTMLDivElement, RadioSelectBoxC
35
159
  "content",
36
160
  );
37
161
 
162
+ export interface RadioSelectBoxBodyProps
163
+ extends PrimitiveProps,
164
+ React.HTMLAttributes<HTMLDivElement> {}
165
+
166
+ export const RadioSelectBoxBody = withContext<HTMLDivElement, RadioSelectBoxBodyProps>(
167
+ withStateProps(Primitive.div),
168
+ "body",
169
+ );
170
+
38
171
  export interface RadioSelectBoxLabelProps
39
172
  extends PrimitiveProps,
40
- React.HTMLAttributes<HTMLSpanElement> {}
173
+ React.HTMLAttributes<HTMLDivElement> {}
41
174
 
42
- export const RadioSelectBoxLabel = withContext<HTMLSpanElement, RadioSelectBoxLabelProps>(
175
+ export const RadioSelectBoxLabel = withContext<HTMLDivElement, RadioSelectBoxLabelProps>(
43
176
  withStateProps(Primitive.div),
44
177
  "label",
45
178
  );
46
179
 
47
180
  export interface RadioSelectBoxDescriptionProps
48
181
  extends PrimitiveProps,
49
- React.HTMLAttributes<HTMLSpanElement> {}
182
+ React.HTMLAttributes<HTMLDivElement> {}
50
183
 
51
184
  export const RadioSelectBoxDescription = withContext<
52
- HTMLSpanElement,
185
+ HTMLDivElement,
53
186
  RadioSelectBoxDescriptionProps
54
187
  >(withStateProps(Primitive.div), "description");
188
+
189
+ export interface RadioSelectBoxHiddenInputProps extends RadioGroupPrimitive.ItemHiddenInputProps {}
190
+
191
+ export const RadioSelectBoxHiddenInput = forwardRef<
192
+ HTMLInputElement,
193
+ RadioSelectBoxHiddenInputProps
194
+ >((props, ref) => {
195
+ // when footerVisibility !== "when-selected", this context is automatically unavailable since it's not wrapped in CollapsibleProvider
196
+
197
+ // NOTE: aria-expanded on role="radio" is not officially supported. See: https://github.com/w3c/aria/issues/1404
198
+ // but it helps some screen readers to announce the expanded/collapsed state of the footer.
199
+ // gov.uk applies aria-expanded on the radio input as well. See: https://design-system.service.gov.uk/components/radios/#conditionally-revealing-a-related-question
200
+ const collapsibleContext = useCollapsibleContext({ strict: false });
201
+ const footerContext = useContext(FooterContext);
202
+
203
+ const triggerAriaProps = footerContext?.isFooterRendered
204
+ ? collapsibleContext?.triggerAriaProps
205
+ : undefined;
206
+
207
+ return <RadioGroupPrimitive.ItemHiddenInput ref={ref} {...triggerAriaProps} {...props} />;
208
+ });
209
+ RadioSelectBoxHiddenInput.displayName = "RadioSelectBoxHiddenInput";
210
+
211
+ export interface RadioSelectBoxFooterProps
212
+ extends PrimitiveProps,
213
+ React.HTMLAttributes<HTMLDivElement> {}
214
+
215
+ export const RadioSelectBoxFooter = forwardRef<HTMLDivElement, RadioSelectBoxFooterProps>(
216
+ ({ className, children, ...props }, ref) => {
217
+ const classNames = useClassNames();
218
+ const { stateProps } = useRadioGroupItemContext();
219
+ const collapsibleContext = useCollapsibleContext({ strict: false });
220
+ const footerContext = useContext(FooterContext);
221
+ const composedRef = composeRefs(ref, footerContext?.footerRef ?? null);
222
+
223
+ if (collapsibleContext) {
224
+ return (
225
+ <Collapsible.Content
226
+ ref={composedRef}
227
+ className={clsx(classNames.footer, className)}
228
+ {...stateProps}
229
+ {...props}
230
+ >
231
+ {children}
232
+ </Collapsible.Content>
233
+ );
234
+ }
235
+
236
+ return (
237
+ <Primitive.div
238
+ ref={composedRef}
239
+ className={clsx(classNames.footer, className)}
240
+ {...stateProps}
241
+ {...props}
242
+ >
243
+ {children}
244
+ </Primitive.div>
245
+ );
246
+ },
247
+ );
248
+ RadioSelectBoxFooter.displayName = "RadioSelectBoxFooter";
@@ -1,27 +1,47 @@
1
1
  export {
2
+ CheckSelectBoxBody,
3
+ CheckSelectBoxCheckmarkControl,
4
+ CheckSelectBoxCheckmarkIcon,
2
5
  CheckSelectBoxContent,
3
6
  CheckSelectBoxDescription,
7
+ CheckSelectBoxFooter,
4
8
  CheckSelectBoxGroup,
9
+ CheckSelectBoxHiddenInput,
5
10
  CheckSelectBoxLabel,
6
11
  CheckSelectBoxRoot,
12
+ CheckSelectBoxTrigger,
13
+ type CheckSelectBoxBodyProps,
14
+ type CheckSelectBoxCheckmarkControlProps,
15
+ type CheckSelectBoxCheckmarkIconProps,
7
16
  type CheckSelectBoxContentProps,
8
17
  type CheckSelectBoxDescriptionProps,
18
+ type CheckSelectBoxFooterProps,
9
19
  type CheckSelectBoxGroupProps,
20
+ type CheckSelectBoxHiddenInputProps,
10
21
  type CheckSelectBoxLabelProps,
11
22
  type CheckSelectBoxRootProps,
23
+ type CheckSelectBoxTriggerProps,
12
24
  } from "./CheckSelectBox";
13
25
 
14
26
  export {
27
+ RadioSelectBoxBody,
15
28
  RadioSelectBoxContent,
16
29
  RadioSelectBoxDescription,
30
+ RadioSelectBoxFooter,
31
+ RadioSelectBoxGroup,
32
+ RadioSelectBoxHiddenInput,
17
33
  RadioSelectBoxItem,
18
34
  RadioSelectBoxLabel,
19
- RadioSelectBoxRoot,
35
+ RadioSelectBoxTrigger,
36
+ type RadioSelectBoxBodyProps,
20
37
  type RadioSelectBoxContentProps,
21
38
  type RadioSelectBoxDescriptionProps,
39
+ type RadioSelectBoxFooterProps,
40
+ type RadioSelectBoxGroupProps,
41
+ type RadioSelectBoxHiddenInputProps,
22
42
  type RadioSelectBoxItemProps,
23
43
  type RadioSelectBoxLabelProps,
24
- type RadioSelectBoxRootProps,
44
+ type RadioSelectBoxTriggerProps,
25
45
  } from "./RadioSelectBox";
26
46
 
27
47
  export * as CheckSelectBox from "./CheckSelectBox.namespace";
@@ -1,6 +1,6 @@
1
1
  import { Switch as SwitchPrimitive, useSwitchContext } from "@seed-design/react-switch";
2
2
  import { switchStyle, type SwitchVariantProps } from "@seed-design/css/recipes/switch";
3
- import { switchMark, type SwitchMarkVariantProps } from "@seed-design/css/recipes/switch-mark";
3
+ import { switchmark, type SwitchmarkVariantProps } from "@seed-design/css/recipes/switchmark";
4
4
  import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
5
5
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
6
6
  import { createWithStateProps } from "../../utils/createWithStateProps";
@@ -13,7 +13,7 @@ const {
13
13
  withContext: withControlContext,
14
14
  PropsProvider: ControlPropsProvider,
15
15
  withProvider: withControlProvider,
16
- } = createSlotRecipeContext(switchMark);
16
+ } = createSlotRecipeContext(switchmark);
17
17
  const withStateProps = createWithStateProps([useSwitchContext]);
18
18
 
19
19
  ////////////////////////////////////////////////////////////////////////////////////
@@ -25,27 +25,36 @@ type SwitchVariantDeprecatedSizeProps = "small" | "medium";
25
25
 
26
26
  export interface SwitchRootProps
27
27
  extends Omit<SwitchVariantProps, "size">,
28
- Omit<SwitchMarkVariantProps, "size">,
28
+ Omit<SwitchmarkVariantProps, "size">,
29
29
  SwitchPrimitive.RootProps {
30
30
  size?: SwitchVariantProps["size"] | SwitchVariantDeprecatedSizeProps;
31
31
  }
32
32
 
33
33
  export const SwitchRoot = React.forwardRef<HTMLLabelElement, SwitchRootProps>(
34
34
  ({ className, ...props }, ref) => {
35
- const [{ switch: switchVariantProps, switchMark: switchMarkVariantProps }, otherProps] =
35
+ if (
36
+ process.env.NODE_ENV !== "production" &&
37
+ (props.size === "small" || props.size === "medium")
38
+ ) {
39
+ console.warn(
40
+ `[SEED Design System] Switch size='${props.size}' is deprecated and will be removed in @seed-design/react@1.3.0. Use size='${props.size === "small" ? "16" : "32"}' instead.`,
41
+ );
42
+ }
43
+
44
+ const [{ switch: switchVariantProps, switchmark: switchmarkVariantProps }, otherProps] =
36
45
  splitMultipleVariantsProps(
37
46
  {
38
47
  ...props,
39
48
  // TODO: replace this mapping completely
40
49
  size: props.size === "small" ? "16" : props.size === "medium" ? "32" : props.size,
41
50
  },
42
- { switchMark, switch: switchStyle },
51
+ { switchmark, switch: switchStyle },
43
52
  );
44
53
 
45
54
  const classNames = switchStyle(switchVariantProps);
46
55
 
47
56
  return (
48
- <ControlPropsProvider value={switchMarkVariantProps}>
57
+ <ControlPropsProvider value={switchmarkVariantProps}>
49
58
  <ClassNamesProvider value={classNames}>
50
59
  <SwitchPrimitive.Root
51
60
  ref={ref}
@@ -61,7 +70,7 @@ SwitchRoot.displayName = "SwitchRoot";
61
70
 
62
71
  ////////////////////////////////////////////////////////////////////////////////////
63
72
 
64
- export interface SwitchControlProps extends SwitchMarkVariantProps, SwitchPrimitive.ControlProps {}
73
+ export interface SwitchControlProps extends SwitchmarkVariantProps, SwitchPrimitive.ControlProps {}
65
74
 
66
75
  export const SwitchControl = withControlProvider<HTMLDivElement, SwitchControlProps>(
67
76
  SwitchPrimitive.Control,
@@ -1,6 +1,8 @@
1
1
  export {
2
2
  TagGroupRoot as Root,
3
3
  TagGroupItem as Item,
4
+ TagGroupItemLabel as ItemLabel,
4
5
  type TagGroupRootProps as RootProps,
5
6
  type TagGroupItemProps as ItemProps,
7
+ type TagGroupItemLabelProps as ItemLabelProps,
6
8
  } from "./TagGroup";
@@ -4,13 +4,14 @@ import {
4
4
  tagGroupItem,
5
5
  type TagGroupItemVariantProps,
6
6
  } from "@seed-design/css/recipes/tag-group-item";
7
- import { createRecipeContext } from "../../utils/createRecipeContext";
8
7
  import { forwardRef, Children, Fragment } from "react";
9
8
  import clsx from "clsx";
10
9
  import { splitMultipleVariantsProps } from "../../utils/splitMultipleVariantsProps";
11
- import { mergeProps } from "@seed-design/dom-utils";
10
+ import { useStyleProps, type StyleProps } from "../../utils/styled";
11
+ import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
12
12
 
13
- const { PropsProvider, useProps } = createRecipeContext(tagGroupItem);
13
+ const { PropsProvider, useProps, withContext, ClassNamesProvider } =
14
+ createSlotRecipeContext(tagGroupItem);
14
15
 
15
16
  export interface TagGroupRootProps
16
17
  extends TagGroupVariantProps,
@@ -50,14 +51,37 @@ export const TagGroupRoot = forwardRef<HTMLSpanElement, TagGroupRootProps>(
50
51
 
51
52
  export interface TagGroupItemProps
52
53
  extends TagGroupItemVariantProps,
54
+ Pick<StyleProps, "flexShrink">,
53
55
  PrimitiveProps,
54
56
  React.HTMLAttributes<HTMLSpanElement> {}
55
57
 
56
- export const TagGroupItem = forwardRef<HTMLSpanElement, TagGroupItemProps>((props, ref) => {
57
- const parentVariantProps = useProps();
58
+ export const TagGroupItem = forwardRef<HTMLSpanElement, TagGroupItemProps>(
59
+ ({ className, ...props }, ref) => {
60
+ const parentVariantProps = useProps();
58
61
 
59
- const [variantProps, { className, ...otherProps }] = tagGroupItem.splitVariantProps(props);
60
- const recipeClassName = tagGroupItem(mergeProps(parentVariantProps, variantProps));
62
+ const [variantProps, otherProps] = tagGroupItem.splitVariantProps(props);
63
+ const classNames = tagGroupItem({ ...parentVariantProps, ...variantProps });
61
64
 
62
- return <Primitive.span ref={ref} className={clsx(recipeClassName, className)} {...otherProps} />;
63
- });
65
+ const { style, restProps } = useStyleProps(otherProps);
66
+
67
+ return (
68
+ <ClassNamesProvider value={classNames}>
69
+ <Primitive.span
70
+ ref={ref}
71
+ style={style}
72
+ className={clsx(classNames.root, className)}
73
+ {...restProps}
74
+ />
75
+ </ClassNamesProvider>
76
+ );
77
+ },
78
+ );
79
+
80
+ export interface TagGroupItemLabelProps
81
+ extends PrimitiveProps,
82
+ React.HTMLAttributes<HTMLSpanElement> {}
83
+
84
+ export const TagGroupItemLabel = withContext<HTMLSpanElement, TagGroupItemLabelProps>(
85
+ Primitive.span,
86
+ "label",
87
+ );
@@ -1,8 +1,10 @@
1
1
  export {
2
2
  TagGroupRoot,
3
3
  TagGroupItem,
4
+ TagGroupItemLabel,
4
5
  type TagGroupRootProps,
5
6
  type TagGroupItemProps,
7
+ type TagGroupItemLabelProps,
6
8
  } from "./TagGroup";
7
9
 
8
10
  export * as TagGroup from "./TagGroup.namespace";
@@ -2,6 +2,7 @@ export * from "./ActionButton";
2
2
  export * from "./ActionChip";
3
3
  export * from "./ActionSheet";
4
4
  export * from "./Article";
5
+ export * from "./AspectRatio";
5
6
  export * from "./Avatar";
6
7
  export * from "./Badge";
7
8
  export * from "./BottomSheet";
@@ -23,12 +24,16 @@ export * from "./ExtendedFab";
23
24
  export * from "./Fab";
24
25
  export * from "./Field";
25
26
  export * from "./FieldButton";
27
+ export * from "./Fieldset";
26
28
  export * from "./Flex";
27
29
  export * from "./Float";
28
30
  export * from "./FloatingActionButton";
31
+ export * from "./Grid";
32
+ export * from "./GridItem";
29
33
  export * from "./HelpBubble";
30
34
  export * from "./Icon";
31
35
  export * from "./IdentityPlaceholder";
36
+ export * from "./ImageFrame";
32
37
  export * from "./Inline";
33
38
  export * from "./InlineBanner";
34
39
  export * from "./LinkContent";
@@ -43,6 +48,7 @@ export * from "./Portal";
43
48
  export * from "./ProgressCircle";
44
49
  export * from "./PullToRefresh";
45
50
  export * from "./RadioGroup";
51
+ export * from "./RadioGroupField";
46
52
  export * from "./ReactionButton";
47
53
  export * from "./ResponsivePair";
48
54
  export * from "./ScrollFog";
@@ -105,7 +105,7 @@ function handleDisplay(display: string | undefined) {
105
105
  if (process.env.NODE_ENV !== "production") {
106
106
  if (display === "inlineFlex" || display === "inlineBlock") {
107
107
  console.warn(
108
- `[SEED Design System] ${display} is deprecated. Use inline-flex or inline-block instead.`,
108
+ `[SEED Design System] display='${display}' is deprecated and will be removed in @seed-design/react@1.3.0. Use display='${display === "inlineFlex" ? "inline-flex" : "inline-block"}' instead.`,
109
109
  );
110
110
  }
111
111
  }
@@ -128,7 +128,7 @@ function handleFlexDirection(flexDirection: string | undefined) {
128
128
  if (process.env.NODE_ENV !== "production") {
129
129
  if (flexDirection === "rowReverse" || flexDirection === "columnReverse") {
130
130
  console.warn(
131
- `[SEED Design System] ${flexDirection} is deprecated. Use row-reverse or column-reverse instead.`,
131
+ `[SEED Design System] flexDirection='${flexDirection}' is deprecated and will be removed in @seed-design/react@1.3.0. Use flexDirection='${flexDirection === "rowReverse" ? "row-reverse" : "column-reverse"}' instead.`,
132
132
  );
133
133
  }
134
134
  }
@@ -151,12 +151,12 @@ function handleJustifyContent(justifyContent: string | undefined) {
151
151
  if (process.env.NODE_ENV !== "production") {
152
152
  if (justifyContent === "flexStart" || justifyContent === "flexEnd") {
153
153
  console.warn(
154
- `[SEED Design System] ${justifyContent} is deprecated. Use flex-start or flex-end instead.`,
154
+ `[SEED Design System] justifyContent='${justifyContent}' is deprecated and will be removed in @seed-design/react@1.3.0. Use justifyContent='${justifyContent === "flexStart" ? "flex-start" : "flex-end"}' instead.`,
155
155
  );
156
156
  }
157
157
  if (justifyContent === "spaceBetween" || justifyContent === "spaceAround") {
158
158
  console.warn(
159
- `[SEED Design System] ${justifyContent} is deprecated. Use space-between or space-around instead.`,
159
+ `[SEED Design System] justifyContent='${justifyContent}' is deprecated and will be removed in @seed-design/react@1.3.0. Use justifyContent='${justifyContent === "spaceBetween" ? "space-between" : "space-around"}' instead.`,
160
160
  );
161
161
  }
162
162
  }
@@ -180,7 +180,7 @@ function handleAlignItems(alignItems: string | undefined) {
180
180
  if (process.env.NODE_ENV !== "production") {
181
181
  if (alignItems === "flexStart" || alignItems === "flexEnd") {
182
182
  console.warn(
183
- `[SEED Design System] ${alignItems} is deprecated. Use flex-start or flex-end instead.`,
183
+ `[SEED Design System] alignItems='${alignItems}' is deprecated and will be removed in @seed-design/react@1.3.0. Use alignItems='${alignItems === "flexStart" ? "flex-start" : "flex-end"}' instead.`,
184
184
  );
185
185
  }
186
186
  }
@@ -471,6 +471,11 @@ export interface StyleProps {
471
471
  | "spaceBetween" // @deprecated Use `space-between` instead.
472
472
  | "spaceAround"; // @deprecated Use `space-around` instead.
473
473
 
474
+ /**
475
+ * In flexbox layout, this property is ignored.
476
+ */
477
+ justifySelf?: "center" | "start" | "end" | "stretch";
478
+
474
479
  alignItems?:
475
480
  | "flex-start"
476
481
  | "flex-end"
@@ -497,6 +502,13 @@ export interface StyleProps {
497
502
 
498
503
  gap?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
499
504
 
505
+ // Grid Item
506
+ // NOTE: gridArea는 지원하지 않습니다.
507
+ // grid-area가 grid-column/row의 shorthand이므로 CSS 변수로 동시에 바인딩하면 충돌합니다.
508
+ gridColumn?: string;
509
+
510
+ gridRow?: string;
511
+
500
512
  // NOTE: Not sure how to treat transform/translate right now, mark as unstable until we have a better solution.
501
513
  unstable_transform?: string;
502
514
 
@@ -577,10 +589,13 @@ export function useStyleProps<T extends UseStyleProps>(
577
589
  flexDirection,
578
590
  flexWrap,
579
591
  justifyContent,
592
+ justifySelf,
580
593
  alignItems,
581
594
  alignContent,
582
595
  alignSelf,
583
596
  gap,
597
+ gridColumn,
598
+ gridRow,
584
599
  unstable_transform,
585
600
  _active,
586
601
  style,
@@ -644,9 +659,12 @@ export function useStyleProps<T extends UseStyleProps>(
644
659
  "--seed-box-flex-direction": handleFlexDirection(flexDirection),
645
660
  "--seed-box-flex-wrap": flexWrap === true ? "wrap" : flexWrap,
646
661
  "--seed-box-justify-content": handleJustifyContent(justifyContent),
662
+ "--seed-box-justify-self": justifySelf,
647
663
  "--seed-box-align-items": handleAlignItems(alignItems),
648
664
  "--seed-box-align-content": handleAlignItems(alignContent),
649
665
  "--seed-box-align-self": handleAlignItems(alignSelf),
666
+ "--seed-box-grid-column": gridColumn,
667
+ "--seed-box-grid-row": gridRow,
650
668
  "--seed-box-unstable-transform": unstable_transform,
651
669
 
652
670
  // Active