@vouched-id/ui 0.0.0-stage → 0.1.1
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/Accordion.d.ts +8 -0
- package/dist/Accordion.d.ts.map +1 -0
- package/dist/Accordion.js +20 -0
- package/dist/Accordion.js.map +1 -0
- package/dist/Alert.d.ts +12 -0
- package/dist/Alert.d.ts.map +1 -0
- package/dist/Alert.js +64 -0
- package/dist/Alert.js.map +1 -0
- package/dist/AlertDialog.d.ts +90 -0
- package/dist/AlertDialog.d.ts.map +1 -0
- package/dist/AlertDialog.js +148 -0
- package/dist/AlertDialog.js.map +1 -0
- package/dist/Avatar.d.ts +43 -0
- package/dist/Avatar.d.ts.map +1 -0
- package/dist/Avatar.js +29 -0
- package/dist/Avatar.js.map +1 -0
- package/dist/Badge.d.ts +31 -0
- package/dist/Badge.d.ts.map +1 -0
- package/dist/Badge.js +22 -0
- package/dist/Badge.js.map +1 -0
- package/dist/Banner.d.ts +57 -0
- package/dist/Banner.d.ts.map +1 -0
- package/dist/Banner.js +30 -0
- package/dist/Banner.js.map +1 -0
- package/dist/Button.d.ts +56 -0
- package/dist/Button.d.ts.map +1 -0
- package/dist/Button.js +106 -0
- package/dist/Button.js.map +1 -0
- package/dist/Card.d.ts +79 -0
- package/dist/Card.d.ts.map +1 -0
- package/dist/Card.js +50 -0
- package/dist/Card.js.map +1 -0
- package/dist/Chart.d.ts +63 -0
- package/dist/Chart.d.ts.map +1 -0
- package/dist/Chart.js +120 -0
- package/dist/Chart.js.map +1 -0
- package/dist/Checkbox.d.ts +4 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/Checkbox.js +10 -0
- package/dist/Checkbox.js.map +1 -0
- package/dist/CodeBlock.d.ts +101 -0
- package/dist/CodeBlock.d.ts.map +1 -0
- package/dist/CodeBlock.js +99 -0
- package/dist/CodeBlock.js.map +1 -0
- package/dist/Collapsible.d.ts +6 -0
- package/dist/Collapsible.d.ts.map +1 -0
- package/dist/Collapsible.js +14 -0
- package/dist/Collapsible.js.map +1 -0
- package/dist/DataTable.d.ts +59 -0
- package/dist/DataTable.d.ts.map +1 -0
- package/dist/DataTable.js +162 -0
- package/dist/DataTable.js.map +1 -0
- package/dist/Dialog.d.ts +71 -0
- package/dist/Dialog.d.ts.map +1 -0
- package/dist/Dialog.js +185 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/DropdownMenu.d.ts +82 -0
- package/dist/DropdownMenu.d.ts.map +1 -0
- package/dist/DropdownMenu.js +111 -0
- package/dist/DropdownMenu.js.map +1 -0
- package/dist/EditorialHeading.d.ts +42 -0
- package/dist/EditorialHeading.d.ts.map +1 -0
- package/dist/EditorialHeading.js +36 -0
- package/dist/EditorialHeading.js.map +1 -0
- package/dist/EmptyState.d.ts +40 -0
- package/dist/EmptyState.d.ts.map +1 -0
- package/dist/EmptyState.js +7 -0
- package/dist/EmptyState.js.map +1 -0
- package/dist/Eyebrow.d.ts +27 -0
- package/dist/Eyebrow.d.ts.map +1 -0
- package/dist/Eyebrow.js +23 -0
- package/dist/Eyebrow.js.map +1 -0
- package/dist/Field.d.ts +33 -0
- package/dist/Field.d.ts.map +1 -0
- package/dist/Field.js +26 -0
- package/dist/Field.js.map +1 -0
- package/dist/HoverCard.d.ts +7 -0
- package/dist/HoverCard.d.ts.map +1 -0
- package/dist/HoverCard.js +17 -0
- package/dist/HoverCard.js.map +1 -0
- package/dist/Input.d.ts +20 -0
- package/dist/Input.d.ts.map +1 -0
- package/dist/Input.js +17 -0
- package/dist/Input.js.map +1 -0
- package/dist/InstallCommand.d.ts +48 -0
- package/dist/InstallCommand.d.ts.map +1 -0
- package/dist/InstallCommand.js +60 -0
- package/dist/InstallCommand.js.map +1 -0
- package/dist/Kbd.d.ts +23 -0
- package/dist/Kbd.d.ts.map +1 -0
- package/dist/Kbd.js +7 -0
- package/dist/Kbd.js.map +1 -0
- package/dist/Label.d.ts +5 -0
- package/dist/Label.d.ts.map +1 -0
- package/dist/Label.js +9 -0
- package/dist/Label.js.map +1 -0
- package/dist/Popover.d.ts +41 -0
- package/dist/Popover.d.ts.map +1 -0
- package/dist/Popover.js +27 -0
- package/dist/Popover.js.map +1 -0
- package/dist/Progress.d.ts +6 -0
- package/dist/Progress.d.ts.map +1 -0
- package/dist/Progress.js +9 -0
- package/dist/Progress.js.map +1 -0
- package/dist/RadioGroup.d.ts +5 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RadioGroup.js +15 -0
- package/dist/RadioGroup.js.map +1 -0
- package/dist/ScrollArea.d.ts +32 -0
- package/dist/ScrollArea.d.ts.map +1 -0
- package/dist/ScrollArea.js +13 -0
- package/dist/ScrollArea.js.map +1 -0
- package/dist/SegmentedControl.d.ts +37 -0
- package/dist/SegmentedControl.d.ts.map +1 -0
- package/dist/SegmentedControl.js +85 -0
- package/dist/SegmentedControl.js.map +1 -0
- package/dist/Select.d.ts +21 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/Select.js +52 -0
- package/dist/Select.js.map +1 -0
- package/dist/Separator.d.ts +4 -0
- package/dist/Separator.d.ts.map +1 -0
- package/dist/Separator.js +9 -0
- package/dist/Separator.js.map +1 -0
- package/dist/Sheet.d.ts +71 -0
- package/dist/Sheet.d.ts.map +1 -0
- package/dist/Sheet.js +173 -0
- package/dist/Sheet.js.map +1 -0
- package/dist/Skeleton.d.ts +26 -0
- package/dist/Skeleton.d.ts.map +1 -0
- package/dist/Skeleton.js +9 -0
- package/dist/Skeleton.js.map +1 -0
- package/dist/Slider.d.ts +5 -0
- package/dist/Slider.d.ts.map +1 -0
- package/dist/Slider.js +12 -0
- package/dist/Slider.js.map +1 -0
- package/dist/StatusDot.d.ts +29 -0
- package/dist/StatusDot.d.ts.map +1 -0
- package/dist/StatusDot.js +55 -0
- package/dist/StatusDot.js.map +1 -0
- package/dist/StatusText.d.ts +15 -0
- package/dist/StatusText.d.ts.map +1 -0
- package/dist/StatusText.js +49 -0
- package/dist/StatusText.js.map +1 -0
- package/dist/Switch.d.ts +47 -0
- package/dist/Switch.d.ts.map +1 -0
- package/dist/Switch.js +17 -0
- package/dist/Switch.js.map +1 -0
- package/dist/Table.d.ts +22 -0
- package/dist/Table.d.ts.map +1 -0
- package/dist/Table.js +42 -0
- package/dist/Table.js.map +1 -0
- package/dist/Tabs.d.ts +96 -0
- package/dist/Tabs.d.ts.map +1 -0
- package/dist/Tabs.js +319 -0
- package/dist/Tabs.js.map +1 -0
- package/dist/Tag.d.ts +19 -0
- package/dist/Tag.d.ts.map +1 -0
- package/dist/Tag.js +50 -0
- package/dist/Tag.js.map +1 -0
- package/dist/Textarea.d.ts +32 -0
- package/dist/Textarea.d.ts.map +1 -0
- package/dist/Textarea.js +11 -0
- package/dist/Textarea.js.map +1 -0
- package/dist/Toast.d.ts +47 -0
- package/dist/Toast.d.ts.map +1 -0
- package/dist/Toast.js +110 -0
- package/dist/Toast.js.map +1 -0
- package/dist/ToggleGroup.d.ts +48 -0
- package/dist/ToggleGroup.d.ts.map +1 -0
- package/dist/ToggleGroup.js +27 -0
- package/dist/ToggleGroup.js.map +1 -0
- package/dist/Tooltip.d.ts +8 -0
- package/dist/Tooltip.d.ts.map +1 -0
- package/dist/Tooltip.js +81 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/VouchedLogo.d.ts +31 -0
- package/dist/VouchedLogo.d.ts.map +1 -0
- package/dist/VouchedLogo.js +215 -0
- package/dist/VouchedLogo.js.map +1 -0
- package/dist/_code-copy-button.d.ts +9 -0
- package/dist/_code-copy-button.d.ts.map +1 -0
- package/dist/_code-copy-button.js +72 -0
- package/dist/_code-copy-button.js.map +1 -0
- package/dist/_code-syntax.d.ts +81 -0
- package/dist/_code-syntax.d.ts.map +1 -0
- package/dist/_code-syntax.js +293 -0
- package/dist/_code-syntax.js.map +1 -0
- package/dist/_status-icons.d.ts +22 -0
- package/dist/_status-icons.d.ts.map +1 -0
- package/dist/_status-icons.js +40 -0
- package/dist/_status-icons.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/format-numbers.d.ts +51 -0
- package/dist/lib/format-numbers.d.ts.map +1 -0
- package/dist/lib/format-numbers.js +158 -0
- package/dist/lib/format-numbers.js.map +1 -0
- package/dist/lib/utils.d.ts +20 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +23 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/public.d.ts +62 -0
- package/dist/public.d.ts.map +1 -0
- package/dist/public.js +66 -0
- package/dist/public.js.map +1 -0
- package/dist/theme-scope.d.ts +55 -0
- package/dist/theme-scope.d.ts.map +1 -0
- package/dist/theme-scope.js +90 -0
- package/dist/theme-scope.js.map +1 -0
- package/dist/tokens.generated.d.ts +335 -0
- package/dist/tokens.generated.d.ts.map +1 -0
- package/dist/tokens.generated.js +349 -0
- package/dist/tokens.generated.js.map +1 -0
- package/package.json +100 -3
- package/styles/README.md +106 -0
- package/styles/base.css +301 -0
- package/styles/canvas.css +147 -0
- package/styles/colors_and_type.css +136 -0
- package/styles/component-contracts.css +471 -0
- package/styles/fonts.css +28 -0
- package/styles/package.css +6 -0
- package/styles/primitive-skins.css +104 -0
- package/styles/semantic-bindings.css +119 -0
- package/styles/shell.css +50 -0
- package/styles/source.css +4 -0
- package/styles/tailwind-bridge.css +255 -0
- package/styles/theme.css +15 -0
- package/styles/tokens.css +1281 -0
- package/styles/vouched-logo.css +336 -0
- package/README.md +0 -3
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkpoint · code syntax (internal)
|
|
3
|
+
*
|
|
4
|
+
* Tokenizes plain code for {@link CodeBlock} and classifies every piece into
|
|
5
|
+
* one of the six CodeTokenKind values. It never produces a color: shiki runs
|
|
6
|
+
* against a theme with no settings, and only the TextMate scope stack of
|
|
7
|
+
* each piece is read. The block then renders a CodeToken per kind, so every
|
|
8
|
+
* visible color comes from the `--code-token-*` tokens, the one place the
|
|
9
|
+
* palette is defined (a baked hex theme like the chat block's restates it).
|
|
10
|
+
*
|
|
11
|
+
* Shiki merges neighbouring tokens that resolve to the same color, and with
|
|
12
|
+
* a colorless theme that is nearly the whole line, so the pieces come from
|
|
13
|
+
* each token's `explanation` entries instead, one per scope run.
|
|
14
|
+
*
|
|
15
|
+
* Runtime shape follows components/features/chat/code-block/highlighter.ts:
|
|
16
|
+
* one lazily created highlighter, grammars loaded on first use, a capped
|
|
17
|
+
* result cache and de-duplicated in-flight work. The JavaScript regex engine
|
|
18
|
+
* keeps WASM out of the bundle and works under jsdom.
|
|
19
|
+
*
|
|
20
|
+
* The only static shiki imports are types. The @checkpoint barrel re-exports
|
|
21
|
+
* CodeBlock into hundreds of client bundles, so anything this module pulls
|
|
22
|
+
* in eagerly is paid on every one of those pages; the tokenizer, the engine
|
|
23
|
+
* and each grammar arrive through import() when a block first asks for
|
|
24
|
+
* color. src/__tests__/code-block-syntax.test.ts guards that.
|
|
25
|
+
*
|
|
26
|
+
* Prefixed with `_` as a private internal of CodeBlock, shipped beside it
|
|
27
|
+
* in the registry and not re-exported from the barrel.
|
|
28
|
+
*/
|
|
29
|
+
export type CodeTokenKind = 'keyword' | 'string' | 'number' | 'comment' | 'property' | 'punctuation';
|
|
30
|
+
/** A run of source text and the kind it renders as; null renders uncolored. */
|
|
31
|
+
export interface CodeSyntaxPiece {
|
|
32
|
+
content: string;
|
|
33
|
+
kind: CodeTokenKind | null;
|
|
34
|
+
}
|
|
35
|
+
/** One source line. Joining pieces, then lines with '\n', rebuilds the source exactly. */
|
|
36
|
+
export type CodeSyntaxLine = CodeSyntaxPiece[];
|
|
37
|
+
/**
|
|
38
|
+
* Classify a root-first TextMate scope stack. Walks from the leaf up so the
|
|
39
|
+
* most specific scope decides (a JSON key is `string.json` by ancestry but
|
|
40
|
+
* `support.type.property-name.json` at the leaf).
|
|
41
|
+
*
|
|
42
|
+
* @example kindForScopes(['source.ts', 'keyword.operator.assignment.ts']) // 'punctuation'
|
|
43
|
+
* @example kindForScopes(['source.shell', 'string.unquoted.argument.shell']) // null
|
|
44
|
+
*/
|
|
45
|
+
export declare function kindForScopes(scopes: readonly string[]): CodeTokenKind | null;
|
|
46
|
+
/**
|
|
47
|
+
* The language ids CodeBlock colors. An explicit list, not shiki's
|
|
48
|
+
* `bundledLanguages`: that map holds a loader for every grammar shiki
|
|
49
|
+
* ships, and importing it statically put all of them into each bundle
|
|
50
|
+
* that reaches the barrel. Anything off this list (cedar, rust, text)
|
|
51
|
+
* renders as plain text. Each alias is one the grammar itself registers
|
|
52
|
+
* in shiki, so a loaded grammar answers to every id listed for it.
|
|
53
|
+
*/
|
|
54
|
+
export type SupportedLanguage = 'bash' | 'sh' | 'shell' | 'shellscript' | 'zsh' | 'json' | 'jsonc' | 'typescript' | 'ts' | 'tsx' | 'javascript' | 'js' | 'jsx' | 'http' | 'yaml' | 'yml' | 'html' | 'css' | 'sql' | 'python' | 'py' | 'diff' | 'csharp' | 'hcl' | 'xml';
|
|
55
|
+
/**
|
|
56
|
+
* Whether CodeBlock colors this language id or alias.
|
|
57
|
+
*
|
|
58
|
+
* @example isHighlightable('bash') // true
|
|
59
|
+
* @example isHighlightable('cedar') // false, no shiki grammar
|
|
60
|
+
* @example isHighlightable('rust') // false, shiki has one but it is not allowlisted
|
|
61
|
+
*/
|
|
62
|
+
export declare function isHighlightable(language: string | undefined): language is SupportedLanguage;
|
|
63
|
+
/**
|
|
64
|
+
* Tokenizing is linear in the code length and runs on the main thread:
|
|
65
|
+
* about 26k characters of TypeScript measured near 100ms, so longer code
|
|
66
|
+
* stays plain rather than risk a visible stall.
|
|
67
|
+
*/
|
|
68
|
+
export declare const MAX_HIGHLIGHT_LENGTH = 10000;
|
|
69
|
+
/**
|
|
70
|
+
* Whether CodeBlock should colorize this code at all. A plain boolean, not a
|
|
71
|
+
* type guard: it also refuses a valid language when the code is too long,
|
|
72
|
+
* so a `false` says nothing about the language.
|
|
73
|
+
*/
|
|
74
|
+
export declare function canHighlight(code: string, language: string | undefined): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Tokenize `code` as `language` into kind-classified lines. Resolves from
|
|
77
|
+
* the cache when this exact code was colorized before. Rejects when the
|
|
78
|
+
* language is not supported or shiki fails; callers keep the plain text.
|
|
79
|
+
*/
|
|
80
|
+
export declare function highlightCode(code: string, language: string): Promise<CodeSyntaxLine[]>;
|
|
81
|
+
//# sourceMappingURL=_code-syntax.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_code-syntax.d.ts","sourceRoot":"","sources":["../src/_code-syntax.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,MAAM,MAAM,aAAa,GACvB,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAE3E,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;CAC5B;AAED,0FAA0F;AAC1F,MAAM,MAAM,cAAc,GAAG,eAAe,EAAE,CAAC;AA0C/C;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,aAAa,GAAG,IAAI,CAO7E;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,IAAI,GACJ,OAAO,GACP,aAAa,GACb,KAAK,GACL,MAAM,GACN,OAAO,GACP,YAAY,GACZ,IAAI,GACJ,KAAK,GACL,YAAY,GACZ,IAAI,GACJ,KAAK,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,MAAM,GACN,KAAK,GACL,KAAK,GACL,QAAQ,GACR,IAAI,GACJ,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,CAAC;AA8EV;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,IAAI,iBAAiB,CAE3F;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEhF;AAwJD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CA4BvF"}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Most specific first, because one scope can match several prefixes
|
|
3
|
+
* (keyword.operator.assignment is both keyword.operator and keyword). A
|
|
4
|
+
* null kind is a deliberate "leave uncolored" that also stops the walk up
|
|
5
|
+
* to ancestor scopes.
|
|
6
|
+
*/
|
|
7
|
+
const SCOPE_RULES = [
|
|
8
|
+
['comment', 'comment'],
|
|
9
|
+
['punctuation.definition.comment', 'comment'],
|
|
10
|
+
['support.type.property-name', 'property'],
|
|
11
|
+
['punctuation.support.type.property-name', 'property'],
|
|
12
|
+
['meta.object-literal.key', 'property'],
|
|
13
|
+
['variable.other.property', 'property'],
|
|
14
|
+
// A bare shell argument (`git clone`, `-v`) is scoped as a string, but
|
|
15
|
+
// painting every argument as a string drowns the command line.
|
|
16
|
+
['string.unquoted', null],
|
|
17
|
+
['punctuation.definition.string', 'string'],
|
|
18
|
+
['string', 'string'],
|
|
19
|
+
['constant.numeric', 'number'],
|
|
20
|
+
['constant.language', 'number'],
|
|
21
|
+
// Word operators read as keywords; symbol operators read as punctuation.
|
|
22
|
+
['keyword.operator.new', 'keyword'],
|
|
23
|
+
['keyword.operator.expression', 'keyword'],
|
|
24
|
+
['keyword.operator.word', 'keyword'],
|
|
25
|
+
['keyword.operator', 'punctuation'],
|
|
26
|
+
['keyword', 'keyword'],
|
|
27
|
+
['storage.type', 'keyword'],
|
|
28
|
+
['storage.modifier', 'keyword'],
|
|
29
|
+
['entity.name.command', 'keyword'],
|
|
30
|
+
['support.function.builtin', 'keyword'],
|
|
31
|
+
['punctuation', 'punctuation'],
|
|
32
|
+
['meta.brace', 'punctuation'],
|
|
33
|
+
['meta.delimiter', 'punctuation'],
|
|
34
|
+
];
|
|
35
|
+
/** TextMate selector matching: a prefix only counts on a dot boundary. */
|
|
36
|
+
function scopeMatches(scope, prefix) {
|
|
37
|
+
return scope === prefix || scope.startsWith(`${prefix}.`);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Classify a root-first TextMate scope stack. Walks from the leaf up so the
|
|
41
|
+
* most specific scope decides (a JSON key is `string.json` by ancestry but
|
|
42
|
+
* `support.type.property-name.json` at the leaf).
|
|
43
|
+
*
|
|
44
|
+
* @example kindForScopes(['source.ts', 'keyword.operator.assignment.ts']) // 'punctuation'
|
|
45
|
+
* @example kindForScopes(['source.shell', 'string.unquoted.argument.shell']) // null
|
|
46
|
+
*/
|
|
47
|
+
export function kindForScopes(scopes) {
|
|
48
|
+
for (let index = scopes.length - 1; index >= 0; index--) {
|
|
49
|
+
const scope = scopes[index];
|
|
50
|
+
const rule = SCOPE_RULES.find(([prefix]) => scopeMatches(scope, prefix));
|
|
51
|
+
if (rule)
|
|
52
|
+
return rule[1];
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
const GRAMMAR_FOR_LANGUAGE = {
|
|
57
|
+
bash: 'shellscript',
|
|
58
|
+
sh: 'shellscript',
|
|
59
|
+
shell: 'shellscript',
|
|
60
|
+
shellscript: 'shellscript',
|
|
61
|
+
zsh: 'shellscript',
|
|
62
|
+
json: 'json',
|
|
63
|
+
jsonc: 'jsonc',
|
|
64
|
+
typescript: 'typescript',
|
|
65
|
+
ts: 'typescript',
|
|
66
|
+
tsx: 'tsx',
|
|
67
|
+
javascript: 'javascript',
|
|
68
|
+
js: 'javascript',
|
|
69
|
+
jsx: 'jsx',
|
|
70
|
+
http: 'http',
|
|
71
|
+
yaml: 'yaml',
|
|
72
|
+
yml: 'yaml',
|
|
73
|
+
html: 'html',
|
|
74
|
+
css: 'css',
|
|
75
|
+
sql: 'sql',
|
|
76
|
+
python: 'python',
|
|
77
|
+
py: 'python',
|
|
78
|
+
diff: 'diff',
|
|
79
|
+
csharp: 'csharp',
|
|
80
|
+
hcl: 'hcl',
|
|
81
|
+
xml: 'xml',
|
|
82
|
+
};
|
|
83
|
+
// A Set, not an `in` check on the record: `'constructor' in {}` is true.
|
|
84
|
+
const SUPPORTED_LANGUAGES = new Set(Object.keys(GRAMMAR_FOR_LANGUAGE));
|
|
85
|
+
/**
|
|
86
|
+
* One literal import() per grammar, so a bundler emits a chunk for each
|
|
87
|
+
* allowlisted grammar (plus the ones it embeds, such as html's css and
|
|
88
|
+
* javascript) and nothing for the rest of shiki's catalog.
|
|
89
|
+
*/
|
|
90
|
+
const GRAMMAR_LOADERS = {
|
|
91
|
+
shellscript: () => import('shiki/langs/shellscript.mjs'),
|
|
92
|
+
json: () => import('shiki/langs/json.mjs'),
|
|
93
|
+
jsonc: () => import('shiki/langs/jsonc.mjs'),
|
|
94
|
+
typescript: () => import('shiki/langs/typescript.mjs'),
|
|
95
|
+
tsx: () => import('shiki/langs/tsx.mjs'),
|
|
96
|
+
javascript: () => import('shiki/langs/javascript.mjs'),
|
|
97
|
+
jsx: () => import('shiki/langs/jsx.mjs'),
|
|
98
|
+
http: () => import('shiki/langs/http.mjs'),
|
|
99
|
+
yaml: () => import('shiki/langs/yaml.mjs'),
|
|
100
|
+
html: () => import('shiki/langs/html.mjs'),
|
|
101
|
+
css: () => import('shiki/langs/css.mjs'),
|
|
102
|
+
sql: () => import('shiki/langs/sql.mjs'),
|
|
103
|
+
python: () => import('shiki/langs/python.mjs'),
|
|
104
|
+
diff: () => import('shiki/langs/diff.mjs'),
|
|
105
|
+
csharp: () => import('shiki/langs/csharp.mjs'),
|
|
106
|
+
hcl: () => import('shiki/langs/hcl.mjs'),
|
|
107
|
+
xml: () => import('shiki/langs/xml.mjs'),
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Whether CodeBlock colors this language id or alias.
|
|
111
|
+
*
|
|
112
|
+
* @example isHighlightable('bash') // true
|
|
113
|
+
* @example isHighlightable('cedar') // false, no shiki grammar
|
|
114
|
+
* @example isHighlightable('rust') // false, shiki has one but it is not allowlisted
|
|
115
|
+
*/
|
|
116
|
+
export function isHighlightable(language) {
|
|
117
|
+
return typeof language === 'string' && SUPPORTED_LANGUAGES.has(language);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Tokenizing is linear in the code length and runs on the main thread:
|
|
121
|
+
* about 26k characters of TypeScript measured near 100ms, so longer code
|
|
122
|
+
* stays plain rather than risk a visible stall.
|
|
123
|
+
*/
|
|
124
|
+
export const MAX_HIGHLIGHT_LENGTH = 10_000;
|
|
125
|
+
/**
|
|
126
|
+
* Whether CodeBlock should colorize this code at all. A plain boolean, not a
|
|
127
|
+
* type guard: it also refuses a valid language when the code is too long,
|
|
128
|
+
* so a `false` says nothing about the language.
|
|
129
|
+
*/
|
|
130
|
+
export function canHighlight(code, language) {
|
|
131
|
+
return code.length <= MAX_HIGHLIGHT_LENGTH && isHighlightable(language);
|
|
132
|
+
}
|
|
133
|
+
const SCOPE_THEME_NAME = 'checkpoint-scopes';
|
|
134
|
+
// Deliberately empty: this theme exists only because shiki requires one.
|
|
135
|
+
const SCOPE_THEME = {
|
|
136
|
+
name: SCOPE_THEME_NAME,
|
|
137
|
+
type: 'dark',
|
|
138
|
+
settings: [],
|
|
139
|
+
};
|
|
140
|
+
let highlighterPromise = null;
|
|
141
|
+
// Keyed by grammar, so aliases of one grammar (bash, sh, zsh) share a load.
|
|
142
|
+
const grammarLoads = new Map();
|
|
143
|
+
function getHighlighter() {
|
|
144
|
+
if (!highlighterPromise) {
|
|
145
|
+
// Imported on first use so pages that never colorize a block do not
|
|
146
|
+
// pay for the tokenizer in their initial bundle.
|
|
147
|
+
highlighterPromise = Promise.all([import('shiki/core'), import('shiki/engine/javascript')])
|
|
148
|
+
.then(([{ createHighlighterCore }, { createJavaScriptRegexEngine }]) => createHighlighterCore({
|
|
149
|
+
themes: [SCOPE_THEME],
|
|
150
|
+
langs: [],
|
|
151
|
+
engine: createJavaScriptRegexEngine(),
|
|
152
|
+
}))
|
|
153
|
+
.catch((error) => {
|
|
154
|
+
// Forget the failure so a later block can retry.
|
|
155
|
+
highlighterPromise = null;
|
|
156
|
+
throw error;
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
return highlighterPromise;
|
|
160
|
+
}
|
|
161
|
+
function loadGrammar(highlighter, language) {
|
|
162
|
+
const grammar = GRAMMAR_FOR_LANGUAGE[language];
|
|
163
|
+
let load = grammarLoads.get(grammar);
|
|
164
|
+
if (!load) {
|
|
165
|
+
load = highlighter.loadLanguage(GRAMMAR_LOADERS[grammar]).catch((error) => {
|
|
166
|
+
// Forget the failure (a chunk that did not load) so a later block can retry.
|
|
167
|
+
grammarLoads.delete(grammar);
|
|
168
|
+
throw error;
|
|
169
|
+
});
|
|
170
|
+
grammarLoads.set(grammar, load);
|
|
171
|
+
}
|
|
172
|
+
return load;
|
|
173
|
+
}
|
|
174
|
+
function piecesFromToken(token) {
|
|
175
|
+
const explanation = token.explanation ?? [];
|
|
176
|
+
const explained = explanation.map((part) => part.content).join('');
|
|
177
|
+
// Explanation runs are expected to tile the token exactly; if a shiki
|
|
178
|
+
// change ever breaks that, keep the text and drop the color.
|
|
179
|
+
if (explained !== token.content)
|
|
180
|
+
return [{ content: token.content, kind: null }];
|
|
181
|
+
return explanation.map((part) => ({
|
|
182
|
+
content: part.content,
|
|
183
|
+
kind: kindForScopes(part.scopes.map((scope) => scope.scopeName)),
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
/** Fewer DOM nodes: neighbouring runs of the same kind render as one span. */
|
|
187
|
+
function coalesce(pieces) {
|
|
188
|
+
const merged = [];
|
|
189
|
+
for (const piece of pieces) {
|
|
190
|
+
if (piece.content === '')
|
|
191
|
+
continue;
|
|
192
|
+
const previous = merged.at(-1);
|
|
193
|
+
if (previous && previous.kind === piece.kind) {
|
|
194
|
+
merged[merged.length - 1] = { content: previous.content + piece.content, kind: piece.kind };
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
merged.push(piece);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return merged;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Shiki splits on CRLF and drops the CR, and any other drift would make the
|
|
204
|
+
* colored block read differently from its copy payload. Every line is
|
|
205
|
+
* checked against the source and falls back to uncolored text if it differs.
|
|
206
|
+
*/
|
|
207
|
+
function alignToSource(code, tokenLines) {
|
|
208
|
+
const sourceLines = code.split('\n');
|
|
209
|
+
const plain = (source) => source ? [{ content: source, kind: null }] : [];
|
|
210
|
+
if (tokenLines.length !== sourceLines.length)
|
|
211
|
+
return sourceLines.map(plain);
|
|
212
|
+
return sourceLines.map((source, index) => {
|
|
213
|
+
const pieces = tokenLines[index];
|
|
214
|
+
const text = pieces.map((piece) => piece.content).join('');
|
|
215
|
+
if (text === source)
|
|
216
|
+
return pieces;
|
|
217
|
+
if (`${text}\r` === source)
|
|
218
|
+
return coalesce([...pieces, { content: '\r', kind: null }]);
|
|
219
|
+
return plain(source);
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
async function tokenize(code, language) {
|
|
223
|
+
const highlighter = await getHighlighter();
|
|
224
|
+
await loadGrammar(highlighter, language);
|
|
225
|
+
const { tokens } = highlighter.codeToTokens(code, {
|
|
226
|
+
lang: language,
|
|
227
|
+
theme: SCOPE_THEME_NAME,
|
|
228
|
+
includeExplanation: 'scopeName',
|
|
229
|
+
});
|
|
230
|
+
const tokenLines = tokens.map((line) => coalesce(line.flatMap(piecesFromToken)));
|
|
231
|
+
return alignToSource(code, tokenLines);
|
|
232
|
+
}
|
|
233
|
+
const RESULT_CACHE_MAX = 200;
|
|
234
|
+
const resultCache = new Map();
|
|
235
|
+
// Every caller awaiting the same (code, language) shares one promise, so a
|
|
236
|
+
// page with repeated snippets tokenizes each only once.
|
|
237
|
+
const inFlight = new Map();
|
|
238
|
+
function hashCode(text) {
|
|
239
|
+
let hash = 0;
|
|
240
|
+
for (let index = 0; index < text.length; index++) {
|
|
241
|
+
hash = (hash * 31 + text.charCodeAt(index)) | 0;
|
|
242
|
+
}
|
|
243
|
+
return hash >>> 0;
|
|
244
|
+
}
|
|
245
|
+
function cacheKey(code, language) {
|
|
246
|
+
return `${language}:${code.length}:${hashCode(code)}`;
|
|
247
|
+
}
|
|
248
|
+
function readCache(key, code) {
|
|
249
|
+
const entry = resultCache.get(key);
|
|
250
|
+
// The stored source guards against a hash collision rendering another
|
|
251
|
+
// snippet's tokens.
|
|
252
|
+
return entry && entry.code === code ? entry.lines : undefined;
|
|
253
|
+
}
|
|
254
|
+
function writeCache(key, code, lines) {
|
|
255
|
+
if (resultCache.size >= RESULT_CACHE_MAX) {
|
|
256
|
+
resultCache.delete(resultCache.keys().next().value);
|
|
257
|
+
}
|
|
258
|
+
resultCache.set(key, { code, lines });
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Tokenize `code` as `language` into kind-classified lines. Resolves from
|
|
262
|
+
* the cache when this exact code was colorized before. Rejects when the
|
|
263
|
+
* language is not supported or shiki fails; callers keep the plain text.
|
|
264
|
+
*/
|
|
265
|
+
export function highlightCode(code, language) {
|
|
266
|
+
if (!isHighlightable(language)) {
|
|
267
|
+
return Promise.reject(new Error(`CodeBlock loads no grammar for "${language}"`));
|
|
268
|
+
}
|
|
269
|
+
const key = cacheKey(code, language);
|
|
270
|
+
const cached = readCache(key, code);
|
|
271
|
+
if (cached)
|
|
272
|
+
return Promise.resolve(cached);
|
|
273
|
+
const pending = inFlight.get(key);
|
|
274
|
+
if (pending && pending.code === code)
|
|
275
|
+
return pending.task;
|
|
276
|
+
const task = tokenize(code, language).then((lines) => {
|
|
277
|
+
writeCache(key, code, lines);
|
|
278
|
+
return lines;
|
|
279
|
+
});
|
|
280
|
+
// A colliding key already in flight keeps its slot; this call just runs
|
|
281
|
+
// without sharing.
|
|
282
|
+
if (pending)
|
|
283
|
+
return task;
|
|
284
|
+
inFlight.set(key, { code, task });
|
|
285
|
+
const release = () => {
|
|
286
|
+
inFlight.delete(key);
|
|
287
|
+
};
|
|
288
|
+
// Settles the bookkeeping on both outcomes without creating a second,
|
|
289
|
+
// unobserved rejection: the caller still receives `task` itself.
|
|
290
|
+
task.then(release, release);
|
|
291
|
+
return task;
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=_code-syntax.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_code-syntax.js","sourceRoot":"","sources":["../src/_code-syntax.ts"],"names":[],"mappings":"AA2CA;;;;;GAKG;AACH,MAAM,WAAW,GAAyE;IACxF,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,gCAAgC,EAAE,SAAS,CAAC;IAC7C,CAAC,4BAA4B,EAAE,UAAU,CAAC;IAC1C,CAAC,wCAAwC,EAAE,UAAU,CAAC;IACtD,CAAC,yBAAyB,EAAE,UAAU,CAAC;IACvC,CAAC,yBAAyB,EAAE,UAAU,CAAC;IACvC,uEAAuE;IACvE,+DAA+D;IAC/D,CAAC,iBAAiB,EAAE,IAAI,CAAC;IACzB,CAAC,+BAA+B,EAAE,QAAQ,CAAC;IAC3C,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC9B,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAC/B,yEAAyE;IACzE,CAAC,sBAAsB,EAAE,SAAS,CAAC;IACnC,CAAC,6BAA6B,EAAE,SAAS,CAAC;IAC1C,CAAC,uBAAuB,EAAE,SAAS,CAAC;IACpC,CAAC,kBAAkB,EAAE,aAAa,CAAC;IACnC,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,C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|
1
|
+
/**
|
|
2
|
+
* Shared status glyphs for the status-bearing primitives (Toast,
|
|
3
|
+
* Banner, future cp-primitives that surface allow / deny / warn /
|
|
4
|
+
* info state).
|
|
5
|
+
*
|
|
6
|
+
* Single source so all four icons stay byte-identical across the
|
|
7
|
+
* codebase — bugbot caught earlier that Toast.tsx and Banner.tsx
|
|
8
|
+
* had byte-for-byte duplicate SVG bodies. Extracted here so any
|
|
9
|
+
* future glyph tuning lands in one place.
|
|
10
|
+
*
|
|
11
|
+
* All four are feather-style, stroke-only, 24×24 viewBox,
|
|
12
|
+
* `currentColor` strokes — the consuming primitive supplies the
|
|
13
|
+
* status hue via the surrounding text color.
|
|
14
|
+
*
|
|
15
|
+
* Prefixed with `_` so the file is treated as a private internal —
|
|
16
|
+
* not re-exported from the barrel.
|
|
17
|
+
*/
|
|
18
|
+
export declare function InfoGlyph(): import("react").JSX.Element;
|
|
19
|
+
export declare function WarnGlyph(): import("react").JSX.Element;
|
|
20
|
+
export declare function DenyGlyph(): import("react").JSX.Element;
|
|
21
|
+
export declare function SuccessGlyph(): import("react").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=_status-icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_status-icons.d.ts","sourceRoot":"","sources":["../src/_status-icons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAYH,wBAAgB,SAAS,gCAQxB;AAED,wBAAgB,SAAS,gCAQxB;AAED,wBAAgB,SAAS,gCAQxB;AAED,wBAAgB,YAAY,gCAM3B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Shared status glyphs for the status-bearing primitives (Toast,
|
|
4
|
+
* Banner, future cp-primitives that surface allow / deny / warn /
|
|
5
|
+
* info state).
|
|
6
|
+
*
|
|
7
|
+
* Single source so all four icons stay byte-identical across the
|
|
8
|
+
* codebase — bugbot caught earlier that Toast.tsx and Banner.tsx
|
|
9
|
+
* had byte-for-byte duplicate SVG bodies. Extracted here so any
|
|
10
|
+
* future glyph tuning lands in one place.
|
|
11
|
+
*
|
|
12
|
+
* All four are feather-style, stroke-only, 24×24 viewBox,
|
|
13
|
+
* `currentColor` strokes — the consuming primitive supplies the
|
|
14
|
+
* status hue via the surrounding text color.
|
|
15
|
+
*
|
|
16
|
+
* Prefixed with `_` so the file is treated as a private internal —
|
|
17
|
+
* not re-exported from the barrel.
|
|
18
|
+
*/
|
|
19
|
+
const common = {
|
|
20
|
+
viewBox: '0 0 24 24',
|
|
21
|
+
fill: 'none',
|
|
22
|
+
stroke: 'currentColor',
|
|
23
|
+
strokeWidth: 2,
|
|
24
|
+
strokeLinecap: 'round',
|
|
25
|
+
strokeLinejoin: 'round',
|
|
26
|
+
'aria-hidden': true,
|
|
27
|
+
};
|
|
28
|
+
export function InfoGlyph() {
|
|
29
|
+
return (_jsxs("svg", { ...common, children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" }), _jsx("line", { x1: "12", y1: "12", x2: "12", y2: "16" })] }));
|
|
30
|
+
}
|
|
31
|
+
export function WarnGlyph() {
|
|
32
|
+
return (_jsxs("svg", { ...common, children: [_jsx("path", { d: "M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }), _jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), _jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })] }));
|
|
33
|
+
}
|
|
34
|
+
export function DenyGlyph() {
|
|
35
|
+
return (_jsxs("svg", { ...common, children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), _jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" })] }));
|
|
36
|
+
}
|
|
37
|
+
export function SuccessGlyph() {
|
|
38
|
+
return (_jsx("svg", { ...common, children: _jsx("polyline", { points: "20 6 9 17 4 12" }) }));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=_status-icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_status-icons.js","sourceRoot":"","sources":["../src/_status-icons.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,WAAW;IACpB,IAAI,EAAE,MAAe;IACrB,MAAM,EAAE,cAAc;IACtB,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,OAAgB;IAC/B,cAAc,EAAE,OAAgB;IAChC,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,UAAU,SAAS;IACvB,OAAO,CACL,kBAAS,MAAM,aACb,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,GAAG,EACjC,eAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,OAAO,EAAC,EAAE,EAAC,GAAG,GAAG,EACzC,eAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,GAAG,IACpC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,OAAO,CACL,kBAAS,MAAM,aACb,eAAM,CAAC,EAAC,0FAA0F,GAAG,EACrG,eAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,GAAG,EACvC,eAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,OAAO,EAAC,EAAE,EAAC,IAAI,GAAG,IACvC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,OAAO,CACL,kBAAS,MAAM,aACb,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,GAAG,EACjC,eAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,GAAG,EACtC,eAAM,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,GAAG,IAClC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,CACL,iBAAS,MAAM,YACb,mBAAU,MAAM,EAAC,gBAAgB,GAAG,GAChC,CACP,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package entry, `@vouched-id/ui`.
|
|
3
|
+
*
|
|
4
|
+
* import { Button, Field, Input, SegmentedControl, Eyebrow, EditorialHeading } from '@vouched-id/ui';
|
|
5
|
+
*
|
|
6
|
+
* The primitives live in `./public.ts`, which the shadcn registry also
|
|
7
|
+
* installs as the consumer's barrel, so a package consumer and a registry
|
|
8
|
+
* consumer import the same set.
|
|
9
|
+
*/
|
|
10
|
+
export * from './public.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package entry, `@vouched-id/ui`.
|
|
3
|
+
*
|
|
4
|
+
* import { Button, Field, Input, SegmentedControl, Eyebrow, EditorialHeading } from '@vouched-id/ui';
|
|
5
|
+
*
|
|
6
|
+
* The primitives live in `./public.ts`, which the shadcn registry also
|
|
7
|
+
* installs as the consumer's barrel, so a package consumer and a registry
|
|
8
|
+
* consumer import the same set.
|
|
9
|
+
*/
|
|
10
|
+
export * from './public.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Number formatting utilities for dashboard display
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Format numbers for display in stat cards and overview cards
|
|
6
|
+
* - Numbers < 1,000: Show as is (e.g., "999")
|
|
7
|
+
* - Numbers 1,000-9,999: Show with commas (e.g., "1,234")
|
|
8
|
+
* - Numbers ≥10,000: Show abbreviated with 2 decimals (e.g., "12.35K")
|
|
9
|
+
* - Numbers ≥1M: Show with 1 decimal (e.g., "1.2M")
|
|
10
|
+
* - Numbers ≥1B: Show with 1 decimal (e.g., "2.5B")
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatStatValue(value: number | string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Format percentage values with appropriate precision
|
|
15
|
+
* Use this for actual percentages (parts of 100%)
|
|
16
|
+
* - < 0.01%: Display as "<0.01%"
|
|
17
|
+
* - Whole numbers: "30%" not "30.00%"
|
|
18
|
+
* - Decimals: Show up to 2 decimal places, trimming trailing zeros
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatPercentage(percentage: number): string;
|
|
21
|
+
/**
|
|
22
|
+
* Format percentage change values (for comparisons/growth indicators)
|
|
23
|
+
* Use this for changes over time (e.g., "↑ 67%" or "↓ 12%")
|
|
24
|
+
* Always shows whole numbers for cleaner display in comparison contexts
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatPercentageChange(percentage: number): string;
|
|
27
|
+
/**
|
|
28
|
+
* Compact number formatter with 3 significant figures + k/M/B suffix.
|
|
29
|
+
*
|
|
30
|
+
* Matches the v2 dashboard's display convention (`index-new.html`):
|
|
31
|
+
* 1,234 → "1.23k"
|
|
32
|
+
* 12,345 → "12.3k"
|
|
33
|
+
* 123,456 → "123k"
|
|
34
|
+
* 1,234,567 → "1.23M"
|
|
35
|
+
* 12,345,678 → "12.3M"
|
|
36
|
+
* 123,456,789 → "123M"
|
|
37
|
+
*
|
|
38
|
+
* Below 1000 the integer is shown verbatim (no comma, no decimal) so
|
|
39
|
+
* counts like "3 reqs" or "5 new" stay legible.
|
|
40
|
+
*
|
|
41
|
+
* Distinct from `formatStatValue`, which uses uppercase `K` and a single
|
|
42
|
+
* decimal place at the thousand scale — kept for v1 callers and any v2
|
|
43
|
+
* surface that explicitly opts out.
|
|
44
|
+
*/
|
|
45
|
+
export declare function formatCompactNumber(value: number): string;
|
|
46
|
+
/**
|
|
47
|
+
* Format byte values into human-readable strings (B, KB, MB, GB, TB, PB).
|
|
48
|
+
* Clamps the unit index to avoid undefined lookups for very large values.
|
|
49
|
+
*/
|
|
50
|
+
export declare function formatBytes(bytes: number): string;
|
|
51
|
+
//# sourceMappingURL=format-numbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-numbers.d.ts","sourceRoot":"","sources":["../../src/lib/format-numbers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CA2C9D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAyB3D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAMjE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA2CzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMjD"}
|