@vygruppen/spor-react 12.24.6 → 12.24.8

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
@@ -614,6 +614,7 @@ declare const RadioCard: React__default.ForwardRefExoticComponent<RadioCard$1.It
614
614
  } & {
615
615
  inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
616
616
  ariaLabel?: string;
617
+ value?: string;
617
618
  } & React__default.RefAttributes<HTMLInputElement>>;
618
619
  declare const RadioCardGroup: React__default.ForwardRefExoticComponent<{
619
620
  variant?: _chakra_ui_react.ConditionalValue<"core" | "floating" | undefined>;
@@ -1286,7 +1287,7 @@ type Props = {
1286
1287
  emptyLabel?: React__default.ReactNode;
1287
1288
  openOnFocus?: boolean;
1288
1289
  } & Omit<ComboboxRootProps, "collection"> & FieldProps;
1289
- declare const Autocomplete: ({ variant, children, label, leftIcon, onInputValueChange, invalid, helperText, errorText, required, filteredExternally, loading, disabled, emptyLabel, openOnClick, openOnFocus, ...rest }: Props) => react_jsx_runtime.JSX.Element;
1290
+ declare const Autocomplete: ({ variant, children, label, leftIcon, onInputValueChange, invalid, helperText, errorText, required, filteredExternally, loading, disabled, emptyLabel, onFocus, openOnClick, openOnFocus, ...rest }: Props) => react_jsx_runtime.JSX.Element;
1290
1291
  declare const AutocompleteItemGroup: React__default.ForwardRefExoticComponent<Combobox$1.ItemGroupProps & React__default.RefAttributes<HTMLDivElement>>;
1291
1292
  declare const AutocompleteItemGroupLabel: React__default.ForwardRefExoticComponent<_chakra_ui_react.ComboboxItemGroupLabelProps & React__default.RefAttributes<HTMLDivElement>>;
1292
1293
  declare const AutocompleteItem: React__default.ForwardRefExoticComponent<Combobox$1.ItemProps & React__default.RefAttributes<HTMLDivElement>>;
@@ -1669,7 +1670,16 @@ declare const NativeSelect: React$1.ForwardRefExoticComponent<{
1669
1670
  icon?: React$1.ReactNode;
1670
1671
  } & React$1.RefAttributes<HTMLDivElement>>;
1671
1672
 
1672
- declare const numericStepperRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "container" | "input" | "text" | "button", _chakra_ui_react.SlotRecipeVariantRecord<"root" | "container" | "input" | "text" | "button">>;
1673
+ declare const numericStepperRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "container" | "input" | "text" | "button", {
1674
+ withStepLabel: {
1675
+ true: {
1676
+ button: {
1677
+ paddingInline: "1 !important";
1678
+ };
1679
+ };
1680
+ false: {};
1681
+ };
1682
+ }>;
1673
1683
 
1674
1684
  type NumericStepperVariants = RecipeVariantProps<typeof numericStepperRecipe>;
1675
1685
  type NumericStepperProps = FieldBaseProps & NumericStepperVariants & {
@@ -1722,6 +1732,8 @@ type NumericStepperProps = FieldBaseProps & NumericStepperVariants & {
1722
1732
  * @see https://spor.vy.no/components/numeric-stepper
1723
1733
  */
1724
1734
  declare const NumericStepper: React__default.ForwardRefExoticComponent<FieldBaseProps & {
1735
+ withStepLabel?: _chakra_ui_react.ConditionalValue<boolean | undefined>;
1736
+ } & {
1725
1737
  children?: React__default.ReactNode;
1726
1738
  /** The name of the input field */
1727
1739
  name?: string;
package/dist/index.d.ts CHANGED
@@ -614,6 +614,7 @@ declare const RadioCard: React__default.ForwardRefExoticComponent<RadioCard$1.It
614
614
  } & {
615
615
  inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
616
616
  ariaLabel?: string;
617
+ value?: string;
617
618
  } & React__default.RefAttributes<HTMLInputElement>>;
618
619
  declare const RadioCardGroup: React__default.ForwardRefExoticComponent<{
619
620
  variant?: _chakra_ui_react.ConditionalValue<"core" | "floating" | undefined>;
@@ -1286,7 +1287,7 @@ type Props = {
1286
1287
  emptyLabel?: React__default.ReactNode;
1287
1288
  openOnFocus?: boolean;
1288
1289
  } & Omit<ComboboxRootProps, "collection"> & FieldProps;
1289
- declare const Autocomplete: ({ variant, children, label, leftIcon, onInputValueChange, invalid, helperText, errorText, required, filteredExternally, loading, disabled, emptyLabel, openOnClick, openOnFocus, ...rest }: Props) => react_jsx_runtime.JSX.Element;
1290
+ declare const Autocomplete: ({ variant, children, label, leftIcon, onInputValueChange, invalid, helperText, errorText, required, filteredExternally, loading, disabled, emptyLabel, onFocus, openOnClick, openOnFocus, ...rest }: Props) => react_jsx_runtime.JSX.Element;
1290
1291
  declare const AutocompleteItemGroup: React__default.ForwardRefExoticComponent<Combobox$1.ItemGroupProps & React__default.RefAttributes<HTMLDivElement>>;
1291
1292
  declare const AutocompleteItemGroupLabel: React__default.ForwardRefExoticComponent<_chakra_ui_react.ComboboxItemGroupLabelProps & React__default.RefAttributes<HTMLDivElement>>;
1292
1293
  declare const AutocompleteItem: React__default.ForwardRefExoticComponent<Combobox$1.ItemProps & React__default.RefAttributes<HTMLDivElement>>;
@@ -1669,7 +1670,16 @@ declare const NativeSelect: React$1.ForwardRefExoticComponent<{
1669
1670
  icon?: React$1.ReactNode;
1670
1671
  } & React$1.RefAttributes<HTMLDivElement>>;
1671
1672
 
1672
- declare const numericStepperRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "container" | "input" | "text" | "button", _chakra_ui_react.SlotRecipeVariantRecord<"root" | "container" | "input" | "text" | "button">>;
1673
+ declare const numericStepperRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "container" | "input" | "text" | "button", {
1674
+ withStepLabel: {
1675
+ true: {
1676
+ button: {
1677
+ paddingInline: "1 !important";
1678
+ };
1679
+ };
1680
+ false: {};
1681
+ };
1682
+ }>;
1673
1683
 
1674
1684
  type NumericStepperVariants = RecipeVariantProps<typeof numericStepperRecipe>;
1675
1685
  type NumericStepperProps = FieldBaseProps & NumericStepperVariants & {
@@ -1722,6 +1732,8 @@ type NumericStepperProps = FieldBaseProps & NumericStepperVariants & {
1722
1732
  * @see https://spor.vy.no/components/numeric-stepper
1723
1733
  */
1724
1734
  declare const NumericStepper: React__default.ForwardRefExoticComponent<FieldBaseProps & {
1735
+ withStepLabel?: _chakra_ui_react.ConditionalValue<boolean | undefined>;
1736
+ } & {
1725
1737
  children?: React__default.ReactNode;
1726
1738
  /** The name of the input field */
1727
1739
  name?: string;
package/dist/index.mjs CHANGED
@@ -1503,10 +1503,17 @@ var PressableCard = forwardRef(
1503
1503
  PressableCard.displayName = "PressableCard";
1504
1504
  var RadioCard = forwardRef(
1505
1505
  (props, ref) => {
1506
- const { inputProps, children } = props;
1506
+ const { inputProps, children, value } = props;
1507
1507
  return /* @__PURE__ */ jsxs(RadioCard$1.Item, { ...props, children: [
1508
- /* @__PURE__ */ jsx(RadioCard$1.ItemHiddenInput, { ref, ...inputProps }),
1509
- /* @__PURE__ */ jsx(RadioCard$1.ItemControl, { children })
1508
+ /* @__PURE__ */ jsx(
1509
+ RadioCard$1.ItemHiddenInput,
1510
+ {
1511
+ ref,
1512
+ ...inputProps,
1513
+ "aria-label": value
1514
+ }
1515
+ ),
1516
+ /* @__PURE__ */ jsx(RadioCard$1.ItemControl, { "aria-hidden": value ? true : false, children })
1510
1517
  ] });
1511
1518
  }
1512
1519
  );
@@ -2292,7 +2299,7 @@ var CalendarTriggerButton = forwardRef(({ variant, disabled, onPress: _, ...butt
2292
2299
  key: "datePicker"
2293
2300
  });
2294
2301
  const styles = recipe({ variant });
2295
- return /* @__PURE__ */ jsx(PopoverAnchor, { ...buttonProps, ref, children: /* @__PURE__ */ jsx(
2302
+ return /* @__PURE__ */ jsx(PopoverAnchor, { ...buttonProps, ref, asChild: true, children: /* @__PURE__ */ jsx(
2296
2303
  IconButton,
2297
2304
  {
2298
2305
  icon: /* @__PURE__ */ jsx(CalendarOutline24Icon, {}),
@@ -2341,7 +2348,7 @@ var DateTimeSegment = forwardRef(
2341
2348
  borderRadius: "xs",
2342
2349
  fontSize: ["mobile.sm", "desktop.sm"],
2343
2350
  css: styles.dateTimeSegment,
2344
- "aria-description": ariaDescription,
2351
+ "aria-label": ariaDescription,
2345
2352
  "aria-labelledby": ariaLabel,
2346
2353
  children: isPaddable(segment.type) ? segment.text.padStart(2, "0") : segment.text
2347
2354
  }
@@ -3306,6 +3313,7 @@ var Autocomplete = ({
3306
3313
  loading,
3307
3314
  disabled,
3308
3315
  emptyLabel,
3316
+ onFocus,
3309
3317
  openOnClick = true,
3310
3318
  openOnFocus = true,
3311
3319
  ...rest
@@ -3361,7 +3369,8 @@ var Autocomplete = ({
3361
3369
  helperText,
3362
3370
  errorText,
3363
3371
  required,
3364
- onFocus: () => {
3372
+ onFocus: (event) => {
3373
+ onFocus == null ? void 0 : onFocus(event);
3365
3374
  if (openOnFocus)
3366
3375
  combobox.setOpen(true);
3367
3376
  }
@@ -3369,20 +3378,10 @@ var Autocomplete = ({
3369
3378
  ) }),
3370
3379
  /* @__PURE__ */ jsx(Combobox.IndicatorGroup, { children: /* @__PURE__ */ jsx(Combobox.ClearTrigger, { asChild: true, "aria-label": t(texts14.clearValue), children: /* @__PURE__ */ jsx(CloseButton, { size: "xs" }) }) })
3371
3380
  ] }),
3372
- /* @__PURE__ */ jsx(Combobox.Positioner, { children: /* @__PURE__ */ jsxs(
3373
- Combobox.Content,
3374
- {
3375
- onBlur: (event) => {
3376
- if (!event.currentTarget.contains(event.relatedTarget)) {
3377
- combobox.setOpen(false);
3378
- }
3379
- },
3380
- children: [
3381
- /* @__PURE__ */ jsx(Combobox.Empty, { children: !loading && (emptyLabel ?? t(texts14.noItemsFound)) }),
3382
- loading ? /* @__PURE__ */ jsx(ColorSpinner, { width: "1.5rem", p: "2" }) : /* @__PURE__ */ jsx(Fragment, { children: filteredChildren })
3383
- ]
3384
- }
3385
- ) })
3381
+ /* @__PURE__ */ jsx(Combobox.Positioner, { children: /* @__PURE__ */ jsxs(Combobox.Content, { children: [
3382
+ /* @__PURE__ */ jsx(Combobox.Empty, { children: !loading && (emptyLabel ?? t(texts14.noItemsFound)) }),
3383
+ loading ? /* @__PURE__ */ jsx(ColorSpinner, { width: "1.5rem", p: "2" }) : /* @__PURE__ */ jsx(Fragment, { children: filteredChildren })
3384
+ ] }) })
3386
3385
  ] });
3387
3386
  };
3388
3387
  var AutocompleteItemGroup = Combobox.ItemGroup;
@@ -4048,7 +4047,8 @@ var NumericStepper = React20__default.forwardRef((props, ref) => {
4048
4047
  focusOnAddButton();
4049
4048
  }
4050
4049
  },
4051
- disabled: disabled || value <= minValue
4050
+ disabled: disabled || value <= minValue,
4051
+ withStepLabel: stepSize != 1
4052
4052
  }
4053
4053
  ),
4054
4054
  withInput ? /* @__PURE__ */ jsx(
@@ -4097,7 +4097,8 @@ var NumericStepper = React20__default.forwardRef((props, ref) => {
4097
4097
  )
4098
4098
  ),
4099
4099
  onClick: () => onChange(Math.min(value + clampedStepSize, maxValue)),
4100
- disabled: disabled || value >= maxValue
4100
+ disabled: disabled || value >= maxValue,
4101
+ withStepLabel: stepSize != 1
4101
4102
  }
4102
4103
  )
4103
4104
  ]
@@ -4106,8 +4107,9 @@ var NumericStepper = React20__default.forwardRef((props, ref) => {
4106
4107
  });
4107
4108
  NumericStepper.displayName = "NumericStepper";
4108
4109
  var VerySmallButton = React20__default.forwardRef((props, ref) => {
4110
+ const { withStepLabel = false, ...rest } = props;
4109
4111
  const recipe = useSlotRecipe({ key: "numericStepper" });
4110
- const styles = recipe({ colorPalette: "default" });
4112
+ const styles = recipe({ withStepLabel });
4111
4113
  return /* @__PURE__ */ jsx(
4112
4114
  IconButton,
4113
4115
  {
@@ -4115,7 +4117,7 @@ var VerySmallButton = React20__default.forwardRef((props, ref) => {
4115
4117
  size: "xs",
4116
4118
  css: styles.button,
4117
4119
  ref,
4118
- ...props
4120
+ ...rest
4119
4121
  }
4120
4122
  );
4121
4123
  });
@@ -9819,6 +9821,16 @@ var numericStepperRecipe = defineSlotRecipe({
9819
9821
  height: "1.2rem"
9820
9822
  }
9821
9823
  }
9824
+ },
9825
+ variants: {
9826
+ withStepLabel: {
9827
+ true: {
9828
+ button: {
9829
+ paddingInline: "1 !important"
9830
+ }
9831
+ },
9832
+ false: {}
9833
+ }
9822
9834
  }
9823
9835
  });
9824
9836
  var paginationSlotRecipe = defineSlotRecipe({