@techsio/ui-kit 0.57.0 → 0.59.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 +128 -133
- package/dist/atoms/action-icon.js +9 -8
- package/dist/atoms/button.js +114 -18
- package/dist/atoms/checkbox.js +77 -17
- package/dist/atoms/hotkeys.js +26 -7
- package/dist/atoms/icon.js +5 -5
- package/dist/atoms/image.js +118 -3
- package/dist/atoms/input.js +57 -9
- package/dist/atoms/label.js +13 -4
- package/dist/atoms/link-button.js +15 -12
- package/dist/atoms/link.js +18 -4
- package/dist/atoms/numeric-input.js +362 -84
- package/dist/atoms/rating.js +306 -73
- package/dist/atoms/skeleton.js +18 -14
- package/dist/atoms/status-text.js +31 -18
- package/dist/atoms/textarea.js +59 -12
- package/dist/atoms/tooltip.js +64 -43
- package/dist/hotkeys.js +1 -0
- package/dist/internal/choice-control.js +173 -0
- package/dist/internal/combobox-query-sync.js +11 -0
- package/dist/internal/date-picker-coordinator.js +56 -40
- package/dist/internal/date-picker-dom.js +44 -0
- package/dist/internal/date-picker-input.js +30 -0
- package/dist/internal/described-by.js +23 -18
- package/dist/internal/form-control-lifecycle.js +122 -0
- package/dist/internal/molecules/command.context.js +1 -0
- package/dist/internal/molecules/drawer.context.js +1 -0
- package/dist/internal/molecules/vertical-navigation.context.js +1 -0
- package/dist/internal/molecules/vertical-navigation.styles.js +9 -2
- package/dist/internal/numeric-input-editing.js +87 -0
- package/dist/internal/organisms/sidebar.context.js +1 -0
- package/dist/internal/organisms/sidebar.focus.js +1 -0
- package/dist/internal/overlay-portal.js +72 -0
- package/dist/internal/reduced-motion.js +1 -0
- package/dist/internal/use-effective-disabled.js +8 -0
- package/dist/molecules/accordion.js +44 -30
- package/dist/molecules/availability-status.js +1 -0
- package/dist/molecules/breadcrumb.js +11 -11
- package/dist/molecules/carousel.js +279 -97
- package/dist/molecules/cascade-select.js +327 -81
- package/dist/molecules/chart.js +427 -78
- package/dist/molecules/color-select.js +181 -62
- package/dist/molecules/combobox.js +537 -182
- package/dist/molecules/command.js +2 -1
- package/dist/molecules/date-picker.js +629 -119
- package/dist/molecules/dialog.js +89 -48
- package/dist/molecules/drawer.js +63 -6
- package/dist/molecules/file-upload.js +373 -37
- package/dist/molecules/form-checkbox.js +65 -22
- package/dist/molecules/form-error-summary.js +29 -5
- package/dist/molecules/form-input.js +26 -30
- package/dist/molecules/form-numeric-input.js +11 -9
- package/dist/molecules/form-textarea.js +26 -23
- package/dist/molecules/menu.js +170 -47
- package/dist/molecules/pagination.js +100 -28
- package/dist/molecules/phone-input.js +172 -37
- package/dist/molecules/popover.js +53 -26
- package/dist/molecules/price-block.js +1 -0
- package/dist/molecules/product-card.js +85 -23
- package/dist/molecules/quantity-field.js +4 -2
- package/dist/molecules/radio-card.js +102 -30
- package/dist/molecules/radio-group.js +108 -31
- package/dist/molecules/search-form.js +116 -13
- package/dist/molecules/select.js +226 -81
- package/dist/molecules/slider.js +141 -30
- package/dist/molecules/steps.js +181 -50
- package/dist/molecules/switch.js +86 -20
- package/dist/molecules/tabs.js +227 -31
- package/dist/molecules/toast.js +155 -53
- package/dist/molecules/totals-summary.js +2 -1
- package/dist/molecules/tour.js +9 -5
- package/dist/molecules/tree-view.js +255 -109
- package/dist/molecules/vertical-navigation.js +8 -4
- package/dist/organisms/data-table.fields.js +26 -5
- package/dist/organisms/data-table.helpers.js +6 -2
- package/dist/organisms/data-table.js +587 -154
- package/dist/organisms/footer.js +18 -11
- package/dist/organisms/gallery.js +61 -24
- package/dist/organisms/header.js +106 -32
- package/dist/organisms/line-item.js +1 -0
- package/dist/organisms/sidebar.js +1 -0
- package/dist/organisms/table.js +22 -7
- package/dist/src/atoms/action-icon.d.ts +10 -10
- package/dist/src/atoms/action-icon.d.ts.map +1 -1
- package/dist/src/atoms/badge.d.ts +3 -3
- package/dist/src/atoms/badge.d.ts.map +1 -1
- package/dist/src/atoms/button.d.ts +47 -24
- package/dist/src/atoms/button.d.ts.map +1 -1
- package/dist/src/atoms/checkbox.d.ts +6 -5
- package/dist/src/atoms/checkbox.d.ts.map +1 -1
- package/dist/src/atoms/hotkeys.d.ts +3 -2
- package/dist/src/atoms/hotkeys.d.ts.map +1 -1
- package/dist/src/atoms/icon.d.ts +18 -17
- package/dist/src/atoms/icon.d.ts.map +1 -1
- package/dist/src/atoms/image.d.ts +38 -7
- package/dist/src/atoms/image.d.ts.map +1 -1
- package/dist/src/atoms/input.d.ts +23 -14
- package/dist/src/atoms/input.d.ts.map +1 -1
- package/dist/src/atoms/label.d.ts +4 -4
- package/dist/src/atoms/label.d.ts.map +1 -1
- package/dist/src/atoms/link-button.d.ts +78 -31
- package/dist/src/atoms/link-button.d.ts.map +1 -1
- package/dist/src/atoms/link.d.ts +30 -9
- package/dist/src/atoms/link.d.ts.map +1 -1
- package/dist/src/atoms/numeric-input.d.ts +24 -19
- package/dist/src/atoms/numeric-input.d.ts.map +1 -1
- package/dist/src/atoms/rating.d.ts +54 -26
- 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 +21 -13
- package/dist/src/atoms/status-text.d.ts.map +1 -1
- package/dist/src/atoms/textarea.d.ts +22 -20
- package/dist/src/atoms/textarea.d.ts.map +1 -1
- package/dist/src/atoms/tooltip.d.ts +5 -5
- package/dist/src/atoms/tooltip.d.ts.map +1 -1
- package/dist/src/hotkeys.d.ts +1 -1
- package/dist/src/hotkeys.d.ts.map +1 -1
- package/dist/src/internal/choice-control.d.ts +18 -0
- package/dist/src/internal/choice-control.d.ts.map +1 -0
- package/dist/src/internal/combobox-query-sync.d.ts +4 -0
- package/dist/src/internal/combobox-query-sync.d.ts.map +1 -0
- package/dist/src/internal/date-picker-coordinator.d.ts +7 -1
- package/dist/src/internal/date-picker-coordinator.d.ts.map +1 -1
- package/dist/src/internal/date-picker-dom.d.ts +10 -0
- package/dist/src/internal/date-picker-dom.d.ts.map +1 -0
- package/dist/src/internal/date-picker-input.d.ts +7 -0
- package/dist/src/internal/date-picker-input.d.ts.map +1 -0
- package/dist/src/internal/described-by.d.ts +7 -1
- package/dist/src/internal/described-by.d.ts.map +1 -1
- package/dist/src/internal/form-control-lifecycle.d.ts +22 -0
- package/dist/src/internal/form-control-lifecycle.d.ts.map +1 -0
- package/dist/src/internal/molecules/vertical-navigation.context.d.ts +1 -1
- package/dist/src/internal/molecules/vertical-navigation.context.d.ts.map +1 -1
- package/dist/src/internal/molecules/vertical-navigation.styles.d.ts +21 -0
- package/dist/src/internal/molecules/vertical-navigation.styles.d.ts.map +1 -1
- package/dist/src/internal/numeric-input-editing.d.ts +13 -0
- package/dist/src/internal/numeric-input-editing.d.ts.map +1 -0
- package/dist/src/internal/overlay-portal.d.ts +18 -0
- package/dist/src/internal/overlay-portal.d.ts.map +1 -0
- package/dist/src/internal/use-effective-disabled.d.ts +4 -0
- package/dist/src/internal/use-effective-disabled.d.ts.map +1 -0
- package/dist/src/molecules/accordion.d.ts +25 -19
- package/dist/src/molecules/accordion.d.ts.map +1 -1
- package/dist/src/molecules/availability-status.d.ts +4 -1
- package/dist/src/molecules/availability-status.d.ts.map +1 -1
- package/dist/src/molecules/breadcrumb.d.ts +2 -2
- package/dist/src/molecules/breadcrumb.d.ts.map +1 -1
- package/dist/src/molecules/carousel.d.ts +51 -52
- package/dist/src/molecules/carousel.d.ts.map +1 -1
- package/dist/src/molecules/cascade-select.d.ts +23 -8
- package/dist/src/molecules/cascade-select.d.ts.map +1 -1
- package/dist/src/molecules/chart.d.ts +18 -1
- package/dist/src/molecules/chart.d.ts.map +1 -1
- package/dist/src/molecules/color-select.d.ts +19 -3
- package/dist/src/molecules/color-select.d.ts.map +1 -1
- package/dist/src/molecules/combobox.d.ts +27 -5
- 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 +30 -4
- package/dist/src/molecules/date-picker.d.ts.map +1 -1
- package/dist/src/molecules/dialog.d.ts +17 -4
- package/dist/src/molecules/dialog.d.ts.map +1 -1
- package/dist/src/molecules/drawer.d.ts +4 -4
- package/dist/src/molecules/drawer.d.ts.map +1 -1
- package/dist/src/molecules/file-upload.d.ts +11 -6
- package/dist/src/molecules/file-upload.d.ts.map +1 -1
- package/dist/src/molecules/form-checkbox.d.ts +7 -2
- package/dist/src/molecules/form-checkbox.d.ts.map +1 -1
- package/dist/src/molecules/form-error-summary.d.ts +4 -3
- package/dist/src/molecules/form-error-summary.d.ts.map +1 -1
- package/dist/src/molecules/form-input.d.ts +5 -6
- package/dist/src/molecules/form-input.d.ts.map +1 -1
- package/dist/src/molecules/form-numeric-input.d.ts +5 -5
- package/dist/src/molecules/form-numeric-input.d.ts.map +1 -1
- package/dist/src/molecules/form-textarea.d.ts +5 -6
- package/dist/src/molecules/form-textarea.d.ts.map +1 -1
- package/dist/src/molecules/menu.d.ts +17 -3
- package/dist/src/molecules/menu.d.ts.map +1 -1
- package/dist/src/molecules/pagination.d.ts +1 -1
- package/dist/src/molecules/pagination.d.ts.map +1 -1
- package/dist/src/molecules/phone-input.d.ts +4 -1
- package/dist/src/molecules/phone-input.d.ts.map +1 -1
- package/dist/src/molecules/popover.d.ts +7 -1
- package/dist/src/molecules/popover.d.ts.map +1 -1
- package/dist/src/molecules/price-block.d.ts +1 -1
- package/dist/src/molecules/price-block.d.ts.map +1 -1
- package/dist/src/molecules/product-card.d.ts +127 -27
- package/dist/src/molecules/product-card.d.ts.map +1 -1
- package/dist/src/molecules/quantity-field.d.ts +1 -1
- package/dist/src/molecules/quantity-field.d.ts.map +1 -1
- package/dist/src/molecules/radio-card.d.ts +10 -3
- package/dist/src/molecules/radio-card.d.ts.map +1 -1
- package/dist/src/molecules/radio-group.d.ts +15 -6
- package/dist/src/molecules/radio-group.d.ts.map +1 -1
- package/dist/src/molecules/search-form.d.ts +37 -12
- package/dist/src/molecules/search-form.d.ts.map +1 -1
- package/dist/src/molecules/select.d.ts +34 -29
- package/dist/src/molecules/select.d.ts.map +1 -1
- package/dist/src/molecules/slider.d.ts +23 -2
- package/dist/src/molecules/slider.d.ts.map +1 -1
- package/dist/src/molecules/steps.d.ts +30 -10
- package/dist/src/molecules/steps.d.ts.map +1 -1
- package/dist/src/molecules/switch.d.ts +54 -33
- package/dist/src/molecules/switch.d.ts.map +1 -1
- package/dist/src/molecules/tabs.d.ts +11 -11
- package/dist/src/molecules/tabs.d.ts.map +1 -1
- package/dist/src/molecules/toast.d.ts +38 -14
- package/dist/src/molecules/toast.d.ts.map +1 -1
- package/dist/src/molecules/totals-summary.d.ts +1 -1
- package/dist/src/molecules/totals-summary.d.ts.map +1 -1
- package/dist/src/molecules/tour.d.ts +1 -1
- package/dist/src/molecules/tour.d.ts.map +1 -1
- package/dist/src/molecules/tree-view.d.ts +16 -20
- package/dist/src/molecules/tree-view.d.ts.map +1 -1
- package/dist/src/molecules/vertical-navigation.d.ts +2 -2
- package/dist/src/molecules/vertical-navigation.d.ts.map +1 -1
- package/dist/src/organisms/data-table.d.ts +28 -3
- package/dist/src/organisms/data-table.d.ts.map +1 -1
- package/dist/src/organisms/data-table.fields.d.ts +4 -1
- package/dist/src/organisms/data-table.fields.d.ts.map +1 -1
- package/dist/src/organisms/data-table.helpers.d.ts +5 -12
- package/dist/src/organisms/data-table.helpers.d.ts.map +1 -1
- package/dist/src/organisms/footer.d.ts +5 -5
- package/dist/src/organisms/footer.d.ts.map +1 -1
- package/dist/src/organisms/gallery.d.ts +11 -9
- package/dist/src/organisms/gallery.d.ts.map +1 -1
- package/dist/src/organisms/header.d.ts +24 -22
- package/dist/src/organisms/header.d.ts.map +1 -1
- package/dist/src/organisms/table.d.ts +14 -14
- package/dist/src/organisms/table.d.ts.map +1 -1
- package/dist/src/templates/accordion.d.ts +8 -6
- package/dist/src/templates/accordion.d.ts.map +1 -1
- package/dist/src/templates/breadcrumb.d.ts +1 -1
- package/dist/src/templates/breadcrumb.d.ts.map +1 -1
- package/dist/src/templates/carousel.d.ts +3 -3
- package/dist/src/templates/carousel.d.ts.map +1 -1
- package/dist/src/templates/facet-filter-panel.d.ts +9 -3
- package/dist/src/templates/facet-filter-panel.d.ts.map +1 -1
- package/dist/src/templates/gallery.d.ts +2 -2
- package/dist/src/templates/gallery.d.ts.map +1 -1
- package/dist/src/templates/numeric-input.d.ts +1 -1
- package/dist/src/templates/numeric-input.d.ts.map +1 -1
- package/dist/src/templates/popover.d.ts +4 -2
- package/dist/src/templates/popover.d.ts.map +1 -1
- package/dist/src/templates/product-card.d.ts +12 -4
- package/dist/src/templates/product-card.d.ts.map +1 -1
- package/dist/src/templates/search-suggestions.d.ts +1 -1
- package/dist/src/templates/select.d.ts +7 -2
- package/dist/src/templates/select.d.ts.map +1 -1
- package/dist/src/templates/tabs.d.ts +8 -7
- package/dist/src/templates/tabs.d.ts.map +1 -1
- package/dist/src/theme/theme-config.d.ts +9 -16
- package/dist/src/theme/theme-config.d.ts.map +1 -1
- package/dist/src/theme/theme-provider.d.ts +16 -21
- package/dist/src/theme/theme-provider.d.ts.map +1 -1
- package/dist/src/theme/theme-toggle.d.ts.map +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/templates/accordion.js +3 -1
- package/dist/templates/breadcrumb.js +11 -4
- package/dist/templates/carousel.js +3 -6
- package/dist/templates/facet-filter-panel.js +121 -52
- package/dist/templates/gallery.js +6 -2
- package/dist/templates/numeric-input.js +6 -1
- package/dist/templates/popover.js +6 -1
- package/dist/templates/product-card.js +52 -26
- package/dist/templates/select.js +6 -1
- package/dist/templates/tabs.js +4 -2
- package/dist/theme/theme-config.js +8 -16
- package/dist/theme/theme-provider.js +89 -63
- package/dist/theme/theme-toggle.js +17 -9
- package/dist/utils.js +11 -1
- package/package.json +9 -5
- package/src/tokens/_base.css +4 -3
- package/src/tokens/_business-atoms.css +96 -0
- package/src/tokens/_foundation-overrides.css +251 -0
- package/src/tokens/_reset.css +10 -10
- package/src/tokens/_scheme-scopes.css +4194 -0
- package/src/tokens/_semantic.css +1 -23
- package/src/tokens/_tokens-base.css +36 -32
- package/src/tokens/_typography.css +2 -1
- package/src/tokens/components/_form-control.css +149 -6
- package/src/tokens/components/_popup-surface.css +15 -29
- package/src/tokens/components/atoms/_action-icon.css +49 -0
- package/src/tokens/components/atoms/_button.css +77 -0
- package/src/tokens/components/atoms/_checkbox.css +47 -4
- package/src/tokens/components/atoms/_hotkeys.css +2 -0
- package/src/tokens/components/atoms/_icon.css +60 -7
- package/src/tokens/components/atoms/_image.css +18 -0
- package/src/tokens/components/atoms/_input.css +20 -0
- package/src/tokens/components/atoms/_label.css +3 -7
- package/src/tokens/components/atoms/_link.css +47 -5
- package/src/tokens/components/atoms/_numeric-input.css +121 -2
- package/src/tokens/components/atoms/_rating.css +55 -6
- package/src/tokens/components/atoms/_skeleton.css +12 -2
- package/src/tokens/components/atoms/_status-text.css +35 -5
- package/src/tokens/components/atoms/_textarea.css +32 -3
- package/src/tokens/components/atoms/_tooltip.css +25 -0
- package/src/tokens/components/molecules/_accordion.css +46 -5
- package/src/tokens/components/molecules/_breadcrumb.css +15 -4
- package/src/tokens/components/molecules/_carousel.css +67 -0
- package/src/tokens/components/molecules/_cascade-select.css +104 -0
- package/src/tokens/components/molecules/_chart.css +32 -16
- package/src/tokens/components/molecules/_color-select.css +21 -0
- package/src/tokens/components/molecules/_combobox.css +81 -0
- package/src/tokens/components/molecules/_command.css +1 -0
- package/src/tokens/components/molecules/_date-picker.css +66 -10
- package/src/tokens/components/molecules/_dialog.css +36 -4
- package/src/tokens/components/molecules/_drawer.css +39 -3
- package/src/tokens/components/molecules/_file-upload.css +16 -1
- package/src/tokens/components/molecules/_menu.css +17 -0
- package/src/tokens/components/molecules/_pagination.css +19 -0
- package/src/tokens/components/molecules/_phone-input.css +20 -5
- package/src/tokens/components/molecules/_popover.css +34 -0
- package/src/tokens/components/molecules/_product-card.css +70 -0
- package/src/tokens/components/molecules/_radio-card.css +35 -0
- package/src/tokens/components/molecules/_radio-group.css +8 -0
- package/src/tokens/components/molecules/_select.css +33 -0
- package/src/tokens/components/molecules/_slider.css +5 -0
- package/src/tokens/components/molecules/_steps.css +52 -0
- package/src/tokens/components/molecules/_switch.css +59 -10
- package/src/tokens/components/molecules/_tabs.css +61 -3
- package/src/tokens/components/molecules/_toast.css +60 -0
- package/src/tokens/components/molecules/_totals-summary.css +22 -22
- package/src/tokens/components/molecules/_tour.css +16 -1
- package/src/tokens/components/molecules/_tree-view.css +27 -3
- package/src/tokens/components/molecules/_vertical-navigation.css +21 -3
- package/src/tokens/components/organisms/_data-table.css +97 -0
- package/src/tokens/components/organisms/_footer.css +9 -0
- package/src/tokens/components/organisms/_gallery.css +11 -0
- package/src/tokens/components/organisms/_header.css +22 -0
- package/src/tokens/components/organisms/_sidebar.css +1 -1
- package/src/tokens/components/organisms/_table.css +31 -0
- package/src/tokens/components/templates/_facet-filter-panel.css +11 -1
- package/src/tokens/figma/akros/variables.css +15 -6
- package/src/tokens/figma/brand-overrides.css +171 -57
- package/src/tokens/figma/business/variables.css +15 -6
- package/src/tokens/figma/cyber/variables.css +115 -38
- package/src/tokens/figma/cyber-dark/variables.css +115 -38
- package/src/tokens/figma/dark/variables.css +13 -4
- package/src/tokens/figma/light/variables.css +62 -49
- package/src/tokens/figma/{neo → n1}/variables.css +123 -114
- package/src/tokens/figma/variables.css +658 -249
- package/src/tokens/theme.css +24 -4
- package/src/tokens/_colors.css +0 -5
- package/src/tokens/figma/neo-dark/variables.css +0 -457
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { Carousel } from "../molecules/carousel.js";
|
|
3
4
|
import { Gallery } from "../organisms/gallery.js";
|
|
@@ -11,12 +12,15 @@ function resolveSlides(items, renderSlide) {
|
|
|
11
12
|
})
|
|
12
13
|
}));
|
|
13
14
|
}
|
|
14
|
-
function GalleryTemplate({ items, orientation, carouselWidth, carouselHeight, fitParent = false, carouselClassName, slidesClassName, mainClassName, thumbnailsClassName, thumbnailsScrollAreaClassName, thumbnailsListClassName, thumbnailClassName, renderThumbnail, renderSlide, showControls = false, showIndicators = false, showAutoplay = false, controlsClassName, indicatorsClassName, controlPosition = "unset", prevIcon = "token-icon-carousel-prev", nextIcon = "token-icon-carousel-next", previousTriggerClassName, nextTriggerClassName, autoplayTriggerClassName, aspectRatio, size, objectFit, loop, autoplay, allowMouseDrag, imageAs, onPageChange, thumbnailImageAs, ...galleryProps }) {
|
|
15
|
+
function GalleryTemplate({ "aria-label": ariaLabel, items, orientation, carouselWidth, carouselHeight, fitParent = false, carouselClassName, slidesClassName, mainClassName, thumbnailsClassName, thumbnailsScrollAreaClassName, thumbnailsListClassName, thumbnailClassName, renderThumbnail, renderSlide, showControls = false, showIndicators = false, showAutoplay = false, controlsClassName, indicatorsClassName, controlPosition = "unset", prevIcon = "token-icon-carousel-prev", nextIcon = "token-icon-carousel-next", previousTriggerClassName, nextTriggerClassName, autoplayTriggerClassName, aspectRatio, size, objectFit, loop, autoplay, allowMouseDrag, imageAs, onPageChange, thumbnailImageAs, ...galleryProps }) {
|
|
15
16
|
const resolvedItems = resolveSlides(items, renderSlide);
|
|
16
17
|
const resolvedOrientation = orientation ?? "vertical";
|
|
17
18
|
const resolvedCarouselWidth = carouselWidth ?? (fitParent ? "100%" : void 0);
|
|
18
19
|
const resolvedCarouselHeight = carouselHeight;
|
|
19
20
|
const resolvedCarouselProps = {
|
|
21
|
+
...void 0 === ariaLabel ? {} : {
|
|
22
|
+
"aria-label": ariaLabel
|
|
23
|
+
},
|
|
20
24
|
orientation: resolvedOrientation,
|
|
21
25
|
aspectRatio: aspectRatio ?? "portrait",
|
|
22
26
|
size: size ?? "full",
|
|
@@ -77,7 +81,7 @@ function GalleryTemplate({ items, orientation, carouselWidth, carouselHeight, fi
|
|
|
77
81
|
})
|
|
78
82
|
]
|
|
79
83
|
}),
|
|
80
|
-
showAutoplay && /*#__PURE__*/ jsx(Carousel.Autoplay, {
|
|
84
|
+
(Boolean(autoplay) || showAutoplay) && /*#__PURE__*/ jsx(Carousel.Autoplay, {
|
|
81
85
|
className: autoplayTriggerClassName
|
|
82
86
|
})
|
|
83
87
|
]
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { NumericInput } from "../atoms/numeric-input.js";
|
|
4
|
+
import { tv } from "../utils.js";
|
|
5
|
+
const numericInputTemplateVariants = tv({
|
|
6
|
+
base: "flex min-w-0 items-center gap-numeric-input-md"
|
|
7
|
+
});
|
|
3
8
|
function NumericInputTemplate({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, showControls = true, showScrubber = false, controlsPosition = "right", incrementIcon = "token-icon-numeric-input-increment", decrementIcon = "token-icon-numeric-input-decrement", className, ref, ...numericInputProps }) {
|
|
4
9
|
if ("right" === controlsPosition) return /*#__PURE__*/ jsx(NumericInput, {
|
|
5
10
|
...numericInputProps,
|
|
@@ -30,7 +35,7 @@ function NumericInputTemplate({ "aria-label": ariaLabel, "aria-labelledby": aria
|
|
|
30
35
|
className: className,
|
|
31
36
|
ref: ref,
|
|
32
37
|
children: /*#__PURE__*/ jsxs("div", {
|
|
33
|
-
className:
|
|
38
|
+
className: numericInputTemplateVariants(),
|
|
34
39
|
children: [
|
|
35
40
|
showControls && /*#__PURE__*/ jsx(NumericInput.DecrementTrigger, {
|
|
36
41
|
icon: decrementIcon
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { Popover } from "../molecules/popover.js";
|
|
3
|
-
function PopoverTemplate({ children, contentClassName, contentProps, contentRef, description, disabled = false, showArrow = true, showCloseButton = false, title, trigger, triggerClassName, triggerProps, triggerRef, ...rootProps }) {
|
|
4
|
+
function PopoverTemplate({ "aria-label": ariaLabel, children, contentClassName, contentProps, contentRef, description, disabled = false, showArrow = true, showCloseButton = false, title, trigger, triggerClassName, triggerProps, triggerRef, ...rootProps }) {
|
|
5
|
+
const fallbackName = "string" == typeof trigger ? trigger : "Additional details";
|
|
6
|
+
const unnamed = !(title || contentProps?.["aria-labelledby"]);
|
|
7
|
+
const accessibleName = contentProps?.["aria-label"] ?? ariaLabel ?? (unnamed ? fallbackName : void 0);
|
|
4
8
|
return /*#__PURE__*/ jsxs(Popover.Root, {
|
|
5
9
|
...rootProps,
|
|
6
10
|
children: [
|
|
@@ -14,6 +18,7 @@ function PopoverTemplate({ children, contentClassName, contentProps, contentRef,
|
|
|
14
18
|
/*#__PURE__*/ jsx(Popover.Positioner, {
|
|
15
19
|
children: /*#__PURE__*/ jsxs(Popover.Content, {
|
|
16
20
|
...contentProps,
|
|
21
|
+
"aria-label": accessibleName,
|
|
17
22
|
className: contentClassName,
|
|
18
23
|
ref: contentRef,
|
|
19
24
|
children: [
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createElement } from "react";
|
|
2
4
|
import { Badge } from "../atoms/badge.js";
|
|
5
|
+
import { Link } from "../atoms/link.js";
|
|
3
6
|
import { ProductCard } from "../molecules/product-card.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
7
|
+
import { tv } from "../utils.js";
|
|
8
|
+
const styles = tv({
|
|
9
|
+
slots: {
|
|
10
|
+
prices: "flex flex-wrap items-baseline gap-product-card-badges",
|
|
11
|
+
rating: "flex items-center gap-product-card-badges"
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
function ProductCardTemplate({ image, name, nameAs, href, linkAs, linkProps, price, originalPrice, originalPriceLabel = "Original price", currentPriceLabel = "Current price", badges, rating, stock, showActions = true, onAddToCart, onViewDetails, onAddToWishlist, cartButtonText = "Add to Cart", detailButtonText = "View Details", wishlistButtonText = "Add to Wishlist", layout = "column", className }) {
|
|
15
|
+
const slots = styles();
|
|
16
|
+
const NameLink = Link;
|
|
6
17
|
return /*#__PURE__*/ jsxs(ProductCard, {
|
|
7
18
|
className: className,
|
|
8
19
|
layout: layout,
|
|
@@ -12,46 +23,61 @@ function ProductCardTemplate({ image, name, nameAs, price, originalPrice, badges
|
|
|
12
23
|
src: image.src
|
|
13
24
|
}),
|
|
14
25
|
badges && badges.length > 0 && /*#__PURE__*/ jsx(ProductCard.Badges, {
|
|
15
|
-
children: badges.map((badge)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
fgColor: badge.fgColor,
|
|
20
|
-
variant: "dynamic",
|
|
21
|
-
children: badge.children
|
|
22
|
-
}, slugify(badge.children));
|
|
23
|
-
return /*#__PURE__*/ jsx(Badge, {
|
|
24
|
-
variant: badge.variant,
|
|
25
|
-
children: badge.children
|
|
26
|
-
}, slugify(badge.children));
|
|
27
|
-
})
|
|
26
|
+
children: badges.map(({ key, ...badge }, index)=>/*#__PURE__*/ createElement(Badge, {
|
|
27
|
+
...badge,
|
|
28
|
+
key: key ?? index
|
|
29
|
+
}))
|
|
28
30
|
}),
|
|
29
|
-
name && /*#__PURE__*/ jsx(ProductCard.Name, {
|
|
31
|
+
null != name && false !== name && /*#__PURE__*/ jsx(ProductCard.Name, {
|
|
30
32
|
as: nameAs,
|
|
31
|
-
children:
|
|
33
|
+
children: href ? /*#__PURE__*/ jsx(NameLink, {
|
|
34
|
+
...linkProps,
|
|
35
|
+
as: linkAs,
|
|
36
|
+
href: href,
|
|
37
|
+
size: "current",
|
|
38
|
+
children: name
|
|
39
|
+
}) : name
|
|
32
40
|
}),
|
|
33
41
|
(price || originalPrice) && /*#__PURE__*/ jsxs("div", {
|
|
34
|
-
className:
|
|
42
|
+
className: slots.prices(),
|
|
35
43
|
children: [
|
|
36
|
-
originalPrice && /*#__PURE__*/
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
originalPrice && /*#__PURE__*/ jsxs("del", {
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ jsxs("span", {
|
|
47
|
+
className: "sr-only",
|
|
48
|
+
children: [
|
|
49
|
+
originalPriceLabel,
|
|
50
|
+
": "
|
|
51
|
+
]
|
|
52
|
+
}),
|
|
53
|
+
originalPrice
|
|
54
|
+
]
|
|
39
55
|
}),
|
|
40
|
-
price && /*#__PURE__*/
|
|
41
|
-
children:
|
|
56
|
+
price && /*#__PURE__*/ jsxs(ProductCard.Price, {
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ jsxs("span", {
|
|
59
|
+
className: "sr-only",
|
|
60
|
+
children: [
|
|
61
|
+
currentPriceLabel,
|
|
62
|
+
": "
|
|
63
|
+
]
|
|
64
|
+
}),
|
|
65
|
+
price
|
|
66
|
+
]
|
|
42
67
|
})
|
|
43
68
|
]
|
|
44
69
|
}),
|
|
45
70
|
rating && /*#__PURE__*/ jsxs("div", {
|
|
46
|
-
className:
|
|
71
|
+
className: slots.rating(),
|
|
47
72
|
children: [
|
|
48
73
|
/*#__PURE__*/ jsx(ProductCard.Rating, {
|
|
49
74
|
rating: {
|
|
50
75
|
value: rating.value,
|
|
51
|
-
count: rating.count
|
|
76
|
+
count: rating.count,
|
|
77
|
+
displayOnly: true
|
|
52
78
|
}
|
|
53
79
|
}),
|
|
54
|
-
rating.reviewCount && /*#__PURE__*/ jsxs("span", {
|
|
80
|
+
void 0 !== rating.reviewCount && /*#__PURE__*/ jsxs("span", {
|
|
55
81
|
className: "text-sm",
|
|
56
82
|
children: [
|
|
57
83
|
"(",
|
package/dist/templates/select.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { Select } from "../molecules/select.js";
|
|
3
|
-
function SelectTemplate({ items, label, labelProps, placeholder, valueText, valueTextProps, showIndicator = true, renderItem, ref, ...selectProps }) {
|
|
4
|
+
function SelectTemplate({ items, helpText, triggerProps, label, labelProps, placeholder, valueText, valueTextProps, showIndicator = true, renderItem, ref, ...selectProps }) {
|
|
4
5
|
return /*#__PURE__*/ jsxs(Select, {
|
|
5
6
|
items: items,
|
|
6
7
|
ref: ref,
|
|
@@ -12,6 +13,7 @@ function SelectTemplate({ items, label, labelProps, placeholder, valueText, valu
|
|
|
12
13
|
}) : null,
|
|
13
14
|
/*#__PURE__*/ jsx(Select.Control, {
|
|
14
15
|
children: /*#__PURE__*/ jsx(Select.Trigger, {
|
|
16
|
+
...triggerProps,
|
|
15
17
|
children: /*#__PURE__*/ jsx(Select.ValueText, {
|
|
16
18
|
placeholder: placeholder,
|
|
17
19
|
...valueTextProps,
|
|
@@ -36,6 +38,9 @@ function SelectTemplate({ items, label, labelProps, placeholder, valueText, valu
|
|
|
36
38
|
]
|
|
37
39
|
}, item.value))
|
|
38
40
|
})
|
|
41
|
+
}),
|
|
42
|
+
helpText && /*#__PURE__*/ jsx(Select.StatusText, {
|
|
43
|
+
children: helpText
|
|
39
44
|
})
|
|
40
45
|
]
|
|
41
46
|
});
|
package/dist/templates/tabs.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { Tabs } from "../molecules/tabs.js";
|
|
3
|
-
function TabsTemplate({ items, showIndicator = false, variant = "default", size = "md", fitted = false, justify = "start", orientation = "horizontal", defaultValue, value, onValueChange, ref, className, ...tabsProps }) {
|
|
4
|
+
function TabsTemplate({ items, tablistProps, showIndicator = false, variant = "default", size = "md", fitted = false, justify = "start", orientation = "horizontal", defaultValue, value, onValueChange, ref, className, ...tabsProps }) {
|
|
4
5
|
return /*#__PURE__*/ jsxs(Tabs, {
|
|
5
6
|
className: className,
|
|
6
|
-
defaultValue: defaultValue,
|
|
7
|
+
defaultValue: defaultValue ?? items.find((item)=>!item.disabled)?.value,
|
|
7
8
|
fitted: fitted,
|
|
8
9
|
justify: justify,
|
|
9
10
|
onValueChange: onValueChange,
|
|
@@ -15,6 +16,7 @@ function TabsTemplate({ items, showIndicator = false, variant = "default", size
|
|
|
15
16
|
...tabsProps,
|
|
16
17
|
children: [
|
|
17
18
|
/*#__PURE__*/ jsxs(Tabs.List, {
|
|
19
|
+
...tablistProps,
|
|
18
20
|
children: [
|
|
19
21
|
items.map((item)=>/*#__PURE__*/ jsx(Tabs.Trigger, {
|
|
20
22
|
disabled: item.disabled,
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
const THEMES = {
|
|
2
|
-
base: {
|
|
3
|
-
label: "Default",
|
|
4
|
-
modes: [
|
|
5
|
-
"light",
|
|
6
|
-
"dark"
|
|
7
|
-
]
|
|
8
|
-
},
|
|
9
|
-
neo: {
|
|
10
|
-
label: "Neo (Red)",
|
|
11
|
-
modes: [
|
|
12
|
-
"light",
|
|
13
|
-
"dark"
|
|
14
|
-
],
|
|
15
|
-
attr: "neo"
|
|
16
|
-
},
|
|
17
2
|
business: {
|
|
18
3
|
label: "Business",
|
|
19
4
|
modes: [
|
|
@@ -27,9 +12,16 @@ const THEMES = {
|
|
|
27
12
|
"light"
|
|
28
13
|
],
|
|
29
14
|
attr: "akros"
|
|
15
|
+
},
|
|
16
|
+
n1: {
|
|
17
|
+
label: "N1",
|
|
18
|
+
modes: [
|
|
19
|
+
"light"
|
|
20
|
+
],
|
|
21
|
+
attr: "n1"
|
|
30
22
|
}
|
|
31
23
|
};
|
|
32
|
-
const DEFAULT_BRAND = "
|
|
24
|
+
const DEFAULT_BRAND = "business";
|
|
33
25
|
const DEFAULT_MODE = "system";
|
|
34
26
|
const BRAND_STORAGE_KEY = "ui-brand";
|
|
35
27
|
const MODE_STORAGE_KEY = "ui-mode";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { ThemeProvider, useTheme } from "better-themes";
|
|
4
|
-
import { createContext, useContext, useEffect, useState } from "react";
|
|
5
|
+
import { createContext, useContext, useEffect, useLayoutEffect, useState, useSyncExternalStore } from "react";
|
|
5
6
|
import { BRAND_STORAGE_KEY, DEFAULT_BRAND, DEFAULT_MODE, MODE_STORAGE_KEY, availableModeSettings, brandAttr, brandKeys, brandSupportsDark, isBrandKey } from "./theme-config.js";
|
|
6
7
|
function readStoredBrand() {
|
|
7
|
-
if ("u" < typeof window) return null;
|
|
8
8
|
try {
|
|
9
9
|
const value = window.localStorage.getItem(BRAND_STORAGE_KEY);
|
|
10
10
|
return value && isBrandKey(value) ? value : null;
|
|
@@ -12,90 +12,116 @@ function readStoredBrand() {
|
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} catch {}
|
|
15
|
+
function subscribeAppearance(onChange) {
|
|
16
|
+
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
17
|
+
media.addEventListener("change", onChange);
|
|
18
|
+
return ()=>media.removeEventListener("change", onChange);
|
|
20
19
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
else root.removeAttribute("data-theme");
|
|
20
|
+
const getAppearance = ()=>window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
21
|
+
const getServerAppearance = ()=>"light";
|
|
22
|
+
function resolveAppearance(brand, requested, system) {
|
|
23
|
+
if (!brandSupportsDark(brand)) return "light";
|
|
24
|
+
return "system" === requested ? system : requested;
|
|
27
25
|
}
|
|
28
|
-
const
|
|
29
|
-
function BrandProvider({ defaultBrand, children }) {
|
|
30
|
-
const { setTheme } = useTheme();
|
|
26
|
+
const AppThemeContext = /*#__PURE__*/ createContext(null);
|
|
27
|
+
function BrandProvider({ defaultBrand, defaultMode, children }) {
|
|
28
|
+
const { theme, setTheme } = useTheme();
|
|
31
29
|
const [brand, setBrandState] = useState(()=>readStoredBrand() ?? defaultBrand);
|
|
32
30
|
const [mounted, setMounted] = useState(false);
|
|
31
|
+
const system = useSyncExternalStore(subscribeAppearance, getAppearance, getServerAppearance);
|
|
32
|
+
const mode = "light" === theme || "dark" === theme || "system" === theme ? theme : defaultMode;
|
|
33
|
+
const resolvedMode = resolveAppearance(brand, mode, system);
|
|
33
34
|
useEffect(()=>{
|
|
34
35
|
setMounted(true);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const onStorage = (event)=>{
|
|
37
|
+
if (event.key !== BRAND_STORAGE_KEY && null !== event.key) return;
|
|
38
|
+
if (event.storageArea && event.storageArea !== window.localStorage) return;
|
|
39
|
+
const value = event.newValue;
|
|
40
|
+
setBrandState(value && isBrandKey(value) ? value : defaultBrand);
|
|
41
|
+
};
|
|
42
|
+
window.addEventListener("storage", onStorage);
|
|
43
|
+
return ()=>window.removeEventListener("storage", onStorage);
|
|
44
|
+
}, [
|
|
45
|
+
defaultBrand
|
|
46
|
+
]);
|
|
47
|
+
useLayoutEffect(()=>{
|
|
48
|
+
const root = document.documentElement;
|
|
49
|
+
root.setAttribute("data-theme", brandAttr(brand));
|
|
50
|
+
root.classList.remove("light", "dark");
|
|
51
|
+
root.classList.add(resolvedMode);
|
|
52
|
+
root.style.colorScheme = resolvedMode;
|
|
40
53
|
}, [
|
|
41
54
|
brand,
|
|
42
|
-
|
|
55
|
+
resolvedMode
|
|
43
56
|
]);
|
|
44
|
-
|
|
57
|
+
const setBrand = (next)=>{
|
|
58
|
+
setBrandState(next);
|
|
59
|
+
try {
|
|
60
|
+
window.localStorage.setItem(BRAND_STORAGE_KEY, next);
|
|
61
|
+
} catch {}
|
|
62
|
+
};
|
|
63
|
+
return /*#__PURE__*/ jsx(AppThemeContext.Provider, {
|
|
45
64
|
value: {
|
|
46
65
|
brand,
|
|
47
|
-
|
|
66
|
+
brands: brandKeys(),
|
|
67
|
+
setBrand,
|
|
68
|
+
mode,
|
|
69
|
+
resolvedMode,
|
|
70
|
+
setMode: setTheme,
|
|
71
|
+
availableModes: availableModeSettings(brand),
|
|
48
72
|
mounted
|
|
49
73
|
},
|
|
50
74
|
children: children
|
|
51
75
|
});
|
|
52
76
|
}
|
|
53
|
-
function AppThemeProvider({ defaultBrand = DEFAULT_BRAND, defaultMode = DEFAULT_MODE, children }) {
|
|
54
|
-
return /*#__PURE__*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
77
|
+
function AppThemeProvider({ defaultBrand = DEFAULT_BRAND, defaultMode = DEFAULT_MODE, nonce, children }) {
|
|
78
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
79
|
+
children: [
|
|
80
|
+
/*#__PURE__*/ jsx(BrandThemeScript, {
|
|
81
|
+
defaultBrand: defaultBrand,
|
|
82
|
+
defaultMode: defaultMode,
|
|
83
|
+
nonce: nonce
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ jsx(ThemeProvider, {
|
|
86
|
+
attribute: "data-requested-mode",
|
|
87
|
+
defaultTheme: defaultMode,
|
|
88
|
+
enableColorScheme: false,
|
|
89
|
+
enableSystem: true,
|
|
90
|
+
nonce: nonce,
|
|
91
|
+
storageKey: MODE_STORAGE_KEY,
|
|
92
|
+
themes: [
|
|
93
|
+
"light",
|
|
94
|
+
"dark"
|
|
95
|
+
],
|
|
96
|
+
children: /*#__PURE__*/ jsx(BrandProvider, {
|
|
97
|
+
defaultBrand: defaultBrand,
|
|
98
|
+
defaultMode: defaultMode,
|
|
99
|
+
children: children
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
]
|
|
68
103
|
});
|
|
69
104
|
}
|
|
70
105
|
function useAppTheme() {
|
|
71
|
-
const
|
|
72
|
-
if (!
|
|
73
|
-
|
|
74
|
-
const { brand, setBrand, mounted } = brandCtx;
|
|
75
|
-
const mode = theme ?? DEFAULT_MODE;
|
|
76
|
-
const resolvedMode = "system" === mode ? systemTheme ?? "light" : mode;
|
|
77
|
-
return {
|
|
78
|
-
brand,
|
|
79
|
-
brands: brandKeys(),
|
|
80
|
-
setBrand,
|
|
81
|
-
mode,
|
|
82
|
-
resolvedMode,
|
|
83
|
-
setMode: (next)=>{
|
|
84
|
-
if ("light" === next || brandSupportsDark(brand)) setTheme(next);
|
|
85
|
-
},
|
|
86
|
-
availableModes: availableModeSettings(brand),
|
|
87
|
-
mounted
|
|
88
|
-
};
|
|
106
|
+
const context = useContext(AppThemeContext);
|
|
107
|
+
if (!context) throw new Error("useAppTheme must be used within AppThemeProvider");
|
|
108
|
+
return context;
|
|
89
109
|
}
|
|
90
|
-
function BrandThemeScript({ defaultBrand = DEFAULT_BRAND }) {
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
110
|
+
function BrandThemeScript({ defaultBrand = DEFAULT_BRAND, defaultMode = DEFAULT_MODE, nonce }) {
|
|
111
|
+
const brands = Object.fromEntries(brandKeys().map((key)=>[
|
|
112
|
+
key,
|
|
113
|
+
{
|
|
114
|
+
attr: brandAttr(key),
|
|
115
|
+
dark: brandSupportsDark(key)
|
|
116
|
+
}
|
|
117
|
+
]));
|
|
118
|
+
const script = `(function(){var b=${JSON.stringify(defaultBrand)},m=${JSON.stringify(defaultMode)},r=${JSON.stringify(brands)};try{var s=localStorage.getItem(${JSON.stringify(BRAND_STORAGE_KEY)});if(s&&Object.prototype.hasOwnProperty.call(r,s)){b=s;}var t=localStorage.getItem(${JSON.stringify(MODE_STORAGE_KEY)});if(t==='light'||t==='dark'||t==='system'){m=t;}}catch(e){}var e=document.documentElement;e.setAttribute('data-theme',r[b].attr);var c=r[b].dark?(m==='system'?(window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'):m):'light';e.classList.remove('light','dark');e.classList.add(c);e.style.colorScheme=c;})();`;
|
|
94
119
|
return /*#__PURE__*/ jsx("script", {
|
|
95
120
|
dangerouslySetInnerHTML: {
|
|
96
121
|
__html: script
|
|
97
122
|
},
|
|
123
|
+
nonce: nonce,
|
|
98
124
|
suppressHydrationWarning: true
|
|
99
125
|
});
|
|
100
126
|
}
|
|
101
|
-
export { AppThemeProvider, BrandThemeScript, useAppTheme };
|
|
127
|
+
export { AppThemeProvider, BrandThemeScript, resolveAppearance, useAppTheme };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
"use client";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { Button } from "../atoms/button.js";
|
|
4
5
|
import { tv } from "../utils.js";
|
|
@@ -7,10 +8,11 @@ import { useAppTheme } from "./theme-provider.js";
|
|
|
7
8
|
const themeToggle = tv({
|
|
8
9
|
slots: {
|
|
9
10
|
root: "",
|
|
10
|
-
group: "flex flex-col gap-
|
|
11
|
-
modeGroup: "mt-
|
|
12
|
-
label: "text-
|
|
13
|
-
row: "flex gap-
|
|
11
|
+
group: "flex min-w-0 flex-col gap-theme-toggle-group",
|
|
12
|
+
modeGroup: "mt-theme-toggle-mode flex min-w-0 flex-col gap-theme-toggle-group",
|
|
13
|
+
label: "text-theme-toggle-label-size",
|
|
14
|
+
row: "flex flex-wrap gap-theme-toggle-choice",
|
|
15
|
+
choice: "h-auto min-h-form-control-sm min-w-0 whitespace-normal break-words"
|
|
14
16
|
}
|
|
15
17
|
});
|
|
16
18
|
const MODE_LABELS = {
|
|
@@ -21,44 +23,50 @@ const MODE_LABELS = {
|
|
|
21
23
|
function ThemeToggle({ className }) {
|
|
22
24
|
const { brand, brands, setBrand, mode, setMode, availableModes, mounted } = useAppTheme();
|
|
23
25
|
const showModes = mounted && availableModes.length > 1;
|
|
24
|
-
const { root, group, modeGroup, label, row } = themeToggle();
|
|
26
|
+
const { root, group, modeGroup, label, row, choice } = themeToggle();
|
|
25
27
|
return /*#__PURE__*/ jsxs("div", {
|
|
26
28
|
className: root({
|
|
27
29
|
className
|
|
28
30
|
}),
|
|
29
31
|
children: [
|
|
30
|
-
/*#__PURE__*/ jsxs("
|
|
32
|
+
/*#__PURE__*/ jsxs("fieldset", {
|
|
31
33
|
className: group(),
|
|
32
34
|
children: [
|
|
33
|
-
/*#__PURE__*/ jsx("
|
|
35
|
+
/*#__PURE__*/ jsx("legend", {
|
|
34
36
|
className: label(),
|
|
35
37
|
children: "Brand"
|
|
36
38
|
}),
|
|
37
39
|
/*#__PURE__*/ jsx("div", {
|
|
38
40
|
className: row(),
|
|
39
41
|
children: brands.map((key)=>/*#__PURE__*/ jsx(Button, {
|
|
42
|
+
"aria-pressed": mounted && key === brand,
|
|
43
|
+
className: choice(),
|
|
40
44
|
onClick: ()=>setBrand(key),
|
|
41
45
|
size: "sm",
|
|
42
46
|
theme: mounted && key === brand ? "solid" : "outlined",
|
|
47
|
+
type: "button",
|
|
43
48
|
variant: "primary",
|
|
44
49
|
children: getBrand(key).label
|
|
45
50
|
}, key))
|
|
46
51
|
})
|
|
47
52
|
]
|
|
48
53
|
}),
|
|
49
|
-
showModes && /*#__PURE__*/ jsxs("
|
|
54
|
+
showModes && /*#__PURE__*/ jsxs("fieldset", {
|
|
50
55
|
className: modeGroup(),
|
|
51
56
|
children: [
|
|
52
|
-
/*#__PURE__*/ jsx("
|
|
57
|
+
/*#__PURE__*/ jsx("legend", {
|
|
53
58
|
className: label(),
|
|
54
59
|
children: "Mode"
|
|
55
60
|
}),
|
|
56
61
|
/*#__PURE__*/ jsx("div", {
|
|
57
62
|
className: row(),
|
|
58
63
|
children: availableModes.map((value)=>/*#__PURE__*/ jsx(Button, {
|
|
64
|
+
"aria-pressed": mounted && value === mode,
|
|
65
|
+
className: choice(),
|
|
59
66
|
onClick: ()=>setMode(value),
|
|
60
67
|
size: "sm",
|
|
61
68
|
theme: mounted && value === mode ? "solid" : "outlined",
|
|
69
|
+
type: "button",
|
|
62
70
|
variant: "secondary",
|
|
63
71
|
children: MODE_LABELS[value]
|
|
64
72
|
}, value))
|
package/dist/utils.js
CHANGED
|
@@ -9,15 +9,25 @@ const tv = createTV({
|
|
|
9
9
|
twMergeConfig: {
|
|
10
10
|
theme: {
|
|
11
11
|
text: [
|
|
12
|
+
"popover-description",
|
|
12
13
|
(value)=>TEXT_SIZE_REGEX.test(value)
|
|
13
14
|
],
|
|
14
15
|
"font-weight": [
|
|
15
16
|
"button",
|
|
16
17
|
"input",
|
|
17
|
-
"input-placeholder"
|
|
18
|
+
"input-placeholder",
|
|
19
|
+
"label",
|
|
20
|
+
"popover-title"
|
|
18
21
|
]
|
|
19
22
|
},
|
|
20
23
|
classGroups: {
|
|
24
|
+
"outline-style": [
|
|
25
|
+
{
|
|
26
|
+
outline: [
|
|
27
|
+
(value)=>value.startsWith("(style:")
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
21
31
|
p: [
|
|
22
32
|
{
|
|
23
33
|
p: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techsio/ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -68,19 +68,23 @@
|
|
|
68
68
|
],
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build": "rslib build",
|
|
71
|
-
"check:package": "cross-env RSLIB_CHECK_OUTPUT=true rslib build && node scripts/validate-package-exports.mjs",
|
|
71
|
+
"check:package": "cross-env RSLIB_CHECK_OUTPUT=true rslib build && node scripts/validate-package-exports.mjs && pnpm check:consumer",
|
|
72
|
+
"check:consumer": "node --test test/visual-package-consumer.test.mjs",
|
|
72
73
|
"build:storybook": "storybook build",
|
|
73
74
|
"dev": "rslib build --watch",
|
|
74
75
|
"storybook": "storybook dev",
|
|
75
76
|
"figma:connect:parse": "figma connect parse --config figma.config.json",
|
|
76
77
|
"figma:connect:publish": "figma connect publish --config figma.config.json",
|
|
77
|
-
"test": "vitest run --config vitest.config.ts",
|
|
78
|
+
"test": "vitest run --config vitest.config.ts && pnpm test:node",
|
|
79
|
+
"test:node": "node --test test/visual-tooling.test.mjs test/token-utility-prefixes.test.mjs ../../.agents/skills/figma-token-binding/scripts/merge-figma-themes.test.mjs scripts/*.node-test.mjs",
|
|
78
80
|
"test-storybook": "test-storybook --index-json",
|
|
79
81
|
"storybook:a11y": "bash scripts/storybook-a11y.sh",
|
|
82
|
+
"storybook:a11y:report": "cross-env A11Y_REPORT_FAIL_ON_VIOLATIONS=false bash scripts/storybook-a11y.sh",
|
|
80
83
|
"test:visual-assets": "node --test test/visual-assets.test.mjs",
|
|
81
84
|
"test:components": "node scripts/run-component-tests.mjs",
|
|
85
|
+
"test:components:release": "cross-env VISUAL_RELEASE_READINESS=1 node scripts/run-component-tests.mjs",
|
|
82
86
|
"test:components:update": "node scripts/run-component-tests.mjs --update-snapshots",
|
|
83
|
-
"test:sidebar:ssr": "
|
|
87
|
+
"test:sidebar:ssr": "vitest run --config vitest.config.ts test/sidebar.ssr.bun.tsx",
|
|
84
88
|
"lint:tailwind": "eslint \"**/*.{js,jsx,ts,tsx}\" --config eslint.config.js",
|
|
85
89
|
"lint:tailwind:fix": "eslint \"**/*.{js,jsx,ts,tsx}\" --config eslint.config.js --fix",
|
|
86
90
|
"prepare": "node -e \"if (!process.env.RSLIB_CHECK_OUTPUT) require('node:child_process').execSync('pnpm build', { stdio: 'inherit' })\"",
|
|
@@ -104,7 +108,7 @@
|
|
|
104
108
|
"@internationalized/date": "^3.12.4",
|
|
105
109
|
"@tanstack/charts": "^1.1.0",
|
|
106
110
|
"@tanstack/react-table": "^9.2.8",
|
|
107
|
-
"@tanstack/react-virtual": "^3.14.
|
|
111
|
+
"@tanstack/react-virtual": "^3.14.21",
|
|
108
112
|
"@zag-js/accordion": "^1.45.0",
|
|
109
113
|
"@zag-js/carousel": "^1.45.0",
|
|
110
114
|
"@zag-js/cascade-select": "^1.45.0",
|
package/src/tokens/_base.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@theme static {
|
|
2
|
-
/*
|
|
2
|
+
/* Fallback radius scale. Effective exported radii are 8/12/16px; see THEME-FLOW.md. */
|
|
3
3
|
--radius-sm: 4px;
|
|
4
4
|
--radius-md: 8px;
|
|
5
5
|
--radius-lg: 12px;
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
--offset-shadow-3: 1px 1px 20px 0px;
|
|
15
15
|
|
|
16
16
|
--shadow-primary:
|
|
17
|
-
var(--offset-shadow-1) var(--color-shadow-1),
|
|
18
|
-
var(--
|
|
17
|
+
var(--offset-shadow-1) var(--color-shadow-1),
|
|
18
|
+
var(--offset-shadow-2) var(--color-shadow-2),
|
|
19
|
+
var(--offset-shadow-3) var(--color-shadow-3);
|
|
19
20
|
|
|
20
21
|
/* Motion — strong ease-out for UI feedback, ease-in-out for on-screen
|
|
21
22
|
* movement. Never ease-in: it delays the response the user is waiting for. */
|