@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,5 +1,7 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
1
2
|
import { styled } from "@pyck/styled-system/jsx";
|
|
2
3
|
import { textarea } from "@pyck/styled-system/recipes";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
5
|
import { Field } from "@pyck/react/field";
|
|
4
6
|
import { Controller, useFormContext } from "react-hook-form";
|
|
5
7
|
import { Field as Field$1 } from "@ark-ui/react/field";
|
|
@@ -11,11 +13,71 @@ const Textarea = styled(Field$1.Textarea, textarea);
|
|
|
11
13
|
//#endregion
|
|
12
14
|
//#region src/components/textarea/textarea-field.tsx
|
|
13
15
|
const TextareaField = (props) => {
|
|
14
|
-
const
|
|
16
|
+
const $ = c(17);
|
|
17
|
+
let disabled;
|
|
18
|
+
let helperText;
|
|
19
|
+
let hideLabel;
|
|
20
|
+
let label;
|
|
21
|
+
let name;
|
|
22
|
+
let textareaProps;
|
|
23
|
+
if ($[0] !== props) {
|
|
24
|
+
({name, label, hideLabel, helperText, disabled, ...textareaProps} = props);
|
|
25
|
+
$[0] = props;
|
|
26
|
+
$[1] = disabled;
|
|
27
|
+
$[2] = helperText;
|
|
28
|
+
$[3] = hideLabel;
|
|
29
|
+
$[4] = label;
|
|
30
|
+
$[5] = name;
|
|
31
|
+
$[6] = textareaProps;
|
|
32
|
+
} else {
|
|
33
|
+
disabled = $[1];
|
|
34
|
+
helperText = $[2];
|
|
35
|
+
hideLabel = $[3];
|
|
36
|
+
label = $[4];
|
|
37
|
+
name = $[5];
|
|
38
|
+
textareaProps = $[6];
|
|
39
|
+
}
|
|
15
40
|
const { control } = useFormContext();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
41
|
+
let t0;
|
|
42
|
+
if ($[7] !== disabled || $[8] !== helperText || $[9] !== hideLabel || $[10] !== label || $[11] !== textareaProps) {
|
|
43
|
+
t0 = (t1) => {
|
|
44
|
+
const { field, fieldState } = t1;
|
|
45
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
46
|
+
label,
|
|
47
|
+
helperText,
|
|
48
|
+
hideLabel,
|
|
49
|
+
disabled: field.disabled || disabled,
|
|
50
|
+
invalid: !!fieldState.error,
|
|
51
|
+
errorText: fieldState.error?.message,
|
|
52
|
+
children: /* @__PURE__ */ jsx(Textarea$1, {
|
|
53
|
+
...textareaProps,
|
|
54
|
+
name: field.name,
|
|
55
|
+
value: field.value,
|
|
56
|
+
onChange: field.onChange,
|
|
57
|
+
onBlur: field.onBlur
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
$[7] = disabled;
|
|
62
|
+
$[8] = helperText;
|
|
63
|
+
$[9] = hideLabel;
|
|
64
|
+
$[10] = label;
|
|
65
|
+
$[11] = textareaProps;
|
|
66
|
+
$[12] = t0;
|
|
67
|
+
} else t0 = $[12];
|
|
68
|
+
let t1;
|
|
69
|
+
if ($[13] !== control || $[14] !== name || $[15] !== t0) {
|
|
70
|
+
t1 = /* @__PURE__ */ jsx(Controller, {
|
|
71
|
+
name,
|
|
72
|
+
control,
|
|
73
|
+
render: t0
|
|
74
|
+
});
|
|
75
|
+
$[13] = control;
|
|
76
|
+
$[14] = name;
|
|
77
|
+
$[15] = t0;
|
|
78
|
+
$[16] = t1;
|
|
79
|
+
} else t1 = $[16];
|
|
80
|
+
return t1;
|
|
19
81
|
};
|
|
20
82
|
|
|
21
83
|
//#endregion
|
|
@@ -2,8 +2,8 @@ import * as react from "react";
|
|
|
2
2
|
import { ComponentProps, HTMLAttributes } 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 { CreateToasterReturn, Toast, ToastContext as Context } from "@ark-ui/react/toast";
|
|
6
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
import { CreateToasterReturn, Toast, ToastContext as Context } from "@ark-ui/react/toast";
|
|
7
7
|
|
|
8
8
|
//#region src/components/toast/toast.d.ts
|
|
9
9
|
declare namespace toast_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 { Stack, createStyleContext, styled } from "@pyck/styled-system/jsx";
|
|
4
5
|
import { toast } from "@pyck/styled-system/recipes";
|
|
5
6
|
import { CheckCircleIcon, CircleAlertIcon, CircleXIcon } from "lucide-react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
import { Show } from "@pyck/react/show";
|
|
7
9
|
import { Portal } from "@ark-ui/react/portal";
|
|
8
10
|
import { CloseButton } from "@pyck/react/button";
|
|
@@ -32,12 +34,31 @@ const iconMap = {
|
|
|
32
34
|
error: CircleXIcon
|
|
33
35
|
};
|
|
34
36
|
const Indicator = forwardRef((props, ref) => {
|
|
37
|
+
const $ = c(7);
|
|
35
38
|
const toast = useToastContext();
|
|
36
39
|
const StatusIcon = iconMap[toast.type];
|
|
37
40
|
if (!StatusIcon) return null;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
let t0;
|
|
42
|
+
if ($[0] !== StatusIcon) {
|
|
43
|
+
t0 = /* @__PURE__ */ jsx(StatusIcon, {});
|
|
44
|
+
$[0] = StatusIcon;
|
|
45
|
+
$[1] = t0;
|
|
46
|
+
} else t0 = $[1];
|
|
47
|
+
let t1;
|
|
48
|
+
if ($[2] !== props || $[3] !== ref || $[4] !== t0 || $[5] !== toast.type) {
|
|
49
|
+
t1 = /* @__PURE__ */ jsx(Icon, {
|
|
50
|
+
ref,
|
|
51
|
+
"data-type": toast.type,
|
|
52
|
+
...props,
|
|
53
|
+
children: t0
|
|
54
|
+
});
|
|
55
|
+
$[2] = props;
|
|
56
|
+
$[3] = ref;
|
|
57
|
+
$[4] = t0;
|
|
58
|
+
$[5] = toast.type;
|
|
59
|
+
$[6] = t1;
|
|
60
|
+
} else t1 = $[6];
|
|
61
|
+
return t1;
|
|
41
62
|
});
|
|
42
63
|
|
|
43
64
|
//#endregion
|
|
@@ -51,26 +72,39 @@ const toaster = createToaster({
|
|
|
51
72
|
});
|
|
52
73
|
const StyledToaster = styled(Toaster$1);
|
|
53
74
|
const Toaster = () => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{toast.action && <toast_exports.ActionTrigger>{toast.action.label}</toast_exports.ActionTrigger>}
|
|
66
|
-
</Stack>
|
|
67
|
-
{toast.closable && <toast_exports.CloseTrigger asChild>
|
|
68
|
-
<CloseButton size="sm" />
|
|
69
|
-
</toast_exports.CloseTrigger>}
|
|
70
|
-
</toast_exports.Root>}
|
|
71
|
-
</StyledToaster>
|
|
72
|
-
</Portal>;
|
|
75
|
+
const $ = c(1);
|
|
76
|
+
let t0;
|
|
77
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
78
|
+
t0 = /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(StyledToaster, {
|
|
79
|
+
toaster,
|
|
80
|
+
insetInline: { mdDown: "4" },
|
|
81
|
+
children: _temp
|
|
82
|
+
}) });
|
|
83
|
+
$[0] = t0;
|
|
84
|
+
} else t0 = $[0];
|
|
85
|
+
return t0;
|
|
73
86
|
};
|
|
87
|
+
function _temp(toast) {
|
|
88
|
+
return /* @__PURE__ */ jsxs(Root, { children: [
|
|
89
|
+
/* @__PURE__ */ jsx(Show, {
|
|
90
|
+
when: toast.type === "loading",
|
|
91
|
+
fallback: /* @__PURE__ */ jsx(Indicator, {}),
|
|
92
|
+
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsxs(Stack, {
|
|
95
|
+
gap: "3",
|
|
96
|
+
alignItems: "start",
|
|
97
|
+
children: [/* @__PURE__ */ jsxs(Stack, {
|
|
98
|
+
gap: "1",
|
|
99
|
+
children: [toast.title && /* @__PURE__ */ jsx(Title, { children: toast.title }), toast.description && /* @__PURE__ */ jsx(Description, { children: toast.description })]
|
|
100
|
+
}), toast.action && /* @__PURE__ */ jsx(ActionTrigger, { children: toast.action.label })]
|
|
101
|
+
}),
|
|
102
|
+
toast.closable && /* @__PURE__ */ jsx(CloseTrigger, {
|
|
103
|
+
asChild: true,
|
|
104
|
+
children: /* @__PURE__ */ jsx(CloseButton, { size: "sm" })
|
|
105
|
+
})
|
|
106
|
+
] });
|
|
107
|
+
}
|
|
74
108
|
|
|
75
109
|
//#endregion
|
|
76
110
|
export { toast_exports as Toast, Toaster, toaster };
|
|
@@ -2,8 +2,8 @@ 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 { Tooltip as Tooltip$1 } from "@ark-ui/react/tooltip";
|
|
6
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
import { Tooltip as Tooltip$1 } from "@ark-ui/react/tooltip";
|
|
7
7
|
|
|
8
8
|
//#region src/components/tooltip/tooltip.d.ts
|
|
9
9
|
type RootProps = ComponentProps<typeof Root>;
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
4
4
|
import { tooltip } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { Portal } from "@ark-ui/react/portal";
|
|
6
|
-
import { Tooltip as Tooltip$1
|
|
7
|
+
import { Tooltip as Tooltip$1 } from "@ark-ui/react/tooltip";
|
|
7
8
|
|
|
8
9
|
//#region src/components/tooltip/tooltip.tsx
|
|
9
|
-
var tooltip_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
-
Arrow: () => Arrow,
|
|
11
|
-
ArrowTip: () => ArrowTip,
|
|
12
|
-
Content: () => Content,
|
|
13
|
-
Context: () => Context,
|
|
14
|
-
Positioner: () => Positioner,
|
|
15
|
-
Root: () => Root,
|
|
16
|
-
Trigger: () => Trigger
|
|
17
|
-
});
|
|
18
10
|
const { withRootProvider, withContext } = createStyleContext(tooltip);
|
|
19
11
|
const Root = withRootProvider(Tooltip$1.Root, { defaultProps: {
|
|
20
12
|
unmountOnExit: true,
|
|
@@ -29,21 +21,91 @@ const Trigger = withContext(Tooltip$1.Trigger, "trigger");
|
|
|
29
21
|
//#endregion
|
|
30
22
|
//#region src/components/tooltip/tooltip.closed.tsx
|
|
31
23
|
const Tooltip = forwardRef(function Tooltip(props, ref) {
|
|
32
|
-
const
|
|
24
|
+
const $ = c(26);
|
|
25
|
+
let children;
|
|
26
|
+
let content;
|
|
27
|
+
let contentProps;
|
|
28
|
+
let disabled;
|
|
29
|
+
let portalRef;
|
|
30
|
+
let rootProps;
|
|
31
|
+
let showArrow;
|
|
32
|
+
let t0;
|
|
33
|
+
if ($[0] !== props) {
|
|
34
|
+
({showArrow, children, disabled, portalled: t0, content, contentProps, portalRef, ...rootProps} = props);
|
|
35
|
+
$[0] = props;
|
|
36
|
+
$[1] = children;
|
|
37
|
+
$[2] = content;
|
|
38
|
+
$[3] = contentProps;
|
|
39
|
+
$[4] = disabled;
|
|
40
|
+
$[5] = portalRef;
|
|
41
|
+
$[6] = rootProps;
|
|
42
|
+
$[7] = showArrow;
|
|
43
|
+
$[8] = t0;
|
|
44
|
+
} else {
|
|
45
|
+
children = $[1];
|
|
46
|
+
content = $[2];
|
|
47
|
+
contentProps = $[3];
|
|
48
|
+
disabled = $[4];
|
|
49
|
+
portalRef = $[5];
|
|
50
|
+
rootProps = $[6];
|
|
51
|
+
showArrow = $[7];
|
|
52
|
+
t0 = $[8];
|
|
53
|
+
}
|
|
54
|
+
const portalled = t0 === void 0 ? true : t0;
|
|
33
55
|
if (disabled) return children;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
let t1;
|
|
57
|
+
if ($[9] !== children) {
|
|
58
|
+
t1 = /* @__PURE__ */ jsx(Trigger, {
|
|
59
|
+
asChild: true,
|
|
60
|
+
children
|
|
61
|
+
});
|
|
62
|
+
$[9] = children;
|
|
63
|
+
$[10] = t1;
|
|
64
|
+
} else t1 = $[10];
|
|
65
|
+
const t2 = !portalled;
|
|
66
|
+
let t3;
|
|
67
|
+
if ($[11] !== showArrow) {
|
|
68
|
+
t3 = showArrow && /* @__PURE__ */ jsx(Arrow, { children: /* @__PURE__ */ jsx(ArrowTip, {}) });
|
|
69
|
+
$[11] = showArrow;
|
|
70
|
+
$[12] = t3;
|
|
71
|
+
} else t3 = $[12];
|
|
72
|
+
let t4;
|
|
73
|
+
if ($[13] !== content || $[14] !== contentProps || $[15] !== ref || $[16] !== t3) {
|
|
74
|
+
t4 = /* @__PURE__ */ jsx(Positioner, { children: /* @__PURE__ */ jsxs(Content, {
|
|
75
|
+
ref,
|
|
76
|
+
...contentProps,
|
|
77
|
+
children: [t3, content]
|
|
78
|
+
}) });
|
|
79
|
+
$[13] = content;
|
|
80
|
+
$[14] = contentProps;
|
|
81
|
+
$[15] = ref;
|
|
82
|
+
$[16] = t3;
|
|
83
|
+
$[17] = t4;
|
|
84
|
+
} else t4 = $[17];
|
|
85
|
+
let t5;
|
|
86
|
+
if ($[18] !== portalRef || $[19] !== t2 || $[20] !== t4) {
|
|
87
|
+
t5 = /* @__PURE__ */ jsx(Portal, {
|
|
88
|
+
disabled: t2,
|
|
89
|
+
container: portalRef,
|
|
90
|
+
children: t4
|
|
91
|
+
});
|
|
92
|
+
$[18] = portalRef;
|
|
93
|
+
$[19] = t2;
|
|
94
|
+
$[20] = t4;
|
|
95
|
+
$[21] = t5;
|
|
96
|
+
} else t5 = $[21];
|
|
97
|
+
let t6;
|
|
98
|
+
if ($[22] !== rootProps || $[23] !== t1 || $[24] !== t5) {
|
|
99
|
+
t6 = /* @__PURE__ */ jsxs(Root, {
|
|
100
|
+
...rootProps,
|
|
101
|
+
children: [t1, t5]
|
|
102
|
+
});
|
|
103
|
+
$[22] = rootProps;
|
|
104
|
+
$[23] = t1;
|
|
105
|
+
$[24] = t5;
|
|
106
|
+
$[25] = t6;
|
|
107
|
+
} else t6 = $[25];
|
|
108
|
+
return t6;
|
|
47
109
|
});
|
|
48
110
|
|
|
49
111
|
//#endregion
|
|
@@ -3,9 +3,9 @@ import * as react from "react";
|
|
|
3
3
|
import { ComponentProps, RefAttributes } from "react";
|
|
4
4
|
import * as _pyck_styled_system_jsx0 from "@pyck/styled-system/jsx";
|
|
5
5
|
import { TreeViewVariantProps } from "@pyck/styled-system/recipes";
|
|
6
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
7
|
import { TreeView, TreeViewContext as Context, TreeViewNodeProvider as NodeProvider, TreeViewNodeProviderProps as NodeProviderProps, TreeViewRootProps, createTreeCollection } from "@ark-ui/react/tree-view";
|
|
7
8
|
import { Assign, HTMLStyledProps as HTMLStyledProps$1 } from "@pyck/styled-system/types";
|
|
8
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
9
9
|
|
|
10
10
|
//#region src/components/tree-view/tree-view.d.ts
|
|
11
11
|
declare namespace tree_view_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 { createStyleContext } from "@pyck/styled-system/jsx";
|
|
4
5
|
import { treeView } from "@pyck/styled-system/recipes";
|
|
5
6
|
import { ChevronRightIcon } from "lucide-react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
8
|
import { Show } from "@pyck/react/show";
|
|
7
9
|
import { TreeView, TreeViewContext as Context, TreeViewNodeProvider as NodeProvider, createTreeCollection, useTreeViewNodeContext } from "@ark-ui/react/tree-view";
|
|
8
10
|
import { Checkmark } from "@pyck/react/checkmark";
|
|
@@ -45,18 +47,72 @@ const Tree = withContext(TreeView.Tree, "tree");
|
|
|
45
47
|
const NodeCheckboxIndicator = TreeView.NodeCheckboxIndicator;
|
|
46
48
|
const StyledBranchIndicator = withContext(TreeView.BranchIndicator, "branchIndicator");
|
|
47
49
|
const BranchIndicator = forwardRef(function BranchIndicator(props, ref) {
|
|
50
|
+
const $ = c(8);
|
|
48
51
|
const node = useTreeViewNodeContext();
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
let t0;
|
|
53
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
54
|
+
t0 = /* @__PURE__ */ jsx("svg", {
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
focusable: "false"
|
|
57
|
+
});
|
|
58
|
+
$[0] = t0;
|
|
59
|
+
} else t0 = $[0];
|
|
60
|
+
let t1;
|
|
61
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
62
|
+
t1 = /* @__PURE__ */ jsx(ChevronRightIcon, {});
|
|
63
|
+
$[1] = t1;
|
|
64
|
+
} else t1 = $[1];
|
|
65
|
+
let t2;
|
|
66
|
+
if ($[2] !== props || $[3] !== ref) {
|
|
67
|
+
t2 = /* @__PURE__ */ jsx(StyledBranchIndicator, {
|
|
68
|
+
ref,
|
|
69
|
+
...props,
|
|
70
|
+
children: t1
|
|
71
|
+
});
|
|
72
|
+
$[2] = props;
|
|
73
|
+
$[3] = ref;
|
|
74
|
+
$[4] = t2;
|
|
75
|
+
} else t2 = $[4];
|
|
76
|
+
let t3;
|
|
77
|
+
if ($[5] !== node.isBranch || $[6] !== t2) {
|
|
78
|
+
t3 = /* @__PURE__ */ jsx(Show, {
|
|
79
|
+
when: node.isBranch,
|
|
80
|
+
fallback: t0,
|
|
81
|
+
children: t2
|
|
82
|
+
});
|
|
83
|
+
$[5] = node.isBranch;
|
|
84
|
+
$[6] = t2;
|
|
85
|
+
$[7] = t3;
|
|
86
|
+
} else t3 = $[7];
|
|
87
|
+
return t3;
|
|
54
88
|
});
|
|
55
89
|
const Checkbox = (props) => {
|
|
90
|
+
const $ = c(6);
|
|
56
91
|
const node = useTreeViewNodeContext();
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
92
|
+
const t0 = node.checked === true;
|
|
93
|
+
const t1 = node.checked === "indeterminate";
|
|
94
|
+
let t2;
|
|
95
|
+
if ($[0] !== t0 || $[1] !== t1) {
|
|
96
|
+
t2 = /* @__PURE__ */ jsx(Checkmark, {
|
|
97
|
+
size: "sm",
|
|
98
|
+
checked: t0,
|
|
99
|
+
indeterminate: t1
|
|
100
|
+
});
|
|
101
|
+
$[0] = t0;
|
|
102
|
+
$[1] = t1;
|
|
103
|
+
$[2] = t2;
|
|
104
|
+
} else t2 = $[2];
|
|
105
|
+
let t3;
|
|
106
|
+
if ($[3] !== props || $[4] !== t2) {
|
|
107
|
+
t3 = /* @__PURE__ */ jsx(NodeCheckbox, {
|
|
108
|
+
...props,
|
|
109
|
+
children: t2
|
|
110
|
+
});
|
|
111
|
+
$[3] = props;
|
|
112
|
+
$[4] = t2;
|
|
113
|
+
$[5] = t3;
|
|
114
|
+
} else t3 = $[5];
|
|
115
|
+
return t3;
|
|
60
116
|
};
|
|
61
117
|
|
|
62
118
|
//#endregion
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { t as DisplayValue } from "./display-value-R2nHrGQo.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { formatDate, formatDateTime, getDateFormats, isString } from "@pyck/react/utils";
|
|
5
|
+
|
|
6
|
+
//#region src/components/display-date-value/display-date-value.tsx
|
|
7
|
+
const DisplayDateValue = (props) => {
|
|
8
|
+
const $ = c(8);
|
|
9
|
+
const { value, format, copyable, type: t0, locale: localeProp } = props;
|
|
10
|
+
const type = t0 === void 0 ? "date" : t0;
|
|
11
|
+
const locale = localeProp ?? "en-US";
|
|
12
|
+
let t1;
|
|
13
|
+
if ($[0] !== format || $[1] !== locale || $[2] !== type) {
|
|
14
|
+
t1 = (date) => {
|
|
15
|
+
if (format && isString(format) && !isDateFormatKey(format, locale)) return formatDate(date, format, locale);
|
|
16
|
+
if (format && isDateFormatKey(format, locale)) return formatDate(date, getDateFormats(locale)[format], locale);
|
|
17
|
+
return formatDateTime(date, type, locale);
|
|
18
|
+
};
|
|
19
|
+
$[0] = format;
|
|
20
|
+
$[1] = locale;
|
|
21
|
+
$[2] = type;
|
|
22
|
+
$[3] = t1;
|
|
23
|
+
} else t1 = $[3];
|
|
24
|
+
const formatValue = t1;
|
|
25
|
+
let t2;
|
|
26
|
+
if ($[4] !== copyable || $[5] !== formatValue || $[6] !== value) {
|
|
27
|
+
t2 = /* @__PURE__ */ jsx(DisplayValue, {
|
|
28
|
+
value,
|
|
29
|
+
formatValue,
|
|
30
|
+
copyable
|
|
31
|
+
});
|
|
32
|
+
$[4] = copyable;
|
|
33
|
+
$[5] = formatValue;
|
|
34
|
+
$[6] = value;
|
|
35
|
+
$[7] = t2;
|
|
36
|
+
} else t2 = $[7];
|
|
37
|
+
return t2;
|
|
38
|
+
};
|
|
39
|
+
const isDateFormatKey = (format, locale) => {
|
|
40
|
+
const formats = getDateFormats(locale);
|
|
41
|
+
return Object.keys(formats).includes(format);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { DisplayDateValue as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DateInput, Locale, getDateFormats } from "@pyck/react/utils";
|
|
2
1
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { DateInput, Locale, getDateFormats } from "@pyck/react/utils";
|
|
3
3
|
|
|
4
4
|
//#region src/components/display-date-value/display-date-value.d.ts
|
|
5
5
|
type DateFormatType = keyof ReturnType<typeof getDateFormats> | (string & {});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { HStack, VisuallyHidden } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { isString } from "@pyck/react/utils";
|
|
5
|
+
import { Clipboard } from "@pyck/react/clipboard";
|
|
6
|
+
import { Show } from "@pyck/react/show";
|
|
7
|
+
import { Span } from "@pyck/react/span";
|
|
8
|
+
import { Wrap } from "@pyck/react/wrap";
|
|
9
|
+
|
|
10
|
+
//#region src/components/display-value/display-value.tsx
|
|
11
|
+
const DisplayValue = (props) => {
|
|
12
|
+
const $ = c(13);
|
|
13
|
+
const { value, copyable, formatValue } = props;
|
|
14
|
+
let t0;
|
|
15
|
+
if ($[0] !== formatValue || $[1] !== value) {
|
|
16
|
+
t0 = isNotEmpty(value) ? formatValue?.(value) ?? String(value) : null;
|
|
17
|
+
$[0] = formatValue;
|
|
18
|
+
$[1] = value;
|
|
19
|
+
$[2] = t0;
|
|
20
|
+
} else t0 = $[2];
|
|
21
|
+
const formattedValue = t0;
|
|
22
|
+
const t1 = formattedValue != null;
|
|
23
|
+
let t2;
|
|
24
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
25
|
+
t2 = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Span, {
|
|
26
|
+
color: "fg.subtle",
|
|
27
|
+
"aria-hidden": true,
|
|
28
|
+
children: "—"
|
|
29
|
+
}), /* @__PURE__ */ jsx(VisuallyHidden, { children: "No value" })] });
|
|
30
|
+
$[3] = t2;
|
|
31
|
+
} else t2 = $[3];
|
|
32
|
+
let t3;
|
|
33
|
+
if ($[4] !== formattedValue) {
|
|
34
|
+
t3 = (children) => /* @__PURE__ */ jsx(Clipboard.Root, {
|
|
35
|
+
value: formattedValue,
|
|
36
|
+
timeout: 400,
|
|
37
|
+
children: /* @__PURE__ */ jsx(Clipboard.Trigger, {
|
|
38
|
+
_hover: { "& [data-part=\"indicator\"]": { opacity: 1 } },
|
|
39
|
+
_active: { "& [data-part=\"indicator\"]": { opacity: 1 } },
|
|
40
|
+
children: /* @__PURE__ */ jsxs(HStack, { children: [/* @__PURE__ */ jsx(Clipboard.Indicator, {
|
|
41
|
+
color: "fg.subtle",
|
|
42
|
+
opacity: "0"
|
|
43
|
+
}), /* @__PURE__ */ jsx(Span, { children })] })
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
$[4] = formattedValue;
|
|
47
|
+
$[5] = t3;
|
|
48
|
+
} else t3 = $[5];
|
|
49
|
+
let t4;
|
|
50
|
+
if ($[6] !== copyable || $[7] !== formattedValue || $[8] !== t3) {
|
|
51
|
+
t4 = /* @__PURE__ */ jsx(Wrap, {
|
|
52
|
+
when: copyable,
|
|
53
|
+
with: t3,
|
|
54
|
+
children: formattedValue
|
|
55
|
+
});
|
|
56
|
+
$[6] = copyable;
|
|
57
|
+
$[7] = formattedValue;
|
|
58
|
+
$[8] = t3;
|
|
59
|
+
$[9] = t4;
|
|
60
|
+
} else t4 = $[9];
|
|
61
|
+
let t5;
|
|
62
|
+
if ($[10] !== t1 || $[11] !== t4) {
|
|
63
|
+
t5 = /* @__PURE__ */ jsx(Show, {
|
|
64
|
+
when: t1,
|
|
65
|
+
fallback: t2,
|
|
66
|
+
children: t4
|
|
67
|
+
});
|
|
68
|
+
$[10] = t1;
|
|
69
|
+
$[11] = t4;
|
|
70
|
+
$[12] = t5;
|
|
71
|
+
} else t5 = $[12];
|
|
72
|
+
return t5;
|
|
73
|
+
};
|
|
74
|
+
const isNotEmpty = (value) => {
|
|
75
|
+
if (value == null) return false;
|
|
76
|
+
if (isString(value) || Array.isArray(value)) return value.length > 0;
|
|
77
|
+
return true;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
export { DisplayValue as t };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
1
2
|
import { ark } from "@ark-ui/react/factory";
|
|
2
3
|
import { styled } from "@pyck/styled-system/jsx";
|
|
3
4
|
import { icon } from "@pyck/styled-system/recipes";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
6
|
import { cva } from "@pyck/styled-system/css";
|
|
5
7
|
|
|
6
8
|
//#region src/components/icon/icon.tsx
|
|
@@ -25,10 +27,35 @@ const IconWrapper = styled("div", cva({
|
|
|
25
27
|
} } }
|
|
26
28
|
}));
|
|
27
29
|
const FeaturedIcon = (props) => {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const $ = c(8);
|
|
31
|
+
let children;
|
|
32
|
+
let rest;
|
|
33
|
+
if ($[0] !== props) {
|
|
34
|
+
({children, ...rest} = props);
|
|
35
|
+
$[0] = props;
|
|
36
|
+
$[1] = children;
|
|
37
|
+
$[2] = rest;
|
|
38
|
+
} else {
|
|
39
|
+
children = $[1];
|
|
40
|
+
rest = $[2];
|
|
41
|
+
}
|
|
42
|
+
let t0;
|
|
43
|
+
if ($[3] !== children) {
|
|
44
|
+
t0 = /* @__PURE__ */ jsx(Icon, { children });
|
|
45
|
+
$[3] = children;
|
|
46
|
+
$[4] = t0;
|
|
47
|
+
} else t0 = $[4];
|
|
48
|
+
let t1;
|
|
49
|
+
if ($[5] !== rest || $[6] !== t0) {
|
|
50
|
+
t1 = /* @__PURE__ */ jsx(IconWrapper, {
|
|
51
|
+
...rest,
|
|
52
|
+
children: t0
|
|
53
|
+
});
|
|
54
|
+
$[5] = rest;
|
|
55
|
+
$[6] = t0;
|
|
56
|
+
$[7] = t1;
|
|
57
|
+
} else t1 = $[7];
|
|
58
|
+
return t1;
|
|
32
59
|
};
|
|
33
60
|
|
|
34
61
|
//#endregion
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { isValidElement } from "react";
|
|
3
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/show/show.tsx
|
|
6
|
+
function Show(props) {
|
|
7
|
+
const $ = c(5);
|
|
8
|
+
const { when, fallback, children } = props;
|
|
9
|
+
if (!when) return fallback ?? null;
|
|
10
|
+
let t0;
|
|
11
|
+
if ($[0] !== children || $[1] !== when) {
|
|
12
|
+
t0 = typeof children === "function" ? children(when) : children;
|
|
13
|
+
$[0] = children;
|
|
14
|
+
$[1] = when;
|
|
15
|
+
$[2] = t0;
|
|
16
|
+
} else t0 = $[2];
|
|
17
|
+
const result = t0;
|
|
18
|
+
let t1;
|
|
19
|
+
if ($[3] !== result) {
|
|
20
|
+
t1 = isValidElement(result) ? result : /* @__PURE__ */ jsx(Fragment$1, { children: result });
|
|
21
|
+
$[3] = result;
|
|
22
|
+
$[4] = t1;
|
|
23
|
+
} else t1 = $[4];
|
|
24
|
+
return t1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Show as t };
|