@shapesos/clay 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-elements.cjs +3 -1
- package/dist/ai-elements.cjs.map +1 -1
- package/dist/ai-elements.js +4 -4
- package/dist/artifacts.cjs +1010 -60
- package/dist/artifacts.cjs.map +1 -1
- package/dist/artifacts.d.cts +20 -3
- package/dist/artifacts.d.ts +20 -3
- package/dist/artifacts.js +15 -6
- package/dist/badge.cjs +70 -0
- package/dist/badge.cjs.map +1 -0
- package/dist/badge.d.cts +28 -0
- package/dist/badge.d.ts +28 -0
- package/dist/badge.js +9 -0
- package/dist/blocks.cjs +981 -96
- package/dist/blocks.cjs.map +1 -1
- package/dist/blocks.css +1 -1
- package/dist/blocks.d.cts +15 -4
- package/dist/blocks.d.ts +15 -4
- package/dist/blocks.js +20 -8
- package/dist/button.cjs +3 -1
- package/dist/button.cjs.map +1 -1
- package/dist/button.js +2 -2
- package/dist/capture.cjs +3 -1
- package/dist/capture.cjs.map +1 -1
- package/dist/capture.js +2 -2
- package/dist/chart.cjs +3 -1
- package/dist/chart.cjs.map +1 -1
- package/dist/chart.js +2 -2
- package/dist/chat.cjs +986 -151
- package/dist/chat.cjs.map +1 -1
- package/dist/chat.d.cts +2 -2
- package/dist/chat.d.ts +2 -2
- package/dist/chat.js +13 -8
- package/dist/{chunk-JGMN6W72.js → chunk-2X4KUXYP.js} +1 -1
- package/dist/chunk-BHHJOG5X.js +1 -0
- package/dist/{chunk-B4U37WIH.js → chunk-CFCLVJIO.js} +2 -2
- package/dist/chunk-CSTCTO3B.js +161 -0
- package/dist/chunk-CSTCTO3B.js.map +1 -0
- package/dist/{chunk-6YZ65KPW.js → chunk-DC5KYT2G.js} +669 -171
- package/dist/chunk-DC5KYT2G.js.map +1 -0
- package/dist/{chunk-PYDVANWI.js → chunk-E36VI2HA.js} +2 -2
- package/dist/chunk-EIAWZXE4.js +69 -0
- package/dist/chunk-EIAWZXE4.js.map +1 -0
- package/dist/chunk-EXRNGIQ2.js +41 -0
- package/dist/chunk-EXRNGIQ2.js.map +1 -0
- package/dist/{chunk-B6GAPZ2R.js → chunk-FCSYVF4Z.js} +12 -46
- package/dist/chunk-FCSYVF4Z.js.map +1 -0
- package/dist/{chunk-PUVZ2S3F.js → chunk-G4NXVFXU.js} +2 -2
- package/dist/{chunk-JAGNXEWK.js → chunk-GK4XW4BC.js} +2 -2
- package/dist/{chunk-4MZZH3WX.js → chunk-HU5W7CGE.js} +37 -2
- package/dist/chunk-HU5W7CGE.js.map +1 -0
- package/dist/chunk-JMHE3Q5K.js +406 -0
- package/dist/chunk-JMHE3Q5K.js.map +1 -0
- package/dist/{chunk-4VE6ZXXW.js → chunk-MQP57DOP.js} +3 -3
- package/dist/{chunk-JF3P66JF.js → chunk-SN3ORQSJ.js} +4 -2
- package/dist/{chunk-JF3P66JF.js.map → chunk-SN3ORQSJ.js.map} +1 -1
- package/dist/{chunk-PGR2MDDU.js → chunk-W66OJM55.js} +2 -2
- package/dist/{chunk-7OYIDM42.js → chunk-XKURJ72I.js} +2 -2
- package/dist/copy-button.cjs +439 -0
- package/dist/copy-button.cjs.map +1 -0
- package/dist/copy-button.d.cts +20 -0
- package/dist/copy-button.d.ts +20 -0
- package/dist/copy-button.js +12 -0
- package/dist/copy-button.js.map +1 -0
- package/dist/{dom-to-image-NATF3446.js → dom-to-image-QB7KMTAE.js} +3 -3
- package/dist/dom-to-image-QB7KMTAE.js.map +1 -0
- package/dist/icon.cjs +3 -1
- package/dist/icon.cjs.map +1 -1
- package/dist/icon.js +2 -2
- package/dist/index.cjs +1070 -209
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +42 -17
- package/dist/keyboard-shortcut.cjs +3 -1
- package/dist/keyboard-shortcut.cjs.map +1 -1
- package/dist/keyboard-shortcut.js +2 -2
- package/dist/table.cjs +40 -0
- package/dist/table.cjs.map +1 -1
- package/dist/table.d.cts +37 -2
- package/dist/table.d.ts +37 -2
- package/dist/table.js +11 -1
- package/dist/text-area.cjs +3 -1
- package/dist/text-area.cjs.map +1 -1
- package/dist/text-area.js +2 -2
- package/dist/tokens.cjs +3 -1
- package/dist/tokens.cjs.map +1 -1
- package/dist/tokens.d.cts +1 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.js +1 -1
- package/dist/{types-CW45GBXl.d.cts → types-Bhg0_ES8.d.cts} +75 -3
- package/dist/{types-GCkXbyFm.d.ts → types-C8JtnwNY.d.ts} +200 -4
- package/dist/{types-BzXPBy6s.d.cts → types-DTdDFU3O.d.cts} +200 -4
- package/dist/{types-D1b8v7EY.d.ts → types-orOQcI2z.d.ts} +75 -3
- package/package.json +11 -1
- package/dist/chunk-46ZYTBX5.js +0 -250
- package/dist/chunk-46ZYTBX5.js.map +0 -1
- package/dist/chunk-4MZZH3WX.js.map +0 -1
- package/dist/chunk-6YZ65KPW.js.map +0 -1
- package/dist/chunk-B6GAPZ2R.js.map +0 -1
- package/dist/chunk-RSRNSWJN.js +0 -1
- /package/dist/{chunk-RSRNSWJN.js.map → badge.js.map} +0 -0
- /package/dist/{chunk-JGMN6W72.js.map → chunk-2X4KUXYP.js.map} +0 -0
- /package/dist/{dom-to-image-NATF3446.js.map → chunk-BHHJOG5X.js.map} +0 -0
- /package/dist/{chunk-B4U37WIH.js.map → chunk-CFCLVJIO.js.map} +0 -0
- /package/dist/{chunk-PYDVANWI.js.map → chunk-E36VI2HA.js.map} +0 -0
- /package/dist/{chunk-PUVZ2S3F.js.map → chunk-G4NXVFXU.js.map} +0 -0
- /package/dist/{chunk-JAGNXEWK.js.map → chunk-GK4XW4BC.js.map} +0 -0
- /package/dist/{chunk-4VE6ZXXW.js.map → chunk-MQP57DOP.js.map} +0 -0
- /package/dist/{chunk-PGR2MDDU.js.map → chunk-W66OJM55.js.map} +0 -0
- /package/dist/{chunk-7OYIDM42.js.map → chunk-XKURJ72I.js.map} +0 -0
package/dist/artifacts.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as ArtifactType, d as ArtifactService, c as ArtifactRecord, e as ArtifactServiceProps,
|
|
2
|
-
export { A as ArtifactCallbacksOf, a as ArtifactDataRow, b as ArtifactLabelsOf, B as BarChartConfig, C as ChartArtifactLabels, h as ChartConfig, i as ChartStats, D as DEFAULT_CHART_ARTIFACT_LABELS, j as DEFAULT_TABLE_ARTIFACT_LABELS, L as LineChartConfig, P as PieChartConfig, T as TableArtifactLabels,
|
|
1
|
+
import { f as ArtifactType, d as ArtifactService, c as ArtifactRecord, e as ArtifactServiceProps, x as TableArtifactRecord, g as ChartArtifactRecord, n as DeckArtifactRecord } from './types-DTdDFU3O.cjs';
|
|
2
|
+
export { A as ArtifactCallbacksOf, a as ArtifactDataRow, b as ArtifactLabelsOf, B as BarChartConfig, C as ChartArtifactLabels, h as ChartConfig, i as ChartStats, D as DEFAULT_CHART_ARTIFACT_LABELS, j as DEFAULT_DECK_ARTIFACT_LABELS, k as DEFAULT_TABLE_ARTIFACT_LABELS, l as DeckArtifactCallbacks, m as DeckArtifactLabels, o as DeckBlock, p as DeckChartBlock, q as DeckConfig, r as DeckMeta, s as DeckSlide, t as DeckSlideKind, u as DeckStats, v as DeckTableBlock, w as DeckTextBlock, L as LineChartConfig, P as PieChartConfig, T as TableArtifactLabels, y as TableColumn, z as TableConfig, E as TableRow, F as TableStats, G as artifactTypes, H as deckBlockTypes, I as deckSlideKinds } from './types-DTdDFU3O.cjs';
|
|
3
3
|
import { ReactNode, RefObject } from 'react';
|
|
4
4
|
export { C as ChartSeries, a as ChartVariant } from './types-B2aYk82c.cjs';
|
|
5
5
|
|
|
@@ -214,4 +214,21 @@ declare function TableArtifact({ artifact, labels, callbacks }: ArtifactServiceP
|
|
|
214
214
|
*/
|
|
215
215
|
declare function ChartArtifact({ artifact, labels, callbacks }: ArtifactServiceProps<ChartArtifactRecord>): ReactNode;
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Orchestrator for the `DECK`-typed artifact.
|
|
219
|
+
*
|
|
220
|
+
* Composes the ai-elements chrome primitives (`Artifact`, `ArtifactHeader`, `ArtifactTitle`,
|
|
221
|
+
* `ArtifactActions`, `ArtifactContent`) directly around the slide navigator (`DeckArtifactContent`).
|
|
222
|
+
*
|
|
223
|
+
* Render and download are two independent paths. Slides render inline from `artifact.config` after
|
|
224
|
+
* validation — no fetch. Download, when available, points at a `.pptx` export via
|
|
225
|
+
* `protectedAsset.presignedUrl`; the button is gated on a *safe* `http(s)` URL (mirrors
|
|
226
|
+
* `TableArtifact` / `ChartArtifact`).
|
|
227
|
+
*
|
|
228
|
+
* Fullscreen: clicking the expand button opens a React portal overlay (`createPortal` to
|
|
229
|
+
* `document.body`) at 100vw×100vh. Portal is used instead of the browser Fullscreen API because
|
|
230
|
+
* the chat may run in a sandboxed iframe where `requestFullscreen` is blocked.
|
|
231
|
+
*/
|
|
232
|
+
declare function DeckArtifact({ artifact, labels, callbacks }: ArtifactServiceProps<DeckArtifactRecord>): ReactNode;
|
|
233
|
+
|
|
234
|
+
export { ArtifactCopyAsImageButton, type ArtifactCopyAsImageButtonProps, ArtifactDownloadButton, type ArtifactDownloadButtonProps, ArtifactDownloadMenu, type ArtifactDownloadMenuCsvAction, type ArtifactDownloadMenuPngAction, type ArtifactDownloadMenuProps, ArtifactRecord, ArtifactService, ArtifactServiceProps, ArtifactServices, ArtifactType, ChartArtifact, ChartArtifactRecord, DeckArtifact, DeckArtifactRecord, TableArtifact, TableArtifactRecord, artifactToClipboardText, isSafeDownloadUrl };
|
package/dist/artifacts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as ArtifactType, d as ArtifactService, c as ArtifactRecord, e as ArtifactServiceProps,
|
|
2
|
-
export { A as ArtifactCallbacksOf, a as ArtifactDataRow, b as ArtifactLabelsOf, B as BarChartConfig, C as ChartArtifactLabels, h as ChartConfig, i as ChartStats, D as DEFAULT_CHART_ARTIFACT_LABELS, j as DEFAULT_TABLE_ARTIFACT_LABELS, L as LineChartConfig, P as PieChartConfig, T as TableArtifactLabels,
|
|
1
|
+
import { f as ArtifactType, d as ArtifactService, c as ArtifactRecord, e as ArtifactServiceProps, x as TableArtifactRecord, g as ChartArtifactRecord, n as DeckArtifactRecord } from './types-C8JtnwNY.js';
|
|
2
|
+
export { A as ArtifactCallbacksOf, a as ArtifactDataRow, b as ArtifactLabelsOf, B as BarChartConfig, C as ChartArtifactLabels, h as ChartConfig, i as ChartStats, D as DEFAULT_CHART_ARTIFACT_LABELS, j as DEFAULT_DECK_ARTIFACT_LABELS, k as DEFAULT_TABLE_ARTIFACT_LABELS, l as DeckArtifactCallbacks, m as DeckArtifactLabels, o as DeckBlock, p as DeckChartBlock, q as DeckConfig, r as DeckMeta, s as DeckSlide, t as DeckSlideKind, u as DeckStats, v as DeckTableBlock, w as DeckTextBlock, L as LineChartConfig, P as PieChartConfig, T as TableArtifactLabels, y as TableColumn, z as TableConfig, E as TableRow, F as TableStats, G as artifactTypes, H as deckBlockTypes, I as deckSlideKinds } from './types-C8JtnwNY.js';
|
|
3
3
|
import { ReactNode, RefObject } from 'react';
|
|
4
4
|
export { C as ChartSeries, a as ChartVariant } from './types-B2aYk82c.js';
|
|
5
5
|
|
|
@@ -214,4 +214,21 @@ declare function TableArtifact({ artifact, labels, callbacks }: ArtifactServiceP
|
|
|
214
214
|
*/
|
|
215
215
|
declare function ChartArtifact({ artifact, labels, callbacks }: ArtifactServiceProps<ChartArtifactRecord>): ReactNode;
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Orchestrator for the `DECK`-typed artifact.
|
|
219
|
+
*
|
|
220
|
+
* Composes the ai-elements chrome primitives (`Artifact`, `ArtifactHeader`, `ArtifactTitle`,
|
|
221
|
+
* `ArtifactActions`, `ArtifactContent`) directly around the slide navigator (`DeckArtifactContent`).
|
|
222
|
+
*
|
|
223
|
+
* Render and download are two independent paths. Slides render inline from `artifact.config` after
|
|
224
|
+
* validation — no fetch. Download, when available, points at a `.pptx` export via
|
|
225
|
+
* `protectedAsset.presignedUrl`; the button is gated on a *safe* `http(s)` URL (mirrors
|
|
226
|
+
* `TableArtifact` / `ChartArtifact`).
|
|
227
|
+
*
|
|
228
|
+
* Fullscreen: clicking the expand button opens a React portal overlay (`createPortal` to
|
|
229
|
+
* `document.body`) at 100vw×100vh. Portal is used instead of the browser Fullscreen API because
|
|
230
|
+
* the chat may run in a sandboxed iframe where `requestFullscreen` is blocked.
|
|
231
|
+
*/
|
|
232
|
+
declare function DeckArtifact({ artifact, labels, callbacks }: ArtifactServiceProps<DeckArtifactRecord>): ReactNode;
|
|
233
|
+
|
|
234
|
+
export { ArtifactCopyAsImageButton, type ArtifactCopyAsImageButtonProps, ArtifactDownloadButton, type ArtifactDownloadButtonProps, ArtifactDownloadMenu, type ArtifactDownloadMenuCsvAction, type ArtifactDownloadMenuPngAction, type ArtifactDownloadMenuProps, ArtifactRecord, ArtifactService, ArtifactServiceProps, ArtifactServices, ArtifactType, ChartArtifact, ChartArtifactRecord, DeckArtifact, DeckArtifactRecord, TableArtifact, TableArtifactRecord, artifactToClipboardText, isSafeDownloadUrl };
|
package/dist/artifacts.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-BHHJOG5X.js";
|
|
2
2
|
import {
|
|
3
3
|
ArtifactCopyAsImageButton,
|
|
4
4
|
ArtifactDownloadButton,
|
|
@@ -6,20 +6,25 @@ import {
|
|
|
6
6
|
ArtifactServices,
|
|
7
7
|
ChartArtifact,
|
|
8
8
|
DEFAULT_CHART_ARTIFACT_LABELS,
|
|
9
|
+
DEFAULT_DECK_ARTIFACT_LABELS,
|
|
9
10
|
DEFAULT_TABLE_ARTIFACT_LABELS,
|
|
11
|
+
DeckArtifact,
|
|
10
12
|
TableArtifact,
|
|
11
13
|
artifactToClipboardText,
|
|
12
14
|
artifactTypes,
|
|
15
|
+
deckBlockTypes,
|
|
16
|
+
deckSlideKinds,
|
|
13
17
|
isSafeDownloadUrl
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-DC5KYT2G.js";
|
|
19
|
+
import "./chunk-CSTCTO3B.js";
|
|
20
|
+
import "./chunk-E36VI2HA.js";
|
|
16
21
|
import "./chunk-LXYCT4YO.js";
|
|
17
22
|
import "./chunk-OLJIJYB5.js";
|
|
18
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-G4NXVFXU.js";
|
|
19
24
|
import "./chunk-C77QMQNT.js";
|
|
20
25
|
import "./chunk-UXT2H3FM.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-SN3ORQSJ.js";
|
|
27
|
+
import "./chunk-HU5W7CGE.js";
|
|
23
28
|
import "./chunk-P6GUNIAE.js";
|
|
24
29
|
import "./chunk-5WRI5ZAA.js";
|
|
25
30
|
export {
|
|
@@ -29,10 +34,14 @@ export {
|
|
|
29
34
|
ArtifactServices,
|
|
30
35
|
ChartArtifact,
|
|
31
36
|
DEFAULT_CHART_ARTIFACT_LABELS,
|
|
37
|
+
DEFAULT_DECK_ARTIFACT_LABELS,
|
|
32
38
|
DEFAULT_TABLE_ARTIFACT_LABELS,
|
|
39
|
+
DeckArtifact,
|
|
33
40
|
TableArtifact,
|
|
34
41
|
artifactToClipboardText,
|
|
35
42
|
artifactTypes,
|
|
43
|
+
deckBlockTypes,
|
|
44
|
+
deckSlideKinds,
|
|
36
45
|
isSafeDownloadUrl
|
|
37
46
|
};
|
|
38
47
|
//# sourceMappingURL=artifacts.js.map
|
package/dist/badge.cjs
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/badge/index.ts
|
|
21
|
+
var badge_exports = {};
|
|
22
|
+
__export(badge_exports, {
|
|
23
|
+
Badge: () => Badge
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(badge_exports);
|
|
26
|
+
|
|
27
|
+
// src/lib/utils.ts
|
|
28
|
+
var import_clsx = require("clsx");
|
|
29
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
30
|
+
function cn(...inputs) {
|
|
31
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// src/components/badge/badge.tsx
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var BASE = "inline-flex items-center whitespace-nowrap rounded-full";
|
|
37
|
+
var SIZES = {
|
|
38
|
+
// `sm` is a uniform scale-down of `md` (text 10/12 of caption): padding and line-height keep
|
|
39
|
+
// md's proportions (caption is 12px text on a 16px line = 1.333 ratio) so the pill shape matches.
|
|
40
|
+
md: "px-2.5 py-0.5 text-geist-label-caption-medium",
|
|
41
|
+
sm: "px-2 py-0.5 text-[11px]/[1.333] font-medium"
|
|
42
|
+
};
|
|
43
|
+
var SUBTLE = {
|
|
44
|
+
neutral: "bg-brown-20 text-brown-70",
|
|
45
|
+
warning: "bg-orange-50 text-orange-600",
|
|
46
|
+
violet: "bg-violet-50 text-violet-600"
|
|
47
|
+
};
|
|
48
|
+
var OUTLINE = {
|
|
49
|
+
neutral: "border border-brown-30 bg-white text-brown-100",
|
|
50
|
+
warning: "border border-orange-200 bg-white text-orange-600",
|
|
51
|
+
violet: "border border-violet-400 bg-white text-violet-600"
|
|
52
|
+
};
|
|
53
|
+
var VARIANTS = {
|
|
54
|
+
subtle: SUBTLE,
|
|
55
|
+
outline: OUTLINE
|
|
56
|
+
};
|
|
57
|
+
function Badge({
|
|
58
|
+
variant = "subtle",
|
|
59
|
+
tone = "neutral",
|
|
60
|
+
size = "md",
|
|
61
|
+
className,
|
|
62
|
+
children
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: cn(BASE, SIZES[size], VARIANTS[variant][tone], className), children });
|
|
65
|
+
}
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
Badge
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=badge.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/badge/index.ts","../src/lib/utils.ts","../src/components/badge/badge.tsx"],"sourcesContent":["export { Badge } from \"./badge\";\nexport type { BadgeProps, BadgeSize, BadgeTone, BadgeVariant } from \"./badge\";\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Combines class names using clsx and tailwind-merge — the standard shadcn/ui helper.\n * Tailwind classes that conflict (e.g. `p-2 p-4`) get merged so the last one wins.\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","import type { ReactNode } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\n/** Fill treatment of the badge. */\nexport type BadgeVariant = \"subtle\" | \"outline\";\n\n/** Semantic color of the badge. */\nexport type BadgeTone = \"neutral\" | \"warning\" | \"violet\";\n\n/** Overall size — `md` (default) or a more compact `sm` for eyebrow-style tags. */\nexport type BadgeSize = \"sm\" | \"md\";\n\nexport interface BadgeProps {\n /** Fill treatment. `subtle` = tinted background, `outline` = bordered on white. Default `subtle`. */\n variant?: BadgeVariant;\n /** Semantic color. `neutral` = brown, `warning` = orange, `violet` = violet. Default `neutral`. */\n tone?: BadgeTone;\n /** Size. `md` (12px text) or `sm` (10px text, tighter padding). Default `md`. */\n size?: BadgeSize;\n /** Extra classes merged after the variant/tone classes (last-wins via tailwind-merge). */\n className?: string;\n /** Badge label content. */\n children: ReactNode;\n}\n\nconst BASE = \"inline-flex items-center whitespace-nowrap rounded-full\";\n\n/** Padding + text size per size. Kept as one class each so there is a single font-size utility (deterministic override). */\nconst SIZES: Record<BadgeSize, string> = {\n // `sm` is a uniform scale-down of `md` (text 10/12 of caption): padding and line-height keep\n // md's proportions (caption is 12px text on a 16px line = 1.333 ratio) so the pill shape matches.\n md: \"px-2.5 py-0.5 text-geist-label-caption-medium\",\n sm: \"px-2 py-0.5 text-[11px]/[1.333] font-medium\",\n};\n\n/** Tinted background — low-emphasis tag. */\nconst SUBTLE: Record<BadgeTone, string> = {\n neutral: \"bg-brown-20 text-brown-70\",\n warning: \"bg-orange-50 text-orange-600\",\n violet: \"bg-violet-50 text-violet-600\",\n};\n\n/** Bordered on white — reads as a discrete chip. */\nconst OUTLINE: Record<BadgeTone, string> = {\n neutral: \"border border-brown-30 bg-white text-brown-100\",\n warning: \"border border-orange-200 bg-white text-orange-600\",\n violet: \"border border-violet-400 bg-white text-violet-600\",\n};\n\nconst VARIANTS: Record<BadgeVariant, Record<BadgeTone, string>> = {\n subtle: SUBTLE,\n outline: OUTLINE,\n};\n\n/**\n * Small pill for labels, counts, and status tags — recipient chips, \"+N\" overflow, \"Email\n * (fallback)\" tags, \"Labs\". Presentational only; on clay tokens. Compose the label at the call\n * site.\n */\nexport function Badge({\n variant = \"subtle\",\n tone = \"neutral\",\n size = \"md\",\n className,\n children,\n}: BadgeProps): ReactNode {\n return <span className={cn(BASE, SIZES[size], VARIANTS[variant][tone], className)}>{children}</span>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AACtC,4BAAwB;AAMjB,SAAS,MAAM,QAA8B;AAClD,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AC0DS;AAzCT,IAAM,OAAO;AAGb,IAAM,QAAmC;AAAA;AAAA;AAAA,EAGvC,IAAI;AAAA,EACJ,IAAI;AACN;AAGA,IAAM,SAAoC;AAAA,EACxC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;AAGA,IAAM,UAAqC;AAAA,EACzC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;AAEA,IAAM,WAA4D;AAAA,EAChE,QAAQ;AAAA,EACR,SAAS;AACX;AAOO,SAAS,MAAM;AAAA,EACpB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP;AAAA,EACA;AACF,GAA0B;AACxB,SAAO,4CAAC,UAAK,WAAW,GAAG,MAAM,MAAM,IAAI,GAAG,SAAS,OAAO,EAAE,IAAI,GAAG,SAAS,GAAI,UAAS;AAC/F;","names":[]}
|
package/dist/badge.d.cts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Fill treatment of the badge. */
|
|
4
|
+
type BadgeVariant = "subtle" | "outline";
|
|
5
|
+
/** Semantic color of the badge. */
|
|
6
|
+
type BadgeTone = "neutral" | "warning" | "violet";
|
|
7
|
+
/** Overall size — `md` (default) or a more compact `sm` for eyebrow-style tags. */
|
|
8
|
+
type BadgeSize = "sm" | "md";
|
|
9
|
+
interface BadgeProps {
|
|
10
|
+
/** Fill treatment. `subtle` = tinted background, `outline` = bordered on white. Default `subtle`. */
|
|
11
|
+
variant?: BadgeVariant;
|
|
12
|
+
/** Semantic color. `neutral` = brown, `warning` = orange, `violet` = violet. Default `neutral`. */
|
|
13
|
+
tone?: BadgeTone;
|
|
14
|
+
/** Size. `md` (12px text) or `sm` (10px text, tighter padding). Default `md`. */
|
|
15
|
+
size?: BadgeSize;
|
|
16
|
+
/** Extra classes merged after the variant/tone classes (last-wins via tailwind-merge). */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Badge label content. */
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Small pill for labels, counts, and status tags — recipient chips, "+N" overflow, "Email
|
|
23
|
+
* (fallback)" tags, "Labs". Presentational only; on clay tokens. Compose the label at the call
|
|
24
|
+
* site.
|
|
25
|
+
*/
|
|
26
|
+
declare function Badge({ variant, tone, size, className, children, }: BadgeProps): ReactNode;
|
|
27
|
+
|
|
28
|
+
export { Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant };
|
package/dist/badge.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Fill treatment of the badge. */
|
|
4
|
+
type BadgeVariant = "subtle" | "outline";
|
|
5
|
+
/** Semantic color of the badge. */
|
|
6
|
+
type BadgeTone = "neutral" | "warning" | "violet";
|
|
7
|
+
/** Overall size — `md` (default) or a more compact `sm` for eyebrow-style tags. */
|
|
8
|
+
type BadgeSize = "sm" | "md";
|
|
9
|
+
interface BadgeProps {
|
|
10
|
+
/** Fill treatment. `subtle` = tinted background, `outline` = bordered on white. Default `subtle`. */
|
|
11
|
+
variant?: BadgeVariant;
|
|
12
|
+
/** Semantic color. `neutral` = brown, `warning` = orange, `violet` = violet. Default `neutral`. */
|
|
13
|
+
tone?: BadgeTone;
|
|
14
|
+
/** Size. `md` (12px text) or `sm` (10px text, tighter padding). Default `md`. */
|
|
15
|
+
size?: BadgeSize;
|
|
16
|
+
/** Extra classes merged after the variant/tone classes (last-wins via tailwind-merge). */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Badge label content. */
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Small pill for labels, counts, and status tags — recipient chips, "+N" overflow, "Email
|
|
23
|
+
* (fallback)" tags, "Labs". Presentational only; on clay tokens. Compose the label at the call
|
|
24
|
+
* site.
|
|
25
|
+
*/
|
|
26
|
+
declare function Badge({ variant, tone, size, className, children, }: BadgeProps): ReactNode;
|
|
27
|
+
|
|
28
|
+
export { Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant };
|