@softure-ai/theme-notion 0.1.1 → 0.3.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.
Files changed (137) hide show
  1. package/CHANGELOG.md +178 -0
  2. package/README.md +239 -12
  3. package/dist/index.d.ts +12 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +12 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/messages/en.d.ts +20 -0
  8. package/dist/messages/en.d.ts.map +1 -1
  9. package/dist/messages/en.js +11 -0
  10. package/dist/messages/en.js.map +1 -1
  11. package/dist/messages/index.d.ts +20 -0
  12. package/dist/messages/index.d.ts.map +1 -1
  13. package/dist/notion/Code.d.ts +8 -0
  14. package/dist/notion/Code.d.ts.map +1 -0
  15. package/dist/notion/Code.js +12 -0
  16. package/dist/notion/Code.js.map +1 -0
  17. package/dist/notion/DetailTable.d.ts +15 -0
  18. package/dist/notion/DetailTable.d.ts.map +1 -0
  19. package/dist/notion/DetailTable.js +20 -0
  20. package/dist/notion/DetailTable.js.map +1 -0
  21. package/dist/notion/FilterChip.d.ts +24 -0
  22. package/dist/notion/FilterChip.d.ts.map +1 -0
  23. package/dist/notion/FilterChip.js +18 -0
  24. package/dist/notion/FilterChip.js.map +1 -0
  25. package/dist/notion/FoldRow.d.ts +23 -0
  26. package/dist/notion/FoldRow.d.ts.map +1 -0
  27. package/dist/notion/FoldRow.js +14 -0
  28. package/dist/notion/FoldRow.js.map +1 -0
  29. package/dist/notion/MarkPopover.d.ts +19 -0
  30. package/dist/notion/MarkPopover.d.ts.map +1 -0
  31. package/dist/notion/MarkPopover.js +22 -0
  32. package/dist/notion/MarkPopover.js.map +1 -0
  33. package/dist/notion/PageHeader.d.ts +2 -1
  34. package/dist/notion/PageHeader.d.ts.map +1 -1
  35. package/dist/notion/PageHeader.js +2 -2
  36. package/dist/notion/PageHeader.js.map +1 -1
  37. package/dist/notion/SidePanel.d.ts +13 -0
  38. package/dist/notion/SidePanel.d.ts.map +1 -0
  39. package/dist/notion/SidePanel.js +28 -0
  40. package/dist/notion/SidePanel.js.map +1 -0
  41. package/dist/notion/Sortable.d.ts +36 -0
  42. package/dist/notion/Sortable.d.ts.map +1 -0
  43. package/dist/notion/Sortable.js +83 -0
  44. package/dist/notion/Sortable.js.map +1 -0
  45. package/dist/notion/Stats.d.ts +49 -0
  46. package/dist/notion/Stats.d.ts.map +1 -0
  47. package/dist/notion/Stats.js +38 -0
  48. package/dist/notion/Stats.js.map +1 -0
  49. package/dist/notion/Steps.d.ts +18 -0
  50. package/dist/notion/Steps.d.ts.map +1 -0
  51. package/dist/notion/Steps.js +32 -0
  52. package/dist/notion/Steps.js.map +1 -0
  53. package/dist/notion/TabBar.d.ts +15 -0
  54. package/dist/notion/TabBar.d.ts.map +1 -0
  55. package/dist/notion/TabBar.js +6 -0
  56. package/dist/notion/TabBar.js.map +1 -0
  57. package/dist/notion/tones.d.ts +8 -0
  58. package/dist/notion/tones.d.ts.map +1 -0
  59. package/dist/notion/tones.js +37 -0
  60. package/dist/notion/tones.js.map +1 -0
  61. package/dist/page.css +22 -0
  62. package/dist/theme.css +55 -46
  63. package/dist/tokens.d.ts +82 -64
  64. package/dist/tokens.d.ts.map +1 -1
  65. package/dist/tokens.js +22 -19
  66. package/dist/tokens.js.map +1 -1
  67. package/dist/ui/alert.js +1 -1
  68. package/dist/ui/alert.js.map +1 -1
  69. package/dist/ui/badge.d.ts +1 -1
  70. package/dist/ui/badge.d.ts.map +1 -1
  71. package/dist/ui/badge.js +33 -13
  72. package/dist/ui/badge.js.map +1 -1
  73. package/dist/ui/button-group.js +1 -1
  74. package/dist/ui/button-group.js.map +1 -1
  75. package/dist/ui/button.d.ts +1 -1
  76. package/dist/ui/button.js +3 -3
  77. package/dist/ui/button.js.map +1 -1
  78. package/dist/ui/checkbox.js +1 -1
  79. package/dist/ui/checkbox.js.map +1 -1
  80. package/dist/ui/dropdown-menu.js +1 -1
  81. package/dist/ui/empty.js +1 -1
  82. package/dist/ui/empty.js.map +1 -1
  83. package/dist/ui/field.js +2 -2
  84. package/dist/ui/field.js.map +1 -1
  85. package/dist/ui/item.d.ts.map +1 -1
  86. package/dist/ui/item.js +8 -3
  87. package/dist/ui/item.js.map +1 -1
  88. package/dist/ui/progress.d.ts +4 -1
  89. package/dist/ui/progress.d.ts.map +1 -1
  90. package/dist/ui/progress.js +9 -2
  91. package/dist/ui/progress.js.map +1 -1
  92. package/dist/ui/radio-group.d.ts +6 -0
  93. package/dist/ui/radio-group.d.ts.map +1 -0
  94. package/dist/ui/radio-group.js +14 -0
  95. package/dist/ui/radio-group.js.map +1 -0
  96. package/dist/ui/scroll-area.d.ts +3 -1
  97. package/dist/ui/scroll-area.d.ts.map +1 -1
  98. package/dist/ui/scroll-area.js +2 -2
  99. package/dist/ui/scroll-area.js.map +1 -1
  100. package/dist/ui/select.js +2 -2
  101. package/dist/ui/select.js.map +1 -1
  102. package/dist/ui/sidebar.js +4 -4
  103. package/dist/ui/sidebar.js.map +1 -1
  104. package/dist/ui/tabs.js +1 -1
  105. package/dist/ui/tabs.js.map +1 -1
  106. package/package.json +16 -5
  107. package/src/index.ts +32 -0
  108. package/src/messages/en.ts +12 -0
  109. package/src/notion/Code.tsx +39 -0
  110. package/src/notion/DetailTable.tsx +46 -0
  111. package/src/notion/FilterChip.tsx +71 -0
  112. package/src/notion/FoldRow.tsx +78 -0
  113. package/src/notion/MarkPopover.tsx +84 -0
  114. package/src/notion/PageHeader.tsx +4 -2
  115. package/src/notion/SidePanel.tsx +73 -0
  116. package/src/notion/Sortable.tsx +235 -0
  117. package/src/notion/Stats.tsx +165 -0
  118. package/src/notion/Steps.tsx +102 -0
  119. package/src/notion/TabBar.tsx +47 -0
  120. package/src/notion/tones.ts +45 -0
  121. package/src/page.css +22 -0
  122. package/src/tokens.ts +22 -19
  123. package/src/ui/alert.tsx +1 -1
  124. package/src/ui/badge.tsx +35 -13
  125. package/src/ui/button-group.tsx +1 -1
  126. package/src/ui/button.tsx +3 -3
  127. package/src/ui/checkbox.tsx +1 -1
  128. package/src/ui/dropdown-menu.tsx +1 -1
  129. package/src/ui/empty.tsx +1 -1
  130. package/src/ui/field.tsx +2 -2
  131. package/src/ui/item.tsx +16 -7
  132. package/src/ui/progress.tsx +19 -2
  133. package/src/ui/radio-group.tsx +44 -0
  134. package/src/ui/scroll-area.tsx +11 -2
  135. package/src/ui/select.tsx +2 -2
  136. package/src/ui/sidebar.tsx +4 -4
  137. package/src/ui/tabs.tsx +3 -3
package/src/tokens.ts CHANGED
@@ -14,67 +14,69 @@ export const NOTION_THEME = defineTheme({
14
14
  "card-foreground": { light: "#37352f", dark: "#d4d4d4" },
15
15
  popover: { light: "#ffffff", dark: "#252525" },
16
16
  "popover-foreground": { light: "#37352f", dark: "#d4d4d4" },
17
- primary: { light: "#2383e2", dark: "#2383e2" },
17
+ primary: { light: "#0171cf", dark: "#0171cf" },
18
18
  "primary-foreground": { light: "#ffffff", dark: "#ffffff" },
19
- "primary-hover": { light: "#0077d4", dark: "#0077d4" },
19
+ "primary-hover": { light: "#0066b8", dark: "#0066b8" },
20
+ link: { light: "#0171cf", dark: "#409cfd" },
20
21
  secondary: { light: "#f1f1ef", dark: "#2f2f2f" },
21
22
  "secondary-foreground": { light: "#37352f", dark: "#d4d4d4" },
23
+ "code-foreground": { light: "#c33c39", dark: "#f86a66" },
22
24
  muted: { light: "#f7f7f5", dark: "#202020" },
23
- "muted-foreground": { light: "#787774", dark: "#9b9b9b" },
25
+ "muted-foreground": { light: "#656461", dark: "#a5a5a5" },
24
26
  accent: { light: "rgba(55, 53, 47, 0.08)", dark: "rgba(255, 255, 255, 0.055)" },
25
27
  "accent-foreground": { light: "#37352f", dark: "#d4d4d4" },
26
28
  "accent-strong": { light: "rgba(55, 53, 47, 0.16)", dark: "rgba(255, 255, 255, 0.1)" },
27
- destructive: { light: "#eb5757", dark: "#eb5757" },
29
+ destructive: { light: "#c63339", dark: "#fd6866" },
28
30
  "destructive-foreground": { light: "#ffffff", dark: "#ffffff" },
29
31
  border: { light: "#e9e9e7", dark: "#2f2f2f" },
30
- input: { light: "rgba(15, 15, 15, 0.1)", dark: "rgba(255, 255, 255, 0.075)" },
32
+ input: { light: "rgba(15, 15, 15, 0.46)", dark: "rgba(255, 255, 255, 0.36)" },
31
33
  field: { light: "rgba(242, 241, 238, 0.6)", dark: "rgba(255, 255, 255, 0.055)" },
32
- "control-off": { light: "rgba(135, 131, 120, 0.3)", dark: "rgba(202, 196, 183, 0.15)" },
33
- ring: { light: "rgba(35, 131, 226, 0.57)", dark: "rgba(35, 131, 226, 0.57)" },
34
+ "control-off": { light: "rgba(135, 131, 120, 0.95)", dark: "rgba(202, 196, 183, 0.5)" },
35
+ ring: { light: "rgba(1, 113, 207, 0.8)", dark: "rgba(64, 156, 253, 0.65)" },
34
36
  sidebar: { light: "#f7f7f5", dark: "#202020" },
35
37
  "sidebar-foreground": { light: "#5f5e5b", dark: "#9b9b9b" },
36
- "sidebar-primary": { light: "#2383e2", dark: "#2383e2" },
38
+ "sidebar-primary": { light: "#0171cf", dark: "#0171cf" },
37
39
  "sidebar-primary-foreground": { light: "#ffffff", dark: "#ffffff" },
38
40
  "sidebar-accent": { light: "rgba(55, 53, 47, 0.08)", dark: "rgba(255, 255, 255, 0.055)" },
39
41
  "sidebar-accent-foreground": { light: "#37352f", dark: "#d4d4d4" },
40
42
  "sidebar-border": { light: "#ededeb", dark: "#2a2a2a" },
41
- "sidebar-ring": { light: "rgba(35, 131, 226, 0.57)", dark: "rgba(35, 131, 226, 0.57)" },
43
+ "sidebar-ring": { light: "rgba(1, 113, 207, 0.8)", dark: "rgba(64, 156, 253, 0.65)" },
42
44
  tooltip: { light: "#0f0f0f", dark: "#373737" },
43
45
  "tooltip-foreground": { light: "rgba(255, 255, 255, 0.9)", dark: "rgba(255, 255, 255, 0.9)" },
44
46
  overlay: { light: "rgba(15, 15, 15, 0.6)", dark: "rgba(0, 0, 0, 0.6)" },
45
- gray: { light: "#787774", dark: "#9b9b9b" },
47
+ gray: { light: "#656461", dark: "#a5a5a5" },
46
48
  "gray-bg": { light: "#f1f1ef", dark: "#2f2f2f" },
47
49
  "gray-tag": { light: "#e3e2e0", dark: "#5a5a5a" },
48
50
  "gray-tag-foreground": { light: "#32302c", dark: "rgba(255, 255, 255, 0.81)" },
49
- brown: { light: "#9f6b53", dark: "#ba856f" },
51
+ brown: { light: "#98644d", dark: "#ba856f" },
50
52
  "brown-bg": { light: "#f4eeee", dark: "#4a3228" },
51
53
  "brown-tag": { light: "#eee0da", dark: "#603b2c" },
52
54
  "brown-tag-foreground": { light: "#442a1e", dark: "rgba(255, 255, 255, 0.81)" },
53
- orange: { light: "#d9730d", dark: "#c77d48" },
55
+ orange: { light: "#af5a02", dark: "#c77d48" },
54
56
  "orange-bg": { light: "#fbecdd", dark: "#5c3b23" },
55
57
  "orange-tag": { light: "#fadec9", dark: "#854c1d" },
56
58
  "orange-tag-foreground": { light: "#49290e", dark: "rgba(255, 255, 255, 0.81)" },
57
- yellow: { light: "#cb912f", dark: "#ca984d" },
59
+ yellow: { light: "#986702", dark: "#ca984d" },
58
60
  "yellow-bg": { light: "#fbf3db", dark: "#564328" },
59
- "yellow-tag": { light: "#fdecc8", dark: "#89632a" },
61
+ "yellow-tag": { light: "#fdecc8", dark: "#825c23" },
60
62
  "yellow-tag-foreground": { light: "#402c1b", dark: "rgba(255, 255, 255, 0.81)" },
61
- green: { light: "#448361", dark: "#529e72" },
63
+ green: { light: "#3e7d5c", dark: "#529e72" },
62
64
  "green-bg": { light: "#edf3ec", dark: "#243d30" },
63
65
  "green-tag": { light: "#dbeddb", dark: "#2b593f" },
64
66
  "green-tag-foreground": { light: "#1c3829", dark: "rgba(255, 255, 255, 0.81)" },
65
- blue: { light: "#337ea9", dark: "#379ad3" },
67
+ blue: { light: "#2b77a2", dark: "#379ad3" },
66
68
  "blue-bg": { light: "#e7f3f8", dark: "#143a4e" },
67
69
  "blue-tag": { light: "#d3e5ef", dark: "#28456c" },
68
70
  "blue-tag-foreground": { light: "#183347", dark: "rgba(255, 255, 255, 0.81)" },
69
- purple: { light: "#9065b0", dark: "#9d68d3" },
71
+ purple: { light: "#8a5faa", dark: "#a974e0" },
70
72
  "purple-bg": { light: "#f6f3f9", dark: "#3c2d49" },
71
73
  "purple-tag": { light: "#e8deee", dark: "#492f64" },
72
74
  "purple-tag-foreground": { light: "#412454", dark: "rgba(255, 255, 255, 0.81)" },
73
- pink: { light: "#c14c8a", dark: "#d15796" },
75
+ pink: { light: "#ba4684", dark: "#dc61a0" },
74
76
  "pink-bg": { light: "#faf1f5", dark: "#4e2c3c" },
75
77
  "pink-tag": { light: "#f5e0e9", dark: "#69314c" },
76
78
  "pink-tag-foreground": { light: "#4c2337", dark: "rgba(255, 255, 255, 0.81)" },
77
- red: { light: "#d44c47", dark: "#df5452" },
79
+ red: { light: "#c8413d", dark: "#ea5e5b" },
78
80
  "red-bg": { light: "#fdebec", dark: "#522e2a" },
79
81
  "red-tag": { light: "#ffe2dd", dark: "#6e3630" },
80
82
  "red-tag-foreground": { light: "#5d1715", dark: "rgba(255, 255, 255, 0.81)" },
@@ -131,6 +133,7 @@ export const NOTION_THEME = defineTheme({
131
133
  "content-width-wide": "1152px",
132
134
  "control-height": "28px",
133
135
  "row-height": "34px",
136
+ "touch-target": "44px",
134
137
  },
135
138
  // The design system allows only its own colours, so no raw Tailwind colour utility exists.
136
139
  clearDefaultPalette: true,
package/src/ui/alert.tsx CHANGED
@@ -9,7 +9,7 @@ const alertVariants = cva(
9
9
  variant: {
10
10
  default: "bg-card text-card-foreground",
11
11
  destructive:
12
- "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current",
12
+ "bg-card text-destructive *:data-[slot=alert-description]:text-destructive [&>svg]:text-current",
13
13
  gray: "border-transparent bg-gray-bg text-foreground [&>svg]:text-gray *:data-[slot=alert-description]:text-foreground",
14
14
  brown: "border-transparent bg-brown-bg text-foreground [&>svg]:text-brown *:data-[slot=alert-description]:text-foreground",
15
15
  orange: "border-transparent bg-orange-bg text-foreground [&>svg]:text-orange *:data-[slot=alert-description]:text-foreground",
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/90",
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-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
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-primary underline-offset-4 [a&]:hover:underline",
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: "bg-default-tag text-default-tag-foreground",
25
- gray: "bg-gray-tag text-gray-tag-foreground",
26
- brown: "bg-brown-tag text-brown-tag-foreground",
27
- orange: "bg-orange-tag text-orange-tag-foreground",
28
- yellow: "bg-yellow-tag text-yellow-tag-foreground",
29
- green: "bg-green-tag text-green-tag-foreground",
30
- blue: "bg-blue-tag text-blue-tag-foreground",
31
- purple: "bg-purple-tag text-purple-tag-foreground",
32
- pink: "bg-pink-tag text-pink-tag-foreground",
33
- red: "bg-red-tag text-red-tag-foreground",
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",
@@ -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-input data-[orientation=vertical]:h-auto",
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-input bg-background hover:bg-accent hover:text-accent-foreground",
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-primary underline-offset-4 hover:underline",
18
+ link: "text-link underline-offset-4 hover:underline",
19
19
  },
20
20
  size: {
21
21
  default:
@@ -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="grid place-content-center text-current transition-none" />
25
+ <CheckIcon className="size-3.5" />
26
26
  </CheckboxPrimitive.Indicator>
27
27
  </CheckboxPrimitive.Root>
28
28
  )
@@ -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/20 [&_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!",
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-primary",
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
- "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
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-primary",
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
@@ -5,14 +5,19 @@ import { Slot } from "radix-ui"
5
5
 
6
6
  import { Separator } from "./separator.js"
7
7
 
8
+ // Set by ItemGroup so that its items render as list items (axe aria-required-children).
9
+ const ItemGroupContext = React.createContext(false)
10
+
8
11
  function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
9
12
  return (
10
- <div
11
- role="list"
12
- data-slot="item-group"
13
- className={cn("group/item-group flex flex-col", className)}
14
- {...props}
15
- />
13
+ <ItemGroupContext.Provider value={true}>
14
+ <div
15
+ role="list"
16
+ data-slot="item-group"
17
+ className={cn("group/item-group flex flex-col", className)}
18
+ {...props}
19
+ />
20
+ </ItemGroupContext.Provider>
16
21
  )
17
22
  }
18
23
 
@@ -60,8 +65,12 @@ function Item({
60
65
  }: React.ComponentProps<"div"> &
61
66
  VariantProps<typeof itemVariants> & { asChild?: boolean }) {
62
67
  const Comp = asChild ? Slot.Root : "div"
68
+ const isInGroup = React.useContext(ItemGroupContext)
69
+ // An asChild item keeps its child's own role (a link stays a link).
70
+ const role = isInGroup && !asChild ? "listitem" : undefined
63
71
  return (
64
72
  <Comp
73
+ role={role}
65
74
  data-slot="item"
66
75
  data-variant={variant}
67
76
  data-size={size}
@@ -135,7 +144,7 @@ function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
135
144
  data-slot="item-description"
136
145
  className={cn(
137
146
  "line-clamp-2 text-sm leading-normal font-normal text-balance text-muted-foreground",
138
- "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
147
+ "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-link",
139
148
  className
140
149
  )}
141
150
  {...props}
@@ -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="h-full w-full flex-1 bg-primary transition-all"
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 }
@@ -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
- className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-1"
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="flex cursor-default items-center justify-center py-1" />
155
+ <ChevronUpIcon className="size-4" />
156
156
  </SelectPrimitive.ScrollUpButton>
157
157
  )
158
158
  }
@@ -175,7 +175,7 @@ function Sidebar({
175
175
  <div
176
176
  data-slot="sidebar"
177
177
  className={cn(
178
- "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
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="flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground"
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
- "flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
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-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
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/60 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:text-muted-foreground 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 dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
68
- "data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark: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
  )}