@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.
Files changed (199) hide show
  1. package/README.md +838 -65
  2. package/dist/components/Accordion.js +93 -4
  3. package/dist/components/Avatar.js +96 -4
  4. package/dist/components/BottomSheet.js +131 -0
  5. package/dist/components/Button.js +194 -0
  6. package/dist/components/CardNumberInput.js +28 -44
  7. package/dist/components/Carousel.js +71 -5
  8. package/dist/components/Checkbox.js +178 -4
  9. package/dist/components/Clipboard.js +135 -5
  10. package/dist/components/CloseButton.js +97 -0
  11. package/dist/components/Collapsible.js +22 -4
  12. package/dist/components/ColorPicker.js +327 -4
  13. package/dist/components/Combobox.js +86 -13
  14. package/dist/components/ConfirmDialog.js +174 -19
  15. package/dist/components/DateInput.js +437 -5
  16. package/dist/components/{DatePickerMobile/wheel.js → DateWheel.js} +1 -3
  17. package/dist/components/Dialog.js +214 -110
  18. package/dist/components/Drawer.js +169 -4
  19. package/dist/components/Field.js +121 -5
  20. package/dist/components/Fieldset.js +64 -5
  21. package/dist/components/FileUpload.js +181 -4
  22. package/dist/components/FocusTrap.js +0 -2
  23. package/dist/components/Icon.js +32 -17
  24. package/dist/components/Input.js +211 -0
  25. package/dist/components/Listbox.js +47 -4
  26. package/dist/components/Menu.js +99 -4
  27. package/dist/components/MoneyInput.js +33 -85
  28. package/dist/components/NumberInput.js +117 -4
  29. package/dist/components/Pagination.js +91 -5
  30. package/dist/components/Popover.js +123 -4
  31. package/dist/components/Portal.js +0 -2
  32. package/dist/components/Presence.js +0 -2
  33. package/dist/components/Progress.js +107 -4
  34. package/dist/components/RadioGroup.js +104 -4
  35. package/dist/components/RatingGroup.js +75 -4
  36. package/dist/components/SearchInput.js +60 -55
  37. package/dist/components/Select.js +428 -5
  38. package/dist/components/SelectPc.js +239 -0
  39. package/dist/components/SignaturePad.js +77 -4
  40. package/dist/components/Skeleton.js +2 -4
  41. package/dist/components/Slider.js +112 -4
  42. package/dist/components/Spinner.js +41 -0
  43. package/dist/components/Splitter.js +51 -4
  44. package/dist/components/Steps.js +259 -4
  45. package/dist/components/SwipeReveal.js +2 -4
  46. package/dist/components/Switch.js +147 -4
  47. package/dist/components/Tabs.js +80 -4
  48. package/dist/components/TagsInput.js +128 -4
  49. package/dist/components/Toast.js +174 -4
  50. package/dist/components/Toggle.js +39 -4
  51. package/dist/components/ToggleGroup.js +103 -4
  52. package/dist/components/Tour.js +63 -4
  53. package/dist/components/TreeView.js +113 -4
  54. package/dist/index.js +44 -45
  55. package/dist/tsumiki.css +1 -0
  56. package/docs/api.md +670 -0
  57. package/docs/component-api-pattern.md +362 -0
  58. package/package.json +16 -6
  59. package/src/styles/color.css +112 -0
  60. package/src/styles/index.css +1 -0
  61. package/src/styles/radius.css +27 -0
  62. package/src/styles/reset.css +111 -0
  63. package/src/styles/shadow.css +5 -0
  64. package/src/styles/sizing.css +59 -0
  65. package/src/styles/spacing.css +9 -0
  66. package/src/styles/theme.css +38 -0
  67. package/src/styles/tokens.css +22 -0
  68. package/src/styles/transition.css +5 -0
  69. package/src/styles/typography.css +8 -0
  70. package/dist/components/Accordion.js.map +0 -1
  71. package/dist/components/Avatar.js.map +0 -1
  72. package/dist/components/CardNumberInput.js.map +0 -1
  73. package/dist/components/Carousel.js.map +0 -1
  74. package/dist/components/Checkbox.js.map +0 -1
  75. package/dist/components/Clipboard.js.map +0 -1
  76. package/dist/components/Collapsible.js.map +0 -1
  77. package/dist/components/ColorPicker.js.map +0 -1
  78. package/dist/components/Combobox.js.map +0 -1
  79. package/dist/components/ConfirmDialog.js.map +0 -1
  80. package/dist/components/DateInput.js.map +0 -1
  81. package/dist/components/DatePicker.js +0 -7
  82. package/dist/components/DatePicker.js.map +0 -1
  83. package/dist/components/DatePickerMobile/index.js +0 -479
  84. package/dist/components/DatePickerMobile/index.js.map +0 -1
  85. package/dist/components/DatePickerMobile/wheel.js.map +0 -1
  86. package/dist/components/Dialog.js.map +0 -1
  87. package/dist/components/Drawer.js.map +0 -1
  88. package/dist/components/Field.js.map +0 -1
  89. package/dist/components/Fieldset.js.map +0 -1
  90. package/dist/components/FileUpload.js.map +0 -1
  91. package/dist/components/FilterableSelect.js +0 -210
  92. package/dist/components/FilterableSelect.js.map +0 -1
  93. package/dist/components/FilterableSelectMobile.js +0 -167
  94. package/dist/components/FilterableSelectMobile.js.map +0 -1
  95. package/dist/components/FocusTrap.js.map +0 -1
  96. package/dist/components/HoverCard.js +0 -7
  97. package/dist/components/HoverCard.js.map +0 -1
  98. package/dist/components/Icon.js.map +0 -1
  99. package/dist/components/Listbox.js.map +0 -1
  100. package/dist/components/Menu.js.map +0 -1
  101. package/dist/components/MoneyInput.js.map +0 -1
  102. package/dist/components/NumberInput.js.map +0 -1
  103. package/dist/components/Pagination.js.map +0 -1
  104. package/dist/components/Popover.js.map +0 -1
  105. package/dist/components/Portal.js.map +0 -1
  106. package/dist/components/Presence.js.map +0 -1
  107. package/dist/components/Progress.js.map +0 -1
  108. package/dist/components/RadioGroup.js.map +0 -1
  109. package/dist/components/RatingGroup.js.map +0 -1
  110. package/dist/components/SearchInput.js.map +0 -1
  111. package/dist/components/Select.js.map +0 -1
  112. package/dist/components/SelectMobile/anatomy.js +0 -10
  113. package/dist/components/SelectMobile/anatomy.js.map +0 -1
  114. package/dist/components/SelectMobile/index.js +0 -310
  115. package/dist/components/SelectMobile/index.js.map +0 -1
  116. package/dist/components/SignaturePad.js.map +0 -1
  117. package/dist/components/Skeleton.js.map +0 -1
  118. package/dist/components/Slider.js.map +0 -1
  119. package/dist/components/Splitter.js.map +0 -1
  120. package/dist/components/Steps.js.map +0 -1
  121. package/dist/components/SwipeReveal.js.map +0 -1
  122. package/dist/components/Switch.js.map +0 -1
  123. package/dist/components/Tabs.js.map +0 -1
  124. package/dist/components/TagsInput.js.map +0 -1
  125. package/dist/components/Toast.js.map +0 -1
  126. package/dist/components/Toggle.js.map +0 -1
  127. package/dist/components/ToggleGroup.js.map +0 -1
  128. package/dist/components/Tooltip.js +0 -7
  129. package/dist/components/Tooltip.js.map +0 -1
  130. package/dist/components/Tour.js.map +0 -1
  131. package/dist/components/TreeView.js.map +0 -1
  132. package/dist/node_modules/framesync/dist/es/create-render-step.js +0 -54
  133. package/dist/node_modules/framesync/dist/es/create-render-step.js.map +0 -1
  134. package/dist/node_modules/framesync/dist/es/index.js +0 -61
  135. package/dist/node_modules/framesync/dist/es/index.js.map +0 -1
  136. package/dist/node_modules/framesync/dist/es/on-next-frame.js +0 -8
  137. package/dist/node_modules/framesync/dist/es/on-next-frame.js.map +0 -1
  138. package/dist/node_modules/hey-listen/dist/hey-listen.es.js +0 -15
  139. package/dist/node_modules/hey-listen/dist/hey-listen.es.js.map +0 -1
  140. package/dist/node_modules/popmotion/dist/es/animations/generators/decay.js +0 -24
  141. package/dist/node_modules/popmotion/dist/es/animations/generators/decay.js.map +0 -1
  142. package/dist/node_modules/popmotion/dist/es/animations/generators/keyframes.js +0 -40
  143. package/dist/node_modules/popmotion/dist/es/animations/generators/keyframes.js.map +0 -1
  144. package/dist/node_modules/popmotion/dist/es/animations/generators/spring.js +0 -96
  145. package/dist/node_modules/popmotion/dist/es/animations/generators/spring.js.map +0 -1
  146. package/dist/node_modules/popmotion/dist/es/animations/index.js +0 -94
  147. package/dist/node_modules/popmotion/dist/es/animations/index.js.map +0 -1
  148. package/dist/node_modules/popmotion/dist/es/animations/inertia.js +0 -74
  149. package/dist/node_modules/popmotion/dist/es/animations/inertia.js.map +0 -1
  150. package/dist/node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.js +0 -21
  151. package/dist/node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.js.map +0 -1
  152. package/dist/node_modules/popmotion/dist/es/animations/utils/elapsed.js +0 -14
  153. package/dist/node_modules/popmotion/dist/es/animations/utils/elapsed.js.map +0 -1
  154. package/dist/node_modules/popmotion/dist/es/animations/utils/find-spring.js +0 -68
  155. package/dist/node_modules/popmotion/dist/es/animations/utils/find-spring.js.map +0 -1
  156. package/dist/node_modules/popmotion/dist/es/easing/index.js +0 -28
  157. package/dist/node_modules/popmotion/dist/es/easing/index.js.map +0 -1
  158. package/dist/node_modules/popmotion/dist/es/easing/utils.js +0 -13
  159. package/dist/node_modules/popmotion/dist/es/easing/utils.js.map +0 -1
  160. package/dist/node_modules/popmotion/dist/es/utils/clamp.js +0 -6
  161. package/dist/node_modules/popmotion/dist/es/utils/clamp.js.map +0 -1
  162. package/dist/node_modules/popmotion/dist/es/utils/hsla-to-rgba.js +0 -35
  163. package/dist/node_modules/popmotion/dist/es/utils/hsla-to-rgba.js.map +0 -1
  164. package/dist/node_modules/popmotion/dist/es/utils/inc.js +0 -6
  165. package/dist/node_modules/popmotion/dist/es/utils/inc.js.map +0 -1
  166. package/dist/node_modules/popmotion/dist/es/utils/interpolate.js +0 -69
  167. package/dist/node_modules/popmotion/dist/es/utils/interpolate.js.map +0 -1
  168. package/dist/node_modules/popmotion/dist/es/utils/mix-color.js +0 -45
  169. package/dist/node_modules/popmotion/dist/es/utils/mix-color.js.map +0 -1
  170. package/dist/node_modules/popmotion/dist/es/utils/mix-complex.js +0 -61
  171. package/dist/node_modules/popmotion/dist/es/utils/mix-complex.js.map +0 -1
  172. package/dist/node_modules/popmotion/dist/es/utils/mix.js +0 -6
  173. package/dist/node_modules/popmotion/dist/es/utils/mix.js.map +0 -1
  174. package/dist/node_modules/popmotion/dist/es/utils/pipe.js +0 -7
  175. package/dist/node_modules/popmotion/dist/es/utils/pipe.js.map +0 -1
  176. package/dist/node_modules/popmotion/dist/es/utils/progress.js +0 -9
  177. package/dist/node_modules/popmotion/dist/es/utils/progress.js.map +0 -1
  178. package/dist/node_modules/popmotion/dist/es/utils/velocity-per-second.js +0 -8
  179. package/dist/node_modules/popmotion/dist/es/utils/velocity-per-second.js.map +0 -1
  180. package/dist/node_modules/popmotion/node_modules/tslib/tslib.es6.js +0 -13
  181. package/dist/node_modules/popmotion/node_modules/tslib/tslib.es6.js.map +0 -1
  182. package/dist/node_modules/style-value-types/dist/es/color/hex.js +0 -39
  183. package/dist/node_modules/style-value-types/dist/es/color/hex.js.map +0 -1
  184. package/dist/node_modules/style-value-types/dist/es/color/hsla.js +0 -16
  185. package/dist/node_modules/style-value-types/dist/es/color/hsla.js.map +0 -1
  186. package/dist/node_modules/style-value-types/dist/es/color/index.js +0 -20
  187. package/dist/node_modules/style-value-types/dist/es/color/index.js.map +0 -1
  188. package/dist/node_modules/style-value-types/dist/es/color/rgba.js +0 -15
  189. package/dist/node_modules/style-value-types/dist/es/color/rgba.js.map +0 -1
  190. package/dist/node_modules/style-value-types/dist/es/color/utils.js +0 -19
  191. package/dist/node_modules/style-value-types/dist/es/color/utils.js.map +0 -1
  192. package/dist/node_modules/style-value-types/dist/es/complex/index.js +0 -58
  193. package/dist/node_modules/style-value-types/dist/es/complex/index.js.map +0 -1
  194. package/dist/node_modules/style-value-types/dist/es/numbers/index.js +0 -13
  195. package/dist/node_modules/style-value-types/dist/es/numbers/index.js.map +0 -1
  196. package/dist/node_modules/style-value-types/dist/es/numbers/units.js +0 -16
  197. package/dist/node_modules/style-value-types/dist/es/numbers/units.js.map +0 -1
  198. package/dist/node_modules/style-value-types/dist/es/utils.js +0 -13
  199. package/dist/node_modules/style-value-types/dist/es/utils.js.map +0 -1
@@ -1,7 +1,123 @@
1
- import { Field } from "@plastic-js/ark";
1
+ import { insert, jsx, mergeProps, setProp, template } from "@plastic-js/plastic/jsx-runtime";
2
+ import { css } from "@emotion/css";
3
+ import { mergeProps as mergeProps$1, splitProps } from "@plastic-js/plastic";
2
4
  //#region src/components/Field.jsx
3
- var Field_default = Field;
5
+ var _tmpl4 = template("<p></p>");
6
+ var _tmpl3 = template("<div></div>");
7
+ var _tmpl2 = template("<span>*</span>");
8
+ var _tmpl = template("<span><!><!></span>");
9
+ var rootClass = css({
10
+ display: "flex",
11
+ flexDirection: "column",
12
+ gap: "var(--tsu-spacing-xs)"
13
+ });
14
+ var compactRootClass = css({
15
+ display: "flex",
16
+ flexDirection: "row",
17
+ alignItems: "center",
18
+ flexWrap: "wrap",
19
+ gap: "var(--tsu-spacing-xs)"
20
+ });
21
+ var labelClass = css({
22
+ fontSize: "var(--tsu-font-size-sm)",
23
+ fontWeight: 500,
24
+ color: "var(--tsu-fg)"
25
+ });
26
+ var compactLabelClass = css({
27
+ flexShrink: 0,
28
+ marginRight: "var(--tsu-spacing-sm)"
29
+ });
30
+ var inputWrapClass = css({
31
+ display: "flex",
32
+ flexDirection: "column",
33
+ flex: 1,
34
+ minWidth: 0,
35
+ gap: "var(--tsu-spacing-xs)"
36
+ });
37
+ var requiredClass = css({
38
+ color: "var(--tsu-danger-9)",
39
+ marginLeft: "var(--tsu-spacing-xxs)"
40
+ });
41
+ var errorTextClass = css({
42
+ fontSize: "var(--tsu-font-size-sm)",
43
+ color: "var(--tsu-danger-9)",
44
+ margin: 0,
45
+ flexBasis: "100%"
46
+ });
47
+ var helperTextClass = css({
48
+ fontSize: "var(--tsu-font-size-sm)",
49
+ color: "var(--tsu-neutral-11)",
50
+ margin: 0,
51
+ flexBasis: "100%"
52
+ });
53
+ var read = (v) => typeof v === "function" ? v() : v;
54
+ var Field = (props = {}) => {
55
+ const [local, rest] = splitProps(mergeProps$1({
56
+ label: "",
57
+ error: "",
58
+ helper: "",
59
+ required: false,
60
+ compact: false
61
+ }, props), [
62
+ "label",
63
+ "error",
64
+ "helper",
65
+ "required",
66
+ "compact",
67
+ "className",
68
+ "children"
69
+ ]);
70
+ const error = () => read(local.error);
71
+ const helper = () => read(local.helper);
72
+ const hasError = () => !!error();
73
+ const hasHelper = () => !!helper();
74
+ const isCompact = () => read(local.compact);
75
+ return jsx("div", mergeProps(rest, {
76
+ className: () => [isCompact() ? compactRootClass : rootClass, local.className].filter(Boolean).join(" "),
77
+ get "data-invalid"() {
78
+ return hasError() ? "" : void 0;
79
+ },
80
+ children: [
81
+ () => {
82
+ const label = read(local.label);
83
+ if (!label) return null;
84
+ return () => {
85
+ const _el0 = _tmpl.cloneNode(true);
86
+ const _el1 = _el0.firstChild;
87
+ const _el2 = _el0.firstChild.nextSibling;
88
+ insert(_el0, () => label, _el1);
89
+ insert(_el0, () => read(local.required) && (() => {
90
+ const _el0 = _tmpl2.cloneNode(true);
91
+ setProp(_el0, "className", () => requiredClass);
92
+ return _el0;
93
+ })(), _el2);
94
+ setProp(_el0, "className", () => [labelClass, isCompact() && compactLabelClass].filter(Boolean).join(" "));
95
+ return _el0;
96
+ };
97
+ },
98
+ () => isCompact() ? () => {
99
+ const _el0 = _tmpl3.cloneNode(true);
100
+ insert(_el0, () => local.children);
101
+ setProp(_el0, "className", () => inputWrapClass);
102
+ return _el0;
103
+ } : local.children,
104
+ () => {
105
+ if (hasError()) return () => {
106
+ const _el0 = _tmpl4.cloneNode(true);
107
+ insert(_el0, () => error());
108
+ setProp(_el0, "className", () => errorTextClass);
109
+ return _el0;
110
+ };
111
+ if (hasHelper()) return () => {
112
+ const _el0 = _tmpl4.cloneNode(true);
113
+ insert(_el0, () => helper());
114
+ setProp(_el0, "className", () => helperTextClass);
115
+ return _el0;
116
+ };
117
+ return null;
118
+ }
119
+ ]
120
+ }));
121
+ };
4
122
  //#endregion
5
- export { Field_default as default };
6
-
7
- //# sourceMappingURL=Field.js.map
123
+ export { Field as default };
@@ -1,7 +1,66 @@
1
- import { Fieldset } from "@plastic-js/ark";
1
+ import { insert, jsx, mergeProps, setProp, template } from "@plastic-js/plastic/jsx-runtime";
2
+ import { css } from "@emotion/css";
3
+ import { mergeProps as mergeProps$1, splitProps } from "@plastic-js/plastic";
2
4
  //#region src/components/Fieldset.jsx
3
- var Fieldset_default = Fieldset;
5
+ var _tmpl2 = template("<p></p>");
6
+ var _tmpl = template("<div></div>");
7
+ var rootClass = css({
8
+ display: "flex",
9
+ flexDirection: "column",
10
+ gap: "var(--tsu-spacing-xs)",
11
+ border: "1px solid var(--tsu-neutral-7)",
12
+ borderRadius: "var(--tsu-radius-l1-md)",
13
+ padding: "var(--tsu-spacing-lg)"
14
+ });
15
+ var legendClass = css({
16
+ fontSize: "var(--tsu-font-size-md)",
17
+ fontWeight: 600,
18
+ color: "var(--tsu-fg)",
19
+ padding: 0,
20
+ margin: 0
21
+ });
22
+ var helperClass = css({
23
+ fontSize: "var(--tsu-font-size-sm)",
24
+ color: "var(--tsu-neutral-11)",
25
+ margin: 0
26
+ });
27
+ var read = (v) => typeof v === "function" ? v() : v;
28
+ var Fieldset = (props = {}) => {
29
+ const [local, rest] = splitProps(mergeProps$1({
30
+ legend: "",
31
+ helper: ""
32
+ }, props), [
33
+ "legend",
34
+ "helper",
35
+ "className",
36
+ "children"
37
+ ]);
38
+ return jsx("div", mergeProps(rest, {
39
+ className: () => [rootClass, local.className].filter(Boolean).join(" "),
40
+ children: [
41
+ () => {
42
+ const legend = read(local.legend);
43
+ if (!legend) return null;
44
+ return () => {
45
+ const _el0 = _tmpl.cloneNode(true);
46
+ insert(_el0, () => legend);
47
+ setProp(_el0, "className", () => legendClass);
48
+ return _el0;
49
+ };
50
+ },
51
+ () => local.children,
52
+ () => {
53
+ const helper = read(local.helper);
54
+ if (!helper) return null;
55
+ return () => {
56
+ const _el0 = _tmpl2.cloneNode(true);
57
+ insert(_el0, () => helper);
58
+ setProp(_el0, "className", () => helperClass);
59
+ return _el0;
60
+ };
61
+ }
62
+ ]
63
+ }));
64
+ };
4
65
  //#endregion
5
- export { Fieldset_default as default };
6
-
7
- //# sourceMappingURL=Fieldset.js.map
66
+ export { Fieldset as default };
@@ -1,7 +1,184 @@
1
+ import { jsx, mergeProps, setProp, template } from "@plastic-js/plastic/jsx-runtime";
2
+ import { css } from "@emotion/css";
1
3
  import { FileUpload } from "@plastic-js/ark";
4
+ import { splitProps } from "@plastic-js/plastic";
2
5
  //#region src/components/FileUpload.jsx
3
- var FileUpload_default = FileUpload;
6
+ var _tmpl2 = template("<span>Drop files here or click to browse</span>");
7
+ var _tmpl = template("<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"M18 6 6 18M6 6l12 12\"></path></svg>");
8
+ var read = (v) => typeof v === "function" ? v() : v;
9
+ var formatSize = (bytes) => {
10
+ if (bytes < 1024) return `${bytes} B`;
11
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
12
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
13
+ };
14
+ var rootClass = css({
15
+ display: "flex",
16
+ flexDirection: "column",
17
+ gap: "var(--tsu-spacing-md)"
18
+ });
19
+ var dropzoneClass = css({
20
+ display: "flex",
21
+ flexDirection: "column",
22
+ alignItems: "center",
23
+ justifyContent: "center",
24
+ gap: "var(--tsu-spacing-sm)",
25
+ padding: "var(--tsu-spacing-xl)",
26
+ border: "2px dashed var(--tsu-accent-7)",
27
+ borderRadius: "var(--tsu-radius-l2-md)",
28
+ backgroundColor: "var(--tsu-bg)",
29
+ cursor: "pointer",
30
+ minHeight: "120px",
31
+ transition: "border-color var(--tsu-transition-fast), background-color var(--tsu-transition-fast)",
32
+ touchAction: "manipulation",
33
+ "&[data-disabled]": {
34
+ opacity: .5,
35
+ cursor: "not-allowed",
36
+ pointerEvents: "none"
37
+ }
38
+ });
39
+ var dropzoneTextClass = css({
40
+ fontSize: "var(--tsu-font-size-sm)",
41
+ color: "var(--tsu-neutral-9)",
42
+ textAlign: "center"
43
+ });
44
+ var itemGroupClass = css({
45
+ display: "flex",
46
+ flexDirection: "column",
47
+ gap: "var(--tsu-spacing-sm)",
48
+ listStyle: "none",
49
+ margin: 0,
50
+ padding: 0
51
+ });
52
+ var itemClass = css({
53
+ display: "flex",
54
+ alignItems: "center",
55
+ gap: "var(--tsu-spacing-sm)",
56
+ padding: "var(--tsu-spacing-sm) var(--tsu-spacing-md)",
57
+ backgroundColor: "var(--tsu-bg)",
58
+ border: "1px solid var(--tsu-neutral-5)",
59
+ borderRadius: "var(--tsu-radius-l2-md)"
60
+ });
61
+ var itemNameClass = css({
62
+ flex: 1,
63
+ fontSize: "var(--tsu-font-size-sm)",
64
+ color: "var(--tsu-fg)",
65
+ whiteSpace: "nowrap",
66
+ overflow: "hidden",
67
+ textOverflow: "ellipsis"
68
+ });
69
+ var itemSizeTextClass = css({
70
+ fontSize: "var(--tsu-font-size-xs)",
71
+ color: "var(--tsu-neutral-9)",
72
+ marginTop: "var(--tsu-spacing-xxs)"
73
+ });
74
+ var itemDeleteClass = css({
75
+ display: "flex",
76
+ alignItems: "center",
77
+ justifyContent: "center",
78
+ width: "var(--tsu-level-primary-sm)",
79
+ height: "var(--tsu-level-primary-sm)",
80
+ flexShrink: 0,
81
+ border: "none",
82
+ background: "none",
83
+ color: "var(--tsu-neutral-9)",
84
+ cursor: "pointer",
85
+ borderRadius: "var(--tsu-radius-l1-md)",
86
+ padding: 0
87
+ });
88
+ var clearClass = css({
89
+ display: "inline-flex",
90
+ alignItems: "center",
91
+ gap: "var(--tsu-spacing-xs)",
92
+ padding: "var(--tsu-spacing-sm) var(--tsu-spacing-md)",
93
+ border: "1px solid var(--tsu-neutral-7)",
94
+ borderRadius: "var(--tsu-radius-l2-md)",
95
+ backgroundColor: "var(--tsu-bg)",
96
+ color: "var(--tsu-neutral-11)",
97
+ fontSize: "var(--tsu-font-size-sm)",
98
+ cursor: "pointer",
99
+ fontFamily: "inherit",
100
+ touchAction: "manipulation",
101
+ "&:disabled": {
102
+ opacity: .5,
103
+ cursor: "not-allowed"
104
+ }
105
+ });
106
+ var deleteIcon = _tmpl.cloneNode(true);
107
+ var FileUpload$1 = (props = {}) => {
108
+ const [local, rest] = splitProps(props, ["className", "children"]);
109
+ return jsx(FileUpload.Root, mergeProps(rest, {
110
+ get className() {
111
+ return [rootClass, local.className].filter(Boolean).join(" ");
112
+ },
113
+ children: [
114
+ jsx(FileUpload.Dropzone, mergeProps({
115
+ className: dropzoneClass,
116
+ children: (() => {
117
+ const _el0 = _tmpl2.cloneNode(true);
118
+ setProp(_el0, "className", () => dropzoneTextClass);
119
+ return _el0;
120
+ })()
121
+ })),
122
+ () => local.children,
123
+ jsx(FileUpload.HiddenInput, {})
124
+ ]
125
+ }));
126
+ };
127
+ var FileUploadItemGroup = (props = {}) => {
128
+ const [local, rest] = splitProps(props, ["className", "children"]);
129
+ return jsx(FileUpload.ItemGroup, mergeProps(rest, {
130
+ get className() {
131
+ return [itemGroupClass, local.className].filter(Boolean).join(" ");
132
+ },
133
+ children: () => local.children
134
+ }));
135
+ };
136
+ var FileUploadItem = (props = {}) => {
137
+ const [local, rest] = splitProps(props, ["className", "file"]);
138
+ return jsx(FileUpload.Item, mergeProps(rest, {
139
+ get file() {
140
+ return local.file;
141
+ },
142
+ get className() {
143
+ return [itemClass, local.className].filter(Boolean).join(" ");
144
+ },
145
+ children: [
146
+ jsx(FileUpload.ItemName, mergeProps({
147
+ className: itemNameClass,
148
+ children: () => read(local.file).name
149
+ })),
150
+ jsx(FileUpload.ItemSizeText, mergeProps({
151
+ className: itemSizeTextClass,
152
+ children: () => formatSize(read(local.file).size)
153
+ })),
154
+ jsx(FileUpload.ItemDeleteTrigger, mergeProps({
155
+ className: itemDeleteClass,
156
+ children: deleteIcon
157
+ }))
158
+ ]
159
+ }));
160
+ };
161
+ var FileUploadClearTrigger = (props = {}) => {
162
+ const [local, rest] = splitProps(props, ["className", "children"]);
163
+ return jsx(FileUpload.ClearTrigger, mergeProps(rest, {
164
+ get className() {
165
+ return [clearClass, local.className].filter(Boolean).join(" ");
166
+ },
167
+ children: () => local.children || "Clear"
168
+ }));
169
+ };
170
+ FileUpload$1.origin = {
171
+ Root: FileUpload.Root,
172
+ Label: FileUpload.Label,
173
+ Dropzone: FileUpload.Dropzone,
174
+ Trigger: FileUpload.Trigger,
175
+ ItemGroup: FileUpload.ItemGroup,
176
+ Item: FileUpload.Item,
177
+ ItemName: FileUpload.ItemName,
178
+ ItemSizeText: FileUpload.ItemSizeText,
179
+ ItemDeleteTrigger: FileUpload.ItemDeleteTrigger,
180
+ ClearTrigger: FileUpload.ClearTrigger,
181
+ HiddenInput: FileUpload.HiddenInput
182
+ };
4
183
  //#endregion
5
- export { FileUpload_default as default };
6
-
7
- //# sourceMappingURL=FileUpload.js.map
184
+ export { FileUploadClearTrigger, FileUploadItem, FileUploadItemGroup, FileUpload$1 as default };
@@ -3,5 +3,3 @@ import { FocusTrap } from "@plastic-js/ark";
3
3
  var FocusTrap_default = FocusTrap;
4
4
  //#endregion
5
5
  export { FocusTrap_default as default };
6
-
7
- //# sourceMappingURL=FocusTrap.js.map
@@ -1,7 +1,9 @@
1
1
  import { setProp, template } from "@plastic-js/plastic/jsx-runtime";
2
2
  import { css } from "@emotion/css";
3
+ import { mergeProps as mergeProps$1, splitProps } from "@plastic-js/plastic";
3
4
  //#region src/components/Icon.jsx
4
5
  var _tmpl = template("<span></span>");
6
+ var read = (v) => typeof v === "function" ? v() : v;
5
7
  var iconClass = css({
6
8
  display: "inline-flex",
7
9
  alignItems: "center",
@@ -14,24 +16,37 @@ var iconClass = css({
14
16
  strokeWidth: "var(--icon-sw)"
15
17
  }
16
18
  });
17
- var Icon = ({ svg, size = 22, strokeWidth = 1.25, className }) => {
18
- const style = {
19
- width: `${size}px`,
20
- height: `${size}px`,
21
- "--icon-sw": strokeWidth
19
+ var Icon = (props = {}) => {
20
+ const [local] = splitProps(mergeProps$1({
21
+ size: 22,
22
+ strokeWidth: 1.25
23
+ }, props), [
24
+ "svg",
25
+ "size",
26
+ "strokeWidth",
27
+ "className"
28
+ ]);
29
+ return () => {
30
+ const svgContent = read(local.svg);
31
+ const s = read(local.size);
32
+ const sw = read(local.strokeWidth);
33
+ const cls = read(local.className);
34
+ const style = {
35
+ width: `${s}px`,
36
+ height: `${s}px`,
37
+ "--icon-sw": sw
38
+ };
39
+ const setEl = (el) => {
40
+ if (el && el.innerHTML !== svgContent) el.innerHTML = svgContent;
41
+ };
42
+ return (() => {
43
+ const _el0 = _tmpl.cloneNode(true);
44
+ setProp(_el0, "className", () => cls ? `${iconClass} ${cls}` : iconClass);
45
+ setProp(_el0, "ref", () => setEl);
46
+ setProp(_el0, "style", () => style);
47
+ return _el0;
48
+ })();
22
49
  };
23
- const setEl = (el) => {
24
- if (el && el.innerHTML !== svg) el.innerHTML = svg;
25
- };
26
- return (() => {
27
- const _el0 = _tmpl.cloneNode(true);
28
- setProp(_el0, "className", () => className ? `${iconClass} ${className}` : iconClass);
29
- setProp(_el0, "ref", () => setEl);
30
- setProp(_el0, "style", () => style);
31
- return _el0;
32
- })();
33
50
  };
34
51
  //#endregion
35
52
  export { Icon as default };
36
-
37
- //# sourceMappingURL=Icon.js.map
@@ -0,0 +1,211 @@
1
+ import { insert, jsx, mergeProps, setProp, template } from "@plastic-js/plastic/jsx-runtime";
2
+ import { css } from "@emotion/css";
3
+ import { createSignal, mergeProps as mergeProps$1, splitProps } from "@plastic-js/plastic";
4
+ import { ark } from "@plastic-js/ark/factory";
5
+ //#region src/components/Input.jsx
6
+ var _tmpl5 = template("<svg fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" viewBox=\"0 0 24 24\"><path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"></path><circle cx=\"12\" cy=\"12\" r=\"3\"></circle></svg>");
7
+ var _tmpl4 = template("<svg fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" viewBox=\"0 0 24 24\"><path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94\"></path><path d=\"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19\"></path><line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\"></line></svg>");
8
+ var _tmpl3 = template("<button type=\"button\"></button>");
9
+ var _tmpl2 = template("<div><!><!><!></div>");
10
+ var _tmpl = template("<span></span>");
11
+ var wrapperClass = css({
12
+ display: "flex",
13
+ alignItems: "center",
14
+ width: "100%",
15
+ gap: "var(--tsu-spacing-xs)",
16
+ fontFamily: "inherit",
17
+ transition: "background-color var(--tsu-transition-fast), border-color var(--tsu-transition-fast)"
18
+ });
19
+ var sizeClasses = {
20
+ xs: css({
21
+ height: "var(--tsu-comp-height-xs)",
22
+ padding: "var(--tsu-comp-padding-y-xs) var(--tsu-comp-padding-x-xs)",
23
+ fontSize: "var(--tsu-comp-font-size-xs)",
24
+ borderRadius: "var(--tsu-radius-l1-xs)"
25
+ }),
26
+ sm: css({
27
+ height: "var(--tsu-comp-height-sm)",
28
+ padding: "var(--tsu-comp-padding-y-sm) var(--tsu-comp-padding-x-sm)",
29
+ fontSize: "var(--tsu-comp-font-size-sm)",
30
+ borderRadius: "var(--tsu-radius-l1-sm)"
31
+ }),
32
+ md: css({
33
+ height: "var(--tsu-comp-height-md)",
34
+ padding: "var(--tsu-comp-padding-y-md) var(--tsu-comp-padding-x-md)",
35
+ fontSize: "var(--tsu-comp-font-size-md)",
36
+ borderRadius: "var(--tsu-radius-l1-md)"
37
+ }),
38
+ lg: css({
39
+ height: "var(--tsu-comp-height-lg)",
40
+ padding: "var(--tsu-comp-padding-y-lg) var(--tsu-comp-padding-x-lg)",
41
+ fontSize: "var(--tsu-comp-font-size-lg)",
42
+ borderRadius: "var(--tsu-radius-l1-lg)"
43
+ }),
44
+ xl: css({
45
+ height: "var(--tsu-comp-height-xl)",
46
+ padding: "var(--tsu-comp-padding-y-xl) var(--tsu-comp-padding-x-xl)",
47
+ fontSize: "var(--tsu-comp-font-size-xl)",
48
+ borderRadius: "var(--tsu-radius-l1-xl)"
49
+ })
50
+ };
51
+ var variantClasses = {
52
+ solid: css({
53
+ backgroundColor: "var(--tsu-neutral-3)",
54
+ border: "1px solid transparent",
55
+ color: "var(--tsu-fg)",
56
+ "&:focus-within": {
57
+ backgroundColor: "var(--tsu-focus-bg)",
58
+ borderColor: "var(--tsu-focus-border)"
59
+ }
60
+ }),
61
+ outline: css({
62
+ backgroundColor: "var(--tsu-bg)",
63
+ border: "1px solid var(--tsu-accent-8)",
64
+ color: "var(--tsu-fg)",
65
+ "&:focus-within": {
66
+ backgroundColor: "var(--tsu-focus-bg)",
67
+ borderColor: "var(--tsu-focus-border)"
68
+ }
69
+ })
70
+ };
71
+ var errorClass = css({
72
+ borderColor: "var(--tsu-danger-9) !important",
73
+ "&:focus-within": { borderColor: "var(--tsu-danger-9) !important" }
74
+ });
75
+ var disabledClass = css({
76
+ backgroundColor: "var(--tsu-disabled-bg) !important",
77
+ borderColor: "var(--tsu-disabled-border) !important",
78
+ color: "var(--tsu-disabled-fg) !important",
79
+ cursor: "not-allowed"
80
+ });
81
+ var inputClass = css({
82
+ flex: 1,
83
+ minWidth: 0,
84
+ border: "none",
85
+ outline: "none",
86
+ background: "transparent",
87
+ fontFamily: "inherit",
88
+ fontSize: "inherit",
89
+ color: "inherit",
90
+ padding: 0,
91
+ "&::placeholder": { color: "var(--tsu-neutral-11)" }
92
+ });
93
+ var affixClass = css({
94
+ flexShrink: 0,
95
+ display: "inline-flex",
96
+ alignItems: "center",
97
+ color: "var(--tsu-neutral-11)",
98
+ userSelect: "none",
99
+ "& > svg": {
100
+ width: "1.3em",
101
+ height: "1.3em",
102
+ display: "block"
103
+ }
104
+ });
105
+ var eyeButtonClass = css({
106
+ flexShrink: 0,
107
+ display: "inline-flex",
108
+ alignItems: "center",
109
+ justifyContent: "center",
110
+ width: "1.7em",
111
+ height: "1.7em",
112
+ padding: 0,
113
+ background: "none",
114
+ border: "none",
115
+ borderRadius: "var(--tsu-radius-l1-sm)",
116
+ color: "var(--tsu-neutral-11)",
117
+ cursor: "pointer",
118
+ "& svg": {
119
+ width: "100%",
120
+ height: "100%",
121
+ display: "block"
122
+ },
123
+ "&:hover": { color: "var(--tsu-fg)" },
124
+ "&:focus-visible": {
125
+ outline: "2px solid var(--tsu-accent-9)",
126
+ outlineOffset: "1px"
127
+ }
128
+ });
129
+ var read = (v) => typeof v === "function" ? v() : v;
130
+ var Input = (props = {}) => {
131
+ const [local, rest] = splitProps(mergeProps$1({
132
+ solid: false,
133
+ size: "md",
134
+ disabled: false,
135
+ invalid: false
136
+ }, props), [
137
+ "solid",
138
+ "size",
139
+ "disabled",
140
+ "invalid",
141
+ "className",
142
+ "inputClassName",
143
+ "type",
144
+ "prefix",
145
+ "suffix",
146
+ "ref"
147
+ ]);
148
+ const showPassword = createSignal(false);
149
+ const isPassword = read(local.type) === "password";
150
+ const wrapperClassName = () => [
151
+ wrapperClass,
152
+ sizeClasses[read(local.size)],
153
+ read(local.solid) ? variantClasses.solid : variantClasses.outline,
154
+ read(local.invalid) && errorClass,
155
+ read(local.disabled) && disabledClass,
156
+ read(local.className)
157
+ ].filter(Boolean).join(" ");
158
+ const inputType = () => {
159
+ if (!isPassword) return read(local.type);
160
+ return showPassword() ? "text" : "password";
161
+ };
162
+ const renderAffix = (content) => {
163
+ if (content == null) return null;
164
+ return () => {
165
+ const _el0 = _tmpl.cloneNode(true);
166
+ insert(_el0, () => content);
167
+ setProp(_el0, "className", () => affixClass);
168
+ return _el0;
169
+ };
170
+ };
171
+ return () => {
172
+ const _el0 = _tmpl2.cloneNode(true);
173
+ const _el1 = _el0.firstChild;
174
+ const _el2 = _el0.firstChild.nextSibling;
175
+ const _el3 = _el0.firstChild.nextSibling.nextSibling;
176
+ insert(_el0, () => {
177
+ const p = read(local.prefix);
178
+ if (p == null) return null;
179
+ return renderAffix(p);
180
+ }, _el1);
181
+ insert(_el0, () => jsx(ark.input, mergeProps({ get ref() {
182
+ return local.ref;
183
+ } }, rest, {
184
+ type: inputType,
185
+ disabled: () => read(local.disabled),
186
+ className: () => [inputClass, read(local.inputClassName)].filter(Boolean).join(" ")
187
+ })), _el2);
188
+ insert(_el0, () => {
189
+ if (isPassword && read(local.suffix) == null) {
190
+ const visible = showPassword();
191
+ return () => {
192
+ const _el0 = _tmpl3.cloneNode(true);
193
+ insert(_el0, () => visible ? _tmpl4.cloneNode(true) : _tmpl5.cloneNode(true));
194
+ setProp(_el0, "className", () => eyeButtonClass);
195
+ setProp(_el0, "onClick", () => showPassword(!visible));
196
+ setProp(_el0, "tabIndex", () => -1);
197
+ setProp(_el0, "aria-label", () => visible ? "Hide password" : "Show password");
198
+ return _el0;
199
+ };
200
+ }
201
+ const s = read(local.suffix);
202
+ if (s == null) return null;
203
+ return renderAffix(s);
204
+ }, _el3);
205
+ setProp(_el0, "className", () => wrapperClassName);
206
+ return _el0;
207
+ };
208
+ };
209
+ Input.origin = { Root: ark.input };
210
+ //#endregion
211
+ export { Input as default };