@signal9/era-ui 32.0.0 → 33.0.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/CHANGELOG.md +24 -0
- package/dist/dev/audit-overlay.svelte +2 -2
- package/dist/era-ui.css +1 -1
- package/dist/generated-docs/utilities.json +99 -99
- package/dist/os/pane.svelte +3 -13
- package/dist/styles/index.css +2 -956
- package/dist/styles/typography.css +1 -1
- package/dist/styles/utilities/geometry.css +188 -0
- package/dist/styles/utilities/interaction.css +334 -0
- package/dist/styles/utilities/materials.css +39 -0
- package/dist/styles/utilities/public.css +391 -0
- package/dist/styles/utilities.css +5 -0
- package/dist/ui/card/card.svelte +2 -52
- package/dist/ui/card/card.svelte.d.ts +0 -43
- package/dist/ui/card/variants.d.ts +44 -0
- package/dist/ui/card/variants.js +20 -0
- package/dist/ui/context-menu/context-menu-checkbox-item.svelte +2 -4
- package/dist/ui/context-menu/context-menu-group-heading.svelte +2 -5
- package/dist/ui/context-menu/context-menu-item.svelte +2 -8
- package/dist/ui/context-menu/context-menu-radio-item.svelte +2 -8
- package/dist/ui/context-menu/context-menu-separator.svelte +2 -5
- package/dist/ui/context-menu/context-menu-sub-trigger.svelte +2 -8
- package/dist/ui/dialog/dialog-header.svelte +1 -1
- package/dist/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +2 -4
- package/dist/ui/dropdown-menu/dropdown-menu-group-heading.svelte +2 -5
- package/dist/ui/dropdown-menu/dropdown-menu-item.svelte +2 -8
- package/dist/ui/dropdown-menu/dropdown-menu-radio-item.svelte +2 -8
- package/dist/ui/dropdown-menu/dropdown-menu-separator.svelte +2 -5
- package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +2 -8
- package/dist/ui/menu-recipes.d.ts +6 -0
- package/dist/ui/menu-recipes.js +6 -0
- package/dist/ui/menubar/menubar-checkbox-item.svelte +2 -9
- package/dist/ui/menubar/menubar-group-heading.svelte +2 -5
- package/dist/ui/menubar/menubar-item.svelte +2 -8
- package/dist/ui/menubar/menubar-radio-item.svelte +2 -8
- package/dist/ui/menubar/menubar-separator.svelte +2 -5
- package/dist/ui/menubar/menubar-sub-trigger.svelte +2 -8
- package/dist/ui/pane/pane-close.svelte +7 -26
- package/dist/ui/video-player/video-player.svelte +8 -8
- package/package.json +48 -12
- package/dist/docs/badge.md +0 -18
- package/dist/docs/bits-ui-audit.md +0 -58
- package/dist/docs/button.md +0 -19
- package/dist/docs/chip.md +0 -20
- package/dist/docs/component-docs-core.d.ts +0 -8
- package/dist/docs/component-docs-core.js +0 -73
- package/dist/docs/component-docs.d.ts +0 -2
- package/dist/docs/component-docs.js +0 -25
- package/dist/docs/component-source-scanners.d.ts +0 -18
- package/dist/docs/component-source-scanners.js +0 -46
- package/dist/docs/consumer-import.d.ts +0 -65
- package/dist/docs/consumer-import.js +0 -70
- package/dist/docs/css-utilities.d.ts +0 -58
- package/dist/docs/css-utilities.js +0 -317
- package/dist/docs/extract-props.d.ts +0 -13
- package/dist/docs/extract-props.js +0 -324
- package/dist/docs/generated-docs.d.ts +0 -6
- package/dist/docs/generated-docs.js +0 -30
- package/dist/docs/index.d.ts +0 -5
- package/dist/docs/index.js +0 -66
- package/dist/docs/notes.md +0 -83
- package/dist/docs/scroll-area.md +0 -7
- package/dist/docs/separator.md +0 -20
- package/dist/docs/table.md +0 -35
- package/dist/docs/utilities.d.ts +0 -4
- package/dist/docs/utilities.js +0 -15
- package/dist/generated-docs/accordion.md +0 -57
- package/dist/generated-docs/alert-dialog.md +0 -91
- package/dist/generated-docs/aspect-ratio.md +0 -17
- package/dist/generated-docs/avatar.md +0 -39
- package/dist/generated-docs/badge.md +0 -41
- package/dist/generated-docs/bar.md +0 -41
- package/dist/generated-docs/button-group.md +0 -19
- package/dist/generated-docs/button.md +0 -117
- package/dist/generated-docs/calendar.md +0 -126
- package/dist/generated-docs/card.md +0 -58
- package/dist/generated-docs/checkbox.md +0 -42
- package/dist/generated-docs/chip.md +0 -61
- package/dist/generated-docs/code-block.md +0 -20
- package/dist/generated-docs/collapsible.md +0 -30
- package/dist/generated-docs/combobox.md +0 -74
- package/dist/generated-docs/command-bar.md +0 -3
- package/dist/generated-docs/command.md +0 -126
- package/dist/generated-docs/context-menu.md +0 -104
- package/dist/generated-docs/copy-button.md +0 -29
- package/dist/generated-docs/cycle.md +0 -29
- package/dist/generated-docs/date-field.md +0 -49
- package/dist/generated-docs/date-picker.md +0 -180
- package/dist/generated-docs/date-range-field.md +0 -50
- package/dist/generated-docs/date-range-picker.md +0 -180
- package/dist/generated-docs/dialog.md +0 -94
- package/dist/generated-docs/draggable.md +0 -3
- package/dist/generated-docs/dropdown-menu.md +0 -104
- package/dist/generated-docs/file-upload.md +0 -18
- package/dist/generated-docs/getting-started.md +0 -3
- package/dist/generated-docs/input.md +0 -23
- package/dist/generated-docs/kv.md +0 -20
- package/dist/generated-docs/label.md +0 -17
- package/dist/generated-docs/link-preview.md +0 -40
- package/dist/generated-docs/llm-shell.md +0 -3
- package/dist/generated-docs/llms-full.txt +0 -5201
- package/dist/generated-docs/llms.txt +0 -138
- package/dist/generated-docs/logo.md +0 -24
- package/dist/generated-docs/manifest.json +0 -1685
- package/dist/generated-docs/measurements.md +0 -3
- package/dist/generated-docs/menu.md +0 -11
- package/dist/generated-docs/menubar.md +0 -104
- package/dist/generated-docs/meter.md +0 -101
- package/dist/generated-docs/mode.md +0 -24
- package/dist/generated-docs/nav.md +0 -73
- package/dist/generated-docs/navigation-menu.md +0 -11
- package/dist/generated-docs/notes.md +0 -87
- package/dist/generated-docs/os.md +0 -3
- package/dist/generated-docs/pagination.md +0 -55
- package/dist/generated-docs/pane.md +0 -34
- package/dist/generated-docs/pin-input.md +0 -31
- package/dist/generated-docs/popover.md +0 -43
- package/dist/generated-docs/progress.md +0 -17
- package/dist/generated-docs/radio-group.md +0 -31
- package/dist/generated-docs/range-calendar.md +0 -11
- package/dist/generated-docs/rating-group.md +0 -31
- package/dist/generated-docs/scroll-area.md +0 -65
- package/dist/generated-docs/select.md +0 -67
- package/dist/generated-docs/separator.md +0 -57
- package/dist/generated-docs/sheet.md +0 -11
- package/dist/generated-docs/skeleton.md +0 -18
- package/dist/generated-docs/slider.md +0 -71
- package/dist/generated-docs/spacing.md +0 -3
- package/dist/generated-docs/step.md +0 -51
- package/dist/generated-docs/surfaces.md +0 -3
- package/dist/generated-docs/switch.md +0 -18
- package/dist/generated-docs/table.md +0 -113
- package/dist/generated-docs/tabs.md +0 -48
- package/dist/generated-docs/text.md +0 -3
- package/dist/generated-docs/time-field.md +0 -49
- package/dist/generated-docs/time-range-field.md +0 -50
- package/dist/generated-docs/timeline.md +0 -32
- package/dist/generated-docs/todo.md +0 -3
- package/dist/generated-docs/toggle-group.md +0 -31
- package/dist/generated-docs/toggle.md +0 -20
- package/dist/generated-docs/toolbar.md +0 -11
- package/dist/generated-docs/tooltip.md +0 -40
- package/dist/generated-docs/tree.md +0 -36
- package/dist/generated-docs/utilities.md +0 -1236
- package/dist/generated-docs/video-player.md +0 -73
package/dist/docs/chip.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
## Usage
|
|
2
|
-
|
|
3
|
-
```svelte
|
|
4
|
-
<script>
|
|
5
|
-
import { Chip } from '@signal9/era-ui/chip';
|
|
6
|
-
|
|
7
|
-
let tags = $state(['alpha', 'beta', 'gamma']);
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
{#each tags as tag}
|
|
11
|
-
<Chip ondismiss={() => (tags = tags.filter((t) => t !== tag))}>
|
|
12
|
-
{tag}
|
|
13
|
-
</Chip>
|
|
14
|
-
{/each}
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Notes
|
|
18
|
-
|
|
19
|
-
- Internal pointerdown/up events on the dismiss button are stopped from bubbling — this prevents accidental toggling when a Chip is nested inside a Select/Popover trigger.
|
|
20
|
-
- Uses the `xxs` tier tokens (height, radius, inset). Part of the Badge/Chip/KV "tag" family.
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ComponentEntry } from '../../routes/registry.js';
|
|
2
|
-
import type { RootExport, SubExport } from './component-source-scanners.js';
|
|
3
|
-
export interface ComponentDocSources {
|
|
4
|
-
rootExports: Record<string, RootExport>;
|
|
5
|
-
subExportsBySlug: Record<string, SubExport[]>;
|
|
6
|
-
svelteBySlug: Record<string, Record<string, string>>;
|
|
7
|
-
}
|
|
8
|
-
export declare function buildComponentDocFromSources(entry: ComponentEntry, sources: ComponentDocSources, appendix?: string): string;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { importLine } from './consumer-import.js';
|
|
2
|
-
import { extractProps } from './extract-props.js';
|
|
3
|
-
export function buildComponentDocFromSources(entry, sources, appendix) {
|
|
4
|
-
const { slug, name, description } = entry;
|
|
5
|
-
const root = sources.rootExports[slug];
|
|
6
|
-
const lines = [`# ${name}`, '', description, ''];
|
|
7
|
-
if (!root) {
|
|
8
|
-
if (appendix) {
|
|
9
|
-
const trimmed = stripRedundantHeader(appendix).trim();
|
|
10
|
-
if (trimmed)
|
|
11
|
-
lines.push(trimmed, '');
|
|
12
|
-
}
|
|
13
|
-
return lines.join('\n');
|
|
14
|
-
}
|
|
15
|
-
lines.push('## Import', '', '```ts', importLine(root.kind, root.alias, slug), '```', '');
|
|
16
|
-
const subs = sources.subExportsBySlug[slug] ?? [];
|
|
17
|
-
const files = sources.svelteBySlug[slug] ?? {};
|
|
18
|
-
if (root.kind === 'namespace') {
|
|
19
|
-
lines.push('Composed from sub-components — compose explicitly at the call site:', '', ...subs.map((s) => `- \`${root.alias}.${s.name}\``), '');
|
|
20
|
-
for (const sub of subs) {
|
|
21
|
-
lines.push(`## ${root.alias}.${sub.name}`, '');
|
|
22
|
-
if (sub.source.kind === 'passthrough') {
|
|
23
|
-
lines.push(`Re-exports \`${sub.source.ref}\` directly — see [bits-ui docs](https://bits-ui.com) for its full API.`, '');
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
const spec = extractProps(files[sub.source.file] ?? '');
|
|
27
|
-
lines.push(...renderPropsSection(spec));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
const sub = subs.find((s) => s.source.kind === 'file');
|
|
32
|
-
const file = sub && sub.source.kind === 'file' ? sub.source.file : `${slug}.svelte`;
|
|
33
|
-
const spec = extractProps(files[file] ?? '');
|
|
34
|
-
lines.push('## Props', '');
|
|
35
|
-
lines.push(...renderPropsSection(spec));
|
|
36
|
-
}
|
|
37
|
-
if (appendix) {
|
|
38
|
-
const trimmed = stripRedundantHeader(appendix).trim();
|
|
39
|
-
if (trimmed)
|
|
40
|
-
lines.push(trimmed, '');
|
|
41
|
-
}
|
|
42
|
-
return lines.join('\n');
|
|
43
|
-
}
|
|
44
|
-
function renderPropsSection(spec) {
|
|
45
|
-
if (!spec)
|
|
46
|
-
return ['_Props could not be parsed from source._', ''];
|
|
47
|
-
const out = [];
|
|
48
|
-
for (const inh of spec.inherits) {
|
|
49
|
-
out.push(`Inherits all props from \`${inh}\`.`);
|
|
50
|
-
}
|
|
51
|
-
if (spec.inherits.length)
|
|
52
|
-
out.push('');
|
|
53
|
-
if (!spec.props.length) {
|
|
54
|
-
if (!spec.inherits.length)
|
|
55
|
-
out.push('_No wrapper-specific props._', '');
|
|
56
|
-
return out;
|
|
57
|
-
}
|
|
58
|
-
out.push('| Prop | Type | Default | Notes |');
|
|
59
|
-
out.push('|------|------|---------|-------|');
|
|
60
|
-
for (const p of spec.props) {
|
|
61
|
-
const notes = [p.bindable ? 'bindable' : '', p.description ?? ''].filter(Boolean).join(' — ');
|
|
62
|
-
out.push(`| \`${p.name}${p.optional ? '?' : ''}\` | ${fmtCode(p.type)} | ${p.default !== undefined ? fmtCode(p.default) : '—'} | ${notes || '—'} |`);
|
|
63
|
-
}
|
|
64
|
-
out.push('');
|
|
65
|
-
return out;
|
|
66
|
-
}
|
|
67
|
-
function fmtCode(s) {
|
|
68
|
-
const normalized = s.replace(/\s+/g, ' ').trim().replace(/\|/g, '\\|');
|
|
69
|
-
return `\`${normalized}\``;
|
|
70
|
-
}
|
|
71
|
-
function stripRedundantHeader(md) {
|
|
72
|
-
return md.replace(/^#\s+[^\n]+\n+/, '');
|
|
73
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { buildComponentDocFromSources } from './component-docs-core.js';
|
|
2
|
-
import { groupSvelteBySlug, parseAllSubExports, parseRootExports } from './component-source-scanners.js';
|
|
3
|
-
const svelteSources = import.meta.glob('../ui/**/*.svelte', {
|
|
4
|
-
query: '?raw',
|
|
5
|
-
import: 'default',
|
|
6
|
-
eager: true
|
|
7
|
-
});
|
|
8
|
-
const componentIndexSources = import.meta.glob('../ui/*/index.ts', {
|
|
9
|
-
query: '?raw',
|
|
10
|
-
import: 'default',
|
|
11
|
-
eager: true
|
|
12
|
-
});
|
|
13
|
-
const rootIndexSources = import.meta.glob('../ui/index.ts', {
|
|
14
|
-
query: '?raw',
|
|
15
|
-
import: 'default',
|
|
16
|
-
eager: true
|
|
17
|
-
});
|
|
18
|
-
const sources = {
|
|
19
|
-
rootExports: parseRootExports(Object.values(rootIndexSources)[0] ?? ''),
|
|
20
|
-
subExportsBySlug: parseAllSubExports(componentIndexSources),
|
|
21
|
-
svelteBySlug: groupSvelteBySlug(svelteSources)
|
|
22
|
-
};
|
|
23
|
-
export function buildComponentDoc(entry, appendix) {
|
|
24
|
-
return buildComponentDocFromSources(entry, sources, appendix);
|
|
25
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface RootExport {
|
|
2
|
-
kind: 'named' | 'namespace';
|
|
3
|
-
alias: string;
|
|
4
|
-
}
|
|
5
|
-
export interface SubExport {
|
|
6
|
-
name: string;
|
|
7
|
-
source: {
|
|
8
|
-
kind: 'file';
|
|
9
|
-
file: string;
|
|
10
|
-
} | {
|
|
11
|
-
kind: 'passthrough';
|
|
12
|
-
ref: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export declare function parseRootExports(src: string): Record<string, RootExport>;
|
|
16
|
-
export declare function parseAllSubExports(sources: Record<string, string>): Record<string, SubExport[]>;
|
|
17
|
-
export declare function parseSubExports(src: string): SubExport[];
|
|
18
|
-
export declare function groupSvelteBySlug(sources: Record<string, string>): Record<string, Record<string, string>>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export function parseRootExports(src) {
|
|
2
|
-
const out = {};
|
|
3
|
-
for (const m of src.matchAll(/export\s*\{\s*([\w]+)(?:\s+as\s+[\w]+)?\s*(?:,[^}]*)?\}\s*from\s*["']\.\/([^/"']+)\/index\.js["']/g)) {
|
|
4
|
-
out[m[2]] = { kind: 'named', alias: m[1] };
|
|
5
|
-
}
|
|
6
|
-
for (const m of src.matchAll(/export\s*\*\s*as\s*([\w]+)\s*from\s*["']\.\/([^/"']+)\/index\.js["']/g)) {
|
|
7
|
-
out[m[2]] = { kind: 'namespace', alias: m[1] };
|
|
8
|
-
}
|
|
9
|
-
return out;
|
|
10
|
-
}
|
|
11
|
-
export function parseAllSubExports(sources) {
|
|
12
|
-
const out = {};
|
|
13
|
-
for (const [path, src] of Object.entries(sources)) {
|
|
14
|
-
const m = path.match(/\/ui\/([^/]+)\/index\.ts$/);
|
|
15
|
-
if (!m)
|
|
16
|
-
continue;
|
|
17
|
-
out[m[1]] = parseSubExports(src);
|
|
18
|
-
}
|
|
19
|
-
return out;
|
|
20
|
-
}
|
|
21
|
-
export function parseSubExports(src) {
|
|
22
|
-
const out = [];
|
|
23
|
-
for (const m of src.matchAll(/export\s*\{\s*default\s+as\s+([\w]+)\s*\}\s*from\s*["']\.\/([^"']+\.svelte)["']/g)) {
|
|
24
|
-
out.push({ name: m[1], source: { kind: 'file', file: m[2] } });
|
|
25
|
-
}
|
|
26
|
-
for (const m of src.matchAll(/export\s+const\s+([\w]+)\s*=\s*([\w.]+)\s*;/g)) {
|
|
27
|
-
out.push({ name: m[1], source: { kind: 'passthrough', ref: m[2] } });
|
|
28
|
-
}
|
|
29
|
-
for (const m of src.matchAll(/export\s*\{\s*([\w]+)\s*\}\s*from\s*["']\.\/([^"']+\.svelte)["']/g)) {
|
|
30
|
-
out.push({ name: m[1], source: { kind: 'file', file: m[2] } });
|
|
31
|
-
}
|
|
32
|
-
for (const m of src.matchAll(/export\s*\{\s*default\s*\}\s*from\s*["']\.\/([^"']+\.svelte)["']/g)) {
|
|
33
|
-
out.push({ name: 'default', source: { kind: 'file', file: m[1] } });
|
|
34
|
-
}
|
|
35
|
-
return out;
|
|
36
|
-
}
|
|
37
|
-
export function groupSvelteBySlug(sources) {
|
|
38
|
-
const out = {};
|
|
39
|
-
for (const [path, src] of Object.entries(sources)) {
|
|
40
|
-
const m = path.match(/\/ui\/([^/]+)\/([^/]+\.svelte)$/);
|
|
41
|
-
if (!m)
|
|
42
|
-
continue;
|
|
43
|
-
(out[m[1]] ??= {})[m[2]] = src;
|
|
44
|
-
}
|
|
45
|
-
return out;
|
|
46
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The import line a CONSUMER writes, and the two ways it has been wrong.
|
|
3
|
-
*
|
|
4
|
-
* WRONG ONCE (fixed in 12.1.1): the docs printed `$lib/ui/<slug>`, a SvelteKit
|
|
5
|
-
* alias that resolves inside this repo and nowhere else.
|
|
6
|
-
*
|
|
7
|
-
* WRONG AGAIN, and this one survived that fix because it is a different
|
|
8
|
-
* mistake: every component was documented with NAMED import syntax. That is
|
|
9
|
-
* right for `export { Button }` and silently wrong for `export * as PinInput`,
|
|
10
|
-
* where the component's own index exports `Root` and `Cell` and no `PinInput`
|
|
11
|
-
* at all. `import { PinInput } from '@signal9/era-ui/pin-input'` therefore
|
|
12
|
-
* type-checks, builds, and evaluates to `undefined` — it fails at RENDER, and
|
|
13
|
-
* the docs are the only place a consumer could have learned otherwise.
|
|
14
|
-
*
|
|
15
|
-
* The shape is decided by how src/lib/ui/index.ts re-exports the component,
|
|
16
|
-
* which is a barrel consumers cannot import — so the two spellings have to be
|
|
17
|
-
* translated here rather than copied from it.
|
|
18
|
-
*
|
|
19
|
-
* npm's name deliberately: the package publishes under two names
|
|
20
|
-
* (`@sig-nine/era-ui` on GitHub Packages, where the scope must match the repo
|
|
21
|
-
* owner) and npm's is the one a reader can install without auth.
|
|
22
|
-
*
|
|
23
|
-
* Its own module, with no imports of its own, because the node doc builder
|
|
24
|
-
* loads it through --experimental-strip-types — which cannot follow the `.js`
|
|
25
|
-
* specifiers the rest of src/lib/docs uses.
|
|
26
|
-
*/
|
|
27
|
-
export declare const PACKAGE = "@signal9/era-ui";
|
|
28
|
-
/**
|
|
29
|
-
* The install command WITH the pin, because npm's default fights era's cadence.
|
|
30
|
-
*
|
|
31
|
-
* `npm install @signal9/era-ui` writes a caret range. A caret still holds the
|
|
32
|
-
* major — `^26.1.0` resolves `<27.0.0` — so it is not the open subscription to
|
|
33
|
-
* the next breaking release it gets mistaken for. The real exposure is smaller
|
|
34
|
-
* and sharper than that, and it is worse:
|
|
35
|
-
*
|
|
36
|
-
* 1. era's majors are not annual. Measured at 26.1.1: 132 releases in the
|
|
37
|
-
* preceding 30 days, 24 of them major. The protection a caret buys is
|
|
38
|
-
* about a day and a quarter of era time.
|
|
39
|
-
* 2. Inside that window the minors and patches MOVE PIXELS. `fix(command): a
|
|
40
|
-
* row carries its OWN tier's radius` is a patch, and it changes what every
|
|
41
|
-
* command palette row looks like. For a library whose output is geometry
|
|
42
|
-
* there is no such thing as a rendering-neutral patch, so semver's promise
|
|
43
|
-
* — "patches are safe to float" — does not describe what era ships.
|
|
44
|
-
*
|
|
45
|
-
* So era's advice is to pin exact. This is that advice as the command that
|
|
46
|
-
* PRODUCES the pin, rather than as a sentence printed next to a command that
|
|
47
|
-
* does not: a reader who copies the snippet is pinned, whereas a reader given a
|
|
48
|
-
* bare `npm install` and a note about `--save-exact` is pinned only if they
|
|
49
|
-
* copied the prose too.
|
|
50
|
-
*
|
|
51
|
-
* Found by signalnine.org, which shipped a caret it never meant to and caught it
|
|
52
|
-
* reading its own diff. Every other pin in that repo was exact and deliberate —
|
|
53
|
-
* the docs had simply never said so, and the default quietly answered instead.
|
|
54
|
-
*/
|
|
55
|
-
export declare const INSTALL = "npm install --save-exact @signal9/era-ui";
|
|
56
|
-
/** How a component is re-exported by the internal barrel. */
|
|
57
|
-
export type ImportKind = 'named' | 'namespace';
|
|
58
|
-
/** The import statement, in the spelling that actually resolves. */
|
|
59
|
-
export declare function importLine(kind: ImportKind, alias: string, slug: string): string;
|
|
60
|
-
/**
|
|
61
|
-
* The symbol a consumer must be able to reach, given the documented import.
|
|
62
|
-
* For a namespace import that is nothing — `import * as X` always binds — so
|
|
63
|
-
* only named imports can be checked against the component's own exports.
|
|
64
|
-
*/
|
|
65
|
-
export declare function requiredExport(kind: ImportKind, alias: string): string | null;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The import line a CONSUMER writes, and the two ways it has been wrong.
|
|
3
|
-
*
|
|
4
|
-
* WRONG ONCE (fixed in 12.1.1): the docs printed `$lib/ui/<slug>`, a SvelteKit
|
|
5
|
-
* alias that resolves inside this repo and nowhere else.
|
|
6
|
-
*
|
|
7
|
-
* WRONG AGAIN, and this one survived that fix because it is a different
|
|
8
|
-
* mistake: every component was documented with NAMED import syntax. That is
|
|
9
|
-
* right for `export { Button }` and silently wrong for `export * as PinInput`,
|
|
10
|
-
* where the component's own index exports `Root` and `Cell` and no `PinInput`
|
|
11
|
-
* at all. `import { PinInput } from '@signal9/era-ui/pin-input'` therefore
|
|
12
|
-
* type-checks, builds, and evaluates to `undefined` — it fails at RENDER, and
|
|
13
|
-
* the docs are the only place a consumer could have learned otherwise.
|
|
14
|
-
*
|
|
15
|
-
* The shape is decided by how src/lib/ui/index.ts re-exports the component,
|
|
16
|
-
* which is a barrel consumers cannot import — so the two spellings have to be
|
|
17
|
-
* translated here rather than copied from it.
|
|
18
|
-
*
|
|
19
|
-
* npm's name deliberately: the package publishes under two names
|
|
20
|
-
* (`@sig-nine/era-ui` on GitHub Packages, where the scope must match the repo
|
|
21
|
-
* owner) and npm's is the one a reader can install without auth.
|
|
22
|
-
*
|
|
23
|
-
* Its own module, with no imports of its own, because the node doc builder
|
|
24
|
-
* loads it through --experimental-strip-types — which cannot follow the `.js`
|
|
25
|
-
* specifiers the rest of src/lib/docs uses.
|
|
26
|
-
*/
|
|
27
|
-
export const PACKAGE = '@signal9/era-ui';
|
|
28
|
-
/**
|
|
29
|
-
* The install command WITH the pin, because npm's default fights era's cadence.
|
|
30
|
-
*
|
|
31
|
-
* `npm install @signal9/era-ui` writes a caret range. A caret still holds the
|
|
32
|
-
* major — `^26.1.0` resolves `<27.0.0` — so it is not the open subscription to
|
|
33
|
-
* the next breaking release it gets mistaken for. The real exposure is smaller
|
|
34
|
-
* and sharper than that, and it is worse:
|
|
35
|
-
*
|
|
36
|
-
* 1. era's majors are not annual. Measured at 26.1.1: 132 releases in the
|
|
37
|
-
* preceding 30 days, 24 of them major. The protection a caret buys is
|
|
38
|
-
* about a day and a quarter of era time.
|
|
39
|
-
* 2. Inside that window the minors and patches MOVE PIXELS. `fix(command): a
|
|
40
|
-
* row carries its OWN tier's radius` is a patch, and it changes what every
|
|
41
|
-
* command palette row looks like. For a library whose output is geometry
|
|
42
|
-
* there is no such thing as a rendering-neutral patch, so semver's promise
|
|
43
|
-
* — "patches are safe to float" — does not describe what era ships.
|
|
44
|
-
*
|
|
45
|
-
* So era's advice is to pin exact. This is that advice as the command that
|
|
46
|
-
* PRODUCES the pin, rather than as a sentence printed next to a command that
|
|
47
|
-
* does not: a reader who copies the snippet is pinned, whereas a reader given a
|
|
48
|
-
* bare `npm install` and a note about `--save-exact` is pinned only if they
|
|
49
|
-
* copied the prose too.
|
|
50
|
-
*
|
|
51
|
-
* Found by signalnine.org, which shipped a caret it never meant to and caught it
|
|
52
|
-
* reading its own diff. Every other pin in that repo was exact and deliberate —
|
|
53
|
-
* the docs had simply never said so, and the default quietly answered instead.
|
|
54
|
-
*/
|
|
55
|
-
export const INSTALL = `npm install --save-exact ${PACKAGE}`;
|
|
56
|
-
/** The import statement, in the spelling that actually resolves. */
|
|
57
|
-
export function importLine(kind, alias, slug) {
|
|
58
|
-
const spec = `"${PACKAGE}/${slug}"`;
|
|
59
|
-
return kind === 'namespace'
|
|
60
|
-
? `import * as ${alias} from ${spec};`
|
|
61
|
-
: `import { ${alias} } from ${spec};`;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* The symbol a consumer must be able to reach, given the documented import.
|
|
65
|
-
* For a namespace import that is nothing — `import * as X` always binds — so
|
|
66
|
-
* only named imports can be checked against the component's own exports.
|
|
67
|
-
*/
|
|
68
|
-
export function requiredExport(kind, alias) {
|
|
69
|
-
return kind === 'named' ? alias : null;
|
|
70
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export interface CssUtility {
|
|
2
|
-
/** Class name, e.g. `era-link` — the first of `names` for a ladder. */
|
|
3
|
-
name: string;
|
|
4
|
-
/**
|
|
5
|
-
* Every class the doc comment governs. Usually one; a scale documented as a
|
|
6
|
-
* run of consecutive `@utility` blocks under a single comment (h-icon … h-bar)
|
|
7
|
-
* lists the whole ladder.
|
|
8
|
-
*/
|
|
9
|
-
names: string[];
|
|
10
|
-
/** Stylesheet the utility is declared in, relative to src/lib/styles. */
|
|
11
|
-
file: string;
|
|
12
|
-
/** One-line use case from the comment's `@use` line, if present. */
|
|
13
|
-
useCase?: string;
|
|
14
|
-
/** The rest of the doc comment — rationale, caveats, axis behaviour. */
|
|
15
|
-
description: string;
|
|
16
|
-
/** The `@utility` block verbatim, as authored. */
|
|
17
|
-
css: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* `@theme` namespace → the utility prefixes it generates.
|
|
21
|
-
*
|
|
22
|
-
* Half of era's public class API is registered this way rather than as
|
|
23
|
-
* `@utility` blocks — `rounded-control` from `--radius-control`, `shadow-lg`,
|
|
24
|
-
* `bg-highlight`, `text-body`, and the whole spacing scale. They are classes a
|
|
25
|
-
* consumer writes exactly like the others, and until this table existed the
|
|
26
|
-
* doc pipeline could not see any of them: `@utility` was the only thing it
|
|
27
|
-
* parsed, so era's most-used names were also its least-documented.
|
|
28
|
-
*
|
|
29
|
-
* The list per namespace is the SPELLINGS WORTH DOCUMENTING, not everything
|
|
30
|
-
* Tailwind derives — a spacing token really does generate `mt-`, `gap-x-`,
|
|
31
|
-
* `inset-`, `translate-` and a dozen more, and printing all of them per name
|
|
32
|
-
* would bury the point. The prose says the rest.
|
|
33
|
-
*/
|
|
34
|
-
export declare const THEME_CLASS_PREFIXES: Record<string, string[]>;
|
|
35
|
-
/** Every prefix a namespace really generates — the map the codemod needs. */
|
|
36
|
-
export declare const THEME_ALL_PREFIXES: Record<string, string[]>;
|
|
37
|
-
/**
|
|
38
|
-
* The classes one `@theme` key generates, each with the utility PREFIX that
|
|
39
|
-
* generated it — `--spacing-inset-control` → `{ prefix: 'px', name:
|
|
40
|
-
* 'px-inset-control' }`. The prefix cannot be recovered from the name (both
|
|
41
|
-
* `px` and `px-inset` are hyphen-splits of `px-inset-control`), and the codemod
|
|
42
|
-
* matches on it, so it is returned rather than re-derived.
|
|
43
|
-
*/
|
|
44
|
-
export declare function themeKeyClassEntries(themeKey: string, prefixes?: Record<string, string[]>): {
|
|
45
|
-
prefix: string;
|
|
46
|
-
name: string;
|
|
47
|
-
}[];
|
|
48
|
-
/** The class names one `@theme` key generates, e.g. `--radius-control` → `rounded-control`. */
|
|
49
|
-
export declare function themeKeyClasses(themeKey: string, prefixes?: Record<string, string[]>): string[];
|
|
50
|
-
/**
|
|
51
|
-
* @param sources stylesheet text keyed by path relative to src/lib/styles
|
|
52
|
-
* (e.g. `index.css`, `surfaces/glass.css`).
|
|
53
|
-
*/
|
|
54
|
-
export declare function parseUtilities(sources: Record<string, string>): CssUtility[];
|
|
55
|
-
/** Renders the utilities reference — the generated `utilities.md` body. */
|
|
56
|
-
export declare function buildUtilitiesDoc(utilities: CssUtility[]): string;
|
|
57
|
-
/** One line per utility (or ladder) for llms.txt — plus its searchable use case. */
|
|
58
|
-
export declare function buildUtilitiesIndex(utilities: CssUtility[]): string[];
|