@sesionario/blocks 1.38.0 → 1.39.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +49 -0
  2. package/dist/index.cjs +813 -57
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +31 -1
  5. package/dist/index.d.ts +31 -1
  6. package/dist/index.js +812 -58
  7. package/dist/index.js.map +1 -1
  8. package/dist/livo.cjs +8 -0
  9. package/dist/livo.cjs.map +1 -1
  10. package/dist/livo.js +8 -0
  11. package/dist/livo.js.map +1 -1
  12. package/dist/navigation-progress.cjs +140 -0
  13. package/dist/navigation-progress.cjs.map +1 -0
  14. package/dist/navigation-progress.d.cts +19 -0
  15. package/dist/navigation-progress.d.ts +19 -0
  16. package/dist/navigation-progress.js +138 -0
  17. package/dist/navigation-progress.js.map +1 -0
  18. package/dist/office.cjs +310 -0
  19. package/dist/office.cjs.map +1 -0
  20. package/dist/office.d.cts +53 -0
  21. package/dist/office.d.ts +53 -0
  22. package/dist/office.js +282 -0
  23. package/dist/office.js.map +1 -0
  24. package/dist/route-loading.cjs +12 -0
  25. package/dist/route-loading.cjs.map +1 -0
  26. package/dist/route-loading.d.cts +9 -0
  27. package/dist/route-loading.d.ts +9 -0
  28. package/dist/route-loading.js +10 -0
  29. package/dist/route-loading.js.map +1 -0
  30. package/dist/sidebar-dismiss.cjs +44 -0
  31. package/dist/sidebar-dismiss.cjs.map +1 -0
  32. package/dist/sidebar-dismiss.d.cts +13 -0
  33. package/dist/sidebar-dismiss.d.ts +13 -0
  34. package/dist/sidebar-dismiss.js +41 -0
  35. package/dist/sidebar-dismiss.js.map +1 -0
  36. package/dist/theme.cjs +26 -0
  37. package/dist/theme.cjs.map +1 -0
  38. package/dist/theme.d.cts +19 -0
  39. package/dist/theme.d.ts +19 -0
  40. package/dist/theme.js +20 -0
  41. package/dist/theme.js.map +1 -0
  42. package/package.json +55 -5
package/README.md CHANGED
@@ -95,6 +95,55 @@ the server-safe subpath:
95
95
  import { avatarFallbackStyle, getInitials } from "@sesionario/blocks/avatar";
96
96
  ```
97
97
 
98
+ Theme boot for server layouts is also server-safe. Do not import it from the
99
+ main entry:
100
+
101
+ ```tsx
102
+ import {
103
+ THEME_STORAGE_KEY,
104
+ htmlThemeClass,
105
+ themeBootScript,
106
+ themeColorSchemeCss,
107
+ } from "@sesionario/blocks/theme";
108
+ ```
109
+
110
+ The top progress bar is a separate client subpath so `loading.tsx` does not
111
+ pull the main barrel. It does not import Next.js: pass `pathname` and
112
+ `search`, and wrap `useSearchParams` in `<Suspense>`. Keyframes are inlined
113
+ on the bar.
114
+
115
+ ```tsx
116
+ import { NavigationProgress } from "@sesionario/blocks/navigation-progress";
117
+ import { RouteLoading } from "@sesionario/blocks/route-loading";
118
+ ```
119
+
120
+ `RouteLoading` is server-safe. It marks a route shell with `data-route-loading`
121
+ so the bar stays up until that shell unmounts.
122
+
123
+ Mobile sheet sidebars should close only when the user activates a navigation
124
+ link. Buttons (section toggles, account menus, org switchers) stay open.
125
+ Call the hook while the sheet is open; it listens on `document` so links
126
+ inside portaled menus count, and it closes after the click so navigation
127
+ can start first.
128
+
129
+ ```tsx
130
+ import { useDismissSidebarOnLink } from "@sesionario/blocks/sidebar-dismiss";
131
+
132
+ useDismissSidebarOnLink(isMobile && openMobile, () => setOpenMobile(false));
133
+ ```
134
+
135
+ Scroll restoration lives on the main client entry. Pass a route key from the
136
+ app (`pathname` + search). Fresh navigations start at the top; back and
137
+ forward restore the offset of the port that actually moved (the window, or
138
+ a nested overflow pane registered with `useRegisterScrollContainer`).
139
+
140
+ ```tsx
141
+ import {
142
+ ScrollRestorationProvider,
143
+ useRegisterScrollContainer,
144
+ } from "@sesionario/blocks";
145
+ ```
146
+
98
147
  Peer dependencies (install in the consuming app as needed):
99
148
 
100
149
  - `react`, `react-dom`