@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
@@ -2,12 +2,12 @@ import * as react from "react";
2
2
  import { ComponentProps, ReactNode, RefObject } 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 { FieldProps } from "@pyck/react/field";
6
7
  import { FieldPath, FieldValues } from "react-hook-form";
7
8
  import "@ark-ui/react";
8
9
  import { Switch as Switch$1 } from "@ark-ui/react/switch";
9
10
  import "@pyck/styled-system/types";
10
- import * as react_jsx_runtime0 from "react/jsx-runtime";
11
11
 
12
12
  //#region src/components/switch/switch.d.ts
13
13
  type RootProps = ComponentProps<typeof Root>;
@@ -1,79 +1,246 @@
1
- import { t as __exportAll } from "../../chunk-BYypO7fO.js";
1
+ import { c } from "react/compiler-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { VisuallyHidden, createStyleContext, styled } from "@pyck/styled-system/jsx";
4
4
  import { switchRecipe } from "@pyck/styled-system/recipes";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { Field } from "@pyck/react/field";
6
7
  import { Controller, useFormContext } from "react-hook-form";
7
8
  import { ark } from "@ark-ui/react";
8
- import { Switch as Switch$1, SwitchContext as Context, useSwitchContext } from "@ark-ui/react/switch";
9
+ import { Switch as Switch$1, useSwitchContext } from "@ark-ui/react/switch";
9
10
 
10
11
  //#region src/components/switch/switch.tsx
11
- var switch_exports = /* @__PURE__ */ __exportAll({
12
- Context: () => Context,
13
- Control: () => Control,
14
- HiddenInput: () => HiddenInput,
15
- Indicator: () => Indicator,
16
- Label: () => Label,
17
- Root: () => Root,
18
- RootProvider: () => RootProvider,
19
- Thumb: () => Thumb,
20
- ThumbIndicator: () => ThumbIndicator
21
- });
22
12
  const { withProvider, withContext } = createStyleContext(switchRecipe);
23
13
  const Root = withProvider(Switch$1.Root, "root");
24
14
  const RootProvider = withProvider(Switch$1.RootProvider, "root");
25
15
  const Label = withContext(Switch$1.Label, "label");
26
16
  const Thumb = withContext(Switch$1.Thumb, "thumb");
27
17
  const HiddenInput = Switch$1.HiddenInput;
28
- const Control = withContext(Switch$1.Control, "control", { defaultProps: { children: <Thumb /> } });
18
+ const Control = withContext(Switch$1.Control, "control", { defaultProps: { children: /* @__PURE__ */ jsx(Thumb, {}) } });
29
19
  const StyledIndicator = withContext(ark.span, "indicator");
30
20
  const Indicator = forwardRef(function Indicator(props, ref) {
31
- const { fallback, children, ...rest } = props;
21
+ const $ = c(9);
22
+ let children;
23
+ let fallback;
24
+ let rest;
25
+ if ($[0] !== props) {
26
+ ({fallback, children, ...rest} = props);
27
+ $[0] = props;
28
+ $[1] = children;
29
+ $[2] = fallback;
30
+ $[3] = rest;
31
+ } else {
32
+ children = $[1];
33
+ fallback = $[2];
34
+ rest = $[3];
35
+ }
32
36
  const api = useSwitchContext();
33
- return <StyledIndicator ref={ref} data-checked={api.checked ? "" : void 0} {...rest}>
34
- {api.checked ? children : fallback}
35
- </StyledIndicator>;
37
+ const t0 = api.checked ? "" : void 0;
38
+ const t1 = api.checked ? children : fallback;
39
+ let t2;
40
+ if ($[4] !== ref || $[5] !== rest || $[6] !== t0 || $[7] !== t1) {
41
+ t2 = /* @__PURE__ */ jsx(StyledIndicator, {
42
+ ref,
43
+ "data-checked": t0,
44
+ ...rest,
45
+ children: t1
46
+ });
47
+ $[4] = ref;
48
+ $[5] = rest;
49
+ $[6] = t0;
50
+ $[7] = t1;
51
+ $[8] = t2;
52
+ } else t2 = $[8];
53
+ return t2;
36
54
  });
37
55
  const StyledThumbIndicator = styled(ark.span);
38
56
  const ThumbIndicator = forwardRef(function SwitchThumbIndicator(props, ref) {
39
- const { fallback, children, ...rest } = props;
57
+ const $ = c(9);
58
+ let children;
59
+ let fallback;
60
+ let rest;
61
+ if ($[0] !== props) {
62
+ ({fallback, children, ...rest} = props);
63
+ $[0] = props;
64
+ $[1] = children;
65
+ $[2] = fallback;
66
+ $[3] = rest;
67
+ } else {
68
+ children = $[1];
69
+ fallback = $[2];
70
+ rest = $[3];
71
+ }
40
72
  const api = useSwitchContext();
41
- return <StyledThumbIndicator ref={ref} data-checked={api.checked ? "" : void 0} {...rest}>
42
- {api.checked ? children : fallback}
43
- </StyledThumbIndicator>;
73
+ const t0 = api.checked ? "" : void 0;
74
+ const t1 = api.checked ? children : fallback;
75
+ let t2;
76
+ if ($[4] !== ref || $[5] !== rest || $[6] !== t0 || $[7] !== t1) {
77
+ t2 = /* @__PURE__ */ jsx(StyledThumbIndicator, {
78
+ ref,
79
+ "data-checked": t0,
80
+ ...rest,
81
+ children: t1
82
+ });
83
+ $[4] = ref;
84
+ $[5] = rest;
85
+ $[6] = t0;
86
+ $[7] = t1;
87
+ $[8] = t2;
88
+ } else t2 = $[8];
89
+ return t2;
44
90
  });
45
91
 
46
92
  //#endregion
47
93
  //#region src/components/switch/switch.closed.tsx
48
94
  const Switch = forwardRef(function Switch(props, ref) {
49
- const { inputProps, children, rootRef = null, trackLabel, thumbLabel, ...rest } = props;
50
- return <switch_exports.Root ref={rootRef} {...rest}>
51
- <switch_exports.HiddenInput ref={ref} {...inputProps} />
52
- <switch_exports.Control>
53
- <switch_exports.Thumb>
54
- {thumbLabel && <switch_exports.ThumbIndicator fallback={thumbLabel?.off}>
55
- {thumbLabel?.on}
56
- </switch_exports.ThumbIndicator>}
57
- </switch_exports.Thumb>
58
- {trackLabel && <switch_exports.Indicator fallback={trackLabel.off}>{trackLabel.on}</switch_exports.Indicator>}
59
- </switch_exports.Control>
60
- {children && <switch_exports.Label>{children}</switch_exports.Label>}
61
- {props["aria-label"] && <switch_exports.Label asChild>
62
- <VisuallyHidden>{props["aria-label"]}</VisuallyHidden>
63
- </switch_exports.Label>}
64
- </switch_exports.Root>;
95
+ const $ = c(30);
96
+ let children;
97
+ let inputProps;
98
+ let rest;
99
+ let t0;
100
+ let thumbLabel;
101
+ let trackLabel;
102
+ if ($[0] !== props) {
103
+ ({inputProps, children, rootRef: t0, trackLabel, thumbLabel, ...rest} = props);
104
+ $[0] = props;
105
+ $[1] = children;
106
+ $[2] = inputProps;
107
+ $[3] = rest;
108
+ $[4] = t0;
109
+ $[5] = thumbLabel;
110
+ $[6] = trackLabel;
111
+ } else {
112
+ children = $[1];
113
+ inputProps = $[2];
114
+ rest = $[3];
115
+ t0 = $[4];
116
+ thumbLabel = $[5];
117
+ trackLabel = $[6];
118
+ }
119
+ const rootRef = t0 === void 0 ? null : t0;
120
+ let t1;
121
+ if ($[7] !== inputProps || $[8] !== ref) {
122
+ t1 = /* @__PURE__ */ jsx(HiddenInput, {
123
+ ref,
124
+ ...inputProps
125
+ });
126
+ $[7] = inputProps;
127
+ $[8] = ref;
128
+ $[9] = t1;
129
+ } else t1 = $[9];
130
+ let t2;
131
+ if ($[10] !== thumbLabel) {
132
+ t2 = thumbLabel && /* @__PURE__ */ jsx(ThumbIndicator, {
133
+ fallback: thumbLabel?.off,
134
+ children: thumbLabel?.on
135
+ });
136
+ $[10] = thumbLabel;
137
+ $[11] = t2;
138
+ } else t2 = $[11];
139
+ let t3;
140
+ if ($[12] !== t2) {
141
+ t3 = /* @__PURE__ */ jsx(Thumb, { children: t2 });
142
+ $[12] = t2;
143
+ $[13] = t3;
144
+ } else t3 = $[13];
145
+ let t4;
146
+ if ($[14] !== trackLabel) {
147
+ t4 = trackLabel && /* @__PURE__ */ jsx(Indicator, {
148
+ fallback: trackLabel.off,
149
+ children: trackLabel.on
150
+ });
151
+ $[14] = trackLabel;
152
+ $[15] = t4;
153
+ } else t4 = $[15];
154
+ let t5;
155
+ if ($[16] !== t3 || $[17] !== t4) {
156
+ t5 = /* @__PURE__ */ jsxs(Control, { children: [t3, t4] });
157
+ $[16] = t3;
158
+ $[17] = t4;
159
+ $[18] = t5;
160
+ } else t5 = $[18];
161
+ let t6;
162
+ if ($[19] !== children) {
163
+ t6 = children && /* @__PURE__ */ jsx(Label, { children });
164
+ $[19] = children;
165
+ $[20] = t6;
166
+ } else t6 = $[20];
167
+ let t7;
168
+ if ($[21] !== props) {
169
+ t7 = props["aria-label"] && /* @__PURE__ */ jsx(Label, {
170
+ asChild: true,
171
+ children: /* @__PURE__ */ jsx(VisuallyHidden, { children: props["aria-label"] })
172
+ });
173
+ $[21] = props;
174
+ $[22] = t7;
175
+ } else t7 = $[22];
176
+ let t8;
177
+ if ($[23] !== rest || $[24] !== rootRef || $[25] !== t1 || $[26] !== t5 || $[27] !== t6 || $[28] !== t7) {
178
+ t8 = /* @__PURE__ */ jsxs(Root, {
179
+ ref: rootRef,
180
+ ...rest,
181
+ children: [
182
+ t1,
183
+ t5,
184
+ t6,
185
+ t7
186
+ ]
187
+ });
188
+ $[23] = rest;
189
+ $[24] = rootRef;
190
+ $[25] = t1;
191
+ $[26] = t5;
192
+ $[27] = t6;
193
+ $[28] = t7;
194
+ $[29] = t8;
195
+ } else t8 = $[29];
196
+ return t8;
65
197
  });
66
198
 
67
199
  //#endregion
68
200
  //#region src/components/switch/switch.field.tsx
69
201
  const SwitchField = (props) => {
202
+ const $ = c(8);
70
203
  const { name, label, helperText, disabled } = props;
71
204
  const { control } = useFormContext();
72
- return <Controller name={name} control={control} render={({ field, fieldState }) => <Field helperText={helperText} disabled={field.disabled || disabled} invalid={!!fieldState.error} errorText={fieldState.error?.message}>
73
- <Switch name={field.name} checked={field.value} onCheckedChange={({ checked }) => field.onChange(checked)} inputProps={{ onBlur: field.onBlur }}>
74
- {label}
75
- </Switch>
76
- </Field>} />;
205
+ let t0;
206
+ if ($[0] !== disabled || $[1] !== helperText || $[2] !== label) {
207
+ t0 = (t1) => {
208
+ const { field, fieldState } = t1;
209
+ return /* @__PURE__ */ jsx(Field, {
210
+ helperText,
211
+ disabled: field.disabled || disabled,
212
+ invalid: !!fieldState.error,
213
+ errorText: fieldState.error?.message,
214
+ children: /* @__PURE__ */ jsx(Switch, {
215
+ name: field.name,
216
+ checked: field.value,
217
+ onCheckedChange: (t2) => {
218
+ const { checked } = t2;
219
+ return field.onChange(checked);
220
+ },
221
+ inputProps: { onBlur: field.onBlur },
222
+ children: label
223
+ })
224
+ });
225
+ };
226
+ $[0] = disabled;
227
+ $[1] = helperText;
228
+ $[2] = label;
229
+ $[3] = t0;
230
+ } else t0 = $[3];
231
+ let t1;
232
+ if ($[4] !== control || $[5] !== name || $[6] !== t0) {
233
+ t1 = /* @__PURE__ */ jsx(Controller, {
234
+ name,
235
+ control,
236
+ render: t0
237
+ });
238
+ $[4] = control;
239
+ $[5] = name;
240
+ $[6] = t0;
241
+ $[7] = t1;
242
+ } else t1 = $[7];
243
+ return t1;
77
244
  };
78
245
 
79
246
  //#endregion
@@ -2,11 +2,11 @@ import * as react from "react";
2
2
  import { ComponentProps, ComponentType, ReactNode } 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 { DateInput, Locale } from "@pyck/react/utils";
6
7
  import * as _ark_ui_react0 from "@ark-ui/react";
7
8
  import { DisplayValueProps } from "@pyck/react/display-value";
8
9
  import { DateFormatType } from "@pyck/react/display-date-value";
9
- import * as react_jsx_runtime0 from "react/jsx-runtime";
10
10
 
11
11
  //#region src/components/table/cells/table-cell-content.d.ts
12
12
  interface TableCellContentProps<IconProps extends object = object> {