@softure-ai/theme-notion 0.9.0 → 0.10.1
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/CHANGELOG.md +31 -0
- package/README.md +58 -3
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/notion/InstallBar.d.ts +23 -0
- package/dist/notion/InstallBar.d.ts.map +1 -0
- package/dist/notion/InstallBar.js +16 -0
- package/dist/notion/InstallBar.js.map +1 -0
- package/dist/notion/MiniProgress.d.ts +13 -0
- package/dist/notion/MiniProgress.d.ts.map +1 -0
- package/dist/notion/MiniProgress.js +24 -0
- package/dist/notion/MiniProgress.js.map +1 -0
- package/dist/notion/UpdatePrompt.d.ts +13 -0
- package/dist/notion/UpdatePrompt.d.ts.map +1 -0
- package/dist/notion/UpdatePrompt.js +16 -0
- package/dist/notion/UpdatePrompt.js.map +1 -0
- package/dist/ui/accordion.d.ts +3 -1
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +2 -2
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/dialog.d.ts +2 -1
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +3 -2
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts +14 -5
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +21 -10
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/tabs.d.ts +6 -2
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +13 -4
- package/dist/ui/tabs.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/notion/InstallBar.tsx +75 -0
- package/src/notion/MiniProgress.tsx +67 -0
- package/src/notion/UpdatePrompt.tsx +47 -0
- package/src/ui/accordion.tsx +5 -1
- package/src/ui/dialog.tsx +8 -1
- package/src/ui/dropdown-menu.tsx +55 -16
- package/src/ui/tabs.tsx +27 -7
package/src/ui/tabs.tsx
CHANGED
|
@@ -5,6 +5,11 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
5
5
|
import { cn } from "../lib/utils.js"
|
|
6
6
|
import { Tabs as TabsPrimitive } from "radix-ui"
|
|
7
7
|
|
|
8
|
+
type TabsTriggerSize = "default" | "touch"
|
|
9
|
+
|
|
10
|
+
// A list's size reaches its triggers through context, so a trigger's own size can win over it.
|
|
11
|
+
const TabsTriggerSizeContext = React.createContext<TabsTriggerSize>("default")
|
|
12
|
+
|
|
8
13
|
function Tabs({
|
|
9
14
|
className,
|
|
10
15
|
orientation = "horizontal",
|
|
@@ -32,9 +37,15 @@ const tabsListVariants = cva(
|
|
|
32
37
|
default: "bg-muted",
|
|
33
38
|
line: "gap-1 bg-transparent",
|
|
34
39
|
},
|
|
40
|
+
size: {
|
|
41
|
+
default: "",
|
|
42
|
+
// The triggers set the height: a fixed one would cap them at 35 px.
|
|
43
|
+
touch: "group-data-[orientation=horizontal]/tabs:h-auto",
|
|
44
|
+
},
|
|
35
45
|
},
|
|
36
46
|
defaultVariants: {
|
|
37
47
|
variant: "line",
|
|
48
|
+
size: "default",
|
|
38
49
|
},
|
|
39
50
|
}
|
|
40
51
|
)
|
|
@@ -42,23 +53,31 @@ const tabsListVariants = cva(
|
|
|
42
53
|
function TabsList({
|
|
43
54
|
className,
|
|
44
55
|
variant = "line",
|
|
56
|
+
size = "default",
|
|
45
57
|
...props
|
|
46
58
|
}: React.ComponentProps<typeof TabsPrimitive.List> &
|
|
47
59
|
VariantProps<typeof tabsListVariants>) {
|
|
48
60
|
return (
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
<TabsTriggerSizeContext.Provider value={size ?? "default"}>
|
|
62
|
+
<TabsPrimitive.List
|
|
63
|
+
data-slot="tabs-list"
|
|
64
|
+
data-variant={variant}
|
|
65
|
+
className={cn(tabsListVariants({ variant, size }), className)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
</TabsTriggerSizeContext.Provider>
|
|
55
69
|
)
|
|
56
70
|
}
|
|
57
71
|
|
|
58
72
|
function TabsTrigger({
|
|
59
73
|
className,
|
|
74
|
+
size,
|
|
60
75
|
...props
|
|
61
|
-
}: React.ComponentProps<typeof TabsPrimitive.Trigger>
|
|
76
|
+
}: React.ComponentProps<typeof TabsPrimitive.Trigger> & {
|
|
77
|
+
size?: TabsTriggerSize
|
|
78
|
+
}) {
|
|
79
|
+
const listSize = React.useContext(TabsTriggerSizeContext)
|
|
80
|
+
|
|
62
81
|
return (
|
|
63
82
|
<TabsPrimitive.Trigger
|
|
64
83
|
data-slot="tabs-trigger"
|
|
@@ -67,6 +86,7 @@ function TabsTrigger({
|
|
|
67
86
|
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
|
|
68
87
|
"bg-clip-padding data-[state=active]:border-input data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:data-[state=active]:border-ring dark:data-[state=active]:bg-accent/40 dark:data-[state=active]:text-foreground",
|
|
69
88
|
"after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
|
|
89
|
+
(size ?? listSize) === "touch" && "min-h-touch-target min-w-touch-target",
|
|
70
90
|
className
|
|
71
91
|
)}
|
|
72
92
|
{...props}
|