tw-react-components 0.0.151 → 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 +4 -4
- package/package.json +1 -1
- package/src/contexts/LayoutContext.d.ts +1 -3
package/index.esm.js
CHANGED
|
@@ -3,10 +3,10 @@ import { forwardRef, useMemo, useState, useEffect, useId, useCallback, useRef, c
|
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import dayjs from 'dayjs';
|
|
6
|
-
import advancedFormat from 'dayjs/plugin/advancedFormat';
|
|
6
|
+
import advancedFormat from 'dayjs/plugin/advancedFormat.js';
|
|
7
7
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
8
8
|
import { HelpCircle, XIcon, AtSignIcon, EyeIcon, EyeOffIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronDownIcon, CalendarIcon, ClockIcon, CheckIcon, CircleIcon, CloudUploadIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsDownUpIcon, ChevronsUpDownIcon, ArrowUpDownIcon, SortAscIcon, SortDescIcon, MinusIcon, PlusIcon, PanelLeft, MoonIcon, SunIcon, MonitorIcon } from 'lucide-react';
|
|
9
|
-
import localeData from 'dayjs/plugin/localeData';
|
|
9
|
+
import localeData from 'dayjs/plugin/localeData.js';
|
|
10
10
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
11
11
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
12
12
|
import { useFormContext, Controller, FormProvider } from 'react-hook-form';
|
|
@@ -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.
|
|
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;
|