@pyck/react 0.0.5 → 0.0.6
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-fJPHeX8N.js +62 -0
- package/dist/close-button-r3blTfSH.js +141 -0
- package/dist/components/avatar/index.js +96 -11
- package/dist/components/button/index.js +1 -1
- package/dist/components/carousel/index.js +35 -10
- package/dist/components/checkbox/index.js +103 -22
- package/dist/components/checkmark/index.js +1 -1
- package/dist/components/combobox/index.js +30 -6
- package/dist/components/data-list/index.js +19 -8
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/dialog/index.js +44 -13
- package/dist/components/display-date-value/index.js +2 -2
- package/dist/components/display-value/index.js +1 -1
- package/dist/components/drawer/index.js +17 -1
- package/dist/components/drilldown-menu/index.js +209 -78
- package/dist/components/field/index.js +89 -16
- package/dist/components/floating-panel/index.js +54 -43
- package/dist/components/form/index.js +115 -26
- package/dist/components/highlight/index.js +52 -14
- package/dist/components/icon/index.js +1 -1
- package/dist/components/image/index.js +27 -2
- package/dist/components/input/index.js +47 -4
- package/dist/components/input-group/index.js +56 -14
- package/dist/components/json-form-builder/index.js +245 -87
- package/dist/components/logo/index.js +46 -19
- package/dist/components/menu/index.js +28 -6
- package/dist/components/number-input/index.js +46 -7
- package/dist/components/page-header/index.js +45 -12
- package/dist/components/pagination/index.js +35 -13
- package/dist/components/progress/index.js +47 -8
- package/dist/components/progress-circle/index.js +66 -17
- package/dist/components/radio-group/index.js +47 -6
- package/dist/components/scroll-area/index.js +64 -9
- package/dist/components/segment-group/index.js +34 -5
- package/dist/components/select/index.js +85 -21
- package/dist/components/show/index.js +1 -1
- package/dist/components/skeleton/index.js +44 -4
- package/dist/components/slider/index.js +134 -37
- package/dist/components/spotlight/index.js +269 -125
- package/dist/components/steps/index.js +26 -12
- package/dist/components/switch/index.js +160 -29
- package/dist/components/table/index.js +370 -66
- package/dist/components/tags-input/index.js +17 -7
- package/dist/components/textarea/index.js +47 -4
- package/dist/components/toast/index.js +28 -22
- package/dist/components/tooltip/index.js +71 -14
- package/dist/components/tree-view/index.js +45 -8
- package/dist/display-date-value-BAU46P8s.js +40 -0
- package/dist/display-value-Bz71ZqgM.js +57 -0
- package/dist/{featured-icon-DPysOpSf.js → featured-icon-CKDv0xfF.js} +27 -4
- package/dist/show-DAysVQAC.js +27 -0
- package/dist/utils/index.js +164 -73
- package/package.json +5 -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,4 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { createStyleContext } from "@pyck/styled-system/jsx";
|
|
3
4
|
import { tagsInput } from "@pyck/styled-system/recipes";
|
|
4
5
|
import { XIcon } from "lucide-react";
|
|
@@ -35,13 +36,22 @@ const ItemPreview = withContext(TagsInput.ItemPreview, "itemPreview");
|
|
|
35
36
|
const ItemText = withContext(TagsInput.ItemText, "itemText");
|
|
36
37
|
const Label = withContext(TagsInput.Label, "label");
|
|
37
38
|
const Items = (props) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
const $ = c(5);
|
|
40
|
+
const context = useTagsInputContext();
|
|
41
|
+
let t0;
|
|
42
|
+
if ($[0] !== context.value || $[1] !== props) {
|
|
43
|
+
let t1;
|
|
44
|
+
if ($[3] !== props) {
|
|
45
|
+
t1 = (item, index) => <Item key={item} index={index} value={item} {...props}><ItemPreview><ItemText>{item}</ItemText><ItemDeleteTrigger /></ItemPreview><ItemInput /></Item>;
|
|
46
|
+
$[3] = props;
|
|
47
|
+
$[4] = t1;
|
|
48
|
+
} else t1 = $[4];
|
|
49
|
+
t0 = context.value.map(t1);
|
|
50
|
+
$[0] = context.value;
|
|
51
|
+
$[1] = props;
|
|
52
|
+
$[2] = t0;
|
|
53
|
+
} else t0 = $[2];
|
|
54
|
+
return t0;
|
|
45
55
|
};
|
|
46
56
|
|
|
47
57
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
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";
|
|
3
4
|
import { Field } from "@pyck/react/field";
|
|
@@ -11,11 +12,53 @@ const Textarea = styled(Field$1.Textarea, textarea);
|
|
|
11
12
|
//#endregion
|
|
12
13
|
//#region src/components/textarea/textarea-field.tsx
|
|
13
14
|
const TextareaField = (props) => {
|
|
14
|
-
const
|
|
15
|
+
const $ = c(17);
|
|
16
|
+
let disabled;
|
|
17
|
+
let helperText;
|
|
18
|
+
let hideLabel;
|
|
19
|
+
let label;
|
|
20
|
+
let name;
|
|
21
|
+
let textareaProps;
|
|
22
|
+
if ($[0] !== props) {
|
|
23
|
+
({name, label, hideLabel, helperText, disabled, ...textareaProps} = props);
|
|
24
|
+
$[0] = props;
|
|
25
|
+
$[1] = disabled;
|
|
26
|
+
$[2] = helperText;
|
|
27
|
+
$[3] = hideLabel;
|
|
28
|
+
$[4] = label;
|
|
29
|
+
$[5] = name;
|
|
30
|
+
$[6] = textareaProps;
|
|
31
|
+
} else {
|
|
32
|
+
disabled = $[1];
|
|
33
|
+
helperText = $[2];
|
|
34
|
+
hideLabel = $[3];
|
|
35
|
+
label = $[4];
|
|
36
|
+
name = $[5];
|
|
37
|
+
textareaProps = $[6];
|
|
38
|
+
}
|
|
15
39
|
const { control } = useFormContext();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
40
|
+
let t0;
|
|
41
|
+
if ($[7] !== disabled || $[8] !== helperText || $[9] !== hideLabel || $[10] !== label || $[11] !== textareaProps) {
|
|
42
|
+
t0 = (t1) => {
|
|
43
|
+
const { field, fieldState } = t1;
|
|
44
|
+
return <Field label={label} helperText={helperText} hideLabel={hideLabel} disabled={field.disabled || disabled} invalid={!!fieldState.error} errorText={fieldState.error?.message}><Textarea$1 {...textareaProps} name={field.name} value={field.value} onChange={field.onChange} onBlur={field.onBlur} /></Field>;
|
|
45
|
+
};
|
|
46
|
+
$[7] = disabled;
|
|
47
|
+
$[8] = helperText;
|
|
48
|
+
$[9] = hideLabel;
|
|
49
|
+
$[10] = label;
|
|
50
|
+
$[11] = textareaProps;
|
|
51
|
+
$[12] = t0;
|
|
52
|
+
} else t0 = $[12];
|
|
53
|
+
let t1;
|
|
54
|
+
if ($[13] !== control || $[14] !== name || $[15] !== t0) {
|
|
55
|
+
t1 = <Controller name={name} control={control} render={t0} />;
|
|
56
|
+
$[13] = control;
|
|
57
|
+
$[14] = name;
|
|
58
|
+
$[15] = t0;
|
|
59
|
+
$[16] = t1;
|
|
60
|
+
} else t1 = $[16];
|
|
61
|
+
return t1;
|
|
19
62
|
};
|
|
20
63
|
|
|
21
64
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
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";
|
|
@@ -32,12 +33,26 @@ const iconMap = {
|
|
|
32
33
|
error: CircleXIcon
|
|
33
34
|
};
|
|
34
35
|
const Indicator = forwardRef((props, ref) => {
|
|
36
|
+
const $ = c(7);
|
|
35
37
|
const toast = useToastContext();
|
|
36
38
|
const StatusIcon = iconMap[toast.type];
|
|
37
39
|
if (!StatusIcon) return null;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
let t0;
|
|
41
|
+
if ($[0] !== StatusIcon) {
|
|
42
|
+
t0 = <StatusIcon />;
|
|
43
|
+
$[0] = StatusIcon;
|
|
44
|
+
$[1] = t0;
|
|
45
|
+
} else t0 = $[1];
|
|
46
|
+
let t1;
|
|
47
|
+
if ($[2] !== props || $[3] !== ref || $[4] !== t0 || $[5] !== toast.type) {
|
|
48
|
+
t1 = <Icon ref={ref} data-type={toast.type} {...props}>{t0}</Icon>;
|
|
49
|
+
$[2] = props;
|
|
50
|
+
$[3] = ref;
|
|
51
|
+
$[4] = t0;
|
|
52
|
+
$[5] = toast.type;
|
|
53
|
+
$[6] = t1;
|
|
54
|
+
} else t1 = $[6];
|
|
55
|
+
return t1;
|
|
41
56
|
});
|
|
42
57
|
|
|
43
58
|
//#endregion
|
|
@@ -51,26 +66,17 @@ const toaster = createToaster({
|
|
|
51
66
|
});
|
|
52
67
|
const StyledToaster = styled(Toaster$1);
|
|
53
68
|
const Toaster = () => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<Stack gap="1">
|
|
62
|
-
{toast.title && <toast_exports.Title>{toast.title}</toast_exports.Title>}
|
|
63
|
-
{toast.description && <toast_exports.Description>{toast.description}</toast_exports.Description>}
|
|
64
|
-
</Stack>
|
|
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>;
|
|
69
|
+
const $ = c(1);
|
|
70
|
+
let t0;
|
|
71
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
72
|
+
t0 = <Portal><StyledToaster toaster={toaster} insetInline={{ mdDown: "4" }}>{_temp}</StyledToaster></Portal>;
|
|
73
|
+
$[0] = t0;
|
|
74
|
+
} else t0 = $[0];
|
|
75
|
+
return t0;
|
|
73
76
|
};
|
|
77
|
+
function _temp(toast) {
|
|
78
|
+
return <toast_exports.Root><Show when={toast.type === "loading"} fallback={<toast_exports.Indicator />}><Spinner /></Show><Stack gap="3" alignItems="start"><Stack gap="1">{toast.title && <toast_exports.Title>{toast.title}</toast_exports.Title>}{toast.description && <toast_exports.Description>{toast.description}</toast_exports.Description>}</Stack>{toast.action && <toast_exports.ActionTrigger>{toast.action.label}</toast_exports.ActionTrigger>}</Stack>{toast.closable && <toast_exports.CloseTrigger asChild={true}><CloseButton size="sm" /></toast_exports.CloseTrigger>}</toast_exports.Root>;
|
|
79
|
+
}
|
|
74
80
|
|
|
75
81
|
//#endregion
|
|
76
82
|
export { toast_exports as Toast, Toaster, toaster };
|
|
@@ -1,4 +1,5 @@
|
|
|
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 { tooltip } from "@pyck/styled-system/recipes";
|
|
@@ -29,21 +30,77 @@ const Trigger = withContext(Tooltip$1.Trigger, "trigger");
|
|
|
29
30
|
//#endregion
|
|
30
31
|
//#region src/components/tooltip/tooltip.closed.tsx
|
|
31
32
|
const Tooltip = forwardRef(function Tooltip(props, ref) {
|
|
32
|
-
const
|
|
33
|
+
const $ = c(26);
|
|
34
|
+
let children;
|
|
35
|
+
let content;
|
|
36
|
+
let contentProps;
|
|
37
|
+
let disabled;
|
|
38
|
+
let portalRef;
|
|
39
|
+
let rootProps;
|
|
40
|
+
let showArrow;
|
|
41
|
+
let t0;
|
|
42
|
+
if ($[0] !== props) {
|
|
43
|
+
({showArrow, children, disabled, portalled: t0, content, contentProps, portalRef, ...rootProps} = props);
|
|
44
|
+
$[0] = props;
|
|
45
|
+
$[1] = children;
|
|
46
|
+
$[2] = content;
|
|
47
|
+
$[3] = contentProps;
|
|
48
|
+
$[4] = disabled;
|
|
49
|
+
$[5] = portalRef;
|
|
50
|
+
$[6] = rootProps;
|
|
51
|
+
$[7] = showArrow;
|
|
52
|
+
$[8] = t0;
|
|
53
|
+
} else {
|
|
54
|
+
children = $[1];
|
|
55
|
+
content = $[2];
|
|
56
|
+
contentProps = $[3];
|
|
57
|
+
disabled = $[4];
|
|
58
|
+
portalRef = $[5];
|
|
59
|
+
rootProps = $[6];
|
|
60
|
+
showArrow = $[7];
|
|
61
|
+
t0 = $[8];
|
|
62
|
+
}
|
|
63
|
+
const portalled = t0 === void 0 ? true : t0;
|
|
33
64
|
if (disabled) return children;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
65
|
+
let t1;
|
|
66
|
+
if ($[9] !== children) {
|
|
67
|
+
t1 = <tooltip_exports.Trigger asChild={true}>{children}</tooltip_exports.Trigger>;
|
|
68
|
+
$[9] = children;
|
|
69
|
+
$[10] = t1;
|
|
70
|
+
} else t1 = $[10];
|
|
71
|
+
const t2 = !portalled;
|
|
72
|
+
let t3;
|
|
73
|
+
if ($[11] !== showArrow) {
|
|
74
|
+
t3 = showArrow && <tooltip_exports.Arrow><tooltip_exports.ArrowTip /></tooltip_exports.Arrow>;
|
|
75
|
+
$[11] = showArrow;
|
|
76
|
+
$[12] = t3;
|
|
77
|
+
} else t3 = $[12];
|
|
78
|
+
let t4;
|
|
79
|
+
if ($[13] !== content || $[14] !== contentProps || $[15] !== ref || $[16] !== t3) {
|
|
80
|
+
t4 = <tooltip_exports.Positioner><tooltip_exports.Content ref={ref} {...contentProps}>{t3}{content}</tooltip_exports.Content></tooltip_exports.Positioner>;
|
|
81
|
+
$[13] = content;
|
|
82
|
+
$[14] = contentProps;
|
|
83
|
+
$[15] = ref;
|
|
84
|
+
$[16] = t3;
|
|
85
|
+
$[17] = t4;
|
|
86
|
+
} else t4 = $[17];
|
|
87
|
+
let t5;
|
|
88
|
+
if ($[18] !== portalRef || $[19] !== t2 || $[20] !== t4) {
|
|
89
|
+
t5 = <Portal disabled={t2} container={portalRef}>{t4}</Portal>;
|
|
90
|
+
$[18] = portalRef;
|
|
91
|
+
$[19] = t2;
|
|
92
|
+
$[20] = t4;
|
|
93
|
+
$[21] = t5;
|
|
94
|
+
} else t5 = $[21];
|
|
95
|
+
let t6;
|
|
96
|
+
if ($[22] !== rootProps || $[23] !== t1 || $[24] !== t5) {
|
|
97
|
+
t6 = <tooltip_exports.Root {...rootProps}>{t1}{t5}</tooltip_exports.Root>;
|
|
98
|
+
$[22] = rootProps;
|
|
99
|
+
$[23] = t1;
|
|
100
|
+
$[24] = t5;
|
|
101
|
+
$[25] = t6;
|
|
102
|
+
} else t6 = $[25];
|
|
103
|
+
return t6;
|
|
47
104
|
});
|
|
48
105
|
|
|
49
106
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
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";
|
|
@@ -45,18 +46,54 @@ const Tree = withContext(TreeView.Tree, "tree");
|
|
|
45
46
|
const NodeCheckboxIndicator = TreeView.NodeCheckboxIndicator;
|
|
46
47
|
const StyledBranchIndicator = withContext(TreeView.BranchIndicator, "branchIndicator");
|
|
47
48
|
const BranchIndicator = forwardRef(function BranchIndicator(props, ref) {
|
|
49
|
+
const $ = c(8);
|
|
48
50
|
const node = useTreeViewNodeContext();
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
let t0;
|
|
52
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
53
|
+
t0 = <svg aria-hidden="true" focusable="false" />;
|
|
54
|
+
$[0] = t0;
|
|
55
|
+
} else t0 = $[0];
|
|
56
|
+
let t1;
|
|
57
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
58
|
+
t1 = <ChevronRightIcon />;
|
|
59
|
+
$[1] = t1;
|
|
60
|
+
} else t1 = $[1];
|
|
61
|
+
let t2;
|
|
62
|
+
if ($[2] !== props || $[3] !== ref) {
|
|
63
|
+
t2 = <StyledBranchIndicator ref={ref} {...props}>{t1}</StyledBranchIndicator>;
|
|
64
|
+
$[2] = props;
|
|
65
|
+
$[3] = ref;
|
|
66
|
+
$[4] = t2;
|
|
67
|
+
} else t2 = $[4];
|
|
68
|
+
let t3;
|
|
69
|
+
if ($[5] !== node.isBranch || $[6] !== t2) {
|
|
70
|
+
t3 = <Show when={node.isBranch} fallback={t0}>{t2}</Show>;
|
|
71
|
+
$[5] = node.isBranch;
|
|
72
|
+
$[6] = t2;
|
|
73
|
+
$[7] = t3;
|
|
74
|
+
} else t3 = $[7];
|
|
75
|
+
return t3;
|
|
54
76
|
});
|
|
55
77
|
const Checkbox = (props) => {
|
|
78
|
+
const $ = c(6);
|
|
56
79
|
const node = useTreeViewNodeContext();
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
80
|
+
const t0 = node.checked === true;
|
|
81
|
+
const t1 = node.checked === "indeterminate";
|
|
82
|
+
let t2;
|
|
83
|
+
if ($[0] !== t0 || $[1] !== t1) {
|
|
84
|
+
t2 = <Checkmark size="sm" checked={t0} indeterminate={t1} />;
|
|
85
|
+
$[0] = t0;
|
|
86
|
+
$[1] = t1;
|
|
87
|
+
$[2] = t2;
|
|
88
|
+
} else t2 = $[2];
|
|
89
|
+
let t3;
|
|
90
|
+
if ($[3] !== props || $[4] !== t2) {
|
|
91
|
+
t3 = <NodeCheckbox {...props}>{t2}</NodeCheckbox>;
|
|
92
|
+
$[3] = props;
|
|
93
|
+
$[4] = t2;
|
|
94
|
+
$[5] = t3;
|
|
95
|
+
} else t3 = $[5];
|
|
96
|
+
return t3;
|
|
60
97
|
};
|
|
61
98
|
|
|
62
99
|
//#endregion
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { t as DisplayValue } from "./display-value-Bz71ZqgM.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { formatDate, formatDateTime, getDateFormats, isString } from "@pyck/react/utils";
|
|
4
|
+
|
|
5
|
+
//#region src/components/display-date-value/display-date-value.tsx
|
|
6
|
+
const DisplayDateValue = (props) => {
|
|
7
|
+
const $ = c(8);
|
|
8
|
+
const { value, format, copyable, type: t0, locale: localeProp } = props;
|
|
9
|
+
const type = t0 === void 0 ? "date" : t0;
|
|
10
|
+
const locale = localeProp ?? "en-US";
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== format || $[1] !== locale || $[2] !== type) {
|
|
13
|
+
t1 = (date) => {
|
|
14
|
+
if (format && isString(format) && !isDateFormatKey(format, locale)) return formatDate(date, format, locale);
|
|
15
|
+
if (format && isDateFormatKey(format, locale)) return formatDate(date, getDateFormats(locale)[format], locale);
|
|
16
|
+
return formatDateTime(date, type, locale);
|
|
17
|
+
};
|
|
18
|
+
$[0] = format;
|
|
19
|
+
$[1] = locale;
|
|
20
|
+
$[2] = type;
|
|
21
|
+
$[3] = t1;
|
|
22
|
+
} else t1 = $[3];
|
|
23
|
+
const formatValue = t1;
|
|
24
|
+
let t2;
|
|
25
|
+
if ($[4] !== copyable || $[5] !== formatValue || $[6] !== value) {
|
|
26
|
+
t2 = <DisplayValue value={value} formatValue={formatValue} copyable={copyable} />;
|
|
27
|
+
$[4] = copyable;
|
|
28
|
+
$[5] = formatValue;
|
|
29
|
+
$[6] = value;
|
|
30
|
+
$[7] = t2;
|
|
31
|
+
} else t2 = $[7];
|
|
32
|
+
return t2;
|
|
33
|
+
};
|
|
34
|
+
const isDateFormatKey = (format, locale) => {
|
|
35
|
+
const formats = getDateFormats(locale);
|
|
36
|
+
return Object.keys(formats).includes(format);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { DisplayDateValue as t };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { HStack, VisuallyHidden } from "@pyck/styled-system/jsx";
|
|
3
|
+
import { isString } from "@pyck/react/utils";
|
|
4
|
+
import { Show } from "@pyck/react/show";
|
|
5
|
+
import { Clipboard } from "@pyck/react/clipboard";
|
|
6
|
+
import { Span } from "@pyck/react/span";
|
|
7
|
+
import { Wrap } from "@pyck/react/wrap";
|
|
8
|
+
|
|
9
|
+
//#region src/components/display-value/display-value.tsx
|
|
10
|
+
const DisplayValue = (props) => {
|
|
11
|
+
const $ = c(13);
|
|
12
|
+
const { value, copyable, formatValue } = props;
|
|
13
|
+
let t0;
|
|
14
|
+
if ($[0] !== formatValue || $[1] !== value) {
|
|
15
|
+
t0 = isNotEmpty(value) ? formatValue?.(value) ?? String(value) : null;
|
|
16
|
+
$[0] = formatValue;
|
|
17
|
+
$[1] = value;
|
|
18
|
+
$[2] = t0;
|
|
19
|
+
} else t0 = $[2];
|
|
20
|
+
const formattedValue = t0;
|
|
21
|
+
const t1 = formattedValue != null;
|
|
22
|
+
let t2;
|
|
23
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
24
|
+
t2 = <><Span color="fg.subtle" aria-hidden={true}>—</Span><VisuallyHidden>No value</VisuallyHidden></>;
|
|
25
|
+
$[3] = t2;
|
|
26
|
+
} else t2 = $[3];
|
|
27
|
+
let t3;
|
|
28
|
+
if ($[4] !== formattedValue) {
|
|
29
|
+
t3 = (children) => <Clipboard.Root value={formattedValue} timeout={400}><Clipboard.Trigger _hover={{ "& [data-part=\"indicator\"]": { opacity: 1 } }} _active={{ "& [data-part=\"indicator\"]": { opacity: 1 } }}><HStack><Clipboard.Indicator color="fg.subtle" opacity="0" /><Span>{children}</Span></HStack></Clipboard.Trigger></Clipboard.Root>;
|
|
30
|
+
$[4] = formattedValue;
|
|
31
|
+
$[5] = t3;
|
|
32
|
+
} else t3 = $[5];
|
|
33
|
+
let t4;
|
|
34
|
+
if ($[6] !== copyable || $[7] !== formattedValue || $[8] !== t3) {
|
|
35
|
+
t4 = <Wrap when={copyable} with={t3}>{formattedValue}</Wrap>;
|
|
36
|
+
$[6] = copyable;
|
|
37
|
+
$[7] = formattedValue;
|
|
38
|
+
$[8] = t3;
|
|
39
|
+
$[9] = t4;
|
|
40
|
+
} else t4 = $[9];
|
|
41
|
+
let t5;
|
|
42
|
+
if ($[10] !== t1 || $[11] !== t4) {
|
|
43
|
+
t5 = <Show when={t1} fallback={t2}>{t4}</Show>;
|
|
44
|
+
$[10] = t1;
|
|
45
|
+
$[11] = t4;
|
|
46
|
+
$[12] = t5;
|
|
47
|
+
} else t5 = $[12];
|
|
48
|
+
return t5;
|
|
49
|
+
};
|
|
50
|
+
const isNotEmpty = (value) => {
|
|
51
|
+
if (value == null) return false;
|
|
52
|
+
if (isString(value) || Array.isArray(value)) return value.length > 0;
|
|
53
|
+
return true;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { DisplayValue as t };
|
|
@@ -1,3 +1,4 @@
|
|
|
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";
|
|
@@ -25,10 +26,32 @@ const IconWrapper = styled("div", cva({
|
|
|
25
26
|
} } }
|
|
26
27
|
}));
|
|
27
28
|
const FeaturedIcon = (props) => {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const $ = c(8);
|
|
30
|
+
let children;
|
|
31
|
+
let rest;
|
|
32
|
+
if ($[0] !== props) {
|
|
33
|
+
({children, ...rest} = props);
|
|
34
|
+
$[0] = props;
|
|
35
|
+
$[1] = children;
|
|
36
|
+
$[2] = rest;
|
|
37
|
+
} else {
|
|
38
|
+
children = $[1];
|
|
39
|
+
rest = $[2];
|
|
40
|
+
}
|
|
41
|
+
let t0;
|
|
42
|
+
if ($[3] !== children) {
|
|
43
|
+
t0 = <Icon>{children}</Icon>;
|
|
44
|
+
$[3] = children;
|
|
45
|
+
$[4] = t0;
|
|
46
|
+
} else t0 = $[4];
|
|
47
|
+
let t1;
|
|
48
|
+
if ($[5] !== rest || $[6] !== t0) {
|
|
49
|
+
t1 = <IconWrapper {...rest}>{t0}</IconWrapper>;
|
|
50
|
+
$[5] = rest;
|
|
51
|
+
$[6] = t0;
|
|
52
|
+
$[7] = t1;
|
|
53
|
+
} else t1 = $[7];
|
|
54
|
+
return t1;
|
|
32
55
|
};
|
|
33
56
|
|
|
34
57
|
//#endregion
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { isValidElement } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/show/show.tsx
|
|
5
|
+
function Show(props) {
|
|
6
|
+
const $ = c(5);
|
|
7
|
+
const { when, fallback, children } = props;
|
|
8
|
+
if (!when) return fallback ?? null;
|
|
9
|
+
let t0;
|
|
10
|
+
if ($[0] !== children || $[1] !== when) {
|
|
11
|
+
t0 = typeof children === "function" ? children(when) : children;
|
|
12
|
+
$[0] = children;
|
|
13
|
+
$[1] = when;
|
|
14
|
+
$[2] = t0;
|
|
15
|
+
} else t0 = $[2];
|
|
16
|
+
const result = t0;
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[3] !== result) {
|
|
19
|
+
t1 = isValidElement(result) ? result : <>{result}</>;
|
|
20
|
+
$[3] = result;
|
|
21
|
+
$[4] = t1;
|
|
22
|
+
} else t1 = $[4];
|
|
23
|
+
return t1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { Show as t };
|