@tosui/react 0.1.0 → 0.1.2
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/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +109 -0
- package/dist/components/Accordion/Accordion.js.map +1 -0
- package/dist/components/Accordion/accordion.module.css +36 -0
- package/dist/components/Accordion/accordion.module.css.js +27 -0
- package/dist/components/Accordion/accordion.module.css.js.map +1 -0
- package/dist/components/Alert/Alert.js +109 -0
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/Alert/alert.module.css +27 -0
- package/dist/components/Alert/alert.module.css.js +24 -0
- package/dist/components/Alert/alert.module.css.js.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.js +72 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Avatar/avatar.module.css +14 -0
- package/dist/components/Avatar/avatar.module.css.js +15 -0
- package/dist/components/Avatar/avatar.module.css.js.map +1 -0
- package/dist/components/Badge/Badge.js +66 -0
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Badge/badge.module.css +3 -0
- package/dist/components/Badge/badge.module.css.js +9 -0
- package/dist/components/Badge/badge.module.css.js.map +1 -0
- package/dist/components/Box/Box.js +217 -0
- package/dist/components/Box/Box.js.map +1 -0
- package/dist/components/Box/borders/borders.js +91 -0
- package/dist/components/Box/borders/borders.js.map +1 -0
- package/dist/components/Box/borders/borders.module.css +49 -0
- package/dist/components/Box/borders/borders.module.css.js +46 -0
- package/dist/components/Box/borders/borders.module.css.js.map +1 -0
- package/dist/components/Box/colors/colors.js +45 -0
- package/dist/components/Box/colors/colors.js.map +1 -0
- package/dist/components/Box/colors/colors.module.css +113 -0
- package/dist/components/Box/colors/colors.module.css.js +114 -0
- package/dist/components/Box/colors/colors.module.css.js.map +1 -0
- package/dist/components/Box/display/display.js +52 -0
- package/dist/components/Box/display/display.js.map +1 -0
- package/dist/components/Box/display/display.module.css +375 -0
- package/dist/components/Box/display/display.module.css.js +318 -0
- package/dist/components/Box/display/display.module.css.js.map +1 -0
- package/dist/components/Box/flexbox/flexbox.js +139 -0
- package/dist/components/Box/flexbox/flexbox.js.map +1 -0
- package/dist/components/Box/flexbox/flexbox.module.css +65 -0
- package/dist/components/Box/flexbox/flexbox.module.css.js +62 -0
- package/dist/components/Box/flexbox/flexbox.module.css.js.map +1 -0
- package/dist/components/Box/grid/grid.js +49 -0
- package/dist/components/Box/grid/grid.js.map +1 -0
- package/dist/components/Box/grid/grid.module.css +19 -0
- package/dist/components/Box/grid/grid.module.css.js +20 -0
- package/dist/components/Box/grid/grid.module.css.js.map +1 -0
- package/dist/components/Box/inset/inset.js +96 -0
- package/dist/components/Box/inset/inset.js.map +1 -0
- package/dist/components/Box/inset/inset.module.css +187 -0
- package/dist/components/Box/inset/inset.module.css.js +174 -0
- package/dist/components/Box/inset/inset.module.css.js.map +1 -0
- package/dist/components/Box/interactions/interactions.js +45 -0
- package/dist/components/Box/interactions/interactions.js.map +1 -0
- package/dist/components/Box/interactions/interactions.module.css +43 -0
- package/dist/components/Box/interactions/interactions.module.css.js +44 -0
- package/dist/components/Box/interactions/interactions.module.css.js.map +1 -0
- package/dist/components/Box/margin/margin.js +96 -0
- package/dist/components/Box/margin/margin.js.map +1 -0
- package/dist/components/Box/margin/margin.module.css +187 -0
- package/dist/components/Box/margin/margin.module.css.js +174 -0
- package/dist/components/Box/margin/margin.module.css.js.map +1 -0
- package/dist/components/Box/opacity/opacity.js +52 -0
- package/dist/components/Box/opacity/opacity.js.map +1 -0
- package/dist/components/Box/opacity/opacity.module.css +51 -0
- package/dist/components/Box/opacity/opacity.module.css.js +174 -0
- package/dist/components/Box/opacity/opacity.module.css.js.map +1 -0
- package/dist/components/Box/overflow/overflow.js +69 -0
- package/dist/components/Box/overflow/overflow.js.map +1 -0
- package/dist/components/Box/overflow/overflow.module.css +155 -0
- package/dist/components/Box/overflow/overflow.module.css.js +510 -0
- package/dist/components/Box/overflow/overflow.module.css.js.map +1 -0
- package/dist/components/Box/padding/padding.js +96 -0
- package/dist/components/Box/padding/padding.js.map +1 -0
- package/dist/components/Box/padding/padding.module.css +187 -0
- package/dist/components/Box/padding/padding.module.css.js +174 -0
- package/dist/components/Box/padding/padding.module.css.js.map +1 -0
- package/dist/components/Box/position/position.js +52 -0
- package/dist/components/Box/position/position.js.map +1 -0
- package/dist/components/Box/position/position.module.css +234 -0
- package/dist/components/Box/position/position.module.css.js +214 -0
- package/dist/components/Box/position/position.module.css.js.map +1 -0
- package/dist/components/Box/reset/reset.js +6 -0
- package/dist/components/Box/reset/reset.js.map +1 -0
- package/dist/components/Box/reset/reset.module.css +23 -0
- package/dist/components/Box/reset/reset.module.css.js +9 -0
- package/dist/components/Box/reset/reset.module.css.js.map +1 -0
- package/dist/components/Box/roundness/roundness.js +92 -0
- package/dist/components/Box/roundness/roundness.js.map +1 -0
- package/dist/components/Box/roundness/roundness.module.css +47 -0
- package/dist/components/Box/roundness/roundness.module.css.js +46 -0
- package/dist/components/Box/roundness/roundness.module.css.js.map +1 -0
- package/dist/components/Box/shadows/shadows.js +52 -0
- package/dist/components/Box/shadows/shadows.js.map +1 -0
- package/dist/components/Box/shadows/shadows.module.css +51 -0
- package/dist/components/Box/shadows/shadows.module.css.js +174 -0
- package/dist/components/Box/shadows/shadows.module.css.js.map +1 -0
- package/dist/components/Box/shared/constants.js +21 -0
- package/dist/components/Box/shared/constants.js.map +1 -0
- package/dist/components/Box/shared/spacing.js +10 -0
- package/dist/components/Box/shared/spacing.js.map +1 -0
- package/dist/components/Box/sizing/sizing.js +75 -0
- package/dist/components/Box/sizing/sizing.js.map +1 -0
- package/dist/components/Box/sizing/sizing.module.css +281 -0
- package/dist/components/Box/sizing/sizing.module.css.js +258 -0
- package/dist/components/Box/sizing/sizing.module.css.js.map +1 -0
- package/dist/components/Box/text/text.js +45 -0
- package/dist/components/Box/text/text.js.map +1 -0
- package/dist/components/Box/text/text.module.css +29 -0
- package/dist/components/Box/text/text.module.css.js +30 -0
- package/dist/components/Box/text/text.module.css.js.map +1 -0
- package/dist/components/Box/typography/typography.js +27 -0
- package/dist/components/Box/typography/typography.js.map +1 -0
- package/dist/components/Box/typography/typography.module.css +26 -0
- package/dist/components/Box/typography/typography.module.css.js +25 -0
- package/dist/components/Box/typography/typography.module.css.js.map +1 -0
- package/dist/components/Box/zIndex/zIndex.js +52 -0
- package/dist/components/Box/zIndex/zIndex.js.map +1 -0
- package/dist/components/Box/zIndex/zIndex.module.css +90 -0
- package/dist/components/Box/zIndex/zIndex.module.css.js +300 -0
- package/dist/components/Box/zIndex/zIndex.module.css.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +78 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Breadcrumb/breadcrumb.module.css +25 -0
- package/dist/components/Breadcrumb/breadcrumb.module.css.js +21 -0
- package/dist/components/Breadcrumb/breadcrumb.module.css.js.map +1 -0
- package/dist/components/Button/Button.js +129 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/button.module.css +17 -0
- package/dist/components/Button/button.module.css.js +18 -0
- package/dist/components/Button/button.module.css.js.map +1 -0
- package/dist/components/Card/Card.js +60 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Card/card.module.css +16 -0
- package/dist/components/Card/card.module.css.js +18 -0
- package/dist/components/Card/card.module.css.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +74 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Checkbox/checkbox.module.css +65 -0
- package/dist/components/Checkbox/checkbox.module.css.js +15 -0
- package/dist/components/Checkbox/checkbox.module.css.js.map +1 -0
- package/dist/components/Code/Code.js +32 -0
- package/dist/components/Code/Code.js.map +1 -0
- package/dist/components/Container/Container.js +44 -0
- package/dist/components/Container/Container.js.map +1 -0
- package/dist/components/Divider/Divider.js +48 -0
- package/dist/components/Divider/Divider.js.map +1 -0
- package/dist/components/Flex/Flex.js +48 -0
- package/dist/components/Flex/Flex.js.map +1 -0
- package/dist/components/FormField/FormField.js +52 -0
- package/dist/components/FormField/FormField.js.map +1 -0
- package/dist/components/Grid/Grid.js +41 -0
- package/dist/components/Grid/Grid.js.map +1 -0
- package/dist/components/HStack/HStack.js +17 -0
- package/dist/components/HStack/HStack.js.map +1 -0
- package/dist/components/Heading/Heading.js +42 -0
- package/dist/components/Heading/Heading.js.map +1 -0
- package/dist/components/IconButton/IconButton.js +93 -0
- package/dist/components/IconButton/IconButton.js.map +1 -0
- package/dist/components/IconButton/iconbutton.module.css +18 -0
- package/dist/components/IconButton/iconbutton.module.css.js +18 -0
- package/dist/components/IconButton/iconbutton.module.css.js.map +1 -0
- package/dist/components/Image/Image.d.ts.map +1 -1
- package/dist/components/Image/Image.js +101 -0
- package/dist/components/Image/Image.js.map +1 -0
- package/dist/components/Image/image.module.css +44 -0
- package/dist/components/Image/image.module.css.js +36 -0
- package/dist/components/Image/image.module.css.js.map +1 -0
- package/dist/components/Input/Input.js +57 -0
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Input/input.module.css +29 -0
- package/dist/components/Input/input.module.css.js +12 -0
- package/dist/components/Input/input.module.css.js.map +1 -0
- package/dist/components/Label/Label.js +36 -0
- package/dist/components/Label/Label.js.map +1 -0
- package/dist/components/Link/Link.js +38 -0
- package/dist/components/Link/Link.js.map +1 -0
- package/dist/components/Link/link.module.css +28 -0
- package/dist/components/Link/link.module.css.js +16 -0
- package/dist/components/Link/link.module.css.js.map +1 -0
- package/dist/components/List/List.js +51 -0
- package/dist/components/List/List.js.map +1 -0
- package/dist/components/List/list.module.css +45 -0
- package/dist/components/List/list.module.css.js +24 -0
- package/dist/components/List/list.module.css.js.map +1 -0
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/Menu/Menu.js +143 -0
- package/dist/components/Menu/Menu.js.map +1 -0
- package/dist/components/Menu/menu.module.css +24 -0
- package/dist/components/Menu/menu.module.css.js +18 -0
- package/dist/components/Menu/menu.module.css.js.map +1 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +130 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/modal.module.css +26 -0
- package/dist/components/Modal/modal.module.css.js +21 -0
- package/dist/components/Modal/modal.module.css.js.map +1 -0
- package/dist/components/Pagination/Pagination.js +125 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/pagination.module.css +3 -0
- package/dist/components/Pagination/pagination.module.css.js +9 -0
- package/dist/components/Pagination/pagination.module.css.js.map +1 -0
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/Popover.js +144 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Popover/popover.module.css +11 -0
- package/dist/components/Popover/popover.module.css.js +15 -0
- package/dist/components/Popover/popover.module.css.js.map +1 -0
- package/dist/components/Progress/Progress.js +54 -0
- package/dist/components/Progress/Progress.js.map +1 -0
- package/dist/components/Progress/progress.module.css +24 -0
- package/dist/components/Progress/progress.module.css.js +15 -0
- package/dist/components/Progress/progress.module.css.js.map +1 -0
- package/dist/components/Radio/Radio.js +70 -0
- package/dist/components/Radio/Radio.js.map +1 -0
- package/dist/components/Radio/radio.module.css +48 -0
- package/dist/components/Radio/radio.module.css.js +12 -0
- package/dist/components/Radio/radio.module.css.js.map +1 -0
- package/dist/components/Select/Select.js +57 -0
- package/dist/components/Select/Select.js.map +1 -0
- package/dist/components/Select/select.module.css +43 -0
- package/dist/components/Select/select.module.css.js +12 -0
- package/dist/components/Select/select.module.css.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.js +37 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/Skeleton/skeleton.module.css +26 -0
- package/dist/components/Skeleton/skeleton.module.css.js +9 -0
- package/dist/components/Skeleton/skeleton.module.css.js.map +1 -0
- package/dist/components/Spacer/Spacer.js +16 -0
- package/dist/components/Spacer/Spacer.js.map +1 -0
- package/dist/components/Spinner/Spinner.js +41 -0
- package/dist/components/Spinner/Spinner.js.map +1 -0
- package/dist/components/Spinner/spinner.module.css +21 -0
- package/dist/components/Spinner/spinner.module.css.js +9 -0
- package/dist/components/Spinner/spinner.module.css.js.map +1 -0
- package/dist/components/Stack/Stack.js +35 -0
- package/dist/components/Stack/Stack.js.map +1 -0
- package/dist/components/Switch/Switch.js +83 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/Switch/switch.module.css +48 -0
- package/dist/components/Switch/switch.module.css.js +15 -0
- package/dist/components/Switch/switch.module.css.js.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +87 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tabs/tabs.module.css +55 -0
- package/dist/components/Tabs/tabs.module.css.js +27 -0
- package/dist/components/Tabs/tabs.module.css.js.map +1 -0
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/Text/Text.js +40 -0
- package/dist/components/Text/Text.js.map +1 -0
- package/dist/components/Text/text.module.css +9 -0
- package/dist/components/Text/text.module.css.js +12 -0
- package/dist/components/Text/text.module.css.js.map +1 -0
- package/dist/components/Textarea/Textarea.js +70 -0
- package/dist/components/Textarea/Textarea.js.map +1 -0
- package/dist/components/Textarea/textarea.module.css +46 -0
- package/dist/components/Textarea/textarea.module.css.js +24 -0
- package/dist/components/Textarea/textarea.module.css.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +135 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/Tooltip/tooltip.module.css +4 -0
- package/dist/components/Tooltip/tooltip.module.css.js +9 -0
- package/dist/components/Tooltip/tooltip.module.css.js.map +1 -0
- package/dist/components/VStack/VStack.js +17 -0
- package/dist/components/VStack/VStack.js.map +1 -0
- package/dist/fonts.css +23 -1
- package/dist/index.css +3320 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +99 -5521
- package/dist/index.js.map +1 -1
- package/dist/styles/styles.css +353 -0
- package/package.json +8 -4
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { Box } from "../Box/Box.js";
|
|
5
|
+
import styles from "./card.module.css.js";
|
|
6
|
+
function Card({
|
|
7
|
+
shadow = "sm",
|
|
8
|
+
className,
|
|
9
|
+
children
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
Box,
|
|
13
|
+
{
|
|
14
|
+
bg: "surface",
|
|
15
|
+
border: "thin",
|
|
16
|
+
borderColor: "border",
|
|
17
|
+
rounded: "md",
|
|
18
|
+
overflow: "hidden",
|
|
19
|
+
shadow,
|
|
20
|
+
className: clsx(styles.card, className),
|
|
21
|
+
children
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function CardHeader({ className, children }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
Box,
|
|
28
|
+
{
|
|
29
|
+
px: 4,
|
|
30
|
+
py: 3,
|
|
31
|
+
borderBottom: "thin",
|
|
32
|
+
borderColor: "border",
|
|
33
|
+
className: clsx(styles.cardHeader, className),
|
|
34
|
+
children
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function CardBody({ className, children }) {
|
|
39
|
+
return /* @__PURE__ */ jsx(Box, { p: 4, className: clsx(styles.cardBody, className), children });
|
|
40
|
+
}
|
|
41
|
+
function CardFooter({ className, children }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
Box,
|
|
44
|
+
{
|
|
45
|
+
px: 4,
|
|
46
|
+
py: 3,
|
|
47
|
+
borderTop: "thin",
|
|
48
|
+
borderColor: "border",
|
|
49
|
+
className: clsx(styles.cardFooter, className),
|
|
50
|
+
children
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
Card,
|
|
56
|
+
CardBody,
|
|
57
|
+
CardFooter,
|
|
58
|
+
CardHeader
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import { type ReactNode } from \"react\";\nimport clsx from \"clsx\";\nimport { Box } from \"@/components/Box/Box\";\nimport type { ShadowValue } from \"@/components/Box/shadows/shadows\";\nimport styles from \"./card.module.css\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type CardProps = {\n /** Shadow level */\n shadow?: ShadowValue;\n /** Additional class name */\n className?: string;\n /** Card content */\n children?: ReactNode;\n};\n\nexport type CardHeaderProps = {\n /** Additional class name */\n className?: string;\n /** Header content */\n children?: ReactNode;\n};\n\nexport type CardBodyProps = {\n /** Additional class name */\n className?: string;\n /** Body content */\n children?: ReactNode;\n};\n\nexport type CardFooterProps = {\n /** Additional class name */\n className?: string;\n /** Footer content */\n children?: ReactNode;\n};\n\n// ============================================================================\n// Components\n// ============================================================================\n\n/**\n * Card - Content container\n *\n * A flexible content container with:\n * - Surface background with border\n * - Optional shadow elevation\n * - Composable Header/Body/Footer sections\n */\nexport function Card({\n shadow = \"sm\",\n className,\n children,\n}: CardProps) {\n return (\n <Box\n bg=\"surface\"\n border=\"thin\"\n borderColor=\"border\"\n rounded=\"md\"\n overflow=\"hidden\"\n shadow={shadow}\n className={clsx(styles.card, className)}\n >\n {children}\n </Box>\n );\n}\n\n/**\n * CardHeader - Optional header section\n *\n * Use inside Card for header content with bottom border.\n */\nexport function CardHeader({ className, children }: CardHeaderProps) {\n return (\n <Box\n px={4}\n py={3}\n borderBottom=\"thin\"\n borderColor=\"border\"\n className={clsx(styles.cardHeader, className)}\n >\n {children}\n </Box>\n );\n}\n\n/**\n * CardBody - Main content section\n *\n * Use inside Card for main content with padding.\n */\nexport function CardBody({ className, children }: CardBodyProps) {\n return (\n <Box p={4} className={clsx(styles.cardBody, className)}>\n {children}\n </Box>\n );\n}\n\n/**\n * CardFooter - Optional footer section\n *\n * Use inside Card for footer content with top border.\n */\nexport function CardFooter({ className, children }: CardFooterProps) {\n return (\n <Box\n px={4}\n py={3}\n borderTop=\"thin\"\n borderColor=\"border\"\n className={clsx(styles.cardFooter, className)}\n >\n {children}\n </Box>\n );\n}\n"],"names":[],"mappings":";;;;;AAoDO,SAAS,KAAK;AAAA,EACnB,SAAS;AAAA,EACT;AAAA,EACA;AACF,GAAc;AACZ,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,SAAQ;AAAA,MACR,UAAS;AAAA,MACT;AAAA,MACA,WAAW,KAAK,OAAO,MAAM,SAAS;AAAA,MAErC;AAAA,IAAA;AAAA,EAAA;AAGP;AAOO,SAAS,WAAW,EAAE,WAAW,YAA6B;AACnE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,cAAa;AAAA,MACb,aAAY;AAAA,MACZ,WAAW,KAAK,OAAO,YAAY,SAAS;AAAA,MAE3C;AAAA,IAAA;AAAA,EAAA;AAGP;AAOO,SAAS,SAAS,EAAE,WAAW,YAA2B;AAC/D,SACE,oBAAC,KAAA,EAAI,GAAG,GAAG,WAAW,KAAK,OAAO,UAAU,SAAS,GAClD,SAAA,CACH;AAEJ;AAOO,SAAS,WAAW,EAAE,WAAW,YAA6B;AACnE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,WAAU;AAAA,MACV,aAAY;AAAA,MACZ,WAAW,KAAK,OAAO,YAAY,SAAS;AAAA,MAE3C;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const card = "_card_id7v0_1";
|
|
2
|
+
const cardHeader = "_cardHeader_id7v0_6";
|
|
3
|
+
const cardBody = "_cardBody_id7v0_10";
|
|
4
|
+
const cardFooter = "_cardFooter_id7v0_14";
|
|
5
|
+
const styles = {
|
|
6
|
+
card,
|
|
7
|
+
cardHeader,
|
|
8
|
+
cardBody,
|
|
9
|
+
cardFooter
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
card,
|
|
13
|
+
cardBody,
|
|
14
|
+
cardFooter,
|
|
15
|
+
cardHeader,
|
|
16
|
+
styles as default
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=card.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { Box } from "../Box/Box.js";
|
|
5
|
+
import styles from "./checkbox.module.css.js";
|
|
6
|
+
const sizeConfig = {
|
|
7
|
+
sm: { box: 16, fontSize: "sm" },
|
|
8
|
+
md: { box: 20, fontSize: "md" },
|
|
9
|
+
lg: { box: 24, fontSize: "lg" }
|
|
10
|
+
};
|
|
11
|
+
const Checkbox = forwardRef(
|
|
12
|
+
function Checkbox2({
|
|
13
|
+
size = "md",
|
|
14
|
+
disabled = false,
|
|
15
|
+
isInvalid = false,
|
|
16
|
+
isChecked,
|
|
17
|
+
label,
|
|
18
|
+
className,
|
|
19
|
+
style,
|
|
20
|
+
...rest
|
|
21
|
+
}, ref) {
|
|
22
|
+
const sizeProps = sizeConfig[size];
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
24
|
+
Box,
|
|
25
|
+
{
|
|
26
|
+
as: "label",
|
|
27
|
+
display: "inline-flex",
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
gap: 2,
|
|
30
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
31
|
+
opacity: disabled ? "faint" : void 0,
|
|
32
|
+
className: clsx(styles.wrapper, className),
|
|
33
|
+
style,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
"input",
|
|
37
|
+
{
|
|
38
|
+
type: "checkbox",
|
|
39
|
+
ref,
|
|
40
|
+
checked: isChecked,
|
|
41
|
+
disabled,
|
|
42
|
+
"aria-invalid": isInvalid || void 0,
|
|
43
|
+
className: styles.input,
|
|
44
|
+
...rest
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
Box,
|
|
49
|
+
{
|
|
50
|
+
as: "span",
|
|
51
|
+
display: "inline-flex",
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
justifyContent: "center",
|
|
54
|
+
rounded: "sm",
|
|
55
|
+
border: "thin",
|
|
56
|
+
borderColor: isInvalid ? "error" : "border",
|
|
57
|
+
flexShrink: 0,
|
|
58
|
+
className: clsx(styles.box, isInvalid && styles.invalid),
|
|
59
|
+
style: {
|
|
60
|
+
width: sizeProps.box,
|
|
61
|
+
height: sizeProps.box
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
label && /* @__PURE__ */ jsx(Box, { as: "span", fontSize: sizeProps.fontSize, color: "foreground", children: label })
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
export {
|
|
72
|
+
Checkbox
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { type InputHTMLAttributes, forwardRef } from \"react\";\nimport clsx from \"clsx\";\nimport { Box } from \"@/components/Box/Box\";\nimport styles from \"./checkbox.module.css\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type CheckboxSize = \"sm\" | \"md\" | \"lg\";\n\nexport type CheckboxProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"size\" | \"type\"\n> & {\n /** Checkbox size affecting box dimensions */\n size?: CheckboxSize;\n /** Whether the checkbox is disabled */\n disabled?: boolean;\n /** Whether the checkbox is in an invalid state */\n isInvalid?: boolean;\n /** Controlled checked state */\n isChecked?: boolean;\n /** Optional label text displayed to the right */\n label?: string;\n};\n\n// ============================================================================\n// Size configurations\n// ============================================================================\n\nconst sizeConfig = {\n sm: { box: 16, fontSize: \"sm\" },\n md: { box: 20, fontSize: \"md\" },\n lg: { box: 24, fontSize: \"lg\" },\n} as const;\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * Checkbox - Toggle checkbox component\n *\n * A styled checkbox component that provides:\n * - Sizes: sm, md (default), lg\n * - Custom styled box with checkmark\n * - Optional inline label\n * - Disabled and invalid states\n * - Focus ring styling\n */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n function Checkbox(\n {\n size = \"md\",\n disabled = false,\n isInvalid = false,\n isChecked,\n label,\n className,\n style,\n ...rest\n },\n ref\n ) {\n const sizeProps = sizeConfig[size];\n\n return (\n <Box\n as=\"label\"\n display=\"inline-flex\"\n alignItems=\"center\"\n gap={2}\n cursor={disabled ? \"not-allowed\" : \"pointer\"}\n opacity={disabled ? \"faint\" : undefined}\n className={clsx(styles.wrapper, className)}\n style={style}\n >\n {/* Hidden native checkbox */}\n <input\n type=\"checkbox\"\n ref={ref}\n checked={isChecked}\n disabled={disabled}\n aria-invalid={isInvalid || undefined}\n className={styles.input}\n {...rest}\n />\n\n {/* Custom visual checkbox */}\n <Box\n as=\"span\"\n display=\"inline-flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n rounded=\"sm\"\n border=\"thin\"\n borderColor={isInvalid ? \"error\" : \"border\"}\n flexShrink={0}\n className={clsx(styles.box, isInvalid && styles.invalid)}\n style={{\n width: sizeProps.box,\n height: sizeProps.box,\n }}\n />\n\n {/* Optional label */}\n {label && (\n <Box as=\"span\" fontSize={sizeProps.fontSize} color=\"foreground\">\n {label}\n </Box>\n )}\n </Box>\n );\n }\n);\n"],"names":["Checkbox"],"mappings":";;;;;AA+BA,MAAM,aAAa;AAAA,EACjB,IAAI,EAAE,KAAK,IAAI,UAAU,KAAA;AAAA,EACzB,IAAI,EAAE,KAAK,IAAI,UAAU,KAAA;AAAA,EACzB,IAAI,EAAE,KAAK,IAAI,UAAU,KAAA;AAC3B;AAgBO,MAAM,WAAW;AAAA,EACtB,SAASA,UACP;AAAA,IACE,OAAO;AAAA,IACP,WAAW;AAAA,IACX,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,KACA;AACA,UAAM,YAAY,WAAW,IAAI;AAEjC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,SAAQ;AAAA,QACR,YAAW;AAAA,QACX,KAAK;AAAA,QACL,QAAQ,WAAW,gBAAgB;AAAA,QACnC,SAAS,WAAW,UAAU;AAAA,QAC9B,WAAW,KAAK,OAAO,SAAS,SAAS;AAAA,QACzC;AAAA,QAGA,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL;AAAA,cACA,SAAS;AAAA,cACT;AAAA,cACA,gBAAc,aAAa;AAAA,cAC3B,WAAW,OAAO;AAAA,cACjB,GAAG;AAAA,YAAA;AAAA,UAAA;AAAA,UAIN;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAG;AAAA,cACH,SAAQ;AAAA,cACR,YAAW;AAAA,cACX,gBAAe;AAAA,cACf,SAAQ;AAAA,cACR,QAAO;AAAA,cACP,aAAa,YAAY,UAAU;AAAA,cACnC,YAAY;AAAA,cACZ,WAAW,KAAK,OAAO,KAAK,aAAa,OAAO,OAAO;AAAA,cACvD,OAAO;AAAA,gBACL,OAAO,UAAU;AAAA,gBACjB,QAAQ,UAAU;AAAA,cAAA;AAAA,YACpB;AAAA,UAAA;AAAA,UAID,SACC,oBAAC,KAAA,EAAI,IAAG,QAAO,UAAU,UAAU,UAAU,OAAM,cAChD,UAAA,MAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* Hidden native checkbox */
|
|
2
|
+
._input_1hfvy_2 {
|
|
3
|
+
position: absolute;
|
|
4
|
+
opacity: 0;
|
|
5
|
+
width: 0;
|
|
6
|
+
height: 0;
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Custom checkbox box */
|
|
12
|
+
._box_1hfvy_12 {
|
|
13
|
+
transition-duration: 150ms;
|
|
14
|
+
transition-property: border-color, background-color, box-shadow;
|
|
15
|
+
transition-timing-function: ease-in-out;
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Checkmark icon (hidden by default) */
|
|
20
|
+
._box_1hfvy_12::before {
|
|
21
|
+
content: "";
|
|
22
|
+
position: absolute;
|
|
23
|
+
display: none;
|
|
24
|
+
width: 40%;
|
|
25
|
+
height: 60%;
|
|
26
|
+
border: solid white;
|
|
27
|
+
border-width: 0 2px 2px 0;
|
|
28
|
+
transform: rotate(45deg) translate(-10%, -10%);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Focus ring when input is focused */
|
|
32
|
+
._input_1hfvy_2:focus-visible ~ ._box_1hfvy_12 {
|
|
33
|
+
border-color: var(--t-color-primary-default);
|
|
34
|
+
box-shadow: 0 0 0 3px var(--t-color-primary-subtle);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Checked state */
|
|
38
|
+
._input_1hfvy_2:checked ~ ._box_1hfvy_12 {
|
|
39
|
+
background-color: var(--t-color-primary-default);
|
|
40
|
+
border-color: var(--t-color-primary-default);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
._input_1hfvy_2:checked ~ ._box_1hfvy_12::before {
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Invalid state */
|
|
48
|
+
._box_1hfvy_12._invalid_1hfvy_48 {
|
|
49
|
+
border-color: var(--t-color-error-default);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
._input_1hfvy_2:focus-visible ~ ._box_1hfvy_12._invalid_1hfvy_48 {
|
|
53
|
+
border-color: var(--t-color-error-default);
|
|
54
|
+
box-shadow: 0 0 0 3px var(--t-color-error-subtle);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
._input_1hfvy_2:checked ~ ._box_1hfvy_12._invalid_1hfvy_48 {
|
|
58
|
+
background-color: var(--t-color-error-default);
|
|
59
|
+
border-color: var(--t-color-error-default);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Disabled state (handled via opacity on wrapper) */
|
|
63
|
+
._input_1hfvy_2:disabled ~ ._box_1hfvy_12 {
|
|
64
|
+
cursor: not-allowed;
|
|
65
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const input = "_input_1hfvy_2";
|
|
2
|
+
const box = "_box_1hfvy_12";
|
|
3
|
+
const invalid = "_invalid_1hfvy_48";
|
|
4
|
+
const styles = {
|
|
5
|
+
input,
|
|
6
|
+
box,
|
|
7
|
+
invalid
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
box,
|
|
11
|
+
styles as default,
|
|
12
|
+
input,
|
|
13
|
+
invalid
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=checkbox.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Box } from "../Box/Box.js";
|
|
4
|
+
function Code({
|
|
5
|
+
as,
|
|
6
|
+
size,
|
|
7
|
+
color,
|
|
8
|
+
variant = "plain",
|
|
9
|
+
...rest
|
|
10
|
+
}) {
|
|
11
|
+
const isSubtle = variant === "subtle";
|
|
12
|
+
return (
|
|
13
|
+
// @ts-expect-error - Polymorphic component prop forwarding
|
|
14
|
+
/* @__PURE__ */ jsx(
|
|
15
|
+
Box,
|
|
16
|
+
{
|
|
17
|
+
as: as || "code",
|
|
18
|
+
fontSize: size,
|
|
19
|
+
fontFamily: "mono",
|
|
20
|
+
color,
|
|
21
|
+
bg: isSubtle ? "surface" : void 0,
|
|
22
|
+
rounded: isSubtle ? "sm" : void 0,
|
|
23
|
+
px: isSubtle ? 1 : void 0,
|
|
24
|
+
...rest
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
Code
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=Code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.js","sources":["../../../src/components/Code/Code.tsx"],"sourcesContent":["import { type ElementType } from \"react\";\nimport { Box, type BoxOwnProps } from \"../Box/Box\";\nimport { type Polymorphic } from \"@/types/Polymorphic\";\n\ntype FontSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\" | \"4xl\" | \"5xl\";\ntype Color =\n | \"foreground\"\n | \"foreground-muted\"\n | \"foreground-subtle\"\n | \"foreground-inverted\"\n | \"foreground-inverted-muted\"\n | \"foreground-inverted-subtle\"\n | \"accent\"\n | \"accent-emphasis\"\n | \"primary\"\n | \"primary-emphasis\"\n | \"success\"\n | \"success-emphasis\"\n | \"warning\"\n | \"warning-emphasis\"\n | \"error\"\n | \"error-emphasis\"\n | \"info\"\n | \"info-emphasis\";\n\nexport type CodeVariant = \"plain\" | \"subtle\";\n\nexport type CodeOwnProps = Omit<\n BoxOwnProps,\n \"fontSize\" | \"fontFamily\" | \"color\" | \"bg\" | \"rounded\" | \"px\"\n> & {\n /** Font size */\n size?: FontSize;\n /** Text color */\n color?: Color;\n /** Visual variant: plain (no background) or subtle (surface background) */\n variant?: CodeVariant;\n};\n\nexport type CodeProps<T extends ElementType = \"code\"> = Polymorphic<\n T,\n CodeOwnProps\n>;\n\n/**\n * Code - Inline code styling component\n *\n * Built on top of Box with code-specific conveniences:\n * - Default element: <code>\n * - Always uses monospace font family\n * - Variants: plain (no background) or subtle (surface background with rounded corners)\n * - Can be changed to any element via `as` prop\n */\nexport function Code<T extends ElementType = \"code\">({\n as,\n size,\n color,\n variant = \"plain\",\n ...rest\n}: CodeProps<T>) {\n const isSubtle = variant === \"subtle\";\n\n return (\n // @ts-expect-error - Polymorphic component prop forwarding\n <Box\n as={as || \"code\"}\n fontSize={size}\n fontFamily=\"mono\"\n color={color}\n bg={isSubtle ? \"surface\" : undefined}\n rounded={isSubtle ? \"sm\" : undefined}\n px={isSubtle ? 1 : undefined}\n {...rest}\n />\n );\n}\n"],"names":[],"mappings":";;;AAqDO,SAAS,KAAqC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,GAAG;AACL,GAAiB;AACf,QAAM,WAAW,YAAY;AAE7B;AAAA;AAAA,IAEE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,MAAM;AAAA,QACV,UAAU;AAAA,QACV,YAAW;AAAA,QACX;AAAA,QACA,IAAI,WAAW,YAAY;AAAA,QAC3B,SAAS,WAAW,OAAO;AAAA,QAC3B,IAAI,WAAW,IAAI;AAAA,QAClB,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA;AAGV;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Box } from "../Box/Box.js";
|
|
4
|
+
const SIZE_MAP = {
|
|
5
|
+
sm: "640px",
|
|
6
|
+
md: "768px",
|
|
7
|
+
lg: "1024px",
|
|
8
|
+
xl: "1280px",
|
|
9
|
+
"2xl": "1536px",
|
|
10
|
+
full: "100%"
|
|
11
|
+
};
|
|
12
|
+
function Container({
|
|
13
|
+
as,
|
|
14
|
+
size = "lg",
|
|
15
|
+
centerContent = false,
|
|
16
|
+
px = 4,
|
|
17
|
+
children,
|
|
18
|
+
...rest
|
|
19
|
+
}) {
|
|
20
|
+
return (
|
|
21
|
+
// @ts-expect-error - Polymorphic component type forwarding
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
Box,
|
|
24
|
+
{
|
|
25
|
+
as: as || "div",
|
|
26
|
+
w: "100%",
|
|
27
|
+
maxW: SIZE_MAP[size],
|
|
28
|
+
mx: "auto",
|
|
29
|
+
px,
|
|
30
|
+
...centerContent && {
|
|
31
|
+
display: "flex",
|
|
32
|
+
flexDirection: "column",
|
|
33
|
+
alignItems: "center"
|
|
34
|
+
},
|
|
35
|
+
...rest,
|
|
36
|
+
children
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
Container
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=Container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.js","sources":["../../../src/components/Container/Container.tsx"],"sourcesContent":["import { type ElementType } from \"react\";\nimport { type Polymorphic } from \"@/types/Polymorphic\";\nimport { Box, type BoxOwnProps } from \"@/components/Box/Box\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/** Container size preset */\nexport type ContainerSize = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"full\";\n\nexport type ContainerOwnProps = Omit<BoxOwnProps, \"maxW\" | \"mx\"> & {\n /** Max-width preset: sm=640px, md=768px, lg=1024px, xl=1280px, 2xl=1536px, full=100% (default: lg) */\n size?: ContainerSize;\n /** Center children using flexbox (default: false) */\n centerContent?: boolean;\n /** Horizontal padding (default: 4 = 16px) */\n px?: BoxOwnProps[\"px\"];\n};\n\nexport type ContainerProps<T extends ElementType = \"div\"> = Polymorphic<\n T,\n ContainerOwnProps\n>;\n\n// ============================================================================\n// Config\n// ============================================================================\n\nconst SIZE_MAP: Record<ContainerSize, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\",\n full: \"100%\",\n};\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * Container - Max-width centered content wrapper\n *\n * A polymorphic container for constraining content width:\n * - Default element: <div>\n * - Size presets: sm (640px), md (768px), lg (1024px), xl (1280px), 2xl (1536px), full (100%)\n * - Default: lg (1024px max-width)\n * - Centered horizontally with mx=\"auto\"\n * - Optional centerContent to center children vertically with flex\n */\nexport function Container<T extends ElementType = \"div\">({\n as,\n size = \"lg\",\n centerContent = false,\n px = 4,\n children,\n ...rest\n}: ContainerProps<T>) {\n return (\n // @ts-expect-error - Polymorphic component type forwarding\n <Box\n as={as || \"div\"}\n w=\"100%\"\n maxW={SIZE_MAP[size]}\n mx=\"auto\"\n px={px}\n {...(centerContent && {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n })}\n {...rest}\n >\n {children}\n </Box>\n );\n}\n"],"names":[],"mappings":";;;AA6BA,MAAM,WAA0C;AAAA,EAC9C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AACR;AAgBO,SAAS,UAAyC;AAAA,EACvD;AAAA,EACA,OAAO;AAAA,EACP,gBAAgB;AAAA,EAChB,KAAK;AAAA,EACL;AAAA,EACA,GAAG;AACL,GAAsB;AACpB;AAAA;AAAA,IAEE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,MAAM;AAAA,QACV,GAAE;AAAA,QACF,MAAM,SAAS,IAAI;AAAA,QACnB,IAAG;AAAA,QACH;AAAA,QACC,GAAI,iBAAiB;AAAA,UACpB,SAAS;AAAA,UACT,eAAe;AAAA,UACf,YAAY;AAAA,QAAA;AAAA,QAEb,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA;AAGP;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Box } from "../Box/Box.js";
|
|
4
|
+
const COLOR_MAP = {
|
|
5
|
+
border: "var(--t-color-border)",
|
|
6
|
+
"border-muted": "var(--t-color-border-muted)",
|
|
7
|
+
primary: "var(--t-color-primary-default)",
|
|
8
|
+
accent: "var(--t-color-accent-default)",
|
|
9
|
+
success: "var(--t-color-success-default)",
|
|
10
|
+
warning: "var(--t-color-warning-default)",
|
|
11
|
+
error: "var(--t-color-error-default)",
|
|
12
|
+
info: "var(--t-color-info-default)"
|
|
13
|
+
};
|
|
14
|
+
function Divider({
|
|
15
|
+
as,
|
|
16
|
+
orientation = "horizontal",
|
|
17
|
+
color = "border-muted",
|
|
18
|
+
thickness = 1,
|
|
19
|
+
style,
|
|
20
|
+
...rest
|
|
21
|
+
}) {
|
|
22
|
+
const isHorizontal = orientation === "horizontal";
|
|
23
|
+
const defaultElement = isHorizontal ? "hr" : "div";
|
|
24
|
+
return (
|
|
25
|
+
// @ts-expect-error - Polymorphic component type forwarding
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
Box,
|
|
28
|
+
{
|
|
29
|
+
as: as || defaultElement,
|
|
30
|
+
role: "separator",
|
|
31
|
+
"aria-orientation": orientation,
|
|
32
|
+
w: isHorizontal ? "100%" : void 0,
|
|
33
|
+
h: isHorizontal ? void 0 : "100%",
|
|
34
|
+
style: {
|
|
35
|
+
backgroundColor: COLOR_MAP[color],
|
|
36
|
+
...isHorizontal ? { height: `${thickness}px` } : { width: `${thickness}px` },
|
|
37
|
+
border: "none",
|
|
38
|
+
...style
|
|
39
|
+
},
|
|
40
|
+
...rest
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
Divider
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=Divider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.js","sources":["../../../src/components/Divider/Divider.tsx"],"sourcesContent":["import { type ElementType } from \"react\";\nimport { type Polymorphic } from \"@/types/Polymorphic\";\nimport { Box, type BoxOwnProps } from \"@/components/Box/Box\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/** Divider color using semantic border color tokens */\nexport type DividerColor =\n | \"border\"\n | \"border-muted\"\n | \"primary\"\n | \"accent\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\n\nexport type DividerOwnProps = Omit<BoxOwnProps, \"w\" | \"h\" | \"bg\" | \"color\"> & {\n /** Divider orientation (default: \"horizontal\") */\n orientation?: \"horizontal\" | \"vertical\";\n /** Divider color token (default: \"border-muted\") */\n color?: DividerColor;\n /** Divider thickness in pixels 1-4 (default: 1) */\n thickness?: 1 | 2 | 3 | 4;\n};\n\nexport type DividerProps<T extends ElementType = \"hr\"> = Polymorphic<\n T,\n DividerOwnProps\n>;\n\n// ============================================================================\n// Config\n// ============================================================================\n\nconst COLOR_MAP: Record<DividerColor, string> = {\n border: \"var(--t-color-border)\",\n \"border-muted\": \"var(--t-color-border-muted)\",\n primary: \"var(--t-color-primary-default)\",\n accent: \"var(--t-color-accent-default)\",\n success: \"var(--t-color-success-default)\",\n warning: \"var(--t-color-warning-default)\",\n error: \"var(--t-color-error-default)\",\n info: \"var(--t-color-info-default)\",\n};\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * Divider - Visual separator between content sections\n *\n * A polymorphic divider component that provides:\n * - Default element: <hr> for horizontal, <div> for vertical\n * - Orientations: horizontal (default), vertical\n * - Customizable color and thickness\n * - Proper accessibility attributes (role=\"separator\", aria-orientation)\n */\nexport function Divider<T extends ElementType = \"hr\">({\n as,\n orientation = \"horizontal\",\n color = \"border-muted\",\n thickness = 1,\n style,\n ...rest\n}: DividerProps<T>) {\n const isHorizontal = orientation === \"horizontal\";\n const defaultElement = isHorizontal ? \"hr\" : \"div\";\n\n return (\n // @ts-expect-error - Polymorphic component type forwarding\n <Box\n as={as || defaultElement}\n role=\"separator\"\n aria-orientation={orientation}\n w={isHorizontal ? \"100%\" : undefined}\n h={isHorizontal ? undefined : \"100%\"}\n style={{\n backgroundColor: COLOR_MAP[color],\n ...(isHorizontal\n ? { height: `${thickness}px` }\n : { width: `${thickness}px` }),\n border: \"none\",\n ...style,\n }}\n {...rest}\n />\n );\n}\n"],"names":[],"mappings":";;;AAqCA,MAAM,YAA0C;AAAA,EAC9C,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AACR;AAeO,SAAS,QAAsC;AAAA,EACpD;AAAA,EACA,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,QAAM,eAAe,gBAAgB;AACrC,QAAM,iBAAiB,eAAe,OAAO;AAE7C;AAAA;AAAA,IAEE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,MAAM;AAAA,QACV,MAAK;AAAA,QACL,oBAAkB;AAAA,QAClB,GAAG,eAAe,SAAS;AAAA,QAC3B,GAAG,eAAe,SAAY;AAAA,QAC9B,OAAO;AAAA,UACL,iBAAiB,UAAU,KAAK;AAAA,UAChC,GAAI,eACA,EAAE,QAAQ,GAAG,SAAS,KAAA,IACtB,EAAE,OAAO,GAAG,SAAS,KAAA;AAAA,UACzB,QAAQ;AAAA,UACR,GAAG;AAAA,QAAA;AAAA,QAEJ,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA;AAGV;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Box } from "../Box/Box.js";
|
|
4
|
+
function Flex({
|
|
5
|
+
as,
|
|
6
|
+
direction,
|
|
7
|
+
wrap,
|
|
8
|
+
justify,
|
|
9
|
+
align,
|
|
10
|
+
alignContent,
|
|
11
|
+
gap,
|
|
12
|
+
gapRow,
|
|
13
|
+
gapColumn,
|
|
14
|
+
basis,
|
|
15
|
+
grow,
|
|
16
|
+
shrink,
|
|
17
|
+
alignSelf,
|
|
18
|
+
children,
|
|
19
|
+
...rest
|
|
20
|
+
}) {
|
|
21
|
+
return (
|
|
22
|
+
// @ts-expect-error - Polymorphic component type forwarding
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
Box,
|
|
25
|
+
{
|
|
26
|
+
as: as || "div",
|
|
27
|
+
display: "flex",
|
|
28
|
+
flexDirection: direction,
|
|
29
|
+
flexWrap: wrap,
|
|
30
|
+
justifyContent: justify,
|
|
31
|
+
alignItems: align,
|
|
32
|
+
gap,
|
|
33
|
+
gapRow,
|
|
34
|
+
gapColumn,
|
|
35
|
+
flexBasis: basis,
|
|
36
|
+
flexGrow: grow,
|
|
37
|
+
flexShrink: shrink,
|
|
38
|
+
alignSelf,
|
|
39
|
+
...rest,
|
|
40
|
+
children
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
Flex
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=Flex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flex.js","sources":["../../../src/components/Flex/Flex.tsx"],"sourcesContent":["import { type ElementType } from \"react\";\nimport { type Polymorphic } from \"@/types/Polymorphic\";\nimport { Box, type BoxOwnProps } from \"@/components/Box/Box\";\nimport type {\n FlexDirectionValue,\n JustifyContentValue,\n AlignItemsValue,\n AlignSelfValue,\n FlexWrapValue,\n SpacingValue,\n} from \"@/components/Box/flexbox/flexbox\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type FlexOwnProps = Omit<\n BoxOwnProps,\n | \"display\"\n | \"flexDirection\"\n | \"justifyContent\"\n | \"alignItems\"\n | \"alignSelf\"\n | \"flexWrap\"\n | \"gap\"\n | \"gapRow\"\n | \"gapColumn\"\n | \"flexBasis\"\n | \"flexGrow\"\n | \"flexShrink\"\n> & {\n /** Flex direction: row (default), column, row-reverse, column-reverse */\n direction?: FlexDirectionValue;\n /** Flex wrapping: nowrap (default), wrap, wrap-reverse */\n wrap?: FlexWrapValue;\n /** Justify content along the main axis */\n justify?: JustifyContentValue;\n /** Align items along the cross axis */\n align?: AlignItemsValue;\n /** Align content when there are multiple lines */\n alignContent?: JustifyContentValue;\n /** Gap between children (0-32 spacing multiplier or string) */\n gap?: SpacingValue;\n /** Row gap between children (0-32 spacing multiplier or string) */\n gapRow?: SpacingValue;\n /** Column gap between children (0-32 spacing multiplier or string) */\n gapColumn?: SpacingValue;\n /** Flex basis of the container */\n basis?: string;\n /** Flex grow of the container */\n grow?: number;\n /** Flex shrink of the container */\n shrink?: number;\n /** Align self within parent flex container */\n alignSelf?: AlignSelfValue;\n};\n\nexport type FlexProps<T extends ElementType = \"div\"> = Polymorphic<\n T,\n FlexOwnProps\n>;\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * Flex - Explicit flexbox layout component\n *\n * A polymorphic flex container with shorthand props:\n * - Default element: <div>\n * - Always renders with display=\"flex\"\n * - direction -> flexDirection (default: row)\n * - wrap -> flexWrap\n * - justify -> justifyContent\n * - align -> alignItems\n * - gap, gapRow, gapColumn\n * - basis, grow, shrink -> flexBasis, flexGrow, flexShrink\n */\nexport function Flex<T extends ElementType = \"div\">({\n as,\n direction,\n wrap,\n justify,\n align,\n alignContent,\n gap,\n gapRow,\n gapColumn,\n basis,\n grow,\n shrink,\n alignSelf,\n children,\n ...rest\n}: FlexProps<T>) {\n return (\n // @ts-expect-error - Polymorphic component type forwarding\n <Box\n as={as || \"div\"}\n display=\"flex\"\n flexDirection={direction}\n flexWrap={wrap}\n justifyContent={justify}\n alignItems={align}\n gap={gap}\n gapRow={gapRow}\n gapColumn={gapColumn}\n flexBasis={basis}\n flexGrow={grow}\n flexShrink={shrink}\n alignSelf={alignSelf}\n {...rest}\n >\n {children}\n </Box>\n );\n}\n"],"names":[],"mappings":";;;AA+EO,SAAS,KAAoC;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAiB;AACf;AAAA;AAAA,IAEE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,MAAM;AAAA,QACV,SAAQ;AAAA,QACR,eAAe;AAAA,QACf,UAAU;AAAA,QACV,gBAAgB;AAAA,QAChB,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,QACX,UAAU;AAAA,QACV,YAAY;AAAA,QACZ;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA;AAGP;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useId, Children, isValidElement, cloneElement } from "react";
|
|
3
|
+
import { Box } from "../Box/Box.js";
|
|
4
|
+
import { Label } from "../Label/Label.js";
|
|
5
|
+
import { VStack } from "../VStack/VStack.js";
|
|
6
|
+
function FormField({
|
|
7
|
+
label,
|
|
8
|
+
helperText,
|
|
9
|
+
errorMessage,
|
|
10
|
+
isRequired = false,
|
|
11
|
+
isInvalid = false,
|
|
12
|
+
disabled = false,
|
|
13
|
+
id: providedId,
|
|
14
|
+
children
|
|
15
|
+
}) {
|
|
16
|
+
const generatedId = useId();
|
|
17
|
+
const fieldId = providedId || generatedId;
|
|
18
|
+
const helperId = `${fieldId}-helper`;
|
|
19
|
+
const showError = isInvalid && errorMessage;
|
|
20
|
+
const message = showError ? errorMessage : helperText;
|
|
21
|
+
const hasMessage = Boolean(message);
|
|
22
|
+
const enhancedChild = Children.map(children, (child) => {
|
|
23
|
+
if (!isValidElement(child)) {
|
|
24
|
+
return child;
|
|
25
|
+
}
|
|
26
|
+
return cloneElement(child, {
|
|
27
|
+
id: fieldId,
|
|
28
|
+
isInvalid,
|
|
29
|
+
disabled,
|
|
30
|
+
"aria-describedby": hasMessage ? helperId : void 0,
|
|
31
|
+
"aria-invalid": isInvalid || void 0
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: 1, align: "stretch", children: [
|
|
35
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: fieldId, required: isRequired, children: label }),
|
|
36
|
+
enhancedChild,
|
|
37
|
+
hasMessage && /* @__PURE__ */ jsx(
|
|
38
|
+
Box,
|
|
39
|
+
{
|
|
40
|
+
as: "span",
|
|
41
|
+
id: helperId,
|
|
42
|
+
fontSize: "sm",
|
|
43
|
+
color: showError ? "error" : "foreground-muted",
|
|
44
|
+
children: message
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
FormField
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=FormField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormField.js","sources":["../../../src/components/FormField/FormField.tsx"],"sourcesContent":["import { type ReactNode, useId, cloneElement, isValidElement, Children } from \"react\";\nimport { Box } from \"@/components/Box/Box\";\nimport { Label } from \"@/components/Label/Label\";\nimport { VStack } from \"@/components/VStack/VStack\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type FormFieldProps = {\n /** Label text displayed above the control */\n label: string;\n /** Helper text displayed below the control (hidden when isInvalid) */\n helperText?: string;\n /** Error message displayed when isInvalid (replaces helperText) */\n errorMessage?: string;\n /** Whether the field is required (shows asterisk) */\n isRequired?: boolean;\n /** Whether the field is in an invalid state */\n isInvalid?: boolean;\n /** Whether the field is disabled */\n disabled?: boolean;\n /** Custom ID for the field (auto-generated if not provided) */\n id?: string;\n /** The form control to render */\n children: ReactNode;\n};\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * FormField - Form field wrapper component\n *\n * A composition component that provides:\n * - Label with required indicator\n * - Helper text for descriptions\n * - Error message for validation\n * - State propagation to child controls (isInvalid, disabled)\n * - Accessible aria-describedby linking\n */\nexport function FormField({\n label,\n helperText,\n errorMessage,\n isRequired = false,\n isInvalid = false,\n disabled = false,\n id: providedId,\n children,\n}: FormFieldProps) {\n // Generate ID for accessibility linking\n const generatedId = useId();\n const fieldId = providedId || generatedId;\n const helperId = `${fieldId}-helper`;\n\n // Determine which message to show\n const showError = isInvalid && errorMessage;\n const message = showError ? errorMessage : helperText;\n const hasMessage = Boolean(message);\n\n // Clone child to pass props and aria attributes\n const enhancedChild = Children.map(children, (child) => {\n if (!isValidElement(child)) {\n return child;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return cloneElement(child as React.ReactElement<any>, {\n id: fieldId,\n isInvalid,\n disabled,\n \"aria-describedby\": hasMessage ? helperId : undefined,\n \"aria-invalid\": isInvalid || undefined,\n });\n });\n\n return (\n <VStack gap={1} align=\"stretch\">\n {/* Label */}\n <Label htmlFor={fieldId} required={isRequired}>\n {label}\n </Label>\n\n {/* Form control */}\n {enhancedChild}\n\n {/* Helper text or error message */}\n {hasMessage && (\n <Box\n as=\"span\"\n id={helperId}\n fontSize=\"sm\"\n color={showError ? \"error\" : \"foreground-muted\"}\n >\n {message}\n </Box>\n )}\n </VStack>\n );\n}\n"],"names":[],"mappings":";;;;;AA0CO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,IAAI;AAAA,EACJ;AACF,GAAmB;AAEjB,QAAM,cAAc,MAAA;AACpB,QAAM,UAAU,cAAc;AAC9B,QAAM,WAAW,GAAG,OAAO;AAG3B,QAAM,YAAY,aAAa;AAC/B,QAAM,UAAU,YAAY,eAAe;AAC3C,QAAM,aAAa,QAAQ,OAAO;AAGlC,QAAM,gBAAgB,SAAS,IAAI,UAAU,CAAC,UAAU;AACtD,QAAI,CAAC,eAAe,KAAK,GAAG;AAC1B,aAAO;AAAA,IACT;AAGA,WAAO,aAAa,OAAkC;AAAA,MACpD,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,MACA,oBAAoB,aAAa,WAAW;AAAA,MAC5C,gBAAgB,aAAa;AAAA,IAAA,CAC9B;AAAA,EACH,CAAC;AAED,SACE,qBAAC,QAAA,EAAO,KAAK,GAAG,OAAM,WAEpB,UAAA;AAAA,IAAA,oBAAC,OAAA,EAAM,SAAS,SAAS,UAAU,YAChC,UAAA,OACH;AAAA,IAGC;AAAA,IAGA,cACC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,IAAI;AAAA,QACJ,UAAS;AAAA,QACT,OAAO,YAAY,UAAU;AAAA,QAE5B,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Box } from "../Box/Box.js";
|
|
4
|
+
function Grid({
|
|
5
|
+
as,
|
|
6
|
+
columns,
|
|
7
|
+
rows,
|
|
8
|
+
gap,
|
|
9
|
+
gapRow,
|
|
10
|
+
gapColumn,
|
|
11
|
+
justify,
|
|
12
|
+
align,
|
|
13
|
+
justifyContent,
|
|
14
|
+
alignContent,
|
|
15
|
+
children,
|
|
16
|
+
...rest
|
|
17
|
+
}) {
|
|
18
|
+
return (
|
|
19
|
+
// @ts-expect-error - Polymorphic component type forwarding
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
Box,
|
|
22
|
+
{
|
|
23
|
+
as: as || "div",
|
|
24
|
+
display: "grid",
|
|
25
|
+
gridTemplateColumns: columns,
|
|
26
|
+
gridTemplateRows: rows,
|
|
27
|
+
gap,
|
|
28
|
+
gapRow,
|
|
29
|
+
gapColumn,
|
|
30
|
+
justifyContent: justify ?? justifyContent,
|
|
31
|
+
alignItems: align ?? alignContent,
|
|
32
|
+
...rest,
|
|
33
|
+
children
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
Grid
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=Grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grid.js","sources":["../../../src/components/Grid/Grid.tsx"],"sourcesContent":["import { type ElementType } from \"react\";\nimport { type Polymorphic } from \"@/types/Polymorphic\";\nimport { Box, type BoxOwnProps } from \"@/components/Box/Box\";\nimport type {\n JustifyContentValue,\n AlignItemsValue,\n SpacingValue,\n} from \"@/components/Box/flexbox/flexbox\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type GridOwnProps = Omit<\n BoxOwnProps,\n | \"display\"\n | \"gridTemplateColumns\"\n | \"gridTemplateRows\"\n | \"gap\"\n | \"gapRow\"\n | \"gapColumn\"\n | \"justifyContent\"\n | \"alignItems\"\n> & {\n /** Grid template columns (CSS value) */\n columns?: string;\n /** Grid template rows (CSS value) */\n rows?: string;\n /** Gap between grid items (0-32 spacing multiplier or string) */\n gap?: SpacingValue;\n /** Row gap between grid items (0-32 spacing multiplier or string) */\n gapRow?: SpacingValue;\n /** Column gap between grid items (0-32 spacing multiplier or string) */\n gapColumn?: SpacingValue;\n /** Justify items along the inline (row) axis */\n justify?: JustifyContentValue;\n /** Align items along the block (column) axis */\n align?: AlignItemsValue;\n /** Justify content (distribute rows) */\n justifyContent?: JustifyContentValue;\n /** Align content (distribute columns) */\n alignContent?: JustifyContentValue;\n};\n\nexport type GridProps<T extends ElementType = \"div\"> = Polymorphic<\n T,\n GridOwnProps\n>;\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * Grid - Explicit CSS Grid layout component\n *\n * A polymorphic grid container with shorthand props:\n * - Default element: <div>\n * - Always renders with display=\"grid\"\n * - columns -> gridTemplateColumns\n * - rows -> gridTemplateRows\n * - gap, gapRow, gapColumn\n * - justify -> justifyItems (alignment within cells)\n * - align -> alignItems (alignment within cells)\n * - justifyContent, alignContent (distribution of grid tracks)\n */\nexport function Grid<T extends ElementType = \"div\">({\n as,\n columns,\n rows,\n gap,\n gapRow,\n gapColumn,\n justify,\n align,\n justifyContent,\n alignContent,\n children,\n ...rest\n}: GridProps<T>) {\n return (\n // @ts-expect-error - Polymorphic component type forwarding\n <Box\n as={as || \"div\"}\n display=\"grid\"\n gridTemplateColumns={columns}\n gridTemplateRows={rows}\n gap={gap}\n gapRow={gapRow}\n gapColumn={gapColumn}\n justifyContent={justify ?? justifyContent}\n alignItems={align ?? alignContent}\n {...rest}\n >\n {children}\n </Box>\n );\n}\n"],"names":[],"mappings":";;;AAkEO,SAAS,KAAoC;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAiB;AACf;AAAA;AAAA,IAEE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,MAAM;AAAA,QACV,SAAQ;AAAA,QACR,qBAAqB;AAAA,QACrB,kBAAkB;AAAA,QAClB;AAAA,QACA;AAAA,QACA;AAAA,QACA,gBAAgB,WAAW;AAAA,QAC3B,YAAY,SAAS;AAAA,QACpB,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA;AAGP;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Stack } from "../Stack/Stack.js";
|
|
4
|
+
function HStack({
|
|
5
|
+
as,
|
|
6
|
+
children,
|
|
7
|
+
...rest
|
|
8
|
+
}) {
|
|
9
|
+
return (
|
|
10
|
+
// @ts-expect-error - Polymorphic component type forwarding
|
|
11
|
+
/* @__PURE__ */ jsx(Stack, { as: as || "div", direction: "row", ...rest, children })
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
HStack
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=HStack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HStack.js","sources":["../../../src/components/HStack/HStack.tsx"],"sourcesContent":["import { type ElementType } from \"react\";\nimport { type Polymorphic } from \"@/types/Polymorphic\";\nimport { Stack, type StackOwnProps } from \"@/components/Stack/Stack\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type HStackOwnProps = Omit<StackOwnProps, \"direction\">;\n\nexport type HStackProps<T extends ElementType = \"div\"> = Polymorphic<\n T,\n HStackOwnProps\n>;\n\n// ============================================================================\n// Component\n// ============================================================================\n\n/**\n * HStack - Horizontal stack component\n *\n * A convenience wrapper around Stack with direction=\"row\".\n * - Default element: <div>\n * - Direction: row (fixed)\n * - Gap: spacing multiplier (0-32)\n * - Align: cross-axis alignment\n * - Justify: main-axis alignment\n * - Wrap: enable flex wrapping\n */\nexport function HStack<T extends ElementType = \"div\">({\n as,\n children,\n ...rest\n}: HStackProps<T>) {\n return (\n // @ts-expect-error - Polymorphic component type forwarding\n <Stack as={as || \"div\"} direction=\"row\" {...rest}>\n {children}\n </Stack>\n );\n}\n"],"names":[],"mappings":";;;AA8BO,SAAS,OAAsC;AAAA,EACpD;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAmB;AACjB;AAAA;AAAA,IAEE,oBAAC,SAAM,IAAI,MAAM,OAAO,WAAU,OAAO,GAAG,MACzC,SAAA,CACH;AAAA;AAEJ;"}
|