@blockle/blocks 0.20.0-alpha1 → 1.0.0

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 (267) hide show
  1. package/README.md +1 -70
  2. package/dist/index.cjs +21 -71
  3. package/dist/index.d.ts +3 -1
  4. package/dist/index.js +3 -0
  5. package/dist/index.spec.d.ts +0 -0
  6. package/dist/reset.cjs +1 -2
  7. package/dist/reset.d.ts +0 -2
  8. package/dist/reset.js +1 -0
  9. package/package.json +24 -81
  10. package/LICENSE +0 -21
  11. package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.cjs +0 -19
  12. package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.mjs +0 -20
  13. package/dist/components/accessibility/VisuallyHidden/index.cjs +0 -1
  14. package/dist/components/accessibility/VisuallyHidden/index.mjs +0 -1
  15. package/dist/components/accessibility/VisuallyHidden/visually-hidden.css.cjs +0 -15
  16. package/dist/components/accessibility/VisuallyHidden/visually-hidden.css.mjs +0 -16
  17. package/dist/components/display/Divider/Divider.cjs +0 -25
  18. package/dist/components/display/Divider/Divider.mjs +0 -26
  19. package/dist/components/display/Divider/divider.css.cjs +0 -15
  20. package/dist/components/display/Divider/divider.css.mjs +0 -16
  21. package/dist/components/display/Divider/index.cjs +0 -1
  22. package/dist/components/display/Divider/index.mjs +0 -1
  23. package/dist/components/feedback/Progress/Progress.cjs +0 -53
  24. package/dist/components/feedback/Progress/Progress.mjs +0 -54
  25. package/dist/components/feedback/Progress/index.cjs +0 -1
  26. package/dist/components/feedback/Progress/index.mjs +0 -1
  27. package/dist/components/feedback/Spinner/Spinner.cjs +0 -25
  28. package/dist/components/feedback/Spinner/Spinner.mjs +0 -26
  29. package/dist/components/feedback/Spinner/index.cjs +0 -1
  30. package/dist/components/feedback/Spinner/index.mjs +0 -1
  31. package/dist/components/form/Button/Button.cjs +0 -58
  32. package/dist/components/form/Button/Button.css.cjs +0 -15
  33. package/dist/components/form/Button/Button.css.mjs +0 -16
  34. package/dist/components/form/Button/Button.mjs +0 -59
  35. package/dist/components/form/Button/index.cjs +0 -1
  36. package/dist/components/form/Button/index.mjs +0 -1
  37. package/dist/components/form/Checkbox/Checkbox.cjs +0 -78
  38. package/dist/components/form/Checkbox/Checkbox.mjs +0 -79
  39. package/dist/components/form/Checkbox/checkbox.css.cjs +0 -31
  40. package/dist/components/form/Checkbox/checkbox.css.mjs +0 -32
  41. package/dist/components/form/Checkbox/index.cjs +0 -1
  42. package/dist/components/form/Checkbox/index.mjs +0 -1
  43. package/dist/components/form/Input/Input.cjs +0 -50
  44. package/dist/components/form/Input/Input.mjs +0 -51
  45. package/dist/components/form/Input/index.cjs +0 -1
  46. package/dist/components/form/Input/index.mjs +0 -1
  47. package/dist/components/form/Input/input.css.cjs +0 -20
  48. package/dist/components/form/Input/input.css.mjs +0 -21
  49. package/dist/components/form/Label/Label.cjs +0 -29
  50. package/dist/components/form/Label/Label.mjs +0 -30
  51. package/dist/components/form/Label/index.cjs +0 -1
  52. package/dist/components/form/Label/index.mjs +0 -1
  53. package/dist/components/form/Radio/Radio.cjs +0 -47
  54. package/dist/components/form/Radio/Radio.mjs +0 -48
  55. package/dist/components/form/Radio/RadioGroup.cjs +0 -1
  56. package/dist/components/form/Radio/RadioGroup.mjs +0 -1
  57. package/dist/components/form/Radio/index.cjs +0 -1
  58. package/dist/components/form/Radio/index.mjs +0 -1
  59. package/dist/components/form/Radio/radio.css.cjs +0 -31
  60. package/dist/components/form/Radio/radio.css.mjs +0 -32
  61. package/dist/components/form/Select/Select.cjs +0 -64
  62. package/dist/components/form/Select/Select.mjs +0 -65
  63. package/dist/components/form/Select/index.cjs +0 -1
  64. package/dist/components/form/Select/index.mjs +0 -1
  65. package/dist/components/form/Select/select.css.cjs +0 -37
  66. package/dist/components/form/Select/select.css.mjs +0 -38
  67. package/dist/components/form/Slider/Slider.cjs +0 -139
  68. package/dist/components/form/Slider/Slider.mjs +0 -142
  69. package/dist/components/form/Slider/index.cjs +0 -1
  70. package/dist/components/form/Slider/index.mjs +0 -1
  71. package/dist/components/form/Slider/slider.css.cjs +0 -74
  72. package/dist/components/form/Slider/slider.css.mjs +0 -75
  73. package/dist/components/form/Slider/usePointerProgress.cjs +0 -44
  74. package/dist/components/form/Slider/usePointerProgress.mjs +0 -45
  75. package/dist/components/form/Switch/Switch.cjs +0 -71
  76. package/dist/components/form/Switch/Switch.mjs +0 -74
  77. package/dist/components/form/Switch/index.cjs +0 -1
  78. package/dist/components/form/Switch/index.mjs +0 -1
  79. package/dist/components/form/Switch/switch.css.cjs +0 -26
  80. package/dist/components/form/Switch/switch.css.mjs +0 -27
  81. package/dist/components/layout/Box/Box.cjs +0 -27
  82. package/dist/components/layout/Box/Box.mjs +0 -28
  83. package/dist/components/layout/Box/index.cjs +0 -1
  84. package/dist/components/layout/Box/index.mjs +0 -1
  85. package/dist/components/layout/Inline/Inline.cjs +0 -29
  86. package/dist/components/layout/Inline/Inline.mjs +0 -30
  87. package/dist/components/layout/Inline/index.cjs +0 -1
  88. package/dist/components/layout/Inline/index.mjs +0 -1
  89. package/dist/components/layout/Stack/Stack.cjs +0 -29
  90. package/dist/components/layout/Stack/Stack.mjs +0 -30
  91. package/dist/components/layout/Stack/index.cjs +0 -1
  92. package/dist/components/layout/Stack/index.mjs +0 -1
  93. package/dist/components/navigation/Link/Link.cjs +0 -31
  94. package/dist/components/navigation/Link/Link.mjs +0 -32
  95. package/dist/components/navigation/Link/index.cjs +0 -1
  96. package/dist/components/navigation/Link/index.mjs +0 -1
  97. package/dist/components/other/BlocksProvider/BlocksProvider.cjs +0 -36
  98. package/dist/components/other/BlocksProvider/BlocksProvider.mjs +0 -39
  99. package/dist/components/other/BlocksProvider/context.cjs +0 -4
  100. package/dist/components/other/BlocksProvider/context.mjs +0 -7
  101. package/dist/components/other/BlocksProvider/index.cjs +0 -1
  102. package/dist/components/other/BlocksProvider/index.mjs +0 -1
  103. package/dist/components/other/Portal/Portal.cjs +0 -7
  104. package/dist/components/other/Portal/Portal.mjs +0 -8
  105. package/dist/components/other/Portal/index.cjs +0 -1
  106. package/dist/components/other/Portal/index.mjs +0 -1
  107. package/dist/components/overlay/Dialog/Dialog.cjs +0 -77
  108. package/dist/components/overlay/Dialog/Dialog.mjs +0 -80
  109. package/dist/components/overlay/Dialog/dialog.css.cjs +0 -21
  110. package/dist/components/overlay/Dialog/dialog.css.mjs +0 -22
  111. package/dist/components/overlay/Dialog/dialogHelper.cjs +0 -20
  112. package/dist/components/overlay/Dialog/dialogHelper.mjs +0 -21
  113. package/dist/components/overlay/Dialog/index.cjs +0 -1
  114. package/dist/components/overlay/Dialog/index.mjs +0 -1
  115. package/dist/components/overlay/Popover/Popover.cjs +0 -111
  116. package/dist/components/overlay/Popover/Popover.mjs +0 -112
  117. package/dist/components/overlay/Popover/popover-utils.cjs +0 -61
  118. package/dist/components/overlay/Popover/popover-utils.mjs +0 -62
  119. package/dist/components/overlay/Tooltip/Tooltip.cjs +0 -71
  120. package/dist/components/overlay/Tooltip/Tooltip.mjs +0 -74
  121. package/dist/components/overlay/Tooltip/index.cjs +0 -1
  122. package/dist/components/overlay/Tooltip/index.mjs +0 -1
  123. package/dist/components/typography/Heading/Heading.cjs +0 -23
  124. package/dist/components/typography/Heading/Heading.mjs +0 -24
  125. package/dist/components/typography/Heading/heading.css.cjs +0 -15
  126. package/dist/components/typography/Heading/heading.css.mjs +0 -16
  127. package/dist/components/typography/Heading/index.cjs +0 -1
  128. package/dist/components/typography/Heading/index.mjs +0 -1
  129. package/dist/components/typography/Text/Text.cjs +0 -20
  130. package/dist/components/typography/Text/Text.mjs +0 -21
  131. package/dist/components/typography/Text/index.cjs +0 -1
  132. package/dist/components/typography/Text/index.mjs +0 -1
  133. package/dist/components/typography/Text/text.css.cjs +0 -15
  134. package/dist/components/typography/Text/text.css.mjs +0 -16
  135. package/dist/hooks/useClickOutside/useClickOutside.cjs +0 -22
  136. package/dist/hooks/useClickOutside/useClickOutside.mjs +0 -23
  137. package/dist/hooks/useControlledValue/useControlledValue.cjs +0 -31
  138. package/dist/hooks/useControlledValue/useControlledValue.mjs +0 -32
  139. package/dist/hooks/useIsomorphicLayoutEffect/index.cjs +0 -1
  140. package/dist/hooks/useIsomorphicLayoutEffect/index.mjs +0 -1
  141. package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs +0 -4
  142. package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs +0 -7
  143. package/dist/hooks/useKeyboard/index.cjs +0 -1
  144. package/dist/hooks/useKeyboard/index.mjs +0 -1
  145. package/dist/hooks/useKeyboard/useKeyboard.cjs +0 -19
  146. package/dist/hooks/useKeyboard/useKeyboard.mjs +0 -22
  147. package/dist/hooks/useLayer/index.cjs +0 -1
  148. package/dist/hooks/useLayer/index.mjs +0 -1
  149. package/dist/hooks/useLayer/useLayer.cjs +0 -25
  150. package/dist/hooks/useLayer/useLayer.mjs +0 -26
  151. package/dist/hooks/usePreventBodyScroll/index.cjs +0 -1
  152. package/dist/hooks/usePreventBodyScroll/index.mjs +0 -1
  153. package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.cjs +0 -29
  154. package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.mjs +0 -30
  155. package/dist/hooks/useRestoreFocus/index.cjs +0 -1
  156. package/dist/hooks/useRestoreFocus/index.mjs +0 -1
  157. package/dist/hooks/useRestoreFocus/useRestoreFocus.cjs +0 -17
  158. package/dist/hooks/useRestoreFocus/useRestoreFocus.mjs +0 -18
  159. package/dist/hooks/useRootAriaHidden/index.cjs +0 -1
  160. package/dist/hooks/useRootAriaHidden/index.mjs +0 -1
  161. package/dist/hooks/useRootAriaHidden/useRootAriaHidden.cjs +0 -11
  162. package/dist/hooks/useRootAriaHidden/useRootAriaHidden.mjs +0 -12
  163. package/dist/hooks/useVisibilityState/index.cjs +0 -1
  164. package/dist/hooks/useVisibilityState/index.mjs +0 -1
  165. package/dist/hooks/useVisibilityState/useVisibilityState.cjs +0 -15
  166. package/dist/hooks/useVisibilityState/useVisibilityState.mjs +0 -16
  167. package/dist/index.d.mts +0 -1
  168. package/dist/index.mjs +0 -73
  169. package/dist/lib/asChildRenderer/createAsChildTemplate.cjs +0 -72
  170. package/dist/lib/asChildRenderer/createAsChildTemplate.mjs +0 -73
  171. package/dist/lib/css/atoms/atomicProperties.cjs +0 -89
  172. package/dist/lib/css/atoms/atomicProperties.mjs +0 -90
  173. package/dist/lib/css/atoms/atoms.cjs +0 -2
  174. package/dist/lib/css/atoms/atoms.mjs +0 -1
  175. package/dist/lib/css/atoms/breakpoints.cjs +0 -13
  176. package/dist/lib/css/atoms/breakpoints.mjs +0 -14
  177. package/dist/lib/css/atoms/index.cjs +0 -2
  178. package/dist/lib/css/atoms/index.mjs +0 -1
  179. package/dist/lib/css/atoms/sprinkles.css.cjs +0 -38
  180. package/dist/lib/css/atoms/sprinkles.css.mjs +0 -39
  181. package/dist/lib/css/flexbox/flexbox.cjs +0 -16
  182. package/dist/lib/css/flexbox/flexbox.mjs +0 -17
  183. package/dist/lib/css/layers/layers.css.cjs +0 -7
  184. package/dist/lib/css/layers/layers.css.mjs +0 -8
  185. package/dist/lib/css/reset/reset.css.cjs +0 -38
  186. package/dist/lib/css/reset/reset.css.mjs +0 -37
  187. package/dist/lib/css/style/style.cjs +0 -28
  188. package/dist/lib/css/style/style.mjs +0 -29
  189. package/dist/lib/css/utils/cssUtils.cjs +0 -5
  190. package/dist/lib/css/utils/cssUtils.mjs +0 -6
  191. package/dist/lib/react/mergeProps.cjs +0 -42
  192. package/dist/lib/react/mergeProps.mjs +0 -43
  193. package/dist/lib/react/refs.cjs +0 -16
  194. package/dist/lib/react/refs.mjs +0 -17
  195. package/dist/lib/theme/makeComponentTheme.cjs +0 -5
  196. package/dist/lib/theme/makeComponentTheme.mjs +0 -6
  197. package/dist/lib/theme/makeTheme.cjs +0 -12
  198. package/dist/lib/theme/makeTheme.mjs +0 -13
  199. package/dist/lib/theme/makeVanillaTheme.cjs +0 -19
  200. package/dist/lib/theme/makeVanillaTheme.mjs +0 -20
  201. package/dist/lib/theme/store/theme.cjs +0 -92
  202. package/dist/lib/theme/store/theme.mjs +0 -93
  203. package/dist/lib/theme/tokens.cjs +0 -81
  204. package/dist/lib/theme/tokens.mjs +0 -82
  205. package/dist/lib/theme/vars.css.cjs +0 -9
  206. package/dist/lib/theme/vars.css.mjs +0 -10
  207. package/dist/lib/utils/atom-props.cjs +0 -15
  208. package/dist/lib/utils/atom-props.mjs +0 -16
  209. package/dist/lib/utils/classnames.cjs +0 -6
  210. package/dist/lib/utils/classnames.mjs +0 -7
  211. package/dist/lib/utils/dom.cjs +0 -12
  212. package/dist/lib/utils/dom.mjs +0 -13
  213. package/dist/lib/utils/math.cjs +0 -12
  214. package/dist/lib/utils/math.mjs +0 -13
  215. package/dist/momotaro.chunk.d.ts +0 -906
  216. package/dist/reset.d.mts +0 -2
  217. package/dist/reset.mjs +0 -2
  218. package/dist/themes/momotaro/components/button.css.cjs +0 -103
  219. package/dist/themes/momotaro/components/button.css.mjs +0 -104
  220. package/dist/themes/momotaro/components/checkbox.css.cjs +0 -59
  221. package/dist/themes/momotaro/components/checkbox.css.mjs +0 -60
  222. package/dist/themes/momotaro/components/dialog.css.cjs +0 -78
  223. package/dist/themes/momotaro/components/dialog.css.mjs +0 -79
  224. package/dist/themes/momotaro/components/divider.css.cjs +0 -15
  225. package/dist/themes/momotaro/components/divider.css.mjs +0 -16
  226. package/dist/themes/momotaro/components/helpers.css.cjs +0 -43
  227. package/dist/themes/momotaro/components/helpers.css.mjs +0 -44
  228. package/dist/themes/momotaro/components/index.cjs +0 -34
  229. package/dist/themes/momotaro/components/index.mjs +0 -35
  230. package/dist/themes/momotaro/components/input.css.cjs +0 -41
  231. package/dist/themes/momotaro/components/input.css.mjs +0 -42
  232. package/dist/themes/momotaro/components/label.css.cjs +0 -33
  233. package/dist/themes/momotaro/components/label.css.mjs +0 -34
  234. package/dist/themes/momotaro/components/link.css.cjs +0 -53
  235. package/dist/themes/momotaro/components/link.css.mjs +0 -54
  236. package/dist/themes/momotaro/components/popover.css.cjs +0 -32
  237. package/dist/themes/momotaro/components/popover.css.mjs +0 -33
  238. package/dist/themes/momotaro/components/progress.css.cjs +0 -55
  239. package/dist/themes/momotaro/components/progress.css.mjs +0 -56
  240. package/dist/themes/momotaro/components/radio.css.cjs +0 -60
  241. package/dist/themes/momotaro/components/radio.css.mjs +0 -61
  242. package/dist/themes/momotaro/components/select.css.cjs +0 -44
  243. package/dist/themes/momotaro/components/select.css.mjs +0 -45
  244. package/dist/themes/momotaro/components/slider.css.cjs +0 -89
  245. package/dist/themes/momotaro/components/slider.css.mjs +0 -90
  246. package/dist/themes/momotaro/components/spinner.css.cjs +0 -43
  247. package/dist/themes/momotaro/components/spinner.css.mjs +0 -44
  248. package/dist/themes/momotaro/components/switch.css.cjs +0 -58
  249. package/dist/themes/momotaro/components/switch.css.mjs +0 -59
  250. package/dist/themes/momotaro/components/tooltip.css.cjs +0 -30
  251. package/dist/themes/momotaro/components/tooltip.css.mjs +0 -31
  252. package/dist/themes/momotaro/components/transitions.cjs +0 -3
  253. package/dist/themes/momotaro/components/transitions.mjs +0 -4
  254. package/dist/themes/momotaro/index.cjs +0 -2
  255. package/dist/themes/momotaro/index.mjs +0 -1
  256. package/dist/themes/momotaro/momotaro.css.cjs +0 -13
  257. package/dist/themes/momotaro/momotaro.css.mjs +0 -14
  258. package/dist/themes/momotaro/tokens.css.cjs +0 -85
  259. package/dist/themes/momotaro/tokens.css.mjs +0 -86
  260. package/dist/themes/momotaro.cjs +0 -4
  261. package/dist/themes/momotaro.d.mts +0 -1
  262. package/dist/themes/momotaro.d.ts +0 -1
  263. package/dist/themes/momotaro.mjs +0 -4
  264. package/reset/index.d.ts +0 -1
  265. package/reset/package.json +0 -5
  266. package/themes/momotaro/index.d.ts +0 -1
  267. package/themes/momotaro/package.json +0 -5
@@ -1,47 +0,0 @@
1
- "use strict";
2
- const jsxRuntime = require("react/jsx-runtime");
3
- const lib_theme_store_theme_cjs = require("../../../lib/theme/store/theme.cjs");
4
- const lib_utils_classnames_cjs = require("../../../lib/utils/classnames.cjs");
5
- const components_form_Radio_radio_css_cjs = require("./radio.css.cjs");
6
- const components_form_Label_Label_cjs = require("../Label/Label.cjs");
7
- const Radio = ({
8
- name,
9
- children,
10
- className,
11
- ref,
12
- ...restProps
13
- }) => {
14
- const containerClassName = lib_theme_store_theme_cjs.getComponentStyles("radio", { base: true }, false);
15
- const iconClassName = lib_theme_store_theme_cjs.getComponentStyles("radio", { icon: true }, false);
16
- const labelClassName = lib_theme_store_theme_cjs.getComponentStyles("checkbox", { label: true }, false);
17
- const input = /* @__PURE__ */ jsxRuntime.jsxs(
18
- "div",
19
- {
20
- className: lib_utils_classnames_cjs.classnames(components_form_Radio_radio_css_cjs.container, containerClassName, className),
21
- children: [
22
- /* @__PURE__ */ jsxRuntime.jsx(
23
- "input",
24
- {
25
- ref,
26
- type: "radio",
27
- name,
28
- className: components_form_Radio_radio_css_cjs.input,
29
- ...restProps
30
- }
31
- ),
32
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: lib_utils_classnames_cjs.classnames(components_form_Radio_radio_css_cjs.icon, iconClassName) })
33
- ]
34
- }
35
- );
36
- if (!children) {
37
- return input;
38
- }
39
- return (
40
- // biome-ignore lint/a11y/noLabelWithoutControl: <explanation>
41
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: labelClassName, children: [
42
- input,
43
- /* @__PURE__ */ jsxRuntime.jsx(components_form_Label_Label_cjs.Label, { asSpan: true, children })
44
- ] })
45
- );
46
- };
47
- exports.Radio = Radio;
@@ -1,48 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { getComponentStyles } from "../../../lib/theme/store/theme.mjs";
3
- import { classnames } from "../../../lib/utils/classnames.mjs";
4
- import { input, icon, container } from "./radio.css.mjs";
5
- import { Label } from "../Label/Label.mjs";
6
- const Radio = ({
7
- name,
8
- children,
9
- className,
10
- ref,
11
- ...restProps
12
- }) => {
13
- const containerClassName = getComponentStyles("radio", { base: true }, false);
14
- const iconClassName = getComponentStyles("radio", { icon: true }, false);
15
- const labelClassName = getComponentStyles("checkbox", { label: true }, false);
16
- const input$1 = /* @__PURE__ */ jsxs(
17
- "div",
18
- {
19
- className: classnames(container, containerClassName, className),
20
- children: [
21
- /* @__PURE__ */ jsx(
22
- "input",
23
- {
24
- ref,
25
- type: "radio",
26
- name,
27
- className: input,
28
- ...restProps
29
- }
30
- ),
31
- /* @__PURE__ */ jsx("div", { className: classnames(icon, iconClassName) })
32
- ]
33
- }
34
- );
35
- if (!children) {
36
- return input$1;
37
- }
38
- return (
39
- // biome-ignore lint/a11y/noLabelWithoutControl: <explanation>
40
- /* @__PURE__ */ jsxs("label", { className: labelClassName, children: [
41
- input$1,
42
- /* @__PURE__ */ jsx(Label, { asSpan: true, children })
43
- ] })
44
- );
45
- };
46
- export {
47
- Radio
48
- };
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
-
@@ -1,31 +0,0 @@
1
- "use strict";
2
- const fileScope = require("@vanilla-extract/css/fileScope");
3
- const css = require("@vanilla-extract/css");
4
- const lib_css_layers_layers_css_cjs = require("../../../lib/css/layers/layers.css.cjs");
5
- fileScope.setFileScope("src/components/form/Radio/radio.css.ts", "@blockle/blocks");
6
- const container = css.style({
7
- "@layer": {
8
- [lib_css_layers_layers_css_cjs.blocksLayer]: {
9
- position: "relative",
10
- cursor: "pointer",
11
- overflow: "hidden"
12
- }
13
- }
14
- }, "container");
15
- const input = css.style({
16
- position: "absolute",
17
- inset: 0,
18
- opacity: 0,
19
- "@layer": {
20
- [lib_css_layers_layers_css_cjs.blocksLayer]: {
21
- all: "unset"
22
- }
23
- }
24
- }, "input");
25
- const icon = css.style({
26
- pointerEvents: "none"
27
- }, "icon");
28
- fileScope.endFileScope();
29
- exports.container = container;
30
- exports.icon = icon;
31
- exports.input = input;
@@ -1,32 +0,0 @@
1
- import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
- import { style } from "@vanilla-extract/css";
3
- import { blocksLayer } from "../../../lib/css/layers/layers.css.mjs";
4
- setFileScope("src/components/form/Radio/radio.css.ts", "@blockle/blocks");
5
- const container = style({
6
- "@layer": {
7
- [blocksLayer]: {
8
- position: "relative",
9
- cursor: "pointer",
10
- overflow: "hidden"
11
- }
12
- }
13
- }, "container");
14
- const input = style({
15
- position: "absolute",
16
- inset: 0,
17
- opacity: 0,
18
- "@layer": {
19
- [blocksLayer]: {
20
- all: "unset"
21
- }
22
- }
23
- }, "input");
24
- const icon = style({
25
- pointerEvents: "none"
26
- }, "icon");
27
- endFileScope();
28
- export {
29
- container,
30
- icon,
31
- input
32
- };
@@ -1,64 +0,0 @@
1
- "use strict";
2
- const jsxRuntime = require("react/jsx-runtime");
3
- const lib_theme_store_theme_cjs = require("../../../lib/theme/store/theme.cjs");
4
- const lib_utils_classnames_cjs = require("../../../lib/utils/classnames.cjs");
5
- const components_form_Select_select_css_cjs = require("./select.css.cjs");
6
- const components_layout_Box_Box_cjs = require("../../layout/Box/Box.cjs");
7
- const Select = ({
8
- children,
9
- placeholder,
10
- className,
11
- variant,
12
- ref,
13
- ...restProps
14
- }) => {
15
- const wrapperClassName = lib_theme_store_theme_cjs.getComponentStyles(
16
- "select",
17
- { wrapper: true },
18
- false
19
- );
20
- const selectClassName = lib_theme_store_theme_cjs.getComponentStyles("select", {
21
- select: true,
22
- variants: { variant }
23
- });
24
- const iconClassName = lib_theme_store_theme_cjs.getComponentStyles("select", { icon: true }, false);
25
- return /* @__PURE__ */ jsxRuntime.jsxs(components_layout_Box_Box_cjs.Box, { className: lib_utils_classnames_cjs.classnames(components_form_Select_select_css_cjs.wrapper, wrapperClassName), children: [
26
- /* @__PURE__ */ jsxRuntime.jsxs(
27
- "select",
28
- {
29
- ref,
30
- className: lib_utils_classnames_cjs.classnames(components_form_Select_select_css_cjs.select, selectClassName, className),
31
- ...restProps,
32
- children: [
33
- placeholder && /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: placeholder }),
34
- children
35
- ]
36
- }
37
- ),
38
- /* @__PURE__ */ jsxRuntime.jsx(
39
- components_layout_Box_Box_cjs.Box,
40
- {
41
- className: lib_utils_classnames_cjs.classnames(components_form_Select_select_css_cjs.icon, iconClassName),
42
- role: "presentation",
43
- "aria-hidden": true,
44
- children: /* @__PURE__ */ jsxRuntime.jsx(DefaultIcon, {})
45
- }
46
- )
47
- ] });
48
- };
49
- const DefaultIcon = () => {
50
- return (
51
- // TOOD - replace with actual icon component renderer
52
- // biome-ignore lint/a11y/noSvgWithoutTitle: <explanation>
53
- /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", style: { width: "1rem", height: "1rem" }, children: /* @__PURE__ */ jsxRuntime.jsx(
54
- "path",
55
- {
56
- fill: "currentColor",
57
- fillRule: "evenodd",
58
- d: "m11.625 14.3666 7.9365-7.653c.5241-.5055 1.3133-.4372 1.7625.1525.4493.5897.3886 1.4774-.1355 1.9829l-8.75 8.4375c-.4681.4513-1.1589.4513-1.627 0l-8.75-8.4375c-.5241-.5055-.5848-1.3932-.1356-1.9829.4493-.5897 1.2385-.658 1.7626-.1525l7.9365 7.653Z",
59
- clipRule: "evenodd"
60
- }
61
- ) })
62
- );
63
- };
64
- exports.Select = Select;
@@ -1,65 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { getComponentStyles } from "../../../lib/theme/store/theme.mjs";
3
- import { classnames } from "../../../lib/utils/classnames.mjs";
4
- import { select, icon, wrapper } from "./select.css.mjs";
5
- import { Box } from "../../layout/Box/Box.mjs";
6
- const Select = ({
7
- children,
8
- placeholder,
9
- className,
10
- variant,
11
- ref,
12
- ...restProps
13
- }) => {
14
- const wrapperClassName = getComponentStyles(
15
- "select",
16
- { wrapper: true },
17
- false
18
- );
19
- const selectClassName = getComponentStyles("select", {
20
- select: true,
21
- variants: { variant }
22
- });
23
- const iconClassName = getComponentStyles("select", { icon: true }, false);
24
- return /* @__PURE__ */ jsxs(Box, { className: classnames(wrapper, wrapperClassName), children: [
25
- /* @__PURE__ */ jsxs(
26
- "select",
27
- {
28
- ref,
29
- className: classnames(select, selectClassName, className),
30
- ...restProps,
31
- children: [
32
- placeholder && /* @__PURE__ */ jsx("option", { value: "", children: placeholder }),
33
- children
34
- ]
35
- }
36
- ),
37
- /* @__PURE__ */ jsx(
38
- Box,
39
- {
40
- className: classnames(icon, iconClassName),
41
- role: "presentation",
42
- "aria-hidden": true,
43
- children: /* @__PURE__ */ jsx(DefaultIcon, {})
44
- }
45
- )
46
- ] });
47
- };
48
- const DefaultIcon = () => {
49
- return (
50
- // TOOD - replace with actual icon component renderer
51
- // biome-ignore lint/a11y/noSvgWithoutTitle: <explanation>
52
- /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", style: { width: "1rem", height: "1rem" }, children: /* @__PURE__ */ jsx(
53
- "path",
54
- {
55
- fill: "currentColor",
56
- fillRule: "evenodd",
57
- d: "m11.625 14.3666 7.9365-7.653c.5241-.5055 1.3133-.4372 1.7625.1525.4493.5897.3886 1.4774-.1355 1.9829l-8.75 8.4375c-.4681.4513-1.1589.4513-1.627 0l-8.75-8.4375c-.5241-.5055-.5848-1.3932-.1356-1.9829.4493-.5897 1.2385-.658 1.7626-.1525l7.9365 7.653Z",
58
- clipRule: "evenodd"
59
- }
60
- ) })
61
- );
62
- };
63
- export {
64
- Select
65
- };
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
-
@@ -1,37 +0,0 @@
1
- "use strict";
2
- const fileScope = require("@vanilla-extract/css/fileScope");
3
- const css = require("@vanilla-extract/css");
4
- const lib_css_layers_layers_css_cjs = require("../../../lib/css/layers/layers.css.cjs");
5
- fileScope.setFileScope("src/components/form/Select/select.css.ts", "@blockle/blocks");
6
- const wrapper = css.style({
7
- "@layer": {
8
- [lib_css_layers_layers_css_cjs.blocksLayer]: {
9
- position: "relative"
10
- }
11
- }
12
- }, "wrapper");
13
- const select = css.style({
14
- "@layer": {
15
- [lib_css_layers_layers_css_cjs.blocksLayer]: {
16
- appearance: "none",
17
- inlineSize: "100%"
18
- }
19
- }
20
- }, "select");
21
- const icon = css.style({
22
- "@layer": {
23
- [lib_css_layers_layers_css_cjs.blocksLayer]: {
24
- position: "absolute",
25
- right: 0,
26
- top: 0,
27
- bottom: 0,
28
- pointerEvents: "none",
29
- display: "flex",
30
- alignItems: "center"
31
- }
32
- }
33
- }, "icon");
34
- fileScope.endFileScope();
35
- exports.icon = icon;
36
- exports.select = select;
37
- exports.wrapper = wrapper;
@@ -1,38 +0,0 @@
1
- import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
- import { style } from "@vanilla-extract/css";
3
- import { blocksLayer } from "../../../lib/css/layers/layers.css.mjs";
4
- setFileScope("src/components/form/Select/select.css.ts", "@blockle/blocks");
5
- const wrapper = style({
6
- "@layer": {
7
- [blocksLayer]: {
8
- position: "relative"
9
- }
10
- }
11
- }, "wrapper");
12
- const select = style({
13
- "@layer": {
14
- [blocksLayer]: {
15
- appearance: "none",
16
- inlineSize: "100%"
17
- }
18
- }
19
- }, "select");
20
- const icon = style({
21
- "@layer": {
22
- [blocksLayer]: {
23
- position: "absolute",
24
- right: 0,
25
- top: 0,
26
- bottom: 0,
27
- pointerEvents: "none",
28
- display: "flex",
29
- alignItems: "center"
30
- }
31
- }
32
- }, "icon");
33
- endFileScope();
34
- export {
35
- icon,
36
- select,
37
- wrapper
38
- };
@@ -1,139 +0,0 @@
1
- "use strict";
2
- const jsxRuntime = require("react/jsx-runtime");
3
- const react = require("react");
4
- const hooks_useControlledValue_useControlledValue_cjs = require("../../../hooks/useControlledValue/useControlledValue.cjs");
5
- const lib_theme_store_theme_cjs = require("../../../lib/theme/store/theme.cjs");
6
- const lib_utils_classnames_cjs = require("../../../lib/utils/classnames.cjs");
7
- const lib_utils_math_cjs = require("../../../lib/utils/math.cjs");
8
- const components_form_Slider_slider_css_cjs = require("./slider.css.cjs");
9
- const components_form_Slider_usePointerProgress_cjs = require("./usePointerProgress.cjs");
10
- const usableKeys = /* @__PURE__ */ new Set([
11
- "ArrowLeft",
12
- "ArrowRight",
13
- "ArrowUp",
14
- "ArrowDown",
15
- "Home",
16
- "End",
17
- "PageUp",
18
- "PageDown",
19
- "Home",
20
- "End"
21
- ]);
22
- const Slider = ({
23
- min = 0,
24
- max = 100,
25
- step = 1,
26
- orientation = "horizontal",
27
- defaultValue = 0,
28
- onChange,
29
- value,
30
- name,
31
- size,
32
- colorScheme,
33
- disabled,
34
- precision = 2,
35
- ...restProps
36
- }) => {
37
- const baseClass = lib_theme_store_theme_cjs.getComponentStyles("slider", {
38
- base: true,
39
- variants: { size, colorScheme, disabled }
40
- });
41
- const trackClass = lib_theme_store_theme_cjs.getComponentStyles("slider", { track: true }, false);
42
- const filledTrackClass = lib_theme_store_theme_cjs.getComponentStyles(
43
- "slider",
44
- { filledTrack: true },
45
- false
46
- );
47
- const thumbClass = lib_theme_store_theme_cjs.getComponentStyles("slider", { thumb: true }, false);
48
- const containerRef = react.useRef(null);
49
- const [currentValue, setValue] = hooks_useControlledValue_useControlledValue_cjs.useControlledValue({
50
- defaultValue,
51
- value,
52
- onChange,
53
- transformValue: (value2) => lib_utils_math_cjs.roundToPrecision(lib_utils_math_cjs.getBoundValue(value2, min, max, step), precision)
54
- });
55
- components_form_Slider_usePointerProgress_cjs.usePointerProgress({
56
- container: containerRef,
57
- orientation,
58
- onChange(progress) {
59
- if (orientation === "vertical") {
60
- setValue(max * (1 - progress));
61
- } else {
62
- setValue(max * progress);
63
- }
64
- }
65
- });
66
- const onKeyDown = react.useCallback(
67
- (event) => {
68
- if (!usableKeys.has(event.key)) {
69
- return;
70
- }
71
- event.preventDefault();
72
- event.stopPropagation();
73
- const specialKey = ["PageUp", "PageDown"];
74
- const stepModifier = event.shiftKey || specialKey.includes(event.key) ? (max - min) / 10 : step;
75
- if (event.key === "ArrowLeft" || event.key === "ArrowDown" || event.key === "PageDown") {
76
- return setValue(currentValue - stepModifier);
77
- }
78
- if (event.key === "ArrowRight" || event.key === "ArrowUp" || event.key === "PageUp") {
79
- return setValue(currentValue + stepModifier);
80
- }
81
- if (event.key === "Home") {
82
- return setValue(min);
83
- }
84
- if (event.key === "End") {
85
- return setValue(max);
86
- }
87
- },
88
- [max, min, step, setValue, currentValue]
89
- );
90
- return /* @__PURE__ */ jsxRuntime.jsxs(
91
- "div",
92
- {
93
- ref: containerRef,
94
- className: lib_utils_classnames_cjs.classnames(
95
- components_form_Slider_slider_css_cjs.container,
96
- orientation === "vertical" ? components_form_Slider_slider_css_cjs.containerVertical : "",
97
- baseClass
98
- ),
99
- children: [
100
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: lib_utils_classnames_cjs.classnames(components_form_Slider_slider_css_cjs.track, trackClass), children: /* @__PURE__ */ jsxRuntime.jsx(
101
- "div",
102
- {
103
- className: lib_utils_classnames_cjs.classnames(components_form_Slider_slider_css_cjs.filledTrack, filledTrackClass),
104
- style: {
105
- inlineSize: `${currentValue / max * 100}%`
106
- }
107
- }
108
- ) }),
109
- /* @__PURE__ */ jsxRuntime.jsx(
110
- "button",
111
- {
112
- type: "button",
113
- className: lib_utils_classnames_cjs.classnames(components_form_Slider_slider_css_cjs.thumb, thumbClass),
114
- role: "slider",
115
- "aria-valuemin": min,
116
- "aria-valuemax": max,
117
- "aria-valuenow": currentValue,
118
- "aria-orientation": orientation,
119
- style: {
120
- [orientation === "horizontal" ? "insetInlineStart" : "insetInlineEnd"]: `${currentValue / max * 100}%`
121
- },
122
- onKeyDown,
123
- ...restProps
124
- }
125
- ),
126
- /* @__PURE__ */ jsxRuntime.jsx(
127
- "input",
128
- {
129
- type: "hidden",
130
- disabled,
131
- name,
132
- value: currentValue
133
- }
134
- )
135
- ]
136
- }
137
- );
138
- };
139
- exports.Slider = Slider;
@@ -1,142 +0,0 @@
1
- 'use client';
2
-
3
- import { jsxs, jsx } from "react/jsx-runtime";
4
- import { useRef, useCallback } from "react";
5
- import { useControlledValue } from "../../../hooks/useControlledValue/useControlledValue.mjs";
6
- import { getComponentStyles } from "../../../lib/theme/store/theme.mjs";
7
- import { classnames } from "../../../lib/utils/classnames.mjs";
8
- import { roundToPrecision, getBoundValue } from "../../../lib/utils/math.mjs";
9
- import { filledTrack, track, thumb, containerVertical, container } from "./slider.css.mjs";
10
- import { usePointerProgress } from "./usePointerProgress.mjs";
11
- const usableKeys = /* @__PURE__ */ new Set([
12
- "ArrowLeft",
13
- "ArrowRight",
14
- "ArrowUp",
15
- "ArrowDown",
16
- "Home",
17
- "End",
18
- "PageUp",
19
- "PageDown",
20
- "Home",
21
- "End"
22
- ]);
23
- const Slider = ({
24
- min = 0,
25
- max = 100,
26
- step = 1,
27
- orientation = "horizontal",
28
- defaultValue = 0,
29
- onChange,
30
- value,
31
- name,
32
- size,
33
- colorScheme,
34
- disabled,
35
- precision = 2,
36
- ...restProps
37
- }) => {
38
- const baseClass = getComponentStyles("slider", {
39
- base: true,
40
- variants: { size, colorScheme, disabled }
41
- });
42
- const trackClass = getComponentStyles("slider", { track: true }, false);
43
- const filledTrackClass = getComponentStyles(
44
- "slider",
45
- { filledTrack: true },
46
- false
47
- );
48
- const thumbClass = getComponentStyles("slider", { thumb: true }, false);
49
- const containerRef = useRef(null);
50
- const [currentValue, setValue] = useControlledValue({
51
- defaultValue,
52
- value,
53
- onChange,
54
- transformValue: (value2) => roundToPrecision(getBoundValue(value2, min, max, step), precision)
55
- });
56
- usePointerProgress({
57
- container: containerRef,
58
- orientation,
59
- onChange(progress) {
60
- if (orientation === "vertical") {
61
- setValue(max * (1 - progress));
62
- } else {
63
- setValue(max * progress);
64
- }
65
- }
66
- });
67
- const onKeyDown = useCallback(
68
- (event) => {
69
- if (!usableKeys.has(event.key)) {
70
- return;
71
- }
72
- event.preventDefault();
73
- event.stopPropagation();
74
- const specialKey = ["PageUp", "PageDown"];
75
- const stepModifier = event.shiftKey || specialKey.includes(event.key) ? (max - min) / 10 : step;
76
- if (event.key === "ArrowLeft" || event.key === "ArrowDown" || event.key === "PageDown") {
77
- return setValue(currentValue - stepModifier);
78
- }
79
- if (event.key === "ArrowRight" || event.key === "ArrowUp" || event.key === "PageUp") {
80
- return setValue(currentValue + stepModifier);
81
- }
82
- if (event.key === "Home") {
83
- return setValue(min);
84
- }
85
- if (event.key === "End") {
86
- return setValue(max);
87
- }
88
- },
89
- [max, min, step, setValue, currentValue]
90
- );
91
- return /* @__PURE__ */ jsxs(
92
- "div",
93
- {
94
- ref: containerRef,
95
- className: classnames(
96
- container,
97
- orientation === "vertical" ? containerVertical : "",
98
- baseClass
99
- ),
100
- children: [
101
- /* @__PURE__ */ jsx("div", { className: classnames(track, trackClass), children: /* @__PURE__ */ jsx(
102
- "div",
103
- {
104
- className: classnames(filledTrack, filledTrackClass),
105
- style: {
106
- inlineSize: `${currentValue / max * 100}%`
107
- }
108
- }
109
- ) }),
110
- /* @__PURE__ */ jsx(
111
- "button",
112
- {
113
- type: "button",
114
- className: classnames(thumb, thumbClass),
115
- role: "slider",
116
- "aria-valuemin": min,
117
- "aria-valuemax": max,
118
- "aria-valuenow": currentValue,
119
- "aria-orientation": orientation,
120
- style: {
121
- [orientation === "horizontal" ? "insetInlineStart" : "insetInlineEnd"]: `${currentValue / max * 100}%`
122
- },
123
- onKeyDown,
124
- ...restProps
125
- }
126
- ),
127
- /* @__PURE__ */ jsx(
128
- "input",
129
- {
130
- type: "hidden",
131
- disabled,
132
- name,
133
- value: currentValue
134
- }
135
- )
136
- ]
137
- }
138
- );
139
- };
140
- export {
141
- Slider
142
- };
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
-