@vygruppen/spor-react 12.4.1 → 12.4.3

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.4.1 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.4.3 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
@@ -10,17 +10,17 @@ CLI Target: node16
10
10
  CJS Build start
11
11
  ESM Build start
12
12
  DTS Build start
13
+ ESM dist/index.mjs 294.22 KB
13
14
  ESM dist/icons/index.mjs 110.00 B
14
- ESM dist/index.mjs 295.23 KB
15
15
  ESM dist/icons/index.mjs.map 157.00 B
16
- ESM dist/index.mjs.map 633.84 KB
17
- ESM ⚡️ Build success in 2800ms
18
- CJS dist/index.js 315.85 KB
16
+ ESM dist/index.mjs.map 633.63 KB
17
+ ESM ⚡️ Build success in 2624ms
18
+ CJS dist/index.js 314.70 KB
19
19
  CJS dist/icons/index.js 380.00 B
20
- CJS dist/index.js.map 633.84 KB
21
20
  CJS dist/icons/index.js.map 157.00 B
22
- CJS ⚡️ Build success in 2801ms
23
- DTS ⚡️ Build success in 30877ms
21
+ CJS dist/index.js.map 633.63 KB
22
+ CJS ⚡️ Build success in 2627ms
23
+ DTS ⚡️ Build success in 29298ms
24
24
  DTS dist/icons/index.d.ts 44.00 B
25
25
  DTS dist/index.d.ts 126.10 KB
26
26
  DTS dist/icons/index.d.mts 44.00 B
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@12.4.1 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.4.3 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,17 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 12.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 144aca1: Support exporting icons directly from spor, which seems to fix SSR issues for icons.
8
+
9
+ ## 12.4.2
10
+
11
+ ### Patch Changes
12
+
13
+ - d96b924: Revert exporting icons, which caused issues with tokens with remix.
14
+
3
15
  ## 12.4.1
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -61,9 +61,8 @@ var paletteJson__default = /*#__PURE__*/_interopDefault(paletteJson);
61
61
  var warnAboutMismatchingIcon = ({
62
62
  icon
63
63
  }) => {
64
- var _a5, _b4;
65
64
  if (process.env.NODE_ENV !== "production") {
66
- const displayName = (_b4 = (_a5 = icon == null ? void 0 : icon.type) == null ? void 0 : _a5.render) == null ? void 0 : _b4.displayName;
65
+ const displayName = icon?.type?.render?.displayName;
67
66
  if (!displayName) {
68
67
  return;
69
68
  }
@@ -829,7 +828,6 @@ var badgeRecipie = react.defineRecipe({
829
828
  });
830
829
 
831
830
  // src/theme/recipes/code.ts
832
- var _a;
833
831
  var codeRecipie = react.defineRecipe({
834
832
  base: {
835
833
  fontFamily: "monospace",
@@ -838,7 +836,7 @@ var codeRecipie = react.defineRecipe({
838
836
  paddingX: 1
839
837
  },
840
838
  variants: {
841
- colorPalette: ((_a = badgeRecipie.variants) == null ? void 0 : _a.colorPalette) ?? {}
839
+ colorPalette: badgeRecipie.variants?.colorPalette ?? {}
842
840
  }
843
841
  });
844
842
  var StyledCode = react.chakra(react.Code, codeRecipie);
@@ -1155,7 +1153,7 @@ var Alert = React28.forwardRef((props, ref) => {
1155
1153
  const { open, onClose } = react.useDisclosure({ defaultOpen: true });
1156
1154
  const handleAlertClose = () => {
1157
1155
  onClose();
1158
- onAlertClose == null ? void 0 : onAlertClose();
1156
+ onAlertClose?.();
1159
1157
  };
1160
1158
  const recipe = react.useSlotRecipe({ key: "alert" });
1161
1159
  const styles = recipe({ variant: props.variant });
@@ -1991,8 +1989,7 @@ function CalendarCell({
1991
1989
  stateProps["data-unavailable"] = true;
1992
1990
  }
1993
1991
  React28.useEffect(() => {
1994
- var _a5;
1995
- (_a5 = ref.current) == null ? void 0 : _a5.addEventListener(
1992
+ ref.current?.addEventListener(
1996
1993
  "touchend",
1997
1994
  (event) => {
1998
1995
  event.preventDefault();
@@ -2038,7 +2035,7 @@ var getCurrentTime = () => {
2038
2035
  return date.parseTime(now.toTimeString().split(" ")[0]);
2039
2036
  };
2040
2037
  var getTimestampFromTime = (time) => {
2041
- return `${(time == null ? void 0 : time.hour) ?? 0}:${(time == null ? void 0 : time.minute) ?? 0}`;
2038
+ return `${time?.hour ?? 0}:${time?.minute ?? 0}`;
2042
2039
  };
2043
2040
  var weekDays = {
2044
2041
  nb: ["Ma", "Ti", "On", "To", "Fr", "L\xF8", "S\xF8"],
@@ -2342,7 +2339,6 @@ function createCalendar2(identifier) {
2342
2339
  }
2343
2340
  var DateField = React28.forwardRef(
2344
2341
  ({ labelId, ...props }, externalRef) => {
2345
- var _a5;
2346
2342
  const locale = useCurrentLocale();
2347
2343
  const recipe = react.useSlotRecipe({
2348
2344
  key: "datePicker",
@@ -2388,7 +2384,7 @@ var DateField = React28.forwardRef(
2388
2384
  "input",
2389
2385
  {
2390
2386
  type: "hidden",
2391
- value: ((_a5 = state.value) == null ? void 0 : _a5.toString()) ?? "",
2387
+ value: state.value?.toString() ?? "",
2392
2388
  name: props.name
2393
2389
  }
2394
2390
  )
@@ -2474,8 +2470,8 @@ var DatePicker = React28.forwardRef(
2474
2470
  ...props,
2475
2471
  shouldCloseOnSelect: true,
2476
2472
  errorMessage: errorText,
2477
- isRequired: props.isRequired ?? (chakraFieldProps == null ? void 0 : chakraFieldProps.required),
2478
- validationState: (chakraFieldProps == null ? void 0 : chakraFieldProps.invalid) ? "invalid" : "valid"
2473
+ isRequired: props.isRequired ?? chakraFieldProps?.required,
2474
+ validationState: chakraFieldProps?.invalid ? "invalid" : "valid"
2479
2475
  });
2480
2476
  const internalRef = React28.useRef(null);
2481
2477
  const ref = externalRef ?? internalRef;
@@ -2611,8 +2607,8 @@ function DateRangePicker({
2611
2607
  shouldCloseOnSelect: true,
2612
2608
  isInvalid: invalid,
2613
2609
  errorMessage: errorText,
2614
- isRequired: props.required ?? (fieldContextPRops == null ? void 0 : fieldContextPRops.required),
2615
- validationState: (fieldContextPRops == null ? void 0 : fieldContextPRops.invalid) ? "invalid" : "valid"
2610
+ isRequired: props.required ?? fieldContextPRops?.required,
2611
+ validationState: fieldContextPRops?.invalid ? "invalid" : "valid"
2616
2612
  });
2617
2613
  const ref = React28.useRef(null);
2618
2614
  const uniqueId = reactAria.useId();
@@ -2788,7 +2784,7 @@ var TimePicker = ({
2788
2784
  )}`;
2789
2785
  const inputLabel = label ?? t(texts11.time);
2790
2786
  const ariaLabel = `${inputLabel} \u2013 ${t(
2791
- texts11.selectedTimeIs(`${(dateTime == null ? void 0 : dateTime.hour) ?? 0} ${(dateTime == null ? void 0 : dateTime.minute) ?? 0}`)
2787
+ texts11.selectedTimeIs(`${dateTime?.hour ?? 0} ${dateTime?.minute ?? 0}`)
2792
2788
  )}`;
2793
2789
  return /* @__PURE__ */ jsxRuntime.jsx(Field3, { as: "time", ...boxProps, children: /* @__PURE__ */ jsxRuntime.jsxs(
2794
2790
  StyledField,
@@ -3136,7 +3132,6 @@ var Popover = React28.forwardRef(
3136
3132
  hasBackdrop = true,
3137
3133
  containerPadding = 12
3138
3134
  }, ref) => {
3139
- var _a5;
3140
3135
  const internalRef = React28.useRef(null);
3141
3136
  const popoverRef = ref ?? internalRef;
3142
3137
  const { popoverProps, underlayProps } = reactAria.usePopover(
@@ -3157,7 +3152,7 @@ var Popover = React28.forwardRef(
3157
3152
  {
3158
3153
  ...popoverProps,
3159
3154
  ref: popoverRef,
3160
- minWidth: ((_a5 = triggerRef.current) == null ? void 0 : _a5.clientWidth) ?? "auto",
3155
+ minWidth: triggerRef.current?.clientWidth ?? "auto",
3161
3156
  children: [
3162
3157
  /* @__PURE__ */ jsxRuntime.jsx(reactAria.DismissButton, { onDismiss: state.close }),
3163
3158
  children,
@@ -3539,8 +3534,7 @@ function Option({ item, state }) {
3539
3534
  dataFields["data-focus-visible"] = true;
3540
3535
  }
3541
3536
  React28.useEffect(() => {
3542
- var _a5;
3543
- (_a5 = ref == null ? void 0 : ref.current) == null ? void 0 : _a5.addEventListener(
3537
+ ref?.current?.addEventListener(
3544
3538
  "touchend",
3545
3539
  (event) => {
3546
3540
  event.preventDefault();
@@ -3558,7 +3552,6 @@ var useOptionContext = () => {
3558
3552
  return React28.useContext(OptionContext);
3559
3553
  };
3560
3554
  function ListBoxSection({ section, state }) {
3561
- var _a5, _b4;
3562
3555
  const { itemProps, headingProps, groupProps } = reactAria.useListBoxSection({
3563
3556
  heading: section.rendered,
3564
3557
  "aria-label": section["aria-label"]
@@ -3580,7 +3573,7 @@ function ListBoxSection({ section, state }) {
3580
3573
  children: section.rendered
3581
3574
  }
3582
3575
  ),
3583
- /* @__PURE__ */ jsxRuntime.jsx(List, { ...groupProps, padding: 0, listStyleType: "none", children: [...((_b4 = (_a5 = state.collection).getChildren) == null ? void 0 : _b4.call(_a5, section.key)) ?? []].map(
3576
+ /* @__PURE__ */ jsxRuntime.jsx(List, { ...groupProps, padding: 0, listStyleType: "none", children: [...state.collection.getChildren?.(section.key) ?? []].map(
3584
3577
  (item) => /* @__PURE__ */ jsxRuntime.jsx(Option, { item, state }, item.key)
3585
3578
  ) })
3586
3579
  ] }) });
@@ -3720,7 +3713,6 @@ function coreText(state) {
3720
3713
  }
3721
3714
 
3722
3715
  // src/theme/slot-recipes/native-select.ts
3723
- var _a2, _b;
3724
3716
  var nativeSelectSlotRecipe = react.defineSlotRecipe({
3725
3717
  slots: NativeSelectAnatomy.keys(),
3726
3718
  className: "spor-nativeSelect",
@@ -3759,12 +3751,12 @@ var nativeSelectSlotRecipe = react.defineSlotRecipe({
3759
3751
  variant: {
3760
3752
  core: {
3761
3753
  field: {
3762
- ...(_a2 = inputRecipe.variants) == null ? void 0 : _a2.variant.core
3754
+ ...inputRecipe.variants?.variant.core
3763
3755
  }
3764
3756
  },
3765
3757
  floating: {
3766
3758
  field: {
3767
- ...(_b = inputRecipe.variants) == null ? void 0 : _b.variant.floating
3759
+ ...inputRecipe.variants?.variant.floating
3768
3760
  }
3769
3761
  }
3770
3762
  }
@@ -3907,8 +3899,7 @@ var NumericStepper = React28__namespace.default.forwardRef((props, ref) => {
3907
3899
  });
3908
3900
  const clampedStepSize = Math.max(Math.min(stepSize, 10), 1);
3909
3901
  const focusOnAddButton = () => {
3910
- var _a5;
3911
- (_a5 = addButtonRef.current) == null ? void 0 : _a5.focus();
3902
+ addButtonRef.current?.focus();
3912
3903
  };
3913
3904
  return /* @__PURE__ */ jsxRuntime.jsxs(Field3, { css: styles.root, width: "auto", ...rest, ref, children: [
3914
3905
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -4165,10 +4156,7 @@ var CountryCodeSelect = React28.forwardRef((props, ref) => {
4165
4156
  const { t } = useTranslation();
4166
4157
  if (props.allowedCountryCodes) {
4167
4158
  callingCodes.items = callingCodes.items.filter(
4168
- (callingCode) => {
4169
- var _a5;
4170
- return (_a5 = props.allowedCountryCodes) == null ? void 0 : _a5.some((code) => code === callingCode.label);
4171
- }
4159
+ (callingCode) => props.allowedCountryCodes?.some((code) => code === callingCode.label)
4172
4160
  );
4173
4161
  }
4174
4162
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -4872,8 +4860,7 @@ var icons = {
4872
4860
  walk: { sm: sporIconReact.WalkFill18Icon, md: sporIconReact.WalkFill24Icon, lg: sporIconReact.WalkFill30Icon }
4873
4861
  };
4874
4862
  var getCorrectIcon = ({ variant, size }) => {
4875
- var _a5;
4876
- return ((_a5 = icons[variant]) == null ? void 0 : _a5[size]) ?? react.Box;
4863
+ return icons[variant]?.[size] ?? react.Box;
4877
4864
  };
4878
4865
  var LineIcon = React28.forwardRef(
4879
4866
  function LineIcon2({
@@ -5031,7 +5018,7 @@ var ExternalIcon = ({ label }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fra
5031
5018
  var TextLink = React28.forwardRef(
5032
5019
  ({ children, external, href, ...props }, ref) => {
5033
5020
  const { t } = useTranslation();
5034
- const isExternal = external ?? Boolean((href == null ? void 0 : href.startsWith("http://")) || (href == null ? void 0 : href.startsWith("https://")));
5021
+ const isExternal = external ?? Boolean(href?.startsWith("http://") || href?.startsWith("https://"));
5035
5022
  const externalLabel = t ? t(texts18.externalLink) : texts18.externalLink.en;
5036
5023
  if (props.asChild && React28.isValidElement(children)) {
5037
5024
  return /* @__PURE__ */ jsxRuntime.jsx(react.Link, { href, ...props, ref, children: React28.cloneElement(children, {
@@ -6833,7 +6820,6 @@ var linkRecipe = react.defineRecipe({
6833
6820
  }
6834
6821
  }
6835
6822
  });
6836
- var _a3, _b2;
6837
6823
  var textareaRecipe = react.defineRecipe({
6838
6824
  className: "spor-textarea",
6839
6825
  base: {
@@ -6850,10 +6836,10 @@ var textareaRecipe = react.defineRecipe({
6850
6836
  variants: {
6851
6837
  variant: {
6852
6838
  core: {
6853
- ...(_a3 = inputRecipe.variants) == null ? void 0 : _a3.variant.core
6839
+ ...inputRecipe.variants?.variant.core
6854
6840
  },
6855
6841
  floating: {
6856
- ...(_b2 = inputRecipe.variants) == null ? void 0 : _b2.variant.floating
6842
+ ...inputRecipe.variants?.variant.floating
6857
6843
  }
6858
6844
  }
6859
6845
  }
@@ -8458,7 +8444,6 @@ var travelTagSlotRecipe = react.defineSlotRecipe({
8458
8444
  });
8459
8445
 
8460
8446
  // src/theme/slot-recipes/info-tag.ts
8461
- var _a4, _b3, _c, _d;
8462
8447
  var infoTagSlotRecipe = react.defineSlotRecipe({
8463
8448
  slots: infoTagAnatomy.keys(),
8464
8449
  className: "spor-info-tag",
@@ -8491,21 +8476,21 @@ var infoTagSlotRecipe = react.defineSlotRecipe({
8491
8476
  }
8492
8477
  },
8493
8478
  size: {
8494
- ...(_a4 = travelTagSlotRecipe.variants) == null ? void 0 : _a4.size,
8479
+ ...travelTagSlotRecipe.variants?.size,
8495
8480
  sm: {
8496
- ...(_b3 = travelTagSlotRecipe.variants) == null ? void 0 : _b3.size.sm,
8481
+ ...travelTagSlotRecipe.variants?.size.sm,
8497
8482
  iconContainer: {
8498
8483
  borderRadius: "0.375rem"
8499
8484
  }
8500
8485
  },
8501
8486
  md: {
8502
- ...(_c = travelTagSlotRecipe.variants) == null ? void 0 : _c.size.md,
8487
+ ...travelTagSlotRecipe.variants?.size.md,
8503
8488
  iconContainer: {
8504
8489
  borderRadius: "0.375rem"
8505
8490
  }
8506
8491
  },
8507
8492
  lg: {
8508
- ...(_d = travelTagSlotRecipe.variants) == null ? void 0 : _d.size.lg,
8493
+ ...travelTagSlotRecipe.variants?.size.lg,
8509
8494
  iconContainer: {
8510
8495
  borderRadius: "sm"
8511
8496
  }