@seed-design/react 1.1.17 → 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 (185) 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 +5 -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 +5 -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/Dialog/Dialog.d.ts.map +1 -1
  26. package/lib/components/Fieldset/Fieldset.cjs +86 -0
  27. package/lib/components/Fieldset/Fieldset.d.ts +30 -0
  28. package/lib/components/Fieldset/Fieldset.d.ts.map +1 -0
  29. package/lib/components/Fieldset/Fieldset.js +75 -0
  30. package/lib/components/Fieldset/Fieldset.namespace.cjs +16 -0
  31. package/lib/components/Fieldset/Fieldset.namespace.d.ts +2 -0
  32. package/lib/components/Fieldset/Fieldset.namespace.d.ts.map +1 -0
  33. package/lib/components/Fieldset/Fieldset.namespace.js +1 -0
  34. package/lib/components/Fieldset/index.cjs +18 -0
  35. package/lib/components/Fieldset/index.d.ts +3 -0
  36. package/lib/components/Fieldset/index.d.ts.map +1 -0
  37. package/lib/components/Fieldset/index.js +3 -0
  38. package/lib/components/Grid/Grid.cjs +56 -0
  39. package/lib/components/Grid/Grid.d.ts +41 -0
  40. package/lib/components/Grid/Grid.d.ts.map +1 -0
  41. package/lib/components/Grid/Grid.js +33 -0
  42. package/lib/components/Grid/index.cjs +9 -0
  43. package/lib/components/Grid/index.d.ts +2 -0
  44. package/lib/components/Grid/index.d.ts.map +1 -0
  45. package/lib/components/Grid/index.js +1 -0
  46. package/lib/components/GridItem/GridItem.cjs +45 -0
  47. package/lib/components/GridItem/GridItem.d.ts +35 -0
  48. package/lib/components/GridItem/GridItem.d.ts.map +1 -0
  49. package/lib/components/GridItem/GridItem.js +22 -0
  50. package/lib/components/GridItem/index.cjs +9 -0
  51. package/lib/components/GridItem/index.d.ts +2 -0
  52. package/lib/components/GridItem/index.d.ts.map +1 -0
  53. package/lib/components/GridItem/index.js +1 -0
  54. package/lib/components/HelpBubble/HelpBubble.cjs +5 -0
  55. package/lib/components/HelpBubble/HelpBubble.d.ts +3 -0
  56. package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
  57. package/lib/components/HelpBubble/HelpBubble.js +5 -1
  58. package/lib/components/HelpBubble/HelpBubble.namespace.cjs +1 -0
  59. package/lib/components/HelpBubble/HelpBubble.namespace.d.ts +1 -1
  60. package/lib/components/HelpBubble/HelpBubble.namespace.d.ts.map +1 -1
  61. package/lib/components/HelpBubble/HelpBubble.namespace.js +1 -1
  62. package/lib/components/HelpBubble/index.cjs +1 -0
  63. package/lib/components/HelpBubble/index.d.ts +1 -1
  64. package/lib/components/HelpBubble/index.d.ts.map +1 -1
  65. package/lib/components/HelpBubble/index.js +1 -1
  66. package/lib/components/ImageFrame/ImageFrame.cjs +157 -0
  67. package/lib/components/ImageFrame/ImageFrame.d.ts +51 -0
  68. package/lib/components/ImageFrame/ImageFrame.d.ts.map +1 -0
  69. package/lib/components/ImageFrame/ImageFrame.js +129 -0
  70. package/lib/components/ImageFrame/index.cjs +14 -0
  71. package/lib/components/ImageFrame/index.d.ts +2 -0
  72. package/lib/components/ImageFrame/index.d.ts.map +1 -0
  73. package/lib/components/ImageFrame/index.js +1 -0
  74. package/lib/components/MenuSheet/MenuSheet.cjs +60 -24
  75. package/lib/components/MenuSheet/MenuSheet.d.ts +12 -0
  76. package/lib/components/MenuSheet/MenuSheet.d.ts.map +1 -1
  77. package/lib/components/MenuSheet/MenuSheet.js +57 -25
  78. package/lib/components/MenuSheet/MenuSheet.namespace.cjs +4 -0
  79. package/lib/components/MenuSheet/MenuSheet.namespace.d.ts +1 -1
  80. package/lib/components/MenuSheet/MenuSheet.namespace.d.ts.map +1 -1
  81. package/lib/components/MenuSheet/MenuSheet.namespace.js +1 -1
  82. package/lib/components/MenuSheet/index.cjs +4 -0
  83. package/lib/components/MenuSheet/index.d.ts +1 -1
  84. package/lib/components/MenuSheet/index.d.ts.map +1 -1
  85. package/lib/components/MenuSheet/index.js +1 -1
  86. package/lib/components/RadioGroup/RadioGroup.cjs +4 -1
  87. package/lib/components/RadioGroup/RadioGroup.d.ts +3 -2
  88. package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  89. package/lib/components/RadioGroup/RadioGroup.js +4 -1
  90. package/lib/components/RadioGroupField/RadioGroupField.cjs +79 -0
  91. package/lib/components/RadioGroupField/RadioGroupField.d.ts +30 -0
  92. package/lib/components/RadioGroupField/RadioGroupField.d.ts.map +1 -0
  93. package/lib/components/RadioGroupField/RadioGroupField.js +68 -0
  94. package/lib/components/RadioGroupField/RadioGroupField.namespace.cjs +16 -0
  95. package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts +2 -0
  96. package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts.map +1 -0
  97. package/lib/components/RadioGroupField/RadioGroupField.namespace.js +1 -0
  98. package/lib/components/RadioGroupField/index.cjs +18 -0
  99. package/lib/components/RadioGroupField/index.d.ts +3 -0
  100. package/lib/components/RadioGroupField/index.d.ts.map +1 -0
  101. package/lib/components/RadioGroupField/index.js +3 -0
  102. package/lib/components/SelectBox/CheckSelectBox.cjs +117 -8
  103. package/lib/components/SelectBox/CheckSelectBox.d.ts +38 -10
  104. package/lib/components/SelectBox/CheckSelectBox.d.ts.map +1 -1
  105. package/lib/components/SelectBox/CheckSelectBox.js +113 -10
  106. package/lib/components/SelectBox/CheckSelectBox.namespace.cjs +6 -0
  107. package/lib/components/SelectBox/CheckSelectBox.namespace.d.ts +1 -1
  108. package/lib/components/SelectBox/CheckSelectBox.namespace.d.ts.map +1 -1
  109. package/lib/components/SelectBox/CheckSelectBox.namespace.js +1 -1
  110. package/lib/components/SelectBox/RadioSelectBox.cjs +112 -9
  111. package/lib/components/SelectBox/RadioSelectBox.d.ts +31 -7
  112. package/lib/components/SelectBox/RadioSelectBox.d.ts.map +1 -1
  113. package/lib/components/SelectBox/RadioSelectBox.js +109 -10
  114. package/lib/components/SelectBox/RadioSelectBox.namespace.cjs +5 -1
  115. package/lib/components/SelectBox/RadioSelectBox.namespace.d.ts +1 -1
  116. package/lib/components/SelectBox/RadioSelectBox.namespace.d.ts.map +1 -1
  117. package/lib/components/SelectBox/RadioSelectBox.namespace.js +1 -1
  118. package/lib/components/SelectBox/index.cjs +11 -1
  119. package/lib/components/SelectBox/index.d.ts +2 -2
  120. package/lib/components/SelectBox/index.d.ts.map +1 -1
  121. package/lib/components/SelectBox/index.js +2 -2
  122. package/lib/components/Switch/Switch.cjs +5 -5
  123. package/lib/components/Switch/Switch.d.ts +3 -3
  124. package/lib/components/Switch/Switch.d.ts.map +1 -1
  125. package/lib/components/Switch/Switch.js +5 -5
  126. package/lib/components/TagGroup/TagGroup.cjs +25 -9
  127. package/lib/components/TagGroup/TagGroup.d.ts +5 -1
  128. package/lib/components/TagGroup/TagGroup.d.ts.map +1 -1
  129. package/lib/components/TagGroup/TagGroup.js +25 -10
  130. package/lib/components/TagGroup/TagGroup.namespace.cjs +1 -0
  131. package/lib/components/TagGroup/TagGroup.namespace.d.ts +1 -1
  132. package/lib/components/TagGroup/TagGroup.namespace.d.ts.map +1 -1
  133. package/lib/components/TagGroup/TagGroup.namespace.js +1 -1
  134. package/lib/components/TagGroup/index.cjs +1 -0
  135. package/lib/components/TagGroup/index.d.ts +1 -1
  136. package/lib/components/TagGroup/index.d.ts.map +1 -1
  137. package/lib/components/TagGroup/index.js +1 -1
  138. package/lib/components/index.cjs +53 -1
  139. package/lib/components/index.d.ts +6 -0
  140. package/lib/components/index.d.ts.map +1 -1
  141. package/lib/components/index.js +16 -6
  142. package/lib/index.cjs +53 -1
  143. package/lib/index.js +16 -6
  144. package/lib/utils/styled.cjs +6 -0
  145. package/lib/utils/styled.d.ts +6 -0
  146. package/lib/utils/styled.d.ts.map +1 -1
  147. package/lib/utils/styled.js +6 -0
  148. package/package.json +5 -2
  149. package/src/components/AspectRatio/AspectRatio.tsx +38 -0
  150. package/src/components/AspectRatio/index.ts +1 -0
  151. package/src/components/Avatar/Avatar.tsx +7 -14
  152. package/src/components/Checkbox/Checkbox.namespace.ts +2 -0
  153. package/src/components/Checkbox/Checkbox.tsx +15 -0
  154. package/src/components/Checkbox/index.ts +2 -0
  155. package/src/components/Dialog/Dialog.tsx +6 -0
  156. package/src/components/Fieldset/Fieldset.namespace.ts +17 -0
  157. package/src/components/Fieldset/Fieldset.tsx +101 -0
  158. package/src/components/Fieldset/index.ts +19 -0
  159. package/src/components/Grid/Grid.tsx +79 -0
  160. package/src/components/Grid/index.ts +1 -0
  161. package/src/components/GridItem/GridItem.tsx +70 -0
  162. package/src/components/GridItem/index.ts +1 -0
  163. package/src/components/HelpBubble/HelpBubble.namespace.ts +3 -0
  164. package/src/components/HelpBubble/HelpBubble.tsx +7 -2
  165. package/src/components/HelpBubble/index.ts +2 -0
  166. package/src/components/ImageFrame/ImageFrame.tsx +227 -0
  167. package/src/components/ImageFrame/index.ts +14 -0
  168. package/src/components/MenuSheet/MenuSheet.namespace.ts +8 -0
  169. package/src/components/MenuSheet/MenuSheet.tsx +82 -34
  170. package/src/components/MenuSheet/index.ts +8 -0
  171. package/src/components/RadioGroup/RadioGroup.tsx +8 -2
  172. package/src/components/RadioGroupField/RadioGroupField.namespace.ts +18 -0
  173. package/src/components/RadioGroupField/RadioGroupField.tsx +114 -0
  174. package/src/components/RadioGroupField/index.ts +2 -0
  175. package/src/components/SelectBox/CheckSelectBox.namespace.ts +12 -0
  176. package/src/components/SelectBox/CheckSelectBox.tsx +229 -24
  177. package/src/components/SelectBox/RadioSelectBox.namespace.ts +10 -2
  178. package/src/components/SelectBox/RadioSelectBox.tsx +210 -16
  179. package/src/components/SelectBox/index.ts +22 -2
  180. package/src/components/Switch/Switch.tsx +7 -7
  181. package/src/components/TagGroup/TagGroup.namespace.ts +2 -0
  182. package/src/components/TagGroup/TagGroup.tsx +33 -9
  183. package/src/components/TagGroup/index.ts +2 -0
  184. package/src/components/index.ts +6 -0
  185. package/src/utils/styled.tsx +18 -0
@@ -1 +1 @@
1
- {"version":3,"file":"CheckSelectBox.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/CheckSelectBox.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,IAAI,OAAO,EAChC,yBAAyB,IAAI,WAAW,EACxC,mBAAmB,IAAI,KAAK,EAC5B,mBAAmB,IAAI,KAAK,EAC5B,kBAAkB,IAAI,IAAI,EAC1B,KAAK,0BAA0B,IAAI,YAAY,EAC/C,KAAK,8BAA8B,IAAI,gBAAgB,EACvD,KAAK,wBAAwB,IAAI,UAAU,EAC3C,KAAK,wBAAwB,IAAI,UAAU,EAC3C,KAAK,uBAAuB,IAAI,SAAS,GAC1C,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"CheckSelectBox.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/CheckSelectBox.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,IAAI,IAAI,EAC1B,8BAA8B,IAAI,gBAAgB,EAClD,2BAA2B,IAAI,aAAa,EAC5C,qBAAqB,IAAI,OAAO,EAChC,yBAAyB,IAAI,WAAW,EACxC,oBAAoB,IAAI,MAAM,EAC9B,mBAAmB,IAAI,KAAK,EAC5B,yBAAyB,IAAI,WAAW,EACxC,mBAAmB,IAAI,KAAK,EAC5B,kBAAkB,IAAI,IAAI,EAC1B,qBAAqB,IAAI,OAAO,EAChC,KAAK,uBAAuB,IAAI,SAAS,EACzC,KAAK,mCAAmC,IAAI,qBAAqB,EACjE,KAAK,gCAAgC,IAAI,kBAAkB,EAC3D,KAAK,0BAA0B,IAAI,YAAY,EAC/C,KAAK,8BAA8B,IAAI,gBAAgB,EACvD,KAAK,yBAAyB,IAAI,WAAW,EAC7C,KAAK,wBAAwB,IAAI,UAAU,EAC3C,KAAK,8BAA8B,IAAI,gBAAgB,EACvD,KAAK,wBAAwB,IAAI,UAAU,EAC3C,KAAK,uBAAuB,IAAI,SAAS,EACzC,KAAK,0BAA0B,IAAI,YAAY,GAChD,MAAM,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- export { CheckSelectBoxContent as Content, CheckSelectBoxDescription as Description, CheckSelectBoxGroup as Group, CheckSelectBoxLabel as Label, CheckSelectBoxRoot as Root } from './CheckSelectBox.js';
1
+ export { CheckSelectBoxBody as Body, CheckSelectBoxCheckmarkControl as CheckmarkControl, CheckSelectBoxCheckmarkIcon as CheckmarkIcon, CheckSelectBoxContent as Content, CheckSelectBoxDescription as Description, CheckSelectBoxFooter as Footer, CheckSelectBoxGroup as Group, CheckSelectBoxHiddenInput as HiddenInput, CheckSelectBoxLabel as Label, CheckSelectBoxRoot as Root, CheckSelectBoxTrigger as Trigger } from './CheckSelectBox.js';
@@ -3,36 +3,139 @@
3
3
 
4
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
 
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const reactComposeRefs = require('@radix-ui/react-compose-refs');
6
8
  const selectBox = require('@seed-design/css/recipes/select-box');
7
9
  const selectBoxGroup = require('@seed-design/css/recipes/select-box-group');
10
+ const reactCollapsible = require('@seed-design/react-collapsible');
8
11
  const reactPrimitive = require('@seed-design/react-primitive');
9
12
  const reactRadioGroup = require('@seed-design/react-radio-group');
10
- const createRecipeContext = require('../../utils/createRecipeContext.cjs');
13
+ const React = require('react');
11
14
  const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs');
12
15
  const createWithStateProps = require('../../utils/createWithStateProps.cjs');
16
+ const clsx = require('clsx');
13
17
 
14
- const { withContext: withGroupContext } = createRecipeContext.createRecipeContext(selectBoxGroup.selectBoxGroup);
15
- const { withContext, withProvider } = createSlotRecipeContext.createSlotRecipeContext(selectBox.selectBox);
18
+ const { PropsProvider, ClassNamesProvider, withContext, useProps, useClassNames } = createSlotRecipeContext.createSlotRecipeContext(selectBox.selectBox);
16
19
  const withStateProps = createWithStateProps.createWithStateProps([reactRadioGroup.useRadioGroupItemContext]);
17
- const RadioSelectBoxRoot = withGroupContext(
18
- reactRadioGroup.RadioGroup.Root
20
+ const FooterContext = React.createContext(null);
21
+ const RadioSelectBoxGroup = React.forwardRef(
22
+ ({ columns = 1, className, style, ...props }, ref) => {
23
+ const [variantProps, otherProps] = selectBoxGroup.selectBoxGroup.splitVariantProps(props);
24
+ const recipeClassName = selectBoxGroup.selectBoxGroup(variantProps);
25
+ const layout = columns === 1 ? "horizontal" : "vertical";
26
+ return /* @__PURE__ */ jsxRuntime.jsx(PropsProvider, { value: { layout }, children: /* @__PURE__ */ jsxRuntime.jsx(
27
+ reactPrimitive.Primitive.div,
28
+ {
29
+ ref,
30
+ "data-columns": columns,
31
+ className: clsx(recipeClassName, className),
32
+ style: {
33
+ ...style,
34
+ "--seed-select-box-group--columns": columns
35
+ },
36
+ ...otherProps
37
+ }
38
+ ) });
39
+ }
19
40
  );
20
- const RadioSelectBoxItem = withProvider(
21
- reactRadioGroup.RadioGroup.Item,
22
- "root"
41
+ function FooterVisibilityProvider({
42
+ children,
43
+ footerVisibility
44
+ }) {
45
+ const { checked } = reactRadioGroup.useRadioGroupItemContext();
46
+ const collapsible = reactCollapsible.useCollapsible({
47
+ open: {
48
+ "when-selected": checked,
49
+ "when-not-selected": !checked
50
+ }[footerVisibility]
51
+ });
52
+ const [isFooterRendered, setIsFooterRendered] = React.useState(false);
53
+ const footerRef = React.useCallback((node) => {
54
+ setIsFooterRendered(!!node);
55
+ }, []);
56
+ return /* @__PURE__ */ jsxRuntime.jsx(reactCollapsible.CollapsibleProvider, { value: collapsible, children: /* @__PURE__ */ jsxRuntime.jsx(FooterContext.Provider, { value: { isFooterRendered, footerRef, footerVisibility }, children }) });
57
+ }
58
+ const RadioSelectBoxItem = React.forwardRef(
59
+ ({ footerVisibility = "when-selected", className, children, ...props }, ref) => {
60
+ const [variantProps, otherProps] = selectBox.selectBox.splitVariantProps(props);
61
+ const classNames = selectBox.selectBox({
62
+ ...useProps(),
63
+ ...variantProps
64
+ });
65
+ return /* @__PURE__ */ jsxRuntime.jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsxRuntime.jsx(
66
+ reactRadioGroup.RadioGroup.Item,
67
+ {
68
+ ref,
69
+ className: clsx(classNames.root, className),
70
+ ...otherProps,
71
+ children: footerVisibility === "always" ? children : /* @__PURE__ */ jsxRuntime.jsx(FooterVisibilityProvider, { footerVisibility, children })
72
+ }
73
+ ) });
74
+ }
75
+ );
76
+ const RadioSelectBoxTrigger = withContext(
77
+ withStateProps(reactPrimitive.Primitive.div),
78
+ "trigger"
23
79
  );
24
80
  const RadioSelectBoxContent = withContext(
25
81
  withStateProps(reactPrimitive.Primitive.div),
26
82
  "content"
27
83
  );
84
+ const RadioSelectBoxBody = withContext(
85
+ withStateProps(reactPrimitive.Primitive.div),
86
+ "body"
87
+ );
28
88
  const RadioSelectBoxLabel = withContext(
29
89
  withStateProps(reactPrimitive.Primitive.div),
30
90
  "label"
31
91
  );
32
92
  const RadioSelectBoxDescription = withContext(withStateProps(reactPrimitive.Primitive.div), "description");
93
+ const RadioSelectBoxHiddenInput = React.forwardRef((props, ref) => {
94
+ const collapsibleContext = reactCollapsible.useCollapsibleContext({ strict: false });
95
+ const footerContext = React.useContext(FooterContext);
96
+ const triggerAriaProps = footerContext?.isFooterRendered ? collapsibleContext?.triggerAriaProps : void 0;
97
+ return /* @__PURE__ */ jsxRuntime.jsx(reactRadioGroup.RadioGroup.ItemHiddenInput, { ref, ...triggerAriaProps, ...props });
98
+ });
99
+ RadioSelectBoxHiddenInput.displayName = "RadioSelectBoxHiddenInput";
100
+ const RadioSelectBoxFooter = React.forwardRef(
101
+ ({ className, children, ...props }, ref) => {
102
+ const classNames = useClassNames();
103
+ const { stateProps } = reactRadioGroup.useRadioGroupItemContext();
104
+ const collapsibleContext = reactCollapsible.useCollapsibleContext({ strict: false });
105
+ const footerContext = React.useContext(FooterContext);
106
+ const composedRef = reactComposeRefs.composeRefs(ref, footerContext?.footerRef ?? null);
107
+ if (collapsibleContext) {
108
+ return /* @__PURE__ */ jsxRuntime.jsx(
109
+ reactCollapsible.Collapsible.Content,
110
+ {
111
+ ref: composedRef,
112
+ className: clsx(classNames.footer, className),
113
+ ...stateProps,
114
+ ...props,
115
+ children
116
+ }
117
+ );
118
+ }
119
+ return /* @__PURE__ */ jsxRuntime.jsx(
120
+ reactPrimitive.Primitive.div,
121
+ {
122
+ ref: composedRef,
123
+ className: clsx(classNames.footer, className),
124
+ ...stateProps,
125
+ ...props,
126
+ children
127
+ }
128
+ );
129
+ }
130
+ );
131
+ RadioSelectBoxFooter.displayName = "RadioSelectBoxFooter";
33
132
 
133
+ exports.RadioSelectBoxBody = RadioSelectBoxBody;
34
134
  exports.RadioSelectBoxContent = RadioSelectBoxContent;
35
135
  exports.RadioSelectBoxDescription = RadioSelectBoxDescription;
136
+ exports.RadioSelectBoxFooter = RadioSelectBoxFooter;
137
+ exports.RadioSelectBoxGroup = RadioSelectBoxGroup;
138
+ exports.RadioSelectBoxHiddenInput = RadioSelectBoxHiddenInput;
36
139
  exports.RadioSelectBoxItem = RadioSelectBoxItem;
37
140
  exports.RadioSelectBoxLabel = RadioSelectBoxLabel;
38
- exports.RadioSelectBoxRoot = RadioSelectBoxRoot;
141
+ exports.RadioSelectBoxTrigger = RadioSelectBoxTrigger;
@@ -1,19 +1,43 @@
1
+ import { SelectBoxVariantProps } from '@seed-design/css/recipes/select-box';
2
+ import { SelectBoxGroupVariantProps } from '@seed-design/css/recipes/select-box-group';
1
3
  import { PrimitiveProps } from '@seed-design/react-primitive';
2
4
  import { RadioGroup as RadioGroupPrimitive } from '@seed-design/react-radio-group';
3
5
  import { ForwardRefExoticComponent, RefAttributes } from 'react';
4
- export interface RadioSelectBoxRootProps extends RadioGroupPrimitive.RootProps {
6
+ export interface RadioSelectBoxGroupProps extends SelectBoxGroupVariantProps, PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
7
+ /**
8
+ * Number of columns in the grid layout. When bigger than 1, child `RadioSelectBoxItem` will have a default layout of "vertical".
9
+ * @default 1
10
+ */
11
+ columns?: number;
5
12
  }
6
- export declare const RadioSelectBoxRoot: ForwardRefExoticComponent<RadioSelectBoxRootProps & RefAttributes<HTMLDivElement>>;
7
- export interface RadioSelectBoxItemProps extends RadioGroupPrimitive.ItemProps {
13
+ export declare const RadioSelectBoxGroup: ForwardRefExoticComponent<RadioSelectBoxGroupProps & RefAttributes<HTMLDivElement>>;
14
+ export interface RadioSelectBoxItemProps extends SelectBoxVariantProps, RadioGroupPrimitive.ItemProps {
15
+ /**
16
+ * Controls when the footer is visible.
17
+ * @default "when-selected"
18
+ */
19
+ footerVisibility?: "when-selected" | "when-not-selected" | "always";
8
20
  }
9
21
  export declare const RadioSelectBoxItem: ForwardRefExoticComponent<RadioSelectBoxItemProps & RefAttributes<HTMLLabelElement>>;
22
+ export interface RadioSelectBoxTriggerProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
23
+ }
24
+ export declare const RadioSelectBoxTrigger: ForwardRefExoticComponent<RadioSelectBoxTriggerProps & RefAttributes<HTMLDivElement>>;
10
25
  export interface RadioSelectBoxContentProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
11
26
  }
12
27
  export declare const RadioSelectBoxContent: ForwardRefExoticComponent<RadioSelectBoxContentProps & RefAttributes<HTMLDivElement>>;
13
- export interface RadioSelectBoxLabelProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
28
+ export interface RadioSelectBoxBodyProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
29
+ }
30
+ export declare const RadioSelectBoxBody: ForwardRefExoticComponent<RadioSelectBoxBodyProps & RefAttributes<HTMLDivElement>>;
31
+ export interface RadioSelectBoxLabelProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
32
+ }
33
+ export declare const RadioSelectBoxLabel: ForwardRefExoticComponent<RadioSelectBoxLabelProps & RefAttributes<HTMLDivElement>>;
34
+ export interface RadioSelectBoxDescriptionProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
35
+ }
36
+ export declare const RadioSelectBoxDescription: ForwardRefExoticComponent<RadioSelectBoxDescriptionProps & RefAttributes<HTMLDivElement>>;
37
+ export interface RadioSelectBoxHiddenInputProps extends RadioGroupPrimitive.ItemHiddenInputProps {
14
38
  }
15
- export declare const RadioSelectBoxLabel: ForwardRefExoticComponent<RadioSelectBoxLabelProps & RefAttributes<HTMLSpanElement>>;
16
- export interface RadioSelectBoxDescriptionProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
39
+ export declare const RadioSelectBoxHiddenInput: ForwardRefExoticComponent<RadioSelectBoxHiddenInputProps & RefAttributes<HTMLInputElement>>;
40
+ export interface RadioSelectBoxFooterProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
17
41
  }
18
- export declare const RadioSelectBoxDescription: ForwardRefExoticComponent<RadioSelectBoxDescriptionProps & RefAttributes<HTMLSpanElement>>;
42
+ export declare const RadioSelectBoxFooter: ForwardRefExoticComponent<RadioSelectBoxFooterProps & RefAttributes<HTMLDivElement>>;
19
43
  //# sourceMappingURL=RadioSelectBox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioSelectBox.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/RadioSelectBox.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EACL,UAAU,IAAI,mBAAmB,EAElC,MAAM,gCAAgC,CAAC;AASxC,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB,CAAC,SAAS;CAAG;AAEjF,eAAO,MAAM,kBAAkB,oHAE9B,CAAC;AAEF,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB,CAAC,SAAS;CAAG;AAEjF,eAAO,MAAM,kBAAkB,sHAG9B,CAAC;AAEF,MAAM,WAAW,0BACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,qBAAqB,uHAGjC,CAAC;AAEF,MAAM,WAAW,wBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,mBAAmB,sHAG/B,CAAC;AAEF,MAAM,WAAW,8BACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,yBAAyB,4HAGS,CAAC"}
1
+ {"version":3,"file":"RadioSelectBox.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/RadioSelectBox.tsx"],"names":[],"mappings":";AACA,OAAO,EAAa,KAAK,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,2CAA2C,CAAC;AAOnD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EACL,UAAU,IAAI,mBAAmB,EAElC,MAAM,gCAAgC,CAAC;AAwBxC,MAAM,WAAW,wBACf,SAAQ,0BAA0B,EAChC,cAAc,EACd,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,mBAAmB,qHAuB/B,CAAC;AA+BF,MAAM,WAAW,uBACf,SAAQ,qBAAqB,EAC3B,mBAAmB,CAAC,SAAS;IAC/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,eAAe,GAAG,mBAAmB,GAAG,QAAQ,CAAC;CACrE;AAED,eAAO,MAAM,kBAAkB,sHA0B9B,CAAC;AAEF,MAAM,WAAW,0BACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,qBAAqB,uHAGjC,CAAC;AAEF,MAAM,WAAW,0BACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,qBAAqB,uHAGjC,CAAC;AAEF,MAAM,WAAW,uBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,kBAAkB,oHAG9B,CAAC;AAEF,MAAM,WAAW,wBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,mBAAmB,qHAG/B,CAAC;AAEF,MAAM,WAAW,8BACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,yBAAyB,2HAGS,CAAC;AAEhD,MAAM,WAAW,8BAA+B,SAAQ,mBAAmB,CAAC,oBAAoB;CAAG;AAEnG,eAAO,MAAM,yBAAyB,6HAiBpC,CAAC;AAGH,MAAM,WAAW,yBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,oBAAoB,sHAgChC,CAAC"}
@@ -1,30 +1,129 @@
1
1
  'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { composeRefs } from '@radix-ui/react-compose-refs';
2
4
  import { selectBox } from '@seed-design/css/recipes/select-box';
3
5
  import { selectBoxGroup } from '@seed-design/css/recipes/select-box-group';
6
+ import { useCollapsibleContext, Collapsible, useCollapsible, CollapsibleProvider } from '@seed-design/react-collapsible';
4
7
  import { Primitive } from '@seed-design/react-primitive';
5
- import { RadioGroup, useRadioGroupItemContext } from '@seed-design/react-radio-group';
6
- import { createRecipeContext } from '../../utils/createRecipeContext.js';
8
+ import { useRadioGroupItemContext, RadioGroup } from '@seed-design/react-radio-group';
9
+ import { forwardRef, useContext, createContext, useState, useCallback } from 'react';
7
10
  import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
8
11
  import { createWithStateProps } from '../../utils/createWithStateProps.js';
12
+ import clsx from 'clsx';
9
13
 
10
- const { withContext: withGroupContext } = createRecipeContext(selectBoxGroup);
11
- const { withContext, withProvider } = createSlotRecipeContext(selectBox);
14
+ const { PropsProvider, ClassNamesProvider, withContext, useProps, useClassNames } = createSlotRecipeContext(selectBox);
12
15
  const withStateProps = createWithStateProps([useRadioGroupItemContext]);
13
- const RadioSelectBoxRoot = withGroupContext(
14
- RadioGroup.Root
16
+ const FooterContext = createContext(null);
17
+ const RadioSelectBoxGroup = forwardRef(
18
+ ({ columns = 1, className, style, ...props }, ref) => {
19
+ const [variantProps, otherProps] = selectBoxGroup.splitVariantProps(props);
20
+ const recipeClassName = selectBoxGroup(variantProps);
21
+ const layout = columns === 1 ? "horizontal" : "vertical";
22
+ return /* @__PURE__ */ jsx(PropsProvider, { value: { layout }, children: /* @__PURE__ */ jsx(
23
+ Primitive.div,
24
+ {
25
+ ref,
26
+ "data-columns": columns,
27
+ className: clsx(recipeClassName, className),
28
+ style: {
29
+ ...style,
30
+ "--seed-select-box-group--columns": columns
31
+ },
32
+ ...otherProps
33
+ }
34
+ ) });
35
+ }
15
36
  );
16
- const RadioSelectBoxItem = withProvider(
17
- RadioGroup.Item,
18
- "root"
37
+ function FooterVisibilityProvider({
38
+ children,
39
+ footerVisibility
40
+ }) {
41
+ const { checked } = useRadioGroupItemContext();
42
+ const collapsible = useCollapsible({
43
+ open: {
44
+ "when-selected": checked,
45
+ "when-not-selected": !checked
46
+ }[footerVisibility]
47
+ });
48
+ const [isFooterRendered, setIsFooterRendered] = useState(false);
49
+ const footerRef = useCallback((node) => {
50
+ setIsFooterRendered(!!node);
51
+ }, []);
52
+ return /* @__PURE__ */ jsx(CollapsibleProvider, { value: collapsible, children: /* @__PURE__ */ jsx(FooterContext.Provider, { value: { isFooterRendered, footerRef, footerVisibility }, children }) });
53
+ }
54
+ const RadioSelectBoxItem = forwardRef(
55
+ ({ footerVisibility = "when-selected", className, children, ...props }, ref) => {
56
+ const [variantProps, otherProps] = selectBox.splitVariantProps(props);
57
+ const classNames = selectBox({
58
+ ...useProps(),
59
+ ...variantProps
60
+ });
61
+ return /* @__PURE__ */ jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsx(
62
+ RadioGroup.Item,
63
+ {
64
+ ref,
65
+ className: clsx(classNames.root, className),
66
+ ...otherProps,
67
+ children: footerVisibility === "always" ? children : /* @__PURE__ */ jsx(FooterVisibilityProvider, { footerVisibility, children })
68
+ }
69
+ ) });
70
+ }
71
+ );
72
+ const RadioSelectBoxTrigger = withContext(
73
+ withStateProps(Primitive.div),
74
+ "trigger"
19
75
  );
20
76
  const RadioSelectBoxContent = withContext(
21
77
  withStateProps(Primitive.div),
22
78
  "content"
23
79
  );
80
+ const RadioSelectBoxBody = withContext(
81
+ withStateProps(Primitive.div),
82
+ "body"
83
+ );
24
84
  const RadioSelectBoxLabel = withContext(
25
85
  withStateProps(Primitive.div),
26
86
  "label"
27
87
  );
28
88
  const RadioSelectBoxDescription = withContext(withStateProps(Primitive.div), "description");
89
+ const RadioSelectBoxHiddenInput = forwardRef((props, ref) => {
90
+ const collapsibleContext = useCollapsibleContext({ strict: false });
91
+ const footerContext = useContext(FooterContext);
92
+ const triggerAriaProps = footerContext?.isFooterRendered ? collapsibleContext?.triggerAriaProps : void 0;
93
+ return /* @__PURE__ */ jsx(RadioGroup.ItemHiddenInput, { ref, ...triggerAriaProps, ...props });
94
+ });
95
+ RadioSelectBoxHiddenInput.displayName = "RadioSelectBoxHiddenInput";
96
+ const RadioSelectBoxFooter = forwardRef(
97
+ ({ className, children, ...props }, ref) => {
98
+ const classNames = useClassNames();
99
+ const { stateProps } = useRadioGroupItemContext();
100
+ const collapsibleContext = useCollapsibleContext({ strict: false });
101
+ const footerContext = useContext(FooterContext);
102
+ const composedRef = composeRefs(ref, footerContext?.footerRef ?? null);
103
+ if (collapsibleContext) {
104
+ return /* @__PURE__ */ jsx(
105
+ Collapsible.Content,
106
+ {
107
+ ref: composedRef,
108
+ className: clsx(classNames.footer, className),
109
+ ...stateProps,
110
+ ...props,
111
+ children
112
+ }
113
+ );
114
+ }
115
+ return /* @__PURE__ */ jsx(
116
+ Primitive.div,
117
+ {
118
+ ref: composedRef,
119
+ className: clsx(classNames.footer, className),
120
+ ...stateProps,
121
+ ...props,
122
+ children
123
+ }
124
+ );
125
+ }
126
+ );
127
+ RadioSelectBoxFooter.displayName = "RadioSelectBoxFooter";
29
128
 
30
- export { RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxItem, RadioSelectBoxLabel, RadioSelectBoxRoot };
129
+ export { RadioSelectBoxBody, RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxFooter, RadioSelectBoxGroup, RadioSelectBoxHiddenInput, RadioSelectBoxItem, RadioSelectBoxLabel, RadioSelectBoxTrigger };
@@ -6,8 +6,12 @@ const RadioSelectBox = require('./RadioSelectBox.cjs');
6
6
 
7
7
 
8
8
 
9
+ exports.Body = RadioSelectBox.RadioSelectBoxBody;
9
10
  exports.Content = RadioSelectBox.RadioSelectBoxContent;
10
11
  exports.Description = RadioSelectBox.RadioSelectBoxDescription;
12
+ exports.Footer = RadioSelectBox.RadioSelectBoxFooter;
13
+ exports.Group = RadioSelectBox.RadioSelectBoxGroup;
14
+ exports.HiddenInput = RadioSelectBox.RadioSelectBoxHiddenInput;
11
15
  exports.Item = RadioSelectBox.RadioSelectBoxItem;
12
16
  exports.Label = RadioSelectBox.RadioSelectBoxLabel;
13
- exports.Root = RadioSelectBox.RadioSelectBoxRoot;
17
+ exports.Trigger = RadioSelectBox.RadioSelectBoxTrigger;
@@ -1,2 +1,2 @@
1
- export { RadioSelectBoxContent as Content, RadioSelectBoxDescription as Description, RadioSelectBoxItem as Item, RadioSelectBoxLabel as Label, RadioSelectBoxRoot as Root, type RadioSelectBoxContentProps as ContentProps, type RadioSelectBoxDescriptionProps as DescriptionProps, type RadioSelectBoxItemProps as ItemProps, type RadioSelectBoxLabelProps as LabelProps, type RadioSelectBoxRootProps as RootProps, } from './RadioSelectBox';
1
+ export { RadioSelectBoxBody as Body, RadioSelectBoxContent as Content, RadioSelectBoxDescription as Description, RadioSelectBoxFooter as Footer, RadioSelectBoxGroup as Group, RadioSelectBoxHiddenInput as HiddenInput, RadioSelectBoxItem as Item, RadioSelectBoxLabel as Label, RadioSelectBoxTrigger as Trigger, type RadioSelectBoxBodyProps as BodyProps, type RadioSelectBoxContentProps as ContentProps, type RadioSelectBoxDescriptionProps as DescriptionProps, type RadioSelectBoxFooterProps as FooterProps, type RadioSelectBoxGroupProps as GroupProps, type RadioSelectBoxHiddenInputProps as HiddenInputProps, type RadioSelectBoxItemProps as ItemProps, type RadioSelectBoxLabelProps as LabelProps, type RadioSelectBoxTriggerProps as TriggerProps, } from './RadioSelectBox';
2
2
  //# sourceMappingURL=RadioSelectBox.namespace.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioSelectBox.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/RadioSelectBox.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,IAAI,OAAO,EAChC,yBAAyB,IAAI,WAAW,EACxC,kBAAkB,IAAI,IAAI,EAC1B,mBAAmB,IAAI,KAAK,EAC5B,kBAAkB,IAAI,IAAI,EAC1B,KAAK,0BAA0B,IAAI,YAAY,EAC/C,KAAK,8BAA8B,IAAI,gBAAgB,EACvD,KAAK,uBAAuB,IAAI,SAAS,EACzC,KAAK,wBAAwB,IAAI,UAAU,EAC3C,KAAK,uBAAuB,IAAI,SAAS,GAC1C,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"RadioSelectBox.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/RadioSelectBox.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,IAAI,IAAI,EAC1B,qBAAqB,IAAI,OAAO,EAChC,yBAAyB,IAAI,WAAW,EACxC,oBAAoB,IAAI,MAAM,EAC9B,mBAAmB,IAAI,KAAK,EAC5B,yBAAyB,IAAI,WAAW,EACxC,kBAAkB,IAAI,IAAI,EAC1B,mBAAmB,IAAI,KAAK,EAC5B,qBAAqB,IAAI,OAAO,EAChC,KAAK,uBAAuB,IAAI,SAAS,EACzC,KAAK,0BAA0B,IAAI,YAAY,EAC/C,KAAK,8BAA8B,IAAI,gBAAgB,EACvD,KAAK,yBAAyB,IAAI,WAAW,EAC7C,KAAK,wBAAwB,IAAI,UAAU,EAC3C,KAAK,8BAA8B,IAAI,gBAAgB,EACvD,KAAK,uBAAuB,IAAI,SAAS,EACzC,KAAK,wBAAwB,IAAI,UAAU,EAC3C,KAAK,0BAA0B,IAAI,YAAY,GAChD,MAAM,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- export { RadioSelectBoxContent as Content, RadioSelectBoxDescription as Description, RadioSelectBoxItem as Item, RadioSelectBoxLabel as Label, RadioSelectBoxRoot as Root } from './RadioSelectBox.js';
1
+ export { RadioSelectBoxBody as Body, RadioSelectBoxContent as Content, RadioSelectBoxDescription as Description, RadioSelectBoxFooter as Footer, RadioSelectBoxGroup as Group, RadioSelectBoxHiddenInput as HiddenInput, RadioSelectBoxItem as Item, RadioSelectBoxLabel as Label, RadioSelectBoxTrigger as Trigger } from './RadioSelectBox.js';
@@ -9,15 +9,25 @@ const RadioSelectBox_namespace = require('./RadioSelectBox.namespace.cjs');
9
9
 
10
10
 
11
11
 
12
+ exports.CheckSelectBoxBody = CheckSelectBox.CheckSelectBoxBody;
13
+ exports.CheckSelectBoxCheckmarkControl = CheckSelectBox.CheckSelectBoxCheckmarkControl;
14
+ exports.CheckSelectBoxCheckmarkIcon = CheckSelectBox.CheckSelectBoxCheckmarkIcon;
12
15
  exports.CheckSelectBoxContent = CheckSelectBox.CheckSelectBoxContent;
13
16
  exports.CheckSelectBoxDescription = CheckSelectBox.CheckSelectBoxDescription;
17
+ exports.CheckSelectBoxFooter = CheckSelectBox.CheckSelectBoxFooter;
14
18
  exports.CheckSelectBoxGroup = CheckSelectBox.CheckSelectBoxGroup;
19
+ exports.CheckSelectBoxHiddenInput = CheckSelectBox.CheckSelectBoxHiddenInput;
15
20
  exports.CheckSelectBoxLabel = CheckSelectBox.CheckSelectBoxLabel;
16
21
  exports.CheckSelectBoxRoot = CheckSelectBox.CheckSelectBoxRoot;
22
+ exports.CheckSelectBoxTrigger = CheckSelectBox.CheckSelectBoxTrigger;
23
+ exports.RadioSelectBoxBody = RadioSelectBox.RadioSelectBoxBody;
17
24
  exports.RadioSelectBoxContent = RadioSelectBox.RadioSelectBoxContent;
18
25
  exports.RadioSelectBoxDescription = RadioSelectBox.RadioSelectBoxDescription;
26
+ exports.RadioSelectBoxFooter = RadioSelectBox.RadioSelectBoxFooter;
27
+ exports.RadioSelectBoxGroup = RadioSelectBox.RadioSelectBoxGroup;
28
+ exports.RadioSelectBoxHiddenInput = RadioSelectBox.RadioSelectBoxHiddenInput;
19
29
  exports.RadioSelectBoxItem = RadioSelectBox.RadioSelectBoxItem;
20
30
  exports.RadioSelectBoxLabel = RadioSelectBox.RadioSelectBoxLabel;
21
- exports.RadioSelectBoxRoot = RadioSelectBox.RadioSelectBoxRoot;
31
+ exports.RadioSelectBoxTrigger = RadioSelectBox.RadioSelectBoxTrigger;
22
32
  exports.CheckSelectBox = CheckSelectBox_namespace;
23
33
  exports.RadioSelectBox = RadioSelectBox_namespace;
@@ -1,5 +1,5 @@
1
- export { CheckSelectBoxContent, CheckSelectBoxDescription, CheckSelectBoxGroup, CheckSelectBoxLabel, CheckSelectBoxRoot, type CheckSelectBoxContentProps, type CheckSelectBoxDescriptionProps, type CheckSelectBoxGroupProps, type CheckSelectBoxLabelProps, type CheckSelectBoxRootProps, } from './CheckSelectBox';
2
- export { RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxItem, RadioSelectBoxLabel, RadioSelectBoxRoot, type RadioSelectBoxContentProps, type RadioSelectBoxDescriptionProps, type RadioSelectBoxItemProps, type RadioSelectBoxLabelProps, type RadioSelectBoxRootProps, } from './RadioSelectBox';
1
+ export { CheckSelectBoxBody, CheckSelectBoxCheckmarkControl, CheckSelectBoxCheckmarkIcon, CheckSelectBoxContent, CheckSelectBoxDescription, CheckSelectBoxFooter, CheckSelectBoxGroup, CheckSelectBoxHiddenInput, CheckSelectBoxLabel, CheckSelectBoxRoot, CheckSelectBoxTrigger, type CheckSelectBoxBodyProps, type CheckSelectBoxCheckmarkControlProps, type CheckSelectBoxCheckmarkIconProps, type CheckSelectBoxContentProps, type CheckSelectBoxDescriptionProps, type CheckSelectBoxFooterProps, type CheckSelectBoxGroupProps, type CheckSelectBoxHiddenInputProps, type CheckSelectBoxLabelProps, type CheckSelectBoxRootProps, type CheckSelectBoxTriggerProps, } from './CheckSelectBox';
2
+ export { RadioSelectBoxBody, RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxFooter, RadioSelectBoxGroup, RadioSelectBoxHiddenInput, RadioSelectBoxItem, RadioSelectBoxLabel, RadioSelectBoxTrigger, type RadioSelectBoxBodyProps, type RadioSelectBoxContentProps, type RadioSelectBoxDescriptionProps, type RadioSelectBoxFooterProps, type RadioSelectBoxGroupProps, type RadioSelectBoxHiddenInputProps, type RadioSelectBoxItemProps, type RadioSelectBoxLabelProps, type RadioSelectBoxTriggerProps, } from './RadioSelectBox';
3
3
  export * as CheckSelectBox from './CheckSelectBox.namespace';
4
4
  export * as RadioSelectBox from './RadioSelectBox.namespace';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectBox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,8BAA8B,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,mCAAmC,EACxC,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,GAChC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,GAChC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC"}
@@ -1,5 +1,5 @@
1
- export { CheckSelectBoxContent, CheckSelectBoxDescription, CheckSelectBoxGroup, CheckSelectBoxLabel, CheckSelectBoxRoot } from './CheckSelectBox.js';
2
- export { RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxItem, RadioSelectBoxLabel, RadioSelectBoxRoot } from './RadioSelectBox.js';
1
+ export { CheckSelectBoxBody, CheckSelectBoxCheckmarkControl, CheckSelectBoxCheckmarkIcon, CheckSelectBoxContent, CheckSelectBoxDescription, CheckSelectBoxFooter, CheckSelectBoxGroup, CheckSelectBoxHiddenInput, CheckSelectBoxLabel, CheckSelectBoxRoot, CheckSelectBoxTrigger } from './CheckSelectBox.js';
2
+ export { RadioSelectBoxBody, RadioSelectBoxContent, RadioSelectBoxDescription, RadioSelectBoxFooter, RadioSelectBoxGroup, RadioSelectBoxHiddenInput, RadioSelectBoxItem, RadioSelectBoxLabel, RadioSelectBoxTrigger } from './RadioSelectBox.js';
3
3
  import * as CheckSelectBox_namespace from './CheckSelectBox.namespace.js';
4
4
  export { CheckSelectBox_namespace as CheckSelectBox };
5
5
  import * as RadioSelectBox_namespace from './RadioSelectBox.namespace.js';
@@ -6,7 +6,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6
6
  const jsxRuntime = require('react/jsx-runtime');
7
7
  const reactSwitch = require('@seed-design/react-switch');
8
8
  const _switch = require('@seed-design/css/recipes/switch');
9
- const switchMark = require('@seed-design/css/recipes/switch-mark');
9
+ const switchmark = require('@seed-design/css/recipes/switchmark');
10
10
  const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs');
11
11
  const reactPrimitive = require('@seed-design/react-primitive');
12
12
  const createWithStateProps = require('../../utils/createWithStateProps.cjs');
@@ -19,7 +19,7 @@ const {
19
19
  withContext: withControlContext,
20
20
  PropsProvider: ControlPropsProvider,
21
21
  withProvider: withControlProvider
22
- } = createSlotRecipeContext.createSlotRecipeContext(switchMark.switchMark);
22
+ } = createSlotRecipeContext.createSlotRecipeContext(switchmark.switchmark);
23
23
  const withStateProps = createWithStateProps.createWithStateProps([reactSwitch.useSwitchContext]);
24
24
  const SwitchRoot = React.forwardRef(
25
25
  ({ className, ...props }, ref) => {
@@ -28,16 +28,16 @@ const SwitchRoot = React.forwardRef(
28
28
  `[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.`
29
29
  );
30
30
  }
31
- const [{ switch: switchVariantProps, switchMark: switchMarkVariantProps }, otherProps] = splitMultipleVariantsProps.splitMultipleVariantsProps(
31
+ const [{ switch: switchVariantProps, switchmark: switchmarkVariantProps }, otherProps] = splitMultipleVariantsProps.splitMultipleVariantsProps(
32
32
  {
33
33
  ...props,
34
34
  // TODO: replace this mapping completely
35
35
  size: props.size === "small" ? "16" : props.size === "medium" ? "32" : props.size
36
36
  },
37
- { switchMark: switchMark.switchMark, switch: _switch.switchStyle }
37
+ { switchmark: switchmark.switchmark, switch: _switch.switchStyle }
38
38
  );
39
39
  const classNames = _switch.switchStyle(switchVariantProps);
40
- return /* @__PURE__ */ jsxRuntime.jsx(ControlPropsProvider, { value: switchMarkVariantProps, children: /* @__PURE__ */ jsxRuntime.jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsxRuntime.jsx(
40
+ return /* @__PURE__ */ jsxRuntime.jsx(ControlPropsProvider, { value: switchmarkVariantProps, children: /* @__PURE__ */ jsxRuntime.jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsxRuntime.jsx(
41
41
  reactSwitch.Switch.Root,
42
42
  {
43
43
  ref,
@@ -1,17 +1,17 @@
1
1
  import { Switch as SwitchPrimitive } from '@seed-design/react-switch';
2
2
  import { SwitchVariantProps } from '@seed-design/css/recipes/switch';
3
- import { SwitchMarkVariantProps } from '@seed-design/css/recipes/switch-mark';
3
+ import { SwitchmarkVariantProps } from '@seed-design/css/recipes/switchmark';
4
4
  import { PrimitiveProps } from '@seed-design/react-primitive';
5
5
  import { default as React } from 'react';
6
6
  /**
7
7
  * @deprecated Use `16` or `32` instead of `small` or `medium`.
8
8
  */
9
9
  type SwitchVariantDeprecatedSizeProps = "small" | "medium";
10
- export interface SwitchRootProps extends Omit<SwitchVariantProps, "size">, Omit<SwitchMarkVariantProps, "size">, SwitchPrimitive.RootProps {
10
+ export interface SwitchRootProps extends Omit<SwitchVariantProps, "size">, Omit<SwitchmarkVariantProps, "size">, SwitchPrimitive.RootProps {
11
11
  size?: SwitchVariantProps["size"] | SwitchVariantDeprecatedSizeProps;
12
12
  }
13
13
  export declare const SwitchRoot: React.ForwardRefExoticComponent<SwitchRootProps & React.RefAttributes<HTMLLabelElement>>;
14
- export interface SwitchControlProps extends SwitchMarkVariantProps, SwitchPrimitive.ControlProps {
14
+ export interface SwitchControlProps extends SwitchmarkVariantProps, SwitchPrimitive.ControlProps {
15
15
  }
16
16
  export declare const SwitchControl: React.ForwardRefExoticComponent<SwitchControlProps & React.RefAttributes<HTMLDivElement>>;
17
17
  export interface SwitchThumbProps extends SwitchPrimitive.ThumbProps {
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAoB,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACvF,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE/F,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B;;GAEG;AACH,KAAK,gCAAgC,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,EACtC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,EACpC,eAAe,CAAC,SAAS;IAC3B,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAAG,gCAAgC,CAAC;CACtE;AAED,eAAO,MAAM,UAAU,0FAmCtB,CAAC;AAKF,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB,EAAE,eAAe,CAAC,YAAY;CAAG;AAEnG,eAAO,MAAM,aAAa,2FAGzB,CAAC;AAIF,MAAM,WAAW,gBAAiB,SAAQ,eAAe,CAAC,UAAU;CAAG;AAEvE,eAAO,MAAM,WAAW,yFAGvB,CAAC;AAIF,MAAM,WAAW,gBAAiB,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAElG,eAAO,MAAM,WAAW,0FAGvB,CAAC;AAIF,MAAM,WAAW,sBAAuB,SAAQ,eAAe,CAAC,gBAAgB;CAAG;AAEnF,eAAO,MAAM,iBAAiB,2GAA8B,CAAC"}
1
+ {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAoB,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACvF,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE9F,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B;;GAEG;AACH,KAAK,gCAAgC,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,EACtC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,EACpC,eAAe,CAAC,SAAS;IAC3B,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAAG,gCAAgC,CAAC;CACtE;AAED,eAAO,MAAM,UAAU,0FAmCtB,CAAC;AAKF,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB,EAAE,eAAe,CAAC,YAAY;CAAG;AAEnG,eAAO,MAAM,aAAa,2FAGzB,CAAC;AAIF,MAAM,WAAW,gBAAiB,SAAQ,eAAe,CAAC,UAAU;CAAG;AAEvE,eAAO,MAAM,WAAW,yFAGvB,CAAC;AAIF,MAAM,WAAW,gBAAiB,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAElG,eAAO,MAAM,WAAW,0FAGvB,CAAC;AAIF,MAAM,WAAW,sBAAuB,SAAQ,eAAe,CAAC,gBAAgB;CAAG;AAEnF,eAAO,MAAM,iBAAiB,2GAA8B,CAAC"}
@@ -2,7 +2,7 @@
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { Switch, useSwitchContext } from '@seed-design/react-switch';
4
4
  import { switchStyle } from '@seed-design/css/recipes/switch';
5
- import { switchMark } from '@seed-design/css/recipes/switch-mark';
5
+ import { switchmark } from '@seed-design/css/recipes/switchmark';
6
6
  import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
7
7
  import { Primitive } from '@seed-design/react-primitive';
8
8
  import { createWithStateProps } from '../../utils/createWithStateProps.js';
@@ -15,7 +15,7 @@ const {
15
15
  withContext: withControlContext,
16
16
  PropsProvider: ControlPropsProvider,
17
17
  withProvider: withControlProvider
18
- } = createSlotRecipeContext(switchMark);
18
+ } = createSlotRecipeContext(switchmark);
19
19
  const withStateProps = createWithStateProps([useSwitchContext]);
20
20
  const SwitchRoot = React__default.forwardRef(
21
21
  ({ className, ...props }, ref) => {
@@ -24,16 +24,16 @@ const SwitchRoot = React__default.forwardRef(
24
24
  `[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.`
25
25
  );
26
26
  }
27
- const [{ switch: switchVariantProps, switchMark: switchMarkVariantProps }, otherProps] = splitMultipleVariantsProps(
27
+ const [{ switch: switchVariantProps, switchmark: switchmarkVariantProps }, otherProps] = splitMultipleVariantsProps(
28
28
  {
29
29
  ...props,
30
30
  // TODO: replace this mapping completely
31
31
  size: props.size === "small" ? "16" : props.size === "medium" ? "32" : props.size
32
32
  },
33
- { switchMark, switch: switchStyle }
33
+ { switchmark, switch: switchStyle }
34
34
  );
35
35
  const classNames = switchStyle(switchVariantProps);
36
- return /* @__PURE__ */ jsx(ControlPropsProvider, { value: switchMarkVariantProps, children: /* @__PURE__ */ jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsx(
36
+ return /* @__PURE__ */ jsx(ControlPropsProvider, { value: switchmarkVariantProps, children: /* @__PURE__ */ jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsx(
37
37
  Switch.Root,
38
38
  {
39
39
  ref,
@@ -7,13 +7,13 @@ const jsxRuntime = require('react/jsx-runtime');
7
7
  const reactPrimitive = require('@seed-design/react-primitive');
8
8
  const tagGroup = require('@seed-design/css/recipes/tag-group');
9
9
  const tagGroupItem = require('@seed-design/css/recipes/tag-group-item');
10
- const createRecipeContext = require('../../utils/createRecipeContext.cjs');
11
10
  const React = require('react');
12
11
  const clsx = require('clsx');
13
12
  const splitMultipleVariantsProps = require('../../utils/splitMultipleVariantsProps.cjs');
14
- const domUtils = require('@seed-design/dom-utils');
13
+ const styled = require('../../utils/styled.cjs');
14
+ const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs');
15
15
 
16
- const { PropsProvider, useProps } = createRecipeContext.createRecipeContext(tagGroupItem.tagGroupItem);
16
+ const { PropsProvider, useProps, withContext, ClassNamesProvider } = createSlotRecipeContext.createSlotRecipeContext(tagGroupItem.tagGroupItem);
17
17
  const TagGroupRoot = React.forwardRef(
18
18
  ({ className, children, separator = " · ", ...props }, ref) => {
19
19
  const [{ tagGroup: tagGroupVariantProps, tagGroupItem: tagGroupItemVariantProps }, otherProps] = splitMultipleVariantsProps.splitMultipleVariantsProps(props, { tagGroup: tagGroup.tagGroup, tagGroupItem: tagGroupItem.tagGroupItem });
@@ -27,12 +27,28 @@ const TagGroupRoot = React.forwardRef(
27
27
  )) }) });
28
28
  }
29
29
  );
30
- const TagGroupItem = React.forwardRef((props, ref) => {
31
- const parentVariantProps = useProps();
32
- const [variantProps, { className, ...otherProps }] = tagGroupItem.tagGroupItem.splitVariantProps(props);
33
- const recipeClassName = tagGroupItem.tagGroupItem(domUtils.mergeProps(parentVariantProps, variantProps));
34
- return /* @__PURE__ */ jsxRuntime.jsx(reactPrimitive.Primitive.span, { ref, className: clsx(recipeClassName, className), ...otherProps });
35
- });
30
+ const TagGroupItem = React.forwardRef(
31
+ ({ className, ...props }, ref) => {
32
+ const parentVariantProps = useProps();
33
+ const [variantProps, otherProps] = tagGroupItem.tagGroupItem.splitVariantProps(props);
34
+ const classNames = tagGroupItem.tagGroupItem({ ...parentVariantProps, ...variantProps });
35
+ const { style, restProps } = styled.useStyleProps(otherProps);
36
+ return /* @__PURE__ */ jsxRuntime.jsx(ClassNamesProvider, { value: classNames, children: /* @__PURE__ */ jsxRuntime.jsx(
37
+ reactPrimitive.Primitive.span,
38
+ {
39
+ ref,
40
+ style,
41
+ className: clsx(classNames.root, className),
42
+ ...restProps
43
+ }
44
+ ) });
45
+ }
46
+ );
47
+ const TagGroupItemLabel = withContext(
48
+ reactPrimitive.Primitive.span,
49
+ "label"
50
+ );
36
51
 
37
52
  exports.TagGroupItem = TagGroupItem;
53
+ exports.TagGroupItemLabel = TagGroupItemLabel;
38
54
  exports.TagGroupRoot = TagGroupRoot;