@signal9/era-ui 13.0.0 → 14.0.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/ai/conversations/conversations-item.svelte +5 -5
- package/dist/docs/button.md +1 -1
- package/dist/docs/component-docs-core.js +2 -2
- package/dist/docs/consumer-import.d.ts +37 -0
- package/dist/docs/consumer-import.js +42 -0
- package/dist/docs/css-utilities.js +11 -0
- package/dist/era-ui.css +1 -1
- package/dist/generated-docs/accordion.md +1 -1
- package/dist/generated-docs/alert-dialog.md +1 -1
- package/dist/generated-docs/avatar.md +1 -1
- package/dist/generated-docs/button.md +1 -1
- package/dist/generated-docs/calendar.md +1 -1
- package/dist/generated-docs/checkbox.md +1 -1
- package/dist/generated-docs/collapsible.md +1 -1
- package/dist/generated-docs/combobox.md +1 -1
- package/dist/generated-docs/command.md +1 -1
- package/dist/generated-docs/context-menu.md +1 -1
- package/dist/generated-docs/date-field.md +1 -1
- package/dist/generated-docs/date-picker.md +1 -1
- package/dist/generated-docs/date-range-field.md +1 -1
- package/dist/generated-docs/date-range-picker.md +1 -1
- package/dist/generated-docs/dialog.md +1 -1
- package/dist/generated-docs/dropdown-menu.md +1 -1
- package/dist/generated-docs/link-preview.md +1 -1
- package/dist/generated-docs/llms-full.txt +49 -38
- package/dist/generated-docs/manifest.json +8 -8
- package/dist/generated-docs/menu.md +1 -1
- package/dist/generated-docs/menubar.md +1 -1
- package/dist/generated-docs/navigation-menu.md +1 -1
- package/dist/generated-docs/pagination.md +1 -1
- package/dist/generated-docs/pin-input.md +1 -1
- package/dist/generated-docs/popover.md +1 -1
- package/dist/generated-docs/radio-group.md +1 -1
- package/dist/generated-docs/range-calendar.md +1 -1
- package/dist/generated-docs/rating-group.md +1 -1
- package/dist/generated-docs/scroll-area.md +1 -1
- package/dist/generated-docs/select.md +1 -1
- package/dist/generated-docs/sheet.md +1 -1
- package/dist/generated-docs/slider.md +1 -1
- package/dist/generated-docs/step.md +1 -1
- package/dist/generated-docs/table.md +1 -1
- package/dist/generated-docs/tabs.md +1 -1
- package/dist/generated-docs/time-field.md +1 -1
- package/dist/generated-docs/time-range-field.md +1 -1
- package/dist/generated-docs/toggle-group.md +1 -1
- package/dist/generated-docs/toolbar.md +1 -1
- package/dist/generated-docs/tooltip.md +1 -1
- package/dist/generated-docs/utilities.md +11 -0
- package/dist/ui/checkbox/checkbox.svelte +9 -1
- package/dist/ui/pin-input/index.d.ts +1 -0
- package/dist/ui/pin-input/index.js +10 -0
- package/dist/ui/radio-group/radio-group-item.svelte +9 -1
- package/package.json +4 -3
- package/dist/docs/package-name.d.ts +0 -18
- package/dist/docs/package-name.js +0 -18
- package/dist/docs/quickstart.md +0 -43
|
@@ -129,11 +129,11 @@
|
|
|
129
129
|
<div
|
|
130
130
|
data-active={active || undefined}
|
|
131
131
|
class={cn(
|
|
132
|
-
// The trailing buttons are
|
|
133
|
-
// 2px of air around the glyph (
|
|
134
|
-
//
|
|
135
|
-
// box nests in the row's rd-
|
|
136
|
-
// rd-
|
|
132
|
+
// The trailing buttons are pill-tier icon buttons: h-pill box + h-icon glyph =
|
|
133
|
+
// 2px of air around the glyph (the icon tier would hug it flush — density.css:
|
|
134
|
+
// the icon tier IS the glyph). pr is their concentric inset: a button's rounded
|
|
135
|
+
// box nests in the row's rd-control corner only when its right gap equals
|
|
136
|
+
// rd-control − rd-pill = pill-inset-control (3/5/7), which its vertical gap already is
|
|
137
137
|
// via items-center. pl stays inset-md so the leading glyph + title align
|
|
138
138
|
// with the group heading (a bare glyph has no corner to nest).
|
|
139
139
|
//
|
package/dist/docs/button.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<Button onclick={() => console.log('clicked')}>Save</Button>
|
|
9
|
-
<Button tone="accent" size="
|
|
9
|
+
<Button tone="accent" size="chip">Confirm</Button>
|
|
10
10
|
<Button tone="destructive" variant="link">Delete</Button>
|
|
11
11
|
<Button icon size="icon" aria-label="Close"><X /></Button>
|
|
12
12
|
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { importLine } from './consumer-import.js';
|
|
2
2
|
import { extractProps } from './extract-props.js';
|
|
3
3
|
export function buildComponentDocFromSources(entry, sources, appendix) {
|
|
4
4
|
const { slug, name, description } = entry;
|
|
@@ -12,7 +12,7 @@ export function buildComponentDocFromSources(entry, sources, appendix) {
|
|
|
12
12
|
}
|
|
13
13
|
return lines.join('\n');
|
|
14
14
|
}
|
|
15
|
-
lines.push('## Import', '', '```ts',
|
|
15
|
+
lines.push('## Import', '', '```ts', importLine(root.kind, root.alias, slug), '```', '');
|
|
16
16
|
const subs = sources.subExportsBySlug[slug] ?? [];
|
|
17
17
|
const files = sources.svelteBySlug[slug] ?? {};
|
|
18
18
|
if (root.kind === 'namespace') {
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
/** How a component is re-exported by the internal barrel. */
|
|
29
|
+
export type ImportKind = 'named' | 'namespace';
|
|
30
|
+
/** The import statement, in the spelling that actually resolves. */
|
|
31
|
+
export declare function importLine(kind: ImportKind, alias: string, slug: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* The symbol a consumer must be able to reach, given the documented import.
|
|
34
|
+
* For a namespace import that is nothing — `import * as X` always binds — so
|
|
35
|
+
* only named imports can be checked against the component's own exports.
|
|
36
|
+
*/
|
|
37
|
+
export declare function requiredExport(kind: ImportKind, alias: string): string | null;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
/** The import statement, in the spelling that actually resolves. */
|
|
29
|
+
export function importLine(kind, alias, slug) {
|
|
30
|
+
const spec = `"${PACKAGE}/${slug}"`;
|
|
31
|
+
return kind === 'namespace'
|
|
32
|
+
? `import * as ${alias} from ${spec};`
|
|
33
|
+
: `import { ${alias} } from ${spec};`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The symbol a consumer must be able to reach, given the documented import.
|
|
37
|
+
* For a namespace import that is nothing — `import * as X` always binds — so
|
|
38
|
+
* only named imports can be checked against the component's own exports.
|
|
39
|
+
*/
|
|
40
|
+
export function requiredExport(kind, alias) {
|
|
41
|
+
return kind === 'named' ? alias : null;
|
|
42
|
+
}
|
|
@@ -248,6 +248,17 @@ const INTRO = [
|
|
|
248
248
|
'| `text-body` | density-derived body/control text size |',
|
|
249
249
|
'| `p-gutter` / `gap-gutter` / `mt-gutter` / … | the spacing scale — EVERY spacing prefix works |',
|
|
250
250
|
'',
|
|
251
|
+
'THE SPACING NAMES IN SIZE ORDER, smallest first, because the names do not',
|
|
252
|
+
'imply it and guessing gets it backwards:',
|
|
253
|
+
'',
|
|
254
|
+
' gutter < panel < field < card < content',
|
|
255
|
+
'',
|
|
256
|
+
'Measured at `data-mode="balanced"`: gutter 5px, field ~9px, card ~11px,',
|
|
257
|
+
'content ~22px. `gutter` is the TIGHT one — the gap between sibling controls',
|
|
258
|
+
"and a rail's own padding. `field` is a text input's side padding, not the",
|
|
259
|
+
'label-to-input gap. Reading them the other way round produces a layout whose',
|
|
260
|
+
'hierarchy is inverted and therefore reads flat.',
|
|
261
|
+
'',
|
|
251
262
|
'The spacing names (`gutter`, `card`, `panel`, `content`, `menu`, `field`, the',
|
|
252
263
|
'`inset-*` and concentric `*-inset-*` insets, `glyph-*`) are registered as a',
|
|
253
264
|
'Tailwind spacing scale, so every prefix derives automatically: `p-`, `px-`,',
|