@vygruppen/spor-react 13.4.5 → 13.5.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.5 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.5.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.14 KB
15
- ESM dist/icons/index.mjs 110.00 B
16
- ESM dist/index.mjs.map 747.03 KB
17
- ESM dist/icons/index.mjs.map 157.00 B
18
- ESM ⚡️ Build success in 2348ms
19
- CJS dist/index.cjs 375.72 KB
20
14
  CJS dist/icons/index.cjs 381.00 B
21
- CJS dist/index.cjs.map 747.03 KB
15
+ CJS dist/index.cjs 377.88 KB
22
16
  CJS dist/icons/index.cjs.map 157.00 B
23
- CJS ⚡️ Build success in 2348ms
24
- DTS ⚡️ Build success in 19728ms
17
+ CJS dist/index.cjs.map 751.12 KB
18
+ CJS ⚡️ Build success in 2931ms
19
+ ESM dist/index.mjs 353.23 KB
20
+ ESM dist/icons/index.mjs 110.00 B
21
+ ESM dist/index.mjs.map 751.12 KB
22
+ ESM dist/icons/index.mjs.map 157.00 B
23
+ ESM ⚡️ Build success in 2932ms
24
+ DTS ⚡️ Build success in 21320ms
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 154.92 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 154.92 KB
@@ -1,11 +1,12 @@
1
1
 
2
- > @vygruppen/spor-react@13.4.5 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.5.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: override existing { override: true }
5
+ ◇ injected env (0) from .env // tip: encrypted .env [www.dotenvx.com]
6
6
  ┌ Chakra CLI ⚡️
7
7
  [?25l│
8
- ◇ Generated conditions typings
8
+ ◒ Generating conditions types...
9
+ ◇ ✅ Generated conditions typings
9
10
  [?25h[?25l│
10
11
  ◒ Generating recipe types...
11
12
  ◇ ✅ Generated recipe typings
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 13.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 44c4594: Date and time picker: Add `size` prop with `"sm"` and `"md"` variants (defaults to `"md"`)
8
+ - bc0f4b4: RadioCards: Add "showIndicator" as an optional prop. If true, show a radiobutton-indicator on the left side of the content.
9
+ - 3ca4098: Toast: Add action and closable props to Toast component for enhanced functionality
10
+
11
+ ## 13.4.6
12
+
13
+ ### Patch Changes
14
+
15
+ - 4500a7b: Select: Fix border radius and spacing when dropdown opens above the trigger
16
+ - Updated dependencies [cc9028e]
17
+ - Updated dependencies [5ee8079]
18
+ - @vygruppen/spor-design-tokens@5.0.6
19
+ - @vygruppen/spor-icon-react@5.0.2
20
+
3
21
  ## 13.4.5
4
22
 
5
23
  ### 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,
@@ -6694,13 +6696,17 @@ var createToast = ({
6694
6696
  variant,
6695
6697
  id,
6696
6698
  duration = 6e3,
6697
- width = "sm"
6699
+ width = "sm",
6700
+ action,
6701
+ closable = false
6698
6702
  }) => toaster.create({
6699
6703
  description: text,
6700
6704
  type: variant,
6701
6705
  id: id ?? crypto.randomUUID(),
6702
6706
  duration,
6703
- meta: { width }
6707
+ action,
6708
+ meta: { width },
6709
+ closable
6704
6710
  });
6705
6711
  var Toaster = () => {
6706
6712
  return /* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Toaster, { toaster, insetInline: { mdDown: "4" }, children: (toast) => {
@@ -6715,7 +6721,9 @@ var Toaster = () => {
6715
6721
  role: "alert",
6716
6722
  children: [
6717
6723
  /* @__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 }) })
6724
+ /* @__PURE__ */ jsxRuntime.jsx(react.Stack, { gap: "1", flex: "1", maxWidth: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(react.Toast.Description, { children: toast.description }) }),
6725
+ 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 }) }),
6726
+ toast.closable && /* @__PURE__ */ jsxRuntime.jsx(react.Toast.CloseTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { size: "xs" }) })
6719
6727
  ]
6720
6728
  }
6721
6729
  );
@@ -7964,7 +7972,8 @@ var radioCardAnatomy = anatomy.createAnatomy("radio-card").parts(
7964
7972
  "itemText",
7965
7973
  "itemDescription",
7966
7974
  "itemContent",
7967
- "itemControl"
7975
+ "itemControl",
7976
+ "itemIndicator"
7968
7977
  );
7969
7978
  var radioAnatomy = anatomy.createAnatomy("radio").parts(
7970
7979
  "root",
@@ -8989,6 +8998,8 @@ var datePickerSlotRecipe = react.defineSlotRecipe({
8989
8998
  display: "flex",
8990
8999
  flex: 1,
8991
9000
  paddingY: 0.5,
9001
+ paddingX: 2,
9002
+ gap: 1.5,
8992
9003
  alignItems: "center",
8993
9004
  _hover: {
8994
9005
  zIndex: "docked"
@@ -9204,10 +9215,25 @@ var datePickerSlotRecipe = react.defineSlotRecipe({
9204
9215
  }
9205
9216
  }
9206
9217
  }
9218
+ },
9219
+ size: {
9220
+ sm: {
9221
+ wrapper: {
9222
+ fontSize: ["mobile.xs", "desktop.xs"],
9223
+ paddingX: 1,
9224
+ gap: 1
9225
+ }
9226
+ },
9227
+ md: {
9228
+ wrapper: {
9229
+ fontSize: ["mobile.sm", "desktop.sm"]
9230
+ }
9231
+ }
9207
9232
  }
9208
9233
  },
9209
9234
  defaultVariants: {
9210
- variant: "core"
9235
+ variant: "core",
9236
+ size: "md"
9211
9237
  }
9212
9238
  });
9213
9239
  var dialogSlotRecipe = react.defineSlotRecipe({
@@ -11245,6 +11271,54 @@ var radioCardSlotRecipe = react.defineSlotRecipe({
11245
11271
  _disabled: { opacity: 0.4 },
11246
11272
  fontWeight: "bold",
11247
11273
  fontSize: "inherit"
11274
+ },
11275
+ itemControl: {
11276
+ display: "flex",
11277
+ alignItems: "flex-start",
11278
+ justifyContent: "flex-start"
11279
+ },
11280
+ itemIndicator: {
11281
+ display: "inline-flex",
11282
+ flexShrink: 0,
11283
+ alignItems: "center",
11284
+ justifyContent: "center",
11285
+ borderWidth: "2px",
11286
+ borderColor: "outline.core",
11287
+ borderRadius: "xl",
11288
+ width: 3,
11289
+ height: 3,
11290
+ marginRight: 2,
11291
+ marginTop: 0.5,
11292
+ _checked: {
11293
+ borderColor: "surface.brand"
11294
+ },
11295
+ _hover: {
11296
+ borderColor: "surface.brand.hover",
11297
+ "& .dot": {
11298
+ backgroundColor: "surface.brand.hover"
11299
+ }
11300
+ },
11301
+ _disabled: {
11302
+ pointerEvents: "none",
11303
+ backgroundColor: "surface.disabled",
11304
+ borderColor: "outline.disabled",
11305
+ "& .dot": {
11306
+ backgroundColor: "outline.disabled"
11307
+ }
11308
+ },
11309
+ _focusVisible: {
11310
+ outlineWidth: "2px",
11311
+ outlineColor: "outline.focus",
11312
+ outlineStyle: "solid",
11313
+ outlineOffset: "1px"
11314
+ },
11315
+ "& .dot": {
11316
+ height: "full",
11317
+ width: "full",
11318
+ borderRadius: "xl",
11319
+ backgroundColor: "surface.brand",
11320
+ scale: "0.5"
11321
+ }
11248
11322
  }
11249
11323
  },
11250
11324
  variants: {
@@ -11387,6 +11461,12 @@ var selectSlotRecipe = react.defineSlotRecipe({
11387
11461
  listStyle: "none",
11388
11462
  borderBottomRadius: "sm",
11389
11463
  marginTop: -1,
11464
+ "&[data-placement^='top']": {
11465
+ borderTopRadius: "sm",
11466
+ borderBottomRadius: 0,
11467
+ marginTop: 0,
11468
+ marginBottom: -1
11469
+ },
11390
11470
  _open: {
11391
11471
  animationStyle: "slide-fade-in",
11392
11472
  animationDuration: "fast",
@@ -11455,6 +11535,10 @@ var selectSlotRecipe = react.defineSlotRecipe({
11455
11535
  _open: {
11456
11536
  borderBottomRadius: 0
11457
11537
  },
11538
+ "&:has([data-placement^='top'][data-state='open'])": {
11539
+ borderTopRadius: 0,
11540
+ borderBottomRadius: "sm"
11541
+ },
11458
11542
  _invalid: {
11459
11543
  outline: "2px solid",
11460
11544
  outlineColor: "outline.error"