@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,28 +1,31 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Tabs } from "./Tabs";
|
|
3
|
-
import {
|
|
3
|
+
import { Flex } from "../Flex/Flex";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Tabs> = {
|
|
6
|
-
title: "UI-Kit
|
|
6
|
+
title: "UI-Kit/Tabs",
|
|
7
7
|
component: Tabs,
|
|
8
8
|
tags: ["autodocs"],
|
|
9
9
|
parameters: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
layout: "centered",
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
variant: {
|
|
14
|
+
control: "radio",
|
|
15
|
+
options: ["default", "outline", "pills"],
|
|
16
|
+
},
|
|
17
|
+
orientation: {
|
|
18
|
+
control: "radio",
|
|
19
|
+
options: ["horizontal", "vertical"],
|
|
20
|
+
},
|
|
21
|
+
// @ts-expect-error Custom prop not in native TabsProps
|
|
22
|
+
disabled: {
|
|
23
|
+
control: "boolean",
|
|
24
|
+
},
|
|
25
|
+
defaultChecked: {
|
|
26
|
+
table: {
|
|
27
|
+
disable: true,
|
|
28
|
+
},
|
|
26
29
|
},
|
|
27
30
|
},
|
|
28
31
|
};
|
|
@@ -30,6 +33,122 @@ const meta: Meta<typeof Tabs> = {
|
|
|
30
33
|
export default meta;
|
|
31
34
|
type Story = StoryObj<typeof Tabs>;
|
|
32
35
|
|
|
36
|
+
const InteractiveTabs = (
|
|
37
|
+
args: React.ComponentProps<typeof Tabs> & { disabled?: boolean },
|
|
38
|
+
) => {
|
|
39
|
+
return (
|
|
40
|
+
<Flex w={600} h={300}>
|
|
41
|
+
<Tabs defaultValue="gallery" {...args}>
|
|
42
|
+
<Tabs.List>
|
|
43
|
+
<Tabs.Tab
|
|
44
|
+
value="gallery"
|
|
45
|
+
disabled={args.disabled}
|
|
46
|
+
leftSection={
|
|
47
|
+
<svg
|
|
48
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
49
|
+
viewBox="0 0 24 24"
|
|
50
|
+
fill="none"
|
|
51
|
+
stroke="currentColor"
|
|
52
|
+
strokeWidth="2"
|
|
53
|
+
strokeLinecap="round"
|
|
54
|
+
strokeLinejoin="round"
|
|
55
|
+
>
|
|
56
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
57
|
+
<circle cx="8.5" cy="8.5" r="1.5"></circle>
|
|
58
|
+
<polyline points="21 15 16 10 5 21"></polyline>
|
|
59
|
+
</svg>
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
Gallery
|
|
63
|
+
</Tabs.Tab>
|
|
64
|
+
<Tabs.Tab
|
|
65
|
+
value="messages"
|
|
66
|
+
disabled={args.disabled}
|
|
67
|
+
leftSection={
|
|
68
|
+
<svg
|
|
69
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
70
|
+
viewBox="0 0 24 24"
|
|
71
|
+
fill="none"
|
|
72
|
+
stroke="currentColor"
|
|
73
|
+
strokeWidth="2"
|
|
74
|
+
strokeLinecap="round"
|
|
75
|
+
strokeLinejoin="round"
|
|
76
|
+
>
|
|
77
|
+
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
|
|
78
|
+
</svg>
|
|
79
|
+
}
|
|
80
|
+
>
|
|
81
|
+
Messages
|
|
82
|
+
</Tabs.Tab>
|
|
83
|
+
<Tabs.Tab
|
|
84
|
+
value="settings"
|
|
85
|
+
disabled={args.disabled}
|
|
86
|
+
leftSection={
|
|
87
|
+
<svg
|
|
88
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
89
|
+
viewBox="0 0 24 24"
|
|
90
|
+
fill="none"
|
|
91
|
+
stroke="currentColor"
|
|
92
|
+
strokeWidth="2"
|
|
93
|
+
strokeLinecap="round"
|
|
94
|
+
strokeLinejoin="round"
|
|
95
|
+
>
|
|
96
|
+
<circle cx="12" cy="12" r="3"></circle>
|
|
97
|
+
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
|
|
98
|
+
</svg>
|
|
99
|
+
}
|
|
100
|
+
>
|
|
101
|
+
Settings
|
|
102
|
+
</Tabs.Tab>
|
|
103
|
+
</Tabs.List>
|
|
104
|
+
|
|
105
|
+
<Tabs.Panel value="gallery">Gallery tab content</Tabs.Panel>
|
|
106
|
+
|
|
107
|
+
<Tabs.Panel value="messages">Messages tab content</Tabs.Panel>
|
|
108
|
+
|
|
109
|
+
<Tabs.Panel value="settings">Settings tab content</Tabs.Panel>
|
|
110
|
+
</Tabs>
|
|
111
|
+
</Flex>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
33
115
|
export const Default: Story = {
|
|
34
|
-
render: () => <
|
|
116
|
+
render: (args) => <InteractiveTabs {...args} />,
|
|
117
|
+
args: {
|
|
118
|
+
variant: "default",
|
|
119
|
+
orientation: "horizontal",
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const Outline: Story = {
|
|
124
|
+
render: (args) => <InteractiveTabs {...args} />,
|
|
125
|
+
args: {
|
|
126
|
+
variant: "outline",
|
|
127
|
+
orientation: "horizontal",
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const Pills: Story = {
|
|
132
|
+
render: (args) => <InteractiveTabs {...args} />,
|
|
133
|
+
args: {
|
|
134
|
+
variant: "pills",
|
|
135
|
+
orientation: "horizontal",
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const Vertical: Story = {
|
|
140
|
+
render: (args) => <InteractiveTabs {...args} />,
|
|
141
|
+
args: {
|
|
142
|
+
variant: "default",
|
|
143
|
+
orientation: "vertical",
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const Inverted: Story = {
|
|
148
|
+
render: (args) => <InteractiveTabs {...args} />,
|
|
149
|
+
args: {
|
|
150
|
+
variant: "default",
|
|
151
|
+
orientation: "horizontal",
|
|
152
|
+
inverted: true,
|
|
153
|
+
},
|
|
35
154
|
};
|
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Tabs as MuiTabs,
|
|
4
|
+
type TabsProps as MuiTabsProps,
|
|
5
|
+
type ListProps as MuiTabsListProps,
|
|
6
|
+
type TabsProps as MuiTabsTabProps,
|
|
7
|
+
} from "@mui/material";
|
|
8
|
+
import {
|
|
9
|
+
filterStylingProps,
|
|
10
|
+
type RecursicaOverStyled,
|
|
11
|
+
} from "../../utils/filterStylingProps";
|
|
12
|
+
import styles from "./Tabs.module.css";
|
|
3
13
|
|
|
4
|
-
export
|
|
14
|
+
export interface RecursicaTabsProps
|
|
15
|
+
extends Omit<MuiTabsProps, "variant" | "classNames" | "color" | "radius"> {
|
|
16
|
+
variant?: "default" | "outline" | "pills";
|
|
17
|
+
}
|
|
5
18
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
export type TabsProps = RecursicaOverStyled<RecursicaTabsProps>;
|
|
20
|
+
|
|
21
|
+
const _Tabs = forwardRef<HTMLDivElement, TabsProps>(function Tabs(props, ref) {
|
|
22
|
+
const {
|
|
23
|
+
variant = "default",
|
|
24
|
+
orientation = "horizontal",
|
|
25
|
+
overStyled = false,
|
|
26
|
+
className,
|
|
27
|
+
...rest
|
|
28
|
+
} = props;
|
|
29
|
+
|
|
30
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<MuiTabs
|
|
34
|
+
ref={ref}
|
|
35
|
+
variant={variant}
|
|
36
|
+
orientation={orientation}
|
|
37
|
+
className={`${styles.root} ${className || ""}`}
|
|
38
|
+
data-variant={variant}
|
|
39
|
+
data-orientation={orientation}
|
|
40
|
+
classes={{
|
|
41
|
+
list: styles.list,
|
|
42
|
+
tab: styles.tab,
|
|
43
|
+
panel: styles.panel,
|
|
44
|
+
}}
|
|
45
|
+
{...(sanitizedProps as MuiTabsProps)}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
_Tabs.displayName = "Tabs";
|
|
51
|
+
|
|
52
|
+
export type TabsListProps = RecursicaOverStyled<MuiTabsListProps>;
|
|
53
|
+
|
|
54
|
+
const _TabsList = forwardRef<HTMLDivElement, TabsListProps>(
|
|
55
|
+
function TabsList(props, ref) {
|
|
56
|
+
const { overStyled = false, ...rest } = props;
|
|
57
|
+
return (
|
|
58
|
+
<div
|
|
59
|
+
ref={ref}
|
|
60
|
+
{...(filterStylingProps(rest, overStyled) as MuiTabsListProps)}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
_TabsList.displayName = "Tabs.List";
|
|
66
|
+
|
|
67
|
+
export type TabsTabProps = RecursicaOverStyled<MuiTabsTabProps>;
|
|
68
|
+
|
|
69
|
+
const _TabsTab = forwardRef<HTMLButtonElement, TabsTabProps>(
|
|
70
|
+
function TabsTab(props, ref) {
|
|
71
|
+
const { overStyled = false, ...rest } = props;
|
|
72
|
+
return (
|
|
73
|
+
<div
|
|
74
|
+
ref={ref}
|
|
75
|
+
{...(filterStylingProps(rest, overStyled) as MuiTabsTabProps)}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
},
|
|
79
|
+
);
|
|
80
|
+
_TabsTab.displayName = "Tabs.Tab";
|
|
81
|
+
|
|
82
|
+
export type TabsPanelProps = RecursicaOverStyled<MuiTabsPanelProps>;
|
|
83
|
+
|
|
84
|
+
const _TabsPanel = forwardRef<HTMLDivElement, TabsPanelProps>(
|
|
85
|
+
function TabsPanel(props, ref) {
|
|
86
|
+
const { overStyled = false, ...rest } = props;
|
|
87
|
+
return (
|
|
88
|
+
<div
|
|
89
|
+
ref={ref}
|
|
90
|
+
{...(filterStylingProps(rest, overStyled) as MuiTabsPanelProps)}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
},
|
|
94
|
+
);
|
|
95
|
+
_TabsPanel.displayName = "Tabs.Panel";
|
|
96
|
+
|
|
97
|
+
export const Tabs: typeof _Tabs & {
|
|
98
|
+
List: typeof _TabsList;
|
|
99
|
+
Tab: typeof _TabsTab;
|
|
100
|
+
Panel: typeof _TabsPanel;
|
|
101
|
+
} = Object.assign(_Tabs, {
|
|
102
|
+
List: _TabsList,
|
|
103
|
+
Tab: _TabsTab,
|
|
104
|
+
Panel: _TabsPanel,
|
|
105
|
+
});
|
|
@@ -1,37 +1,160 @@
|
|
|
1
1
|
/* EXEMPTIONS:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_border-radius */
|
|
6
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_horizontal-padding */
|
|
7
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_max-width */
|
|
8
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_min-width */
|
|
9
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_placeholder-opacity */
|
|
10
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_rows */
|
|
11
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_font-family */
|
|
12
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_font-size */
|
|
13
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_font-style */
|
|
14
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_font-weight */
|
|
15
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_letter-spacing */
|
|
16
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_line-height */
|
|
17
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_text-decoration */
|
|
18
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_text_text-transform */
|
|
19
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_properties_vertical-padding */
|
|
20
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_layouts_side-by-side_properties_top-bottom-margin */
|
|
21
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_layouts_stacked_properties_top-bottom-margin */
|
|
2
|
+
- state-specific border-size variables are ignored because a uniform 1px border is applied globally to prevent
|
|
3
|
+
unexpected layout shift or flickering during focus, disabled, or error state transitions. */
|
|
22
4
|
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_default_properties_border-size */
|
|
23
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_default_properties_colors_background */
|
|
24
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_default_properties_colors_border-color */
|
|
25
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_default_properties_colors_text */
|
|
26
5
|
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_disabled_properties_border-size */
|
|
27
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_background */
|
|
28
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_border-color */
|
|
29
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_text */
|
|
30
6
|
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_error_properties_border-size */
|
|
31
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_error_properties_colors_background */
|
|
32
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_error_properties_colors_border-color */
|
|
33
|
-
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_error_properties_colors_text */
|
|
34
7
|
/* recursica-ignore: --recursica_ui-kit_components_textarea_variants_states_focus_properties_border-size */
|
|
35
|
-
|
|
36
|
-
/*
|
|
37
|
-
|
|
8
|
+
|
|
9
|
+
/* LAYOUT SPACING OVERRIDES:
|
|
10
|
+
- Sets the --form-control-margin-bottom spacing hook to map component-specific layout tokens. */
|
|
11
|
+
.layoutOverride {
|
|
12
|
+
--form-control-margin-bottom: var(
|
|
13
|
+
--recursica_ui-kit_components_textarea_variants_layouts_stacked_properties_top-bottom-margin
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.layoutOverride[data-form-layout="side-by-side"] {
|
|
18
|
+
--form-control-margin-bottom: var(
|
|
19
|
+
--recursica_ui-kit_components_textarea_variants_layouts_side-by-side_properties_top-bottom-margin
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* HARDCODED VALUES:
|
|
24
|
+
- border-width: 1px. Native geometric boundary for the input box.
|
|
25
|
+
- border-style: solid. Native structural rendering rule.
|
|
26
|
+
- outline: none. Bypassing browser focus rings to rely strictly on Recursica focus states natively.
|
|
27
|
+
- flex/layout: display: flex on the root wrapper safely encapsulating internal section rendering.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
.root {
|
|
31
|
+
display: flex;
|
|
32
|
+
position: relative;
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.input {
|
|
37
|
+
/* Structural Overrides */
|
|
38
|
+
width: 100%;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
margin: 0;
|
|
41
|
+
|
|
42
|
+
/* Sizing driven by rows token */
|
|
43
|
+
min-height: calc(
|
|
44
|
+
var(--recursica_ui-kit_components_textarea_properties_rows) *
|
|
45
|
+
var(--recursica_ui-kit_components_textarea_properties_text_line-height) +
|
|
46
|
+
2 *
|
|
47
|
+
var(--recursica_ui-kit_components_textarea_properties_vertical-padding) +
|
|
48
|
+
2px
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
/* Box Geometry */
|
|
52
|
+
padding-top: var(
|
|
53
|
+
--recursica_ui-kit_components_textarea_properties_vertical-padding
|
|
54
|
+
);
|
|
55
|
+
padding-bottom: var(
|
|
56
|
+
--recursica_ui-kit_components_textarea_properties_vertical-padding
|
|
57
|
+
);
|
|
58
|
+
padding-left: var(
|
|
59
|
+
--recursica_ui-kit_components_textarea_properties_horizontal-padding
|
|
60
|
+
);
|
|
61
|
+
padding-right: var(
|
|
62
|
+
--recursica_ui-kit_components_textarea_properties_horizontal-padding
|
|
63
|
+
);
|
|
64
|
+
border-radius: var(
|
|
65
|
+
--recursica_ui-kit_components_textarea_properties_border-radius
|
|
66
|
+
);
|
|
67
|
+
border-width: 1px;
|
|
68
|
+
border-style: solid;
|
|
69
|
+
|
|
70
|
+
/* Strict Typography Unification */
|
|
71
|
+
font-family: var(
|
|
72
|
+
--recursica_ui-kit_components_textarea_properties_text_font-family
|
|
73
|
+
);
|
|
74
|
+
font-size: var(
|
|
75
|
+
--recursica_ui-kit_components_textarea_properties_text_font-size
|
|
76
|
+
);
|
|
77
|
+
font-style: var(
|
|
78
|
+
--recursica_ui-kit_components_textarea_properties_text_font-style
|
|
79
|
+
);
|
|
80
|
+
font-weight: var(
|
|
81
|
+
--recursica_ui-kit_components_textarea_properties_text_font-weight
|
|
82
|
+
);
|
|
83
|
+
letter-spacing: var(
|
|
84
|
+
--recursica_ui-kit_components_textarea_properties_text_letter-spacing
|
|
85
|
+
);
|
|
86
|
+
line-height: var(
|
|
87
|
+
--recursica_ui-kit_components_textarea_properties_text_line-height
|
|
88
|
+
);
|
|
89
|
+
text-decoration: var(
|
|
90
|
+
--recursica_ui-kit_components_textarea_properties_text_text-decoration
|
|
91
|
+
);
|
|
92
|
+
text-transform: var(
|
|
93
|
+
--recursica_ui-kit_components_textarea_properties_text_text-transform
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
/* Base State Default Execution */
|
|
97
|
+
background-color: var(
|
|
98
|
+
--recursica_ui-kit_components_textarea_variants_states_default_properties_colors_background
|
|
99
|
+
);
|
|
100
|
+
border-color: var(
|
|
101
|
+
--recursica_ui-kit_components_textarea_variants_states_default_properties_colors_border-color
|
|
102
|
+
);
|
|
103
|
+
color: var(
|
|
104
|
+
--recursica_ui-kit_components_textarea_variants_states_default_properties_colors_text
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
outline: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.input::placeholder {
|
|
111
|
+
opacity: var(
|
|
112
|
+
--recursica_ui-kit_components_textarea_properties_placeholder-opacity
|
|
113
|
+
);
|
|
114
|
+
color: inherit;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* -------------------------------------
|
|
118
|
+
STATE CASCADE ARCHITECTURE
|
|
119
|
+
-------------------------------------- */
|
|
120
|
+
|
|
121
|
+
/* Focus State Mapping (Triggered internally via browser focus rules) */
|
|
122
|
+
.input:focus-within,
|
|
123
|
+
.input:focus {
|
|
124
|
+
border-color: var(
|
|
125
|
+
--recursica_ui-kit_components_textarea_variants_states_focus_properties_colors_border-color
|
|
126
|
+
);
|
|
127
|
+
background-color: var(
|
|
128
|
+
--recursica_ui-kit_components_textarea_variants_states_focus_properties_colors_background
|
|
129
|
+
);
|
|
130
|
+
color: var(
|
|
131
|
+
--recursica_ui-kit_components_textarea_variants_states_focus_properties_colors_text
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* Error State Mapping (Propagated strictly down from the wrapper DOM context) */
|
|
136
|
+
.root[data-error] .input {
|
|
137
|
+
border-color: var(
|
|
138
|
+
--recursica_ui-kit_components_textarea_variants_states_error_properties_colors_border-color
|
|
139
|
+
) !important;
|
|
140
|
+
background-color: var(
|
|
141
|
+
--recursica_ui-kit_components_textarea_variants_states_error_properties_colors_background
|
|
142
|
+
) !important;
|
|
143
|
+
color: var(
|
|
144
|
+
--recursica_ui-kit_components_textarea_variants_states_error_properties_colors_text
|
|
145
|
+
) !important;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Disabled State Mapping (Propagated strictly down from the wrapper DOM context) */
|
|
149
|
+
.root[data-disabled] .input {
|
|
150
|
+
border-color: var(
|
|
151
|
+
--recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_border-color
|
|
152
|
+
) !important;
|
|
153
|
+
background-color: var(
|
|
154
|
+
--recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_background
|
|
155
|
+
) !important;
|
|
156
|
+
color: var(
|
|
157
|
+
--recursica_ui-kit_components_textarea_variants_states_disabled_properties_colors_text
|
|
158
|
+
) !important;
|
|
159
|
+
cursor: not-allowed;
|
|
160
|
+
}
|
|
@@ -1,35 +1,94 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
3
|
import { TextArea } from "./TextArea";
|
|
3
|
-
import {
|
|
4
|
+
import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
type TextAreaStoryProps = React.ComponentProps<typeof TextArea>;
|
|
7
|
+
|
|
8
|
+
const meta: Meta<TextAreaStoryProps> = {
|
|
9
|
+
title: "UI-Kit/TextArea",
|
|
7
10
|
component: TextArea,
|
|
8
11
|
tags: ["autodocs"],
|
|
9
12
|
parameters: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component:
|
|
16
|
+
"TextArea provides a multi-line input field, mapping layout explicitly over the standardized FormControlWrapper.",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
label: "Description",
|
|
22
|
+
assistiveText: "Enter your full description here.",
|
|
23
|
+
disabled: false,
|
|
24
|
+
required: false,
|
|
25
|
+
readOnly: false,
|
|
26
|
+
autosize: false,
|
|
27
|
+
},
|
|
28
|
+
argTypes: {
|
|
29
|
+
disabled: {
|
|
30
|
+
control: "boolean",
|
|
31
|
+
},
|
|
32
|
+
...formControlArgTypes,
|
|
33
|
+
readOnly: {
|
|
34
|
+
control: "boolean",
|
|
35
|
+
},
|
|
36
|
+
autosize: {
|
|
37
|
+
control: "boolean",
|
|
38
|
+
},
|
|
39
|
+
minRows: {
|
|
40
|
+
control: "number",
|
|
41
|
+
},
|
|
42
|
+
maxRows: {
|
|
43
|
+
control: "number",
|
|
44
|
+
},
|
|
45
|
+
value: {
|
|
46
|
+
control: "text",
|
|
47
|
+
},
|
|
48
|
+
placeholder: {
|
|
49
|
+
control: "text",
|
|
26
50
|
},
|
|
27
51
|
},
|
|
28
52
|
};
|
|
29
53
|
|
|
30
54
|
export default meta;
|
|
31
|
-
|
|
55
|
+
|
|
56
|
+
type Story = StoryObj<TextAreaStoryProps>;
|
|
32
57
|
|
|
33
58
|
export const Default: Story = {
|
|
34
|
-
|
|
59
|
+
args: {
|
|
60
|
+
placeholder: "Type something long...",
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const Autosize: Story = {
|
|
65
|
+
args: {
|
|
66
|
+
label: "Auto-sizing TextArea",
|
|
67
|
+
autosize: true,
|
|
68
|
+
minRows: 2,
|
|
69
|
+
maxRows: 6,
|
|
70
|
+
placeholder: "Type multiple lines here. Watch it grow!",
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const StaticError: Story = {
|
|
75
|
+
args: {
|
|
76
|
+
error: "This field requires a detailed explanation.",
|
|
77
|
+
value: "Some bad input.",
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const StaticDisabled: Story = {
|
|
82
|
+
args: {
|
|
83
|
+
disabled: true,
|
|
84
|
+
value: "This content is locked.",
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const StaticReadOnly: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
label: "Read Only View",
|
|
91
|
+
readOnly: true,
|
|
92
|
+
value: "This text is safely frozen in read-only form.",
|
|
93
|
+
},
|
|
35
94
|
};
|