@dorsk/tsumikit 0.79.0 → 0.80.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.
Files changed (53) hide show
  1. package/dist/components/atoms/Artwork.svelte +14 -10
  2. package/dist/components/atoms/Artwork.svelte.d.ts +1 -1
  3. package/dist/components/atoms/Badge.svelte +1 -4
  4. package/dist/components/atoms/Button.svelte +303 -9
  5. package/dist/components/atoms/Button.svelte.d.ts +4 -1
  6. package/dist/components/atoms/Card.svelte +142 -0
  7. package/dist/components/atoms/Checkbox.svelte +177 -1
  8. package/dist/components/atoms/Input.svelte +35 -0
  9. package/dist/components/atoms/Link.svelte +61 -0
  10. package/dist/components/atoms/Progress.svelte +74 -1
  11. package/dist/components/atoms/Progress.svelte.d.ts +1 -0
  12. package/dist/components/atoms/Select.svelte +30 -0
  13. package/dist/components/atoms/Skeleton.svelte +54 -3
  14. package/dist/components/atoms/Skeleton.svelte.d.ts +1 -0
  15. package/dist/components/atoms/Spinner.svelte +152 -3
  16. package/dist/components/atoms/Spinner.svelte.d.ts +1 -1
  17. package/dist/components/atoms/Switch.svelte +135 -0
  18. package/dist/components/atoms/Textarea.svelte +36 -0
  19. package/dist/components/atoms/Thinking.svelte +130 -0
  20. package/dist/components/atoms/Thinking.svelte.d.ts +15 -0
  21. package/dist/components/molecules/CopyButton.svelte +146 -5
  22. package/dist/components/molecules/Field.svelte +55 -1
  23. package/dist/components/molecules/FileButton.svelte +4 -2
  24. package/dist/components/molecules/InputGroup.svelte +1 -1
  25. package/dist/components/molecules/LookPicker.svelte +100 -0
  26. package/dist/components/molecules/LookPicker.svelte.d.ts +17 -0
  27. package/dist/components/molecules/MotionSettings.svelte +166 -0
  28. package/dist/components/molecules/MotionSettings.svelte.d.ts +18 -0
  29. package/dist/components/molecules/RadioGroup.svelte +61 -0
  30. package/dist/components/molecules/SectionHeader.svelte +2 -0
  31. package/dist/components/molecules/Tabs.svelte +157 -4
  32. package/dist/components/molecules/ThemePicker.svelte +8 -3
  33. package/dist/fx.d.ts +149 -0
  34. package/dist/fx.js +111 -0
  35. package/dist/fx.md +58 -0
  36. package/dist/index.d.ts +8 -2
  37. package/dist/index.js +8 -2
  38. package/dist/looks/README.md +101 -0
  39. package/dist/looks/depth.css +939 -0
  40. package/dist/looks/editorial.css +545 -0
  41. package/dist/looks/tactile.css +871 -0
  42. package/dist/markdown.js +47 -21
  43. package/dist/pointer.d.ts +3 -0
  44. package/dist/pointer.js +40 -0
  45. package/dist/stores/fx.svelte.d.ts +17 -0
  46. package/dist/stores/fx.svelte.js +64 -0
  47. package/dist/stores/theme.svelte.d.ts +8 -2
  48. package/dist/stores/theme.svelte.js +33 -7
  49. package/dist/styles/themes.css +249 -249
  50. package/dist/styles/tokens.css +4 -3
  51. package/dist/theme-mode.d.ts +31 -0
  52. package/dist/theme-mode.js +19 -0
  53. package/package.json +3 -2
@@ -19,10 +19,10 @@
19
19
  --c-bg-elev-2: #1f232c;
20
20
  --c-surface: #21262f;
21
21
  --c-border: #2c323d;
22
- --c-border-strong: #68707e;
22
+ --c-border-strong: #757d8b;
23
23
  --c-text: #e6e9ef;
24
24
  --c-text-muted: #9aa3b2;
25
- --c-text-faint: #848c9e;
25
+ --c-text-faint: #929bad;
26
26
 
27
27
  --c-accent: #5ad6a0;
28
28
  --c-accent-ink: #04130c;
@@ -267,6 +267,7 @@
267
267
 
268
268
  --dur-instant: 0ms;
269
269
  --dur-press: 100ms;
270
+ --dur-release: 150ms;
270
271
  --dur-fast: 120ms;
271
272
  --dur-base: 180ms;
272
273
  --dur-slow: 240ms;
@@ -306,7 +307,7 @@
306
307
  --control-edge-hover: var(--text-faint);
307
308
  --control-shadow: 0 0 0 0 transparent;
308
309
  --track-fill: var(--bg-elevated-2);
309
- --track-edge: var(--border);
310
+ --track-edge: var(--control-edge);
310
311
  --thumb-fill: var(--bg);
311
312
  --thumb-shadow: var(--shadow-sm);
312
313
  --btn-fill: var(--surface);
@@ -7,6 +7,8 @@ export interface ThemePreference {
7
7
  light: string;
8
8
  /** Last dark theme the user picked. */
9
9
  dark: string;
10
+ /** Structural look; absent means the default look. */
11
+ look?: string;
10
12
  }
11
13
  /** The picker value that means "follow the system". Never a theme id. */
12
14
  export declare const AUTO_THEME = "auto";
@@ -31,3 +33,32 @@ export declare function preferenceFrom(raw: {
31
33
  }, slotOf: SlotOf, defaults?: ThemePreference): ThemePreference;
32
34
  /** The picker's current value: `auto`, or the pinned slot's theme id. */
33
35
  export declare function pickerValue(pref: ThemePreference): string;
36
+ export type LookStatus = 'stable' | 'experimental';
37
+ /** Structural looks, an axis independent of the theme. Each non-default look
38
+ * ships as `@dorsk/tsumikit/looks/<id>.css`, scoped to `:root[data-look="<id>"]`. */
39
+ export declare const LOOKS: readonly [{
40
+ readonly id: "default";
41
+ readonly label: "Polished";
42
+ readonly status: "stable";
43
+ }, {
44
+ readonly id: "depth";
45
+ readonly label: "Depth";
46
+ readonly status: "stable";
47
+ }, {
48
+ readonly id: "tactile";
49
+ readonly label: "Tactile";
50
+ readonly status: "stable";
51
+ }, {
52
+ readonly id: "editorial";
53
+ readonly label: "Editorial";
54
+ readonly status: "experimental";
55
+ }];
56
+ export type LookId = (typeof LOOKS)[number]['id'];
57
+ export declare const DEFAULT_LOOK: LookId;
58
+ export declare function parseLook(v: unknown): LookId;
59
+ /** Inline script that paints `data-theme`, `data-mode` and `data-look` from the
60
+ * persisted blob before first paint. `themes` resolves a legacy lone theme id. */
61
+ export declare function themePrepaint(key: string, themes: readonly {
62
+ id: string;
63
+ mode: ThemeSlot;
64
+ }[]): string;
@@ -43,3 +43,22 @@ export function preferenceFrom(raw, slotOf, defaults = DEFAULT_THEME_PREFERENCE)
43
43
  export function pickerValue(pref) {
44
44
  return pref.mode === 'auto' ? AUTO_THEME : pref.mode === 'dark' ? pref.dark : pref.light;
45
45
  }
46
+ /** Structural looks, an axis independent of the theme. Each non-default look
47
+ * ships as `@dorsk/tsumikit/looks/<id>.css`, scoped to `:root[data-look="<id>"]`. */
48
+ export const LOOKS = [
49
+ { id: 'default', label: 'Polished', status: 'stable' },
50
+ { id: 'depth', label: 'Depth', status: 'stable' },
51
+ { id: 'tactile', label: 'Tactile', status: 'stable' },
52
+ { id: 'editorial', label: 'Editorial', status: 'experimental' },
53
+ ];
54
+ export const DEFAULT_LOOK = 'default';
55
+ export function parseLook(v) {
56
+ return LOOKS.find((l) => l.id === v)?.id ?? DEFAULT_LOOK;
57
+ }
58
+ /** Inline script that paints `data-theme`, `data-mode` and `data-look` from the
59
+ * persisted blob before first paint. `themes` resolves a legacy lone theme id. */
60
+ export function themePrepaint(key, themes) {
61
+ const looks = LOOKS.filter((l) => l.id !== DEFAULT_LOOK).map((l) => l.id);
62
+ const modes = Object.fromEntries(themes.map((t) => [t.id, t.mode]));
63
+ return `(function(){try{var d=document.documentElement,s=localStorage.getItem(${JSON.stringify(key)});if(!s)return;var b,t,m;try{b=JSON.parse(s)}catch(e){}if(b&&typeof b==='object'){m=b.mode==='auto'?(matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'):b.mode==='light'?'light':'dark';t=b[m];if(${JSON.stringify(looks)}.indexOf(b.look)>=0)d.setAttribute('data-look',b.look)}else{var k=${JSON.stringify(modes)};if(!Object.prototype.hasOwnProperty.call(k,s))return;t=s;m=k[s]}if(typeof t==='string'&&t)d.setAttribute('data-theme',t);d.setAttribute('data-mode',m)}catch(e){}})();`;
64
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dorsk/tsumikit",
3
- "version": "0.79.0",
3
+ "version": "0.80.1",
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",
@@ -40,7 +40,8 @@
40
40
  "./styles/themes.css": "./dist/styles/themes.css",
41
41
  "./styles/reset.css": "./dist/styles/reset.css",
42
42
  "./styles/utilities.css": "./dist/styles/utilities.css",
43
- "./styles/syntax.css": "./dist/styles/syntax.css"
43
+ "./styles/syntax.css": "./dist/styles/syntax.css",
44
+ "./looks/*.css": "./dist/looks/*.css"
44
45
  },
45
46
  "publishConfig": {
46
47
  "access": "public",