@firecms/ui 3.0.0-tw4.2 → 3.0.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.
- package/dist/index.css +6 -55
- package/dist/index.es.js +308 -329
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +308 -329
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.d.ts +11 -11
- package/package.json +2 -2
- package/src/components/BooleanSwitch.tsx +3 -3
- package/src/components/Button.tsx +5 -5
- package/src/components/Checkbox.tsx +1 -1
- package/src/components/Dialog.tsx +13 -13
- package/src/components/DialogActions.tsx +1 -1
- package/src/components/ExpandablePanel.tsx +1 -1
- package/src/components/IconButton.tsx +2 -3
- package/src/components/Menubar.tsx +1 -1
- package/src/components/MultiSelect.tsx +9 -12
- package/src/components/Select.tsx +0 -1
- package/src/components/Separator.tsx +2 -2
- package/src/components/Sheet.tsx +2 -2
- package/src/components/Slider.tsx +4 -4
- package/src/components/Tabs.tsx +1 -1
- package/src/components/TextField.tsx +2 -10
- package/src/components/Tooltip.tsx +1 -1
- package/src/index.css +6 -55
- package/src/styles.ts +11 -11
- package/src/util/cls.ts +1 -1
package/dist/styles.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const focusedDisabled = "focus-visible:ring-0 focus-visible:ring-offset-0";
|
|
2
|
-
export declare const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-surface-accent-100 focus:dark:bg-surface-800 focus:dark:bg-opacity-60
|
|
3
|
-
export declare const focusedClasses = "z-30 outline-
|
|
4
|
-
export declare const fieldBackgroundMixin = "bg-opacity-50 bg-surface-accent-200
|
|
5
|
-
export declare const fieldBackgroundInvisibleMixin = "bg-opacity-0 bg-surface-accent-100 dark:bg-surface-800 dark:bg-opacity-0
|
|
6
|
-
export declare const fieldBackgroundDisabledMixin = "dark:bg-surface-800 bg-opacity-50 dark:bg-opacity-90
|
|
7
|
-
export declare const fieldBackgroundHoverMixin = "hover:bg-opacity-70 dark:hover:bg-surface-700 dark:hover:bg-opacity-40
|
|
8
|
-
export declare const defaultBorderMixin = "border-surface-200 border-opacity-40 dark:border-surface-700 dark:border-opacity-40
|
|
9
|
-
export declare const paperMixin = "bg-white rounded-md dark:bg-surface-950 border border-surface-200 border-opacity-40 dark:border-surface-700 dark:border-opacity-40
|
|
10
|
-
export declare const cardMixin = "bg-white
|
|
11
|
-
export declare const cardClickableMixin = "hover:bg-surface-accent-100 dark:hover:bg-surface-accent-800 hover:ring-2 hover:ring-primary cursor-pointer
|
|
12
|
-
export declare const cardSelectedMixin = "bg-primary-bg dark:bg-primary-bg bg-opacity-30
|
|
2
|
+
export declare const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-surface-accent-100 focus:dark:bg-surface-800 focus:dark:bg-opacity-60";
|
|
3
|
+
export declare const focusedClasses = "z-30 outline-none ring-2 ring-primary ring-opacity-75 ring-offset-2 ring-offset-transparent ";
|
|
4
|
+
export declare const fieldBackgroundMixin = "bg-opacity-50 bg-surface-accent-200 dark:bg-surface-800 dark:bg-opacity-60";
|
|
5
|
+
export declare const fieldBackgroundInvisibleMixin = "bg-opacity-0 bg-surface-accent-100 dark:bg-surface-800 dark:bg-opacity-0";
|
|
6
|
+
export declare const fieldBackgroundDisabledMixin = "dark:bg-surface-800 bg-opacity-50 dark:bg-opacity-90";
|
|
7
|
+
export declare const fieldBackgroundHoverMixin = "hover:bg-opacity-70 dark:hover:bg-surface-700 dark:hover:bg-opacity-40";
|
|
8
|
+
export declare const defaultBorderMixin = "border-surface-200 border-opacity-40 dark:border-surface-700 dark:border-opacity-40";
|
|
9
|
+
export declare const paperMixin = "bg-white rounded-md dark:bg-surface-950 border border-surface-200 border-opacity-40 dark:border-surface-700 dark:border-opacity-40";
|
|
10
|
+
export declare const cardMixin = "bg-white border border-surface-200 border-opacity-40 dark:border-transparent rounded-md dark:bg-surface-950 dark:border-surface-700 dark:border-opacity-40";
|
|
11
|
+
export declare const cardClickableMixin = "hover:bg-surface-accent-100 dark:hover:bg-surface-accent-800 hover:ring-2 hover:ring-primary cursor-pointer";
|
|
12
|
+
export declare const cardSelectedMixin = "bg-primary-bg dark:bg-primary-bg bg-opacity-30 dark:bg-opacity-10 ring-1 ring-primary ring-opacity-75";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firecms/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/firecmsco"
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"index.css",
|
|
116
116
|
"tailwind.config.js"
|
|
117
117
|
],
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "d106a7fde537c4330ae4ba5471c74d4536dea710",
|
|
119
119
|
"publishConfig": {
|
|
120
120
|
"access": "public"
|
|
121
121
|
}
|
|
@@ -42,10 +42,10 @@ export const BooleanSwitch = React.forwardRef(function BooleanSwitch({
|
|
|
42
42
|
}}
|
|
43
43
|
className={cls(
|
|
44
44
|
size === "smallest" ? "w-[34px] h-[18px] min-w-[34px] min-h-[18px]" : size === "small" ? "w-[38px] h-[22px] min-w-[38px] min-h-[22px]" : "w-[42px] h-[26px] min-w-[42px] min-h-[26px]",
|
|
45
|
-
"outline-none
|
|
45
|
+
"outline-none rounded-full relative shadow-sm",
|
|
46
46
|
value ? (disabled
|
|
47
|
-
? "bg-white bg-opacity-54
|
|
48
|
-
: "ring-secondary ring-1 bg-secondary dark:bg-secondary") : "bg-white bg-opacity-54
|
|
47
|
+
? "bg-white bg-opacity-54 dark:bg-surface-accent-950 border-surface-accent-100 dark:border-surface-accent-700 ring-1 ring-surface-accent-200 dark:ring-surface-accent-700"
|
|
48
|
+
: "ring-secondary ring-1 bg-secondary dark:bg-secondary") : "bg-white bg-opacity-54 dark:bg-surface-accent-900 ring-1 ring-surface-accent-200 dark:ring-surface-accent-700",
|
|
49
49
|
className
|
|
50
50
|
)}
|
|
51
51
|
{...props}
|
|
@@ -46,14 +46,14 @@ const ButtonInner = React.forwardRef<
|
|
|
46
46
|
"border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-text-primary dark:bg-surface-800 dark:hover:bg-surface-accent-700 dark:text-text-primary-dark hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark": variant === "filled" && color === "neutral" && !disabled,
|
|
47
47
|
|
|
48
48
|
// Text Variants
|
|
49
|
-
"border border-transparent text-primary hover:text-primary hover:bg-surface-accent-200 hover:bg-opacity-75
|
|
50
|
-
"border border-transparent text-secondary hover:text-secondary hover:bg-surface-accent-200 hover:bg-opacity-75
|
|
51
|
-
"border border-transparent text-red-500 hover:text-red-500 hover:bg-red-500 hover:bg-opacity-10
|
|
49
|
+
"border border-transparent text-primary hover:text-primary hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800": variant === "text" && color === "primary" && !disabled,
|
|
50
|
+
"border border-transparent text-secondary hover:text-secondary hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800": variant === "text" && color === "secondary" && !disabled,
|
|
51
|
+
"border border-transparent text-red-500 hover:text-red-500 hover:bg-red-500 hover:bg-opacity-10": variant === "text" && color === "error" && !disabled,
|
|
52
52
|
"border border-transparent text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark hover:bg-surface-accent-200 hover:dark:bg-surface-700": variant === "text" && color === "text" && !disabled,
|
|
53
53
|
"border border-transparent text-text-primary hover:text-text-primary hover:bg-surface-accent-200 dark:text-text-primary-dark dark:hover:text-text-primary-dark dark:hover:bg-surface-accent-700": variant === "text" && color === "neutral" && !disabled,
|
|
54
54
|
|
|
55
55
|
// Outlined Variants
|
|
56
|
-
"border border-primary text-primary hover:text-primary hover:bg-primary-bg
|
|
56
|
+
"border border-primary text-primary hover:text-primary hover:bg-primary-bg": variant === "outlined" && color === "primary" && !disabled,
|
|
57
57
|
"border border-secondary text-secondary hover:text-secondary hover:bg-secondary-bg": variant === "outlined" && color === "secondary" && !disabled,
|
|
58
58
|
"border border-red-500 text-red-500 hover:text-red-500 hover:bg-red-500 hover:text-white": variant === "outlined" && color === "error" && !disabled,
|
|
59
59
|
"border border-surface-accent-400 text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:bg-surface-accent-200": variant === "outlined" && color === "text" && !disabled,
|
|
@@ -63,7 +63,7 @@ const ButtonInner = React.forwardRef<
|
|
|
63
63
|
"text-text-disabled dark:text-text-disabled-dark": disabled,
|
|
64
64
|
"border border-transparent opacity-50": variant === "text" && disabled,
|
|
65
65
|
"border border-surface-500 opacity-50": variant === "outlined" && disabled,
|
|
66
|
-
"border border-transparent bg-surface-300 dark:bg-surface-500 opacity-40
|
|
66
|
+
"border border-transparent bg-surface-300 dark:bg-surface-500 opacity-40": variant === "filled" && disabled,
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
const sizeClasses = cls(
|
|
@@ -71,7 +71,7 @@ export const Checkbox = ({
|
|
|
71
71
|
padding ? paddingClasses[size] : "",
|
|
72
72
|
outerSizeClasses[size],
|
|
73
73
|
"inline-flex items-center justify-center text-sm font-medium focus:outline-none transition-colors ease-in-out duration-150",
|
|
74
|
-
onCheckedChange ? "rounded-full hover:bg-surface-accent-200 hover:bg-opacity-75
|
|
74
|
+
onCheckedChange ? "rounded-full hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-700 dark:hover:bg-opacity-75" : "",
|
|
75
75
|
onCheckedChange ? "cursor-pointer" : "cursor-default"
|
|
76
76
|
)}>
|
|
77
77
|
<div
|
|
@@ -27,18 +27,18 @@ export type DialogProps = {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
const widthClasses = {
|
|
30
|
-
xs: "max-w-xs w-xs",
|
|
31
|
-
sm: "max-w-sm w-sm",
|
|
32
|
-
md: "max-w-md w-md",
|
|
33
|
-
lg: "max-w-lg w-lg",
|
|
34
|
-
xl: "max-w-xl w-xl",
|
|
35
|
-
"2xl": "max-w-2xl w-2xl",
|
|
36
|
-
"3xl": "max-w-3xl w-3xl",
|
|
37
|
-
"4xl": "max-w-4xl w-4xl",
|
|
38
|
-
"5xl": "max-w-5xl w-5xl",
|
|
39
|
-
"6xl": "max-w-6xl w-6xl",
|
|
40
|
-
"7xl": "max-w-7xl w-7xl",
|
|
41
|
-
full: "max-w-full w-full"
|
|
30
|
+
xs: "max-w-xs min-w-xs w-xs",
|
|
31
|
+
sm: "max-w-sm min-w-sm w-sm",
|
|
32
|
+
md: "max-w-md min-w-md w-md",
|
|
33
|
+
lg: "max-w-lg min-w-lg w-lg",
|
|
34
|
+
xl: "max-w-xl min-w-xl w-xl",
|
|
35
|
+
"2xl": "max-w-2xl min-w-2xl w-2xl",
|
|
36
|
+
"3xl": "max-w-3xl min-w-3xl w-3xl",
|
|
37
|
+
"4xl": "max-w-4xl min-w-4xl w-4xl",
|
|
38
|
+
"5xl": "max-w-5xl min-w-5xl w-5xl",
|
|
39
|
+
"6xl": "max-w-6xl min-w-6xl w-6xl",
|
|
40
|
+
"7xl": "max-w-7xl min-w-7xl w-7xl",
|
|
41
|
+
full: "max-w-full min-w-full w-full"
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export const Dialog = ({
|
|
@@ -83,7 +83,7 @@ export const Dialog = ({
|
|
|
83
83
|
<div className={cls("fixed inset-0 z-30", containerClassName)}>
|
|
84
84
|
|
|
85
85
|
<DialogPrimitive.Overlay
|
|
86
|
-
className={cls("fixed inset-0 transition-opacity z-20 ease-in-out duration-200 bg-black
|
|
86
|
+
className={cls("fixed inset-0 transition-opacity z-20 ease-in-out duration-200 bg-black bg-opacity-50 dark:bg-opacity-60 backdrop-blur-sm ",
|
|
87
87
|
displayed && open ? "opacity-100" : "opacity-0",
|
|
88
88
|
"z-20 fixed top-0 left-0 w-full h-full flex justify-center items-center"
|
|
89
89
|
)}
|
|
@@ -19,7 +19,7 @@ export function DialogActions({
|
|
|
19
19
|
defaultBorderMixin,
|
|
20
20
|
"pt-2 pb-4 px-4 border-t flex flex-row items-center justify-end bottom-0 right-0 left-0 text-right z-2 gap-2",
|
|
21
21
|
position,
|
|
22
|
-
"bg-white bg-opacity-60
|
|
22
|
+
"bg-white bg-opacity-60 dark:bg-surface-900 dark:bg-opacity-60",
|
|
23
23
|
translucent ? "backdrop-blur-sm" : "",
|
|
24
24
|
className)}>
|
|
25
25
|
{children}
|
|
@@ -94,7 +94,7 @@ export function ExpandablePanel({
|
|
|
94
94
|
<Collapsible.Trigger
|
|
95
95
|
className={cls(
|
|
96
96
|
"rounded-t flex items-center justify-between w-full min-h-[52px]",
|
|
97
|
-
"hover:bg-surface-accent-200 hover:bg-opacity-40
|
|
97
|
+
"hover:bg-surface-accent-200 hover:bg-opacity-40 dark:hover:bg-surface-800 dark:hover:bg-opacity-40",
|
|
98
98
|
invisible ? "border-b px-2" : "p-4",
|
|
99
99
|
open ? "py-6" : "py-4",
|
|
100
100
|
"transition-all duration-200",
|
|
@@ -14,7 +14,7 @@ export type IconButtonProps<C extends React.ElementType> =
|
|
|
14
14
|
onClick?: React.MouseEventHandler<any>
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const buttonClasses = "hover:bg-surface-accent-200 hover:bg-opacity-75
|
|
17
|
+
const buttonClasses = "hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800 hover:scale-105 transition-transform";
|
|
18
18
|
const baseClasses = "inline-flex items-center justify-center p-2 text-sm font-medium focus:outline-none transition-colors ease-in-out duration-150";
|
|
19
19
|
const colorClasses = "text-surface-accent-600 visited:text-surface-accent-600 dark:text-surface-accent-300 dark:visited:text-surface-300";
|
|
20
20
|
const sizeClasses = {
|
|
@@ -40,7 +40,7 @@ const IconButtonInner = <C extends React.ElementType = "button">({
|
|
|
40
40
|
...props
|
|
41
41
|
}: IconButtonProps<C>, ref: React.ForwardedRef<HTMLButtonElement>) => {
|
|
42
42
|
|
|
43
|
-
const bgClasses = variant === "ghost" ? "bg-transparent" : "bg-surface-accent-200 bg-opacity-50
|
|
43
|
+
const bgClasses = variant === "ghost" ? "bg-transparent" : "bg-surface-accent-200 bg-opacity-50 dark:bg-surface-950 dark:bg-opacity-50";
|
|
44
44
|
const Component: React.ElementType<any> = component || "button";
|
|
45
45
|
return (
|
|
46
46
|
<Component
|
|
@@ -50,7 +50,6 @@ const IconButtonInner = <C extends React.ElementType = "button">({
|
|
|
50
50
|
className={cls(
|
|
51
51
|
disabled ? "opacity-50 pointer-events-none" : "cursor-pointer",
|
|
52
52
|
toggled ? "outline outline-2 outline-primary" : "",
|
|
53
|
-
"text-inherit dark:text-inherit",
|
|
54
53
|
colorClasses,
|
|
55
54
|
bgClasses,
|
|
56
55
|
baseClasses,
|
|
@@ -44,7 +44,7 @@ export function MenubarTrigger({
|
|
|
44
44
|
return (
|
|
45
45
|
<MenubarPrimitive.Trigger
|
|
46
46
|
onSelect={onSelect}
|
|
47
|
-
className={cls("py-2 px-3 outline-none select-none font-medium leading-none rounded text-text-primary dark:text-text-primary-dark text-[13px] flex items-center justify-between gap-[2px] data-[highlighted]:bg-surface-accent-100 data-[highlighted]:dark:bg-surface-800 data-[state=open]:bg-surface-accent-100 data-[state=open]:dark:bg-surface-800 hover:bg-surface-accent-200 hover:bg-opacity-75
|
|
47
|
+
className={cls("py-2 px-3 outline-none select-none font-medium leading-none rounded text-text-primary dark:text-text-primary-dark text-[13px] flex items-center justify-between gap-[2px] data-[highlighted]:bg-surface-accent-100 data-[highlighted]:dark:bg-surface-800 data-[state=open]:bg-surface-accent-100 data-[state=open]:dark:bg-surface-800 hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800",
|
|
48
48
|
className)}>
|
|
49
49
|
{children}
|
|
50
50
|
</MenubarPrimitive.Trigger>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { ChangeEvent, Children, useEffect
|
|
4
|
+
import { ChangeEvent, Children, useEffect } from "react";
|
|
5
5
|
import { Command as CommandPrimitive } from "cmdk";
|
|
6
6
|
import { cls } from "../util";
|
|
7
7
|
import { CheckIcon, CloseIcon, KeyboardArrowDownIcon } from "../icons";
|
|
@@ -88,13 +88,9 @@ export const MultiSelect = React.forwardRef<
|
|
|
88
88
|
},
|
|
89
89
|
ref
|
|
90
90
|
) => {
|
|
91
|
-
|
|
92
|
-
const [isPopoverOpen, setIsPopoverOpen] = useState(open ?? false);
|
|
93
|
-
const [selectedValues, setSelectedValues] = useState<any[]>(value ?? []);
|
|
94
|
-
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
setIsMounted(true);
|
|
97
|
-
}, []);
|
|
91
|
+
// Properly type the state variables to match the generic props
|
|
92
|
+
const [isPopoverOpen, setIsPopoverOpen] = React.useState(open ?? false);
|
|
93
|
+
const [selectedValues, setSelectedValues] = React.useState<any[]>(value ?? []);
|
|
98
94
|
|
|
99
95
|
const onPopoverOpenChange = (open: boolean) => {
|
|
100
96
|
setIsPopoverOpen(open);
|
|
@@ -188,7 +184,7 @@ export const MultiSelect = React.forwardRef<
|
|
|
188
184
|
{typeof label === "string" ? <SelectInputLabel error={error}>{label}</SelectInputLabel> : label}
|
|
189
185
|
|
|
190
186
|
<PopoverPrimitive.Root
|
|
191
|
-
open={
|
|
187
|
+
open={isPopoverOpen}
|
|
192
188
|
onOpenChange={onPopoverOpenChange}
|
|
193
189
|
modal={modalPopover}
|
|
194
190
|
>
|
|
@@ -282,7 +278,7 @@ export const MultiSelect = React.forwardRef<
|
|
|
282
278
|
</button>
|
|
283
279
|
</PopoverPrimitive.Trigger>
|
|
284
280
|
<PopoverPrimitive.Content
|
|
285
|
-
className={cls("z-50 overflow-hidden border bg-white dark:bg-surface-900 rounded-lg w-[400px]", defaultBorderMixin)}
|
|
281
|
+
className={cls("z-50 relative overflow-hidden border bg-white dark:bg-surface-900 rounded-lg w-[400px]", defaultBorderMixin)}
|
|
286
282
|
align="start"
|
|
287
283
|
sideOffset={8}
|
|
288
284
|
onEscapeKeyDown={() => onPopoverOpenChange(false)}
|
|
@@ -317,7 +313,7 @@ export const MultiSelect = React.forwardRef<
|
|
|
317
313
|
"cursor-pointer",
|
|
318
314
|
"m-1",
|
|
319
315
|
"ring-offset-transparent",
|
|
320
|
-
"p-1 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-
|
|
316
|
+
"p-1 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-offset-2",
|
|
321
317
|
"aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900",
|
|
322
318
|
"cursor-pointer p-2 rounded aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900"
|
|
323
319
|
)
|
|
@@ -373,7 +369,7 @@ export function MultiSelectItem<T extends MultiSelectValue = string>({
|
|
|
373
369
|
"cursor-pointer",
|
|
374
370
|
"m-1",
|
|
375
371
|
"ring-offset-transparent",
|
|
376
|
-
"p-1 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-
|
|
372
|
+
"p-1 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-offset-2",
|
|
377
373
|
"aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900",
|
|
378
374
|
"cursor-pointer p-2 rounded aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900",
|
|
379
375
|
className
|
|
@@ -402,3 +398,4 @@ function InnerCheckBox({ checked }: { checked: boolean }) {
|
|
|
402
398
|
</div>
|
|
403
399
|
</div>
|
|
404
400
|
}
|
|
401
|
+
|
|
@@ -142,7 +142,6 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
|
142
142
|
"px-3": size === "medium",
|
|
143
143
|
"px-2": size === "small" || size === "smallest",
|
|
144
144
|
} : "",
|
|
145
|
-
"outline-hidden focus:outline-hidden",
|
|
146
145
|
"outline-none focus:outline-none",
|
|
147
146
|
"select-none rounded-md text-sm",
|
|
148
147
|
error ? "text-red-500 dark:text-red-600" : "focus:text-text-primary dark:focus:text-text-primary-dark",
|
|
@@ -15,12 +15,12 @@ export function Separator({
|
|
|
15
15
|
<SeparatorPrimitive.Root
|
|
16
16
|
decorative={decorative}
|
|
17
17
|
orientation="horizontal"
|
|
18
|
-
className={cls("dark:bg-opacity-80 dark:bg-surface-800
|
|
18
|
+
className={cls("dark:bg-opacity-80 dark:bg-surface-800 bg-surface-100 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px my-4", className)}/>
|
|
19
19
|
);
|
|
20
20
|
else
|
|
21
21
|
return (
|
|
22
22
|
<SeparatorPrimitive.Root
|
|
23
|
-
className={cls("dark:bg-opacity-80 dark:bg-surface-800
|
|
23
|
+
className={cls("dark:bg-opacity-80 dark:bg-surface-800 bg-surface-100 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px mx-4", className)}
|
|
24
24
|
decorative={decorative}
|
|
25
25
|
orientation="vertical"
|
|
26
26
|
/>
|
package/src/components/Sheet.tsx
CHANGED
|
@@ -70,8 +70,8 @@ export const Sheet: React.FC<SheetProps> = ({
|
|
|
70
70
|
className={cls(
|
|
71
71
|
"outline-none",
|
|
72
72
|
"fixed inset-0 transition-opacity z-20 ease-in-out duration-100 backdrop-blur-sm",
|
|
73
|
-
"bg-black bg-opacity-50
|
|
74
|
-
"dark:bg-surface-900 dark:bg-opacity-60
|
|
73
|
+
"bg-black bg-opacity-50",
|
|
74
|
+
"dark:bg-surface-900 dark:bg-opacity-60",
|
|
75
75
|
displayed && open ? "opacity-100" : "opacity-0",
|
|
76
76
|
overlayClassName
|
|
77
77
|
)}
|
|
@@ -37,8 +37,8 @@ function SliderThumb(props: {
|
|
|
37
37
|
"border-surface-accent-300 bg-surface-accent-300 dark:border-surface-700 dark:bg-surface-700": props.props.disabled
|
|
38
38
|
},
|
|
39
39
|
props.classes,
|
|
40
|
-
"focus-visible:ring-4 focus-visible:ring-primary focus-visible:ring-opacity-50
|
|
41
|
-
"hover:ring-4 hover:ring-primary hover:ring-opacity-25
|
|
40
|
+
"focus-visible:ring-4 focus-visible:ring-primary focus-visible:ring-opacity-50",
|
|
41
|
+
"hover:ring-4 hover:ring-primary hover:ring-opacity-25",
|
|
42
42
|
"block rounded-full transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50")}
|
|
43
43
|
|
|
44
44
|
/>
|
|
@@ -48,7 +48,7 @@ function SliderThumb(props: {
|
|
|
48
48
|
className={cls(
|
|
49
49
|
"TooltipContent",
|
|
50
50
|
"max-w-lg leading-relaxed",
|
|
51
|
-
"z-50 rounded px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90
|
|
51
|
+
"z-50 rounded px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90 font-medium text-surface-accent-50 shadow-2xl select-none duration-400 ease-in transform opacity-100",
|
|
52
52
|
)}>
|
|
53
53
|
{props.props.value?.[props.index]}
|
|
54
54
|
</TooltipPrimitive.Content>
|
|
@@ -84,7 +84,7 @@ const Slider = React.forwardRef<
|
|
|
84
84
|
>
|
|
85
85
|
<SliderPrimitive.Track
|
|
86
86
|
style={{ height: size === "small" ? 4 : 8 }}
|
|
87
|
-
className={"relative w-full grow overflow-hidden rounded-full bg-surface-accent-300 bg-opacity-40
|
|
87
|
+
className={"relative w-full grow overflow-hidden rounded-full bg-surface-accent-300 bg-opacity-40 dark:bg-surface-700 dark:bg-opacity-40"}>
|
|
88
88
|
|
|
89
89
|
<SliderPrimitive.Range
|
|
90
90
|
className={cls("absolute h-full", {
|
package/src/components/Tabs.tsx
CHANGED
|
@@ -57,7 +57,7 @@ export function Tab({
|
|
|
57
57
|
className)}>
|
|
58
58
|
<div className={cls("line-clamp-1",
|
|
59
59
|
"uppercase inline-block p-2 px-4 rounded",
|
|
60
|
-
"hover:bg-surface-accent-200 hover:bg-opacity-75
|
|
60
|
+
"hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800",
|
|
61
61
|
innerClassName)}>
|
|
62
62
|
{children}
|
|
63
63
|
</div>
|
|
@@ -85,16 +85,10 @@ export const TextField = forwardRef<HTMLDivElement, TextFieldProps<string | numb
|
|
|
85
85
|
|
|
86
86
|
const inputRef = inputRefProp ?? useRef(null);
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
// @ts-ignore
|
|
89
|
+
const [focused, setFocused] = React.useState(document.activeElement === inputRef.current);
|
|
89
90
|
const hasValue = value !== undefined && value !== null && value !== "";
|
|
90
91
|
|
|
91
|
-
useEffect(() => {
|
|
92
|
-
// @ts-ignore
|
|
93
|
-
if (inputRef.current && document.activeElement === inputRef.current) {
|
|
94
|
-
setFocused(true);
|
|
95
|
-
}
|
|
96
|
-
}, []);
|
|
97
|
-
|
|
98
92
|
useEffect(() => {
|
|
99
93
|
if (type !== "number") return;
|
|
100
94
|
const handleWheel = (event: any) => {
|
|
@@ -120,8 +114,6 @@ export const TextField = forwardRef<HTMLDivElement, TextFieldProps<string | numb
|
|
|
120
114
|
maxRows={maxRows}
|
|
121
115
|
value={value ?? ""}
|
|
122
116
|
onChange={onChange}
|
|
123
|
-
onFocus={() => setFocused(true)}
|
|
124
|
-
onBlur={() => setFocused(false)}
|
|
125
117
|
style={inputStyle}
|
|
126
118
|
className={cls(
|
|
127
119
|
invisible ? focusedInvisibleMixin : "",
|
|
@@ -64,7 +64,7 @@ export const Tooltip = ({
|
|
|
64
64
|
<TooltipPrimitive.Content
|
|
65
65
|
className={cls("TooltipContent",
|
|
66
66
|
"max-w-lg leading-relaxed",
|
|
67
|
-
"z-50 rounded px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90
|
|
67
|
+
"z-50 rounded px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90 font-medium text-surface-accent-50 shadow-2xl select-none duration-400 ease-in transform opacity-100",
|
|
68
68
|
tooltipClassName)}
|
|
69
69
|
style={tooltipStyle}
|
|
70
70
|
sideOffset={sideOffset === undefined ? 4 : sideOffset}
|
package/src/index.css
CHANGED
|
@@ -1,57 +1,3 @@
|
|
|
1
|
-
@theme {
|
|
2
|
-
/* Font Families */
|
|
3
|
-
--font-sans: 'Rubik', 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
|
4
|
-
--font-headers: 'Rubik', 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
|
5
|
-
--font-mono: 'JetBrains Mono', 'Space Mono', 'Lucida Console', monospace;
|
|
6
|
-
|
|
7
|
-
/* Colors */
|
|
8
|
-
--color-primary: #0070F4;
|
|
9
|
-
--color-primary-light: oklch(from var(--color-primary) calc(l + 0.15) c h);
|
|
10
|
-
--color-primary-dark: oklch(from var(--color-primary) calc(l - 0.15) c h);
|
|
11
|
-
--color-secondary: #FF5B79;
|
|
12
|
-
--color-secondary-light: oklch(from var(--color-secondary) calc(l + 0.15) c h);
|
|
13
|
-
--color-secondary-dark: oklch(from var(--color-secondary) calc(l - 0.15) c h);
|
|
14
|
-
|
|
15
|
-
/* Field Colors */
|
|
16
|
-
--color-field-disabled: rgb(224 224 226);
|
|
17
|
-
--color-field-disabled-dark: rgb(35 35 37);
|
|
18
|
-
|
|
19
|
-
/* Text Colors */
|
|
20
|
-
--color-text-primary: rgba(0, 0, 0, 0.87);
|
|
21
|
-
--color-text-secondary: rgba(0, 0, 0, 0.52);
|
|
22
|
-
--color-text-disabled: rgba(0, 0, 0, 0.38);
|
|
23
|
-
--color-text-primary-dark: #ffffff;
|
|
24
|
-
--color-text-secondary-dark: rgba(255, 255, 255, 0.6);
|
|
25
|
-
--color-text-disabled-dark: rgba(255, 255, 255, 0.48);
|
|
26
|
-
|
|
27
|
-
/* Surface Colors */
|
|
28
|
-
--color-surface-50: #f8f8fc;
|
|
29
|
-
--color-surface-100: #e7e7eb;
|
|
30
|
-
--color-surface-200: #cfcfd6;
|
|
31
|
-
--color-surface-300: #b7b7bf;
|
|
32
|
-
--color-surface-400: #a0a0a9;
|
|
33
|
-
--color-surface-500: #87878f;
|
|
34
|
-
--color-surface-600: #6b6b74;
|
|
35
|
-
--color-surface-700: #454552;
|
|
36
|
-
--color-surface-800: #292934;
|
|
37
|
-
--color-surface-900: #18181c;
|
|
38
|
-
--color-surface-950: #101013;
|
|
39
|
-
|
|
40
|
-
/* Surface Accent Colors */
|
|
41
|
-
--color-surface-accent-50: #f8fafc;
|
|
42
|
-
--color-surface-accent-100: #f1f5f9;
|
|
43
|
-
--color-surface-accent-200: #e2e8f0;
|
|
44
|
-
--color-surface-accent-300: #cbd5e1;
|
|
45
|
-
--color-surface-accent-400: #94a3b8;
|
|
46
|
-
--color-surface-accent-500: #64748b;
|
|
47
|
-
--color-surface-accent-600: #475569;
|
|
48
|
-
--color-surface-accent-700: #334155;
|
|
49
|
-
--color-surface-accent-800: #1e293b;
|
|
50
|
-
--color-surface-accent-900: #0f172a;
|
|
51
|
-
--color-surface-accent-950: #020617;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
1
|
/* Chrome, Safari and Opera */
|
|
56
2
|
.no-scrollbar::-webkit-scrollbar {
|
|
57
3
|
display: none;
|
|
@@ -117,7 +63,12 @@
|
|
|
117
63
|
@apply text-sm font-semibold uppercase;
|
|
118
64
|
}
|
|
119
65
|
|
|
66
|
+
|
|
120
67
|
:focus-visible {
|
|
121
|
-
@apply outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-transparent
|
|
68
|
+
@apply outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-transparent
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
a {
|
|
72
|
+
@apply text-blue-600 dark:text-blue-400 dark:hover:text-blue-600 hover:text-blue-800
|
|
122
73
|
}
|
|
123
74
|
|
package/src/styles.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export const focusedDisabled = "focus-visible:ring-0 focus-visible:ring-offset-0";
|
|
2
|
-
export const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-surface-accent-100 focus:dark:bg-surface-800 focus:dark:bg-opacity-60
|
|
3
|
-
export const focusedClasses = "z-30 outline-
|
|
4
|
-
export const fieldBackgroundMixin = "bg-opacity-50 bg-surface-accent-200
|
|
5
|
-
export const fieldBackgroundInvisibleMixin = "bg-opacity-0 bg-surface-accent-100 dark:bg-surface-800 dark:bg-opacity-0
|
|
6
|
-
export const fieldBackgroundDisabledMixin = "dark:bg-surface-800 bg-opacity-50 dark:bg-opacity-90
|
|
7
|
-
export const fieldBackgroundHoverMixin = "hover:bg-opacity-70 dark:hover:bg-surface-700 dark:hover:bg-opacity-40
|
|
8
|
-
export const defaultBorderMixin = "border-surface-200 border-opacity-40 dark:border-surface-700 dark:border-opacity-40
|
|
9
|
-
export const paperMixin = "bg-white rounded-md dark:bg-surface-950 border border-surface-200 border-opacity-40 dark:border-surface-700 dark:border-opacity-40
|
|
10
|
-
export const cardMixin = "bg-white
|
|
11
|
-
export const cardClickableMixin = "hover:bg-surface-accent-100 dark:hover:bg-surface-accent-800 hover:ring-2 hover:ring-primary cursor-pointer
|
|
12
|
-
export const cardSelectedMixin = "bg-primary-bg dark:bg-primary-bg bg-opacity-30
|
|
2
|
+
export const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-surface-accent-100 focus:dark:bg-surface-800 focus:dark:bg-opacity-60";
|
|
3
|
+
export const focusedClasses = "z-30 outline-none ring-2 ring-primary ring-opacity-75 ring-offset-2 ring-offset-transparent ";
|
|
4
|
+
export const fieldBackgroundMixin = "bg-opacity-50 bg-surface-accent-200 dark:bg-surface-800 dark:bg-opacity-60";
|
|
5
|
+
export const fieldBackgroundInvisibleMixin = "bg-opacity-0 bg-surface-accent-100 dark:bg-surface-800 dark:bg-opacity-0";
|
|
6
|
+
export const fieldBackgroundDisabledMixin = "dark:bg-surface-800 bg-opacity-50 dark:bg-opacity-90";
|
|
7
|
+
export const fieldBackgroundHoverMixin = "hover:bg-opacity-70 dark:hover:bg-surface-700 dark:hover:bg-opacity-40";
|
|
8
|
+
export const defaultBorderMixin = "border-surface-200 border-opacity-40 dark:border-surface-700 dark:border-opacity-40";
|
|
9
|
+
export const paperMixin = "bg-white rounded-md dark:bg-surface-950 border border-surface-200 border-opacity-40 dark:border-surface-700 dark:border-opacity-40";
|
|
10
|
+
export const cardMixin = "bg-white border border-surface-200 border-opacity-40 dark:border-transparent rounded-md dark:bg-surface-950 dark:border-surface-700 dark:border-opacity-40";
|
|
11
|
+
export const cardClickableMixin = "hover:bg-surface-accent-100 dark:hover:bg-surface-accent-800 hover:ring-2 hover:ring-primary cursor-pointer";
|
|
12
|
+
export const cardSelectedMixin = "bg-primary-bg dark:bg-primary-bg bg-opacity-30 dark:bg-opacity-10 ring-1 ring-primary ring-opacity-75";
|