@recursica/mantine-adapter 0.23.0 → 0.26.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 +32 -0
- package/SETUP.md +79 -0
- package/USAGE.md +55 -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 +928 -878
- package/dist/mantine-adapter.js.map +1 -1
- package/dist/src/components/Accordion/Accordion.d.ts +4 -24
- package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +1 -6
- package/dist/src/components/AutoComplete/AutoComplete.d.ts +7 -3
- package/dist/src/components/Avatar/Avatar.d.ts +2 -6
- package/dist/src/components/Badge/Badge.d.ts +2 -5
- package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +1 -2
- package/dist/src/components/Button/Button.d.ts +2 -16
- package/dist/src/components/Card/Card.d.ts +4 -6
- package/dist/src/components/Checkbox/Checkbox.d.ts +4 -4
- package/dist/src/components/Checkbox/CheckboxGroup.d.ts +7 -3
- package/dist/src/components/Chip/Chip.d.ts +1 -10
- package/dist/src/components/Container/Container.d.ts +1 -11
- package/dist/src/components/DatePicker/DatePicker.d.ts +7 -3
- package/dist/src/components/Dropdown/Dropdown.d.ts +2 -4
- package/dist/src/components/Flex/Flex.d.ts +2 -11
- package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +2 -7
- package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +1 -15
- package/dist/src/components/Group/Group.d.ts +1 -10
- package/dist/src/components/HoverCard/HoverCard.d.ts +1 -11
- package/dist/src/components/Label/Label.d.ts +1 -14
- package/dist/src/components/Link/Link.d.ts +2 -11
- package/dist/src/components/Loader/Loader.d.ts +2 -7
- package/dist/src/components/Menu/Menu.d.ts +4 -3
- package/dist/src/components/Modal/Modal.d.ts +2 -1
- package/dist/src/components/NumberInput/NumberInput.d.ts +2 -4
- package/dist/src/components/Pagination/Pagination.d.ts +2 -4
- package/dist/src/components/Panel/Panel.d.ts +2 -9
- package/dist/src/components/Popover/Popover.d.ts +1 -11
- package/dist/src/components/Radio/Radio.d.ts +4 -4
- package/dist/src/components/Radio/RadioGroup.d.ts +7 -3
- package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +2 -10
- package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +1 -11
- package/dist/src/components/Slider/Slider.d.ts +7 -13
- package/dist/src/components/Stack/Stack.d.ts +2 -9
- package/dist/src/components/Stepper/Stepper.d.ts +2 -4
- package/dist/src/components/Switch/Switch.d.ts +4 -4
- package/dist/src/components/Switch/SwitchGroup.d.ts +7 -3
- package/dist/src/components/Table/Table.d.ts +2 -1
- package/dist/src/components/Tabs/Tabs.d.ts +2 -4
- package/dist/src/components/Text/Text.d.ts +2 -11
- package/dist/src/components/TextArea/TextArea.d.ts +2 -8
- package/dist/src/components/TextField/TextField.d.ts +7 -3
- package/dist/src/components/TimePicker/TimePicker.d.ts +2 -1
- package/dist/src/components/Timeline/Timeline.d.ts +2 -1
- package/dist/src/components/Timeline/TimelineItem.d.ts +1 -12
- package/dist/src/components/Title/Title.d.ts +1 -7
- package/dist/src/components/Toast/Toast.d.ts +1 -12
- package/dist/src/components/Tooltip/Tooltip.d.ts +1 -12
- package/dist/src/components/TransferList/TransferList.d.ts +2 -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 +9 -2
- package/src/components/Accordion/Accordion.module.css +1 -2
- package/src/components/Accordion/Accordion.tsx +15 -28
- package/src/components/AssistiveElement/AssistiveElement.tsx +1 -6
- package/src/components/AutoComplete/AutoComplete.tsx +4 -1
- package/src/components/Avatar/Avatar.tsx +1 -5
- package/src/components/Badge/Badge.tsx +1 -4
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -2
- package/src/components/Button/Button.module.css +18 -45
- package/src/components/Button/Button.tsx +1 -15
- package/src/components/Card/Card.tsx +11 -6
- package/src/components/Checkbox/Checkbox.module.css +6 -10
- package/src/components/Checkbox/Checkbox.tsx +19 -14
- package/src/components/Checkbox/CheckboxGroup.tsx +4 -1
- package/src/components/Chip/CHIP_IMPLEMENTATION_NOTES.md +4 -1
- package/src/components/Chip/Chip.module.css +36 -28
- package/src/components/Chip/Chip.tsx +8 -15
- package/src/components/Container/Container.tsx +1 -19
- package/src/components/DatePicker/DatePicker.module.css +2 -2
- package/src/components/DatePicker/DatePicker.tsx +4 -1
- package/src/components/Dropdown/Dropdown.tsx +4 -4
- package/src/components/Flex/Flex.tsx +2 -13
- package/src/components/FormControlLayout/FormControlLayout.module.css +6 -18
- package/src/components/FormControlLayout/FormControlLayout.tsx +4 -8
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +2 -15
- package/src/components/Group/Group.tsx +2 -13
- package/src/components/HoverCard/HoverCard.tsx +1 -8
- package/src/components/Label/Label.module.css +5 -10
- package/src/components/Label/Label.tsx +1 -14
- package/src/components/Link/Link.module.css +4 -3
- package/src/components/Link/Link.stories.tsx +2 -3
- package/src/components/Link/Link.tsx +1 -10
- package/src/components/Loader/Loader.module.css +1 -2
- package/src/components/Loader/Loader.tsx +1 -7
- package/src/components/Menu/Menu.tsx +5 -1
- package/src/components/Modal/Modal.tsx +3 -1
- package/src/components/NumberInput/NumberInput.tsx +4 -4
- package/src/components/Pagination/Pagination.module.css +12 -24
- package/src/components/Pagination/Pagination.stories.tsx +0 -8
- package/src/components/Pagination/Pagination.tsx +5 -4
- package/src/components/Panel/Panel.tsx +1 -8
- package/src/components/Popover/Popover.tsx +1 -8
- package/src/components/Radio/Radio.module.css +4 -10
- package/src/components/Radio/Radio.tsx +19 -14
- package/src/components/Radio/RadioGroup.tsx +4 -1
- package/src/components/ReadOnlyField/ReadOnlyField.module.css +9 -18
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +4 -11
- package/src/components/SegmentedControl/SegmentedControl.module.css +20 -44
- package/src/components/SegmentedControl/SegmentedControl.tsx +1 -11
- package/src/components/Slider/Slider.module.css +1 -4
- package/src/components/Slider/Slider.tsx +4 -12
- package/src/components/Stack/Stack.tsx +2 -11
- package/src/components/Stepper/Stepper.tsx +1 -7
- package/src/components/Switch/Switch.tsx +19 -11
- package/src/components/Switch/SwitchGroup.tsx +4 -1
- package/src/components/Table/Table.tsx +3 -1
- package/src/components/Tabs/Tabs.tsx +1 -7
- package/src/components/Text/Text.tsx +2 -16
- package/src/components/TextArea/TextArea.tsx +4 -8
- package/src/components/TextField/TextField.tsx +4 -1
- package/src/components/TimePicker/TimePicker.tsx +3 -1
- package/src/components/Timeline/Timeline.tsx +4 -1
- package/src/components/Timeline/TimelineItem.tsx +1 -12
- package/src/components/Title/Title.tsx +1 -6
- package/src/components/Toast/Toast.tsx +1 -13
- package/src/components/Tooltip/Tooltip.tsx +1 -9
- package/src/components/TransferList/TransferList.tsx +3 -1
- package/src/utils/RequireAccessibleLabel.ts +1 -12
- package/src/utils/filterStylingProps.ts +7 -20
|
@@ -12,8 +12,20 @@ import {
|
|
|
12
12
|
} from "../../utils/filterStylingProps";
|
|
13
13
|
import styles from "./Accordion.module.css";
|
|
14
14
|
|
|
15
|
+
import {
|
|
16
|
+
type RecursicaAccordionProps,
|
|
17
|
+
type RecursicaAccordionItemProps,
|
|
18
|
+
type RecursicaAccordionControlProps,
|
|
19
|
+
} from "@recursica/adapter-common";
|
|
20
|
+
|
|
15
21
|
// ==== ACCORDION CONTAINER ====
|
|
16
|
-
export type AccordionProps = RecursicaOverStyled<
|
|
22
|
+
export type AccordionProps = RecursicaOverStyled<
|
|
23
|
+
Omit<
|
|
24
|
+
MantineAccordionProps,
|
|
25
|
+
"value" | "defaultValue" | "onChange" | "multiple" | "variant"
|
|
26
|
+
> &
|
|
27
|
+
RecursicaAccordionProps
|
|
28
|
+
>;
|
|
17
29
|
|
|
18
30
|
const AccordionBase = function Accordion({
|
|
19
31
|
variant = "unstyled",
|
|
@@ -63,29 +75,9 @@ const AccordionBase = function Accordion({
|
|
|
63
75
|
};
|
|
64
76
|
AccordionBase.displayName = "Accordion";
|
|
65
77
|
|
|
66
|
-
// ==== ACCORDION ITEM ====
|
|
67
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
68
|
-
export interface RecursicaAccordionItemProps
|
|
69
|
-
extends Omit<AccordionItemProps, "className"> {}
|
|
70
78
|
// We need to omit and re-merge native props like in Badge
|
|
71
79
|
export type AccordionItemWrapperProps = RecursicaOverStyled<
|
|
72
|
-
AccordionItemProps &
|
|
73
|
-
/**
|
|
74
|
-
* When provided alongside `leftIcon` or independently, this auto-generates the Accordion Control and Panel DOM layers natively.
|
|
75
|
-
*/
|
|
76
|
-
title?: React.ReactNode;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Leading icon explicitly mapped into the Mantine `Accordion.Control` leftSection boundary natively.
|
|
80
|
-
*/
|
|
81
|
-
leftIcon?: React.ReactNode;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Toggles the presence of the bottom trailing divider native to AccordionItems.
|
|
85
|
-
* @default true
|
|
86
|
-
*/
|
|
87
|
-
divider?: boolean;
|
|
88
|
-
}
|
|
80
|
+
AccordionItemProps & RecursicaAccordionItemProps
|
|
89
81
|
>;
|
|
90
82
|
|
|
91
83
|
export const AccordionItem = forwardRef<
|
|
@@ -127,12 +119,7 @@ AccordionItem.displayName = "AccordionItem";
|
|
|
127
119
|
|
|
128
120
|
// ==== ACCORDION CONTROL ====
|
|
129
121
|
export type AccordionControlWrapperProps = RecursicaOverStyled<
|
|
130
|
-
AccordionControlProps &
|
|
131
|
-
/**
|
|
132
|
-
* Leading icon explicitly mapped into the Mantine `Accordion.Control` leftSection boundary natively.
|
|
133
|
-
*/
|
|
134
|
-
leftIcon?: React.ReactNode;
|
|
135
|
-
}
|
|
122
|
+
AccordionControlProps & RecursicaAccordionControlProps
|
|
136
123
|
>;
|
|
137
124
|
|
|
138
125
|
export const AccordionControl = forwardRef<
|
|
@@ -5,12 +5,7 @@ import {
|
|
|
5
5
|
} from "../../utils/filterStylingProps";
|
|
6
6
|
import styles from "./AssistiveElement.module.css";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
/** The semantic variant driving the icon and text colors natively mapped across the UI Kit tokens. */
|
|
10
|
-
assistiveVariant?: "help" | "error";
|
|
11
|
-
/** Explicitly toggle the rendering of the variant-specific SVG bounding box. */
|
|
12
|
-
assistiveWithIcon?: boolean;
|
|
13
|
-
}
|
|
8
|
+
import { type RecursicaAssistiveElementProps } from "@recursica/adapter-common";
|
|
14
9
|
|
|
15
10
|
export type AssistiveElementProps = RecursicaOverStyled<
|
|
16
11
|
React.HTMLAttributes<HTMLDivElement> & RecursicaAssistiveElementProps
|
|
@@ -13,6 +13,8 @@ import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/For
|
|
|
13
13
|
import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
|
|
14
14
|
import styles from "./AutoComplete.module.css";
|
|
15
15
|
|
|
16
|
+
import { type RecursicaAutocompleteProps as BaseRecursicaAutocompleteProps } from "@recursica/adapter-common";
|
|
17
|
+
|
|
16
18
|
export interface RecursicaAutoCompleteProps
|
|
17
19
|
extends Omit<
|
|
18
20
|
MantineAutocompleteProps,
|
|
@@ -26,7 +28,8 @@ export interface RecursicaAutoCompleteProps
|
|
|
26
28
|
RecursicaFormControlWrapperProps,
|
|
27
29
|
"controlMaxWidth" | "controlMinWidth"
|
|
28
30
|
>,
|
|
29
|
-
ReadOnlyControlProps
|
|
31
|
+
ReadOnlyControlProps,
|
|
32
|
+
BaseRecursicaAutocompleteProps {}
|
|
30
33
|
|
|
31
34
|
export type AutoCompleteProps = RecursicaOverStyled<RecursicaAutoCompleteProps>;
|
|
32
35
|
|
|
@@ -10,11 +10,7 @@ import {
|
|
|
10
10
|
} from "../../utils/filterStylingProps";
|
|
11
11
|
import styles from "./Avatar.module.css";
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
size?: "small" | "default" | "large";
|
|
15
|
-
variant?: "solid" | "outline" | "ghost";
|
|
16
|
-
icon?: React.ReactNode;
|
|
17
|
-
}
|
|
13
|
+
import { type RecursicaAvatarProps } from "@recursica/adapter-common";
|
|
18
14
|
|
|
19
15
|
export type AvatarProps = RecursicaOverStyled<
|
|
20
16
|
Omit<MantineAvatarProps, "variant" | "size" | "color" | "radius"> &
|
|
@@ -10,10 +10,7 @@ import {
|
|
|
10
10
|
} from "../../utils/filterStylingProps";
|
|
11
11
|
import styles from "./Badge.module.css";
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
/** Map to the component styles defined in variables */
|
|
15
|
-
variant?: "alert" | "primary-color" | "success" | "warning";
|
|
16
|
-
}
|
|
13
|
+
import { type RecursicaBadgeProps } from "@recursica/adapter-common";
|
|
17
14
|
|
|
18
15
|
export type BadgeProps = RecursicaOverStyled<
|
|
19
16
|
Omit<MantineBadgeProps, "variant" | "size" | "color" | "radius"> &
|
|
@@ -11,8 +11,7 @@ import styles from "./Breadcrumb.module.css";
|
|
|
11
11
|
|
|
12
12
|
// Currently there are no Recursica prop additions specific to Breadcrumbs (like size or variant)
|
|
13
13
|
// according to recursica_ui-kit.json
|
|
14
|
-
|
|
15
|
-
export interface RecursicaBreadcrumbProps {}
|
|
14
|
+
import { type RecursicaBreadcrumbProps } from "@recursica/adapter-common";
|
|
16
15
|
|
|
17
16
|
export type BreadcrumbProps = RecursicaOverStyled<
|
|
18
17
|
Omit<MantineBreadcrumbsProps, "variant" | "size"> & RecursicaBreadcrumbProps
|
|
@@ -31,9 +31,6 @@
|
|
|
31
31
|
letter-spacing: var(
|
|
32
32
|
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_letter-spacing
|
|
33
33
|
);
|
|
34
|
-
line-height: var(
|
|
35
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_line-height
|
|
36
|
-
);
|
|
37
34
|
text-decoration: var(
|
|
38
35
|
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_text-decoration
|
|
39
36
|
);
|
|
@@ -68,7 +65,15 @@
|
|
|
68
65
|
text-overflow: ellipsis;
|
|
69
66
|
white-space: nowrap;
|
|
70
67
|
font-size: inherit;
|
|
71
|
-
line-height:
|
|
68
|
+
line-height: var(
|
|
69
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_line-height
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.root[data-size="small"] .labelText {
|
|
74
|
+
line-height: var(
|
|
75
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_line-height
|
|
76
|
+
);
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
/* ==== SIZES ==== */
|
|
@@ -184,52 +189,25 @@
|
|
|
184
189
|
|
|
185
190
|
/* Override specific typography for small */
|
|
186
191
|
font-family: var(
|
|
187
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-family
|
|
188
|
-
var(
|
|
189
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-family
|
|
190
|
-
)
|
|
192
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-family
|
|
191
193
|
);
|
|
192
194
|
font-size: var(
|
|
193
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-size
|
|
194
|
-
var(
|
|
195
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-size
|
|
196
|
-
)
|
|
195
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-size
|
|
197
196
|
);
|
|
198
197
|
font-weight: var(
|
|
199
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-weight
|
|
200
|
-
var(
|
|
201
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-weight
|
|
202
|
-
)
|
|
198
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-weight
|
|
203
199
|
);
|
|
204
200
|
font-style: var(
|
|
205
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-style
|
|
206
|
-
var(
|
|
207
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-style
|
|
208
|
-
)
|
|
201
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-style
|
|
209
202
|
);
|
|
210
203
|
letter-spacing: var(
|
|
211
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_letter-spacing
|
|
212
|
-
var(
|
|
213
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_letter-spacing
|
|
214
|
-
)
|
|
215
|
-
);
|
|
216
|
-
line-height: var(
|
|
217
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_line-height,
|
|
218
|
-
var(
|
|
219
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_line-height
|
|
220
|
-
)
|
|
204
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_letter-spacing
|
|
221
205
|
);
|
|
222
206
|
text-decoration: var(
|
|
223
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_text-decoration
|
|
224
|
-
var(
|
|
225
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_text-decoration
|
|
226
|
-
)
|
|
207
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_text-decoration
|
|
227
208
|
);
|
|
228
209
|
text-transform: var(
|
|
229
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_text-transform
|
|
230
|
-
var(
|
|
231
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_text_text-transform
|
|
232
|
-
)
|
|
210
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_text_text-transform
|
|
233
211
|
);
|
|
234
212
|
|
|
235
213
|
&[data-content="label"] {
|
|
@@ -340,17 +318,12 @@
|
|
|
340
318
|
}
|
|
341
319
|
.root[data-size="default"]:hover:not(:disabled)::after {
|
|
342
320
|
opacity: var(
|
|
343
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_hover-opacity
|
|
344
|
-
0.1
|
|
321
|
+
--recursica_ui-kit_components_button_variants_sizes_default_properties_hover-opacity
|
|
345
322
|
);
|
|
346
323
|
}
|
|
347
324
|
.root[data-size="small"]:hover:not(:disabled)::after {
|
|
348
325
|
opacity: var(
|
|
349
|
-
--recursica_ui-kit_components_button_variants_sizes_small_properties_hover-opacity
|
|
350
|
-
var(
|
|
351
|
-
--recursica_ui-kit_components_button_variants_sizes_default_properties_hover-opacity,
|
|
352
|
-
0.1
|
|
353
|
-
)
|
|
326
|
+
--recursica_ui-kit_components_button_variants_sizes_small_properties_hover-opacity
|
|
354
327
|
);
|
|
355
328
|
}
|
|
356
329
|
/* ==== VARIANTS ==== */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from "react";
|
|
2
2
|
import { Loader } from "../Loader/Loader";
|
|
3
|
-
import type { RecursicaLoaderProps } from "../Loader/Loader";
|
|
4
3
|
import {
|
|
5
4
|
Button as MantineButton,
|
|
6
5
|
type ButtonProps as MantineButtonProps,
|
|
@@ -12,20 +11,7 @@ import {
|
|
|
12
11
|
} from "../../utils/filterStylingProps";
|
|
13
12
|
import styles from "./Button.module.css";
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
/** The visual style variant of the button */
|
|
17
|
-
variant?: "solid" | "outline" | "text";
|
|
18
|
-
/** The size of the button */
|
|
19
|
-
size?: "default" | "small";
|
|
20
|
-
/** An optional icon element to display to the left of the button text. Replaces Mantine's leftSection. */
|
|
21
|
-
icon?: React.ReactNode;
|
|
22
|
-
/** Which Recursica Loader variant to use */
|
|
23
|
-
loaderVariant?: RecursicaLoaderProps["variant"];
|
|
24
|
-
/** The size variant for the loader */
|
|
25
|
-
loaderSize?: RecursicaLoaderProps["size"];
|
|
26
|
-
/** Whether to use the Recursica loader or fallback to the Mantine loader */
|
|
27
|
-
useRecursicaLoader?: boolean;
|
|
28
|
-
}
|
|
14
|
+
import { type RecursicaButtonProps } from "@recursica/adapter-common";
|
|
29
15
|
|
|
30
16
|
export type ButtonProps = RecursicaOverStyled<
|
|
31
17
|
Omit<MantineButtonProps, "variant" | "size" | "leftSection" | "fullWidth"> &
|
|
@@ -11,8 +11,15 @@ import {
|
|
|
11
11
|
} from "../../utils/filterStylingProps";
|
|
12
12
|
import styles from "./Card.module.css";
|
|
13
13
|
|
|
14
|
+
import {
|
|
15
|
+
type RecursicaCardProps,
|
|
16
|
+
type RecursicaCardSectionProps,
|
|
17
|
+
} from "@recursica/adapter-common";
|
|
18
|
+
|
|
14
19
|
// ==== CARD CONTAINER ====
|
|
15
|
-
export type CardProps = RecursicaOverStyled<
|
|
20
|
+
export type CardProps = RecursicaOverStyled<
|
|
21
|
+
MantineCardProps & RecursicaCardProps
|
|
22
|
+
>;
|
|
16
23
|
|
|
17
24
|
/**
|
|
18
25
|
* The root Card elevation box. It establishes the global background color, border radius, nested component gap, and outer shadow governed by the current `Layer` context.
|
|
@@ -57,11 +64,9 @@ const CardBase = forwardRef<HTMLDivElement, CardProps>(function Card(
|
|
|
57
64
|
});
|
|
58
65
|
CardBase.displayName = "Card";
|
|
59
66
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
64
|
-
export type CardSectionProps = RecursicaOverStyled<RecursicaCardSectionProps>;
|
|
67
|
+
export type CardSectionProps = RecursicaOverStyled<
|
|
68
|
+
MantineCardSectionProps & RecursicaCardSectionProps
|
|
69
|
+
>;
|
|
65
70
|
|
|
66
71
|
/**
|
|
67
72
|
* A generalized edge-to-edge structural wrapper native to Mantine. Strips typical boundary padding via negative margins to allow content (like maps or header images) to touch the border seamlessly.
|
|
@@ -11,17 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
/* --- GROUP STYLES --- */
|
|
13
13
|
.groupRoot {
|
|
14
|
-
padding: var(
|
|
15
|
-
--recursica_ui-kit_components_checkbox-group_properties_padding,
|
|
16
|
-
0
|
|
17
|
-
);
|
|
14
|
+
padding: var(--recursica_ui-kit_components_checkbox-group_properties_padding);
|
|
18
15
|
margin: 0; /* HARDCODE: structural reset; consider token if layout needs change */
|
|
19
16
|
display: flex;
|
|
20
17
|
flex-direction: column;
|
|
21
|
-
gap: var(
|
|
22
|
-
--recursica_ui-kit_components_checkbox-group_properties_item-gap,
|
|
23
|
-
16px
|
|
24
|
-
);
|
|
18
|
+
gap: var(--recursica_ui-kit_components_checkbox-group_properties_item-gap);
|
|
25
19
|
}
|
|
26
20
|
|
|
27
21
|
/* SideBySide Variant */
|
|
@@ -118,7 +112,8 @@
|
|
|
118
112
|
}
|
|
119
113
|
|
|
120
114
|
/* Checked/Indeterminate State */
|
|
121
|
-
.input:checked
|
|
115
|
+
.input:checked,
|
|
116
|
+
.inputChecked {
|
|
122
117
|
background-color: var(
|
|
123
118
|
--recursica_ui-kit_components_checkbox_properties_colors_background-checked
|
|
124
119
|
);
|
|
@@ -126,7 +121,8 @@
|
|
|
126
121
|
--recursica_ui-kit_components_checkbox_properties_colors_border-checked
|
|
127
122
|
);
|
|
128
123
|
}
|
|
129
|
-
.input[data-indeterminate]
|
|
124
|
+
.input[data-indeterminate],
|
|
125
|
+
.inputIndeterminate {
|
|
130
126
|
background-color: var(
|
|
131
127
|
--recursica_ui-kit_components_checkbox_properties_colors_background-indeterminate
|
|
132
128
|
);
|
|
@@ -9,7 +9,10 @@ import {
|
|
|
9
9
|
filterStylingProps,
|
|
10
10
|
type RecursicaOverStyled,
|
|
11
11
|
} from "../../utils/filterStylingProps";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
type RequireAccessibleLabel,
|
|
14
|
+
type RecursicaCheckboxProps,
|
|
15
|
+
} from "@recursica/adapter-common";
|
|
13
16
|
import {
|
|
14
17
|
FormControlLayout,
|
|
15
18
|
type FormControlLayoutProps,
|
|
@@ -17,19 +20,21 @@ import {
|
|
|
17
20
|
|
|
18
21
|
import styles from "./Checkbox.module.css";
|
|
19
22
|
|
|
20
|
-
export type
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
export type CheckboxWrapperProps = Omit<
|
|
24
|
+
MantineCheckboxProps,
|
|
25
|
+
"size" | "color" | "radius" | "iconColor" | "variant"
|
|
26
|
+
> &
|
|
27
|
+
RecursicaCheckboxProps &
|
|
28
|
+
ReadOnlyControlProps &
|
|
29
|
+
Pick<
|
|
30
|
+
FormControlLayoutProps,
|
|
31
|
+
"formLayout" | "labelSize" | "controlMaxWidth" | "controlMinWidth"
|
|
32
|
+
>;
|
|
33
|
+
|
|
34
|
+
export type RecursicaCheckboxPropsAlias =
|
|
35
|
+
RequireAccessibleLabel<CheckboxWrapperProps>;
|
|
36
|
+
|
|
37
|
+
export type CheckboxProps = RecursicaOverStyled<RecursicaCheckboxPropsAlias>;
|
|
33
38
|
|
|
34
39
|
type CheckboxComponent = React.ForwardRefExoticComponent<
|
|
35
40
|
CheckboxProps & React.RefAttributes<HTMLInputElement>
|
|
@@ -13,13 +13,16 @@ import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/For
|
|
|
13
13
|
import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
|
|
14
14
|
import styles from "./Checkbox.module.css";
|
|
15
15
|
|
|
16
|
+
import { type RecursicaCheckboxGroupProps as BaseRecursicaCheckboxGroupProps } from "@recursica/adapter-common";
|
|
17
|
+
|
|
16
18
|
export interface RecursicaCheckboxGroupProps
|
|
17
19
|
extends Omit<MantineCheckboxGroupProps, "size" | "labelProps">,
|
|
18
20
|
Omit<
|
|
19
21
|
RecursicaFormControlWrapperProps,
|
|
20
22
|
"controlMaxWidth" | "controlMinWidth"
|
|
21
23
|
>,
|
|
22
|
-
ReadOnlyControlProps
|
|
24
|
+
ReadOnlyControlProps,
|
|
25
|
+
BaseRecursicaCheckboxGroupProps {}
|
|
23
26
|
|
|
24
27
|
export type CheckboxGroupProps =
|
|
25
28
|
RecursicaOverStyled<RecursicaCheckboxGroupProps>;
|
|
@@ -14,7 +14,6 @@ Because the `.label` is the primary visual surface and handles Mantine's built-i
|
|
|
14
14
|
|
|
15
15
|
### Icon and Remove Implementations
|
|
16
16
|
|
|
17
|
-
The Recursica specifications for the Chip component define `--chip-icon` and `--chip-close` which map to leading and trailing states.
|
|
18
17
|
To achieve this without breaking Mantine's `Chip` input architecture, we wrapped the internal `children` using a standard `span` DOM strategy:
|
|
19
18
|
|
|
20
19
|
```tsx
|
|
@@ -25,6 +24,10 @@ To achieve this without breaking Mantine's `Chip` input architecture, we wrapped
|
|
|
25
24
|
</span>
|
|
26
25
|
```
|
|
27
26
|
|
|
27
|
+
#### Intermediate Children Wrapper Span display fix:
|
|
28
|
+
|
|
29
|
+
Mantine internally wraps the children passed to `Chip` in a default `<span>` which has `display: inline`. This intermediate `span` inherits the `line-height` of the `.label` container, causing the computed height of the Chip to be ~2px taller than expected. To address this, `.label > span:not(.mantineIconWrapper)` is targeted to force `display: inline-flex; align-items: center;` on that intermediate wrapper `span`, allowing it to collapse perfectly to the `16px` height of the `innerWrapper`.
|
|
30
|
+
|
|
28
31
|
### Accessibility of Remove Action
|
|
29
32
|
|
|
30
33
|
Because the Chip fundamentally functions as a `<label>` linked to an `<input>`, placing a raw interactive element like `<button>` directly inside the standard Chip sub-tree violates nested interactive element ARIA constraints in strict validators.
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
background: transparent; (Override mantine default)
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
.root {
|
|
26
|
+
.root.root {
|
|
27
27
|
/* Set preset layout variables to override mantine defaults safely */
|
|
28
28
|
box-sizing: border-box;
|
|
29
29
|
display: inline-flex;
|
|
@@ -46,24 +46,30 @@
|
|
|
46
46
|
--recursica_ui-kit_components_chip_variants_styles_unselected_properties_colors_close-icon-color
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
/* Override Mantine's internal variables */
|
|
50
|
+
--chip-size: max-content;
|
|
51
|
+
--chip-radius: var(
|
|
50
52
|
--recursica_ui-kit_components_chip_properties_border-radius
|
|
51
53
|
);
|
|
54
|
+
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
user-select: none;
|
|
57
|
+
overflow: hidden;
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
/* We target the mantine label directly because that is the visible container in Mantine's Chip */
|
|
55
|
-
.label {
|
|
61
|
+
.label.label {
|
|
56
62
|
box-sizing: border-box;
|
|
57
63
|
display: inline-flex;
|
|
58
64
|
align-items: center;
|
|
59
65
|
justify-content: center;
|
|
60
66
|
|
|
61
67
|
/* Reset mantine styles */
|
|
62
|
-
background: transparent
|
|
68
|
+
background: transparent; /* HARDCODE: Mantine forces background styling on label */
|
|
63
69
|
border-style: solid;
|
|
64
70
|
border-width: var(--recursica_ui-kit_components_chip_properties_border-size);
|
|
65
71
|
padding: var(--recursica_ui-kit_components_chip_properties_vertical-padding)
|
|
66
|
-
var(--recursica_ui-kit_components_chip_properties_horizontal-padding)
|
|
72
|
+
var(--recursica_ui-kit_components_chip_properties_horizontal-padding);
|
|
67
73
|
|
|
68
74
|
/* Typography */
|
|
69
75
|
font-family: var(
|
|
@@ -90,21 +96,27 @@
|
|
|
90
96
|
);
|
|
91
97
|
|
|
92
98
|
/* Token evaluation */
|
|
93
|
-
background-color: var(--chip-bg)
|
|
94
|
-
border-color: var(--chip-border)
|
|
95
|
-
color: var(--chip-text)
|
|
99
|
+
background-color: var(--chip-bg);
|
|
100
|
+
border-color: var(--chip-border);
|
|
101
|
+
color: var(--chip-text);
|
|
96
102
|
min-width: var(--recursica_ui-kit_components_chip_properties_min-width);
|
|
97
103
|
max-width: var(--recursica_ui-kit_components_chip_properties_max-width);
|
|
98
|
-
box-shadow: var(
|
|
99
|
-
--recursica_ui-kit_components_chip_properties_elevation,
|
|
100
|
-
none
|
|
101
|
-
);
|
|
104
|
+
box-shadow: var(--recursica_ui-kit_components_chip_properties_elevation);
|
|
102
105
|
|
|
103
106
|
transition: all 0.2s ease;
|
|
104
107
|
}
|
|
105
108
|
|
|
109
|
+
.label.label > span:not(.mantineIconWrapper) {
|
|
110
|
+
display: inline-flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.label.label:hover {
|
|
115
|
+
background-color: var(--chip-bg);
|
|
116
|
+
}
|
|
117
|
+
|
|
106
118
|
/* Default (Unselected) hover/active interactions (Mantine overrides) */
|
|
107
|
-
.label[data-checked] {
|
|
119
|
+
.label.label[data-checked] {
|
|
108
120
|
--chip-bg: var(
|
|
109
121
|
--recursica_ui-kit_components_chip_variants_styles_selected_properties_colors_background
|
|
110
122
|
);
|
|
@@ -122,7 +134,7 @@
|
|
|
122
134
|
);
|
|
123
135
|
}
|
|
124
136
|
|
|
125
|
-
.root[data-error] .label {
|
|
137
|
+
.root[data-error] .label.label {
|
|
126
138
|
--chip-bg: var(
|
|
127
139
|
--recursica_ui-kit_components_chip_variants_styles_error_properties_colors_background
|
|
128
140
|
);
|
|
@@ -140,7 +152,7 @@
|
|
|
140
152
|
);
|
|
141
153
|
}
|
|
142
154
|
|
|
143
|
-
.root[data-error] .label[data-checked] {
|
|
155
|
+
.root[data-error] .label.label[data-checked] {
|
|
144
156
|
--chip-bg: var(
|
|
145
157
|
--recursica_ui-kit_components_chip_variants_styles_error-selected_properties_colors_background
|
|
146
158
|
);
|
|
@@ -158,20 +170,16 @@
|
|
|
158
170
|
);
|
|
159
171
|
}
|
|
160
172
|
|
|
161
|
-
.root[data-disabled] .label {
|
|
162
|
-
opacity: var(--recursica_brand_states_disabled
|
|
173
|
+
.root[data-disabled] .label.label {
|
|
174
|
+
opacity: var(--recursica_brand_states_disabled);
|
|
163
175
|
cursor: not-allowed;
|
|
164
176
|
}
|
|
165
177
|
|
|
166
178
|
/* Override Mantine's built-in check icon colors and size if we keep it */
|
|
167
|
-
.mantineIconWrapper {
|
|
168
|
-
color: var(--chip-icon)
|
|
169
|
-
width: var(
|
|
170
|
-
|
|
171
|
-
) !important;
|
|
172
|
-
height: var(
|
|
173
|
-
--recursica_ui-kit_components_chip_properties_icon-size
|
|
174
|
-
) !important;
|
|
179
|
+
.mantineIconWrapper.mantineIconWrapper {
|
|
180
|
+
color: var(--chip-icon);
|
|
181
|
+
width: var(--recursica_ui-kit_components_chip_properties_icon-size);
|
|
182
|
+
height: var(--recursica_ui-kit_components_chip_properties_icon-size);
|
|
175
183
|
margin-right: var(
|
|
176
184
|
--recursica_ui-kit_components_chip_properties_icon-text-gap
|
|
177
185
|
);
|
|
@@ -226,11 +234,11 @@
|
|
|
226
234
|
height: 100%;
|
|
227
235
|
}
|
|
228
236
|
|
|
229
|
-
.root[data-icon-only] .label {
|
|
237
|
+
.root[data-icon-only] .label.label {
|
|
230
238
|
padding-left: var(
|
|
231
239
|
--recursica_ui-kit_components_chip_properties_vertical-padding
|
|
232
|
-
)
|
|
240
|
+
);
|
|
233
241
|
padding-right: var(
|
|
234
242
|
--recursica_ui-kit_components_chip_properties_vertical-padding
|
|
235
|
-
)
|
|
243
|
+
);
|
|
236
244
|
}
|
|
@@ -8,20 +8,7 @@ import {
|
|
|
8
8
|
type RecursicaOverStyled,
|
|
9
9
|
} from "../../utils/filterStylingProps";
|
|
10
10
|
import styles from "./Chip.module.css";
|
|
11
|
-
|
|
12
|
-
export interface RecursicaChipProps {
|
|
13
|
-
/** Enables the error state styling */
|
|
14
|
-
error?: boolean;
|
|
15
|
-
|
|
16
|
-
/** Leading icon content */
|
|
17
|
-
icon?: React.ReactNode;
|
|
18
|
-
|
|
19
|
-
/** Called when the remove (X) icon is clicked. If provided, the remove icon will be displayed. */
|
|
20
|
-
onRemove?: (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
|
|
21
|
-
|
|
22
|
-
/** Screen reader label for the remove button. Defaults to 'Remove' */
|
|
23
|
-
removeLabel?: string;
|
|
24
|
-
}
|
|
11
|
+
import { type RecursicaChipProps } from "@recursica/adapter-common";
|
|
25
12
|
|
|
26
13
|
export type ChipProps = RecursicaOverStyled<
|
|
27
14
|
Omit<MantineChipProps, "variant" | "size" | "color" | "radius"> &
|
|
@@ -92,14 +79,20 @@ export const Chip = forwardRef<HTMLInputElement, ChipProps>(function Chip(
|
|
|
92
79
|
// Determine state
|
|
93
80
|
const dataError = error ? "" : undefined;
|
|
94
81
|
const isIconOnly = !children && (!!icon || !!onRemove);
|
|
82
|
+
const isInteractive =
|
|
83
|
+
restRecord.checked !== undefined ||
|
|
84
|
+
restRecord.defaultChecked !== undefined ||
|
|
85
|
+
onRemove !== undefined ||
|
|
86
|
+
restRecord.onClick !== undefined;
|
|
95
87
|
|
|
96
88
|
return (
|
|
97
89
|
<MantineChip
|
|
98
90
|
ref={ref}
|
|
99
91
|
className={finalClass}
|
|
100
92
|
classNames={mergedClassNames}
|
|
101
|
-
{
|
|
93
|
+
wrapperProps={dataError !== undefined ? { "data-error": "" } : undefined}
|
|
102
94
|
{...(isIconOnly ? { "data-icon-only": "" } : {})}
|
|
95
|
+
{...(!isInteractive ? { tabIndex: -1, "aria-hidden": true } : {})}
|
|
103
96
|
{...sanitizedProps}
|
|
104
97
|
>
|
|
105
98
|
<span className={styles.innerWrapper}>
|
|
@@ -3,27 +3,9 @@ import {
|
|
|
3
3
|
Container as MantineContainer,
|
|
4
4
|
type ContainerProps as MantineContainerProps,
|
|
5
5
|
} from "@mantine/core";
|
|
6
|
-
import { type RecursicaSpacing } from "../../utils/filterStylingProps";
|
|
7
6
|
import styles from "./Container.module.css";
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Children components inside the layout container
|
|
12
|
-
*/
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
/**
|
|
15
|
-
* Maximum width defined by Mantine system sizes or Recursica sizes
|
|
16
|
-
*/
|
|
17
|
-
size?:
|
|
18
|
-
| "xs"
|
|
19
|
-
| "sm"
|
|
20
|
-
| "md"
|
|
21
|
-
| "lg"
|
|
22
|
-
| "xl"
|
|
23
|
-
| RecursicaSpacing
|
|
24
|
-
| (string & {})
|
|
25
|
-
| number;
|
|
26
|
-
}
|
|
8
|
+
import { type RecursicaContainerProps } from "@recursica/adapter-common";
|
|
27
9
|
|
|
28
10
|
/**
|
|
29
11
|
* Container layout wrapper.
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
.root {
|
|
31
31
|
display: flex;
|
|
32
32
|
position: relative;
|
|
33
|
-
width: var(--recursica_ui-kit_components_date-picker_properties_width
|
|
33
|
+
width: var(--recursica_ui-kit_components_date-picker_properties_width);
|
|
34
34
|
min-height: var(
|
|
35
35
|
--recursica_ui-kit_components_date-picker_properties_min-height
|
|
36
36
|
);
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
color: var(
|
|
273
273
|
--recursica_ui-kit_components_hover-card-popover_properties_colors_content
|
|
274
274
|
);
|
|
275
|
-
border-radius: var(--recursica_brand_dimensions_border-radii_default
|
|
275
|
+
border-radius: var(--recursica_brand_dimensions_border-radii_default);
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
.day[data-selected],
|