@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.
package/dist/index.d.cts CHANGED
@@ -1186,7 +1186,6 @@ type ComboboxProps<T> = Exclude<InputProps, "variant" | "colorPalette" | "size">
1186
1186
  leftIcon?: ReactNode;
1187
1187
  rightIcon?: ReactNode;
1188
1188
  variant?: "core" | "floating";
1189
- children?: React__default.ReactNode;
1190
1189
  };
1191
1190
  /**
1192
1191
  * A combobox is a combination of an input and a list of suggestions.
package/dist/index.d.ts CHANGED
@@ -1186,7 +1186,6 @@ type ComboboxProps<T> = Exclude<InputProps, "variant" | "colorPalette" | "size">
1186
1186
  leftIcon?: ReactNode;
1187
1187
  rightIcon?: ReactNode;
1188
1188
  variant?: "core" | "floating";
1189
- children?: React__default.ReactNode;
1190
1189
  };
1191
1190
  /**
1192
1191
  * A combobox is a combination of an input and a list of suggestions.
package/dist/index.mjs CHANGED
@@ -1705,7 +1705,7 @@ var texts8 = createTexts({
1705
1705
  en: "Calendar"
1706
1706
  }
1707
1707
  });
1708
- var CalendarTriggerButton = forwardRef(({ variant, disabled, ariaLabelledby, ...buttonProps }, ref) => {
1708
+ var CalendarTriggerButton = forwardRef(({ variant, disabled, onPress: _, ...buttonProps }, ref) => {
1709
1709
  const { t } = useTranslation();
1710
1710
  const recipe = useSlotRecipe({
1711
1711
  key: "datePicker"
@@ -1718,8 +1718,7 @@ var CalendarTriggerButton = forwardRef(({ variant, disabled, ariaLabelledby, ...
1718
1718
  "aria-label": t(texts9.openCalendar),
1719
1719
  css: styles.calendarTriggerButton,
1720
1720
  variant: "ghost",
1721
- disabled,
1722
- "aria-labelledby": ariaLabelledby
1721
+ disabled
1723
1722
  }
1724
1723
  ) });
1725
1724
  });
@@ -1782,7 +1781,7 @@ function createCalendar2(identifier) {
1782
1781
  }
1783
1782
  }
1784
1783
  var DateField = forwardRef(
1785
- ({ labelId, ...props }, externalRef) => {
1784
+ (props, externalRef) => {
1786
1785
  var _a5;
1787
1786
  const locale = useCurrentLocale();
1788
1787
  const recipe = useSlotRecipe({
@@ -1806,12 +1805,11 @@ var DateField = forwardRef(
1806
1805
  props.label && /* @__PURE__ */ jsx(
1807
1806
  Box,
1808
1807
  {
1809
- as: "label",
1808
+ asChild: true,
1810
1809
  css: styles.inputLabel,
1811
1810
  position: "absolute",
1812
1811
  paddingTop: "2px",
1813
- id: labelId,
1814
- children: props.label
1812
+ children: /* @__PURE__ */ jsx("label", { ...props.labelProps, children: props.label })
1815
1813
  }
1816
1814
  ),
1817
1815
  /* @__PURE__ */ jsx(Flex, { ...fieldProps, ref, paddingTop: "3", paddingBottom: "0.5", children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(
@@ -1819,7 +1817,6 @@ var DateField = forwardRef(
1819
1817
  {
1820
1818
  segment,
1821
1819
  ariaDescription: t(getAriaLabel(segment.type)),
1822
- ariaLabel: labelId,
1823
1820
  state
1824
1821
  },
1825
1822
  i
@@ -1829,7 +1826,8 @@ var DateField = forwardRef(
1829
1826
  {
1830
1827
  type: "hidden",
1831
1828
  value: ((_a5 = state.value) == null ? void 0 : _a5.toString()) ?? "",
1832
- name: props.name
1829
+ name: props.name,
1830
+ id: props.id
1833
1831
  }
1834
1832
  )
1835
1833
  ] });
@@ -1874,7 +1872,7 @@ var getAriaLabel = (segmentType) => {
1874
1872
  };
1875
1873
  var StyledField = forwardRef(
1876
1874
  function StyledField2(props, ref) {
1877
- const { children, variant, isDisabled, ariaLabelledby, ...otherProps } = props;
1875
+ const { children, variant, isDisabled, ...otherProps } = props;
1878
1876
  const { invalid } = useFieldContext() ?? {
1879
1877
  };
1880
1878
  const recipe = useSlotRecipe({
@@ -1889,7 +1887,6 @@ var StyledField = forwardRef(
1889
1887
  ref,
1890
1888
  "aria-invalid": invalid,
1891
1889
  "aria-disabled": isDisabled,
1892
- "aria-labelledby": ariaLabelledby,
1893
1890
  children
1894
1891
  }
1895
1892
  );
@@ -1923,7 +1920,6 @@ var DatePicker = forwardRef(
1923
1920
  state,
1924
1921
  ref
1925
1922
  );
1926
- const labelId = `label-${useId()}`;
1927
1923
  const inputGroupId = `input-group-${useId()}`;
1928
1924
  const recipe = useSlotRecipe({
1929
1925
  key: "datePicker"
@@ -1954,7 +1950,6 @@ var DatePicker = forwardRef(
1954
1950
  {
1955
1951
  display: "inline-flex",
1956
1952
  id: inputGroupId,
1957
- "aria-labelledby": labelId,
1958
1953
  errorText,
1959
1954
  invalid,
1960
1955
  helperText,
@@ -1966,7 +1961,6 @@ var DatePicker = forwardRef(
1966
1961
  paddingX: 3,
1967
1962
  minHeight,
1968
1963
  isDisabled: props.isDisabled,
1969
- ariaLabelledby: labelId,
1970
1964
  children: [
1971
1965
  /* @__PURE__ */ jsx(Popover$1.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
1972
1966
  CalendarTriggerButton,
@@ -1983,7 +1977,6 @@ var DatePicker = forwardRef(
1983
1977
  {
1984
1978
  label: props.label,
1985
1979
  labelProps,
1986
- labelId,
1987
1980
  name: props.name,
1988
1981
  ...fieldProps
1989
1982
  }
@@ -2157,7 +2150,14 @@ var TimeField = ({ state, ...props }) => {
2157
2150
  children: props.label
2158
2151
  }
2159
2152
  ),
2160
- /* @__PURE__ */ jsx(Flex, { ...fieldProps, ref, paddingTop: "3", paddingBottom: "0.5", children: state.segments.map((segment) => /* @__PURE__ */ jsx(DateTimeSegment, { segment, state }, segment.type)) }),
2153
+ /* @__PURE__ */ jsx(Flex, { ...fieldProps, ref, paddingTop: "3", paddingBottom: "0.5", children: state.segments.map((segment) => /* @__PURE__ */ jsx(
2154
+ DateTimeSegment,
2155
+ {
2156
+ segment,
2157
+ state
2158
+ },
2159
+ JSON.stringify(segment)
2160
+ )) }),
2161
2161
  /* @__PURE__ */ jsx(
2162
2162
  "input",
2163
2163
  {
@@ -2596,6 +2596,17 @@ var Combobox = (props) => {
2596
2596
  inputRef: externalInputRef,
2597
2597
  children,
2598
2598
  variant,
2599
+ allowsEmptyCollection,
2600
+ onSelectionChange,
2601
+ inputValue,
2602
+ onInputChange,
2603
+ menuTrigger,
2604
+ allowsCustomValue,
2605
+ onFocusChange,
2606
+ defaultInputValue,
2607
+ defaultItems,
2608
+ defaultSelectedKey,
2609
+ onOpenChange,
2599
2610
  ...restProps
2600
2611
  } = props;
2601
2612
  const { contains } = useFilter({ sensitivity: "base" });
@@ -2603,11 +2614,22 @@ var Combobox = (props) => {
2603
2614
  const inputRef = externalInputRef ?? fallbackInputRef;
2604
2615
  const listBoxRef = useRef(null);
2605
2616
  const popoverRef = useRef(null);
2606
- const listboxId = `${useId()}-listbox`;
2617
+ const listboxId = useId();
2607
2618
  const inputWidth = useInputWidth(inputRef);
2608
2619
  const state = useComboBoxState({
2609
2620
  defaultFilter: contains,
2610
2621
  shouldCloseOnBlur: true,
2622
+ allowsEmptyCollection,
2623
+ onSelectionChange,
2624
+ inputValue,
2625
+ onInputChange,
2626
+ menuTrigger,
2627
+ allowsCustomValue,
2628
+ onFocusChange,
2629
+ defaultInputValue,
2630
+ defaultItems,
2631
+ defaultSelectedKey,
2632
+ onOpenChange,
2611
2633
  ...props
2612
2634
  });
2613
2635
  const comboBoxProps = {
@@ -2624,22 +2646,29 @@ var Combobox = (props) => {
2624
2646
  paddingTop,
2625
2647
  paddingLeft,
2626
2648
  paddingX,
2627
- paddingY,
2628
- leftIcon
2649
+ paddingY
2629
2650
  };
2630
- const {
2631
- inputProps: { ...inputProps },
2632
- listBoxProps
2633
- } = useComboBox(
2651
+ const { inputProps, listBoxProps } = useComboBox(
2634
2652
  {
2635
2653
  ...props,
2636
2654
  inputRef,
2637
2655
  listBoxRef,
2638
2656
  popoverRef,
2639
- label
2657
+ label,
2658
+ onSelectionChange,
2659
+ inputValue,
2660
+ onInputChange,
2661
+ menuTrigger,
2662
+ allowsCustomValue,
2663
+ onFocusChange,
2664
+ defaultInputValue,
2665
+ defaultItems,
2666
+ defaultSelectedKey,
2667
+ onOpenChange
2640
2668
  },
2641
2669
  state
2642
2670
  );
2671
+ const { "aria-labelledby": _, id: __, ...filteredInputProps } = inputProps;
2643
2672
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2644
2673
  /* @__PURE__ */ jsx(
2645
2674
  Input,
@@ -2662,7 +2691,7 @@ var Combobox = (props) => {
2662
2691
  borderBottomLeftRadius: state.isOpen && !loading ? 0 : borderBottomLeftRadius,
2663
2692
  borderBottomRightRadius: state.isOpen && !loading ? 0 : borderBottomRightRadius,
2664
2693
  _active: { backgroundColor: "core.surface.active" },
2665
- ...inputProps,
2694
+ ...filteredInputProps,
2666
2695
  startElement: leftIcon,
2667
2696
  endElement: loading ? /* @__PURE__ */ jsx(
2668
2697
  ColorSpinner,