@womp/kookie-ui 0.36.0 → 0.37.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 (264) hide show
  1. package/components.css +0 -20
  2. package/dist/cjs/components/_internal/base-menu.utils.js +1 -1
  3. package/dist/cjs/components/_internal/base-menu.utils.js.map +2 -2
  4. package/dist/cjs/components/_internal/menu-context.js +1 -1
  5. package/dist/cjs/components/_internal/menu-context.js.map +2 -2
  6. package/dist/cjs/components/_internal/pane-chrome.js +1 -1
  7. package/dist/cjs/components/_internal/pane-chrome.js.map +2 -2
  8. package/dist/cjs/components/_internal/shell-bottom.d.ts +3 -3
  9. package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -1
  10. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  11. package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
  12. package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -1
  13. package/dist/cjs/components/_internal/shell-handles.js +1 -1
  14. package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
  15. package/dist/cjs/components/_internal/shell-inspector.d.ts +3 -3
  16. package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
  17. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  18. package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
  19. package/dist/cjs/components/_internal/shell-pane.d.ts +2 -7
  20. package/dist/cjs/components/_internal/shell-pane.d.ts.map +1 -1
  21. package/dist/cjs/components/_internal/shell-pane.js +1 -1
  22. package/dist/cjs/components/_internal/shell-pane.js.map +3 -3
  23. package/dist/cjs/components/_internal/shell-resizable.d.ts +3 -9
  24. package/dist/cjs/components/_internal/shell-resizable.d.ts.map +1 -1
  25. package/dist/cjs/components/_internal/shell-resizable.js +1 -1
  26. package/dist/cjs/components/_internal/shell-resizable.js.map +3 -3
  27. package/dist/cjs/components/_internal/shell-resize.d.ts +0 -4
  28. package/dist/cjs/components/_internal/shell-resize.d.ts.map +1 -1
  29. package/dist/cjs/components/_internal/shell-resize.js +1 -1
  30. package/dist/cjs/components/_internal/shell-resize.js.map +2 -2
  31. package/dist/cjs/components/_internal/shell-rest.d.ts +1 -6
  32. package/dist/cjs/components/_internal/shell-rest.d.ts.map +1 -1
  33. package/dist/cjs/components/_internal/shell-rest.js +1 -1
  34. package/dist/cjs/components/_internal/shell-rest.js.map +3 -3
  35. package/dist/cjs/components/_internal/shell-sidebar.d.ts +3 -3
  36. package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
  37. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  38. package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
  39. package/dist/cjs/components/_internal/shell-store.d.ts +0 -10
  40. package/dist/cjs/components/_internal/shell-store.d.ts.map +1 -1
  41. package/dist/cjs/components/_internal/shell-store.js +1 -1
  42. package/dist/cjs/components/_internal/shell-store.js.map +3 -3
  43. package/dist/cjs/components/checkbox-group.js +1 -1
  44. package/dist/cjs/components/checkbox-group.js.map +3 -3
  45. package/dist/cjs/components/checkbox-group.primitive.d.ts +0 -10
  46. package/dist/cjs/components/checkbox-group.primitive.d.ts.map +1 -1
  47. package/dist/cjs/components/checkbox-group.primitive.js +1 -1
  48. package/dist/cjs/components/checkbox-group.primitive.js.map +3 -3
  49. package/dist/cjs/components/context-menu.d.ts +1 -5
  50. package/dist/cjs/components/context-menu.d.ts.map +1 -1
  51. package/dist/cjs/components/context-menu.js +1 -1
  52. package/dist/cjs/components/context-menu.js.map +3 -3
  53. package/dist/cjs/components/dropdown-menu.js +1 -1
  54. package/dist/cjs/components/dropdown-menu.js.map +2 -2
  55. package/dist/cjs/components/index.js +2 -2
  56. package/dist/cjs/components/index.js.map +4 -4
  57. package/dist/cjs/components/navigator.js.map +2 -2
  58. package/dist/cjs/components/schemas/index.d.ts +1 -1
  59. package/dist/cjs/components/schemas/index.d.ts.map +1 -1
  60. package/dist/cjs/components/schemas/index.js +1 -1
  61. package/dist/cjs/components/schemas/index.js.map +3 -3
  62. package/dist/cjs/components/schemas/shell.schema.d.ts +6 -112
  63. package/dist/cjs/components/schemas/shell.schema.d.ts.map +1 -1
  64. package/dist/cjs/components/schemas/shell.schema.js +1 -1
  65. package/dist/cjs/components/schemas/shell.schema.js.map +3 -3
  66. package/dist/cjs/components/separator.js +1 -1
  67. package/dist/cjs/components/separator.js.map +2 -2
  68. package/dist/cjs/components/shell.context.d.ts +1 -45
  69. package/dist/cjs/components/shell.context.d.ts.map +1 -1
  70. package/dist/cjs/components/shell.context.js +1 -1
  71. package/dist/cjs/components/shell.context.js.map +4 -4
  72. package/dist/cjs/components/shell.d.ts +7 -37
  73. package/dist/cjs/components/shell.d.ts.map +1 -1
  74. package/dist/cjs/components/shell.js +1 -1
  75. package/dist/cjs/components/shell.js.map +4 -4
  76. package/dist/cjs/components/shell.types.d.ts +6 -27
  77. package/dist/cjs/components/shell.types.d.ts.map +1 -1
  78. package/dist/cjs/components/shell.types.js +1 -1
  79. package/dist/cjs/components/shell.types.js.map +2 -2
  80. package/dist/cjs/components/sidebar.js +1 -1
  81. package/dist/cjs/components/sidebar.js.map +2 -2
  82. package/dist/cjs/components/toolbar.js +1 -1
  83. package/dist/cjs/components/toolbar.js.map +2 -2
  84. package/dist/cjs/hooks/use-breakpoint.js +1 -1
  85. package/dist/cjs/hooks/use-breakpoint.js.map +2 -2
  86. package/dist/cjs/index.js +4 -4
  87. package/dist/cjs/index.js.map +4 -4
  88. package/dist/esm/{chunk-5RLGDXOM.js → chunk-2K46JPUL.js} +2 -2
  89. package/dist/esm/chunk-3K7E4XL3.js +3 -0
  90. package/dist/esm/chunk-3K7E4XL3.js.map +7 -0
  91. package/dist/esm/chunk-3LR7KMBE.js +3 -0
  92. package/dist/esm/chunk-3LR7KMBE.js.map +7 -0
  93. package/dist/esm/chunk-5U2LEJLU.js +3 -0
  94. package/dist/esm/chunk-5U2LEJLU.js.map +7 -0
  95. package/dist/esm/{chunk-IN6D33TU.js → chunk-5XO3PLDH.js} +2 -2
  96. package/dist/esm/{chunk-COLJWVN7.js → chunk-AQR42GKA.js} +2 -2
  97. package/dist/esm/{chunk-FTNZWAPB.js → chunk-ARPUPT4M.js} +2 -2
  98. package/dist/esm/{chunk-ISCZ57VL.js → chunk-DJGZ4K3V.js} +2 -2
  99. package/dist/esm/{chunk-PMXIQ5B4.js → chunk-FKCKELUB.js} +2 -2
  100. package/dist/esm/chunk-H7GH3DTF.js +3 -0
  101. package/dist/esm/chunk-H7GH3DTF.js.map +7 -0
  102. package/dist/esm/{chunk-E6MOZSYV.js → chunk-HNOT2HS4.js} +2 -2
  103. package/dist/esm/chunk-LBAC2X4U.js +3 -0
  104. package/dist/esm/{chunk-5BXCPANF.js.map → chunk-LBAC2X4U.js.map} +3 -3
  105. package/dist/esm/{chunk-MAA6LEE2.js → chunk-MDQ7ZHOS.js} +1 -1
  106. package/dist/esm/chunk-MDQ7ZHOS.js.map +7 -0
  107. package/dist/esm/chunk-MQA3BKF4.js +3 -0
  108. package/dist/esm/chunk-MQA3BKF4.js.map +7 -0
  109. package/dist/esm/chunk-MXNPCJPV.js +3 -0
  110. package/dist/esm/chunk-MXNPCJPV.js.map +7 -0
  111. package/dist/esm/{chunk-EB4AG3OL.js → chunk-REELD6CT.js} +2 -2
  112. package/dist/esm/chunk-RYXIRZQW.js +3 -0
  113. package/dist/esm/chunk-RYXIRZQW.js.map +7 -0
  114. package/dist/esm/chunk-S66WR5R7.js +3 -0
  115. package/dist/esm/{chunk-MXEOE4LA.js.map → chunk-S66WR5R7.js.map} +2 -2
  116. package/dist/esm/chunk-SECVO3CW.js +3 -0
  117. package/dist/esm/chunk-SECVO3CW.js.map +7 -0
  118. package/dist/esm/chunk-SHDZYFUN.js +3 -0
  119. package/dist/esm/chunk-SHDZYFUN.js.map +7 -0
  120. package/dist/esm/{chunk-3M5ZM67R.js → chunk-TCFBNE6A.js} +2 -2
  121. package/dist/esm/chunk-U7P64MXD.js +3 -0
  122. package/dist/esm/chunk-U7P64MXD.js.map +7 -0
  123. package/dist/esm/chunk-UFYQC5XY.js +3 -0
  124. package/dist/esm/chunk-UFYQC5XY.js.map +7 -0
  125. package/dist/esm/{chunk-G66WDIIV.js → chunk-WJKCXGVN.js} +2 -2
  126. package/dist/esm/chunk-XBDAE77C.js +3 -0
  127. package/dist/esm/chunk-XBDAE77C.js.map +7 -0
  128. package/dist/esm/{chunk-SIYOLE6P.js → chunk-YM47BXKK.js} +2 -2
  129. package/dist/esm/components/_internal/base-menu.utils.js +1 -1
  130. package/dist/esm/components/_internal/menu-context.js +1 -1
  131. package/dist/esm/components/_internal/pane-chrome.js +1 -1
  132. package/dist/esm/components/_internal/shell-bottom.d.ts +3 -3
  133. package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -1
  134. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  135. package/dist/esm/components/_internal/shell-handles.d.ts.map +1 -1
  136. package/dist/esm/components/_internal/shell-handles.js +1 -1
  137. package/dist/esm/components/_internal/shell-inspector.d.ts +3 -3
  138. package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
  139. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  140. package/dist/esm/components/_internal/shell-pane.d.ts +2 -7
  141. package/dist/esm/components/_internal/shell-pane.d.ts.map +1 -1
  142. package/dist/esm/components/_internal/shell-pane.js +1 -1
  143. package/dist/esm/components/_internal/shell-resizable.d.ts +3 -9
  144. package/dist/esm/components/_internal/shell-resizable.d.ts.map +1 -1
  145. package/dist/esm/components/_internal/shell-resizable.js +1 -1
  146. package/dist/esm/components/_internal/shell-resize.d.ts +0 -4
  147. package/dist/esm/components/_internal/shell-resize.d.ts.map +1 -1
  148. package/dist/esm/components/_internal/shell-resize.js +1 -1
  149. package/dist/esm/components/_internal/shell-rest.d.ts +1 -6
  150. package/dist/esm/components/_internal/shell-rest.d.ts.map +1 -1
  151. package/dist/esm/components/_internal/shell-rest.js +1 -1
  152. package/dist/esm/components/_internal/shell-sidebar.d.ts +3 -3
  153. package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
  154. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  155. package/dist/esm/components/_internal/shell-store.d.ts +0 -10
  156. package/dist/esm/components/_internal/shell-store.d.ts.map +1 -1
  157. package/dist/esm/components/_internal/shell-store.js +1 -1
  158. package/dist/esm/components/checkbox-group.js +1 -1
  159. package/dist/esm/components/checkbox-group.primitive.d.ts +0 -10
  160. package/dist/esm/components/checkbox-group.primitive.d.ts.map +1 -1
  161. package/dist/esm/components/checkbox-group.primitive.js +1 -1
  162. package/dist/esm/components/context-menu.d.ts +1 -5
  163. package/dist/esm/components/context-menu.d.ts.map +1 -1
  164. package/dist/esm/components/context-menu.js +1 -1
  165. package/dist/esm/components/dropdown-menu.js +1 -1
  166. package/dist/esm/components/index.js +1 -1
  167. package/dist/esm/components/navigator.js +1 -1
  168. package/dist/esm/components/schemas/index.d.ts +1 -1
  169. package/dist/esm/components/schemas/index.d.ts.map +1 -1
  170. package/dist/esm/components/schemas/index.js +1 -1
  171. package/dist/esm/components/schemas/index.js.map +2 -2
  172. package/dist/esm/components/schemas/shell.schema.d.ts +6 -112
  173. package/dist/esm/components/schemas/shell.schema.d.ts.map +1 -1
  174. package/dist/esm/components/schemas/shell.schema.js +1 -1
  175. package/dist/esm/components/separator.js +1 -1
  176. package/dist/esm/components/shell.context.d.ts +1 -45
  177. package/dist/esm/components/shell.context.d.ts.map +1 -1
  178. package/dist/esm/components/shell.context.js +1 -1
  179. package/dist/esm/components/shell.d.ts +7 -37
  180. package/dist/esm/components/shell.d.ts.map +1 -1
  181. package/dist/esm/components/shell.js +1 -1
  182. package/dist/esm/components/shell.types.d.ts +6 -27
  183. package/dist/esm/components/shell.types.d.ts.map +1 -1
  184. package/dist/esm/components/shell.types.js +1 -1
  185. package/dist/esm/components/sidebar.js +1 -1
  186. package/dist/esm/components/toolbar.js +1 -1
  187. package/dist/esm/components/virtual-menu.js +1 -1
  188. package/dist/esm/hooks/use-breakpoint.js +1 -1
  189. package/dist/esm/index.js +1 -1
  190. package/package.json +1 -1
  191. package/schemas/index.json +13 -335
  192. package/schemas/shell-bottom.json +2 -63
  193. package/schemas/shell-inspector.json +2 -63
  194. package/schemas/shell-panel.json +2 -63
  195. package/schemas/shell-rail.json +2 -38
  196. package/schemas/shell-sidebar.json +5 -102
  197. package/schemas/shell-trigger.json +0 -6
  198. package/src/components/_internal/shell-bottom.tsx +6 -26
  199. package/src/components/_internal/shell-handles.tsx +2 -32
  200. package/src/components/_internal/shell-inspector.tsx +6 -26
  201. package/src/components/_internal/shell-pane.tsx +7 -56
  202. package/src/components/_internal/shell-resizable.tsx +6 -81
  203. package/src/components/_internal/shell-resize.tsx +0 -4
  204. package/src/components/_internal/shell-rest.ts +2 -11
  205. package/src/components/_internal/shell-sidebar.tsx +8 -30
  206. package/src/components/_internal/shell-store.tsx +1 -34
  207. package/src/components/checkbox-group.primitive.tsx +0 -12
  208. package/src/components/context-menu.tsx +1 -6
  209. package/src/components/schemas/index.ts +0 -1
  210. package/src/components/schemas/shell.schema.ts +3 -20
  211. package/src/components/shell.context.tsx +5 -112
  212. package/src/components/shell.css +1 -29
  213. package/src/components/shell.tsx +12 -97
  214. package/src/components/shell.types.ts +6 -28
  215. package/styles.css +0 -20
  216. package/dist/cjs/components/shell.hooks.d.ts +0 -10
  217. package/dist/cjs/components/shell.hooks.d.ts.map +0 -1
  218. package/dist/cjs/components/shell.hooks.js +0 -3
  219. package/dist/cjs/components/shell.hooks.js.map +0 -7
  220. package/dist/esm/chunk-2VSRZ4IT.js +0 -3
  221. package/dist/esm/chunk-2VSRZ4IT.js.map +0 -7
  222. package/dist/esm/chunk-2WFN4D52.js +0 -3
  223. package/dist/esm/chunk-2WFN4D52.js.map +0 -7
  224. package/dist/esm/chunk-4OJRLS5N.js +0 -3
  225. package/dist/esm/chunk-4OJRLS5N.js.map +0 -7
  226. package/dist/esm/chunk-4TTRPCGG.js +0 -3
  227. package/dist/esm/chunk-4TTRPCGG.js.map +0 -7
  228. package/dist/esm/chunk-5BXCPANF.js +0 -3
  229. package/dist/esm/chunk-B447PNRD.js +0 -3
  230. package/dist/esm/chunk-B447PNRD.js.map +0 -7
  231. package/dist/esm/chunk-BJVXB3PN.js +0 -3
  232. package/dist/esm/chunk-BJVXB3PN.js.map +0 -7
  233. package/dist/esm/chunk-DNY4WWZF.js +0 -3
  234. package/dist/esm/chunk-DNY4WWZF.js.map +0 -7
  235. package/dist/esm/chunk-HQT32HQ6.js +0 -3
  236. package/dist/esm/chunk-HQT32HQ6.js.map +0 -7
  237. package/dist/esm/chunk-KGCGT4MJ.js +0 -3
  238. package/dist/esm/chunk-KGCGT4MJ.js.map +0 -7
  239. package/dist/esm/chunk-M26LLCQC.js +0 -3
  240. package/dist/esm/chunk-M26LLCQC.js.map +0 -7
  241. package/dist/esm/chunk-MAA6LEE2.js.map +0 -7
  242. package/dist/esm/chunk-MXEOE4LA.js +0 -3
  243. package/dist/esm/chunk-TS4QCDSI.js +0 -3
  244. package/dist/esm/chunk-TS4QCDSI.js.map +0 -7
  245. package/dist/esm/chunk-XOAOSRTH.js +0 -3
  246. package/dist/esm/chunk-XOAOSRTH.js.map +0 -7
  247. package/dist/esm/chunk-XUCR7L4G.js +0 -3
  248. package/dist/esm/chunk-XUCR7L4G.js.map +0 -7
  249. package/dist/esm/components/shell.hooks.d.ts +0 -10
  250. package/dist/esm/components/shell.hooks.d.ts.map +0 -1
  251. package/dist/esm/components/shell.hooks.js +0 -3
  252. package/dist/esm/components/shell.hooks.js.map +0 -7
  253. package/src/components/shell.hooks.ts +0 -20
  254. /package/dist/esm/{chunk-5RLGDXOM.js.map → chunk-2K46JPUL.js.map} +0 -0
  255. /package/dist/esm/{chunk-IN6D33TU.js.map → chunk-5XO3PLDH.js.map} +0 -0
  256. /package/dist/esm/{chunk-COLJWVN7.js.map → chunk-AQR42GKA.js.map} +0 -0
  257. /package/dist/esm/{chunk-FTNZWAPB.js.map → chunk-ARPUPT4M.js.map} +0 -0
  258. /package/dist/esm/{chunk-ISCZ57VL.js.map → chunk-DJGZ4K3V.js.map} +0 -0
  259. /package/dist/esm/{chunk-PMXIQ5B4.js.map → chunk-FKCKELUB.js.map} +0 -0
  260. /package/dist/esm/{chunk-E6MOZSYV.js.map → chunk-HNOT2HS4.js.map} +0 -0
  261. /package/dist/esm/{chunk-EB4AG3OL.js.map → chunk-REELD6CT.js.map} +0 -0
  262. /package/dist/esm/{chunk-3M5ZM67R.js.map → chunk-TCFBNE6A.js.map} +0 -0
  263. /package/dist/esm/{chunk-G66WDIIV.js.map → chunk-WJKCXGVN.js.map} +0 -0
  264. /package/dist/esm/{chunk-SIYOLE6P.js.map → chunk-YM47BXKK.js.map} +0 -0
@@ -1,34 +1,18 @@
1
1
  'use client';
2
2
 
3
3
  /**
4
- * Since 0.8.0 the Shell has two contexts: the pane registry (the store) and
5
- * the set of panes off the frame. They live in `_internal/shell-store.tsx`. This module keeps
6
- * the two hooks consumers can reach: `useSidebarMode`, and the deprecated
7
- * `useShell`.
4
+ * The Shell has two contexts: the pane registry (the store) and the set of panes off the frame.
5
+ * They live in `_internal/shell-store.tsx`. This module keeps the hook consumers can reach:
6
+ * `useSidebarMode`.
8
7
  */
9
8
  import * as React from 'react';
10
- import { useBreakpoint } from '../hooks/use-breakpoint.js';
11
- import type { Breakpoint, PaneMode, PaneName, PaneTarget, PresentationValue, SidebarMode } from './shell.types.js';
12
- import { setShellPeek, subscribeShellStore, useShellStore, warnOnce, type PaneValue, type ShellStore } from './_internal/shell-store.js';
9
+ import type { SidebarMode } from './shell.types.js';
10
+ import { subscribeShellStore, useShellStore, type PaneValue } from './_internal/shell-store.js';
13
11
 
14
12
  const toSidebarMode = (value: PaneValue | undefined): SidebarMode | undefined => (value === undefined ? undefined : value === 'closed' ? 'collapsed' : 'expanded');
15
13
 
16
14
  const fromSidebarMode = (mode: SidebarMode): PaneValue => (mode === 'collapsed' ? 'closed' : 'open');
17
15
 
18
- const toPaneMode = (value: PaneValue | undefined): PaneMode => (value === undefined || value === 'closed' ? 'collapsed' : 'expanded');
19
-
20
- const paneName = (target: PaneTarget): PaneName => (target === 'left' ? 'rail' : target);
21
-
22
- /** Re-renders on every change to the registry. For the deprecated whole-shell reader only. */
23
- function useStoreVersion(store: ShellStore) {
24
- const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);
25
- return React.useSyncExternalStore(
26
- subscribe,
27
- () => store.version,
28
- () => 0,
29
- );
30
- }
31
-
32
16
  /**
33
17
  * The Sidebar's mode, and a setter. The setter is a user action: it reports
34
18
  * through the Sidebar's `onStateChange` the way a Trigger does.
@@ -49,94 +33,3 @@ export function useSidebarMode(): { sidebarMode: SidebarMode; setSidebarMode: (m
49
33
  );
50
34
  return { sidebarMode: toSidebarMode(value) ?? 'expanded', setSidebarMode };
51
35
  }
52
-
53
- export interface ShellContextValue {
54
- leftMode: PaneMode;
55
- setLeftMode: (mode: PaneMode) => void;
56
- /** The Rail's open state, resolved, when it is controlled. */
57
- leftControlledOpen?: boolean;
58
- panelMode: PaneMode;
59
- setPanelMode: (mode: PaneMode) => void;
60
- sidebarMode: SidebarMode;
61
- setSidebarMode: (mode: SidebarMode) => void;
62
- inspectorMode: PaneMode;
63
- setInspectorMode: (mode: PaneMode) => void;
64
- bottomMode: PaneMode;
65
- setBottomMode: (mode: PaneMode) => void;
66
- peekTarget: PaneTarget | null;
67
- setPeekTarget: (target: PaneTarget | null) => void;
68
- peekPane: (target: PaneTarget) => void;
69
- clearPeek: () => void;
70
- /** Whether a Rail is mounted. */
71
- hasLeft: boolean;
72
- /** No effect since 0.8.0: the registry knows which panes are mounted. */
73
- setHasLeft: (has: boolean) => void;
74
- /** Whether a Sidebar is mounted. */
75
- hasSidebar: boolean;
76
- /** No effect since 0.8.0: the registry knows which panes are mounted. */
77
- setHasSidebar: (has: boolean) => void;
78
- currentBreakpoint: Breakpoint;
79
- currentBreakpointReady: boolean;
80
- /** The Rail's presentation at the current breakpoint, when known. */
81
- leftResolvedPresentation?: PresentationValue;
82
- togglePane: (target: PaneTarget) => void;
83
- expandPane: (target: PaneTarget) => void;
84
- collapsePane: (target: PaneTarget) => void;
85
- }
86
-
87
- const noop = () => {};
88
-
89
- /**
90
- * @deprecated The whole-shell reader re-renders its consumer on every change
91
- * to any pane. Use `Shell.Trigger` to drive a pane, `Shell.useSidebarMode`
92
- * for the Sidebar, and each pane's `open`/`onOpenChange` for its state.
93
- * Removed in 1.0.
94
- *
95
- * Keeps 0.7's shape. The setters act as a user would: they report through
96
- * the pane's own callback with `reason: 'toggle'`, and a controlled pane
97
- * changes only when the app passes the new value.
98
- */
99
- export function useShell(): ShellContextValue {
100
- const store = useShellStore('useShell');
101
- React.useEffect(() => {
102
- warnOnce("Shell.useShell is deprecated and is removed in 1.0. Use Shell.Trigger, Shell.useSidebarMode, or a pane's own open/onOpenChange.");
103
- }, []);
104
- useStoreVersion(store);
105
- const { breakpoint, ready } = useBreakpoint();
106
- const actions = React.useMemo(() => {
107
- const setMode = (name: PaneName) => (mode: PaneMode) => store.entries.get(name)?.setValue(mode === 'collapsed' ? 'closed' : 'open', 'toggle');
108
- const setPeekTarget = (target: PaneTarget | null) => setShellPeek(store, target === null ? null : paneName(target));
109
- return {
110
- setLeftMode: setMode('rail'),
111
- setPanelMode: setMode('panel'),
112
- setInspectorMode: setMode('inspector'),
113
- setBottomMode: setMode('bottom'),
114
- setSidebarMode: (mode: SidebarMode) => store.entries.get('sidebar')?.setValue(fromSidebarMode(mode), 'toggle'),
115
- setPeekTarget,
116
- peekPane: (target: PaneTarget) => setPeekTarget(target),
117
- clearPeek: () => setPeekTarget(null),
118
- setHasLeft: noop,
119
- setHasSidebar: noop,
120
- togglePane: (target: PaneTarget) => store.entries.get(paneName(target))?.toggle('toggle'),
121
- expandPane: (target: PaneTarget) => store.entries.get(paneName(target))?.setValue('open', 'toggle'),
122
- collapsePane: (target: PaneTarget) => store.entries.get(paneName(target))?.setValue('closed', 'toggle'),
123
- };
124
- }, [store]);
125
- const value = (name: PaneName) => store.entries.get(name)?.value;
126
- const rail = store.entries.get('rail');
127
- return {
128
- leftMode: toPaneMode(value('rail')),
129
- leftControlledOpen: rail?.value === undefined ? undefined : rail.value !== 'closed',
130
- panelMode: toPaneMode(value('panel')),
131
- sidebarMode: toSidebarMode(value('sidebar')) ?? 'expanded',
132
- inspectorMode: toPaneMode(value('inspector')),
133
- bottomMode: toPaneMode(value('bottom')),
134
- peekTarget: store.peek,
135
- hasLeft: store.entries.has('rail'),
136
- hasSidebar: store.entries.has('sidebar'),
137
- currentBreakpoint: breakpoint,
138
- currentBreakpointReady: ready,
139
- leftResolvedPresentation: rail?.presentation,
140
- ...actions,
141
- };
142
- }
@@ -885,34 +885,6 @@
885
885
  }
886
886
  }
887
887
 
888
- /* ── Peek ──────────────────────────────────────────────────────────────────── */
889
-
890
- /*
891
- * A Trigger with `peekOnHover` previews a closed pane while the pointer is on
892
- * it. The pane shows, floating above the content at its edge. After every
893
- * breakpoint block, so it wins over a closed state at any width.
894
- */
895
- .kui-ShellPane[data-peek][data-state],
896
- .kui-ShellRail ~ .kui-ShellPanel[data-presentation-follows][data-peek][data-state] {
897
- --kui-shell-position: absolute;
898
- --kui-shell-z: 4;
899
- --kui-shell-pin: fixed;
900
- --kui-shell-pin-top: initial;
901
- --kui-shell-row: 2 / 3;
902
- --kui-shell-col: 1 / -1;
903
- --kui-shell-surface: var(--color-surface);
904
- --kui-shell-shadow: var(--surface-chrome);
905
- --kui-shell-edge: 1px;
906
- --kui-shell-offset: var(--shell-rail-offset, 0px);
907
- --kui-shell-handle: none;
908
-
909
- display: flex;
910
- }
911
-
912
- .kui-ShellSidebar[data-peek][data-state] {
913
- inline-size: var(--peek-sidebar-width, var(--sidebar-size, var(--sidebar-expanded-size, 288px)));
914
- }
915
-
916
888
  /* ── Scrim ─────────────────────────────────────────────────────────────────── */
917
889
 
918
890
  /* Root-owned and always mounted; shown while an overlay is live. Under the overlay panes, over everything else. */
@@ -1207,7 +1179,7 @@
1207
1179
  }
1208
1180
 
1209
1181
  /*
1210
- * The panes. A pane over the page (overlay, stacked, peek) attaches to the screen: its posture
1182
+ * The panes. A pane over the page (overlay, stacked) attaches to the screen: its posture
1211
1183
  * writes `--kui-shell-pin: fixed`. A pane in flow sticks beneath the header, a screen tall, and
1212
1184
  * the bottom pane sticks to the screen's bottom. An overlay covers the header
1213
1185
  * (`--kui-shell-pin-top: 0px`); the rest start beneath it.
@@ -39,17 +39,14 @@ import {
39
39
  ShellFrameContext,
40
40
  ShellStoreContext,
41
41
  createShellStore,
42
- setShellPeek,
43
42
  subscribeShellStore,
44
43
  useFrameRegistration,
45
44
  usePaneEntry,
46
45
  useShellStore,
47
- warnOnce,
48
46
  type FramePaneId,
49
47
  } from './_internal/shell-store.js';
50
- import { navigationRest, detailRest, toPaneValue, startAnchoredGrowth, withoutRemovedPaneProps } from './_internal/shell-rest.js';
51
- import { useShell, useSidebarMode } from './shell.context.js';
52
- import { useResponsivePresentation } from './shell.hooks.js';
48
+ import { navigationRest, detailRest, toPaneValue, startAnchoredGrowth } from './_internal/shell-rest.js';
49
+ import { useSidebarMode } from './shell.context.js';
53
50
  import { readBreakpoint } from '../hooks/use-breakpoint.js';
54
51
  import { useThemeSize } from '../hooks/theme-size.js';
55
52
  import { PageScope } from './_internal/page-scope.js';
@@ -57,7 +54,7 @@ import { PaneChromeScope, PaneFooter, PaneHeader, Scroll, ShellContentContext, S
57
54
  import { onPageScrollMediaChange, pageScrollMatches } from './_internal/shell-page-scroll.js';
58
55
  import type { PaneSize, PaneHeaderProps, PaneFooterProps, ScrollProps } from './_internal/pane-chrome.js';
59
56
  import { PaneBandSizeContext } from './_internal/pane-band-context.js';
60
- import type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps, PaneMode, PaneName, PaneTarget, ResponsivePresentation, SidebarMode } from './shell.types.js';
57
+ import type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps, PaneMode, PaneName, PaneOpenChangeReason, PaneTarget, ResponsivePresentation, SidebarMode } from './shell.types.js';
61
58
 
62
59
  /* ── Root ──────────────────────────────────────────────────────────────────── */
63
60
 
@@ -536,46 +533,17 @@ const Header = React.forwardRef<HTMLElement, ShellHeaderProps>(({ className, hei
536
533
  });
537
534
  Header.displayName = 'Shell.Header';
538
535
 
539
- /* ── Left (deprecated) ─────────────────────────────────────────────────────── */
540
-
541
- interface LeftProps extends React.ComponentPropsWithoutRef<'div'> {
542
- presentation?: ResponsivePresentation;
543
- open?: boolean;
544
- defaultOpen?: boolean;
545
- onOpenChange?: (open: boolean, meta: { reason: 'init' | 'toggle' | 'panel' | 'responsive' | 'dismiss' }) => void;
546
- collapsible?: boolean;
547
- onExpand?: () => void;
548
- onCollapse?: () => void;
549
- }
550
-
551
- /**
552
- * @deprecated The Root no longer wraps the Rail and Panel in a Left
553
- * container: each is its own pane. `Shell.Left` renders its children and
554
- * ignores its own props. Removed in 1.0.
555
- */
556
- const Left = React.forwardRef<HTMLDivElement, LeftProps>(({ children }, _ref) => {
557
- React.useEffect(() => {
558
- warnOnce('Shell.Left is deprecated and is removed in 1.0. Render Shell.Rail and Shell.Panel directly in Shell.Root.');
559
- }, []);
560
- return <>{children}</>;
561
- });
562
- Left.displayName = 'Shell.Left';
563
-
564
536
  /* ── Rail ──────────────────────────────────────────────────────────────────── */
565
537
 
566
- type RailOpenChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'panel' | 'dismiss' };
538
+ type RailOpenChangeMeta = { reason: PaneOpenChangeReason };
567
539
 
568
- type RailControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: RailOpenChangeMeta) => void; defaultOpen?: never };
540
+ type RailControlledProps = { open: boolean; onOpenChange?: (open: boolean, meta: RailOpenChangeMeta) => void; defaultOpen?: never };
569
541
  type RailUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: RailOpenChangeMeta) => void; open?: never };
570
542
 
571
543
  type RailProps = React.ComponentPropsWithoutRef<'div'> & {
572
544
  presentation?: ResponsivePresentation;
573
545
  expandedSize?: number;
574
546
  collapsible?: boolean;
575
- /** @deprecated Use `onOpenChange`. */
576
- onExpand?: () => void;
577
- /** @deprecated Use `onOpenChange`. */
578
- onCollapse?: () => void;
579
547
  /**
580
548
  * Sets whether this pane joins the app frame. The default is `true`: the pane sits against its
581
549
  * neighbours with one hairline between them. Set `flush={false}` to pull it off the frame as a
@@ -588,7 +556,7 @@ type RailProps = React.ComponentPropsWithoutRef<'div'> & {
588
556
  const RAIL_PROP_NAMES = { controlled: 'open', default: 'defaultOpen' };
589
557
 
590
558
  const Rail = React.forwardRef<HTMLDivElement, RailProps>((props, ref) => {
591
- const { className, presentation, expandedSize = 64, collapsible: _collapsible, onExpand, onCollapse, children, style, open, defaultOpen, onOpenChange, flush = true, id, ...domProps } = props;
559
+ const { className, presentation, expandedSize = 64, collapsible: _collapsible, children, style, open, defaultOpen, onOpenChange, flush = true, id, ...domProps } = props;
592
560
  const { table, attributes } = usePresentationTable(presentation, 'fixed');
593
561
  const pane = usePane({
594
562
  name: 'rail',
@@ -600,8 +568,6 @@ const Rail = React.forwardRef<HTMLDivElement, RailProps>((props, ref) => {
600
568
  presentationTable: table,
601
569
  builtIn: navigationRest,
602
570
  onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),
603
- onExpand,
604
- onCollapse,
605
571
  size: expandedSize,
606
572
  });
607
573
  useFrameRegistration('rail', flush);
@@ -639,8 +605,8 @@ function RailContent({ children }: { children: React.ReactNode }) {
639
605
 
640
606
  type HandleComponent = React.ForwardRefExoticComponent<React.ComponentPropsWithoutRef<'div'> & React.RefAttributes<HTMLDivElement>>;
641
607
 
642
- type PanelOpenChangeMeta = { reason: 'toggle' | 'left' | 'init' | 'responsive' | 'dismiss' };
643
- type PanelControlledProps = { open: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: PanelOpenChangeMeta) => void; defaultOpen?: never };
608
+ type PanelOpenChangeMeta = { reason: PaneOpenChangeReason };
609
+ type PanelControlledProps = { open: boolean; onOpenChange?: (open: boolean, meta: PanelOpenChangeMeta) => void; defaultOpen?: never };
644
610
  type PanelUncontrolledProps = { defaultOpen?: boolean | Partial<Record<Breakpoint, boolean>>; onOpenChange?: (open: boolean, meta: PanelOpenChangeMeta) => void; open?: never };
645
611
 
646
612
  type PanelSizeControlledProps = { size: number | string; defaultSize?: never };
@@ -687,16 +653,9 @@ const Panel = React.forwardRef<HTMLDivElement, PanelPublicProps>((props, ref) =>
687
653
  maxSize = 800,
688
654
  resizable = false,
689
655
  collapsible = true,
690
- onExpand,
691
- onCollapse,
692
656
  onResize,
693
657
  onResizeStart,
694
658
  onResizeEnd,
695
- snapPoints,
696
- snapTolerance,
697
- collapseThreshold,
698
- paneId,
699
- persistence,
700
659
  children,
701
660
  style,
702
661
  onSizeChange,
@@ -723,17 +682,10 @@ const Panel = React.forwardRef<HTMLDivElement, PanelPublicProps>((props, ref) =>
723
682
  presentationTable,
724
683
  builtIn: detailRest,
725
684
  onChange: (value, reason) => onOpenChange?.(value !== 'closed', { reason }),
726
- onExpand,
727
- onCollapse,
728
685
  size: expandedSize,
729
686
  });
730
687
  useFrameRegistration('panel', flush);
731
688
 
732
- React.useEffect(() => {
733
- if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {
734
- warnOnce('Shell.Panel: `snapPoints`, `collapseThreshold`, `paneId` and `persistence` are deprecated and are removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');
735
- }
736
- }, [snapPoints, collapseThreshold, paneId, persistence]);
737
689
 
738
690
  const elementRef = React.useRef<HTMLElement | null>(null);
739
691
  const composedRef = useComposedRefs(ref, pane.setElement, elementRef);
@@ -759,11 +711,6 @@ const Panel = React.forwardRef<HTMLDivElement, PanelPublicProps>((props, ref) =>
759
711
  onResize,
760
712
  onResizeStart,
761
713
  onResizeEnd,
762
- snapPoints,
763
- snapTolerance,
764
- collapseThreshold,
765
- paneId,
766
- persistence,
767
714
  overlaying: pane.overlaying,
768
715
  // Asked when the effect runs: the Rail registers its table after this
769
716
  // Panel first renders, so the render's answer can be out of date.
@@ -771,7 +718,6 @@ const Panel = React.forwardRef<HTMLDivElement, PanelPublicProps>((props, ref) =>
771
718
  const table = followsRail ? (store.entries.get('rail')?.presentationTable ?? FIXED_TABLE) : own.table;
772
719
  return table[readBreakpoint()] === 'overlay';
773
720
  },
774
- requestCollapse: () => pane.setValue('closed', 'toggle'),
775
721
  requestToggle: () => pane.toggle('toggle'),
776
722
  });
777
723
 
@@ -782,7 +728,7 @@ const Panel = React.forwardRef<HTMLDivElement, PanelPublicProps>((props, ref) =>
782
728
 
783
729
  return (
784
730
  <div
785
- {...withoutRemovedPaneProps(domProps)}
731
+ {...domProps}
786
732
  role={domProps.role ?? 'navigation'}
787
733
  id={pane.id}
788
734
  ref={composedRef}
@@ -851,14 +797,6 @@ interface TriggerProps extends React.ComponentPropsWithoutRef<'button'> {
851
797
  * `Button` the trigger: `<Shell.Trigger asChild><Button iconOnly aria-label="Toggle sidebar">…</Button></Shell.Trigger>`.
852
798
  */
853
799
  asChild?: boolean;
854
- /**
855
- * Whether to show a preview of the target pane on hover while it is closed
856
- * and not an overlay. Defaults to false.
857
- *
858
- * @deprecated Removed in 1.0. A preview reachable only by mouse hover has no
859
- * keyboard or touch equivalent; open the pane instead.
860
- */
861
- peekOnHover?: boolean;
862
800
  }
863
801
 
864
802
  /**
@@ -868,40 +806,22 @@ interface TriggerProps extends React.ComponentPropsWithoutRef<'button'> {
868
806
  * consumer's `onClick` first: calling `preventDefault()` there cancels it. With `asChild` the
869
807
  * child is the button, and its own `type` stands.
870
808
  */
871
- const Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(({ target, action = 'toggle', peekOnHover, asChild = false, onClick, onMouseEnter, onMouseLeave, children, ...props }, ref) => {
809
+ const Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(({ target, action = 'toggle', asChild = false, onClick, children, ...props }, ref) => {
872
810
  const store = useShellStore('Shell.Trigger');
873
- React.useEffect(() => {
874
- if (target === 'left') warnOnce('Shell.Trigger target="left" is deprecated and is removed in 1.0. Use target="rail".');
875
- if (peekOnHover) warnOnce('Shell.Trigger: `peekOnHover` is deprecated and is removed in 1.0.');
876
- }, [target, peekOnHover]);
877
- const name: PaneName = target === 'left' ? 'rail' : target;
878
811
  // Subscribes to its own pane only.
879
- const entry = usePaneEntry(store, name);
812
+ const entry = usePaneEntry(store, target);
880
813
  const shown = entry?.value === undefined ? undefined : entry.value !== 'closed';
881
814
 
882
815
  const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
883
816
  onClick?.(event);
884
817
  if (event.defaultPrevented) return;
885
- const current = store.entries.get(name);
818
+ const current = store.entries.get(target);
886
819
  if (!current) return;
887
- if (store.peek === name) setShellPeek(store, null);
888
820
  if (action === 'toggle') current.toggle('toggle');
889
821
  else if (action === 'expand') current.setValue('open', 'toggle');
890
822
  else current.setValue('closed', 'toggle');
891
823
  };
892
824
 
893
- const handleMouseEnter = (event: React.MouseEvent<HTMLButtonElement>) => {
894
- onMouseEnter?.(event);
895
- if (!peekOnHover) return;
896
- const current = store.entries.get(name);
897
- if (current && current.value === 'closed' && current.presentation !== 'overlay') setShellPeek(store, name);
898
- };
899
-
900
- const handleMouseLeave = (event: React.MouseEvent<HTMLButtonElement>) => {
901
- onMouseLeave?.(event);
902
- if (peekOnHover && store.peek === name) setShellPeek(store, null);
903
- };
904
-
905
825
  const Comp = asChild ? Slot.Root : 'button';
906
826
  return (
907
827
  <Comp
@@ -914,8 +834,6 @@ const Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(({ target, act
914
834
  {...props}
915
835
  ref={ref}
916
836
  onClick={handleClick}
917
- onMouseEnter={handleMouseEnter}
918
- onMouseLeave={handleMouseLeave}
919
837
  data-shell-trigger={target}
920
838
  data-shell-action={action}
921
839
  >
@@ -929,7 +847,6 @@ Trigger.displayName = 'Shell.Trigger';
929
847
  export {
930
848
  Root,
931
849
  Header,
932
- Left,
933
850
  Rail,
934
851
  Panel,
935
852
  Sidebar,
@@ -940,9 +857,7 @@ export {
940
857
  PaneHeader,
941
858
  PaneFooter,
942
859
  Scroll,
943
- useShell,
944
860
  useSidebarMode,
945
- useResponsivePresentation,
946
861
  type PaneMode,
947
862
  type SidebarMode,
948
863
  type ResponsivePresentation,
@@ -13,19 +13,11 @@ export type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs
13
13
 
14
14
  export type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;
15
15
 
16
- export type PaneSizePersistence = {
17
- load?: () => number | Promise<number | undefined> | undefined;
18
- save?: (size: number) => void | Promise<void>;
19
- };
20
-
21
16
  /**
22
- * Why a pane's open state changed. Since 0.8.0 only a user action is reported:
23
- * `toggle` for a Trigger, a handle double-click or a drag past
24
- * `collapseThreshold`, and `dismiss` for Escape or a press on the scrim.
25
- * `init`, `responsive`, `panel` and `left` are kept in the types for
26
- * compatibility and are never sent.
17
+ * Why a pane's open state changed. Only a user action is reported: `toggle` for a Trigger or a
18
+ * handle double-click, and `dismiss` for Escape or a press on the scrim.
27
19
  */
28
- export type PaneOpenChangeReason = 'toggle' | 'dismiss' | 'init' | 'responsive';
20
+ export type PaneOpenChangeReason = 'toggle' | 'dismiss';
29
21
 
30
22
  export interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {
31
23
  presentation?: ResponsivePresentation;
@@ -34,23 +26,9 @@ export interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {
34
26
  maxSize?: number;
35
27
  resizable?: boolean;
36
28
  collapsible?: boolean;
37
- /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */
38
- onExpand?: () => void;
39
- /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */
40
- onCollapse?: () => void;
41
29
  onResize?: (size: number) => void;
42
30
  onResizeStart?: (size: number) => void;
43
31
  onResizeEnd?: (size: number) => void;
44
- /** @deprecated Removed in 1.0. Snap in your own `onSizeChange` and pass `size`. */
45
- snapPoints?: number[];
46
- /** @deprecated Removed in 1.0, with `snapPoints`. */
47
- snapTolerance?: number;
48
- /** @deprecated Removed in 1.0. Close the pane from your own `onResizeEnd`. */
49
- collapseThreshold?: number;
50
- /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */
51
- paneId?: string;
52
- /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */
53
- persistence?: PaneSizePersistence;
54
32
  }
55
33
 
56
34
  export const _BREAKPOINTS = {
@@ -66,10 +44,10 @@ export type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;
66
44
  /** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */
67
45
  export const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];
68
46
 
69
- export type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';
47
+ /** The panes a Trigger can drive. */
48
+ export type PaneTarget = 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';
70
49
 
71
- /** The panes a Trigger can drive. `left` is the deprecated name for `rail`. */
72
- export type PaneName = Exclude<PaneTarget, 'left'>;
50
+ export type PaneName = PaneTarget;
73
51
 
74
52
  /**
75
53
  * CSS custom property key type for type-safe style objects.
package/styles.css CHANGED
@@ -17747,26 +17747,6 @@
17747
17747
  inline-size: var(--sidebar-size, var(--sidebar-expanded-size, 288px));
17748
17748
  }
17749
17749
  }
17750
- .kui-ShellPane[data-peek][data-state],
17751
- .kui-ShellRail ~ .kui-ShellPanel[data-presentation-follows][data-peek][data-state] {
17752
- --kui-shell-position: absolute;
17753
- --kui-shell-z: 4;
17754
- --kui-shell-pin: fixed;
17755
- --kui-shell-pin-top: initial;
17756
- --kui-shell-row: 2 / 3;
17757
- --kui-shell-col: 1 / -1;
17758
- --kui-shell-surface: var(--color-surface);
17759
- --kui-shell-shadow: var(--surface-chrome);
17760
- --kui-shell-edge: 1px;
17761
- --kui-shell-offset: var(--shell-rail-offset, 0px);
17762
- --kui-shell-handle: none;
17763
- display: -webkit-box;
17764
- display: -ms-flexbox;
17765
- display: flex;
17766
- }
17767
- .kui-ShellSidebar[data-peek][data-state] {
17768
- inline-size: var(--peek-sidebar-width, var(--sidebar-size, var(--sidebar-expanded-size, 288px)));
17769
- }
17770
17750
  .kui-ShellScrim {
17771
17751
  display: none;
17772
17752
  position: absolute;
@@ -1,10 +0,0 @@
1
- import type { PresentationValue, ResponsivePresentation } from './shell.types.js';
2
- /**
3
- * @deprecated Since 0.8.0 the Shell resolves a responsive `presentation` in
4
- * its stylesheet, so the pane is placed before any script runs. This hook
5
- * resolves it in JS after mount, which is the behaviour the Shell left
6
- * behind. It keeps working until 1.0.
7
- */
8
- declare function useResponsivePresentation(presentation: ResponsivePresentation): PresentationValue;
9
- export { useResponsivePresentation };
10
- //# sourceMappingURL=shell.hooks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shell.hooks.d.ts","sourceRoot":"","sources":["../../../src/components/shell.hooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAGlF;;;;;GAKG;AACH,iBAAS,yBAAyB,CAAC,YAAY,EAAE,sBAAsB,GAAG,iBAAiB,CAM1F;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -1,3 +0,0 @@
1
- "use client";
2
- "use strict";var T=Object.create;var p=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var O=(e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})},y=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of B(t))!C.call(e,r)&&r!==n&&p(e,r,{get:()=>t[r],enumerable:!(i=E(t,r))||i.enumerable});return e};var d=(e,t,n)=>(n=e!=null?T(w(e)):{},y(t||!e||!e.__esModule?p(n,"default",{value:e,enumerable:!0}):n,e)),L=e=>y(p({},"__esModule",{value:!0}),e);var K={};O(K,{useResponsivePresentation:()=>_});module.exports=L(K);var k=d(require("react"));var l=d(require("react"));var P={xs:"(min-width: 520px)",sm:"(min-width: 768px)",md:"(min-width: 1024px)",lg:"(min-width: 1280px)",xl:"(min-width: 1640px)"},b=["initial","xs","sm","md","lg","xl"];var M=Object.entries(P),c=null,s=new Set,o=null;function f(){return c??(c=M.map(([e,t])=>[e,window.matchMedia(t)])),c}function m(){let e="initial";for(let[t,n]of f())n.matches&&(e=t);return e}function u(){let e=m();e!==o&&(o=e,s.forEach(t=>t()))}function R(e){if(typeof window>"u")return()=>{};if(s.size===0){o=m();for(let[,t]of f())typeof t.addEventListener=="function"?t.addEventListener("change",u):t.addListener?.(u)}return s.add(e),()=>{if(s.delete(e),!(s.size>0)){for(let[,t]of f())try{typeof t.removeEventListener=="function"?t.removeEventListener("change",u):t.removeListener?.(u)}catch{}o=null}}}function N(){return typeof window>"u"?"initial":(o??(o=m()),o)}function V(){return"initial"}var z=()=>!0,I=()=>!1,h=()=>()=>{},F=()=>"initial";function g(e=!0){let t=l.useSyncExternalStore(e?R:h,e?N:F,V),n=l.useSyncExternalStore(e?R:h,z,I);return l.useMemo(()=>({breakpoint:t,ready:n}),[t,n])}var a=d(require("react")),A=require("radix-ui/internal");function v(e){return typeof e=="object"&&e!==null}function S(e,t){let n={},i=null;for(let r of b){if(e!==void 0&&!v(e)){n[r]=e;continue}let x=v(e)?e[r]:void 0;x!==void 0&&(i={value:x}),n[r]=i?i.value:t(r)}return n}var H=S("fixed",()=>"fixed");var W=a.createContext(null);var J=a.createContext(null);function _(e){k.useEffect(()=>{},[]);let{breakpoint:t}=g(typeof e!="string");return S(e,()=>"fixed")[t]}
3
- //# sourceMappingURL=shell.hooks.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/shell.hooks.ts", "../../../src/hooks/use-breakpoint.ts", "../../../src/components/shell.types.ts", "../../../src/components/_internal/shell-store.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport { useBreakpoint } from '../hooks/use-breakpoint.js';\nimport type { PresentationValue, ResponsivePresentation } from './shell.types.js';\nimport { tableOf, warnOnce } from './_internal/shell-store.js';\n\n/**\n * @deprecated Since 0.8.0 the Shell resolves a responsive `presentation` in\n * its stylesheet, so the pane is placed before any script runs. This hook\n * resolves it in JS after mount, which is the behaviour the Shell left\n * behind. It keeps working until 1.0.\n */\nfunction useResponsivePresentation(presentation: ResponsivePresentation): PresentationValue {\n React.useEffect(() => {\n warnOnce('Shell.useResponsivePresentation is deprecated and is removed in 1.0. The Shell resolves presentation in CSS.');\n }, []);\n const { breakpoint } = useBreakpoint(typeof presentation !== 'string');\n return tableOf<PresentationValue>(presentation, () => 'fixed')[breakpoint];\n}\n\nexport { useResponsivePresentation };\n", "'use client';\n\nimport * as React from 'react';\nimport { _BREAKPOINTS, type Breakpoint } from '../components/shell.types.js';\n\nconst QUERIES = Object.entries(_BREAKPOINTS) as Array<[Breakpoint, string]>;\n\ntype Listener = () => void;\n\n/**\n * One set of `MediaQueryList`s and one set of listeners for the whole\n * application. Every component that asks for the breakpoint used to create and\n * subscribe to its own copy of all five queries.\n */\nlet mediaQueryLists: Array<[Breakpoint, MediaQueryList]> | null = null;\nconst listeners = new Set<Listener>();\nlet cachedBreakpoint: Breakpoint | null = null;\n\nfunction getMediaQueryLists() {\n mediaQueryLists ??= QUERIES.map(([name, query]) => [name, window.matchMedia(query)] as [Breakpoint, MediaQueryList]);\n return mediaQueryLists;\n}\n\nfunction computeBreakpoint(): Breakpoint {\n // The largest matching query wins; `_BREAKPOINTS` is ordered smallest first.\n let matched: Breakpoint = 'initial';\n for (const [name, mql] of getMediaQueryLists()) {\n if (mql.matches) matched = name;\n }\n return matched;\n}\n\nfunction handleChange() {\n const next = computeBreakpoint();\n if (next === cachedBreakpoint) return;\n cachedBreakpoint = next;\n listeners.forEach((listener) => listener());\n}\n\nfunction subscribe(listener: Listener) {\n if (typeof window === 'undefined') return () => {};\n\n if (listeners.size === 0) {\n cachedBreakpoint = computeBreakpoint();\n for (const [, mql] of getMediaQueryLists()) {\n // Safari below 14 only has the deprecated listener API.\n if (typeof mql.addEventListener === 'function') mql.addEventListener('change', handleChange);\n else mql.addListener?.(handleChange);\n }\n }\n\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n if (listeners.size > 0) return;\n\n for (const [, mql] of getMediaQueryLists()) {\n try {\n if (typeof mql.removeEventListener === 'function') mql.removeEventListener('change', handleChange);\n else mql.removeListener?.(handleChange);\n } catch (error) {\n // Removal can throw in edge cases, e.g. the list was already torn down.\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[useBreakpoint] MediaQueryList cleanup warning:', error);\n }\n }\n }\n cachedBreakpoint = null;\n };\n}\n\n/**\n * `getSnapshot` must return a referentially stable value between changes, so it\n * reads the cache that `handleChange` maintains rather than recomputing.\n */\nfunction getSnapshot(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n cachedBreakpoint ??= computeBreakpoint();\n return cachedBreakpoint;\n}\n\nfunction getServerSnapshot(): Breakpoint {\n return 'initial';\n}\n\n/**\n * The breakpoint right now, outside React's render. For an effect that needs\n * the answer at the moment it runs rather than the one its render saw.\n */\nexport function readBreakpoint(): Breakpoint {\n if (typeof window === 'undefined') return 'initial';\n return computeBreakpoint();\n}\n\nconst getReadySnapshot = () => true;\nconst getReadyServerSnapshot = () => false;\n\nconst noopSubscribe = () => () => {};\nconst getInitialSnapshot = (): Breakpoint => 'initial';\n\n/**\n * The current breakpoint, and whether it has been resolved against a real\n * viewport yet (`false` on the server and during hydration).\n *\n * Reads through `useSyncExternalStore` rather than settling into state from an\n * effect. On a client render the very first pass already has the real\n * breakpoint, instead of rendering the whole shell at `initial` and correcting\n * it after the browser has painted.\n *\n * Pass `enabled = false` to skip the subscription (the breakpoint then reads as\n * `initial`).\n */\nexport function useBreakpoint(enabled = true): { breakpoint: Breakpoint; ready: boolean } {\n // Callers with a non-responsive value pass `enabled = false` so they neither\n // subscribe to the media queries nor re-render when the viewport crosses one.\n const breakpoint = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n enabled ? getSnapshot : getInitialSnapshot,\n getServerSnapshot,\n );\n const ready = React.useSyncExternalStore(\n enabled ? subscribe : noopSubscribe,\n getReadySnapshot,\n getReadyServerSnapshot,\n );\n\n return React.useMemo(() => ({ breakpoint, ready }), [breakpoint, ready]);\n}\n", "import type * as React from 'react';\n\nexport type PresentationValue = 'fixed' | 'overlay' | 'stacked';\n\nexport type ResponsivePresentation = PresentationValue | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PresentationValue>>;\n\nexport type PaneMode = 'expanded' | 'collapsed';\nexport type SidebarMode = 'collapsed' | 'expanded';\n\nexport type ResponsiveMode = PaneMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', PaneMode>>;\n\nexport type ResponsiveSidebarMode = SidebarMode | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', SidebarMode>>;\n\nexport type Responsive<T> = T | Partial<Record<'initial' | 'xs' | 'sm' | 'md' | 'lg' | 'xl', T>>;\n\nexport type PaneSizePersistence = {\n load?: () => number | Promise<number | undefined> | undefined;\n save?: (size: number) => void | Promise<void>;\n};\n\n/**\n * Why a pane's open state changed. Since 0.8.0 only a user action is reported:\n * `toggle` for a Trigger, a handle double-click or a drag past\n * `collapseThreshold`, and `dismiss` for Escape or a press on the scrim.\n * `init`, `responsive`, `panel` and `left` are kept in the types for\n * compatibility and are never sent.\n */\nexport type PaneOpenChangeReason = 'toggle' | 'dismiss' | 'init' | 'responsive';\n\nexport interface PaneBaseProps extends React.ComponentPropsWithoutRef<'div'> {\n presentation?: ResponsivePresentation;\n expandedSize?: number;\n minSize?: number;\n maxSize?: number;\n resizable?: boolean;\n collapsible?: boolean;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onExpand?: () => void;\n /** @deprecated Use `onOpenChange`. Still called when a user's toggle or a controlled prop changes whether the pane is shown; never on mount or when the window crosses a breakpoint. */\n onCollapse?: () => void;\n onResize?: (size: number) => void;\n onResizeStart?: (size: number) => void;\n onResizeEnd?: (size: number) => void;\n /** @deprecated Removed in 1.0. Snap in your own `onSizeChange` and pass `size`. */\n snapPoints?: number[];\n /** @deprecated Removed in 1.0, with `snapPoints`. */\n snapTolerance?: number;\n /** @deprecated Removed in 1.0. Close the pane from your own `onResizeEnd`. */\n collapseThreshold?: number;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n paneId?: string;\n /** @deprecated Removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`. */\n persistence?: PaneSizePersistence;\n}\n\nexport const _BREAKPOINTS = {\n xs: '(min-width: 520px)',\n sm: '(min-width: 768px)',\n md: '(min-width: 1024px)',\n lg: '(min-width: 1280px)',\n xl: '(min-width: 1640px)',\n} as const;\n\nexport type Breakpoint = 'initial' | keyof typeof _BREAKPOINTS;\n\n/** Every breakpoint, smallest first. The stylesheet's @media blocks follow this order. */\nexport const SHELL_BREAKPOINTS: readonly Breakpoint[] = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'];\n\nexport type PaneTarget = 'left' | 'rail' | 'panel' | 'sidebar' | 'inspector' | 'bottom';\n\n/** The panes a Trigger can drive. `left` is the deprecated name for `rail`. */\nexport type PaneName = Exclude<PaneTarget, 'left'>;\n\n/**\n * CSS custom property key type for type-safe style objects.\n * Allows any string prefixed with '--'.\n */\nexport type CSSCustomProperty = `--${string}`;\n\n/**\n * Style object that supports CSS custom properties.\n */\nexport type CSSPropertiesWithVars = React.CSSProperties & {\n [key: CSSCustomProperty]: string | number | undefined;\n};\n", "'use client';\n\n/**\n * The Shell's state model (0.8.0), ported from kookie-ui-v2's Shell.\n *\n * - State lives on the pane. Each pane holds `auto | open | closed`.\n * `auto` means untouched: the stylesheet decides what\n * it shows at each breakpoint, so first paint is right with no script, the\n * server and the client render the same markup, and no open-state callback\n * can fire on mount or on a resize.\n * - The one thing that crosses the Shell is a registry keyed by pane name.\n * Each pane registers what it is and how to drive it; a Trigger looks its\n * pane up, and the Root reads the set of live overlays. Nothing scans\n * children and nothing checks `displayName`.\n * - The responsive props are resolved into a table with one value per\n * breakpoint, from the props alone, with no window. The table is written to\n * the DOM as data attributes for the stylesheet, and read again in JS by the\n * mirror that sets `aria-expanded`. One table, two readers, so they agree by\n * construction.\n */\nimport * as React from 'react';\nimport { useLayoutEffect } from 'radix-ui/internal';\nimport { SHELL_BREAKPOINTS } from '../shell.types.js';\nimport type { Breakpoint, PaneName, PresentationValue } from '../shell.types.js';\n\n/* \u2500\u2500 Breakpoint tables \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type Table<T> = Record<Breakpoint, T>;\n\n/** What a pane shows: open or closed. */\nexport type PaneValue = 'open' | 'closed';\n\ntype ResponsiveInput<T> = T | Partial<Record<Breakpoint, T>> | undefined;\n\nfunction isMap<T>(value: ResponsiveInput<T>): value is Partial<Record<Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * A responsive value at every breakpoint. A breakpoint takes the largest key\n * at or below it, the same fallback `useResponsiveValue` used; a breakpoint\n * below every key takes `fallback`.\n */\nexport function tableOf<T>(value: ResponsiveInput<T>, fallback: (bp: Breakpoint) => T): Table<T> {\n const table = {} as Table<T>;\n let carried: { value: T } | null = null;\n for (const bp of SHELL_BREAKPOINTS) {\n if (value !== undefined && !isMap(value)) {\n table[bp] = value;\n continue;\n }\n const entry = isMap(value) ? value[bp] : undefined;\n if (entry !== undefined) carried = { value: entry };\n table[bp] = carried ? carried.value : fallback(bp);\n }\n return table;\n}\n\n/** The table's one value, when it has only one. */\nexport function constantOf<T>(table: Table<T>): T | undefined {\n const first = table.initial;\n return SHELL_BREAKPOINTS.every((bp) => table[bp] === first) ? first : undefined;\n}\n\n/**\n * The table as data attributes: `data-<name>` when it holds one value, one\n * `data-<name>-<bp>` per breakpoint when it holds several. The stylesheet has\n * a rule for each spelling.\n */\nexport function tableAttributes(name: string, table: Table<string>): Record<string, string> {\n const constant = constantOf(table);\n if (constant !== undefined) return { [`data-${name}`]: constant };\n const attributes: Record<string, string> = {};\n for (const bp of SHELL_BREAKPOINTS) attributes[`data-${name}-${bp}`] = table[bp];\n return attributes;\n}\n\n/**\n * A responsive prop object is usually an inline literal, a new identity every\n * render. Keying memoisation on its contents keeps the tables, and so the\n * registry entries, stable across renders that change nothing.\n */\nexport function useStableKey(value: unknown): string {\n return typeof value === 'object' && value !== null ? JSON.stringify(value) : String(value);\n}\n\nexport const FIXED_TABLE: Table<PresentationValue> = tableOf<PresentationValue>('fixed', () => 'fixed');\n\n/* \u2500\u2500 The registry \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type OpenChangeReason = 'toggle' | 'dismiss';\n\nexport type PaneEntry = {\n name: PaneName;\n id: string;\n el: HTMLElement | null;\n /** What the pane shows now; `undefined` while an untouched pane cannot know (before the breakpoint is known). */\n value: PaneValue | undefined;\n /** How the pane is presented now, when known. */\n presentation: PresentationValue | undefined;\n /** The pane's own presentation at every breakpoint. A Panel with none of its own follows the Rail's. */\n presentationTable: Table<PresentationValue>;\n /** Open and presented as an overlay: what the scrim and Escape close, and what containment exempts. */\n overlayLive: boolean;\n /** The pane's designed open width, for panes that sit beside it when floating. */\n size: number;\n setValue: (value: PaneValue, reason: OpenChangeReason) => void;\n toggle: (reason: OpenChangeReason) => void;\n};\n\nexport type ShellStore = {\n entries: Map<PaneName, PaneEntry>;\n listeners: Set<() => void>;\n /**\n * What a subscriber reads. useSyncExternalStore needs a value that is stable\n * between notifications, and a number is; the Map, or anything derived from\n * it, would be a new identity on every read.\n */\n version: number;\n /** The pane a hovered Trigger is previewing, if any. Layout only. */\n peek: PaneName | null;\n};\n\nexport function createShellStore(): ShellStore {\n return { entries: new Map(), listeners: new Set(), version: 0, peek: null };\n}\n\nexport function notifyShellStore(store: ShellStore) {\n store.version += 1;\n for (const listener of store.listeners) listener();\n}\n\nexport function subscribeShellStore(store: ShellStore, listener: () => void) {\n store.listeners.add(listener);\n return () => {\n store.listeners.delete(listener);\n };\n}\n\nexport function setShellPeek(store: ShellStore, peek: PaneName | null) {\n if (store.peek === peek) return;\n store.peek = peek;\n notifyShellStore(store);\n}\n\nexport const ShellStoreContext = React.createContext<ShellStore | null>(null);\n\nexport function useShellStore(part: string): ShellStore {\n const store = React.useContext(ShellStoreContext);\n if (!store) throw new Error(`${part} must be used within <Shell.Root>`);\n return store;\n}\n\n/** One pane's registry entry. Re-renders only when that entry is replaced. */\nexport function usePaneEntry(store: ShellStore, name: PaneName): PaneEntry | undefined {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n const getSnapshot = React.useCallback(() => store.entries.get(name), [store, name]);\n return React.useSyncExternalStore(subscribe, getSnapshot, () => undefined);\n}\n\n/**\n * Whether this pane is the one being previewed. A boolean per pane rather than\n * the peek target itself, so hovering one Trigger re-renders one pane, not all.\n */\nexport function usePeeking(store: ShellStore, name: PaneName): boolean {\n const subscribe = React.useCallback((listener: () => void) => subscribeShellStore(store, listener), [store]);\n return React.useSyncExternalStore(\n subscribe,\n () => store.peek === name,\n () => false,\n );\n}\n\n/* \u2500\u2500 Off the frame \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type FramePaneId = 'rail' | 'panel' | 'sidebar' | 'content' | 'inspector' | 'bottom';\n\nexport const ShellFrameContext = React.createContext<{\n registerOffFrame: (id: FramePaneId) => void;\n unregisterOffFrame: (id: FramePaneId) => void;\n} | null>(null);\n\n/** Tells the Root a pane is off the frame (`flush={false}`); the Rail's card moves a floating Panel over. */\nexport function useFrameRegistration(id: FramePaneId, flush: boolean) {\n const ctx = React.useContext(ShellFrameContext);\n if (!ctx) throw new Error('Shell panes must be used within <Shell.Root>');\n const { registerOffFrame, unregisterOffFrame } = ctx;\n useLayoutEffect(() => {\n if (flush) return;\n registerOffFrame(id);\n return () => unregisterOffFrame(id);\n }, [id, flush, registerOffFrame, unregisterOffFrame]);\n}\n\n/* \u2500\u2500 Development warnings \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nconst warned = new Set<string>();\n\n/** A deprecation warning, once per message per page load. Development only. */\nexport function warnOnce(message: string) {\n if (process.env.NODE_ENV === 'production') return;\n if (warned.has(message)) return;\n warned.add(message);\n console.warn(`[kookie-ui] ${message}`);\n}\n"],
5
- "mappings": ";0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBCEvB,IAAAC,EAAuB,oBCqDhB,IAAMC,EAAe,CAC1B,GAAI,qBACJ,GAAI,qBACJ,GAAI,sBACJ,GAAI,sBACJ,GAAI,qBACN,EAKaC,EAA2C,CAAC,UAAW,KAAM,KAAM,KAAM,KAAM,IAAI,ED7DhG,IAAMC,EAAU,OAAO,QAAQC,CAAY,EASvCC,EAA8D,KAC5DC,EAAY,IAAI,IAClBC,EAAsC,KAE1C,SAASC,GAAqB,CAC5B,OAAAH,MAAoBF,EAAQ,IAAI,CAAC,CAACM,EAAMC,CAAK,IAAM,CAACD,EAAM,OAAO,WAAWC,CAAK,CAAC,CAAiC,GAC5GL,CACT,CAEA,SAASM,GAAgC,CAEvC,IAAIC,EAAsB,UAC1B,OAAW,CAACH,EAAMI,CAAG,IAAKL,EAAmB,EACvCK,EAAI,UAASD,EAAUH,GAE7B,OAAOG,CACT,CAEA,SAASE,GAAe,CACtB,IAAMC,EAAOJ,EAAkB,EAC3BI,IAASR,IACbA,EAAmBQ,EACnBT,EAAU,QAASU,GAAaA,EAAS,CAAC,EAC5C,CAEA,SAASC,EAAUD,EAAoB,CACrC,GAAI,OAAO,OAAW,IAAa,MAAO,IAAM,CAAC,EAEjD,GAAIV,EAAU,OAAS,EAAG,CACxBC,EAAmBI,EAAkB,EACrC,OAAW,CAAC,CAAEE,CAAG,IAAKL,EAAmB,EAEnC,OAAOK,EAAI,kBAAqB,WAAYA,EAAI,iBAAiB,SAAUC,CAAY,EACtFD,EAAI,cAAcC,CAAY,CAEvC,CAEA,OAAAR,EAAU,IAAIU,CAAQ,EAEf,IAAM,CAEX,GADAV,EAAU,OAAOU,CAAQ,EACrB,EAAAV,EAAU,KAAO,GAErB,QAAW,CAAC,CAAEO,CAAG,IAAKL,EAAmB,EACvC,GAAI,CACE,OAAOK,EAAI,qBAAwB,WAAYA,EAAI,oBAAoB,SAAUC,CAAY,EAC5FD,EAAI,iBAAiBC,CAAY,CACxC,MAAgB,CAKhB,CAEFP,EAAmB,KACrB,CACF,CAMA,SAASW,GAA0B,CACjC,OAAI,OAAO,OAAW,IAAoB,WAC1CX,MAAqBI,EAAkB,GAChCJ,EACT,CAEA,SAASY,GAAgC,CACvC,MAAO,SACT,CAWA,IAAMC,EAAmB,IAAM,GACzBC,EAAyB,IAAM,GAE/BC,EAAgB,IAAM,IAAM,CAAC,EAC7BC,EAAqB,IAAkB,UActC,SAASC,EAAcC,EAAU,GAAkD,CAGxF,IAAMC,EAAmB,uBACvBD,EAAUE,EAAYL,EACtBG,EAAUG,EAAcL,EACxBM,CACF,EACMC,EAAc,uBAClBL,EAAUE,EAAYL,EACtBF,EACAC,CACF,EAEA,OAAa,UAAQ,KAAO,CAAE,WAAAK,EAAY,MAAAI,CAAM,GAAI,CAACJ,EAAYI,CAAK,CAAC,CACzE,CE5GA,IAAAC,EAAuB,oBACvBC,EAAgC,6BAahC,SAASC,EAASC,EAAoE,CACpF,OAAO,OAAOA,GAAU,UAAYA,IAAU,IAChD,CAOO,SAASC,EAAWD,EAA2BE,EAA2C,CAC/F,IAAMC,EAAQ,CAAC,EACXC,EAA+B,KACnC,QAAWC,KAAMC,EAAmB,CAClC,GAAIN,IAAU,QAAa,CAACD,EAAMC,CAAK,EAAG,CACxCG,EAAME,CAAE,EAAIL,EACZ,QACF,CACA,IAAMO,EAAQR,EAAMC,CAAK,EAAIA,EAAMK,CAAE,EAAI,OACrCE,IAAU,SAAWH,EAAU,CAAE,MAAOG,CAAM,GAClDJ,EAAME,CAAE,EAAID,EAAUA,EAAQ,MAAQF,EAASG,CAAE,CACnD,CACA,OAAOF,CACT,CA8BO,IAAMK,EAAwCC,EAA2B,QAAS,IAAM,OAAO,EA2D/F,IAAMC,EAA0B,gBAAiC,IAAI,EAgCrE,IAAMC,EAA0B,gBAG7B,IAAI,EHzKd,SAASC,EAA0BC,EAAyD,CACpF,YAAU,IAAM,CAEtB,EAAG,CAAC,CAAC,EACL,GAAM,CAAE,WAAAC,CAAW,EAAIC,EAAc,OAAOF,GAAiB,QAAQ,EACrE,OAAOG,EAA2BH,EAAc,IAAM,OAAO,EAAEC,CAAU,CAC3E",
6
- "names": ["shell_hooks_exports", "__export", "useResponsivePresentation", "__toCommonJS", "React", "React", "_BREAKPOINTS", "SHELL_BREAKPOINTS", "QUERIES", "_BREAKPOINTS", "mediaQueryLists", "listeners", "cachedBreakpoint", "getMediaQueryLists", "name", "query", "computeBreakpoint", "matched", "mql", "handleChange", "next", "listener", "subscribe", "getSnapshot", "getServerSnapshot", "getReadySnapshot", "getReadyServerSnapshot", "noopSubscribe", "getInitialSnapshot", "useBreakpoint", "enabled", "breakpoint", "subscribe", "getSnapshot", "getServerSnapshot", "ready", "React", "import_internal", "isMap", "value", "tableOf", "fallback", "table", "carried", "bp", "SHELL_BREAKPOINTS", "entry", "FIXED_TABLE", "tableOf", "ShellStoreContext", "ShellFrameContext", "useResponsivePresentation", "presentation", "breakpoint", "useBreakpoint", "tableOf"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import*as e from"react";import{Checkbox as s,Direction as S}from"radix-ui";import{Context as V,Primitive as q,useControllableState as N}from"radix-ui/internal";var{useDirection:D}=S,l="CheckboxGroup",[U,T]=V.createContextScope(l,[s.createCheckboxScope]),x=s.createCheckboxScope(),[W,A]=U(l),m=e.forwardRef((t,n)=>{let{__scopeCheckboxGroup:r,name:i,defaultValue:c,value:o,required:u=!1,disabled:a=!1,orientation:b,dir:C,loop:k,onValueChange:G,...I}=t,R=D(C),[y=[],p]=N({prop:o,defaultProp:c??[],onChange:G}),g=e.useCallback(d=>p((h=[])=>[...h,d]),[p]),E=e.useCallback(d=>p((h=[])=>h.filter(_=>_!==d)),[p]);return e.createElement(W,{scope:r,name:i,required:u,disabled:a,value:y,onItemCheck:g,onItemUncheck:E},e.createElement(q.div,{role:"group","data-disabled":a?"":void 0,dir:R,...I,ref:n}))});m.displayName=l;var P="CheckboxGroupItem",f=e.forwardRef((t,n)=>{let{__scopeCheckboxGroup:r,disabled:i,...c}=t,o=A(P,r),u=o.disabled||i,a=x(r),b=o.value?.includes(c.value),C=o.required&&(o.value?.length??0)===0;return e.createElement(s.Root,{name:o.name,disabled:u,required:C,checked:b,...a,...c,ref:n,onCheckedChange:k=>{k?o.onItemCheck(t.value):o.onItemUncheck(t.value)}})});f.displayName=P;var M="CheckboxGroupIndicator",v=e.forwardRef((t,n)=>{let{__scopeCheckboxGroup:r,...i}=t,c=x(r);return e.createElement(s.Indicator,{...c,...i,ref:n})});v.displayName=M;var z=m,B=f,H=v;export{T as a,m as b,f as c,v as d,z as e,B as f,H as g};
3
- //# sourceMappingURL=chunk-2VSRZ4IT.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/checkbox-group.primitive.tsx"],
4
- "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport { Checkbox as CheckboxPrimitive, Direction } from 'radix-ui';\nimport { Context, Primitive, useControllableState } from 'radix-ui/internal';\n\nconst { useDirection } = Direction;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxGroup\n * -----------------------------------------------------------------------------------------------*/\nconst CHECKBOX_GROUP_NAME = 'CheckboxGroup';\n\ntype ScopedProps<P> = P & { __scopeCheckboxGroup?: Context.Scope };\nconst [createCheckboxGroupContext, createCheckboxGroupScope] = Context.createContextScope(\n CHECKBOX_GROUP_NAME,\n [CheckboxPrimitive.createCheckboxScope],\n);\nconst useCheckboxScope = CheckboxPrimitive.createCheckboxScope();\n\ntype CheckboxGroupContextValue = {\n name?: string;\n required: boolean;\n disabled: boolean;\n value?: string[];\n onItemCheck(value: string): void;\n onItemUncheck(value: string): void;\n};\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] =\n createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);\n\ntype CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface CheckboxGroupProps extends PrimitiveDivProps {\n name?: CheckboxGroupContextValue['name'];\n required?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['required'];\n disabled?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['disabled'];\n dir?: 'ltr' | 'rtl';\n /**\n * @deprecated Has no effect. Each checkbox is its own tab stop, as with native checkboxes,\n * so there is no arrow-key navigation to orient.\n */\n orientation?: 'horizontal' | 'vertical';\n /**\n * @deprecated Has no effect. Each checkbox is its own tab stop, as with native checkboxes,\n * so there is no arrow-key navigation to loop.\n */\n loop?: boolean;\n defaultValue?: string[];\n value?: CheckboxGroupContextValue['value'];\n onValueChange?: (value: string[]) => void;\n}\n\nconst CheckboxGroup = React.forwardRef<CheckboxGroupElement, CheckboxGroupProps>(\n (props: ScopedProps<CheckboxGroupProps>, forwardedRef) => {\n const {\n __scopeCheckboxGroup,\n name,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation: _orientation,\n dir,\n loop: _loop,\n onValueChange,\n ...groupProps\n } = props;\n const direction = useDirection(dir);\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? [],\n onChange: onValueChange,\n });\n\n const handleItemCheck = React.useCallback(\n (itemValue: string) => setValue((prevValue = []) => [...prevValue, itemValue]),\n [setValue],\n );\n\n const handleItemUncheck = React.useCallback(\n (itemValue: string) =>\n setValue((prevValue = []) => prevValue.filter((value) => value !== itemValue)),\n [setValue],\n );\n\n return (\n <CheckboxGroupProvider\n scope={__scopeCheckboxGroup}\n name={name}\n required={required}\n disabled={disabled}\n value={value}\n onItemCheck={handleItemCheck}\n onItemUncheck={handleItemUncheck}\n >\n <Primitive.div\n role=\"group\"\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...groupProps}\n ref={forwardedRef}\n />\n </CheckboxGroupProvider>\n );\n },\n);\n\nCheckboxGroup.displayName = CHECKBOX_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'CheckboxGroupItem';\n\ntype CheckboxGroupItemElement = React.ElementRef<typeof CheckboxPrimitive.Root>;\ntype CheckboxProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>;\ninterface CheckboxGroupItemProps\n extends Omit<CheckboxProps, 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'> {\n value: string;\n}\n\nconst CheckboxGroupItem = React.forwardRef<CheckboxGroupItemElement, CheckboxGroupItemProps>(\n (props: ScopedProps<CheckboxGroupItemProps>, forwardedRef) => {\n const { __scopeCheckboxGroup, disabled, ...itemProps } = props;\n const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);\n const isDisabled = context.disabled || disabled;\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n const checked = context.value?.includes(itemProps.value);\n // A required group needs at least one box checked, not every box: the items are\n // required only while none is checked.\n const isRequired = context.required && (context.value?.length ?? 0) === 0;\n\n return (\n <CheckboxPrimitive.Root\n name={context.name}\n disabled={isDisabled}\n required={isRequired}\n checked={checked}\n {...checkboxScope}\n {...itemProps}\n ref={forwardedRef}\n onCheckedChange={(checked) => {\n if (checked) {\n context.onItemCheck(props.value);\n } else {\n context.onItemUncheck(props.value);\n }\n }}\n />\n );\n },\n);\n\nCheckboxGroupItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * CheckboxGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'CheckboxGroupIndicator';\n\ntype CheckboxGroupIndicatorElement = React.ElementRef<typeof CheckboxPrimitive.Indicator>;\ntype CheckboxIndicatorProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Indicator>;\ninterface CheckboxGroupIndicatorProps extends CheckboxIndicatorProps {}\n\nconst CheckboxGroupIndicator = React.forwardRef<\n CheckboxGroupIndicatorElement,\n CheckboxGroupIndicatorProps\n>((props: ScopedProps<CheckboxGroupIndicatorProps>, forwardedRef) => {\n const { __scopeCheckboxGroup, ...indicatorProps } = props;\n const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);\n return <CheckboxPrimitive.Indicator {...checkboxScope} {...indicatorProps} ref={forwardedRef} />;\n});\n\nCheckboxGroupIndicator.displayName = INDICATOR_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\nconst Root = CheckboxGroup;\nconst Item = CheckboxGroupItem;\nconst Indicator = CheckboxGroupIndicator;\n\nexport {\n createCheckboxGroupScope,\n //\n CheckboxGroup,\n CheckboxGroupItem,\n CheckboxGroupIndicator,\n //\n Root,\n Item,\n Indicator,\n};\nexport type { CheckboxGroupProps, CheckboxGroupItemProps, CheckboxGroupIndicatorProps };\n"],
5
- "mappings": ";AAEA,UAAYA,MAAW,QACvB,OAAS,YAAYC,EAAmB,aAAAC,MAAiB,WACzD,OAAS,WAAAC,EAAS,aAAAC,EAAW,wBAAAC,MAA4B,oBAEzD,GAAM,CAAE,aAAAC,CAAa,EAAIJ,EAKnBK,EAAsB,gBAGtB,CAACC,EAA4BC,CAAwB,EAAIN,EAAQ,mBACrEI,EACA,CAACN,EAAkB,mBAAmB,CACxC,EACMS,EAAmBT,EAAkB,oBAAoB,EAWzD,CAACU,EAAuBC,CAAuB,EACnDJ,EAAsDD,CAAmB,EAwBrEM,EAAsB,aAC1B,CAACC,EAAwCC,IAAiB,CACxD,GAAM,CACJ,qBAAAC,EACA,KAAAC,EACA,aAAAC,EACA,MAAOC,EACP,SAAAC,EAAW,GACX,SAAAC,EAAW,GACX,YAAaC,EACb,IAAAC,EACA,KAAMC,EACN,cAAAC,EACA,GAAGC,CACL,EAAIZ,EACEa,EAAYrB,EAAaiB,CAAG,EAC5B,CAACK,EAAQ,CAAC,EAAGC,CAAQ,EAAIxB,EAAqB,CAClD,KAAMc,EACN,YAAaD,GAAgB,CAAC,EAC9B,SAAUO,CACZ,CAAC,EAEKK,EAAwB,cAC3BC,GAAsBF,EAAS,CAACG,EAAY,CAAC,IAAM,CAAC,GAAGA,EAAWD,CAAS,CAAC,EAC7E,CAACF,CAAQ,CACX,EAEMI,EAA0B,cAC7BF,GACCF,EAAS,CAACG,EAAY,CAAC,IAAMA,EAAU,OAAQJ,GAAUA,IAAUG,CAAS,CAAC,EAC/E,CAACF,CAAQ,CACX,EAEA,OACE,gBAAClB,EAAA,CACC,MAAOK,EACP,KAAMC,EACN,SAAUG,EACV,SAAUC,EACV,MAAOO,EACP,YAAaE,EACb,cAAeG,GAEf,gBAAC7B,EAAU,IAAV,CACC,KAAK,QACL,gBAAeiB,EAAW,GAAK,OAC/B,IAAKM,EACJ,GAAGD,EACJ,IAAKX,EACP,CACF,CAEJ,CACF,EAEAF,EAAc,YAAcN,EAM5B,IAAM2B,EAAY,oBASZC,EAA0B,aAC9B,CAACrB,EAA4CC,IAAiB,CAC5D,GAAM,CAAE,qBAAAC,EAAsB,SAAAK,EAAU,GAAGe,CAAU,EAAItB,EACnDuB,EAAUzB,EAAwBsB,EAAWlB,CAAoB,EACjEsB,EAAaD,EAAQ,UAAYhB,EACjCkB,EAAgB7B,EAAiBM,CAAoB,EACrDwB,EAAUH,EAAQ,OAAO,SAASD,EAAU,KAAK,EAGjDK,EAAaJ,EAAQ,WAAaA,EAAQ,OAAO,QAAU,KAAO,EAExE,OACE,gBAACpC,EAAkB,KAAlB,CACC,KAAMoC,EAAQ,KACd,SAAUC,EACV,SAAUG,EACV,QAASD,EACR,GAAGD,EACH,GAAGH,EACJ,IAAKrB,EACL,gBAAkByB,GAAY,CACxBA,EACFH,EAAQ,YAAYvB,EAAM,KAAK,EAE/BuB,EAAQ,cAAcvB,EAAM,KAAK,CAErC,EACF,CAEJ,CACF,EAEAqB,EAAkB,YAAcD,EAMhC,IAAMQ,EAAiB,yBAMjBC,EAA+B,aAGnC,CAAC7B,EAAiDC,IAAiB,CACnE,GAAM,CAAE,qBAAAC,EAAsB,GAAG4B,CAAe,EAAI9B,EAC9CyB,EAAgB7B,EAAiBM,CAAoB,EAC3D,OAAO,gBAACf,EAAkB,UAAlB,CAA6B,GAAGsC,EAAgB,GAAGK,EAAgB,IAAK7B,EAAc,CAChG,CAAC,EAED4B,EAAuB,YAAcD,EAIrC,IAAMG,EAAOhC,EACPiC,EAAOX,EACPY,EAAYJ",
6
- "names": ["React", "CheckboxPrimitive", "Direction", "Context", "Primitive", "useControllableState", "useDirection", "CHECKBOX_GROUP_NAME", "createCheckboxGroupContext", "createCheckboxGroupScope", "useCheckboxScope", "CheckboxGroupProvider", "useCheckboxGroupContext", "CheckboxGroup", "props", "forwardedRef", "__scopeCheckboxGroup", "name", "defaultValue", "valueProp", "required", "disabled", "_orientation", "dir", "_loop", "onValueChange", "groupProps", "direction", "value", "setValue", "handleItemCheck", "itemValue", "prevValue", "handleItemUncheck", "ITEM_NAME", "CheckboxGroupItem", "itemProps", "context", "isDisabled", "checkboxScope", "checked", "isRequired", "INDICATOR_NAME", "CheckboxGroupIndicator", "indicatorProps", "Root", "Item", "Indicator"]
7
- }