@signal9/era-ui 26.1.1 → 27.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.
@@ -1,100 +0,0 @@
1
- import { docs, hasDoc, listEntries } from './index.js';
2
- import { buildUtilitiesIndex } from './css-utilities.js';
3
- import { utilities } from './utilities.js';
4
- import { modes, defaultMode, surfaces, defaultSurface, corners, defaultCorners, fonts, defaultFont, motions, defaultMotion } from '../ui/provider/index.js';
5
- const H1 = '# era-ui';
6
- const MISSION = '> A Svelte 5 + Bits UI component library. Every surface — heights, paddings, radii, gaps — derives from a single spacing atom, so density is a one-attribute override at any scope.';
7
- function orientation(origin) {
8
- const axisList = (arr, dflt) => arr.map((v) => (v === dflt ? `**${v}** (default)` : v)).join(' · ');
9
- return [
10
- '## Using the library',
11
- '',
12
- '```ts',
13
- 'import { Button, Table, Select } from "@signal9/era-ui";',
14
- 'import "@signal9/era-ui/css";',
15
- '```',
16
- '',
17
- 'Named exports wrap a single primitive (`Button`, `Badge`, `Chip`, `Input`, …). Namespace exports compose primitives via sub-components (`Table.Root`, `Table.Row`, `Select.Trigger`, `Dialog.Content`, …). Every wrapper forwards unknown props to its underlying element or bits-ui primitive, so standard HTML attributes (`class`, `style`, event handlers, `aria-*`, `data-*`) work without ceremony.',
18
- '',
19
- '## Scoped overrides',
20
- '',
21
- 'Five orthogonal axes are exposed as HTML attributes on any ancestor. The entire subtree re-tiers through CSS inheritance — no JS, no context provider.',
22
- '',
23
- `- \`data-mode\`: ${axisList(modes, defaultMode)} — adjusts the spacing atom (\`--era-sp\`).`,
24
- `- \`data-surface\`: ${axisList(surfaces, defaultSurface)} — swaps the background treatment.`,
25
- `- \`data-corners\`: ${axisList(corners, defaultCorners)} — scales all radii toward 0.`,
26
- `- \`data-font\`: ${axisList(fonts, defaultFont)} — switches the font stack.`,
27
- `- \`data-motion\`: ${axisList(motions, defaultMotion)} — sets animation speed (\`--era-duration\` / \`--era-ease\`), independent of density.`,
28
- '',
29
- 'The `Mode` component is a thin wrapper that applies these attributes plus optional `primary` / `primaryFg` color overrides to a subtree.',
30
- '',
31
- '## Spacing system',
32
- '',
33
- 'One atom, `--era-sp` (8px dense / 10px balanced / 12px spacious), drives everything. The tier ladder is:',
34
- '',
35
- '```',
36
- 'xs = sp + 6 icons, tight affordances 14 / 16 / 18 px',
37
- 'xxs = sp + 10 nested pill (badge, chip) 18 / 20 / 22 px',
38
- 'sm = 2·sp + 6 standalone pill (kv) 22 / 26 / 30 px',
39
- 'md = 3·sp buttons, inputs, triggers 24 / 30 / 36 px',
40
- 'lg = 4·sp bars, top-level containers 32 / 40 / 48 px',
41
- '```',
42
- '',
43
- 'Heights (`--era-h-*`), insets (`--era-inset-*`), radii (`--era-rd-*`), and concentric gaps (`--era-icon-inset-chip`, `--era-pill-inset-control`, …) are all `calc()` chains off `--era-sp`. Never hard-code pixel values — setting `data-mode` on any ancestor re-derives the whole subtree. Type is the second density input (12 px at dense, 14 px above); the spacing atom moves with it.',
44
- '',
45
- '## Per-component docs',
46
- '',
47
- `Every component has a passive markdown doc at \`${origin}/<slug>.md\`.`,
48
- `Examples: \`${origin}/button.md\`, \`${origin}/select.md\`, \`${origin}/table.md\`.`,
49
- `Full concatenated reference: \`${origin}/llms-full.txt\`.`,
50
- '',
51
- 'Each page is generated from the component source, so props/variants/defaults stay in sync with the code automatically.'
52
- ].join('\n');
53
- }
54
- function utilitiesSection(origin) {
55
- return [
56
- '## CSS utilities',
57
- '',
58
- 'Classes, not components — they need no import beyond the stylesheet. Reach for one of these before hand-rolling the same styling or bending a component into the role.',
59
- '',
60
- ...buildUtilitiesIndex(utilities),
61
- '',
62
- `Full reference (what each emits, when to use it): \`${origin}/utilities.md\`. Machine-readable list: \`${origin}/utilities.json\`.`
63
- ].join('\n');
64
- }
65
- export function buildLlmsTxt(origin = '') {
66
- const entries = listEntries();
67
- const lines = [H1, '', MISSION, '', orientation(origin), ''];
68
- if (entries.length) {
69
- lines.push('## Components', '');
70
- lines.push(entries.map((e) => e.slug).join(', '), '');
71
- }
72
- lines.push(utilitiesSection(origin), '');
73
- return lines.join('\n');
74
- }
75
- // Module-init-cached: the concatenated reference has no request-dependent
76
- // inputs, so we pay its ~80 KB assembly cost once per worker instance instead
77
- // of on every request.
78
- let llmsFullTxtCache;
79
- export function buildLlmsFullTxt() {
80
- if (llmsFullTxtCache !== undefined)
81
- return llmsFullTxtCache;
82
- const entries = listEntries().filter((e) => hasDoc(e.slug));
83
- const parts = [
84
- H1,
85
- '',
86
- MISSION,
87
- '',
88
- orientation(''),
89
- '',
90
- utilitiesSection(''),
91
- '',
92
- '<!-- Full component documentation, concatenated. The utilities page below carries the CSS each utility emits. -->',
93
- ''
94
- ];
95
- for (const e of entries) {
96
- parts.push(`<!-- begin: ${e.slug} -->`, '', docs[e.slug].trim(), '', `<!-- end: ${e.slug} -->`, '');
97
- }
98
- llmsFullTxtCache = parts.join('\n');
99
- return llmsFullTxtCache;
100
- }