@nadicodeai/ui 12.1.10 → 12.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
nadicode's React components, published as a built package: shadcn components on
|
|
4
4
|
Base UI, the chart kit, the Agent conversation interface, and the product
|
|
5
|
-
compositions the website, the Portal and
|
|
5
|
+
compositions the website, the Portal, Nadia and Alveare share. They build on
|
|
6
6
|
`@nadicodeai/design-system`, whose `DESIGN.md` is the design system and its only
|
|
7
7
|
design authority.
|
|
8
8
|
|
package/dist/eslint/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import { noPackageComponentRedefinition } from "./rules/no-package-component-red
|
|
|
19
19
|
import { noPairedSizeUtility } from "./rules/no-paired-size-utility.js";
|
|
20
20
|
import { noRestingSettingsControl } from "./rules/no-resting-settings-control.js";
|
|
21
21
|
import { oneControlHeight } from "./rules/one-control-height.js";
|
|
22
|
+
import { tableColumnWrapsByMeta } from "./rules/table-column-wraps-by-meta.js";
|
|
22
23
|
import { noShadcnAppearanceOverride } from "./rules/no-shadcn-appearance-override.js";
|
|
23
24
|
import { noSubjectDerivedExpectation } from "./rules/no-subject-derived-expectation.js";
|
|
24
25
|
import { noUnpinnedVercelFunctionsImport } from "./rules/no-unpinned-vercel-functions-import.js";
|
|
@@ -131,6 +132,7 @@ const plugin = {
|
|
|
131
132
|
"no-invalid-token-utility": noInvalidTokenUtility,
|
|
132
133
|
"no-token-category-bypass": noTokenCategoryBypass,
|
|
133
134
|
"one-control-height": oneControlHeight,
|
|
135
|
+
"table-column-wraps-by-meta": tableColumnWrapsByMeta,
|
|
134
136
|
"server-action-discipline": serverActionDiscipline,
|
|
135
137
|
"settings-section-description": settingsSectionDescription,
|
|
136
138
|
"shadcn-composition": shadcnComposition,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A table column wraps by its definition, never by its cells. DataTable holds a
|
|
3
|
+
* fact on one line and gives a column marked `meta: { prose: true }` a floor
|
|
4
|
+
* and wrapping between words (DESIGN.md, "Tables and missing values"). A cell
|
|
5
|
+
* that sets its own wrapping gets neither the floor nor the identity's share
|
|
6
|
+
* of the width, and the table squeezes it until each word takes a line.
|
|
7
|
+
*
|
|
8
|
+
* Standard tool checked first: `better-tailwindcss`'s `no-restricted-classes`
|
|
9
|
+
* judges one class at a time, and `whitespace-normal` is right in a button or a
|
|
10
|
+
* card. What is wrong is where it is written: inside a column's `cell`, which
|
|
11
|
+
* this rule reads on the shared className reader.
|
|
12
|
+
*/
|
|
13
|
+
import { openingElementClassUtilities } from "./jsx-class-utility.js";
|
|
14
|
+
|
|
15
|
+
const WRAPPING = /^(?:.*:)?whitespace-(?:normal|pre-line|pre-wrap)$/;
|
|
16
|
+
|
|
17
|
+
/** Inside the `cell` renderer of a column definition object. */
|
|
18
|
+
function insideColumnCell(node) {
|
|
19
|
+
for (let current = node.parent; current; current = current.parent) {
|
|
20
|
+
if (
|
|
21
|
+
current.type === "Property" &&
|
|
22
|
+
!current.computed &&
|
|
23
|
+
current.key.type === "Identifier" &&
|
|
24
|
+
current.key.name === "cell"
|
|
25
|
+
) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const tableColumnWrapsByMeta = {
|
|
33
|
+
meta: {
|
|
34
|
+
type: "problem",
|
|
35
|
+
docs: {
|
|
36
|
+
description: "Disallow a table cell setting its own wrapping; mark the column prose",
|
|
37
|
+
},
|
|
38
|
+
schema: [],
|
|
39
|
+
messages: {
|
|
40
|
+
cellWraps:
|
|
41
|
+
'"{{token}}" wraps one cell of a table column. Mark the column `meta: { prose: true }` so DataTable gives it a floor and wraps it between words.',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
create(context) {
|
|
45
|
+
return {
|
|
46
|
+
JSXOpeningElement(node) {
|
|
47
|
+
if (!insideColumnCell(node)) return;
|
|
48
|
+
for (const token of openingElementClassUtilities(node, context)) {
|
|
49
|
+
if (WRAPPING.test(token))
|
|
50
|
+
context.report({ node, messageId: "cellWraps", data: { token } });
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-orb.d.ts","sourceRoot":"","sources":["../../src/internal/agent-orb.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EAEb,KAAK,QAAQ,EAId,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,oBAAoB,CAAC;AAE5B,QAAA,MAAM,aAAa;;;;;;;;CAQ0B,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,aAAa,CAAC;AACtD,kEAAkE;AAClE,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,OAAO,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;AAE7D,kDAAkD;AAClD,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,cAAc,CAAC;AACxD,+FAA+F;AAC/F,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;AA+BlD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAuDpF;AA4FD,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB;;;OAGG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,o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ACjB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAClD,CAAC;IAAE,MAAM,CAAC,EAAE,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAExF,wBAAgB,aAAa,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,oBAAoB;;sBAIzC,OAAO;qBAAuB,aAAa;EAuKvF"}
|
|
@@ -233,6 +233,17 @@ export function mountAgentOrb(canvas, options) {
|
|
|
233
233
|
if (running())
|
|
234
234
|
request = requestAnimationFrame(tick);
|
|
235
235
|
}
|
|
236
|
+
/** WebKit's canvas rejects `color-mix()` in a gradient stop, so a mix is
|
|
237
|
+
* handed to the canvas as the colour it computes to. */
|
|
238
|
+
function computedColor(declaration) {
|
|
239
|
+
const probe = document.createElement("span");
|
|
240
|
+
probe.hidden = true;
|
|
241
|
+
probe.style.color = declaration;
|
|
242
|
+
(canvas.parentElement ?? document.body).append(probe);
|
|
243
|
+
const resolved = getComputedStyle(probe).color;
|
|
244
|
+
probe.remove();
|
|
245
|
+
return resolved || color;
|
|
246
|
+
}
|
|
236
247
|
function refresh() {
|
|
237
248
|
painted = measure();
|
|
238
249
|
const backing = Math.max(1, Math.round(painted * Math.min(window.devicePixelRatio || 1, 2)));
|
|
@@ -241,7 +252,7 @@ export function mountAgentOrb(canvas, options) {
|
|
|
241
252
|
ratio = backing / painted;
|
|
242
253
|
const appearance = getComputedStyle(canvas);
|
|
243
254
|
color = appearance.color;
|
|
244
|
-
celebrationColors = ["--nc-chart-5", "--nc-chart-6", "--nc-warning", "--nc-chart-4"].map((token) => `color-mix(in oklch, ${appearance.getPropertyValue(token).trim() || color} 75%, white)`);
|
|
255
|
+
celebrationColors = ["--nc-chart-5", "--nc-chart-6", "--nc-warning", "--nc-chart-4"].map((token) => computedColor(`color-mix(in oklch, ${appearance.getPropertyValue(token).trim() || color} 75%, white)`));
|
|
245
256
|
stripeColors = nadiaStripes.map((token) => (token && appearance.getPropertyValue(token).trim()) || color);
|
|
246
257
|
play();
|
|
247
258
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@assistant-ui/react": "0.15.21",
|
|
72
72
|
"@assistant-ui/react-markdown": "0.14.16",
|
|
73
73
|
"@base-ui/react": "^1.8.0",
|
|
74
|
-
"@nadicodeai/design-system": "12.1.
|
|
74
|
+
"@nadicodeai/design-system": "12.1.12",
|
|
75
75
|
"class-variance-authority": "^0.7.1",
|
|
76
76
|
"clsx": "^2.1.1",
|
|
77
77
|
"cmdk": "^1.1.1",
|