@dorsk/tsumikit 0.2.13 → 0.2.14
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.
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// adds a subtle fill on hover. For stateful controls — an "on"/active toggle
|
|
9
9
|
// (`accent`), or cost/severity states (`info`, `warn`).
|
|
10
10
|
tone?: 'none' | 'accent' | 'info' | 'warn' | 'danger';
|
|
11
|
-
size?: 'sm' | 'md';
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
12
|
control?: boolean;
|
|
13
13
|
block?: boolean;
|
|
14
14
|
// Square 2.25rem icon-only tap target (IconButton). `iconInline` is the
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
class:btn-ghost={variant === 'ghost'}
|
|
60
60
|
class:btn-danger={variant === 'danger'}
|
|
61
61
|
class:btn-sm={size === 'sm'}
|
|
62
|
+
class:btn-lg={size === 'lg'}
|
|
62
63
|
class:btn-control={control}
|
|
63
64
|
class:btn-block={block}
|
|
64
65
|
class:btn-icon={icon}
|
|
@@ -139,6 +140,11 @@
|
|
|
139
140
|
padding: var(--sp-1) var(--sp-3);
|
|
140
141
|
font-size: var(--fs-xs);
|
|
141
142
|
}
|
|
143
|
+
.btn-lg {
|
|
144
|
+
min-height: 3rem;
|
|
145
|
+
padding: var(--sp-3) var(--sp-5);
|
|
146
|
+
font-size: var(--fs-base);
|
|
147
|
+
}
|
|
142
148
|
.btn-block {
|
|
143
149
|
width: 100%;
|
|
144
150
|
}
|
|
@@ -3,7 +3,7 @@ import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
|
3
3
|
type ButtonProps = HTMLButtonAttributes & {
|
|
4
4
|
variant?: 'default' | 'primary' | 'ghost' | 'danger';
|
|
5
5
|
tone?: 'none' | 'accent' | 'info' | 'warn' | 'danger';
|
|
6
|
-
size?: 'sm' | 'md';
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
7
|
control?: boolean;
|
|
8
8
|
block?: boolean;
|
|
9
9
|
icon?: boolean;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
multiple = false,
|
|
15
15
|
disabled = false,
|
|
16
16
|
variant = 'default',
|
|
17
|
+
size = 'md',
|
|
17
18
|
class: klass = ''
|
|
18
19
|
}: {
|
|
19
20
|
onfiles: (files: File[]) => void;
|
|
@@ -28,6 +29,9 @@
|
|
|
28
29
|
multiple?: boolean;
|
|
29
30
|
disabled?: boolean;
|
|
30
31
|
variant?: 'default' | 'primary' | 'ghost';
|
|
32
|
+
/** Match the Button atom's sizes so a FileButton lines up with buttons in
|
|
33
|
+
* the same row. */
|
|
34
|
+
size?: 'sm' | 'md' | 'lg';
|
|
31
35
|
class?: string;
|
|
32
36
|
} = $props();
|
|
33
37
|
|
|
@@ -43,6 +47,8 @@
|
|
|
43
47
|
class="file-btn {klass}"
|
|
44
48
|
class:primary={variant === 'primary'}
|
|
45
49
|
class:ghost={variant === 'ghost'}
|
|
50
|
+
class:sm={size === 'sm'}
|
|
51
|
+
class:lg={size === 'lg'}
|
|
46
52
|
class:icon-only={iconOnly}
|
|
47
53
|
class:disabled
|
|
48
54
|
aria-label={iconOnly ? label : undefined}
|
|
@@ -92,6 +98,17 @@
|
|
|
92
98
|
.file-btn:hover:not(.disabled) {
|
|
93
99
|
border-color: var(--accent);
|
|
94
100
|
}
|
|
101
|
+
/* Size variants mirror the Button atom (sm 2rem / md 2.5rem / lg 3rem). */
|
|
102
|
+
.file-btn.sm {
|
|
103
|
+
min-height: 2rem;
|
|
104
|
+
padding: var(--sp-1) var(--sp-3);
|
|
105
|
+
font-size: var(--fs-xs);
|
|
106
|
+
}
|
|
107
|
+
.file-btn.lg {
|
|
108
|
+
min-height: 3rem;
|
|
109
|
+
padding: var(--sp-3) var(--sp-5);
|
|
110
|
+
font-size: var(--fs-base);
|
|
111
|
+
}
|
|
95
112
|
/* icon-only: square it up and drop the label gap. */
|
|
96
113
|
.file-btn.icon-only {
|
|
97
114
|
gap: 0;
|
|
@@ -12,6 +12,9 @@ type $$ComponentProps = {
|
|
|
12
12
|
multiple?: boolean;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
variant?: 'default' | 'primary' | 'ghost';
|
|
15
|
+
/** Match the Button atom's sizes so a FileButton lines up with buttons in
|
|
16
|
+
* the same row. */
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
15
18
|
class?: string;
|
|
16
19
|
};
|
|
17
20
|
declare const FileButton: import("svelte").Component<$$ComponentProps, {}, "">;
|
package/package.json
CHANGED