@techsio/ui-kit 0.56.1 → 0.58.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 +78 -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 +107 -2
- package/dist/atoms/input.js +57 -9
- package/dist/atoms/label.js +13 -4
- package/dist/atoms/link-button.js +14 -12
- package/dist/atoms/link.js +18 -4
- package/dist/atoms/numeric-input.js +293 -76
- 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 +276 -38
- package/dist/molecules/color-select.js +181 -62
- package/dist/molecules/combobox.js +535 -182
- package/dist/molecules/command.js +2 -1
- package/dist/molecules/date-picker.js +571 -119
- package/dist/molecules/dialog.js +81 -47
- package/dist/molecules/drawer.js +54 -5
- 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 +23 -18
- 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 +85 -20
- package/dist/molecules/tabs.js +227 -31
- package/dist/molecules/toast.js +146 -51
- 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 +25 -5
- package/dist/organisms/data-table.helpers.js +6 -2
- package/dist/organisms/data-table.js +580 -151
- 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 +35 -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 +14 -6
- 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 +54 -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 +23 -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 +7 -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 +23 -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 +7 -3
- package/dist/src/molecules/date-picker.d.ts.map +1 -1
- package/dist/src/molecules/dialog.d.ts +7 -3
- 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 +20 -25
- 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 +25 -13
- 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 +24 -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 +103 -0
- package/src/tokens/_foundation-overrides.css +251 -0
- package/src/tokens/_reset.css +10 -10
- package/src/tokens/_scheme-scopes.css +4144 -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 +67 -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 +111 -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 +12 -14
- 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 +49 -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 +6 -6
- package/src/tokens/figma/brand-overrides.css +162 -57
- package/src/tokens/figma/business/variables.css +6 -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 +4 -4
- package/src/tokens/figma/light/variables.css +43 -40
- package/src/tokens/figma/{neo → n1}/variables.css +114 -114
- package/src/tokens/figma/variables.css +639 -240
- 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,6 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useId, useRef, useState } from "react";
|
|
3
|
+
import { useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
3
4
|
import { Button } from "../atoms/button.js";
|
|
5
|
+
import { StatusText } from "../atoms/status-text.js";
|
|
4
6
|
import { Accordion } from "../molecules/accordion.js";
|
|
5
7
|
import { Dialog } from "../molecules/dialog.js";
|
|
6
8
|
import { FormCheckbox } from "../molecules/form-checkbox.js";
|
|
@@ -13,7 +15,8 @@ const facetFilterPanelStyles = tv({
|
|
|
13
15
|
"max-h-(--container-facet-filter-panel-max-h) rounded-facet-filter-panel",
|
|
14
16
|
"border-(length:--border-width-facet-filter-panel) border-facet-filter-panel-border",
|
|
15
17
|
"bg-facet-filter-panel-bg text-facet-filter-panel-fg",
|
|
16
|
-
"p-facet-filter-panel"
|
|
18
|
+
"p-facet-filter-panel",
|
|
19
|
+
"focus-visible:facet-filter-panel-scroll-focus"
|
|
17
20
|
],
|
|
18
21
|
content: "flex min-h-0 flex-col gap-facet-filter-panel",
|
|
19
22
|
title: "font-facet-filter-panel-title text-facet-filter-panel-title text-facet-filter-panel-title-fg",
|
|
@@ -29,7 +32,7 @@ const facetFilterPanelStyles = tv({
|
|
|
29
32
|
drawerTrigger: "self-start",
|
|
30
33
|
drawerContent: "min-w-0",
|
|
31
34
|
triggerCount: "inline-flex min-w-facet-filter-panel-count items-center justify-center rounded-facet-filter-panel-count bg-facet-filter-panel-count-bg px-facet-filter-panel-count text-facet-filter-panel-count text-facet-filter-panel-count-fg",
|
|
32
|
-
activeRoot: "border-b-(length:--border-width-facet-filter-panel) flex flex-col gap-facet-filter-panel-active border-facet-filter-panel-border pb-facet-filter-panel-active",
|
|
35
|
+
activeRoot: "border-b-(length:--border-width-facet-filter-panel) flex flex-col gap-facet-filter-panel-active border-facet-filter-panel-border pb-facet-filter-panel-active data-empty:border-0 data-empty:pb-0",
|
|
33
36
|
activeHeader: "flex flex-wrap items-center justify-between gap-facet-filter-panel-active",
|
|
34
37
|
activeTitle: "font-facet-filter-panel-active-title text-facet-filter-panel-active-title",
|
|
35
38
|
activeList: "flex flex-wrap gap-facet-filter-panel-active"
|
|
@@ -39,7 +42,7 @@ const toRangeTuple = (values, group)=>[
|
|
|
39
42
|
values[0] ?? group.min,
|
|
40
43
|
values[1] ?? group.max
|
|
41
44
|
];
|
|
42
|
-
function FacetFilterOptions({ group, selectedValues, disabled, showMoreLabel, showLessLabel, onOptionChange }) {
|
|
45
|
+
function FacetFilterOptions({ group, selectedValues, disabled, readOnly, size, showMoreLabel, showLessLabel, onOptionChange }) {
|
|
43
46
|
const [expanded, setExpanded] = useState(false);
|
|
44
47
|
const styles = facetFilterPanelStyles();
|
|
45
48
|
const collapseAfter = Math.max(0, group.collapseAfter ?? group.options.length);
|
|
@@ -65,10 +68,10 @@ function FacetFilterOptions({ group, selectedValues, disabled, showMoreLabel, sh
|
|
|
65
68
|
className: styles.optionText(),
|
|
66
69
|
children: option.label
|
|
67
70
|
}),
|
|
68
|
-
void 0
|
|
71
|
+
void 0 === option.count ? null : /*#__PURE__*/ jsx("span", {
|
|
69
72
|
className: styles.optionCount(),
|
|
70
73
|
children: option.count
|
|
71
|
-
})
|
|
74
|
+
})
|
|
72
75
|
]
|
|
73
76
|
}),
|
|
74
77
|
name: group.id,
|
|
@@ -77,6 +80,8 @@ function FacetFilterOptions({ group, selectedValues, disabled, showMoreLabel, sh
|
|
|
77
80
|
value: option.value,
|
|
78
81
|
checked
|
|
79
82
|
}),
|
|
83
|
+
readOnly: readOnly,
|
|
84
|
+
size: size,
|
|
80
85
|
value: option.value
|
|
81
86
|
})
|
|
82
87
|
}, option.value))
|
|
@@ -95,7 +100,7 @@ function FacetFilterOptions({ group, selectedValues, disabled, showMoreLabel, sh
|
|
|
95
100
|
]
|
|
96
101
|
});
|
|
97
102
|
}
|
|
98
|
-
function FacetFilterPanelContent({ title, groups, selectedValues = {}, activeFilters = [], disabled = false, pending = false, pendingLabel, activeFiltersLabel = "Active filters", resetLabel = "Clear filters", showMoreLabel = (hiddenCount)=>`Show ${hiddenCount} more`, showLessLabel = "Show less", expandedGroups, defaultExpandedGroups, onExpandedGroupsChange, onOptionChange, onRangeChange, onRangeChangeEnd, onRemoveFilter, onReset, showTitle, titleId }) {
|
|
103
|
+
function FacetFilterPanelContent({ title, groups, selectedValues = {}, activeFilters = [], disabled = false, readOnly = false, size = "md", pending = false, pendingLabel, activeFiltersLabel = "Active filters", resetLabel = "Clear filters", showMoreLabel = (hiddenCount)=>`Show ${hiddenCount} more`, showLessLabel = "Show less", expandedGroups, defaultExpandedGroups, onExpandedGroupsChange, onOptionChange, onRangeChange, onRangeChangeEnd, onRemoveFilter, onReset, showTitle, titleId }) {
|
|
99
104
|
const styles = facetFilterPanelStyles();
|
|
100
105
|
const interactionDisabled = disabled || pending;
|
|
101
106
|
const optionGroupIds = groups.filter((group)=>"options" === group.type).map((group)=>group.id);
|
|
@@ -124,9 +129,10 @@ function FacetFilterPanelContent({ title, groups, selectedValues = {}, activeFil
|
|
|
124
129
|
id: titleId,
|
|
125
130
|
children: title
|
|
126
131
|
}) : null,
|
|
127
|
-
pending && pendingLabel ? /*#__PURE__*/ jsx(
|
|
128
|
-
"aria-live": "polite",
|
|
132
|
+
pending && pendingLabel ? /*#__PURE__*/ jsx(StatusText, {
|
|
129
133
|
className: styles.pending(),
|
|
134
|
+
role: "status",
|
|
135
|
+
size: size,
|
|
130
136
|
children: pendingLabel
|
|
131
137
|
}) : null,
|
|
132
138
|
/*#__PURE__*/ jsx(FacetFilterPanel.ActiveFilters, {
|
|
@@ -135,6 +141,7 @@ function FacetFilterPanelContent({ title, groups, selectedValues = {}, activeFil
|
|
|
135
141
|
label: activeFiltersLabel,
|
|
136
142
|
onRemove: onRemoveFilter,
|
|
137
143
|
onReset: onReset,
|
|
144
|
+
readOnly: readOnly,
|
|
138
145
|
resetLabel: resetLabel
|
|
139
146
|
}),
|
|
140
147
|
/*#__PURE__*/ jsx(Accordion, {
|
|
@@ -151,6 +158,10 @@ function FacetFilterPanelContent({ title, groups, selectedValues = {}, activeFil
|
|
|
151
158
|
if ("range" === group.type) return /*#__PURE__*/ jsx("section", {
|
|
152
159
|
className: styles.rangeGroup(),
|
|
153
160
|
children: /*#__PURE__*/ jsx(Slider, {
|
|
161
|
+
"aria-label": group["aria-label"] ?? [
|
|
162
|
+
`Minimum ${group.label.toLocaleLowerCase()}`,
|
|
163
|
+
`Maximum ${group.label.toLocaleLowerCase()}`
|
|
164
|
+
],
|
|
154
165
|
disabled: interactionDisabled || group.disabled,
|
|
155
166
|
formatRangeText: group.formatRangeText,
|
|
156
167
|
formatValue: group.formatValue,
|
|
@@ -158,15 +169,17 @@ function FacetFilterPanelContent({ title, groups, selectedValues = {}, activeFil
|
|
|
158
169
|
max: group.max,
|
|
159
170
|
min: group.min,
|
|
160
171
|
minStepsBetweenThumbs: group.minStepsBetweenThumbs,
|
|
161
|
-
onChange: (value)
|
|
172
|
+
onChange: (value)=>!readOnly && onRangeChange?.({
|
|
162
173
|
groupId: group.id,
|
|
163
174
|
value: toRangeTuple(value, group)
|
|
164
175
|
}),
|
|
165
|
-
onChangeEnd: (value)
|
|
176
|
+
onChangeEnd: (value)=>!readOnly && onRangeChangeEnd?.({
|
|
166
177
|
groupId: group.id,
|
|
167
178
|
value: toRangeTuple(value, group)
|
|
168
179
|
}),
|
|
180
|
+
readOnly: readOnly,
|
|
169
181
|
showValueText: true,
|
|
182
|
+
size: size,
|
|
170
183
|
step: group.step,
|
|
171
184
|
value: [
|
|
172
185
|
...group.value
|
|
@@ -186,13 +199,16 @@ function FacetFilterPanelContent({ title, groups, selectedValues = {}, activeFil
|
|
|
186
199
|
]
|
|
187
200
|
}),
|
|
188
201
|
/*#__PURE__*/ jsx(Accordion.Content, {
|
|
202
|
+
role: "group",
|
|
189
203
|
children: /*#__PURE__*/ jsx(FacetFilterOptions, {
|
|
190
204
|
disabled: interactionDisabled || Boolean(group.disabled),
|
|
191
205
|
group: group,
|
|
192
206
|
onOptionChange: onOptionChange,
|
|
207
|
+
readOnly: readOnly,
|
|
193
208
|
selectedValues: selectedValues[group.id] ?? [],
|
|
194
209
|
showLessLabel: showLessLabel,
|
|
195
|
-
showMoreLabel: showMoreLabel
|
|
210
|
+
showMoreLabel: showMoreLabel,
|
|
211
|
+
size: size
|
|
196
212
|
})
|
|
197
213
|
})
|
|
198
214
|
]
|
|
@@ -202,7 +218,7 @@ function FacetFilterPanelContent({ title, groups, selectedValues = {}, activeFil
|
|
|
202
218
|
]
|
|
203
219
|
});
|
|
204
220
|
}
|
|
205
|
-
function FacetFilterPanel({ presentation = "inline", drawerTriggerLabel, drawerPlacement = "right", drawerSize = "sm", drawerOpen, defaultDrawerOpen = false, onDrawerOpenChange, className, ...props }) {
|
|
221
|
+
function FacetFilterPanel({ "aria-label": ariaLabel, presentation = "inline", drawerTriggerLabel, drawerPlacement = "right", drawerSize = "sm", drawerOpen, defaultDrawerOpen = false, onDrawerOpenChange, className, ...props }) {
|
|
206
222
|
const styles = facetFilterPanelStyles();
|
|
207
223
|
const inlineTitleId = useId();
|
|
208
224
|
const drawerTriggerRef = useRef(null);
|
|
@@ -234,6 +250,7 @@ function FacetFilterPanel({ presentation = "inline", drawerTriggerLabel, drawerP
|
|
|
234
250
|
]
|
|
235
251
|
}),
|
|
236
252
|
/*#__PURE__*/ jsx(Dialog, {
|
|
253
|
+
"aria-label": ariaLabel,
|
|
237
254
|
className: styles.drawerContent({
|
|
238
255
|
className
|
|
239
256
|
}),
|
|
@@ -252,10 +269,12 @@ function FacetFilterPanel({ presentation = "inline", drawerTriggerLabel, drawerP
|
|
|
252
269
|
]
|
|
253
270
|
});
|
|
254
271
|
return /*#__PURE__*/ jsx("aside", {
|
|
255
|
-
"aria-
|
|
272
|
+
"aria-label": ariaLabel,
|
|
273
|
+
"aria-labelledby": ariaLabel ? void 0 : inlineTitleId,
|
|
256
274
|
className: styles.root({
|
|
257
275
|
className
|
|
258
276
|
}),
|
|
277
|
+
tabIndex: 0,
|
|
259
278
|
children: /*#__PURE__*/ jsx(FacetFilterPanelContent, {
|
|
260
279
|
...props,
|
|
261
280
|
showTitle: true,
|
|
@@ -263,48 +282,98 @@ function FacetFilterPanel({ presentation = "inline", drawerTriggerLabel, drawerP
|
|
|
263
282
|
})
|
|
264
283
|
});
|
|
265
284
|
}
|
|
266
|
-
FacetFilterPanel.ActiveFilters = function({ items, label = "Active filters", resetLabel = "Clear filters", disabled = false, className, onRemove, onReset }) {
|
|
285
|
+
FacetFilterPanel.ActiveFilters = function({ items, label = "Active filters", resetLabel = "Clear filters", disabled = false, readOnly = false, className, onRemove, onReset, fallbackFocusEl }) {
|
|
267
286
|
const styles = facetFilterPanelStyles();
|
|
268
|
-
|
|
269
|
-
|
|
287
|
+
const sectionRef = useRef(null);
|
|
288
|
+
const pendingFocus = useRef(null);
|
|
289
|
+
const itemKey = JSON.stringify(items.map((item)=>item.id));
|
|
290
|
+
useLayoutEffect(()=>{
|
|
291
|
+
const pending = pendingFocus.current;
|
|
292
|
+
const section = sectionRef.current;
|
|
293
|
+
if (!(pending && section)) return;
|
|
294
|
+
const document = section.ownerDocument;
|
|
295
|
+
if (document.activeElement !== document.body && document.activeElement !== pending.action) {
|
|
296
|
+
pendingFocus.current = null;
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
if (pending.action.isConnected) return;
|
|
300
|
+
const buttons = Array.from(section.querySelectorAll("[data-filter-id]:not(:disabled)"));
|
|
301
|
+
const nextIds = [
|
|
302
|
+
...pending.ids.slice(pending.index + 1),
|
|
303
|
+
...pending.ids.slice(0, pending.index).reverse()
|
|
304
|
+
];
|
|
305
|
+
const target = nextIds.map((id)=>buttons.find((button)=>button.dataset.filterId === id)).find(Boolean) ?? buttons[0] ?? fallbackFocusEl?.() ?? section.parentElement?.querySelector('[data-scope="accordion"][data-part="item-trigger"]:not(:disabled), [role="slider"]:not([aria-disabled="true"])') ?? section;
|
|
306
|
+
target.focus({
|
|
307
|
+
preventScroll: true
|
|
308
|
+
});
|
|
309
|
+
pendingFocus.current = null;
|
|
310
|
+
}, [
|
|
311
|
+
itemKey,
|
|
312
|
+
fallbackFocusEl
|
|
313
|
+
]);
|
|
314
|
+
const trackFocus = (action, index)=>{
|
|
315
|
+
if (action.ownerDocument.activeElement === action) pendingFocus.current = {
|
|
316
|
+
action,
|
|
317
|
+
ids: items.map((item)=>item.id),
|
|
318
|
+
index
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
return /*#__PURE__*/ jsx("div", {
|
|
322
|
+
"aria-label": "string" == typeof label ? label : "Active filters",
|
|
270
323
|
className: styles.activeRoot({
|
|
271
324
|
className
|
|
272
325
|
}),
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
326
|
+
"data-empty": 0 === items.length ? "" : void 0,
|
|
327
|
+
ref: sectionRef,
|
|
328
|
+
role: "group",
|
|
329
|
+
tabIndex: -1,
|
|
330
|
+
children: items.length > 0 && /*#__PURE__*/ jsxs(Fragment, {
|
|
331
|
+
children: [
|
|
332
|
+
/*#__PURE__*/ jsxs("div", {
|
|
333
|
+
className: styles.activeHeader(),
|
|
334
|
+
children: [
|
|
335
|
+
/*#__PURE__*/ jsx("h3", {
|
|
336
|
+
className: styles.activeTitle(),
|
|
337
|
+
children: label
|
|
338
|
+
}),
|
|
339
|
+
!readOnly && /*#__PURE__*/ jsx(Button, {
|
|
340
|
+
disabled: disabled,
|
|
341
|
+
onClick: (event)=>{
|
|
342
|
+
trackFocus(event.currentTarget, -1);
|
|
343
|
+
onReset?.();
|
|
344
|
+
},
|
|
345
|
+
size: "sm",
|
|
346
|
+
theme: "borderless",
|
|
347
|
+
type: "button",
|
|
348
|
+
variant: "primary",
|
|
349
|
+
children: resetLabel
|
|
350
|
+
})
|
|
351
|
+
]
|
|
352
|
+
}),
|
|
353
|
+
/*#__PURE__*/ jsx("div", {
|
|
354
|
+
className: styles.activeList(),
|
|
355
|
+
children: items.map((item)=>readOnly ? /*#__PURE__*/ jsx("span", {
|
|
356
|
+
className: styles.optionText(),
|
|
357
|
+
children: item.label
|
|
358
|
+
}, item.id) : /*#__PURE__*/ jsx(Button, {
|
|
359
|
+
"aria-label": item.removeLabel,
|
|
360
|
+
"data-filter-id": item.id,
|
|
361
|
+
disabled: disabled,
|
|
362
|
+
icon: "token-icon-close",
|
|
363
|
+
iconPosition: "right",
|
|
364
|
+
onClick: (event)=>{
|
|
365
|
+
trackFocus(event.currentTarget, items.indexOf(item));
|
|
366
|
+
onRemove?.(item.id);
|
|
367
|
+
},
|
|
368
|
+
size: "sm",
|
|
369
|
+
theme: "outlined",
|
|
370
|
+
type: "button",
|
|
371
|
+
variant: "primary",
|
|
372
|
+
children: item.label
|
|
373
|
+
}, item.id))
|
|
374
|
+
})
|
|
375
|
+
]
|
|
376
|
+
})
|
|
308
377
|
});
|
|
309
378
|
};
|
|
310
379
|
export { FacetFilterPanel };
|
|
@@ -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";
|