@vygruppen/spor-react 12.8.10 → 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.10 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,17 +11,17 @@ CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
13
  DTS Build start
14
+ CJS dist/index.cjs 315.42 KB
14
15
  CJS dist/icons/index.cjs 381.00 B
15
16
  CJS dist/icons/index.cjs.map 157.00 B
16
- CJS dist/index.cjs 315.14 KB
17
- CJS dist/index.cjs.map 629.02 KB
18
- CJS ⚡️ Build success in 3030ms
17
+ CJS dist/index.cjs.map 629.60 KB
18
+ CJS ⚡️ Build success in 3398ms
19
+ ESM dist/index.mjs 294.02 KB
19
20
  ESM dist/icons/index.mjs 110.00 B
20
- ESM dist/index.mjs 293.75 KB
21
+ ESM dist/index.mjs.map 629.60 KB
21
22
  ESM dist/icons/index.mjs.map 157.00 B
22
- ESM dist/index.mjs.map 629.02 KB
23
- ESM ⚡️ Build success in 3037ms
24
- DTS ⚡️ Build success in 30729ms
23
+ ESM ⚡️ Build success in 3402ms
24
+ DTS ⚡️ Build success in 32388ms
25
25
  DTS dist/icons/index.d.ts 44.00 B
26
26
  DTS dist/index.d.ts 156.40 KB
27
27
  DTS dist/icons/index.d.cts 44.00 B
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@12.8.10 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,11 @@
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
+
3
9
  ## 12.8.10
4
10
 
5
11
  ### 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');
@@ -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
  });