@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.
Files changed (128) hide show
  1. package/dist/index.d.mts +672 -52
  2. package/dist/index.d.ts +672 -52
  3. package/dist/index.js +1860 -657
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +1836 -655
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/manifests/app-shell.manifest.json +156 -0
  8. package/dist/manifests/auth-layout.manifest.json +99 -0
  9. package/dist/manifests/autocomplete.manifest.json +53 -5
  10. package/dist/manifests/badge.manifest.json +12 -0
  11. package/dist/manifests/button.manifest.json +6 -2
  12. package/dist/manifests/card.manifest.json +53 -6
  13. package/dist/manifests/date-picker.manifest.json +87 -0
  14. package/dist/manifests/dialog.manifest.json +49 -4
  15. package/dist/manifests/drawer.manifest.json +18 -4
  16. package/dist/manifests/empty-state.manifest.json +108 -0
  17. package/dist/manifests/file-upload.manifest.json +103 -0
  18. package/dist/manifests/filter-bar.manifest.json +100 -0
  19. package/dist/manifests/menu.manifest.json +13 -1
  20. package/dist/manifests/metric-card.manifest.json +105 -0
  21. package/dist/manifests/page-header.manifest.json +94 -0
  22. package/dist/manifests/pagination.manifest.json +62 -34
  23. package/dist/manifests/password-input.manifest.json +75 -0
  24. package/dist/manifests/select-menu.manifest.json +142 -0
  25. package/dist/manifests/select.manifest.json +49 -12
  26. package/dist/manifests/stepper.manifest.json +95 -0
  27. package/dist/manifests/table-card.manifest.json +123 -0
  28. package/dist/manifests/time-picker.manifest.json +86 -0
  29. package/dist/manifests/timeline.manifest.json +69 -0
  30. package/dist/manifests/toast.manifest.json +101 -25
  31. package/package.json +1 -1
  32. package/src/components/app-shell/AppShell.test.tsx +100 -0
  33. package/src/components/app-shell/AppShell.tsx +162 -0
  34. package/src/components/app-shell/index.ts +1 -0
  35. package/src/components/auth-layout/AuthLayout.test.tsx +34 -0
  36. package/src/components/auth-layout/AuthLayout.tsx +47 -0
  37. package/src/components/auth-layout/index.ts +1 -0
  38. package/src/components/autocomplete/Autocomplete.test.tsx +53 -0
  39. package/src/components/autocomplete/Autocomplete.tsx +160 -41
  40. package/src/components/badge/Badge.test.tsx +14 -0
  41. package/src/components/badge/Badge.tsx +10 -4
  42. package/src/components/button/Button.test.tsx +29 -0
  43. package/src/components/button/Button.tsx +10 -0
  44. package/src/components/button-group/ButtonGroup.test.tsx +6 -8
  45. package/src/components/button-group/ButtonGroup.tsx +17 -9
  46. package/src/components/card/Card.test.tsx +14 -0
  47. package/src/components/card/Card.tsx +15 -8
  48. package/src/components/date-picker/DatePicker.test.tsx +30 -0
  49. package/src/components/date-picker/DatePicker.tsx +57 -0
  50. package/src/components/date-picker/index.ts +1 -0
  51. package/src/components/dialog/Dialog.test.tsx +64 -1
  52. package/src/components/dialog/Dialog.tsx +113 -23
  53. package/src/components/dialog/index.ts +1 -2
  54. package/src/components/drawer/Drawer.test.tsx +50 -0
  55. package/src/components/drawer/Drawer.tsx +44 -6
  56. package/src/components/empty-state/EmptyState.test.tsx +30 -0
  57. package/src/components/empty-state/EmptyState.tsx +48 -0
  58. package/src/components/empty-state/index.ts +1 -0
  59. package/src/components/file-upload/FileUpload.test.tsx +43 -0
  60. package/src/components/file-upload/FileUpload.tsx +143 -0
  61. package/src/components/file-upload/index.ts +1 -0
  62. package/src/components/filter-bar/FilterBar.test.tsx +32 -0
  63. package/src/components/filter-bar/FilterBar.tsx +71 -0
  64. package/src/components/filter-bar/index.ts +1 -0
  65. package/src/components/input-group/InputGroup.test.tsx +6 -3
  66. package/src/components/input-group/InputGroup.tsx +9 -6
  67. package/src/components/menu/Menu.test.tsx +21 -0
  68. package/src/components/menu/Menu.tsx +8 -3
  69. package/src/components/metric-card/MetricCard.test.tsx +28 -0
  70. package/src/components/metric-card/MetricCard.tsx +54 -0
  71. package/src/components/metric-card/index.ts +1 -0
  72. package/src/components/page-header/PageHeader.test.tsx +31 -0
  73. package/src/components/page-header/PageHeader.tsx +37 -0
  74. package/src/components/page-header/index.ts +1 -0
  75. package/src/components/pagination/Pagination.test.tsx +25 -0
  76. package/src/components/pagination/Pagination.tsx +53 -12
  77. package/src/components/password-input/PasswordInput.test.tsx +29 -0
  78. package/src/components/password-input/PasswordInput.tsx +41 -0
  79. package/src/components/password-input/index.ts +1 -0
  80. package/src/components/select/Select.test.tsx +40 -1
  81. package/src/components/select/Select.tsx +52 -14
  82. package/src/components/select/index.ts +1 -1
  83. package/src/components/select-menu/SelectMenu.test.tsx +105 -0
  84. package/src/components/select-menu/SelectMenu.tsx +368 -0
  85. package/src/components/select-menu/index.ts +1 -0
  86. package/src/components/stepper/Stepper.test.tsx +35 -0
  87. package/src/components/stepper/Stepper.tsx +91 -0
  88. package/src/components/stepper/index.ts +1 -0
  89. package/src/components/table-card/TableCard.test.tsx +59 -0
  90. package/src/components/table-card/TableCard.tsx +48 -0
  91. package/src/components/table-card/index.ts +1 -0
  92. package/src/components/time-picker/TimePicker.test.tsx +30 -0
  93. package/src/components/time-picker/TimePicker.tsx +56 -0
  94. package/src/components/time-picker/index.ts +1 -0
  95. package/src/components/timeline/Timeline.test.tsx +26 -0
  96. package/src/components/timeline/Timeline.tsx +53 -0
  97. package/src/components/timeline/index.ts +1 -0
  98. package/src/components/toast/Toast.test.tsx +5 -0
  99. package/src/components/toast/Toast.tsx +2 -16
  100. package/src/components/toast/Toaster.test.tsx +84 -0
  101. package/src/components/toast/Toaster.tsx +116 -0
  102. package/src/components/toast/index.ts +4 -0
  103. package/src/components/toast/toast-store.ts +117 -0
  104. package/src/index.ts +14 -0
  105. package/src/manifests/app-shell.manifest.json +156 -0
  106. package/src/manifests/auth-layout.manifest.json +99 -0
  107. package/src/manifests/autocomplete.manifest.json +53 -5
  108. package/src/manifests/badge.manifest.json +12 -0
  109. package/src/manifests/button.manifest.json +6 -2
  110. package/src/manifests/card.manifest.json +53 -6
  111. package/src/manifests/date-picker.manifest.json +87 -0
  112. package/src/manifests/dialog.manifest.json +49 -4
  113. package/src/manifests/drawer.manifest.json +18 -4
  114. package/src/manifests/empty-state.manifest.json +108 -0
  115. package/src/manifests/file-upload.manifest.json +103 -0
  116. package/src/manifests/filter-bar.manifest.json +100 -0
  117. package/src/manifests/menu.manifest.json +13 -1
  118. package/src/manifests/metric-card.manifest.json +105 -0
  119. package/src/manifests/page-header.manifest.json +94 -0
  120. package/src/manifests/pagination.manifest.json +62 -34
  121. package/src/manifests/password-input.manifest.json +75 -0
  122. package/src/manifests/select-menu.manifest.json +142 -0
  123. package/src/manifests/select.manifest.json +49 -12
  124. package/src/manifests/stepper.manifest.json +95 -0
  125. package/src/manifests/table-card.manifest.json +123 -0
  126. package/src/manifests/time-picker.manifest.json +86 -0
  127. package/src/manifests/timeline.manifest.json +69 -0
  128. 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 app-level notifications announced through a polite live region, with auto-dismiss, stacking and optional actions",
6
- "designIntent": "Applications need lightweight feedback that does not steal focus. Toasts render into a labelled polite live region so screen readers announce them, stack newest-first, auto-dismiss on a timer, and support one optional action (typically undo).",
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": "Short heading announced with the toast"
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": "Optional supporting detail"
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": "Optional inline action; invoking it dismisses the toast"
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
- "description": "Auto-dismiss delay in ms; 0 keeps the toast until dismissed",
32
- "enum": ["0", "5000"],
33
- "examples": [0, 3000, 5000]
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": "Basic toast with useToast",
39
- "code": "'use client';\n\nimport { ToastProvider, useToast } from '@/components/slipstream/toast';\n\nfunction SaveButton() {\n const { toast } = useToast();\n return (\n <button onClick={() => toast({ title: 'Saved', description: 'Your changes are live.' })}>\n Save\n </button>\n );\n}\n\nexport function App() {\n return (\n <ToastProvider>\n <SaveButton />\n </ToastProvider>\n );\n}",
40
- "description": "Wrap your app in ToastProvider once; call toast() anywhere below it."
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": "Undo action",
44
- "code": "toast({\n title: 'License revoked',\n action: { label: 'Undo', onClick: restore },\n duration: 0,\n});",
45
- "description": "duration: 0 keeps the toast until the user acts or dismisses it."
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": "Screen reader announcements",
57
- "implementation": "Each toast renders inside role=status (implicit aria-live=polite) within a labelled list container."
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": "Keyboard dismiss",
61
- "implementation": "Toast content is regular DOM; buttons inside toasts are reachable and activatable with the keyboard."
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": ["State what happened in past tense", "Keep under ~60 characters"],
68
- "goodExamples": ["Saved", "License revoked"],
69
- "badExamples": ["Oops!"]
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": "Confirmation",
75
- "relationship": "Use Confirmation for destructive actions before they happen; use Toast to report the result after."
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": ["Confirmation", "Button"],
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",