@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
|
@@ -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 {
|
|
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,
|
|
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:
|
|
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
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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> {
|