@marianmeres/stuic 3.0.0 → 3.0.2
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/actions/index.d.ts +1 -0
- package/dist/actions/index.js +1 -0
- package/dist/actions/typeahead.svelte.d.ts +53 -0
- package/dist/actions/typeahead.svelte.js +328 -0
- package/dist/base.css +17 -0
- package/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte +4 -3
- package/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte.d.ts +4 -3
- package/dist/components/AlertConfirmPrompt/Current.svelte +1 -2
- package/dist/components/AlertConfirmPrompt/Current.svelte.d.ts +0 -1
- package/dist/components/AlertConfirmPrompt/index.css +47 -43
- package/dist/components/AssetsPreview/AssetsPreview.svelte +0 -1
- package/dist/components/AssetsPreview/AssetsPreview.svelte.d.ts +0 -1
- package/dist/components/AssetsPreview/index.css +31 -29
- package/dist/components/Avatar/Avatar.svelte +0 -1
- package/dist/components/Avatar/Avatar.svelte.d.ts +0 -1
- package/dist/components/Avatar/index.css +87 -85
- package/dist/components/Backdrop/Backdrop.svelte +0 -1
- package/dist/components/Backdrop/Backdrop.svelte.d.ts +0 -1
- package/dist/components/Backdrop/index.css +15 -13
- package/dist/components/Button/Button.svelte +0 -1
- package/dist/components/Button/Button.svelte.d.ts +0 -1
- package/dist/components/Button/index.css +431 -429
- package/dist/components/ButtonGroupRadio/ButtonGroupRadio.svelte +0 -1
- package/dist/components/ButtonGroupRadio/ButtonGroupRadio.svelte.d.ts +0 -1
- package/dist/components/ButtonGroupRadio/index.css +123 -117
- package/dist/components/Collapsible/index.css +17 -15
- package/dist/components/CommandMenu/CommandMenu.svelte +7 -4
- package/dist/components/CommandMenu/CommandMenu.svelte.d.ts +0 -1
- package/dist/components/CommandMenu/index.css +27 -25
- package/dist/components/DismissibleMessage/DismissibleMessage.svelte +0 -2
- package/dist/components/DismissibleMessage/DismissibleMessage.svelte.d.ts +0 -1
- package/dist/components/DismissibleMessage/index.css +116 -110
- package/dist/components/DropdownMenu/DropdownMenu.svelte +317 -74
- package/dist/components/DropdownMenu/DropdownMenu.svelte.d.ts +19 -1
- package/dist/components/DropdownMenu/index.css +236 -170
- package/dist/components/DropdownMenu/index.d.ts +1 -1
- package/dist/components/HoverExpandableWidth/HoverExpandableWidth.svelte +3 -1
- package/dist/components/HoverExpandableWidth/HoverExpandableWidth.svelte.d.ts +1 -0
- package/dist/components/Input/FieldInput.svelte +8 -0
- package/dist/components/Input/FieldInput.svelte.d.ts +2 -0
- package/dist/components/Input/FieldOptions.svelte +1 -1
- package/dist/components/Input/index.css +411 -398
- package/dist/components/KbdShortcut/KbdShortcut.svelte +4 -12
- package/dist/components/KbdShortcut/README.md +34 -0
- package/dist/components/KbdShortcut/index.css +55 -0
- package/dist/components/ListItemButton/ListItemButton.svelte +0 -1
- package/dist/components/ListItemButton/ListItemButton.svelte.d.ts +0 -1
- package/dist/components/ListItemButton/index.css +118 -116
- package/dist/components/Modal/Modal.svelte +0 -1
- package/dist/components/Modal/Modal.svelte.d.ts +0 -1
- package/dist/components/Modal/index.css +18 -16
- package/dist/components/ModalDialog/index.css +29 -27
- package/dist/components/Nav/Nav.svelte +732 -0
- package/dist/components/Nav/Nav.svelte.d.ts +110 -0
- package/dist/components/Nav/README.md +334 -0
- package/dist/components/Nav/index.css +318 -0
- package/dist/components/Nav/index.d.ts +1 -0
- package/dist/components/Nav/index.js +1 -0
- package/dist/components/Notifications/Notifications.svelte +2 -3
- package/dist/components/Notifications/Notifications.svelte.d.ts +0 -1
- package/dist/components/Notifications/index.css +158 -158
- package/dist/components/Notifications/notifications-stack.svelte.d.ts +4 -0
- package/dist/components/Notifications/notifications-stack.svelte.js +8 -0
- package/dist/components/Progress/Progress.svelte +4 -2
- package/dist/components/Progress/Progress.svelte.d.ts +1 -0
- package/dist/components/Progress/README.md +86 -15
- package/dist/components/Progress/_internal/Bar.svelte +4 -15
- package/dist/components/Progress/_internal/Bar.svelte.d.ts +1 -1
- package/dist/components/Progress/_internal/Circle.svelte +30 -2
- package/dist/components/Progress/_internal/Circle.svelte.d.ts +1 -0
- package/dist/components/Progress/index.css +47 -1
- package/dist/components/Skeleton/README.md +152 -0
- package/dist/components/Skeleton/Skeleton.svelte +6 -7
- package/dist/components/Skeleton/Skeleton.svelte.d.ts +0 -1
- package/dist/components/Skeleton/index.css +73 -43
- package/dist/components/Spinner/README.md +149 -37
- package/dist/components/Spinner/Spinner.svelte +14 -38
- package/dist/components/Spinner/Spinner.svelte.d.ts +2 -1
- package/dist/components/Spinner/SpinnerCircle.svelte +6 -34
- package/dist/components/Spinner/SpinnerCircle.svelte.d.ts +1 -0
- package/dist/components/Spinner/SpinnerCircleOscillate.svelte +10 -5
- package/dist/components/Spinner/SpinnerUnicode.svelte +3 -1
- package/dist/components/Spinner/SpinnerUnicode.svelte.d.ts +1 -0
- package/dist/components/Spinner/index.css +104 -0
- package/dist/components/Switch/README.md +34 -18
- package/dist/components/Switch/Switch.svelte +24 -46
- package/dist/components/Switch/Switch.svelte.d.ts +4 -2
- package/dist/components/Switch/index.css +120 -2
- package/dist/components/Switch/index.d.ts +1 -2
- package/dist/components/Switch/index.js +1 -2
- package/dist/components/TabbedMenu/README.md +28 -17
- package/dist/components/TabbedMenu/TabbedMenu.svelte +5 -46
- package/dist/components/TabbedMenu/TabbedMenu.svelte.d.ts +0 -1
- package/dist/components/TabbedMenu/index.css +85 -3
- package/dist/components/ThemePreview/ThemePreview.svelte +86 -33
- package/dist/components/ThemePreview/ThemePreview.svelte.d.ts +3 -1
- package/dist/components/ThemePreview/index.css +24 -8
- package/dist/components/TwCheck/README.md +32 -13
- package/dist/components/TwCheck/TwCheck.svelte +11 -9
- package/dist/components/TwCheck/TwCheck.svelte.d.ts +0 -1
- package/dist/components/TwCheck/index.css +14 -0
- package/dist/components/TypeaheadInput/TypeaheadInput.svelte +19 -187
- package/dist/components/TypeaheadInput/TypeaheadInput.svelte.d.ts +4 -2
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.css +44 -39
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/themes/blue-orange.css +246 -156
- package/dist/themes/blue-orange.js +24 -0
- package/dist/themes/cyan-red.css +246 -156
- package/dist/themes/cyan-red.js +24 -0
- package/dist/themes/cyan-slate.css +246 -156
- package/dist/themes/cyan-slate.js +25 -1
- package/dist/themes/emerald-pink.css +246 -156
- package/dist/themes/emerald-pink.js +25 -1
- package/dist/themes/fuchsia-emerald.css +246 -156
- package/dist/themes/fuchsia-emerald.js +25 -1
- package/dist/themes/gray.css +246 -156
- package/dist/themes/gray.js +24 -0
- package/dist/themes/indigo-amber.css +246 -156
- package/dist/themes/indigo-amber.js +26 -2
- package/dist/themes/neutral.css +246 -156
- package/dist/themes/neutral.js +24 -0
- package/dist/themes/pink-emerald.css +246 -156
- package/dist/themes/pink-emerald.js +25 -1
- package/dist/themes/pink-teal.css +253 -0
- package/dist/themes/pink-teal.d.ts +6 -0
- package/dist/themes/pink-teal.js +175 -0
- package/dist/themes/purple-yellow.css +246 -156
- package/dist/themes/purple-yellow.js +24 -0
- package/dist/themes/rainbow.css +246 -156
- package/dist/themes/rainbow.js +25 -1
- package/dist/themes/red-blue.css +246 -156
- package/dist/themes/red-blue.js +24 -0
- package/dist/themes/red-cyan.css +246 -156
- package/dist/themes/red-cyan.js +24 -0
- package/dist/themes/red-sky.css +253 -0
- package/dist/themes/red-sky.d.ts +6 -0
- package/dist/themes/red-sky.js +175 -0
- package/dist/themes/rose-teal.css +246 -156
- package/dist/themes/rose-teal.js +24 -0
- package/dist/themes/sky-amber.css +246 -156
- package/dist/themes/sky-amber.js +26 -2
- package/dist/themes/slate-cyan.css +246 -156
- package/dist/themes/slate-cyan.js +25 -1
- package/dist/themes/teal-rose.css +246 -156
- package/dist/themes/teal-rose.js +24 -0
- package/dist/themes/violet-lime.css +246 -156
- package/dist/themes/violet-lime.js +27 -3
- package/dist/utils/design-tokens.d.ts +1 -1
- package/dist/utils/design-tokens.js +44 -3
- package/dist/utils/storage-abstraction.js +1 -1
- package/package.json +11 -28
- package/dist/components/Switch/SwitchButton.svelte +0 -134
- package/dist/components/Switch/SwitchButton.svelte.d.ts +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marianmeres/stuic",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"!dist/**/*.test.*",
|
|
@@ -26,31 +26,31 @@
|
|
|
26
26
|
"@marianmeres/icons-fns": "^5.0.0",
|
|
27
27
|
"@marianmeres/random-human-readable": "^1.6.1",
|
|
28
28
|
"@sveltejs/adapter-auto": "^4.0.0",
|
|
29
|
-
"@sveltejs/kit": "^2.
|
|
29
|
+
"@sveltejs/kit": "^2.50.1",
|
|
30
30
|
"@sveltejs/package": "^2.5.7",
|
|
31
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
31
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
32
32
|
"@tailwindcss/cli": "^4.1.18",
|
|
33
33
|
"@tailwindcss/forms": "^0.5.11",
|
|
34
34
|
"@tailwindcss/typography": "^0.5.19",
|
|
35
35
|
"@tailwindcss/vite": "^4.1.18",
|
|
36
|
-
"@types/node": "^25.0.
|
|
36
|
+
"@types/node": "^25.0.10",
|
|
37
37
|
"dotenv": "^16.6.1",
|
|
38
38
|
"eslint": "^9.39.2",
|
|
39
39
|
"globals": "^16.5.0",
|
|
40
|
-
"prettier": "^3.8.
|
|
40
|
+
"prettier": "^3.8.1",
|
|
41
41
|
"prettier-plugin-svelte": "^3.4.1",
|
|
42
|
-
"publint": "^0.3.
|
|
43
|
-
"svelte": "^5.
|
|
42
|
+
"publint": "^0.3.17",
|
|
43
|
+
"svelte": "^5.48.0",
|
|
44
44
|
"svelte-check": "^4.3.5",
|
|
45
45
|
"tailwindcss": "^4.1.18",
|
|
46
46
|
"tsx": "^4.21.0",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
|
-
"typescript-eslint": "^8.53.
|
|
49
|
-
"vite": "^
|
|
48
|
+
"typescript-eslint": "^8.53.1",
|
|
49
|
+
"vite": "^7.3.1",
|
|
50
50
|
"vitest": "^3.2.4"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@marianmeres/clog": "^3.15.
|
|
53
|
+
"@marianmeres/clog": "^3.15.1",
|
|
54
54
|
"@marianmeres/item-collection": "^1.3.5",
|
|
55
55
|
"@marianmeres/parse-boolean": "^2.0.5",
|
|
56
56
|
"@marianmeres/ticker": "^1.16.5",
|
|
@@ -74,23 +74,6 @@
|
|
|
74
74
|
"rp": "pnpm run build && ./release.sh patch",
|
|
75
75
|
"rpm": "pnpm run build && ./release.sh minor",
|
|
76
76
|
"build:theme": "tsx scripts/generate-theme.ts",
|
|
77
|
-
"build:theme:
|
|
78
|
-
"build:theme:neutral": "pnpm run build:theme --infile=src/lib/themes/neutral.ts --outfile=src/lib/themes/neutral.css",
|
|
79
|
-
"build:theme:gray": "pnpm run build:theme --infile=src/lib/themes/gray.ts --outfile=src/lib/themes/gray.css",
|
|
80
|
-
"build:theme:indigo-amber": "pnpm run build:theme --infile=src/lib/themes/indigo-amber.ts --outfile=src/lib/themes/indigo-amber.css",
|
|
81
|
-
"build:theme:teal-rose": "pnpm run build:theme --infile=src/lib/themes/teal-rose.ts --outfile=src/lib/themes/teal-rose.css",
|
|
82
|
-
"build:theme:violet-lime": "pnpm run build:theme --infile=src/lib/themes/violet-lime.ts --outfile=src/lib/themes/violet-lime.css",
|
|
83
|
-
"build:theme:blue-orange": "pnpm run build:theme --infile=src/lib/themes/blue-orange.ts --outfile=src/lib/themes/blue-orange.css",
|
|
84
|
-
"build:theme:emerald-pink": "pnpm run build:theme --infile=src/lib/themes/emerald-pink.ts --outfile=src/lib/themes/emerald-pink.css",
|
|
85
|
-
"build:theme:sky-amber": "pnpm run build:theme --infile=src/lib/themes/sky-amber.ts --outfile=src/lib/themes/sky-amber.css",
|
|
86
|
-
"build:theme:fuchsia-emerald": "pnpm run build:theme --infile=src/lib/themes/fuchsia-emerald.ts --outfile=src/lib/themes/fuchsia-emerald.css",
|
|
87
|
-
"build:theme:slate-cyan": "pnpm run build:theme --infile=src/lib/themes/slate-cyan.ts --outfile=src/lib/themes/slate-cyan.css",
|
|
88
|
-
"build:theme:purple-yellow": "pnpm run build:theme --infile=src/lib/themes/purple-yellow.ts --outfile=src/lib/themes/purple-yellow.css",
|
|
89
|
-
"build:theme:cyan-red": "pnpm run build:theme --infile=src/lib/themes/cyan-red.ts --outfile=src/lib/themes/cyan-red.css",
|
|
90
|
-
"build:theme:rose-teal": "pnpm run build:theme --infile=src/lib/themes/rose-teal.ts --outfile=src/lib/themes/rose-teal.css",
|
|
91
|
-
"build:theme:red-cyan": "pnpm run build:theme --infile=src/lib/themes/red-cyan.ts --outfile=src/lib/themes/red-cyan.css",
|
|
92
|
-
"build:theme:cyan-slate": "pnpm run build:theme --infile=src/lib/themes/cyan-slate.ts --outfile=src/lib/themes/cyan-slate.css",
|
|
93
|
-
"build:theme:pink-emerald": "pnpm run build:theme --infile=src/lib/themes/pink-emerald.ts --outfile=src/lib/themes/pink-emerald.css",
|
|
94
|
-
"build:theme:red-blue": "pnpm run build:theme --infile=src/lib/themes/red-blue.ts --outfile=src/lib/themes/red-blue.css"
|
|
77
|
+
"build:theme:all": "pnpm run build:theme --indir=src/lib/themes --outdir=src/lib/themes"
|
|
95
78
|
}
|
|
96
79
|
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
import type { Snippet } from "svelte";
|
|
3
|
-
import type { FormEventHandler, HTMLButtonAttributes } from "svelte/elements";
|
|
4
|
-
|
|
5
|
-
export interface Props extends Omit<HTMLButtonAttributes, "children"> {
|
|
6
|
-
button?: HTMLButtonElement;
|
|
7
|
-
checked?: boolean;
|
|
8
|
-
size?: "xs" | "sm" | "md" | "lg" | "xl" | string;
|
|
9
|
-
class?: string;
|
|
10
|
-
dotClass?: string;
|
|
11
|
-
label?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
tabindex?: number;
|
|
14
|
-
on?: Snippet;
|
|
15
|
-
off?: Snippet;
|
|
16
|
-
onclick?: (event: MouseEvent) => void;
|
|
17
|
-
onchange?: FormEventHandler<HTMLButtonElement> | null | undefined;
|
|
18
|
-
preHook?: (current: boolean) => Promise<false | any>;
|
|
19
|
-
}
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<script lang="ts">
|
|
23
|
-
import { tick } from "svelte";
|
|
24
|
-
import { twMerge } from "../../utils/tw-merge.js";
|
|
25
|
-
|
|
26
|
-
import "./index.css";
|
|
27
|
-
|
|
28
|
-
let {
|
|
29
|
-
button = $bindable(),
|
|
30
|
-
size = "md",
|
|
31
|
-
class: classProp,
|
|
32
|
-
dotClass,
|
|
33
|
-
checked = $bindable(),
|
|
34
|
-
disabled,
|
|
35
|
-
tabindex = 0,
|
|
36
|
-
label,
|
|
37
|
-
on,
|
|
38
|
-
off,
|
|
39
|
-
onclick,
|
|
40
|
-
preHook,
|
|
41
|
-
...rest
|
|
42
|
-
}: Props = $props();
|
|
43
|
-
|
|
44
|
-
const _preset: any = {
|
|
45
|
-
size: {
|
|
46
|
-
xs: `h-4 w-7`,
|
|
47
|
-
sm: `h-5 w-9`,
|
|
48
|
-
md: `h-6 w-11`,
|
|
49
|
-
lg: `h-7 w-13`,
|
|
50
|
-
xl: `h-8 w-15`,
|
|
51
|
-
},
|
|
52
|
-
dot: {
|
|
53
|
-
size: {
|
|
54
|
-
xs: `size-2 data-[checked=true]:translate-x-4`,
|
|
55
|
-
sm: `size-3 data-[checked=true]:translate-x-5`,
|
|
56
|
-
md: `size-4 data-[checked=true]:translate-x-6`,
|
|
57
|
-
lg: `size-5 data-[checked=true]:translate-x-7`,
|
|
58
|
-
xl: `size-6 data-[checked=true]:translate-x-8`,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
</script>
|
|
63
|
-
|
|
64
|
-
<!-- <div class="inline-block relative"> -->
|
|
65
|
-
<button
|
|
66
|
-
bind:this={button}
|
|
67
|
-
class={twMerge(
|
|
68
|
-
"stuic-switch",
|
|
69
|
-
`m-2
|
|
70
|
-
relative inline-flex flex-shrink-0 items-center
|
|
71
|
-
rounded-full cursor-pointer
|
|
72
|
-
|
|
73
|
-
transition-colors duration-100
|
|
74
|
-
|
|
75
|
-
hover:brightness-105 active:brightness-95
|
|
76
|
-
disabled:!cursor-not-allowed disabled:!opacity-50 disabled:hover:brightness-100
|
|
77
|
-
|
|
78
|
-
bg-neutral-400 dark:bg-neutral-400
|
|
79
|
-
|
|
80
|
-
aria-[checked=true]:bg-(--stuic-switch-accent)
|
|
81
|
-
|
|
82
|
-
focus:outline-0
|
|
83
|
-
focus:ring-(--stuic-switch-accent)/20
|
|
84
|
-
focus:ring-4`,
|
|
85
|
-
size,
|
|
86
|
-
_preset.size[size],
|
|
87
|
-
classProp
|
|
88
|
-
)}
|
|
89
|
-
type="button"
|
|
90
|
-
role="switch"
|
|
91
|
-
aria-checked={checked}
|
|
92
|
-
value={`${!!checked}`}
|
|
93
|
-
{tabindex}
|
|
94
|
-
{disabled}
|
|
95
|
-
onclick={async (e) => {
|
|
96
|
-
if (typeof preHook === "function" && (await preHook(checked ?? false)) === false) {
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
checked = !checked;
|
|
100
|
-
|
|
101
|
-
await tick();
|
|
102
|
-
|
|
103
|
-
if (typeof onclick === "function") onclick(e);
|
|
104
|
-
|
|
105
|
-
button!.dispatchEvent(
|
|
106
|
-
new CustomEvent("change", { bubbles: true, cancelable: true, detail: checked })
|
|
107
|
-
);
|
|
108
|
-
}}
|
|
109
|
-
{...rest}
|
|
110
|
-
>
|
|
111
|
-
{#if label}<span class="sr-only">{@html label}</span>{/if}
|
|
112
|
-
<span
|
|
113
|
-
aria-hidden="true"
|
|
114
|
-
data-checked={checked}
|
|
115
|
-
class={twMerge(
|
|
116
|
-
"dot",
|
|
117
|
-
`flex items-center justify-center
|
|
118
|
-
translate-x-1 rounded-full
|
|
119
|
-
transition-all duration-100
|
|
120
|
-
shadow
|
|
121
|
-
bg-neutral-50 dark:bg-neutral-50
|
|
122
|
-
text-neutral-950 dark:text-neutral-950`,
|
|
123
|
-
size,
|
|
124
|
-
_preset.dot.size[size],
|
|
125
|
-
dotClass
|
|
126
|
-
)}
|
|
127
|
-
>
|
|
128
|
-
{#if checked}
|
|
129
|
-
{@render on?.()}
|
|
130
|
-
{:else}
|
|
131
|
-
{@render off?.()}
|
|
132
|
-
{/if}
|
|
133
|
-
</span>
|
|
134
|
-
</button>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from "svelte";
|
|
2
|
-
import type { FormEventHandler, HTMLButtonAttributes } from "svelte/elements";
|
|
3
|
-
export interface Props extends Omit<HTMLButtonAttributes, "children"> {
|
|
4
|
-
button?: HTMLButtonElement;
|
|
5
|
-
checked?: boolean;
|
|
6
|
-
size?: "xs" | "sm" | "md" | "lg" | "xl" | string;
|
|
7
|
-
class?: string;
|
|
8
|
-
dotClass?: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
tabindex?: number;
|
|
12
|
-
on?: Snippet;
|
|
13
|
-
off?: Snippet;
|
|
14
|
-
onclick?: (event: MouseEvent) => void;
|
|
15
|
-
onchange?: FormEventHandler<HTMLButtonElement> | null | undefined;
|
|
16
|
-
preHook?: (current: boolean) => Promise<false | any>;
|
|
17
|
-
}
|
|
18
|
-
import "./index.css";
|
|
19
|
-
declare const SwitchButton: import("svelte").Component<Props, {}, "button" | "checked">;
|
|
20
|
-
type SwitchButton = ReturnType<typeof SwitchButton>;
|
|
21
|
-
export default SwitchButton;
|