@vygruppen/spor-react 13.4.6 → 13.6.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@13.4.6 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.6.0 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,18 +11,18 @@ CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
13
  DTS Build start
14
- ESM dist/index.mjs 351.42 KB
14
+ ESM dist/index.mjs 353.61 KB
15
15
  ESM dist/icons/index.mjs 110.00 B
16
- ESM dist/index.mjs.map 747.49 KB
17
16
  ESM dist/icons/index.mjs.map 157.00 B
18
- ESM ⚡️ Build success in 2649ms
19
- CJS dist/index.cjs 376.00 KB
17
+ ESM dist/index.mjs.map 752.22 KB
18
+ ESM ⚡️ Build success in 2851ms
19
+ CJS dist/index.cjs 378.29 KB
20
20
  CJS dist/icons/index.cjs 381.00 B
21
21
  CJS dist/icons/index.cjs.map 157.00 B
22
- CJS dist/index.cjs.map 747.49 KB
23
- CJS ⚡️ Build success in 2649ms
24
- DTS ⚡️ Build success in 20906ms
22
+ CJS dist/index.cjs.map 752.22 KB
23
+ CJS ⚡️ Build success in 2850ms
24
+ DTS ⚡️ Build success in 21728ms
25
25
  DTS dist/icons/index.d.ts 44.00 B
26
- DTS dist/index.d.ts 154.14 KB
26
+ DTS dist/index.d.ts 155.16 KB
27
27
  DTS dist/icons/index.d.cts 44.00 B
28
- DTS dist/index.d.cts 154.14 KB
28
+ DTS dist/index.d.cts 155.16 KB
@@ -1,8 +1,8 @@
1
1
 
2
- > @vygruppen/spor-react@13.4.6 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.6.0 postinstall /home/runner/work/spor/spor/packages/spor-react
3
3
  > chakra typegen src/theme/index.ts
4
4
 
5
- ◇ injected env (0) from .env // tip: suppress logs { quiet: true }
5
+ ◇ injected env (0) from .env // tip: secrets for agents [www.dotenvx.com]
6
6
  ┌ Chakra CLI ⚡️
7
7
  [?25l│
8
8
  ◒ Generating conditions types...
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 13.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ce5b9e0: Add new VyTeknologi brand theme and deprecate VyUtvikling
8
+ - New `Brand.VyTeknologi` theme, usable with `<SporProvider theme={themes[Brand.VyTeknologi]}>`
9
+ - Three new color palettes with 12 steps each: `teal`, `pink` and `violet`, with named aliases (e.g. `grape` → `violet.900`, `moss` → `teal.700`, `jam` → `pink.800`)
10
+ - The existing `pink` alias (→ `red.50`) still resolves as before; the new range is available as `pink.50`–`pink.1100`
11
+ - `Brand.VyUtvikling` and `vyUtviklingColors` are marked as `@deprecated` — migrate to `Brand.VyTeknologi`
12
+ - The MCP server's `get_spor_tokens` tool now accepts `vyTeknologi` as a theme
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [ce5b9e0]
17
+ - @vygruppen/spor-design-tokens@5.1.0
18
+
19
+ ## 13.5.0
20
+
21
+ ### Minor Changes
22
+
23
+ - 44c4594: Date and time picker: Add `size` prop with `"sm"` and `"md"` variants (defaults to `"md"`)
24
+ - bc0f4b4: RadioCards: Add "showIndicator" as an optional prop. If true, show a radiobutton-indicator on the left side of the content.
25
+ - 3ca4098: Toast: Add action and closable props to Toast component for enhanced functionality
26
+
3
27
  ## 13.4.6
4
28
 
5
29
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1572,6 +1572,7 @@ var PressableCard = ({
1572
1572
  };
1573
1573
  var RadioCard = ({
1574
1574
  ref,
1575
+ showIndicator = false,
1575
1576
  ...props
1576
1577
  }) => {
1577
1578
  const { inputProps, children } = props;
@@ -1587,7 +1588,10 @@ var RadioCard = ({
1587
1588
  ...inputProps
1588
1589
  }
1589
1590
  ),
1590
- /* @__PURE__ */ jsxRuntime.jsx(react.RadioCard.ItemControl, { id: itemControlId, "aria-hidden": true, children })
1591
+ /* @__PURE__ */ jsxRuntime.jsxs(react.RadioCard.ItemControl, { id: itemControlId, "aria-hidden": true, children: [
1592
+ showIndicator && /* @__PURE__ */ jsxRuntime.jsx(react.RadioCard.ItemIndicator, {}),
1593
+ children
1594
+ ] })
1591
1595
  ] });
1592
1596
  };
1593
1597
  var RadioCardGroup = ({
@@ -2505,7 +2509,6 @@ var DateTimeSegment = ({
2505
2509
  textAlign: "center",
2506
2510
  outline: "none",
2507
2511
  borderRadius: "xs",
2508
- fontSize: ["mobile.sm", "desktop.sm"],
2509
2512
  css: styles.dateTimeSegment,
2510
2513
  "aria-label": ariaLabel,
2511
2514
  "aria-labelledby": ariaLabelledby,
@@ -2628,6 +2631,7 @@ var StyledField = function StyledField2({
2628
2631
  isDisabled,
2629
2632
  isActive,
2630
2633
  overrideBorderColor,
2634
+ size,
2631
2635
  ...otherProps
2632
2636
  } = props;
2633
2637
  const { invalid } = react.useFieldContext() ?? {
@@ -2635,7 +2639,7 @@ var StyledField = function StyledField2({
2635
2639
  const recipe = react.useSlotRecipe({
2636
2640
  key: "datePicker"
2637
2641
  });
2638
- const styles = recipe({ variant });
2642
+ const styles = recipe({ variant, size });
2639
2643
  return /* @__PURE__ */ jsxRuntime.jsx(
2640
2644
  react.Box,
2641
2645
  {
@@ -2648,7 +2652,6 @@ var StyledField = function StyledField2({
2648
2652
  ref,
2649
2653
  "aria-invalid": invalid,
2650
2654
  "aria-disabled": isDisabled,
2651
- fontSize: ["mobile.md", "desktop.md"],
2652
2655
  children
2653
2656
  }
2654
2657
  );
@@ -2656,6 +2659,7 @@ var StyledField = function StyledField2({
2656
2659
  var DatePicker = ({
2657
2660
  ref: externalRef,
2658
2661
  variant,
2662
+ size,
2659
2663
  errorText,
2660
2664
  minHeight,
2661
2665
  showYearNavigation,
@@ -2720,12 +2724,13 @@ var DatePicker = ({
2720
2724
  invalid,
2721
2725
  helperText,
2722
2726
  required: props.required,
2727
+ size,
2723
2728
  children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverAnchor, { children: /* @__PURE__ */ jsxRuntime.jsxs(
2724
2729
  StyledField,
2725
2730
  {
2726
2731
  variant,
2732
+ size,
2727
2733
  onClick: onFieldClick,
2728
- paddingX: 3,
2729
2734
  minHeight,
2730
2735
  isDisabled: props.isDisabled,
2731
2736
  isActive: props.isActive,
@@ -2734,8 +2739,7 @@ var DatePicker = ({
2734
2739
  props.noCalendar ? /* @__PURE__ */ jsxRuntime.jsx(react.Box, { pr: 3, pl: 0.5, mr: 0.5, children: /* @__PURE__ */ jsxRuntime.jsx(spor_icon_react_star.CalendarOutline24Icon, {}) }) : /* @__PURE__ */ jsxRuntime.jsx(react.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2735
2740
  CalendarTriggerButton,
2736
2741
  {
2737
- paddingLeft: 1,
2738
- paddingRight: 1,
2742
+ marginLeft: 1,
2739
2743
  variant,
2740
2744
  ref,
2741
2745
  ...buttonProps
@@ -2791,6 +2795,7 @@ function RangeCalendar(props) {
2791
2795
  }
2792
2796
  function DateRangePicker({
2793
2797
  variant = "core",
2798
+ size,
2794
2799
  minHeight,
2795
2800
  startName,
2796
2801
  endName,
@@ -2850,6 +2855,7 @@ function DateRangePicker({
2850
2855
  alignItems: "center",
2851
2856
  paddingX: 3,
2852
2857
  variant,
2858
+ size,
2853
2859
  onClick: onFieldClick,
2854
2860
  minHeight,
2855
2861
  children: [
@@ -2914,8 +2920,6 @@ var TimeField = ({ state, ...props }) => {
2914
2920
  color: "text.subtle",
2915
2921
  top: 0,
2916
2922
  cursor: "text",
2917
- left: "50%",
2918
- transform: "translateX(-50%)",
2919
2923
  position: "absolute",
2920
2924
  paddingTop: "2px",
2921
2925
  whiteSpace: "nowrap",
@@ -3051,10 +3055,8 @@ var TimePicker = ({
3051
3055
  StyledField,
3052
3056
  {
3053
3057
  width: "fit-content",
3054
- paddingX: 2,
3055
3058
  alignItems: "center",
3056
3059
  justifyContent: "space-between",
3057
- gap: 2,
3058
3060
  opacity: isDisabled ? 0.5 : 1,
3059
3061
  pointerEvents: isDisabled ? "none" : "auto",
3060
3062
  "aria-disabled": isDisabled,
@@ -6682,6 +6684,7 @@ var fontFaces = `
6682
6684
  var Brand = /* @__PURE__ */ ((Brand2) => {
6683
6685
  Brand2["VyDigital"] = "VyDigital";
6684
6686
  Brand2["VyUtvikling"] = "VyUtvikling";
6687
+ Brand2["VyTeknologi"] = "VyTeknologi";
6685
6688
  Brand2["CargoNet"] = "CargoNet";
6686
6689
  return Brand2;
6687
6690
  })(Brand || {});
@@ -6694,13 +6697,17 @@ var createToast = ({
6694
6697
  variant,
6695
6698
  id,
6696
6699
  duration = 6e3,
6697
- width = "sm"
6700
+ width = "sm",
6701
+ action,
6702
+ closable = false
6698
6703
  }) => toaster.create({
6699
6704
  description: text,
6700
6705
  type: variant,
6701
6706
  id: id ?? crypto.randomUUID(),
6702
6707
  duration,
6703
- meta: { width }
6708
+ action,
6709
+ meta: { width },
6710
+ closable
6704
6711
  });
6705
6712
  var Toaster = () => {
6706
6713
  return /* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Toaster, { toaster, insetInline: { mdDown: "4" }, children: (toast) => {
@@ -6715,7 +6722,9 @@ var Toaster = () => {
6715
6722
  role: "alert",
6716
6723
  children: [
6717
6724
  /* @__PURE__ */ jsxRuntime.jsx(AlertIcon, { variant: toast.type }),
6718
- /* @__PURE__ */ jsxRuntime.jsx(react.Stack, { gap: "1", flex: "1", maxWidth: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(react.Toast.Description, { children: toast.description }) })
6725
+ /* @__PURE__ */ jsxRuntime.jsx(react.Stack, { gap: "1", flex: "1", maxWidth: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(react.Toast.Description, { children: toast.description }) }),
6726
+ toast.action && /* @__PURE__ */ jsxRuntime.jsx(react.Toast.ActionTrigger, { onClick: toast.action.onClick, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "xs", children: toast.action.label }) }),
6727
+ toast.closable && /* @__PURE__ */ jsxRuntime.jsx(react.Toast.CloseTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { size: "xs" }) })
6719
6728
  ]
6720
6729
  }
6721
6730
  );
@@ -7768,6 +7777,9 @@ var vyDigitalColors = react.defineSemanticTokens.colors({
7768
7777
  var vyUtviklingColors = react.defineSemanticTokens.colors({
7769
7778
  ...tokens4__default.default.color["vy-utvikling"].color.vyUtvikling
7770
7779
  });
7780
+ var vyTeknologiColors = react.defineSemanticTokens.colors({
7781
+ ...tokens4__default.default.color["vy-teknologi"].color.vyTeknologi
7782
+ });
7771
7783
  var cargonetColors = react.defineSemanticTokens.colors({
7772
7784
  ...tokens4__default.default.color["cargonet"].color.cargonet
7773
7785
  });
@@ -7814,6 +7826,10 @@ var semanticTokens = {
7814
7826
  ...baseSemanticTokens,
7815
7827
  colors: vyUtviklingColors
7816
7828
  },
7829
+ ["VyTeknologi" /* VyTeknologi */]: {
7830
+ ...baseSemanticTokens,
7831
+ colors: vyTeknologiColors
7832
+ },
7817
7833
  ["CargoNet" /* CargoNet */]: {
7818
7834
  ...baseSemanticTokens,
7819
7835
  colors: cargonetColors
@@ -7964,7 +7980,8 @@ var radioCardAnatomy = anatomy.createAnatomy("radio-card").parts(
7964
7980
  "itemText",
7965
7981
  "itemDescription",
7966
7982
  "itemContent",
7967
- "itemControl"
7983
+ "itemControl",
7984
+ "itemIndicator"
7968
7985
  );
7969
7986
  var radioAnatomy = anatomy.createAnatomy("radio").parts(
7970
7987
  "root",
@@ -8989,6 +9006,8 @@ var datePickerSlotRecipe = react.defineSlotRecipe({
8989
9006
  display: "flex",
8990
9007
  flex: 1,
8991
9008
  paddingY: 0.5,
9009
+ paddingX: 2,
9010
+ gap: 1.5,
8992
9011
  alignItems: "center",
8993
9012
  _hover: {
8994
9013
  zIndex: "docked"
@@ -9204,10 +9223,25 @@ var datePickerSlotRecipe = react.defineSlotRecipe({
9204
9223
  }
9205
9224
  }
9206
9225
  }
9226
+ },
9227
+ size: {
9228
+ sm: {
9229
+ wrapper: {
9230
+ fontSize: ["mobile.xs", "desktop.xs"],
9231
+ paddingX: 1,
9232
+ gap: 1
9233
+ }
9234
+ },
9235
+ md: {
9236
+ wrapper: {
9237
+ fontSize: ["mobile.sm", "desktop.sm"]
9238
+ }
9239
+ }
9207
9240
  }
9208
9241
  },
9209
9242
  defaultVariants: {
9210
- variant: "core"
9243
+ variant: "core",
9244
+ size: "md"
9211
9245
  }
9212
9246
  });
9213
9247
  var dialogSlotRecipe = react.defineSlotRecipe({
@@ -11245,6 +11279,54 @@ var radioCardSlotRecipe = react.defineSlotRecipe({
11245
11279
  _disabled: { opacity: 0.4 },
11246
11280
  fontWeight: "bold",
11247
11281
  fontSize: "inherit"
11282
+ },
11283
+ itemControl: {
11284
+ display: "flex",
11285
+ alignItems: "flex-start",
11286
+ justifyContent: "flex-start"
11287
+ },
11288
+ itemIndicator: {
11289
+ display: "inline-flex",
11290
+ flexShrink: 0,
11291
+ alignItems: "center",
11292
+ justifyContent: "center",
11293
+ borderWidth: "2px",
11294
+ borderColor: "outline.core",
11295
+ borderRadius: "xl",
11296
+ width: 3,
11297
+ height: 3,
11298
+ marginRight: 2,
11299
+ marginTop: 0.5,
11300
+ _checked: {
11301
+ borderColor: "surface.brand"
11302
+ },
11303
+ _hover: {
11304
+ borderColor: "surface.brand.hover",
11305
+ "& .dot": {
11306
+ backgroundColor: "surface.brand.hover"
11307
+ }
11308
+ },
11309
+ _disabled: {
11310
+ pointerEvents: "none",
11311
+ backgroundColor: "surface.disabled",
11312
+ borderColor: "outline.disabled",
11313
+ "& .dot": {
11314
+ backgroundColor: "outline.disabled"
11315
+ }
11316
+ },
11317
+ _focusVisible: {
11318
+ outlineWidth: "2px",
11319
+ outlineColor: "outline.focus",
11320
+ outlineStyle: "solid",
11321
+ outlineOffset: "1px"
11322
+ },
11323
+ "& .dot": {
11324
+ height: "full",
11325
+ width: "full",
11326
+ borderRadius: "xl",
11327
+ backgroundColor: "surface.brand",
11328
+ scale: "0.5"
11329
+ }
11248
11330
  }
11249
11331
  },
11250
11332
  variants: {
@@ -13100,6 +13182,10 @@ var themes = {
13100
13182
  ["VyUtvikling" /* VyUtvikling */]: react.createSystem(
13101
13183
  react.defaultBaseConfig,
13102
13184
  generateTheme("VyUtvikling" /* VyUtvikling */)
13185
+ ),
13186
+ ["VyTeknologi" /* VyTeknologi */]: react.createSystem(
13187
+ react.defaultBaseConfig,
13188
+ generateTheme("VyTeknologi" /* VyTeknologi */)
13103
13189
  )
13104
13190
  };
13105
13191
  var system = themes["VyDigital" /* VyDigital */];