@vygruppen/spor-react 13.7.1 → 13.8.0

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.d.cts CHANGED
@@ -3925,37 +3925,31 @@ declare const tabsSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "in
3925
3925
  list: {
3926
3926
  color: "text.core";
3927
3927
  border: "sm";
3928
+ borderColor: "outline";
3928
3929
  };
3929
3930
  trigger: {
3930
3931
  color: "text.core";
3931
3932
  border: "md";
3932
3933
  borderColor: "transparent";
3933
- _hover: {
3934
- outline: "2px solid";
3935
- outlineColor: "outline.core.hover";
3936
- outlineOffset: "-2px";
3937
- };
3938
- _active: {
3939
- backgroundColor: "surface.brand.active";
3940
- color: "text.brand";
3941
- outline: "none";
3942
- };
3943
- _selected: {
3944
- backgroundColor: "surface.brand";
3945
- color: "text.brand";
3934
+ "&:not([data-selected])": {
3946
3935
  _hover: {
3947
- outline: "none";
3936
+ backgroundColor: "surface.ghost.hover";
3937
+ _active: {
3938
+ backgroundColor: "surface.ghost.active";
3939
+ outline: "none";
3940
+ outlineColor: "transparent";
3941
+ };
3948
3942
  };
3949
3943
  };
3950
- _disabled: {
3951
- backgroundColor: "surface.disabled";
3952
- color: "surface.disabled";
3953
- };
3944
+ };
3945
+ _disabled: {
3946
+ backgroundColor: "surface.disabled";
3947
+ color: "surface.disabled";
3954
3948
  };
3955
3949
  };
3956
3950
  accent: {
3957
3951
  list: {
3958
- backgroundColor: "bg.accent";
3952
+ backgroundColor: "surface.accent";
3959
3953
  color: "text.accent";
3960
3954
  };
3961
3955
  trigger: {
@@ -3964,23 +3958,18 @@ declare const tabsSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "in
3964
3958
  backgroundColor: "surface.disabled";
3965
3959
  color: "icon.disabled";
3966
3960
  };
3967
- _hover: {
3968
- backgroundColor: "surface.accent.hover";
3969
- _active: {
3970
- backgroundColor: "surface.brand.active";
3971
- color: "text.brand";
3972
- };
3973
- };
3974
- _selected: {
3975
- backgroundColor: "surface.brand";
3976
- color: "text.brand";
3961
+ "&:not([data-selected])": {
3977
3962
  _hover: {
3978
- backgroundColor: "surface.brand.hover";
3979
- color: "text.brand";
3980
- outline: "none";
3963
+ backgroundColor: "surface.accent.hover";
3964
+ _active: {
3965
+ backgroundColor: "surface.accent.active";
3966
+ };
3981
3967
  };
3982
3968
  };
3983
3969
  };
3970
+ indicator: {
3971
+ backgroundColor: "surface.brand";
3972
+ };
3984
3973
  };
3985
3974
  };
3986
3975
  size: {
@@ -3993,6 +3982,9 @@ declare const tabsSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "in
3993
3982
  paddingX: number;
3994
3983
  paddingY: number;
3995
3984
  };
3985
+ indicator: {
3986
+ top: "1px";
3987
+ };
3996
3988
  };
3997
3989
  sm: {
3998
3990
  list: {
@@ -4022,10 +4014,6 @@ declare const tabsSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "in
4022
4014
  fontWeight: "bold";
4023
4015
  fontSize: "sm";
4024
4016
  paddingX: number;
4025
- _focus: {
4026
- border: "md";
4027
- borderColor: "surface.accent";
4028
- };
4029
4017
  };
4030
4018
  };
4031
4019
  };
package/dist/index.d.ts CHANGED
@@ -3925,37 +3925,31 @@ declare const tabsSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "in
3925
3925
  list: {
3926
3926
  color: "text.core";
3927
3927
  border: "sm";
3928
+ borderColor: "outline";
3928
3929
  };
3929
3930
  trigger: {
3930
3931
  color: "text.core";
3931
3932
  border: "md";
3932
3933
  borderColor: "transparent";
3933
- _hover: {
3934
- outline: "2px solid";
3935
- outlineColor: "outline.core.hover";
3936
- outlineOffset: "-2px";
3937
- };
3938
- _active: {
3939
- backgroundColor: "surface.brand.active";
3940
- color: "text.brand";
3941
- outline: "none";
3942
- };
3943
- _selected: {
3944
- backgroundColor: "surface.brand";
3945
- color: "text.brand";
3934
+ "&:not([data-selected])": {
3946
3935
  _hover: {
3947
- outline: "none";
3936
+ backgroundColor: "surface.ghost.hover";
3937
+ _active: {
3938
+ backgroundColor: "surface.ghost.active";
3939
+ outline: "none";
3940
+ outlineColor: "transparent";
3941
+ };
3948
3942
  };
3949
3943
  };
3950
- _disabled: {
3951
- backgroundColor: "surface.disabled";
3952
- color: "surface.disabled";
3953
- };
3944
+ };
3945
+ _disabled: {
3946
+ backgroundColor: "surface.disabled";
3947
+ color: "surface.disabled";
3954
3948
  };
3955
3949
  };
3956
3950
  accent: {
3957
3951
  list: {
3958
- backgroundColor: "bg.accent";
3952
+ backgroundColor: "surface.accent";
3959
3953
  color: "text.accent";
3960
3954
  };
3961
3955
  trigger: {
@@ -3964,23 +3958,18 @@ declare const tabsSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "in
3964
3958
  backgroundColor: "surface.disabled";
3965
3959
  color: "icon.disabled";
3966
3960
  };
3967
- _hover: {
3968
- backgroundColor: "surface.accent.hover";
3969
- _active: {
3970
- backgroundColor: "surface.brand.active";
3971
- color: "text.brand";
3972
- };
3973
- };
3974
- _selected: {
3975
- backgroundColor: "surface.brand";
3976
- color: "text.brand";
3961
+ "&:not([data-selected])": {
3977
3962
  _hover: {
3978
- backgroundColor: "surface.brand.hover";
3979
- color: "text.brand";
3980
- outline: "none";
3963
+ backgroundColor: "surface.accent.hover";
3964
+ _active: {
3965
+ backgroundColor: "surface.accent.active";
3966
+ };
3981
3967
  };
3982
3968
  };
3983
3969
  };
3970
+ indicator: {
3971
+ backgroundColor: "surface.brand";
3972
+ };
3984
3973
  };
3985
3974
  };
3986
3975
  size: {
@@ -3993,6 +3982,9 @@ declare const tabsSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "in
3993
3982
  paddingX: number;
3994
3983
  paddingY: number;
3995
3984
  };
3985
+ indicator: {
3986
+ top: "1px";
3987
+ };
3996
3988
  };
3997
3989
  sm: {
3998
3990
  list: {
@@ -4022,10 +4014,6 @@ declare const tabsSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "in
4022
4014
  fontWeight: "bold";
4023
4015
  fontSize: "sm";
4024
4016
  paddingX: number;
4025
- _focus: {
4026
- border: "md";
4027
- borderColor: "surface.accent";
4028
- };
4029
4017
  };
4030
4018
  };
4031
4019
  };
package/dist/index.mjs CHANGED
@@ -1576,11 +1576,11 @@ var RadioCard = ({
1576
1576
  showIndicator = false,
1577
1577
  ...props
1578
1578
  }) => {
1579
- const { inputProps, children } = props;
1579
+ const { inputProps, children, invalid } = props;
1580
1580
  const uniqueId = useId();
1581
1581
  const itemControlId = `radio-card-item-control-${uniqueId}`;
1582
1582
  const inputHasAriaLabel = (inputProps == null ? void 0 : inputProps["aria-labelledby"]) || (inputProps == null ? void 0 : inputProps["aria-label"]);
1583
- return /* @__PURE__ */ jsxs(RadioCard$1.Item, { ...props, children: [
1583
+ return /* @__PURE__ */ jsxs(RadioCard$1.Item, { ...props, "aria-invalid": invalid, children: [
1584
1584
  /* @__PURE__ */ jsx(
1585
1585
  RadioCard$1.ItemHiddenInput,
1586
1586
  {
@@ -1591,7 +1591,7 @@ var RadioCard = ({
1591
1591
  ),
1592
1592
  /* @__PURE__ */ jsxs(RadioCard$1.ItemControl, { id: itemControlId, "aria-hidden": true, children: [
1593
1593
  showIndicator && /* @__PURE__ */ jsx(RadioCard$1.ItemIndicator, {}),
1594
- /* @__PURE__ */ jsx(Flex, { direction: "column", children })
1594
+ /* @__PURE__ */ jsx(Flex, { direction: "column", width: "100%", children })
1595
1595
  ] })
1596
1596
  ] });
1597
1597
  };
@@ -5010,8 +5010,8 @@ var Radio = ({
5010
5010
  ref,
5011
5011
  ...props
5012
5012
  }) => {
5013
- const { children, inputProps, rootRef, ...rest } = props;
5014
- return /* @__PURE__ */ jsxs(RadioGroup$1.Item, { ref: rootRef, ...rest, children: [
5013
+ const { children, inputProps, rootRef, invalid, ...rest } = props;
5014
+ return /* @__PURE__ */ jsxs(RadioGroup$1.Item, { ref: rootRef, ...rest, "aria-invalid": invalid, children: [
5015
5015
  /* @__PURE__ */ jsx(RadioGroup$1.ItemHiddenInput, { ref, ...inputProps }),
5016
5016
  /* @__PURE__ */ jsx(RadioGroup$1.ItemIndicator, {}),
5017
5017
  children && /* @__PURE__ */ jsx(RadioGroup$1.ItemText, { children })
@@ -5131,7 +5131,7 @@ var SelectItem = ({
5131
5131
  const multiple = selectContext.multiple;
5132
5132
  const isSelected = selectContext.value.includes(item.value);
5133
5133
  return /* @__PURE__ */ jsxs(Select$1.Item, { item, ...rest, ref, children: [
5134
- multiple && /* @__PURE__ */ jsx(Checkbox$1.Root, { checked: isSelected, pointerEvents: "none", children: /* @__PURE__ */ jsx(Checkbox$1.Control, { children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, {}) }) }),
5134
+ multiple && /* @__PURE__ */ jsx(Checkbox$1.Root, { checked: isSelected, pointerEvents: "none", children: /* @__PURE__ */ jsx(Checkbox$1.Control, { children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, { marginLeft: "1px" }) }) }),
5135
5135
  /* @__PURE__ */ jsxs(Box, { width: "100%", children: [
5136
5136
  /* @__PURE__ */ jsx(Select$1.ItemText, { display: "flex", children }),
5137
5137
  description && /* @__PURE__ */ jsx(Box, { "data-part": "item-description", children: description })
@@ -11259,6 +11259,18 @@ var radioGroupSlotRecipe = defineSlotRecipe({
11259
11259
  backgroundColor: "outline.disabled"
11260
11260
  }
11261
11261
  },
11262
+ _invalid: {
11263
+ borderColor: "outline.error",
11264
+ "& .dot": {
11265
+ backgroundColor: "outline.error"
11266
+ },
11267
+ _hover: {
11268
+ borderColor: "outline.error",
11269
+ "& .dot": {
11270
+ backgroundColor: "outline.error"
11271
+ }
11272
+ }
11273
+ },
11262
11274
  _focusVisible: {
11263
11275
  outlineWidth: "2px",
11264
11276
  outlineColor: "outline.focus",
@@ -11308,6 +11320,25 @@ var radioCardSlotRecipe = defineSlotRecipe({
11308
11320
  pointerEvents: "none",
11309
11321
  background: "surface.disabled",
11310
11322
  color: "text.disabled"
11323
+ },
11324
+ _invalid: {
11325
+ outlineColor: "outline.error",
11326
+ "& .dot": {
11327
+ backgroundColor: "outline.error"
11328
+ },
11329
+ _hover: {
11330
+ outlineColor: "outline.error",
11331
+ "& .dot": {
11332
+ backgroundColor: "outline.error"
11333
+ },
11334
+ _active: {
11335
+ backgroundColor: "surface.critical"
11336
+ }
11337
+ },
11338
+ _checked: {
11339
+ outlineColor: "outline.error",
11340
+ backgroundColor: "surface.critical"
11341
+ }
11311
11342
  }
11312
11343
  },
11313
11344
  label: {
@@ -11523,10 +11554,9 @@ var selectSlotRecipe = defineSlotRecipe({
11523
11554
  }
11524
11555
  },
11525
11556
  item: {
11526
- paddingX: 2,
11527
- paddingY: 2,
11528
- marginY: 1,
11529
- marginX: 1,
11557
+ px: 2,
11558
+ py: 1,
11559
+ margin: 1,
11530
11560
  display: "flex",
11531
11561
  alignItems: "center",
11532
11562
  justifyContent: "space-between",
@@ -11535,38 +11565,28 @@ var selectSlotRecipe = defineSlotRecipe({
11535
11565
  color: "text.ghost",
11536
11566
  cursor: "pointer",
11537
11567
  outline: "none",
11538
- "&[data-highlighted]:hover": {
11539
- outlineOffset: "2px",
11540
- outline: "2px solid",
11541
- outlineColor: "outline.focus",
11542
- backgroundColor: "surface.accent.hover"
11543
- },
11544
- "&[data-highlighted]": {
11545
- outlineOffset: "2px",
11546
- outline: "2px solid",
11547
- outlineColor: "outline.focus"
11548
- },
11549
- _active: {
11550
- backgroundColor: "surface.accent.active"
11551
- },
11552
- _highlighted: {
11568
+ _hover: {
11569
+ backgroundColor: "surface.accent.hover",
11553
11570
  _active: {
11554
- color: "text"
11571
+ backgroundColor: "surface.accent.active"
11555
11572
  }
11556
11573
  },
11557
- _hover: {
11558
- backgroundColor: "surface.accent.hover"
11559
- },
11560
11574
  _selected: {
11561
11575
  backgroundColor: "surface.accent"
11562
11576
  },
11577
+ _highlighted: {
11578
+ backgroundColor: "surface.ghost.active",
11579
+ _selected: {
11580
+ backgroundColor: "surface.accent"
11581
+ }
11582
+ },
11563
11583
  _icon: {
11564
11584
  width: 3,
11565
11585
  height: 3
11566
11586
  },
11567
11587
  "& [data-part='item-description']": {
11568
11588
  fontSize: ["mobile.xs", "desktop.xs"],
11569
- color: "text.ghost"
11589
+ color: "text.subtle"
11570
11590
  }
11571
11591
  },
11572
11592
  control: {
@@ -11691,9 +11711,7 @@ var selectSlotRecipe = defineSlotRecipe({
11691
11711
  }
11692
11712
  },
11693
11713
  item: {
11694
- paddingX: 2,
11695
- paddingY: 1,
11696
- fontSize: "xs",
11714
+ fontSize: ["mobile.xs", "desktop.xs"],
11697
11715
  "& [data-part='item-description']": {
11698
11716
  fontSize: ["mobile.2xs", "desktop.2xs"]
11699
11717
  }
@@ -12163,7 +12181,9 @@ var tabsSlotRecipe = defineSlotRecipe({
12163
12181
  alignItems: "center",
12164
12182
  gap: 0.5,
12165
12183
  borderRadius: "xl",
12166
- width: "fit-content"
12184
+ width: "fit-content",
12185
+ position: "relative",
12186
+ overflow: "hidden"
12167
12187
  },
12168
12188
  trigger: {
12169
12189
  display: "flex",
@@ -12174,7 +12194,32 @@ var tabsSlotRecipe = defineSlotRecipe({
12174
12194
  transitionDuration: "normal",
12175
12195
  height: "100%",
12176
12196
  whiteSpace: "nowrap",
12177
- borderRadius: "xl"
12197
+ borderRadius: "xl",
12198
+ position: "relative",
12199
+ ".spor-tabs__list:has(.spor-tabs__indicator) &": {
12200
+ transition: "color 0.2s ease"
12201
+ },
12202
+ _selected: {
12203
+ color: "text.brand",
12204
+ // @ts-expect-error — valid CSS selector, not recognized by Chakra's types
12205
+ ".spor-tabs__list:not(:has(.spor-tabs__indicator)) &[data-selected]": {
12206
+ backgroundColor: "surface.brand",
12207
+ _hover: {
12208
+ backgroundColor: "surface.brand"
12209
+ }
12210
+ }
12211
+ }
12212
+ },
12213
+ indicator: {
12214
+ position: "absolute",
12215
+ top: "2.5px",
12216
+ left: 0,
12217
+ width: "var(--width)",
12218
+ height: "var(--height)",
12219
+ transform: "translate(var(--x), var(--y))",
12220
+ transition: "transform 0.2s ease, width 0.2s ease",
12221
+ borderRadius: "xl",
12222
+ backgroundColor: "surface.brand"
12178
12223
  }
12179
12224
  },
12180
12225
  variants: {
@@ -12212,38 +12257,32 @@ var tabsSlotRecipe = defineSlotRecipe({
12212
12257
  core: {
12213
12258
  list: {
12214
12259
  color: "text.core",
12215
- border: "sm"
12260
+ border: "sm",
12261
+ borderColor: "outline"
12216
12262
  },
12217
12263
  trigger: {
12218
12264
  color: "text.core",
12219
12265
  border: "md",
12220
12266
  borderColor: "transparent",
12221
- _hover: {
12222
- outline: "2px solid",
12223
- outlineColor: "outline.core.hover",
12224
- outlineOffset: "-2px"
12225
- },
12226
- _active: {
12227
- backgroundColor: "surface.brand.active",
12228
- color: "text.brand",
12229
- outline: "none"
12230
- },
12231
- _selected: {
12232
- backgroundColor: "surface.brand",
12233
- color: "text.brand",
12267
+ "&:not([data-selected])": {
12234
12268
  _hover: {
12235
- outline: "none"
12269
+ backgroundColor: "surface.ghost.hover",
12270
+ _active: {
12271
+ backgroundColor: "surface.ghost.active",
12272
+ outline: "none",
12273
+ outlineColor: "transparent"
12274
+ }
12236
12275
  }
12237
- },
12238
- _disabled: {
12239
- backgroundColor: "surface.disabled",
12240
- color: "surface.disabled"
12241
12276
  }
12277
+ },
12278
+ _disabled: {
12279
+ backgroundColor: "surface.disabled",
12280
+ color: "surface.disabled"
12242
12281
  }
12243
12282
  },
12244
12283
  accent: {
12245
12284
  list: {
12246
- backgroundColor: "bg.accent",
12285
+ backgroundColor: "surface.accent",
12247
12286
  color: "text.accent"
12248
12287
  },
12249
12288
  trigger: {
@@ -12252,22 +12291,17 @@ var tabsSlotRecipe = defineSlotRecipe({
12252
12291
  backgroundColor: "surface.disabled",
12253
12292
  color: "icon.disabled"
12254
12293
  },
12255
- _hover: {
12256
- backgroundColor: "surface.accent.hover",
12257
- _active: {
12258
- backgroundColor: "surface.brand.active",
12259
- color: "text.brand"
12260
- }
12261
- },
12262
- _selected: {
12263
- backgroundColor: "surface.brand",
12264
- color: "text.brand",
12294
+ "&:not([data-selected])": {
12265
12295
  _hover: {
12266
- backgroundColor: "surface.brand.hover",
12267
- color: "text.brand",
12268
- outline: "none"
12296
+ backgroundColor: "surface.accent.hover",
12297
+ _active: {
12298
+ backgroundColor: "surface.accent.active"
12299
+ }
12269
12300
  }
12270
12301
  }
12302
+ },
12303
+ indicator: {
12304
+ backgroundColor: "surface.brand"
12271
12305
  }
12272
12306
  }
12273
12307
  },
@@ -12280,6 +12314,9 @@ var tabsSlotRecipe = defineSlotRecipe({
12280
12314
  trigger: {
12281
12315
  paddingX: 2,
12282
12316
  paddingY: 0
12317
+ },
12318
+ indicator: {
12319
+ top: "1px"
12283
12320
  }
12284
12321
  },
12285
12322
  sm: {
@@ -12309,11 +12346,7 @@ var tabsSlotRecipe = defineSlotRecipe({
12309
12346
  trigger: {
12310
12347
  fontWeight: "bold",
12311
12348
  fontSize: "sm",
12312
- paddingX: 3,
12313
- _focus: {
12314
- border: "md",
12315
- borderColor: "surface.accent"
12316
- }
12349
+ paddingX: 3
12317
12350
  }
12318
12351
  }
12319
12352
  }