@slipstream-ui/core 0.9.0 → 0.10.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 (255) hide show
  1. package/dist/index.d.mts +19 -0
  2. package/dist/index.d.ts +19 -0
  3. package/dist/index.js +96 -46
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +96 -46
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/manifests/accordion.manifest.json +1 -1
  8. package/dist/manifests/alert.manifest.json +1 -1
  9. package/dist/manifests/announcement-bar.manifest.json +1 -1
  10. package/dist/manifests/app-shell.manifest.json +1 -1
  11. package/dist/manifests/applied-filters.manifest.json +1 -1
  12. package/dist/manifests/article-card.manifest.json +1 -1
  13. package/dist/manifests/auth-layout.manifest.json +1 -1
  14. package/dist/manifests/autocomplete.manifest.json +1 -1
  15. package/dist/manifests/avatar.manifest.json +1 -1
  16. package/dist/manifests/badge.manifest.json +1 -1
  17. package/dist/manifests/block.manifest.json +1 -1
  18. package/dist/manifests/bottom-nav.manifest.json +1 -1
  19. package/dist/manifests/breadcrumb.manifest.json +1 -1
  20. package/dist/manifests/button-group.manifest.json +1 -1
  21. package/dist/manifests/button.manifest.json +1 -1
  22. package/dist/manifests/calendar.manifest.json +1 -1
  23. package/dist/manifests/card.manifest.json +1 -1
  24. package/dist/manifests/checkbox.manifest.json +1 -1
  25. package/dist/manifests/comparison-table.manifest.json +1 -1
  26. package/dist/manifests/confirm-dialog.manifest.json +1 -1
  27. package/dist/manifests/contact-strip.manifest.json +1 -1
  28. package/dist/manifests/container.manifest.json +1 -1
  29. package/dist/manifests/cta-section.manifest.json +1 -1
  30. package/dist/manifests/data-table.manifest.json +1 -1
  31. package/dist/manifests/date-picker-popover.manifest.json +1 -1
  32. package/dist/manifests/date-picker.manifest.json +1 -1
  33. package/dist/manifests/date-range-picker.manifest.json +1 -1
  34. package/dist/manifests/deal-card.manifest.json +1 -1
  35. package/dist/manifests/dialog.manifest.json +1 -1
  36. package/dist/manifests/document-card.manifest.json +1 -1
  37. package/dist/manifests/drawer.manifest.json +1 -1
  38. package/dist/manifests/empty-state.manifest.json +1 -1
  39. package/dist/manifests/entity-card.manifest.json +1 -1
  40. package/dist/manifests/feature-grid.manifest.json +1 -1
  41. package/dist/manifests/feature-row.manifest.json +1 -1
  42. package/dist/manifests/fieldset.manifest.json +1 -1
  43. package/dist/manifests/file-upload.manifest.json +1 -1
  44. package/dist/manifests/filter-bar.manifest.json +1 -1
  45. package/dist/manifests/filter-chips.manifest.json +13 -1
  46. package/dist/manifests/filter-panel.manifest.json +1 -1
  47. package/dist/manifests/flex.manifest.json +1 -1
  48. package/dist/manifests/form-field.manifest.json +1 -1
  49. package/dist/manifests/form-layout.manifest.json +1 -1
  50. package/dist/manifests/form.manifest.json +1 -1
  51. package/dist/manifests/grid.manifest.json +1 -1
  52. package/dist/manifests/heading.manifest.json +1 -1
  53. package/dist/manifests/hero.manifest.json +1 -1
  54. package/dist/manifests/image.manifest.json +1 -1
  55. package/dist/manifests/input-group.manifest.json +1 -1
  56. package/dist/manifests/input.manifest.json +1 -1
  57. package/dist/manifests/label.manifest.json +1 -1
  58. package/dist/manifests/link-tabs.manifest.json +1 -1
  59. package/dist/manifests/link.manifest.json +1 -1
  60. package/dist/manifests/list.manifest.json +1 -1
  61. package/dist/manifests/load-more.manifest.json +1 -1
  62. package/dist/manifests/logo-cloud.manifest.json +1 -1
  63. package/dist/manifests/menu.manifest.json +1 -1
  64. package/dist/manifests/metric-card.manifest.json +1 -1
  65. package/dist/manifests/multi-select.manifest.json +1 -1
  66. package/dist/manifests/newsletter.manifest.json +1 -1
  67. package/dist/manifests/page-header.manifest.json +1 -1
  68. package/dist/manifests/pagination.manifest.json +1 -1
  69. package/dist/manifests/password-input.manifest.json +1 -1
  70. package/dist/manifests/popover.manifest.json +1 -1
  71. package/dist/manifests/process-steps.manifest.json +1 -1
  72. package/dist/manifests/progress.manifest.json +1 -1
  73. package/dist/manifests/prose.manifest.json +1 -1
  74. package/dist/manifests/radio.manifest.json +1 -1
  75. package/dist/manifests/range-slider.manifest.json +1 -1
  76. package/dist/manifests/search.manifest.json +1 -1
  77. package/dist/manifests/section-heading.manifest.json +1 -1
  78. package/dist/manifests/section.manifest.json +1 -1
  79. package/dist/manifests/segmented-control.manifest.json +1 -1
  80. package/dist/manifests/select-menu.manifest.json +1 -1
  81. package/dist/manifests/select.manifest.json +8 -1
  82. package/dist/manifests/separator.manifest.json +1 -1
  83. package/dist/manifests/site-footer.manifest.json +1 -1
  84. package/dist/manifests/site-header.manifest.json +1 -1
  85. package/dist/manifests/skeleton.manifest.json +1 -1
  86. package/dist/manifests/spinner.manifest.json +1 -1
  87. package/dist/manifests/stat-band.manifest.json +1 -1
  88. package/dist/manifests/stepper.manifest.json +1 -1
  89. package/dist/manifests/switch.manifest.json +1 -1
  90. package/dist/manifests/table-card.manifest.json +1 -1
  91. package/dist/manifests/table-of-contents.manifest.json +1 -1
  92. package/dist/manifests/table.manifest.json +1 -1
  93. package/dist/manifests/tabs.manifest.json +1 -1
  94. package/dist/manifests/testimonial.manifest.json +1 -1
  95. package/dist/manifests/text.manifest.json +1 -1
  96. package/dist/manifests/textarea.manifest.json +1 -1
  97. package/dist/manifests/theme-toggle.manifest.json +1 -1
  98. package/dist/manifests/time-picker.manifest.json +1 -1
  99. package/dist/manifests/timeline.manifest.json +1 -1
  100. package/dist/manifests/toast.manifest.json +1 -1
  101. package/dist/manifests/tombstone-card.manifest.json +1 -1
  102. package/dist/manifests/tooltip.manifest.json +12 -1
  103. package/dist/src/components/accordion/Accordion.js +26 -19
  104. package/dist/src/components/accordion/Accordion.js.map +1 -1
  105. package/dist/src/components/accordion/Accordion.mjs +26 -19
  106. package/dist/src/components/accordion/Accordion.mjs.map +1 -1
  107. package/dist/src/components/checkbox/Checkbox.js +1 -1
  108. package/dist/src/components/checkbox/Checkbox.js.map +1 -1
  109. package/dist/src/components/checkbox/Checkbox.mjs +1 -1
  110. package/dist/src/components/checkbox/Checkbox.mjs.map +1 -1
  111. package/dist/src/components/drawer/Drawer.js +2 -1
  112. package/dist/src/components/drawer/Drawer.js.map +1 -1
  113. package/dist/src/components/drawer/Drawer.mjs +2 -1
  114. package/dist/src/components/drawer/Drawer.mjs.map +1 -1
  115. package/dist/src/components/filter-chips/FilterChips.d.ts +4 -0
  116. package/dist/src/components/filter-chips/FilterChips.js +35 -4
  117. package/dist/src/components/filter-chips/FilterChips.js.map +1 -1
  118. package/dist/src/components/filter-chips/FilterChips.mjs +35 -4
  119. package/dist/src/components/filter-chips/FilterChips.mjs.map +1 -1
  120. package/dist/src/components/radio/Radio.js +1 -1
  121. package/dist/src/components/radio/Radio.js.map +1 -1
  122. package/dist/src/components/radio/Radio.mjs +1 -1
  123. package/dist/src/components/radio/Radio.mjs.map +1 -1
  124. package/dist/src/components/range-slider/RangeSlider.js +3 -3
  125. package/dist/src/components/range-slider/RangeSlider.js.map +1 -1
  126. package/dist/src/components/range-slider/RangeSlider.mjs +3 -3
  127. package/dist/src/components/range-slider/RangeSlider.mjs.map +1 -1
  128. package/dist/src/components/select/Select.d.ts +10 -0
  129. package/dist/src/components/select/Select.js +2 -2
  130. package/dist/src/components/select/Select.js.map +1 -1
  131. package/dist/src/components/select/Select.mjs +2 -2
  132. package/dist/src/components/select/Select.mjs.map +1 -1
  133. package/dist/src/components/timeline/Timeline.js +17 -13
  134. package/dist/src/components/timeline/Timeline.js.map +1 -1
  135. package/dist/src/components/timeline/Timeline.mjs +17 -13
  136. package/dist/src/components/timeline/Timeline.mjs.map +1 -1
  137. package/dist/src/components/tooltip/Tooltip.d.ts +5 -0
  138. package/dist/src/components/tooltip/Tooltip.js +9 -2
  139. package/dist/src/components/tooltip/Tooltip.js.map +1 -1
  140. package/dist/src/components/tooltip/Tooltip.mjs +9 -2
  141. package/dist/src/components/tooltip/Tooltip.mjs.map +1 -1
  142. package/dist/styles-full.css +1 -1
  143. package/dist/styles.css +1 -1
  144. package/package.json +1 -1
  145. package/src/components/accordion/Accordion.test.tsx +14 -3
  146. package/src/components/accordion/Accordion.tsx +34 -21
  147. package/src/components/checkbox/Checkbox.tsx +1 -1
  148. package/src/components/drawer/Drawer.test.tsx +12 -0
  149. package/src/components/drawer/Drawer.tsx +8 -1
  150. package/src/components/filter-chips/FilterChips.test.tsx +11 -0
  151. package/src/components/filter-chips/FilterChips.tsx +40 -4
  152. package/src/components/radio/Radio.tsx +1 -1
  153. package/src/components/range-slider/RangeSlider.tsx +3 -3
  154. package/src/components/select/Select.test.tsx +14 -0
  155. package/src/components/select/Select.tsx +7 -2
  156. package/src/components/timeline/Timeline.test.tsx +11 -0
  157. package/src/components/timeline/Timeline.tsx +13 -2
  158. package/src/components/tooltip/Tooltip.test.tsx +15 -0
  159. package/src/components/tooltip/Tooltip.tsx +19 -2
  160. package/src/manifests/accordion.manifest.json +1 -1
  161. package/src/manifests/alert.manifest.json +1 -1
  162. package/src/manifests/announcement-bar.manifest.json +1 -1
  163. package/src/manifests/app-shell.manifest.json +1 -1
  164. package/src/manifests/applied-filters.manifest.json +1 -1
  165. package/src/manifests/article-card.manifest.json +1 -1
  166. package/src/manifests/auth-layout.manifest.json +1 -1
  167. package/src/manifests/autocomplete.manifest.json +1 -1
  168. package/src/manifests/avatar.manifest.json +1 -1
  169. package/src/manifests/badge.manifest.json +1 -1
  170. package/src/manifests/block.manifest.json +1 -1
  171. package/src/manifests/bottom-nav.manifest.json +1 -1
  172. package/src/manifests/breadcrumb.manifest.json +1 -1
  173. package/src/manifests/button-group.manifest.json +1 -1
  174. package/src/manifests/button.manifest.json +1 -1
  175. package/src/manifests/calendar.manifest.json +1 -1
  176. package/src/manifests/card.manifest.json +1 -1
  177. package/src/manifests/checkbox.manifest.json +1 -1
  178. package/src/manifests/comparison-table.manifest.json +1 -1
  179. package/src/manifests/confirm-dialog.manifest.json +1 -1
  180. package/src/manifests/contact-strip.manifest.json +1 -1
  181. package/src/manifests/container.manifest.json +1 -1
  182. package/src/manifests/cta-section.manifest.json +1 -1
  183. package/src/manifests/data-table.manifest.json +1 -1
  184. package/src/manifests/date-picker-popover.manifest.json +1 -1
  185. package/src/manifests/date-picker.manifest.json +1 -1
  186. package/src/manifests/date-range-picker.manifest.json +1 -1
  187. package/src/manifests/deal-card.manifest.json +1 -1
  188. package/src/manifests/dialog.manifest.json +1 -1
  189. package/src/manifests/document-card.manifest.json +1 -1
  190. package/src/manifests/drawer.manifest.json +1 -1
  191. package/src/manifests/empty-state.manifest.json +1 -1
  192. package/src/manifests/entity-card.manifest.json +1 -1
  193. package/src/manifests/feature-grid.manifest.json +1 -1
  194. package/src/manifests/feature-row.manifest.json +1 -1
  195. package/src/manifests/fieldset.manifest.json +1 -1
  196. package/src/manifests/file-upload.manifest.json +1 -1
  197. package/src/manifests/filter-bar.manifest.json +1 -1
  198. package/src/manifests/filter-chips.manifest.json +13 -1
  199. package/src/manifests/filter-panel.manifest.json +1 -1
  200. package/src/manifests/flex.manifest.json +1 -1
  201. package/src/manifests/form-field.manifest.json +1 -1
  202. package/src/manifests/form-layout.manifest.json +1 -1
  203. package/src/manifests/form.manifest.json +1 -1
  204. package/src/manifests/grid.manifest.json +1 -1
  205. package/src/manifests/heading.manifest.json +1 -1
  206. package/src/manifests/hero.manifest.json +1 -1
  207. package/src/manifests/image.manifest.json +1 -1
  208. package/src/manifests/input-group.manifest.json +1 -1
  209. package/src/manifests/input.manifest.json +1 -1
  210. package/src/manifests/label.manifest.json +1 -1
  211. package/src/manifests/link-tabs.manifest.json +1 -1
  212. package/src/manifests/link.manifest.json +1 -1
  213. package/src/manifests/list.manifest.json +1 -1
  214. package/src/manifests/load-more.manifest.json +1 -1
  215. package/src/manifests/logo-cloud.manifest.json +1 -1
  216. package/src/manifests/menu.manifest.json +1 -1
  217. package/src/manifests/metric-card.manifest.json +1 -1
  218. package/src/manifests/multi-select.manifest.json +1 -1
  219. package/src/manifests/newsletter.manifest.json +1 -1
  220. package/src/manifests/page-header.manifest.json +1 -1
  221. package/src/manifests/pagination.manifest.json +1 -1
  222. package/src/manifests/password-input.manifest.json +1 -1
  223. package/src/manifests/popover.manifest.json +1 -1
  224. package/src/manifests/process-steps.manifest.json +1 -1
  225. package/src/manifests/progress.manifest.json +1 -1
  226. package/src/manifests/prose.manifest.json +1 -1
  227. package/src/manifests/radio.manifest.json +1 -1
  228. package/src/manifests/range-slider.manifest.json +1 -1
  229. package/src/manifests/search.manifest.json +1 -1
  230. package/src/manifests/section-heading.manifest.json +1 -1
  231. package/src/manifests/section.manifest.json +1 -1
  232. package/src/manifests/segmented-control.manifest.json +1 -1
  233. package/src/manifests/select-menu.manifest.json +1 -1
  234. package/src/manifests/select.manifest.json +8 -1
  235. package/src/manifests/separator.manifest.json +1 -1
  236. package/src/manifests/site-footer.manifest.json +1 -1
  237. package/src/manifests/site-header.manifest.json +1 -1
  238. package/src/manifests/skeleton.manifest.json +1 -1
  239. package/src/manifests/spinner.manifest.json +1 -1
  240. package/src/manifests/stat-band.manifest.json +1 -1
  241. package/src/manifests/stepper.manifest.json +1 -1
  242. package/src/manifests/switch.manifest.json +1 -1
  243. package/src/manifests/table-card.manifest.json +1 -1
  244. package/src/manifests/table-of-contents.manifest.json +1 -1
  245. package/src/manifests/table.manifest.json +1 -1
  246. package/src/manifests/tabs.manifest.json +1 -1
  247. package/src/manifests/testimonial.manifest.json +1 -1
  248. package/src/manifests/text.manifest.json +1 -1
  249. package/src/manifests/textarea.manifest.json +1 -1
  250. package/src/manifests/theme-toggle.manifest.json +1 -1
  251. package/src/manifests/time-picker.manifest.json +1 -1
  252. package/src/manifests/timeline.manifest.json +1 -1
  253. package/src/manifests/toast.manifest.json +1 -1
  254. package/src/manifests/tombstone-card.manifest.json +1 -1
  255. package/src/manifests/tooltip.manifest.json +12 -1
@@ -201,29 +201,42 @@ const AccordionContent = React.forwardRef<HTMLDivElement, AccordionContentProps>
201
201
  // Expansion animation via grid-template-rows (0fr -> 1fr): supported
202
202
  // in Chrome 117+/Firefox 66+/Safari 17+, and degrades to an instant
203
203
  // toggle elsewhere because the rows value simply stops interpolating.
204
- // The `hidden` attribute stays bound to `open` (synchronous) so panels
205
- // are removed from the a11y tree and tab order the moment they close.
204
+ //
205
+ // Closing keeps the panel mounted for the transition window. Binding
206
+ // `hidden` straight to `open` removed the panel on the closing frame, so
207
+ // collapse was a jump cut with no animation at all.
208
+ const [mounted, setMounted] = React.useState(open);
206
209
  const [expanded, setExpanded] = React.useState(open);
210
+
207
211
  React.useEffect(() => {
208
- if (!open) {
209
- setExpanded(false);
210
- return;
211
- }
212
212
  const reduce =
213
213
  typeof window.matchMedia === 'function' &&
214
214
  window.matchMedia('(prefers-reduced-motion: reduce)').matches;
215
+
216
+ if (open) {
217
+ setMounted(true);
218
+ if (reduce) {
219
+ setExpanded(true);
220
+ return;
221
+ }
222
+ // Paint the collapsed frame first so the row transition has a start.
223
+ let second = 0;
224
+ const first = requestAnimationFrame(() => {
225
+ second = requestAnimationFrame(() => setExpanded(true));
226
+ });
227
+ return () => {
228
+ cancelAnimationFrame(first);
229
+ cancelAnimationFrame(second);
230
+ };
231
+ }
232
+
233
+ setExpanded(false);
215
234
  if (reduce) {
216
- setExpanded(true);
235
+ setMounted(false);
217
236
  return;
218
237
  }
219
- let second = 0;
220
- const first = requestAnimationFrame(() => {
221
- second = requestAnimationFrame(() => setExpanded(true));
222
- });
223
- return () => {
224
- cancelAnimationFrame(first);
225
- cancelAnimationFrame(second);
226
- };
238
+ const timer = setTimeout(() => setMounted(false), 320);
239
+ return () => clearTimeout(timer);
227
240
  }, [open]);
228
241
 
229
242
  return (
@@ -232,16 +245,16 @@ const AccordionContent = React.forwardRef<HTMLDivElement, AccordionContentProps>
232
245
  id={`${id}-panel`}
233
246
  role="region"
234
247
  aria-labelledby={`${id}-trigger`}
235
- hidden={!open}
248
+ aria-hidden={open ? undefined : true}
249
+ hidden={!mounted}
236
250
  className={cn(
237
- // No display utility while closed: author styles would beat the
251
+ // No display utility while unmounted: author styles would beat the
238
252
  // UA [hidden] rule and keep the collapsed panel visible.
239
- open &&
253
+ mounted &&
240
254
  cn(
241
- 'grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none',
242
- expanded ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]'
255
+ 'grid transition-[grid-template-rows,opacity] duration-300 ease-out motion-reduce:transition-none',
256
+ expanded ? 'grid-rows-[1fr] opacity-100' : 'grid-rows-[0fr] pointer-events-none opacity-0'
243
257
  ),
244
- !open && 'grid-rows-[0fr]',
245
258
  className
246
259
  )}
247
260
  {...props}
@@ -24,7 +24,7 @@ const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(
24
24
  onChange?.(event);
25
25
  }}
26
26
  className={cn(
27
- 'peer h-4 w-4 shrink-0 rounded-sm border border-primary',
27
+ 'peer h-4 w-4 shrink-0 rounded-sm border border-primary accent-primary',
28
28
  'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',
29
29
  'disabled:cursor-not-allowed disabled:opacity-50',
30
30
  'checked:bg-primary checked:text-primary-foreground',
@@ -67,6 +67,18 @@ describe('Drawer', () => {
67
67
  });
68
68
 
69
69
  describe('Drawer animate (optional slide)', () => {
70
+ it('dims the backdrop so content never flashes through on close', () => {
71
+ render(
72
+ <Drawer open animate onOpenChange={vi.fn()} title="Sliding" side="right">
73
+ body
74
+ </Drawer>
75
+ );
76
+ const backdrop = document.body.querySelector('.fixed.inset-0');
77
+ expect(backdrop).toHaveClass('bg-background/80');
78
+ expect(backdrop).toHaveClass('animate-in');
79
+ expect(backdrop?.className).toContain('fade-in-0');
80
+ });
81
+
70
82
  it('applies side-aware slide-in classes when animate is on', () => {
71
83
  render(
72
84
  <Drawer open animate onOpenChange={vi.fn()} title="Sliding" side="left">
@@ -306,9 +306,16 @@ export function Drawer({
306
306
  )
307
307
  : undefined;
308
308
 
309
+ // The backdrop dims and fades with the panel. Without it the page showed
310
+ // through at full brightness while the drawer slid out, which read as a
311
+ // content flash during close.
312
+ const backdropMotion = animate
313
+ ? cn('motion-reduce:animate-none', exiting ? 'animate-out fade-out-0' : 'animate-in fade-in-0')
314
+ : undefined;
315
+
309
316
  return createPortal(
310
317
  <div
311
- className="fixed inset-0 z-50"
318
+ className={cn('fixed inset-0 z-50 bg-background/80', backdropMotion)}
312
319
  onMouseDown={(event) => {
313
320
  if (closeOnBackdrop && event.target === event.currentTarget) requestClose();
314
321
  }}
@@ -19,6 +19,17 @@ describe('FilterChips', () => {
19
19
  expect(onRemove).toHaveBeenCalled();
20
20
  });
21
21
 
22
+ it('scales the chip set with size', () => {
23
+ const { rerender, container } = render(
24
+ <FilterChips size="sm" filters={[{ key: 'type', label: 'Type', value: 'PE' }]} />
25
+ );
26
+ expect(container.querySelector('span.text-xs')).not.toBeNull();
27
+ rerender(
28
+ <FilterChips size="lg" filters={[{ key: 'type', label: 'Type', value: 'PE' }]} />
29
+ );
30
+ expect(container.querySelector('span.text-base')).not.toBeNull();
31
+ });
32
+
22
33
  it('renders a clear-all action', () => {
23
34
  const onClearAll = vi.fn();
24
35
  render(
@@ -17,6 +17,8 @@ export type FilterChip = {
17
17
  export type FilterChipsProps = React.HTMLAttributes<HTMLDivElement> & {
18
18
  /** Active filters to render. */
19
19
  filters: FilterChip[];
20
+ /** Chip scale. Default 'md'. */
21
+ size?: 'sm' | 'md' | 'lg';
20
22
  /** Shows a clear-all action when provided. */
21
23
  onClearAll?: () => void;
22
24
  /** Label for the clear-all action. Default "Clear all". */
@@ -25,6 +27,28 @@ export type FilterChipsProps = React.HTMLAttributes<HTMLDivElement> & {
25
27
  emptyLabel?: string;
26
28
  };
27
29
 
30
+ /** Literal size maps so the scanner keeps every chip utility. */
31
+ const CHIP_SIZES = {
32
+ sm: {
33
+ chip: 'gap-1 py-0.5 pl-2.5 pr-0.5 text-xs',
34
+ remove: 'p-0.5',
35
+ icon: 'h-3 w-3',
36
+ clear: 'text-xs',
37
+ },
38
+ md: {
39
+ chip: 'gap-1.5 py-1 pl-3 pr-1 text-sm',
40
+ remove: 'p-1',
41
+ icon: 'h-3.5 w-3.5',
42
+ clear: 'text-sm',
43
+ },
44
+ lg: {
45
+ chip: 'gap-2 py-1.5 pl-3.5 pr-1.5 text-base',
46
+ remove: 'p-1.5',
47
+ icon: 'h-4 w-4',
48
+ clear: 'text-base',
49
+ },
50
+ } as const;
51
+
28
52
  /**
29
53
  * Active-filter summary for list and dashboard pages. Each chip pairs a
30
54
  * filter name with its current value and exposes a remove action; an optional
@@ -34,6 +58,7 @@ export type FilterChipsProps = React.HTMLAttributes<HTMLDivElement> & {
34
58
  export const FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(function FilterChips(
35
59
  {
36
60
  filters,
61
+ size = 'md',
37
62
  onClearAll,
38
63
  clearLabel = 'Clear all',
39
64
  emptyLabel,
@@ -51,6 +76,8 @@ export const FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(fu
51
76
  ) : null;
52
77
  }
53
78
 
79
+ const scale = CHIP_SIZES[size];
80
+
54
81
  return (
55
82
  <div
56
83
  ref={ref}
@@ -62,7 +89,10 @@ export const FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(fu
62
89
  {filters.map((filter) => (
63
90
  <span
64
91
  key={filter.key}
65
- className="inline-flex max-w-full items-center gap-1.5 rounded-full border border-border bg-muted/60 py-1 pl-3 pr-1 text-sm"
92
+ className={cn(
93
+ 'inline-flex max-w-full items-center rounded-full border border-border bg-muted/60',
94
+ scale.chip
95
+ )}
66
96
  >
67
97
  <span className="truncate">
68
98
  <span className="text-muted-foreground">{filter.label}:</span>{' '}
@@ -73,9 +103,12 @@ export const FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(fu
73
103
  type="button"
74
104
  onClick={filter.onRemove}
75
105
  aria-label={`Remove ${filter.label}${filter.value ? `: ${filter.value}` : ''}`}
76
- className="rounded-full p-1 text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
106
+ className={cn(
107
+ 'rounded-full text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
108
+ scale.remove
109
+ )}
77
110
  >
78
- <svg aria-hidden="true" viewBox="0 0 20 20" className="h-3.5 w-3.5" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
111
+ <svg aria-hidden="true" viewBox="0 0 20 20" className={scale.icon} fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
79
112
  <path d="m5 5 10 10M15 5 5 15" />
80
113
  </svg>
81
114
  </button>
@@ -86,7 +119,10 @@ export const FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(fu
86
119
  <button
87
120
  type="button"
88
121
  onClick={onClearAll}
89
- className="rounded-sm px-1 text-sm font-medium text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
122
+ className={cn(
123
+ 'rounded-sm px-1 font-medium text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
124
+ scale.clear
125
+ )}
90
126
  >
91
127
  {clearLabel}
92
128
  </button>
@@ -26,7 +26,7 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
26
26
  onChange?.(event);
27
27
  }}
28
28
  className={cn(
29
- 'h-4 w-4 shrink-0 rounded-full border border-primary',
29
+ 'h-4 w-4 shrink-0 rounded-full border border-primary accent-primary',
30
30
  'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',
31
31
  'disabled:cursor-not-allowed disabled:opacity-50',
32
32
  'checked:bg-primary checked:text-primary-foreground',
@@ -34,9 +34,9 @@ export type RangeSliderProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onCha
34
34
  const rangeInputClass = cn(
35
35
  'pointer-events-none absolute inset-x-0 top-1/2 h-6 w-full -translate-y-1/2 appearance-none bg-transparent',
36
36
  '[&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-transparent',
37
- '[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-primary [&::-webkit-slider-thumb]:bg-background [&::-webkit-slider-thumb]:shadow',
37
+ '[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-md',
38
38
  '[&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent',
39
- '[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-primary [&::-moz-range-thumb]:bg-background [&::-moz-range-thumb]:shadow',
39
+ '[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-md',
40
40
  'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',
41
41
  'disabled:cursor-not-allowed disabled:opacity-50'
42
42
  );
@@ -92,7 +92,7 @@ export const RangeSlider = React.forwardRef<HTMLDivElement, RangeSliderProps>(fu
92
92
  </div>
93
93
  )}
94
94
  <div className="relative h-6 w-full">
95
- <div className="absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-muted" />
95
+ <div className="absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-border" />
96
96
  <div
97
97
  className="absolute top-1/2 h-1 -translate-y-1/2 rounded-full bg-primary"
98
98
  style={{ left: `${lowPercent}%`, right: `${100 - highPercent}%` }}
@@ -20,6 +20,20 @@ describe('Select', () => {
20
20
  expect(select).toBeInTheDocument();
21
21
  });
22
22
 
23
+ it('can hide the label visually while keeping it accessible', () => {
24
+ render(
25
+ <Select
26
+ label="Status"
27
+ labelHidden
28
+ options={[{ value: 'all', label: 'All' }]}
29
+ defaultValue="all"
30
+ />
31
+ );
32
+ const label = screen.getByText('Status');
33
+ expect(label).toHaveClass('sr-only');
34
+ expect(screen.getByRole('combobox', { name: 'Status' })).toBeInTheDocument();
35
+ });
36
+
23
37
  it('supports uncontrolled defaultValue', () => {
24
38
  render(<Select options={options} defaultValue="sm" aria-label="Size" />);
25
39
  expect(screen.getByRole('combobox', { name: 'Size' })).toHaveValue('sm');
@@ -23,6 +23,11 @@ export type SelectProps = Omit<
23
23
  /** Optgroups with a heading per section. Takes precedence over `options` and `children`. */
24
24
  groups?: SelectOptionGroup[];
25
25
  label?: string;
26
+ /**
27
+ * Keep the label for assistive tech but hide it visually, so the control
28
+ * lines up with sibling inputs in a filter bar or toolbar.
29
+ */
30
+ labelHidden?: boolean;
26
31
  /** Renders a disabled empty option — the native "choose one" affordance. */
27
32
  placeholder?: string;
28
33
  /** Native multi-select: value/onChange switch to string[]. */
@@ -43,7 +48,7 @@ export type SelectProps = Omit<
43
48
  * <option>/<optgroup> children for dynamic lists.
44
49
  */
45
50
  export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(function Select(
46
- { options, groups, label, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props },
51
+ { options, groups, label, labelHidden = false, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props },
47
52
  ref,
48
53
  ) {
49
54
  const generatedId = React.useId();
@@ -59,7 +64,7 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(function
59
64
  return (
60
65
  <div className="flex w-full flex-col gap-1.5">
61
66
  {label && (
62
- <label id={labelId} htmlFor={selectId} className="text-sm font-medium">
67
+ <label id={labelId} htmlFor={selectId} className={labelHidden ? 'sr-only' : 'text-sm font-medium'}>
63
68
  {label}
64
69
  </label>
65
70
  )}
@@ -19,6 +19,17 @@ describe('Timeline', () => {
19
19
  expect(screen.getByText('Platform team')).toBeInTheDocument();
20
20
  });
21
21
 
22
+ it('draws one connector rail per item except the last', () => {
23
+ const { container } = render(
24
+ <Timeline items={[{ title: 'One' }, { title: 'Two' }, { title: 'Three' }]} />
25
+ );
26
+ const rails = container.querySelectorAll('li > span[aria-hidden="true"]');
27
+ expect(rails).toHaveLength(2);
28
+ // The rail spans from the dot's lower edge into the next item's dot.
29
+ expect(rails[0]).toHaveClass('top-4');
30
+ expect(rails[0]).toHaveClass('-bottom-7');
31
+ });
32
+
22
33
  it('has no accessibility violations', async () => {
23
34
  const { container } = render(<Timeline items={[{ title: 'Started' }]} />);
24
35
  expect(await axe(container)).toHaveNoViolations();
@@ -28,7 +28,19 @@ export const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(functi
28
28
  <ol ref={ref} className={cn('relative flex flex-col gap-6', className)} {...props}>
29
29
  {items.map((item, index) => (
30
30
  <li key={`${item.title}-${index}`} className="relative flex gap-4">
31
- <div className="flex flex-col items-center">
31
+ {/*
32
+ One rail per item, absolutely positioned so it starts at the dot's
33
+ bottom edge and runs through the list gap into the next dot. A
34
+ flex-column connector stops at the item box, which left a visible
35
+ break at every item boundary.
36
+ */}
37
+ {index < items.length - 1 && (
38
+ <span
39
+ aria-hidden="true"
40
+ className="absolute left-[5.5px] top-4 -bottom-7 w-px bg-border"
41
+ />
42
+ )}
43
+ <div className="relative z-10 flex flex-col items-center">
32
44
  <span
33
45
  aria-hidden="true"
34
46
  className={cn(
@@ -36,7 +48,6 @@ export const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(functi
36
48
  item.muted ? 'border-border bg-background' : 'border-primary bg-primary'
37
49
  )}
38
50
  />
39
- {index < items.length - 1 && <span aria-hidden="true" className="mt-1 w-px flex-1 bg-border" />}
40
51
  </div>
41
52
  <div className="min-w-0 pb-1">
42
53
  {item.period && (
@@ -18,6 +18,21 @@ describe('Tooltip', () => {
18
18
  });
19
19
  });
20
20
 
21
+ it('renders the inverse palette on request', async () => {
22
+ const user = userEvent.setup();
23
+ render(
24
+ <Tooltip content="Dark bubble" delay={0} variant="inverse">
25
+ <button>Hover me</button>
26
+ </Tooltip>
27
+ );
28
+ await user.hover(screen.getByRole('button'));
29
+ await waitFor(() => {
30
+ const bubble = screen.getByRole('tooltip');
31
+ expect(bubble).toHaveClass('bg-inverse');
32
+ expect(bubble).toHaveClass('text-inverse-foreground');
33
+ });
34
+ });
35
+
21
36
  it('hides the tooltip on unhover', async () => {
22
37
  const user = userEvent.setup();
23
38
  render(
@@ -11,6 +11,11 @@ export type TooltipProps = {
11
11
  side?: 'top' | 'bottom' | 'left' | 'right';
12
12
  /** Delay before showing on hover, in milliseconds. */
13
13
  delay?: number;
14
+ /**
15
+ * Bubble palette. `default` uses the popover surface; `inverse` flips the
16
+ * surface (dark bubble in light mode, light bubble in dark mode).
17
+ */
18
+ variant?: 'default' | 'inverse';
14
19
  className?: string;
15
20
  /** A single focusable element; receives aria-describedby when open. */
16
21
  children: React.ReactElement;
@@ -20,6 +25,15 @@ type Position = { top: number; left: number; transform: string };
20
25
 
21
26
  const GAP = 8;
22
27
 
28
+ /**
29
+ * Literal class maps so the Tailwind scanner keeps both palettes. `inverse`
30
+ * reuses the inverse surface tokens: navy in light mode, white in dark mode.
31
+ */
32
+ const VARIANTS: Record<NonNullable<TooltipProps['variant']>, string> = {
33
+ default: 'border-border bg-popover text-popover-foreground',
34
+ inverse: 'border-inverse-border bg-inverse text-inverse-foreground',
35
+ };
36
+
23
37
  /**
24
38
  * Hover/focus tooltip built on aria-describedby. Shows on pointer
25
39
  * hover and keyboard focus (not click), dismisses on Escape, and
@@ -30,7 +44,7 @@ const GAP = 8;
30
44
  * scroll the container (the reported "tooltip causes scroll" bug).
31
45
  */
32
46
  const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(
33
- ({ content, side = 'top', delay = 300, className, children }, ref) => {
47
+ ({ content, side = 'top', delay = 300, variant = 'default', className, children }, ref) => {
34
48
  const [open, setOpen] = React.useState(false);
35
49
  const [pos, setPos] = React.useState<Position | null>(null);
36
50
  const anchorRef = React.useRef<HTMLDivElement | null>(null);
@@ -113,7 +127,10 @@ const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(
113
127
  id={id}
114
128
  role="tooltip"
115
129
  style={{ position: 'fixed', top: pos.top, left: pos.left, transform: pos.transform, zIndex: 60 }}
116
- className="pointer-events-none w-max max-w-xs rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md"
130
+ className={cn(
131
+ 'pointer-events-none w-max max-w-xs rounded-md border px-3 py-1.5 text-xs shadow-md',
132
+ VARIANTS[variant]
133
+ )}
117
134
  >
118
135
  {content}
119
136
  </div>,
@@ -138,7 +138,7 @@
138
138
  ],
139
139
  "package": "@slipstream-ui/core",
140
140
  "importPath": "@slipstream-ui/core",
141
- "version": "0.9.0",
141
+ "version": "0.10.0",
142
142
  "sourceDir": "accordion",
143
143
  "exportName": "Accordion"
144
144
  }
@@ -91,7 +91,7 @@
91
91
  ],
92
92
  "package": "@slipstream-ui/core",
93
93
  "importPath": "@slipstream-ui/core",
94
- "version": "0.9.0",
94
+ "version": "0.10.0",
95
95
  "sourceDir": "alert",
96
96
  "exportName": "Alert"
97
97
  }
@@ -4,7 +4,7 @@
4
4
  "tier": "molecule",
5
5
  "package": "@slipstream-ui/core",
6
6
  "importPath": "@slipstream-ui/core",
7
- "version": "0.9.0",
7
+ "version": "0.10.0",
8
8
  "sourceDir": "announcement-bar",
9
9
  "exportName": "AnnouncementBar",
10
10
  "description": "Dismissible announcement bar with optional action, tone and sticky positioning.",
@@ -214,7 +214,7 @@
214
214
  ],
215
215
  "package": "@slipstream-ui/core",
216
216
  "importPath": "@slipstream-ui/core",
217
- "version": "0.9.0",
217
+ "version": "0.10.0",
218
218
  "sourceDir": "app-shell",
219
219
  "exportName": "AppShell"
220
220
  }
@@ -4,7 +4,7 @@
4
4
  "tier": "molecule",
5
5
  "package": "@slipstream-ui/core",
6
6
  "importPath": "@slipstream-ui/core",
7
- "version": "0.9.0",
7
+ "version": "0.10.0",
8
8
  "sourceDir": "applied-filters",
9
9
  "exportName": "AppliedFilters",
10
10
  "description": "Applied-filter summary with a live count, removable chips and an edit action.",
@@ -4,7 +4,7 @@
4
4
  "tier": "molecule",
5
5
  "package": "@slipstream-ui/core",
6
6
  "importPath": "@slipstream-ui/core",
7
- "version": "0.9.0",
7
+ "version": "0.10.0",
8
8
  "sourceDir": "article-card",
9
9
  "exportName": "ArticleCard",
10
10
  "description": "Linked article or resource card with media, eyebrow, title, summary and metadata.",
@@ -124,7 +124,7 @@
124
124
  ],
125
125
  "package": "@slipstream-ui/core",
126
126
  "importPath": "@slipstream-ui/core",
127
- "version": "0.9.0",
127
+ "version": "0.10.0",
128
128
  "sourceDir": "auth-layout",
129
129
  "exportName": "AuthLayout"
130
130
  }
@@ -194,7 +194,7 @@
194
194
  ],
195
195
  "package": "@slipstream-ui/core",
196
196
  "importPath": "@slipstream-ui/core",
197
- "version": "0.9.0",
197
+ "version": "0.10.0",
198
198
  "sourceDir": "autocomplete",
199
199
  "exportName": "Autocomplete"
200
200
  }
@@ -152,7 +152,7 @@
152
152
  ],
153
153
  "package": "@slipstream-ui/core",
154
154
  "importPath": "@slipstream-ui/core",
155
- "version": "0.9.0",
155
+ "version": "0.10.0",
156
156
  "sourceDir": "avatar",
157
157
  "exportName": "Avatar"
158
158
  }
@@ -205,7 +205,7 @@
205
205
  ],
206
206
  "package": "@slipstream-ui/core",
207
207
  "importPath": "@slipstream-ui/core",
208
- "version": "0.9.0",
208
+ "version": "0.10.0",
209
209
  "sourceDir": "badge",
210
210
  "exportName": "Badge"
211
211
  }
@@ -101,7 +101,7 @@
101
101
  ],
102
102
  "package": "@slipstream-ui/core",
103
103
  "importPath": "@slipstream-ui/core",
104
- "version": "0.9.0",
104
+ "version": "0.10.0",
105
105
  "sourceDir": "block",
106
106
  "exportName": "Block"
107
107
  }
@@ -124,7 +124,7 @@
124
124
  ],
125
125
  "package": "@slipstream-ui/core",
126
126
  "importPath": "@slipstream-ui/core",
127
- "version": "0.9.0",
127
+ "version": "0.10.0",
128
128
  "sourceDir": "bottom-nav",
129
129
  "exportName": "BottomNav"
130
130
  }
@@ -129,7 +129,7 @@
129
129
  ],
130
130
  "package": "@slipstream-ui/core",
131
131
  "importPath": "@slipstream-ui/core",
132
- "version": "0.9.0",
132
+ "version": "0.10.0",
133
133
  "sourceDir": "breadcrumb",
134
134
  "exportName": "Breadcrumb"
135
135
  }
@@ -105,7 +105,7 @@
105
105
  ],
106
106
  "package": "@slipstream-ui/core",
107
107
  "importPath": "@slipstream-ui/core",
108
- "version": "0.9.0",
108
+ "version": "0.10.0",
109
109
  "sourceDir": "button-group",
110
110
  "exportName": "ButtonGroup"
111
111
  }
@@ -253,7 +253,7 @@
253
253
  ],
254
254
  "package": "@slipstream-ui/core",
255
255
  "importPath": "@slipstream-ui/core",
256
- "version": "0.9.0",
256
+ "version": "0.10.0",
257
257
  "sourceDir": "button",
258
258
  "exportName": "Button"
259
259
  }
@@ -169,7 +169,7 @@
169
169
  ],
170
170
  "package": "@slipstream-ui/core",
171
171
  "importPath": "@slipstream-ui/core",
172
- "version": "0.9.0",
172
+ "version": "0.10.0",
173
173
  "sourceDir": "calendar",
174
174
  "exportName": "Calendar"
175
175
  }
@@ -86,7 +86,7 @@
86
86
  ],
87
87
  "package": "@slipstream-ui/core",
88
88
  "importPath": "@slipstream-ui/core",
89
- "version": "0.9.0",
89
+ "version": "0.10.0",
90
90
  "sourceDir": "card",
91
91
  "exportName": "Card"
92
92
  }
@@ -160,7 +160,7 @@
160
160
  ],
161
161
  "package": "@slipstream-ui/core",
162
162
  "importPath": "@slipstream-ui/core",
163
- "version": "0.9.0",
163
+ "version": "0.10.0",
164
164
  "sourceDir": "checkbox",
165
165
  "exportName": "Checkbox"
166
166
  }
@@ -4,7 +4,7 @@
4
4
  "tier": "molecule",
5
5
  "package": "@slipstream-ui/core",
6
6
  "importPath": "@slipstream-ui/core",
7
- "version": "0.9.0",
7
+ "version": "0.10.0",
8
8
  "sourceDir": "comparison-table",
9
9
  "exportName": "ComparisonTable",
10
10
  "description": "Marketing comparison table with check/dash boolean cells, a highlighted column and responsive overflow.",