tw-react-components 0.0.152 → 0.0.153

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.
package/index.esm.js CHANGED
@@ -2112,9 +2112,9 @@ const THEME_COOKIE_NAME = 'theme:state';
2112
2112
  const THEME_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
2113
2113
  const SHOW_IDS_COOKIE_NAME = 'show-ids:state';
2114
2114
  const SHOW_IDS_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
2115
- const LayoutContextProvider = ({ children, defaultTheme, }) => {
2115
+ const LayoutContextProvider = ({ children, theme: defaultTheme, showIds: defaultShowIds }) => {
2116
2116
  const [theme, _setTheme] = useState(defaultTheme !== null && defaultTheme !== void 0 ? defaultTheme : getValueFromCookie(THEME_COOKIE_NAME, 'system'));
2117
- const [showIds, _setShowIds] = useState(getValueFromCookie(SHOW_IDS_COOKIE_NAME, false));
2117
+ const [showIds, _setShowIds] = useState(defaultShowIds !== null && defaultShowIds !== void 0 ? defaultShowIds : getValueFromCookie(SHOW_IDS_COOKIE_NAME, false));
2118
2118
  const [resolvedTheme, setResolvedTheme] = useState(() => theme === 'system' ? getSystemTheme() : theme);
2119
2119
  useEffect(() => {
2120
2120
  if (resolvedTheme === 'dark') {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tw-react-components",
3
3
  "description": "A set of React components build with TailwindCSS to make a nice dashboard.",
4
- "version": "0.0.152",
4
+ "version": "0.0.153",
5
5
  "license": "MIT",
6
6
  "homepage": "https://bacali95.github.io/tw-react-components",
7
7
  "type": "module",
@@ -13,7 +13,5 @@ export declare const THEME_COOKIE_NAME = "theme:state";
13
13
  export declare const THEME_COOKIE_MAX_AGE: number;
14
14
  export declare const SHOW_IDS_COOKIE_NAME = "show-ids:state";
15
15
  export declare const SHOW_IDS_COOKIE_MAX_AGE: number;
16
- export declare const LayoutContextProvider: FC<PropsWithChildren<{
17
- defaultTheme?: ThemeState;
18
- }>>;
16
+ export declare const LayoutContextProvider: FC<PropsWithChildren<Pick<LayoutContext, 'theme' | 'showIds'>>>;
19
17
  export declare function useLayoutContext(): LayoutContext;