@recursica/mui-adapter 0.5.0 → 0.6.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/CHANGELOG.md +9 -0
- package/dist/mui-adapter.cjs +74 -1
- package/dist/mui-adapter.cjs.map +1 -1
- package/dist/mui-adapter.css +1 -1
- package/dist/mui-adapter.js +6652 -204
- package/dist/mui-adapter.js.map +1 -1
- package/dist/src/components/Accordion/Accordion.d.ts +63 -2
- package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +9 -2
- package/dist/src/components/Autocomplete/Autocomplete.d.ts +16 -2
- package/dist/src/components/Avatar/Avatar.d.ts +14 -2
- package/dist/src/components/Badge/Badge.d.ts +13 -3
- package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +10 -3
- package/dist/src/components/Button/Button.d.ts +1 -1
- package/dist/src/components/Card/Card.d.ts +40 -3
- package/dist/src/components/Checkbox/Checkbox.d.ts +15 -2
- package/dist/src/components/Checkbox/CheckboxGroup.d.ts +16 -0
- package/dist/src/components/Checkbox/index.d.ts +5 -1
- package/dist/src/components/Chip/Chip.d.ts +18 -2
- package/dist/src/components/Dropdown/Dropdown.d.ts +23 -3
- package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +10 -2
- package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +24 -2
- package/dist/src/components/HoverCard/HoverCard.d.ts +55 -3
- package/dist/src/components/Label/Label.d.ts +13 -2
- package/dist/src/components/Link/Link.d.ts +1 -1
- package/dist/src/components/Menu/Menu.d.ts +99 -3
- package/dist/src/components/Modal/Modal.d.ts +36 -2
- package/dist/src/components/NumberInput/NumberInput.d.ts +14 -2
- package/dist/src/components/Pagination/Pagination.d.ts +44 -2
- package/dist/src/components/Pagination/Pagination.icons.d.ts +8 -0
- package/dist/src/components/Panel/Panel.d.ts +65 -3
- package/dist/src/components/Radio/Radio.d.ts +13 -3
- package/dist/src/components/Radio/RadioGroup.d.ts +13 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyBooleanField.d.ts +5 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +7 -2
- package/dist/src/components/ReadOnlyField/ReadOnlySwitchField.d.ts +5 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +8 -0
- package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +28 -0
- package/dist/src/components/ReadOnlyField/index.d.ts +1 -0
- package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +31 -3
- package/dist/src/components/Slider/Slider.d.ts +28 -2
- package/dist/src/components/Stepper/Stepper.d.ts +21 -2
- package/dist/src/components/Switch/Switch.d.ts +10 -3
- package/dist/src/components/Switch/SwitchGroup.d.ts +13 -0
- package/dist/src/components/Tabs/Tabs.d.ts +35 -3
- package/dist/src/components/Text/Text.d.ts +1 -1
- package/dist/src/components/TextArea/TextArea.d.ts +18 -2
- package/dist/src/components/TextField/TextField.d.ts +16 -2
- package/dist/src/components/Timeline/Timeline.d.ts +14 -2
- package/dist/src/components/Timeline/TimelineItem.d.ts +29 -0
- package/dist/src/components/Title/Title.d.ts +1 -1
- package/dist/src/components/Toast/Toast.d.ts +25 -2
- package/dist/src/components/Tooltip/Tooltip.d.ts +42 -3
- package/dist/src/components/Typography/Typography.d.ts +1 -1
- package/package.json +9 -2
- package/src/components/Accordion/Accordion.module.css +295 -56
- package/src/components/Accordion/Accordion.stories.tsx +149 -21
- package/src/components/Accordion/Accordion.tsx +264 -5
- package/src/components/AssistiveElement/AssistiveElement.module.css +111 -20
- package/src/components/AssistiveElement/AssistiveElement.stories.tsx +76 -19
- package/src/components/AssistiveElement/AssistiveElement.tsx +85 -5
- package/src/components/Autocomplete/Autocomplete.module.css +320 -42
- package/src/components/Autocomplete/Autocomplete.stories.tsx +180 -19
- package/src/components/Autocomplete/Autocomplete.tsx +199 -6
- package/src/components/Avatar/Avatar.module.css +343 -73
- package/src/components/Avatar/Avatar.stories.tsx +94 -22
- package/src/components/Avatar/Avatar.tsx +110 -6
- package/src/components/Badge/Badge.module.css +127 -29
- package/src/components/Badge/Badge.stories.tsx +65 -22
- package/src/components/Badge/Badge.tsx +70 -6
- package/src/components/Breadcrumb/Breadcrumb.module.css +25 -5
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +57 -22
- package/src/components/Breadcrumb/Breadcrumb.tsx +62 -6
- package/src/components/Button/Button.module.css +3 -3
- package/src/components/Card/Card.module.css +118 -38
- package/src/components/Card/Card.stories.tsx +117 -19
- package/src/components/Card/Card.tsx +179 -5
- package/src/components/Checkbox/Checkbox.module.css +232 -39
- package/src/components/Checkbox/Checkbox.stories.tsx +81 -19
- package/src/components/Checkbox/Checkbox.tsx +146 -5
- package/src/components/Checkbox/CheckboxGroup.tsx +117 -0
- package/src/components/Checkbox/index.ts +6 -1
- package/src/components/Chip/Chip.module.css +228 -43
- package/src/components/Chip/Chip.stories.tsx +101 -21
- package/src/components/Chip/Chip.tsx +138 -6
- package/src/components/Dropdown/Dropdown.module.css +291 -41
- package/src/components/Dropdown/Dropdown.stories.tsx +80 -21
- package/src/components/Dropdown/Dropdown.tsx +182 -6
- package/src/components/FormControlLayout/FormControlLayout.module.css +92 -0
- package/src/components/FormControlLayout/FormControlLayout.stories.tsx +74 -19
- package/src/components/FormControlLayout/FormControlLayout.tsx +58 -4
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +96 -0
- package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +122 -19
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +145 -6
- package/src/components/HoverCard/HoverCard.module.css +90 -22
- package/src/components/HoverCard/HoverCard.stories.tsx +158 -21
- package/src/components/HoverCard/HoverCard.tsx +150 -5
- package/src/components/Label/Label.module.css +136 -35
- package/src/components/Label/Label.stories.tsx +98 -17
- package/src/components/Label/Label.tsx +88 -5
- package/src/components/Menu/Menu.module.css +285 -51
- package/src/components/Menu/Menu.stories.tsx +307 -21
- package/src/components/Menu/Menu.tsx +318 -5
- package/src/components/Modal/Modal.module.css +171 -35
- package/src/components/Modal/Modal.stories.tsx +66 -22
- package/src/components/Modal/Modal.tsx +216 -4
- package/src/components/NumberInput/NumberInput.module.css +276 -42
- package/src/components/NumberInput/NumberInput.stories.tsx +83 -20
- package/src/components/NumberInput/NumberInput.tsx +148 -6
- package/src/components/Pagination/Pagination.icons.tsx +66 -0
- package/src/components/Pagination/Pagination.module.css +246 -20
- package/src/components/Pagination/Pagination.stories.tsx +42 -21
- package/src/components/Pagination/Pagination.tsx +193 -5
- package/src/components/Panel/Panel.module.css +206 -38
- package/src/components/Panel/Panel.stories.tsx +214 -22
- package/src/components/Panel/Panel.tsx +153 -5
- package/src/components/Radio/Radio.module.css +220 -37
- package/src/components/Radio/Radio.stories.tsx +77 -19
- package/src/components/Radio/Radio.tsx +178 -5
- package/src/components/Radio/RadioGroup.tsx +111 -0
- package/src/components/ReadOnlyField/ReadOnlyBooleanField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyField.module.css +53 -15
- package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +175 -16
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +109 -5
- package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
- package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
- package/src/components/ReadOnlyField/index.ts +1 -0
- package/src/components/SegmentedControl/SegmentedControl.module.css +203 -47
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +102 -20
- package/src/components/SegmentedControl/SegmentedControl.tsx +110 -6
- package/src/components/Slider/Slider.module.css +542 -86
- package/src/components/Slider/Slider.stories.tsx +157 -19
- package/src/components/Slider/Slider.tsx +282 -5
- package/src/components/Stepper/Stepper.module.css +410 -71
- package/src/components/Stepper/Stepper.stories.tsx +132 -19
- package/src/components/Stepper/Stepper.tsx +145 -6
- package/src/components/Switch/Switch.module.css +238 -39
- package/src/components/Switch/Switch.stories.tsx +98 -19
- package/src/components/Switch/Switch.tsx +153 -6
- package/src/components/Switch/SwitchGroup.tsx +111 -0
- package/src/components/Tabs/Tabs.module.css +422 -79
- package/src/components/Tabs/Tabs.stories.tsx +138 -19
- package/src/components/Tabs/Tabs.tsx +103 -6
- package/src/components/TextArea/TextArea.module.css +155 -32
- package/src/components/TextArea/TextArea.stories.tsx +80 -21
- package/src/components/TextArea/TextArea.tsx +156 -6
- package/src/components/TextField/TextField.module.css +261 -42
- package/src/components/TextField/TextField.stories.tsx +168 -15
- package/src/components/TextField/TextField.tsx +171 -6
- package/src/components/Timeline/Timeline.module.css +365 -76
- package/src/components/Timeline/Timeline.stories.tsx +114 -21
- package/src/components/Timeline/Timeline.tsx +80 -5
- package/src/components/Timeline/TimelineItem.tsx +101 -0
- package/src/components/Toast/Toast.module.css +166 -28
- package/src/components/Toast/Toast.stories.tsx +54 -22
- package/src/components/Toast/Toast.tsx +90 -5
- package/src/components/Tooltip/Tooltip.module.css +89 -24
- package/src/components/Tooltip/Tooltip.stories.tsx +152 -22
- package/src/components/Tooltip/Tooltip.tsx +114 -5
|
@@ -1,35 +1,70 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
3
|
import { Breadcrumb } from "./Breadcrumb";
|
|
3
|
-
import {
|
|
4
|
+
import { Link } from "../Link";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
type BreadcrumbStoryProps = React.ComponentProps<typeof Breadcrumb> & {
|
|
7
|
+
items?: string[];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const meta: Meta<BreadcrumbStoryProps> = {
|
|
11
|
+
title: "UI-Kit/Breadcrumb",
|
|
7
12
|
component: Breadcrumb,
|
|
8
13
|
tags: ["autodocs"],
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
argTypes: {
|
|
15
|
+
children: {
|
|
16
|
+
table: {
|
|
17
|
+
disable: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
items: {
|
|
21
|
+
control: "object",
|
|
22
|
+
description:
|
|
23
|
+
"Array of string labels used to dynamically generate the interactive Breadcrumb nodes.",
|
|
24
|
+
table: {
|
|
25
|
+
category: "Story Controls",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
separator: {
|
|
29
|
+
control: "text",
|
|
30
|
+
description: "Custom separator between items",
|
|
26
31
|
},
|
|
27
32
|
},
|
|
33
|
+
args: {
|
|
34
|
+
items: ["Home", "Components", "Breadcrumbs"],
|
|
35
|
+
},
|
|
36
|
+
render: ({ items, children, ...args }) => {
|
|
37
|
+
const mappedChildren = items
|
|
38
|
+
? items.map((label, index) => (
|
|
39
|
+
<Link href="#" key={index}>
|
|
40
|
+
{label}
|
|
41
|
+
</Link>
|
|
42
|
+
))
|
|
43
|
+
: children;
|
|
44
|
+
|
|
45
|
+
return <Breadcrumb children={mappedChildren} {...args} />;
|
|
46
|
+
},
|
|
28
47
|
};
|
|
29
48
|
|
|
30
49
|
export default meta;
|
|
31
|
-
|
|
50
|
+
|
|
51
|
+
type Story = StoryObj<BreadcrumbStoryProps>;
|
|
32
52
|
|
|
33
53
|
export const Default: Story = {
|
|
34
|
-
|
|
54
|
+
args: {
|
|
55
|
+
items: ["Dashboard", "Settings", "Security"],
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const StaticExample: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
items: ["Store", "Electronics", "Computers", "Laptops"],
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const CustomSeparator: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
items: ["Root", "Branch", "Leaf"],
|
|
68
|
+
separator: "→",
|
|
69
|
+
},
|
|
35
70
|
};
|
|
@@ -1,8 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Breadcrumbs as MuiBreadcrumbs,
|
|
4
|
+
type BreadcrumbsProps as MuiBreadcrumbsProps,
|
|
5
|
+
} from "@mui/material";
|
|
6
|
+
import {
|
|
7
|
+
filterStylingProps,
|
|
8
|
+
type RecursicaOverStyled,
|
|
9
|
+
} from "../../utils/filterStylingProps";
|
|
10
|
+
import styles from "./Breadcrumb.module.css";
|
|
3
11
|
|
|
4
|
-
|
|
12
|
+
// Currently there are no Recursica prop additions specific to Breadcrumbs (like size or variant)
|
|
13
|
+
// according to recursica_ui-kit.json
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
15
|
+
export interface RecursicaBreadcrumbProps {}
|
|
5
16
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
17
|
+
export type BreadcrumbProps = RecursicaOverStyled<
|
|
18
|
+
Omit<MuiBreadcrumbsProps, "variant" | "size"> & RecursicaBreadcrumbProps
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
export const Breadcrumb = forwardRef<HTMLDivElement, BreadcrumbProps>(
|
|
22
|
+
function Breadcrumb({ overStyled = false, separator = ">", ...rest }, ref) {
|
|
23
|
+
const sanitizedProps = filterStylingProps(
|
|
24
|
+
{ separator, ...rest },
|
|
25
|
+
overStyled,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const mergedClassNames: Partial<Record<string, string>> = {
|
|
29
|
+
root: styles.root,
|
|
30
|
+
separator: styles.separator,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const classNamesProp = (sanitizedProps as Record<string, unknown>)
|
|
34
|
+
.classNames;
|
|
35
|
+
if (
|
|
36
|
+
classNamesProp &&
|
|
37
|
+
typeof classNamesProp === "object" &&
|
|
38
|
+
!Array.isArray(classNamesProp)
|
|
39
|
+
) {
|
|
40
|
+
const o = classNamesProp as Partial<Record<string, string>>;
|
|
41
|
+
mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;
|
|
42
|
+
mergedClassNames.separator = o.separator
|
|
43
|
+
? `${styles.separator} ${o.separator}`
|
|
44
|
+
: styles.separator;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const classNameProp = (sanitizedProps as Record<string, unknown>)
|
|
48
|
+
.className as string | undefined;
|
|
49
|
+
const finalClass = classNameProp
|
|
50
|
+
? `${styles.root} ${classNameProp}`
|
|
51
|
+
: styles.root;
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<MuiBreadcrumbs
|
|
55
|
+
ref={ref}
|
|
56
|
+
{...(sanitizedProps as unknown as MuiBreadcrumbsProps)}
|
|
57
|
+
className={finalClass}
|
|
58
|
+
classes={mergedClassNames}
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
* to create contrast for solid variants without changing the loader color.
|
|
76
76
|
*/
|
|
77
77
|
.root[data-loading="true"] {
|
|
78
|
-
opacity: 1
|
|
78
|
+
opacity: 1;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.root[data-size="default"][data-variant="solid"][data-loading="true"] {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
100%
|
|
92
92
|
),
|
|
93
93
|
transparent
|
|
94
|
-
)
|
|
94
|
+
);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
.root[data-size="small"][data-variant="solid"][data-loading="true"] {
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
100%
|
|
108
108
|
),
|
|
109
109
|
transparent
|
|
110
|
-
)
|
|
110
|
+
);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/* ==== SIZES ==== */
|
|
@@ -1,38 +1,118 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
/* HARDCODED VALUES:
|
|
2
|
+
- display: flex on root
|
|
3
|
+
- flex-direction: column
|
|
4
|
+
- gap: section-gap
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.root {
|
|
8
|
+
/* HARDCODE: Map Recursica explicitly into Mantine's variable format so internal components know the margins */
|
|
9
|
+
--card-padding: var(--recursica_ui-kit_components_card_properties_padding);
|
|
10
|
+
|
|
11
|
+
background-color: var(
|
|
12
|
+
--recursica_ui-kit_components_card_properties_colors_background
|
|
13
|
+
);
|
|
14
|
+
border-radius: var(
|
|
15
|
+
--recursica_ui-kit_components_card_properties_borders_border-radius
|
|
16
|
+
);
|
|
17
|
+
border: var(--recursica_ui-kit_components_card_properties_borders_border-size)
|
|
18
|
+
solid var(--recursica_ui-kit_components_card_properties_colors_border-color);
|
|
19
|
+
box-shadow: var(
|
|
20
|
+
--recursica_ui-kit_components_card_properties_elevations_elevation
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
padding: var(--card-padding);
|
|
24
|
+
min-width: var(--recursica_ui-kit_components_card_properties_min-width);
|
|
25
|
+
max-width: var(--recursica_ui-kit_components_card_properties_max-width);
|
|
26
|
+
color: var(--recursica_ui-kit_components_card_properties_colors_content);
|
|
27
|
+
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: var(--recursica_ui-kit_components_card_properties_section-gap);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.header {
|
|
34
|
+
background-color: var(
|
|
35
|
+
--recursica_ui-kit_components_card_properties_colors_header-background
|
|
36
|
+
);
|
|
37
|
+
padding: var(--recursica_ui-kit_components_card_properties_header-padding);
|
|
38
|
+
color: var(--recursica_ui-kit_components_card_properties_colors_title);
|
|
39
|
+
border-bottom: var(--recursica_ui-kit_components_card_properties_divider-size)
|
|
40
|
+
solid
|
|
41
|
+
var(--recursica_ui-kit_components_card_properties_colors_divider-color);
|
|
42
|
+
|
|
43
|
+
/* Direct Figma Typography Mapping */
|
|
44
|
+
font-family: var(
|
|
45
|
+
--recursica_ui-kit_components_card_properties_header-style_fontFamily
|
|
46
|
+
);
|
|
47
|
+
font-size: var(
|
|
48
|
+
--recursica_ui-kit_components_card_properties_header-style_fontSize
|
|
49
|
+
);
|
|
50
|
+
font-style: var(
|
|
51
|
+
--recursica_ui-kit_components_card_properties_header-style_fontStyle
|
|
52
|
+
);
|
|
53
|
+
font-weight: var(
|
|
54
|
+
--recursica_ui-kit_components_card_properties_header-style_fontWeight
|
|
55
|
+
);
|
|
56
|
+
letter-spacing: var(
|
|
57
|
+
--recursica_ui-kit_components_card_properties_header-style_letterSpacing
|
|
58
|
+
);
|
|
59
|
+
line-height: var(
|
|
60
|
+
--recursica_ui-kit_components_card_properties_header-style_lineHeight
|
|
61
|
+
);
|
|
62
|
+
text-transform: var(
|
|
63
|
+
--recursica_ui-kit_components_card_properties_header-style_textCase
|
|
64
|
+
);
|
|
65
|
+
text-decoration: var(
|
|
66
|
+
--recursica_ui-kit_components_card_properties_header-style_textDecoration
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.footer {
|
|
71
|
+
background-color: var(
|
|
72
|
+
--recursica_ui-kit_components_card_properties_colors_footer-background
|
|
73
|
+
);
|
|
74
|
+
padding: var(--recursica_ui-kit_components_card_properties_footer-padding);
|
|
75
|
+
border-top: var(--recursica_ui-kit_components_card_properties_divider-size)
|
|
76
|
+
solid
|
|
77
|
+
var(--recursica_ui-kit_components_card_properties_colors_divider-color);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.section {
|
|
81
|
+
/* Just maps standard section spacing overrides if passed explicitly */
|
|
82
|
+
margin-top: var(
|
|
83
|
+
--recursica_ui-kit_components_card_properties_vertical-gutter
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.content {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
gap: var(--recursica_ui-kit_components_card_properties_vertical-gutter);
|
|
91
|
+
padding: 0;
|
|
92
|
+
|
|
93
|
+
/* Direct Figma Typography Mapping */
|
|
94
|
+
font-family: var(
|
|
95
|
+
--recursica_ui-kit_components_card_properties_content-style_fontFamily
|
|
96
|
+
);
|
|
97
|
+
font-size: var(
|
|
98
|
+
--recursica_ui-kit_components_card_properties_content-style_fontSize
|
|
99
|
+
);
|
|
100
|
+
font-style: var(
|
|
101
|
+
--recursica_ui-kit_components_card_properties_content-style_fontStyle
|
|
102
|
+
);
|
|
103
|
+
font-weight: var(
|
|
104
|
+
--recursica_ui-kit_components_card_properties_content-style_fontWeight
|
|
105
|
+
);
|
|
106
|
+
letter-spacing: var(
|
|
107
|
+
--recursica_ui-kit_components_card_properties_content-style_letterSpacing
|
|
108
|
+
);
|
|
109
|
+
line-height: var(
|
|
110
|
+
--recursica_ui-kit_components_card_properties_content-style_lineHeight
|
|
111
|
+
);
|
|
112
|
+
text-transform: var(
|
|
113
|
+
--recursica_ui-kit_components_card_properties_content-style_textCase
|
|
114
|
+
);
|
|
115
|
+
text-decoration: var(
|
|
116
|
+
--recursica_ui-kit_components_card_properties_content-style_textDecoration
|
|
117
|
+
);
|
|
118
|
+
}
|
|
@@ -1,35 +1,133 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Card } from "./Card";
|
|
3
|
-
import {
|
|
3
|
+
import { Layer } from "@recursica/adapter-common";
|
|
4
|
+
import { Button } from "../Button/Button";
|
|
5
|
+
import { Group } from "../Group/Group";
|
|
6
|
+
import { Text } from "../Text/Text";
|
|
4
7
|
|
|
5
8
|
const meta: Meta<typeof Card> = {
|
|
6
|
-
title: "UI-Kit
|
|
9
|
+
title: "UI-Kit/Card",
|
|
7
10
|
component: Card,
|
|
11
|
+
subcomponents: {
|
|
12
|
+
"Card.Header": Card.Header,
|
|
13
|
+
"Card.Content": Card.Content,
|
|
14
|
+
"Card.Footer": Card.Footer,
|
|
15
|
+
"Card.Section": Card.Section,
|
|
16
|
+
} as Record<string, React.ComponentType<unknown>>,
|
|
8
17
|
tags: ["autodocs"],
|
|
9
18
|
parameters: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"component",
|
|
16
|
-
"variant",
|
|
17
|
-
"size",
|
|
18
|
-
"icon",
|
|
19
|
-
"disabled",
|
|
20
|
-
"href",
|
|
21
|
-
"onClick",
|
|
22
|
-
"onChange",
|
|
23
|
-
"value",
|
|
24
|
-
"checked",
|
|
25
|
-
],
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component:
|
|
22
|
+
"The Card component acts as the foundational padded surface for grouping related information. It relies on standard internal compositional nodes (`Card.Header`, `Card.Content`, `Card.Footer`) mapped directly to the active Recursica design tokens to enforce layout gaps and margins seamlessly. Use the provided dot-notation wrappers rather than building ad-hoc generic sections.",
|
|
23
|
+
},
|
|
26
24
|
},
|
|
27
25
|
},
|
|
26
|
+
argTypes: {},
|
|
28
27
|
};
|
|
29
28
|
|
|
30
29
|
export default meta;
|
|
30
|
+
|
|
31
31
|
type Story = StoryObj<typeof Card>;
|
|
32
32
|
|
|
33
33
|
export const Default: Story = {
|
|
34
|
-
|
|
34
|
+
args: {},
|
|
35
|
+
render: ({ ...args }) => {
|
|
36
|
+
return (
|
|
37
|
+
<div
|
|
38
|
+
style={{
|
|
39
|
+
padding: "48px",
|
|
40
|
+
backgroundColor:
|
|
41
|
+
"var(--recursica_brand_palettes_neutral_050_color_tone)",
|
|
42
|
+
}}
|
|
43
|
+
>
|
|
44
|
+
<Layer layer={0}>
|
|
45
|
+
<Card {...args}>
|
|
46
|
+
<Card.Header>Customer Activity Report</Card.Header>
|
|
47
|
+
<Card.Content>
|
|
48
|
+
<Text>
|
|
49
|
+
Card inner section content body. Notice how this acts as padded
|
|
50
|
+
content natively based on the overarching properties.
|
|
51
|
+
Recursica's vertical gutter governs vertical spacing between
|
|
52
|
+
siblings in the flex container.
|
|
53
|
+
</Text>
|
|
54
|
+
<Text>Another section showing the vertical gutter spacing.</Text>
|
|
55
|
+
</Card.Content>
|
|
56
|
+
<Card.Footer>
|
|
57
|
+
<Group justify="space-between" align="center">
|
|
58
|
+
<Text variant="caption">Generated today</Text>
|
|
59
|
+
<Button variant="solid">View Details</Button>
|
|
60
|
+
</Group>
|
|
61
|
+
</Card.Footer>
|
|
62
|
+
</Card>
|
|
63
|
+
</Layer>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const HeaderlessAndFooterless: Story = {
|
|
70
|
+
args: {},
|
|
71
|
+
render: ({ ...args }) => {
|
|
72
|
+
return (
|
|
73
|
+
<div
|
|
74
|
+
style={{
|
|
75
|
+
padding: "48px",
|
|
76
|
+
backgroundColor:
|
|
77
|
+
"var(--recursica_brand_palettes_neutral_050_color_tone)",
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
<Layer layer={0}>
|
|
81
|
+
<Card {...args}>
|
|
82
|
+
<Card.Content>
|
|
83
|
+
<Text variant="subtitle">Notice</Text>
|
|
84
|
+
<Text>
|
|
85
|
+
This is a completely generic card payload dropping the Header
|
|
86
|
+
and Footer specific elements, simply acting as a padded
|
|
87
|
+
elevation boundary box directly mirroring native composability!
|
|
88
|
+
</Text>
|
|
89
|
+
<Button variant="solid">Acknowledge</Button>
|
|
90
|
+
</Card.Content>
|
|
91
|
+
</Card>
|
|
92
|
+
</Layer>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const LayerDemonstration: Story = {
|
|
99
|
+
args: {},
|
|
100
|
+
render: ({ ...args }) => {
|
|
101
|
+
return (
|
|
102
|
+
<div
|
|
103
|
+
style={{
|
|
104
|
+
display: "flex",
|
|
105
|
+
gap: "32px",
|
|
106
|
+
backgroundColor: "#e9ecef",
|
|
107
|
+
padding: "32px",
|
|
108
|
+
}}
|
|
109
|
+
>
|
|
110
|
+
<Layer layer={1}>
|
|
111
|
+
<Card {...args}>
|
|
112
|
+
<Card.Header>Layer 1 Wrapper</Card.Header>
|
|
113
|
+
<Card.Content>
|
|
114
|
+
<Text>Content inside layer 1 card.</Text>
|
|
115
|
+
</Card.Content>
|
|
116
|
+
</Card>
|
|
117
|
+
</Layer>
|
|
118
|
+
|
|
119
|
+
<Layer layer={2}>
|
|
120
|
+
<Card {...args}>
|
|
121
|
+
<Card.Header>Layer 2 Wrapper</Card.Header>
|
|
122
|
+
<Card.Content>
|
|
123
|
+
<Text>
|
|
124
|
+
Content inside layer 2 card exposing a higher elevation drop
|
|
125
|
+
shadow inherently cascaded.
|
|
126
|
+
</Text>
|
|
127
|
+
</Card.Content>
|
|
128
|
+
</Card>
|
|
129
|
+
</Layer>
|
|
130
|
+
</div>
|
|
131
|
+
);
|
|
132
|
+
},
|
|
35
133
|
};
|