@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.
- package/README.md +54 -0
- package/content/auth/components/account-settings/llm.txt +33 -0
- package/content/auth/components/forgot-password-page/llm.txt +25 -0
- package/content/auth/components/invitation-manager/llm.txt +28 -0
- package/content/auth/components/login-page/llm.txt +34 -0
- package/content/auth/components/notification-badge/llm.txt +21 -0
- package/content/auth/components/notification-center/llm.txt +33 -0
- package/content/auth/components/notification-listener/llm.txt +24 -0
- package/content/auth/components/passkey-manager/llm.txt +27 -0
- package/content/auth/components/push-permission-prompt/llm.txt +32 -0
- package/content/auth/components/register-page/llm.txt +35 -0
- package/content/auth/components/reset-password-page/llm.txt +26 -0
- package/content/auth/components/session-manager/llm.txt +32 -0
- package/content/auth/components/two-factor-manager/llm.txt +40 -0
- package/content/auth/components/verify-email-page/llm.txt +25 -0
- package/content/blocks/components/area-chart/llm.txt +46 -0
- package/content/blocks/components/bar-chart/llm.txt +44 -0
- package/content/blocks/components/calendar/llm.txt +105 -0
- package/content/blocks/components/chart-frame/llm.txt +38 -0
- package/content/blocks/components/command-palette/llm.txt +60 -0
- package/content/blocks/components/composition-bar/llm.txt +69 -0
- package/content/blocks/components/currency-input/llm.txt +65 -0
- package/content/blocks/components/date-picker/llm.txt +90 -0
- package/content/blocks/components/donut-chart/llm.txt +45 -0
- package/content/blocks/components/empty-state/llm.txt +43 -0
- package/content/blocks/components/file-upload/llm.txt +76 -0
- package/content/blocks/components/guide/llm.txt +49 -0
- package/content/blocks/components/guide-article/llm.txt +30 -0
- package/content/blocks/components/guide-beacon/llm.txt +38 -0
- package/content/blocks/components/guide-hint/llm.txt +41 -0
- package/content/blocks/components/guide-marker/llm.txt +36 -0
- package/content/blocks/components/guide-mention/llm.txt +31 -0
- package/content/blocks/components/guide-panel/llm.txt +42 -0
- package/content/blocks/components/guide-provider/llm.txt +31 -0
- package/content/blocks/components/line-chart/llm.txt +45 -0
- package/content/blocks/components/locale-switcher/llm.txt +44 -0
- package/content/blocks/components/planner/llm.txt +68 -0
- package/content/blocks/components/sankey/llm.txt +72 -0
- package/content/blocks/components/sidebar-layout/llm.txt +87 -0
- package/content/blocks/components/sparkline/llm.txt +33 -0
- package/content/blocks/components/theme-switcher/llm.txt +40 -0
- package/content/blocks/primitives/accordion/llm.txt +57 -0
- package/content/blocks/primitives/alert/llm.txt +54 -0
- package/content/blocks/primitives/avatar/llm.txt +61 -0
- package/content/blocks/primitives/badge/llm.txt +60 -0
- package/content/blocks/primitives/breadcrumb/llm.txt +47 -0
- package/content/blocks/primitives/button/llm.txt +80 -0
- package/content/blocks/primitives/button-group/llm.txt +65 -0
- package/content/blocks/primitives/card/llm.txt +68 -0
- package/content/blocks/primitives/checkbox/llm.txt +61 -0
- package/content/blocks/primitives/collapsible/llm.txt +66 -0
- package/content/blocks/primitives/combobox/llm.txt +86 -0
- package/content/blocks/primitives/confirm-dialog/llm.txt +47 -0
- package/content/blocks/primitives/dialog/llm.txt +59 -0
- package/content/blocks/primitives/drawer/llm.txt +54 -0
- package/content/blocks/primitives/form-field/llm.txt +43 -0
- package/content/blocks/primitives/input/llm.txt +73 -0
- package/content/blocks/primitives/menu/llm.txt +81 -0
- package/content/blocks/primitives/pagination/llm.txt +68 -0
- package/content/blocks/primitives/popover/llm.txt +72 -0
- package/content/blocks/primitives/progress/llm.txt +55 -0
- package/content/blocks/primitives/radio-group/llm.txt +53 -0
- package/content/blocks/primitives/segment-group/llm.txt +51 -0
- package/content/blocks/primitives/select/llm.txt +130 -0
- package/content/blocks/primitives/separator/llm.txt +45 -0
- package/content/blocks/primitives/sidebar/llm.txt +79 -0
- package/content/blocks/primitives/skeleton/llm.txt +54 -0
- package/content/blocks/primitives/slider/llm.txt +82 -0
- package/content/blocks/primitives/spinner/llm.txt +46 -0
- package/content/blocks/primitives/stepper/llm.txt +60 -0
- package/content/blocks/primitives/tab/llm.txt +72 -0
- package/content/blocks/primitives/textarea/llm.txt +61 -0
- package/content/blocks/primitives/toast/llm.txt +45 -0
- package/content/blocks/primitives/toggle/llm.txt +62 -0
- package/content/blocks/primitives/toolbar/llm.txt +60 -0
- package/content/blocks/primitives/tooltip/llm.txt +54 -0
- package/content/component-catalog.json +5010 -0
- package/content/design-system/patterns/dashboard.md +55 -0
- package/content/design-system/patterns/form-page.md +69 -0
- package/content/design-system/patterns/onboarding-guide.md +50 -0
- package/content/design-system/patterns/planning-board.md +46 -0
- package/content/design-system/patterns/settings-page.md +48 -0
- package/content/design-system/patterns/tab-navigation.md +136 -0
- package/content/design-system/principles.md +260 -0
- package/content/docs/components/api-reference/llm.txt +32 -0
- package/content/docs/components/code-example/llm.txt +44 -0
- package/content/docs/components/code-panel/llm.txt +26 -0
- package/content/docs/components/docs-layout/llm.txt +61 -0
- package/content/docs/components/info-card/llm.txt +31 -0
- package/content/docs/components/playground-configurator/llm.txt +49 -0
- package/content/docs/components/section/llm.txt +46 -0
- package/content/docs/components/table-of-contents/llm.txt +48 -0
- package/content/docs/components/types-reference/llm.txt +38 -0
- package/content/guides/llms-full-template.md +1019 -0
- package/content/icons.json +4834 -0
- package/content/meta.json +5 -0
- package/content/table/table/llm.txt +110 -0
- package/content/verbs/adopt.md +33 -0
- package/content/verbs/audit.md +29 -0
- package/content/verbs/compose.md +38 -0
- package/content/verbs/critique.md +27 -0
- package/content/verbs/fix.md +29 -0
- package/content/verbs/migrate.md +30 -0
- package/content/verbs/onboard.md +33 -0
- package/content/verbs/polish.md +25 -0
- package/content/verbs/redesign.md +29 -0
- package/content/verbs/retheme.md +29 -0
- package/package.json +45 -0
- package/src/content-loader.test.ts +78 -0
- package/src/content-loader.ts +97 -0
- package/src/index.ts +23 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
## Collapsible
|
|
5
|
+
A single expand/collapse panel with animated content, trigger button,
|
|
6
|
+
and full ARIA support. Can be used standalone or as the foundation for compound
|
|
7
|
+
components like Accordion.
|
|
8
|
+
|
|
9
|
+
**Import:** `import { Collapsible } from '@urbicon-ui/blocks';`
|
|
10
|
+
|
|
11
|
+
### Examples
|
|
12
|
+
```svelte
|
|
13
|
+
<Collapsible title="Show details">
|
|
14
|
+
<p>Hidden content revealed when expanded.</p>
|
|
15
|
+
</Collapsible>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```svelte
|
|
19
|
+
<Collapsible bind:open={isOpen} variant="card">
|
|
20
|
+
{#snippet trigger({ open, toggle })}
|
|
21
|
+
<button onclick={toggle}>
|
|
22
|
+
{open ? 'Hide' : 'Show'} settings
|
|
23
|
+
</button>
|
|
24
|
+
{/snippet}
|
|
25
|
+
<SettingsForm />
|
|
26
|
+
</Collapsible>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Variants
|
|
30
|
+
- variant: card, default, ghost (default: default)
|
|
31
|
+
- size: lg, md, sm (default: md)
|
|
32
|
+
|
|
33
|
+
### Api
|
|
34
|
+
| Prop | Type | Required | Default | Description |
|
|
35
|
+
| --- | --- | :---: | --- | --- |
|
|
36
|
+
| children | `Snippet` | yes | | Content to render inside the Collapsible component |
|
|
37
|
+
| ...CollapsibleVariants | `VariantProps` | no | | Styling variants from CollapsibleVariants |
|
|
38
|
+
| ...HTMLAttributes<HTMLDivElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') |
|
|
39
|
+
| class | `string` | no | | Additional CSS classes to apply to the Collapsible component |
|
|
40
|
+
| defaultOpen | `boolean` | no | false | Initial open state for uncontrolled usage |
|
|
41
|
+
| disabled | `boolean` | no | false | Whether the Collapsible is disabled and non-interactive |
|
|
42
|
+
| name | `string` | no | | Base name for generating ARIA IDs. Defaults to auto-generated. |
|
|
43
|
+
| onOpenChange | `(open: boolean) => void` | no | | Callback fired when open state changes |
|
|
44
|
+
| open | `boolean` | no | | Whether the content is visible. Supports bind:open. |
|
|
45
|
+
| preset | `string` | no | | Apply a named preset registered via `<BlocksProvider presets={{ Collapsible: {...} }}>`. 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. |
|
|
46
|
+
| slotClasses | `Partial<Record<'base' | 'trigger' | 'chevron' | 'content' | 'contentInner', string>>` | no | | Per-slot class overrides |
|
|
47
|
+
| title | `string` | no | | Trigger label text (used by the default trigger) |
|
|
48
|
+
| trigger | `Snippet<[
|
|
49
|
+
{
|
|
50
|
+
open: boolean;
|
|
51
|
+
toggle: () => void;
|
|
52
|
+
disabled: boolean;
|
|
53
|
+
triggerId: string;
|
|
54
|
+
contentId: string;
|
|
55
|
+
}
|
|
56
|
+
]>` | no | | Custom trigger snippet — receives open state, toggle fn, disabled flag, and ARIA IDs |
|
|
57
|
+
| unstyled | `boolean` | no | | Remove default styles |
|
|
58
|
+
| variant | `'card' | 'default' | 'ghost'` | no | default | Controls the visual style and presentation of the Collapsible. Determines the component's visual treatment. Available options: card, default, ghost. |
|
|
59
|
+
| size | `'lg' | 'md' | 'sm'` | no | md | Controls the dimensions, padding, and text size of the Collapsible. Affects the component's physical footprint. Available options: lg, md, sm. |
|
|
60
|
+
|
|
61
|
+
Inherited from:
|
|
62
|
+
- CollapsibleVariants (external)
|
|
63
|
+
- Omit<HTMLAttributes<HTMLDivElement>, 'children'> (omit-pattern)
|
|
64
|
+
|
|
65
|
+
### Slots (slotClasses keys)
|
|
66
|
+
`base`, `trigger`, `chevron`, `content`, `contentInner`
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
## Combobox
|
|
5
|
+
Searchable menu (autocomplete) combining a text input with a
|
|
6
|
+
filterable option list. Implements the ARIA combobox pattern with
|
|
7
|
+
keyboard navigation, custom filtering, and two-way bindable state.
|
|
8
|
+
|
|
9
|
+
**Import:** `import { Combobox } from '@urbicon-ui/blocks';`
|
|
10
|
+
|
|
11
|
+
### Examples
|
|
12
|
+
```svelte
|
|
13
|
+
<Combobox
|
|
14
|
+
options={[
|
|
15
|
+
{ label: 'Apple', value: 'apple' },
|
|
16
|
+
{ label: 'Banana', value: 'banana' },
|
|
17
|
+
{ label: 'Cherry', value: 'cherry' }
|
|
18
|
+
]}
|
|
19
|
+
bind:value={selected}
|
|
20
|
+
placeholder="Search fruit…"
|
|
21
|
+
/>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```svelte
|
|
25
|
+
<Combobox
|
|
26
|
+
options={tenants.map((t) => ({ label: t.name, value: t.id }))}
|
|
27
|
+
bind:value={tenantId}
|
|
28
|
+
/>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```svelte
|
|
32
|
+
<Combobox
|
|
33
|
+
options={countries}
|
|
34
|
+
bind:value={country}
|
|
35
|
+
filter={(option, query) => option.label.toLowerCase().startsWith(query.toLowerCase())}
|
|
36
|
+
clearable
|
|
37
|
+
size="lg"
|
|
38
|
+
/>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Variants
|
|
42
|
+
- size: lg, md, sm (default: md)
|
|
43
|
+
- disabled: true (default: false)
|
|
44
|
+
- open: true (default: false)
|
|
45
|
+
- tier: commit, modify (default: modify)
|
|
46
|
+
|
|
47
|
+
### Api
|
|
48
|
+
| Prop | Type | Required | Default | Description |
|
|
49
|
+
| --- | --- | :---: | --- | --- |
|
|
50
|
+
| options | `ComboboxOption<T>[]` | yes | | Array of selectable options. Each needs a unique `value`. |
|
|
51
|
+
| ...ComboboxVariants | `VariantProps` | no | | Styling variants from ComboboxVariants |
|
|
52
|
+
| ...HTMLAttributes<HTMLDivElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') |
|
|
53
|
+
| class | `string` | no | | Extra classes merged onto the root wrapper element. |
|
|
54
|
+
| clearable | `boolean` | no | false | Show a clear button when a value is selected. Click or press Escape to reset. |
|
|
55
|
+
| closeOnClickOutside | `boolean` | no | | Whether the listbox closes on outside click. Default `true`. Set to `false` to pin the listbox open while the consumer manages dismissal explicitly. |
|
|
56
|
+
| closeOnEscape | `boolean` | no | | Whether the listbox closes on Escape key. Default `true`. Set to `false` for inline contexts where Escape should be intercepted by an outer widget (e.g. a row editor that wants to revert on Escape). |
|
|
57
|
+
| customOption | `Snippet<[ComboboxOption<T>, boolean]>` | no | | Custom option renderer. Receives the option and whether it is selected. |
|
|
58
|
+
| disabled | `boolean` | no | false | Disable the entire combobox. |
|
|
59
|
+
| error | `string` | no | | Error message — replaces helper text and flags the field as invalid. |
|
|
60
|
+
| filter | `(option: ComboboxOption<T>, query: string) => boolean` | no | | Custom filter replacing the built-in case-insensitive label match. Return `true` to include an option. |
|
|
61
|
+
| helper | `string` | no | | Helper text shown below the field. Hidden when an error is set. |
|
|
62
|
+
| id | `string` | no | | Deterministic HTML `id` for the component. Auto-generated when omitted. |
|
|
63
|
+
| label | `string` | no | | Field label rendered above the input. |
|
|
64
|
+
| mint | `MintProp` | no | 'none' | Micro-interaction preset. Form controls default to 'none' for a clean feel. |
|
|
65
|
+
| name | `string` | no | | Shared `name` for a hidden input for native form submission. |
|
|
66
|
+
| noResultsText | `string` | no | 'No results found' | Text displayed when the filter produces no matches. |
|
|
67
|
+
| onClickOutside | `() => void` | no | | Fires after an outside click closes the listbox. Use for analytics or side-effects on dismiss. Does NOT control whether the listbox closes — that is governed by `closeOnClickOutside`. |
|
|
68
|
+
| onEscape | `() => void` | no | | Fires after Escape closes the listbox. Use for analytics or to clear ephemeral state on dismiss. Does NOT control whether the listbox closes — that is governed by `closeOnEscape`. |
|
|
69
|
+
| onValueChange | `(value: T | null) => void` | no | | Fires after the selected value changes. Receives the new value or `null` on clear. |
|
|
70
|
+
| open | `boolean` | no | false | Controls the open state of the listbox. Supports `bind:open`. |
|
|
71
|
+
| placeholder | `string` | no | 'Search…' | Placeholder shown when the input is empty. |
|
|
72
|
+
| preset | `string` | no | | Apply a named preset registered via `<BlocksProvider presets={{ Combobox: {...} }}>`. 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. |
|
|
73
|
+
| query | `string` | no | | Current search query text. Supports `bind:query` for external control (e.g. server-side filtering). |
|
|
74
|
+
| required | `boolean` | no | false | Marks the field as required. Adds the asterisk on the label. |
|
|
75
|
+
| slotClasses | `Partial<Record<'base' | 'label' | 'requiredMark' | 'inputWrapper' | 'input' | 'message' | 'hint' | 'listbox' | 'option' | 'optionActive' | 'optionSelected' | 'noResults' | 'clear' | 'chevron', string>>` | no | | Per-slot class overrides merged with tv() styles. |
|
|
76
|
+
| unstyled | `boolean` | no | false | Remove all default tv() classes — only user-provided classes apply. |
|
|
77
|
+
| value | `T | null` | no | | Currently selected value. Supports `bind:value` for two-way binding. |
|
|
78
|
+
| size | `'lg' | 'md' | 'sm'` | no | md | Controls the dimensions, padding, and text size of the Combobox. Affects the component's physical footprint. Available options: lg, md, sm. |
|
|
79
|
+
| tier | `'commit' | 'modify'` | no | modify | Controls the tier behavior and appearance of the Combobox component. Available options: commit, modify. |
|
|
80
|
+
|
|
81
|
+
Inherited from:
|
|
82
|
+
- ComboboxVariants (external)
|
|
83
|
+
- Omit<HTMLAttributes<HTMLDivElement>, 'children'> (omit-pattern)
|
|
84
|
+
|
|
85
|
+
### Slots (slotClasses keys)
|
|
86
|
+
`base`, `label`, `requiredMark`, `inputWrapper`, `input`, `message`, `hint`, `listbox`, `option`, `optionActive`, `optionSelected`, `noResults`, `clear`, `chevron`
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
## ConfirmDialog
|
|
5
|
+
Pre-configured Dialog for confirming a single, often
|
|
6
|
+
destructive action. Replaces the native `window.confirm()` with a
|
|
7
|
+
styleable, focus-trapped, keyboard-accessible modal that matches the
|
|
8
|
+
design system's intent palette.
|
|
9
|
+
|
|
10
|
+
`onConfirm` may be `async`; while the returned promise is pending the
|
|
11
|
+
dialog locks itself (no backdrop dismiss, no escape, confirm button
|
|
12
|
+
shows a spinner). Auto-closes on resolve.
|
|
13
|
+
|
|
14
|
+
**Import:** `import { ConfirmDialog } from '@urbicon-ui/blocks';`
|
|
15
|
+
|
|
16
|
+
### Examples
|
|
17
|
+
```svelte
|
|
18
|
+
<script>
|
|
19
|
+
let confirmOpen = $state(false);
|
|
20
|
+
</script>
|
|
21
|
+
<Button intent="danger" onclick={() => (confirmOpen = true)}>Delete</Button>
|
|
22
|
+
<ConfirmDialog
|
|
23
|
+
bind:open={confirmOpen}
|
|
24
|
+
title="Delete project?"
|
|
25
|
+
description="This cannot be undone."
|
|
26
|
+
intent="danger"
|
|
27
|
+
confirmLabel="Delete"
|
|
28
|
+
onConfirm={async () => { await deleteProject(id); }}
|
|
29
|
+
/>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Api
|
|
33
|
+
| Prop | Type | Required | Default | Description |
|
|
34
|
+
| --- | --- | :---: | --- | --- |
|
|
35
|
+
| title | `string` | yes | | Heading shown in the dialog header. |
|
|
36
|
+
| cancelLabel | `string` | no | | Label of the cancel button. Defaults to the localized `button.cancel`. |
|
|
37
|
+
| children | `Snippet` | no | | Optional richer markup rendered below `description`. |
|
|
38
|
+
| closeOnBackdropClick | `boolean` | no | true | Whether the backdrop click cancels. |
|
|
39
|
+
| closeOnEscape | `boolean` | no | true | Whether Escape cancels. |
|
|
40
|
+
| confirmIntent | `ConfirmIntent` | no | | Override for the confirm button intent. Defaults to , with `neutral` upgraded to `primary` for visual affordance. |
|
|
41
|
+
| confirmLabel | `string` | no | | Label of the confirm button. Defaults to the localized `button.confirm`. |
|
|
42
|
+
| description | `string` | no | | Description rendered above the footer. Use `children` for richer markup. |
|
|
43
|
+
| intent | `DialogIntent` | no | 'danger' | Accent on the dialog header strip. Drives the default `confirmIntent`. |
|
|
44
|
+
| loading | `boolean` | no | false | Externally controlled loading flag. Combined with the internal `busy` flag from an async `onConfirm`. While truthy, both buttons are disabled and dismissal is blocked. |
|
|
45
|
+
| onCancel | `() => void` | no | | Fired when the user cancels (button, backdrop, or Escape). |
|
|
46
|
+
| onConfirm | `() => void | Promise<void>` | no | | Confirm handler. May return a promise — the dialog stays open and shows a loading state while it resolves, then auto-closes on success. |
|
|
47
|
+
| open | `boolean` | no | | Controls visibility. Supports bind:open. |
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
## Dialog
|
|
5
|
+
Overlay dialog built on native dialog element. Can be used as a simple
|
|
6
|
+
content-agnostic overlay or as a structured dialog with title, footer, and intent accent.
|
|
7
|
+
|
|
8
|
+
**Import:** `import { Dialog } from '@urbicon-ui/blocks';`
|
|
9
|
+
|
|
10
|
+
### Examples
|
|
11
|
+
```svelte
|
|
12
|
+
<Dialog bind:open>
|
|
13
|
+
<p>Are you sure?</p>
|
|
14
|
+
<Button onclick={() => (open = false)}>Close</Button>
|
|
15
|
+
</Dialog>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```svelte
|
|
19
|
+
<Dialog bind:open title="Confirm deletion" intent="danger">
|
|
20
|
+
<p>This action cannot be undone.</p>
|
|
21
|
+
{#snippet footer()}
|
|
22
|
+
<Button variant="ghost" onclick={() => (open = false)}>Cancel</Button>
|
|
23
|
+
<Button intent="danger" onclick={handleDelete}>Delete</Button>
|
|
24
|
+
{/snippet}
|
|
25
|
+
</Dialog>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Variants
|
|
29
|
+
- intent: danger, neutral, primary, secondary, success, warning (default: neutral)
|
|
30
|
+
- size: full, fullscreen, lg, md, sm, xl (default: sm)
|
|
31
|
+
- placement: center, top (default: center)
|
|
32
|
+
|
|
33
|
+
### Api
|
|
34
|
+
| Prop | Type | Required | Default | Description |
|
|
35
|
+
| --- | --- | :---: | --- | --- |
|
|
36
|
+
| children | `Snippet` | yes | | Dialog body content. When `title` is omitted the content fills the entire panel. |
|
|
37
|
+
| ...HTMLDialogAttributes | `HTMLAttributes` | no | | HTML attributes (excluding: 'children' | 'open') |
|
|
38
|
+
| class | `string` | no | | Additional CSS classes applied to the dialog panel. |
|
|
39
|
+
| closeOnBackdropClick | `boolean` | no | true | Whether clicking the backdrop dismisses the dialog. |
|
|
40
|
+
| closeOnEscape | `boolean` | no | true | Whether pressing Escape dismisses the dialog. |
|
|
41
|
+
| footer | `Snippet` | no | | Action buttons rendered in a footer bar. Only rendered when provided. |
|
|
42
|
+
| hideCloseButton | `boolean` | no | false | Hides the built-in close button. Only takes effect when `title` is also set — the close button only renders in the structured (titled) header. Without a title, no close button exists to hide. |
|
|
43
|
+
| intent | `DialogVariants['intent']` | no | 'neutral' | Semantic purpose marker (e.g. `danger` for destructive actions). After the Lighter-Refactor, the Dialog itself no longer paints an accent bar — the value is exposed on the panel as `data-intent="…"` so consumers can hook presets, CSS overrides, or icon/title color via their own snippets. |
|
|
44
|
+
| onClose | `() => void` | no | | Fires when the dialog is dismissed via Escape, backdrop click, or close button. |
|
|
45
|
+
| open | `boolean` | no | | Controls whether the dialog is visible. Supports bind:open. |
|
|
46
|
+
| placement | `DialogVariants['placement']` | no | 'center' | Vertical placement within the viewport. Use 'top' for command-palette style positioning. |
|
|
47
|
+
| preset | `string` | no | | Apply a named preset registered via `<BlocksProvider presets={{ Dialog: {...} }}>`. 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. |
|
|
48
|
+
| size | `DialogVariants['size']` | no | 'sm' | Controls the maximum width of the dialog panel. |
|
|
49
|
+
| slotClasses | `Partial<Record<'dialog' | 'backdrop' | 'panel' | 'content' | 'header' | 'title' | 'body' | 'footer', string>>` | no | | Per-slot class overrides merged with variant styles. |
|
|
50
|
+
| title | `string` | no | | Heading displayed in a header bar. Enables the structured header/body/footer layout. |
|
|
51
|
+
| transitionDuration | `number` | no | | Override the enter/exit animation duration in milliseconds. Defaults to the overlay token `--blocks-overlay-enter-duration` / `--blocks-overlay-exit-duration` (200ms / 180ms). Set globally via the CSS custom properties or per-instance via this prop. Respects `prefers-reduced-motion`. |
|
|
52
|
+
| transitionEasing | `(t: number) => number` | no | | Override the enter/exit easing function. Defaults to the overlay token easing (`quintOut`). |
|
|
53
|
+
| unstyled | `boolean` | no | | Strip all default styles. Combine with slotClasses for fully custom appearance. |
|
|
54
|
+
|
|
55
|
+
Inherited from:
|
|
56
|
+
- Omit<HTMLDialogAttributes, 'children' | 'open'> (omit-pattern)
|
|
57
|
+
|
|
58
|
+
### Slots (slotClasses keys)
|
|
59
|
+
`dialog`, `backdrop`, `panel`, `content`, `header`, `title`, `body`, `footer`
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
## Drawer
|
|
5
|
+
Slide-in panel overlay from any edge of the viewport.
|
|
6
|
+
Uses native dialog with focus trap, backdrop click dismiss, and Escape key support.
|
|
7
|
+
|
|
8
|
+
**Import:** `import { Drawer } from '@urbicon-ui/blocks';`
|
|
9
|
+
|
|
10
|
+
### Examples
|
|
11
|
+
```svelte
|
|
12
|
+
<Drawer bind:open title="Settings" placement="right">
|
|
13
|
+
<p>Drawer content here</p>
|
|
14
|
+
</Drawer>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<Drawer bind:open title="Menu" placement="left" size="sm">
|
|
19
|
+
<nav>...</nav>
|
|
20
|
+
</Drawer>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Variants
|
|
24
|
+
- intent: danger, neutral, primary, secondary, success, warning (default: neutral)
|
|
25
|
+
- size: full, lg, md, sm, xl (default: md)
|
|
26
|
+
- placement: bottom, left, right, top (default: right)
|
|
27
|
+
|
|
28
|
+
### Api
|
|
29
|
+
| Prop | Type | Required | Default | Description |
|
|
30
|
+
| --- | --- | :---: | --- | --- |
|
|
31
|
+
| children | `Snippet` | yes | | Content rendered inside the drawer body. |
|
|
32
|
+
| ...HTMLDialogAttributes | `HTMLAttributes` | no | | HTML attributes (excluding: 'children' | 'open') |
|
|
33
|
+
| class | `string` | no | | Additional CSS classes applied to the drawer panel. |
|
|
34
|
+
| closeOnBackdropClick | `boolean` | no | true | Whether clicking the backdrop closes the drawer. |
|
|
35
|
+
| closeOnEscape | `boolean` | no | true | Whether pressing Escape closes the drawer. |
|
|
36
|
+
| footer | `Snippet` | no | | Action buttons rendered in the drawer footer. |
|
|
37
|
+
| hideCloseButton | `boolean` | no | false | Hides the built-in close button in the header. |
|
|
38
|
+
| intent | `DrawerVariants['intent']` | no | 'neutral' | Semantic purpose marker (mirrors Dialog). After the Lighter-Refactor, the Drawer itself no longer paints an accent border — the value is exposed on the panel as `data-intent="…"` so consumers can hook presets, CSS overrides, or icon/title color via their own snippets. |
|
|
39
|
+
| onClose | `() => void` | no | | Fires when the drawer is dismissed via Escape, backdrop click, or close button. |
|
|
40
|
+
| open | `boolean` | no | | Controls whether the drawer is visible. Supports `bind:open`. |
|
|
41
|
+
| placement | `DrawerVariants['placement']` | no | 'right' | Edge of the viewport from which the drawer slides in. |
|
|
42
|
+
| preset | `string` | no | | Apply a named preset registered via `<BlocksProvider presets={{ Drawer: {...} }}>`. 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. |
|
|
43
|
+
| size | `DrawerVariants['size']` | no | 'md' | Width (for left/right) or height (for top/bottom) of the drawer panel. |
|
|
44
|
+
| slotClasses | `Partial<Record<'dialog' | 'backdrop' | 'panel' | 'header' | 'title' | 'body' | 'footer', string>>` | no | | Per-slot class overrides merged with variant styles. |
|
|
45
|
+
| title | `string` | no | | Heading displayed in the drawer header. |
|
|
46
|
+
| transitionDuration | `number` | no | | Override the enter/exit animation duration in milliseconds. Defaults to the overlay token `--blocks-overlay-enter-duration` / `--blocks-overlay-exit-duration` (200ms / 180ms). Respects `prefers-reduced-motion`. |
|
|
47
|
+
| transitionEasing | `(t: number) => number` | no | | Override the enter/exit easing function. Defaults to the overlay token easing (`quintOut`). |
|
|
48
|
+
| unstyled | `boolean` | no | | Strip all default styles. Combine with slotClasses for fully custom appearance. |
|
|
49
|
+
|
|
50
|
+
Inherited from:
|
|
51
|
+
- Omit<HTMLDialogAttributes, 'children' | 'open'> (omit-pattern)
|
|
52
|
+
|
|
53
|
+
### Slots (slotClasses keys)
|
|
54
|
+
`dialog`, `backdrop`, `panel`, `header`, `title`, `body`, `footer`
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
## FormField
|
|
5
|
+
Layout wrapper for composite form fields that need a label,
|
|
6
|
+
helper text, and error message but cannot rely on the built-in slots of
|
|
7
|
+
primitives like or . Examples:
|
|
8
|
+
a custom file picker, a slider/number-input pair, a media uploader.
|
|
9
|
+
|
|
10
|
+
The `id` is auto-generated and forwarded to the slot via the `for`
|
|
11
|
+
snippet parameter so the rendered control can wire `aria-describedby`
|
|
12
|
+
and `aria-invalid` correctly.
|
|
13
|
+
|
|
14
|
+
**Import:** `import { FormField } from '@urbicon-ui/blocks';`
|
|
15
|
+
|
|
16
|
+
### Examples
|
|
17
|
+
```svelte
|
|
18
|
+
<FormField label="Document" required error={fileError} hint="PDF, JPG, PNG — max 10 MB">
|
|
19
|
+
{#snippet children({ id, describedBy, invalid })}
|
|
20
|
+
<FileUpload {id} aria-describedby={describedBy} aria-invalid={invalid} bind:files />
|
|
21
|
+
{/snippet}
|
|
22
|
+
</FormField>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Api
|
|
26
|
+
| Prop | Type | Required | Default | Description |
|
|
27
|
+
| --- | --- | :---: | --- | --- |
|
|
28
|
+
| children | `Snippet<[FormFieldSlotContext]>` | yes | | Snippet receiving wiring metadata (`id`, `describedBy`, `invalid`, `required`, `disabled`). The wrapped control should spread or apply these to itself for accessibility. |
|
|
29
|
+
| ...HTMLAttributes<HTMLDivElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') |
|
|
30
|
+
| class | `string` | no | | Extra classes merged onto the wrapper element. |
|
|
31
|
+
| disabled | `boolean` | no | false | Disables visual emphasis. Pass through to the slot's control as needed. |
|
|
32
|
+
| error | `string` | no | | Error message shown below the control. Replaces the helper text and propagates `invalid: true` to the slot for ARIA wiring. |
|
|
33
|
+
| hint | `string` | no | | Helper text shown below the control. Hidden when `error` is present. |
|
|
34
|
+
| id | `string` | no | | Explicit HTML `id` for the control. Auto-generated when omitted, then forwarded to the slot. Caller may use it to attach external `<label for>`. |
|
|
35
|
+
| label | `string` | no | | Label rendered above the control. Auto-linked to the slot via the generated `id`. |
|
|
36
|
+
| required | `boolean` | no | false | Adds a required asterisk to the label and propagates `required: true` to the slot. Does **not** apply the native `required` attribute — the slot's control is responsible for that. |
|
|
37
|
+
| slotClasses | `Partial<Record<'wrapper' | 'label' | 'message' | 'hint', string>>` | no | | Per-slot class overrides. |
|
|
38
|
+
|
|
39
|
+
Inherited from:
|
|
40
|
+
- Omit<HTMLAttributes<HTMLDivElement>, 'children'> (omit-pattern)
|
|
41
|
+
|
|
42
|
+
### Slots (slotClasses keys)
|
|
43
|
+
`wrapper`, `label`, `message`, `hint`
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
## Input
|
|
5
|
+
Text input with labels, validation states, icons, and clearable functionality.
|
|
6
|
+
Supports outlined, filled, and ghost visual variants with automatic ARIA linking.
|
|
7
|
+
|
|
8
|
+
**Import:** `import { Input } from '@urbicon-ui/blocks';`
|
|
9
|
+
|
|
10
|
+
### Examples
|
|
11
|
+
```svelte
|
|
12
|
+
<Input label="Email" placeholder="name@example.com" required />
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Variants
|
|
16
|
+
- intent: danger, default, success, warning (default: default)
|
|
17
|
+
- variant: filled, ghost, outlined, underline (default: outlined)
|
|
18
|
+
- size: lg, md, sm, xl, xs (default: md)
|
|
19
|
+
- disabled: true (default: false)
|
|
20
|
+
- hasLeftIcon: true (default: false)
|
|
21
|
+
- hasRightIcon: true (default: false)
|
|
22
|
+
- iconPosition: left, right (default: left)
|
|
23
|
+
- messageType: error, helper (default: helper)
|
|
24
|
+
- readonly: true (default: false)
|
|
25
|
+
- required: true (default: false)
|
|
26
|
+
- tier: commit, modify (default: modify)
|
|
27
|
+
|
|
28
|
+
### Api
|
|
29
|
+
| Prop | Type | Required | Default | Description |
|
|
30
|
+
| --- | --- | :---: | --- | --- |
|
|
31
|
+
| ...HTMLInputAttributes | `HTMLAttributes` | no | | HTML attributes (excluding: 'size' | 'class' | 'disabled' | 'readonly' | 'children') |
|
|
32
|
+
| ...InputVariants | `VariantProps` | no | | Styling variants from InputVariants |
|
|
33
|
+
| autoComplete | `string` | no | | HTML autocomplete hint for browser autofill. |
|
|
34
|
+
| children | `Snippet` | no | | Snippet content rendered below the input for advanced layouts. |
|
|
35
|
+
| class | `string` | no | | Extra classes merged onto the root wrapper element. |
|
|
36
|
+
| clearable | `boolean` | no | false | Show a clear button when the input has a value. Press Escape or click the button to clear. Fires `onClear` after clearing. |
|
|
37
|
+
| disabled | `boolean` | no | false | Whether the Input is disabled and non-interactive |
|
|
38
|
+
| error | `string` | no | | Error message below the input. When set, overrides `helper` and forces danger border styling regardless of `intent`. |
|
|
39
|
+
| helper | `string` | no | | Helper text below the input — hidden when `error` is present. |
|
|
40
|
+
| label | `string` | no | | Label text displayed above the input, auto-linked via `for`/`id`. |
|
|
41
|
+
| leftIcon | `Snippet` | no | | Icon snippet rendered on the left side of the input field. |
|
|
42
|
+
| leftIconAriaLabel | `string` | no | | Accessible label for the clickable left icon button. Required when `onLeftIconClick` is set so screen-reader users hear a name for the button (icons inside are `aria-hidden`). |
|
|
43
|
+
| mint | `MintProp` | no | 'none' | Micro-interaction preset applied to the input element. |
|
|
44
|
+
| onClear | `() => void` | no | | Fired after the value is cleared via the clear button or Escape key. |
|
|
45
|
+
| onLeftIconClick | `() => void` | no | | When provided, the left icon becomes a clickable button. |
|
|
46
|
+
| onRightIconClick | `() => void` | no | | When provided, the right icon becomes a clickable button. |
|
|
47
|
+
| persistDebounceMs | `number` | no | 300 | Debounce interval (ms) for storage writes. |
|
|
48
|
+
| persistKey | `string` | no | | Key for persisting the input value to storage. |
|
|
49
|
+
| persistNamespace | `string` | no | | Namespace (e.g. user id) to scope the persist key. |
|
|
50
|
+
| persistStorage | `'localStorage' | 'sessionStorage'` | no | 'localStorage' | Storage backend for persistence. |
|
|
51
|
+
| persistVersion | `number` | no | 1 | Version stamp included in the storage key. |
|
|
52
|
+
| preset | `string` | no | | Apply a named preset registered via `<BlocksProvider presets={{ Input: {...} }}>`. 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
|
+
| readonly | `boolean` | no | false | Readonly property for the Input component |
|
|
54
|
+
| required | `boolean` | no | false | Adds a required asterisk to the label and sets the native `required` attribute. |
|
|
55
|
+
| rightIcon | `Snippet` | no | | Icon snippet rendered on the right side of the input field. |
|
|
56
|
+
| rightIconAriaLabel | `string` | no | | Accessible label for the clickable right icon button. Required when `onRightIconClick` is set so screen-reader users hear a name for the button (icons inside are `aria-hidden`). |
|
|
57
|
+
| slotClasses | `Partial<Record<'wrapper' | 'container' | 'base' | 'label' | 'message' | 'iconContainer', string>>` | no | | Per-slot class overrides merged with tv() styles. |
|
|
58
|
+
| unstyled | `boolean` | no | | Remove all default tv() classes — only user-provided classes apply. |
|
|
59
|
+
| intent | `'danger' | 'default' | 'success' | 'warning'` | no | default | Controls the color theme and semantic meaning of the Input. Affects the overall appearance and user perception. Available options: danger, default, success, warning. |
|
|
60
|
+
| variant | `'filled' | 'ghost' | 'outlined' | 'underline'` | no | outlined | Controls the visual style and presentation of the Input. Determines the component's visual treatment. Available options: filled, ghost, outlined, underline. |
|
|
61
|
+
| size | `'lg' | 'md' | 'sm' | 'xl' | 'xs'` | no | md | Controls the dimensions, padding, and text size of the Input. Affects the component's physical footprint. Available options: lg, md, sm, and 2 more. |
|
|
62
|
+
| hasLeftIcon | `'true'` | no | false | Controls the hasLeftIcon behavior and appearance of the Input component. Available options: true. |
|
|
63
|
+
| hasRightIcon | `'true'` | no | false | Controls the hasRightIcon behavior and appearance of the Input component. Available options: true. |
|
|
64
|
+
| iconPosition | `'left' | 'right'` | no | left | Controls the iconPosition behavior and appearance of the Input component. Available options: left, right. |
|
|
65
|
+
| messageType | `'error' | 'helper'` | no | helper | Controls the messageType behavior and appearance of the Input component. Available options: error, helper. |
|
|
66
|
+
| tier | `'commit' | 'modify'` | no | modify | Controls the tier behavior and appearance of the Input component. Available options: commit, modify. |
|
|
67
|
+
|
|
68
|
+
Inherited from:
|
|
69
|
+
- Omit<InputVariants, 'error'> (omit-pattern)
|
|
70
|
+
- Omit<HTMLInputAttributes, 'size' | 'class' | 'disabled' | 'readonly' | 'children'> (omit-pattern)
|
|
71
|
+
|
|
72
|
+
### Slots (slotClasses keys)
|
|
73
|
+
`wrapper`, `container`, `base`, `label`, `message`, `iconContainer`
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
## Menu
|
|
5
|
+
Action menu triggered by a button with nested items, icons, separators, and keyboard navigation.
|
|
6
|
+
|
|
7
|
+
**Import:** `import { Menu } from '@urbicon-ui/blocks';`
|
|
8
|
+
|
|
9
|
+
### Examples
|
|
10
|
+
```svelte
|
|
11
|
+
<Menu placeholder="Actions" items={[
|
|
12
|
+
{ label: 'Edit', onSelect: () => edit() },
|
|
13
|
+
{ label: 'Duplicate', onSelect: () => duplicate() },
|
|
14
|
+
{ type: 'section', label: 'Danger' },
|
|
15
|
+
{ label: 'Delete', onSelect: () => confirmDelete() }
|
|
16
|
+
]} />
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```svelte
|
|
20
|
+
<Menu placeholder="More">
|
|
21
|
+
<MenuSection label="Edit" />
|
|
22
|
+
<MenuItem onSelect={() => rename()}>Rename</MenuItem>
|
|
23
|
+
<MenuItem onSelect={() => duplicate()}>Duplicate</MenuItem>
|
|
24
|
+
<MenuDivider />
|
|
25
|
+
<MenuItem onSelect={() => confirmDelete()}>Delete</MenuItem>
|
|
26
|
+
</Menu>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```svelte
|
|
30
|
+
<Menu items={actionItems}>
|
|
31
|
+
{#snippet customTrigger(toggle, open)}
|
|
32
|
+
<Button
|
|
33
|
+
variant="ghost"
|
|
34
|
+
aria-label="Actions"
|
|
35
|
+
aria-haspopup="menu"
|
|
36
|
+
aria-expanded={open}
|
|
37
|
+
onclick={toggle}
|
|
38
|
+
>
|
|
39
|
+
<MoreHorizontalIcon />
|
|
40
|
+
</Button>
|
|
41
|
+
{/snippet}
|
|
42
|
+
</Menu>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Variants
|
|
46
|
+
- chevronAnimation: fade, none, rotate, translate (default: rotate)
|
|
47
|
+
- disabled: true
|
|
48
|
+
- itemSize: lg, md, sm (default: md)
|
|
49
|
+
- open: true (default: false)
|
|
50
|
+
- placement: bottom, bottom-end, bottom-start, top, top-end, top-start (default: bottom-start)
|
|
51
|
+
- syncWidth: false, true (default: true)
|
|
52
|
+
- tier: commit, modify (default: commit)
|
|
53
|
+
- usePortal: false, true (default: true)
|
|
54
|
+
|
|
55
|
+
### Api
|
|
56
|
+
| Prop | Type | Required | Default | Description |
|
|
57
|
+
| --- | --- | :---: | --- | --- |
|
|
58
|
+
| ...AnimationProps | `inherited` | no | | Properties inherited from AnimationProps |
|
|
59
|
+
| ...HTMLAttributes<HTMLDivElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children' | 'class' | 'placeholder') |
|
|
60
|
+
| ...MenuVariants | `VariantProps` | no | | Styling variants from MenuVariants |
|
|
61
|
+
| class | `string` | no | | Additional CSS classes to apply to the Menu component |
|
|
62
|
+
| customFooter | `Snippet` | no | | Optional custom footer rendered below the items list. |
|
|
63
|
+
| customHeader | `Snippet` | no | | Optional custom header rendered above the items list. |
|
|
64
|
+
| customItem | `Snippet<[TItem]>` | no | | Custom per-item content. **Render visible content only** — the outer `role="menuitem"` button is provided by Menu and handles the click / keyboard activation. Putting an interactive element (`<button>`, `<a>`) inside the snippet creates nested-interactive HTML and triggers the item's action twice via event bubbling. Positional arg: `(item)`. To dispatch from outside the normal click (e.g. a "Recent" entry that needs to activate from a parent shortcut), call the item's own `onSelect` directly. |
|
|
65
|
+
| customTrigger | `Snippet<[() => void, boolean, () => void]>` | no | | Replace the default trigger button (chevron + label) with a custom element. Positional args: `(toggle, open, dismiss)`. - `toggle`: flips the open state — wire this to your custom trigger's click handler so the menu can be opened from the consumer's element. - `open`: current open state — useful for `aria-expanded`. - `dismiss`: closes the menu without changing toggle history; rarely needed but provided for symmetry. The consumer's element should bind its `onclick` to `toggle` and set `aria-expanded={open}` + `aria-haspopup="menu"` for ARIA correctness. |
|
|
66
|
+
| id | `string` | no | | Id property for the Menu component |
|
|
67
|
+
| chevronAnimation | `'fade' | 'none' | 'rotate' | 'translate'` | no | rotate | Controls the chevronAnimation behavior and appearance of the Menu component. Available options: fade, none, rotate, translate. |
|
|
68
|
+
| disabled | `'true'` | no | | Controls the disabled behavior and appearance of the Menu component. Available options: true. |
|
|
69
|
+
| itemSize | `'lg' | 'md' | 'sm'` | no | md | Controls the itemSize behavior and appearance of the Menu component. Available options: lg, md, sm. |
|
|
70
|
+
| open | `'true'` | no | false | Controls the open behavior and appearance of the Menu component. Available options: true. |
|
|
71
|
+
| placement | `'bottom' | 'bottom-end' | 'bottom-start' | 'top' | 'top-end' | 'top-start'` | no | bottom-start | Controls the positioning and alignment of the Menu relative to its container or trigger element. Available options: bottom, bottom-end, bottom-start, and 3 more. |
|
|
72
|
+
| syncWidth | `'false' | 'true'` | no | true | Controls the syncWidth behavior and appearance of the Menu component. Available options: false, true. |
|
|
73
|
+
| tier | `'commit' | 'modify'` | no | commit | Controls the tier behavior and appearance of the Menu component. Available options: commit, modify. |
|
|
74
|
+
| usePortal | `'false' | 'true'` | no | true | Controls the usePortal behavior and appearance of the Menu component. Available options: false, true. |
|
|
75
|
+
|
|
76
|
+
Inherited from:
|
|
77
|
+
- MenuVariants (external)
|
|
78
|
+
- Omit<MenuSpecificProps<TItem>, keyof MenuVariants> (omit-pattern)
|
|
79
|
+
- MenuCustomSlots (local-interface)
|
|
80
|
+
- AnimationProps (external)
|
|
81
|
+
- Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class' | 'placeholder'> (omit-pattern)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
## Pagination
|
|
5
|
+
Navigation control for paged data sets.
|
|
6
|
+
Supports multiple layouts, intents, button variants, and configurable ellipsis behaviour.
|
|
7
|
+
|
|
8
|
+
**Import:** `import { Pagination } from '@urbicon-ui/blocks';`
|
|
9
|
+
|
|
10
|
+
### Examples
|
|
11
|
+
```svelte
|
|
12
|
+
<Pagination
|
|
13
|
+
currentPage={page}
|
|
14
|
+
totalPages={20}
|
|
15
|
+
onPageChange={(p) => page = p}
|
|
16
|
+
/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Variants
|
|
20
|
+
- size: lg, md, sm (default: md)
|
|
21
|
+
- layout: default, minimal, navigation, table (default: default)
|
|
22
|
+
|
|
23
|
+
### Api
|
|
24
|
+
| Prop | Type | Required | Default | Description |
|
|
25
|
+
| --- | --- | :---: | --- | --- |
|
|
26
|
+
| currentPage | `number` | yes | | 1-based index of the currently active page. |
|
|
27
|
+
| totalPages | `number` | yes | | Total number of pages in the data set. |
|
|
28
|
+
| ...HTMLAttributes<HTMLElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'class') |
|
|
29
|
+
| ...PaginationVariants | `VariantProps` | no | | Styling variants from PaginationVariants |
|
|
30
|
+
| class | `string` | no | | Additional CSS classes merged onto the root `<nav>` element. |
|
|
31
|
+
| disabled | `boolean` | no | | Disables all buttons and dims the component. |
|
|
32
|
+
| endItem | `number` | no | | Override the calculated end item number for the info text. |
|
|
33
|
+
| firstIcon | `Snippet` | no | | Custom icon rendered inside the "First" button. |
|
|
34
|
+
| firstLabel | `string` | no | | Label for the "First" button. Falls back to i18n key `pagination.first`. |
|
|
35
|
+
| infoText | `string` | no | | Override the auto-generated info text with a fully custom string. |
|
|
36
|
+
| intent | `'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'neutral'` | no | | Semantic color applied to every pagination button. |
|
|
37
|
+
| itemsPerPage | `number` | no | | Items shown per page. Used by the table layout to compute "Showing X to Y of Z". |
|
|
38
|
+
| lastIcon | `Snippet` | no | | Custom icon rendered inside the "Last" button. |
|
|
39
|
+
| lastLabel | `string` | no | | Label for the "Last" button. Falls back to i18n key `pagination.last`. |
|
|
40
|
+
| loading | `boolean` | no | | Shows a loading state with reduced opacity. |
|
|
41
|
+
| mint | `MintProp` | no | | Micro-interaction animation applied to the pagination container. |
|
|
42
|
+
| nextIcon | `Snippet` | no | | Custom icon rendered inside the "Next" button. |
|
|
43
|
+
| nextLabel | `string` | no | | Label for the "Next" button. Falls back to i18n key `pagination.next`. |
|
|
44
|
+
| onPageChange | `(page: number) => void` | no | | Fires when the user selects a different page. Receives the 1-based page number. |
|
|
45
|
+
| pageLabel | `string` | no | | Prefix for the info text (e.g. "Page"). Falls back to i18n key `pagination.page`. |
|
|
46
|
+
| preset | `string` | no | | Apply a named preset registered via `<BlocksProvider presets={{ Pagination: {...} }}>`. 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. |
|
|
47
|
+
| previousIcon | `Snippet` | no | | Custom icon rendered inside the "Previous" button. |
|
|
48
|
+
| previousLabel | `string` | no | | Label for the "Previous" button. Falls back to i18n key `pagination.previous`. |
|
|
49
|
+
| showFirstLast | `boolean` | no | | Show "First" / "Last" boundary buttons when the current page is far from the edges. |
|
|
50
|
+
| showInfo | `boolean` | no | | Show a text summary such as "Page 3 of 10" beneath the controls. |
|
|
51
|
+
| showNumbers | `boolean` | no | | Show numbered page buttons. Set to false for a compact prev/next-only bar. |
|
|
52
|
+
| showPreviousNext | `boolean` | no | | Show "Previous" / "Next" navigation buttons. |
|
|
53
|
+
| size | `'sm' | 'md' | 'lg'` | no | | Button dimensions. Affects page numbers, prev/next, and first/last. |
|
|
54
|
+
| slotClasses | `Partial<Record<'base' | 'info' | 'controls' | 'ellipsis', string>>` | no | | Per-slot class overrides merged with (or replacing, when unstyled) tv styles. Slots: base, info, controls, ellipsis. |
|
|
55
|
+
| startItem | `number` | no | | Override the calculated start item number for the info text. |
|
|
56
|
+
| tier | `InteractiveTier` | no | | Semantic radius tier forwarded to pagination buttons. |
|
|
57
|
+
| totalItems | `number` | no | | Total number of items across all pages. Used by the table layout info text. |
|
|
58
|
+
| unstyled | `boolean` | no | | Strip all default tailwind-variants classes for a fully custom build. |
|
|
59
|
+
| variant | `'outlined' | 'filled' | 'ghost'` | no | | Visual weight of pagination buttons. |
|
|
60
|
+
| visiblePages | `number` | no | | Maximum number of page buttons shown between the ellipsis indicators. |
|
|
61
|
+
| layout | `'default' | 'minimal' | 'navigation' | 'table'` | no | default | Controls the layout behavior and appearance of the Pagination component. Available options: default, minimal, navigation, table. |
|
|
62
|
+
|
|
63
|
+
Inherited from:
|
|
64
|
+
- Omit<PaginationVariants, 'disabled' | 'loading'> (omit-pattern)
|
|
65
|
+
- Omit<HTMLAttributes<HTMLElement>, 'class'> (omit-pattern)
|
|
66
|
+
|
|
67
|
+
### Slots (slotClasses keys)
|
|
68
|
+
`base`, `info`, `controls`, `ellipsis`
|