@fpkit/acss 3.2.1 → 3.4.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-KAR3HDXK.js +8 -0
- package/libs/chunk-KAR3HDXK.js.map +1 -0
- package/libs/chunk-M5JARVJD.cjs +18 -0
- package/libs/chunk-M5JARVJD.cjs.map +1 -0
- package/libs/components/alert/alert.min.min.css +2 -0
- package/libs/components/badge/badge.min.min.css +2 -0
- package/libs/components/box/box.min.min.css +2 -0
- package/libs/components/breadcrumbs/breadcrumb.min.min.css +2 -0
- package/libs/components/buttons/button.min.min.css +2 -0
- package/libs/components/card.cjs +6 -6
- package/libs/components/card.js +1 -1
- package/libs/components/cards/card-style.min.min.css +2 -0
- package/libs/components/cards/card.min.min.css +2 -0
- package/libs/components/cluster/cluster.min.min.css +2 -0
- package/libs/components/details/details.min.min.css +2 -0
- package/libs/components/dialog/dialog.min.min.css +2 -0
- package/libs/components/flexbox/flex.min.min.css +2 -0
- package/libs/components/form/form.min.min.css +2 -0
- package/libs/components/grid/grid.min.min.css +2 -0
- package/libs/components/icons/icon.min.min.css +2 -0
- package/libs/components/images/img.min.min.css +2 -0
- package/libs/components/layout/landmarks.min.min.css +2 -0
- package/libs/components/link/link.min.min.css +2 -0
- package/libs/components/list/list.min.min.css +2 -0
- package/libs/components/nav/nav.min.min.css +2 -0
- package/libs/components/progress/progress.min.min.css +2 -0
- package/libs/components/stack/stack.min.min.css +2 -0
- package/libs/components/styles/index.min.min.css +2 -0
- package/libs/components/tag/tag.min.min.css +2 -0
- package/libs/components/text-to-speech/text-to-speech.min.min.css +2 -0
- package/libs/index.cjs +27 -25
- 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 +275 -1
- package/libs/index.d.ts +275 -1
- package/libs/index.js +10 -10
- package/libs/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/cards/card.stories.tsx +1 -1
- package/src/components/cards/card.tsx +46 -41
- package/src/components/col/README.mdx +532 -0
- package/src/components/col/col.stories.tsx +424 -0
- package/src/components/col/col.test.tsx +321 -0
- package/src/components/col/col.tsx +105 -0
- package/src/components/col/col.types.ts +76 -0
- package/src/components/row/README.mdx +324 -0
- package/src/components/row/row.stories.tsx +595 -0
- package/src/components/row/row.test.tsx +358 -0
- package/src/components/row/row.tsx +121 -0
- package/src/components/row/row.types.ts +93 -0
- package/src/index.scss +1 -0
- package/src/index.ts +2 -0
- package/src/sass/README.mdx +597 -0
- package/src/sass/_columns.scss +198 -0
- package/src/sass/columns.stories.tsx +456 -0
- package/src/styles/index.css +340 -0
- package/src/styles/index.css.map +1 -1
- package/src/types/layout-primitives.ts +61 -0
- package/libs/chunk-OU52NIKA.js +0 -8
- package/libs/chunk-OU52NIKA.js.map +0 -1
- package/libs/chunk-WWPLBWCQ.cjs +0 -18
- package/libs/chunk-WWPLBWCQ.cjs.map +0 -1
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import UI from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import UI from "#components/ui";
|
|
3
3
|
import type {
|
|
4
4
|
CardProps,
|
|
5
5
|
CardTitleProps,
|
|
6
6
|
CardContentProps,
|
|
7
7
|
CardFooterProps,
|
|
8
8
|
CardComponent,
|
|
9
|
-
} from
|
|
10
|
-
import {
|
|
9
|
+
} from "./card.types";
|
|
10
|
+
import {
|
|
11
|
+
cn,
|
|
12
|
+
CARD_CLASSES,
|
|
13
|
+
handleCardKeyDown,
|
|
14
|
+
warnInteractiveUsage,
|
|
15
|
+
} from "./card.utils";
|
|
11
16
|
|
|
12
17
|
/**
|
|
13
18
|
* Card.Title - Title sub-component for Card
|
|
@@ -36,22 +41,22 @@ export const Title = ({
|
|
|
36
41
|
children,
|
|
37
42
|
className,
|
|
38
43
|
style,
|
|
39
|
-
as =
|
|
44
|
+
as = "h3",
|
|
40
45
|
...props
|
|
41
46
|
}: CardTitleProps) => {
|
|
42
47
|
return (
|
|
43
48
|
<UI
|
|
44
49
|
as={as}
|
|
45
|
-
|
|
50
|
+
classes={cn(CARD_CLASSES.TITLE, className)}
|
|
46
51
|
styles={style}
|
|
47
52
|
{...props}
|
|
48
53
|
>
|
|
49
54
|
{children}
|
|
50
55
|
</UI>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
56
|
+
);
|
|
57
|
+
};
|
|
53
58
|
|
|
54
|
-
Title.displayName =
|
|
59
|
+
Title.displayName = "Card.Title";
|
|
55
60
|
|
|
56
61
|
/**
|
|
57
62
|
* Card.Content - Content sub-component for Card
|
|
@@ -86,22 +91,22 @@ export const Content = ({
|
|
|
86
91
|
children,
|
|
87
92
|
className,
|
|
88
93
|
style,
|
|
89
|
-
as =
|
|
94
|
+
as = "article",
|
|
90
95
|
...props
|
|
91
96
|
}: CardContentProps) => {
|
|
92
97
|
return (
|
|
93
98
|
<UI
|
|
94
99
|
as={as}
|
|
95
|
-
|
|
100
|
+
classes={cn(CARD_CLASSES.CONTENT, className)}
|
|
96
101
|
styles={style}
|
|
97
102
|
{...props}
|
|
98
103
|
>
|
|
99
104
|
{children}
|
|
100
105
|
</UI>
|
|
101
|
-
)
|
|
102
|
-
}
|
|
106
|
+
);
|
|
107
|
+
};
|
|
103
108
|
|
|
104
|
-
Content.displayName =
|
|
109
|
+
Content.displayName = "Card.Content";
|
|
105
110
|
|
|
106
111
|
/**
|
|
107
112
|
* Card.Footer - Footer sub-component for Card
|
|
@@ -133,22 +138,22 @@ export const Footer = ({
|
|
|
133
138
|
children,
|
|
134
139
|
className,
|
|
135
140
|
style,
|
|
136
|
-
as =
|
|
141
|
+
as = "div",
|
|
137
142
|
...props
|
|
138
143
|
}: CardFooterProps) => {
|
|
139
144
|
return (
|
|
140
145
|
<UI
|
|
141
146
|
as={as}
|
|
142
|
-
|
|
147
|
+
classes={cn(CARD_CLASSES.FOOTER, className)}
|
|
143
148
|
styles={style}
|
|
144
149
|
{...props}
|
|
145
150
|
>
|
|
146
151
|
{children}
|
|
147
152
|
</UI>
|
|
148
|
-
)
|
|
149
|
-
}
|
|
153
|
+
);
|
|
154
|
+
};
|
|
150
155
|
|
|
151
|
-
Footer.displayName =
|
|
156
|
+
Footer.displayName = "Card.Footer";
|
|
152
157
|
|
|
153
158
|
/**
|
|
154
159
|
* Card - A flexible, accessible card component with compound component pattern
|
|
@@ -220,35 +225,35 @@ Footer.displayName = 'Card.Footer'
|
|
|
220
225
|
* ```
|
|
221
226
|
*/
|
|
222
227
|
const CardRoot = ({
|
|
223
|
-
as =
|
|
228
|
+
as = "div",
|
|
224
229
|
styles,
|
|
225
230
|
children,
|
|
226
|
-
classes =
|
|
231
|
+
classes = "shadow-sm",
|
|
227
232
|
id,
|
|
228
233
|
interactive = false,
|
|
229
234
|
onClick,
|
|
230
235
|
tabIndex,
|
|
231
236
|
role,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
237
|
+
"aria-label": ariaLabel,
|
|
238
|
+
"aria-labelledby": ariaLabelledBy,
|
|
239
|
+
"aria-describedby": ariaDescribedBy,
|
|
235
240
|
...props
|
|
236
241
|
}: CardProps) => {
|
|
237
242
|
// Development warnings for common accessibility issues
|
|
238
243
|
React.useEffect(() => {
|
|
239
|
-
warnInteractiveUsage(!!onClick, interactive)
|
|
240
|
-
}, [onClick, interactive])
|
|
244
|
+
warnInteractiveUsage(!!onClick, interactive);
|
|
245
|
+
}, [onClick, interactive]);
|
|
241
246
|
|
|
242
247
|
// Interactive card handling
|
|
243
248
|
const handleKeyDown = (event: React.KeyboardEvent) => {
|
|
244
249
|
if (interactive || onClick) {
|
|
245
|
-
handleCardKeyDown(event, onClick)
|
|
250
|
+
handleCardKeyDown(event, onClick);
|
|
246
251
|
}
|
|
247
|
-
}
|
|
252
|
+
};
|
|
248
253
|
|
|
249
254
|
const interactiveProps = interactive
|
|
250
255
|
? {
|
|
251
|
-
role: role ||
|
|
256
|
+
role: role || "button",
|
|
252
257
|
tabIndex: tabIndex ?? 0,
|
|
253
258
|
onClick,
|
|
254
259
|
onKeyDown: handleKeyDown,
|
|
@@ -256,34 +261,34 @@ const CardRoot = ({
|
|
|
256
261
|
: {
|
|
257
262
|
role,
|
|
258
263
|
onClick,
|
|
259
|
-
}
|
|
264
|
+
};
|
|
260
265
|
|
|
261
266
|
return (
|
|
262
267
|
<UI
|
|
263
268
|
as={as}
|
|
264
269
|
id={id}
|
|
265
270
|
styles={styles}
|
|
266
|
-
|
|
271
|
+
classes={classes}
|
|
267
272
|
aria-label={ariaLabel}
|
|
268
273
|
aria-labelledby={ariaLabelledBy}
|
|
269
274
|
aria-describedby={ariaDescribedBy}
|
|
270
|
-
data-card={interactive ?
|
|
275
|
+
data-card={interactive ? "interactive" : true}
|
|
271
276
|
{...interactiveProps}
|
|
272
277
|
{...props}
|
|
273
278
|
>
|
|
274
279
|
{children}
|
|
275
280
|
</UI>
|
|
276
|
-
)
|
|
277
|
-
}
|
|
281
|
+
);
|
|
282
|
+
};
|
|
278
283
|
|
|
279
284
|
// Create compound component with proper TypeScript typing
|
|
280
|
-
export const Card = CardRoot as CardComponent
|
|
281
|
-
Card.displayName =
|
|
282
|
-
Card.Title = Title
|
|
283
|
-
Card.Content = Content
|
|
284
|
-
Card.Footer = Footer
|
|
285
|
+
export const Card = CardRoot as CardComponent;
|
|
286
|
+
Card.displayName = "Card";
|
|
287
|
+
Card.Title = Title;
|
|
288
|
+
Card.Content = Content;
|
|
289
|
+
Card.Footer = Footer;
|
|
285
290
|
|
|
286
|
-
export default Card
|
|
291
|
+
export default Card;
|
|
287
292
|
|
|
288
293
|
// Export types for external consumption
|
|
289
294
|
export type {
|
|
@@ -292,4 +297,4 @@ export type {
|
|
|
292
297
|
CardContentProps,
|
|
293
298
|
CardFooterProps,
|
|
294
299
|
CardComponent,
|
|
295
|
-
} from
|
|
300
|
+
} from "./card.types";
|