@vygruppen/spor-react 12.10.1 → 12.10.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.
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(
@@ -2149,14 +2153,7 @@ var TimeField = ({ state, ...props }) => {
2149
2153
  children: props.label
2150
2154
  }
2151
2155
  ),
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
- )) }),
2156
+ /* @__PURE__ */ jsx(Flex, { ...fieldProps, ref, paddingTop: "3", paddingBottom: "0.5", children: state.segments.map((segment, index) => /* @__PURE__ */ jsx(DateTimeSegment, { segment, state }, index)) }),
2160
2157
  /* @__PURE__ */ jsx(
2161
2158
  "input",
2162
2159
  {
@@ -2843,6 +2840,7 @@ var ListBox = (props) => {
2843
2840
  css: styles.root,
2844
2841
  "aria-busy": loading,
2845
2842
  maxWidth,
2843
+ padding: "1",
2846
2844
  children: [
2847
2845
  state.collection.size === 0 && props.emptyContent,
2848
2846
  [...state.collection].map(
@@ -2900,7 +2898,18 @@ function Option({ item, state }) {
2900
2898
  { passive: false, once: true }
2901
2899
  );
2902
2900
  }, []);
2903
- return /* @__PURE__ */ jsx(OptionContext.Provider, { value: { labelProps, descriptionProps }, children: /* @__PURE__ */ jsx(ListItem, { ...optionProps, ...dataFields, ref, css: styles.item, children: item.rendered }) });
2901
+ return /* @__PURE__ */ jsx(OptionContext.Provider, { value: { labelProps, descriptionProps }, children: /* @__PURE__ */ jsx(
2902
+ ListItem,
2903
+ {
2904
+ ...optionProps,
2905
+ ...dataFields,
2906
+ ref,
2907
+ css: styles.item,
2908
+ padding: "1",
2909
+ marginX: "0",
2910
+ children: item.rendered
2911
+ }
2912
+ ) });
2904
2913
  }
2905
2914
  var OptionContext = React27__default.createContext({
2906
2915
  labelProps: {},
@@ -2917,25 +2926,34 @@ function ListBoxSection({ section, state }) {
2917
2926
  });
2918
2927
  const isFirstSection = section.key === state.collection.getFirstKey();
2919
2928
  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
- ] }) });
2929
+ return /* @__PURE__ */ jsx(List, { children: /* @__PURE__ */ jsxs(
2930
+ ListItem,
2931
+ {
2932
+ ...itemProps,
2933
+ listStyleType: "none",
2934
+ marginLeft: "0",
2935
+ paddingX: "1",
2936
+ children: [
2937
+ section.rendered && /* @__PURE__ */ jsx(
2938
+ Box,
2939
+ {
2940
+ fontSize: "mobile.xs",
2941
+ color: titleColor,
2942
+ paddingTop: 1,
2943
+ marginTop: isFirstSection ? 0 : 2,
2944
+ marginLeft: "1",
2945
+ textTransform: "uppercase",
2946
+ fontWeight: "bold",
2947
+ ...headingProps,
2948
+ children: section.rendered
2949
+ }
2950
+ ),
2951
+ /* @__PURE__ */ jsx(List, { ...groupProps, padding: 0, listStyleType: "none", children: [...((_b4 = (_a5 = state.collection).getChildren) == null ? void 0 : _b4.call(_a5, section.key)) ?? []].map(
2952
+ (item) => /* @__PURE__ */ jsx(Option, { item, state }, item.key)
2953
+ ) })
2954
+ ]
2955
+ }
2956
+ ) });
2939
2957
  }
2940
2958
  var NativeSelect = React27.forwardRef(function NativeSelect2(props, ref) {
2941
2959
  const {
@@ -3327,54 +3345,43 @@ var PhoneNumberInput = forwardRef((props, ref) => {
3327
3345
  nationalNumber: value.nationalNumber
3328
3346
  });
3329
3347
  };
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
- );
3348
+ return /* @__PURE__ */ jsxs(AttachedInputs, { display: "grid", gridTemplateColumns: "1fr 10fr", children: [
3349
+ /* @__PURE__ */ jsx(
3350
+ CountryCodeSelect,
3351
+ {
3352
+ value: [value.countryCode],
3353
+ onValueChange: handleCountryCodeChange,
3354
+ height: "100%",
3355
+ width: "6.25rem",
3356
+ variant,
3357
+ allowedCountryCodes,
3358
+ "data-state": "on",
3359
+ invalid
3360
+ }
3361
+ ),
3362
+ /* @__PURE__ */ jsx(
3363
+ Input,
3364
+ {
3365
+ ref,
3366
+ type: "tel",
3367
+ ...props,
3368
+ value: value.nationalNumber,
3369
+ invalid,
3370
+ errorText,
3371
+ onChange: (e) => {
3372
+ const target = e.target;
3373
+ const strippedValue = target.value.replaceAll(/[^\d\s-]/g, "");
3374
+ onChange({
3375
+ countryCode: value.countryCode,
3376
+ nationalNumber: strippedValue
3377
+ });
3378
+ },
3379
+ variant,
3380
+ "data-state": "on",
3381
+ label
3382
+ }
3383
+ )
3384
+ ] });
3378
3385
  });
3379
3386
  PhoneNumberInput.displayName = "PhoneNumberInput";
3380
3387
  var texts16 = createTexts({
@@ -3612,9 +3619,9 @@ var Switch = forwardRef(
3612
3619
  checked: props.checked,
3613
3620
  css: styles.root,
3614
3621
  children: [
3615
- /* @__PURE__ */ jsx(Switch$1.Label, { children: label }),
3616
3622
  /* @__PURE__ */ jsx(Switch$1.HiddenInput, { ref }),
3617
- /* @__PURE__ */ jsx(Switch$1.Control, { css: styles.control, children: /* @__PURE__ */ jsx(Switch$1.Thumb, {}) })
3623
+ /* @__PURE__ */ jsx(Switch$1.Control, { css: styles.control, children: /* @__PURE__ */ jsx(Switch$1.Thumb, {}) }),
3624
+ /* @__PURE__ */ jsx(Switch$1.Label, { children: label })
3618
3625
  ]
3619
3626
  }
3620
3627
  )
@@ -6678,13 +6685,13 @@ var alertServiceSlotRecipe = defineSlotRecipe({
6678
6685
  textWrap: "nowrap"
6679
6686
  },
6680
6687
  itemBody: {
6681
- paddingInline: 2,
6688
+ marginX: "auto",
6689
+ padding: "0 !important",
6682
6690
  paddingBottom: ["0.5", null, null, "1"],
6683
6691
  color: "text.inverted",
6684
6692
  "& > p": {
6685
6693
  gap: 2,
6686
6694
  width: "full",
6687
- justifyContent: "center",
6688
6695
  borderBottom: "1px dashed",
6689
6696
  borderColor: "outline.inverted",
6690
6697
  paddingBottom: "3",
@@ -9046,29 +9053,20 @@ var selectSlotRecipe = defineSlotRecipe({
9046
9053
  },
9047
9054
  floating: {
9048
9055
  control: {
9049
- backgroundColor: {
9050
- _light: "bg",
9051
- _dark: `color-mix(in srgb, white 10%, var(--spor-colors-bg))`
9052
- },
9053
9056
  outline: "1px solid",
9054
9057
  outlineColor: "floating.outline",
9055
9058
  _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
- }
9059
+ outline: "2px solid",
9060
+ outlineColor: "floating.outline"
9062
9061
  },
9063
9062
  _active: {
9064
- outline: "1px solid",
9065
- outlineColor: "floating.outline.active",
9066
- backgroundColor: "floating.surface.active"
9063
+ backgroundColor: "brand.surface.active"
9064
+ },
9065
+ _disabled: {
9066
+ pointerEvents: "none",
9067
+ color: "text.disabled",
9068
+ backgroundColor: "surface.disabled"
9067
9069
  }
9068
- },
9069
- selectContent: {
9070
- outline: "1px solid",
9071
- outlineColor: "floating.outline"
9072
9070
  }
9073
9071
  }
9074
9072
  },
@@ -9190,7 +9188,7 @@ var switchSlotRecipe = defineSlotRecipe({
9190
9188
  base: {
9191
9189
  root: {
9192
9190
  display: "inline-flex",
9193
- gap: "2.5",
9191
+ gap: "2",
9194
9192
  alignItems: "center",
9195
9193
  position: "relative",
9196
9194
  verticalAlign: "middle",