@apple-pie/slice 0.0.1 → 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 (218) 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/index.d.ts +1 -1
  202. package/dist/types/stores/index.d.ts +2 -0
  203. package/dist/types/stores/tip/_types.d.ts +8 -0
  204. package/dist/types/stores/tip/index.d.ts +2 -0
  205. package/dist/types/stores/tip/tipStore.d.ts +12 -0
  206. package/dist/types/stores/toast/_types.d.ts +14 -0
  207. package/dist/types/stores/toast/index.d.ts +2 -0
  208. package/dist/types/stores/toast/toastStore.d.ts +12 -0
  209. package/dist/types/uikit/FlexDiv/FlexDiv.d.ts +2 -0
  210. package/dist/types/uikit/FlexDiv/_types.d.ts +1 -0
  211. package/dist/types/uikit/Toast/Toast.d.ts +1 -1
  212. package/dist/types/uikit/Toast/_types.d.ts +7 -1
  213. package/dist/types/uikit/Toast/index.d.ts +1 -1
  214. package/package.json +79 -5
  215. package/dist/index.esm.js +0 -5859
  216. package/dist/index.esm.js.map +0 -1
  217. package/dist/index.js +0 -5911
  218. package/dist/index.js.map +0 -1
@@ -0,0 +1,121 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('./tslib.es6-4H29ixHs.js');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var react = require('motion/react');
6
+ var React = require('react');
7
+ var hooks_useTheme = require('../hooks/useTheme.js');
8
+ require('../theme/colors.js');
9
+ require('../hooks/useWindow.js');
10
+ var styleInject_es = require('./style-inject.es-XZHJH68X.js');
11
+
12
+ const DoneCheck = React.memo((props) => {
13
+ const theme = hooks_useTheme.useTheme();
14
+ const { size = 88, stroke = 0.75, duration = 0.35, bounce = 0.7, delay = 0.5, color = theme.current.colors['feedback-positive'], didEnd = () => null, didStart = () => null, play = false } = props, svgAttributes = tslib_es6.__rest(props, ["size", "stroke", "duration", "bounce", "delay", "color", "didEnd", "didStart", "play"]);
15
+ const { id: svgId, className, style } = svgAttributes, rest = tslib_es6.__rest(svgAttributes, ["id", "className", "style"]);
16
+ const [check, animateCheck] = react.useAnimate();
17
+ const [isPresent, safeToRemove] = react.usePresence();
18
+ React.useEffect(() => {
19
+ const variants = { initial: { scale: 0.9 }, animate: { scale: 1 } };
20
+ const spring = {
21
+ type: 'spring',
22
+ time: duration,
23
+ bounce,
24
+ delay,
25
+ };
26
+ const instant = { ease: 'linear', duration: 0, delay: 0 };
27
+ if (isPresent && play) {
28
+ const enterAnimation = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
29
+ didStart();
30
+ yield animateCheck(check.current, variants.initial, instant);
31
+ yield animateCheck(check.current, variants.animate, spring);
32
+ didEnd();
33
+ });
34
+ enterAnimation();
35
+ }
36
+ else if (isPresent && !play) {
37
+ const enterAnimation = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
38
+ yield animateCheck(check.current, variants.animate, instant);
39
+ });
40
+ enterAnimation();
41
+ }
42
+ else if (!isPresent) {
43
+ const exitAnimation = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
44
+ yield animateCheck(check.current, variants.initial, instant);
45
+ safeToRemove();
46
+ });
47
+ exitAnimation();
48
+ }
49
+ }, [
50
+ isPresent,
51
+ play,
52
+ animateCheck,
53
+ check,
54
+ didEnd,
55
+ didStart,
56
+ safeToRemove,
57
+ bounce,
58
+ delay,
59
+ duration,
60
+ ]);
61
+ const checkMark = () => {
62
+ return (jsxRuntime.jsxs("svg", Object.assign({ id: svgId, className: className, ref: check, xmlns: "http://www.w3.org/2000/svg", width: size, height: size, scale: 0.9, viewBox: "0 0 20 20", fill: "none", style: (style !== null && style !== void 0 ? style : {}), "aria-label": "Checkmark icon" }, rest, { children: [jsxRuntime.jsx("title", { children: "Checkmark" }), jsxRuntime.jsx("path", { d: "M 1 1 L 19 1 L 19 19 L 1 19 Z", fill: "transparent" }), jsxRuntime.jsx("path", { d: "M 10 2 C 14.418 2 18 5.582 18 10 C 18 14.418 14.418 18 10 18 C 5.582 18 2 14.418 2 10 C 2 5.582 5.582 2 10 2 Z", fill: "transparent", strokeWidth: stroke, stroke: color }), jsxRuntime.jsx("path", { d: "M 6.5 9.5 L 9 12 L 13.5 7.5", fill: "transparent", strokeWidth: stroke, stroke: color })] })));
63
+ };
64
+ return checkMark();
65
+ });
66
+
67
+ 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}\n\n.ProgressIndicator-module_container__CZDPk {\n\tposition: var(--pi-position);\n\ttop: var(--pi-inset);\n\tbottom: var(--pi-inset);\n\tleft: var(--pi-inset);\n\tright: var(--pi-inset);\n\tcolor: var(--core-text-disabled);\n}\n\n.ProgressIndicator-module_iconWrapper__jPIBx {\n\tmin-width: var(--pi-icon-size);\n\tmax-width: var(--pi-icon-size);\n\tmax-height: var(--pi-icon-size);\n\tmin-height: var(--pi-icon-size);\n\theight: var(--pi-icon-size);\n\twidth: var(--pi-icon-size);\n\tpadding: 0;\n\tbackground: none;\n\tborder-radius: 100%;\n}\n";
68
+ var css = {"container":"ProgressIndicator-module_container__CZDPk flexBox-module_column__MP2Xd"};
69
+ styleInject_es.styleInject(css_248z);
70
+
71
+ function ProgressIndicator(props) {
72
+ const theme = hooks_useTheme.useTheme();
73
+ const { size = 20, secondsPerSpin = 1, show = false, color = theme.current.colors['core-icon-primary'], stroke = 1.5, inline = false, duration = undefined, didStart = () => null, didStop = () => null } = props, divAttributes = tslib_es6.__rest(props, ["size", "secondsPerSpin", "show", "color", "stroke", "inline", "duration", "didStart", "didStop"]);
74
+ const { id: divId, className, style } = divAttributes, rest = tslib_es6.__rest(divAttributes, ["id", "className", "style"]);
75
+ const divStyle = style !== null && style !== void 0 ? style : {};
76
+ const divClass = className ? ` ${className}` : '';
77
+ const [playing, setPlaying] = React.useState(show);
78
+ const timer = React.useRef(null);
79
+ React.useEffect(() => {
80
+ if (show) {
81
+ setPlaying(true);
82
+ didStart();
83
+ if (duration) {
84
+ timer.current = setTimeout(() => {
85
+ setPlaying(false);
86
+ didStop();
87
+ }, duration * 1000);
88
+ }
89
+ }
90
+ else {
91
+ setPlaying(false);
92
+ didStop();
93
+ }
94
+ return () => {
95
+ if (timer === null || timer === void 0 ? void 0 : timer.current)
96
+ clearTimeout(timer.current);
97
+ };
98
+ }, [show, didStart, didStop, duration]);
99
+ const cssVars = React.useMemo(() => {
100
+ return {
101
+ '--pi-position': inline ? 'relative' : 'absolute',
102
+ '--pi-inset': inline ? 'unset' : '0',
103
+ '--pi-icon-size': `${size !== null && size !== void 0 ? size : 0}px`,
104
+ };
105
+ }, [inline, size]);
106
+ const openCircle = React.useMemo(() => {
107
+ return OpenCircle(size, secondsPerSpin, color, stroke, playing);
108
+ }, [size, secondsPerSpin, color, stroke, playing]);
109
+ return (jsxRuntime.jsx(react.AnimatePresence, { initial: true, children: show && (jsxRuntime.jsx(react.motion.div, Object.assign({ id: divId, className: `${css.container}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } }, rest, { children: openCircle }))) }));
110
+ }
111
+ const OpenCircle = (size, secondsPerSpin, color, stroke = 1.5, playing = false) => {
112
+ return (jsxRuntime.jsxs(react.motion.svg, { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", role: "img", "aria-label": "Loading spinner", transition: {
113
+ ease: 'linear',
114
+ repeatType: 'loop',
115
+ repeat: playing ? Number.POSITIVE_INFINITY : 0,
116
+ duration: secondsPerSpin,
117
+ }, animate: playing ? { rotate: 360 } : { rotate: 0 }, children: [jsxRuntime.jsx("title", { children: "Loading" }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsxs("linearGradient", { id: "strokeFill", x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [jsxRuntime.jsx("stop", { offset: "0%", stopColor: color, stopOpacity: 1 }), jsxRuntime.jsx("stop", { offset: "50%", stopColor: color, stopOpacity: 1 }), jsxRuntime.jsx("stop", { offset: "100%", stopColor: color, stopOpacity: 0 })] }) }), jsxRuntime.jsx(react.motion.path, { d: "M 17.371 6.886 C 17.776 7.843 18 8.895 18 10 C 18 14.418 14.418 18 10 18 C 5.582 18 2 14.418 2 10 C 2 5.582 5.582 2 10 2", fill: "transparent", strokeWidth: stroke, stroke: 'url(#strokeFill)' })] }));
118
+ };
119
+
120
+ exports.DoneCheck = DoneCheck;
121
+ exports.ProgressIndicator = ProgressIndicator;
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('./tslib.es6-4H29ixHs.js');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var React = require('react');
6
+ var hooks_useTheme = require('../hooks/useTheme.js');
7
+ require('../theme/colors.js');
8
+ require('../hooks/useWindow.js');
9
+ var IconButton = require('./IconButton-BfsPlKTb.js');
10
+ var styleInject_es = require('./style-inject.es-XZHJH68X.js');
11
+
12
+ 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.RadioButton-module_wrapper__ezvz- {\n\tpadding: var(--rb-padding) !important;\n\tmax-width: var(--rb-max-width);\n\tflex: var(--rb-flex);\n\tborder: 1px solid var(--core-outline-primary);\n\tbackground: var(--rb-bg);\n\tgap: 8px;\n\tborder-radius: 8px;\n\tcursor: pointer;\n\ttransition: all 0.25s ease-in-out 0s;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.RadioButton-module_radioIcon__6ddS9 {\n\twidth: 20px;\n\theight: 20px;\n\tmax-width: 20px;\n\tmax-height: 20px;\n\tmin-height: 20px;\n\tmin-width: 20px;\n}\n\n.RadioButton-module_radioTitle__R1R2D {\n\tcolor: var(--core-text-primary);\n\twhite-space: nowrap;\n\tflex: 1;\n}\n\n.RadioButton-module_radioSummary__-RRdT {\n\tcolor: var(--core-text-primary);\n\tflex: 1;\n}\n\n.RadioButton-module_radioContent__Fq-Ry {\n\twidth: 100%;\n}\n";
13
+ var css = {"wrapper":"RadioButton-module_wrapper__ezvz- flexBox-module_row__PWxbe","radioIcon":"RadioButton-module_radioIcon__6ddS9 flexBox-module_column__MP2Xd","radioTitle":"RadioButton-module_radioTitle__R1R2D flexBox-module_rowStart__nJZnW type-module_body-m-regular__Qtp5G","radioSummary":"RadioButton-module_radioSummary__-RRdT flexBox-module_rowStart__nJZnW type-module_body-s-regular__8-FO-","radioContent":"RadioButton-module_radioContent__Fq-Ry flexBox-module_columnStart__Kg8cV"};
14
+ styleInject_es.styleInject(css_248z);
15
+
16
+ const RadioButton = React.memo((props) => {
17
+ const theme = hooks_useTheme.useTheme();
18
+ const { option, selected = false, deselect = true, tabIndex = 1, wrap = false, list = false, hideRadio = false, toggleIcon = true, noFrame = false, iconColor, onChange = () => null } = props, divAttributes = tslib_es6.__rest(props, ["option", "selected", "deselect", "tabIndex", "wrap", "list", "hideRadio", "toggleIcon", "noFrame", "iconColor", "onChange"]);
19
+ const { id: divId, className, style } = divAttributes, rest = tslib_es6.__rest(divAttributes, ["id", "className", "style"]);
20
+ const divStyle = style !== null && style !== void 0 ? style : {};
21
+ const divClass = className ? ` ${className}` : '';
22
+ const [isSelected, setIsSelected] = React.useState(selected);
23
+ React.useEffect(() => setIsSelected(selected), [selected]);
24
+ const handleChange = React.useCallback(() => {
25
+ if (isSelected && !deselect)
26
+ return;
27
+ setIsSelected(!isSelected);
28
+ onChange(option, !isSelected);
29
+ }, [isSelected, deselect, onChange, option]);
30
+ const handleKeyDown = React.useCallback((e) => {
31
+ if (e.code === 'Space') {
32
+ e.preventDefault();
33
+ e.stopPropagation();
34
+ handleChange();
35
+ }
36
+ }, [handleChange]);
37
+ // memo icon color
38
+ const setIconColor = React.useMemo(() => {
39
+ if (iconColor)
40
+ return iconColor;
41
+ return toggleIcon && isSelected
42
+ ? theme.current.colors['core-button-primary']
43
+ : theme.current.colors['core-icon-primary'];
44
+ }, [iconColor, toggleIcon, isSelected, theme]);
45
+ // memo icon name
46
+ const iconName = React.useMemo(() => (toggleIcon && isSelected ? 'checked' : 'unchecked'), [toggleIcon, isSelected]);
47
+ // memo flex
48
+ const setFlex = React.useMemo(() => {
49
+ if (list)
50
+ return 'unset';
51
+ return wrap ? '40%' : '1';
52
+ }, [list, wrap]);
53
+ // memo css vars
54
+ const cssVars = React.useMemo(() => {
55
+ return {
56
+ '--rb-max-width': wrap ? '50%' : '100%',
57
+ '--rb-flex': setFlex,
58
+ '--rb-padding': noFrame ? '0' : '8px 16px 8px 10px',
59
+ '--rb-bg': isSelected ? 'var(--core-surface-secondary)' : 'transparent',
60
+ };
61
+ }, [setFlex, isSelected, wrap, noFrame]);
62
+ return (jsxRuntime.jsxs("div", Object.assign({ id: divId, className: `${css.wrapper}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), onClick: handleChange, onKeyDown: handleKeyDown, tabIndex: tabIndex, "aria-label": option.title, "aria-selected": isSelected }, rest, { children: [option.icon && !hideRadio && (jsxRuntime.jsx("div", { className: css.radioIcon, children: jsxRuntime.jsx(IconButton.IconButton, { toggle: false, icon: iconName, color: setIconColor, frameSize: 20, iconSize: 20 }) })), jsxRuntime.jsxs("div", { className: css.radioContent, children: [jsxRuntime.jsx("div", { className: css.radioTitle, children: option.title }), option.description && option.description !== '' && (jsxRuntime.jsx("div", { className: css.radioSummary, children: option.description }))] })] })));
63
+ });
64
+
65
+ exports.RadioButton = RadioButton;
@@ -0,0 +1,116 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('./tslib.es6-4H29ixHs.js');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var React = require('react');
6
+ var RadioButton = require('./RadioButton-e_y2qiPE.js');
7
+ var styleInject_es = require('./style-inject.es-XZHJH68X.js');
8
+
9
+ 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}\n\n.RadioButtonList-module_wrapper__UMlAV {\n\talign-items: flex-start;\n\twidth: 100%;\n\tflex-wrap: var(--rb-list-flex-wrap);\n\tmargin-bottom: var(--rb-list-margin-bottom);\n\tgap: var(--rb-gap);\n}\n\n.RadioButtonList-module_column__E9MfY {\n}\n\n.RadioButtonList-module_row__l88Vt {\n}\n";
10
+ var css = {"wrapper":"RadioButtonList-module_wrapper__UMlAV","column":"RadioButtonList-module_column__E9MfY flexBox-module_columnStart__Kg8cV","row":"RadioButtonList-module_row__l88Vt flexBox-module_rowStart__nJZnW"};
11
+ styleInject_es.styleInject(css_248z);
12
+
13
+ const RadioButtonList = React.memo((props) => {
14
+ const { options = [], selectedIndexes = null, selectedOptions = null, label = null, deselect = false, multiSelect = false, wrap = false, tabIndexSeed = 0, spacer = 'none', custom = 0, gap = 16, hideRadio = false, noFrame = false, toggleIcon = true, iconColor = undefined, iconSelectedColor = undefined, onChange = () => null } = props, divAttributes = tslib_es6.__rest(props, ["options", "selectedIndexes", "selectedOptions", "label", "deselect", "multiSelect", "wrap", "tabIndexSeed", "spacer", "custom", "gap", "hideRadio", "noFrame", "toggleIcon", "iconColor", "iconSelectedColor", "onChange"]);
15
+ const { id: divId, className, style } = divAttributes, rest = tslib_es6.__rest(divAttributes, ["id", "className", "style"]);
16
+ const divStyle = style !== null && style !== void 0 ? style : {};
17
+ const divClass = className ? ` ${className}` : '';
18
+ // internal array of selected indexes
19
+ const [selected, setSelected] = React.useState(selectedIndexes);
20
+ // update indexes selected based on prop
21
+ React.useEffect(() => setSelected(selectedIndexes), [selectedIndexes]);
22
+ // update indexes selected if setting selections via field name / values
23
+ React.useEffect(() => {
24
+ if (!selectedOptions || !options)
25
+ return;
26
+ const selections = [];
27
+ for (const item of selectedOptions) {
28
+ for (let i = 0; i < options.length; i++) {
29
+ const option = options[i];
30
+ if (option.fieldName === item)
31
+ selections.push(i);
32
+ }
33
+ }
34
+ setSelected(selections);
35
+ }, [selectedOptions, options]);
36
+ // returns if a specific option index is selected
37
+ const isSelected = React.useCallback((index) => {
38
+ if (!selected)
39
+ return false;
40
+ return selected.includes(index);
41
+ }, [selected]);
42
+ const doMultiSelection = React.useCallback((selection, state) => {
43
+ // **** update the selected indexes
44
+ let indexesSelected = selected ? [...selected] : [];
45
+ // if deselecting and there are selections
46
+ if (!state && selected) {
47
+ const removeAt = indexesSelected.indexOf(selection);
48
+ indexesSelected.splice(removeAt, 1);
49
+ }
50
+ else if (state) {
51
+ indexesSelected = selected ? [...selected] : [];
52
+ const exists = indexesSelected.includes(selection);
53
+ if (!exists)
54
+ indexesSelected.push(selection);
55
+ }
56
+ // **** create an array of selected options
57
+ let updatedSelections = [];
58
+ for (const index of indexesSelected || []) {
59
+ if (updatedSelections)
60
+ updatedSelections.push(options[index]);
61
+ }
62
+ if (updatedSelections.length < 1)
63
+ updatedSelections = null;
64
+ setSelected(indexesSelected || null);
65
+ onChange(updatedSelections, indexesSelected || null);
66
+ }, [selected, options, onChange]);
67
+ const doSingleSelection = React.useCallback((selection, state) => {
68
+ onChange(state ? [options[selection]] : [], state ? [selection] : []);
69
+ setSelected(state ? [selection] : null);
70
+ }, [options, onChange]);
71
+ const handleChange = React.useCallback((selection, state) => {
72
+ // it not multiselect just pass the current selection
73
+ if (multiSelect) {
74
+ doMultiSelection(selection, state);
75
+ }
76
+ else {
77
+ doSingleSelection(selection, state);
78
+ }
79
+ }, [multiSelect, doMultiSelection, doSingleSelection]);
80
+ const renderedOptions = React.useMemo(() => {
81
+ return options.map((option, i) => {
82
+ return (jsxRuntime.jsx(RadioButton.RadioButton, { option: option, selected: isSelected(i), deselect: deselect, wrap: wrap, noFrame: noFrame, hideRadio: hideRadio, onChange: (_option, state) => handleChange(i, state), tabIndex: i + 1 + 100 * tabIndexSeed, toggleIcon: toggleIcon, iconColor: isSelected(i) ? iconSelectedColor : iconColor }, `${option.fieldName}_${i}`));
83
+ });
84
+ }, [
85
+ options,
86
+ isSelected,
87
+ deselect,
88
+ wrap,
89
+ noFrame,
90
+ hideRadio,
91
+ handleChange,
92
+ tabIndexSeed,
93
+ toggleIcon,
94
+ iconColor,
95
+ iconSelectedColor,
96
+ ]);
97
+ // memo margin
98
+ const margin = React.useMemo(() => {
99
+ if (spacer === 'none')
100
+ return 0;
101
+ if (spacer === 'custom')
102
+ return custom;
103
+ return 0;
104
+ }, [spacer, custom]);
105
+ // memo css vars
106
+ const cssVars = React.useMemo(() => {
107
+ return {
108
+ '--rb-list-flex-wrap': wrap ? 'wrap' : 'nowrap',
109
+ '--rb-list-margin-bottom': noFrame ? 0 : `${margin}px`,
110
+ '--rb-gap': `${gap}px`,
111
+ };
112
+ }, [wrap, margin, gap, noFrame]);
113
+ return (jsxRuntime.jsxs("div", Object.assign({ id: divId, className: `${css.wrapper} ${noFrame ? css.column : css.row}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars) }, rest, { children: [label, renderedOptions] })));
114
+ });
115
+
116
+ exports.RadioButtonList = RadioButtonList;
@@ -0,0 +1,285 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('./tslib.es6-4H29ixHs.js');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var React = require('react');
6
+ var hooks_useObserveResize = require('../hooks/useObserveResize.js');
7
+ var utils = require('./utils-CbayehuI.js');
8
+ var styleInject_es = require('./style-inject.es-XZHJH68X.js');
9
+
10
+ /**
11
+ * General debounce utility with delay setting and cancel/flush methods
12
+ * to clear a "debounce" or immediately "execute" the debounced function
13
+ */
14
+ function debounce(func, delay) {
15
+ let timeoutId = null;
16
+ let lastArgs = null;
17
+ const debounced = function (...args) {
18
+ lastArgs = args;
19
+ if (timeoutId !== null) {
20
+ clearTimeout(timeoutId);
21
+ }
22
+ timeoutId = setTimeout(() => {
23
+ func.apply(this, lastArgs !== null && lastArgs !== void 0 ? lastArgs : []);
24
+ timeoutId = null;
25
+ lastArgs = null;
26
+ }, delay);
27
+ };
28
+ debounced.cancel = () => {
29
+ if (timeoutId !== null) {
30
+ clearTimeout(timeoutId);
31
+ timeoutId = null;
32
+ lastArgs = null;
33
+ }
34
+ };
35
+ debounced.flush = function () {
36
+ if (timeoutId !== null && lastArgs !== null) {
37
+ clearTimeout(timeoutId);
38
+ func.apply(this, lastArgs);
39
+ timeoutId = null;
40
+ lastArgs = null;
41
+ }
42
+ };
43
+ return debounced;
44
+ }
45
+
46
+ 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}\n\n.Slider-module_wrapper__ju4N2 {\n\tposition: relative;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: var(--slider-padding);\n\tmargin: 0;\n\twidth: var(--slider-width);\n\theight: var(--slider-height);\n\tmin-height: var(--slider-touch-height);\n\tcursor: var(--slider-cursor);\n}\n\n.Slider-module_track__XogMe {\n\tposition: relative;\n\twidth: 0;\n\theight: 100%;\n\tbackground-color: var(--slider-progress-color);\n\toverflow: visible;\n\tpointer-events: none;\n\tborder-radius: 100px;\n}\n\n.Slider-module_trackHead__Ka3pu {\n\tposition: absolute;\n\tdisplay: var(--slider-head-display);\n\tbackground-color: var(--slider-head-color);\n\tpointer-events: none;\n\tborder-radius: var(--slider-head-radius);\n\tmax-width: var(--slider-head-width);\n\tmax-height: var(--slider-head-size);\n\tmin-width: var(--slider-head-width);\n\tmin-height: var(--slider-head-size);\n\ttop: 50%;\n\ttransform: translateY(-50%) translateX(-50%);\n}\n\n.Slider-module_trackBg__4z7Pt {\n\twidth: 100%;\n\theight: var(--slider-height);\n\tbackground-color: var(--slider-track-color);\n\tpointer-events: none;\n\tborder-radius: 100px;\n}\n";
47
+ var css = {"wrapper":"Slider-module_wrapper__ju4N2","track":"Slider-module_track__XogMe flexBox-module_rowStart__nJZnW","trackHead":"Slider-module_trackHead__Ka3pu","trackBg":"Slider-module_trackBg__4z7Pt flexBox-module_rowStart__nJZnW"};
48
+ styleInject_es.styleInject(css_248z);
49
+
50
+ const Slider = React.memo((props) => {
51
+ const { value = 25, scaleMin = 0, scaleMax = 100, width, height = 2, touchHeight = 24, trackHeadSize = 7, headType = 'round', trackHeadWidth = 4, cursor = 'default', headColor = 'var(--core-text-primary)', trackColor = 'var(--core-surface-secondary)', progressColor = 'var(--core-text-primary)', onChange = () => null, onDragChange = () => null } = props, divAttributes = tslib_es6.__rest(props, ["value", "scaleMin", "scaleMax", "width", "height", "touchHeight", "trackHeadSize", "headType", "trackHeadWidth", "cursor", "headColor", "trackColor", "progressColor", "onChange", "onDragChange"]);
52
+ const { id: divId, className, style } = divAttributes, rest = tslib_es6.__rest(divAttributes, ["id", "className", "style"]);
53
+ const divStyle = style !== null && style !== void 0 ? style : {};
54
+ const divClass = className ? ` ${className}` : '';
55
+ // hook into the relevant on screen elements
56
+ const ref = React.useRef(null);
57
+ const track = React.useRef(null);
58
+ const head = React.useRef(null);
59
+ // tracking slider values via ref to avoid state issues from direct listeners
60
+ const absProgressRef = React.useRef(value);
61
+ const relativeProgressRef = React.useRef(value / scaleMax);
62
+ const didMount = React.useRef(false);
63
+ // use resize observer to track changes to container size for responsive behavior
64
+ const size = hooks_useObserveResize.useObserveResize(ref, { ignore: 'height' });
65
+ // use a "debounce" to limit the number of onChange calls
66
+ const debouncedOnChange = debounce((value, percent) => {
67
+ onChange(value, percent);
68
+ }, 0);
69
+ // set padding based on head size since dragging the head all the way to the edge will move it
70
+ // such that half the head would be outside the track constraints
71
+ const padding = React.useMemo(() => {
72
+ if (headType === 'none' || !trackHeadSize)
73
+ return 0;
74
+ return trackHeadSize / 2;
75
+ }, [headType, trackHeadSize]);
76
+ // set the position of the track progress and track head
77
+ // based on the pixel position / adjust for half the size of the head (= padding)
78
+ const setTrackAndHead = React.useCallback((pixelPos, max = false) => {
79
+ const tr = track.current;
80
+ const hd = head.current;
81
+ let adjustment = 0;
82
+ if (pixelPos === 0)
83
+ adjustment = padding;
84
+ if (max)
85
+ adjustment = -padding;
86
+ if (tr && hd) {
87
+ tr.style.width = `${pixelPos}px`;
88
+ hd.style.left = `${pixelPos - padding + adjustment}px`;
89
+ }
90
+ didMount.current = true;
91
+ }, [padding]);
92
+ // set the initial position of the slider absolute value within scale
93
+ const initialProgress = React.useCallback((current) => {
94
+ if (!(ref === null || ref === void 0 ? void 0 : ref.current))
95
+ return;
96
+ const sliderWidth = ref.current.getBoundingClientRect().width;
97
+ let adjustedCurrent = current;
98
+ if (adjustedCurrent > scaleMax || adjustedCurrent < scaleMin) {
99
+ console.warn('Slider outside range. Adjusted to mid point.');
100
+ adjustedCurrent = (scaleMax - scaleMin) / 2;
101
+ }
102
+ const normalized = (adjustedCurrent - scaleMin) / (scaleMax - scaleMin);
103
+ const pixelPos = normalized * sliderWidth;
104
+ absProgressRef.current = adjustedCurrent; // updated the progress value
105
+ relativeProgressRef.current = normalized; // updated the relative value
106
+ const max = relativeProgressRef.current === 1; // flag if at max value
107
+ setTrackAndHead(pixelPos, max);
108
+ didMount.current = true;
109
+ }, [scaleMax, scaleMin, setTrackAndHead]);
110
+ // based on x pos of a mouse drag/click, update the percent and normalized value of the slider
111
+ const progress = React.useCallback((posX) => {
112
+ const el = ref === null || ref === void 0 ? void 0 : ref.current;
113
+ if (!el)
114
+ return { value: 0, percent: 0 };
115
+ const rect = el.getBoundingClientRect();
116
+ const sliderWidth = rect.width;
117
+ relativeProgressRef.current = posX / sliderWidth;
118
+ absProgressRef.current =
119
+ scaleMin + relativeProgressRef.current * (scaleMax - scaleMin);
120
+ }, [scaleMax, scaleMin]);
121
+ // take a mouse pos and sets the slider position accordingly
122
+ // returns the pos value making sure it's in bounds
123
+ const updateSlider = React.useCallback((e) => {
124
+ const newPos = utils.pointerPosition(e);
125
+ const el = ref === null || ref === void 0 ? void 0 : ref.current;
126
+ if (!el)
127
+ return 0;
128
+ const rect = el.getBoundingClientRect();
129
+ const sliderWidth = rect.width;
130
+ let pos = newPos - rect.x;
131
+ if (pos > sliderWidth - padding)
132
+ pos = sliderWidth;
133
+ else if (pos < padding)
134
+ pos = 0;
135
+ const max = pos === sliderWidth;
136
+ setTrackAndHead(pos, max);
137
+ return pos;
138
+ }, [setTrackAndHead, padding]);
139
+ // on mouse move, push slider to the updated mouse position and trigger the update events
140
+ // use ref values in the call back to avoid state issues
141
+ const handleMouseMove = React.useCallback((e) => {
142
+ e.preventDefault();
143
+ const el = ref === null || ref === void 0 ? void 0 : ref.current;
144
+ if (el) {
145
+ const pos = updateSlider(e); // return new pixel pos and updates head/track
146
+ progress(pos); // update the slider progress
147
+ debouncedOnChange(absProgressRef.current, relativeProgressRef.current); // debounce updates
148
+ }
149
+ }, [progress, updateSlider, debouncedOnChange]);
150
+ // on mouse up, push slider to the updated mouse up position and trigger the update events
151
+ // also cleaning up the mouse move and mouse up listeners attached to the window
152
+ const handleMouseUp = React.useCallback((e) => {
153
+ e.preventDefault();
154
+ const el = ref === null || ref === void 0 ? void 0 : ref.current;
155
+ if (el) {
156
+ const pos = updateSlider(e); // return new pixel pos and updates head/track
157
+ progress(pos);
158
+ debouncedOnChange.cancel(); // cancel current debounce if any
159
+ onDragChange(absProgressRef.current, relativeProgressRef.current); // immediate update
160
+ onChange(absProgressRef.current, relativeProgressRef.current);
161
+ }
162
+ globalThis.removeEventListener('mousemove', handleMouseMove, false);
163
+ globalThis.removeEventListener('touchmove', handleMouseMove, false);
164
+ globalThis.removeEventListener('mouseup', handleMouseUp, false);
165
+ globalThis.removeEventListener('touchend', handleMouseUp, false);
166
+ }, [
167
+ handleMouseMove,
168
+ progress,
169
+ updateSlider,
170
+ debouncedOnChange,
171
+ onDragChange,
172
+ onChange,
173
+ ]);
174
+ // On mouse down push the progress of then slider to the mouse down point
175
+ // and trigger events - add the drag and mouse up window listeners
176
+ const handleMouseDown = React.useCallback((e) => {
177
+ e.preventDefault();
178
+ e.stopPropagation();
179
+ globalThis.addEventListener('mousemove', handleMouseMove, false);
180
+ globalThis.addEventListener('touchmove', handleMouseMove, false);
181
+ globalThis.addEventListener('mouseup', handleMouseUp, false);
182
+ globalThis.addEventListener('touchend', handleMouseUp, false);
183
+ const el = ref === null || ref === void 0 ? void 0 : ref.current;
184
+ if (el) {
185
+ const pos = updateSlider(e); // return new pixel pos and updates head/track
186
+ progress(pos);
187
+ debouncedOnChange.cancel(); // cancel current debounce if any
188
+ onChange(absProgressRef.current, relativeProgressRef.current); // immediate update
189
+ onDragChange(absProgressRef.current, relativeProgressRef.current);
190
+ }
191
+ }, [
192
+ handleMouseMove,
193
+ handleMouseUp,
194
+ onChange,
195
+ onDragChange,
196
+ progress,
197
+ updateSlider,
198
+ debouncedOnChange,
199
+ ]);
200
+ // on mount, set the initial position of the slider
201
+ React.useEffect(() => {
202
+ if (didMount.current && value === absProgressRef.current)
203
+ return;
204
+ initialProgress(value);
205
+ }, [value, initialProgress]);
206
+ // set up slider
207
+ React.useEffect(() => {
208
+ const el = ref === null || ref === void 0 ? void 0 : ref.current;
209
+ el === null || el === void 0 ? void 0 : el.addEventListener('mousedown', handleMouseDown, false);
210
+ el === null || el === void 0 ? void 0 : el.addEventListener('touchstart', handleMouseDown, false);
211
+ return () => {
212
+ el === null || el === void 0 ? void 0 : el.removeEventListener('mousedown', handleMouseDown, false);
213
+ el === null || el === void 0 ? void 0 : el.removeEventListener('touchstart', handleMouseDown, false);
214
+ };
215
+ }, [handleMouseDown]);
216
+ // respond to size changes triggered by browser resizing as opposed to props
217
+ // note: this causes an extra render with every width prop change
218
+ React.useEffect(() => {
219
+ var _a;
220
+ const sliderWidth = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
221
+ if (!sliderWidth || size.width === 0)
222
+ return;
223
+ const max = relativeProgressRef.current === 1;
224
+ setTrackAndHead(relativeProgressRef.current * sliderWidth, max);
225
+ }, [size.width, setTrackAndHead]);
226
+ // memo head color
227
+ const trackHeadColor = React.useMemo(() => {
228
+ if (headType === 'none')
229
+ return 'transparent';
230
+ return headColor !== null && headColor !== void 0 ? headColor : 'var(--core-text-primary)';
231
+ }, [headColor, headType]);
232
+ // memo head height
233
+ const headSize = React.useMemo(() => {
234
+ if (headType === 'none')
235
+ return height;
236
+ return trackHeadSize;
237
+ }, [trackHeadSize, headType, height]);
238
+ // memo head width
239
+ const headWidth = React.useMemo(() => {
240
+ if (headType === 'round')
241
+ return trackHeadSize;
242
+ return trackHeadWidth;
243
+ }, [headType, trackHeadSize, trackHeadWidth]);
244
+ // set container width
245
+ const setWidth = React.useMemo(() => {
246
+ if (width && typeof width === 'string') {
247
+ if (width === 'auto')
248
+ return '100%';
249
+ return width;
250
+ }
251
+ return `${width !== null && width !== void 0 ? width : 100}px`;
252
+ }, [width]);
253
+ // memo css vars
254
+ const cssVars = React.useMemo(() => {
255
+ return {
256
+ '--slider-padding': `${padding}px`,
257
+ '--slider-width': setWidth,
258
+ '--slider-height': `${height}px`,
259
+ '--slider-touch-height': `${touchHeight}px`,
260
+ '--slider-cursor': cursor,
261
+ '--slider-head-display': height ? 'block' : 'none',
262
+ '--slider-head-radius': headType === 'round' ? '100%' : '0px',
263
+ '--slider-head-size': `${headSize}px`,
264
+ '--slider-head-width': `${headWidth}px`,
265
+ '--slider-head-color': trackHeadColor,
266
+ '--slider-progress-color': progressColor !== null && progressColor !== void 0 ? progressColor : 'var(--core-text-primary)',
267
+ '--slider-track-color': trackColor !== null && trackColor !== void 0 ? trackColor : 'var(--core-surface-secondary)',
268
+ };
269
+ }, [
270
+ padding,
271
+ height,
272
+ touchHeight,
273
+ cursor,
274
+ headWidth,
275
+ progressColor,
276
+ trackColor,
277
+ headSize,
278
+ trackHeadColor,
279
+ headType,
280
+ setWidth,
281
+ ]);
282
+ return (jsxRuntime.jsx("div", Object.assign({ id: divId, className: `${css.wrapper}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), ref: ref }, rest, { children: jsxRuntime.jsx("div", { className: css.trackBg, children: jsxRuntime.jsx("div", { className: css.track, ref: track, children: jsxRuntime.jsx("div", { className: css.trackHead, ref: head }) }) }) })));
283
+ });
284
+
285
+ exports.Slider = Slider;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('./tslib.es6-4H29ixHs.js');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var React = require('react');
6
+
7
+ const Spacer = React.memo((props) => {
8
+ const { size = 8 } = props, divAttributes = tslib_es6.__rest(props, ["size"]);
9
+ const { id: divId, className, style } = divAttributes, rest = tslib_es6.__rest(divAttributes, ["id", "className", "style"]);
10
+ const spacerStyle = React.useMemo(() => ({ height: size, minHeight: size, maxHeight: size }), [size]);
11
+ const divStyle = style !== null && style !== void 0 ? style : {};
12
+ const divClass = className ? ` ${className}` : '';
13
+ return (jsxRuntime.jsx("div", Object.assign({ id: divId, className: divClass.trim(), style: Object.assign(Object.assign({}, divStyle), spacerStyle) }, rest)));
14
+ });
15
+
16
+ exports.Spacer = Spacer;