@vygruppen/spor-react 12.8.3 → 12.8.6

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@12.8.3 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.8.6 build /home/runner/work/spor/spor/packages/spor-react
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.tsx, src/icons/index.tsx
@@ -11,18 +11,18 @@ CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
13
  DTS Build start
14
- CJS dist/index.cjs 313.52 KB
15
- CJS dist/icons/index.cjs 381.00 B
16
- CJS dist/icons/index.cjs.map 157.00 B
17
- CJS dist/index.cjs.map 627.10 KB
18
- CJS ⚡️ Build success in 3142ms
19
- ESM dist/index.mjs 292.69 KB
14
+ ESM dist/index.mjs 293.20 KB
20
15
  ESM dist/icons/index.mjs 110.00 B
21
- ESM dist/index.mjs.map 627.10 KB
22
16
  ESM dist/icons/index.mjs.map 157.00 B
23
- ESM ⚡️ Build success in 3146ms
24
- DTS ⚡️ Build success in 30320ms
17
+ ESM dist/index.mjs.map 628.09 KB
18
+ ESM ⚡️ Build success in 3384ms
19
+ CJS dist/index.cjs 314.03 KB
20
+ CJS dist/icons/index.cjs 381.00 B
21
+ CJS dist/icons/index.cjs.map 157.00 B
22
+ CJS dist/index.cjs.map 628.09 KB
23
+ CJS ⚡️ Build success in 3385ms
24
+ DTS ⚡️ Build success in 30082ms
25
25
  DTS dist/icons/index.d.ts 44.00 B
26
- DTS dist/index.d.ts 156.38 KB
26
+ DTS dist/index.d.ts 156.34 KB
27
27
  DTS dist/icons/index.d.cts 44.00 B
28
- DTS dist/index.d.cts 156.38 KB
28
+ DTS dist/index.d.cts 156.34 KB
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@12.8.3 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.8.6 postinstall /home/runner/work/spor/spor/packages/spor-react
3
3
  > chakra typegen src/theme/index.ts
4
4
 
5
5
  ┌ Chakra CLI ⚡️
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 12.8.6
4
+
5
+ ### Patch Changes
6
+
7
+ - fb78407: Fix accessibility issues in DatePicker and TimePicker.
8
+
9
+ ## 12.8.5
10
+
11
+ ### Patch Changes
12
+
13
+ - e8d7d4d: Fix: Combobox, make sure combobox-props do not get spread to input.
14
+
15
+ ## 12.8.4
16
+
17
+ ### Patch Changes
18
+
19
+ - 736a159: Fix Broken ARIA reference in combobox.
20
+
3
21
  ## 12.8.3
4
22
 
5
23
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1725,7 +1725,7 @@ var texts8 = createTexts({
1725
1725
  en: "Calendar"
1726
1726
  }
1727
1727
  });
1728
- var CalendarTriggerButton = React27.forwardRef(({ variant, disabled, ariaLabelledby, ...buttonProps }, ref) => {
1728
+ var CalendarTriggerButton = React27.forwardRef(({ variant, disabled, onPress: _, ...buttonProps }, ref) => {
1729
1729
  const { t } = useTranslation();
1730
1730
  const recipe = react.useSlotRecipe({
1731
1731
  key: "datePicker"
@@ -1738,8 +1738,7 @@ var CalendarTriggerButton = React27.forwardRef(({ variant, disabled, ariaLabelle
1738
1738
  "aria-label": t(texts9.openCalendar),
1739
1739
  css: styles.calendarTriggerButton,
1740
1740
  variant: "ghost",
1741
- disabled,
1742
- "aria-labelledby": ariaLabelledby
1741
+ disabled
1743
1742
  }
1744
1743
  ) });
1745
1744
  });
@@ -1802,7 +1801,7 @@ function createCalendar2(identifier) {
1802
1801
  }
1803
1802
  }
1804
1803
  var DateField = React27.forwardRef(
1805
- ({ labelId, ...props }, externalRef) => {
1804
+ (props, externalRef) => {
1806
1805
  var _a5;
1807
1806
  const locale = useCurrentLocale();
1808
1807
  const recipe = react.useSlotRecipe({
@@ -1826,12 +1825,11 @@ var DateField = React27.forwardRef(
1826
1825
  props.label && /* @__PURE__ */ jsxRuntime.jsx(
1827
1826
  react.Box,
1828
1827
  {
1829
- as: "label",
1828
+ asChild: true,
1830
1829
  css: styles.inputLabel,
1831
1830
  position: "absolute",
1832
1831
  paddingTop: "2px",
1833
- id: labelId,
1834
- children: props.label
1832
+ children: /* @__PURE__ */ jsxRuntime.jsx("label", { ...props.labelProps, children: props.label })
1835
1833
  }
1836
1834
  ),
1837
1835
  /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { ...fieldProps, ref, paddingTop: "3", paddingBottom: "0.5", children: state.segments.map((segment, i) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -1839,7 +1837,6 @@ var DateField = React27.forwardRef(
1839
1837
  {
1840
1838
  segment,
1841
1839
  ariaDescription: t(getAriaLabel(segment.type)),
1842
- ariaLabel: labelId,
1843
1840
  state
1844
1841
  },
1845
1842
  i
@@ -1849,7 +1846,8 @@ var DateField = React27.forwardRef(
1849
1846
  {
1850
1847
  type: "hidden",
1851
1848
  value: ((_a5 = state.value) == null ? void 0 : _a5.toString()) ?? "",
1852
- name: props.name
1849
+ name: props.name,
1850
+ id: props.id
1853
1851
  }
1854
1852
  )
1855
1853
  ] });
@@ -1894,7 +1892,7 @@ var getAriaLabel = (segmentType) => {
1894
1892
  };
1895
1893
  var StyledField = React27.forwardRef(
1896
1894
  function StyledField2(props, ref) {
1897
- const { children, variant, isDisabled, ariaLabelledby, ...otherProps } = props;
1895
+ const { children, variant, isDisabled, ...otherProps } = props;
1898
1896
  const { invalid } = react.useFieldContext() ?? {
1899
1897
  };
1900
1898
  const recipe = react.useSlotRecipe({
@@ -1909,7 +1907,6 @@ var StyledField = React27.forwardRef(
1909
1907
  ref,
1910
1908
  "aria-invalid": invalid,
1911
1909
  "aria-disabled": isDisabled,
1912
- "aria-labelledby": ariaLabelledby,
1913
1910
  children
1914
1911
  }
1915
1912
  );
@@ -1943,7 +1940,6 @@ var DatePicker = React27.forwardRef(
1943
1940
  state,
1944
1941
  ref
1945
1942
  );
1946
- const labelId = `label-${React27.useId()}`;
1947
1943
  const inputGroupId = `input-group-${React27.useId()}`;
1948
1944
  const recipe = react.useSlotRecipe({
1949
1945
  key: "datePicker"
@@ -1974,7 +1970,6 @@ var DatePicker = React27.forwardRef(
1974
1970
  {
1975
1971
  display: "inline-flex",
1976
1972
  id: inputGroupId,
1977
- "aria-labelledby": labelId,
1978
1973
  errorText,
1979
1974
  invalid,
1980
1975
  helperText,
@@ -1986,7 +1981,6 @@ var DatePicker = React27.forwardRef(
1986
1981
  paddingX: 3,
1987
1982
  minHeight,
1988
1983
  isDisabled: props.isDisabled,
1989
- ariaLabelledby: labelId,
1990
1984
  children: [
1991
1985
  /* @__PURE__ */ jsxRuntime.jsx(react.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1992
1986
  CalendarTriggerButton,
@@ -2003,7 +1997,6 @@ var DatePicker = React27.forwardRef(
2003
1997
  {
2004
1998
  label: props.label,
2005
1999
  labelProps,
2006
- labelId,
2007
2000
  name: props.name,
2008
2001
  ...fieldProps
2009
2002
  }
@@ -2177,7 +2170,14 @@ var TimeField = ({ state, ...props }) => {
2177
2170
  children: props.label
2178
2171
  }
2179
2172
  ),
2180
- /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { ...fieldProps, ref, paddingTop: "3", paddingBottom: "0.5", children: state.segments.map((segment) => /* @__PURE__ */ jsxRuntime.jsx(DateTimeSegment, { segment, state }, segment.type)) }),
2173
+ /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { ...fieldProps, ref, paddingTop: "3", paddingBottom: "0.5", children: state.segments.map((segment) => /* @__PURE__ */ jsxRuntime.jsx(
2174
+ DateTimeSegment,
2175
+ {
2176
+ segment,
2177
+ state
2178
+ },
2179
+ JSON.stringify(segment)
2180
+ )) }),
2181
2181
  /* @__PURE__ */ jsxRuntime.jsx(
2182
2182
  "input",
2183
2183
  {
@@ -2616,6 +2616,17 @@ var Combobox = (props) => {
2616
2616
  inputRef: externalInputRef,
2617
2617
  children,
2618
2618
  variant,
2619
+ allowsEmptyCollection,
2620
+ onSelectionChange,
2621
+ inputValue,
2622
+ onInputChange,
2623
+ menuTrigger,
2624
+ allowsCustomValue,
2625
+ onFocusChange,
2626
+ defaultInputValue,
2627
+ defaultItems,
2628
+ defaultSelectedKey,
2629
+ onOpenChange,
2619
2630
  ...restProps
2620
2631
  } = props;
2621
2632
  const { contains } = reactAria.useFilter({ sensitivity: "base" });
@@ -2623,11 +2634,22 @@ var Combobox = (props) => {
2623
2634
  const inputRef = externalInputRef ?? fallbackInputRef;
2624
2635
  const listBoxRef = React27.useRef(null);
2625
2636
  const popoverRef = React27.useRef(null);
2626
- const listboxId = `${React27.useId()}-listbox`;
2637
+ const listboxId = React27.useId();
2627
2638
  const inputWidth = useInputWidth(inputRef);
2628
2639
  const state = reactStately.useComboBoxState({
2629
2640
  defaultFilter: contains,
2630
2641
  shouldCloseOnBlur: true,
2642
+ allowsEmptyCollection,
2643
+ onSelectionChange,
2644
+ inputValue,
2645
+ onInputChange,
2646
+ menuTrigger,
2647
+ allowsCustomValue,
2648
+ onFocusChange,
2649
+ defaultInputValue,
2650
+ defaultItems,
2651
+ defaultSelectedKey,
2652
+ onOpenChange,
2631
2653
  ...props
2632
2654
  });
2633
2655
  const comboBoxProps = {
@@ -2644,22 +2666,29 @@ var Combobox = (props) => {
2644
2666
  paddingTop,
2645
2667
  paddingLeft,
2646
2668
  paddingX,
2647
- paddingY,
2648
- leftIcon
2669
+ paddingY
2649
2670
  };
2650
- const {
2651
- inputProps: { ...inputProps },
2652
- listBoxProps
2653
- } = reactAria.useComboBox(
2671
+ const { inputProps, listBoxProps } = reactAria.useComboBox(
2654
2672
  {
2655
2673
  ...props,
2656
2674
  inputRef,
2657
2675
  listBoxRef,
2658
2676
  popoverRef,
2659
- label
2677
+ label,
2678
+ onSelectionChange,
2679
+ inputValue,
2680
+ onInputChange,
2681
+ menuTrigger,
2682
+ allowsCustomValue,
2683
+ onFocusChange,
2684
+ defaultInputValue,
2685
+ defaultItems,
2686
+ defaultSelectedKey,
2687
+ onOpenChange
2660
2688
  },
2661
2689
  state
2662
2690
  );
2691
+ const { "aria-labelledby": _, id: __, ...filteredInputProps } = inputProps;
2663
2692
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2664
2693
  /* @__PURE__ */ jsxRuntime.jsx(
2665
2694
  Input,
@@ -2682,7 +2711,7 @@ var Combobox = (props) => {
2682
2711
  borderBottomLeftRadius: state.isOpen && !loading ? 0 : borderBottomLeftRadius,
2683
2712
  borderBottomRightRadius: state.isOpen && !loading ? 0 : borderBottomRightRadius,
2684
2713
  _active: { backgroundColor: "core.surface.active" },
2685
- ...inputProps,
2714
+ ...filteredInputProps,
2686
2715
  startElement: leftIcon,
2687
2716
  endElement: loading ? /* @__PURE__ */ jsxRuntime.jsx(
2688
2717
  ColorSpinner,