@wix/headless-stores 0.0.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 (150) hide show
  1. package/astro/actions/package.json +4 -0
  2. package/cjs/dist/astro/actions/custom-checkout.d.ts +50 -0
  3. package/cjs/dist/astro/actions/custom-checkout.js +53 -0
  4. package/cjs/dist/astro/actions/index.d.ts +1 -0
  5. package/cjs/dist/astro/actions/index.js +1 -0
  6. package/cjs/dist/data-component-tags.d.ts +8 -0
  7. package/cjs/dist/data-component-tags.js +9 -0
  8. package/cjs/dist/enums/index.d.ts +2 -0
  9. package/cjs/dist/enums/index.js +2 -0
  10. package/cjs/dist/enums/social-platform-enums.d.ts +25 -0
  11. package/cjs/dist/enums/social-platform-enums.js +27 -0
  12. package/cjs/dist/enums/sort-enums.d.ts +17 -0
  13. package/cjs/dist/enums/sort-enums.js +18 -0
  14. package/cjs/dist/react/Category.d.ts +242 -0
  15. package/cjs/dist/react/Category.js +235 -0
  16. package/cjs/dist/react/CategoryList.d.ts +107 -0
  17. package/cjs/dist/react/CategoryList.js +91 -0
  18. package/cjs/dist/react/Choice.d.ts +211 -0
  19. package/cjs/dist/react/Choice.js +213 -0
  20. package/cjs/dist/react/Option.d.ts +242 -0
  21. package/cjs/dist/react/Option.js +346 -0
  22. package/cjs/dist/react/Product.d.ts +1065 -0
  23. package/cjs/dist/react/Product.js +1157 -0
  24. package/cjs/dist/react/ProductList.d.ts +400 -0
  25. package/cjs/dist/react/ProductList.js +368 -0
  26. package/cjs/dist/react/core/CategoryList.d.ts +194 -0
  27. package/cjs/dist/react/core/CategoryList.js +180 -0
  28. package/cjs/dist/react/core/Product.d.ts +225 -0
  29. package/cjs/dist/react/core/Product.js +190 -0
  30. package/cjs/dist/react/core/ProductList.d.ts +235 -0
  31. package/cjs/dist/react/core/ProductList.js +217 -0
  32. package/cjs/dist/react/core/ProductListFilters.d.ts +138 -0
  33. package/cjs/dist/react/core/ProductListFilters.js +242 -0
  34. package/cjs/dist/react/core/ProductListPagination.d.ts +49 -0
  35. package/cjs/dist/react/core/ProductListPagination.js +41 -0
  36. package/cjs/dist/react/core/ProductListSort.d.ts +19 -0
  37. package/cjs/dist/react/core/ProductListSort.js +52 -0
  38. package/cjs/dist/react/core/ProductModifiers.d.ts +416 -0
  39. package/cjs/dist/react/core/ProductModifiers.js +413 -0
  40. package/cjs/dist/react/core/ProductVariantSelector.d.ts +313 -0
  41. package/cjs/dist/react/core/ProductVariantSelector.js +291 -0
  42. package/cjs/dist/react/core/SelectedVariant.d.ts +230 -0
  43. package/cjs/dist/react/core/SelectedVariant.js +269 -0
  44. package/cjs/dist/react/index.d.ts +6 -0
  45. package/cjs/dist/react/index.js +6 -0
  46. package/cjs/dist/react/types.d.ts +8 -0
  47. package/cjs/dist/react/types.js +9 -0
  48. package/cjs/dist/server-actions/custom-checkout-action.d.ts +49 -0
  49. package/cjs/dist/server-actions/custom-checkout-action.js +64 -0
  50. package/cjs/dist/server-actions/index.d.ts +1 -0
  51. package/cjs/dist/server-actions/index.js +1 -0
  52. package/cjs/dist/services/buy-now-service.d.ts +346 -0
  53. package/cjs/dist/services/buy-now-service.js +197 -0
  54. package/cjs/dist/services/categories-list-service.d.ts +164 -0
  55. package/cjs/dist/services/categories-list-service.js +148 -0
  56. package/cjs/dist/services/index.d.ts +5 -0
  57. package/cjs/dist/services/index.js +5 -0
  58. package/cjs/dist/services/pay-now-service.d.ts +214 -0
  59. package/cjs/dist/services/pay-now-service.js +156 -0
  60. package/cjs/dist/services/product-modifiers-service.d.ts +34 -0
  61. package/cjs/dist/services/product-modifiers-service.js +107 -0
  62. package/cjs/dist/services/product-service.d.ts +177 -0
  63. package/cjs/dist/services/product-service.js +190 -0
  64. package/cjs/dist/services/products-list-search-service.d.ts +1 -0
  65. package/cjs/dist/services/products-list-search-service.js +1 -0
  66. package/cjs/dist/services/products-list-service.d.ts +429 -0
  67. package/cjs/dist/services/products-list-service.js +893 -0
  68. package/cjs/dist/services/selected-variant-service.d.ts +66 -0
  69. package/cjs/dist/services/selected-variant-service.js +527 -0
  70. package/cjs/dist/utils/index.d.ts +1 -0
  71. package/cjs/dist/utils/index.js +30 -0
  72. package/cjs/dist/utils/url-params.d.ts +73 -0
  73. package/cjs/dist/utils/url-params.js +114 -0
  74. package/cjs/package.json +3 -0
  75. package/dist/astro/actions/custom-checkout.d.ts +50 -0
  76. package/dist/astro/actions/custom-checkout.js +53 -0
  77. package/dist/astro/actions/index.d.ts +1 -0
  78. package/dist/astro/actions/index.js +1 -0
  79. package/dist/data-component-tags.d.ts +8 -0
  80. package/dist/data-component-tags.js +9 -0
  81. package/dist/enums/index.d.ts +2 -0
  82. package/dist/enums/index.js +2 -0
  83. package/dist/enums/social-platform-enums.d.ts +25 -0
  84. package/dist/enums/social-platform-enums.js +27 -0
  85. package/dist/enums/sort-enums.d.ts +17 -0
  86. package/dist/enums/sort-enums.js +18 -0
  87. package/dist/react/Category.d.ts +242 -0
  88. package/dist/react/Category.js +235 -0
  89. package/dist/react/CategoryList.d.ts +107 -0
  90. package/dist/react/CategoryList.js +91 -0
  91. package/dist/react/Choice.d.ts +211 -0
  92. package/dist/react/Choice.js +213 -0
  93. package/dist/react/Option.d.ts +242 -0
  94. package/dist/react/Option.js +346 -0
  95. package/dist/react/Product.d.ts +1065 -0
  96. package/dist/react/Product.js +1157 -0
  97. package/dist/react/ProductList.d.ts +400 -0
  98. package/dist/react/ProductList.js +368 -0
  99. package/dist/react/core/CategoryList.d.ts +194 -0
  100. package/dist/react/core/CategoryList.js +180 -0
  101. package/dist/react/core/Product.d.ts +225 -0
  102. package/dist/react/core/Product.js +190 -0
  103. package/dist/react/core/ProductList.d.ts +235 -0
  104. package/dist/react/core/ProductList.js +217 -0
  105. package/dist/react/core/ProductListFilters.d.ts +138 -0
  106. package/dist/react/core/ProductListFilters.js +242 -0
  107. package/dist/react/core/ProductListPagination.d.ts +49 -0
  108. package/dist/react/core/ProductListPagination.js +41 -0
  109. package/dist/react/core/ProductListSort.d.ts +19 -0
  110. package/dist/react/core/ProductListSort.js +52 -0
  111. package/dist/react/core/ProductModifiers.d.ts +416 -0
  112. package/dist/react/core/ProductModifiers.js +413 -0
  113. package/dist/react/core/ProductVariantSelector.d.ts +313 -0
  114. package/dist/react/core/ProductVariantSelector.js +291 -0
  115. package/dist/react/core/SelectedVariant.d.ts +230 -0
  116. package/dist/react/core/SelectedVariant.js +269 -0
  117. package/dist/react/index.d.ts +6 -0
  118. package/dist/react/index.js +6 -0
  119. package/dist/react/types.d.ts +8 -0
  120. package/dist/react/types.js +9 -0
  121. package/dist/server-actions/custom-checkout-action.d.ts +49 -0
  122. package/dist/server-actions/custom-checkout-action.js +64 -0
  123. package/dist/server-actions/index.d.ts +1 -0
  124. package/dist/server-actions/index.js +1 -0
  125. package/dist/services/buy-now-service.d.ts +346 -0
  126. package/dist/services/buy-now-service.js +197 -0
  127. package/dist/services/categories-list-service.d.ts +164 -0
  128. package/dist/services/categories-list-service.js +148 -0
  129. package/dist/services/index.d.ts +5 -0
  130. package/dist/services/index.js +5 -0
  131. package/dist/services/pay-now-service.d.ts +214 -0
  132. package/dist/services/pay-now-service.js +156 -0
  133. package/dist/services/product-modifiers-service.d.ts +34 -0
  134. package/dist/services/product-modifiers-service.js +107 -0
  135. package/dist/services/product-service.d.ts +177 -0
  136. package/dist/services/product-service.js +190 -0
  137. package/dist/services/products-list-search-service.d.ts +0 -0
  138. package/dist/services/products-list-search-service.js +1 -0
  139. package/dist/services/products-list-service.d.ts +429 -0
  140. package/dist/services/products-list-service.js +893 -0
  141. package/dist/services/selected-variant-service.d.ts +66 -0
  142. package/dist/services/selected-variant-service.js +527 -0
  143. package/dist/utils/index.d.ts +1 -0
  144. package/dist/utils/index.js +30 -0
  145. package/dist/utils/url-params.d.ts +73 -0
  146. package/dist/utils/url-params.js +114 -0
  147. package/package.json +89 -0
  148. package/react/package.json +4 -0
  149. package/server-actions/package.json +4 -0
  150. package/services/package.json +4 -0
@@ -0,0 +1,213 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { FreeText as FreeTextPrimitive } from './core/ProductModifiers.js';
4
+ import { AsChildSlot } from '@wix/headless-utils/react';
5
+ import { DataComponentTags } from '../data-component-tags.js';
6
+ var TestIds;
7
+ (function (TestIds) {
8
+ TestIds["choiceRoot"] = "choice-root";
9
+ TestIds["choiceText"] = "choice-text";
10
+ TestIds["choiceColor"] = "choice-color";
11
+ TestIds["choiceFreetext"] = "choice-freetext";
12
+ })(TestIds || (TestIds = {}));
13
+ // Create a context for individual choices
14
+ export const ChoiceContext = React.createContext(null);
15
+ /**
16
+ * Hook to access ChoiceContext with proper error handling
17
+ * @throws {Error} When used outside of a Choice context provider
18
+ * @returns {ChoiceContextValue} The choice context value
19
+ */
20
+ export function useChoiceContext() {
21
+ const context = React.useContext(ChoiceContext);
22
+ if (!context) {
23
+ throw new Error('useChoiceContext must be used within a Choice context provider (Option.ChoiceRepeater)');
24
+ }
25
+ return context;
26
+ }
27
+ /**
28
+ * Root component that consumes ChoiceContext provided by Option.ChoiceRepeater.
29
+ *
30
+ * @component
31
+ * @example
32
+ * ```tsx
33
+ * <Choice.Root>
34
+ * <Choice.Text />
35
+ * <Choice.Color />
36
+ * </Choice.Root>
37
+ * ```
38
+ */
39
+ export const Root = React.forwardRef((props, ref) => {
40
+ const { children } = props;
41
+ const choiceContext = React.useContext(ChoiceContext);
42
+ if (!choiceContext) {
43
+ return null; // Should be used within Option.ChoiceRepeater
44
+ }
45
+ const { choice } = choiceContext;
46
+ const attributes = {
47
+ 'data-component-tag': DataComponentTags.choiceRoot,
48
+ 'data-testid': TestIds.choiceRoot,
49
+ 'data-type': choice?.type,
50
+ };
51
+ return (_jsx("div", { ...attributes, ref: ref, children: children }));
52
+ });
53
+ Root.displayName = 'Choice.Root';
54
+ /**
55
+ * Text-based choice button.
56
+ *
57
+ * @component
58
+ * @example
59
+ * ```tsx
60
+ * // Default usage
61
+ * <Choice.Text className="px-4 py-2 border rounded-lg" />
62
+ *
63
+ * // asChild with primitive
64
+ * <Choice.Text asChild>
65
+ * <button className="px-4 py-2 border rounded-lg" />
66
+ * </Choice.Text>
67
+ *
68
+ * // asChild with react component
69
+ * <Choice.Text asChild>
70
+ * {React.forwardRef(({id, value, ...props}, ref) => (
71
+ * <button ref={ref} {...props} className="px-4 py-2 border rounded-lg">
72
+ * {value}
73
+ * </button>
74
+ * ))}
75
+ * </Choice.Text>
76
+ * ```
77
+ *
78
+ * Data Attributes:
79
+ * - `data-testid="choice-text"` - Applied to choice buttons
80
+ * - `data-selected` - Is Choice selected
81
+ * - `disabled` - Is Choice disabled (not in stock)
82
+ */
83
+ export const Text = React.forwardRef((props, ref) => {
84
+ const { asChild, children, className, ...otherProps } = props;
85
+ const choiceContext = React.useContext(ChoiceContext);
86
+ if (!choiceContext) {
87
+ return null; // Should be used within Option.ChoiceRepeater
88
+ }
89
+ const { choice, shouldRenderAsText, value, isSelected, select, isVisible, isInStock, isPreOrderEnabled, } = choiceContext;
90
+ // Only render if this should be rendered as text
91
+ if (!shouldRenderAsText)
92
+ return null;
93
+ // Don't render if not visible (handled by ProductVariantSelector in Root)
94
+ if (!isVisible)
95
+ return null;
96
+ const choiceId = choice?.choiceId || '';
97
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.choiceText, "data-selected": isSelected ? 'true' : 'false', disabled: !isInStock && !isPreOrderEnabled, onClick: select, customElement: children, customElementProps: { id: choiceId, value }, content: value, ...otherProps, children: _jsx("button", { children: value }) }));
98
+ });
99
+ /**
100
+ * Color swatch choice.
101
+ *
102
+ * @component
103
+ * @example
104
+ * ```tsx
105
+ * // Default usage
106
+ * <Choice.Color className="w-10 h-10 rounded-full border-4" />
107
+ *
108
+ * // asChild with primitive
109
+ * <Choice.Color asChild>
110
+ * <button className="w-10 h-10 rounded-full border-4" />
111
+ * </Choice.Color>
112
+ *
113
+ * // asChild with react component
114
+ * <Choice.Color asChild>
115
+ * {React.forwardRef(({colorCode, name, id, ...props}, ref) => (
116
+ * <button
117
+ * ref={ref}
118
+ * {...props}
119
+ * className="w-10 h-10 rounded-full border-4"
120
+ * style={{ backgroundColor: colorCode }}
121
+ * title={name}
122
+ * />
123
+ * ))}
124
+ * </Choice.Color>
125
+ * ```
126
+ *
127
+ * Data Attributes:
128
+ * - `data-testid="choice-color"` - Applied to color swatches
129
+ * - `data-selected` - Is Choice selected
130
+ * - `disabled` - Is Choice disabled (not in stock)
131
+ */
132
+ export const Color = React.forwardRef((props, ref) => {
133
+ const { asChild, children, className, ...otherProps } = props;
134
+ const choiceContext = React.useContext(ChoiceContext);
135
+ if (!choiceContext) {
136
+ return null; // Should be used within Option.ChoiceRepeater
137
+ }
138
+ const { choice, shouldRenderAsColor, value, isSelected, select, isVisible, isInStock, isPreOrderEnabled, } = choiceContext;
139
+ // Only render if this should be rendered as color
140
+ if (!shouldRenderAsColor)
141
+ return null;
142
+ // Don't render if not visible (handled by ProductVariantSelector in Root)
143
+ if (!isVisible)
144
+ return null;
145
+ const { colorCode, choiceId } = choice;
146
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.choiceColor, "data-selected": isSelected ? 'true' : 'false', disabled: !isInStock && !isPreOrderEnabled, onClick: select, customElement: children, customElementProps: {
147
+ colorCode: colorCode || '',
148
+ name: value,
149
+ id: choiceId || '',
150
+ }, ...otherProps, children: _jsx("button", { style: { backgroundColor: colorCode }, title: value }) }));
151
+ });
152
+ /**
153
+ * Provides a free text input for variant selection.
154
+ *
155
+ * @component
156
+ * @example
157
+ * ```tsx
158
+ * // Default usage
159
+ * <Choice.FreeText className="p-3 border rounded-lg" />
160
+ *
161
+ * // asChild with primitive
162
+ * <Choice.FreeText asChild>
163
+ * <textarea className="p-3 border rounded-lg" />
164
+ * </Choice.FreeText>
165
+ *
166
+ * // asChild with react component
167
+ * <Choice.FreeText asChild>
168
+ * {React.forwardRef(({value, onChange, title, ...props}, ref) => (
169
+ * <textarea
170
+ * ref={ref}
171
+ * {...props}
172
+ * className="p-3 border rounded-lg"
173
+ * value={value}
174
+ * onChange={onChange}
175
+ * placeholder={`Enter custom ${title}...`}
176
+ * />
177
+ * ))}
178
+ * </Choice.FreeText>
179
+ * ```
180
+ *
181
+ * Data Attributes:
182
+ * - `data-testid="choice-free-text"` - Applied to free text input
183
+ * - `data-selected` - Is Choice selected
184
+ */
185
+ export const FreeText = React.forwardRef((props, ref) => {
186
+ const { asChild, children, className, ...otherProps } = props;
187
+ const choiceContext = React.useContext(ChoiceContext);
188
+ if (!choiceContext) {
189
+ return null; // Should be used within Option.ChoiceRepeater
190
+ }
191
+ const { choice, shouldRenderAsFreeText, onValueChange, isVisible, isSelected, } = choiceContext;
192
+ // Only render if this should be rendered as free text
193
+ if (!shouldRenderAsFreeText)
194
+ return null;
195
+ // Don't render if not visible (handled by ProductVariantSelector in Root)
196
+ if (!isVisible)
197
+ return null;
198
+ return (_jsx(FreeTextPrimitive, { modifier: choice, children: ({ value, setText, placeholder, maxChars }) => {
199
+ const handleChange = (e) => {
200
+ setText(e.target.value);
201
+ if (onValueChange) {
202
+ onValueChange(e.target.value);
203
+ }
204
+ };
205
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.choiceFreetext, "data-selected": isSelected ? 'true' : 'false', customElement: children, customElementProps: {
206
+ minCharCount: choice?.minCharCount,
207
+ maxCharCount: choice?.maxCharCount,
208
+ defaultAddedPrice: choice?.addedPrice || undefined,
209
+ title: choice?.name || undefined,
210
+ onChange: handleChange,
211
+ }, ...otherProps, children: _jsx("textarea", { placeholder: placeholder, rows: 3, value: value, maxLength: maxChars, onChange: handleChange }) }));
212
+ } }));
213
+ });
@@ -0,0 +1,242 @@
1
+ import React from 'react';
2
+ import { AsChildChildren } from '@wix/headless-utils/react';
3
+ export interface Option {
4
+ name: string;
5
+ choices?: any[];
6
+ hasChoices?: boolean;
7
+ type?: string;
8
+ mandatory?: boolean;
9
+ }
10
+ /**
11
+ * Root props with asChild support
12
+ */
13
+ export interface RootProps {
14
+ /** Whether to render as a child component */
15
+ asChild?: boolean;
16
+ /** Custom render function when using asChild */
17
+ children?: AsChildChildren<{
18
+ option: Option;
19
+ onValueChange?: (value: string) => void;
20
+ allowedTypes?: ('color' | 'text' | 'free-text')[];
21
+ }>;
22
+ /** CSS classes to apply to the default element */
23
+ className?: string;
24
+ option: Option;
25
+ onValueChange?: (value: string) => void;
26
+ allowedTypes?: ('color' | 'text' | 'free-text')[];
27
+ }
28
+ /**
29
+ * Root component that provides context for variant options.
30
+ * Automatically detects and sets the option type based on the option name and available choices.
31
+ *
32
+ * @component
33
+ *
34
+ * **Data Attributes**
35
+ *
36
+ * - `data-testid="option-root"` - Applied to option container (TestIds.optionRoot)
37
+ * - `data-type` - The type of the option: 'color' | 'text' | 'free-text'
38
+ * @example
39
+ * ```tsx
40
+ * // Color option (data-type="color")
41
+ * <Option.Root
42
+ * option={{ name: "Color" }}
43
+ * onValueChange={(value) => console.log('Selected:', value)}
44
+ * >
45
+ * <Option.Name />
46
+ * <Option.Choices>
47
+ * <Option.ChoiceRepeater>
48
+ * <Choice.Color />
49
+ * </Option.ChoiceRepeater>
50
+ * </Option.Choices>
51
+ * </Option.Root>
52
+ *
53
+ * // Text option (data-type="text")
54
+ * <Option.Root
55
+ * option={{ name: "Size" }}
56
+ * onValueChange={(value) => console.log('Selected:', value)}
57
+ * >
58
+ * <Option.Name />
59
+ * <Option.Choices>
60
+ * <Option.ChoiceRepeater>
61
+ * <Choice.Text />
62
+ * </Option.ChoiceRepeater>
63
+ * </Option.Choices>
64
+ * </Option.Root>
65
+ *
66
+ * // Free text option (data-type="free-text")
67
+ * <Option.Root
68
+ * option={{ name: "Custom Text" }}
69
+ * onValueChange={(value) => console.log('Entered:', value)}
70
+ * >
71
+ * <Option.Name />
72
+ * <Option.Choices>
73
+ * <Option.ChoiceRepeater>
74
+ * <Choice.FreeText />
75
+ * </Option.ChoiceRepeater>
76
+ * </Option.Choices>
77
+ * </Option.Root>
78
+ *
79
+ * // With allowed types filter
80
+ * <Option.Root
81
+ * option={{ name: "Size" }}
82
+ * allowedTypes={['text']}
83
+ * onValueChange={(value) => console.log('Selected size:', value)}
84
+ * >
85
+ * <Option.Name />
86
+ * <Option.Choices>
87
+ * <Option.ChoiceRepeater>
88
+ * <Choice.Text />
89
+ * </Option.ChoiceRepeater>
90
+ * </Option.Choices>
91
+ * </Option.Root>
92
+ *
93
+ * // asChild with react component
94
+ * <Option.Root
95
+ * asChild
96
+ * option={{ name: "Color" }}
97
+ * onValueChange={(value) => console.log('Selected:', value)}
98
+ * >
99
+ * {React.forwardRef(({option, onValueChange, allowedTypes, ...props}, ref) => (
100
+ * <section ref={ref} {...props} className="option-section">
101
+ * <h3>Option: {option.name}</h3>
102
+ * <p>Allowed types: {allowedTypes.join(', ')}</p>
103
+ * {props.children}
104
+ * </section>
105
+ * ))}
106
+ * </Option.Root>
107
+ * ```
108
+ */
109
+ export declare const Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLElement>>;
110
+ export declare const OptionContext: React.Context<any>;
111
+ /**
112
+ * Props for Option Name component
113
+ */
114
+ export interface NameProps {
115
+ /** Whether to render as a child component */
116
+ asChild?: boolean;
117
+ /** Custom render function when using asChild */
118
+ children?: AsChildChildren<{
119
+ name: string;
120
+ }>;
121
+ /** CSS classes to apply to the default element */
122
+ className?: string;
123
+ }
124
+ /**
125
+ * Displays the option name.
126
+ * Follows true Radix pattern - use separate components for each styleable element.
127
+ *
128
+ * @component
129
+ * @example
130
+ * ```tsx
131
+ * // True Radix pattern - separate components
132
+ * <div className="flex items-center gap-1">
133
+ * <Option.Name className="text-lg font-medium" />
134
+ * <Option.MandatoryIndicator className="text-red-500" />
135
+ * </div>
136
+ *
137
+ * // Custom rendering
138
+ * <Option.Name asChild>
139
+ * {React.forwardRef<HTMLElement, { name: string }>(({ name, ...props }, ref) => (
140
+ * <h4 ref={ref} {...props} className="text-lg font-medium text-content-primary">
141
+ * {name}
142
+ * </h4>
143
+ * ))}
144
+ * </Option.Name>
145
+ * ```
146
+ */
147
+ export declare const Name: React.ForwardRefExoticComponent<NameProps & React.RefAttributes<HTMLElement>>;
148
+ /**
149
+ * Props for Option MandatoryIndicator component
150
+ */
151
+ export interface MandatoryIndicatorProps {
152
+ /** Whether to render as a child component */
153
+ asChild?: boolean;
154
+ /** Custom render function when using asChild */
155
+ children?: AsChildChildren<{
156
+ mandatory: boolean;
157
+ }>;
158
+ /** CSS classes to apply to the default element */
159
+ className?: string;
160
+ }
161
+ /**
162
+ * Displays the mandatory indicator (asterisk) when the option is required.
163
+ * Follows true Radix pattern - separate component for each styleable element.
164
+ *
165
+ * @component
166
+ * @example
167
+ * ```tsx
168
+ * // Default usage - only renders if mandatory
169
+ * <Option.MandatoryIndicator className="text-red-500 ml-1" />
170
+ *
171
+ * // Custom rendering
172
+ * <Option.MandatoryIndicator asChild>
173
+ * {React.forwardRef<HTMLElement, { mandatory: boolean }>(({ mandatory, ...props }, ref) => (
174
+ * mandatory ? <span ref={ref} {...props} className="text-red-500">*</span> : null
175
+ * ))}
176
+ * </Option.MandatoryIndicator>
177
+ * ```
178
+ */
179
+ export declare const MandatoryIndicator: React.ForwardRefExoticComponent<MandatoryIndicatorProps & React.RefAttributes<HTMLElement>>;
180
+ /**
181
+ * Props for Option Choices component
182
+ */
183
+ export interface ChoicesProps {
184
+ children: React.ReactNode;
185
+ emptyState?: React.ReactNode;
186
+ }
187
+ /**
188
+ * Container for the list items with empty state support.
189
+ * Follows List Container Level pattern (inspired by Product.VariantOptions).
190
+ *
191
+ * @component
192
+ *
193
+ * **Data Attributes**
194
+ *
195
+ * - `data-testid="option-choices"` - Applied to choices container (TestIds.optionChoices)
196
+ * - `data-type` - The type of the option 'color' | 'text' | 'free-text'
197
+ *
198
+ * @example
199
+ * ```tsx
200
+ * // Default usage with empty state
201
+ * <Option.Choices emptyState={<div>No choices available</div>}>
202
+ * <Option.ChoiceRepeater>
203
+ * <Choice.Text />
204
+ * <Choice.Color />
205
+ * </Option.ChoiceRepeater>
206
+ * </Option.Choices>
207
+ *
208
+ * // Simple container usage
209
+ * <Option.Choices emptyState={<div>No choices</div>}>
210
+ * <div className="choices-grid">
211
+ * <Option.ChoiceRepeater>
212
+ * <Choice.Text />
213
+ * </Option.ChoiceRepeater>
214
+ * </div>
215
+ * </Option.Choices>
216
+ * ```
217
+ */
218
+ export declare const Choices: React.ForwardRefExoticComponent<ChoicesProps & React.RefAttributes<HTMLElement>>;
219
+ /**
220
+ * Props for Option ChoiceRepeater component
221
+ */
222
+ export interface ChoiceRepeaterProps {
223
+ children: React.ReactNode;
224
+ }
225
+ /**
226
+ * Repeater component that renders Choice.Root for each choice.
227
+ * Inspired by Product.VariantOptionRepeater pattern.
228
+ *
229
+ * Now handles ProductVariantSelector.Choice logic and provides ChoiceContext.
230
+ *
231
+ * @component
232
+ *
233
+ * @example
234
+ * ```tsx
235
+ * <Option.ChoiceRepeater>
236
+ * <Choice.Text />
237
+ * <Choice.Color />
238
+ * <Choice.FreeText />
239
+ * </Option.ChoiceRepeater>
240
+ * ```
241
+ */
242
+ export declare const ChoiceRepeater: React.ForwardRefExoticComponent<ChoiceRepeaterProps & React.RefAttributes<HTMLElement>>;