@okam/stack-ui 2.0.0 → 2.0.3

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/index40.mjs CHANGED
@@ -6,18 +6,18 @@ import { mergeDefaultComponentProps as G } from "./index77.mjs";
6
6
  import { BoxWithForwardRef as H, Box as k } from "./index7.mjs";
7
7
  import { Anchor as J } from "./index8.mjs";
8
8
  function _({
9
- item: c,
9
+ item: l,
10
10
  state: n,
11
11
  ...g
12
12
  }) {
13
- const { key: s, rendered: e, type: b } = c, {
13
+ const { key: s, rendered: e, type: b } = l, {
14
14
  themeName: t = "option",
15
- tokens: y,
16
- as: P = "li",
17
- customTheme: x,
15
+ tokens: P,
16
+ as: x = "li",
17
+ customTheme: y,
18
18
  linkElementType: C = J,
19
19
  ...F
20
- } = G(g, c.props), l = W(null), {
20
+ } = G(g, l.props), c = W(null), {
21
21
  optionProps: E,
22
22
  isFocused: L,
23
23
  isDisabled: N,
@@ -28,8 +28,8 @@ function _({
28
28
  descriptionProps: A,
29
29
  labelProps: D,
30
30
  hasAction: $
31
- } = q({ key: s }, n, l), i = n.selectionManager.isLink(s), j = n.selectionManager.canSelectItem(s), r = {
32
- ...y,
31
+ } = q({ key: s }, n, c), i = n.selectionManager.isLink(s), j = n.selectionManager.canSelectItem(s), r = {
32
+ ...P,
33
33
  type: b,
34
34
  isFocused: L,
35
35
  isDisabled: N,
@@ -40,7 +40,7 @@ function _({
40
40
  hasAction: $,
41
41
  isLink: i,
42
42
  isSelectable: j
43
- }, w = i ? C : H, B = i ? "a" : P, M = async () => {
43
+ }, w = i ? C : H, B = i ? "a" : x, M = () => {
44
44
  if (u.count(e) > 1) {
45
45
  const [m, a] = u.toArray(e), p = f(m), d = f(a);
46
46
  return !p && !d ? e : /* @__PURE__ */ O(I, { children: [
@@ -55,10 +55,10 @@ function _({
55
55
  {
56
56
  as: B,
57
57
  ...z(F, E),
58
- ref: l,
58
+ ref: c,
59
59
  themeName: `${t}.option`,
60
60
  tokens: r,
61
- customTheme: x,
61
+ customTheme: y,
62
62
  children: M()
63
63
  }
64
64
  ) });
package/index56.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),o=require("react-aria"),a=require("./index7.js");function D(c){const{children:l,themeName:r="popover",tokens:m,customTheme:f,placement:h="bottom",offset:d=5,state:s,arrow:i,sizeRef:R,popoverRef:v,triggerRef:x,contain:P=!0,autoFocus:g=!0,restoreFocus:j=!0}=c,y=R??x,{isOpen:k}=s,w=n.useRef(null),p=v??w,{popoverProps:u,underlayProps:F,arrowProps:$,placement:b}=o.usePopover({...c,placement:h,offset:d,popoverRef:p},s),t={placement:b??"bottom",isOpen:k,...m},q={[`--${r?.replace(".","-")}-container-width`]:`${y?.current?.offsetWidth}px`,...u.style};return e.jsxs(o.Overlay,{children:[e.jsx(a.Box,{themeName:`${r}.underlay`,tokens:t,...F}),e.jsx(o.FocusScope,{autoFocus:g,restoreFocus:j,contain:P,children:e.jsxs(a.BoxWithForwardRef,{themeName:`${r}.popover`,customTheme:f,tokens:t,ref:p,...u,style:q,children:[i!=null&&n.cloneElement(i,{...$,themeName:`${r}.arrow`,tokens:t}),e.jsx(o.DismissButton,{onDismiss:s.close}),n.Children.map(l,B=>e.jsx(o.FocusRing,{focusRingClass:"has-focus-ring",children:B})),e.jsx(o.DismissButton,{onDismiss:s.close})]})})]})}exports.Popover=D;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),o=require("react-aria"),p=require("./index7.js");function D(r){const{children:u,themeName:s="popover",tokens:m,customTheme:f,placement:d="bottom",offset:h=5,state:t,arrow:a,sizeRef:x,popoverRef:R,triggerRef:v,contain:P=!0,autoFocus:g=!0,restoreFocus:j=!0}=r,b=x??v,{isOpen:y}=t,k=i.useRef(null),l=R??k,{popoverProps:n,underlayProps:w,arrowProps:F,placement:N}=o.usePopover({...r,placement:d,offset:h,popoverRef:l},t),c={placement:N??"bottom",isOpen:y,...m},$={[`--${s?.replace(".","-")}-container-width`]:`${b?.current?.offsetWidth}px`,...n.style},q=r.isNonModal===!0?0:n.tabIndex;return e.jsxs(o.Overlay,{children:[e.jsx(p.Box,{themeName:`${s}.underlay`,tokens:c,...w}),e.jsx(o.FocusScope,{autoFocus:g,restoreFocus:j,contain:P,children:e.jsxs(p.BoxWithForwardRef,{themeName:`${s}.popover`,customTheme:f,tokens:c,ref:l,...n,tabIndex:q,style:$,children:[a!=null&&i.cloneElement(a,{...F,themeName:`${s}.arrow`,tokens:c}),e.jsx(o.DismissButton,{onDismiss:t.close}),i.Children.map(u,B=>e.jsx(o.FocusRing,{focusRingClass:"has-focus-ring",children:B})),e.jsx(o.DismissButton,{onDismiss:t.close})]})})]})}exports.Popover=D;
package/index56.mjs CHANGED
@@ -1,61 +1,62 @@
1
1
  "use client";
2
2
  import { jsxs as i, jsx as e } from "react/jsx-runtime";
3
- import { useRef as D, cloneElement as b, Children as j } from "react";
4
- import { usePopover as C, Overlay as O, FocusScope as T, DismissButton as m, FocusRing as W } from "react-aria";
5
- import { Box as E, BoxWithForwardRef as S } from "./index7.mjs";
6
- function I(s) {
3
+ import { useRef as D, cloneElement as I, Children as T } from "react";
4
+ import { usePopover as j, Overlay as C, FocusScope as O, DismissButton as l, FocusRing as W } from "react-aria";
5
+ import { Box as E, BoxWithForwardRef as M } from "./index7.mjs";
6
+ function H(t) {
7
7
  const {
8
- children: l,
8
+ children: m,
9
9
  themeName: o = "popover",
10
10
  tokens: a,
11
11
  customTheme: f,
12
12
  placement: u = "bottom",
13
- offset: h = 5,
13
+ offset: d = 5,
14
14
  state: r,
15
- arrow: n,
16
- sizeRef: R,
17
- popoverRef: d,
15
+ arrow: c,
16
+ sizeRef: h,
17
+ popoverRef: R,
18
18
  triggerRef: v,
19
19
  contain: P = !0,
20
- autoFocus: g = !0,
21
- restoreFocus: x = !0
22
- } = s, k = R ?? v, { isOpen: w } = r, y = D(null), p = d ?? y, { popoverProps: c, underlayProps: F, arrowProps: $, placement: N } = C(
20
+ autoFocus: x = !0,
21
+ restoreFocus: g = !0
22
+ } = t, b = h ?? v, { isOpen: k } = r, w = D(null), p = R ?? w, { popoverProps: n, underlayProps: y, arrowProps: F, placement: N } = j(
23
23
  {
24
- ...s,
24
+ ...t,
25
25
  placement: u,
26
- offset: h,
26
+ offset: d,
27
27
  popoverRef: p
28
28
  },
29
29
  r
30
- ), t = {
30
+ ), s = {
31
31
  placement: N ?? "bottom",
32
- isOpen: w,
32
+ isOpen: k,
33
33
  ...a
34
- }, z = {
35
- [`--${o?.replace(".", "-")}-container-width`]: `${k?.current?.offsetWidth}px`,
36
- ...c.style
37
- };
38
- return /* @__PURE__ */ i(O, { children: [
39
- /* @__PURE__ */ e(E, { themeName: `${o}.underlay`, tokens: t, ...F }),
40
- /* @__PURE__ */ e(T, { autoFocus: g, restoreFocus: x, contain: P, children: /* @__PURE__ */ i(
41
- S,
34
+ }, $ = {
35
+ [`--${o?.replace(".", "-")}-container-width`]: `${b?.current?.offsetWidth}px`,
36
+ ...n.style
37
+ }, z = t.isNonModal === !0 ? 0 : n.tabIndex;
38
+ return /* @__PURE__ */ i(C, { children: [
39
+ /* @__PURE__ */ e(E, { themeName: `${o}.underlay`, tokens: s, ...y }),
40
+ /* @__PURE__ */ e(O, { autoFocus: x, restoreFocus: g, contain: P, children: /* @__PURE__ */ i(
41
+ M,
42
42
  {
43
43
  themeName: `${o}.popover`,
44
44
  customTheme: f,
45
- tokens: t,
45
+ tokens: s,
46
46
  ref: p,
47
- ...c,
48
- style: z,
47
+ ...n,
48
+ tabIndex: z,
49
+ style: $,
49
50
  children: [
50
- n != null && b(n, { ...$, themeName: `${o}.arrow`, tokens: t }),
51
- /* @__PURE__ */ e(m, { onDismiss: r.close }),
52
- j.map(l, (B) => /* @__PURE__ */ e(W, { focusRingClass: "has-focus-ring", children: B })),
53
- /* @__PURE__ */ e(m, { onDismiss: r.close })
51
+ c != null && I(c, { ...F, themeName: `${o}.arrow`, tokens: s }),
52
+ /* @__PURE__ */ e(l, { onDismiss: r.close }),
53
+ T.map(m, (B) => /* @__PURE__ */ e(W, { focusRingClass: "has-focus-ring", children: B })),
54
+ /* @__PURE__ */ e(l, { onDismiss: r.close })
54
55
  ]
55
56
  }
56
57
  ) })
57
58
  ] });
58
59
  }
59
60
  export {
60
- I as Popover
61
+ H as Popover
61
62
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okam/stack-ui",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "repository": {
5
5
  "url": "https://github.com/OKAMca/stack.git"
6
6
  },
@@ -45,7 +45,7 @@
45
45
  "react-stately": "^3.43.0",
46
46
  "react-use": "^17.6.0",
47
47
  "sanitize-html": "^2.13.1",
48
- "swiper": "^12.0.0",
48
+ "swiper": "^12.1.2",
49
49
  "tailwind-variants": "^3.2.2",
50
50
  "usehooks-ts": "^3.1.0"
51
51
  }