@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.
Files changed (181) hide show
  1. package/dist/index.d.mts +957 -56
  2. package/dist/index.d.ts +957 -56
  3. package/dist/index.js +2554 -777
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +2524 -777
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/manifests/app-shell.manifest.json +206 -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 +20 -3
  11. package/dist/manifests/breadcrumb.manifest.json +6 -0
  12. package/dist/manifests/button.manifest.json +20 -2
  13. package/dist/manifests/card.manifest.json +53 -6
  14. package/dist/manifests/confirm-dialog.manifest.json +132 -0
  15. package/dist/manifests/data-table.manifest.json +50 -0
  16. package/dist/manifests/date-picker.manifest.json +87 -0
  17. package/dist/manifests/dialog.manifest.json +56 -4
  18. package/dist/manifests/drawer.manifest.json +25 -4
  19. package/dist/manifests/empty-state.manifest.json +108 -0
  20. package/dist/manifests/file-upload.manifest.json +103 -0
  21. package/dist/manifests/filter-bar.manifest.json +100 -0
  22. package/dist/manifests/link.manifest.json +106 -0
  23. package/dist/manifests/menu.manifest.json +13 -1
  24. package/dist/manifests/metric-card.manifest.json +105 -0
  25. package/dist/manifests/page-header.manifest.json +124 -0
  26. package/dist/manifests/pagination.manifest.json +68 -34
  27. package/dist/manifests/password-input.manifest.json +75 -0
  28. package/dist/manifests/prose.manifest.json +75 -0
  29. package/dist/manifests/search.manifest.json +41 -9
  30. package/dist/manifests/section-heading.manifest.json +108 -0
  31. package/dist/manifests/select-menu.manifest.json +142 -0
  32. package/dist/manifests/select.manifest.json +55 -12
  33. package/dist/manifests/site-footer.manifest.json +94 -0
  34. package/dist/manifests/site-header.manifest.json +130 -0
  35. package/dist/manifests/stepper.manifest.json +95 -0
  36. package/dist/manifests/table-card.manifest.json +123 -0
  37. package/dist/manifests/table-of-contents.manifest.json +87 -0
  38. package/dist/manifests/time-picker.manifest.json +86 -0
  39. package/dist/manifests/timeline.manifest.json +69 -0
  40. package/dist/manifests/toast.manifest.json +101 -25
  41. package/package.json +2 -2
  42. package/src/components/alert/Alert.tsx +2 -2
  43. package/src/components/app-shell/AppShell.test.tsx +148 -0
  44. package/src/components/app-shell/AppShell.tsx +266 -0
  45. package/src/components/app-shell/index.ts +1 -0
  46. package/src/components/auth-layout/AuthLayout.test.tsx +34 -0
  47. package/src/components/auth-layout/AuthLayout.tsx +47 -0
  48. package/src/components/auth-layout/index.ts +1 -0
  49. package/src/components/autocomplete/Autocomplete.test.tsx +53 -0
  50. package/src/components/autocomplete/Autocomplete.tsx +160 -41
  51. package/src/components/badge/Badge.test.tsx +35 -0
  52. package/src/components/badge/Badge.tsx +16 -4
  53. package/src/components/breadcrumb/Breadcrumb.test.tsx +16 -0
  54. package/src/components/breadcrumb/Breadcrumb.tsx +10 -5
  55. package/src/components/button/Button.test.tsx +67 -0
  56. package/src/components/button/Button.tsx +37 -3
  57. package/src/components/button-group/ButtonGroup.test.tsx +6 -8
  58. package/src/components/button-group/ButtonGroup.tsx +17 -9
  59. package/src/components/card/Card.test.tsx +14 -0
  60. package/src/components/card/Card.tsx +15 -8
  61. package/src/components/confirm-dialog/ConfirmDialog.test.tsx +46 -0
  62. package/src/components/confirm-dialog/ConfirmDialog.tsx +86 -0
  63. package/src/components/confirm-dialog/index.ts +1 -0
  64. package/src/components/data-table/DataTable.test.tsx +92 -0
  65. package/src/components/data-table/DataTable.tsx +98 -7
  66. package/src/components/date-picker/DatePicker.test.tsx +30 -0
  67. package/src/components/date-picker/DatePicker.tsx +57 -0
  68. package/src/components/date-picker/index.ts +1 -0
  69. package/src/components/dialog/Dialog.test.tsx +71 -1
  70. package/src/components/dialog/Dialog.tsx +116 -23
  71. package/src/components/dialog/index.ts +1 -2
  72. package/src/components/drawer/Drawer.test.tsx +59 -0
  73. package/src/components/drawer/Drawer.tsx +49 -8
  74. package/src/components/empty-state/EmptyState.test.tsx +30 -0
  75. package/src/components/empty-state/EmptyState.tsx +48 -0
  76. package/src/components/empty-state/index.ts +1 -0
  77. package/src/components/file-upload/FileUpload.test.tsx +43 -0
  78. package/src/components/file-upload/FileUpload.tsx +143 -0
  79. package/src/components/file-upload/index.ts +1 -0
  80. package/src/components/filter-bar/FilterBar.test.tsx +32 -0
  81. package/src/components/filter-bar/FilterBar.tsx +71 -0
  82. package/src/components/filter-bar/index.ts +1 -0
  83. package/src/components/input/Input.tsx +1 -0
  84. package/src/components/input-group/InputGroup.test.tsx +6 -3
  85. package/src/components/input-group/InputGroup.tsx +9 -6
  86. package/src/components/link/Link.test.tsx +60 -0
  87. package/src/components/link/Link.tsx +85 -0
  88. package/src/components/link/index.ts +1 -0
  89. package/src/components/menu/Menu.test.tsx +21 -0
  90. package/src/components/menu/Menu.tsx +8 -3
  91. package/src/components/metric-card/MetricCard.test.tsx +28 -0
  92. package/src/components/metric-card/MetricCard.tsx +54 -0
  93. package/src/components/metric-card/index.ts +1 -0
  94. package/src/components/page-header/PageHeader.test.tsx +48 -0
  95. package/src/components/page-header/PageHeader.tsx +53 -0
  96. package/src/components/page-header/index.ts +1 -0
  97. package/src/components/pagination/Pagination.test.tsx +33 -0
  98. package/src/components/pagination/Pagination.tsx +69 -18
  99. package/src/components/password-input/PasswordInput.test.tsx +29 -0
  100. package/src/components/password-input/PasswordInput.tsx +41 -0
  101. package/src/components/password-input/index.ts +1 -0
  102. package/src/components/prose/Prose.test.tsx +35 -0
  103. package/src/components/prose/Prose.tsx +61 -0
  104. package/src/components/prose/index.ts +1 -0
  105. package/src/components/search/Search.test.tsx +16 -0
  106. package/src/components/search/Search.tsx +11 -2
  107. package/src/components/section-heading/SectionHeading.test.tsx +32 -0
  108. package/src/components/section-heading/SectionHeading.tsx +54 -0
  109. package/src/components/section-heading/index.ts +1 -0
  110. package/src/components/select/Select.test.tsx +40 -1
  111. package/src/components/select/Select.tsx +54 -14
  112. package/src/components/select/index.ts +1 -1
  113. package/src/components/select-menu/SelectMenu.test.tsx +105 -0
  114. package/src/components/select-menu/SelectMenu.tsx +368 -0
  115. package/src/components/select-menu/index.ts +1 -0
  116. package/src/components/site-footer/SiteFooter.test.tsx +30 -0
  117. package/src/components/site-footer/SiteFooter.tsx +79 -0
  118. package/src/components/site-footer/index.ts +1 -0
  119. package/src/components/site-header/SiteHeader.test.tsx +53 -0
  120. package/src/components/site-header/SiteHeader.tsx +124 -0
  121. package/src/components/site-header/index.ts +1 -0
  122. package/src/components/stepper/Stepper.test.tsx +35 -0
  123. package/src/components/stepper/Stepper.tsx +91 -0
  124. package/src/components/stepper/index.ts +1 -0
  125. package/src/components/switch/Switch.test.tsx +10 -0
  126. package/src/components/switch/Switch.tsx +8 -3
  127. package/src/components/table-card/TableCard.test.tsx +59 -0
  128. package/src/components/table-card/TableCard.tsx +48 -0
  129. package/src/components/table-card/index.ts +1 -0
  130. package/src/components/table-of-contents/TableOfContents.test.tsx +31 -0
  131. package/src/components/table-of-contents/TableOfContents.tsx +100 -0
  132. package/src/components/table-of-contents/index.ts +1 -0
  133. package/src/components/textarea/Textarea.tsx +1 -0
  134. package/src/components/time-picker/TimePicker.test.tsx +30 -0
  135. package/src/components/time-picker/TimePicker.tsx +56 -0
  136. package/src/components/time-picker/index.ts +1 -0
  137. package/src/components/timeline/Timeline.test.tsx +26 -0
  138. package/src/components/timeline/Timeline.tsx +53 -0
  139. package/src/components/timeline/index.ts +1 -0
  140. package/src/components/toast/Toast.test.tsx +5 -0
  141. package/src/components/toast/Toast.tsx +2 -16
  142. package/src/components/toast/Toaster.test.tsx +84 -0
  143. package/src/components/toast/Toaster.tsx +116 -0
  144. package/src/components/toast/index.ts +4 -0
  145. package/src/components/toast/toast-store.ts +117 -0
  146. package/src/index.ts +21 -0
  147. package/src/manifests/app-shell.manifest.json +206 -0
  148. package/src/manifests/auth-layout.manifest.json +99 -0
  149. package/src/manifests/autocomplete.manifest.json +53 -5
  150. package/src/manifests/badge.manifest.json +20 -3
  151. package/src/manifests/breadcrumb.manifest.json +6 -0
  152. package/src/manifests/button.manifest.json +20 -2
  153. package/src/manifests/card.manifest.json +53 -6
  154. package/src/manifests/confirm-dialog.manifest.json +132 -0
  155. package/src/manifests/data-table.manifest.json +50 -0
  156. package/src/manifests/date-picker.manifest.json +87 -0
  157. package/src/manifests/dialog.manifest.json +56 -4
  158. package/src/manifests/drawer.manifest.json +25 -4
  159. package/src/manifests/empty-state.manifest.json +108 -0
  160. package/src/manifests/file-upload.manifest.json +103 -0
  161. package/src/manifests/filter-bar.manifest.json +100 -0
  162. package/src/manifests/link.manifest.json +106 -0
  163. package/src/manifests/menu.manifest.json +13 -1
  164. package/src/manifests/metric-card.manifest.json +105 -0
  165. package/src/manifests/page-header.manifest.json +124 -0
  166. package/src/manifests/pagination.manifest.json +68 -34
  167. package/src/manifests/password-input.manifest.json +75 -0
  168. package/src/manifests/prose.manifest.json +75 -0
  169. package/src/manifests/search.manifest.json +41 -9
  170. package/src/manifests/section-heading.manifest.json +108 -0
  171. package/src/manifests/select-menu.manifest.json +142 -0
  172. package/src/manifests/select.manifest.json +55 -12
  173. package/src/manifests/site-footer.manifest.json +94 -0
  174. package/src/manifests/site-header.manifest.json +130 -0
  175. package/src/manifests/stepper.manifest.json +95 -0
  176. package/src/manifests/table-card.manifest.json +123 -0
  177. package/src/manifests/table-of-contents.manifest.json +87 -0
  178. package/src/manifests/time-picker.manifest.json +86 -0
  179. package/src/manifests/timeline.manifest.json +69 -0
  180. package/src/manifests/toast.manifest.json +101 -25
  181. package/src/test/tailwind-v4.test.ts +103 -0
@@ -0,0 +1,100 @@
1
+ {
2
+ "id": "filter-bar",
3
+ "name": "FilterBar",
4
+ "tier": "molecule",
5
+ "description": "List-page filter strip: search field, filter controls, reset affordance and trailing actions.",
6
+ "designIntent": "Filter rows drift: some pages wrap, some scroll, resets appear inconsistently. FilterBar fixes the order (search → filters → reset → trailing) and keeps the strip compact on narrow screens.",
7
+ "props": [
8
+ {
9
+ "name": "searchValue",
10
+ "type": "string",
11
+ "required": false,
12
+ "description": "Controlled search text."
13
+ },
14
+ {
15
+ "name": "onSearchChange",
16
+ "type": "(value: string) => void",
17
+ "required": false,
18
+ "description": "Fires on each keystroke; hides the search box when omitted."
19
+ },
20
+ {
21
+ "name": "searchPlaceholder",
22
+ "type": "string",
23
+ "required": false,
24
+ "defaultValue": "Search…",
25
+ "description": "Search input placeholder (also its accessible name)."
26
+ },
27
+ {
28
+ "name": "onReset",
29
+ "type": "() => void",
30
+ "required": false,
31
+ "description": "Shows a reset button when provided."
32
+ },
33
+ {
34
+ "name": "activeCount",
35
+ "type": "number",
36
+ "required": false,
37
+ "defaultValue": "0",
38
+ "description": "Active filter count appended to the reset label."
39
+ },
40
+ {
41
+ "name": "trailing",
42
+ "type": "ReactNode",
43
+ "required": false,
44
+ "description": "Far-right actions (bulk actions, column settings)."
45
+ }
46
+ ],
47
+ "examples": [
48
+ {
49
+ "title": "List filters",
50
+ "code": "<FilterBar\n searchValue={query}\n onSearchChange={setQuery}\n searchPlaceholder=\"Search students\"\n onReset={resetFilters}\n activeCount={activeFilters}\n>\n <Select label=\"Status\" options={statusOptions} />\n</FilterBar>",
51
+ "description": "Search, filters, reset and count in one strip."
52
+ }
53
+ ],
54
+ "antiPatterns": [
55
+ {
56
+ "title": "Don't put the primary action in the bar",
57
+ "explanation": "FilterBar is for narrowing; creation actions belong in PageHeader actions.",
58
+ "example": "// Avoid\n<FilterBar trailing={<Button>New class</Button>} />\n\n// Prefer\n<PageHeader actions={<Button>New class</Button>} />"
59
+ }
60
+ ],
61
+ "accessibility": [
62
+ {
63
+ "feature": "Search landmark",
64
+ "implementation": "Wraps controls in role=search; the search input is labelled by its placeholder",
65
+ "userRequirements": "Provide a descriptive placeholder"
66
+ }
67
+ ],
68
+ "contentGuidelines": [
69
+ {
70
+ "contentType": "Placeholder",
71
+ "guidelines": [
72
+ "Name the collection being searched"
73
+ ],
74
+ "goodExamples": [
75
+ "Search students"
76
+ ],
77
+ "badExamples": [
78
+ "Search…"
79
+ ]
80
+ }
81
+ ],
82
+ "compositionRules": [
83
+ {
84
+ "component": "Select",
85
+ "relationship": "Filter controls render in children",
86
+ "example": "<FilterBar><Select … /></FilterBar>"
87
+ }
88
+ ],
89
+ "relatedComponents": [
90
+ "DataTable",
91
+ "Select",
92
+ "Input",
93
+ "PageHeader"
94
+ ],
95
+ "package": "@slipstream-ui/core",
96
+ "importPath": "@slipstream-ui/core",
97
+ "version": "0.1.0",
98
+ "sourceDir": "filter-bar",
99
+ "exportName": "FilterBar"
100
+ }
@@ -0,0 +1,106 @@
1
+ {
2
+ "id": "link",
3
+ "name": "Link",
4
+ "tier": "atom",
5
+ "package": "@slipstream-ui/core",
6
+ "importPath": "@slipstream-ui/core",
7
+ "version": "0.1.0",
8
+ "sourceDir": "link",
9
+ "exportName": "Link",
10
+ "description": "Inline link primitive with default/muted/underline/arrow/external variants, asChild router support and safe external handling.",
11
+ "designIntent": "Every codebase re-implements inline links with inconsistent variants and unsafe target=_blank. Link centralizes the variants, keeps a real <a href> (SEO, modified clicks) and adds rel=noopener plus a screen-reader note for external URLs.",
12
+ "props": [
13
+ {
14
+ "name": "href",
15
+ "type": "string",
16
+ "required": false,
17
+ "description": "Destination URL (pass through or via asChild)."
18
+ },
19
+ {
20
+ "name": "variant",
21
+ "type": "'default' | 'muted' | 'underline' | 'arrow' | 'external'",
22
+ "required": false,
23
+ "defaultValue": "default",
24
+ "description": "Visual style.",
25
+ "enum": [
26
+ "default",
27
+ "muted",
28
+ "underline",
29
+ "arrow",
30
+ "external"
31
+ ]
32
+ },
33
+ {
34
+ "name": "asChild",
35
+ "type": "boolean",
36
+ "required": false,
37
+ "defaultValue": "false",
38
+ "description": "Render the child (router Link) with link styling."
39
+ },
40
+ {
41
+ "name": "external",
42
+ "type": "boolean",
43
+ "required": false,
44
+ "description": "Force external handling; absolute http(s) URLs are auto-detected, mailto/tel never open a new tab."
45
+ }
46
+ ],
47
+ "examples": [
48
+ {
49
+ "title": "Inline link",
50
+ "code": "<Link href=\"/docs\">Read the docs</Link>\n<Link href=\"https://github.com\" variant=\"external\">GitHub</Link>",
51
+ "description": "Internal links stay client-side; absolute URLs open safely in a new tab."
52
+ },
53
+ {
54
+ "title": "Router link",
55
+ "code": "<Link asChild variant=\"underline\"><RouterLink href=\"/posts\">Posts</RouterLink></Link>",
56
+ "description": "Preserves prefetch and modified-click behavior."
57
+ }
58
+ ],
59
+ "antiPatterns": [
60
+ {
61
+ "title": "Don't use Link for buttons",
62
+ "explanation": "Actions belong in Button; Link is for navigation.",
63
+ "example": "// Avoid\n<Link href=\"#\" onClick={save}>Save</Link>\n\n// Prefer\n<Button onClick={save}>Save</Button>"
64
+ }
65
+ ],
66
+ "accessibility": [
67
+ {
68
+ "feature": "Real anchors",
69
+ "implementation": "Renders <a href> so middle-click/modified clicks work",
70
+ "userRequirements": "Pass descriptive link text, not 'click here'"
71
+ },
72
+ {
73
+ "feature": "External notice",
74
+ "implementation": "External links get rel=noopener noreferrer and a screen-reader note",
75
+ "userRequirements": "Keep the sr-only note when overriding rows"
76
+ }
77
+ ],
78
+ "contentGuidelines": [
79
+ {
80
+ "contentType": "Link text",
81
+ "guidelines": [
82
+ "Describe the destination",
83
+ "2-5 words"
84
+ ],
85
+ "goodExamples": [
86
+ "Read the docs",
87
+ "View on GitHub"
88
+ ],
89
+ "badExamples": [
90
+ "Click here"
91
+ ]
92
+ }
93
+ ],
94
+ "compositionRules": [
95
+ {
96
+ "component": "Card / List",
97
+ "relationship": "asChild makes whole-card links safe",
98
+ "example": "<Card asChild><Link href=\"/post\">…</Link></Card>"
99
+ }
100
+ ],
101
+ "relatedComponents": [
102
+ "Button",
103
+ "Breadcrumb",
104
+ "Card"
105
+ ]
106
+ }
@@ -35,9 +35,21 @@
35
35
  "defaultValue": "false",
36
36
  "required": false,
37
37
  "type": "boolean"
38
+ },
39
+ {
40
+ "name": "asChild",
41
+ "type": "boolean",
42
+ "required": false,
43
+ "defaultValue": "false",
44
+ "description": "Render the child element (e.g. an <a>) as the menu item (MenuItem)."
38
45
  }
39
46
  ],
40
47
  "examples": [
48
+ {
49
+ "title": "Link menu item",
50
+ "code": "<MenuItem asChild>\n <a href=\"/settings\">Settings</a>\n</MenuItem>",
51
+ "description": "Navigation items keep menuitem semantics."
52
+ },
41
53
  {
42
54
  "title": "Actions menu",
43
55
  "code": "<Menu>\n <MenuTrigger>Options</MenuTrigger>\n <MenuContent>\n <MenuLabel>Actions</MenuLabel>\n <MenuItem>Profile</MenuItem>\n <MenuItem>Settings</MenuItem>\n <MenuSeparator />\n <MenuItem destructive>Sign out</MenuItem>\n </MenuContent>\n</Menu>",
@@ -111,4 +123,4 @@
111
123
  "version": "0.1.0",
112
124
  "sourceDir": "menu",
113
125
  "exportName": "Menu"
114
- }
126
+ }
@@ -0,0 +1,105 @@
1
+ {
2
+ "id": "metric-card",
3
+ "name": "MetricCard",
4
+ "tier": "molecule",
5
+ "description": "KPI tile: label, value, directional delta (arrow + color) and supporting hint.",
6
+ "designIntent": "Dashboards need comparable tiles. MetricCard standardizes tabular numbers, delta direction (never color-only) and the label/value/hint hierarchy so rows of KPIs align.",
7
+ "props": [
8
+ {
9
+ "name": "label",
10
+ "type": "string",
11
+ "required": true,
12
+ "description": "Metric name."
13
+ },
14
+ {
15
+ "name": "value",
16
+ "type": "string | number",
17
+ "required": true,
18
+ "description": "Primary number/value; rendered tabular."
19
+ },
20
+ {
21
+ "name": "delta",
22
+ "type": "string",
23
+ "required": false,
24
+ "description": "Signed change, e.g. +12.4%."
25
+ },
26
+ {
27
+ "name": "trend",
28
+ "type": "'up' | 'down' | 'flat'",
29
+ "required": false,
30
+ "defaultValue": "flat",
31
+ "description": "Delta direction color + arrow glyph.",
32
+ "enum": [
33
+ "up",
34
+ "down",
35
+ "flat"
36
+ ]
37
+ },
38
+ {
39
+ "name": "hint",
40
+ "type": "string",
41
+ "required": false,
42
+ "description": "Comparison context (vs last month)."
43
+ },
44
+ {
45
+ "name": "icon",
46
+ "type": "ReactNode",
47
+ "required": false,
48
+ "description": "Decorative icon."
49
+ }
50
+ ],
51
+ "examples": [
52
+ {
53
+ "title": "KPI row",
54
+ "code": "<div className=\"grid gap-4 sm:grid-cols-3\">\n <MetricCard label=\"Revenue\" value=\"$12,480\" delta=\"+12.4%\" trend=\"up\" hint=\"vs last month\" />\n <MetricCard label=\"Churn\" value=\"2.1%\" delta=\"-0.4\" trend=\"down\" />\n</div>",
55
+ "description": "Deltas carry arrows as well as color."
56
+ }
57
+ ],
58
+ "antiPatterns": [
59
+ {
60
+ "title": "Don't encode meaning in color alone",
61
+ "explanation": "Always pass trend so the arrow glyph accompanies the color.",
62
+ "example": "// Avoid\n<MetricCard label=\"Churn\" value=\"2.1%\" delta=\"-0.4\" />\n\n// Prefer\n<MetricCard label=\"Churn\" value=\"2.1%\" delta=\"-0.4\" trend=\"down\" />"
63
+ }
64
+ ],
65
+ "accessibility": [
66
+ {
67
+ "feature": "Color-independent direction",
68
+ "implementation": "Delta renders ↑/↓/→ glyphs alongside color",
69
+ "userRequirements": "Include the sign in the delta string"
70
+ }
71
+ ],
72
+ "contentGuidelines": [
73
+ {
74
+ "contentType": "Labels",
75
+ "guidelines": [
76
+ "Short metric names",
77
+ "State the unit in value or hint"
78
+ ],
79
+ "goodExamples": [
80
+ "Revenue",
81
+ "Active students"
82
+ ],
83
+ "badExamples": [
84
+ "Total revenue generated across all locations"
85
+ ]
86
+ }
87
+ ],
88
+ "compositionRules": [
89
+ {
90
+ "component": "Grid",
91
+ "relationship": "Lay KPI rows out with Grid for even columns",
92
+ "example": "<Grid columns={3} gap=\"md\"><MetricCard … /></Grid>"
93
+ }
94
+ ],
95
+ "relatedComponents": [
96
+ "Card",
97
+ "Grid",
98
+ "Progress"
99
+ ],
100
+ "package": "@slipstream-ui/core",
101
+ "importPath": "@slipstream-ui/core",
102
+ "version": "0.1.0",
103
+ "sourceDir": "metric-card",
104
+ "exportName": "MetricCard"
105
+ }
@@ -0,0 +1,124 @@
1
+ {
2
+ "id": "page-header",
3
+ "name": "PageHeader",
4
+ "tier": "molecule",
5
+ "description": "Standard page heading: optional breadcrumbs, level-1 title, description, right-aligned actions and a sub-row slot.",
6
+ "designIntent": "Every list/detail page repeats breadcrumb + title + description + actions with drifting spacing. PageHeader fixes the hierarchy (one h1 per page) and the responsive wrap, so pages stay consistent.",
7
+ "props": [
8
+ {
9
+ "name": "title",
10
+ "type": "string",
11
+ "required": true,
12
+ "description": "Page heading rendered as h1."
13
+ },
14
+ {
15
+ "name": "description",
16
+ "type": "string",
17
+ "required": false,
18
+ "description": "Supporting summary under the title."
19
+ },
20
+ {
21
+ "name": "breadcrumbs",
22
+ "type": "ReactNode",
23
+ "required": false,
24
+ "description": "Trail rendered above the title."
25
+ },
26
+ {
27
+ "name": "actions",
28
+ "type": "ReactNode",
29
+ "required": false,
30
+ "description": "Right-aligned actions (buttons, menus)."
31
+ },
32
+ {
33
+ "name": "children",
34
+ "type": "ReactNode",
35
+ "required": false,
36
+ "description": "Sub-row under the title (tabs, filters)."
37
+ },
38
+ {
39
+ "name": "eyebrow",
40
+ "type": "ReactNode",
41
+ "required": false,
42
+ "description": "Kicker above the title."
43
+ },
44
+ {
45
+ "name": "size",
46
+ "type": "'sm' | 'md' | 'lg' | 'hero'",
47
+ "required": false,
48
+ "defaultValue": "md",
49
+ "description": "Heading scale; hero is for marketing pages.",
50
+ "enum": [
51
+ "sm",
52
+ "md",
53
+ "lg",
54
+ "hero"
55
+ ]
56
+ },
57
+ {
58
+ "name": "align",
59
+ "type": "'left' | 'center'",
60
+ "required": false,
61
+ "defaultValue": "left",
62
+ "description": "Text alignment.",
63
+ "enum": [
64
+ "left",
65
+ "center"
66
+ ]
67
+ }
68
+ ],
69
+ "examples": [
70
+ {
71
+ "title": "List page header",
72
+ "code": "<PageHeader\n title=\"Classes\"\n description=\"Manage your weekly schedule.\"\n breadcrumbs={<Breadcrumb … />}\n actions={<Button>New class</Button>}\n/>",
73
+ "description": "One h1, one action cluster."
74
+ }
75
+ ],
76
+ "antiPatterns": [
77
+ {
78
+ "title": "Don't stack multiple h1s",
79
+ "explanation": "PageHeader renders the page's h1; section headings inside the page should be h2 via Heading.",
80
+ "example": "// Avoid\n<PageHeader title=\"A\" /><PageHeader title=\"B\" />\n\n// Prefer one PageHeader per page"
81
+ }
82
+ ],
83
+ "accessibility": [
84
+ {
85
+ "feature": "Heading hierarchy",
86
+ "implementation": "Renders exactly one level-1 heading",
87
+ "userRequirements": "Use Heading level={2} for sections below"
88
+ }
89
+ ],
90
+ "contentGuidelines": [
91
+ {
92
+ "contentType": "Titles",
93
+ "guidelines": [
94
+ "Noun or noun phrase",
95
+ "Sentence case",
96
+ "Under 60 characters"
97
+ ],
98
+ "goodExamples": [
99
+ "Classes",
100
+ "Billing settings"
101
+ ],
102
+ "badExamples": [
103
+ "Here you can manage all of your classes"
104
+ ]
105
+ }
106
+ ],
107
+ "compositionRules": [
108
+ {
109
+ "component": "Breadcrumb",
110
+ "relationship": "Pass a Breadcrumb as breadcrumbs for hierarchy context",
111
+ "example": "<PageHeader breadcrumbs={<Breadcrumb items={trail} />} title=\"Detail\" />"
112
+ }
113
+ ],
114
+ "relatedComponents": [
115
+ "Breadcrumb",
116
+ "Heading",
117
+ "Tabs"
118
+ ],
119
+ "package": "@slipstream-ui/core",
120
+ "importPath": "@slipstream-ui/core",
121
+ "version": "0.1.0",
122
+ "sourceDir": "page-header",
123
+ "exportName": "PageHeader"
124
+ }
@@ -2,81 +2,115 @@
2
2
  "id": "pagination",
3
3
  "name": "Pagination",
4
4
  "tier": "molecule",
5
- "description": "Numeric pagination with prev/next, ellipsis, and aria-current on the active page",
5
+ "description": "Numeric pagination with prev/next and boundary jumps; accepts page/pageCount or currentPage/totalPages and derives the count (plus a Showing X-Y of Z summary) from total/pageSize.",
6
6
  "designIntent": "Pagination lets users navigate through paged content. It shows page numbers with ellipsis for large ranges, prev/next buttons, and marks the current page with aria-current=page.",
7
7
  "props": [
8
8
  {
9
9
  "name": "page",
10
10
  "type": "number",
11
- "required": true,
12
- "description": "Current page number (1-based)"
11
+ "required": false,
12
+ "defaultValue": "1",
13
+ "description": "Current page (1-based). Alias: currentPage."
13
14
  },
14
15
  {
15
16
  "name": "pageCount",
16
17
  "type": "number",
17
- "required": true,
18
- "description": "Total number of pages"
18
+ "required": false,
19
+ "description": "Total pages. Alias: totalPages, or derived from total/pageSize."
20
+ },
21
+ {
22
+ "name": "currentPage",
23
+ "type": "number",
24
+ "required": false,
25
+ "description": "Alias for page (migration-friendly)."
26
+ },
27
+ {
28
+ "name": "totalPages",
29
+ "type": "number",
30
+ "required": false,
31
+ "description": "Alias for pageCount."
32
+ },
33
+ {
34
+ "name": "pageSize",
35
+ "type": "number",
36
+ "required": false,
37
+ "description": "Rows per page; with total enables the summary and derives pageCount."
38
+ },
39
+ {
40
+ "name": "total",
41
+ "type": "number",
42
+ "required": false,
43
+ "description": "Total item count for the summary."
44
+ },
45
+ {
46
+ "name": "itemLabel",
47
+ "type": "string",
48
+ "required": false,
49
+ "defaultValue": "items",
50
+ "description": "Noun used in the summary."
51
+ },
52
+ {
53
+ "name": "showSummary",
54
+ "type": "boolean",
55
+ "required": false,
56
+ "description": "Force the summary on/off (defaults on when total and pageSize are set)."
19
57
  },
20
58
  {
21
59
  "name": "onPageChange",
22
60
  "type": "(page: number) => void",
23
61
  "required": false,
24
- "description": "Called with the new page number"
62
+ "description": "Called with the new page number."
25
63
  },
26
64
  {
27
65
  "name": "siblings",
28
66
  "type": "number",
29
- "defaultValue": "1",
30
67
  "required": false,
31
- "description": "How many page buttons to show around the current page"
68
+ "defaultValue": "1",
69
+ "description": "Page buttons shown around the current page."
32
70
  },
33
71
  {
34
72
  "name": "showBoundaries",
35
73
  "type": "boolean",
36
- "defaultValue": "false",
37
- "required": false,
38
- "description": "Show « / » jump-to-first/last buttons around prev/next",
39
- "examples": [
40
- "true",
41
- "false"
42
- ]
43
- },
44
- {
45
- "name": "className",
46
- "type": "string",
47
74
  "required": false,
48
- "description": "Additional CSS classes to apply"
75
+ "defaultValue": "false",
76
+ "description": "Show first/last jump buttons."
49
77
  },
50
78
  {
51
79
  "name": "showFirst",
52
80
  "type": "boolean",
53
- "defaultValue": "showBoundaries",
54
81
  "required": false,
55
- "description": "Force-show the first-page button; defaults to showBoundaries.",
56
- "examples": [
57
- "true",
58
- "false"
59
- ]
82
+ "description": "Force-show the first-page button."
60
83
  },
61
84
  {
62
85
  "name": "showLast",
63
86
  "type": "boolean",
64
- "defaultValue": "showBoundaries",
65
87
  "required": false,
66
- "description": "Force-show the last-page button; defaults to showBoundaries.",
67
- "examples": [
68
- "true",
69
- "false"
70
- ]
88
+ "description": "Force-show the last-page button."
71
89
  },
72
90
  {
73
91
  "name": "icons",
74
- "type": "{ first?: ReactNode; previous?: ReactNode; next?: ReactNode; last?: ReactNode }",
92
+ "type": "PaginationIcons",
75
93
  "required": false,
76
- "description": "Replace the default ‹ › « » glyphs with custom markup."
94
+ "description": "Replace the default glyphs."
95
+ },
96
+ {
97
+ "name": "labels",
98
+ "type": "{ pagination?: string; first?: string; previous?: string; next?: string; last?: string; page?: (page: number) => string }",
99
+ "required": false,
100
+ "description": "Localized landmark and control labels."
77
101
  }
78
102
  ],
79
103
  "examples": [
104
+ {
105
+ "title": "Summary + derived pages",
106
+ "code": "<Pagination\n page={page}\n pageSize={25}\n total={312}\n itemLabel=\"students\"\n onPageChange={setPage}\n/>",
107
+ "description": "Renders \"Showing 26–50 of 312 students\" and derives 13 pages."
108
+ },
109
+ {
110
+ "title": "Migration aliases",
111
+ "code": "<Pagination currentPage={page} totalPages={pages} onPageChange={setPage} />",
112
+ "description": "currentPage/totalPages map onto page/pageCount."
113
+ },
80
114
  {
81
115
  "title": "Basic pagination",
82
116
  "code": "<Pagination page={3} pageCount={10} onPageChange={setPage} />",