@vygruppen/spor-react 12.22.1 → 12.22.2

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.22.1 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.22.2 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
- ESM dist/index.mjs 326.81 KB
14
+ ESM dist/index.mjs 326.79 KB
15
15
  ESM dist/icons/index.mjs 110.00 B
16
+ ESM dist/index.mjs.map 691.91 KB
16
17
  ESM dist/icons/index.mjs.map 157.00 B
17
- ESM dist/index.mjs.map 691.66 KB
18
- ESM ⚡️ Build success in 2807ms
19
- CJS dist/index.cjs 350.70 KB
18
+ ESM ⚡️ Build success in 2623ms
19
+ CJS dist/index.cjs 350.69 KB
20
20
  CJS dist/icons/index.cjs 381.00 B
21
- CJS dist/index.cjs.map 691.66 KB
21
+ CJS dist/index.cjs.map 691.91 KB
22
22
  CJS dist/icons/index.cjs.map 157.00 B
23
- CJS ⚡️ Build success in 2808ms
24
- DTS ⚡️ Build success in 21325ms
23
+ CJS ⚡️ Build success in 2626ms
24
+ DTS ⚡️ Build success in 20971ms
25
25
  DTS dist/icons/index.d.ts 44.00 B
26
- DTS dist/index.d.ts 146.60 KB
26
+ DTS dist/index.d.ts 146.71 KB
27
27
  DTS dist/icons/index.d.cts 44.00 B
28
- DTS dist/index.d.cts 146.60 KB
28
+ DTS dist/index.d.cts 146.71 KB
@@ -1,8 +1,8 @@
1
1
 
2
- > @vygruppen/spor-react@12.22.1 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.22.2 postinstall /home/runner/work/spor/spor/packages/spor-react
3
3
  > chakra typegen src/theme/index.ts
4
4
 
5
- [dotenv@17.2.3] injecting env (0) from .env -- tip: ⚙️ enable debug logging with { debug: true }
5
+ [dotenv@17.2.3] injecting env (0) from .env -- tip: ⚙️ load multiple .env files with { path: ['.env.local', '.env'] }
6
6
  ┌ Chakra CLI ⚡️
7
7
  [?25l│
8
8
  ◒ Generating conditions types...
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 12.22.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 815694c: Improvements to Autocomplete accessibility and bugfixes.
8
+
9
+ Also fix floatingLabel fontSize not being set to 2xs.
10
+
11
+ - 877bd20: Remove unessesary ids from numeric stepper buttons
12
+ - 98504fe: Change from using aria-label in Box to adding a VisuallyHidden elements for better screen reader support of AlertIcon.
13
+ - 3bfb2b1: Align Text font-size breakpoint with other components
14
+
15
+ Changed responsive font-size steps so Text switches size at sm (568px) instead of lg (1025px). This fixes visual size mismatches across the design system.
16
+
3
17
  ## 12.22.1
4
18
 
5
19
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1043,7 +1043,10 @@ var useScrollDirection = () => {
1043
1043
  var AlertIcon = React20.forwardRef(
1044
1044
  ({ variant, customIcon: CustomAlertIcon }, ref) => {
1045
1045
  const { t } = useTranslation();
1046
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { ref, "aria-label": t(texts5[variant]), children: CustomAlertIcon ? /* @__PURE__ */ jsxRuntime.jsx(CustomAlertIcon, { color: `alert.${variant}.icon` }) : /* @__PURE__ */ jsxRuntime.jsx(BaseAlertIcon, { variant }) });
1046
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { ref, children: [
1047
+ /* @__PURE__ */ jsxRuntime.jsx(reactAria.VisuallyHidden, { children: t(texts5[variant]) }),
1048
+ CustomAlertIcon ? /* @__PURE__ */ jsxRuntime.jsx(CustomAlertIcon, { color: `alert.${variant}.icon` }) : /* @__PURE__ */ jsxRuntime.jsx(BaseAlertIcon, { variant })
1049
+ ] });
1047
1050
  }
1048
1051
  );
1049
1052
  AlertIcon.displayName = "AlertIcon";
@@ -1919,12 +1922,12 @@ var floatingLabelStyles = react.defineStyle({
1919
1922
  opacity: 0.4
1920
1923
  },
1921
1924
  pos: "absolute",
1922
- transition: "position",
1925
+ transition: "top 160ms ease, font-size 160ms ease",
1923
1926
  top: "0.9rem",
1924
1927
  color: "text",
1925
1928
  fontSize: ["mobile.sm", "desktop.sm"],
1926
1929
  "&[data-float]": {
1927
- fontSize: ["mobile.xs", "desktop.xs"],
1930
+ fontSize: ["mobile.2xs", "desktop.2xs"],
1928
1931
  color: "text",
1929
1932
  top: "0.3rem"
1930
1933
  }
@@ -1998,7 +2001,7 @@ var Field3 = React20__namespace.forwardRef(
1998
2001
  children: renderLabelWithIndicator(label, labelAsChild)
1999
2002
  }
2000
2003
  ),
2001
- errorText && /* @__PURE__ */ jsxRuntime.jsx(react.Field.ErrorText, { children: errorText })
2004
+ errorText && /* @__PURE__ */ jsxRuntime.jsx(react.Field.ErrorText, { "aria-live": "polite", children: errorText })
2002
2005
  ]
2003
2006
  }
2004
2007
  ),
@@ -3123,7 +3126,7 @@ var SwitchButton = react.chakra(
3123
3126
  react.defineRecipe({
3124
3127
  base: {
3125
3128
  position: "absolute !important",
3126
- zIndex: "docked !important",
3129
+ zIndex: "101 !important",
3127
3130
  // eslint-disable-next-line spor/use-semantic-tokens
3128
3131
  bg: "bg !important",
3129
3132
  outlineWidth: "1px !important",
@@ -3139,7 +3142,7 @@ var SwitchButton = react.chakra(
3139
3142
  },
3140
3143
  vertical: {
3141
3144
  top: "calc(50% - 15px)",
3142
- right: "12px",
3145
+ right: "3rem",
3143
3146
  transform: "rotate(90deg)"
3144
3147
  }
3145
3148
  }
@@ -3254,7 +3257,7 @@ var Input = React20.forwardRef(
3254
3257
  errorText,
3255
3258
  id: props.id,
3256
3259
  labelAsChild,
3257
- label: /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { fontSize: fontSize ?? "mobile.md", children: [
3260
+ label: /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { children: [
3258
3261
  /* @__PURE__ */ jsxRuntime.jsx(react.Box, { visibility: "hidden", children: startElement }),
3259
3262
  label
3260
3263
  ] }),
@@ -3266,6 +3269,7 @@ var Input = React20.forwardRef(
3266
3269
  {
3267
3270
  pointerEvents: "none",
3268
3271
  paddingX: 2,
3272
+ "aria-hidden": "true",
3269
3273
  fontSize: fontSize ?? "mobile.md",
3270
3274
  children: startElement
3271
3275
  }
@@ -3318,6 +3322,9 @@ var Autocomplete = ({
3318
3322
  filteredExternally,
3319
3323
  loading,
3320
3324
  disabled,
3325
+ emptyLabel,
3326
+ openOnClick = true,
3327
+ openOnFocus = true,
3321
3328
  ...rest
3322
3329
  }) => {
3323
3330
  const { contains } = react.useFilter({ sensitivity: "base" });
@@ -3338,50 +3345,52 @@ var Autocomplete = ({
3338
3345
  () => filterChildren(children, collection.items),
3339
3346
  [children, collection.items]
3340
3347
  );
3341
- return /* @__PURE__ */ jsxRuntime.jsxs(
3342
- react.Combobox.Root,
3343
- {
3344
- ...rest,
3345
- collection,
3346
- onInputValueChange: (event) => {
3347
- if (!filteredExternally) {
3348
- filter(event.inputValue);
3349
- }
3350
- onInputValueChange == null ? void 0 : onInputValueChange(event);
3351
- },
3352
- positioning: {
3353
- placement: "bottom",
3354
- offset: {
3355
- mainAxis: 3,
3356
- crossAxis: -1
3357
- },
3358
- flip: false
3348
+ const combobox = react.useCombobox({
3349
+ collection,
3350
+ openOnClick,
3351
+ onInputValueChange: (event) => {
3352
+ if (!filteredExternally) {
3353
+ filter(event.inputValue);
3354
+ }
3355
+ onInputValueChange == null ? void 0 : onInputValueChange(event);
3356
+ },
3357
+ positioning: {
3358
+ placement: "bottom",
3359
+ offset: {
3360
+ mainAxis: 3,
3361
+ crossAxis: -1
3359
3362
  },
3360
- disabled,
3361
- children: [
3362
- /* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.Control, { children: [
3363
- /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Input, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
3364
- Input,
3365
- {
3366
- label: /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Label, { children: label }),
3367
- variant,
3368
- labelAsChild: true,
3369
- startElement: leftIcon,
3370
- invalid,
3371
- helperText,
3372
- errorText,
3373
- required
3374
- }
3375
- ) }),
3376
- /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.IndicatorGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.ClearTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { size: "xs" }) }) })
3377
- ] }),
3378
- /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.Content, { children: [
3379
- /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Empty, { children: !loading && t(texts14.noItemsFound) }),
3380
- loading ? /* @__PURE__ */ jsxRuntime.jsx(ColorSpinner, { width: "1.5rem", p: "2" }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: filteredChildren })
3381
- ] }) })
3382
- ]
3383
- }
3384
- );
3363
+ flip: false
3364
+ },
3365
+ disabled,
3366
+ ...rest
3367
+ });
3368
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.RootProvider, { value: combobox, children: [
3369
+ /* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.Control, { children: [
3370
+ /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Input, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
3371
+ Input,
3372
+ {
3373
+ label: /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Label, { children: label }),
3374
+ variant,
3375
+ labelAsChild: true,
3376
+ startElement: leftIcon,
3377
+ invalid,
3378
+ helperText,
3379
+ errorText,
3380
+ required,
3381
+ onFocus: () => {
3382
+ if (openOnFocus)
3383
+ combobox.setOpen(true);
3384
+ }
3385
+ }
3386
+ ) }),
3387
+ /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.IndicatorGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.ClearTrigger, { asChild: true, "aria-label": t(texts14.clearValue), children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { size: "xs" }) }) })
3388
+ ] }),
3389
+ /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.Content, { children: [
3390
+ /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Empty, { children: !loading && (emptyLabel ?? t(texts14.noItemsFound)) }),
3391
+ loading ? /* @__PURE__ */ jsxRuntime.jsx(ColorSpinner, { width: "1.5rem", p: "2" }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: filteredChildren })
3392
+ ] }) })
3393
+ ] });
3385
3394
  };
3386
3395
  var AutocompleteItemGroup = react.Combobox.ItemGroup;
3387
3396
  var AutocompleteItemGroupLabel = react.Combobox.ItemGroupLabel;
@@ -3451,6 +3460,12 @@ var texts14 = createTexts({
3451
3460
  nn: "Ingen resultat",
3452
3461
  sv: "Inga resultat",
3453
3462
  en: "No results found"
3463
+ },
3464
+ clearValue: {
3465
+ nb: "T\xF8m verdi",
3466
+ nn: "T\xF8m verdi",
3467
+ sv: "Rensa v\xE4rde",
3468
+ en: "Clear value"
3454
3469
  }
3455
3470
  });
3456
3471
  var CardSelect = ({ size = "md", ...props }) => {
@@ -4016,7 +4031,6 @@ var NumericStepper = React20__namespace.default.forwardRef((props, ref) => {
4016
4031
  {
4017
4032
  css: styles.root,
4018
4033
  width: "auto",
4019
- id: idProperty,
4020
4034
  ref,
4021
4035
  label,
4022
4036
  helperText,
@@ -4041,8 +4055,7 @@ var NumericStepper = React20__namespace.default.forwardRef((props, ref) => {
4041
4055
  focusOnAddButton();
4042
4056
  }
4043
4057
  },
4044
- disabled: disabled || value <= minValue,
4045
- id: value <= minValue ? void 0 : idProperty
4058
+ disabled: disabled || value <= minValue
4046
4059
  }
4047
4060
  ),
4048
4061
  withInput ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -4053,7 +4066,7 @@ var NumericStepper = React20__namespace.default.forwardRef((props, ref) => {
4053
4066
  name: nameProperty,
4054
4067
  value,
4055
4068
  disabled,
4056
- id: value === 0 ? void 0 : idProperty,
4069
+ id: idProperty,
4057
4070
  css: styles.input,
4058
4071
  width: `${Math.max(value.toString().length + 1, 3)}ch`,
4059
4072
  "aria-live": "assertive",
@@ -4091,8 +4104,7 @@ var NumericStepper = React20__namespace.default.forwardRef((props, ref) => {
4091
4104
  )
4092
4105
  ),
4093
4106
  onClick: () => onChange(Math.min(value + clampedStepSize, maxValue)),
4094
- disabled: disabled || value >= maxValue,
4095
- id: value >= maxValue ? void 0 : idProperty
4107
+ disabled: disabled || value >= maxValue
4096
4108
  }
4097
4109
  )
4098
4110
  ]
@@ -6300,10 +6312,10 @@ var attachedInputsRecipe = react.defineRecipe({
6300
6312
  },
6301
6313
  "& > *": {
6302
6314
  position: "relative",
6303
- zIndex: 0
6315
+ zIndex: 100
6304
6316
  },
6305
6317
  "& > *:focus-within": {
6306
- zIndex: 1
6318
+ zIndex: 101
6307
6319
  }
6308
6320
  },
6309
6321
  variants: {
@@ -7695,8 +7707,7 @@ var comboboxSlotRecipe = react.defineSlotRecipe({
7695
7707
  },
7696
7708
  label: {
7697
7709
  fontWeight: "medium",
7698
- userSelect: "none",
7699
- textStyle: "sm"
7710
+ userSelect: "none"
7700
7711
  },
7701
7712
  input: {
7702
7713
  transition: "border-radius",
@@ -11616,8 +11627,6 @@ var textStyles = react.defineTextStyles({
11616
11627
  value: {
11617
11628
  fontSize: [
11618
11629
  tokens23__namespace.default.font.style.xxl["font-size"].mobile,
11619
- null,
11620
- null,
11621
11630
  tokens23__namespace.default.font.style.xxl["font-size"].desktop
11622
11631
  ],
11623
11632
  fontFamily: tokens23__namespace.default.font.style.xxl["font-family"],
@@ -11628,8 +11637,6 @@ var textStyles = react.defineTextStyles({
11628
11637
  value: {
11629
11638
  fontSize: [
11630
11639
  tokens23__namespace.default.font.style["xl-display"]["font-size"].mobile,
11631
- null,
11632
- null,
11633
11640
  tokens23__namespace.default.font.style["xl-display"]["font-size"].desktop
11634
11641
  ],
11635
11642
  fontFamily: tokens23__namespace.default.font.style["xl-display"]["font-family"],
@@ -11640,8 +11647,6 @@ var textStyles = react.defineTextStyles({
11640
11647
  value: {
11641
11648
  fontSize: [
11642
11649
  tokens23__namespace.default.font.style["xl-sans"]["font-size"].mobile,
11643
- null,
11644
- null,
11645
11650
  tokens23__namespace.default.font.style["xl-sans"]["font-size"].desktop
11646
11651
  ],
11647
11652
  fontFamily: tokens23__namespace.default.font.style["xl-sans"]["font-family"],
@@ -11652,8 +11657,6 @@ var textStyles = react.defineTextStyles({
11652
11657
  value: {
11653
11658
  fontSize: [
11654
11659
  tokens23__namespace.default.font.style.lg["font-size"].mobile,
11655
- null,
11656
- null,
11657
11660
  tokens23__namespace.default.font.style.lg["font-size"].desktop
11658
11661
  ],
11659
11662
  fontFamily: tokens23__namespace.default.font.style.lg["font-family"],
@@ -11664,8 +11667,6 @@ var textStyles = react.defineTextStyles({
11664
11667
  value: {
11665
11668
  fontSize: [
11666
11669
  tokens23__namespace.default.font.style["md-lg"]["font-size"].mobile,
11667
- null,
11668
- null,
11669
11670
  tokens23__namespace.default.font.style["md-lg"]["font-size"].desktop
11670
11671
  ],
11671
11672
  fontFamily: tokens23__namespace.default.font.style["md-lg"]["font-family"],
@@ -11676,8 +11677,6 @@ var textStyles = react.defineTextStyles({
11676
11677
  value: {
11677
11678
  fontSize: [
11678
11679
  tokens23__namespace.default.font.style.md["font-size"].mobile,
11679
- null,
11680
- null,
11681
11680
  tokens23__namespace.default.font.style.md["font-size"].desktop
11682
11681
  ],
11683
11682
  fontFamily: tokens23__namespace.default.font.style.md["font-family"],
@@ -11688,8 +11687,6 @@ var textStyles = react.defineTextStyles({
11688
11687
  value: {
11689
11688
  fontSize: [
11690
11689
  tokens23__namespace.default.font.style.sm["font-size"].mobile,
11691
- null,
11692
- null,
11693
11690
  tokens23__namespace.default.font.style.sm["font-size"].desktop
11694
11691
  ],
11695
11692
  fontFamily: tokens23__namespace.default.font.style.sm["font-family"],
@@ -11700,8 +11697,6 @@ var textStyles = react.defineTextStyles({
11700
11697
  value: {
11701
11698
  fontSize: [
11702
11699
  tokens23__namespace.default.font.style.xs["font-size"].mobile,
11703
- null,
11704
- null,
11705
11700
  tokens23__namespace.default.font.style.xs["font-size"].desktop
11706
11701
  ],
11707
11702
  fontFamily: tokens23__namespace.default.font.style.xs["font-family"],
@@ -11712,8 +11707,6 @@ var textStyles = react.defineTextStyles({
11712
11707
  value: {
11713
11708
  fontSize: [
11714
11709
  tokens23__namespace.default.font.style["2xs"]["font-size"].mobile,
11715
- null,
11716
- null,
11717
11710
  tokens23__namespace.default.font.style["2xs"]["font-size"].desktop
11718
11711
  ],
11719
11712
  fontFamily: tokens23__namespace.default.font.style["2xs"]["font-family"],