@vuu-ui/vuu-shell 0.13.8 → 0.13.10

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 (225) hide show
  1. package/cjs/ShellContextProvider.js +25 -0
  2. package/cjs/ShellContextProvider.js.map +1 -0
  3. package/cjs/app-header/AppHeader.css.js +6 -0
  4. package/cjs/app-header/AppHeader.css.js.map +1 -0
  5. package/cjs/app-header/AppHeader.js +85 -0
  6. package/cjs/app-header/AppHeader.js.map +1 -0
  7. package/cjs/app-status-bar/AppStatusBar.css.js +6 -0
  8. package/cjs/app-status-bar/AppStatusBar.css.js.map +1 -0
  9. package/cjs/app-status-bar/AppStatusBar.js +47 -0
  10. package/cjs/app-status-bar/AppStatusBar.js.map +1 -0
  11. package/cjs/application-provider/ApplicationContext.js +18 -0
  12. package/cjs/application-provider/ApplicationContext.js.map +1 -0
  13. package/cjs/application-provider/ApplicationProvider.js +104 -0
  14. package/cjs/application-provider/ApplicationProvider.js.map +1 -0
  15. package/cjs/connection-status/ConnectionRetryCountdown.js +36 -0
  16. package/cjs/connection-status/ConnectionRetryCountdown.js.map +1 -0
  17. package/cjs/connection-status/ConnectionStateDisplay.css.js +6 -0
  18. package/cjs/connection-status/ConnectionStateDisplay.css.js.map +1 -0
  19. package/cjs/connection-status/ConnectionStateDisplay.js +65 -0
  20. package/cjs/connection-status/ConnectionStateDisplay.js.map +1 -0
  21. package/cjs/connection-status/ConnectionStatusIndicator.css.js +6 -0
  22. package/cjs/connection-status/ConnectionStatusIndicator.css.js.map +1 -0
  23. package/cjs/connection-status/ConnectionStatusIndicator.js +81 -0
  24. package/cjs/connection-status/ConnectionStatusIndicator.js.map +1 -0
  25. package/cjs/feature/Feature.js +55 -0
  26. package/cjs/feature/Feature.js.map +1 -0
  27. package/cjs/feature/FeatureErrorBoundary.js +30 -0
  28. package/cjs/feature/FeatureErrorBoundary.js.map +1 -0
  29. package/cjs/feature/Loader.js +8 -0
  30. package/cjs/feature/Loader.js.map +1 -0
  31. package/cjs/feature-and-layout-provider/FeatureAndLayoutProvider.js +60 -0
  32. package/cjs/feature-and-layout-provider/FeatureAndLayoutProvider.js.map +1 -0
  33. package/cjs/feature-list/FeatureList.css.js +6 -0
  34. package/cjs/feature-list/FeatureList.css.js.map +1 -0
  35. package/cjs/feature-list/FeatureList.js +97 -0
  36. package/cjs/feature-list/FeatureList.js.map +1 -0
  37. package/cjs/index.js +77 -2826
  38. package/cjs/index.js.map +1 -1
  39. package/cjs/left-nav/LeftNav.css.js +6 -0
  40. package/cjs/left-nav/LeftNav.css.js.map +1 -0
  41. package/cjs/left-nav/LeftNav.js +199 -0
  42. package/cjs/left-nav/LeftNav.js.map +1 -0
  43. package/cjs/login/LoginPanel.css.js +6 -0
  44. package/cjs/login/LoginPanel.css.js.map +1 -0
  45. package/cjs/login/LoginPanel.js +108 -0
  46. package/cjs/login/LoginPanel.js.map +1 -0
  47. package/cjs/login/VuuLogo.js +134 -0
  48. package/cjs/login/VuuLogo.js.map +1 -0
  49. package/cjs/login/login-utils.js +31 -0
  50. package/cjs/login/login-utils.js.map +1 -0
  51. package/cjs/persistence-manager/LocalPersistenceManager.js +197 -0
  52. package/cjs/persistence-manager/LocalPersistenceManager.js.map +1 -0
  53. package/cjs/persistence-manager/PersistenceProvider.js +21 -0
  54. package/cjs/persistence-manager/PersistenceProvider.js.map +1 -0
  55. package/cjs/persistence-manager/RemotePersistenceManager.js +175 -0
  56. package/cjs/persistence-manager/RemotePersistenceManager.js.map +1 -0
  57. package/cjs/persistence-manager/StaticPersistenceManager.js +71 -0
  58. package/cjs/persistence-manager/StaticPersistenceManager.js.map +1 -0
  59. package/cjs/shell-layout-templates/context-panel/ContextPanel.css.js +6 -0
  60. package/cjs/shell-layout-templates/context-panel/ContextPanel.css.js.map +1 -0
  61. package/cjs/shell-layout-templates/context-panel/ContextPanel.js +94 -0
  62. package/cjs/shell-layout-templates/context-panel/ContextPanel.js.map +1 -0
  63. package/cjs/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +53 -0
  64. package/cjs/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js.map +1 -0
  65. package/cjs/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +83 -0
  66. package/cjs/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js.map +1 -0
  67. package/cjs/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +46 -0
  68. package/cjs/shell-layout-templates/left-main-tabs/useLeftMainTabs.js.map +1 -0
  69. package/cjs/shell-layout-templates/side-panel/SidePanel.css.js +6 -0
  70. package/cjs/shell-layout-templates/side-panel/SidePanel.css.js.map +1 -0
  71. package/cjs/shell-layout-templates/side-panel/SidePanel.js +36 -0
  72. package/cjs/shell-layout-templates/side-panel/SidePanel.js.map +1 -0
  73. package/cjs/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +48 -0
  74. package/cjs/shell-layout-templates/simple-content-pane/useSimpleContentPane.js.map +1 -0
  75. package/cjs/shell-layout-templates/useShellLayout.js +23 -0
  76. package/cjs/shell-layout-templates/useShellLayout.js.map +1 -0
  77. package/cjs/shell.css.js +6 -0
  78. package/cjs/shell.css.js.map +1 -0
  79. package/cjs/shell.js +161 -0
  80. package/cjs/shell.js.map +1 -0
  81. package/cjs/theme-switch/ThemeSwitch.css.js +6 -0
  82. package/cjs/theme-switch/ThemeSwitch.css.js.map +1 -0
  83. package/cjs/theme-switch/ThemeSwitch.js +56 -0
  84. package/cjs/theme-switch/ThemeSwitch.js.map +1 -0
  85. package/cjs/user-settings/SettingsForm.css.js +6 -0
  86. package/cjs/user-settings/SettingsForm.css.js.map +1 -0
  87. package/cjs/user-settings/SettingsForm.js +168 -0
  88. package/cjs/user-settings/SettingsForm.js.map +1 -0
  89. package/cjs/user-settings/UserSettingsPanel.css.js +6 -0
  90. package/cjs/user-settings/UserSettingsPanel.css.js.map +1 -0
  91. package/cjs/user-settings/UserSettingsPanel.js +42 -0
  92. package/cjs/user-settings/UserSettingsPanel.js.map +1 -0
  93. package/cjs/workspace-management/LayoutList.css.js +6 -0
  94. package/cjs/workspace-management/LayoutList.css.js.map +1 -0
  95. package/cjs/workspace-management/LayoutList.js +116 -0
  96. package/cjs/workspace-management/LayoutList.js.map +1 -0
  97. package/cjs/workspace-management/LayoutTile.css.js +6 -0
  98. package/cjs/workspace-management/LayoutTile.css.js.map +1 -0
  99. package/cjs/workspace-management/LayoutTile.js +41 -0
  100. package/cjs/workspace-management/LayoutTile.js.map +1 -0
  101. package/cjs/workspace-management/SaveLayoutPanel.css.js +6 -0
  102. package/cjs/workspace-management/SaveLayoutPanel.css.js.map +1 -0
  103. package/cjs/workspace-management/SaveLayoutPanel.js +129 -0
  104. package/cjs/workspace-management/SaveLayoutPanel.js.map +1 -0
  105. package/cjs/workspace-management/WorkspaceProvider.js +264 -0
  106. package/cjs/workspace-management/WorkspaceProvider.js.map +1 -0
  107. package/cjs/workspace-management/defaultWorkspaceJSON.js +101 -0
  108. package/cjs/workspace-management/defaultWorkspaceJSON.js.map +1 -0
  109. package/cjs/workspace-management/screenshot-utils.js +25 -0
  110. package/cjs/workspace-management/screenshot-utils.js.map +1 -0
  111. package/cjs/workspace-management/useWorkspaceContextMenuItems.js +72 -0
  112. package/cjs/workspace-management/useWorkspaceContextMenuItems.js.map +1 -0
  113. package/esm/ShellContextProvider.js +23 -0
  114. package/esm/ShellContextProvider.js.map +1 -0
  115. package/esm/app-header/AppHeader.css.js +4 -0
  116. package/esm/app-header/AppHeader.css.js.map +1 -0
  117. package/esm/app-header/AppHeader.js +83 -0
  118. package/esm/app-header/AppHeader.js.map +1 -0
  119. package/esm/app-status-bar/AppStatusBar.css.js +4 -0
  120. package/esm/app-status-bar/AppStatusBar.css.js.map +1 -0
  121. package/esm/app-status-bar/AppStatusBar.js +45 -0
  122. package/esm/app-status-bar/AppStatusBar.js.map +1 -0
  123. package/esm/application-provider/ApplicationContext.js +16 -0
  124. package/esm/application-provider/ApplicationContext.js.map +1 -0
  125. package/esm/application-provider/ApplicationProvider.js +98 -0
  126. package/esm/application-provider/ApplicationProvider.js.map +1 -0
  127. package/esm/connection-status/ConnectionRetryCountdown.js +34 -0
  128. package/esm/connection-status/ConnectionRetryCountdown.js.map +1 -0
  129. package/esm/connection-status/ConnectionStateDisplay.css.js +4 -0
  130. package/esm/connection-status/ConnectionStateDisplay.css.js.map +1 -0
  131. package/esm/connection-status/ConnectionStateDisplay.js +63 -0
  132. package/esm/connection-status/ConnectionStateDisplay.js.map +1 -0
  133. package/esm/connection-status/ConnectionStatusIndicator.css.js +4 -0
  134. package/esm/connection-status/ConnectionStatusIndicator.css.js.map +1 -0
  135. package/esm/connection-status/ConnectionStatusIndicator.js +79 -0
  136. package/esm/connection-status/ConnectionStatusIndicator.js.map +1 -0
  137. package/esm/feature/Feature.js +53 -0
  138. package/esm/feature/Feature.js.map +1 -0
  139. package/esm/feature/FeatureErrorBoundary.js +28 -0
  140. package/esm/feature/FeatureErrorBoundary.js.map +1 -0
  141. package/esm/feature/Loader.js +6 -0
  142. package/esm/feature/Loader.js.map +1 -0
  143. package/esm/feature-and-layout-provider/FeatureAndLayoutProvider.js +56 -0
  144. package/esm/feature-and-layout-provider/FeatureAndLayoutProvider.js.map +1 -0
  145. package/esm/feature-list/FeatureList.css.js +4 -0
  146. package/esm/feature-list/FeatureList.css.js.map +1 -0
  147. package/esm/feature-list/FeatureList.js +95 -0
  148. package/esm/feature-list/FeatureList.js.map +1 -0
  149. package/esm/index.js +27 -2780
  150. package/esm/index.js.map +1 -1
  151. package/esm/left-nav/LeftNav.css.js +4 -0
  152. package/esm/left-nav/LeftNav.css.js.map +1 -0
  153. package/esm/left-nav/LeftNav.js +197 -0
  154. package/esm/left-nav/LeftNav.js.map +1 -0
  155. package/esm/login/LoginPanel.css.js +4 -0
  156. package/esm/login/LoginPanel.css.js.map +1 -0
  157. package/esm/login/LoginPanel.js +106 -0
  158. package/esm/login/LoginPanel.js.map +1 -0
  159. package/esm/login/VuuLogo.js +132 -0
  160. package/esm/login/VuuLogo.js.map +1 -0
  161. package/esm/login/login-utils.js +26 -0
  162. package/esm/login/login-utils.js.map +1 -0
  163. package/esm/persistence-manager/LocalPersistenceManager.js +195 -0
  164. package/esm/persistence-manager/LocalPersistenceManager.js.map +1 -0
  165. package/esm/persistence-manager/PersistenceProvider.js +17 -0
  166. package/esm/persistence-manager/PersistenceProvider.js.map +1 -0
  167. package/esm/persistence-manager/RemotePersistenceManager.js +173 -0
  168. package/esm/persistence-manager/RemotePersistenceManager.js.map +1 -0
  169. package/esm/persistence-manager/StaticPersistenceManager.js +69 -0
  170. package/esm/persistence-manager/StaticPersistenceManager.js.map +1 -0
  171. package/esm/shell-layout-templates/context-panel/ContextPanel.css.js +4 -0
  172. package/esm/shell-layout-templates/context-panel/ContextPanel.css.js.map +1 -0
  173. package/esm/shell-layout-templates/context-panel/ContextPanel.js +92 -0
  174. package/esm/shell-layout-templates/context-panel/ContextPanel.js.map +1 -0
  175. package/esm/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js +51 -0
  176. package/esm/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.js.map +1 -0
  177. package/esm/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js +81 -0
  178. package/esm/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.js.map +1 -0
  179. package/esm/shell-layout-templates/left-main-tabs/useLeftMainTabs.js +44 -0
  180. package/esm/shell-layout-templates/left-main-tabs/useLeftMainTabs.js.map +1 -0
  181. package/esm/shell-layout-templates/side-panel/SidePanel.css.js +4 -0
  182. package/esm/shell-layout-templates/side-panel/SidePanel.css.js.map +1 -0
  183. package/esm/shell-layout-templates/side-panel/SidePanel.js +34 -0
  184. package/esm/shell-layout-templates/side-panel/SidePanel.js.map +1 -0
  185. package/esm/shell-layout-templates/simple-content-pane/useSimpleContentPane.js +46 -0
  186. package/esm/shell-layout-templates/simple-content-pane/useSimpleContentPane.js.map +1 -0
  187. package/esm/shell-layout-templates/useShellLayout.js +21 -0
  188. package/esm/shell-layout-templates/useShellLayout.js.map +1 -0
  189. package/esm/shell.css.js +4 -0
  190. package/esm/shell.css.js.map +1 -0
  191. package/esm/shell.js +159 -0
  192. package/esm/shell.js.map +1 -0
  193. package/esm/theme-switch/ThemeSwitch.css.js +4 -0
  194. package/esm/theme-switch/ThemeSwitch.css.js.map +1 -0
  195. package/esm/theme-switch/ThemeSwitch.js +54 -0
  196. package/esm/theme-switch/ThemeSwitch.js.map +1 -0
  197. package/esm/user-settings/SettingsForm.css.js +4 -0
  198. package/esm/user-settings/SettingsForm.css.js.map +1 -0
  199. package/esm/user-settings/SettingsForm.js +162 -0
  200. package/esm/user-settings/SettingsForm.js.map +1 -0
  201. package/esm/user-settings/UserSettingsPanel.css.js +4 -0
  202. package/esm/user-settings/UserSettingsPanel.css.js.map +1 -0
  203. package/esm/user-settings/UserSettingsPanel.js +40 -0
  204. package/esm/user-settings/UserSettingsPanel.js.map +1 -0
  205. package/esm/workspace-management/LayoutList.css.js +4 -0
  206. package/esm/workspace-management/LayoutList.css.js.map +1 -0
  207. package/esm/workspace-management/LayoutList.js +114 -0
  208. package/esm/workspace-management/LayoutList.js.map +1 -0
  209. package/esm/workspace-management/LayoutTile.css.js +4 -0
  210. package/esm/workspace-management/LayoutTile.css.js.map +1 -0
  211. package/esm/workspace-management/LayoutTile.js +39 -0
  212. package/esm/workspace-management/LayoutTile.js.map +1 -0
  213. package/esm/workspace-management/SaveLayoutPanel.css.js +4 -0
  214. package/esm/workspace-management/SaveLayoutPanel.css.js.map +1 -0
  215. package/esm/workspace-management/SaveLayoutPanel.js +127 -0
  216. package/esm/workspace-management/SaveLayoutPanel.js.map +1 -0
  217. package/esm/workspace-management/WorkspaceProvider.js +261 -0
  218. package/esm/workspace-management/WorkspaceProvider.js.map +1 -0
  219. package/esm/workspace-management/defaultWorkspaceJSON.js +95 -0
  220. package/esm/workspace-management/defaultWorkspaceJSON.js.map +1 -0
  221. package/esm/workspace-management/screenshot-utils.js +23 -0
  222. package/esm/workspace-management/screenshot-utils.js.map +1 -0
  223. package/esm/workspace-management/useWorkspaceContextMenuItems.js +70 -0
  224. package/esm/workspace-management/useWorkspaceContextMenuItems.js.map +1 -0
  225. package/package.json +13 -13
@@ -0,0 +1,51 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Flexbox, LayoutContainer } from '@vuu-ui/vuu-layout';
3
+ import { VuuShellLocation } from '@vuu-ui/vuu-utils';
4
+ import { ContextPanel } from '../context-panel/ContextPanel.js';
5
+ import { SidePanel } from '../side-panel/SidePanel.js';
6
+ import { useMemo } from 'react';
7
+ import { ApplicationStatusBar } from '../../app-status-bar/AppStatusBar.js';
8
+
9
+ const useFullHeightLeftPanel = ({
10
+ appHeader,
11
+ SidePanelProps: LeftSidePanelProps,
12
+ htmlAttributes
13
+ }) => useMemo(
14
+ () => /* @__PURE__ */ jsxs(
15
+ Flexbox,
16
+ {
17
+ ...htmlAttributes,
18
+ style: {
19
+ ...htmlAttributes?.style,
20
+ flexDirection: "row"
21
+ },
22
+ children: [
23
+ /* @__PURE__ */ jsx(SidePanel, { ...LeftSidePanelProps, id: VuuShellLocation.SidePanel }),
24
+ /* @__PURE__ */ jsxs(
25
+ Flexbox,
26
+ {
27
+ className: "vuuShell-content",
28
+ style: { flex: 1, flexDirection: "column" },
29
+ children: [
30
+ appHeader,
31
+ /* @__PURE__ */ jsx(
32
+ LayoutContainer,
33
+ {
34
+ id: VuuShellLocation.WorkspaceContainer,
35
+ style: { flex: 1 }
36
+ },
37
+ "main-content"
38
+ ),
39
+ /* @__PURE__ */ jsx(ApplicationStatusBar, {})
40
+ ]
41
+ }
42
+ ),
43
+ /* @__PURE__ */ jsx(ContextPanel, { id: VuuShellLocation.ContextPanel, overlay: true })
44
+ ]
45
+ }
46
+ ),
47
+ [LeftSidePanelProps, appHeader, htmlAttributes]
48
+ );
49
+
50
+ export { useFullHeightLeftPanel };
51
+ //# sourceMappingURL=useFullHeightLeftPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFullHeightLeftPanel.js","sources":["../../../src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.tsx"],"sourcesContent":["import { LayoutContainer, Flexbox } from \"@vuu-ui/vuu-layout\";\nimport { VuuShellLocation } from \"@vuu-ui/vuu-utils\";\nimport { ContextPanel } from \"../context-panel\";\nimport { SidePanel } from \"../side-panel\";\nimport { ShellLayoutTemplateHook } from \"../useShellLayout\";\nimport { useMemo } from \"react\";\nimport { ApplicationStatusBar } from \"../../app-status-bar\";\n\nexport const useFullHeightLeftPanel: ShellLayoutTemplateHook = ({\n appHeader,\n SidePanelProps: LeftSidePanelProps,\n htmlAttributes,\n}) =>\n useMemo(\n () => (\n <Flexbox\n {...htmlAttributes}\n style={{\n ...htmlAttributes?.style,\n flexDirection: \"row\",\n }}\n >\n <SidePanel {...LeftSidePanelProps} id={VuuShellLocation.SidePanel} />\n <Flexbox\n className=\"vuuShell-content\"\n style={{ flex: 1, flexDirection: \"column\" }}\n >\n {appHeader}\n <LayoutContainer\n id={VuuShellLocation.WorkspaceContainer}\n key=\"main-content\"\n style={{ flex: 1 }}\n />\n <ApplicationStatusBar />\n </Flexbox>\n <ContextPanel id={VuuShellLocation.ContextPanel} overlay></ContextPanel>\n </Flexbox>\n ),\n [LeftSidePanelProps, appHeader, htmlAttributes],\n );\n"],"names":[],"mappings":";;;;;;;;AAQO,MAAM,yBAAkD,CAAC;AAAA,EAC9D,SAAA;AAAA,EACA,cAAgB,EAAA,kBAAA;AAAA,EAChB;AACF,CACE,KAAA,OAAA;AAAA,EACE,sBACE,IAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACE,GAAG,cAAA;AAAA,MACJ,KAAO,EAAA;AAAA,QACL,GAAG,cAAgB,EAAA,KAAA;AAAA,QACnB,aAAe,EAAA;AAAA,OACjB;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,SAAW,EAAA,EAAA,GAAG,kBAAoB,EAAA,EAAA,EAAI,iBAAiB,SAAW,EAAA,CAAA;AAAA,wBACnE,IAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YACC,SAAU,EAAA,kBAAA;AAAA,YACV,KAAO,EAAA,EAAE,IAAM,EAAA,CAAA,EAAG,eAAe,QAAS,EAAA;AAAA,YAEzC,QAAA,EAAA;AAAA,cAAA,SAAA;AAAA,8BACD,GAAA;AAAA,gBAAC,eAAA;AAAA,gBAAA;AAAA,kBACC,IAAI,gBAAiB,CAAA,kBAAA;AAAA,kBAErB,KAAA,EAAO,EAAE,IAAA,EAAM,CAAE;AAAA,iBAAA;AAAA,gBADb;AAAA,eAEN;AAAA,kCACC,oBAAqB,EAAA,EAAA;AAAA;AAAA;AAAA,SACxB;AAAA,4BACC,YAAa,EAAA,EAAA,EAAA,EAAI,gBAAiB,CAAA,YAAA,EAAc,SAAO,IAAC,EAAA;AAAA;AAAA;AAAA,GAC3D;AAAA,EAEF,CAAC,kBAAoB,EAAA,SAAA,EAAW,cAAc;AAChD;;;;"}
@@ -0,0 +1,81 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Flexbox, DockLayout, LayoutContainer, Drawer, View } from '@vuu-ui/vuu-layout';
3
+ import { VuuShellLocation } from '@vuu-ui/vuu-utils';
4
+ import { useRef, useState, useCallback, useMemo } from 'react';
5
+
6
+ const useInlayLeftPanel = ({
7
+ SidePanelProps: LeftSidePanelProps,
8
+ appHeader,
9
+ htmlAttributes
10
+ }) => {
11
+ const paletteView = useRef(null);
12
+ const [open, setOpen] = useState(true);
13
+ const handleDrawerClick = useCallback(
14
+ (e) => {
15
+ const target = e.target;
16
+ if (!paletteView.current?.contains(target)) {
17
+ setOpen(!open);
18
+ }
19
+ },
20
+ [open]
21
+ );
22
+ return useMemo(() => {
23
+ const getDrawers = (leftSidePanel) => {
24
+ const drawers = [];
25
+ drawers.push(
26
+ /* @__PURE__ */ jsx(
27
+ Drawer,
28
+ {
29
+ onClick: handleDrawerClick,
30
+ open,
31
+ position: "left",
32
+ inline: true,
33
+ peekaboo: true,
34
+ sizeOpen: 200,
35
+ toggleButton: "end",
36
+ children: /* @__PURE__ */ jsx(
37
+ View,
38
+ {
39
+ className: "vuuShell-palette",
40
+ id: "vw-app-palette",
41
+ ref: paletteView,
42
+ style: { height: "100%" },
43
+ children: leftSidePanel
44
+ },
45
+ "app-palette"
46
+ )
47
+ },
48
+ "left-panel"
49
+ )
50
+ );
51
+ return drawers;
52
+ };
53
+ return /* @__PURE__ */ jsxs(
54
+ Flexbox,
55
+ {
56
+ ...htmlAttributes,
57
+ style: {
58
+ ...htmlAttributes?.style,
59
+ flexDirection: "column"
60
+ },
61
+ children: [
62
+ appHeader,
63
+ /* @__PURE__ */ jsx(DockLayout, { style: { flex: 1 }, children: getDrawers(LeftSidePanelProps?.children).concat(
64
+ /* @__PURE__ */ jsx(
65
+ LayoutContainer,
66
+ {
67
+ dropTarget: true,
68
+ id: VuuShellLocation.WorkspaceContainer,
69
+ style: { width: "100%", height: "100%" }
70
+ },
71
+ "main-content"
72
+ )
73
+ ) })
74
+ ]
75
+ }
76
+ );
77
+ }, [LeftSidePanelProps, appHeader, handleDrawerClick, htmlAttributes, open]);
78
+ };
79
+
80
+ export { useInlayLeftPanel };
81
+ //# sourceMappingURL=useInlayLeftPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInlayLeftPanel.js","sources":["../../../src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.tsx"],"sourcesContent":["import {\n DockLayout,\n LayoutContainer,\n Drawer,\n Flexbox,\n View,\n} from \"@vuu-ui/vuu-layout\";\n\nimport { VuuShellLocation } from \"@vuu-ui/vuu-utils\";\nimport {\n MouseEvent,\n ReactElement,\n ReactNode,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { ShellLayoutTemplateHook } from \"../useShellLayout\";\n\nexport const useInlayLeftPanel: ShellLayoutTemplateHook = ({\n SidePanelProps: LeftSidePanelProps,\n appHeader,\n htmlAttributes,\n}) => {\n const paletteView = useRef<HTMLDivElement>(null);\n const [open, setOpen] = useState(true);\n const handleDrawerClick = useCallback(\n (e: MouseEvent<HTMLElement>) => {\n const target = e.target as HTMLElement;\n if (!paletteView.current?.contains(target)) {\n setOpen(!open);\n }\n },\n [open],\n );\n\n return useMemo(() => {\n const getDrawers = (leftSidePanel: ReactNode) => {\n const drawers: ReactElement[] = [];\n drawers.push(\n <Drawer\n key=\"left-panel\"\n onClick={handleDrawerClick}\n open={open}\n position=\"left\"\n inline\n peekaboo\n sizeOpen={200}\n toggleButton=\"end\"\n >\n <View\n className=\"vuuShell-palette\"\n id=\"vw-app-palette\"\n key=\"app-palette\"\n ref={paletteView}\n style={{ height: \"100%\" }}\n >\n {leftSidePanel}\n </View>\n </Drawer>,\n );\n\n return drawers;\n };\n\n return (\n <Flexbox\n {...htmlAttributes}\n style={{\n ...htmlAttributes?.style,\n flexDirection: \"column\",\n }}\n >\n {appHeader}\n <DockLayout style={{ flex: 1 }}>\n {getDrawers(LeftSidePanelProps?.children).concat(\n <LayoutContainer\n dropTarget\n id={VuuShellLocation.WorkspaceContainer}\n key=\"main-content\"\n style={{ width: \"100%\", height: \"100%\" }}\n />,\n )}\n </DockLayout>\n </Flexbox>\n );\n }, [LeftSidePanelProps, appHeader, handleDrawerClick, htmlAttributes, open]);\n};\n"],"names":[],"mappings":";;;;;AAoBO,MAAM,oBAA6C,CAAC;AAAA,EACzD,cAAgB,EAAA,kBAAA;AAAA,EAChB,SAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAAM,MAAA,WAAA,GAAc,OAAuB,IAAI,CAAA;AAC/C,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,IAAI,CAAA;AACrC,EAAA,MAAM,iBAAoB,GAAA,WAAA;AAAA,IACxB,CAAC,CAA+B,KAAA;AAC9B,MAAA,MAAM,SAAS,CAAE,CAAA,MAAA;AACjB,MAAA,IAAI,CAAC,WAAA,CAAY,OAAS,EAAA,QAAA,CAAS,MAAM,CAAG,EAAA;AAC1C,QAAA,OAAA,CAAQ,CAAC,IAAI,CAAA;AAAA;AACf,KACF;AAAA,IACA,CAAC,IAAI;AAAA,GACP;AAEA,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAM,MAAA,UAAA,GAAa,CAAC,aAA6B,KAAA;AAC/C,MAAA,MAAM,UAA0B,EAAC;AACjC,MAAQ,OAAA,CAAA,IAAA;AAAA,wBACN,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YAEC,OAAS,EAAA,iBAAA;AAAA,YACT,IAAA;AAAA,YACA,QAAS,EAAA,MAAA;AAAA,YACT,MAAM,EAAA,IAAA;AAAA,YACN,QAAQ,EAAA,IAAA;AAAA,YACR,QAAU,EAAA,GAAA;AAAA,YACV,YAAa,EAAA,KAAA;AAAA,YAEb,QAAA,kBAAA,GAAA;AAAA,cAAC,IAAA;AAAA,cAAA;AAAA,gBACC,SAAU,EAAA,kBAAA;AAAA,gBACV,EAAG,EAAA,gBAAA;AAAA,gBAEH,GAAK,EAAA,WAAA;AAAA,gBACL,KAAA,EAAO,EAAE,MAAA,EAAQ,MAAO,EAAA;AAAA,gBAEvB,QAAA,EAAA;AAAA,eAAA;AAAA,cAJG;AAAA;AAKN,WAAA;AAAA,UAjBI;AAAA;AAkBN,OACF;AAEA,MAAO,OAAA,OAAA;AAAA,KACT;AAEA,IACE,uBAAA,IAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACE,GAAG,cAAA;AAAA,QACJ,KAAO,EAAA;AAAA,UACL,GAAG,cAAgB,EAAA,KAAA;AAAA,UACnB,aAAe,EAAA;AAAA,SACjB;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,SAAA;AAAA,0BACD,GAAA,CAAC,UAAW,EAAA,EAAA,KAAA,EAAO,EAAE,IAAA,EAAM,GACxB,EAAA,QAAA,EAAA,UAAA,CAAW,kBAAoB,EAAA,QAAQ,CAAE,CAAA,MAAA;AAAA,4BACxC,GAAA;AAAA,cAAC,eAAA;AAAA,cAAA;AAAA,gBACC,UAAU,EAAA,IAAA;AAAA,gBACV,IAAI,gBAAiB,CAAA,kBAAA;AAAA,gBAErB,KAAO,EAAA,EAAE,KAAO,EAAA,MAAA,EAAQ,QAAQ,MAAO;AAAA,eAAA;AAAA,cADnC;AAAA;AAEN,WAEJ,EAAA;AAAA;AAAA;AAAA,KACF;AAAA,KAED,CAAC,kBAAA,EAAoB,WAAW,iBAAmB,EAAA,cAAA,EAAgB,IAAI,CAAC,CAAA;AAC7E;;;;"}
@@ -0,0 +1,44 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Flexbox, StackLayout } from '@vuu-ui/vuu-layout';
3
+ import { VuuShellLocation } from '@vuu-ui/vuu-utils';
4
+ import { useMemo } from 'react';
5
+
6
+ const useLeftMainTabs = ({
7
+ appHeader,
8
+ htmlAttributes,
9
+ ToolbarProps
10
+ }) => {
11
+ if (ToolbarProps === void 0) {
12
+ throw Error("LeftMainTabs layout requires ToolbarProps");
13
+ }
14
+ return useMemo(() => {
15
+ return /* @__PURE__ */ jsxs(
16
+ Flexbox,
17
+ {
18
+ ...htmlAttributes,
19
+ style: {
20
+ ...htmlAttributes?.style,
21
+ flexDirection: "column"
22
+ },
23
+ children: [
24
+ appHeader,
25
+ /* @__PURE__ */ jsx(
26
+ StackLayout,
27
+ {
28
+ TabstripProps: {
29
+ className: `${VuuShellLocation.MultiWorkspaceContainer}-tabs`
30
+ },
31
+ active: 0,
32
+ showTabs: "left",
33
+ style: { flex: 1 },
34
+ id: VuuShellLocation.MultiWorkspaceContainer
35
+ }
36
+ )
37
+ ]
38
+ }
39
+ );
40
+ }, [appHeader, htmlAttributes]);
41
+ };
42
+
43
+ export { useLeftMainTabs };
44
+ //# sourceMappingURL=useLeftMainTabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLeftMainTabs.js","sources":["../../../src/shell-layout-templates/left-main-tabs/useLeftMainTabs.tsx"],"sourcesContent":["import { Flexbox, StackLayout } from \"@vuu-ui/vuu-layout\";\n\nimport { VuuShellLocation } from \"@vuu-ui/vuu-utils\";\nimport { useMemo } from \"react\";\nimport { ShellLayoutTemplateHook } from \"../useShellLayout\";\n\nexport const useLeftMainTabs: ShellLayoutTemplateHook = ({\n appHeader,\n htmlAttributes,\n ToolbarProps,\n}) => {\n if (ToolbarProps === undefined) {\n throw Error(\"LeftMainTabs layout requires ToolbarProps\");\n }\n\n return useMemo(() => {\n return (\n <Flexbox\n {...htmlAttributes}\n style={{\n ...htmlAttributes?.style,\n flexDirection: \"column\",\n }}\n >\n {appHeader}\n <StackLayout\n TabstripProps={{\n className: `${VuuShellLocation.MultiWorkspaceContainer}-tabs`,\n }}\n active={0}\n showTabs=\"left\"\n style={{ flex: 1 }}\n id={VuuShellLocation.MultiWorkspaceContainer}\n />\n </Flexbox>\n );\n }, [appHeader, htmlAttributes]);\n};\n"],"names":[],"mappings":";;;;;AAMO,MAAM,kBAA2C,CAAC;AAAA,EACvD,SAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAAA,IAAI,iBAAiB,KAAW,CAAA,EAAA;AAC9B,IAAA,MAAM,MAAM,2CAA2C,CAAA;AAAA;AAGzD,EAAA,OAAO,QAAQ,MAAM;AACnB,IACE,uBAAA,IAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACE,GAAG,cAAA;AAAA,QACJ,KAAO,EAAA;AAAA,UACL,GAAG,cAAgB,EAAA,KAAA;AAAA,UACnB,aAAe,EAAA;AAAA,SACjB;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,SAAA;AAAA,0BACD,GAAA;AAAA,YAAC,WAAA;AAAA,YAAA;AAAA,cACC,aAAe,EAAA;AAAA,gBACb,SAAA,EAAW,CAAG,EAAA,gBAAA,CAAiB,uBAAuB,CAAA,KAAA;AAAA,eACxD;AAAA,cACA,MAAQ,EAAA,CAAA;AAAA,cACR,QAAS,EAAA,MAAA;AAAA,cACT,KAAA,EAAO,EAAE,IAAA,EAAM,CAAE,EAAA;AAAA,cACjB,IAAI,gBAAiB,CAAA;AAAA;AAAA;AACvB;AAAA;AAAA,KACF;AAAA,GAED,EAAA,CAAC,SAAW,EAAA,cAAc,CAAC,CAAA;AAChC;;;;"}
@@ -0,0 +1,4 @@
1
+ var sidePanelCss = ".vuuShellSidePanel {\n transition: width .2s ease-out;\n width: var(--shell-left-nav-size);\n}";
2
+
3
+ export { sidePanelCss as default };
4
+ //# sourceMappingURL=SidePanel.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidePanel.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,34 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
3
+ import cx from 'clsx';
4
+ import { useComponentCssInjection } from '@salt-ds/styles';
5
+ import { useWindow } from '@salt-ds/window';
6
+ import sidePanelCss from './SidePanel.css.js';
7
+
8
+ const classBase = "vuuShellSidePanel";
9
+ const SidePanel = ({
10
+ children,
11
+ open = true,
12
+ sizeClosed = 90,
13
+ sizeOpen = 200,
14
+ style: styleProp,
15
+ ...htmlAttributes
16
+ }) => {
17
+ const targetWindow = useWindow();
18
+ useComponentCssInjection({
19
+ testId: "vuu-side-panel",
20
+ css: sidePanelCss,
21
+ window: targetWindow
22
+ });
23
+ const style = useMemo(
24
+ () => ({
25
+ ...styleProp,
26
+ "--shell-left-nav-size": open ? `${sizeOpen}px` : `${sizeClosed}px`
27
+ }),
28
+ [open, sizeClosed, sizeOpen, styleProp]
29
+ );
30
+ return /* @__PURE__ */ jsx("div", { ...htmlAttributes, className: cx(classBase), style, children });
31
+ };
32
+
33
+ export { SidePanel };
34
+ //# sourceMappingURL=SidePanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidePanel.js","sources":["../../../src/shell-layout-templates/side-panel/SidePanel.tsx"],"sourcesContent":["import { CSSProperties, HTMLAttributes, useMemo } from \"react\";\nimport cx from \"clsx\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\n\nimport sidePanelCss from \"./SidePanel.css\";\n// import { useLayoutManager } from \"../../layout-management\";\n\nconst classBase = \"vuuShellSidePanel\";\n\nexport interface SidePanelProps extends HTMLAttributes<HTMLDivElement> {\n open?: boolean;\n path?: string;\n sizeOpen?: number;\n sizeClosed?: number;\n}\n\nexport const SidePanel = ({\n children,\n open = true,\n sizeClosed = 90,\n sizeOpen = 200,\n style: styleProp,\n ...htmlAttributes\n}: SidePanelProps) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-side-panel\",\n css: sidePanelCss,\n window: targetWindow,\n });\n\n // const { applicationJson, saveApplicationSettings } = useLayoutManager();\n // console.log(`settings`, {\n // expanded: applicationJson?.settings?.leftNav?.expanded,\n // active: applicationJson?.settings?.leftNav?.activeTabIndex,\n // });\n\n const style = useMemo(\n () =>\n ({\n ...styleProp,\n \"--shell-left-nav-size\": open ? `${sizeOpen}px` : `${sizeClosed}px`,\n } as CSSProperties),\n [open, sizeClosed, sizeOpen, styleProp]\n );\n return (\n <div {...htmlAttributes} className={cx(classBase)} style={style}>\n {children}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAQA,MAAM,SAAY,GAAA,mBAAA;AASX,MAAM,YAAY,CAAC;AAAA,EACxB,QAAA;AAAA,EACA,IAAO,GAAA,IAAA;AAAA,EACP,UAAa,GAAA,EAAA;AAAA,EACb,QAAW,GAAA,GAAA;AAAA,EACX,KAAO,EAAA,SAAA;AAAA,EACP,GAAG;AACL,CAAsB,KAAA;AACpB,EAAA,MAAM,eAAe,SAAU,EAAA;AAC/B,EAAyB,wBAAA,CAAA;AAAA,IACvB,MAAQ,EAAA,gBAAA;AAAA,IACR,GAAK,EAAA,YAAA;AAAA,IACL,MAAQ,EAAA;AAAA,GACT,CAAA;AAQD,EAAA,MAAM,KAAQ,GAAA,OAAA;AAAA,IACZ,OACG;AAAA,MACC,GAAG,SAAA;AAAA,MACH,yBAAyB,IAAO,GAAA,CAAA,EAAG,QAAQ,CAAA,EAAA,CAAA,GAAO,GAAG,UAAU,CAAA,EAAA;AAAA,KACjE,CAAA;AAAA,IACF,CAAC,IAAA,EAAM,UAAY,EAAA,QAAA,EAAU,SAAS;AAAA,GACxC;AACA,EACE,uBAAA,GAAA,CAAC,SAAK,GAAG,cAAA,EAAgB,WAAW,EAAG,CAAA,SAAS,CAAG,EAAA,KAAA,EAChD,QACH,EAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,46 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Flexbox, LayoutContainer } from '@vuu-ui/vuu-layout';
3
+ import { VuuShellLocation } from '@vuu-ui/vuu-utils';
4
+ import { ContextPanel } from '../context-panel/ContextPanel.js';
5
+ import { useMemo } from 'react';
6
+
7
+ const useSimpleContentPane = ({
8
+ appHeader,
9
+ htmlAttributes
10
+ }) => useMemo(
11
+ () => /* @__PURE__ */ jsxs(
12
+ Flexbox,
13
+ {
14
+ ...htmlAttributes,
15
+ style: {
16
+ ...htmlAttributes?.style,
17
+ flexDirection: "row"
18
+ },
19
+ children: [
20
+ /* @__PURE__ */ jsxs(
21
+ Flexbox,
22
+ {
23
+ className: "vuuShell-content",
24
+ style: { flex: 1, flexDirection: "column" },
25
+ children: [
26
+ appHeader,
27
+ /* @__PURE__ */ jsx(
28
+ LayoutContainer,
29
+ {
30
+ id: VuuShellLocation.WorkspaceContainer,
31
+ style: { flex: 1 }
32
+ },
33
+ "main-content"
34
+ )
35
+ ]
36
+ }
37
+ ),
38
+ /* @__PURE__ */ jsx(ContextPanel, { id: VuuShellLocation.ContextPanel, overlay: true })
39
+ ]
40
+ }
41
+ ),
42
+ [appHeader, htmlAttributes]
43
+ );
44
+
45
+ export { useSimpleContentPane };
46
+ //# sourceMappingURL=useSimpleContentPane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSimpleContentPane.js","sources":["../../../src/shell-layout-templates/simple-content-pane/useSimpleContentPane.tsx"],"sourcesContent":["import { LayoutContainer, Flexbox } from \"@vuu-ui/vuu-layout\";\nimport { VuuShellLocation } from \"@vuu-ui/vuu-utils\";\nimport { ContextPanel } from \"../context-panel\";\nimport { ShellLayoutTemplateHook } from \"../useShellLayout\";\nimport { useMemo } from \"react\";\n\nexport const useSimpleContentPane: ShellLayoutTemplateHook = ({\n appHeader,\n htmlAttributes,\n}) =>\n useMemo(\n () => (\n <Flexbox\n {...htmlAttributes}\n style={{\n ...htmlAttributes?.style,\n flexDirection: \"row\",\n }}\n >\n <Flexbox\n className=\"vuuShell-content\"\n style={{ flex: 1, flexDirection: \"column\" }}\n >\n {appHeader}\n <LayoutContainer\n id={VuuShellLocation.WorkspaceContainer}\n key=\"main-content\"\n style={{ flex: 1 }}\n />\n </Flexbox>\n <ContextPanel id={VuuShellLocation.ContextPanel} overlay></ContextPanel>\n </Flexbox>\n ),\n [appHeader, htmlAttributes],\n );\n"],"names":[],"mappings":";;;;;;AAMO,MAAM,uBAAgD,CAAC;AAAA,EAC5D,SAAA;AAAA,EACA;AACF,CACE,KAAA,OAAA;AAAA,EACE,sBACE,IAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACE,GAAG,cAAA;AAAA,MACJ,KAAO,EAAA;AAAA,QACL,GAAG,cAAgB,EAAA,KAAA;AAAA,QACnB,aAAe,EAAA;AAAA,OACjB;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,IAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YACC,SAAU,EAAA,kBAAA;AAAA,YACV,KAAO,EAAA,EAAE,IAAM,EAAA,CAAA,EAAG,eAAe,QAAS,EAAA;AAAA,YAEzC,QAAA,EAAA;AAAA,cAAA,SAAA;AAAA,8BACD,GAAA;AAAA,gBAAC,eAAA;AAAA,gBAAA;AAAA,kBACC,IAAI,gBAAiB,CAAA,kBAAA;AAAA,kBAErB,KAAA,EAAO,EAAE,IAAA,EAAM,CAAE;AAAA,iBAAA;AAAA,gBADb;AAAA;AAEN;AAAA;AAAA,SACF;AAAA,4BACC,YAAa,EAAA,EAAA,EAAA,EAAI,gBAAiB,CAAA,YAAA,EAAc,SAAO,IAAC,EAAA;AAAA;AAAA;AAAA,GAC3D;AAAA,EAEF,CAAC,WAAW,cAAc;AAC5B;;;;"}
@@ -0,0 +1,21 @@
1
+ import { useFullHeightLeftPanel } from './full-height-left-panel/useFullHeightLeftPanel.js';
2
+ import { useInlayLeftPanel } from './inlay-left-panel/useInlayLeftPanel.js';
3
+ import { useLeftMainTabs } from './left-main-tabs/useLeftMainTabs.js';
4
+ import { useSimpleContentPane } from './simple-content-pane/useSimpleContentPane.js';
5
+
6
+ const LayoutHook = {
7
+ "full-height": useFullHeightLeftPanel,
8
+ inlay: useInlayLeftPanel,
9
+ "left-main-tabs": useLeftMainTabs,
10
+ "simple-content-pane": useSimpleContentPane
11
+ };
12
+ const useShellLayout = ({
13
+ layoutTemplateId = "simple-content-pane",
14
+ ...props
15
+ }) => {
16
+ const useLayoutHook = LayoutHook[layoutTemplateId];
17
+ return useLayoutHook(props);
18
+ };
19
+
20
+ export { useShellLayout };
21
+ //# sourceMappingURL=useShellLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useShellLayout.js","sources":["../../src/shell-layout-templates/useShellLayout.ts"],"sourcesContent":["import { HTMLAttributes, ReactElement, ReactNode } from \"react\";\nimport { useFullHeightLeftPanel } from \"./full-height-left-panel/useFullHeightLeftPanel\";\nimport { useInlayLeftPanel } from \"./inlay-left-panel/useInlayLeftPanel\";\nimport { useLeftMainTabs } from \"./left-main-tabs/useLeftMainTabs\";\nimport { useSimpleContentPane } from \"./simple-content-pane/useSimpleContentPane\";\nimport { SidePanelProps as ShellSidePanelProps } from \"./side-panel\";\n\nconst LayoutHook = {\n \"full-height\": useFullHeightLeftPanel,\n inlay: useInlayLeftPanel,\n \"left-main-tabs\": useLeftMainTabs,\n \"simple-content-pane\": useSimpleContentPane,\n};\n\nexport type LayoutTemplateId = keyof typeof LayoutHook;\n\nexport type ShellLayoutTemplateProps = Omit<\n ShellLayoutProps,\n \"layoutTemplateId\"\n>;\n\nexport type ShellToolbarProps = {\n children: ReactNode;\n position?: \"left\";\n width?: number;\n};\n\nexport type ShellLayoutTemplateHook = (\n props: ShellLayoutTemplateProps,\n) => ReactElement;\n\n/**\n * The Shell Layout is the outermost 'chrome' of the appliciation,\n * enclosing the main content area. It will be rendered by one of\n * two available templates, determined by the layoutTemplateId,\n */\nexport interface ShellLayoutProps {\n /**\n * App Header will be rendered in position determined by layout-template\n */\n appHeader?: ReactNode;\n\n /**\n * HTML attributes that will be applied to root div.\n */\n htmlAttributes?: HTMLAttributes<HTMLDivElement>;\n /**\n * identifier for shell layout template to be used. Default template\n * will be \"inlay\"\n */\n layoutTemplateId?: LayoutTemplateId;\n /**\n * If template renders SidePanel, these props will be provided\n */\n SidePanelProps?: ShellSidePanelProps;\n /**\n * If template renders Toolbar, these props will be provided\n */\n ToolbarProps?: ShellToolbarProps;\n}\n\n/**\n * This hook acts as a stub for the actual shell layout\n * template hooks. It will delegate to the appropriate shell\n * layout hook, based on the value of layoutTemplateId.\n */\nexport const useShellLayout = ({\n layoutTemplateId = \"simple-content-pane\",\n ...props\n}: ShellLayoutProps) => {\n const useLayoutHook = LayoutHook[layoutTemplateId];\n return useLayoutHook(props);\n};\n"],"names":[],"mappings":";;;;;AAOA,MAAM,UAAa,GAAA;AAAA,EACjB,aAAe,EAAA,sBAAA;AAAA,EACf,KAAO,EAAA,iBAAA;AAAA,EACP,gBAAkB,EAAA,eAAA;AAAA,EAClB,qBAAuB,EAAA;AACzB,CAAA;AAsDO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,gBAAmB,GAAA,qBAAA;AAAA,EACnB,GAAG;AACL,CAAwB,KAAA;AACtB,EAAM,MAAA,aAAA,GAAgB,WAAW,gBAAgB,CAAA;AACjD,EAAA,OAAO,cAAc,KAAK,CAAA;AAC5B;;;;"}
@@ -0,0 +1,4 @@
1
+ var shellCss = ".vuuShell {\n background-color: var(\n --vuuShell-background,\n var(--salt-container-primary-background)\n );\n height: var(--vuuShell-height, 100vh);\n width: var(--vuuShell-width, 100vw);\n\n .left-main-tabs {\n --vuuOverflowContainer-width: 48px;\n }\n}\n\n.vuu-workspace-tabs {\n background: var(\n --vuuWorkspace-background,\n var(--salt-container-primary-background)\n );\n}\n\n.vuuShell-palette {\n --vuuView-border: none;\n --vuuView-margin: 0;\n}\n\n.vuuShell-warningPlaceholder {\n background-color: var(--salt-container-background-high);\n height: 100%;\n}\n\n/* until we reinstat5e the toolbar */\n.vuuToolbarProxy {\n background: var(--salt-container-primary-background);\n}\n\n.vuu-workspace-tabs > .vuuTabstrip > .vuuOverflowContainer-wrapContainer {\n background: var(--vuuShell-background, var(--vuu-color-gray-25));\n}\n\n.vuu-workspace-tabs {\n --vuuTab-height: 28px;\n border: solid 1px var(--salt-separable-primary-borderColor);\n border-top: none !important;\n border-radius: 6px;\n height: 100%;\n padding: 36px 8px 8px 8px;\n position: relative;\n width: 100%;\n}\n\n.vuu-workspace-tabs > .vuuTabstrip {\n left: 0px;\n padding-bottom: 7px;\n position: absolute !important;\n right: 0px;\n top: 0;\n}\n\n.vuuShell-content {\n padding: var(--vuuShell-content-padding, 8px);\n}\n";
2
+
3
+ export { shellCss as default };
4
+ //# sourceMappingURL=shell.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
package/esm/shell.js ADDED
@@ -0,0 +1,159 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { ConnectionManager } from '@vuu-ui/vuu-data-remote';
3
+ import { StackLayout, LayoutProvider } from '@vuu-ui/vuu-layout';
4
+ import { DialogProvider, NotificationsProvider, useNotifications } from '@vuu-ui/vuu-popups';
5
+ import { registerComponent, logger } from '@vuu-ui/vuu-utils';
6
+ import { useComponentCssInjection } from '@salt-ds/styles';
7
+ import { useWindow } from '@salt-ds/window';
8
+ import { useMemo, useCallback } from 'react';
9
+ import { AppHeader } from './app-header/AppHeader.js';
10
+ import { ApplicationProvider } from './application-provider/ApplicationProvider.js';
11
+ import { usePersistenceManager, PersistenceProvider } from './persistence-manager/PersistenceProvider.js';
12
+ import { LocalPersistenceManager } from './persistence-manager/LocalPersistenceManager.js';
13
+ import '@vuu-ui/vuu-ui-controls';
14
+ import '@salt-ds/core';
15
+ import 'clsx';
16
+ import './persistence-manager/StaticPersistenceManager.js';
17
+ import { useShellLayout } from './shell-layout-templates/useShellLayout.js';
18
+ import { UserSettingsPanel } from './user-settings/UserSettingsPanel.js';
19
+ import 'html-to-image';
20
+ import { WorkspaceProvider, useWorkspace } from './workspace-management/WorkspaceProvider.js';
21
+ import './feature-and-layout-provider/FeatureAndLayoutProvider.js';
22
+ import { loadingJSON } from './workspace-management/defaultWorkspaceJSON.js';
23
+ import { useWorkspaceContextMenuItems } from './workspace-management/useWorkspaceContextMenuItems.js';
24
+ import shellCss from './shell.css.js';
25
+ import { ContextMenuProvider } from '@vuu-ui/vuu-context-menu';
26
+
27
+ registerComponent("ApplicationSettings", UserSettingsPanel, "view");
28
+ if (process.env.NODE_ENV === "production") {
29
+ if (typeof StackLayout !== "function") {
30
+ console.warn(
31
+ "StackLayout module not loaded, will be unable to deserialize from layout JSON"
32
+ );
33
+ }
34
+ }
35
+ const { error } = logger("Shell");
36
+ const defaultAppHeader = /* @__PURE__ */ jsx(AppHeader, {});
37
+ const getAppHeader = (shellLayoutProps) => shellLayoutProps?.appHeader ?? defaultAppHeader;
38
+ const defaultHTMLAttributes = {
39
+ className: "vuuShell"
40
+ };
41
+ const getHTMLAttributes = (props) => {
42
+ if (props?.htmlAttributes) {
43
+ return {
44
+ ...defaultHTMLAttributes,
45
+ ...props.htmlAttributes
46
+ };
47
+ } else {
48
+ return defaultHTMLAttributes;
49
+ }
50
+ };
51
+ const VuuApplication = ({
52
+ shellLayoutProps: ShellLayoutProps2,
53
+ children,
54
+ // loginUrl, // need to make this available to app header
55
+ serverUrl,
56
+ user
57
+ }) => {
58
+ const targetWindow = useWindow();
59
+ useComponentCssInjection({
60
+ testId: "vuu-shell",
61
+ css: shellCss,
62
+ window: targetWindow
63
+ });
64
+ const notify = useNotifications();
65
+ const { workspaceJSON, saveApplicationLayout } = useWorkspace();
66
+ const { buildMenuOptions, handleMenuAction } = useWorkspaceContextMenuItems();
67
+ const handleLayoutChange = useCallback(
68
+ (layout) => {
69
+ try {
70
+ saveApplicationLayout(layout);
71
+ } catch {
72
+ error?.("Failed to save layout");
73
+ }
74
+ },
75
+ [saveApplicationLayout]
76
+ );
77
+ useMemo(async () => {
78
+ if (serverUrl && user.token) {
79
+ const connectionResult = await ConnectionManager.connect({
80
+ token: user.token,
81
+ url: serverUrl,
82
+ username: user.username
83
+ });
84
+ if (connectionResult === "rejected") {
85
+ notify({
86
+ type: "error",
87
+ body: "Unable to connect to VUU Server",
88
+ header: "Error"
89
+ });
90
+ }
91
+ } else {
92
+ console.warn(
93
+ `Shell: serverUrl: '${serverUrl}', token: '${Array(user.token.length).fill("#").join("")}'
94
+ `
95
+ );
96
+ }
97
+ }, [notify, serverUrl, user.token, user.username]);
98
+ const isLayoutLoading = workspaceJSON === loadingJSON;
99
+ const initialLayout = useShellLayout({
100
+ ...ShellLayoutProps2,
101
+ appHeader: getAppHeader(ShellLayoutProps2),
102
+ htmlAttributes: getHTMLAttributes(ShellLayoutProps2)
103
+ });
104
+ return isLayoutLoading ? null : /* @__PURE__ */ jsxs(
105
+ ContextMenuProvider,
106
+ {
107
+ menuActionHandler: handleMenuAction,
108
+ menuBuilder: buildMenuOptions,
109
+ children: [
110
+ /* @__PURE__ */ jsx(
111
+ LayoutProvider,
112
+ {
113
+ workspaceJSON,
114
+ onLayoutChange: handleLayoutChange,
115
+ children: initialLayout
116
+ }
117
+ ),
118
+ children
119
+ ]
120
+ }
121
+ );
122
+ };
123
+ const Shell = ({
124
+ loginUrl,
125
+ user,
126
+ userSettingsSchema,
127
+ workspaceProps,
128
+ ...props
129
+ }) => {
130
+ const persistenceManager = usePersistenceManager();
131
+ const localPersistenceManager = useMemo(() => {
132
+ if (persistenceManager) {
133
+ return void 0;
134
+ }
135
+ console.log(
136
+ `No Persistence Manager, configuration data will be persisted to Local Storage, key: 'vuu/${user.username}'`
137
+ );
138
+ return new LocalPersistenceManager(`vuu/${user.username}`);
139
+ }, [persistenceManager, user.username]);
140
+ const shellProviders = /* @__PURE__ */ jsx(
141
+ ApplicationProvider,
142
+ {
143
+ density: "high",
144
+ loginUrl,
145
+ theme: "vuu-theme",
146
+ user,
147
+ userSettingsSchema,
148
+ children: /* @__PURE__ */ jsx(WorkspaceProvider, { ...workspaceProps, children: /* @__PURE__ */ jsx(DialogProvider, { children: /* @__PURE__ */ jsx(NotificationsProvider, { children: /* @__PURE__ */ jsx(VuuApplication, { ...props, user }) }) }) })
149
+ }
150
+ );
151
+ if (persistenceManager) {
152
+ return shellProviders;
153
+ } else {
154
+ return /* @__PURE__ */ jsx(PersistenceProvider, { persistenceManager: localPersistenceManager, children: shellProviders });
155
+ }
156
+ };
157
+
158
+ export { Shell };
159
+ //# sourceMappingURL=shell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell.js","sources":["../src/shell.tsx"],"sourcesContent":["import { ConnectionManager } from \"@vuu-ui/vuu-data-remote\";\nimport type { LayoutChangeHandler } from \"@vuu-ui/vuu-layout\";\nimport { LayoutProvider, StackLayout } from \"@vuu-ui/vuu-layout\";\nimport {\n DialogProvider,\n NotificationsProvider,\n useNotifications,\n} from \"@vuu-ui/vuu-popups\";\nimport { VuuUser, logger, registerComponent } from \"@vuu-ui/vuu-utils\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { HTMLAttributes, ReactNode, useCallback, useMemo } from \"react\";\nimport { AppHeader } from \"./app-header\";\nimport { ApplicationProvider } from \"./application-provider\";\nimport {\n IPersistenceManager,\n LocalPersistenceManager,\n PersistenceProvider,\n usePersistenceManager,\n} from \"./persistence-manager\";\nimport { ShellLayoutProps, useShellLayout } from \"./shell-layout-templates\";\nimport { SettingsSchema, UserSettingsPanel } from \"./user-settings\";\nimport {\n WorkspaceProps,\n WorkspaceProvider,\n useWorkspace,\n useWorkspaceContextMenuItems,\n} from \"./workspace-management\";\n\nimport shellCss from \"./shell.css\";\nimport { loadingJSON } from \"./workspace-management/defaultWorkspaceJSON\";\nimport { ContextMenuProvider } from \"@vuu-ui/vuu-context-menu\";\n\nregisterComponent(\"ApplicationSettings\", UserSettingsPanel, \"view\");\n\nif (process.env.NODE_ENV === \"production\") {\n // StackLayout is loaded just to force component registration, we know it will be\n // required when default layout is instantiated. This is only required in prod\n // to avoif tree shaking the Stack away. Causes a runtime issue in dev.\n if (typeof StackLayout !== \"function\") {\n console.warn(\n \"StackLayout module not loaded, will be unable to deserialize from layout JSON\",\n );\n }\n}\n\nconst { error } = logger(\"Shell\");\n\nexport type LayoutTemplateName = \"full-height\" | \"inlay\";\n\nexport interface ShellProps extends HTMLAttributes<HTMLDivElement> {\n shellLayoutProps?: ShellLayoutProps;\n userSettingsSchema?: SettingsSchema;\n workspaceProps?: WorkspaceProps;\n children?: ReactNode;\n loginUrl?: string;\n saveUrl?: string;\n serverUrl?: string;\n user: VuuUser;\n}\n\nconst defaultAppHeader = <AppHeader />;\n\nconst getAppHeader = (shellLayoutProps?: ShellLayoutProps) =>\n shellLayoutProps?.appHeader ?? defaultAppHeader;\n\nconst defaultHTMLAttributes: HTMLAttributes<HTMLDivElement> = {\n className: \"vuuShell\",\n};\n\nconst getHTMLAttributes = (props?: ShellLayoutProps) => {\n if (props?.htmlAttributes) {\n return {\n ...defaultHTMLAttributes,\n ...props.htmlAttributes,\n };\n } else {\n return defaultHTMLAttributes;\n }\n};\n\nconst VuuApplication = ({\n shellLayoutProps: ShellLayoutProps,\n children,\n // loginUrl, // need to make this available to app header\n serverUrl,\n user,\n}: Omit<\n ShellProps,\n \"ContentLayoutProps\" | \"loginUrl\" | \"userSettingsSchema\" | \"workspaceProps\"\n>) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-shell\",\n css: shellCss,\n window: targetWindow,\n });\n\n const notify = useNotifications();\n const { workspaceJSON, saveApplicationLayout } = useWorkspace();\n\n const { buildMenuOptions, handleMenuAction } = useWorkspaceContextMenuItems();\n\n const handleLayoutChange = useCallback<LayoutChangeHandler>(\n (layout) => {\n try {\n saveApplicationLayout(layout);\n } catch {\n error?.(\"Failed to save layout\");\n }\n },\n [saveApplicationLayout],\n );\n\n useMemo(async () => {\n if (serverUrl && user.token) {\n const connectionResult = await ConnectionManager.connect({\n token: user.token,\n url: serverUrl,\n username: user.username,\n });\n if (connectionResult === \"rejected\") {\n notify({\n type: \"error\",\n body: \"Unable to connect to VUU Server\",\n header: \"Error\",\n });\n }\n } else {\n console.warn(\n `Shell: serverUrl: '${serverUrl}', token: '${Array(user.token.length)\n .fill(\"#\")\n .join(\"\")}' \n `,\n );\n }\n }, [notify, serverUrl, user.token, user.username]);\n\n const isLayoutLoading = workspaceJSON === loadingJSON;\n\n const initialLayout = useShellLayout({\n ...ShellLayoutProps,\n appHeader: getAppHeader(ShellLayoutProps),\n htmlAttributes: getHTMLAttributes(ShellLayoutProps),\n });\n\n return isLayoutLoading ? null : (\n <ContextMenuProvider\n menuActionHandler={handleMenuAction}\n menuBuilder={buildMenuOptions}\n >\n <LayoutProvider\n workspaceJSON={workspaceJSON}\n onLayoutChange={handleLayoutChange}\n >\n {initialLayout}\n </LayoutProvider>\n {children}\n </ContextMenuProvider>\n );\n};\n\nexport const Shell = ({\n loginUrl,\n user,\n userSettingsSchema,\n workspaceProps,\n ...props\n}: ShellProps) => {\n // If user has provided an implementation of IPersistenceManager\n // by wrapping higher level PersistenceProvider, use it, otw\n // default to LocalPersistenceManager\n const persistenceManager = usePersistenceManager();\n const localPersistenceManager = useMemo<\n IPersistenceManager | undefined\n >(() => {\n if (persistenceManager) {\n return undefined;\n }\n console.log(\n `No Persistence Manager, configuration data will be persisted to Local Storage, key: 'vuu/${user.username}'`,\n );\n return new LocalPersistenceManager(`vuu/${user.username}`);\n }, [persistenceManager, user.username]);\n\n // ApplicationProvider must go outside Dialog and Notification providers\n // ApplicationProvider injects the SaltProvider and this must be the root\n // SaltProvider.\n\n const shellProviders = (\n <ApplicationProvider\n density=\"high\"\n loginUrl={loginUrl}\n theme=\"vuu-theme\"\n user={user}\n userSettingsSchema={userSettingsSchema}\n >\n <WorkspaceProvider {...workspaceProps}>\n <DialogProvider>\n <NotificationsProvider>\n <VuuApplication {...props} user={user} />\n </NotificationsProvider>\n </DialogProvider>\n </WorkspaceProvider>\n </ApplicationProvider>\n );\n\n if (persistenceManager) {\n return shellProviders;\n } else {\n return (\n <PersistenceProvider persistenceManager={localPersistenceManager}>\n {shellProviders}\n </PersistenceProvider>\n );\n }\n};\n"],"names":["ShellLayoutProps"],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ var themeSwitchCss = "\n.vuuThemeSwitch {\n --saltButton-minWidth: 22px;\n --svg-light: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><path d=\"M24 31q2.9 0 4.95-2.05Q31 26.9 31 24q0-2.9-2.05-4.95Q26.9 17 24 17q-2.9 0-4.95 2.05Q17 21.1 17 24q0 2.9 2.05 4.95Q21.1 31 24 31Zm0 3q-4.15 0-7.075-2.925T14 24q0-4.15 2.925-7.075T24 14q4.15 0 7.075 2.925T34 24q0 4.15-2.925 7.075T24 34ZM3.5 25.5q-.65 0-1.075-.425Q2 24.65 2 24q0-.65.425-1.075Q2.85 22.5 3.5 22.5h5q.65 0 1.075.425Q10 23.35 10 24q0 .65-.425 1.075-.425.425-1.075.425Zm36 0q-.65 0-1.075-.425Q38 24.65 38 24q0-.65.425-1.075.425-.425 1.075-.425h5q.65 0 1.075.425Q46 23.35 46 24q0 .65-.425 1.075-.425.425-1.075.425ZM24 10q-.65 0-1.075-.425Q22.5 9.15 22.5 8.5v-5q0-.65.425-1.075Q23.35 2 24 2q.65 0 1.075.425.425.425.425 1.075v5q0 .65-.425 1.075Q24.65 10 24 10Zm0 36q-.65 0-1.075-.425-.425-.425-.425-1.075v-5q0-.65.425-1.075Q23.35 38 24 38q.65 0 1.075.425.425.425.425 1.075v5q0 .65-.425 1.075Q24.65 46 24 46ZM12 14.1l-2.85-2.8q-.45-.45-.425-1.075.025-.625.425-1.075.45-.45 1.075-.45t1.075.45L14.1 12q.4.45.4 1.05 0 .6-.4 1-.4.45-1.025.45-.625 0-1.075-.4Zm24.7 24.75L33.9 36q-.4-.45-.4-1.075t.45-1.025q.4-.45 1-.45t1.05.45l2.85 2.8q.45.45.425 1.075-.025.625-.425 1.075-.45.45-1.075.45t-1.075-.45ZM33.9 14.1q-.45-.45-.45-1.05 0-.6.45-1.05l2.8-2.85q.45-.45 1.075-.425.625.025 1.075.425.45.45.45 1.075t-.45 1.075L36 14.1q-.4.4-1.025.4-.625 0-1.075-.4ZM9.15 38.85q-.45-.45-.45-1.075t.45-1.075L12 33.9q.45-.45 1.05-.45.6 0 1.05.45.45.45.45 1.05 0 .6-.45 1.05l-2.8 2.85q-.45.45-1.075.425-.625-.025-1.075-.425ZM24 24Z\"/></svg>');\n --svg-dark: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><path d=\"M24 42q-7.5 0-12.75-5.25T6 24q0-7.5 5.25-12.75T24 6q.4 0 .85.025.45.025 1.15.075-1.8 1.6-2.8 3.95-1 2.35-1 4.95 0 4.5 3.15 7.65Q28.5 25.8 33 25.8q2.6 0 4.95-.925T41.9 22.3q.05.6.075.975Q42 23.65 42 24q0 7.5-5.25 12.75T24 42Zm0-3q5.45 0 9.5-3.375t5.05-7.925q-1.25.55-2.675.825Q34.45 28.8 33 28.8q-5.75 0-9.775-4.025T19.2 15q0-1.2.25-2.575.25-1.375.9-3.125-4.9 1.35-8.125 5.475Q9 18.9 9 24q0 6.25 4.375 10.625T24 39Zm-.2-14.85Z\"/></svg>');\n padding: 2px;\n}\n\n.salt-density-high .vuuThemeSwitch {\n --saltButton-minWidth: 16px;\n --saltButton-width: 18px;\n --vuuThemeSwitch-iconSize: 16px;\n}\n\n.vuuThemeSwitch [data-icon] {\n --vuu-icon-size: var(--vuuThemeSwitch-iconSize,18px);\n}\n\n.vuuThemeSwitch [data-icon='light'] {\n --vuu-icon-svg: var(--svg-light);\n}\n.vuuThemeSwitch [data-icon='dark'] {\n --vuu-icon-svg: var(--svg-dark);\n}\n\n.vuuThemeSwitch .saltToggleButton {\n height: 20px;\n width: 20px;\n}\n\n";
2
+
3
+ export { themeSwitchCss as default };
4
+ //# sourceMappingURL=ThemeSwitch.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeSwitch.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,54 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import cx from 'clsx';
3
+ import { useControlled, ToggleButtonGroup, ToggleButton } from '@salt-ds/core';
4
+ import { useComponentCssInjection } from '@salt-ds/styles';
5
+ import { useWindow } from '@salt-ds/window';
6
+ import { useCallback } from 'react';
7
+ import themeSwitchCss from './ThemeSwitch.css.js';
8
+
9
+ const classBase = "vuuThemeSwitch";
10
+ const ThemeSwitch = ({
11
+ className: classNameProp,
12
+ defaultMode: defaultModeProp,
13
+ mode: modeProp,
14
+ onChange,
15
+ ...htmlAttributes
16
+ }) => {
17
+ const targetWindow = useWindow();
18
+ useComponentCssInjection({
19
+ testId: "vuu-theme-switch",
20
+ css: themeSwitchCss,
21
+ window: targetWindow
22
+ });
23
+ const [mode, setMode] = useControlled({
24
+ controlled: modeProp,
25
+ default: defaultModeProp ?? "light",
26
+ name: "ThemeSwitch",
27
+ state: "mode"
28
+ });
29
+ const handleChangeSecondary = useCallback(
30
+ (evt) => {
31
+ const { value } = evt.target;
32
+ setMode(value);
33
+ onChange(value);
34
+ },
35
+ [onChange, setMode]
36
+ );
37
+ const className = cx(classBase, classNameProp);
38
+ return /* @__PURE__ */ jsxs(
39
+ ToggleButtonGroup,
40
+ {
41
+ className,
42
+ ...htmlAttributes,
43
+ onChange: handleChangeSecondary,
44
+ value: mode,
45
+ children: [
46
+ /* @__PURE__ */ jsx(ToggleButton, { "aria-label": "alert", "data-icon": "light", value: "light" }),
47
+ /* @__PURE__ */ jsx(ToggleButton, { "aria-label": "home", "data-icon": "dark", value: "dark" })
48
+ ]
49
+ }
50
+ );
51
+ };
52
+
53
+ export { ThemeSwitch };
54
+ //# sourceMappingURL=ThemeSwitch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeSwitch.js","sources":["../../src/theme-switch/ThemeSwitch.tsx"],"sourcesContent":["import cx from \"clsx\";\nimport { ToggleButton, ToggleButtonGroup, useControlled } from \"@salt-ds/core\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { HTMLAttributes, SyntheticEvent, useCallback } from \"react\";\nimport { ThemeMode } from \"@vuu-ui/vuu-utils\";\n\nimport themeSwitchCss from \"./ThemeSwitch.css\";\n\nconst classBase = \"vuuThemeSwitch\";\nexport interface ThemeSwitchProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n defaultMode?: ThemeMode;\n mode?: ThemeMode;\n onChange: (mode: ThemeMode) => void;\n}\n\nexport const ThemeSwitch = ({\n className: classNameProp,\n defaultMode: defaultModeProp,\n mode: modeProp,\n onChange,\n ...htmlAttributes\n}: ThemeSwitchProps) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"vuu-theme-switch\",\n css: themeSwitchCss,\n window: targetWindow,\n });\n\n const [mode, setMode] = useControlled<ThemeMode>({\n controlled: modeProp,\n default: defaultModeProp ?? \"light\",\n name: \"ThemeSwitch\",\n state: \"mode\",\n });\n\n const handleChangeSecondary = useCallback(\n (evt: SyntheticEvent<HTMLButtonElement>) => {\n const { value } = evt.target as HTMLButtonElement;\n setMode(value as ThemeMode);\n onChange(value as ThemeMode);\n },\n [onChange, setMode],\n );\n const className = cx(classBase, classNameProp);\n return (\n <ToggleButtonGroup\n className={className}\n {...htmlAttributes}\n onChange={handleChangeSecondary}\n value={mode}\n >\n <ToggleButton aria-label=\"alert\" data-icon=\"light\" value=\"light\" />\n <ToggleButton aria-label=\"home\" data-icon=\"dark\" value=\"dark\" />\n </ToggleButtonGroup>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AASA,MAAM,SAAY,GAAA,gBAAA;AAQX,MAAM,cAAc,CAAC;AAAA,EAC1B,SAAW,EAAA,aAAA;AAAA,EACX,WAAa,EAAA,eAAA;AAAA,EACb,IAAM,EAAA,QAAA;AAAA,EACN,QAAA;AAAA,EACA,GAAG;AACL,CAAwB,KAAA;AACtB,EAAA,MAAM,eAAe,SAAU,EAAA;AAC/B,EAAyB,wBAAA,CAAA;AAAA,IACvB,MAAQ,EAAA,kBAAA;AAAA,IACR,GAAK,EAAA,cAAA;AAAA,IACL,MAAQ,EAAA;AAAA,GACT,CAAA;AAED,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,aAAyB,CAAA;AAAA,IAC/C,UAAY,EAAA,QAAA;AAAA,IACZ,SAAS,eAAmB,IAAA,OAAA;AAAA,IAC5B,IAAM,EAAA,aAAA;AAAA,IACN,KAAO,EAAA;AAAA,GACR,CAAA;AAED,EAAA,MAAM,qBAAwB,GAAA,WAAA;AAAA,IAC5B,CAAC,GAA2C,KAAA;AAC1C,MAAM,MAAA,EAAE,KAAM,EAAA,GAAI,GAAI,CAAA,MAAA;AACtB,MAAA,OAAA,CAAQ,KAAkB,CAAA;AAC1B,MAAA,QAAA,CAAS,KAAkB,CAAA;AAAA,KAC7B;AAAA,IACA,CAAC,UAAU,OAAO;AAAA,GACpB;AACA,EAAM,MAAA,SAAA,GAAY,EAAG,CAAA,SAAA,EAAW,aAAa,CAAA;AAC7C,EACE,uBAAA,IAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,SAAA;AAAA,MACC,GAAG,cAAA;AAAA,MACJ,QAAU,EAAA,qBAAA;AAAA,MACV,KAAO,EAAA,IAAA;AAAA,MAEP,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,gBAAa,YAAW,EAAA,OAAA,EAAQ,WAAU,EAAA,OAAA,EAAQ,OAAM,OAAQ,EAAA,CAAA;AAAA,4BAChE,YAAa,EAAA,EAAA,YAAA,EAAW,QAAO,WAAU,EAAA,MAAA,EAAO,OAAM,MAAO,EAAA;AAAA;AAAA;AAAA,GAChE;AAEJ;;;;"}
@@ -0,0 +1,4 @@
1
+ var settingsFormCss = ".vuuSettingsForm {\n display: flex;\n flex-direction: column;\n gap: var(--salt-spacing-200);\n}\n";
2
+
3
+ export { settingsFormCss as default };
4
+ //# sourceMappingURL=SettingsForm.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsForm.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}