@code0-tech/pictor 1.0.0 → 1.1.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 (459) hide show
  1. package/dist/_virtual/__vite-optional-peer-dep_@emotion/is-prop-valid_framer-motion.js +6 -0
  2. package/dist/_virtual/rolldown_runtime.js +18 -0
  3. package/dist/assets/Alert.style.css +1 -0
  4. package/dist/assets/Aurora.style.css +1 -0
  5. package/dist/assets/Avatar.style.css +1 -0
  6. package/dist/assets/Badge.style.css +1 -0
  7. package/dist/assets/Breadcrumb.style.css +1 -0
  8. package/dist/assets/Button.style.css +1 -0
  9. package/dist/assets/ButtonGroup.style.css +1 -0
  10. package/dist/assets/Card.style.css +1 -0
  11. package/dist/assets/Chart.style.css +1 -0
  12. package/dist/assets/Col.style.css +1 -0
  13. package/dist/assets/ColorInput.style.css +1 -0
  14. package/dist/assets/Command.style.css +1 -0
  15. package/dist/assets/Container.style.css +1 -0
  16. package/dist/assets/ContextMenu.style.css +1 -0
  17. package/dist/assets/DataTable.style.css +1 -0
  18. package/dist/assets/DateInput.style.css +1 -0
  19. package/dist/assets/Dialog.style.css +1 -0
  20. package/dist/assets/Editor.styles.css +1 -0
  21. package/dist/assets/EditorInput.style.css +1 -0
  22. package/dist/assets/FileInput.style.css +1 -0
  23. package/dist/assets/FileTabs.style.css +1 -0
  24. package/dist/assets/FullScreen.style.css +1 -0
  25. package/dist/assets/Gantt.style.css +1 -0
  26. package/dist/assets/Icon.style.css +1 -0
  27. package/dist/assets/Input.style.css +1 -0
  28. package/dist/assets/InputWrapper.style.css +1 -0
  29. package/dist/assets/JsonView.style.css +1 -0
  30. package/dist/assets/Layout.style.css +1 -0
  31. package/dist/assets/Menu.style.css +1 -0
  32. package/dist/assets/Progress.style.css +1 -0
  33. package/dist/assets/Quote.style.css +1 -0
  34. package/dist/assets/Resizable.style.css +1 -0
  35. package/dist/assets/Row.style.css +1 -0
  36. package/dist/assets/ScrollArea.style.css +1 -0
  37. package/dist/assets/SegmentedControl.style.css +1 -0
  38. package/dist/assets/SelectInput.style.css +1 -0
  39. package/dist/assets/Tab.style.css +1 -0
  40. package/dist/assets/Text.style.css +1 -0
  41. package/dist/assets/Toast.style.css +1 -0
  42. package/dist/assets/Tooltip.style.css +1 -0
  43. package/dist/components/alert/Alert.js +34 -41
  44. package/dist/components/aurora/Aurora.js +27 -22
  45. package/dist/components/avatar/Avatar.js +57 -55
  46. package/dist/components/badge/Badge.js +58 -64
  47. package/dist/components/breadcrumb/Breadcrumb.js +16 -21
  48. package/dist/components/button/Button.js +24 -31
  49. package/dist/components/button-group/ButtonGroup.js +29 -31
  50. package/dist/components/card/Card.js +30 -44
  51. package/dist/components/card/CardSection.js +21 -29
  52. package/dist/components/chart/Chart.js +138 -153
  53. package/dist/components/chart/LineChart.js +75 -74
  54. package/dist/components/chart/index.js +3 -8
  55. package/dist/components/col/Col.js +19 -29
  56. package/dist/components/command/Command.js +101 -134
  57. package/dist/components/container/Container.js +19 -23
  58. package/dist/components/context-menu/ContextMenu.js +119 -112
  59. package/dist/components/data-table/DataTable.js +53 -64
  60. package/dist/components/data-table/DataTableColumn.js +18 -22
  61. package/dist/components/data-table/DataTableFilterInput.js +208 -205
  62. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +59 -48
  63. package/dist/components/data-table/DataTableHeader.js +34 -38
  64. package/dist/components/data-table/DataTablePagination.js +62 -74
  65. package/dist/components/data-table/index.js +7 -22
  66. package/dist/components/dialog/Dialog.js +107 -97
  67. package/dist/components/editor/Editor.js +352 -323
  68. package/dist/components/file-tabs/FileTabs.js +78 -73
  69. package/dist/components/file-tabs/FileTabs.service.js +85 -87
  70. package/dist/components/file-tabs/FileTabs.view.js +0 -1
  71. package/dist/components/file-tabs/index.js +3 -9
  72. package/dist/components/flex/Flex.js +19 -23
  73. package/dist/components/form/CheckboxInput.js +73 -76
  74. package/dist/components/form/ColorInput.js +378 -353
  75. package/dist/components/form/DateInput.js +315 -265
  76. package/dist/components/form/EditorInput.js +597 -579
  77. package/dist/components/form/EmailInput.js +30 -23
  78. package/dist/components/form/FileInput.js +93 -123
  79. package/dist/components/form/Input.js +64 -58
  80. package/dist/components/form/Input.utils.js +25 -37
  81. package/dist/components/form/InputDescription.js +11 -11
  82. package/dist/components/form/InputLabel.js +18 -22
  83. package/dist/components/form/InputMessage.js +17 -17
  84. package/dist/components/form/InputWrapper.js +56 -65
  85. package/dist/components/form/NumberInput.js +41 -20
  86. package/dist/components/form/PasswordInput.js +71 -54
  87. package/dist/components/form/PinInput.js +50 -65
  88. package/dist/components/form/RadioGroup.js +42 -50
  89. package/dist/components/form/RadioInput.js +31 -29
  90. package/dist/components/form/SelectInput.js +69 -92
  91. package/dist/components/form/SwitchInput.js +17 -18
  92. package/dist/components/form/TagInput.js +108 -122
  93. package/dist/components/form/TextAreaInput.js +24 -21
  94. package/dist/components/form/TextInput.js +30 -22
  95. package/dist/components/form/index.js +22 -87
  96. package/dist/components/form/useForm.js +87 -88
  97. package/dist/components/fullscreen/FullScreen.js +28 -27
  98. package/dist/components/gantt/Gantt.js +100 -98
  99. package/dist/components/gantt/GanttGroup.js +210 -195
  100. package/dist/components/gantt/GanttHeader.js +79 -81
  101. package/dist/components/gantt/GanttItem.js +19 -22
  102. package/dist/components/icon/Icon.d.ts +6 -4
  103. package/dist/components/icon/Icon.js +53 -42
  104. package/dist/components/icon/codezero/codezero.js +10 -0
  105. package/dist/components/icon/codezero/gls.js +9 -0
  106. package/dist/components/icon/codezero/index.js +17 -13
  107. package/dist/components/json-view/JsonView.js +120 -109
  108. package/dist/components/layout/Layout.js +101 -78
  109. package/dist/components/menu/Menu.js +135 -128
  110. package/dist/components/progress/ProgressCircle.js +60 -49
  111. package/dist/components/progress/ProgressLinear.js +39 -43
  112. package/dist/components/quote/Quote.js +52 -43
  113. package/dist/components/resizable/Resizable.js +36 -33
  114. package/dist/components/row/Row.js +19 -23
  115. package/dist/components/scroll-area/ScrollArea.js +66 -76
  116. package/dist/components/segmented-control/SegmentedControl.js +46 -50
  117. package/dist/components/spacing/Spacing.js +16 -23
  118. package/dist/components/tab/Tab.js +73 -66
  119. package/dist/components/text/Text.js +19 -25
  120. package/dist/components/toast/Toast.js +104 -82
  121. package/dist/components/tooltip/Tooltip.js +66 -55
  122. package/dist/index.js +76 -272
  123. package/dist/node_modules/@lezer/common/dist/index.js +778 -143
  124. package/dist/node_modules/@lezer/highlight/dist/index.js +305 -536
  125. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +55 -55
  126. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +49 -32
  127. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +57 -46
  128. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +17 -16
  129. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +8 -11
  130. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +4 -5
  131. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +4 -5
  132. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +7 -8
  133. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -11
  134. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +4 -5
  135. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +12 -14
  136. package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +4 -5
  137. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +4 -5
  138. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +5 -7
  139. package/dist/node_modules/framer-motion/dist/es/events/event-info.js +8 -13
  140. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +252 -281
  141. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +19 -21
  142. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +57 -67
  143. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +24 -27
  144. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +16 -19
  145. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +130 -124
  146. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +39 -42
  147. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +22 -27
  148. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +36 -44
  149. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +22 -32
  150. package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +6 -12
  151. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +47 -37
  152. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +12 -16
  153. package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +10 -20
  154. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +58 -59
  155. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +7 -11
  156. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +10 -13
  157. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +42 -43
  158. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +19 -18
  159. package/dist/node_modules/framer-motion/dist/es/motion/index.js +64 -58
  160. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +2 -4
  161. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +18 -20
  162. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +53 -62
  163. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +45 -49
  164. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +4 -38
  165. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +7 -17
  166. package/dist/node_modules/framer-motion/dist/es/render/components/m/proxy.js +3 -0
  167. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +10 -12
  168. package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +5 -7
  169. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +6 -10
  170. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +18 -15
  171. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +14 -18
  172. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +4 -23
  173. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +8 -9
  174. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +20 -23
  175. package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +6 -8
  176. package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +27 -29
  177. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +23 -21
  178. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +8 -9
  179. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +5 -7
  180. package/dist/node_modules/framer-motion/dist/es/utils/distance.js +5 -8
  181. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +2 -4
  182. package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +2 -4
  183. package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +3 -5
  184. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +10 -11
  185. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +20 -25
  186. package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +6 -7
  187. package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +5 -6
  188. package/dist/node_modules/motion/dist/es/react.js +196 -0
  189. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +104 -111
  190. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +126 -143
  191. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +81 -105
  192. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +25 -37
  193. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +7 -9
  194. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +10 -16
  195. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +29 -36
  196. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +18 -28
  197. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +156 -170
  198. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +6 -12
  199. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +13 -12
  200. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +3 -5
  201. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +6 -8
  202. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +42 -45
  203. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +52 -57
  204. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +22 -27
  205. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +18 -21
  206. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +58 -67
  207. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +61 -70
  208. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +5 -7
  209. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +5 -7
  210. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +9 -11
  211. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +3 -5
  212. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +3 -6
  213. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +4 -6
  214. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +15 -15
  215. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +32 -35
  216. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +3 -6
  217. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +4 -6
  218. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +19 -26
  219. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +4 -6
  220. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +14 -21
  221. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +21 -29
  222. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +25 -22
  223. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +5 -7
  224. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +3 -7
  225. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +4 -8
  226. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +15 -19
  227. package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +3 -5
  228. package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +12 -14
  229. package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +10 -9
  230. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +2 -4
  231. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +8 -11
  232. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +32 -14
  233. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +16 -20
  234. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +21 -32
  235. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +7 -11
  236. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +5 -7
  237. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +5 -9
  238. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +5 -9
  239. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +12 -14
  240. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +3 -5
  241. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +27 -26
  242. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +4 -9
  243. package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +3 -5
  244. package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +10 -20
  245. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +29 -42
  246. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +11 -13
  247. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +6 -9
  248. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +8 -10
  249. package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +32 -36
  250. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +32 -32
  251. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +16 -15
  252. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +23 -24
  253. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +2 -4
  254. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +2 -4
  255. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +2 -4
  256. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +13 -11
  257. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +20 -29
  258. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +34 -22
  259. package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +7 -11
  260. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +41 -53
  261. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +28 -38
  262. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +23 -21
  263. package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +15 -17
  264. package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +18 -26
  265. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +10 -12
  266. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +19 -24
  267. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +554 -592
  268. package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +4 -14
  269. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +48 -52
  270. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +10 -20
  271. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +11 -16
  272. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +14 -20
  273. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +9 -12
  274. package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +2 -4
  275. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +3 -5
  276. package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +16 -18
  277. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +11 -15
  278. package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +8 -11
  279. package/dist/node_modules/motion-dom/dist/es/render/Feature.js +6 -9
  280. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +198 -260
  281. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +25 -27
  282. package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +2 -4
  283. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +49 -60
  284. package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +4 -6
  285. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +3 -5
  286. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +35 -35
  287. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +25 -28
  288. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +33 -37
  289. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +5 -11
  290. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +8 -12
  291. package/dist/node_modules/motion-dom/dist/es/render/store.js +2 -4
  292. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +37 -39
  293. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +18 -30
  294. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +25 -27
  295. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +2 -4
  296. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +11 -13
  297. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +6 -10
  298. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +11 -14
  299. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +128 -138
  300. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +16 -19
  301. package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +3 -5
  302. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +8 -11
  303. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +5 -8
  304. package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +2 -4
  305. package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +3 -5
  306. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +10 -12
  307. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +20 -23
  308. package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +18 -24
  309. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +8 -14
  310. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +2 -5
  311. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +5 -7
  312. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +16 -18
  313. package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +14 -18
  314. package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +7 -13
  315. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +10 -13
  316. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +31 -35
  317. package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +18 -21
  318. package/dist/node_modules/motion-dom/dist/es/resize/index.js +5 -7
  319. package/dist/node_modules/motion-dom/dist/es/stats/buffer.js +5 -0
  320. package/dist/node_modules/motion-dom/dist/es/utils/border-radius.js +7 -0
  321. package/dist/node_modules/motion-dom/dist/es/utils/delay.js +9 -11
  322. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +29 -40
  323. package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +4 -6
  324. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +4 -6
  325. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +4 -6
  326. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +26 -27
  327. package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +44 -45
  328. package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +3 -5
  329. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +5 -7
  330. package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +2 -4
  331. package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +4 -7
  332. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +11 -14
  333. package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +2 -4
  334. package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +9 -11
  335. package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +6 -8
  336. package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +3 -5
  337. package/dist/node_modules/motion-dom/dist/es/value/index.js +89 -211
  338. package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +4 -6
  339. package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +15 -17
  340. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +17 -20
  341. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +9 -11
  342. package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +12 -14
  343. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +12 -15
  344. package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +13 -17
  345. package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +22 -22
  346. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +43 -44
  347. package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +11 -10
  348. package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +14 -9
  349. package/dist/node_modules/motion-dom/dist/es/value/types/int.js +5 -7
  350. package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +22 -27
  351. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +61 -69
  352. package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +29 -36
  353. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +12 -16
  354. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +10 -17
  355. package/dist/node_modules/motion-dom/dist/es/value/types/test.js +2 -4
  356. package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +9 -11
  357. package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +2 -4
  358. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +10 -8
  359. package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +2 -4
  360. package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +2 -4
  361. package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +3 -5
  362. package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +2 -4
  363. package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +2 -4
  364. package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +2 -4
  365. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +4 -6
  366. package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +10 -13
  367. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +4 -6
  368. package/dist/node_modules/motion-utils/dist/es/array.js +6 -9
  369. package/dist/node_modules/motion-utils/dist/es/clamp.js +2 -4
  370. package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +3 -5
  371. package/dist/node_modules/motion-utils/dist/es/easing/back.js +5 -9
  372. package/dist/node_modules/motion-utils/dist/es/easing/circ.js +4 -8
  373. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +14 -17
  374. package/dist/node_modules/motion-utils/dist/es/easing/ease.js +3 -7
  375. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +2 -4
  376. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +2 -4
  377. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +2 -4
  378. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +2 -4
  379. package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +28 -31
  380. package/dist/node_modules/motion-utils/dist/es/errors.js +7 -13
  381. package/dist/node_modules/motion-utils/dist/es/format-error-message.js +3 -5
  382. package/dist/node_modules/motion-utils/dist/es/global-config.js +2 -4
  383. package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +2 -4
  384. package/dist/node_modules/motion-utils/dist/es/is-object.js +2 -4
  385. package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +2 -4
  386. package/dist/node_modules/motion-utils/dist/es/memo.js +5 -7
  387. package/dist/node_modules/motion-utils/dist/es/noop.js +2 -4
  388. package/dist/node_modules/motion-utils/dist/es/pipe.js +2 -4
  389. package/dist/node_modules/motion-utils/dist/es/progress.js +4 -6
  390. package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +23 -28
  391. package/dist/node_modules/motion-utils/dist/es/time-conversion.js +2 -5
  392. package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +2 -4
  393. package/dist/node_modules/motion-utils/dist/es/warn-once.js +5 -7
  394. package/dist/node_modules/prettier/plugins/babel.js +9582 -7023
  395. package/dist/node_modules/prettier/plugins/estree.js +6997 -4377
  396. package/dist/node_modules/prettier/standalone.js +3444 -2415
  397. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +21 -21
  398. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +18 -14
  399. package/dist/node_modules/react/compiler-runtime.js +8 -10
  400. package/dist/utils/arrayService.js +0 -1
  401. package/dist/utils/color.js +46 -41
  402. package/dist/utils/component.js +60 -129
  403. package/dist/utils/contextStore.js +48 -58
  404. package/dist/utils/index.js +7 -29
  405. package/dist/utils/motion.js +85 -113
  406. package/dist/utils/reactiveArrayService.js +80 -76
  407. package/dist/utils/size.js +14 -26
  408. package/dist/utils/utils.js +0 -1
  409. package/dist/utils/view.js +27 -24
  410. package/dist/vite-env.d.js +0 -1
  411. package/package.json +25 -20
  412. package/dist/_virtual/compiler-runtime.js +0 -5
  413. package/dist/_virtual/compiler-runtime2.js +0 -4
  414. package/dist/_virtual/react-compiler-runtime.development.js +0 -4
  415. package/dist/_virtual/react-compiler-runtime.production.js +0 -4
  416. package/dist/assets/components/alert/Alert.style.css +0 -1
  417. package/dist/assets/components/aurora/Aurora.style.css +0 -1
  418. package/dist/assets/components/avatar/Avatar.style.css +0 -1
  419. package/dist/assets/components/badge/Badge.style.css +0 -1
  420. package/dist/assets/components/breadcrumb/Breadcrumb.style.css +0 -1
  421. package/dist/assets/components/button/Button.style.css +0 -1
  422. package/dist/assets/components/button-group/ButtonGroup.style.css +0 -1
  423. package/dist/assets/components/card/Card.style.css +0 -1
  424. package/dist/assets/components/chart/Chart.style.css +0 -1
  425. package/dist/assets/components/col/Col.style.css +0 -1
  426. package/dist/assets/components/command/Command.style.css +0 -1
  427. package/dist/assets/components/container/Container.style.css +0 -1
  428. package/dist/assets/components/context-menu/ContextMenu.style.css +0 -1
  429. package/dist/assets/components/data-table/DataTable.style.css +0 -1
  430. package/dist/assets/components/dialog/Dialog.style.css +0 -1
  431. package/dist/assets/components/editor/Editor.styles.css +0 -1
  432. package/dist/assets/components/file-tabs/FileTabs.style.css +0 -1
  433. package/dist/assets/components/form/ColorInput.style.css +0 -1
  434. package/dist/assets/components/form/DateInput.style.css +0 -1
  435. package/dist/assets/components/form/EditorInput.style.css +0 -1
  436. package/dist/assets/components/form/FileInput.style.css +0 -1
  437. package/dist/assets/components/form/Input.style.css +0 -1
  438. package/dist/assets/components/form/InputWrapper.style.css +0 -1
  439. package/dist/assets/components/form/SelectInput.style.css +0 -1
  440. package/dist/assets/components/fullscreen/FullScreen.style.css +0 -1
  441. package/dist/assets/components/gantt/Gantt.style.css +0 -1
  442. package/dist/assets/components/icon/Icon.style.css +0 -1
  443. package/dist/assets/components/json-view/JsonView.style.css +0 -1
  444. package/dist/assets/components/layout/Layout.style.css +0 -1
  445. package/dist/assets/components/menu/Menu.style.css +0 -1
  446. package/dist/assets/components/progress/Progress.style.css +0 -1
  447. package/dist/assets/components/quote/Quote.style.css +0 -1
  448. package/dist/assets/components/resizable/Resizable.style.css +0 -1
  449. package/dist/assets/components/row/Row.style.css +0 -1
  450. package/dist/assets/components/scroll-area/ScrollArea.style.css +0 -1
  451. package/dist/assets/components/segmented-control/SegmentedControl.style.css +0 -1
  452. package/dist/assets/components/tab/Tab.style.css +0 -1
  453. package/dist/assets/components/text/Text.style.css +0 -1
  454. package/dist/assets/components/toast/Toast.style.css +0 -1
  455. package/dist/assets/components/tooltip/Tooltip.style.css +0 -1
  456. package/dist/components/icon/codezero/codezero.svg.js +0 -5
  457. package/dist/components/icon/codezero/gls.svg.js +0 -5
  458. /package/dist/assets/{components/flex/Flex.style.css → Flex.style.css} +0 -0
  459. /package/dist/assets/{components/spacing/Spacing.style.css → Spacing.style.css} +0 -0
@@ -1,355 +1,380 @@
1
- import { jsx as c, jsxs as C, Fragment as ae } from "react/jsx-runtime";
2
- import { c as v } from "../../_virtual/compiler-runtime.js";
3
- import { ColorPicker as g, parseColor as w } from "@ark-ui/react";
4
- import "../../utils/contextStore.js";
5
- import b from "react";
6
- import { mergeComponentProps as x } from "../../utils/component.js";
7
- import "js-md5";
8
- import { InputWrapper as se } from "./InputWrapper.js";
9
- import { Flex as ce } from "../flex/Flex.js";
10
- import { Badge as ee } from "../badge/Badge.js";
11
- import { Button as te } from "../button/Button.js";
12
- import { MenuTrigger as ie, Menu as ue, MenuPortal as he, MenuContent as me } from "../menu/Menu.js";
13
- import { SegmentedControlItem as q, SegmentedControl as de } from "../segmented-control/SegmentedControl.js";
14
- import { useCopyToClipboard as fe } from "@uidotdev/usehooks";
15
- import { useHotkeys as le } from "react-hotkeys-hook";
16
- import '../../assets/components/form/ColorInput.style.css';/* empty css */
17
- const L = b.createContext({
18
- hasValue: !1,
19
- placeholder: null
20
- }), pe = /^(#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|(rgba?|hsla?|hsba?)\(\s*-?[\d.]+%?(\s*,\s*-?[\d.]+%?){2,3}\s*\))$/i, J = (o) => {
21
- const e = o.trim();
22
- return pe.test(e) ? w(e) : void 0;
23
- }, ne = (o) => {
24
- if (typeof o == "string") return J(o);
25
- if (o != null)
26
- return o;
27
- }, _e = (o) => {
28
- const e = o.trim().replace(/°/g, "").replace(/deg\b/gi, "");
29
- if (!e) return null;
30
- const t = J(e);
31
- if (t) {
32
- const a = e.toLowerCase(), s = a.startsWith("#") ? "hexa" : a.startsWith("hsl") ? "hsla" : "rgba";
33
- return {
34
- color: t,
35
- notation: s
36
- };
37
- }
38
- if (/^[0-9a-f]+$/i.test(e) && (e.length === 6 || e.length === 8 || (e.length === 3 || e.length === 4) && /[a-f]/i.test(e))) return {
39
- color: w(`#${e}`),
40
- notation: "hexa"
41
- };
42
- const l = e.split(/[\s,]+/).filter(Boolean), r = l.map((a) => Number(a.replace("%", "")));
43
- if ((l.length === 3 || l.length === 4) && r.every((a) => !Number.isNaN(a))) {
44
- const a = l.length === 4 ? r[3] : 1;
45
- return l[1].includes("%") || l[2].includes("%") ? {
46
- color: w(`hsla(${r[0]}, ${r[1]}%, ${r[2]}%, ${a})`),
47
- notation: "hsla"
48
- } : {
49
- color: w(`rgba(${r[0]}, ${r[1]}, ${r[2]}, ${a})`),
50
- notation: "rgba"
51
- };
52
- }
53
- return null;
54
- }, Be = (o) => {
55
- const e = v.c(42), {
56
- title: t,
57
- description: n,
58
- left: l,
59
- leftType: r,
60
- rightType: a,
61
- right: s,
62
- formValidation: i,
63
- initialValue: h,
64
- defaultValue: m,
65
- value: u,
66
- placeholder: f,
67
- name: d,
68
- disabled: p,
69
- readOnly: _,
70
- closeOnSelect: k,
71
- onValueChange: G,
72
- children: K
73
- } = o, W = f === void 0 ? "Pick a color" : f, j = u ?? h ?? m;
74
- let H;
75
- e[0] !== j ? (H = ne(j), e[0] = j, e[1] = H) : H = e[1];
76
- const S = H;
77
- let A;
78
- e[2] !== S ? (A = () => S ?? w("hsla(0, 0%, 0%, 1)"), e[2] = S, e[3] = A) : A = e[3];
79
- const [z, Q] = b.useState(A);
80
- let E;
81
- e[4] !== S ? (E = () => S !== void 0, e[4] = S, e[5] = E) : E = e[5];
82
- const [D, Y] = b.useState(E), [y, Z] = b.useState(!1);
83
- let O, P;
84
- e[6] !== u ? (O = () => {
85
- if (u === void 0)
86
- return;
87
- const N = ne(u);
88
- Y(N !== void 0), N && Q(N);
89
- }, P = [u], e[6] = u, e[7] = O, e[8] = P) : (O = e[7], P = e[8]), b.useEffect(O, P);
90
- let R;
91
- e[9] !== i || e[10] !== G ? (R = (N) => {
92
- Q(N.value), Y(!0), i?.setValue?.(N.value.toString("hsla")), G?.(N);
93
- }, e[9] = i, e[10] = G, e[11] = R) : R = e[11];
94
- const X = R;
95
- let B;
96
- e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = (N) => Z(N.open), e[12] = B) : B = e[12];
97
- let M;
98
- e[13] !== k || e[14] !== z || e[15] !== p || e[16] !== X || e[17] !== d || e[18] !== y || e[19] !== _ ? (M = x("color-input", {
99
- value: z,
100
- onValueChange: X,
101
- open: y,
102
- onOpenChange: B,
103
- name: d,
104
- disabled: p,
105
- readOnly: _,
106
- closeOnSelect: k
107
- }), e[13] = k, e[14] = z, e[15] = p, e[16] = X, e[17] = d, e[18] = y, e[19] = _, e[20] = M) : M = e[20];
108
- const U = M;
109
- let T;
110
- e[21] !== D || e[22] !== W ? (T = {
111
- hasValue: D,
112
- placeholder: W
113
- }, e[21] = D, e[22] = W, e[23] = T) : T = e[23];
114
- let V;
115
- e[24] !== K || e[25] !== n || e[26] !== i || e[27] !== l || e[28] !== r || e[29] !== s || e[30] !== a || e[31] !== t ? (V = /* @__PURE__ */ c(se, { title: t, description: n, left: l, leftType: r, right: s, rightType: a, formValidation: i, children: K }), e[24] = K, e[25] = n, e[26] = i, e[27] = l, e[28] = r, e[29] = s, e[30] = a, e[31] = t, e[32] = V) : V = e[32];
116
- let $;
117
- e[33] !== y || e[34] !== V ? ($ = /* @__PURE__ */ c(ue, { open: y, onOpenChange: Z, children: V }), e[33] = y, e[34] = V, e[35] = $) : $ = e[35];
118
- let I;
119
- e[36] !== T || e[37] !== $ ? (I = /* @__PURE__ */ c(L.Provider, { value: T, children: $ }), e[36] = T, e[37] = $, e[38] = I) : I = e[38];
120
- let F;
121
- return e[39] !== U || e[40] !== I ? (F = /* @__PURE__ */ c(g.Root, { ...U, children: I }), e[39] = U, e[40] = I, e[41] = F) : F = e[41], F;
122
- }, Me = (o) => {
123
- const e = v.c(9);
124
- let t, n, l;
125
- if (e[0] !== o) {
126
- const {
127
- children: i,
128
- ...h
129
- } = o;
130
- n = i, t = g.Control, l = x("color-input__control", h), e[0] = o, e[1] = t, e[2] = n, e[3] = l;
131
- } else
132
- t = e[1], n = e[2], l = e[3];
133
- const r = l;
134
- let a;
135
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ c(g.HiddenInput, {}), e[4] = a) : a = e[4];
136
- let s;
137
- return e[5] !== t || e[6] !== n || e[7] !== r ? (s = /* @__PURE__ */ C(t, { ...r, children: [
138
- n,
139
- a
140
- ] }), e[5] = t, e[6] = n, e[7] = r, e[8] = s) : s = e[8], s;
141
- }, Fe = (o) => {
142
- const e = v.c(3), {
143
- hasValue: t
144
- } = b.useContext(L);
145
- let n;
146
- return e[0] !== t || e[1] !== o ? (n = /* @__PURE__ */ c("div", { className: "color-input__swatch-wrapper", children: t ? /* @__PURE__ */ C(ae, { children: [
147
- /* @__PURE__ */ c(g.TransparencyGrid, { className: "color-input__transparency-grid" }),
148
- /* @__PURE__ */ c(g.ValueSwatch, { ...x("color-input__swatch", o) })
149
- ] }) : /* @__PURE__ */ c("div", { className: "color-input__swatch color-input__swatch--empty" }) }), e[0] = t, e[1] = o, e[2] = n) : n = e[2], n;
150
- }, Le = (o) => {
151
- const e = v.c(7), {
152
- hasValue: t,
153
- placeholder: n
154
- } = b.useContext(L);
155
- if (!t) {
156
- let r;
157
- e[0] !== o ? (r = x("color-input__value-text color-input__value-text--placeholder", o), e[0] = o, e[1] = r) : r = e[1];
158
- let a;
159
- return e[2] !== n || e[3] !== r ? (a = /* @__PURE__ */ c("span", { ...r, children: n }), e[2] = n, e[3] = r, e[4] = a) : a = e[4], a;
160
- }
161
- let l;
162
- return e[5] !== o ? (l = /* @__PURE__ */ c(g.Context, { children: (r) => /* @__PURE__ */ c("span", { ...x("color-input__value-text", o), children: r.value.toString("hsla") }) }), e[5] = o, e[6] = l) : l = e[6], l;
163
- }, Ge = (o) => {
164
- const e = v.c(4);
165
- let t;
166
- e[0] !== o ? (t = x("color-input__trigger", o), e[0] = o, e[1] = t) : t = e[1];
167
- const n = t;
168
- let l;
169
- return e[2] !== n ? (l = /* @__PURE__ */ c(ie, { ...n }), e[2] = n, e[3] = l) : l = e[3], l;
170
- }, Ke = (o) => {
171
- const e = v.c(21);
172
- let t, n, l, r, a, s;
173
- if (e[0] !== o) {
174
- const {
175
- defaultNotation: _,
176
- ...k
177
- } = o;
178
- l = _, n = he, t = me, a = "end", s = 8, r = x("color-input__content", k), e[0] = o, e[1] = t, e[2] = n, e[3] = l, e[4] = r, e[5] = a, e[6] = s;
179
- } else
180
- t = e[1], n = e[2], l = e[3], r = e[4], a = e[5], s = e[6];
181
- const i = r;
182
- let h;
183
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ C(g.Area, { className: "color-input__area", children: [
184
- /* @__PURE__ */ c(g.AreaBackground, { className: "color-input__area-background" }),
185
- /* @__PURE__ */ c(g.AreaThumb, { className: "color-input__area-thumb" })
186
- ] }), e[7] = h) : h = e[7];
187
- let m;
188
- e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ C(g.ChannelSlider, { channel: "hue", className: "color-input__channel-slider", children: [
189
- /* @__PURE__ */ c(g.ChannelSliderTrack, { className: "color-input__channel-slider-track" }),
190
- /* @__PURE__ */ c(g.ChannelSliderThumb, { className: "color-input__channel-slider-thumb" })
191
- ] }), e[8] = m) : m = e[8];
192
- let u;
193
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ C("div", { className: "color-input__sliders", children: [
194
- m,
195
- /* @__PURE__ */ C(g.ChannelSlider, { channel: "alpha", className: "color-input__channel-slider", children: [
196
- /* @__PURE__ */ c(g.TransparencyGrid, { className: "color-input__channel-slider-grid" }),
197
- /* @__PURE__ */ c(g.ChannelSliderTrack, { className: "color-input__channel-slider-track" }),
198
- /* @__PURE__ */ c(g.ChannelSliderThumb, { className: "color-input__channel-slider-thumb" })
199
- ] })
200
- ] }), e[9] = u) : u = e[9];
201
- let f;
202
- e[10] !== l ? (f = /* @__PURE__ */ C("div", { className: "color-input__body", children: [
203
- h,
204
- u,
205
- /* @__PURE__ */ c(g.Context, { children: (_) => /* @__PURE__ */ c(ge, { api: _, defaultNotation: l ?? "hsla" }) })
206
- ] }), e[10] = l, e[11] = f) : f = e[11];
207
- let d;
208
- e[12] !== t || e[13] !== a || e[14] !== s || e[15] !== i || e[16] !== f ? (d = /* @__PURE__ */ c(t, { align: a, sideOffset: s, ...i, children: f }), e[12] = t, e[13] = a, e[14] = s, e[15] = i, e[16] = f, e[17] = d) : d = e[17];
209
- let p;
210
- return e[18] !== n || e[19] !== d ? (p = /* @__PURE__ */ c(n, { children: d }), e[18] = n, e[19] = d, e[20] = p) : p = e[20], p;
211
- }, ge = (o) => {
212
- const e = v.c(14), {
213
- api: t,
214
- defaultNotation: n
215
- } = o, [l, r] = b.useState(n);
216
- let a;
217
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (_) => {
218
- (_ === "rgba" || _ === "hsla" || _ === "hexa") && r(_);
219
- }, e[0] = a) : a = e[0];
220
- const s = a;
221
- let i, h, m;
222
- e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ c(q, { value: "rgba", children: "RGBA" }), h = /* @__PURE__ */ c(q, { value: "hsla", children: "HSLA" }), m = /* @__PURE__ */ c(q, { value: "hexa", children: "HEXA" }), e[1] = i, e[2] = h, e[3] = m) : (i = e[1], h = e[2], m = e[3]);
223
- let u;
224
- e[4] !== l ? (u = /* @__PURE__ */ C(de, { type: "single", value: l, onValueChange: s, className: "segmented-control color-input__notation", children: [
225
- i,
226
- h,
227
- m
228
- ] }), e[4] = l, e[5] = u) : u = e[5];
229
- let f, d;
230
- e[6] !== t || e[7] !== l ? (f = l === "hexa" ? /* @__PURE__ */ C("label", { className: "color-input__channel color-input__channel--hex", children: [
231
- /* @__PURE__ */ c("span", { className: "color-input__channel-label", children: "HEXA" }),
232
- /* @__PURE__ */ c(be, { api: t })
233
- ] }) : /* @__PURE__ */ C("div", { className: "color-input__channel-row", children: [
234
- (l === "rgba" ? ["red", "green", "blue"] : ["hue", "saturation", "lightness"]).map((_) => /* @__PURE__ */ c(oe, { api: t, format: l, channel: _ }, _)),
235
- /* @__PURE__ */ c(oe, { api: t, format: l, channel: "alpha" })
236
- ] }), d = /* @__PURE__ */ c(Ce, { api: t, notation: l, setNotation: r }), e[6] = t, e[7] = l, e[8] = f, e[9] = d) : (f = e[8], d = e[9]);
237
- let p;
238
- return e[10] !== u || e[11] !== f || e[12] !== d ? (p = /* @__PURE__ */ C("div", { className: "color-input__channels", onKeyDown: ve, children: [
239
- u,
240
- f,
241
- d
242
- ] }), e[10] = u, e[11] = f, e[12] = d, e[13] = p) : p = e[13], p;
243
- }, Ce = ({
244
- api: o,
245
- notation: e,
246
- setNotation: t
247
- }) => {
248
- const {
249
- hasValue: n
250
- } = b.useContext(L), [, l] = fe(), r = b.useRef(o);
251
- r.current = o;
252
- const a = () => {
253
- n && l(e === "hexa" ? o.value.toString("hexa") : o.value.toString(e));
254
- }, s = () => {
255
- navigator.clipboard.readText().then((h) => {
256
- const m = _e(h);
257
- m && (r.current.setValue(m.color), t(m.notation), document.activeElement instanceof HTMLElement && document.activeElement.blur());
258
- }, () => {
259
- });
260
- };
261
- le("mod+c", a, {
262
- enabled: n,
263
- enableOnFormTags: !0
264
- }, [n, e, o]), le("mod+v", s, {
265
- enableOnFormTags: !0
266
- });
267
- const i = /mac|iphone|ipad|ipod/i.test(navigator.userAgent) ? "⌘" : "Ctrl";
268
- return /* @__PURE__ */ C(ce, { className: "color-input__actions", align: "center", children: [
269
- /* @__PURE__ */ C(te, { paddingSize: "xxs", onClick: s, children: [
270
- "Paste",
271
- /* @__PURE__ */ C(ee, { children: [
272
- i,
273
- "V"
274
- ] })
275
- ] }),
276
- /* @__PURE__ */ C(te, { paddingSize: "xxs", onClick: a, disabled: !n, children: [
277
- "Copy",
278
- /* @__PURE__ */ C(ee, { children: [
279
- i,
280
- "C"
281
- ] })
282
- ] })
283
- ] });
284
- }, oe = (o) => {
285
- const e = v.c(18), {
286
- channel: t,
287
- format: n,
288
- api: l
289
- } = o;
290
- let r;
291
- e[0] !== t[0] ? (r = t[0].toUpperCase(), e[0] = t[0], e[1] = r) : r = e[1];
292
- let a;
293
- e[2] !== r ? (a = /* @__PURE__ */ c("span", { className: "color-input__channel-label", children: r }), e[2] = r, e[3] = a) : a = e[3];
294
- let s;
295
- e[4] !== l || e[5] !== t ? (s = l.getChannelValue(t), e[4] = l, e[5] = t, e[6] = s) : s = e[6];
296
- const i = t === "alpha" ? "decimal" : "numeric";
297
- let h;
298
- e[7] !== l || e[8] !== t || e[9] !== n ? (h = (f) => {
299
- const d = Number(f);
300
- f.trim() === "" || Number.isNaN(d) || l.setValue(l.value.toFormat(n).withChannelValue(t, d));
301
- }, e[7] = l, e[8] = t, e[9] = n, e[10] = h) : h = e[10];
302
- let m;
303
- e[11] !== s || e[12] !== i || e[13] !== h ? (m = /* @__PURE__ */ c(re, { committed: s, inputMode: i, commit: h }), e[11] = s, e[12] = i, e[13] = h, e[14] = m) : m = e[14];
304
- let u;
305
- return e[15] !== a || e[16] !== m ? (u = /* @__PURE__ */ C("label", { className: "color-input__channel", children: [
306
- a,
307
- m
308
- ] }), e[15] = a, e[16] = m, e[17] = u) : u = e[17], u;
309
- }, be = (o) => {
310
- const e = v.c(7), {
311
- api: t
312
- } = o;
313
- let n;
314
- e[0] !== t.value ? (n = t.value.toString("hexa"), e[0] = t.value, e[1] = n) : n = e[1];
315
- let l;
316
- e[2] !== t ? (l = (a) => {
317
- const s = J(a);
318
- s && t.setValue(s);
319
- }, e[2] = t, e[3] = l) : l = e[3];
320
- let r;
321
- return e[4] !== n || e[5] !== l ? (r = /* @__PURE__ */ c(re, { committed: n, commit: l }), e[4] = n, e[5] = l, e[6] = r) : r = e[6], r;
322
- }, re = (o) => {
323
- const e = v.c(13), {
324
- committed: t,
325
- commit: n,
326
- inputMode: l
327
- } = o, r = l === void 0 ? "text" : l, [a, s] = b.useState(t), i = b.useRef(!1);
328
- let h, m;
329
- e[0] !== t ? (h = () => {
330
- i.current || s(t);
331
- }, m = [t], e[0] = t, e[1] = h, e[2] = m) : (h = e[1], m = e[2]), b.useEffect(h, m);
332
- let u;
333
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = () => i.current = !0, e[3] = u) : u = e[3];
334
- let f;
335
- e[4] !== n ? (f = (_) => {
336
- s(_.target.value), n(_.target.value);
337
- }, e[4] = n, e[5] = f) : f = e[5];
338
- let d;
339
- e[6] !== t ? (d = () => {
340
- i.current = !1, s(t);
341
- }, e[6] = t, e[7] = d) : d = e[7];
342
- let p;
343
- return e[8] !== a || e[9] !== r || e[10] !== f || e[11] !== d ? (p = /* @__PURE__ */ c("input", { className: "color-input__channel-input", type: "text", inputMode: r, value: a, spellCheck: !1, autoComplete: "off", onFocus: u, onChange: f, onBlur: d }), e[8] = a, e[9] = r, e[10] = f, e[11] = d, e[12] = p) : p = e[12], p;
1
+ import { require_compiler_runtime } from "../../node_modules/react/compiler-runtime.js";
2
+ import { mergeComponentProps } from "../../utils/component.js";
3
+ import "../../utils/index.js";
4
+ import { Badge } from "../badge/Badge.js";
5
+ import { Button } from "../button/Button.js";
6
+ import { Flex } from "../flex/Flex.js";
7
+ import { InputWrapper } from "./InputWrapper.js";
8
+ import { Menu, MenuContent, MenuPortal, MenuTrigger } from "../menu/Menu.js";
9
+ import { SegmentedControl, SegmentedControlItem } from "../segmented-control/SegmentedControl.js";
10
+ import '../../assets/ColorInput.style.css';/* empty css */
11
+ import React from "react";
12
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
+ import { ColorPicker, parseColor } from "@ark-ui/react";
14
+ import { useCopyToClipboard } from "@uidotdev/usehooks";
15
+ import { useHotkeys } from "react-hotkeys-hook";
16
+ var import_compiler_runtime = require_compiler_runtime(), ColorInputStateContext = React.createContext({
17
+ hasValue: !1,
18
+ placeholder: null
19
+ }), COLOR_PATTERN = /^(#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|(rgba?|hsla?|hsba?)\(\s*-?[\d.]+%?(\s*,\s*-?[\d.]+%?){2,3}\s*\))$/i, safeParseColor = (t) => {
20
+ let i = t.trim();
21
+ return COLOR_PATTERN.test(i) ? parseColor(i) : void 0;
22
+ }, toColor = (t) => {
23
+ if (typeof t == "string") return safeParseColor(t);
24
+ if (t != null) return t;
25
+ }, parsePastedColor = (t) => {
26
+ let i = t.trim().replace(/°/g, "").replace(/deg\b/gi, "");
27
+ if (!i) return null;
28
+ let a = safeParseColor(i);
29
+ if (a) {
30
+ let t = i.toLowerCase();
31
+ return {
32
+ color: a,
33
+ notation: t.startsWith("#") ? "hexa" : t.startsWith("hsl") ? "hsla" : "rgba"
34
+ };
35
+ }
36
+ if (/^[0-9a-f]+$/i.test(i) && (i.length === 6 || i.length === 8 || (i.length === 3 || i.length === 4) && /[a-f]/i.test(i))) return {
37
+ color: parseColor(`#${i}`),
38
+ notation: "hexa"
39
+ };
40
+ let o = i.split(/[\s,]+/).filter(Boolean), s = o.map((t) => Number(t.replace("%", "")));
41
+ if ((o.length === 3 || o.length === 4) && s.every((t) => !Number.isNaN(t))) {
42
+ let t = o.length === 4 ? s[3] : 1;
43
+ return o[1].includes("%") || o[2].includes("%") ? {
44
+ color: parseColor(`hsla(${s[0]}, ${s[1]}%, ${s[2]}%, ${t})`),
45
+ notation: "hsla"
46
+ } : {
47
+ color: parseColor(`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${t})`),
48
+ notation: "rgba"
49
+ };
50
+ }
51
+ return null;
344
52
  };
345
- function ve(o) {
346
- o.key !== "Escape" && !o.metaKey && !o.ctrlKey && o.stopPropagation();
347
- }
348
- export {
349
- Be as ColorInput,
350
- Ke as ColorInputContent,
351
- Me as ColorInputControl,
352
- Fe as ColorInputSwatch,
353
- Ge as ColorInputTrigger,
354
- Le as ColorInputValueText
53
+ const ColorInput = (t) => {
54
+ let a = (0, import_compiler_runtime.c)(42), { title: o, description: s, left: u, leftType: d, rightType: f, right: p, formValidation: m, initialValue: g, defaultValue: _, value: b, placeholder: x, name: C, disabled: w, readOnly: T, closeOnSelect: E, onValueChange: D, children: O } = t, k = x === void 0 ? "Pick a color" : x, A = b ?? g ?? _, j;
55
+ a[0] === A ? j = a[1] : (j = toColor(A), a[0] = A, a[1] = j);
56
+ let M = j, N;
57
+ a[2] === M ? N = a[3] : (N = () => M ?? parseColor("hsla(0, 0%, 0%, 1)"), a[2] = M, a[3] = N);
58
+ let [P, F] = React.useState(N), I;
59
+ a[4] === M ? I = a[5] : (I = () => M !== void 0, a[4] = M, a[5] = I);
60
+ let [L, R] = React.useState(I), [z, B] = React.useState(!1), V, H;
61
+ a[6] === b ? (V = a[7], H = a[8]) : (V = () => {
62
+ if (b === void 0) return;
63
+ let t = toColor(b);
64
+ R(t !== void 0), t && F(t);
65
+ }, H = [b], a[6] = b, a[7] = V, a[8] = H), React.useEffect(V, H);
66
+ let U;
67
+ a[9] !== m || a[10] !== D ? (U = (t) => {
68
+ F(t.value), R(!0), m?.setValue?.(t.value.toString("hsla")), D?.(t);
69
+ }, a[9] = m, a[10] = D, a[11] = U) : U = a[11];
70
+ let W = U, G;
71
+ a[12] === Symbol.for("react.memo_cache_sentinel") ? (G = (t) => B(t.open), a[12] = G) : G = a[12];
72
+ let K;
73
+ a[13] !== E || a[14] !== P || a[15] !== w || a[16] !== W || a[17] !== C || a[18] !== z || a[19] !== T ? (K = mergeComponentProps("color-input", {
74
+ value: P,
75
+ onValueChange: W,
76
+ open: z,
77
+ onOpenChange: G,
78
+ name: C,
79
+ disabled: w,
80
+ readOnly: T,
81
+ closeOnSelect: E
82
+ }), a[13] = E, a[14] = P, a[15] = w, a[16] = W, a[17] = C, a[18] = z, a[19] = T, a[20] = K) : K = a[20];
83
+ let q = K, J;
84
+ a[21] !== L || a[22] !== k ? (J = {
85
+ hasValue: L,
86
+ placeholder: k
87
+ }, a[21] = L, a[22] = k, a[23] = J) : J = a[23];
88
+ let Y;
89
+ a[24] !== O || a[25] !== s || a[26] !== m || a[27] !== u || a[28] !== d || a[29] !== p || a[30] !== f || a[31] !== o ? (Y = /* @__PURE__ */ jsx(InputWrapper, {
90
+ title: o,
91
+ description: s,
92
+ left: u,
93
+ leftType: d,
94
+ right: p,
95
+ rightType: f,
96
+ formValidation: m,
97
+ children: O
98
+ }), a[24] = O, a[25] = s, a[26] = m, a[27] = u, a[28] = d, a[29] = p, a[30] = f, a[31] = o, a[32] = Y) : Y = a[32];
99
+ let X;
100
+ a[33] !== z || a[34] !== Y ? (X = /* @__PURE__ */ jsx(Menu, {
101
+ open: z,
102
+ onOpenChange: B,
103
+ children: Y
104
+ }), a[33] = z, a[34] = Y, a[35] = X) : X = a[35];
105
+ let Z;
106
+ a[36] !== J || a[37] !== X ? (Z = /* @__PURE__ */ jsx(ColorInputStateContext.Provider, {
107
+ value: J,
108
+ children: X
109
+ }), a[36] = J, a[37] = X, a[38] = Z) : Z = a[38];
110
+ let Q;
111
+ return a[39] !== q || a[40] !== Z ? (Q = /* @__PURE__ */ jsx(ColorPicker.Root, {
112
+ ...q,
113
+ children: Z
114
+ }), a[39] = q, a[40] = Z, a[41] = Q) : Q = a[41], Q;
115
+ }, ColorInputControl = (t) => {
116
+ let a = (0, import_compiler_runtime.c)(9), o, s, c;
117
+ if (a[0] !== t) {
118
+ let { children: l, ...u } = t;
119
+ s = l, o = ColorPicker.Control, c = mergeComponentProps("color-input__control", u), a[0] = t, a[1] = o, a[2] = s, a[3] = c;
120
+ } else o = a[1], s = a[2], c = a[3];
121
+ let l = c, u;
122
+ a[4] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ jsx(ColorPicker.HiddenInput, {}), a[4] = u) : u = a[4];
123
+ let d;
124
+ return a[5] !== o || a[6] !== s || a[7] !== l ? (d = /* @__PURE__ */ jsxs(o, {
125
+ ...l,
126
+ children: [s, u]
127
+ }), a[5] = o, a[6] = s, a[7] = l, a[8] = d) : d = a[8], d;
128
+ }, ColorInputSwatch = (t) => {
129
+ let a = (0, import_compiler_runtime.c)(3), { hasValue: o } = React.useContext(ColorInputStateContext), s;
130
+ return a[0] !== o || a[1] !== t ? (s = /* @__PURE__ */ jsx("div", {
131
+ className: "color-input__swatch-wrapper",
132
+ children: o ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ColorPicker.TransparencyGrid, { className: "color-input__transparency-grid" }), /* @__PURE__ */ jsx(ColorPicker.ValueSwatch, { ...mergeComponentProps("color-input__swatch", t) })] }) : /* @__PURE__ */ jsx("div", { className: "color-input__swatch color-input__swatch--empty" })
133
+ }), a[0] = o, a[1] = t, a[2] = s) : s = a[2], s;
134
+ }, ColorInputValueText = (t) => {
135
+ let a = (0, import_compiler_runtime.c)(7), { hasValue: o, placeholder: s } = React.useContext(ColorInputStateContext);
136
+ if (!o) {
137
+ let o;
138
+ a[0] === t ? o = a[1] : (o = mergeComponentProps("color-input__value-text color-input__value-text--placeholder", t), a[0] = t, a[1] = o);
139
+ let c;
140
+ return a[2] !== s || a[3] !== o ? (c = /* @__PURE__ */ jsx("span", {
141
+ ...o,
142
+ children: s
143
+ }), a[2] = s, a[3] = o, a[4] = c) : c = a[4], c;
144
+ }
145
+ let c;
146
+ return a[5] === t ? c = a[6] : (c = /* @__PURE__ */ jsx(ColorPicker.Context, { children: (a) => /* @__PURE__ */ jsx("span", {
147
+ ...mergeComponentProps("color-input__value-text", t),
148
+ children: a.value.toString("hsla")
149
+ }) }), a[5] = t, a[6] = c), c;
150
+ }, ColorInputTrigger = (t) => {
151
+ let a = (0, import_compiler_runtime.c)(4), o;
152
+ a[0] === t ? o = a[1] : (o = mergeComponentProps("color-input__trigger", t), a[0] = t, a[1] = o);
153
+ let s = o, c;
154
+ return a[2] === s ? c = a[3] : (c = /* @__PURE__ */ jsx(MenuTrigger, { ...s }), a[2] = s, a[3] = c), c;
155
+ }, ColorInputContent = (t) => {
156
+ let a = (0, import_compiler_runtime.c)(21), o, s, c, l, f, p;
157
+ if (a[0] !== t) {
158
+ let { defaultNotation: m, ...h } = t;
159
+ c = m, s = MenuPortal, o = MenuContent, f = "end", p = 8, l = mergeComponentProps("color-input__content", h), a[0] = t, a[1] = o, a[2] = s, a[3] = c, a[4] = l, a[5] = f, a[6] = p;
160
+ } else o = a[1], s = a[2], c = a[3], l = a[4], f = a[5], p = a[6];
161
+ let m = l, h;
162
+ a[7] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsxs(ColorPicker.Area, {
163
+ className: "color-input__area",
164
+ children: [/* @__PURE__ */ jsx(ColorPicker.AreaBackground, { className: "color-input__area-background" }), /* @__PURE__ */ jsx(ColorPicker.AreaThumb, { className: "color-input__area-thumb" })]
165
+ }), a[7] = h) : h = a[7];
166
+ let g;
167
+ a[8] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsxs(ColorPicker.ChannelSlider, {
168
+ channel: "hue",
169
+ className: "color-input__channel-slider",
170
+ children: [/* @__PURE__ */ jsx(ColorPicker.ChannelSliderTrack, { className: "color-input__channel-slider-track" }), /* @__PURE__ */ jsx(ColorPicker.ChannelSliderThumb, { className: "color-input__channel-slider-thumb" })]
171
+ }), a[8] = g) : g = a[8];
172
+ let y;
173
+ a[9] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ jsxs("div", {
174
+ className: "color-input__sliders",
175
+ children: [g, /* @__PURE__ */ jsxs(ColorPicker.ChannelSlider, {
176
+ channel: "alpha",
177
+ className: "color-input__channel-slider",
178
+ children: [
179
+ /* @__PURE__ */ jsx(ColorPicker.TransparencyGrid, { className: "color-input__channel-slider-grid" }),
180
+ /* @__PURE__ */ jsx(ColorPicker.ChannelSliderTrack, { className: "color-input__channel-slider-track" }),
181
+ /* @__PURE__ */ jsx(ColorPicker.ChannelSliderThumb, { className: "color-input__channel-slider-thumb" })
182
+ ]
183
+ })]
184
+ }), a[9] = y) : y = a[9];
185
+ let b;
186
+ a[10] === c ? b = a[11] : (b = /* @__PURE__ */ jsxs("div", {
187
+ className: "color-input__body",
188
+ children: [
189
+ h,
190
+ y,
191
+ /* @__PURE__ */ jsx(ColorPicker.Context, { children: (t) => /* @__PURE__ */ jsx(ColorInputChannels, {
192
+ api: t,
193
+ defaultNotation: c ?? "hsla"
194
+ }) })
195
+ ]
196
+ }), a[10] = c, a[11] = b);
197
+ let x;
198
+ a[12] !== o || a[13] !== f || a[14] !== p || a[15] !== m || a[16] !== b ? (x = /* @__PURE__ */ jsx(o, {
199
+ align: f,
200
+ sideOffset: p,
201
+ ...m,
202
+ children: b
203
+ }), a[12] = o, a[13] = f, a[14] = p, a[15] = m, a[16] = b, a[17] = x) : x = a[17];
204
+ let S;
205
+ return a[18] !== s || a[19] !== x ? (S = /* @__PURE__ */ jsx(s, { children: x }), a[18] = s, a[19] = x, a[20] = S) : S = a[20], S;
206
+ };
207
+ var ColorInputChannels = (t) => {
208
+ let i = (0, import_compiler_runtime.c)(14), { api: a, defaultNotation: o } = t, [s, c] = React.useState(o), l;
209
+ i[0] === Symbol.for("react.memo_cache_sentinel") ? (l = (t) => {
210
+ (t === "rgba" || t === "hsla" || t === "hexa") && c(t);
211
+ }, i[0] = l) : l = i[0];
212
+ let u = l, d, f, g;
213
+ i[1] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ jsx(SegmentedControlItem, {
214
+ value: "rgba",
215
+ children: "RGBA"
216
+ }), f = /* @__PURE__ */ jsx(SegmentedControlItem, {
217
+ value: "hsla",
218
+ children: "HSLA"
219
+ }), g = /* @__PURE__ */ jsx(SegmentedControlItem, {
220
+ value: "hexa",
221
+ children: "HEXA"
222
+ }), i[1] = d, i[2] = f, i[3] = g) : (d = i[1], f = i[2], g = i[3]);
223
+ let v;
224
+ i[4] === s ? v = i[5] : (v = /* @__PURE__ */ jsxs(SegmentedControl, {
225
+ type: "single",
226
+ value: s,
227
+ onValueChange: u,
228
+ className: "segmented-control color-input__notation",
229
+ children: [
230
+ d,
231
+ f,
232
+ g
233
+ ]
234
+ }), i[4] = s, i[5] = v);
235
+ let y, b;
236
+ i[6] !== a || i[7] !== s ? (y = s === "hexa" ? /* @__PURE__ */ jsxs("label", {
237
+ className: "color-input__channel color-input__channel--hex",
238
+ children: [/* @__PURE__ */ jsx("span", {
239
+ className: "color-input__channel-label",
240
+ children: "HEXA"
241
+ }), /* @__PURE__ */ jsx(ColorInputHexInput, { api: a })]
242
+ }) : /* @__PURE__ */ jsxs("div", {
243
+ className: "color-input__channel-row",
244
+ children: [(s === "rgba" ? [
245
+ "red",
246
+ "green",
247
+ "blue"
248
+ ] : [
249
+ "hue",
250
+ "saturation",
251
+ "lightness"
252
+ ]).map((t) => /* @__PURE__ */ jsx(ColorInputChannel, {
253
+ api: a,
254
+ format: s,
255
+ channel: t
256
+ }, t)), /* @__PURE__ */ jsx(ColorInputChannel, {
257
+ api: a,
258
+ format: s,
259
+ channel: "alpha"
260
+ })]
261
+ }), b = /* @__PURE__ */ jsx(ColorInputActions, {
262
+ api: a,
263
+ notation: s,
264
+ setNotation: c
265
+ }), i[6] = a, i[7] = s, i[8] = y, i[9] = b) : (y = i[8], b = i[9]);
266
+ let x;
267
+ return i[10] !== v || i[11] !== y || i[12] !== b ? (x = /* @__PURE__ */ jsxs("div", {
268
+ className: "color-input__channels",
269
+ onKeyDown: _temp,
270
+ children: [
271
+ v,
272
+ y,
273
+ b
274
+ ]
275
+ }), i[10] = v, i[11] = y, i[12] = b, i[13] = x) : x = i[13], x;
276
+ }, ColorInputActions = ({ api: t, notation: i, setNotation: c }) => {
277
+ let { hasValue: l } = React.useContext(ColorInputStateContext), [, u] = useCopyToClipboard(), d = React.useRef(t);
278
+ d.current = t;
279
+ let f = () => {
280
+ l && u(i === "hexa" ? t.value.toString("hexa") : t.value.toString(i));
281
+ }, p = () => {
282
+ navigator.clipboard.readText().then((t) => {
283
+ let i = parsePastedColor(t);
284
+ i && (d.current.setValue(i.color), c(i.notation), document.activeElement instanceof HTMLElement && document.activeElement.blur());
285
+ }, () => void 0);
286
+ };
287
+ useHotkeys("mod+c", f, {
288
+ enabled: l,
289
+ enableOnFormTags: !0
290
+ }, [
291
+ l,
292
+ i,
293
+ t
294
+ ]), useHotkeys("mod+v", p, { enableOnFormTags: !0 });
295
+ let m = /mac|iphone|ipad|ipod/i.test(navigator.userAgent) ? "⌘" : "Ctrl";
296
+ return /* @__PURE__ */ jsxs(Flex, {
297
+ className: "color-input__actions",
298
+ align: "center",
299
+ children: [/* @__PURE__ */ jsxs(Button, {
300
+ paddingSize: "xxs",
301
+ onClick: p,
302
+ children: ["Paste", /* @__PURE__ */ jsxs(Badge, { children: [m, "V"] })]
303
+ }), /* @__PURE__ */ jsxs(Button, {
304
+ paddingSize: "xxs",
305
+ onClick: f,
306
+ disabled: !l,
307
+ children: ["Copy", /* @__PURE__ */ jsxs(Badge, { children: [m, "C"] })]
308
+ })]
309
+ });
310
+ }, ColorInputChannel = (t) => {
311
+ let i = (0, import_compiler_runtime.c)(18), { channel: a, format: o, api: s } = t, c;
312
+ i[0] === a[0] ? c = i[1] : (c = a[0].toUpperCase(), i[0] = a[0], i[1] = c);
313
+ let l;
314
+ i[2] === c ? l = i[3] : (l = /* @__PURE__ */ jsx("span", {
315
+ className: "color-input__channel-label",
316
+ children: c
317
+ }), i[2] = c, i[3] = l);
318
+ let u;
319
+ i[4] !== s || i[5] !== a ? (u = s.getChannelValue(a), i[4] = s, i[5] = a, i[6] = u) : u = i[6];
320
+ let d = a === "alpha" ? "decimal" : "numeric", f;
321
+ i[7] !== s || i[8] !== a || i[9] !== o ? (f = (t) => {
322
+ let i = Number(t);
323
+ t.trim() === "" || Number.isNaN(i) || s.setValue(s.value.toFormat(o).withChannelValue(a, i));
324
+ }, i[7] = s, i[8] = a, i[9] = o, i[10] = f) : f = i[10];
325
+ let p;
326
+ i[11] !== u || i[12] !== d || i[13] !== f ? (p = /* @__PURE__ */ jsx(ColorInputTextInput, {
327
+ committed: u,
328
+ inputMode: d,
329
+ commit: f
330
+ }), i[11] = u, i[12] = d, i[13] = f, i[14] = p) : p = i[14];
331
+ let m;
332
+ return i[15] !== l || i[16] !== p ? (m = /* @__PURE__ */ jsxs("label", {
333
+ className: "color-input__channel",
334
+ children: [l, p]
335
+ }), i[15] = l, i[16] = p, i[17] = m) : m = i[17], m;
336
+ }, ColorInputHexInput = (t) => {
337
+ let i = (0, import_compiler_runtime.c)(7), { api: a } = t, o;
338
+ i[0] === a.value ? o = i[1] : (o = a.value.toString("hexa"), i[0] = a.value, i[1] = o);
339
+ let s;
340
+ i[2] === a ? s = i[3] : (s = (t) => {
341
+ let i = safeParseColor(t);
342
+ i && a.setValue(i);
343
+ }, i[2] = a, i[3] = s);
344
+ let c;
345
+ return i[4] !== o || i[5] !== s ? (c = /* @__PURE__ */ jsx(ColorInputTextInput, {
346
+ committed: o,
347
+ commit: s
348
+ }), i[4] = o, i[5] = s, i[6] = c) : c = i[6], c;
349
+ }, ColorInputTextInput = (t) => {
350
+ let i = (0, import_compiler_runtime.c)(13), { committed: a, commit: o, inputMode: s } = t, c = s === void 0 ? "text" : s, [l, u] = React.useState(a), d = React.useRef(!1), f, p;
351
+ i[0] === a ? (f = i[1], p = i[2]) : (f = () => {
352
+ d.current || u(a);
353
+ }, p = [a], i[0] = a, i[1] = f, i[2] = p), React.useEffect(f, p);
354
+ let m;
355
+ i[3] === Symbol.for("react.memo_cache_sentinel") ? (m = () => d.current = !0, i[3] = m) : m = i[3];
356
+ let g;
357
+ i[4] === o ? g = i[5] : (g = (t) => {
358
+ u(t.target.value), o(t.target.value);
359
+ }, i[4] = o, i[5] = g);
360
+ let _;
361
+ i[6] === a ? _ = i[7] : (_ = () => {
362
+ d.current = !1, u(a);
363
+ }, i[6] = a, i[7] = _);
364
+ let v;
365
+ return i[8] !== l || i[9] !== c || i[10] !== g || i[11] !== _ ? (v = /* @__PURE__ */ jsx("input", {
366
+ className: "color-input__channel-input",
367
+ type: "text",
368
+ inputMode: c,
369
+ value: l,
370
+ spellCheck: !1,
371
+ autoComplete: "off",
372
+ onFocus: m,
373
+ onChange: g,
374
+ onBlur: _
375
+ }), i[8] = l, i[9] = c, i[10] = g, i[11] = _, i[12] = v) : v = i[12], v;
355
376
  };
377
+ function _temp(t) {
378
+ t.key !== "Escape" && !t.metaKey && !t.ctrlKey && t.stopPropagation();
379
+ }
380
+ export { ColorInput, ColorInputContent, ColorInputControl, ColorInputSwatch, ColorInputTrigger, ColorInputValueText };