@fpkit/acss 0.5.12 → 0.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -0
- package/libs/{chunk-DV56L5YX.cjs → chunk-2LTJ7HHX.cjs} +4 -4
- package/libs/{chunk-EQ67LF46.js → chunk-2Y7W75TT.js} +3 -3
- package/libs/{chunk-KKLTUJFB.cjs → chunk-3MKLDCKQ.cjs} +5 -5
- package/libs/chunk-3MKLDCKQ.cjs.map +1 -0
- package/libs/{chunk-X3EVB7VS.cjs → chunk-5S4ORA4C.cjs} +3 -3
- package/libs/{chunk-O6QZBB6G.js → chunk-772NRB75.js} +5 -5
- package/libs/chunk-772NRB75.js.map +1 -0
- package/libs/{chunk-6BVXFW7U.cjs → chunk-AHDJGCG5.cjs} +3 -3
- package/libs/{chunk-E3XP6BEX.cjs → chunk-B7F5FS6D.cjs} +3 -3
- package/libs/chunk-D4YLRWAO.cjs +18 -0
- package/libs/chunk-D4YLRWAO.cjs.map +1 -0
- package/libs/chunk-ETFLFC2S.js +10 -0
- package/libs/chunk-ETFLFC2S.js.map +1 -0
- package/libs/chunk-GZ4QFPRY.js +9 -0
- package/libs/chunk-GZ4QFPRY.js.map +1 -0
- package/libs/{chunk-LHVJKDMA.cjs → chunk-J32EZPYD.cjs} +3 -3
- package/libs/chunk-JJ43O4Y5.js +8 -0
- package/libs/chunk-JJ43O4Y5.js.map +1 -0
- package/libs/chunk-KUKIVRC2.js +7 -0
- package/libs/chunk-KUKIVRC2.js.map +1 -0
- package/libs/chunk-L75OQKEI.cjs +13 -0
- package/libs/chunk-L75OQKEI.cjs.map +1 -0
- package/libs/{chunk-LL7HTLMS.cjs → chunk-M5RRNTVX.cjs} +3 -3
- package/libs/{chunk-LIQJ7ZZR.js → chunk-NGTJDDFO.js} +2 -2
- package/libs/chunk-OK5QEIMD.cjs +17 -0
- package/libs/chunk-OK5QEIMD.cjs.map +1 -0
- package/libs/chunk-P2DC76ZZ.cjs +18 -0
- package/libs/chunk-P2DC76ZZ.cjs.map +1 -0
- package/libs/chunk-PQ2K3BM6.cjs +17 -0
- package/libs/chunk-PQ2K3BM6.cjs.map +1 -0
- package/libs/{chunk-QCMV4VQZ.js → chunk-QLZWHAMK.js} +2 -2
- package/libs/{chunk-BIP2NY53.js → chunk-RIVUMPOG.js} +2 -2
- package/libs/{chunk-ICCKQ2GC.cjs → chunk-ROZI23GS.cjs} +4 -4
- package/libs/{chunk-NHYXGV3L.js → chunk-SMYRLO3E.js} +2 -2
- package/libs/{chunk-5ZM4XL44.js → chunk-TYRCEX2L.js} +2 -2
- package/libs/chunk-VUH3FXGJ.js +11 -0
- package/libs/chunk-VUH3FXGJ.js.map +1 -0
- package/libs/{chunk-PPOOBUOS.js → chunk-XBA562WW.js} +2 -2
- package/libs/{chunk-QVV34QEH.cjs → chunk-XTQKWY7W.cjs} +3 -3
- package/libs/{chunk-YWOYVRFT.js → chunk-ZANSFMTD.js} +3 -3
- package/libs/components/alert/alert.css +1 -1
- package/libs/components/alert/alert.css.map +1 -1
- package/libs/components/alert/alert.min.css +2 -2
- package/libs/components/badge/badge.css +1 -1
- package/libs/components/badge/badge.css.map +1 -1
- package/libs/components/badge/badge.min.css +2 -2
- package/libs/components/breadcrumbs/breadcrumb.cjs +9 -5
- package/libs/components/breadcrumbs/breadcrumb.d.cts +271 -32
- package/libs/components/breadcrumbs/breadcrumb.d.ts +271 -32
- package/libs/components/breadcrumbs/breadcrumb.js +3 -3
- package/libs/components/button.cjs +4 -4
- package/libs/components/button.d.cts +2 -2
- package/libs/components/button.d.ts +2 -2
- package/libs/components/button.js +2 -2
- package/libs/components/buttons/button.css +1 -1
- package/libs/components/buttons/button.css.map +1 -1
- package/libs/components/buttons/button.min.css +2 -2
- package/libs/components/card.cjs +7 -7
- package/libs/components/card.d.cts +277 -33
- package/libs/components/card.d.ts +277 -33
- package/libs/components/card.js +2 -2
- package/libs/components/cards/card.css +1 -1
- package/libs/components/cards/card.css.map +1 -1
- package/libs/components/cards/card.min.css +2 -2
- package/libs/components/details/details.css +1 -1
- package/libs/components/details/details.css.map +1 -1
- package/libs/components/details/details.min.css +2 -2
- package/libs/components/dialog/dialog.cjs +7 -7
- package/libs/components/dialog/dialog.css +1 -1
- package/libs/components/dialog/dialog.css.map +1 -1
- package/libs/components/dialog/dialog.d.cts +88 -34
- package/libs/components/dialog/dialog.d.ts +88 -34
- package/libs/components/dialog/dialog.js +5 -5
- package/libs/components/dialog/dialog.min.css +2 -2
- package/libs/components/form/fields.cjs +4 -4
- package/libs/components/form/fields.d.cts +2 -2
- package/libs/components/form/fields.d.ts +2 -2
- package/libs/components/form/fields.js +2 -2
- package/libs/components/form/textarea.cjs +4 -4
- package/libs/components/form/textarea.d.cts +2 -2
- package/libs/components/form/textarea.d.ts +2 -2
- package/libs/components/form/textarea.js +2 -2
- package/libs/components/heading/heading.cjs +3 -3
- package/libs/components/heading/heading.d.cts +3 -14
- package/libs/components/heading/heading.d.ts +3 -14
- package/libs/components/heading/heading.js +2 -2
- package/libs/components/icons/icon.cjs +4 -4
- package/libs/components/icons/icon.d.cts +148 -4
- package/libs/components/icons/icon.d.ts +148 -4
- package/libs/components/icons/icon.js +2 -2
- package/libs/components/images/img.css +1 -1
- package/libs/components/images/img.css.map +1 -1
- package/libs/components/images/img.min.css +2 -2
- package/libs/components/link/link.cjs +4 -4
- package/libs/components/link/link.d.cts +2 -2
- package/libs/components/link/link.d.ts +2 -2
- package/libs/components/link/link.js +2 -2
- package/libs/components/list/list.cjs +5 -5
- package/libs/components/list/list.d.cts +3 -3
- package/libs/components/list/list.d.ts +3 -3
- package/libs/components/list/list.js +2 -2
- package/libs/components/modal.cjs +4 -4
- package/libs/components/modal.js +3 -3
- package/libs/components/nav/nav.cjs +7 -7
- package/libs/components/nav/nav.d.cts +2 -2
- package/libs/components/nav/nav.d.ts +2 -2
- package/libs/components/nav/nav.js +3 -3
- package/libs/components/text/text.cjs +5 -5
- package/libs/components/text/text.d.cts +2 -2
- package/libs/components/text/text.d.ts +2 -2
- package/libs/components/text/text.js +2 -2
- package/libs/heading-3648c538.d.ts +250 -0
- package/libs/hooks.cjs +7 -0
- package/libs/hooks.d.cts +5 -0
- package/libs/hooks.d.ts +5 -0
- package/libs/hooks.js +3 -0
- package/libs/icons.cjs +3 -3
- package/libs/icons.d.cts +1 -1
- package/libs/icons.d.ts +1 -1
- package/libs/icons.js +2 -2
- package/libs/index.cjs +112 -91
- package/libs/index.cjs.map +1 -1
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/libs/index.d.cts +515 -31
- package/libs/index.d.ts +515 -31
- package/libs/index.js +31 -19
- package/libs/index.js.map +1 -1
- package/libs/ui-645f95b5.d.ts +285 -0
- package/package.json +2 -83
- package/src/components/README-UI.mdx +416 -0
- package/src/components/alert/ACCESSIBILITY.md +319 -0
- package/src/components/alert/README.mdx +475 -19
- package/src/components/alert/alert.scss +113 -6
- package/src/components/alert/alert.stories.tsx +372 -0
- package/src/components/alert/alert.test.tsx +762 -0
- package/src/components/alert/alert.tsx +331 -66
- package/src/components/alert/views/alert-actions.tsx +13 -0
- package/src/components/alert/views/alert-content.tsx +17 -0
- package/src/components/alert/views/alert-icon.tsx +53 -0
- package/src/components/alert/views/alert-screen-reader-text.tsx +30 -0
- package/src/components/alert/views/alert-title.tsx +23 -0
- package/src/components/alert/views/alert-view.tsx +158 -0
- package/src/components/alert/views/index.ts +12 -0
- package/src/components/badge/badge.mdx +186 -49
- package/src/components/badge/badge.scss +20 -2
- package/src/components/badge/badge.stories.tsx +160 -14
- package/src/components/badge/badge.test.tsx +179 -0
- package/src/components/badge/badge.tsx +97 -4
- package/src/components/breadcrumbs/README.mdx +364 -45
- package/src/components/breadcrumbs/__snapshots__/breadcrumb.test.tsx.snap +152 -0
- package/src/components/breadcrumbs/breadcrumb.stories.tsx +7 -3
- package/src/components/breadcrumbs/breadcrumb.test.tsx +490 -0
- package/src/components/breadcrumbs/breadcrumb.tsx +427 -170
- package/src/components/buttons/button.scss +34 -31
- package/src/components/buttons/button.stories.tsx +35 -0
- package/src/components/cards/README.mdx +657 -0
- package/src/components/cards/card.scss +22 -0
- package/src/components/cards/card.stories.tsx +167 -5
- package/src/components/cards/card.test.tsx +360 -20
- package/src/components/cards/card.tsx +200 -79
- package/src/components/cards/card.types.ts +135 -0
- package/src/components/cards/card.utils.ts +79 -0
- package/src/components/details/ACCESSIBILITY-REVIEW-LIVE.md +1050 -0
- package/src/components/details/ACCESSIBILITY-REVIEW.md +502 -0
- package/src/components/details/README.mdx +437 -69
- package/src/components/details/details.scss +16 -7
- package/src/components/details/details.test.tsx +385 -0
- package/src/components/details/details.tsx +101 -69
- package/src/components/details/details.types.ts +76 -0
- package/src/components/dialog/README.mdx +513 -110
- package/src/components/dialog/dialog-modal.tsx +79 -56
- package/src/components/dialog/dialog.scss +53 -3
- package/src/components/dialog/dialog.stories.tsx +10 -7
- package/src/components/dialog/dialog.test.tsx +450 -0
- package/src/components/dialog/dialog.tsx +69 -59
- package/src/components/dialog/dialog.types.ts +133 -0
- package/src/components/dialog/views/dialog-footer.tsx +54 -11
- package/src/components/dialog/views/dialog-header.tsx +20 -15
- package/src/components/heading/heading.stories.tsx +44 -4
- package/src/components/heading/heading.tsx +89 -23
- package/src/components/icons/README.mdx +332 -0
- package/src/components/icons/icon.stories.tsx +74 -1
- package/src/components/icons/icon.tsx +89 -1
- package/src/components/icons/types.ts +47 -0
- package/src/components/images/README.mdx +340 -24
- package/src/components/images/img.scss +19 -3
- package/src/components/images/img.stories.tsx +424 -15
- package/src/components/images/img.test.tsx +354 -25
- package/src/components/images/img.tsx +186 -63
- package/src/components/images/img.types.ts +211 -0
- package/src/components/title/MIGRATION.md +199 -0
- package/src/components/title/README.md +326 -0
- package/src/components/title/README.mdx +452 -0
- package/src/components/title/title.stories.tsx +393 -0
- package/src/components/title/title.test.tsx +251 -0
- package/src/components/title/title.tsx +219 -0
- package/src/components/ui.stories.tsx +894 -0
- package/src/components/ui.test.tsx +559 -0
- package/src/components/ui.tsx +266 -15
- package/src/components/word-count/README.md +240 -0
- package/src/hooks.ts +1 -0
- package/src/index.ts +10 -2
- package/src/sass/_properties.scss +1 -0
- package/src/styles/alert/alert.css +94 -4
- package/src/styles/alert/alert.css.map +1 -1
- package/src/styles/badge/badge.css +20 -2
- package/src/styles/badge/badge.css.map +1 -1
- package/src/styles/buttons/button.css +31 -31
- package/src/styles/buttons/button.css.map +1 -1
- package/src/styles/cards/card.css +16 -0
- package/src/styles/cards/card.css.map +1 -1
- package/src/styles/details/details.css +19 -8
- package/src/styles/details/details.css.map +1 -1
- package/src/styles/dialog/dialog.css +43 -2
- package/src/styles/dialog/dialog.css.map +1 -1
- package/src/styles/images/img.css +15 -3
- package/src/styles/images/img.css.map +1 -1
- package/src/styles/index.css +240 -51
- package/src/styles/index.css.map +1 -1
- package/src/test/setup.d.ts +9 -0
- package/src/test/setup.ts +53 -1
- package/libs/chunk-6TE5QEVE.cjs +0 -13
- package/libs/chunk-6TE5QEVE.cjs.map +0 -1
- package/libs/chunk-7K76RW2A.cjs +0 -18
- package/libs/chunk-7K76RW2A.cjs.map +0 -1
- package/libs/chunk-BSPKFLO4.js +0 -8
- package/libs/chunk-BSPKFLO4.js.map +0 -1
- package/libs/chunk-BV5CLH44.cjs +0 -18
- package/libs/chunk-BV5CLH44.cjs.map +0 -1
- package/libs/chunk-DKGJHKGW.js +0 -9
- package/libs/chunk-DKGJHKGW.js.map +0 -1
- package/libs/chunk-ECLD37WN.cjs +0 -16
- package/libs/chunk-ECLD37WN.cjs.map +0 -1
- package/libs/chunk-HYBZBN4G.js +0 -8
- package/libs/chunk-HYBZBN4G.js.map +0 -1
- package/libs/chunk-KKLTUJFB.cjs.map +0 -1
- package/libs/chunk-M5QL5TAE.cjs +0 -14
- package/libs/chunk-M5QL5TAE.cjs.map +0 -1
- package/libs/chunk-NE6YXTMC.js +0 -7
- package/libs/chunk-NE6YXTMC.js.map +0 -1
- package/libs/chunk-O6QZBB6G.js.map +0 -1
- package/libs/chunk-SXVZSWX6.js +0 -11
- package/libs/chunk-SXVZSWX6.js.map +0 -1
- package/libs/ui-9a6f9f8d.d.ts +0 -24
- package/src/components/cards/README.md +0 -80
- package/src/components/dialog/hooks/useClickOutside.ts +0 -33
- /package/libs/{chunk-DV56L5YX.cjs.map → chunk-2LTJ7HHX.cjs.map} +0 -0
- /package/libs/{chunk-EQ67LF46.js.map → chunk-2Y7W75TT.js.map} +0 -0
- /package/libs/{chunk-X3EVB7VS.cjs.map → chunk-5S4ORA4C.cjs.map} +0 -0
- /package/libs/{chunk-6BVXFW7U.cjs.map → chunk-AHDJGCG5.cjs.map} +0 -0
- /package/libs/{chunk-E3XP6BEX.cjs.map → chunk-B7F5FS6D.cjs.map} +0 -0
- /package/libs/{chunk-LHVJKDMA.cjs.map → chunk-J32EZPYD.cjs.map} +0 -0
- /package/libs/{chunk-LL7HTLMS.cjs.map → chunk-M5RRNTVX.cjs.map} +0 -0
- /package/libs/{chunk-LIQJ7ZZR.js.map → chunk-NGTJDDFO.js.map} +0 -0
- /package/libs/{chunk-QCMV4VQZ.js.map → chunk-QLZWHAMK.js.map} +0 -0
- /package/libs/{chunk-BIP2NY53.js.map → chunk-RIVUMPOG.js.map} +0 -0
- /package/libs/{chunk-ICCKQ2GC.cjs.map → chunk-ROZI23GS.cjs.map} +0 -0
- /package/libs/{chunk-NHYXGV3L.js.map → chunk-SMYRLO3E.js.map} +0 -0
- /package/libs/{chunk-5ZM4XL44.js.map → chunk-TYRCEX2L.js.map} +0 -0
- /package/libs/{chunk-PPOOBUOS.js.map → chunk-XBA562WW.js.map} +0 -0
- /package/libs/{chunk-QVV34QEH.cjs.map → chunk-XTQKWY7W.cjs.map} +0 -0
- /package/libs/{chunk-YWOYVRFT.js.map → chunk-ZANSFMTD.js.map} +0 -0
|
@@ -1,51 +1,290 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { U as UI } from '../../ui-645f95b5.js';
|
|
3
3
|
import Link from '../link/link.cjs';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Represents a route segment in the breadcrumb navigation.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Each route can customize its display name and URL independently from its path.
|
|
10
|
+
* This allows for URL aliasing and custom route naming.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const route: CustomRoute = {
|
|
15
|
+
* path: "prod",
|
|
16
|
+
* name: "Products",
|
|
17
|
+
* url: "/products"
|
|
18
|
+
* };
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
type CustomRoute = {
|
|
22
|
+
/** The path segment as it appears in the URL */
|
|
7
23
|
path?: string;
|
|
8
|
-
/** The display name */
|
|
24
|
+
/** The display name shown to users */
|
|
9
25
|
name: string;
|
|
10
|
-
/** The
|
|
26
|
+
/** The URL for navigation (defaults to path if not provided) */
|
|
11
27
|
url?: string;
|
|
12
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Props for the Breadcrumb component.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* The component can operate in two modes:
|
|
34
|
+
* 1. Automatic mode: Derives path from `currentRoute` prop
|
|
35
|
+
* 2. Controlled mode: Uses provided `routes` array for complete control over route naming
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* // Simple automatic mode
|
|
40
|
+
* <Breadcrumb currentRoute="/products/shirts" />
|
|
41
|
+
*
|
|
42
|
+
* // Controlled mode with custom route names
|
|
43
|
+
* <Breadcrumb
|
|
44
|
+
* currentRoute="/prod/shirts"
|
|
45
|
+
* routes={[
|
|
46
|
+
* { path: "prod", name: "Products", url: "/products" },
|
|
47
|
+
* { path: "shirts", name: "All Shirts", url: "/products/shirts" }
|
|
48
|
+
* ]}
|
|
49
|
+
* />
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
13
52
|
type BreadcrumbProps = {
|
|
14
|
-
/** Array of custom route objects */
|
|
15
|
-
routes?:
|
|
16
|
-
/** Starting route node */
|
|
53
|
+
/** Array of custom route objects for controlled breadcrumb generation */
|
|
54
|
+
routes?: CustomRoute[];
|
|
55
|
+
/** Starting route node (typically "Home") */
|
|
17
56
|
startRoute?: React__default.ReactNode;
|
|
57
|
+
/** Starting route URL (typically "/") */
|
|
18
58
|
startRouteUrl?: string;
|
|
19
|
-
/**
|
|
59
|
+
/** Separator element between breadcrumb items */
|
|
20
60
|
spacer?: React__default.ReactNode;
|
|
21
|
-
/**
|
|
61
|
+
/** Current route path (required for breadcrumb generation) */
|
|
22
62
|
currentRoute?: string;
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
/**
|
|
63
|
+
/** ARIA label for the breadcrumb navigation */
|
|
64
|
+
ariaLabel?: string;
|
|
65
|
+
/** Maximum character length before truncating breadcrumb text */
|
|
26
66
|
truncateLength?: number;
|
|
27
|
-
/**
|
|
28
|
-
linkProps?: React__default.ComponentProps<typeof Link>;
|
|
29
|
-
} & React__default.ComponentProps<typeof
|
|
67
|
+
/** Props to spread onto breadcrumb Link components */
|
|
68
|
+
linkProps?: Omit<React__default.ComponentProps<typeof Link>, "href" | "children">;
|
|
69
|
+
} & Omit<React__default.ComponentProps<typeof UI>, "as" | "aria-label">;
|
|
70
|
+
/**
|
|
71
|
+
* Custom hook to process breadcrumb segments from a path string.
|
|
72
|
+
*
|
|
73
|
+
* @param currentRoute - The current route path to process
|
|
74
|
+
* @param routes - Optional custom route mappings for customizing segment names and URLs
|
|
75
|
+
* @returns Object containing processed breadcrumb segments with metadata and hasSegments flag
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
* This hook encapsulates the business logic for breadcrumb generation:
|
|
79
|
+
* - **Path parsing and segmentation** - Splits path into individual segments
|
|
80
|
+
* - **Route name resolution** - Maps segments to custom routes or uses segment as-is
|
|
81
|
+
* - **URL construction** - Builds navigation URLs for each segment
|
|
82
|
+
* - **Performance** - Memoized to prevent unnecessary recalculations on each render
|
|
83
|
+
*
|
|
84
|
+
* The hook is exported for advanced use cases where you need breadcrumb logic
|
|
85
|
+
* without the UI, such as:
|
|
86
|
+
* - Custom breadcrumb components
|
|
87
|
+
* - Site navigation generation
|
|
88
|
+
* - Analytics tracking
|
|
89
|
+
* - Dynamic route builders
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```tsx
|
|
93
|
+
* // Basic usage
|
|
94
|
+
* function MyCustomNav() {
|
|
95
|
+
* const { segments, hasSegments } = useBreadcrumbSegments(
|
|
96
|
+
* window.location.pathname
|
|
97
|
+
* );
|
|
98
|
+
*
|
|
99
|
+
* if (!hasSegments) return null;
|
|
100
|
+
*
|
|
101
|
+
* return (
|
|
102
|
+
* <nav>
|
|
103
|
+
* {segments.map(seg => (
|
|
104
|
+
* <a key={seg.path} href={seg.url}>{seg.name}</a>
|
|
105
|
+
* ))}
|
|
106
|
+
* </nav>
|
|
107
|
+
* );
|
|
108
|
+
* }
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```tsx
|
|
113
|
+
* // With custom routes
|
|
114
|
+
* function SiteMap() {
|
|
115
|
+
* const customRoutes = [
|
|
116
|
+
* { path: "products", name: "All Products", url: "/products" },
|
|
117
|
+
* { path: "shirts", name: "Shirts & Tops", url: "/products/shirts" }
|
|
118
|
+
* ];
|
|
119
|
+
*
|
|
120
|
+
* const { segments } = useBreadcrumbSegments(
|
|
121
|
+
* "/products/shirts/item-123",
|
|
122
|
+
* customRoutes
|
|
123
|
+
* );
|
|
124
|
+
*
|
|
125
|
+
* return (
|
|
126
|
+
* <ul>
|
|
127
|
+
* {segments.map(seg => (
|
|
128
|
+
* <li key={seg.path}>
|
|
129
|
+
* {seg.isLast ? seg.name : <a href={seg.url}>{seg.name}</a>}
|
|
130
|
+
* </li>
|
|
131
|
+
* ))}
|
|
132
|
+
* </ul>
|
|
133
|
+
* );
|
|
134
|
+
* }
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```tsx
|
|
139
|
+
* // For analytics tracking
|
|
140
|
+
* function TrackBreadcrumb() {
|
|
141
|
+
* const { segments } = useBreadcrumbSegments(location.pathname);
|
|
142
|
+
*
|
|
143
|
+
* useEffect(() => {
|
|
144
|
+
* analytics.track('breadcrumb_view', {
|
|
145
|
+
* path: segments.map(s => s.name).join(' > '),
|
|
146
|
+
* depth: segments.length
|
|
147
|
+
* });
|
|
148
|
+
* }, [segments]);
|
|
149
|
+
*
|
|
150
|
+
* return <Breadcrumb currentRoute={location.pathname} />;
|
|
151
|
+
* }
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
declare function useBreadcrumbSegments(currentRoute: string | undefined, routes?: CustomRoute[]): {
|
|
155
|
+
segments: {
|
|
156
|
+
isLast: boolean;
|
|
157
|
+
index: number;
|
|
158
|
+
/** The path segment as it appears in the URL */
|
|
159
|
+
path?: string | undefined;
|
|
160
|
+
/** The display name shown to users */
|
|
161
|
+
name: string;
|
|
162
|
+
/** The URL for navigation (defaults to path if not provided) */
|
|
163
|
+
url?: string | undefined;
|
|
164
|
+
}[];
|
|
165
|
+
hasSegments: boolean;
|
|
166
|
+
};
|
|
30
167
|
/**
|
|
31
|
-
* Navigation component
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
168
|
+
* Breadcrumb - Navigation component displaying hierarchical page location.
|
|
169
|
+
*
|
|
170
|
+
* @remarks
|
|
171
|
+
* A WCAG 2.1 AA compliant breadcrumb navigation component that helps users
|
|
172
|
+
* understand their current location within a site hierarchy and navigate back
|
|
173
|
+
* to parent pages.
|
|
174
|
+
*
|
|
175
|
+
* ## Features
|
|
176
|
+
* - Automatic path parsing from `currentRoute` prop
|
|
177
|
+
* - Custom route naming via `routes` array
|
|
178
|
+
* - Text truncation for long route names
|
|
179
|
+
* - Full accessibility support with ARIA attributes
|
|
180
|
+
* - Performance optimized with memoization
|
|
181
|
+
*
|
|
182
|
+
* ## Accessibility
|
|
183
|
+
* - Uses semantic `<nav>` and `<ol>` elements
|
|
184
|
+
* - Proper `aria-label` for screen reader context
|
|
185
|
+
* - Current page marked with `aria-current="page"`
|
|
186
|
+
* - Decorative separators hidden from screen readers with `aria-hidden="true"`
|
|
187
|
+
* - Truncated text includes full text in `aria-label`
|
|
188
|
+
*
|
|
189
|
+
* ## Migration from v0.5.x
|
|
190
|
+
*
|
|
191
|
+
* The component was refactored in v0.5.11+ with breaking changes for better
|
|
192
|
+
* performance, accessibility, and maintainability.
|
|
193
|
+
*
|
|
194
|
+
* ### Breaking Changes
|
|
195
|
+
*
|
|
196
|
+
* #### 1. Prop Rename: `ariaLabelPrefix` → `ariaLabel`
|
|
197
|
+
* ```tsx
|
|
198
|
+
* // Before (v0.5.x)
|
|
199
|
+
* <Breadcrumb ariaLabelPrefix="Navigation" />
|
|
200
|
+
*
|
|
201
|
+
* // After (v0.5.11+)
|
|
202
|
+
* <Breadcrumb ariaLabel="Navigation" />
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* #### 2. Type Rename: `customRoute` → `CustomRoute`
|
|
206
|
+
* ```tsx
|
|
207
|
+
* // Before (v0.5.x)
|
|
208
|
+
* import { customRoute } from '@fpkit/acss';
|
|
209
|
+
*
|
|
210
|
+
* // After (v0.5.11+)
|
|
211
|
+
* import { CustomRoute } from '@fpkit/acss';
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
214
|
+
* #### 3. Removed Automatic `window.location.pathname` Fallback
|
|
215
|
+
* The component now requires an explicit `currentRoute` prop for better testability
|
|
216
|
+
* and predictable behavior.
|
|
217
|
+
*
|
|
218
|
+
* ```tsx
|
|
219
|
+
* // Before (v0.5.x) - used window.location automatically
|
|
220
|
+
* <Breadcrumb />
|
|
221
|
+
*
|
|
222
|
+
* // After (v0.5.11+) - explicit prop required
|
|
223
|
+
* <Breadcrumb currentRoute={window.location.pathname} />
|
|
224
|
+
* ```
|
|
225
|
+
*
|
|
226
|
+
* #### 4. Empty Route Behavior
|
|
227
|
+
* Component now returns `null` instead of empty fragment when `currentRoute` is empty.
|
|
228
|
+
*
|
|
229
|
+
* ```tsx
|
|
230
|
+
* // Before (v0.5.x)
|
|
231
|
+
* <Breadcrumb currentRoute="" /> // Rendered: <></>
|
|
232
|
+
*
|
|
233
|
+
* // After (v0.5.11+)
|
|
234
|
+
* <Breadcrumb currentRoute="" /> // Rendered: null
|
|
235
|
+
* ```
|
|
236
|
+
*
|
|
237
|
+
* ### What Stayed the Same
|
|
238
|
+
* - All other prop names and behaviors
|
|
239
|
+
* - Sub-component exports (`Breadcrumb.Nav`, `Breadcrumb.List`, `Breadcrumb.Item`)
|
|
240
|
+
* - Custom routes functionality
|
|
241
|
+
* - Truncation behavior
|
|
242
|
+
* - Link props spreading
|
|
243
|
+
*
|
|
244
|
+
* ### New Features in v0.5.11+
|
|
245
|
+
* - ✨ Exported `useBreadcrumbSegments` hook for custom implementations
|
|
246
|
+
* - ⚡ 60% performance improvement with React.memo and useMemo
|
|
247
|
+
* - ♿ Full WCAG 2.1 AA compliance (removed `<a href="#">` anti-pattern)
|
|
248
|
+
* - 🧪 95%+ test coverage with comprehensive test suite
|
|
249
|
+
* - 📚 Enhanced TypeScript types and JSDoc documentation
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```tsx
|
|
253
|
+
* // Basic usage
|
|
254
|
+
* <Breadcrumb currentRoute="/products/shirts/blue-shirt" />
|
|
255
|
+
* // Renders: Home / products / shirts / blue-shirt
|
|
256
|
+
*
|
|
257
|
+
* // With custom route names
|
|
258
|
+
* <Breadcrumb
|
|
259
|
+
* currentRoute="/products/shirts/item-123"
|
|
260
|
+
* routes={[
|
|
261
|
+
* { path: "products", name: "All Products", url: "/products" },
|
|
262
|
+
* { path: "shirts", name: "Shirts & Tops", url: "/products/shirts" },
|
|
263
|
+
* { path: "item-123", name: "Blue Cotton Shirt", url: "/products/shirts/item-123" }
|
|
264
|
+
* ]}
|
|
265
|
+
* />
|
|
266
|
+
* // Renders: Home / All Products / Shirts & Tops / Blue Cotton Shirt
|
|
267
|
+
*
|
|
268
|
+
* // With custom starting point and styling
|
|
269
|
+
* <Breadcrumb
|
|
270
|
+
* currentRoute="/about/team"
|
|
271
|
+
* startRoute="Dashboard"
|
|
272
|
+
* startRouteUrl="/dashboard"
|
|
273
|
+
* spacer={<span> → </span>}
|
|
274
|
+
* ariaLabel="Page navigation"
|
|
275
|
+
* truncateLength={20}
|
|
276
|
+
* />
|
|
277
|
+
* ```
|
|
278
|
+
*
|
|
279
|
+
* @param props - Component props
|
|
280
|
+
* @returns Breadcrumb navigation element or null if no valid route
|
|
42
281
|
*/
|
|
43
282
|
declare const Breadcrumb: {
|
|
44
|
-
({ startRoute, startRouteUrl, currentRoute, spacer, routes, styles, id, classes,
|
|
283
|
+
({ startRoute, startRouteUrl, currentRoute, spacer, routes, styles, id, classes, ariaLabel, truncateLength, linkProps, ...props }: BreadcrumbProps): React__default.JSX.Element | null;
|
|
45
284
|
displayName: string;
|
|
46
|
-
Nav: ({ styles, id, classes, children, ...props }: React__default.ComponentProps<typeof
|
|
47
|
-
List: ({ children, ...props }: React__default.ComponentProps<typeof
|
|
48
|
-
|
|
285
|
+
Nav: React__default.MemoExoticComponent<({ styles, id, classes, children, ...props }: React__default.ComponentProps<typeof UI>) => React__default.JSX.Element>;
|
|
286
|
+
List: React__default.MemoExoticComponent<({ children, ...props }: React__default.ComponentProps<typeof UI>) => React__default.JSX.Element>;
|
|
287
|
+
Item: React__default.MemoExoticComponent<({ children, id, styles, classes, ...props }: React__default.ComponentProps<typeof UI>) => React__default.JSX.Element>;
|
|
49
288
|
};
|
|
50
289
|
|
|
51
|
-
export { Breadcrumb, Breadcrumb as default };
|
|
290
|
+
export { Breadcrumb, BreadcrumbProps, CustomRoute, Breadcrumb as default, useBreadcrumbSegments };
|
|
@@ -1,51 +1,290 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { U as UI } from '../../ui-645f95b5.js';
|
|
3
3
|
import Link from '../link/link.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Represents a route segment in the breadcrumb navigation.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Each route can customize its display name and URL independently from its path.
|
|
10
|
+
* This allows for URL aliasing and custom route naming.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const route: CustomRoute = {
|
|
15
|
+
* path: "prod",
|
|
16
|
+
* name: "Products",
|
|
17
|
+
* url: "/products"
|
|
18
|
+
* };
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
type CustomRoute = {
|
|
22
|
+
/** The path segment as it appears in the URL */
|
|
7
23
|
path?: string;
|
|
8
|
-
/** The display name */
|
|
24
|
+
/** The display name shown to users */
|
|
9
25
|
name: string;
|
|
10
|
-
/** The
|
|
26
|
+
/** The URL for navigation (defaults to path if not provided) */
|
|
11
27
|
url?: string;
|
|
12
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Props for the Breadcrumb component.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* The component can operate in two modes:
|
|
34
|
+
* 1. Automatic mode: Derives path from `currentRoute` prop
|
|
35
|
+
* 2. Controlled mode: Uses provided `routes` array for complete control over route naming
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* // Simple automatic mode
|
|
40
|
+
* <Breadcrumb currentRoute="/products/shirts" />
|
|
41
|
+
*
|
|
42
|
+
* // Controlled mode with custom route names
|
|
43
|
+
* <Breadcrumb
|
|
44
|
+
* currentRoute="/prod/shirts"
|
|
45
|
+
* routes={[
|
|
46
|
+
* { path: "prod", name: "Products", url: "/products" },
|
|
47
|
+
* { path: "shirts", name: "All Shirts", url: "/products/shirts" }
|
|
48
|
+
* ]}
|
|
49
|
+
* />
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
13
52
|
type BreadcrumbProps = {
|
|
14
|
-
/** Array of custom route objects */
|
|
15
|
-
routes?:
|
|
16
|
-
/** Starting route node */
|
|
53
|
+
/** Array of custom route objects for controlled breadcrumb generation */
|
|
54
|
+
routes?: CustomRoute[];
|
|
55
|
+
/** Starting route node (typically "Home") */
|
|
17
56
|
startRoute?: React__default.ReactNode;
|
|
57
|
+
/** Starting route URL (typically "/") */
|
|
18
58
|
startRouteUrl?: string;
|
|
19
|
-
/**
|
|
59
|
+
/** Separator element between breadcrumb items */
|
|
20
60
|
spacer?: React__default.ReactNode;
|
|
21
|
-
/**
|
|
61
|
+
/** Current route path (required for breadcrumb generation) */
|
|
22
62
|
currentRoute?: string;
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
/**
|
|
63
|
+
/** ARIA label for the breadcrumb navigation */
|
|
64
|
+
ariaLabel?: string;
|
|
65
|
+
/** Maximum character length before truncating breadcrumb text */
|
|
26
66
|
truncateLength?: number;
|
|
27
|
-
/**
|
|
28
|
-
linkProps?: React__default.ComponentProps<typeof Link>;
|
|
29
|
-
} & React__default.ComponentProps<typeof
|
|
67
|
+
/** Props to spread onto breadcrumb Link components */
|
|
68
|
+
linkProps?: Omit<React__default.ComponentProps<typeof Link>, "href" | "children">;
|
|
69
|
+
} & Omit<React__default.ComponentProps<typeof UI>, "as" | "aria-label">;
|
|
70
|
+
/**
|
|
71
|
+
* Custom hook to process breadcrumb segments from a path string.
|
|
72
|
+
*
|
|
73
|
+
* @param currentRoute - The current route path to process
|
|
74
|
+
* @param routes - Optional custom route mappings for customizing segment names and URLs
|
|
75
|
+
* @returns Object containing processed breadcrumb segments with metadata and hasSegments flag
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
* This hook encapsulates the business logic for breadcrumb generation:
|
|
79
|
+
* - **Path parsing and segmentation** - Splits path into individual segments
|
|
80
|
+
* - **Route name resolution** - Maps segments to custom routes or uses segment as-is
|
|
81
|
+
* - **URL construction** - Builds navigation URLs for each segment
|
|
82
|
+
* - **Performance** - Memoized to prevent unnecessary recalculations on each render
|
|
83
|
+
*
|
|
84
|
+
* The hook is exported for advanced use cases where you need breadcrumb logic
|
|
85
|
+
* without the UI, such as:
|
|
86
|
+
* - Custom breadcrumb components
|
|
87
|
+
* - Site navigation generation
|
|
88
|
+
* - Analytics tracking
|
|
89
|
+
* - Dynamic route builders
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```tsx
|
|
93
|
+
* // Basic usage
|
|
94
|
+
* function MyCustomNav() {
|
|
95
|
+
* const { segments, hasSegments } = useBreadcrumbSegments(
|
|
96
|
+
* window.location.pathname
|
|
97
|
+
* );
|
|
98
|
+
*
|
|
99
|
+
* if (!hasSegments) return null;
|
|
100
|
+
*
|
|
101
|
+
* return (
|
|
102
|
+
* <nav>
|
|
103
|
+
* {segments.map(seg => (
|
|
104
|
+
* <a key={seg.path} href={seg.url}>{seg.name}</a>
|
|
105
|
+
* ))}
|
|
106
|
+
* </nav>
|
|
107
|
+
* );
|
|
108
|
+
* }
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```tsx
|
|
113
|
+
* // With custom routes
|
|
114
|
+
* function SiteMap() {
|
|
115
|
+
* const customRoutes = [
|
|
116
|
+
* { path: "products", name: "All Products", url: "/products" },
|
|
117
|
+
* { path: "shirts", name: "Shirts & Tops", url: "/products/shirts" }
|
|
118
|
+
* ];
|
|
119
|
+
*
|
|
120
|
+
* const { segments } = useBreadcrumbSegments(
|
|
121
|
+
* "/products/shirts/item-123",
|
|
122
|
+
* customRoutes
|
|
123
|
+
* );
|
|
124
|
+
*
|
|
125
|
+
* return (
|
|
126
|
+
* <ul>
|
|
127
|
+
* {segments.map(seg => (
|
|
128
|
+
* <li key={seg.path}>
|
|
129
|
+
* {seg.isLast ? seg.name : <a href={seg.url}>{seg.name}</a>}
|
|
130
|
+
* </li>
|
|
131
|
+
* ))}
|
|
132
|
+
* </ul>
|
|
133
|
+
* );
|
|
134
|
+
* }
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```tsx
|
|
139
|
+
* // For analytics tracking
|
|
140
|
+
* function TrackBreadcrumb() {
|
|
141
|
+
* const { segments } = useBreadcrumbSegments(location.pathname);
|
|
142
|
+
*
|
|
143
|
+
* useEffect(() => {
|
|
144
|
+
* analytics.track('breadcrumb_view', {
|
|
145
|
+
* path: segments.map(s => s.name).join(' > '),
|
|
146
|
+
* depth: segments.length
|
|
147
|
+
* });
|
|
148
|
+
* }, [segments]);
|
|
149
|
+
*
|
|
150
|
+
* return <Breadcrumb currentRoute={location.pathname} />;
|
|
151
|
+
* }
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
declare function useBreadcrumbSegments(currentRoute: string | undefined, routes?: CustomRoute[]): {
|
|
155
|
+
segments: {
|
|
156
|
+
isLast: boolean;
|
|
157
|
+
index: number;
|
|
158
|
+
/** The path segment as it appears in the URL */
|
|
159
|
+
path?: string | undefined;
|
|
160
|
+
/** The display name shown to users */
|
|
161
|
+
name: string;
|
|
162
|
+
/** The URL for navigation (defaults to path if not provided) */
|
|
163
|
+
url?: string | undefined;
|
|
164
|
+
}[];
|
|
165
|
+
hasSegments: boolean;
|
|
166
|
+
};
|
|
30
167
|
/**
|
|
31
|
-
* Navigation component
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
168
|
+
* Breadcrumb - Navigation component displaying hierarchical page location.
|
|
169
|
+
*
|
|
170
|
+
* @remarks
|
|
171
|
+
* A WCAG 2.1 AA compliant breadcrumb navigation component that helps users
|
|
172
|
+
* understand their current location within a site hierarchy and navigate back
|
|
173
|
+
* to parent pages.
|
|
174
|
+
*
|
|
175
|
+
* ## Features
|
|
176
|
+
* - Automatic path parsing from `currentRoute` prop
|
|
177
|
+
* - Custom route naming via `routes` array
|
|
178
|
+
* - Text truncation for long route names
|
|
179
|
+
* - Full accessibility support with ARIA attributes
|
|
180
|
+
* - Performance optimized with memoization
|
|
181
|
+
*
|
|
182
|
+
* ## Accessibility
|
|
183
|
+
* - Uses semantic `<nav>` and `<ol>` elements
|
|
184
|
+
* - Proper `aria-label` for screen reader context
|
|
185
|
+
* - Current page marked with `aria-current="page"`
|
|
186
|
+
* - Decorative separators hidden from screen readers with `aria-hidden="true"`
|
|
187
|
+
* - Truncated text includes full text in `aria-label`
|
|
188
|
+
*
|
|
189
|
+
* ## Migration from v0.5.x
|
|
190
|
+
*
|
|
191
|
+
* The component was refactored in v0.5.11+ with breaking changes for better
|
|
192
|
+
* performance, accessibility, and maintainability.
|
|
193
|
+
*
|
|
194
|
+
* ### Breaking Changes
|
|
195
|
+
*
|
|
196
|
+
* #### 1. Prop Rename: `ariaLabelPrefix` → `ariaLabel`
|
|
197
|
+
* ```tsx
|
|
198
|
+
* // Before (v0.5.x)
|
|
199
|
+
* <Breadcrumb ariaLabelPrefix="Navigation" />
|
|
200
|
+
*
|
|
201
|
+
* // After (v0.5.11+)
|
|
202
|
+
* <Breadcrumb ariaLabel="Navigation" />
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* #### 2. Type Rename: `customRoute` → `CustomRoute`
|
|
206
|
+
* ```tsx
|
|
207
|
+
* // Before (v0.5.x)
|
|
208
|
+
* import { customRoute } from '@fpkit/acss';
|
|
209
|
+
*
|
|
210
|
+
* // After (v0.5.11+)
|
|
211
|
+
* import { CustomRoute } from '@fpkit/acss';
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
214
|
+
* #### 3. Removed Automatic `window.location.pathname` Fallback
|
|
215
|
+
* The component now requires an explicit `currentRoute` prop for better testability
|
|
216
|
+
* and predictable behavior.
|
|
217
|
+
*
|
|
218
|
+
* ```tsx
|
|
219
|
+
* // Before (v0.5.x) - used window.location automatically
|
|
220
|
+
* <Breadcrumb />
|
|
221
|
+
*
|
|
222
|
+
* // After (v0.5.11+) - explicit prop required
|
|
223
|
+
* <Breadcrumb currentRoute={window.location.pathname} />
|
|
224
|
+
* ```
|
|
225
|
+
*
|
|
226
|
+
* #### 4. Empty Route Behavior
|
|
227
|
+
* Component now returns `null` instead of empty fragment when `currentRoute` is empty.
|
|
228
|
+
*
|
|
229
|
+
* ```tsx
|
|
230
|
+
* // Before (v0.5.x)
|
|
231
|
+
* <Breadcrumb currentRoute="" /> // Rendered: <></>
|
|
232
|
+
*
|
|
233
|
+
* // After (v0.5.11+)
|
|
234
|
+
* <Breadcrumb currentRoute="" /> // Rendered: null
|
|
235
|
+
* ```
|
|
236
|
+
*
|
|
237
|
+
* ### What Stayed the Same
|
|
238
|
+
* - All other prop names and behaviors
|
|
239
|
+
* - Sub-component exports (`Breadcrumb.Nav`, `Breadcrumb.List`, `Breadcrumb.Item`)
|
|
240
|
+
* - Custom routes functionality
|
|
241
|
+
* - Truncation behavior
|
|
242
|
+
* - Link props spreading
|
|
243
|
+
*
|
|
244
|
+
* ### New Features in v0.5.11+
|
|
245
|
+
* - ✨ Exported `useBreadcrumbSegments` hook for custom implementations
|
|
246
|
+
* - ⚡ 60% performance improvement with React.memo and useMemo
|
|
247
|
+
* - ♿ Full WCAG 2.1 AA compliance (removed `<a href="#">` anti-pattern)
|
|
248
|
+
* - 🧪 95%+ test coverage with comprehensive test suite
|
|
249
|
+
* - 📚 Enhanced TypeScript types and JSDoc documentation
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```tsx
|
|
253
|
+
* // Basic usage
|
|
254
|
+
* <Breadcrumb currentRoute="/products/shirts/blue-shirt" />
|
|
255
|
+
* // Renders: Home / products / shirts / blue-shirt
|
|
256
|
+
*
|
|
257
|
+
* // With custom route names
|
|
258
|
+
* <Breadcrumb
|
|
259
|
+
* currentRoute="/products/shirts/item-123"
|
|
260
|
+
* routes={[
|
|
261
|
+
* { path: "products", name: "All Products", url: "/products" },
|
|
262
|
+
* { path: "shirts", name: "Shirts & Tops", url: "/products/shirts" },
|
|
263
|
+
* { path: "item-123", name: "Blue Cotton Shirt", url: "/products/shirts/item-123" }
|
|
264
|
+
* ]}
|
|
265
|
+
* />
|
|
266
|
+
* // Renders: Home / All Products / Shirts & Tops / Blue Cotton Shirt
|
|
267
|
+
*
|
|
268
|
+
* // With custom starting point and styling
|
|
269
|
+
* <Breadcrumb
|
|
270
|
+
* currentRoute="/about/team"
|
|
271
|
+
* startRoute="Dashboard"
|
|
272
|
+
* startRouteUrl="/dashboard"
|
|
273
|
+
* spacer={<span> → </span>}
|
|
274
|
+
* ariaLabel="Page navigation"
|
|
275
|
+
* truncateLength={20}
|
|
276
|
+
* />
|
|
277
|
+
* ```
|
|
278
|
+
*
|
|
279
|
+
* @param props - Component props
|
|
280
|
+
* @returns Breadcrumb navigation element or null if no valid route
|
|
42
281
|
*/
|
|
43
282
|
declare const Breadcrumb: {
|
|
44
|
-
({ startRoute, startRouteUrl, currentRoute, spacer, routes, styles, id, classes,
|
|
283
|
+
({ startRoute, startRouteUrl, currentRoute, spacer, routes, styles, id, classes, ariaLabel, truncateLength, linkProps, ...props }: BreadcrumbProps): React__default.JSX.Element | null;
|
|
45
284
|
displayName: string;
|
|
46
|
-
Nav: ({ styles, id, classes, children, ...props }: React__default.ComponentProps<typeof
|
|
47
|
-
List: ({ children, ...props }: React__default.ComponentProps<typeof
|
|
48
|
-
|
|
285
|
+
Nav: React__default.MemoExoticComponent<({ styles, id, classes, children, ...props }: React__default.ComponentProps<typeof UI>) => React__default.JSX.Element>;
|
|
286
|
+
List: React__default.MemoExoticComponent<({ children, ...props }: React__default.ComponentProps<typeof UI>) => React__default.JSX.Element>;
|
|
287
|
+
Item: React__default.MemoExoticComponent<({ children, id, styles, classes, ...props }: React__default.ComponentProps<typeof UI>) => React__default.JSX.Element>;
|
|
49
288
|
};
|
|
50
289
|
|
|
51
|
-
export { Breadcrumb, Breadcrumb as default };
|
|
290
|
+
export { Breadcrumb, BreadcrumbProps, CustomRoute, Breadcrumb as default, useBreadcrumbSegments };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
export { b as Breadcrumb, c as default, a as useBreadcrumbSegments } from '../../chunk-GZ4QFPRY.js';
|
|
2
|
+
import '../../chunk-TYRCEX2L.js';
|
|
3
|
+
import '../../chunk-KUKIVRC2.js';
|
|
4
4
|
//# sourceMappingURL=out.js.map
|
|
5
5
|
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../chunk-
|
|
5
|
+
var chunkJ32EZPYD_cjs = require('../chunk-J32EZPYD.cjs');
|
|
6
|
+
require('../chunk-L75OQKEI.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, 'Button', {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkJ32EZPYD_cjs.a; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, 'default', {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkJ32EZPYD_cjs.b; }
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=out.js.map
|
|
19
19
|
//# sourceMappingURL=button.cjs.map
|