@djangocfg/ui-core 2.1.634 → 2.1.636
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -8
- package/src/components/data/badge/index.tsx +10 -1
- package/src/components/data/table/index.tsx +12 -2
- package/src/components/forms/button/index.tsx +18 -4
- package/src/components/forms/control-size.ts +10 -10
- package/src/components/index.ts +2 -1
- package/src/components/navigation/context-menu/index.tsx +7 -7
- package/src/components/navigation/dropdown-menu/index.tsx +7 -7
- package/src/components/navigation/menubar/index.tsx +7 -7
- package/src/components/navigation/sidebar/sidebar.tsx +14 -23
- package/src/components/overlay/popover/index.tsx +1 -1
- package/src/components/overlay/side-panel/index.tsx +28 -4
- package/src/components/overlay/tooltip/index.tsx +56 -6
- package/src/components/select/select.tsx +4 -4
- package/src/components/specialized/copy/index.tsx +3 -0
- package/src/hooks/media/index.ts +1 -0
- package/src/hooks/media/useCanHover.ts +14 -0
- package/src/styles/css/base.css +80 -0
- package/src/styles/css/presets/notion.css +175 -0
- package/src/styles/css/theme/dark.css +23 -23
- package/src/styles/css/theme/light.css +54 -59
- package/src/styles/css/utilities/touch-safe.css +17 -3
- package/src/styles/presets/presets.ts +1 -0
- package/src/styles/presets/types.ts +2 -1
|
@@ -4,11 +4,16 @@ import * as React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
6
6
|
|
|
7
|
+
import { formatHotkey } from '../../../hooks/hotkey/formatHotkey';
|
|
8
|
+
import { useCanHover } from '../../../hooks/media/useCanHover';
|
|
7
9
|
import { cn } from '../../../lib/utils';
|
|
8
10
|
|
|
9
11
|
const TooltipProvider = TooltipPrimitive.Provider
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
/** A tooltip names a control; it is not a surface to reach into, so it closes the moment the pointer leaves the trigger (no hoverable content, as in Notion). Pass `disableHoverableContent={false}` for one with a link inside. */
|
|
14
|
+
const Tooltip = ({ disableHoverableContent = true, ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) => (
|
|
15
|
+
<TooltipPrimitive.Root disableHoverableContent={disableHoverableContent} {...props} />
|
|
16
|
+
)
|
|
12
17
|
|
|
13
18
|
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
14
19
|
|
|
@@ -22,10 +27,9 @@ const TooltipContent = React.forwardRef<
|
|
|
22
27
|
aria-describedby={undefined}
|
|
23
28
|
sideOffset={sideOffset}
|
|
24
29
|
className={cn(
|
|
25
|
-
// INVERSE
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
"z-[1400] overflow-hidden rounded-[var(--radius-tooltip)] bg-foreground px-3 py-1.5 text-xs font-medium text-background shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
30
|
+
// Surface from tokens: by default INVERSE (foreground bg + background text, high contrast on any panel);
|
|
31
|
+
// a preset (Notion) points --tooltip-bg/-fg/-border at the popover surface instead.
|
|
32
|
+
"pointer-events-none z-[1400] overflow-hidden rounded-[var(--radius-tooltip)] border border-[var(--tooltip-border,transparent)] bg-[var(--tooltip-bg,var(--foreground))] px-3 py-1.5 text-xs font-medium text-[var(--tooltip-fg,var(--background))] shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
29
33
|
className
|
|
30
34
|
)}
|
|
31
35
|
{...props}
|
|
@@ -34,4 +38,50 @@ const TooltipContent = React.forwardRef<
|
|
|
34
38
|
))
|
|
35
39
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
/** What a control says about itself on hover: a text (or node), or this config. One shape for every control that takes a `tooltip` prop. */
|
|
42
|
+
export interface TooltipConfig {
|
|
43
|
+
/** The name of the action. */
|
|
44
|
+
content: React.ReactNode
|
|
45
|
+
/** A `useHotkey` string (`mod+j`), shown after the content in a muted tone, written for the viewer's system (⌘J on a Mac, Ctrl+J elsewhere). */
|
|
46
|
+
hotkey?: string
|
|
47
|
+
side?: 'top' | 'right' | 'bottom' | 'left'
|
|
48
|
+
align?: 'start' | 'center' | 'end'
|
|
49
|
+
sideOffset?: number
|
|
50
|
+
/** Hover delay in ms. Default 400. */
|
|
51
|
+
delay?: number
|
|
52
|
+
/** Keep it open while the pointer is over it (a tooltip with a link). Default false. */
|
|
53
|
+
hoverable?: boolean
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type TooltipProp = React.ReactNode | TooltipConfig
|
|
57
|
+
|
|
58
|
+
function isConfig(value: TooltipProp): value is TooltipConfig {
|
|
59
|
+
return typeof value === 'object' && value !== null && !React.isValidElement(value) && 'content' in value
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Wraps one trigger element in the standard tooltip. This is what a `tooltip` prop on `Button` / `ButtonLink` calls; reach for it directly only around something that is not a button.
|
|
64
|
+
* It does not mount a `TooltipProvider` (the host's `UiProviders` does, once). Nothing is drawn (and no wrapper is added) when `tooltip` is empty or the device cannot hover (`useCanHover`: a phone or tablet). A disabled button gets no pointer events, so its trigger is a `span`.
|
|
65
|
+
*/
|
|
66
|
+
function TooltipHint({ tooltip, children, disabled = false }: { tooltip: TooltipProp; children: React.ReactElement; disabled?: boolean }) {
|
|
67
|
+
const canHover = useCanHover()
|
|
68
|
+
if (tooltip === undefined || tooltip === null || tooltip === false || tooltip === '' || !canHover) return children
|
|
69
|
+
const config: TooltipConfig = isConfig(tooltip) ? tooltip : { content: tooltip }
|
|
70
|
+
const trigger = disabled ? <span className="inline-flex cursor-not-allowed">{children}</span> : children
|
|
71
|
+
return (
|
|
72
|
+
<TooltipPrimitive.Root delayDuration={config.delay ?? 400} disableHoverableContent={!config.hoverable}>
|
|
73
|
+
<TooltipTrigger asChild>{trigger}</TooltipTrigger>
|
|
74
|
+
<TooltipContent
|
|
75
|
+
side={config.side}
|
|
76
|
+
align={config.align}
|
|
77
|
+
sideOffset={config.sideOffset}
|
|
78
|
+
className={cn('flex items-center gap-3', config.hotkey ? 'whitespace-nowrap' : undefined, config.hoverable && 'pointer-events-auto')}
|
|
79
|
+
>
|
|
80
|
+
<span>{config.content}</span>
|
|
81
|
+
{config.hotkey ? <span className="opacity-60">{formatHotkey(config.hotkey)}</span> : null}
|
|
82
|
+
</TooltipContent>
|
|
83
|
+
</TooltipPrimitive.Root>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, TooltipHint }
|
|
@@ -147,7 +147,7 @@ const SelectContent = React.forwardRef<
|
|
|
147
147
|
<SelectPrimitive.Content
|
|
148
148
|
ref={ref}
|
|
149
149
|
className={cn(
|
|
150
|
-
"relative z-[1400] max-h-(--radix-select-content-available-height) min-w-32 overflow-y-auto overflow-x-hidden rounded-[var(--radius-popover)] border bg-popover backdrop-blur-xl text-popover-foreground shadow-
|
|
150
|
+
"relative z-[1400] max-h-(--radix-select-content-available-height) min-w-32 overflow-y-auto overflow-x-hidden rounded-[var(--radius-popover)] border bg-popover backdrop-blur-xl text-popover-foreground shadow-(--popup-shadow) data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
151
151
|
position === "popper" &&
|
|
152
152
|
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
153
153
|
className
|
|
@@ -158,7 +158,7 @@ const SelectContent = React.forwardRef<
|
|
|
158
158
|
<SelectScrollUpButton />
|
|
159
159
|
<SelectPrimitive.Viewport
|
|
160
160
|
className={cn(
|
|
161
|
-
"p-
|
|
161
|
+
"p-(--menu-padding)",
|
|
162
162
|
position === "popper" &&
|
|
163
163
|
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
164
164
|
)}
|
|
@@ -177,7 +177,7 @@ const SelectLabel = React.forwardRef<
|
|
|
177
177
|
>(({ className, ...props }, ref) => (
|
|
178
178
|
<SelectPrimitive.Label
|
|
179
179
|
ref={ref}
|
|
180
|
-
className={cn("px-
|
|
180
|
+
className={cn("px-(--menu-item-px) py-(--menu-item-py) text-(length:--menu-label-font-size) font-(weight:--menu-label-weight) text-(color:--menu-label-color)", className)}
|
|
181
181
|
{...props}
|
|
182
182
|
/>
|
|
183
183
|
))
|
|
@@ -202,7 +202,7 @@ const SelectItem = React.forwardRef<
|
|
|
202
202
|
ref={ref}
|
|
203
203
|
value={value === '' ? EMPTY_SENTINEL : value}
|
|
204
204
|
className={cn(
|
|
205
|
-
"relative flex w-full cursor-default select-none items-center rounded-[var(--radius-sm)] py-
|
|
205
|
+
"relative flex w-full cursor-default select-none items-center rounded-[var(--radius-sm)] py-(--menu-item-py) pl-2 pr-8 text-(length:--menu-font-size) outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
206
206
|
className
|
|
207
207
|
)}
|
|
208
208
|
{...props}
|
|
@@ -7,6 +7,7 @@ import { useAppT } from '@djangocfg/i18n';
|
|
|
7
7
|
import { copyText } from '../../../lib/clipboard';
|
|
8
8
|
import { cn } from '../../../lib/utils';
|
|
9
9
|
import { Button } from '../../forms/button';
|
|
10
|
+
import type { TooltipProp } from '../../overlay/tooltip';
|
|
10
11
|
|
|
11
12
|
// =============================================================================
|
|
12
13
|
// CopyButton - Copy button with icon feedback
|
|
@@ -27,6 +28,8 @@ export interface CopyButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLBut
|
|
|
27
28
|
children?: React.ReactNode
|
|
28
29
|
/** Icon size class (default: "h-4 w-4") */
|
|
29
30
|
iconClassName?: string
|
|
31
|
+
/** Hover name (standard tooltip, hover devices only). Forwarded to the inner Button. */
|
|
32
|
+
tooltip?: TooltipProp
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
const CopyButton = React.forwardRef<HTMLButtonElement, CopyButtonProps>(
|
package/src/hooks/media/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { useMediaQuery, BREAKPOINTS as MEDIA_BREAKPOINTS } from './useMediaQuery
|
|
|
4
4
|
export { useIsMobile, useIsPhone, useIsTabletOrBelow, BREAKPOINTS } from './useMobile';
|
|
5
5
|
export type { Breakpoint } from './useMobile';
|
|
6
6
|
export { useIsTouch } from './useIsTouch';
|
|
7
|
+
export { useCanHover } from './useCanHover';
|
|
7
8
|
export { useDisplayMode, useIsPwa } from './useDisplayMode';
|
|
8
9
|
export { detectDisplayMode, syncDisplayModeAttribute } from './displayMode';
|
|
9
10
|
export type { DisplayMode } from './displayMode';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useMediaQuery } from './useMediaQuery';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Can the primary input hover (a mouse or trackpad), as opposed to a finger or a pen-less tablet?
|
|
7
|
+
*
|
|
8
|
+
* Reads `(hover: hover) and (pointer: fine)` via `matchMedia`, not the userAgent, so a touch laptop with a trackpad counts, an iPad does not, and DevTools device
|
|
9
|
+
* emulation updates live. SSR-safe (false until mounted). The tooltip of `Button` / `ButtonLink` is drawn only when this is true: there is nothing to hover on a phone,
|
|
10
|
+
* and a hint that needs a long press is noise. Hover hints are also the ones that name a keyboard shortcut, which a phone has none of.
|
|
11
|
+
*/
|
|
12
|
+
export function useCanHover(): boolean {
|
|
13
|
+
return useMediaQuery('(hover: hover) and (pointer: fine)');
|
|
14
|
+
}
|
package/src/styles/css/base.css
CHANGED
|
@@ -60,6 +60,64 @@
|
|
|
60
60
|
--font-size-xl: 1.125rem;
|
|
61
61
|
--line-height-base: 1.5;
|
|
62
62
|
--letter-spacing-base: 0em;
|
|
63
|
+
|
|
64
|
+
/* Menu tokens — one density for dropdown, context menu, menubar and select panels.
|
|
65
|
+
* Components read these; a preset changes them in one place (never per-component literals). */
|
|
66
|
+
/* Chat prose follows the theme scale (Notion: 14px / 1.5). widget-chat reads these two. */
|
|
67
|
+
/* Notion-style tag colours: a tinted fill with matching ink (Badge variants gray…red). */
|
|
68
|
+
--tag-gray-bg: #e3e2e0;
|
|
69
|
+
--tag-gray-fg: #32302c;
|
|
70
|
+
--tag-brown-bg: #eee0da;
|
|
71
|
+
--tag-brown-fg: #442a1e;
|
|
72
|
+
--tag-orange-bg: #fadec9;
|
|
73
|
+
--tag-orange-fg: #49290e;
|
|
74
|
+
--tag-yellow-bg: #fdecc8;
|
|
75
|
+
--tag-yellow-fg: #402c1b;
|
|
76
|
+
--tag-green-bg: #dbeddb;
|
|
77
|
+
--tag-green-fg: #1c3829;
|
|
78
|
+
--tag-blue-bg: #d3e5ef;
|
|
79
|
+
--tag-blue-fg: #183347;
|
|
80
|
+
--tag-purple-bg: #e8deee;
|
|
81
|
+
--tag-purple-fg: #412454;
|
|
82
|
+
--tag-pink-bg: #f5e0e9;
|
|
83
|
+
--tag-pink-fg: #4c2337;
|
|
84
|
+
--tag-red-bg: #ffe2dd;
|
|
85
|
+
--tag-red-fg: #5d1715;
|
|
86
|
+
/* The control height ladder every Button, Input and Select reads (control-size.ts). */
|
|
87
|
+
--control-h-xs: 1.75rem;
|
|
88
|
+
--control-h-sm: 2rem;
|
|
89
|
+
--control-h-default: 2.25rem;
|
|
90
|
+
--control-h-lg: 2.75rem;
|
|
91
|
+
--control-h-huge: 3.5rem;
|
|
92
|
+
--button-weight: 600;
|
|
93
|
+
/* PrivateLayout sidebar rows (desktop). */
|
|
94
|
+
--sidebar-item-h: 2rem;
|
|
95
|
+
--sidebar-item-gap: 0.125rem;
|
|
96
|
+
--sidebar-item-font: var(--font-size-sm);
|
|
97
|
+
--sidebar-item-radius: 0.5rem;
|
|
98
|
+
--sidebar-divider-h: 1px;
|
|
99
|
+
/* Badge metrics. Defaults keep the compact label; a preset widens them to a 20px tag. */
|
|
100
|
+
--badge-radius: var(--radius);
|
|
101
|
+
--badge-px: 0.625rem;
|
|
102
|
+
--badge-py: 0.125rem;
|
|
103
|
+
--badge-font-size: 0.75rem;
|
|
104
|
+
--badge-weight: 600;
|
|
105
|
+
--chat-text: var(--font-size-base);
|
|
106
|
+
--chat-leading: 1.5;
|
|
107
|
+
/* Side-panel title (widget-chat header): small caps by default, plain sentence case in Notion. */
|
|
108
|
+
--panel-title-weight: 600;
|
|
109
|
+
--panel-title-tracking: 0.025em;
|
|
110
|
+
--panel-title-color: var(--muted-foreground);
|
|
111
|
+
--panel-title-transform: uppercase;
|
|
112
|
+
/* Shadow of every popup surface (menus, select, popover). */
|
|
113
|
+
--popup-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
114
|
+
--menu-font-size: var(--font-size-sm);
|
|
115
|
+
--menu-label-font-size: var(--menu-font-size);
|
|
116
|
+
--menu-label-weight: 600;
|
|
117
|
+
--menu-label-color: inherit;
|
|
118
|
+
--menu-item-px: 0.5rem;
|
|
119
|
+
--menu-item-py: 0.375rem;
|
|
120
|
+
--menu-padding: 0.25rem;
|
|
63
121
|
}
|
|
64
122
|
|
|
65
123
|
/* Base element styles */
|
|
@@ -200,3 +258,25 @@ body {
|
|
|
200
258
|
-webkit-font-smoothing: antialiased;
|
|
201
259
|
-moz-osx-font-smoothing: grayscale;
|
|
202
260
|
}
|
|
261
|
+
|
|
262
|
+
/* Tag colours on a dark page: translucent tints, near-white ink. */
|
|
263
|
+
.dark {
|
|
264
|
+
--tag-gray-bg: rgba(255,252,235,.306);
|
|
265
|
+
--tag-gray-fg: #f0efed;
|
|
266
|
+
--tag-brown-bg: rgba(210,160,120,.40);
|
|
267
|
+
--tag-brown-fg: #f0e6df;
|
|
268
|
+
--tag-orange-bg: rgba(255,146,60,.45);
|
|
269
|
+
--tag-orange-fg: #fbeadb;
|
|
270
|
+
--tag-yellow-bg: rgba(255,188,53,.46);
|
|
271
|
+
--tag-yellow-fg: #f9f3dc;
|
|
272
|
+
--tag-green-bg: rgba(113,255,175,.337);
|
|
273
|
+
--tag-green-fg: #e8f1ec;
|
|
274
|
+
--tag-blue-bg: rgba(81,166,255,.494);
|
|
275
|
+
--tag-blue-fg: #e5f2fc;
|
|
276
|
+
--tag-purple-bg: rgba(208,147,255,.427);
|
|
277
|
+
--tag-purple-fg: #f3ebf9;
|
|
278
|
+
--tag-pink-bg: rgba(255,133,192,.427);
|
|
279
|
+
--tag-pink-fg: #faE9f1;
|
|
280
|
+
--tag-red-bg: rgba(255,116,105,.525);
|
|
281
|
+
--tag-red-fg: #fce9e7;
|
|
282
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/* Authoritative static preset: notion.
|
|
2
|
+
*
|
|
3
|
+
* Measured from app.notion.com on 2026-11-06 (its `:root, .notion-light-theme`
|
|
4
|
+
* custom properties), not eyeballed from a screenshot:
|
|
5
|
+
* canvas #fff · rail #f9f8f7 · hover #f0efed · hairline #e6e5e3
|
|
6
|
+
* ink #2c2c2b · secondary ink #7d7a75 · accent blue #2783de
|
|
7
|
+
* Notion is neutral: no brand colour on surfaces, one blue for the single
|
|
8
|
+
* primary action, and a warm-grey hover. Everything else is ink on white.
|
|
9
|
+
*/
|
|
10
|
+
:root {
|
|
11
|
+
--background: hsl(0 0% 100%);
|
|
12
|
+
--foreground: hsl(60 1% 17%);
|
|
13
|
+
--card: hsl(0 0% 100%);
|
|
14
|
+
--card-foreground: hsl(60 1% 17%);
|
|
15
|
+
--popover: hsl(0 0% 100%);
|
|
16
|
+
--popover-foreground: hsl(60 1% 17%);
|
|
17
|
+
/* Notion's blue is #2783de (white on it: 3.9:1). One lightness step deeper
|
|
18
|
+
keeps white button labels at AA (4.6:1) while staying the same hue. */
|
|
19
|
+
--primary: hsl(209 74% 47%);
|
|
20
|
+
--primary-foreground: hsl(0 0% 100%);
|
|
21
|
+
/* #f9f8f7 — Notion's "secondary background". */
|
|
22
|
+
--secondary: hsl(30 14% 97%);
|
|
23
|
+
--secondary-foreground: hsl(60 1% 17%);
|
|
24
|
+
/* #f0efed. 6.5 points under the white page: a visible chip, not a plate. */
|
|
25
|
+
--muted: hsl(40 9% 93.5%);
|
|
26
|
+
/* #7d7a75 darkened one step: AA on white and on the muted fill. */
|
|
27
|
+
--muted-foreground: hsl(37 3% 43%);
|
|
28
|
+
--surface-hover: hsl(40 9% 95%);
|
|
29
|
+
/* Hover on the page: the same warm grey as Notion's row hover. */
|
|
30
|
+
--accent: hsl(40 9% 93.5%);
|
|
31
|
+
--accent-foreground: hsl(60 1% 17%);
|
|
32
|
+
/* #cf5148 text red, #e56458 fill red; deeper for white labels. */
|
|
33
|
+
--destructive: hsl(5 62% 48%);
|
|
34
|
+
--destructive-foreground: hsl(0 0% 100%);
|
|
35
|
+
--on-destructive: hsl(0 0% 100%);
|
|
36
|
+
/* #e6e5e3 */
|
|
37
|
+
--border: hsl(40 6% 90%);
|
|
38
|
+
/* Notion fields are white with a hairline, not a grey plate. */
|
|
39
|
+
--input: hsl(0 0% 100%);
|
|
40
|
+
--divider: hsl(40 6% 92%);
|
|
41
|
+
--ring: hsl(209 74% 52%);
|
|
42
|
+
--overlay: hsl(0 0% 0% / 0.4);
|
|
43
|
+
--radius: 0.375rem;
|
|
44
|
+
--shadow-card: 0 0 0 1px rgb(15 15 15 / 0.05), 0 3px 6px rgb(15 15 15 / 0.1);
|
|
45
|
+
/* Notion's sidebar is #f9f8f7 under #fff content; its hover is a ~8% ink
|
|
46
|
+
veil, 5 points down. */
|
|
47
|
+
--sidebar-background: hsl(30 14% 97%);
|
|
48
|
+
--sidebar-foreground: hsl(60 1% 17%);
|
|
49
|
+
--sidebar-primary: hsl(209 74% 47%);
|
|
50
|
+
--sidebar-primary-foreground: hsl(0 0% 100%);
|
|
51
|
+
--sidebar-accent: hsl(40 7% 92%);
|
|
52
|
+
--sidebar-accent-foreground: hsl(60 1% 17%);
|
|
53
|
+
--sidebar-border: hsl(40 6% 90%);
|
|
54
|
+
--sidebar-ring: hsl(209 74% 52%);
|
|
55
|
+
--code: hsl(30 14% 97%);
|
|
56
|
+
--code-foreground: hsl(60 1% 17%);
|
|
57
|
+
--code-border: hsl(40 6% 90%);
|
|
58
|
+
--code-inline: hsl(40 9% 93.5%);
|
|
59
|
+
--code-inline-foreground: hsl(5 62% 42%);
|
|
60
|
+
--chart-1: hsl(209 74% 52%);
|
|
61
|
+
--chart-2: hsl(147 30% 47%);
|
|
62
|
+
--chart-3: hsl(277 30% 55%);
|
|
63
|
+
--chart-4: hsl(31 65% 51%);
|
|
64
|
+
--chart-5: hsl(5 62% 59%);
|
|
65
|
+
/* Status tints are Notion's *BacPri / *TexPri / *BorPri triples. */
|
|
66
|
+
--warning: hsl(39 60% 51%);
|
|
67
|
+
--warning-background: hsl(52 70% 96%);
|
|
68
|
+
--warning-foreground: hsl(45 53% 26%);
|
|
69
|
+
--warning-border: hsl(46 66% 82%);
|
|
70
|
+
--success: hsl(147 30% 47%);
|
|
71
|
+
--success-background: hsl(147 20% 96%);
|
|
72
|
+
--success-foreground: hsl(147 33% 25%);
|
|
73
|
+
--success-border: hsl(147 22% 87%);
|
|
74
|
+
--destructive-background: hsl(0 55% 97%);
|
|
75
|
+
--destructive-border: hsl(5 70% 92%);
|
|
76
|
+
--info: hsl(209 74% 52%);
|
|
77
|
+
--info-background: hsl(209 80% 97%);
|
|
78
|
+
--info-foreground: hsl(209 50% 29%);
|
|
79
|
+
--info-border: hsl(209 75% 91%);
|
|
80
|
+
/* Notion types in the system UI stack, 14px, with a 1.5 leading. */
|
|
81
|
+
--font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
|
|
82
|
+
--font-size-base: 0.875rem;
|
|
83
|
+
--font-size-sm: 0.8125rem;
|
|
84
|
+
--font-size-xs: 0.75rem;
|
|
85
|
+
--line-height-base: 1.5;
|
|
86
|
+
/* Notion's menus: 14px type, 28px rows (4px vertical padding), 4px panel padding. */
|
|
87
|
+
/* Notion AI: messages 14px / 20px. */
|
|
88
|
+
/* Notion's controls are flat: the hairline does the work, no drop shadow. */
|
|
89
|
+
--shadow: 0 0 #0000;
|
|
90
|
+
--shadow-xs: 0 0 #0000;
|
|
91
|
+
--shadow-sm: 0 0 #0000;
|
|
92
|
+
/* Notion's controls are 24/28/32px, 14px type at weight 500. */
|
|
93
|
+
--control-h-xs: 1.5rem;
|
|
94
|
+
--control-h-sm: 1.75rem;
|
|
95
|
+
--control-h-default: 2rem;
|
|
96
|
+
--control-h-lg: 2.5rem;
|
|
97
|
+
--button-weight: 500;
|
|
98
|
+
/* Notion's sidebar row: 30px, 14px type, 6px corner. */
|
|
99
|
+
--sidebar-item-h: 1.875rem;
|
|
100
|
+
--sidebar-item-gap: 0.0625rem;
|
|
101
|
+
--sidebar-item-font: var(--font-size-base);
|
|
102
|
+
--sidebar-item-radius: 0.375rem;
|
|
103
|
+
/* Notion separates sidebar groups by space, not by a rule. */
|
|
104
|
+
--sidebar-divider-h: 0px;
|
|
105
|
+
/* Notion's top bar is 44px. */
|
|
106
|
+
--panel-header-h: 2.75rem;
|
|
107
|
+
/* Notion tags: 20px, 4px corner, 14px regular. */
|
|
108
|
+
--badge-radius: 0.25rem;
|
|
109
|
+
--badge-px: 0.375rem;
|
|
110
|
+
--badge-py: 0;
|
|
111
|
+
--badge-font-size: 0.875rem;
|
|
112
|
+
--badge-weight: 400;
|
|
113
|
+
--chat-text: var(--font-size-base);
|
|
114
|
+
--chat-leading: 1.5;
|
|
115
|
+
/* The AI composer is a raised 1px-ringed card (#202020 on #191919 in dark). */
|
|
116
|
+
--chat-composer-bg: var(--card);
|
|
117
|
+
--chat-composer-radius: 0.75rem;
|
|
118
|
+
--chat-composer-button-radius: 9999px;
|
|
119
|
+
--chat-composer-ring-w: 1px;
|
|
120
|
+
--chat-composer-ring: var(--border);
|
|
121
|
+
--chat-composer-ring-focus: var(--ring);
|
|
122
|
+
--panel-title-weight: 500;
|
|
123
|
+
--panel-title-tracking: 0;
|
|
124
|
+
--panel-title-color: var(--foreground);
|
|
125
|
+
--panel-title-transform: none;
|
|
126
|
+
--menu-font-size: var(--font-size-base);
|
|
127
|
+
/* Menu section labels: 12px / 500 in the muted ink. */
|
|
128
|
+
--menu-label-font-size: var(--font-size-xs);
|
|
129
|
+
--menu-label-weight: 500;
|
|
130
|
+
--menu-label-color: var(--muted-foreground);
|
|
131
|
+
--radius-popover: 0.625rem;
|
|
132
|
+
/* Tooltips are the popover surface with a hairline, not inverted (Notion: "Chat ^2" on the same grey as the menus). */
|
|
133
|
+
--tooltip-bg: var(--popover);
|
|
134
|
+
--tooltip-fg: var(--popover-foreground);
|
|
135
|
+
--tooltip-border: var(--border);
|
|
136
|
+
--radius-tooltip: 0.375rem;
|
|
137
|
+
/* The popover already has a hairline border, so no ring here; a short, soft lift (the earlier 0.2 / 24px blur read as a heavy cloud on white). */
|
|
138
|
+
--popup-shadow: 0 2px 4px rgb(15 15 15 / 0.05), 0 8px 20px -6px rgb(15 15 15 / 0.12);
|
|
139
|
+
--menu-item-px: 0.5rem;
|
|
140
|
+
--menu-item-py: 0.25rem;
|
|
141
|
+
--menu-padding: 0.25rem;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Notion dark (#191919 page, #202020 rail, #2f2f2f hairline). */
|
|
145
|
+
.dark {
|
|
146
|
+
--background: hsl(0 0% 10%);
|
|
147
|
+
--foreground: hsl(40 9% 93.5%);
|
|
148
|
+
--card: hsl(0 0% 12%);
|
|
149
|
+
--card-foreground: hsl(40 9% 93.5%);
|
|
150
|
+
--popover: hsl(0 0% 15%);
|
|
151
|
+
--popover-foreground: hsl(40 9% 93.5%);
|
|
152
|
+
--primary: hsl(209 74% 52%);
|
|
153
|
+
--primary-foreground: hsl(0 0% 100%);
|
|
154
|
+
--secondary: hsl(0 0% 15%);
|
|
155
|
+
--secondary-foreground: hsl(0 0% 81%);
|
|
156
|
+
--muted: hsl(0 0% 15%);
|
|
157
|
+
--muted-foreground: hsl(0 0% 60%);
|
|
158
|
+
--accent: hsl(0 0% 17%);
|
|
159
|
+
--accent-foreground: hsl(0 0% 90%);
|
|
160
|
+
--border: hsl(0 0% 18%);
|
|
161
|
+
--input: hsl(0 0% 18%);
|
|
162
|
+
--divider: hsl(0 0% 15%);
|
|
163
|
+
--ring: hsl(209 74% 52%);
|
|
164
|
+
--sidebar-background: hsl(0 0% 12.5%);
|
|
165
|
+
--sidebar-foreground: hsl(0 0% 81%);
|
|
166
|
+
--sidebar-primary: hsl(209 74% 52%);
|
|
167
|
+
--sidebar-primary-foreground: hsl(0 0% 100%);
|
|
168
|
+
--sidebar-accent: hsl(0 0% 17%);
|
|
169
|
+
--sidebar-accent-foreground: hsl(0 0% 90%);
|
|
170
|
+
--sidebar-border: hsl(0 0% 18%);
|
|
171
|
+
--sidebar-ring: hsl(209 74% 52%);
|
|
172
|
+
--chart-1: hsl(209 74% 58%);
|
|
173
|
+
/* Dark popups: a 1px #383836 ring plus a soft drop. */
|
|
174
|
+
--popup-shadow: 0 0 0 1px hsl(60 2% 22%), 0 14px 28px -6px rgb(0 0 0 / 0.2), 0 2px 4px -1px rgb(0 0 0 / 0.12);
|
|
175
|
+
}
|
|
@@ -19,21 +19,21 @@
|
|
|
19
19
|
* panels and menus read as raised. muted recesses below the page.
|
|
20
20
|
* page ≈ bg-100 card ≈ bg-000(18.4%) popover 18.8% (claude.ai menus) */
|
|
21
21
|
--background: hsl(0 0% 10%);
|
|
22
|
-
--foreground: hsl(0 0%
|
|
23
|
-
--card: hsl(0 0%
|
|
24
|
-
--card-foreground: hsl(0 0%
|
|
25
|
-
--popover: hsl(0 0%
|
|
26
|
-
--popover-foreground: hsl(0 0%
|
|
22
|
+
--foreground: hsl(0 0% 81%);
|
|
23
|
+
--card: hsl(0 0% 12%);
|
|
24
|
+
--card-foreground: hsl(0 0% 81%);
|
|
25
|
+
--popover: hsl(0 0% 15%);
|
|
26
|
+
--popover-foreground: hsl(0 0% 81%);
|
|
27
27
|
/* Brand clay #d97757 (Claude). Bright enough on dark chrome to carry the full swatch. */
|
|
28
|
-
--primary: hsl(
|
|
28
|
+
--primary: hsl(209 74% 52%);
|
|
29
29
|
/* Dark label on clay — 5.8:1, stronger than white-on-clay (3.1:1) */
|
|
30
|
-
--primary-foreground: hsl(0 0%
|
|
30
|
+
--primary-foreground: hsl(0 0% 100%);
|
|
31
31
|
/* Secondary: elevated warm-gray control surface + light label */
|
|
32
|
-
--secondary: hsl(0 0%
|
|
33
|
-
--secondary-foreground: hsl(0 0%
|
|
32
|
+
--secondary: hsl(0 0% 15%);
|
|
33
|
+
--secondary-foreground: hsl(0 0% 81%);
|
|
34
34
|
/* Recessed surface — below the page (Claude bg-200), for input rest / chips. */
|
|
35
|
-
--muted: hsl(0 0%
|
|
36
|
-
--muted-foreground: hsl(0 0%
|
|
35
|
+
--muted: hsl(0 0% 15%);
|
|
36
|
+
--muted-foreground: hsl(0 0% 60%);
|
|
37
37
|
/* Neutral interaction surface: a quiet lift above the current dark page. */
|
|
38
38
|
--surface-hover: color-mix(in oklab, var(--card) 96%, var(--foreground));
|
|
39
39
|
/* The counterpart to --surface-hover: a surface that reads as sunk BELOW the
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
* and composites over whatever surface the band happens to sit on. */
|
|
50
50
|
--surface-recessed: rgb(0 0 0 / 0.35);
|
|
51
51
|
/* Hover/active surface (rails, menus, tabs) — a quiet warm lift above the page. */
|
|
52
|
-
--accent: hsl(0 0%
|
|
53
|
-
--accent-foreground: hsl(0 0%
|
|
52
|
+
--accent: hsl(0 0% 17%);
|
|
53
|
+
--accent-foreground: hsl(0 0% 90%);
|
|
54
54
|
--destructive: hsl(0 67% 60%);
|
|
55
55
|
--destructive-foreground: hsl(0 0% 98%);
|
|
56
56
|
/* Soft warm border — Claude draws hairlines from a light border at low
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
Capped by MAXIMUM_BORDER_GAP in check-preset-contrast.mjs. */
|
|
62
62
|
--border: hsl(0 0% 18%);
|
|
63
63
|
/* Input surface — a notch above card so fields read as raised controls. */
|
|
64
|
-
--input: hsl(0 0%
|
|
64
|
+
--input: hsl(0 0% 18%);
|
|
65
65
|
/* Divider — TRANSLUCENT hairline (Apple-style): a light warm-gray at low alpha
|
|
66
66
|
* that dissolves into whatever sits behind it, so structural separators
|
|
67
67
|
* (columns, headers, rows) stay quiet on the dark page instead of reading as a
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
left of "кондово" after the fills were calmed. Over a 12% card this
|
|
73
73
|
lands at 15.4% (step 3.4) against the border's 18% (step 6.0): a clear
|
|
74
74
|
hierarchy, frame first. */
|
|
75
|
-
--divider: hsl(0 0%
|
|
75
|
+
--divider: hsl(0 0% 15%);
|
|
76
76
|
/* Overlay — modal scrim / backdrop behind dialogs, drawers, sheets. Black in
|
|
77
77
|
* both themes; slightly darker here so it still reads on the dark page. */
|
|
78
78
|
--overlay: hsl(0 0% 0% / 0.7);
|
|
79
79
|
/* Focus ring — blue (system-accent feel), independent of the cyan brand. */
|
|
80
|
-
--ring: hsl(
|
|
80
|
+
--ring: hsl(209 74% 52%);
|
|
81
81
|
--shadow-card: none;
|
|
82
82
|
|
|
83
83
|
/* Code surface — see light.css for the rationale. On dark we want
|
|
@@ -94,13 +94,13 @@
|
|
|
94
94
|
* block; rail and page share one tone). A hair darker than --background for
|
|
95
95
|
* subtle separation, not a hard black slab. */
|
|
96
96
|
--sidebar-background: hsl(0 0% 12.5%);
|
|
97
|
-
--sidebar-foreground: hsl(0 0%
|
|
98
|
-
--sidebar-primary: hsl(
|
|
99
|
-
--sidebar-primary-foreground: hsl(0 0%
|
|
100
|
-
--sidebar-accent: hsl(0 0%
|
|
101
|
-
--sidebar-accent-foreground: hsl(0 0%
|
|
97
|
+
--sidebar-foreground: hsl(0 0% 81%);
|
|
98
|
+
--sidebar-primary: hsl(209 74% 52%);
|
|
99
|
+
--sidebar-primary-foreground: hsl(0 0% 100%);
|
|
100
|
+
--sidebar-accent: hsl(0 0% 17%);
|
|
101
|
+
--sidebar-accent-foreground: hsl(0 0% 90%);
|
|
102
102
|
--sidebar-border: hsl(0 0% 18%);
|
|
103
|
-
--sidebar-ring: hsl(
|
|
103
|
+
--sidebar-ring: hsl(209 74% 52%);
|
|
104
104
|
/* ── Status surfaces (dark) ──────────────────────────────────────
|
|
105
105
|
* Dark variants: dim backgrounds (~8-12% lightness) so banners
|
|
106
106
|
* don't blow out against the near-black page. Foreground raised
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
/* Chart colors — chart-1 aligned with brand.
|
|
149
149
|
* Fully-wrapped hsl() like every other token (consume via `bg-chart-N` or
|
|
150
150
|
* `var(--chart-N)`, never `hsl(var(--chart-N))`). */
|
|
151
|
-
--chart-1: hsl(
|
|
151
|
+
--chart-1: hsl(209 74% 58%);
|
|
152
152
|
--chart-2: hsl(142 76% 36%);
|
|
153
153
|
--chart-3: hsl(262 83% 58%);
|
|
154
154
|
--chart-4: hsl(26 90% 57%);
|