@techsio/ui-kit 0.58.0 → 0.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/atoms/button.js +40 -4
  2. package/dist/atoms/image.js +12 -2
  3. package/dist/atoms/link-button.js +2 -1
  4. package/dist/atoms/numeric-input.js +70 -9
  5. package/dist/molecules/chart.js +154 -43
  6. package/dist/molecules/combobox.js +3 -1
  7. package/dist/molecules/date-picker.js +66 -8
  8. package/dist/molecules/dialog.js +11 -4
  9. package/dist/molecules/drawer.js +10 -2
  10. package/dist/molecules/product-card.js +65 -8
  11. package/dist/molecules/switch.js +3 -2
  12. package/dist/molecules/toast.js +12 -5
  13. package/dist/organisms/data-table.fields.js +1 -0
  14. package/dist/organisms/data-table.js +7 -3
  15. package/dist/src/atoms/badge.d.ts +1 -1
  16. package/dist/src/atoms/button.d.ts +23 -11
  17. package/dist/src/atoms/button.d.ts.map +1 -1
  18. package/dist/src/atoms/image.d.ts +25 -2
  19. package/dist/src/atoms/image.d.ts.map +1 -1
  20. package/dist/src/atoms/input.d.ts +1 -1
  21. package/dist/src/atoms/link-button.d.ts +38 -14
  22. package/dist/src/atoms/link-button.d.ts.map +1 -1
  23. package/dist/src/atoms/numeric-input.d.ts +3 -2
  24. package/dist/src/atoms/numeric-input.d.ts.map +1 -1
  25. package/dist/src/atoms/textarea.d.ts +1 -1
  26. package/dist/src/molecules/chart.d.ts +12 -1
  27. package/dist/src/molecules/chart.d.ts.map +1 -1
  28. package/dist/src/molecules/combobox.d.ts +6 -2
  29. package/dist/src/molecules/combobox.d.ts.map +1 -1
  30. package/dist/src/molecules/date-picker.d.ts +24 -2
  31. package/dist/src/molecules/date-picker.d.ts.map +1 -1
  32. package/dist/src/molecules/dialog.d.ts +11 -2
  33. package/dist/src/molecules/dialog.d.ts.map +1 -1
  34. package/dist/src/molecules/drawer.d.ts.map +1 -1
  35. package/dist/src/molecules/product-card.d.ts +109 -4
  36. package/dist/src/molecules/product-card.d.ts.map +1 -1
  37. package/dist/src/molecules/switch.d.ts.map +1 -1
  38. package/dist/src/molecules/toast.d.ts +14 -2
  39. package/dist/src/molecules/toast.d.ts.map +1 -1
  40. package/dist/src/organisms/data-table.d.ts +5 -1
  41. package/dist/src/organisms/data-table.d.ts.map +1 -1
  42. package/dist/src/organisms/data-table.fields.d.ts.map +1 -1
  43. package/dist/src/templates/numeric-input.d.ts +1 -1
  44. package/dist/src/templates/product-card.d.ts +1 -1
  45. package/package.json +1 -1
  46. package/src/tokens/_business-atoms.css +0 -7
  47. package/src/tokens/_scheme-scopes.css +73 -23
  48. package/src/tokens/components/atoms/_button.css +10 -0
  49. package/src/tokens/components/atoms/_input.css +1 -1
  50. package/src/tokens/components/atoms/_numeric-input.css +10 -0
  51. package/src/tokens/components/molecules/_chart.css +24 -6
  52. package/src/tokens/components/molecules/_product-card.css +21 -0
  53. package/src/tokens/figma/akros/variables.css +10 -1
  54. package/src/tokens/figma/brand-overrides.css +9 -0
  55. package/src/tokens/figma/business/variables.css +10 -1
  56. package/src/tokens/figma/dark/variables.css +10 -1
  57. package/src/tokens/figma/light/variables.css +20 -10
  58. package/src/tokens/figma/n1/variables.css +10 -1
  59. package/src/tokens/figma/variables.css +19 -9
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Fragment as external_react_Fragment, createContext, createElement, useContext, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
4
- import { connect } from "@zag-js/date-input";
5
- import { connect as date_picker_connect, machine } from "@zag-js/date-picker";
4
+ import { connect, machine } from "@zag-js/date-input";
5
+ import { connect as date_picker_connect, machine as date_picker_machine } from "@zag-js/date-picker";
6
6
  import { mergeProps, normalizeProps, useMachine } from "@zag-js/react";
7
7
  import { Button } from "../atoms/button.js";
8
8
  import { Input } from "../atoms/input.js";
@@ -16,6 +16,52 @@ import { subscribeOwnerFormReset } from "../internal/form-control-lifecycle.js";
16
16
  import { OverlayPortal, restoreFocusAfterOverlayClose } from "../internal/overlay-portal.js";
17
17
  import { useEffectiveDisabled } from "../internal/use-effective-disabled.js";
18
18
  import { tv } from "../utils.js";
19
+ const DATE_PICKER_ENGLISH_SEGMENT_LABELS = {
20
+ era: "Era",
21
+ year: "Year",
22
+ month: "Month",
23
+ day: "Day",
24
+ hour: "Hour",
25
+ minute: "Minute",
26
+ second: "Second",
27
+ dayPeriod: "AM/PM",
28
+ timeZoneName: "Time zone"
29
+ };
30
+ function formatDatePickerSegmentAnnouncement(segment, options) {
31
+ const name = options.segmentLabels?.[segment.type] ?? DATE_PICKER_ENGLISH_SEGMENT_LABELS[segment.type] ?? segment.type;
32
+ const valueText = segment.isPlaceholder ? options.emptySegmentLabel ?? "Empty" : segment.text;
33
+ return `${name}, ${valueText}`;
34
+ }
35
+ const announceLocalizedSegment = (params)=>{
36
+ const { computed, context, prop, refs } = params;
37
+ const readLocalizedProp = prop;
38
+ const segmentLabels = readLocalizedProp("segmentLabels");
39
+ const emptySegmentLabel = readLocalizedProp("emptySegmentLabel");
40
+ if (!(segmentLabels || emptySegmentLabel)) return void machine.implementations?.actions?.announceSegmentValue?.(params);
41
+ const announcer = refs.get("announcer");
42
+ if (!announcer) return;
43
+ const index = context.get("activeIndex");
44
+ const segmentIndexToUse = refs.get("segmentToAnnounceIndex") ?? context.get("activeSegmentIndex");
45
+ refs.set("segmentToAnnounceIndex", null);
46
+ const allSegments = computed("segments");
47
+ const groupOffset = allSegments.slice(0, index).reduce((total, group)=>total + group.length, 0);
48
+ const segment = allSegments[index]?.[segmentIndexToUse - groupOffset];
49
+ if (!segment || "literal" === segment.type) return;
50
+ announcer.announce(formatDatePickerSegmentAnnouncement(segment, {
51
+ emptySegmentLabel,
52
+ segmentLabels
53
+ }));
54
+ };
55
+ const localizedDateInputMachine = {
56
+ ...datePickerInputMachine,
57
+ implementations: {
58
+ ...datePickerInputMachine.implementations,
59
+ actions: {
60
+ ...datePickerInputMachine.implementations?.actions,
61
+ announceSegmentValue: announceLocalizedSegment
62
+ }
63
+ }
64
+ };
19
65
  const DATE_PICKER_ASCII_DIGIT = /[0-9]/;
20
66
  const DEFAULT_DATE_PICKER_MONTHS = {
21
67
  single: 1,
@@ -343,7 +389,8 @@ function useDatePickerEnvironment(explicitDisabled, explicitDir, ref) {
343
389
  function DatePicker({ children, className, defaultOpen = false, defaultValue, disabled: explicitDisabled, dir: explicitDir, endName, flip = true, form, granularity = "day", gutter = 8, hideTimeZone = false, hourCycle, id, invalid, isDateUnavailable, isTimeUnavailable, locale = "en-US", max: maximum, min: minimum, name, numOfMonths, offset = {
344
390
  mainAxis: 8,
345
391
  crossAxis: 0
346
- }, onOpenChange, onValueChange, open, overflowPadding = 8, placement = "bottom-start", readOnly, ref, required, sameWidth = false, selectionMode = "single", shouldForceLeadingZeros = false, size = "md", slide = true, startOfWeek, startName, timeZone = "UTC", value, ...htmlProps }) {
392
+ }, onOpenChange, onValueChange, open, overflowPadding = 8, placement = "bottom-start", readOnly, ref, required, sameWidth = false, selectionMode = "single", shouldForceLeadingZeros = false, size = "md", slide = true, startOfWeek, startName, timeZone = "UTC", translations, value, ...htmlProps }) {
393
+ const { emptySegment, segmentLabels, ...pickerTranslations } = translations ?? {};
347
394
  const generatedId = useId();
348
395
  const uniqueId = id ?? generatedId;
349
396
  const { rootElementRef, disabledProbeRef, rootRef, disabled, dir } = useDatePickerEnvironment(explicitDisabled, explicitDir, ref);
@@ -497,7 +544,7 @@ function DatePicker({ children, className, defaultOpen = false, defaultValue, di
497
544
  const pickerValues = usesPopupDraft && resolvedOpen ? toDateValues(draftValue) : acceptedValues;
498
545
  const dateInputValues = "range" !== selectionMode || isTimedRangePopupOpen ? segmentInputDraft ?? acceptedValues : rangeInputDraft ?? acceptedValues;
499
546
  const resolvedNumOfMonths = numOfMonths ?? DEFAULT_DATE_PICKER_MONTHS[selectionMode];
500
- const pickerService = useMachine(machine, {
547
+ const pickerService = useMachine(date_picker_machine, {
501
548
  closeOnSelect: !isTimed,
502
549
  dir,
503
550
  disabled,
@@ -551,10 +598,16 @@ function DatePicker({ children, className, defaultOpen = false, defaultValue, di
551
598
  selectionMode,
552
599
  startOfWeek,
553
600
  timeZone,
601
+ translations: pickerTranslations,
554
602
  value: pickerValues
555
603
  });
556
604
  const pickerApi = date_picker_connect(pickerService, normalizeProps);
557
- const dateInputService = useMachine(datePickerInputMachine, {
605
+ const localizedSegmentProps = {
606
+ emptySegmentLabel: emptySegment,
607
+ segmentLabels
608
+ };
609
+ const dateInputService = useMachine(localizedDateInputMachine, {
610
+ ...localizedSegmentProps,
558
611
  disabled,
559
612
  dir,
560
613
  granularity,
@@ -713,6 +766,7 @@ function DatePicker({ children, className, defaultOpen = false, defaultValue, di
713
766
  pickerApi,
714
767
  requestOpen,
715
768
  required: Boolean(required),
769
+ segmentLabels,
716
770
  selectionMode,
717
771
  setDraftTimePart: (part, nextValue, index = 0)=>{
718
772
  if (!interactionBlocked && "day" !== granularity) dispatch({
@@ -804,7 +858,7 @@ function DatePickerFormValue({ disabled, form, names, values }) {
804
858
  }
805
859
  DatePicker.Label = function({ children, className, ref, ...props }) {
806
860
  const { dateInputApi, pickerApi, required, size, styles } = useDatePickerContext();
807
- const labelProps = mergeProps({
861
+ const { htmlFor: _unrenderedInputId, ...labelProps } = mergeProps({
808
862
  ...props,
809
863
  ref
810
864
  }, pickerApi.getLabelProps(), dateInputApi.getLabelProps());
@@ -858,7 +912,7 @@ DatePicker.Control = function({ children, className, ref, ...props }) {
858
912
  });
859
913
  };
860
914
  DatePicker.Segments = function({ className, endLabel = "End", ref, separator = "–", startLabel = "Start", ...props }) {
861
- const { dateInputApi, locale, sendSegmentInput, prepareSegmentDeletion, validationMessage, validationMessageId, required, selectionMode, styles, descriptions, errorDescriptions } = useDatePickerContext();
915
+ const { dateInputApi, locale, sendSegmentInput, prepareSegmentDeletion, validationMessage, validationMessageId, required, segmentLabels, selectionMode, styles, descriptions, errorDescriptions } = useDatePickerContext();
862
916
  const startDescriptorId = useId();
863
917
  const endDescriptorId = useId();
864
918
  const renderSegments = (index)=>dateInputApi.getSegments({
@@ -880,6 +934,9 @@ DatePicker.Segments = function({ className, endLabel = "End", ref, separator = "
880
934
  index,
881
935
  segment
882
936
  }),
937
+ ...segmentLabels?.[segment.type] ? {
938
+ "aria-label": segmentLabels[segment.type]
939
+ } : {},
883
940
  "aria-describedby": joinDescribedBy(props["aria-describedby"], descriptions.describedById, validationMessage ? validationMessageId : void 0),
884
941
  "aria-errormessage": hasError ? errorIds : void 0,
885
942
  "aria-invalid": hasError || void 0,
@@ -1035,6 +1092,7 @@ DatePicker.Trigger = function({ children, className, icon, iconSize = "current",
1035
1092
  if (pickerApi.readOnly) return null;
1036
1093
  return /*#__PURE__*/ jsx(Button, {
1037
1094
  ...triggerProps,
1095
+ "aria-controls": pickerApi.open ? triggerProps["aria-controls"] : void 0,
1038
1096
  "aria-invalid": dateInputApi.invalid || void 0,
1039
1097
  className: styles.trigger({
1040
1098
  className
@@ -1823,4 +1881,4 @@ DatePicker.StatusText = function({ id: providedId, status, size: sizeProp, ...pr
1823
1881
  };
1824
1882
  DatePicker.Root = DatePicker;
1825
1883
  DatePicker.displayName = "DatePicker";
1826
- export { DatePicker };
1884
+ export { DatePicker, formatDatePickerSegmentAnnouncement };
@@ -6,6 +6,7 @@ import { useId, useState } from "react";
6
6
  import { tv } from "tailwind-variants";
7
7
  import { ActionIcon } from "../atoms/action-icon.js";
8
8
  import { Button } from "../atoms/button.js";
9
+ import { useComposedRefs } from "../internal/molecules/drawer.context.js";
9
10
  import { OverlayContainerProvider } from "../internal/overlay-portal.js";
10
11
  const dialogVariants = tv({
11
12
  slots: {
@@ -88,7 +89,8 @@ const dialogVariants = tv({
88
89
  },
89
90
  behavior: {
90
91
  modal: {
91
- backdrop: "bg-dialog-backdrop-bg-modal"
92
+ backdrop: "bg-dialog-backdrop-bg-modal",
93
+ positioner: "pointer-events-auto"
92
94
  },
93
95
  modeless: {
94
96
  backdrop: "pointer-events-none bg-transparent",
@@ -246,11 +248,12 @@ const dialogVariants = tv({
246
248
  position: "fixed"
247
249
  }
248
250
  });
249
- function Dialog({ "aria-label": ariaLabel, id, open, onOpenChange, initialFocusEl, finalFocusEl, role = "dialog", placement = "center", position = "fixed", size = "md", behavior = "modal", closeOnEscape = true, closeOnInteractOutside = true, preventScroll, trapFocus, customTrigger = false, triggerText = "Open", title, description, children, hideCloseButton = false, actions, className, modal, portal = true }) {
251
+ function Dialog({ "aria-label": ariaLabel, id, open, onOpenChange, initialFocusEl, finalFocusEl, role = "dialog", placement = "center", position = "fixed", size = "md", behavior = "modal", closeOnEscape = true, closeOnInteractOutside = true, preventScroll, trapFocus, customTrigger = false, triggerText = "Open", title, description, children, hideCloseButton = false, closeLabel = "Close dialog", actions, className, contentRef, contentStyle, modal, portal = true }) {
250
252
  const generatedId = useId();
251
253
  const uniqueId = id || generatedId;
252
254
  const isModal = modal ?? "modeless" !== behavior;
253
255
  const [contentElement, setContentElement] = useState(null);
256
+ const setContentNode = useComposedRefs(setContentElement, contentRef);
254
257
  const service = useMachine(machine, {
255
258
  id: uniqueId,
256
259
  onOpenChange,
@@ -288,7 +291,11 @@ function Dialog({ "aria-label": ariaLabel, id, open, onOpenChange, initialFocusE
288
291
  className
289
292
  }),
290
293
  ...api.getContentProps(),
291
- ref: setContentElement,
294
+ ref: setContentNode,
295
+ style: {
296
+ ...api.getContentProps().style,
297
+ ...contentStyle
298
+ },
292
299
  children: /*#__PURE__*/ jsxs(OverlayContainerProvider, {
293
300
  container: isModal ? contentElement : null,
294
301
  children: [
@@ -298,7 +305,7 @@ function Dialog({ "aria-label": ariaLabel, id, open, onOpenChange, initialFocusE
298
305
  size: "md",
299
306
  tone: "neutral",
300
307
  ...api.getCloseTriggerProps(),
301
- "aria-label": "Close dialog"
308
+ "aria-label": closeLabel
302
309
  }),
303
310
  /*#__PURE__*/ jsxs("div", {
304
311
  className: scrollViewport(),
@@ -41,7 +41,11 @@ function drawer_useDrawer(props = {}) {
41
41
  previousOpen.current = api.open;
42
42
  });
43
43
  useEffect(()=>()=>cancelRestore.current?.(), []);
44
- return api;
44
+ const apiWithModal = {
45
+ ...api,
46
+ modal: props.modal ?? true
47
+ };
48
+ return apiWithModal;
45
49
  }
46
50
  const swipeDirectionByPlacement = {
47
51
  bottom: "down",
@@ -100,6 +104,7 @@ Drawer.Portal = function(props) {
100
104
  };
101
105
  Drawer.Backdrop = function({ className, ref, ...props }) {
102
106
  const { api, presenceOptions, styles } = useDrawerContext();
107
+ const modal = api.modal ?? true;
103
108
  const presence = useDrawerPresence({
104
109
  ...presenceOptions,
105
110
  present: api.open
@@ -110,7 +115,10 @@ Drawer.Backdrop = function({ className, ref, ...props }) {
110
115
  return /*#__PURE__*/ jsx("div", {
111
116
  ...mergedProps,
112
117
  className: styles.backdrop({
113
- className
118
+ className: [
119
+ modal && "pointer-events-auto",
120
+ className
121
+ ]
114
122
  }),
115
123
  ref: composedRef
116
124
  });
@@ -8,14 +8,12 @@ import { tv } from "../utils.js";
8
8
  const productCardVariants = tv({
9
9
  slots: {
10
10
  root: [
11
- "rounded-product-card p-product-card-padding",
12
- "border-(length:--border-product-card-width) max-w-product-card-max border-product-card-border bg-product-card-bg shadow-sm"
11
+ "max-w-product-card-max border-product-card-border"
13
12
  ],
14
- imageSlot: "w-full rounded-product-card-image object-cover",
15
- nameSlot: "product-card-name line-clamp-product-card-name min-h-product-card-name font-product-card-name text-product-card-name-fg text-product-card-name-size",
13
+ imageSlot: "w-full",
14
+ nameSlot: "product-card-name line-clamp-product-card-name min-h-product-card-name text-product-card-name-fg",
16
15
  priceSlot: "mt-auto font-product-card-price text-product-card-price-fg text-product-card-price-size",
17
16
  stockStatusSlot: [
18
- "font-product-card-stock text-product-card-stock-size",
19
17
  "data-[stock=in-stock]:text-product-card-stock-fg-in-stock",
20
18
  "data-[stock=limited-stock]:text-product-card-stock-fg-limited-stock",
21
19
  "data-[stock=out-of-stock]:text-product-card-stock-fg-out-of-stock"
@@ -26,6 +24,39 @@ const productCardVariants = tv({
26
24
  button: ""
27
25
  },
28
26
  variants: {
27
+ presentation: {
28
+ default: {
29
+ root: "border-(length:--border-product-card-width) rounded-product-card bg-product-card-bg p-product-card-padding",
30
+ imageSlot: "rounded-product-card-image",
31
+ nameSlot: "font-product-card-name text-product-card-name-size",
32
+ stockStatusSlot: "font-product-card-stock text-product-card-stock-size"
33
+ },
34
+ featured: {
35
+ root: "border-(length:--border-product-card-featured-width) rounded-product-card-featured bg-product-card-featured-bg p-product-card-featured-padding",
36
+ imageSlot: "rounded-product-card-featured-image",
37
+ nameSlot: "font-product-card-featured-name text-product-card-featured-name-size",
38
+ stockStatusSlot: "font-product-card-featured-stock text-product-card-featured-stock-size"
39
+ }
40
+ },
41
+ shadow: {
42
+ true: {
43
+ root: "shadow-sm"
44
+ },
45
+ false: {
46
+ root: "shadow-none"
47
+ }
48
+ },
49
+ objectFit: {
50
+ cover: {
51
+ imageSlot: "object-cover"
52
+ },
53
+ contain: {
54
+ imageSlot: "object-contain"
55
+ },
56
+ fill: {
57
+ imageSlot: "object-fill"
58
+ }
59
+ },
29
60
  buttonVariant: {
30
61
  cart: {
31
62
  button: "w-max bg-product-card-button-cart-bg-base text-product-card-button-cart-fg hover:bg-product-card-button-cart-bg-hover active:bg-product-card-button-cart-bg-active active:text-product-card-button-cart-fg"
@@ -41,7 +72,7 @@ const productCardVariants = tv({
41
72
  layout: {
42
73
  column: {
43
74
  root: [
44
- "flex h-full flex-col gap-product-card-col-layout"
75
+ "flex h-full flex-col"
45
76
  ],
46
77
  imageSlot: "aspect-product-card-image"
47
78
  },
@@ -51,18 +82,40 @@ const productCardVariants = tv({
51
82
  }
52
83
  }
53
84
  },
85
+ compoundVariants: [
86
+ {
87
+ presentation: "default",
88
+ layout: "column",
89
+ className: {
90
+ root: "gap-product-card-col-layout"
91
+ }
92
+ },
93
+ {
94
+ presentation: "featured",
95
+ layout: "column",
96
+ className: {
97
+ root: "gap-product-card-featured-col-layout"
98
+ }
99
+ }
100
+ ],
54
101
  defaultVariants: {
102
+ presentation: "default",
103
+ shadow: true,
104
+ objectFit: "cover",
55
105
  layout: "column",
56
106
  buttonVariant: "cart"
57
107
  }
58
108
  });
59
109
  const ProductCardContext = /*#__PURE__*/ createContext({});
60
- function ProductCard({ children, layout = "column", className, ref, ...props }) {
110
+ function ProductCard({ children, layout = "column", presentation = "default", shadow = true, className, ref, ...props }) {
61
111
  const { root } = productCardVariants({
112
+ shadow,
113
+ presentation,
62
114
  layout
63
115
  });
64
116
  return /*#__PURE__*/ jsx(ProductCardContext.Provider, {
65
117
  value: {
118
+ presentation,
66
119
  layout
67
120
  },
68
121
  children: /*#__PURE__*/ jsx("div", {
@@ -76,9 +129,11 @@ function ProductCard({ children, layout = "column", className, ref, ...props })
76
129
  })
77
130
  });
78
131
  }
79
- ProductCard.Image = function({ as, className, ref, ...props }) {
132
+ ProductCard.Image = function({ as, objectFit = "cover", className, ref, ...props }) {
80
133
  const context = useContext(ProductCardContext);
81
134
  const { imageSlot } = productCardVariants({
135
+ objectFit,
136
+ presentation: context.presentation,
82
137
  layout: context.layout
83
138
  });
84
139
  const Media = ImageWithFallback;
@@ -94,6 +149,7 @@ ProductCard.Image = function({ as, className, ref, ...props }) {
94
149
  ProductCard.Name = function({ as: Heading = "h3", children, className, ref, ...props }) {
95
150
  const context = useContext(ProductCardContext);
96
151
  const { nameSlot } = productCardVariants({
152
+ presentation: context.presentation,
97
153
  layout: context.layout
98
154
  });
99
155
  return /*#__PURE__*/ jsx(Heading, {
@@ -122,6 +178,7 @@ ProductCard.Price = function({ children, className, ref, ...props }) {
122
178
  ProductCard.Stock = function({ children, className, ref, status = "in-stock", ...props }) {
123
179
  const context = useContext(ProductCardContext);
124
180
  const { stockStatusSlot } = productCardVariants({
181
+ presentation: context.presentation,
125
182
  layout: context.layout
126
183
  });
127
184
  return /*#__PURE__*/ jsx("p", {
@@ -116,6 +116,7 @@ function Switch({ ref, inputProps: nativeInputProps = {}, "aria-label": ariaLabe
116
116
  });
117
117
  const api = connect(service, normalizeProps);
118
118
  const inputProps = getControlledChoiceInputProps(mergeChoiceInputProps(nativeInputProps, api.getHiddenInputProps()), api.checked);
119
+ const inputAriaLabel = nativeInputProps["aria-label"] ?? (children ? void 0 : ariaLabel);
119
120
  const inputRef = useChoiceInputRef(ref);
120
121
  const { root, control, thumb, label, hiddenInput } = switchVariants({
121
122
  size
@@ -135,8 +136,8 @@ function Switch({ ref, inputProps: nativeInputProps = {}, "aria-label": ariaLabe
135
136
  "aria-describedby": joinDescribedBy(ariaDescribedBy, nativeInputProps["aria-describedby"], helpText ? helpTextId : void 0),
136
137
  "aria-errormessage": invalid && helpText ? helpTextId : void 0,
137
138
  "aria-invalid": invalid || void 0,
138
- "aria-label": nativeInputProps["aria-label"] ?? ariaLabel,
139
- "aria-labelledby": nativeInputProps["aria-labelledby"] ?? ariaLabelledBy ?? ((nativeInputProps["aria-label"] ?? ariaLabel) || !children ? void 0 : inputProps["aria-labelledby"]),
139
+ "aria-label": inputAriaLabel,
140
+ "aria-labelledby": nativeInputProps["aria-labelledby"] ?? ariaLabelledBy ?? (inputAriaLabel || !children ? void 0 : inputProps["aria-labelledby"]),
140
141
  "aria-readonly": readOnly && !disabled || void 0,
141
142
  className: hiddenInput({
142
143
  className: nativeInputProps.className
@@ -51,7 +51,7 @@ const toastVariants = tv({
51
51
  ]
52
52
  }
53
53
  });
54
- function Toast({ actor, index, parent, placement }) {
54
+ function Toast({ actor, index, parent, placement, closeLabel = "Close notification", loadingLabel = "loading..." }) {
55
55
  const composedProps = {
56
56
  ...actor,
57
57
  index,
@@ -89,7 +89,7 @@ function Toast({ actor, index, parent, placement }) {
89
89
  className: title(),
90
90
  ...api.getTitleProps(),
91
91
  "data-type": api.type,
92
- children: api.title
92
+ children: "loading" === api.type ? api.title ?? loadingLabel : api.title
93
93
  }),
94
94
  api.closable && /*#__PURE__*/ jsx(ActionIcon, {
95
95
  className: closeButton(),
@@ -97,7 +97,7 @@ function Toast({ actor, index, parent, placement }) {
97
97
  size: "sm",
98
98
  tone: "neutral",
99
99
  ...api.getCloseTriggerProps(),
100
- "aria-label": "Close notification"
100
+ "aria-label": closeLabel
101
101
  })
102
102
  ]
103
103
  }),
@@ -174,7 +174,7 @@ const scopedGroupMachine = {
174
174
  }
175
175
  }
176
176
  };
177
- function Toaster({ store = toaster } = {}) {
177
+ function Toaster({ store = toaster, closeLabel, label, loadingLabel } = {}) {
178
178
  const groupId = useId();
179
179
  const modalContainer = useActiveModalContainer();
180
180
  const [portalHost, setPortalHost] = useState(null);
@@ -202,15 +202,22 @@ function Toaster({ store = toaster } = {}) {
202
202
  store
203
203
  });
204
204
  const api = __rspack_external__zag_js_toast_856c971b.group.connect(service, normalizeProps);
205
+ const groupProps = api.getGroupProps();
206
+ const regionProps = {
207
+ ...groupProps,
208
+ "aria-label": label ?? groupProps["aria-label"]
209
+ };
205
210
  const { group } = toastVariants();
206
211
  if (!portalHost) return null;
207
212
  return /*#__PURE__*/ createPortal(/*#__PURE__*/ jsx("div", {
208
213
  className: group(),
209
- ...api.getGroupProps(),
214
+ ...regionProps,
210
215
  id: `toast-group:${groupId}`,
211
216
  children: api.getToasts().map((notification, index)=>/*#__PURE__*/ jsx(Toast, {
212
217
  actor: notification,
218
+ closeLabel: closeLabel,
213
219
  index: index,
220
+ loadingLabel: loadingLabel,
214
221
  parent: service
215
222
  }, notification.id))
216
223
  }), portalHost);
@@ -144,6 +144,7 @@ function FieldSelect({ items, value, ariaLabel, placeholder, disabled, readOnly,
144
144
  }) : null,
145
145
  /*#__PURE__*/ jsx(Select.Positioner, {
146
146
  children: /*#__PURE__*/ jsx(Select.Content, {
147
+ "aria-label": ariaLabel,
147
148
  children: items.map((item)=>/*#__PURE__*/ jsxs(Select.Item, {
148
149
  item: item,
149
150
  children: [
@@ -370,6 +370,8 @@ const DEFAULT_TRANSLATIONS = {
370
370
  editingLabel: "Editing a row — other table controls are locked",
371
371
  rangeLabel: ({ start, end, total })=>`${start}–${end} of ${total}`,
372
372
  requiredLabel: "Enter a value before saving this row.",
373
+ selectRowLabel: (rowLabel)=>`Select ${rowLabel}`,
374
+ editRowLabel: (rowLabel)=>`Edit ${rowLabel}`,
373
375
  pageLabel: ({ page, pageCount })=>null == pageCount ? `Page ${page}` : `Page ${page} of ${pageCount}`,
374
376
  previousPageLabel: "Previous page",
375
377
  nextPageLabel: "Next page",
@@ -802,6 +804,7 @@ function DataTable(props) {
802
804
  selectAllLabel: translations.selectAllLabel,
803
805
  selectionLabel: translations.selectionLabel,
804
806
  reorderLabel: translations.reorderLabel,
807
+ selectRowLabel: translations.selectRowLabel,
805
808
  showSelectAll: "multiple" === selectionMode && null == maxSelectedRows
806
809
  }), [
807
810
  userColumns,
@@ -812,6 +815,7 @@ function DataTable(props) {
812
815
  translations.selectAllLabel,
813
816
  translations.selectionLabel,
814
817
  translations.reorderLabel,
818
+ translations.selectRowLabel,
815
819
  selectionMode,
816
820
  maxSelectedRows
817
821
  ]);
@@ -1583,7 +1587,7 @@ function DataTable(props) {
1583
1587
  ]
1584
1588
  });
1585
1589
  return /*#__PURE__*/ jsx(ActionIcon, {
1586
- "aria-label": `Edit ${getRowLabel?.(row) ?? `row ${row.id}`}`,
1590
+ "aria-label": translations.editRowLabel(getRowLabel?.(row) ?? `row ${row.id}`),
1587
1591
  disabled: isEditing || (canEditRow ? !canEditRow(row) : false),
1588
1592
  icon: "icon-[mdi--pencil-outline]",
1589
1593
  id: `${instanceId}-edit-${row.id}`,
@@ -2017,7 +2021,7 @@ function DataTable(props) {
2017
2021
  })
2018
2022
  });
2019
2023
  }
2020
- function buildColumns({ userColumns, enableRowReorder, enableRowSelection, locked, getRowLabel, selectAllLabel, selectionLabel, reorderLabel, showSelectAll }) {
2024
+ function buildColumns({ userColumns, enableRowReorder, enableRowSelection, locked, getRowLabel, selectAllLabel, selectionLabel, reorderLabel, selectRowLabel, showSelectAll }) {
2021
2025
  const leading = [];
2022
2026
  if (enableRowReorder) leading.push({
2023
2027
  id: DRAG_COLUMN_ID,
@@ -2046,7 +2050,7 @@ function buildColumns({ userColumns, enableRowReorder, enableRowSelection, locke
2046
2050
  children: selectionLabel
2047
2051
  }),
2048
2052
  cell: ({ row })=>/*#__PURE__*/ jsx(Checkbox, {
2049
- "aria-label": `Select ${getRowLabel?.(row) ?? `row ${row.id}`}`,
2053
+ "aria-label": selectRowLabel(getRowLabel?.(row) ?? `row ${row.id}`),
2050
2054
  checked: row.getIsSelected(),
2051
2055
  disabled: locked || !row.getCanSelect(),
2052
2056
  indeterminate: row.getIsSomeSelected(),
@@ -2,7 +2,7 @@
2
2
  * Badge — @techsio/ui-kit atom.
3
3
  *
4
4
  * @component Badge
5
- * @componentVersion v1.1.1
5
+ * @componentVersion v1.1.2
6
6
  * @skill badge-usage
7
7
  * @changelog libs/ui/stories/changelog/changelog.stories.tsx
8
8
  *
@@ -2,7 +2,7 @@
2
2
  * Button — @techsio/ui-kit atom.
3
3
  *
4
4
  * @component Button
5
- * @componentVersion v0.6.3
5
+ * @componentVersion v0.6.5
6
6
  * @skill button-usage
7
7
  * @changelog libs/ui/stories/changelog/changelog.stories.tsx
8
8
  *
@@ -17,6 +17,10 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
17
17
  true: "";
18
18
  false: string[];
19
19
  };
20
+ density: {
21
+ default: "";
22
+ compact: "";
23
+ };
20
24
  variant: {
21
25
  primary: "";
22
26
  secondary: "";
@@ -35,9 +39,9 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
35
39
  true: "uppercase";
36
40
  };
37
41
  size: {
38
- sm: "button-size-sm min-w-0 gap-button-sm rounded-button-sm p-button-sm text-button-sm";
39
- md: "button-size-md min-w-0 gap-button-md rounded-button-md p-button-md text-button-md";
40
- lg: "button-size-lg min-w-0 gap-button-lg rounded-button-lg p-button-lg text-button-lg";
42
+ sm: "min-w-0 gap-button-sm rounded-button-sm text-button-sm";
43
+ md: "min-w-0 gap-button-md rounded-button-md text-button-md";
44
+ lg: "min-w-0 gap-button-lg rounded-button-lg text-button-lg";
41
45
  current: "button-current-size gap-button-md";
42
46
  };
43
47
  block: {
@@ -48,6 +52,10 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
48
52
  true: "";
49
53
  false: string[];
50
54
  };
55
+ density: {
56
+ default: "";
57
+ compact: "";
58
+ };
51
59
  variant: {
52
60
  primary: "";
53
61
  secondary: "";
@@ -66,9 +74,9 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
66
74
  true: "uppercase";
67
75
  };
68
76
  size: {
69
- sm: "button-size-sm min-w-0 gap-button-sm rounded-button-sm p-button-sm text-button-sm";
70
- md: "button-size-md min-w-0 gap-button-md rounded-button-md p-button-md text-button-md";
71
- lg: "button-size-lg min-w-0 gap-button-lg rounded-button-lg p-button-lg text-button-lg";
77
+ sm: "min-w-0 gap-button-sm rounded-button-sm text-button-sm";
78
+ md: "min-w-0 gap-button-md rounded-button-md text-button-md";
79
+ lg: "min-w-0 gap-button-lg rounded-button-lg text-button-lg";
72
80
  current: "button-current-size gap-button-md";
73
81
  };
74
82
  block: {
@@ -79,6 +87,10 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
79
87
  true: "";
80
88
  false: string[];
81
89
  };
90
+ density: {
91
+ default: "";
92
+ compact: "";
93
+ };
82
94
  variant: {
83
95
  primary: "";
84
96
  secondary: "";
@@ -97,9 +109,9 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
97
109
  true: "uppercase";
98
110
  };
99
111
  size: {
100
- sm: "button-size-sm min-w-0 gap-button-sm rounded-button-sm p-button-sm text-button-sm";
101
- md: "button-size-md min-w-0 gap-button-md rounded-button-md p-button-md text-button-md";
102
- lg: "button-size-lg min-w-0 gap-button-lg rounded-button-lg p-button-lg text-button-lg";
112
+ sm: "min-w-0 gap-button-sm rounded-button-sm text-button-sm";
113
+ md: "min-w-0 gap-button-md rounded-button-md text-button-md";
114
+ lg: "min-w-0 gap-button-lg rounded-button-lg text-button-lg";
103
115
  current: "button-current-size gap-button-md";
104
116
  };
105
117
  block: {
@@ -116,5 +128,5 @@ export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "childre
116
128
  children?: ReactNode;
117
129
  ref?: Ref<HTMLButtonElement>;
118
130
  };
119
- export declare function Button({ variant, theme, size, block, isLoading, loadingText, icon, iconPosition, iconSize, uppercase, children, className, disabled, composition, ref, onClick, type, ...props }: ButtonProps): import("react").JSX.Element;
131
+ export declare function Button({ density, variant, theme, size, block, isLoading, loadingText, icon, iconPosition, iconSize, uppercase, children, className, disabled, composition, ref, onClick, type, ...props }: ButtonProps): import("react").JSX.Element;
120
132
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/atoms/button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,GAAG,EAIT,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAE5C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwPzB,CAAA;AAeF,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,CACX,GACC,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC/B,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,CAAA;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAC7B,CAAA;AAEH,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,KAAK,EACL,IAAI,EACJ,KAAK,EACL,SAAS,EACT,WAAW,EACX,IAAI,EACJ,YAAqB,EACrB,QAAQ,EACR,SAAiB,EACjB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,WAAW,EACX,GAAG,EACH,OAAO,EACP,IAAe,EACf,GAAG,KAAK,EACT,EAAE,WAAW,+BAqFb"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/atoms/button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,GAAG,EAIT,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAE5C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkRzB,CAAA;AAeF,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,CACX,GACC,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC/B,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,CAAA;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAC7B,CAAA;AAEH,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,OAAO,EACP,KAAK,EACL,IAAI,EACJ,KAAK,EACL,SAAS,EACT,WAAW,EACX,IAAI,EACJ,YAAqB,EACrB,QAAQ,EACR,SAAiB,EACjB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,WAAW,EACX,GAAG,EACH,OAAO,EACP,IAAe,EACf,GAAG,KAAK,EACT,EAAE,WAAW,+BAsFb"}