@slipstream-ui/core 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +957 -56
- package/dist/index.d.ts +957 -56
- package/dist/index.js +2554 -777
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2524 -777
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/app-shell.manifest.json +206 -0
- package/dist/manifests/auth-layout.manifest.json +99 -0
- package/dist/manifests/autocomplete.manifest.json +53 -5
- package/dist/manifests/badge.manifest.json +20 -3
- package/dist/manifests/breadcrumb.manifest.json +6 -0
- package/dist/manifests/button.manifest.json +20 -2
- package/dist/manifests/card.manifest.json +53 -6
- package/dist/manifests/confirm-dialog.manifest.json +132 -0
- package/dist/manifests/data-table.manifest.json +50 -0
- package/dist/manifests/date-picker.manifest.json +87 -0
- package/dist/manifests/dialog.manifest.json +56 -4
- package/dist/manifests/drawer.manifest.json +25 -4
- package/dist/manifests/empty-state.manifest.json +108 -0
- package/dist/manifests/file-upload.manifest.json +103 -0
- package/dist/manifests/filter-bar.manifest.json +100 -0
- package/dist/manifests/link.manifest.json +106 -0
- package/dist/manifests/menu.manifest.json +13 -1
- package/dist/manifests/metric-card.manifest.json +105 -0
- package/dist/manifests/page-header.manifest.json +124 -0
- package/dist/manifests/pagination.manifest.json +68 -34
- package/dist/manifests/password-input.manifest.json +75 -0
- package/dist/manifests/prose.manifest.json +75 -0
- package/dist/manifests/search.manifest.json +41 -9
- package/dist/manifests/section-heading.manifest.json +108 -0
- package/dist/manifests/select-menu.manifest.json +142 -0
- package/dist/manifests/select.manifest.json +55 -12
- package/dist/manifests/site-footer.manifest.json +94 -0
- package/dist/manifests/site-header.manifest.json +130 -0
- package/dist/manifests/stepper.manifest.json +95 -0
- package/dist/manifests/table-card.manifest.json +123 -0
- package/dist/manifests/table-of-contents.manifest.json +87 -0
- package/dist/manifests/time-picker.manifest.json +86 -0
- package/dist/manifests/timeline.manifest.json +69 -0
- package/dist/manifests/toast.manifest.json +101 -25
- package/package.json +2 -2
- package/src/components/alert/Alert.tsx +2 -2
- package/src/components/app-shell/AppShell.test.tsx +148 -0
- package/src/components/app-shell/AppShell.tsx +266 -0
- package/src/components/app-shell/index.ts +1 -0
- package/src/components/auth-layout/AuthLayout.test.tsx +34 -0
- package/src/components/auth-layout/AuthLayout.tsx +47 -0
- package/src/components/auth-layout/index.ts +1 -0
- package/src/components/autocomplete/Autocomplete.test.tsx +53 -0
- package/src/components/autocomplete/Autocomplete.tsx +160 -41
- package/src/components/badge/Badge.test.tsx +35 -0
- package/src/components/badge/Badge.tsx +16 -4
- package/src/components/breadcrumb/Breadcrumb.test.tsx +16 -0
- package/src/components/breadcrumb/Breadcrumb.tsx +10 -5
- package/src/components/button/Button.test.tsx +67 -0
- package/src/components/button/Button.tsx +37 -3
- package/src/components/button-group/ButtonGroup.test.tsx +6 -8
- package/src/components/button-group/ButtonGroup.tsx +17 -9
- package/src/components/card/Card.test.tsx +14 -0
- package/src/components/card/Card.tsx +15 -8
- package/src/components/confirm-dialog/ConfirmDialog.test.tsx +46 -0
- package/src/components/confirm-dialog/ConfirmDialog.tsx +86 -0
- package/src/components/confirm-dialog/index.ts +1 -0
- package/src/components/data-table/DataTable.test.tsx +92 -0
- package/src/components/data-table/DataTable.tsx +98 -7
- package/src/components/date-picker/DatePicker.test.tsx +30 -0
- package/src/components/date-picker/DatePicker.tsx +57 -0
- package/src/components/date-picker/index.ts +1 -0
- package/src/components/dialog/Dialog.test.tsx +71 -1
- package/src/components/dialog/Dialog.tsx +116 -23
- package/src/components/dialog/index.ts +1 -2
- package/src/components/drawer/Drawer.test.tsx +59 -0
- package/src/components/drawer/Drawer.tsx +49 -8
- package/src/components/empty-state/EmptyState.test.tsx +30 -0
- package/src/components/empty-state/EmptyState.tsx +48 -0
- package/src/components/empty-state/index.ts +1 -0
- package/src/components/file-upload/FileUpload.test.tsx +43 -0
- package/src/components/file-upload/FileUpload.tsx +143 -0
- package/src/components/file-upload/index.ts +1 -0
- package/src/components/filter-bar/FilterBar.test.tsx +32 -0
- package/src/components/filter-bar/FilterBar.tsx +71 -0
- package/src/components/filter-bar/index.ts +1 -0
- package/src/components/input/Input.tsx +1 -0
- package/src/components/input-group/InputGroup.test.tsx +6 -3
- package/src/components/input-group/InputGroup.tsx +9 -6
- package/src/components/link/Link.test.tsx +60 -0
- package/src/components/link/Link.tsx +85 -0
- package/src/components/link/index.ts +1 -0
- package/src/components/menu/Menu.test.tsx +21 -0
- package/src/components/menu/Menu.tsx +8 -3
- package/src/components/metric-card/MetricCard.test.tsx +28 -0
- package/src/components/metric-card/MetricCard.tsx +54 -0
- package/src/components/metric-card/index.ts +1 -0
- package/src/components/page-header/PageHeader.test.tsx +48 -0
- package/src/components/page-header/PageHeader.tsx +53 -0
- package/src/components/page-header/index.ts +1 -0
- package/src/components/pagination/Pagination.test.tsx +33 -0
- package/src/components/pagination/Pagination.tsx +69 -18
- package/src/components/password-input/PasswordInput.test.tsx +29 -0
- package/src/components/password-input/PasswordInput.tsx +41 -0
- package/src/components/password-input/index.ts +1 -0
- package/src/components/prose/Prose.test.tsx +35 -0
- package/src/components/prose/Prose.tsx +61 -0
- package/src/components/prose/index.ts +1 -0
- package/src/components/search/Search.test.tsx +16 -0
- package/src/components/search/Search.tsx +11 -2
- package/src/components/section-heading/SectionHeading.test.tsx +32 -0
- package/src/components/section-heading/SectionHeading.tsx +54 -0
- package/src/components/section-heading/index.ts +1 -0
- package/src/components/select/Select.test.tsx +40 -1
- package/src/components/select/Select.tsx +54 -14
- package/src/components/select/index.ts +1 -1
- package/src/components/select-menu/SelectMenu.test.tsx +105 -0
- package/src/components/select-menu/SelectMenu.tsx +368 -0
- package/src/components/select-menu/index.ts +1 -0
- package/src/components/site-footer/SiteFooter.test.tsx +30 -0
- package/src/components/site-footer/SiteFooter.tsx +79 -0
- package/src/components/site-footer/index.ts +1 -0
- package/src/components/site-header/SiteHeader.test.tsx +53 -0
- package/src/components/site-header/SiteHeader.tsx +124 -0
- package/src/components/site-header/index.ts +1 -0
- package/src/components/stepper/Stepper.test.tsx +35 -0
- package/src/components/stepper/Stepper.tsx +91 -0
- package/src/components/stepper/index.ts +1 -0
- package/src/components/switch/Switch.test.tsx +10 -0
- package/src/components/switch/Switch.tsx +8 -3
- package/src/components/table-card/TableCard.test.tsx +59 -0
- package/src/components/table-card/TableCard.tsx +48 -0
- package/src/components/table-card/index.ts +1 -0
- package/src/components/table-of-contents/TableOfContents.test.tsx +31 -0
- package/src/components/table-of-contents/TableOfContents.tsx +100 -0
- package/src/components/table-of-contents/index.ts +1 -0
- package/src/components/textarea/Textarea.tsx +1 -0
- package/src/components/time-picker/TimePicker.test.tsx +30 -0
- package/src/components/time-picker/TimePicker.tsx +56 -0
- package/src/components/time-picker/index.ts +1 -0
- package/src/components/timeline/Timeline.test.tsx +26 -0
- package/src/components/timeline/Timeline.tsx +53 -0
- package/src/components/timeline/index.ts +1 -0
- package/src/components/toast/Toast.test.tsx +5 -0
- package/src/components/toast/Toast.tsx +2 -16
- package/src/components/toast/Toaster.test.tsx +84 -0
- package/src/components/toast/Toaster.tsx +116 -0
- package/src/components/toast/index.ts +4 -0
- package/src/components/toast/toast-store.ts +117 -0
- package/src/index.ts +21 -0
- package/src/manifests/app-shell.manifest.json +206 -0
- package/src/manifests/auth-layout.manifest.json +99 -0
- package/src/manifests/autocomplete.manifest.json +53 -5
- package/src/manifests/badge.manifest.json +20 -3
- package/src/manifests/breadcrumb.manifest.json +6 -0
- package/src/manifests/button.manifest.json +20 -2
- package/src/manifests/card.manifest.json +53 -6
- package/src/manifests/confirm-dialog.manifest.json +132 -0
- package/src/manifests/data-table.manifest.json +50 -0
- package/src/manifests/date-picker.manifest.json +87 -0
- package/src/manifests/dialog.manifest.json +56 -4
- package/src/manifests/drawer.manifest.json +25 -4
- package/src/manifests/empty-state.manifest.json +108 -0
- package/src/manifests/file-upload.manifest.json +103 -0
- package/src/manifests/filter-bar.manifest.json +100 -0
- package/src/manifests/link.manifest.json +106 -0
- package/src/manifests/menu.manifest.json +13 -1
- package/src/manifests/metric-card.manifest.json +105 -0
- package/src/manifests/page-header.manifest.json +124 -0
- package/src/manifests/pagination.manifest.json +68 -34
- package/src/manifests/password-input.manifest.json +75 -0
- package/src/manifests/prose.manifest.json +75 -0
- package/src/manifests/search.manifest.json +41 -9
- package/src/manifests/section-heading.manifest.json +108 -0
- package/src/manifests/select-menu.manifest.json +142 -0
- package/src/manifests/select.manifest.json +55 -12
- package/src/manifests/site-footer.manifest.json +94 -0
- package/src/manifests/site-header.manifest.json +130 -0
- package/src/manifests/stepper.manifest.json +95 -0
- package/src/manifests/table-card.manifest.json +123 -0
- package/src/manifests/table-of-contents.manifest.json +87 -0
- package/src/manifests/time-picker.manifest.json +86 -0
- package/src/manifests/timeline.manifest.json +69 -0
- package/src/manifests/toast.manifest.json +101 -25
- package/src/test/tailwind-v4.test.ts +103 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "app-shell",
|
|
3
|
+
"name": "AppShell",
|
|
4
|
+
"tier": "organism",
|
|
5
|
+
"description": "Application frame with a sectioned sidebar, sticky header and scrolling main; the sidebar becomes a left Drawer on small screens.",
|
|
6
|
+
"designIntent": "Every dashboard hand-rolls the same shell: rail, header, scroll owner, and a mobile nav. AppShell owns the structure and responsive switch while staying presentational — you pass the active route and a router link component, so it works with React Router, Next Link, or plain anchors.",
|
|
7
|
+
"props": [
|
|
8
|
+
{
|
|
9
|
+
"name": "sidebar",
|
|
10
|
+
"type": "ReactNode",
|
|
11
|
+
"required": false,
|
|
12
|
+
"description": "Desktop rail content; also rendered inside the mobile drawer (AppShell)."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "header",
|
|
16
|
+
"type": "ReactNode",
|
|
17
|
+
"required": false,
|
|
18
|
+
"description": "Sticky top bar content (AppShell)."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "hideMobileMenu",
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"required": false,
|
|
24
|
+
"defaultValue": "false",
|
|
25
|
+
"description": "Hide the built-in burger button when the header owns navigation (AppShell)."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "sidebarWidth",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"required": false,
|
|
31
|
+
"defaultValue": "w-64",
|
|
32
|
+
"description": "Tailwind width class for the desktop rail (AppShell)."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "sections",
|
|
36
|
+
"type": "{ title?: string; items: SidebarItem[] }[]",
|
|
37
|
+
"required": true,
|
|
38
|
+
"description": "Grouped navigation items (Sidebar)."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "heading",
|
|
42
|
+
"type": "ReactNode",
|
|
43
|
+
"required": false,
|
|
44
|
+
"description": "Brand/mark at the top of the rail (Sidebar)."
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "footer",
|
|
48
|
+
"type": "ReactNode",
|
|
49
|
+
"required": false,
|
|
50
|
+
"description": "Bottom area of the rail (Sidebar)."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "activeHref",
|
|
54
|
+
"type": "string",
|
|
55
|
+
"required": false,
|
|
56
|
+
"description": "Current route; matching items get aria-current=page (Sidebar)."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "linkComponent",
|
|
60
|
+
"type": "React.ElementType",
|
|
61
|
+
"required": false,
|
|
62
|
+
"defaultValue": "a",
|
|
63
|
+
"description": "Router link component (react-router Link, Next Link) (Sidebar)."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "label",
|
|
67
|
+
"type": "string",
|
|
68
|
+
"required": false,
|
|
69
|
+
"defaultValue": "Primary",
|
|
70
|
+
"description": "Accessible name of the nav landmark (Sidebar)."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "children",
|
|
74
|
+
"type": "SidebarItem[]",
|
|
75
|
+
"required": false,
|
|
76
|
+
"description": "Nested items — renders a collapsible group with aria-expanded (SidebarItem)."
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "collapsible",
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"required": false,
|
|
82
|
+
"defaultValue": "false",
|
|
83
|
+
"description": "Shows the collapse/expand control (Sidebar)."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "defaultCollapsed",
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"required": false,
|
|
89
|
+
"defaultValue": "false",
|
|
90
|
+
"description": "Initial collapsed state (Sidebar)."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "collapsed",
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"required": false,
|
|
96
|
+
"description": "Controlled collapsed state (Sidebar)."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "onCollapsedChange",
|
|
100
|
+
"type": "(collapsed: boolean) => void",
|
|
101
|
+
"required": false,
|
|
102
|
+
"description": "Fires when the rail collapses/expands (Sidebar)."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "defaultExpanded",
|
|
106
|
+
"type": "string[]",
|
|
107
|
+
"required": false,
|
|
108
|
+
"description": "SidebarItem hrefs of groups open initially (Sidebar)."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "mobileBreakpoint",
|
|
112
|
+
"type": "'sm' | 'md' | 'lg'",
|
|
113
|
+
"required": false,
|
|
114
|
+
"defaultValue": "md",
|
|
115
|
+
"description": "Breakpoint where the rail becomes a drawer (AppShell).",
|
|
116
|
+
"enum": [
|
|
117
|
+
"sm",
|
|
118
|
+
"md",
|
|
119
|
+
"lg"
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"examples": [
|
|
124
|
+
{
|
|
125
|
+
"title": "Dashboard shell",
|
|
126
|
+
"code": "import { AppShell, Sidebar } from '@slipstream-ui/core';\n\n<AppShell\n header={<h1 className=\"text-sm font-semibold\">Studio</h1>}\n sidebar={\n <Sidebar\n activeHref={pathname}\n linkComponent={RouterLink}\n heading={<strong>Acme</strong>}\n sections={[\n { title: 'Workspace', items: [{ href: '/dashboard', label: 'Dashboard' }, { href: '/classes', label: 'Classes', badge: 4 }] },\n ]}\n />\n }\n>\n <Page />\n</AppShell>",
|
|
127
|
+
"description": "Router-agnostic: pass your Link component and the current path."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"title": "Header only",
|
|
131
|
+
"code": "<AppShell header={<TopBar />}>\n <Page />\n</AppShell>",
|
|
132
|
+
"description": "Skip the sidebar when the product is a single surface."
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"antiPatterns": [
|
|
136
|
+
{
|
|
137
|
+
"title": "Don't nest scroll containers",
|
|
138
|
+
"explanation": "AppShell's main is the scroll owner. Adding h-screen/overflow-hidden wrappers inside breaks sticky headers and mobile drawer focus.",
|
|
139
|
+
"example": "// Avoid\n<AppShell><div className=\"h-screen overflow-hidden\">…</div></AppShell>\n\n// Prefer\n<AppShell><Page /></AppShell>"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"title": "Don't hardcode anchors for SPA routes",
|
|
143
|
+
"explanation": "Plain <a href> triggers full page loads in client-side routers. Pass your router's Link via linkComponent.",
|
|
144
|
+
"example": "// Avoid (full reload in React Router)\n<Sidebar sections={sections} />\n\n// Prefer\n<Sidebar sections={sections} linkComponent={Link} />"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"accessibility": [
|
|
148
|
+
{
|
|
149
|
+
"feature": "Nav landmark",
|
|
150
|
+
"implementation": "Sidebar renders nav with an accessible name (label prop)",
|
|
151
|
+
"userRequirements": "Keep one primary nav per page; use other labels for secondary rails"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"feature": "Current route",
|
|
155
|
+
"implementation": "aria-current=page on the active item",
|
|
156
|
+
"userRequirements": "Pass activeHref (or item.active) so the state is announced"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"feature": "Mobile drawer",
|
|
160
|
+
"implementation": "The rail becomes a Drawer with focus trap, Escape, focus restore and a labelled dialog",
|
|
161
|
+
"userRequirements": "Don't duplicate the nav in two places at once"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"contentGuidelines": [
|
|
165
|
+
{
|
|
166
|
+
"contentType": "Item labels",
|
|
167
|
+
"guidelines": [
|
|
168
|
+
"Use nouns for destinations",
|
|
169
|
+
"Keep to 1-2 words",
|
|
170
|
+
"Group by workflow, not by component type"
|
|
171
|
+
],
|
|
172
|
+
"goodExamples": [
|
|
173
|
+
"Dashboard",
|
|
174
|
+
"Classes",
|
|
175
|
+
"Settings"
|
|
176
|
+
],
|
|
177
|
+
"badExamples": [
|
|
178
|
+
"Click here",
|
|
179
|
+
"List page component"
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"compositionRules": [
|
|
184
|
+
{
|
|
185
|
+
"component": "Drawer",
|
|
186
|
+
"relationship": "AppShell mounts the mobile navigation Drawer for you when a sidebar is provided",
|
|
187
|
+
"example": "<AppShell sidebar={<Sidebar sections={sections} />}>…</AppShell>"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"component": "Button",
|
|
191
|
+
"relationship": "Header actions live in the header slot",
|
|
192
|
+
"example": "<AppShell header={<Button>New</Button>}>…</AppShell>"
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"relatedComponents": [
|
|
196
|
+
"Drawer",
|
|
197
|
+
"Button",
|
|
198
|
+
"Breadcrumb",
|
|
199
|
+
"Menu"
|
|
200
|
+
],
|
|
201
|
+
"package": "@slipstream-ui/core",
|
|
202
|
+
"importPath": "@slipstream-ui/core",
|
|
203
|
+
"version": "0.1.0",
|
|
204
|
+
"sourceDir": "app-shell",
|
|
205
|
+
"exportName": "AppShell"
|
|
206
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "auth-layout",
|
|
3
|
+
"name": "AuthLayout",
|
|
4
|
+
"tier": "organism",
|
|
5
|
+
"description": "Centered authentication surface: brand, title/description, form card and footer, with size presets.",
|
|
6
|
+
"designIntent": "Sign-in, sign-up, reset and verify screens should look identical. AuthLayout owns the centered card, brand slot and footer so auth pages only supply the form.",
|
|
7
|
+
"props": [
|
|
8
|
+
{
|
|
9
|
+
"name": "title",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": true,
|
|
12
|
+
"description": "Card heading (h1)."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "description",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"required": false,
|
|
18
|
+
"description": "Supporting line under the heading."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "brand",
|
|
22
|
+
"type": "ReactNode",
|
|
23
|
+
"required": false,
|
|
24
|
+
"description": "Mark rendered above the card."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "footer",
|
|
28
|
+
"type": "ReactNode",
|
|
29
|
+
"required": false,
|
|
30
|
+
"description": "Links/legal copy under the card."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "size",
|
|
34
|
+
"type": "'sm' | 'md' | 'lg'",
|
|
35
|
+
"required": false,
|
|
36
|
+
"defaultValue": "md",
|
|
37
|
+
"description": "Card width preset.",
|
|
38
|
+
"enum": [
|
|
39
|
+
"sm",
|
|
40
|
+
"md",
|
|
41
|
+
"lg"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"examples": [
|
|
46
|
+
{
|
|
47
|
+
"title": "Sign in",
|
|
48
|
+
"code": "<AuthLayout\n title=\"Sign in\"\n description=\"Welcome back.\"\n brand={<Logo />}\n footer={<a href=\"/signup\">Create account</a>}\n>\n <SignInForm />\n</AuthLayout>",
|
|
49
|
+
"description": "Form lives inside the card."
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"antiPatterns": [
|
|
53
|
+
{
|
|
54
|
+
"title": "Don't nest another full-height page",
|
|
55
|
+
"explanation": "AuthLayout already owns min-h-screen centering.",
|
|
56
|
+
"example": "// Avoid\n<div className=\"min-h-screen\"><AuthLayout … /></div>"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"accessibility": [
|
|
60
|
+
{
|
|
61
|
+
"feature": "One h1",
|
|
62
|
+
"implementation": "Renders the page heading",
|
|
63
|
+
"userRequirements": "Don't add another h1 inside the form"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"contentGuidelines": [
|
|
67
|
+
{
|
|
68
|
+
"contentType": "Titles",
|
|
69
|
+
"guidelines": [
|
|
70
|
+
"Action-oriented",
|
|
71
|
+
"Sentence case"
|
|
72
|
+
],
|
|
73
|
+
"goodExamples": [
|
|
74
|
+
"Sign in",
|
|
75
|
+
"Create your account"
|
|
76
|
+
],
|
|
77
|
+
"badExamples": [
|
|
78
|
+
"Login page"
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"compositionRules": [
|
|
83
|
+
{
|
|
84
|
+
"component": "Form",
|
|
85
|
+
"relationship": "Place the Form inside children",
|
|
86
|
+
"example": "<AuthLayout title=\"Sign in\"><Form onSubmit={…}>…</Form></AuthLayout>"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"relatedComponents": [
|
|
90
|
+
"Form",
|
|
91
|
+
"PasswordInput",
|
|
92
|
+
"Button"
|
|
93
|
+
],
|
|
94
|
+
"package": "@slipstream-ui/core",
|
|
95
|
+
"importPath": "@slipstream-ui/core",
|
|
96
|
+
"version": "0.1.0",
|
|
97
|
+
"sourceDir": "auth-layout",
|
|
98
|
+
"exportName": "AuthLayout"
|
|
99
|
+
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"id": "autocomplete",
|
|
3
3
|
"name": "Autocomplete",
|
|
4
4
|
"tier": "molecule",
|
|
5
|
-
"description": "
|
|
6
|
-
"designIntent": "
|
|
5
|
+
"description": "Free-text type-ahead input with a portalled listbox: static or async options, grouped headings, descriptions and custom rows.",
|
|
6
|
+
"designIntent": "Free text stays first-class: any value may be typed, while matching options accelerate entry. Async sources are debounced with stale-response guards; grouped headings and custom rows cover searchable-select patterns; Escape/arrow keys follow the combobox model.",
|
|
7
7
|
"props": [
|
|
8
8
|
{
|
|
9
9
|
"name": "suggestions",
|
|
10
10
|
"type": "string[]",
|
|
11
|
-
"required":
|
|
12
|
-
"description": "
|
|
11
|
+
"required": false,
|
|
12
|
+
"description": "Deprecated — use options.",
|
|
13
13
|
"examples": [
|
|
14
14
|
"['react', 'remix', 'astro']"
|
|
15
15
|
]
|
|
@@ -43,13 +43,61 @@
|
|
|
43
43
|
"name": "emptyText",
|
|
44
44
|
"type": "string",
|
|
45
45
|
"required": false,
|
|
46
|
-
"description": "Shown when no
|
|
46
|
+
"description": "Shown when no option matches.",
|
|
47
47
|
"examples": [
|
|
48
48
|
"'No matches — press Enter to use your text'"
|
|
49
49
|
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "options",
|
|
53
|
+
"type": "Array<string | AutocompleteOption>",
|
|
54
|
+
"required": false,
|
|
55
|
+
"description": "Static options; strings or { value, label?, group?, description? }."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "loadOptions",
|
|
59
|
+
"type": "(query: string) => Promise<Array<string | AutocompleteOption>>",
|
|
60
|
+
"required": false,
|
|
61
|
+
"description": "Async option source; debounced and guarded against stale responses."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "renderOption",
|
|
65
|
+
"type": "(option, state: { active: boolean }) => ReactNode",
|
|
66
|
+
"required": false,
|
|
67
|
+
"description": "Custom row renderer."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "clearable",
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"required": false,
|
|
73
|
+
"defaultValue": "false",
|
|
74
|
+
"description": "Shows a clear button once the field has text."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "loadingText",
|
|
78
|
+
"type": "string",
|
|
79
|
+
"required": false,
|
|
80
|
+
"description": "Shown while async options load."
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "debounceMs",
|
|
84
|
+
"type": "number",
|
|
85
|
+
"required": false,
|
|
86
|
+
"defaultValue": "200",
|
|
87
|
+
"description": "Debounce for loadOptions in ms."
|
|
50
88
|
}
|
|
51
89
|
],
|
|
52
90
|
"examples": [
|
|
91
|
+
{
|
|
92
|
+
"title": "Async search",
|
|
93
|
+
"code": "<Autocomplete\n aria-label=\"Search people\"\n clearable\n loadOptions={async (query) => searchPeople(query)}\n/>",
|
|
94
|
+
"description": "Debounced async source with stale-response guard and clear."
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"title": "Grouped options with descriptions",
|
|
98
|
+
"code": "<Autocomplete\n aria-label=\"Search\"\n options={[\n { value: 'ada', label: 'Ada Lovelace', group: 'People', description: 'Mathematician' },\n { value: 'rust', label: 'Rust', group: 'Languages' },\n ]}\n/>",
|
|
99
|
+
"description": "Section headings plus a supporting line per row."
|
|
100
|
+
},
|
|
53
101
|
{
|
|
54
102
|
"title": "Controlled form field",
|
|
55
103
|
"code": "const [framework, setFramework] = useState('');\n\n<FormField id=\"framework\" label=\"Primary framework\" hint=\"Type or pick a suggestion\">\n <Autocomplete\n suggestions={['react', 'remix', 'next', 'vite']}\n value={framework}\n onValueChange={setFramework}\n name=\"framework\"\n autoComplete=\"off\"\n />\n</FormField>",
|
|
@@ -7,15 +7,20 @@
|
|
|
7
7
|
"props": [
|
|
8
8
|
{
|
|
9
9
|
"name": "variant",
|
|
10
|
-
"type": "'default' | 'secondary' | 'destructive' | 'outline'",
|
|
10
|
+
"type": "'default' | 'secondary' | 'destructive' | 'outline' | 'primary' | 'danger' | 'success' | 'warning' | 'info'",
|
|
11
11
|
"defaultValue": "default",
|
|
12
12
|
"required": false,
|
|
13
|
-
"description": "
|
|
13
|
+
"description": "Semantic surface; primary/danger are aliases for default/destructive.",
|
|
14
14
|
"enum": [
|
|
15
15
|
"default",
|
|
16
16
|
"secondary",
|
|
17
17
|
"destructive",
|
|
18
|
-
"outline"
|
|
18
|
+
"outline",
|
|
19
|
+
"primary",
|
|
20
|
+
"danger",
|
|
21
|
+
"success",
|
|
22
|
+
"warning",
|
|
23
|
+
"info"
|
|
19
24
|
],
|
|
20
25
|
"examples": [
|
|
21
26
|
"default",
|
|
@@ -40,9 +45,21 @@
|
|
|
40
45
|
"type": "string",
|
|
41
46
|
"required": false,
|
|
42
47
|
"description": "Additional CSS classes to apply"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "asChild",
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"required": false,
|
|
53
|
+
"defaultValue": "false",
|
|
54
|
+
"description": "Render the child element with badge styling."
|
|
43
55
|
}
|
|
44
56
|
],
|
|
45
57
|
"examples": [
|
|
58
|
+
{
|
|
59
|
+
"title": "Tag linking to a filter",
|
|
60
|
+
"code": "<Badge asChild>\n <Link href=\"/tags/react\">React</Link>\n</Badge>",
|
|
61
|
+
"description": "Tag that navigates."
|
|
62
|
+
},
|
|
46
63
|
{
|
|
47
64
|
"title": "Default badge",
|
|
48
65
|
"code": "<Badge>New</Badge>",
|
|
@@ -29,6 +29,12 @@
|
|
|
29
29
|
"type": "(item: BreadcrumbItem, index: number) => void",
|
|
30
30
|
"required": false,
|
|
31
31
|
"description": "Receives every link click with default navigation prevented — route programmatically."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "linkComponent",
|
|
35
|
+
"type": "React.ElementType",
|
|
36
|
+
"required": false,
|
|
37
|
+
"description": "Custom link element for routers (preserves prefetch/modified clicks)."
|
|
32
38
|
}
|
|
33
39
|
],
|
|
34
40
|
"examples": [
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"props": [
|
|
8
8
|
{
|
|
9
9
|
"name": "variant",
|
|
10
|
-
"type": "'default' | 'destructive' | 'success' | 'warning' | 'info' | 'outline' | 'secondary' | 'ghost' | 'link'",
|
|
10
|
+
"type": "'default' | 'destructive' | 'success' | 'warning' | 'info' | 'outline' | 'outline-destructive' | 'outline-success' | 'outline-warning' | 'outline-info' | 'secondary' | 'ghost' | 'link'",
|
|
11
11
|
"defaultValue": "default",
|
|
12
12
|
"required": false,
|
|
13
13
|
"description": "Visual style variant of the button",
|
|
@@ -20,7 +20,11 @@
|
|
|
20
20
|
"link",
|
|
21
21
|
"success",
|
|
22
22
|
"warning",
|
|
23
|
-
"info"
|
|
23
|
+
"info",
|
|
24
|
+
"outline-destructive",
|
|
25
|
+
"outline-success",
|
|
26
|
+
"outline-warning",
|
|
27
|
+
"outline-info"
|
|
24
28
|
],
|
|
25
29
|
"examples": [
|
|
26
30
|
"default",
|
|
@@ -102,6 +106,20 @@
|
|
|
102
106
|
"button",
|
|
103
107
|
"submit"
|
|
104
108
|
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "loading",
|
|
112
|
+
"type": "boolean",
|
|
113
|
+
"required": false,
|
|
114
|
+
"defaultValue": "false",
|
|
115
|
+
"description": "Shows a spinner, disables the button and sets aria-busy."
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "loadingLabel",
|
|
119
|
+
"type": "string",
|
|
120
|
+
"required": false,
|
|
121
|
+
"defaultValue": "'Loading'",
|
|
122
|
+
"description": "Screen-reader text while loading; localize this for non-English apps."
|
|
105
123
|
}
|
|
106
124
|
],
|
|
107
125
|
"examples": [
|
|
@@ -5,10 +5,32 @@
|
|
|
5
5
|
"description": "A content container with header, body, and footer sections for grouping related information",
|
|
6
6
|
"designIntent": "Card groups related content into a scannable container. Use it for settings panels, feature highlights, user profiles, and any content that benefits from visual grouping.",
|
|
7
7
|
"props": [
|
|
8
|
-
{
|
|
9
|
-
|
|
8
|
+
{
|
|
9
|
+
"name": "children",
|
|
10
|
+
"type": "ReactNode",
|
|
11
|
+
"required": true,
|
|
12
|
+
"description": "Card sub-components (CardHeader, CardContent, CardFooter)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "className",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"required": false,
|
|
18
|
+
"description": "Additional CSS classes to apply"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "asChild",
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"required": false,
|
|
24
|
+
"defaultValue": "false",
|
|
25
|
+
"description": "Render the child element (router Link, <a>) with card styling instead of a div."
|
|
26
|
+
}
|
|
10
27
|
],
|
|
11
28
|
"examples": [
|
|
29
|
+
{
|
|
30
|
+
"title": "Card as a link",
|
|
31
|
+
"code": "<Card asChild>\n <Link href=\"/writing/hello\">\n <CardHeader><CardTitle>Hello</CardTitle></CardHeader>\n </Link>\n</Card>",
|
|
32
|
+
"description": "Whole card becomes a semantic link without losing styling."
|
|
33
|
+
},
|
|
12
34
|
{
|
|
13
35
|
"title": "Basic card",
|
|
14
36
|
"code": "<Card>\n <CardHeader>\n <CardTitle>Profile</CardTitle>\n <CardDescription>Manage your account settings</CardDescription>\n </CardHeader>\n <CardContent>Form fields here</CardContent>\n <CardFooter>\n <Button>Save</Button>\n </CardFooter>\n</Card>",
|
|
@@ -28,15 +50,40 @@
|
|
|
28
50
|
}
|
|
29
51
|
],
|
|
30
52
|
"accessibility": [
|
|
31
|
-
{
|
|
53
|
+
{
|
|
54
|
+
"feature": "Heading hierarchy",
|
|
55
|
+
"implementation": "CardTitle renders as h3",
|
|
56
|
+
"userRequirements": "Maintain logical heading order in your page"
|
|
57
|
+
}
|
|
32
58
|
],
|
|
33
59
|
"contentGuidelines": [
|
|
34
|
-
{
|
|
60
|
+
{
|
|
61
|
+
"contentType": "Card titles",
|
|
62
|
+
"guidelines": [
|
|
63
|
+
"Keep titles short (2-5 words)",
|
|
64
|
+
"Use sentence case"
|
|
65
|
+
],
|
|
66
|
+
"goodExamples": [
|
|
67
|
+
"Profile settings",
|
|
68
|
+
"Billing overview"
|
|
69
|
+
],
|
|
70
|
+
"badExamples": [
|
|
71
|
+
"Card title",
|
|
72
|
+
"Section"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
35
75
|
],
|
|
36
76
|
"compositionRules": [
|
|
37
|
-
{
|
|
77
|
+
{
|
|
78
|
+
"component": "Button",
|
|
79
|
+
"relationship": "Place primary actions in CardFooter",
|
|
80
|
+
"example": "<CardFooter><Button>Save</Button></CardFooter>"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"relatedComponents": [
|
|
84
|
+
"Separator",
|
|
85
|
+
"Tabs"
|
|
38
86
|
],
|
|
39
|
-
"relatedComponents": ["Separator", "Tabs"],
|
|
40
87
|
"package": "@slipstream-ui/core",
|
|
41
88
|
"importPath": "@slipstream-ui/core",
|
|
42
89
|
"version": "0.1.0",
|