@recursica/mantine-adapter 0.18.0 → 0.19.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 +6 -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 +1642 -1357
- package/dist/mantine-adapter.js.map +1 -1
- package/dist/src/components/Modal/Modal.d.ts +39 -2
- package/dist/src/components/Modal/index.d.ts +1 -0
- package/dist/src/components/Popover/Popover.d.ts +55 -0
- package/dist/src/components/Popover/index.d.ts +1 -0
- package/dist/src/components/Timeline/Timeline.d.ts +14 -2
- package/dist/src/components/Timeline/TimelineItem.d.ts +25 -0
- package/dist/src/components/Toast/Toast.d.ts +21 -2
- package/dist/src/components/Toast/index.d.ts +1 -0
- package/dist/src/components/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/Modal/MODAL_IMPLEMENTATION_NOTES.md +15 -0
- package/src/components/Modal/Modal.module.css +127 -0
- package/src/components/Modal/Modal.stories.tsx +66 -4
- package/src/components/Modal/Modal.tsx +218 -3
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Popover/IMPLEMENTATION_NOTES.md +77 -0
- package/src/components/Popover/Popover.module.css +84 -0
- package/src/components/Popover/Popover.stories.tsx +133 -0
- package/src/components/Popover/Popover.tsx +156 -0
- package/src/components/Popover/index.ts +1 -0
- package/src/components/Timeline/TIMELINE_IMPLEMENTATION_NOTES.md +13 -0
- package/src/components/Timeline/Timeline.module.css +361 -0
- package/src/components/Timeline/Timeline.stories.tsx +114 -3
- package/src/components/Timeline/Timeline.tsx +81 -4
- package/src/components/Timeline/TimelineItem.tsx +102 -0
- package/src/components/Toast/TOAST_IMPLEMENTATION_NOTES.md +39 -0
- package/src/components/Toast/Toast.module.css +109 -0
- package/src/components/Toast/Toast.stories.tsx +57 -7
- package/src/components/Toast/Toast.tsx +90 -4
- package/src/components/Toast/index.ts +1 -0
- package/src/components/index.ts +2 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Popover – Implementation Notes
|
|
2
|
+
|
|
3
|
+
Decisions and design tweaks strictly tailored for the UI Kit's Popover wrapped against `@mantine/core`. This is a living document that tracks _why_ specific logic decisions exist.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Composable API Preservation (1:1 Mapping)
|
|
8
|
+
|
|
9
|
+
**Decision:** We maintain the exact library composition API structure (`<Popover>`, `<Popover.Target>`, `<Popover.Dropdown>`) as a 1:1 React component mapping.
|
|
10
|
+
|
|
11
|
+
**Implementation:** Mantine's Popover internally manages click detection, open/close state, Floating UI positioning, and portal rendering. By preserving the exact sub-component tree, Recursica safely inherits all of these behaviors without reimplementation.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Popover.Target Pass-Through
|
|
16
|
+
|
|
17
|
+
**Decision:** `Popover.Target` is a transparent pass-through with no styling applied.
|
|
18
|
+
|
|
19
|
+
**Implementation:** The target wrapper exists solely to manage Mantine's ref forwarding and event binding for the trigger element. No `filterStylingProps` or CSS module classes are applied — the trigger's appearance is entirely controlled by whatever component the integrator places inside it (e.g., `<Button>`). This is identical to the `Menu.Target` and `HoverCard.Target` pattern.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 3. Token Namespace: `hover-card-popover`
|
|
24
|
+
|
|
25
|
+
**Decision:** The CSS module exclusively uses variables from the `--recursica_ui-kit_components_hover-card-popover_*` namespace.
|
|
26
|
+
|
|
27
|
+
**Implementation:** The Recursica token system defines a single shared namespace (`hover-card-popover`) for this component and HoverCard. It covers geometry (border-radius, border-size, padding, min/max-width), typography (content-text\_\*), elevation, and layer-aware colors (background, border-color, content).
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 4. Hardcoded Values
|
|
32
|
+
|
|
33
|
+
**Decision:** Two hardcoded values exist in the component.
|
|
34
|
+
|
|
35
|
+
### `border-style: solid` (CSS module)
|
|
36
|
+
|
|
37
|
+
Mantine renders the dropdown using its `Paper` component, which does not set `border-style` natively. Without this hardcoded value, the border-width and border-color tokens would have no visible effect. This is the same pattern used in the Menu component's dropdown.
|
|
38
|
+
|
|
39
|
+
### `arrowSize` defaulted to `16` (Popover.tsx)
|
|
40
|
+
|
|
41
|
+
Mantine's `arrowSize` prop is a JavaScript number used for inline style calculations: it sets `width`, `height`, and a positioning offset (`-arrowSize/2`) directly on the arrow `<div>` element. These inline styles **cannot** be overridden via CSS without `!important`, and the positioning offset has no CSS equivalent. This means the beak size cannot be fully CSS-driven — it is one of the rare cases where a design token value must be mirrored as a JS prop.
|
|
42
|
+
|
|
43
|
+
The default value `16` matches the Recursica `beak-size` token (`--recursica_ui-kit_components_hover-card-popover_properties_beak-size: 16px`). Developers can override `arrowSize` if needed, but should be aware this is a design system concern. If the token value changes, the default in `Popover.tsx` must also be updated.
|
|
44
|
+
|
|
45
|
+
This is documented as an open issue in `docs/COMPONENT_ISSUES.md`.
|
|
46
|
+
|
|
47
|
+
**Note:** Mantine calls this the "arrow"; Recursica calls it the "beak". The Recursica prop `withBeak` (defaulting to `true`) maps to Mantine's `withArrow`. Both `withBeak` and `withArrow` are accepted; `withBeak` takes precedence.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 5. Minimal CSS Override Philosophy
|
|
52
|
+
|
|
53
|
+
**Decision:** The CSS module only overrides visual design tokens (colors, typography, spacing, borders, shadows). All structural layout properties are deferred to Mantine's native behavior.
|
|
54
|
+
|
|
55
|
+
**Implementation:** Popover is an overlay component where Mantine's native Floating UI positioning and Paper layout are already correct. We avoid setting:
|
|
56
|
+
|
|
57
|
+
- `overflow` on the dropdown (Mantine handles scroll behavior natively)
|
|
58
|
+
- `display`, `position`, `z-index` (Floating UI controls these)
|
|
59
|
+
- `pointer-events` (Mantine manages hover detection across target and dropdown)
|
|
60
|
+
|
|
61
|
+
**Rationale:** Default to Mantine's native behavior and only override what the Recursica token system explicitly needs to control.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 6. ClassNames Merging on Root
|
|
66
|
+
|
|
67
|
+
**Decision:** The root `Popover` component binds CSS module classes via `classNames` on the Mantine root.
|
|
68
|
+
|
|
69
|
+
**Implementation:** The root component receives `classNames={{ dropdown: styles.dropdown, arrow: styles.arrow }}` and merges any consumer-provided `classNames` when `overStyled` is true. This ensures our token-driven styles are applied to the dropdown panel without wrapper divs, and the consumer's classes are additive.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 7. Default Position Override
|
|
74
|
+
|
|
75
|
+
**Decision:** Recursica defaults `position` to `"top"`. Mantine defaults to `"bottom"`.
|
|
76
|
+
|
|
77
|
+
**Implementation:** The `position="top"` default is set on the Mantine root element before the prop spread, so developer-provided `position` values still take precedence. This aligns with Recursica's design intent for overlay components to appear above their trigger by default.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/* HARDCODED VALUES:
|
|
2
|
+
- border-style: solid. Structural rendering rule for the dropdown border (Mantine uses Paper
|
|
3
|
+
which may not set border-style natively). Same pattern as Menu and HoverCard.
|
|
4
|
+
- arrowSize defaults to 16 in Popover.tsx. Mantine uses arrowSize for inline width/height
|
|
5
|
+
and positioning (-arrowSize/2) calculations that cannot be CSS-driven. The default matches
|
|
6
|
+
the Recursica beak-size token (16px). See COMPONENT_ISSUES.md for details.
|
|
7
|
+
- All structural layout (display, position, overflow) is deferred to Mantine's native
|
|
8
|
+
behavior. We only override visual design tokens (colors, typography, spacing, borders).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/* ======================================
|
|
12
|
+
DROPDOWN CONTAINER
|
|
13
|
+
====================================== */
|
|
14
|
+
|
|
15
|
+
.dropdown {
|
|
16
|
+
background-color: var(
|
|
17
|
+
--recursica_ui-kit_components_hover-card-popover_colors_background
|
|
18
|
+
);
|
|
19
|
+
border-style: solid; /* HARDCODE: Mantine Paper does not set border-style natively */
|
|
20
|
+
border-width: var(
|
|
21
|
+
--recursica_ui-kit_components_hover-card-popover_properties_border-size
|
|
22
|
+
);
|
|
23
|
+
border-color: var(
|
|
24
|
+
--recursica_ui-kit_components_hover-card-popover_colors_border-color
|
|
25
|
+
);
|
|
26
|
+
border-radius: var(
|
|
27
|
+
--recursica_ui-kit_components_hover-card-popover_properties_border-radius
|
|
28
|
+
);
|
|
29
|
+
box-shadow: var(
|
|
30
|
+
--recursica_ui-kit_components_hover-card-popover_properties_elevation
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
min-width: var(
|
|
34
|
+
--recursica_ui-kit_components_hover-card-popover_properties_min-width
|
|
35
|
+
);
|
|
36
|
+
max-width: var(
|
|
37
|
+
--recursica_ui-kit_components_hover-card-popover_properties_max-width
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
padding: var(
|
|
41
|
+
--recursica_ui-kit_components_hover-card-popover_properties_vertical-padding
|
|
42
|
+
)
|
|
43
|
+
var(
|
|
44
|
+
--recursica_ui-kit_components_hover-card-popover_properties_horizontal-padding
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
/* Typography */
|
|
48
|
+
font-family: var(
|
|
49
|
+
--recursica_ui-kit_components_hover-card-popover_properties_content-text_font-family
|
|
50
|
+
);
|
|
51
|
+
font-size: var(
|
|
52
|
+
--recursica_ui-kit_components_hover-card-popover_properties_content-text_font-size
|
|
53
|
+
);
|
|
54
|
+
font-style: var(
|
|
55
|
+
--recursica_ui-kit_components_hover-card-popover_properties_content-text_font-style
|
|
56
|
+
);
|
|
57
|
+
font-weight: var(
|
|
58
|
+
--recursica_ui-kit_components_hover-card-popover_properties_content-text_font-weight
|
|
59
|
+
);
|
|
60
|
+
letter-spacing: var(
|
|
61
|
+
--recursica_ui-kit_components_hover-card-popover_properties_content-text_letter-spacing
|
|
62
|
+
);
|
|
63
|
+
line-height: var(
|
|
64
|
+
--recursica_ui-kit_components_hover-card-popover_properties_content-text_line-height
|
|
65
|
+
);
|
|
66
|
+
text-decoration: var(
|
|
67
|
+
--recursica_ui-kit_components_hover-card-popover_properties_content-text_text-decoration
|
|
68
|
+
);
|
|
69
|
+
text-transform: var(
|
|
70
|
+
--recursica_ui-kit_components_hover-card-popover_properties_content-text_text-transform
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
color: var(--recursica_ui-kit_components_hover-card-popover_colors_content);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* ======================================
|
|
77
|
+
ARROW / BEAK
|
|
78
|
+
====================================== */
|
|
79
|
+
|
|
80
|
+
.arrow {
|
|
81
|
+
border-color: var(
|
|
82
|
+
--recursica_ui-kit_components_hover-card-popover_colors_border-color
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Popover } from "./Popover";
|
|
3
|
+
import { Button } from "../Button";
|
|
4
|
+
import { Text } from "../Text/Text";
|
|
5
|
+
import { Stack } from "../Stack/Stack";
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
type PopoverStoryArgs = Record<string, any>;
|
|
9
|
+
|
|
10
|
+
const meta = {
|
|
11
|
+
title: "UI-Kit/Popover",
|
|
12
|
+
component: Popover,
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
parameters: {
|
|
15
|
+
docs: {
|
|
16
|
+
description: {
|
|
17
|
+
component:
|
|
18
|
+
"The `Popover` component is a composable wrapper around Mantine's Popover. It displays a dropdown panel when the user clicks or interacts with a target element.",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
argTypes: {
|
|
23
|
+
withBeak: {
|
|
24
|
+
control: "boolean",
|
|
25
|
+
description:
|
|
26
|
+
"Whether to display a beak (arrow) pointing from the dropdown to the target.",
|
|
27
|
+
},
|
|
28
|
+
position: {
|
|
29
|
+
control: "select",
|
|
30
|
+
options: [
|
|
31
|
+
"top",
|
|
32
|
+
"top-start",
|
|
33
|
+
"top-end",
|
|
34
|
+
"bottom",
|
|
35
|
+
"bottom-start",
|
|
36
|
+
"bottom-end",
|
|
37
|
+
"left",
|
|
38
|
+
"left-start",
|
|
39
|
+
"left-end",
|
|
40
|
+
"right",
|
|
41
|
+
"right-start",
|
|
42
|
+
"right-end",
|
|
43
|
+
],
|
|
44
|
+
description: "Dropdown position relative to target",
|
|
45
|
+
},
|
|
46
|
+
defaultOpened: {
|
|
47
|
+
control: "boolean",
|
|
48
|
+
description: "Initial opened state",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
} satisfies Meta<typeof Popover>;
|
|
52
|
+
|
|
53
|
+
export default meta;
|
|
54
|
+
type Story = StoryObj<typeof meta>;
|
|
55
|
+
|
|
56
|
+
export const Default: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
withBeak: true,
|
|
59
|
+
position: "top",
|
|
60
|
+
},
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62
|
+
render: ({ withLayer, layer, ...args }: PopoverStoryArgs) => {
|
|
63
|
+
return (
|
|
64
|
+
<Popover width={250} {...args}>
|
|
65
|
+
<Popover.Target>
|
|
66
|
+
<Button variant="solid">Toggle Popover</Button>
|
|
67
|
+
</Popover.Target>
|
|
68
|
+
<Popover.Dropdown>
|
|
69
|
+
<Text size="rec-sm">
|
|
70
|
+
This is the popover content. It can contain any elements you want to
|
|
71
|
+
display when the user clicks the target.
|
|
72
|
+
</Text>
|
|
73
|
+
</Popover.Dropdown>
|
|
74
|
+
</Popover>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const SolidDefault: Story = {
|
|
80
|
+
args: {
|
|
81
|
+
withBeak: true,
|
|
82
|
+
position: "top",
|
|
83
|
+
defaultOpened: true,
|
|
84
|
+
},
|
|
85
|
+
parameters: {
|
|
86
|
+
controls: { disable: true },
|
|
87
|
+
},
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
89
|
+
render: ({ withLayer, layer, ...args }: PopoverStoryArgs) => {
|
|
90
|
+
return (
|
|
91
|
+
<Stack align="center" justify="center" style={{ padding: "100px" }}>
|
|
92
|
+
<Popover width={200} {...args}>
|
|
93
|
+
<Popover.Target>
|
|
94
|
+
<Button variant="solid">Toggle Popover</Button>
|
|
95
|
+
</Popover.Target>
|
|
96
|
+
<Popover.Dropdown>
|
|
97
|
+
<Text size="rec-sm">
|
|
98
|
+
This is a static representation of an opened popover with a beak.
|
|
99
|
+
</Text>
|
|
100
|
+
</Popover.Dropdown>
|
|
101
|
+
</Popover>
|
|
102
|
+
</Stack>
|
|
103
|
+
);
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const WithoutBeak: Story = {
|
|
108
|
+
args: {
|
|
109
|
+
withBeak: false,
|
|
110
|
+
position: "bottom",
|
|
111
|
+
defaultOpened: true,
|
|
112
|
+
},
|
|
113
|
+
parameters: {
|
|
114
|
+
controls: { disable: true },
|
|
115
|
+
},
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
117
|
+
render: ({ withLayer, layer, ...args }: PopoverStoryArgs) => {
|
|
118
|
+
return (
|
|
119
|
+
<Stack align="center" justify="center" style={{ padding: "100px" }}>
|
|
120
|
+
<Popover width={200} {...args}>
|
|
121
|
+
<Popover.Target>
|
|
122
|
+
<Button variant="outline">Bottom Popover</Button>
|
|
123
|
+
</Popover.Target>
|
|
124
|
+
<Popover.Dropdown>
|
|
125
|
+
<Text size="rec-sm">
|
|
126
|
+
This popover is positioned at the bottom and has no beak.
|
|
127
|
+
</Text>
|
|
128
|
+
</Popover.Dropdown>
|
|
129
|
+
</Popover>
|
|
130
|
+
</Stack>
|
|
131
|
+
);
|
|
132
|
+
},
|
|
133
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Popover as MantinePopover,
|
|
3
|
+
type PopoverProps as MantinePopoverProps,
|
|
4
|
+
type PopoverTargetProps as MantinePopoverTargetProps,
|
|
5
|
+
type PopoverDropdownProps as MantinePopoverDropdownProps,
|
|
6
|
+
} from "@mantine/core";
|
|
7
|
+
import {
|
|
8
|
+
filterStylingProps,
|
|
9
|
+
type RecursicaOverStyled,
|
|
10
|
+
} from "../../utils/filterStylingProps";
|
|
11
|
+
import styles from "./Popover.module.css";
|
|
12
|
+
|
|
13
|
+
// ============================================================
|
|
14
|
+
// POPOVER ROOT
|
|
15
|
+
// ============================================================
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Recursica-specific props for Popover.
|
|
19
|
+
*/
|
|
20
|
+
export interface RecursicaPopoverProps {
|
|
21
|
+
/**
|
|
22
|
+
* Whether to display a beak (arrow) pointing from the dropdown to the target.
|
|
23
|
+
* This is the Recursica equivalent of Mantine's `withArrow`.
|
|
24
|
+
* When both `withBeak` and `withArrow` are provided, `withBeak` takes precedence.
|
|
25
|
+
*/
|
|
26
|
+
withBeak?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Recursica Popover component wrapping Mantine's composable Popover.
|
|
31
|
+
*
|
|
32
|
+
* Displays a dropdown panel when the user clicks or interacts with a target element.
|
|
33
|
+
* Uses the composable dot-notation pattern:
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <Popover withBeak>
|
|
36
|
+
* <Popover.Target>
|
|
37
|
+
* <Button>Click me</Button>
|
|
38
|
+
* </Popover.Target>
|
|
39
|
+
* <Popover.Dropdown>
|
|
40
|
+
* Content displayed in popover
|
|
41
|
+
* </Popover.Dropdown>
|
|
42
|
+
* </Popover>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export type PopoverProps = RecursicaOverStyled<
|
|
46
|
+
MantinePopoverProps & RecursicaPopoverProps
|
|
47
|
+
>;
|
|
48
|
+
|
|
49
|
+
const PopoverBase = function Popover({
|
|
50
|
+
overStyled = false,
|
|
51
|
+
withBeak = true,
|
|
52
|
+
...rest
|
|
53
|
+
}: PopoverProps) {
|
|
54
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
55
|
+
|
|
56
|
+
// Bind CSS module classes to Mantine's internal classNames API
|
|
57
|
+
const mergedClassNames: Partial<Record<string, string>> = {
|
|
58
|
+
dropdown: styles.dropdown,
|
|
59
|
+
arrow: styles.arrow,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const classNamesProp = (sanitizedProps as Record<string, unknown>).classNames;
|
|
63
|
+
if (
|
|
64
|
+
classNamesProp &&
|
|
65
|
+
typeof classNamesProp === "object" &&
|
|
66
|
+
!Array.isArray(classNamesProp)
|
|
67
|
+
) {
|
|
68
|
+
const o = classNamesProp as Record<string, string>;
|
|
69
|
+
Object.keys(o).forEach((key) => {
|
|
70
|
+
if (mergedClassNames[key]) {
|
|
71
|
+
mergedClassNames[key] = `${mergedClassNames[key]} ${o[key]}`;
|
|
72
|
+
} else {
|
|
73
|
+
mergedClassNames[key] = o[key];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// arrowSize must be a JS number prop — Mantine uses it for inline width/height
|
|
79
|
+
// and positioning offset (-arrowSize/2) calculations that cannot be CSS-driven.
|
|
80
|
+
// Default to 16 to match the Recursica beak-size token (16px).
|
|
81
|
+
const arrowSize =
|
|
82
|
+
((sanitizedProps as Record<string, unknown>).arrowSize as
|
|
83
|
+
| number
|
|
84
|
+
| undefined) ?? 16;
|
|
85
|
+
|
|
86
|
+
// Resolve withBeak (Recursica) vs withArrow (Mantine).
|
|
87
|
+
// withBeak takes precedence when both are provided.
|
|
88
|
+
const withArrow = (sanitizedProps as Record<string, unknown>).withArrow as
|
|
89
|
+
| boolean
|
|
90
|
+
| undefined;
|
|
91
|
+
const resolvedWithArrow = withBeak ?? withArrow;
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<MantinePopover
|
|
95
|
+
position="top" /* Recursica default; Mantine defaults to "bottom" */
|
|
96
|
+
arrowSize={arrowSize}
|
|
97
|
+
withArrow={resolvedWithArrow}
|
|
98
|
+
classNames={mergedClassNames}
|
|
99
|
+
{...(sanitizedProps as unknown as MantinePopoverProps)}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
PopoverBase.displayName = "Popover";
|
|
104
|
+
|
|
105
|
+
// ============================================================
|
|
106
|
+
// POPOVER TARGET
|
|
107
|
+
// ============================================================
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Wrapper for the element that triggers the popover.
|
|
111
|
+
* Requires a single child element that supports ref forwarding.
|
|
112
|
+
*/
|
|
113
|
+
export type PopoverTargetProps = MantinePopoverTargetProps;
|
|
114
|
+
|
|
115
|
+
const PopoverTarget = function PopoverTarget(props: PopoverTargetProps) {
|
|
116
|
+
return <MantinePopover.Target {...props} />;
|
|
117
|
+
};
|
|
118
|
+
PopoverTarget.displayName = "PopoverTarget";
|
|
119
|
+
|
|
120
|
+
// ============================================================
|
|
121
|
+
// POPOVER DROPDOWN
|
|
122
|
+
// ============================================================
|
|
123
|
+
|
|
124
|
+
/** The dropdown panel displayed from the popover. */
|
|
125
|
+
export type PopoverDropdownProps =
|
|
126
|
+
RecursicaOverStyled<MantinePopoverDropdownProps>;
|
|
127
|
+
|
|
128
|
+
const PopoverDropdown = function PopoverDropdown({
|
|
129
|
+
overStyled = false,
|
|
130
|
+
...rest
|
|
131
|
+
}: PopoverDropdownProps) {
|
|
132
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
133
|
+
const classNameProp = (sanitizedProps as Record<string, unknown>)
|
|
134
|
+
.className as string | undefined;
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<MantinePopover.Dropdown
|
|
138
|
+
className={classNameProp}
|
|
139
|
+
{...(sanitizedProps as unknown as MantinePopoverDropdownProps)}
|
|
140
|
+
/>
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
PopoverDropdown.displayName = "PopoverDropdown";
|
|
144
|
+
|
|
145
|
+
// ============================================================
|
|
146
|
+
// DOT NOTATION EXPORT
|
|
147
|
+
// ============================================================
|
|
148
|
+
|
|
149
|
+
type PopoverComponent = typeof PopoverBase & {
|
|
150
|
+
Target: typeof PopoverTarget;
|
|
151
|
+
Dropdown: typeof PopoverDropdown;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const Popover = PopoverBase as PopoverComponent;
|
|
155
|
+
Popover.Target = PopoverTarget;
|
|
156
|
+
Popover.Dropdown = PopoverDropdown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Popover";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Timeline Implementation Notes
|
|
2
|
+
|
|
3
|
+
## Architecture
|
|
4
|
+
|
|
5
|
+
The `Timeline` component is a strict structural wrapper around Mantine's `<Timeline>` and `<Timeline.Item>` components.
|
|
6
|
+
|
|
7
|
+
- `Timeline.tsx` intercepts overarching properties like `lineWidth` and `bulletSize` to strip them out via `overStyled`, strictly adhering to the CSS token mapping in `.item` rules instead.
|
|
8
|
+
- `TimelineItem.tsx` implements a custom `timestamp` React node rendering slot to match the design system, positioning the text directly below the item's `children`.
|
|
9
|
+
- `TimelineItem.tsx` supports a custom `bulletVariant` prop (`"default" | "avatar" | "icon" | "icon-alternative"`) mapped onto `data-variant` to handle CSS variations dynamically.
|
|
10
|
+
|
|
11
|
+
## Limitations & Missing Tokens
|
|
12
|
+
|
|
13
|
+
- **Avatar Bullet Size**: There is no specific pixel variable provided for the Avatar bullet size in the UI kit tokens (`avatar-size` evaluates to `"default"`). To maintain exact mathematical centering with Mantine's connector line `calc()` equations, the CSS falls back to inheriting the `default` bullet size (`20px`) for avatar nodes natively. If users supply a custom sized `img` tag, it must adhere to inline structural constraints or flex mappings.
|