@c-rex/ui 0.1.13 → 0.1.14
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/package.json +1 -1
- package/src/hooks/index.tsx +2 -3
- package/src/input.tsx +1 -1
- package/src/sidebar.tsx +1 -1
package/package.json
CHANGED
package/src/hooks/index.tsx
CHANGED
|
@@ -2,9 +2,8 @@ import { useEffect, useState } from "react";
|
|
|
2
2
|
import { BREAKPOINTS, DEVICE_OPTIONS } from "@c-rex/constants";
|
|
3
3
|
import { DeviceType } from "@c-rex/types";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const [device, setDevice] = useState<DeviceType>(DEVICE_OPTIONS.MOBILE);
|
|
5
|
+
export const useBreakpoint = (): DeviceType | null => {
|
|
6
|
+
const [device, setDevice] = useState<DeviceType | null>(null);
|
|
8
7
|
|
|
9
8
|
useEffect(() => {
|
|
10
9
|
function handleResize() {
|
package/src/input.tsx
CHANGED
|
@@ -8,7 +8,7 @@ const inputVariants = cva(
|
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring
|
|
11
|
+
default: "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
12
12
|
file: "file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground",
|
|
13
13
|
embedded: "border-0 outline-none focus:border-0 focus:outline-none focus:ring20",
|
|
14
14
|
}
|
package/src/sidebar.tsx
CHANGED
|
@@ -81,7 +81,7 @@ const MultiSidebarProvider = React.forwardRef<
|
|
|
81
81
|
ref
|
|
82
82
|
) => {
|
|
83
83
|
const device = useBreakpoint();
|
|
84
|
-
const isMobile = (device === DEVICE_OPTIONS.MOBILE || device === DEVICE_OPTIONS.TABLET);
|
|
84
|
+
const isMobile = device !== null && (device === DEVICE_OPTIONS.MOBILE || device === DEVICE_OPTIONS.TABLET);
|
|
85
85
|
|
|
86
86
|
// Left Sidebar State
|
|
87
87
|
const [_leftOpen, _setLeftOpen] = React.useState(defaultLeftOpen);
|