@burdenoff/fe-libs 2026.1116.5 → 2026.1116.7
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/chrome/AppShellLayout.js +1 -0
- package/dist/tag/TagBadge.d.ts +10 -1
- package/dist/tag/TagBadge.js +32 -25
- package/dist/tag/TagsWidget.d.ts +8 -1
- package/dist/tag/TagsWidget.js +39 -37
- package/dist/tag/index.d.ts +2 -1
- package/dist/tag/tagColor.d.ts +17 -0
- package/dist/tag/tagColor.js +20 -4
- package/dist/tag/tagPalette.d.ts +59 -0
- package/dist/tag/tagPalette.js +74 -0
- package/dist/tag/tagsWidget/TagBadgeList.d.ts +3 -1
- package/dist/tag/tagsWidget/TagBadgeList.js +3 -2
- package/dist/tag/tagsWidget/TagSearchPopover.d.ts +4 -1
- package/dist/tag/tagsWidget/TagSearchPopover.js +41 -33
- package/dist/tag.js +4 -3
- package/package.json +1 -1
- package/src/shared/tokens/depth.css +191 -122
|
@@ -39,6 +39,7 @@ var o = ({ header: o, sidebar: s, footer: c, bottomPanel: l, rightPanel: u, stat
|
|
|
39
39
|
style: N,
|
|
40
40
|
"data-shell-scroll-container": !0,
|
|
41
41
|
children: v ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("div", {
|
|
42
|
+
"data-shell-content": "",
|
|
42
43
|
className: m ? "flex-1" : "flex-1 min-h-0",
|
|
43
44
|
children: f
|
|
44
45
|
}), m && c] }) : f
|
package/dist/tag/TagBadge.d.ts
CHANGED
|
@@ -9,8 +9,17 @@ export interface TagBadgeProps {
|
|
|
9
9
|
onRemove?: () => void;
|
|
10
10
|
className?: string;
|
|
11
11
|
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
/**
|
|
13
|
+
* How the tag colour is shown (BOFF-15056).
|
|
14
|
+
* - `text` (default): the label is drawn in the tag colour, on a tint.
|
|
15
|
+
* - `dot`: the label stays in the normal text colour, with a dot and a tint
|
|
16
|
+
* in the tag colour. Tag colours are picked to read as a mark, not as
|
|
17
|
+
* text, so this is the readable choice; it is opt-in so other products'
|
|
18
|
+
* badges look as they did.
|
|
19
|
+
*/
|
|
20
|
+
appearance?: 'text' | 'dot';
|
|
12
21
|
}
|
|
13
22
|
/**
|
|
14
23
|
* A badge component for displaying a tag with optional icon, color, and remove button
|
|
15
24
|
*/
|
|
16
|
-
export declare function TagBadge({ label, icon, color, description, removable, onClick, onRemove, className, size, }: TagBadgeProps): import('react').JSX.Element;
|
|
25
|
+
export declare function TagBadge({ label, icon, color, description, removable, onClick, onRemove, className, size, appearance, }: TagBadgeProps): import('react').JSX.Element;
|
package/dist/tag/TagBadge.js
CHANGED
|
@@ -1,47 +1,54 @@
|
|
|
1
1
|
import { cn as e } from "../shared-utils.js";
|
|
2
2
|
import { Badge as t } from "../ui/badge.js";
|
|
3
3
|
import { Tooltip as n, TooltipContent as r, TooltipProvider as i, TooltipTrigger as a } from "../ui/tooltip.js";
|
|
4
|
-
import { tagColorStyle as o } from "./tagColor.js";
|
|
5
|
-
import { X as
|
|
6
|
-
import { jsx as
|
|
4
|
+
import { tagColorStyle as o, tagDotStyle as s, tagTintStyle as c } from "./tagColor.js";
|
|
5
|
+
import { X as l } from "lucide-react";
|
|
6
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
7
|
// src/tag/TagBadge.tsx
|
|
8
|
-
var
|
|
8
|
+
var f = {
|
|
9
9
|
sm: "text-xs px-1.5 py-0.5",
|
|
10
10
|
md: "text-sm px-2 py-0.5",
|
|
11
11
|
lg: "text-base px-2.5 py-1"
|
|
12
12
|
};
|
|
13
|
-
function
|
|
14
|
-
let
|
|
13
|
+
function p({ label: p, icon: m, color: h, description: g, removable: _ = !1, onClick: v, onRemove: y, className: b, size: x = "md", appearance: S = "text" }) {
|
|
14
|
+
let C = (e) => {
|
|
15
|
+
e.stopPropagation(), y?.();
|
|
16
|
+
}, w = S === "dot", T = h ? w ? c(h) : o(h) : void 0, E = /* @__PURE__ */ d(t, {
|
|
15
17
|
variant: "secondary",
|
|
16
|
-
className: e("inline-flex items-center gap-1 font-medium transition-colors",
|
|
17
|
-
style:
|
|
18
|
-
|
|
18
|
+
className: e("inline-flex items-center gap-1 font-medium transition-colors", f[x], w && "text-text-primary", v && "cursor-pointer hover:bg-secondary/80", b),
|
|
19
|
+
style: T,
|
|
20
|
+
"data-appearance": w ? "dot" : void 0,
|
|
21
|
+
onClick: v,
|
|
19
22
|
children: [
|
|
20
|
-
|
|
23
|
+
w && h && /* @__PURE__ */ u("span", {
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
"data-tag-dot": "",
|
|
26
|
+
className: "size-2 flex-shrink-0 rounded-full",
|
|
27
|
+
style: s(h)
|
|
28
|
+
}),
|
|
29
|
+
m && /* @__PURE__ */ u("span", {
|
|
21
30
|
className: "flex-shrink-0",
|
|
22
|
-
children:
|
|
31
|
+
children: m
|
|
23
32
|
}),
|
|
24
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ u("span", {
|
|
25
34
|
className: "truncate max-w-[150px]",
|
|
26
|
-
children:
|
|
35
|
+
children: p
|
|
27
36
|
}),
|
|
28
|
-
|
|
37
|
+
_ && y && /* @__PURE__ */ u("button", {
|
|
29
38
|
type: "button",
|
|
30
|
-
onClick:
|
|
31
|
-
e.stopPropagation(), _?.();
|
|
32
|
-
},
|
|
39
|
+
onClick: C,
|
|
33
40
|
className: "flex-shrink-0 ms-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10 transition-colors",
|
|
34
|
-
"aria-label": `Remove ${
|
|
35
|
-
children: /* @__PURE__ */
|
|
41
|
+
"aria-label": `Remove ${p}`,
|
|
42
|
+
children: /* @__PURE__ */ u(l, { className: "size-3" })
|
|
36
43
|
})
|
|
37
44
|
]
|
|
38
45
|
});
|
|
39
|
-
return
|
|
46
|
+
return g ? /* @__PURE__ */ u(i, { children: /* @__PURE__ */ d(n, { children: [/* @__PURE__ */ u(a, {
|
|
40
47
|
asChild: !0,
|
|
41
|
-
children:
|
|
42
|
-
}), /* @__PURE__ */
|
|
48
|
+
children: E
|
|
49
|
+
}), /* @__PURE__ */ u(r, { children: /* @__PURE__ */ u("p", {
|
|
43
50
|
className: "max-w-xs",
|
|
44
|
-
children:
|
|
45
|
-
}) })] }) }) :
|
|
51
|
+
children: g
|
|
52
|
+
}) })] }) }) : E;
|
|
46
53
|
}
|
|
47
|
-
export {
|
|
54
|
+
export { p as TagBadge };
|
package/dist/tag/TagsWidget.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TagBadgeProps } from './TagBadge';
|
|
1
2
|
export interface TagItem {
|
|
2
3
|
id: string;
|
|
3
4
|
key: string;
|
|
@@ -54,6 +55,12 @@ export interface TagsWidgetProps {
|
|
|
54
55
|
syncGraphNotifications?: boolean;
|
|
55
56
|
maxTags?: number;
|
|
56
57
|
className?: string;
|
|
58
|
+
/**
|
|
59
|
+
* How the badges and search results show a tag's colour. Default `text`
|
|
60
|
+
* (the label in the tag colour); `dot` keeps the label in the normal text
|
|
61
|
+
* colour with a colour dot and tint (BOFF-15056).
|
|
62
|
+
*/
|
|
63
|
+
appearance?: TagBadgeProps['appearance'];
|
|
57
64
|
}
|
|
58
65
|
/**
|
|
59
66
|
* TagsWidget - compact, embeddable tag input (controlled).
|
|
@@ -99,4 +106,4 @@ export interface TagsWidgetProps {
|
|
|
99
106
|
* }
|
|
100
107
|
* ```
|
|
101
108
|
*/
|
|
102
|
-
export declare function TagsWidget({ entityType, entityId, workspaceId, tags, onAdd, onRemove, vocabularyId: vocabIdProp, allowCreate, syncGraphNotifications, maxTags, className, }: TagsWidgetProps): import('react').JSX.Element | null;
|
|
109
|
+
export declare function TagsWidget({ entityType, entityId, workspaceId, tags, onAdd, onRemove, vocabularyId: vocabIdProp, allowCreate, syncGraphNotifications, maxTags, className, appearance, }: TagsWidgetProps): import('react').JSX.Element | null;
|
package/dist/tag/TagsWidget.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { cn as e } from "../shared-utils.js";
|
|
2
2
|
import { useGatewayClient as t } from "../shared/graphql/GatewayContext.js";
|
|
3
3
|
import { Popover as n, PopoverContent as r, PopoverTrigger as i } from "../ui/popover.js";
|
|
4
|
-
import { CREATE_TAG as
|
|
5
|
-
import { useVocabResolver as
|
|
6
|
-
import { TagBadgeList as
|
|
7
|
-
import { AddTagTrigger as
|
|
4
|
+
import { CREATE_TAG as a, NOTIFY_TAG_ASSIGNED as o, NOTIFY_TAG_REMOVED as ee, SEARCH_TAGS as s } from "./tagsWidget/operations.js";
|
|
5
|
+
import { useVocabResolver as c } from "./tagsWidget/useVocabResolver.js";
|
|
6
|
+
import { TagBadgeList as l } from "./tagsWidget/TagBadgeList.js";
|
|
7
|
+
import { AddTagTrigger as te } from "./tagsWidget/AddTagTrigger.js";
|
|
8
8
|
import { TagSearchPopover as u } from "./tagsWidget/TagSearchPopover.js";
|
|
9
9
|
import { useCallback as d, useEffect as f, useRef as p, useState as m } from "react";
|
|
10
10
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
|
-
import { useLazyQuery as
|
|
11
|
+
import { useLazyQuery as ne, useMutation as _ } from "@apollo/client/react";
|
|
12
12
|
// src/tag/TagsWidget.tsx
|
|
13
|
-
function
|
|
14
|
-
let [A, j] = m(!1), [M, N] = m(""), [P, F] = m(null), [I, L] = m(!1), R = p(null), z = t("workspace"), { resolvedVocabId: B, resolveVocabId: V } =
|
|
13
|
+
function v({ entityType: v, entityId: y, workspaceId: b, tags: x, onAdd: S, onRemove: C, vocabularyId: w, allowCreate: T = !0, syncGraphNotifications: E = !0, maxTags: D = 20, className: O, appearance: k }) {
|
|
14
|
+
let [A, j] = m(!1), [M, N] = m(""), [P, F] = m(null), [I, L] = m(!1), R = p(null), z = t("workspace"), { resolvedVocabId: B, resolveVocabId: V } = c(z, w), H = !b || !y, U = new Set(x.map((e) => e.id)), W = x.length < D, [G, { data: K, loading: q }] = ne(s, { client: z }), J = (K?.searchTags ?? []).filter((e) => !U.has(e.id)), [Y, { loading: X }] = _(a, { client: z }), [Z] = _(o, { client: z }), [Q] = _(ee, { client: z }), re = d((e) => {
|
|
15
15
|
N(e), P && F(null), R.current && clearTimeout(R.current), e.trim() && (R.current = setTimeout(() => {
|
|
16
16
|
G({ variables: {
|
|
17
17
|
query: e,
|
|
@@ -31,13 +31,13 @@ function y({ entityType: y, entityId: b, workspaceId: x, tags: S, onAdd: C, onRe
|
|
|
31
31
|
if (W && !I) {
|
|
32
32
|
L(!0);
|
|
33
33
|
try {
|
|
34
|
-
await
|
|
34
|
+
await S({
|
|
35
35
|
...e,
|
|
36
36
|
vocabularyKey: e.vocabularyKey ?? e.vocabulary?.key ?? null
|
|
37
|
-
}), N(""), j(!1),
|
|
37
|
+
}), N(""), j(!1), E && Z({ variables: { input: {
|
|
38
38
|
key: e.key,
|
|
39
|
-
entityType:
|
|
40
|
-
entityId:
|
|
39
|
+
entityType: v,
|
|
40
|
+
entityId: y,
|
|
41
41
|
source: "MANUAL"
|
|
42
42
|
} } });
|
|
43
43
|
} finally {
|
|
@@ -46,14 +46,14 @@ function y({ entityType: y, entityId: b, workspaceId: x, tags: S, onAdd: C, onRe
|
|
|
46
46
|
}
|
|
47
47
|
}, [
|
|
48
48
|
Z,
|
|
49
|
-
|
|
49
|
+
S,
|
|
50
|
+
v,
|
|
50
51
|
y,
|
|
51
|
-
b,
|
|
52
52
|
W,
|
|
53
53
|
I,
|
|
54
|
-
|
|
55
|
-
]),
|
|
56
|
-
if (
|
|
54
|
+
E
|
|
55
|
+
]), ie = d(async () => {
|
|
56
|
+
if (T && M.trim() && !X) {
|
|
57
57
|
F(null);
|
|
58
58
|
try {
|
|
59
59
|
let e = M.trim(), t = e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
@@ -73,40 +73,41 @@ function y({ entityType: y, entityId: b, workspaceId: x, tags: S, onAdd: C, onRe
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}, [
|
|
76
|
-
|
|
76
|
+
T,
|
|
77
77
|
M,
|
|
78
78
|
X,
|
|
79
79
|
V,
|
|
80
80
|
Y,
|
|
81
81
|
$
|
|
82
|
-
]),
|
|
83
|
-
let t =
|
|
84
|
-
await
|
|
82
|
+
]), ae = d(async (e) => {
|
|
83
|
+
let t = x.find((t) => t.id === e);
|
|
84
|
+
await C(e), t && E && Q({ variables: {
|
|
85
85
|
key: t.key,
|
|
86
|
-
entityType:
|
|
87
|
-
entityId:
|
|
86
|
+
entityType: v,
|
|
87
|
+
entityId: y
|
|
88
88
|
} });
|
|
89
89
|
}, [
|
|
90
90
|
Q,
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
C,
|
|
92
|
+
x,
|
|
93
|
+
v,
|
|
93
94
|
y,
|
|
94
|
-
|
|
95
|
-
D
|
|
95
|
+
E
|
|
96
96
|
]);
|
|
97
97
|
if (H) return null;
|
|
98
|
-
let
|
|
98
|
+
let oe = !!(T && M.trim() && !q && J.length === 0);
|
|
99
99
|
return /* @__PURE__ */ g("div", {
|
|
100
|
-
className: e("flex flex-wrap items-center gap-1.5",
|
|
101
|
-
children: [/* @__PURE__ */ h(
|
|
102
|
-
tags:
|
|
103
|
-
onRemove: (e) => void
|
|
100
|
+
className: e("flex flex-wrap items-center gap-1.5", O),
|
|
101
|
+
children: [/* @__PURE__ */ h(l, {
|
|
102
|
+
tags: x,
|
|
103
|
+
onRemove: (e) => void ae(e),
|
|
104
|
+
appearance: k
|
|
104
105
|
}), W && /* @__PURE__ */ g(n, {
|
|
105
106
|
open: A,
|
|
106
107
|
onOpenChange: j,
|
|
107
108
|
children: [/* @__PURE__ */ h(i, {
|
|
108
109
|
asChild: !0,
|
|
109
|
-
children: /* @__PURE__ */ h(
|
|
110
|
+
children: /* @__PURE__ */ h(te, { hasTags: x.length > 0 })
|
|
110
111
|
}), /* @__PURE__ */ h(r, {
|
|
111
112
|
className: "w-64 p-0",
|
|
112
113
|
align: "start",
|
|
@@ -114,20 +115,21 @@ function y({ entityType: y, entityId: b, workspaceId: x, tags: S, onAdd: C, onRe
|
|
|
114
115
|
sideOffset: 4,
|
|
115
116
|
children: /* @__PURE__ */ h(u, {
|
|
116
117
|
search: M,
|
|
117
|
-
onSearchChange:
|
|
118
|
+
onSearchChange: re,
|
|
118
119
|
searching: q,
|
|
119
120
|
searchResults: J,
|
|
120
121
|
adding: I,
|
|
121
122
|
creating: X,
|
|
122
|
-
showCreateOption:
|
|
123
|
+
showCreateOption: oe,
|
|
123
124
|
createError: P,
|
|
124
125
|
canAddMore: W,
|
|
125
|
-
maxTags:
|
|
126
|
+
maxTags: D,
|
|
126
127
|
onAssign: (e) => void $(e),
|
|
127
|
-
onCreate: () => void
|
|
128
|
+
onCreate: () => void ie(),
|
|
129
|
+
appearance: k
|
|
128
130
|
})
|
|
129
131
|
})]
|
|
130
132
|
})]
|
|
131
133
|
});
|
|
132
134
|
}
|
|
133
|
-
export {
|
|
135
|
+
export { v as TagsWidget };
|
package/dist/tag/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { TagBadge, type TagBadgeProps } from './TagBadge';
|
|
2
|
-
export { tagColorStyle } from './tagColor';
|
|
2
|
+
export { tagColorStyle, tagDotStyle, tagTintStyle } from './tagColor';
|
|
3
|
+
export { LEGACY_CHART_TAG_COLORS, TAG_COLOR_PALETTE, isLegacyTagColor, legacyTagColorToHex, normalizeTagColor, tagPaletteColor, type TagPaletteColor, type TagPaletteColorId, } from './tagPalette';
|
|
3
4
|
export { TagsWidget, type TagsWidgetProps, type TagItem } from './TagsWidget';
|
package/dist/tag/tagColor.d.ts
CHANGED
|
@@ -8,5 +8,22 @@ import { CSSProperties } from 'react';
|
|
|
8
8
|
* appended a hex alpha (`${color}20`), which only works for six-digit hex. A
|
|
9
9
|
* stored `var(--color-chart-N)` became `var(--color-chart-N)20`, invalid CSS
|
|
10
10
|
* the browser drops, so the tint and border vanished (BOFF-11867).
|
|
11
|
+
*
|
|
12
|
+
* Painting the label in the tag colour fails text contrast for most colours.
|
|
13
|
+
* New surfaces should use {@link tagTintStyle} with a label in the normal text
|
|
14
|
+
* colour (TagBadge `appearance="dot"`); this style stays for existing callers.
|
|
11
15
|
*/
|
|
12
16
|
export declare function tagColorStyle(color: string): CSSProperties;
|
|
17
|
+
/**
|
|
18
|
+
* Inline style for a tag tint only: a light background and a stronger border
|
|
19
|
+
* in the tag colour, leaving the text colour to the caller (use the normal
|
|
20
|
+
* text colour, `text-text-primary`). A legacy `var(--color-chart-N)` colour is
|
|
21
|
+
* painted as its tag palette hex (BOFF-15056), so it looks the same in light
|
|
22
|
+
* and dark mode and matches what the tag form saves.
|
|
23
|
+
*/
|
|
24
|
+
export declare function tagTintStyle(color: string): CSSProperties;
|
|
25
|
+
/**
|
|
26
|
+
* Inline style for a solid tag-colour dot shown beside a tag label. Like
|
|
27
|
+
* {@link tagTintStyle}, a legacy chart token is painted as its palette hex.
|
|
28
|
+
*/
|
|
29
|
+
export declare function tagDotStyle(color: string): CSSProperties;
|
package/dist/tag/tagColor.js
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { normalizeTagColor as e } from "./tagPalette.js";
|
|
2
|
+
// src/tag/tagColor.ts
|
|
3
|
+
var t = 12, n = 25;
|
|
4
|
+
function r(e, t) {
|
|
5
|
+
return `color-mix(in srgb, ${e} ${t}%, transparent)`;
|
|
6
|
+
}
|
|
7
|
+
function i(e) {
|
|
2
8
|
return {
|
|
3
|
-
backgroundColor:
|
|
9
|
+
backgroundColor: r(e, t),
|
|
4
10
|
color: e,
|
|
5
|
-
borderColor:
|
|
11
|
+
borderColor: r(e, n)
|
|
6
12
|
};
|
|
7
13
|
}
|
|
8
|
-
|
|
14
|
+
function a(i) {
|
|
15
|
+
let a = e(i);
|
|
16
|
+
return {
|
|
17
|
+
backgroundColor: r(a, t),
|
|
18
|
+
borderColor: r(a, n)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function o(t) {
|
|
22
|
+
return { backgroundColor: e(t) };
|
|
23
|
+
}
|
|
24
|
+
export { i as tagColorStyle, o as tagDotStyle, a as tagTintStyle };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tag colour palette (BOFF-15056).
|
|
3
|
+
*
|
|
4
|
+
* ★ These hex values are DATA, not UI styling. A tag's colour is stored in the
|
|
5
|
+
* database and read back by everything that shows a tag: the web apps, but
|
|
6
|
+
* also exports, the SDKs, the MCP tools, the API, emails and native code.
|
|
7
|
+
* Outside our web pages a design token such as `var(--color-chart-3)` is not a
|
|
8
|
+
* colour at all, so a stored tag colour must be a plain hex. UI code still
|
|
9
|
+
* styles itself with semantic tokens; it only paints a tag with the hex the
|
|
10
|
+
* tag carries. This file is exempt from the raw-colour lint guard for that
|
|
11
|
+
* reason (eslint.config.js), and is the only place the palette is written down.
|
|
12
|
+
*
|
|
13
|
+
* One value per colour, the same in light and dark mode. Every colour has a
|
|
14
|
+
* relative luminance of about 0.21, the point where a mid-tone reaches 3:1 or
|
|
15
|
+
* more against both the light surfaces (`--color-bg-*` in `:root`) and the
|
|
16
|
+
* dark ones (`:root.dark` and the forest, ocean, sunset and high-contrast
|
|
17
|
+
* themes). That is the WCAG 1.4.11 level for a non-text mark, which is how a
|
|
18
|
+
* tag colour is meant to be shown: as a dot or a tint beside a label drawn in
|
|
19
|
+
* the normal text colour, never as the label's own colour. tagPalette.test.ts
|
|
20
|
+
* reads the real token values and fails if any pair drops under 3:1.
|
|
21
|
+
*/
|
|
22
|
+
/** The stable id of a palette colour. */
|
|
23
|
+
export type TagPaletteColorId = 'red' | 'orange' | 'amber' | 'green' | 'teal' | 'blue' | 'violet' | 'pink';
|
|
24
|
+
export interface TagPaletteColor {
|
|
25
|
+
/** Stable id, safe to use as a React key or a test id. */
|
|
26
|
+
readonly id: TagPaletteColorId;
|
|
27
|
+
/** English name, for tools and docs. UI shows its own translated label. */
|
|
28
|
+
readonly name: string;
|
|
29
|
+
/** The value a tag stores: `#RRGGBB`, upper case. */
|
|
30
|
+
readonly hex: string;
|
|
31
|
+
}
|
|
32
|
+
/** The eight tag colours, in hue order. Pickers show them in this order. */
|
|
33
|
+
export declare const TAG_COLOR_PALETTE: ReadonlyArray<TagPaletteColor>;
|
|
34
|
+
/**
|
|
35
|
+
* The palette colour that replaces each legacy chart token.
|
|
36
|
+
*
|
|
37
|
+
* The FluidGrids tag form stored `var(--color-chart-1)` … `var(--color-chart-8)`
|
|
38
|
+
* before this palette existed. Each chart token maps to the palette colour
|
|
39
|
+
* nearest to it, measured as the OKLab distance from the token's light value
|
|
40
|
+
* plus the distance from its dark value (the test recomputes this from
|
|
41
|
+
* semantic.css). Chart tokens 1 and 6, 2 and 7, and 3 and 8 are the same hue
|
|
42
|
+
* family and swapped shades between themes, so each pair lands on one colour.
|
|
43
|
+
* Tokens 9–12 were never offered as swatches but could be typed by hand.
|
|
44
|
+
*/
|
|
45
|
+
export declare const LEGACY_CHART_TAG_COLORS: Readonly<Record<number, TagPaletteColorId>>;
|
|
46
|
+
/** The palette colour with this id. */
|
|
47
|
+
export declare function tagPaletteColor(id: TagPaletteColorId): TagPaletteColor;
|
|
48
|
+
/**
|
|
49
|
+
* The palette hex for a legacy `var(--color-chart-N)` tag colour, or `null`
|
|
50
|
+
* when the value is anything else.
|
|
51
|
+
*/
|
|
52
|
+
export declare function legacyTagColorToHex(color: string): string | null;
|
|
53
|
+
/** True when a tag colour is a legacy chart token this module can convert. */
|
|
54
|
+
export declare function isLegacyTagColor(color: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The colour to store or paint for a tag: a legacy chart token becomes its
|
|
57
|
+
* palette hex; every other value comes back trimmed and otherwise unchanged.
|
|
58
|
+
*/
|
|
59
|
+
export declare function normalizeTagColor(color: string): string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/tag/tagPalette.ts
|
|
2
|
+
var e = [
|
|
3
|
+
{
|
|
4
|
+
id: "red",
|
|
5
|
+
name: "Red",
|
|
6
|
+
hex: "#E64142"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
id: "orange",
|
|
10
|
+
name: "Orange",
|
|
11
|
+
hex: "#CC5F00"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: "amber",
|
|
15
|
+
name: "Amber",
|
|
16
|
+
hex: "#AB7302"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "green",
|
|
20
|
+
name: "Green",
|
|
21
|
+
hex: "#269142"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "teal",
|
|
25
|
+
name: "Teal",
|
|
26
|
+
hex: "#038E88"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "blue",
|
|
30
|
+
name: "Blue",
|
|
31
|
+
hex: "#227EE6"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "violet",
|
|
35
|
+
name: "Violet",
|
|
36
|
+
hex: "#8E66E5"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "pink",
|
|
40
|
+
name: "Pink",
|
|
41
|
+
hex: "#DE3F8D"
|
|
42
|
+
}
|
|
43
|
+
], t = {
|
|
44
|
+
1: "blue",
|
|
45
|
+
2: "green",
|
|
46
|
+
3: "violet",
|
|
47
|
+
4: "amber",
|
|
48
|
+
5: "red",
|
|
49
|
+
6: "blue",
|
|
50
|
+
7: "green",
|
|
51
|
+
8: "violet",
|
|
52
|
+
9: "amber",
|
|
53
|
+
10: "red",
|
|
54
|
+
11: "green",
|
|
55
|
+
12: "blue"
|
|
56
|
+
}, n = /^var\(\s*--color-chart-(\d+)\s*\)$/i;
|
|
57
|
+
function r(t) {
|
|
58
|
+
let n = e.find((e) => e.id === t);
|
|
59
|
+
if (!n) throw Error(`Unknown tag palette colour: ${t}`);
|
|
60
|
+
return n;
|
|
61
|
+
}
|
|
62
|
+
function i(e) {
|
|
63
|
+
let i = n.exec(e.trim());
|
|
64
|
+
if (!i) return null;
|
|
65
|
+
let a = t[Number(i[1])];
|
|
66
|
+
return a ? r(a).hex : null;
|
|
67
|
+
}
|
|
68
|
+
function a(e) {
|
|
69
|
+
return i(e) !== null;
|
|
70
|
+
}
|
|
71
|
+
function o(e) {
|
|
72
|
+
return i(e) ?? e.trim();
|
|
73
|
+
}
|
|
74
|
+
export { t as LEGACY_CHART_TAG_COLORS, e as TAG_COLOR_PALETTE, a as isLegacyTagColor, i as legacyTagColorToHex, o as normalizeTagColor, r as tagPaletteColor };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { TagBadgeProps } from '../TagBadge';
|
|
1
2
|
import { TagItem } from '../TagsWidget';
|
|
2
3
|
export interface TagBadgeListProps {
|
|
3
4
|
tags: TagItem[];
|
|
4
5
|
onRemove: (tagId: string) => void;
|
|
6
|
+
appearance?: TagBadgeProps['appearance'];
|
|
5
7
|
}
|
|
6
|
-
export declare function TagBadgeList({ tags, onRemove }: TagBadgeListProps): import('react').JSX.Element;
|
|
8
|
+
export declare function TagBadgeList({ tags, onRemove, appearance }: TagBadgeListProps): import('react').JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TagBadge as e } from "../TagBadge.js";
|
|
2
2
|
import { Fragment as t, jsx as n } from "react/jsx-runtime";
|
|
3
3
|
// src/tag/tagsWidget/TagBadgeList.tsx
|
|
4
|
-
function r({ tags: r, onRemove: i }) {
|
|
4
|
+
function r({ tags: r, onRemove: i, appearance: a }) {
|
|
5
5
|
return /* @__PURE__ */ n(t, { children: r.map((t) => /* @__PURE__ */ n(e, {
|
|
6
6
|
id: t.id,
|
|
7
7
|
label: t.label,
|
|
@@ -10,7 +10,8 @@ function r({ tags: r, onRemove: i }) {
|
|
|
10
10
|
description: t.description ?? void 0,
|
|
11
11
|
removable: !0,
|
|
12
12
|
onRemove: () => i(t.id),
|
|
13
|
-
size: "sm"
|
|
13
|
+
size: "sm",
|
|
14
|
+
appearance: a
|
|
14
15
|
}, t.id)) });
|
|
15
16
|
}
|
|
16
17
|
export { r as TagBadgeList };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TagBadgeProps } from '../TagBadge';
|
|
1
2
|
import { TagItem } from '../TagsWidget';
|
|
2
3
|
export interface TagSearchPopoverProps {
|
|
3
4
|
search: string;
|
|
@@ -12,5 +13,7 @@ export interface TagSearchPopoverProps {
|
|
|
12
13
|
maxTags: number;
|
|
13
14
|
onAssign: (tag: TagItem) => void;
|
|
14
15
|
onCreate: () => void;
|
|
16
|
+
/** How a result shows its colour; matches the badges' `appearance`. */
|
|
17
|
+
appearance?: TagBadgeProps['appearance'];
|
|
15
18
|
}
|
|
16
|
-
export declare function TagSearchPopover({ search, onSearchChange, searching, searchResults, adding, creating, showCreateOption, createError, canAddMore, maxTags, onAssign, onCreate, }: TagSearchPopoverProps): import('react').JSX.Element;
|
|
19
|
+
export declare function TagSearchPopover({ search, onSearchChange, searching, searchResults, adding, creating, showCreateOption, createError, canAddMore, maxTags, onAssign, onCreate, appearance, }: TagSearchPopoverProps): import('react').JSX.Element;
|
|
@@ -1,79 +1,87 @@
|
|
|
1
1
|
import { Command as e, CommandEmpty as t, CommandGroup as n, CommandInput as r, CommandItem as i, CommandList as a } from "../../ui/command.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { tagDotStyle as o } from "../tagColor.js";
|
|
3
|
+
import { Loader2 as s, Plus as c, Search as l, X as u } from "lucide-react";
|
|
4
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
4
5
|
// src/tag/tagsWidget/TagSearchPopover.tsx
|
|
5
|
-
function
|
|
6
|
-
|
|
6
|
+
function p({ search: p, onSearchChange: m, searching: h, searchResults: g, adding: _, creating: v, showCreateOption: y, createError: b, canAddMore: x, maxTags: S, onAssign: C, onCreate: w, appearance: T = "text" }) {
|
|
7
|
+
let E = T === "dot";
|
|
8
|
+
return /* @__PURE__ */ f(e, {
|
|
7
9
|
shouldFilter: !1,
|
|
8
10
|
children: [
|
|
9
|
-
/* @__PURE__ */
|
|
11
|
+
/* @__PURE__ */ f("div", {
|
|
10
12
|
className: "flex items-center border-b border-border px-3",
|
|
11
13
|
children: [
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
+
/* @__PURE__ */ d(l, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
15
|
+
/* @__PURE__ */ d(r, {
|
|
14
16
|
placeholder: "Search or create a tag...",
|
|
15
|
-
value:
|
|
16
|
-
onValueChange:
|
|
17
|
+
value: p,
|
|
18
|
+
onValueChange: m,
|
|
17
19
|
className: "h-9 flex-1 border-0 bg-transparent px-2 text-sm outline-none placeholder:text-muted-foreground"
|
|
18
20
|
}),
|
|
19
|
-
|
|
21
|
+
h && /* @__PURE__ */ d(s, { className: "size-3.5 shrink-0 animate-spin text-muted-foreground" })
|
|
20
22
|
]
|
|
21
23
|
}),
|
|
22
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ f(a, {
|
|
23
25
|
className: "max-h-48 overflow-y-auto",
|
|
24
26
|
children: [
|
|
25
|
-
|
|
27
|
+
p.trim() === "" && /* @__PURE__ */ d(t, {
|
|
26
28
|
className: "py-4 text-center text-xs text-muted-foreground",
|
|
27
29
|
children: "Type to search or create a tag"
|
|
28
30
|
}),
|
|
29
|
-
|
|
31
|
+
g.length > 0 && /* @__PURE__ */ d(n, { children: g.map((e) => /* @__PURE__ */ f(i, {
|
|
30
32
|
value: e.id,
|
|
31
|
-
onSelect: () =>
|
|
33
|
+
onSelect: () => C(e),
|
|
32
34
|
className: "flex items-center gap-2 px-3 py-2 cursor-pointer",
|
|
33
|
-
disabled:
|
|
35
|
+
disabled: _,
|
|
34
36
|
children: [
|
|
35
|
-
e.
|
|
37
|
+
E && e.color && /* @__PURE__ */ d("span", {
|
|
38
|
+
"aria-hidden": "true",
|
|
39
|
+
"data-tag-dot": "",
|
|
40
|
+
className: "size-2 shrink-0 rounded-full",
|
|
41
|
+
style: o(e.color)
|
|
42
|
+
}),
|
|
43
|
+
e.icon && /* @__PURE__ */ d("span", {
|
|
36
44
|
className: "text-sm",
|
|
37
45
|
children: e.icon
|
|
38
46
|
}),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
className: "truncate text-sm",
|
|
41
|
-
style: e.color ? { color: e.color } : void 0,
|
|
47
|
+
/* @__PURE__ */ d("span", {
|
|
48
|
+
className: E ? "truncate text-sm text-text-primary" : "truncate text-sm",
|
|
49
|
+
style: !E && e.color ? { color: e.color } : void 0,
|
|
42
50
|
children: e.label
|
|
43
51
|
}),
|
|
44
|
-
|
|
52
|
+
_ && /* @__PURE__ */ d(s, { className: "ms-auto size-3 animate-spin" })
|
|
45
53
|
]
|
|
46
54
|
}, e.id)) }),
|
|
47
|
-
|
|
48
|
-
value: `__create__${
|
|
49
|
-
onSelect:
|
|
55
|
+
y && /* @__PURE__ */ d(n, { children: /* @__PURE__ */ f(i, {
|
|
56
|
+
value: `__create__${p}`,
|
|
57
|
+
onSelect: w,
|
|
50
58
|
className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-primary",
|
|
51
|
-
disabled:
|
|
52
|
-
children: [
|
|
59
|
+
disabled: v,
|
|
60
|
+
children: [v ? /* @__PURE__ */ d(s, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ d(c, { className: "size-3.5" }), /* @__PURE__ */ d("span", {
|
|
53
61
|
className: "text-sm truncate",
|
|
54
|
-
children:
|
|
62
|
+
children: v ? "Creating..." : `Create "${p}"`
|
|
55
63
|
})]
|
|
56
64
|
}) }),
|
|
57
|
-
|
|
65
|
+
p.trim() !== "" && !h && g.length === 0 && !y && /* @__PURE__ */ d(t, {
|
|
58
66
|
className: "py-4 text-center text-xs text-muted-foreground",
|
|
59
67
|
children: "No tags found"
|
|
60
68
|
}),
|
|
61
|
-
|
|
69
|
+
b && /* @__PURE__ */ d("div", {
|
|
62
70
|
className: "px-3 py-2 text-xs text-destructive border-t border-border",
|
|
63
|
-
children:
|
|
71
|
+
children: b
|
|
64
72
|
})
|
|
65
73
|
]
|
|
66
74
|
}),
|
|
67
|
-
!
|
|
75
|
+
!x && /* @__PURE__ */ f("div", {
|
|
68
76
|
className: "border-t border-border px-3 py-2 text-xs text-muted-foreground flex items-center gap-1",
|
|
69
77
|
children: [
|
|
70
|
-
/* @__PURE__ */ u
|
|
78
|
+
/* @__PURE__ */ d(u, { className: "size-3" }),
|
|
71
79
|
"Maximum ",
|
|
72
|
-
|
|
80
|
+
S,
|
|
73
81
|
" tags reached"
|
|
74
82
|
]
|
|
75
83
|
})
|
|
76
84
|
]
|
|
77
85
|
});
|
|
78
86
|
}
|
|
79
|
-
export {
|
|
87
|
+
export { p as TagSearchPopover };
|
package/dist/tag.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TagBadge as e } from "./tag/TagBadge.js";
|
|
2
|
-
import { tagColorStyle as t } from "./tag/tagColor.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { tagColorStyle as t, tagDotStyle as n, tagTintStyle as r } from "./tag/tagColor.js";
|
|
3
|
+
import { LEGACY_CHART_TAG_COLORS as i, TAG_COLOR_PALETTE as a, isLegacyTagColor as o, legacyTagColorToHex as s, normalizeTagColor as c, tagPaletteColor as l } from "./tag/tagPalette.js";
|
|
4
|
+
import { TagsWidget as u } from "./tag/TagsWidget.js";
|
|
5
|
+
export { i as LEGACY_CHART_TAG_COLORS, a as TAG_COLOR_PALETTE, e as TagBadge, u as TagsWidget, o as isLegacyTagColor, s as legacyTagColorToHex, c as normalizeTagColor, t as tagColorStyle, n as tagDotStyle, l as tagPaletteColor, r as tagTintStyle };
|
package/package.json
CHANGED
|
@@ -24,9 +24,16 @@
|
|
|
24
24
|
* [data-depth="off"] on any element: its subtree keeps today's look.
|
|
25
25
|
* Page rules key on the box, `[data-shell-page][data-page-width]:not([data-page-width='tool'])`;
|
|
26
26
|
* the rise-in on `[data-shell-page][data-page-enter]:not([data-page-width='tool'])`; the glow on
|
|
27
|
-
* the shell's scroll container that holds such a box
|
|
28
|
-
*
|
|
29
|
-
* [data-shell-
|
|
27
|
+
* the shell's scroll container that holds such a box, found along the shell's fixed path:
|
|
28
|
+
* <main data-shell-scroll-container> AppShellLayout's scroll container
|
|
29
|
+
* > [data-shell-content] its content wrapper (the host passes footerInContent)
|
|
30
|
+
* > [data-swipe-root] the host's swipe root
|
|
31
|
+
* > [data-shell-page] the page box
|
|
32
|
+
* > :first-child on a desktop page, the host's sticky wrapper
|
|
33
|
+
* > [data-shell-topbar] and ShellTopBar in it
|
|
34
|
+
* The sidebar's rules key on [data-shell-sidebar] and apply on every page. fe-libs provides
|
|
35
|
+
* the rest: [data-shell-scroll-container] on AppShellLayout's <main> and [data-shell-content]
|
|
36
|
+
* on its content wrapper, [data-shell-topbar] on ShellTopBar,
|
|
30
37
|
* [data-shell-sidebar], [data-active] and [data-shell-active-bar] in the sidebar, the data-slot
|
|
31
38
|
* hooks on the primitives (Card, GlassCard, IconTile, Table, Tabs, Button, Input, Badge, ...),
|
|
32
39
|
* and <html dir> from the I18nProvider for the mirrored rules.
|
|
@@ -50,6 +57,22 @@
|
|
|
50
57
|
* without data-reduce-motion; every lift also needs (hover: hover).
|
|
51
58
|
* - Every rule that uses :has() sits inside @supports selector(:has(*)): a browser without
|
|
52
59
|
* :has() skips only those rules, and the build cannot merge them into the others.
|
|
60
|
+
* - A :has() argument never holds `*` or :not(), and every :has() on the shell keys on
|
|
61
|
+
* attributes only. Chrome decides per inserted element whether a :has() could see it: one
|
|
62
|
+
* with `*` or :not() in its argument sees every element, and then each insertion anywhere
|
|
63
|
+
* costs time that grows with the page (about 1.7 ms on a 20,000-element page in the
|
|
64
|
+
* browser run, against 0.02 ms without the layer); a type in it sees every element of that
|
|
65
|
+
* type, so no :has() argument names a type that pages insert all the time (div, p, span,
|
|
66
|
+
* li, tr, ...). The glow
|
|
67
|
+
* once asked <main> about any descendant through such an argument, and every insertion,
|
|
68
|
+
* class or text change re-scanned all of <main> (600 recalcs over 20,000 elements:
|
|
69
|
+
* 1137-1161 ms against 182-377 ms without the layer).
|
|
70
|
+
* - Every :has() argument starts with a child combinator and uses no other, so it looks a
|
|
71
|
+
* fixed number of levels down, except the two card checks ("holds a table", and a
|
|
72
|
+
* hand-drawn card's "holds a table or a field"), which name only attributes and rare
|
|
73
|
+
* types. A change inside such a card re-checks it, at a cost that grows with the card
|
|
74
|
+
* (written as `> * > ...` steps they measured four to seven times slower).
|
|
75
|
+
* depthLayer.test.ts pins all of this; the browser run measures it.
|
|
53
76
|
* - A selector breaks across lines only where it already has a descendant combinator.
|
|
54
77
|
* - The strengths below are the most each theme allows while every text token that reads at
|
|
55
78
|
* 4.5:1 today keeps 4.5:1, and every icon and bar that reads at 3:1 keeps 3:1, on what the
|
|
@@ -117,15 +140,28 @@
|
|
|
117
140
|
* away with the page and adds no scroll height however short <main> is. <main> stays
|
|
118
141
|
* unpositioned: no element changes containing block. The pseudo-elements are positioned
|
|
119
142
|
* only to take a z-index; they hold nothing. The two ellipses never overlap, so the
|
|
120
|
-
* strongest tint anywhere is one accent at its mesh share.
|
|
143
|
+
* strongest tint anywhere is one accent at its mesh share. <main> finds its page box three
|
|
144
|
+
* levels down along the shell's fixed path (the host contract above), by attributes only;
|
|
145
|
+
* the tool tier and an opted-out box are left out by a second :has() of the same kind,
|
|
146
|
+
* outside the first (a :not() inside it would see every inserted element). */
|
|
121
147
|
@supports selector(:has(*)) {
|
|
122
148
|
:root[data-depth='rich']:not([data-theme='high-contrast'])
|
|
123
149
|
[data-shell-scroll-container]:has(
|
|
124
|
-
[data-shell-
|
|
150
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page][data-page-width]
|
|
151
|
+
):not(
|
|
152
|
+
:has(
|
|
153
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page]:is([data-page-width='tool'], [data-depth='off']),
|
|
154
|
+
> [data-shell-content] > [data-swipe-root][data-depth='off'], > [data-shell-content][data-depth='off']
|
|
155
|
+
)
|
|
125
156
|
):not(:where([data-depth='off'], [data-depth='off'] *))::before,
|
|
126
157
|
:root[data-depth='rich']:not([data-theme='high-contrast'])
|
|
127
158
|
[data-shell-scroll-container]:has(
|
|
128
|
-
[data-shell-
|
|
159
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page][data-page-width]
|
|
160
|
+
):not(
|
|
161
|
+
:has(
|
|
162
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page]:is([data-page-width='tool'], [data-depth='off']),
|
|
163
|
+
> [data-shell-content] > [data-swipe-root][data-depth='off'], > [data-shell-content][data-depth='off']
|
|
164
|
+
)
|
|
129
165
|
):not(:where([data-depth='off'], [data-depth='off'] *))::after {
|
|
130
166
|
content: '';
|
|
131
167
|
display: block;
|
|
@@ -141,39 +177,70 @@
|
|
|
141
177
|
}
|
|
142
178
|
:root[data-depth='rich']:not([data-theme='high-contrast'])
|
|
143
179
|
[data-shell-scroll-container]:has(
|
|
144
|
-
[data-shell-
|
|
180
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page][data-page-width]
|
|
181
|
+
):not(
|
|
182
|
+
:has(
|
|
183
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page]:is([data-page-width='tool'], [data-depth='off']),
|
|
184
|
+
> [data-shell-content] > [data-swipe-root][data-depth='off'], > [data-shell-content][data-depth='off']
|
|
185
|
+
)
|
|
145
186
|
):not(:where([data-depth='off'], [data-depth='off'] *))::before {
|
|
146
187
|
border-image-source: radial-gradient(46% 100% at 18% 0%, color-mix(in oklab, var(--color-accent-glow) var(--depth-mesh-a), transparent), transparent 72%);
|
|
147
188
|
}
|
|
148
189
|
:root[data-depth='rich']:not([data-theme='high-contrast'])
|
|
149
190
|
[data-shell-scroll-container]:has(
|
|
150
|
-
[data-shell-
|
|
191
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page][data-page-width]
|
|
192
|
+
):not(
|
|
193
|
+
:has(
|
|
194
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page]:is([data-page-width='tool'], [data-depth='off']),
|
|
195
|
+
> [data-shell-content] > [data-swipe-root][data-depth='off'], > [data-shell-content][data-depth='off']
|
|
196
|
+
)
|
|
151
197
|
):not(:where([data-depth='off'], [data-depth='off'] *))::after {
|
|
152
198
|
order: -1;
|
|
153
199
|
border-image-source: radial-gradient(40% 92% at 82% 0%, color-mix(in oklab, var(--color-accent-glow-alt) var(--depth-mesh-b), transparent), transparent 74%);
|
|
154
200
|
}
|
|
155
201
|
:root[data-depth='rich']:not([data-theme='high-contrast'])[dir='rtl']
|
|
156
202
|
[data-shell-scroll-container]:has(
|
|
157
|
-
[data-shell-
|
|
203
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page][data-page-width]
|
|
204
|
+
):not(
|
|
205
|
+
:has(
|
|
206
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page]:is([data-page-width='tool'], [data-depth='off']),
|
|
207
|
+
> [data-shell-content] > [data-swipe-root][data-depth='off'], > [data-shell-content][data-depth='off']
|
|
208
|
+
)
|
|
158
209
|
):not(:where([data-depth='off'], [data-depth='off'] *))::before {
|
|
159
210
|
border-image-source: radial-gradient(46% 100% at 82% 0%, color-mix(in oklab, var(--color-accent-glow) var(--depth-mesh-a), transparent), transparent 72%);
|
|
160
211
|
}
|
|
161
212
|
:root[data-depth='rich']:not([data-theme='high-contrast'])[dir='rtl']
|
|
162
213
|
[data-shell-scroll-container]:has(
|
|
163
|
-
[data-shell-
|
|
214
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page][data-page-width]
|
|
215
|
+
):not(
|
|
216
|
+
:has(
|
|
217
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page]:is([data-page-width='tool'], [data-depth='off']),
|
|
218
|
+
> [data-shell-content] > [data-swipe-root][data-depth='off'], > [data-shell-content][data-depth='off']
|
|
219
|
+
)
|
|
164
220
|
):not(:where([data-depth='off'], [data-depth='off'] *))::after {
|
|
165
221
|
border-image-source: radial-gradient(40% 92% at 18% 0%, color-mix(in oklab, var(--color-accent-glow-alt) var(--depth-mesh-b), transparent), transparent 74%);
|
|
166
222
|
}
|
|
167
|
-
/* No top bar in the
|
|
168
|
-
*
|
|
223
|
+
/* No top bar in the swipe root's first child (phones put theirs above <main>, and a
|
|
224
|
+
* page without a bar starts with its box): start the glow above <main>, where it is
|
|
225
|
+
* clipped, so the page sees what it sees below a desktop bar. */
|
|
169
226
|
:root[data-depth='rich']:not([data-theme='high-contrast'])
|
|
170
227
|
[data-shell-scroll-container]:has(
|
|
171
|
-
[data-shell-
|
|
172
|
-
):not(
|
|
228
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page][data-page-width]
|
|
229
|
+
):not(
|
|
230
|
+
:has(
|
|
231
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page]:is([data-page-width='tool'], [data-depth='off']),
|
|
232
|
+
> [data-shell-content] > [data-swipe-root][data-depth='off'], > [data-shell-content][data-depth='off']
|
|
233
|
+
)
|
|
234
|
+
):not(:has(> [data-shell-content] > [data-swipe-root] > :first-child > [data-shell-topbar])):not(:where([data-depth='off'], [data-depth='off'] *))::before,
|
|
173
235
|
:root[data-depth='rich']:not([data-theme='high-contrast'])
|
|
174
236
|
[data-shell-scroll-container]:has(
|
|
175
|
-
[data-shell-
|
|
176
|
-
):not(
|
|
237
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page][data-page-width]
|
|
238
|
+
):not(
|
|
239
|
+
:has(
|
|
240
|
+
> [data-shell-content] > [data-swipe-root] > [data-shell-page]:is([data-page-width='tool'], [data-depth='off']),
|
|
241
|
+
> [data-shell-content] > [data-swipe-root][data-depth='off'], > [data-shell-content][data-depth='off']
|
|
242
|
+
)
|
|
243
|
+
):not(:has(> [data-shell-content] > [data-swipe-root] > :first-child > [data-shell-topbar])):not(:where([data-depth='off'], [data-depth='off'] *))::after {
|
|
177
244
|
border-image-outset: var(--depth-glow-under-bar) 0 calc(var(--depth-glow-height) - var(--depth-glow-under-bar)) 0;
|
|
178
245
|
}
|
|
179
246
|
}
|
|
@@ -276,9 +343,11 @@
|
|
|
276
343
|
}
|
|
277
344
|
/* Hand-drawn cards in module code (no hook yet, so class tokens; a follow-up gives each a
|
|
278
345
|
* hook): exact tokens only, inside the page box. Never a filter bar (a search, a toolbar or
|
|
279
|
-
* any field inside
|
|
280
|
-
*
|
|
281
|
-
*
|
|
346
|
+
* any field inside: a combobox, a select, a textarea, or an input you can type in, which is
|
|
347
|
+
* :read-write; a checkbox, radio, button or hidden input is not), a table's wrapper, a
|
|
348
|
+
* sticky bar or anything inside one, a positioned popover, a status panel, or anything that
|
|
349
|
+
* is or sits in a menu, listbox, dialog, tooltip or popper. The edge light and the sheen;
|
|
350
|
+
* never a border colour or a lift. */
|
|
282
351
|
@supports selector(:has(*)) {
|
|
283
352
|
:root[data-depth='rich']:not([data-theme='high-contrast'])
|
|
284
353
|
[data-shell-page][data-page-width]:not([data-page-width='tool'])
|
|
@@ -294,8 +363,7 @@
|
|
|
294
363
|
):not(
|
|
295
364
|
:has(
|
|
296
365
|
table, [role='table'], [role='grid'], [role='treegrid'], [role='search'], [role='searchbox'],
|
|
297
|
-
[role='combobox'], select, textarea,
|
|
298
|
-
input:not([type='checkbox'], [type='radio'], [type='hidden'], [type='button'], [type='submit'], [type='reset'])
|
|
366
|
+
[role='combobox'], select, textarea, input:read-write
|
|
299
367
|
)
|
|
300
368
|
):not(
|
|
301
369
|
:where(
|
|
@@ -318,8 +386,7 @@
|
|
|
318
386
|
):not(
|
|
319
387
|
:has(
|
|
320
388
|
table, [role='table'], [role='grid'], [role='treegrid'], [role='search'], [role='searchbox'],
|
|
321
|
-
[role='combobox'], select, textarea,
|
|
322
|
-
input:not([type='checkbox'], [type='radio'], [type='hidden'], [type='button'], [type='submit'], [type='reset'])
|
|
389
|
+
[role='combobox'], select, textarea, input:read-write
|
|
323
390
|
)
|
|
324
391
|
):not(
|
|
325
392
|
:where(
|
|
@@ -342,8 +409,7 @@
|
|
|
342
409
|
):not(
|
|
343
410
|
:has(
|
|
344
411
|
table, [role='table'], [role='grid'], [role='treegrid'], [role='search'], [role='searchbox'],
|
|
345
|
-
[role='combobox'], select, textarea,
|
|
346
|
-
input:not([type='checkbox'], [type='radio'], [type='hidden'], [type='button'], [type='submit'], [type='reset'])
|
|
412
|
+
[role='combobox'], select, textarea, input:read-write
|
|
347
413
|
)
|
|
348
414
|
):not(
|
|
349
415
|
:where(
|
|
@@ -375,31 +441,33 @@
|
|
|
375
441
|
0 18px 40px -22px color-mix(in oklab, var(--color-accent-glow) 60%, transparent),
|
|
376
442
|
var(--shadow-pop);
|
|
377
443
|
}
|
|
378
|
-
/* Hand-drawn clickable cards:
|
|
379
|
-
*
|
|
380
|
-
*
|
|
444
|
+
/* Hand-drawn clickable cards: an element that is clickable itself (a link, a button, a
|
|
445
|
+
* button or link role, or data-interactive) with the card tokens. No look at its body:
|
|
446
|
+
* a :has() on the children named div and p, and Chrome re-checked it for every div or p
|
|
447
|
+
* inserted anywhere (about 1.9 ms each on a 20,000-element page), so a card with no body
|
|
448
|
+
* lifts too. A disabled one (:disabled, aria-disabled) never does: it is not available.
|
|
449
|
+
* Chips, page numbers, toggles and pickers that share the tokens are skipped by their ARIA
|
|
450
|
+
* state. A <div onClick> leaves no trace in the DOM: give it a role, or move it
|
|
381
451
|
* to Card or GlassCard, which set data-interactive. */
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
var(--shadow-pop);
|
|
402
|
-
}
|
|
452
|
+
:root[data-depth='rich']:not([data-theme='high-contrast'])
|
|
453
|
+
[data-shell-page][data-page-width]:not([data-page-width='tool'])
|
|
454
|
+
:is(a[href], button, [role='button'], [role='link'], [data-interactive])[class~='border']:is(
|
|
455
|
+
[class~='rounded-lg'], [class~='rounded-xl'], [class~='rounded-2xl'], [class~='rounded-card']
|
|
456
|
+
):is([class~='bg-bg-surface'], [class~='bg-bg-elevated'], [class~='bg-surface'], [class~='bg-card']):not(
|
|
457
|
+
[data-slot], :disabled, [aria-disabled='true'], [aria-pressed], [aria-selected],
|
|
458
|
+
[aria-current], [role='tab'], [role='radio'], [role='option'], [role='combobox'],
|
|
459
|
+
[role='menuitem'], [class*='status-'], [class~='ring-2'], [class*='sticky'], :focus-visible
|
|
460
|
+
):not(
|
|
461
|
+
:where(
|
|
462
|
+
[class*='sticky'] *, [role='menu'] *, [role='menubar'] *, [role='listbox'] *, [role='dialog'] *,
|
|
463
|
+
[role='alertdialog'] *, [role='tooltip'] *, [popover] *, [data-radix-popper-content-wrapper] *
|
|
464
|
+
)
|
|
465
|
+
):hover:not(:where([data-depth='off'], [data-depth='off'] *)) {
|
|
466
|
+
border-color: color-mix(in oklab, var(--color-accent-glow) 45%, transparent);
|
|
467
|
+
box-shadow:
|
|
468
|
+
0 0 0 1px color-mix(in oklab, var(--color-accent-glow) 30%, transparent),
|
|
469
|
+
0 18px 40px -22px color-mix(in oklab, var(--color-accent-glow) 60%, transparent),
|
|
470
|
+
var(--shadow-pop);
|
|
403
471
|
}
|
|
404
472
|
}
|
|
405
473
|
|
|
@@ -469,12 +537,13 @@
|
|
|
469
537
|
}
|
|
470
538
|
|
|
471
539
|
/* ---------- D3: tables ----------
|
|
472
|
-
* An accent wash on the header and on the row under the pointer (background
|
|
473
|
-
* row's own hover fill and the selected tint stay underneath), and an accent
|
|
474
|
-
* hovered row's start edge. In the light theme, muted text there reads in the
|
|
475
|
-
* token and a link in its hover token: muted (#6B7280) is 4.63:1 on the canvas
|
|
476
|
-
* a hovered fe-libs row today, a link 4.70:1 on that row, so the approved
|
|
477
|
-
* them under 4.5:1 (secondary and the link's hover token keep 6:1 or
|
|
540
|
+
* An accent wash on the header and on the cells of the row under the pointer (background
|
|
541
|
+
* images, so a row's own hover fill and the selected tint stay underneath), and an accent
|
|
542
|
+
* bar on the hovered row's start edge. In the light theme, muted text there reads in the
|
|
543
|
+
* secondary token and a link in its hover token: muted (#6B7280) is 4.63:1 on the canvas
|
|
544
|
+
* and 4.39:1 on a hovered fe-libs row today, a link 4.70:1 on that row, so the approved
|
|
545
|
+
* washes would take them under 4.5:1 (secondary and the link's hover token keep 6:1 or
|
|
546
|
+
* more).
|
|
478
547
|
* The remap covers the aliases that resolve at :root and so never follow a remapped
|
|
479
548
|
* --color-text-muted: text-muted-foreground (semantic.css, app-shell.css and the app's
|
|
480
549
|
* @theme) and text-content-muted / -tertiary (app-shell.css). The header's remap sits on the
|
|
@@ -504,57 +573,58 @@
|
|
|
504
573
|
--color-text-link: var(--color-text-linkHover);
|
|
505
574
|
}
|
|
506
575
|
@media (hover: hover) {
|
|
507
|
-
/*
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
)
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
576
|
+
/* The wash paints on the hovered row's cells (the row's own hover fill and the selected
|
|
577
|
+
* tint stay underneath them), and the bar on its first cell, except a full-width colspan
|
|
578
|
+
* cell (an expanded detail, "No variables yet"): that row is not a row to pick. Keyed on
|
|
579
|
+
* the cells, not on the row with a :has(): a :has() that names td made Chrome re-check it
|
|
580
|
+
* for every row inserted anywhere (about 3.7 ms a row on a 20,000-element page). */
|
|
581
|
+
:root[data-depth='rich']:not([data-theme='high-contrast'])
|
|
582
|
+
[data-shell-page][data-page-width]:not([data-page-width='tool'])
|
|
583
|
+
:is([data-slot='table'], table):not(
|
|
584
|
+
.prose table, [data-slot='glass-card']:is([data-treatment='metric'], [data-treatment='glass']) table
|
|
585
|
+
)
|
|
586
|
+
> :is([data-slot='table-body'], tbody)
|
|
587
|
+
> tr:hover:not([data-state='selected'], [aria-selected='true'])
|
|
588
|
+
> :not(td[colspan]:only-child):not(:where([data-depth='off'], [data-depth='off'] *)) {
|
|
589
|
+
background-image: linear-gradient(
|
|
590
|
+
color-mix(in oklab, var(--color-accent-glow) var(--depth-row-wash), transparent),
|
|
591
|
+
color-mix(in oklab, var(--color-accent-glow) var(--depth-row-wash), transparent)
|
|
592
|
+
);
|
|
593
|
+
}
|
|
594
|
+
/* The light remap sits on the row itself, so a colour class on the <tr> reads it too (a
|
|
595
|
+
* colspan row's muted text reads the secondary token as well: more contrast, no wash). */
|
|
596
|
+
:root[data-depth='rich']:not([data-theme='high-contrast']):not(.dark)
|
|
597
|
+
[data-shell-page][data-page-width]:not([data-page-width='tool'])
|
|
598
|
+
:is([data-slot='table'], table):not(
|
|
599
|
+
.prose table, [data-slot='glass-card']:is([data-treatment='metric'], [data-treatment='glass']) table
|
|
600
|
+
)
|
|
601
|
+
> :is([data-slot='table-body'], tbody)
|
|
602
|
+
> tr:hover:not([data-state='selected'], [aria-selected='true']):not(:where([data-depth='off'], [data-depth='off'] *)) {
|
|
603
|
+
--color-text-muted: var(--color-text-secondary);
|
|
604
|
+
--color-muted-foreground: var(--color-text-secondary);
|
|
605
|
+
--color-content-muted: var(--color-text-secondary);
|
|
606
|
+
--color-content-tertiary: var(--color-text-secondary);
|
|
607
|
+
--color-text-link: var(--color-text-linkHover);
|
|
608
|
+
}
|
|
609
|
+
:root[data-depth='rich']:not([data-theme='high-contrast'])
|
|
610
|
+
[data-shell-page][data-page-width]:not([data-page-width='tool'])
|
|
611
|
+
:is([data-slot='table'], table):not(
|
|
612
|
+
.prose table, [data-slot='glass-card']:is([data-treatment='metric'], [data-treatment='glass']) table
|
|
613
|
+
)
|
|
614
|
+
> :is([data-slot='table-body'], tbody)
|
|
615
|
+
> tr:hover:not([data-state='selected'], [aria-selected='true'])
|
|
616
|
+
> :first-child:not(td[colspan]:only-child):not(:where([data-depth='off'], [data-depth='off'] *)) {
|
|
617
|
+
box-shadow: inset 3px 0 0 var(--color-accent-glow);
|
|
618
|
+
}
|
|
619
|
+
:root[data-depth='rich']:not([data-theme='high-contrast'])[dir='rtl']
|
|
620
|
+
[data-shell-page][data-page-width]:not([data-page-width='tool'])
|
|
621
|
+
:is([data-slot='table'], table):not(
|
|
622
|
+
.prose table, [data-slot='glass-card']:is([data-treatment='metric'], [data-treatment='glass']) table
|
|
623
|
+
)
|
|
624
|
+
> :is([data-slot='table-body'], tbody)
|
|
625
|
+
> tr:hover:not([data-state='selected'], [aria-selected='true'])
|
|
626
|
+
> :first-child:not(td[colspan]:only-child):not(:where([data-depth='off'], [data-depth='off'] *)) {
|
|
627
|
+
box-shadow: inset -3px 0 0 var(--color-accent-glow);
|
|
558
628
|
}
|
|
559
629
|
}
|
|
560
630
|
|
|
@@ -737,22 +807,21 @@
|
|
|
737
807
|
):hover:not([data-glow], [class*='status-']):not(:where([data-depth='off'], [data-depth='off'] *)) {
|
|
738
808
|
translate: 0 var(--depth-lift);
|
|
739
809
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
}
|
|
810
|
+
:root[data-depth='rich']:not([data-theme='high-contrast']):not([data-reduce-motion])
|
|
811
|
+
[data-shell-page][data-page-width]:not([data-page-width='tool'])
|
|
812
|
+
:is(a[href], button, [role='button'], [role='link'], [data-interactive])[class~='border']:is(
|
|
813
|
+
[class~='rounded-lg'], [class~='rounded-xl'], [class~='rounded-2xl'], [class~='rounded-card']
|
|
814
|
+
):is([class~='bg-bg-surface'], [class~='bg-bg-elevated'], [class~='bg-surface'], [class~='bg-card']):not(
|
|
815
|
+
[data-slot], :disabled, [aria-disabled='true'], [aria-pressed], [aria-selected],
|
|
816
|
+
[aria-current], [role='tab'], [role='radio'], [role='option'], [role='combobox'],
|
|
817
|
+
[role='menuitem'], [class*='status-'], [class*='sticky']
|
|
818
|
+
):not(
|
|
819
|
+
:where(
|
|
820
|
+
[class*='sticky'] *, [role='menu'] *, [role='menubar'] *, [role='listbox'] *, [role='dialog'] *,
|
|
821
|
+
[role='alertdialog'] *, [role='tooltip'] *, [popover] *, [data-radix-popper-content-wrapper] *
|
|
822
|
+
)
|
|
823
|
+
):hover:not(:where([data-depth='off'], [data-depth='off'] *)) {
|
|
824
|
+
translate: 0 var(--depth-lift);
|
|
756
825
|
}
|
|
757
826
|
}
|
|
758
827
|
}
|