@urbicon-ui/blocks 6.33.0 → 6.35.0

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 (49) hide show
  1. package/README.md +11 -1
  2. package/dist/components/Calendar/CalendarHeader.svelte +32 -26
  3. package/dist/components/Calendar/CalendarMiniMonth.svelte +10 -10
  4. package/dist/components/Calendar/calendar.variants.d.ts +63 -63
  5. package/dist/components/Calendar/calendar.variants.js +19 -5
  6. package/dist/components/FileUpload/FileUpload.svelte +17 -2
  7. package/dist/components/Planner/PlannerHeader.svelte +16 -13
  8. package/dist/components/Planner/planner.variants.js +14 -3
  9. package/dist/i18n/index.d.ts +467 -205
  10. package/dist/i18n/index.js +83 -9
  11. package/dist/internal/core/CoreIconButton.svelte +66 -0
  12. package/dist/internal/core/CoreIconButton.svelte.d.ts +13 -0
  13. package/dist/internal/core/CoreSpinner.svelte +49 -0
  14. package/dist/internal/core/CoreSpinner.svelte.d.ts +8 -0
  15. package/dist/internal/core/spinner-geometry.d.ts +6 -0
  16. package/dist/internal/core/spinner-geometry.js +6 -0
  17. package/dist/mint/README.md +33 -0
  18. package/dist/mint/compose.d.ts +7 -1
  19. package/dist/mint/compose.js +35 -8
  20. package/dist/mint/engine.d.ts +34 -0
  21. package/dist/mint/engine.js +106 -0
  22. package/dist/mint/index.d.ts +2 -2
  23. package/dist/mint/index.js +1 -1
  24. package/dist/mint/micro-interactions.d.ts +9 -3
  25. package/dist/mint/micro-interactions.js +18 -87
  26. package/dist/mint/presets.d.ts +7 -1
  27. package/dist/mint/presets.js +9 -3
  28. package/dist/mint/registry.d.ts +61 -4
  29. package/dist/mint/registry.js +99 -28
  30. package/dist/mint/ripple.js +1 -1
  31. package/dist/primitives/Alert/alert.variants.d.ts +8 -8
  32. package/dist/primitives/Badge/Badge.svelte +5 -5
  33. package/dist/primitives/Badge/badge.variants.js +17 -1
  34. package/dist/primitives/Button/Button.svelte +9 -3
  35. package/dist/primitives/Dialog/Dialog.svelte +7 -5
  36. package/dist/primitives/Dialog/dialog.variants.d.ts +7 -0
  37. package/dist/primitives/Dialog/dialog.variants.js +17 -0
  38. package/dist/primitives/Drawer/Drawer.svelte +7 -5
  39. package/dist/primitives/Drawer/drawer.variants.d.ts +8 -0
  40. package/dist/primitives/Drawer/drawer.variants.js +17 -0
  41. package/dist/primitives/JourneyTimeline/journey-timeline.variants.d.ts +22 -22
  42. package/dist/primitives/Spinner/Spinner.svelte +3 -1
  43. package/dist/primitives/Spinner/spinner.variants.d.ts +16 -16
  44. package/dist/primitives/Stepper/stepper.variants.d.ts +11 -11
  45. package/dist/primitives/Toast/Toaster.svelte +17 -2
  46. package/dist/primitives/Toast/toast.variants.d.ts +12 -12
  47. package/dist/primitives/Tooltip/tooltip.variants.d.ts +3 -3
  48. package/dist/utils/variants.js +44 -10
  49. package/package.json +4 -6
package/README.md CHANGED
@@ -107,7 +107,17 @@ Re-exports `@urbicon-ui/i18n`. Components with text content (Pagination, Menu, C
107
107
  </I18nProvider>
108
108
  ```
109
109
 
110
- For the provider/hook API, typed keys, SSR locale resolution, and opt-in lazy loading see the [@urbicon-ui/i18n](../i18n/) package.
110
+ **English is bundled eagerly; German is lazy.** The `de` catalog is a dynamic-import chunk, so an English-only app never bundles it. Before that chunk loads, `de` keys resolve to the English fallback (never the raw key). The provider loads `de` client-side on mount, which means a **server-rendered German app** would paint English first and flip on hydration. Fix it by registering `de` eagerly once at server start:
111
+
112
+ ```ts
113
+ // src/hooks.server.ts (evaluated once at server start — SSR-safe, static data)
114
+ import { registerBlocksLocale } from '@urbicon-ui/blocks';
115
+ import de from '@urbicon-ui/blocks/i18n/de';
116
+
117
+ registerBlocksLocale('de', de);
118
+ ```
119
+
120
+ For the provider/hook API, typed keys, SSR locale resolution, and the code-splitting + eager-register details see the [@urbicon-ui/i18n](../i18n/) package.
111
121
 
112
122
  ## Development
113
123
 
@@ -3,7 +3,8 @@
3
3
  import { Tooltip } from '../../primitives/Tooltip';
4
4
  import { Popover } from '../../primitives/Popover';
5
5
  import { SegmentGroup, SegmentItem } from '../../primitives/SegmentGroup';
6
- import { Button } from '../../primitives/Button';
6
+ // internal core, not the public component — keeps the public-to-public import graph clean (see internal/core/)
7
+ import CoreIconButton from '../../internal/core/CoreIconButton.svelte';
7
8
  import ChevronLeftIcon from '../../icons/ChevronLeftIcon.svelte';
8
9
  import ChevronRightIcon from '../../icons/ChevronRightIcon.svelte';
9
10
  import ChevronDownIcon from '../../icons/ChevronDownIcon.svelte';
@@ -125,18 +126,24 @@
125
126
  {@render children()}
126
127
  </div>
127
128
  {:else}
129
+ <!--
130
+ All header buttons render on the internal CoreIconButton (was `<Button
131
+ unstyled mint="none">`, which emitted only the call-site classes). The
132
+ core's plumbing overlaps the navButton slot's old baseline (inline-flex
133
+ centring, focus-visible reset, disabled opacity/cursor — now supplied by
134
+ the core, stripped from the slot); the deliberate deltas it introduces are
135
+ documented on the slot in calendar.variants.ts.
136
+ -->
128
137
  <div class={slot('header', className)} {...restProps}>
129
138
  <div class={slot('nav')}>
130
- <Button
131
- unstyled
132
- mint="none"
139
+ <CoreIconButton
133
140
  class={slot('navButton')}
134
141
  onclick={() => ctx.navigate(-1)}
135
142
  disabled={!ctx.canGoBack || ctx.disabled}
136
143
  aria-label={prevLabel}
137
144
  >
138
145
  <ChevronLeftIcon size={navIconSize} />
139
- </Button>
146
+ </CoreIconButton>
140
147
  </div>
141
148
 
142
149
  <div class="flex items-center gap-2">
@@ -162,40 +169,43 @@
162
169
  {/snippet}
163
170
  <div class="min-w-48 p-3">
164
171
  <div class="mb-2 flex items-center justify-between">
165
- <Button
166
- unstyled
167
- mint="none"
172
+ <CoreIconButton
168
173
  class={slot('navButton')}
169
174
  onclick={() => pickerYear--}
170
175
  aria-label={bt('calendar.previousYear')}
171
176
  >
172
177
  <ChevronLeftIcon size={pickerIconSize} />
173
- </Button>
178
+ </CoreIconButton>
174
179
  <span class="text-text-primary font-semibold tabular-nums">{pickerYear}</span>
175
- <Button
176
- unstyled
177
- mint="none"
180
+ <CoreIconButton
178
181
  class={slot('navButton')}
179
182
  onclick={() => pickerYear++}
180
183
  aria-label={bt('calendar.nextYear')}
181
184
  >
182
185
  <ChevronRightIcon size={pickerIconSize} />
183
- </Button>
186
+ </CoreIconButton>
184
187
  </div>
185
188
  <div class="grid grid-cols-3 gap-1">
186
189
  {#each months as m (m.index)}
187
- <Button
188
- unstyled
189
- mint="none"
190
+ <!--
191
+ Text-labelled month cell on the same CoreIconButton as the nav
192
+ buttons (removes the last CalendarHeader→Button edge). The core
193
+ REQUIRES aria-label, so it gets the visible label — the accessible
194
+ name stays the identical string. Never rendered disabled (the
195
+ picker closes when the calendar is disabled), so the core's
196
+ disabled plumbing is inert here.
197
+ -->
198
+ <CoreIconButton
190
199
  class="text-text-primary rounded-md px-2 py-1.5 text-sm transition-colors
191
200
  {m.isCurrent
192
201
  ? 'bg-primary-subtle ring-primary text-primary font-semibold ring-1'
193
202
  : 'hover:bg-surface-hover'}
194
- focus-visible:ring-primary/50 focus-visible:ring-2 focus-visible:outline-none"
203
+ focus-visible:ring-primary/50 focus-visible:ring-2"
195
204
  onclick={() => selectMonth(m.index)}
205
+ aria-label={m.label}
196
206
  >
197
207
  {m.label}
198
- </Button>
208
+ </CoreIconButton>
199
209
  {/each}
200
210
  </div>
201
211
  </div>
@@ -221,29 +231,25 @@
221
231
 
222
232
  {#if showToday}
223
233
  <Tooltip label={bt('calendar.today')}>
224
- <Button
225
- unstyled
226
- mint="none"
234
+ <CoreIconButton
227
235
  class="{slot('navButton')} ml-1"
228
236
  onclick={() => ctx.goToToday()}
229
237
  disabled={!ctx.canGoToToday || ctx.disabled}
230
238
  aria-label={bt('calendar.today')}
231
239
  >
232
240
  <CalendarIcon size={navIconSize} />
233
- </Button>
241
+ </CoreIconButton>
234
242
  </Tooltip>
235
243
  {/if}
236
244
 
237
- <Button
238
- unstyled
239
- mint="none"
245
+ <CoreIconButton
240
246
  class={slot('navButton')}
241
247
  onclick={() => ctx.navigate(1)}
242
248
  disabled={!ctx.canGoForward || ctx.disabled}
243
249
  aria-label={nextLabel}
244
250
  >
245
251
  <ChevronRightIcon size={navIconSize} />
246
- </Button>
252
+ </CoreIconButton>
247
253
  </div>
248
254
  </div>
249
255
  {/if}
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { useBlocksI18n } from '../..';
3
- import { Button } from '../../primitives/Button';
3
+ // internal core, not the public component — keeps the public-to-public import graph clean (see internal/core/)
4
+ import CoreIconButton from '../../internal/core/CoreIconButton.svelte';
4
5
  import { getCalendarContext, createSlotHelper } from './calendar.context';
5
6
  import {
6
7
  getMonthGrid,
@@ -118,27 +119,26 @@
118
119
  </script>
119
120
 
120
121
  <div class={slot('miniCalendar', className)}>
121
- <!-- Mini header -->
122
+ <!-- Mini header. Nav buttons render on the internal CoreIconButton (was
123
+ `<Button unstyled mint="none">`); the plumbing/slot split is documented
124
+ on the miniCalendarNavButton slot in calendar.variants.ts. Never
125
+ disabled, so the core's disabled plumbing is inert here. -->
122
126
  <div class={slot('miniCalendarHeader')}>
123
- <Button
124
- unstyled
125
- mint="none"
127
+ <CoreIconButton
126
128
  class={slot('miniCalendarNavButton')}
127
129
  onclick={() => navigateMini(-1)}
128
130
  aria-label={bt('calendar.previousMonth')}
129
131
  >
130
132
 
131
- </Button>
133
+ </CoreIconButton>
132
134
  <span class={slot('miniCalendarTitle')}>{miniTitle}</span>
133
- <Button
134
- unstyled
135
- mint="none"
135
+ <CoreIconButton
136
136
  class={slot('miniCalendarNavButton')}
137
137
  onclick={() => navigateMini(1)}
138
138
  aria-label={bt('calendar.nextMonth')}
139
139
  >
140
140
 
141
- </Button>
141
+ </CoreIconButton>
142
142
  </div>
143
143
 
144
144
  <!-- Weekday headers — narrow names duplicate in many locales (de-DE: M, D,