@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,171 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import { InputBase, type InputBaseProps } from "@mui/material";
|
|
3
|
+
import { type ReadOnlyControlProps } from "@recursica/adapter-common";
|
|
4
|
+
import {
|
|
5
|
+
filterStylingProps,
|
|
6
|
+
type RecursicaOverStyled,
|
|
7
|
+
} from "../../utils/filterStylingProps";
|
|
8
|
+
import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/FormControlWrapper";
|
|
9
|
+
import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
|
|
10
|
+
import styles from "./TextField.module.css";
|
|
3
11
|
|
|
4
|
-
|
|
12
|
+
import { type RecursicaTextFieldProps as BaseRecursicaTextFieldProps } from "@recursica/adapter-common";
|
|
5
13
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
export interface RecursicaTextFieldProps
|
|
15
|
+
extends Omit<
|
|
16
|
+
InputBaseProps,
|
|
17
|
+
"color" | "size" | "startAdornment" | "endAdornment" | "autoComplete"
|
|
18
|
+
>,
|
|
19
|
+
Omit<
|
|
20
|
+
React.ComponentPropsWithoutRef<"input">,
|
|
21
|
+
keyof InputBaseProps | "size" | "color" | "style" | "className" | "id"
|
|
22
|
+
>,
|
|
23
|
+
Pick<
|
|
24
|
+
RecursicaFormControlWrapperProps,
|
|
25
|
+
| "label"
|
|
26
|
+
| "error"
|
|
27
|
+
| "required"
|
|
28
|
+
| "id"
|
|
29
|
+
| "assistiveText"
|
|
30
|
+
| "assistiveWithIcon"
|
|
31
|
+
| "formLayout"
|
|
32
|
+
| "labelSize"
|
|
33
|
+
| "labelAlignment"
|
|
34
|
+
| "labelOptionalText"
|
|
35
|
+
| "labelWithEditIcon"
|
|
36
|
+
| "onLabelEditClick"
|
|
37
|
+
>,
|
|
38
|
+
ReadOnlyControlProps,
|
|
39
|
+
BaseRecursicaTextFieldProps {}
|
|
40
|
+
|
|
41
|
+
export type TextFieldProps = RecursicaOverStyled<RecursicaTextFieldProps>;
|
|
42
|
+
|
|
43
|
+
export const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
44
|
+
function TextField(props, ref) {
|
|
45
|
+
const {
|
|
46
|
+
overStyled = false,
|
|
47
|
+
formLayout = "stacked",
|
|
48
|
+
|
|
49
|
+
// Label & Wrapper Maps
|
|
50
|
+
labelSize,
|
|
51
|
+
labelAlignment,
|
|
52
|
+
labelOptionalText,
|
|
53
|
+
labelWithEditIcon,
|
|
54
|
+
onLabelEditClick,
|
|
55
|
+
|
|
56
|
+
label,
|
|
57
|
+
assistiveText,
|
|
58
|
+
assistiveWithIcon,
|
|
59
|
+
error,
|
|
60
|
+
required,
|
|
61
|
+
id,
|
|
62
|
+
className,
|
|
63
|
+
style,
|
|
64
|
+
disabled,
|
|
65
|
+
readOnly,
|
|
66
|
+
readOnlyComponent,
|
|
67
|
+
emptyValueComponent,
|
|
68
|
+
value,
|
|
69
|
+
defaultValue,
|
|
70
|
+
leftSection,
|
|
71
|
+
rightSection,
|
|
72
|
+
...rest
|
|
73
|
+
} = props;
|
|
74
|
+
|
|
75
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
76
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
77
|
+
|
|
78
|
+
// Delete prohibited sizing hooks from bypassing variables natively
|
|
79
|
+
delete restRecord["size"];
|
|
80
|
+
delete restRecord["color"];
|
|
81
|
+
|
|
82
|
+
// Securely map core native blocks down ensuring nested CSS modules map precisely
|
|
83
|
+
const mergedClassNames: Partial<Record<string, string>> = {
|
|
84
|
+
wrapper: styles.root, // The nested Input internal relative wrapper bounding box
|
|
85
|
+
input: styles.input,
|
|
86
|
+
section: styles.section,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const classesProp = restRecord.classes;
|
|
90
|
+
if (
|
|
91
|
+
classesProp &&
|
|
92
|
+
typeof classesProp === "object" &&
|
|
93
|
+
!Array.isArray(classesProp)
|
|
94
|
+
) {
|
|
95
|
+
const o = classesProp as Partial<Record<string, string>>;
|
|
96
|
+
mergedClassNames.wrapper = o.root
|
|
97
|
+
? `${styles.root} ${o.root}`
|
|
98
|
+
: styles.root;
|
|
99
|
+
mergedClassNames.input = o.input
|
|
100
|
+
? `${styles.input} ${o.input}`
|
|
101
|
+
: styles.input;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const wrapperClass = className
|
|
105
|
+
? `${styles.layoutOverride} ${className}`
|
|
106
|
+
: styles.layoutOverride;
|
|
107
|
+
|
|
108
|
+
const startAdornment = leftSection ? (
|
|
109
|
+
<div className={mergedClassNames.section} data-position="left">
|
|
110
|
+
{leftSection}
|
|
111
|
+
</div>
|
|
112
|
+
) : undefined;
|
|
113
|
+
|
|
114
|
+
const endAdornment = rightSection ? (
|
|
115
|
+
<div className={mergedClassNames.section} data-position="right">
|
|
116
|
+
{rightSection}
|
|
117
|
+
</div>
|
|
118
|
+
) : undefined;
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<WithReadOnlyWrapper
|
|
122
|
+
className={wrapperClass}
|
|
123
|
+
style={style as React.CSSProperties}
|
|
124
|
+
controlMaxWidth="var(--recursica_ui-kit_components_text-field_properties_max-width)"
|
|
125
|
+
controlMinWidth="var(--recursica_ui-kit_components_text-field_properties_min-width)"
|
|
126
|
+
overStyled={overStyled as true}
|
|
127
|
+
formLayout={formLayout}
|
|
128
|
+
labelSize={labelSize}
|
|
129
|
+
labelAlignment={labelAlignment}
|
|
130
|
+
labelOptionalText={labelOptionalText}
|
|
131
|
+
labelWithEditIcon={labelWithEditIcon}
|
|
132
|
+
onLabelEditClick={onLabelEditClick}
|
|
133
|
+
label={label}
|
|
134
|
+
assistiveText={assistiveText}
|
|
135
|
+
assistiveWithIcon={assistiveWithIcon}
|
|
136
|
+
error={error}
|
|
137
|
+
required={required}
|
|
138
|
+
id={id}
|
|
139
|
+
readOnly={readOnly}
|
|
140
|
+
readOnlyComponent={readOnlyComponent as any}
|
|
141
|
+
emptyValueComponent={(emptyValueComponent as any) || undefined}
|
|
142
|
+
readOnlyType="text"
|
|
143
|
+
readOnlyValue={value !== undefined ? value : defaultValue}
|
|
144
|
+
readOnlyNativeProps={props}
|
|
145
|
+
activeComponent={
|
|
146
|
+
/* Naked Input execution safely decoupled from MUI's macro FormControl DOM hooks */
|
|
147
|
+
<InputBase
|
|
148
|
+
inputRef={ref} // MUI specific forward ref mapping
|
|
149
|
+
classes={{
|
|
150
|
+
root: mergedClassNames.wrapper,
|
|
151
|
+
input: mergedClassNames.input,
|
|
152
|
+
}}
|
|
153
|
+
disabled={disabled}
|
|
154
|
+
value={value}
|
|
155
|
+
defaultValue={defaultValue}
|
|
156
|
+
startAdornment={startAdornment}
|
|
157
|
+
endAdornment={endAdornment}
|
|
158
|
+
// Bind native CSS selectors for errors / adornments explicitly to the root boundary
|
|
159
|
+
data-disabled={disabled ? "true" : undefined}
|
|
160
|
+
data-error={error ? "true" : undefined}
|
|
161
|
+
data-with-left-section={leftSection ? "true" : undefined}
|
|
162
|
+
data-with-right-section={rightSection ? "true" : undefined}
|
|
163
|
+
{...(sanitizedProps as unknown as InputBaseProps)}
|
|
164
|
+
/>
|
|
165
|
+
}
|
|
166
|
+
/>
|
|
167
|
+
);
|
|
168
|
+
},
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
TextField.displayName = "TextField";
|
|
@@ -6,28 +6,11 @@ const meta: Meta<typeof TimePicker> = {
|
|
|
6
6
|
title: "UI-Kit/🚧 TimePicker",
|
|
7
7
|
component: TimePicker,
|
|
8
8
|
tags: ["autodocs"],
|
|
9
|
-
|
|
10
|
-
controls: {
|
|
11
|
-
include: [
|
|
12
|
-
"layer",
|
|
13
|
-
"withLayer",
|
|
14
|
-
"children",
|
|
15
|
-
"component",
|
|
16
|
-
"variant",
|
|
17
|
-
"size",
|
|
18
|
-
"icon",
|
|
19
|
-
"disabled",
|
|
20
|
-
"href",
|
|
21
|
-
"onClick",
|
|
22
|
-
"onChange",
|
|
23
|
-
"value",
|
|
24
|
-
"checked",
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
9
|
+
argTypes: {},
|
|
28
10
|
};
|
|
29
11
|
|
|
30
12
|
export default meta;
|
|
13
|
+
|
|
31
14
|
type Story = StoryObj<typeof TimePicker>;
|
|
32
15
|
|
|
33
16
|
export const Default: Story = {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./TimePicker.module.css";
|
|
3
|
+
import { type RecursicaTimePickerProps } from "@recursica/adapter-common";
|
|
3
4
|
|
|
4
|
-
export type TimePickerProps = React.HTMLAttributes<HTMLDivElement
|
|
5
|
+
export type TimePickerProps = React.HTMLAttributes<HTMLDivElement> &
|
|
6
|
+
RecursicaTimePickerProps;
|
|
5
7
|
|
|
6
8
|
export const TimePicker: React.FC<TimePickerProps> = (props) => {
|
|
7
9
|
return <div {...props}>TimePicker</div>;
|
|
@@ -1,78 +1,367 @@
|
|
|
1
1
|
/* EXEMPTIONS:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/* recursica-ignore: --recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_active-avatar-opacity */
|
|
2
|
+
- timeline-bullet_variants_types_avatar_properties_avatar-size is ignored because under the avatar timeline variant,
|
|
3
|
+
the bullet container size uses fallback bullet-size configurations to maintain vertical alignment with the
|
|
4
|
+
inactive/active connector line, while the nested Avatar subcomponent handles its own sizing natively. */
|
|
6
5
|
/* recursica-ignore: --recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_avatar-size */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/*
|
|
78
|
-
|
|
6
|
+
|
|
7
|
+
.root {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.item {
|
|
13
|
+
/* Mantine uses these vars to calculate the exact left: position of the connector line */
|
|
14
|
+
--tl-line-width: var(
|
|
15
|
+
--recursica_ui-kit_components_timeline_properties_inactive-connector-size
|
|
16
|
+
) !important;
|
|
17
|
+
|
|
18
|
+
&[data-active] {
|
|
19
|
+
--tl-line-width: var(
|
|
20
|
+
--recursica_ui-kit_components_timeline_properties_active-connector-size
|
|
21
|
+
) !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&[data-variant="default"] {
|
|
25
|
+
--tl-bullet-size: var(
|
|
26
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
27
|
+
) !important;
|
|
28
|
+
}
|
|
29
|
+
&[data-variant="icon"] {
|
|
30
|
+
--tl-bullet-size: var(
|
|
31
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_bullet-size
|
|
32
|
+
) !important;
|
|
33
|
+
}
|
|
34
|
+
&[data-variant="icon-alternative"] {
|
|
35
|
+
--tl-bullet-size: var(
|
|
36
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_bullet-size
|
|
37
|
+
) !important;
|
|
38
|
+
}
|
|
39
|
+
&[data-variant="avatar"] {
|
|
40
|
+
/* Avatar sizing fallback to default to maintain connector alignment */
|
|
41
|
+
--tl-bullet-size: var(
|
|
42
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
43
|
+
) !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Control connector lines via the item ::before pseudo-element */
|
|
47
|
+
/* Inactive connector */
|
|
48
|
+
&::before {
|
|
49
|
+
border-left-width: var(
|
|
50
|
+
--recursica_ui-kit_components_timeline_properties_inactive-connector-size
|
|
51
|
+
) !important;
|
|
52
|
+
border-left-color: var(
|
|
53
|
+
--recursica_ui-kit_components_timeline_properties_colors_inactive-connector-color
|
|
54
|
+
) !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Active connector */
|
|
58
|
+
&[data-active]::before {
|
|
59
|
+
border-left-width: var(
|
|
60
|
+
--recursica_ui-kit_components_timeline_properties_active-connector-size
|
|
61
|
+
) !important;
|
|
62
|
+
border-left-color: var(
|
|
63
|
+
--recursica_ui-kit_components_timeline_properties_colors_active-connector-color
|
|
64
|
+
) !important;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.itemBody {
|
|
69
|
+
/* Space between the bullet and the content */
|
|
70
|
+
padding-left: var(
|
|
71
|
+
--recursica_ui-kit_components_timeline_properties_bullet-content-gap
|
|
72
|
+
) !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.itemBullet {
|
|
76
|
+
/* Default Variant */
|
|
77
|
+
:global(.mantine-Timeline-item)[data-variant="default"] & {
|
|
78
|
+
width: var(
|
|
79
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
80
|
+
) !important;
|
|
81
|
+
height: var(
|
|
82
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_bullet-size
|
|
83
|
+
) !important;
|
|
84
|
+
border-radius: var(
|
|
85
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_border-radius
|
|
86
|
+
) !important;
|
|
87
|
+
border-width: var(
|
|
88
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_border-size
|
|
89
|
+
) !important;
|
|
90
|
+
|
|
91
|
+
background-color: var(
|
|
92
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_colors_inactive-background
|
|
93
|
+
) !important;
|
|
94
|
+
border-color: var(
|
|
95
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_colors_inactive-border-color
|
|
96
|
+
) !important;
|
|
97
|
+
}
|
|
98
|
+
:global(.mantine-Timeline-item)[data-variant="default"][data-active] & {
|
|
99
|
+
background-color: var(
|
|
100
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_colors_active-background
|
|
101
|
+
) !important;
|
|
102
|
+
border-color: var(
|
|
103
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_default_properties_colors_active-border-color
|
|
104
|
+
) !important;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Icon Variant */
|
|
108
|
+
:global(.mantine-Timeline-item)[data-variant="icon"] & {
|
|
109
|
+
width: var(
|
|
110
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_bullet-size
|
|
111
|
+
) !important;
|
|
112
|
+
height: var(
|
|
113
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_bullet-size
|
|
114
|
+
) !important;
|
|
115
|
+
border-radius: var(
|
|
116
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_border-radius
|
|
117
|
+
) !important;
|
|
118
|
+
border-width: var(
|
|
119
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_border-size
|
|
120
|
+
) !important;
|
|
121
|
+
|
|
122
|
+
background-color: var(
|
|
123
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_colors_inactive-background
|
|
124
|
+
) !important;
|
|
125
|
+
border-color: var(
|
|
126
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_colors_inactive-border-color
|
|
127
|
+
) !important;
|
|
128
|
+
color: var(
|
|
129
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_colors_inactive-icon-color
|
|
130
|
+
) !important;
|
|
131
|
+
|
|
132
|
+
/* Propagate icon size */
|
|
133
|
+
font-size: var(
|
|
134
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_icon-size
|
|
135
|
+
);
|
|
136
|
+
& svg {
|
|
137
|
+
width: var(
|
|
138
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_icon-size
|
|
139
|
+
);
|
|
140
|
+
height: var(
|
|
141
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_icon-size
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
:global(.mantine-Timeline-item)[data-variant="icon"][data-active] & {
|
|
146
|
+
background-color: var(
|
|
147
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_colors_active-background
|
|
148
|
+
) !important;
|
|
149
|
+
border-color: var(
|
|
150
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_colors_active-border-color
|
|
151
|
+
) !important;
|
|
152
|
+
color: var(
|
|
153
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon_properties_colors_active-icon-color
|
|
154
|
+
) !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Icon Alternative Variant */
|
|
158
|
+
:global(.mantine-Timeline-item)[data-variant="icon-alternative"] & {
|
|
159
|
+
width: var(
|
|
160
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_bullet-size
|
|
161
|
+
) !important;
|
|
162
|
+
height: var(
|
|
163
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_bullet-size
|
|
164
|
+
) !important;
|
|
165
|
+
border-radius: var(
|
|
166
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_border-radius
|
|
167
|
+
) !important;
|
|
168
|
+
border-width: var(
|
|
169
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_border-size
|
|
170
|
+
) !important;
|
|
171
|
+
|
|
172
|
+
background-color: var(
|
|
173
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_colors_inactive-background
|
|
174
|
+
) !important;
|
|
175
|
+
border-color: var(
|
|
176
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_colors_inactive-border-color
|
|
177
|
+
) !important;
|
|
178
|
+
color: var(
|
|
179
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_colors_inactive-icon-color
|
|
180
|
+
) !important;
|
|
181
|
+
|
|
182
|
+
font-size: var(
|
|
183
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_icon-size
|
|
184
|
+
);
|
|
185
|
+
& svg {
|
|
186
|
+
width: var(
|
|
187
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_icon-size
|
|
188
|
+
);
|
|
189
|
+
height: var(
|
|
190
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_icon-size
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
:global(.mantine-Timeline-item)[data-variant="icon-alternative"][data-active]
|
|
195
|
+
& {
|
|
196
|
+
background-color: var(
|
|
197
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_colors_active-background
|
|
198
|
+
) !important;
|
|
199
|
+
border-color: var(
|
|
200
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_colors_active-border-color
|
|
201
|
+
) !important;
|
|
202
|
+
color: var(
|
|
203
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_icon-alternative_properties_colors_active-icon-color
|
|
204
|
+
) !important;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* Avatar Variant */
|
|
208
|
+
:global(.mantine-Timeline-item)[data-variant="avatar"] & {
|
|
209
|
+
/* Avatar sizing is often governed by the avatar itself, but we'll apply the radius and opacity */
|
|
210
|
+
border-radius: var(
|
|
211
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_border-radius
|
|
212
|
+
) !important;
|
|
213
|
+
border-width: var(
|
|
214
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_border-size
|
|
215
|
+
) !important;
|
|
216
|
+
opacity: var(
|
|
217
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_inactive-avatar-opacity
|
|
218
|
+
) !important;
|
|
219
|
+
|
|
220
|
+
background-color: var(
|
|
221
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_colors_inactive-background
|
|
222
|
+
) !important;
|
|
223
|
+
border-color: var(
|
|
224
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_colors_inactive-border-color
|
|
225
|
+
) !important;
|
|
226
|
+
}
|
|
227
|
+
:global(.mantine-Timeline-item)[data-variant="avatar"][data-active] & {
|
|
228
|
+
opacity: var(
|
|
229
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_active-avatar-opacity
|
|
230
|
+
) !important;
|
|
231
|
+
background-color: var(
|
|
232
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_colors_active-background
|
|
233
|
+
) !important;
|
|
234
|
+
border-color: var(
|
|
235
|
+
--recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_colors_active-border-color
|
|
236
|
+
) !important;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.itemTitle {
|
|
241
|
+
font-family: var(
|
|
242
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-family
|
|
243
|
+
);
|
|
244
|
+
font-size: var(
|
|
245
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-size
|
|
246
|
+
);
|
|
247
|
+
font-style: var(
|
|
248
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-style
|
|
249
|
+
);
|
|
250
|
+
font-weight: var(
|
|
251
|
+
--recursica_ui-kit_components_timeline_properties_title-text_font-weight
|
|
252
|
+
);
|
|
253
|
+
letter-spacing: var(
|
|
254
|
+
--recursica_ui-kit_components_timeline_properties_title-text_letter-spacing
|
|
255
|
+
);
|
|
256
|
+
line-height: var(
|
|
257
|
+
--recursica_ui-kit_components_timeline_properties_title-text_line-height
|
|
258
|
+
);
|
|
259
|
+
text-decoration: var(
|
|
260
|
+
--recursica_ui-kit_components_timeline_properties_title-text_text-decoration
|
|
261
|
+
);
|
|
262
|
+
text-transform: var(
|
|
263
|
+
--recursica_ui-kit_components_timeline_properties_title-text_text-transform
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
/* Title Description Gap */
|
|
267
|
+
margin-bottom: var(
|
|
268
|
+
--recursica_ui-kit_components_timeline_properties_title-description-gap
|
|
269
|
+
) !important;
|
|
270
|
+
|
|
271
|
+
/* Inactive Title Color */
|
|
272
|
+
color: var(
|
|
273
|
+
--recursica_ui-kit_components_timeline_properties_colors_inactive-title-color
|
|
274
|
+
) !important;
|
|
275
|
+
|
|
276
|
+
/* Active Title Color */
|
|
277
|
+
:global(.mantine-Timeline-item)[data-active] & {
|
|
278
|
+
color: var(
|
|
279
|
+
--recursica_ui-kit_components_timeline_properties_colors_active-title-color
|
|
280
|
+
) !important;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.itemContent {
|
|
285
|
+
display: flex;
|
|
286
|
+
flex-direction: column;
|
|
287
|
+
gap: var(
|
|
288
|
+
--recursica_ui-kit_components_timeline_properties_description-timestamp-gap
|
|
289
|
+
);
|
|
290
|
+
max-width: var(
|
|
291
|
+
--recursica_ui-kit_components_timeline_properties_max-text-width
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.description {
|
|
296
|
+
font-family: var(
|
|
297
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-family
|
|
298
|
+
);
|
|
299
|
+
font-size: var(
|
|
300
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-size
|
|
301
|
+
);
|
|
302
|
+
font-style: var(
|
|
303
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-style
|
|
304
|
+
);
|
|
305
|
+
font-weight: var(
|
|
306
|
+
--recursica_ui-kit_components_timeline_properties_description-text_font-weight
|
|
307
|
+
);
|
|
308
|
+
letter-spacing: var(
|
|
309
|
+
--recursica_ui-kit_components_timeline_properties_description-text_letter-spacing
|
|
310
|
+
);
|
|
311
|
+
line-height: var(
|
|
312
|
+
--recursica_ui-kit_components_timeline_properties_description-text_line-height
|
|
313
|
+
);
|
|
314
|
+
text-decoration: var(
|
|
315
|
+
--recursica_ui-kit_components_timeline_properties_description-text_text-decoration
|
|
316
|
+
);
|
|
317
|
+
text-transform: var(
|
|
318
|
+
--recursica_ui-kit_components_timeline_properties_description-text_text-transform
|
|
319
|
+
);
|
|
320
|
+
|
|
321
|
+
color: var(
|
|
322
|
+
--recursica_ui-kit_components_timeline_properties_colors_inactive-description-color
|
|
323
|
+
);
|
|
324
|
+
|
|
325
|
+
:global(.mantine-Timeline-item)[data-active] & {
|
|
326
|
+
color: var(
|
|
327
|
+
--recursica_ui-kit_components_timeline_properties_colors_active-description-color
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.timestamp {
|
|
333
|
+
font-family: var(
|
|
334
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-family
|
|
335
|
+
);
|
|
336
|
+
font-size: var(
|
|
337
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-size
|
|
338
|
+
);
|
|
339
|
+
font-style: var(
|
|
340
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-style
|
|
341
|
+
);
|
|
342
|
+
font-weight: var(
|
|
343
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_font-weight
|
|
344
|
+
);
|
|
345
|
+
letter-spacing: var(
|
|
346
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_letter-spacing
|
|
347
|
+
);
|
|
348
|
+
line-height: var(
|
|
349
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_line-height
|
|
350
|
+
);
|
|
351
|
+
text-decoration: var(
|
|
352
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_text-decoration
|
|
353
|
+
);
|
|
354
|
+
text-transform: var(
|
|
355
|
+
--recursica_ui-kit_components_timeline_properties_timestamp-text_text-transform
|
|
356
|
+
);
|
|
357
|
+
|
|
358
|
+
color: var(
|
|
359
|
+
--recursica_ui-kit_components_timeline_properties_colors_inactive-timestamp-color
|
|
360
|
+
);
|
|
361
|
+
|
|
362
|
+
:global(.mantine-Timeline-item)[data-active] & {
|
|
363
|
+
color: var(
|
|
364
|
+
--recursica_ui-kit_components_timeline_properties_colors_active-timestamp-color
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
}
|