@vygruppen/spor-react 12.8.9 → 12.9.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@12.8.9 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.9.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
- CJS dist/index.cjs 314.57 KB
14
+ CJS dist/index.cjs 315.42 KB
15
15
  CJS dist/icons/index.cjs 381.00 B
16
16
  CJS dist/icons/index.cjs.map 157.00 B
17
- CJS dist/index.cjs.map 628.88 KB
18
- CJS ⚡️ Build success in 2988ms
19
- ESM dist/index.mjs 293.69 KB
17
+ CJS dist/index.cjs.map 629.60 KB
18
+ CJS ⚡️ Build success in 3398ms
19
+ ESM dist/index.mjs 294.02 KB
20
20
  ESM dist/icons/index.mjs 110.00 B
21
- ESM dist/index.mjs.map 628.88 KB
21
+ ESM dist/index.mjs.map 629.60 KB
22
22
  ESM dist/icons/index.mjs.map 157.00 B
23
- ESM ⚡️ Build success in 2990ms
24
- DTS ⚡️ Build success in 29591ms
23
+ ESM ⚡️ Build success in 3402ms
24
+ DTS ⚡️ Build success in 32388ms
25
25
  DTS dist/icons/index.d.ts 44.00 B
26
- DTS dist/index.d.ts 156.34 KB
26
+ DTS dist/index.d.ts 156.40 KB
27
27
  DTS dist/icons/index.d.cts 44.00 B
28
- DTS dist/index.d.cts 156.34 KB
28
+ DTS dist/index.d.cts 156.40 KB
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@12.8.9 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.9.0 postinstall /home/runner/work/spor/spor/packages/spor-react
3
3
  > chakra typegen src/theme/index.ts
4
4
 
5
5
  ┌ Chakra CLI ⚡️
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 12.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5e4f450: Drawer: Make it possible to close a drawer by swiping
8
+
9
+ ## 12.8.10
10
+
11
+ ### Patch Changes
12
+
13
+ - 6fc5a24: Export some more externals from chakra-ui
14
+
3
15
  ## 12.8.9
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -12,6 +12,7 @@ var nextThemes = require('next-themes');
12
12
  var lu = require('react-icons/lu');
13
13
  var reactStately = require('react-stately');
14
14
  var date = require('@internationalized/date');
15
+ var reactSwipeable = require('react-swipeable');
15
16
  var awesomePhonenumber = require('awesome-phonenumber');
16
17
  var react$1 = require('@emotion/react');
17
18
  var tokens23 = require('@vygruppen/spor-design-tokens');
@@ -982,11 +983,11 @@ var useScrollDirection = () => {
982
983
  var AlertIcon = React27.forwardRef(
983
984
  ({ variant, customIcon }, ref) => {
984
985
  const { t } = useTranslation();
985
- const Icon2 = customIcon ?? getIcon(variant);
986
+ const Icon3 = customIcon ?? getIcon(variant);
986
987
  return /* @__PURE__ */ jsxRuntime.jsx(
987
988
  react.Box,
988
989
  {
989
- as: Icon2,
990
+ as: Icon3,
990
991
  ref,
991
992
  "aria-label": t(texts5[variant]),
992
993
  color: customIcon ? `alert.${variant}.icon` : void 0
@@ -2376,38 +2377,38 @@ var DrawerContent = React27.forwardRef(
2376
2377
  (props, ref) => {
2377
2378
  const { children, portalled = true, portalRef, ...rest } = props;
2378
2379
  const { size, placement } = useRootDrawerProps();
2380
+ const { setOpen } = react.useDialogContext();
2381
+ const handlers = reactSwipeable.useSwipeable({
2382
+ onSwiped: (e) => {
2383
+ const shouldClose = placement === "bottom" && e.dir === "Down" || placement === "top" && e.dir === "Up" || placement === "end" && e.dir === "Right" || placement === "start" && e.dir === "Left";
2384
+ if (shouldClose) {
2385
+ setOpen(false);
2386
+ }
2387
+ },
2388
+ swipeDuration: 250
2389
+ });
2379
2390
  const sizeNotFull = size !== "full";
2380
- return /* @__PURE__ */ jsxRuntime.jsx(react.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsxRuntime.jsx(react.Drawer.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.Drawer.Content, { ref, ...rest, children: [
2391
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsxRuntime.jsx(react.Drawer.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { ...handlers, width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(react.Drawer.Content, { ref, ...rest, children: [
2381
2392
  sizeNotFull && placement === "bottom" && /* @__PURE__ */ jsxRuntime.jsx(CloseDrawerLine, {}),
2382
2393
  children,
2383
2394
  sizeNotFull && placement === "top" && /* @__PURE__ */ jsxRuntime.jsx(CloseDrawerLine, {})
2384
- ] }) }) });
2395
+ ] }) }) }) });
2385
2396
  }
2386
2397
  );
2387
2398
  DrawerContent.displayName = "DrawerContent";
2388
2399
  var CloseDrawerLine = React27.forwardRef((props, ref) => {
2389
- const { t } = useTranslation();
2390
2400
  return /* @__PURE__ */ jsxRuntime.jsx(
2391
- react.Drawer.CloseTrigger,
2401
+ react.Box,
2392
2402
  {
2393
- ...props,
2394
- ref,
2395
- position: "relative",
2396
- insetEnd: "unset",
2397
- "aria-label": t(texts12.close),
2398
- cursor: "pointer",
2403
+ width: 7,
2404
+ minHeight: 1,
2399
2405
  top: 0,
2400
- paddingY: 2,
2401
- children: /* @__PURE__ */ jsxRuntime.jsx(
2402
- react.Box,
2403
- {
2404
- width: 7,
2405
- height: 1,
2406
- backgroundColor: "silver",
2407
- borderRadius: "xs",
2408
- marginX: "auto"
2409
- }
2410
- )
2406
+ marginY: 2,
2407
+ marginX: "auto",
2408
+ backgroundColor: "silver",
2409
+ borderRadius: "xs",
2410
+ ...props,
2411
+ ref
2411
2412
  }
2412
2413
  );
2413
2414
  });
@@ -3849,14 +3850,14 @@ var LineIcon = React27.forwardRef(
3849
3850
  const borderContainer = () => {
3850
3851
  return variant === "walk" && target === "travelTag" ? 0 : 0.5;
3851
3852
  };
3852
- const Icon2 = getCorrectIcon({
3853
+ const Icon3 = getCorrectIcon({
3853
3854
  variant: variant === "custom" && "customIconVariant" in rest ? rest.customIconVariant : (
3854
3855
  // eslint-disable-next-line unicorn/no-nested-ternary
3855
3856
  variant === "custom" ? "local-train" : variant
3856
3857
  ),
3857
3858
  size
3858
3859
  });
3859
- if (!Icon2) {
3860
+ if (!Icon3) {
3860
3861
  return null;
3861
3862
  }
3862
3863
  if (foregroundColor) {
@@ -3871,7 +3872,7 @@ var LineIcon = React27.forwardRef(
3871
3872
  borderColor: variant === "walk" ? "core.outline" : "transparent",
3872
3873
  "aria-label": label,
3873
3874
  ref,
3874
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { css: styles.icon })
3875
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon3, { css: styles.icon })
3875
3876
  }
3876
3877
  );
3877
3878
  }
@@ -10651,6 +10652,10 @@ var TooltipContent = React27.forwardRef(
10651
10652
  );
10652
10653
  TooltipContent.displayName = "TooltipContent";
10653
10654
 
10655
+ Object.defineProperty(exports, "AspectRatio", {
10656
+ enumerable: true,
10657
+ get: function () { return react.AspectRatio; }
10658
+ });
10654
10659
  Object.defineProperty(exports, "Box", {
10655
10660
  enumerable: true,
10656
10661
  get: function () { return react.Box; }
@@ -10715,6 +10720,10 @@ Object.defineProperty(exports, "HStack", {
10715
10720
  enumerable: true,
10716
10721
  get: function () { return react.HStack; }
10717
10722
  });
10723
+ Object.defineProperty(exports, "Icon", {
10724
+ enumerable: true,
10725
+ get: function () { return react.Icon; }
10726
+ });
10718
10727
  Object.defineProperty(exports, "Image", {
10719
10728
  enumerable: true,
10720
10729
  get: function () { return react.Image; }
@@ -10799,6 +10808,10 @@ Object.defineProperty(exports, "VisuallyHidden", {
10799
10808
  enumerable: true,
10800
10809
  get: function () { return react.VisuallyHidden; }
10801
10810
  });
10811
+ Object.defineProperty(exports, "createIcon", {
10812
+ enumerable: true,
10813
+ get: function () { return react.createIcon; }
10814
+ });
10802
10815
  Object.defineProperty(exports, "createListCollection", {
10803
10816
  enumerable: true,
10804
10817
  get: function () { return react.createListCollection; }
@@ -10847,6 +10860,14 @@ Object.defineProperty(exports, "useMediaQuery", {
10847
10860
  enumerable: true,
10848
10861
  get: function () { return react.useMediaQuery; }
10849
10862
  });
10863
+ Object.defineProperty(exports, "useRecipe", {
10864
+ enumerable: true,
10865
+ get: function () { return react.useRecipe; }
10866
+ });
10867
+ Object.defineProperty(exports, "useSlotRecipe", {
10868
+ enumerable: true,
10869
+ get: function () { return react.useSlotRecipe; }
10870
+ });
10850
10871
  Object.defineProperty(exports, "useToken", {
10851
10872
  enumerable: true,
10852
10873
  get: function () { return react.useToken; }