@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,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "password-input",
|
|
3
|
+
"name": "PasswordInput",
|
|
4
|
+
"tier": "molecule",
|
|
5
|
+
"description": "Password field with an accessible show/hide toggle (aria-pressed), built on Input.",
|
|
6
|
+
"designIntent": "Users mistype passwords; a reveal toggle reduces failed sign-ins. The toggle must be a real button with a pressed state and a proper label so it is not a mystery control.",
|
|
7
|
+
"props": [
|
|
8
|
+
{
|
|
9
|
+
"name": "showLabel",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": false,
|
|
12
|
+
"defaultValue": "Show password",
|
|
13
|
+
"description": "Accessible label while hidden."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "hideLabel",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"required": false,
|
|
19
|
+
"defaultValue": "Hide password",
|
|
20
|
+
"description": "Accessible label while visible."
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"examples": [
|
|
24
|
+
{
|
|
25
|
+
"title": "Sign-in field",
|
|
26
|
+
"code": "<PasswordInput aria-label=\"Password\" autoComplete=\"current-password\" />",
|
|
27
|
+
"description": "Input props pass through."
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"antiPatterns": [
|
|
31
|
+
{
|
|
32
|
+
"title": "Don't reveal by default",
|
|
33
|
+
"explanation": "Start masked; reveal is user-initiated.",
|
|
34
|
+
"example": "// Avoid: type=\"text\" for a password\n<Input type=\"text\" aria-label=\"Password\" />\n\n// Prefer\n<PasswordInput aria-label=\"Password\" />"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"accessibility": [
|
|
38
|
+
{
|
|
39
|
+
"feature": "Toggle semantics",
|
|
40
|
+
"implementation": "Button with aria-pressed and Show/Hide labels",
|
|
41
|
+
"userRequirements": "Keep both labels descriptive"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"contentGuidelines": [
|
|
45
|
+
{
|
|
46
|
+
"contentType": "Labels",
|
|
47
|
+
"guidelines": [
|
|
48
|
+
"Verb-first toggle labels"
|
|
49
|
+
],
|
|
50
|
+
"goodExamples": [
|
|
51
|
+
"Show password"
|
|
52
|
+
],
|
|
53
|
+
"badExamples": [
|
|
54
|
+
"Eye"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"compositionRules": [
|
|
59
|
+
{
|
|
60
|
+
"component": "FormField",
|
|
61
|
+
"relationship": "Wrap for label/hint/error wiring",
|
|
62
|
+
"example": "<FormField id=\"pw\" label=\"Password\"><PasswordInput /></FormField>"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"relatedComponents": [
|
|
66
|
+
"Input",
|
|
67
|
+
"FormField",
|
|
68
|
+
"InputGroup"
|
|
69
|
+
],
|
|
70
|
+
"package": "@slipstream-ui/core",
|
|
71
|
+
"importPath": "@slipstream-ui/core",
|
|
72
|
+
"version": "0.1.0",
|
|
73
|
+
"sourceDir": "password-input",
|
|
74
|
+
"exportName": "PasswordInput"
|
|
75
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "prose",
|
|
3
|
+
"name": "Prose",
|
|
4
|
+
"tier": "molecule",
|
|
5
|
+
"package": "@slipstream-ui/core",
|
|
6
|
+
"importPath": "@slipstream-ui/core",
|
|
7
|
+
"version": "0.1.0",
|
|
8
|
+
"sourceDir": "prose",
|
|
9
|
+
"exportName": "Prose",
|
|
10
|
+
"description": "Self-contained long-form typography for rendered markdown/MDX: headings, links, lists, code, tables, quotes and figures.",
|
|
11
|
+
"designIntent": "Content sites need consistent article typography without depending on the Tailwind typography plugin. Prose styles rendered HTML via child selectors, so any remark/MDX pipeline can drop output inside.",
|
|
12
|
+
"props": [
|
|
13
|
+
{
|
|
14
|
+
"name": "size",
|
|
15
|
+
"type": "'sm' | 'md' | 'lg'",
|
|
16
|
+
"required": false,
|
|
17
|
+
"defaultValue": "md",
|
|
18
|
+
"description": "Type scale for body and headings.",
|
|
19
|
+
"enum": [
|
|
20
|
+
"sm",
|
|
21
|
+
"md",
|
|
22
|
+
"lg"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"examples": [
|
|
27
|
+
{
|
|
28
|
+
"title": "Article body",
|
|
29
|
+
"code": "<Prose size=\"md\">\n {renderedMarkdown}\n</Prose>",
|
|
30
|
+
"description": "Wrap MDX/remark output; keep Shiki/KaTeX as-is."
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"antiPatterns": [
|
|
34
|
+
{
|
|
35
|
+
"title": "Don't use prose for app UI",
|
|
36
|
+
"explanation": "Prose targets article content; forms and dashboards use Text/Heading.",
|
|
37
|
+
"example": "// Avoid\n<Prose><Button /></Prose>"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"accessibility": [
|
|
41
|
+
{
|
|
42
|
+
"feature": "Heading anchors",
|
|
43
|
+
"implementation": "scroll-mt offsets headings under sticky headers",
|
|
44
|
+
"userRequirements": "Generate heading ids in your markdown pipeline"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"contentGuidelines": [
|
|
48
|
+
{
|
|
49
|
+
"contentType": "Article copy",
|
|
50
|
+
"guidelines": [
|
|
51
|
+
"Sentence case headings",
|
|
52
|
+
"Short paragraphs"
|
|
53
|
+
],
|
|
54
|
+
"goodExamples": [
|
|
55
|
+
"## Install the package"
|
|
56
|
+
],
|
|
57
|
+
"badExamples": [
|
|
58
|
+
"## CLICK HERE"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"compositionRules": [
|
|
63
|
+
{
|
|
64
|
+
"component": "TableOfContents",
|
|
65
|
+
"relationship": "Pair long articles with a TOC + useScrollSpy",
|
|
66
|
+
"example": "<Prose>{content}</Prose><TableOfContents headings={headings} />"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"relatedComponents": [
|
|
70
|
+
"TableOfContents",
|
|
71
|
+
"Heading",
|
|
72
|
+
"Text",
|
|
73
|
+
"CodeBlock"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
@@ -10,14 +10,18 @@
|
|
|
10
10
|
"type": "SearchOption[]",
|
|
11
11
|
"required": true,
|
|
12
12
|
"description": "The full option set; filtered client-side as the user types.",
|
|
13
|
-
"examples": [
|
|
13
|
+
"examples": [
|
|
14
|
+
"[{ value: 'react', label: 'React', keywords: 'ui framework' }]"
|
|
15
|
+
]
|
|
14
16
|
},
|
|
15
17
|
{
|
|
16
18
|
"name": "defaultValue",
|
|
17
19
|
"type": "string",
|
|
18
20
|
"required": false,
|
|
19
21
|
"description": "Initially selected option value (display starts on its label).",
|
|
20
|
-
"examples": [
|
|
22
|
+
"examples": [
|
|
23
|
+
"react"
|
|
24
|
+
]
|
|
21
25
|
},
|
|
22
26
|
{
|
|
23
27
|
"name": "onValueChange",
|
|
@@ -31,7 +35,9 @@
|
|
|
31
35
|
"required": false,
|
|
32
36
|
"description": "Input placeholder while no query is typed.",
|
|
33
37
|
"defaultValue": "'Search…'",
|
|
34
|
-
"examples": [
|
|
38
|
+
"examples": [
|
|
39
|
+
"'Search components…'"
|
|
40
|
+
]
|
|
35
41
|
},
|
|
36
42
|
{
|
|
37
43
|
"name": "emptyText",
|
|
@@ -39,7 +45,9 @@
|
|
|
39
45
|
"required": false,
|
|
40
46
|
"description": "Shown when no option matches the query.",
|
|
41
47
|
"defaultValue": "'No matching results'",
|
|
42
|
-
"examples": [
|
|
48
|
+
"examples": [
|
|
49
|
+
"'No people found'"
|
|
50
|
+
]
|
|
43
51
|
},
|
|
44
52
|
{
|
|
45
53
|
"name": "disabled",
|
|
@@ -47,7 +55,16 @@
|
|
|
47
55
|
"required": false,
|
|
48
56
|
"description": "Disables the input and the dropdown.",
|
|
49
57
|
"defaultValue": "false",
|
|
50
|
-
"examples": [
|
|
58
|
+
"examples": [
|
|
59
|
+
"true",
|
|
60
|
+
"false"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "value",
|
|
65
|
+
"type": "string | null",
|
|
66
|
+
"required": false,
|
|
67
|
+
"description": "Controlled selected value; display follows it (null clears)."
|
|
51
68
|
}
|
|
52
69
|
],
|
|
53
70
|
"examples": [
|
|
@@ -104,9 +121,19 @@
|
|
|
104
121
|
"contentGuidelines": [
|
|
105
122
|
{
|
|
106
123
|
"contentType": "Option labels",
|
|
107
|
-
"guidelines": [
|
|
108
|
-
|
|
109
|
-
|
|
124
|
+
"guidelines": [
|
|
125
|
+
"Show the primary identifying text",
|
|
126
|
+
"Use description for role/context",
|
|
127
|
+
"Keep labels unique or disambiguate with description"
|
|
128
|
+
],
|
|
129
|
+
"goodExamples": [
|
|
130
|
+
"Ada Lovelace — Design",
|
|
131
|
+
"prod-eu-west-1 (Frankfurt)"
|
|
132
|
+
],
|
|
133
|
+
"badExamples": [
|
|
134
|
+
"Ada",
|
|
135
|
+
"test"
|
|
136
|
+
]
|
|
110
137
|
}
|
|
111
138
|
],
|
|
112
139
|
"compositionRules": [
|
|
@@ -120,7 +147,12 @@
|
|
|
120
147
|
"relationship": "Choose Search for constrained picks; Autocomplete when free-form values must stay allowed"
|
|
121
148
|
}
|
|
122
149
|
],
|
|
123
|
-
"relatedComponents": [
|
|
150
|
+
"relatedComponents": [
|
|
151
|
+
"Autocomplete",
|
|
152
|
+
"Select",
|
|
153
|
+
"FormField",
|
|
154
|
+
"CommandPalette"
|
|
155
|
+
],
|
|
124
156
|
"package": "@slipstream-ui/core",
|
|
125
157
|
"importPath": "@slipstream-ui/core",
|
|
126
158
|
"version": "0.1.0",
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "section-heading",
|
|
3
|
+
"name": "SectionHeading",
|
|
4
|
+
"tier": "molecule",
|
|
5
|
+
"package": "@slipstream-ui/core",
|
|
6
|
+
"importPath": "@slipstream-ui/core",
|
|
7
|
+
"version": "0.1.0",
|
|
8
|
+
"sourceDir": "section-heading",
|
|
9
|
+
"exportName": "SectionHeading",
|
|
10
|
+
"description": "Section heading block: eyebrow, title (level 2-4), description and actions, with left/center alignment and three sizes.",
|
|
11
|
+
"designIntent": "Marketing and content pages repeat the same eyebrow/title/description/actions cluster for every section. SectionHeading standardizes it without claiming the page h1 (that is PageHeader's job).",
|
|
12
|
+
"props": [
|
|
13
|
+
{
|
|
14
|
+
"name": "title",
|
|
15
|
+
"type": "string",
|
|
16
|
+
"required": true,
|
|
17
|
+
"description": "Section title."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "description",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"required": false,
|
|
23
|
+
"description": "Supporting copy."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "eyebrow",
|
|
27
|
+
"type": "ReactNode",
|
|
28
|
+
"required": false,
|
|
29
|
+
"description": "Kicker above the title."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "actions",
|
|
33
|
+
"type": "ReactNode",
|
|
34
|
+
"required": false,
|
|
35
|
+
"description": "Right-aligned actions."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "level",
|
|
39
|
+
"type": "2 | 3 | 4",
|
|
40
|
+
"required": false,
|
|
41
|
+
"defaultValue": "2",
|
|
42
|
+
"description": "Heading level rendered for the title."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "align",
|
|
46
|
+
"type": "'left' | 'center'",
|
|
47
|
+
"required": false,
|
|
48
|
+
"defaultValue": "left",
|
|
49
|
+
"description": "Text and action alignment."
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "size",
|
|
53
|
+
"type": "'sm' | 'md' | 'lg'",
|
|
54
|
+
"required": false,
|
|
55
|
+
"defaultValue": "md",
|
|
56
|
+
"description": "Title scale."
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"examples": [
|
|
60
|
+
{
|
|
61
|
+
"title": "Marketing section",
|
|
62
|
+
"code": "<SectionHeading\n eyebrow=\"Components\"\n title=\"Built for agents\"\n description=\"Every component ships a spec.\"\n actions={<Link href=\"/docs\">All docs</Link>}\n/>",
|
|
63
|
+
"description": "Eyebrow + title + copy + action link."
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"antiPatterns": [
|
|
67
|
+
{
|
|
68
|
+
"title": "Don't use it for the page title",
|
|
69
|
+
"explanation": "PageHeader owns the single h1; SectionHeading defaults to h2.",
|
|
70
|
+
"example": "// Avoid two h1s\n<SectionHeading level={1} />\n\n// Prefer\n<PageHeader title=\"Page\" />"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"accessibility": [
|
|
74
|
+
{
|
|
75
|
+
"feature": "Configurable heading level",
|
|
76
|
+
"implementation": "Renders h2/h3/h4 via the level prop",
|
|
77
|
+
"userRequirements": "Keep the hierarchy sequential under the page h1"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"contentGuidelines": [
|
|
81
|
+
{
|
|
82
|
+
"contentType": "Titles",
|
|
83
|
+
"guidelines": [
|
|
84
|
+
"Noun phrases",
|
|
85
|
+
"Sentence case",
|
|
86
|
+
"Parallel across sections"
|
|
87
|
+
],
|
|
88
|
+
"goodExamples": [
|
|
89
|
+
"Built for agents"
|
|
90
|
+
],
|
|
91
|
+
"badExamples": [
|
|
92
|
+
"Section 2"
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"compositionRules": [
|
|
97
|
+
{
|
|
98
|
+
"component": "PageHeader",
|
|
99
|
+
"relationship": "PageHeader for the h1; SectionHeading for h2+ sections",
|
|
100
|
+
"example": "<PageHeader title=\"…\" /><SectionHeading title=\"…\" />"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"relatedComponents": [
|
|
104
|
+
"PageHeader",
|
|
105
|
+
"Heading",
|
|
106
|
+
"Text"
|
|
107
|
+
]
|
|
108
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "select-menu",
|
|
3
|
+
"name": "SelectMenu",
|
|
4
|
+
"tier": "molecule",
|
|
5
|
+
"package": "@slipstream-ui/core",
|
|
6
|
+
"importPath": "@slipstream-ui/core",
|
|
7
|
+
"version": "0.1.0",
|
|
8
|
+
"sourceDir": "select-menu",
|
|
9
|
+
"exportName": "SelectMenu",
|
|
10
|
+
"description": "Custom listbox select for rich options: descriptions, icons, groups, multi-select, custom rows and hidden inputs for forms.",
|
|
11
|
+
"designIntent": "Native <select> cannot render rich option content. SelectMenu supplies a real listbox with the button/listbox keyboard model while keeping the same value/onValueChange contract as Select, so teams can move between the two without rewriting state.",
|
|
12
|
+
"props": [
|
|
13
|
+
{
|
|
14
|
+
"name": "items",
|
|
15
|
+
"type": "SelectMenuItem[]",
|
|
16
|
+
"required": true,
|
|
17
|
+
"description": "Options: { value, label, description?, icon?, disabled?, group? }."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "value",
|
|
21
|
+
"type": "string | string[]",
|
|
22
|
+
"required": false,
|
|
23
|
+
"description": "Controlled value(s); string[] when multiple."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "defaultValue",
|
|
27
|
+
"type": "string | string[]",
|
|
28
|
+
"required": false,
|
|
29
|
+
"description": "Initial value(s) when uncontrolled."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "onValueChange",
|
|
33
|
+
"type": "(value: string | string[]) => void",
|
|
34
|
+
"required": false,
|
|
35
|
+
"description": "Fired with the new selection."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "multiple",
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"required": false,
|
|
41
|
+
"defaultValue": "false",
|
|
42
|
+
"description": "Allow several selections; the listbox stays open."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "placeholder",
|
|
46
|
+
"type": "string",
|
|
47
|
+
"required": false,
|
|
48
|
+
"defaultValue": "Select…",
|
|
49
|
+
"description": "Shown when nothing is selected."
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "name",
|
|
53
|
+
"type": "string",
|
|
54
|
+
"required": false,
|
|
55
|
+
"description": "Renders hidden form inputs for the selected values."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "renderValue",
|
|
59
|
+
"type": "(selected: SelectMenuItem[]) => ReactNode",
|
|
60
|
+
"required": false,
|
|
61
|
+
"description": "Custom trigger content."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "renderItem",
|
|
65
|
+
"type": "(item, state: { selected: boolean; active: boolean }) => ReactNode",
|
|
66
|
+
"required": false,
|
|
67
|
+
"description": "Custom option row."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "emptyText",
|
|
71
|
+
"type": "string",
|
|
72
|
+
"required": false,
|
|
73
|
+
"defaultValue": "No options",
|
|
74
|
+
"description": "Shown when items is empty."
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"examples": [
|
|
78
|
+
{
|
|
79
|
+
"title": "Rich options",
|
|
80
|
+
"code": "<SelectMenu\n aria-label=\"Plan\"\n placeholder=\"Choose a plan\"\n items={[\n { value: 'free', label: 'Free', description: '1 project', group: 'Individual' },\n { value: 'team', label: 'Team', description: 'SSO + audit log', group: 'Business' },\n ]}\n value={plan}\n onValueChange={setPlan}\n/>",
|
|
81
|
+
"description": "Descriptions and grouped headings inside a real listbox."
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"title": "Multi-select with form input",
|
|
85
|
+
"code": "<SelectMenu\n aria-label=\"Channels\"\n multiple\n name=\"channels\"\n items={channels}\n value={selected}\n onValueChange={setSelected}\n/>",
|
|
86
|
+
"description": "Hidden inputs make the selection submit with the form."
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"antiPatterns": [
|
|
90
|
+
{
|
|
91
|
+
"title": "Don't use it for free-text entry",
|
|
92
|
+
"explanation": "SelectMenu has no text input. Use Autocomplete when typing a value is expected.",
|
|
93
|
+
"example": "// Avoid: 200 options behind a menu\n<SelectMenu items={allCities} />\n\n// Prefer\n<Autocomplete loadOptions={searchCities} />"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"title": "Don't render more than ~50 options",
|
|
97
|
+
"explanation": "There is no filtering. Large sets need Autocomplete or a searchable flow.",
|
|
98
|
+
"example": "// Avoid\n<SelectMenu items={tenThousandRows} />"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"accessibility": [
|
|
102
|
+
{
|
|
103
|
+
"feature": "Keyboard model",
|
|
104
|
+
"implementation": "Arrows move the active option, Home/End jump, Enter/Space select, Escape closes, typeahead jumps by first letters",
|
|
105
|
+
"userRequirements": "Keep option labels distinct so typeahead stays predictable"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"contentGuidelines": [
|
|
109
|
+
{
|
|
110
|
+
"contentType": "Option labels",
|
|
111
|
+
"guidelines": [
|
|
112
|
+
"Noun phrases",
|
|
113
|
+
"Use description for the second line",
|
|
114
|
+
"Parallel phrasing across options"
|
|
115
|
+
],
|
|
116
|
+
"goodExamples": [
|
|
117
|
+
"Pro — Unlimited projects"
|
|
118
|
+
],
|
|
119
|
+
"badExamples": [
|
|
120
|
+
"Click to pick the pro plan option"
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"compositionRules": [
|
|
125
|
+
{
|
|
126
|
+
"component": "FormField",
|
|
127
|
+
"relationship": "Wrap for label/hint/error wiring",
|
|
128
|
+
"example": "<FormField id=\"plan\" label=\"Plan\"><SelectMenu items={items} /></FormField>"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"component": "Select",
|
|
132
|
+
"relationship": "Prefer Select when options are plain text (native pickers, mobile UX)",
|
|
133
|
+
"example": "<Select options={plain} />"
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"relatedComponents": [
|
|
137
|
+
"Select",
|
|
138
|
+
"Autocomplete",
|
|
139
|
+
"Menu",
|
|
140
|
+
"FormField"
|
|
141
|
+
]
|
|
142
|
+
}
|
|
@@ -2,15 +2,20 @@
|
|
|
2
2
|
"id": "select",
|
|
3
3
|
"name": "Select",
|
|
4
4
|
"tier": "atom",
|
|
5
|
-
"description": "Accessible select
|
|
6
|
-
"designIntent": "
|
|
5
|
+
"description": "Accessible select built on the native <select> with flat options, optgroups, a placeholder row and native multi-select.",
|
|
6
|
+
"designIntent": "Native selects keep platform keyboard, mobile picker and screen-reader behavior for free. Groups cover coarse categorization, placeholder renders the 'choose one' affordance, and multiple switches the contract to string[] for tag-picker use cases without reimplementing a listbox.",
|
|
7
7
|
"props": [
|
|
8
8
|
{
|
|
9
9
|
"name": "options",
|
|
10
10
|
"type": "SelectOption[]",
|
|
11
|
-
"required":
|
|
12
|
-
"description": "
|
|
13
|
-
"examples": [
|
|
11
|
+
"required": false,
|
|
12
|
+
"description": "Flat options ({ value, label, disabled? }). Ignored when groups is provided.",
|
|
13
|
+
"examples": [
|
|
14
|
+
{
|
|
15
|
+
"value": "sm",
|
|
16
|
+
"label": "Small"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
14
19
|
},
|
|
15
20
|
{
|
|
16
21
|
"name": "label",
|
|
@@ -20,24 +25,59 @@
|
|
|
20
25
|
},
|
|
21
26
|
{
|
|
22
27
|
"name": "value",
|
|
23
|
-
"type": "string",
|
|
28
|
+
"type": "string | string[]",
|
|
24
29
|
"required": false,
|
|
25
|
-
"description": "Controlled
|
|
30
|
+
"description": "Controlled value (string, or string[] when multiple)."
|
|
26
31
|
},
|
|
27
32
|
{
|
|
28
33
|
"name": "defaultValue",
|
|
29
|
-
"type": "string",
|
|
34
|
+
"type": "string | string[]",
|
|
30
35
|
"required": false,
|
|
31
|
-
"description": "
|
|
36
|
+
"description": "Initial value when uncontrolled."
|
|
32
37
|
},
|
|
33
38
|
{
|
|
34
39
|
"name": "onChange",
|
|
35
|
-
"type": "(value: string) => void",
|
|
40
|
+
"type": "(value: string | string[]) => void",
|
|
41
|
+
"required": false,
|
|
42
|
+
"description": "Fired with the new value; string[] when multiple."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "groups",
|
|
46
|
+
"type": "SelectOptionGroup[]",
|
|
36
47
|
"required": false,
|
|
37
|
-
"description": "
|
|
48
|
+
"description": "Optgroups: [{ label, options }] rendered with a heading per section."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "placeholder",
|
|
52
|
+
"type": "string",
|
|
53
|
+
"required": false,
|
|
54
|
+
"description": "Renders a disabled empty option as the 'choose one' affordance."
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "multiple",
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"required": false,
|
|
60
|
+
"defaultValue": "false",
|
|
61
|
+
"description": "Native multi-select; value/defaultValue/onChange switch to string[]."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "onValueChange",
|
|
65
|
+
"type": "(value: string | string[]) => void",
|
|
66
|
+
"required": false,
|
|
67
|
+
"description": "Alias for onChange — value-based callback."
|
|
38
68
|
}
|
|
39
69
|
],
|
|
40
70
|
"examples": [
|
|
71
|
+
{
|
|
72
|
+
"title": "Grouped options",
|
|
73
|
+
"code": "<Select\n label=\"Plan\"\n placeholder=\"Choose a plan\"\n groups={[\n { label: 'Individual', options: [{ value: 'free', label: 'Free' }] },\n { label: 'Business', options: [{ value: 'team', label: 'Team' }] },\n ]}\n/>",
|
|
74
|
+
"description": "Optgroups with a placeholder row."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"title": "Multi-select",
|
|
78
|
+
"code": "<Select\n label=\"Channels\"\n multiple\n value={channels}\n onChange={setChannels}\n options={[{ value: 'email', label: 'Email' }, { value: 'slack', label: 'Slack' }]}\n/>",
|
|
79
|
+
"description": "Native listbox with a string[] contract."
|
|
80
|
+
},
|
|
41
81
|
{
|
|
42
82
|
"title": "Controlled select",
|
|
43
83
|
"code": "const [size, setSize] = useState('default');\n\n<Select\n label=\"Size\"\n value={size}\n onChange={setSize}\n options={[\n { value: 'default', label: 'Default' },\n { value: 'sm', label: 'Small' },\n { value: 'lg', label: 'Large' },\n ]}\n/>",
|
|
@@ -66,7 +106,10 @@
|
|
|
66
106
|
"relationship": "Pair Select with Button in filter toolbars; Button submits, Select filters."
|
|
67
107
|
}
|
|
68
108
|
],
|
|
69
|
-
"relatedComponents": [
|
|
109
|
+
"relatedComponents": [
|
|
110
|
+
"Button",
|
|
111
|
+
"Input"
|
|
112
|
+
],
|
|
70
113
|
"package": "@slipstream-ui/core",
|
|
71
114
|
"importPath": "@slipstream-ui/core",
|
|
72
115
|
"version": "0.0.1",
|