@vygruppen/spor-react 12.10.1 → 12.10.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.
package/dist/index.mjs CHANGED
@@ -1207,11 +1207,11 @@ var ServiceAlert = forwardRef(
1207
1207
  ]
1208
1208
  }
1209
1209
  ) }),
1210
- /* @__PURE__ */ jsx(Accordion$1.ItemContent, { asChild: true, children: /* @__PURE__ */ jsx(Stack, { flexDirection: "row", justifyContent: "center", width: "100%", children: /* @__PURE__ */ jsx(
1210
+ /* @__PURE__ */ jsx(Accordion$1.ItemContent, { asChild: true, children: /* @__PURE__ */ jsx(Stack, { flexDirection: "row", width: "100%", children: /* @__PURE__ */ jsx(
1211
1211
  Accordion$1.ItemBody,
1212
1212
  {
1213
1213
  as: Stack,
1214
- maxWidth: contentWidth,
1214
+ width: contentWidth,
1215
1215
  css: styles.itemBody,
1216
1216
  children
1217
1217
  }
@@ -1806,7 +1806,11 @@ var DateField = forwardRef(
1806
1806
  css: styles.inputLabel,
1807
1807
  position: "absolute",
1808
1808
  paddingTop: "2px",
1809
- children: /* @__PURE__ */ jsx("label", { ...props.labelProps, children: props.label })
1809
+ children: /* @__PURE__ */ jsxs(Label, { padding: "0", fontSize: "2xs", ...props.labelProps, children: [
1810
+ props.label,
1811
+ " ",
1812
+ /* @__PURE__ */ jsx(Field.RequiredIndicator, {})
1813
+ ] })
1810
1814
  }
1811
1815
  ),
1812
1816
  /* @__PURE__ */ jsx(Flex, { ...fieldProps, ref, paddingTop: "3", paddingBottom: "0.5", children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(
@@ -2142,21 +2146,21 @@ var TimeField = ({ state, ...props }) => {
2142
2146
  style: {
2143
2147
  marginBottom: 0,
2144
2148
  fontSize: "mobile.xs",
2149
+ top: 0,
2145
2150
  cursor: "text",
2151
+ left: "50%",
2152
+ transform: "translateX(-50%)",
2146
2153
  position: "absolute",
2147
- paddingTop: "2px"
2154
+ paddingTop: "2px",
2155
+ whiteSpace: "nowrap",
2156
+ overflow: "hidden",
2157
+ textOverflow: "ellipsis",
2158
+ maxWidth: "80%"
2148
2159
  },
2149
2160
  children: props.label
2150
2161
  }
2151
2162
  ),
2152
- /* @__PURE__ */ jsx(Flex, { ...fieldProps, ref, paddingTop: "3", paddingBottom: "0.5", children: state.segments.map((segment) => /* @__PURE__ */ jsx(
2153
- DateTimeSegment,
2154
- {
2155
- segment,
2156
- state
2157
- },
2158
- JSON.stringify(segment)
2159
- )) }),
2163
+ /* @__PURE__ */ jsx(Flex, { ...fieldProps, ref, paddingTop: "3", paddingBottom: "0.5", children: state.segments.map((segment, index) => /* @__PURE__ */ jsx(DateTimeSegment, { segment, state }, index)) }),
2160
2164
  /* @__PURE__ */ jsx(
2161
2165
  "input",
2162
2166
  {
@@ -2238,6 +2242,7 @@ var TimePicker = ({
2238
2242
  "aria-disabled": isDisabled,
2239
2243
  "aria-live": "assertive",
2240
2244
  "aria-label": ariaLabel,
2245
+ position: "relative",
2241
2246
  ...boxProps,
2242
2247
  children: [
2243
2248
  /* @__PURE__ */ jsx(
@@ -2251,7 +2256,8 @@ var TimePicker = ({
2251
2256
  icon: /* @__PURE__ */ jsx(DropdownLeftFill18Icon, {}),
2252
2257
  onClick: handleBackwardsClick,
2253
2258
  disabled: isDisabled,
2254
- style: isDisabled ? { backgroundColor: "transparent" } : {}
2259
+ style: isDisabled ? { backgroundColor: "transparent" } : {},
2260
+ zIndex: 1
2255
2261
  }
2256
2262
  ),
2257
2263
  /* @__PURE__ */ jsx(TimeField, { label, state, name }),
@@ -2266,7 +2272,8 @@ var TimePicker = ({
2266
2272
  icon: /* @__PURE__ */ jsx(DropdownRightFill18Icon, {}),
2267
2273
  onClick: handleForwardClick,
2268
2274
  disabled: isDisabled,
2269
- style: isDisabled ? { backgroundColor: "transparent" } : {}
2275
+ style: isDisabled ? { backgroundColor: "transparent" } : {},
2276
+ zIndex: 1
2270
2277
  }
2271
2278
  )
2272
2279
  ]
@@ -2385,11 +2392,11 @@ var DrawerBackTrigger = forwardRef((props, ref) => {
2385
2392
  });
2386
2393
  DrawerBackTrigger.displayName = "DrawerBackTrigger";
2387
2394
  var DrawerFullScreenHeader = forwardRef((props, ref) => {
2388
- const { backTrigger = true, title } = props;
2395
+ const { backTrigger = true, closeTrigger = true, title } = props;
2389
2396
  return /* @__PURE__ */ jsx(Drawer$1.Header, { ...props, ref, asChild: true, children: /* @__PURE__ */ jsxs(Grid, { templateColumns: "1fr auto 1fr", height: "auto", paddingX: "8", children: [
2390
2397
  /* @__PURE__ */ jsx(GridItem, { width: "full", alignSelf: "center", children: backTrigger && /* @__PURE__ */ jsx(DrawerBackTrigger, {}) }),
2391
2398
  /* @__PURE__ */ jsx(GridItem, { width: "full", alignSelf: "end", asChild: true, children: title && /* @__PURE__ */ jsx(DrawerTitle, { children: title }) }),
2392
- /* @__PURE__ */ jsx(GridItem, { width: "full", alignSelf: "end", children: /* @__PURE__ */ jsx(DrawerCloseTrigger, { justifySelf: "end", top: "0" }) })
2399
+ closeTrigger && /* @__PURE__ */ jsx(GridItem, { width: "full", alignSelf: "end", children: /* @__PURE__ */ jsx(DrawerCloseTrigger, { justifySelf: "end", top: "0" }) })
2393
2400
  ] }) });
2394
2401
  });
2395
2402
  DrawerFullScreenHeader.displayName = "DrawerFullScreenHeader";
@@ -2843,6 +2850,7 @@ var ListBox = (props) => {
2843
2850
  css: styles.root,
2844
2851
  "aria-busy": loading,
2845
2852
  maxWidth,
2853
+ padding: "1",
2846
2854
  children: [
2847
2855
  state.collection.size === 0 && props.emptyContent,
2848
2856
  [...state.collection].map(
@@ -2900,7 +2908,18 @@ function Option({ item, state }) {
2900
2908
  { passive: false, once: true }
2901
2909
  );
2902
2910
  }, []);
2903
- return /* @__PURE__ */ jsx(OptionContext.Provider, { value: { labelProps, descriptionProps }, children: /* @__PURE__ */ jsx(ListItem, { ...optionProps, ...dataFields, ref, css: styles.item, children: item.rendered }) });
2911
+ return /* @__PURE__ */ jsx(OptionContext.Provider, { value: { labelProps, descriptionProps }, children: /* @__PURE__ */ jsx(
2912
+ ListItem,
2913
+ {
2914
+ ...optionProps,
2915
+ ...dataFields,
2916
+ ref,
2917
+ css: styles.item,
2918
+ padding: "1",
2919
+ marginX: "0",
2920
+ children: item.rendered
2921
+ }
2922
+ ) });
2904
2923
  }
2905
2924
  var OptionContext = React27__default.createContext({
2906
2925
  labelProps: {},
@@ -2917,25 +2936,34 @@ function ListBoxSection({ section, state }) {
2917
2936
  });
2918
2937
  const isFirstSection = section.key === state.collection.getFirstKey();
2919
2938
  const titleColor = useColorModeValue("darkGrey", "white");
2920
- return /* @__PURE__ */ jsx(List, { children: /* @__PURE__ */ jsxs(ListItem, { ...itemProps, listStyleType: "none", children: [
2921
- section.rendered && /* @__PURE__ */ jsx(
2922
- Box,
2923
- {
2924
- fontSize: "mobile.xs",
2925
- color: titleColor,
2926
- paddingX: 3,
2927
- paddingTop: 1,
2928
- marginTop: isFirstSection ? 0 : 2,
2929
- textTransform: "uppercase",
2930
- fontWeight: "bold",
2931
- ...headingProps,
2932
- children: section.rendered
2933
- }
2934
- ),
2935
- /* @__PURE__ */ jsx(List, { ...groupProps, padding: 0, listStyleType: "none", children: [...((_b4 = (_a5 = state.collection).getChildren) == null ? void 0 : _b4.call(_a5, section.key)) ?? []].map(
2936
- (item) => /* @__PURE__ */ jsx(Option, { item, state }, item.key)
2937
- ) })
2938
- ] }) });
2939
+ return /* @__PURE__ */ jsx(List, { children: /* @__PURE__ */ jsxs(
2940
+ ListItem,
2941
+ {
2942
+ ...itemProps,
2943
+ listStyleType: "none",
2944
+ marginLeft: "0",
2945
+ paddingX: "1",
2946
+ children: [
2947
+ section.rendered && /* @__PURE__ */ jsx(
2948
+ Box,
2949
+ {
2950
+ fontSize: "mobile.xs",
2951
+ color: titleColor,
2952
+ paddingTop: 1,
2953
+ marginTop: isFirstSection ? 0 : 2,
2954
+ marginLeft: "1",
2955
+ textTransform: "uppercase",
2956
+ fontWeight: "bold",
2957
+ ...headingProps,
2958
+ children: section.rendered
2959
+ }
2960
+ ),
2961
+ /* @__PURE__ */ jsx(List, { ...groupProps, padding: 0, listStyleType: "none", children: [...((_b4 = (_a5 = state.collection).getChildren) == null ? void 0 : _b4.call(_a5, section.key)) ?? []].map(
2962
+ (item) => /* @__PURE__ */ jsx(Option, { item, state }, item.key)
2963
+ ) })
2964
+ ]
2965
+ }
2966
+ ) });
2939
2967
  }
2940
2968
  var NativeSelect = React27.forwardRef(function NativeSelect2(props, ref) {
2941
2969
  const {
@@ -3327,54 +3355,43 @@ var PhoneNumberInput = forwardRef((props, ref) => {
3327
3355
  nationalNumber: value.nationalNumber
3328
3356
  });
3329
3357
  };
3330
- return /* @__PURE__ */ jsx(
3331
- AttachedInputs,
3332
- {
3333
- border: invalid ? "1px solid" : "none",
3334
- borderColor: invalid ? "outline.error" : "none",
3335
- outline: invalid ? "1px solid" : "none",
3336
- outlineColor: invalid ? "outline.error" : "none",
3337
- borderRadius: invalid ? "sm" : "none",
3338
- display: "grid",
3339
- gridTemplateColumns: "1fr 10fr",
3340
- children: /* @__PURE__ */ jsxs(Fragment, { children: [
3341
- /* @__PURE__ */ jsx(
3342
- CountryCodeSelect,
3343
- {
3344
- value: [value.countryCode],
3345
- onValueChange: handleCountryCodeChange,
3346
- height: "100%",
3347
- width: "6.25rem",
3348
- variant,
3349
- allowedCountryCodes,
3350
- "data-state": "on"
3351
- }
3352
- ),
3353
- /* @__PURE__ */ jsx(
3354
- Input,
3355
- {
3356
- ref,
3357
- type: "tel",
3358
- ...props,
3359
- value: value.nationalNumber,
3360
- invalid,
3361
- errorText,
3362
- onChange: (e) => {
3363
- const target = e.target;
3364
- const strippedValue = target.value.replaceAll(/[^\d\s-]/g, "");
3365
- onChange({
3366
- countryCode: value.countryCode,
3367
- nationalNumber: strippedValue
3368
- });
3369
- },
3370
- variant,
3371
- "data-state": "on",
3372
- label
3373
- }
3374
- )
3375
- ] })
3376
- }
3377
- );
3358
+ return /* @__PURE__ */ jsxs(AttachedInputs, { display: "grid", gridTemplateColumns: "1fr 10fr", children: [
3359
+ /* @__PURE__ */ jsx(
3360
+ CountryCodeSelect,
3361
+ {
3362
+ value: [value.countryCode],
3363
+ onValueChange: handleCountryCodeChange,
3364
+ height: "100%",
3365
+ width: "6.25rem",
3366
+ variant,
3367
+ allowedCountryCodes,
3368
+ "data-state": "on",
3369
+ invalid
3370
+ }
3371
+ ),
3372
+ /* @__PURE__ */ jsx(
3373
+ Input,
3374
+ {
3375
+ ref,
3376
+ type: "tel",
3377
+ ...props,
3378
+ value: value.nationalNumber,
3379
+ invalid,
3380
+ errorText,
3381
+ onChange: (e) => {
3382
+ const target = e.target;
3383
+ const strippedValue = target.value.replaceAll(/[^\d\s-]/g, "");
3384
+ onChange({
3385
+ countryCode: value.countryCode,
3386
+ nationalNumber: strippedValue
3387
+ });
3388
+ },
3389
+ variant,
3390
+ "data-state": "on",
3391
+ label
3392
+ }
3393
+ )
3394
+ ] });
3378
3395
  });
3379
3396
  PhoneNumberInput.displayName = "PhoneNumberInput";
3380
3397
  var texts16 = createTexts({
@@ -3612,9 +3629,9 @@ var Switch = forwardRef(
3612
3629
  checked: props.checked,
3613
3630
  css: styles.root,
3614
3631
  children: [
3615
- /* @__PURE__ */ jsx(Switch$1.Label, { children: label }),
3616
3632
  /* @__PURE__ */ jsx(Switch$1.HiddenInput, { ref }),
3617
- /* @__PURE__ */ jsx(Switch$1.Control, { css: styles.control, children: /* @__PURE__ */ jsx(Switch$1.Thumb, {}) })
3633
+ /* @__PURE__ */ jsx(Switch$1.Control, { css: styles.control, children: /* @__PURE__ */ jsx(Switch$1.Thumb, {}) }),
3634
+ /* @__PURE__ */ jsx(Switch$1.Label, { children: label })
3618
3635
  ]
3619
3636
  }
3620
3637
  )
@@ -3680,16 +3697,9 @@ var PressableCard = forwardRef(
3680
3697
  PressableCard.displayName = "PressableCard";
3681
3698
  var RadioCard = forwardRef(
3682
3699
  (props, ref) => {
3683
- const { inputProps, children, value, ariaLabel } = props;
3700
+ const { inputProps, children } = props;
3684
3701
  return /* @__PURE__ */ jsxs(RadioCard$1.Item, { ...props, children: [
3685
- /* @__PURE__ */ jsx(
3686
- RadioCard$1.ItemHiddenInput,
3687
- {
3688
- "aria-label": ariaLabel ?? value,
3689
- ref,
3690
- ...inputProps
3691
- }
3692
- ),
3702
+ /* @__PURE__ */ jsx(RadioCard$1.ItemHiddenInput, { ref, ...inputProps }),
3693
3703
  /* @__PURE__ */ jsx(RadioCard$1.ItemControl, { children })
3694
3704
  ] });
3695
3705
  }
@@ -3976,18 +3986,42 @@ var TextLink = forwardRef(
3976
3986
  const isExternal = external ?? Boolean((href == null ? void 0 : href.startsWith("http://")) || (href == null ? void 0 : href.startsWith("https://")));
3977
3987
  const externalLabel = t ? t(texts18.externalLink) : texts18.externalLink.en;
3978
3988
  if (props.asChild && isValidElement(children)) {
3979
- return /* @__PURE__ */ jsx(Link, { href, ...props, ref, children: cloneElement(children, {
3980
- ...children.props,
3981
- children: /* @__PURE__ */ jsxs(Fragment, { children: [
3982
- children.props.children,
3983
- isExternal && /* @__PURE__ */ jsx(ExternalIcon, { label: externalLabel, size: props.size })
3984
- ] })
3985
- }) });
3989
+ return /* @__PURE__ */ jsx(
3990
+ Link,
3991
+ {
3992
+ href,
3993
+ ...props,
3994
+ ref,
3995
+ ...isExternal && {
3996
+ target: "_blank",
3997
+ rel: "noopener noreferrer"
3998
+ },
3999
+ children: cloneElement(children, {
4000
+ ...children.props,
4001
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
4002
+ children.props.children,
4003
+ isExternal && /* @__PURE__ */ jsx(ExternalIcon, { label: externalLabel, size: props.size })
4004
+ ] })
4005
+ })
4006
+ }
4007
+ );
3986
4008
  }
3987
- return /* @__PURE__ */ jsxs(Link, { href, ...props, ref, children: [
3988
- children,
3989
- isExternal && /* @__PURE__ */ jsx(ExternalIcon, { label: externalLabel, size: props.size })
3990
- ] });
4009
+ return /* @__PURE__ */ jsxs(
4010
+ Link,
4011
+ {
4012
+ href,
4013
+ ...props,
4014
+ ref,
4015
+ ...isExternal && {
4016
+ target: "_blank",
4017
+ rel: "noopener noreferrer"
4018
+ },
4019
+ children: [
4020
+ children,
4021
+ isExternal && /* @__PURE__ */ jsx(ExternalIcon, { label: externalLabel, size: props.size })
4022
+ ]
4023
+ }
4024
+ );
3991
4025
  }
3992
4026
  );
3993
4027
  TextLink.displayName = "TextLink";
@@ -6678,13 +6712,13 @@ var alertServiceSlotRecipe = defineSlotRecipe({
6678
6712
  textWrap: "nowrap"
6679
6713
  },
6680
6714
  itemBody: {
6681
- paddingInline: 2,
6715
+ marginX: "auto",
6716
+ padding: "0 !important",
6682
6717
  paddingBottom: ["0.5", null, null, "1"],
6683
6718
  color: "text.inverted",
6684
6719
  "& > p": {
6685
6720
  gap: 2,
6686
6721
  width: "full",
6687
- justifyContent: "center",
6688
6722
  borderBottom: "1px dashed",
6689
6723
  borderColor: "outline.inverted",
6690
6724
  paddingBottom: "3",
@@ -7478,7 +7512,7 @@ var drawerSlotRecipe = defineSlotRecipe({
7478
7512
  maxHeight: "100dvh",
7479
7513
  color: "inherit",
7480
7514
  boxShadow: "lg",
7481
- minHeight: ["50vh", null, null, "auto"],
7515
+ minHeight: ["10rem", null, null, "auto"],
7482
7516
  _open: {
7483
7517
  animationDuration: "slowest",
7484
7518
  animationTimingFunction: "ease-in-smooth"
@@ -7492,16 +7526,16 @@ var drawerSlotRecipe = defineSlotRecipe({
7492
7526
  display: "flex",
7493
7527
  alignItems: "center",
7494
7528
  justifyContent: "space-between",
7495
- paddingX: "5",
7529
+ paddingX: ["3", null, null, "5"],
7496
7530
  paddingBottom: "1"
7497
7531
  },
7498
7532
  body: {
7499
- paddingX: "5",
7533
+ paddingX: ["3", null, null, "5"],
7500
7534
  paddingY: ["1", null, null, "2"],
7501
7535
  flex: "1",
7502
7536
  overflow: "auto",
7503
7537
  fontSize: ["xs", null, null, "sm"],
7504
- minHeight: ["12", null, null, "auto"]
7538
+ minHeight: ["2", null, null, "auto"]
7505
7539
  },
7506
7540
  footer: {
7507
7541
  display: "flex",
@@ -7518,8 +7552,8 @@ var drawerSlotRecipe = defineSlotRecipe({
7518
7552
  },
7519
7553
  closeTrigger: {
7520
7554
  position: "absolute",
7521
- top: "2",
7522
- insetEnd: "2"
7555
+ top: "0",
7556
+ right: "0"
7523
7557
  }
7524
7558
  },
7525
7559
  variants: {
@@ -9046,29 +9080,20 @@ var selectSlotRecipe = defineSlotRecipe({
9046
9080
  },
9047
9081
  floating: {
9048
9082
  control: {
9049
- backgroundColor: {
9050
- _light: "bg",
9051
- _dark: `color-mix(in srgb, white 10%, var(--spor-colors-bg))`
9052
- },
9053
9083
  outline: "1px solid",
9054
9084
  outlineColor: "floating.outline",
9055
9085
  _hover: {
9056
- outline: "1px solid",
9057
- outlineColor: "floating.outline.hover",
9058
- backgroundColor: {
9059
- _light: "floating.surface.hover",
9060
- _dark: `color-mix(in srgb, white 10%, var(--spor-colors-bg))`
9061
- }
9086
+ outline: "2px solid",
9087
+ outlineColor: "floating.outline"
9062
9088
  },
9063
9089
  _active: {
9064
- outline: "1px solid",
9065
- outlineColor: "floating.outline.active",
9066
- backgroundColor: "floating.surface.active"
9090
+ backgroundColor: "brand.surface.active"
9091
+ },
9092
+ _disabled: {
9093
+ pointerEvents: "none",
9094
+ color: "text.disabled",
9095
+ backgroundColor: "surface.disabled"
9067
9096
  }
9068
- },
9069
- selectContent: {
9070
- outline: "1px solid",
9071
- outlineColor: "floating.outline"
9072
9097
  }
9073
9098
  }
9074
9099
  },
@@ -9190,7 +9215,7 @@ var switchSlotRecipe = defineSlotRecipe({
9190
9215
  base: {
9191
9216
  root: {
9192
9217
  display: "inline-flex",
9193
- gap: "2.5",
9218
+ gap: "2",
9194
9219
  alignItems: "center",
9195
9220
  position: "relative",
9196
9221
  verticalAlign: "middle",