@emuanalytics/flow-rdf-ui 4.0.4 → 4.0.6

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 (355) hide show
  1. package/dist/components/alert/alert.component.mjs +202 -0
  2. package/dist/components/alert/alert.mjs +5 -0
  3. package/dist/components/alert/alert.styles.mjs +107 -0
  4. package/dist/components/animation/animation.component.mjs +207 -0
  5. package/dist/components/animation/animation.mjs +5 -0
  6. package/dist/components/animation/animation.styles.mjs +12 -0
  7. package/dist/components/animation/animations.mjs +11 -0
  8. package/dist/components/avatar/avatar.component.mjs +95 -0
  9. package/dist/components/avatar/avatar.mjs +5 -0
  10. package/dist/components/avatar/avatar.styles.mjs +70 -0
  11. package/dist/components/badge/badge.component.mjs +62 -0
  12. package/dist/components/badge/badge.mjs +5 -0
  13. package/dist/components/badge/badge.styles.mjs +105 -0
  14. package/dist/components/breadcrumb/breadcrumb.component.mjs +82 -0
  15. package/dist/components/breadcrumb/breadcrumb.mjs +5 -0
  16. package/dist/components/breadcrumb/breadcrumb.styles.mjs +14 -0
  17. package/dist/components/breadcrumb-item/breadcrumb-item.component.mjs +73 -0
  18. package/dist/components/breadcrumb-item/breadcrumb-item.mjs +5 -0
  19. package/dist/components/breadcrumb-item/breadcrumb-item.styles.mjs +90 -0
  20. package/dist/components/button/button.component.mjs +310 -0
  21. package/dist/components/button/button.mjs +5 -0
  22. package/dist/components/button/button.styles.mjs +690 -0
  23. package/dist/components/button-group/button-group.component.mjs +108 -0
  24. package/dist/components/button-group/button-group.mjs +5 -0
  25. package/dist/components/button-group/button-group.styles.mjs +21 -0
  26. package/dist/components/calendar/calendar.component.mjs +320 -0
  27. package/dist/components/calendar/calendar.mjs +5 -0
  28. package/dist/components/calendar/calendar.styles.mjs +145 -0
  29. package/dist/components/card/card.component.mjs +33 -0
  30. package/dist/components/card/card.mjs +5 -0
  31. package/dist/components/card/card.styles.mjs +73 -0
  32. package/dist/components/carousel/autoplay-controller.mjs +56 -0
  33. package/dist/components/carousel/carousel.component.mjs +406 -0
  34. package/dist/components/carousel/carousel.mjs +5 -0
  35. package/dist/components/carousel/carousel.styles.mjs +162 -0
  36. package/dist/components/carousel/scroll-controller.mjs +148 -0
  37. package/dist/components/carousel-item/carousel-item.component.mjs +22 -0
  38. package/dist/components/carousel-item/carousel-item.mjs +5 -0
  39. package/dist/components/carousel-item/carousel-item.styles.mjs +28 -0
  40. package/dist/components/chart/chart.component.mjs +82 -0
  41. package/dist/components/chart/chart.mjs +5 -0
  42. package/dist/components/chart/chart.styles.mjs +80 -0
  43. package/dist/components/chart/chartjs-plugins/interaction.interpolate.mjs +80 -0
  44. package/dist/components/chart/chartjs-plugins/plugin.flow-ui-colors.mjs +135 -0
  45. package/dist/components/chart/chartjs-plugins/positioner.cursor.mjs +14 -0
  46. package/dist/components/chart/chartjs-plugins/symlog.scale.mjs +42 -0
  47. package/dist/components/chart/chartjs-support.mjs +59 -0
  48. package/dist/components/checkbox/checkbox.component.mjs +246 -0
  49. package/dist/components/checkbox/checkbox.mjs +5 -0
  50. package/dist/components/checkbox/checkbox.styles.mjs +177 -0
  51. package/dist/components/color-mapper/color-mapper.component.mjs +260 -0
  52. package/dist/components/color-mapper/color-mapper.mjs +5 -0
  53. package/dist/components/color-mapper/color-mapper.styles.mjs +92 -0
  54. package/dist/components/color-mapper/helpers.mjs +55 -0
  55. package/dist/components/color-picker/color-picker.component.mjs +919 -0
  56. package/dist/components/color-picker/color-picker.mjs +5 -0
  57. package/dist/components/color-picker/color-picker.styles.mjs +337 -0
  58. package/dist/components/color-stop/color-stop.component.mjs +289 -0
  59. package/dist/components/color-stop/color-stop.mjs +5 -0
  60. package/dist/components/color-stop/color-stop.styles.mjs +103 -0
  61. package/dist/components/date-time-picker/date-time-picker.component.mjs +532 -0
  62. package/dist/components/date-time-picker/date-time-picker.mjs +5 -0
  63. package/dist/components/date-time-picker/date-time-picker.styles.mjs +260 -0
  64. package/dist/components/details/details.component.mjs +194 -0
  65. package/dist/components/details/details.mjs +5 -0
  66. package/dist/components/details/details.styles.mjs +85 -0
  67. package/dist/components/dialog/dialog.component.mjs +256 -0
  68. package/dist/components/dialog/dialog.mjs +5 -0
  69. package/dist/components/dialog/dialog.styles.mjs +125 -0
  70. package/dist/components/divider/divider.component.mjs +45 -0
  71. package/dist/components/divider/divider.mjs +5 -0
  72. package/dist/components/divider/divider.styles.mjs +34 -0
  73. package/dist/components/drawer/drawer.component.mjs +354 -0
  74. package/dist/components/drawer/drawer.mjs +5 -0
  75. package/dist/components/drawer/drawer.styles.mjs +161 -0
  76. package/dist/components/dropdown/dropdown.component.mjs +381 -0
  77. package/dist/components/dropdown/dropdown.mjs +5 -0
  78. package/dist/components/dropdown/dropdown.styles.mjs +56 -0
  79. package/dist/components/gauge/gauge.component.mjs +151 -0
  80. package/dist/components/gauge/gauge.mjs +5 -0
  81. package/dist/components/gauge/gauge.styles.mjs +127 -0
  82. package/dist/components/icon/icon.component.mjs +146 -0
  83. package/dist/components/icon/icon.mjs +5 -0
  84. package/dist/components/icon/icon.styles.mjs +35 -0
  85. package/dist/components/icon/library.default.mjs +38 -0
  86. package/dist/components/icon/library.mjs +38 -0
  87. package/dist/components/icon/library.system.mjs +158 -0
  88. package/dist/components/icon-button/icon-button.component.mjs +239 -0
  89. package/dist/components/icon-button/icon-button.mjs +5 -0
  90. package/dist/components/icon-button/icon-button.styles.mjs +81 -0
  91. package/dist/components/input/input.component.mjs +574 -0
  92. package/dist/components/input/input.mjs +5 -0
  93. package/dist/components/input/input.styles.mjs +310 -0
  94. package/dist/components/map/map.component.mjs +196 -0
  95. package/dist/components/map/map.mjs +5 -0
  96. package/dist/components/map/map.styles.mjs +90 -0
  97. package/dist/components/menu/menu.component.mjs +125 -0
  98. package/dist/components/menu/menu.mjs +5 -0
  99. package/dist/components/menu/menu.styles.mjs +23 -0
  100. package/dist/components/menu-item/menu-item.component.mjs +143 -0
  101. package/dist/components/menu-item/menu-item.mjs +5 -0
  102. package/dist/components/menu-item/menu-item.styles.mjs +103 -0
  103. package/dist/components/menu-label/menu-label.component.mjs +14 -0
  104. package/dist/components/menu-label/menu-label.mjs +5 -0
  105. package/dist/components/menu-label/menu-label.styles.mjs +24 -0
  106. package/dist/components/mutation-observer/mutation-observer.component.mjs +115 -0
  107. package/dist/components/mutation-observer/mutation-observer.mjs +5 -0
  108. package/dist/components/mutation-observer/mutation-observer.styles.mjs +12 -0
  109. package/dist/components/option/option.component.mjs +152 -0
  110. package/dist/components/option/option.mjs +5 -0
  111. package/dist/components/option/option.styles.mjs +102 -0
  112. package/dist/components/panel/panel.component.mjs +90 -0
  113. package/dist/components/panel/panel.mjs +5 -0
  114. package/dist/components/panel/panel.styles.mjs +51 -0
  115. package/dist/components/panel-header/panel-header.component.mjs +131 -0
  116. package/dist/components/panel-header/panel-header.mjs +5 -0
  117. package/dist/components/panel-header/panel-header.styles.mjs +67 -0
  118. package/dist/components/popup/popup.component.mjs +420 -0
  119. package/dist/components/popup/popup.mjs +5 -0
  120. package/dist/components/popup/popup.styles.mjs +63 -0
  121. package/dist/components/progress-bar/progress-bar.component.mjs +70 -0
  122. package/dist/components/progress-bar/progress-bar.mjs +5 -0
  123. package/dist/components/progress-bar/progress-bar.styles.mjs +87 -0
  124. package/dist/components/progress-ring/progress-ring.component.mjs +71 -0
  125. package/dist/components/progress-ring/progress-ring.mjs +5 -0
  126. package/dist/components/progress-ring/progress-ring.styles.mjs +72 -0
  127. package/dist/components/query-builder/converters/flow-query-converters.mjs +111 -0
  128. package/dist/components/query-builder/converters/map-layer-filter-converter.mjs +99 -0
  129. package/dist/components/query-builder/default-value-templates.mjs +151 -0
  130. package/dist/components/query-builder/helpers.mjs +42 -0
  131. package/dist/components/query-builder/query-builder.component.mjs +466 -0
  132. package/dist/components/query-builder/query-builder.mjs +5 -0
  133. package/dist/components/query-builder/query-builder.styles.mjs +261 -0
  134. package/dist/components/radio/radio.component.mjs +144 -0
  135. package/dist/components/radio/radio.mjs +5 -0
  136. package/dist/components/radio/radio.styles.mjs +164 -0
  137. package/dist/components/radio-group/radio-group.component.mjs +310 -0
  138. package/dist/components/radio-group/radio-group.mjs +5 -0
  139. package/dist/components/radio-group/radio-group.styles.mjs +49 -0
  140. package/dist/components/range/range.component.mjs +324 -0
  141. package/dist/components/range/range.mjs +5 -0
  142. package/dist/components/range/range.styles.mjs +233 -0
  143. package/dist/components/resize-observer/resize-observer.component.mjs +80 -0
  144. package/dist/components/resize-observer/resize-observer.mjs +5 -0
  145. package/dist/components/resize-observer/resize-observer.styles.mjs +12 -0
  146. package/dist/components/scroll-view/overlay-scrollbar.styles.mjs +686 -0
  147. package/dist/components/scroll-view/scroll-view.component.mjs +128 -0
  148. package/dist/components/scroll-view/scroll-view.mjs +5 -0
  149. package/dist/components/scroll-view/scroll-view.styles.mjs +57 -0
  150. package/dist/components/select/select.component.mjs +785 -0
  151. package/dist/components/select/select.mjs +5 -0
  152. package/dist/components/select/select.styles.mjs +339 -0
  153. package/dist/components/spinner/spinner.component.mjs +22 -0
  154. package/dist/components/spinner/spinner.mjs +5 -0
  155. package/dist/components/spinner/spinner.styles.mjs +64 -0
  156. package/dist/components/split-view/split-view.component.mjs +500 -0
  157. package/dist/components/split-view/split-view.mjs +5 -0
  158. package/dist/components/split-view/split-view.styles.mjs +33 -0
  159. package/dist/components/split-view-divider/split-view-divider.component.mjs +98 -0
  160. package/dist/components/split-view-divider/split-view-divider.mjs +5 -0
  161. package/dist/components/split-view-divider/split-view-divider.styles.mjs +96 -0
  162. package/dist/components/split-view-pane/split-view-pane.component.mjs +126 -0
  163. package/dist/components/split-view-pane/split-view-pane.mjs +5 -0
  164. package/dist/components/split-view-pane/split-view-pane.styles.mjs +49 -0
  165. package/dist/components/split-view-toggle-button/split-view-toggle-button.component.mjs +76 -0
  166. package/dist/components/split-view-toggle-button/split-view-toggle-button.mjs +5 -0
  167. package/dist/components/split-view-toggle-button/split-view-toggle-button.styles.mjs +40 -0
  168. package/dist/components/stepper/stepper.component.mjs +139 -0
  169. package/dist/components/stepper/stepper.mjs +5 -0
  170. package/dist/components/stepper/stepper.styles.mjs +103 -0
  171. package/dist/components/stepper-panel/stepper-panel.component.mjs +76 -0
  172. package/dist/components/stepper-panel/stepper-panel.mjs +5 -0
  173. package/dist/components/stepper-panel/stepper-panel.styles.mjs +22 -0
  174. package/dist/components/switch/switch.component.mjs +211 -0
  175. package/dist/components/switch/switch.mjs +5 -0
  176. package/dist/components/switch/switch.styles.mjs +166 -0
  177. package/dist/components/tab/tab.component.mjs +159 -0
  178. package/dist/components/tab/tab.mjs +5 -0
  179. package/dist/components/tab/tab.styles.mjs +107 -0
  180. package/dist/components/tab-group/tab-group.component.mjs +402 -0
  181. package/dist/components/tab-group/tab-group.mjs +5 -0
  182. package/dist/components/tab-group/tab-group.styles.mjs +386 -0
  183. package/dist/components/tab-panel/tab-panel.component.mjs +72 -0
  184. package/dist/components/tab-panel/tab-panel.mjs +5 -0
  185. package/dist/components/tab-panel/tab-panel.styles.mjs +55 -0
  186. package/dist/components/tag/tag.component.mjs +94 -0
  187. package/dist/components/tag/tag.mjs +5 -0
  188. package/dist/components/tag/tag.styles.mjs +130 -0
  189. package/dist/components/textarea/textarea.component.mjs +359 -0
  190. package/dist/components/textarea/textarea.mjs +5 -0
  191. package/dist/components/textarea/textarea.styles.mjs +171 -0
  192. package/dist/components/timer/ticker.mjs +78 -0
  193. package/dist/components/timer/timer.component.mjs +293 -0
  194. package/dist/components/timer/timer.mjs +5 -0
  195. package/dist/components/timer/timer.styles.mjs +94 -0
  196. package/dist/components/tool-button/tool-button.component.mjs +208 -0
  197. package/dist/components/tool-button/tool-button.mjs +5 -0
  198. package/dist/components/tool-button/tool-button.styles.mjs +251 -0
  199. package/dist/components/tool-button-group/tool-button-group.component.mjs +347 -0
  200. package/dist/components/tool-button-group/tool-button-group.mjs +5 -0
  201. package/dist/components/tool-button-group/tool-button-group.styles.mjs +59 -0
  202. package/dist/components/tooltip/tooltip.component.mjs +259 -0
  203. package/dist/components/tooltip/tooltip.mjs +5 -0
  204. package/dist/components/tooltip/tooltip.styles.mjs +57 -0
  205. package/dist/components/tree/tree.component.mjs +368 -0
  206. package/dist/components/tree/tree.mjs +5 -0
  207. package/dist/components/tree/tree.styles.mjs +41 -0
  208. package/dist/components/tree-item/tree-item.component.mjs +324 -0
  209. package/dist/components/tree-item/tree-item.mjs +5 -0
  210. package/dist/components/tree-item/tree-item.styles.mjs +178 -0
  211. package/dist/components/visually-hidden/visually-hidden.component.mjs +14 -0
  212. package/dist/components/visually-hidden/visually-hidden.mjs +5 -0
  213. package/dist/components/visually-hidden/visually-hidden.styles.mjs +20 -0
  214. package/dist/custom-elements.json +6494 -6508
  215. package/dist/index.d.mts +141 -132
  216. package/dist/index.d.ts +141 -132
  217. package/dist/index.mjs +78 -25094
  218. package/dist/internal/animate.mjs +47 -0
  219. package/dist/internal/animations/attention_seekers/bounce.mjs +17 -0
  220. package/dist/internal/animations/attention_seekers/flash.mjs +9 -0
  221. package/dist/internal/animations/attention_seekers/headShake.mjs +10 -0
  222. package/dist/internal/animations/attention_seekers/heartBeat.mjs +9 -0
  223. package/dist/internal/animations/attention_seekers/jello.mjs +14 -0
  224. package/dist/internal/animations/attention_seekers/pulse.mjs +7 -0
  225. package/dist/internal/animations/attention_seekers/rubberBand.mjs +11 -0
  226. package/dist/internal/animations/attention_seekers/shake.mjs +15 -0
  227. package/dist/internal/animations/attention_seekers/shakeX.mjs +15 -0
  228. package/dist/internal/animations/attention_seekers/shakeY.mjs +15 -0
  229. package/dist/internal/animations/attention_seekers/swing.mjs +9 -0
  230. package/dist/internal/animations/attention_seekers/tada.mjs +15 -0
  231. package/dist/internal/animations/attention_seekers/wobble.mjs +11 -0
  232. package/dist/internal/animations/back_entrances/backInDown.mjs +7 -0
  233. package/dist/internal/animations/back_entrances/backInLeft.mjs +7 -0
  234. package/dist/internal/animations/back_entrances/backInRight.mjs +7 -0
  235. package/dist/internal/animations/back_entrances/backInUp.mjs +7 -0
  236. package/dist/internal/animations/back_exits/backOutDown.mjs +7 -0
  237. package/dist/internal/animations/back_exits/backOutLeft.mjs +7 -0
  238. package/dist/internal/animations/back_exits/backOutRight.mjs +7 -0
  239. package/dist/internal/animations/back_exits/backOutUp.mjs +7 -0
  240. package/dist/internal/animations/bouncing_entrances/bounceIn.mjs +16 -0
  241. package/dist/internal/animations/bouncing_entrances/bounceInDown.mjs +14 -0
  242. package/dist/internal/animations/bouncing_entrances/bounceInLeft.mjs +14 -0
  243. package/dist/internal/animations/bouncing_entrances/bounceInRight.mjs +14 -0
  244. package/dist/internal/animations/bouncing_entrances/bounceInUp.mjs +14 -0
  245. package/dist/internal/animations/bouncing_exits/bounceOut.mjs +8 -0
  246. package/dist/internal/animations/bouncing_exits/bounceOutDown.mjs +8 -0
  247. package/dist/internal/animations/bouncing_exits/bounceOutLeft.mjs +6 -0
  248. package/dist/internal/animations/bouncing_exits/bounceOutRight.mjs +6 -0
  249. package/dist/internal/animations/bouncing_exits/bounceOutUp.mjs +8 -0
  250. package/dist/internal/animations/easings/easings.mjs +33 -0
  251. package/dist/internal/animations/fading_entrances/fadeIn.mjs +6 -0
  252. package/dist/internal/animations/fading_entrances/fadeInBottomLeft.mjs +6 -0
  253. package/dist/internal/animations/fading_entrances/fadeInBottomRight.mjs +6 -0
  254. package/dist/internal/animations/fading_entrances/fadeInDown.mjs +6 -0
  255. package/dist/internal/animations/fading_entrances/fadeInDownBig.mjs +6 -0
  256. package/dist/internal/animations/fading_entrances/fadeInLeft.mjs +6 -0
  257. package/dist/internal/animations/fading_entrances/fadeInLeftBig.mjs +6 -0
  258. package/dist/internal/animations/fading_entrances/fadeInRight.mjs +6 -0
  259. package/dist/internal/animations/fading_entrances/fadeInRightBig.mjs +6 -0
  260. package/dist/internal/animations/fading_entrances/fadeInTopLeft.mjs +6 -0
  261. package/dist/internal/animations/fading_entrances/fadeInTopRight.mjs +6 -0
  262. package/dist/internal/animations/fading_entrances/fadeInUp.mjs +6 -0
  263. package/dist/internal/animations/fading_entrances/fadeInUpBig.mjs +6 -0
  264. package/dist/internal/animations/fading_exits/fadeOut.mjs +6 -0
  265. package/dist/internal/animations/fading_exits/fadeOutBottomLeft.mjs +6 -0
  266. package/dist/internal/animations/fading_exits/fadeOutBottomRight.mjs +6 -0
  267. package/dist/internal/animations/fading_exits/fadeOutDown.mjs +6 -0
  268. package/dist/internal/animations/fading_exits/fadeOutDownBig.mjs +6 -0
  269. package/dist/internal/animations/fading_exits/fadeOutLeft.mjs +6 -0
  270. package/dist/internal/animations/fading_exits/fadeOutLeftBig.mjs +6 -0
  271. package/dist/internal/animations/fading_exits/fadeOutRight.mjs +6 -0
  272. package/dist/internal/animations/fading_exits/fadeOutRightBig.mjs +6 -0
  273. package/dist/internal/animations/fading_exits/fadeOutTopLeft.mjs +6 -0
  274. package/dist/internal/animations/fading_exits/fadeOutTopRight.mjs +6 -0
  275. package/dist/internal/animations/fading_exits/fadeOutUp.mjs +6 -0
  276. package/dist/internal/animations/fading_exits/fadeOutUpBig.mjs +6 -0
  277. package/dist/internal/animations/flippers/flip.mjs +29 -0
  278. package/dist/internal/animations/flippers/flipInX.mjs +9 -0
  279. package/dist/internal/animations/flippers/flipInY.mjs +9 -0
  280. package/dist/internal/animations/flippers/flipOutX.mjs +7 -0
  281. package/dist/internal/animations/flippers/flipOutY.mjs +7 -0
  282. package/dist/internal/animations/index.mjs +99 -0
  283. package/dist/internal/animations/lightspeed/lightSpeedInLeft.mjs +8 -0
  284. package/dist/internal/animations/lightspeed/lightSpeedInRight.mjs +8 -0
  285. package/dist/internal/animations/lightspeed/lightSpeedOutLeft.mjs +6 -0
  286. package/dist/internal/animations/lightspeed/lightSpeedOutRight.mjs +6 -0
  287. package/dist/internal/animations/rotating_entrances/rotateIn.mjs +6 -0
  288. package/dist/internal/animations/rotating_entrances/rotateInDownLeft.mjs +6 -0
  289. package/dist/internal/animations/rotating_entrances/rotateInDownRight.mjs +6 -0
  290. package/dist/internal/animations/rotating_entrances/rotateInUpLeft.mjs +6 -0
  291. package/dist/internal/animations/rotating_entrances/rotateInUpRight.mjs +6 -0
  292. package/dist/internal/animations/rotating_exits/rotateOut.mjs +6 -0
  293. package/dist/internal/animations/rotating_exits/rotateOutDownLeft.mjs +6 -0
  294. package/dist/internal/animations/rotating_exits/rotateOutDownRight.mjs +6 -0
  295. package/dist/internal/animations/rotating_exits/rotateOutUpLeft.mjs +6 -0
  296. package/dist/internal/animations/rotating_exits/rotateOutUpRight.mjs +6 -0
  297. package/dist/internal/animations/sliding_entrances/slideInDown.mjs +6 -0
  298. package/dist/internal/animations/sliding_entrances/slideInLeft.mjs +6 -0
  299. package/dist/internal/animations/sliding_entrances/slideInRight.mjs +6 -0
  300. package/dist/internal/animations/sliding_entrances/slideInUp.mjs +6 -0
  301. package/dist/internal/animations/sliding_exits/slideOutDown.mjs +6 -0
  302. package/dist/internal/animations/sliding_exits/slideOutLeft.mjs +6 -0
  303. package/dist/internal/animations/sliding_exits/slideOutRight.mjs +6 -0
  304. package/dist/internal/animations/sliding_exits/slideOutUp.mjs +6 -0
  305. package/dist/internal/animations/specials/hinge.mjs +10 -0
  306. package/dist/internal/animations/specials/jackInTheBox.mjs +8 -0
  307. package/dist/internal/animations/specials/rollIn.mjs +6 -0
  308. package/dist/internal/animations/specials/rollOut.mjs +6 -0
  309. package/dist/internal/animations/zooming_entrances/zoomIn.mjs +6 -0
  310. package/dist/internal/animations/zooming_entrances/zoomInDown.mjs +16 -0
  311. package/dist/internal/animations/zooming_entrances/zoomInLeft.mjs +16 -0
  312. package/dist/internal/animations/zooming_entrances/zoomInRight.mjs +16 -0
  313. package/dist/internal/animations/zooming_entrances/zoomInUp.mjs +16 -0
  314. package/dist/internal/animations/zooming_exits/zoomOut.mjs +7 -0
  315. package/dist/internal/animations/zooming_exits/zoomOutDown.mjs +16 -0
  316. package/dist/internal/animations/zooming_exits/zoomOutLeft.mjs +6 -0
  317. package/dist/internal/animations/zooming_exits/zoomOutRight.mjs +6 -0
  318. package/dist/internal/animations/zooming_exits/zoomOutUp.mjs +16 -0
  319. package/dist/internal/boolean.mjs +17 -0
  320. package/dist/internal/datetime.mjs +65 -0
  321. package/dist/internal/debounce.mjs +14 -0
  322. package/dist/internal/default-value.mjs +21 -0
  323. package/dist/internal/drag.mjs +30 -0
  324. package/dist/internal/ensure-array.mjs +16 -0
  325. package/dist/internal/event.mjs +13 -0
  326. package/dist/internal/flow-ui-rdf-element.mjs +61 -0
  327. package/dist/internal/form.mjs +264 -0
  328. package/dist/internal/localize.mjs +124 -0
  329. package/dist/internal/math.mjs +12 -0
  330. package/dist/internal/modal.mjs +52 -0
  331. package/dist/internal/offset.mjs +8 -0
  332. package/dist/internal/orderby.mjs +18 -0
  333. package/dist/internal/scroll.mjs +47 -0
  334. package/dist/internal/slot.mjs +59 -0
  335. package/dist/internal/string.mjs +5 -0
  336. package/dist/internal/tabbable.mjs +49 -0
  337. package/dist/internal/throttle.mjs +28 -0
  338. package/dist/internal/type-checks.mjs +16 -0
  339. package/dist/internal/watch.mjs +27 -0
  340. package/dist/package.json.mjs +3 -0
  341. package/dist/public-api.mjs +10 -0
  342. package/dist/styles/component.styles.mjs +19 -0
  343. package/dist/styles/form-control.styles.mjs +63 -0
  344. package/dist/translations/en.mjs +34 -0
  345. package/dist/utilities/animation-registry.mjs +33 -0
  346. package/dist/utilities/announce.mjs +12 -0
  347. package/dist/utilities/locale.mjs +10 -0
  348. package/dist/utilities/localize.mjs +7 -0
  349. package/dist/utilities/register-components.mjs +203 -0
  350. package/dist/vscode.html-custom-data.json +429 -429
  351. package/package.json +5 -8
  352. package/dist/icons/index.cjs +0 -4053
  353. package/dist/icons/index.d.cts +0 -2027
  354. package/dist/index.cjs +0 -25187
  355. package/dist/index.d.cts +0 -5678
@@ -0,0 +1,919 @@
1
+ import { TinyColor } from '@ctrl/tinycolor';
2
+ import { html } from 'lit';
3
+ import { query, state, property } from 'lit/decorators.js';
4
+ import { classMap } from 'lit/directives/class-map.js';
5
+ import { ifDefined } from 'lit/directives/if-defined.js';
6
+ import { styleMap } from 'lit/directives/style-map.js';
7
+ import { boolean } from '../../internal/boolean.mjs';
8
+ import { defaultValue } from '../../internal/default-value.mjs';
9
+ import { drag } from '../../internal/drag.mjs';
10
+ import { FlowRdfFormControl } from '../../internal/flow-ui-rdf-element.mjs';
11
+ import { FormControlController } from '../../internal/form.mjs';
12
+ import { clamp } from '../../internal/math.mjs';
13
+ import { watch } from '../../internal/watch.mjs';
14
+ import { LocalizeController } from '../../utilities/localize.mjs';
15
+ import styles from './color-picker.styles.mjs';
16
+
17
+ var __defProp = Object.defineProperty;
18
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
19
+ var __decorateClass = (decorators, target, key, kind) => {
20
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
21
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
22
+ if (decorator = decorators[i])
23
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
24
+ if (kind && result)
25
+ __defProp(target, key, result);
26
+ return result;
27
+ };
28
+ const hasEyeDropper = typeof window !== "undefined" && "EyeDropper" in window;
29
+ class FlowUiColorPicker extends FlowRdfFormControl {
30
+ constructor() {
31
+ super(...arguments);
32
+ this.formControlController = new FormControlController(this);
33
+ this.isSafeValue = false;
34
+ this.localize = new LocalizeController(this);
35
+ this.hasFocus = false;
36
+ this.isDraggingGridHandle = false;
37
+ this.isEmpty = false;
38
+ this.inputValue = "";
39
+ this.hue = 0;
40
+ this.saturation = 100;
41
+ this.brightness = 100;
42
+ this.alpha = 100;
43
+ this.value = "";
44
+ this.defaultValue = "";
45
+ this.label = "";
46
+ this.format = "hex";
47
+ this.inline = false;
48
+ this.size = "medium";
49
+ this.noFormatToggle = false;
50
+ this.name = "";
51
+ this.disabled = false;
52
+ this.placement = "bottom-start";
53
+ this.distance = 0;
54
+ this.skidding = 0;
55
+ this.hoist = false;
56
+ this.opacity = false;
57
+ this.uppercase = false;
58
+ this.swatches = "";
59
+ this.form = "";
60
+ this.required = false;
61
+ }
62
+ /** Gets the validity state object */
63
+ get validity() {
64
+ return this.input.validity;
65
+ }
66
+ /** Gets the validation message */
67
+ get validationMessage() {
68
+ return this.input.validationMessage;
69
+ }
70
+ connectedCallback() {
71
+ super.connectedCallback();
72
+ this.disabled = boolean(this.disabled, true);
73
+ this.opacity = boolean(this.opacity, true);
74
+ this.required = boolean(this.required, true);
75
+ this.noFormatToggle = boolean(this.noFormatToggle, true);
76
+ this.inline = boolean(this.inline, true);
77
+ this.uppercase = boolean(this.uppercase, true);
78
+ this.handleFocusIn = this.handleFocusIn.bind(this);
79
+ this.handleFocusOut = this.handleFocusOut.bind(this);
80
+ this.addEventListener("focusin", this.handleFocusIn);
81
+ this.addEventListener("focusout", this.handleFocusOut);
82
+ }
83
+ disconnectedCallback() {
84
+ super.disconnectedCallback();
85
+ this.removeEventListener("focusin", this.handleFocusIn);
86
+ this.removeEventListener("focusout", this.handleFocusOut);
87
+ }
88
+ firstUpdated() {
89
+ this.input.updateComplete.then(() => {
90
+ this.formControlController.updateValidity();
91
+ });
92
+ }
93
+ handleCopy() {
94
+ this.input.select();
95
+ document.execCommand("copy");
96
+ this.previewButton.focus();
97
+ this.previewButton.classList.add("color-picker__preview-color--copied");
98
+ this.previewButton.addEventListener("animationend", () => {
99
+ this.previewButton.classList.remove("color-picker__preview-color--copied");
100
+ });
101
+ }
102
+ handleFocusIn() {
103
+ this.hasFocus = true;
104
+ this.emit("flow-ui-focus");
105
+ }
106
+ handleFocusOut() {
107
+ this.hasFocus = false;
108
+ this.emit("flow-ui-blur");
109
+ }
110
+ handleFormatToggle() {
111
+ const formats = ["hex", "rgb", "hsl", "hsv"];
112
+ const nextIndex = (formats.indexOf(this.format) + 1) % formats.length;
113
+ this.format = formats[nextIndex];
114
+ this.setColor(this.value);
115
+ this.emit("flow-ui-change");
116
+ this.emit("flow-ui-input");
117
+ }
118
+ handleAlphaDrag(event) {
119
+ const container = this.shadowRoot.querySelector(".color-picker__slider.color-picker__alpha");
120
+ const handle = container.querySelector(".color-picker__slider-handle");
121
+ const { width } = container.getBoundingClientRect();
122
+ let oldValue = this.value;
123
+ handle.focus();
124
+ event.preventDefault();
125
+ drag(container, {
126
+ onMove: (x) => {
127
+ this.alpha = clamp(x / width * 100, 0, 100);
128
+ this.syncValues();
129
+ if (this.value !== oldValue) {
130
+ oldValue = this.value;
131
+ this.emit("flow-ui-change");
132
+ this.emit("flow-ui-input");
133
+ }
134
+ },
135
+ initialEvent: event
136
+ });
137
+ }
138
+ handleHueDrag(event) {
139
+ const container = this.shadowRoot.querySelector(".color-picker__slider.color-picker__hue");
140
+ const handle = container.querySelector(".color-picker__slider-handle");
141
+ const { width } = container.getBoundingClientRect();
142
+ let oldValue = this.value;
143
+ handle.focus();
144
+ event.preventDefault();
145
+ drag(container, {
146
+ onMove: (x) => {
147
+ this.hue = clamp(x / width * 360, 0, 360);
148
+ this.syncValues();
149
+ if (this.value !== oldValue) {
150
+ oldValue = this.value;
151
+ this.emit("flow-ui-change");
152
+ this.emit("flow-ui-input");
153
+ }
154
+ },
155
+ initialEvent: event
156
+ });
157
+ }
158
+ handleGridDrag(event) {
159
+ const grid = this.shadowRoot.querySelector(".color-picker__grid");
160
+ const handle = grid.querySelector(".color-picker__grid-handle");
161
+ const { width, height } = grid.getBoundingClientRect();
162
+ let oldValue = this.value;
163
+ handle.focus();
164
+ event.preventDefault();
165
+ this.isDraggingGridHandle = true;
166
+ drag(grid, {
167
+ onMove: (x, y) => {
168
+ this.saturation = clamp(x / width * 100, 0, 100);
169
+ this.brightness = clamp(100 - y / height * 100, 0, 100);
170
+ this.syncValues();
171
+ if (this.value !== oldValue) {
172
+ oldValue = this.value;
173
+ this.emit("flow-ui-change");
174
+ this.emit("flow-ui-input");
175
+ }
176
+ },
177
+ onStop: () => this.isDraggingGridHandle = false,
178
+ initialEvent: event
179
+ });
180
+ }
181
+ handleAlphaKeyDown(event) {
182
+ const increment = event.shiftKey ? 10 : 1;
183
+ const oldValue = this.value;
184
+ if (event.key === "ArrowLeft") {
185
+ event.preventDefault();
186
+ this.alpha = clamp(this.alpha - increment, 0, 100);
187
+ this.syncValues();
188
+ }
189
+ if (event.key === "ArrowRight") {
190
+ event.preventDefault();
191
+ this.alpha = clamp(this.alpha + increment, 0, 100);
192
+ this.syncValues();
193
+ }
194
+ if (event.key === "Home") {
195
+ event.preventDefault();
196
+ this.alpha = 0;
197
+ this.syncValues();
198
+ }
199
+ if (event.key === "End") {
200
+ event.preventDefault();
201
+ this.alpha = 100;
202
+ this.syncValues();
203
+ }
204
+ if (this.value !== oldValue) {
205
+ this.emit("flow-ui-change");
206
+ this.emit("flow-ui-input");
207
+ }
208
+ }
209
+ handleHueKeyDown(event) {
210
+ const increment = event.shiftKey ? 10 : 1;
211
+ const oldValue = this.value;
212
+ if (event.key === "ArrowLeft") {
213
+ event.preventDefault();
214
+ this.hue = clamp(this.hue - increment, 0, 360);
215
+ this.syncValues();
216
+ }
217
+ if (event.key === "ArrowRight") {
218
+ event.preventDefault();
219
+ this.hue = clamp(this.hue + increment, 0, 360);
220
+ this.syncValues();
221
+ }
222
+ if (event.key === "Home") {
223
+ event.preventDefault();
224
+ this.hue = 0;
225
+ this.syncValues();
226
+ }
227
+ if (event.key === "End") {
228
+ event.preventDefault();
229
+ this.hue = 360;
230
+ this.syncValues();
231
+ }
232
+ if (this.value !== oldValue) {
233
+ this.emit("flow-ui-change");
234
+ this.emit("flow-ui-input");
235
+ }
236
+ }
237
+ handleGridKeyDown(event) {
238
+ const increment = event.shiftKey ? 10 : 1;
239
+ const oldValue = this.value;
240
+ if (event.key === "ArrowLeft") {
241
+ event.preventDefault();
242
+ this.saturation = clamp(this.saturation - increment, 0, 100);
243
+ this.syncValues();
244
+ }
245
+ if (event.key === "ArrowRight") {
246
+ event.preventDefault();
247
+ this.saturation = clamp(this.saturation + increment, 0, 100);
248
+ this.syncValues();
249
+ }
250
+ if (event.key === "ArrowUp") {
251
+ event.preventDefault();
252
+ this.brightness = clamp(this.brightness + increment, 0, 100);
253
+ this.syncValues();
254
+ }
255
+ if (event.key === "ArrowDown") {
256
+ event.preventDefault();
257
+ this.brightness = clamp(this.brightness - increment, 0, 100);
258
+ this.syncValues();
259
+ }
260
+ if (this.value !== oldValue) {
261
+ this.emit("flow-ui-change");
262
+ this.emit("flow-ui-input");
263
+ }
264
+ }
265
+ handleInputChange(event) {
266
+ const target = event.target;
267
+ const oldValue = this.value;
268
+ event.stopPropagation();
269
+ if (this.input.value) {
270
+ this.setColor(target.value);
271
+ target.value = this.value;
272
+ } else {
273
+ this.value = "";
274
+ }
275
+ if (this.value !== oldValue) {
276
+ this.emit("flow-ui-change");
277
+ this.emit("flow-ui-input");
278
+ }
279
+ }
280
+ handleInputInput(event) {
281
+ this.formControlController.updateValidity();
282
+ event.stopPropagation();
283
+ }
284
+ handleInputKeyDown(event) {
285
+ if (event.key === "Enter") {
286
+ const oldValue = this.value;
287
+ if (this.input.value) {
288
+ this.setColor(this.input.value);
289
+ this.input.value = this.value;
290
+ if (this.value !== oldValue) {
291
+ this.emit("flow-ui-change");
292
+ this.emit("flow-ui-input");
293
+ }
294
+ setTimeout(() => this.input.select());
295
+ } else {
296
+ this.hue = 0;
297
+ }
298
+ }
299
+ }
300
+ handleInputInvalid(event) {
301
+ this.formControlController.setValidity(false);
302
+ this.formControlController.emitInvalidEvent(event);
303
+ }
304
+ handleTouchMove(event) {
305
+ event.preventDefault();
306
+ }
307
+ parseColor(colorString) {
308
+ const color = new TinyColor(colorString);
309
+ if (!color.isValid) {
310
+ return null;
311
+ }
312
+ const hslColor = color.toHsl();
313
+ const hsl = {
314
+ h: hslColor.h,
315
+ s: hslColor.s * 100,
316
+ l: hslColor.l * 100,
317
+ a: hslColor.a
318
+ };
319
+ const rgb = color.toRgb();
320
+ const hex = color.toHexString();
321
+ const hexa = color.toHex8String();
322
+ const hsvColor = color.toHsv();
323
+ const hsv = {
324
+ h: hsvColor.h,
325
+ s: hsvColor.s * 100,
326
+ v: hsvColor.v * 100,
327
+ a: hsvColor.a
328
+ };
329
+ return {
330
+ hsl: {
331
+ h: hsl.h,
332
+ s: hsl.s,
333
+ l: hsl.l,
334
+ string: this.setLetterCase(`hsl(${Math.round(hsl.h)}, ${Math.round(hsl.s)}%, ${Math.round(hsl.l)}%)`)
335
+ },
336
+ hsla: {
337
+ h: hsl.h,
338
+ s: hsl.s,
339
+ l: hsl.l,
340
+ a: hsl.a,
341
+ string: this.setLetterCase(
342
+ `hsla(${Math.round(hsl.h)}, ${Math.round(hsl.s)}%, ${Math.round(hsl.l)}%, ${hsl.a.toFixed(2).toString()})`
343
+ )
344
+ },
345
+ hsv: {
346
+ h: hsv.h,
347
+ s: hsv.s,
348
+ v: hsv.v,
349
+ string: this.setLetterCase(`hsv(${Math.round(hsv.h)}, ${Math.round(hsv.s)}%, ${Math.round(hsv.v)}%)`)
350
+ },
351
+ hsva: {
352
+ h: hsv.h,
353
+ s: hsv.s,
354
+ v: hsv.v,
355
+ a: hsv.a,
356
+ string: this.setLetterCase(
357
+ `hsva(${Math.round(hsv.h)}, ${Math.round(hsv.s)}%, ${Math.round(hsv.v)}%, ${hsv.a.toFixed(2).toString()})`
358
+ )
359
+ },
360
+ rgb: {
361
+ r: rgb.r,
362
+ g: rgb.g,
363
+ b: rgb.b,
364
+ string: this.setLetterCase(`rgb(${Math.round(rgb.r)}, ${Math.round(rgb.g)}, ${Math.round(rgb.b)})`)
365
+ },
366
+ rgba: {
367
+ r: rgb.r,
368
+ g: rgb.g,
369
+ b: rgb.b,
370
+ a: rgb.a,
371
+ string: this.setLetterCase(
372
+ `rgba(${Math.round(rgb.r)}, ${Math.round(rgb.g)}, ${Math.round(rgb.b)}, ${rgb.a.toFixed(2).toString()})`
373
+ )
374
+ },
375
+ hex: this.setLetterCase(hex),
376
+ hexa: this.setLetterCase(hexa)
377
+ };
378
+ }
379
+ setColor(colorString) {
380
+ const newColor = this.parseColor(colorString);
381
+ if (newColor === null) {
382
+ return false;
383
+ }
384
+ this.hue = newColor.hsva.h;
385
+ this.saturation = newColor.hsva.s;
386
+ this.brightness = newColor.hsva.v;
387
+ this.alpha = this.opacity ? newColor.hsva.a * 100 : 100;
388
+ this.syncValues();
389
+ return true;
390
+ }
391
+ setLetterCase(string) {
392
+ if (typeof string !== "string") {
393
+ return "";
394
+ }
395
+ return this.uppercase ? string.toUpperCase() : string.toLowerCase();
396
+ }
397
+ async syncValues() {
398
+ const currentColor = this.parseColor(
399
+ `hsva(${this.hue}, ${this.saturation}%, ${this.brightness}%, ${this.alpha / 100})`
400
+ );
401
+ if (currentColor === null) {
402
+ return;
403
+ }
404
+ if (this.format === "hsl") {
405
+ this.inputValue = this.opacity ? currentColor.hsla.string : currentColor.hsl.string;
406
+ } else if (this.format === "rgb") {
407
+ this.inputValue = this.opacity ? currentColor.rgba.string : currentColor.rgb.string;
408
+ } else if (this.format === "hsv") {
409
+ this.inputValue = this.opacity ? currentColor.hsva.string : currentColor.hsv.string;
410
+ } else {
411
+ this.inputValue = this.opacity ? currentColor.hexa : currentColor.hex;
412
+ }
413
+ this.isSafeValue = true;
414
+ this.value = this.inputValue;
415
+ await this.updateComplete;
416
+ this.isSafeValue = false;
417
+ }
418
+ handleAfterHide() {
419
+ this.previewButton.classList.remove("color-picker__preview-color--copied");
420
+ }
421
+ handleEyeDropper() {
422
+ if (!hasEyeDropper) {
423
+ return;
424
+ }
425
+ const eyeDropper = new EyeDropper();
426
+ eyeDropper.open().then((colorSelectionResult) => {
427
+ const oldValue = this.value;
428
+ this.setColor(colorSelectionResult.sRGBHex);
429
+ if (this.value !== oldValue) {
430
+ this.emit("flow-ui-change");
431
+ this.emit("flow-ui-input");
432
+ }
433
+ }).catch(() => {
434
+ });
435
+ }
436
+ selectSwatch(color) {
437
+ const oldValue = this.value;
438
+ if (!this.disabled) {
439
+ this.setColor(color);
440
+ if (this.value !== oldValue) {
441
+ this.emit("flow-ui-change");
442
+ this.emit("flow-ui-input");
443
+ }
444
+ }
445
+ }
446
+ /** Generates a hex string from HSV values. Hue must be 0-360. All other arguments must be 0-100. */
447
+ getHexString(hue, saturation, brightness, alpha = 100) {
448
+ const color = new TinyColor(`hsva(${hue}, ${saturation}, ${brightness}, ${alpha / 100})`);
449
+ if (!color.isValid) {
450
+ return "";
451
+ }
452
+ return color.toHex8String();
453
+ }
454
+ // Prevents nested components from leaking events
455
+ stopNestedEventPropagation(event) {
456
+ event.stopImmediatePropagation();
457
+ }
458
+ handleFormatChange() {
459
+ this.syncValues();
460
+ }
461
+ handleOpacityChange() {
462
+ this.alpha = 100;
463
+ }
464
+ handleValueChange(oldValue, newValue) {
465
+ this.isEmpty = !newValue;
466
+ if (!newValue) {
467
+ this.hue = 0;
468
+ this.saturation = 0;
469
+ this.brightness = 100;
470
+ this.alpha = 100;
471
+ }
472
+ if (!this.isSafeValue) {
473
+ const newColor = this.parseColor(newValue);
474
+ if (newColor !== null) {
475
+ this.inputValue = this.value;
476
+ this.hue = newColor.hsva.h;
477
+ this.saturation = newColor.hsva.s;
478
+ this.brightness = newColor.hsva.v;
479
+ this.alpha = newColor.hsva.a * 100;
480
+ this.syncValues();
481
+ } else {
482
+ this.inputValue = oldValue ?? "";
483
+ }
484
+ }
485
+ }
486
+ /** Sets focus on the color picker. */
487
+ focus(options) {
488
+ if (this.inline) {
489
+ this.base.focus(options);
490
+ } else {
491
+ this.trigger.focus(options);
492
+ }
493
+ }
494
+ /** Removes focus from the color picker. */
495
+ blur() {
496
+ const elementToBlur = this.inline ? this.base : this.trigger;
497
+ if (this.hasFocus) {
498
+ elementToBlur.focus({ preventScroll: true });
499
+ elementToBlur.blur();
500
+ }
501
+ if (this.dropdown?.open) {
502
+ this.dropdown.hide();
503
+ }
504
+ }
505
+ /** Returns the current value as a string in the specified format. */
506
+ getFormattedValue(format = "hex") {
507
+ const currentColor = this.parseColor(
508
+ `hsva(${this.hue}, ${this.saturation}%, ${this.brightness}%, ${this.alpha / 100})`
509
+ );
510
+ if (currentColor === null) {
511
+ return "";
512
+ }
513
+ switch (format) {
514
+ case "hex":
515
+ return currentColor.hex;
516
+ case "hexa":
517
+ return currentColor.hexa;
518
+ case "rgb":
519
+ return currentColor.rgb.string;
520
+ case "rgba":
521
+ return currentColor.rgba.string;
522
+ case "hsl":
523
+ return currentColor.hsl.string;
524
+ case "hsla":
525
+ return currentColor.hsla.string;
526
+ case "hsv":
527
+ return currentColor.hsv.string;
528
+ case "hsva":
529
+ return currentColor.hsva.string;
530
+ default:
531
+ return "";
532
+ }
533
+ }
534
+ /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
535
+ checkValidity() {
536
+ return this.input.checkValidity();
537
+ }
538
+ /** Gets the associated form, if one exists. */
539
+ getForm() {
540
+ return this.formControlController.getForm();
541
+ }
542
+ /** Checks for validity and shows the browser's validation message if the control is invalid. */
543
+ reportValidity() {
544
+ if (!this.inline && !this.validity.valid) {
545
+ this.dropdown.show();
546
+ this.addEventListener("flow-ui-after-show", () => this.input.reportValidity(), { once: true });
547
+ if (!this.disabled) {
548
+ this.formControlController.emitInvalidEvent();
549
+ }
550
+ return false;
551
+ }
552
+ return this.input.reportValidity();
553
+ }
554
+ /** Sets a custom validation message. Pass an empty string to restore validity. */
555
+ setCustomValidity(message) {
556
+ this.input.setCustomValidity(message);
557
+ this.formControlController.updateValidity();
558
+ }
559
+ render() {
560
+ const gridHandleX = this.saturation;
561
+ const gridHandleY = 100 - this.brightness;
562
+ const swatches = Array.isArray(this.swatches) ? this.swatches : this.swatches.split(";").filter((color) => color.trim() !== "");
563
+ const colorPicker = html`
564
+ <div
565
+ part="base"
566
+ class=${classMap({
567
+ "color-picker": true,
568
+ "color-picker--inline": this.inline,
569
+ "color-picker--disabled": this.disabled,
570
+ "color-picker--focused": this.hasFocus
571
+ })}
572
+ aria-disabled=${this.disabled ? "true" : "false"}
573
+ aria-labelledby="label"
574
+ tabindex=${this.inline ? "0" : "-1"}
575
+ >
576
+ ${this.inline ? html`
577
+ <flow-ui-visually-hidden id="label">
578
+ <slot name="label">${this.label}</slot>
579
+ </flow-ui-visually-hidden>
580
+ ` : null}
581
+
582
+ <div
583
+ part="grid"
584
+ class="color-picker__grid"
585
+ style=${styleMap({ backgroundColor: this.getHexString(this.hue, 100, 100) })}
586
+ @pointerdown=${this.handleGridDrag}
587
+ @touchmove=${this.handleTouchMove}
588
+ >
589
+ <span
590
+ part="grid-handle"
591
+ class=${classMap({
592
+ "color-picker__grid-handle": true,
593
+ "color-picker__grid-handle--dragging": this.isDraggingGridHandle
594
+ })}
595
+ style=${styleMap({
596
+ top: `${gridHandleY}%`,
597
+ left: `${gridHandleX}%`,
598
+ backgroundColor: this.getHexString(this.hue, this.saturation, this.brightness, this.alpha)
599
+ })}
600
+ role="application"
601
+ aria-label="HSV"
602
+ tabindex=${ifDefined(this.disabled ? void 0 : "0")}
603
+ @keydown=${this.handleGridKeyDown}
604
+ ></span>
605
+ </div>
606
+
607
+ <div class="color-picker__controls">
608
+ <div class="color-picker__sliders">
609
+ <div
610
+ part="slider hue-slider"
611
+ class="color-picker__hue color-picker__slider"
612
+ @pointerdown=${this.handleHueDrag}
613
+ @touchmove=${this.handleTouchMove}
614
+ >
615
+ <span
616
+ part="slider-handle hue-slider-handle"
617
+ class="color-picker__slider-handle"
618
+ style=${styleMap({
619
+ left: `${this.hue === 0 ? 0 : 100 / (360 / this.hue)}%`
620
+ })}
621
+ role="slider"
622
+ aria-label="hue"
623
+ aria-orientation="horizontal"
624
+ aria-valuemin="0"
625
+ aria-valuemax="360"
626
+ aria-valuenow=${`${Math.round(this.hue)}`}
627
+ tabindex=${ifDefined(this.disabled ? void 0 : "0")}
628
+ @keydown=${this.handleHueKeyDown}
629
+ ></span>
630
+ </div>
631
+
632
+ ${this.opacity ? html`
633
+ <div
634
+ part="slider opacity-slider"
635
+ class="color-picker__alpha color-picker__slider color-picker__transparent-bg"
636
+ @pointerdown="${this.handleAlphaDrag}"
637
+ @touchmove=${this.handleTouchMove}
638
+ >
639
+ <div
640
+ class="color-picker__alpha-gradient"
641
+ style=${styleMap({
642
+ backgroundImage: `linear-gradient(
643
+ to right,
644
+ ${this.getHexString(this.hue, this.saturation, this.brightness, 0)} 0%
645
+ ${this.getHexString(this.hue, this.saturation, this.brightness, 100)} 100%
646
+ )`
647
+ })}
648
+ ></div>
649
+ <span
650
+ part="slider-handle opacity-slider-handle"
651
+ class="color-picker__slider-handle"
652
+ style=${styleMap({
653
+ left: `${this.alpha}%`
654
+ })}
655
+ role="slider"
656
+ aria-label="alpha"
657
+ aria-orientation="horizontal"
658
+ aria-valuemin="0"
659
+ aria-valuemax="100"
660
+ aria-valuenow=${Math.round(this.alpha)}
661
+ tabindex=${ifDefined(this.disabled ? void 0 : "0")}
662
+ @keydown=${this.handleAlphaKeyDown}
663
+ ></span>
664
+ </div>
665
+ ` : ""}
666
+ </div>
667
+
668
+ <button
669
+ type="button"
670
+ part="preview"
671
+ class="color-picker__preview color-picker__transparent-bg"
672
+ aria-label=${this.localize.term("copy")}
673
+ style=${styleMap({
674
+ "--preview-color": this.getHexString(this.hue, this.saturation, this.brightness, this.alpha)
675
+ })}
676
+ @click=${this.handleCopy}
677
+ ></button>
678
+ </div>
679
+
680
+ <div class="color-picker__user-input" aria-live="polite">
681
+ <flow-ui-input
682
+ part="input"
683
+ type="text"
684
+ name=${this.name}
685
+ autocomplete="off"
686
+ autocorrect="off"
687
+ autocapitalize="off"
688
+ spellcheck="false"
689
+ value=${this.isEmpty ? "" : this.inputValue}
690
+ ?required=${this.required}
691
+ ?disabled=${this.disabled}
692
+ aria-label=${this.localize.term("currentValue")}
693
+ @keydown=${this.handleInputKeyDown}
694
+ @flow-ui-change=${this.handleInputChange}
695
+ @flow-ui-input=${this.handleInputInput}
696
+ @flow-ui-invalid=${this.handleInputInvalid}
697
+ @flow-ui-blur=${this.stopNestedEventPropagation}
698
+ @flow-ui-focus=${this.stopNestedEventPropagation}
699
+ ></flow-ui-input>
700
+
701
+ <flow-ui-button-group>
702
+ ${!this.noFormatToggle ? html`
703
+ <flow-ui-button
704
+ part="format-button"
705
+ aria-label=${this.localize.term("toggleColorFormat")}
706
+ exportparts="
707
+ base:format-button__base,
708
+ prefix:format-button__prefix,
709
+ label:format-button__label,
710
+ suffix:format-button__suffix,
711
+ caret:format-button__caret
712
+ "
713
+ @click=${this.handleFormatToggle}
714
+ @flow-ui-blur=${this.stopNestedEventPropagation}
715
+ @flow-ui-focus=${this.stopNestedEventPropagation}
716
+ >
717
+ ${this.setLetterCase(this.format)}
718
+ </flow-ui-button>
719
+ ` : ""}
720
+ ${hasEyeDropper ? html`
721
+ <flow-ui-button
722
+ part="eye-dropper-button"
723
+ exportparts="
724
+ base:eye-dropper-button__base,
725
+ prefix:eye-dropper-button__prefix,
726
+ label:eye-dropper-button__label,
727
+ suffix:eye-dropper-button__suffix,
728
+ caret:eye-dropper-button__caret
729
+ "
730
+ @click=${this.handleEyeDropper}
731
+ @flow-ui-blur=${this.stopNestedEventPropagation}
732
+ @flow-ui-focus=${this.stopNestedEventPropagation}
733
+ >
734
+ <flow-ui-icon
735
+ library="system"
736
+ name="eyedropper"
737
+ label=${this.localize.term("selectAColorFromTheScreen")}
738
+ ></flow-ui-icon>
739
+ </flow-ui-button>
740
+ ` : ""}
741
+ </flow-ui-button-group>
742
+ </div>
743
+
744
+ ${swatches.length > 0 ? html`
745
+ <div part="swatches" class="color-picker__swatches">
746
+ ${swatches.map((swatch) => {
747
+ const parsedColor = this.parseColor(swatch);
748
+ if (!parsedColor) {
749
+ console.error(`Unable to parse swatch color: "${swatch}"`, this);
750
+ return "";
751
+ }
752
+ return html`
753
+ <div
754
+ part="swatch"
755
+ class="color-picker__swatch color-picker__transparent-bg"
756
+ tabindex=${ifDefined(this.disabled ? void 0 : "0")}
757
+ role="button"
758
+ aria-label=${swatch}
759
+ @click=${() => this.selectSwatch(swatch)}
760
+ @keydown=${(event) => !this.disabled && event.key === "Enter" && this.setColor(parsedColor.hexa)}
761
+ >
762
+ <div
763
+ class="color-picker__swatch-color"
764
+ style=${styleMap({ backgroundColor: parsedColor.hexa })}
765
+ ></div>
766
+ </div>
767
+ `;
768
+ })}
769
+ </div>
770
+ ` : ""}
771
+ </div>
772
+ `;
773
+ if (this.inline) {
774
+ return colorPicker;
775
+ }
776
+ return html`
777
+ <flow-ui-dropdown
778
+ class="color-dropdown"
779
+ aria-disabled=${this.disabled ? "true" : "false"}
780
+ .containing-element=${this}
781
+ ?disabled=${this.disabled}
782
+ placement=${this.placement}
783
+ distance=${this.distance}
784
+ skidding=${this.skidding}
785
+ ?hoist=${this.hoist}
786
+ @flow-ui-after-hide=${this.handleAfterHide}
787
+ >
788
+ <button
789
+ part="trigger"
790
+ slot="trigger"
791
+ class=${classMap({
792
+ "color-dropdown__trigger": true,
793
+ "color-dropdown__trigger--disabled": this.disabled,
794
+ "color-dropdown__trigger--small": this.size === "small",
795
+ "color-dropdown__trigger--medium": this.size === "medium",
796
+ "color-dropdown__trigger--large": this.size === "large",
797
+ "color-dropdown__trigger--empty": this.isEmpty,
798
+ "color-dropdown__trigger--focused": this.hasFocus,
799
+ "color-picker__transparent-bg": true
800
+ })}
801
+ style=${styleMap({
802
+ color: this.getHexString(this.hue, this.saturation, this.brightness, this.alpha)
803
+ })}
804
+ type="button"
805
+ >
806
+ <flow-ui-visually-hidden>
807
+ <slot name="label">${this.label}</slot>
808
+ </flow-ui-visually-hidden>
809
+ </button>
810
+ ${colorPicker}
811
+ </flow-ui-dropdown>
812
+ `;
813
+ }
814
+ }
815
+ FlowUiColorPicker.styles = styles;
816
+ __decorateClass([
817
+ query('[part~="base"]')
818
+ ], FlowUiColorPicker.prototype, "base", 2);
819
+ __decorateClass([
820
+ query('[part~="input"]')
821
+ ], FlowUiColorPicker.prototype, "input", 2);
822
+ __decorateClass([
823
+ query(".color-dropdown")
824
+ ], FlowUiColorPicker.prototype, "dropdown", 2);
825
+ __decorateClass([
826
+ query('[part~="preview"]')
827
+ ], FlowUiColorPicker.prototype, "previewButton", 2);
828
+ __decorateClass([
829
+ query('[part~="trigger"]')
830
+ ], FlowUiColorPicker.prototype, "trigger", 2);
831
+ __decorateClass([
832
+ state()
833
+ ], FlowUiColorPicker.prototype, "hasFocus", 2);
834
+ __decorateClass([
835
+ state()
836
+ ], FlowUiColorPicker.prototype, "isDraggingGridHandle", 2);
837
+ __decorateClass([
838
+ state()
839
+ ], FlowUiColorPicker.prototype, "isEmpty", 2);
840
+ __decorateClass([
841
+ state()
842
+ ], FlowUiColorPicker.prototype, "inputValue", 2);
843
+ __decorateClass([
844
+ state()
845
+ ], FlowUiColorPicker.prototype, "hue", 2);
846
+ __decorateClass([
847
+ state()
848
+ ], FlowUiColorPicker.prototype, "saturation", 2);
849
+ __decorateClass([
850
+ state()
851
+ ], FlowUiColorPicker.prototype, "brightness", 2);
852
+ __decorateClass([
853
+ state()
854
+ ], FlowUiColorPicker.prototype, "alpha", 2);
855
+ __decorateClass([
856
+ property()
857
+ ], FlowUiColorPicker.prototype, "value", 2);
858
+ __decorateClass([
859
+ defaultValue()
860
+ ], FlowUiColorPicker.prototype, "defaultValue", 2);
861
+ __decorateClass([
862
+ property()
863
+ ], FlowUiColorPicker.prototype, "label", 2);
864
+ __decorateClass([
865
+ property()
866
+ ], FlowUiColorPicker.prototype, "format", 2);
867
+ __decorateClass([
868
+ property({ type: Boolean, reflect: true })
869
+ ], FlowUiColorPicker.prototype, "inline", 2);
870
+ __decorateClass([
871
+ property({ reflect: true })
872
+ ], FlowUiColorPicker.prototype, "size", 2);
873
+ __decorateClass([
874
+ property({ attribute: "no-format-toggle", type: Boolean })
875
+ ], FlowUiColorPicker.prototype, "noFormatToggle", 2);
876
+ __decorateClass([
877
+ property()
878
+ ], FlowUiColorPicker.prototype, "name", 2);
879
+ __decorateClass([
880
+ property({ type: Boolean, reflect: true })
881
+ ], FlowUiColorPicker.prototype, "disabled", 2);
882
+ __decorateClass([
883
+ property({ reflect: true })
884
+ ], FlowUiColorPicker.prototype, "placement", 2);
885
+ __decorateClass([
886
+ property({ type: Number })
887
+ ], FlowUiColorPicker.prototype, "distance", 2);
888
+ __decorateClass([
889
+ property({ type: Number })
890
+ ], FlowUiColorPicker.prototype, "skidding", 2);
891
+ __decorateClass([
892
+ property({ type: Boolean })
893
+ ], FlowUiColorPicker.prototype, "hoist", 2);
894
+ __decorateClass([
895
+ property({ type: Boolean })
896
+ ], FlowUiColorPicker.prototype, "opacity", 2);
897
+ __decorateClass([
898
+ property({ type: Boolean })
899
+ ], FlowUiColorPicker.prototype, "uppercase", 2);
900
+ __decorateClass([
901
+ property()
902
+ ], FlowUiColorPicker.prototype, "swatches", 2);
903
+ __decorateClass([
904
+ property({ reflect: true })
905
+ ], FlowUiColorPicker.prototype, "form", 2);
906
+ __decorateClass([
907
+ property({ type: Boolean, reflect: true })
908
+ ], FlowUiColorPicker.prototype, "required", 2);
909
+ __decorateClass([
910
+ watch("format", { waitUntilFirstUpdate: true })
911
+ ], FlowUiColorPicker.prototype, "handleFormatChange", 1);
912
+ __decorateClass([
913
+ watch("opacity", { waitUntilFirstUpdate: true })
914
+ ], FlowUiColorPicker.prototype, "handleOpacityChange", 1);
915
+ __decorateClass([
916
+ watch("value")
917
+ ], FlowUiColorPicker.prototype, "handleValueChange", 1);
918
+
919
+ export { FlowUiColorPicker as default };