@ceed/ads 1.23.3 → 1.23.4

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 (43) hide show
  1. package/dist/components/data-display/Badge.md +71 -39
  2. package/dist/components/data-display/InfoSign.md +74 -98
  3. package/dist/components/data-display/Typography.md +310 -61
  4. package/dist/components/feedback/CircularProgress.md +257 -0
  5. package/dist/components/feedback/Skeleton.md +280 -0
  6. package/dist/components/feedback/llms.txt +2 -0
  7. package/dist/components/inputs/ButtonGroup.md +115 -106
  8. package/dist/components/inputs/Calendar.md +98 -459
  9. package/dist/components/inputs/CurrencyInput.md +181 -8
  10. package/dist/components/inputs/DatePicker.md +108 -436
  11. package/dist/components/inputs/DateRangePicker.md +130 -496
  12. package/dist/components/inputs/FilterMenu.md +169 -19
  13. package/dist/components/inputs/FilterableCheckboxGroup.md +119 -24
  14. package/dist/components/inputs/FormControl.md +368 -0
  15. package/dist/components/inputs/IconButton.md +137 -88
  16. package/dist/components/inputs/MonthPicker.md +95 -427
  17. package/dist/components/inputs/MonthRangePicker.md +89 -471
  18. package/dist/components/inputs/PercentageInput.md +183 -19
  19. package/dist/components/inputs/RadioButton.md +163 -35
  20. package/dist/components/inputs/RadioList.md +241 -0
  21. package/dist/components/inputs/RadioTileGroup.md +146 -62
  22. package/dist/components/inputs/Select.md +219 -328
  23. package/dist/components/inputs/Slider.md +334 -0
  24. package/dist/components/inputs/Switch.md +136 -376
  25. package/dist/components/inputs/Textarea.md +209 -11
  26. package/dist/components/inputs/Uploader/Uploader.md +145 -66
  27. package/dist/components/inputs/llms.txt +3 -0
  28. package/dist/components/navigation/Breadcrumbs.md +80 -322
  29. package/dist/components/navigation/Dropdown.md +92 -221
  30. package/dist/components/navigation/IconMenuButton.md +40 -502
  31. package/dist/components/navigation/InsetDrawer.md +68 -738
  32. package/dist/components/navigation/Link.md +39 -298
  33. package/dist/components/navigation/Menu.md +92 -285
  34. package/dist/components/navigation/MenuButton.md +55 -448
  35. package/dist/components/navigation/Pagination.md +47 -338
  36. package/dist/components/navigation/ProfileMenu.md +45 -268
  37. package/dist/components/navigation/Stepper.md +160 -28
  38. package/dist/components/navigation/Tabs.md +57 -316
  39. package/dist/components/surfaces/Sheet.md +150 -333
  40. package/dist/guides/ThemeProvider.md +116 -0
  41. package/dist/guides/llms.txt +9 -0
  42. package/dist/llms.txt +8 -0
  43. package/package.json +1 -1
@@ -2,7 +2,9 @@
2
2
 
3
3
  ## Introduction
4
4
 
5
- The Link component is a navigational element that allows users to navigate between pages or external resources. Built on Joy UI's Link, it provides consistent styling and accessibility features while supporting various visual styles and text hierarchy levels. Links are fundamental to web navigation and should be used to connect related content within your application.
5
+ The Link component is a navigational element that allows users to move between pages or access external resources. Built on top of Joy UI's Link, it provides consistent styling, multiple visual variants, and comprehensive accessibility features out of the box.
6
+
7
+ Links are fundamental to web navigation. Use them to connect related content, reference external documentation, or enable movement between sections of your application. For actions that do not navigate (such as submitting a form or opening a modal), use a Button instead.
6
8
 
7
9
  ```tsx
8
10
  <Link
@@ -27,15 +29,12 @@ import { Link } from '@ceed/ads';
27
29
  function MyComponent() {
28
30
  return (
29
31
  <div>
30
- {/* Basic link */}
31
32
  <Link href="/about">About Us</Link>
32
33
 
33
- {/* External link */}
34
34
  <Link href="https://example.com" target="_blank" rel="noopener noreferrer">
35
35
  External Site
36
36
  </Link>
37
37
 
38
- {/* Styled link */}
39
38
  <Link href="/contact" color="primary" underline="hover">
40
39
  Contact
41
40
  </Link>
@@ -44,22 +43,11 @@ function MyComponent() {
44
43
  }
45
44
  ```
46
45
 
47
- ## Examples
48
-
49
- ### Basic Link
50
-
51
- The default link appearance with plain variant.
52
-
53
- ```tsx
54
- <Link
55
- children="Link"
56
- variant="plain"
57
- />
58
- ```
46
+ ## Features
59
47
 
60
48
  ### Variants
61
49
 
62
- Links support different visual styles through the variant prop.
50
+ Links support four visual styles through the `variant` prop: `plain`, `outlined`, `soft`, and `solid`.
63
51
 
64
52
  ```tsx
65
53
  <div style={{
@@ -84,7 +72,7 @@ Links support different visual styles through the variant prop.
84
72
 
85
73
  ### Colors
86
74
 
87
- Apply different semantic colors to links.
75
+ Apply semantic colors to communicate different purposes -- `primary`, `neutral`, `success`, `warning`, and `danger`.
88
76
 
89
77
  ```tsx
90
78
  <div style={{
@@ -112,7 +100,7 @@ Apply different semantic colors to links.
112
100
 
113
101
  ### Underline Styles
114
102
 
115
- Control the underline behavior of links.
103
+ Control the underline behavior with three options: `none` (never shown), `hover` (shown on hover), and `always` (permanently visible).
116
104
 
117
105
  ```tsx
118
106
  <div style={{
@@ -134,7 +122,7 @@ Control the underline behavior of links.
134
122
 
135
123
  ### Typography Levels
136
124
 
137
- Links can inherit or specify typography levels for different text hierarchies.
125
+ Links can adopt any typography level from the design system, enabling consistent text hierarchies when links appear alongside headings or body text.
138
126
 
139
127
  ```tsx
140
128
  <div style={{
@@ -172,7 +160,7 @@ Links can inherit or specify typography levels for different text hierarchies.
172
160
 
173
161
  ### Disabled State
174
162
 
175
- Links can be disabled to prevent interaction.
163
+ Links can be disabled to prevent interaction while remaining visible in the layout.
176
164
 
177
165
  ```tsx
178
166
  <Link
@@ -185,7 +173,7 @@ Links can be disabled to prevent interaction.
185
173
 
186
174
  ### External Links
187
175
 
188
- Links to external resources with proper security attributes.
176
+ For links that navigate away from your application, include `target="_blank"` and `rel="noopener noreferrer"` for security.
189
177
 
190
178
  ```tsx
191
179
  <Link href="https://example.com" target="_blank" rel="noopener noreferrer">
@@ -195,7 +183,7 @@ Links to external resources with proper security attributes.
195
183
 
196
184
  ### Inline with Text
197
185
 
198
- Links can be seamlessly integrated within paragraph text.
186
+ Links integrate seamlessly within paragraph text, inheriting the surrounding font styles.
199
187
 
200
188
  ```tsx
201
189
  <p style={{
@@ -205,84 +193,23 @@ This is a paragraph with an <Link href="#">inline link</Link> that flows natural
205
193
  </p>
206
194
  ```
207
195
 
208
- ## When to Use
209
-
210
- ### ✅ Good Use Cases
211
-
212
- - **Page navigation**: Moving between different pages or sections within your app
213
- - **External resources**: Linking to external websites, documentation, or references
214
- - **In-context references**: Linking related content mentioned in text
215
- - **Skip navigation**: Accessibility links for keyboard users
216
- - **Breadcrumbs**: Navigation hierarchy indicators
217
- - **Footer navigation**: Site-wide links in footer sections
218
-
219
- ### ❌ When Not to Use
220
-
221
- - **Actions that don't navigate**: Use Button instead for actions like submitting forms, opening modals, or triggering events
222
- - **Primary calls to action**: Use Button for prominent actions users should take
223
- - **Menu items**: Use MenuItem components within navigation menus
224
- - **Tab navigation**: Use Tabs component for content switching within a page
225
- - **Cards/clickable areas**: Use Card with onClick or a wrapping anchor element
226
-
227
196
  ## Common Use Cases
228
197
 
229
- ### Navigation Menu Links
230
-
231
- ```tsx
232
- function NavigationMenu() {
233
- return (
234
- <nav>
235
- <Stack direction="row" spacing={3}>
236
- <Link href="/" color="neutral" underline="none">
237
- Home
238
- </Link>
239
- <Link href="/products" color="neutral" underline="none">
240
- Products
241
- </Link>
242
- <Link href="/about" color="neutral" underline="none">
243
- About
244
- </Link>
245
- <Link href="/contact" color="neutral" underline="none">
246
- Contact
247
- </Link>
248
- </Stack>
249
- </nav>
250
- );
251
- }
252
- ```
253
-
254
198
  ### Inline Text Links
255
199
 
256
200
  ```tsx
257
201
  function ArticleContent() {
258
202
  return (
259
203
  <Typography level="body-md">
260
- For more information about our services, please visit our{' '}
261
- <Link href="/services">services page</Link> or read our{' '}
204
+ For more information, visit our{' '}
205
+ <Link href="/services">services page</Link> or read the{' '}
262
206
  <Link href="/faq">frequently asked questions</Link>.
263
207
  </Typography>
264
208
  );
265
209
  }
266
210
  ```
267
211
 
268
- ### External Links with Icon
269
-
270
- ```tsx
271
- function ExternalResourceLink() {
272
- return (
273
- <Link
274
- href="https://documentation.example.com"
275
- target="_blank"
276
- rel="noopener noreferrer"
277
- endDecorator={<OpenInNewIcon sx={{ fontSize: 16 }} />}
278
- >
279
- View Documentation
280
- </Link>
281
- );
282
- }
283
- ```
284
-
285
- ### Footer Links
212
+ ### Footer Navigation
286
213
 
287
214
  ```tsx
288
215
  function FooterLinks() {
@@ -302,12 +229,12 @@ function FooterLinks() {
302
229
  }
303
230
  ```
304
231
 
305
- ### Link with React Router
232
+ ### Router Integration
306
233
 
307
234
  ```tsx
308
235
  import { Link as RouterLink } from 'react-router-dom';
309
236
 
310
- function RouterIntegration() {
237
+ function AppNavigation() {
311
238
  return (
312
239
  <Link component={RouterLink} to="/dashboard">
313
240
  Go to Dashboard
@@ -316,235 +243,49 @@ function RouterIntegration() {
316
243
  }
317
244
  ```
318
245
 
319
- ### Skip to Content Link
320
-
321
- ```tsx
322
- function SkipLink() {
323
- return (
324
- <Link
325
- href="#main-content"
326
- sx={{
327
- position: 'absolute',
328
- left: '-9999px',
329
- '&:focus': {
330
- left: 0,
331
- zIndex: 1000,
332
- p: 2,
333
- bgcolor: 'background.surface',
334
- },
335
- }}
336
- >
337
- Skip to main content
338
- </Link>
339
- );
340
- }
341
- ```
342
-
343
- ### Download Link
344
-
345
- ```tsx
346
- function DownloadLink({ filename, url }) {
347
- return (
348
- <Link
349
- href={url}
350
- download={filename}
351
- startDecorator={<DownloadIcon />}
352
- >
353
- Download {filename}
354
- </Link>
355
- );
356
- }
357
- ```
358
-
359
- ## Props and Customization
360
-
361
- ### Key Props
362
-
363
- | Prop | Type | Default | Description |
364
- | ---------------- | -------------------------------------------------------------- | ----------- | ---------------------------------------- |
365
- | `href` | `string` | - | The URL to navigate to |
366
- | `variant` | `'plain' \| 'outlined' \| 'soft' \| 'solid'` | `'plain'` | Visual style variant |
367
- | `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'primary'` | Color scheme |
368
- | `level` | `string` | - | Typography level (e.g., 'body-md', 'h4') |
369
- | `underline` | `'none' \| 'hover' \| 'always'` | `'hover'` | Underline behavior |
370
- | `disabled` | `boolean` | `false` | Disable the link |
371
- | `startDecorator` | `ReactNode` | - | Element before the link text |
372
- | `endDecorator` | `ReactNode` | - | Element after the link text |
373
- | `component` | `ElementType` | `'a'` | The root element type |
374
-
375
- ### Underline Behavior
376
-
377
- ```tsx
378
- <Stack spacing={2}>
379
- {/* No underline */}
380
- <Link underline="none" href="#">Never underlined</Link>
381
-
382
- {/* Underline on hover (default) */}
383
- <Link underline="hover" href="#">Underline on hover</Link>
384
-
385
- {/* Always underlined */}
386
- <Link underline="always" href="#">Always underlined</Link>
387
- </Stack>
388
- ```
389
-
390
- ### With Decorators
391
-
392
- ```tsx
393
- <Stack spacing={2}>
394
- <Link href="#" startDecorator={<HomeIcon />}>
395
- Home
396
- </Link>
397
-
398
- <Link href="#" endDecorator={<ArrowForwardIcon />}>
399
- Learn more
400
- </Link>
401
-
402
- <Link
403
- href="https://external.com"
404
- target="_blank"
405
- endDecorator={<OpenInNewIcon sx={{ fontSize: '1rem' }} />}
406
- >
407
- External link
408
- </Link>
409
- </Stack>
410
- ```
411
-
412
- ### Custom Styling
413
-
414
- ```tsx
415
- <Link
416
- href="#"
417
- sx={{
418
- fontWeight: 'bold',
419
- transition: 'color 0.2s',
420
- '&:hover': {
421
- color: 'primary.600',
422
- },
423
- }}
424
- >
425
- Custom styled link
426
- </Link>
427
- ```
428
-
429
- ## Accessibility
430
-
431
- Link components include comprehensive accessibility features:
432
-
433
- ### Semantic HTML
434
-
435
- - Uses native `<a>` element by default for proper semantics
436
- - Supports custom components for router integration
437
-
438
- ### Screen Reader Support
246
+ ## Best Practices
439
247
 
440
- - Links announce their destination or purpose
441
- - Use descriptive link text instead of "click here" or "read more"
248
+ - **Use descriptive link text.** The text should clearly communicate the destination. Avoid generic labels such as "click here" or "read more".
442
249
 
443
250
  ```tsx
444
- // Good: Descriptive link text
445
- <Link href="/pricing">View our pricing plans</Link>
251
+ // Good
252
+ <Link href="/pricing">View pricing plans</Link>
446
253
 
447
- // Bad: Non-descriptive link text
254
+ // Bad
448
255
  <Link href="/pricing">Click here</Link>
449
256
  ```
450
257
 
451
- ### Keyboard Navigation
452
-
453
- - **Tab**: Navigate to and from links
454
- - **Enter**: Activate the link
455
- - Links receive visible focus indicators
456
-
457
- ### External Links
458
-
459
- Always include proper attributes for external links:
258
+ - **Indicate external links.** When a link opens in a new tab, add a visual cue (such as an icon) and the appropriate security attributes.
460
259
 
461
260
  ```tsx
462
- <Link
463
- href="https://external-site.com"
464
- target="_blank"
465
- rel="noopener noreferrer"
466
- aria-label="Visit external site (opens in new tab)"
467
- >
468
- External Site
261
+ // Good
262
+ <Link href="https://docs.example.com" target="_blank" rel="noopener noreferrer">
263
+ Documentation
469
264
  </Link>
470
- ```
471
-
472
- ### Color Contrast
473
-
474
- All link colors meet WCAG contrast requirements. Avoid relying solely on color to indicate links - use underlines or other visual indicators.
475
-
476
- ## Best Practices
477
-
478
- ### ✅ Do
479
-
480
- 1. **Use descriptive text**: Link text should describe the destination
481
265
 
482
- ```tsx
483
- // Good
484
- <Link href="/documentation">Read the documentation</Link>
485
-
486
- // ❌ Bad
487
- <Link href="/documentation">Click here</Link>
488
- ```
489
-
490
- 2. **Indicate external links**: Show users when links open in new tabs
491
-
492
- ```tsx
493
- <Link href="https://external.com" target="_blank" rel="noopener noreferrer">
494
- External Resource <OpenInNewIcon sx={{ fontSize: 14 }} />
266
+ // Bad -- opens in new tab with no indication
267
+ <Link href="https://docs.example.com" target="_blank">
268
+ Documentation
495
269
  </Link>
496
270
  ```
497
271
 
498
- 3. **Use appropriate colors**: Match link colors to their context and importance
499
-
500
- 4. **Maintain consistency**: Use consistent link styles throughout your application
501
-
502
- ### ❌ Don't
503
-
504
- 1. **Don't use links for actions**: Use Button for non-navigation actions
272
+ - **Do not use links for actions.** If clicking triggers a side effect (form submission, modal opening, deletion), use a Button component instead.
505
273
 
506
274
  ```tsx
507
- // ❌ Bad: Using link for action
508
- <Link onClick={handleSubmit}>Submit Form</Link>
509
-
510
- // ✅ Good: Using button for action
275
+ // Good
511
276
  <Button onClick={handleSubmit}>Submit Form</Button>
512
- ```
513
-
514
- 2. **Don't disable links without reason**: If content is unavailable, explain why
515
-
516
- 3. **Don't open all external links in new tabs**: Only do so when users might lose context
517
277
 
518
- 4. **Don't use link styling for non-interactive elements**
519
-
520
- ## Performance Considerations
521
-
522
- ### Prefetching
523
-
524
- When using with routing libraries, consider implementing link prefetching for improved perceived performance:
525
-
526
- ```tsx
527
- // With Next.js
528
- import NextLink from 'next/link';
529
-
530
- <Link component={NextLink} href="/page" prefetch>
531
- Prefetched Page
532
- </Link>
278
+ // Bad
279
+ <Link onClick={handleSubmit}>Submit Form</Link>
533
280
  ```
534
281
 
535
- ### Avoid Unnecessary Re-renders
536
-
537
- For links in lists or frequently updating components, ensure stable references:
282
+ - **Maintain visual consistency.** Use the same variant, color, and underline settings for links that serve the same purpose across different pages.
538
283
 
539
- ```tsx
540
- // Using useCallback for event handlers in links
541
- const handleClick = useCallback((e) => {
542
- trackLinkClick(e);
543
- }, []);
284
+ - **Match typography level to context.** When a link sits inside a heading or body text block, set its `level` prop to match the surrounding text for visual harmony.
544
285
 
545
- <Link href="/page" onClick={handleClick}>
546
- Tracked Link
547
- </Link>
548
- ```
286
+ ## Accessibility
549
287
 
550
- Link is a fundamental navigation component that ensures consistent, accessible navigation throughout your application. Use it thoughtfully to create clear pathways for users to explore your content.
288
+ - **Semantic HTML**: Renders a native `<a>` element by default, ensuring proper semantics and browser behavior. The `component` prop allows substitution with router-specific elements.
289
+ - **Descriptive text**: Screen readers announce the link text as the accessible name. Always write link text that makes sense out of context since screen reader users often navigate by listing all links on a page.
290
+ - **Keyboard navigation**: Links are focusable with `Tab` and activated with `Enter`. Visible focus indicators are provided for keyboard users.
291
+ - **External link attributes**: Always add `target="_blank"` together with `rel="noopener noreferrer"` on external links to prevent security vulnerabilities and provide an `aria-label` that mentions the new tab behavior when appropriate.