@pyck/react 0.0.3 → 0.0.6

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.
Files changed (58) hide show
  1. package/dist/checkmark-fJPHeX8N.js +62 -0
  2. package/dist/close-button-r3blTfSH.js +141 -0
  3. package/dist/components/avatar/index.js +96 -11
  4. package/dist/components/button/index.js +1 -1
  5. package/dist/components/carousel/index.js +35 -10
  6. package/dist/components/checkbox/index.js +103 -22
  7. package/dist/components/checkmark/index.js +1 -1
  8. package/dist/components/combobox/index.js +30 -6
  9. package/dist/components/data-list/index.js +19 -8
  10. package/dist/components/date-picker/index.js +1 -1
  11. package/dist/components/dialog/index.js +45 -14
  12. package/dist/components/display-date-value/index.js +2 -2
  13. package/dist/components/display-value/index.js +1 -1
  14. package/dist/components/drawer/index.js +17 -1
  15. package/dist/components/drilldown-menu/index.js +209 -78
  16. package/dist/components/field/index.js +89 -16
  17. package/dist/components/floating-panel/index.js +54 -43
  18. package/dist/components/form/index.js +115 -26
  19. package/dist/components/highlight/index.js +52 -14
  20. package/dist/components/icon/index.js +1 -1
  21. package/dist/components/image/index.js +27 -2
  22. package/dist/components/input/index.js +47 -4
  23. package/dist/components/input-group/index.js +56 -14
  24. package/dist/components/json-form-builder/index.js +243 -85
  25. package/dist/components/logo/index.js +46 -19
  26. package/dist/components/menu/index.js +28 -6
  27. package/dist/components/number-input/index.js +46 -7
  28. package/dist/components/page-header/index.js +45 -12
  29. package/dist/components/pagination/index.js +35 -13
  30. package/dist/components/progress/index.js +47 -8
  31. package/dist/components/progress-circle/index.js +66 -17
  32. package/dist/components/radio-group/index.js +47 -6
  33. package/dist/components/scroll-area/index.js +64 -9
  34. package/dist/components/segment-group/index.js +34 -5
  35. package/dist/components/select/index.js +85 -21
  36. package/dist/components/show/index.js +1 -1
  37. package/dist/components/skeleton/index.js +44 -4
  38. package/dist/components/slider/index.js +134 -37
  39. package/dist/components/spotlight/index.js +269 -125
  40. package/dist/components/steps/index.js +26 -12
  41. package/dist/components/switch/index.js +160 -29
  42. package/dist/components/table/index.js +370 -66
  43. package/dist/components/tags-input/index.js +17 -7
  44. package/dist/components/textarea/index.js +47 -4
  45. package/dist/components/toast/index.js +28 -22
  46. package/dist/components/tooltip/index.js +71 -14
  47. package/dist/components/tree-view/index.js +45 -8
  48. package/dist/display-date-value-BAU46P8s.js +40 -0
  49. package/dist/display-value-Bz71ZqgM.js +57 -0
  50. package/dist/{featured-icon-DPysOpSf.js → featured-icon-CKDv0xfF.js} +27 -4
  51. package/dist/show-DAysVQAC.js +27 -0
  52. package/dist/utils/index.js +164 -73
  53. package/package.json +21 -3
  54. package/dist/checkmark-CW-yHMvN.js +0 -18
  55. package/dist/close-button-BM7ikbYh.js +0 -52
  56. package/dist/display-date-value-gTlidtNz.js +0 -21
  57. package/dist/display-value-BNKxQ99u.js +0 -37
  58. package/dist/show-IaI-36v9.js +0 -12
@@ -1,17 +1,18 @@
1
1
  import { t as __exportAll } from "../../chunk-BYypO7fO.js";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { forwardRef, useId, useSyncExternalStore } from "react";
3
4
  import { ark } from "@ark-ui/react/factory";
4
5
  import { Stack, createStyleContext } from "@pyck/styled-system/jsx";
5
6
  import { dialog } from "@pyck/styled-system/recipes";
6
7
  import { CheckCircleIcon, FilePenLineIcon, Trash2Icon } from "lucide-react";
7
- import { omit } from "@pyck/react/utils";
8
8
  import { useForm } from "react-hook-form";
9
+ import { omit } from "@pyck/react/utils";
9
10
  import { Show } from "@pyck/react/show";
10
- import { Dialog, DialogContext as Context, useDialogContext } from "@ark-ui/react/dialog";
11
11
  import { Portal } from "@ark-ui/react/portal";
12
12
  import { Button, CloseButton } from "@pyck/react/button";
13
13
  import { FeaturedIcon } from "@pyck/react/icon";
14
14
  import { shallow } from "zustand/shallow";
15
+ import { Dialog, DialogContext as Context, useDialogContext } from "@ark-ui/react/dialog";
15
16
  import { zodResolver } from "@hookform/resolvers/zod";
16
17
  import { Form } from "@pyck/react/form";
17
18
 
@@ -116,14 +117,26 @@ function createOverlay(Component, options) {
116
117
  publish();
117
118
  };
118
119
  function Viewport() {
120
+ const $ = c(4);
119
121
  const overlays = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
120
- return <>
121
- {overlays.map((props) => {
122
- const { _id, ...componentProps } = props;
123
- const Comp = Component;
124
- return <Comp key={_id} {...componentProps} />;
125
- })}
126
- </>;
122
+ let t0;
123
+ if ($[0] !== overlays) {
124
+ t0 = overlays.map(_temp);
125
+ $[0] = overlays;
126
+ $[1] = t0;
127
+ } else t0 = $[1];
128
+ let t1;
129
+ if ($[2] !== t0) {
130
+ t1 = <>{t0}</>;
131
+ $[2] = t0;
132
+ $[3] = t1;
133
+ } else t1 = $[3];
134
+ return t1;
135
+ }
136
+ function _temp(props) {
137
+ const { _id, ...componentProps } = props;
138
+ const Comp = Component;
139
+ return <Comp key={_id} {...componentProps} />;
127
140
  }
128
141
  return {
129
142
  Viewport,
@@ -176,8 +189,23 @@ const Body = withContext(ark.div, "body");
176
189
  const Header = withContext(ark.div, "header");
177
190
  const Footer = withContext(ark.div, "footer");
178
191
  const ActionTrigger = forwardRef(function ActionTrigger(props, ref) {
192
+ const $ = c(6);
179
193
  const dialog = useDialogContext();
180
- return <ark.button {...props} ref={ref} onClick={() => dialog.setOpen(false)} />;
194
+ let t0;
195
+ if ($[0] !== dialog) {
196
+ t0 = () => dialog.setOpen(false);
197
+ $[0] = dialog;
198
+ $[1] = t0;
199
+ } else t0 = $[1];
200
+ let t1;
201
+ if ($[2] !== props || $[3] !== ref || $[4] !== t0) {
202
+ t1 = <ark.button {...props} ref={ref} onClick={t0} />;
203
+ $[2] = props;
204
+ $[3] = ref;
205
+ $[4] = t0;
206
+ $[5] = t1;
207
+ } else t1 = $[5];
208
+ return t1;
181
209
  });
182
210
 
183
211
  //#endregion
@@ -285,10 +313,13 @@ const FormDialog = {
285
313
  //#endregion
286
314
  //#region src/components/dialog/overlay-manager.tsx
287
315
  const OverlayManager = () => {
288
- return <>
289
- <FormDialog.Viewport />
290
- <ConfirmDialog.Viewport />
291
- </>;
316
+ const $ = c(1);
317
+ let t0;
318
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
319
+ t0 = <><FormDialog.Viewport /><ConfirmDialog.Viewport /></>;
320
+ $[0] = t0;
321
+ } else t0 = $[0];
322
+ return t0;
292
323
  };
293
324
 
294
325
  //#endregion
@@ -1,4 +1,4 @@
1
- import "../../display-value-BNKxQ99u.js";
2
- import { t as DisplayDateValue } from "../../display-date-value-gTlidtNz.js";
1
+ import "../../display-value-Bz71ZqgM.js";
2
+ import { t as DisplayDateValue } from "../../display-date-value-BAU46P8s.js";
3
3
 
4
4
  export { DisplayDateValue };
@@ -1,3 +1,3 @@
1
- import { t as DisplayValue } from "../../display-value-BNKxQ99u.js";
1
+ import { t as DisplayValue } from "../../display-value-Bz71ZqgM.js";
2
2
 
3
3
  export { DisplayValue };
@@ -1,4 +1,5 @@
1
1
  import { t as __exportAll } from "../../chunk-BYypO7fO.js";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { ark } from "@ark-ui/react/factory";
4
5
  import { createStyleContext } from "@pyck/styled-system/jsx";
@@ -42,8 +43,23 @@ const Body = withContext(ark.div, "body");
42
43
  const Header = withContext(ark.div, "header");
43
44
  const Footer = withContext(ark.div, "footer");
44
45
  const ActionTrigger = forwardRef(function ActionTrigger(props, ref) {
46
+ const $ = c(6);
45
47
  const dialog = useDialogContext();
46
- return <ark.button {...props} ref={ref} onClick={() => dialog.setOpen(false)} />;
48
+ let t0;
49
+ if ($[0] !== dialog) {
50
+ t0 = () => dialog.setOpen(false);
51
+ $[0] = dialog;
52
+ $[1] = t0;
53
+ } else t0 = $[1];
54
+ let t1;
55
+ if ($[2] !== props || $[3] !== ref || $[4] !== t0) {
56
+ t1 = <ark.button {...props} ref={ref} onClick={t0} />;
57
+ $[2] = props;
58
+ $[3] = ref;
59
+ $[4] = t0;
60
+ $[5] = t1;
61
+ } else t1 = $[5];
62
+ return t1;
47
63
  });
48
64
 
49
65
  //#endregion
@@ -1,8 +1,9 @@
1
1
  import { t as __exportAll } from "../../chunk-BYypO7fO.js";
2
- import { n as Icon } from "../../featured-icon-DPysOpSf.js";
2
+ import { n as Icon } from "../../featured-icon-CKDv0xfF.js";
3
3
  import "../icon/index.js";
4
4
  import { t as Span } from "../../span-DWZSA3mH.js";
5
5
  import "../span/index.js";
6
+ import { c } from "react/compiler-runtime";
6
7
  import { startTransition, useState } from "react";
7
8
  import { ark } from "@ark-ui/react/factory";
8
9
  import { Box, HStack, Stack, createStyleContext } from "@pyck/styled-system/jsx";
@@ -30,93 +31,223 @@ const Trigger = withContext(ark.button, "trigger");
30
31
 
31
32
  //#endregion
32
33
  //#region src/components/drilldown-menu/use-drilldown-menu.ts
33
- const useDrilldownMenu = ({ collection }) => {
34
+ const useDrilldownMenu = (t0) => {
35
+ const $ = c(23);
36
+ const { collection } = t0;
34
37
  const [currentValue, setCurrentValue] = useState(null);
35
38
  const [direction, setDirection] = useState("forward");
36
39
  const [isAnimating, setIsAnimating] = useState(false);
37
- const currentNode = currentValue ? collection.findNode(currentValue) ?? collection.rootNode : collection.rootNode;
38
- const current = collection.getNodeChildren(currentNode);
39
- const next = (node) => {
40
- if (collection.getNodeChildren(node).length > 0) {
41
- setDirection("forward");
40
+ let t1;
41
+ if ($[0] !== collection || $[1] !== currentValue) {
42
+ t1 = currentValue ? collection.findNode(currentValue) ?? collection.rootNode : collection.rootNode;
43
+ $[0] = collection;
44
+ $[1] = currentValue;
45
+ $[2] = t1;
46
+ } else t1 = $[2];
47
+ const currentNode = t1;
48
+ let t2;
49
+ if ($[3] !== collection || $[4] !== currentNode) {
50
+ t2 = collection.getNodeChildren(currentNode);
51
+ $[3] = collection;
52
+ $[4] = currentNode;
53
+ $[5] = t2;
54
+ } else t2 = $[5];
55
+ const current = t2;
56
+ let t3;
57
+ if ($[6] !== collection) {
58
+ t3 = (node) => {
59
+ if (collection.getNodeChildren(node).length > 0) {
60
+ setDirection("forward");
61
+ setIsAnimating(true);
62
+ startTransition(() => {
63
+ setCurrentValue(collection.getNodeValue(node));
64
+ });
65
+ }
66
+ };
67
+ $[6] = collection;
68
+ $[7] = t3;
69
+ } else t3 = $[7];
70
+ const next = t3;
71
+ let t4;
72
+ if ($[8] !== collection || $[9] !== currentValue) {
73
+ t4 = () => {
74
+ const parentNode = currentValue ? collection.getParentNode(currentValue) : void 0;
75
+ setDirection("back");
42
76
  setIsAnimating(true);
43
77
  startTransition(() => {
44
- setCurrentValue(collection.getNodeValue(node));
78
+ setCurrentValue(parentNode && !collection.isRootNode(parentNode) ? collection.getNodeValue(parentNode) : null);
45
79
  });
46
- }
47
- };
48
- const prev = () => {
49
- const parentNode = currentValue ? collection.getParentNode(currentValue) : void 0;
50
- setDirection("back");
51
- setIsAnimating(true);
52
- startTransition(() => {
53
- setCurrentValue(parentNode && !collection.isRootNode(parentNode) ? collection.getNodeValue(parentNode) : null);
54
- });
55
- };
56
- const depth = currentValue ? collection.getDepth(currentValue) : 0;
57
- return {
58
- current,
59
- currentNode,
60
- canGoBack: currentValue !== null,
61
- direction,
62
- prev,
63
- next,
64
- depth,
65
- isAnimating,
66
- setIsAnimating
67
- };
80
+ };
81
+ $[8] = collection;
82
+ $[9] = currentValue;
83
+ $[10] = t4;
84
+ } else t4 = $[10];
85
+ const prev = t4;
86
+ let t5;
87
+ if ($[11] !== collection || $[12] !== currentValue) {
88
+ t5 = currentValue ? collection.getDepth(currentValue) : 0;
89
+ $[11] = collection;
90
+ $[12] = currentValue;
91
+ $[13] = t5;
92
+ } else t5 = $[13];
93
+ const depth = t5;
94
+ const canGoBack = currentValue !== null;
95
+ let t6;
96
+ if ($[14] !== canGoBack || $[15] !== current || $[16] !== currentNode || $[17] !== depth || $[18] !== direction || $[19] !== isAnimating || $[20] !== next || $[21] !== prev) {
97
+ t6 = {
98
+ current,
99
+ currentNode,
100
+ canGoBack,
101
+ direction,
102
+ prev,
103
+ next,
104
+ depth,
105
+ isAnimating,
106
+ setIsAnimating
107
+ };
108
+ $[14] = canGoBack;
109
+ $[15] = current;
110
+ $[16] = currentNode;
111
+ $[17] = depth;
112
+ $[18] = direction;
113
+ $[19] = isAnimating;
114
+ $[20] = next;
115
+ $[21] = prev;
116
+ $[22] = t6;
117
+ } else t6 = $[22];
118
+ return t6;
68
119
  };
69
120
 
70
121
  //#endregion
71
122
  //#region src/components/drilldown-menu/drilldown-menu.closed.tsx
72
- const DrilldownMenu = ({ collection, renderItem, onLeafSelect }) => {
73
- const menu = useDrilldownMenu({ collection });
74
- const renderNode = (node) => {
75
- if (!node) return null;
76
- return renderItem ? renderItem(node) : collection.stringifyNode(node);
77
- };
78
- const handleNodeClick = (node) => {
79
- if (collection.getNodeChildren(node).length > 0) menu.next(node);
80
- else if (onLeafSelect) onLeafSelect(node);
81
- };
82
- const isLeafNode = (node) => collection.getNodeChildren(node).length === 0;
83
- return <drilldown_menu_exports.Root>
84
- <drilldown_menu_exports.Trigger onClick={menu.prev} disabled={!menu.canGoBack}>
85
- <HStack justify="space-between" width="full">
86
- <Icon size="sm" color="fg.subtle" opacity={menu.canGoBack ? "1" : "0"}>
87
- <ChevronLeftIcon />
88
- </Icon>
89
- <Stack gap="0" alignItems="start" justify="center">
90
- <Span textStyle="md" fontWeight="medium">
91
- {menu.canGoBack ? renderNode(menu.currentNode) : "Menu"}
92
- </Span>
93
- </Stack>
94
- <Box />
95
- </HStack>
96
- </drilldown_menu_exports.Trigger>
97
- <drilldown_menu_exports.Viewport>
98
- <drilldown_menu_exports.Content key={menu.depth} data-animating={menu.isAnimating || void 0} data-direction={menu.direction} onAnimationEnd={() => menu.setIsAnimating(false)}>
99
- <Group attached orientation="vertical" width="full" asChild>
100
- <drilldown_menu_exports.List>
101
- {menu.current?.map((node) => <drilldown_menu_exports.Item key={collection.getNodeValue(node)}>
102
- <drilldown_menu_exports.Trigger onClick={() => handleNodeClick(node)}>
103
- <HStack justifyContent="space-between" width="full">
104
- <Stack gap="0" alignItems="start">
105
- <Span fontWeight="medium">{renderNode(node)}</Span>
106
- </Stack>
107
- <Show when={!isLeafNode(node)}>
108
- <Icon size="sm" color="fg.subtle">
109
- <ChevronRightIcon />
110
- </Icon>
111
- </Show>
112
- </HStack>
113
- </drilldown_menu_exports.Trigger>
114
- </drilldown_menu_exports.Item>)}
115
- </drilldown_menu_exports.List>
116
- </Group>
117
- </drilldown_menu_exports.Content>
118
- </drilldown_menu_exports.Viewport>
119
- </drilldown_menu_exports.Root>;
123
+ const DrilldownMenu = (t0) => {
124
+ const $ = c(47);
125
+ const { collection, renderItem, onLeafSelect } = t0;
126
+ let t1;
127
+ if ($[0] !== collection) {
128
+ t1 = { collection };
129
+ $[0] = collection;
130
+ $[1] = t1;
131
+ } else t1 = $[1];
132
+ const menu = useDrilldownMenu(t1);
133
+ let t2;
134
+ if ($[2] !== collection || $[3] !== renderItem) {
135
+ t2 = (node) => {
136
+ if (!node) return null;
137
+ return renderItem ? renderItem(node) : collection.stringifyNode(node);
138
+ };
139
+ $[2] = collection;
140
+ $[3] = renderItem;
141
+ $[4] = t2;
142
+ } else t2 = $[4];
143
+ const renderNode = t2;
144
+ let t3;
145
+ if ($[5] !== collection || $[6] !== menu || $[7] !== onLeafSelect) {
146
+ t3 = (node_0) => {
147
+ if (collection.getNodeChildren(node_0).length > 0) menu.next(node_0);
148
+ else if (onLeafSelect) onLeafSelect(node_0);
149
+ };
150
+ $[5] = collection;
151
+ $[6] = menu;
152
+ $[7] = onLeafSelect;
153
+ $[8] = t3;
154
+ } else t3 = $[8];
155
+ const handleNodeClick = t3;
156
+ let t4;
157
+ if ($[9] !== collection) {
158
+ t4 = (node_1) => collection.getNodeChildren(node_1).length === 0;
159
+ $[9] = collection;
160
+ $[10] = t4;
161
+ } else t4 = $[10];
162
+ const isLeafNode = t4;
163
+ const t5 = !menu.canGoBack;
164
+ const t6 = menu.canGoBack ? "1" : "0";
165
+ let t7;
166
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
167
+ t7 = <ChevronLeftIcon />;
168
+ $[11] = t7;
169
+ } else t7 = $[11];
170
+ let t8;
171
+ if ($[12] !== t6) {
172
+ t8 = <Icon size="sm" color="fg.subtle" opacity={t6}>{t7}</Icon>;
173
+ $[12] = t6;
174
+ $[13] = t8;
175
+ } else t8 = $[13];
176
+ let t9;
177
+ if ($[14] !== menu.canGoBack || $[15] !== menu.currentNode || $[16] !== renderNode) {
178
+ t9 = menu.canGoBack ? renderNode(menu.currentNode) : "Menu";
179
+ $[14] = menu.canGoBack;
180
+ $[15] = menu.currentNode;
181
+ $[16] = renderNode;
182
+ $[17] = t9;
183
+ } else t9 = $[17];
184
+ let t10;
185
+ if ($[18] !== t9) {
186
+ t10 = <Stack gap="0" alignItems="start" justify="center"><Span textStyle="md" fontWeight="medium">{t9}</Span></Stack>;
187
+ $[18] = t9;
188
+ $[19] = t10;
189
+ } else t10 = $[19];
190
+ let t11;
191
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
192
+ t11 = <Box />;
193
+ $[20] = t11;
194
+ } else t11 = $[20];
195
+ let t12;
196
+ if ($[21] !== t10 || $[22] !== t8) {
197
+ t12 = <HStack justify="space-between" width="full">{t8}{t10}{t11}</HStack>;
198
+ $[21] = t10;
199
+ $[22] = t8;
200
+ $[23] = t12;
201
+ } else t12 = $[23];
202
+ let t13;
203
+ if ($[24] !== menu.prev || $[25] !== t12 || $[26] !== t5) {
204
+ t13 = <drilldown_menu_exports.Trigger onClick={menu.prev} disabled={t5}>{t12}</drilldown_menu_exports.Trigger>;
205
+ $[24] = menu.prev;
206
+ $[25] = t12;
207
+ $[26] = t5;
208
+ $[27] = t13;
209
+ } else t13 = $[27];
210
+ const t14 = menu.isAnimating || void 0;
211
+ let t15;
212
+ if ($[28] !== menu) {
213
+ t15 = () => menu.setIsAnimating(false);
214
+ $[28] = menu;
215
+ $[29] = t15;
216
+ } else t15 = $[29];
217
+ let t16;
218
+ if ($[30] !== collection || $[31] !== handleNodeClick || $[32] !== isLeafNode || $[33] !== menu.current || $[34] !== renderNode) {
219
+ t16 = menu.current?.map((node_2) => <drilldown_menu_exports.Item key={collection.getNodeValue(node_2)}><drilldown_menu_exports.Trigger onClick={() => handleNodeClick(node_2)}><HStack justifyContent="space-between" width="full"><Stack gap="0" alignItems="start"><Span fontWeight="medium">{renderNode(node_2)}</Span></Stack><Show when={!isLeafNode(node_2)}><Icon size="sm" color="fg.subtle"><ChevronRightIcon /></Icon></Show></HStack></drilldown_menu_exports.Trigger></drilldown_menu_exports.Item>);
220
+ $[30] = collection;
221
+ $[31] = handleNodeClick;
222
+ $[32] = isLeafNode;
223
+ $[33] = menu.current;
224
+ $[34] = renderNode;
225
+ $[35] = t16;
226
+ } else t16 = $[35];
227
+ let t17;
228
+ if ($[36] !== t16) {
229
+ t17 = <Group attached={true} orientation="vertical" width="full" asChild={true}><drilldown_menu_exports.List>{t16}</drilldown_menu_exports.List></Group>;
230
+ $[36] = t16;
231
+ $[37] = t17;
232
+ } else t17 = $[37];
233
+ let t18;
234
+ if ($[38] !== menu.depth || $[39] !== menu.direction || $[40] !== t14 || $[41] !== t15 || $[42] !== t17) {
235
+ t18 = <drilldown_menu_exports.Viewport><drilldown_menu_exports.Content key={menu.depth} data-animating={t14} data-direction={menu.direction} onAnimationEnd={t15}>{t17}</drilldown_menu_exports.Content></drilldown_menu_exports.Viewport>;
236
+ $[38] = menu.depth;
237
+ $[39] = menu.direction;
238
+ $[40] = t14;
239
+ $[41] = t15;
240
+ $[42] = t17;
241
+ $[43] = t18;
242
+ } else t18 = $[43];
243
+ let t19;
244
+ if ($[44] !== t13 || $[45] !== t18) {
245
+ t19 = <drilldown_menu_exports.Root>{t13}{t18}</drilldown_menu_exports.Root>;
246
+ $[44] = t13;
247
+ $[45] = t18;
248
+ $[46] = t19;
249
+ } else t19 = $[46];
250
+ return t19;
120
251
  };
121
252
 
122
253
  //#endregion
@@ -1,4 +1,5 @@
1
1
  import { t as __exportAll } from "../../chunk-BYypO7fO.js";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { VisuallyHidden, createStyleContext } from "@pyck/styled-system/jsx";
4
5
  import { field } from "@pyck/styled-system/recipes";
@@ -27,23 +28,95 @@ const RequiredIndicator = withContext(Field$1.RequiredIndicator, "requiredIndica
27
28
  //#endregion
28
29
  //#region src/components/field/field.closed.tsx
29
30
  const Field = forwardRef(function Field(props, ref) {
30
- const { label, children, hideLabel, helperText, errorText, optionalText, ...rest } = props;
31
- return <field_exports.Root ref={ref} {...rest}>
32
- <Show when={label}>
33
- <Wrap when={hideLabel} with={(children) => <VisuallyHidden>{children}</VisuallyHidden>}>
34
- <field_exports.Label>
35
- {label}
36
- <field_exports.RequiredIndicator fallback={optionalText} />
37
- </field_exports.Label>
38
- </Wrap>
39
- </Show>
40
- {children}
41
- <Show when={helperText}>
42
- <field_exports.HelperText>{helperText}</field_exports.HelperText>
43
- </Show>
44
- <field_exports.ErrorText>{errorText}</field_exports.ErrorText>
45
- </field_exports.Root>;
31
+ const $ = c(33);
32
+ let children;
33
+ let errorText;
34
+ let helperText;
35
+ let hideLabel;
36
+ let label;
37
+ let optionalText;
38
+ let rest;
39
+ if ($[0] !== props) {
40
+ ({label, children, hideLabel, helperText, errorText, optionalText, ...rest} = props);
41
+ $[0] = props;
42
+ $[1] = children;
43
+ $[2] = errorText;
44
+ $[3] = helperText;
45
+ $[4] = hideLabel;
46
+ $[5] = label;
47
+ $[6] = optionalText;
48
+ $[7] = rest;
49
+ } else {
50
+ children = $[1];
51
+ errorText = $[2];
52
+ helperText = $[3];
53
+ hideLabel = $[4];
54
+ label = $[5];
55
+ optionalText = $[6];
56
+ rest = $[7];
57
+ }
58
+ let t0;
59
+ if ($[8] !== optionalText) {
60
+ t0 = <field_exports.RequiredIndicator fallback={optionalText} />;
61
+ $[8] = optionalText;
62
+ $[9] = t0;
63
+ } else t0 = $[9];
64
+ let t1;
65
+ if ($[10] !== label || $[11] !== t0) {
66
+ t1 = <field_exports.Label>{label}{t0}</field_exports.Label>;
67
+ $[10] = label;
68
+ $[11] = t0;
69
+ $[12] = t1;
70
+ } else t1 = $[12];
71
+ let t2;
72
+ if ($[13] !== hideLabel || $[14] !== t1) {
73
+ t2 = <Wrap when={hideLabel} with={_temp}>{t1}</Wrap>;
74
+ $[13] = hideLabel;
75
+ $[14] = t1;
76
+ $[15] = t2;
77
+ } else t2 = $[15];
78
+ let t3;
79
+ if ($[16] !== label || $[17] !== t2) {
80
+ t3 = <Show when={label}>{t2}</Show>;
81
+ $[16] = label;
82
+ $[17] = t2;
83
+ $[18] = t3;
84
+ } else t3 = $[18];
85
+ let t4;
86
+ if ($[19] !== helperText) {
87
+ t4 = <field_exports.HelperText>{helperText}</field_exports.HelperText>;
88
+ $[19] = helperText;
89
+ $[20] = t4;
90
+ } else t4 = $[20];
91
+ let t5;
92
+ if ($[21] !== helperText || $[22] !== t4) {
93
+ t5 = <Show when={helperText}>{t4}</Show>;
94
+ $[21] = helperText;
95
+ $[22] = t4;
96
+ $[23] = t5;
97
+ } else t5 = $[23];
98
+ let t6;
99
+ if ($[24] !== errorText) {
100
+ t6 = <field_exports.ErrorText>{errorText}</field_exports.ErrorText>;
101
+ $[24] = errorText;
102
+ $[25] = t6;
103
+ } else t6 = $[25];
104
+ let t7;
105
+ if ($[26] !== children || $[27] !== ref || $[28] !== rest || $[29] !== t3 || $[30] !== t5 || $[31] !== t6) {
106
+ t7 = <field_exports.Root ref={ref} {...rest}>{t3}{children}{t5}{t6}</field_exports.Root>;
107
+ $[26] = children;
108
+ $[27] = ref;
109
+ $[28] = rest;
110
+ $[29] = t3;
111
+ $[30] = t5;
112
+ $[31] = t6;
113
+ $[32] = t7;
114
+ } else t7 = $[32];
115
+ return t7;
46
116
  });
117
+ function _temp(children_0) {
118
+ return <VisuallyHidden>{children_0}</VisuallyHidden>;
119
+ }
47
120
 
48
121
  //#endregion
49
122
  export { Field };