@okam/stack-ui 2.0.1 → 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/CHANGELOG.md +25 -0
- package/components/fields/ComboBox/interface.d.ts +6 -0
- package/components/fields/ListBox/interface.d.ts +1 -1
- package/index12.js +1 -1
- package/index12.mjs +6 -6
- package/index127.js +1 -1
- package/index127.mjs +10 -10
- package/index151.js +3 -2
- package/index151.mjs +5 -4
- package/index17.js +1 -1
- package/index17.mjs +14 -14
- package/index18.js +1 -1
- package/index18.mjs +7 -7
- package/index26.js +1 -1
- package/index26.mjs +15 -15
- package/index27.js +1 -1
- package/index27.mjs +15 -15
- package/index32.js +1 -1
- package/index32.mjs +105 -85
- package/index35.js +1 -1
- package/index35.mjs +14 -14
- package/index38.js +1 -1
- package/index38.mjs +114 -106
- package/index56.js +1 -1
- package/index56.mjs +33 -32
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
## 2.0.3 (2026-03-11)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- resolve high-severity dependabot alerts ([#429](https://github.com/OKAMca/stack/pull/429))
|
|
6
|
+
- **stack-ui:** error message and validation fixes ([6e4d9f21](https://github.com/OKAMca/stack/commit/6e4d9f21))
|
|
7
|
+
- **stack-ui:** validation fix ([fc54df32](https://github.com/OKAMca/stack/commit/fc54df32))
|
|
8
|
+
- **stack-ui:** selection change fixes ([89bf4c0e](https://github.com/OKAMca/stack/commit/89bf4c0e))
|
|
9
|
+
- **stack-ui:** controlled state fix ([431d9b63](https://github.com/OKAMca/stack/commit/431d9b63))
|
|
10
|
+
- **stack-ui:** remove state from typing ([e3bbfc49](https://github.com/OKAMca/stack/commit/e3bbfc49))
|
|
11
|
+
- **stack-ui:** listbox clear all fix ([0fb6428a](https://github.com/OKAMca/stack/commit/0fb6428a))
|
|
12
|
+
- **stack-ui:** revert select change ([f884b2fa](https://github.com/OKAMca/stack/commit/f884b2fa))
|
|
13
|
+
- **stack-ui:** revert debounce delay, modal fixes ([b8422eb4](https://github.com/OKAMca/stack/commit/b8422eb4))
|
|
14
|
+
- **stack-ui:** add cursor-pointer ([cfce38fb](https://github.com/OKAMca/stack/commit/cfce38fb))
|
|
15
|
+
- **stack-ui:** combobox migration fixes ([69a02a6c](https://github.com/OKAMca/stack/commit/69a02a6c))
|
|
16
|
+
|
|
17
|
+
### ❤️ Thank You
|
|
18
|
+
|
|
19
|
+
- Marie-Maxime Tanguay @marie-maxime
|
|
20
|
+
- Max Hilland
|
|
21
|
+
|
|
22
|
+
## 2.0.2 (2026-02-27)
|
|
23
|
+
|
|
24
|
+
This was a version bump only for stack-ui to align it with other projects, there were no code changes.
|
|
25
|
+
|
|
1
26
|
## 2.0.1 (2026-02-27)
|
|
2
27
|
|
|
3
28
|
### 🩹 Fixes
|
|
@@ -22,7 +22,13 @@ export interface TComboBoxProps<I extends object = object, T extends TToken = TT
|
|
|
22
22
|
* @default 200
|
|
23
23
|
*/
|
|
24
24
|
debounceDelay?: number;
|
|
25
|
+
/**
|
|
26
|
+
* @description When true, the popover does not prevent scrolling and does not trap focus.
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
isNonModal?: boolean;
|
|
25
30
|
}
|
|
26
31
|
export interface TComboBoxButtonProps<T extends TToken = TToken> extends TButtonProps<T> {
|
|
27
32
|
state: ComboBoxState<object & TDefaultNodeComponent<object, TToken>>;
|
|
33
|
+
preventFocusOnPress?: boolean;
|
|
28
34
|
}
|
|
@@ -28,5 +28,5 @@ export interface TReactHookFormListBoxProps<I extends object = object, T extends
|
|
|
28
28
|
name: string;
|
|
29
29
|
selectionMode?: Exclude<AriaListBoxProps<I>['selectionMode'], 'none'>;
|
|
30
30
|
}
|
|
31
|
-
export interface TControlledReactHookFormListBoxProps<I extends object = object, T extends TToken = TToken> extends TReactHookFormListBoxProps<I, T>, Omit<TControlledListBoxFormProps<I, T>, 'children' | 'onBlur' | 'selectionMode'> {
|
|
31
|
+
export interface TControlledReactHookFormListBoxProps<I extends object = object, T extends TToken = TToken> extends TReactHookFormListBoxProps<I, T>, Omit<TControlledListBoxFormProps<I, T>, 'children' | 'onBlur' | 'selectionMode' | 'state'> {
|
|
32
32
|
}
|
package/index12.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react-aria"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react-aria"),s=require("./index82.js");function u(o){const{controller:t,activeIndex:r,slides:n}=s.useCarousel(),{params:e}=t??{};return{a11y:typeof e?.a11y=="object"?e.a11y:e?.a11y===!0?{enabled:!0}:void 0,announcerProps:a.mergeProps(o,{"aria-live":"polite",children:n?.[r]?.title??n?.[r]?.ariaLabel})}}exports.useCarouselA11yAnnouncer=u;
|
package/index12.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { mergeProps as
|
|
2
|
+
import { mergeProps as n } from "react-aria";
|
|
3
3
|
import { useCarousel as i } from "./index82.mjs";
|
|
4
|
-
function u(
|
|
5
|
-
const { controller:
|
|
4
|
+
function u(a) {
|
|
5
|
+
const { controller: t, activeIndex: r, slides: o } = i(), { params: e } = t ?? {};
|
|
6
6
|
return {
|
|
7
|
-
a11y:
|
|
8
|
-
announcerProps:
|
|
7
|
+
a11y: typeof e?.a11y == "object" ? e.a11y : e?.a11y === !0 ? { enabled: !0 } : void 0,
|
|
8
|
+
announcerProps: n(a, {
|
|
9
9
|
"aria-live": "polite",
|
|
10
|
-
children:
|
|
10
|
+
children: o?.[r]?.title ?? o?.[r]?.ariaLabel
|
|
11
11
|
})
|
|
12
12
|
};
|
|
13
13
|
}
|
package/index127.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const u=require("react/jsx-runtime"),c=require("react"),i=require("./index8.js");function t({ref:s,...o}){const{state:d,handlePress:e,...r}=o,n=c.useCallback(a=>{e?.(a)},[e]);return u.jsx(i.ButtonWithForwardRef,{...r,ref:s,handlePress:n})}t.displayName="ComboBoxButton";module.exports=t;
|
package/index127.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback as m } from "react";
|
|
3
|
-
import { ButtonWithForwardRef as
|
|
4
|
-
function
|
|
5
|
-
const { state:
|
|
6
|
-
(
|
|
7
|
-
o
|
|
3
|
+
import { ButtonWithForwardRef as l } from "./index8.mjs";
|
|
4
|
+
function u({ ref: t, ...r }) {
|
|
5
|
+
const { state: d, handlePress: o, ...e } = r, s = m(
|
|
6
|
+
(a) => {
|
|
7
|
+
o?.(a);
|
|
8
8
|
},
|
|
9
|
-
[
|
|
9
|
+
[o]
|
|
10
10
|
);
|
|
11
|
-
return /* @__PURE__ */ l
|
|
11
|
+
return /* @__PURE__ */ n(l, { ...e, ref: t, handlePress: s });
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
u.displayName = "ComboBoxButton";
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
u as default
|
|
16
16
|
};
|
package/index151.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
"use strict";const o=require("tailwind-variants"),i=require("./index146.js"),n=require("./index155.js"),t=require("./index168.js"),
|
|
1
|
+
"use strict";const o=require("tailwind-variants"),i=require("./index146.js"),n=require("./index155.js"),t=require("./index168.js"),r=o.tv({base:[i.base,`
|
|
2
2
|
px-4
|
|
3
3
|
py-2
|
|
4
|
+
cursor-pointer
|
|
4
5
|
text-white
|
|
5
6
|
bg-color-1-500
|
|
6
|
-
`],variants:{isOpen:{true:"pointer-events-none",false:"hover:bg-color-1-400 active:bg-color-1-400"}}}),
|
|
7
|
+
`],variants:{isOpen:{true:"pointer-events-none",false:"hover:bg-color-1-400 active:bg-color-1-400"}}}),l={wrapper:()=>"flex flex-col gap-4 relative",label:e=>t({...e,className:"text-gray-3"}),container:()=>"flex flex-col gap-4",inputWrapper:()=>"relative flex items-center outline outline-2 outline-gray-300 focus-within:outline focus-within:outline-black focus-within:outline-2 [&>input]:flex-1 [&>input]:min-w-0 [&>input]:pr-10 [&>input]:border-0 [&>input]:outline-0 [&>input]:bg-transparent [&>input]:text-ellipsis [&>input]:whitespace-nowrap [&>input]:overflow-hidden",button:r,popover:{popover:()=>"w-[var(--comboBox-popover-container-width)] max-h-[300px] overflow-y-auto overflow-x-hidden text-white !bg-color-1-500 rounded-md p-2"},listContainer:e=>t({...e,className:"outline outline-2 outline-white outline-offset-2 p-2 my-4 rounded-md w-full flex flex-col gap-6 max-h-[300px] overflow-y-auto overflow-x-hidden"}),ul:e=>t({...e,className:"w-full flex flex-col gap-6"}),li:()=>"transition w-full hover:text-gray-300 focus-ring-white",group:()=>"flex flex-col gap-4",section:()=>"flex flex-col gap-4",list:{...n},headerText:()=>"text-gray-300",noResults:()=>"p-4 text-center",noResultsText:e=>t({...e,className:"text-gray-400"}),errorMessage:e=>t({...e,size:"footnotes",isError:!0})};module.exports=l;
|
package/index151.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { tv as t } from "tailwind-variants";
|
|
2
2
|
import l from "./index146.mjs";
|
|
3
|
-
import
|
|
3
|
+
import r from "./index155.mjs";
|
|
4
4
|
import o from "./index168.mjs";
|
|
5
|
-
const
|
|
5
|
+
const i = t({
|
|
6
6
|
base: [
|
|
7
7
|
l.base,
|
|
8
8
|
`
|
|
9
9
|
px-4
|
|
10
10
|
py-2
|
|
11
|
+
cursor-pointer
|
|
11
12
|
text-white
|
|
12
13
|
bg-color-1-500
|
|
13
14
|
`
|
|
@@ -23,7 +24,7 @@ const r = t({
|
|
|
23
24
|
label: (e) => o({ ...e, className: "text-gray-3" }),
|
|
24
25
|
container: () => "flex flex-col gap-4",
|
|
25
26
|
inputWrapper: () => "relative flex items-center outline outline-2 outline-gray-300 focus-within:outline focus-within:outline-black focus-within:outline-2 [&>input]:flex-1 [&>input]:min-w-0 [&>input]:pr-10 [&>input]:border-0 [&>input]:outline-0 [&>input]:bg-transparent [&>input]:text-ellipsis [&>input]:whitespace-nowrap [&>input]:overflow-hidden",
|
|
26
|
-
button:
|
|
27
|
+
button: i,
|
|
27
28
|
popover: {
|
|
28
29
|
popover: () => "w-[var(--comboBox-popover-container-width)] max-h-[300px] overflow-y-auto overflow-x-hidden text-white !bg-color-1-500 rounded-md p-2"
|
|
29
30
|
},
|
|
@@ -39,7 +40,7 @@ const r = t({
|
|
|
39
40
|
group: () => "flex flex-col gap-4",
|
|
40
41
|
section: () => "flex flex-col gap-4",
|
|
41
42
|
list: {
|
|
42
|
-
...
|
|
43
|
+
...r
|
|
43
44
|
},
|
|
44
45
|
headerText: () => "text-gray-300",
|
|
45
46
|
noResults: () => "p-4 text-center",
|
package/index17.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react-aria"),f=require("./index82.js");function h(i){const{isDisabled:l,handlePress:d,...u}=i,{controller:r,nextNavigationRef:c,id:p,activeIndex:a}=f.useCarousel(),{params:s,slides:o}=r??{},{slidesPerView:e,loop:g}=s??{},b=typeof s?.a11y=="object"?s.a11y:void 0,x=Math.round(typeof e=="number"?(a+1)/e:a),P=Math.round(o!=null&&typeof e=="number"?o.length/e:o?.length??1),v=x<P,t=l||!g&&!v,{pressProps:y}=n.usePress({onPress:N=>{r?.slideNext(),d?.(N)},isDisabled:t});return{isDisabled:t,navigationProps:n.mergeProps(y,{"aria-disabled":t,"aria-controls":p,"aria-label":b?.nextSlideMessage},u),ref:c}}exports.useCarouselNextNavigation=h;
|
package/index17.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { usePress as h, mergeProps as
|
|
3
|
-
import { useCarousel as
|
|
2
|
+
import { usePress as h, mergeProps as v } from "react-aria";
|
|
3
|
+
import { useCarousel as y } from "./index82.mjs";
|
|
4
4
|
function M(a) {
|
|
5
|
-
const { isDisabled: i, handlePress: l, ...d } = a, { controller:
|
|
6
|
-
typeof e == "number" ? (
|
|
7
|
-
),
|
|
8
|
-
|
|
9
|
-
),
|
|
10
|
-
onPress: (
|
|
11
|
-
|
|
5
|
+
const { isDisabled: i, handlePress: l, ...d } = a, { controller: r, nextNavigationRef: c, id: p, activeIndex: n } = y(), { params: s, slides: o } = r ?? {}, { slidesPerView: e, loop: u } = s ?? {}, g = typeof s?.a11y == "object" ? s.a11y : void 0, b = Math.round(
|
|
6
|
+
typeof e == "number" ? (n + 1) / e : n
|
|
7
|
+
), f = Math.round(
|
|
8
|
+
o != null && typeof e == "number" ? o.length / e : o?.length ?? 1
|
|
9
|
+
), m = b < f, t = i || !u && !m, { pressProps: x } = h({
|
|
10
|
+
onPress: (P) => {
|
|
11
|
+
r?.slideNext(), l?.(P);
|
|
12
12
|
},
|
|
13
|
-
isDisabled:
|
|
13
|
+
isDisabled: t
|
|
14
14
|
});
|
|
15
15
|
return {
|
|
16
|
-
isDisabled:
|
|
17
|
-
navigationProps:
|
|
18
|
-
|
|
16
|
+
isDisabled: t,
|
|
17
|
+
navigationProps: v(
|
|
18
|
+
x,
|
|
19
19
|
{
|
|
20
|
-
"aria-disabled":
|
|
20
|
+
"aria-disabled": t,
|
|
21
21
|
"aria-controls": p,
|
|
22
22
|
"aria-label": g?.nextSlideMessage
|
|
23
23
|
},
|
package/index18.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react-aria"),b=require("./index82.js");function y(r){const{isDisabled:o,handlePress:i,...t}=r,{controller:e,prevNavigationRef:n,id:l,activeIndex:c}=b.useCarousel(),{params:d}=e??{},u=typeof e?.params?.a11y=="object"?e.params.a11y:void 0,{loop:v}=d??{},p=c>0,s=o||!v&&!p,{pressProps:P}=a.usePress({onPress:g=>{e?.slidePrev(),i?.(g)},isDisabled:s});return{isDisabled:s,navigationProps:a.mergeProps(P,{"aria-disabled":s,"aria-controls":l,"aria-label":u?.prevSlideMessage},t),ref:n}}exports.useCarouselPrevNavigation=y;
|
package/index18.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { usePress as u, mergeProps as
|
|
3
|
-
import { useCarousel as
|
|
4
|
-
function
|
|
5
|
-
const { isDisabled: o, handlePress:
|
|
2
|
+
import { usePress as u, mergeProps as b } from "react-aria";
|
|
3
|
+
import { useCarousel as f } from "./index82.mjs";
|
|
4
|
+
function D(a) {
|
|
5
|
+
const { isDisabled: o, handlePress: r, ...i } = a, { controller: s, prevNavigationRef: t, id: n, activeIndex: l } = f(), { params: p } = s ?? {}, c = typeof s?.params?.a11y == "object" ? s.params.a11y : void 0, { loop: d } = p ?? {}, v = l > 0, e = o || !d && !v, { pressProps: P } = u({
|
|
6
6
|
onPress: (m) => {
|
|
7
|
-
s?.slidePrev(),
|
|
7
|
+
s?.slidePrev(), r?.(m);
|
|
8
8
|
},
|
|
9
9
|
isDisabled: e
|
|
10
10
|
});
|
|
11
11
|
return {
|
|
12
12
|
isDisabled: e,
|
|
13
|
-
navigationProps:
|
|
13
|
+
navigationProps: b(
|
|
14
14
|
P,
|
|
15
15
|
{
|
|
16
16
|
"aria-disabled": e,
|
|
@@ -23,5 +23,5 @@ function N(r) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
D as useCarouselPrevNavigation
|
|
27
27
|
};
|
package/index26.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("radashi"),o=require("react"),y=require("react-aria");function v(e,s){if(s.current==null||e==null)return[];const{slideClass:l="swiper-slide"}=e.params;return s.current?.className.split(" ").filter(i=>i.indexOf("swiper-slide")===0||i.indexOf(l)===0)}function w(e){const{title:s,id:l,ariaLabel:n,"aria-label":i,children:g,swiperSlideIndex:P,swiper:t,...d}=e,u=typeof t?.params?.a11y=="object"?t.params.a11y:void 0,{itemRoleDescriptionMessage:p="slide",slideRole:b="group"}=u??{},f=!m.isEmpty(s),a=o.useRef(null),c=o.useMemo(()=>{const r=v(t,a);return{isActive:r?.includes("swiper-slide-active"),isVisible:r?.includes("swiper-slide-visible"),isPrev:r?.includes("swiper-slide-prev"),isNext:r?.includes("swiper-slide-next")}},[a.current]);return{ref:a,slideProps:y.mergeProps(d,{...f?{"aria-labelledby":l}:{"aria-label":n??i},"aria-roledescription":p??void 0,role:b,inert:`!${c.isVisible}`}),titleProps:{},...c}}exports.useCarouselSlide=w;
|
package/index26.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { isEmpty as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { mergeProps as
|
|
5
|
-
function
|
|
2
|
+
import { isEmpty as b } from "radashi";
|
|
3
|
+
import { useRef as f, useMemo as w } from "react";
|
|
4
|
+
import { mergeProps as v } from "react-aria";
|
|
5
|
+
function y(e, s) {
|
|
6
6
|
if (s.current == null || e == null)
|
|
7
7
|
return [];
|
|
8
8
|
const { slideClass: l = "swiper-slide" } = e.params;
|
|
9
9
|
return s.current?.className.split(" ").filter((i) => i.indexOf("swiper-slide") === 0 || i.indexOf(l) === 0);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function R(e) {
|
|
12
12
|
const {
|
|
13
13
|
title: s,
|
|
14
14
|
id: l,
|
|
@@ -16,23 +16,23 @@ function L(e) {
|
|
|
16
16
|
"aria-label": i,
|
|
17
17
|
children: x,
|
|
18
18
|
swiperSlideIndex: g,
|
|
19
|
-
swiper:
|
|
19
|
+
swiper: t,
|
|
20
20
|
...c
|
|
21
|
-
} = e, { itemRoleDescriptionMessage:
|
|
22
|
-
const r =
|
|
21
|
+
} = e, d = typeof t?.params?.a11y == "object" ? t.params.a11y : void 0, { itemRoleDescriptionMessage: p = "slide", slideRole: u = "group" } = d ?? {}, m = !b(s), a = f(null), o = w(() => {
|
|
22
|
+
const r = y(t, a);
|
|
23
23
|
return {
|
|
24
24
|
isActive: r?.includes("swiper-slide-active"),
|
|
25
25
|
isVisible: r?.includes("swiper-slide-visible"),
|
|
26
26
|
isPrev: r?.includes("swiper-slide-prev"),
|
|
27
27
|
isNext: r?.includes("swiper-slide-next")
|
|
28
28
|
};
|
|
29
|
-
}, [
|
|
29
|
+
}, [a.current]);
|
|
30
30
|
return {
|
|
31
|
-
ref:
|
|
32
|
-
slideProps:
|
|
33
|
-
...
|
|
34
|
-
"aria-roledescription":
|
|
35
|
-
role:
|
|
31
|
+
ref: a,
|
|
32
|
+
slideProps: v(c, {
|
|
33
|
+
...m ? { "aria-labelledby": l } : { "aria-label": n ?? i },
|
|
34
|
+
"aria-roledescription": p ?? void 0,
|
|
35
|
+
role: u,
|
|
36
36
|
inert: `!${o.isVisible}`
|
|
37
37
|
}),
|
|
38
38
|
titleProps: {},
|
|
@@ -40,5 +40,5 @@ function L(e) {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
R as useCarouselSlide
|
|
44
44
|
};
|
package/index27.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@react-aria/utils"),v=require("react-aria"),P=require("swiper/modules"),S=require("./index82.js");function M(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const x=M(P),O=["A11y","Controller"],j="Pagination";function C(e){const{children:n,...r}=e,{controller:t,setController:a,modules:s,slides:l,id:c,nextNavigationRef:u,prevNavigationRef:p,swiperProps:d,swiperRef:f,setActiveIndex:g}=S.useCarousel(),i=typeof t?.params?.a11y=="object"?t.params.a11y:void 0,b=[...s?.filter(o=>o!==j)??[],...O].map(o=>x[o]),{containerRoleDescriptionMessage:w="carousel"}=i??{},y={navigation:{nextEl:u.current,prevEl:p.current,enabled:s?.includes("Navigation")},id:c,watchSlidesProgress:!0,role:"group",onSwiper:a,onSlideChange:o=>{g(o.activeIndex)},modules:b,keyboard:{enabled:!0,onlyInViewport:!1},a11y:{enabled:!0,...i},"aria-roledescription":w??void 0,tabIndex:0};return{swiperProps:v.mergeProps(d,y,m.filterDOMProps(r)),slides:l,ref:f}}exports.useCarouselSwiper=C;
|
package/index27.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { filterDOMProps as
|
|
3
|
-
import { mergeProps as
|
|
4
|
-
import * as
|
|
5
|
-
import { useCarousel as
|
|
6
|
-
const b = ["A11y", "Controller"],
|
|
7
|
-
function h(
|
|
8
|
-
const { children: C, ...
|
|
9
|
-
controller:
|
|
10
|
-
setController:
|
|
2
|
+
import { filterDOMProps as w } from "@react-aria/utils";
|
|
3
|
+
import { mergeProps as y } from "react-aria";
|
|
4
|
+
import * as P from "swiper/modules";
|
|
5
|
+
import { useCarousel as x } from "./index82.mjs";
|
|
6
|
+
const b = ["A11y", "Controller"], M = "Pagination";
|
|
7
|
+
function h(s) {
|
|
8
|
+
const { children: C, ...i } = s, {
|
|
9
|
+
controller: o,
|
|
10
|
+
setController: n,
|
|
11
11
|
modules: r,
|
|
12
12
|
slides: a,
|
|
13
13
|
id: l,
|
|
@@ -16,9 +16,9 @@ function h(t) {
|
|
|
16
16
|
swiperProps: c,
|
|
17
17
|
swiperRef: u,
|
|
18
18
|
setActiveIndex: m
|
|
19
|
-
} =
|
|
20
|
-
(e) =>
|
|
21
|
-
), { containerRoleDescriptionMessage: g = "carousel" } =
|
|
19
|
+
} = x(), t = typeof o?.params?.a11y == "object" ? o.params.a11y : void 0, f = [...r?.filter((e) => e !== M) ?? [], ...b].map(
|
|
20
|
+
(e) => P[e]
|
|
21
|
+
), { containerRoleDescriptionMessage: g = "carousel" } = t ?? {}, v = {
|
|
22
22
|
navigation: {
|
|
23
23
|
nextEl: p.current,
|
|
24
24
|
prevEl: d.current,
|
|
@@ -27,7 +27,7 @@ function h(t) {
|
|
|
27
27
|
id: l,
|
|
28
28
|
watchSlidesProgress: !0,
|
|
29
29
|
role: "group",
|
|
30
|
-
onSwiper:
|
|
30
|
+
onSwiper: n,
|
|
31
31
|
onSlideChange: (e) => {
|
|
32
32
|
m(e.activeIndex);
|
|
33
33
|
},
|
|
@@ -38,13 +38,13 @@ function h(t) {
|
|
|
38
38
|
},
|
|
39
39
|
a11y: {
|
|
40
40
|
enabled: !0,
|
|
41
|
-
...
|
|
41
|
+
...t
|
|
42
42
|
},
|
|
43
43
|
"aria-roledescription": g ?? void 0,
|
|
44
44
|
tabIndex: 0
|
|
45
45
|
};
|
|
46
46
|
return {
|
|
47
|
-
swiperProps:
|
|
47
|
+
swiperProps: y(c, v, w(i)),
|
|
48
48
|
slides: a,
|
|
49
49
|
ref: u
|
|
50
50
|
};
|
package/index32.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";const
|
|
2
|
+
"use strict";const n=require("react/jsx-runtime"),ae=require("radashi"),s=require("react"),y=require("react-aria");require("react-hook-form");const pe=require("react-stately"),fe=require("./index78.js"),de=require("./index88.js"),m=require("./index7.js"),me=require("./index48.js"),he=require("./index93.js"),xe=require("./index99.js"),Re=require("./index56.js"),v=require("./index74.js"),be=require("./index38.js"),Pe=require("./index127.js");function Be(i){const{children:I,hookFormRef:h,errorMessage:x,themeName:t="comboBox",tokens:R,customTheme:N,label:b,icon:S=n.jsx(he,{}),closeIcon:V=n.jsx(xe,{}),isDisabled:F=!1,isRequired:M=!1,isReadOnly:E=!1,defaultFilter:T,onInputChange:c,onSelectionChange:w,inputRef:D,buttonRef:O,popoverRef:A,listBoxRef:W,debounceDelay:z=200,isNonModal:P=!0}=i,L=s.useRef(null),a=D??L,K=s.useRef(null),B=O??K,G=s.useRef(null),q=A??G,H=s.useRef(null),g=W??H,u=s.useRef(null),{contains:J}=y.useFilter({sensitivity:"base"}),Q=T??J,p=i.inputValue!==void 0,e=pe.useComboBoxState({...i,defaultFilter:Q,onInputChange:p?c:void 0,onSelectionChange:w}),C=fe.useDebounce(e.inputValue,z);s.useEffect(()=>{p||c?.(C)},[C,p,c]);const{inputProps:U,listBoxProps:X,labelProps:Y,buttonProps:Z,errorMessageProps:_,isInvalid:$}=y.useComboBox({...i,inputRef:a,buttonRef:B,popoverRef:q,listBoxRef:g},e),{onPress:ee,onPressStart:j,onPressEnd:qe,onPressChange:ge,preventFocusOnPress:ne,...te}=Z,{isOpen:l,selectedItem:f,selectionManager:oe}=e,{isFocused:se,isSelectAll:re,isEmpty:ie}=oe,d=!ae.isEmpty(e.inputValue),k=!ie,o={...R,isInvalid:$,isOpen:l,isFocused:se,hasValue:d,hasSelectedItem:k,isSelectAll:re,isReadOnly:E,isDisabled:F,isRequired:M},ue=s.useCallback(r=>{r!=null&&(h?.(r),a.current=r)},[h,a]),le=s.useMemo(()=>f!=null&&!l?f.rendered:e.inputValue,[f,e.inputValue,l]),ce=de(`${t}.input`,R);return n.jsxs(m.Box,{themeName:`${t}.wrapper`,tokens:o,customTheme:N,children:[b!=null&&n.jsx(v.Typography,{...Y,as:"label",themeName:`${t}.label`,tokens:o,children:b}),n.jsxs(m.Box,{themeName:`${t}.container`,children:[n.jsxs(m.BoxWithForwardRef,{ref:u,themeName:`${t}.inputWrapper`,tokens:o,children:[n.jsx("input",{...U,ref:ue,value:le,className:ce}),n.jsx(Pe,{state:e,themeName:`${t}.button`,tokens:o,...te,preventFocusOnPress:ne,ref:B,handlePress:r=>{if(d||k){e.setSelectedKey(null),e.selectionManager.clearSelection(),e.setInputValue("");return}j!=null?j(r):ee?.(r)},children:n.jsx(me,{themeName:`${t}.icon`,tokens:o,icon:d?V:S})})]}),l&&u.current!=null&&e.collection.size>0&&n.jsx(Re.Popover,{themeName:`${t}.popover`,tokens:o,state:e,triggerRef:u,placement:"bottom",sizeRef:u,popoverRef:q,isNonModal:P,autoFocus:!1,contain:!P,children:n.jsx(be.ControlledListBox,{...X,themeName:`${t}.list`,tokens:o,state:e,ref:g,children:I})}),$&&x!=null&&n.jsx(v.Typography,{tokens:o,themeName:`${t}.errorMessage`,..._,children:x})]})]})}module.exports=Be;
|
package/index32.mjs
CHANGED
|
@@ -1,114 +1,134 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as t, jsxs as
|
|
3
|
-
import { isEmpty as
|
|
4
|
-
import { useRef as s,
|
|
5
|
-
import { useFilter as
|
|
2
|
+
import { jsx as t, jsxs as h } from "react/jsx-runtime";
|
|
3
|
+
import { isEmpty as ce } from "radashi";
|
|
4
|
+
import { useRef as s, useEffect as pe, useCallback as me, useMemo as fe } from "react";
|
|
5
|
+
import { useFilter as he, useComboBox as de } from "react-aria";
|
|
6
6
|
import "react-hook-form";
|
|
7
|
-
import { useComboBoxState as
|
|
8
|
-
import { useDebounce as
|
|
9
|
-
import
|
|
10
|
-
import { Box as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { Popover as
|
|
15
|
-
import { Typography as
|
|
16
|
-
import { ControlledListBox as
|
|
17
|
-
import
|
|
18
|
-
function
|
|
7
|
+
import { useComboBoxState as Re } from "react-stately";
|
|
8
|
+
import { useDebounce as be } from "./index78.mjs";
|
|
9
|
+
import Pe from "./index88.mjs";
|
|
10
|
+
import { Box as y, BoxWithForwardRef as xe } from "./index7.mjs";
|
|
11
|
+
import Be from "./index48.mjs";
|
|
12
|
+
import Ce from "./index93.mjs";
|
|
13
|
+
import ge from "./index99.mjs";
|
|
14
|
+
import { Popover as Ie } from "./index56.mjs";
|
|
15
|
+
import { Typography as S } from "./index74.mjs";
|
|
16
|
+
import { ControlledListBox as ke } from "./index38.mjs";
|
|
17
|
+
import ve from "./index127.mjs";
|
|
18
|
+
function Ke(l) {
|
|
19
19
|
const {
|
|
20
|
-
children:
|
|
21
|
-
hookFormRef:
|
|
22
|
-
errorMessage:
|
|
23
|
-
themeName:
|
|
24
|
-
tokens:
|
|
25
|
-
customTheme:
|
|
26
|
-
label:
|
|
27
|
-
icon:
|
|
28
|
-
closeIcon:
|
|
29
|
-
isDisabled:
|
|
30
|
-
isRequired:
|
|
31
|
-
isReadOnly:
|
|
32
|
-
defaultFilter:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
20
|
+
children: V,
|
|
21
|
+
hookFormRef: d,
|
|
22
|
+
errorMessage: R,
|
|
23
|
+
themeName: o = "comboBox",
|
|
24
|
+
tokens: b,
|
|
25
|
+
customTheme: $,
|
|
26
|
+
label: P,
|
|
27
|
+
icon: F = /* @__PURE__ */ t(Ce, {}),
|
|
28
|
+
closeIcon: M = /* @__PURE__ */ t(ge, {}),
|
|
29
|
+
isDisabled: D = !1,
|
|
30
|
+
isRequired: E = !1,
|
|
31
|
+
isReadOnly: T = !1,
|
|
32
|
+
defaultFilter: w,
|
|
33
|
+
onInputChange: a,
|
|
34
|
+
onSelectionChange: O,
|
|
35
|
+
inputRef: W,
|
|
36
|
+
buttonRef: j,
|
|
37
|
+
popoverRef: z,
|
|
38
|
+
listBoxRef: A,
|
|
39
|
+
debounceDelay: L = 200,
|
|
40
|
+
isNonModal: x = !0
|
|
41
|
+
} = l, q = s(null), c = W ?? q, K = s(null), B = j ?? K, G = s(null), C = z ?? G, H = s(null), g = A ?? H, i = s(null), { contains: J } = he({ sensitivity: "base" }), Q = w ?? J, p = l.inputValue !== void 0, e = Re({
|
|
42
|
+
...l,
|
|
43
|
+
defaultFilter: Q,
|
|
44
|
+
onInputChange: p ? a : void 0,
|
|
45
|
+
onSelectionChange: O
|
|
46
|
+
}), I = be(e.inputValue, L);
|
|
47
|
+
pe(() => {
|
|
48
|
+
p || a?.(I);
|
|
49
|
+
}, [I, p, a]);
|
|
50
|
+
const { inputProps: U, listBoxProps: X, labelProps: Y, buttonProps: Z, errorMessageProps: _, isInvalid: k } = de(
|
|
51
|
+
{ ...l, inputRef: c, buttonRef: B, popoverRef: C, listBoxRef: g },
|
|
52
|
+
e
|
|
53
|
+
), {
|
|
54
|
+
onPress: ee,
|
|
55
|
+
onPressStart: v,
|
|
56
|
+
onPressEnd: Ne,
|
|
57
|
+
onPressChange: ye,
|
|
58
|
+
preventFocusOnPress: oe,
|
|
59
|
+
...te
|
|
60
|
+
} = Z, { isOpen: u, selectedItem: m, selectionManager: ne } = e, { isFocused: re, isSelectAll: se, isEmpty: le } = ne, f = !ce(e.inputValue), N = !le, n = {
|
|
61
|
+
...b,
|
|
62
|
+
isInvalid: k,
|
|
63
|
+
isOpen: u,
|
|
64
|
+
isFocused: re,
|
|
65
|
+
hasValue: f,
|
|
66
|
+
hasSelectedItem: N,
|
|
67
|
+
isSelectAll: se,
|
|
68
|
+
isReadOnly: T,
|
|
69
|
+
isDisabled: D,
|
|
70
|
+
isRequired: E
|
|
71
|
+
}, ie = me(
|
|
59
72
|
(r) => {
|
|
60
|
-
r != null && (
|
|
73
|
+
r != null && (d?.(r), c.current = r);
|
|
61
74
|
},
|
|
62
|
-
[
|
|
63
|
-
),
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */ t("input", { ...
|
|
75
|
+
[d, c]
|
|
76
|
+
), ue = fe(() => m != null && !u ? m.rendered : e.inputValue, [m, e.inputValue, u]), ae = Pe(`${o}.input`, b);
|
|
77
|
+
return /* @__PURE__ */ h(y, { themeName: `${o}.wrapper`, tokens: n, customTheme: $, children: [
|
|
78
|
+
P != null && /* @__PURE__ */ t(S, { ...Y, as: "label", themeName: `${o}.label`, tokens: n, children: P }),
|
|
79
|
+
/* @__PURE__ */ h(y, { themeName: `${o}.container`, children: [
|
|
80
|
+
/* @__PURE__ */ h(xe, { ref: i, themeName: `${o}.inputWrapper`, tokens: n, children: [
|
|
81
|
+
/* @__PURE__ */ t("input", { ...U, ref: ie, value: ue, className: ae }),
|
|
69
82
|
/* @__PURE__ */ t(
|
|
70
|
-
|
|
83
|
+
ve,
|
|
71
84
|
{
|
|
72
|
-
state:
|
|
73
|
-
themeName: `${
|
|
85
|
+
state: e,
|
|
86
|
+
themeName: `${o}.button`,
|
|
74
87
|
tokens: n,
|
|
75
|
-
...
|
|
76
|
-
|
|
88
|
+
...te,
|
|
89
|
+
preventFocusOnPress: oe,
|
|
90
|
+
ref: B,
|
|
77
91
|
handlePress: (r) => {
|
|
78
|
-
|
|
92
|
+
if (f || N) {
|
|
93
|
+
e.setSelectedKey(null), e.selectionManager.clearSelection(), e.setInputValue("");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
v != null ? v(r) : ee?.(r);
|
|
79
97
|
},
|
|
80
|
-
children: /* @__PURE__ */ t(
|
|
98
|
+
children: /* @__PURE__ */ t(Be, { themeName: `${o}.icon`, tokens: n, icon: f ? M : F })
|
|
81
99
|
}
|
|
82
100
|
)
|
|
83
101
|
] }),
|
|
84
|
-
|
|
85
|
-
|
|
102
|
+
u && i.current != null && e.collection.size > 0 && /* @__PURE__ */ t(
|
|
103
|
+
Ie,
|
|
86
104
|
{
|
|
87
|
-
themeName: `${
|
|
105
|
+
themeName: `${o}.popover`,
|
|
88
106
|
tokens: n,
|
|
89
|
-
state:
|
|
90
|
-
triggerRef:
|
|
107
|
+
state: e,
|
|
108
|
+
triggerRef: i,
|
|
91
109
|
placement: "bottom",
|
|
92
|
-
sizeRef:
|
|
93
|
-
popoverRef:
|
|
110
|
+
sizeRef: i,
|
|
111
|
+
popoverRef: C,
|
|
112
|
+
isNonModal: x,
|
|
94
113
|
autoFocus: !1,
|
|
114
|
+
contain: !x,
|
|
95
115
|
children: /* @__PURE__ */ t(
|
|
96
|
-
|
|
116
|
+
ke,
|
|
97
117
|
{
|
|
98
|
-
...
|
|
99
|
-
themeName: `${
|
|
118
|
+
...X,
|
|
119
|
+
themeName: `${o}.list`,
|
|
100
120
|
tokens: n,
|
|
101
|
-
state:
|
|
102
|
-
ref:
|
|
103
|
-
children:
|
|
121
|
+
state: e,
|
|
122
|
+
ref: g,
|
|
123
|
+
children: V
|
|
104
124
|
}
|
|
105
125
|
)
|
|
106
126
|
}
|
|
107
127
|
),
|
|
108
|
-
|
|
128
|
+
k && R != null && /* @__PURE__ */ t(S, { tokens: n, themeName: `${o}.errorMessage`, ..._, children: R })
|
|
109
129
|
] })
|
|
110
130
|
] });
|
|
111
131
|
}
|
|
112
132
|
export {
|
|
113
|
-
|
|
133
|
+
Ke as default
|
|
114
134
|
};
|
package/index35.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"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),r=require("react-aria"),i=require("./index7.js");function p({themeName:o="datePicker",tokens:s,...t}){const a=u.useRef(null),{state:n,children:c}={...t},{popoverProps:l,underlayProps:d}=r.usePopover({...t,popoverRef:a},n);return e.jsx(r.Overlay,{children:e.jsxs(i.Box,{themeName:`${o}.calendarPopoverWrapper`,tokens:s,children:[e.jsx(i.Box,{themeName:`${o}.calendarUnderlay`,tokens:s,...d}),e.jsxs(i.BoxWithForwardRef,{themeName:`${o}.calendarPopover`,tokens:s,...l,ref:a,children:[e.jsx(r.DismissButton,{onDismiss:n.close}),c,e.jsx(r.DismissButton,{onDismiss:n.close})]})]})})}exports.CalendarPopover=p;
|
package/index35.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { usePopover as
|
|
5
|
-
import { Box as
|
|
6
|
-
function B({ themeName:
|
|
7
|
-
const i =
|
|
2
|
+
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as d } from "react";
|
|
4
|
+
import { usePopover as f, Overlay as u, DismissButton as a } from "react-aria";
|
|
5
|
+
import { Box as l, BoxWithForwardRef as v } from "./index7.mjs";
|
|
6
|
+
function B({ themeName: o = "datePicker", tokens: e, ...n }) {
|
|
7
|
+
const i = d(null), { state: s, children: c } = { ...n }, { popoverProps: t, underlayProps: m } = f(
|
|
8
8
|
{
|
|
9
9
|
...n,
|
|
10
10
|
popoverRef: i
|
|
11
11
|
},
|
|
12
|
-
|
|
12
|
+
s
|
|
13
13
|
);
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */ r(
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */ r(
|
|
18
|
-
|
|
19
|
-
/* @__PURE__ */ r(
|
|
14
|
+
return /* @__PURE__ */ r(u, { children: /* @__PURE__ */ p(l, { themeName: `${o}.calendarPopoverWrapper`, tokens: e, children: [
|
|
15
|
+
/* @__PURE__ */ r(l, { themeName: `${o}.calendarUnderlay`, tokens: e, ...m }),
|
|
16
|
+
/* @__PURE__ */ p(v, { themeName: `${o}.calendarPopover`, tokens: e, ...t, ref: i, children: [
|
|
17
|
+
/* @__PURE__ */ r(a, { onDismiss: s.close }),
|
|
18
|
+
c,
|
|
19
|
+
/* @__PURE__ */ r(a, { onDismiss: s.close })
|
|
20
20
|
] })
|
|
21
|
-
] });
|
|
21
|
+
] }) });
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
24
|
B as CalendarPopover
|
package/index38.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),O=require("radashi"),E=require("react"),M=require("react-aria"),v=require("react-hook-form"),H=require("react-stately"),I=require("./index89.js"),N=require("./index7.js"),V=require("./index8.js"),S=require("./index74.js"),K=require("./index40.js"),A=require("./index39.js"),W={item:K,section:A};function k({ref:e,...o}){const{state:r,themeName:c="listBox",tokens:m,customTheme:b,label:d,escapeKeyBehavior:h="clearSelection",linkElementType:R=V.Anchor,isDisabled:n=!1,isRequired:C=!1,isInvalid:L=!1,isError:x=!1,errorMessage:f,disabledKeys:y,fieldRef:q,...B}=o,g=r.collection.getKeys(),a=t=>{if(t!=null){if(q?.(t),e==null)return;typeof e=="function"?e(t):typeof e=="object"&&(e.current=t)}},{listBoxProps:j,labelProps:i}=M.useListBox({...B,escapeKeyBehavior:h,label:d,disabledKeys:n?g:y},r,a),l={...m,isDisabled:n,isRequired:C,isInvalid:L};return s.jsxs(N.Box,{themeName:`${c}.wrapper`,tokens:l,customTheme:b,children:[d!=null&&s.jsx(S.Typography,{...i,themeName:`${c}.label`,tokens:l,children:d}),s.jsx(N.BoxWithForwardRef,{ref:e,as:"ul",...j,themeName:`${c}.list`,tokens:l,children:[...r.collection].map(t=>{const{key:F}=t,u=t.type??"item",p=W[u]??K;return s.jsx(p,{[u]:t,state:r,tokens:{...m,type:u},themeName:`${c}.${u}`,linkElementType:R},F)})}),x&&f!=null&&s.jsx(S.Typography,{themeName:`${c}.errorMessage`,tokens:{...l,isError:x},children:f})]})}k.displayName="ControlledListBox";function Q(e){const o=H.useListState(e),r=E.useRef(null);return s.jsx(k,{...e,state:o,ref:r})}function $({ref:e,...o}){const{name:r,rules:c,isRequired:m,isDisabled:b,tokens:d,selectionMode:h="single",errorMessage:R,...n}=o,{control:C,setValue:L,watch:x,getValues:f}=v.useFormContext(),{selectedKeys:y=x(r),defaultSelectedKeys:q=f(r)}=n,{t:B}=I.useTranslation(),g=E.useRef(null),a={required:m?B("FORM.ERROR.REQUIRED")??"required":!1,disabled:b,...c},j=H.useListState({...n,selectionMode:h,selectedKeys:y,children:o.children,onSelectionChange:i=>{n.onSelectionChange?.(i),L(r,i,{shouldDirty:!0,shouldTouch:!0}),g.current?.(i)}});return s.jsx(v.Controller,{...n,defaultValue:q,name:r,control:C,rules:a,disabled:a?.disabled,render:({field:i,fieldState:l})=>{const{ref:t,onChange:F,...u}=i;g.current=F;const p=!O.isEmpty(l.error),T={isDisabled:i.disabled??!1,isRequired:a?.required===!0||a?.required==="required",isInvalid:l.invalid,isError:p},{isError:_,...D}=T,P={...d,...D};return s.jsx(k,{...M.mergeProps(n,u,T),state:j,tokens:P,isError:p,selectionMode:h,selectedKeys:y,defaultSelectedKeys:q,errorMessage:R??l.error?.message,ref:e})}})}$.displayName="ControlledReactHookFormListBox";function U(e){const o=E.useRef(null);return s.jsx($,{...e,ref:o})}exports.ControlledListBox=k;exports.ControlledReactHookFormListBox=$;exports.ListBox=Q;exports.ReactHookFormListBox=U;
|
package/index38.mjs
CHANGED
|
@@ -1,130 +1,138 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { isEmpty as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { useListBox as
|
|
6
|
-
import { useFormContext as
|
|
7
|
-
import { useListState as
|
|
8
|
-
import { useTranslation as
|
|
9
|
-
import { Box as
|
|
10
|
-
import { Anchor as
|
|
11
|
-
import { Typography as
|
|
2
|
+
import { jsxs as P, jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import { isEmpty as S } from "radashi";
|
|
4
|
+
import { useRef as F } from "react";
|
|
5
|
+
import { useListBox as j, mergeProps as H } from "react-aria";
|
|
6
|
+
import { useFormContext as I, Controller as V } from "react-hook-form";
|
|
7
|
+
import { useListState as K } from "react-stately";
|
|
8
|
+
import { useTranslation as W } from "./index89.mjs";
|
|
9
|
+
import { Box as A, BoxWithForwardRef as Q } from "./index7.mjs";
|
|
10
|
+
import { Anchor as U } from "./index8.mjs";
|
|
11
|
+
import { Typography as T } from "./index74.mjs";
|
|
12
12
|
import M from "./index40.mjs";
|
|
13
|
-
import
|
|
14
|
-
const
|
|
13
|
+
import _ from "./index39.mjs";
|
|
14
|
+
const w = {
|
|
15
15
|
item: M,
|
|
16
|
-
section:
|
|
16
|
+
section: _
|
|
17
17
|
};
|
|
18
|
-
function
|
|
18
|
+
function N({ ref: e, ...t }) {
|
|
19
19
|
const {
|
|
20
|
-
|
|
20
|
+
state: o,
|
|
21
|
+
themeName: a = "listBox",
|
|
21
22
|
tokens: u,
|
|
22
|
-
customTheme:
|
|
23
|
-
label:
|
|
24
|
-
escapeKeyBehavior:
|
|
25
|
-
linkElementType:
|
|
26
|
-
isDisabled:
|
|
27
|
-
isRequired:
|
|
28
|
-
isInvalid:
|
|
23
|
+
customTheme: x,
|
|
24
|
+
label: d,
|
|
25
|
+
escapeKeyBehavior: f = "clearSelection",
|
|
26
|
+
linkElementType: C = U,
|
|
27
|
+
isDisabled: s = !1,
|
|
28
|
+
isRequired: E = !1,
|
|
29
|
+
isInvalid: R = !1,
|
|
29
30
|
isError: p = !1,
|
|
30
|
-
errorMessage:
|
|
31
|
-
disabledKeys:
|
|
32
|
-
fieldRef:
|
|
33
|
-
...
|
|
34
|
-
} =
|
|
35
|
-
if (
|
|
36
|
-
if (
|
|
31
|
+
errorMessage: h,
|
|
32
|
+
disabledKeys: y,
|
|
33
|
+
fieldRef: g,
|
|
34
|
+
...B
|
|
35
|
+
} = t, k = o.collection.getKeys(), c = (r) => {
|
|
36
|
+
if (r != null) {
|
|
37
|
+
if (g?.(r), e == null)
|
|
37
38
|
return;
|
|
38
|
-
typeof e == "function" ? e(
|
|
39
|
+
typeof e == "function" ? e(r) : typeof e == "object" && (e.current = r);
|
|
39
40
|
}
|
|
40
|
-
}, { listBoxProps:
|
|
41
|
+
}, { listBoxProps: L, labelProps: n } = j(
|
|
41
42
|
{
|
|
42
|
-
...
|
|
43
|
-
escapeKeyBehavior:
|
|
44
|
-
label:
|
|
45
|
-
disabledKeys:
|
|
43
|
+
...B,
|
|
44
|
+
escapeKeyBehavior: f,
|
|
45
|
+
label: d,
|
|
46
|
+
disabledKeys: s ? k : y
|
|
46
47
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
),
|
|
48
|
+
o,
|
|
49
|
+
c
|
|
50
|
+
), i = {
|
|
50
51
|
...u,
|
|
51
|
-
isDisabled:
|
|
52
|
-
isRequired:
|
|
53
|
-
isInvalid:
|
|
54
|
-
isError: p
|
|
52
|
+
isDisabled: s,
|
|
53
|
+
isRequired: E,
|
|
54
|
+
isInvalid: R
|
|
55
55
|
};
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
56
|
+
return /* @__PURE__ */ P(A, { themeName: `${a}.wrapper`, tokens: i, customTheme: x, children: [
|
|
57
|
+
d != null && /* @__PURE__ */ l(T, { ...n, themeName: `${a}.label`, tokens: i, children: d }),
|
|
58
|
+
/* @__PURE__ */ l(
|
|
59
|
+
Q,
|
|
60
60
|
{
|
|
61
61
|
ref: e,
|
|
62
62
|
as: "ul",
|
|
63
|
-
...
|
|
64
|
-
themeName: `${
|
|
65
|
-
tokens:
|
|
66
|
-
children: [...
|
|
67
|
-
const { key:
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
|
|
63
|
+
...L,
|
|
64
|
+
themeName: `${a}.list`,
|
|
65
|
+
tokens: i,
|
|
66
|
+
children: [...o.collection].map((r) => {
|
|
67
|
+
const { key: q } = r, m = r.type ?? "item", b = w[m] ?? M;
|
|
68
|
+
return /* @__PURE__ */ l(
|
|
69
|
+
b,
|
|
70
70
|
{
|
|
71
|
-
[
|
|
72
|
-
state:
|
|
73
|
-
tokens: { ...u, type:
|
|
74
|
-
themeName: `${
|
|
75
|
-
linkElementType:
|
|
71
|
+
[m]: r,
|
|
72
|
+
state: o,
|
|
73
|
+
tokens: { ...u, type: m },
|
|
74
|
+
themeName: `${a}.${m}`,
|
|
75
|
+
linkElementType: C
|
|
76
76
|
},
|
|
77
|
-
|
|
77
|
+
q
|
|
78
78
|
);
|
|
79
79
|
})
|
|
80
80
|
}
|
|
81
81
|
),
|
|
82
|
-
p &&
|
|
82
|
+
p && h != null && /* @__PURE__ */ l(T, { themeName: `${a}.errorMessage`, tokens: { ...i, isError: p }, children: h })
|
|
83
83
|
] });
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
function
|
|
87
|
-
const
|
|
88
|
-
return /* @__PURE__ */
|
|
85
|
+
N.displayName = "ControlledListBox";
|
|
86
|
+
function le(e) {
|
|
87
|
+
const t = K(e), o = F(null);
|
|
88
|
+
return /* @__PURE__ */ l(N, { ...e, state: t, ref: o });
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
const { name: o, rules:
|
|
92
|
-
required:
|
|
93
|
-
disabled:
|
|
94
|
-
...
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
function $({ ref: e, ...t }) {
|
|
91
|
+
const { name: o, rules: a, isRequired: u, isDisabled: x, tokens: d, selectionMode: f = "single", errorMessage: C, ...s } = t, { control: E, setValue: R, watch: p, getValues: h } = I(), { selectedKeys: y = p(o), defaultSelectedKeys: g = h(o) } = s, { t: B } = W(), k = F(null), c = {
|
|
92
|
+
required: u ? B("FORM.ERROR.REQUIRED") ?? "required" : !1,
|
|
93
|
+
disabled: x,
|
|
94
|
+
...a
|
|
95
|
+
}, L = K({
|
|
96
|
+
...s,
|
|
97
|
+
selectionMode: f,
|
|
98
|
+
selectedKeys: y,
|
|
99
|
+
children: t.children,
|
|
100
|
+
onSelectionChange: (n) => {
|
|
101
|
+
s.onSelectionChange?.(n), R(o, n, { shouldDirty: !0, shouldTouch: !0 }), k.current?.(n);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return /* @__PURE__ */ l(
|
|
105
|
+
V,
|
|
98
106
|
{
|
|
99
|
-
...
|
|
100
|
-
defaultValue:
|
|
107
|
+
...s,
|
|
108
|
+
defaultValue: g,
|
|
101
109
|
name: o,
|
|
102
|
-
control:
|
|
103
|
-
rules:
|
|
104
|
-
disabled:
|
|
105
|
-
render: ({ field:
|
|
106
|
-
const { ref:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
control: E,
|
|
111
|
+
rules: c,
|
|
112
|
+
disabled: c?.disabled,
|
|
113
|
+
render: ({ field: n, fieldState: i }) => {
|
|
114
|
+
const { ref: r, onChange: q, ...m } = n;
|
|
115
|
+
k.current = q;
|
|
116
|
+
const b = !S(i.error), v = {
|
|
117
|
+
isDisabled: n.disabled ?? !1,
|
|
118
|
+
isRequired: c?.required === !0 || c?.required === "required",
|
|
119
|
+
isInvalid: i.invalid,
|
|
120
|
+
isError: b
|
|
121
|
+
}, { isError: z, ...D } = v, O = {
|
|
122
|
+
...d,
|
|
123
|
+
...D
|
|
114
124
|
};
|
|
115
|
-
return /* @__PURE__ */
|
|
116
|
-
|
|
125
|
+
return /* @__PURE__ */ l(
|
|
126
|
+
N,
|
|
117
127
|
{
|
|
118
|
-
...
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
defaultSelectedKeys: h,
|
|
127
|
-
errorMessage: f ?? d.error?.message,
|
|
128
|
+
...H(s, m, v),
|
|
129
|
+
state: L,
|
|
130
|
+
tokens: O,
|
|
131
|
+
isError: b,
|
|
132
|
+
selectionMode: f,
|
|
133
|
+
selectedKeys: y,
|
|
134
|
+
defaultSelectedKeys: g,
|
|
135
|
+
errorMessage: C ?? i.error?.message,
|
|
128
136
|
ref: e
|
|
129
137
|
}
|
|
130
138
|
);
|
|
@@ -132,14 +140,14 @@ function T({ ref: e, ...r }) {
|
|
|
132
140
|
}
|
|
133
141
|
);
|
|
134
142
|
}
|
|
135
|
-
|
|
136
|
-
function
|
|
137
|
-
const
|
|
138
|
-
return /* @__PURE__ */
|
|
143
|
+
$.displayName = "ControlledReactHookFormListBox";
|
|
144
|
+
function ae(e) {
|
|
145
|
+
const t = F(null);
|
|
146
|
+
return /* @__PURE__ */ l($, { ...e, ref: t });
|
|
139
147
|
}
|
|
140
148
|
export {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
149
|
+
N as ControlledListBox,
|
|
150
|
+
$ as ControlledReactHookFormListBox,
|
|
151
|
+
le as ListBox,
|
|
152
|
+
ae as ReactHookFormListBox
|
|
145
153
|
};
|
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"),
|
|
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
|
|
4
|
-
import { usePopover as
|
|
5
|
-
import { Box as E, BoxWithForwardRef as
|
|
6
|
-
function
|
|
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:
|
|
8
|
+
children: m,
|
|
9
9
|
themeName: o = "popover",
|
|
10
10
|
tokens: a,
|
|
11
11
|
customTheme: f,
|
|
12
12
|
placement: u = "bottom",
|
|
13
|
-
offset:
|
|
13
|
+
offset: d = 5,
|
|
14
14
|
state: r,
|
|
15
|
-
arrow:
|
|
16
|
-
sizeRef:
|
|
17
|
-
popoverRef:
|
|
15
|
+
arrow: c,
|
|
16
|
+
sizeRef: h,
|
|
17
|
+
popoverRef: R,
|
|
18
18
|
triggerRef: v,
|
|
19
19
|
contain: P = !0,
|
|
20
|
-
autoFocus:
|
|
21
|
-
restoreFocus:
|
|
22
|
-
} =
|
|
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
|
-
...
|
|
24
|
+
...t,
|
|
25
25
|
placement: u,
|
|
26
|
-
offset:
|
|
26
|
+
offset: d,
|
|
27
27
|
popoverRef: p
|
|
28
28
|
},
|
|
29
29
|
r
|
|
30
|
-
),
|
|
30
|
+
), s = {
|
|
31
31
|
placement: N ?? "bottom",
|
|
32
|
-
isOpen:
|
|
32
|
+
isOpen: k,
|
|
33
33
|
...a
|
|
34
|
-
},
|
|
35
|
-
[`--${o?.replace(".", "-")}-container-width`]: `${
|
|
36
|
-
...
|
|
37
|
-
};
|
|
38
|
-
return /* @__PURE__ */ i(
|
|
39
|
-
/* @__PURE__ */ e(E, { themeName: `${o}.underlay`, tokens:
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
|
|
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:
|
|
45
|
+
tokens: s,
|
|
46
46
|
ref: p,
|
|
47
|
-
...
|
|
48
|
-
|
|
47
|
+
...n,
|
|
48
|
+
tabIndex: z,
|
|
49
|
+
style: $,
|
|
49
50
|
children: [
|
|
50
|
-
|
|
51
|
-
/* @__PURE__ */ e(
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */ e(
|
|
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
|
-
|
|
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.
|
|
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.
|
|
48
|
+
"swiper": "^12.1.2",
|
|
49
49
|
"tailwind-variants": "^3.2.2",
|
|
50
50
|
"usehooks-ts": "^3.1.0"
|
|
51
51
|
}
|