@recursica/mantine-adapter 0.9.4 → 0.11.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/CHANGELOG.md +94 -0
- package/README.md +48 -332
- package/dist/index.d.ts +2 -8
- package/dist/mantine-adapter.cjs +2 -0
- package/dist/mantine-adapter.cjs.map +1 -0
- package/dist/mantine-adapter.css +1 -0
- package/dist/mantine-adapter.js +1963 -0
- package/dist/mantine-adapter.js.map +1 -0
- package/dist/src/components/Accordion/Accordion.d.ts +42 -0
- package/dist/src/components/Accordion/index.d.ts +1 -0
- package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +10 -0
- package/dist/src/components/Avatar/Avatar.d.ts +9 -0
- package/dist/src/components/Avatar/index.d.ts +1 -0
- package/dist/src/components/Badge/Badge.d.ts +8 -0
- package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +6 -0
- package/dist/src/components/Button/Button.d.ts +10 -0
- package/dist/src/components/Button/index.d.ts +1 -0
- package/dist/src/components/Card/Card.d.ts +38 -0
- package/dist/src/components/Checkbox/Checkbox.d.ts +13 -0
- package/dist/src/components/Checkbox/CheckboxGroup.d.ts +9 -0
- package/dist/src/components/Chip/Chip.d.ts +15 -0
- package/dist/src/components/Container/Container.d.ts +18 -0
- package/dist/src/components/DatePicker/DatePicker.d.ts +3 -0
- package/dist/src/components/Dropdown/Dropdown.d.ts +11 -0
- package/dist/src/components/FileInput/FileInput.d.ts +3 -0
- package/dist/src/components/FileUpload/FileUpload.d.ts +3 -0
- package/dist/src/components/Flex/Flex.d.ts +17 -0
- package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +21 -0
- package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +20 -0
- package/dist/src/components/Group/Group.d.ts +17 -0
- package/dist/src/components/HoverCard/HoverCard.d.ts +3 -0
- package/dist/src/components/Label/Label.d.ts +19 -0
- package/dist/src/components/Label/index.d.ts +1 -0
- package/dist/src/components/Link/Link.d.ts +3 -0
- package/dist/src/components/Loader/Loader.d.ts +10 -0
- package/dist/src/components/Menu/Menu.d.ts +3 -0
- package/dist/src/components/Modal/Modal.d.ts +3 -0
- package/dist/src/components/NumberInput/NumberInput.d.ts +3 -0
- package/dist/src/components/Pagination/Pagination.d.ts +3 -0
- package/dist/src/components/Panel/Panel.d.ts +3 -0
- package/dist/src/components/Popover/Popover.d.ts +3 -0
- package/dist/src/components/Radio/Radio.d.ts +13 -0
- package/dist/src/components/Radio/RadioGroup.d.ts +9 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyBooleanField.d.ts +5 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +20 -0
- package/dist/src/components/ReadOnlyField/ReadOnlySwitchField.d.ts +5 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +8 -0
- package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +28 -0
- package/dist/src/components/ReadOnlyField/index.d.ts +5 -0
- package/dist/src/components/Search/Search.d.ts +3 -0
- package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/dist/src/components/Slider/Slider.d.ts +3 -0
- package/dist/src/components/Stack/Stack.d.ts +15 -0
- package/dist/src/components/Stepper/Stepper.d.ts +3 -0
- package/dist/src/components/Switch/Switch.d.ts +13 -0
- package/dist/src/components/Switch/SwitchGroup.d.ts +9 -0
- package/dist/src/components/Table/Table.d.ts +3 -0
- package/dist/src/components/Tabs/Tabs.d.ts +3 -0
- package/dist/src/components/Text/Text.d.ts +17 -0
- package/dist/src/components/TextArea/TextArea.d.ts +15 -0
- package/dist/src/components/TextField/TextField.d.ts +9 -0
- package/dist/src/components/TimePicker/TimePicker.d.ts +3 -0
- package/dist/src/components/Timeline/Timeline.d.ts +3 -0
- package/dist/src/components/Title/Title.d.ts +13 -0
- package/dist/src/components/Toast/Toast.d.ts +3 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts +3 -0
- package/dist/src/components/TransferList/TransferList.d.ts +3 -0
- package/dist/src/components/index.d.ts +48 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/types/index.d.ts +6 -0
- package/dist/src/utils/ColorSchemeWrapper.d.ts +3 -0
- package/dist/src/utils/RequireAccessibleLabel.d.ts +18 -0
- package/dist/src/utils/copyToClipboard.d.ts +8 -0
- package/dist/src/utils/filterStylingProps.d.ts +36 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/vite.svg +1 -0
- package/dist/vitest.workspace.d.ts +2 -0
- package/package.json +74 -35
- package/src/OverStyling.stories.tsx +174 -0
- package/src/Version.stories.tsx +56 -0
- package/src/components/Accordion/ACCORDION_IMPLEMENTATION_NOTES.md +48 -0
- package/src/components/Accordion/Accordion.module.css +282 -0
- package/src/components/Accordion/Accordion.stories.tsx +145 -0
- package/src/components/Accordion/Accordion.tsx +200 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/AssistiveElement/AssistiveElement.module.css +111 -0
- package/src/components/AssistiveElement/AssistiveElement.stories.tsx +75 -0
- package/src/components/AssistiveElement/AssistiveElement.tsx +91 -0
- package/src/components/Avatar/AVATAR_IMPLEMENTATION_NOTES.md +24 -0
- package/src/components/Avatar/Avatar.module.css +340 -0
- package/src/components/Avatar/Avatar.stories.tsx +107 -0
- package/src/components/Avatar/Avatar.tsx +100 -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 +124 -0
- package/src/components/Badge/Badge.stories.tsx +78 -0
- package/src/components/Badge/Badge.tsx +66 -0
- package/src/components/Breadcrumb/BREADCRUMB_IMPLEMENTATION_NOTES.md +14 -0
- package/src/components/Breadcrumb/Breadcrumb.module.css +26 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +77 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +64 -0
- package/src/components/Button/Button.module.css +275 -0
- package/src/components/Button/Button.stories.tsx +103 -0
- package/src/components/Button/Button.tsx +122 -0
- package/src/components/Button/IMPLEMENTATION_NOTES.md +45 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Card/CARD_IMPLEMENTATION_NOTES.md +10 -0
- package/src/components/Card/Card.module.css +60 -0
- package/src/components/Card/Card.stories.tsx +141 -0
- package/src/components/Card/Card.tsx +176 -0
- package/src/components/Checkbox/CHECKBOX_IMPLEMENTATION_NOTES.md +25 -0
- package/src/components/Checkbox/Checkbox.module.css +204 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +94 -0
- package/src/components/Checkbox/Checkbox.tsx +159 -0
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +120 -0
- package/src/components/Chip/CHIP_IMPLEMENTATION_NOTES.md +35 -0
- package/src/components/Chip/Chip.module.css +218 -0
- package/src/components/Chip/Chip.stories.tsx +115 -0
- package/src/components/Chip/Chip.tsx +143 -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.tsx +89 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +18 -0
- package/src/components/DatePicker/DatePicker.tsx +7 -0
- package/src/components/Dropdown/DROPDOWN_IMPLEMENTATION_NOTES.md +7 -0
- package/src/components/Dropdown/Dropdown.module.css +272 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +91 -0
- package/src/components/Dropdown/Dropdown.tsx +174 -0
- package/src/components/FileInput/FileInput.stories.tsx +18 -0
- package/src/components/FileInput/FileInput.tsx +7 -0
- package/src/components/FileUpload/FileUpload.stories.tsx +18 -0
- package/src/components/FileUpload/FileUpload.tsx +7 -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.tsx +68 -0
- package/src/components/FormControlLayout/FormControlLayout.module.css +80 -0
- package/src/components/FormControlLayout/FormControlLayout.stories.tsx +82 -0
- package/src/components/FormControlLayout/FormControlLayout.tsx +78 -0
- package/src/components/FormControlWrapper/FORMCONTROLWRAPPER_IMPLEMENTATION_NOTES.md +32 -0
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +8 -0
- package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +129 -0
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +157 -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.tsx +68 -0
- package/src/components/HoverCard/HoverCard.stories.tsx +17 -0
- package/src/components/HoverCard/HoverCard.tsx +7 -0
- package/src/components/Label/LABEL_IMPLEMENTATION_NOTES.md +48 -0
- package/src/components/Label/Label.module.css +140 -0
- package/src/components/Label/Label.stories.tsx +122 -0
- package/src/components/Label/Label.tsx +127 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Link/Link.stories.tsx +17 -0
- package/src/components/Link/Link.tsx +7 -0
- package/src/components/Loader/Loader.module.css +60 -0
- package/src/components/Loader/Loader.stories.tsx +103 -0
- package/src/components/Loader/Loader.tsx +76 -0
- package/src/components/Menu/Menu.stories.tsx +17 -0
- package/src/components/Menu/Menu.tsx +7 -0
- package/src/components/Modal/Modal.stories.tsx +17 -0
- package/src/components/Modal/Modal.tsx +7 -0
- package/src/components/NumberInput/NumberInput.stories.tsx +18 -0
- package/src/components/NumberInput/NumberInput.tsx +7 -0
- package/src/components/Pagination/Pagination.stories.tsx +17 -0
- package/src/components/Pagination/Pagination.tsx +7 -0
- package/src/components/Panel/Panel.stories.tsx +17 -0
- package/src/components/Panel/Panel.tsx +7 -0
- package/src/components/Popover/Popover.stories.tsx +17 -0
- package/src/components/Popover/Popover.tsx +7 -0
- package/src/components/Radio/Radio.module.css +207 -0
- package/src/components/Radio/Radio.stories.tsx +90 -0
- package/src/components/Radio/Radio.tsx +174 -0
- package/src/components/Radio/RadioGroup.stories.tsx +117 -0
- package/src/components/Radio/RadioGroup.tsx +118 -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 +49 -0
- package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +163 -0
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +102 -0
- package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
- package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
- package/src/components/ReadOnlyField/index.ts +5 -0
- package/src/components/Search/Search.stories.tsx +17 -0
- package/src/components/Search/Search.tsx +7 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +18 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +7 -0
- package/src/components/Slider/Slider.stories.tsx +18 -0
- package/src/components/Slider/Slider.tsx +7 -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.tsx +66 -0
- package/src/components/Stepper/Stepper.stories.tsx +17 -0
- package/src/components/Stepper/Stepper.tsx +7 -0
- package/src/components/Switch/SWITCH_IMPLEMENTATION_NOTES.md +28 -0
- package/src/components/Switch/Switch.module.css +199 -0
- package/src/components/Switch/Switch.stories.tsx +111 -0
- package/src/components/Switch/Switch.tsx +168 -0
- package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
- package/src/components/Switch/SwitchGroup.tsx +118 -0
- package/src/components/Table/Table.stories.tsx +17 -0
- package/src/components/Table/Table.tsx +7 -0
- package/src/components/Tabs/Tabs.stories.tsx +17 -0
- package/src/components/Tabs/Tabs.tsx +7 -0
- package/src/components/Text/Text.stories.tsx +88 -0
- package/src/components/Text/Text.tsx +54 -0
- package/src/components/TextArea/TEXTAREA_IMPLEMENTATION_NOTES.md +7 -0
- package/src/components/TextArea/TextArea.module.css +225 -0
- package/src/components/TextArea/TextArea.stories.tsx +91 -0
- package/src/components/TextArea/TextArea.tsx +152 -0
- package/src/components/TextField/TEXTFIELD_IMPLEMENTATION_NOTES.md +19 -0
- package/src/components/TextField/TextField.module.css +225 -0
- package/src/components/TextField/TextField.stories.tsx +162 -0
- package/src/components/TextField/TextField.tsx +139 -0
- package/src/components/TimePicker/TimePicker.stories.tsx +18 -0
- package/src/components/TimePicker/TimePicker.tsx +7 -0
- package/src/components/Timeline/Timeline.stories.tsx +17 -0
- package/src/components/Timeline/Timeline.tsx +7 -0
- package/src/components/Title/Title.stories.tsx +63 -0
- package/src/components/Title/Title.tsx +45 -0
- package/src/components/Toast/Toast.stories.tsx +17 -0
- package/src/components/Toast/Toast.tsx +7 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +17 -0
- package/src/components/Tooltip/Tooltip.tsx +7 -0
- package/src/components/TransferList/TransferList.stories.tsx +17 -0
- package/src/components/TransferList/TransferList.tsx +7 -0
- package/src/components/index.ts +48 -0
- package/src/env.d.ts +7 -0
- package/src/index.ts +3 -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 +12 -0
- package/src/utils/copyToClipboard.ts +36 -0
- package/src/utils/filterStylingProps.ts +141 -0
- package/src/utils/index.ts +1 -0
- package/dist/adapter/generateBorderRadiusType.d.ts +0 -3
- package/dist/adapter/generateBorderRadiusType.d.ts.map +0 -1
- package/dist/adapter/generateColorTypes.d.ts +0 -6
- package/dist/adapter/generateColorTypes.d.ts.map +0 -1
- package/dist/adapter/generateIcons.d.ts +0 -8
- package/dist/adapter/generateIcons.d.ts.map +0 -1
- package/dist/adapter/generateMantineTheme.d.ts +0 -19
- package/dist/adapter/generateMantineTheme.d.ts.map +0 -1
- package/dist/adapter/generatePrettierignore.d.ts +0 -3
- package/dist/adapter/generatePrettierignore.d.ts.map +0 -1
- package/dist/adapter/generateRecursicaObject.d.ts +0 -7
- package/dist/adapter/generateRecursicaObject.d.ts.map +0 -1
- package/dist/adapter/generateRecursicaThemes.d.ts +0 -12
- package/dist/adapter/generateRecursicaThemes.d.ts.map +0 -1
- package/dist/adapter/generateRecursicaTokens.d.ts +0 -3
- package/dist/adapter/generateRecursicaTokens.d.ts.map +0 -1
- package/dist/adapter/generateSpacersType.d.ts +0 -3
- package/dist/adapter/generateSpacersType.d.ts.map +0 -1
- package/dist/adapter/generateUiKit.d.ts +0 -8
- package/dist/adapter/generateUiKit.d.ts.map +0 -1
- package/dist/adapter/generateVanillaExtractThemes.d.ts +0 -12
- package/dist/adapter/generateVanillaExtractThemes.d.ts.map +0 -1
- package/dist/adapter/index.d.ts +0 -44
- package/dist/adapter/index.d.ts.map +0 -1
- package/dist/cli.d.ts +0 -6
- package/dist/cli.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -921
- package/dist/index.js.map +0 -1
- package/dist/main.cjs +0 -928
- package/dist/main.cjs.map +0 -1
- package/dist/main.d.ts +0 -2
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js +0 -926
- package/dist/main.js.map +0 -1
- package/dist/shared/processTokens.d.ts +0 -22
- package/dist/shared/processTokens.d.ts.map +0 -1
- package/dist/types.d.ts +0 -62
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/fileCheck.d.ts +0 -8
- package/dist/utils/fileCheck.d.ts.map +0 -1
- package/dist/utils/loadConfig.d.ts +0 -24
- package/dist/utils/loadConfig.d.ts.map +0 -1
- package/dist/webworker.d.ts +0 -2
- package/dist/webworker.d.ts.map +0 -1
- package/dist/webworker.js +0 -791
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* filterStylingProps
|
|
3
|
+
*
|
|
4
|
+
* This utility acts as the central gatekeeper for strict design-system adherence across
|
|
5
|
+
* all Recursica components mapped over Mantine.
|
|
6
|
+
*
|
|
7
|
+
* PHILOSOPHY:
|
|
8
|
+
* Recursica components are designed to be explicitly sandboxed tokens. Allowing external
|
|
9
|
+
* `className` or Mantine style system props (`bg`, `p`, etc.) breaks the design system by
|
|
10
|
+
* allowing developers to leak arbitrary designs into components.
|
|
11
|
+
*
|
|
12
|
+
* By default (`overStyled=false`), this utility actively prevents developers from overriding
|
|
13
|
+
* internal component styles (such as background, colors, typography, or internal classNames).
|
|
14
|
+
* It safely *permits* external layout overrides (like `margin` / `m`) so that components can
|
|
15
|
+
* easily be spaced alongside other DOM elements.
|
|
16
|
+
*
|
|
17
|
+
* If a developer passes `overStyled={true}`, this filter allows all styling properties to
|
|
18
|
+
* flow through to the underlying Mantine component natively, at the developer's own risk.
|
|
19
|
+
*
|
|
20
|
+
* @param props - The raw component props passed down to the wrapper
|
|
21
|
+
* @param overStyled - Boolean toggle to allow raw external styling. Defaults to false.
|
|
22
|
+
* @returns Sanitized component props safe for internal styling merging
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export const BLOCKED_STYLING_KEYS = [
|
|
26
|
+
"className",
|
|
27
|
+
"classNames",
|
|
28
|
+
"style",
|
|
29
|
+
"styles",
|
|
30
|
+
"vars", // Internal structure hooks
|
|
31
|
+
"p",
|
|
32
|
+
"px",
|
|
33
|
+
"py",
|
|
34
|
+
"pt",
|
|
35
|
+
"pb",
|
|
36
|
+
"pl",
|
|
37
|
+
"pr", // Padding
|
|
38
|
+
"bg",
|
|
39
|
+
"c",
|
|
40
|
+
"opacity", // Color
|
|
41
|
+
"ff",
|
|
42
|
+
"fz",
|
|
43
|
+
"fw",
|
|
44
|
+
"lts",
|
|
45
|
+
"ta",
|
|
46
|
+
"lh",
|
|
47
|
+
"fs",
|
|
48
|
+
"tt",
|
|
49
|
+
"td", // Typography
|
|
50
|
+
"bd",
|
|
51
|
+
"bdw",
|
|
52
|
+
"bds",
|
|
53
|
+
"bdc",
|
|
54
|
+
"bdr", // Borders
|
|
55
|
+
"shadow", // Effects
|
|
56
|
+
"w",
|
|
57
|
+
"miw",
|
|
58
|
+
"maw",
|
|
59
|
+
"h",
|
|
60
|
+
"mih",
|
|
61
|
+
"mah", // Dimensions
|
|
62
|
+
] as const;
|
|
63
|
+
|
|
64
|
+
export type BlockedStylingKeys = (typeof BLOCKED_STYLING_KEYS)[number];
|
|
65
|
+
|
|
66
|
+
export type RecursicaSpacing =
|
|
67
|
+
| "rec-none"
|
|
68
|
+
| "rec-sm"
|
|
69
|
+
| "rec-default"
|
|
70
|
+
| "rec-md"
|
|
71
|
+
| "rec-lg"
|
|
72
|
+
| "rec-xl"
|
|
73
|
+
| "rec-2xl";
|
|
74
|
+
|
|
75
|
+
export type RecursicaSize = "small" | "default" | "large";
|
|
76
|
+
|
|
77
|
+
const LAYOUT_PROPS = new Set([
|
|
78
|
+
"m",
|
|
79
|
+
"my",
|
|
80
|
+
"mx",
|
|
81
|
+
"mt",
|
|
82
|
+
"mb",
|
|
83
|
+
"ml",
|
|
84
|
+
"mr",
|
|
85
|
+
"gap",
|
|
86
|
+
"rowGap",
|
|
87
|
+
"columnGap",
|
|
88
|
+
"top",
|
|
89
|
+
"left",
|
|
90
|
+
"bottom",
|
|
91
|
+
"right",
|
|
92
|
+
]);
|
|
93
|
+
|
|
94
|
+
const SPACING_MAP: Record<string, string> = {
|
|
95
|
+
"rec-none": "var(--recursica_brand_dimensions_general_none)",
|
|
96
|
+
"rec-sm": "var(--recursica_brand_dimensions_general_sm)",
|
|
97
|
+
"rec-default": "var(--recursica_brand_dimensions_general_default)",
|
|
98
|
+
"rec-md": "var(--recursica_brand_dimensions_general_md)",
|
|
99
|
+
"rec-lg": "var(--recursica_brand_dimensions_general_lg)",
|
|
100
|
+
"rec-xl": "var(--recursica_brand_dimensions_general_xl)",
|
|
101
|
+
"rec-2xl": "var(--recursica_brand_dimensions_general_2xl)",
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export type ForbiddenStyles = { [K in BlockedStylingKeys]?: never };
|
|
105
|
+
|
|
106
|
+
export type RecursicaOverStyled<T> =
|
|
107
|
+
| (Omit<T, BlockedStylingKeys> &
|
|
108
|
+
ForbiddenStyles & { overStyled?: false | undefined })
|
|
109
|
+
| (T & { overStyled: true });
|
|
110
|
+
|
|
111
|
+
export function filterStylingProps<T extends Record<string, unknown>>(
|
|
112
|
+
props: T,
|
|
113
|
+
overStyled?: boolean,
|
|
114
|
+
): Partial<T> {
|
|
115
|
+
if (overStyled) {
|
|
116
|
+
return props;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const sanitized = { ...props };
|
|
120
|
+
|
|
121
|
+
for (const prop of BLOCKED_STYLING_KEYS) {
|
|
122
|
+
if (prop in sanitized) {
|
|
123
|
+
delete sanitized[prop];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Intercept Recursica spacing tokens for valid layout properties
|
|
128
|
+
for (const [key, value] of Object.entries(sanitized)) {
|
|
129
|
+
if (
|
|
130
|
+
typeof value === "string" &&
|
|
131
|
+
value.startsWith("rec-") &&
|
|
132
|
+
LAYOUT_PROPS.has(key)
|
|
133
|
+
) {
|
|
134
|
+
if (value in SPACING_MAP) {
|
|
135
|
+
(sanitized as Record<string, unknown>)[key] = SPACING_MAP[value];
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return sanitized;
|
|
141
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./copyToClipboard";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateBorderRadiusType.d.ts","sourceRoot":"","sources":["../../adapter/generateBorderRadiusType.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,MAAM,EAAE,EACtB,UAAU,EAAE,MAAM,GACjB,eAAe,CAYjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateColorTypes.d.ts","sourceRoot":"","sources":["../../adapter/generateColorTypes.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM;;;;EAQ3E"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ExportingResult, RecursicaConfigIcons } from "../types";
|
|
2
|
-
export interface GenerateIconsOutput {
|
|
3
|
-
exportedIcons: ExportingResult[];
|
|
4
|
-
iconExports: ExportingResult;
|
|
5
|
-
iconResourceMap: ExportingResult;
|
|
6
|
-
}
|
|
7
|
-
export declare function generateIcons(icons: Record<string, string>, srcPath: string, config: RecursicaConfigIcons | undefined): GenerateIconsOutput;
|
|
8
|
-
//# sourceMappingURL=generateIcons.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateIcons.d.ts","sourceRoot":"","sources":["../../adapter/generateIcons.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEjE,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,WAAW,EAAE,eAAe,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,oBAAoB,GAAG,SAAS,GACvC,mBAAmB,CAwErB"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ThemeTokens, ContractTokens, ExportingProps, MantineThemeOverride, ExportingResult } from "../types";
|
|
2
|
-
interface ContractTokensObject {
|
|
3
|
-
tokens: ContractTokens;
|
|
4
|
-
filename: string;
|
|
5
|
-
}
|
|
6
|
-
interface GenerateMantineThemeParams {
|
|
7
|
-
mantineThemeOverride: MantineThemeOverride | undefined;
|
|
8
|
-
tokens: ThemeTokens;
|
|
9
|
-
breakpoints: Record<string, string>;
|
|
10
|
-
contractTokens: ContractTokensObject;
|
|
11
|
-
exportingProps: ExportingProps;
|
|
12
|
-
}
|
|
13
|
-
export interface GenerateMantineThemeOutput {
|
|
14
|
-
mantineTheme: ExportingResult;
|
|
15
|
-
postCss: ExportingResult;
|
|
16
|
-
}
|
|
17
|
-
export declare function generateMantineTheme({ mantineThemeOverride, tokens, breakpoints, contractTokens: { tokens: contractTokens, filename: contractFilename }, exportingProps: { outputPath, project, rootPath }, }: GenerateMantineThemeParams): GenerateMantineThemeOutput;
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=generateMantineTheme.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateMantineTheme.d.ts","sourceRoot":"","sources":["../../adapter/generateMantineTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,eAAe,EAChB,MAAM,UAAU,CAAC;AAGlB,UAAU,oBAAoB;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,0BAA0B;IAClC,oBAAoB,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACvD,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,cAAc,EAAE,oBAAoB,CAAC;IACrC,cAAc,EAAE,cAAc,CAAC;CAChC;AAeD,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,eAAe,CAAC;IAC9B,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,wBAAgB,oBAAoB,CAAC,EACnC,oBAAoB,EACpB,MAAM,EACN,WAAW,EACX,cAAc,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,EACtE,cAAc,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,GAClD,EAAE,0BAA0B,GAAG,0BAA0B,CA4FzD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generatePrettierignore.d.ts","sourceRoot":"","sources":["../../adapter/generatePrettierignore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,sBAAsB,IAAI,eAAe,CAWxD"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { RecursicaConfiguration } from "@recursica/schemas";
|
|
2
|
-
export declare function createRecursicaObject(project: RecursicaConfiguration["project"], outputPath: string): {
|
|
3
|
-
content: string;
|
|
4
|
-
path: string;
|
|
5
|
-
filename: string;
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=generateRecursicaObject.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateRecursicaObject.d.ts","sourceRoot":"","sources":["../../adapter/generateRecursicaObject.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,CAAC,SAAS,CAAC,EAC1C,UAAU,EAAE,MAAM;;;;EAwBnB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ExportingResult, Themes } from "../types";
|
|
2
|
-
interface GenerateRecursicaThemesParams {
|
|
3
|
-
outputPath: string;
|
|
4
|
-
themes: Themes;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Generates the RecursicaThemes.ts file that contains the THEMES constant
|
|
8
|
-
* based on the theme dictionary
|
|
9
|
-
*/
|
|
10
|
-
export declare function generateRecursicaThemes({ outputPath, themes, }: GenerateRecursicaThemesParams): ExportingResult;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=generateRecursicaThemes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateRecursicaThemes.d.ts","sourceRoot":"","sources":["../../adapter/generateRecursicaThemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGxD,UAAU,6BAA6B;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,UAAU,EACV,MAAM,GACP,EAAE,6BAA6B,GAAG,eAAe,CAsCjD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateRecursicaTokens.d.ts","sourceRoot":"","sources":["../../adapter/generateRecursicaTokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG7E,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,WAAW,EACvB,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,cAAc,GACtC,eAAe,CAmBjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateSpacersType.d.ts","sourceRoot":"","sources":["../../adapter/generateSpacersType.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EAAE,EACtB,UAAU,EAAE,MAAM,GACjB,eAAe,CASjB"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ThemeTokens, ExportingProps, ExportingResult } from "../types";
|
|
2
|
-
interface GenerateUiKitParams {
|
|
3
|
-
recursicaTokensFilename: string;
|
|
4
|
-
themeContractFilename: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function generateUiKit(uiKit: ThemeTokens, { recursicaTokensFilename, themeContractFilename }: GenerateUiKitParams, { outputPath, project }: ExportingProps): ExportingResult;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=generateUiKit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateUiKit.d.ts","sourceRoot":"","sources":["../../adapter/generateUiKit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EAEd,eAAe,EAChB,MAAM,UAAU,CAAC;AAIlB,UAAU,mBAAmB;IAC3B,uBAAuB,EAAE,MAAM,CAAC;IAChC,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,EAClB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,EAAE,mBAAmB,EACvE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,cAAc,GACtC,eAAe,CAwBjB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Themes, ExportingProps, ValueToken, ContractTokens, ThemeTokens, ExportingResult } from "../types";
|
|
2
|
-
export declare function parseValue(value: ValueToken | string, recursicaTokens: string): string;
|
|
3
|
-
export interface VanillaExtractThemesOutput {
|
|
4
|
-
themesFileContent: ExportingResult;
|
|
5
|
-
vanillaExtractThemes: ExportingResult[];
|
|
6
|
-
availableThemes: ExportingResult;
|
|
7
|
-
themeContract: ExportingResult;
|
|
8
|
-
contractTokens: ContractTokens;
|
|
9
|
-
typeDefinitions: ExportingResult;
|
|
10
|
-
}
|
|
11
|
-
export declare function generateVanillaExtractThemes(tokens: ThemeTokens, themes: Themes, recursicaTokensFilename: string, { outputPath, project }: ExportingProps): VanillaExtractThemesOutput;
|
|
12
|
-
//# sourceMappingURL=generateVanillaExtractThemes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateVanillaExtractThemes.d.ts","sourceRoot":"","sources":["../../adapter/generateVanillaExtractThemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,cAAc,EACd,UAAU,EACV,cAAc,EACd,WAAW,EACX,eAAe,EAChB,MAAM,UAAU,CAAC;AAOlB,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,GAAG,MAAM,EAC1B,eAAe,EAAE,MAAM,UAaxB;AAiCD,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,EAAE,eAAe,CAAC;IACnC,oBAAoB,EAAE,eAAe,EAAE,CAAC;IACxC,eAAe,EAAE,eAAe,CAAC;IACjC,aAAa,EAAE,eAAe,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;IAC/B,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,MAAM,EACd,uBAAuB,EAAE,MAAM,EAC/B,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,cAAc,GACtC,0BAA0B,CA8H5B"}
|
package/dist/adapter/index.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { RecursicaConfigOverrides, RecursicaConfigIcons, ExportingResult } from "../types";
|
|
2
|
-
import { VanillaExtractThemesOutput } from "./generateVanillaExtractThemes";
|
|
3
|
-
import { GenerateMantineThemeOutput } from "./generateMantineTheme";
|
|
4
|
-
import { GenerateIconsOutput } from "./generateIcons";
|
|
5
|
-
import { ProcessTokens } from "../shared/processTokens";
|
|
6
|
-
import type { RecursicaConfiguration } from "@recursica/schemas";
|
|
7
|
-
interface GenerateThemeFileParams {
|
|
8
|
-
overrides: RecursicaConfigOverrides | undefined;
|
|
9
|
-
rootPath: string;
|
|
10
|
-
srcPath: string;
|
|
11
|
-
project: RecursicaConfiguration["project"];
|
|
12
|
-
icons: Record<string, string>;
|
|
13
|
-
iconsConfig: RecursicaConfigIcons | undefined;
|
|
14
|
-
processTokens: ProcessTokens;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Generates Mantine theme files including:
|
|
18
|
-
* - Generic theme file with base theme and createColorToken function
|
|
19
|
-
* - Individual theme files for each theme variant
|
|
20
|
-
* - CSS variables file
|
|
21
|
-
* - Type declarations for theme colors
|
|
22
|
-
* - Index file exporting all themes
|
|
23
|
-
*
|
|
24
|
-
* @param srcPath - Path to the source directory for type declarations
|
|
25
|
-
* @param tokens - Base theme tokens
|
|
26
|
-
* @param themes - Theme variants
|
|
27
|
-
* @param project - Project name
|
|
28
|
-
*/
|
|
29
|
-
interface RunAdapterOutput {
|
|
30
|
-
recursicaTokens: ExportingResult;
|
|
31
|
-
vanillaExtractThemes: VanillaExtractThemesOutput;
|
|
32
|
-
mantineTheme: GenerateMantineThemeOutput;
|
|
33
|
-
uiKitObject: ExportingResult;
|
|
34
|
-
recursicaObject: ExportingResult;
|
|
35
|
-
colorsType: ExportingResult;
|
|
36
|
-
spacersType: ExportingResult;
|
|
37
|
-
borderRadiusType: ExportingResult;
|
|
38
|
-
iconsObject: GenerateIconsOutput | undefined;
|
|
39
|
-
recursicaThemes: ExportingResult;
|
|
40
|
-
prettierignore: ExportingResult;
|
|
41
|
-
}
|
|
42
|
-
export declare function runAdapter({ rootPath, overrides, srcPath, project, icons, iconsConfig, processTokens, }: GenerateThemeFileParams): RunAdapterOutput;
|
|
43
|
-
export {};
|
|
44
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../adapter/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAEL,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAEL,0BAA0B,EAC3B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAiB,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAIrE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGjE,UAAU,uBAAuB;IAC/B,SAAS,EAAE,wBAAwB,GAAG,SAAS,CAAC;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,WAAW,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAC9C,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED;;;;;;;;;;;;GAYG;AACH,UAAU,gBAAgB;IACxB,eAAe,EAAE,eAAe,CAAC;IACjC,oBAAoB,EAAE,0BAA0B,CAAC;IACjD,YAAY,EAAE,0BAA0B,CAAC;IACzC,WAAW,EAAE,eAAe,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE,eAAe,CAAC;IAC5B,WAAW,EAAE,eAAe,CAAC;IAC7B,gBAAgB,EAAE,eAAe,CAAC;IAClC,WAAW,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC7C,eAAe,EAAE,eAAe,CAAC;IACjC,cAAc,EAAE,eAAe,CAAC;CACjC;AACD,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,OAAO,EACP,OAAO,EACP,KAAK,EACL,WAAW,EACX,aAAa,GACd,EAAE,uBAAuB,GAAG,gBAAgB,CA6E5C"}
|
package/dist/cli.d.ts
DELETED
package/dist/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CA8F7C"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAGvC,YAAY,EACV,MAAM,EACN,WAAW,EACX,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC"}
|