@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
package/dist/organisms/footer.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { Children, Fragment, cloneElement, createContext, isValidElement, useContext } from "react";
|
|
3
4
|
import { Link } from "../atoms/link.js";
|
|
@@ -5,10 +6,10 @@ import { tv } from "../utils.js";
|
|
|
5
6
|
const footerVariants = tv({
|
|
6
7
|
slots: {
|
|
7
8
|
root: "flex w-full items-center justify-center rounded-footer bg-footer-bg",
|
|
8
|
-
container: "w-full max-w-footer-max bg-footer-container-bg",
|
|
9
|
-
section: "bg-footer-section-bg",
|
|
10
|
-
list: "flex list-none flex-col gap-footer-list bg-footer-list-bg",
|
|
11
|
-
bottom: "border-t-(length:--border-footer-width) flex w-full items-center justify-between bg-footer-bottom-bg pt-footer-bottom",
|
|
9
|
+
container: "w-full min-w-0 max-w-footer-max bg-footer-container-bg",
|
|
10
|
+
section: "wrap-anywhere min-w-0 bg-footer-section-bg",
|
|
11
|
+
list: "flex min-w-0 list-none flex-col gap-footer-list bg-footer-list-bg",
|
|
12
|
+
bottom: "border-t-(length:--border-footer-width) flex w-full flex-wrap items-center justify-between gap-footer-list border-footer-bottom-border bg-footer-bottom-bg pt-footer-bottom",
|
|
12
13
|
title: "font-footer-title text-footer-title-fg transition-colors duration-200 hover:text-footer-title-fg-hover motion-reduce:transition-none",
|
|
13
14
|
link: "font-footer-link text-footer-link-fg transition-colors duration-200 hover:text-footer-link-fg-hover motion-reduce:transition-none",
|
|
14
15
|
text: "text-footer-text-fg",
|
|
@@ -25,10 +26,10 @@ const footerVariants = tv({
|
|
|
25
26
|
},
|
|
26
27
|
layout: {
|
|
27
28
|
col: {
|
|
28
|
-
container: "grid grid-cols-(--footer-cols)"
|
|
29
|
+
container: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-(--footer-cols)"
|
|
29
30
|
},
|
|
30
31
|
row: {
|
|
31
|
-
container: "flex flex-
|
|
32
|
+
container: "flex flex-wrap"
|
|
32
33
|
}
|
|
33
34
|
},
|
|
34
35
|
sectionFlow: {
|
|
@@ -83,7 +84,7 @@ const footerVariants = tv({
|
|
|
83
84
|
}
|
|
84
85
|
});
|
|
85
86
|
const FooterContext = /*#__PURE__*/ createContext({});
|
|
86
|
-
function Footer({ children, size, sectionFlow, direction, layout, className }) {
|
|
87
|
+
function Footer({ children, size, sectionFlow, direction, layout, className, ...props }) {
|
|
87
88
|
const { root } = footerVariants({
|
|
88
89
|
size,
|
|
89
90
|
direction
|
|
@@ -98,11 +99,12 @@ function Footer({ children, size, sectionFlow, direction, layout, className }) {
|
|
|
98
99
|
className: root({
|
|
99
100
|
className
|
|
100
101
|
}),
|
|
102
|
+
...props,
|
|
101
103
|
children: children
|
|
102
104
|
})
|
|
103
105
|
});
|
|
104
106
|
}
|
|
105
|
-
Footer.Container = function({ children, className }) {
|
|
107
|
+
Footer.Container = function({ children, className, ...props }) {
|
|
106
108
|
const { size, layout } = useContext(FooterContext);
|
|
107
109
|
const { container } = footerVariants({
|
|
108
110
|
size,
|
|
@@ -112,10 +114,11 @@ Footer.Container = function({ children, className }) {
|
|
|
112
114
|
className: container({
|
|
113
115
|
className
|
|
114
116
|
}),
|
|
117
|
+
...props,
|
|
115
118
|
children: children
|
|
116
119
|
});
|
|
117
120
|
};
|
|
118
|
-
Footer.Section = function({ children, className }) {
|
|
121
|
+
Footer.Section = function({ children, className, ...props }) {
|
|
119
122
|
const { size, sectionFlow } = useContext(FooterContext);
|
|
120
123
|
const { section } = footerVariants({
|
|
121
124
|
size,
|
|
@@ -125,10 +128,12 @@ Footer.Section = function({ children, className }) {
|
|
|
125
128
|
className: section({
|
|
126
129
|
className
|
|
127
130
|
}),
|
|
131
|
+
role: "group",
|
|
132
|
+
...props,
|
|
128
133
|
children: children
|
|
129
134
|
});
|
|
130
135
|
};
|
|
131
|
-
Footer.Title = function({ children, className }) {
|
|
136
|
+
Footer.Title = function({ children, className, ...props }) {
|
|
132
137
|
const { size } = useContext(FooterContext);
|
|
133
138
|
const { title } = footerVariants({
|
|
134
139
|
size
|
|
@@ -137,6 +142,7 @@ Footer.Title = function({ children, className }) {
|
|
|
137
142
|
className: title({
|
|
138
143
|
className
|
|
139
144
|
}),
|
|
145
|
+
...props,
|
|
140
146
|
children: children
|
|
141
147
|
});
|
|
142
148
|
};
|
|
@@ -154,7 +160,7 @@ function FooterLink({ children, className, ...linkProps }) {
|
|
|
154
160
|
});
|
|
155
161
|
}
|
|
156
162
|
Footer.Link = FooterLink;
|
|
157
|
-
Footer.Text = function({ children, className }) {
|
|
163
|
+
Footer.Text = function({ children, className, ...props }) {
|
|
158
164
|
const { size } = useContext(FooterContext);
|
|
159
165
|
const { text } = footerVariants({
|
|
160
166
|
size
|
|
@@ -163,6 +169,7 @@ Footer.Text = function({ children, className }) {
|
|
|
163
169
|
className: text({
|
|
164
170
|
className
|
|
165
171
|
}),
|
|
172
|
+
...props,
|
|
166
173
|
children: children
|
|
167
174
|
});
|
|
168
175
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment, createContext, useContext, useEffect, useState } from "react";
|
|
3
|
+
import { Fragment, createContext, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
4
|
import { Button } from "../atoms/button.js";
|
|
4
|
-
import { Image } from "../atoms/image.js";
|
|
5
|
+
import { Image, ImageWithFallback } from "../atoms/image.js";
|
|
5
6
|
import { Carousel } from "../molecules/carousel.js";
|
|
6
7
|
import { tv } from "../utils.js";
|
|
7
8
|
const galleryVariants = tv({
|
|
@@ -58,10 +59,8 @@ function useGalleryContext() {
|
|
|
58
59
|
return context;
|
|
59
60
|
}
|
|
60
61
|
function clampPage(page, maxPage) {
|
|
61
|
-
if (Number.
|
|
62
|
-
|
|
63
|
-
if (page > maxPage) return maxPage;
|
|
64
|
-
return page;
|
|
62
|
+
if (!Number.isFinite(page)) return 1 / 0 === page ? maxPage : 0;
|
|
63
|
+
return Math.min(maxPage, Math.max(0, Math.trunc(page)));
|
|
65
64
|
}
|
|
66
65
|
function getDefaultThumbnailAriaLabel({ index }) {
|
|
67
66
|
return `Show slide ${index + 1}`;
|
|
@@ -119,8 +118,49 @@ Gallery.Main = function({ children, className, ...props }) {
|
|
|
119
118
|
children: children
|
|
120
119
|
});
|
|
121
120
|
};
|
|
122
|
-
Gallery.Thumbnails = function({ children, className, listClassName, scrollAreaClassName, thumbnailClassName, renderThumbnail, ...props }) {
|
|
121
|
+
Gallery.Thumbnails = function({ children, className, listClassName, listRef, scrollAreaRef: callerScrollAreaRef, scrollAreaClassName, thumbnailClassName, renderThumbnail, ...props }) {
|
|
123
122
|
const { items, page, setPage, showThumbnails, styles } = useGalleryContext();
|
|
123
|
+
const scrollAreaRef = useRef(null);
|
|
124
|
+
const mergedScrollAreaRef = useMemo(()=>(node)=>{
|
|
125
|
+
scrollAreaRef.current = node;
|
|
126
|
+
const cleanup = "function" == typeof callerScrollAreaRef ? callerScrollAreaRef(node) : void 0;
|
|
127
|
+
if (callerScrollAreaRef && "function" != typeof callerScrollAreaRef) callerScrollAreaRef.current = node;
|
|
128
|
+
return ()=>{
|
|
129
|
+
scrollAreaRef.current = null;
|
|
130
|
+
if ("function" == typeof cleanup) cleanup();
|
|
131
|
+
else if ("function" == typeof callerScrollAreaRef) callerScrollAreaRef(null);
|
|
132
|
+
else if (callerScrollAreaRef) callerScrollAreaRef.current = null;
|
|
133
|
+
};
|
|
134
|
+
}, [
|
|
135
|
+
callerScrollAreaRef
|
|
136
|
+
]);
|
|
137
|
+
useEffect(()=>{
|
|
138
|
+
const rail = scrollAreaRef.current;
|
|
139
|
+
const active = rail?.querySelector('[aria-current="true"]');
|
|
140
|
+
if (!(rail && active)) return;
|
|
141
|
+
const reveal = ()=>{
|
|
142
|
+
const bounds = rail.getBoundingClientRect();
|
|
143
|
+
const item = active.getBoundingClientRect();
|
|
144
|
+
let left = 0;
|
|
145
|
+
let top = 0;
|
|
146
|
+
if (item.left < bounds.left) left = item.left - bounds.left;
|
|
147
|
+
else if (item.right > bounds.right) left = item.right - bounds.right;
|
|
148
|
+
if (item.top < bounds.top) top = item.top - bounds.top;
|
|
149
|
+
else if (item.bottom > bounds.bottom) top = item.bottom - bounds.bottom;
|
|
150
|
+
if (left || top) rail.scrollBy({
|
|
151
|
+
left,
|
|
152
|
+
top,
|
|
153
|
+
behavior: "instant"
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
reveal();
|
|
157
|
+
const observer = "u" < typeof ResizeObserver ? void 0 : new ResizeObserver(reveal);
|
|
158
|
+
observer?.observe(rail);
|
|
159
|
+
return ()=>observer?.disconnect();
|
|
160
|
+
}, [
|
|
161
|
+
page,
|
|
162
|
+
showThumbnails
|
|
163
|
+
]);
|
|
124
164
|
if (!showThumbnails) return null;
|
|
125
165
|
const thumbnails = children ? children : items.map((item, index)=>{
|
|
126
166
|
const defaultThumbnail = /*#__PURE__*/ jsx(Gallery.Thumbnail, {
|
|
@@ -147,10 +187,12 @@ Gallery.Thumbnails = function({ children, className, listClassName, scrollAreaCl
|
|
|
147
187
|
className: styles.thumbnailsScrollArea({
|
|
148
188
|
className: scrollAreaClassName
|
|
149
189
|
}),
|
|
190
|
+
ref: mergedScrollAreaRef,
|
|
150
191
|
children: /*#__PURE__*/ jsx("div", {
|
|
151
192
|
className: styles.thumbnailsList({
|
|
152
193
|
className: listClassName
|
|
153
194
|
}),
|
|
195
|
+
ref: listRef,
|
|
154
196
|
children: thumbnails
|
|
155
197
|
})
|
|
156
198
|
})
|
|
@@ -162,10 +204,8 @@ Gallery.Thumbnail = function({ index, children, imageAs, imageClassName, classNa
|
|
|
162
204
|
if (!item) return null;
|
|
163
205
|
const isActive = page === index;
|
|
164
206
|
const thumbnailSource = item.thumbnailSrc || item.src || "";
|
|
165
|
-
const
|
|
166
|
-
const
|
|
167
|
-
const hasCustomThumbnailComponent = resolvedImageAs !== Image;
|
|
168
|
-
const CustomThumbnailComponent = hasCustomThumbnailComponent ? resolvedImageAs : Image;
|
|
207
|
+
const resolvedImageAs = imageAs ?? thumbnailImageAs;
|
|
208
|
+
const Media = ImageWithFallback;
|
|
169
209
|
const handleClick = (event)=>{
|
|
170
210
|
onClick?.(event);
|
|
171
211
|
if (event.defaultPrevented) return;
|
|
@@ -175,21 +215,15 @@ Gallery.Thumbnail = function({ index, children, imageAs, imageClassName, classNa
|
|
|
175
215
|
"--gallery-thumbnail-size": `${thumbnailSize}px`,
|
|
176
216
|
...style
|
|
177
217
|
};
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
alt:
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
width: thumbnailSize,
|
|
185
|
-
...item.thumbnailImageProps
|
|
186
|
-
}) : /*#__PURE__*/ jsx(Image, {
|
|
187
|
-
alt: thumbnailAlt,
|
|
188
|
-
className: imageClassName,
|
|
218
|
+
const fallbackThumbnail = /*#__PURE__*/ jsx(Media, {
|
|
219
|
+
...item.thumbnailImageProps,
|
|
220
|
+
alt: "",
|
|
221
|
+
"aria-hidden": "true",
|
|
222
|
+
as: resolvedImageAs && resolvedImageAs !== Image ? resolvedImageAs : "img",
|
|
223
|
+
className: imageClassName ?? item.thumbnailImageProps?.className,
|
|
189
224
|
height: thumbnailSize,
|
|
190
225
|
src: thumbnailSource,
|
|
191
|
-
width: thumbnailSize
|
|
192
|
-
...item.thumbnailImageProps
|
|
226
|
+
width: thumbnailSize
|
|
193
227
|
});
|
|
194
228
|
return /*#__PURE__*/ jsx(Button, {
|
|
195
229
|
"aria-current": isActive ? "true" : void 0,
|
|
@@ -225,10 +259,13 @@ Gallery.Carousel = function({ children, onPageChange, ...props }) {
|
|
|
225
259
|
onPageChange?.(details);
|
|
226
260
|
};
|
|
227
261
|
return /*#__PURE__*/ jsx(Carousel, {
|
|
262
|
+
"aria-label": "Product images",
|
|
228
263
|
...mergedProps,
|
|
229
264
|
onPageChange: handlePageChange,
|
|
230
265
|
page: page,
|
|
231
266
|
slideCount: items.length,
|
|
267
|
+
slidesPerMove: 1,
|
|
268
|
+
slidesPerPage: 1,
|
|
232
269
|
children: children ?? /*#__PURE__*/ jsx(Gallery.Slides, {})
|
|
233
270
|
});
|
|
234
271
|
};
|
package/dist/organisms/header.js
CHANGED
|
@@ -1,51 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useState } from "react";
|
|
3
|
+
import { createContext, useContext, useEffect, useId, useRef, useState } from "react";
|
|
3
4
|
import { Button } from "../atoms/button.js";
|
|
4
5
|
import { tv } from "../utils.js";
|
|
5
6
|
const headerVariants = tv({
|
|
6
7
|
slots: {
|
|
7
8
|
root: [
|
|
8
|
-
"@container w-full bg-header-bg",
|
|
9
|
+
"@container w-full min-w-0 bg-header-bg",
|
|
9
10
|
"flex justify-between",
|
|
10
11
|
"max-w-header-max",
|
|
11
12
|
"relative"
|
|
12
13
|
],
|
|
13
|
-
desktop: "
|
|
14
|
+
desktop: "header-desktop w-full min-w-0",
|
|
14
15
|
mobile: [
|
|
15
|
-
"absolute top-full
|
|
16
|
+
"header-mobile absolute inset-x-0 top-full z-20 w-full min-w-0 bg-header-bg *:flex *:flex-col data-[position=right]:right-0 data-[position=left]:left-0 data-[open=false]:hidden"
|
|
16
17
|
],
|
|
17
18
|
container: [
|
|
18
|
-
"grid w-full gap-header-container",
|
|
19
|
+
"grid w-full min-w-0 gap-header-container",
|
|
19
20
|
"data-[position=start]:justify-items-start-safe",
|
|
20
21
|
"data-[position=center]:justify-items-center-safe",
|
|
21
22
|
"data-[position=end]:justify-items-end-safe"
|
|
22
23
|
],
|
|
23
24
|
nav: [
|
|
24
25
|
"flex flex-1 items-center",
|
|
25
|
-
"
|
|
26
|
+
"bg-header-bg"
|
|
26
27
|
],
|
|
27
28
|
navItem: [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
"bg-header-nav-item-bg hover:bg-header-nav-item-bg-hover",
|
|
30
|
+
"data-[active=true]:text-header-nav-fg-active",
|
|
31
|
+
"data-[active=true]:font-header-nav-active",
|
|
32
|
+
"min-w-max",
|
|
33
|
+
"transition-colors duration-200 motion-reduce:transition-none"
|
|
33
34
|
],
|
|
34
35
|
actions: [
|
|
35
36
|
"flex items-center",
|
|
36
37
|
"shrink-0"
|
|
37
38
|
],
|
|
38
39
|
actionItem: [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
"text-header-actions-fg",
|
|
41
|
+
"hover:text-header-actions-fg-hover",
|
|
42
|
+
"transition-colors duration-200 motion-reduce:transition-none"
|
|
42
43
|
],
|
|
43
44
|
hamburger: [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
"header-hamburger ms-auto shrink-0",
|
|
46
|
+
"items-center",
|
|
47
|
+
"text-header-hamburger-fg hover:text-header-hamburger-fg-hover",
|
|
48
|
+
"transition-colors duration-header motion-reduce:transition-none",
|
|
49
|
+
"cursor-pointer"
|
|
49
50
|
]
|
|
50
51
|
},
|
|
51
52
|
compoundSlots: [
|
|
@@ -78,21 +79,21 @@ const headerVariants = tv({
|
|
|
78
79
|
navItem: "p-header-item-sm text-header-item-sm",
|
|
79
80
|
actions: "gap-header-actions-sm",
|
|
80
81
|
actionItem: "p-header-item-sm text-header-item-sm",
|
|
81
|
-
hamburger: "p-header-hamburger-sm text-header-hamburger-sm"
|
|
82
|
+
hamburger: "h-form-control-sm p-header-hamburger-sm text-header-hamburger-sm"
|
|
82
83
|
},
|
|
83
84
|
md: {
|
|
84
85
|
nav: "gap-header-nav-md",
|
|
85
86
|
navItem: "p-header-item-md text-header-item-md",
|
|
86
87
|
actions: "gap-header-actions-md",
|
|
87
88
|
actionItem: "p-header-item-md text-header-item-md",
|
|
88
|
-
hamburger: "p-header-hamburger-md text-header-hamburger-md"
|
|
89
|
+
hamburger: "h-form-control-md p-header-hamburger-md text-header-hamburger-md"
|
|
89
90
|
},
|
|
90
91
|
lg: {
|
|
91
92
|
nav: "gap-header-nav-lg",
|
|
92
93
|
navItem: "p-header-item-lg text-header-item-lg",
|
|
93
94
|
actions: "gap-header-actions-lg",
|
|
94
95
|
actionItem: "p-header-item-lg text-header-item-lg",
|
|
95
|
-
hamburger: "p-header-hamburger-lg text-header-hamburger-lg"
|
|
96
|
+
hamburger: "h-form-control-lg p-header-hamburger-lg text-header-hamburger-lg"
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
},
|
|
@@ -102,13 +103,64 @@ const headerVariants = tv({
|
|
|
102
103
|
}
|
|
103
104
|
});
|
|
104
105
|
const HeaderContext = /*#__PURE__*/ createContext({
|
|
106
|
+
mobileMenuId: "",
|
|
107
|
+
setMobileMenuId: ()=>void 0,
|
|
105
108
|
isMobileMenuOpen: false,
|
|
106
|
-
setIsMobileMenuOpen: ()=>
|
|
107
|
-
toggleMobileMenu: ()=>
|
|
109
|
+
setIsMobileMenuOpen: ()=>void 0,
|
|
110
|
+
toggleMobileMenu: ()=>void 0
|
|
108
111
|
});
|
|
109
112
|
function Header({ size = "md", direction = "horizontal", className, children, ref, ...props }) {
|
|
113
|
+
const generatedMenuId = useId();
|
|
114
|
+
const [mobileMenuId, setMobileMenuId] = useState(`${generatedMenuId}-mobile-menu`);
|
|
115
|
+
const hamburgerRef = useRef(null);
|
|
110
116
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
111
117
|
const toggleMobileMenu = ()=>setIsMobileMenuOpen((prev)=>!prev);
|
|
118
|
+
useEffect(()=>{
|
|
119
|
+
if (!isMobileMenuOpen) return;
|
|
120
|
+
const ownerDocument = hamburgerRef.current?.ownerDocument;
|
|
121
|
+
const handleEscape = (event)=>{
|
|
122
|
+
if ("Escape" !== event.key || event.defaultPrevented) return;
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
setIsMobileMenuOpen(false);
|
|
125
|
+
hamburgerRef.current?.focus();
|
|
126
|
+
};
|
|
127
|
+
ownerDocument?.addEventListener("keydown", handleEscape);
|
|
128
|
+
return ()=>ownerDocument?.removeEventListener("keydown", handleEscape);
|
|
129
|
+
}, [
|
|
130
|
+
isMobileMenuOpen
|
|
131
|
+
]);
|
|
132
|
+
useEffect(()=>{
|
|
133
|
+
const trigger = hamburgerRef.current;
|
|
134
|
+
const header = trigger?.closest("header");
|
|
135
|
+
if (!(trigger && header)) return;
|
|
136
|
+
let focusWasInMobile = false;
|
|
137
|
+
const rememberFocus = (event)=>{
|
|
138
|
+
const panel = trigger.ownerDocument.getElementById(mobileMenuId);
|
|
139
|
+
focusWasInMobile = event.target === trigger || event.target instanceof Node && !!panel?.contains(event.target);
|
|
140
|
+
};
|
|
141
|
+
const reconcile = ()=>{
|
|
142
|
+
if ("none" !== getComputedStyle(trigger).display) return;
|
|
143
|
+
setIsMobileMenuOpen(false);
|
|
144
|
+
if (focusWasInMobile) {
|
|
145
|
+
header.querySelector(".header-desktop a[href], .header-desktop button:not([disabled])")?.focus();
|
|
146
|
+
focusWasInMobile = false;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
const view = trigger.ownerDocument.defaultView;
|
|
150
|
+
trigger.ownerDocument.addEventListener("focusin", rememberFocus);
|
|
151
|
+
const Observer = view?.ResizeObserver;
|
|
152
|
+
const observer = Observer ? new Observer(reconcile) : void 0;
|
|
153
|
+
observer?.observe(header);
|
|
154
|
+
if (!observer) view?.addEventListener("resize", reconcile);
|
|
155
|
+
reconcile();
|
|
156
|
+
return ()=>{
|
|
157
|
+
observer?.disconnect();
|
|
158
|
+
view?.removeEventListener("resize", reconcile);
|
|
159
|
+
trigger.ownerDocument.removeEventListener("focusin", rememberFocus);
|
|
160
|
+
};
|
|
161
|
+
}, [
|
|
162
|
+
mobileMenuId
|
|
163
|
+
]);
|
|
112
164
|
const { root } = headerVariants({
|
|
113
165
|
size,
|
|
114
166
|
direction
|
|
@@ -118,7 +170,10 @@ function Header({ size = "md", direction = "horizontal", className, children, re
|
|
|
118
170
|
size,
|
|
119
171
|
isMobileMenuOpen,
|
|
120
172
|
setIsMobileMenuOpen,
|
|
121
|
-
toggleMobileMenu
|
|
173
|
+
toggleMobileMenu,
|
|
174
|
+
mobileMenuId,
|
|
175
|
+
setMobileMenuId,
|
|
176
|
+
hamburgerRef
|
|
122
177
|
},
|
|
123
178
|
children: /*#__PURE__*/ jsx("header", {
|
|
124
179
|
className: root({
|
|
@@ -141,8 +196,14 @@ Header.Desktop = function({ className, children, ref, ...props }) {
|
|
|
141
196
|
children: children
|
|
142
197
|
});
|
|
143
198
|
};
|
|
144
|
-
Header.Mobile = function({ className, children, ref, position = "right", ...props }) {
|
|
145
|
-
const { isMobileMenuOpen } = useContext(HeaderContext);
|
|
199
|
+
Header.Mobile = function({ className, children, ref, position = "right", id, ...props }) {
|
|
200
|
+
const { isMobileMenuOpen, mobileMenuId, setMobileMenuId } = useContext(HeaderContext);
|
|
201
|
+
useEffect(()=>{
|
|
202
|
+
if (id) setMobileMenuId(id);
|
|
203
|
+
}, [
|
|
204
|
+
id,
|
|
205
|
+
setMobileMenuId
|
|
206
|
+
]);
|
|
146
207
|
const { mobile } = headerVariants();
|
|
147
208
|
return /*#__PURE__*/ jsx("section", {
|
|
148
209
|
className: mobile({
|
|
@@ -152,6 +213,7 @@ Header.Mobile = function({ className, children, ref, position = "right", ...prop
|
|
|
152
213
|
"data-position": position,
|
|
153
214
|
ref: ref,
|
|
154
215
|
...props,
|
|
216
|
+
id: mobileMenuId,
|
|
155
217
|
children: children
|
|
156
218
|
});
|
|
157
219
|
};
|
|
@@ -228,17 +290,29 @@ Header.ActionItem = function({ className, children, ref, size: overrideSize, ...
|
|
|
228
290
|
children: children
|
|
229
291
|
});
|
|
230
292
|
};
|
|
231
|
-
Header.Hamburger = function({ className }) {
|
|
232
|
-
const { toggleMobileMenu, isMobileMenuOpen } = useContext(HeaderContext);
|
|
233
|
-
const { hamburger } = headerVariants(
|
|
293
|
+
Header.Hamburger = function({ className, ref, onClick, "aria-label": ariaLabel = "Toggle mobile menu", ...props }) {
|
|
294
|
+
const { toggleMobileMenu, isMobileMenuOpen, mobileMenuId, hamburgerRef, size } = useContext(HeaderContext);
|
|
295
|
+
const { hamburger } = headerVariants({
|
|
296
|
+
size
|
|
297
|
+
});
|
|
234
298
|
return /*#__PURE__*/ jsx(Button, {
|
|
299
|
+
"aria-controls": mobileMenuId,
|
|
235
300
|
"aria-expanded": isMobileMenuOpen,
|
|
236
|
-
|
|
301
|
+
...props,
|
|
302
|
+
"aria-label": ariaLabel,
|
|
237
303
|
className: hamburger({
|
|
238
304
|
className
|
|
239
305
|
}),
|
|
240
306
|
icon: isMobileMenuOpen ? "token-icon-header-close" : "token-icon-header-menu",
|
|
241
|
-
onClick:
|
|
307
|
+
onClick: (event)=>{
|
|
308
|
+
onClick?.(event);
|
|
309
|
+
if (!event.defaultPrevented) toggleMobileMenu();
|
|
310
|
+
},
|
|
311
|
+
ref: (node)=>{
|
|
312
|
+
if (hamburgerRef) hamburgerRef.current = node;
|
|
313
|
+
if ("function" == typeof ref) return ref(node);
|
|
314
|
+
if (ref) ref.current = node;
|
|
315
|
+
},
|
|
242
316
|
size: "current",
|
|
243
317
|
theme: "unstyled",
|
|
244
318
|
type: "button"
|
package/dist/organisms/table.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { createContext, useContext } from "react";
|
|
3
4
|
import { tv } from "../utils.js";
|
|
4
5
|
const tableVariants = tv({
|
|
5
6
|
slots: {
|
|
6
7
|
root: [
|
|
7
|
-
"w-full border-collapse",
|
|
8
|
+
"isolate w-full border-collapse",
|
|
8
9
|
"bg-table-bg text-table-fg"
|
|
9
10
|
],
|
|
10
11
|
caption: [
|
|
@@ -47,12 +48,16 @@ const tableVariants = tv({
|
|
|
47
48
|
root: "border-(length:--border-table-width) rounded-table border-table-border shadow-table-outline"
|
|
48
49
|
},
|
|
49
50
|
striped: {
|
|
50
|
-
row: "odd:bg-table-row-striped-primary even:bg-table-row-striped-secondary"
|
|
51
|
+
row: "table-row-striped odd:bg-table-row-striped-primary even:bg-table-row-striped-secondary"
|
|
51
52
|
}
|
|
52
53
|
},
|
|
53
54
|
interactive: {
|
|
54
55
|
true: {
|
|
55
|
-
row:
|
|
56
|
+
row: [
|
|
57
|
+
"table-row-interactive cursor-pointer hover:bg-table-row-bg-hover",
|
|
58
|
+
"focus-visible:outline-(style:--default-ring-style) focus-visible:outline-(length:--default-ring-width)",
|
|
59
|
+
"focus-visible:-outline-offset-(length:--default-ring-width) focus-visible:outline-table-ring"
|
|
60
|
+
]
|
|
56
61
|
}
|
|
57
62
|
},
|
|
58
63
|
size: {
|
|
@@ -85,8 +90,7 @@ const tableVariants = tv({
|
|
|
85
90
|
],
|
|
86
91
|
cell: [
|
|
87
92
|
"first:sticky first:inset-s-0 first:z-10",
|
|
88
|
-
"
|
|
89
|
-
"group-data-[selected=true]:text-table-row-fg-selected"
|
|
93
|
+
"first:table-frozen-cell"
|
|
90
94
|
]
|
|
91
95
|
}
|
|
92
96
|
},
|
|
@@ -196,14 +200,25 @@ Table.Footer = function({ children, ref, className, ...props }) {
|
|
|
196
200
|
children: children
|
|
197
201
|
});
|
|
198
202
|
};
|
|
199
|
-
Table.Row = function({ children, ref, className, selected, ...props }) {
|
|
200
|
-
const { styles } = useTableContext();
|
|
203
|
+
Table.Row = function({ children, ref, className, selected, onClick, onKeyDown, tabIndex, ...props }) {
|
|
204
|
+
const { styles, interactive } = useTableContext();
|
|
205
|
+
const actionable = Boolean(interactive && onClick);
|
|
201
206
|
return /*#__PURE__*/ jsx("tr", {
|
|
207
|
+
"aria-selected": selected,
|
|
202
208
|
className: styles.row({
|
|
203
209
|
className
|
|
204
210
|
}),
|
|
205
211
|
"data-selected": selected,
|
|
212
|
+
onClick: onClick,
|
|
213
|
+
onKeyDown: (event)=>{
|
|
214
|
+
onKeyDown?.(event);
|
|
215
|
+
if (!event.defaultPrevented && actionable && event.target === event.currentTarget && ("Enter" === event.key || " " === event.key)) {
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
event.currentTarget.click();
|
|
218
|
+
}
|
|
219
|
+
},
|
|
206
220
|
ref: ref,
|
|
221
|
+
tabIndex: tabIndex ?? (actionable ? 0 : void 0),
|
|
207
222
|
...props,
|
|
208
223
|
children: children
|
|
209
224
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ActionIcon — @techsio/ui-kit atom.
|
|
3
3
|
*
|
|
4
4
|
* @component ActionIcon
|
|
5
|
-
* @componentVersion v1.1.
|
|
5
|
+
* @componentVersion v1.1.5
|
|
6
6
|
* @skill action-icon-usage
|
|
7
7
|
* @changelog libs/ui/stories/changelog/changelog.stories.tsx
|
|
8
8
|
*
|
|
@@ -14,9 +14,9 @@ import type { VariantProps } from "tailwind-variants";
|
|
|
14
14
|
import { type IconType } from "./icon.js";
|
|
15
15
|
declare const actionIconVariants: import("tailwind-variants").TVReturnType<{
|
|
16
16
|
size: {
|
|
17
|
-
sm: "size-icon-control-sm text-icon-
|
|
18
|
-
md: "size-icon-control-md text-icon-
|
|
19
|
-
lg: "size-icon-
|
|
17
|
+
sm: "size-icon-control-sm text-action-icon-sm";
|
|
18
|
+
md: "size-icon-control-md text-action-icon-md";
|
|
19
|
+
lg: "size-action-icon-lg text-action-icon-lg";
|
|
20
20
|
};
|
|
21
21
|
tone: {
|
|
22
22
|
neutral: string[];
|
|
@@ -24,9 +24,9 @@ declare const actionIconVariants: import("tailwind-variants").TVReturnType<{
|
|
|
24
24
|
};
|
|
25
25
|
}, undefined, string[], {
|
|
26
26
|
size: {
|
|
27
|
-
sm: "size-icon-control-sm text-icon-
|
|
28
|
-
md: "size-icon-control-md text-icon-
|
|
29
|
-
lg: "size-icon-
|
|
27
|
+
sm: "size-icon-control-sm text-action-icon-sm";
|
|
28
|
+
md: "size-icon-control-md text-action-icon-md";
|
|
29
|
+
lg: "size-action-icon-lg text-action-icon-lg";
|
|
30
30
|
};
|
|
31
31
|
tone: {
|
|
32
32
|
neutral: string[];
|
|
@@ -34,9 +34,9 @@ declare const actionIconVariants: import("tailwind-variants").TVReturnType<{
|
|
|
34
34
|
};
|
|
35
35
|
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
36
36
|
size: {
|
|
37
|
-
sm: "size-icon-control-sm text-icon-
|
|
38
|
-
md: "size-icon-control-md text-icon-
|
|
39
|
-
lg: "size-icon-
|
|
37
|
+
sm: "size-icon-control-sm text-action-icon-sm";
|
|
38
|
+
md: "size-icon-control-md text-action-icon-md";
|
|
39
|
+
lg: "size-action-icon-lg text-action-icon-lg";
|
|
40
40
|
};
|
|
41
41
|
tone: {
|
|
42
42
|
neutral: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-icon.d.ts","sourceRoot":"","sources":["../../../src/atoms/action-icon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAY5C,QAAA,MAAM,kBAAkB;;;;;;;QAgBlB,OAAO;QAIP,MAAM;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"action-icon.d.ts","sourceRoot":"","sources":["../../../src/atoms/action-icon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAY5C,QAAA,MAAM,kBAAkB;;;;;;;QAgBlB,OAAO;QAIP,MAAM;;;;;;;;;;;;;;;;;;;;;;cAWV,CAAA;AAEF,KAAK,kBAAkB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEjE,oEAAoE;AACpE,KAAK,cAAc,GACf;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAA;AAExD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,YAAY,GAAG,iBAAiB,CAC9C,GACC,kBAAkB,GAClB,cAAc,GAAG;IACf,IAAI,EAAE,QAAQ,CAAA;IACd,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAC7B,CAAA;AAEH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAe,EACf,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,+BAWjB;yBAnBe,UAAU"}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Badge — @techsio/ui-kit atom.
|
|
3
3
|
*
|
|
4
4
|
* @component Badge
|
|
5
|
-
* @componentVersion v1.
|
|
5
|
+
* @componentVersion v1.1.1
|
|
6
6
|
* @skill badge-usage
|
|
7
7
|
* @changelog libs/ui/stories/changelog/changelog.stories.tsx
|
|
8
8
|
*
|
|
9
9
|
* Versioning is enforced at commit by scripts/check-skill-sync.mjs: @componentVersion must match
|
|
10
10
|
* the badge-usage skill's component_version and a changelog entry. Bump all three together.
|
|
11
11
|
*/
|
|
12
|
-
import type {
|
|
12
|
+
import type { ComponentPropsWithRef } from "react";
|
|
13
13
|
import type { VariantProps } from "tailwind-variants";
|
|
14
14
|
declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
15
15
|
variant: {
|
|
@@ -71,7 +71,7 @@ declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
71
71
|
}, undefined>>;
|
|
72
72
|
type BadgeVariant = NonNullable<VariantProps<typeof badgeVariants>["variant"]>;
|
|
73
73
|
type BadgeSize = NonNullable<VariantProps<typeof badgeVariants>["size"]>;
|
|
74
|
-
type BaseBadgeProps = Omit<
|
|
74
|
+
type BaseBadgeProps = Omit<ComponentPropsWithRef<"span">, "color" | "children"> & {
|
|
75
75
|
children: string;
|
|
76
76
|
size?: BadgeSize;
|
|
77
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/atoms/badge.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/atoms/badge.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGrD,QAAA,MAAM,aAAa;;QAQb,OAAO;QAGP,SAAS;QAGT,QAAQ;QAGR,QAAQ;QAGR,IAAI;QACJ,OAAO;QAGP,OAAO;QAGP,MAAM;QAGN,OAAO;QAGP,OAAO;;;QAGP,EAAE;QACF,EAAE;QACF,EAAE;QACF,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAON,CAAA;AAEF,KAAK,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AAC9E,KAAK,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAExE,KAAK,cAAc,GAAG,IAAI,CACxB,qBAAqB,CAAC,MAAM,CAAC,EAC7B,OAAO,GAAG,UAAU,CACrB,GAAG;IACF,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB,CAAA;AAED,KAAK,iBAAiB,GAAG,cAAc,GAAG;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;CAC3C,CAAA;AAED,KAAK,iBAAiB,GAAG,cAAc,GAAG;IACxC,OAAO,EAAE,SAAS,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,iBAAiB,CAAA;AAE9D,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,EAAE,UAAU,+BAwBZ"}
|