@flamingo-stack/openframe-frontend-core 0.0.823 → 0.0.824
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-GP2Y3DBE.cjs → chunk-2IHGR57J.cjs} +6 -6
- package/dist/{chunk-QCRJVO6Y.cjs → chunk-2IWAHBCC.cjs} +1 -1
- package/dist/{chunk-U7CH53FT.cjs → chunk-2M4E2V25.cjs} +13 -13
- package/dist/{chunk-YMDSCI4E.cjs → chunk-5N26M6CK.cjs} +32 -32
- package/dist/{chunk-DEWT25QK.cjs → chunk-A3SR6HHX.cjs} +65 -72
- package/dist/{chunk-2U6MAM6D.cjs → chunk-B2VRNRTY.cjs} +63 -63
- package/dist/{chunk-XEIZL3I3.cjs → chunk-B7NSH7IK.cjs} +6 -6
- package/dist/{chunk-K7NGDYBG.cjs → chunk-C3RAE7RO.cjs} +136 -136
- package/dist/{chunk-Y7BTM2NC.cjs → chunk-EZTCN43H.cjs} +39 -39
- package/dist/{chunk-3JCDSZ6D.cjs → chunk-GXBIYPDM.cjs} +4 -4
- package/dist/{chunk-HWXFUI3R.cjs → chunk-HDOU3AXV.cjs} +30 -30
- package/dist/{chunk-KWS7YKCO.cjs → chunk-J5U3XHFJ.cjs} +13 -13
- package/dist/{chunk-TJFVIJPV.cjs → chunk-M7EBCYKN.cjs} +2 -2
- package/dist/{chunk-Y3MPERIZ.cjs → chunk-MROW2JWE.cjs} +3 -3
- package/dist/{chunk-GBILLSRM.cjs → chunk-QOOMUGF2.cjs} +4 -4
- package/dist/{chunk-AK7MYM25.cjs → chunk-SOSVC6HB.cjs} +3 -3
- package/dist/{chunk-2LT2WR4O.cjs → chunk-TQ7TUEK2.cjs} +37 -37
- package/dist/{chunk-DYSMAPSI.cjs → chunk-TTMTNG3U.cjs} +4 -4
- package/dist/{chunk-L7YE6APP.cjs → chunk-WMTV6M5B.cjs} +11 -11
- package/dist/{chunk-UUFL4FDS.cjs → chunk-WSBAIZXL.cjs} +14 -14
- package/dist/{chunk-SBXL5EKE.cjs → chunk-XUMZMIHR.cjs} +23 -23
- package/dist/{chunk-2YUWBIZM.cjs → chunk-Z7BLMJEI.cjs} +46 -46
- package/dist/{cloud-tenants-VQQ2KNJI.cjs → cloud-tenants-VYXMNISG.cjs} +6 -6
- package/dist/components/case-studies/index.cjs +20 -20
- package/dist/components/chat/embeddable-chat.d.ts +0 -2
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +1 -2
- package/dist/components/chat/entity-cards/blog-card.js +1 -1
- package/dist/components/chat/index.cjs +5 -5
- package/dist/components/chat/mingo-welcome.js +1 -1
- package/dist/components/contact/index.cjs +7 -7
- package/dist/components/docs/index.cjs +10 -10
- package/dist/components/embeds/index.cjs +7 -7
- package/dist/components/faq/index.cjs +8 -8
- package/dist/components/features/filters-dropdown.js +2 -2
- package/dist/components/features/index.cjs +6 -6
- package/dist/components/features/notifications/approval-request-notification-tile.js +1 -1
- package/dist/components/help-center-pages/index.cjs +80 -80
- package/dist/components/index.cjs +48 -48
- package/dist/components/loading/index.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +31 -31
- package/dist/components/navigation/index.cjs +9 -9
- package/dist/components/onboarding-guides/index.cjs +9 -9
- package/dist/components/product-demo/index.cjs +15 -15
- package/dist/components/related-content/index.cjs +4 -4
- package/dist/components/shared/article-author-byline.js +4 -4
- package/dist/components/tickets/index.cjs +11 -11
- package/dist/components/tickets/ticket-row.js +10 -17
- package/dist/components/ui/date-picker.js +1 -1
- package/dist/components/ui/index.cjs +6 -6
- package/dist/components/ui/markdown/base-components.js +1 -1
- package/dist/components/ui/markdown/engine.js +2 -2
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/sticky-action-bar.js +1 -1
- package/dist/{devices-KKJHYQ72.cjs → devices-NTYNZEGJ.cjs} +7 -7
- package/dist/{embeddable-chat-MQGYFYGX.cjs → embeddable-chat-JAUO4O2T.cjs} +68 -69
- package/dist/index.cjs +10 -10
- package/dist/{knowledge-VMLXNFDI.cjs → knowledge-I2LW27EP.cjs} +7 -7
- package/dist/loading-standard/engine.d.mts.map +1 -1
- package/dist/{logs-EFXRQ6LV.cjs → logs-KLZHXSOU.cjs} +14 -14
- package/dist/{policies-SU3NQPFV.cjs → policies-SMDAHDKL.cjs} +10 -10
- package/dist/{scripts-WLLAUOAA.cjs → scripts-OMBBPNTU.cjs} +11 -11
- package/dist/{software-update-WKUDBC3U.cjs → software-update-ZIJYNJIC.cjs} +9 -9
- package/eslint-config/README.md +21 -0
- package/eslint-config/base.js +12 -0
- package/eslint-config/dead-classes.js +256 -0
- package/package.json +2 -1
- package/src/components/chat/embeddable-chat.tsx +2 -7
- package/src/components/chat/entity-cards/blog-card.tsx +1 -1
- package/src/components/chat/mingo-welcome.tsx +1 -1
- package/src/components/features/filters-dropdown.tsx +2 -2
- package/src/components/features/notifications/approval-request-notification-tile.tsx +1 -1
- package/src/components/loading/index.ts +0 -5
- package/src/components/shared/article-author-byline.tsx +4 -4
- package/src/components/tickets/ticket-row.tsx +1 -4
- package/src/components/ui/date-picker.tsx +1 -1
- package/src/components/ui/markdown/base-components.tsx +1 -1
- package/src/components/ui/markdown/engine.tsx +4 -4
- package/src/components/ui/navigation-menu.tsx +1 -1
- package/src/components/ui/radio-group.tsx +1 -2
- package/src/components/ui/sticky-action-bar.tsx +1 -1
- package/src/loading-standard/engine.mjs +1 -2
- package/dist/components/loading/openmsp-heartbeat.d.ts +0 -7
- package/dist/components/loading/openmsp-heartbeat.d.ts.map +0 -1
- package/dist/components/loading/openmsp-heartbeat.js +0 -68
- package/src/components/loading/openmsp-heartbeat.tsx +0 -69
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A class that styles nothing is an error. See "Dead classes" in ./README.md.
|
|
3
|
+
*
|
|
4
|
+
* Tailwind writes no rule for a class it does not know, and says nothing about it: `bg-ods-background`
|
|
5
|
+
* (the token is `bg-ods-bg`), `text-body-sm`, `prose` (no typography plugin), `md:w-full!` (the
|
|
6
|
+
* `!` goes first) and `duration-[180ms]` (ambiguous beside tailwindcss-animate's own `duration-*`) all
|
|
7
|
+
* reached production that way, each one a style the author meant and no visitor ever got.
|
|
8
|
+
*
|
|
9
|
+
* The rule asks Tailwind itself, with the ODS preset (`../tailwind.config.ts`, the whole theme of every
|
|
10
|
+
* app that uses this config), whether it knows each class in a class string (`getClassOrder`, the
|
|
11
|
+
* lookup the official Prettier plugin sorts with). A class Tailwind does not know is still fine when a
|
|
12
|
+
* stylesheet defines it: this package's own (`../src/styles`) and the app's, named by the `css` option.
|
|
13
|
+
*
|
|
14
|
+
* Only class strings are read: a `className` / `class` attribute, the arguments of `cn`, `clsx`, `cva`,
|
|
15
|
+
* `twMerge`, `twJoin` and `classNames`, and a variable or property whose name ends in `class`,
|
|
16
|
+
* `className` or `classes`. Only a token shaped like a Tailwind utility is judged, so a hook class
|
|
17
|
+
* (`simple-markdown-renderer`) or a word in a cva key is never reported.
|
|
18
|
+
*
|
|
19
|
+
* Options: `{ css: ['app/globals.css'], allow: ['m-btn'] }`. `css` are files or directories relative to
|
|
20
|
+
* the working directory whose `.class` selectors count as defined; `allow` names classes defined
|
|
21
|
+
* somewhere a file cannot be read from (an email's inline `<style>`).
|
|
22
|
+
*/
|
|
23
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
24
|
+
import { createRequire } from 'node:module';
|
|
25
|
+
import { dirname, join, resolve } from 'node:path';
|
|
26
|
+
import { fileURLToPath } from 'node:url';
|
|
27
|
+
|
|
28
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
const PRESET = join(HERE, '..', 'tailwind.config.ts');
|
|
30
|
+
const OWN_CSS = join(HERE, '..', 'src', 'styles');
|
|
31
|
+
|
|
32
|
+
/** Calls whose string arguments are class lists. */
|
|
33
|
+
const CLASS_CALLS = new Set(['cn', 'clsx', 'cva', 'twMerge', 'twJoin', 'classNames', 'classnames']);
|
|
34
|
+
const CLASS_ATTRIBUTES = new Set(['className', 'class']);
|
|
35
|
+
const CLASS_BINDING =
|
|
36
|
+
/(?:^|_|[a-z])(?:[cC]lass(?:[nN]ame)?(?:es)?|CLASS(?:_?NAME)?(?:ES)?)$|^[a-z]\w*(?:Class|ClassName)$/;
|
|
37
|
+
|
|
38
|
+
/** The utility families Tailwind and the ODS preset generate. A token outside them is a hook, not a utility. */
|
|
39
|
+
const UTILITY =
|
|
40
|
+
/^(?:bg|text|border|ring|fill|stroke|shadow|outline|p[xytrbl]?|m[xytrbl]?|w|h|size|min-w|max-w|min-h|max-h|gap|space-[xy]|inset(?:-[xy])?|top|left|right|bottom|start|end|z|order|grid|col|row|flex|basis|grow|shrink|items|justify|content|self|place|font|leading|tracking|line-clamp|rounded|opacity|duration|ease|delay|transition|animate|translate-[xyz]|scale(?:-[xy])?|rotate|skew-[xy]|origin|cursor|select|overflow|overscroll|whitespace|break|truncate|list|decoration|underline|object|aspect|columns|divide|backdrop|blur|brightness|contrast|drop-shadow|grayscale|invert|saturate|sepia|filter|mix-blend|bg-blend|from|via|to|prose|align|appearance|accent|caret|scroll|snap|touch|will-change|visible|invisible|static|fixed|absolute|relative|sticky|block|inline|hidden|table|contents|float|clear|box|indent|hyphens|tabular)(?:-|$)/;
|
|
41
|
+
/** An arbitrary duration, easing or delay: tailwindcss-animate defines the same names, so Tailwind writes neither. */
|
|
42
|
+
const AMBIGUOUS = /^(?:duration|ease|delay)-\[/;
|
|
43
|
+
|
|
44
|
+
let tailwind;
|
|
45
|
+
/** One Tailwind context for the preset, built on first use and kept for the process. */
|
|
46
|
+
function knownClasses(classes) {
|
|
47
|
+
if (!tailwind) {
|
|
48
|
+
const requireTailwind = createRequire(join(process.cwd(), 'package.json'));
|
|
49
|
+
const fromHere = createRequire(import.meta.url);
|
|
50
|
+
const load = id => {
|
|
51
|
+
try {
|
|
52
|
+
return requireTailwind(id);
|
|
53
|
+
} catch {
|
|
54
|
+
return fromHere(id);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const loadConfig = load('tailwindcss/loadConfig');
|
|
58
|
+
const resolveConfig = load('tailwindcss/resolveConfig');
|
|
59
|
+
const { createContext } = load('tailwindcss/lib/lib/setupContextUtils');
|
|
60
|
+
const preset = loadConfig(PRESET);
|
|
61
|
+
tailwind = createContext(resolveConfig({ presets: [preset.default ?? preset], content: [] }));
|
|
62
|
+
}
|
|
63
|
+
// Tailwind prints its own "ambiguous class" warning to the console; this rule reports it instead.
|
|
64
|
+
const warn = console.warn;
|
|
65
|
+
console.warn = () => {};
|
|
66
|
+
try {
|
|
67
|
+
return new Map(tailwind.getClassOrder(classes));
|
|
68
|
+
} finally {
|
|
69
|
+
console.warn = warn;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const cssClasses = new Map();
|
|
74
|
+
/** The class names the `.class` selectors of the CSS files under `paths` define. */
|
|
75
|
+
function definedInCss(paths) {
|
|
76
|
+
const key = paths.join('\n');
|
|
77
|
+
if (!cssClasses.has(key)) {
|
|
78
|
+
const names = new Set();
|
|
79
|
+
const read = path => {
|
|
80
|
+
if (!existsSync(path)) return;
|
|
81
|
+
if (statSync(path).isDirectory()) {
|
|
82
|
+
for (const entry of readdirSync(path)) read(join(path, entry));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (!path.endsWith('.css')) return;
|
|
86
|
+
const text = readFileSync(path, 'utf8').replace(/\/\*[\s\S]*?\*\//g, '');
|
|
87
|
+
for (const match of text.matchAll(/\.(-?[_a-zA-Z][\w-]*(?:\\.[\w-]*)*)/g)) names.add(match[1].replace(/\\/g, ''));
|
|
88
|
+
};
|
|
89
|
+
for (const path of paths) read(path);
|
|
90
|
+
cssClasses.set(key, names);
|
|
91
|
+
}
|
|
92
|
+
return cssClasses.get(key);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** The utility a token applies, without its variants (`md:`, `[&_svg]:`), `!` and `-`. */
|
|
96
|
+
function utilityOf(token) {
|
|
97
|
+
let depth = 0;
|
|
98
|
+
let last = -1;
|
|
99
|
+
for (let i = 0; i < token.length; i++) {
|
|
100
|
+
const char = token[i];
|
|
101
|
+
if (char === '[') depth++;
|
|
102
|
+
else if (char === ']') depth--;
|
|
103
|
+
else if (char === ':' && depth === 0) last = i;
|
|
104
|
+
}
|
|
105
|
+
return token.slice(last + 1).replace(/^!?-?/, '');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Is this node where a class string is expected? */
|
|
109
|
+
function isClassContext(node) {
|
|
110
|
+
if (node.type === 'JSXAttribute') return CLASS_ATTRIBUTES.has(node.name?.name);
|
|
111
|
+
if (node.type === 'CallExpression') {
|
|
112
|
+
const callee = node.callee.type === 'MemberExpression' ? node.callee.property : node.callee;
|
|
113
|
+
return callee?.type === 'Identifier' && CLASS_CALLS.has(callee.name);
|
|
114
|
+
}
|
|
115
|
+
if (node.type === 'VariableDeclarator') return node.id.type === 'Identifier' && CLASS_BINDING.test(node.id.name);
|
|
116
|
+
if (node.type === 'AssignmentPattern') return node.left.type === 'Identifier' && CLASS_BINDING.test(node.left.name);
|
|
117
|
+
if (node.type === 'Property') {
|
|
118
|
+
const name = node.key?.type === 'Identifier' ? node.key.name : node.key?.value;
|
|
119
|
+
return typeof name === 'string' && CLASS_BINDING.test(name);
|
|
120
|
+
}
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** @type {import('eslint').Rule.RuleModule} */
|
|
125
|
+
const noDeadClass = {
|
|
126
|
+
meta: {
|
|
127
|
+
type: 'problem',
|
|
128
|
+
docs: { description: 'Disallow class names that no Tailwind utility and no stylesheet defines' },
|
|
129
|
+
schema: [
|
|
130
|
+
{
|
|
131
|
+
type: 'object',
|
|
132
|
+
properties: {
|
|
133
|
+
css: { type: 'array', items: { type: 'string' } },
|
|
134
|
+
allow: { type: 'array', items: { type: 'string' } },
|
|
135
|
+
},
|
|
136
|
+
additionalProperties: false,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
messages: {
|
|
140
|
+
dead:
|
|
141
|
+
'`{{token}}` styles nothing: Tailwind with the ODS preset has no utility by that name and no stylesheet ' +
|
|
142
|
+
'defines it, so it is dropped without a warning. Use an ODS token (src/ODS_TOKEN_RULES.md) or delete it.',
|
|
143
|
+
ambiguous:
|
|
144
|
+
'`{{token}}` styles nothing: tailwindcss-animate defines `{{family}}-*` too, so Tailwind writes neither ' +
|
|
145
|
+
'rule. Write the property itself: `[{{property}}:{{value}}]`.',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
create(context) {
|
|
149
|
+
const { css = [], allow = [] } = context.options[0] ?? {};
|
|
150
|
+
const allowed = new Set(allow);
|
|
151
|
+
const defined = definedInCss([OWN_CSS, ...css.map(path => resolve(process.cwd(), path))]);
|
|
152
|
+
|
|
153
|
+
const check = (node, text, { openStart, openEnd }) => {
|
|
154
|
+
const tokens = text.split(/\s+/);
|
|
155
|
+
if (openStart) tokens.shift();
|
|
156
|
+
if (openEnd) tokens.pop();
|
|
157
|
+
const candidates = tokens.filter(token => token && !allowed.has(token) && UTILITY.test(utilityOf(token)));
|
|
158
|
+
if (candidates.length === 0) return;
|
|
159
|
+
const known = knownClasses(candidates);
|
|
160
|
+
for (const token of candidates) {
|
|
161
|
+
if (known.get(token) !== null || defined.has(token) || defined.has(utilityOf(token))) continue;
|
|
162
|
+
const utility = utilityOf(token);
|
|
163
|
+
if (AMBIGUOUS.test(utility)) {
|
|
164
|
+
const family = utility.slice(0, utility.indexOf('-'));
|
|
165
|
+
const property = {
|
|
166
|
+
duration: 'transition-duration',
|
|
167
|
+
ease: 'transition-timing-function',
|
|
168
|
+
delay: 'transition-delay',
|
|
169
|
+
}[family];
|
|
170
|
+
const value = utility.slice(utility.indexOf('[') + 1, utility.lastIndexOf(']'));
|
|
171
|
+
context.report({ node, messageId: 'ambiguous', data: { token, family, property, value } });
|
|
172
|
+
} else {
|
|
173
|
+
context.report({ node, messageId: 'dead', data: { token } });
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/** Every string literal and template part under a class context, once each. */
|
|
179
|
+
const seen = new WeakSet();
|
|
180
|
+
const visit = node => {
|
|
181
|
+
if (!node || typeof node.type !== 'string' || seen.has(node)) return;
|
|
182
|
+
seen.add(node);
|
|
183
|
+
if (node.type === 'Literal' && typeof node.value === 'string') {
|
|
184
|
+
// A value compared or switched on (`side === 'right' && 'right-0'`) is a value, not a class; so is a
|
|
185
|
+
// lone word (a variant name such as `'accent'`): a class list that is one bare word is a utility
|
|
186
|
+
// Tailwind knows (`'hidden'`) or not a class at all.
|
|
187
|
+
const parent = node.parent;
|
|
188
|
+
if ((parent?.type === 'BinaryExpression' && parent.operator !== '+') || parent?.type === 'SwitchCase') return;
|
|
189
|
+
if (/^[a-z]+$/.test(node.value.trim())) return;
|
|
190
|
+
check(node, node.value, {});
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// An index (`ALIGN_CLASS[align ?? 'left']`) names an entry, not a class.
|
|
194
|
+
if (node.type === 'MemberExpression') {
|
|
195
|
+
visit(node.object);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
// cva: `defaultVariants` names variants; a `compoundVariants` entry names variants beside its `class`.
|
|
199
|
+
if (node.type === 'Property') {
|
|
200
|
+
const key = node.key?.type === 'Identifier' ? node.key.name : node.key?.value;
|
|
201
|
+
if (key === 'defaultVariants') return;
|
|
202
|
+
if (key === 'compoundVariants' && node.value.type === 'ArrayExpression') {
|
|
203
|
+
for (const entry of node.value.elements) {
|
|
204
|
+
if (entry?.type !== 'ObjectExpression') continue;
|
|
205
|
+
for (const property of entry.properties) {
|
|
206
|
+
const name = property.key?.type === 'Identifier' ? property.key.name : property.key?.value;
|
|
207
|
+
if (name === 'class' || name === 'className') visit(property.value);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
visit(node.value);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (node.type === 'TemplateLiteral') {
|
|
216
|
+
node.quasis.forEach((quasi, index) => {
|
|
217
|
+
check(quasi, quasi.value.cooked ?? quasi.value.raw, {
|
|
218
|
+
openStart: index > 0 && !/^\s/.test(quasi.value.raw),
|
|
219
|
+
openEnd: !quasi.tail && !/\s$/.test(quasi.value.raw),
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
node.expressions.forEach(visit);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
// A nested function is behaviour, not a class list (an event handler inside a cn() call's arguments).
|
|
226
|
+
if (/Function/.test(node.type)) return;
|
|
227
|
+
for (const key of Object.keys(node)) {
|
|
228
|
+
if (key === 'parent' || key === 'loc' || key === 'range') continue;
|
|
229
|
+
const value = node[key];
|
|
230
|
+
if (Array.isArray(value)) value.forEach(visit);
|
|
231
|
+
else if (value && typeof value.type === 'string') visit(value);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const enter = node => {
|
|
236
|
+
if (!isClassContext(node)) return;
|
|
237
|
+
if (node.type === 'JSXAttribute') visit(node.value);
|
|
238
|
+
else if (node.type === 'CallExpression') node.arguments.forEach(visit);
|
|
239
|
+
else if (node.type === 'VariableDeclarator') visit(node.init);
|
|
240
|
+
else if (node.type === 'AssignmentPattern') visit(node.right);
|
|
241
|
+
else visit(node.value);
|
|
242
|
+
};
|
|
243
|
+
return {
|
|
244
|
+
JSXAttribute: enter,
|
|
245
|
+
CallExpression: enter,
|
|
246
|
+
VariableDeclarator: enter,
|
|
247
|
+
Property: enter,
|
|
248
|
+
AssignmentPattern: enter,
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
export const deadClassesPlugin = {
|
|
254
|
+
meta: { name: 'flamingo-dead-classes' },
|
|
255
|
+
rules: { 'no-dead-class': noDeadClass },
|
|
256
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flamingo-stack/openframe-frontend-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.824",
|
|
4
4
|
"description": "Shared design system and components for all Flamingo platforms",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -378,6 +378,7 @@
|
|
|
378
378
|
"./eslint-config": "./eslint-config/index.js",
|
|
379
379
|
"./eslint-config/base": "./eslint-config/base.js",
|
|
380
380
|
"./eslint-config/image-sizes": "./eslint-config/image-sizes.js",
|
|
381
|
+
"./eslint-config/dead-classes": "./eslint-config/dead-classes.js",
|
|
381
382
|
"./eslint-config/next": "./eslint-config/next.js",
|
|
382
383
|
"./eslint-config/react": "./eslint-config/react.js",
|
|
383
384
|
"./eslint-config/relay": "./eslint-config/relay.js",
|
|
@@ -304,9 +304,6 @@ export interface EmbeddableChatProps {
|
|
|
304
304
|
*/
|
|
305
305
|
activeAgentSlug?: string;
|
|
306
306
|
|
|
307
|
-
/** Optional agent switcher callback (host renders the agent picker UI). */
|
|
308
|
-
onAgentChange?: (slug: string) => void;
|
|
309
|
-
|
|
310
307
|
/**
|
|
311
308
|
* Per-component override for the agent display-config route. Highest
|
|
312
309
|
* precedence (over `runtime.endpoints.aiAgentConfigUrl` and the built-in
|
|
@@ -616,8 +613,7 @@ function useRailPresence(open: boolean): { mounted: boolean; active: boolean } {
|
|
|
616
613
|
* and the body's list column). The OUTER box transitions its width 0 ⇄ 320 +
|
|
617
614
|
* opacity (so the neighbouring chat block slides smoothly); the INNER keeps a
|
|
618
615
|
* fixed `w-80` so the rail content never squishes mid-animation — it's just
|
|
619
|
-
* clipped by the shrinking outer (`overflow-hidden`).
|
|
620
|
-
* the collapse runs a touch longer than the open for a soft close.
|
|
616
|
+
* clipped by the shrinking outer (`overflow-hidden`).
|
|
621
617
|
*/
|
|
622
618
|
function RailSlot({
|
|
623
619
|
active,
|
|
@@ -640,7 +636,7 @@ function RailSlot({
|
|
|
640
636
|
// Border on the OUTER so the rail/chat divider tracks the animating
|
|
641
637
|
// boundary (and fades out with the panel) instead of vanishing early.
|
|
642
638
|
'shrink-0 overflow-hidden border-r border-ods-border transition-[width,opacity] ease-out',
|
|
643
|
-
active ? cn('
|
|
639
|
+
active ? cn('opacity-100', width) : 'w-0 opacity-0',
|
|
644
640
|
className,
|
|
645
641
|
)}
|
|
646
642
|
>
|
|
@@ -1018,7 +1014,6 @@ function EmbeddableChatInner({
|
|
|
1018
1014
|
activeMode: controlledActiveMode,
|
|
1019
1015
|
onActiveModeChange,
|
|
1020
1016
|
activeAgentSlug,
|
|
1021
|
-
onAgentChange: _onAgentChange,
|
|
1022
1017
|
aiAgentConfigUrl: aiAgentConfigUrlProp,
|
|
1023
1018
|
defaultActiveMode,
|
|
1024
1019
|
shell = 'drawer',
|
|
@@ -265,7 +265,7 @@ function LoadedBlogCard({
|
|
|
265
265
|
alt={post.title}
|
|
266
266
|
fill
|
|
267
267
|
priority={priority}
|
|
268
|
-
className={cn('object-cover object-center', '
|
|
268
|
+
className={cn('object-cover object-center', 'transition-all ease-out', 'hover:scale-[1.02]')}
|
|
269
269
|
sizes={IMAGE_SLOT.card}
|
|
270
270
|
unoptimized
|
|
271
271
|
onError={onImageError}
|
|
@@ -234,7 +234,7 @@ export function MingoWelcome({
|
|
|
234
234
|
<AlertCircleIcon className="h-8 w-8 shrink-0 text-ods-text-secondary" />
|
|
235
235
|
<div className="flex flex-col gap-[var(--spacing-system-xxs)]">
|
|
236
236
|
<p className="text-ods-text-primary text-h4">Couldn’t load your chats</p>
|
|
237
|
-
<p className="text-
|
|
237
|
+
<p className="text-ods-text-secondary">
|
|
238
238
|
Something went wrong reaching the server. Check your connection and try again.
|
|
239
239
|
</p>
|
|
240
240
|
</div>
|
|
@@ -489,10 +489,10 @@ export const FiltersDropdown: FC<FiltersDropdownProps> = ({
|
|
|
489
489
|
</div>
|
|
490
490
|
{/* Action Buttons */}
|
|
491
491
|
<div className="mt-4 flex shrink-0 gap-3">
|
|
492
|
-
<Button variant="outline" onClick={handleReset} size="default"
|
|
492
|
+
<Button variant="outline" onClick={handleReset} size="default">
|
|
493
493
|
Reset
|
|
494
494
|
</Button>
|
|
495
|
-
<Button variant="accent" onClick={handleApply} size="default"
|
|
495
|
+
<Button variant="accent" onClick={handleApply} size="default">
|
|
496
496
|
Apply
|
|
497
497
|
</Button>
|
|
498
498
|
</div>
|
|
@@ -123,7 +123,7 @@ export function ApprovalRequestNotificationTile({
|
|
|
123
123
|
disabled={processing}
|
|
124
124
|
data-pressed={approvePressed || undefined}
|
|
125
125
|
className={cn(
|
|
126
|
-
'
|
|
126
|
+
'transition-[filter,transform] duration-200 motion-reduce:transition-none',
|
|
127
127
|
lockscreen ? LOCKSCREEN_APPROVAL_BUTTON_CLASS : APPROVAL_BUTTON_CLASS,
|
|
128
128
|
approvePressed && 'scale-[0.98] brightness-75',
|
|
129
129
|
)}
|
|
@@ -15,11 +15,6 @@ export {
|
|
|
15
15
|
// New unified loading components
|
|
16
16
|
export { ContentLoadingContainer, useContentLoading } from '../content-loading-container';
|
|
17
17
|
|
|
18
|
-
// Note: OpenmspHeartbeatLoader is a client-only component and should be
|
|
19
|
-
// imported directly from "./openmsp-heartbeat" in client components. Do NOT
|
|
20
|
-
// export it here, otherwise server components that import this index will
|
|
21
|
-
// break due to client-only code.
|
|
22
|
-
|
|
23
18
|
export { LoadingRegion, type LoadingRegionProps } from './loading-region';
|
|
24
19
|
export { LoadingStatus } from '../ui/loading-scope';
|
|
25
20
|
export { LoadingFallback, LoadingSuspense } from './loading-fallback';
|
|
@@ -78,8 +78,8 @@ const AVATAR_BORDER_CLASS = 'rounded-full border-2 border-ods-border';
|
|
|
78
78
|
const BODY_CLASS = 'min-w-0 flex-1';
|
|
79
79
|
const NAME_ROW_CLASS = 'flex flex-wrap items-baseline gap-x-3 gap-y-1';
|
|
80
80
|
const NAME_CLASS = 'text-ods-text-primary text-h5';
|
|
81
|
-
const JOB_TITLE_CLASS = '
|
|
82
|
-
const BIO_CLASS = '
|
|
81
|
+
const JOB_TITLE_CLASS = 'mt-0.5 font-body text-ods-text-secondary';
|
|
82
|
+
const BIO_CLASS = 'mt-2 font-body leading-relaxed text-ods-text-secondary';
|
|
83
83
|
|
|
84
84
|
function formatDate(value: string | Date): string {
|
|
85
85
|
// A published date is a content date: UTC-pinned through the one renderer, so
|
|
@@ -147,7 +147,7 @@ export function ArticleAuthorByline({
|
|
|
147
147
|
)}
|
|
148
148
|
</h3>
|
|
149
149
|
{dateLabel && (
|
|
150
|
-
<span className="
|
|
150
|
+
<span className="inline-flex items-center gap-1 font-body text-ods-text-secondary">
|
|
151
151
|
<Calendar className="h-3 w-3" />
|
|
152
152
|
{dateLabel}
|
|
153
153
|
</span>
|
|
@@ -157,7 +157,7 @@ export function ArticleAuthorByline({
|
|
|
157
157
|
{formattedBio ? (
|
|
158
158
|
<p className={BIO_CLASS}>{formattedBio}</p>
|
|
159
159
|
) : fallbackBio ? (
|
|
160
|
-
<p className="
|
|
160
|
+
<p className="mt-2 font-body italic text-ods-text-secondary">{fallbackBio}</p>
|
|
161
161
|
) : null}
|
|
162
162
|
</div>
|
|
163
163
|
</div>
|
|
@@ -161,10 +161,7 @@ function TicketRowLoaded({
|
|
|
161
161
|
aria-expanded={expanded && !optimistic}
|
|
162
162
|
aria-controls={`ticket-drawer-${ticket.id}`}
|
|
163
163
|
/>
|
|
164
|
-
<CollapsibleContent
|
|
165
|
-
id={`ticket-drawer-${ticket.id}`}
|
|
166
|
-
className="data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down overflow-hidden"
|
|
167
|
-
>
|
|
164
|
+
<CollapsibleContent id={`ticket-drawer-${ticket.id}`} className="overflow-hidden">
|
|
168
165
|
<TicketDetailDrawer
|
|
169
166
|
ticket={ticket}
|
|
170
167
|
busy={busy}
|
|
@@ -352,7 +352,7 @@ export function DatePickerCalendar({
|
|
|
352
352
|
cellInner,
|
|
353
353
|
'flex items-center justify-center',
|
|
354
354
|
'cursor-pointer border-none bg-transparent outline-none',
|
|
355
|
-
'
|
|
355
|
+
'text-inherit',
|
|
356
356
|
),
|
|
357
357
|
// Painted through the `todayTint` modifier instead — see `isUnclaimedToday`.
|
|
358
358
|
today: '',
|
|
@@ -410,7 +410,7 @@ export function buildBaseComponents({
|
|
|
410
410
|
// bottom row's `border-b` used to sit against the frame's own border as a
|
|
411
411
|
// doubled line.
|
|
412
412
|
table: ({ children }: MdRenderProps<'table'>) => (
|
|
413
|
-
<div className="
|
|
413
|
+
<div className="my-6 overflow-x-auto rounded-lg border border-ods-border bg-ods-card">
|
|
414
414
|
<table className="w-full table-fixed md:table-auto [&_tr:last-child_td]:border-b-0">{children}</table>
|
|
415
415
|
</div>
|
|
416
416
|
),
|
|
@@ -217,13 +217,13 @@ const SKELETON_LEAD_LINES = { phone: 5, wide: 3 } as const;
|
|
|
217
217
|
/** The renderer's root class, on the rendered document and on every skeleton of one: it names a markdown body. */
|
|
218
218
|
export const MARKDOWN_RENDERER_CLASS = 'simple-markdown-renderer';
|
|
219
219
|
const RENDERER_CLASS = MARKDOWN_RENDERER_CLASS;
|
|
220
|
-
const CONTENT_WRAPPER_CLASS = '
|
|
220
|
+
const CONTENT_WRAPPER_CLASS = 'max-w-none';
|
|
221
221
|
/**
|
|
222
222
|
* The rendered body. `[&>*:last-child]:mb-0`: the last block never pushes what follows the document further down.
|
|
223
|
-
*
|
|
224
|
-
*
|
|
223
|
+
* Without it a block that sets its own margin (a table's `my-6`) kept it, and a document's distance to the next
|
|
224
|
+
* section depended on which block it ended with.
|
|
225
225
|
*/
|
|
226
|
-
const ARTICLE_CLASS = '
|
|
226
|
+
const ARTICLE_CLASS = 'max-w-none [&>*:last-child]:mb-0';
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
229
|
* One memoized completed block of a streaming message. Parent-level memos
|
|
@@ -14,7 +14,7 @@ const NavigationMenuViewport = forwardRef<
|
|
|
14
14
|
<div className={cn('absolute left-0 top-full flex justify-center')}>
|
|
15
15
|
<NavigationMenuPrimitive.Viewport
|
|
16
16
|
className={cn(
|
|
17
|
-
'
|
|
17
|
+
'relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]',
|
|
18
18
|
className,
|
|
19
19
|
)}
|
|
20
20
|
ref={ref}
|
|
@@ -244,8 +244,7 @@ const RadioGroupBlock = forwardRef<ComponentRef<typeof RadioGroupPrimitive.Root>
|
|
|
244
244
|
)
|
|
245
245
|
: cn(
|
|
246
246
|
'rounded-[6px] border bg-ods-card p-[var(--spacing-system-sf)]',
|
|
247
|
-
interactive &&
|
|
248
|
-
'has-[[data-state=checked]]:bg-[var(--ods-system-greys-soft-grey)]/30 has-[[data-state=checked]]:border-ods-accent/40',
|
|
247
|
+
interactive && 'has-[[data-state=checked]]:border-ods-accent/40',
|
|
249
248
|
error ? 'border-ods-error' : 'border-ods-border',
|
|
250
249
|
),
|
|
251
250
|
// Disabled matches a disabled field: flat `ods-bg` fill and
|
|
@@ -76,7 +76,7 @@ export function StickyActionBar({ visible, children, className }: StickyActionBa
|
|
|
76
76
|
aria-hidden={!visible}
|
|
77
77
|
inert={!visible}
|
|
78
78
|
className={cn(
|
|
79
|
-
'
|
|
79
|
+
'fixed inset-x-0 bottom-0 z-[44] border-t border-ods-border bg-ods-bg px-4 pt-3 transition-transform motion-reduce:transition-none',
|
|
80
80
|
'pb-[calc(1rem+env(safe-area-inset-bottom))]',
|
|
81
81
|
visible ? 'translate-y-0' : 'pointer-events-none translate-y-full',
|
|
82
82
|
className,
|
|
@@ -281,8 +281,7 @@ export const CONFIGS = {
|
|
|
281
281
|
},
|
|
282
282
|
{
|
|
283
283
|
why: "the loaders themselves (declared, never a screen state in the lib), the Button's own action progress, and the chat registry's card loader (a card read by id, drawn by the card's own skeleton)",
|
|
284
|
-
files:
|
|
285
|
-
/(?:^|\/)components\/(?:ui\/(?:[\w-]+-)?loader|loading\/openmsp-heartbeat|ui\/button\/button|chat\/entity-cards\/dispatch)\.tsx$/,
|
|
284
|
+
files: /(?:^|\/)components\/(?:ui\/(?:[\w-]+-)?loader|ui\/button\/button|chat\/entity-cards\/dispatch)\.tsx$/,
|
|
286
285
|
rules: ['LOADER_COMPONENT', 'SPINNER', 'OWN_PULSE'],
|
|
287
286
|
},
|
|
288
287
|
],
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openmsp-heartbeat.d.ts","sourceRoot":"","sources":["../../../src/components/loading/openmsp-heartbeat.tsx"],"names":[],"mappings":"AAIA,wBAAgB,sBAAsB,CAAC,EACrC,SAAc,EACd,QAAY,EACZ,KAAK,EACL,QAAkB,GACnB,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,+BAsDA"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { OpenmspLogoIcon } from "../icons-v2-generated/logos/openmsp-logo-icon.js";
|
|
4
|
-
function OpenmspHeartbeatLoader({
|
|
5
|
-
className = "",
|
|
6
|
-
progress = 0,
|
|
7
|
-
label,
|
|
8
|
-
barWidth = "w-128"
|
|
9
|
-
}) {
|
|
10
|
-
return /* @__PURE__ */ jsxs(
|
|
11
|
-
"div",
|
|
12
|
-
{
|
|
13
|
-
className: "max-w-screen flex max-h-screen min-h-screen items-center justify-center " + className,
|
|
14
|
-
role: "status",
|
|
15
|
-
"aria-label": "Generating report",
|
|
16
|
-
children: [
|
|
17
|
-
/* @__PURE__ */ jsx("style", { children: `
|
|
18
|
-
/* Lub-dub double-beat: quick pulse, quick pulse, rest */
|
|
19
|
-
@keyframes heartbeatInline {
|
|
20
|
-
0% { transform: scale(1); opacity: 0.96; }
|
|
21
|
-
8% { transform: scale(1.07); opacity: 1; }
|
|
22
|
-
16% { transform: scale(1); opacity: 0.98; }
|
|
23
|
-
24% { transform: scale(1.07); opacity: 1; }
|
|
24
|
-
32% { transform: scale(1); opacity: 0.96; }
|
|
25
|
-
/* small rebound */
|
|
26
|
-
40% { transform: scale(0.97); opacity: 0.94; }
|
|
27
|
-
/* rest */
|
|
28
|
-
70% { transform: scale(1); opacity: 0.96; }
|
|
29
|
-
100% { transform: scale(1); opacity: 0.96; }
|
|
30
|
-
}
|
|
31
|
-
` }),
|
|
32
|
-
/* @__PURE__ */ jsxs("div", { className: "justify-top flex flex-col items-center", children: [
|
|
33
|
-
/* @__PURE__ */ jsx(
|
|
34
|
-
"div",
|
|
35
|
-
{
|
|
36
|
-
style: {
|
|
37
|
-
animation: "heartbeatInline 3.6s ease-in-out infinite",
|
|
38
|
-
transformOrigin: "center center",
|
|
39
|
-
display: "inline-flex"
|
|
40
|
-
},
|
|
41
|
-
children: /* @__PURE__ */ jsx(
|
|
42
|
-
OpenmspLogoIcon,
|
|
43
|
-
{
|
|
44
|
-
secondaryColor: "var(--color-bg)",
|
|
45
|
-
tertiaryColor: "var(--ods-open-yellow-base)",
|
|
46
|
-
className: "mb-10 h-16 w-16 text-ods-accent opacity-90 md:h-24 md:w-24",
|
|
47
|
-
color: "var(--color-text-primary)"
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
),
|
|
52
|
-
/* @__PURE__ */ jsxs("div", { className: `${barWidth} flex flex-col items-center justify-center`, children: [
|
|
53
|
-
/* @__PURE__ */ jsxs("h2", { className: "mt-2 text-center font-bold text-ods-accent", children: [
|
|
54
|
-
progress > 0 ? Math.floor(progress) : 0,
|
|
55
|
-
"% ",
|
|
56
|
-
/* @__PURE__ */ jsx("span", { className: "text-ods-text-secondary text-h6", children: "/100%" })
|
|
57
|
-
] }),
|
|
58
|
-
/* @__PURE__ */ jsx("h3", { className: "mt-2 text-center text-ods-text-primary", children: label ?? `Processing\u2026` }),
|
|
59
|
-
/* @__PURE__ */ jsx("p", { className: "mt-2 text-center text-ods-text-secondary", children: "You can safely navigate away from this page, report generation will continue in the background." })
|
|
60
|
-
] })
|
|
61
|
-
] })
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
export {
|
|
67
|
-
OpenmspHeartbeatLoader
|
|
68
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { OpenmspLogoIcon } from '../icons-v2-generated/logos/openmsp-logo-icon';
|
|
4
|
-
|
|
5
|
-
export function OpenmspHeartbeatLoader({
|
|
6
|
-
className = '',
|
|
7
|
-
progress = 0,
|
|
8
|
-
label,
|
|
9
|
-
barWidth = 'w-128',
|
|
10
|
-
}: {
|
|
11
|
-
className?: string;
|
|
12
|
-
progress?: number;
|
|
13
|
-
label?: string;
|
|
14
|
-
barWidth?: string;
|
|
15
|
-
}) {
|
|
16
|
-
return (
|
|
17
|
-
<div
|
|
18
|
-
className={'max-w-screen flex max-h-screen min-h-screen items-center justify-center ' + className}
|
|
19
|
-
role="status"
|
|
20
|
-
aria-label="Generating report"
|
|
21
|
-
>
|
|
22
|
-
{/* Inline keyframes to bypass Tailwind build issues */}
|
|
23
|
-
<style>{`
|
|
24
|
-
/* Lub-dub double-beat: quick pulse, quick pulse, rest */
|
|
25
|
-
@keyframes heartbeatInline {
|
|
26
|
-
0% { transform: scale(1); opacity: 0.96; }
|
|
27
|
-
8% { transform: scale(1.07); opacity: 1; }
|
|
28
|
-
16% { transform: scale(1); opacity: 0.98; }
|
|
29
|
-
24% { transform: scale(1.07); opacity: 1; }
|
|
30
|
-
32% { transform: scale(1); opacity: 0.96; }
|
|
31
|
-
/* small rebound */
|
|
32
|
-
40% { transform: scale(0.97); opacity: 0.94; }
|
|
33
|
-
/* rest */
|
|
34
|
-
70% { transform: scale(1); opacity: 0.96; }
|
|
35
|
-
100% { transform: scale(1); opacity: 0.96; }
|
|
36
|
-
}
|
|
37
|
-
`}</style>
|
|
38
|
-
<div className="justify-top flex flex-col items-center">
|
|
39
|
-
<div
|
|
40
|
-
style={{
|
|
41
|
-
animation: 'heartbeatInline 3.6s ease-in-out infinite',
|
|
42
|
-
transformOrigin: 'center center',
|
|
43
|
-
display: 'inline-flex',
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
46
|
-
<OpenmspLogoIcon
|
|
47
|
-
secondaryColor="var(--color-bg)"
|
|
48
|
-
tertiaryColor="var(--ods-open-yellow-base)"
|
|
49
|
-
className="mb-10 h-16 w-16 text-ods-accent opacity-90 md:h-24 md:w-24"
|
|
50
|
-
color="var(--color-text-primary)"
|
|
51
|
-
/>
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
<div className={`${barWidth} flex flex-col items-center justify-center`}>
|
|
55
|
-
{/* Progress text */}
|
|
56
|
-
<h2 className="mt-2 text-center font-bold text-ods-accent">
|
|
57
|
-
{progress > 0 ? Math.floor(progress) : 0}% <span className="text-ods-text-secondary text-h6">/100%</span>
|
|
58
|
-
</h2>
|
|
59
|
-
|
|
60
|
-
{/* Progress text */}
|
|
61
|
-
<h3 className="mt-2 text-center text-ods-text-primary">{label ?? `Processing…`}</h3>
|
|
62
|
-
<p className="mt-2 text-center text-ods-text-secondary">
|
|
63
|
-
You can safely navigate away from this page, report generation will continue in the background.
|
|
64
|
-
</p>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
);
|
|
69
|
-
}
|