@dorsk/tsumikit 0.2.12 → 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;
@@ -128,7 +128,11 @@
128
128
  }
129
129
  .textarea {
130
130
  width: 100%;
131
- padding: var(--sp-3);
131
+ /* Horizontal padding matches Input/Button; vertical padding is tighter
132
+ (--sp-2) so a single line-box + border actually fits the 2.5rem floor —
133
+ --sp-3 top+bottom would overshoot it and a `rows={1}` textarea would
134
+ render taller than the buttons it sits beside. */
135
+ padding: var(--sp-2) var(--sp-3);
132
136
  background: var(--bg);
133
137
  border: 1px solid var(--border-strong);
134
138
  border-radius: var(--r-md);
@@ -139,6 +143,7 @@
139
143
  /* Match the single-row height of Button/Input so a `rows={1}` textarea
140
144
  lines up with them; the native `rows` attribute grows it from here. */
141
145
  min-height: 2.5rem;
146
+ line-height: var(--lh-tight);
142
147
  font-family: inherit;
143
148
  }
144
149
  .textarea:focus {
@@ -146,7 +151,7 @@
146
151
  border-color: var(--accent);
147
152
  }
148
153
  .textarea-sm {
149
- padding: var(--sp-2);
154
+ padding: var(--sp-1) var(--sp-2);
150
155
  font-size: var(--fs-sm);
151
156
  min-height: 2rem;
152
157
  }
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dorsk/tsumikit",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "description": "Minimal, dependency-free Svelte 5 + pure-CSS UI kit. Token-driven atoms, molecules & layouts with theming out of the box.",
5
5
  "type": "module",
6
6
  "license": "MIT",