@recursica/mantine-adapter 0.42.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/index.d.ts +93 -15
- package/dist/mantine-adapter.cjs +2 -2
- package/dist/mantine-adapter.cjs.map +1 -1
- package/dist/mantine-adapter.css +1 -1
- package/dist/mantine-adapter.js +3546 -3250
- package/dist/mantine-adapter.js.map +1 -1
- package/package.json +1 -1
- package/src/GlobalExemptions.modules.css +0 -6
- package/src/components/Accordion/Accordion.module.css +0 -8
- package/src/components/Accordion/Accordion.tsx +32 -33
- package/src/components/AssistiveElement/AssistiveElement.tsx +1 -1
- package/src/components/AutoComplete/AutoComplete.module.css +0 -7
- package/src/components/AutoComplete/AutoComplete.tsx +26 -38
- package/src/components/Avatar/Avatar.module.css +0 -8
- package/src/components/Avatar/Avatar.tsx +22 -23
- package/src/components/Badge/Badge.tsx +12 -18
- package/src/components/Breadcrumb/Breadcrumb.tsx +10 -18
- package/src/components/Button/Button.tsx +31 -30
- package/src/components/Card/Card.tsx +48 -27
- package/src/components/Checkbox/Checkbox.tsx +29 -42
- package/src/components/Checkbox/CheckboxGroup.tsx +12 -5
- package/src/components/Chip/Chip.module.css +0 -16
- package/src/components/Chip/Chip.tsx +34 -27
- package/src/components/DatePicker/DATEPICKER_IMPLEMENTATION_NOTES.md +14 -1
- package/src/components/DatePicker/DatePicker.icons.tsx +27 -0
- package/src/components/DatePicker/DatePicker.module.css +256 -7
- package/src/components/DatePicker/DatePicker.stories.tsx +0 -7
- package/src/components/DatePicker/DatePicker.tsx +68 -33
- package/src/components/DatePicker/USAGE.md +6 -2
- package/src/components/Dropdown/BareDropdown.tsx +25 -13
- package/src/components/Dropdown/Dropdown.module.css +0 -7
- package/src/components/Dropdown/Dropdown.tsx +25 -38
- package/src/components/FileInput/FileInput.module.css +0 -21
- package/src/components/FileInput/FileInput.tsx +1 -1
- package/src/components/FileUpload/FileUpload.module.css +0 -11
- package/src/components/FileUpload/FileUpload.tsx +1 -1
- package/src/components/HoverCard/HoverCard.module.css +1 -7
- package/src/components/HoverCard/HoverCard.tsx +18 -34
- package/src/components/Label/Label.module.css +0 -6
- package/src/components/Label/Label.tsx +20 -21
- package/src/components/Link/Link.module.css +1 -6
- package/src/components/Link/Link.tsx +6 -14
- package/src/components/Loader/Loader.tsx +8 -16
- package/src/components/Menu/Menu.module.css +0 -6
- package/src/components/Menu/Menu.tsx +55 -48
- package/src/components/Modal/Modal.module.css +0 -11
- package/src/components/Modal/Modal.tsx +134 -96
- package/src/components/NumberInput/NumberInput.module.css +0 -7
- package/src/components/NumberInput/NumberInput.tsx +14 -7
- package/src/components/Pagination/Pagination.module.css +0 -81
- package/src/components/Pagination/Pagination.tsx +25 -34
- package/src/components/Panel/Panel.tsx +19 -26
- package/src/components/Popover/Popover.tsx +19 -31
- package/src/components/Radio/Radio.tsx +32 -43
- package/src/components/Radio/RadioGroup.tsx +11 -4
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +1 -1
- package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +1 -1
- package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +1 -1
- package/src/components/SegmentedControl/SegmentedControl.module.css +0 -1
- package/src/components/SegmentedControl/SegmentedControl.tsx +29 -33
- package/src/components/Slider/Slider.tsx +30 -43
- package/src/components/Stepper/Stepper.tsx +20 -13
- package/src/components/Switch/Switch.tsx +45 -45
- package/src/components/Switch/SwitchGroup.tsx +11 -4
- package/src/components/Table/Table.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +13 -6
- package/src/components/Text/Text.tsx +1 -1
- package/src/components/TextArea/TextArea.module.css +0 -7
- package/src/components/TextArea/TextArea.tsx +21 -25
- package/src/components/TextField/TextField.module.css +0 -7
- package/src/components/TextField/TextField.tsx +23 -30
- package/src/components/TimePicker/TimePicker.module.css +0 -16
- package/src/components/TimePicker/TimePicker.tsx +26 -12
- package/src/components/Timeline/Timeline.module.css +0 -6
- package/src/components/Timeline/Timeline.tsx +7 -21
- package/src/components/Timeline/TimelineItem.tsx +14 -26
- package/src/components/Title/Title.tsx +12 -2
- package/src/components/Toast/Toast.module.css +0 -7
- package/src/components/Toast/Toast.tsx +32 -31
- package/src/components/Tooltip/Tooltip.module.css +0 -9
- package/src/components/Tooltip/Tooltip.tsx +18 -34
- package/src/components/TransferList/TransferList.module.css +0 -8
- package/src/components/TransferList/TransferList.tsx +1 -1
- package/src/components/Tree/Tree.tsx +8 -8
- package/src/utils/filterStylingProps.ts +4 -0
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/* EXEMPTIONS:
|
|
2
|
-
- state-specific border-size variables are ignored because a uniform border-size is applied
|
|
3
|
-
globally to prevent unexpected layout shift or flickering during disabled/error transitions.
|
|
4
|
-
- icon-size/icon-color/icon-text-gap have no equivalent here: the time field has no icon slot,
|
|
5
|
-
unlike TextField/DatePicker.
|
|
6
|
-
- placeholder-opacity has no direct equivalent: each SpinInput's native "--" placeholder is styled
|
|
7
|
-
by Mantine's own SpinInput internals, not a ::placeholder pseudo-element we can target directly. */
|
|
8
|
-
/* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_disabled_properties_border-size */
|
|
9
|
-
/* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_error_properties_border-size */
|
|
10
|
-
/* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_icon-size */
|
|
11
|
-
/* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_icon-text-gap */
|
|
12
|
-
/* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_placeholder-opacity */
|
|
13
|
-
/* recursica-ignore: --recursica_ui-kit_components_time-picker_properties_colors_icon-color */
|
|
14
|
-
/* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_disabled_properties_colors_icon-color */
|
|
15
|
-
/* recursica-ignore: --recursica_ui-kit_components_time-picker_variants_states_error_properties_colors_icon-color */
|
|
16
|
-
|
|
17
1
|
/* LAYOUT SPACING OVERRIDES:
|
|
18
2
|
- Sets the --form-control-margin-bottom spacing hook to map component-specific layout tokens. */
|
|
19
3
|
.layoutOverride {
|
|
@@ -7,6 +7,8 @@ import { type InputWrapperProps } from "@mantine/core";
|
|
|
7
7
|
import { type ReadOnlyControlProps } from "@recursica/adapter-common";
|
|
8
8
|
import {
|
|
9
9
|
filterStylingProps,
|
|
10
|
+
omitUnsupportedProps,
|
|
11
|
+
mergeClassNames,
|
|
10
12
|
type RecursicaOverStyled,
|
|
11
13
|
} from "../../utils/filterStylingProps";
|
|
12
14
|
import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/FormControlWrapper";
|
|
@@ -102,6 +104,14 @@ export interface RecursicaTimePickerProps
|
|
|
102
104
|
|
|
103
105
|
export type TimePickerProps = RecursicaOverStyled<RecursicaTimePickerProps>;
|
|
104
106
|
|
|
107
|
+
// Props this component intentionally doesn't support — deleted at runtime so they can't leak
|
|
108
|
+
// through even if a caller forces them via plain JavaScript, bypassing the `Omit<>` above.
|
|
109
|
+
const UNSUPPORTED_PROPS = [
|
|
110
|
+
"size", // Recursica controls sizing via the `size` variant + design tokens, not raw dimensions.
|
|
111
|
+
"variant", // Colors/variants are token-driven; the library's native palette isn't exposed.
|
|
112
|
+
"radius", // Recursica does not expose the library's native corner-radius system.
|
|
113
|
+
] as const satisfies readonly (keyof MantineTimePickerProps)[];
|
|
114
|
+
|
|
105
115
|
export const TimePicker = forwardRef<HTMLDivElement, TimePickerProps>(
|
|
106
116
|
function TimePicker(props, ref) {
|
|
107
117
|
const {
|
|
@@ -137,13 +147,12 @@ export const TimePicker = forwardRef<HTMLDivElement, TimePickerProps>(
|
|
|
137
147
|
...rest
|
|
138
148
|
} = props;
|
|
139
149
|
|
|
140
|
-
const sanitizedProps =
|
|
150
|
+
const sanitizedProps = omitUnsupportedProps(
|
|
151
|
+
filterStylingProps(rest, overStyled) as Record<string, unknown>,
|
|
152
|
+
UNSUPPORTED_PROPS,
|
|
153
|
+
);
|
|
141
154
|
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
142
155
|
|
|
143
|
-
delete restRecord["size"];
|
|
144
|
-
delete restRecord["variant"];
|
|
145
|
-
delete restRecord["radius"];
|
|
146
|
-
|
|
147
156
|
// Internal full 24-hour value. Needed because Mantine's TimePicker (hour/minute/second entry)
|
|
148
157
|
// and our own BareDropdown (AM/PM) both mutate the same conceptual value — see
|
|
149
158
|
// TIMEPICKER_IMPLEMENTATION_NOTES.md.
|
|
@@ -241,12 +250,18 @@ export const TimePicker = forwardRef<HTMLDivElement, TimePickerProps>(
|
|
|
241
250
|
>
|
|
242
251
|
<MantineTimePicker
|
|
243
252
|
ref={ref}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
253
|
+
{...(sanitizedProps as unknown as MantineTimePickerProps)}
|
|
254
|
+
classNames={mergeClassNames(
|
|
255
|
+
{
|
|
256
|
+
wrapper: styles.timeWrapper,
|
|
257
|
+
input: styles.timeInput,
|
|
258
|
+
fieldsGroup: styles.fieldsGroup,
|
|
259
|
+
field: styles.timeField,
|
|
260
|
+
},
|
|
261
|
+
restRecord.classNames as
|
|
262
|
+
| Partial<Record<string, string>>
|
|
263
|
+
| undefined,
|
|
264
|
+
)}
|
|
250
265
|
disabled={disabled}
|
|
251
266
|
value={internalValue}
|
|
252
267
|
onChange={handleFieldChange}
|
|
@@ -259,7 +274,6 @@ export const TimePicker = forwardRef<HTMLDivElement, TimePickerProps>(
|
|
|
259
274
|
// to seed the mount-time AM default onto Mantine's own hidden native select. See
|
|
260
275
|
// TIMEPICKER_IMPLEMENTATION_NOTES.md.
|
|
261
276
|
amPmRef={amPmRef}
|
|
262
|
-
{...(sanitizedProps as unknown as MantineTimePickerProps)}
|
|
263
277
|
/>
|
|
264
278
|
<BareDropdown
|
|
265
279
|
overStyled
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/* EXEMPTIONS:
|
|
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. */
|
|
5
|
-
/* recursica-ignore: --recursica_ui-kit_components_timeline-bullet_variants_types_avatar_properties_avatar-size */
|
|
6
|
-
|
|
7
1
|
.root {
|
|
8
2
|
display: flex;
|
|
9
3
|
flex-direction: column;
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
} from "@mantine/core";
|
|
6
6
|
import {
|
|
7
7
|
filterStylingProps,
|
|
8
|
+
mergeClassNames,
|
|
8
9
|
type RecursicaOverStyled,
|
|
9
10
|
} from "../../utils/filterStylingProps";
|
|
10
11
|
import styles from "./Timeline.module.css";
|
|
@@ -46,36 +47,21 @@ interface TimelineComponent
|
|
|
46
47
|
const TimelineInner = React.forwardRef<HTMLDivElement, TimelineProps>(
|
|
47
48
|
function Timeline({ overStyled = false, ...rest }, ref) {
|
|
48
49
|
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
50
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
49
51
|
|
|
50
|
-
const mergedClassNames
|
|
51
|
-
root: styles.root,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const classNamesProp = (sanitizedProps as Record<string, unknown>)
|
|
55
|
-
.classNames;
|
|
56
|
-
if (
|
|
57
|
-
classNamesProp &&
|
|
58
|
-
typeof classNamesProp === "object" &&
|
|
59
|
-
!Array.isArray(classNamesProp)
|
|
60
|
-
) {
|
|
61
|
-
const o = classNamesProp as Record<string, string>;
|
|
62
|
-
Object.keys(o).forEach((key) => {
|
|
63
|
-
if (mergedClassNames[key]) {
|
|
64
|
-
mergedClassNames[key] = `${mergedClassNames[key]} ${o[key]}`;
|
|
65
|
-
} else {
|
|
66
|
-
mergedClassNames[key] = o[key];
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
52
|
+
const mergedClassNames = mergeClassNames(
|
|
53
|
+
{ root: styles.root },
|
|
54
|
+
restRecord.classNames as Partial<Record<string, string>> | undefined,
|
|
55
|
+
);
|
|
70
56
|
|
|
71
57
|
return (
|
|
72
58
|
<MantineTimeline
|
|
73
59
|
ref={ref}
|
|
74
|
-
classNames={mergedClassNames}
|
|
75
60
|
{...(sanitizedProps as unknown as Omit<
|
|
76
61
|
MantineTimelineProps,
|
|
77
62
|
"color" | "radius" | "bulletSize" | "lineWidth"
|
|
78
63
|
>)}
|
|
64
|
+
classNames={mergedClassNames}
|
|
79
65
|
/>
|
|
80
66
|
);
|
|
81
67
|
},
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
} from "@mantine/core";
|
|
6
6
|
import {
|
|
7
7
|
filterStylingProps,
|
|
8
|
+
mergeClassNames,
|
|
8
9
|
type RecursicaOverStyled,
|
|
9
10
|
} from "../../utils/filterStylingProps";
|
|
10
11
|
import styles from "./Timeline.module.css";
|
|
@@ -36,31 +37,18 @@ export const TimelineItem = React.forwardRef<HTMLDivElement, TimelineItemProps>(
|
|
|
36
37
|
ref,
|
|
37
38
|
) {
|
|
38
39
|
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
40
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
39
41
|
|
|
40
|
-
const mergedClassNames
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
classNamesProp &&
|
|
52
|
-
typeof classNamesProp === "object" &&
|
|
53
|
-
!Array.isArray(classNamesProp)
|
|
54
|
-
) {
|
|
55
|
-
const o = classNamesProp as Record<string, string>;
|
|
56
|
-
Object.keys(o).forEach((key) => {
|
|
57
|
-
if (mergedClassNames[key]) {
|
|
58
|
-
mergedClassNames[key] = `${mergedClassNames[key]} ${o[key]}`;
|
|
59
|
-
} else {
|
|
60
|
-
mergedClassNames[key] = o[key];
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}
|
|
42
|
+
const mergedClassNames = mergeClassNames(
|
|
43
|
+
{
|
|
44
|
+
item: styles.item,
|
|
45
|
+
itemBody: styles.itemBody,
|
|
46
|
+
itemContent: styles.itemContent,
|
|
47
|
+
itemBullet: styles.itemBullet,
|
|
48
|
+
itemTitle: styles.itemTitle,
|
|
49
|
+
},
|
|
50
|
+
restRecord.classNames as Partial<Record<string, string>> | undefined,
|
|
51
|
+
);
|
|
64
52
|
|
|
65
53
|
// Embed timestamp inside children if provided, wrapped in a specific class
|
|
66
54
|
const content = timestamp ? (
|
|
@@ -75,12 +63,12 @@ export const TimelineItem = React.forwardRef<HTMLDivElement, TimelineItemProps>(
|
|
|
75
63
|
return (
|
|
76
64
|
<MantineTimelineItem
|
|
77
65
|
ref={ref}
|
|
78
|
-
classNames={mergedClassNames}
|
|
79
|
-
data-variant={bulletVariant}
|
|
80
66
|
{...(sanitizedProps as unknown as Omit<
|
|
81
67
|
MantineTimelineItemProps,
|
|
82
68
|
"radius" | "color" | "lineVariant"
|
|
83
69
|
>)}
|
|
70
|
+
classNames={mergedClassNames}
|
|
71
|
+
data-variant={bulletVariant}
|
|
84
72
|
>
|
|
85
73
|
{content}
|
|
86
74
|
</MantineTimelineItem>
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
} from "@mantine/core";
|
|
6
6
|
import {
|
|
7
7
|
filterStylingProps,
|
|
8
|
+
omitUnsupportedProps,
|
|
8
9
|
type RecursicaOverStyled,
|
|
9
10
|
} from "../../utils/filterStylingProps";
|
|
10
11
|
|
|
@@ -21,7 +22,16 @@ export const Title = forwardRef<HTMLHeadingElement, TitleProps>(function Title(
|
|
|
21
22
|
{ overStyled = false, order = 1, ...rest },
|
|
22
23
|
ref,
|
|
23
24
|
) {
|
|
24
|
-
|
|
25
|
+
// Props this component intentionally doesn't support — deleted at runtime so they can't leak
|
|
26
|
+
// through even if a caller forces them via plain JavaScript, bypassing the `Omit<>` above.
|
|
27
|
+
const UNSUPPORTED_PROPS = [
|
|
28
|
+
"size", // Recursica controls Title sizing via the `order` prop + typography tokens, not Mantine's native `size`.
|
|
29
|
+
] as const satisfies readonly (keyof MantineTitleProps)[];
|
|
30
|
+
|
|
31
|
+
const sanitizedProps = omitUnsupportedProps(
|
|
32
|
+
filterStylingProps(rest, overStyled),
|
|
33
|
+
UNSUPPORTED_PROPS,
|
|
34
|
+
);
|
|
25
35
|
const classNameProp = (sanitizedProps as Record<string, unknown>)
|
|
26
36
|
.className as string | undefined;
|
|
27
37
|
|
|
@@ -33,9 +43,9 @@ export const Title = forwardRef<HTMLHeadingElement, TitleProps>(function Title(
|
|
|
33
43
|
return (
|
|
34
44
|
<MantineTitle
|
|
35
45
|
ref={ref}
|
|
46
|
+
{...(sanitizedProps as unknown as MantineTitleProps)}
|
|
36
47
|
order={order}
|
|
37
48
|
className={mergedClassName}
|
|
38
|
-
{...(sanitizedProps as unknown as MantineTitleProps)}
|
|
39
49
|
/>
|
|
40
50
|
);
|
|
41
51
|
});
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/* EXEMPTIONS:
|
|
2
|
-
- elevation levels layer-1, layer-2, and layer-3 are ignored because all toasts explicitly use the standard
|
|
3
|
-
layer-0 elevation shadow for styling consistency. */
|
|
4
|
-
/* recursica-ignore: --recursica_ui-kit_components_toast_properties_elevation_layer-1 */
|
|
5
|
-
/* recursica-ignore: --recursica_ui-kit_components_toast_properties_elevation_layer-2 */
|
|
6
|
-
/* recursica-ignore: --recursica_ui-kit_components_toast_properties_elevation_layer-3 */
|
|
7
|
-
|
|
8
1
|
/* HARDCODED VALUES:
|
|
9
2
|
- border-style: solid. Baseline so the per-variant border-color tokens actually render.
|
|
10
3
|
*/
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
} from "@mantine/core";
|
|
6
6
|
import {
|
|
7
7
|
filterStylingProps,
|
|
8
|
+
omitUnsupportedProps,
|
|
9
|
+
mergeClassNames,
|
|
8
10
|
type RecursicaOverStyled,
|
|
9
11
|
} from "../../utils/filterStylingProps";
|
|
10
12
|
import styles from "./Toast.module.css";
|
|
@@ -31,48 +33,47 @@ export const Toast = React.forwardRef<HTMLDivElement, ToastProps>(
|
|
|
31
33
|
},
|
|
32
34
|
ref,
|
|
33
35
|
) {
|
|
34
|
-
|
|
36
|
+
// Props this component intentionally doesn't support — deleted at runtime so they can't leak
|
|
37
|
+
// through even if a caller forces them via plain JavaScript, bypassing the `Omit<>` above.
|
|
38
|
+
const UNSUPPORTED_PROPS = [
|
|
39
|
+
"color", // Colors are token-driven via `data-variant`; Mantine's native palette isn't exposed.
|
|
40
|
+
"radius", // Toast corner radius is controlled by design tokens, not a raw radius prop.
|
|
41
|
+
"loading", // Toast never renders a loading state; always forced off via `loading={false}` below.
|
|
42
|
+
] as const satisfies readonly (keyof MantineNotificationProps)[];
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
title: styles.title,
|
|
41
|
-
description: styles.description,
|
|
42
|
-
closeButton: styles.closeButton,
|
|
43
|
-
icon: styles.icon,
|
|
44
|
-
loader: styles.loader,
|
|
45
|
-
};
|
|
44
|
+
const sanitizedProps = omitUnsupportedProps(
|
|
45
|
+
filterStylingProps(rest, overStyled),
|
|
46
|
+
UNSUPPORTED_PROPS,
|
|
47
|
+
);
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
49
|
+
// Bind CSS module classes to Mantine's internal classNames API
|
|
50
|
+
const mergedClassNames = mergeClassNames(
|
|
51
|
+
{
|
|
52
|
+
root: styles.root,
|
|
53
|
+
body: styles.body,
|
|
54
|
+
title: styles.title,
|
|
55
|
+
description: styles.description,
|
|
56
|
+
closeButton: styles.closeButton,
|
|
57
|
+
icon: styles.icon,
|
|
58
|
+
loader: styles.loader,
|
|
59
|
+
},
|
|
60
|
+
(sanitizedProps as Record<string, unknown>).classNames as
|
|
61
|
+
| Partial<Record<string, string>>
|
|
62
|
+
| undefined,
|
|
63
|
+
);
|
|
63
64
|
|
|
64
65
|
return (
|
|
65
66
|
<MantineNotification
|
|
66
67
|
ref={ref}
|
|
68
|
+
{...(sanitizedProps as unknown as Omit<
|
|
69
|
+
MantineNotificationProps,
|
|
70
|
+
"color" | "radius" | "variant" | "loading"
|
|
71
|
+
>)}
|
|
67
72
|
withCloseButton={withCloseButton}
|
|
68
73
|
withBorder={false} // Border is handled via CSS or tokens if needed
|
|
69
74
|
data-variant={variant}
|
|
70
75
|
classNames={mergedClassNames}
|
|
71
76
|
loading={false}
|
|
72
|
-
{...(sanitizedProps as unknown as Omit<
|
|
73
|
-
MantineNotificationProps,
|
|
74
|
-
"color" | "radius" | "variant" | "loading"
|
|
75
|
-
>)}
|
|
76
77
|
/>
|
|
77
78
|
);
|
|
78
79
|
},
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/* EXEMPTIONS:
|
|
2
|
-
- beak-inset is ignored because Tooltip positioning calculations are handled dynamically by Mantine/Floating UI at the React runtime.
|
|
3
|
-
- beak-size is ignored because Mantine's tooltip arrows compute their sizing and positional offsets
|
|
4
|
-
dynamically within the React rendering engine (requires inline pixel number rather than standard CSS variables).
|
|
5
|
-
The beak size is checked in JS against a fixed value of 16px. If this variable changes, the TSX components
|
|
6
|
-
need to be reviewed/re-compiled. */
|
|
7
|
-
/* recursica-ignore: --recursica_ui-kit_components_tooltip_properties_beak-inset = 8px */
|
|
8
|
-
/* recursica-ignore: --recursica_ui-kit_components_tooltip_properties_beak-size = 16px */
|
|
9
|
-
|
|
10
1
|
/* HARDCODED VALUES:
|
|
11
2
|
- border-style: solid. Structural rendering rule for the tooltip border (Mantine uses Box
|
|
12
3
|
which may not set border-style natively). Same pattern as Menu / HoverCard.
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from "@mantine/core";
|
|
7
7
|
import {
|
|
8
8
|
filterStylingProps,
|
|
9
|
+
mergeClassNames,
|
|
9
10
|
type RecursicaOverStyled,
|
|
10
11
|
} from "../../utils/filterStylingProps";
|
|
11
12
|
import styles from "./Tooltip.module.css";
|
|
@@ -43,55 +44,38 @@ export type TooltipProps = RecursicaOverStyled<
|
|
|
43
44
|
const TooltipBase = function Tooltip({
|
|
44
45
|
overStyled = false,
|
|
45
46
|
withBeak = true,
|
|
47
|
+
position = "top", // Recursica default; Mantine defaults to "bottom"
|
|
48
|
+
// arrowSize must be a JS number prop — Mantine uses it for inline width/height
|
|
49
|
+
// and positioning offset (-arrowSize/2) calculations that cannot be CSS-driven.
|
|
50
|
+
// Default to 16 to match the Recursica beak-size token (16px).
|
|
51
|
+
arrowSize = 16,
|
|
46
52
|
...rest
|
|
47
53
|
}: TooltipProps) {
|
|
48
54
|
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
55
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
49
56
|
|
|
50
57
|
// Bind CSS module classes to Mantine's internal classNames API
|
|
51
|
-
const mergedClassNames
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
classNamesProp &&
|
|
59
|
-
typeof classNamesProp === "object" &&
|
|
60
|
-
!Array.isArray(classNamesProp)
|
|
61
|
-
) {
|
|
62
|
-
const o = classNamesProp as Record<string, string>;
|
|
63
|
-
Object.keys(o).forEach((key) => {
|
|
64
|
-
if (mergedClassNames[key]) {
|
|
65
|
-
mergedClassNames[key] = `${mergedClassNames[key]} ${o[key]}`;
|
|
66
|
-
} else {
|
|
67
|
-
mergedClassNames[key] = o[key];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// arrowSize must be a JS number prop — Mantine uses it for inline width/height
|
|
73
|
-
// and positioning offset (-arrowSize/2) calculations that cannot be CSS-driven.
|
|
74
|
-
// Default to 16 to match the Recursica beak-size token (16px).
|
|
75
|
-
const arrowSize =
|
|
76
|
-
((sanitizedProps as Record<string, unknown>).arrowSize as
|
|
77
|
-
| number
|
|
78
|
-
| undefined) ?? 16;
|
|
58
|
+
const mergedClassNames = mergeClassNames(
|
|
59
|
+
{
|
|
60
|
+
tooltip: styles.tooltip,
|
|
61
|
+
arrow: styles.arrow,
|
|
62
|
+
},
|
|
63
|
+
restRecord.classNames as Partial<Record<string, string>> | undefined,
|
|
64
|
+
);
|
|
79
65
|
|
|
80
66
|
// Resolve withBeak (Recursica) vs withArrow (Mantine).
|
|
81
67
|
// withBeak takes precedence when both are provided.
|
|
82
|
-
const withArrow =
|
|
83
|
-
| boolean
|
|
84
|
-
| undefined;
|
|
68
|
+
const withArrow = restRecord.withArrow as boolean | undefined;
|
|
85
69
|
const resolvedWithArrow = withBeak ?? withArrow;
|
|
86
70
|
|
|
87
71
|
return (
|
|
88
72
|
<MantineTooltip
|
|
89
|
-
|
|
90
|
-
|
|
73
|
+
{...(sanitizedProps as unknown as MantineTooltipProps)}
|
|
74
|
+
position={position}
|
|
91
75
|
arrowSize={arrowSize}
|
|
92
76
|
withArrow={resolvedWithArrow}
|
|
77
|
+
multiline /* Always allow text wrapping within max-width */
|
|
93
78
|
classNames={mergedClassNames}
|
|
94
|
-
{...(sanitizedProps as unknown as MantineTooltipProps)}
|
|
95
79
|
/>
|
|
96
80
|
);
|
|
97
81
|
};
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/* EXEMPTIONS:
|
|
2
|
-
- border-size variables are ignored because a uniform 1px border is applied globally to prevent
|
|
3
|
-
unexpected layout shift or flickering during disabled/error state transitions (same exemption
|
|
4
|
-
TextArea takes). */
|
|
5
|
-
/* recursica-ignore: --recursica_ui-kit_components_transfer-list_properties_border-size */
|
|
6
|
-
/* recursica-ignore: --recursica_ui-kit_components_transfer-list_variants_states_disabled_properties_border-size */
|
|
7
|
-
/* recursica-ignore: --recursica_ui-kit_components_transfer-list_variants_states_error_properties_border-size */
|
|
8
|
-
|
|
9
1
|
/* TOKEN INTERPRETATION NOTES (see TRANSFERLIST_IMPLEMENTATION_NOTES.md):
|
|
10
2
|
- `properties_gap` is applied to the row that holds [source pane, transfer buttons, target pane] —
|
|
11
3
|
it's the only unnested gap the schema defines at the component's own level.
|
|
@@ -346,10 +346,10 @@ export const TransferList = forwardRef<HTMLDivElement, TransferListProps>(
|
|
|
346
346
|
readOnlyNativeProps={props}
|
|
347
347
|
activeComponent={
|
|
348
348
|
<div
|
|
349
|
+
{...(sanitizedProps as Record<string, unknown>)}
|
|
349
350
|
className={styles.root}
|
|
350
351
|
data-disabled={disabled ? "true" : undefined}
|
|
351
352
|
data-error={error ? "true" : undefined}
|
|
352
|
-
{...(sanitizedProps as Record<string, unknown>)}
|
|
353
353
|
>
|
|
354
354
|
<div className={styles.panes}>
|
|
355
355
|
{renderPane(
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import { useMergedRef } from "@mantine/hooks";
|
|
9
9
|
import {
|
|
10
10
|
filterStylingProps,
|
|
11
|
+
mergeClassNames,
|
|
11
12
|
type RecursicaOverStyled,
|
|
12
13
|
} from "../../utils/filterStylingProps";
|
|
13
14
|
import { type RecursicaTreeProps } from "@recursica/adapter-common";
|
|
@@ -186,8 +187,8 @@ export const Tree = forwardRef<HTMLUListElement, TreeProps>(function Tree(
|
|
|
186
187
|
}, [disabled]);
|
|
187
188
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
188
189
|
|
|
189
|
-
const
|
|
190
|
-
|
|
190
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
191
|
+
const classNameProp = restRecord.className as string | undefined;
|
|
191
192
|
const rootClass = classNameProp
|
|
192
193
|
? `${styles.root} ${classNameProp}`
|
|
193
194
|
: styles.root;
|
|
@@ -195,6 +196,7 @@ export const Tree = forwardRef<HTMLUListElement, TreeProps>(function Tree(
|
|
|
195
196
|
return (
|
|
196
197
|
<MantineTree
|
|
197
198
|
ref={mergedRef}
|
|
199
|
+
{...(sanitizedProps as unknown as Record<string, unknown>)}
|
|
198
200
|
data={data}
|
|
199
201
|
tree={tree}
|
|
200
202
|
expandOnClick={false}
|
|
@@ -202,12 +204,10 @@ export const Tree = forwardRef<HTMLUListElement, TreeProps>(function Tree(
|
|
|
202
204
|
expandOnSpace={false}
|
|
203
205
|
renderNode={createRenderTreeNode(disabled)}
|
|
204
206
|
data-disabled={disabled || undefined}
|
|
205
|
-
classNames={
|
|
206
|
-
root: rootClass,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}}
|
|
210
|
-
{...(sanitizedProps as unknown as Record<string, unknown>)}
|
|
207
|
+
classNames={mergeClassNames(
|
|
208
|
+
{ root: rootClass, node: styles.node, subtree: styles.subtree },
|
|
209
|
+
restRecord.classNames as Partial<Record<string, string>> | undefined,
|
|
210
|
+
)}
|
|
211
211
|
/>
|
|
212
212
|
);
|
|
213
213
|
});
|