@lessly/ui 4.1.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-LTHOLX7I.js → chunk-OTYVKDP2.js} +37 -6
- package/dist/index.d.ts +125 -8
- package/dist/index.js +348 -197
- package/dist/router.d.ts +27 -6
- package/dist/router.js +128 -44
- package/dist/styles-federated.css +61 -17
- package/dist/styles.css +62 -54
- package/dist/tailwind-preset.js +30 -4
- package/package.json +2 -2
package/dist/styles.css
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
--bg-elevated: #252936;
|
|
19
19
|
--bg-overlay: #252936;
|
|
20
20
|
--bg-sunken: #0e1015;
|
|
21
|
-
--bg-selected: #
|
|
21
|
+
--bg-selected: #252735;
|
|
22
22
|
--bg-brand: #06297d;
|
|
23
23
|
--bg-brand-subtle: #1f2541;
|
|
24
24
|
--bg-brand-hover: #08349b;
|
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
--grid-container-max: 1440px;
|
|
103
103
|
|
|
104
104
|
/* typography text-styles — theme-invariant, :root only (see typographyVars in build.js) */
|
|
105
|
-
--text-display-xl-font-family: "
|
|
105
|
+
--text-display-xl-font-family: "Sora", "Inter", system-ui, -apple-system, sans-serif;
|
|
106
106
|
--text-display-xl-font-size: 3.5rem;
|
|
107
107
|
--text-display-xl-line-height: 1.05;
|
|
108
108
|
--text-display-xl-font-weight: 400;
|
|
109
109
|
--text-display-xl-letter-spacing: -0.02em;
|
|
110
|
-
--text-display-lg-font-family: "
|
|
110
|
+
--text-display-lg-font-family: "Sora", "Inter", system-ui, -apple-system, sans-serif;
|
|
111
111
|
--text-display-lg-font-size: 3rem;
|
|
112
112
|
--text-display-lg-line-height: 1.1;
|
|
113
113
|
--text-display-lg-font-weight: 400;
|
|
@@ -282,7 +282,7 @@
|
|
|
282
282
|
--bg-elevated: #edeef0;
|
|
283
283
|
--bg-overlay: #ffffff;
|
|
284
284
|
--bg-sunken: #e1e2e4;
|
|
285
|
-
--bg-selected: #
|
|
285
|
+
--bg-selected: #eceded;
|
|
286
286
|
--bg-brand-subtle: #e4ecfe;
|
|
287
287
|
--bg-brand-hover: #05226a;
|
|
288
288
|
--bg-brand-bright-hover: #0b4cd5;
|
|
@@ -341,6 +341,27 @@
|
|
|
341
341
|
--overlay-modal-bg: #ffffff;
|
|
342
342
|
--focus-ring-color: #0940b8;
|
|
343
343
|
|
|
344
|
+
/* Same value as :root on purpose, re-declared so .light lists every colour token a
|
|
345
|
+
light consumer gets rather than leaving some to inheritance. Why, and what holds
|
|
346
|
+
it honest: docs/tokens.md, "Theme invariance". */
|
|
347
|
+
--bg-brand: #06297d;
|
|
348
|
+
--bg-brand-bright: #165ff2;
|
|
349
|
+
--bg-success: #13703c;
|
|
350
|
+
--bg-success-bright: #21be63;
|
|
351
|
+
--bg-danger: #78100b;
|
|
352
|
+
--text-on-brand: #f6f7f7;
|
|
353
|
+
--text-on-success: #f6f7f7;
|
|
354
|
+
--text-on-success-bright: #08090c;
|
|
355
|
+
--text-on-warning: #08090c;
|
|
356
|
+
--text-on-danger: #f6f7f7;
|
|
357
|
+
--border-selected: #737c95;
|
|
358
|
+
--border-brand: #165ff2;
|
|
359
|
+
--border-warning: #b3780e;
|
|
360
|
+
--border-danger: #e82020;
|
|
361
|
+
--field-border-hover: #737c95;
|
|
362
|
+
--field-border-filled: #737c95;
|
|
363
|
+
--field-border-error: #e82020;
|
|
364
|
+
|
|
344
365
|
/* shadcn role bridge re-declared so .light on a nested element (not just <html>)
|
|
345
366
|
re-resolves the aliases to light values. */
|
|
346
367
|
--background: var(--bg-primary);
|
|
@@ -470,11 +491,15 @@
|
|
|
470
491
|
--color-bg-surface: var(--bg-surface);
|
|
471
492
|
--color-bg-elevated: var(--bg-elevated);
|
|
472
493
|
--color-bg-sunken: var(--bg-sunken);
|
|
494
|
+
--color-bg-brand: var(--bg-brand);
|
|
473
495
|
--color-bg-brand-subtle: var(--bg-brand-subtle);
|
|
474
496
|
--color-bg-brand-hover: var(--bg-brand-hover);
|
|
497
|
+
--color-bg-brand-bright: var(--bg-brand-bright);
|
|
498
|
+
--color-bg-success: var(--bg-success);
|
|
475
499
|
--color-bg-success-subtle: var(--bg-success-subtle);
|
|
476
500
|
--color-bg-warning: var(--bg-warning);
|
|
477
501
|
--color-bg-warning-subtle: var(--bg-warning-subtle);
|
|
502
|
+
--color-bg-danger: var(--bg-danger);
|
|
478
503
|
--color-bg-danger-subtle: var(--bg-danger-subtle);
|
|
479
504
|
--color-bg-teal-subtle: var(--bg-teal-subtle);
|
|
480
505
|
--color-bg-violet-subtle: var(--bg-violet-subtle);
|
|
@@ -484,6 +509,10 @@
|
|
|
484
509
|
--color-text-tertiary: var(--text-tertiary);
|
|
485
510
|
--color-text-disabled: var(--text-disabled);
|
|
486
511
|
--color-text-inverse: var(--text-inverse);
|
|
512
|
+
--color-text-on-brand: var(--text-on-brand);
|
|
513
|
+
--color-text-on-success: var(--text-on-success);
|
|
514
|
+
--color-text-on-warning: var(--text-on-warning);
|
|
515
|
+
--color-text-on-danger: var(--text-on-danger);
|
|
487
516
|
--color-text-brand: var(--text-brand);
|
|
488
517
|
--color-text-success: var(--text-success);
|
|
489
518
|
--color-text-warning: var(--text-warning);
|
|
@@ -501,53 +530,25 @@
|
|
|
501
530
|
--color-border-subtle: var(--border-subtle);
|
|
502
531
|
--color-border-default: var(--border-default);
|
|
503
532
|
--color-border-strong: var(--border-strong);
|
|
533
|
+
--color-border-brand: var(--border-brand);
|
|
504
534
|
--color-border-focus: var(--border-focus);
|
|
505
535
|
--color-border-success: var(--border-success);
|
|
536
|
+
--color-border-warning: var(--border-warning);
|
|
537
|
+
--color-border-danger: var(--border-danger);
|
|
506
538
|
}
|
|
507
539
|
|
|
508
540
|
/* === Fonts === */
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
font-style: normal;
|
|
521
|
-
font-display: swap;
|
|
522
|
-
}
|
|
523
|
-
@font-face {
|
|
524
|
-
font-family: "Inter";
|
|
525
|
-
src: url("/fonts/inter/inter-semibold.woff2") format("woff2");
|
|
526
|
-
font-weight: 600;
|
|
527
|
-
font-style: normal;
|
|
528
|
-
font-display: swap;
|
|
529
|
-
}
|
|
530
|
-
@font-face {
|
|
531
|
-
font-family: "Inter";
|
|
532
|
-
src: url("/fonts/inter/inter-bold.woff2") format("woff2");
|
|
533
|
-
font-weight: 700;
|
|
534
|
-
font-style: normal;
|
|
535
|
-
font-display: swap;
|
|
536
|
-
}
|
|
537
|
-
@font-face {
|
|
538
|
-
font-family: "Fira Mono";
|
|
539
|
-
src: url("/fonts/fira-mono/fira-mono-regular.woff2") format("woff2");
|
|
540
|
-
font-weight: 400;
|
|
541
|
-
font-style: normal;
|
|
542
|
-
font-display: swap;
|
|
543
|
-
}
|
|
544
|
-
@font-face {
|
|
545
|
-
font-family: "Fira Mono";
|
|
546
|
-
src: url("/fonts/fira-mono/fira-mono-medium.woff2") format("woff2");
|
|
547
|
-
font-weight: 500;
|
|
548
|
-
font-style: normal;
|
|
549
|
-
font-display: swap;
|
|
550
|
-
}
|
|
541
|
+
/* This kit declares no face of its own, and scripts/build-styles.mjs refuses a build where one
|
|
542
|
+
reappears here. Written without the at-rule spelled out: that guard is a character scanner
|
|
543
|
+
over this file, so naming the rule in prose would register as a block.
|
|
544
|
+
|
|
545
|
+
The faces live in @lessly/tokens/fonts.css — Inter, Fira Mono and Sora, against RELATIVE
|
|
546
|
+
`./fonts/...` paths at files inside that package. A consumer imports that sheet and is done.
|
|
547
|
+
What stood here declared four of them a second time against ABSOLUTE `/fonts/**.woff2`, which
|
|
548
|
+
named files the kit does not ship and every consumer had to serve itself; one who did not
|
|
549
|
+
rendered in system fallback with no error at all. Sora, which `--text-display-*-font-family`
|
|
550
|
+
has named since @lessly/tokens@0.8.0, was never declared here in any form and so never
|
|
551
|
+
painted at all. */
|
|
551
552
|
|
|
552
553
|
/* === Theme Variables === */
|
|
553
554
|
/* The token palettes (colors, typography, motion, shadows, grid) live in
|
|
@@ -647,8 +648,10 @@
|
|
|
647
648
|
|
|
648
649
|
/* === Motion === */
|
|
649
650
|
/* Backs the <AutoHeight> primitive: eases a container's height as its content changes size.
|
|
650
|
-
|
|
651
|
-
|
|
651
|
+
A real class because `height` is a property no Tailwind transition utility names: the only way to
|
|
652
|
+
write it in a class list is the arbitrary `transition-[height]`, which the content scanner can
|
|
653
|
+
drop the first time a file writes it. (The duration is not the reason — `duration-normal` carries
|
|
654
|
+
the same variable this line does.)
|
|
652
655
|
Overflow is NOT clipped here — the component clips only while the height is animating (so the
|
|
653
656
|
settled box doesn't slice focus rings or tooltips on full-width children). */
|
|
654
657
|
.motion-auto-height {
|
|
@@ -658,9 +661,11 @@
|
|
|
658
661
|
}
|
|
659
662
|
|
|
660
663
|
/* Backs ToggleGroup's `sliding` mark: one thumb that travels between equal-width slots instead of a
|
|
661
|
-
fill appearing on each. A
|
|
662
|
-
|
|
663
|
-
`
|
|
664
|
+
fill appearing on each. A named primitive rather than the three utilities that would now say the
|
|
665
|
+
same thing, so the thumb's timing is stated once and cannot drift between the call sites that
|
|
666
|
+
write it. `slide` because the thumb crosses the width of a slot — `ui`, the hover/focus tint step,
|
|
667
|
+
would clip it to near a snap. `standard` because it is on screen before and after and only moves
|
|
668
|
+
in place. */
|
|
664
669
|
.motion-segment-thumb {
|
|
665
670
|
transition-property: transform;
|
|
666
671
|
transition-duration: var(--motion-duration-slide);
|
|
@@ -671,9 +676,9 @@
|
|
|
671
676
|
frame as it travels. One class on both, so the mark cannot be retuned away from the edge it
|
|
672
677
|
answers for — the same reason two carets read one `caretMotion`. `transform` is here rather than
|
|
673
678
|
in a class of its own because the bar is that edge said in miniature: retune one and the two stop
|
|
674
|
-
arriving together. A real class for the reason the
|
|
675
|
-
|
|
676
|
-
|
|
679
|
+
arriving together. A real class for the reason the first one above is, and more so: `width,
|
|
680
|
+
transform` is a pair no Tailwind utility names at all, so writing it in a class list means the
|
|
681
|
+
arbitrary `transition-[width,transform]` — the form the scanner can drop. */
|
|
677
682
|
.motion-rail-collapse {
|
|
678
683
|
transition-property: width, transform;
|
|
679
684
|
transition-duration: var(--motion-duration-normal);
|
|
@@ -738,6 +743,9 @@
|
|
|
738
743
|
/* === Animation layer (tw-animate-css, compiled) — see scripts/build-styles.mjs === */
|
|
739
744
|
/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */
|
|
740
745
|
@layer properties;
|
|
746
|
+
.animate-accordion-down {
|
|
747
|
+
animation: accordion-down var(--tw-animation-duration,var(--tw-duration,.2s))var(--tw-ease,ease-out)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);
|
|
748
|
+
}
|
|
741
749
|
.animate-in {
|
|
742
750
|
animation: enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);
|
|
743
751
|
}
|
package/dist/tailwind-preset.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
// src/tailwind-preset.ts
|
|
2
2
|
import tokensPreset from "@lessly/tokens/tailwind-preset";
|
|
3
3
|
var upstreamTheme = tokensPreset.theme;
|
|
4
|
+
var boundToMotionVar = (name, fallback) => `var(--motion-duration-${name}, ${fallback})`;
|
|
5
|
+
var NUMERIC_DURATION_ALIASES = { 200: "normal", 300: "slow", 500: "slower" };
|
|
6
|
+
var upstreamDuration = (name) => {
|
|
7
|
+
const value = upstreamTheme.transitionDuration[name];
|
|
8
|
+
if (value === void 0) {
|
|
9
|
+
throw new Error(
|
|
10
|
+
`@lessly/tokens no longer declares transitionDuration.${name}, which the numeric duration steps alias \u2014 repoint or drop NUMERIC_DURATION_ALIASES for it in src/tailwind-preset.ts.`
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
};
|
|
4
15
|
var lesslyPreset = {
|
|
5
16
|
// Spread first: darkMode must keep winning even if upstream ever adds one.
|
|
6
17
|
...tokensPreset,
|
|
@@ -30,11 +41,26 @@ var lesslyPreset = {
|
|
|
30
41
|
// is not there. Four of these steps are an upstream token's own value under the name Tailwind
|
|
31
42
|
// reads for it — 200ms is `normal`, 300ms `slow`, 500ms `slower`, 10 `raised`. Same deletion
|
|
32
43
|
// contract as the three above.
|
|
44
|
+
//
|
|
45
|
+
// Every step reaches the utility as its motion variable, upstream's literal behind it as the
|
|
46
|
+
// fallback, and the numeric steps bind to the variable of the key they alias. Only a
|
|
47
|
+
// declaration naming a variable is one the token layer's `prefers-reduced-motion` block can
|
|
48
|
+
// zero. Only the fallback keeps a consumer who takes the preset without `@lessly/ui/styles.css`
|
|
49
|
+
// on the durations they have: a `var()` with nothing to resolve and no fallback is invalid at
|
|
50
|
+
// computed-value time, and `transition-duration` drops to its initial `0s`.
|
|
33
51
|
transitionDuration: {
|
|
34
|
-
...
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
52
|
+
...Object.fromEntries(
|
|
53
|
+
Object.entries(upstreamTheme.transitionDuration).map(([name, value]) => [
|
|
54
|
+
name,
|
|
55
|
+
boundToMotionVar(name, value)
|
|
56
|
+
])
|
|
57
|
+
),
|
|
58
|
+
...Object.fromEntries(
|
|
59
|
+
Object.entries(NUMERIC_DURATION_ALIASES).map(([step, name]) => [
|
|
60
|
+
step,
|
|
61
|
+
boundToMotionVar(name, upstreamDuration(name))
|
|
62
|
+
])
|
|
63
|
+
)
|
|
38
64
|
},
|
|
39
65
|
zIndex: { ...upstreamTheme.zIndex, 10: "10", 20: "20", 50: "50" },
|
|
40
66
|
boxShadow: { ...upstreamTheme.boxShadow, none: "none" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lessly/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Lessly design system — shared UI primitives, tokens, and theme",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.30.3",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@lessly/tokens": "^0.
|
|
76
|
+
"@lessly/tokens": "^0.9.0",
|
|
77
77
|
"@radix-ui/react-accordion": "^1.2.16",
|
|
78
78
|
"@radix-ui/react-alert-dialog": "^1.1.19",
|
|
79
79
|
"@radix-ui/react-aspect-ratio": "^1.1.11",
|