@techsio/ui-kit 0.60.0 → 0.62.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.
- package/README.md +59 -0
- package/dist/atoms/action-icon.js +9 -4
- package/dist/atoms/badge.js +59 -33
- package/dist/atoms/button.js +73 -54
- package/dist/atoms/checkbox.js +5 -1
- package/dist/atoms/hotkeys.js +5 -1
- package/dist/atoms/icon.js +9 -4
- package/dist/atoms/image.js +9 -2
- package/dist/atoms/input.js +10 -6
- package/dist/atoms/label.js +6 -1
- package/dist/atoms/link-button.js +9 -4
- package/dist/atoms/link.js +6 -1
- package/dist/atoms/numeric-input.js +11 -7
- package/dist/atoms/rating.js +5 -1
- package/dist/atoms/skeleton.js +22 -15
- package/dist/atoms/status-text.js +6 -1
- package/dist/atoms/textarea.js +23 -12
- package/dist/atoms/tooltip.js +10 -5
- package/dist/internal/molecules/vertical-navigation.styles.js +7 -7
- package/dist/molecules/accordion.js +20 -14
- package/dist/molecules/availability-status.js +2 -1
- package/dist/molecules/breadcrumb.js +9 -4
- package/dist/molecules/carousel.js +5 -1
- package/dist/molecules/cascade-select.js +8 -4
- package/dist/molecules/color-select.js +5 -1
- package/dist/molecules/combobox.js +8 -4
- package/dist/molecules/date-picker.js +26 -22
- package/dist/molecules/dialog.js +7 -3
- package/dist/molecules/drawer.js +9 -5
- package/dist/molecules/file-upload.js +9 -5
- package/dist/molecules/form-checkbox.js +5 -1
- package/dist/molecules/form-input.js +12 -2
- package/dist/molecules/form-numeric-input.js +11 -1
- package/dist/molecules/form-textarea.js +12 -2
- package/dist/molecules/menu.js +17 -7
- package/dist/molecules/pagination.js +13 -8
- package/dist/molecules/phone-input.js +5 -1
- package/dist/molecules/popover.js +10 -6
- package/dist/molecules/price-block.js +1 -1
- package/dist/molecules/product-card.js +5 -5
- package/dist/molecules/quantity-field.js +5 -1
- package/dist/molecules/radio-card.js +26 -21
- package/dist/molecules/radio-group.js +24 -19
- package/dist/molecules/search-form.js +8 -4
- package/dist/molecules/select.js +8 -4
- package/dist/molecules/slider.js +5 -1
- package/dist/molecules/steps.js +24 -14
- package/dist/molecules/switch.js +5 -1
- package/dist/molecules/tabs.js +13 -8
- package/dist/molecules/toast.js +3 -3
- package/dist/molecules/totals-summary.js +5 -5
- package/dist/molecules/tree-view.js +7 -2
- package/dist/molecules/vertical-navigation.js +23 -13
- package/dist/organisms/data-table.fields.js +2 -2
- package/dist/organisms/data-table.js +39 -23
- package/dist/organisms/footer.js +5 -1
- package/dist/organisms/gallery.js +1 -1
- package/dist/organisms/header.js +7 -3
- package/dist/organisms/line-item.js +2 -2
- package/dist/organisms/sidebar.js +5 -6
- package/dist/organisms/table.js +10 -5
- package/dist/src/atoms/action-icon.d.ts +5 -5
- package/dist/src/atoms/action-icon.d.ts.map +1 -1
- package/dist/src/atoms/badge.d.ts +55 -40
- package/dist/src/atoms/badge.d.ts.map +1 -1
- package/dist/src/atoms/button.d.ts +29 -18
- package/dist/src/atoms/button.d.ts.map +1 -1
- package/dist/src/atoms/checkbox.d.ts +2 -2
- package/dist/src/atoms/checkbox.d.ts.map +1 -1
- package/dist/src/atoms/hotkeys.d.ts +2 -2
- package/dist/src/atoms/hotkeys.d.ts.map +1 -1
- package/dist/src/atoms/icon.d.ts +5 -5
- package/dist/src/atoms/icon.d.ts.map +1 -1
- package/dist/src/atoms/image.d.ts +2 -2
- package/dist/src/atoms/image.d.ts.map +1 -1
- package/dist/src/atoms/input.d.ts +5 -5
- package/dist/src/atoms/input.d.ts.map +1 -1
- package/dist/src/atoms/label.d.ts +2 -2
- package/dist/src/atoms/label.d.ts.map +1 -1
- package/dist/src/atoms/link-button.d.ts +34 -29
- package/dist/src/atoms/link-button.d.ts.map +1 -1
- package/dist/src/atoms/link.d.ts +2 -2
- package/dist/src/atoms/link.d.ts.map +1 -1
- package/dist/src/atoms/numeric-input.d.ts +9 -8
- package/dist/src/atoms/numeric-input.d.ts.map +1 -1
- package/dist/src/atoms/rating.d.ts +2 -2
- package/dist/src/atoms/rating.d.ts.map +1 -1
- package/dist/src/atoms/skeleton.d.ts +9 -9
- package/dist/src/atoms/skeleton.d.ts.map +1 -1
- package/dist/src/atoms/status-text.d.ts +2 -2
- package/dist/src/atoms/status-text.d.ts.map +1 -1
- package/dist/src/atoms/textarea.d.ts +17 -8
- package/dist/src/atoms/textarea.d.ts.map +1 -1
- package/dist/src/atoms/tooltip.d.ts +7 -7
- package/dist/src/atoms/tooltip.d.ts.map +1 -1
- package/dist/src/internal/molecules/vertical-navigation.context.d.ts +2 -2
- package/dist/src/internal/molecules/vertical-navigation.context.d.ts.map +1 -1
- package/dist/src/internal/molecules/vertical-navigation.styles.d.ts +9 -9
- package/dist/src/internal/molecules/vertical-navigation.styles.d.ts.map +1 -1
- package/dist/src/molecules/accordion.d.ts +25 -14
- package/dist/src/molecules/accordion.d.ts.map +1 -1
- package/dist/src/molecules/availability-status.d.ts +1 -1
- package/dist/src/molecules/availability-status.d.ts.map +1 -1
- package/dist/src/molecules/breadcrumb.d.ts +6 -6
- package/dist/src/molecules/breadcrumb.d.ts.map +1 -1
- package/dist/src/molecules/carousel.d.ts +2 -2
- package/dist/src/molecules/carousel.d.ts.map +1 -1
- package/dist/src/molecules/cascade-select.d.ts +3 -3
- package/dist/src/molecules/cascade-select.d.ts.map +1 -1
- package/dist/src/molecules/color-select.d.ts +2 -2
- package/dist/src/molecules/color-select.d.ts.map +1 -1
- package/dist/src/molecules/combobox.d.ts +2 -2
- package/dist/src/molecules/combobox.d.ts.map +1 -1
- package/dist/src/molecules/command.d.ts +1 -1
- package/dist/src/molecules/date-picker.d.ts +5 -5
- package/dist/src/molecules/date-picker.d.ts.map +1 -1
- package/dist/src/molecules/dialog.d.ts +1 -1
- package/dist/src/molecules/dialog.d.ts.map +1 -1
- package/dist/src/molecules/drawer.d.ts +1 -1
- package/dist/src/molecules/drawer.d.ts.map +1 -1
- package/dist/src/molecules/file-upload.d.ts +2 -2
- package/dist/src/molecules/file-upload.d.ts.map +1 -1
- package/dist/src/molecules/form-checkbox.d.ts +1 -1
- package/dist/src/molecules/form-checkbox.d.ts.map +1 -1
- package/dist/src/molecules/form-input.d.ts +2 -2
- package/dist/src/molecules/form-input.d.ts.map +1 -1
- package/dist/src/molecules/form-numeric-input.d.ts +2 -2
- package/dist/src/molecules/form-numeric-input.d.ts.map +1 -1
- package/dist/src/molecules/form-textarea.d.ts +2 -2
- package/dist/src/molecules/form-textarea.d.ts.map +1 -1
- package/dist/src/molecules/menu.d.ts +2 -2
- package/dist/src/molecules/menu.d.ts.map +1 -1
- package/dist/src/molecules/pagination.d.ts +15 -15
- package/dist/src/molecules/pagination.d.ts.map +1 -1
- package/dist/src/molecules/phone-input.d.ts +2 -2
- package/dist/src/molecules/phone-input.d.ts.map +1 -1
- package/dist/src/molecules/popover.d.ts +4 -4
- package/dist/src/molecules/popover.d.ts.map +1 -1
- package/dist/src/molecules/price-block.d.ts +1 -1
- package/dist/src/molecules/product-card.d.ts +7 -7
- package/dist/src/molecules/product-card.d.ts.map +1 -1
- package/dist/src/molecules/quantity-field.d.ts +2 -2
- package/dist/src/molecules/quantity-field.d.ts.map +1 -1
- package/dist/src/molecules/radio-card.d.ts +7 -7
- package/dist/src/molecules/radio-card.d.ts.map +1 -1
- package/dist/src/molecules/radio-group.d.ts +7 -7
- package/dist/src/molecules/radio-group.d.ts.map +1 -1
- package/dist/src/molecules/search-form.d.ts +3 -3
- package/dist/src/molecules/search-form.d.ts.map +1 -1
- package/dist/src/molecules/select.d.ts +1 -1
- package/dist/src/molecules/select.d.ts.map +1 -1
- package/dist/src/molecules/slider.d.ts +1 -1
- package/dist/src/molecules/slider.d.ts.map +1 -1
- package/dist/src/molecules/steps.d.ts +7 -7
- package/dist/src/molecules/steps.d.ts.map +1 -1
- package/dist/src/molecules/switch.d.ts +1 -1
- package/dist/src/molecules/switch.d.ts.map +1 -1
- package/dist/src/molecules/tabs.d.ts +8 -8
- package/dist/src/molecules/tabs.d.ts.map +1 -1
- package/dist/src/molecules/totals-summary.d.ts +2 -2
- package/dist/src/molecules/tour.d.ts +1 -1
- package/dist/src/molecules/tree-view.d.ts +1 -1
- package/dist/src/molecules/tree-view.d.ts.map +1 -1
- package/dist/src/molecules/vertical-navigation.d.ts +13 -11
- package/dist/src/molecules/vertical-navigation.d.ts.map +1 -1
- package/dist/src/organisms/data-table.d.ts +5 -5
- package/dist/src/organisms/data-table.d.ts.map +1 -1
- package/dist/src/organisms/footer.d.ts +2 -2
- package/dist/src/organisms/footer.d.ts.map +1 -1
- package/dist/src/organisms/gallery.d.ts +1 -1
- package/dist/src/organisms/header.d.ts +2 -2
- package/dist/src/organisms/header.d.ts.map +1 -1
- package/dist/src/organisms/line-item.d.ts +2 -2
- package/dist/src/organisms/line-item.d.ts.map +1 -1
- package/dist/src/organisms/sidebar.d.ts +4 -3
- package/dist/src/organisms/sidebar.d.ts.map +1 -1
- package/dist/src/organisms/table.d.ts +5 -5
- package/dist/src/organisms/table.d.ts.map +1 -1
- package/dist/src/templates/accordion.d.ts +2 -2
- package/dist/src/templates/accordion.d.ts.map +1 -1
- package/dist/src/templates/breadcrumb.d.ts +1 -1
- package/dist/src/templates/carousel.d.ts +1 -1
- package/dist/src/templates/facet-filter-panel.d.ts +1 -1
- package/dist/src/templates/facet-filter-panel.d.ts.map +1 -1
- package/dist/src/templates/gallery.d.ts +1 -1
- package/dist/src/templates/numeric-input.d.ts +1 -1
- package/dist/src/templates/popover.d.ts +1 -1
- package/dist/src/templates/product-card.d.ts +1 -1
- package/dist/src/templates/select.d.ts +1 -1
- package/dist/src/templates/tabs.d.ts +2 -2
- package/dist/src/templates/tabs.d.ts.map +1 -1
- package/dist/src/theme/theme-config.d.ts +11 -0
- package/dist/src/theme/theme-config.d.ts.map +1 -1
- package/dist/src/theme/theme-provider.d.ts.map +1 -1
- package/dist/src/theme/ui-provider.d.ts +48 -0
- package/dist/src/theme/ui-provider.d.ts.map +1 -0
- package/dist/templates/accordion.js +1 -3
- package/dist/templates/facet-filter-panel.js +20 -9
- package/dist/templates/product-card.js +3 -3
- package/dist/templates/tabs.js +1 -3
- package/dist/theme/theme-config.js +12 -1
- package/dist/theme/theme-provider.js +6 -2
- package/dist/theme/theme-toggle.js +4 -4
- package/dist/theme/ui-provider.js +53 -0
- package/package.json +1 -1
- package/src/tokens/_foundation-overrides.css +1 -1
- package/src/tokens/_scheme-scopes.css +8 -0
- package/src/tokens/_semantic.css +1 -1
- package/src/tokens/components/atoms/_action-icon.css +1 -1
- package/src/tokens/components/atoms/_badge.css +13 -0
- package/src/tokens/components/atoms/_icon.css +1 -1
- package/src/tokens/components/molecules/_chart.css +1 -1
- package/src/tokens/components/molecules/_combobox.css +1 -1
- package/src/tokens/figma/akros/variables.css +1 -1
- package/src/tokens/figma/business/variables.css +1 -1
- package/src/tokens/figma/dark/variables.css +1 -1
- package/src/tokens/figma/light/variables.css +1 -1
- package/src/tokens/figma/n1/variables.css +1 -1
package/dist/molecules/menu.js
CHANGED
|
@@ -7,6 +7,7 @@ import { Button } from "../atoms/button.js";
|
|
|
7
7
|
import { Icon } from "../atoms/icon.js";
|
|
8
8
|
import { OverlayPortal } from "../internal/overlay-portal.js";
|
|
9
9
|
import { useUiMessages } from "../messages/ui-messages-provider.js";
|
|
10
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
10
11
|
import * as __rspack_external__zag_js_menu_d3b38dd2 from "@zag-js/menu";
|
|
11
12
|
const menuVariants = tv({
|
|
12
13
|
slots: {
|
|
@@ -99,7 +100,8 @@ function renderMenuItem(menuItem, { api, service, slots, size, closeOnSelect, on
|
|
|
99
100
|
children: [
|
|
100
101
|
menuItem.icon && /*#__PURE__*/ jsx(Icon, {
|
|
101
102
|
className: itemIcon(),
|
|
102
|
-
icon: menuItem.icon
|
|
103
|
+
icon: menuItem.icon,
|
|
104
|
+
size: "current"
|
|
103
105
|
}),
|
|
104
106
|
/*#__PURE__*/ jsx("span", {
|
|
105
107
|
className: itemText(),
|
|
@@ -107,7 +109,8 @@ function renderMenuItem(menuItem, { api, service, slots, size, closeOnSelect, on
|
|
|
107
109
|
}),
|
|
108
110
|
/*#__PURE__*/ jsx(Icon, {
|
|
109
111
|
className: slots.submenuIndicator(),
|
|
110
|
-
icon: "token-icon-menu-submenu"
|
|
112
|
+
icon: "token-icon-menu-submenu",
|
|
113
|
+
size: "current"
|
|
111
114
|
})
|
|
112
115
|
]
|
|
113
116
|
});
|
|
@@ -161,7 +164,8 @@ function renderMenuItem(menuItem, { api, service, slots, size, closeOnSelect, on
|
|
|
161
164
|
children: [
|
|
162
165
|
menuItem.icon && /*#__PURE__*/ jsx(Icon, {
|
|
163
166
|
className: itemIcon(),
|
|
164
|
-
icon: menuItem.icon
|
|
167
|
+
icon: menuItem.icon,
|
|
168
|
+
size: "current"
|
|
165
169
|
}),
|
|
166
170
|
/*#__PURE__*/ jsx("span", {
|
|
167
171
|
className: itemText(),
|
|
@@ -179,7 +183,8 @@ function renderMenuItem(menuItem, { api, service, slots, size, closeOnSelect, on
|
|
|
179
183
|
children: [
|
|
180
184
|
menuItem.icon && /*#__PURE__*/ jsx(Icon, {
|
|
181
185
|
className: itemIcon(),
|
|
182
|
-
icon: menuItem.icon
|
|
186
|
+
icon: menuItem.icon,
|
|
187
|
+
size: "current"
|
|
183
188
|
}),
|
|
184
189
|
/*#__PURE__*/ jsx("span", {
|
|
185
190
|
className: itemText(),
|
|
@@ -236,7 +241,8 @@ function SubmenuItem({ item, parentApi, parentService, size = "md", onCheckedCha
|
|
|
236
241
|
children: [
|
|
237
242
|
item.icon && /*#__PURE__*/ jsx(Icon, {
|
|
238
243
|
className: itemIcon(),
|
|
239
|
-
icon: item.icon
|
|
244
|
+
icon: item.icon,
|
|
245
|
+
size: "current"
|
|
240
246
|
}),
|
|
241
247
|
/*#__PURE__*/ jsx("span", {
|
|
242
248
|
className: itemText(),
|
|
@@ -244,7 +250,8 @@ function SubmenuItem({ item, parentApi, parentService, size = "md", onCheckedCha
|
|
|
244
250
|
}),
|
|
245
251
|
/*#__PURE__*/ jsx(Icon, {
|
|
246
252
|
className: submenuIndicator(),
|
|
247
|
-
icon: "token-icon-menu-submenu"
|
|
253
|
+
icon: "token-icon-menu-submenu",
|
|
254
|
+
size: "current"
|
|
248
255
|
})
|
|
249
256
|
]
|
|
250
257
|
}),
|
|
@@ -264,7 +271,10 @@ function SubmenuItem({ item, parentApi, parentService, size = "md", onCheckedCha
|
|
|
264
271
|
]
|
|
265
272
|
});
|
|
266
273
|
}
|
|
267
|
-
function Menu({ "aria-label": ariaLabel, dir, id, closeOnSelect = true, loopFocus = true, typeahead = true, positioning, anchorPoint, open, defaultOpen, composite, navigate, defaultHighlightedValue, highlightedValue, onHighlightChange, onSelect, onOpenChange, onEscapeKeyDown, onPointerDownOutside, onInteractOutside, onFocusOutside, items, triggerText, triggerIcon, customTrigger, contextMenu = false, className, size
|
|
274
|
+
function Menu({ "aria-label": ariaLabel, dir, id, closeOnSelect = true, loopFocus = true, typeahead = true, positioning, anchorPoint, open, defaultOpen, composite, navigate, defaultHighlightedValue, highlightedValue, onHighlightChange, onSelect, onOpenChange, onEscapeKeyDown, onPointerDownOutside, onInteractOutside, onFocusOutside, items, triggerText, triggerIcon, customTrigger, contextMenu = false, className, size: sizeProp, onCheckedChange }) {
|
|
275
|
+
const { size = "md" } = useUIDefaults("Menu", {
|
|
276
|
+
size: sizeProp
|
|
277
|
+
}, menuVariants);
|
|
268
278
|
const generatedId = useId();
|
|
269
279
|
const messages = useUiMessages();
|
|
270
280
|
const contextInvoker = useRef(null);
|
|
@@ -7,6 +7,7 @@ import { Icon } from "../atoms/icon.js";
|
|
|
7
7
|
import { LinkButton } from "../atoms/link-button.js";
|
|
8
8
|
import { definedEntries } from "../messages/ui-messages.js";
|
|
9
9
|
import { useUiMessages } from "../messages/ui-messages-provider.js";
|
|
10
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
10
11
|
import { tv } from "../utils.js";
|
|
11
12
|
const paginationVariants = tv({
|
|
12
13
|
slots: {
|
|
@@ -47,8 +48,8 @@ const paginationVariants = tv({
|
|
|
47
48
|
}
|
|
48
49
|
],
|
|
49
50
|
variants: {
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
appearance: {
|
|
52
|
+
solid: {
|
|
52
53
|
item: "bg-pagination-bg-base",
|
|
53
54
|
link: [
|
|
54
55
|
"data-selected:border-pagination-border-active data-selected:bg-pagination-bg-active data-selected:text-pagination-fg-filled-active",
|
|
@@ -56,14 +57,14 @@ const paginationVariants = tv({
|
|
|
56
57
|
"hover:text-pagination-fg-filled-active"
|
|
57
58
|
]
|
|
58
59
|
},
|
|
59
|
-
|
|
60
|
+
outline: {
|
|
60
61
|
item: "bg-pagination-bg-base",
|
|
61
62
|
link: [
|
|
62
63
|
"data-selected:border-pagination-border-active data-selected:text-pagination-fg-outlined-active",
|
|
63
64
|
"hover:border-pagination-border-hover hover:text-pagination-fg-outlined-active"
|
|
64
65
|
]
|
|
65
66
|
},
|
|
66
|
-
|
|
67
|
+
ghost: {
|
|
67
68
|
link: [
|
|
68
69
|
"border-transparent",
|
|
69
70
|
"data-selected:decoration-(length:--text-decoration-thickness-pagination-marker) data-selected:underline-offset-(length:--text-underline-offset-pagination-marker) data-selected:text-pagination-fg-minimal-active data-selected:underline",
|
|
@@ -87,7 +88,7 @@ const paginationVariants = tv({
|
|
|
87
88
|
}
|
|
88
89
|
},
|
|
89
90
|
defaultVariants: {
|
|
90
|
-
|
|
91
|
+
appearance: "solid",
|
|
91
92
|
size: "md"
|
|
92
93
|
}
|
|
93
94
|
});
|
|
@@ -156,9 +157,13 @@ function usePaginationPage({ page, defaultPage = 1, count, pageSize = 10, onChan
|
|
|
156
157
|
setUncontrolledPage
|
|
157
158
|
};
|
|
158
159
|
}
|
|
159
|
-
function Pagination({ page, defaultPage = 1, count, pageSize = 10, siblingCount = 1, boundaryCount = 1, showPrevNext = true,
|
|
160
|
+
function Pagination({ page, defaultPage = 1, count, pageSize = 10, siblingCount = 1, boundaryCount = 1, showPrevNext = true, appearance: appearanceProp, className, dir = "ltr", getPageUrl, linkAs, linkProps, size: sizeProp, compact = false, compactLabel, onChange, onPageChange, translations, ...props }) {
|
|
160
161
|
const messages = useUiMessages();
|
|
161
162
|
const uniqueId = useId();
|
|
163
|
+
const { size, appearance } = useUIDefaults("Pagination", {
|
|
164
|
+
size: sizeProp,
|
|
165
|
+
appearance: appearanceProp
|
|
166
|
+
}, paginationVariants);
|
|
162
167
|
const { safeCount, safePageSize, totalPages, effectivePage, pendingCorrection, setUncontrolledPage } = usePaginationPage({
|
|
163
168
|
page,
|
|
164
169
|
defaultPage,
|
|
@@ -190,7 +195,7 @@ function Pagination({ page, defaultPage = 1, count, pageSize = 10, siblingCount
|
|
|
190
195
|
});
|
|
191
196
|
const api = connect(service, normalizeProps);
|
|
192
197
|
const { base, list, link, item, ellipsis, compactText } = paginationVariants({
|
|
193
|
-
|
|
198
|
+
appearance,
|
|
194
199
|
size
|
|
195
200
|
});
|
|
196
201
|
const rootProps = mergeProps(props, api.getRootProps(), props["aria-label"] ? {
|
|
@@ -212,7 +217,7 @@ function Pagination({ page, defaultPage = 1, count, pageSize = 10, siblingCount
|
|
|
212
217
|
} : void 0,
|
|
213
218
|
className: link(),
|
|
214
219
|
size: "current",
|
|
215
|
-
|
|
220
|
+
unstyled: true,
|
|
216
221
|
...overrides
|
|
217
222
|
});
|
|
218
223
|
return mergeProps(isNavigable ? {
|
|
@@ -8,6 +8,7 @@ import { StatusText } from "../atoms/status-text.js";
|
|
|
8
8
|
import { joinDescribedBy, useDescribedBy, useRegisterDescription } from "../internal/described-by.js";
|
|
9
9
|
import { subscribeOwnerFormReset } from "../internal/form-control-lifecycle.js";
|
|
10
10
|
import { useUiMessages } from "../messages/ui-messages-provider.js";
|
|
11
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
11
12
|
import { tv } from "../utils.js";
|
|
12
13
|
import { Select } from "./select.js";
|
|
13
14
|
const phoneDigit = /\d/;
|
|
@@ -148,7 +149,10 @@ function usePhoneInputItemContext() {
|
|
|
148
149
|
if (!context) throw new Error("PhoneInput item components must be used within PhoneInput.Item");
|
|
149
150
|
return context;
|
|
150
151
|
}
|
|
151
|
-
function PhoneInput({ countries: countriesProp, value, defaultValue = "", country, defaultCountry = "CZ", name, countryName, form, required = false, disabled = false, readOnly = false, nativeValidation = false, nativeValidationMessage, validateStatus = "default", onValueChange, onCountryChange, size
|
|
152
|
+
function PhoneInput({ countries: countriesProp, value, defaultValue = "", country, defaultCountry = "CZ", name, countryName, form, required = false, disabled = false, readOnly = false, nativeValidation = false, nativeValidationMessage, validateStatus = "default", onValueChange, onCountryChange, size: sizeProp, id: providedId, className, children, ref, ...props }) {
|
|
153
|
+
const { size = "md" } = useUIDefaults("PhoneInput", {
|
|
154
|
+
size: sizeProp
|
|
155
|
+
}, phoneInputVariants);
|
|
152
156
|
const messages = useUiMessages();
|
|
153
157
|
const generatedId = useId();
|
|
154
158
|
const id = providedId || generatedId;
|
|
@@ -9,6 +9,7 @@ import { Button } from "../atoms/button.js";
|
|
|
9
9
|
import { OverlayContainerProvider, OverlayPortal } from "../internal/overlay-portal.js";
|
|
10
10
|
import { definedEntries } from "../messages/ui-messages.js";
|
|
11
11
|
import { useUiMessages } from "../messages/ui-messages-provider.js";
|
|
12
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
12
13
|
import { tv } from "../utils.js";
|
|
13
14
|
const popoverVariants = tv({
|
|
14
15
|
slots: {
|
|
@@ -91,7 +92,10 @@ function usePopoverContext() {
|
|
|
91
92
|
function Popover({ autoFocus = true, border, children, closeOnEscape = true, closeOnInteractOutside = true, defaultOpen, dir = "ltr", flip = true, gutter = 8, id, modal = false, offset = {
|
|
92
93
|
mainAxis: 8,
|
|
93
94
|
crossAxis: 0
|
|
94
|
-
}, onOpenChange, onPointerDownOutside, open, overflowPadding = 8, placement = "bottom", portalled = true, sameWidth = false, shadow, size, slide = true, ...props }) {
|
|
95
|
+
}, onOpenChange, onPointerDownOutside, open, overflowPadding = 8, placement = "bottom", portalled = true, sameWidth = false, shadow, size: sizeProp, slide = true, ...props }) {
|
|
96
|
+
const { size } = useUIDefaults("Popover", {
|
|
97
|
+
size: sizeProp
|
|
98
|
+
}, popoverVariants);
|
|
95
99
|
const messages = useUiMessages();
|
|
96
100
|
const generatedId = useId();
|
|
97
101
|
const uniqueId = id || generatedId;
|
|
@@ -152,13 +156,14 @@ Popover.Anchor = function({ className, ref, ...props }) {
|
|
|
152
156
|
ref: ref
|
|
153
157
|
});
|
|
154
158
|
};
|
|
155
|
-
Popover.Trigger = function({ children, className, clickBehavior = "toggle", disabled, onClick, ref, size = "current",
|
|
159
|
+
Popover.Trigger = function({ children, className, clickBehavior = "toggle", disabled, onClick, ref, size = "current", appearance = "ghost", type = "button", ...props }) {
|
|
156
160
|
const { api, styles } = usePopoverContext();
|
|
157
161
|
const { disabled: machineDisabled, onClick: onMachineClick, ...machineTriggerProps } = api.getTriggerProps();
|
|
158
162
|
const buttonProps = mergeProps(props, machineTriggerProps);
|
|
159
163
|
const isDisabled = Boolean(disabled || machineDisabled);
|
|
160
164
|
return /*#__PURE__*/ jsx(Button, {
|
|
161
165
|
...buttonProps,
|
|
166
|
+
appearance: appearance,
|
|
162
167
|
className: styles.trigger({
|
|
163
168
|
className
|
|
164
169
|
}),
|
|
@@ -170,7 +175,6 @@ Popover.Trigger = function({ children, className, clickBehavior = "toggle", disa
|
|
|
170
175
|
},
|
|
171
176
|
ref: ref,
|
|
172
177
|
size: size,
|
|
173
|
-
theme: theme,
|
|
174
178
|
type: type,
|
|
175
179
|
children: children
|
|
176
180
|
});
|
|
@@ -302,7 +306,7 @@ Popover.Description = function({ className, ref, ...props }) {
|
|
|
302
306
|
ref: ref
|
|
303
307
|
});
|
|
304
308
|
};
|
|
305
|
-
Popover.CloseTrigger = function({ children, className, icon, onClick, ref, size = "current",
|
|
309
|
+
Popover.CloseTrigger = function({ children, className, icon, onClick, ref, size = "current", unstyled, type = "button", ...props }) {
|
|
306
310
|
const messages = useUiMessages();
|
|
307
311
|
const { api, styles } = usePopoverContext();
|
|
308
312
|
const chromeContainer = useContext(PopoverChromeContext);
|
|
@@ -321,8 +325,8 @@ Popover.CloseTrigger = function({ children, className, icon, onClick, ref, size
|
|
|
321
325
|
onClick: handleClick,
|
|
322
326
|
ref: ref,
|
|
323
327
|
size: size,
|
|
324
|
-
theme: theme,
|
|
325
328
|
type: type,
|
|
329
|
+
unstyled: unstyled ?? (void 0 === props.appearance && void 0 === props.severity),
|
|
326
330
|
children: children
|
|
327
331
|
}) : /*#__PURE__*/ jsx(ActionIcon, {
|
|
328
332
|
...buttonProps,
|
|
@@ -333,8 +337,8 @@ Popover.CloseTrigger = function({ children, className, icon, onClick, ref, size
|
|
|
333
337
|
icon: icon ?? "token-icon-close",
|
|
334
338
|
onClick: handleClick,
|
|
335
339
|
ref: ref,
|
|
340
|
+
severity: "neutral",
|
|
336
341
|
size: "current" === size ? "md" : size,
|
|
337
|
-
tone: "neutral",
|
|
338
342
|
type: type
|
|
339
343
|
});
|
|
340
344
|
return chromeContainer ? /*#__PURE__*/ createPortal(closeTrigger, chromeContainer) : closeTrigger;
|
|
@@ -105,8 +105,8 @@ function PriceBlock({ state, amountLabel, originalLabel, originalSrLabel, discou
|
|
|
105
105
|
]
|
|
106
106
|
}) : null,
|
|
107
107
|
"discounted" === state && discountLabel ? /*#__PURE__*/ jsx(Badge, {
|
|
108
|
+
severity: "discount",
|
|
108
109
|
size: "sm",
|
|
109
|
-
variant: "discount",
|
|
110
110
|
children: discountLabel
|
|
111
111
|
}) : null
|
|
112
112
|
]
|
|
@@ -57,7 +57,7 @@ const productCardVariants = tv({
|
|
|
57
57
|
imageSlot: "object-fill"
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
-
|
|
60
|
+
action: {
|
|
61
61
|
cart: {
|
|
62
62
|
button: "w-max bg-product-card-button-cart-bg-base text-product-card-button-cart-fg hover:bg-product-card-button-cart-bg-hover active:bg-product-card-button-cart-bg-active active:text-product-card-button-cart-fg"
|
|
63
63
|
},
|
|
@@ -103,7 +103,7 @@ const productCardVariants = tv({
|
|
|
103
103
|
shadow: true,
|
|
104
104
|
objectFit: "cover",
|
|
105
105
|
layout: "column",
|
|
106
|
-
|
|
106
|
+
action: "cart"
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
const ProductCardContext = /*#__PURE__*/ createContext({});
|
|
@@ -236,9 +236,9 @@ ProductCard.Actions = function({ children, className, ref, ...props }) {
|
|
|
236
236
|
children: children
|
|
237
237
|
});
|
|
238
238
|
};
|
|
239
|
-
ProductCard.Button = function({ children, onClick, icon, iconSize, className,
|
|
239
|
+
ProductCard.Button = function({ children, onClick, icon, iconSize, className, action, ref, ...props }) {
|
|
240
240
|
const { button } = productCardVariants({
|
|
241
|
-
|
|
241
|
+
action
|
|
242
242
|
});
|
|
243
243
|
return /*#__PURE__*/ jsx(Button, {
|
|
244
244
|
className: button({
|
|
@@ -248,8 +248,8 @@ ProductCard.Button = function({ children, onClick, icon, iconSize, className, bu
|
|
|
248
248
|
iconSize: iconSize,
|
|
249
249
|
onClick: onClick,
|
|
250
250
|
ref: ref,
|
|
251
|
+
severity: "detail" === action || "wishlist" === action ? "secondary" : "primary",
|
|
251
252
|
size: "sm",
|
|
252
|
-
variant: "detail" === buttonVariant || "wishlist" === buttonVariant ? "secondary" : "primary",
|
|
253
253
|
...props,
|
|
254
254
|
children: children
|
|
255
255
|
});
|
|
@@ -4,6 +4,7 @@ import { useId } from "react";
|
|
|
4
4
|
import { Label } from "../atoms/label.js";
|
|
5
5
|
import { NumericInput } from "../atoms/numeric-input.js";
|
|
6
6
|
import { StatusText } from "../atoms/status-text.js";
|
|
7
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
7
8
|
import { tv } from "../utils.js";
|
|
8
9
|
const descriptionSeparator = /\s+/;
|
|
9
10
|
const quantityFieldVariants = tv({
|
|
@@ -42,7 +43,10 @@ const quantityFieldVariants = tv({
|
|
|
42
43
|
function hasContent(content) {
|
|
43
44
|
return null != content && false !== content && "" !== content;
|
|
44
45
|
}
|
|
45
|
-
function QuantityField({ id, label, unitLabel, value, onValueChange, onValueCommit, helperText, error, hideLabel = false, pending = false, pendingLabel, disabled = false, readOnly = false, required, requiredLabel, describedBy, "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, autoFocus, size
|
|
46
|
+
function QuantityField({ id, label, unitLabel, value, onValueChange, onValueCommit, helperText, error, hideLabel = false, pending = false, pendingLabel, disabled = false, readOnly = false, required, requiredLabel, describedBy, "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, autoFocus, size: sizeProp, formatOptions, ref, className, ...props }) {
|
|
47
|
+
const { size = "md" } = useUIDefaults("QuantityField", {
|
|
48
|
+
size: sizeProp
|
|
49
|
+
}, quantityFieldVariants);
|
|
46
50
|
const generatedId = useId();
|
|
47
51
|
const inputId = id ?? generatedId;
|
|
48
52
|
const unitId = `${inputId}-unit`;
|
|
@@ -7,6 +7,7 @@ import { Label } from "../atoms/label.js";
|
|
|
7
7
|
import { StatusText } from "../atoms/status-text.js";
|
|
8
8
|
import { commitRadioClick, getControlledChoiceInputProps, handleChoiceArrowKey, isSilentChoiceReset, mergeChoiceInputProps, useChoiceFocusRecovery } from "../internal/choice-control.js";
|
|
9
9
|
import { joinDescribedBy, useDescribedBy, useRegisterDescription } from "../internal/described-by.js";
|
|
10
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
10
11
|
import { tv } from "../utils.js";
|
|
11
12
|
import { radioChoiceMachine } from "./radio-group.js";
|
|
12
13
|
const radioCardVariants = tv({
|
|
@@ -103,7 +104,7 @@ const radioCardVariants = tv({
|
|
|
103
104
|
hiddenInput: "sr-only"
|
|
104
105
|
},
|
|
105
106
|
variants: {
|
|
106
|
-
|
|
107
|
+
appearance: {
|
|
107
108
|
outline: {
|
|
108
109
|
item: [
|
|
109
110
|
"radio-card-outline-readable",
|
|
@@ -268,7 +269,7 @@ const radioCardVariants = tv({
|
|
|
268
269
|
}
|
|
269
270
|
},
|
|
270
271
|
defaultVariants: {
|
|
271
|
-
|
|
272
|
+
appearance: "outline",
|
|
272
273
|
size: "md",
|
|
273
274
|
itemOrientation: "horizontal",
|
|
274
275
|
align: "start",
|
|
@@ -288,7 +289,11 @@ function useRadioCardItemContext() {
|
|
|
288
289
|
if (!context) throw new Error("RadioCard item components must be used within RadioCard.Item");
|
|
289
290
|
return context;
|
|
290
291
|
}
|
|
291
|
-
function RadioCard({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedByProp, id: providedId, disabled = false, readOnly = false, required = false, orientation = "horizontal", itemOrientation = "horizontal", align = "start", justify = "between", validateStatus = "default", onValueChange,
|
|
292
|
+
function RadioCard({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedByProp, id: providedId, disabled = false, readOnly = false, required = false, orientation = "horizontal", itemOrientation = "horizontal", align = "start", justify = "between", validateStatus = "default", onValueChange, appearance: appearanceProp, size: sizeProp, children, className, ref, ...machineProps }) {
|
|
293
|
+
const { size = "md", appearance = "outline" } = useUIDefaults("RadioCard", {
|
|
294
|
+
size: sizeProp,
|
|
295
|
+
appearance: appearanceProp
|
|
296
|
+
}, radioCardVariants);
|
|
292
297
|
const generatedId = useId();
|
|
293
298
|
const id = providedId || generatedId;
|
|
294
299
|
const invalid = "error" === validateStatus;
|
|
@@ -308,7 +313,7 @@ function RadioCard({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy,
|
|
|
308
313
|
const focusRef = useChoiceFocusRecovery();
|
|
309
314
|
const styles = radioCardVariants({
|
|
310
315
|
size,
|
|
311
|
-
|
|
316
|
+
appearance,
|
|
312
317
|
itemOrientation,
|
|
313
318
|
align,
|
|
314
319
|
justify
|
|
@@ -324,7 +329,7 @@ function RadioCard({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy,
|
|
|
324
329
|
errorMessageId: errors.describedById,
|
|
325
330
|
registerError: errors.registerDescription,
|
|
326
331
|
...describedBy,
|
|
327
|
-
|
|
332
|
+
appearance,
|
|
328
333
|
size,
|
|
329
334
|
itemOrientation,
|
|
330
335
|
align,
|
|
@@ -366,10 +371,10 @@ RadioCard.Label = function({ children, disabled, required, size: sizeProp, ...pr
|
|
|
366
371
|
});
|
|
367
372
|
};
|
|
368
373
|
RadioCard.Item = function({ value, disabled, invalid, children, className, ref, ...props }) {
|
|
369
|
-
const { api, size,
|
|
374
|
+
const { api, size, appearance } = useRadioCardContext();
|
|
370
375
|
const styles = radioCardVariants({
|
|
371
376
|
size,
|
|
372
|
-
|
|
377
|
+
appearance
|
|
373
378
|
});
|
|
374
379
|
const itemProps = {
|
|
375
380
|
value,
|
|
@@ -394,11 +399,11 @@ RadioCard.Item = function({ value, disabled, invalid, children, className, ref,
|
|
|
394
399
|
});
|
|
395
400
|
};
|
|
396
401
|
RadioCard.ItemHiddenInput = function({ className, ref, ...props }) {
|
|
397
|
-
const { api, selectValue, size,
|
|
402
|
+
const { api, selectValue, size, appearance, readOnly, callerDescribedBy, describedById, errorMessageId, validateStatus } = useRadioCardContext();
|
|
398
403
|
const { itemProps, describedById: itemDescriptionId } = useRadioCardItemContext();
|
|
399
404
|
const styles = radioCardVariants({
|
|
400
405
|
size,
|
|
401
|
-
|
|
406
|
+
appearance
|
|
402
407
|
});
|
|
403
408
|
const hiddenInputProps = getControlledChoiceInputProps(mergeChoiceInputProps(props, commitRadioClick(api.getItemHiddenInputProps(itemProps), readOnly, ()=>selectValue(itemProps.value))), api.getItemState(itemProps).checked);
|
|
404
409
|
return /*#__PURE__*/ jsx("input", {
|
|
@@ -434,11 +439,11 @@ RadioCard.ItemHiddenInput = function({ className, ref, ...props }) {
|
|
|
434
439
|
});
|
|
435
440
|
};
|
|
436
441
|
RadioCard.ItemControl = function({ children, className, ref, ...props }) {
|
|
437
|
-
const { api, size,
|
|
442
|
+
const { api, size, appearance, itemOrientation, align, justify } = useRadioCardContext();
|
|
438
443
|
const { itemProps } = useRadioCardItemContext();
|
|
439
444
|
const styles = radioCardVariants({
|
|
440
445
|
size,
|
|
441
|
-
|
|
446
|
+
appearance,
|
|
442
447
|
itemOrientation,
|
|
443
448
|
align,
|
|
444
449
|
justify
|
|
@@ -455,10 +460,10 @@ RadioCard.ItemControl = function({ children, className, ref, ...props }) {
|
|
|
455
460
|
});
|
|
456
461
|
};
|
|
457
462
|
RadioCard.ItemContent = function({ children, className, ref, ...props }) {
|
|
458
|
-
const { size,
|
|
463
|
+
const { size, appearance, itemOrientation, align } = useRadioCardContext();
|
|
459
464
|
const styles = radioCardVariants({
|
|
460
465
|
size,
|
|
461
|
-
|
|
466
|
+
appearance,
|
|
462
467
|
itemOrientation,
|
|
463
468
|
align
|
|
464
469
|
});
|
|
@@ -472,11 +477,11 @@ RadioCard.ItemContent = function({ children, className, ref, ...props }) {
|
|
|
472
477
|
});
|
|
473
478
|
};
|
|
474
479
|
RadioCard.ItemText = function({ children, className, ref, ...props }) {
|
|
475
|
-
const { api, size,
|
|
480
|
+
const { api, size, appearance, itemOrientation, align } = useRadioCardContext();
|
|
476
481
|
const { itemProps } = useRadioCardItemContext();
|
|
477
482
|
const styles = radioCardVariants({
|
|
478
483
|
size,
|
|
479
|
-
|
|
484
|
+
appearance,
|
|
480
485
|
itemOrientation,
|
|
481
486
|
align
|
|
482
487
|
});
|
|
@@ -491,14 +496,14 @@ RadioCard.ItemText = function({ children, className, ref, ...props }) {
|
|
|
491
496
|
});
|
|
492
497
|
};
|
|
493
498
|
RadioCard.ItemDescription = function({ children, className, ref, ...props }) {
|
|
494
|
-
const { api, size,
|
|
499
|
+
const { api, size, appearance, align } = useRadioCardContext();
|
|
495
500
|
const { itemProps, registerDescription } = useRadioCardItemContext();
|
|
496
501
|
const generatedId = useId();
|
|
497
502
|
const id = props.id ?? generatedId;
|
|
498
503
|
useRegisterDescription(id, registerDescription);
|
|
499
504
|
const styles = radioCardVariants({
|
|
500
505
|
size,
|
|
501
|
-
|
|
506
|
+
appearance,
|
|
502
507
|
align
|
|
503
508
|
});
|
|
504
509
|
const itemState = api.getItemState(itemProps);
|
|
@@ -516,11 +521,11 @@ RadioCard.ItemDescription = function({ children, className, ref, ...props }) {
|
|
|
516
521
|
});
|
|
517
522
|
};
|
|
518
523
|
RadioCard.ItemIndicator = function({ className, ref, ...props }) {
|
|
519
|
-
const { api, size,
|
|
524
|
+
const { api, size, appearance } = useRadioCardContext();
|
|
520
525
|
const { itemProps } = useRadioCardItemContext();
|
|
521
526
|
const styles = radioCardVariants({
|
|
522
527
|
size,
|
|
523
|
-
|
|
528
|
+
appearance
|
|
524
529
|
});
|
|
525
530
|
const itemState = api.getItemState(itemProps);
|
|
526
531
|
return /*#__PURE__*/ jsx("span", {
|
|
@@ -545,14 +550,14 @@ RadioCard.ItemIndicator = function({ className, ref, ...props }) {
|
|
|
545
550
|
});
|
|
546
551
|
};
|
|
547
552
|
RadioCard.ItemAddon = function({ children, className, ref, ...props }) {
|
|
548
|
-
const { api, size,
|
|
553
|
+
const { api, size, appearance, align } = useRadioCardContext();
|
|
549
554
|
const { itemProps, registerDescription } = useRadioCardItemContext();
|
|
550
555
|
const generatedId = useId();
|
|
551
556
|
const id = props.id ?? generatedId;
|
|
552
557
|
useRegisterDescription(id, registerDescription);
|
|
553
558
|
const styles = radioCardVariants({
|
|
554
559
|
size,
|
|
555
|
-
|
|
560
|
+
appearance,
|
|
556
561
|
align
|
|
557
562
|
});
|
|
558
563
|
const itemState = api.getItemState(itemProps);
|
|
@@ -7,6 +7,7 @@ import { Label } from "../atoms/label.js";
|
|
|
7
7
|
import { StatusText } from "../atoms/status-text.js";
|
|
8
8
|
import { commitRadioClick, getControlledChoiceInputProps, handleChoiceArrowKey, isSilentChoiceReset, mergeChoiceInputProps, runSilentChoiceReset, trackChoiceFormControl, useChoiceFocusRecovery } from "../internal/choice-control.js";
|
|
9
9
|
import { joinDescribedBy, useDescribedBy, useRegisterDescription } from "../internal/described-by.js";
|
|
10
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
10
11
|
import { tv } from "../utils.js";
|
|
11
12
|
const radioChoiceMachine = {
|
|
12
13
|
...machine,
|
|
@@ -88,7 +89,7 @@ const radioGroupVariants = tv({
|
|
|
88
89
|
hiddenInput: "sr-only"
|
|
89
90
|
},
|
|
90
91
|
variants: {
|
|
91
|
-
|
|
92
|
+
appearance: {
|
|
92
93
|
outline: {
|
|
93
94
|
itemControl: [
|
|
94
95
|
"data-[state=checked]:bg-radio-group-item-bg-outline-checked",
|
|
@@ -151,7 +152,7 @@ const radioGroupVariants = tv({
|
|
|
151
152
|
}
|
|
152
153
|
},
|
|
153
154
|
defaultVariants: {
|
|
154
|
-
|
|
155
|
+
appearance: "outline",
|
|
155
156
|
size: "md"
|
|
156
157
|
}
|
|
157
158
|
});
|
|
@@ -168,7 +169,11 @@ function useRadioGroupItemContext() {
|
|
|
168
169
|
if (!context) throw new Error("RadioGroup item components must be used within RadioGroup.Item");
|
|
169
170
|
return context;
|
|
170
171
|
}
|
|
171
|
-
function RadioGroup({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedByProp, id: providedId, disabled = false, readOnly = false, required = false, orientation = "vertical", validateStatus = "default", onValueChange,
|
|
172
|
+
function RadioGroup({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedByProp, id: providedId, disabled = false, readOnly = false, required = false, orientation = "vertical", validateStatus = "default", onValueChange, appearance: appearanceProp, size: sizeProp, children, className, ref, ...machineProps }) {
|
|
173
|
+
const { size = "md", appearance = "outline" } = useUIDefaults("RadioGroup", {
|
|
174
|
+
size: sizeProp,
|
|
175
|
+
appearance: appearanceProp
|
|
176
|
+
}, radioGroupVariants);
|
|
172
177
|
const generatedId = useId();
|
|
173
178
|
const id = providedId || generatedId;
|
|
174
179
|
const invalid = "error" === validateStatus;
|
|
@@ -188,7 +193,7 @@ function RadioGroup({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy
|
|
|
188
193
|
const focusRef = useChoiceFocusRecovery();
|
|
189
194
|
const styles = radioGroupVariants({
|
|
190
195
|
size,
|
|
191
|
-
|
|
196
|
+
appearance
|
|
192
197
|
});
|
|
193
198
|
const describedBy = useDescribedBy();
|
|
194
199
|
const errors = useDescribedBy();
|
|
@@ -201,7 +206,7 @@ function RadioGroup({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy
|
|
|
201
206
|
errorMessageId: errors.describedById,
|
|
202
207
|
registerError: errors.registerDescription,
|
|
203
208
|
...describedBy,
|
|
204
|
-
|
|
209
|
+
appearance,
|
|
205
210
|
size,
|
|
206
211
|
orientation,
|
|
207
212
|
disabled,
|
|
@@ -242,10 +247,10 @@ RadioGroup.Label = function({ children, disabled, required, size: sizeProp, ...p
|
|
|
242
247
|
});
|
|
243
248
|
};
|
|
244
249
|
RadioGroup.ItemGroup = function({ children, className, ref, ...props }) {
|
|
245
|
-
const { size,
|
|
250
|
+
const { size, appearance, orientation } = useRadioGroupContext();
|
|
246
251
|
const styles = radioGroupVariants({
|
|
247
252
|
size,
|
|
248
|
-
|
|
253
|
+
appearance
|
|
249
254
|
});
|
|
250
255
|
return /*#__PURE__*/ jsx("div", {
|
|
251
256
|
className: styles.itemGroup({
|
|
@@ -258,10 +263,10 @@ RadioGroup.ItemGroup = function({ children, className, ref, ...props }) {
|
|
|
258
263
|
});
|
|
259
264
|
};
|
|
260
265
|
RadioGroup.Item = function({ value, disabled, invalid, children, className, ref, ...props }) {
|
|
261
|
-
const { api, size,
|
|
266
|
+
const { api, size, appearance } = useRadioGroupContext();
|
|
262
267
|
const styles = radioGroupVariants({
|
|
263
268
|
size,
|
|
264
|
-
|
|
269
|
+
appearance
|
|
265
270
|
});
|
|
266
271
|
const itemProps = {
|
|
267
272
|
value,
|
|
@@ -286,11 +291,11 @@ RadioGroup.Item = function({ value, disabled, invalid, children, className, ref,
|
|
|
286
291
|
});
|
|
287
292
|
};
|
|
288
293
|
RadioGroup.ItemHiddenInput = function({ className, ref, ...props }) {
|
|
289
|
-
const { api, selectValue, size,
|
|
294
|
+
const { api, selectValue, size, appearance, readOnly, callerDescribedBy, describedById, errorMessageId, validateStatus } = useRadioGroupContext();
|
|
290
295
|
const { itemProps, describedById: itemDescriptionId } = useRadioGroupItemContext();
|
|
291
296
|
const styles = radioGroupVariants({
|
|
292
297
|
size,
|
|
293
|
-
|
|
298
|
+
appearance
|
|
294
299
|
});
|
|
295
300
|
const inputProps = getControlledChoiceInputProps(mergeChoiceInputProps(props, commitRadioClick(api.getItemHiddenInputProps(itemProps), readOnly, ()=>selectValue(itemProps.value))), api.getItemState(itemProps).checked);
|
|
296
301
|
return /*#__PURE__*/ jsx("input", {
|
|
@@ -326,11 +331,11 @@ RadioGroup.ItemHiddenInput = function({ className, ref, ...props }) {
|
|
|
326
331
|
});
|
|
327
332
|
};
|
|
328
333
|
RadioGroup.ItemControl = function({ children, className, ref, ...props }) {
|
|
329
|
-
const { api, size,
|
|
334
|
+
const { api, size, appearance } = useRadioGroupContext();
|
|
330
335
|
const { itemProps } = useRadioGroupItemContext();
|
|
331
336
|
const styles = radioGroupVariants({
|
|
332
337
|
size,
|
|
333
|
-
|
|
338
|
+
appearance
|
|
334
339
|
});
|
|
335
340
|
const itemState = api.getItemState(itemProps);
|
|
336
341
|
return /*#__PURE__*/ jsxs("span", {
|
|
@@ -353,10 +358,10 @@ RadioGroup.ItemControl = function({ children, className, ref, ...props }) {
|
|
|
353
358
|
});
|
|
354
359
|
};
|
|
355
360
|
RadioGroup.ItemContent = function({ children, className, ref, ...props }) {
|
|
356
|
-
const { size,
|
|
361
|
+
const { size, appearance } = useRadioGroupContext();
|
|
357
362
|
const styles = radioGroupVariants({
|
|
358
363
|
size,
|
|
359
|
-
|
|
364
|
+
appearance
|
|
360
365
|
});
|
|
361
366
|
return /*#__PURE__*/ jsx("div", {
|
|
362
367
|
className: styles.itemContent({
|
|
@@ -368,11 +373,11 @@ RadioGroup.ItemContent = function({ children, className, ref, ...props }) {
|
|
|
368
373
|
});
|
|
369
374
|
};
|
|
370
375
|
RadioGroup.ItemText = function({ children, className, ref, ...props }) {
|
|
371
|
-
const { api, size,
|
|
376
|
+
const { api, size, appearance } = useRadioGroupContext();
|
|
372
377
|
const { itemProps } = useRadioGroupItemContext();
|
|
373
378
|
const styles = radioGroupVariants({
|
|
374
379
|
size,
|
|
375
|
-
|
|
380
|
+
appearance
|
|
376
381
|
});
|
|
377
382
|
return /*#__PURE__*/ jsx("span", {
|
|
378
383
|
className: styles.itemText({
|
|
@@ -385,14 +390,14 @@ RadioGroup.ItemText = function({ children, className, ref, ...props }) {
|
|
|
385
390
|
});
|
|
386
391
|
};
|
|
387
392
|
RadioGroup.ItemDescription = function({ children, className, ref, ...props }) {
|
|
388
|
-
const { api, size,
|
|
393
|
+
const { api, size, appearance } = useRadioGroupContext();
|
|
389
394
|
const { itemProps, registerDescription } = useRadioGroupItemContext();
|
|
390
395
|
const generatedId = useId();
|
|
391
396
|
const id = props.id ?? generatedId;
|
|
392
397
|
useRegisterDescription(id, registerDescription);
|
|
393
398
|
const styles = radioGroupVariants({
|
|
394
399
|
size,
|
|
395
|
-
|
|
400
|
+
appearance
|
|
396
401
|
});
|
|
397
402
|
const itemState = api.getItemState(itemProps);
|
|
398
403
|
return /*#__PURE__*/ jsx("div", {
|