@vygruppen/spor-react 12.12.1 → 12.13.1

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
@@ -269,6 +269,7 @@ declare const buttonRecipe: _chakra_ui_react.RecipeDefinition<{
269
269
  };
270
270
  floating: {
271
271
  color: "floating.text";
272
+ background: "floating.surface";
272
273
  border: "sm";
273
274
  borderColor: "floating.outline";
274
275
  boxShadow: "0px 1px 3px 0px var(--spor-colors-surface-disabled, rgba(0, 0, 0, 0.10))";
@@ -1445,8 +1446,6 @@ type NumericStepperProps = FieldBaseProps & NumericStepperVariants & {
1445
1446
  withInput?: boolean;
1446
1447
  /** The amount to increase/decrease when pressing +/- */
1447
1448
  stepSize?: number;
1448
- /** Whether to show the number input when value is zero */
1449
- showZero?: boolean;
1450
1449
  /** Name added to the aria-label of subtract and add buttons. */
1451
1450
  ariaLabelContext?: {
1452
1451
  singular: string;
@@ -1496,8 +1495,6 @@ declare const NumericStepper: React__default.ForwardRefExoticComponent<FieldBase
1496
1495
  withInput?: boolean;
1497
1496
  /** The amount to increase/decrease when pressing +/- */
1498
1497
  stepSize?: number;
1499
- /** Whether to show the number input when value is zero */
1500
- showZero?: boolean;
1501
1498
  /** Name added to the aria-label of subtract and add buttons. */
1502
1499
  ariaLabelContext?: {
1503
1500
  singular: string;
package/dist/index.d.ts CHANGED
@@ -269,6 +269,7 @@ declare const buttonRecipe: _chakra_ui_react.RecipeDefinition<{
269
269
  };
270
270
  floating: {
271
271
  color: "floating.text";
272
+ background: "floating.surface";
272
273
  border: "sm";
273
274
  borderColor: "floating.outline";
274
275
  boxShadow: "0px 1px 3px 0px var(--spor-colors-surface-disabled, rgba(0, 0, 0, 0.10))";
@@ -1445,8 +1446,6 @@ type NumericStepperProps = FieldBaseProps & NumericStepperVariants & {
1445
1446
  withInput?: boolean;
1446
1447
  /** The amount to increase/decrease when pressing +/- */
1447
1448
  stepSize?: number;
1448
- /** Whether to show the number input when value is zero */
1449
- showZero?: boolean;
1450
1449
  /** Name added to the aria-label of subtract and add buttons. */
1451
1450
  ariaLabelContext?: {
1452
1451
  singular: string;
@@ -1496,8 +1495,6 @@ declare const NumericStepper: React__default.ForwardRefExoticComponent<FieldBase
1496
1495
  withInput?: boolean;
1497
1496
  /** The amount to increase/decrease when pressing +/- */
1498
1497
  stepSize?: number;
1499
- /** Whether to show the number input when value is zero */
1500
- showZero?: boolean;
1501
1498
  /** Name added to the aria-label of subtract and add buttons. */
1502
1499
  ariaLabelContext?: {
1503
1500
  singular: string;
package/dist/index.mjs CHANGED
@@ -16,6 +16,7 @@ export { Item, Section } from 'react-stately';
16
16
  import { GregorianCalendar, createCalendar, getLocalTimeZone, endOfMonth, getWeeksInMonth, isSameMonth, isToday, parseTime } from '@internationalized/date';
17
17
  export { Time } from '@internationalized/date';
18
18
  import { useSwipeable } from 'react-swipeable';
19
+ import ReactDOM from 'react-dom';
19
20
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
20
21
  import { Global } from '@emotion/react';
21
22
  import tokens23__default from '@vygruppen/spor-design-tokens';
@@ -2560,6 +2561,8 @@ var Popover = forwardRef(
2560
2561
  ...popoverProps,
2561
2562
  ref: popoverRef,
2562
2563
  minWidth: ((_a5 = triggerRef.current) == null ? void 0 : _a5.clientWidth) ?? "auto",
2564
+ position: "absolute",
2565
+ zIndex: 1400,
2563
2566
  children: [
2564
2567
  /* @__PURE__ */ jsx(DismissButton, { onDismiss: state.close }),
2565
2568
  children,
@@ -2568,6 +2571,9 @@ var Popover = forwardRef(
2568
2571
  }
2569
2572
  );
2570
2573
  if (isNonModal) {
2574
+ if (globalThis.window !== void 0 && typeof document !== "undefined") {
2575
+ return ReactDOM.createPortal(popoverBox, document.body);
2576
+ }
2571
2577
  return popoverBox;
2572
2578
  }
2573
2579
  return /* @__PURE__ */ jsxs(Overlay, { children: [
@@ -3028,7 +3034,6 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
3028
3034
  disabled,
3029
3035
  withInput = true,
3030
3036
  stepSize = 1,
3031
- showZero = false,
3032
3037
  ariaLabelContext = { singular: "", plural: "" },
3033
3038
  ...rest
3034
3039
  } = props;
@@ -3063,8 +3068,7 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
3063
3068
  focusOnAddButton();
3064
3069
  }
3065
3070
  },
3066
- visibility: value <= minValue ? "hidden" : "visible",
3067
- disabled,
3071
+ disabled: disabled || value <= minValue,
3068
3072
  id: value <= minValue ? void 0 : idProp
3069
3073
  }
3070
3074
  ),
@@ -3076,10 +3080,9 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
3076
3080
  name: nameProp,
3077
3081
  value,
3078
3082
  disabled,
3079
- id: !showZero && value === 0 ? void 0 : idProp,
3083
+ id: value === 0 ? void 0 : idProp,
3080
3084
  css: styles.input,
3081
3085
  width: `${Math.max(value.toString().length + 1, 3)}ch`,
3082
- visibility: !showZero && value === 0 ? "hidden" : "visible",
3083
3086
  "aria-live": "assertive",
3084
3087
  "aria-label": ariaLabelContext.plural === "" ? "" : t(texts13.currentNumberAriaLabel(ariaLabelContext.plural)),
3085
3088
  onChange: (e) => {
@@ -3088,7 +3091,7 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
3088
3091
  return;
3089
3092
  }
3090
3093
  onChange(Math.max(Math.min(numericInput, maxValue), minValue));
3091
- if (!showZero && Math.max(Math.min(numericInput, maxValue), minValue) === 0) {
3094
+ if (Math.max(Math.min(numericInput, maxValue), minValue) === 0) {
3092
3095
  focusOnAddButton();
3093
3096
  }
3094
3097
  }
@@ -3096,7 +3099,6 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
3096
3099
  ) : /* @__PURE__ */ jsx(
3097
3100
  Text3,
3098
3101
  {
3099
- visibility: !showZero && value === 0 ? "hidden" : "visible",
3100
3102
  "aria-live": "assertive",
3101
3103
  paddingX: "0.95rem",
3102
3104
  "aria-label": ariaLabelContext.plural === "" ? "" : t(texts13.currentNumberAriaLabel(ariaLabelContext.plural)),
@@ -3115,8 +3117,7 @@ var NumericStepper = React27__default.forwardRef((props, ref) => {
3115
3117
  )
3116
3118
  ),
3117
3119
  onClick: () => onChange(Math.min(value + clampedStepSize, maxValue)),
3118
- visibility: value >= maxValue ? "hidden" : "visible",
3119
- disabled,
3120
+ disabled: disabled || value >= maxValue,
3120
3121
  id: value >= maxValue ? void 0 : idProp
3121
3122
  }
3122
3123
  )
@@ -3317,7 +3318,7 @@ var CountryCodeSelect = forwardRef((props, ref) => {
3317
3318
  lazyMount: true,
3318
3319
  "aria-label": t(texts15.countryCode),
3319
3320
  sideRadiusVariant: "rightSideSquare",
3320
- children: callingCodes.items.map((code) => /* @__PURE__ */ jsx(SelectItem, { as: "option", item: code, children: code.label }, code.label))
3321
+ children: callingCodes.items.map((code) => /* @__PURE__ */ jsx(SelectItem, { item: code, children: code.label }, code.label))
3321
3322
  }
3322
3323
  );
3323
3324
  });
@@ -5498,6 +5499,7 @@ var buttonRecipe = defineRecipe({
5498
5499
  },
5499
5500
  floating: {
5500
5501
  color: "floating.text",
5502
+ background: "floating.surface",
5501
5503
  border: "sm",
5502
5504
  borderColor: "floating.outline",
5503
5505
  boxShadow: "0px 1px 3px 0px var(--spor-colors-surface-disabled, rgba(0, 0, 0, 0.10))",