@vygruppen/spor-react 12.8.7 → 12.8.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@12.8.7 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.8.8 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,17 +11,17 @@ 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.77 KB
15
- CJS dist/icons/index.cjs 381.00 B
16
- CJS dist/index.cjs.map 627.68 KB
17
- CJS dist/icons/index.cjs.map 157.00 B
18
- CJS ⚡️ Build success in 2979ms
19
- ESM dist/index.mjs 292.93 KB
14
+ ESM dist/index.mjs 293.57 KB
20
15
  ESM dist/icons/index.mjs 110.00 B
21
- ESM dist/index.mjs.map 627.68 KB
16
+ ESM dist/index.mjs.map 628.65 KB
22
17
  ESM dist/icons/index.mjs.map 157.00 B
23
- ESM ⚡️ Build success in 2979ms
24
- DTS ⚡️ Build success in 29664ms
18
+ ESM ⚡️ Build success in 2969ms
19
+ CJS dist/index.cjs 314.45 KB
20
+ CJS dist/icons/index.cjs 381.00 B
21
+ CJS dist/index.cjs.map 628.65 KB
22
+ CJS dist/icons/index.cjs.map 157.00 B
23
+ CJS ⚡️ Build success in 2970ms
24
+ DTS ⚡️ Build success in 29941ms
25
25
  DTS dist/icons/index.d.ts 44.00 B
26
26
  DTS dist/index.d.ts 156.34 KB
27
27
  DTS dist/icons/index.d.cts 44.00 B
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@12.8.7 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.8.8 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,12 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 12.8.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 7f7c933: field: Render RequiredIndicator when required is true
8
+ heading: Fix bug where autoId was used when externalId was specified
9
+
3
10
  ## 12.8.7
4
11
 
5
12
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -773,8 +773,15 @@ var Heading = React27.forwardRef(
773
773
  id: externalId,
774
774
  ...rest
775
775
  } = props;
776
- const id = externalId ?? (autoId && typeof rest.children === "string") ? slugify(rest.children) : void 0;
777
- return /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as, textStyle: variant, id, ref, ...rest });
776
+ const reactId = React27.useId();
777
+ function getId() {
778
+ if (externalId !== void 0)
779
+ return externalId;
780
+ if (!autoId)
781
+ return;
782
+ return typeof rest.children === "string" ? slugify(rest.children) : reactId;
783
+ }
784
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as, textStyle: variant, id: getId(), ref, ...rest });
778
785
  }
779
786
  );
780
787
  function resolveTextProps({
@@ -1405,9 +1412,15 @@ var Field3 = React27__namespace.forwardRef(
1405
1412
  css: styles.root,
1406
1413
  direction,
1407
1414
  children: [
1408
- label && !floatingLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { children: label }),
1415
+ label && !floatingLabel && /* @__PURE__ */ jsxRuntime.jsxs(Label, { children: [
1416
+ label,
1417
+ /* @__PURE__ */ jsxRuntime.jsx(react.Field.RequiredIndicator, {})
1418
+ ] }),
1409
1419
  children,
1410
- label && floatingLabel && /* @__PURE__ */ jsxRuntime.jsx(FloatingLabel, { children: label }),
1420
+ label && floatingLabel && /* @__PURE__ */ jsxRuntime.jsxs(FloatingLabel, { children: [
1421
+ label,
1422
+ /* @__PURE__ */ jsxRuntime.jsx(react.Field.RequiredIndicator, {})
1423
+ ] }),
1411
1424
  errorText && /* @__PURE__ */ jsxRuntime.jsx(react.Field.ErrorText, { children: errorText })
1412
1425
  ]
1413
1426
  }
@@ -1973,6 +1986,7 @@ var DatePicker = React27.forwardRef(
1973
1986
  errorText,
1974
1987
  invalid,
1975
1988
  helperText,
1989
+ required: props.required,
1976
1990
  children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverAnchor, { children: /* @__PURE__ */ jsxRuntime.jsxs(
1977
1991
  StyledField,
1978
1992
  {
@@ -2096,6 +2110,7 @@ function DateRangePicker({
2096
2110
  errorText,
2097
2111
  helperText,
2098
2112
  invalid,
2113
+ required: props.required,
2099
2114
  children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverAnchor, { children: /* @__PURE__ */ jsxRuntime.jsxs(
2100
2115
  StyledField,
2101
2116
  {
@@ -2805,6 +2820,7 @@ var Input = React27.forwardRef(
2805
2820
  invalid,
2806
2821
  helperText,
2807
2822
  errorText,
2823
+ required,
2808
2824
  ...props
2809
2825
  }, ref) => {
2810
2826
  const recipe = react.useRecipe({ key: "input" });
@@ -2815,6 +2831,7 @@ var Input = React27.forwardRef(
2815
2831
  {
2816
2832
  invalid,
2817
2833
  helperText,
2834
+ required,
2818
2835
  errorText,
2819
2836
  label: (
2820
2837
  // Render startElement invisibly to align label text with input content when an icon is present
@@ -3487,22 +3504,31 @@ var Select = React27__namespace.forwardRef(
3487
3504
  } = props;
3488
3505
  const recipe = react.useSlotRecipe({ key: "select" });
3489
3506
  const styles = recipe({ variant });
3490
- return /* @__PURE__ */ jsxRuntime.jsx(Field3, { errorText, invalid, helperText, children: /* @__PURE__ */ jsxRuntime.jsxs(
3491
- react.Select.Root,
3507
+ return /* @__PURE__ */ jsxRuntime.jsx(
3508
+ Field3,
3492
3509
  {
3493
- ...rest,
3494
- ref,
3495
- positioning: { sameWidth: true, ...positioning },
3496
- variant,
3497
- css: styles.root,
3498
- position: "relative",
3499
- children: [
3500
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { "data-attachable": true, children: /* @__PURE__ */ jsxRuntime.jsx(SelectValueText, { withPlaceholder: label ? true : false }) }),
3501
- label && /* @__PURE__ */ jsxRuntime.jsx(SelectLabel, { css: styles.label, children: label }),
3502
- /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { css: styles.selectContent, children })
3503
- ]
3510
+ errorText,
3511
+ invalid,
3512
+ helperText,
3513
+ required: props.required,
3514
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
3515
+ react.Select.Root,
3516
+ {
3517
+ ...rest,
3518
+ ref,
3519
+ positioning: { sameWidth: true, ...positioning },
3520
+ variant,
3521
+ css: styles.root,
3522
+ position: "relative",
3523
+ children: [
3524
+ /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { "data-attachable": true, children: /* @__PURE__ */ jsxRuntime.jsx(SelectValueText, { withPlaceholder: label ? true : false }) }),
3525
+ label && /* @__PURE__ */ jsxRuntime.jsx(SelectLabel, { css: styles.label, children: label }),
3526
+ /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { css: styles.selectContent, children })
3527
+ ]
3528
+ }
3529
+ )
3504
3530
  }
3505
- ) });
3531
+ );
3506
3532
  }
3507
3533
  );
3508
3534
  var SelectLabel = (props) => {
@@ -3609,6 +3635,7 @@ var Switch = React27.forwardRef(
3609
3635
  invalid,
3610
3636
  errorText,
3611
3637
  helperText,
3638
+ required: props.required,
3612
3639
  children: /* @__PURE__ */ jsxRuntime.jsxs(
3613
3640
  react.Switch.Root,
3614
3641
  {
@@ -7629,6 +7656,9 @@ var fieldSlotRecipe = react.defineSlotRecipe({
7629
7656
  marginStart: 1,
7630
7657
  color: "brightRed"
7631
7658
  },
7659
+ label: {
7660
+ display: "flex"
7661
+ },
7632
7662
  helperText: {
7633
7663
  marginTop: 2,
7634
7664
  color: "text.tertiary",