@siiway/ui-react 0.0.0 → 0.2.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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -1
  3. package/dist/components/AppShell.d.ts +29 -0
  4. package/dist/components/AppShell.d.ts.map +1 -0
  5. package/dist/components/AppShell.js +220 -0
  6. package/dist/components/AppShell.js.map +1 -0
  7. package/dist/components/AuthShell.d.ts +21 -0
  8. package/dist/components/AuthShell.d.ts.map +1 -0
  9. package/dist/components/AuthShell.js +53 -0
  10. package/dist/components/AuthShell.js.map +1 -0
  11. package/dist/components/BrandMark.d.ts +11 -0
  12. package/dist/components/BrandMark.d.ts.map +1 -0
  13. package/dist/components/BrandMark.js +11 -0
  14. package/dist/components/BrandMark.js.map +1 -0
  15. package/dist/components/ButtonLink.d.ts +11 -0
  16. package/dist/components/ButtonLink.d.ts.map +1 -0
  17. package/dist/components/ButtonLink.js +15 -0
  18. package/dist/components/ButtonLink.js.map +1 -0
  19. package/dist/components/CheckboxField.d.ts +15 -0
  20. package/dist/components/CheckboxField.d.ts.map +1 -0
  21. package/dist/components/CheckboxField.js +23 -0
  22. package/dist/components/CheckboxField.js.map +1 -0
  23. package/dist/components/ColorPickerInput.d.ts +17 -0
  24. package/dist/components/ColorPickerInput.d.ts.map +1 -0
  25. package/dist/components/ColorPickerInput.js +97 -0
  26. package/dist/components/ColorPickerInput.js.map +1 -0
  27. package/dist/components/CommandPalette.d.ts +65 -0
  28. package/dist/components/CommandPalette.d.ts.map +1 -0
  29. package/dist/components/CommandPalette.js +269 -0
  30. package/dist/components/CommandPalette.js.map +1 -0
  31. package/dist/components/CopyButton.d.ts +27 -0
  32. package/dist/components/CopyButton.d.ts.map +1 -0
  33. package/dist/components/CopyButton.js +20 -0
  34. package/dist/components/CopyButton.js.map +1 -0
  35. package/dist/components/CopyIdTrigger.d.ts +31 -0
  36. package/dist/components/CopyIdTrigger.d.ts.map +1 -0
  37. package/dist/components/CopyIdTrigger.js +72 -0
  38. package/dist/components/CopyIdTrigger.js.map +1 -0
  39. package/dist/components/DataList.d.ts +78 -0
  40. package/dist/components/DataList.d.ts.map +1 -0
  41. package/dist/components/DataList.js +150 -0
  42. package/dist/components/DataList.js.map +1 -0
  43. package/dist/components/DetailHeader.d.ts +26 -0
  44. package/dist/components/DetailHeader.d.ts.map +1 -0
  45. package/dist/components/DetailHeader.js +49 -0
  46. package/dist/components/DetailHeader.js.map +1 -0
  47. package/dist/components/DurationInput.d.ts +25 -0
  48. package/dist/components/DurationInput.d.ts.map +1 -0
  49. package/dist/components/DurationInput.js +83 -0
  50. package/dist/components/DurationInput.js.map +1 -0
  51. package/dist/components/EmptyState.d.ts +14 -0
  52. package/dist/components/EmptyState.d.ts.map +1 -0
  53. package/dist/components/EmptyState.js +41 -0
  54. package/dist/components/EmptyState.js.map +1 -0
  55. package/dist/components/FormPage.d.ts +22 -0
  56. package/dist/components/FormPage.d.ts.map +1 -0
  57. package/dist/components/FormPage.js +65 -0
  58. package/dist/components/FormPage.js.map +1 -0
  59. package/dist/components/GetStartedPanel.d.ts +16 -0
  60. package/dist/components/GetStartedPanel.d.ts.map +1 -0
  61. package/dist/components/GetStartedPanel.js +96 -0
  62. package/dist/components/GetStartedPanel.js.map +1 -0
  63. package/dist/components/LabeledLine.d.ts +12 -0
  64. package/dist/components/LabeledLine.d.ts.map +1 -0
  65. package/dist/components/LabeledLine.js +6 -0
  66. package/dist/components/LabeledLine.js.map +1 -0
  67. package/dist/components/ListSearch.d.ts +15 -0
  68. package/dist/components/ListSearch.d.ts.map +1 -0
  69. package/dist/components/ListSearch.js +23 -0
  70. package/dist/components/ListSearch.js.map +1 -0
  71. package/dist/components/LoadingBar.d.ts +8 -0
  72. package/dist/components/LoadingBar.d.ts.map +1 -0
  73. package/dist/components/LoadingBar.js +55 -0
  74. package/dist/components/LoadingBar.js.map +1 -0
  75. package/dist/components/LoadingPage.d.ts +6 -0
  76. package/dist/components/LoadingPage.d.ts.map +1 -0
  77. package/dist/components/LoadingPage.js +25 -0
  78. package/dist/components/LoadingPage.js.map +1 -0
  79. package/dist/components/MenuPanel.d.ts +34 -0
  80. package/dist/components/MenuPanel.d.ts.map +1 -0
  81. package/dist/components/MenuPanel.js +98 -0
  82. package/dist/components/MenuPanel.js.map +1 -0
  83. package/dist/components/Outline.d.ts +23 -0
  84. package/dist/components/Outline.d.ts.map +1 -0
  85. package/dist/components/Outline.js +150 -0
  86. package/dist/components/Outline.js.map +1 -0
  87. package/dist/components/Overview.d.ts +103 -0
  88. package/dist/components/Overview.d.ts.map +1 -0
  89. package/dist/components/Overview.js +286 -0
  90. package/dist/components/Overview.js.map +1 -0
  91. package/dist/components/PageHeader.d.ts +19 -0
  92. package/dist/components/PageHeader.d.ts.map +1 -0
  93. package/dist/components/PageHeader.js +41 -0
  94. package/dist/components/PageHeader.js.map +1 -0
  95. package/dist/components/Pagination.d.ts +19 -0
  96. package/dist/components/Pagination.d.ts.map +1 -0
  97. package/dist/components/Pagination.js +47 -0
  98. package/dist/components/Pagination.js.map +1 -0
  99. package/dist/components/PasswordInput.d.ts +3 -0
  100. package/dist/components/PasswordInput.d.ts.map +1 -0
  101. package/dist/components/PasswordInput.js +29 -0
  102. package/dist/components/PasswordInput.js.map +1 -0
  103. package/dist/components/PrevNext.d.ts +16 -0
  104. package/dist/components/PrevNext.d.ts.map +1 -0
  105. package/dist/components/PrevNext.js +61 -0
  106. package/dist/components/PrevNext.js.map +1 -0
  107. package/dist/components/SearchButton.d.ts +16 -0
  108. package/dist/components/SearchButton.d.ts.map +1 -0
  109. package/dist/components/SearchButton.js +63 -0
  110. package/dist/components/SearchButton.js.map +1 -0
  111. package/dist/components/SearchField.d.ts +10 -0
  112. package/dist/components/SearchField.d.ts.map +1 -0
  113. package/dist/components/SearchField.js +67 -0
  114. package/dist/components/SearchField.js.map +1 -0
  115. package/dist/components/Segmented.d.ts +28 -0
  116. package/dist/components/Segmented.d.ts.map +1 -0
  117. package/dist/components/Segmented.js +74 -0
  118. package/dist/components/Segmented.js.map +1 -0
  119. package/dist/components/Select.d.ts +22 -0
  120. package/dist/components/Select.d.ts.map +1 -0
  121. package/dist/components/Select.js +50 -0
  122. package/dist/components/Select.js.map +1 -0
  123. package/dist/components/Settings.d.ts +103 -0
  124. package/dist/components/Settings.d.ts.map +1 -0
  125. package/dist/components/Settings.js +246 -0
  126. package/dist/components/Settings.js.map +1 -0
  127. package/dist/components/SideNav.d.ts +47 -0
  128. package/dist/components/SideNav.d.ts.map +1 -0
  129. package/dist/components/SideNav.js +125 -0
  130. package/dist/components/SideNav.js.map +1 -0
  131. package/dist/components/Skeletons.d.ts +37 -0
  132. package/dist/components/Skeletons.d.ts.map +1 -0
  133. package/dist/components/Skeletons.js +109 -0
  134. package/dist/components/Skeletons.js.map +1 -0
  135. package/dist/components/StatusPage.d.ts +49 -0
  136. package/dist/components/StatusPage.d.ts.map +1 -0
  137. package/dist/components/StatusPage.js +110 -0
  138. package/dist/components/StatusPage.js.map +1 -0
  139. package/dist/components/ThemeMenu.d.ts +13 -0
  140. package/dist/components/ThemeMenu.d.ts.map +1 -0
  141. package/dist/components/ThemeMenu.js +18 -0
  142. package/dist/components/ThemeMenu.js.map +1 -0
  143. package/dist/components/ThemeSwitch.d.ts +17 -0
  144. package/dist/components/ThemeSwitch.d.ts.map +1 -0
  145. package/dist/components/ThemeSwitch.js +25 -0
  146. package/dist/components/ThemeSwitch.js.map +1 -0
  147. package/dist/components/TopBar.d.ts +49 -0
  148. package/dist/components/TopBar.d.ts.map +1 -0
  149. package/dist/components/TopBar.js +146 -0
  150. package/dist/components/TopBar.js.map +1 -0
  151. package/dist/components/ViewBanner.d.ts +17 -0
  152. package/dist/components/ViewBanner.d.ts.map +1 -0
  153. package/dist/components/ViewBanner.js +14 -0
  154. package/dist/components/ViewBanner.js.map +1 -0
  155. package/dist/hooks/platform.d.ts +7 -0
  156. package/dist/hooks/platform.d.ts.map +1 -0
  157. package/dist/hooks/platform.js +19 -0
  158. package/dist/hooks/platform.js.map +1 -0
  159. package/dist/hooks/useConfirm.d.ts +23 -0
  160. package/dist/hooks/useConfirm.d.ts.map +1 -0
  161. package/dist/hooks/useConfirm.js +55 -0
  162. package/dist/hooks/useConfirm.js.map +1 -0
  163. package/dist/hooks/useCopy.d.ts +12 -0
  164. package/dist/hooks/useCopy.d.ts.map +1 -0
  165. package/dist/hooks/useCopy.js +39 -0
  166. package/dist/hooks/useCopy.js.map +1 -0
  167. package/dist/hooks/useDebouncedSearch.d.ts +8 -0
  168. package/dist/hooks/useDebouncedSearch.d.ts.map +1 -0
  169. package/dist/hooks/useDebouncedSearch.js +19 -0
  170. package/dist/hooks/useDebouncedSearch.js.map +1 -0
  171. package/dist/hooks/usePageClamp.d.ts +4 -0
  172. package/dist/hooks/usePageClamp.d.ts.map +1 -0
  173. package/dist/hooks/usePageClamp.js +17 -0
  174. package/dist/hooks/usePageClamp.js.map +1 -0
  175. package/dist/hooks/useSearchShortcut.d.ts +8 -0
  176. package/dist/hooks/useSearchShortcut.d.ts.map +1 -0
  177. package/dist/hooks/useSearchShortcut.js +38 -0
  178. package/dist/hooks/useSearchShortcut.js.map +1 -0
  179. package/dist/hooks/useThemeMode.d.ts +29 -0
  180. package/dist/hooks/useThemeMode.d.ts.map +1 -0
  181. package/dist/hooks/useThemeMode.js +111 -0
  182. package/dist/hooks/useThemeMode.js.map +1 -0
  183. package/dist/hooks/useToastMessage.d.ts +22 -0
  184. package/dist/hooks/useToastMessage.d.ts.map +1 -0
  185. package/dist/hooks/useToastMessage.js +26 -0
  186. package/dist/hooks/useToastMessage.js.map +1 -0
  187. package/dist/index.d.ts +50 -0
  188. package/dist/index.d.ts.map +1 -0
  189. package/dist/index.js +60 -0
  190. package/dist/index.js.map +1 -0
  191. package/dist/provider/UiProvider.d.ts +60 -0
  192. package/dist/provider/UiProvider.d.ts.map +1 -0
  193. package/dist/provider/UiProvider.js +144 -0
  194. package/dist/provider/UiProvider.js.map +1 -0
  195. package/dist/provider/canvas.d.ts +7 -0
  196. package/dist/provider/canvas.d.ts.map +1 -0
  197. package/dist/provider/canvas.js +30 -0
  198. package/dist/provider/canvas.js.map +1 -0
  199. package/dist/provider/context.d.ts +69 -0
  200. package/dist/provider/context.d.ts.map +1 -0
  201. package/dist/provider/context.js +84 -0
  202. package/dist/provider/context.js.map +1 -0
  203. package/dist/theme/createTheme.d.ts +13 -0
  204. package/dist/theme/createTheme.d.ts.map +1 -0
  205. package/dist/theme/createTheme.js +18 -0
  206. package/dist/theme/createTheme.js.map +1 -0
  207. package/package.json +42 -2
  208. package/src/components/AppShell.tsx +337 -0
  209. package/src/components/AuthShell.tsx +104 -0
  210. package/src/components/BrandMark.tsx +28 -0
  211. package/src/components/ButtonLink.tsx +40 -0
  212. package/src/components/CheckboxField.tsx +50 -0
  213. package/src/components/ColorPickerInput.tsx +190 -0
  214. package/src/components/CommandPalette.tsx +479 -0
  215. package/src/components/CopyButton.tsx +76 -0
  216. package/src/components/CopyIdTrigger.tsx +127 -0
  217. package/src/components/DataList.tsx +332 -0
  218. package/src/components/DetailHeader.tsx +108 -0
  219. package/src/components/DurationInput.tsx +133 -0
  220. package/src/components/EmptyState.tsx +67 -0
  221. package/src/components/FormPage.tsx +109 -0
  222. package/src/components/GetStartedPanel.tsx +132 -0
  223. package/src/components/LabeledLine.tsx +28 -0
  224. package/src/components/ListSearch.tsx +64 -0
  225. package/src/components/LoadingBar.tsx +81 -0
  226. package/src/components/LoadingPage.tsx +41 -0
  227. package/src/components/MenuPanel.tsx +163 -0
  228. package/src/components/Outline.tsx +208 -0
  229. package/src/components/Overview.tsx +448 -0
  230. package/src/components/PageHeader.tsx +69 -0
  231. package/src/components/Pagination.tsx +105 -0
  232. package/src/components/PasswordInput.tsx +50 -0
  233. package/src/components/PrevNext.tsx +98 -0
  234. package/src/components/SearchButton.tsx +90 -0
  235. package/src/components/SearchField.tsx +97 -0
  236. package/src/components/Segmented.tsx +136 -0
  237. package/src/components/Select.tsx +110 -0
  238. package/src/components/Settings.tsx +432 -0
  239. package/src/components/SideNav.tsx +258 -0
  240. package/src/components/Skeletons.tsx +233 -0
  241. package/src/components/StatusPage.tsx +212 -0
  242. package/src/components/ThemeMenu.tsx +51 -0
  243. package/src/components/ThemeSwitch.tsx +49 -0
  244. package/src/components/TopBar.tsx +293 -0
  245. package/src/components/ViewBanner.tsx +51 -0
  246. package/src/hooks/platform.ts +22 -0
  247. package/src/hooks/useConfirm.tsx +97 -0
  248. package/src/hooks/useCopy.ts +39 -0
  249. package/src/hooks/useDebouncedSearch.ts +19 -0
  250. package/src/hooks/usePageClamp.ts +20 -0
  251. package/src/hooks/useSearchShortcut.ts +49 -0
  252. package/src/hooks/useThemeMode.ts +168 -0
  253. package/src/hooks/useToastMessage.ts +38 -0
  254. package/src/index.ts +156 -0
  255. package/src/provider/UiProvider.tsx +256 -0
  256. package/src/provider/canvas.ts +31 -0
  257. package/src/provider/context.tsx +145 -0
  258. package/src/theme/createTheme.ts +29 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewBanner.d.ts","sourceRoot":"","sources":["../../src/components/ViewBanner.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,UAAU,KAAK;IACb,oCAAoC;IACpC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,mBAAmB;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,qEAAqE;IACrE,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IAChD,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,KAAK,+BA4BxE"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // The banner on app and team pages that says which authority a site admin is
3
+ // acting with (the site override or their own membership), with the button
4
+ // that switches. Built on MessageBar's own layout, so a long message moves
5
+ // the action under the text and the dismiss stays in the corner rather than
6
+ // wrapping onto a line of its own.
7
+ import { Button, MessageBar, MessageBarActions, MessageBarBody } from "@fluentui/react-components";
8
+ import { DismissRegular } from "@fluentui/react-icons";
9
+ import { useUiStrings } from "../provider/context.js";
10
+ export function ViewBanner({ intent, children, action, onDismiss }) {
11
+ const strings = useUiStrings();
12
+ return (_jsxs(MessageBar, { intent: intent, children: [_jsx(MessageBarBody, { children: children }), (action || onDismiss) && (_jsx(MessageBarActions, { containerAction: onDismiss && (_jsx(Button, { appearance: "transparent", size: "small", icon: _jsx(DismissRegular, {}), "aria-label": strings.close, onClick: onDismiss })), children: action && (_jsx(Button, { size: "small", onClick: action.onClick, children: action.label })) }))] }));
13
+ }
14
+ //# sourceMappingURL=ViewBanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewBanner.js","sourceRoot":"","sources":["../../src/components/ViewBanner.tsx"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,2EAA2E;AAC3E,2EAA2E;AAC3E,4EAA4E;AAC5E,mCAAmC;AAEnC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAatD,MAAM,UAAU,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAS;IACvE,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,OAAO,CACL,MAAC,UAAU,IAAC,MAAM,EAAE,MAAM,aACxB,KAAC,cAAc,cAAE,QAAQ,GAAkB,EAC1C,CAAC,MAAM,IAAI,SAAS,CAAC,IAAI,CACxB,KAAC,iBAAiB,IAChB,eAAe,EACb,SAAS,IAAI,CACX,KAAC,MAAM,IACL,UAAU,EAAC,aAAa,EACxB,IAAI,EAAC,OAAO,EACZ,IAAI,EAAE,KAAC,cAAc,KAAG,gBACZ,OAAO,CAAC,KAAK,EACzB,OAAO,EAAE,SAAS,GAClB,CACH,YAGF,MAAM,IAAI,CACT,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,MAAM,CAAC,OAAO,YACzC,MAAM,CAAC,KAAK,GACN,CACV,GACiB,CACrB,IACU,CACd,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Whether the reader is on an Apple device, where shortcuts use ⌘ rather than
3
+ * Ctrl. The server can't tell, so it renders Ctrl, and the browser corrects
4
+ * it without a hydration mismatch.
5
+ */
6
+ export declare function useIsApple(): boolean;
7
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/hooks/platform.ts"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC"}
@@ -0,0 +1,19 @@
1
+ import { useSyncExternalStore } from "react";
2
+ function subscribe() {
3
+ return () => { };
4
+ }
5
+ function isApple() {
6
+ return /Mac|iPhone|iPad/.test(navigator.platform);
7
+ }
8
+ function serverIsApple() {
9
+ return false;
10
+ }
11
+ /**
12
+ * Whether the reader is on an Apple device, where shortcuts use ⌘ rather than
13
+ * Ctrl. The server can't tell, so it renders Ctrl, and the browser corrects
14
+ * it without a hydration mismatch.
15
+ */
16
+ export function useIsApple() {
17
+ return useSyncExternalStore(subscribe, isApple, serverIsApple);
18
+ }
19
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/hooks/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE7C,SAAS,SAAS;IAChB,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,OAAO;IACd,OAAO,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,aAAa;IACpB,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { type ReactNode } from "react";
2
+ /** What `confirm` asks. */
3
+ export interface ConfirmOptions {
4
+ /** The question, as the dialog's title. */
5
+ title: string;
6
+ /** More detail under the title. */
7
+ body?: ReactNode;
8
+ /** Label of the confirming button, e.g. "Remove". */
9
+ confirmLabel: string;
10
+ }
11
+ /**
12
+ * Asks a yes-or-no question in a dialog and waits for the answer. Render
13
+ * `confirmDialog` once, anywhere in the component.
14
+ */
15
+ export declare function useConfirm(): {
16
+ /** Opens the dialog. Resolves to `true` when confirmed and `false` when
17
+ * cancelled or closed. A second call while it's open answers the first
18
+ * with `false`. */
19
+ confirm: (next: ConfirmOptions) => Promise<boolean>;
20
+ /** The dialog. Render it once. */
21
+ confirmDialog: import("react").JSX.Element;
22
+ };
23
+ //# sourceMappingURL=useConfirm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConfirm.d.ts","sourceRoot":"","sources":["../../src/hooks/useConfirm.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAWtE,2BAA2B;AAC3B,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,UAAU;IA4CtB;;wBAEoB;oBAxCa,cAAc;IA0C/C,kCAAkC;;EAGrC"}
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Promise-based confirmation dialog for one-click destructive actions:
3
+ //
4
+ // const { confirm, confirmDialog } = useConfirm();
5
+ // if (!(await confirm({ title, body, confirmLabel }))) return;
6
+ // ...
7
+ // return <>{...}{confirmDialog}</>;
8
+ //
9
+ // One dialog per page, reused for every action on it.
10
+ import { Button, Dialog, DialogActions, DialogBody, DialogContent, DialogSurface, DialogTitle, makeStyles, tokens, } from "@fluentui/react-components";
11
+ import { useCallback, useRef, useState } from "react";
12
+ import { useUiStrings } from "../provider/context.js";
13
+ const useStyles = makeStyles({
14
+ danger: {
15
+ background: tokens.colorPaletteRedBackground3,
16
+ ":hover": { background: tokens.colorPaletteRedForeground1 },
17
+ ":hover:active": { background: tokens.colorPaletteRedForeground1 },
18
+ },
19
+ });
20
+ /**
21
+ * Asks a yes-or-no question in a dialog and waits for the answer. Render
22
+ * `confirmDialog` once, anywhere in the component.
23
+ */
24
+ export function useConfirm() {
25
+ const styles = useStyles();
26
+ const strings = useUiStrings();
27
+ const [options, setOptions] = useState(null);
28
+ const resolver = useRef(null);
29
+ const confirm = useCallback((next) => {
30
+ // A second request while one is open answers the first with "no".
31
+ resolver.current?.(false);
32
+ setOptions(next);
33
+ return new Promise((resolve) => {
34
+ resolver.current = resolve;
35
+ });
36
+ }, []);
37
+ const close = (ok) => {
38
+ resolver.current?.(ok);
39
+ resolver.current = null;
40
+ setOptions(null);
41
+ };
42
+ const confirmDialog = (_jsx(Dialog, { open: options !== null, onOpenChange: (_, d) => {
43
+ if (!d.open)
44
+ close(false);
45
+ }, children: _jsx(DialogSurface, { children: _jsxs(DialogBody, { children: [_jsx(DialogTitle, { children: options?.title }), options?.body && _jsx(DialogContent, { children: options.body }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: () => close(false), children: strings.cancel }), _jsx(Button, { appearance: "primary", className: styles.danger, onClick: () => close(true), children: options?.confirmLabel })] })] }) }) }));
46
+ return {
47
+ /** Opens the dialog. Resolves to `true` when confirmed and `false` when
48
+ * cancelled or closed. A second call while it's open answers the first
49
+ * with `false`. */
50
+ confirm,
51
+ /** The dialog. Render it once. */
52
+ confirmDialog,
53
+ };
54
+ }
55
+ //# sourceMappingURL=useConfirm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConfirm.js","sourceRoot":"","sources":["../../src/hooks/useConfirm.tsx"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,EAAE;AACF,qDAAqD;AACrD,iEAAiE;AACjE,QAAQ;AACR,sCAAsC;AACtC,EAAE;AACF,sDAAsD;AAEtD,OAAO,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,UAAU,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,MAAM,GACP,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,SAAS,GAAG,UAAU,CAAC;IAC3B,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAC,0BAA0B;QAC7C,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,0BAA0B,EAAE;QAC3D,eAAe,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,0BAA0B,EAAE;KACnE;CACF,CAAC,CAAC;AAYH;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAwB,IAAI,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG,MAAM,CAAiC,IAAI,CAAC,CAAC;IAE9D,MAAM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ACL;;4BAEoB;QACpB,OAAO;QACP,kCAAkC;QAClC,aAAa;KACd,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ export type CopyState = "idle" | "copied" | "failed";
2
+ /** Copy text to the clipboard and report how it went for a moment, so the
3
+ * control can say "Copied" — or "Copy failed" when clipboard access is
4
+ * denied (permission, insecure context), rather than claiming success.
5
+ * `copy` takes the text, or a function that returns it, called as it copies:
6
+ * for a value only known then, such as what a code block shows. It resolves
7
+ * to how that copy went. */
8
+ export declare function useCopy(resetMs?: number): {
9
+ state: CopyState;
10
+ copy: (text: string | (() => string)) => Promise<"copied" | "failed">;
11
+ };
12
+ //# sourceMappingURL=useCopy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCopy.d.ts","sourceRoot":"","sources":["../../src/hooks/useCopy.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErD;;;;;6BAK6B;AAC7B,wBAAgB,OAAO,CAAC,OAAO,SAAO;;iBAeV,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,KAAG,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;EAajF"}
@@ -0,0 +1,39 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ /** Copy text to the clipboard and report how it went for a moment, so the
3
+ * control can say "Copied" — or "Copy failed" when clipboard access is
4
+ * denied (permission, insecure context), rather than claiming success.
5
+ * `copy` takes the text, or a function that returns it, called as it copies:
6
+ * for a value only known then, such as what a code block shows. It resolves
7
+ * to how that copy went. */
8
+ export function useCopy(resetMs = 1500) {
9
+ const [state, setState] = useState("idle");
10
+ const timer = useRef(undefined);
11
+ // The latest copy: only it reports, so an earlier one that settles later
12
+ // can't replace its outcome.
13
+ const latest = useRef(0);
14
+ useEffect(() => () => clearTimeout(timer.current), []);
15
+ function flash(next) {
16
+ // A second copy starts its own moment, not the rest of the first.
17
+ clearTimeout(timer.current);
18
+ setState(next);
19
+ timer.current = setTimeout(() => setState("idle"), resetMs);
20
+ }
21
+ // Up to the first await, this runs in the click that called it, as Safari
22
+ // needs. No clipboard (a plain-http page) or a throwing `text` is a failure.
23
+ async function copy(text) {
24
+ const id = ++latest.current;
25
+ let outcome;
26
+ try {
27
+ await navigator.clipboard.writeText(typeof text === "function" ? text() : text);
28
+ outcome = "copied";
29
+ }
30
+ catch {
31
+ outcome = "failed";
32
+ }
33
+ if (id === latest.current)
34
+ flash(outcome);
35
+ return outcome;
36
+ }
37
+ return { state, copy };
38
+ }
39
+ //# sourceMappingURL=useCopy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCopy.js","sourceRoot":"","sources":["../../src/hooks/useCopy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIpD;;;;;6BAK6B;AAC7B,MAAM,UAAU,OAAO,CAAC,OAAO,GAAG,IAAI;IACpC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAY,MAAM,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,MAAM,CAA4C,SAAS,CAAC,CAAC;IAC3E,yEAAyE;IACzE,6BAA6B;IAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACzB,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IACvD,SAAS,KAAK,CAAC,IAAe;QAC5B,kEAAkE;QAClE,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5B,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IACD,0EAA0E;IAC1E,6EAA6E;IAC7E,KAAK,UAAU,IAAI,CAAC,IAA6B;QAC/C,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC;QAC5B,IAAI,OAA4B,CAAC;QACjC,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAChF,OAAO,GAAG,QAAQ,CAAC;QACrB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,GAAG,QAAQ,CAAC;QACrB,CAAC;QACD,IAAI,EAAE,KAAK,MAAM,CAAC,OAAO;YAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** A search box value plus its debounced, trimmed copy; resets the page when
2
+ * the search settles. */
3
+ export declare function useDebouncedSearch(onSettle?: () => void, delay?: number): {
4
+ query: string;
5
+ setQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
6
+ search: string;
7
+ };
8
+ //# sourceMappingURL=useDebouncedSearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDebouncedSearch.d.ts","sourceRoot":"","sources":["../../src/hooks/useDebouncedSearch.ts"],"names":[],"mappings":"AAEA;0BAC0B;AAC1B,wBAAgB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,EAAE,KAAK,SAAM;;;;EAcpE"}
@@ -0,0 +1,19 @@
1
+ import { useEffect, useState } from "react";
2
+ /** A search box value plus its debounced, trimmed copy; resets the page when
3
+ * the search settles. */
4
+ export function useDebouncedSearch(onSettle, delay = 250) {
5
+ const [query, setQuery] = useState("");
6
+ const [search, setSearch] = useState("");
7
+ useEffect(() => {
8
+ const id = setTimeout(() => {
9
+ setSearch(query.trim());
10
+ onSettle?.();
11
+ }, delay);
12
+ return () => clearTimeout(id);
13
+ // onSettle is a setter-style callback; re-running on its identity would
14
+ // restart the timer every render.
15
+ // eslint-disable-next-line react-hooks/exhaustive-deps
16
+ }, [query, delay]);
17
+ return { query, setQuery, search };
18
+ }
19
+ //# sourceMappingURL=useDebouncedSearch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDebouncedSearch.js","sourceRoot":"","sources":["../../src/hooks/useDebouncedSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C;0BAC0B;AAC1B,MAAM,UAAU,kBAAkB,CAAC,QAAqB,EAAE,KAAK,GAAG,GAAG;IACnE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE;YACzB,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACxB,QAAQ,EAAE,EAAE,CAAC;QACf,CAAC,EAAE,KAAK,CAAC,CAAC;QACV,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC9B,wEAAwE;QACxE,kCAAkC;QAClC,uDAAuD;IACzD,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACrC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare function usePageClamp(page: number,
2
+ /** Total rows from the latest response; undefined while loading. */
3
+ total: number | undefined, pageSize: number, setPage: (page: number) => void): void;
4
+ //# sourceMappingURL=usePageClamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePageClamp.d.ts","sourceRoot":"","sources":["../../src/hooks/usePageClamp.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM;AACZ,oEAAoE;AACpE,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,QAOhC"}
@@ -0,0 +1,17 @@
1
+ // Keep a paged list on a page that exists. Removing the last row on the last
2
+ // page (or filtering elsewhere) can leave `page` past the end, where the
3
+ // list would show as empty with no pager to get back; this steps back to
4
+ // the last page that still has rows.
5
+ import { useEffect } from "react";
6
+ export function usePageClamp(page,
7
+ /** Total rows from the latest response; undefined while loading. */
8
+ total, pageSize, setPage) {
9
+ useEffect(() => {
10
+ if (total === undefined)
11
+ return;
12
+ const last = Math.max(1, Math.ceil(total / pageSize));
13
+ if (page > last)
14
+ setPage(last);
15
+ }, [page, total, pageSize, setPage]);
16
+ }
17
+ //# sourceMappingURL=usePageClamp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePageClamp.js","sourceRoot":"","sources":["../../src/hooks/usePageClamp.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,yEAAyE;AACzE,yEAAyE;AACzE,qCAAqC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,UAAU,YAAY,CAC1B,IAAY;AACZ,oEAAoE;AACpE,KAAyB,EACzB,QAAgB,EAChB,OAA+B;IAE/B,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC;QACtD,IAAI,IAAI,GAAG,IAAI;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type Dispatch, type SetStateAction } from "react";
2
+ export interface SearchShortcutOptions {
3
+ /** Also open on "/", as docs sites do. Defaults to false. */
4
+ slash?: boolean;
5
+ }
6
+ /** Pass the state setter of the search's `open`, e.g. from `useState(false)`. */
7
+ export declare function useSearchShortcut(setOpen: Dispatch<SetStateAction<boolean>>, { slash }?: SearchShortcutOptions): void;
8
+ //# sourceMappingURL=useSearchShortcut.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchShortcut.d.ts","sourceRoot":"","sources":["../../src/hooks/useSearchShortcut.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtE,MAAM,WAAW,qBAAqB;IACpC,6DAA6D;IAC7D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAYD,iFAAiF;AACjF,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAC1C,EAAE,KAAa,EAAE,GAAE,qBAA0B,GAC5C,IAAI,CAuBN"}
@@ -0,0 +1,38 @@
1
+ // The keys that open search, as Prism and Vellum both have them: Ctrl K (⌘K
2
+ // on Apple devices) toggles it from anywhere, and with `slash`, "/" opens it
3
+ // when the reader isn't typing.
4
+ import { useEffect } from "react";
5
+ function typing(target) {
6
+ if (!(target instanceof HTMLElement))
7
+ return false;
8
+ return (target.isContentEditable ||
9
+ target.tagName === "INPUT" ||
10
+ target.tagName === "TEXTAREA" ||
11
+ target.tagName === "SELECT");
12
+ }
13
+ /** Pass the state setter of the search's `open`, e.g. from `useState(false)`. */
14
+ export function useSearchShortcut(setOpen, { slash = false } = {}) {
15
+ useEffect(() => {
16
+ function onKey(e) {
17
+ // An input method's keys belong to the text it's composing.
18
+ if (e.isComposing)
19
+ return;
20
+ if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "k") {
21
+ e.preventDefault();
22
+ setOpen((open) => !open);
23
+ }
24
+ else if (slash &&
25
+ e.key === "/" &&
26
+ !e.ctrlKey &&
27
+ !e.metaKey &&
28
+ !e.altKey &&
29
+ !typing(e.target)) {
30
+ e.preventDefault();
31
+ setOpen(true);
32
+ }
33
+ }
34
+ window.addEventListener("keydown", onKey);
35
+ return () => window.removeEventListener("keydown", onKey);
36
+ }, [setOpen, slash]);
37
+ }
38
+ //# sourceMappingURL=useSearchShortcut.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchShortcut.js","sourceRoot":"","sources":["../../src/hooks/useSearchShortcut.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,gCAAgC;AAEhC,OAAO,EAAE,SAAS,EAAsC,MAAM,OAAO,CAAC;AAOtE,SAAS,MAAM,CAAC,MAA0B;IACxC,IAAI,CAAC,CAAC,MAAM,YAAY,WAAW,CAAC;QAAE,OAAO,KAAK,CAAC;IACnD,OAAO,CACL,MAAM,CAAC,iBAAiB;QACxB,MAAM,CAAC,OAAO,KAAK,OAAO;QAC1B,MAAM,CAAC,OAAO,KAAK,UAAU;QAC7B,MAAM,CAAC,OAAO,KAAK,QAAQ,CAC5B,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,iBAAiB,CAC/B,OAA0C,EAC1C,EAAE,KAAK,GAAG,KAAK,KAA4B,EAAE;IAE7C,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,KAAK,CAAC,CAAgB;YAC7B,4DAA4D;YAC5D,IAAI,CAAC,CAAC,WAAW;gBAAE,OAAO;YAC1B,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,GAAG,EAAE,CAAC;gBACzE,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC;iBAAM,IACL,KAAK;gBACL,CAAC,CAAC,GAAG,KAAK,GAAG;gBACb,CAAC,CAAC,CAAC,OAAO;gBACV,CAAC,CAAC,CAAC,OAAO;gBACV,CAAC,CAAC,CAAC,MAAM;gBACT,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EACjB,CAAC;gBACD,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC;QACH,CAAC;QACD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC1C,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5D,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AACvB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { type Scheme, type ThemeMode } from "@siiway/ui-core";
2
+ export interface ThemeModeOptions {
3
+ /** The `localStorage` key; give `schemeBootScript` the same. Defaults to `"siiway-theme"`. */
4
+ storageKey?: string;
5
+ /** Until a choice is stored, and on the server. Defaults to `"system"`. */
6
+ defaultMode?: ThemeMode;
7
+ /**
8
+ * A cookie to keep the scheme in, for the server to render the next
9
+ * request in (`schemeFromRequest`), such as `SCHEME_COOKIE`. Give
10
+ * `schemeBootScript` the same.
11
+ */
12
+ cookie?: string;
13
+ /**
14
+ * The scheme the server rendered in, on the server and again on the client:
15
+ * drawn until hydration ends. `schemeFromRequest`'s answer; with null,
16
+ * `defaultMode`'s scheme, light for `system`.
17
+ */
18
+ initialScheme?: Scheme | null;
19
+ }
20
+ export interface ThemeModeState {
21
+ /** The choice, for `<ThemeSwitch value>`. */
22
+ mode: ThemeMode;
23
+ /** Stores a new choice, for `<ThemeSwitch onChange>`. */
24
+ setMode: (mode: ThemeMode) => void;
25
+ /** What to draw in now, for `<UiProvider scheme>`. */
26
+ scheme: Scheme;
27
+ }
28
+ export declare function useThemeMode({ storageKey, defaultMode, cookie, initialScheme, }?: ThemeModeOptions): ThemeModeState;
29
+ //# sourceMappingURL=useThemeMode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useThemeMode.d.ts","sourceRoot":"","sources":["../../src/hooks/useThemeMode.ts"],"names":[],"mappings":"AAYA,OAAO,EAKL,KAAK,MAAM,EACX,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AA8EzB,MAAM,WAAW,gBAAgB;IAC/B,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,6CAA6C;IAC7C,IAAI,EAAE,SAAS,CAAC;IAChB,yDAAyD;IACzD,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,YAAY,CAAC,EAC3B,UAA8B,EAC9B,WAAsB,EACtB,MAAM,EACN,aAAa,GACd,GAAE,gBAAqB,GAAG,cAAc,CAqCxC"}
@@ -0,0 +1,111 @@
1
+ // The person's light/dark choice and the scheme it draws in now. The choice is
2
+ // kept in localStorage under the key schemeBootScript reads, and follows
3
+ // other tabs; `system` follows the OS setting as it changes.
4
+ //
5
+ // On the server, and while hydrating, it gives `defaultMode`, drawn in
6
+ // `initialScheme` (what the server read from the scheme cookie), or else as
7
+ // `defaultMode` draws without the OS (`system` light): the server can't see
8
+ // the stored choice or the OS. The client then moves to the
9
+ // real scheme. useSyncExternalStore makes that switch without a hydration
10
+ // mismatch. With `cookie`, it keeps the scheme cookie in step for the next
11
+ // request.
12
+ import { THEME_STORAGE_KEY, isThemeMode, resolveScheme, schemeCookie, } from "@siiway/ui-core";
13
+ import { useCallback, useEffect, useMemo, useSyncExternalStore } from "react";
14
+ const DARK_QUERY = "(prefers-color-scheme: dark)";
15
+ // setMode in this tab notifies these; other tabs arrive as `storage` events.
16
+ const listeners = new Set();
17
+ // This tab's choice when localStorage wouldn't take it (blocked, or full). It
18
+ // wins over what's stored, other tabs' choices included, until a write gets
19
+ // through.
20
+ const memory = new Map();
21
+ function subscribeMode(onChange) {
22
+ listeners.add(onChange);
23
+ window.addEventListener("storage", onChange);
24
+ return () => {
25
+ listeners.delete(onChange);
26
+ window.removeEventListener("storage", onChange);
27
+ };
28
+ }
29
+ function subscribeSystem(onChange) {
30
+ const query = window.matchMedia?.(DARK_QUERY);
31
+ query?.addEventListener("change", onChange);
32
+ return () => query?.removeEventListener("change", onChange);
33
+ }
34
+ function systemDark() {
35
+ return window.matchMedia?.(DARK_QUERY).matches ?? false;
36
+ }
37
+ function readStored(key) {
38
+ const own = memory.get(key);
39
+ if (own !== undefined)
40
+ return own;
41
+ try {
42
+ return window.localStorage.getItem(key);
43
+ }
44
+ catch {
45
+ return null;
46
+ }
47
+ }
48
+ // The scheme the page draws, read afresh: while hydrating, the hook's own
49
+ // values are still the server's.
50
+ function currentScheme(storageKey, defaultMode) {
51
+ const stored = readStored(storageKey);
52
+ return resolveScheme(isThemeMode(stored) ? stored : defaultMode, systemDark());
53
+ }
54
+ function serverStored() {
55
+ return null;
56
+ }
57
+ function serverDark() {
58
+ return false;
59
+ }
60
+ function writeCookie(name, scheme) {
61
+ try {
62
+ document.cookie = schemeCookie(name, scheme, window.isSecureContext);
63
+ }
64
+ catch {
65
+ // A sandboxed frame has no cookies.
66
+ }
67
+ }
68
+ // True once the page is the client's: false on the server and while
69
+ // hydrating, where initialScheme must be drawn.
70
+ function subscribeNothing() {
71
+ return () => { };
72
+ }
73
+ function clientTrue() {
74
+ return true;
75
+ }
76
+ function serverFalse() {
77
+ return false;
78
+ }
79
+ export function useThemeMode({ storageKey = THEME_STORAGE_KEY, defaultMode = "system", cookie, initialScheme, } = {}) {
80
+ const stored = useSyncExternalStore(subscribeMode, () => readStored(storageKey), serverStored);
81
+ const dark = useSyncExternalStore(subscribeSystem, systemDark, serverDark);
82
+ // Without initialScheme there's nothing to hold until hydration ends, so the
83
+ // server's answer is the client's, and hydrating needs no second render.
84
+ const hydrated = useSyncExternalStore(subscribeNothing, clientTrue, initialScheme ? serverFalse : clientTrue);
85
+ const mode = isThemeMode(stored) ? stored : defaultMode;
86
+ const live = resolveScheme(mode, dark);
87
+ const scheme = hydrated || !initialScheme ? live : initialScheme;
88
+ // On load, and whenever the scheme changes: another tab's choice, or the
89
+ // OS setting.
90
+ useEffect(() => {
91
+ if (cookie)
92
+ writeCookie(cookie, currentScheme(storageKey, defaultMode));
93
+ }, [cookie, storageKey, defaultMode, live]);
94
+ const setMode = useCallback((next) => {
95
+ try {
96
+ window.localStorage.setItem(storageKey, next);
97
+ memory.delete(storageKey);
98
+ }
99
+ catch {
100
+ memory.set(storageKey, next);
101
+ }
102
+ // At once, not in the effect: a page load right after must carry it.
103
+ if (cookie)
104
+ writeCookie(cookie, currentScheme(storageKey, defaultMode));
105
+ for (const listener of listeners)
106
+ listener();
107
+ }, [storageKey, cookie, defaultMode]);
108
+ // The same object until something changes: UiProvider puts it in context.
109
+ return useMemo(() => ({ mode, setMode, scheme }), [mode, setMode, scheme]);
110
+ }
111
+ //# sourceMappingURL=useThemeMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useThemeMode.js","sourceRoot":"","sources":["../../src/hooks/useThemeMode.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,yEAAyE;AACzE,6DAA6D;AAC7D,EAAE;AACF,uEAAuE;AACvE,4EAA4E;AAC5E,4EAA4E;AAC5E,4DAA4D;AAC5D,0EAA0E;AAC1E,2EAA2E;AAC3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,WAAW,CAAC,CAClC,CAAC;IAEF,0EAA0E;IAC1E,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAC7E,CAAC"}
@@ -0,0 +1,22 @@
1
+ /** A message for `SettingsToast`. */
2
+ export interface ToastMessage {
3
+ /** Shows it as a success or an error. */
4
+ type: "success" | "error";
5
+ /** The message, already translated. */
6
+ text: string;
7
+ }
8
+ /**
9
+ * A message that clears itself, for `SettingsToast`.
10
+ *
11
+ * @param timeoutMs How long a message shows, in milliseconds.
12
+ */
13
+ export declare function useToastMessage(timeoutMs?: number): {
14
+ /** The message to show, or `null`. Pass it to `SettingsToast`. */
15
+ message: ToastMessage | null;
16
+ /** Shows a message, which clears after `timeoutMs`. A new one replaces
17
+ * the one showing and starts its own timeout. */
18
+ showMsg: (type: ToastMessage["type"], text: string) => void;
19
+ /** To clear or set the message yourself. */
20
+ setMessage: import("react").Dispatch<import("react").SetStateAction<ToastMessage | null>>;
21
+ };
22
+ //# sourceMappingURL=useToastMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToastMessage.d.ts","sourceRoot":"","sources":["../../src/hooks/useToastMessage.ts"],"names":[],"mappings":"AAEA,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;IAC1B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,SAAO;IAc5C,kEAAkE;;IAElE;sDACkD;oBAZ3C,YAAY,CAAC,MAAM,CAAC,QAAQ,MAAM;IAczC,4CAA4C;;EAG/C"}
@@ -0,0 +1,26 @@
1
+ import { useCallback, useRef, useState } from "react";
2
+ /**
3
+ * A message that clears itself, for `SettingsToast`.
4
+ *
5
+ * @param timeoutMs How long a message shows, in milliseconds.
6
+ */
7
+ export function useToastMessage(timeoutMs = 5000) {
8
+ const [message, setMessage] = useState(null);
9
+ const timerRef = useRef(null);
10
+ const showMsg = useCallback((type, text) => {
11
+ if (timerRef.current)
12
+ clearTimeout(timerRef.current);
13
+ setMessage({ type, text });
14
+ timerRef.current = setTimeout(() => setMessage(null), timeoutMs);
15
+ }, [timeoutMs]);
16
+ return {
17
+ /** The message to show, or `null`. Pass it to `SettingsToast`. */
18
+ message,
19
+ /** Shows a message, which clears after `timeoutMs`. A new one replaces
20
+ * the one showing and starts its own timeout. */
21
+ showMsg,
22
+ /** To clear or set the message yourself. */
23
+ setMessage,
24
+ };
25
+ }
26
+ //# sourceMappingURL=useToastMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToastMessage.js","sourceRoot":"","sources":["../../src/hooks/useToastMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUtD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,SAAS,GAAG,IAAI;IAC9C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAsB,IAAI,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAC;IAEpE,MAAM,OAAO,GAAG,WAAW,CACzB,CAAC,IAA0B,EAAE,IAAY,EAAE,EAAE;QAC3C,IAAI,QAAQ,CAAC,OAAO;YAAE,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACrD,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3B,QAAQ,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;IACnE,CAAC,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,OAAO;QACL,kEAAkE;QAClE,OAAO;QACP;0DACkD;QAClD,OAAO;QACP,4CAA4C;QAC5C,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,50 @@
1
+ export { createTheme, type CreateThemeOptions } from "./theme/createTheme.js";
2
+ export { UiProvider, type UiProviderProps } from "./provider/UiProvider.js";
3
+ export { useCanvasClass } from "./provider/canvas.js";
4
+ export { DEFAULT_ROUTER, UiLink, useUiMatch, useUiNavigate, useUiPageTitle, useUiScheme, useUiThemeMode, useUiStrings, type PageTitleHandler, type UiLinkProps, type UiRouter, } from "./provider/context.js";
5
+ export { useConfirm, type ConfirmOptions } from "./hooks/useConfirm.js";
6
+ export { useCopy, type CopyState } from "./hooks/useCopy.js";
7
+ export { useDebouncedSearch } from "./hooks/useDebouncedSearch.js";
8
+ export { usePageClamp } from "./hooks/usePageClamp.js";
9
+ export { useSearchShortcut, type SearchShortcutOptions } from "./hooks/useSearchShortcut.js";
10
+ export { useThemeMode, type ThemeModeOptions, type ThemeModeState } from "./hooks/useThemeMode.js";
11
+ export { useToastMessage, type ToastMessage } from "./hooks/useToastMessage.js";
12
+ export { PageHeader } from "./components/PageHeader.js";
13
+ export { BackButton, DetailHeader } from "./components/DetailHeader.js";
14
+ export { FormPage } from "./components/FormPage.js";
15
+ export { StatusPage, type StatusPageAction, type StatusPageProps, } from "./components/StatusPage.js";
16
+ export { LoadingPage } from "./components/LoadingPage.js";
17
+ export { AuthShell, type AuthShellProps } from "./components/AuthShell.js";
18
+ export { EmptyState } from "./components/EmptyState.js";
19
+ export { GetStartedPanel } from "./components/GetStartedPanel.js";
20
+ export { ViewBanner } from "./components/ViewBanner.js";
21
+ export { LabeledLine } from "./components/LabeledLine.js";
22
+ export { BrandMark } from "./components/BrandMark.js";
23
+ export { TOP_BAR_HEIGHT, TopBar, type TopBarBrand, type TopBarLink, type TopBarProps, } from "./components/TopBar.js";
24
+ export { SideNav, type SideNavGroup, type SideNavItem, type SideNavProps, } from "./components/SideNav.js";
25
+ export { Outline, type OutlineItem, type OutlineProps } from "./components/Outline.js";
26
+ export { PrevNext, type PrevNextLink, type PrevNextProps } from "./components/PrevNext.js";
27
+ export { LoadingBar } from "./components/LoadingBar.js";
28
+ export { AppShell, AppShellClose, type AppShellProps } from "./components/AppShell.js";
29
+ export { SearchField, type SearchFieldProps } from "./components/SearchField.js";
30
+ export { SearchButton, type SearchButtonProps } from "./components/SearchButton.js";
31
+ export { CommandPalette, type CommandGroup, type CommandItem, type CommandPaletteProps, } from "./components/CommandPalette.js";
32
+ export { SaveFooter, SettingsBody, SettingsCard, SettingsEmpty, SettingsFooter, SettingsLinkRow, SettingsPage, SettingsRow, SettingsSubhead, SettingsTable, SettingsToast, } from "./components/Settings.js";
33
+ export { DataList, DataListLink, DataListName, DataListRow, DataListSkeleton, type DataListColumn, } from "./components/DataList.js";
34
+ export { Pagination } from "./components/Pagination.js";
35
+ export { ListSearch } from "./components/ListSearch.js";
36
+ export { Callout, Callouts, ListColumn, ListGrid, ListRow, Metric, MetricGrid, MetricSuffix, SectionTitle, SummaryList, SummaryRow, } from "./components/Overview.js";
37
+ export { SkeletonSettingsCard, SkeletonSettingsPage, SkeletonStatCards, SkeletonTableBodyRows, SkeletonTableRows, } from "./components/Skeletons.js";
38
+ export { Segmented, type SegmentedOption } from "./components/Segmented.js";
39
+ export { ThemeSwitch, type ThemeSwitchProps } from "./components/ThemeSwitch.js";
40
+ export { ThemeMenu, type ThemeMenuProps } from "./components/ThemeMenu.js";
41
+ export { MenuPanel, MenuPanelButton, MenuPanelDivider, MenuPanelHeader, MenuPanelRow, } from "./components/MenuPanel.js";
42
+ export { Select } from "./components/Select.js";
43
+ export { CheckboxField } from "./components/CheckboxField.js";
44
+ export { PasswordInput } from "./components/PasswordInput.js";
45
+ export { DurationInput } from "./components/DurationInput.js";
46
+ export { ColorPickerInput } from "./components/ColorPickerInput.js";
47
+ export { CopyButton, type CopyButtonProps } from "./components/CopyButton.js";
48
+ export { CopyIdText, CopyIdTrigger } from "./components/CopyIdTrigger.js";
49
+ export { CANVAS, DEFAULT_ACCENT, SCHEME_COOKIE, THEME_STORAGE_KEY, resolveScheme, schemeBootScript, schemeCookie, schemeFromRequest, type Scheme, type ThemeMode, type UiStrings, type DurationUnit, } from "@siiway/ui-core";
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,cAAc,EACd,MAAM,EACN,UAAU,EACV,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EACd,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,QAAQ,GACd,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,KAAK,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAGhF,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,8B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