@recursica/adapter-mantine-v8 1.0.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/.storybook/commonArgTypes.ts +148 -0
- package/ARCHITECTURE.md +18 -0
- package/CHANGELOG.md +688 -0
- package/LICENSE +21 -0
- package/OVERSTYLING.md +56 -0
- package/README.md +70 -0
- package/SETUP.md +93 -0
- package/USAGE.md +57 -0
- package/dist/adapter-mantine-v8.cjs +12 -0
- package/dist/adapter-mantine-v8.cjs.map +1 -0
- package/dist/adapter-mantine-v8.css +1 -0
- package/dist/adapter-mantine-v8.js +5759 -0
- package/dist/adapter-mantine-v8.js.map +1 -0
- package/dist/index.d.ts +2095 -0
- package/dist/test.html +1 -0
- package/dist/vite.svg +1 -0
- package/docs/PHILOSOPHY.md +39 -0
- package/llms.txt +74 -0
- package/package.json +131 -0
- package/recursica_brand.json +2677 -0
- package/recursica_tokens.json +799 -0
- package/recursica_ui-kit.json +14981 -0
- package/recursica_variables_scoped.css +30489 -0
- package/src/GlobalExemptions.modules.css +7 -0
- package/src/Introduction.stories.tsx +154 -0
- package/src/OverStyling.tsx +79 -0
- package/src/Version.tsx +44 -0
- package/src/components/Accordion/ACCORDION_IMPLEMENTATION_NOTES.md +72 -0
- package/src/components/Accordion/Accordion.module.css +367 -0
- package/src/components/Accordion/Accordion.stories.tsx +189 -0
- package/src/components/Accordion/Accordion.test.tsx +1 -0
- package/src/components/Accordion/Accordion.tsx +220 -0
- package/src/components/Accordion/USAGE.md +51 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/AssistiveElement/ASSISTIVEELEMENT_IMPLEMENTATION_NOTES.md +45 -0
- package/src/components/AssistiveElement/AssistiveElement.module.css +111 -0
- package/src/components/AssistiveElement/AssistiveElement.stories.tsx +68 -0
- package/src/components/AssistiveElement/AssistiveElement.test.tsx +1 -0
- package/src/components/AssistiveElement/AssistiveElement.tsx +93 -0
- package/src/components/AssistiveElement/USAGE.md +36 -0
- package/src/components/AutoComplete/AUTOCOMPLETE_IMPLEMENTATION_NOTES.md +42 -0
- package/src/components/AutoComplete/AutoComplete.module.css +430 -0
- package/src/components/AutoComplete/AutoComplete.stories.tsx +336 -0
- package/src/components/AutoComplete/AutoComplete.test.tsx +1 -0
- package/src/components/AutoComplete/AutoComplete.tsx +179 -0
- package/src/components/AutoComplete/USAGE.md +80 -0
- package/src/components/Avatar/AVATAR_IMPLEMENTATION_NOTES.md +34 -0
- package/src/components/Avatar/Avatar.module.css +336 -0
- package/src/components/Avatar/Avatar.stories.tsx +92 -0
- package/src/components/Avatar/Avatar.test.tsx +1 -0
- package/src/components/Avatar/Avatar.tsx +108 -0
- package/src/components/Avatar/USAGE.md +38 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Badge/BADGE_IMPLEMENTATION_NOTES.md +18 -0
- package/src/components/Badge/Badge.module.css +127 -0
- package/src/components/Badge/Badge.stories.tsx +78 -0
- package/src/components/Badge/Badge.test.tsx +1 -0
- package/src/components/Badge/Badge.tsx +64 -0
- package/src/components/Badge/USAGE.md +56 -0
- package/src/components/Breadcrumb/BREADCRUMB_IMPLEMENTATION_NOTES.md +47 -0
- package/src/components/Breadcrumb/Breadcrumb.module.css +48 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +114 -0
- package/src/components/Breadcrumb/Breadcrumb.test.tsx +1 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +85 -0
- package/src/components/Breadcrumb/USAGE.md +55 -0
- package/src/components/Breadcrumb/markCurrentPageItem.test.ts +49 -0
- package/src/components/Button/Button.module.css +446 -0
- package/src/components/Button/Button.stories.tsx +196 -0
- package/src/components/Button/Button.styleIsolation.dom.test.tsx +98 -0
- package/src/components/Button/Button.tsx +184 -0
- package/src/components/Button/IMPLEMENTATION_NOTES.md +109 -0
- package/src/components/Button/USAGE.md +80 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Card/CARD_IMPLEMENTATION_NOTES.md +17 -0
- package/src/components/Card/Card.module.css +119 -0
- package/src/components/Card/Card.stories.tsx +131 -0
- package/src/components/Card/Card.test.tsx +1 -0
- package/src/components/Card/Card.tsx +248 -0
- package/src/components/Card/USAGE.md +63 -0
- package/src/components/Checkbox/CHECKBOX_IMPLEMENTATION_NOTES.md +25 -0
- package/src/components/Checkbox/Checkbox.module.css +267 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +97 -0
- package/src/components/Checkbox/Checkbox.test.tsx +1 -0
- package/src/components/Checkbox/Checkbox.tsx +151 -0
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +147 -0
- package/src/components/Checkbox/USAGE.md +48 -0
- package/src/components/Chip/CHIP_IMPLEMENTATION_NOTES.md +110 -0
- package/src/components/Chip/Chip.module.css +288 -0
- package/src/components/Chip/Chip.stories.tsx +128 -0
- package/src/components/Chip/Chip.test.tsx +1 -0
- package/src/components/Chip/Chip.tsx +157 -0
- package/src/components/Chip/USAGE.md +55 -0
- package/src/components/Container/CONTAINER_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Container/Container.module.css +7 -0
- package/src/components/Container/Container.stories.tsx +118 -0
- package/src/components/Container/Container.test.tsx +1 -0
- package/src/components/Container/Container.tsx +69 -0
- package/src/components/Container/USAGE.md +47 -0
- package/src/components/DatePicker/DATEPICKER_IMPLEMENTATION_NOTES.md +31 -0
- package/src/components/DatePicker/DatePicker.icons.tsx +27 -0
- package/src/components/DatePicker/DatePicker.module.css +566 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +158 -0
- package/src/components/DatePicker/DatePicker.test.tsx +1 -0
- package/src/components/DatePicker/DatePicker.tsx +218 -0
- package/src/components/DatePicker/USAGE.md +49 -0
- package/src/components/Dropdown/BareDropdown.tsx +97 -0
- package/src/components/Dropdown/DROPDOWN_IMPLEMENTATION_NOTES.md +12 -0
- package/src/components/Dropdown/Dropdown.module.css +477 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +252 -0
- package/src/components/Dropdown/Dropdown.test.tsx +1 -0
- package/src/components/Dropdown/Dropdown.tsx +213 -0
- package/src/components/Dropdown/USAGE.md +69 -0
- package/src/components/FileInput/FILEINPUT_IMPLEMENTATION_NOTES.md +153 -0
- package/src/components/FileInput/FileInput.module.css +280 -0
- package/src/components/FileInput/FileInput.stories.tsx +313 -0
- package/src/components/FileInput/FileInput.test.tsx +1 -0
- package/src/components/FileInput/FileInput.tsx +417 -0
- package/src/components/FileInput/USAGE.md +145 -0
- package/src/components/FileUpload/FILEUPLOAD_IMPLEMENTATION_NOTES.md +244 -0
- package/src/components/FileUpload/FileUpload.module.css +205 -0
- package/src/components/FileUpload/FileUpload.stories.tsx +362 -0
- package/src/components/FileUpload/FileUpload.test.tsx +1 -0
- package/src/components/FileUpload/FileUpload.tsx +354 -0
- package/src/components/FileUpload/USAGE.md +199 -0
- package/src/components/Flex/FLEX_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Flex/Flex.module.css +7 -0
- package/src/components/Flex/Flex.stories.tsx +128 -0
- package/src/components/Flex/Flex.test.tsx +1 -0
- package/src/components/Flex/Flex.tsx +75 -0
- package/src/components/Flex/USAGE.md +48 -0
- package/src/components/FormControlLayout/FormControlLayout.module.css +90 -0
- package/src/components/FormControlLayout/FormControlLayout.stories.tsx +118 -0
- package/src/components/FormControlLayout/FormControlLayout.test.tsx +1 -0
- package/src/components/FormControlLayout/FormControlLayout.tsx +74 -0
- package/src/components/FormControlLayout/USAGE.md +40 -0
- package/src/components/FormControlWrapper/FORMCONTROLWRAPPER_IMPLEMENTATION_NOTES.md +32 -0
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +75 -0
- package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +129 -0
- package/src/components/FormControlWrapper/FormControlWrapper.test.tsx +1 -0
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +151 -0
- package/src/components/FormControlWrapper/USAGE.md +47 -0
- package/src/components/Grid/GRID_IMPLEMENTATION_NOTES.md +18 -0
- package/src/components/Grid/Grid.module.css +11 -0
- package/src/components/Grid/Grid.stories.tsx +206 -0
- package/src/components/Grid/Grid.test.tsx +1 -0
- package/src/components/Grid/Grid.tsx +140 -0
- package/src/components/Grid/USAGE.md +47 -0
- package/src/components/Group/GROUP_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Group/Group.module.css +7 -0
- package/src/components/Group/Group.stories.tsx +120 -0
- package/src/components/Group/Group.test.tsx +1 -0
- package/src/components/Group/Group.tsx +60 -0
- package/src/components/Group/USAGE.md +48 -0
- package/src/components/Heading/HEADING_IMPLEMENTATION_NOTES.md +18 -0
- package/src/components/Heading/Heading.module.css +13 -0
- package/src/components/Heading/Heading.stories.tsx +50 -0
- package/src/components/Heading/Heading.test.tsx +1 -0
- package/src/components/Heading/Heading.tsx +52 -0
- package/src/components/Heading/USAGE.md +36 -0
- package/src/components/HoverCard/HOVERCARD_IMPLEMENTATION_NOTES.md +77 -0
- package/src/components/HoverCard/HoverCard.module.css +90 -0
- package/src/components/HoverCard/HoverCard.stories.tsx +172 -0
- package/src/components/HoverCard/HoverCard.test.tsx +1 -0
- package/src/components/HoverCard/HoverCard.tsx +133 -0
- package/src/components/HoverCard/USAGE.md +52 -0
- package/src/components/Label/LABEL_IMPLEMENTATION_NOTES.md +48 -0
- package/src/components/Label/Label.module.css +141 -0
- package/src/components/Label/Label.stories.tsx +131 -0
- package/src/components/Label/Label.test.tsx +1 -0
- package/src/components/Label/Label.tsx +113 -0
- package/src/components/Label/USAGE.md +47 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Layer/USAGE.md +54 -0
- package/src/components/Link/IMPLEMENTATION_NOTES.md +19 -0
- package/src/components/Link/Link.module.css +110 -0
- package/src/components/Link/Link.stories.tsx +58 -0
- package/src/components/Link/Link.test.tsx +1 -0
- package/src/components/Link/Link.tsx +67 -0
- package/src/components/Link/USAGE.md +56 -0
- package/src/components/Link/index.ts +1 -0
- package/src/components/Loader/LOADER_IMPLEMENTATION_NOTES.md +24 -0
- package/src/components/Loader/Loader.animate.dom.test.tsx +82 -0
- package/src/components/Loader/Loader.module.css +63 -0
- package/src/components/Loader/Loader.stories.tsx +123 -0
- package/src/components/Loader/Loader.test.tsx +1 -0
- package/src/components/Loader/Loader.tsx +69 -0
- package/src/components/Loader/USAGE.md +44 -0
- package/src/components/Menu/MENU_IMPLEMENTATION_NOTES.md +88 -0
- package/src/components/Menu/Menu.module.css +280 -0
- package/src/components/Menu/Menu.stories.tsx +371 -0
- package/src/components/Menu/Menu.test.tsx +1 -0
- package/src/components/Menu/Menu.tsx +373 -0
- package/src/components/Menu/USAGE.md +55 -0
- package/src/components/Modal/MODAL_IMPLEMENTATION_NOTES.md +32 -0
- package/src/components/Modal/Modal.module.css +302 -0
- package/src/components/Modal/Modal.stories.tsx +105 -0
- package/src/components/Modal/Modal.test.tsx +1 -0
- package/src/components/Modal/Modal.tsx +368 -0
- package/src/components/Modal/USAGE.md +58 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/NumberInput/NUMBER_INPUT_IMPLEMENTATION_NOTES.md +24 -0
- package/src/components/NumberInput/NumberInput.module.css +302 -0
- package/src/components/NumberInput/NumberInput.stories.tsx +96 -0
- package/src/components/NumberInput/NumberInput.test.tsx +1 -0
- package/src/components/NumberInput/NumberInput.tsx +157 -0
- package/src/components/NumberInput/USAGE.md +52 -0
- package/src/components/Pagination/IMPLEMENTATION_NOTES.md +16 -0
- package/src/components/Pagination/Pagination.icons.tsx +66 -0
- package/src/components/Pagination/Pagination.module.css +188 -0
- package/src/components/Pagination/Pagination.stories.tsx +48 -0
- package/src/components/Pagination/Pagination.test.tsx +1 -0
- package/src/components/Pagination/Pagination.tsx +265 -0
- package/src/components/Pagination/USAGE.md +36 -0
- package/src/components/Pagination/index.ts +5 -0
- package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +116 -0
- package/src/components/Panel/Panel.module.css +209 -0
- package/src/components/Panel/Panel.stories.tsx +227 -0
- package/src/components/Panel/Panel.test.tsx +1 -0
- package/src/components/Panel/Panel.tsx +269 -0
- package/src/components/Panel/USAGE.md +56 -0
- package/src/components/Popover/IMPLEMENTATION_NOTES.md +77 -0
- package/src/components/Popover/Popover.module.css +86 -0
- package/src/components/Popover/Popover.stories.tsx +133 -0
- package/src/components/Popover/Popover.test.tsx +1 -0
- package/src/components/Popover/Popover.tsx +142 -0
- package/src/components/Popover/USAGE.md +61 -0
- package/src/components/Popover/index.ts +1 -0
- package/src/components/Radio/Radio.module.css +231 -0
- package/src/components/Radio/Radio.stories.tsx +93 -0
- package/src/components/Radio/Radio.test.tsx +1 -0
- package/src/components/Radio/Radio.tsx +168 -0
- package/src/components/Radio/RadioGroup.stories.tsx +117 -0
- package/src/components/Radio/RadioGroup.tsx +124 -0
- package/src/components/Radio/USAGE.md +36 -0
- package/src/components/ReadOnlyField/READ_ONLY_FIELD_IMPLEMENTATION_NOTES.md +15 -0
- package/src/components/ReadOnlyField/ReadOnlyBooleanField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyField.module.css +54 -0
- package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +163 -0
- package/src/components/ReadOnlyField/ReadOnlyField.test.tsx +1 -0
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +114 -0
- package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
- package/src/components/ReadOnlyField/USAGE.md +44 -0
- package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
- package/src/components/ReadOnlyField/index.ts +5 -0
- package/src/components/RecursicaThemeProvider/USAGE.md +60 -0
- package/src/components/SegmentedControl/IMPLEMENTATION_NOTES.md +25 -0
- package/src/components/SegmentedControl/SegmentedControl.module.css +185 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +106 -0
- package/src/components/SegmentedControl/SegmentedControl.test.tsx +1 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +110 -0
- package/src/components/SegmentedControl/USAGE.md +55 -0
- package/src/components/Slider/IMPLEMENTATION_NOTES.md +92 -0
- package/src/components/Slider/Slider.module.css +588 -0
- package/src/components/Slider/Slider.stories.tsx +282 -0
- package/src/components/Slider/Slider.test.tsx +1 -0
- package/src/components/Slider/Slider.tsx +391 -0
- package/src/components/Slider/USAGE.md +56 -0
- package/src/components/Stack/STACK_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Stack/Stack.module.css +7 -0
- package/src/components/Stack/Stack.stories.tsx +108 -0
- package/src/components/Stack/Stack.test.tsx +1 -0
- package/src/components/Stack/Stack.tsx +62 -0
- package/src/components/Stack/USAGE.md +48 -0
- package/src/components/Stepper/IMPLEMENTATION_NOTES.md +28 -0
- package/src/components/Stepper/Stepper.module.css +404 -0
- package/src/components/Stepper/Stepper.stories.tsx +148 -0
- package/src/components/Stepper/Stepper.test.tsx +1 -0
- package/src/components/Stepper/Stepper.tsx +93 -0
- package/src/components/Stepper/USAGE.md +41 -0
- package/src/components/Switch/SWITCH_IMPLEMENTATION_NOTES.md +64 -0
- package/src/components/Switch/Switch.module.css +279 -0
- package/src/components/Switch/Switch.stories.tsx +114 -0
- package/src/components/Switch/Switch.test.tsx +1 -0
- package/src/components/Switch/Switch.tsx +177 -0
- package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
- package/src/components/Switch/SwitchGroup.tsx +127 -0
- package/src/components/Switch/USAGE.md +42 -0
- package/src/components/Table/TABLE_IMPLEMENTATION_NOTES.md +78 -0
- package/src/components/Table/Table.icons.tsx +40 -0
- package/src/components/Table/Table.module.css +444 -0
- package/src/components/Table/Table.stories.tsx +140 -0
- package/src/components/Table/Table.test.tsx +1 -0
- package/src/components/Table/Table.tsx +243 -0
- package/src/components/Table/USAGE.md +78 -0
- package/src/components/Tabs/IMPLEMENTATION_NOTES.md +27 -0
- package/src/components/Tabs/Tabs.module.css +591 -0
- package/src/components/Tabs/Tabs.stories.tsx +154 -0
- package/src/components/Tabs/Tabs.test.tsx +1 -0
- package/src/components/Tabs/Tabs.tsx +114 -0
- package/src/components/Tabs/USAGE.md +45 -0
- package/src/components/Text/TEXT_IMPLEMENTATION_NOTES.md +12 -0
- package/src/components/Text/Text.module.css +13 -0
- package/src/components/Text/Text.stories.tsx +75 -0
- package/src/components/Text/Text.test.tsx +1 -0
- package/src/components/Text/Text.tsx +53 -0
- package/src/components/Text/USAGE.md +40 -0
- package/src/components/TextArea/TEXTAREA_IMPLEMENTATION_NOTES.md +7 -0
- package/src/components/TextArea/TextArea.module.css +183 -0
- package/src/components/TextArea/TextArea.stories.tsx +94 -0
- package/src/components/TextArea/TextArea.test.tsx +1 -0
- package/src/components/TextArea/TextArea.tsx +137 -0
- package/src/components/TextArea/USAGE.md +48 -0
- package/src/components/TextField/TEXTFIELD_IMPLEMENTATION_NOTES.md +19 -0
- package/src/components/TextField/TextField.module.css +264 -0
- package/src/components/TextField/TextField.stories.tsx +162 -0
- package/src/components/TextField/TextField.test.tsx +1 -0
- package/src/components/TextField/TextField.tsx +139 -0
- package/src/components/TextField/USAGE.md +44 -0
- package/src/components/TimePicker/TIMEPICKER_IMPLEMENTATION_NOTES.md +119 -0
- package/src/components/TimePicker/TimePicker.module.css +291 -0
- package/src/components/TimePicker/TimePicker.stories.tsx +141 -0
- package/src/components/TimePicker/TimePicker.test.tsx +1 -0
- package/src/components/TimePicker/TimePicker.tsx +304 -0
- package/src/components/TimePicker/USAGE.md +57 -0
- package/src/components/Timeline/TIMELINE_IMPLEMENTATION_NOTES.md +13 -0
- package/src/components/Timeline/Timeline.module.css +373 -0
- package/src/components/Timeline/Timeline.stories.tsx +128 -0
- package/src/components/Timeline/Timeline.test.tsx +1 -0
- package/src/components/Timeline/Timeline.tsx +73 -0
- package/src/components/Timeline/TimelineItem.tsx +79 -0
- package/src/components/Timeline/USAGE.md +49 -0
- package/src/components/Toast/TOAST_IMPLEMENTATION_NOTES.md +39 -0
- package/src/components/Toast/Toast.module.css +184 -0
- package/src/components/Toast/Toast.stories.tsx +67 -0
- package/src/components/Toast/Toast.test.tsx +1 -0
- package/src/components/Toast/Toast.tsx +82 -0
- package/src/components/Toast/USAGE.md +50 -0
- package/src/components/Toast/index.ts +1 -0
- package/src/components/Tooltip/TOOLTIP_IMPLEMENTATION_NOTES.md +85 -0
- package/src/components/Tooltip/Tooltip.module.css +91 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +165 -0
- package/src/components/Tooltip/Tooltip.test.tsx +1 -0
- package/src/components/Tooltip/Tooltip.tsx +117 -0
- package/src/components/Tooltip/USAGE.md +80 -0
- package/src/components/TransferList/TRANSFERLIST_IMPLEMENTATION_NOTES.md +111 -0
- package/src/components/TransferList/TransferList.module.css +182 -0
- package/src/components/TransferList/TransferList.stories.tsx +121 -0
- package/src/components/TransferList/TransferList.test.tsx +1 -0
- package/src/components/TransferList/TransferList.tsx +419 -0
- package/src/components/TransferList/USAGE.md +77 -0
- package/src/components/Tree/IMPLEMENTATION_NOTES.md +48 -0
- package/src/components/Tree/Tree.module.css +232 -0
- package/src/components/Tree/Tree.stories.tsx +104 -0
- package/src/components/Tree/Tree.test.tsx +1 -0
- package/src/components/Tree/Tree.tsx +220 -0
- package/src/components/Tree/USAGE.md +96 -0
- package/src/components/Tree/index.ts +1 -0
- package/src/components/index.ts +52 -0
- package/src/env.d.ts +7 -0
- package/src/index.ts +179 -0
- package/src/types/index.ts +9 -0
- package/src/types/mantine.d.ts +7 -0
- package/src/types/scss-modules.d.ts +9 -0
- package/src/utils/ColorSchemeWrapper.tsx +27 -0
- package/src/utils/RequireAccessibleLabel.ts +1 -0
- package/src/utils/copyToClipboard.ts +36 -0
- package/src/utils/filterStylingProps.test.ts +85 -0
- package/src/utils/filterStylingProps.ts +150 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/renderRichOption.tsx +65 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Panel - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `Panel` component in your projects using `@recursica/adapter-mantine-v8`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Panel } from "@recursica/adapter-mantine-v8";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { Panel } from "@recursica/adapter-mantine-v8";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<Panel>
|
|
24
|
+
<Text>This is a clean, structured visual container.</Text>
|
|
25
|
+
</Panel>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 3. Design System Integration
|
|
33
|
+
|
|
34
|
+
All Recursica components in the `@recursica/adapter-mantine-v8` package adhere strictly to design system spacing, scaling, and behavior patterns.
|
|
35
|
+
|
|
36
|
+
> [!IMPORTANT]
|
|
37
|
+
>
|
|
38
|
+
> - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
|
|
39
|
+
> - **No Direct Layers**: Do not pass a `layer` prop to this component. To place it on a specific visual layer, wrap it in a `<Layer layer={0|1|2|3}>` component natively.
|
|
40
|
+
> - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 4. Key Integration Features & Constraints
|
|
45
|
+
|
|
46
|
+
### Placement
|
|
47
|
+
|
|
48
|
+
Use the `placement` prop (not `position`) to choose which edge the panel slides in from: `"left"`, `"right"`, `"top"`, or `"bottom"`. It defaults to `"right"`.
|
|
49
|
+
|
|
50
|
+
### Panel.Footer
|
|
51
|
+
|
|
52
|
+
A `Panel.Footer` sub-component is available for footer content and action buttons.
|
|
53
|
+
|
|
54
|
+
### Content Overflow
|
|
55
|
+
|
|
56
|
+
When content exceeds the panel's available height, the body scrolls internally while the header and footer stay fixed in place.
|
|
@@ -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,86 @@
|
|
|
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_properties_colors_background-color
|
|
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_properties_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(
|
|
74
|
+
--recursica_ui-kit_components_hover-card-popover_properties_colors_content
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* ======================================
|
|
79
|
+
ARROW / BEAK
|
|
80
|
+
====================================== */
|
|
81
|
+
|
|
82
|
+
.arrow {
|
|
83
|
+
border-color: var(
|
|
84
|
+
--recursica_ui-kit_components_hover-card-popover_properties_colors_border-color
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -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 @@
|
|
|
1
|
+
// Placeholder for future Popover component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1,142 @@
|
|
|
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
|
+
mergeClassNames,
|
|
10
|
+
withCallerOverride,
|
|
11
|
+
type RecursicaOverStyled,
|
|
12
|
+
} from "../../utils/filterStylingProps";
|
|
13
|
+
import styles from "./Popover.module.css";
|
|
14
|
+
|
|
15
|
+
// ============================================================
|
|
16
|
+
// POPOVER ROOT
|
|
17
|
+
// ============================================================
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Recursica-specific props for Popover.
|
|
21
|
+
*/
|
|
22
|
+
import { type RecursicaPopoverProps } from "@recursica/adapter-common";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Recursica Popover component wrapping Mantine's composable Popover.
|
|
26
|
+
*
|
|
27
|
+
* Displays a dropdown panel when the user clicks or interacts with a target element.
|
|
28
|
+
* Uses the composable dot-notation pattern:
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <Popover withBeak>
|
|
31
|
+
* <Popover.Target>
|
|
32
|
+
* <Button>Click me</Button>
|
|
33
|
+
* </Popover.Target>
|
|
34
|
+
* <Popover.Dropdown>
|
|
35
|
+
* Content displayed in popover
|
|
36
|
+
* </Popover.Dropdown>
|
|
37
|
+
* </Popover>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export type PopoverProps = Omit<
|
|
41
|
+
RecursicaOverStyled<
|
|
42
|
+
Omit<MantinePopoverProps, "position"> & RecursicaPopoverProps
|
|
43
|
+
>,
|
|
44
|
+
"position"
|
|
45
|
+
> & {
|
|
46
|
+
position?: MantinePopoverProps["position"];
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const PopoverBase = function Popover({
|
|
50
|
+
overStyled = false,
|
|
51
|
+
withBeak = true,
|
|
52
|
+
position = "top", // Recursica default; Mantine defaults to "bottom"
|
|
53
|
+
...rest
|
|
54
|
+
}: PopoverProps) {
|
|
55
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
56
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
57
|
+
|
|
58
|
+
// Bind CSS module classes to Mantine's internal classNames API
|
|
59
|
+
const mergedClassNames = mergeClassNames(
|
|
60
|
+
{ dropdown: styles.dropdown, arrow: styles.arrow },
|
|
61
|
+
restRecord.classNames as Partial<Record<string, string>> | undefined,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
// arrowSize must be a JS number prop — Mantine uses it for inline width/height
|
|
65
|
+
// and positioning offset (-arrowSize/2) calculations that cannot be CSS-driven.
|
|
66
|
+
// Default to 16 to match the Recursica beak-size token (16px).
|
|
67
|
+
const arrowSize = withCallerOverride<number>(
|
|
68
|
+
16,
|
|
69
|
+
restRecord.arrowSize as number | undefined,
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
// Resolve withBeak (Recursica) vs withArrow (Mantine).
|
|
73
|
+
// withBeak takes precedence when both are provided.
|
|
74
|
+
const resolvedWithArrow = withCallerOverride<boolean | undefined>(
|
|
75
|
+
withBeak,
|
|
76
|
+
restRecord.withArrow as boolean | undefined,
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<MantinePopover
|
|
81
|
+
{...(sanitizedProps as unknown as MantinePopoverProps)}
|
|
82
|
+
position={position}
|
|
83
|
+
arrowSize={arrowSize}
|
|
84
|
+
withArrow={resolvedWithArrow}
|
|
85
|
+
classNames={mergedClassNames}
|
|
86
|
+
/>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
PopoverBase.displayName = "Popover";
|
|
90
|
+
|
|
91
|
+
// ============================================================
|
|
92
|
+
// POPOVER TARGET
|
|
93
|
+
// ============================================================
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Wrapper for the element that triggers the popover.
|
|
97
|
+
* Requires a single child element that supports ref forwarding.
|
|
98
|
+
*/
|
|
99
|
+
export type PopoverTargetProps = MantinePopoverTargetProps;
|
|
100
|
+
|
|
101
|
+
const PopoverTarget = function PopoverTarget(props: PopoverTargetProps) {
|
|
102
|
+
return <MantinePopover.Target {...props} />;
|
|
103
|
+
};
|
|
104
|
+
PopoverTarget.displayName = "PopoverTarget";
|
|
105
|
+
|
|
106
|
+
// ============================================================
|
|
107
|
+
// POPOVER DROPDOWN
|
|
108
|
+
// ============================================================
|
|
109
|
+
|
|
110
|
+
/** The dropdown panel displayed from the popover. */
|
|
111
|
+
export type PopoverDropdownProps =
|
|
112
|
+
RecursicaOverStyled<MantinePopoverDropdownProps>;
|
|
113
|
+
|
|
114
|
+
const PopoverDropdown = function PopoverDropdown({
|
|
115
|
+
overStyled = false,
|
|
116
|
+
...rest
|
|
117
|
+
}: PopoverDropdownProps) {
|
|
118
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
119
|
+
const classNameProp = (sanitizedProps as Record<string, unknown>)
|
|
120
|
+
.className as string | undefined;
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<MantinePopover.Dropdown
|
|
124
|
+
{...(sanitizedProps as unknown as MantinePopoverDropdownProps)}
|
|
125
|
+
className={classNameProp}
|
|
126
|
+
/>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
PopoverDropdown.displayName = "PopoverDropdown";
|
|
130
|
+
|
|
131
|
+
// ============================================================
|
|
132
|
+
// DOT NOTATION EXPORT
|
|
133
|
+
// ============================================================
|
|
134
|
+
|
|
135
|
+
type PopoverComponent = typeof PopoverBase & {
|
|
136
|
+
Target: typeof PopoverTarget;
|
|
137
|
+
Dropdown: typeof PopoverDropdown;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const Popover = PopoverBase as PopoverComponent;
|
|
141
|
+
Popover.Target = PopoverTarget;
|
|
142
|
+
Popover.Dropdown = PopoverDropdown;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Popover - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `Popover` component in your projects using `@recursica/adapter-mantine-v8`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Popover } from "@recursica/adapter-mantine-v8";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { Popover } from "@recursica/adapter-mantine-v8";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<Popover position="bottom" withArrow>
|
|
24
|
+
<Popover.Target>
|
|
25
|
+
<Button>Open Popover</Button>
|
|
26
|
+
</Popover.Target>
|
|
27
|
+
<Popover.Dropdown>
|
|
28
|
+
<Text size="sm">This is the popover content.</Text>
|
|
29
|
+
</Popover.Dropdown>
|
|
30
|
+
</Popover>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 3. Design System Integration
|
|
38
|
+
|
|
39
|
+
All Recursica components in the `@recursica/adapter-mantine-v8` package adhere strictly to design system spacing, scaling, and behavior patterns.
|
|
40
|
+
|
|
41
|
+
> [!IMPORTANT]
|
|
42
|
+
>
|
|
43
|
+
> - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
|
|
44
|
+
> - **No Direct Layers**: Do not pass a `layer` prop to this component. To place it on a specific visual layer, wrap it in a `<Layer layer={0|1|2|3}>` component natively.
|
|
45
|
+
> - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 4. Key Integration Features & Constraints
|
|
50
|
+
|
|
51
|
+
### Composition
|
|
52
|
+
|
|
53
|
+
`Popover`, `Popover.Target`, and `Popover.Dropdown` are used together the same way as in Mantine: `Popover.Target` wraps the trigger element and applies no styling of its own, while `Popover.Dropdown` renders the styled panel content.
|
|
54
|
+
|
|
55
|
+
### Beak (Arrow)
|
|
56
|
+
|
|
57
|
+
The Recursica prop `withBeak` (defaulting to `true`) controls whether the pointer beak is shown, and maps to Mantine's `withArrow`. Both `withBeak` and `withArrow` are accepted; `withBeak` takes precedence. An `arrowSize` prop is also available (default `16`) to size the beak.
|
|
58
|
+
|
|
59
|
+
### Default Position
|
|
60
|
+
|
|
61
|
+
Recursica defaults `position` to `"top"` rather than Mantine's `"bottom"`. Pass your own `position` value to override it.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Popover";
|