@signal9/era-ui 2.18.1 → 2.20.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/generated-docs/about.md +3 -0
- package/dist/generated-docs/copy-button.md +4 -0
- package/dist/generated-docs/llms-full.txt +12 -0
- package/dist/generated-docs/llms.txt +1 -1
- package/dist/generated-docs/manifest.json +9 -1
- package/dist/ui/copy-button/copy-button.svelte +15 -3
- package/dist/ui/copy-button/copy-button.svelte.d.ts +10 -1
- package/package.json +1 -1
|
@@ -23,3 +23,7 @@ is resolved on each click, not at render. |
|
|
|
23
23
|
| `resetDelay?` | `number` | `1500` | How long the result icon holds before falling back to idle. |
|
|
24
24
|
| `label?` | `string` | `'Copy'` | Accessible name in the idle and failure states. |
|
|
25
25
|
| `copiedLabel?` | `string` | `'Copied'` | Accessible name while the success icon is showing. |
|
|
26
|
+
| `idleIcon?` | `Component<IconProps>` | `Copy` | Idle-state glyph (the "copy" affordance). Swap to match a host
|
|
27
|
+
icon set — any component taking lucide's IconProps fits. |
|
|
28
|
+
| `successIcon?` | `Component<IconProps>` | `Check` | Glyph shown after a successful write. |
|
|
29
|
+
| `failureIcon?` | `Component<IconProps>` | `X` | Glyph shown after a failed write. |
|
|
@@ -31,6 +31,14 @@ Full concatenated reference: `/llms-full.txt`.
|
|
|
31
31
|
|
|
32
32
|
<!-- Full component documentation, concatenated. -->
|
|
33
33
|
|
|
34
|
+
<!-- begin: about -->
|
|
35
|
+
|
|
36
|
+
# About
|
|
37
|
+
|
|
38
|
+
What era ui is — density, surface, corners, type, and colour as orthogonal axes.
|
|
39
|
+
|
|
40
|
+
<!-- end: about -->
|
|
41
|
+
|
|
34
42
|
<!-- begin: spacing -->
|
|
35
43
|
|
|
36
44
|
# Spacing
|
|
@@ -462,6 +470,10 @@ is resolved on each click, not at render. |
|
|
|
462
470
|
| `resetDelay?` | `number` | `1500` | How long the result icon holds before falling back to idle. |
|
|
463
471
|
| `label?` | `string` | `'Copy'` | Accessible name in the idle and failure states. |
|
|
464
472
|
| `copiedLabel?` | `string` | `'Copied'` | Accessible name while the success icon is showing. |
|
|
473
|
+
| `idleIcon?` | `Component<IconProps>` | `Copy` | Idle-state glyph (the "copy" affordance). Swap to match a host
|
|
474
|
+
icon set — any component taking lucide's IconProps fits. |
|
|
475
|
+
| `successIcon?` | `Component<IconProps>` | `Check` | Glyph shown after a successful write. |
|
|
476
|
+
| `failureIcon?` | `Component<IconProps>` | `X` | Glyph shown after a failed write. |
|
|
465
477
|
|
|
466
478
|
<!-- end: copy-button -->
|
|
467
479
|
|
|
@@ -31,4 +31,4 @@ Full concatenated reference: `{{ORIGIN}}/llms-full.txt`.
|
|
|
31
31
|
|
|
32
32
|
## Components
|
|
33
33
|
|
|
34
|
-
spacing, surfaces, measurements, text, draggable, llm-shell, os, aspect-ratio, badge, avatar, bar, button, button-group, pane, card, chip, code-block, copy-button, kv, separator, sheet, skeleton, switch, toggle, accordion, alert-dialog, calendar, checkbox, collapsible, combobox, command, command-bar, step, context-menu, date-field, date-picker, date-range-field, date-range-picker, dialog, dropdown-menu, file-upload, scroll-area, input, link-preview, label, menu, menubar, meter, navigation-menu, mode, pagination, pin-input, popover, progress, range-calendar, radio-group, rating-group, select, slider, table, tabs, time-field, time-range-field, toggle-group, toolbar, video-player, tooltip
|
|
34
|
+
about, spacing, surfaces, measurements, text, draggable, llm-shell, os, aspect-ratio, badge, avatar, bar, button, button-group, pane, card, chip, code-block, copy-button, kv, separator, sheet, skeleton, switch, toggle, accordion, alert-dialog, calendar, checkbox, collapsible, combobox, command, command-bar, step, context-menu, date-field, date-picker, date-range-field, date-range-picker, dialog, dropdown-menu, file-upload, scroll-area, input, link-preview, label, menu, menubar, meter, navigation-menu, mode, pagination, pin-input, popover, progress, range-calendar, radio-group, rating-group, select, slider, table, tabs, time-field, time-range-field, toggle-group, toolbar, video-player, tooltip
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
{
|
|
4
|
+
"slug": "about",
|
|
5
|
+
"title": "About",
|
|
6
|
+
"summary": "What era ui is — density, surface, corners, type, and colour as orthogonal axes.",
|
|
7
|
+
"tokenEstimate": 23,
|
|
8
|
+
"sections": [],
|
|
9
|
+
"file": "about.md"
|
|
10
|
+
},
|
|
3
11
|
{
|
|
4
12
|
"slug": "spacing",
|
|
5
13
|
"title": "Spacing",
|
|
@@ -178,7 +186,7 @@
|
|
|
178
186
|
"slug": "copy-button",
|
|
179
187
|
"title": "Copy Button",
|
|
180
188
|
"summary": "An icon button that copies text and cross-fades to a result glyph.",
|
|
181
|
-
"tokenEstimate":
|
|
189
|
+
"tokenEstimate": 345,
|
|
182
190
|
"sections": [
|
|
183
191
|
"Import",
|
|
184
192
|
"Props"
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
import type { Component } from 'svelte';
|
|
4
|
+
import type { IconProps } from '@lucide/svelte';
|
|
3
5
|
import Copy from '@lucide/svelte/icons/copy';
|
|
4
6
|
import Check from '@lucide/svelte/icons/check';
|
|
5
7
|
import X from '@lucide/svelte/icons/x';
|
|
@@ -14,6 +16,9 @@
|
|
|
14
16
|
label = 'Copy',
|
|
15
17
|
copiedLabel = 'Copied',
|
|
16
18
|
size = 'sm',
|
|
19
|
+
idleIcon: IdleIcon = Copy,
|
|
20
|
+
successIcon: SuccessIcon = Check,
|
|
21
|
+
failureIcon: FailureIcon = X,
|
|
17
22
|
class: className,
|
|
18
23
|
...restProps
|
|
19
24
|
// Typed off the native button rather than bits-ui's Button.RootProps: the
|
|
@@ -36,6 +41,13 @@
|
|
|
36
41
|
label?: string;
|
|
37
42
|
/** Accessible name while the success icon is showing. */
|
|
38
43
|
copiedLabel?: string;
|
|
44
|
+
/** Idle-state glyph (the "copy" affordance). Swap to match a host
|
|
45
|
+
* icon set — any component taking lucide's IconProps fits. */
|
|
46
|
+
idleIcon?: Component<IconProps>;
|
|
47
|
+
/** Glyph shown after a successful write. */
|
|
48
|
+
successIcon?: Component<IconProps>;
|
|
49
|
+
/** Glyph shown after a failed write. */
|
|
50
|
+
failureIcon?: Component<IconProps>;
|
|
39
51
|
} = $props();
|
|
40
52
|
|
|
41
53
|
let status = $state<'idle' | 'success' | 'failure'>('idle');
|
|
@@ -78,8 +90,8 @@
|
|
|
78
90
|
{...restProps}
|
|
79
91
|
>
|
|
80
92
|
<span class="relative block size-(--era-h-xs) shrink-0">
|
|
81
|
-
<
|
|
82
|
-
<
|
|
83
|
-
<
|
|
93
|
+
<IdleIcon class={cn(iconBase, status === 'idle' ? iconIn : iconOut)} />
|
|
94
|
+
<SuccessIcon class={cn(iconBase, 'text-success', status === 'success' ? iconIn : iconOut)} />
|
|
95
|
+
<FailureIcon class={cn(iconBase, 'text-destructive', status === 'failure' ? iconIn : iconOut)} />
|
|
84
96
|
</span>
|
|
85
97
|
</Button>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
2
|
+
import type { Component } from 'svelte';
|
|
3
|
+
import type { IconProps } from '@lucide/svelte';
|
|
2
4
|
import { type ButtonVariants } from '../button/index.js';
|
|
3
5
|
type $$ComponentProps = Omit<HTMLButtonAttributes, 'onclick' | 'children'> & {
|
|
4
6
|
ref?: HTMLElement | null;
|
|
@@ -17,7 +19,14 @@ type $$ComponentProps = Omit<HTMLButtonAttributes, 'onclick' | 'children'> & {
|
|
|
17
19
|
label?: string;
|
|
18
20
|
/** Accessible name while the success icon is showing. */
|
|
19
21
|
copiedLabel?: string;
|
|
22
|
+
/** Idle-state glyph (the "copy" affordance). Swap to match a host
|
|
23
|
+
* icon set — any component taking lucide's IconProps fits. */
|
|
24
|
+
idleIcon?: Component<IconProps>;
|
|
25
|
+
/** Glyph shown after a successful write. */
|
|
26
|
+
successIcon?: Component<IconProps>;
|
|
27
|
+
/** Glyph shown after a failed write. */
|
|
28
|
+
failureIcon?: Component<IconProps>;
|
|
20
29
|
};
|
|
21
|
-
declare const CopyButton:
|
|
30
|
+
declare const CopyButton: Component<$$ComponentProps, {}, "ref">;
|
|
22
31
|
type CopyButton = ReturnType<typeof CopyButton>;
|
|
23
32
|
export default CopyButton;
|