@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.
Files changed (88) hide show
  1. package/dist/checkmark-rF75Pk98.js +75 -0
  2. package/dist/close-button-DAgpEZYq.js +172 -0
  3. package/dist/components/avatar/index.js +118 -20
  4. package/dist/components/button/index.js +1 -1
  5. package/dist/components/carousel/index.js +52 -12
  6. package/dist/components/checkbox/index.d.ts +1 -1
  7. package/dist/components/checkbox/index.js +151 -34
  8. package/dist/components/checkmark/index.js +1 -1
  9. package/dist/components/clipboard/index.js +3 -2
  10. package/dist/components/combobox/index.js +46 -9
  11. package/dist/components/data-list/index.d.ts +3 -2
  12. package/dist/components/data-list/index.js +23 -8
  13. package/dist/components/date-picker/index.js +17 -10
  14. package/dist/components/dialog/index.d.ts +1 -1
  15. package/dist/components/dialog/index.js +156 -95
  16. package/dist/components/display-date-value/index.d.ts +1 -1
  17. package/dist/components/display-date-value/index.js +2 -2
  18. package/dist/components/display-value/index.js +1 -1
  19. package/dist/components/drawer/index.d.ts +1 -1
  20. package/dist/components/drawer/index.js +22 -1
  21. package/dist/components/drilldown-menu/index.js +268 -87
  22. package/dist/components/field/index.js +110 -27
  23. package/dist/components/floating-panel/index.d.ts +1 -1
  24. package/dist/components/floating-panel/index.js +91 -43
  25. package/dist/components/form/index.d.ts +1 -1
  26. package/dist/components/form/index.js +142 -26
  27. package/dist/components/highlight/index.d.ts +1 -1
  28. package/dist/components/highlight/index.js +63 -14
  29. package/dist/components/icon/index.d.ts +1 -1
  30. package/dist/components/icon/index.js +1 -1
  31. package/dist/components/image/index.js +33 -2
  32. package/dist/components/input/index.d.ts +1 -1
  33. package/dist/components/input/index.js +67 -4
  34. package/dist/components/input-group/index.js +79 -14
  35. package/dist/components/json-form-builder/index.d.ts +1 -1
  36. package/dist/components/json-form-builder/index.js +383 -99
  37. package/dist/components/loader/index.js +35 -15
  38. package/dist/components/logo/index.js +97 -19
  39. package/dist/components/menu/index.d.ts +1 -1
  40. package/dist/components/menu/index.js +41 -7
  41. package/dist/components/number-input/index.d.ts +1 -1
  42. package/dist/components/number-input/index.js +68 -13
  43. package/dist/components/page-header/index.js +67 -12
  44. package/dist/components/pagination/index.d.ts +1 -1
  45. package/dist/components/pagination/index.js +52 -13
  46. package/dist/components/picker/index.js +56 -28
  47. package/dist/components/popover/index.d.ts +1 -1
  48. package/dist/components/popover/index.js +2 -1
  49. package/dist/components/progress/index.js +57 -23
  50. package/dist/components/progress-circle/index.js +82 -30
  51. package/dist/components/radio-group/index.js +60 -19
  52. package/dist/components/scroll-area/index.js +80 -19
  53. package/dist/components/segment-group/index.d.ts +1 -1
  54. package/dist/components/segment-group/index.js +40 -5
  55. package/dist/components/select/index.d.ts +1 -1
  56. package/dist/components/select/index.js +119 -22
  57. package/dist/components/show/index.js +1 -1
  58. package/dist/components/skeleton/index.js +55 -4
  59. package/dist/components/slider/index.d.ts +1 -0
  60. package/dist/components/slider/index.js +174 -55
  61. package/dist/components/spotlight/index.js +447 -126
  62. package/dist/components/steps/index.js +35 -13
  63. package/dist/components/switch/index.d.ts +1 -1
  64. package/dist/components/switch/index.js +210 -43
  65. package/dist/components/table/index.d.ts +1 -1
  66. package/dist/components/table/index.js +435 -67
  67. package/dist/components/tags-input/index.d.ts +1 -1
  68. package/dist/components/tags-input/index.js +25 -9
  69. package/dist/components/textarea/index.d.ts +1 -1
  70. package/dist/components/textarea/index.js +66 -4
  71. package/dist/components/toast/index.d.ts +1 -1
  72. package/dist/components/toast/index.js +56 -22
  73. package/dist/components/tooltip/index.d.ts +1 -1
  74. package/dist/components/tooltip/index.js +87 -25
  75. package/dist/components/tree-view/index.d.ts +1 -1
  76. package/dist/components/tree-view/index.js +64 -8
  77. package/dist/display-date-value-CSPbdE60.js +45 -0
  78. package/dist/{display-date-value-CdfgVuB7.d.ts → display-date-value-RbzRgYHt.d.ts} +1 -1
  79. package/dist/display-value-R2nHrGQo.js +81 -0
  80. package/dist/{featured-icon-DPysOpSf.js → featured-icon-DBnAKGXC.js} +31 -4
  81. package/dist/show-B7zG1Vci.js +28 -0
  82. package/dist/utils/index.js +164 -73
  83. package/package.json +6 -3
  84. package/dist/checkmark-CW-yHMvN.js +0 -18
  85. package/dist/close-button-BM7ikbYh.js +0 -52
  86. package/dist/display-date-value-gTlidtNz.js +0 -21
  87. package/dist/display-value-BNKxQ99u.js +0 -37
  88. 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 { omit } from "@pyck/react/utils";
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
- return <>
121
- {overlays.map((props) => {
122
- const { _id, ...componentProps } = props;
123
- const Comp = Component;
124
- return <Comp key={_id} {...componentProps} />;
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
- 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 = /* @__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 <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>;
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 = <FilePenLineIcon />, submitLabel = "Submit", ...rest } = props;
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 <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>;
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
- return <>
289
- <FormDialog.Viewport />
290
- <ConfirmDialog.Viewport />
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-CdfgVuB7.js";
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-BNKxQ99u.js";
2
- import { t as DisplayDateValue } from "../../display-date-value-gTlidtNz.js";
1
+ import "../../display-value-R2nHrGQo.js";
2
+ import { t as DisplayDateValue } from "../../display-date-value-CSPbdE60.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-R2nHrGQo.js";
2
2
 
3
3
  export { DisplayValue };
@@ -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
- return <ark.button {...props} ref={ref} onClick={() => dialog.setOpen(false)} />;
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