@pyck/react 0.0.5 → 0.0.7
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/checkmark-rF75Pk98.js +75 -0
- package/dist/close-button-DAgpEZYq.js +172 -0
- package/dist/components/avatar/index.js +118 -20
- package/dist/components/button/index.js +1 -1
- package/dist/components/carousel/index.js +52 -12
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/index.js +151 -34
- package/dist/components/checkmark/index.js +1 -1
- package/dist/components/clipboard/index.js +3 -2
- package/dist/components/combobox/index.js +46 -9
- package/dist/components/data-list/index.d.ts +3 -2
- package/dist/components/data-list/index.js +23 -8
- package/dist/components/date-picker/index.js +17 -10
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/dialog/index.js +156 -95
- package/dist/components/display-date-value/index.d.ts +1 -1
- package/dist/components/display-date-value/index.js +2 -2
- package/dist/components/display-value/index.js +1 -1
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/drawer/index.js +22 -1
- package/dist/components/drilldown-menu/index.js +268 -87
- package/dist/components/field/index.js +110 -27
- package/dist/components/floating-panel/index.d.ts +1 -1
- package/dist/components/floating-panel/index.js +91 -43
- package/dist/components/form/index.d.ts +1 -1
- package/dist/components/form/index.js +142 -26
- package/dist/components/highlight/index.d.ts +1 -1
- package/dist/components/highlight/index.js +63 -14
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/image/index.js +33 -2
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/input/index.js +67 -4
- package/dist/components/input-group/index.js +79 -14
- package/dist/components/json-form-builder/index.d.ts +1 -1
- package/dist/components/json-form-builder/index.js +383 -99
- package/dist/components/loader/index.js +35 -15
- package/dist/components/logo/index.js +97 -19
- package/dist/components/menu/index.d.ts +1 -1
- package/dist/components/menu/index.js +41 -7
- package/dist/components/number-input/index.d.ts +1 -1
- package/dist/components/number-input/index.js +68 -13
- package/dist/components/page-header/index.js +67 -12
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/pagination/index.js +52 -13
- package/dist/components/picker/index.js +56 -28
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/popover/index.js +2 -1
- package/dist/components/progress/index.js +57 -23
- package/dist/components/progress-circle/index.js +82 -30
- package/dist/components/radio-group/index.js +60 -19
- package/dist/components/scroll-area/index.js +80 -19
- package/dist/components/segment-group/index.d.ts +1 -1
- package/dist/components/segment-group/index.js +40 -5
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.js +119 -22
- package/dist/components/show/index.js +1 -1
- package/dist/components/skeleton/index.js +55 -4
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider/index.js +174 -55
- package/dist/components/spotlight/index.js +447 -126
- package/dist/components/steps/index.js +35 -13
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/index.js +210 -43
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/index.js +435 -67
- package/dist/components/tags-input/index.d.ts +1 -1
- package/dist/components/tags-input/index.js +25 -9
- package/dist/components/textarea/index.d.ts +1 -1
- package/dist/components/textarea/index.js +66 -4
- package/dist/components/toast/index.d.ts +1 -1
- package/dist/components/toast/index.js +56 -22
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/components/tooltip/index.js +87 -25
- package/dist/components/tree-view/index.d.ts +1 -1
- package/dist/components/tree-view/index.js +64 -8
- package/dist/display-date-value-CSPbdE60.js +45 -0
- package/dist/{display-date-value-CdfgVuB7.d.ts → display-date-value-RbzRgYHt.d.ts} +1 -1
- package/dist/display-value-R2nHrGQo.js +81 -0
- package/dist/{featured-icon-DPysOpSf.js → featured-icon-DBnAKGXC.js} +31 -4
- package/dist/show-B7zG1Vci.js +28 -0
- package/dist/utils/index.js +164 -73
- package/package.json +6 -3
- package/dist/checkmark-CW-yHMvN.js +0 -18
- package/dist/close-button-BM7ikbYh.js +0 -52
- package/dist/display-date-value-gTlidtNz.js +0 -21
- package/dist/display-value-BNKxQ99u.js +0 -37
- package/dist/show-IaI-36v9.js +0 -12
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as Icon } from "../../featured-icon-DPysOpSf.js";
|
|
1
|
+
import { n as Icon } from "../../featured-icon-DBnAKGXC.js";
|
|
3
2
|
import "../icon/index.js";
|
|
4
3
|
import { t as Span } from "../../span-DWZSA3mH.js";
|
|
5
4
|
import "../span/index.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { startTransition, useState } from "react";
|
|
7
7
|
import { ark } from "@ark-ui/react/factory";
|
|
8
8
|
import { Box, HStack, Stack, createStyleContext } from "@pyck/styled-system/jsx";
|
|
9
9
|
import { drilldownMenu } from "@pyck/styled-system/recipes";
|
|
10
10
|
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
import { Group } from "@pyck/react/group";
|
|
12
13
|
import { Show } from "@pyck/react/show";
|
|
13
14
|
|
|
14
15
|
//#region src/components/drilldown-menu/drilldown-menu.tsx
|
|
15
|
-
var drilldown_menu_exports = /* @__PURE__ */ __exportAll({
|
|
16
|
-
Content: () => Content,
|
|
17
|
-
Item: () => Item,
|
|
18
|
-
List: () => List,
|
|
19
|
-
Root: () => Root,
|
|
20
|
-
Trigger: () => Trigger,
|
|
21
|
-
Viewport: () => Viewport
|
|
22
|
-
});
|
|
23
16
|
const { withProvider, withContext } = createStyleContext(drilldownMenu);
|
|
24
17
|
const Root = withProvider(ark.div, "root");
|
|
25
18
|
const Viewport = withContext(ark.div, "viewport");
|
|
@@ -30,93 +23,281 @@ const Trigger = withContext(ark.button, "trigger");
|
|
|
30
23
|
|
|
31
24
|
//#endregion
|
|
32
25
|
//#region src/components/drilldown-menu/use-drilldown-menu.ts
|
|
33
|
-
const useDrilldownMenu = (
|
|
26
|
+
const useDrilldownMenu = (t0) => {
|
|
27
|
+
const $ = c(23);
|
|
28
|
+
const { collection } = t0;
|
|
34
29
|
const [currentValue, setCurrentValue] = useState(null);
|
|
35
30
|
const [direction, setDirection] = useState("forward");
|
|
36
31
|
const [isAnimating, setIsAnimating] = useState(false);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
let t1;
|
|
33
|
+
if ($[0] !== collection || $[1] !== currentValue) {
|
|
34
|
+
t1 = currentValue ? collection.findNode(currentValue) ?? collection.rootNode : collection.rootNode;
|
|
35
|
+
$[0] = collection;
|
|
36
|
+
$[1] = currentValue;
|
|
37
|
+
$[2] = t1;
|
|
38
|
+
} else t1 = $[2];
|
|
39
|
+
const currentNode = t1;
|
|
40
|
+
let t2;
|
|
41
|
+
if ($[3] !== collection || $[4] !== currentNode) {
|
|
42
|
+
t2 = collection.getNodeChildren(currentNode);
|
|
43
|
+
$[3] = collection;
|
|
44
|
+
$[4] = currentNode;
|
|
45
|
+
$[5] = t2;
|
|
46
|
+
} else t2 = $[5];
|
|
47
|
+
const current = t2;
|
|
48
|
+
let t3;
|
|
49
|
+
if ($[6] !== collection) {
|
|
50
|
+
t3 = (node) => {
|
|
51
|
+
if (collection.getNodeChildren(node).length > 0) {
|
|
52
|
+
setDirection("forward");
|
|
53
|
+
setIsAnimating(true);
|
|
54
|
+
startTransition(() => {
|
|
55
|
+
setCurrentValue(collection.getNodeValue(node));
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
$[6] = collection;
|
|
60
|
+
$[7] = t3;
|
|
61
|
+
} else t3 = $[7];
|
|
62
|
+
const next = t3;
|
|
63
|
+
let t4;
|
|
64
|
+
if ($[8] !== collection || $[9] !== currentValue) {
|
|
65
|
+
t4 = () => {
|
|
66
|
+
const parentNode = currentValue ? collection.getParentNode(currentValue) : void 0;
|
|
67
|
+
setDirection("back");
|
|
42
68
|
setIsAnimating(true);
|
|
43
69
|
startTransition(() => {
|
|
44
|
-
setCurrentValue(collection.getNodeValue(
|
|
70
|
+
setCurrentValue(parentNode && !collection.isRootNode(parentNode) ? collection.getNodeValue(parentNode) : null);
|
|
45
71
|
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
};
|
|
73
|
+
$[8] = collection;
|
|
74
|
+
$[9] = currentValue;
|
|
75
|
+
$[10] = t4;
|
|
76
|
+
} else t4 = $[10];
|
|
77
|
+
const prev = t4;
|
|
78
|
+
let t5;
|
|
79
|
+
if ($[11] !== collection || $[12] !== currentValue) {
|
|
80
|
+
t5 = currentValue ? collection.getDepth(currentValue) : 0;
|
|
81
|
+
$[11] = collection;
|
|
82
|
+
$[12] = currentValue;
|
|
83
|
+
$[13] = t5;
|
|
84
|
+
} else t5 = $[13];
|
|
85
|
+
const depth = t5;
|
|
86
|
+
const canGoBack = currentValue !== null;
|
|
87
|
+
let t6;
|
|
88
|
+
if ($[14] !== canGoBack || $[15] !== current || $[16] !== currentNode || $[17] !== depth || $[18] !== direction || $[19] !== isAnimating || $[20] !== next || $[21] !== prev) {
|
|
89
|
+
t6 = {
|
|
90
|
+
current,
|
|
91
|
+
currentNode,
|
|
92
|
+
canGoBack,
|
|
93
|
+
direction,
|
|
94
|
+
prev,
|
|
95
|
+
next,
|
|
96
|
+
depth,
|
|
97
|
+
isAnimating,
|
|
98
|
+
setIsAnimating
|
|
99
|
+
};
|
|
100
|
+
$[14] = canGoBack;
|
|
101
|
+
$[15] = current;
|
|
102
|
+
$[16] = currentNode;
|
|
103
|
+
$[17] = depth;
|
|
104
|
+
$[18] = direction;
|
|
105
|
+
$[19] = isAnimating;
|
|
106
|
+
$[20] = next;
|
|
107
|
+
$[21] = prev;
|
|
108
|
+
$[22] = t6;
|
|
109
|
+
} else t6 = $[22];
|
|
110
|
+
return t6;
|
|
68
111
|
};
|
|
69
112
|
|
|
70
113
|
//#endregion
|
|
71
114
|
//#region src/components/drilldown-menu/drilldown-menu.closed.tsx
|
|
72
|
-
const DrilldownMenu = (
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
const DrilldownMenu = (t0) => {
|
|
116
|
+
const $ = c(47);
|
|
117
|
+
const { collection, renderItem, onLeafSelect } = t0;
|
|
118
|
+
let t1;
|
|
119
|
+
if ($[0] !== collection) {
|
|
120
|
+
t1 = { collection };
|
|
121
|
+
$[0] = collection;
|
|
122
|
+
$[1] = t1;
|
|
123
|
+
} else t1 = $[1];
|
|
124
|
+
const menu = useDrilldownMenu(t1);
|
|
125
|
+
let t2;
|
|
126
|
+
if ($[2] !== collection || $[3] !== renderItem) {
|
|
127
|
+
t2 = (node) => {
|
|
128
|
+
if (!node) return null;
|
|
129
|
+
return renderItem ? renderItem(node) : collection.stringifyNode(node);
|
|
130
|
+
};
|
|
131
|
+
$[2] = collection;
|
|
132
|
+
$[3] = renderItem;
|
|
133
|
+
$[4] = t2;
|
|
134
|
+
} else t2 = $[4];
|
|
135
|
+
const renderNode = t2;
|
|
136
|
+
let t3;
|
|
137
|
+
if ($[5] !== collection || $[6] !== menu || $[7] !== onLeafSelect) {
|
|
138
|
+
t3 = (node_0) => {
|
|
139
|
+
if (collection.getNodeChildren(node_0).length > 0) menu.next(node_0);
|
|
140
|
+
else if (onLeafSelect) onLeafSelect(node_0);
|
|
141
|
+
};
|
|
142
|
+
$[5] = collection;
|
|
143
|
+
$[6] = menu;
|
|
144
|
+
$[7] = onLeafSelect;
|
|
145
|
+
$[8] = t3;
|
|
146
|
+
} else t3 = $[8];
|
|
147
|
+
const handleNodeClick = t3;
|
|
148
|
+
let t4;
|
|
149
|
+
if ($[9] !== collection) {
|
|
150
|
+
t4 = (node_1) => collection.getNodeChildren(node_1).length === 0;
|
|
151
|
+
$[9] = collection;
|
|
152
|
+
$[10] = t4;
|
|
153
|
+
} else t4 = $[10];
|
|
154
|
+
const isLeafNode = t4;
|
|
155
|
+
const t5 = !menu.canGoBack;
|
|
156
|
+
const t6 = menu.canGoBack ? "1" : "0";
|
|
157
|
+
let t7;
|
|
158
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
159
|
+
t7 = /* @__PURE__ */ jsx(ChevronLeftIcon, {});
|
|
160
|
+
$[11] = t7;
|
|
161
|
+
} else t7 = $[11];
|
|
162
|
+
let t8;
|
|
163
|
+
if ($[12] !== t6) {
|
|
164
|
+
t8 = /* @__PURE__ */ jsx(Icon, {
|
|
165
|
+
size: "sm",
|
|
166
|
+
color: "fg.subtle",
|
|
167
|
+
opacity: t6,
|
|
168
|
+
children: t7
|
|
169
|
+
});
|
|
170
|
+
$[12] = t6;
|
|
171
|
+
$[13] = t8;
|
|
172
|
+
} else t8 = $[13];
|
|
173
|
+
let t9;
|
|
174
|
+
if ($[14] !== menu.canGoBack || $[15] !== menu.currentNode || $[16] !== renderNode) {
|
|
175
|
+
t9 = menu.canGoBack ? renderNode(menu.currentNode) : "Menu";
|
|
176
|
+
$[14] = menu.canGoBack;
|
|
177
|
+
$[15] = menu.currentNode;
|
|
178
|
+
$[16] = renderNode;
|
|
179
|
+
$[17] = t9;
|
|
180
|
+
} else t9 = $[17];
|
|
181
|
+
let t10;
|
|
182
|
+
if ($[18] !== t9) {
|
|
183
|
+
t10 = /* @__PURE__ */ jsx(Stack, {
|
|
184
|
+
gap: "0",
|
|
185
|
+
alignItems: "start",
|
|
186
|
+
justify: "center",
|
|
187
|
+
children: /* @__PURE__ */ jsx(Span, {
|
|
188
|
+
textStyle: "md",
|
|
189
|
+
fontWeight: "medium",
|
|
190
|
+
children: t9
|
|
191
|
+
})
|
|
192
|
+
});
|
|
193
|
+
$[18] = t9;
|
|
194
|
+
$[19] = t10;
|
|
195
|
+
} else t10 = $[19];
|
|
196
|
+
let t11;
|
|
197
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
198
|
+
t11 = /* @__PURE__ */ jsx(Box, {});
|
|
199
|
+
$[20] = t11;
|
|
200
|
+
} else t11 = $[20];
|
|
201
|
+
let t12;
|
|
202
|
+
if ($[21] !== t10 || $[22] !== t8) {
|
|
203
|
+
t12 = /* @__PURE__ */ jsxs(HStack, {
|
|
204
|
+
justify: "space-between",
|
|
205
|
+
width: "full",
|
|
206
|
+
children: [
|
|
207
|
+
t8,
|
|
208
|
+
t10,
|
|
209
|
+
t11
|
|
210
|
+
]
|
|
211
|
+
});
|
|
212
|
+
$[21] = t10;
|
|
213
|
+
$[22] = t8;
|
|
214
|
+
$[23] = t12;
|
|
215
|
+
} else t12 = $[23];
|
|
216
|
+
let t13;
|
|
217
|
+
if ($[24] !== menu.prev || $[25] !== t12 || $[26] !== t5) {
|
|
218
|
+
t13 = /* @__PURE__ */ jsx(Trigger, {
|
|
219
|
+
onClick: menu.prev,
|
|
220
|
+
disabled: t5,
|
|
221
|
+
children: t12
|
|
222
|
+
});
|
|
223
|
+
$[24] = menu.prev;
|
|
224
|
+
$[25] = t12;
|
|
225
|
+
$[26] = t5;
|
|
226
|
+
$[27] = t13;
|
|
227
|
+
} else t13 = $[27];
|
|
228
|
+
const t14 = menu.isAnimating || void 0;
|
|
229
|
+
let t15;
|
|
230
|
+
if ($[28] !== menu) {
|
|
231
|
+
t15 = () => menu.setIsAnimating(false);
|
|
232
|
+
$[28] = menu;
|
|
233
|
+
$[29] = t15;
|
|
234
|
+
} else t15 = $[29];
|
|
235
|
+
let t16;
|
|
236
|
+
if ($[30] !== collection || $[31] !== handleNodeClick || $[32] !== isLeafNode || $[33] !== menu.current || $[34] !== renderNode) {
|
|
237
|
+
t16 = menu.current?.map((node_2) => /* @__PURE__ */ jsx(Item, { children: /* @__PURE__ */ jsx(Trigger, {
|
|
238
|
+
onClick: () => handleNodeClick(node_2),
|
|
239
|
+
children: /* @__PURE__ */ jsxs(HStack, {
|
|
240
|
+
justifyContent: "space-between",
|
|
241
|
+
width: "full",
|
|
242
|
+
children: [/* @__PURE__ */ jsx(Stack, {
|
|
243
|
+
gap: "0",
|
|
244
|
+
alignItems: "start",
|
|
245
|
+
children: /* @__PURE__ */ jsx(Span, {
|
|
246
|
+
fontWeight: "medium",
|
|
247
|
+
children: renderNode(node_2)
|
|
248
|
+
})
|
|
249
|
+
}), /* @__PURE__ */ jsx(Show, {
|
|
250
|
+
when: !isLeafNode(node_2),
|
|
251
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
252
|
+
size: "sm",
|
|
253
|
+
color: "fg.subtle",
|
|
254
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
255
|
+
})
|
|
256
|
+
})]
|
|
257
|
+
})
|
|
258
|
+
}) }, collection.getNodeValue(node_2)));
|
|
259
|
+
$[30] = collection;
|
|
260
|
+
$[31] = handleNodeClick;
|
|
261
|
+
$[32] = isLeafNode;
|
|
262
|
+
$[33] = menu.current;
|
|
263
|
+
$[34] = renderNode;
|
|
264
|
+
$[35] = t16;
|
|
265
|
+
} else t16 = $[35];
|
|
266
|
+
let t17;
|
|
267
|
+
if ($[36] !== t16) {
|
|
268
|
+
t17 = /* @__PURE__ */ jsx(Group, {
|
|
269
|
+
attached: true,
|
|
270
|
+
orientation: "vertical",
|
|
271
|
+
width: "full",
|
|
272
|
+
asChild: true,
|
|
273
|
+
children: /* @__PURE__ */ jsx(List, { children: t16 })
|
|
274
|
+
});
|
|
275
|
+
$[36] = t16;
|
|
276
|
+
$[37] = t17;
|
|
277
|
+
} else t17 = $[37];
|
|
278
|
+
let t18;
|
|
279
|
+
if ($[38] !== menu.depth || $[39] !== menu.direction || $[40] !== t14 || $[41] !== t15 || $[42] !== t17) {
|
|
280
|
+
t18 = /* @__PURE__ */ jsx(Viewport, { children: /* @__PURE__ */ jsx(Content, {
|
|
281
|
+
"data-animating": t14,
|
|
282
|
+
"data-direction": menu.direction,
|
|
283
|
+
onAnimationEnd: t15,
|
|
284
|
+
children: t17
|
|
285
|
+
}, menu.depth) });
|
|
286
|
+
$[38] = menu.depth;
|
|
287
|
+
$[39] = menu.direction;
|
|
288
|
+
$[40] = t14;
|
|
289
|
+
$[41] = t15;
|
|
290
|
+
$[42] = t17;
|
|
291
|
+
$[43] = t18;
|
|
292
|
+
} else t18 = $[43];
|
|
293
|
+
let t19;
|
|
294
|
+
if ($[44] !== t13 || $[45] !== t18) {
|
|
295
|
+
t19 = /* @__PURE__ */ jsxs(Root, { children: [t13, t18] });
|
|
296
|
+
$[44] = t13;
|
|
297
|
+
$[45] = t18;
|
|
298
|
+
$[46] = t19;
|
|
299
|
+
} else t19 = $[46];
|
|
300
|
+
return t19;
|
|
120
301
|
};
|
|
121
302
|
|
|
122
303
|
//#endregion
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { VisuallyHidden, createStyleContext } from "@pyck/styled-system/jsx";
|
|
4
4
|
import { field } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { Show } from "@pyck/react/show";
|
|
6
7
|
import { Wrap } from "@pyck/react/wrap";
|
|
7
|
-
import { Field as Field$1
|
|
8
|
+
import { Field as Field$1 } from "@ark-ui/react/field";
|
|
8
9
|
|
|
9
10
|
//#region src/components/field/field.tsx
|
|
10
|
-
var field_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
-
Context: () => Context,
|
|
12
|
-
ErrorText: () => ErrorText,
|
|
13
|
-
HelperText: () => HelperText,
|
|
14
|
-
Label: () => Label,
|
|
15
|
-
RequiredIndicator: () => RequiredIndicator,
|
|
16
|
-
Root: () => Root,
|
|
17
|
-
RootProvider: () => RootProvider
|
|
18
|
-
});
|
|
19
11
|
const { withProvider, withContext } = createStyleContext(field);
|
|
20
12
|
const Root = withProvider(Field$1.Root, "root");
|
|
21
13
|
const RootProvider = withProvider(Field$1.RootProvider, "root");
|
|
@@ -27,23 +19,114 @@ const RequiredIndicator = withContext(Field$1.RequiredIndicator, "requiredIndica
|
|
|
27
19
|
//#endregion
|
|
28
20
|
//#region src/components/field/field.closed.tsx
|
|
29
21
|
const Field = forwardRef(function Field(props, ref) {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
22
|
+
const $ = c(33);
|
|
23
|
+
let children;
|
|
24
|
+
let errorText;
|
|
25
|
+
let helperText;
|
|
26
|
+
let hideLabel;
|
|
27
|
+
let label;
|
|
28
|
+
let optionalText;
|
|
29
|
+
let rest;
|
|
30
|
+
if ($[0] !== props) {
|
|
31
|
+
({label, children, hideLabel, helperText, errorText, optionalText, ...rest} = props);
|
|
32
|
+
$[0] = props;
|
|
33
|
+
$[1] = children;
|
|
34
|
+
$[2] = errorText;
|
|
35
|
+
$[3] = helperText;
|
|
36
|
+
$[4] = hideLabel;
|
|
37
|
+
$[5] = label;
|
|
38
|
+
$[6] = optionalText;
|
|
39
|
+
$[7] = rest;
|
|
40
|
+
} else {
|
|
41
|
+
children = $[1];
|
|
42
|
+
errorText = $[2];
|
|
43
|
+
helperText = $[3];
|
|
44
|
+
hideLabel = $[4];
|
|
45
|
+
label = $[5];
|
|
46
|
+
optionalText = $[6];
|
|
47
|
+
rest = $[7];
|
|
48
|
+
}
|
|
49
|
+
let t0;
|
|
50
|
+
if ($[8] !== optionalText) {
|
|
51
|
+
t0 = /* @__PURE__ */ jsx(RequiredIndicator, { fallback: optionalText });
|
|
52
|
+
$[8] = optionalText;
|
|
53
|
+
$[9] = t0;
|
|
54
|
+
} else t0 = $[9];
|
|
55
|
+
let t1;
|
|
56
|
+
if ($[10] !== label || $[11] !== t0) {
|
|
57
|
+
t1 = /* @__PURE__ */ jsxs(Label, { children: [label, t0] });
|
|
58
|
+
$[10] = label;
|
|
59
|
+
$[11] = t0;
|
|
60
|
+
$[12] = t1;
|
|
61
|
+
} else t1 = $[12];
|
|
62
|
+
let t2;
|
|
63
|
+
if ($[13] !== hideLabel || $[14] !== t1) {
|
|
64
|
+
t2 = /* @__PURE__ */ jsx(Wrap, {
|
|
65
|
+
when: hideLabel,
|
|
66
|
+
with: _temp,
|
|
67
|
+
children: t1
|
|
68
|
+
});
|
|
69
|
+
$[13] = hideLabel;
|
|
70
|
+
$[14] = t1;
|
|
71
|
+
$[15] = t2;
|
|
72
|
+
} else t2 = $[15];
|
|
73
|
+
let t3;
|
|
74
|
+
if ($[16] !== label || $[17] !== t2) {
|
|
75
|
+
t3 = /* @__PURE__ */ jsx(Show, {
|
|
76
|
+
when: label,
|
|
77
|
+
children: t2
|
|
78
|
+
});
|
|
79
|
+
$[16] = label;
|
|
80
|
+
$[17] = t2;
|
|
81
|
+
$[18] = t3;
|
|
82
|
+
} else t3 = $[18];
|
|
83
|
+
let t4;
|
|
84
|
+
if ($[19] !== helperText) {
|
|
85
|
+
t4 = /* @__PURE__ */ jsx(HelperText, { children: helperText });
|
|
86
|
+
$[19] = helperText;
|
|
87
|
+
$[20] = t4;
|
|
88
|
+
} else t4 = $[20];
|
|
89
|
+
let t5;
|
|
90
|
+
if ($[21] !== helperText || $[22] !== t4) {
|
|
91
|
+
t5 = /* @__PURE__ */ jsx(Show, {
|
|
92
|
+
when: helperText,
|
|
93
|
+
children: t4
|
|
94
|
+
});
|
|
95
|
+
$[21] = helperText;
|
|
96
|
+
$[22] = t4;
|
|
97
|
+
$[23] = t5;
|
|
98
|
+
} else t5 = $[23];
|
|
99
|
+
let t6;
|
|
100
|
+
if ($[24] !== errorText) {
|
|
101
|
+
t6 = /* @__PURE__ */ jsx(ErrorText, { children: errorText });
|
|
102
|
+
$[24] = errorText;
|
|
103
|
+
$[25] = t6;
|
|
104
|
+
} else t6 = $[25];
|
|
105
|
+
let t7;
|
|
106
|
+
if ($[26] !== children || $[27] !== ref || $[28] !== rest || $[29] !== t3 || $[30] !== t5 || $[31] !== t6) {
|
|
107
|
+
t7 = /* @__PURE__ */ jsxs(Root, {
|
|
108
|
+
ref,
|
|
109
|
+
...rest,
|
|
110
|
+
children: [
|
|
111
|
+
t3,
|
|
112
|
+
children,
|
|
113
|
+
t5,
|
|
114
|
+
t6
|
|
115
|
+
]
|
|
116
|
+
});
|
|
117
|
+
$[26] = children;
|
|
118
|
+
$[27] = ref;
|
|
119
|
+
$[28] = rest;
|
|
120
|
+
$[29] = t3;
|
|
121
|
+
$[30] = t5;
|
|
122
|
+
$[31] = t6;
|
|
123
|
+
$[32] = t7;
|
|
124
|
+
} else t7 = $[32];
|
|
125
|
+
return t7;
|
|
46
126
|
});
|
|
127
|
+
function _temp(children_0) {
|
|
128
|
+
return /* @__PURE__ */ jsx(VisuallyHidden, { children: children_0 });
|
|
129
|
+
}
|
|
47
130
|
|
|
48
131
|
//#endregion
|
|
49
132
|
export { Field };
|
|
@@ -2,8 +2,8 @@ import * as react from "react";
|
|
|
2
2
|
import { ComponentProps, PropsWithChildren } from "react";
|
|
3
3
|
import * as _pyck_styled_system_jsx0 from "@pyck/styled-system/jsx";
|
|
4
4
|
import * as _pyck_styled_system_recipes0 from "@pyck/styled-system/recipes";
|
|
5
|
-
import { FloatingPanel } from "@ark-ui/react/floating-panel";
|
|
6
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
import { FloatingPanel } from "@ark-ui/react/floating-panel";
|
|
7
7
|
|
|
8
8
|
//#region src/components/floating-panel/floating-panel.d.ts
|
|
9
9
|
declare namespace floating_panel_d_exports {
|