@widgetic/design-system 0.5.12 → 0.5.15

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.
@@ -28,6 +28,8 @@
28
28
  export let height: string = '168px';
29
29
  export let target: string = 'action-confirmation-modal'; // target for Portal
30
30
  export let isConfirmDisabled: boolean = false;
31
+ /** When false, a failed confirm can leave the dialog open. Callers close it themselves. */
32
+ export let closeOnConfirm: boolean = true;
31
33
  export let confirmVariant: 'primary' | 'attention' = 'primary';
32
34
  export let actionType: string = 'confirm';
33
35
 
@@ -75,8 +77,8 @@
75
77
  // Dispatch a confirmation event with all items
76
78
  dispatch('confirm', { items });
77
79
 
78
- // Close the modal immediately to allow user to continue working
79
- isOpen = false;
80
+ // Callers that show an error inside the dialog set closeOnConfirm to false.
81
+ if (closeOnConfirm) isOpen = false;
80
82
  }
81
83
 
82
84
  // Support for restoring modal state
@@ -31,6 +31,7 @@ declare const ActionModal: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_Pro
31
31
  height?: string;
32
32
  target?: string;
33
33
  isConfirmDisabled?: boolean;
34
+ /** When false, a failed confirm can leave the dialog open. Callers close it themselves. */ closeOnConfirm?: boolean;
34
35
  confirmVariant?: "primary" | "attention";
35
36
  actionType?: string;
36
37
  modalType?: string;
@@ -39,6 +39,19 @@
39
39
  if (!host) {
40
40
  host = document.querySelector(`.${targetId}`) as HTMLElement | null;
41
41
  }
42
+ // Never adopt the portal's own subtree as its host.
43
+ //
44
+ // A caller may name a target after a class that the *portalled content*
45
+ // also carries (e.g. target `app-header-widget-picker` for a dropdown
46
+ // whose root div has that same class, so outside-click detection can
47
+ // find it). The slot is already rendered inside `portal` when onMount
48
+ // runs, so the class lookup above can return that inner div. Moving
49
+ // `portal` into it then throws
50
+ // "HierarchyRequestError: The new child element contains the parent".
51
+ // Anything equal to, inside, or containing `portal` is not a host.
52
+ if (host && (host === portal || portal?.contains(host) || host.contains(portal))) {
53
+ host = null;
54
+ }
42
55
  // if(showLogs) console.log('DS Portal host:', host, 'target:', target);
43
56
 
44
57
  // Create host container if it doesn't exist
@@ -188,24 +188,20 @@
188
188
  <Tooltip.Provider delayDuration={300}>
189
189
  <div class="nav-buttons flex items-center shrink-0">
190
190
  <Tooltip.Root open={showBackTooltip}>
191
- <Tooltip.Trigger class="inline-flex focus:outline-none">
192
- <!-- svelte-ignore a11y-click-events-have-key-events -->
193
- <div
194
- class="breadcrumbs-nav-button flex items-center justify-center w-6 h-6"
195
- style="cursor: {canGoBack && !isLoading ? 'pointer' : 'default'};"
196
- class:opacity-50={!canGoBack || isLoading}
197
- on:mouseenter={() => { showBackTooltip = true; }}
198
- on:mouseleave={() => { showBackTooltip = false; }}
199
- on:click={canGoBack && !isLoading ? onBack : undefined}
200
- role="button"
201
- tabindex={canGoBack && !isLoading ? 0 : -1}
202
- >
203
- <IconArrowLeft
204
- class="w-6 h-6 text-[hsl(var(--grey6))]"
205
- style="min-width: 24px; min-height: 24px;"
206
- />
207
- </div>
208
- </Tooltip.Trigger>
191
+ <button
192
+ type="button"
193
+ class="breadcrumbs-nav-button inline-flex items-center justify-center w-6 h-6 border-0 bg-transparent p-0 focus:outline-none"
194
+ style="cursor: {canGoBack && !isLoading ? 'pointer' : 'default'}; opacity: {canGoBack && !isLoading ? 1 : 0.35};"
195
+ aria-disabled={!canGoBack || isLoading}
196
+ on:mouseenter={() => { showBackTooltip = true; }}
197
+ on:mouseleave={() => { showBackTooltip = false; }}
198
+ on:click={() => { if (!isLoading) onBack(); }}
199
+ >
200
+ <IconArrowLeft
201
+ class="w-6 h-6 text-[hsl(var(--grey6))]"
202
+ style="min-width: 24px; min-height: 24px;"
203
+ />
204
+ </button>
209
205
  {#if showBackTooltip}
210
206
  <!-- Portaled to <body>: the header row around this nav is overflow-hidden, which
211
207
  otherwise clips the tooltip at the header's bottom edge. -->
@@ -218,24 +214,20 @@
218
214
  </Tooltip.Root>
219
215
 
220
216
  <Tooltip.Root open={showForwardTooltip}>
221
- <Tooltip.Trigger class="inline-flex focus:outline-none">
222
- <!-- svelte-ignore a11y-click-events-have-key-events -->
223
- <div
224
- class="breadcrumbs-nav-button flex items-center justify-center w-6 h-6 ml-4"
225
- style="cursor: {canGoForward && !isLoading ? 'pointer' : 'default'};"
226
- class:opacity-50={!canGoForward || isLoading}
227
- on:mouseenter={() => { showForwardTooltip = true; }}
228
- on:mouseleave={() => { showForwardTooltip = false; }}
229
- on:click={canGoForward && !isLoading ? onForward : undefined}
230
- role="button"
231
- tabindex={canGoForward && !isLoading ? 0 : -1}
232
- >
233
- <IconArrowRight
234
- class="w-6 h-6 text-[hsl(var(--grey6))]"
235
- style="min-width: 24px; min-height: 24px;"
236
- />
237
- </div>
238
- </Tooltip.Trigger>
217
+ <button
218
+ type="button"
219
+ class="breadcrumbs-nav-button ml-4 inline-flex items-center justify-center w-6 h-6 border-0 bg-transparent p-0 focus:outline-none"
220
+ style="cursor: {canGoForward && !isLoading ? 'pointer' : 'default'}; opacity: {canGoForward && !isLoading ? 1 : 0.35};"
221
+ aria-disabled={!canGoForward || isLoading}
222
+ on:mouseenter={() => { showForwardTooltip = true; }}
223
+ on:mouseleave={() => { showForwardTooltip = false; }}
224
+ on:click={() => { if (!isLoading) onForward(); }}
225
+ >
226
+ <IconArrowRight
227
+ class="w-6 h-6 text-[hsl(var(--grey6))]"
228
+ style="min-width: 24px; min-height: 24px;"
229
+ />
230
+ </button>
239
231
  {#if showForwardTooltip}
240
232
  <Tooltip.Portal>
241
233
  <Tooltip.Content side="bottom" sideOffset={6} class="bg-[hsl(var(--dark))] text-white caption px-2 py-1 rounded-md z-[200000]">
@@ -1,3 +1,22 @@
1
+ /* Self-hosted faces from src/lib/fonts (packaged with DS).
2
+ * Paths are relative so Vite resolves them when consumers import fonts.css.
3
+ * Site also mirrors these under static/fonts for /fonts/* URLs in app.html.
4
+ *
5
+ * ## OTS / Chromium validation (Sep 2026)
6
+ * Several Inter / Cousine / JetBrains Mono WOFF2 files under src/lib/fonts fail
7
+ * Chromium OpenType Sanitizer (console: "OTS parsing error", "Failed to convert
8
+ * WOFF 2.0 font to SFNT") when served via Vite `@fs` in local monorepo links.
9
+ * That does NOT mean CSS @font-face is wrong — the binary files themselves are
10
+ * incomplete/corrupt for OTS. Google Fonts CDN faces (site app.html) still work
11
+ * for the same family names, so UI typography stays correct even when local
12
+ * @font-face errors appear in the console.
13
+ *
14
+ * Keep these @font-face rules for packaging / offline / consumers that ship
15
+ * clean binaries. Prefer replacing the WOFF2 files with official releases
16
+ * (rsms/inter, google/fonts) when cleaning the console is required — do not
17
+ * delete @font-face solely to silence OTS.
18
+ */
19
+
1
20
  /* Tailwind config */
2
21
  /* @config "../../../tailwind.config.ts"; */
3
22
 
@@ -6,7 +25,7 @@
6
25
  /** INTER FAMILY (Figma Foundations: 01 — Foundations) **/
7
26
  @font-face {
8
27
  font-family: 'Inter';
9
- src: url('/fonts/Inter/Inter-Thin-BETA.woff2') format('woff2');
28
+ src: url('../fonts/Inter/Inter-Thin-BETA.woff2') format('woff2');
10
29
  font-weight: 100;
11
30
  font-style: normal;
12
31
  font-display: swap;
@@ -14,7 +33,7 @@
14
33
 
15
34
  @font-face {
16
35
  font-family: 'Inter';
17
- src: url('/fonts/Inter/Inter-ExtraLight-BETA.woff2') format('woff2');
36
+ src: url('../fonts/Inter/Inter-ExtraLight-BETA.woff2') format('woff2');
18
37
  font-weight: 200;
19
38
  font-style: normal;
20
39
  font-display: swap;
@@ -22,7 +41,7 @@
22
41
 
23
42
  @font-face {
24
43
  font-family: 'Inter';
25
- src: url('/fonts/Inter/Inter-Light-BETA.woff2') format('woff2');
44
+ src: url('../fonts/Inter/Inter-Light-BETA.woff2') format('woff2');
26
45
  font-weight: 300;
27
46
  font-style: normal;
28
47
  font-display: swap;
@@ -30,7 +49,7 @@
30
49
 
31
50
  @font-face {
32
51
  font-family: 'Inter';
33
- src: url('/fonts/Inter/Inter-Regular.woff2') format('woff2');
52
+ src: url('../fonts/Inter/Inter-Regular.woff2') format('woff2');
34
53
  font-weight: 400;
35
54
  font-style: normal;
36
55
  font-display: swap;
@@ -38,7 +57,7 @@
38
57
 
39
58
  @font-face {
40
59
  font-family: 'Inter';
41
- src: url('/fonts/Inter/Inter-Italic.woff2') format('woff2');
60
+ src: url('../fonts/Inter/Inter-Italic.woff2') format('woff2');
42
61
  font-weight: 400;
43
62
  font-style: italic;
44
63
  font-display: swap;
@@ -46,7 +65,7 @@
46
65
 
47
66
  @font-face {
48
67
  font-family: 'Inter';
49
- src: url('/fonts/Inter/Inter-Medium.woff2') format('woff2');
68
+ src: url('../fonts/Inter/Inter-Medium.woff2') format('woff2');
50
69
  font-weight: 500;
51
70
  font-style: normal;
52
71
  font-display: swap;
@@ -54,7 +73,7 @@
54
73
 
55
74
  @font-face {
56
75
  font-family: 'Inter';
57
- src: url('/fonts/Inter/Inter-SemiBold.woff2') format('woff2');
76
+ src: url('../fonts/Inter/Inter-SemiBold.woff2') format('woff2');
58
77
  font-weight: 600;
59
78
  font-style: normal;
60
79
  font-display: swap;
@@ -62,7 +81,7 @@
62
81
 
63
82
  @font-face {
64
83
  font-family: 'Inter';
65
- src: url('/fonts/Inter/Inter-Bold.woff2') format('woff2');
84
+ src: url('../fonts/Inter/Inter-Bold.woff2') format('woff2');
66
85
  font-weight: 700;
67
86
  font-style: normal;
68
87
  font-display: swap;
@@ -70,7 +89,7 @@
70
89
 
71
90
  @font-face {
72
91
  font-family: 'Inter';
73
- src: url('/fonts/Inter/Inter-ExtraBold.woff2') format('woff2');
92
+ src: url('../fonts/Inter/Inter-ExtraBold.woff2') format('woff2');
74
93
  font-weight: 800;
75
94
  font-style: normal;
76
95
  font-display: swap;
@@ -78,7 +97,7 @@
78
97
 
79
98
  @font-face {
80
99
  font-family: 'Inter';
81
- src: url('/fonts/Inter/Inter-Black.woff2') format('woff2');
100
+ src: url('../fonts/Inter/Inter-Black.woff2') format('woff2');
82
101
  font-weight: 900;
83
102
  font-style: normal;
84
103
  font-display: swap;
@@ -86,7 +105,7 @@
86
105
 
87
106
  @font-face {
88
107
  font-family: 'Inter';
89
- src: url('/fonts/Inter/Inter.var.woff2') format('woff2-variations');
108
+ src: url('../fonts/Inter/Inter.var.woff2') format('woff2-variations');
90
109
  font-weight: 100 900;
91
110
  font-style: normal;
92
111
  font-display: swap;
@@ -95,7 +114,7 @@
95
114
  /* JETBRAINS MONO: Monospace Display (Developer API) */
96
115
  @font-face {
97
116
  font-family: 'JetBrains Mono';
98
- src: url('/fonts/JetBrainsMono/JetBrainsMono-ExtraBold.woff2') format('woff2');
117
+ src: url('../fonts/JetBrainsMono/JetBrainsMono-ExtraBold.woff2') format('woff2');
99
118
  font-weight: 800;
100
119
  font-style: normal;
101
120
  font-display: swap;
@@ -104,7 +123,7 @@
104
123
  /* COUSINE: Code & Embed Snippets */
105
124
  @font-face {
106
125
  font-family: 'Cousine';
107
- src: url('/fonts/Cousine/Cousine-Regular.woff2') format('woff2');
126
+ src: url('../fonts/Cousine/Cousine-Regular.woff2') format('woff2');
108
127
  font-weight: 400;
109
128
  font-style: normal;
110
129
  font-display: swap;
@@ -112,7 +131,7 @@
112
131
 
113
132
  @font-face {
114
133
  font-family: 'Cousine';
115
- src: url('/fonts/Cousine/Cousine-Bold.woff2') format('woff2');
134
+ src: url('../fonts/Cousine/Cousine-Bold.woff2') format('woff2');
116
135
  font-weight: 700;
117
136
  font-style: normal;
118
137
  font-display: swap;
@@ -476,14 +476,14 @@ go 3 levels up in development mode, 2 levels up in production mode*/
476
476
  /* Tablet (744px and below) */
477
477
  @media (max-width: 744px) {
478
478
  .dashboard-grid {
479
- grid-template-columns:
480
- var(--dashboard-margin)
479
+ /* Keep the four tracks aligned with the four named areas below. */
480
+ grid-template-columns:
481
481
  var(--dashboard-sidebar-width)
482
- var(--dashboard-gap)
483
- 1fr
482
+ var(--dashboard-margin)
483
+ minmax(0, 1fr)
484
484
  var(--dashboard-margin);
485
485
  grid-template-rows: 56px 1fr;
486
- gap: var(--dashboard-gap);
486
+ gap: 0;
487
487
  grid-template-areas:
488
488
  "sidebar margin-l header margin-r"
489
489
  "sidebar margin-l main margin-r";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/design-system",
3
- "version": "0.5.12",
3
+ "version": "0.5.15",
4
4
  "type": "module",
5
5
  "svelte": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -38,6 +38,8 @@
38
38
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
39
39
  "check:watch": "NODE_OPTIONS='--max-old-space-size=8192' svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
40
40
  "check:strict": "tsc --noEmit && npm run check",
41
+ "check:deps": "check-runtime-deps",
42
+ "test:deps": "check-runtime-deps-fixtures",
41
43
  "pnpm-link": "zsh -c 'mkdir -p ~/.pnpm-global/bin && export PATH=\"$PATH:$HOME/.pnpm-global/bin\" && pnpm install -g pnpm && pnpm config set global-bin-dir ~/.pnpm-global/bin && echo \"export PATH=\\\"$PATH:$HOME/.pnpm-global/bin\\\"\" >> ~/.zshrc && source ~/.zshrc && pnpm link --global'",
42
44
  "link-packs": "zsh -c 'mkdir -p ~/.pnpm-global/bin && export PATH=\"$PATH:$HOME/.pnpm-global/bin\" && pnpm install -g pnpm && pnpm config set global-bin-dir ~/.pnpm-global/bin && echo \"export PATH=\\\"$PATH:$HOME/.pnpm-global/bin\\\"\" >> ~/.zshrc && source ~/.zshrc && pnpm link --global @widgetic/api-sdk @widgetic/design-system'",
43
45
  "i-shadcn": "npm run clean-shadcn && npm run i-shadcn-init && npm run i-shadcn-comps",
@@ -93,16 +95,6 @@
93
95
  "svelte": "./dist/stores/*.js",
94
96
  "default": "./dist/stores/*.js"
95
97
  },
96
- "./previews": {
97
- "types": "./dist/components/previews/index.d.ts",
98
- "svelte": "./dist/components/previews/index.js",
99
- "default": "./dist/components/previews/index.js"
100
- },
101
- "./previews/*": {
102
- "types": "./dist/components/previews/*.d.ts",
103
- "svelte": "./dist/components/previews/*.js",
104
- "default": "./dist/components/previews/*.js"
105
- },
106
98
  "./styles": "./dist/styles/global.css",
107
99
  "./styles/*": "./dist/styles/*.css",
108
100
  "./fonts": "./dist/fonts",
@@ -149,6 +141,7 @@
149
141
  "@tiptap/pm": "^2.9.1",
150
142
  "@tiptap/starter-kit": "^2.9.1",
151
143
  "@types/node": "^22.10.1",
144
+ "@widgetic/dev-tools": "^0.2.0",
152
145
  "chokidar-cli": "^3.0.0",
153
146
  "concurrently": "^9.1.0",
154
147
  "eslint": "^9.7.0",