@siiway/ui-react 0.1.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 (108) hide show
  1. package/dist/components/AppShell.d.ts +29 -0
  2. package/dist/components/AppShell.d.ts.map +1 -0
  3. package/dist/components/AppShell.js +220 -0
  4. package/dist/components/AppShell.js.map +1 -0
  5. package/dist/components/AuthShell.d.ts +21 -0
  6. package/dist/components/AuthShell.d.ts.map +1 -0
  7. package/dist/components/AuthShell.js +53 -0
  8. package/dist/components/AuthShell.js.map +1 -0
  9. package/dist/components/ButtonLink.d.ts +11 -0
  10. package/dist/components/ButtonLink.d.ts.map +1 -0
  11. package/dist/components/ButtonLink.js +15 -0
  12. package/dist/components/ButtonLink.js.map +1 -0
  13. package/dist/components/CommandPalette.d.ts +23 -11
  14. package/dist/components/CommandPalette.d.ts.map +1 -1
  15. package/dist/components/CommandPalette.js +33 -3
  16. package/dist/components/CommandPalette.js.map +1 -1
  17. package/dist/components/CopyButton.d.ts +25 -6
  18. package/dist/components/CopyButton.d.ts.map +1 -1
  19. package/dist/components/CopyButton.js +11 -8
  20. package/dist/components/CopyButton.js.map +1 -1
  21. package/dist/components/DetailHeader.d.ts +5 -1
  22. package/dist/components/DetailHeader.d.ts.map +1 -1
  23. package/dist/components/DetailHeader.js +6 -5
  24. package/dist/components/DetailHeader.js.map +1 -1
  25. package/dist/components/FormPage.d.ts +1 -1
  26. package/dist/components/FormPage.d.ts.map +1 -1
  27. package/dist/components/LoadingPage.d.ts +6 -0
  28. package/dist/components/LoadingPage.d.ts.map +1 -0
  29. package/dist/components/LoadingPage.js +25 -0
  30. package/dist/components/LoadingPage.js.map +1 -0
  31. package/dist/components/MenuPanel.d.ts +34 -0
  32. package/dist/components/MenuPanel.d.ts.map +1 -0
  33. package/dist/components/MenuPanel.js +98 -0
  34. package/dist/components/MenuPanel.js.map +1 -0
  35. package/dist/components/PageHeader.d.ts +3 -3
  36. package/dist/components/PageHeader.d.ts.map +1 -1
  37. package/dist/components/PageHeader.js +5 -14
  38. package/dist/components/PageHeader.js.map +1 -1
  39. package/dist/components/PasswordInput.d.ts.map +1 -1
  40. package/dist/components/PasswordInput.js +15 -2
  41. package/dist/components/PasswordInput.js.map +1 -1
  42. package/dist/components/SideNav.d.ts +18 -5
  43. package/dist/components/SideNav.d.ts.map +1 -1
  44. package/dist/components/SideNav.js +30 -4
  45. package/dist/components/SideNav.js.map +1 -1
  46. package/dist/components/StatusPage.d.ts +17 -5
  47. package/dist/components/StatusPage.d.ts.map +1 -1
  48. package/dist/components/StatusPage.js +10 -6
  49. package/dist/components/StatusPage.js.map +1 -1
  50. package/dist/components/ThemeMenu.d.ts +6 -4
  51. package/dist/components/ThemeMenu.d.ts.map +1 -1
  52. package/dist/components/ThemeMenu.js +3 -27
  53. package/dist/components/ThemeMenu.js.map +1 -1
  54. package/dist/components/ThemeSwitch.d.ts +7 -4
  55. package/dist/components/ThemeSwitch.d.ts.map +1 -1
  56. package/dist/components/ThemeSwitch.js +12 -4
  57. package/dist/components/ThemeSwitch.js.map +1 -1
  58. package/dist/components/TopBar.d.ts +6 -2
  59. package/dist/components/TopBar.d.ts.map +1 -1
  60. package/dist/components/TopBar.js +10 -9
  61. package/dist/components/TopBar.js.map +1 -1
  62. package/dist/hooks/useCopy.d.ts +5 -2
  63. package/dist/hooks/useCopy.d.ts.map +1 -1
  64. package/dist/hooks/useCopy.js +29 -4
  65. package/dist/hooks/useCopy.js.map +1 -1
  66. package/dist/hooks/useThemeMode.d.ts +13 -1
  67. package/dist/hooks/useThemeMode.d.ts.map +1 -1
  68. package/dist/hooks/useThemeMode.js +59 -10
  69. package/dist/hooks/useThemeMode.js.map +1 -1
  70. package/dist/index.d.ts +8 -3
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +7 -2
  73. package/dist/index.js.map +1 -1
  74. package/dist/provider/UiProvider.d.ts +30 -7
  75. package/dist/provider/UiProvider.d.ts.map +1 -1
  76. package/dist/provider/UiProvider.js +116 -14
  77. package/dist/provider/UiProvider.js.map +1 -1
  78. package/dist/provider/canvas.d.ts +5 -0
  79. package/dist/provider/canvas.d.ts.map +1 -1
  80. package/dist/provider/canvas.js +21 -6
  81. package/dist/provider/canvas.js.map +1 -1
  82. package/dist/provider/context.d.ts +27 -3
  83. package/dist/provider/context.d.ts.map +1 -1
  84. package/dist/provider/context.js +48 -3
  85. package/dist/provider/context.js.map +1 -1
  86. package/package.json +2 -2
  87. package/src/components/AppShell.tsx +337 -0
  88. package/src/components/AuthShell.tsx +104 -0
  89. package/src/components/ButtonLink.tsx +40 -0
  90. package/src/components/CommandPalette.tsx +56 -14
  91. package/src/components/CopyButton.tsx +61 -33
  92. package/src/components/DetailHeader.tsx +12 -6
  93. package/src/components/FormPage.tsx +1 -1
  94. package/src/components/LoadingPage.tsx +41 -0
  95. package/src/components/MenuPanel.tsx +163 -0
  96. package/src/components/PageHeader.tsx +9 -20
  97. package/src/components/PasswordInput.tsx +16 -1
  98. package/src/components/SideNav.tsx +86 -16
  99. package/src/components/StatusPage.tsx +41 -17
  100. package/src/components/ThemeMenu.tsx +12 -44
  101. package/src/components/ThemeSwitch.tsx +20 -10
  102. package/src/components/TopBar.tsx +31 -18
  103. package/src/hooks/useCopy.ts +27 -8
  104. package/src/hooks/useThemeMode.ts +78 -8
  105. package/src/index.ts +17 -1
  106. package/src/provider/UiProvider.tsx +182 -21
  107. package/src/provider/canvas.ts +20 -6
  108. package/src/provider/context.tsx +65 -5
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { createTheme, type CreateThemeOptions } from "./theme/createTheme.js";
2
2
  export { UiProvider, type UiProviderProps } from "./provider/UiProvider.js";
3
- export { DEFAULT_ROUTER, UiLink, useUiNavigate, useUiPageTitle, useUiScheme, useUiStrings, type PageTitleHandler, type UiLinkProps, type UiRouter, } from "./provider/context.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";
4
5
  export { useConfirm, type ConfirmOptions } from "./hooks/useConfirm.js";
5
6
  export { useCopy, type CopyState } from "./hooks/useCopy.js";
6
7
  export { useDebouncedSearch } from "./hooks/useDebouncedSearch.js";
@@ -12,6 +13,8 @@ export { PageHeader } from "./components/PageHeader.js";
12
13
  export { BackButton, DetailHeader } from "./components/DetailHeader.js";
13
14
  export { FormPage } from "./components/FormPage.js";
14
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";
15
18
  export { EmptyState } from "./components/EmptyState.js";
16
19
  export { GetStartedPanel } from "./components/GetStartedPanel.js";
17
20
  export { ViewBanner } from "./components/ViewBanner.js";
@@ -22,6 +25,7 @@ export { SideNav, type SideNavGroup, type SideNavItem, type SideNavProps, } from
22
25
  export { Outline, type OutlineItem, type OutlineProps } from "./components/Outline.js";
23
26
  export { PrevNext, type PrevNextLink, type PrevNextProps } from "./components/PrevNext.js";
24
27
  export { LoadingBar } from "./components/LoadingBar.js";
28
+ export { AppShell, AppShellClose, type AppShellProps } from "./components/AppShell.js";
25
29
  export { SearchField, type SearchFieldProps } from "./components/SearchField.js";
26
30
  export { SearchButton, type SearchButtonProps } from "./components/SearchButton.js";
27
31
  export { CommandPalette, type CommandGroup, type CommandItem, type CommandPaletteProps, } from "./components/CommandPalette.js";
@@ -34,12 +38,13 @@ export { SkeletonSettingsCard, SkeletonSettingsPage, SkeletonStatCards, Skeleton
34
38
  export { Segmented, type SegmentedOption } from "./components/Segmented.js";
35
39
  export { ThemeSwitch, type ThemeSwitchProps } from "./components/ThemeSwitch.js";
36
40
  export { ThemeMenu, type ThemeMenuProps } from "./components/ThemeMenu.js";
41
+ export { MenuPanel, MenuPanelButton, MenuPanelDivider, MenuPanelHeader, MenuPanelRow, } from "./components/MenuPanel.js";
37
42
  export { Select } from "./components/Select.js";
38
43
  export { CheckboxField } from "./components/CheckboxField.js";
39
44
  export { PasswordInput } from "./components/PasswordInput.js";
40
45
  export { DurationInput } from "./components/DurationInput.js";
41
46
  export { ColorPickerInput } from "./components/ColorPickerInput.js";
42
- export { CopyButton } from "./components/CopyButton.js";
47
+ export { CopyButton, type CopyButtonProps } from "./components/CopyButton.js";
43
48
  export { CopyIdText, CopyIdTrigger } from "./components/CopyIdTrigger.js";
44
- export { CANVAS, DEFAULT_ACCENT, THEME_STORAGE_KEY, resolveScheme, schemeBootScript, type Scheme, type ThemeMode, type UiStrings, type DurationUnit, } from "@siiway/ui-core";
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";
45
50
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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,EACL,cAAc,EACd,MAAM,EACN,aAAa,EACb,cAAc,EACd,WAAW,EACX,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,YAA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AE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG1E,OAAO,EACL,MAAM,EACN,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  // Theme and provider
2
2
  export { createTheme } from "./theme/createTheme.js";
3
3
  export { UiProvider } from "./provider/UiProvider.js";
4
- export { DEFAULT_ROUTER, UiLink, useUiNavigate, useUiPageTitle, useUiScheme, useUiStrings, } from "./provider/context.js";
4
+ export { useCanvasClass } from "./provider/canvas.js";
5
+ export { DEFAULT_ROUTER, UiLink, useUiMatch, useUiNavigate, useUiPageTitle, useUiScheme, useUiThemeMode, useUiStrings, } from "./provider/context.js";
5
6
  // Hooks
6
7
  export { useConfirm } from "./hooks/useConfirm.js";
7
8
  export { useCopy } from "./hooks/useCopy.js";
@@ -15,6 +16,8 @@ export { PageHeader } from "./components/PageHeader.js";
15
16
  export { BackButton, DetailHeader } from "./components/DetailHeader.js";
16
17
  export { FormPage } from "./components/FormPage.js";
17
18
  export { StatusPage, } from "./components/StatusPage.js";
19
+ export { LoadingPage } from "./components/LoadingPage.js";
20
+ export { AuthShell } from "./components/AuthShell.js";
18
21
  export { EmptyState } from "./components/EmptyState.js";
19
22
  export { GetStartedPanel } from "./components/GetStartedPanel.js";
20
23
  export { ViewBanner } from "./components/ViewBanner.js";
@@ -26,6 +29,7 @@ export { SideNav, } from "./components/SideNav.js";
26
29
  export { Outline } from "./components/Outline.js";
27
30
  export { PrevNext } from "./components/PrevNext.js";
28
31
  export { LoadingBar } from "./components/LoadingBar.js";
32
+ export { AppShell, AppShellClose } from "./components/AppShell.js";
29
33
  // Search
30
34
  export { SearchField } from "./components/SearchField.js";
31
35
  export { SearchButton } from "./components/SearchButton.js";
@@ -42,6 +46,7 @@ export { SkeletonSettingsCard, SkeletonSettingsPage, SkeletonStatCards, Skeleton
42
46
  export { Segmented } from "./components/Segmented.js";
43
47
  export { ThemeSwitch } from "./components/ThemeSwitch.js";
44
48
  export { ThemeMenu } from "./components/ThemeMenu.js";
49
+ export { MenuPanel, MenuPanelButton, MenuPanelDivider, MenuPanelHeader, MenuPanelRow, } from "./components/MenuPanel.js";
45
50
  export { Select } from "./components/Select.js";
46
51
  export { CheckboxField } from "./components/CheckboxField.js";
47
52
  export { PasswordInput } from "./components/PasswordInput.js";
@@ -51,5 +56,5 @@ export { ColorPickerInput } from "./components/ColorPickerInput.js";
51
56
  export { CopyButton } from "./components/CopyButton.js";
52
57
  export { CopyIdText, CopyIdTrigger } from "./components/CopyIdTrigger.js";
53
58
  // Re-exported from @siiway/ui-core for convenience
54
- export { CANVAS, DEFAULT_ACCENT, THEME_STORAGE_KEY, resolveScheme, schemeBootScript, } from "@siiway/ui-core";
59
+ export { CANVAS, DEFAULT_ACCENT, SCHEME_COOKIE, THEME_STORAGE_KEY, resolveScheme, schemeBootScript, schemeCookie, schemeFromRequest, } from "@siiway/ui-core";
55
60
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EAAE,WAAW,EAA2B,MAAM,wBAAwB,CAAC;AAC9E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EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EACL,OAAO,EACP,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAEnC,SAAS;AACT,OAAO,EAAE,SAAS,EAAwB,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAyB,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAE,SAAS,EAAuB,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EACL,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,YAAY,GACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO;AACP,OAAO,EAAE,UAAU,EAAwB,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE1E,mDAAmD;AACnD,OAAO,EACL,MAAM,EACN,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,GAKlB,MAAM,iBAAiB,CAAC"}
@@ -1,16 +1,38 @@
1
1
  import { type FluentProviderProps } from "@fluentui/react-components";
2
2
  import { type Scheme, type UiStrings } from "@siiway/ui-core";
3
+ import { type ThemeModeOptions } from "../hooks/useThemeMode.js";
3
4
  import { type PageTitleHandler, type UiRouter } from "./context.js";
4
5
  export interface UiProviderProps extends Omit<FluentProviderProps, "theme"> {
5
- /** The scheme to render in: `useThemeMode().scheme`, or the app's own. */
6
- scheme: Scheme;
6
+ /**
7
+ * The scheme to render in, when the app keeps the light/dark choice itself
8
+ * or draws a fixed one. Leave it out and the provider keeps the person's
9
+ * choice (`themeMode`), or a provider inside another follows the outer one.
10
+ */
11
+ scheme?: Scheme;
12
+ /**
13
+ * How the provider keeps the person's choice when it has no `scheme`:
14
+ * `useThemeMode`'s options (`storageKey`, `defaultMode`, `cookie`,
15
+ * `initialScheme`). `ThemeSwitch` and `ThemeMenu` show and change it, and
16
+ * `useUiThemeMode()` gives it to your own components.
17
+ */
18
+ themeMode?: ThemeModeOptions;
7
19
  /**
8
20
  * This provider is the page. It takes the canvas colour, removes the
9
21
  * body's margin, and draws `<html>` in the scheme (`data-scheme`,
10
- * `color-scheme`, the canvas background), as `schemeBootScript` does
11
- * before the app loads. Set it on the app's outermost provider only.
22
+ * `color-scheme`, the canvas background, `--siiway-canvas`) and each
23
+ * `<meta name="theme-color">` in the canvas, as `schemeBootScript` does
24
+ * before the app loads. Selected text takes a tint of the accent, and
25
+ * scrollbars are thin. Set it on the app's outermost provider only.
12
26
  */
13
27
  page?: boolean;
28
+ /**
29
+ * With `page`, for a page rendered once for everyone, such as a static
30
+ * site: it carries both schemes' colours, keyed on `<html data-scheme>`,
31
+ * so the scheme `schemeBootScript` picks shows before the app loads, not
32
+ * the one the page was rendered in. It adds about as much CSS again as the
33
+ * theme takes. Without `page` it does nothing.
34
+ */
35
+ bothSchemes?: boolean;
14
36
  /** Brand colour; missing or invalid gives Fluent's blue. */
15
37
  accent?: string | null;
16
38
  /** BCP-47 tag for the library's own strings: `zh*` is Chinese, anything else English. */
@@ -23,8 +45,9 @@ export interface UiProviderProps extends Omit<FluentProviderProps, "theme"> {
23
45
  */
24
46
  router?: UiRouter;
25
47
  /**
26
- * Called with a page's title when a PageHeader mounts, and with null when
27
- * it unmounts, so the app can set the browser tab's title. Pass a stable
48
+ * Called with a page's title when its PageHeader or DetailHeader mounts
49
+ * (`tabTitle`, or the title if it's plain text), and with null when the
50
+ * page goes, so the app can set the browser tab's title. Pass a stable
28
51
  * function.
29
52
  */
30
53
  onPageTitle?: PageTitleHandler;
@@ -33,5 +56,5 @@ export interface UiProviderProps extends Omit<FluentProviderProps, "theme"> {
33
56
  * Fluent's provider with the SiiWay theme, plus the library's strings and
34
57
  * router. Wrap the app in it once, where FluentProvider used to be.
35
58
  */
36
- export declare function UiProvider({ scheme, page, accent, locale, strings, router, onPageTitle, children, ...rest }: UiProviderProps): import("react").JSX.Element;
59
+ export declare function UiProvider(props: UiProviderProps): import("react").JSX.Element;
37
60
  //# sourceMappingURL=UiProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiProvider.d.ts","sourceRoot":"","sources":["../../src/provider/UiProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAuB,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGnF,OAAO,EAA6B,KAAK,gBAAgB,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/F,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACzE,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,yFAAyF;IACzF,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7B;;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;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAQhD"}
@@ -1,32 +1,128 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { FluentProvider, makeStaticStyles, useIsomorphicLayoutEffect, } from "@fluentui/react-components";
3
- import { CANVAS, pickStrings } from "@siiway/ui-core";
4
- import { useMemo } from "react";
2
+ import { FluentProvider, createCSSRuleFromTheme, makeStaticStyles, mergeClasses, tokens, useIsomorphicLayoutEffect, } from "@fluentui/react-components";
3
+ import { CANVAS, DEFAULT_ACCENT, pickStrings } from "@siiway/ui-core";
4
+ import { useContext, useMemo, useSyncExternalStore } from "react";
5
+ import { useThemeMode } from "../hooks/useThemeMode.js";
5
6
  import { createTheme } from "../theme/createTheme.js";
6
- import { DEFAULT_ROUTER, UiContext } from "./context.js";
7
- const usePageStyles = makeStaticStyles({ body: { margin: "0" } });
7
+ import { DEFAULT_ROUTER, NO_PROVIDER, UiContext, } from "./context.js";
8
+ // The look's rules for Fluent's own parts, wherever they render. Badges keep
9
+ // their label on one line: in a narrow flex row, CJK text otherwise wraps a
10
+ // character at a time. Surfaces that float (in a portal, outside the page's
11
+ // containers) get a hairline on top of their shadow, which barely shows on the
12
+ // dark canvas.
13
+ const useLookStyles = makeStaticStyles({
14
+ ".fui-Badge": { whiteSpace: "nowrap", flexShrink: "0" },
15
+ ".fui-DialogSurface, .fui-MenuPopover, .fui-PopoverSurface, .fui-Listbox": {
16
+ border: `1px solid ${tokens.colorNeutralStroke2}`,
17
+ },
18
+ });
19
+ function LookStyles() {
20
+ useLookStyles();
21
+ return null;
22
+ }
23
+ // Selected text takes a tint of the accent, and scrollbars are thin, with a
24
+ // neutral thumb on a clear track in either scheme.
25
+ const usePageStyles = makeStaticStyles({
26
+ body: { margin: "0" },
27
+ "::selection": {
28
+ backgroundColor: `color-mix(in srgb, var(--colorBrandBackground, ${DEFAULT_ACCENT}) 22%, transparent)`,
29
+ },
30
+ "::-webkit-scrollbar": { width: "8px", height: "8px" },
31
+ "::-webkit-scrollbar-track": { backgroundColor: "transparent" },
32
+ "::-webkit-scrollbar-thumb": {
33
+ backgroundColor: "rgba(0, 0, 0, 0.16)",
34
+ backgroundClip: "padding-box",
35
+ border: "2px solid transparent",
36
+ borderRadius: "4px",
37
+ },
38
+ "::-webkit-scrollbar-thumb:hover": { backgroundColor: "rgba(0, 0, 0, 0.32)" },
39
+ 'html[data-scheme="dark"] ::-webkit-scrollbar-thumb': {
40
+ backgroundColor: "rgba(255, 255, 255, 0.14)",
41
+ },
42
+ 'html[data-scheme="dark"] ::-webkit-scrollbar-thumb:hover': {
43
+ backgroundColor: "rgba(255, 255, 255, 0.28)",
44
+ },
45
+ });
46
+ const subscribeNothing = () => () => { };
47
+ // False while hydrating, true from the render after (and at once in a render
48
+ // that doesn't hydrate).
49
+ function useHydrated() {
50
+ return useSyncExternalStore(subscribeNothing, () => true, () => false);
51
+ }
8
52
  // <html> in the page's scheme, for what lies outside the provider: the
9
- // overscroll area, the scrollbars, form controls' native parts.
10
- function PageScheme({ scheme }) {
53
+ // overscroll area, the scrollbars, form controls' native parts, the app's CSS
54
+ // (--siiway-canvas) and the browser's own bar (theme-color).
55
+ function PageScheme({ scheme, both }) {
11
56
  usePageStyles();
57
+ // Hydrating a page with both schemes, `scheme` is the one the server drew,
58
+ // and <html> has the one the boot script picked, which the page shows. Left
59
+ // as it is until the render after, which brings the app's own scheme.
60
+ const hydrated = useHydrated();
61
+ const hold = both && !hydrated;
12
62
  useIsomorphicLayoutEffect(() => {
63
+ if (hold)
64
+ return;
13
65
  const root = document.documentElement;
66
+ const canvas = CANVAS[scheme];
14
67
  root.setAttribute("data-scheme", scheme);
15
68
  root.style.colorScheme = scheme;
16
- root.style.backgroundColor = CANVAS[scheme];
69
+ root.style.backgroundColor = canvas;
70
+ root.style.setProperty("--siiway-canvas", canvas);
71
+ const metas = Array.from(document.querySelectorAll('meta[name="theme-color"]'));
72
+ const colors = metas.map((meta) => meta.content);
73
+ for (const meta of metas)
74
+ meta.content = canvas;
17
75
  return () => {
18
76
  root.removeAttribute("data-scheme");
19
77
  root.style.removeProperty("color-scheme");
20
78
  root.style.removeProperty("background-color");
79
+ root.style.removeProperty("--siiway-canvas");
80
+ metas.forEach((meta, i) => (meta.content = colors[i]));
21
81
  };
22
- }, [scheme]);
82
+ }, [scheme, hold]);
83
+ return null;
84
+ }
85
+ // For bothSchemes: each scheme's tokens, keyed on <html data-scheme>, which the
86
+ // boot script sets before the page paints. They outrank FluentProvider's own
87
+ // rule for its class, and agree with it once the provider draws the page's
88
+ // scheme.
89
+ const BOTH_SCHEMES = "siiway-both-schemes";
90
+ // Through Griffel, as static styles: the renderer gives them its attributes
91
+ // (a CSP nonce) and, on the server, puts them in the head with the rest. One
92
+ // hook per accent, made once.
93
+ const bothSchemesStyles = new Map();
94
+ function BothSchemes({ accent }) {
95
+ const key = accent ?? "";
96
+ let useRules = bothSchemesStyles.get(key);
97
+ if (!useRules) {
98
+ useRules = makeStaticStyles(["light", "dark"].map((scheme) => createCSSRuleFromTheme(`html[data-scheme="${scheme}"] .${BOTH_SCHEMES}`, createTheme({ scheme, accent }))));
99
+ bothSchemesStyles.set(key, useRules);
100
+ }
101
+ useRules();
23
102
  return null;
24
103
  }
25
104
  /**
26
105
  * Fluent's provider with the SiiWay theme, plus the library's strings and
27
106
  * router. Wrap the app in it once, where FluentProvider used to be.
28
107
  */
29
- export function UiProvider({ scheme, page, accent, locale, strings, router, onPageTitle, children, ...rest }) {
108
+ export function UiProvider(props) {
109
+ const outer = useContext(UiContext);
110
+ const kept = outer.themeMode;
111
+ if (props.scheme !== undefined)
112
+ return _jsx(Provider, { ...props, scheme: props.scheme, kept: kept });
113
+ // Inside another provider: draw what it draws, whether it keeps the choice
114
+ // or was given a scheme.
115
+ if (outer !== NO_PROVIDER)
116
+ return _jsx(Provider, { ...props, scheme: outer.scheme, kept: kept });
117
+ return _jsx(KeepingProvider, { ...props });
118
+ }
119
+ // The outermost provider without a scheme keeps the person's choice.
120
+ function KeepingProvider({ themeMode, ...props }) {
121
+ const kept = useThemeMode(themeMode);
122
+ return _jsx(Provider, { ...props, scheme: kept.scheme, kept: kept });
123
+ }
124
+ function Provider({ scheme, kept, themeMode: _options, page, bothSchemes, accent, locale, strings, router, onPageTitle, children, ...rest }) {
125
+ const both = !!(page && bothSchemes);
30
126
  const theme = useMemo(() => createTheme({ scheme, accent }), [scheme, accent]);
31
127
  const resolved = useMemo(() => pickStrings(locale, strings), [locale, strings]);
32
128
  const value = useMemo(() => ({
@@ -34,9 +130,15 @@ export function UiProvider({ scheme, page, accent, locale, strings, router, onPa
34
130
  strings: resolved,
35
131
  router: router ?? DEFAULT_ROUTER,
36
132
  onPageTitle: onPageTitle ?? null,
37
- }), [scheme, resolved, router, onPageTitle]);
38
- // Fluent paints its provider colorNeutralBackground1; the page is the canvas.
39
- const style = page ? { backgroundColor: CANVAS[scheme], ...rest.style } : rest.style;
40
- return (_jsxs(FluentProvider, { theme: theme, ...rest, style: style, children: [page && _jsx(PageScheme, { scheme: scheme }), _jsx(UiContext.Provider, { value: value, children: children })] }));
133
+ themeMode: kept,
134
+ bothSchemes: both,
135
+ }), [scheme, resolved, router, onPageTitle, kept, both]);
136
+ // Fluent paints its provider colorNeutralBackground1; the page is the canvas,
137
+ // with bothSchemes the one <html> has.
138
+ const canvas = both ? `var(--siiway-canvas, ${CANVAS[scheme]})` : CANVAS[scheme];
139
+ const style = page
140
+ ? { backgroundColor: canvas, ...rest.style }
141
+ : rest.style;
142
+ return (_jsxs(FluentProvider, { theme: theme, ...rest, className: both ? mergeClasses(BOTH_SCHEMES, rest.className) : rest.className, style: style, children: [_jsx(LookStyles, {}), both && _jsx(BothSchemes, { accent: accent }), page && _jsx(PageScheme, { scheme: scheme, both: both }), _jsx(UiContext.Provider, { value: value, children: children })] }));
41
143
  }
42
144
  //# sourceMappingURL=UiProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiProvider.js","sourceRoot":"","s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,EAAE,KAAK,YAAG,QAAQ,GAAsB,IAClD,CAClB,CAAC;AACJ,CAAC"}
@@ -1,2 +1,7 @@
1
+ /**
2
+ * A class with the canvas colour, in the provider's scheme (or the page's,
3
+ * with `bothSchemes`), for parts of the page drawn on it that must be opaque:
4
+ * a sticky bar, a drawer, a full-page message.
5
+ */
1
6
  export declare function useCanvasClass(): string;
2
7
  //# sourceMappingURL=canvas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../../src/provider/canvas.ts"],"names":[],"mappings":"AAcA,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
1
+ {"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../../src/provider/canvas.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAKvC"}
@@ -1,15 +1,30 @@
1
- // The page canvas as a class, for the parts of the page drawn on it that must
2
- // be opaque: a sticky top bar, a full-page message. Tokens have no canvas
3
- // (it's darker than colorNeutralBackground1 in dark), so this picks CANVAS by
4
- // the provider's scheme.
1
+ // Tokens have no canvas (it's darker than colorNeutralBackground1 in dark),
2
+ // so this picks CANVAS by the provider's scheme. Under a page provider with
3
+ // bothSchemes, whose colours follow <html data-scheme>, it reads the canvas
4
+ // there instead (--siiway-canvas, set by schemeBootScript before the page
5
+ // paints): the one the boot script picked, not the one the page was rendered
6
+ // in. Without bothSchemes the rest of the page is drawn in the rendered
7
+ // scheme until the app loads, so the canvas stays with it.
5
8
  import { makeStyles } from "@fluentui/react-components";
6
9
  import { CANVAS } from "@siiway/ui-core";
7
- import { useUiScheme } from "./context.js";
10
+ import { useContext } from "react";
11
+ import { UiContext } from "./context.js";
8
12
  const useStyles = makeStyles({
9
13
  light: { backgroundColor: CANVAS.light },
10
14
  dark: { backgroundColor: CANVAS.dark },
15
+ pageLight: { backgroundColor: `var(--siiway-canvas, ${CANVAS.light})` },
16
+ pageDark: { backgroundColor: `var(--siiway-canvas, ${CANVAS.dark})` },
11
17
  });
18
+ /**
19
+ * A class with the canvas colour, in the provider's scheme (or the page's,
20
+ * with `bothSchemes`), for parts of the page drawn on it that must be opaque:
21
+ * a sticky bar, a drawer, a full-page message.
22
+ */
12
23
  export function useCanvasClass() {
13
- return useStyles()[useUiScheme()];
24
+ const styles = useStyles();
25
+ const { scheme, bothSchemes } = useContext(UiContext);
26
+ if (!bothSchemes)
27
+ return styles[scheme];
28
+ return scheme === "dark" ? styles.pageDark : styles.pageLight;
14
29
  }
15
30
  //# sourceMappingURL=canvas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"canvas.js","sourceRoot":"","sources":["../../src/provider/canvas.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0EAA0E;AAC1E,8EAA8E;AAC9E,yBAAyB;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,SAAS,GAAG,UAAU,CAAC;IAC3B,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,CAAC,KAAK,EAAE;IACxC,IAAI,EAAE,EAAE,eAAe,EAAE,MAAM,CAAC,IAAI,EAAE;CACvC,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc;IAC5B,OAAO,SAAS,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AACpC,CAAC"}
1
+ {"version":3,"file":"canvas.js","sourceRoot":"","sources":["../../src/provider/canvas.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAC5E,0EAA0E;AAC1E,6EAA6E;AAC7E,wEAAwE;AACxE,2DAA2D;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,SAAS,GAAG,UAAU,CAAC;IAC3B,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,CAAC,KAAK,EAAE;IACxC,IAAI,EAAE,EAAE,eAAe,EAAE,MAAM,CAAC,IAAI,EAAE;IACtC,SAAS,EAAE,EAAE,eAAe,EAAE,wBAAwB,MAAM,CAAC,KAAK,GAAG,EAAE;IACvE,QAAQ,EAAE,EAAE,eAAe,EAAE,wBAAwB,MAAM,CAAC,IAAI,GAAG,EAAE;CACtE,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACtD,IAAI,CAAC,WAAW;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;AAChE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { type ComponentType, type MouseEventHandler, type ReactNode } from "react";
2
2
  import { type Scheme, type UiStrings } from "@siiway/ui-core";
3
+ import type { ThemeModeState } from "../hooks/useThemeMode.js";
3
4
  /** Props the library passes to the app's link component. */
4
5
  export interface UiLinkProps {
5
6
  /** An in-app path, e.g. `/apps/123`. */
@@ -13,33 +14,56 @@ export interface UiLinkProps {
13
14
  children?: ReactNode;
14
15
  }
15
16
  /**
16
- * How library components link and navigate. React Router fits as is:
17
- * `router={{ Link, useNavigate }}`.
17
+ * How library components link, navigate and know the current page. React
18
+ * Router fits as is: `router={{ Link, useNavigate }}`, plus `useMatch`.
18
19
  */
19
20
  export interface UiRouter {
20
21
  Link: ComponentType<UiLinkProps>;
21
22
  /** A hook returning a navigate function. Called during render, like any hook. */
22
23
  useNavigate: () => (to: string) => void;
24
+ /**
25
+ * A hook: whether the reader is on `to`, or on a page below it unless
26
+ * `end`. SideNav asks it for items without `active`. React Router:
27
+ * `(to, end) => useMatch({ path: to, end }) !== null`.
28
+ */
29
+ useMatch?: (to: string, end: boolean) => boolean;
23
30
  }
24
31
  /** Plain `<a href>` links and full page loads: for apps without a client router. */
25
32
  export declare const DEFAULT_ROUTER: UiRouter;
26
- /** Receives the page's title from PageHeader, and null when the page goes. */
33
+ /** Receives the page's title from its header, and null when the page goes. */
27
34
  export type PageTitleHandler = (title: string | null) => void;
28
35
  export interface UiContextValue {
29
36
  scheme: Scheme;
30
37
  strings: UiStrings;
31
38
  router: UiRouter;
32
39
  onPageTitle: PageTitleHandler | null;
40
+ /** The person's light/dark choice, when the page's provider keeps it. */
41
+ themeMode: ThemeModeState | null;
42
+ /** Under a page provider with `bothSchemes`: colours follow `<html data-scheme>`. */
43
+ bothSchemes: boolean;
33
44
  }
45
+ export declare const NO_PROVIDER: UiContextValue;
34
46
  export declare const UiContext: import("react").Context<UiContextValue>;
35
47
  /** The library's own strings, in the locale given to `<UiProvider>`. */
36
48
  export declare function useUiStrings(): UiStrings;
37
49
  /** The scheme `<UiProvider>` renders in. */
38
50
  export declare function useUiScheme(): Scheme;
51
+ /**
52
+ * The person's light/dark choice that `<UiProvider>` keeps when it has no
53
+ * `scheme`: `{ mode, setMode, scheme }`. Null when the app keeps it itself.
54
+ */
55
+ export declare function useUiThemeMode(): ThemeModeState | null;
39
56
  /** A link through the app's router (React Router's `Link`, or `<a href>`). */
40
57
  export declare function UiLink(props: UiLinkProps): import("react").JSX.Element;
41
58
  /** A function that navigates to an in-app path. */
42
59
  export declare function useUiNavigate(): (to: string) => void;
60
+ /**
61
+ * Whether the reader is on `to`, or on a page below it unless `end`, by the
62
+ * router's `useMatch`; false without one. Keep the same router: one that
63
+ * gains or loses `useMatch` changes the hooks this calls.
64
+ */
65
+ export declare function useUiMatch(to: string, end?: boolean): boolean;
43
66
  /** The app's page-title handler, if it gave `<UiProvider onPageTitle>`. */
44
67
  export declare function useUiPageTitle(): PageTitleHandler | null;
68
+ export declare function useTabTitle(title: ReactNode, tabTitle?: string): void;
45
69
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/provider/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAc,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE1E,4DAA4D;AAC5D,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC/C,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACjC,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAUD,oFAAoF;AACpF,eAAO,MAAM,cAAc,EAAE,QAAiE,CAAC;AAE/F,8EAA8E;AAC9E,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;AAE9D,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,QAAQ,CAAC;IACjB,WAAW,EAAE,gBAAgB,GAAG,IAAI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E,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC;CAClD;AAUD,oFAAoF;AACpF,eAAO,MAAM,cAAc,EAAE,QAAiE,CAAC;AAE/F,8EAA8E;AAC9E,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;AAE9D,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,QAAQ,CAAC;IACjB,WAAW,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACrC,yEAAyE;IACzE,SAAS,EAAE,cAAc,GAAG,IAAI,CAAC;IACjC,qFAAqF;IACrF,WAAW,EAAE,OAAO,CAAC;CACtB;AAID,eAAO,MAAM,WAAW,EAAE,cAOzB,CAAC;AAEF,eAAO,MAAM,SAAS,yCAA6C,CAAC;AAEpE,wEAAwE;AACxE,wBAAgB,YAAY,IAAI,SAAS,CAExC;AAED,4CAA4C;AAC5C,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,cAAc,GAAG,IAAI,CAEtD;AAED,8EAA8E;AAC9E,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAGxC;AAED,mDAAmD;AACnD,wBAAgB,aAAa,IAAI,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,UAAQ,GAAG,OAAO,CAG3D;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,IAAI,gBAAgB,GAAG,IAAI,CAExD;AAUD,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,QAc9D"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { createContext, useContext, } from "react";
2
+ import { createContext, useContext, useEffect, } from "react";
3
3
  import { UI_STRINGS } from "@siiway/ui-core";
4
4
  function AnchorLink({ to, state: _state, ...rest }) {
5
5
  return _jsx("a", { href: to, ...rest });
@@ -9,12 +9,17 @@ function useLocationNavigate() {
9
9
  }
10
10
  /** Plain `<a href>` links and full page loads: for apps without a client router. */
11
11
  export const DEFAULT_ROUTER = { Link: AnchorLink, useNavigate: useLocationNavigate };
12
- export const UiContext = createContext({
12
+ // What components see outside any provider; UiProvider tells it apart from
13
+ // an outer provider's value by identity.
14
+ export const NO_PROVIDER = {
13
15
  scheme: "light",
14
16
  strings: UI_STRINGS.en,
15
17
  router: DEFAULT_ROUTER,
16
18
  onPageTitle: null,
17
- });
19
+ themeMode: null,
20
+ bothSchemes: false,
21
+ };
22
+ export const UiContext = createContext(NO_PROVIDER);
18
23
  /** The library's own strings, in the locale given to `<UiProvider>`. */
19
24
  export function useUiStrings() {
20
25
  return useContext(UiContext).strings;
@@ -23,6 +28,13 @@ export function useUiStrings() {
23
28
  export function useUiScheme() {
24
29
  return useContext(UiContext).scheme;
25
30
  }
31
+ /**
32
+ * The person's light/dark choice that `<UiProvider>` keeps when it has no
33
+ * `scheme`: `{ mode, setMode, scheme }`. Null when the app keeps it itself.
34
+ */
35
+ export function useUiThemeMode() {
36
+ return useContext(UiContext).themeMode;
37
+ }
26
38
  /** A link through the app's router (React Router's `Link`, or `<a href>`). */
27
39
  export function UiLink(props) {
28
40
  const { Link } = useContext(UiContext).router;
@@ -32,8 +44,41 @@ export function UiLink(props) {
32
44
  export function useUiNavigate() {
33
45
  return useContext(UiContext).router.useNavigate();
34
46
  }
47
+ /**
48
+ * Whether the reader is on `to`, or on a page below it unless `end`, by the
49
+ * router's `useMatch`; false without one. Keep the same router: one that
50
+ * gains or loses `useMatch` changes the hooks this calls.
51
+ */
52
+ export function useUiMatch(to, end = false) {
53
+ const { router } = useContext(UiContext);
54
+ return router.useMatch ? router.useMatch(to, end) : false;
55
+ }
35
56
  /** The app's page-title handler, if it gave `<UiProvider onPageTitle>`. */
36
57
  export function useUiPageTitle() {
37
58
  return useContext(UiContext).onPageTitle;
38
59
  }
60
+ // The header each handler last heard from. Only it clears the title, so a
61
+ // page that leaves after the next one came (in a route transition) doesn't
62
+ // clear the next one's.
63
+ const titleOwners = new WeakMap();
64
+ // Names the browser tab after a page header ("Security · Prism"): `tabTitle`,
65
+ // or the title when it's plain text; a rich or empty title (a name still
66
+ // loading, say) leaves the site name.
67
+ export function useTabTitle(title, tabTitle) {
68
+ const onPageTitle = useUiPageTitle();
69
+ const text = tabTitle ?? (typeof title === "string" ? title : null);
70
+ useEffect(() => {
71
+ if (!text || !onPageTitle)
72
+ return;
73
+ const owner = {};
74
+ titleOwners.set(onPageTitle, owner);
75
+ onPageTitle(text);
76
+ return () => {
77
+ if (titleOwners.get(onPageTitle) !== owner)
78
+ return;
79
+ titleOwners.delete(onPageTitle);
80
+ onPageTitle(null);
81
+ };
82
+ }, [text, onPageTitle]);
83
+ }
39
84
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/provider/context.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,UAAU,GAIX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAA+B,MAAM,iBAAiB,CAAC;AAyB1E,SAAS,UAAU,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAe;IAC7D,OAAO,YAAG,IAAI,EAAE,EAAE,KAAM,IAAI,GAAI,CAAC;AACnC,CAAC;AAED,SAAS,mBAAmB;IAC1B,OAAO,CAAC,EAAU,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,oFAAoF;AACpF,MAAM,CAAC,MAAM,cAAc,GAAa,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;AAY/F,MAAM,CAAC,MAAM,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,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC5D,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,cAAc;IAC5B,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC;AAC3C,CAAC;AAED,0EAA0E;AAC1E,2EAA2E;AAC3E,wBAAwB;AACxB,MAAM,WAAW,GAAG,IAAI,OAAO,EAA4B,CAAC;AAE5D,8EAA8E;AAC9E,yEAAyE;AACzE,sCAAsC;AACtC,MAAM,UAAU,WAAW,CAAC,KAAgB,EAAE,QAAiB;IAC7D,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,QAAQ,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACpE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO;QAClC,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QACpC,WAAW,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO,GAAG,EAAE;YACV,IAAI,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,KAAK;gBAAE,OAAO;YACnD,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YAChC,WAAW,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;AAC1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siiway/ui-react",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "SiiWay's Fluent UI v9 theme, provider and components for React.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://ui.siiway.org",
@@ -29,7 +29,7 @@
29
29
  "build": "tsc -b"
30
30
  },
31
31
  "dependencies": {
32
- "@siiway/ui-core": "0.1.0"
32
+ "@siiway/ui-core": "0.2.0"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@fluentui/react-components": "^9.73.0",