@trinityui/design-system 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +464 -0
- package/README.md +492 -136
- package/dist/assets/design-system.css +1 -1
- package/dist/components/DocumentCard/DocumentCard.d.ts +77 -0
- package/dist/components/DocumentCard/DocumentCard.d.ts.map +1 -0
- package/dist/components/DocumentCard/index.d.ts +3 -0
- package/dist/components/DocumentCard/index.d.ts.map +1 -0
- package/dist/components/HtmlToMui/HtmlToMui.d.ts +39 -0
- package/dist/components/HtmlToMui/HtmlToMui.d.ts.map +1 -0
- package/dist/components/HtmlToMui/StreamingHtmlToMui.d.ts +35 -0
- package/dist/components/HtmlToMui/StreamingHtmlToMui.d.ts.map +1 -0
- package/dist/components/HtmlToMui/index.d.ts +4 -0
- package/dist/components/HtmlToMui/index.d.ts.map +1 -0
- package/dist/components/SandboxedIframeRenderer/SandboxedIframeRenderer.d.ts +62 -0
- package/dist/components/SandboxedIframeRenderer/SandboxedIframeRenderer.d.ts.map +1 -0
- package/dist/components/SandboxedIframeRenderer/index.d.ts +3 -0
- package/dist/components/SandboxedIframeRenderer/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/data-table2.js +18194 -15721
- package/dist/forms.js +10814 -9340
- package/dist/index.js +30181 -30234
- package/dist/theme.d.ts +4 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +183 -156
- package/dist/trinity.css +11 -2
- package/package.json +61 -24
package/dist/theme.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { createTheme as M, useTheme as C } from "@mui/material/styles";
|
|
2
|
-
import { t, c as
|
|
3
|
-
import { g as
|
|
4
|
-
import { useMemo as
|
|
2
|
+
import { t as p, c as i, d as f, e as w, s as m, a as y } from "./app-shell.js";
|
|
3
|
+
import { g as X, j as Z, f as q, o as J, m as K, p as Q, n as Y, h as _, k, i as S, l as rr } from "./app-shell.js";
|
|
4
|
+
import { useMemo as R } from "react";
|
|
5
5
|
function O(...r) {
|
|
6
6
|
return `--trinity-${r.join("-").replace(/([A-Z])/g, "-$1").toLowerCase()}`;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
for (const [
|
|
11
|
-
const
|
|
8
|
+
function e(r, a = []) {
|
|
9
|
+
const o = [];
|
|
10
|
+
for (const [s, c] of Object.entries(r)) {
|
|
11
|
+
const g = [...a, s];
|
|
12
12
|
if (c != null)
|
|
13
13
|
if (typeof c == "object" && !Array.isArray(c))
|
|
14
|
-
|
|
14
|
+
o.push(...e(c, g));
|
|
15
15
|
else {
|
|
16
|
-
const n = typeof c == "number" && !
|
|
17
|
-
|
|
16
|
+
const n = typeof c == "number" && !s.includes("opacity") && !s.includes("weight") && !s.includes("Height") ? `${c}px` : String(c);
|
|
17
|
+
o.push({ name: O(...g), value: n });
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return o;
|
|
21
21
|
}
|
|
22
|
-
function z(r =
|
|
22
|
+
function z(r = p) {
|
|
23
23
|
const a = [];
|
|
24
|
-
return a.push(...
|
|
24
|
+
return a.push(...e(r.base.colors, ["color"])), a.push(...e(r.base.spacing, ["spacing"])), a.push(...e(r.base.fontSize, ["font-size"])), a.push(...e(r.base.fontWeight, ["font-weight"])), a.push(...e(r.base.lineHeight, ["line-height"])), a.push(...e(r.base.letterSpacing, ["letter-spacing"])), a.push(...e(r.base.borderRadius, ["radius"])), a.push(...e(r.base.borderWidth, ["border-width"])), a.push(...e(r.base.shadows, ["shadow"])), a.push(...e(r.base.zIndex, ["z-index"])), a.push(...e(r.base.duration, ["duration"])), a.push(...e(r.base.easing, ["easing"])), a.push(...e(r.base.opacity, ["opacity"])), a.push(...e(r.base.breakpoints, ["breakpoint"])), a.push(...e(r.semantic.colors, ["semantic"])), a.push(...e(r.semantic.spacing, ["semantic-spacing"])), a.push(...e(r.semantic.borders, ["semantic-border"])), a.push(...e(r.semantic.shadows, ["semantic-shadow"])), a.push(...e(r.semantic.motion, ["motion"])), a.push(...e(r.component, ["component"])), a.map((o) => ` ${o.name}: ${o.value};`).join(`
|
|
25
25
|
`);
|
|
26
26
|
}
|
|
27
|
-
function $(r =
|
|
27
|
+
function $(r = p) {
|
|
28
28
|
const a = [];
|
|
29
|
-
return a.push(...
|
|
29
|
+
return a.push(...e(r.darkMode.colors.text, ["semantic", "text"])), a.push(...e(r.darkMode.colors.background, ["semantic", "background"])), a.push(...e(r.darkMode.colors.border, ["semantic", "border"])), r.darkMode.colors.interactive && a.push(...e(r.darkMode.colors.interactive, ["semantic", "interactive"])), r.darkMode.colors.status && a.push(...e(r.darkMode.colors.status, ["semantic", "status"])), a.map((o) => ` ${o.name}: ${o.value};`).join(`
|
|
30
30
|
`);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function P(r = p) {
|
|
33
33
|
if (typeof window > "u") return;
|
|
34
|
-
const a = z(r),
|
|
35
|
-
|
|
34
|
+
const a = z(r), o = document.createElement("style");
|
|
35
|
+
o.id = "trinity-css-variables", o.textContent = `:root {
|
|
36
36
|
${a}
|
|
37
37
|
}`;
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const s = document.getElementById("trinity-css-variables");
|
|
39
|
+
s && s.remove(), document.head.appendChild(o);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function D(r = p) {
|
|
42
42
|
if (typeof window > "u") return;
|
|
43
|
-
const a = $(r),
|
|
44
|
-
|
|
43
|
+
const a = $(r), o = document.createElement("style");
|
|
44
|
+
o.id = "trinity-dark-mode-variables", o.textContent = `
|
|
45
45
|
[data-theme="dark"],
|
|
46
46
|
.dark-mode,
|
|
47
47
|
:root.dark {
|
|
@@ -53,29 +53,29 @@ ${a}
|
|
|
53
53
|
${a}
|
|
54
54
|
}
|
|
55
55
|
}`;
|
|
56
|
-
const
|
|
57
|
-
|
|
56
|
+
const s = document.getElementById("trinity-dark-mode-variables");
|
|
57
|
+
s && s.remove(), document.head.appendChild(o);
|
|
58
58
|
}
|
|
59
59
|
function W(r, a) {
|
|
60
|
-
function
|
|
61
|
-
let
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
return [
|
|
60
|
+
function o(n) {
|
|
61
|
+
let u = n.replace("#", "");
|
|
62
|
+
u.length === 3 && (u = u.split("").map((l) => l + l).join(""));
|
|
63
|
+
const t = parseInt(u, 16);
|
|
64
|
+
return [t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const l = [n,
|
|
66
|
+
function s([n, u, t]) {
|
|
67
|
+
const l = [n, u, t].map((b) => (b /= 255, b <= 0.03928 ? b / 12.92 : Math.pow((b + 0.055) / 1.055, 2.4)));
|
|
68
68
|
return 0.2126 * l[0] + 0.7152 * l[1] + 0.0722 * l[2];
|
|
69
69
|
}
|
|
70
|
-
const c =
|
|
71
|
-
return (Math.max(c,
|
|
70
|
+
const c = s(o(r)), g = s(o(a));
|
|
71
|
+
return (Math.max(c, g) + 0.05) / (Math.min(c, g) + 0.05);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
const
|
|
75
|
-
return
|
|
73
|
+
function L(r, a, o = 4.5) {
|
|
74
|
+
const s = W(r, a);
|
|
75
|
+
return s < o && typeof window < "u" && console.warn(`[Trinity] Low contrast ratio ${s.toFixed(2)} for ${r} on ${a}`), s >= o;
|
|
76
76
|
}
|
|
77
|
-
function T(r =
|
|
78
|
-
const
|
|
77
|
+
function T(r = p, a = "light") {
|
|
78
|
+
const o = a === "dark" ? "rgba(255, 255, 255, 0.12)" : r.base.colors.gray[200], s = a === "dark" ? "rgba(255, 255, 255, 0.2)" : r.base.colors.gray[300];
|
|
79
79
|
return {
|
|
80
80
|
MuiCssBaseline: {
|
|
81
81
|
styleOverrides: {
|
|
@@ -234,7 +234,7 @@ function T(r = t, a = "light") {
|
|
|
234
234
|
borderRadius: r.base.borderRadius.lg,
|
|
235
235
|
// 12px — matches component tokens
|
|
236
236
|
backgroundColor: a === "dark" ? r.base.colors.gray[700] : r.base.colors.gray[0],
|
|
237
|
-
border: `1px solid ${
|
|
237
|
+
border: `1px solid ${o}`,
|
|
238
238
|
boxShadow: a === "dark" ? "0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.3), 0 0 0 1px rgb(255 255 255 / 0.05)" : r.base.shadows.base,
|
|
239
239
|
transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out",
|
|
240
240
|
"&:hover": {
|
|
@@ -252,30 +252,30 @@ function T(r = t, a = "light") {
|
|
|
252
252
|
borderRadius: r.base.borderRadius.lg,
|
|
253
253
|
// 12px — consistent with cards
|
|
254
254
|
backgroundColor: a === "dark" ? r.base.colors.gray[700] : r.base.colors.gray[0],
|
|
255
|
-
border: `1px solid ${
|
|
255
|
+
border: `1px solid ${o}`,
|
|
256
256
|
boxShadow: a === "dark" ? "0 1px 2px 0 rgb(0 0 0 / 0.3), 0 0 0 1px rgb(255 255 255 / 0.05)" : r.base.shadows.sm
|
|
257
257
|
},
|
|
258
258
|
rounded: {
|
|
259
259
|
borderRadius: r.base.borderRadius.lg
|
|
260
260
|
},
|
|
261
261
|
elevation0: {
|
|
262
|
-
border: `1px solid ${
|
|
262
|
+
border: `1px solid ${o}`,
|
|
263
263
|
boxShadow: a === "dark" ? "0 1px 2px 0 rgb(0 0 0 / 0.3), 0 0 0 1px rgb(255 255 255 / 0.05)" : r.base.shadows.sm
|
|
264
264
|
},
|
|
265
265
|
elevation1: {
|
|
266
|
-
border: `1px solid ${
|
|
266
|
+
border: `1px solid ${o}`,
|
|
267
267
|
boxShadow: a === "dark" ? "0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.3), 0 0 0 1px rgb(255 255 255 / 0.05)" : r.base.shadows.base
|
|
268
268
|
},
|
|
269
269
|
elevation2: {
|
|
270
|
-
border: `1px solid ${
|
|
270
|
+
border: `1px solid ${o}`,
|
|
271
271
|
boxShadow: a === "dark" ? "0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.4), 0 0 0 1px rgb(255 255 255 / 0.05)" : r.base.shadows.md
|
|
272
272
|
},
|
|
273
273
|
elevation3: {
|
|
274
|
-
border: `1px solid ${
|
|
274
|
+
border: `1px solid ${o}`,
|
|
275
275
|
boxShadow: a === "dark" ? "0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.05)" : r.base.shadows.lg
|
|
276
276
|
},
|
|
277
277
|
outlined: {
|
|
278
|
-
border: `1px solid ${
|
|
278
|
+
border: `1px solid ${s}`,
|
|
279
279
|
boxShadow: "none"
|
|
280
280
|
}
|
|
281
281
|
}
|
|
@@ -321,7 +321,7 @@ function T(r = t, a = "light") {
|
|
|
321
321
|
borderRadius: r.base.borderRadius.xl,
|
|
322
322
|
// 16px — allows nested cards with lg:12px
|
|
323
323
|
backgroundColor: a === "dark" ? r.base.colors.gray[700] : r.base.colors.gray[0],
|
|
324
|
-
border: `1px solid ${
|
|
324
|
+
border: `1px solid ${o}`,
|
|
325
325
|
boxShadow: a === "dark" ? "0 25px 50px -12px rgb(0 0 0 / 0.6), 0 0 0 1px rgb(255 255 255 / 0.1)" : r.base.shadows["2xl"]
|
|
326
326
|
}
|
|
327
327
|
}
|
|
@@ -329,7 +329,7 @@ function T(r = t, a = "light") {
|
|
|
329
329
|
MuiDialogTitle: {
|
|
330
330
|
styleOverrides: {
|
|
331
331
|
root: {
|
|
332
|
-
fontSize: r.base.fontSize.
|
|
332
|
+
fontSize: r.base.fontSize.xl,
|
|
333
333
|
fontWeight: r.base.fontWeight.semibold,
|
|
334
334
|
padding: `${r.base.spacing[5]}px ${r.base.spacing[6]}px`,
|
|
335
335
|
paddingBottom: r.base.spacing[3],
|
|
@@ -598,7 +598,7 @@ function T(r = t, a = "light") {
|
|
|
598
598
|
transitionDuration: "300ms",
|
|
599
599
|
"&.Mui-checked": {
|
|
600
600
|
transform: "translateX(20px)",
|
|
601
|
-
color:
|
|
601
|
+
color: r.base.colors.gray[0],
|
|
602
602
|
"& + .MuiSwitch-track": {
|
|
603
603
|
backgroundColor: a === "dark" ? r.base.colors.coral[400] : r.base.colors.navy[900],
|
|
604
604
|
opacity: 1,
|
|
@@ -607,7 +607,18 @@ function T(r = t, a = "light") {
|
|
|
607
607
|
"& .MuiSwitch-thumb": {
|
|
608
608
|
width: 24,
|
|
609
609
|
height: 24,
|
|
610
|
-
margin: 0
|
|
610
|
+
margin: 0,
|
|
611
|
+
"&::before": {
|
|
612
|
+
content: '""',
|
|
613
|
+
position: "absolute",
|
|
614
|
+
width: "100%",
|
|
615
|
+
height: "100%",
|
|
616
|
+
left: 0,
|
|
617
|
+
top: 0,
|
|
618
|
+
backgroundRepeat: "no-repeat",
|
|
619
|
+
backgroundPosition: "center",
|
|
620
|
+
backgroundImage: `url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 24 24"><path fill="${encodeURIComponent(a === "dark" ? r.base.colors.coral[400] : r.base.colors.navy[900])}" d="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>')`
|
|
621
|
+
}
|
|
611
622
|
},
|
|
612
623
|
"&.Mui-disabled + .MuiSwitch-track": {
|
|
613
624
|
opacity: 0.5
|
|
@@ -615,7 +626,7 @@ function T(r = t, a = "light") {
|
|
|
615
626
|
},
|
|
616
627
|
"&.Mui-focusVisible .MuiSwitch-thumb": {
|
|
617
628
|
color: a === "dark" ? r.base.colors.coral[400] : r.base.colors.navy[900],
|
|
618
|
-
border:
|
|
629
|
+
border: `6px solid ${r.base.colors.gray[0]}`
|
|
619
630
|
},
|
|
620
631
|
"&.Mui-disabled .MuiSwitch-thumb": {
|
|
621
632
|
color: a === "dark" ? r.base.colors.gray[600] : r.base.colors.gray[300]
|
|
@@ -629,6 +640,7 @@ function T(r = t, a = "light") {
|
|
|
629
640
|
width: 16,
|
|
630
641
|
height: 16,
|
|
631
642
|
margin: 4,
|
|
643
|
+
position: "relative",
|
|
632
644
|
boxShadow: r.base.shadows.sm,
|
|
633
645
|
transition: "all 200ms ease-in-out"
|
|
634
646
|
},
|
|
@@ -652,7 +664,18 @@ function T(r = t, a = "light") {
|
|
|
652
664
|
"& .MuiSwitch-thumb": {
|
|
653
665
|
width: 18,
|
|
654
666
|
height: 18,
|
|
655
|
-
margin: 0
|
|
667
|
+
margin: 0,
|
|
668
|
+
"&::before": {
|
|
669
|
+
content: '""',
|
|
670
|
+
position: "absolute",
|
|
671
|
+
width: "100%",
|
|
672
|
+
height: "100%",
|
|
673
|
+
left: 0,
|
|
674
|
+
top: 0,
|
|
675
|
+
backgroundRepeat: "no-repeat",
|
|
676
|
+
backgroundPosition: "center",
|
|
677
|
+
backgroundImage: `url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="12" width="12" viewBox="0 0 24 24"><path fill="${encodeURIComponent(a === "dark" ? r.base.colors.coral[400] : r.base.colors.navy[900])}" d="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>')`
|
|
678
|
+
}
|
|
656
679
|
}
|
|
657
680
|
}
|
|
658
681
|
},
|
|
@@ -761,7 +784,7 @@ function T(r = t, a = "light") {
|
|
|
761
784
|
MuiTableCell: {
|
|
762
785
|
styleOverrides: {
|
|
763
786
|
root: {
|
|
764
|
-
borderBottom: `1px solid ${
|
|
787
|
+
borderBottom: `1px solid ${o}`,
|
|
765
788
|
padding: `${r.base.spacing[3]}px ${r.base.spacing[4]}px`
|
|
766
789
|
},
|
|
767
790
|
head: {
|
|
@@ -803,7 +826,7 @@ function T(r = t, a = "light") {
|
|
|
803
826
|
paper: {
|
|
804
827
|
borderRadius: r.base.borderRadius.md,
|
|
805
828
|
boxShadow: a === "dark" ? "0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5)" : "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
806
|
-
border: `1px solid ${
|
|
829
|
+
border: `1px solid ${o}`,
|
|
807
830
|
marginTop: r.base.spacing[1]
|
|
808
831
|
},
|
|
809
832
|
list: {
|
|
@@ -835,7 +858,7 @@ function T(r = t, a = "light") {
|
|
|
835
858
|
paper: {
|
|
836
859
|
borderRadius: r.base.borderRadius.md,
|
|
837
860
|
boxShadow: a === "dark" ? "0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5)" : "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
838
|
-
border: `1px solid ${
|
|
861
|
+
border: `1px solid ${o}`
|
|
839
862
|
}
|
|
840
863
|
}
|
|
841
864
|
},
|
|
@@ -901,7 +924,7 @@ function T(r = t, a = "light") {
|
|
|
901
924
|
styleOverrides: {
|
|
902
925
|
paper: {
|
|
903
926
|
backgroundColor: a === "dark" ? r.base.colors.gray[800] : r.base.colors.gray[0],
|
|
904
|
-
borderRight: `1px solid ${
|
|
927
|
+
borderRight: `1px solid ${o}`
|
|
905
928
|
}
|
|
906
929
|
}
|
|
907
930
|
},
|
|
@@ -968,7 +991,7 @@ function T(r = t, a = "light") {
|
|
|
968
991
|
backgroundColor: r.base.colors.coral[600]
|
|
969
992
|
},
|
|
970
993
|
colorSuccess: {
|
|
971
|
-
backgroundColor:
|
|
994
|
+
backgroundColor: r.semantic.colors.status.success.text
|
|
972
995
|
}
|
|
973
996
|
}
|
|
974
997
|
},
|
|
@@ -1031,7 +1054,7 @@ function T(r = t, a = "light") {
|
|
|
1031
1054
|
color: a === "dark" ? r.base.colors.coral[400] : r.base.colors.navy[900]
|
|
1032
1055
|
},
|
|
1033
1056
|
"&.Mui-completed": {
|
|
1034
|
-
color:
|
|
1057
|
+
color: r.semantic.colors.status.success.text
|
|
1035
1058
|
}
|
|
1036
1059
|
}
|
|
1037
1060
|
}
|
|
@@ -1069,6 +1092,7 @@ function T(r = t, a = "light") {
|
|
|
1069
1092
|
styleOverrides: {
|
|
1070
1093
|
root: {
|
|
1071
1094
|
color: "#FFB400"
|
|
1095
|
+
// @intentional-color: rating star gold — no token equivalent
|
|
1072
1096
|
},
|
|
1073
1097
|
iconEmpty: {
|
|
1074
1098
|
color: a === "dark" ? r.base.colors.gray[600] : r.base.colors.gray[300]
|
|
@@ -1164,31 +1188,33 @@ function T(r = t, a = "light") {
|
|
|
1164
1188
|
}
|
|
1165
1189
|
};
|
|
1166
1190
|
}
|
|
1167
|
-
function
|
|
1191
|
+
function F(r) {
|
|
1168
1192
|
const {
|
|
1169
1193
|
mode: a,
|
|
1194
|
+
direction: o = "ltr",
|
|
1170
1195
|
name: s = "custom",
|
|
1171
|
-
tokens:
|
|
1172
|
-
palette:
|
|
1173
|
-
components:
|
|
1174
|
-
typography:
|
|
1175
|
-
shape:
|
|
1176
|
-
config:
|
|
1177
|
-
} = r,
|
|
1196
|
+
tokens: c,
|
|
1197
|
+
palette: g,
|
|
1198
|
+
components: n,
|
|
1199
|
+
typography: u,
|
|
1200
|
+
shape: t,
|
|
1201
|
+
config: l = {}
|
|
1202
|
+
} = r, b = v(a, c, o);
|
|
1178
1203
|
return {
|
|
1179
|
-
theme: M(
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1204
|
+
theme: M(b, {
|
|
1205
|
+
direction: o,
|
|
1206
|
+
palette: g,
|
|
1207
|
+
components: n,
|
|
1208
|
+
typography: u,
|
|
1209
|
+
shape: t
|
|
1184
1210
|
}),
|
|
1185
1211
|
name: s,
|
|
1186
1212
|
mode: a,
|
|
1187
|
-
config:
|
|
1213
|
+
config: l
|
|
1188
1214
|
};
|
|
1189
1215
|
}
|
|
1190
|
-
function
|
|
1191
|
-
const s = { ...
|
|
1216
|
+
function v(r, a, o = "ltr") {
|
|
1217
|
+
const s = { ...p, ...a }, c = r === "dark" ? {
|
|
1192
1218
|
mode: "dark",
|
|
1193
1219
|
primary: { main: s.base.colors.coral[600], ...s.base.colors.coral },
|
|
1194
1220
|
secondary: { main: s.base.colors.purple[500], ...s.base.colors.purple },
|
|
@@ -1219,15 +1245,15 @@ function h(r, a) {
|
|
|
1219
1245
|
focus: s.base.colors.purple[400]
|
|
1220
1246
|
},
|
|
1221
1247
|
status: {
|
|
1222
|
-
success: { text:
|
|
1223
|
-
warning: { text:
|
|
1224
|
-
error: { text:
|
|
1225
|
-
info: { text:
|
|
1248
|
+
success: { text: s.darkMode.colors.status.success.text, background: s.darkMode.colors.status.success.background, border: s.darkMode.colors.status.success.border },
|
|
1249
|
+
warning: { text: s.darkMode.colors.status.warning.text, background: s.darkMode.colors.status.warning.background, border: s.darkMode.colors.status.warning.border },
|
|
1250
|
+
error: { text: s.darkMode.colors.status.error.text, background: s.darkMode.colors.status.error.background, border: s.darkMode.colors.status.error.border },
|
|
1251
|
+
info: { text: s.darkMode.colors.status.info.text, background: s.darkMode.colors.status.info.background, border: s.darkMode.colors.status.info.border }
|
|
1226
1252
|
},
|
|
1227
1253
|
border: {
|
|
1228
|
-
default:
|
|
1229
|
-
subtle:
|
|
1230
|
-
strong:
|
|
1254
|
+
default: s.darkMode.colors.border.default,
|
|
1255
|
+
subtle: s.darkMode.colors.border.subtle,
|
|
1256
|
+
strong: s.darkMode.colors.border.strong
|
|
1231
1257
|
}
|
|
1232
1258
|
}
|
|
1233
1259
|
} : {
|
|
@@ -1261,10 +1287,10 @@ function h(r, a) {
|
|
|
1261
1287
|
focus: s.base.colors.purple[700]
|
|
1262
1288
|
},
|
|
1263
1289
|
status: {
|
|
1264
|
-
success: { text:
|
|
1265
|
-
warning: { text:
|
|
1266
|
-
error: { text:
|
|
1267
|
-
info: { text: s.
|
|
1290
|
+
success: { text: s.semantic.colors.status.success.text, background: s.semantic.colors.status.success.background, border: s.semantic.colors.status.success.border },
|
|
1291
|
+
warning: { text: s.semantic.colors.status.warning.text, background: s.semantic.colors.status.warning.background, border: s.semantic.colors.status.warning.border },
|
|
1292
|
+
error: { text: s.semantic.colors.status.error.text, background: s.semantic.colors.status.error.background, border: s.semantic.colors.status.error.border },
|
|
1293
|
+
info: { text: s.semantic.colors.status.info.text, background: s.semantic.colors.status.info.background, border: s.semantic.colors.status.info.border }
|
|
1268
1294
|
},
|
|
1269
1295
|
border: {
|
|
1270
1296
|
default: s.base.colors.gray[200],
|
|
@@ -1272,7 +1298,7 @@ function h(r, a) {
|
|
|
1272
1298
|
strong: s.base.colors.gray[400]
|
|
1273
1299
|
}
|
|
1274
1300
|
}
|
|
1275
|
-
},
|
|
1301
|
+
}, g = {
|
|
1276
1302
|
fontFamily: '"Montserrat", sans-serif',
|
|
1277
1303
|
// Button text style
|
|
1278
1304
|
button: {
|
|
@@ -1282,85 +1308,86 @@ function h(r, a) {
|
|
|
1282
1308
|
// Hierarchy-based typography variants
|
|
1283
1309
|
// Display variants (Level 1 - Hero/Marketing)
|
|
1284
1310
|
h1: {
|
|
1285
|
-
fontSize:
|
|
1286
|
-
fontWeight:
|
|
1287
|
-
lineHeight:
|
|
1311
|
+
fontSize: i.heading.scale.h1.size,
|
|
1312
|
+
fontWeight: i.heading.scale.h1.weight,
|
|
1313
|
+
lineHeight: i.heading.scale.h1.lineHeight,
|
|
1288
1314
|
color: r === "dark" ? s.darkMode.colors.text.primary : s.semantic.colors.text.primary
|
|
1289
1315
|
},
|
|
1290
1316
|
h2: {
|
|
1291
|
-
fontSize:
|
|
1292
|
-
fontWeight:
|
|
1293
|
-
lineHeight:
|
|
1317
|
+
fontSize: i.heading.scale.h2.size,
|
|
1318
|
+
fontWeight: i.heading.scale.h2.weight,
|
|
1319
|
+
lineHeight: i.heading.scale.h2.lineHeight,
|
|
1294
1320
|
color: r === "dark" ? s.darkMode.colors.text.primary : s.semantic.colors.text.primary
|
|
1295
1321
|
},
|
|
1296
1322
|
h3: {
|
|
1297
|
-
fontSize:
|
|
1298
|
-
fontWeight:
|
|
1299
|
-
lineHeight:
|
|
1323
|
+
fontSize: i.heading.scale.h3.size,
|
|
1324
|
+
fontWeight: i.heading.scale.h3.weight,
|
|
1325
|
+
lineHeight: i.heading.scale.h3.lineHeight,
|
|
1300
1326
|
color: r === "dark" ? s.darkMode.colors.text.primary : s.semantic.colors.text.primary
|
|
1301
1327
|
},
|
|
1302
1328
|
h4: {
|
|
1303
|
-
fontSize:
|
|
1304
|
-
fontWeight:
|
|
1305
|
-
lineHeight:
|
|
1329
|
+
fontSize: i.heading.scale.h4.size,
|
|
1330
|
+
fontWeight: i.heading.scale.h4.weight,
|
|
1331
|
+
lineHeight: i.heading.scale.h4.lineHeight,
|
|
1306
1332
|
color: r === "dark" ? s.darkMode.colors.text.primary : s.semantic.colors.text.secondary
|
|
1307
1333
|
},
|
|
1308
1334
|
h5: {
|
|
1309
|
-
fontSize:
|
|
1310
|
-
fontWeight:
|
|
1311
|
-
lineHeight:
|
|
1335
|
+
fontSize: i.heading.scale.h5.size,
|
|
1336
|
+
fontWeight: i.heading.scale.h5.weight,
|
|
1337
|
+
lineHeight: i.heading.scale.h5.lineHeight,
|
|
1312
1338
|
color: r === "dark" ? s.darkMode.colors.text.secondary : s.semantic.colors.text.secondary
|
|
1313
1339
|
},
|
|
1314
1340
|
h6: {
|
|
1315
|
-
fontSize:
|
|
1316
|
-
fontWeight:
|
|
1317
|
-
lineHeight:
|
|
1341
|
+
fontSize: i.heading.scale.h6.size,
|
|
1342
|
+
fontWeight: i.heading.scale.h6.weight,
|
|
1343
|
+
lineHeight: i.heading.scale.h6.lineHeight,
|
|
1318
1344
|
color: r === "dark" ? s.darkMode.colors.text.secondary : s.semantic.colors.text.secondary
|
|
1319
1345
|
},
|
|
1320
1346
|
// Body variants (Level 3 - Content)
|
|
1321
1347
|
body1: {
|
|
1322
|
-
fontSize:
|
|
1323
|
-
fontWeight:
|
|
1324
|
-
lineHeight:
|
|
1348
|
+
fontSize: i.body.scale.medium.size,
|
|
1349
|
+
fontWeight: i.body.scale.medium.weight,
|
|
1350
|
+
lineHeight: i.body.scale.medium.lineHeight,
|
|
1325
1351
|
color: r === "dark" ? s.darkMode.colors.text.primary : s.semantic.colors.text.primary
|
|
1326
1352
|
},
|
|
1327
1353
|
body2: {
|
|
1328
|
-
fontSize:
|
|
1329
|
-
fontWeight:
|
|
1330
|
-
lineHeight:
|
|
1354
|
+
fontSize: i.body.scale.small.size,
|
|
1355
|
+
fontWeight: i.body.scale.small.weight,
|
|
1356
|
+
lineHeight: i.body.scale.small.lineHeight,
|
|
1331
1357
|
color: r === "dark" ? s.darkMode.colors.text.secondary : s.semantic.colors.text.secondary
|
|
1332
1358
|
},
|
|
1333
1359
|
// Supporting text variants
|
|
1334
1360
|
subtitle1: {
|
|
1335
|
-
fontSize:
|
|
1336
|
-
fontWeight:
|
|
1337
|
-
lineHeight:
|
|
1361
|
+
fontSize: i.label.scale.large.size,
|
|
1362
|
+
fontWeight: i.label.scale.large.weight,
|
|
1363
|
+
lineHeight: i.label.scale.large.lineHeight,
|
|
1338
1364
|
color: r === "dark" ? s.darkMode.colors.text.primary : s.semantic.colors.text.primary
|
|
1339
1365
|
},
|
|
1340
1366
|
subtitle2: {
|
|
1341
|
-
fontSize:
|
|
1342
|
-
fontWeight:
|
|
1343
|
-
lineHeight:
|
|
1367
|
+
fontSize: i.label.scale.medium.size,
|
|
1368
|
+
fontWeight: i.label.scale.medium.weight,
|
|
1369
|
+
lineHeight: i.label.scale.medium.lineHeight,
|
|
1344
1370
|
color: r === "dark" ? s.darkMode.colors.text.secondary : s.semantic.colors.text.secondary
|
|
1345
1371
|
},
|
|
1346
1372
|
caption: {
|
|
1347
|
-
fontSize:
|
|
1348
|
-
fontWeight:
|
|
1349
|
-
lineHeight:
|
|
1373
|
+
fontSize: i.caption.scale.default.size,
|
|
1374
|
+
fontWeight: i.caption.scale.default.weight,
|
|
1375
|
+
lineHeight: i.caption.scale.default.lineHeight,
|
|
1350
1376
|
color: r === "dark" ? s.darkMode.colors.text.tertiary : s.semantic.colors.text.tertiary
|
|
1351
1377
|
},
|
|
1352
1378
|
overline: {
|
|
1353
|
-
fontSize:
|
|
1354
|
-
fontWeight:
|
|
1355
|
-
lineHeight:
|
|
1356
|
-
letterSpacing:
|
|
1379
|
+
fontSize: i.overline.scale.default.size,
|
|
1380
|
+
fontWeight: i.overline.scale.default.weight,
|
|
1381
|
+
lineHeight: i.overline.scale.default.lineHeight,
|
|
1382
|
+
letterSpacing: i.overline.scale.default.tracking,
|
|
1357
1383
|
textTransform: "uppercase",
|
|
1358
1384
|
color: r === "dark" ? s.darkMode.colors.text.tertiary : s.semantic.colors.text.tertiary
|
|
1359
1385
|
}
|
|
1360
1386
|
};
|
|
1361
1387
|
return M({
|
|
1362
|
-
|
|
1363
|
-
|
|
1388
|
+
direction: o,
|
|
1389
|
+
palette: c,
|
|
1390
|
+
typography: g,
|
|
1364
1391
|
shape: {
|
|
1365
1392
|
borderRadius: s.base.borderRadius.md
|
|
1366
1393
|
// 8px base - components override as needed
|
|
@@ -1395,7 +1422,7 @@ const d = {
|
|
|
1395
1422
|
darkBg: "#18181B",
|
|
1396
1423
|
darkPaper: "#27272A"
|
|
1397
1424
|
}
|
|
1398
|
-
},
|
|
1425
|
+
}, E = {
|
|
1399
1426
|
// White text on colored backgrounds
|
|
1400
1427
|
whiteOnNavy: { text: d.neutral.white, bg: d.primary.main },
|
|
1401
1428
|
whiteOnPurple: { text: d.neutral.white, bg: d.primary.light },
|
|
@@ -1408,61 +1435,61 @@ const d = {
|
|
|
1408
1435
|
// Accent colors on navy background
|
|
1409
1436
|
coralOnNavy: { text: d.secondary.main, bg: d.primary.main },
|
|
1410
1437
|
azureOnNavy: { text: d.secondary.light, bg: d.primary.main }
|
|
1411
|
-
}, V =
|
|
1438
|
+
}, V = v("light"), j = v("dark");
|
|
1412
1439
|
function N() {
|
|
1413
|
-
const a = C().palette.mode,
|
|
1414
|
-
return
|
|
1415
|
-
tokens:
|
|
1440
|
+
const a = C().palette.mode, o = a === "dark";
|
|
1441
|
+
return R(() => ({
|
|
1442
|
+
tokens: p,
|
|
1416
1443
|
base: y,
|
|
1417
1444
|
semantic: m,
|
|
1418
|
-
component:
|
|
1419
|
-
darkMode:
|
|
1445
|
+
component: w,
|
|
1446
|
+
darkMode: f,
|
|
1420
1447
|
mode: a,
|
|
1421
|
-
isDarkMode:
|
|
1422
|
-
getColor: (l, b) =>
|
|
1448
|
+
isDarkMode: o,
|
|
1449
|
+
getColor: (l, b) => o && b ? b : l,
|
|
1423
1450
|
getSemanticColor: (l, b) => {
|
|
1424
|
-
const
|
|
1425
|
-
if (
|
|
1426
|
-
const
|
|
1427
|
-
if (
|
|
1451
|
+
const h = m.colors[l]?.[b];
|
|
1452
|
+
if (o) {
|
|
1453
|
+
const x = f.colors[l]?.[b];
|
|
1454
|
+
if (x) return x;
|
|
1428
1455
|
}
|
|
1429
|
-
return typeof
|
|
1456
|
+
return typeof h == "string" ? h : "";
|
|
1430
1457
|
},
|
|
1431
1458
|
spacing: (l) => y.spacing[l],
|
|
1432
1459
|
spacingCss: (l) => `${y.spacing[l]}px`,
|
|
1433
1460
|
radius: (l) => y.borderRadius[l],
|
|
1434
1461
|
shadow: (l) => y.shadows[l]
|
|
1435
|
-
}), [
|
|
1462
|
+
}), [o, a]);
|
|
1436
1463
|
}
|
|
1437
1464
|
export {
|
|
1438
|
-
|
|
1439
|
-
|
|
1465
|
+
E as accessibleCombinations,
|
|
1466
|
+
X as attentionHierarchy,
|
|
1440
1467
|
y as baseTokens,
|
|
1441
1468
|
d as brandColors,
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1469
|
+
w as componentTokens,
|
|
1470
|
+
Z as contrastHierarchy,
|
|
1471
|
+
v as createTrinityTheme,
|
|
1472
|
+
F as createTrinityThemePreset,
|
|
1473
|
+
f as darkModeTokens,
|
|
1447
1474
|
j as darkTheme,
|
|
1448
|
-
|
|
1475
|
+
q as elevationHierarchy,
|
|
1449
1476
|
z as generateCssVariables,
|
|
1450
1477
|
$ as generateDarkModeCssVariables,
|
|
1451
|
-
|
|
1478
|
+
J as getAttentionColor,
|
|
1452
1479
|
W as getContrastRatio,
|
|
1453
|
-
|
|
1454
|
-
|
|
1480
|
+
K as getElevation,
|
|
1481
|
+
Q as getHierarchySpacing,
|
|
1455
1482
|
Y as getTypography,
|
|
1456
1483
|
_ as hierarchy,
|
|
1457
|
-
|
|
1458
|
-
|
|
1484
|
+
D as injectDarkModeCssVariables,
|
|
1485
|
+
P as injectTrinityCssVariables,
|
|
1459
1486
|
k as interactiveHierarchy,
|
|
1460
1487
|
V as lightTheme,
|
|
1461
1488
|
S as scaleHierarchy,
|
|
1462
1489
|
m as semanticTokens,
|
|
1463
1490
|
rr as spacingHierarchy,
|
|
1464
|
-
|
|
1465
|
-
|
|
1491
|
+
p as tokens,
|
|
1492
|
+
i as typographicHierarchy,
|
|
1466
1493
|
N as useTrinityTokens,
|
|
1467
|
-
|
|
1494
|
+
L as validateAccessibility
|
|
1468
1495
|
};
|
package/dist/trinity.css
CHANGED
|
@@ -359,8 +359,7 @@
|
|
|
359
359
|
--trinity-radius-button: 9999px;
|
|
360
360
|
--trinity-radius-input: 6px;
|
|
361
361
|
--trinity-radius-card: 12px;
|
|
362
|
-
--trinity-radius-modal:
|
|
363
|
-
--trinity-radius-modal-large: 16px;
|
|
362
|
+
--trinity-radius-modal: 16px;
|
|
364
363
|
--trinity-radius-badge: 6px;
|
|
365
364
|
--trinity-radius-avatar: 9999px;
|
|
366
365
|
--trinity-radius-chip: 6px;
|
|
@@ -556,6 +555,16 @@
|
|
|
556
555
|
--trinity-dense-badge: 0.625rem;
|
|
557
556
|
--trinity-dense-text: 0.75rem;
|
|
558
557
|
|
|
558
|
+
/* ============================================
|
|
559
|
+
ICON SIZES - SEMANTIC (Intent-Based)
|
|
560
|
+
============================================ */
|
|
561
|
+
--trinity-icon-size-inline: 14px;
|
|
562
|
+
--trinity-icon-size-control: 16px;
|
|
563
|
+
--trinity-icon-size-navigation: 20px;
|
|
564
|
+
--trinity-icon-size-prominent: 24px;
|
|
565
|
+
--trinity-icon-size-hero: 28px;
|
|
566
|
+
--trinity-icon-size-display: 36px;
|
|
567
|
+
|
|
559
568
|
/* ============================================
|
|
560
569
|
TYPOGRAPHY - DATA STYLES
|
|
561
570
|
============================================ */
|