@wallarm-org/design-system 4.16.1-rc-fix-escape-outside-layer-stack.1 → 4.16.1
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/dist/components/Dialog/DialogContent.js +68 -35
- package/dist/components/Drawer/DrawerContent.d.ts +6 -2
- package/dist/components/Drawer/DrawerContent.js +80 -67
- package/dist/components/Drawer/DrawerRoot.d.ts +4 -0
- package/dist/components/Drawer/DrawerRoot.js +28 -1
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/Drawer/index.js +1 -0
- package/dist/components/Field/FieldDescription.js +27 -13
- package/dist/components/Field/FieldError.js +46 -26
- package/dist/components/Input/Input.js +59 -34
- package/dist/components/NumberInput/NumberInput.js +20 -18
- package/dist/components/PasswordInput/PasswordInput.js +72 -71
- package/dist/components/Select/useSelectSearch.d.ts +4 -0
- package/dist/components/Table/TableBody/TableBodyRowDndContext.js +84 -77
- package/dist/components/Table/TableContext/TableProvider.js +62 -59
- package/dist/components/Table/TableContext/types.d.ts +1 -0
- package/dist/components/Table/lib/createSelectionColumn.js +4 -6
- package/dist/components/Textarea/Textarea.js +74 -77
- package/dist/guidelines/patterns/filtering.md +2 -2
- package/dist/hooks/useControlled.js +24 -9
- package/dist/metadata/components.json +79 -16
- package/dist/metadata/guidelines.json +4 -4
- package/package.json +1 -1
|
@@ -3,71 +3,104 @@ import { c } from "react/compiler-runtime";
|
|
|
3
3
|
import { Dialog } from "@ark-ui/react/dialog";
|
|
4
4
|
import { cn } from "../../utils/cn.js";
|
|
5
5
|
import { useTestId } from "../../utils/testId.js";
|
|
6
|
-
import { DrawerOverlay, DrawerPortal, drawerContentVariants, useDrawerContext, useNestedSameKindCount } from "../Drawer/index.js";
|
|
6
|
+
import { DrawerAncestorIdsProvider, DrawerOverlay, DrawerPortal, drawerContentVariants, useDrawerContext, useNestedSameKindCount } from "../Drawer/index.js";
|
|
7
7
|
import { DialogPositioner } from "./DialogPositioner.js";
|
|
8
8
|
const DialogContent = (t0)=>{
|
|
9
|
-
const $ = c(
|
|
10
|
-
|
|
9
|
+
const $ = c(27);
|
|
10
|
+
let children;
|
|
11
|
+
let className;
|
|
12
|
+
let ref;
|
|
13
|
+
let rest;
|
|
14
|
+
let style;
|
|
15
|
+
if ($[0] !== t0) {
|
|
16
|
+
({ children, ref, className, style, ...rest } = t0);
|
|
17
|
+
$[0] = t0;
|
|
18
|
+
$[1] = children;
|
|
19
|
+
$[2] = className;
|
|
20
|
+
$[3] = ref;
|
|
21
|
+
$[4] = rest;
|
|
22
|
+
$[5] = style;
|
|
23
|
+
} else {
|
|
24
|
+
children = $[1];
|
|
25
|
+
className = $[2];
|
|
26
|
+
ref = $[3];
|
|
27
|
+
rest = $[4];
|
|
28
|
+
style = $[5];
|
|
29
|
+
}
|
|
11
30
|
const testId = useTestId("content");
|
|
12
31
|
const { width, overlay } = useDrawerContext();
|
|
13
32
|
const nestedSameKindCount = useNestedSameKindCount();
|
|
14
33
|
let t1;
|
|
15
|
-
if ($[
|
|
34
|
+
if ($[6] !== overlay) {
|
|
16
35
|
t1 = overlay && /*#__PURE__*/ jsx(DrawerOverlay, {});
|
|
17
|
-
$[
|
|
18
|
-
$[
|
|
19
|
-
} else t1 = $[
|
|
36
|
+
$[6] = overlay;
|
|
37
|
+
$[7] = t1;
|
|
38
|
+
} else t1 = $[7];
|
|
20
39
|
const t2 = nestedSameKindCount > 0 ? "" : void 0;
|
|
21
40
|
let t3;
|
|
22
|
-
if ($[
|
|
41
|
+
if ($[8] !== className) {
|
|
23
42
|
t3 = cn(drawerContentVariants({
|
|
24
43
|
isResizing: false
|
|
25
|
-
}), "flex flex-col min-h-0", "slide-in-from-bottom-[25%] slide-out-to-bottom-[25%]", "origin-top", "data-[has-nested-same]:scale-[calc(var(--dialog-pushed-back-scale)-(var(--nested-same-kind-count)*var(--dialog-pushed-back-ratio)))]", "data-[has-nested-same]:-translate-y-[calc((var(--dialog-pushed-back-offset)/(var(--dialog-pushed-back-scale)-(var(--nested-same-kind-count)*var(--dialog-pushed-back-ratio))))*var(--nested-same-kind-count))]", "**:data-[slot=drawer-header]:pt-20 **:data-[slot=drawer-header]:pb-16 **:data-[slot=drawer-header]:px-24");
|
|
26
|
-
$[
|
|
27
|
-
|
|
44
|
+
}), "flex flex-col min-h-0", "slide-in-from-bottom-[25%] slide-out-to-bottom-[25%]", "origin-top", "data-[has-nested-same]:scale-[calc(var(--dialog-pushed-back-scale)-(var(--nested-same-kind-count)*var(--dialog-pushed-back-ratio)))]", "data-[has-nested-same]:-translate-y-[calc((var(--dialog-pushed-back-offset)/(var(--dialog-pushed-back-scale)-(var(--nested-same-kind-count)*var(--dialog-pushed-back-ratio))))*var(--nested-same-kind-count))]", "**:data-[slot=drawer-header]:pt-20 **:data-[slot=drawer-header]:pb-16 **:data-[slot=drawer-header]:px-24", className);
|
|
45
|
+
$[8] = className;
|
|
46
|
+
$[9] = t3;
|
|
47
|
+
} else t3 = $[9];
|
|
28
48
|
let t4;
|
|
29
|
-
if ($[
|
|
49
|
+
if ($[10] !== nestedSameKindCount || $[11] !== style || $[12] !== width) {
|
|
30
50
|
t4 = {
|
|
51
|
+
...style,
|
|
31
52
|
width,
|
|
32
53
|
"--nested-same-kind-count": nestedSameKindCount
|
|
33
54
|
};
|
|
34
|
-
$[
|
|
35
|
-
$[
|
|
36
|
-
$[
|
|
37
|
-
|
|
55
|
+
$[10] = nestedSameKindCount;
|
|
56
|
+
$[11] = style;
|
|
57
|
+
$[12] = width;
|
|
58
|
+
$[13] = t4;
|
|
59
|
+
} else t4 = $[13];
|
|
38
60
|
const t5 = t4;
|
|
39
61
|
let t6;
|
|
40
|
-
if ($[
|
|
41
|
-
t6 = /*#__PURE__*/ jsx(
|
|
62
|
+
if ($[14] !== children) {
|
|
63
|
+
t6 = /*#__PURE__*/ jsx(DrawerAncestorIdsProvider, {
|
|
64
|
+
children: children
|
|
65
|
+
});
|
|
66
|
+
$[14] = children;
|
|
67
|
+
$[15] = t6;
|
|
68
|
+
} else t6 = $[15];
|
|
69
|
+
let t7;
|
|
70
|
+
if ($[16] !== ref || $[17] !== rest || $[18] !== t2 || $[19] !== t3 || $[20] !== t5 || $[21] !== t6 || $[22] !== testId) {
|
|
71
|
+
t7 = /*#__PURE__*/ jsx(DialogPositioner, {
|
|
42
72
|
children: /*#__PURE__*/ jsx(Dialog.Content, {
|
|
73
|
+
...rest,
|
|
43
74
|
ref: ref,
|
|
44
75
|
"data-testid": testId,
|
|
45
76
|
"data-has-nested-same": t2,
|
|
46
77
|
className: t3,
|
|
47
78
|
style: t5,
|
|
48
|
-
children:
|
|
79
|
+
children: t6
|
|
49
80
|
})
|
|
50
81
|
});
|
|
51
|
-
$[
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
82
|
+
$[16] = ref;
|
|
83
|
+
$[17] = rest;
|
|
84
|
+
$[18] = t2;
|
|
85
|
+
$[19] = t3;
|
|
86
|
+
$[20] = t5;
|
|
87
|
+
$[21] = t6;
|
|
88
|
+
$[22] = testId;
|
|
89
|
+
$[23] = t7;
|
|
90
|
+
} else t7 = $[23];
|
|
91
|
+
let t8;
|
|
92
|
+
if ($[24] !== t1 || $[25] !== t7) {
|
|
93
|
+
t8 = /*#__PURE__*/ jsxs(DrawerPortal, {
|
|
61
94
|
children: [
|
|
62
95
|
t1,
|
|
63
|
-
|
|
96
|
+
t7
|
|
64
97
|
]
|
|
65
98
|
});
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
69
|
-
} else
|
|
70
|
-
return
|
|
99
|
+
$[24] = t1;
|
|
100
|
+
$[25] = t7;
|
|
101
|
+
$[26] = t8;
|
|
102
|
+
} else t8 = $[26];
|
|
103
|
+
return t8;
|
|
71
104
|
};
|
|
72
105
|
DialogContent.displayName = "DialogContent";
|
|
73
106
|
export { DialogContent };
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* `id` is omitted: the dialog machine owns the content id (`ids.content` in DrawerRoot), which
|
|
4
|
+
* wires the trigger's `aria-controls`, nesting and non-modal focus return.
|
|
5
|
+
*/
|
|
6
|
+
export interface DrawerContentProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'id'> {
|
|
3
7
|
children: ReactNode;
|
|
4
8
|
asChild?: boolean;
|
|
5
9
|
ref?: Ref<HTMLDivElement>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { useContext } from "react";
|
|
4
3
|
import { Dialog } from "@ark-ui/react/dialog";
|
|
5
4
|
import { cn } from "../../utils/cn.js";
|
|
6
5
|
import { useTestId } from "../../utils/testId.js";
|
|
@@ -10,103 +9,117 @@ import { useNestedSameKindCount } from "./DrawerNestingContext.js";
|
|
|
10
9
|
import { DrawerOverlay } from "./DrawerOverlay.js";
|
|
11
10
|
import { DrawerPortal } from "./DrawerPortal.js";
|
|
12
11
|
import { DrawerPositioner } from "./DrawerPositioner.js";
|
|
13
|
-
import {
|
|
12
|
+
import { DrawerAncestorIdsProvider } from "./DrawerRoot.js";
|
|
14
13
|
const DrawerContent = (t0)=>{
|
|
15
|
-
const $ = c(
|
|
16
|
-
|
|
14
|
+
const $ = c(33);
|
|
15
|
+
let asChild;
|
|
16
|
+
let children;
|
|
17
|
+
let className;
|
|
18
|
+
let ref;
|
|
19
|
+
let rest;
|
|
20
|
+
let style;
|
|
21
|
+
if ($[0] !== t0) {
|
|
22
|
+
({ children, asChild, ref, className, style, ...rest } = t0);
|
|
23
|
+
$[0] = t0;
|
|
24
|
+
$[1] = asChild;
|
|
25
|
+
$[2] = children;
|
|
26
|
+
$[3] = className;
|
|
27
|
+
$[4] = ref;
|
|
28
|
+
$[5] = rest;
|
|
29
|
+
$[6] = style;
|
|
30
|
+
} else {
|
|
31
|
+
asChild = $[1];
|
|
32
|
+
children = $[2];
|
|
33
|
+
className = $[3];
|
|
34
|
+
ref = $[4];
|
|
35
|
+
rest = $[5];
|
|
36
|
+
style = $[6];
|
|
37
|
+
}
|
|
17
38
|
const testId = useTestId("content");
|
|
18
|
-
const { width, isResizing, overlay
|
|
19
|
-
const ancestorIds = useContext(DrawerAncestorIdsContext);
|
|
39
|
+
const { width, isResizing, overlay } = useDrawerContext();
|
|
20
40
|
const nestedSameKindCount = useNestedSameKindCount();
|
|
21
41
|
let t1;
|
|
22
|
-
if ($[
|
|
42
|
+
if ($[7] !== overlay) {
|
|
23
43
|
t1 = overlay && /*#__PURE__*/ jsx(DrawerOverlay, {});
|
|
24
|
-
$[
|
|
25
|
-
$[
|
|
26
|
-
} else t1 = $[
|
|
44
|
+
$[7] = overlay;
|
|
45
|
+
$[8] = t1;
|
|
46
|
+
} else t1 = $[8];
|
|
27
47
|
const t2 = nestedSameKindCount > 0 ? "" : void 0;
|
|
28
48
|
let t3;
|
|
29
|
-
if ($[
|
|
49
|
+
if ($[9] !== className || $[10] !== isResizing) {
|
|
30
50
|
t3 = cn(drawerContentVariants({
|
|
31
51
|
isResizing
|
|
32
|
-
}), "h-full", "slide-in-from-right-[25%] slide-out-to-right-[25%]", "origin-left", "data-[has-nested-same]:scale-[calc(var(--drawer-pushed-back-scale)-(var(--nested-same-kind-count)*var(--drawer-pushed-back-ratio)))]", "data-[has-nested-same]:-translate-x-[calc((var(--drawer-pushed-back-offset)/(var(--drawer-pushed-back-scale)-(var(--nested-same-kind-count)*var(--drawer-pushed-back-ratio))))*var(--nested-same-kind-count))]");
|
|
33
|
-
$[
|
|
34
|
-
$[
|
|
35
|
-
|
|
52
|
+
}), "h-full", "slide-in-from-right-[25%] slide-out-to-right-[25%]", "origin-left", "data-[has-nested-same]:scale-[calc(var(--drawer-pushed-back-scale)-(var(--nested-same-kind-count)*var(--drawer-pushed-back-ratio)))]", "data-[has-nested-same]:-translate-x-[calc((var(--drawer-pushed-back-offset)/(var(--drawer-pushed-back-scale)-(var(--nested-same-kind-count)*var(--drawer-pushed-back-ratio))))*var(--nested-same-kind-count))]", className);
|
|
53
|
+
$[9] = className;
|
|
54
|
+
$[10] = isResizing;
|
|
55
|
+
$[11] = t3;
|
|
56
|
+
} else t3 = $[11];
|
|
36
57
|
let t4;
|
|
37
|
-
if ($[
|
|
58
|
+
if ($[12] !== nestedSameKindCount || $[13] !== style || $[14] !== width) {
|
|
38
59
|
t4 = {
|
|
60
|
+
...style,
|
|
39
61
|
width,
|
|
40
62
|
"--nested-same-kind-count": nestedSameKindCount
|
|
41
63
|
};
|
|
42
|
-
$[
|
|
43
|
-
$[
|
|
44
|
-
$[
|
|
45
|
-
|
|
64
|
+
$[12] = nestedSameKindCount;
|
|
65
|
+
$[13] = style;
|
|
66
|
+
$[14] = width;
|
|
67
|
+
$[15] = t4;
|
|
68
|
+
} else t4 = $[15];
|
|
46
69
|
const t5 = t4;
|
|
47
70
|
let t6;
|
|
48
|
-
if ($[
|
|
49
|
-
t6 =
|
|
50
|
-
...ancestorIds,
|
|
51
|
-
contentId
|
|
52
|
-
];
|
|
53
|
-
$[7] = ancestorIds;
|
|
54
|
-
$[8] = contentId;
|
|
55
|
-
$[9] = t6;
|
|
56
|
-
} else t6 = $[9];
|
|
57
|
-
let t7;
|
|
58
|
-
if ($[10] !== children || $[11] !== t6) {
|
|
59
|
-
t7 = /*#__PURE__*/ jsx(DrawerAncestorIdsContext.Provider, {
|
|
60
|
-
value: t6,
|
|
71
|
+
if ($[16] !== children) {
|
|
72
|
+
t6 = /*#__PURE__*/ jsx(DrawerAncestorIdsProvider, {
|
|
61
73
|
children: children
|
|
62
74
|
});
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
$[16] = children;
|
|
76
|
+
$[17] = t6;
|
|
77
|
+
} else t6 = $[17];
|
|
78
|
+
let t7;
|
|
79
|
+
if ($[18] !== asChild || $[19] !== ref || $[20] !== rest || $[21] !== t2 || $[22] !== t3 || $[23] !== t5 || $[24] !== t6 || $[25] !== testId) {
|
|
80
|
+
t7 = /*#__PURE__*/ jsx(Dialog.Content, {
|
|
81
|
+
...rest,
|
|
70
82
|
ref: ref,
|
|
71
83
|
"data-testid": testId,
|
|
72
84
|
"data-has-nested-same": t2,
|
|
73
85
|
className: t3,
|
|
74
86
|
style: t5,
|
|
75
87
|
asChild: asChild,
|
|
76
|
-
children:
|
|
88
|
+
children: t6
|
|
77
89
|
});
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
$[18] = asChild;
|
|
91
|
+
$[19] = ref;
|
|
92
|
+
$[20] = rest;
|
|
93
|
+
$[21] = t2;
|
|
94
|
+
$[22] = t3;
|
|
95
|
+
$[23] = t5;
|
|
96
|
+
$[24] = t6;
|
|
97
|
+
$[25] = testId;
|
|
98
|
+
$[26] = t7;
|
|
99
|
+
} else t7 = $[26];
|
|
100
|
+
let t8;
|
|
101
|
+
if ($[27] !== isResizing || $[28] !== t7) {
|
|
102
|
+
t8 = /*#__PURE__*/ jsx(DrawerPositioner, {
|
|
90
103
|
isResizing: isResizing,
|
|
91
|
-
children:
|
|
104
|
+
children: t7
|
|
92
105
|
});
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
} else
|
|
97
|
-
let
|
|
98
|
-
if ($[
|
|
99
|
-
|
|
106
|
+
$[27] = isResizing;
|
|
107
|
+
$[28] = t7;
|
|
108
|
+
$[29] = t8;
|
|
109
|
+
} else t8 = $[29];
|
|
110
|
+
let t9;
|
|
111
|
+
if ($[30] !== t1 || $[31] !== t8) {
|
|
112
|
+
t9 = /*#__PURE__*/ jsxs(DrawerPortal, {
|
|
100
113
|
children: [
|
|
101
114
|
t1,
|
|
102
|
-
|
|
115
|
+
t8
|
|
103
116
|
]
|
|
104
117
|
});
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
} else
|
|
109
|
-
return
|
|
118
|
+
$[30] = t1;
|
|
119
|
+
$[31] = t8;
|
|
120
|
+
$[32] = t9;
|
|
121
|
+
} else t9 = $[32];
|
|
122
|
+
return t9;
|
|
110
123
|
};
|
|
111
124
|
DrawerContent.displayName = "DrawerContent";
|
|
112
125
|
export { DrawerContent };
|
|
@@ -7,6 +7,10 @@ type LayerDismissRequest = Parameters<NonNullable<Dialog.RootProps['onRequestDis
|
|
|
7
7
|
* renders no DOM, so a sibling of the content is not a descendant of the layer.
|
|
8
8
|
*/
|
|
9
9
|
export declare const DrawerAncestorIdsContext: import("react").Context<readonly string[]>;
|
|
10
|
+
/** Adds this Drawer/Dialog's content id to the ancestry seen by layers rendered inside it. */
|
|
11
|
+
export declare const DrawerAncestorIdsProvider: FC<{
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}>;
|
|
10
14
|
/**
|
|
11
15
|
* Since zag-js 1.43.1 a dialog that mounts while its content node exists registers its layer
|
|
12
16
|
* synchronously. When a Dialog closes in the same commit a sibling Drawer opens (Create → Continue),
|
|
@@ -5,6 +5,33 @@ import { Dialog } from "@ark-ui/react/dialog";
|
|
|
5
5
|
import { useDrawerContext } from "./DrawerContext/index.js";
|
|
6
6
|
import { useNonModalFocusReturn } from "./useNonModalFocusReturn.js";
|
|
7
7
|
const DrawerAncestorIdsContext = /*#__PURE__*/ createContext([]);
|
|
8
|
+
const DrawerAncestorIdsProvider = (t0)=>{
|
|
9
|
+
const $ = c(6);
|
|
10
|
+
const { children } = t0;
|
|
11
|
+
const { contentId } = useDrawerContext();
|
|
12
|
+
const ancestorIds = useContext(DrawerAncestorIdsContext);
|
|
13
|
+
let t1;
|
|
14
|
+
if ($[0] !== ancestorIds || $[1] !== contentId) {
|
|
15
|
+
t1 = [
|
|
16
|
+
...ancestorIds,
|
|
17
|
+
contentId
|
|
18
|
+
];
|
|
19
|
+
$[0] = ancestorIds;
|
|
20
|
+
$[1] = contentId;
|
|
21
|
+
$[2] = t1;
|
|
22
|
+
} else t1 = $[2];
|
|
23
|
+
let t2;
|
|
24
|
+
if ($[3] !== children || $[4] !== t1) {
|
|
25
|
+
t2 = /*#__PURE__*/ jsx(DrawerAncestorIdsContext.Provider, {
|
|
26
|
+
value: t1,
|
|
27
|
+
children: children
|
|
28
|
+
});
|
|
29
|
+
$[3] = children;
|
|
30
|
+
$[4] = t1;
|
|
31
|
+
$[5] = t2;
|
|
32
|
+
} else t2 = $[5];
|
|
33
|
+
return t2;
|
|
34
|
+
};
|
|
8
35
|
const EXITING_DIALOG_LAYER = '[data-scope="dialog"][data-part="content"][data-state="closed"]';
|
|
9
36
|
const keepOpenUnlessAncestorCloses = (ancestorIds)=>(event)=>{
|
|
10
37
|
const targetId = event.detail.targetLayer?.id;
|
|
@@ -83,4 +110,4 @@ const DrawerRoot = (t0)=>{
|
|
|
83
110
|
return t5;
|
|
84
111
|
};
|
|
85
112
|
DrawerRoot.displayName = "DrawerRoot";
|
|
86
|
-
export { DrawerAncestorIdsContext, DrawerRoot, keepOpenUnlessAncestorCloses };
|
|
113
|
+
export { DrawerAncestorIdsContext, DrawerAncestorIdsProvider, DrawerRoot, keepOpenUnlessAncestorCloses };
|
|
@@ -14,5 +14,6 @@ export { DrawerOverlay } from './DrawerOverlay.js';
|
|
|
14
14
|
export { DrawerPortal } from './DrawerPortal.js';
|
|
15
15
|
export { DrawerPositioner, type DrawerPositionerProps, } from './DrawerPositioner.js';
|
|
16
16
|
export { DrawerResizeHandle } from './DrawerResizeHandle.js';
|
|
17
|
+
export { DrawerAncestorIdsProvider } from './DrawerRoot.js';
|
|
17
18
|
export { DrawerTitle, type DrawerTitleProps } from './DrawerTitle.js';
|
|
18
19
|
export { DrawerTrigger, type DrawerTriggerProps } from './DrawerTrigger.js';
|
|
@@ -13,5 +13,6 @@ export { DrawerOverlay } from "./DrawerOverlay.js";
|
|
|
13
13
|
export { DrawerPortal } from "./DrawerPortal.js";
|
|
14
14
|
export { DrawerPositioner } from "./DrawerPositioner.js";
|
|
15
15
|
export { DrawerResizeHandle } from "./DrawerResizeHandle.js";
|
|
16
|
+
export { DrawerAncestorIdsProvider } from "./DrawerRoot.js";
|
|
16
17
|
export { DrawerTitle } from "./DrawerTitle.js";
|
|
17
18
|
export { DrawerTrigger } from "./DrawerTrigger.js";
|
|
@@ -1,28 +1,42 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useFieldContext } from "@ark-ui/react/field";
|
|
4
|
+
import { useFieldsetContext } from "@ark-ui/react/fieldset";
|
|
3
5
|
import { cn } from "../../utils/cn.js";
|
|
4
6
|
import { useTestId } from "../../utils/testId.js";
|
|
5
7
|
const FieldDescription = (props)=>{
|
|
6
|
-
const $ = c(
|
|
8
|
+
const $ = c(8);
|
|
7
9
|
const testId = useTestId("description");
|
|
10
|
+
const field = useFieldContext();
|
|
11
|
+
const fieldset = useFieldsetContext();
|
|
8
12
|
let t0;
|
|
9
|
-
if ($[0]
|
|
10
|
-
t0 =
|
|
11
|
-
$[0] =
|
|
12
|
-
|
|
13
|
+
if ($[0] !== field || $[1] !== fieldset) {
|
|
14
|
+
t0 = (field ?? fieldset)?.getHelperTextProps();
|
|
15
|
+
$[0] = field;
|
|
16
|
+
$[1] = fieldset;
|
|
17
|
+
$[2] = t0;
|
|
18
|
+
} else t0 = $[2];
|
|
19
|
+
const helperTextProps = t0;
|
|
13
20
|
let t1;
|
|
14
|
-
if ($[
|
|
15
|
-
t1 =
|
|
21
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
22
|
+
t1 = cn("text-text-secondary text-sm font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance", "nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:mb-16");
|
|
23
|
+
$[3] = t1;
|
|
24
|
+
} else t1 = $[3];
|
|
25
|
+
let t2;
|
|
26
|
+
if ($[4] !== helperTextProps || $[5] !== props || $[6] !== testId) {
|
|
27
|
+
t2 = /*#__PURE__*/ jsx("p", {
|
|
28
|
+
...helperTextProps,
|
|
16
29
|
...props,
|
|
17
30
|
"data-testid": testId,
|
|
18
31
|
"data-slot": "field-description",
|
|
19
|
-
className:
|
|
32
|
+
className: t1
|
|
20
33
|
});
|
|
21
|
-
$[
|
|
22
|
-
$[
|
|
23
|
-
$[
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
$[4] = helperTextProps;
|
|
35
|
+
$[5] = props;
|
|
36
|
+
$[6] = testId;
|
|
37
|
+
$[7] = t2;
|
|
38
|
+
} else t2 = $[7];
|
|
39
|
+
return t2;
|
|
26
40
|
};
|
|
27
41
|
FieldDescription.displayName = "FieldDescription";
|
|
28
42
|
export { FieldDescription };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useFieldContext } from "@ark-ui/react/field";
|
|
4
|
+
import { useFieldsetContext } from "@ark-ui/react/fieldset";
|
|
3
5
|
import { OctagonAlert } from "../../icons/index.js";
|
|
4
6
|
import { cn } from "../../utils/cn.js";
|
|
5
7
|
import { useTestId } from "../../utils/testId.js";
|
|
6
8
|
import { Text } from "../Text/index.js";
|
|
7
9
|
const FieldError = (t0)=>{
|
|
8
|
-
const $ = c(
|
|
10
|
+
const $ = c(17);
|
|
9
11
|
let children;
|
|
10
12
|
let props;
|
|
11
13
|
if ($[0] !== t0) {
|
|
@@ -18,49 +20,67 @@ const FieldError = (t0)=>{
|
|
|
18
20
|
props = $[2];
|
|
19
21
|
}
|
|
20
22
|
const testId = useTestId("error");
|
|
23
|
+
const field = useFieldContext();
|
|
24
|
+
const fieldset = useFieldsetContext();
|
|
21
25
|
let t1;
|
|
26
|
+
if ($[3] !== field || $[4] !== fieldset) {
|
|
27
|
+
t1 = (field ?? fieldset)?.getErrorTextProps() ?? {};
|
|
28
|
+
$[3] = field;
|
|
29
|
+
$[4] = fieldset;
|
|
30
|
+
$[5] = t1;
|
|
31
|
+
} else t1 = $[5];
|
|
32
|
+
let errorTextProps;
|
|
33
|
+
if ($[6] !== t1) {
|
|
34
|
+
const { "aria-live": _ariaLive, ...t2 } = t1;
|
|
35
|
+
errorTextProps = t2;
|
|
36
|
+
$[6] = t1;
|
|
37
|
+
$[7] = errorTextProps;
|
|
38
|
+
} else errorTextProps = $[7];
|
|
22
39
|
let t2;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
t2 =
|
|
40
|
+
let t3;
|
|
41
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
42
|
+
t2 = cn("flex gap-4 text-text-danger");
|
|
43
|
+
t3 = /*#__PURE__*/ jsx(OctagonAlert, {
|
|
26
44
|
size: "md",
|
|
27
45
|
className: "self-start my-2"
|
|
28
46
|
});
|
|
29
|
-
$[
|
|
30
|
-
$[
|
|
47
|
+
$[8] = t2;
|
|
48
|
+
$[9] = t3;
|
|
31
49
|
} else {
|
|
32
|
-
|
|
33
|
-
|
|
50
|
+
t2 = $[8];
|
|
51
|
+
t3 = $[9];
|
|
34
52
|
}
|
|
35
|
-
let
|
|
36
|
-
if ($[
|
|
37
|
-
|
|
53
|
+
let t4;
|
|
54
|
+
if ($[10] !== children) {
|
|
55
|
+
t4 = /*#__PURE__*/ jsx(Text, {
|
|
38
56
|
size: "sm",
|
|
39
57
|
color: "danger",
|
|
40
58
|
children: children
|
|
41
59
|
});
|
|
42
|
-
$[
|
|
43
|
-
$[
|
|
44
|
-
} else
|
|
45
|
-
let
|
|
46
|
-
if ($[
|
|
47
|
-
|
|
60
|
+
$[10] = children;
|
|
61
|
+
$[11] = t4;
|
|
62
|
+
} else t4 = $[11];
|
|
63
|
+
let t5;
|
|
64
|
+
if ($[12] !== errorTextProps || $[13] !== props || $[14] !== t4 || $[15] !== testId) {
|
|
65
|
+
t5 = /*#__PURE__*/ jsxs("div", {
|
|
66
|
+
...errorTextProps,
|
|
48
67
|
...props,
|
|
49
68
|
"data-testid": testId,
|
|
50
69
|
role: "alert",
|
|
51
70
|
"data-slot": "field-error",
|
|
52
|
-
className:
|
|
71
|
+
className: t2,
|
|
53
72
|
children: [
|
|
54
|
-
|
|
55
|
-
|
|
73
|
+
t3,
|
|
74
|
+
t4
|
|
56
75
|
]
|
|
57
76
|
});
|
|
58
|
-
$[
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
62
|
-
|
|
63
|
-
|
|
77
|
+
$[12] = errorTextProps;
|
|
78
|
+
$[13] = props;
|
|
79
|
+
$[14] = t4;
|
|
80
|
+
$[15] = testId;
|
|
81
|
+
$[16] = t5;
|
|
82
|
+
} else t5 = $[16];
|
|
83
|
+
return t5;
|
|
64
84
|
};
|
|
65
85
|
FieldError.displayName = "FieldError";
|
|
66
86
|
export { FieldError };
|