@urbicon-ui/design-content 6.1.8

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 (111) hide show
  1. package/README.md +54 -0
  2. package/content/auth/components/account-settings/llm.txt +33 -0
  3. package/content/auth/components/forgot-password-page/llm.txt +25 -0
  4. package/content/auth/components/invitation-manager/llm.txt +28 -0
  5. package/content/auth/components/login-page/llm.txt +34 -0
  6. package/content/auth/components/notification-badge/llm.txt +21 -0
  7. package/content/auth/components/notification-center/llm.txt +33 -0
  8. package/content/auth/components/notification-listener/llm.txt +24 -0
  9. package/content/auth/components/passkey-manager/llm.txt +27 -0
  10. package/content/auth/components/push-permission-prompt/llm.txt +32 -0
  11. package/content/auth/components/register-page/llm.txt +35 -0
  12. package/content/auth/components/reset-password-page/llm.txt +26 -0
  13. package/content/auth/components/session-manager/llm.txt +32 -0
  14. package/content/auth/components/two-factor-manager/llm.txt +40 -0
  15. package/content/auth/components/verify-email-page/llm.txt +25 -0
  16. package/content/blocks/components/area-chart/llm.txt +46 -0
  17. package/content/blocks/components/bar-chart/llm.txt +44 -0
  18. package/content/blocks/components/calendar/llm.txt +105 -0
  19. package/content/blocks/components/chart-frame/llm.txt +38 -0
  20. package/content/blocks/components/command-palette/llm.txt +60 -0
  21. package/content/blocks/components/composition-bar/llm.txt +69 -0
  22. package/content/blocks/components/currency-input/llm.txt +65 -0
  23. package/content/blocks/components/date-picker/llm.txt +90 -0
  24. package/content/blocks/components/donut-chart/llm.txt +45 -0
  25. package/content/blocks/components/empty-state/llm.txt +43 -0
  26. package/content/blocks/components/file-upload/llm.txt +76 -0
  27. package/content/blocks/components/guide/llm.txt +49 -0
  28. package/content/blocks/components/guide-article/llm.txt +30 -0
  29. package/content/blocks/components/guide-beacon/llm.txt +38 -0
  30. package/content/blocks/components/guide-hint/llm.txt +41 -0
  31. package/content/blocks/components/guide-marker/llm.txt +36 -0
  32. package/content/blocks/components/guide-mention/llm.txt +31 -0
  33. package/content/blocks/components/guide-panel/llm.txt +42 -0
  34. package/content/blocks/components/guide-provider/llm.txt +31 -0
  35. package/content/blocks/components/line-chart/llm.txt +45 -0
  36. package/content/blocks/components/locale-switcher/llm.txt +44 -0
  37. package/content/blocks/components/planner/llm.txt +68 -0
  38. package/content/blocks/components/sankey/llm.txt +72 -0
  39. package/content/blocks/components/sidebar-layout/llm.txt +87 -0
  40. package/content/blocks/components/sparkline/llm.txt +33 -0
  41. package/content/blocks/components/theme-switcher/llm.txt +40 -0
  42. package/content/blocks/primitives/accordion/llm.txt +57 -0
  43. package/content/blocks/primitives/alert/llm.txt +54 -0
  44. package/content/blocks/primitives/avatar/llm.txt +61 -0
  45. package/content/blocks/primitives/badge/llm.txt +60 -0
  46. package/content/blocks/primitives/breadcrumb/llm.txt +47 -0
  47. package/content/blocks/primitives/button/llm.txt +80 -0
  48. package/content/blocks/primitives/button-group/llm.txt +65 -0
  49. package/content/blocks/primitives/card/llm.txt +68 -0
  50. package/content/blocks/primitives/checkbox/llm.txt +61 -0
  51. package/content/blocks/primitives/collapsible/llm.txt +66 -0
  52. package/content/blocks/primitives/combobox/llm.txt +86 -0
  53. package/content/blocks/primitives/confirm-dialog/llm.txt +47 -0
  54. package/content/blocks/primitives/dialog/llm.txt +59 -0
  55. package/content/blocks/primitives/drawer/llm.txt +54 -0
  56. package/content/blocks/primitives/form-field/llm.txt +43 -0
  57. package/content/blocks/primitives/input/llm.txt +73 -0
  58. package/content/blocks/primitives/menu/llm.txt +81 -0
  59. package/content/blocks/primitives/pagination/llm.txt +68 -0
  60. package/content/blocks/primitives/popover/llm.txt +72 -0
  61. package/content/blocks/primitives/progress/llm.txt +55 -0
  62. package/content/blocks/primitives/radio-group/llm.txt +53 -0
  63. package/content/blocks/primitives/segment-group/llm.txt +51 -0
  64. package/content/blocks/primitives/select/llm.txt +130 -0
  65. package/content/blocks/primitives/separator/llm.txt +45 -0
  66. package/content/blocks/primitives/sidebar/llm.txt +79 -0
  67. package/content/blocks/primitives/skeleton/llm.txt +54 -0
  68. package/content/blocks/primitives/slider/llm.txt +82 -0
  69. package/content/blocks/primitives/spinner/llm.txt +46 -0
  70. package/content/blocks/primitives/stepper/llm.txt +60 -0
  71. package/content/blocks/primitives/tab/llm.txt +72 -0
  72. package/content/blocks/primitives/textarea/llm.txt +61 -0
  73. package/content/blocks/primitives/toast/llm.txt +45 -0
  74. package/content/blocks/primitives/toggle/llm.txt +62 -0
  75. package/content/blocks/primitives/toolbar/llm.txt +60 -0
  76. package/content/blocks/primitives/tooltip/llm.txt +54 -0
  77. package/content/component-catalog.json +5010 -0
  78. package/content/design-system/patterns/dashboard.md +55 -0
  79. package/content/design-system/patterns/form-page.md +69 -0
  80. package/content/design-system/patterns/onboarding-guide.md +50 -0
  81. package/content/design-system/patterns/planning-board.md +46 -0
  82. package/content/design-system/patterns/settings-page.md +48 -0
  83. package/content/design-system/patterns/tab-navigation.md +136 -0
  84. package/content/design-system/principles.md +260 -0
  85. package/content/docs/components/api-reference/llm.txt +32 -0
  86. package/content/docs/components/code-example/llm.txt +44 -0
  87. package/content/docs/components/code-panel/llm.txt +26 -0
  88. package/content/docs/components/docs-layout/llm.txt +61 -0
  89. package/content/docs/components/info-card/llm.txt +31 -0
  90. package/content/docs/components/playground-configurator/llm.txt +49 -0
  91. package/content/docs/components/section/llm.txt +46 -0
  92. package/content/docs/components/table-of-contents/llm.txt +48 -0
  93. package/content/docs/components/types-reference/llm.txt +38 -0
  94. package/content/guides/llms-full-template.md +1019 -0
  95. package/content/icons.json +4834 -0
  96. package/content/meta.json +5 -0
  97. package/content/table/table/llm.txt +110 -0
  98. package/content/verbs/adopt.md +33 -0
  99. package/content/verbs/audit.md +29 -0
  100. package/content/verbs/compose.md +38 -0
  101. package/content/verbs/critique.md +27 -0
  102. package/content/verbs/fix.md +29 -0
  103. package/content/verbs/migrate.md +30 -0
  104. package/content/verbs/onboard.md +33 -0
  105. package/content/verbs/polish.md +25 -0
  106. package/content/verbs/redesign.md +29 -0
  107. package/content/verbs/retheme.md +29 -0
  108. package/package.json +45 -0
  109. package/src/content-loader.test.ts +78 -0
  110. package/src/content-loader.ts +97 -0
  111. package/src/index.ts +23 -0
@@ -0,0 +1,105 @@
1
+
2
+ ---
3
+
4
+ ## Calendar
5
+ Flexible calendar component with month, year, week, and day views.
6
+ Renders timed appointments, multi-day spans and recurrence on a time grid, with
7
+ event display, date selection and configurable layout. For a headless grid that
8
+ buckets your own domain content (meals, shifts, bookings) per day, use `Planner`.
9
+
10
+ **Import:** `import { Calendar } from '@urbicon-ui/blocks';`
11
+
12
+ ### Examples
13
+ ```svelte
14
+ <Calendar
15
+ events={wasteEvents}
16
+ categories={wasteCategories}
17
+ bind:value={selectedDate}
18
+ showEventList
19
+ showLegend
20
+ locale="de-DE"
21
+ />
22
+ ```
23
+
24
+ ```svelte
25
+ <Calendar view="week" bind:value={selectedDate} />
26
+ ```
27
+
28
+ ```svelte
29
+ <Calendar selectionMode="range" bind:value={dateRange}>
30
+ {#snippet children()}
31
+ <CalendarHeader showViewSwitcher />
32
+ <CalendarGrid />
33
+ {/snippet}
34
+ </Calendar>
35
+ ```
36
+
37
+ ### Variants
38
+ - variant: bordered, default, ghost (default: default)
39
+ - size: lg, md, sm (default: md)
40
+
41
+ ### Api
42
+ | Prop | Type | Required | Default | Description |
43
+ | --- | --- | :---: | --- | --- |
44
+ | ...CalendarVariants | `VariantProps` | no | | Styling variants from CalendarVariants |
45
+ | ...HTMLAttributes<HTMLDivElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') |
46
+ | agendaDays | `number` | no | 30 | Number of days shown in agenda view. |
47
+ | animated | `boolean` | no | true | Enable animated transitions for navigation. |
48
+ | categories | `CalendarEventCategory[]` | no | [] | Event categories for color coding and legend. |
49
+ | children | `Snippet` | no | | Default children snippet for custom layout composition. |
50
+ | class | `string` | no | | Extra CSS classes on the root element. |
51
+ | dayCell | `Snippet<[DayCellContext]>` | no | | Custom snippet for rendering a day cell. |
52
+ | defaultDate | `Date` | no | | Initial reference day the grid is anchored on, without selecting it. Use this to open a **week** or **day** view on a specific week — `defaultMonth`/ `defaultYear` resolve to the 1st, whose week can fall mostly in the previous month. Ignored when `value` is set (the selection anchors instead); takes priority over `defaultMonth`/`defaultYear`. Read at mount only. |
53
+ | defaultMonth | `number` | no | | Initial displayed month (0–11). Used only when `value` and `defaultDate` are unset; when `value` is provided, the calendar opens on the value's month. Best for month/year views — for week/day views prefer `defaultDate`. Defaults to current month. |
54
+ | defaultYear | `number` | no | | Initial displayed year. Used only when `value` is unset; when `value` is provided, the calendar opens on the value's year. Defaults to current year. |
55
+ | disabled | `boolean` | no | false | Disable the entire calendar. |
56
+ | disabledDates | `Date[]` | no | | Specific dates that are disabled (not selectable). |
57
+ | draggable | `boolean` | no | false | Enable drag & drop to move events between dates. |
58
+ | eventItem | `Snippet<[EventItemContext]>` | no | | Custom snippet for rendering an event item in the detail list. |
59
+ | eventPopover | `boolean` | no | false | Show a rich popover on hover/focus for days with events (month view). |
60
+ | events | `CalendarEvent[]` | no | [] | Array of events to display on the calendar. |
61
+ | fixedWeeks | `boolean` | no | false | Always show 6 weeks in the grid. |
62
+ | header | `Snippet<[HeaderContext]>` | no | | Custom snippet for the header area. |
63
+ | isDateDisabled | `(date: Date) => boolean` | no | | Function to test whether a date is disabled. |
64
+ | locale | `string` | no | 'de-DE' | BCP 47 locale tag for date formatting. |
65
+ | maxDate | `Date` | no | | Latest selectable/navigable date. |
66
+ | minDate | `Date` | no | | Earliest selectable/navigable date. |
67
+ | miniCalendarPosition | `'left' | 'right'` | no | 'left' | Position of the mini calendar sidebar. |
68
+ | mint | `MintProp` | no | | Micro-interaction preset. |
69
+ | onDateClick | `(date: Date) => void` | no | | Fires when a date cell is clicked (regardless of selection change). |
70
+ | onDateCreate | `(date: Date, view: CalendarViewMode) => void` | no | | Fires on double-click on a day cell for event creation. The consumer shows their own form. |
71
+ | onDayChange | `(date: Date) => void` | no | | Fires when the displayed day changes (day view). |
72
+ | onEventClick | `(event: CalendarEvent) => void` | no | | Fires when an event is clicked. |
73
+ | onEventMove | `(event: CalendarEvent, newStart: Date, newEnd: Date) => void` | no | | Fires when an event is moved via drag & drop. |
74
+ | onEventResize | `(event: CalendarEvent, newEnd: Date) => void` | no | | Fires when an event is resized via drag handle. |
75
+ | onMonthChange | `(month: number, year: number) => void` | no | | Fires when the displayed month/year changes via navigation. |
76
+ | onTimeSlotCreate | `(start: Date, end: Date) => void` | no | | Fires on click on an empty time slot for event creation. Returns default 1h duration. |
77
+ | onValueChange | `(value: CalendarSelection) => void` | no | | Fires when the selected date(s) change. |
78
+ | onViewChange | `(view: CalendarViewMode) => void` | no | | Fires when the view mode changes. |
79
+ | onWeekChange | `(weekStart: Date) => void` | no | | Fires when the displayed week changes (week view). |
80
+ | preset | `string` | no | | Apply a named preset registered via `<BlocksProvider presets={{ Calendar: {...} }}>`. Prefer this over `class` overrides when the requested look falls outside the semantic intent palette — presets keep hover/active/dark-mode logic coherent and make the custom look reusable across the project. |
81
+ | resizable | `boolean` | no | false | Enable resize handles on timed events in the time grid. |
82
+ | selectionMode | `'single' | 'range' | 'multiple'` | no | 'single' | SelectionMode property for the Calendar component |
83
+ | showEventList | `boolean` | no | | Whether to show the detail list when a date is selected. Auto-enabled when events are provided. |
84
+ | showLegend | `boolean` | no | | Whether to show the built-in legend. Defaults to true when categories are provided. |
85
+ | showMiniCalendar | `boolean` | no | false | Show a mini month calendar sidebar (week/day/agenda views). |
86
+ | showOutsideDays | `boolean` | no | true | Show days from previous/next months to fill the grid. |
87
+ | showTimeGrid | `boolean` | no | | Show time grid in week/day views. Auto-detected from events with allDay: false. |
88
+ | showViewSwitcher | `boolean` | no | true | Show the view switcher in the header. |
89
+ | showWeekNumbers | `boolean` | no | false | Show ISO week numbers in the left margin. |
90
+ | size | `'sm' | 'md' | 'lg'` | no | 'md' | Size variant that controls dimensions and spacing of the Calendar |
91
+ | slotClasses | `Partial<Record<CalendarSlotName, string>>` | no | | Per-slot class overrides. |
92
+ | swipeable | `boolean` | no | true | Enable swipe gestures for touch navigation. |
93
+ | timeGridEndHour | `number` | no | 20 | Last visible hour in time grid (exclusive). |
94
+ | timeGridInterval | `30 | 60` | no | 60 | Time slot interval in minutes. |
95
+ | timeGridStartHour | `number` | no | 7 | First visible hour in time grid. |
96
+ | unstyled | `boolean` | no | | Strip all default tv() classes. |
97
+ | value | `CalendarSelection` | no | | Currently selected date(s). Supports bind:value. |
98
+ | variant | `'default' | 'bordered' | 'ghost'` | no | 'default' | Visual style variant for the Calendar component |
99
+ | view | `CalendarViewMode` | no | 'month' | Active view mode. Supports bind:view. |
100
+ | views | `CalendarViewMode[]` | no | ['month', 'week', 'day', 'year', 'agenda'] | Which views appear in the view switcher. |
101
+ | weekStartsOn | `0 | 1 | 2 | 3 | 4 | 5 | 6` | no | 1 | First day of the week. 0 = Sunday, 1 = Monday. |
102
+
103
+ Inherited from:
104
+ - Omit<CalendarVariants, 'dayState' | 'hasEvents'> (omit-pattern)
105
+ - Omit<HTMLAttributes<HTMLDivElement>, 'children'> (omit-pattern)
@@ -0,0 +1,38 @@
1
+
2
+ ---
3
+
4
+ ## ChartFrame
5
+ Responsive SVG chart shell: measures its width via
6
+ ResizeObserver, applies plot margins, and hands the drawable plot geometry
7
+ to a child snippet. The building block under every cartesian chart in the
8
+ family — use it directly only for fully custom marks.
9
+
10
+ **Import:** `import { ChartFrame } from '@urbicon-ui/blocks';`
11
+
12
+ ### Examples
13
+ ```svelte
14
+ <ChartFrame height={200} ariaLabel="Weekly revenue">
15
+ {#snippet children({ innerWidth, innerHeight })}
16
+ <!-- map your data onto innerWidth / innerHeight, then draw SVG marks -->
17
+ <polyline points={pts} fill="none" class="stroke-primary" stroke-width="2" />
18
+ {/snippet}
19
+ </ChartFrame>
20
+ ```
21
+
22
+ ### Api
23
+ | Prop | Type | Required | Default | Description |
24
+ | --- | --- | :---: | --- | --- |
25
+ | ...HTMLAttributes<HTMLElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') |
26
+ | ariaLabel | `string` | no | | Accessible label for the chart image (role="img"). |
27
+ | children | `Snippet<[ChartPlot]>` | no | | Renders the SVG plot content; receives the geometry. |
28
+ | class | `string` | no | | Extra classes merged onto the <figure> wrapper. |
29
+ | fallback | `Snippet` | no | | Screen-reader fallback (e.g. a data table) rendered visually hidden. |
30
+ | height | `number` | no | 240 | Fixed SVG height in px. |
31
+ | legend | `Snippet` | no | | Optional legend rendered (as HTML) below the SVG. |
32
+ | margin | `ChartMargin` | no | | Plot margins; merged over the frame defaults. |
33
+ | slotClasses | `ChartSlotClasses` | no | | Per-slot class overrides. |
34
+ | unstyled | `boolean` | no | | Remove all default tv classes. |
35
+ | width | `number` | no | | Fixed width in px. Omit for responsive width measured from the container (the common case); set it only for SSR-stable, non-responsive output. |
36
+
37
+ Inherited from:
38
+ - Omit<HTMLAttributes<HTMLElement>, 'children'> (omit-pattern)
@@ -0,0 +1,60 @@
1
+
2
+ ---
3
+
4
+ ## CommandPalette
5
+ Keyboard-driven command palette with search, grouped results,
6
+ and arrow-key navigation. Composes Dialog + search input into a ready-to-use overlay.
7
+ Open via bind:open or the built-in Cmd+K shortcut.
8
+
9
+ **Import:** `import { CommandPalette } from '@urbicon-ui/blocks';`
10
+
11
+ ### Examples
12
+ ```svelte
13
+ <CommandPalette
14
+ items={commands}
15
+ bind:open
16
+ onSelect={(item) => handleCommand(item)}
17
+ placeholder="Type a command..."
18
+ />
19
+ ```
20
+
21
+ ```svelte
22
+ <CommandPalette
23
+ items={[
24
+ { id: 'new', label: 'New File', category: 'File', shortcut: 'Ctrl+N' },
25
+ { id: 'open', label: 'Open File', category: 'File', shortcut: 'Ctrl+O' },
26
+ { id: 'theme', label: 'Toggle Theme', category: 'Settings' },
27
+ { id: 'search', label: 'Search', category: 'Navigation', shortcut: 'Ctrl+F' }
28
+ ]}
29
+ bind:open={paletteOpen}
30
+ onSelect={(item) => runAction(item.id)}
31
+ size="md"
32
+ showFooter
33
+ />
34
+ ```
35
+
36
+ ### Variants
37
+ - size: lg, md, sm (default: md)
38
+
39
+ ### Api
40
+ | Prop | Type | Required | Default | Description |
41
+ | --- | --- | :---: | --- | --- |
42
+ | items | `CommandPaletteItem[]` | yes | | Items to display. Grouped automatically by `category`. |
43
+ | class | `string` | no | | Additional CSS classes on the root wrapper. |
44
+ | customEmpty | `Snippet<[query: string]>` | no | | Custom empty-state renderer. Receives the current query string. |
45
+ | customItem | `Snippet<[item: CommandPaletteItem, highlighted: boolean, index: number]>` | no | | Custom item renderer. Receives the item, whether it is highlighted, and its flat index. |
46
+ | emptyText | `string` | no | 'No results found.' | Message shown when the filter returns no results. |
47
+ | filter | `(item: CommandPaletteItem, query: string) => boolean` | no | | Custom filter function. Receives each item and the current query. Return `true` to keep the item. When omitted, a case-insensitive label + category substring match is used. |
48
+ | onOpenChange | `(open: boolean) => void` | no | | Fired when the open state changes (close via Escape, backdrop, or selection). |
49
+ | onSelect | `(item: CommandPaletteItem) => void` | no | | Fired when an item is selected via click or Enter. |
50
+ | open | `boolean` | no | false | Controls visibility. Supports `bind:open`. |
51
+ | placeholder | `string` | no | 'Search...' | Placeholder text for the search input. |
52
+ | preset | `string` | no | | Apply a named preset registered via `<BlocksProvider presets={{ CommandPalette: {...} }}>`. Prefer this over `class` overrides when the requested look falls outside the semantic intent palette — presets keep hover/active/dark-mode logic coherent and make the custom look reusable across the project. |
53
+ | shortcut | `string | false` | no | 'mod+k' (Cmd+K / Ctrl+K) | Register a global keyboard shortcut that toggles the palette. Set to `false` to disable. |
54
+ | showFooter | `boolean` | no | true | Show keyboard-shortcut hints in the footer. |
55
+ | size | `CommandPaletteVariants['size']` | no | 'md' | Maximum width of the palette panel. |
56
+ | slotClasses | `Partial<Record<'wrapper' | 'input' | 'inputIcon' | 'clearButton' | 'list' | 'group' | 'groupLabel' | 'item' | 'itemHighlighted' | 'itemDefault' | 'itemDisabled' | 'itemIcon' | 'itemLabel' | 'itemShortcut' | 'empty' | 'footer' | 'kbd', string>>` | no | | Per-slot class overrides. |
57
+ | unstyled | `boolean` | no | false | Strip all default styles. |
58
+
59
+ ### Slots (slotClasses keys)
60
+ `wrapper`, `input`, `inputIcon`, `clearButton`, `list`, `group`, `groupLabel`, `item`, `itemHighlighted`, `itemDefault`, `itemDisabled`, `itemIcon`, `itemLabel`, `itemShortcut`, `empty`, `footer`, `kbd`
@@ -0,0 +1,69 @@
1
+
2
+ ---
3
+
4
+ ## CompositionBar
5
+ Stacked bar with legend that breaks an aggregate value down into
6
+ its components. Suited for budget splits, pool composition, resource
7
+ allocation, token vesting — anywhere `pool = a + b + c` should be visible
8
+ at a glance.
9
+
10
+ Small segments (< 2% of the total width) are kept minimally visible;
11
+ hovering/focusing the bar or the legend highlights the counterpart in
12
+ sync. Tooltip content is fully overridable via the `tooltip` snippet.
13
+
14
+ **Import:** `import { CompositionBar } from '@urbicon-ui/blocks';`
15
+
16
+ ### Examples
17
+ ```svelte
18
+ <CompositionBar
19
+ items={[
20
+ { label: 'Gas', value: 220609, intent: 'primary' },
21
+ { label: 'Power', value: 112731, intent: 'secondary' },
22
+ { label: 'Maintenance', value: 36102, intent: 'success' }
23
+ ]}
24
+ formatValue={(v) => formatCurrency(v)}
25
+ size="lg"
26
+ legendPlacement="right"
27
+ showTotal
28
+ />
29
+ ```
30
+
31
+ ### Variants
32
+ - size: lg, md, sm (default: md)
33
+ - legendPlacement: bottom, left, none, right, top (default: bottom)
34
+ - orientation: horizontal, vertical (default: horizontal)
35
+
36
+ ### Api
37
+ | Prop | Type | Required | Default | Description |
38
+ | --- | --- | :---: | --- | --- |
39
+ | items | `CompositionItem[]` | yes | | Composition shares in the order they should appear in the bar. |
40
+ | ...CompositionBarVariants | `VariantProps` | no | | Styling variants from CompositionBarVariants |
41
+ | ...HTMLAttributes<HTMLDivElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') |
42
+ | class | `string` | no | | Extra classes merged onto the wrapper. |
43
+ | formatPercent | `(percent: number) => string` | no | | Format function for percentages. Default: 1 fraction digit, formatted with the active locale (e.g. `12.3 %`). |
44
+ | formatValue | `(value: number) => string` | no | | Format function for values (tooltip, legend, total). |
45
+ | intent | `CompositionBarIntent` | no | 'primary' | Default intent for items without their own `intent`/`color`. |
46
+ | legendItem | `Snippet<[item: CompositionItem, percent: number]>` | no | | Custom rendering of a legend entry. Receives the item and its percentage. Fully replaces the default rendering (dot + label + value/percent). |
47
+ | minSegmentPercent | `number` | no | 1.5 | Minimum segment width in percent. Values below it are raised to this width so they stay visible in the bar (nothing gets swallowed). Larger segments are shrunk proportionally so the sum still adds up to 100%. |
48
+ | mint | `MintProp` | no | 'none' | Micro-interaction preset. |
49
+ | onItemSelect | `(item: CompositionItem, index: number) => void` | no | | Selection callback fired when a bar segment or legend entry is clicked. Receives the item and its index. Makes the bar interactive (cursor + click handler). |
50
+ | preset | `string` | no | | Preset name (registered via `<BlocksProvider presets={{ CompositionBar: {...} }}>`). |
51
+ | showLegend | `boolean` | no | true | ShowLegend property for the CompositionBar component |
52
+ | showPercentages | `boolean` | no | true | Show percentages in legend and tooltip. |
53
+ | showTotal | `boolean` | no | false | Render the total value after the legend. |
54
+ | showValues | `boolean` | no | false | Render the value directly inside the bar segment (in addition to the legend). Narrow segments are skipped automatically to prevent overflow — only segments with sufficient width (≥ 8% or ~40 px) show their value. Useful for print, PDF attachments, or dense dashboards where hover tooltips are not enough. |
55
+ | slotClasses | `Partial<Record<'wrapper' | 'barWrapper' | 'bar' | 'segment' | 'segmentRest' | 'tooltip' | 'tooltipLabel' | 'tooltipDetail' | 'legend' | 'legendItem' | 'legendDot' | 'legendLabel' | 'legendValue' | 'total' | 'totalLabel', string>>` | no | | Per-slot class overrides. |
56
+ | tooltip | `Snippet<[item: CompositionItem, percent: number]>` | no | | Custom tooltip content. Replaces the default layout (label, value, percent). |
57
+ | total | `number` | no | | Optional fixed total value. Default: Σ items.value. If the explicit total exceeds the sum, the remaining area is rendered neutrally ("unaccounted share"). If it is below the sum, segments are scaled to 100% and a console warning is emitted. |
58
+ | totalLabel | `string` | no | | Label rendered before the total. Defaults to the localized "Total" label from the blocks i18n bundle. |
59
+ | unstyled | `boolean` | no | | Remove all default classes; only the layout structure remains. |
60
+ | size | `'lg' | 'md' | 'sm'` | no | md | Controls the dimensions, padding, and text size of the CompositionBar. Affects the component's physical footprint. Available options: lg, md, sm. |
61
+ | legendPlacement | `'bottom' | 'left' | 'none' | 'right' | 'top'` | no | bottom | Controls the legendPlacement behavior and appearance of the CompositionBar component. Available options: bottom, left, none, and 2 more. |
62
+ | orientation | `'horizontal' | 'vertical'` | no | horizontal | Controls the orientation behavior and appearance of the CompositionBar component. Available options: horizontal, vertical. |
63
+
64
+ Inherited from:
65
+ - Omit<CompositionBarVariants, 'isHovered'> (omit-pattern)
66
+ - Omit<HTMLAttributes<HTMLDivElement>, 'children'> (omit-pattern)
67
+
68
+ ### Slots (slotClasses keys)
69
+ `wrapper`, `barWrapper`, `bar`, `segment`, `segmentRest`, `tooltip`, `tooltipLabel`, `tooltipDetail`, `legend`, `legendItem`, `legendDot`, `legendLabel`, `legendValue`, `total`, `totalLabel`
@@ -0,0 +1,65 @@
1
+
2
+ ---
3
+
4
+ ## CurrencyInput
5
+ Locale-aware monetary input that stores values in **minor units**
6
+ (cents for EUR/USD, pennies for GBP, etc.). While focused the user types raw
7
+ digits with a single decimal separator; on blur the value is reformatted with
8
+ the locale's grouping separators. The currency symbol is rendered as a static
9
+ adornment (left or right of the field) and stays visible at all times.
10
+
11
+ Storing cents as integers avoids floating-point drift when summing, sorting,
12
+ or persisting amounts. Parsing also goes through string splits — never
13
+ `parseFloat * factor` — so values like `1,005` round to the expected
14
+ `100` minor units (instead of `99` due to IEEE-754 drift). Use
15
+ for currencies with non-2 decimal
16
+ places (JPY = 0, BHD = 3).
17
+
18
+ **Import:** `import { CurrencyInput } from '@urbicon-ui/blocks';`
19
+
20
+ ### Examples
21
+ ```svelte
22
+ <script>
23
+ let priceCents = $state(1234_56); // 1.234,56 €
24
+ </script>
25
+ <CurrencyInput label="Price" bind:value={priceCents} />
26
+ ```
27
+
28
+ ```svelte
29
+ <CurrencyInput
30
+ label="Amount"
31
+ bind:value={amountCents}
32
+ locale="en-US"
33
+ currency="USD"
34
+ symbolPosition="prefix"
35
+ />
36
+ ```
37
+
38
+ ```svelte
39
+ <CurrencyInput bind:value={yen} locale="ja-JP" currency="JPY" precision={0} />
40
+ ```
41
+
42
+ ### Api
43
+ | Prop | Type | Required | Default | Description |
44
+ | --- | --- | :---: | --- | --- |
45
+ | currency | `string` | no | 'EUR' | ISO-4217 currency code. Determines the symbol when is `'prefix'` or `'suffix'`. |
46
+ | locale | `string` | no | 'de-DE' | BCP 47 locale used for formatting (`Intl.NumberFormat`). Controls grouping separator (`.` vs `,`) and decimal separator. Pass `'auto'` to defer to the runtime locale (`Intl.NumberFormat().resolvedOptions().locale`) — i.e. the user's browser language. Note that the runtime locale on the server (Node) and in the browser typically differ, so SSR pages using `'auto'` may briefly show a different format on initial render before hydration. `currency` is intentionally **not** auto-detected, since it is orthogonal to locale (a `de-CH` user may still bill in EUR). |
47
+ | name | `string` | no | | Shared `name` for native form submission. When set, a hidden input is rendered carrying the integer minor-unit value (matching ) — never the locale-formatted display string. The visible Input itself stays unnamed so the formatted text is not submitted alongside. Empty / `null` values submit as `""` so the field still appears in the FormData payload (consumers can disambiguate "untouched" via server-side schema parsing). |
48
+ | onValueChange | `(cents: number | null) => void` | no | | Fires whenever the parsed value changes. Receives the new value in minor units (or `null`). |
49
+ | precision | `number` | no | 2 | Number of fractional digits stored in . For most currencies `2`; for JPY use `0`, for BHD/KWD use `3`. |
50
+ | symbolPosition | `CurrencySymbolPosition` | no | 'suffix' | Where the currency symbol is rendered as a static adornment. The symbol is shown in the input's left or right icon slot (always visible, including while focused) — it is never embedded in the editable text. Use `'none'` for headless numeric editing (no symbol shown at all). |
51
+ | value | `number | null` | no | null | Current monetary value in **minor units** (e.g. cents). Use `null` for "no value entered yet"; the input renders empty. |
52
+
53
+ Inherited from:
54
+ - Omit<
55
+ InputProps,
56
+ | 'type'
57
+ | 'value'
58
+ | 'onClear'
59
+ | 'inputmode'
60
+ | 'oninput'
61
+ | 'onchange'
62
+ | 'onblur'
63
+ | 'onfocus'
64
+ | 'name'
65
+ > (omit-pattern)
@@ -0,0 +1,90 @@
1
+
2
+ ---
3
+
4
+ ## DatePicker
5
+ Date input with calendar popup for selecting a single date. Supports min/max constraints, disabled dates, and format customization.
6
+
7
+ The `value` prop accepts either a `Date` or an ISO timestamp string —
8
+ useful when surrounding state is hydrated from JSON or a SQL driver
9
+ that serialises timestamps as strings. `onValueChange` always reports
10
+ back a `Date` (or `undefined`); use `toDateInputValue` from
11
+ `@urbicon-ui/blocks` to project it back into a string state.
12
+
13
+ **Import:** `import { DatePicker } from '@urbicon-ui/blocks';`
14
+
15
+ ### Examples
16
+ ```svelte
17
+ <DatePicker
18
+ bind:value={selectedDate}
19
+ label="Date of birth"
20
+ placeholder="Select a date"
21
+ locale="en-US"
22
+ clearable
23
+ />
24
+ ```
25
+
26
+ ```svelte
27
+ <script>
28
+ import { DatePicker, toDateInputValue } from '@urbicon-ui/blocks';
29
+ let isoDate = $state('2026-04-22T08:00:00Z');
30
+ </script>
31
+ <DatePicker
32
+ value={isoDate}
33
+ onValueChange={(d) => (isoDate = toDateInputValue(d))}
34
+ label="Period start"
35
+ />
36
+ ```
37
+
38
+ ```svelte
39
+ <DatePicker
40
+ bind:value={deadline}
41
+ label="Deadline"
42
+ minDate={new Date()}
43
+ maxDate={new Date(2026, 11, 31)}
44
+ isDateDisabled={(d) => d.getDay() === 0 || d.getDay() === 6}
45
+ required
46
+ error={deadlineError}
47
+ />
48
+ ```
49
+
50
+ ### Api
51
+ | Prop | Type | Required | Default | Description |
52
+ | --- | --- | :---: | --- | --- |
53
+ | ...HTMLAttributes<HTMLDivElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') |
54
+ | calendarVariant | `'default' | 'bordered' | 'ghost'` | no | 'default' | Visual style of the calendar popup. |
55
+ | class | `string` | no | | Additional CSS classes to apply to the DatePicker component |
56
+ | clearable | `boolean` | no | true | Allow clearing the selected date. |
57
+ | closeOnClickOutside | `boolean` | no | true | Whether the popover closes on outside click. |
58
+ | closeOnEscape | `boolean` | no | true | Whether the popover closes on Escape key. |
59
+ | closeOnSelect | `boolean` | no | true | Close popover after selecting a date. |
60
+ | defaultMonth | `MonthIndex` | no | | Default month shown when the picker opens without a value. `0`–`11`. |
61
+ | defaultYear | `number` | no | | Default year shown when the picker opens without a value. |
62
+ | disabled | `boolean` | no | false | Disable the entire picker. |
63
+ | disabledDates | `Date[]` | no | | Specific dates that are disabled. |
64
+ | displayFormat | `DateFormatOptions` | no | | Intl.DateTimeFormat options for the displayed date. |
65
+ | error | `string` | no | | Error message shown below the input. |
66
+ | fixedWeeks | `boolean` | no | false | Always show 6 weeks. |
67
+ | helper | `string` | no | | Helper text shown below the input. |
68
+ | inputVariant | `'outlined' | 'filled' | 'ghost' | 'underline'` | no | 'outlined' | InputVariant property for the DatePicker component |
69
+ | isDateDisabled | `(date: Date) => boolean` | no | | Predicate that disables specific dates. Errors thrown by the predicate are caught and logged; the date is then treated as allowed so a faulty consumer callback can't take the picker down. |
70
+ | label | `string` | no | | Label above the input. |
71
+ | locale | `string` | no | 'de-DE' | BCP 47 locale for date formatting and calendar. |
72
+ | maxDate | `Date` | no | | Latest selectable date. |
73
+ | minDate | `Date` | no | | Earliest selectable date. |
74
+ | mint | `MintProp` | no | | Micro-interaction preset. |
75
+ | name | `string` | no | | Shared `name` for native form submission. When set, a hidden input is rendered carrying the serialized date — matching what the user picked, so the visible input's locale-formatted display string is never submitted instead. Empty / unset values submit as `""` so the field still appears in the FormData payload. |
76
+ | onClickOutside | `() => void` | no | | Fires after an outside click closes the popover. Notification only — does NOT govern whether close happens. That is controlled by `closeOnClickOutside`. |
77
+ | onEscape | `() => void` | no | | Fires after Escape closes the popover. Notification only — does NOT govern whether close happens. That is controlled by `closeOnEscape`. |
78
+ | onOpenChange | `(open: boolean) => void` | no | | Fires when the popover opens or closes. |
79
+ | onValueChange | `(value: Date | undefined) => void` | no | | Fires when the selected date changes. |
80
+ | placeholder | `string` | no | | Placeholder when no date is selected. |
81
+ | required | `boolean` | no | false | Mark input as required. |
82
+ | showOutsideDays | `boolean` | no | true | Show days from adjacent months. |
83
+ | showWeekNumbers | `boolean` | no | false | Show ISO week numbers. |
84
+ | size | `'xs' | 'sm' | 'md' | 'lg' | 'xl'` | no | 'md' | Size variant that controls dimensions and spacing of the DatePicker |
85
+ | value | `Date | string | null` | no | | Currently selected date. Supports bind:value. Accepts a `Date`, an ISO timestamp string, or `null` / `undefined`. Internally coerced to a `Date`; the picker emits `Date` instances via . When both `bind:value` and `onValueChange` are wired, both fire on every user-driven change — pick one to drive side-effects (saves, analytics) to avoid duplicates. |
86
+ | valueFormat | `'date' | 'iso'` | no | 'date' | Format used to serialise the date for the hidden form input. - `'date'` (default): `YYYY-MM-DD` in the local timezone — matches the native `<input type="date">` payload and Zod schemas like `z.string().regex(/^\d{4}-\d{2}-\d{2}$/).transform((v) => new Date(v))`. - `'iso'`: full ISO-8601 with `Z` suffix (UTC). Use this when the downstream schema expects a parseable timestamp string (e.g. a Drizzle `timestamp({ withTimezone: true, mode: 'date' })` column). Only relevant when is set. |
87
+ | weekStartsOn | `WeekdayIndex` | no | 1 | First day of the week. 0 = Sunday, 1 = Monday. |
88
+
89
+ Inherited from:
90
+ - Omit<HTMLAttributes<HTMLDivElement>, 'children'> (omit-pattern)
@@ -0,0 +1,45 @@
1
+
2
+ ---
3
+
4
+ ## DonutChart
5
+ Donut (or pie) chart for part-to-whole composition. Zero-
6
+ dependency SVG arcs on the design-token palette, dark-mode aware, with an
7
+ optional center total, legend, and a screen-reader data-table fallback. Set
8
+ `innerRadiusRatio={0}` for a full pie. Pairs with CompositionBar for the
9
+ linear equivalent.
10
+
11
+ **Import:** `import { DonutChart } from '@urbicon-ui/blocks';`
12
+
13
+ ### Examples
14
+ ```svelte
15
+ <DonutChart
16
+ data={[
17
+ { label: 'Direct', value: 45 },
18
+ { label: 'Referral', value: 30 },
19
+ { label: 'Organic', value: 25 }
20
+ ]}
21
+ showTotal
22
+ />
23
+ ```
24
+
25
+ ### Api
26
+ | Prop | Type | Required | Default | Description |
27
+ | --- | --- | :---: | --- | --- |
28
+ | data | `DonutDatum[]` | yes | | Slices; angle is each value's share of the total. |
29
+ | ...HTMLAttributes<HTMLElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') |
30
+ | ariaLabel | `string` | no | | Accessible label; a summary is generated when omitted. |
31
+ | class | `string` | no | | Extra classes merged onto the wrapper. |
32
+ | formatValue | `(value: number) => string` | no | | Format values for the center total, tooltips, and the data table. |
33
+ | innerRadiusRatio | `number` | no | 0.6 | Inner-hole radius as a fraction of the outer radius (0 = pie). |
34
+ | locale | `string` | no | | BCP-47 locale for the default number formatter. |
35
+ | padAngle | `number` | no | 0 | Gap between slices in degrees. |
36
+ | preset | `string` | no | | Apply a named preset registered on `<BlocksProvider>`. |
37
+ | showLegend | `boolean` | no | true | ShowLegend property for the DonutChart component |
38
+ | showTotal | `boolean` | no | false | Show the summed total in the center hole. |
39
+ | size | `number` | no | 220 | Square SVG size in px. |
40
+ | slotClasses | `ChartSlotClasses` | no | | Per-slot class overrides. |
41
+ | totalLabel | `string` | no | | Caption under the center total (e.g. "Total"). |
42
+ | unstyled | `boolean` | no | | Remove all default tv classes. |
43
+
44
+ Inherited from:
45
+ - Omit<HTMLAttributes<HTMLElement>, 'children'> (omit-pattern)
@@ -0,0 +1,43 @@
1
+
2
+ ---
3
+
4
+ ## EmptyState
5
+ Centered placeholder block for "no data yet" / "no results"
6
+ states. Pairs an optional icon with a heading, supporting text, and an
7
+ optional call-to-action slot.
8
+
9
+ **Import:** `import { EmptyState } from '@urbicon-ui/blocks';`
10
+
11
+ ### Examples
12
+ ```svelte
13
+ <EmptyState
14
+ icon={BuildingIcon}
15
+ title="No apartments yet"
16
+ description="Get started by adding the first apartment to the system."
17
+ >
18
+ {#snippet cta()}
19
+ <Button intent="primary" onclick={openCreate}>Add apartment</Button>
20
+ {/snippet}
21
+ </EmptyState>
22
+ ```
23
+
24
+ ### Variants
25
+ - density: compact, default (default: default)
26
+
27
+ ### Api
28
+ | Prop | Type | Required | Default | Description |
29
+ | --- | --- | :---: | --- | --- |
30
+ | title | `string` | yes | | Title property for the EmptyState component |
31
+ | ...HTMLAttributes<HTMLDivElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children' | 'title') |
32
+ | children | `Snippet` | no | | Optional richer content rendered below the description (and replacing it visually). |
33
+ | class | `string` | no | | Extra classes merged onto the wrapper. |
34
+ | cta | `Snippet` | no | | Action buttons rendered below the description. |
35
+ | density | `'compact' | 'default'` | no | 'default' | Visual density. `compact` is suitable for inline empty rows in tables or cards; `default` for full-page empty states. |
36
+ | description | `string` | no | | Supporting paragraph below the title. |
37
+ | icon | `Component<IconProps>` | no | | Icon component rendered above the title. Pass any icon from `@urbicon-ui/blocks/icons` (or a compatible stroke icon). |
38
+ | preset | `string` | no | | Apply a named preset registered via `<BlocksProvider presets={{ EmptyState: {...} }}>`. Prefer this over `class` overrides when the same look should be reused across the project. |
39
+ | slotClasses | `Partial<Record<EmptyStateSlot, string>>` | no | | Per-slot class overrides. |
40
+ | unstyled | `boolean` | no | | Remove all default tv classes. |
41
+
42
+ Inherited from:
43
+ - Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> (omit-pattern)
@@ -0,0 +1,76 @@
1
+
2
+ ---
3
+
4
+ ## FileUpload
5
+ Drag-and-drop file upload with validation, image previews, progress tracking, and animated file list.
6
+
7
+ **Import:** `import { FileUpload } from '@urbicon-ui/blocks';`
8
+
9
+ ### Examples
10
+ ```svelte
11
+ <FileUpload
12
+ bind:files
13
+ multiple
14
+ maxFiles={5}
15
+ maxFileSize={10 * 1024 * 1024}
16
+ title="Drop files here or click to browse"
17
+ description="PDF, DOCX, XLSX — max 10 MB per file"
18
+ />
19
+ ```
20
+
21
+ ```svelte
22
+ <FileUpload
23
+ bind:files
24
+ accept={IMAGE_MIME_TYPES}
25
+ multiple
26
+ maxFiles={8}
27
+ title="Upload images"
28
+ description="PNG, JPG, WebP — max 5 MB"
29
+ onFileReject={(rejections) => console.log('Rejected:', rejections)}
30
+ />
31
+ ```
32
+
33
+ ### Variants
34
+ - intent: neutral, primary (default: neutral)
35
+ - size: lg, md, sm (default: md)
36
+ - disabled: false, true (default: false)
37
+
38
+ ### Api
39
+ | Prop | Type | Required | Default | Description |
40
+ | --- | --- | :---: | --- | --- |
41
+ | ...FileUploadVariants | `VariantProps` | no | | Styling variants from FileUploadVariants |
42
+ | ...HTMLAttributes<HTMLDivElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') |
43
+ | accept | `string | string[]` | no | | Accepted MIME types or file extensions (e.g. 'image/*', '.pdf'). |
44
+ | allowDrop | `boolean` | no | true | Enable drag-and-drop. |
45
+ | allowPaste | `boolean` | no | false | Enable paste from clipboard. |
46
+ | children | `Snippet` | no | | Default slot for fully custom dropzone content. |
47
+ | class | `string` | no | | Additional CSS class for the root element. |
48
+ | description | `string` | no | | Dropzone description text (accepted types, limits). |
49
+ | disabled | `boolean` | no | | Disable all interaction. |
50
+ | dropzoneIcon | `Snippet` | no | | Custom dropzone icon snippet. |
51
+ | file | `File | null` | no | | Convenience binding for single-file uses. Two-way: - Reads as `files[0]?.file ?? null`. - Setting to a `File` replaces the current selection (object URLs are revoked, no validation re-runs — assumes the caller already validated). - Setting to `null` clears the list. Recommended when `maxFiles === 1` (e.g. logo / avatar uploads). Use `bind:files` instead when you need progress, errors, or status metadata. |
52
+ | fileItem | `Snippet<[FileItemContext]>` | no | | Custom file item renderer. Receives file entry and remove callback. |
53
+ | files | `FileUploadFile[]` | no | | Current file list. Supports two-way binding. |
54
+ | maxFiles | `number` | no | | Maximum number of files. |
55
+ | maxFileSize | `number` | no | | Maximum file size in bytes. |
56
+ | minFileSize | `number` | no | | Minimum file size in bytes. |
57
+ | mint | `MintProp` | no | | Micro-interaction preset for the dropzone. |
58
+ | multiple | `boolean` | no | | Allow selecting multiple files. |
59
+ | name | `string` | no | | Shared `name` for native form submission. When set, the underlying hidden `<input type="file">` carries the current file list — including files added via drag/drop, paste, or programmatic `bind:files`, not just files picked through the file dialog. Submits as a `File[]` under `{name}` in the FormData payload. |
60
+ | onFileAccept | `(files: FileUploadFile[]) => void` | no | | Fires when valid files are accepted. |
61
+ | onFileReject | `(rejections: FileRejection[]) => void` | no | | Fires when files are rejected by validation. |
62
+ | onFileRemove | `(file: FileUploadFile) => void` | no | | Fires when a file is removed. |
63
+ | onFilesChange | `(files: FileUploadFile[]) => void` | no | | Fires when the file list changes (add or remove). |
64
+ | preset | `string` | no | | Apply a named preset registered via `<BlocksProvider presets={{ FileUpload: {...} }}>`. Prefer this over `class` overrides when the requested look falls outside the semantic intent palette — presets keep hover/active/dark-mode logic coherent and make the custom look reusable across the project. |
65
+ | preventDocumentDrop | `boolean` | no | true | Prevent browser navigation when files are dropped outside the zone. |
66
+ | required | `boolean` | no | | Mark as required for form validation. |
67
+ | slotClasses | `Partial<Record<FileUploadSlotName, string>>` | no | | Per-slot class overrides. |
68
+ | title | `string` | no | | Dropzone title text. |
69
+ | unstyled | `boolean` | no | | Strip all default styles. |
70
+ | validate | `(file: File) => FileUploadError[] | null` | no | | Custom validation function. Return errors array or null. |
71
+ | intent | `'neutral' | 'primary'` | no | neutral | Controls the color theme and semantic meaning of the FileUpload. Affects the overall appearance and user perception. Available options: neutral, primary. |
72
+ | size | `'lg' | 'md' | 'sm'` | no | md | Controls the dimensions, padding, and text size of the FileUpload. Affects the component's physical footprint. Available options: lg, md, sm. |
73
+
74
+ Inherited from:
75
+ - Omit<FileUploadVariants, 'dragging' | 'invalid'> (omit-pattern)
76
+ - Omit<HTMLAttributes<HTMLDivElement>, 'children'> (omit-pattern)