@fpkit/acss 3.1.0 → 3.2.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.
- package/libs/{chunk-2NRIP6RB.cjs → chunk-2C3YLBWP.cjs} +3 -3
- package/libs/{chunk-NWJDAHP6.cjs → chunk-2GJHKWEK.cjs} +3 -3
- package/libs/{chunk-FVROL3V5.js → chunk-2JCDEC32.js} +3 -3
- package/libs/{chunk-IRLFZ3OL.js → chunk-3XJC4XUG.js} +2 -2
- package/libs/{chunk-23ANBDCR.js → chunk-4I5MF54P.js} +3 -3
- package/libs/chunk-4I5MF54P.js.map +1 -0
- package/libs/chunk-5CJPTDK3.cjs +31 -0
- package/libs/chunk-5CJPTDK3.cjs.map +1 -0
- package/libs/{chunk-E4OSROCA.cjs → chunk-5QSNJQVH.cjs} +3 -3
- package/libs/{chunk-O3JIHC5M.cjs → chunk-6BUJZ4DJ.cjs} +3 -3
- package/libs/{chunk-WXBFBWYF.cjs → chunk-AFINOD2L.cjs} +3 -3
- package/libs/{chunk-HRRHPLER.js → chunk-AWZLSWDO.js} +2 -2
- package/libs/chunk-DDSXKOUB.js +7 -0
- package/libs/chunk-DDSXKOUB.js.map +1 -0
- package/libs/{chunk-CWRNJA4P.js → chunk-DIJBIOFE.js} +3 -3
- package/libs/chunk-EJ6KYBFE.cjs +13 -0
- package/libs/chunk-EJ6KYBFE.cjs.map +1 -0
- package/libs/{chunk-GUJSMQ3V.cjs → chunk-EKJYOCLY.cjs} +3 -3
- package/libs/{chunk-X5RKCLDC.cjs → chunk-F64GE6RG.cjs} +4 -4
- package/libs/chunk-FMIM3332.js +8 -0
- package/libs/chunk-FMIM3332.js.map +1 -0
- package/libs/{chunk-5RAWNUVD.js → chunk-IBUTNPTQ.js} +2 -2
- package/libs/chunk-IWP4VJEP.cjs +18 -0
- package/libs/chunk-IWP4VJEP.cjs.map +1 -0
- package/libs/{chunk-ZFJ4U45S.js → chunk-KDMX3FAW.js} +2 -2
- package/libs/{chunk-DYFAUAB7.cjs → chunk-LXODKKA3.cjs} +4 -4
- package/libs/chunk-M7JLT62Q.js +9 -0
- package/libs/chunk-M7JLT62Q.js.map +1 -0
- package/libs/{chunk-IQ76HGVP.js → chunk-MBWI67UT.js} +2 -2
- package/libs/{chunk-O5XAJ7BY.cjs → chunk-NCGVF2QS.cjs} +4 -4
- package/libs/{chunk-W2UIN7EV.cjs → chunk-NPWHQVYB.cjs} +3 -3
- package/libs/{chunk-G55UJ53G.cjs → chunk-NZVSXRTB.cjs} +3 -3
- package/libs/chunk-NZVSXRTB.cjs.map +1 -0
- package/libs/{chunk-43TK2ICH.js → chunk-PMWL5XZ4.js} +3 -3
- package/libs/{chunk-KVKQLRJG.js → chunk-TF3GQKOY.js} +2 -2
- package/libs/chunk-TNEJXNZA.cjs +22 -0
- package/libs/chunk-TNEJXNZA.cjs.map +1 -0
- package/libs/{chunk-IEB64SWY.js → chunk-U5VA34SU.js} +2 -2
- package/libs/chunk-UGMP72J2.js +8 -0
- package/libs/chunk-UGMP72J2.js.map +1 -0
- package/libs/{chunk-MGPWZRBX.cjs → chunk-URBGDUFN.cjs} +6 -6
- package/libs/{chunk-QKHPHMG2.js → chunk-ZF6Y7W57.js} +5 -5
- package/libs/component-props-50e69975.d.ts +66 -0
- package/libs/components/box/box.css +1 -0
- package/libs/components/box/box.css.map +1 -0
- package/libs/components/box/box.min.css +3 -0
- package/libs/components/breadcrumbs/breadcrumb.cjs +6 -6
- package/libs/components/breadcrumbs/breadcrumb.js +3 -3
- package/libs/components/button.cjs +4 -4
- package/libs/components/button.d.cts +10 -3
- package/libs/components/button.d.ts +10 -3
- package/libs/components/button.js +2 -2
- package/libs/components/card.cjs +7 -7
- package/libs/components/card.d.cts +13 -85
- package/libs/components/card.d.ts +13 -85
- 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/cluster/cluster.css +1 -0
- package/libs/components/cluster/cluster.css.map +1 -0
- package/libs/components/cluster/cluster.min.css +3 -0
- package/libs/components/dialog/dialog.cjs +7 -7
- package/libs/components/dialog/dialog.js +5 -5
- package/libs/components/form/fields.cjs +4 -4
- package/libs/components/form/fields.js +2 -2
- package/libs/components/form/textarea.cjs +4 -4
- package/libs/components/form/textarea.js +2 -2
- package/libs/components/grid/grid.css +1 -0
- package/libs/components/grid/grid.css.map +1 -0
- package/libs/components/grid/grid.min.css +3 -0
- package/libs/components/heading/heading.cjs +3 -3
- package/libs/components/heading/heading.js +2 -2
- package/libs/components/icons/icon.cjs +4 -4
- package/libs/components/icons/icon.d.cts +2 -2
- package/libs/components/icons/icon.d.ts +2 -2
- package/libs/components/icons/icon.js +2 -2
- package/libs/components/link/link.cjs +6 -6
- package/libs/components/link/link.js +2 -2
- package/libs/components/list/list.cjs +5 -5
- package/libs/components/list/list.js +2 -2
- package/libs/components/modal.cjs +4 -4
- package/libs/components/modal.d.cts +1 -1
- package/libs/components/modal.d.ts +1 -1
- package/libs/components/modal.js +3 -3
- package/libs/components/nav/nav.cjs +7 -7
- package/libs/components/nav/nav.js +3 -3
- package/libs/components/popover/popover.cjs +4 -4
- package/libs/components/popover/popover.d.cts +1 -1
- package/libs/components/popover/popover.d.ts +1 -1
- package/libs/components/popover/popover.js +1 -1
- package/libs/components/stack/stack.css +1 -0
- package/libs/components/stack/stack.css.map +1 -0
- package/libs/components/stack/stack.min.css +3 -0
- package/libs/components/tables/table.cjs +4 -4
- package/libs/components/tables/table.d.cts +2 -2
- package/libs/components/tables/table.d.ts +2 -2
- package/libs/components/tables/table.js +1 -1
- package/libs/components/text/text.cjs +5 -5
- package/libs/components/text/text.js +2 -2
- package/libs/hooks.cjs +4 -4
- package/libs/hooks.js +3 -3
- package/libs/{icons-287fce3a.d.ts → icons-df8e744f.d.ts} +1 -1
- package/libs/icons.cjs +3 -3
- package/libs/icons.d.cts +2 -2
- package/libs/icons.d.ts +2 -2
- package/libs/icons.js +2 -2
- package/libs/index.cjs +74 -73
- 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 +925 -6
- package/libs/index.d.ts +925 -6
- package/libs/index.js +30 -30
- package/libs/index.js.map +1 -1
- package/package.json +2 -2
- package/src/App.tsx +1 -3
- package/src/components/alert/STYLES.mdx +790 -0
- package/src/components/badge/STYLES.mdx +610 -0
- package/src/components/box/README.mdx +401 -0
- package/src/components/box/STYLES.mdx +360 -0
- package/src/components/box/box.scss +245 -0
- package/src/components/box/box.stories.tsx +395 -0
- package/src/components/box/box.test.tsx +425 -0
- package/src/components/box/box.tsx +170 -0
- package/src/components/box/box.types.ts +166 -0
- package/src/components/breadcrumbs/STYLES.mdx +99 -0
- package/src/components/breadcrumbs/bc-item.tsx +0 -1
- package/src/components/buttons/STYLES.mdx +766 -0
- package/src/components/cards/STYLES.mdx +835 -0
- package/src/components/cards/card.scss +29 -21
- package/src/components/cards/card.tsx +13 -3
- package/src/components/cards/card.types.ts +13 -0
- package/src/components/cluster/README.mdx +595 -0
- package/src/components/cluster/STYLES.mdx +626 -0
- package/src/components/cluster/cluster.scss +86 -0
- package/src/components/cluster/cluster.stories.tsx +385 -0
- package/src/components/cluster/cluster.test.tsx +655 -0
- package/src/components/cluster/cluster.tsx +94 -0
- package/src/components/cluster/cluster.types.ts +75 -0
- package/src/components/details/STYLES.mdx +445 -0
- package/src/components/dialog/STYLES.mdx +888 -0
- package/src/components/flexbox/STYLES.mdx +857 -0
- package/src/components/flexbox/flex.stories.tsx +842 -141
- package/src/components/flexbox/flex.types.ts +25 -6
- package/src/components/form/STYLES.mdx +821 -0
- package/src/components/grid/README.mdx +709 -0
- package/src/components/grid/STYLES.mdx +785 -0
- package/src/components/grid/grid.scss +287 -0
- package/src/components/grid/grid.stories.tsx +486 -0
- package/src/components/grid/grid.test.tsx +981 -0
- package/src/components/grid/grid.tsx +222 -0
- package/src/components/grid/grid.types.ts +344 -0
- package/src/components/icons/STYLES.mdx +56 -0
- package/src/components/icons/components/arrow-right.tsx +0 -5
- package/src/components/images/STYLES.mdx +75 -0
- package/src/components/kit.tsx +8 -4
- package/src/components/layout/STYLES.mdx +556 -0
- package/src/components/link/STYLES.mdx +75 -0
- package/src/components/list/STYLES.mdx +631 -0
- package/src/components/nav/STYLES.mdx +460 -0
- package/src/components/popover/popover.tsx +1 -1
- package/src/components/progress/STYLES.mdx +64 -0
- package/src/components/stack/README.mdx +400 -0
- package/src/components/stack/STYLES.mdx +414 -0
- package/src/components/stack/stack.scss +109 -0
- package/src/components/stack/stack.stories.tsx +559 -0
- package/src/components/stack/stack.test.tsx +426 -0
- package/src/components/stack/stack.tsx +141 -0
- package/src/components/stack/stack.types.ts +133 -0
- package/src/components/tables/table-elements.tsx +1 -1
- package/src/components/tables/table.tsx +2 -2
- package/src/components/tag/STYLES.mdx +105 -0
- package/src/components/text-to-speech/STYLES.mdx +80 -0
- package/src/components/text-to-speech/TextToSpeech.tsx +0 -4
- package/src/components/text-to-speech/useTextToSpeech.tsx +2 -6
- package/src/components/ui.tsx +3 -3
- package/src/decorators/instructions.tsx +22 -18
- package/src/hooks/popover/popover.tsx +1 -1
- package/src/index.scss +5 -1
- package/src/index.ts +305 -12
- package/src/sass/GLOBALS-STYLES.md +631 -0
- package/src/sass/_globals.scss +45 -24
- package/src/styles/box/box.css +220 -0
- package/src/styles/box/box.css.map +1 -0
- package/src/styles/cards/card.css +22 -17
- package/src/styles/cards/card.css.map +1 -1
- package/src/styles/cluster/cluster.css +71 -0
- package/src/styles/cluster/cluster.css.map +1 -0
- package/src/styles/grid/grid.css +238 -0
- package/src/styles/grid/grid.css.map +1 -0
- package/src/styles/index.css +667 -49
- package/src/styles/index.css.map +1 -1
- package/src/styles/stack/stack.css +86 -0
- package/src/styles/stack/stack.css.map +1 -0
- package/src/types/component-props.ts +42 -13
- package/src/types/layout-primitives.ts +48 -0
- package/src/types/shared.ts +10 -26
- package/libs/chunk-23ANBDCR.js.map +0 -1
- package/libs/chunk-5QD3DWFI.js +0 -9
- package/libs/chunk-5QD3DWFI.js.map +0 -1
- package/libs/chunk-6WTC4JXH.cjs +0 -31
- package/libs/chunk-6WTC4JXH.cjs.map +0 -1
- package/libs/chunk-ENTCUJ3A.cjs +0 -13
- package/libs/chunk-ENTCUJ3A.cjs.map +0 -1
- package/libs/chunk-G55UJ53G.cjs.map +0 -1
- package/libs/chunk-HHLNOC5T.js +0 -7
- package/libs/chunk-HHLNOC5T.js.map +0 -1
- package/libs/chunk-KK47SYZI.js +0 -8
- package/libs/chunk-KK47SYZI.js.map +0 -1
- package/libs/chunk-US2I5GI7.cjs +0 -22
- package/libs/chunk-US2I5GI7.cjs.map +0 -1
- package/libs/chunk-W5TKWBFC.cjs +0 -18
- package/libs/chunk-W5TKWBFC.cjs.map +0 -1
- package/libs/chunk-Y2PFDELK.js +0 -8
- package/libs/chunk-Y2PFDELK.js.map +0 -1
- package/libs/component-props-67d978a2.d.ts +0 -38
- /package/libs/{chunk-2NRIP6RB.cjs.map → chunk-2C3YLBWP.cjs.map} +0 -0
- /package/libs/{chunk-NWJDAHP6.cjs.map → chunk-2GJHKWEK.cjs.map} +0 -0
- /package/libs/{chunk-FVROL3V5.js.map → chunk-2JCDEC32.js.map} +0 -0
- /package/libs/{chunk-IRLFZ3OL.js.map → chunk-3XJC4XUG.js.map} +0 -0
- /package/libs/{chunk-E4OSROCA.cjs.map → chunk-5QSNJQVH.cjs.map} +0 -0
- /package/libs/{chunk-O3JIHC5M.cjs.map → chunk-6BUJZ4DJ.cjs.map} +0 -0
- /package/libs/{chunk-WXBFBWYF.cjs.map → chunk-AFINOD2L.cjs.map} +0 -0
- /package/libs/{chunk-HRRHPLER.js.map → chunk-AWZLSWDO.js.map} +0 -0
- /package/libs/{chunk-CWRNJA4P.js.map → chunk-DIJBIOFE.js.map} +0 -0
- /package/libs/{chunk-GUJSMQ3V.cjs.map → chunk-EKJYOCLY.cjs.map} +0 -0
- /package/libs/{chunk-X5RKCLDC.cjs.map → chunk-F64GE6RG.cjs.map} +0 -0
- /package/libs/{chunk-5RAWNUVD.js.map → chunk-IBUTNPTQ.js.map} +0 -0
- /package/libs/{chunk-ZFJ4U45S.js.map → chunk-KDMX3FAW.js.map} +0 -0
- /package/libs/{chunk-DYFAUAB7.cjs.map → chunk-LXODKKA3.cjs.map} +0 -0
- /package/libs/{chunk-IQ76HGVP.js.map → chunk-MBWI67UT.js.map} +0 -0
- /package/libs/{chunk-O5XAJ7BY.cjs.map → chunk-NCGVF2QS.cjs.map} +0 -0
- /package/libs/{chunk-W2UIN7EV.cjs.map → chunk-NPWHQVYB.cjs.map} +0 -0
- /package/libs/{chunk-43TK2ICH.js.map → chunk-PMWL5XZ4.js.map} +0 -0
- /package/libs/{chunk-KVKQLRJG.js.map → chunk-TF3GQKOY.js.map} +0 -0
- /package/libs/{chunk-IEB64SWY.js.map → chunk-U5VA34SU.js.map} +0 -0
- /package/libs/{chunk-MGPWZRBX.cjs.map → chunk-URBGDUFN.cjs.map} +0 -0
- /package/libs/{chunk-QKHPHMG2.js.map → chunk-ZF6Y7W57.js.map} +0 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { ComponentProps } from "../../types/component-props";
|
|
2
|
+
import type { SpacingScale, BoxElement } from "../../types/layout-primitives";
|
|
3
|
+
import type React from "react";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Box component - a fundamental container primitive for spacing and sizing control.
|
|
7
|
+
*
|
|
8
|
+
* The Box component provides a flexible, semantic container with comprehensive spacing, sizing,
|
|
9
|
+
* and visual customization options. All spacing values use the unified spacing scale with
|
|
10
|
+
* fluid responsive values via CSS clamp().
|
|
11
|
+
*
|
|
12
|
+
* ## Design Principles
|
|
13
|
+
* - **Logical Properties**: Uses `padding-inline`/`padding-block` for better i18n support
|
|
14
|
+
* - **Fluid Spacing**: All spacing scales responsively without media queries
|
|
15
|
+
* - **Semantic HTML**: Defaults to `div` but supports semantic elements via `as` prop
|
|
16
|
+
* - **CSS Custom Properties**: All values customizable via CSS variables
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Basic container with padding
|
|
20
|
+
* <Box padding="md">
|
|
21
|
+
* <h1>Content</h1>
|
|
22
|
+
* </Box>
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Centered container with max width
|
|
26
|
+
* <Box
|
|
27
|
+
* padding="lg"
|
|
28
|
+
* maxWidth="container"
|
|
29
|
+
* style={{ marginInline: 'auto' }}
|
|
30
|
+
* >
|
|
31
|
+
* <article>Centered content</article>
|
|
32
|
+
* </Box>
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Card-like box with radius
|
|
36
|
+
* <Box
|
|
37
|
+
* padding="lg"
|
|
38
|
+
* radius="md"
|
|
39
|
+
* as="article"
|
|
40
|
+
* styles={{
|
|
41
|
+
* '--box-bg': '#fff',
|
|
42
|
+
* boxShadow: '0 1px 3px rgba(0,0,0,0.1)'
|
|
43
|
+
* }}
|
|
44
|
+
* >
|
|
45
|
+
* <h2>Card Title</h2>
|
|
46
|
+
* <p>Card content</p>
|
|
47
|
+
* </Box>
|
|
48
|
+
*/
|
|
49
|
+
export interface BoxProps
|
|
50
|
+
extends Partial<ComponentProps>,
|
|
51
|
+
Omit<React.HTMLAttributes<HTMLElement>, "className"> {
|
|
52
|
+
/**
|
|
53
|
+
* Padding on all sides.
|
|
54
|
+
* Uses unified spacing scale: '0' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
55
|
+
* Maps to CSS custom properties (--spacing-*)
|
|
56
|
+
* @example
|
|
57
|
+
* <Box padding="md">Content</Box>
|
|
58
|
+
*/
|
|
59
|
+
padding?: SpacingScale;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Padding on inline axis (left/right in LTR, right/left in RTL).
|
|
63
|
+
* Uses logical property `padding-inline` for better internationalization.
|
|
64
|
+
* @example
|
|
65
|
+
* <Box paddingInline="xl">Wide horizontal padding</Box>
|
|
66
|
+
*/
|
|
67
|
+
paddingInline?: SpacingScale;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Padding on block axis (top/bottom).
|
|
71
|
+
* Uses logical property `padding-block` for consistency.
|
|
72
|
+
* @example
|
|
73
|
+
* <Box paddingBlock="md">Vertical padding</Box>
|
|
74
|
+
*/
|
|
75
|
+
paddingBlock?: SpacingScale;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Margin on all sides.
|
|
79
|
+
* Uses unified spacing scale: '0' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
80
|
+
* @example
|
|
81
|
+
* <Box margin="lg">Content with margin</Box>
|
|
82
|
+
*/
|
|
83
|
+
margin?: SpacingScale;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Margin on inline axis (left/right in LTR).
|
|
87
|
+
* For centering, use inline styles: `style={{ marginInline: 'auto' }}`
|
|
88
|
+
* @example
|
|
89
|
+
* <Box marginInline="md">Horizontal margin</Box>
|
|
90
|
+
*/
|
|
91
|
+
marginInline?: SpacingScale;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Margin on block axis (top/bottom).
|
|
95
|
+
* @example
|
|
96
|
+
* <Box marginBlock="lg">Vertical margin</Box>
|
|
97
|
+
*/
|
|
98
|
+
marginBlock?: SpacingScale;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Width behavior control.
|
|
102
|
+
* - 'auto': Natural width (default)
|
|
103
|
+
* - 'full': 100% width
|
|
104
|
+
* - 'fit': Width fits content (fit-content)
|
|
105
|
+
* - 'max': Width determined by widest content (max-content)
|
|
106
|
+
* @default 'auto'
|
|
107
|
+
* @example
|
|
108
|
+
* <Box width="full">Full width box</Box>
|
|
109
|
+
*/
|
|
110
|
+
width?: "auto" | "full" | "fit" | "max";
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Maximum width constraint.
|
|
114
|
+
* Useful for readable text widths and responsive containers.
|
|
115
|
+
* Sizes map to: xs(480px), sm(640px), md(768px), lg(1024px), xl(1280px), container(1200px)
|
|
116
|
+
* @example
|
|
117
|
+
* <Box maxWidth="container" style={{ marginInline: 'auto' }}>
|
|
118
|
+
* Centered container with max width
|
|
119
|
+
* </Box>
|
|
120
|
+
*/
|
|
121
|
+
maxWidth?: "xs" | "sm" | "md" | "lg" | "xl" | "container";
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Border radius for rounded corners.
|
|
125
|
+
* - 'xs' through 'xl': Increasing radii (2px - 12px)
|
|
126
|
+
* - 'full': Fully rounded (9999px) for pills/circles
|
|
127
|
+
* @example
|
|
128
|
+
* <Box radius="md">Slightly rounded box</Box>
|
|
129
|
+
* @example
|
|
130
|
+
* <Box radius="full" width="fit" padding="md">
|
|
131
|
+
* <Avatar />
|
|
132
|
+
* </Box>
|
|
133
|
+
*/
|
|
134
|
+
radius?: SpacingScale | "full";
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Polymorphic element type to render.
|
|
138
|
+
* Defaults to 'div' but supports semantic HTML elements.
|
|
139
|
+
* Choose semantic elements for better accessibility:
|
|
140
|
+
* - 'section' for thematic groupings
|
|
141
|
+
* - 'article' for self-contained content
|
|
142
|
+
* - 'aside' for tangentially related content
|
|
143
|
+
* - 'main' for primary page content
|
|
144
|
+
* - 'header'/'footer' for page/section headers/footers
|
|
145
|
+
* - 'nav' for navigation landmarks
|
|
146
|
+
* @default 'div'
|
|
147
|
+
* @example
|
|
148
|
+
* <Box as="section" padding="lg">
|
|
149
|
+
* <h2>Section Content</h2>
|
|
150
|
+
* </Box>
|
|
151
|
+
*/
|
|
152
|
+
as?: BoxElement;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Additional CSS classes to apply.
|
|
156
|
+
* Merged with generated utility classes.
|
|
157
|
+
* @example
|
|
158
|
+
* <Box classes="my-custom-class" padding="md">Content</Box>
|
|
159
|
+
*/
|
|
160
|
+
className?: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Children elements to render inside the Box.
|
|
164
|
+
*/
|
|
165
|
+
children?: React.ReactNode;
|
|
166
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Meta } from "@storybook/addon-docs/blocks";
|
|
2
|
+
|
|
3
|
+
<Meta title="FP.REACT Components/Breadcrumbs/Styles" />
|
|
4
|
+
|
|
5
|
+
# Breadcrumb Styles
|
|
6
|
+
|
|
7
|
+
Navigation breadcrumb styling using semantic `<nav>` with ordered lists for
|
|
8
|
+
showing page hierarchy and location.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
The fpkit breadcrumb system provides navigation trail styling using `<nav>`
|
|
13
|
+
elements with ordered lists. Includes automatic separators and current page
|
|
14
|
+
indication.
|
|
15
|
+
|
|
16
|
+
### Key Features
|
|
17
|
+
|
|
18
|
+
- **Semantic HTML** - Uses `<nav>` with `<ol>` for proper structure
|
|
19
|
+
- **Automatic separators** - Visual separators between items
|
|
20
|
+
- **Current page styling** - Distinct styling for current location
|
|
21
|
+
- **CSS custom properties** - Full theming control
|
|
22
|
+
- **Rem-based sizing** - All measurements use rem units (1rem = 16px)
|
|
23
|
+
|
|
24
|
+
## CSS Custom Properties
|
|
25
|
+
|
|
26
|
+
```css
|
|
27
|
+
nav[data-breadcrumb] {
|
|
28
|
+
/* Layout */
|
|
29
|
+
--breadcrumb-display: flex;
|
|
30
|
+
--breadcrumb-gap: 0.5rem; /* 8px */
|
|
31
|
+
|
|
32
|
+
/* Colors */
|
|
33
|
+
--breadcrumb-color: currentColor;
|
|
34
|
+
--breadcrumb-current-color: rgb(46, 46, 46);
|
|
35
|
+
|
|
36
|
+
/* Typography */
|
|
37
|
+
--breadcrumb-fs: var(--fs-3);
|
|
38
|
+
|
|
39
|
+
/* Spacing */
|
|
40
|
+
--breadcrumb-padding-inline: unset;
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Basic Structure
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<nav data-breadcrumb aria-label="Breadcrumb">
|
|
48
|
+
<ol>
|
|
49
|
+
<li>
|
|
50
|
+
<a href="/">Home</a>
|
|
51
|
+
<span aria-hidden="true">/</span>
|
|
52
|
+
</li>
|
|
53
|
+
<li>
|
|
54
|
+
<a href="/products">Products</a>
|
|
55
|
+
<span aria-hidden="true">/</span>
|
|
56
|
+
</li>
|
|
57
|
+
<li>
|
|
58
|
+
<a href="/products/shoes" aria-current="page">Shoes</a>
|
|
59
|
+
</li>
|
|
60
|
+
</ol>
|
|
61
|
+
</nav>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Real-World Examples
|
|
65
|
+
|
|
66
|
+
### E-commerce Breadcrumb
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<nav data-breadcrumb aria-label="Breadcrumb">
|
|
70
|
+
<ol>
|
|
71
|
+
<li><a href="/">Home</a><span aria-hidden="true">/</span></li>
|
|
72
|
+
<li><a href="/shop">Shop</a><span aria-hidden="true">/</span></li>
|
|
73
|
+
<li>
|
|
74
|
+
<a href="/shop/clothing">Clothing</a><span aria-hidden="true">/</span>
|
|
75
|
+
</li>
|
|
76
|
+
<li><a aria-current="page">Men's Shirts</a></li>
|
|
77
|
+
</ol>
|
|
78
|
+
</nav>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Documentation Site
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<nav data-breadcrumb aria-label="Breadcrumb">
|
|
85
|
+
<ol>
|
|
86
|
+
<li><a href="/">Docs</a><span aria-hidden="true">›</span></li>
|
|
87
|
+
<li>
|
|
88
|
+
<a href="/components">Components</a><span aria-hidden="true">›</span>
|
|
89
|
+
</li>
|
|
90
|
+
<li><a aria-current="page">Button</a></li>
|
|
91
|
+
</ol>
|
|
92
|
+
</nav>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Related Resources
|
|
96
|
+
|
|
97
|
+
- **React Component** - See README for React Breadcrumb component API
|
|
98
|
+
- **W3C ARIA: Breadcrumb Pattern** -
|
|
99
|
+
https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/
|