plasma-svelte 0.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/README.md +65 -0
- package/dist/accordion/Accordion.svelte +28 -0
- package/dist/accordion/Accordion.svelte.d.ts +8 -0
- package/dist/accordion/AccordionItem.svelte +193 -0
- package/dist/accordion/AccordionItem.svelte.d.ts +14 -0
- package/dist/avatar/Avatar.svelte +178 -0
- package/dist/avatar/Avatar.svelte.d.ts +16 -0
- package/dist/badge/Badge.svelte +162 -0
- package/dist/badge/Badge.svelte.d.ts +16 -0
- package/dist/breadcrumb/Breadcrumb.svelte +59 -0
- package/dist/breadcrumb/Breadcrumb.svelte.d.ts +9 -0
- package/dist/breadcrumb/BreadcrumbItem.svelte +151 -0
- package/dist/breadcrumb/BreadcrumbItem.svelte.d.ts +14 -0
- package/dist/button/Button.svelte +274 -0
- package/dist/button/Button.svelte.d.ts +22 -0
- package/dist/button/ButtonGroup.svelte +98 -0
- package/dist/button/ButtonGroup.svelte.d.ts +12 -0
- package/dist/card/Card.svelte +191 -0
- package/dist/card/Card.svelte.d.ts +18 -0
- package/dist/checkbox/Checkbox.svelte +199 -0
- package/dist/checkbox/Checkbox.svelte.d.ts +12 -0
- package/dist/datepicker/DatePicker.svelte +509 -0
- package/dist/datepicker/DatePicker.svelte.d.ts +14 -0
- package/dist/divider/Divider.svelte +112 -0
- package/dist/divider/Divider.svelte.d.ts +13 -0
- package/dist/drawer/Drawer.svelte +330 -0
- package/dist/drawer/Drawer.svelte.d.ts +21 -0
- package/dist/dropzone/DropZone.svelte +282 -0
- package/dist/dropzone/DropZone.svelte.d.ts +17 -0
- package/dist/emptystate/EmptyState.svelte +169 -0
- package/dist/emptystate/EmptyState.svelte.d.ts +15 -0
- package/dist/headerbar/HeaderBar.svelte +210 -0
- package/dist/headerbar/HeaderBar.svelte.d.ts +17 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +44 -0
- package/dist/input/Input.svelte +227 -0
- package/dist/input/Input.svelte.d.ts +14 -0
- package/dist/layout/Flex.svelte +110 -0
- package/dist/layout/Flex.svelte.d.ts +20 -0
- package/dist/layout/Grid.svelte +78 -0
- package/dist/layout/Grid.svelte.d.ts +19 -0
- package/dist/layout/Space.svelte +64 -0
- package/dist/layout/Space.svelte.d.ts +16 -0
- package/dist/layout/utils.d.ts +2 -0
- package/dist/layout/utils.js +19 -0
- package/dist/menu/Menu.svelte +156 -0
- package/dist/menu/Menu.svelte.d.ts +14 -0
- package/dist/menu/MenuDivider.svelte +19 -0
- package/dist/menu/MenuDivider.svelte.d.ts +6 -0
- package/dist/menu/MenuItem.svelte +126 -0
- package/dist/menu/MenuItem.svelte.d.ts +13 -0
- package/dist/message/InlineMessage.svelte +226 -0
- package/dist/message/InlineMessage.svelte.d.ts +15 -0
- package/dist/modal/ConfirmDialog.svelte +151 -0
- package/dist/modal/ConfirmDialog.svelte.d.ts +19 -0
- package/dist/modal/Modal.svelte +279 -0
- package/dist/modal/Modal.svelte.d.ts +18 -0
- package/dist/pagination/Pagination.svelte +258 -0
- package/dist/pagination/Pagination.svelte.d.ts +16 -0
- package/dist/progress/ProgressBar.svelte +179 -0
- package/dist/progress/ProgressBar.svelte.d.ts +15 -0
- package/dist/radio/Radio.svelte +161 -0
- package/dist/radio/Radio.svelte.d.ts +13 -0
- package/dist/searchfield/SearchField.svelte +246 -0
- package/dist/searchfield/SearchField.svelte.d.ts +15 -0
- package/dist/select/Select.svelte +392 -0
- package/dist/select/Select.svelte.d.ts +20 -0
- package/dist/sidebar/Sidebar.svelte +78 -0
- package/dist/sidebar/Sidebar.svelte.d.ts +11 -0
- package/dist/sidebar/SidebarGroup.svelte +51 -0
- package/dist/sidebar/SidebarGroup.svelte.d.ts +9 -0
- package/dist/sidebar/SidebarItem.svelte +185 -0
- package/dist/sidebar/SidebarItem.svelte.d.ts +16 -0
- package/dist/slider/Slider.svelte +204 -0
- package/dist/slider/Slider.svelte.d.ts +16 -0
- package/dist/spinbox/SpinBox.svelte +299 -0
- package/dist/spinbox/SpinBox.svelte.d.ts +20 -0
- package/dist/spinner/Spinner.svelte +130 -0
- package/dist/spinner/Spinner.svelte.d.ts +11 -0
- package/dist/style/base.css +178 -0
- package/dist/style/index.css +2 -0
- package/dist/style/token.css +230 -0
- package/dist/switch/Switch.svelte +199 -0
- package/dist/switch/Switch.svelte.d.ts +13 -0
- package/dist/table/Table.svelte +305 -0
- package/dist/table/Table.svelte.d.ts +32 -0
- package/dist/tabs/Tabs.svelte +216 -0
- package/dist/tabs/Tabs.svelte.d.ts +21 -0
- package/dist/textarea/TextArea.svelte +114 -0
- package/dist/textarea/TextArea.svelte.d.ts +14 -0
- package/dist/timepicker/TimePicker.svelte +452 -0
- package/dist/timepicker/TimePicker.svelte.d.ts +16 -0
- package/dist/tooltip/Tooltip.svelte +122 -0
- package/dist/tooltip/Tooltip.svelte.d.ts +12 -0
- package/package.json +66 -0
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
type SpinBoxSize = "sm" | "md" | "lg" | "small" | "medium" | "large";
|
|
6
|
+
|
|
7
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "size" | "onchange" | "prefix"> {
|
|
8
|
+
value?: number;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
step?: number;
|
|
12
|
+
size?: SpinBoxSize;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
prefix?: string | Snippet;
|
|
17
|
+
suffix?: string | Snippet;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
onchange?: (val: number) => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
let {
|
|
24
|
+
value = $bindable(0),
|
|
25
|
+
min = -Infinity,
|
|
26
|
+
max = Infinity,
|
|
27
|
+
step = 1,
|
|
28
|
+
size = "md",
|
|
29
|
+
disabled = false,
|
|
30
|
+
readonly = false,
|
|
31
|
+
invalid = false,
|
|
32
|
+
prefix,
|
|
33
|
+
suffix,
|
|
34
|
+
placeholder = "",
|
|
35
|
+
onchange,
|
|
36
|
+
class: customClass = "",
|
|
37
|
+
id,
|
|
38
|
+
...restProps
|
|
39
|
+
}: Props = $props();
|
|
40
|
+
|
|
41
|
+
const resolvedSize = $derived(
|
|
42
|
+
size === "small"
|
|
43
|
+
? "sm"
|
|
44
|
+
: size === "large"
|
|
45
|
+
? "lg"
|
|
46
|
+
: size === "medium"
|
|
47
|
+
? "md"
|
|
48
|
+
: size
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
function clamp(val: number): number {
|
|
52
|
+
return Math.min(max, Math.max(min, val));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function increment() {
|
|
56
|
+
if (disabled || readonly) return;
|
|
57
|
+
const next = clamp((value ?? 0) + step);
|
|
58
|
+
value = next;
|
|
59
|
+
onchange?.(next);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function decrement() {
|
|
63
|
+
if (disabled || readonly) return;
|
|
64
|
+
const next = clamp((value ?? 0) - step);
|
|
65
|
+
value = next;
|
|
66
|
+
onchange?.(next);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function handleInput(e: Event) {
|
|
70
|
+
const target = e.target as HTMLInputElement;
|
|
71
|
+
const num = parseFloat(target.value);
|
|
72
|
+
if (!isNaN(num)) {
|
|
73
|
+
value = clamp(num);
|
|
74
|
+
onchange?.(value);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function handleKeydown(e: KeyboardEvent) {
|
|
79
|
+
if (disabled || readonly) return;
|
|
80
|
+
if (e.key === "ArrowUp") {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
increment();
|
|
83
|
+
} else if (e.key === "ArrowDown") {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
decrement();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<div
|
|
91
|
+
class="plasma-spinbox plasma-spinbox--{resolvedSize} {customClass}"
|
|
92
|
+
class:plasma-spinbox--disabled={disabled}
|
|
93
|
+
class:plasma-spinbox--readonly={readonly}
|
|
94
|
+
class:plasma-spinbox--invalid={invalid}
|
|
95
|
+
{...restProps}
|
|
96
|
+
>
|
|
97
|
+
{#if prefix}
|
|
98
|
+
<span class="plasma-spinbox-affix plasma-spinbox-prefix">
|
|
99
|
+
{#if typeof prefix === "string"}
|
|
100
|
+
{prefix}
|
|
101
|
+
{:else}
|
|
102
|
+
{@render prefix()}
|
|
103
|
+
{/if}
|
|
104
|
+
</span>
|
|
105
|
+
{/if}
|
|
106
|
+
|
|
107
|
+
<input
|
|
108
|
+
{id}
|
|
109
|
+
type="number"
|
|
110
|
+
{min}
|
|
111
|
+
{max}
|
|
112
|
+
{step}
|
|
113
|
+
{disabled}
|
|
114
|
+
{readonly}
|
|
115
|
+
{placeholder}
|
|
116
|
+
value={value}
|
|
117
|
+
oninput={handleInput}
|
|
118
|
+
onkeydown={handleKeydown}
|
|
119
|
+
class="plasma-spinbox-input"
|
|
120
|
+
/>
|
|
121
|
+
|
|
122
|
+
{#if suffix}
|
|
123
|
+
<span class="plasma-spinbox-affix plasma-spinbox-suffix">
|
|
124
|
+
{#if typeof suffix === "string"}
|
|
125
|
+
{suffix}
|
|
126
|
+
{:else}
|
|
127
|
+
{@render suffix()}
|
|
128
|
+
{/if}
|
|
129
|
+
</span>
|
|
130
|
+
{/if}
|
|
131
|
+
|
|
132
|
+
<div class="plasma-spinbox-steppers">
|
|
133
|
+
<button
|
|
134
|
+
type="button"
|
|
135
|
+
tabindex="-1"
|
|
136
|
+
aria-label="Increment"
|
|
137
|
+
{disabled}
|
|
138
|
+
onclick={increment}
|
|
139
|
+
class="plasma-spinbox-btn plasma-spinbox-btn--up"
|
|
140
|
+
>
|
|
141
|
+
<svg aria-hidden="true" viewBox="0 0 16 16" width="10" height="10" fill="currentColor">
|
|
142
|
+
<path d="M3.146 10.354a.5.5 0 0 1 0-.708l4.5-4.5a.5.5 0 0 1 .708 0l4.5 4.5a.5.5 0 0 1-.708.708L8 6.207l-4.146 4.147a.5.5 0 0 1-.708 0z" />
|
|
143
|
+
</svg>
|
|
144
|
+
</button>
|
|
145
|
+
<button
|
|
146
|
+
type="button"
|
|
147
|
+
tabindex="-1"
|
|
148
|
+
aria-label="Decrement"
|
|
149
|
+
{disabled}
|
|
150
|
+
onclick={decrement}
|
|
151
|
+
class="plasma-spinbox-btn plasma-spinbox-btn--down"
|
|
152
|
+
>
|
|
153
|
+
<svg aria-hidden="true" viewBox="0 0 16 16" width="10" height="10" fill="currentColor">
|
|
154
|
+
<path d="M3.146 5.646a.5.5 0 0 0 0 .708l4.5 4.5a.5.5 0 0 0 .708 0l4.5-4.5a.5.5 0 0 0-.708-.708L8 9.793 3.854 5.646a.5.5 0 0 0-.708 0z" />
|
|
155
|
+
</svg>
|
|
156
|
+
</button>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<style>
|
|
161
|
+
.plasma-spinbox {
|
|
162
|
+
position: relative;
|
|
163
|
+
display: inline-flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
width: 100%;
|
|
166
|
+
box-sizing: border-box;
|
|
167
|
+
font-family: var(--plasma-font-sans);
|
|
168
|
+
background-color: var(--plasma-color-view-bg);
|
|
169
|
+
border: 1px solid var(--plasma-color-border);
|
|
170
|
+
border-radius: var(--plasma-radius-md);
|
|
171
|
+
color: var(--plasma-color-text);
|
|
172
|
+
box-shadow: var(--plasma-shadow-xs);
|
|
173
|
+
transition: var(--plasma-transition-fast);
|
|
174
|
+
overflow: hidden;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.plasma-spinbox:hover:not(.plasma-spinbox--disabled):not(:focus-within) {
|
|
178
|
+
border-color: var(--plasma-color-border-hover);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.plasma-spinbox:focus-within:not(.plasma-spinbox--disabled) {
|
|
182
|
+
border-color: var(--plasma-color-highlight);
|
|
183
|
+
box-shadow: var(--plasma-shadow-focus);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.plasma-spinbox--invalid {
|
|
187
|
+
border-color: var(--plasma-color-negative);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.plasma-spinbox--disabled {
|
|
191
|
+
opacity: 0.45;
|
|
192
|
+
cursor: not-allowed;
|
|
193
|
+
background-color: var(--plasma-color-surface-sunken);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* --------------------------------------------------------------------------
|
|
197
|
+
Input Field
|
|
198
|
+
-------------------------------------------------------------------------- */
|
|
199
|
+
.plasma-spinbox-input {
|
|
200
|
+
flex: 1;
|
|
201
|
+
min-width: 0;
|
|
202
|
+
height: 100%;
|
|
203
|
+
border: none;
|
|
204
|
+
outline: none;
|
|
205
|
+
background: transparent;
|
|
206
|
+
color: inherit;
|
|
207
|
+
font-family: var(--plasma-font-mono);
|
|
208
|
+
font-size: inherit;
|
|
209
|
+
padding: 0 var(--plasma-space-sm);
|
|
210
|
+
appearance: textfield;
|
|
211
|
+
-moz-appearance: textfield;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
.plasma-spinbox-input::-webkit-outer-spin-button,
|
|
216
|
+
.plasma-spinbox-input::-webkit-inner-spin-button {
|
|
217
|
+
-webkit-appearance: none;
|
|
218
|
+
margin: 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.plasma-spinbox-affix {
|
|
222
|
+
display: inline-flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
color: var(--plasma-color-text-muted);
|
|
225
|
+
font-size: var(--plasma-font-size-xs);
|
|
226
|
+
user-select: none;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.plasma-spinbox-prefix {
|
|
230
|
+
padding-left: var(--plasma-space-sm);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.plasma-spinbox-suffix {
|
|
234
|
+
padding-right: var(--plasma-space-xs);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* --------------------------------------------------------------------------
|
|
238
|
+
Sizing
|
|
239
|
+
-------------------------------------------------------------------------- */
|
|
240
|
+
.plasma-spinbox--sm {
|
|
241
|
+
height: var(--plasma-control-height-sm);
|
|
242
|
+
font-size: var(--plasma-font-size-xs);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.plasma-spinbox--md {
|
|
246
|
+
height: var(--plasma-control-height-md);
|
|
247
|
+
font-size: var(--plasma-font-size-base);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.plasma-spinbox--lg {
|
|
251
|
+
height: var(--plasma-control-height-lg);
|
|
252
|
+
font-size: var(--plasma-font-size-md);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* --------------------------------------------------------------------------
|
|
256
|
+
Stepper Buttons
|
|
257
|
+
-------------------------------------------------------------------------- */
|
|
258
|
+
.plasma-spinbox-steppers {
|
|
259
|
+
display: flex;
|
|
260
|
+
flex-direction: column;
|
|
261
|
+
height: 100%;
|
|
262
|
+
width: 24px;
|
|
263
|
+
border-left: 1px solid var(--plasma-color-border-subtle);
|
|
264
|
+
background-color: var(--plasma-color-surface);
|
|
265
|
+
flex-shrink: 0;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.plasma-spinbox-btn {
|
|
269
|
+
display: flex;
|
|
270
|
+
align-items: center;
|
|
271
|
+
justify-content: center;
|
|
272
|
+
flex: 1;
|
|
273
|
+
border: none;
|
|
274
|
+
background: transparent;
|
|
275
|
+
color: var(--plasma-color-text-muted);
|
|
276
|
+
cursor: pointer;
|
|
277
|
+
padding: 0;
|
|
278
|
+
transition: var(--plasma-transition-fast);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.plasma-spinbox-btn--up {
|
|
282
|
+
border-bottom: 1px solid var(--plasma-color-border-subtle);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.plasma-spinbox-btn:hover:not(:disabled) {
|
|
286
|
+
background-color: var(--plasma-color-highlight-soft);
|
|
287
|
+
color: var(--plasma-color-highlight);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.plasma-spinbox-btn:active:not(:disabled) {
|
|
291
|
+
background-color: var(--plasma-color-highlight);
|
|
292
|
+
color: #ffffff;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.plasma-spinbox-btn:disabled {
|
|
296
|
+
cursor: not-allowed;
|
|
297
|
+
opacity: 0.5;
|
|
298
|
+
}
|
|
299
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
type SpinBoxSize = "sm" | "md" | "lg" | "small" | "medium" | "large";
|
|
4
|
+
interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "size" | "onchange" | "prefix"> {
|
|
5
|
+
value?: number;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
size?: SpinBoxSize;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
readonly?: boolean;
|
|
12
|
+
invalid?: boolean;
|
|
13
|
+
prefix?: string | Snippet;
|
|
14
|
+
suffix?: string | Snippet;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
onchange?: (val: number) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const SpinBox: import("svelte").Component<Props, {}, "value">;
|
|
19
|
+
type SpinBox = ReturnType<typeof SpinBox>;
|
|
20
|
+
export default SpinBox;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
|
|
4
|
+
type SpinnerSize = "sm" | "md" | "lg" | "xl";
|
|
5
|
+
type SpinnerVariant = "primary" | "current" | "white" | "muted";
|
|
6
|
+
|
|
7
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
size?: SpinnerSize;
|
|
9
|
+
variant?: SpinnerVariant;
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
size = "md",
|
|
15
|
+
variant = "primary",
|
|
16
|
+
label = "Loading...",
|
|
17
|
+
class: customClass = "",
|
|
18
|
+
...restProps
|
|
19
|
+
}: Props = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<div
|
|
23
|
+
role="status"
|
|
24
|
+
aria-label={label}
|
|
25
|
+
class="plasma-spinner plasma-spinner--{size} plasma-spinner--{variant} {customClass}"
|
|
26
|
+
{...restProps}
|
|
27
|
+
>
|
|
28
|
+
<span class="plasma-spinner-circle"></span>
|
|
29
|
+
<span class="sr-only">{label}</span>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<style>
|
|
33
|
+
.plasma-spinner {
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
position: relative;
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
vertical-align: middle;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.plasma-spinner-circle {
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
border-radius: var(--plasma-radius-full);
|
|
47
|
+
border-style: solid;
|
|
48
|
+
animation: plasma-spin 0.8s linear infinite;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* --------------------------------------------------------------------------
|
|
52
|
+
Sizing
|
|
53
|
+
-------------------------------------------------------------------------- */
|
|
54
|
+
.plasma-spinner--sm {
|
|
55
|
+
width: 14px;
|
|
56
|
+
height: 14px;
|
|
57
|
+
}
|
|
58
|
+
.plasma-spinner--sm .plasma-spinner-circle {
|
|
59
|
+
border-width: 2px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.plasma-spinner--md {
|
|
63
|
+
width: 20px;
|
|
64
|
+
height: 20px;
|
|
65
|
+
}
|
|
66
|
+
.plasma-spinner--md .plasma-spinner-circle {
|
|
67
|
+
border-width: 2.5px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.plasma-spinner--lg {
|
|
71
|
+
width: 32px;
|
|
72
|
+
height: 32px;
|
|
73
|
+
}
|
|
74
|
+
.plasma-spinner--lg .plasma-spinner-circle {
|
|
75
|
+
border-width: 3px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.plasma-spinner--xl {
|
|
79
|
+
width: 48px;
|
|
80
|
+
height: 48px;
|
|
81
|
+
}
|
|
82
|
+
.plasma-spinner--xl .plasma-spinner-circle {
|
|
83
|
+
border-width: 4px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* --------------------------------------------------------------------------
|
|
87
|
+
Variants
|
|
88
|
+
-------------------------------------------------------------------------- */
|
|
89
|
+
.plasma-spinner--primary .plasma-spinner-circle {
|
|
90
|
+
border-color: var(--plasma-color-border-subtle);
|
|
91
|
+
border-top-color: var(--plasma-color-highlight);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.plasma-spinner--current .plasma-spinner-circle {
|
|
95
|
+
border-color: transparent;
|
|
96
|
+
border-top-color: currentColor;
|
|
97
|
+
border-right-color: currentColor;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.plasma-spinner--white .plasma-spinner-circle {
|
|
101
|
+
border-color: rgba(255, 255, 255, 0.25);
|
|
102
|
+
border-top-color: #ffffff;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.plasma-spinner--muted .plasma-spinner-circle {
|
|
106
|
+
border-color: var(--plasma-color-border-subtle);
|
|
107
|
+
border-top-color: var(--plasma-color-text-muted);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.sr-only {
|
|
111
|
+
position: absolute;
|
|
112
|
+
width: 1px;
|
|
113
|
+
height: 1px;
|
|
114
|
+
padding: 0;
|
|
115
|
+
margin: -1px;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
clip: rect(0, 0, 0, 0);
|
|
118
|
+
white-space: nowrap;
|
|
119
|
+
border: 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@keyframes plasma-spin {
|
|
123
|
+
from {
|
|
124
|
+
transform: rotate(0deg);
|
|
125
|
+
}
|
|
126
|
+
to {
|
|
127
|
+
transform: rotate(360deg);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
type SpinnerSize = "sm" | "md" | "lg" | "xl";
|
|
3
|
+
type SpinnerVariant = "primary" | "current" | "white" | "muted";
|
|
4
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
size?: SpinnerSize;
|
|
6
|
+
variant?: SpinnerVariant;
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const Spinner: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type Spinner = ReturnType<typeof Spinner>;
|
|
11
|
+
export default Spinner;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Plasma / KDE Breeze Base & Global Styles
|
|
3
|
+
========================================================================== */
|
|
4
|
+
|
|
5
|
+
/* --------------------------------------------------------------------------
|
|
6
|
+
KDE Breeze Typography Web Fonts (Noto Sans & JetBrains Mono)
|
|
7
|
+
-------------------------------------------------------------------------- */
|
|
8
|
+
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=JetBrains+Mono:wght@400;500;600&display=swap');
|
|
9
|
+
|
|
10
|
+
*,
|
|
11
|
+
*::before,
|
|
12
|
+
*::after {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
html {
|
|
17
|
+
font-family: var(--plasma-font-sans);
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
line-height: var(--plasma-line-height-base);
|
|
20
|
+
-webkit-text-size-adjust: 100%;
|
|
21
|
+
tab-size: 4;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
body {
|
|
25
|
+
margin: 0;
|
|
26
|
+
font-family: var(--plasma-font-sans);
|
|
27
|
+
font-size: var(--plasma-font-size-base);
|
|
28
|
+
color: var(--plasma-color-text);
|
|
29
|
+
background-color: var(--plasma-color-window-bg);
|
|
30
|
+
-webkit-font-smoothing: antialiased;
|
|
31
|
+
-moz-osx-font-smoothing: grayscale;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* --------------------------------------------------------------------------
|
|
35
|
+
Headings & Typography Hierarchy
|
|
36
|
+
-------------------------------------------------------------------------- */
|
|
37
|
+
h1, h2, h3, h4, h5, h6 {
|
|
38
|
+
margin: 0 0 var(--plasma-space-sm) 0;
|
|
39
|
+
font-family: var(--plasma-font-sans);
|
|
40
|
+
font-weight: var(--plasma-font-weight-bold);
|
|
41
|
+
line-height: var(--plasma-line-height-tight);
|
|
42
|
+
color: var(--plasma-color-text);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
h1 { font-size: var(--plasma-font-size-2xl); }
|
|
46
|
+
h2 { font-size: var(--plasma-font-size-xl); }
|
|
47
|
+
h3 { font-size: var(--plasma-font-size-lg); }
|
|
48
|
+
h4 { font-size: var(--plasma-font-size-md); }
|
|
49
|
+
h5 { font-size: var(--plasma-font-size-base); }
|
|
50
|
+
h6 { font-size: var(--plasma-font-size-sm); }
|
|
51
|
+
|
|
52
|
+
p {
|
|
53
|
+
margin: 0 0 var(--plasma-space-md) 0;
|
|
54
|
+
line-height: var(--plasma-line-height-base);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
small {
|
|
58
|
+
font-size: var(--plasma-font-size-xs);
|
|
59
|
+
color: var(--plasma-color-text-muted);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* --------------------------------------------------------------------------
|
|
63
|
+
Code & Monospace Blocks
|
|
64
|
+
-------------------------------------------------------------------------- */
|
|
65
|
+
code,
|
|
66
|
+
kbd,
|
|
67
|
+
samp,
|
|
68
|
+
pre {
|
|
69
|
+
font-family: var(--plasma-font-mono);
|
|
70
|
+
font-size: var(--plasma-font-size-xs);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
code {
|
|
74
|
+
padding: 2px 4px;
|
|
75
|
+
border-radius: var(--plasma-radius-sm);
|
|
76
|
+
background-color: var(--plasma-color-surface-sunken);
|
|
77
|
+
border: 1px solid var(--plasma-color-border-subtle);
|
|
78
|
+
color: var(--plasma-color-highlight);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
pre {
|
|
82
|
+
padding: var(--plasma-space-md);
|
|
83
|
+
border-radius: var(--plasma-radius-md);
|
|
84
|
+
background-color: var(--plasma-color-surface-sunken);
|
|
85
|
+
border: 1px solid var(--plasma-color-border);
|
|
86
|
+
overflow-x: auto;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
pre code {
|
|
90
|
+
padding: 0;
|
|
91
|
+
background: transparent;
|
|
92
|
+
border: none;
|
|
93
|
+
color: inherit;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
kbd {
|
|
97
|
+
display: inline-block;
|
|
98
|
+
padding: 2px 5px;
|
|
99
|
+
font-size: 11px;
|
|
100
|
+
line-height: 1;
|
|
101
|
+
color: var(--plasma-color-text);
|
|
102
|
+
background-color: var(--plasma-color-surface);
|
|
103
|
+
border: 1px solid var(--plasma-color-border);
|
|
104
|
+
border-radius: var(--plasma-radius-sm);
|
|
105
|
+
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* --------------------------------------------------------------------------
|
|
109
|
+
Form Elements Font Inheritance
|
|
110
|
+
-------------------------------------------------------------------------- */
|
|
111
|
+
button,
|
|
112
|
+
input,
|
|
113
|
+
optgroup,
|
|
114
|
+
select,
|
|
115
|
+
textarea {
|
|
116
|
+
font-family: inherit;
|
|
117
|
+
font-size: inherit;
|
|
118
|
+
line-height: inherit;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* --------------------------------------------------------------------------
|
|
122
|
+
Selection Highlight (Breeze Blue)
|
|
123
|
+
-------------------------------------------------------------------------- */
|
|
124
|
+
::selection {
|
|
125
|
+
background-color: var(--plasma-color-highlight);
|
|
126
|
+
color: var(--plasma-color-highlight-text);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* --------------------------------------------------------------------------
|
|
130
|
+
KDE Breeze Scrollbars
|
|
131
|
+
-------------------------------------------------------------------------- */
|
|
132
|
+
* {
|
|
133
|
+
scrollbar-width: thin;
|
|
134
|
+
scrollbar-color: var(--plasma-color-border) transparent;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
::-webkit-scrollbar {
|
|
138
|
+
width: 8px;
|
|
139
|
+
height: 8px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
::-webkit-scrollbar-track {
|
|
143
|
+
background: transparent;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
::-webkit-scrollbar-thumb {
|
|
147
|
+
background-color: var(--plasma-color-border);
|
|
148
|
+
border-radius: var(--plasma-radius-full);
|
|
149
|
+
border: 2px solid transparent;
|
|
150
|
+
background-clip: padding-box;
|
|
151
|
+
transition: var(--plasma-transition-fast);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
::-webkit-scrollbar-thumb:hover {
|
|
155
|
+
background-color: var(--plasma-color-text-muted);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* --------------------------------------------------------------------------
|
|
159
|
+
Default Focus Outline (Breeze 2px Accent Ring)
|
|
160
|
+
-------------------------------------------------------------------------- */
|
|
161
|
+
:focus-visible {
|
|
162
|
+
outline: 2px solid var(--plasma-color-highlight);
|
|
163
|
+
outline-offset: 1px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* --------------------------------------------------------------------------
|
|
167
|
+
Links
|
|
168
|
+
-------------------------------------------------------------------------- */
|
|
169
|
+
a {
|
|
170
|
+
color: var(--plasma-color-text-link);
|
|
171
|
+
text-decoration: none;
|
|
172
|
+
transition: var(--plasma-transition-fast);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
a:hover {
|
|
176
|
+
text-decoration: underline;
|
|
177
|
+
color: var(--plasma-color-highlight-hover);
|
|
178
|
+
}
|