wimui 0.53.1 → 0.54.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,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../_internal/OverlayBase.cjs"),r=require("./dialog.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=(0,i.createContext)(void 0),c=()=>{let e=(0,i.useContext)(s);if(!e)throw Error(`Dialog sub-components must be used within Dialog`);return e},l=({children:e,open:t,onOpenChange:n,defaultOpen:r=!1,closeOnOverlayClick:a
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../_internal/OverlayBase.cjs"),r=require("./dialog.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=(0,i.createContext)(void 0),c=()=>{let e=(0,i.useContext)(s);if(!e)throw Error(`Dialog sub-components must be used within Dialog`);return e},l=({children:e,open:t,onOpenChange:n,defaultOpen:r=!1,role:a=`dialog`,closeOnOverlayClick:c=a!==`alertdialog`})=>{let[l,u]=(0,i.useState)(r),d=t!==void 0,f=d?t:l,p=e=>{d||u(e),n?.(e)},m=`wim-dialog-${(0,i.useId)()}`,h=`${m}-title`,g=`${m}-description`;return(0,o.jsx)(s.Provider,{value:{titleId:h,descriptionId:g,open:f,onOpenChange:p,closeOnOverlayClick:c,role:a},children:e})};l.displayName=`Dialog`;var u=({children:e,className:n,onClick:r,asChild:i=!1,...a})=>{let{onOpenChange:s}=c();return(0,o.jsx)(i?t.Root:`button`,{type:`button`,className:n,onClick:e=>{r?.(e),s(!0)},...a,children:(0,o.jsx)(t.Slottable,{children:e})})};u.displayName=`Dialog.Trigger`;var d=({children:e,className:n,onClick:r,asChild:i=!1,...a})=>{let{onOpenChange:s}=c();return(0,o.jsx)(i?t.Root:`button`,{type:`button`,className:n,onClick:e=>{r?.(e),s(!1)},...a,children:(0,o.jsx)(t.Slottable,{children:e})})};d.displayName=`Dialog.Close`;var f=({children:e,className:i,asChild:s=!1,open:l,onOpenChange:u,role:d,...f})=>{let{open:p,onOpenChange:m,titleId:h,descriptionId:g,closeOnOverlayClick:_,role:v}=c(),y=l===void 0?p:l,b=u===void 0?m:u,x=s?t.Root:`div`;return(0,o.jsx)(n.OverlayBase,{...f,open:y,onOpenChange:b,closeOnOverlayClick:_,overlayClassName:r.default.overlay,role:d??v,"aria-labelledby":h,"aria-describedby":g,children:(0,o.jsx)(x,{className:(0,a.default)(`wim-dialog`,r.default.content,i),children:(0,o.jsx)(t.Slottable,{children:e})})})};f.displayName=`Dialog.Content`;var p=({children:e,className:t,...n})=>(0,o.jsx)(`div`,{className:(0,a.default)(r.default.header,t),"data-testid":`dialog-header`,...n,children:e});p.displayName=`Dialog.Header`;var m=({children:e,className:t,layout:n,...i})=>(0,o.jsx)(`div`,{className:(0,a.default)(r.default.footer,t),"data-layout":n,"data-testid":`dialog-footer`,...i,children:e});m.displayName=`Dialog.Footer`;var h=({children:e,className:t,...n})=>{let{titleId:i}=c();return(0,o.jsx)(`h2`,{id:i,className:(0,a.default)(r.default.title,t),"data-testid":`dialog-title`,...n,children:e})};h.displayName=`Dialog.Title`;var g=({children:e,className:t,...n})=>{let{descriptionId:i}=c();return(0,o.jsx)(`p`,{id:i,className:(0,a.default)(r.default.description,t),"data-testid":`dialog-description`,...n,children:e})};g.displayName=`Dialog.Description`;var _=e=>(0,o.jsx)(l,{...e});_.displayName=`Dialog`,_.Trigger=u,_.Content=f,_.Close=d,_.Header=p,_.Footer=m,_.Title=h,_.Description=g,exports.Dialog=_,exports.default=_,exports.DialogClose=d,exports.DialogContent=f,exports.DialogDescription=g,exports.DialogFooter=m,exports.DialogHeader=p,exports.DialogTitle=h,exports.DialogTrigger=u,exports.useDialog=c;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { OverlayBase } from '../../_internal/OverlayBase';
|
|
3
|
+
/** The ARIA role the dialog content announces itself with. */
|
|
4
|
+
export type DialogRole = "dialog" | "alertdialog";
|
|
3
5
|
type DialogContextType = {
|
|
4
6
|
titleId: string;
|
|
5
7
|
descriptionId: string;
|
|
6
8
|
open: boolean;
|
|
7
9
|
onOpenChange: (open: boolean) => void;
|
|
8
10
|
closeOnOverlayClick: boolean;
|
|
11
|
+
role: DialogRole;
|
|
9
12
|
};
|
|
10
13
|
export declare const useDialog: () => DialogContextType;
|
|
11
14
|
export interface DialogProps {
|
|
@@ -31,10 +34,18 @@ export interface DialogProps {
|
|
|
31
34
|
*/
|
|
32
35
|
className?: string;
|
|
33
36
|
/**
|
|
34
|
-
* Whether clicking the overlay closes the dialog.
|
|
35
|
-
*
|
|
37
|
+
* Whether clicking the overlay closes the dialog. Defaults to true, except
|
|
38
|
+
* when role is "alertdialog", where it defaults to false.
|
|
36
39
|
*/
|
|
37
40
|
closeOnOverlayClick?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* ARIA role of the dialog content. Use "alertdialog" for a dialog that
|
|
43
|
+
* interrupts the user and needs a response before they can continue, such as
|
|
44
|
+
* confirming a destructive action. An alert dialog does not close when the
|
|
45
|
+
* overlay is clicked unless closeOnOverlayClick is set; Escape still closes it.
|
|
46
|
+
* @default "dialog"
|
|
47
|
+
*/
|
|
48
|
+
role?: DialogRole;
|
|
38
49
|
}
|
|
39
50
|
export interface DialogTriggerProps extends React.ComponentPropsWithoutRef<"button"> {
|
|
40
51
|
asChild?: boolean;
|
|
@@ -54,7 +65,7 @@ export interface DialogContentProps extends Partial<React.ComponentPropsWithoutR
|
|
|
54
65
|
asChild?: boolean;
|
|
55
66
|
}
|
|
56
67
|
export declare const DialogContent: {
|
|
57
|
-
({ children, className, asChild, open: propsOpen, onOpenChange: propsOnOpenChange, ...props }: DialogContentProps): React.JSX.Element;
|
|
68
|
+
({ children, className, asChild, open: propsOpen, onOpenChange: propsOnOpenChange, role: propsRole, ...props }: DialogContentProps): React.JSX.Element;
|
|
58
69
|
displayName: string;
|
|
59
70
|
};
|
|
60
71
|
export declare const DialogHeader: {
|
|
@@ -10,17 +10,18 @@ var u = i(void 0), d = () => {
|
|
|
10
10
|
let e = a(u);
|
|
11
11
|
if (!e) throw Error("Dialog sub-components must be used within Dialog");
|
|
12
12
|
return e;
|
|
13
|
-
}, f = ({ children: e, open: t, onOpenChange: n, defaultOpen: r = !1,
|
|
14
|
-
let [
|
|
15
|
-
|
|
16
|
-
},
|
|
13
|
+
}, f = ({ children: e, open: t, onOpenChange: n, defaultOpen: r = !1, role: i = "dialog", closeOnOverlayClick: a = i !== "alertdialog" }) => {
|
|
14
|
+
let [c, d] = s(r), f = t !== void 0, p = f ? t : c, m = (e) => {
|
|
15
|
+
f || d(e), n?.(e);
|
|
16
|
+
}, h = `wim-dialog-${o()}`, g = `${h}-title`, _ = `${h}-description`;
|
|
17
17
|
return /* @__PURE__ */ l(u.Provider, {
|
|
18
18
|
value: {
|
|
19
|
-
titleId:
|
|
20
|
-
descriptionId:
|
|
21
|
-
open:
|
|
22
|
-
onOpenChange:
|
|
23
|
-
closeOnOverlayClick:
|
|
19
|
+
titleId: g,
|
|
20
|
+
descriptionId: _,
|
|
21
|
+
open: p,
|
|
22
|
+
onOpenChange: m,
|
|
23
|
+
closeOnOverlayClick: a,
|
|
24
|
+
role: i
|
|
24
25
|
},
|
|
25
26
|
children: e
|
|
26
27
|
});
|
|
@@ -52,18 +53,18 @@ var m = ({ children: n, className: r, onClick: i, asChild: a = !1, ...o }) => {
|
|
|
52
53
|
});
|
|
53
54
|
};
|
|
54
55
|
m.displayName = "Dialog.Close";
|
|
55
|
-
var h = ({ children: i, className: a, asChild: o = !1, open: s, onOpenChange: u,
|
|
56
|
-
let { open:
|
|
56
|
+
var h = ({ children: i, className: a, asChild: o = !1, open: s, onOpenChange: u, role: f, ...p }) => {
|
|
57
|
+
let { open: m, onOpenChange: h, titleId: g, descriptionId: _, closeOnOverlayClick: v, role: y } = d(), b = s === void 0 ? m : s, x = u === void 0 ? h : u, S = o ? e : "div";
|
|
57
58
|
return /* @__PURE__ */ l(n, {
|
|
58
|
-
...
|
|
59
|
-
open:
|
|
60
|
-
onOpenChange:
|
|
61
|
-
closeOnOverlayClick:
|
|
59
|
+
...p,
|
|
60
|
+
open: b,
|
|
61
|
+
onOpenChange: x,
|
|
62
|
+
closeOnOverlayClick: v,
|
|
62
63
|
overlayClassName: r.overlay,
|
|
63
|
-
role:
|
|
64
|
-
"aria-labelledby":
|
|
65
|
-
"aria-describedby":
|
|
66
|
-
children: /* @__PURE__ */ l(
|
|
64
|
+
role: f ?? y,
|
|
65
|
+
"aria-labelledby": g,
|
|
66
|
+
"aria-describedby": _,
|
|
67
|
+
children: /* @__PURE__ */ l(S, {
|
|
67
68
|
className: c("wim-dialog", r.content, a),
|
|
68
69
|
children: /* @__PURE__ */ l(t, { children: i })
|
|
69
70
|
})
|
package/dist/llms-full.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.
|
|
7
|
+
**wimui** v0.54.0 — a React 19 component library: 228 documented components across 10 categories, with design tokens, dark mode, i18n (en/ja/pt-BR) and WAI-ARIA compliant a11y. Peer deps: react ^19, react-dom ^19 (plus optional peers for specific components — see package.json).
|
|
8
8
|
|
|
9
9
|
## Install & required setup
|
|
10
10
|
|
|
@@ -2773,8 +2773,13 @@ anything is measured; long text is truncated and read in full by assistive techn
|
|
|
2773
2773
|
- `defaultOpen: boolean` = false — Initial open state for uncontrolled usage.
|
|
2774
2774
|
@default false
|
|
2775
2775
|
- `className: string` — Additional CSS class name.
|
|
2776
|
-
- `closeOnOverlayClick: boolean` =
|
|
2777
|
-
|
|
2776
|
+
- `closeOnOverlayClick: boolean` = role !== "alertdialog" — Whether clicking the overlay closes the dialog. Defaults to true, except
|
|
2777
|
+
when role is "alertdialog", where it defaults to false.
|
|
2778
|
+
- `role: "dialog" | "alertdialog"` = "dialog" — ARIA role of the dialog content. Use "alertdialog" for a dialog that
|
|
2779
|
+
interrupts the user and needs a response before they can continue, such as
|
|
2780
|
+
confirming a destructive action. An alert dialog does not close when the
|
|
2781
|
+
overlay is clicked unless closeOnOverlayClick is set; Escape still closes it.
|
|
2782
|
+
@default "dialog"
|
|
2778
2783
|
- **Drawer** — Slide-out detail panels (aka Navigation Drawer)
|
|
2779
2784
|
- `children: React.ReactNode` (required) — Drawer parts (DrawerTrigger, DrawerContent, etc.).
|
|
2780
2785
|
- `open: boolean` — Controlled open state. Use together with onOpenChange.
|
package/dist/llms.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.
|
|
7
|
+
**wimui** v0.54.0 — a React 19 component library: 228 documented components across 10 categories, with design tokens, dark mode, i18n (en/ja/pt-BR) and WAI-ARIA compliant a11y. Peer deps: react ^19, react-dom ^19 (plus optional peers for specific components — see package.json).
|
|
8
8
|
|
|
9
9
|
## Install & required setup
|
|
10
10
|
|