@plastic-js/tsumiki 0.1.22 → 0.1.24
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/README.md +838 -65
- package/dist/components/Accordion.js +93 -4
- package/dist/components/Avatar.js +96 -4
- package/dist/components/BottomSheet.js +131 -0
- package/dist/components/Button.js +194 -0
- package/dist/components/CardNumberInput.js +28 -44
- package/dist/components/Carousel.js +71 -5
- package/dist/components/Checkbox.js +178 -4
- package/dist/components/Clipboard.js +135 -5
- package/dist/components/CloseButton.js +97 -0
- package/dist/components/Collapsible.js +22 -4
- package/dist/components/ColorPicker.js +327 -4
- package/dist/components/Combobox.js +86 -13
- package/dist/components/ConfirmDialog.js +174 -19
- package/dist/components/DateInput.js +437 -5
- package/dist/components/{DatePickerMobile/wheel.js → DateWheel.js} +1 -3
- package/dist/components/Dialog.js +214 -110
- package/dist/components/Drawer.js +169 -4
- package/dist/components/Field.js +121 -5
- package/dist/components/Fieldset.js +64 -5
- package/dist/components/FileUpload.js +181 -4
- package/dist/components/FocusTrap.js +0 -2
- package/dist/components/Icon.js +32 -17
- package/dist/components/Input.js +211 -0
- package/dist/components/Listbox.js +47 -4
- package/dist/components/Menu.js +99 -4
- package/dist/components/MoneyInput.js +33 -85
- package/dist/components/NumberInput.js +117 -4
- package/dist/components/Pagination.js +91 -5
- package/dist/components/Popover.js +123 -4
- package/dist/components/Portal.js +0 -2
- package/dist/components/Presence.js +0 -2
- package/dist/components/Progress.js +107 -4
- package/dist/components/RadioGroup.js +104 -4
- package/dist/components/RatingGroup.js +75 -4
- package/dist/components/SearchInput.js +60 -55
- package/dist/components/Select.js +428 -5
- package/dist/components/SelectPc.js +239 -0
- package/dist/components/SignaturePad.js +77 -4
- package/dist/components/Skeleton.js +2 -4
- package/dist/components/Slider.js +112 -4
- package/dist/components/Spinner.js +41 -0
- package/dist/components/Splitter.js +51 -4
- package/dist/components/Steps.js +259 -4
- package/dist/components/SwipeReveal.js +2 -4
- package/dist/components/Switch.js +147 -4
- package/dist/components/Tabs.js +80 -4
- package/dist/components/TagsInput.js +128 -4
- package/dist/components/Toast.js +174 -4
- package/dist/components/Toggle.js +39 -4
- package/dist/components/ToggleGroup.js +103 -4
- package/dist/components/Tour.js +63 -4
- package/dist/components/TreeView.js +113 -4
- package/dist/index.js +44 -45
- package/dist/tsumiki.css +1 -0
- package/docs/api.md +670 -0
- package/docs/component-api-pattern.md +362 -0
- package/package.json +16 -6
- package/src/styles/color.css +112 -0
- package/src/styles/index.css +1 -0
- package/src/styles/radius.css +27 -0
- package/src/styles/reset.css +111 -0
- package/src/styles/shadow.css +5 -0
- package/src/styles/sizing.css +59 -0
- package/src/styles/spacing.css +9 -0
- package/src/styles/theme.css +38 -0
- package/src/styles/tokens.css +22 -0
- package/src/styles/transition.css +5 -0
- package/src/styles/typography.css +8 -0
- package/dist/components/Accordion.js.map +0 -1
- package/dist/components/Avatar.js.map +0 -1
- package/dist/components/CardNumberInput.js.map +0 -1
- package/dist/components/Carousel.js.map +0 -1
- package/dist/components/Checkbox.js.map +0 -1
- package/dist/components/Clipboard.js.map +0 -1
- package/dist/components/Collapsible.js.map +0 -1
- package/dist/components/ColorPicker.js.map +0 -1
- package/dist/components/Combobox.js.map +0 -1
- package/dist/components/ConfirmDialog.js.map +0 -1
- package/dist/components/DateInput.js.map +0 -1
- package/dist/components/DatePicker.js +0 -7
- package/dist/components/DatePicker.js.map +0 -1
- package/dist/components/DatePickerMobile/index.js +0 -479
- package/dist/components/DatePickerMobile/index.js.map +0 -1
- package/dist/components/DatePickerMobile/wheel.js.map +0 -1
- package/dist/components/Dialog.js.map +0 -1
- package/dist/components/Drawer.js.map +0 -1
- package/dist/components/Field.js.map +0 -1
- package/dist/components/Fieldset.js.map +0 -1
- package/dist/components/FileUpload.js.map +0 -1
- package/dist/components/FilterableSelect.js +0 -210
- package/dist/components/FilterableSelect.js.map +0 -1
- package/dist/components/FilterableSelectMobile.js +0 -167
- package/dist/components/FilterableSelectMobile.js.map +0 -1
- package/dist/components/FocusTrap.js.map +0 -1
- package/dist/components/HoverCard.js +0 -7
- package/dist/components/HoverCard.js.map +0 -1
- package/dist/components/Icon.js.map +0 -1
- package/dist/components/Listbox.js.map +0 -1
- package/dist/components/Menu.js.map +0 -1
- package/dist/components/MoneyInput.js.map +0 -1
- package/dist/components/NumberInput.js.map +0 -1
- package/dist/components/Pagination.js.map +0 -1
- package/dist/components/Popover.js.map +0 -1
- package/dist/components/Portal.js.map +0 -1
- package/dist/components/Presence.js.map +0 -1
- package/dist/components/Progress.js.map +0 -1
- package/dist/components/RadioGroup.js.map +0 -1
- package/dist/components/RatingGroup.js.map +0 -1
- package/dist/components/SearchInput.js.map +0 -1
- package/dist/components/Select.js.map +0 -1
- package/dist/components/SelectMobile/anatomy.js +0 -10
- package/dist/components/SelectMobile/anatomy.js.map +0 -1
- package/dist/components/SelectMobile/index.js +0 -310
- package/dist/components/SelectMobile/index.js.map +0 -1
- package/dist/components/SignaturePad.js.map +0 -1
- package/dist/components/Skeleton.js.map +0 -1
- package/dist/components/Slider.js.map +0 -1
- package/dist/components/Splitter.js.map +0 -1
- package/dist/components/Steps.js.map +0 -1
- package/dist/components/SwipeReveal.js.map +0 -1
- package/dist/components/Switch.js.map +0 -1
- package/dist/components/Tabs.js.map +0 -1
- package/dist/components/TagsInput.js.map +0 -1
- package/dist/components/Toast.js.map +0 -1
- package/dist/components/Toggle.js.map +0 -1
- package/dist/components/ToggleGroup.js.map +0 -1
- package/dist/components/Tooltip.js +0 -7
- package/dist/components/Tooltip.js.map +0 -1
- package/dist/components/Tour.js.map +0 -1
- package/dist/components/TreeView.js.map +0 -1
- package/dist/node_modules/framesync/dist/es/create-render-step.js +0 -54
- package/dist/node_modules/framesync/dist/es/create-render-step.js.map +0 -1
- package/dist/node_modules/framesync/dist/es/index.js +0 -61
- package/dist/node_modules/framesync/dist/es/index.js.map +0 -1
- package/dist/node_modules/framesync/dist/es/on-next-frame.js +0 -8
- package/dist/node_modules/framesync/dist/es/on-next-frame.js.map +0 -1
- package/dist/node_modules/hey-listen/dist/hey-listen.es.js +0 -15
- package/dist/node_modules/hey-listen/dist/hey-listen.es.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/animations/generators/decay.js +0 -24
- package/dist/node_modules/popmotion/dist/es/animations/generators/decay.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/animations/generators/keyframes.js +0 -40
- package/dist/node_modules/popmotion/dist/es/animations/generators/keyframes.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/animations/generators/spring.js +0 -96
- package/dist/node_modules/popmotion/dist/es/animations/generators/spring.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/animations/index.js +0 -94
- package/dist/node_modules/popmotion/dist/es/animations/index.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/animations/inertia.js +0 -74
- package/dist/node_modules/popmotion/dist/es/animations/inertia.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.js +0 -21
- package/dist/node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/animations/utils/elapsed.js +0 -14
- package/dist/node_modules/popmotion/dist/es/animations/utils/elapsed.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/animations/utils/find-spring.js +0 -68
- package/dist/node_modules/popmotion/dist/es/animations/utils/find-spring.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/easing/index.js +0 -28
- package/dist/node_modules/popmotion/dist/es/easing/index.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/easing/utils.js +0 -13
- package/dist/node_modules/popmotion/dist/es/easing/utils.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/utils/clamp.js +0 -6
- package/dist/node_modules/popmotion/dist/es/utils/clamp.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/utils/hsla-to-rgba.js +0 -35
- package/dist/node_modules/popmotion/dist/es/utils/hsla-to-rgba.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/utils/inc.js +0 -6
- package/dist/node_modules/popmotion/dist/es/utils/inc.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/utils/interpolate.js +0 -69
- package/dist/node_modules/popmotion/dist/es/utils/interpolate.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/utils/mix-color.js +0 -45
- package/dist/node_modules/popmotion/dist/es/utils/mix-color.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/utils/mix-complex.js +0 -61
- package/dist/node_modules/popmotion/dist/es/utils/mix-complex.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/utils/mix.js +0 -6
- package/dist/node_modules/popmotion/dist/es/utils/mix.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/utils/pipe.js +0 -7
- package/dist/node_modules/popmotion/dist/es/utils/pipe.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/utils/progress.js +0 -9
- package/dist/node_modules/popmotion/dist/es/utils/progress.js.map +0 -1
- package/dist/node_modules/popmotion/dist/es/utils/velocity-per-second.js +0 -8
- package/dist/node_modules/popmotion/dist/es/utils/velocity-per-second.js.map +0 -1
- package/dist/node_modules/popmotion/node_modules/tslib/tslib.es6.js +0 -13
- package/dist/node_modules/popmotion/node_modules/tslib/tslib.es6.js.map +0 -1
- package/dist/node_modules/style-value-types/dist/es/color/hex.js +0 -39
- package/dist/node_modules/style-value-types/dist/es/color/hex.js.map +0 -1
- package/dist/node_modules/style-value-types/dist/es/color/hsla.js +0 -16
- package/dist/node_modules/style-value-types/dist/es/color/hsla.js.map +0 -1
- package/dist/node_modules/style-value-types/dist/es/color/index.js +0 -20
- package/dist/node_modules/style-value-types/dist/es/color/index.js.map +0 -1
- package/dist/node_modules/style-value-types/dist/es/color/rgba.js +0 -15
- package/dist/node_modules/style-value-types/dist/es/color/rgba.js.map +0 -1
- package/dist/node_modules/style-value-types/dist/es/color/utils.js +0 -19
- package/dist/node_modules/style-value-types/dist/es/color/utils.js.map +0 -1
- package/dist/node_modules/style-value-types/dist/es/complex/index.js +0 -58
- package/dist/node_modules/style-value-types/dist/es/complex/index.js.map +0 -1
- package/dist/node_modules/style-value-types/dist/es/numbers/index.js +0 -13
- package/dist/node_modules/style-value-types/dist/es/numbers/index.js.map +0 -1
- package/dist/node_modules/style-value-types/dist/es/numbers/units.js +0 -16
- package/dist/node_modules/style-value-types/dist/es/numbers/units.js.map +0 -1
- package/dist/node_modules/style-value-types/dist/es/utils.js +0 -13
- package/dist/node_modules/style-value-types/dist/es/utils.js.map +0 -1
|
@@ -1,7 +1,110 @@
|
|
|
1
|
+
import { jsx, mergeProps } from "@plastic-js/plastic/jsx-runtime";
|
|
2
|
+
import { css, keyframes } from "@emotion/css";
|
|
1
3
|
import { Progress } from "@plastic-js/ark";
|
|
4
|
+
import { createContext, mergeProps as mergeProps$2, splitProps, useContext } from "@plastic-js/plastic";
|
|
2
5
|
//#region src/components/Progress.jsx
|
|
3
|
-
var
|
|
6
|
+
var ProgressCtx = createContext(() => ({
|
|
7
|
+
size: "md",
|
|
8
|
+
striped: false
|
|
9
|
+
}));
|
|
10
|
+
var stripeAnim = keyframes({
|
|
11
|
+
"0%": { backgroundPosition: "0 0" },
|
|
12
|
+
"100%": { backgroundPosition: "16px 0" }
|
|
13
|
+
});
|
|
14
|
+
var rootClass = css({
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column",
|
|
17
|
+
gap: "var(--tsu-spacing-sm)",
|
|
18
|
+
width: "100%"
|
|
19
|
+
});
|
|
20
|
+
var trackClass = css({
|
|
21
|
+
width: "100%",
|
|
22
|
+
backgroundColor: "var(--tsu-neutral-3)",
|
|
23
|
+
borderRadius: "999px",
|
|
24
|
+
overflow: "hidden"
|
|
25
|
+
});
|
|
26
|
+
var rangeClass = css({
|
|
27
|
+
height: "100%",
|
|
28
|
+
backgroundColor: "var(--tsu-accent-9)",
|
|
29
|
+
borderRadius: "999px",
|
|
30
|
+
transition: "width var(--tsu-transition-normal)"
|
|
31
|
+
});
|
|
32
|
+
var stripedClass = css({
|
|
33
|
+
backgroundImage: [
|
|
34
|
+
"linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%)",
|
|
35
|
+
"linear-gradient(-45deg, transparent 50%, rgba(255,255,255,0.15) 50%)",
|
|
36
|
+
"linear-gradient(-45deg, rgba(255,255,255,0.15) 75%, transparent 75%)",
|
|
37
|
+
"linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.15) 75%)"
|
|
38
|
+
].join(","),
|
|
39
|
+
backgroundSize: "16px 16px",
|
|
40
|
+
animation: `${stripeAnim} 1s linear infinite`
|
|
41
|
+
});
|
|
42
|
+
var labelClass = css({
|
|
43
|
+
fontSize: "var(--tsu-font-size-sm)",
|
|
44
|
+
color: "var(--tsu-neutral-11)",
|
|
45
|
+
fontWeight: 500
|
|
46
|
+
});
|
|
47
|
+
var sizeHeights = {
|
|
48
|
+
xs: "4px",
|
|
49
|
+
sm: "6px",
|
|
50
|
+
md: "8px",
|
|
51
|
+
lg: "12px",
|
|
52
|
+
xl: "16px"
|
|
53
|
+
};
|
|
54
|
+
var read = (v) => typeof v === "function" ? v() : v;
|
|
55
|
+
var ProgressLabel = (props = {}) => {
|
|
56
|
+
const [local, rest] = splitProps(props, ["className"]);
|
|
57
|
+
return jsx(Progress.Label, mergeProps(rest, { get className() {
|
|
58
|
+
return [labelClass, local.className].filter(Boolean).join(" ");
|
|
59
|
+
} }));
|
|
60
|
+
};
|
|
61
|
+
var ProgressRange = (props = {}) => {
|
|
62
|
+
const getCtx = useContext(ProgressCtx);
|
|
63
|
+
const [local, rest] = splitProps(props, ["className"]);
|
|
64
|
+
return () => {
|
|
65
|
+
const ctx = getCtx();
|
|
66
|
+
return jsx(Progress.Range, mergeProps(rest, { get className() {
|
|
67
|
+
return [
|
|
68
|
+
rangeClass,
|
|
69
|
+
ctx.striped && stripedClass,
|
|
70
|
+
local.className
|
|
71
|
+
].filter(Boolean).join(" ");
|
|
72
|
+
} }));
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
var Progress$1 = (props = {}) => {
|
|
76
|
+
const [local, rest] = splitProps(mergeProps$2({
|
|
77
|
+
size: "md",
|
|
78
|
+
striped: false
|
|
79
|
+
}, props), [
|
|
80
|
+
"size",
|
|
81
|
+
"striped",
|
|
82
|
+
"className",
|
|
83
|
+
"children",
|
|
84
|
+
"label"
|
|
85
|
+
]);
|
|
86
|
+
const size = read(local.size);
|
|
87
|
+
const height = sizeHeights[size];
|
|
88
|
+
return jsx(ProgressCtx.Provider, mergeProps({
|
|
89
|
+
value: () => ({
|
|
90
|
+
size,
|
|
91
|
+
striped: read(local.striped)
|
|
92
|
+
}),
|
|
93
|
+
children: () => jsx(Progress.Root, mergeProps(rest, {
|
|
94
|
+
get className() {
|
|
95
|
+
return [rootClass, local.className].filter(Boolean).join(" ");
|
|
96
|
+
},
|
|
97
|
+
children: [
|
|
98
|
+
() => read(local.label) && jsx(ProgressLabel, mergeProps({ children: () => read(local.label) })),
|
|
99
|
+
() => local.children,
|
|
100
|
+
jsx(Progress.Track, mergeProps({
|
|
101
|
+
className: trackClass,
|
|
102
|
+
style: { height },
|
|
103
|
+
children: jsx(ProgressRange, {})
|
|
104
|
+
}))
|
|
105
|
+
]
|
|
106
|
+
}))
|
|
107
|
+
}));
|
|
108
|
+
};
|
|
4
109
|
//#endregion
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=Progress.js.map
|
|
110
|
+
export { ProgressLabel, Progress$1 as default };
|
|
@@ -1,7 +1,107 @@
|
|
|
1
|
+
import { jsx, mergeProps } from "@plastic-js/plastic/jsx-runtime";
|
|
2
|
+
import { css } from "@emotion/css";
|
|
1
3
|
import { RadioGroup } from "@plastic-js/ark";
|
|
4
|
+
import { mergeProps as mergeProps$2, splitProps } from "@plastic-js/plastic";
|
|
2
5
|
//#region src/components/RadioGroup.jsx
|
|
3
|
-
var
|
|
6
|
+
var rootClass = css({
|
|
7
|
+
display: "flex",
|
|
8
|
+
flexDirection: "column",
|
|
9
|
+
gap: "var(--tsu-spacing-sm)",
|
|
10
|
+
"&[data-orientation=\"horizontal\"]": {
|
|
11
|
+
flexDirection: "row",
|
|
12
|
+
gap: "var(--tsu-spacing-xl)"
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var labelClass = css({
|
|
16
|
+
fontSize: "var(--tsu-comp-font-size-sm)",
|
|
17
|
+
fontWeight: 600,
|
|
18
|
+
color: "var(--tsu-fg)",
|
|
19
|
+
marginBottom: "var(--tsu-spacing-sm)"
|
|
20
|
+
});
|
|
21
|
+
var itemClass = css({
|
|
22
|
+
display: "flex",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
gap: "var(--tsu-spacing-sm)",
|
|
25
|
+
cursor: "pointer",
|
|
26
|
+
fontSize: "var(--tsu-comp-font-size-md)",
|
|
27
|
+
color: "var(--tsu-fg)",
|
|
28
|
+
touchAction: "manipulation",
|
|
29
|
+
WebkitTapHighlightColor: "transparent",
|
|
30
|
+
"&:active": { backgroundColor: "transparent" },
|
|
31
|
+
"&[data-disabled]": {
|
|
32
|
+
color: "var(--tsu-disabled-fg)",
|
|
33
|
+
cursor: "not-allowed"
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var itemControlClass = css({
|
|
37
|
+
width: "20px",
|
|
38
|
+
height: "20px",
|
|
39
|
+
borderRadius: "50%",
|
|
40
|
+
border: "2px solid var(--tsu-accent-8)",
|
|
41
|
+
background: "var(--tsu-bg)",
|
|
42
|
+
display: "flex",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
justifyContent: "center",
|
|
45
|
+
flexShrink: 0,
|
|
46
|
+
touchAction: "manipulation",
|
|
47
|
+
WebkitTapHighlightColor: "transparent",
|
|
48
|
+
transition: "border-color var(--tsu-transition-fast), background-color var(--tsu-transition-fast)",
|
|
49
|
+
"&:active": { backgroundColor: "transparent" },
|
|
50
|
+
"&[data-state=\"checked\"]": { borderColor: "var(--tsu-accent-9)" },
|
|
51
|
+
"&[data-disabled]": {
|
|
52
|
+
borderColor: "var(--tsu-disabled-border)",
|
|
53
|
+
background: "var(--tsu-disabled-bg)"
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
var indicatorClass = css({
|
|
57
|
+
width: "10px",
|
|
58
|
+
height: "10px",
|
|
59
|
+
borderRadius: "50%",
|
|
60
|
+
background: "var(--tsu-accent-9)",
|
|
61
|
+
"&[data-disabled]": { background: "var(--tsu-disabled-fg)" }
|
|
62
|
+
});
|
|
63
|
+
var RadioGroup$1 = (props = {}) => {
|
|
64
|
+
const [local, rest] = splitProps(mergeProps$2({}, props), [
|
|
65
|
+
"label",
|
|
66
|
+
"className",
|
|
67
|
+
"items"
|
|
68
|
+
]);
|
|
69
|
+
const classNames = [rootClass, local.className].filter(Boolean).join(" ");
|
|
70
|
+
return jsx(RadioGroup.Root, mergeProps(rest, {
|
|
71
|
+
className: classNames,
|
|
72
|
+
children: [() => local.label && jsx(RadioGroup.Label, mergeProps({
|
|
73
|
+
className: labelClass,
|
|
74
|
+
children: () => local.label
|
|
75
|
+
})), () => local.items?.map((item) => jsx(RadioGroup.Item, mergeProps({
|
|
76
|
+
get key() {
|
|
77
|
+
return item.value;
|
|
78
|
+
},
|
|
79
|
+
get value() {
|
|
80
|
+
return item.value;
|
|
81
|
+
},
|
|
82
|
+
get disabled() {
|
|
83
|
+
return item.disabled;
|
|
84
|
+
},
|
|
85
|
+
className: itemClass,
|
|
86
|
+
children: [
|
|
87
|
+
jsx(RadioGroup.ItemControl, mergeProps({
|
|
88
|
+
className: itemControlClass,
|
|
89
|
+
children: jsx(RadioGroup.Indicator, mergeProps({ className: indicatorClass }))
|
|
90
|
+
})),
|
|
91
|
+
jsx(RadioGroup.ItemText, mergeProps({ children: () => item.label })),
|
|
92
|
+
jsx(RadioGroup.ItemHiddenInput, {})
|
|
93
|
+
]
|
|
94
|
+
})))]
|
|
95
|
+
}));
|
|
96
|
+
};
|
|
97
|
+
RadioGroup$1.origin = {
|
|
98
|
+
Root: RadioGroup.Root,
|
|
99
|
+
Label: RadioGroup.Label,
|
|
100
|
+
Item: RadioGroup.Item,
|
|
101
|
+
ItemControl: RadioGroup.ItemControl,
|
|
102
|
+
ItemText: RadioGroup.ItemText,
|
|
103
|
+
ItemHiddenInput: RadioGroup.ItemHiddenInput,
|
|
104
|
+
Indicator: RadioGroup.Indicator
|
|
105
|
+
};
|
|
4
106
|
//#endregion
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=RadioGroup.js.map
|
|
107
|
+
export { RadioGroup$1 as default };
|
|
@@ -1,7 +1,78 @@
|
|
|
1
|
+
import { jsx, mergeProps, setProp, template } from "@plastic-js/plastic/jsx-runtime";
|
|
2
|
+
import { css } from "@emotion/css";
|
|
1
3
|
import { RatingGroup } from "@plastic-js/ark";
|
|
4
|
+
import { mergeProps as mergeProps$2, splitProps } from "@plastic-js/plastic";
|
|
2
5
|
//#region src/components/RatingGroup.jsx
|
|
3
|
-
var
|
|
6
|
+
var _tmpl = template("<div><svg viewBox=\"0 0 24 24\" fill=\"currentColor\" width=\"1em\" height=\"1em\" aria-hidden=\"true\"><path d=\"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.56 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z\"></path></svg></div>");
|
|
7
|
+
var rootClass = css({
|
|
8
|
+
display: "flex",
|
|
9
|
+
flexDirection: "column",
|
|
10
|
+
gap: "var(--tsu-spacing-xs)"
|
|
11
|
+
});
|
|
12
|
+
var labelClass = css({
|
|
13
|
+
fontSize: "var(--tsu-comp-font-size-sm)",
|
|
14
|
+
fontWeight: 500,
|
|
15
|
+
color: "var(--tsu-neutral-11)"
|
|
16
|
+
});
|
|
17
|
+
var controlClass = css({
|
|
18
|
+
display: "flex",
|
|
19
|
+
gap: "var(--tsu-spacing-xxs)"
|
|
20
|
+
});
|
|
21
|
+
var itemClass = css({
|
|
22
|
+
background: "none",
|
|
23
|
+
border: "none",
|
|
24
|
+
padding: 0,
|
|
25
|
+
cursor: "pointer",
|
|
26
|
+
lineHeight: 0,
|
|
27
|
+
color: "var(--tsu-neutral-6)",
|
|
28
|
+
transition: "color var(--tsu-transition-fast)",
|
|
29
|
+
"&[data-highlighted]": { color: "var(--tsu-warning-9)" },
|
|
30
|
+
"&[data-checked]": { color: "var(--tsu-warning-9)" },
|
|
31
|
+
"&[data-disabled]": {
|
|
32
|
+
opacity: .4,
|
|
33
|
+
cursor: "not-allowed",
|
|
34
|
+
pointerEvents: "none"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
var itemTextClass = css({
|
|
38
|
+
display: "block",
|
|
39
|
+
color: "inherit",
|
|
40
|
+
fontSize: "24px",
|
|
41
|
+
"& svg": { display: "block" }
|
|
42
|
+
});
|
|
43
|
+
var RatingGroup$1 = (props = {}) => {
|
|
44
|
+
const [local, rest] = splitProps(mergeProps$2({ count: 5 }, props), ["label", "className"]);
|
|
45
|
+
return jsx(RatingGroup.Root, mergeProps(rest, {
|
|
46
|
+
className: () => [rootClass, local.className].filter(Boolean).join(" "),
|
|
47
|
+
children: [
|
|
48
|
+
() => local.label && jsx(RatingGroup.Label, mergeProps({
|
|
49
|
+
className: labelClass,
|
|
50
|
+
children: () => local.label
|
|
51
|
+
})),
|
|
52
|
+
jsx(RatingGroup.Control, mergeProps({
|
|
53
|
+
className: controlClass,
|
|
54
|
+
children: () => Array.from({ length: rest.count }, (_, i) => jsx(RatingGroup.Item, mergeProps({
|
|
55
|
+
key: i,
|
|
56
|
+
index: i + 1,
|
|
57
|
+
className: itemClass,
|
|
58
|
+
children: (() => {
|
|
59
|
+
const _el0 = _tmpl.cloneNode(true);
|
|
60
|
+
setProp(_el0, "className", () => itemTextClass);
|
|
61
|
+
return _el0;
|
|
62
|
+
})()
|
|
63
|
+
})))
|
|
64
|
+
})),
|
|
65
|
+
jsx(RatingGroup.HiddenInput, {})
|
|
66
|
+
]
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
69
|
+
RatingGroup$1.origin = {
|
|
70
|
+
Root: RatingGroup.Root,
|
|
71
|
+
Label: RatingGroup.Label,
|
|
72
|
+
Control: RatingGroup.Control,
|
|
73
|
+
Item: RatingGroup.Item,
|
|
74
|
+
ItemText: RatingGroup.ItemText,
|
|
75
|
+
HiddenInput: RatingGroup.HiddenInput
|
|
76
|
+
};
|
|
4
77
|
//#endregion
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=RatingGroup.js.map
|
|
78
|
+
export { RatingGroup$1 as default };
|
|
@@ -1,66 +1,71 @@
|
|
|
1
|
+
import Input from "./Input.js";
|
|
1
2
|
import { insert, jsx, mergeProps, setProp, template } from "@plastic-js/plastic/jsx-runtime";
|
|
2
3
|
import { css } from "@emotion/css";
|
|
3
|
-
import { splitProps } from "@plastic-js/plastic";
|
|
4
|
+
import { createSignal, splitProps } from "@plastic-js/plastic";
|
|
4
5
|
//#region src/components/SearchInput.jsx
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
background: "
|
|
16
|
-
border: "
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
color: "var(--ink)",
|
|
20
|
-
fontSize: "15px",
|
|
21
|
-
fontFamily: "inherit",
|
|
22
|
-
outline: "none",
|
|
23
|
-
"&::placeholder": { color: "var(--muted)" },
|
|
24
|
-
"&:focus": { borderColor: "var(--accent)" }
|
|
25
|
-
});
|
|
26
|
-
var iconClass = css({
|
|
27
|
-
position: "absolute",
|
|
28
|
-
left: "13px",
|
|
29
|
-
top: "50%",
|
|
30
|
-
transform: "translateY(-50%)",
|
|
31
|
-
color: "var(--muted)",
|
|
32
|
-
pointerEvents: "none",
|
|
6
|
+
var _tmpl3 = template("<button type=\"button\" aria-label=\"Clear search\"></button>");
|
|
7
|
+
var _tmpl2 = template("<svg fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" viewBox=\"0 0 24 24\"><line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line></svg>");
|
|
8
|
+
var _tmpl = template("<svg fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" viewBox=\"0 0 24 24\"><circle cx=\"11\" cy=\"11\" r=\"7\"></circle><path d=\"M21 21l-4.35-4.35\"></path></svg>");
|
|
9
|
+
var clearButtonClass = css({
|
|
10
|
+
width: "28px",
|
|
11
|
+
height: "28px",
|
|
12
|
+
padding: "4px",
|
|
13
|
+
display: "flex",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
justifyContent: "center",
|
|
16
|
+
background: "none",
|
|
17
|
+
border: "none",
|
|
18
|
+
color: "inherit",
|
|
19
|
+
cursor: "pointer",
|
|
33
20
|
"& svg": {
|
|
34
|
-
width: "
|
|
35
|
-
height: "
|
|
36
|
-
}
|
|
21
|
+
width: "100%",
|
|
22
|
+
height: "100%"
|
|
23
|
+
},
|
|
24
|
+
"&:hover": { color: "var(--tsu-fg)" }
|
|
37
25
|
});
|
|
26
|
+
function SearchIcon() {
|
|
27
|
+
return _tmpl.cloneNode(true);
|
|
28
|
+
}
|
|
29
|
+
function XIcon() {
|
|
30
|
+
return _tmpl2.cloneNode(true);
|
|
31
|
+
}
|
|
38
32
|
var SearchInput = (props) => {
|
|
39
33
|
const [local, rest] = splitProps(props, ["placeholder", "onInput"]);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return local.placeholder ?? "Search...";
|
|
53
|
-
},
|
|
54
|
-
type: "search"
|
|
55
|
-
}, rest)), _el2);
|
|
56
|
-
setProp(_el0, "className", () => wrapperClass);
|
|
57
|
-
return _el0;
|
|
34
|
+
const hasValue = createSignal(false);
|
|
35
|
+
let inputEl = null;
|
|
36
|
+
const handleInput = (e) => {
|
|
37
|
+
hasValue(e.target.value.length > 0);
|
|
38
|
+
if (local.onInput) local.onInput(e);
|
|
39
|
+
};
|
|
40
|
+
const handleClear = () => {
|
|
41
|
+
if (!inputEl) return;
|
|
42
|
+
hasValue(false);
|
|
43
|
+
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value").set.call(inputEl, "");
|
|
44
|
+
inputEl.dispatchEvent(new Event("input", { bubbles: true }));
|
|
45
|
+
inputEl.focus();
|
|
58
46
|
};
|
|
47
|
+
return jsx(Input, mergeProps({
|
|
48
|
+
ref: (el) => {
|
|
49
|
+
inputEl = el;
|
|
50
|
+
},
|
|
51
|
+
type: "search",
|
|
52
|
+
size: "lg",
|
|
53
|
+
solid: true,
|
|
54
|
+
get placeholder() {
|
|
55
|
+
return local.placeholder ?? "Search...";
|
|
56
|
+
},
|
|
57
|
+
onInput: handleInput,
|
|
58
|
+
get prefix() {
|
|
59
|
+
return jsx(SearchIcon, {});
|
|
60
|
+
},
|
|
61
|
+
suffix: () => hasValue() ? () => {
|
|
62
|
+
const _el0 = _tmpl3.cloneNode(true);
|
|
63
|
+
insert(_el0, () => jsx(XIcon, {}));
|
|
64
|
+
setProp(_el0, "className", () => clearButtonClass);
|
|
65
|
+
setProp(_el0, "onClick", () => handleClear);
|
|
66
|
+
return _el0;
|
|
67
|
+
} : null
|
|
68
|
+
}, rest));
|
|
59
69
|
};
|
|
60
|
-
function SearchIcon() {
|
|
61
|
-
return _tmpl2.cloneNode(true);
|
|
62
|
-
}
|
|
63
70
|
//#endregion
|
|
64
71
|
export { SearchInput as default };
|
|
65
|
-
|
|
66
|
-
//# sourceMappingURL=SearchInput.js.map
|