@x15ventures/x15-ui-library 3.17.0 → 3.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/dist/cjs/autoGenerated/libraryThemes.js +12 -12
  2. package/dist/cjs/autoGenerated/libraryThemes.js.map +1 -1
  3. package/dist/cjs/autoGenerated/libraryThemes.json +12 -12
  4. package/dist/cjs/components/design/accordion/Accordion.js +7 -23
  5. package/dist/cjs/components/design/accordion/Accordion.js.map +1 -1
  6. package/dist/cjs/components/design/banners/pageBanner/PageBanner.js +2 -4
  7. package/dist/cjs/components/design/banners/pageBanner/PageBanner.js.map +1 -1
  8. package/dist/cjs/components/design/card/cardContent/CardContentLine.js +2 -2
  9. package/dist/cjs/components/design/card/cardContent/CardContentLine.js.map +1 -1
  10. package/dist/cjs/components/design/card/cardHeader/CardHeaderItem.js +2 -2
  11. package/dist/cjs/components/design/card/cardHeader/CardHeaderItem.js.map +1 -1
  12. package/dist/cjs/components/design/headerBar/HeaderBar.js +3 -3
  13. package/dist/cjs/components/design/headerBar/HeaderBar.js.map +1 -1
  14. package/dist/cjs/components/design/icons/notificationIcon/NotificationIcon.js +4 -5
  15. package/dist/cjs/components/design/icons/notificationIcon/NotificationIcon.js.map +1 -1
  16. package/dist/cjs/components/design/paginators/Paginator.js +4 -12
  17. package/dist/cjs/components/design/paginators/Paginator.js.map +1 -1
  18. package/dist/cjs/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.js +2 -1
  19. package/dist/cjs/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.js.map +1 -1
  20. package/dist/cjs/components/design/revealMore/RevealMoreBelow.js +1 -3
  21. package/dist/cjs/components/design/revealMore/RevealMoreBelow.js.map +1 -1
  22. package/dist/cjs/components/design/revealMore/RevealMoreInline.js +3 -5
  23. package/dist/cjs/components/design/revealMore/RevealMoreInline.js.map +1 -1
  24. package/dist/cjs/components/design/revealMore/types/revealMoreTypes.js.map +1 -1
  25. package/dist/cjs/components/design/sidePanel/SidePanel.js +3 -5
  26. package/dist/cjs/components/design/sidePanel/SidePanel.js.map +1 -1
  27. package/dist/cjs/components/design/statusIndicators/statusIconLabel/StatusIconLabel.js +6 -11
  28. package/dist/cjs/components/design/statusIndicators/statusIconLabel/StatusIconLabel.js.map +1 -1
  29. package/dist/cjs/components/design/tabs/Tabs.js +2 -2
  30. package/dist/cjs/components/design/tabs/Tabs.js.map +1 -1
  31. package/dist/cjs/components/design/themeLoader/ThemeLoader.js +2 -2
  32. package/dist/cjs/components/design/themeLoader/ThemeLoader.js.map +1 -1
  33. package/dist/cjs/components/design/tooltip/Tooltip.js +4 -11
  34. package/dist/cjs/components/design/tooltip/Tooltip.js.map +1 -1
  35. package/dist/cjs/components/form/buttons/SimpleButton.js +3 -3
  36. package/dist/cjs/components/form/buttons/SimpleButton.js.map +1 -1
  37. package/dist/cjs/components/form/buttons/button.interface.js.map +1 -1
  38. package/dist/cjs/components/form/formFields/formFieldWrapper/formFieldProps.js.map +1 -1
  39. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js +5 -5
  40. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js.map +1 -1
  41. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.js +176 -0
  42. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.js.map +1 -0
  43. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/_checkboxSwitchVariables.css +0 -0
  44. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitch.css +306 -0
  45. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.js +6 -0
  46. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.js.map +1 -0
  47. package/dist/cjs/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.js.map +1 -1
  48. package/dist/cjs/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js +3 -5
  49. package/dist/cjs/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js.map +1 -1
  50. package/dist/cjs/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.js +12 -22
  51. package/dist/cjs/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.js.map +1 -1
  52. package/dist/cjs/components/form/formFields/subComponents/inputs/file/fileInputProps.js.map +1 -1
  53. package/dist/cjs/components/index.js +7 -0
  54. package/dist/cjs/components/index.js.map +1 -1
  55. package/dist/cjs/components/navigation/menu/Menu.interfaces.js.map +1 -1
  56. package/dist/cjs/components/navigation/menu/menuItemContent/MenuItemIcon.js +19 -31
  57. package/dist/cjs/components/navigation/menu/menuItemContent/MenuItemIcon.js.map +1 -1
  58. package/dist/cjs/helpers/iconHelpers.js +83 -0
  59. package/dist/cjs/helpers/iconHelpers.js.map +1 -0
  60. package/dist/cjs/helpers/index.js +43 -0
  61. package/dist/cjs/helpers/index.js.map +1 -1
  62. package/dist/cjs/helpers/objectHelpers.js +9 -2
  63. package/dist/cjs/helpers/objectHelpers.js.map +1 -1
  64. package/dist/cjs/index.js +57 -0
  65. package/dist/cjs/index.js.map +1 -1
  66. package/dist/cjs/interfaces/headerText.interface.js.map +1 -1
  67. package/dist/cjs/package.json +16 -28
  68. package/dist/cjs/styles/index.css +61 -0
  69. package/dist/cjs/styles/storybook/storybook.css +7 -0
  70. package/dist/cjs/styles/variables/cssVars/_darkModeVariables.css +21 -0
  71. package/dist/cjs/styles/variables/cssVars/_formVariables.css +40 -0
  72. package/dist/cjs/widgets/processLauncher/ProcessLauncher.js +3 -9
  73. package/dist/cjs/widgets/processLauncher/ProcessLauncher.js.map +1 -1
  74. package/dist/cjs/widgets/processLauncher/processLauncher.interfaces.js.map +1 -1
  75. package/dist/components/design/accordion/Accordion.d.ts +3 -2
  76. package/dist/components/design/accordion/Accordion.d.ts.map +1 -1
  77. package/dist/components/design/banners/pageBanner/PageBanner.d.ts +2 -1
  78. package/dist/components/design/banners/pageBanner/PageBanner.d.ts.map +1 -1
  79. package/dist/components/design/card/cardContent/CardContentLine.d.ts +2 -2
  80. package/dist/components/design/card/cardContent/CardContentLine.d.ts.map +1 -1
  81. package/dist/components/design/card/cardHeader/CardHeaderItem.d.ts +2 -2
  82. package/dist/components/design/card/cardHeader/CardHeaderItem.d.ts.map +1 -1
  83. package/dist/components/design/headerBar/HeaderBar.d.ts.map +1 -1
  84. package/dist/components/design/icons/notificationIcon/NotificationIcon.d.ts +2 -2
  85. package/dist/components/design/icons/notificationIcon/NotificationIcon.d.ts.map +1 -1
  86. package/dist/components/design/paginators/Paginator.d.ts +3 -2
  87. package/dist/components/design/paginators/Paginator.d.ts.map +1 -1
  88. package/dist/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.d.ts +2 -1
  89. package/dist/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.d.ts.map +1 -1
  90. package/dist/components/design/revealMore/RevealMoreBelow.d.ts.map +1 -1
  91. package/dist/components/design/revealMore/RevealMoreInline.d.ts.map +1 -1
  92. package/dist/components/design/revealMore/types/revealMoreTypes.d.ts +3 -2
  93. package/dist/components/design/revealMore/types/revealMoreTypes.d.ts.map +1 -1
  94. package/dist/components/design/sidePanel/SidePanel.d.ts +3 -2
  95. package/dist/components/design/sidePanel/SidePanel.d.ts.map +1 -1
  96. package/dist/components/design/statusIndicators/statusIconLabel/StatusIconLabel.d.ts +2 -2
  97. package/dist/components/design/statusIndicators/statusIconLabel/StatusIconLabel.d.ts.map +1 -1
  98. package/dist/components/design/tabs/Tabs.d.ts +3 -3
  99. package/dist/components/design/tabs/Tabs.d.ts.map +1 -1
  100. package/dist/components/design/tooltip/Tooltip.d.ts +5 -4
  101. package/dist/components/design/tooltip/Tooltip.d.ts.map +1 -1
  102. package/dist/components/form/buttons/SimpleButton.test.d.ts +5 -0
  103. package/dist/components/form/buttons/SimpleButton.test.d.ts.map +1 -0
  104. package/dist/components/form/buttons/button.interface.d.ts +3 -3
  105. package/dist/components/form/buttons/button.interface.d.ts.map +1 -1
  106. package/dist/components/form/formFields/formFieldWrapper/formFieldProps.d.ts +2 -1
  107. package/dist/components/form/formFields/formFieldWrapper/formFieldProps.d.ts.map +1 -1
  108. package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.d.ts +29 -0
  109. package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.d.ts.map +1 -0
  110. package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.test.d.ts +5 -0
  111. package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.test.d.ts.map +1 -0
  112. package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.d.ts +52 -0
  113. package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.d.ts.map +1 -0
  114. package/dist/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.d.ts +3 -3
  115. package/dist/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.d.ts.map +1 -1
  116. package/dist/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.d.ts.map +1 -1
  117. package/dist/components/form/formFields/subComponents/inputs/file/fileInputProps.d.ts +4 -3
  118. package/dist/components/form/formFields/subComponents/inputs/file/fileInputProps.d.ts.map +1 -1
  119. package/dist/components/index.d.ts +2 -0
  120. package/dist/components/index.d.ts.map +1 -1
  121. package/dist/components/navigation/menu/Menu.interfaces.d.ts +4 -3
  122. package/dist/components/navigation/menu/Menu.interfaces.d.ts.map +1 -1
  123. package/dist/components/navigation/menu/menuItemContent/MenuItemIcon.d.ts +2 -1
  124. package/dist/components/navigation/menu/menuItemContent/MenuItemIcon.d.ts.map +1 -1
  125. package/dist/components/navigation/menu/menuItemContent/MenuItemIcon.test.d.ts +5 -0
  126. package/dist/components/navigation/menu/menuItemContent/MenuItemIcon.test.d.ts.map +1 -0
  127. package/dist/esm/autoGenerated/libraryThemes.js +12 -12
  128. package/dist/esm/autoGenerated/libraryThemes.js.map +1 -1
  129. package/dist/esm/autoGenerated/libraryThemes.json +12 -12
  130. package/dist/esm/components/design/accordion/Accordion.js +7 -23
  131. package/dist/esm/components/design/accordion/Accordion.js.map +1 -1
  132. package/dist/esm/components/design/banners/pageBanner/PageBanner.js +2 -4
  133. package/dist/esm/components/design/banners/pageBanner/PageBanner.js.map +1 -1
  134. package/dist/esm/components/design/card/cardContent/CardContentLine.js +2 -2
  135. package/dist/esm/components/design/card/cardContent/CardContentLine.js.map +1 -1
  136. package/dist/esm/components/design/card/cardHeader/CardHeaderItem.js +2 -2
  137. package/dist/esm/components/design/card/cardHeader/CardHeaderItem.js.map +1 -1
  138. package/dist/esm/components/design/headerBar/HeaderBar.js +3 -3
  139. package/dist/esm/components/design/headerBar/HeaderBar.js.map +1 -1
  140. package/dist/esm/components/design/icons/notificationIcon/NotificationIcon.js +4 -5
  141. package/dist/esm/components/design/icons/notificationIcon/NotificationIcon.js.map +1 -1
  142. package/dist/esm/components/design/paginators/Paginator.js +4 -12
  143. package/dist/esm/components/design/paginators/Paginator.js.map +1 -1
  144. package/dist/esm/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.js +2 -1
  145. package/dist/esm/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.js.map +1 -1
  146. package/dist/esm/components/design/revealMore/RevealMoreBelow.js +1 -3
  147. package/dist/esm/components/design/revealMore/RevealMoreBelow.js.map +1 -1
  148. package/dist/esm/components/design/revealMore/RevealMoreInline.js +2 -4
  149. package/dist/esm/components/design/revealMore/RevealMoreInline.js.map +1 -1
  150. package/dist/esm/components/design/revealMore/types/revealMoreTypes.js.map +1 -1
  151. package/dist/esm/components/design/sidePanel/SidePanel.js +3 -5
  152. package/dist/esm/components/design/sidePanel/SidePanel.js.map +1 -1
  153. package/dist/esm/components/design/statusIndicators/statusIconLabel/StatusIconLabel.js +6 -11
  154. package/dist/esm/components/design/statusIndicators/statusIconLabel/StatusIconLabel.js.map +1 -1
  155. package/dist/esm/components/design/tabs/Tabs.js +2 -2
  156. package/dist/esm/components/design/tabs/Tabs.js.map +1 -1
  157. package/dist/esm/components/design/themeLoader/ThemeLoader.js +1 -1
  158. package/dist/esm/components/design/themeLoader/ThemeLoader.js.map +1 -1
  159. package/dist/esm/components/design/tooltip/Tooltip.js +4 -11
  160. package/dist/esm/components/design/tooltip/Tooltip.js.map +1 -1
  161. package/dist/esm/components/form/buttons/SimpleButton.js +3 -3
  162. package/dist/esm/components/form/buttons/SimpleButton.js.map +1 -1
  163. package/dist/esm/components/form/buttons/button.interface.js.map +1 -1
  164. package/dist/esm/components/form/formFields/formFieldWrapper/formFieldProps.js.map +1 -1
  165. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js +5 -5
  166. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.js.map +1 -1
  167. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.js +167 -0
  168. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.js.map +1 -0
  169. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/_checkboxSwitchVariables.css +0 -0
  170. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitch.css +306 -0
  171. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.js +2 -0
  172. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/checkboxSwitchProps.js.map +1 -0
  173. package/dist/esm/components/form/formFields/subComponents/inputs/checkbox/inputCheckboxProps.js.map +1 -1
  174. package/dist/esm/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js +3 -5
  175. package/dist/esm/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js.map +1 -1
  176. package/dist/esm/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.js +12 -22
  177. package/dist/esm/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.js.map +1 -1
  178. package/dist/esm/components/form/formFields/subComponents/inputs/file/fileInputProps.js.map +1 -1
  179. package/dist/esm/components/index.js +1 -0
  180. package/dist/esm/components/index.js.map +1 -1
  181. package/dist/esm/components/navigation/menu/Menu.interfaces.js.map +1 -1
  182. package/dist/esm/components/navigation/menu/menuItemContent/MenuItemIcon.js +17 -30
  183. package/dist/esm/components/navigation/menu/menuItemContent/MenuItemIcon.js.map +1 -1
  184. package/dist/esm/helpers/iconHelpers.js +73 -0
  185. package/dist/esm/helpers/iconHelpers.js.map +1 -0
  186. package/dist/esm/helpers/index.js +2 -1
  187. package/dist/esm/helpers/index.js.map +1 -1
  188. package/dist/esm/helpers/objectHelpers.js +7 -3
  189. package/dist/esm/helpers/objectHelpers.js.map +1 -1
  190. package/dist/esm/index.js +3 -3
  191. package/dist/esm/index.js.map +1 -1
  192. package/dist/esm/interfaces/headerText.interface.js.map +1 -1
  193. package/dist/esm/package.json +16 -28
  194. package/dist/esm/styles/index.css +61 -0
  195. package/dist/esm/styles/storybook/storybook.css +7 -0
  196. package/dist/esm/styles/variables/cssVars/_darkModeVariables.css +21 -0
  197. package/dist/esm/styles/variables/cssVars/_formVariables.css +40 -0
  198. package/dist/esm/widgets/processLauncher/ProcessLauncher.js +4 -10
  199. package/dist/esm/widgets/processLauncher/ProcessLauncher.js.map +1 -1
  200. package/dist/esm/widgets/processLauncher/processLauncher.interfaces.js.map +1 -1
  201. package/dist/helpers/iconHelpers.d.ts +30 -0
  202. package/dist/helpers/iconHelpers.d.ts.map +1 -0
  203. package/dist/helpers/iconHelpers.test.d.ts +5 -0
  204. package/dist/helpers/iconHelpers.test.d.ts.map +1 -0
  205. package/dist/helpers/index.d.ts +4 -1
  206. package/dist/helpers/index.d.ts.map +1 -1
  207. package/dist/helpers/objectHelpers.d.ts +10 -3
  208. package/dist/helpers/objectHelpers.d.ts.map +1 -1
  209. package/dist/index.d.ts +6 -3
  210. package/dist/index.d.ts.map +1 -1
  211. package/dist/interfaces/headerText.interface.d.ts +3 -3
  212. package/dist/interfaces/headerText.interface.d.ts.map +1 -1
  213. package/dist/package.json +16 -28
  214. package/dist/widgets/processLauncher/processLauncher.interfaces.d.ts +3 -3
  215. package/dist/widgets/processLauncher/processLauncher.interfaces.d.ts.map +1 -1
  216. package/package.json +16 -28
  217. package/readme.md +0 -36
@@ -137,7 +137,7 @@
137
137
  "files": [
138
138
  "dist"
139
139
  ],
140
- "version": "3.16.1",
140
+ "version": "3.17.0",
141
141
  "devEngines": {
142
142
  "runtime": {
143
143
  "name": "node",
@@ -159,8 +159,6 @@
159
159
  "url": "https://github.com/x15ventures/x15-ui-library.git"
160
160
  },
161
161
  "scripts": {
162
- "library:dev": "pnpm watch && pnpm serve",
163
- "serve": "node localServer/server.js",
164
162
  "watch": "pnpm watch:react && pnpm watch:sass",
165
163
  "watch:react": "nodemon --watch src --ext ts,tsx --exec 'pnpm build:react'",
166
164
  "watch:sass": "nodemon --watch src/styles --ext scss --exec 'pnpm build:sass'",
@@ -196,7 +194,7 @@
196
194
  "react-dom": "18.3.1",
197
195
  "react-helmet": "6.1.0",
198
196
  "run-func": "3.0.0",
199
- "storybook": "10.3.5",
197
+ "storybook": "10.6.1",
200
198
  "use-debounce": "10.1.1"
201
199
  },
202
200
  "peerDependencies": {
@@ -204,7 +202,7 @@
204
202
  "react": "18.3.1",
205
203
  "react-dom": "18.3.1",
206
204
  "react-hook-form": "7.74.0",
207
- "storybook": "10.3.5"
205
+ "storybook": "10.6.1"
208
206
  },
209
207
  "devDependencies": {
210
208
  "@babel/cli": "7.28.6",
@@ -222,8 +220,8 @@
222
220
  "@commitlint/cli": "20.5.2",
223
221
  "@commitlint/config-conventional": "20.5.0",
224
222
  "@eslint/js": "9.39.4",
225
- "@jest/globals": "29.7.0",
226
- "@jest/types": "29.6.3",
223
+ "@jest/globals": "30.5.2",
224
+ "@jest/types": "30.5.1",
227
225
  "@mdx-js/mdx": "3.1.1",
228
226
  "@mdx-js/react": "3.1.1",
229
227
  "@rollup/plugin-commonjs": "28.0.9",
@@ -235,26 +233,20 @@
235
233
  "@semantic-release/git": "10.0.1",
236
234
  "@semantic-release/npm": "12.0.2",
237
235
  "@semantic-release/release-notes-generator": "14.1.0",
238
- "@storybook/addon-a11y": "10.3.5",
239
- "@storybook/addon-docs": "10.3.5",
240
- "@storybook/addon-knobs": "8.0.1",
241
- "@storybook/addon-links": "10.3.5",
242
- "@storybook/addon-styling-webpack": "1.0.1",
243
- "@storybook/cli": "10.3.5",
244
- "@storybook/core-events": "8.6.14",
245
- "@storybook/manager-api": "8.6.14",
236
+ "@storybook/addon-a11y": "10.6.1",
237
+ "@storybook/addon-docs": "10.6.1",
238
+ "@storybook/addon-links": "10.6.1",
239
+ "@storybook/cli": "10.6.1",
246
240
  "@storybook/mdx2-csf": "1.1.0",
247
241
  "@storybook/preset-scss": "1.0.3",
248
- "@storybook/preview-api": "8.6.14",
249
- "@storybook/react": "10.3.5",
250
- "@storybook/react-webpack5": "10.3.5",
251
- "@storybook/types": "8.6.14",
242
+ "@storybook/react": "10.6.1",
243
+ "@storybook/react-webpack5": "10.6.1",
252
244
  "@testing-library/jest-dom": "6.9.1",
253
245
  "@testing-library/react": "16.3.2",
254
246
  "@testing-library/user-event": "14.6.1",
255
247
  "@types/enzyme": "3.10.19",
256
248
  "@types/enzyme-adapter-react-16": "1.0.9",
257
- "@types/jest": "29.5.14",
249
+ "@types/jest": "30.0.0",
258
250
  "@types/node": "20.19.39",
259
251
  "@types/react": "18.3.28",
260
252
  "@types/react-dom": "18.3.7",
@@ -265,13 +257,11 @@
265
257
  "@typescript-eslint/parser": "8.59.1",
266
258
  "@x15stack/aws": "1.7.2",
267
259
  "autoprefixer": "10.5.0",
268
- "babel-jest": "30.3.0",
260
+ "babel-jest": "30.5.2",
269
261
  "babel-loader": "9.2.1",
270
262
  "babel-plugin-macros": "3.1.0",
271
263
  "chromatic": "11.29.0",
272
264
  "commitlint": "20.5.3",
273
- "copy-webpack-plugin": "12.0.2",
274
- "cors": "2.8.6",
275
265
  "cross-env": "7.0.3",
276
266
  "css-loader": "7.1.4",
277
267
  "enzyme": "3.11.0",
@@ -285,14 +275,13 @@
285
275
  "eslint-plugin-jsx-a11y": "6.10.2",
286
276
  "eslint-plugin-react": "7.37.5",
287
277
  "eslint-plugin-storybook": "10.1.10",
288
- "express": "5.2.1",
289
278
  "file-loader": "6.2.0",
290
279
  "fs": "0.0.1-security",
291
280
  "fs-extra": "11.3.4",
292
281
  "glob": "13.0.6",
293
282
  "globals": "15.15.0",
294
- "jest": "30.3.0",
295
- "jest-environment-jsdom": "29.7.0",
283
+ "jest": "30.5.2",
284
+ "jest-environment-jsdom": "30.5.2",
296
285
  "lefthook": "1.13.6",
297
286
  "minimatch": "9.0.7",
298
287
  "nodemon": "3.1.14",
@@ -309,8 +298,7 @@
309
298
  "sass-loader": "16.0.7",
310
299
  "semantic-release": "24.2.9",
311
300
  "style-loader": "4.0.0",
312
- "ts-jest": "29.4.9",
313
- "ts-morph": "25.0.1",
301
+ "ts-jest": "29.4.14",
314
302
  "tsconfig-paths-webpack-plugin": "4.2.0",
315
303
  "ttab": "0.9.0",
316
304
  "typescript": "5.5.4",
@@ -284,6 +284,46 @@
284
284
  --autocompleteOptionHoverFg: #181a1b;
285
285
  --autocompleteOptionSelectedBg: #e5ebef;
286
286
  --autocompleteOptionSelectedFg: #181a1b;
287
+ --checkboxSwitchTransition: 0.2s ease;
288
+ --checkboxSwitchBorder: 1px solid #e5ebef;
289
+ --checkboxSwitchRectangularRadius: 5px;
290
+ --checkboxSwitchStateGap: 5px;
291
+ --checkboxSwitchDisabledOpacity: 0.5;
292
+ --checkboxSwitchButtonInactiveOpacity: 0.4;
293
+ --checkboxSwitchThumbGapXs: 1px;
294
+ --checkboxSwitchThumbGapS: 2px;
295
+ --checkboxSwitchThumbGapM: 3px;
296
+ --checkboxSwitchThumbGapL: 4px;
297
+ --checkboxSwitchThumbGapXl: 5px;
298
+ --checkboxSwitchTrackBg: #e5ebef;
299
+ --checkboxSwitchTrackFgColor: #24282b;
300
+ --checkboxSwitchTrackCheckedBg: #516472;
301
+ --checkboxSwitchTrackCheckedFgColor: #fff;
302
+ --checkboxSwitchThumbBg: #fff;
303
+ --checkboxSwitchThumbShadow: 0 1px 3px rgba(0, 0, 0, 0.35);
304
+ --checkboxSwitchRockerRaisedBg: linear-gradient(to bottom, #fff 0%, #f6f8fa 60%, #e5ebef 100%);
305
+ --checkboxSwitchRockerRaisedFgColor: #384147;
306
+ --checkboxSwitchRockerPressedBg: linear-gradient(to bottom, #c2d0d9 0%, #d3dee4 35%, #e5ebef 100%);
307
+ --checkboxSwitchRockerPressedFgColor: #181a1b;
308
+ --checkboxSwitchRockerCheckedPressedBg: linear-gradient(to bottom, #24282b 0%, #384147 35%, #516472 100%);
309
+ --checkboxSwitchRockerCheckedPressedFgColor: #fff;
310
+ --checkboxSwitchGlowTrackBg: linear-gradient(to bottom, #384147 0%, #24282b 100%);
311
+ --checkboxSwitchGlowInactiveFgColor: #7e97a7;
312
+ --checkboxSwitchGlowOffFgColor: #e5ebef;
313
+ --checkboxSwitchGlowOnFgColor: #e8fff2;
314
+ --checkboxSwitchGlowColor: #2bff88;
315
+ --checkboxSwitchGlowRadius: 5px;
316
+ --checkboxSwitchGlowLightTrackBg: linear-gradient(to bottom, #fff 0%, #eef2f4 100%);
317
+ --checkboxSwitchGlowLightInactiveFgColor: #7e97a7;
318
+ --checkboxSwitchGlowLightOffFgColor: #24282b;
319
+ --checkboxSwitchPowerButtonBezelBg: conic-gradient(from -45deg, #fff 0%, #ddd 50%, #fff 100%);
320
+ --checkboxSwitchPowerButtonCapBg: radial-gradient(circle at bottom right, #fff 0%, #ddd 50%, #ccc 100%);
321
+ --checkboxSwitchPowerButtonCapBorder: 1px solid #ddd;
322
+ --checkboxSwitchPowerButtonCapInset: 15%;
323
+ --checkboxSwitchPowerButtonOffFgColor: #ccc;
324
+ --checkboxSwitchPowerButtonOffShadow: 0 0 1px #888;
325
+ --checkboxSwitchPowerButtonOnFgColor: #f00;
326
+ --checkboxSwitchPowerButtonOnShadow: 0 0 1px #030;
287
327
  --inputTransition: none;
288
328
  --inputHeight: 44px;
289
329
  --inputPadding: 0 14px;
@@ -449,6 +489,27 @@
449
489
  --checkboxBg: #000000;
450
490
  --checkboxBorderColor: #000000;
451
491
  --checkboxFgColor: #000000;
492
+ --checkboxSwitchBorder: 1px solid #3d2f26;
493
+ --checkboxSwitchGlowInactiveFgColor: #8a7f78;
494
+ --checkboxSwitchGlowOffFgColor: #dbd7d5;
495
+ --checkboxSwitchGlowTrackBg: linear-gradient(to bottom, #1a1410 0%, #000000 100%);
496
+ --checkboxSwitchPowerButtonBezelBg: conic-gradient(from -45deg, #3d2f26 0%, #110d0b 50%, #3d2f26 100%);
497
+ --checkboxSwitchPowerButtonCapBg: radial-gradient(circle at bottom right, #3d2f26 0%, #1a1410 50%, #000000 100%);
498
+ --checkboxSwitchPowerButtonCapBorder: 1px solid #2c211b;
499
+ --checkboxSwitchPowerButtonOffFgColor: #5c514a;
500
+ --checkboxSwitchPowerButtonOffShadow: 0 0 1px #000000;
501
+ --checkboxSwitchPowerButtonOnShadow: 0 0 5px rgba(255, 0, 0, 0.6);
502
+ --checkboxSwitchRockerCheckedPressedBg: linear-gradient(to bottom, #a8a8a8 0%, #c4c4c4 35%, #dddddd 100%);
503
+ --checkboxSwitchRockerCheckedPressedFgColor: #000000;
504
+ --checkboxSwitchRockerPressedBg: linear-gradient(to bottom, #000000 0%, #0b0807 35%, #1a1410 100%);
505
+ --checkboxSwitchRockerPressedFgColor: #dddddd;
506
+ --checkboxSwitchRockerRaisedBg: linear-gradient(to bottom, #3d2f26 0%, #2c211b 60%, #1a1410 100%);
507
+ --checkboxSwitchRockerRaisedFgColor: #dbd7d5;
508
+ --checkboxSwitchThumbBg: #dddddd;
509
+ --checkboxSwitchTrackBg: #110d0b;
510
+ --checkboxSwitchTrackCheckedBg: #3d2f26;
511
+ --checkboxSwitchTrackCheckedFgColor: #e7e5e4;
512
+ --checkboxSwitchTrackFgColor: #dbd7d5;
452
513
  --chipBlack: #dddddd;
453
514
  --chipBlue: #009b00;
454
515
  --chipBlueSoftBg: #25401b;
@@ -391,4 +391,11 @@ body.sb-show-main.withSidePanels.sidePanel_l_bottom .innerZoomElementWrapper {
391
391
  .reportFooterStories p {
392
392
  font-size: 13px;
393
393
  margin: 0 0 10px;
394
+ }
395
+
396
+ .checkboxSwitchStory {
397
+ margin: 0 0 30px;
398
+ }
399
+ .checkboxSwitchStory .checkboxSwitchField {
400
+ margin: 0 0 5px;
394
401
  }
@@ -72,6 +72,27 @@
72
72
  --checkboxBg: #000000;
73
73
  --checkboxBorderColor: #000000;
74
74
  --checkboxFgColor: #000000;
75
+ --checkboxSwitchBorder: 1px solid #3d2f26;
76
+ --checkboxSwitchGlowInactiveFgColor: #8a7f78;
77
+ --checkboxSwitchGlowOffFgColor: #dbd7d5;
78
+ --checkboxSwitchGlowTrackBg: linear-gradient(to bottom, #1a1410 0%, #000000 100%);
79
+ --checkboxSwitchPowerButtonBezelBg: conic-gradient(from -45deg, #3d2f26 0%, #110d0b 50%, #3d2f26 100%);
80
+ --checkboxSwitchPowerButtonCapBg: radial-gradient(circle at bottom right, #3d2f26 0%, #1a1410 50%, #000000 100%);
81
+ --checkboxSwitchPowerButtonCapBorder: 1px solid #2c211b;
82
+ --checkboxSwitchPowerButtonOffFgColor: #5c514a;
83
+ --checkboxSwitchPowerButtonOffShadow: 0 0 1px #000000;
84
+ --checkboxSwitchPowerButtonOnShadow: 0 0 5px rgba(255, 0, 0, 0.6);
85
+ --checkboxSwitchRockerCheckedPressedBg: linear-gradient(to bottom, #a8a8a8 0%, #c4c4c4 35%, #dddddd 100%);
86
+ --checkboxSwitchRockerCheckedPressedFgColor: #000000;
87
+ --checkboxSwitchRockerPressedBg: linear-gradient(to bottom, #000000 0%, #0b0807 35%, #1a1410 100%);
88
+ --checkboxSwitchRockerPressedFgColor: #dddddd;
89
+ --checkboxSwitchRockerRaisedBg: linear-gradient(to bottom, #3d2f26 0%, #2c211b 60%, #1a1410 100%);
90
+ --checkboxSwitchRockerRaisedFgColor: #dbd7d5;
91
+ --checkboxSwitchThumbBg: #dddddd;
92
+ --checkboxSwitchTrackBg: #110d0b;
93
+ --checkboxSwitchTrackCheckedBg: #3d2f26;
94
+ --checkboxSwitchTrackCheckedFgColor: #e7e5e4;
95
+ --checkboxSwitchTrackFgColor: #dbd7d5;
75
96
  --chipBlack: #dddddd;
76
97
  --chipBlue: #009b00;
77
98
  --chipBlueSoftBg: #25401b;
@@ -13,6 +13,46 @@
13
13
  --autocompleteOptionHoverFg: #181a1b;
14
14
  --autocompleteOptionSelectedBg: #e5ebef;
15
15
  --autocompleteOptionSelectedFg: #181a1b;
16
+ --checkboxSwitchTransition: 0.2s ease;
17
+ --checkboxSwitchBorder: 1px solid #e5ebef;
18
+ --checkboxSwitchRectangularRadius: 5px;
19
+ --checkboxSwitchStateGap: 5px;
20
+ --checkboxSwitchDisabledOpacity: 0.5;
21
+ --checkboxSwitchButtonInactiveOpacity: 0.4;
22
+ --checkboxSwitchThumbGapXs: 1px;
23
+ --checkboxSwitchThumbGapS: 2px;
24
+ --checkboxSwitchThumbGapM: 3px;
25
+ --checkboxSwitchThumbGapL: 4px;
26
+ --checkboxSwitchThumbGapXl: 5px;
27
+ --checkboxSwitchTrackBg: #e5ebef;
28
+ --checkboxSwitchTrackFgColor: #24282b;
29
+ --checkboxSwitchTrackCheckedBg: #516472;
30
+ --checkboxSwitchTrackCheckedFgColor: #fff;
31
+ --checkboxSwitchThumbBg: #fff;
32
+ --checkboxSwitchThumbShadow: 0 1px 3px rgba(0, 0, 0, 0.35);
33
+ --checkboxSwitchRockerRaisedBg: linear-gradient(to bottom, #fff 0%, #f6f8fa 60%, #e5ebef 100%);
34
+ --checkboxSwitchRockerRaisedFgColor: #384147;
35
+ --checkboxSwitchRockerPressedBg: linear-gradient(to bottom, #c2d0d9 0%, #d3dee4 35%, #e5ebef 100%);
36
+ --checkboxSwitchRockerPressedFgColor: #181a1b;
37
+ --checkboxSwitchRockerCheckedPressedBg: linear-gradient(to bottom, #24282b 0%, #384147 35%, #516472 100%);
38
+ --checkboxSwitchRockerCheckedPressedFgColor: #fff;
39
+ --checkboxSwitchGlowTrackBg: linear-gradient(to bottom, #384147 0%, #24282b 100%);
40
+ --checkboxSwitchGlowInactiveFgColor: #7e97a7;
41
+ --checkboxSwitchGlowOffFgColor: #e5ebef;
42
+ --checkboxSwitchGlowOnFgColor: #e8fff2;
43
+ --checkboxSwitchGlowColor: #2bff88;
44
+ --checkboxSwitchGlowRadius: 5px;
45
+ --checkboxSwitchGlowLightTrackBg: linear-gradient(to bottom, #fff 0%, #eef2f4 100%);
46
+ --checkboxSwitchGlowLightInactiveFgColor: #7e97a7;
47
+ --checkboxSwitchGlowLightOffFgColor: #24282b;
48
+ --checkboxSwitchPowerButtonBezelBg: conic-gradient(from -45deg, #fff 0%, #ddd 50%, #fff 100%);
49
+ --checkboxSwitchPowerButtonCapBg: radial-gradient(circle at bottom right, #fff 0%, #ddd 50%, #ccc 100%);
50
+ --checkboxSwitchPowerButtonCapBorder: 1px solid #ddd;
51
+ --checkboxSwitchPowerButtonCapInset: 15%;
52
+ --checkboxSwitchPowerButtonOffFgColor: #ccc;
53
+ --checkboxSwitchPowerButtonOffShadow: 0 0 1px #888;
54
+ --checkboxSwitchPowerButtonOnFgColor: #f00;
55
+ --checkboxSwitchPowerButtonOnShadow: 0 0 1px #030;
16
56
  --inputTransition: none;
17
57
  --inputHeight: 44px;
18
58
  --inputPadding: 0 14px;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback, useEffect, useRef } from 'react';
3
3
  import { useFormContext } from 'react-hook-form';
4
- import { Icon, SimpleButton, Dialog, CircularProgressIndicator } from '../../components';
4
+ import { SimpleButton, Dialog, CircularProgressIndicator } from '../../components';
5
5
  /*
6
6
  ProcessLauncher is a component that provides a UI for launching an process.
7
7
  It displays a button that opens a modal for launching the process when the process is in the 'prelaunch' state.
@@ -13,16 +13,12 @@ const defaultLaunchButtonProps = {
13
13
  cssClass: 'button outline icon-only processLauncherButton',
14
14
  hideLabel: true,
15
15
  size: 'default',
16
- icon: /*#__PURE__*/React.createElement(Icon, {
17
- icon: "magic-wand"
18
- })
16
+ icon: 'magic-wand'
19
17
  };
20
18
  const defaultProgressIndicatorProps = {
21
19
  size: 'small',
22
20
  hideLabel: true,
23
- icon: /*#__PURE__*/React.createElement(Icon, {
24
- icon: "magic-wand"
25
- })
21
+ icon: 'magic-wand'
26
22
  };
27
23
  export const ProcessLauncher = ({
28
24
  initialStatus = 'idle',
@@ -221,9 +217,7 @@ export const ProcessLauncher = ({
221
217
  className: `processLauncher ${launchButtonProps.size || 'default'}`
222
218
  }, (status === 'idle' || status === 'prelaunch') && /*#__PURE__*/React.createElement(SimpleButton, _extends({}, defaultLaunchButtonProps, launchButtonProps, {
223
219
  cssClass: getLaunchButtonClassName(),
224
- leftIcon: {
225
- icon: launchButtonProps.icon || defaultLaunchButtonProps.icon
226
- },
220
+ leftIcon: launchButtonProps.icon || defaultLaunchButtonProps.icon,
227
221
  id: `processLauncherButton_${processDefinition.id}`,
228
222
  label: `Launch ${processDefinition.name}`,
229
223
  onClickHandler: preRequisiteFieldIds.length > 0 ? handlePreLaunchTriggered : handleLaunch
@@ -1 +1 @@
1
- {"version":3,"file":"ProcessLauncher.js","names":["React","useCallback","useEffect","useRef","useFormContext","Icon","SimpleButton","Dialog","CircularProgressIndicator","defaultLaunchButtonProps","cssClass","hideLabel","size","icon","createElement","defaultProgressIndicatorProps","ProcessLauncher","initialStatus","statusMessage","processDefinition","launchButtonProps","progressIndicatorProps","onLaunch","onCancel","progressUpdateMode","onProgressCheck","progressSubscription","onProgressIndicatorClick","preRequisiteFieldIds","preRequisitesDialogTitle","children","id","processId","isDialogOpen","setIsDialogOpen","useState","status","setStatus","currentProgress","setCurrentProgress","launchAttemptRef","formContext","handleCancel","current","handlePreLaunchTriggered","handleLaunch","launchAttempt","length","fieldValues","trigger","getFieldState","setFocus","isValid","firstInvalidFieldId","find","fieldId","invalid","Object","fromEntries","map","getValues","progressCheckIntervalRef","progressUnsubscribeRef","turnOffProgressCheck","clearInterval","turnOffProgressSubscription","handleProgressUpdate","progress","updatedProgress","explicitStatus","undefined","turnOnProgressCheck","inFlight","active","setInterval","then","catch","e","console","error","finally","turnOnProgressSubscription","subscribe","eventName","onProgress","onError","handleResetLauncher","isProgressActive","stopProgressCheck","getLaunchButtonClassName","baseProgressIndicatorProps","name","className","_extends","leftIcon","label","onClickHandler","customCssClasses","dialog","open","onClose","header","footer","mode"],"sources":["../../../../src/widgets/processLauncher/ProcessLauncher.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useEffect, useRef } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { Icon, SimpleButton, Dialog, CircularProgressIndicator } from '../../components';\n\nimport {\n ProcessDefinition,\n ProcessLaunchButtonProps,\n ProcessLauncherProgressProps,\n ProcessProgressIndicatorProps, ProcessProgressUpdate, ProcessStatus\n} from './processLauncher.interfaces';\n\nexport type ProcessLauncherProps = {\n initialStatus?: ProcessStatus;\n statusMessage?: string;\n processDefinition: ProcessDefinition;\n launchButtonProps?: ProcessLaunchButtonProps;\n progressIndicatorProps?: ProcessProgressIndicatorProps;\n /* eslint-disable-next-line no-unused-vars */\n onLaunch: (params: {processId: string, fieldValues: Record<string, unknown>}) => void;\n onCancel: () => void;\n onProgressIndicatorClick?: () => void;\n preRequisiteFieldIds?: string[];\n preRequisitesDialogTitle?: string;\n children: ReactNode;\n} & ProcessLauncherProgressProps;\n\n/*\n ProcessLauncher is a component that provides a UI for launching an process.\n It displays a button that opens a modal for launching the process when the process is in the 'prelaunch' state.\n It displays a CircularProgressIndicator when the process is in other states (running, complete, warning, error).\n The dialog contains a form for configuring the process before launching it. The form is passed as children to the ProcessLauncher component.\n */\n\nconst defaultLaunchButtonProps: ProcessLaunchButtonProps = {\n cssClass: 'button outline icon-only processLauncherButton',\n hideLabel: true,\n size: 'default',\n icon: <Icon icon=\"magic-wand\" />\n};\n\nconst defaultProgressIndicatorProps: ProcessProgressIndicatorProps = {\n size: 'small',\n hideLabel: true,\n icon: <Icon icon=\"magic-wand\" />\n};\n\nexport const ProcessLauncher: React.FC<ProcessLauncherProps> = (\n {\n initialStatus = 'idle',\n statusMessage = '',\n processDefinition,\n launchButtonProps = {},\n progressIndicatorProps = {},\n onLaunch = () => {},\n onCancel = () => {},\n progressUpdateMode = 'fetch',\n onProgressCheck,\n progressSubscription,\n onProgressIndicatorClick,\n preRequisiteFieldIds = [],\n preRequisitesDialogTitle = 'Launch Process',\n children\n }\n) => {\n const { id: processId } = processDefinition;\n\n const [isDialogOpen, setIsDialogOpen] = React.useState(false);\n const [status, setStatus] = React.useState<ProcessStatus>(initialStatus);\n const [currentProgress, setCurrentProgress] = React.useState<number>(0);\n const launchAttemptRef = useRef(0);\n\n const formContext = useFormContext();\n\n const handleCancel = () => {\n launchAttemptRef.current += 1;\n setIsDialogOpen(false);\n setStatus('idle');\n onCancel();\n };\n\n const handlePreLaunchTriggered = () => {\n launchAttemptRef.current += 1;\n setStatus('prelaunch');\n setIsDialogOpen(true);\n };\n\n const handleLaunch = async () => {\n const launchAttempt = ++launchAttemptRef.current;\n // Validate the form data here if needed before launching the process\n // Get the field values from the form and pass them to the onLaunch function\n // Loop through the preRequisiteFieldIds and check if they have values in the form\n // Also bundle the values of the preRequisiteFieldIds and pass them to the onLaunch function\n if (preRequisiteFieldIds.length === 0) {\n // If there are no preRequisiteFieldIds, we can launch the process without any validation\n setIsDialogOpen(false);\n setStatus('running');\n onLaunch({ processId, fieldValues: {} });\n return;\n }\n\n const { trigger, getFieldState, setFocus } = formContext;\n const isValid = await trigger(preRequisiteFieldIds);\n if (launchAttempt !== launchAttemptRef.current) return;\n\n if (!isValid) {\n const firstInvalidFieldId = preRequisiteFieldIds.find((fieldId) => getFieldState(fieldId).invalid);\n if (firstInvalidFieldId) setFocus(firstInvalidFieldId);\n return;\n }\n\n setIsDialogOpen(false);\n setStatus('running');\n setCurrentProgress(0);\n\n const fieldValues = Object.fromEntries(\n preRequisiteFieldIds.map((fieldId) => [fieldId, formContext.getValues(fieldId)])\n );\n onLaunch({ processId, fieldValues });\n };\n\n // Ref (not a render-scoped let) so every closure clears the same interval handle\n const progressCheckIntervalRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const progressUnsubscribeRef = useRef<(() => void) | null>(null);\n\n const turnOffProgressCheck = useCallback(() => {\n if (progressCheckIntervalRef.current) {\n clearInterval(progressCheckIntervalRef.current);\n progressCheckIntervalRef.current = null;\n }\n }, []);\n\n const turnOffProgressSubscription = useCallback(() => {\n if (progressUnsubscribeRef.current) {\n progressUnsubscribeRef.current();\n progressUnsubscribeRef.current = null;\n }\n }, []);\n\n const handleProgressUpdate = useCallback(({ progress: updatedProgress, status: explicitStatus }: ProcessProgressUpdate) => {\n if (updatedProgress === undefined || updatedProgress === null) {\n setStatus('error');\n return;\n }\n\n setCurrentProgress(updatedProgress);\n\n // An explicit status (e.g. warning) always wins over the value inferred from progress alone.\n if (explicitStatus) {\n setStatus(explicitStatus);\n if (explicitStatus === 'complete' || explicitStatus === 'error') {\n turnOffProgressCheck();\n turnOffProgressSubscription();\n }\n return;\n }\n\n if (updatedProgress === 100) {\n setStatus('complete');\n turnOffProgressCheck();\n turnOffProgressSubscription();\n } else if (updatedProgress >= 0 && updatedProgress < 100) {\n setStatus('running');\n }\n }, [setStatus, setCurrentProgress, turnOffProgressCheck, turnOffProgressSubscription]);\n\n const turnOnProgressCheck = useCallback(() => {\n turnOffProgressCheck();\n let inFlight = false;\n let active = true;\n progressCheckIntervalRef.current = setInterval(() => {\n if (inFlight || !active) return;\n inFlight = true;\n onProgressCheck?.().then((updatedProgress) => {\n if (active) handleProgressUpdate({ progress: updatedProgress });\n }).catch((e) => {\n if (active) {\n console.error('Error getting process progress', e);\n setStatus('error');\n }\n }).finally(() => {\n inFlight = false;\n });\n }, 1000);\n return () => {\n active = false;\n turnOffProgressCheck();\n };\n }, [turnOffProgressCheck, onProgressCheck, handleProgressUpdate]);\n\n const turnOnProgressSubscription = useCallback(() => {\n turnOffProgressSubscription();\n if (!progressSubscription) {\n console.error('progressUpdateMode is \"subscribe\" but no progressSubscription was provided');\n return;\n }\n\n progressUnsubscribeRef.current = progressSubscription.subscribe(\n progressSubscription.eventName,\n {\n onProgress: handleProgressUpdate,\n onError: () => setStatus('error')\n }\n );\n }, [turnOffProgressSubscription, progressSubscription, handleProgressUpdate]);\n\n const handleResetLauncher = () => {\n setStatus('idle');\n setCurrentProgress(0);\n turnOffProgressCheck();\n turnOffProgressSubscription();\n };\n\n // 'warning' is a non-terminal state pushed mid-run, so treat it the same as 'running' here.\n const isProgressActive = status === 'running' || status === 'warning';\n\n useEffect(() => {\n // Depending on the derived boolean (not `status` itself) avoids tearing down and\n // re-establishing the poll/subscription when moving between 'running' and 'warning'.\n let stopProgressCheck: (() => void) | undefined;\n if (isProgressActive) {\n if (progressUpdateMode === 'subscribe') {\n turnOnProgressSubscription();\n } else {\n stopProgressCheck = turnOnProgressCheck();\n }\n } else {\n turnOffProgressCheck();\n turnOffProgressSubscription();\n }\n return () => {\n stopProgressCheck?.();\n turnOffProgressSubscription();\n };\n }, [isProgressActive, progressUpdateMode, turnOnProgressCheck, turnOnProgressSubscription, turnOffProgressCheck, turnOffProgressSubscription]);\n\n const getLaunchButtonClassName = () => {\n if (launchButtonProps.cssClass) {\n return launchButtonProps.cssClass;\n }\n\n return launchButtonProps.size === 'xsmall'\n ? `${ defaultLaunchButtonProps.cssClass } compact`\n : defaultLaunchButtonProps.cssClass;\n };\n\n const baseProgressIndicatorProps = {\n ...defaultProgressIndicatorProps,\n ...progressIndicatorProps,\n statusMessage,\n id: `processLauncherProgressIndicator_${ processDefinition.id }`,\n name: processDefinition.name,\n progress: currentProgress,\n };\n\n return (\n <div className={ `processLauncher ${ launchButtonProps.size || 'default' }` }>\n {\n (status === 'idle' || status === 'prelaunch') &&\n <SimpleButton\n {\n ...{\n ...defaultLaunchButtonProps,\n ...launchButtonProps,\n }\n }\n cssClass={ getLaunchButtonClassName() }\n leftIcon={ { icon: launchButtonProps.icon || defaultLaunchButtonProps.icon } }\n id={ `processLauncherButton_${ processDefinition.id }` }\n label={ `Launch ${ processDefinition.name }` }\n onClickHandler={\n preRequisiteFieldIds.length > 0 ? handlePreLaunchTriggered : handleLaunch\n }\n />\n }\n\n {\n status === 'prelaunch' && (\n <Dialog\n customCssClasses={ { dialog: 'processLauncherDialog' } }\n open={ isDialogOpen }\n id={ `processLauncherDialog_${ processDefinition.id }` }\n size=\"m\"\n onClose={ handleCancel }\n header={ preRequisitesDialogTitle }\n footer={\n <div className=\"actionButtons\">\n <SimpleButton id={ `processLauncherDialogCancelButton_${ processDefinition.id }` } label=\"Cancel\" onClickHandler={ handleCancel } cssClass=\"secondary outline\" />\n <SimpleButton id={ `processLauncherDialogLaunchButton_${ processDefinition.id }` } label=\"Launch process\" onClickHandler={ handleLaunch } cssClass=\"primary\" />\n </div>\n }\n >\n <div className=\"processLauncherPrerequisites\">\n { children }\n </div>\n </Dialog>\n )\n }\n\n { status === 'running' && (\n <CircularProgressIndicator\n {\n ...{\n ...baseProgressIndicatorProps\n }\n }\n mode=\"default\"\n onClickHandler={ onProgressIndicatorClick }\n />\n ) }\n\n { status === 'warning' && (\n <CircularProgressIndicator\n {\n ...{\n ...baseProgressIndicatorProps\n }\n }\n mode=\"warning\"\n onClickHandler={ onProgressIndicatorClick }\n />\n ) }\n\n { status === 'complete' && (\n <CircularProgressIndicator\n {\n ...{\n ...baseProgressIndicatorProps\n }\n }\n mode=\"success\"\n onClickHandler={ handleResetLauncher }\n />\n ) }\n\n { status === 'error' && (\n <CircularProgressIndicator\n {\n ...{\n ...baseProgressIndicatorProps\n }\n }\n mode=\"error\"\n onClickHandler={ handleResetLauncher }\n />\n ) }\n </div>\n );\n};\n\nexport default ProcessLauncher;"],"mappings":";AAAA,OAAOA,KAAK,IAAeC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACxE,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,IAAI,EAAEC,YAAY,EAAEC,MAAM,EAAEC,yBAAyB,QAAQ,kBAAkB;AAwBxF;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,wBAAkD,GAAG;EACzDC,QAAQ,EAAE,gDAAgD;EAC1DC,SAAS,EAAE,IAAI;EACfC,IAAI,EAAE,SAAS;EACfC,IAAI,eAAEb,KAAA,CAAAc,aAAA,CAACT,IAAI;IAACQ,IAAI,EAAC;EAAY,CAAE;AACjC,CAAC;AAED,MAAME,6BAA4D,GAAG;EACnEH,IAAI,EAAE,OAAO;EACbD,SAAS,EAAE,IAAI;EACfE,IAAI,eAAEb,KAAA,CAAAc,aAAA,CAACT,IAAI;IAACQ,IAAI,EAAC;EAAY,CAAE;AACjC,CAAC;AAED,OAAO,MAAMG,eAA+C,GAAGA,CAC7D;EACEC,aAAa,GAAG,MAAM;EACtBC,aAAa,GAAG,EAAE;EAClBC,iBAAiB;EACjBC,iBAAiB,GAAG,CAAC,CAAC;EACtBC,sBAAsB,GAAG,CAAC,CAAC;EAC3BC,QAAQ,GAAGA,CAAA,KAAM,CAAC,CAAC;EACnBC,QAAQ,GAAGA,CAAA,KAAM,CAAC,CAAC;EACnBC,kBAAkB,GAAG,OAAO;EAC5BC,eAAe;EACfC,oBAAoB;EACpBC,wBAAwB;EACxBC,oBAAoB,GAAG,EAAE;EACzBC,wBAAwB,GAAG,gBAAgB;EAC3CC;AACF,CA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,CAACN,yBAAyB,EAAAqF,QAAA,KAGjBH,0BAA0B;IAGjCa,IAAI,EAAC,SAAS;IACdP,cAAc,EAAGrE;EAA0B,EAC5C,CACF,EAECS,MAAM,KAAK,UAAU,iBACrBpC,KAAA,CAAAc,aAAA,CAACN,yBAAyB,EAAAqF,QAAA,KAGjBH,0BAA0B;IAGjCa,IAAI,EAAC,SAAS;IACdP,cAAc,EAAGV;EAAqB,EACvC,CACF,EAEClD,MAAM,KAAK,OAAO,iBAClBpC,KAAA,CAAAc,aAAA,CAACN,yBAAyB,EAAAqF,QAAA,KAGjBH,0BAA0B;IAGjCa,IAAI,EAAC,OAAO;IACZP,cAAc,EAAGV;EAAqB,EACvC,CAEA,CAAC;AAEV,CAAC;AAED,eAAetE,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"ProcessLauncher.js","names":["React","useCallback","useEffect","useRef","useFormContext","SimpleButton","Dialog","CircularProgressIndicator","defaultLaunchButtonProps","cssClass","hideLabel","size","icon","defaultProgressIndicatorProps","ProcessLauncher","initialStatus","statusMessage","processDefinition","launchButtonProps","progressIndicatorProps","onLaunch","onCancel","progressUpdateMode","onProgressCheck","progressSubscription","onProgressIndicatorClick","preRequisiteFieldIds","preRequisitesDialogTitle","children","id","processId","isDialogOpen","setIsDialogOpen","useState","status","setStatus","currentProgress","setCurrentProgress","launchAttemptRef","formContext","handleCancel","current","handlePreLaunchTriggered","handleLaunch","launchAttempt","length","fieldValues","trigger","getFieldState","setFocus","isValid","firstInvalidFieldId","find","fieldId","invalid","Object","fromEntries","map","getValues","progressCheckIntervalRef","progressUnsubscribeRef","turnOffProgressCheck","clearInterval","turnOffProgressSubscription","handleProgressUpdate","progress","updatedProgress","explicitStatus","undefined","turnOnProgressCheck","inFlight","active","setInterval","then","catch","e","console","error","finally","turnOnProgressSubscription","subscribe","eventName","onProgress","onError","handleResetLauncher","isProgressActive","stopProgressCheck","getLaunchButtonClassName","baseProgressIndicatorProps","name","createElement","className","_extends","leftIcon","label","onClickHandler","customCssClasses","dialog","open","onClose","header","footer","mode"],"sources":["../../../../src/widgets/processLauncher/ProcessLauncher.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useEffect, useRef } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { SimpleButton, Dialog, CircularProgressIndicator } from '../../components';\n\nimport {\n ProcessDefinition,\n ProcessLaunchButtonProps,\n ProcessLauncherProgressProps,\n ProcessProgressIndicatorProps, ProcessProgressUpdate, ProcessStatus\n} from './processLauncher.interfaces';\n\nexport type ProcessLauncherProps = {\n initialStatus?: ProcessStatus;\n statusMessage?: string;\n processDefinition: ProcessDefinition;\n launchButtonProps?: ProcessLaunchButtonProps;\n progressIndicatorProps?: ProcessProgressIndicatorProps;\n /* eslint-disable-next-line no-unused-vars */\n onLaunch: (params: {processId: string, fieldValues: Record<string, unknown>}) => void;\n onCancel: () => void;\n onProgressIndicatorClick?: () => void;\n preRequisiteFieldIds?: string[];\n preRequisitesDialogTitle?: string;\n children: ReactNode;\n} & ProcessLauncherProgressProps;\n\n/*\n ProcessLauncher is a component that provides a UI for launching an process.\n It displays a button that opens a modal for launching the process when the process is in the 'prelaunch' state.\n It displays a CircularProgressIndicator when the process is in other states (running, complete, warning, error).\n The dialog contains a form for configuring the process before launching it. The form is passed as children to the ProcessLauncher component.\n */\n\nconst defaultLaunchButtonProps: ProcessLaunchButtonProps = {\n cssClass: 'button outline icon-only processLauncherButton',\n hideLabel: true,\n size: 'default',\n icon: 'magic-wand'\n};\n\nconst defaultProgressIndicatorProps: ProcessProgressIndicatorProps = {\n size: 'small',\n hideLabel: true,\n icon: 'magic-wand'\n};\n\nexport const ProcessLauncher: React.FC<ProcessLauncherProps> = (\n {\n initialStatus = 'idle',\n statusMessage = '',\n processDefinition,\n launchButtonProps = {},\n progressIndicatorProps = {},\n onLaunch = () => {},\n onCancel = () => {},\n progressUpdateMode = 'fetch',\n onProgressCheck,\n progressSubscription,\n onProgressIndicatorClick,\n preRequisiteFieldIds = [],\n preRequisitesDialogTitle = 'Launch Process',\n children\n }\n) => {\n const { id: processId } = processDefinition;\n\n const [isDialogOpen, setIsDialogOpen] = React.useState(false);\n const [status, setStatus] = React.useState<ProcessStatus>(initialStatus);\n const [currentProgress, setCurrentProgress] = React.useState<number>(0);\n const launchAttemptRef = useRef(0);\n\n const formContext = useFormContext();\n\n const handleCancel = () => {\n launchAttemptRef.current += 1;\n setIsDialogOpen(false);\n setStatus('idle');\n onCancel();\n };\n\n const handlePreLaunchTriggered = () => {\n launchAttemptRef.current += 1;\n setStatus('prelaunch');\n setIsDialogOpen(true);\n };\n\n const handleLaunch = async () => {\n const launchAttempt = ++launchAttemptRef.current;\n // Validate the form data here if needed before launching the process\n // Get the field values from the form and pass them to the onLaunch function\n // Loop through the preRequisiteFieldIds and check if they have values in the form\n // Also bundle the values of the preRequisiteFieldIds and pass them to the onLaunch function\n if (preRequisiteFieldIds.length === 0) {\n // If there are no preRequisiteFieldIds, we can launch the process without any validation\n setIsDialogOpen(false);\n setStatus('running');\n onLaunch({ processId, fieldValues: {} });\n return;\n }\n\n const { trigger, getFieldState, setFocus } = formContext;\n const isValid = await trigger(preRequisiteFieldIds);\n if (launchAttempt !== launchAttemptRef.current) return;\n\n if (!isValid) {\n const firstInvalidFieldId = preRequisiteFieldIds.find((fieldId) => getFieldState(fieldId).invalid);\n if (firstInvalidFieldId) setFocus(firstInvalidFieldId);\n return;\n }\n\n setIsDialogOpen(false);\n setStatus('running');\n setCurrentProgress(0);\n\n const fieldValues = Object.fromEntries(\n preRequisiteFieldIds.map((fieldId) => [fieldId, formContext.getValues(fieldId)])\n );\n onLaunch({ processId, fieldValues });\n };\n\n // Ref (not a render-scoped let) so every closure clears the same interval handle\n const progressCheckIntervalRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const progressUnsubscribeRef = useRef<(() => void) | null>(null);\n\n const turnOffProgressCheck = useCallback(() => {\n if (progressCheckIntervalRef.current) {\n clearInterval(progressCheckIntervalRef.current);\n progressCheckIntervalRef.current = null;\n }\n }, []);\n\n const turnOffProgressSubscription = useCallback(() => {\n if (progressUnsubscribeRef.current) {\n progressUnsubscribeRef.current();\n progressUnsubscribeRef.current = null;\n }\n }, []);\n\n const handleProgressUpdate = useCallback(({ progress: updatedProgress, status: explicitStatus }: ProcessProgressUpdate) => {\n if (updatedProgress === undefined || updatedProgress === null) {\n setStatus('error');\n return;\n }\n\n setCurrentProgress(updatedProgress);\n\n // An explicit status (e.g. warning) always wins over the value inferred from progress alone.\n if (explicitStatus) {\n setStatus(explicitStatus);\n if (explicitStatus === 'complete' || explicitStatus === 'error') {\n turnOffProgressCheck();\n turnOffProgressSubscription();\n }\n return;\n }\n\n if (updatedProgress === 100) {\n setStatus('complete');\n turnOffProgressCheck();\n turnOffProgressSubscription();\n } else if (updatedProgress >= 0 && updatedProgress < 100) {\n setStatus('running');\n }\n }, [setStatus, setCurrentProgress, turnOffProgressCheck, turnOffProgressSubscription]);\n\n const turnOnProgressCheck = useCallback(() => {\n turnOffProgressCheck();\n let inFlight = false;\n let active = true;\n progressCheckIntervalRef.current = setInterval(() => {\n if (inFlight || !active) return;\n inFlight = true;\n onProgressCheck?.().then((updatedProgress) => {\n if (active) handleProgressUpdate({ progress: updatedProgress });\n }).catch((e) => {\n if (active) {\n console.error('Error getting process progress', e);\n setStatus('error');\n }\n }).finally(() => {\n inFlight = false;\n });\n }, 1000);\n return () => {\n active = false;\n turnOffProgressCheck();\n };\n }, [turnOffProgressCheck, onProgressCheck, handleProgressUpdate]);\n\n const turnOnProgressSubscription = useCallback(() => {\n turnOffProgressSubscription();\n if (!progressSubscription) {\n console.error('progressUpdateMode is \"subscribe\" but no progressSubscription was provided');\n return;\n }\n\n progressUnsubscribeRef.current = progressSubscription.subscribe(\n progressSubscription.eventName,\n {\n onProgress: handleProgressUpdate,\n onError: () => setStatus('error')\n }\n );\n }, [turnOffProgressSubscription, progressSubscription, handleProgressUpdate]);\n\n const handleResetLauncher = () => {\n setStatus('idle');\n setCurrentProgress(0);\n turnOffProgressCheck();\n turnOffProgressSubscription();\n };\n\n // 'warning' is a non-terminal state pushed mid-run, so treat it the same as 'running' here.\n const isProgressActive = status === 'running' || status === 'warning';\n\n useEffect(() => {\n // Depending on the derived boolean (not `status` itself) avoids tearing down and\n // re-establishing the poll/subscription when moving between 'running' and 'warning'.\n let stopProgressCheck: (() => void) | undefined;\n if (isProgressActive) {\n if (progressUpdateMode === 'subscribe') {\n turnOnProgressSubscription();\n } else {\n stopProgressCheck = turnOnProgressCheck();\n }\n } else {\n turnOffProgressCheck();\n turnOffProgressSubscription();\n }\n return () => {\n stopProgressCheck?.();\n turnOffProgressSubscription();\n };\n }, [isProgressActive, progressUpdateMode, turnOnProgressCheck, turnOnProgressSubscription, turnOffProgressCheck, turnOffProgressSubscription]);\n\n const getLaunchButtonClassName = () => {\n if (launchButtonProps.cssClass) {\n return launchButtonProps.cssClass;\n }\n\n return launchButtonProps.size === 'xsmall'\n ? `${ defaultLaunchButtonProps.cssClass } compact`\n : defaultLaunchButtonProps.cssClass;\n };\n\n const baseProgressIndicatorProps = {\n ...defaultProgressIndicatorProps,\n ...progressIndicatorProps,\n statusMessage,\n id: `processLauncherProgressIndicator_${ processDefinition.id }`,\n name: processDefinition.name,\n progress: currentProgress,\n };\n\n return (\n <div className={ `processLauncher ${ launchButtonProps.size || 'default' }` }>\n {\n (status === 'idle' || status === 'prelaunch') &&\n <SimpleButton\n {\n ...{\n ...defaultLaunchButtonProps,\n ...launchButtonProps,\n }\n }\n cssClass={ getLaunchButtonClassName() }\n leftIcon={ launchButtonProps.icon || defaultLaunchButtonProps.icon }\n id={ `processLauncherButton_${ processDefinition.id }` }\n label={ `Launch ${ processDefinition.name }` }\n onClickHandler={\n preRequisiteFieldIds.length > 0 ? handlePreLaunchTriggered : handleLaunch\n }\n />\n }\n\n {\n status === 'prelaunch' && (\n <Dialog\n customCssClasses={ { dialog: 'processLauncherDialog' } }\n open={ isDialogOpen }\n id={ `processLauncherDialog_${ processDefinition.id }` }\n size=\"m\"\n onClose={ handleCancel }\n header={ preRequisitesDialogTitle }\n footer={\n <div className=\"actionButtons\">\n <SimpleButton id={ `processLauncherDialogCancelButton_${ processDefinition.id }` } label=\"Cancel\" onClickHandler={ handleCancel } cssClass=\"secondary outline\" />\n <SimpleButton id={ `processLauncherDialogLaunchButton_${ processDefinition.id }` } label=\"Launch process\" onClickHandler={ handleLaunch } cssClass=\"primary\" />\n </div>\n }\n >\n <div className=\"processLauncherPrerequisites\">\n { children }\n </div>\n </Dialog>\n )\n }\n\n { status === 'running' && (\n <CircularProgressIndicator\n {\n ...{\n ...baseProgressIndicatorProps\n }\n }\n mode=\"default\"\n onClickHandler={ onProgressIndicatorClick }\n />\n ) }\n\n { status === 'warning' && (\n <CircularProgressIndicator\n {\n ...{\n ...baseProgressIndicatorProps\n }\n }\n mode=\"warning\"\n onClickHandler={ onProgressIndicatorClick }\n />\n ) }\n\n { status === 'complete' && (\n <CircularProgressIndicator\n {\n ...{\n ...baseProgressIndicatorProps\n }\n }\n mode=\"success\"\n onClickHandler={ handleResetLauncher }\n />\n ) }\n\n { status === 'error' && (\n <CircularProgressIndicator\n {\n ...{\n ...baseProgressIndicatorProps\n }\n }\n mode=\"error\"\n onClickHandler={ handleResetLauncher }\n />\n ) }\n </div>\n );\n};\n\nexport default ProcessLauncher;"],"mappings":";AAAA,OAAOA,KAAK,IAAeC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACxE,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,YAAY,EAAEC,MAAM,EAAEC,yBAAyB,QAAQ,kBAAkB;AAwBlF;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,wBAAkD,GAAG;EACzDC,QAAQ,EAAE,gDAAgD;EAC1DC,SAAS,EAAE,IAAI;EACfC,IAAI,EAAE,SAAS;EACfC,IAAI,EAAE;AACR,CAAC;AAED,MAAMC,6BAA4D,GAAG;EACnEF,IAAI,EAAE,OAAO;EACbD,SAAS,EAAE,IA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sCZ,iBAAiB,CAACY,EAAE,EAAK;MAACiE,KAAK,EAAC,gBAAgB;MAACC,cAAc,EAAGpD,YAAc;MAAClC,QAAQ,EAAC;IAAS,CAAE,CAC3J;EACN,gBAEDT,KAAA,CAAA0F,aAAA;IAAKC,SAAS,EAAC;EAA8B,GACzC/D,QACC,CACC,CACT,EAGDM,MAAM,KAAK,SAAS,iBACpBlC,KAAA,CAAA0F,aAAA,CAACnF,yBAAyB,EAAAqF,QAAA,KAGjBJ,0BAA0B;IAGjCc,IAAI,EAAC,SAAS;IACdP,cAAc,EAAGtE;EAA0B,EAC5C,CACF,EAECS,MAAM,KAAK,SAAS,iBACpBlC,KAAA,CAAA0F,aAAA,CAACnF,yBAAyB,EAAAqF,QAAA,KAGjBJ,0BAA0B;IAGjCc,IAAI,EAAC,SAAS;IACdP,cAAc,EAAGtE;EAA0B,EAC5C,CACF,EAECS,MAAM,KAAK,UAAU,iBACrBlC,KAAA,CAAA0F,aAAA,CAACnF,yBAAyB,EAAAqF,QAAA,KAGjBJ,0BAA0B;IAGjCc,IAAI,EAAC,SAAS;IACdP,cAAc,EAAGX;EAAqB,EACvC,CACF,EAEClD,MAAM,KAAK,OAAO,iBAClBlC,KAAA,CAAA0F,aAAA,CAACnF,yBAAyB,EAAAqF,QAAA,KAGjBJ,0BAA0B;IAGjCc,IAAI,EAAC,OAAO;IACZP,cAAc,EAAGX;EAAqB,EACvC,CAEA,CAAC;AAEV,CAAC;AAED,eAAetE,eAAe","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"processLauncher.interfaces.js","names":[],"sources":["../../../../src/widgets/processLauncher/processLauncher.interfaces.ts"],"sourcesContent":["import { ReactElement, ReactNode } from 'react';\n\nexport type ProcessDefinition = {\n id: string;\n name: string;\n description: string;\n};\n\nexport type ProcessLaunchButtonProps = {\n cssClass?: string;\n icon?: ReactNode | ReactElement;\n hideLabel?: boolean;\n size?: 'xsmall' | 'small' | 'default' | 'large' | 'xlarge';\n};\n\nexport type ProcessProgressIndicatorProps = {\n icon?: ReactNode | ReactElement;\n hideLabel?: boolean;\n size?: 'xsmall' | 'small' | 'default' | 'large' | 'xlarge';\n};\n\nexport type ProcessStatus = 'idle' | 'prelaunch' | 'running' | 'warning' | 'complete' | 'error';\n\nexport type ProcessProgressUpdateMode = 'fetch' | 'subscribe';\n\n// Statuses a subscription message is allowed to push explicitly; 'idle'/'prelaunch' are launcher-controlled only.\nexport type ProcessPushableStatus = Extract<ProcessStatus, 'running' | 'warning' | 'complete' | 'error'>;\n\nexport type ProcessProgressUpdate = {\n progress: number;\n // Omit to let progress alone drive status (0-99 = running, 100 = complete), or set explicitly for warning/error.\n status?: ProcessPushableStatus;\n};\n\nexport type ProcessProgressSubscriptionHandlers = {\n /* eslint-disable-next-line no-unused-vars */\n onProgress: (update: ProcessProgressUpdate) => void;\n /* eslint-disable-next-line no-unused-vars */\n onError?: (error: unknown) => void;\n};\n\nexport type ProcessProgressUnsubscribe = () => void;\n\n/*\n Transport-agnostic subscription contract. Consumers wire `subscribe` to whatever\n message bus they use (EventSource, WebSocket, pub/sub client, etc.), listen for\n `eventName`, parse the raw message into a progress percentage (0-100), and invoke\n the provided `onProgress`/`onError` handlers. The returned function must unsubscribe.\n */\nexport type ProcessProgressSubscription = {\n eventName: string;\n /* eslint-disable-next-line no-unused-vars */\n subscribe: (eventName: string, handlers: ProcessProgressSubscriptionHandlers) => ProcessProgressUnsubscribe;\n};\n\nexport type ProcessLauncherFetchProgressProps = {\n progressUpdateMode?: 'fetch';\n onProgressCheck: () => Promise<number>;\n progressSubscription?: never;\n};\n\nexport type ProcessLauncherSubscribeProgressProps = {\n progressUpdateMode: 'subscribe';\n progressSubscription: ProcessProgressSubscription;\n onProgressCheck?: never;\n};\n\nexport type ProcessLauncherProgressProps =\n | ProcessLauncherFetchProgressProps\n | ProcessLauncherSubscribeProgressProps;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"processLauncher.interfaces.js","names":[],"sources":["../../../../src/widgets/processLauncher/processLauncher.interfaces.ts"],"sourcesContent":["import { IconSource } from '../../helpers/iconHelpers';\n\nexport type ProcessDefinition = {\n id: string;\n name: string;\n description: string;\n};\n\nexport type ProcessLaunchButtonProps = {\n cssClass?: string;\n icon?: IconSource;\n hideLabel?: boolean;\n size?: 'xsmall' | 'small' | 'default' | 'large' | 'xlarge';\n};\n\nexport type ProcessProgressIndicatorProps = {\n icon?: IconSource;\n hideLabel?: boolean;\n size?: 'xsmall' | 'small' | 'default' | 'large' | 'xlarge';\n};\n\nexport type ProcessStatus = 'idle' | 'prelaunch' | 'running' | 'warning' | 'complete' | 'error';\n\nexport type ProcessProgressUpdateMode = 'fetch' | 'subscribe';\n\n// Statuses a subscription message is allowed to push explicitly; 'idle'/'prelaunch' are launcher-controlled only.\nexport type ProcessPushableStatus = Extract<ProcessStatus, 'running' | 'warning' | 'complete' | 'error'>;\n\nexport type ProcessProgressUpdate = {\n progress: number;\n // Omit to let progress alone drive status (0-99 = running, 100 = complete), or set explicitly for warning/error.\n status?: ProcessPushableStatus;\n};\n\nexport type ProcessProgressSubscriptionHandlers = {\n /* eslint-disable-next-line no-unused-vars */\n onProgress: (update: ProcessProgressUpdate) => void;\n /* eslint-disable-next-line no-unused-vars */\n onError?: (error: unknown) => void;\n};\n\nexport type ProcessProgressUnsubscribe = () => void;\n\n/*\n Transport-agnostic subscription contract. Consumers wire `subscribe` to whatever\n message bus they use (EventSource, WebSocket, pub/sub client, etc.), listen for\n `eventName`, parse the raw message into a progress percentage (0-100), and invoke\n the provided `onProgress`/`onError` handlers. The returned function must unsubscribe.\n */\nexport type ProcessProgressSubscription = {\n eventName: string;\n /* eslint-disable-next-line no-unused-vars */\n subscribe: (eventName: string, handlers: ProcessProgressSubscriptionHandlers) => ProcessProgressUnsubscribe;\n};\n\nexport type ProcessLauncherFetchProgressProps = {\n progressUpdateMode?: 'fetch';\n onProgressCheck: () => Promise<number>;\n progressSubscription?: never;\n};\n\nexport type ProcessLauncherSubscribeProgressProps = {\n progressUpdateMode: 'subscribe';\n progressSubscription: ProcessProgressSubscription;\n onProgressCheck?: never;\n};\n\nexport type ProcessLauncherProgressProps =\n | ProcessLauncherFetchProgressProps\n | ProcessLauncherSubscribeProgressProps;\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import type { SvgIconDefinition } from '@x15ventures/x15-ui-library-icons/svgIcon/svgIconDefinition.interface';
3
+ import { IconProps } from '../components/design/icons/basicIcon/Icon';
4
+ export type { SvgIconDefinition };
5
+ export type SvgIconSize = 'xs' | 's' | 'm' | 'l' | 'xl';
6
+ /**
7
+ * Every supported way of specifying an icon:
8
+ * - `string`: an icon font name, rendered via `<Icon icon="name" />`
9
+ * - `SvgIconDefinition`: an icon definition from `@x15ventures/x15-ui-library-icons/iconDefinitions`, rendered via `<SvgIcon />`
10
+ * - `IconProps`: props for `<Icon />`, e.g. `{ icon: 'bell', customCssClass: 'large' }`
11
+ * - `ReactElement` / `ReactNode`: rendered as provided, e.g. `<SvgIcon svgDefinition={ car } />` or `<img />`
12
+ */
13
+ export type IconSource = string | SvgIconDefinition | IconProps | ReactElement | ReactNode;
14
+ export interface RenderIconOptions {
15
+ /** Added to icons rendered via `<Icon />` or `<SvgIcon />`. Not applied to React elements. */
16
+ customCssClass?: string;
17
+ /** Only applied to `SvgIconDefinition` sources. */
18
+ svgSize?: SvgIconSize | string;
19
+ /** Used when the icon source is empty (`undefined`, `null`, `false` or `''`). */
20
+ fallback?: IconSource;
21
+ }
22
+ export declare const isSvgIconDefinition: (value: unknown) => value is SvgIconDefinition;
23
+ export declare const isIconProps: (value: unknown) => value is IconProps;
24
+ export declare const isEmptyIconSource: (value: unknown) => boolean;
25
+ /**
26
+ * Normalises any supported `IconSource` into a renderable node.
27
+ * Returns `null` when there is nothing to render.
28
+ */
29
+ export declare const renderIcon: (icon: IconSource, options?: RenderIconOptions) => ReactNode;
30
+ //# sourceMappingURL=iconHelpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconHelpers.d.ts","sourceRoot":"","sources":["../../src/helpers/iconHelpers.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uEAAuE,CAAC;AAC/G,OAAO,EAAQ,SAAS,EAAE,MAAM,2CAA2C,CAAC;AAI5E,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,iBAAiB,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;AAE3F,MAAM,WAAW,iBAAiB;IAChC,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAC/B,iFAAiF;IACjF,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB,UAAW,OAAO,KAAG,KAAK,IAAI,iBAE7D,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,OAAO,KAAG,KAAK,IAAI,SAErD,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAW,OAAO,KAAG,OAElD,CAAC;AAgBF;;;GAGG;AACH,eAAO,MAAM,UAAU,SAAU,UAAU,YAAW,iBAAiB,KAAQ,SAmC9E,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ import '@testing-library/jest-dom';
5
+ //# sourceMappingURL=iconHelpers.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconHelpers.test.d.ts","sourceRoot":"","sources":["../../src/helpers/iconHelpers.test.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,2BAA2B,CAAC"}
@@ -6,5 +6,8 @@ export { dateToShortIsoString, isValidDate, dateToShortReadableDate, dateToShort
6
6
  export { USER_CURRENCY, intlCurrencyFormatter, intlNumberFormatter, formatNumberForLocale, formatAsCurrencyForLocale, getNumberAbbreviation, formatRoundedNumberWithAbbreviation, formatNumberWithAbbreviation, formatNumberForChartAxis, formatAsSimpleCurrencyForChartAxis, formatAsInternationalCurrencyForChartAxis, formatAsCurrencyWithAbbreviation, formatFileSize } from './formatters';
7
7
  export { getRandomNumberBelow, getRandomBetweenInclusive, getRandomBetweenExclusive, hashCode, roundToDecimal, formatNumberToMinDigits, formatDigitalTime } from './numberHelpers';
8
8
  export { richTextParser, capitalize, capitalizeFirstLetter, lowerCaseFirstLetter, getCharacterCount, clampToGraphemeMax, useAnInsteadOfA, splitCamelCase, pluralize, pluralizeIfNeeded, getInitialsOrAcronym } from './stringHelpers';
9
- export { objectsAreTheSame, isAnObject, createCompareValueOverride, deepMergeObjects, overrideMergeObjects, makeInheritanceObject, updateNestedProperty, filterObject, getArrayOfObjectKeys, getArrayOfReadableObjectKeys, getBranchFromPath, deepRemoveProps } from './objectHelpers';
9
+ export { objectsAreTheSame, isAnObject, createCompareValueOverride, isReactElement, isNonElementObject, isPlainObject, deepMergeObjects, overrideMergeObjects, makeInheritanceObject, updateNestedProperty, filterObject, getArrayOfObjectKeys, getArrayOfReadableObjectKeys, getBranchFromPath, deepRemoveProps } from './objectHelpers';
10
+ export type { DeepMergeObjectsArgs, MakeInheritanceObjectArgs, UpdateNestedPropertyArgs } from './objectHelpers';
11
+ export { renderIcon, isSvgIconDefinition, isIconProps, isEmptyIconSource } from './iconHelpers';
12
+ export type { IconSource, RenderIconOptions, SvgIconDefinition, SvgIconSize } from './iconHelpers';
10
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL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,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,EAC5B,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EAClB,SAAS,EACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,mCAAmC,EACnC,4BAA4B,EAC5B,wBAAwB,EACxB,kCAAkC,EAClC,yCAAyC,EACzC,gCAAgC,EAChC,cAAc,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,0BAA0B,EAC1B,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,4BAA4B,EAC5B,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACZ,MAAM,eAAe,CAAC"}
@@ -1,14 +1,18 @@
1
+ import React from 'react';
1
2
  import { JSONObject } from '../interfaces/generic.interface';
2
3
  export declare const objectsAreTheSame: (obj1: object, obj2: object) => boolean;
3
4
  export declare const isAnObject: (value: unknown) => boolean;
4
5
  export declare const createCompareValueOverride: (key: string, compareValue: any) => string;
5
- interface DeepMergeObjectsArgs {
6
+ export interface DeepMergeObjectsArgs {
6
7
  baseObject: Record<string, any>;
7
8
  overrideObject: Record<string, any>;
8
9
  }
10
+ export declare const isReactElement: (val: unknown) => val is React.ReactElement;
11
+ export declare const isNonElementObject: (value: unknown) => value is Record<string, unknown>;
12
+ export declare const isPlainObject: (val: unknown) => val is Record<string, unknown>;
9
13
  export declare function deepMergeObjects<T extends object, U extends object>({ baseObject, overrideObject }: DeepMergeObjectsArgs): T & U;
10
14
  export declare const overrideMergeObjects: ({ baseObject, overrideObject }: DeepMergeObjectsArgs) => object;
11
- interface MakeInheritanceObjectArgs {
15
+ export interface MakeInheritanceObjectArgs {
12
16
  base: {
13
17
  [key: string]: any;
14
18
  };
@@ -19,7 +23,7 @@ interface MakeInheritanceObjectArgs {
19
23
  excludePropSpread?: string[];
20
24
  }
21
25
  export declare const makeInheritanceObject: ({ base, valueOnly, baseObjectName, compare, propPath, excludePropSpread }: MakeInheritanceObjectArgs) => string;
22
- interface UpdateNestedPropertyArgs {
26
+ export interface UpdateNestedPropertyArgs {
23
27
  jsonObject: Record<string, any>;
24
28
  propertyPath: string;
25
29
  newValue: any;
@@ -39,6 +43,9 @@ declare const _default: {
39
43
  objectsAreTheSame: (obj1: object, obj2: object) => boolean;
40
44
  isAnObject: (value: unknown) => boolean;
41
45
  createCompareValueOverride: (key: string, compareValue: any) => string;
46
+ isReactElement: (val: unknown) => val is React.ReactElement;
47
+ isNonElementObject: (value: unknown) => value is Record<string, unknown>;
48
+ isPlainObject: (val: unknown) => val is Record<string, unknown>;
42
49
  deepMergeObjects: typeof deepMergeObjects;
43
50
  overrideMergeObjects: ({ baseObject, overrideObject }: DeepMergeObjectsArgs) => object;
44
51
  makeInheritanceObject: ({ base, valueOnly, baseObjectName, compare, propPath, excludePropSpread }: MakeInheritanceObjectArgs) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"objectHelpers.d.ts","sourceRoot":"","sources":["../../src/helpers/objectHelpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAa,MAAM,iCAAiC,CAAC;AAGxE,eAAO,MAAM,iBAAiB,SAAU,MAAM,QAAQ,MAAM,KAAG,OAU9D,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,OAAO,KAAG,OAA6F,CAAC;AAE1I,eAAO,MAAM,0BAA0B,QAAS,MAAM,gBAAgB,GAAG,KAAG,MAAsD,CAAC;AAEnI,UAAU,oBAAoB;IAC5B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC;AAcD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EACjE,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,oBAAoB,GACnD,CAAC,GAAG,CAAC,CAgCP;AAED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CAAC;AAEnI,eAAO,MAAM,eAAe,QAAS,GAAG,iBAAiB,MAAM,EAAE,KAAG,GAanE,CAAC;;8BAjSsC,MAAM,QAAQ,MAAM,KAAG,OAAO;wBAYpC,OAAO,KAAG,OAAO;sCAEH,MAAM,gBAAgB,GAAG,KAAG,MAAM;0BAO9C,OAAO,KAAG,GAAG,IAAI,KAAK,CAAC,YAAY;gCAI7B,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;yBAOjD,OAAO,KAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;2DA6CN,oBAAoB,KAAG,MAAM;uGAuC7F,yBAAyB,KAC3B,MAAM;mEAoDoE,wBAAwB,KAAG,MAAM;+BAsBrE,UAAU,UAAU;QAC3D,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;QACvE,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,KAAG,UAAU,GAAG,KAAK;uCA4D2B,UAAU;+CAeF,UAAU;6BAK5B,GAAG,QAAQ,MAAM,EAAE,KAAG,GAAG;2BAE3B,GAAG,iBAAiB,MAAM,EAAE,KAAG,GAAG;;AAevE,wBAgBE"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import './styles/index.scss';
2
2
  import './icons/style.scss';
3
- export { Accordion, Chip, Pill, Badge, Dialog, HeaderBar, Icon, NotificationIcon, VentureLogo, CreditSavvyLogo, HomeInLogo, KitLogo, DoshiiLogo, TruyuLogo, SidePanel, Skeleton, Spinner, StatusIconButton, StatusLight, StatusLightsBar, CircularProgressIndicator, Tabs, Tooltip, EllipsisTooltip, RevealMore, CopyText, Paginator, PageBanner, Banner, Alert, SimpleButton, Button, FormField, InputCheckbox, CheckboxInput, StyledRadioGroup, StyledRadioInput, StyledRadioLabel, HookFormWrapper, TextInput, EmailInput, FileInput, SearchInput, NumberInput, PhoneInput, UrlInput, PasswordInput, PasswordInputSignup, SelectDropdown, Select, Combobox, Textarea, InputDate, DateInput, Card, ReportFooter, MainHeader, ThemeLoader, DevToolbar, ThemeSwitch, LoremIpsum, GlobalDashboard, Menu, PopupMenu, SearchPanelMenu, Link, TemplateForm, TemplateLoading, TemplateDashboard, TemplatePage } from './components';
3
+ export { Accordion, Chip, Pill, Badge, Dialog, HeaderBar, Icon, NotificationIcon, VentureLogo, CreditSavvyLogo, HomeInLogo, KitLogo, DoshiiLogo, TruyuLogo, SidePanel, Skeleton, Spinner, StatusIconButton, StatusLight, StatusLightsBar, CircularProgressIndicator, Tabs, Tooltip, EllipsisTooltip, RevealMore, CopyText, Paginator, PageBanner, Banner, Alert, SimpleButton, Button, FormField, InputCheckbox, CheckboxInput, CheckboxSwitch, StyledRadioGroup, StyledRadioInput, StyledRadioLabel, HookFormWrapper, TextInput, EmailInput, FileInput, SearchInput, NumberInput, PhoneInput, UrlInput, PasswordInput, PasswordInputSignup, SelectDropdown, Select, Combobox, Textarea, InputDate, DateInput, Card, ReportFooter, MainHeader, ThemeLoader, DevToolbar, ThemeSwitch, LoremIpsum, GlobalDashboard, Menu, PopupMenu, SearchPanelMenu, Link, TemplateForm, TemplateLoading, TemplateDashboard, TemplatePage } from './components';
4
4
  export { ProcessLauncher } from './widgets';
5
5
  export type { ProcessLauncherProps, ProcessDefinition, ProcessLaunchButtonProps, ProcessProgressIndicatorProps, ProcessStatus, ProcessProgressUpdateMode, ProcessPushableStatus, ProcessProgressUpdate, ProcessProgressSubscriptionHandlers, ProcessProgressUnsubscribe, ProcessProgressSubscription, ProcessLauncherFetchProgressProps, ProcessLauncherSubscribeProgressProps, ProcessLauncherProgressProps } from './widgets';
6
- export type { PageBannerProps, FormComponentProps, DropdownSelectProps, PasswordInputProps, StyledRadioGroupProps, SkeletonProps, ThemeStructure, MenuItemPropTypes, MenuButtonPropTypes, MenuItemIconStates, TemplateFormProps, TemplateLoadingProps, TemplateDashboardProps, TemplatePageProps, CircularProgressIndicatorProps } from './components';
6
+ export type { PageBannerProps, FormComponentProps, DropdownSelectProps, PasswordInputProps, StyledRadioGroupProps, CheckboxSwitchProps, CheckboxSwitchSize, CheckboxSwitchVariant, CheckboxSwitchShape, CheckboxSwitchStateDisplay, CheckboxSwitchGlowTheme, CheckboxSwitchButtonStyle, CheckboxSwitchStateProps, SkeletonProps, ThemeStructure, MenuItemPropTypes, MenuButtonPropTypes, MenuItemIconStates, TemplateFormProps, TemplateLoadingProps, TemplateDashboardProps, TemplatePageProps, CircularProgressIndicatorProps } from './components';
7
7
  export { useOnClickOutside, usePopupKeys, useOnEdgeProximityDetect, useFirstCapital, useTabbableInputGroup, useDialogOverlay, useEllipsisBookends, useFocusTrap, useInertAttribute, useOnInteractiveHostFocus } from './hooks';
8
8
  export * from './interfaces';
9
9
  export { getMinAge, getMaxAge, getMinAndMaxAges, validateBirthdate, isDateEntryComplete, getAgeInWeeks, getAgeInYears } from './helpers/ageHelpers';
@@ -14,7 +14,10 @@ export { dateToShortIsoString, isValidDate, dateToShortReadableDate, dateToShort
14
14
  export { USER_CURRENCY, intlCurrencyFormatter, intlNumberFormatter, formatNumberForLocale, formatAsCurrencyForLocale, getNumberAbbreviation, formatRoundedNumberWithAbbreviation, formatNumberWithAbbreviation, formatNumberForChartAxis, formatAsSimpleCurrencyForChartAxis, formatAsInternationalCurrencyForChartAxis, formatAsCurrencyWithAbbreviation, formatFileSize } from './helpers/formatters';
15
15
  export { getRandomNumberBelow, getRandomBetweenInclusive, getRandomBetweenExclusive, hashCode, roundToDecimal, formatNumberToMinDigits, formatDigitalTime } from './helpers/numberHelpers';
16
16
  export { richTextParser, capitalize, capitalizeFirstLetter, lowerCaseFirstLetter, useAnInsteadOfA, splitCamelCase, pluralize, pluralizeIfNeeded, getInitialsOrAcronym } from './helpers/stringHelpers';
17
- export { objectsAreTheSame, isAnObject, createCompareValueOverride, deepMergeObjects, overrideMergeObjects, makeInheritanceObject, updateNestedProperty, filterObject, getArrayOfObjectKeys, getArrayOfReadableObjectKeys, getBranchFromPath, deepRemoveProps } from './helpers/objectHelpers';
17
+ export { objectsAreTheSame, isAnObject, createCompareValueOverride, isReactElement, isNonElementObject, isPlainObject, deepMergeObjects, overrideMergeObjects, makeInheritanceObject, updateNestedProperty, filterObject, getArrayOfObjectKeys, getArrayOfReadableObjectKeys, getBranchFromPath, deepRemoveProps } from './helpers/objectHelpers';
18
+ export type { DeepMergeObjectsArgs, MakeInheritanceObjectArgs, UpdateNestedPropertyArgs } from './helpers/objectHelpers';
19
+ export { renderIcon, isSvgIconDefinition, isIconProps, isEmptyIconSource } from './helpers/iconHelpers';
20
+ export type { IconSource, RenderIconOptions, SvgIconDefinition, SvgIconSize } from './helpers/iconHelpers';
18
21
  export { UserMock, MenuMock, xGraphTopMenuMock, xGraphMainMenuMock, DashboardMenuMock, UserMenuMock } from './mocks';
19
22
  export { CBA_ORG_STRUCTURE, CBA_LOGO, VENTURES, DEFAULT_PASSWORD_REGEX, DEFAULT_EMAIL_REGEX, DEFAULT_PHONE_REGEX, DEFAULT_NUMBER_REGEX, DEFAULT_URL_REGEX, DATA_CLASSIFICATIONS, BLACKLISTED_FILE_TYPES, DEFAULT_UPLOAD_FILE_TYPES, DEFAULT_UPLOAD_FILE_EXTENSIONS, LIBRARY_CDN_BASE_URL, LIBRARY_CDN_BASE_URL_PROD, LIBRARY_CDN_BUCKET_NAME, LIBRARY_CDN_BUCKET_FOLDER, LIBRARY_CDN_DEV_BASE_URL, LIBRARY_CDN_PROD_BASE_URL, LIBRARY_VERSION } from './constants';
20
23
  export type { USER, GlobalUserRole, ScopedUserRole, UserAuthType, VentureSite, VentureSites, VentureDefinition, VentureDefinitions } from './constants';