@blockle/blocks 0.19.0 → 0.20.0-alpha1

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 (283) hide show
  1. package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.cjs +19 -0
  2. package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.mjs +20 -0
  3. package/dist/components/accessibility/VisuallyHidden/index.cjs +1 -0
  4. package/dist/components/accessibility/VisuallyHidden/index.mjs +1 -0
  5. package/dist/{styles/components/Accessibility → components/accessibility}/VisuallyHidden/visually-hidden.css.cjs +1 -1
  6. package/dist/{styles/components/Accessibility → components/accessibility}/VisuallyHidden/visually-hidden.css.mjs +1 -1
  7. package/dist/components/display/Divider/Divider.cjs +25 -0
  8. package/dist/components/display/Divider/Divider.mjs +26 -0
  9. package/dist/{styles/components → components}/display/Divider/divider.css.cjs +2 -2
  10. package/dist/components/display/Divider/index.cjs +1 -0
  11. package/dist/components/display/Divider/index.mjs +1 -0
  12. package/dist/components/feedback/Progress/Progress.cjs +53 -0
  13. package/dist/components/feedback/Progress/Progress.mjs +54 -0
  14. package/dist/components/feedback/Progress/index.cjs +1 -0
  15. package/dist/components/feedback/Progress/index.mjs +1 -0
  16. package/dist/components/feedback/Spinner/Spinner.cjs +25 -0
  17. package/dist/components/feedback/Spinner/Spinner.mjs +26 -0
  18. package/dist/components/feedback/Spinner/index.cjs +1 -0
  19. package/dist/components/feedback/Spinner/index.mjs +1 -0
  20. package/dist/components/form/Button/Button.cjs +58 -0
  21. package/dist/{styles/components → components}/form/Button/Button.css.cjs +2 -2
  22. package/dist/{styles/components → components}/form/Button/Button.mjs +13 -11
  23. package/dist/components/form/Button/index.cjs +1 -0
  24. package/dist/components/form/Button/index.mjs +1 -0
  25. package/dist/components/form/Checkbox/Checkbox.cjs +78 -0
  26. package/dist/components/form/Checkbox/Checkbox.mjs +79 -0
  27. package/dist/{styles/components → components}/form/Checkbox/checkbox.css.cjs +3 -3
  28. package/dist/components/form/Checkbox/index.cjs +1 -0
  29. package/dist/components/form/Checkbox/index.mjs +1 -0
  30. package/dist/components/form/Input/Input.cjs +50 -0
  31. package/dist/components/form/Input/Input.mjs +51 -0
  32. package/dist/components/form/Input/index.cjs +1 -0
  33. package/dist/components/form/Input/index.mjs +1 -0
  34. package/dist/{styles/components → components}/form/Input/input.css.cjs +2 -2
  35. package/dist/components/form/Label/Label.cjs +29 -0
  36. package/dist/components/form/Label/Label.mjs +30 -0
  37. package/dist/components/form/Label/index.cjs +1 -0
  38. package/dist/components/form/Label/index.mjs +1 -0
  39. package/dist/components/form/Radio/Radio.cjs +47 -0
  40. package/dist/components/form/Radio/Radio.mjs +48 -0
  41. package/dist/components/form/Radio/RadioGroup.cjs +1 -0
  42. package/dist/components/form/Radio/RadioGroup.mjs +1 -0
  43. package/dist/components/form/Radio/index.cjs +1 -0
  44. package/dist/components/form/Radio/index.mjs +1 -0
  45. package/dist/{styles/components → components}/form/Radio/radio.css.cjs +3 -3
  46. package/dist/components/form/Select/Select.cjs +64 -0
  47. package/dist/{styles/components → components}/form/Select/Select.mjs +23 -6
  48. package/dist/components/form/Select/index.cjs +1 -0
  49. package/dist/components/form/Select/index.mjs +1 -0
  50. package/dist/{styles/components → components}/form/Select/select.css.cjs +4 -4
  51. package/dist/components/form/Slider/Slider.cjs +139 -0
  52. package/dist/components/form/Slider/Slider.mjs +142 -0
  53. package/dist/components/form/Slider/index.cjs +1 -0
  54. package/dist/components/form/Slider/index.mjs +1 -0
  55. package/dist/{styles/components → components}/form/Slider/slider.css.cjs +6 -6
  56. package/dist/components/form/Slider/usePointerProgress.cjs +44 -0
  57. package/dist/components/form/Slider/usePointerProgress.mjs +45 -0
  58. package/dist/{styles/components → components}/form/Switch/Switch.cjs +10 -8
  59. package/dist/{styles/components → components}/form/Switch/Switch.mjs +9 -5
  60. package/dist/components/form/Switch/index.cjs +1 -0
  61. package/dist/components/form/Switch/index.mjs +1 -0
  62. package/dist/{styles/components → components}/form/Switch/switch.css.cjs +3 -3
  63. package/dist/components/layout/Box/Box.cjs +27 -0
  64. package/dist/components/layout/Box/Box.mjs +28 -0
  65. package/dist/components/layout/Box/index.cjs +1 -0
  66. package/dist/components/layout/Box/index.mjs +1 -0
  67. package/dist/components/layout/Inline/Inline.cjs +29 -0
  68. package/dist/components/layout/Inline/Inline.mjs +30 -0
  69. package/dist/components/layout/Inline/index.cjs +1 -0
  70. package/dist/components/layout/Inline/index.mjs +1 -0
  71. package/dist/components/layout/Stack/Stack.cjs +29 -0
  72. package/dist/components/layout/Stack/Stack.mjs +30 -0
  73. package/dist/components/layout/Stack/index.cjs +1 -0
  74. package/dist/components/layout/Stack/index.mjs +1 -0
  75. package/dist/components/navigation/Link/Link.cjs +31 -0
  76. package/dist/components/navigation/Link/Link.mjs +32 -0
  77. package/dist/components/navigation/Link/index.cjs +1 -0
  78. package/dist/components/navigation/Link/index.mjs +1 -0
  79. package/dist/components/other/BlocksProvider/BlocksProvider.cjs +36 -0
  80. package/dist/components/other/BlocksProvider/BlocksProvider.mjs +39 -0
  81. package/dist/components/other/BlocksProvider/context.cjs +4 -0
  82. package/dist/components/other/BlocksProvider/context.mjs +7 -0
  83. package/dist/components/other/BlocksProvider/index.cjs +1 -0
  84. package/dist/components/other/BlocksProvider/index.mjs +1 -0
  85. package/dist/components/other/Portal/Portal.cjs +7 -0
  86. package/dist/components/other/Portal/Portal.mjs +8 -0
  87. package/dist/components/other/Portal/index.cjs +1 -0
  88. package/dist/components/other/Portal/index.mjs +1 -0
  89. package/dist/components/overlay/Dialog/Dialog.cjs +77 -0
  90. package/dist/components/overlay/Dialog/Dialog.mjs +80 -0
  91. package/dist/{styles/components → components}/overlay/Dialog/dialog.css.cjs +2 -2
  92. package/dist/components/overlay/Dialog/dialogHelper.cjs +20 -0
  93. package/dist/components/overlay/Dialog/dialogHelper.mjs +21 -0
  94. package/dist/components/overlay/Dialog/index.cjs +1 -0
  95. package/dist/components/overlay/Dialog/index.mjs +1 -0
  96. package/dist/components/overlay/Popover/Popover.cjs +111 -0
  97. package/dist/components/overlay/Popover/Popover.mjs +112 -0
  98. package/dist/components/overlay/Popover/popover-utils.cjs +61 -0
  99. package/dist/components/overlay/Popover/popover-utils.mjs +62 -0
  100. package/dist/components/overlay/Tooltip/Tooltip.cjs +71 -0
  101. package/dist/components/overlay/Tooltip/Tooltip.mjs +74 -0
  102. package/dist/components/overlay/Tooltip/index.cjs +1 -0
  103. package/dist/components/overlay/Tooltip/index.mjs +1 -0
  104. package/dist/components/typography/Heading/Heading.cjs +23 -0
  105. package/dist/components/typography/Heading/Heading.mjs +24 -0
  106. package/dist/{styles/components → components}/typography/Heading/heading.css.cjs +2 -2
  107. package/dist/components/typography/Heading/index.cjs +1 -0
  108. package/dist/components/typography/Heading/index.mjs +1 -0
  109. package/dist/components/typography/Text/Text.cjs +20 -0
  110. package/dist/{styles/components → components}/typography/Text/Text.mjs +2 -2
  111. package/dist/components/typography/Text/index.cjs +1 -0
  112. package/dist/components/typography/Text/index.mjs +1 -0
  113. package/dist/{styles/components → components}/typography/Text/text.css.cjs +2 -2
  114. package/dist/hooks/useClickOutside/useClickOutside.cjs +22 -0
  115. package/dist/hooks/useClickOutside/useClickOutside.mjs +23 -0
  116. package/dist/hooks/useControlledValue/useControlledValue.cjs +31 -0
  117. package/dist/hooks/useControlledValue/useControlledValue.mjs +32 -0
  118. package/dist/hooks/useIsomorphicLayoutEffect/index.cjs +1 -0
  119. package/dist/hooks/useIsomorphicLayoutEffect/index.mjs +1 -0
  120. package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs +4 -0
  121. package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs +7 -0
  122. package/dist/hooks/useKeyboard/index.cjs +1 -0
  123. package/dist/hooks/useKeyboard/index.mjs +1 -0
  124. package/dist/hooks/useKeyboard/useKeyboard.cjs +19 -0
  125. package/dist/hooks/useKeyboard/useKeyboard.mjs +22 -0
  126. package/dist/hooks/useLayer/index.cjs +1 -0
  127. package/dist/hooks/useLayer/index.mjs +1 -0
  128. package/dist/hooks/useLayer/useLayer.cjs +25 -0
  129. package/dist/hooks/useLayer/useLayer.mjs +26 -0
  130. package/dist/hooks/usePreventBodyScroll/index.cjs +1 -0
  131. package/dist/hooks/usePreventBodyScroll/index.mjs +1 -0
  132. package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.cjs +29 -0
  133. package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.mjs +30 -0
  134. package/dist/hooks/useRestoreFocus/index.cjs +1 -0
  135. package/dist/hooks/useRestoreFocus/index.mjs +1 -0
  136. package/dist/hooks/useRestoreFocus/useRestoreFocus.cjs +17 -0
  137. package/dist/hooks/useRestoreFocus/useRestoreFocus.mjs +18 -0
  138. package/dist/hooks/useRootAriaHidden/index.cjs +1 -0
  139. package/dist/hooks/useRootAriaHidden/index.mjs +1 -0
  140. package/dist/hooks/useRootAriaHidden/useRootAriaHidden.cjs +11 -0
  141. package/dist/hooks/useRootAriaHidden/useRootAriaHidden.mjs +12 -0
  142. package/dist/hooks/useVisibilityState/index.cjs +1 -0
  143. package/dist/hooks/useVisibilityState/index.mjs +1 -0
  144. package/dist/hooks/useVisibilityState/useVisibilityState.cjs +15 -0
  145. package/dist/hooks/useVisibilityState/useVisibilityState.mjs +16 -0
  146. package/dist/index.cjs +71 -444
  147. package/dist/index.d.mts +1 -1
  148. package/dist/index.d.ts +1 -1
  149. package/dist/index.mjs +37 -415
  150. package/dist/lib/asChildRenderer/createAsChildTemplate.cjs +72 -0
  151. package/dist/lib/asChildRenderer/createAsChildTemplate.mjs +73 -0
  152. package/dist/{styles/lib → lib}/css/atoms/atomicProperties.cjs +28 -22
  153. package/dist/{styles/lib → lib}/css/atoms/atomicProperties.mjs +7 -1
  154. package/dist/{styles/lib → lib}/css/atoms/sprinkles.css.cjs +8 -8
  155. package/dist/lib/css/flexbox/flexbox.cjs +16 -0
  156. package/dist/lib/css/flexbox/flexbox.mjs +17 -0
  157. package/dist/{styles/lib → lib}/css/style/style.cjs +3 -3
  158. package/dist/lib/react/mergeProps.cjs +42 -0
  159. package/dist/lib/react/mergeProps.mjs +43 -0
  160. package/dist/lib/react/refs.cjs +16 -0
  161. package/dist/lib/react/refs.mjs +17 -0
  162. package/dist/lib/theme/makeTheme.cjs +12 -0
  163. package/dist/lib/theme/store/theme.cjs +92 -0
  164. package/dist/lib/theme/store/theme.mjs +93 -0
  165. package/dist/lib/theme/vars.css.cjs +9 -0
  166. package/dist/{styles/lib → lib}/utils/atom-props.cjs +2 -2
  167. package/dist/lib/utils/classnames.cjs +6 -0
  168. package/dist/lib/utils/classnames.mjs +7 -0
  169. package/dist/lib/utils/dom.cjs +12 -0
  170. package/dist/lib/utils/dom.mjs +13 -0
  171. package/dist/lib/utils/math.cjs +12 -0
  172. package/dist/lib/utils/math.mjs +13 -0
  173. package/dist/momotaro.chunk.d.ts +40 -56
  174. package/dist/reset.cjs +2 -2
  175. package/dist/reset.mjs +2 -2
  176. package/dist/{styles/themes → themes}/momotaro/components/button.css.cjs +23 -23
  177. package/dist/themes/momotaro/components/checkbox.css.cjs +59 -0
  178. package/dist/{styles/themes → themes}/momotaro/components/dialog.css.cjs +4 -4
  179. package/dist/{styles/themes → themes}/momotaro/components/divider.css.cjs +2 -2
  180. package/dist/{styles/themes → themes}/momotaro/components/helpers.css.cjs +3 -3
  181. package/dist/themes/momotaro/components/index.cjs +34 -0
  182. package/dist/{styles/themes → themes}/momotaro/components/input.css.cjs +9 -9
  183. package/dist/{styles/themes → themes}/momotaro/components/label.css.cjs +7 -7
  184. package/dist/{styles/themes → themes}/momotaro/components/link.css.cjs +7 -7
  185. package/dist/{styles/themes → themes}/momotaro/components/popover.css.cjs +4 -4
  186. package/dist/{styles/themes → themes}/momotaro/components/progress.css.cjs +7 -7
  187. package/dist/themes/momotaro/components/radio.css.cjs +60 -0
  188. package/dist/themes/momotaro/components/select.css.cjs +44 -0
  189. package/dist/themes/momotaro/components/slider.css.cjs +89 -0
  190. package/dist/{styles/themes → themes}/momotaro/components/spinner.css.cjs +2 -2
  191. package/dist/{styles/themes → themes}/momotaro/components/switch.css.cjs +10 -10
  192. package/dist/{styles/themes → themes}/momotaro/components/tooltip.css.cjs +6 -6
  193. package/dist/themes/momotaro/momotaro.css.cjs +13 -0
  194. package/dist/{styles/themes → themes}/momotaro/tokens.css.cjs +11 -11
  195. package/dist/themes/momotaro.cjs +2 -2
  196. package/dist/themes/momotaro.mjs +1 -1
  197. package/package.json +5 -15
  198. package/dist/styles/components/Accessibility/VisuallyHidden/VisuallyHidden.cjs +0 -16
  199. package/dist/styles/components/Accessibility/VisuallyHidden/VisuallyHidden.mjs +0 -17
  200. package/dist/styles/components/display/Divider/Divider.cjs +0 -239
  201. package/dist/styles/components/display/Divider/Divider.mjs +0 -240
  202. package/dist/styles/components/form/Button/Button.cjs +0 -56
  203. package/dist/styles/components/form/Checkbox/Checkbox.cjs +0 -84
  204. package/dist/styles/components/form/Checkbox/Checkbox.mjs +0 -85
  205. package/dist/styles/components/form/Input/Input.cjs +0 -37
  206. package/dist/styles/components/form/Input/Input.mjs +0 -38
  207. package/dist/styles/components/form/Radio/Radio.cjs +0 -23
  208. package/dist/styles/components/form/Radio/Radio.mjs +0 -24
  209. package/dist/styles/components/form/Select/Select.cjs +0 -47
  210. package/dist/styles/components/form/Slider/Slider.cjs +0 -205
  211. package/dist/styles/components/form/Slider/Slider.mjs +0 -206
  212. package/dist/styles/components/other/BlocksProvider/BlocksProvider.cjs +0 -41
  213. package/dist/styles/components/other/BlocksProvider/BlocksProvider.mjs +0 -42
  214. package/dist/styles/components/overlay/Dialog/Dialog.cjs +0 -172
  215. package/dist/styles/components/overlay/Dialog/Dialog.mjs +0 -173
  216. package/dist/styles/components/typography/Heading/Heading.cjs +0 -15
  217. package/dist/styles/components/typography/Heading/Heading.mjs +0 -16
  218. package/dist/styles/components/typography/Text/Text.cjs +0 -20
  219. package/dist/styles/lib/theme/makeTheme.cjs +0 -12
  220. package/dist/styles/lib/theme/vars.css.cjs +0 -9
  221. package/dist/styles/themes/momotaro/components/checkbox.css.cjs +0 -59
  222. package/dist/styles/themes/momotaro/components/index.cjs +0 -34
  223. package/dist/styles/themes/momotaro/components/radio.css.cjs +0 -60
  224. package/dist/styles/themes/momotaro/components/select.css.cjs +0 -44
  225. package/dist/styles/themes/momotaro/components/slider.css.cjs +0 -89
  226. package/dist/styles/themes/momotaro/momotaro.css.cjs +0 -13
  227. /package/dist/{styles/components → components}/display/Divider/divider.css.mjs +0 -0
  228. /package/dist/{styles/components → components}/form/Button/Button.css.mjs +0 -0
  229. /package/dist/{styles/components → components}/form/Checkbox/checkbox.css.mjs +0 -0
  230. /package/dist/{styles/components → components}/form/Input/input.css.mjs +0 -0
  231. /package/dist/{styles/components → components}/form/Radio/radio.css.mjs +0 -0
  232. /package/dist/{styles/components → components}/form/Select/select.css.mjs +0 -0
  233. /package/dist/{styles/components → components}/form/Slider/slider.css.mjs +0 -0
  234. /package/dist/{styles/components → components}/form/Switch/switch.css.mjs +0 -0
  235. /package/dist/{styles/components → components}/overlay/Dialog/dialog.css.mjs +0 -0
  236. /package/dist/{styles/components → components}/typography/Heading/heading.css.mjs +0 -0
  237. /package/dist/{styles/components → components}/typography/Text/text.css.mjs +0 -0
  238. /package/dist/{styles/lib → lib}/css/atoms/atoms.cjs +0 -0
  239. /package/dist/{styles/lib → lib}/css/atoms/atoms.mjs +0 -0
  240. /package/dist/{styles/lib → lib}/css/atoms/breakpoints.cjs +0 -0
  241. /package/dist/{styles/lib → lib}/css/atoms/breakpoints.mjs +0 -0
  242. /package/dist/{styles/lib → lib}/css/atoms/index.cjs +0 -0
  243. /package/dist/{styles/lib → lib}/css/atoms/index.mjs +0 -0
  244. /package/dist/{styles/lib → lib}/css/atoms/sprinkles.css.mjs +0 -0
  245. /package/dist/{styles/lib → lib}/css/layers/layers.css.cjs +0 -0
  246. /package/dist/{styles/lib → lib}/css/layers/layers.css.mjs +0 -0
  247. /package/dist/{styles/lib → lib}/css/reset/reset.css.cjs +0 -0
  248. /package/dist/{styles/lib → lib}/css/reset/reset.css.mjs +0 -0
  249. /package/dist/{styles/lib → lib}/css/style/style.mjs +0 -0
  250. /package/dist/{styles/lib → lib}/css/utils/cssUtils.cjs +0 -0
  251. /package/dist/{styles/lib → lib}/css/utils/cssUtils.mjs +0 -0
  252. /package/dist/{styles/lib → lib}/theme/makeComponentTheme.cjs +0 -0
  253. /package/dist/{styles/lib → lib}/theme/makeComponentTheme.mjs +0 -0
  254. /package/dist/{styles/lib → lib}/theme/makeTheme.mjs +0 -0
  255. /package/dist/{styles/lib → lib}/theme/makeVanillaTheme.cjs +0 -0
  256. /package/dist/{styles/lib → lib}/theme/makeVanillaTheme.mjs +0 -0
  257. /package/dist/{styles/lib → lib}/theme/tokens.cjs +0 -0
  258. /package/dist/{styles/lib → lib}/theme/tokens.mjs +0 -0
  259. /package/dist/{styles/lib → lib}/theme/vars.css.mjs +0 -0
  260. /package/dist/{styles/lib → lib}/utils/atom-props.mjs +0 -0
  261. /package/dist/{styles/themes → themes}/momotaro/components/button.css.mjs +0 -0
  262. /package/dist/{styles/themes → themes}/momotaro/components/checkbox.css.mjs +0 -0
  263. /package/dist/{styles/themes → themes}/momotaro/components/dialog.css.mjs +0 -0
  264. /package/dist/{styles/themes → themes}/momotaro/components/divider.css.mjs +0 -0
  265. /package/dist/{styles/themes → themes}/momotaro/components/helpers.css.mjs +0 -0
  266. /package/dist/{styles/themes → themes}/momotaro/components/index.mjs +0 -0
  267. /package/dist/{styles/themes → themes}/momotaro/components/input.css.mjs +0 -0
  268. /package/dist/{styles/themes → themes}/momotaro/components/label.css.mjs +0 -0
  269. /package/dist/{styles/themes → themes}/momotaro/components/link.css.mjs +0 -0
  270. /package/dist/{styles/themes → themes}/momotaro/components/popover.css.mjs +0 -0
  271. /package/dist/{styles/themes → themes}/momotaro/components/progress.css.mjs +0 -0
  272. /package/dist/{styles/themes → themes}/momotaro/components/radio.css.mjs +0 -0
  273. /package/dist/{styles/themes → themes}/momotaro/components/select.css.mjs +0 -0
  274. /package/dist/{styles/themes → themes}/momotaro/components/slider.css.mjs +0 -0
  275. /package/dist/{styles/themes → themes}/momotaro/components/spinner.css.mjs +0 -0
  276. /package/dist/{styles/themes → themes}/momotaro/components/switch.css.mjs +0 -0
  277. /package/dist/{styles/themes → themes}/momotaro/components/tooltip.css.mjs +0 -0
  278. /package/dist/{styles/themes → themes}/momotaro/components/transitions.cjs +0 -0
  279. /package/dist/{styles/themes → themes}/momotaro/components/transitions.mjs +0 -0
  280. /package/dist/{styles/themes → themes}/momotaro/index.cjs +0 -0
  281. /package/dist/{styles/themes → themes}/momotaro/index.mjs +0 -0
  282. /package/dist/{styles/themes → themes}/momotaro/momotaro.css.mjs +0 -0
  283. /package/dist/{styles/themes → themes}/momotaro/tokens.css.mjs +0 -0
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- const styles_lib_theme_vars_css_cjs = require("../../theme/vars.css.cjs");
3
- const colorsWithCurrentColor = { ...styles_lib_theme_vars_css_cjs.vars.color, currentColor: "currentColor" };
2
+ const lib_theme_vars_css_cjs = require("../../theme/vars.css.cjs");
3
+ const colorsWithCurrentColor = { ...lib_theme_vars_css_cjs.vars.color, currentColor: "currentColor" };
4
4
  const size = { auto: "auto", full: "100%", "fit-content": "fit-content" };
5
5
  const unresponsiveProperties = {
6
6
  backgroundColor: colorsWithCurrentColor,
7
7
  borderColor: colorsWithCurrentColor,
8
- borderRadius: styles_lib_theme_vars_css_cjs.vars.borderRadius,
9
- borderWidth: styles_lib_theme_vars_css_cjs.vars.borderWidth,
8
+ borderRadius: lib_theme_vars_css_cjs.vars.borderRadius,
9
+ borderWidth: lib_theme_vars_css_cjs.vars.borderWidth,
10
10
  border: ["none"],
11
11
  insetBlock: [0],
12
12
  insetBlockStart: [0],
@@ -14,13 +14,13 @@ const unresponsiveProperties = {
14
14
  insetInline: [0],
15
15
  insetInlineStart: [0],
16
16
  insetInlineEnd: [0],
17
- boxShadow: styles_lib_theme_vars_css_cjs.vars.shadow,
17
+ boxShadow: lib_theme_vars_css_cjs.vars.shadow,
18
18
  color: colorsWithCurrentColor,
19
19
  cursor: ["auto", "pointer"],
20
- fontFamily: styles_lib_theme_vars_css_cjs.vars.fontFamily,
20
+ fontFamily: lib_theme_vars_css_cjs.vars.fontFamily,
21
21
  fontStyle: ["normal", "italic", "oblique"],
22
- fontWeight: styles_lib_theme_vars_css_cjs.vars.fontWeight,
23
- lineHeight: styles_lib_theme_vars_css_cjs.vars.lineHeight,
22
+ fontWeight: lib_theme_vars_css_cjs.vars.fontWeight,
23
+ lineHeight: lib_theme_vars_css_cjs.vars.lineHeight,
24
24
  blockSize: size,
25
25
  maxBlockSize: size,
26
26
  inlineSize: size,
@@ -33,18 +33,18 @@ const unresponsiveProperties = {
33
33
  textDecoration: ["overline", "line-through", "underline", "none"],
34
34
  textTransform: ["lowercase", "uppercase", "capitalize"],
35
35
  textWrap: ["balance", "wrap"],
36
- transition: styles_lib_theme_vars_css_cjs.vars.transition,
36
+ transition: lib_theme_vars_css_cjs.vars.transition,
37
37
  userSelect: ["none"],
38
38
  whiteSpace: ["nowrap", "pre", "pre-line", "pre-wrap"],
39
39
  wordBreak: ["break-word"],
40
40
  wordWrap: ["break-word"]
41
41
  };
42
- const marginSpace = { auto: "auto", ...styles_lib_theme_vars_css_cjs.vars.space };
42
+ const marginSpace = { auto: "auto", ...lib_theme_vars_css_cjs.vars.space };
43
43
  const responsiveProperties = {
44
44
  alignContent: ["stretch", "center", "flex-start", "flex-end"],
45
45
  alignItems: ["stretch", "center", "flex-start", "flex-end"],
46
46
  alignSelf: ["stretch", "center", "flex-start", "flex-end"],
47
- columnGap: styles_lib_theme_vars_css_cjs.vars.space,
47
+ columnGap: lib_theme_vars_css_cjs.vars.space,
48
48
  display: [
49
49
  "none",
50
50
  "flex",
@@ -60,23 +60,29 @@ const responsiveProperties = {
60
60
  flexGrow: [0, 1],
61
61
  flexShrink: [0, 1],
62
62
  flexWrap: ["nowrap", "wrap"],
63
- fontSize: styles_lib_theme_vars_css_cjs.vars.fontSize,
64
- gap: styles_lib_theme_vars_css_cjs.vars.space,
65
- justifyContent: ["flex-start", "flex-end", "center", "space-between", "space-around"],
63
+ fontSize: lib_theme_vars_css_cjs.vars.fontSize,
64
+ gap: lib_theme_vars_css_cjs.vars.space,
65
+ justifyContent: [
66
+ "flex-start",
67
+ "flex-end",
68
+ "center",
69
+ "space-between",
70
+ "space-around"
71
+ ],
66
72
  marginBlockStart: marginSpace,
67
73
  marginBlockEnd: marginSpace,
68
74
  marginInlineStart: marginSpace,
69
75
  marginInlineEnd: marginSpace,
70
76
  outline: ["none"],
71
- padding: styles_lib_theme_vars_css_cjs.vars.space,
72
- paddingBlock: styles_lib_theme_vars_css_cjs.vars.space,
73
- paddingBlockStart: styles_lib_theme_vars_css_cjs.vars.space,
74
- paddingBlockEnd: styles_lib_theme_vars_css_cjs.vars.space,
75
- paddingInline: styles_lib_theme_vars_css_cjs.vars.space,
76
- paddingInlineStart: styles_lib_theme_vars_css_cjs.vars.space,
77
- paddingInlineEnd: styles_lib_theme_vars_css_cjs.vars.space,
77
+ padding: lib_theme_vars_css_cjs.vars.space,
78
+ paddingBlock: lib_theme_vars_css_cjs.vars.space,
79
+ paddingBlockStart: lib_theme_vars_css_cjs.vars.space,
80
+ paddingBlockEnd: lib_theme_vars_css_cjs.vars.space,
81
+ paddingInline: lib_theme_vars_css_cjs.vars.space,
82
+ paddingInlineStart: lib_theme_vars_css_cjs.vars.space,
83
+ paddingInlineEnd: lib_theme_vars_css_cjs.vars.space,
78
84
  position: ["relative", "fixed", "absolute", "sticky", "static"],
79
- rowGap: styles_lib_theme_vars_css_cjs.vars.space,
85
+ rowGap: lib_theme_vars_css_cjs.vars.space,
80
86
  textAlign: ["center", "left", "right", "justify"]
81
87
  };
82
88
  exports.responsiveProperties = responsiveProperties;
@@ -61,7 +61,13 @@ const responsiveProperties = {
61
61
  flexWrap: ["nowrap", "wrap"],
62
62
  fontSize: vars.fontSize,
63
63
  gap: vars.space,
64
- justifyContent: ["flex-start", "flex-end", "center", "space-between", "space-around"],
64
+ justifyContent: [
65
+ "flex-start",
66
+ "flex-end",
67
+ "center",
68
+ "space-between",
69
+ "space-around"
70
+ ],
65
71
  marginBlockStart: marginSpace,
66
72
  marginBlockEnd: marginSpace,
67
73
  marginInlineStart: marginSpace,
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  const fileScope = require("@vanilla-extract/css/fileScope");
3
3
  const sprinkles = require("@vanilla-extract/sprinkles");
4
- const styles_lib_css_atoms_atomicProperties_cjs = require("./atomicProperties.cjs");
5
- const styles_lib_css_atoms_breakpoints_cjs = require("./breakpoints.cjs");
4
+ const lib_css_atoms_atomicProperties_cjs = require("./atomicProperties.cjs");
5
+ const lib_css_atoms_breakpoints_cjs = require("./breakpoints.cjs");
6
6
  fileScope.setFileScope("src/lib/css/atoms/sprinkles.css.ts", "@blockle/blocks");
7
7
  const unresponsiveAtomicProperties = sprinkles.defineProperties({
8
- properties: styles_lib_css_atoms_atomicProperties_cjs.unresponsiveProperties,
8
+ properties: lib_css_atoms_atomicProperties_cjs.unresponsiveProperties,
9
9
  shorthands: {
10
10
  inset: ["insetBlockStart", "insetBlockEnd", "insetInlineStart", "insetInlineEnd"]
11
11
  }
@@ -15,17 +15,17 @@ const responsiveAtomicProperties = sprinkles.defineProperties({
15
15
  conditions: {
16
16
  mobile: {},
17
17
  tablet: {
18
- "@media": styles_lib_css_atoms_breakpoints_cjs.minMediaQuery("tablet")
18
+ "@media": lib_css_atoms_breakpoints_cjs.minMediaQuery("tablet")
19
19
  },
20
20
  desktop: {
21
- "@media": styles_lib_css_atoms_breakpoints_cjs.minMediaQuery("desktop")
21
+ "@media": lib_css_atoms_breakpoints_cjs.minMediaQuery("desktop")
22
22
  },
23
23
  wide: {
24
- "@media": styles_lib_css_atoms_breakpoints_cjs.minMediaQuery("wide")
24
+ "@media": lib_css_atoms_breakpoints_cjs.minMediaQuery("wide")
25
25
  }
26
26
  },
27
- responsiveArray: styles_lib_css_atoms_breakpoints_cjs.breakpointNames,
28
- properties: styles_lib_css_atoms_atomicProperties_cjs.responsiveProperties,
27
+ responsiveArray: lib_css_atoms_breakpoints_cjs.breakpointNames,
28
+ properties: lib_css_atoms_atomicProperties_cjs.responsiveProperties,
29
29
  shorthands: {
30
30
  margin: ["marginBlockStart", "marginBlockEnd", "marginInlineStart", "marginInlineEnd"],
31
31
  marginBlock: ["marginBlockStart", "marginBlockEnd"],
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ const justifyContentMap = {
3
+ left: "flex-start",
4
+ right: "flex-end",
5
+ center: "center",
6
+ between: "space-between",
7
+ around: "space-around"
8
+ };
9
+ const alignItemsMap = {
10
+ left: "flex-start",
11
+ right: "flex-end",
12
+ center: "center",
13
+ stretch: "stretch"
14
+ };
15
+ exports.alignItemsMap = alignItemsMap;
16
+ exports.justifyContentMap = justifyContentMap;
@@ -0,0 +1,17 @@
1
+ const justifyContentMap = {
2
+ left: "flex-start",
3
+ right: "flex-end",
4
+ center: "center",
5
+ between: "space-between",
6
+ around: "space-around"
7
+ };
8
+ const alignItemsMap = {
9
+ left: "flex-start",
10
+ right: "flex-end",
11
+ center: "center",
12
+ stretch: "stretch"
13
+ };
14
+ export {
15
+ alignItemsMap,
16
+ justifyContentMap
17
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const css = require("@vanilla-extract/css");
3
- const styles_lib_css_atoms_sprinkles_css_cjs = require("../atoms/sprinkles.css.cjs");
3
+ const lib_css_atoms_sprinkles_css_cjs = require("../atoms/sprinkles.css.cjs");
4
4
  function style(props) {
5
5
  const styleRule = {};
6
6
  const atomClassNames = [];
@@ -13,9 +13,9 @@ function style(props) {
13
13
  }).join(" ");
14
14
  }
15
15
  for (const [name, value] of Object.entries(props)) {
16
- if (styles_lib_css_atoms_sprinkles_css_cjs.atoms.properties.has(name)) {
16
+ if (lib_css_atoms_sprinkles_css_cjs.atoms.properties.has(name)) {
17
17
  try {
18
- atomClassNames.push(styles_lib_css_atoms_sprinkles_css_cjs.atoms({ [name]: value }));
18
+ atomClassNames.push(lib_css_atoms_sprinkles_css_cjs.atoms({ [name]: value }));
19
19
  } catch {
20
20
  styleRule[name] = value;
21
21
  }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ const lib_utils_classnames_cjs = require("../utils/classnames.cjs");
3
+ const lib_react_refs_cjs = require("./refs.cjs");
4
+ function mergeProps(slotProps, childProps) {
5
+ const overrideProps = {};
6
+ for (const propName in childProps) {
7
+ const slotPropValue = slotProps[propName];
8
+ const childPropValue = childProps[propName];
9
+ if (childPropValue === void 0) {
10
+ continue;
11
+ }
12
+ if (slotPropValue === void 0) {
13
+ overrideProps[propName] = childPropValue;
14
+ continue;
15
+ }
16
+ if (typeof slotPropValue === "function" && typeof childPropValue === "function") {
17
+ overrideProps[propName] = (...args) => {
18
+ childPropValue(...args);
19
+ slotPropValue(...args);
20
+ };
21
+ } else
22
+ switch (propName) {
23
+ case "style": {
24
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
25
+ break;
26
+ }
27
+ case "className": {
28
+ overrideProps[propName] = lib_utils_classnames_cjs.classnames(slotPropValue, childPropValue);
29
+ break;
30
+ }
31
+ case "ref": {
32
+ overrideProps[propName] = lib_react_refs_cjs.composeRefs(slotPropValue, childPropValue);
33
+ break;
34
+ }
35
+ default: {
36
+ overrideProps[propName] = childPropValue;
37
+ }
38
+ }
39
+ }
40
+ return { ...slotProps, ...overrideProps };
41
+ }
42
+ exports.mergeProps = mergeProps;
@@ -0,0 +1,43 @@
1
+ import { classnames } from "../utils/classnames.mjs";
2
+ import { composeRefs } from "./refs.mjs";
3
+ function mergeProps(slotProps, childProps) {
4
+ const overrideProps = {};
5
+ for (const propName in childProps) {
6
+ const slotPropValue = slotProps[propName];
7
+ const childPropValue = childProps[propName];
8
+ if (childPropValue === void 0) {
9
+ continue;
10
+ }
11
+ if (slotPropValue === void 0) {
12
+ overrideProps[propName] = childPropValue;
13
+ continue;
14
+ }
15
+ if (typeof slotPropValue === "function" && typeof childPropValue === "function") {
16
+ overrideProps[propName] = (...args) => {
17
+ childPropValue(...args);
18
+ slotPropValue(...args);
19
+ };
20
+ } else
21
+ switch (propName) {
22
+ case "style": {
23
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
24
+ break;
25
+ }
26
+ case "className": {
27
+ overrideProps[propName] = classnames(slotPropValue, childPropValue);
28
+ break;
29
+ }
30
+ case "ref": {
31
+ overrideProps[propName] = composeRefs(slotPropValue, childPropValue);
32
+ break;
33
+ }
34
+ default: {
35
+ overrideProps[propName] = childPropValue;
36
+ }
37
+ }
38
+ }
39
+ return { ...slotProps, ...overrideProps };
40
+ }
41
+ export {
42
+ mergeProps
43
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ function setRef(ref, value) {
3
+ if (typeof ref === "function") {
4
+ ref(value);
5
+ } else if (ref !== null && ref !== void 0) {
6
+ ref.current = value;
7
+ }
8
+ }
9
+ function composeRefs(...refs) {
10
+ return (node) => {
11
+ for (const ref of refs) {
12
+ setRef(ref, node);
13
+ }
14
+ };
15
+ }
16
+ exports.composeRefs = composeRefs;
@@ -0,0 +1,17 @@
1
+ function setRef(ref, value) {
2
+ if (typeof ref === "function") {
3
+ ref(value);
4
+ } else if (ref !== null && ref !== void 0) {
5
+ ref.current = value;
6
+ }
7
+ }
8
+ function composeRefs(...refs) {
9
+ return (node) => {
10
+ for (const ref of refs) {
11
+ setRef(ref, node);
12
+ }
13
+ };
14
+ }
15
+ export {
16
+ composeRefs
17
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ const css = require("@vanilla-extract/css");
3
+ const lib_theme_makeVanillaTheme_cjs = require("./makeVanillaTheme.cjs");
4
+ const lib_theme_vars_css_cjs = require("./vars.css.cjs");
5
+ function makeTheme(theme) {
6
+ return {
7
+ name: theme.name,
8
+ vars: css.createTheme(lib_theme_vars_css_cjs.vars, lib_theme_makeVanillaTheme_cjs.makeVanillaTheme(theme.tokens)),
9
+ components: theme.components
10
+ };
11
+ }
12
+ exports.makeTheme = makeTheme;
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ let currentTheme = null;
3
+ function setTheme(theme) {
4
+ currentTheme = theme;
5
+ }
6
+ function getTheme() {
7
+ if (!currentTheme) {
8
+ throw new Error("No theme has been set. Use setTheme() to set a theme.");
9
+ }
10
+ return currentTheme;
11
+ }
12
+ function getComponentStyles(name, props, useDefaultVariants = true) {
13
+ const { components } = getTheme();
14
+ const component = components[name];
15
+ if (!component) {
16
+ console.warn(`Component ${name} is not defined in the theme`);
17
+ return "";
18
+ }
19
+ const classNames = [];
20
+ const variants = props.variants ?? {};
21
+ const variantsWithDefaults = { ...variants };
22
+ for (const key in props) {
23
+ const value = props[key];
24
+ if (typeof value === "boolean" && value) {
25
+ classNames.push(
26
+ // biome-ignore lint/suspicious/noExplicitAny: This is a type assertion for a dynamic key
27
+ component[key]
28
+ );
29
+ }
30
+ }
31
+ if (!component.variants) {
32
+ return classNames.join(" ");
33
+ }
34
+ const { defaultVariants } = component;
35
+ if (useDefaultVariants && defaultVariants) {
36
+ const keys2 = Object.keys(defaultVariants);
37
+ for (const key of keys2) {
38
+ if (variantsWithDefaults[key] === void 0 && defaultVariants[key]) {
39
+ variantsWithDefaults[key] = defaultVariants[key];
40
+ }
41
+ }
42
+ }
43
+ const keys = Object.keys(variantsWithDefaults);
44
+ const componentVariants = component.variants;
45
+ for (const key of keys) {
46
+ const value = variantsWithDefaults[key];
47
+ if (value === void 0 || componentVariants[key] === void 0) {
48
+ continue;
49
+ }
50
+ if (typeof value === "boolean") {
51
+ if (value && componentVariants[key]) {
52
+ classNames.push(componentVariants[key]);
53
+ }
54
+ continue;
55
+ }
56
+ const variant = componentVariants[key][value];
57
+ if (variant) {
58
+ classNames.push(variant);
59
+ }
60
+ }
61
+ const { compoundVariants } = component;
62
+ if (compoundVariants) {
63
+ for (const compoundVariant of compoundVariants) {
64
+ const keys2 = Object.keys(
65
+ compoundVariant.variants
66
+ );
67
+ const matches = keys2.every((key) => {
68
+ const value = variantsWithDefaults[key];
69
+ if (value === void 0) {
70
+ return false;
71
+ }
72
+ return value === compoundVariant.variants[key];
73
+ });
74
+ if (matches) {
75
+ classNames.push(compoundVariant.style);
76
+ }
77
+ }
78
+ }
79
+ return classNames.join(" ");
80
+ }
81
+ function getComponentStyleDefaults(name) {
82
+ const { components } = getTheme();
83
+ const component = components[name];
84
+ if (!component) {
85
+ return {};
86
+ }
87
+ return component.defaultVariants ?? {};
88
+ }
89
+ exports.getComponentStyleDefaults = getComponentStyleDefaults;
90
+ exports.getComponentStyles = getComponentStyles;
91
+ exports.getTheme = getTheme;
92
+ exports.setTheme = setTheme;
@@ -0,0 +1,93 @@
1
+ let currentTheme = null;
2
+ function setTheme(theme) {
3
+ currentTheme = theme;
4
+ }
5
+ function getTheme() {
6
+ if (!currentTheme) {
7
+ throw new Error("No theme has been set. Use setTheme() to set a theme.");
8
+ }
9
+ return currentTheme;
10
+ }
11
+ function getComponentStyles(name, props, useDefaultVariants = true) {
12
+ const { components } = getTheme();
13
+ const component = components[name];
14
+ if (!component) {
15
+ console.warn(`Component ${name} is not defined in the theme`);
16
+ return "";
17
+ }
18
+ const classNames = [];
19
+ const variants = props.variants ?? {};
20
+ const variantsWithDefaults = { ...variants };
21
+ for (const key in props) {
22
+ const value = props[key];
23
+ if (typeof value === "boolean" && value) {
24
+ classNames.push(
25
+ // biome-ignore lint/suspicious/noExplicitAny: This is a type assertion for a dynamic key
26
+ component[key]
27
+ );
28
+ }
29
+ }
30
+ if (!component.variants) {
31
+ return classNames.join(" ");
32
+ }
33
+ const { defaultVariants } = component;
34
+ if (useDefaultVariants && defaultVariants) {
35
+ const keys2 = Object.keys(defaultVariants);
36
+ for (const key of keys2) {
37
+ if (variantsWithDefaults[key] === void 0 && defaultVariants[key]) {
38
+ variantsWithDefaults[key] = defaultVariants[key];
39
+ }
40
+ }
41
+ }
42
+ const keys = Object.keys(variantsWithDefaults);
43
+ const componentVariants = component.variants;
44
+ for (const key of keys) {
45
+ const value = variantsWithDefaults[key];
46
+ if (value === void 0 || componentVariants[key] === void 0) {
47
+ continue;
48
+ }
49
+ if (typeof value === "boolean") {
50
+ if (value && componentVariants[key]) {
51
+ classNames.push(componentVariants[key]);
52
+ }
53
+ continue;
54
+ }
55
+ const variant = componentVariants[key][value];
56
+ if (variant) {
57
+ classNames.push(variant);
58
+ }
59
+ }
60
+ const { compoundVariants } = component;
61
+ if (compoundVariants) {
62
+ for (const compoundVariant of compoundVariants) {
63
+ const keys2 = Object.keys(
64
+ compoundVariant.variants
65
+ );
66
+ const matches = keys2.every((key) => {
67
+ const value = variantsWithDefaults[key];
68
+ if (value === void 0) {
69
+ return false;
70
+ }
71
+ return value === compoundVariant.variants[key];
72
+ });
73
+ if (matches) {
74
+ classNames.push(compoundVariant.style);
75
+ }
76
+ }
77
+ }
78
+ return classNames.join(" ");
79
+ }
80
+ function getComponentStyleDefaults(name) {
81
+ const { components } = getTheme();
82
+ const component = components[name];
83
+ if (!component) {
84
+ return {};
85
+ }
86
+ return component.defaultVariants ?? {};
87
+ }
88
+ export {
89
+ getComponentStyleDefaults,
90
+ getComponentStyles,
91
+ getTheme,
92
+ setTheme
93
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ const fileScope = require("@vanilla-extract/css/fileScope");
3
+ const css = require("@vanilla-extract/css");
4
+ const lib_theme_makeVanillaTheme_cjs = require("./makeVanillaTheme.cjs");
5
+ const lib_theme_tokens_cjs = require("./tokens.cjs");
6
+ fileScope.setFileScope("src/lib/theme/vars.css.ts", "@blockle/blocks");
7
+ const vars = css.createThemeContract(lib_theme_makeVanillaTheme_cjs.makeVanillaTheme(lib_theme_tokens_cjs.tokens));
8
+ fileScope.endFileScope();
9
+ exports.vars = vars;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
- const styles_lib_css_atoms_sprinkles_css_cjs = require("../css/atoms/sprinkles.css.cjs");
2
+ const lib_css_atoms_sprinkles_css_cjs = require("../css/atoms/sprinkles.css.cjs");
3
3
  function getAtomsAndProps(props) {
4
4
  const atomProps = {};
5
5
  const otherProps = {};
6
6
  for (const [name, value] of Object.entries(props)) {
7
- if (styles_lib_css_atoms_sprinkles_css_cjs.atoms.properties.has(name)) {
7
+ if (lib_css_atoms_sprinkles_css_cjs.atoms.properties.has(name)) {
8
8
  atomProps[name] = value;
9
9
  } else {
10
10
  otherProps[name] = value;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ const classnames = (...args) => {
3
+ const className = args.filter((arg) => arg && typeof arg === "string").join(" ");
4
+ return className || void 0;
5
+ };
6
+ exports.classnames = classnames;
@@ -0,0 +1,7 @@
1
+ const classnames = (...args) => {
2
+ const className = args.filter((arg) => arg && typeof arg === "string").join(" ");
3
+ return className || void 0;
4
+ };
5
+ export {
6
+ classnames
7
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ function hasAnimationDuration(element) {
3
+ if (!element) {
4
+ return false;
5
+ }
6
+ const style = window.getComputedStyle(element);
7
+ return hasDuration(style.transitionDuration) || hasDuration(style.animationDuration);
8
+ }
9
+ function hasDuration(duration) {
10
+ return duration.split(",").map((part) => Number.parseFloat(part.trim())).some((part) => part > 0);
11
+ }
12
+ exports.hasAnimationDuration = hasAnimationDuration;
@@ -0,0 +1,13 @@
1
+ function hasAnimationDuration(element) {
2
+ if (!element) {
3
+ return false;
4
+ }
5
+ const style = window.getComputedStyle(element);
6
+ return hasDuration(style.transitionDuration) || hasDuration(style.animationDuration);
7
+ }
8
+ function hasDuration(duration) {
9
+ return duration.split(",").map((part) => Number.parseFloat(part.trim())).some((part) => part > 0);
10
+ }
11
+ export {
12
+ hasAnimationDuration
13
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ function roundToPrecision(value, precision) {
3
+ const factor = 10 ** precision;
4
+ return Math.round(value * factor) / factor;
5
+ }
6
+ function getBoundValue(newValue, min, max, step) {
7
+ let value = Math.round(newValue / step) * step;
8
+ value = Math.max(min, Math.min(max, value));
9
+ return value;
10
+ }
11
+ exports.getBoundValue = getBoundValue;
12
+ exports.roundToPrecision = roundToPrecision;
@@ -0,0 +1,13 @@
1
+ function roundToPrecision(value, precision) {
2
+ const factor = 10 ** precision;
3
+ return Math.round(value * factor) / factor;
4
+ }
5
+ function getBoundValue(newValue, min, max, step) {
6
+ let value = Math.round(newValue / step) * step;
7
+ value = Math.max(min, Math.min(max, value));
8
+ return value;
9
+ }
10
+ export {
11
+ getBoundValue,
12
+ roundToPrecision
13
+ };