@apple-pie/slice 0.0.0 → 0.0.2

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 (291) hide show
  1. package/dist/cjs/chunks/Avatar-8-wPWe0V.js +68 -0
  2. package/dist/cjs/chunks/AvatarGroup-CVKmgBbD.js +39 -0
  3. package/dist/cjs/chunks/Badge-CMapJCij.js +41 -0
  4. package/dist/cjs/chunks/CheckBox-7AACxrdZ.js +76 -0
  5. package/dist/cjs/chunks/DivInput-BKKJTFeV.js +204 -0
  6. package/dist/cjs/chunks/DocIcons-BRWOzK96.js +41 -0
  7. package/dist/cjs/chunks/Dot-Dnr9M9na.js +80 -0
  8. package/dist/cjs/chunks/DrggablePanel-C6TPsDB-.js +302 -0
  9. package/dist/cjs/chunks/DropDown-D9sf_m2I.js +154 -0
  10. package/dist/cjs/chunks/EditorButtonBar-CUNDgRQd.js +244 -0
  11. package/dist/cjs/chunks/ErrorSummary-Dv44onsV.js +42 -0
  12. package/dist/cjs/chunks/FlexDiv-DZBpswHV.js +103 -0
  13. package/dist/cjs/chunks/Grouper-_kd2nU78.js +50 -0
  14. package/dist/cjs/chunks/IconButton-BfsPlKTb.js +84 -0
  15. package/dist/cjs/chunks/Logos-DSlAUz8l.js +119 -0
  16. package/dist/cjs/chunks/MessageInput-CiHFo2j8.js +399 -0
  17. package/dist/cjs/chunks/Overlay-DwCPvGB5.js +45 -0
  18. package/dist/cjs/chunks/Pager-CFtZ0IIW.js +42 -0
  19. package/dist/cjs/chunks/ProgressIndicator-C5oB7Mky.js +121 -0
  20. package/dist/cjs/chunks/RadioButton-e_y2qiPE.js +65 -0
  21. package/dist/cjs/chunks/RadioButtonList-I81UwHmM.js +116 -0
  22. package/dist/cjs/chunks/Slider-C-gn7Sby.js +285 -0
  23. package/dist/cjs/chunks/Spacer-BEY2-_PB.js +16 -0
  24. package/dist/cjs/chunks/Switch-CtkFtogd.js +43 -0
  25. package/dist/cjs/chunks/TabBar-D3bj4pjj.js +176 -0
  26. package/dist/cjs/chunks/TextArea-B1oKK3_b.js +153 -0
  27. package/dist/cjs/chunks/TextField-CiQdPP5E.js +248 -0
  28. package/dist/cjs/chunks/Tip-C2pzExut.js +91 -0
  29. package/dist/cjs/chunks/Toast-DrijUwoL.js +141 -0
  30. package/dist/cjs/chunks/UIButton-CH4p-8yq.js +317 -0
  31. package/dist/cjs/chunks/UIButtonBar-0fHPB0ww.js +58 -0
  32. package/dist/cjs/chunks/UICard-DBDSyT7E.js +36 -0
  33. package/dist/cjs/chunks/UIChip-kjhvRrOV.js +93 -0
  34. package/dist/cjs/chunks/UIFileIcon-ZrbDIeYz.js +54 -0
  35. package/dist/cjs/chunks/UILabel-DkBE2AIt.js +116 -0
  36. package/dist/cjs/chunks/_types-CoWzQFsT.js +714 -0
  37. package/dist/cjs/chunks/sharedTypes-BvTjh6M5.js +9 -0
  38. package/dist/cjs/chunks/style-inject.es-XZHJH68X.js +30 -0
  39. package/dist/cjs/chunks/tipStore-C9oV9SIh.js +23 -0
  40. package/dist/cjs/chunks/toastStore-C-ETP9H6.js +23 -0
  41. package/dist/cjs/chunks/tslib.es6-4H29ixHs.js +48 -0
  42. package/dist/cjs/chunks/utils-CbayehuI.js +126 -0
  43. package/dist/cjs/hooks/useDoubleClick.js +26 -0
  44. package/dist/cjs/hooks/useKeyboardShortcuts.js +42 -0
  45. package/dist/cjs/hooks/useLastUpdated.js +53 -0
  46. package/dist/cjs/hooks/useLocalStore.js +52 -0
  47. package/dist/cjs/hooks/useObserveResize.js +56 -0
  48. package/dist/cjs/hooks/useObserveTheme.js +36 -0
  49. package/dist/cjs/hooks/useTheme.js +85 -0
  50. package/dist/cjs/hooks/useToolTip.js +36 -0
  51. package/dist/cjs/hooks/useTrackRenders.js +38 -0
  52. package/dist/cjs/hooks/useWindow.js +64 -0
  53. package/dist/cjs/hooks.js +32 -0
  54. package/dist/cjs/index.js +121 -0
  55. package/dist/cjs/providers/ThemeProvider.js +51 -0
  56. package/dist/cjs/providers.js +13 -0
  57. package/dist/cjs/stores/tip.js +12 -0
  58. package/dist/cjs/stores/toast.js +12 -0
  59. package/dist/cjs/stores.js +18 -0
  60. package/dist/cjs/theme/colors.js +383 -0
  61. package/dist/cjs/theme/corners.js +14 -0
  62. package/dist/cjs/theme/themes.js +23 -0
  63. package/dist/cjs/theme/type.js +316 -0
  64. package/dist/cjs/theme.js +13 -0
  65. package/dist/cjs/uikit/Avatar.js +11 -0
  66. package/dist/cjs/uikit/AvatarGroup.js +12 -0
  67. package/dist/cjs/uikit/Badge.js +11 -0
  68. package/dist/cjs/uikit/CheckBox.js +21 -0
  69. package/dist/cjs/uikit/DivInput.js +13 -0
  70. package/dist/cjs/uikit/DocIcon.js +17 -0
  71. package/dist/cjs/uikit/Dot.js +12 -0
  72. package/dist/cjs/uikit/DraggablePanel.js +20 -0
  73. package/dist/cjs/uikit/DropDown.js +20 -0
  74. package/dist/cjs/uikit/EditorButtonBar.js +27 -0
  75. package/dist/cjs/uikit/ErrorSummary.js +12 -0
  76. package/dist/cjs/uikit/FlexDiv.js +12 -0
  77. package/dist/cjs/uikit/Grouper.js +22 -0
  78. package/dist/cjs/uikit/Icon.js +22 -0
  79. package/dist/cjs/uikit/IconButton.js +24 -0
  80. package/dist/cjs/uikit/Logos.js +17 -0
  81. package/dist/cjs/uikit/MessageInput.js +29 -0
  82. package/dist/cjs/uikit/Overlay.js +12 -0
  83. package/dist/cjs/uikit/Pager.js +12 -0
  84. package/dist/cjs/uikit/Progress.js +20 -0
  85. package/dist/cjs/uikit/RadioButton.js +25 -0
  86. package/dist/cjs/uikit/RadioButtonList.js +26 -0
  87. package/dist/cjs/uikit/Slider.js +13 -0
  88. package/dist/cjs/uikit/Spacer.js +10 -0
  89. package/dist/cjs/uikit/Switch.js +12 -0
  90. package/dist/cjs/uikit/TabBar.js +25 -0
  91. package/dist/cjs/uikit/TextArea.js +26 -0
  92. package/dist/cjs/uikit/Textfield.js +27 -0
  93. package/dist/cjs/uikit/Tip.js +13 -0
  94. package/dist/cjs/uikit/Toast.js +25 -0
  95. package/dist/cjs/uikit/UIButton.js +25 -0
  96. package/dist/cjs/uikit/UIButtonBar.js +25 -0
  97. package/dist/cjs/uikit/UICard.js +20 -0
  98. package/dist/cjs/uikit/UIChip.js +21 -0
  99. package/dist/cjs/uikit/UIFileIcon.js +17 -0
  100. package/dist/cjs/uikit/UILabel.js +18 -0
  101. package/dist/esm/chunks/Avatar-D_muqPrW.js +66 -0
  102. package/dist/esm/chunks/AvatarGroup-D8Xmrn52.js +37 -0
  103. package/dist/esm/chunks/Badge-PPf5Uvw3.js +39 -0
  104. package/dist/esm/chunks/CheckBox-CswFI0Xc.js +74 -0
  105. package/dist/esm/chunks/DivInput-iKFkeU2F.js +202 -0
  106. package/dist/esm/chunks/DocIcons-CbOX4n8Y.js +39 -0
  107. package/dist/esm/chunks/Dot-B84UVs2e.js +78 -0
  108. package/dist/esm/chunks/DrggablePanel-CYYwTmFd.js +300 -0
  109. package/dist/esm/chunks/DropDown-D4t6EhKL.js +152 -0
  110. package/dist/esm/chunks/EditorButtonBar-FnMa8Zv2.js +242 -0
  111. package/dist/esm/chunks/ErrorSummary-DhU5SKPt.js +40 -0
  112. package/dist/esm/chunks/FlexDiv-CmMpORgn.js +101 -0
  113. package/dist/esm/chunks/Grouper-BbreOXI9.js +48 -0
  114. package/dist/esm/chunks/IconButton-CguHGkBM.js +82 -0
  115. package/dist/esm/chunks/Logos-DwZP-TR2.js +117 -0
  116. package/dist/esm/chunks/MessageInput-DMHzCwjO.js +397 -0
  117. package/dist/esm/chunks/Overlay-CCBy7n7H.js +43 -0
  118. package/dist/esm/chunks/Pager-BsSti93V.js +40 -0
  119. package/dist/esm/chunks/ProgressIndicator-BVukxMU6.js +118 -0
  120. package/dist/esm/chunks/RadioButton-B5BxQI0R.js +63 -0
  121. package/dist/esm/chunks/RadioButtonList-C2z8McAD.js +114 -0
  122. package/dist/esm/chunks/Slider-C-PcWqTz.js +283 -0
  123. package/dist/esm/chunks/Spacer-DbZSG5x3.js +14 -0
  124. package/dist/esm/chunks/Switch-DjfrSiQz.js +41 -0
  125. package/dist/esm/chunks/TabBar-BSBcgTbd.js +174 -0
  126. package/dist/esm/chunks/TextArea-COM0UPo2.js +151 -0
  127. package/dist/esm/chunks/TextField-Bh24bRWs.js +246 -0
  128. package/dist/esm/chunks/Tip-Ct19Ljul.js +89 -0
  129. package/dist/esm/chunks/Toast-BR0oMX6z.js +139 -0
  130. package/dist/esm/chunks/UIButton-DKx-_O8h.js +315 -0
  131. package/dist/esm/chunks/UIButtonBar-BNdA5eVq.js +56 -0
  132. package/dist/esm/chunks/UICard-Dn5f3wg8.js +34 -0
  133. package/dist/esm/chunks/UIChip-DqnGeVyR.js +91 -0
  134. package/dist/esm/chunks/UIFileIcon-qGxIPsJJ.js +52 -0
  135. package/dist/esm/chunks/UILabel-RnbodPCS.js +114 -0
  136. package/dist/esm/chunks/_types-BaYeLEWK.js +712 -0
  137. package/dist/esm/chunks/sharedTypes-BfZzG1KX.js +9 -0
  138. package/dist/esm/chunks/style-inject.es-tgCJW-Cu.js +28 -0
  139. package/dist/esm/chunks/tipStore-nBYJ6tmE.js +17 -0
  140. package/dist/esm/chunks/toastStore-r3pvNa28.js +17 -0
  141. package/dist/esm/chunks/tslib.es6-0pkUdtrF.js +45 -0
  142. package/dist/esm/chunks/utils-BRZK2Drn.js +119 -0
  143. package/dist/esm/hooks/useDoubleClick.js +24 -0
  144. package/dist/esm/hooks/useKeyboardShortcuts.js +40 -0
  145. package/dist/esm/hooks/useLastUpdated.js +51 -0
  146. package/dist/esm/hooks/useLocalStore.js +50 -0
  147. package/dist/esm/hooks/useObserveResize.js +54 -0
  148. package/dist/esm/hooks/useObserveTheme.js +34 -0
  149. package/dist/esm/hooks/useTheme.js +83 -0
  150. package/dist/esm/hooks/useToolTip.js +34 -0
  151. package/dist/esm/hooks/useTrackRenders.js +36 -0
  152. package/dist/esm/hooks/useWindow.js +62 -0
  153. package/dist/esm/hooks.js +14 -0
  154. package/dist/esm/index.js +57 -0
  155. package/dist/esm/providers/ThemeProvider.js +49 -0
  156. package/dist/esm/providers.js +7 -0
  157. package/dist/esm/stores/tip.js +2 -0
  158. package/dist/esm/stores/toast.js +2 -0
  159. package/dist/esm/stores.js +3 -0
  160. package/dist/esm/theme/colors.js +377 -0
  161. package/dist/esm/theme/corners.js +12 -0
  162. package/dist/esm/theme/themes.js +20 -0
  163. package/dist/esm/theme/type.js +312 -0
  164. package/dist/esm/theme.js +4 -0
  165. package/dist/esm/uikit/Avatar.js +5 -0
  166. package/dist/esm/uikit/AvatarGroup.js +6 -0
  167. package/dist/esm/uikit/Badge.js +5 -0
  168. package/dist/esm/uikit/CheckBox.js +15 -0
  169. package/dist/esm/uikit/DivInput.js +7 -0
  170. package/dist/esm/uikit/DocIcon.js +11 -0
  171. package/dist/esm/uikit/Dot.js +6 -0
  172. package/dist/esm/uikit/DraggablePanel.js +14 -0
  173. package/dist/esm/uikit/DropDown.js +14 -0
  174. package/dist/esm/uikit/EditorButtonBar.js +21 -0
  175. package/dist/esm/uikit/ErrorSummary.js +6 -0
  176. package/dist/esm/uikit/FlexDiv.js +6 -0
  177. package/dist/esm/uikit/Grouper.js +16 -0
  178. package/dist/esm/uikit/Icon.js +12 -0
  179. package/dist/esm/uikit/IconButton.js +18 -0
  180. package/dist/esm/uikit/Logos.js +11 -0
  181. package/dist/esm/uikit/MessageInput.js +23 -0
  182. package/dist/esm/uikit/Overlay.js +6 -0
  183. package/dist/esm/uikit/Pager.js +6 -0
  184. package/dist/esm/uikit/Progress.js +13 -0
  185. package/dist/esm/uikit/RadioButton.js +19 -0
  186. package/dist/esm/uikit/RadioButtonList.js +20 -0
  187. package/dist/esm/uikit/Slider.js +7 -0
  188. package/dist/esm/uikit/Spacer.js +4 -0
  189. package/dist/esm/uikit/Switch.js +6 -0
  190. package/dist/esm/uikit/TabBar.js +19 -0
  191. package/dist/esm/uikit/TextArea.js +20 -0
  192. package/dist/esm/uikit/Textfield.js +21 -0
  193. package/dist/esm/uikit/Tip.js +7 -0
  194. package/dist/esm/uikit/Toast.js +15 -0
  195. package/dist/esm/uikit/UIButton.js +19 -0
  196. package/dist/esm/uikit/UIButtonBar.js +19 -0
  197. package/dist/esm/uikit/UICard.js +14 -0
  198. package/dist/esm/uikit/UIChip.js +15 -0
  199. package/dist/esm/uikit/UIFileIcon.js +11 -0
  200. package/dist/esm/uikit/UILabel.js +12 -0
  201. package/dist/types/hooks/index.d.ts +9 -2
  202. package/dist/types/hooks/useDoubleClick/useDoubleClick.d.ts +1 -0
  203. package/dist/types/hooks/useKeyboardShortcuts/useKeyboardShortcuts.d.ts +6 -0
  204. package/dist/types/hooks/useLastUpdated/useLastUpdated.d.ts +4 -0
  205. package/dist/types/hooks/useLocalStore/useLocalStore.d.ts +1 -0
  206. package/dist/types/hooks/{useObserveResize.d.ts → useObserveResize/useObserveResize.d.ts} +1 -1
  207. package/dist/types/hooks/useObserveTheme/useObserveTheme.d.ts +2 -0
  208. package/dist/types/hooks/useTheme/useTheme.d.ts +47 -0
  209. package/dist/types/hooks/useToolTip/useToolTip.d.ts +6 -0
  210. package/dist/types/hooks/useWindow/useWindow.d.ts +15 -0
  211. package/dist/types/index.d.ts +9 -4
  212. package/dist/types/providers/ThemeProvider.d.ts +1 -0
  213. package/dist/types/stores/index.d.ts +2 -0
  214. package/dist/types/stores/tip/_types.d.ts +8 -0
  215. package/dist/types/stores/tip/index.d.ts +2 -0
  216. package/dist/types/stores/tip/tipStore.d.ts +12 -0
  217. package/dist/types/stores/toast/_types.d.ts +14 -0
  218. package/dist/types/stores/toast/index.d.ts +2 -0
  219. package/dist/types/stores/toast/toastStore.d.ts +12 -0
  220. package/dist/types/theme/colors/colors.d.ts +2 -0
  221. package/dist/types/theme/colors/types.d.ts +14 -0
  222. package/dist/types/theme/components/BrandColors.d.ts +1 -0
  223. package/dist/types/theme/components/ColorTile.d.ts +6 -0
  224. package/dist/types/theme/components/ColorTileGroup.d.ts +6 -0
  225. package/dist/types/theme/components/ThemeColors.d.ts +2 -0
  226. package/dist/types/theme/components/_types.d.ts +15 -0
  227. package/dist/types/theme/index.d.ts +1 -1
  228. package/dist/types/theme/themes.d.ts +3 -3
  229. package/dist/types/theme/type/type.d.ts +3 -0
  230. package/dist/types/uikit/Avatar/_types.d.ts +3 -2
  231. package/dist/types/uikit/AvatarGroup/_types.d.ts +4 -2
  232. package/dist/types/uikit/Badge/_types.d.ts +5 -2
  233. package/dist/types/uikit/CheckBox/_types.d.ts +5 -2
  234. package/dist/types/uikit/DivInput/_types.d.ts +4 -2
  235. package/dist/types/uikit/DocIcon/_types.d.ts +5 -2
  236. package/dist/types/uikit/Dot/_types.d.ts +6 -2
  237. package/dist/types/uikit/DraggablePanel/DrggablePanel.d.ts +3 -2
  238. package/dist/types/uikit/DropDown/DropDown.d.ts +2 -1
  239. package/dist/types/uikit/DropDown/_types.d.ts +5 -2
  240. package/dist/types/uikit/EditorButtonBar/_types.d.ts +4 -2
  241. package/dist/types/uikit/ErrorSummary/ErrorSummary.d.ts +2 -1
  242. package/dist/types/uikit/ErrorSummary/_types.d.ts +5 -2
  243. package/dist/types/uikit/FlexDiv/FlexDiv.d.ts +59 -2
  244. package/dist/types/uikit/FlexDiv/_types.d.ts +8 -2
  245. package/dist/types/uikit/Grouper/_types.d.ts +6 -2
  246. package/dist/types/uikit/Icon/_types.d.ts +7 -2
  247. package/dist/types/uikit/Icon/iconRegistry.d.ts +1 -0
  248. package/dist/types/uikit/IconButton/_types.d.ts +4 -2
  249. package/dist/types/uikit/Logos/_types.d.ts +8 -4
  250. package/dist/types/uikit/MessageInput/InputField/_types.d.ts +5 -2
  251. package/dist/types/uikit/Overlay/_types.d.ts +5 -2
  252. package/dist/types/uikit/Pager/_types.d.ts +5 -2
  253. package/dist/types/uikit/Progress/DoneCheck/_types.d.ts +5 -2
  254. package/dist/types/uikit/Progress/ProgressIndicator/_types.d.ts +5 -2
  255. package/dist/types/uikit/RadioButton/_types.d.ts +5 -2
  256. package/dist/types/uikit/RadioButtonList/_types.d.ts +5 -2
  257. package/dist/types/uikit/Slider/_types.d.ts +5 -2
  258. package/dist/types/uikit/Spacer/_types.d.ts +5 -2
  259. package/dist/types/uikit/Switch/Switch.d.ts +1 -1
  260. package/dist/types/uikit/Switch/_types.d.ts +5 -4
  261. package/dist/types/uikit/TabBar/_types.d.ts +5 -2
  262. package/dist/types/uikit/TextArea/_types.d.ts +5 -2
  263. package/dist/types/uikit/Textfield/_types.d.ts +4 -2
  264. package/dist/types/uikit/Tip/Tip.d.ts +3 -0
  265. package/dist/types/uikit/Tip/_types.d.ts +28 -0
  266. package/dist/types/uikit/Tip/index.d.ts +2 -0
  267. package/dist/types/uikit/Toast/Toast.d.ts +3 -0
  268. package/dist/types/uikit/Toast/_types.d.ts +24 -0
  269. package/dist/types/uikit/Toast/index.d.ts +2 -0
  270. package/dist/types/uikit/UIButton/UIButton.d.ts +73 -2
  271. package/dist/types/uikit/UIButton/_types.d.ts +4 -2
  272. package/dist/types/uikit/UIButtonBar/_types.d.ts +5 -2
  273. package/dist/types/uikit/UICard/_types.d.ts +5 -2
  274. package/dist/types/uikit/UIChip/_types.d.ts +4 -2
  275. package/dist/types/uikit/UIFileIcon/UIFileIcon.d.ts +1 -1
  276. package/dist/types/uikit/UIFileIcon/_types.d.ts +4 -2
  277. package/dist/types/uikit/UILabel/_types.d.ts +4 -2
  278. package/dist/types/util/utils.d.ts +12 -0
  279. package/package.json +80 -5
  280. package/dist/colors.css +0 -237
  281. package/dist/index.esm.js +0 -4831
  282. package/dist/index.esm.js.map +0 -1
  283. package/dist/index.js +0 -4873
  284. package/dist/index.js.map +0 -1
  285. package/dist/type.css +0 -16
  286. package/dist/types/hooks/useMayaTheme.d.ts +0 -7
  287. package/dist/types/hooks/useTheme.d.ts +0 -2
  288. package/dist/types/uikit/Avatar/AvatarInline.stories.d.ts +0 -7
  289. /package/dist/{flexBox.module.css → css/flexBox.module.css} +0 -0
  290. /package/dist/{type.module.css → css/type.module.css} +0 -0
  291. /package/dist/types/hooks/{useTrackRenders.d.ts → useTrackRenders/useTrackRenders.d.ts} +0 -0
@@ -0,0 +1,315 @@
1
+ import { _ as __rest } from './tslib.es6-0pkUdtrF.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { motion } from 'motion/react';
4
+ import React, { forwardRef, useState, useRef, useCallback, useEffect, useImperativeHandle, useMemo } from 'react';
5
+ import { useTheme } from '../hooks/useTheme.js';
6
+ import '../theme/colors.js';
7
+ import '../hooks/useWindow.js';
8
+ import { B as Badge } from './Badge-PPf5Uvw3.js';
9
+ import { D as Dot } from './Dot-B84UVs2e.js';
10
+ import { I as Icon } from './_types-BaYeLEWK.js';
11
+ import { P as ProgressIndicator } from './ProgressIndicator-BVukxMU6.js';
12
+ import { T as ToolTipType } from './sharedTypes-BfZzG1KX.js';
13
+ import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
14
+
15
+ var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.UIButton-module_button__nAcQH {\n\tposition: relative;\n\tuser-select: none;\n\tmin-width: var(--ui-button-min-width);\n\t-webkit-user-select: none;\n}\n\n.UIButton-module_label__q4X-J {\n\tuser-select: none;\n\t-webkit-user-select: none;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\twhite-space: nowrap;\n\tword-break: break-all;\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: 1;\n\t-webkit-box-orient: vertical;\n\t&:hover {\n\t\ttext-decoration: var(--ui-button-decoration);\n\t}\n}\n\n.UIButton-module_count__AvZ7Z {\n\tposition: absolute;\n\ttop: 0;\n\tright: 0;\n\ttransform: translateX(10px) translateY(-2px);\n}\n\n.UIButton-module_icon__An3R1 {\n\tmin-width: var(--ui-button-icon-size);\n\tmin-height: var(--ui-button-icon-size);\n\theight: var(--ui-button-icon-size);\n\twidth: var(--ui-button-icon-size);\n}\n\n.UIButton-module_m__6qPGY {\n}\n\n.UIButton-module_l__8Pu8o {\n}\n\n.UIButton-module_s__YShP1 {\n}\n";
16
+ var css = {"button":"UIButton-module_button__nAcQH flexBox-module_row__PWxbe","label":"UIButton-module_label__q4X-J","count":"UIButton-module_count__AvZ7Z flexBox-module_row__PWxbe","icon":"UIButton-module_icon__An3R1 flexBox-module_row__PWxbe","m":"UIButton-module_m__6qPGY type-module_body-m-regular__Qtp5G","l":"UIButton-module_l__8Pu8o type-module_body-l-regular__Ar4d3","s":"UIButton-module_s__YShP1 type-module_body-s-regular__8-FO-"};
17
+ styleInject(css_248z);
18
+
19
+ const UIButtonComponent = forwardRef((props, buttonRef) => {
20
+ const theme = useTheme();
21
+ const { size = 'medium', variant = 'outline', label = undefined, labelSize = 'm', iconRight = undefined, iconLeft = undefined, count = props.count === undefined ? undefined : Number(props.count), showDot = undefined, tooltip = undefined, round = false, state = 'normal', fill = false, iconSize = props.iconSize === undefined ? 20 : Number(props.iconSize), width = 'auto', underline = false, borderRadius = undefined, iconColor = undefined, bgColor = undefined, bgColorDisabled = undefined, labelColor = undefined, transition = undefined, variants = undefined, initial = undefined, animate = undefined, exit = undefined, paddingRight = undefined, paddingLeft = undefined, progress = false, working = false, duration = undefined, trigger = false, destructive = false, onClick = () => null, onToolTip = () => null } = props, divAttributes = __rest(props, ["size", "variant", "label", "labelSize", "iconRight", "iconLeft", "count", "showDot", "tooltip", "round", "state", "fill", "iconSize", "width", "underline", "borderRadius", "iconColor", "bgColor", "bgColorDisabled", "labelColor", "transition", "variants", "initial", "animate", "exit", "paddingRight", "paddingLeft", "progress", "working", "duration", "trigger", "destructive", "onClick", "onToolTip"]);
22
+ const { id: divId, className, style } = divAttributes, rest = __rest(divAttributes, ["id", "className", "style"]);
23
+ const divStyle = style !== null && style !== void 0 ? style : {};
24
+ const divClass = className ? ` ${className}` : '';
25
+ const [btnState, setBtnState] = useState(state);
26
+ const [btnWidth, setBtnWidth] = useState(undefined);
27
+ const [playing, setPlaying] = useState(working);
28
+ const ref = useRef(null);
29
+ const handleClick = useCallback((e) => {
30
+ onToolTip(null);
31
+ if (state === 'disabled')
32
+ return;
33
+ if (progress && duration) {
34
+ setPlaying(true);
35
+ }
36
+ else {
37
+ onClick(e);
38
+ }
39
+ }, [onToolTip, state, progress, duration, onClick]);
40
+ useEffect(() => setBtnState(state), [state]);
41
+ useEffect(() => setPlaying(working), [working]);
42
+ // memo button width - note the inclusion of unnecessary dependencies for story book purposes
43
+ // biome-ignore lint/correctness/useExhaustiveDependencies: avoid expensive observers
44
+ useEffect(() => {
45
+ if (!variant || !size || !labelSize)
46
+ return;
47
+ if (ref === null || ref === void 0 ? void 0 : ref.current)
48
+ setBtnWidth(ref.current.offsetWidth);
49
+ else
50
+ setBtnWidth(width);
51
+ }, [width, variant, labelSize, size, iconLeft, iconRight]);
52
+ useImperativeHandle(buttonRef, () => ({
53
+ triggerClick: () => handleClick(undefined),
54
+ }));
55
+ useEffect(() => {
56
+ if (trigger)
57
+ handleClick(undefined);
58
+ }, [trigger, handleClick]);
59
+ // memo destructive check
60
+ const destructiveColor = useCallback((icon) => {
61
+ if (icon && variant === 'solid') {
62
+ return theme.current.colors['core-text-light'];
63
+ }
64
+ if (destructive)
65
+ return theme.current.colors['feedback-warning'];
66
+ return theme.current.colors['core-text-primary'];
67
+ }, [destructive, theme, variant]);
68
+ // memo solid styles
69
+ const solid = useMemo(() => {
70
+ return {
71
+ border: '0px',
72
+ iconColor: {
73
+ normal: iconColor || destructiveColor(true),
74
+ hover: iconColor || destructiveColor(true),
75
+ disabled: iconColor || destructiveColor(true),
76
+ },
77
+ background: {
78
+ normal: bgColor ||
79
+ (destructive
80
+ ? 'var(--feedback-warning)'
81
+ : 'var(--core-button-primary)'),
82
+ hover: bgColor ||
83
+ (destructive
84
+ ? 'var(--feedback-warning)'
85
+ : 'var(--core-button-primary)'),
86
+ disabled: bgColorDisabled || 'var(--core-button-disabled)',
87
+ },
88
+ borderColor: {
89
+ normal: 'transparent',
90
+ hover: 'transparent',
91
+ disabled: 'transparent',
92
+ },
93
+ color: {
94
+ normal: labelColor || (destructive ? 'white' : 'var(--core-text-light)'),
95
+ hover: labelColor || (destructive ? 'white' : 'var(--core-text-light)'),
96
+ disabled: 'var(--core-text-disabled)',
97
+ },
98
+ };
99
+ }, [
100
+ labelColor,
101
+ destructive,
102
+ destructiveColor,
103
+ bgColor,
104
+ bgColorDisabled,
105
+ iconColor,
106
+ ]);
107
+ // memo outline styles
108
+ const outline = useMemo(() => {
109
+ return {
110
+ border: '1px',
111
+ iconColor: {
112
+ normal: iconColor || destructiveColor(true),
113
+ hover: iconColor || destructiveColor(true),
114
+ disabled: iconColor || 'var(--core-text-disabled)',
115
+ },
116
+ background: {
117
+ normal: bgColor || 'var(--core-surface-primary)',
118
+ hover: bgColor || 'var(--core-surface-primary)',
119
+ disabled: bgColorDisabled || 'var(--core-surface-primary)',
120
+ },
121
+ borderColor: {
122
+ normal: destructive
123
+ ? 'var(--feedback-warning)'
124
+ : 'var(--core-outline-primary)',
125
+ hover: destructive
126
+ ? 'var(--feedback-warning)'
127
+ : 'var(--core-outline-primary)',
128
+ disabled: 'var(--core-outline-primary)',
129
+ },
130
+ color: {
131
+ normal: labelColor ||
132
+ (destructive
133
+ ? 'var(--feedback-warning)'
134
+ : 'var(--core-text-primary)'),
135
+ hover: labelColor ||
136
+ (destructive
137
+ ? 'var(--feedback-warning)'
138
+ : 'var(--core-text-special)'),
139
+ disabled: 'var(--core-text-disabled)',
140
+ },
141
+ };
142
+ }, [
143
+ iconColor,
144
+ destructive,
145
+ bgColor,
146
+ bgColorDisabled,
147
+ labelColor,
148
+ destructiveColor,
149
+ ]);
150
+ // memo text styles
151
+ const text = useMemo(() => {
152
+ return {
153
+ border: '1px',
154
+ iconColor: {
155
+ normal: destructiveColor(true),
156
+ hover: destructiveColor(true),
157
+ disabled: 'var(--core-text-disabled)',
158
+ },
159
+ background: {
160
+ normal: 'transparent',
161
+ hover: 'transparent',
162
+ disabled: 'transparent',
163
+ },
164
+ borderColor: {
165
+ normal: 'transparent',
166
+ hover: 'transparent',
167
+ disabled: 'transparent',
168
+ },
169
+ color: {
170
+ normal: labelColor || destructiveColor(false),
171
+ hover: labelColor || destructiveColor(false),
172
+ disabled: 'var(--core-text-disabled)',
173
+ },
174
+ };
175
+ }, [destructiveColor, labelColor]);
176
+ // memo color styles
177
+ const colorStyles = useMemo(() => {
178
+ return {
179
+ solid,
180
+ outline,
181
+ text,
182
+ };
183
+ }, [solid, outline, text]);
184
+ // Memoize sizing styles
185
+ const setPadding = useCallback((side) => {
186
+ if (round)
187
+ return 0;
188
+ if (side === 'left' && iconLeft)
189
+ return 20;
190
+ if (side === 'right' && iconRight)
191
+ return 20;
192
+ return 24;
193
+ }, [round, iconLeft, iconRight]);
194
+ const sizingStyles = useMemo(() => {
195
+ return {
196
+ large: {
197
+ height: 48,
198
+ gap: 8,
199
+ iconSize,
200
+ paddingLeft: setPadding('left'),
201
+ paddingRight: setPadding('right'),
202
+ width: round ? '48px' : btnWidth || 'auto',
203
+ borderRadius: borderRadius !== null && borderRadius !== void 0 ? borderRadius : '500px',
204
+ },
205
+ medium: {
206
+ height: 36,
207
+ gap: 8,
208
+ iconSize,
209
+ paddingLeft: setPadding('left'),
210
+ paddingRight: setPadding('right'),
211
+ width: round ? '36px' : btnWidth || 'auto',
212
+ borderRadius: borderRadius !== null && borderRadius !== void 0 ? borderRadius : '500px',
213
+ },
214
+ text: {
215
+ height: 20,
216
+ gap: 8,
217
+ iconSize,
218
+ paddingLeft: 0,
219
+ paddingRight: 0,
220
+ btnWidth,
221
+ borderRadius: 0,
222
+ },
223
+ };
224
+ }, [iconSize, btnWidth, round, borderRadius, setPadding]);
225
+ // Memoize handleMouseEnter
226
+ const handleMouseEnter = useCallback((e) => {
227
+ if (btnState !== 'disabled')
228
+ setBtnState('hover');
229
+ if (!(ref === null || ref === void 0 ? void 0 : ref.current) || !tooltip)
230
+ return;
231
+ const tip = {
232
+ type: ToolTipType.button,
233
+ payload: { label: tooltip },
234
+ event: e,
235
+ ref,
236
+ };
237
+ onToolTip(tip);
238
+ }, [btnState, tooltip, onToolTip]);
239
+ // Memoize handleMouseLeave
240
+ const handleMouseLeave = useCallback(() => {
241
+ if (btnState !== 'disabled')
242
+ setBtnState('normal');
243
+ if (tooltip)
244
+ onToolTip(null);
245
+ }, [btnState, tooltip, onToolTip]);
246
+ // Memoize handleDidStop
247
+ const handleDidStop = useCallback(() => {
248
+ setPlaying(false);
249
+ onClick(undefined);
250
+ }, [onClick]);
251
+ // Memoize showLabel
252
+ const shouldShowLabel = useMemo(() => !(playing && !iconLeft && !iconRight) && Boolean(label), [playing, iconLeft, iconRight, label]);
253
+ // Memoize button styles
254
+ const buttonStyle = useMemo(() => ({
255
+ color: colorStyles[variant].color[btnState],
256
+ background: fill
257
+ ? theme.current.colors['core-surface-primary']
258
+ : colorStyles[variant].background[state],
259
+ paddingRight: paddingRight !== null && paddingRight !== void 0 ? paddingRight : sizingStyles[size].paddingRight,
260
+ paddingLeft: paddingLeft !== null && paddingLeft !== void 0 ? paddingLeft : sizingStyles[size].paddingLeft,
261
+ borderRadius: sizingStyles[size].borderRadius,
262
+ height: sizingStyles[size].height,
263
+ maxHeight: sizingStyles[size].height,
264
+ minHeight: sizingStyles[size].height,
265
+ flex: width === 'fill' ? 1 : 'unset',
266
+ gap: sizingStyles[size].gap,
267
+ borderWidth: colorStyles[variant].border,
268
+ borderStyle: 'solid',
269
+ borderColor: colorStyles[variant].borderColor[btnState],
270
+ cursor: state === 'disabled' ? 'default' : 'pointer',
271
+ transition: 'all 0s ease-in-out 0s',
272
+ }), [
273
+ colorStyles,
274
+ variant,
275
+ btnState,
276
+ fill,
277
+ theme,
278
+ state,
279
+ paddingRight,
280
+ paddingLeft,
281
+ sizingStyles,
282
+ size,
283
+ width,
284
+ ]);
285
+ // memo icon stroke color
286
+ const iconStrokeColor = useMemo(() => colorStyles[variant].iconColor[state], [colorStyles, variant, state]);
287
+ // memo progress color
288
+ const progressColor = useMemo(() => destructive
289
+ ? theme.current.colors['feedback-warning']
290
+ : colorStyles[variant].color[btnState], [destructive, theme, colorStyles, variant, btnState]);
291
+ const setStyle = useCallback((value) => {
292
+ if (value === undefined)
293
+ return 'unset';
294
+ if (typeof value === 'number')
295
+ return `${value}px`;
296
+ return value;
297
+ }, []);
298
+ const iconDivSize = useMemo(() => {
299
+ if (round)
300
+ return `${buttonStyle.minHeight}px`;
301
+ return iconSize ? setStyle(iconSize) : 'unset';
302
+ }, [round, iconSize, buttonStyle, setStyle]);
303
+ const cssVars = useMemo(() => {
304
+ return {
305
+ '--ui-button-decoration': underline ? 'underline' : 'unset',
306
+ '--ui-button-min-width': btnWidth ? setStyle(btnWidth) : 'unset',
307
+ '--ui-button-icon-size': iconDivSize,
308
+ };
309
+ }, [underline, btnWidth, setStyle, iconDivSize]);
310
+ return (jsxs(motion.div, Object.assign({ id: divId, className: `${css.button}${divClass}`, ref: ref, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: Object.assign(Object.assign(Object.assign({}, divStyle), buttonStyle), cssVars), transition: transition, variants: variants, initial: initial, animate: animate, exit: exit, onClick: handleClick }, rest, { children: [!playing && iconLeft && (jsx("div", { className: css.icon, children: jsx(Icon, { name: iconLeft, size: sizingStyles[size].iconSize, strokeColor: iconStrokeColor, pointer: state !== 'disabled' }) })), playing && iconLeft && (jsx(ProgressIndicator, { show: playing, didStop: handleDidStop, duration: duration, size: sizingStyles[size].iconSize, color: progressColor, inline: true })), playing && !iconLeft && !iconRight && (jsx(ProgressIndicator, { show: playing, didStop: handleDidStop, duration: duration, size: sizingStyles[size].iconSize, color: progressColor, inline: false })), shouldShowLabel && (jsx("div", { className: `${css.label} ${css[labelSize]}`, children: label })), playing && iconRight && (jsx(ProgressIndicator, { show: playing, didStop: handleDidStop, duration: duration, size: sizingStyles[size].iconSize, color: progressColor, inline: true })), !playing && iconRight && (jsx("div", { className: css.icon, children: jsx(Icon, { name: iconRight, size: sizingStyles[size].iconSize, strokeColor: iconStrokeColor, pointer: state !== 'disabled' }) })), jsx(Dot, { show: !playing && showDot }), !playing && count && (jsx("div", { className: css.count, children: jsx(Badge, { variant: 'light', count: Number(count) }) }))] })));
311
+ });
312
+ UIButtonComponent.displayName = 'UIButton';
313
+ const UIButton = React.memo(UIButtonComponent);
314
+
315
+ export { UIButton as U };
@@ -0,0 +1,56 @@
1
+ import { _ as __rest } from './tslib.es6-0pkUdtrF.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { useState, useEffect, useCallback } from 'react';
4
+ import { useTheme } from '../hooks/useTheme.js';
5
+ import '../theme/colors.js';
6
+ import '../hooks/useWindow.js';
7
+ import { I as IconButton } from './IconButton-CguHGkBM.js';
8
+ import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
9
+
10
+ var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.UIButtonBar-module_wrapper__8z-P8 {\n}\n\n.UIButtonBar-module_label__w6ru4 {\n\tcolor: var(--core-text-disabled);\n\tpadding-right: 4px;\n}\n\n.UIButtonBar-module_button__CeXO1 {\n\theight: 32px;\n\tgap: 0;\n\tcursor: pointer;\n\tbackground: var(--core-surface-primary);\n\tcolor: var(--core-text-disabled);\n\t&:last-child {\n\t\t&:hover {\n\t\t\tbackground: var(--core-surface-primary);\n\t\t}\n\t}\n\t&:first-child {\n\t\t&:hover {\n\t\t\tbackground: var(--core-surface-primary);\n\t\t}\n\t}\n\t&:hover {\n\t\tbackground: var(--core-surface-primary);\n\t\tcolor: var(--core-text-primary);\n\t}\n}\n\n.UIButtonBar-module_selected__I7geu {\n\tbackground: var(--core-surface-primary);\n\tcolor: var(--core-link-primary);\n}\n\n.UIButtonBar-module_divider__E03Ym {\n\tdisplay: block;\n\tbackground: var(--core-outline-primary);\n\twidth: 1px;\n\theight: 16px;\n\tmargin: 0 4px;\n}\n\n.UIButtonBar-module_last__0vvyg {\n\tdisplay: none;\n}\n";
11
+ var css = {"wrapper":"UIButtonBar-module_wrapper__8z-P8 flexBox-module_rowStart__nJZnW","label":"UIButtonBar-module_label__w6ru4 flexBox-module_rowStart__nJZnW type-module_body-s-regular__8-FO-","button":"UIButtonBar-module_button__CeXO1 flexBox-module_rowStart__nJZnW","selected":"UIButtonBar-module_selected__I7geu","divider":"UIButtonBar-module_divider__E03Ym","last":"UIButtonBar-module_last__0vvyg"};
12
+ styleInject(css_248z);
13
+
14
+ function UIButtonBar(props) {
15
+ const { options = [], current = 0, label, onChange = () => null, onToolTip = () => null } = props, divAttributes = __rest(props, ["options", "current", "label", "onChange", "onToolTip"]);
16
+ const { id: divId, className, style } = divAttributes, rest = __rest(divAttributes, ["id", "className", "style"]);
17
+ const divStyle = style !== null && style !== void 0 ? style : {};
18
+ const divClass = className ? ` ${className}` : '';
19
+ const theme = useTheme();
20
+ const [hovered, setHovered] = useState(-1);
21
+ const [currentPage, setCurrentPage] = useState(current);
22
+ useEffect(() => setCurrentPage(current), [current]);
23
+ const handleMouseEnter = useCallback((index) => {
24
+ setHovered(index);
25
+ }, []);
26
+ const handleMouseLeave = useCallback(() => {
27
+ setHovered(-1);
28
+ }, []);
29
+ const handleClick = useCallback((button, index) => {
30
+ setCurrentPage(index);
31
+ onChange(button);
32
+ }, [onChange]);
33
+ // memo display
34
+ const display = useCallback((index) => {
35
+ return index === options.length - 1 ? css.last : '';
36
+ }, [options.length]);
37
+ // memo selected
38
+ const selected = useCallback((index) => {
39
+ return currentPage === index ? css.selected : '';
40
+ }, [currentPage]);
41
+ // memo icon stroke color
42
+ const iconColor = useCallback((index) => {
43
+ const isSelected = currentPage === index;
44
+ const isHovered = hovered === index;
45
+ if (isSelected)
46
+ return theme.current.colors['core-icon-primary'];
47
+ if (isHovered)
48
+ return theme.current.colors['core-button-primary'];
49
+ return theme.current.colors['core-text-disabled'];
50
+ }, [currentPage, hovered, theme]);
51
+ return (jsxs("div", Object.assign({ id: divId, className: `${css.wrapper}${divClass}`, style: divStyle }, rest, { children: [label && jsx("div", { className: css.label, children: label }), options === null || options === void 0 ? void 0 : options.map((button, index) => {
52
+ return (jsxs("div", { className: css.button, onMouseEnter: () => handleMouseEnter(index), onMouseLeave: () => handleMouseLeave(), children: [jsx("div", { className: selected(index), onClick: () => handleClick(button, index), onKeyDown: () => handleClick(button, index), children: jsx(IconButton, { icon: button.icon, color: iconColor(index), label: button.label, tooltip: button.tip, onToolTip: onToolTip, hover: true, toggle: false }) }), jsx("div", { className: `${css.divider} ${display(index)}` })] }, `button-bar-${button.icon}-${index}`));
53
+ })] })));
54
+ }
55
+
56
+ export { UIButtonBar as U };
@@ -0,0 +1,34 @@
1
+ import { _ as __rest } from './tslib.es6-0pkUdtrF.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import React, { useCallback, useMemo } from 'react';
4
+ import { I as Icon } from './_types-BaYeLEWK.js';
5
+ import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
6
+
7
+ var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.UICard-module_card__ENpS- {\n\tpadding: 8px 14px 8px 8px !important;\n\tcolor: var(--core-text-primary);\n\twidth: var(--card-width);\n\tmax-width: min-content;\n\tflex: var(--card-flex);\n\tgap: 8px;\n\tborder-radius: 8px;\n\tborder: 1px solid var(--core-outline-primary);\n\tcursor: pointer;\n\ttransition: all 0.25s ease-in-out 0s;\n\t&:hover {\n\t\tcolor: var(--core-button-primary);\n\t\tborder: 1px solid var(--core-button-primary);\n\t}\n}\n\n.UICard-module_icon__n4kmT {\n\tmin-width: 20px;\n\tmin-height: 20px;\n\tmax-width: 20px;\n\tmax-height: 20px;\n}\n\n.UICard-module_label__Ev9Fa {\n\tflex: 1;\n\tword-break: break-all;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\toverflow-wrap: anywhere;\n\tdisplay: -webkit-box;\n\twhite-space: nowrap;\n\t-webkit-line-clamp: 1;\n\t-webkit-box-orient: vertical;\n}\n";
8
+ var css = {"card":"UICard-module_card__ENpS- flexBox-module_rowStart__nJZnW type-module_body-m-regular__Qtp5G","icon":"UICard-module_icon__n4kmT flexBox-module_row__PWxbe","label":"UICard-module_label__Ev9Fa"};
9
+ styleInject(css_248z);
10
+
11
+ const UICard = React.memo(function UICard(props) {
12
+ const { id, icon, label, command, width, onCommand = () => null } = props, divAttributes = __rest(props, ["id", "icon", "label", "command", "width", "onCommand"]);
13
+ const { className, style } = divAttributes, rest = __rest(divAttributes, ["className", "style"]);
14
+ const divStyle = style !== null && style !== void 0 ? style : {};
15
+ const divClass = className ? ` ${className}` : '';
16
+ // set style value callback
17
+ const setStyle = useCallback((value) => {
18
+ if (value === undefined || value === 'fill')
19
+ return 'unset';
20
+ if (typeof value === 'string')
21
+ return value;
22
+ return `${value}px`;
23
+ }, []);
24
+ // memo css vars
25
+ const cssVars = useMemo(() => {
26
+ return {
27
+ '--card-width': setStyle(width),
28
+ '--card-flex': width === 'fill' ? '1' : 'unset',
29
+ };
30
+ }, [setStyle, width]);
31
+ return (jsxs("div", Object.assign({ id: id, className: `${css.card}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), onClick: () => onCommand({ id, command }), onKeyDown: () => onCommand({ id, command }) }, rest, { children: [icon && (jsx("div", { className: css.icon, children: jsx(Icon, { name: icon }) })), label && jsx("div", { className: css.label, children: label })] })));
32
+ });
33
+
34
+ export { UICard as U };
@@ -0,0 +1,91 @@
1
+ import { _ as __rest } from './tslib.es6-0pkUdtrF.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import React, { useState, useEffect, useCallback, useMemo } from 'react';
4
+ import { useTheme } from '../hooks/useTheme.js';
5
+ import '../theme/colors.js';
6
+ import '../hooks/useWindow.js';
7
+ import { I as Icon } from './_types-BaYeLEWK.js';
8
+ import { T as ToolTipType } from './sharedTypes-BfZzG1KX.js';
9
+ import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
10
+
11
+ var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.UIChip-module_chip__Mlm-E {\n\tpadding: var(--ui-chip-padding) !important;\n\twidth: min-content;\n\tmin-height: 30px;\n\tgap: var(--ui-chip-gap);\n\tbackground: var(--ui-chip-background);\n\tline-height: 1em;\n\tcolor: var(--ui-chip-color);\n\tborder: var(--ui-chip-border) solid var(--ui-chip-border-color);\n\tborder-radius: var(--ui-chip-border-radius);\n\ttransition: all 0.25s ease-in-out 0s;\n\tcursor: pointer;\n\twhite-space: nowrap;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.UIChip-module_icon__T3CKh {\n\theight: var(--ui-chip-icon-size);\n\tmin-height: var(--ui-chip-icon-size);\n\twidth: var(--ui-chip-icon-size);\n\tmin-width: var(--ui-chip-icon-size);\n}\n\n.UIChip-module_s__xUUaz {\n}\n\n.UIChip-module_m__mNHBQ {\n}\n\n.UIChip-module_l__DWRA6 {\n}\n";
12
+ var css = {"chip":"UIChip-module_chip__Mlm-E flexBox-module_row__PWxbe","icon":"UIChip-module_icon__T3CKh flexBox-module_row__PWxbe","s":"UIChip-module_s__xUUaz type-module_body-s-regular__8-FO-","m":"UIChip-module_m__mNHBQ type-module_body-m-regular__Qtp5G","l":"UIChip-module_l__DWRA6 type-module_body-l-regular__Ar4d3"};
13
+ styleInject(css_248z);
14
+
15
+ const UIChip = React.memo((props) => {
16
+ const { label, icon, background, disabled = false, focused = false, variant = 'regular', unframed = false, iconRight = false, labelSize = 'm', tooltip, iconColor, onToolTip = () => null, onClick = () => null, onMouseDown = () => null } = props, divAttributes = __rest(props, ["label", "icon", "background", "disabled", "focused", "variant", "unframed", "iconRight", "labelSize", "tooltip", "iconColor", "onToolTip", "onClick", "onMouseDown"]);
17
+ const { id: divId, className, style } = divAttributes, rest = __rest(divAttributes, ["id", "className", "style"]);
18
+ const divStyle = style !== null && style !== void 0 ? style : {};
19
+ const divClass = className ? ` ${className}` : '';
20
+ const theme = useTheme();
21
+ const [isFocused, setIsFocused] = useState(focused);
22
+ const [isHovered, setIsHovered] = useState(false);
23
+ useEffect(() => setIsFocused(focused), [focused]);
24
+ // click handler
25
+ const handleClick = useCallback((e) => {
26
+ if (!disabled)
27
+ onClick(e);
28
+ }, [disabled, onClick]);
29
+ // handle mouse down
30
+ const handleMouseDown = useCallback((e) => {
31
+ if (!disabled)
32
+ onMouseDown(e);
33
+ }, [disabled, onMouseDown]);
34
+ // handle mouse enter / leave
35
+ const handleMouseEnter = useCallback((enter, event) => {
36
+ if (enter) {
37
+ if (tooltip) {
38
+ const tip = {
39
+ type: ToolTipType.button,
40
+ payload: { label: tooltip },
41
+ ref: null,
42
+ event,
43
+ };
44
+ onToolTip(tip);
45
+ }
46
+ setIsHovered(true);
47
+ }
48
+ else {
49
+ onToolTip(null);
50
+ setIsHovered(false);
51
+ }
52
+ }, [tooltip, onToolTip]);
53
+ // memo padding
54
+ const padding = useMemo(() => {
55
+ const isSmall = variant === 'small';
56
+ if (!icon) {
57
+ return isSmall ? '6px' : '9px 16px 9px 16px';
58
+ }
59
+ if (icon && iconRight) {
60
+ return isSmall ? '6px 6px 6px 10px' : '9px 12px 9px 16px';
61
+ }
62
+ return isSmall ? '6px 10px 6px 6px' : '9px 16px 9px 12px';
63
+ }, [variant, icon, iconRight]);
64
+ // memo icon color
65
+ const computedIconColor = useMemo(() => {
66
+ if (iconColor)
67
+ return iconColor;
68
+ if (disabled)
69
+ return theme.current.colors['core-icon-disabled'];
70
+ if (isHovered)
71
+ return theme.current.colors['core-link-primary'];
72
+ if (isFocused)
73
+ return theme.current.colors['core-link-primary'];
74
+ return theme.current.colors['core-text-primary'];
75
+ }, [iconColor, disabled, isFocused, isHovered, theme]);
76
+ // memo css vars
77
+ const cssVars = useMemo(() => {
78
+ return {
79
+ '--ui-chip-padding': padding,
80
+ '--ui-chip-background': background || 'transparent',
81
+ '--ui-chip-gap': variant === 'small' ? '4px' : '8px',
82
+ '--ui-chip-color': computedIconColor,
83
+ '--ui-chip-border-radius': variant === 'small' ? '4px' : '8px',
84
+ '--ui-chip-border': unframed ? '0' : '1px',
85
+ '--ui-chip-border-color': unframed ? 'transparent' : computedIconColor,
86
+ };
87
+ }, [padding, background, variant, unframed, computedIconColor]);
88
+ return (jsxs("div", Object.assign({ id: divId, className: `${css.chip}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), onMouseDown: handleMouseDown, onKeyDown: () => null, onClick: handleClick, onMouseEnter: (e) => handleMouseEnter(true, e), onMouseLeave: (e) => handleMouseEnter(false, e), onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false) }, rest, { children: [icon && !iconRight && (jsx("div", { className: css.icon, children: jsx(Icon, { name: icon, size: variant === 'regular' ? 20 : 16, strokeColor: computedIconColor }) })), jsx("div", { className: css[labelSize], children: label }), icon && iconRight && (jsx("div", { className: css.icon, children: jsx(Icon, { name: icon, size: variant === 'regular' ? 20 : 16, strokeColor: computedIconColor }) }))] })));
89
+ });
90
+
91
+ export { UIChip as U };
@@ -0,0 +1,52 @@
1
+ import { _ as __rest } from './tslib.es6-0pkUdtrF.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import React, { useCallback, useMemo } from 'react';
4
+ import { useTheme } from '../hooks/useTheme.js';
5
+ import '../theme/colors.js';
6
+ import '../hooks/useWindow.js';
7
+
8
+ const UIFileIcon = React.memo((props) => {
9
+ var _a, _b;
10
+ const { name = 'document', size = 20, pointer = false, disabled = false, onClick = () => null } = props, svgAttributes = __rest(props, ["name", "size", "pointer", "disabled", "onClick"]);
11
+ const { id: svgId, className, style } = svgAttributes, rest = __rest(svgAttributes, ["id", "className", "style"]);
12
+ const theme = useTheme();
13
+ const handleKeyDown = useCallback((e) => {
14
+ if (e.key === 'Enter' || e.key === ' ') {
15
+ e.preventDefault();
16
+ onClick(e);
17
+ }
18
+ }, [onClick]);
19
+ const FileIcon = useMemo(() => {
20
+ return [
21
+ {
22
+ name: 'pdf',
23
+ icon: (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", style: {
24
+ cursor: disabled ? 'default' : pointer ? 'pointer' : 'inherit',
25
+ }, onClick: (e) => onClick(e), onKeyDown: handleKeyDown, tabIndex: pointer ? 0 : -1, fill: "none", role: "img", "aria-label": "PDF document icon", children: [jsx("title", { children: "PDF document" }), jsx("path", { d: "M 4.5 19 L 15.5 19 C 16.328 19 17 18.328 17 17.5 L 17 5 L 14.5 5 C 13.672 5 13 4.328 13 3.5 L 13 1 L 4.5 1 C 3.672 1 3 1.672 3 2.5 L 3 17.5 C 3 18.328 3.672 19 4.5 19 Z", fill: "rgb(250,15,0)" }), jsx("path", { d: "M 5.516 9.416 L 7.237 9.416 C 7.485 9.416 7.7 9.464 7.884 9.56 C 8.068 9.654 8.21 9.788 8.309 9.96 C 8.409 10.133 8.458 10.334 8.458 10.563 C 8.458 10.79 8.408 10.99 8.309 11.164 C 8.209 11.338 8.067 11.474 7.882 11.572 C 7.682 11.673 7.461 11.723 7.237 11.718 L 6.502 11.718 L 6.502 13 L 5.516 13 Z M 7.069 10.932 C 7.175 10.937 7.278 10.902 7.359 10.834 C 7.432 10.764 7.471 10.665 7.467 10.564 C 7.467 10.446 7.431 10.357 7.359 10.294 C 7.277 10.229 7.174 10.196 7.069 10.202 L 6.502 10.202 L 6.502 10.932 Z M 8.836 9.416 L 10.248 9.416 C 10.618 9.416 10.941 9.489 11.214 9.636 C 11.489 9.781 11.701 9.988 11.849 10.258 C 11.997 10.527 12.071 10.843 12.071 11.208 C 12.071 11.573 11.997 11.89 11.849 12.16 C 11.704 12.426 11.483 12.643 11.214 12.783 C 10.915 12.934 10.583 13.008 10.248 13 L 8.836 13 Z M 10.223 12.214 C 10.389 12.214 10.533 12.174 10.653 12.097 C 10.778 12.013 10.875 11.894 10.931 11.755 C 11 11.581 11.034 11.395 11.029 11.208 C 11.034 11.022 11.001 10.837 10.931 10.664 C 10.875 10.524 10.778 10.403 10.653 10.319 C 10.524 10.239 10.375 10.198 10.223 10.202 L 9.823 10.202 L 9.823 12.214 Z M 12.53 9.416 L 15.182 9.416 L 15.182 10.202 L 13.517 10.202 L 13.517 10.759 L 14.715 10.759 L 14.715 11.545 L 13.517 11.545 L 13.517 13 L 12.53 13 Z", fill: theme.current.colors['core-icon-light'] }), jsx("path", { d: "M 13 1 L 15 3 L 17 5 L 14 5 C 13.448 5 13 4.552 13 4 Z", fill: theme.current.coreColors['brand-purple-300'] })] })),
26
+ },
27
+ {
28
+ name: 'spreadsheet',
29
+ icon: (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", style: {
30
+ cursor: disabled ? 'default' : pointer ? 'pointer' : 'inherit',
31
+ }, onClick: (e) => onClick(e), onKeyDown: handleKeyDown, tabIndex: pointer ? 0 : -1, fill: "none", role: "img", "aria-label": "Spreadsheet document icon", children: [jsx("title", { children: "Spreadsheet document" }), jsx("path", { d: "M 4.5 19 L 15.5 19 C 16.328 19 17 18.328 17 17.5 L 17 5 L 14.5 5 C 13.672 5 13 4.328 13 3.5 L 13 1 L 4.5 1 C 3.672 1 3 1.672 3 2.5 L 3 17.5 C 3 18.328 3.672 19 4.5 19 Z", fill: theme.current.coreColors['brand-land-700'] }), jsx("path", { d: "M 5 8 L 11 8 L 11 9.5 L 5 9.5 Z M 12 8 L 15 8 L 15 9.5 L 12 9.5 Z M 5 11 L 11 11 L 11 12.5 L 5 12.5 Z M 12 11 L 15 11 L 15 12.5 L 12 12.5 Z M 5 14 L 11 14 L 11 15.5 L 5 15.5 Z M 12 14 L 15 14 L 15 15.5 L 12 15.5 Z", fill: theme.current.colors['core-icon-light'] }), jsx("path", { d: "M 13 1 L 15 3 L 17 5 L 14 5 C 13.448 5 13 4.552 13 4 Z", fill: theme.current.coreColors['brand-purple-300'] })] })),
32
+ },
33
+ {
34
+ name: 'document',
35
+ icon: (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", style: {
36
+ cursor: disabled ? 'default' : pointer ? 'pointer' : 'inherit',
37
+ }, onClick: (e) => onClick(e), onKeyDown: handleKeyDown, tabIndex: pointer ? 0 : -1, fill: "none", role: "img", "aria-label": "Document icon", children: [jsx("title", { children: "Document" }), jsx("path", { d: "M 4.5 19 L 15.5 19 C 16.328 19 17 18.328 17 17.5 L 17 5 L 14.5 5 C 13.672 5 13 4.328 13 3.5 L 13 1 L 4.5 1 C 3.672 1 3 1.672 3 2.5 L 3 17.5 C 3 18.328 3.672 19 4.5 19 Z", fill: theme.current.colors['core-badge-primary'] }), jsx("path", { d: "M 6 14 L 14 14 M 6 10 L 12 10", fill: "transparent", strokeWidth: "1.5", stroke: theme.current.colors['core-icon-light'], strokeMiterlimit: "10", strokeDasharray: "" }), jsx("path", { d: "M 13 1 L 15 3 L 17 5 L 14 5 C 13.448 5 13 4.552 13 4 Z", fill: theme.current.coreColors['brand-purple-300'] })] })),
38
+ },
39
+ ];
40
+ }, [size, disabled, onClick, pointer, theme, handleKeyDown]);
41
+ // get the right icon in the array
42
+ const svgElement = FileIcon.filter((icon) => {
43
+ return icon.name.toLowerCase() === name.toLowerCase();
44
+ });
45
+ if (svgElement.length > 0) {
46
+ const iconNode = svgElement[0].icon;
47
+ return React.cloneElement(iconNode, Object.assign({ id: svgId, className, style: Object.assign(Object.assign({}, (style !== null && style !== void 0 ? style : {})), ((_b = (_a = iconNode.props) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {})), onClick: (e) => onClick(e) }, rest));
48
+ }
49
+ return null;
50
+ });
51
+
52
+ export { UIFileIcon as U };