@softure-ai/theme-notion 0.2.0 → 0.4.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/CHANGELOG.md +164 -0
- package/README.md +196 -16
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/messages/en.d.ts +17 -0
- package/dist/messages/en.d.ts.map +1 -1
- package/dist/messages/en.js +10 -0
- package/dist/messages/en.js.map +1 -1
- package/dist/messages/index.d.ts +17 -0
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/notion/Code.d.ts +8 -0
- package/dist/notion/Code.d.ts.map +1 -0
- package/dist/notion/Code.js +12 -0
- package/dist/notion/Code.js.map +1 -0
- package/dist/notion/FilterChip.d.ts +24 -0
- package/dist/notion/FilterChip.d.ts.map +1 -0
- package/dist/notion/FilterChip.js +18 -0
- package/dist/notion/FilterChip.js.map +1 -0
- package/dist/notion/Sortable.d.ts +47 -0
- package/dist/notion/Sortable.d.ts.map +1 -0
- package/dist/notion/Sortable.js +158 -0
- package/dist/notion/Sortable.js.map +1 -0
- package/dist/notion/Stats.d.ts +4 -0
- package/dist/notion/Stats.d.ts.map +1 -1
- package/dist/notion/Stats.js +10 -3
- package/dist/notion/Stats.js.map +1 -1
- package/dist/notion/Steps.d.ts +18 -0
- package/dist/notion/Steps.d.ts.map +1 -0
- package/dist/notion/Steps.js +32 -0
- package/dist/notion/Steps.js.map +1 -0
- package/dist/page.css +22 -0
- package/dist/theme.css +55 -46
- package/dist/tokens.d.ts +82 -64
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +22 -19
- package/dist/tokens.js.map +1 -1
- package/dist/ui/alert.js +1 -1
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +33 -13
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/button-group.js +1 -1
- package/dist/ui/button-group.js.map +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +3 -3
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/empty.js +1 -1
- package/dist/ui/empty.js.map +1 -1
- package/dist/ui/field.js +2 -2
- package/dist/ui/field.js.map +1 -1
- package/dist/ui/item.d.ts.map +1 -1
- package/dist/ui/item.js +9 -3
- package/dist/ui/item.js.map +1 -1
- package/dist/ui/progress.d.ts +4 -1
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +9 -2
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio-group.d.ts +6 -0
- package/dist/ui/radio-group.d.ts.map +1 -0
- package/dist/ui/radio-group.js +14 -0
- package/dist/ui/radio-group.js.map +1 -0
- package/dist/ui/scroll-area.d.ts +3 -1
- package/dist/ui/scroll-area.d.ts.map +1 -1
- package/dist/ui/scroll-area.js +2 -2
- package/dist/ui/scroll-area.js.map +1 -1
- package/dist/ui/select.js +2 -2
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/sidebar.js +4 -4
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/tabs.js +1 -1
- package/dist/ui/tabs.js.map +1 -1
- package/package.json +16 -5
- package/src/index.ts +17 -0
- package/src/messages/en.ts +11 -0
- package/src/notion/Code.tsx +39 -0
- package/src/notion/FilterChip.tsx +71 -0
- package/src/notion/Sortable.tsx +352 -0
- package/src/notion/Stats.tsx +23 -3
- package/src/notion/Steps.tsx +102 -0
- package/src/page.css +22 -0
- package/src/tokens.ts +22 -19
- package/src/ui/alert.tsx +1 -1
- package/src/ui/badge.tsx +35 -13
- package/src/ui/button-group.tsx +1 -1
- package/src/ui/button.tsx +3 -3
- package/src/ui/checkbox.tsx +1 -1
- package/src/ui/dropdown-menu.tsx +1 -1
- package/src/ui/empty.tsx +1 -1
- package/src/ui/field.tsx +2 -2
- package/src/ui/item.tsx +18 -7
- package/src/ui/progress.tsx +19 -2
- package/src/ui/radio-group.tsx +44 -0
- package/src/ui/scroll-area.tsx +11 -2
- package/src/ui/select.tsx +2 -2
- package/src/ui/sidebar.tsx +4 -4
- package/src/ui/tabs.tsx +3 -3
package/src/ui/badge.tsx
CHANGED
|
@@ -3,36 +3,58 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
3
3
|
import { cn } from "../lib/utils.js"
|
|
4
4
|
import { Slot } from "radix-ui"
|
|
5
5
|
|
|
6
|
+
const TAG_COLORS = {
|
|
7
|
+
default: "bg-default-tag text-default-tag-foreground",
|
|
8
|
+
gray: "bg-gray-tag text-gray-tag-foreground",
|
|
9
|
+
brown: "bg-brown-tag text-brown-tag-foreground",
|
|
10
|
+
orange: "bg-orange-tag text-orange-tag-foreground",
|
|
11
|
+
yellow: "bg-yellow-tag text-yellow-tag-foreground",
|
|
12
|
+
green: "bg-green-tag text-green-tag-foreground",
|
|
13
|
+
blue: "bg-blue-tag text-blue-tag-foreground",
|
|
14
|
+
purple: "bg-purple-tag text-purple-tag-foreground",
|
|
15
|
+
pink: "bg-pink-tag text-pink-tag-foreground",
|
|
16
|
+
red: "bg-red-tag text-red-tag-foreground",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Every variant a palette colour applies to: all but destructive.
|
|
20
|
+
const COLORED_VARIANTS = ["default", "secondary", "outline", "ghost", "link", "tag"] as const
|
|
21
|
+
|
|
6
22
|
const badgeVariants = cva(
|
|
7
23
|
"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
8
24
|
{
|
|
9
25
|
variants: {
|
|
10
26
|
variant: {
|
|
11
|
-
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary
|
|
27
|
+
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary-hover",
|
|
12
28
|
secondary:
|
|
13
29
|
"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
14
30
|
destructive:
|
|
15
|
-
"bg-destructive text-
|
|
31
|
+
"bg-destructive text-destructive-foreground focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90 dark:[a&]:hover:bg-destructive/50",
|
|
16
32
|
outline:
|
|
17
33
|
"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
18
34
|
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
19
|
-
link: "text-
|
|
35
|
+
link: "text-link underline-offset-4 [a&]:hover:underline",
|
|
20
36
|
tag: "h-5 rounded-xs px-1.5 py-0 text-sm font-normal",
|
|
21
37
|
},
|
|
22
38
|
color: {
|
|
23
39
|
none: "",
|
|
24
|
-
default: "
|
|
25
|
-
gray: "
|
|
26
|
-
brown: "
|
|
27
|
-
orange: "
|
|
28
|
-
yellow: "
|
|
29
|
-
green: "
|
|
30
|
-
blue: "
|
|
31
|
-
purple: "
|
|
32
|
-
pink: "
|
|
33
|
-
red: "
|
|
40
|
+
default: "",
|
|
41
|
+
gray: "",
|
|
42
|
+
brown: "",
|
|
43
|
+
orange: "",
|
|
44
|
+
yellow: "",
|
|
45
|
+
green: "",
|
|
46
|
+
blue: "",
|
|
47
|
+
purple: "",
|
|
48
|
+
pink: "",
|
|
49
|
+
red: "",
|
|
34
50
|
},
|
|
35
51
|
},
|
|
52
|
+
// A destructive badge keeps its own fill and text whatever its colour.
|
|
53
|
+
compoundVariants: Object.entries(TAG_COLORS).map(([color, className]) => ({
|
|
54
|
+
variant: [...COLORED_VARIANTS],
|
|
55
|
+
color: color as keyof typeof TAG_COLORS,
|
|
56
|
+
className,
|
|
57
|
+
})),
|
|
36
58
|
defaultVariants: {
|
|
37
59
|
variant: "default",
|
|
38
60
|
color: "none",
|
package/src/ui/button-group.tsx
CHANGED
|
@@ -67,7 +67,7 @@ function ButtonGroupSeparator({
|
|
|
67
67
|
data-slot="button-group-separator"
|
|
68
68
|
orientation={orientation}
|
|
69
69
|
className={cn(
|
|
70
|
-
"relative m-0! self-stretch bg-
|
|
70
|
+
"relative m-0! self-stretch bg-border data-[orientation=vertical]:h-auto",
|
|
71
71
|
className
|
|
72
72
|
)}
|
|
73
73
|
{...props}
|
package/src/ui/button.tsx
CHANGED
|
@@ -10,12 +10,12 @@ const buttonVariants = cva(
|
|
|
10
10
|
variant: {
|
|
11
11
|
default: "bg-primary text-primary-foreground hover:bg-primary-hover",
|
|
12
12
|
destructive:
|
|
13
|
-
"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
13
|
+
"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:hover:bg-destructive/50 dark:focus-visible:ring-destructive/40",
|
|
14
14
|
outline:
|
|
15
|
-
"border border-
|
|
15
|
+
"border border-border bg-background hover:bg-accent hover:text-accent-foreground",
|
|
16
16
|
secondary: "bg-secondary text-secondary-foreground hover:bg-accent-strong",
|
|
17
17
|
ghost: "text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
18
|
-
link: "text-
|
|
18
|
+
link: "text-link underline-offset-4 hover:underline",
|
|
19
19
|
},
|
|
20
20
|
size: {
|
|
21
21
|
default:
|
package/src/ui/checkbox.tsx
CHANGED
|
@@ -22,7 +22,7 @@ function Checkbox({
|
|
|
22
22
|
data-slot="checkbox-indicator"
|
|
23
23
|
className="grid place-content-center text-current transition-none"
|
|
24
24
|
>
|
|
25
|
-
<CheckIcon className="
|
|
25
|
+
<CheckIcon className="size-3.5" />
|
|
26
26
|
</CheckboxPrimitive.Indicator>
|
|
27
27
|
</CheckboxPrimitive.Root>
|
|
28
28
|
)
|
package/src/ui/dropdown-menu.tsx
CHANGED
|
@@ -73,7 +73,7 @@ function DropdownMenuItem({
|
|
|
73
73
|
data-inset={inset}
|
|
74
74
|
data-variant={variant}
|
|
75
75
|
className={cn(
|
|
76
|
-
"relative flex cursor-default items-center gap-2 rounded-md min-h-7 px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/
|
|
76
|
+
"relative flex cursor-default items-center gap-2 rounded-md min-h-7 px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/10 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
77
77
|
className
|
|
78
78
|
)}
|
|
79
79
|
{...props}
|
package/src/ui/empty.tsx
CHANGED
|
@@ -72,7 +72,7 @@ function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
|
72
72
|
<div
|
|
73
73
|
data-slot="empty-description"
|
|
74
74
|
className={cn(
|
|
75
|
-
"text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-
|
|
75
|
+
"text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-link",
|
|
76
76
|
className
|
|
77
77
|
)}
|
|
78
78
|
{...props}
|
package/src/ui/field.tsx
CHANGED
|
@@ -130,7 +130,7 @@ function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
130
130
|
<div
|
|
131
131
|
data-slot="field-label"
|
|
132
132
|
className={cn(
|
|
133
|
-
"
|
|
133
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
|
|
134
134
|
className
|
|
135
135
|
)}
|
|
136
136
|
{...props}
|
|
@@ -145,7 +145,7 @@ function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
|
145
145
|
className={cn(
|
|
146
146
|
"text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance",
|
|
147
147
|
"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
|
|
148
|
-
"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-
|
|
148
|
+
"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-link",
|
|
149
149
|
className
|
|
150
150
|
)}
|
|
151
151
|
{...props}
|
package/src/ui/item.tsx
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react"
|
|
2
4
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
5
|
import { cn } from "../lib/utils.js"
|
|
@@ -5,14 +7,19 @@ import { Slot } from "radix-ui"
|
|
|
5
7
|
|
|
6
8
|
import { Separator } from "./separator.js"
|
|
7
9
|
|
|
10
|
+
// Set by ItemGroup so that its items render as list items (axe aria-required-children).
|
|
11
|
+
const ItemGroupContext = React.createContext(false)
|
|
12
|
+
|
|
8
13
|
function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
9
14
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
<ItemGroupContext.Provider value={true}>
|
|
16
|
+
<div
|
|
17
|
+
role="list"
|
|
18
|
+
data-slot="item-group"
|
|
19
|
+
className={cn("group/item-group flex flex-col", className)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
</ItemGroupContext.Provider>
|
|
16
23
|
)
|
|
17
24
|
}
|
|
18
25
|
|
|
@@ -60,8 +67,12 @@ function Item({
|
|
|
60
67
|
}: React.ComponentProps<"div"> &
|
|
61
68
|
VariantProps<typeof itemVariants> & { asChild?: boolean }) {
|
|
62
69
|
const Comp = asChild ? Slot.Root : "div"
|
|
70
|
+
const isInGroup = React.useContext(ItemGroupContext)
|
|
71
|
+
// An asChild item keeps its child's own role (a link stays a link).
|
|
72
|
+
const role = isInGroup && !asChild ? "listitem" : undefined
|
|
63
73
|
return (
|
|
64
74
|
<Comp
|
|
75
|
+
role={role}
|
|
65
76
|
data-slot="item"
|
|
66
77
|
data-variant={variant}
|
|
67
78
|
data-size={size}
|
|
@@ -135,7 +146,7 @@ function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
|
135
146
|
data-slot="item-description"
|
|
136
147
|
className={cn(
|
|
137
148
|
"line-clamp-2 text-sm leading-normal font-normal text-balance text-muted-foreground",
|
|
138
|
-
"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-
|
|
149
|
+
"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-link",
|
|
139
150
|
className
|
|
140
151
|
)}
|
|
141
152
|
{...props}
|
package/src/ui/progress.tsx
CHANGED
|
@@ -4,14 +4,25 @@ import * as React from "react"
|
|
|
4
4
|
import { cn } from "../lib/utils.js"
|
|
5
5
|
import { Progress as ProgressPrimitive } from "radix-ui"
|
|
6
6
|
|
|
7
|
+
const FILL_CLASS = /(^|\s)bg-/
|
|
8
|
+
|
|
9
|
+
function hasFillClass(className: string | undefined): boolean {
|
|
10
|
+
return className !== undefined && FILL_CLASS.test(className)
|
|
11
|
+
}
|
|
12
|
+
|
|
7
13
|
function Progress({
|
|
8
14
|
className,
|
|
15
|
+
indicatorClassName,
|
|
9
16
|
value,
|
|
10
17
|
...props
|
|
11
|
-
}: React.ComponentProps<typeof ProgressPrimitive.Root>
|
|
18
|
+
}: React.ComponentProps<typeof ProgressPrimitive.Root> & {
|
|
19
|
+
/** Classes merged over the indicator's, e.g. another fill colour. */
|
|
20
|
+
indicatorClassName?: string
|
|
21
|
+
}) {
|
|
12
22
|
return (
|
|
13
23
|
<ProgressPrimitive.Root
|
|
14
24
|
data-slot="progress"
|
|
25
|
+
value={value}
|
|
15
26
|
className={cn(
|
|
16
27
|
"relative h-1.5 w-full overflow-hidden rounded-full bg-primary/20",
|
|
17
28
|
className
|
|
@@ -20,7 +31,13 @@ function Progress({
|
|
|
20
31
|
>
|
|
21
32
|
<ProgressPrimitive.Indicator
|
|
22
33
|
data-slot="progress-indicator"
|
|
23
|
-
className=
|
|
34
|
+
className={cn(
|
|
35
|
+
"h-full w-full flex-1 bg-primary transition-all",
|
|
36
|
+
// In dark the default fill is the lighter link blue, so it reaches 3:1 against its track; a fill colour of
|
|
37
|
+
// the caller's own replaces both.
|
|
38
|
+
!hasFillClass(indicatorClassName) && "dark:bg-link",
|
|
39
|
+
indicatorClassName
|
|
40
|
+
)}
|
|
24
41
|
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
25
42
|
/>
|
|
26
43
|
</ProgressPrimitive.Root>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "../lib/utils.js"
|
|
5
|
+
import { CircleIcon } from "lucide-react"
|
|
6
|
+
import { RadioGroup as RadioGroupPrimitive } from "radix-ui"
|
|
7
|
+
|
|
8
|
+
function RadioGroup({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<RadioGroupPrimitive.Root
|
|
14
|
+
data-slot="radio-group"
|
|
15
|
+
className={cn("grid gap-3", className)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function RadioGroupItem({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
|
|
25
|
+
return (
|
|
26
|
+
<RadioGroupPrimitive.Item
|
|
27
|
+
data-slot="radio-group-item"
|
|
28
|
+
className={cn(
|
|
29
|
+
"aspect-square size-4 shrink-0 rounded-full border-[1.5px] border-muted-foreground text-primary transition-shadow outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary dark:aria-invalid:ring-destructive/40",
|
|
30
|
+
className
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
<RadioGroupPrimitive.Indicator
|
|
35
|
+
data-slot="radio-group-indicator"
|
|
36
|
+
className="relative flex items-center justify-center"
|
|
37
|
+
>
|
|
38
|
+
<CircleIcon className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary" />
|
|
39
|
+
</RadioGroupPrimitive.Indicator>
|
|
40
|
+
</RadioGroupPrimitive.Item>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { RadioGroup, RadioGroupItem }
|
package/src/ui/scroll-area.tsx
CHANGED
|
@@ -7,17 +7,26 @@ import { ScrollArea as ScrollAreaPrimitive } from "radix-ui"
|
|
|
7
7
|
function ScrollArea({
|
|
8
8
|
className,
|
|
9
9
|
children,
|
|
10
|
+
viewportProps,
|
|
10
11
|
...props
|
|
11
|
-
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>
|
|
12
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {
|
|
13
|
+
viewportProps?: React.ComponentProps<typeof ScrollAreaPrimitive.Viewport>
|
|
14
|
+
}) {
|
|
12
15
|
return (
|
|
13
16
|
<ScrollAreaPrimitive.Root
|
|
14
17
|
data-slot="scroll-area"
|
|
15
18
|
className={cn("relative", className)}
|
|
16
19
|
{...props}
|
|
17
20
|
>
|
|
21
|
+
{/* Focusable, so keyboard users can scroll content without focusable elements (axe scrollable-region-focusable). */}
|
|
18
22
|
<ScrollAreaPrimitive.Viewport
|
|
23
|
+
tabIndex={0}
|
|
19
24
|
data-slot="scroll-area-viewport"
|
|
20
|
-
|
|
25
|
+
{...viewportProps}
|
|
26
|
+
className={cn(
|
|
27
|
+
"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-1",
|
|
28
|
+
viewportProps?.className
|
|
29
|
+
)}
|
|
21
30
|
>
|
|
22
31
|
{children}
|
|
23
32
|
</ScrollAreaPrimitive.Viewport>
|
package/src/ui/select.tsx
CHANGED
|
@@ -108,7 +108,7 @@ function SelectItem({
|
|
|
108
108
|
<SelectPrimitive.Item
|
|
109
109
|
data-slot="select-item"
|
|
110
110
|
className={cn(
|
|
111
|
-
"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 min-h-7 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
111
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 min-h-7 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
112
112
|
className
|
|
113
113
|
)}
|
|
114
114
|
{...props}
|
|
@@ -152,7 +152,7 @@ function SelectScrollUpButton({
|
|
|
152
152
|
)}
|
|
153
153
|
{...props}
|
|
154
154
|
>
|
|
155
|
-
<ChevronUpIcon className="
|
|
155
|
+
<ChevronUpIcon className="size-4" />
|
|
156
156
|
</SelectPrimitive.ScrollUpButton>
|
|
157
157
|
)
|
|
158
158
|
}
|
package/src/ui/sidebar.tsx
CHANGED
|
@@ -175,7 +175,7 @@ function Sidebar({
|
|
|
175
175
|
<div
|
|
176
176
|
data-slot="sidebar"
|
|
177
177
|
className={cn(
|
|
178
|
-
"
|
|
178
|
+
"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
|
|
179
179
|
className
|
|
180
180
|
)}
|
|
181
181
|
{...props}
|
|
@@ -192,7 +192,7 @@ function Sidebar({
|
|
|
192
192
|
data-sidebar="sidebar"
|
|
193
193
|
data-slot="sidebar"
|
|
194
194
|
data-mobile="true"
|
|
195
|
-
className="
|
|
195
|
+
className="w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden"
|
|
196
196
|
style={
|
|
197
197
|
{
|
|
198
198
|
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
|
@@ -223,7 +223,7 @@ function Sidebar({
|
|
|
223
223
|
<div
|
|
224
224
|
data-slot="sidebar-gap"
|
|
225
225
|
className={cn(
|
|
226
|
-
"
|
|
226
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
227
227
|
"group-data-[collapsible=offcanvas]:w-0",
|
|
228
228
|
"group-data-[side=right]:rotate-180",
|
|
229
229
|
variant === "floating" || variant === "inset"
|
|
@@ -421,7 +421,7 @@ function SidebarGroupLabel({
|
|
|
421
421
|
data-slot="sidebar-group-label"
|
|
422
422
|
data-sidebar="group-label"
|
|
423
423
|
className={cn(
|
|
424
|
-
"flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-
|
|
424
|
+
"flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-muted-foreground ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
425
425
|
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
426
426
|
className
|
|
427
427
|
)}
|
package/src/ui/tabs.tsx
CHANGED
|
@@ -63,9 +63,9 @@ function TabsTrigger({
|
|
|
63
63
|
<TabsPrimitive.Trigger
|
|
64
64
|
data-slot="tabs-trigger"
|
|
65
65
|
className={cn(
|
|
66
|
-
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground
|
|
67
|
-
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent
|
|
68
|
-
"data-[state=active]:bg-background data-[state=active]:text-foreground
|
|
66
|
+
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-muted-foreground transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
67
|
+
"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
|
+
"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
69
|
"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",
|
|
70
70
|
className
|
|
71
71
|
)}
|