@slipstream-ui/core 0.3.0 → 0.4.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 +672 -52
- package/dist/index.d.ts +672 -52
- package/dist/index.js +1860 -657
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1836 -655
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/app-shell.manifest.json +156 -0
- package/dist/manifests/auth-layout.manifest.json +99 -0
- package/dist/manifests/autocomplete.manifest.json +53 -5
- package/dist/manifests/badge.manifest.json +12 -0
- package/dist/manifests/button.manifest.json +6 -2
- package/dist/manifests/card.manifest.json +53 -6
- package/dist/manifests/date-picker.manifest.json +87 -0
- package/dist/manifests/dialog.manifest.json +49 -4
- package/dist/manifests/drawer.manifest.json +18 -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/menu.manifest.json +13 -1
- package/dist/manifests/metric-card.manifest.json +105 -0
- package/dist/manifests/page-header.manifest.json +94 -0
- package/dist/manifests/pagination.manifest.json +62 -34
- package/dist/manifests/password-input.manifest.json +75 -0
- package/dist/manifests/select-menu.manifest.json +142 -0
- package/dist/manifests/select.manifest.json +49 -12
- package/dist/manifests/stepper.manifest.json +95 -0
- package/dist/manifests/table-card.manifest.json +123 -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 +1 -1
- package/src/components/app-shell/AppShell.test.tsx +100 -0
- package/src/components/app-shell/AppShell.tsx +162 -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 +14 -0
- package/src/components/badge/Badge.tsx +10 -4
- package/src/components/button/Button.test.tsx +29 -0
- package/src/components/button/Button.tsx +10 -0
- 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/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 +64 -1
- package/src/components/dialog/Dialog.tsx +113 -23
- package/src/components/dialog/index.ts +1 -2
- package/src/components/drawer/Drawer.test.tsx +50 -0
- package/src/components/drawer/Drawer.tsx +44 -6
- 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-group/InputGroup.test.tsx +6 -3
- package/src/components/input-group/InputGroup.tsx +9 -6
- 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 +31 -0
- package/src/components/page-header/PageHeader.tsx +37 -0
- package/src/components/page-header/index.ts +1 -0
- package/src/components/pagination/Pagination.test.tsx +25 -0
- package/src/components/pagination/Pagination.tsx +53 -12
- 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/select/Select.test.tsx +40 -1
- package/src/components/select/Select.tsx +52 -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/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/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/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 +14 -0
- package/src/manifests/app-shell.manifest.json +156 -0
- package/src/manifests/auth-layout.manifest.json +99 -0
- package/src/manifests/autocomplete.manifest.json +53 -5
- package/src/manifests/badge.manifest.json +12 -0
- package/src/manifests/button.manifest.json +6 -2
- package/src/manifests/card.manifest.json +53 -6
- package/src/manifests/date-picker.manifest.json +87 -0
- package/src/manifests/dialog.manifest.json +49 -4
- package/src/manifests/drawer.manifest.json +18 -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/menu.manifest.json +13 -1
- package/src/manifests/metric-card.manifest.json +105 -0
- package/src/manifests/page-header.manifest.json +94 -0
- package/src/manifests/pagination.manifest.json +62 -34
- package/src/manifests/password-input.manifest.json +75 -0
- package/src/manifests/select-menu.manifest.json +142 -0
- package/src/manifests/select.manifest.json +49 -12
- package/src/manifests/stepper.manifest.json +95 -0
- package/src/manifests/table-card.manifest.json +123 -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
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "timeline",
|
|
3
|
+
"name": "Timeline",
|
|
4
|
+
"tier": "molecule",
|
|
5
|
+
"description": "Vertical chronology for experience, activity and audit trails, built on an ordered list.",
|
|
6
|
+
"designIntent": "Chronologies communicate order. Rendering them as an ordered list keeps the sequence structural for assistive tech, while the connector rule and dots provide the visual rhythm.",
|
|
7
|
+
"props": [
|
|
8
|
+
{
|
|
9
|
+
"name": "items",
|
|
10
|
+
"type": "{ title: string; period?: string; description?: string; icon?: ReactNode; muted?: boolean }[]",
|
|
11
|
+
"required": true,
|
|
12
|
+
"description": "Ordered timeline entries."
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"examples": [
|
|
16
|
+
{
|
|
17
|
+
"title": "Experience",
|
|
18
|
+
"code": "<Timeline\n items={[\n { title: 'Senior Engineer', period: '2023 — Present', description: 'Platform team' },\n { title: 'Engineer', period: '2020 — 2023' },\n ]}\n/>",
|
|
19
|
+
"description": "Period label, title and supporting line per entry."
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"antiPatterns": [
|
|
23
|
+
{
|
|
24
|
+
"title": "Don't reverse the DOM order for newest-first",
|
|
25
|
+
"explanation": "Reverse the array instead so reading order matches visual order.",
|
|
26
|
+
"example": "// Avoid: flex-col-reverse\n// Prefer: items={items.slice().reverse()}"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"accessibility": [
|
|
30
|
+
{
|
|
31
|
+
"feature": "Sequence",
|
|
32
|
+
"implementation": "Ordered list semantics",
|
|
33
|
+
"userRequirements": "Keep entries in chronological order in the array"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"contentGuidelines": [
|
|
37
|
+
{
|
|
38
|
+
"contentType": "Periods",
|
|
39
|
+
"guidelines": [
|
|
40
|
+
"Use a consistent format",
|
|
41
|
+
"State Present for ongoing"
|
|
42
|
+
],
|
|
43
|
+
"goodExamples": [
|
|
44
|
+
"2023 — Present",
|
|
45
|
+
"Jan 2024"
|
|
46
|
+
],
|
|
47
|
+
"badExamples": [
|
|
48
|
+
"Some time ago"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"compositionRules": [
|
|
53
|
+
{
|
|
54
|
+
"component": "Card",
|
|
55
|
+
"relationship": "Often embedded in profile/about cards",
|
|
56
|
+
"example": "<Card><CardContent><Timeline items={roles} /></CardContent></Card>"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"relatedComponents": [
|
|
60
|
+
"List",
|
|
61
|
+
"Card",
|
|
62
|
+
"Separator"
|
|
63
|
+
],
|
|
64
|
+
"package": "@slipstream-ui/core",
|
|
65
|
+
"importPath": "@slipstream-ui/core",
|
|
66
|
+
"version": "0.1.0",
|
|
67
|
+
"sourceDir": "timeline",
|
|
68
|
+
"exportName": "Timeline"
|
|
69
|
+
}
|
|
@@ -2,47 +2,99 @@
|
|
|
2
2
|
"id": "toast",
|
|
3
3
|
"name": "Toast",
|
|
4
4
|
"tier": "molecule",
|
|
5
|
-
"description": "Accessible
|
|
6
|
-
"designIntent": "
|
|
5
|
+
"description": "Accessible notifications: tree-scoped provider/hook plus an imperative toast() API rendered by <Toaster />.",
|
|
6
|
+
"designIntent": "Toasts announce status changes without stealing focus. The provider/useToast pair covers tree-scoped usage; the module-level toast() + <Toaster /> covers event handlers and data layers where threading a hook is impossible (e.g. 1000+ call sites). A polite live region and auto-dismiss keep the queue quiet.",
|
|
7
7
|
"props": [
|
|
8
8
|
{
|
|
9
9
|
"name": "title",
|
|
10
10
|
"type": "string",
|
|
11
11
|
"required": true,
|
|
12
|
-
"description": "
|
|
12
|
+
"description": "Toast heading.",
|
|
13
|
+
"examples": [
|
|
14
|
+
"Saved",
|
|
15
|
+
"Upload failed"
|
|
16
|
+
]
|
|
13
17
|
},
|
|
14
18
|
{
|
|
15
19
|
"name": "description",
|
|
16
20
|
"type": "string",
|
|
17
21
|
"required": false,
|
|
18
|
-
"description": "
|
|
22
|
+
"description": "Supporting line under the title."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "variant",
|
|
26
|
+
"type": "'default' | 'success' | 'error' | 'warning' | 'info'",
|
|
27
|
+
"required": false,
|
|
28
|
+
"defaultValue": "default",
|
|
29
|
+
"description": "Status accent (dot + optional rich tint).",
|
|
30
|
+
"enum": [
|
|
31
|
+
"default",
|
|
32
|
+
"success",
|
|
33
|
+
"error",
|
|
34
|
+
"warning",
|
|
35
|
+
"info"
|
|
36
|
+
],
|
|
37
|
+
"examples": [
|
|
38
|
+
"success",
|
|
39
|
+
"error"
|
|
40
|
+
]
|
|
19
41
|
},
|
|
20
42
|
{
|
|
21
43
|
"name": "action",
|
|
22
44
|
"type": "{ label: string; onClick: () => void }",
|
|
23
45
|
"required": false,
|
|
24
|
-
"description": "
|
|
46
|
+
"description": "Single inline action; dismisses the toast after running."
|
|
25
47
|
},
|
|
26
48
|
{
|
|
27
49
|
"name": "duration",
|
|
28
50
|
"type": "number",
|
|
29
|
-
"defaultValue": 5000,
|
|
30
51
|
"required": false,
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
52
|
+
"defaultValue": "5000",
|
|
53
|
+
"description": "Auto-dismiss delay in ms; 0 keeps the toast until dismissed."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "position",
|
|
57
|
+
"type": "'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'",
|
|
58
|
+
"required": false,
|
|
59
|
+
"defaultValue": "bottom-right",
|
|
60
|
+
"description": "Toaster placement (Toaster component).",
|
|
61
|
+
"enum": [
|
|
62
|
+
"top-left",
|
|
63
|
+
"top-center",
|
|
64
|
+
"top-right",
|
|
65
|
+
"bottom-left",
|
|
66
|
+
"bottom-center",
|
|
67
|
+
"bottom-right"
|
|
68
|
+
],
|
|
69
|
+
"examples": [
|
|
70
|
+
"top-right"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "richColors",
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"required": false,
|
|
77
|
+
"defaultValue": "false",
|
|
78
|
+
"description": "Tint the toast surface with its status color (Toaster component)."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "label",
|
|
82
|
+
"type": "string",
|
|
83
|
+
"required": false,
|
|
84
|
+
"defaultValue": "Notifications",
|
|
85
|
+
"description": "Accessible name of the live region (Toaster component)."
|
|
34
86
|
}
|
|
35
87
|
],
|
|
36
88
|
"examples": [
|
|
37
89
|
{
|
|
38
|
-
"title": "
|
|
39
|
-
"code": "
|
|
40
|
-
"description": "
|
|
90
|
+
"title": "Imperative API",
|
|
91
|
+
"code": "import { Toaster, toast } from '@slipstream-ui/core';\n\n<Toaster position=\"bottom-right\" richColors />\n\ntoast.success('Saved', 'Your changes are live');\ntoast.error('Upload failed', 'Check your connection');\ntoast({ title: 'Heads up', duration: 0 });",
|
|
92
|
+
"description": "Fire from event handlers or data layers — no hook needed."
|
|
41
93
|
},
|
|
42
94
|
{
|
|
43
|
-
"title": "
|
|
44
|
-
"code": "
|
|
45
|
-
"description": "
|
|
95
|
+
"title": "Tree-scoped provider",
|
|
96
|
+
"code": "<ToastProvider>\n <App />\n</ToastProvider>;\n\nconst { toast, dismiss } = useToast();\ntoast({ title: 'Saved' });",
|
|
97
|
+
"description": "Existing provider/hook pair for component-scoped usage."
|
|
46
98
|
}
|
|
47
99
|
],
|
|
48
100
|
"antiPatterns": [
|
|
@@ -53,29 +105,53 @@
|
|
|
53
105
|
],
|
|
54
106
|
"accessibility": [
|
|
55
107
|
{
|
|
56
|
-
"feature": "
|
|
57
|
-
"implementation": "Each toast renders
|
|
108
|
+
"feature": "Polite live region",
|
|
109
|
+
"implementation": "Each toast renders role=status inside a labelled list; announcements never steal focus",
|
|
110
|
+
"userRequirements": "Keep messages short and actionable"
|
|
58
111
|
},
|
|
59
112
|
{
|
|
60
|
-
"feature": "
|
|
61
|
-
"implementation": "
|
|
113
|
+
"feature": "Dismiss control",
|
|
114
|
+
"implementation": "Every toast has a labelled dismiss button (Dismiss <title>)",
|
|
115
|
+
"userRequirements": "Don't remove the dismiss button"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"feature": "Auto-dismiss timing",
|
|
119
|
+
"implementation": "5s default; duration 0 keeps sticky toasts",
|
|
120
|
+
"userRequirements": "Use duration 0 for errors that need a decision"
|
|
62
121
|
}
|
|
63
122
|
],
|
|
64
123
|
"contentGuidelines": [
|
|
65
124
|
{
|
|
66
125
|
"contentType": "toast title",
|
|
67
|
-
"guidelines": [
|
|
68
|
-
|
|
69
|
-
|
|
126
|
+
"guidelines": [
|
|
127
|
+
"State what happened in past tense",
|
|
128
|
+
"Keep under ~60 characters"
|
|
129
|
+
],
|
|
130
|
+
"goodExamples": [
|
|
131
|
+
"Saved",
|
|
132
|
+
"License revoked"
|
|
133
|
+
],
|
|
134
|
+
"badExamples": [
|
|
135
|
+
"Oops!"
|
|
136
|
+
]
|
|
70
137
|
}
|
|
71
138
|
],
|
|
72
139
|
"compositionRules": [
|
|
73
140
|
{
|
|
74
|
-
"component": "
|
|
75
|
-
"relationship": "
|
|
141
|
+
"component": "Toaster",
|
|
142
|
+
"relationship": "Mount once near the app root next to your router; keep it outside transforms so fixed positioning is not affected",
|
|
143
|
+
"example": "<App><Toaster /></App>"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"component": "ToastProvider",
|
|
147
|
+
"relationship": "Use the provider/hook pair when the call site is inside the React tree",
|
|
148
|
+
"example": "<ToastProvider><App /></ToastProvider>"
|
|
76
149
|
}
|
|
77
150
|
],
|
|
78
|
-
"relatedComponents": [
|
|
151
|
+
"relatedComponents": [
|
|
152
|
+
"Confirmation",
|
|
153
|
+
"Button"
|
|
154
|
+
],
|
|
79
155
|
"package": "@slipstream-ui/core",
|
|
80
156
|
"importPath": "@slipstream-ui/core",
|
|
81
157
|
"version": "0.0.1",
|