@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,11 +1,13 @@
|
|
|
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 {
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { useForm } from "react-hook-form";
|
|
10
|
+
import { omit } from "@pyck/react/utils";
|
|
9
11
|
import { Show } from "@pyck/react/show";
|
|
10
12
|
import { Portal } from "@ark-ui/react/portal";
|
|
11
13
|
import { Button, CloseButton } from "@pyck/react/button";
|
|
@@ -116,14 +118,25 @@ function createOverlay(Component, options) {
|
|
|
116
118
|
publish();
|
|
117
119
|
};
|
|
118
120
|
function Viewport() {
|
|
121
|
+
const $ = c(4);
|
|
119
122
|
const overlays = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
123
|
+
let t0;
|
|
124
|
+
if ($[0] !== overlays) {
|
|
125
|
+
t0 = overlays.map(_temp);
|
|
126
|
+
$[0] = overlays;
|
|
127
|
+
$[1] = t0;
|
|
128
|
+
} else t0 = $[1];
|
|
129
|
+
let t1;
|
|
130
|
+
if ($[2] !== t0) {
|
|
131
|
+
t1 = /* @__PURE__ */ jsx(Fragment$1, { children: t0 });
|
|
132
|
+
$[2] = t0;
|
|
133
|
+
$[3] = t1;
|
|
134
|
+
} else t1 = $[3];
|
|
135
|
+
return t1;
|
|
136
|
+
}
|
|
137
|
+
function _temp(props) {
|
|
138
|
+
const { _id, ...componentProps } = props;
|
|
139
|
+
return /* @__PURE__ */ jsx(Component, { ...componentProps }, _id);
|
|
127
140
|
}
|
|
128
141
|
return {
|
|
129
142
|
Viewport,
|
|
@@ -176,106 +189,151 @@ 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
|
-
|
|
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 = /* @__PURE__ */ jsx(ark.button, {
|
|
203
|
+
...props,
|
|
204
|
+
ref,
|
|
205
|
+
onClick: t0
|
|
206
|
+
});
|
|
207
|
+
$[2] = props;
|
|
208
|
+
$[3] = ref;
|
|
209
|
+
$[4] = t0;
|
|
210
|
+
$[5] = t1;
|
|
211
|
+
} else t1 = $[5];
|
|
212
|
+
return t1;
|
|
181
213
|
});
|
|
182
214
|
|
|
183
215
|
//#endregion
|
|
184
216
|
//#region src/components/dialog/confirm-dialog.tsx
|
|
185
217
|
const ConfirmDialog = createOverlay((props) => {
|
|
186
218
|
const { title, description, onConfirm, intent = "default", ...rest } = props;
|
|
187
|
-
return
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
219
|
+
return /* @__PURE__ */ jsx(Root, {
|
|
220
|
+
size: "sm",
|
|
221
|
+
...rest,
|
|
222
|
+
children: /* @__PURE__ */ jsxs(Portal, { children: [/* @__PURE__ */ jsx(Backdrop, {}), /* @__PURE__ */ jsx(Positioner, { children: /* @__PURE__ */ jsxs(Content, {
|
|
223
|
+
backgroundImage: {
|
|
224
|
+
_light: "url(/public/images/pattern-light.svg)",
|
|
225
|
+
_dark: "url(/public/images/pattern-dark.svg)"
|
|
226
|
+
},
|
|
227
|
+
backgroundPosition: "center",
|
|
228
|
+
backgroundRepeat: "no-repeat",
|
|
229
|
+
backgroundPositionX: "-25",
|
|
230
|
+
backgroundPositionY: "-73",
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ jsx(Header, {
|
|
233
|
+
pb: "0",
|
|
234
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
235
|
+
gap: "4",
|
|
236
|
+
children: [/* @__PURE__ */ jsx(Show, {
|
|
237
|
+
when: intent === "destructive",
|
|
238
|
+
fallback: /* @__PURE__ */ jsx(FeaturedIcon, {
|
|
239
|
+
variant: "embedded",
|
|
240
|
+
children: /* @__PURE__ */ jsx(CheckCircleIcon, {})
|
|
241
|
+
}),
|
|
242
|
+
children: /* @__PURE__ */ jsx(FeaturedIcon, {
|
|
243
|
+
variant: "embedded",
|
|
244
|
+
children: /* @__PURE__ */ jsx(Trash2Icon, {})
|
|
245
|
+
})
|
|
246
|
+
}), /* @__PURE__ */ jsxs(Stack, {
|
|
247
|
+
gap: "0.5",
|
|
248
|
+
children: [/* @__PURE__ */ jsx(Title, { children: title }), description && /* @__PURE__ */ jsx(Description, { children: description })]
|
|
249
|
+
})]
|
|
250
|
+
})
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ jsxs(Footer, { children: [/* @__PURE__ */ jsx(ActionTrigger, {
|
|
253
|
+
asChild: true,
|
|
254
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
255
|
+
variant: "outline",
|
|
256
|
+
flex: "1",
|
|
257
|
+
children: "Cancel"
|
|
258
|
+
})
|
|
259
|
+
}), /* @__PURE__ */ jsx(ActionTrigger, {
|
|
260
|
+
asChild: true,
|
|
261
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
262
|
+
onClick: onConfirm,
|
|
263
|
+
flex: "1",
|
|
264
|
+
colorPalette: intent === "destructive" ? "red" : "teal",
|
|
265
|
+
children: intent === "destructive" ? "Delete" : "Confirm"
|
|
266
|
+
})
|
|
267
|
+
})] }),
|
|
268
|
+
/* @__PURE__ */ jsx(CloseTrigger, {
|
|
269
|
+
asChild: true,
|
|
270
|
+
children: /* @__PURE__ */ jsx(CloseButton, {})
|
|
271
|
+
})
|
|
272
|
+
]
|
|
273
|
+
}) })] })
|
|
274
|
+
});
|
|
229
275
|
});
|
|
230
276
|
|
|
231
277
|
//#endregion
|
|
232
278
|
//#region src/components/dialog/form-dialog.tsx
|
|
233
279
|
const FormDialogBase = createOverlay((props) => {
|
|
234
|
-
const { content, defaultValues, description, onSubmit, schema, title, icon =
|
|
280
|
+
const { content, defaultValues, description, onSubmit, schema, title, icon = /* @__PURE__ */ jsx(FilePenLineIcon, {}), submitLabel = "Submit", ...rest } = props;
|
|
235
281
|
const form = useForm({
|
|
236
282
|
resolver: zodResolver(schema),
|
|
237
283
|
defaultValues
|
|
238
284
|
});
|
|
239
285
|
const id = useId();
|
|
240
|
-
return
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
286
|
+
return /* @__PURE__ */ jsx(Root, {
|
|
287
|
+
size: "sm",
|
|
288
|
+
...rest,
|
|
289
|
+
children: /* @__PURE__ */ jsxs(Portal, { children: [/* @__PURE__ */ jsx(Backdrop, {}), /* @__PURE__ */ jsx(Positioner, { children: /* @__PURE__ */ jsxs(Content, {
|
|
290
|
+
backgroundImage: {
|
|
291
|
+
_light: "url(/public/images/pattern-light.svg)",
|
|
292
|
+
_dark: "url(/public/images/pattern-dark.svg)"
|
|
293
|
+
},
|
|
294
|
+
backgroundPosition: "center",
|
|
295
|
+
backgroundRepeat: "no-repeat",
|
|
296
|
+
backgroundPositionX: "-25",
|
|
297
|
+
backgroundPositionY: "-73",
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ jsx(Header, { children: /* @__PURE__ */ jsxs(Stack, {
|
|
300
|
+
gap: "4",
|
|
301
|
+
children: [/* @__PURE__ */ jsx(FeaturedIcon, {
|
|
302
|
+
variant: "embedded",
|
|
303
|
+
children: icon
|
|
304
|
+
}), /* @__PURE__ */ jsxs(Stack, {
|
|
305
|
+
gap: "0.5",
|
|
306
|
+
children: [/* @__PURE__ */ jsx(Title, { children: title }), description && /* @__PURE__ */ jsx(Description, { children: description })]
|
|
307
|
+
})]
|
|
308
|
+
}) }),
|
|
309
|
+
/* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsx(Form, {
|
|
310
|
+
id,
|
|
311
|
+
value: form,
|
|
312
|
+
onSubmit: form.handleSubmit(onSubmit),
|
|
313
|
+
children: content
|
|
314
|
+
}) }),
|
|
315
|
+
/* @__PURE__ */ jsxs(Footer, { children: [/* @__PURE__ */ jsx(ActionTrigger, {
|
|
316
|
+
asChild: true,
|
|
317
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
318
|
+
variant: "outline",
|
|
319
|
+
flex: "1",
|
|
320
|
+
children: "Cancel"
|
|
321
|
+
})
|
|
322
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
323
|
+
form: id,
|
|
324
|
+
type: "submit",
|
|
325
|
+
loading: form.formState.isSubmitting,
|
|
326
|
+
colorPalette: "teal",
|
|
327
|
+
flex: "1",
|
|
328
|
+
children: submitLabel
|
|
329
|
+
})] }),
|
|
330
|
+
/* @__PURE__ */ jsx(CloseTrigger, {
|
|
331
|
+
asChild: true,
|
|
332
|
+
children: /* @__PURE__ */ jsx(CloseButton, {})
|
|
333
|
+
})
|
|
334
|
+
]
|
|
335
|
+
}) })] })
|
|
336
|
+
});
|
|
279
337
|
});
|
|
280
338
|
const FormDialog = {
|
|
281
339
|
...FormDialogBase,
|
|
@@ -285,10 +343,13 @@ const FormDialog = {
|
|
|
285
343
|
//#endregion
|
|
286
344
|
//#region src/components/dialog/overlay-manager.tsx
|
|
287
345
|
const OverlayManager = () => {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
346
|
+
const $ = c(1);
|
|
347
|
+
let t0;
|
|
348
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
349
|
+
t0 = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FormDialog.Viewport, {}), /* @__PURE__ */ jsx(ConfirmDialog.Viewport, {})] });
|
|
350
|
+
$[0] = t0;
|
|
351
|
+
} else t0 = $[0];
|
|
352
|
+
return t0;
|
|
292
353
|
};
|
|
293
354
|
|
|
294
355
|
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as DisplayDateValue, r as DisplayDateValueProps, t as DateFormatType } from "../../display-date-value-
|
|
1
|
+
import { n as DisplayDateValue, r as DisplayDateValueProps, t as DateFormatType } from "../../display-date-value-RbzRgYHt.js";
|
|
2
2
|
import { DateInput } from "@pyck/react/utils";
|
|
3
3
|
export { type DateFormatType, type DateInput, DisplayDateValue, type DisplayDateValueProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../display-value-
|
|
2
|
-
import { t as DisplayDateValue } from "../../display-date-value-
|
|
1
|
+
import "../../display-value-R2nHrGQo.js";
|
|
2
|
+
import { t as DisplayDateValue } from "../../display-date-value-CSPbdE60.js";
|
|
3
3
|
|
|
4
4
|
export { DisplayDateValue };
|
|
@@ -2,9 +2,9 @@ import * as react from "react";
|
|
|
2
2
|
import { ComponentProps } 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 * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
6
|
import { Dialog, DialogContext as Context } from "@ark-ui/react/dialog";
|
|
6
7
|
import * as _ark_ui_react0 from "@ark-ui/react";
|
|
7
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
//#region src/components/drawer/drawer.d.ts
|
|
10
10
|
declare namespace drawer_d_exports {
|
|
@@ -1,8 +1,10 @@
|
|
|
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";
|
|
5
6
|
import { drawer } from "@pyck/styled-system/recipes";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
8
|
import { Dialog, DialogContext as Context, useDialogContext } from "@ark-ui/react/dialog";
|
|
7
9
|
|
|
8
10
|
//#region src/components/drawer/drawer.tsx
|
|
@@ -42,8 +44,27 @@ const Body = withContext(ark.div, "body");
|
|
|
42
44
|
const Header = withContext(ark.div, "header");
|
|
43
45
|
const Footer = withContext(ark.div, "footer");
|
|
44
46
|
const ActionTrigger = forwardRef(function ActionTrigger(props, ref) {
|
|
47
|
+
const $ = c(6);
|
|
45
48
|
const dialog = useDialogContext();
|
|
46
|
-
|
|
49
|
+
let t0;
|
|
50
|
+
if ($[0] !== dialog) {
|
|
51
|
+
t0 = () => dialog.setOpen(false);
|
|
52
|
+
$[0] = dialog;
|
|
53
|
+
$[1] = t0;
|
|
54
|
+
} else t0 = $[1];
|
|
55
|
+
let t1;
|
|
56
|
+
if ($[2] !== props || $[3] !== ref || $[4] !== t0) {
|
|
57
|
+
t1 = /* @__PURE__ */ jsx(ark.button, {
|
|
58
|
+
...props,
|
|
59
|
+
ref,
|
|
60
|
+
onClick: t0
|
|
61
|
+
});
|
|
62
|
+
$[2] = props;
|
|
63
|
+
$[3] = ref;
|
|
64
|
+
$[4] = t0;
|
|
65
|
+
$[5] = t1;
|
|
66
|
+
} else t1 = $[5];
|
|
67
|
+
return t1;
|
|
47
68
|
});
|
|
48
69
|
|
|
49
70
|
//#endregion
|