@recursica/mantine-adapter 0.7.0 → 0.9.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 +12 -0
- package/dist/mantine-adapter.cjs +1 -1
- package/dist/mantine-adapter.cjs.map +1 -1
- package/dist/mantine-adapter.css +1 -1
- package/dist/mantine-adapter.js +963 -639
- package/dist/mantine-adapter.js.map +1 -1
- package/dist/src/components/Container/Container.d.ts +14 -0
- package/dist/src/components/Dropdown/Dropdown.d.ts +10 -2
- package/dist/src/components/Flex/Flex.d.ts +17 -0
- package/dist/src/components/Group/Group.d.ts +17 -0
- package/dist/src/components/Stack/Stack.d.ts +15 -0
- package/dist/src/components/TextArea/TextArea.d.ts +14 -2
- package/dist/src/components/index.d.ts +6 -0
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.module.css +29 -8
- package/src/components/Checkbox/CheckboxGroup.tsx +1 -1
- package/src/components/Container/CONTAINER_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Container/Container.module.css +7 -0
- package/src/components/Container/Container.stories.tsx +102 -0
- package/src/components/Container/Container.tsx +63 -0
- package/src/components/Dropdown/DROPDOWN_IMPLEMENTATION_NOTES.md +7 -0
- package/src/components/Dropdown/Dropdown.module.css +272 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +77 -5
- package/src/components/Dropdown/Dropdown.tsx +171 -5
- package/src/components/Flex/FLEX_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Flex/Flex.module.css +7 -0
- package/src/components/Flex/Flex.stories.tsx +125 -0
- package/src/components/Flex/Flex.tsx +68 -0
- package/src/components/Group/GROUP_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Group/Group.module.css +7 -0
- package/src/components/Group/Group.stories.tsx +117 -0
- package/src/components/Group/Group.tsx +68 -0
- package/src/components/Stack/STACK_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Stack/Stack.module.css +7 -0
- package/src/components/Stack/Stack.stories.tsx +105 -0
- package/src/components/Stack/Stack.tsx +66 -0
- package/src/components/TextArea/TEXTAREA_IMPLEMENTATION_NOTES.md +7 -0
- package/src/components/TextArea/TextArea.module.css +225 -0
- package/src/components/TextArea/TextArea.stories.tsx +77 -5
- package/src/components/TextArea/TextArea.tsx +149 -5
- package/src/components/index.ts +6 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Flex as MantineFlex,
|
|
4
|
+
type FlexProps as MantineFlexProps,
|
|
5
|
+
} from "@mantine/core";
|
|
6
|
+
import {
|
|
7
|
+
filterStylingProps,
|
|
8
|
+
type RecursicaOverStyled,
|
|
9
|
+
type RecursicaSpacing,
|
|
10
|
+
} from "../../utils/filterStylingProps";
|
|
11
|
+
import styles from "./Flex.module.css";
|
|
12
|
+
|
|
13
|
+
export interface RecursicaFlexProps {
|
|
14
|
+
/**
|
|
15
|
+
* Children components inside the Flex container
|
|
16
|
+
*/
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
gap?: MantineFlexProps["gap"] | RecursicaSpacing;
|
|
19
|
+
rowGap?: MantineFlexProps["gap"] | RecursicaSpacing;
|
|
20
|
+
columnGap?: MantineFlexProps["gap"] | RecursicaSpacing;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Flex layout wrapper
|
|
25
|
+
*/
|
|
26
|
+
export type FlexProps = RecursicaOverStyled<
|
|
27
|
+
MantineFlexProps & RecursicaFlexProps
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
export const Flex = forwardRef<HTMLDivElement, FlexProps>(function Flex(
|
|
31
|
+
{ children, overStyled = false, gap = "rec-default", ...rest },
|
|
32
|
+
ref,
|
|
33
|
+
) {
|
|
34
|
+
const sanitizedProps = filterStylingProps({ ...rest, gap }, overStyled);
|
|
35
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
36
|
+
|
|
37
|
+
const mergedClassNames: Partial<Record<string, string>> = {
|
|
38
|
+
root: styles.root,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const classNamesProp = restRecord.classNames;
|
|
42
|
+
if (
|
|
43
|
+
classNamesProp &&
|
|
44
|
+
typeof classNamesProp === "object" &&
|
|
45
|
+
!Array.isArray(classNamesProp)
|
|
46
|
+
) {
|
|
47
|
+
const o = classNamesProp as Partial<Record<string, string>>;
|
|
48
|
+
mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const classNameProp = restRecord.className as string | undefined;
|
|
52
|
+
const finalClass = classNameProp
|
|
53
|
+
? `${styles.root} ${classNameProp}`
|
|
54
|
+
: styles.root;
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<MantineFlex
|
|
58
|
+
ref={ref}
|
|
59
|
+
className={finalClass}
|
|
60
|
+
classNames={mergedClassNames}
|
|
61
|
+
{...sanitizedProps}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
</MantineFlex>
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
Flex.displayName = "Flex";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# Group Implementation Notes
|
|
2
|
+
|
|
3
|
+
The `Group` component is a generic flex layout wrapper mapped directly to Mantine's `Group`.
|
|
4
|
+
It currently does not require any custom logical layouts or CSS workarounds since it serves only to organize layout structure, and doesn't enforce any strict design-system token styling itself. All gap, align, wrap, and justify properties pass safely through via the `filterStylingProps` layout-property allowance.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { Group } from "./Group";
|
|
4
|
+
import { Button } from "../Button";
|
|
5
|
+
import { Text } from "../Text/Text";
|
|
6
|
+
|
|
7
|
+
type GroupStoryProps = React.ComponentProps<typeof Group>;
|
|
8
|
+
|
|
9
|
+
const meta: Meta<GroupStoryProps> = {
|
|
10
|
+
title: "UI-Kit/Group",
|
|
11
|
+
component: Group,
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
parameters: {
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component:
|
|
17
|
+
"Group is a flex horizontal layout container that maps directly to Mantine's Group component allowing safe layout property passing.",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
gap: "rec-default",
|
|
23
|
+
align: "center",
|
|
24
|
+
justify: "flex-start",
|
|
25
|
+
wrap: "wrap",
|
|
26
|
+
},
|
|
27
|
+
argTypes: {
|
|
28
|
+
gap: {
|
|
29
|
+
control: "select",
|
|
30
|
+
options: [
|
|
31
|
+
"rec-none",
|
|
32
|
+
"rec-sm",
|
|
33
|
+
"rec-default",
|
|
34
|
+
"rec-md",
|
|
35
|
+
"rec-lg",
|
|
36
|
+
"rec-xl",
|
|
37
|
+
"rec-2xl",
|
|
38
|
+
"xs",
|
|
39
|
+
"sm",
|
|
40
|
+
"md",
|
|
41
|
+
"lg",
|
|
42
|
+
"xl",
|
|
43
|
+
],
|
|
44
|
+
description: "Gap between elements",
|
|
45
|
+
},
|
|
46
|
+
align: {
|
|
47
|
+
control: "select",
|
|
48
|
+
options: ["flex-start", "center", "flex-end", "stretch"],
|
|
49
|
+
description: "Align-items property",
|
|
50
|
+
},
|
|
51
|
+
justify: {
|
|
52
|
+
control: "select",
|
|
53
|
+
options: [
|
|
54
|
+
"flex-start",
|
|
55
|
+
"center",
|
|
56
|
+
"flex-end",
|
|
57
|
+
"space-between",
|
|
58
|
+
"space-around",
|
|
59
|
+
],
|
|
60
|
+
description: "Justify-content property",
|
|
61
|
+
},
|
|
62
|
+
wrap: {
|
|
63
|
+
control: "select",
|
|
64
|
+
options: ["wrap", "nowrap", "wrap-reverse"],
|
|
65
|
+
description: "Flex-wrap property",
|
|
66
|
+
},
|
|
67
|
+
defaultChecked: {
|
|
68
|
+
table: { disable: true },
|
|
69
|
+
},
|
|
70
|
+
rowGap: {
|
|
71
|
+
table: { disable: true },
|
|
72
|
+
},
|
|
73
|
+
columnGap: {
|
|
74
|
+
table: { disable: true },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default meta;
|
|
80
|
+
|
|
81
|
+
type Story = StoryObj<GroupStoryProps>;
|
|
82
|
+
|
|
83
|
+
export const Default: Story = {
|
|
84
|
+
render: (args) => (
|
|
85
|
+
<Group {...args}>
|
|
86
|
+
<Button variant="solid">Primary</Button>
|
|
87
|
+
<Button variant="outline">Secondary</Button>
|
|
88
|
+
<Text>Text element within Group</Text>
|
|
89
|
+
</Group>
|
|
90
|
+
),
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const StaticGapSmall: Story = {
|
|
94
|
+
args: {
|
|
95
|
+
gap: "rec-sm",
|
|
96
|
+
},
|
|
97
|
+
render: (args) => (
|
|
98
|
+
<Group {...args}>
|
|
99
|
+
<Button variant="solid">Item 1</Button>
|
|
100
|
+
<Button variant="solid">Item 2</Button>
|
|
101
|
+
<Button variant="solid">Item 3</Button>
|
|
102
|
+
</Group>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const StaticGapLarge: Story = {
|
|
107
|
+
args: {
|
|
108
|
+
gap: "rec-xl",
|
|
109
|
+
},
|
|
110
|
+
render: (args) => (
|
|
111
|
+
<Group {...args}>
|
|
112
|
+
<Button variant="solid">Item 1</Button>
|
|
113
|
+
<Button variant="solid">Item 2</Button>
|
|
114
|
+
<Button variant="solid">Item 3</Button>
|
|
115
|
+
</Group>
|
|
116
|
+
),
|
|
117
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Group as MantineGroup,
|
|
4
|
+
type GroupProps as MantineGroupProps,
|
|
5
|
+
} from "@mantine/core";
|
|
6
|
+
import {
|
|
7
|
+
filterStylingProps,
|
|
8
|
+
type RecursicaOverStyled,
|
|
9
|
+
type RecursicaSpacing,
|
|
10
|
+
} from "../../utils/filterStylingProps";
|
|
11
|
+
import styles from "./Group.module.css";
|
|
12
|
+
|
|
13
|
+
export interface RecursicaGroupProps {
|
|
14
|
+
/**
|
|
15
|
+
* Children components inside the group
|
|
16
|
+
*/
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
gap?: MantineGroupProps["gap"] | RecursicaSpacing;
|
|
19
|
+
rowGap?: MantineGroupProps["gap"] | RecursicaSpacing;
|
|
20
|
+
columnGap?: MantineGroupProps["gap"] | RecursicaSpacing;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Group flex layout wrapper
|
|
25
|
+
*/
|
|
26
|
+
export type GroupProps = RecursicaOverStyled<
|
|
27
|
+
MantineGroupProps & RecursicaGroupProps
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
export const Group = forwardRef<HTMLDivElement, GroupProps>(function Group(
|
|
31
|
+
{ children, overStyled = false, gap = "rec-default", ...rest },
|
|
32
|
+
ref,
|
|
33
|
+
) {
|
|
34
|
+
const sanitizedProps = filterStylingProps({ ...rest, gap }, overStyled);
|
|
35
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
36
|
+
|
|
37
|
+
const mergedClassNames: Partial<Record<string, string>> = {
|
|
38
|
+
root: styles.root,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const classNamesProp = restRecord.classNames;
|
|
42
|
+
if (
|
|
43
|
+
classNamesProp &&
|
|
44
|
+
typeof classNamesProp === "object" &&
|
|
45
|
+
!Array.isArray(classNamesProp)
|
|
46
|
+
) {
|
|
47
|
+
const o = classNamesProp as Partial<Record<string, string>>;
|
|
48
|
+
mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const classNameProp = restRecord.className as string | undefined;
|
|
52
|
+
const finalClass = classNameProp
|
|
53
|
+
? `${styles.root} ${classNameProp}`
|
|
54
|
+
: styles.root;
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<MantineGroup
|
|
58
|
+
ref={ref}
|
|
59
|
+
className={finalClass}
|
|
60
|
+
classNames={mergedClassNames}
|
|
61
|
+
{...sanitizedProps}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
</MantineGroup>
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
Group.displayName = "Group";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# Stack Implementation Notes
|
|
2
|
+
|
|
3
|
+
The `Stack` component is a generic flex layout wrapper mapped directly to Mantine's `Stack`.
|
|
4
|
+
It currently does not require any custom logical layouts or CSS workarounds since it serves only to organize layout structure, and doesn't enforce any strict design-system token styling itself. All gap, align, and justify properties pass safely through via the `filterStylingProps` layout-property allowance.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { Stack } from "./Stack";
|
|
4
|
+
import { Button } from "../Button";
|
|
5
|
+
import { Text } from "../Text/Text";
|
|
6
|
+
|
|
7
|
+
type StackStoryProps = React.ComponentProps<typeof Stack>;
|
|
8
|
+
|
|
9
|
+
const meta: Meta<StackStoryProps> = {
|
|
10
|
+
title: "UI-Kit/Stack",
|
|
11
|
+
component: Stack,
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
parameters: {
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component:
|
|
17
|
+
"Stack is a flex vertical layout container that maps directly to Mantine's Stack component allowing safe layout property passing.",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
gap: "rec-default",
|
|
23
|
+
align: "stretch",
|
|
24
|
+
justify: "flex-start",
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
gap: {
|
|
28
|
+
control: "select",
|
|
29
|
+
options: [
|
|
30
|
+
"rec-none",
|
|
31
|
+
"rec-sm",
|
|
32
|
+
"rec-default",
|
|
33
|
+
"rec-md",
|
|
34
|
+
"rec-lg",
|
|
35
|
+
"rec-xl",
|
|
36
|
+
"rec-2xl",
|
|
37
|
+
"xs",
|
|
38
|
+
"sm",
|
|
39
|
+
"md",
|
|
40
|
+
"lg",
|
|
41
|
+
"xl",
|
|
42
|
+
],
|
|
43
|
+
description: "Gap between elements",
|
|
44
|
+
},
|
|
45
|
+
align: {
|
|
46
|
+
control: "select",
|
|
47
|
+
options: ["flex-start", "center", "flex-end", "stretch"],
|
|
48
|
+
description: "Align-items property",
|
|
49
|
+
},
|
|
50
|
+
justify: {
|
|
51
|
+
control: "select",
|
|
52
|
+
options: [
|
|
53
|
+
"flex-start",
|
|
54
|
+
"center",
|
|
55
|
+
"flex-end",
|
|
56
|
+
"space-between",
|
|
57
|
+
"space-around",
|
|
58
|
+
],
|
|
59
|
+
description: "Justify-content property",
|
|
60
|
+
},
|
|
61
|
+
defaultChecked: {
|
|
62
|
+
table: { disable: true },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default meta;
|
|
68
|
+
|
|
69
|
+
type Story = StoryObj<StackStoryProps>;
|
|
70
|
+
|
|
71
|
+
export const Default: Story = {
|
|
72
|
+
render: (args) => (
|
|
73
|
+
<Stack {...args}>
|
|
74
|
+
<Button variant="solid">Primary Block</Button>
|
|
75
|
+
<Button variant="outline">Secondary Block</Button>
|
|
76
|
+
<Text>Text element within Stack</Text>
|
|
77
|
+
</Stack>
|
|
78
|
+
),
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const StaticGapSmall: Story = {
|
|
82
|
+
args: {
|
|
83
|
+
gap: "rec-sm",
|
|
84
|
+
},
|
|
85
|
+
render: (args) => (
|
|
86
|
+
<Stack {...args}>
|
|
87
|
+
<Button variant="solid">Item 1</Button>
|
|
88
|
+
<Button variant="solid">Item 2</Button>
|
|
89
|
+
<Button variant="solid">Item 3</Button>
|
|
90
|
+
</Stack>
|
|
91
|
+
),
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const StaticGapLarge: Story = {
|
|
95
|
+
args: {
|
|
96
|
+
gap: "rec-xl",
|
|
97
|
+
},
|
|
98
|
+
render: (args) => (
|
|
99
|
+
<Stack {...args}>
|
|
100
|
+
<Button variant="solid">Item 1</Button>
|
|
101
|
+
<Button variant="solid">Item 2</Button>
|
|
102
|
+
<Button variant="solid">Item 3</Button>
|
|
103
|
+
</Stack>
|
|
104
|
+
),
|
|
105
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Stack as MantineStack,
|
|
4
|
+
type StackProps as MantineStackProps,
|
|
5
|
+
} from "@mantine/core";
|
|
6
|
+
import {
|
|
7
|
+
filterStylingProps,
|
|
8
|
+
type RecursicaOverStyled,
|
|
9
|
+
type RecursicaSpacing,
|
|
10
|
+
} from "../../utils/filterStylingProps";
|
|
11
|
+
import styles from "./Stack.module.css";
|
|
12
|
+
|
|
13
|
+
export interface RecursicaStackProps {
|
|
14
|
+
/**
|
|
15
|
+
* Children components inside the stack
|
|
16
|
+
*/
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
gap?: MantineStackProps["gap"] | RecursicaSpacing;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Stack flex layout wrapper
|
|
23
|
+
*/
|
|
24
|
+
export type StackProps = RecursicaOverStyled<
|
|
25
|
+
MantineStackProps & RecursicaStackProps
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
export const Stack = forwardRef<HTMLDivElement, StackProps>(function Stack(
|
|
29
|
+
{ children, overStyled = false, gap = "rec-default", ...rest },
|
|
30
|
+
ref,
|
|
31
|
+
) {
|
|
32
|
+
const sanitizedProps = filterStylingProps({ ...rest, gap }, overStyled);
|
|
33
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
34
|
+
|
|
35
|
+
const mergedClassNames: Partial<Record<string, string>> = {
|
|
36
|
+
root: styles.root,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const classNamesProp = restRecord.classNames;
|
|
40
|
+
if (
|
|
41
|
+
classNamesProp &&
|
|
42
|
+
typeof classNamesProp === "object" &&
|
|
43
|
+
!Array.isArray(classNamesProp)
|
|
44
|
+
) {
|
|
45
|
+
const o = classNamesProp as Partial<Record<string, string>>;
|
|
46
|
+
mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const classNameProp = restRecord.className as string | undefined;
|
|
50
|
+
const finalClass = classNameProp
|
|
51
|
+
? `${styles.root} ${classNameProp}`
|
|
52
|
+
: styles.root;
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<MantineStack
|
|
56
|
+
ref={ref}
|
|
57
|
+
className={finalClass}
|
|
58
|
+
classNames={mergedClassNames}
|
|
59
|
+
{...sanitizedProps}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
</MantineStack>
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
Stack.displayName = "Stack";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# TextArea Implementation Notes
|
|
2
|
+
|
|
3
|
+
The `TextArea` component is mapped explicitly to Mantine's `<Textarea>` following the same strict encapsulation rules as `TextField`.
|
|
4
|
+
|
|
5
|
+
1. **Naked Primitive Mapping:** Mantine's `Textarea` natively executes macro-label generation. To decouple it, we explicitly disable internal labels (`label={undefined}`) and inject it purely inside our generic `FormControlWrapper`.
|
|
6
|
+
2. **Text Field Token Re-Use:** Because text areas fundamentally share the same box-geometry, text, and state definitions as single-line inputs, it strictly implements the `--recursica_ui-kit_components_text-field_...` variables natively.
|
|
7
|
+
3. **Autosize Handling:** The component supports Mantine's raw `autosize`, `minRows`, and `maxRows` parameters out of the box dynamically via property passthrough.
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/* HARDCODED VALUES:
|
|
2
|
+
- border-width: 1px. Native geometric boundary for the input box.
|
|
3
|
+
- border-style: solid. Native structural rendering rule.
|
|
4
|
+
- outline: none. Bypassing browser focus rings to rely strictly on Recursica focus states natively.
|
|
5
|
+
- flex/layout: display: flex on the root wrapper safely encapsulating internal section rendering.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.root {
|
|
9
|
+
display: flex;
|
|
10
|
+
position: relative;
|
|
11
|
+
width: 100%;
|
|
12
|
+
min-height: var(
|
|
13
|
+
--recursica_ui-kit_components_text-field_properties_min-height
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
/* Override Mantine native Input variables governing section spacing padding mathematics safely */
|
|
17
|
+
--input-left-section-size: calc(
|
|
18
|
+
var(--recursica_ui-kit_components_text-field_properties_icon-size) +
|
|
19
|
+
(
|
|
20
|
+
var(
|
|
21
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
22
|
+
) *
|
|
23
|
+
2
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
--input-right-section-size: calc(
|
|
27
|
+
var(--recursica_ui-kit_components_text-field_properties_icon-size) +
|
|
28
|
+
(
|
|
29
|
+
var(
|
|
30
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
31
|
+
) *
|
|
32
|
+
2
|
|
33
|
+
)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.input {
|
|
38
|
+
/* Structural Overrides */
|
|
39
|
+
width: 100%;
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
margin: 0;
|
|
42
|
+
|
|
43
|
+
/* Box Geometry */
|
|
44
|
+
min-height: var(
|
|
45
|
+
--recursica_ui-kit_components_text-field_properties_min-height
|
|
46
|
+
);
|
|
47
|
+
padding-top: var(
|
|
48
|
+
--recursica_ui-kit_components_text-field_properties_vertical-padding
|
|
49
|
+
);
|
|
50
|
+
padding-bottom: var(
|
|
51
|
+
--recursica_ui-kit_components_text-field_properties_vertical-padding
|
|
52
|
+
);
|
|
53
|
+
padding-left: var(
|
|
54
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
55
|
+
);
|
|
56
|
+
padding-right: var(
|
|
57
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
58
|
+
);
|
|
59
|
+
border-radius: var(
|
|
60
|
+
--recursica_ui-kit_components_text-field_properties_border-radius
|
|
61
|
+
);
|
|
62
|
+
border-width: 1px;
|
|
63
|
+
border-style: solid;
|
|
64
|
+
|
|
65
|
+
/* Strict Typography Unification */
|
|
66
|
+
font-family: var(
|
|
67
|
+
--recursica_ui-kit_components_text-field_properties_text_font-family
|
|
68
|
+
);
|
|
69
|
+
font-size: var(
|
|
70
|
+
--recursica_ui-kit_components_text-field_properties_text_font-size
|
|
71
|
+
);
|
|
72
|
+
font-style: var(
|
|
73
|
+
--recursica_ui-kit_components_text-field_properties_text_font-style
|
|
74
|
+
);
|
|
75
|
+
font-weight: var(
|
|
76
|
+
--recursica_ui-kit_components_text-field_properties_text_font-weight
|
|
77
|
+
);
|
|
78
|
+
letter-spacing: var(
|
|
79
|
+
--recursica_ui-kit_components_text-field_properties_text_letter-spacing
|
|
80
|
+
);
|
|
81
|
+
line-height: var(
|
|
82
|
+
--recursica_ui-kit_components_text-field_properties_text_line-height
|
|
83
|
+
);
|
|
84
|
+
text-decoration: var(
|
|
85
|
+
--recursica_ui-kit_components_text-field_properties_text_text-decoration
|
|
86
|
+
);
|
|
87
|
+
text-transform: var(
|
|
88
|
+
--recursica_ui-kit_components_text-field_properties_text_text-transform
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
/* Base State Default Execution */
|
|
92
|
+
background-color: var(
|
|
93
|
+
--recursica_ui-kit_components_text-field_variants_states_default_properties_colors_background
|
|
94
|
+
);
|
|
95
|
+
border-color: var(
|
|
96
|
+
--recursica_ui-kit_components_text-field_variants_states_default_properties_colors_border-color
|
|
97
|
+
);
|
|
98
|
+
color: var(
|
|
99
|
+
--recursica_ui-kit_components_text-field_variants_states_default_properties_colors_text
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
outline: none;
|
|
103
|
+
transition:
|
|
104
|
+
border-color 0.15s ease,
|
|
105
|
+
background-color 0.15s ease;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.input::placeholder {
|
|
109
|
+
opacity: var(
|
|
110
|
+
--recursica_ui-kit_components_text-field_properties_placeholder-opacity
|
|
111
|
+
);
|
|
112
|
+
color: inherit;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* Dynamic Padding Overrides */
|
|
116
|
+
.root[data-with-left-section] .input {
|
|
117
|
+
padding-left: var(--input-left-section-size);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.root[data-with-right-section] .input {
|
|
121
|
+
padding-right: var(--input-right-section-size);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Flexible End-Caps (Icons, actions) */
|
|
125
|
+
.section {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
height: 100%;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.section :global(svg) {
|
|
133
|
+
width: var(--recursica_ui-kit_components_text-field_properties_icon-size);
|
|
134
|
+
height: var(--recursica_ui-kit_components_text-field_properties_icon-size);
|
|
135
|
+
color: var(
|
|
136
|
+
--recursica_ui-kit_components_text-field_variants_states_default_properties_colors_leading-icon
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.section[data-position="right"] :global(svg) {
|
|
141
|
+
color: var(
|
|
142
|
+
--recursica_ui-kit_components_text-field_variants_states_default_properties_colors_trailing-icon
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* -------------------------------------
|
|
147
|
+
STATE CASCADE ARCHITECTURE
|
|
148
|
+
-------------------------------------- */
|
|
149
|
+
|
|
150
|
+
/* Focus State Mapping (Triggered internally via browser pseudo-pseudo-class) */
|
|
151
|
+
.input:focus-within,
|
|
152
|
+
.input:focus {
|
|
153
|
+
border-color: var(
|
|
154
|
+
--recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_border-color
|
|
155
|
+
);
|
|
156
|
+
background-color: var(
|
|
157
|
+
--recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_background
|
|
158
|
+
);
|
|
159
|
+
color: var(
|
|
160
|
+
--recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_text
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.root:focus-within .section[data-position="left"] :global(svg) {
|
|
165
|
+
color: var(
|
|
166
|
+
--recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_leading-icon
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.root:focus-within .section[data-position="right"] :global(svg) {
|
|
171
|
+
color: var(
|
|
172
|
+
--recursica_ui-kit_components_text-field_variants_states_focus_properties_colors_trailing-icon
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* Error State Mapping (Propagated strictly down from the wrapper DOM context) */
|
|
177
|
+
.root[data-error] .input {
|
|
178
|
+
border-color: var(
|
|
179
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_border-color
|
|
180
|
+
) !important;
|
|
181
|
+
background-color: var(
|
|
182
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_background
|
|
183
|
+
) !important;
|
|
184
|
+
color: var(
|
|
185
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_text
|
|
186
|
+
) !important;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.root[data-error] .section[data-position="left"] :global(svg) {
|
|
190
|
+
color: var(
|
|
191
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_leading-icon
|
|
192
|
+
) !important;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.root[data-error] .section[data-position="right"] :global(svg) {
|
|
196
|
+
color: var(
|
|
197
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_trailing-icon
|
|
198
|
+
) !important;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* Disabled State Mapping (Propagated strictly down from the wrapper DOM context) */
|
|
202
|
+
.root[data-disabled] .input {
|
|
203
|
+
border-color: var(
|
|
204
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_border-color
|
|
205
|
+
) !important;
|
|
206
|
+
background-color: var(
|
|
207
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_background
|
|
208
|
+
) !important;
|
|
209
|
+
color: var(
|
|
210
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_text
|
|
211
|
+
) !important;
|
|
212
|
+
cursor: not-allowed;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.root[data-disabled] .section[data-position="left"] :global(svg) {
|
|
216
|
+
color: var(
|
|
217
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_leading-icon
|
|
218
|
+
) !important;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.root[data-disabled] .section[data-position="right"] :global(svg) {
|
|
222
|
+
color: var(
|
|
223
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_trailing-icon
|
|
224
|
+
) !important;
|
|
225
|
+
}
|