@leitware/composables 1.3.2 → 1.3.3
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/README.md +4 -4
- package/dist/presets/brutalist.css +1 -1
- package/dist/presets/default.css +1 -1
- package/dist/presets/signal-pop.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/skills/use-composables/references/optional-dependencies.md +1 -1
- package/src/_internal/ai-elements/code-block.tsx +1 -1
- package/src/_internal/bubble.tsx +1 -1
- package/src/_internal/grid-overlay.tsx +1 -1
- package/src/_internal/layout-bento.tsx +11 -11
- package/src/_internal/layout.tsx +11 -11
- package/src/index.ts +1 -1
- package/src/lib/utils.ts +2 -2
- package/src/opinionated/alert.tsx +5 -5
- package/src/opinionated/button.tsx +1 -1
- package/src/opinionated/theme-injector.tsx +2 -2
- package/src/opinionated/token-config-panel/spacing-editor.tsx +1 -1
- package/src/opinionated/token-config-panel/types.ts +1 -1
- package/src/opinionated/token-config-panel/typography-editor.tsx +1 -1
- package/src/styles/composable.css +10 -10
- package/src/styles/presets/brutalist.css +1 -1
- package/src/styles/presets/default.css +1 -1
- package/src/styles/presets/signal-pop.css +1 -1
- package/src/styles/presets-data/brutalist.ts +8 -8
- package/src/styles/presets-data/default.ts +3 -3
- package/src/styles/tokens/base.css +1 -1
- package/src/styles/tokens/palette.css +2 -2
- package/src/styles/tokens/semantic.css +1 -1
- package/src/styles/tokens/tailwind-theme.css +7 -7
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ Use this reference before adding AI components, loading preset fonts, or resolvi
|
|
|
4
4
|
|
|
5
5
|
## Component dependencies
|
|
6
6
|
|
|
7
|
-
All non-AI components
|
|
7
|
+
All non-AI components, including Calendar, Carousel, DropZone, Resizable, Toaster, ThemeInjector, and TokenConfigPanel, are imported from `@leitware/composables`. Their runtime integrations are installed with the package and require no feature subpath or separate peer installation.
|
|
8
8
|
|
|
9
9
|
AI components are the deliberate exception. Import them from `@leitware/composables/ai` and install the optional peers required by that entrypoint: `ai`, `shiki`, `streamdown`, `@streamdown/cjk`, `@streamdown/code`, `@streamdown/math`, `@streamdown/mermaid`, `use-stick-to-bottom`, `nanoid`, `@radix-ui/react-use-controllable-state`, `cmdk`, and `motion`. Do not install this dependency set in applications that do not import AI components.
|
|
10
10
|
|
|
@@ -360,7 +360,7 @@ export const CodeBlockContent = ({
|
|
|
360
360
|
// Memoized raw tokens for immediate display
|
|
361
361
|
const rawTokens = useMemo(() => createRawTokens(code), [code])
|
|
362
362
|
|
|
363
|
-
// Synchronous cache lookup
|
|
363
|
+
// Synchronous cache lookup - avoids setState in effect for cached results
|
|
364
364
|
const syncTokens = useMemo(
|
|
365
365
|
() => highlightCode(code, language) ?? rawTokens,
|
|
366
366
|
[code, language, rawTokens],
|
package/src/_internal/bubble.tsx
CHANGED
|
@@ -29,7 +29,7 @@ const bubbleVariants = cva(
|
|
|
29
29
|
'border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0',
|
|
30
30
|
destructive:
|
|
31
31
|
'*:data-[slot=bubble-content]:bg-surface-critical *:data-[slot=bubble-content]:text-critical *:data-[slot=bubble-content]:border-stroke-critical',
|
|
32
|
-
/** @deprecated Use `destructive`
|
|
32
|
+
/** @deprecated Use `destructive` - kept for backwards compatibility. */
|
|
33
33
|
critical:
|
|
34
34
|
'*:data-[slot=bubble-content]:bg-surface-critical *:data-[slot=bubble-content]:text-critical *:data-[slot=bubble-content]:border-stroke-critical',
|
|
35
35
|
success:
|
|
@@ -8,7 +8,7 @@ interface GridOverlayProps extends React.ComponentProps<'div'> {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* GridOverlay
|
|
11
|
+
* GridOverlay - renders a full-viewport grid background aligned to the
|
|
12
12
|
* spacing system. Grid cells are `calc(var(--spacing) * 12)` wide/tall
|
|
13
13
|
* and the pattern is horizontally centered so that containers whose
|
|
14
14
|
* widths are multiples of 96 px snap exactly to the lines.
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Layout philosophy:
|
|
18
18
|
* • Container background IS the border color
|
|
19
|
-
* • Gap exposes it as 1px lines
|
|
20
|
-
* • "Borders never stack"
|
|
19
|
+
* • Gap exposes it as 1px lines - cells are never individually bordered
|
|
20
|
+
* • "Borders never stack" - each grid line is drawn exactly once
|
|
21
21
|
* • Mobile: single-column stack; Desktop: the designed layout
|
|
22
22
|
* • All sizing is responsive, all colors through semantic tokens
|
|
23
23
|
*
|
|
@@ -34,16 +34,16 @@ import { cn } from '../lib/utils'
|
|
|
34
34
|
|
|
35
35
|
// ─── INTERNAL CONSTANTS ───────────────────────────────────────────────────────
|
|
36
36
|
|
|
37
|
-
/** Background IS the border color
|
|
37
|
+
/** Background IS the border color - gap exposes it as lines. */
|
|
38
38
|
const BENTO_CONTAINER =
|
|
39
39
|
'min-w-0 bg-stroke gap-[var(--bento-gap,var(--border-width,1px))] p-[var(--bento-gap,var(--border-width,1px))] rounded-lg'
|
|
40
40
|
|
|
41
|
-
/** Every direct cell child gets card background
|
|
41
|
+
/** Every direct cell child gets card background - it sits on top of the border bg. */
|
|
42
42
|
const BENTO_CELL = 'min-w-0 bg-card rounded-lg overflow-hidden'
|
|
43
43
|
|
|
44
44
|
// ─── STAT CELL ────────────────────────────────────────────────────────────────
|
|
45
45
|
//
|
|
46
|
-
// Compact metric cell. Participates in the gap-border system
|
|
46
|
+
// Compact metric cell. Participates in the gap-border system - add it as a
|
|
47
47
|
// direct child of BentoGrid, CellGrid, or the stats slot of any Bento layout.
|
|
48
48
|
// Padding is internal; the outer gap provides the grid line.
|
|
49
49
|
|
|
@@ -129,7 +129,7 @@ function BentoCell({ colSpan = 1, rowSpan = 1, className, ...props }: BentoCellP
|
|
|
129
129
|
// A 2-area layout: icon panel (fixed 200px on desktop, spans both rows) |
|
|
130
130
|
// content area + stats area stacked in the second column.
|
|
131
131
|
//
|
|
132
|
-
// Mobile: single column
|
|
132
|
+
// Mobile: single column - icon, then content, then stats.
|
|
133
133
|
// Desktop: [200px icon (row-span-2)] | [content / stats]
|
|
134
134
|
|
|
135
135
|
interface BentoSplitProps extends Omit<React.ComponentProps<'div'>, 'content'> {
|
|
@@ -149,18 +149,18 @@ function BentoSplit({ icon, content, stats, className, ...props }: BentoSplitPro
|
|
|
149
149
|
)}
|
|
150
150
|
{...props}
|
|
151
151
|
>
|
|
152
|
-
{/* Icon
|
|
152
|
+
{/* Icon - spans both rows on desktop */}
|
|
153
153
|
<div
|
|
154
154
|
data-slot="bento-split-icon"
|
|
155
155
|
className={cn(BENTO_CELL, 'flex items-center justify-center p-10 lg:row-span-2')}
|
|
156
156
|
>
|
|
157
157
|
{icon}
|
|
158
158
|
</div>
|
|
159
|
-
{/* Content
|
|
159
|
+
{/* Content - auto-places into col 2, row 1 */}
|
|
160
160
|
<div data-slot="bento-split-content" className={cn(BENTO_CELL, 'p-4')}>
|
|
161
161
|
{content}
|
|
162
162
|
</div>
|
|
163
|
-
{/* Stats
|
|
163
|
+
{/* Stats - auto-places into col 2, row 2 */}
|
|
164
164
|
<div data-slot="bento-split-stats" className={cn(BENTO_CELL, 'p-4')}>
|
|
165
165
|
{stats}
|
|
166
166
|
</div>
|
|
@@ -286,14 +286,14 @@ function BentoTriple({ header, aside, body, footer, className, ...props }: Bento
|
|
|
286
286
|
<div data-slot="bento-triple-header" className={cn(BENTO_CELL, 'lg:[grid-column:1/-1]')}>
|
|
287
287
|
{header}
|
|
288
288
|
</div>
|
|
289
|
-
{/* Aside
|
|
289
|
+
{/* Aside - col 1, row 2 */}
|
|
290
290
|
<div
|
|
291
291
|
data-slot="bento-triple-aside"
|
|
292
292
|
className={cn(BENTO_CELL, 'flex items-center justify-center')}
|
|
293
293
|
>
|
|
294
294
|
{aside}
|
|
295
295
|
</div>
|
|
296
|
-
{/* Body
|
|
296
|
+
{/* Body - col 2, row 2 */}
|
|
297
297
|
<div data-slot="bento-triple-body" className={BENTO_CELL}>
|
|
298
298
|
{body}
|
|
299
299
|
</div>
|
package/src/_internal/layout.tsx
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Enforces the spacing and border system.
|
|
6
6
|
*
|
|
7
7
|
* BORDERS NEVER STACK RULES:
|
|
8
|
-
* • Stack/Row gaps use margin (not padding)
|
|
8
|
+
* • Stack/Row gaps use margin (not padding) - items never double-border.
|
|
9
9
|
* • NewspaperGrid: container holds border-t + border-l.
|
|
10
10
|
* NewspaperCell adds border-b + border-r → each edge drawn exactly once.
|
|
11
11
|
* • Use `border-[length:var(--border-width)]` throughout, never hardcoded 1px.
|
|
@@ -33,7 +33,7 @@ import { cn } from '../lib/utils'
|
|
|
33
33
|
// ─── SECTION ──────────────────────────────────────────────────────────────────
|
|
34
34
|
//
|
|
35
35
|
// Page-level section wrapper with macro spacing tokens.
|
|
36
|
-
// Spacing drives py (vertical padding)
|
|
36
|
+
// Spacing drives py (vertical padding) - sm=spacing*6, md=spacing*12, lg=spacing*24.
|
|
37
37
|
|
|
38
38
|
const sectionVariants = cva('w-full', {
|
|
39
39
|
variants: {
|
|
@@ -63,7 +63,7 @@ function Section({ className, spacing, ...props }: SectionProps) {
|
|
|
63
63
|
// ─── SPACER ───────────────────────────────────────────────────────────────────
|
|
64
64
|
//
|
|
65
65
|
// Flex-grow spacer for pushing content apart inside flex containers.
|
|
66
|
-
// aria-hidden: decorative
|
|
66
|
+
// aria-hidden: decorative - not meaningful to assistive tech.
|
|
67
67
|
|
|
68
68
|
function FlexSpacer({ className, ...props }: React.ComponentProps<'div'>) {
|
|
69
69
|
return (
|
|
@@ -82,12 +82,12 @@ function FlexSpacer({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
82
82
|
// (Named NewspaperGrid to distinguish from layout-bento's BentoGrid, which uses
|
|
83
83
|
// gap-as-border rather than this edge-sharing approach.)
|
|
84
84
|
//
|
|
85
|
-
// Border rule
|
|
86
|
-
// Container: border-t + border-l (outer frame
|
|
87
|
-
// NewspaperCell: border-b + border-r (completes each cell
|
|
85
|
+
// Border rule - "each edge drawn exactly once":
|
|
86
|
+
// Container: border-t + border-l (outer frame - top and left)
|
|
87
|
+
// NewspaperCell: border-b + border-r (completes each cell - bottom and right)
|
|
88
88
|
//
|
|
89
89
|
// Result: every grid line is a single border, never doubled.
|
|
90
|
-
// Use `border-[length:var(--border-width)]` throughout
|
|
90
|
+
// Use `border-[length:var(--border-width)]` throughout - never hardcoded px.
|
|
91
91
|
|
|
92
92
|
const newspaperGridVariants = cva(
|
|
93
93
|
[
|
|
@@ -127,10 +127,10 @@ function NewspaperGrid({ className, cols, ...props }: NewspaperGridProps) {
|
|
|
127
127
|
// ─── NEWSPAPER CELL ───────────────────────────────────────────────────────────
|
|
128
128
|
//
|
|
129
129
|
// A single cell within NewspaperGrid. Provides the bottom + right border edges
|
|
130
|
-
// (newspaper rule
|
|
130
|
+
// (newspaper rule - completes the grid line each container started).
|
|
131
131
|
//
|
|
132
|
-
// span
|
|
133
|
-
// rowSpan
|
|
132
|
+
// span - column span (1–4)
|
|
133
|
+
// rowSpan - row span (1–3)
|
|
134
134
|
|
|
135
135
|
const COL_SPANS: Record<1 | 2 | 3 | 4, string> = {
|
|
136
136
|
1: 'col-span-1',
|
|
@@ -145,7 +145,7 @@ const ROW_SPANS: Record<1 | 2 | 3, string> = {
|
|
|
145
145
|
3: 'row-span-3',
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
// Cell border classes
|
|
148
|
+
// Cell border classes - bottom + right complete the newspaper grid rule
|
|
149
149
|
const CELL_BORDERS = [
|
|
150
150
|
'border-b-[length:var(--border-width,var(--border-width-base,0.0625rem))]',
|
|
151
151
|
'border-r-[length:var(--border-width,var(--border-width-base,0.0625rem))]',
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ============================================================================
|
|
2
|
-
// @leitware/composables
|
|
2
|
+
// @leitware/composables - barrel exports
|
|
3
3
|
// ============================================================================
|
|
4
4
|
|
|
5
5
|
// ── Utilities ───────────────────────────────────────────────────────────────
|
package/src/lib/utils.ts
CHANGED
|
@@ -27,11 +27,11 @@ export const HOVER_RING =
|
|
|
27
27
|
export const GROUP_FOCUS_RING =
|
|
28
28
|
'has-[:focus-visible]:border-[var(--focus-ring-color)] has-[:focus-visible]:ring-[color:var(--focus-ring-color)]/30 has-[:focus-visible]:ring-[length:var(--focus-ring-width)] has-aria-invalid:ring-stroke-critical/20 dark:has-aria-invalid:ring-stroke-critical/40 has-aria-invalid:border-stroke-critical dark:has-aria-invalid:border-stroke-critical/50 has-aria-invalid:ring-[length:var(--focus-ring-width)]'
|
|
29
29
|
|
|
30
|
-
/** Destructive-variant focus override
|
|
30
|
+
/** Destructive-variant focus override layered on top of FOCUS_RING. */
|
|
31
31
|
export const FOCUS_RING_DESTRUCTIVE =
|
|
32
32
|
'focus-visible:ring-stroke-critical/20 dark:focus-visible:ring-stroke-critical/40 focus-visible:border-stroke-critical/40'
|
|
33
33
|
|
|
34
|
-
/** Disabled state opacity
|
|
34
|
+
/** Disabled state opacity - single source of truth for all disabled elements. */
|
|
35
35
|
export const DISABLED_OPACITY = 'disabled:opacity-disabled'
|
|
36
36
|
|
|
37
37
|
/**
|
|
@@ -35,11 +35,11 @@ export type AlertVariant = NonNullable<VariantProps<typeof alertVariants>['varia
|
|
|
35
35
|
export interface AlertProps extends Omit<React.ComponentProps<typeof AlertPrimitive>, 'title'> {
|
|
36
36
|
/**
|
|
37
37
|
* Semantic type that controls the icon and colour variant.
|
|
38
|
-
* - `default`
|
|
39
|
-
* - `notice`
|
|
40
|
-
* - `positive`
|
|
41
|
-
* - `warning`
|
|
42
|
-
* - `negative`
|
|
38
|
+
* - `default` - no icon, neutral styling
|
|
39
|
+
* - `notice` - info icon (ℹ), neutral styling
|
|
40
|
+
* - `positive` - check icon, green styling
|
|
41
|
+
* - `warning` - triangle icon, amber styling
|
|
42
|
+
* - `negative` - alert triangle icon, red/destructive styling
|
|
43
43
|
* @default 'default'
|
|
44
44
|
*/
|
|
45
45
|
type?: AlertType
|
|
@@ -20,7 +20,7 @@ export interface ButtonProps extends Omit<React.ComponentProps<'button'>, 'size'
|
|
|
20
20
|
variant?: VariantProps<typeof buttonVariants>['variant']
|
|
21
21
|
/** Size variant. @default 'default' */
|
|
22
22
|
size?: VariantProps<typeof buttonVariants>['size']
|
|
23
|
-
/** Corner shape. 'pill' is fully rounded
|
|
23
|
+
/** Corner shape. 'pill' is fully rounded - circular for icon sizes. @default 'default' */
|
|
24
24
|
shape?: VariantProps<typeof buttonVariants>['shape']
|
|
25
25
|
className?: string
|
|
26
26
|
/** Disables the button and prevents interaction. @default false */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TokenConfigPanel } from './token-config-panel'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* ThemeInjector
|
|
4
|
+
* ThemeInjector - drop this anywhere in your app to get a floating theme
|
|
5
5
|
* control panel. It renders a fixed palette button in the top-right corner
|
|
6
6
|
* of the viewport that opens the full token config sheet.
|
|
7
7
|
*
|
|
8
|
-
* Works on any page without modifying your layout
|
|
8
|
+
* Works on any page without modifying your layout - the button lives outside
|
|
9
9
|
* normal document flow via `position: fixed`.
|
|
10
10
|
*
|
|
11
11
|
* Usage:
|
|
@@ -351,7 +351,7 @@ export function DimensionSliderRow({
|
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
/* ------------------------------------------------------------------ */
|
|
354
|
-
/* FactorSliderRow
|
|
354
|
+
/* FactorSliderRow - edits calc(var(base) * factor) component tokens */
|
|
355
355
|
/* ------------------------------------------------------------------ */
|
|
356
356
|
|
|
357
357
|
export function FactorSliderRow({
|
|
@@ -22,7 +22,7 @@ export interface DimensionToken {
|
|
|
22
22
|
export interface FactorToken {
|
|
23
23
|
cssVar: string
|
|
24
24
|
label: string
|
|
25
|
-
/** Base token the factor multiplies
|
|
25
|
+
/** Base token the factor multiplies - the override is written as calc(var(base) * factor). */
|
|
26
26
|
base: '--radius' | '--spacing'
|
|
27
27
|
defaultFactor: number
|
|
28
28
|
min: number
|
|
@@ -6,7 +6,7 @@ import type { FontGroup } from './types'
|
|
|
6
6
|
import { getResolvedDimension } from './helpers'
|
|
7
7
|
|
|
8
8
|
/* ------------------------------------------------------------------ */
|
|
9
|
-
/* Google Fonts
|
|
9
|
+
/* Google Fonts - grouped by style */
|
|
10
10
|
/* ------------------------------------------------------------------ */
|
|
11
11
|
|
|
12
12
|
const FONT_GROUPS: FontGroup[] = [
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* ============================================================================
|
|
2
|
-
@leitware/composables
|
|
2
|
+
@leitware/composables - Main Stylesheet
|
|
3
3
|
============================================================================
|
|
4
4
|
Design tokens, theme registration, and base styles for the component system.
|
|
5
|
-
This file does NOT include Tailwind itself
|
|
5
|
+
This file does NOT include Tailwind itself - the downstream app owns that.
|
|
6
6
|
See README.md "Quick Start" for the full import pattern.
|
|
7
7
|
|
|
8
8
|
File structure:
|
|
9
|
-
tokens/palette.css
|
|
10
|
-
tokens/tailwind-color-adapter.css
|
|
11
|
-
tokens/tailwind-theme.css
|
|
12
|
-
tokens/semantic.css
|
|
13
|
-
tokens/components.css
|
|
14
|
-
presets/default.css
|
|
15
|
-
tokens/semantic-utilities.css
|
|
16
|
-
tokens/base.css
|
|
9
|
+
tokens/palette.css - Primitive color scales (build-time + runtime)
|
|
10
|
+
tokens/tailwind-color-adapter.css - Generated Tailwind color aliases
|
|
11
|
+
tokens/tailwind-theme.css - Non-color Tailwind theme registrations
|
|
12
|
+
tokens/semantic.css - Semantic role tokens (:root + .dark)
|
|
13
|
+
tokens/components.css - Component-level tunables
|
|
14
|
+
presets/default.css - The canonical default light/dark preset
|
|
15
|
+
tokens/semantic-utilities.css - Generated public semantic classes
|
|
16
|
+
tokens/base.css - Global base styles (@layer base)
|
|
17
17
|
============================================================================ */
|
|
18
18
|
|
|
19
19
|
@import 'shadcn/tailwind.css';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* ============================================================================
|
|
2
|
-
@leitware/composables
|
|
2
|
+
@leitware/composables - Brutalist Preset
|
|
3
3
|
============================================================================
|
|
4
4
|
Raw, architectural, uncompromising. Structural honesty: things look exactly like what they are.
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* ============================================================================
|
|
2
|
-
@leitware/composables
|
|
2
|
+
@leitware/composables - Default Preset
|
|
3
3
|
============================================================================
|
|
4
4
|
Clean, neutral, Inter-based. The "no opinion" starting point.
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* ============================================================================
|
|
2
|
-
@leitware/composables
|
|
2
|
+
@leitware/composables - Signal Pop Preset
|
|
3
3
|
============================================================================
|
|
4
4
|
Bright consumer-tech energy: electric modules, capsule controls, hard outlines, and codey labels.
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Brutalist
|
|
2
|
+
* Brutalist - Raw, architectural, uncompromising.
|
|
3
3
|
* Studied references: Bloomberg Terminal aesthetic, Balenciaga.com restraint,
|
|
4
4
|
* Ssense editorial rigour. High contrast without being garish.
|
|
5
5
|
*
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* about structural honesty: things look exactly like what they are.
|
|
8
8
|
*
|
|
9
9
|
* Fonts:
|
|
10
|
-
* Heading
|
|
10
|
+
* Heading - Space Grotesk Variable: constructed, slightly mechanical,
|
|
11
11
|
* pairs well with mono body without feeling like a joke.
|
|
12
|
-
* Body
|
|
12
|
+
* Body - Space Grotesk Variable: the Bloomberg terminal aesthetic. Readable,
|
|
13
13
|
* functional, carries authority. Uncompromising.
|
|
14
14
|
*
|
|
15
15
|
* Character: zero border-radius, heavy borders, hard offset shadows,
|
|
@@ -126,7 +126,7 @@ export const brutalist: Record<string, string> = {
|
|
|
126
126
|
'--leading-base': '1.4',
|
|
127
127
|
'--letter-spacing-base': '0.04em',
|
|
128
128
|
'--opacity-disabled': '0.5',
|
|
129
|
-
// Hard offset shadow
|
|
129
|
+
// Hard offset shadow - structural, no blur (that's the brutalist shadow)
|
|
130
130
|
'--shadow-offset-y': '4px',
|
|
131
131
|
'--shadow-blur': '0px',
|
|
132
132
|
'--shadow-spread': '0px',
|
|
@@ -146,7 +146,7 @@ export const brutalist: Record<string, string> = {
|
|
|
146
146
|
'--font-brand': '"Space Grotesk Variable", "Arial", sans-serif',
|
|
147
147
|
|
|
148
148
|
// ── Phase 1a: Component tokens ────────────────────────────────────────
|
|
149
|
-
// Zero radius everywhere
|
|
149
|
+
// Zero radius everywhere - things are what they are
|
|
150
150
|
'--button-radius': '0px',
|
|
151
151
|
'--card-radius': '0px',
|
|
152
152
|
'--card-padding': 'calc(var(--spacing) * 6)',
|
|
@@ -154,7 +154,7 @@ export const brutalist: Record<string, string> = {
|
|
|
154
154
|
'--input-height': 'calc(var(--spacing) * 10)',
|
|
155
155
|
'--badge-radius': '0px',
|
|
156
156
|
|
|
157
|
-
// ── Phase 1b: Motion
|
|
157
|
+
// ── Phase 1b: Motion - instant. No decorative animation. ─────────────
|
|
158
158
|
'--motion-duration-fast': '0ms',
|
|
159
159
|
'--motion-duration-normal': '0ms',
|
|
160
160
|
'--motion-duration-slow': '50ms',
|
|
@@ -173,7 +173,7 @@ export const brutalist: Record<string, string> = {
|
|
|
173
173
|
'--hover-shadow': 'none',
|
|
174
174
|
'--active-scale': '1',
|
|
175
175
|
|
|
176
|
-
// ── Phase 1c: Typography
|
|
176
|
+
// ── Phase 1c: Typography - heavy, structural ──────────────────────────
|
|
177
177
|
'--heading-font-weight': '700',
|
|
178
178
|
'--heading-letter-spacing': 'var(--tracking-tight)',
|
|
179
179
|
'--body-letter-spacing': 'var(--tracking-normal)',
|
|
@@ -189,7 +189,7 @@ export const brutalist: Record<string, string> = {
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
export const brutalistDark: Record<string, string> = {
|
|
192
|
-
// ── Dark: inverted
|
|
192
|
+
// ── Dark: inverted - paper becomes black, ink becomes off-white ───────
|
|
193
193
|
'--bg-default': '#0A0A0AFF',
|
|
194
194
|
'--bg-inverse': '#F8F8F8FF',
|
|
195
195
|
'--bg-muted': '#1A1A1AFF',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Default
|
|
2
|
+
* Default - Clean, neutral, Inter-based. The "no opinion" starting point.
|
|
3
3
|
* Think Linear, Vercel. A solid foundation that stays out of the way.
|
|
4
4
|
*
|
|
5
|
-
* Fonts: Inter Variable (all)
|
|
5
|
+
* Fonts: Inter Variable (all) - the most carefully crafted neutral sans-serif.
|
|
6
6
|
*/
|
|
7
7
|
export const defaultPreset: Record<string, string> = {
|
|
8
8
|
// ── Semantic color tokens ─────────────────────────────────────────────
|
|
@@ -175,7 +175,7 @@ export const defaultPreset: Record<string, string> = {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
export const defaultPresetDark: Record<string, string> = {
|
|
178
|
-
// Full dark-mode token set
|
|
178
|
+
// Full dark-mode token set - mirrors tokens.css .dark values so that the
|
|
179
179
|
// injected :root overrides from the light preset are fully superseded when
|
|
180
180
|
// dark mode is toggled.
|
|
181
181
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
@apply border-stroke;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
/* Universal focus ring
|
|
19
|
+
/* Universal focus ring - bare anchors, links, summary, tabindex targets.
|
|
20
20
|
Components use the FOCUS_RING utility class instead. */
|
|
21
21
|
a:focus-visible,
|
|
22
22
|
[role='link']:focus-visible,
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
This file serves TWO purposes from the same data:
|
|
8
8
|
|
|
9
|
-
1. @theme inline
|
|
9
|
+
1. @theme inline - Resolved at BUILD TIME by Tailwind so it can generate
|
|
10
10
|
utility classes (e.g. bg-blue-800, text-neutral-950). These values are
|
|
11
11
|
baked into the compiled CSS and cannot change at runtime.
|
|
12
12
|
|
|
13
|
-
2. :root / .dark
|
|
13
|
+
2. :root / .dark - Standard CSS custom properties available at RUNTIME.
|
|
14
14
|
These power var(--blue-800) references in component code and can be
|
|
15
15
|
swapped by presets or dark mode.
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* ============================================================================
|
|
2
|
-
Semantic Tokens
|
|
2
|
+
Semantic Tokens - Light (:root) & Dark (.dark)
|
|
3
3
|
============================================================================
|
|
4
4
|
Context-aware tokens that map to specific UI roles (background, text,
|
|
5
5
|
border, icon, chart). These swap between light and dark mode.
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
/* ── Type scale, spacing, radius, shadows, motion, z-index ─────────────── */
|
|
12
12
|
@theme {
|
|
13
|
-
/* Spacing base unit
|
|
13
|
+
/* Spacing base unit - reactive at runtime via calc(var(--spacing) * N) */
|
|
14
14
|
--spacing: 0.375rem;
|
|
15
15
|
|
|
16
|
-
/* Type scale
|
|
16
|
+
/* Type scale - all sizes derived from --font-size-base,
|
|
17
17
|
all line-heights derived from --leading-base.
|
|
18
18
|
Adjust the two root tokens to scale the entire system. */
|
|
19
19
|
--text-2xs: calc(var(--font-size-base) * 0.625);
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
--text-7xl: calc(var(--font-size-base) * 5);
|
|
53
53
|
--text-7xl--line-height: calc(var(--leading-base) * 0.75);
|
|
54
54
|
|
|
55
|
-
/* Letter-spacing scale
|
|
55
|
+
/* Letter-spacing scale - derived from --letter-spacing-base.
|
|
56
56
|
tighter=-2x tight=-1x normal=0 wide=1x wider=2x widest=4x */
|
|
57
57
|
--tracking-tighter: calc(var(--letter-spacing-base) * -2);
|
|
58
58
|
--tracking-tight: calc(var(--letter-spacing-base) * -1);
|
|
@@ -61,17 +61,17 @@
|
|
|
61
61
|
--tracking-wider: calc(var(--letter-spacing-base) * 2);
|
|
62
62
|
--tracking-widest: calc(var(--letter-spacing-base) * 4);
|
|
63
63
|
|
|
64
|
-
/* Font families
|
|
64
|
+
/* Font families - in @theme (not inline) so Tailwind generates var()
|
|
65
65
|
references, making them runtime-changeable by presets. */
|
|
66
66
|
--font-sans: 'IBM Plex Mono', sans-serif;
|
|
67
67
|
--font-heading: 'IBM Plex Mono', sans-serif;
|
|
68
68
|
--font-brand: 'IBM Plex Mono', sans-serif;
|
|
69
69
|
|
|
70
|
-
/* Border width
|
|
70
|
+
/* Border width - reactive at runtime */
|
|
71
71
|
--border-width: var(--border-width-base);
|
|
72
72
|
--default-border-width: var(--border-width-base);
|
|
73
73
|
|
|
74
|
-
/* Border radius
|
|
74
|
+
/* Border radius - derived from --radius so presets scale all radii */
|
|
75
75
|
--radius-sm: calc(var(--radius) * 0.6);
|
|
76
76
|
--radius-md: calc(var(--radius) * 0.8);
|
|
77
77
|
--radius-lg: var(--radius);
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
--radius-3xl: calc(var(--radius) * 2.2);
|
|
81
81
|
--radius-4xl: calc(var(--radius) * 2.6);
|
|
82
82
|
|
|
83
|
-
/* Shadow scale
|
|
83
|
+
/* Shadow scale - derived from base variables
|
|
84
84
|
xs=1x sm=1.5x md=3x lg=6x xl=12x */
|
|
85
85
|
--shadow-xs: 0 calc(var(--shadow-offset-y) * 1) calc(var(--shadow-blur) * 1)
|
|
86
86
|
calc(var(--shadow-spread) * 1) var(--shadow-base-color);
|