@recursica/mui-adapter 0.5.0 → 0.7.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/ARCHITECTURE.md +15 -0
- package/CHANGELOG.md +15 -0
- package/SETUP.md +77 -0
- package/USAGE.md +55 -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 +6863 -205
- package/dist/mui-adapter.js.map +1 -1
- package/dist/src/components/Accordion/Accordion.d.ts +43 -2
- package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +6 -2
- package/dist/src/components/Autocomplete/Autocomplete.d.ts +12 -2
- package/dist/src/components/Avatar/Avatar.d.ts +10 -3
- package/dist/src/components/Badge/Badge.d.ts +10 -3
- package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +9 -3
- package/dist/src/components/Button/Button.d.ts +2 -17
- package/dist/src/components/Card/Card.d.ts +38 -3
- package/dist/src/components/Checkbox/Checkbox.d.ts +13 -2
- package/dist/src/components/Checkbox/CheckboxGroup.d.ts +18 -0
- package/dist/src/components/Checkbox/index.d.ts +5 -1
- package/dist/src/components/Chip/Chip.d.ts +9 -2
- package/dist/src/components/Container/Container.d.ts +1 -5
- package/dist/src/components/DatePicker/DatePicker.d.ts +2 -1
- package/dist/src/components/Dropdown/Dropdown.d.ts +12 -2
- package/dist/src/components/Flex/Flex.d.ts +2 -22
- package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +5 -2
- package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +9 -2
- package/dist/src/components/Group/Group.d.ts +2 -7
- package/dist/src/components/HoverCard/HoverCard.d.ts +28 -2
- package/dist/src/components/Label/Label.d.ts +6 -2
- package/dist/src/components/Link/Link.d.ts +2 -6
- package/dist/src/components/Loader/Loader.d.ts +2 -7
- package/dist/src/components/Menu/Menu.d.ts +25 -3
- package/dist/src/components/Modal/Modal.d.ts +37 -2
- package/dist/src/components/NumberInput/NumberInput.d.ts +12 -2
- package/dist/src/components/Pagination/Pagination.d.ts +12 -3
- package/dist/src/components/Pagination/Pagination.icons.d.ts +8 -0
- package/dist/src/components/Panel/Panel.d.ts +52 -3
- package/dist/src/components/Radio/Radio.d.ts +13 -3
- package/dist/src/components/Radio/RadioGroup.d.ts +9 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyBooleanField.d.ts +5 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +4 -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 +21 -3
- package/dist/src/components/Slider/Slider.d.ts +18 -2
- package/dist/src/components/Stack/Stack.d.ts +2 -5
- package/dist/src/components/Stepper/Stepper.d.ts +41 -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/Table/Table.d.ts +2 -1
- package/dist/src/components/Tabs/Tabs.d.ts +20 -3
- package/dist/src/components/Text/Text.d.ts +2 -16
- package/dist/src/components/TextArea/TextArea.d.ts +12 -2
- package/dist/src/components/TextField/TextField.d.ts +12 -2
- package/dist/src/components/TimePicker/TimePicker.d.ts +2 -1
- package/dist/src/components/Timeline/Timeline.d.ts +15 -2
- package/dist/src/components/Timeline/TimelineItem.d.ts +18 -0
- package/dist/src/components/Title/Title.d.ts +2 -15
- package/dist/src/components/Toast/Toast.d.ts +20 -2
- package/dist/src/components/Tooltip/Tooltip.d.ts +28 -3
- package/dist/src/components/TransferList/TransferList.d.ts +2 -1
- package/dist/src/components/Typography/Typography.d.ts +1 -1
- package/dist/src/utils/RequireAccessibleLabel.d.ts +1 -18
- package/dist/src/utils/filterStylingProps.d.ts +1 -11
- package/llms.txt +16 -0
- package/package.json +14 -3
- package/src/components/Accordion/Accordion.module.css +294 -56
- package/src/components/Accordion/Accordion.stories.tsx +131 -21
- package/src/components/Accordion/Accordion.tsx +260 -5
- package/src/components/AssistiveElement/AssistiveElement.module.css +114 -20
- package/src/components/AssistiveElement/AssistiveElement.stories.tsx +60 -20
- package/src/components/AssistiveElement/AssistiveElement.tsx +81 -5
- package/src/components/Autocomplete/Autocomplete.module.css +319 -42
- package/src/components/Autocomplete/Autocomplete.stories.tsx +175 -23
- package/src/components/Autocomplete/Autocomplete.tsx +181 -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 +99 -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 +67 -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 +59 -6
- package/src/components/Button/Button.module.css +19 -61
- package/src/components/Button/Button.stories.tsx +24 -23
- package/src/components/Button/Button.tsx +7 -18
- package/src/components/Card/Card.module.css +154 -38
- package/src/components/Card/Card.stories.tsx +117 -19
- package/src/components/Card/Card.tsx +181 -5
- package/src/components/Checkbox/Checkbox.module.css +249 -39
- package/src/components/Checkbox/Checkbox.stories.tsx +81 -19
- package/src/components/Checkbox/Checkbox.tsx +246 -5
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +137 -0
- package/src/components/Checkbox/index.ts +6 -1
- package/src/components/Chip/Chip.module.css +246 -43
- package/src/components/Chip/Chip.stories.tsx +101 -21
- package/src/components/Chip/Chip.tsx +136 -6
- package/src/components/Container/Container.stories.tsx +103 -20
- package/src/components/Container/Container.tsx +1 -13
- package/src/components/DatePicker/DatePicker.stories.tsx +125 -19
- package/src/components/DatePicker/DatePicker.tsx +3 -1
- package/src/components/Dropdown/Dropdown.module.css +291 -41
- package/src/components/Dropdown/Dropdown.stories.tsx +80 -21
- package/src/components/Dropdown/Dropdown.tsx +180 -6
- package/src/components/FileInput/FileInput.stories.tsx +2 -19
- package/src/components/FileUpload/FileUpload.stories.tsx +2 -19
- package/src/components/Flex/Flex.stories.tsx +113 -20
- package/src/components/Flex/Flex.tsx +16 -26
- package/src/components/FormControlLayout/FormControlLayout.module.css +92 -0
- package/src/components/FormControlLayout/FormControlLayout.stories.tsx +67 -20
- package/src/components/FormControlLayout/FormControlLayout.tsx +69 -4
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +87 -0
- package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +116 -22
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +126 -6
- package/src/components/Group/Group.stories.tsx +6 -30
- package/src/components/Group/Group.tsx +14 -9
- package/src/components/HoverCard/HoverCard.module.css +90 -22
- package/src/components/HoverCard/HoverCard.stories.tsx +158 -21
- package/src/components/HoverCard/HoverCard.tsx +147 -5
- package/src/components/Label/Label.module.css +140 -35
- package/src/components/Label/Label.stories.tsx +108 -21
- package/src/components/Label/Label.tsx +82 -5
- package/src/components/Link/Link.module.css +4 -3
- package/src/components/Link/Link.stories.tsx +2 -8
- package/src/components/Link/Link.tsx +1 -5
- package/src/components/Loader/Loader.module.css +1 -2
- package/src/components/Loader/Loader.tsx +1 -7
- package/src/components/Menu/IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Menu/Menu.module.css +285 -51
- package/src/components/Menu/Menu.stories.tsx +229 -25
- package/src/components/Menu/Menu.tsx +73 -6
- package/src/components/Modal/Modal.module.css +171 -35
- package/src/components/Modal/Modal.stories.tsx +66 -22
- package/src/components/Modal/Modal.tsx +215 -5
- package/src/components/NumberInput/NumberInput.module.css +276 -42
- package/src/components/NumberInput/NumberInput.stories.tsx +83 -20
- package/src/components/NumberInput/NumberInput.tsx +136 -6
- package/src/components/Pagination/IMPLEMENTATION_NOTES.md +3 -0
- package/src/components/Pagination/Pagination.icons.tsx +66 -0
- package/src/components/Pagination/Pagination.module.css +234 -20
- package/src/components/Pagination/Pagination.stories.tsx +34 -21
- package/src/components/Pagination/Pagination.tsx +74 -6
- package/src/components/Panel/Panel.module.css +206 -38
- package/src/components/Panel/Panel.stories.tsx +214 -22
- package/src/components/Panel/Panel.tsx +130 -5
- package/src/components/Radio/Radio.module.css +235 -37
- package/src/components/Radio/Radio.stories.tsx +77 -19
- package/src/components/Radio/Radio.tsx +210 -5
- package/src/components/Radio/RadioGroup.stories.tsx +117 -0
- package/src/components/Radio/RadioGroup.tsx +125 -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 +147 -19
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +105 -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 +179 -47
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +102 -20
- package/src/components/SegmentedControl/SegmentedControl.tsx +140 -6
- package/src/components/Slider/Slider.module.css +539 -86
- package/src/components/Slider/Slider.stories.tsx +157 -19
- package/src/components/Slider/Slider.tsx +283 -5
- package/src/components/Stack/Stack.stories.tsx +4 -25
- package/src/components/Stack/Stack.tsx +1 -5
- package/src/components/Stepper/IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Stepper/Stepper.module.css +410 -71
- package/src/components/Stepper/Stepper.stories.tsx +146 -20
- package/src/components/Stepper/Stepper.tsx +147 -6
- package/src/components/Switch/Switch.module.css +259 -39
- package/src/components/Switch/Switch.stories.tsx +98 -19
- package/src/components/Switch/Switch.tsx +200 -6
- package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
- package/src/components/Switch/SwitchGroup.tsx +120 -0
- package/src/components/Table/Table.stories.tsx +1 -19
- package/src/components/Table/Table.tsx +3 -1
- package/src/components/Tabs/IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Tabs/Tabs.module.css +422 -79
- package/src/components/Tabs/Tabs.stories.tsx +156 -20
- package/src/components/Tabs/Tabs.tsx +86 -6
- package/src/components/Text/Text.stories.tsx +5 -17
- package/src/components/Text/Text.tsx +1 -15
- package/src/components/TextArea/TextArea.module.css +155 -32
- package/src/components/TextArea/TextArea.stories.tsx +80 -21
- package/src/components/TextArea/TextArea.tsx +146 -6
- package/src/components/TextField/TextField.module.css +261 -42
- package/src/components/TextField/TextField.stories.tsx +147 -20
- package/src/components/TextField/TextField.tsx +169 -6
- package/src/components/TimePicker/TimePicker.stories.tsx +2 -19
- package/src/components/TimePicker/TimePicker.tsx +3 -1
- package/src/components/Timeline/Timeline.module.css +365 -76
- package/src/components/Timeline/Timeline.stories.tsx +114 -21
- package/src/components/Timeline/Timeline.tsx +83 -5
- package/src/components/Timeline/TimelineItem.tsx +90 -0
- package/src/components/Title/Title.stories.tsx +0 -18
- package/src/components/Title/Title.tsx +1 -7
- package/src/components/Toast/Toast.module.css +166 -28
- package/src/components/Toast/Toast.stories.tsx +54 -22
- package/src/components/Toast/Toast.tsx +124 -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 +88 -5
- package/src/components/TransferList/TransferList.stories.tsx +1 -19
- package/src/components/TransferList/TransferList.tsx +3 -1
- package/src/utils/RequireAccessibleLabel.ts +1 -12
- package/src/utils/filterStylingProps.ts +7 -20
|
@@ -1,8 +1,183 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Autocomplete as MuiAutocomplete,
|
|
4
|
+
type AutocompleteProps as MuiAutocompleteProps,
|
|
5
|
+
TextField as MuiTextField,
|
|
6
|
+
// removed InputWrapperProps
|
|
7
|
+
} from "@mui/material";
|
|
8
|
+
import { type ReadOnlyControlProps } from "@recursica/adapter-common";
|
|
9
|
+
import {
|
|
10
|
+
filterStylingProps,
|
|
11
|
+
type RecursicaOverStyled,
|
|
12
|
+
} from "../../utils/filterStylingProps";
|
|
13
|
+
import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/FormControlWrapper";
|
|
14
|
+
import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
|
|
15
|
+
import styles from "./Autocomplete.module.css";
|
|
3
16
|
|
|
4
|
-
|
|
17
|
+
import { type RecursicaAutocompleteProps as BaseRecursicaAutocompleteProps } from "@recursica/adapter-common";
|
|
5
18
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
export interface RecursicaAutocompleteProps
|
|
20
|
+
extends Omit<
|
|
21
|
+
MuiAutocompleteProps<any, any, any, any, "div">,
|
|
22
|
+
| "variant"
|
|
23
|
+
| "size"
|
|
24
|
+
| "wrapperProps"
|
|
25
|
+
| "radius"
|
|
26
|
+
| "renderInput"
|
|
27
|
+
| "classes"
|
|
28
|
+
| "defaultValue"
|
|
29
|
+
>,
|
|
30
|
+
Omit<
|
|
31
|
+
RecursicaFormControlWrapperProps,
|
|
32
|
+
| "controlMaxWidth"
|
|
33
|
+
| "controlMinWidth"
|
|
34
|
+
| "error"
|
|
35
|
+
| keyof MuiAutocompleteProps<any, any, any, any, "div">
|
|
36
|
+
>,
|
|
37
|
+
ReadOnlyControlProps,
|
|
38
|
+
BaseRecursicaAutocompleteProps {}
|
|
39
|
+
|
|
40
|
+
export type AutocompleteProps = RecursicaOverStyled<RecursicaAutocompleteProps>;
|
|
41
|
+
|
|
42
|
+
export const Autocomplete = forwardRef<HTMLInputElement, AutocompleteProps>(
|
|
43
|
+
function Autocomplete(props, ref) {
|
|
44
|
+
const {
|
|
45
|
+
overStyled = false,
|
|
46
|
+
formLayout = "stacked",
|
|
47
|
+
|
|
48
|
+
// Label & Wrapper Maps
|
|
49
|
+
labelSize,
|
|
50
|
+
labelAlignment,
|
|
51
|
+
labelOptionalText,
|
|
52
|
+
labelWithEditIcon,
|
|
53
|
+
onLabelEditClick,
|
|
54
|
+
|
|
55
|
+
label,
|
|
56
|
+
assistiveText,
|
|
57
|
+
assistiveWithIcon,
|
|
58
|
+
error,
|
|
59
|
+
required,
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
61
|
+
withAsterisk,
|
|
62
|
+
id,
|
|
63
|
+
className,
|
|
64
|
+
style,
|
|
65
|
+
disabled,
|
|
66
|
+
readOnly,
|
|
67
|
+
readOnlyComponent,
|
|
68
|
+
emptyValueComponent,
|
|
69
|
+
value,
|
|
70
|
+
defaultValue,
|
|
71
|
+
data,
|
|
72
|
+
leftSection,
|
|
73
|
+
rightSection,
|
|
74
|
+
placeholder,
|
|
75
|
+
ListboxProps,
|
|
76
|
+
...rest
|
|
77
|
+
} = props;
|
|
78
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
79
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
80
|
+
|
|
81
|
+
// Delete prohibited sizing hooks from bypassing variables natively
|
|
82
|
+
delete restRecord["size"];
|
|
83
|
+
delete restRecord["variant"];
|
|
84
|
+
delete restRecord["radius"];
|
|
85
|
+
|
|
86
|
+
// Securely map core native blocks down ensuring nested CSS modules map precisely
|
|
87
|
+
const mergedClassNames: Partial<Record<string, string>> = {
|
|
88
|
+
root: styles.root,
|
|
89
|
+
inputRoot: styles.input, // Map Mantine .input (wrapper) to MUI's inputRoot
|
|
90
|
+
listbox: styles.dropdown, // Map Mantine .dropdown to MUI's listbox
|
|
91
|
+
option: styles.option,
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const classNamesProp = restRecord.classNames;
|
|
95
|
+
if (
|
|
96
|
+
classNamesProp &&
|
|
97
|
+
typeof classNamesProp === "object" &&
|
|
98
|
+
!Array.isArray(classNamesProp)
|
|
99
|
+
) {
|
|
100
|
+
const o = classNamesProp as Partial<Record<string, string>>;
|
|
101
|
+
mergedClassNames.root = o.wrapper
|
|
102
|
+
? `${styles.root} ${o.wrapper}`
|
|
103
|
+
: styles.root;
|
|
104
|
+
mergedClassNames.inputRoot = o.input
|
|
105
|
+
? `${styles.input} ${o.input}`
|
|
106
|
+
: styles.input;
|
|
107
|
+
mergedClassNames.listbox = o.dropdown
|
|
108
|
+
? `${styles.dropdown} ${o.dropdown}`
|
|
109
|
+
: styles.dropdown;
|
|
110
|
+
mergedClassNames.option = o.option
|
|
111
|
+
? `${styles.option} ${o.option}`
|
|
112
|
+
: styles.option;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const wrapperClass = className
|
|
116
|
+
? `${styles.layoutOverride} ${className}`
|
|
117
|
+
: styles.layoutOverride;
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<WithReadOnlyWrapper
|
|
121
|
+
className={wrapperClass}
|
|
122
|
+
style={style as React.CSSProperties}
|
|
123
|
+
controlMaxWidth="var(--recursica_ui-kit_components_autocomplete_properties_max-width)"
|
|
124
|
+
controlMinWidth="var(--recursica_ui-kit_components_autocomplete_properties_min-width)"
|
|
125
|
+
overStyled={overStyled as true}
|
|
126
|
+
formLayout={formLayout}
|
|
127
|
+
labelSize={labelSize}
|
|
128
|
+
labelAlignment={labelAlignment}
|
|
129
|
+
labelOptionalText={labelOptionalText}
|
|
130
|
+
labelWithEditIcon={labelWithEditIcon}
|
|
131
|
+
onLabelEditClick={onLabelEditClick}
|
|
132
|
+
label={label}
|
|
133
|
+
assistiveText={assistiveText}
|
|
134
|
+
assistiveWithIcon={assistiveWithIcon}
|
|
135
|
+
error={!!error}
|
|
136
|
+
required={required}
|
|
137
|
+
id={id}
|
|
138
|
+
disabled={disabled}
|
|
139
|
+
readOnly={readOnly}
|
|
140
|
+
readOnlyComponent={readOnlyComponent}
|
|
141
|
+
emptyValueComponent={emptyValueComponent}
|
|
142
|
+
readOnlyType="text"
|
|
143
|
+
readOnlyValue={value !== undefined ? value : defaultValue}
|
|
144
|
+
readOnlyNativeProps={props}
|
|
145
|
+
activeComponent={
|
|
146
|
+
/* Naked Input execution safely decoupled from Mui's macro Input.Wrapper DOM hooks */
|
|
147
|
+
<MuiAutocomplete
|
|
148
|
+
ref={ref}
|
|
149
|
+
freeSolo
|
|
150
|
+
disableClearable
|
|
151
|
+
classes={mergedClassNames}
|
|
152
|
+
disabled={disabled}
|
|
153
|
+
value={value}
|
|
154
|
+
defaultValue={defaultValue}
|
|
155
|
+
forcePopupIcon={false}
|
|
156
|
+
data-error={error ? "true" : undefined}
|
|
157
|
+
data-disabled={disabled ? "true" : undefined}
|
|
158
|
+
data-with-left-section={leftSection ? "true" : undefined}
|
|
159
|
+
data-with-right-section={rightSection ? "true" : undefined}
|
|
160
|
+
ListboxProps={{
|
|
161
|
+
...ListboxProps,
|
|
162
|
+
className: mergedClassNames.listbox,
|
|
163
|
+
}}
|
|
164
|
+
options={data || []}
|
|
165
|
+
renderInput={(params) => {
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
167
|
+
const { InputProps, ...restParams } = params;
|
|
168
|
+
return (
|
|
169
|
+
<MuiTextField
|
|
170
|
+
{...restParams}
|
|
171
|
+
placeholder={placeholder}
|
|
172
|
+
variant="standard"
|
|
173
|
+
/>
|
|
174
|
+
);
|
|
175
|
+
}}
|
|
176
|
+
/>
|
|
177
|
+
}
|
|
178
|
+
/>
|
|
179
|
+
);
|
|
180
|
+
},
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
Autocomplete.displayName = "Autocomplete";
|
|
@@ -1,74 +1,344 @@
|
|
|
1
|
+
/*
|
|
2
|
+
HARDCODED VALUES:
|
|
3
|
+
- justify-content, align-items, display: Center content for custom internal spans
|
|
4
|
+
- Mantine overrides (--avatar-bd, --avatar-bg, --avatar-color): Remove default static themes
|
|
5
|
+
- Default object-fit for image
|
|
6
|
+
- Transitions and standard flex layouts
|
|
7
|
+
- Image has no explicit size tokens other than root size, assume it scales 100%
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
/* EXEMPTIONS:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/* recursica-ignore: --recursica_ui-
|
|
6
|
-
/* recursica-ignore: --recursica_ui-
|
|
7
|
-
/* recursica-ignore: --recursica_ui-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
11
|
+
The generic size variables below are defined in Figma but unused.
|
|
12
|
+
We explicitly style the avatar's dimensions using the dedicated width and height tokens
|
|
13
|
+
(e.g., small_properties_width and small_properties_height) for precise component layout. */
|
|
14
|
+
/* recursica-ignore: --recursica_ui-kit_components_avatar_variants_sizes_default_properties_size */
|
|
15
|
+
/* recursica-ignore: --recursica_ui-kit_components_avatar_variants_sizes_large_properties_size */
|
|
16
|
+
/* recursica-ignore: --recursica_ui-kit_components_avatar_variants_sizes_small_properties_size */
|
|
17
|
+
|
|
18
|
+
.root {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
margin: 0;
|
|
21
|
+
border-style: solid;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
position: relative;
|
|
24
|
+
transition: all 0.2s ease;
|
|
25
|
+
box-shadow: var(--recursica_ui-kit_components_avatar_properties_elevation);
|
|
26
|
+
|
|
27
|
+
/* HARDCODE: Remove internal Mantine custom props that interfere */
|
|
28
|
+
--avatar-bd: none;
|
|
29
|
+
--avatar-bg: transparent;
|
|
30
|
+
--avatar-color: inherit;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* ==== SIZES ==== */
|
|
34
|
+
.root[data-size="small"] {
|
|
35
|
+
width: var(
|
|
36
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_width
|
|
37
|
+
);
|
|
38
|
+
height: var(
|
|
39
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_height
|
|
40
|
+
);
|
|
41
|
+
border-width: var(
|
|
42
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_border-size
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.root[data-size="small"] .iconWrapper {
|
|
47
|
+
width: var(
|
|
48
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_icon-size
|
|
49
|
+
);
|
|
50
|
+
height: var(
|
|
51
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_icon-size
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.root[data-size="small"] .textWrapper {
|
|
56
|
+
font-family: var(
|
|
57
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_font-family
|
|
58
|
+
);
|
|
59
|
+
font-size: var(
|
|
60
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_font-size
|
|
61
|
+
);
|
|
62
|
+
font-style: var(
|
|
63
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_font-style
|
|
64
|
+
);
|
|
65
|
+
font-weight: var(
|
|
66
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_font-weight
|
|
67
|
+
);
|
|
68
|
+
letter-spacing: var(
|
|
69
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_letter-spacing
|
|
70
|
+
);
|
|
71
|
+
line-height: var(
|
|
72
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_line-height
|
|
73
|
+
);
|
|
74
|
+
text-decoration: var(
|
|
75
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_text-decoration
|
|
76
|
+
);
|
|
77
|
+
text-transform: var(
|
|
78
|
+
--recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_text-transform
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.root[data-size="default"] {
|
|
83
|
+
width: var(
|
|
84
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_width
|
|
85
|
+
);
|
|
86
|
+
height: var(
|
|
87
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_height
|
|
88
|
+
);
|
|
89
|
+
border-width: var(
|
|
90
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_border-size
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.root[data-size="default"] .iconWrapper {
|
|
95
|
+
width: var(
|
|
96
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_icon-size
|
|
97
|
+
);
|
|
98
|
+
height: var(
|
|
99
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_icon-size
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.root[data-size="default"] .textWrapper {
|
|
104
|
+
font-family: var(
|
|
105
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_font-family
|
|
106
|
+
);
|
|
107
|
+
font-size: var(
|
|
108
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_font-size
|
|
109
|
+
);
|
|
110
|
+
font-style: var(
|
|
111
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_font-style
|
|
112
|
+
);
|
|
113
|
+
font-weight: var(
|
|
114
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_font-weight
|
|
115
|
+
);
|
|
116
|
+
letter-spacing: var(
|
|
117
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_letter-spacing
|
|
118
|
+
);
|
|
119
|
+
line-height: var(
|
|
120
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_line-height
|
|
121
|
+
);
|
|
122
|
+
text-decoration: var(
|
|
123
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_text-decoration
|
|
124
|
+
);
|
|
125
|
+
text-transform: var(
|
|
126
|
+
--recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_text-transform
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.root[data-size="large"] {
|
|
131
|
+
width: var(
|
|
132
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_width
|
|
133
|
+
);
|
|
134
|
+
height: var(
|
|
135
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_height
|
|
136
|
+
);
|
|
137
|
+
border-width: var(
|
|
138
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_border-size
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.root[data-size="large"] .iconWrapper {
|
|
143
|
+
width: var(
|
|
144
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_icon-size
|
|
145
|
+
);
|
|
146
|
+
height: var(
|
|
147
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_icon-size
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.root[data-size="large"] .textWrapper {
|
|
152
|
+
font-family: var(
|
|
153
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_font-family
|
|
154
|
+
);
|
|
155
|
+
font-size: var(
|
|
156
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_font-size
|
|
157
|
+
);
|
|
158
|
+
font-style: var(
|
|
159
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_font-style
|
|
160
|
+
);
|
|
161
|
+
font-weight: var(
|
|
162
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_font-weight
|
|
163
|
+
);
|
|
164
|
+
letter-spacing: var(
|
|
165
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_letter-spacing
|
|
166
|
+
);
|
|
167
|
+
line-height: var(
|
|
168
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_line-height
|
|
169
|
+
);
|
|
170
|
+
text-decoration: var(
|
|
171
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_text-decoration
|
|
172
|
+
);
|
|
173
|
+
text-transform: var(
|
|
174
|
+
--recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_text-transform
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* ==== STYLES & VARIANTS ==== */
|
|
179
|
+
|
|
180
|
+
/* 1. IMAGE */
|
|
181
|
+
.root[data-style="image"] {
|
|
182
|
+
border-radius: var(
|
|
183
|
+
--recursica_ui-kit_components_avatar_variants_styles_image_properties_border-radius
|
|
184
|
+
);
|
|
185
|
+
border-width: var(
|
|
186
|
+
--recursica_ui-kit_components_avatar_variants_styles_image_properties_border-size
|
|
187
|
+
);
|
|
188
|
+
padding: var(
|
|
189
|
+
--recursica_ui-kit_components_avatar_variants_styles_image_properties_padding
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
/* Image variant styles */
|
|
193
|
+
background-color: var(
|
|
194
|
+
--recursica_ui-kit_components_avatar_variants_styles_image_properties_colors_background
|
|
195
|
+
);
|
|
196
|
+
border-color: var(
|
|
197
|
+
--recursica_ui-kit_components_avatar_variants_styles_image_properties_colors_border-color
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* Base styles for Internal Nodes */
|
|
202
|
+
.image {
|
|
203
|
+
object-fit: cover;
|
|
204
|
+
width: 100%;
|
|
205
|
+
height: 100%;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.placeholder {
|
|
209
|
+
display: flex;
|
|
210
|
+
align-items: center;
|
|
211
|
+
justify-content: center;
|
|
212
|
+
width: 100%;
|
|
213
|
+
height: 100%;
|
|
214
|
+
color: inherit;
|
|
215
|
+
background-color: transparent;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.iconWrapper {
|
|
219
|
+
display: flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
justify-content: center;
|
|
222
|
+
flex-shrink: 0;
|
|
223
|
+
}
|
|
224
|
+
.iconWrapper > * {
|
|
225
|
+
width: 100%;
|
|
226
|
+
height: 100%;
|
|
227
|
+
object-fit: contain;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.textWrapper {
|
|
231
|
+
display: inline-flex;
|
|
232
|
+
align-items: center;
|
|
233
|
+
justify-content: center;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* 2. ICON */
|
|
237
|
+
.root[data-style="icon"] {
|
|
238
|
+
border-radius: var(
|
|
239
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_properties_border-radius
|
|
240
|
+
);
|
|
241
|
+
padding: var(
|
|
242
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_properties_padding
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.root[data-style="icon"][data-variant="solid"] {
|
|
247
|
+
border-width: var(
|
|
248
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_solid_properties_border-size
|
|
249
|
+
);
|
|
250
|
+
background-color: var(
|
|
251
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_solid_properties_colors_background
|
|
252
|
+
);
|
|
253
|
+
border-color: var(
|
|
254
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_solid_properties_colors_border-color
|
|
255
|
+
);
|
|
256
|
+
color: var(
|
|
257
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_solid_properties_colors_icon-color
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.root[data-style="icon"][data-variant="outline"] {
|
|
262
|
+
border-width: var(
|
|
263
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_outline_properties_border-size
|
|
264
|
+
);
|
|
265
|
+
background-color: var(
|
|
266
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_outline_properties_colors_background
|
|
267
|
+
);
|
|
268
|
+
border-color: var(
|
|
269
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_outline_properties_colors_border-color
|
|
270
|
+
);
|
|
271
|
+
color: var(
|
|
272
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_outline_properties_colors_icon-color
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.root[data-style="icon"][data-variant="ghost"] {
|
|
277
|
+
border-width: var(
|
|
278
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_ghost_properties_border-size
|
|
279
|
+
);
|
|
280
|
+
background-color: var(
|
|
281
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_ghost_properties_colors_background
|
|
282
|
+
);
|
|
283
|
+
border-color: var(
|
|
284
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_ghost_properties_colors_border-color
|
|
285
|
+
);
|
|
286
|
+
color: var(
|
|
287
|
+
--recursica_ui-kit_components_avatar_variants_styles_icon_variants_types_ghost_properties_colors_icon-color
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* 3. TEXT */
|
|
292
|
+
.root[data-style="text"] {
|
|
293
|
+
border-radius: var(
|
|
294
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_properties_border-radius
|
|
295
|
+
);
|
|
296
|
+
padding: var(
|
|
297
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_properties_padding
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.root[data-style="text"][data-variant="solid"] {
|
|
302
|
+
border-width: var(
|
|
303
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_solid_properties_border-size
|
|
304
|
+
);
|
|
305
|
+
background-color: var(
|
|
306
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_solid_properties_colors_background
|
|
307
|
+
);
|
|
308
|
+
border-color: var(
|
|
309
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_solid_properties_colors_border-color
|
|
310
|
+
);
|
|
311
|
+
color: var(
|
|
312
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_solid_properties_colors_text-color
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.root[data-style="text"][data-variant="outline"] {
|
|
317
|
+
border-width: var(
|
|
318
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_outline_properties_border-size
|
|
319
|
+
);
|
|
320
|
+
background-color: var(
|
|
321
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_outline_properties_colors_background
|
|
322
|
+
);
|
|
323
|
+
border-color: var(
|
|
324
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_outline_properties_colors_border-color
|
|
325
|
+
);
|
|
326
|
+
color: var(
|
|
327
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_outline_properties_colors_text-color
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.root[data-style="text"][data-variant="ghost"] {
|
|
332
|
+
border-width: var(
|
|
333
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_ghost_properties_border-size
|
|
334
|
+
);
|
|
335
|
+
background-color: var(
|
|
336
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_ghost_properties_colors_background
|
|
337
|
+
);
|
|
338
|
+
border-color: var(
|
|
339
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_ghost_properties_colors_border-color
|
|
340
|
+
);
|
|
341
|
+
color: var(
|
|
342
|
+
--recursica_ui-kit_components_avatar_variants_styles_text_variants_types_ghost_properties_colors_text-color
|
|
343
|
+
);
|
|
344
|
+
}
|