@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
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @urbicon-ui/design-content
2
+
3
+ The version-pinned **bundle of Urbicon UI design knowledge** plus a package-relative
4
+ locator for it. This is the **Knowledge plane** of the design tooling (the
5
+ deterministic linter/manifest/rubric **Judgment** engine lives in
6
+ [`@urbicon-ui/design-engine`](../design-engine)).
7
+
8
+ Because the content ships _inside_ this package, consumers — the remote MCP server,
9
+ the `urbicon` CLI, a CI hook — resolve it from their own install location with no
10
+ monorepo sibling-path assumptions, and the knowledge is automatically coherent with
11
+ the installed library version.
12
+
13
+ ## What's in the bundle
14
+
15
+ The `content/` directory is a **build artifact** (git-ignored in dev, regenerated by
16
+ `docs:gen:all` / `build`, shipped on publish):
17
+
18
+ | File / dir | Contents |
19
+ | --- | --- |
20
+ | `component-catalog.json` | All components (props, variants, slots, tags) + recipes (with code) + tag index |
21
+ | `<group>/<slug>/llm.txt` | Per-component LLM documentation (overview / examples / variants / api / slots) |
22
+ | `design-system/principles.md` | Design principles, by topic |
23
+ | `design-system/patterns/*.md` | Layer-4 composition patterns (dashboard, form-page, …) |
24
+ | `guides/llms-full-template.md` | Source for the seven guide resources |
25
+ | `icons.json` | Icon metadata (name → label / categories / keywords / component) |
26
+ | `meta.json` | Build provenance `{ version, builtAt, contentHash }` |
27
+
28
+ ## API
29
+
30
+ ```ts
31
+ import {
32
+ getCatalogPath,
33
+ getComponentLlmPath,
34
+ getContentDir,
35
+ getDesignSystemDir,
36
+ getIconsPath,
37
+ getTemplatePath,
38
+ loadContentMeta
39
+ } from '@urbicon-ui/design-content';
40
+ ```
41
+
42
+ The functions return absolute paths into the bundle (a thin, dependency-free locator);
43
+ consumers do the reading/parsing. `loadContentMeta()` reads `meta.json`, or returns
44
+ `null` when the bundle has not been generated yet.
45
+
46
+ ### Overriding the bundle location
47
+
48
+ Set `URBICON_CONTENT_DIR` to point the locator at a different bundle — used in
49
+ monorepo dev/tests against a freshly generated `content/`, or to serve an alternate
50
+ content set.
51
+
52
+ ## License
53
+
54
+ MIT
@@ -0,0 +1,33 @@
1
+
2
+ ---
3
+
4
+ ## AccountSettings
5
+ Self-service account-settings panel: change name, email and
6
+ password, and delete the account. Each section talks to `basePath` (default
7
+ `/api/auth/account`); pair them with the server handlers
8
+ `createUpdateProfileHandler`, `createChangeEmailHandler`,
9
+ `createChangePasswordHandler` and `createDeleteAccountHandler`.
10
+
11
+ **Import:** `import { AccountSettings } from '@urbicon-ui/auth';`
12
+
13
+ ### Examples
14
+ ```svelte
15
+ <AccountSettings {user} onProfileUpdated={(u) => (auth.user = u)} onDeleted={() => goto('/')} />
16
+ ```
17
+
18
+ ### Api
19
+ | Prop | Type | Required | Default | Description |
20
+ | --- | --- | :---: | --- | --- |
21
+ | user | `AuthUser | null` | yes | | The current authenticated user — its `name` pre-fills the profile field and its `email` is shown as the current address. Pass `locals.user` / your auth store's user. While `null` the panel renders nothing. |
22
+ | basePath | `string` | no | '/api/auth/account' | API base path for the account endpoints. |
23
+ | class | `string` | no | | Extra classes on the root element. |
24
+ | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names — only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. |
25
+ | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. Useful for mock backends in demos/tests or custom retry/auth layers. |
26
+ | onDeleted | `() => void` | no | | Called after the account has been deleted (e.g. redirect to a goodbye page). |
27
+ | onProfileUpdated | `(user: AuthUser) => void` | no | | Called with the refreshed user after a successful profile change (update your store here). |
28
+ | slotClasses | `Partial<Record<'root' | 'title' | 'section' | 'sectionTitle' | 'field' | 'submit' | 'danger', string>>` | no | | Per-slot class overrides. |
29
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
30
+ | unstyled | `boolean` | no | | Strip all default styling. |
31
+
32
+ ### Slots (slotClasses keys)
33
+ `root`, `title`, `section`, `sectionTitle`, `field`, `submit`, `danger`
@@ -0,0 +1,25 @@
1
+
2
+ ---
3
+
4
+ ## ForgotPasswordPage
5
+ Pre-built forgot-password page. Sends POST to `apiPath` (default `/api/auth/forgot-password`).
6
+ Pair with `createForgotPasswordHandler(authDeps)` on the server. Timing-safe to prevent email enumeration.
7
+
8
+ **Import:** `import { ForgotPasswordPage } from '@urbicon-ui/auth';`
9
+
10
+ ### Examples
11
+ ```svelte
12
+ <ForgotPasswordPage {t} />
13
+ ```
14
+
15
+ ### Api
16
+ | Prop | Type | Required | Default | Description |
17
+ | --- | --- | :---: | --- | --- |
18
+ | apiPath | `string` | no | '/api/auth/forgot-password' | ApiPath property for the ForgotPasswordPage component |
19
+ | class | `string` | no | | Extra classes on the root element. |
20
+ | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names — only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. |
21
+ | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. Useful for mock backends in demos/tests or custom retry/auth layers. |
22
+ | loginUrl | `string` | no | '/auth/login' | URL for the login page link. |
23
+ | slotClasses | `AuthPageSlotClasses` | no | | Per-slot class overrides. Keys: `root`, `card`, `title`, `form`, `field`, `submit`, `error`, `success`, `links`. |
24
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
25
+ | unstyled | `boolean` | no | | Strip all default styling. |
@@ -0,0 +1,28 @@
1
+
2
+ ---
3
+
4
+ ## InvitationManager
5
+ Admin panel for managing invitation-gated registration with email toggle.
6
+ Communicates with `basePath` (default `/api/invitations`). Pair with `createInvitationHandlers(authDeps, { authorize, roles })` on the server — mount its `POST` + `GET` on `/api/invitations` and `DELETE` on `/api/invitations/[id]`.
7
+
8
+ **Import:** `import { InvitationManager } from '@urbicon-ui/auth';`
9
+
10
+ ### Examples
11
+ ```svelte
12
+ <InvitationManager {t} roles={[{ value: 'ADMIN', label: 'Admin' }, { value: 'USER', label: 'User' }]} />
13
+ ```
14
+
15
+ ### Api
16
+ | Prop | Type | Required | Default | Description |
17
+ | --- | --- | :---: | --- | --- |
18
+ | roles | `RoleOption[]` | yes | | Available roles for the invitation menu. |
19
+ | basePath | `string` | no | '/api/invitations' | BasePath property for the InvitationManager component |
20
+ | class | `string` | no | | Extra classes on the root element. |
21
+ | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names — only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. |
22
+ | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. Useful for mock backends in demos/tests or custom retry/auth layers. |
23
+ | slotClasses | `Partial<Record<'root' | 'title' | 'form' | 'list' | 'item' | 'error', string>>` | no | | Per-slot class overrides. See component source for available slot keys. |
24
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
25
+ | unstyled | `boolean` | no | | Strip all default styling. |
26
+
27
+ ### Slots (slotClasses keys)
28
+ `root`, `title`, `form`, `list`, `item`, `error`
@@ -0,0 +1,34 @@
1
+
2
+ ---
3
+
4
+ ## LoginPage
5
+ Pre-built login page with email/password, optional passkey, and remember-me.
6
+ Sends POST to `apiPath` (default `/api/auth/login`). Pair with `createLoginHandler(authDeps)` on the server.
7
+
8
+ **Import:** `import { LoginPage } from '@urbicon-ui/auth';`
9
+
10
+ ### Examples
11
+ ```svelte
12
+ <LoginPage {t} onSuccess={() => goto('/')} />
13
+ ```
14
+
15
+ ### Api
16
+ | Prop | Type | Required | Default | Description |
17
+ | --- | --- | :---: | --- | --- |
18
+ | apiPath | `string` | no | '/api/auth/login' | API endpoint for the login request. |
19
+ | class | `string` | no | | Extra classes on the root element. |
20
+ | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names — only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. |
21
+ | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. Useful for mock backends in demos/tests or custom retry/auth layers. |
22
+ | footer | `Snippet` | no | | Content rendered below the form, above links (e.g. terms checkbox). |
23
+ | forgotPasswordUrl | `string` | no | '/auth/forgot-password' | URL for the forgot-password page link. |
24
+ | header | `Snippet` | no | | Content rendered above the form (e.g. social login buttons, welcome text). |
25
+ | links | `Snippet` | no | | Replaces the link area below the form. |
26
+ | mode | `'password' | 'passkey' | 'both'` | no | 'both' | Login mode. `'password'` shows only email/password, `'passkey'` shows only passkey button, `'both'` shows both with separator. |
27
+ | onSuccess | `() => void` | no | | Called after successful login. |
28
+ | passkeyApiPath | `string` | no | undefined | Passkey API base path. Required when mode is `'passkey'` or `'both'`. |
29
+ | registerUrl | `string` | no | '/auth/register' | URL for the register page link. |
30
+ | rememberMe | `boolean` | no | false | Show a "Remember me" checkbox. When checked, sends `rememberMe: true` in the login request body. |
31
+ | slotClasses | `AuthPageSlotClasses` | no | | Per-slot class overrides. Keys: `root`, `card`, `title`, `form`, `field`, `submit`, `error`, `success`, `links`. |
32
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
33
+ | twoFactorApiPath | `string` | no | '/api/auth/2fa/verify' | API endpoint for the 2FA verify step. When the login response signals `twoFactorRequired`, the page switches to a code-entry step that POSTs here. Pair with `createTwoFactorVerifyHandler`. |
34
+ | unstyled | `boolean` | no | | Strip all default styling. |
@@ -0,0 +1,21 @@
1
+
2
+ ---
3
+
4
+ ## NotificationBadge
5
+ Unread notification count badge. Uses blocks Badge primitive.
6
+ Renders nothing when count is 0.
7
+
8
+ **Import:** `import { NotificationBadge } from '@urbicon-ui/auth';`
9
+
10
+ ### Examples
11
+ ```svelte
12
+ <NotificationBadge count={store.unreadCount} onclick={() => (open = !open)} />
13
+ ```
14
+
15
+ ### Api
16
+ | Prop | Type | Required | Default | Description |
17
+ | --- | --- | :---: | --- | --- |
18
+ | count | `number` | yes | | Number of unread notifications. Badge hidden when 0. |
19
+ | class | `string` | no | | Extra classes on the root element. |
20
+ | onclick | `() => void` | no | | Click handler (e.g. toggle notification center). |
21
+ | unstyled | `boolean` | no | | Strip all default styling. |
@@ -0,0 +1,33 @@
1
+
2
+ ---
3
+
4
+ ## NotificationCenter
5
+ Menu-ready notification list with mark-as-read, delete, and empty state.
6
+ Renders each notification as a clickable card with timestamp.
7
+
8
+ **Import:** `import { NotificationCenter } from '@urbicon-ui/auth';`
9
+
10
+ ### Examples
11
+ ```svelte
12
+ <NotificationCenter {t} notifications={store.notifications}
13
+ onMarkAsRead={(id) => store.markAsRead(id)}
14
+ onMarkAllAsRead={() => store.markAllAsRead()}
15
+ />
16
+ ```
17
+
18
+ ### Api
19
+ | Prop | Type | Required | Default | Description |
20
+ | --- | --- | :---: | --- | --- |
21
+ | notifications | `import('../../../server/adapters/types.js').NotificationRecord[]` | yes | | Notification records to display. |
22
+ | class | `string` | no | | Extra classes on the root element. |
23
+ | item | `Snippet<[import('../../../server/adapters/types.js').NotificationRecord]>` | no | | Custom notification item renderer. |
24
+ | onClick | `(notification: import('../../../server/adapters/types.js').NotificationRecord) => void` | no | | Called when a notification is clicked (e.g. to navigate to a URL). SECURITY: `notification.url` is DB-/server-sourced and untrusted — before passing it to `goto()` / `window.location`, validate it is same-origin or relative (reject `javascript:` and absolute cross-origin URLs). Never navigate to a raw `notification.url`. |
25
+ | onDelete | `(id: string) => void` | no | | Called when a notification is deleted. |
26
+ | onMarkAllAsRead | `() => void` | no | | Called when all notifications are marked as read. |
27
+ | onMarkAsRead | `(id: string) => void` | no | | Called when a single notification is marked as read. |
28
+ | slotClasses | `Partial<Record<'root' | 'header' | 'list' | 'item' | 'empty', string>>` | no | | Per-slot class overrides. See component source for available slot keys. |
29
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
30
+ | unstyled | `boolean` | no | | Strip all default styling. |
31
+
32
+ ### Slots (slotClasses keys)
33
+ `root`, `header`, `list`, `item`, `empty`
@@ -0,0 +1,24 @@
1
+
2
+ ---
3
+
4
+ ## NotificationListener
5
+ Headless SSE listener for real-time notifications. Reconnects with exponential backoff (1–30s).
6
+ Connects to `basePath` (default `/api/notifications/stream`). Pair with `createStreamHandler(sse)` on the server — mount its `GET` on the stream route.
7
+
8
+ **Import:** `import { NotificationListener } from '@urbicon-ui/auth';`
9
+
10
+ ### Examples
11
+ ```svelte
12
+ <NotificationListener onNotification={(n) => store.add(n)} />
13
+ ```
14
+
15
+ ### Api
16
+ | Prop | Type | Required | Default | Description |
17
+ | --- | --- | :---: | --- | --- |
18
+ | basePath | `string` | no | '/api/notifications/stream' | SSE stream endpoint. Read once when the component mounts — to switch endpoints (e.g. after a user change), unmount and remount the listener. |
19
+ | maxReconnectAttempts | `number` | no | 5 | Maximum reconnection attempts before giving up. Read once at mount. |
20
+ | onError | `(error: Event) => void` | no | | Called when the SSE connection encounters an error. |
21
+ | onNotification | `(
22
+ notification: import('../../../server/adapters/types.js').NotificationRecord
23
+ ) => void` | no | | Called when a new notification arrives via SSE. |
24
+ | onReconnect | `(attempt: number) => void` | no | | Called when a reconnection attempt starts. Receives current attempt number. |
@@ -0,0 +1,27 @@
1
+
2
+ ---
3
+
4
+ ## PasskeyManager
5
+ Admin panel for managing passkeys (WebAuthn credentials). Register and delete passkeys.
6
+ Communicates with `basePath` (default `/api/auth/passkey`). Pair with the `createPasskeyRegistrationOptionsHandler`, `createPasskeyRegistrationVerifyHandler`, `createPasskeyAuthenticationOptionsHandler` and `createPasskeyAuthenticationVerifyHandler` server handlers.
7
+
8
+ **Import:** `import { PasskeyManager } from '@urbicon-ui/auth';`
9
+
10
+ ### Examples
11
+ ```svelte
12
+ <PasskeyManager {t} basePath="/api/auth/passkey" />
13
+ ```
14
+
15
+ ### Api
16
+ | Prop | Type | Required | Default | Description |
17
+ | --- | --- | :---: | --- | --- |
18
+ | basePath | `string` | no | '/api/auth/passkey' | API base path for passkey operations. |
19
+ | class | `string` | no | | Extra classes on the root element. |
20
+ | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names — only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. |
21
+ | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. Useful for mock backends in demos/tests or custom retry/auth layers. |
22
+ | slotClasses | `Partial<Record<'root' | 'title' | 'list' | 'item' | 'empty', string>>` | no | | Per-slot class overrides. See component source for available slot keys. |
23
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
24
+ | unstyled | `boolean` | no | | Strip all default styling. |
25
+
26
+ ### Slots (slotClasses keys)
27
+ `root`, `title`, `list`, `item`, `empty`
@@ -0,0 +1,32 @@
1
+
2
+ ---
3
+
4
+ ## PushPermissionPrompt
5
+ Dismissible prompt asking the user to enable push notifications.
6
+ Handles VAPID subscription and server-side registration.
7
+
8
+ **Import:** `import { PushPermissionPrompt } from '@urbicon-ui/auth';`
9
+
10
+ ### Examples
11
+ ```svelte
12
+ <PushPermissionPrompt {t} vapidPublicKey={PUBLIC_VAPID_KEY}
13
+ onSubscribed={(sub) => console.log('Subscribed', sub)}
14
+ />
15
+ ```
16
+
17
+ ### Api
18
+ | Prop | Type | Required | Default | Description |
19
+ | --- | --- | :---: | --- | --- |
20
+ | vapidPublicKey | `string` | yes | | VAPID public key for push subscription. |
21
+ | class | `string` | no | | Extra classes on the root element. |
22
+ | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names — only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. |
23
+ | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. Useful for mock backends in demos/tests or custom retry/auth layers. |
24
+ | onDismissed | `() => void` | no | | Called when the user dismisses the prompt. |
25
+ | onSubscribed | `(subscription: PushSubscription) => void` | no | | Called after successful push subscription. |
26
+ | slotClasses | `Partial<Record<'root' | 'text' | 'actions', string>>` | no | | Per-slot class overrides. See component source for available slot keys. |
27
+ | subscriptionEndpoint | `string` | no | '/api/notifications/push-subscription' | API endpoint for registering subscriptions. |
28
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
29
+ | unstyled | `boolean` | no | | Strip all default styling. |
30
+
31
+ ### Slots (slotClasses keys)
32
+ `root`, `text`, `actions`
@@ -0,0 +1,35 @@
1
+
2
+ ---
3
+
4
+ ## RegisterPage
5
+ Pre-built registration page with invitation-gated signup, password requirements checklist, and confirm field.
6
+ Sends POST to `apiPath` (default `/api/auth/register`). Pair with `createRegisterHandler(authDeps)` on the server.
7
+
8
+ **Import:** `import { RegisterPage } from '@urbicon-ui/auth';`
9
+
10
+ ### Examples
11
+ ```svelte
12
+ <RegisterPage {t} onSuccess={() => goto('/')} />
13
+ ```
14
+
15
+ ### Api
16
+ | Prop | Type | Required | Default | Description |
17
+ | --- | --- | :---: | --- | --- |
18
+ | apiPath | `string` | no | '/api/auth/register' | ApiPath property for the RegisterPage component |
19
+ | class | `string` | no | | Extra classes on the root element. |
20
+ | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names — only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. |
21
+ | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. Useful for mock backends in demos/tests or custom retry/auth layers. |
22
+ | footer | `Snippet` | no | | Content rendered below the form, above links (e.g. terms checkbox). |
23
+ | header | `Snippet` | no | | Content rendered above the form (e.g. social login buttons). |
24
+ | links | `Snippet` | no | | Replaces the link area. |
25
+ | loginUrl | `string` | no | '/auth/login' | URL for the login page link. |
26
+ | onSuccess | `() => void` | no | | Called after successful registration. |
27
+ | passwordMinLength | `number` | no | 8 | Minimum password length. |
28
+ | requireDigit | `boolean` | no | true | RequireDigit property for the RegisterPage component |
29
+ | requireLowercase | `boolean` | no | true | Require lowercase letter. |
30
+ | requireSpecial | `boolean` | no | false | Require special character. |
31
+ | requireUppercase | `boolean` | no | true | Require uppercase letter. |
32
+ | showRequirements | `boolean` | no | true | Show real-time password requirements checklist. |
33
+ | slotClasses | `AuthPageSlotClasses` | no | | Per-slot class overrides. Keys: `root`, `card`, `title`, `form`, `field`, `submit`, `error`, `success`, `links`. |
34
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
35
+ | unstyled | `boolean` | no | | Strip all default styling. |
@@ -0,0 +1,26 @@
1
+
2
+ ---
3
+
4
+ ## ResetPasswordPage
5
+ Pre-built reset-password page with password confirmation.
6
+ Sends POST to `apiPath` (default `/api/auth/reset-password`). Pair with `createResetPasswordHandler(authDeps)` on the server.
7
+
8
+ **Import:** `import { ResetPasswordPage } from '@urbicon-ui/auth';`
9
+
10
+ ### Examples
11
+ ```svelte
12
+ <ResetPasswordPage {t} token={$page.url.searchParams.get('token') ?? ''} />
13
+ ```
14
+
15
+ ### Api
16
+ | Prop | Type | Required | Default | Description |
17
+ | --- | --- | :---: | --- | --- |
18
+ | token | `string` | yes | | Reset token from URL query parameter. |
19
+ | apiPath | `string` | no | '/api/auth/reset-password' | ApiPath property for the ResetPasswordPage component |
20
+ | class | `string` | no | | Extra classes on the root element. |
21
+ | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names — only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. |
22
+ | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. Useful for mock backends in demos/tests or custom retry/auth layers. |
23
+ | loginUrl | `string` | no | '/auth/login' | URL for the login page link. |
24
+ | slotClasses | `AuthPageSlotClasses` | no | | Per-slot class overrides. Keys: `root`, `card`, `title`, `form`, `field`, `submit`, `error`, `success`, `links`. |
25
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
26
+ | unstyled | `boolean` | no | | Strip all default styling. |
@@ -0,0 +1,32 @@
1
+
2
+ ---
3
+
4
+ ## SessionManager
5
+ Lists the user's active sessions (refresh-token families) with a
6
+ device label, last-active time and a "this device" badge, and lets them sign
7
+ out an individual session or all other devices. Requires refresh-token
8
+ rotation on the server (`config.refreshToken`); without it the list reports
9
+ itself unavailable. Pair with `createListSessionsHandler` (GET `basePath`),
10
+ `createRevokeSessionHandler` (POST `basePath/revoke`) and
11
+ `createRevokeOtherSessionsHandler` (POST `basePath/revoke-others`).
12
+
13
+ **Import:** `import { SessionManager } from '@urbicon-ui/auth';`
14
+
15
+ ### Examples
16
+ ```svelte
17
+ <SessionManager basePath="/api/auth/sessions" />
18
+ ```
19
+
20
+ ### Api
21
+ | Prop | Type | Required | Default | Description |
22
+ | --- | --- | :---: | --- | --- |
23
+ | basePath | `string` | no | '/api/auth/sessions' | API base path for the session endpoints. |
24
+ | class | `string` | no | | Extra classes on the root element. |
25
+ | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names — only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. |
26
+ | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. Useful for mock backends in demos/tests or custom retry/auth layers. |
27
+ | slotClasses | `Partial<Record<'root' | 'title' | 'list' | 'item' | 'empty' | 'badge', string>>` | no | | Per-slot class overrides. |
28
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
29
+ | unstyled | `boolean` | no | | Strip all default styling. |
30
+
31
+ ### Slots (slotClasses keys)
32
+ `root`, `title`, `list`, `item`, `empty`, `badge`
@@ -0,0 +1,40 @@
1
+
2
+ ---
3
+
4
+ ## TwoFactorManager
5
+ Self-service two-factor (TOTP) management: enrol with an
6
+ authenticator app, show one-time backup codes, and disable with a password
7
+ re-auth. Talks to `basePath` (default `/api/auth/account/2fa`); pair with the
8
+ server handlers `createTwoFactorSetupHandler`, `createTwoFactorEnableHandler`
9
+ and `createTwoFactorDisableHandler`. The core stays zero-dependency, so QR
10
+ rendering is delegated to the `qr` snippet — without it the otpauth URI +
11
+ Base32 secret are shown for manual entry.
12
+
13
+ **Import:** `import { TwoFactorManager } from '@urbicon-ui/auth';`
14
+
15
+ ### Examples
16
+ ```svelte
17
+ <TwoFactorManager {user} onEnabled={() => auth.checkStatus()}>
18
+ {#snippet qr({ uri })}
19
+ <MyQrCode value={uri} />
20
+ {/snippet}
21
+ </TwoFactorManager>
22
+ ```
23
+
24
+ ### Api
25
+ | Prop | Type | Required | Default | Description |
26
+ | --- | --- | :---: | --- | --- |
27
+ | user | `AuthUser | null` | yes | | The current authenticated user — its `totpEnabled` seeds the initial state and its `email` labels the otpauth entry. While `null` the panel renders nothing. Resolve `user` before mount, or remount with `{#key user?.id}…{/key}` to re-seed after an async load. |
28
+ | basePath | `string` | no | '/api/auth/account/2fa' | API base path for the 2FA account endpoints. |
29
+ | class | `string` | no | | Extra classes on the root element. |
30
+ | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names — only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. |
31
+ | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. |
32
+ | onDisabled | `() => void` | no | | Called after 2FA was disabled. |
33
+ | onEnabled | `() => void` | no | | Called after 2FA was successfully enabled (e.g. refresh your auth store). |
34
+ | qr | `Snippet<[{ uri: string; secret: string }]>` | no | | QR-code renderer for the otpauth URI shown during setup. Receives the `otpauth://` `uri` and the Base32 `secret`. Optional — the package ships no QR encoder (zero-dep), so without this snippet only the URI + secret are shown for manual entry. |
35
+ | slotClasses | `Partial<Record<'root' | 'title' | 'section' | 'sectionTitle' | 'field' | 'submit' | 'code' | 'backupCode', string>>` | no | | Per-slot class overrides. |
36
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
37
+ | unstyled | `boolean` | no | | Strip all default styling. |
38
+
39
+ ### Slots (slotClasses keys)
40
+ `root`, `title`, `section`, `sectionTitle`, `field`, `submit`, `code`, `backupCode`
@@ -0,0 +1,25 @@
1
+
2
+ ---
3
+
4
+ ## VerifyEmailPage
5
+ Auto-verifying email confirmation page. Sends GET to `apiPath` (default `/api/auth/verify-email`) on mount.
6
+ Pair with `createVerifyEmailHandler(authDeps)` on the server.
7
+
8
+ **Import:** `import { VerifyEmailPage } from '@urbicon-ui/auth';`
9
+
10
+ ### Examples
11
+ ```svelte
12
+ <VerifyEmailPage {t} token={$page.url.searchParams.get('token') ?? ''} />
13
+ ```
14
+
15
+ ### Api
16
+ | Prop | Type | Required | Default | Description |
17
+ | --- | --- | :---: | --- | --- |
18
+ | token | `string` | yes | | Verification token from URL query parameter. |
19
+ | apiPath | `string` | no | '/api/auth/verify-email' | ApiPath property for the VerifyEmailPage component |
20
+ | class | `string` | no | | Extra classes on the root element. |
21
+ | csrf | `CsrfClientOptions` | no | | CSRF cookie/header names — only needed when the server overrides the defaults via `config.csrf`. Mutating requests echo the token automatically. |
22
+ | fetcher | `typeof globalThis.fetch` | no | | Custom fetch implementation for all API calls. Defaults to the global `fetch`. Useful for mock backends in demos/tests or custom retry/auth layers. |
23
+ | slotClasses | `AuthPageSlotClasses` | no | | Per-slot class overrides. Keys: `root`, `card`, `title`, `form`, `field`, `submit`, `error`, `success`, `links`. |
24
+ | t | `AuthLocale` | no | | Locale bundle. Auto-detected from i18n context when omitted. |
25
+ | unstyled | `boolean` | no | | Strip all default styling. |
@@ -0,0 +1,46 @@
1
+
2
+ ---
3
+
4
+ ## AreaChart
5
+ Area chart for trends with volume emphasis — filled regions
6
+ under each series, optionally stacked. Zero-dependency SVG on the design-
7
+ token palette, responsive, dark-mode aware, with a screen-reader data-table
8
+ fallback.
9
+
10
+ **Import:** `import { AreaChart } from '@urbicon-ui/blocks';`
11
+
12
+ ### Examples
13
+ ```svelte
14
+ <AreaChart
15
+ stacked
16
+ data={[
17
+ { label: 'Jan', values: [4, 6] },
18
+ { label: 'Feb', values: [7, 3] }
19
+ ]}
20
+ series={[{ label: 'New' }, { label: 'Returning' }]}
21
+ />
22
+ ```
23
+
24
+ ### Api
25
+ | Prop | Type | Required | Default | Description |
26
+ | --- | --- | :---: | --- | --- |
27
+ | data | `CartesianDatum[]` | yes | | Ordered categories with per-series values. |
28
+ | ...HTMLAttributes<HTMLElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') |
29
+ | ariaLabel | `string` | no | | Accessible label; a summary is generated when omitted. |
30
+ | class | `string` | no | | Extra classes merged onto the wrapper. |
31
+ | fillOpacity | `number` | no | 0.2 (overlay) / 0.85 (stacked) | Opacity of the area fill (0–1). |
32
+ | formatValue | `(value: number) => string` | no | | Format values for axis labels, tooltips, and the data table. |
33
+ | height | `number` | no | 240 | Height property for the AreaChart component |
34
+ | locale | `string` | no | | BCP-47 locale for the default number formatter. |
35
+ | margin | `ChartMargin` | no | | Plot margins; merged over the defaults. |
36
+ | preset | `string` | no | | Apply a named preset registered on `<BlocksProvider>`. |
37
+ | series | `ChartSeries[]` | no | | Series metadata (labels + colors); defaults to one per value column. |
38
+ | showGrid | `boolean` | no | true | Render horizontal gridlines. |
39
+ | showLegend | `boolean` | no | true | Show the series legend (only renders with >1 series). |
40
+ | slotClasses | `ChartSlotClasses` | no | | Per-slot class overrides. |
41
+ | stacked | `boolean` | no | false | Stack series cumulatively instead of overlaying them. |
42
+ | unstyled | `boolean` | no | | Remove all default tv classes. |
43
+ | width | `number` | no | | Fixed width in px; omit for responsive width. |
44
+
45
+ Inherited from:
46
+ - Omit<HTMLAttributes<HTMLElement>, 'children'> (omit-pattern)
@@ -0,0 +1,44 @@
1
+
2
+ ---
3
+
4
+ ## BarChart
5
+ Categorical bar chart — single, grouped, or stacked. Zero-
6
+ dependency SVG rendering on the design-token chart palette, responsive via
7
+ ResizeObserver, dark-mode aware, with a screen-reader data-table fallback.
8
+
9
+ **Import:** `import { BarChart } from '@urbicon-ui/blocks';`
10
+
11
+ ### Examples
12
+ ```svelte
13
+ <BarChart
14
+ data={[
15
+ { label: 'Q1', values: [12, 8] },
16
+ { label: 'Q2', values: [19, 11] }
17
+ ]}
18
+ series={[{ label: 'Revenue' }, { label: 'Cost' }]}
19
+ formatValue={(v) => `${v}k`}
20
+ />
21
+ ```
22
+
23
+ ### Api
24
+ | Prop | Type | Required | Default | Description |
25
+ | --- | --- | :---: | --- | --- |
26
+ | data | `BarChartDatum[]` | yes | | Categories with per-series values. |
27
+ | ...HTMLAttributes<HTMLElement> | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') |
28
+ | ariaLabel | `string` | no | | Accessible label; a summary is generated when omitted. |
29
+ | class | `string` | no | | Extra classes merged onto the wrapper. |
30
+ | formatValue | `(value: number) => string` | no | | Format values for axis labels, tooltips, and the data table. |
31
+ | height | `number` | no | 240 | Height property for the BarChart component |
32
+ | locale | `string` | no | | BCP-47 locale for the default number formatter (when no `formatValue`). |
33
+ | margin | `ChartMargin` | no | | Plot margins; merged over the defaults. |
34
+ | preset | `string` | no | | Apply a named preset registered on `<BlocksProvider>`. |
35
+ | series | `ChartSeries[]` | no | | Series metadata (labels + colors). Defaults to one generic series per value column found in `data`. |
36
+ | showGrid | `boolean` | no | true | Render horizontal gridlines. |
37
+ | showLegend | `boolean` | no | true | Show the series legend (only renders with >1 series). |
38
+ | slotClasses | `ChartSlotClasses` | no | | Per-slot class overrides. |
39
+ | stacked | `boolean` | no | false | Stack series instead of grouping them side by side. |
40
+ | unstyled | `boolean` | no | | Remove all default tv classes. |
41
+ | width | `number` | no | | Fixed width in px; omit for responsive width. |
42
+
43
+ Inherited from:
44
+ - Omit<HTMLAttributes<HTMLElement>, 'children'> (omit-pattern)