@pyck/react 0.0.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/checkmark-CW-yHMvN.js +18 -0
- package/dist/chunk-BYypO7fO.js +18 -0
- package/dist/close-button-BM7ikbYh.js +52 -0
- package/dist/components/absolute-center/index.d.ts +11 -0
- package/dist/components/absolute-center/index.js +9 -0
- package/dist/components/action-bar/index.d.ts +21 -0
- package/dist/components/action-bar/index.js +35 -0
- package/dist/components/avatar/index.d.ts +22 -0
- package/dist/components/avatar/index.js +53 -0
- package/dist/components/badge/index.d.ts +11 -0
- package/dist/components/badge/index.js +9 -0
- package/dist/components/breadcrumb/index.d.ts +19 -0
- package/dist/components/breadcrumb/index.js +31 -0
- package/dist/components/button/index.d.ts +47 -0
- package/dist/components/button/index.js +3 -0
- package/dist/components/card/index.d.ts +19 -0
- package/dist/components/card/index.js +24 -0
- package/dist/components/carousel/index.d.ts +25 -0
- package/dist/components/carousel/index.js +65 -0
- package/dist/components/checkbox/index.d.ts +35 -0
- package/dist/components/checkbox/index.js +67 -0
- package/dist/components/checkmark/index.d.ts +26 -0
- package/dist/components/checkmark/index.js +3 -0
- package/dist/components/clipboard/index.d.ts +21 -0
- package/dist/components/clipboard/index.js +36 -0
- package/dist/components/collapsible/index.d.ts +18 -0
- package/dist/components/collapsible/index.js +23 -0
- package/dist/components/combobox/index.d.ts +32 -0
- package/dist/components/combobox/index.js +62 -0
- package/dist/components/data-list/index.d.ts +26 -0
- package/dist/components/data-list/index.js +39 -0
- package/dist/components/date-picker/index.d.ts +38 -0
- package/dist/components/date-picker/index.js +81 -0
- package/dist/components/dialog/index.d.ts +107 -0
- package/dist/components/dialog/index.js +295 -0
- package/dist/components/display-date-value/index.d.ts +3 -0
- package/dist/components/display-date-value/index.js +4 -0
- package/dist/components/display-value/index.d.ts +2 -0
- package/dist/components/display-value/index.js +3 -0
- package/dist/components/drawer/index.d.ts +28 -0
- package/dist/components/drawer/index.js +50 -0
- package/dist/components/drilldown-menu/index.d.ts +16 -0
- package/dist/components/drilldown-menu/index.js +123 -0
- package/dist/components/field/index.d.ts +21 -0
- package/dist/components/field/index.js +49 -0
- package/dist/components/fieldset/index.d.ts +23 -0
- package/dist/components/fieldset/index.js +32 -0
- package/dist/components/floating-panel/index.d.ts +23 -0
- package/dist/components/floating-panel/index.js +86 -0
- package/dist/components/for/index.d.ts +20 -0
- package/dist/components/for/index.js +9 -0
- package/dist/components/form/index.d.ts +41 -0
- package/dist/components/form/index.js +46 -0
- package/dist/components/format/index.d.ts +2 -0
- package/dist/components/format/index.js +3 -0
- package/dist/components/group/index.d.ts +11 -0
- package/dist/components/group/index.js +9 -0
- package/dist/components/heading/index.d.ts +12 -0
- package/dist/components/heading/index.js +8 -0
- package/dist/components/highlight/index.d.ts +17 -0
- package/dist/components/highlight/index.js +27 -0
- package/dist/components/icon/index.d.ts +19 -0
- package/dist/components/icon/index.js +3 -0
- package/dist/components/image/index.d.ts +22 -0
- package/dist/components/image/index.js +12 -0
- package/dist/components/input/index.d.ts +23 -0
- package/dist/components/input/index.js +21 -0
- package/dist/components/input-addon/index.d.ts +11 -0
- package/dist/components/input-addon/index.js +9 -0
- package/dist/components/input-group/index.d.ts +16 -0
- package/dist/components/input-group/index.js +29 -0
- package/dist/components/json-form-builder/index.d.ts +135 -0
- package/dist/components/json-form-builder/index.js +347 -0
- package/dist/components/kbd/index.d.ts +11 -0
- package/dist/components/kbd/index.js +9 -0
- package/dist/components/link/index.d.ts +11 -0
- package/dist/components/link/index.js +9 -0
- package/dist/components/listbox/index.d.ts +2 -0
- package/dist/components/listbox/index.js +3 -0
- package/dist/components/loader/index.d.ts +28 -0
- package/dist/components/loader/index.js +28 -0
- package/dist/components/locale/index.d.ts +2 -0
- package/dist/components/locale/index.js +3 -0
- package/dist/components/logo/index.d.ts +8 -0
- package/dist/components/logo/index.js +25 -0
- package/dist/components/mark/index.d.ts +11 -0
- package/dist/components/mark/index.js +9 -0
- package/dist/components/menu/index.d.ts +34 -0
- package/dist/components/menu/index.js +69 -0
- package/dist/components/number-input/index.d.ts +34 -0
- package/dist/components/number-input/index.js +51 -0
- package/dist/components/page-header/index.d.ts +18 -0
- package/dist/components/page-header/index.js +22 -0
- package/dist/components/pagination/index.d.ts +29 -0
- package/dist/components/pagination/index.js +45 -0
- package/dist/components/picker/index.d.ts +19 -0
- package/dist/components/picker/index.js +57 -0
- package/dist/components/popover/index.d.ts +30 -0
- package/dist/components/popover/index.js +50 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +3 -0
- package/dist/components/progress/index.d.ts +19 -0
- package/dist/components/progress/index.js +47 -0
- package/dist/components/progress-circle/index.d.ts +19 -0
- package/dist/components/progress-circle/index.js +54 -0
- package/dist/components/radio-card-group/index.d.ts +21 -0
- package/dist/components/radio-card-group/index.js +29 -0
- package/dist/components/radio-group/index.d.ts +22 -0
- package/dist/components/radio-group/index.js +41 -0
- package/dist/components/scroll-area/index.d.ts +23 -0
- package/dist/components/scroll-area/index.js +41 -0
- package/dist/components/segment-group/index.d.ts +32 -0
- package/dist/components/segment-group/index.js +46 -0
- package/dist/components/select/index.d.ts +54 -0
- package/dist/components/select/index.js +93 -0
- package/dist/components/show/index.d.ts +11 -0
- package/dist/components/show/index.js +3 -0
- package/dist/components/skeleton/index.d.ts +23 -0
- package/dist/components/skeleton/index.js +17 -0
- package/dist/components/slider/index.d.ts +31 -0
- package/dist/components/slider/index.js +93 -0
- package/dist/components/span/index.d.ts +8 -0
- package/dist/components/span/index.js +3 -0
- package/dist/components/spinner/index.d.ts +11 -0
- package/dist/components/spinner/index.js +9 -0
- package/dist/components/spotlight/index.d.ts +28 -0
- package/dist/components/spotlight/index.js +165 -0
- package/dist/components/stat/index.d.ts +16 -0
- package/dist/components/stat/index.js +18 -0
- package/dist/components/steps/index.d.ts +36 -0
- package/dist/components/steps/index.js +61 -0
- package/dist/components/switch/index.d.ts +41 -0
- package/dist/components/switch/index.js +80 -0
- package/dist/components/table/index.d.ts +85 -0
- package/dist/components/table/index.js +144 -0
- package/dist/components/tabs/index.d.ts +18 -0
- package/dist/components/tabs/index.js +22 -0
- package/dist/components/tags-input/index.d.ts +29 -0
- package/dist/components/tags-input/index.js +48 -0
- package/dist/components/text/index.d.ts +12 -0
- package/dist/components/text/index.js +8 -0
- package/dist/components/textarea/index.d.ts +24 -0
- package/dist/components/textarea/index.js +22 -0
- package/dist/components/toast/index.d.ts +25 -0
- package/dist/components/toast/index.js +76 -0
- package/dist/components/toggle-group/index.d.ts +16 -0
- package/dist/components/toggle-group/index.js +19 -0
- package/dist/components/tooltip/index.d.ts +26 -0
- package/dist/components/tooltip/index.js +50 -0
- package/dist/components/tree-view/index.d.ts +37 -0
- package/dist/components/tree-view/index.js +63 -0
- package/dist/components/wrap/index.d.ts +15 -0
- package/dist/components/wrap/index.js +5 -0
- package/dist/display-date-value-CdfgVuB7.d.ts +15 -0
- package/dist/display-date-value-gTlidtNz.js +21 -0
- package/dist/display-value-BNKxQ99u.js +37 -0
- package/dist/display-value-IyQT1429.d.ts +11 -0
- package/dist/featured-icon-DPysOpSf.js +35 -0
- package/dist/function-DOGwA2sm.js +7 -0
- package/dist/show-IaI-36v9.js +12 -0
- package/dist/span-DWZSA3mH.js +7 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.js +0 -0
- package/dist/utils/index.d.ts +206 -0
- package/dist/utils/index.js +377 -0
- package/package.json +89 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { forwardRef, useId, useSyncExternalStore } from "react";
|
|
3
|
+
import { ark } from "@ark-ui/react/factory";
|
|
4
|
+
import { Stack, createStyleContext } from "@pyck/styled-system/jsx";
|
|
5
|
+
import { dialog } from "@pyck/styled-system/recipes";
|
|
6
|
+
import { CheckCircleIcon, FilePenLineIcon, Trash2Icon } from "lucide-react";
|
|
7
|
+
import { omit } from "@pyck/react/utils";
|
|
8
|
+
import { useForm } from "react-hook-form";
|
|
9
|
+
import { Show } from "@pyck/react/show";
|
|
10
|
+
import { Portal } from "@ark-ui/react/portal";
|
|
11
|
+
import { Button, CloseButton } from "@pyck/react/button";
|
|
12
|
+
import { FeaturedIcon } from "@pyck/react/icon";
|
|
13
|
+
import { shallow } from "zustand/shallow";
|
|
14
|
+
import { Dialog, DialogContext as Context, useDialogContext } from "@ark-ui/react/dialog";
|
|
15
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
16
|
+
import { Form } from "@pyck/react/form";
|
|
17
|
+
|
|
18
|
+
//#region src/components/dialog/create-overlay.tsx
|
|
19
|
+
function createOverlay(Component, options) {
|
|
20
|
+
const map = /* @__PURE__ */ new Map();
|
|
21
|
+
const exitPromises = /* @__PURE__ */ new Map();
|
|
22
|
+
const exitResolvers = /* @__PURE__ */ new Map();
|
|
23
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
24
|
+
const subscribe = (callback) => {
|
|
25
|
+
subscribers.add(callback);
|
|
26
|
+
return () => subscribers.delete(callback);
|
|
27
|
+
};
|
|
28
|
+
const publish = () => {
|
|
29
|
+
for (const callback of subscribers) callback(getSnapshot());
|
|
30
|
+
};
|
|
31
|
+
let lastSnapshot = [];
|
|
32
|
+
const getSnapshot = () => {
|
|
33
|
+
const nextSnapshot = Array.from(map.values());
|
|
34
|
+
if (shallow(lastSnapshot, nextSnapshot)) return lastSnapshot;
|
|
35
|
+
lastSnapshot = nextSnapshot;
|
|
36
|
+
return lastSnapshot;
|
|
37
|
+
};
|
|
38
|
+
const waitForExit = (id) => {
|
|
39
|
+
return exitPromises.get(id) || Promise.resolve();
|
|
40
|
+
};
|
|
41
|
+
const open = (id, props) => {
|
|
42
|
+
return new Promise((resolve) => {
|
|
43
|
+
const overlayProps = {
|
|
44
|
+
...options?.props,
|
|
45
|
+
...props,
|
|
46
|
+
_id: id,
|
|
47
|
+
open: true,
|
|
48
|
+
onOpenChange: (e) => {
|
|
49
|
+
if (!e.open) close(id);
|
|
50
|
+
},
|
|
51
|
+
onExitComplete: () => {
|
|
52
|
+
const resolver = exitResolvers.get(id);
|
|
53
|
+
if (resolver) {
|
|
54
|
+
resolver();
|
|
55
|
+
exitResolvers.delete(id);
|
|
56
|
+
}
|
|
57
|
+
remove(id);
|
|
58
|
+
},
|
|
59
|
+
setReturnValue: resolve,
|
|
60
|
+
setExitComplete: void 0
|
|
61
|
+
};
|
|
62
|
+
map.set(id, overlayProps);
|
|
63
|
+
publish();
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const close = (id, value) => {
|
|
67
|
+
const prevProps = get(id);
|
|
68
|
+
if (!prevProps) return Promise.resolve();
|
|
69
|
+
const castedProps = prevProps;
|
|
70
|
+
if (castedProps.setReturnValue) castedProps.setReturnValue(value);
|
|
71
|
+
map.set(id, {
|
|
72
|
+
...castedProps,
|
|
73
|
+
open: false
|
|
74
|
+
});
|
|
75
|
+
publish();
|
|
76
|
+
const exitPromise = new Promise((resolve) => {
|
|
77
|
+
exitResolvers.set(id, resolve);
|
|
78
|
+
});
|
|
79
|
+
exitPromises.set(id, exitPromise);
|
|
80
|
+
return exitPromise;
|
|
81
|
+
};
|
|
82
|
+
const remove = (id) => {
|
|
83
|
+
const resolver = exitResolvers.get(id);
|
|
84
|
+
if (resolver) {
|
|
85
|
+
resolver();
|
|
86
|
+
exitResolvers.delete(id);
|
|
87
|
+
}
|
|
88
|
+
map.delete(id);
|
|
89
|
+
exitPromises.delete(id);
|
|
90
|
+
publish();
|
|
91
|
+
};
|
|
92
|
+
const update = (id, props) => {
|
|
93
|
+
const prevProps = get(id);
|
|
94
|
+
if (!prevProps) {
|
|
95
|
+
console.warn(`[@pyck/react] Cannot update overlay with id ${id} - not found`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
map.set(id, {
|
|
99
|
+
...prevProps,
|
|
100
|
+
...omit(props, [
|
|
101
|
+
"open",
|
|
102
|
+
"onOpenChange",
|
|
103
|
+
"onExitComplete"
|
|
104
|
+
])
|
|
105
|
+
});
|
|
106
|
+
publish();
|
|
107
|
+
};
|
|
108
|
+
const get = (id) => {
|
|
109
|
+
return map.get(id);
|
|
110
|
+
};
|
|
111
|
+
const removeAll = () => {
|
|
112
|
+
for (const resolver of exitResolvers.values()) resolver();
|
|
113
|
+
map.clear();
|
|
114
|
+
exitPromises.clear();
|
|
115
|
+
exitResolvers.clear();
|
|
116
|
+
publish();
|
|
117
|
+
};
|
|
118
|
+
function Viewport() {
|
|
119
|
+
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
|
+
</>;
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
Viewport,
|
|
130
|
+
open,
|
|
131
|
+
close,
|
|
132
|
+
update,
|
|
133
|
+
remove,
|
|
134
|
+
removeAll,
|
|
135
|
+
get,
|
|
136
|
+
getSnapshot,
|
|
137
|
+
waitForExit
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/components/dialog/dialog.tsx
|
|
143
|
+
var dialog_exports = /* @__PURE__ */ __exportAll({
|
|
144
|
+
ActionTrigger: () => ActionTrigger,
|
|
145
|
+
Backdrop: () => Backdrop,
|
|
146
|
+
Body: () => Body,
|
|
147
|
+
CloseTrigger: () => CloseTrigger,
|
|
148
|
+
Content: () => Content,
|
|
149
|
+
Context: () => Context,
|
|
150
|
+
Description: () => Description,
|
|
151
|
+
Footer: () => Footer,
|
|
152
|
+
Header: () => Header,
|
|
153
|
+
Positioner: () => Positioner,
|
|
154
|
+
Root: () => Root,
|
|
155
|
+
RootProvider: () => RootProvider,
|
|
156
|
+
Title: () => Title,
|
|
157
|
+
Trigger: () => Trigger
|
|
158
|
+
});
|
|
159
|
+
const { withRootProvider, withContext } = createStyleContext(dialog);
|
|
160
|
+
const Root = withRootProvider(Dialog.Root, { defaultProps: {
|
|
161
|
+
unmountOnExit: true,
|
|
162
|
+
lazyMount: true
|
|
163
|
+
} });
|
|
164
|
+
const RootProvider = withRootProvider(Dialog.RootProvider, { defaultProps: {
|
|
165
|
+
unmountOnExit: true,
|
|
166
|
+
lazyMount: true
|
|
167
|
+
} });
|
|
168
|
+
const Backdrop = withContext(Dialog.Backdrop, "backdrop");
|
|
169
|
+
const CloseTrigger = withContext(Dialog.CloseTrigger, "closeTrigger");
|
|
170
|
+
const Content = withContext(Dialog.Content, "content");
|
|
171
|
+
const Description = withContext(Dialog.Description, "description");
|
|
172
|
+
const Positioner = withContext(Dialog.Positioner, "positioner");
|
|
173
|
+
const Title = withContext(Dialog.Title, "title");
|
|
174
|
+
const Trigger = withContext(Dialog.Trigger, "trigger");
|
|
175
|
+
const Body = withContext(ark.div, "body");
|
|
176
|
+
const Header = withContext(ark.div, "header");
|
|
177
|
+
const Footer = withContext(ark.div, "footer");
|
|
178
|
+
const ActionTrigger = forwardRef(function ActionTrigger(props, ref) {
|
|
179
|
+
const dialog = useDialogContext();
|
|
180
|
+
return <ark.button {...props} ref={ref} onClick={() => dialog.setOpen(false)} />;
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/components/dialog/confirm-dialog.tsx
|
|
185
|
+
const ConfirmDialog = createOverlay((props) => {
|
|
186
|
+
const { title, description, onConfirm, intent = "default", ...rest } = props;
|
|
187
|
+
return <dialog_exports.Root size="sm" {...rest}>
|
|
188
|
+
<Portal>
|
|
189
|
+
<dialog_exports.Backdrop />
|
|
190
|
+
<dialog_exports.Positioner>
|
|
191
|
+
<dialog_exports.Content backgroundImage={{
|
|
192
|
+
_light: "url(/public/images/pattern-light.svg)",
|
|
193
|
+
_dark: "url(/public/images/pattern-dark.svg)"
|
|
194
|
+
}} backgroundPosition="center" backgroundRepeat="no-repeat" backgroundPositionX="-25" backgroundPositionY="-73">
|
|
195
|
+
<dialog_exports.Header pb="0">
|
|
196
|
+
<Stack gap="4">
|
|
197
|
+
<Show when={intent === "destructive"} fallback={<FeaturedIcon variant="embedded">
|
|
198
|
+
<CheckCircleIcon />
|
|
199
|
+
</FeaturedIcon>}>
|
|
200
|
+
<FeaturedIcon variant="embedded">
|
|
201
|
+
<Trash2Icon />
|
|
202
|
+
</FeaturedIcon>
|
|
203
|
+
</Show>
|
|
204
|
+
<Stack gap="0.5">
|
|
205
|
+
<dialog_exports.Title>{title}</dialog_exports.Title>
|
|
206
|
+
{description && <dialog_exports.Description>{description}</dialog_exports.Description>}
|
|
207
|
+
</Stack>
|
|
208
|
+
</Stack>
|
|
209
|
+
</dialog_exports.Header>
|
|
210
|
+
<dialog_exports.Footer>
|
|
211
|
+
<dialog_exports.ActionTrigger asChild>
|
|
212
|
+
<Button variant="outline" flex="1">
|
|
213
|
+
Cancel
|
|
214
|
+
</Button>
|
|
215
|
+
</dialog_exports.ActionTrigger>
|
|
216
|
+
<dialog_exports.ActionTrigger asChild>
|
|
217
|
+
<Button onClick={onConfirm} flex="1" colorPalette={intent === "destructive" ? "red" : "teal"}>
|
|
218
|
+
{intent === "destructive" ? "Delete" : "Confirm"}
|
|
219
|
+
</Button>
|
|
220
|
+
</dialog_exports.ActionTrigger>
|
|
221
|
+
</dialog_exports.Footer>
|
|
222
|
+
<dialog_exports.CloseTrigger asChild>
|
|
223
|
+
<CloseButton />
|
|
224
|
+
</dialog_exports.CloseTrigger>
|
|
225
|
+
</dialog_exports.Content>
|
|
226
|
+
</dialog_exports.Positioner>
|
|
227
|
+
</Portal>
|
|
228
|
+
</dialog_exports.Root>;
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/components/dialog/form-dialog.tsx
|
|
233
|
+
const FormDialogBase = createOverlay((props) => {
|
|
234
|
+
const { content, defaultValues, description, onSubmit, schema, title, icon = <FilePenLineIcon />, submitLabel = "Submit", ...rest } = props;
|
|
235
|
+
const form = useForm({
|
|
236
|
+
resolver: zodResolver(schema),
|
|
237
|
+
defaultValues
|
|
238
|
+
});
|
|
239
|
+
const id = useId();
|
|
240
|
+
return <dialog_exports.Root size="sm" {...rest}>
|
|
241
|
+
<Portal>
|
|
242
|
+
<dialog_exports.Backdrop />
|
|
243
|
+
<dialog_exports.Positioner>
|
|
244
|
+
<dialog_exports.Content backgroundImage={{
|
|
245
|
+
_light: "url(/public/images/pattern-light.svg)",
|
|
246
|
+
_dark: "url(/public/images/pattern-dark.svg)"
|
|
247
|
+
}} backgroundPosition="center" backgroundRepeat="no-repeat" backgroundPositionX="-25" backgroundPositionY="-73">
|
|
248
|
+
<dialog_exports.Header>
|
|
249
|
+
<Stack gap="4">
|
|
250
|
+
<FeaturedIcon variant="embedded">{icon}</FeaturedIcon>
|
|
251
|
+
<Stack gap="0.5">
|
|
252
|
+
<dialog_exports.Title>{title}</dialog_exports.Title>
|
|
253
|
+
{description && <dialog_exports.Description>{description}</dialog_exports.Description>}
|
|
254
|
+
</Stack>
|
|
255
|
+
</Stack>
|
|
256
|
+
</dialog_exports.Header>
|
|
257
|
+
<dialog_exports.Body>
|
|
258
|
+
<Form id={id} value={form} onSubmit={form.handleSubmit(onSubmit)}>
|
|
259
|
+
{content}
|
|
260
|
+
</Form>
|
|
261
|
+
</dialog_exports.Body>
|
|
262
|
+
<dialog_exports.Footer>
|
|
263
|
+
<dialog_exports.ActionTrigger asChild>
|
|
264
|
+
<Button variant="outline" flex="1">
|
|
265
|
+
Cancel
|
|
266
|
+
</Button>
|
|
267
|
+
</dialog_exports.ActionTrigger>
|
|
268
|
+
<Button form={id} type="submit" loading={form.formState.isSubmitting} colorPalette="teal" flex="1">
|
|
269
|
+
{submitLabel}
|
|
270
|
+
</Button>
|
|
271
|
+
</dialog_exports.Footer>
|
|
272
|
+
<dialog_exports.CloseTrigger asChild>
|
|
273
|
+
<CloseButton />
|
|
274
|
+
</dialog_exports.CloseTrigger>
|
|
275
|
+
</dialog_exports.Content>
|
|
276
|
+
</dialog_exports.Positioner>
|
|
277
|
+
</Portal>
|
|
278
|
+
</dialog_exports.Root>;
|
|
279
|
+
});
|
|
280
|
+
const FormDialog = {
|
|
281
|
+
...FormDialogBase,
|
|
282
|
+
open: (id, props) => FormDialogBase.open(id, props)
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/components/dialog/overlay-manager.tsx
|
|
287
|
+
const OverlayManager = () => {
|
|
288
|
+
return <>
|
|
289
|
+
<FormDialog.Viewport />
|
|
290
|
+
<ConfirmDialog.Viewport />
|
|
291
|
+
</>;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
//#endregion
|
|
295
|
+
export { ConfirmDialog, dialog_exports as Dialog, FormDialog, OverlayManager };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as _pyck_styled_system_jsx0 from "@pyck/styled-system/jsx";
|
|
4
|
+
import * as _pyck_styled_system_recipes0 from "@pyck/styled-system/recipes";
|
|
5
|
+
import { Dialog, DialogContext as Context } from "@ark-ui/react/dialog";
|
|
6
|
+
import * as _ark_ui_react0 from "@ark-ui/react";
|
|
7
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/components/drawer/drawer.d.ts
|
|
10
|
+
declare namespace drawer_d_exports {
|
|
11
|
+
export { ActionTrigger, Backdrop, Body, CloseTrigger, Content, Context, Description, Footer, Header, Positioner, Root, RootProps, RootProvider, Title, Trigger };
|
|
12
|
+
}
|
|
13
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
14
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextRootProvider<(props: Dialog.RootProps) => react_jsx_runtime0.JSX.Element, _pyck_styled_system_recipes0.DrawerRecipe>;
|
|
15
|
+
declare const RootProvider: _pyck_styled_system_jsx0.StyleContextRootProvider<(props: Dialog.RootProps) => react_jsx_runtime0.JSX.Element, _pyck_styled_system_recipes0.DrawerRecipe>;
|
|
16
|
+
declare const Backdrop: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Dialog.BackdropProps & react.RefAttributes<HTMLDivElement>>>;
|
|
17
|
+
declare const Positioner: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Dialog.PositionerProps & react.RefAttributes<HTMLDivElement>>>;
|
|
18
|
+
declare const CloseTrigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Dialog.CloseTriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
19
|
+
declare const Content: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Dialog.ContentProps & react.RefAttributes<HTMLDivElement>>>;
|
|
20
|
+
declare const Description: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Dialog.DescriptionProps & react.RefAttributes<HTMLDivElement>>>;
|
|
21
|
+
declare const Title: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Dialog.TitleProps & react.RefAttributes<HTMLHeadingElement>>>;
|
|
22
|
+
declare const Trigger: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Dialog.TriggerProps & react.RefAttributes<HTMLButtonElement>>>;
|
|
23
|
+
declare const Body: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
24
|
+
declare const Header: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
25
|
+
declare const Footer: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
26
|
+
declare const ActionTrigger: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & _ark_ui_react0.PolymorphicProps & react.RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { drawer_d_exports as Drawer, type RootProps as DrawerRootProps };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { ark } from "@ark-ui/react/factory";
|
|
4
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
5
|
+
import { drawer } from "@pyck/styled-system/recipes";
|
|
6
|
+
import { Dialog, DialogContext as Context, useDialogContext } from "@ark-ui/react/dialog";
|
|
7
|
+
|
|
8
|
+
//#region src/components/drawer/drawer.tsx
|
|
9
|
+
var drawer_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
ActionTrigger: () => ActionTrigger,
|
|
11
|
+
Backdrop: () => Backdrop,
|
|
12
|
+
Body: () => Body,
|
|
13
|
+
CloseTrigger: () => CloseTrigger,
|
|
14
|
+
Content: () => Content,
|
|
15
|
+
Context: () => Context,
|
|
16
|
+
Description: () => Description,
|
|
17
|
+
Footer: () => Footer,
|
|
18
|
+
Header: () => Header,
|
|
19
|
+
Positioner: () => Positioner,
|
|
20
|
+
Root: () => Root,
|
|
21
|
+
RootProvider: () => RootProvider,
|
|
22
|
+
Title: () => Title,
|
|
23
|
+
Trigger: () => Trigger
|
|
24
|
+
});
|
|
25
|
+
const { withRootProvider, withContext } = createStyleContext(drawer);
|
|
26
|
+
const Root = withRootProvider(Dialog.Root, { defaultProps: {
|
|
27
|
+
unmountOnExit: true,
|
|
28
|
+
lazyMount: true
|
|
29
|
+
} });
|
|
30
|
+
const RootProvider = withRootProvider(Dialog.Root, { defaultProps: {
|
|
31
|
+
unmountOnExit: true,
|
|
32
|
+
lazyMount: true
|
|
33
|
+
} });
|
|
34
|
+
const Backdrop = withContext(Dialog.Backdrop, "backdrop");
|
|
35
|
+
const Positioner = withContext(Dialog.Positioner, "positioner");
|
|
36
|
+
const CloseTrigger = withContext(Dialog.CloseTrigger, "closeTrigger");
|
|
37
|
+
const Content = withContext(Dialog.Content, "content");
|
|
38
|
+
const Description = withContext(Dialog.Description, "description");
|
|
39
|
+
const Title = withContext(Dialog.Title, "title");
|
|
40
|
+
const Trigger = withContext(Dialog.Trigger, "trigger");
|
|
41
|
+
const Body = withContext(ark.div, "body");
|
|
42
|
+
const Header = withContext(ark.div, "header");
|
|
43
|
+
const Footer = withContext(ark.div, "footer");
|
|
44
|
+
const ActionTrigger = forwardRef(function ActionTrigger(props, ref) {
|
|
45
|
+
const dialog = useDialogContext();
|
|
46
|
+
return <ark.button {...props} ref={ref} onClick={() => dialog.setOpen(false)} />;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { drawer_exports as Drawer };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TreeCollection } from "@ark-ui/react/collection";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/drilldown-menu/drilldown-menu.closed.d.ts
|
|
5
|
+
interface DrilldownMenuProps<T> {
|
|
6
|
+
collection: TreeCollection<T>;
|
|
7
|
+
renderItem?: (node: T) => React.ReactNode;
|
|
8
|
+
onLeafSelect?: (node: T) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const DrilldownMenu: <T>({
|
|
11
|
+
collection,
|
|
12
|
+
renderItem,
|
|
13
|
+
onLeafSelect
|
|
14
|
+
}: DrilldownMenuProps<T>) => react_jsx_runtime0.JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DrilldownMenu, type DrilldownMenuProps };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { n as Icon } from "../../featured-icon-DPysOpSf.js";
|
|
3
|
+
import "../icon/index.js";
|
|
4
|
+
import { t as Span } from "../../span-DWZSA3mH.js";
|
|
5
|
+
import "../span/index.js";
|
|
6
|
+
import { startTransition, useState } from "react";
|
|
7
|
+
import { ark } from "@ark-ui/react/factory";
|
|
8
|
+
import { Box, HStack, Stack, createStyleContext } from "@pyck/styled-system/jsx";
|
|
9
|
+
import { drilldownMenu } from "@pyck/styled-system/recipes";
|
|
10
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
11
|
+
import { Group } from "@pyck/react/group";
|
|
12
|
+
import { Show } from "@pyck/react/show";
|
|
13
|
+
|
|
14
|
+
//#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
|
+
const { withProvider, withContext } = createStyleContext(drilldownMenu);
|
|
24
|
+
const Root = withProvider(ark.div, "root");
|
|
25
|
+
const Viewport = withContext(ark.div, "viewport");
|
|
26
|
+
const Content = withContext(ark.div, "content");
|
|
27
|
+
const List = withContext(ark.ul, "list");
|
|
28
|
+
const Item = withContext(ark.li, "item");
|
|
29
|
+
const Trigger = withContext(ark.button, "trigger");
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/drilldown-menu/use-drilldown-menu.ts
|
|
33
|
+
const useDrilldownMenu = ({ collection }) => {
|
|
34
|
+
const [currentValue, setCurrentValue] = useState(null);
|
|
35
|
+
const [direction, setDirection] = useState("forward");
|
|
36
|
+
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");
|
|
42
|
+
setIsAnimating(true);
|
|
43
|
+
startTransition(() => {
|
|
44
|
+
setCurrentValue(collection.getNodeValue(node));
|
|
45
|
+
});
|
|
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
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
//#endregion
|
|
71
|
+
//#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>;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
export { DrilldownMenu };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import * as _pyck_styled_system_jsx0 from "@pyck/styled-system/jsx";
|
|
4
|
+
import * as _pyck_styled_system_recipes0 from "@pyck/styled-system/recipes";
|
|
5
|
+
import { Field as Field$1 } from "@ark-ui/react/field";
|
|
6
|
+
|
|
7
|
+
//#region src/components/field/field.d.ts
|
|
8
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
9
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<Field$1.RootProps & react.RefAttributes<HTMLDivElement>>, _pyck_styled_system_recipes0.FieldRecipe>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/field/field.closed.d.ts
|
|
12
|
+
interface FieldProps extends Omit<RootProps, 'label'> {
|
|
13
|
+
label?: ReactNode;
|
|
14
|
+
helperText?: ReactNode;
|
|
15
|
+
errorText?: ReactNode;
|
|
16
|
+
optionalText?: ReactNode;
|
|
17
|
+
hideLabel?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare const Field: react.ForwardRefExoticComponent<Omit<FieldProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Field, type FieldProps };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { VisuallyHidden, createStyleContext } from "@pyck/styled-system/jsx";
|
|
4
|
+
import { field } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { Show } from "@pyck/react/show";
|
|
6
|
+
import { Wrap } from "@pyck/react/wrap";
|
|
7
|
+
import { Field as Field$1, FieldContext as Context } from "@ark-ui/react/field";
|
|
8
|
+
|
|
9
|
+
//#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
|
+
const { withProvider, withContext } = createStyleContext(field);
|
|
20
|
+
const Root = withProvider(Field$1.Root, "root");
|
|
21
|
+
const RootProvider = withProvider(Field$1.RootProvider, "root");
|
|
22
|
+
const ErrorText = withContext(Field$1.ErrorText, "errorText");
|
|
23
|
+
const HelperText = withContext(Field$1.HelperText, "helperText");
|
|
24
|
+
const Label = withContext(Field$1.Label, "label");
|
|
25
|
+
const RequiredIndicator = withContext(Field$1.RequiredIndicator, "requiredIndicator");
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/field/field.closed.tsx
|
|
29
|
+
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>;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { Field };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as _pyck_styled_system_jsx0 from "@pyck/styled-system/jsx";
|
|
4
|
+
import * as _pyck_styled_system_recipes0 from "@pyck/styled-system/recipes";
|
|
5
|
+
import { Fieldset, FieldsetContext as Context } from "@ark-ui/react/fieldset";
|
|
6
|
+
import * as _ark_ui_react0 from "@ark-ui/react";
|
|
7
|
+
|
|
8
|
+
//#region src/components/fieldset/fieldset.d.ts
|
|
9
|
+
declare namespace fieldset_d_exports {
|
|
10
|
+
export { Body, Context, Description, ErrorText, Footer, Header, HelperText, Legend, Root, RootProps, RootProvider };
|
|
11
|
+
}
|
|
12
|
+
type RootProps = ComponentProps<typeof Root>;
|
|
13
|
+
declare const Root: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<Fieldset.RootProps & react.RefAttributes<HTMLFieldSetElement>>, _pyck_styled_system_recipes0.FieldsetRecipe>;
|
|
14
|
+
declare const RootProvider: _pyck_styled_system_jsx0.StyleContextProvider<react.ForwardRefExoticComponent<Fieldset.RootProviderProps & react.RefAttributes<HTMLFieldSetElement>>, _pyck_styled_system_recipes0.FieldsetRecipe>;
|
|
15
|
+
declare const Legend: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Fieldset.LegendProps & react.RefAttributes<HTMLLegendElement>>>;
|
|
16
|
+
declare const HelperText: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Fieldset.HelperTextProps & react.RefAttributes<HTMLSpanElement>>>;
|
|
17
|
+
declare const ErrorText: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<Fieldset.ErrorTextProps & react.RefAttributes<HTMLSpanElement>>>;
|
|
18
|
+
declare const Header: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
19
|
+
declare const Body: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
20
|
+
declare const Footer: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
21
|
+
declare const Description: _pyck_styled_system_jsx0.StyleContextConsumer<react.ForwardRefExoticComponent<react.ClassAttributes<HTMLParagraphElement> & react.HTMLAttributes<HTMLParagraphElement> & _ark_ui_react0.PolymorphicProps>>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { fieldset_d_exports as Fieldset };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { ark } from "@ark-ui/react/factory";
|
|
3
|
+
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
4
|
+
import { fieldset } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { Fieldset, FieldsetContext as Context } from "@ark-ui/react/fieldset";
|
|
6
|
+
|
|
7
|
+
//#region src/components/fieldset/fieldset.tsx
|
|
8
|
+
var fieldset_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Body: () => Body,
|
|
10
|
+
Context: () => Context,
|
|
11
|
+
Description: () => Description,
|
|
12
|
+
ErrorText: () => ErrorText,
|
|
13
|
+
Footer: () => Footer,
|
|
14
|
+
Header: () => Header,
|
|
15
|
+
HelperText: () => HelperText,
|
|
16
|
+
Legend: () => Legend,
|
|
17
|
+
Root: () => Root,
|
|
18
|
+
RootProvider: () => RootProvider
|
|
19
|
+
});
|
|
20
|
+
const { withProvider, withContext } = createStyleContext(fieldset);
|
|
21
|
+
const Root = withProvider(Fieldset.Root, "root");
|
|
22
|
+
const RootProvider = withProvider(Fieldset.RootProvider, "root");
|
|
23
|
+
const Legend = withContext(Fieldset.Legend, "legend");
|
|
24
|
+
const HelperText = withContext(Fieldset.HelperText, "helperText");
|
|
25
|
+
const ErrorText = withContext(Fieldset.ErrorText, "errorText");
|
|
26
|
+
const Header = withContext(ark.div, "header");
|
|
27
|
+
const Body = withContext(ark.div, "body");
|
|
28
|
+
const Footer = withContext(ark.div, "footer");
|
|
29
|
+
const Description = withContext(ark.p, "description");
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { fieldset_exports as Fieldset };
|