@etsoo/toolpad 1.0.12 → 1.0.13

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 (260) hide show
  1. package/babel.config.json +11 -0
  2. package/build/cjs/Account/Account.js +104 -0
  3. package/build/cjs/Account/Account.test.js +40 -0
  4. package/build/cjs/Account/AccountPopoverFooter.js +18 -0
  5. package/build/cjs/Account/AccountPopoverHeader.js +12 -0
  6. package/build/cjs/Account/AccountPreview.js +96 -0
  7. package/build/cjs/Account/AccountPreview.test.js +52 -0
  8. package/build/cjs/Account/SignInButton.js +56 -0
  9. package/build/cjs/Account/SignOutButton.js +58 -0
  10. package/build/cjs/Account/index.js +22 -0
  11. package/build/cjs/AppProvider/AppProvider.js +40 -0
  12. package/build/cjs/AppProvider/AppProvider.test.js +18 -0
  13. package/build/cjs/AppProvider/AppProviderComponent.js +33 -0
  14. package/build/cjs/AppProvider/AppThemeProvider.js +111 -0
  15. package/build/cjs/AppProvider/index.js +17 -0
  16. package/build/cjs/DashboardLayout/DashboardLayout.js +230 -0
  17. package/build/cjs/DashboardLayout/DashboardLayout.test.js +296 -0
  18. package/build/cjs/DashboardLayout/DashboardSidebarSubNavigation.js +185 -0
  19. package/build/cjs/DashboardLayout/ThemeSwitcher.js +84 -0
  20. package/build/cjs/DashboardLayout/TitleBar.d.ts +2 -0
  21. package/build/cjs/DashboardLayout/TitleBar.js +57 -0
  22. package/build/cjs/DashboardLayout/ToolbarActions.js +11 -0
  23. package/build/cjs/DashboardLayout/index.js +19 -0
  24. package/build/cjs/DashboardLayout/utils.js +20 -0
  25. package/build/{PageContainer → cjs/PageContainer}/PageContainer.d.ts +4 -0
  26. package/build/cjs/PageContainer/PageContainer.js +133 -0
  27. package/build/cjs/PageContainer/PageContainer.test.js +128 -0
  28. package/build/cjs/PageContainer/PageContainerToolbar.js +26 -0
  29. package/build/cjs/PageContainer/PageContainerToolbar.test.js +15 -0
  30. package/build/cjs/PageContainer/index.js +18 -0
  31. package/build/cjs/index.js +24 -0
  32. package/build/cjs/nextjs/AppProvider.js +18 -0
  33. package/build/cjs/nextjs/AppProvider.test.js +71 -0
  34. package/build/cjs/nextjs/AppProviderNextApp.js +63 -0
  35. package/build/cjs/nextjs/AppProviderNextPages.js +73 -0
  36. package/build/cjs/nextjs/index.js +17 -0
  37. package/build/cjs/persistence/codec.js +60 -0
  38. package/build/cjs/persistence/index.js +17 -0
  39. package/build/cjs/persistence/useStorageState.js +153 -0
  40. package/build/cjs/persistence/useStorageState.test.js +63 -0
  41. package/build/cjs/react-router-dom/AppProvider.js +64 -0
  42. package/build/cjs/react-router-dom/AppProvider.test.js +14 -0
  43. package/build/cjs/react-router-dom/index.js +17 -0
  44. package/build/cjs/shared/Link.js +55 -0
  45. package/build/cjs/shared/components.js +30 -0
  46. package/build/cjs/shared/context.js +46 -0
  47. package/build/cjs/shared/locales/LocaleContext.js +71 -0
  48. package/build/cjs/shared/navigation.js +151 -0
  49. package/build/cjs/useActivePage/index.js +17 -0
  50. package/build/cjs/useActivePage/useActivePage.js +83 -0
  51. package/build/cjs/useLocalStorageState/index.js +17 -0
  52. package/build/cjs/useLocalStorageState/useLocalStorageState.js +17 -0
  53. package/build/cjs/useSessionStorageState/index.js +17 -0
  54. package/build/cjs/useSessionStorageState/useSessionStorageState.js +17 -0
  55. package/build/cjs/utils/collections.js +53 -0
  56. package/build/cjs/utils/describeConformance.js +6 -0
  57. package/build/cjs/utils/events.js +58 -0
  58. package/build/cjs/utils/hooks/index.js +10 -0
  59. package/build/cjs/utils/hooks/useBoolean.js +47 -0
  60. package/build/cjs/utils/hooks/useDebounced.js +64 -0
  61. package/build/cjs/utils/hooks/useDebouncedHandler.js +77 -0
  62. package/build/cjs/utils/hooks/useLatest.js +44 -0
  63. package/build/cjs/utils/hooks/usePageTitle.js +49 -0
  64. package/build/cjs/utils/hooks/useSsr.js +52 -0
  65. package/build/cjs/utils/hooks/useStorageState.js +86 -0
  66. package/build/cjs/utils/warnOnce.js +14 -0
  67. package/build/mjs/Account/Account.d.ts +63 -0
  68. package/build/mjs/Account/Account.test.d.ts +1 -0
  69. package/build/mjs/Account/AccountPopoverFooter.d.ts +6 -0
  70. package/build/mjs/Account/AccountPopoverHeader.d.ts +6 -0
  71. package/build/mjs/Account/AccountPreview.d.ts +64 -0
  72. package/build/mjs/Account/AccountPreview.test.d.ts +1 -0
  73. package/build/mjs/Account/SignInButton.d.ts +2 -0
  74. package/build/mjs/Account/SignOutButton.d.ts +3 -0
  75. package/build/mjs/Account/index.js +6 -0
  76. package/build/mjs/AppProvider/AppProvider.d.ts +105 -0
  77. package/build/mjs/AppProvider/AppProvider.test.d.ts +4 -0
  78. package/build/mjs/AppProvider/AppProviderComponent.d.ts +14 -0
  79. package/build/mjs/AppProvider/AppThemeProvider.d.ts +12 -0
  80. package/build/mjs/DashboardLayout/DashboardLayout.d.ts +91 -0
  81. package/build/{DashboardLayout → mjs/DashboardLayout}/DashboardLayout.js +9 -10
  82. package/build/mjs/DashboardLayout/DashboardLayout.test.d.ts +1 -0
  83. package/build/mjs/DashboardLayout/DashboardSidebarSubNavigation.d.ts +16 -0
  84. package/build/mjs/DashboardLayout/ThemeSwitcher.d.ts +5 -0
  85. package/build/mjs/DashboardLayout/TitleBar.d.ts +2 -0
  86. package/build/mjs/DashboardLayout/ToolbarActions.d.ts +5 -0
  87. package/build/mjs/DashboardLayout/index.d.ts +2 -0
  88. package/build/mjs/DashboardLayout/utils.d.ts +8 -0
  89. package/build/mjs/PageContainer/PageContainer.d.ts +61 -0
  90. package/build/{PageContainer → mjs/PageContainer}/PageContainer.js +8 -4
  91. package/build/mjs/PageContainer/PageContainer.test.d.ts +1 -0
  92. package/build/mjs/PageContainer/PageContainerToolbar.d.ts +16 -0
  93. package/build/mjs/PageContainer/PageContainerToolbar.test.d.ts +1 -0
  94. package/build/mjs/PageContainer/index.js +2 -0
  95. package/build/mjs/index.js +8 -0
  96. package/build/mjs/nextjs/AppProvider.d.ts +6 -0
  97. package/build/mjs/nextjs/AppProvider.test.d.ts +1 -0
  98. package/build/mjs/nextjs/AppProviderNextApp.d.ts +5 -0
  99. package/build/mjs/nextjs/AppProviderNextPages.d.ts +5 -0
  100. package/build/mjs/nextjs/index.js +1 -0
  101. package/build/mjs/persistence/codec.d.ts +47 -0
  102. package/build/mjs/persistence/index.js +1 -0
  103. package/build/mjs/persistence/useStorageState.d.ts +50 -0
  104. package/build/mjs/persistence/useStorageState.test.d.ts +1 -0
  105. package/build/mjs/react-router-dom/AppProvider.d.ts +6 -0
  106. package/build/mjs/react-router-dom/AppProvider.test.d.ts +1 -0
  107. package/build/mjs/react-router-dom/index.d.ts +1 -0
  108. package/build/mjs/react-router-dom/index.js +1 -0
  109. package/build/mjs/shared/Link.d.ts +8 -0
  110. package/build/mjs/shared/components.d.ts +5 -0
  111. package/build/mjs/shared/context.d.ts +12 -0
  112. package/build/mjs/shared/locales/LocaleContext.d.ts +56 -0
  113. package/build/mjs/shared/navigation.d.ts +16 -0
  114. package/build/mjs/useActivePage/index.js +1 -0
  115. package/build/mjs/useActivePage/useActivePage.d.ts +8 -0
  116. package/build/mjs/useLocalStorageState/index.js +1 -0
  117. package/build/mjs/useLocalStorageState/useLocalStorageState.d.ts +2 -0
  118. package/build/mjs/useSessionStorageState/index.js +1 -0
  119. package/build/mjs/useSessionStorageState/useSessionStorageState.d.ts +2 -0
  120. package/build/mjs/utils/collections.d.ts +44 -0
  121. package/build/mjs/utils/describeConformance.d.ts +7 -0
  122. package/build/mjs/utils/events.d.ts +27 -0
  123. package/build/mjs/utils/hooks/index.js +2 -0
  124. package/build/mjs/utils/hooks/useBoolean.d.ts +11 -0
  125. package/build/mjs/utils/hooks/useDebounced.d.ts +8 -0
  126. package/build/mjs/utils/hooks/useDebouncedHandler.d.ts +12 -0
  127. package/build/mjs/utils/hooks/useLatest.d.ts +6 -0
  128. package/build/mjs/utils/hooks/usePageTitle.d.ts +4 -0
  129. package/build/mjs/utils/hooks/useSsr.d.ts +4 -0
  130. package/build/mjs/utils/hooks/useStorageState.d.ts +10 -0
  131. package/build/mjs/utils/warnOnce.d.ts +5 -0
  132. package/package.json +33 -23
  133. package/src/DashboardLayout/DashboardLayout.tsx +13 -12
  134. package/src/PageContainer/PageContainer.tsx +12 -4
  135. package/tsconfig.cjs.json +20 -0
  136. package/tsconfig.json +2 -2
  137. package/build/DashboardLayout/TitleBar.d.ts +0 -2
  138. /package/build/{Account → cjs/Account}/Account.d.ts +0 -0
  139. /package/build/{Account → cjs/Account}/Account.test.d.ts +0 -0
  140. /package/build/{Account → cjs/Account}/AccountPopoverFooter.d.ts +0 -0
  141. /package/build/{Account → cjs/Account}/AccountPopoverHeader.d.ts +0 -0
  142. /package/build/{Account → cjs/Account}/AccountPreview.d.ts +0 -0
  143. /package/build/{Account → cjs/Account}/AccountPreview.test.d.ts +0 -0
  144. /package/build/{Account → cjs/Account}/SignInButton.d.ts +0 -0
  145. /package/build/{Account → cjs/Account}/SignOutButton.d.ts +0 -0
  146. /package/build/{Account → cjs/Account}/index.d.ts +0 -0
  147. /package/build/{AppProvider → cjs/AppProvider}/AppProvider.d.ts +0 -0
  148. /package/build/{AppProvider → cjs/AppProvider}/AppProvider.test.d.ts +0 -0
  149. /package/build/{AppProvider → cjs/AppProvider}/AppProviderComponent.d.ts +0 -0
  150. /package/build/{AppProvider → cjs/AppProvider}/AppThemeProvider.d.ts +0 -0
  151. /package/build/{AppProvider → cjs/AppProvider}/index.d.ts +0 -0
  152. /package/build/{DashboardLayout → cjs/DashboardLayout}/DashboardLayout.d.ts +0 -0
  153. /package/build/{DashboardLayout → cjs/DashboardLayout}/DashboardLayout.test.d.ts +0 -0
  154. /package/build/{DashboardLayout → cjs/DashboardLayout}/DashboardSidebarSubNavigation.d.ts +0 -0
  155. /package/build/{DashboardLayout → cjs/DashboardLayout}/ThemeSwitcher.d.ts +0 -0
  156. /package/build/{DashboardLayout → cjs/DashboardLayout}/ToolbarActions.d.ts +0 -0
  157. /package/build/{DashboardLayout → cjs/DashboardLayout}/index.d.ts +0 -0
  158. /package/build/{DashboardLayout → cjs/DashboardLayout}/utils.d.ts +0 -0
  159. /package/build/{PageContainer → cjs/PageContainer}/PageContainer.test.d.ts +0 -0
  160. /package/build/{PageContainer → cjs/PageContainer}/PageContainerToolbar.d.ts +0 -0
  161. /package/build/{PageContainer → cjs/PageContainer}/PageContainerToolbar.test.d.ts +0 -0
  162. /package/build/{PageContainer → cjs/PageContainer}/index.d.ts +0 -0
  163. /package/build/{index.d.ts → cjs/index.d.ts} +0 -0
  164. /package/build/{nextjs → cjs/nextjs}/AppProvider.d.ts +0 -0
  165. /package/build/{nextjs → cjs/nextjs}/AppProvider.test.d.ts +0 -0
  166. /package/build/{nextjs → cjs/nextjs}/AppProviderNextApp.d.ts +0 -0
  167. /package/build/{nextjs → cjs/nextjs}/AppProviderNextPages.d.ts +0 -0
  168. /package/build/{nextjs → cjs/nextjs}/index.d.ts +0 -0
  169. /package/build/{persistence → cjs/persistence}/codec.d.ts +0 -0
  170. /package/build/{persistence → cjs/persistence}/index.d.ts +0 -0
  171. /package/build/{persistence → cjs/persistence}/useStorageState.d.ts +0 -0
  172. /package/build/{persistence → cjs/persistence}/useStorageState.test.d.ts +0 -0
  173. /package/build/{react-router-dom → cjs/react-router-dom}/AppProvider.d.ts +0 -0
  174. /package/build/{react-router-dom → cjs/react-router-dom}/AppProvider.test.d.ts +0 -0
  175. /package/build/{react-router-dom → cjs/react-router-dom}/index.d.ts +0 -0
  176. /package/build/{shared → cjs/shared}/Link.d.ts +0 -0
  177. /package/build/{shared → cjs/shared}/components.d.ts +0 -0
  178. /package/build/{shared → cjs/shared}/context.d.ts +0 -0
  179. /package/build/{shared → cjs/shared}/locales/LocaleContext.d.ts +0 -0
  180. /package/build/{shared → cjs/shared}/navigation.d.ts +0 -0
  181. /package/build/{useActivePage → cjs/useActivePage}/index.d.ts +0 -0
  182. /package/build/{useActivePage → cjs/useActivePage}/useActivePage.d.ts +0 -0
  183. /package/build/{useLocalStorageState → cjs/useLocalStorageState}/index.d.ts +0 -0
  184. /package/build/{useLocalStorageState → cjs/useLocalStorageState}/useLocalStorageState.d.ts +0 -0
  185. /package/build/{useSessionStorageState → cjs/useSessionStorageState}/index.d.ts +0 -0
  186. /package/build/{useSessionStorageState → cjs/useSessionStorageState}/useSessionStorageState.d.ts +0 -0
  187. /package/build/{utils → cjs/utils}/collections.d.ts +0 -0
  188. /package/build/{utils → cjs/utils}/describeConformance.d.ts +0 -0
  189. /package/build/{utils → cjs/utils}/events.d.ts +0 -0
  190. /package/build/{utils → cjs/utils}/hooks/index.d.ts +0 -0
  191. /package/build/{utils → cjs/utils}/hooks/useBoolean.d.ts +0 -0
  192. /package/build/{utils → cjs/utils}/hooks/useDebounced.d.ts +0 -0
  193. /package/build/{utils → cjs/utils}/hooks/useDebouncedHandler.d.ts +0 -0
  194. /package/build/{utils → cjs/utils}/hooks/useLatest.d.ts +0 -0
  195. /package/build/{utils → cjs/utils}/hooks/usePageTitle.d.ts +0 -0
  196. /package/build/{utils → cjs/utils}/hooks/useSsr.d.ts +0 -0
  197. /package/build/{utils → cjs/utils}/hooks/useStorageState.d.ts +0 -0
  198. /package/build/{utils → cjs/utils}/warnOnce.d.ts +0 -0
  199. /package/build/{Account → mjs/Account}/Account.js +0 -0
  200. /package/build/{Account → mjs/Account}/Account.test.js +0 -0
  201. /package/build/{Account → mjs/Account}/AccountPopoverFooter.js +0 -0
  202. /package/build/{Account → mjs/Account}/AccountPopoverHeader.js +0 -0
  203. /package/build/{Account → mjs/Account}/AccountPreview.js +0 -0
  204. /package/build/{Account → mjs/Account}/AccountPreview.test.js +0 -0
  205. /package/build/{Account → mjs/Account}/SignInButton.js +0 -0
  206. /package/build/{Account → mjs/Account}/SignOutButton.js +0 -0
  207. /package/build/{Account/index.js → mjs/Account/index.d.ts} +0 -0
  208. /package/build/{AppProvider → mjs/AppProvider}/AppProvider.js +0 -0
  209. /package/build/{AppProvider → mjs/AppProvider}/AppProvider.test.js +0 -0
  210. /package/build/{AppProvider → mjs/AppProvider}/AppProviderComponent.js +0 -0
  211. /package/build/{AppProvider → mjs/AppProvider}/AppThemeProvider.js +0 -0
  212. /package/build/{AppProvider/index.js → mjs/AppProvider/index.d.ts} +0 -0
  213. /package/build/{nextjs → mjs/AppProvider}/index.js +0 -0
  214. /package/build/{DashboardLayout → mjs/DashboardLayout}/DashboardLayout.test.js +0 -0
  215. /package/build/{DashboardLayout → mjs/DashboardLayout}/DashboardSidebarSubNavigation.js +0 -0
  216. /package/build/{DashboardLayout → mjs/DashboardLayout}/ThemeSwitcher.js +0 -0
  217. /package/build/{DashboardLayout → mjs/DashboardLayout}/TitleBar.js +0 -0
  218. /package/build/{DashboardLayout → mjs/DashboardLayout}/ToolbarActions.js +0 -0
  219. /package/build/{DashboardLayout → mjs/DashboardLayout}/index.js +0 -0
  220. /package/build/{DashboardLayout → mjs/DashboardLayout}/utils.js +0 -0
  221. /package/build/{PageContainer → mjs/PageContainer}/PageContainer.test.js +0 -0
  222. /package/build/{PageContainer → mjs/PageContainer}/PageContainerToolbar.js +0 -0
  223. /package/build/{PageContainer → mjs/PageContainer}/PageContainerToolbar.test.js +0 -0
  224. /package/build/{PageContainer/index.js → mjs/PageContainer/index.d.ts} +0 -0
  225. /package/build/{index.js → mjs/index.d.ts} +0 -0
  226. /package/build/{nextjs → mjs/nextjs}/AppProvider.js +0 -0
  227. /package/build/{nextjs → mjs/nextjs}/AppProvider.test.js +0 -0
  228. /package/build/{nextjs → mjs/nextjs}/AppProviderNextApp.js +0 -0
  229. /package/build/{nextjs → mjs/nextjs}/AppProviderNextPages.js +0 -0
  230. /package/build/{react-router-dom/index.js → mjs/nextjs/index.d.ts} +0 -0
  231. /package/build/{persistence → mjs/persistence}/codec.js +0 -0
  232. /package/build/{persistence/index.js → mjs/persistence/index.d.ts} +0 -0
  233. /package/build/{persistence → mjs/persistence}/useStorageState.js +0 -0
  234. /package/build/{persistence → mjs/persistence}/useStorageState.test.js +0 -0
  235. /package/build/{react-router-dom → mjs/react-router-dom}/AppProvider.js +0 -0
  236. /package/build/{react-router-dom → mjs/react-router-dom}/AppProvider.test.js +0 -0
  237. /package/build/{shared → mjs/shared}/Link.js +0 -0
  238. /package/build/{shared → mjs/shared}/components.js +0 -0
  239. /package/build/{shared → mjs/shared}/context.js +0 -0
  240. /package/build/{shared → mjs/shared}/locales/LocaleContext.js +0 -0
  241. /package/build/{shared → mjs/shared}/navigation.js +0 -0
  242. /package/build/{useActivePage/index.js → mjs/useActivePage/index.d.ts} +0 -0
  243. /package/build/{useActivePage → mjs/useActivePage}/useActivePage.js +0 -0
  244. /package/build/{useLocalStorageState/index.js → mjs/useLocalStorageState/index.d.ts} +0 -0
  245. /package/build/{useLocalStorageState → mjs/useLocalStorageState}/useLocalStorageState.js +0 -0
  246. /package/build/{useSessionStorageState/index.js → mjs/useSessionStorageState/index.d.ts} +0 -0
  247. /package/build/{useSessionStorageState → mjs/useSessionStorageState}/useSessionStorageState.js +0 -0
  248. /package/build/{utils → mjs/utils}/collections.js +0 -0
  249. /package/build/{utils → mjs/utils}/describeConformance.js +0 -0
  250. /package/build/{utils → mjs/utils}/events.js +0 -0
  251. /package/build/{utils/hooks/index.js → mjs/utils/hooks/index.d.ts} +0 -0
  252. /package/build/{utils → mjs/utils}/hooks/useBoolean.js +0 -0
  253. /package/build/{utils → mjs/utils}/hooks/useDebounced.js +0 -0
  254. /package/build/{utils → mjs/utils}/hooks/useDebouncedHandler.js +0 -0
  255. /package/build/{utils → mjs/utils}/hooks/useLatest.js +0 -0
  256. /package/build/{utils → mjs/utils}/hooks/usePageTitle.js +0 -0
  257. /package/build/{utils → mjs/utils}/hooks/useSsr.js +0 -0
  258. /package/build/{utils → mjs/utils}/hooks/useStorageState.js +0 -0
  259. /package/build/{utils → mjs/utils}/warnOnce.js +0 -0
  260. /package/{vite.config.ts → vite.config.mts} +0 -0
@@ -0,0 +1,50 @@
1
+ import * as React from "react";
2
+ import { Codec } from "./codec";
3
+ export type StorageStateInitializer<T> = () => T | null;
4
+ export type UseStorageStateHookResult<T> = [
5
+ T | null,
6
+ React.Dispatch<React.SetStateAction<T | null>>
7
+ ];
8
+ export declare function useStorageStateServer<T = string>(): UseStorageStateHookResult<T>;
9
+ export interface DefaultStorageStateoptions<T = string> {
10
+ codec?: Codec<T>;
11
+ }
12
+ export interface StorageStateOptions<T> extends DefaultStorageStateoptions<T> {
13
+ codec: Codec<T>;
14
+ }
15
+ /**
16
+ * Sync state to local storage so that it persists through a page refresh. Usage is
17
+ * similar to useState except we pass in a storage key so that we can default
18
+ * to that value on page load instead of the specified initial value.
19
+ *
20
+ * Since the storage API isn't available in server-rendering environments, we
21
+ * return null during SSR and hydration.
22
+ */
23
+ export declare function useStorageState(area: Storage, key: string | null, initializer?: string | null | StorageStateInitializer<string>, options?: DefaultStorageStateoptions): UseStorageStateHookResult<string>;
24
+ export declare function useStorageState<T>(area: Storage, key: string | null, initializer: T | null | StorageStateInitializer<T>, options: StorageStateOptions<T>): UseStorageStateHookResult<T>;
25
+ export interface UseStorageState {
26
+ /**
27
+ * Sync state to local or session storage so that it persists through a page refresh. Usage is
28
+ * similar to useState except we pass in a storage key that uniquely identifies the value.
29
+ * @param key The key to use for storing the value in local or session storage.
30
+ * @param initializer The initial value to use if the key is not present in storage.
31
+ * @param options Additional options for the storage state.
32
+ */
33
+ (key: string | null, initializer?: string | null | StorageStateInitializer<string>, options?: DefaultStorageStateoptions): UseStorageStateHookResult<string>;
34
+ /**
35
+ * Sync state to local or session storage so that it persists through a page refresh. Usage is
36
+ * similar to useState except we pass in a storage key that uniquely identifies the value.
37
+ * @param key The key to use for storing the value in local or session storage.
38
+ * @param initializer The initial value to use if the key is not present in storage.
39
+ * @param options Additional options for the storage state.
40
+ */
41
+ <T>(key: string | null, initializer: T | null | StorageStateInitializer<T>, options: StorageStateOptions<T>): UseStorageStateHookResult<T>;
42
+ /**
43
+ * Sync state to local or session storage so that it persists through a page refresh. Usage is
44
+ * similar to useState except we pass in a storage key that uniquely identifies the value.
45
+ * @param key The key to use for storing the value in local or session storage.
46
+ * @param initializer The initial value to use if the key is not present in storage.
47
+ * @param options Additional options for the storage state.
48
+ */
49
+ <T>(key: string | null, initializer?: T | null | StorageStateInitializer<T>, options?: StorageStateOptions<T>): UseStorageStateHookResult<T>;
50
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { type AppProviderProps } from "../AppProvider";
2
+ /**
3
+ * @ignore - internal component.
4
+ */
5
+ declare function AppProvider(props: AppProviderProps): import("react/jsx-runtime").JSX.Element;
6
+ export { AppProvider };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./AppProvider";
@@ -0,0 +1 @@
1
+ export * from "./AppProvider";
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ /**
3
+ * @ignore - internal component.
4
+ */
5
+ export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
6
+ history?: "auto" | "push" | "replace";
7
+ }
8
+ export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,5 @@
1
+ export interface ErrorOverlayProps {
2
+ error?: unknown;
3
+ }
4
+ export declare function ErrorOverlay({ error }: ErrorOverlayProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function LoadingOverlay(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import type { PaletteMode } from "@mui/material";
3
+ import type { Branding, Navigation, Router } from "../AppProvider";
4
+ export declare const BrandingContext: React.Context<Branding | null>;
5
+ export declare const NavigationContext: React.Context<Navigation>;
6
+ export declare const PaletteModeContext: React.Context<{
7
+ paletteMode: PaletteMode;
8
+ setPaletteMode: (mode: PaletteMode) => void;
9
+ isDualTheme: boolean;
10
+ }>;
11
+ export declare const RouterContext: React.Context<Router | null>;
12
+ export declare const WindowContext: React.Context<Window | undefined>;
@@ -0,0 +1,56 @@
1
+ import * as React from "react";
2
+ declare const DEFAULT_LOCALE_TEXT: {
3
+ signInLabel: string;
4
+ signOutLabel: string;
5
+ accountIconButtonAriaLabel: string;
6
+ expandMenuTitle: string;
7
+ expandNavMenuAriaLabel: string;
8
+ collapseMenuTitle: string;
9
+ collapseNavMenuAriaLabel: string;
10
+ switchModeTitle: string;
11
+ darkModeTitle: string;
12
+ lightModeTitle: string;
13
+ switchThemeModeAriaLabel: string;
14
+ switchToDarkModeAriaLabel: string;
15
+ switchToLightModeAriaLabel: string;
16
+ };
17
+ export type LocaleContextType = typeof DEFAULT_LOCALE_TEXT;
18
+ export declare const LocaleContext: React.Context<{
19
+ signInLabel: string;
20
+ signOutLabel: string;
21
+ accountIconButtonAriaLabel: string;
22
+ expandMenuTitle: string;
23
+ expandNavMenuAriaLabel: string;
24
+ collapseMenuTitle: string;
25
+ collapseNavMenuAriaLabel: string;
26
+ switchModeTitle: string;
27
+ darkModeTitle: string;
28
+ lightModeTitle: string;
29
+ switchThemeModeAriaLabel: string;
30
+ switchToDarkModeAriaLabel: string;
31
+ switchToLightModeAriaLabel: string;
32
+ }>;
33
+ export interface LocaleProviderProps {
34
+ localeText?: Partial<LocaleContextType>;
35
+ children: React.ReactNode;
36
+ }
37
+ /**
38
+ * @ignore - internal component.
39
+ */
40
+ export declare function LocaleProvider({ localeText, children }: LocaleProviderProps): import("react/jsx-runtime").JSX.Element;
41
+ export declare function useLocaleText(): {
42
+ signInLabel: string;
43
+ signOutLabel: string;
44
+ accountIconButtonAriaLabel: string;
45
+ expandMenuTitle: string;
46
+ expandNavMenuAriaLabel: string;
47
+ collapseMenuTitle: string;
48
+ collapseNavMenuAriaLabel: string;
49
+ switchModeTitle: string;
50
+ darkModeTitle: string;
51
+ lightModeTitle: string;
52
+ switchThemeModeAriaLabel: string;
53
+ switchToDarkModeAriaLabel: string;
54
+ switchToLightModeAriaLabel: string;
55
+ };
56
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { Navigation, NavigationItem, NavigationPageItem, NavigationSubheaderItem } from "../AppProvider";
2
+ export declare const getItemKind: (item: NavigationItem) => "page" | "header" | "divider";
3
+ export declare const isPageItem: (item: NavigationItem) => item is NavigationPageItem;
4
+ export declare const getItemTitle: (item: NavigationPageItem | NavigationSubheaderItem) => string;
5
+ export declare function getPageItemFullPath(basePath: string, navigationItem: NavigationPageItem): string;
6
+ export declare function isPageItemSelected(navigationItem: NavigationPageItem, basePath: string, pathname: string): boolean;
7
+ export declare function hasSelectedNavigationChildren(navigationItem: NavigationItem, basePath: string, pathname: string): boolean;
8
+ /**
9
+ * Matches a path against the navigation to find the active page. i.e. the page that should be
10
+ * marked as selected in the navigation.
11
+ */
12
+ export declare function matchPath(navigation: Navigation, path: string): NavigationPageItem | null;
13
+ /**
14
+ * Gets the path for a specific navigation page item.
15
+ */
16
+ export declare function getItemPath(navigation: Navigation, item: NavigationPageItem): string;
@@ -0,0 +1 @@
1
+ export * from "./useActivePage";
@@ -0,0 +1,8 @@
1
+ import type { Breadcrumb } from "../PageContainer";
2
+ export interface ActivePage {
3
+ title: string;
4
+ path: string;
5
+ sourcePath: string;
6
+ breadcrumbs: Breadcrumb[];
7
+ }
8
+ export declare function useActivePage(): ActivePage | null;
@@ -0,0 +1 @@
1
+ export * from "./useLocalStorageState";
@@ -0,0 +1,2 @@
1
+ import { UseStorageState } from "../persistence";
2
+ export declare const useLocalStorageState: UseStorageState;
@@ -0,0 +1 @@
1
+ export * from "./useSessionStorageState";
@@ -0,0 +1,2 @@
1
+ import { UseStorageState } from "../persistence";
2
+ export declare const useSessionStorageState: UseStorageState;
@@ -0,0 +1,44 @@
1
+ export declare function asArray<T>(maybeArray: T | T[]): T[];
2
+ type PropertiesOf<P> = Extract<keyof P, string>;
3
+ type Require<T, K extends keyof T> = T & {
4
+ [P in K]-?: T[P];
5
+ };
6
+ type Ensure<U, K extends PropertyKey> = K extends keyof U ? Require<U, K> : U & Record<K, unknown>;
7
+ /**
8
+ * Type aware version of Object.protoype.hasOwnProperty.
9
+ * See https://fettblog.eu/typescript-hasownproperty/
10
+ */
11
+ export declare function hasOwnProperty<X extends {}, Y extends PropertyKey>(obj: X, prop: Y): obj is Ensure<X, Y>;
12
+ /**
13
+ * Maps `obj` to a new object. The `mapper` function receives an entry array of key and value and
14
+ * is allowed to manipulate both. It can also return `null` to omit a property from the result.
15
+ */
16
+ export declare function mapProperties<P, L extends PropertyKey, U>(obj: P, mapper: <K extends PropertiesOf<P>>(old: [K, P[K]]) => [L, U] | null): Record<L, U>;
17
+ /**
18
+ * Maps an objects' property keys. The result is a new object with the mapped keys, but the same values.
19
+ */
20
+ export declare function mapKeys<U>(obj: Record<string, U>, mapper: (old: string) => string): Record<string, U>;
21
+ /**
22
+ * Maps an objects' property values. The result is a new object with the same keys, but mapped values.
23
+ */
24
+ export declare function mapValues<P, V>(obj: P, mapper: (old: P[PropertiesOf<P>], key: PropertiesOf<P>) => V): Record<PropertiesOf<P>, V>;
25
+ /**
26
+ * Filters an objects' property values. Similar to `array.filter` but for objects. The result is a new
27
+ * object with all the properties removed for which `filter` returned `false`.
28
+ */
29
+ export declare function filterValues<K extends PropertyKey, P, Q extends P>(obj: Record<K, P>, filter: (old: P) => old is Q): Record<K, Q>;
30
+ export declare function filterValues<P>(obj: P, filter: (old: P[keyof P]) => boolean): Partial<P>;
31
+ export declare function filterValues<U>(obj: Record<string, U>, filter: (old: U) => boolean): Record<string, U>;
32
+ /**
33
+ * Filters an objects' property keys. Similar to `array.filter` but for objects. The result is a new
34
+ * object with all the properties removed for which `filter` returned `false`.
35
+ */
36
+ export declare function filterKeys<P>(obj: P, filter: (old: keyof P) => boolean): Partial<P>;
37
+ export declare function filterKeys<U>(obj: Record<string, U>, filter: (old: string) => boolean): Record<string, U>;
38
+ /**
39
+ * Compares the properties of two objects. Returns `true` if all properties are strictly equal, `false`
40
+ * otherwise.
41
+ * Pass a subset of properties to only compare those.
42
+ */
43
+ export declare function equalProperties<P extends object>(obj1: P, obj2: P, subset?: (keyof P)[]): boolean;
44
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ export interface ConformanceOptions {
3
+ refInstanceof?: unknown;
4
+ inheritComponent?: React.ElementType;
5
+ skip?: Array<"themeDefaultProps">;
6
+ }
7
+ export default function describeConformance(minimalElement: React.ReactElement<unknown>, getOptions: () => ConformanceOptions): void;
@@ -0,0 +1,27 @@
1
+ export type EventName = string | symbol;
2
+ export type EventHandlers = Record<EventName, unknown>;
3
+ export type EventHandler<T extends EventHandlers, K extends keyof T = keyof T> = (event: T[K]) => void;
4
+ export type AllEventsHandler<T extends EventHandlers, K extends keyof T = keyof T> = (type: K, event: T[K]) => void;
5
+ /**
6
+ * Lightweight event emitter
7
+ */
8
+ export declare class Emitter<T extends EventHandlers = {}> {
9
+ private handlers;
10
+ /**
11
+ * Add a listener for an event
12
+ */
13
+ on(name: "*", handler: AllEventsHandler<T>): void;
14
+ on<K extends keyof T>(name: K, handler: EventHandler<T, K>): void;
15
+ /**
16
+ * Remove a listener from an event
17
+ */
18
+ off<K extends keyof T>(name: K, handler: EventHandler<T, K>): void;
19
+ /**
20
+ * Subscribe to an event and return an unsubscribe function.
21
+ */
22
+ subscribe<K extends keyof T>(name: K, handler: EventHandler<T, K>): () => void;
23
+ /**
24
+ * Emit an event.
25
+ */
26
+ emit<K extends keyof T>(name: K, event: T[K]): void;
27
+ }
@@ -0,0 +1,2 @@
1
+ export { default as useBoolean } from "./useBoolean";
2
+ export { default as usePageTitle } from "./usePageTitle";
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ /**
3
+ * A utility with shortcuts to manipulate boolean values.
4
+ */
5
+ export default function useBoolean(initialValue: boolean): {
6
+ value: boolean;
7
+ setValue: React.Dispatch<React.SetStateAction<boolean>>;
8
+ toggle: () => void;
9
+ setTrue: () => void;
10
+ setFalse: () => void;
11
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This hook allows you to debounce any fast changing value. The debounced value will only
3
+ * reflect the latest value when the useDebounce hook has not been called for the specified
4
+ * time period.
5
+ *
6
+ * Inspired by https://usehooks.com/useDebounce/
7
+ */
8
+ export default function useDebounced<T>(value: T, delay: number): T;
@@ -0,0 +1,12 @@
1
+ interface Handler<P extends unknown[]> {
2
+ (...params: P): void;
3
+ }
4
+ /**
5
+ * Creates a debounced version of the handler that is passed. The invocation of [fn] is
6
+ * delayed for [delay] milliseconds from the last invocation of the debounced function.
7
+ *
8
+ * This implementation adds on the lodash implementation in that it handles updates to the
9
+ * delay value.
10
+ */
11
+ export default function useDebouncedHandler<P extends unknown[]>(fn: Handler<P>, delay: number): Handler<P>;
12
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns the latest non-null, non-undefined value that has been passed to it.
3
+ */
4
+ declare function useLatest<T>(value: T): T;
5
+ declare function useLatest<T>(value: T | null | undefined): T | null | undefined;
6
+ export default useLatest;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Sets the current document title.
3
+ */
4
+ export default function usePageTitle(title: string): void;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Returns true when serverside rendering, or when hydrating.
3
+ */
4
+ export default function useSsr(): boolean;
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ type Initializer<T> = () => T;
3
+ type UseStorageStateHookResult<T> = [
4
+ T,
5
+ React.Dispatch<React.SetStateAction<T>>
6
+ ];
7
+ declare function useStorageStateServer(kind: "session" | "local", key: string, initializer: string | Initializer<string>): UseStorageStateHookResult<string>;
8
+ declare function useStorageStateServer(kind: "session" | "local", key: string, initializer?: string | null | Initializer<string | null>): UseStorageStateHookResult<string | null>;
9
+ declare const _default: typeof useStorageStateServer;
10
+ export default _default;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Warns only once for a specific message.
3
+ * @param msg The message to warn.
4
+ */
5
+ export default function warnOnce(msg: string): void;
package/package.json CHANGED
@@ -1,23 +1,25 @@
1
1
  {
2
2
  "name": "@etsoo/toolpad",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "author": "ETSOO",
5
5
  "description": "Dashboard framework extention based on Toolpad Core",
6
- "main": "build/index.js",
7
- "module": "build/index.js",
8
- "type": "module",
6
+ "main": "build/cjs/index.js",
7
+ "module": "build/mjs/index.js",
9
8
  "exports": {
10
9
  ".": {
11
- "types": "./build/index.d.ts",
12
- "import": "./build/index.js"
10
+ "types": "./build/mjs/index.d.ts",
11
+ "import": "./build/mjs/index.js",
12
+ "require": "./build/cjs/index.js"
13
13
  },
14
14
  "./nextjs": {
15
- "types": "./build/nextjs/index.d.ts",
16
- "import": "./build/nextjs/index.js"
15
+ "types": "./build/mjs/nextjs/index.d.ts",
16
+ "import": "./build/mjs/nextjs/index.js",
17
+ "require": "./build/cjs/nextjs/index.js"
17
18
  },
18
19
  "./react-router-dom": {
19
- "types": "./build/react-router-dom/index.d.ts",
20
- "import": "./build/react-router-dom/index.js"
20
+ "types": "./build/mjs/react-router-dom/index.d.ts",
21
+ "import": "./build/mjs/react-router-dom/index.js",
22
+ "require": "./build/cjs/react-router-dom/index.js"
21
23
  }
22
24
  },
23
25
  "sideEffects": false,
@@ -38,38 +40,46 @@
38
40
  },
39
41
  "homepage": "https://github.com/ETSOO/etsoo-toolpad#readme",
40
42
  "scripts": {
41
- "build": "tsc",
43
+ "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
42
44
  "test": "vitest",
43
45
  "testb": "vitest --browser.enabled"
44
46
  },
45
47
  "dependencies": {
46
- "@babel/runtime": "^7.26.0",
47
48
  "@emotion/react": "^11.14.0",
48
49
  "@emotion/styled": "^11.14.0",
50
+ "@mui/icons-material": "6.3.1",
51
+ "@mui/material": "6.3.1",
49
52
  "@mui/utils": "6.3.1",
50
53
  "invariant": "2.2.4",
51
54
  "path-to-regexp": "6.3.0",
52
- "react": "^18.3.1"
53
- },
54
- "overrides": {
55
- "react": "$react",
56
- "@emotion/react": "$@emotion/react"
55
+ "react": "^19.0.0"
57
56
  },
58
57
  "devDependencies": {
59
- "@mui/icons-material": "6.3.1",
60
- "@mui/material": "6.3.1",
58
+ "@babel/cli": "^7.26.4",
59
+ "@babel/core": "^7.26.0",
60
+ "@babel/plugin-transform-runtime": "^7.25.9",
61
+ "@babel/preset-env": "^7.26.0",
62
+ "@babel/runtime-corejs3": "^7.26.0",
61
63
  "@testing-library/jest-dom": "^6.6.3",
62
64
  "@testing-library/react": "^16.1.0",
63
65
  "@types/invariant": "2.2.37",
64
- "@types/react": "18.3.12",
65
- "@types/react-dom": "18.3.1",
66
+ "@types/react": "19.0.4",
67
+ "@types/react-dom": "19.0.2",
66
68
  "@vitejs/plugin-react": "4.3.4",
67
69
  "@vitest/browser": "2.1.8",
68
- "jsdom": "^25.0.1",
69
- "next": "^15.0.3",
70
+ "jsdom": "^26.0.0",
71
+ "next": "^15.1.4",
70
72
  "next-router-mock": "^0.9.13",
71
73
  "playwright": "^1.49.1",
72
74
  "react-router-dom": "7.1.1",
73
75
  "vitest": "2.1.8"
76
+ },
77
+ "peerDependenciesMeta": {
78
+ "next": {
79
+ "optional": true
80
+ },
81
+ "react-router-dom": {
82
+ "optional": true
83
+ }
74
84
  }
75
85
  }
@@ -9,7 +9,6 @@ import Stack from "@mui/material/Stack";
9
9
  import Toolbar from "@mui/material/Toolbar";
10
10
  import Tooltip from "@mui/material/Tooltip";
11
11
  import useMediaQuery from "@mui/material/useMediaQuery";
12
- import type {} from "@mui/material/themeCssVarsAugmentation";
13
12
  import MenuIcon from "@mui/icons-material/Menu";
14
13
  import MenuOpenIcon from "@mui/icons-material/MenuOpen";
15
14
  import { NavigationContext, WindowContext } from "../shared/context";
@@ -24,15 +23,6 @@ import {
24
23
  import { TitleBar } from "./TitleBar";
25
24
  import { useLocaleText } from "../shared/locales/LocaleContext";
26
25
 
27
- const AppBar = styled(MuiAppBar)(({ theme }) => ({
28
- borderWidth: 0,
29
- borderBottomWidth: 1,
30
- borderStyle: "solid",
31
- borderColor: (theme.vars ?? theme).palette.divider,
32
- boxShadow: "none",
33
- zIndex: theme.zIndex.drawer + 1
34
- }));
35
-
36
26
  export interface SidebarFooterProps {
37
27
  mini: boolean;
38
28
  }
@@ -337,7 +327,18 @@ function DashboardLayout(props: DashboardLayoutProps) {
337
327
  ...sx
338
328
  }}
339
329
  >
340
- <AppBar color="inherit" position="absolute">
330
+ <MuiAppBar
331
+ color="inherit"
332
+ position="absolute"
333
+ sx={(theme) => ({
334
+ borderWidth: 0,
335
+ borderBottomWidth: 1,
336
+ borderStyle: "solid",
337
+ borderColor: theme.palette.divider,
338
+ boxShadow: "none",
339
+ zIndex: theme.zIndex.drawer + 1
340
+ })}
341
+ >
341
342
  <Toolbar
342
343
  sx={{ backgroundColor: "inherit", mx: { xs: -0.75, sm: -1.5 } }}
343
344
  >
@@ -381,7 +382,7 @@ function DashboardLayout(props: DashboardLayoutProps) {
381
382
  <ToolbarAccountSlot {...slotProps?.toolbarAccount} />
382
383
  </Stack>
383
384
  </Toolbar>
384
- </AppBar>
385
+ </MuiAppBar>
385
386
 
386
387
  {!hideNavigation ? (
387
388
  <React.Fragment>
@@ -79,10 +79,14 @@ export function PageDataContextProvider(
79
79
  props: React.PropsWithChildren<PageData>
80
80
  ) {
81
81
  // Destruct
82
- const { title, breadcrumbs, ...rest } = props;
82
+ const { title, page, breadcrumbs, ...rest } = props;
83
83
 
84
84
  // useReducer hook to manage state with our reducer function and initial state
85
- const [state, dispatch] = React.useReducer(reducer, { title, breadcrumbs });
85
+ const [state, dispatch] = React.useReducer(reducer, {
86
+ title,
87
+ page,
88
+ breadcrumbs
89
+ });
86
90
 
87
91
  // Provide the state and dispatch function to the context value
88
92
  return <PageDataContext.Provider value={{ state, dispatch }} {...rest} />;
@@ -90,6 +94,10 @@ export function PageDataContextProvider(
90
94
 
91
95
  export type PageContainerProps = React.PropsWithChildren<
92
96
  ContainerProps & {
97
+ /**
98
+ * The default title of the page.
99
+ */
100
+ defaultTitle?: string;
93
101
  /**
94
102
  * The components used for each slot inside.
95
103
  */
@@ -113,7 +121,7 @@ export type PageContainerProps = React.PropsWithChildren<
113
121
  * - [PageContainer API](https://mui.com/toolpad/core/api/page-container)
114
122
  */
115
123
  function PageContainer(props: PageContainerProps) {
116
- const { children, slots, slotProps, ...rest } = props;
124
+ const { children, defaultTitle, slots, slotProps, ...rest } = props;
117
125
 
118
126
  const loaded = React.useRef(false);
119
127
  const { state, dispatch } = React.useContext(PageDataContext);
@@ -129,7 +137,7 @@ function PageContainer(props: PageContainerProps) {
129
137
  }, [activePage?.sourcePath]);
130
138
 
131
139
  let resolvedBreadcrumbs = state.breadcrumbs ?? activePage?.breadcrumbs ?? [];
132
- const title = state.title ?? activePage?.title ?? "";
140
+ const title = state.title ?? defaultTitle ?? activePage?.title ?? "";
133
141
 
134
142
  if (state.page) {
135
143
  resolvedBreadcrumbs = [
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
+ "target": "ES2020",
5
+ "allowJs": false,
6
+ "module": "NodeNext",
7
+ "moduleResolution": "NodeNext",
8
+ "resolveJsonModule": true,
9
+ "isolatedModules": true,
10
+ "outDir": "./build/cjs",
11
+ "noEmit": false,
12
+ "declaration": true,
13
+ "strict": true,
14
+ "esModuleInterop": true,
15
+ "skipLibCheck": true,
16
+ "jsx": "react-jsx",
17
+ "forceConsistentCasingInFileNames": true
18
+ },
19
+ "include": ["src"]
20
+ }
package/tsconfig.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "compilerOptions": {
3
3
  /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
4
  "target": "ES2020",
5
- "module": "ESNext",
5
+ "module": "ES2020",
6
6
  "moduleResolution": "bundler",
7
7
  "isolatedModules": true,
8
- "outDir": "build",
8
+ "outDir": "./build/mjs",
9
9
  "noEmit": false,
10
10
  "declaration": true,
11
11
  "strict": true,
@@ -1,2 +0,0 @@
1
- import React from "react";
2
- export declare function TitleBar(): number | bigint | boolean | Iterable<React.ReactNode> | Promise<React.AwaitedReactNode> | import("react/jsx-runtime").JSX.Element | undefined;
File without changes
File without changes