@recursica/mantine-adapter 0.55.2 → 0.55.4
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 +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/mantine-adapter.cjs +2 -2
- package/dist/mantine-adapter.cjs.map +1 -1
- package/dist/mantine-adapter.js +2 -2
- package/dist/mantine-adapter.js.map +1 -1
- package/package.json +2 -2
- package/src/components/AssistiveElement/AssistiveElement.stories.tsx +0 -1
- package/src/components/Checkbox/CHECKBOX_IMPLEMENTATION_NOTES.md +13 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +5 -1
- package/src/components/Chip/Chip.stories.tsx +43 -1
- package/src/components/EmptyValueRenderer/USAGE.md +37 -0
- package/src/components/EmptyValueRenderer/index.ts +5 -0
- package/src/components/Layer/index.ts +5 -0
- package/src/components/Radio/RADIO_IMPLEMENTATION_NOTES.md +12 -0
- package/src/components/Radio/RadioGroup.tsx +5 -1
- package/src/components/RecursicaThemeProvider/index.ts +2 -0
- package/src/components/index.ts +3 -0
- package/src/index.ts +105 -1
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "git+https://github.com/borderux/recursica.git",
|
|
14
14
|
"directory": "packages/mantine-adapter"
|
|
15
15
|
},
|
|
16
|
-
"version": "0.55.
|
|
16
|
+
"version": "0.55.4",
|
|
17
17
|
"type": "module",
|
|
18
18
|
"main": "./dist/mantine-adapter.cjs",
|
|
19
19
|
"module": "./dist/mantine-adapter.js",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"vitest": "^3.2.4"
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@recursica/adapter-common": "^0.
|
|
106
|
+
"@recursica/adapter-common": "^0.29.1"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
109
109
|
"@mantine/core": "^8.0.0",
|
|
@@ -23,3 +23,16 @@ This calculation ensures that the optical center of the `.inner` checkmark vecto
|
|
|
23
23
|
### Checkbox.Group Overrides
|
|
24
24
|
|
|
25
25
|
To decouple `<CheckboxGroup>` away from `<Input.Wrapper>`, we explicitly extract the raw array execution mapped correctly against our identical `RecursicaFormControlWrapperProps` schema structurally!
|
|
26
|
+
|
|
27
|
+
### `Checkbox.Group` `controlMaxWidth` bug (fixed 2026-08-31)
|
|
28
|
+
|
|
29
|
+
`CheckboxGroup` was passing `--recursica_ui-kit_components_checkbox-item_properties_max-width`
|
|
30
|
+
(400px) as its own `controlMaxWidth`. That token caps a single checkbox+its own label — it's
|
|
31
|
+
already applied per-item via `.root` in `Checkbox.module.css`. Passed as the _group's_
|
|
32
|
+
`controlMaxWidth`, `FormControlLayout` applies it to the whole root row (`max-width` on
|
|
33
|
+
`.root`, which contains both `leftSection`/label and `rightSection`/items), so in side-by-side
|
|
34
|
+
layout the group's own label got squeezed into that same 400px alongside the checkboxes. There
|
|
35
|
+
is no group-level max-width token in the schema (`checkbox-group_variants_layouts_*` only
|
|
36
|
+
covers gutter/margin/padding) — fixed by leaving `controlMaxWidth` `undefined`, matching
|
|
37
|
+
`SwitchGroup`'s existing pattern. Same bug existed in `RadioGroup` (`radio-button-item_
|
|
38
|
+
properties_max-width`), fixed the same way.
|
|
@@ -89,7 +89,11 @@ export const CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(
|
|
|
89
89
|
<WithReadOnlyWrapper
|
|
90
90
|
className={className}
|
|
91
91
|
style={style as React.CSSProperties}
|
|
92
|
-
|
|
92
|
+
// Not the group's own row width: this token caps a single checkbox+its own label
|
|
93
|
+
// (applied per-item in Checkbox.module.css's `.root`). The group has no max-width token
|
|
94
|
+
// of its own in the schema, so this must stay undefined or FormControlLayout caps the
|
|
95
|
+
// whole label+items row (including the group's own label) at 400px in side-by-side layout.
|
|
96
|
+
controlMaxWidth={undefined}
|
|
93
97
|
controlMinWidth={undefined}
|
|
94
98
|
overStyled={overStyled as true}
|
|
95
99
|
labelElement="div" // Strictly override. ARIA grouping prohibits interactive checkboxes nested natively inside <label>.
|
|
@@ -118,9 +118,51 @@ export const WithLeadingIcon: Story = {
|
|
|
118
118
|
// matches MUI's native behavior of the check icon overlaying the leading icon.
|
|
119
119
|
export const WithLeadingIconSelected: Story = {
|
|
120
120
|
args: {
|
|
121
|
-
...WithLeadingIcon.args,
|
|
122
121
|
children: "Leading Icon Selected",
|
|
123
122
|
checked: true,
|
|
123
|
+
icon: (
|
|
124
|
+
<svg
|
|
125
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
126
|
+
viewBox="0 0 24 24"
|
|
127
|
+
fill="none"
|
|
128
|
+
stroke="currentColor"
|
|
129
|
+
strokeWidth="2"
|
|
130
|
+
strokeLinecap="round"
|
|
131
|
+
strokeLinejoin="round"
|
|
132
|
+
>
|
|
133
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
134
|
+
<path d="M12 8v4"></path>
|
|
135
|
+
<path d="M12 16h.01"></path>
|
|
136
|
+
</svg>
|
|
137
|
+
),
|
|
124
138
|
},
|
|
125
139
|
render: (args: ChipStoryProps) => <Chip {...args} onChange={() => {}} />,
|
|
126
140
|
};
|
|
141
|
+
|
|
142
|
+
// A label long enough to exceed the chip's own max-width token — should stay a single line and
|
|
143
|
+
// truncate with an ellipsis, never wrap, even with both a leading icon and a dismiss button
|
|
144
|
+
// competing for space.
|
|
145
|
+
export const MaxWidthEllipsis: Story = {
|
|
146
|
+
args: {
|
|
147
|
+
children:
|
|
148
|
+
"A very long chip label that exceeds the maximum width and should truncate with an ellipsis",
|
|
149
|
+
checked: false,
|
|
150
|
+
icon: (
|
|
151
|
+
<svg
|
|
152
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
153
|
+
viewBox="0 0 24 24"
|
|
154
|
+
fill="none"
|
|
155
|
+
stroke="currentColor"
|
|
156
|
+
strokeWidth="2"
|
|
157
|
+
strokeLinecap="round"
|
|
158
|
+
strokeLinejoin="round"
|
|
159
|
+
>
|
|
160
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
161
|
+
<path d="M12 8v4"></path>
|
|
162
|
+
<path d="M12 16h.01"></path>
|
|
163
|
+
</svg>
|
|
164
|
+
),
|
|
165
|
+
onDelete: () => console.log("Removal Action Triggered"),
|
|
166
|
+
},
|
|
167
|
+
render: (args: ChipStoryProps) => <Chip {...args} />,
|
|
168
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# EmptyValueRenderer - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `EmptyValueRenderer` component in your projects using `@recursica/mantine-adapter`.
|
|
4
|
+
|
|
5
|
+
> [!NOTE] > `EmptyValueRenderer` is defined once in `@recursica/adapter-common` and re-exported here so it shares the exact same behavior across every Recursica adapter.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Import Reference
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { EmptyValueRenderer } from "@recursica/mantine-adapter";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. Basic Example
|
|
18
|
+
|
|
19
|
+
`EmptyValueRenderer` renders a fallback (`"N/A"` by default) in place of an empty value, and exposes a static `EmptyValueRenderer.check(value)` helper that flags `null`, `undefined`, `""`, and `[]` as empty:
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { EmptyValueRenderer, ReadOnlyField } from "@recursica/mantine-adapter";
|
|
23
|
+
|
|
24
|
+
function Example({ value }: { value?: string }) {
|
|
25
|
+
return EmptyValueRenderer.check(value) ? (
|
|
26
|
+
<EmptyValueRenderer emptyText="No value set" />
|
|
27
|
+
) : (
|
|
28
|
+
<ReadOnlyField value={value} />
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Design System Integration
|
|
36
|
+
|
|
37
|
+
`EmptyValueRenderer` has no visual variants and does not accept `overStyled` — it is a plain text fallback, not a styled component. Use it wherever a read-only or empty-state surface needs a consistent "no value" treatment instead of ad hoc strings.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Radio Implementation Notes
|
|
2
|
+
|
|
3
|
+
### `Radio.Group` `controlMaxWidth` bug (fixed 2026-08-31)
|
|
4
|
+
|
|
5
|
+
`RadioGroup` was passing `--recursica_ui-kit_components_radio-button-item_properties_max-width`
|
|
6
|
+
(400px) as its own `controlMaxWidth`. That token caps a single radio+its own label — it's
|
|
7
|
+
already applied per-item via `.root` in `Radio.module.css`. Passed as the _group's_
|
|
8
|
+
`controlMaxWidth`, `FormControlLayout` applies it to the whole root row, so in side-by-side
|
|
9
|
+
layout the group's own label got squeezed into that same 400px alongside the radios. There is
|
|
10
|
+
no group-level max-width token in the schema — fixed by leaving `controlMaxWidth` `undefined`,
|
|
11
|
+
matching `SwitchGroup`'s existing pattern. Same bug existed in `CheckboxGroup`, fixed the same
|
|
12
|
+
way — see `Checkbox/CHECKBOX_IMPLEMENTATION_NOTES.md`.
|
|
@@ -78,7 +78,11 @@ export const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(
|
|
|
78
78
|
<WithReadOnlyWrapper
|
|
79
79
|
className={className}
|
|
80
80
|
style={style as React.CSSProperties}
|
|
81
|
-
|
|
81
|
+
// Not the group's own row width: this token caps a single radio+its own label (applied
|
|
82
|
+
// per-item in Radio.module.css's `.root`). The group has no max-width token of its own
|
|
83
|
+
// in the schema, so this must stay undefined or FormControlLayout caps the whole
|
|
84
|
+
// label+items row (including the group's own label) at 400px in side-by-side layout.
|
|
85
|
+
controlMaxWidth={undefined}
|
|
82
86
|
controlMinWidth={undefined}
|
|
83
87
|
overStyled={overStyled as true}
|
|
84
88
|
labelElement="div" // Strictly override. ARIA grouping prohibits interactive radios nested natively inside <label>.
|
package/src/components/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from "./Chip/Chip";
|
|
|
12
12
|
export * from "./Container/Container";
|
|
13
13
|
export * from "./DatePicker/DatePicker";
|
|
14
14
|
export * from "./Dropdown/Dropdown";
|
|
15
|
+
export * from "./EmptyValueRenderer";
|
|
15
16
|
export * from "./FileInput/FileInput";
|
|
16
17
|
export * from "./FileUpload/FileUpload";
|
|
17
18
|
export * from "./Flex/Flex";
|
|
@@ -20,6 +21,7 @@ export * from "./Grid/Grid";
|
|
|
20
21
|
export * from "./Group/Group";
|
|
21
22
|
export * from "./Heading/Heading";
|
|
22
23
|
export * from "./HoverCard/HoverCard";
|
|
24
|
+
export * from "./Layer";
|
|
23
25
|
export * from "./Link/Link";
|
|
24
26
|
export * from "./Loader/Loader";
|
|
25
27
|
export * from "./Label";
|
|
@@ -32,6 +34,7 @@ export * from "./Popover";
|
|
|
32
34
|
export * from "./Radio/Radio";
|
|
33
35
|
export * from "./Radio/RadioGroup";
|
|
34
36
|
export * from "./ReadOnlyField";
|
|
37
|
+
export * from "./RecursicaThemeProvider";
|
|
35
38
|
export * from "./SegmentedControl/SegmentedControl";
|
|
36
39
|
export * from "./Slider/Slider";
|
|
37
40
|
export * from "./Stack/Stack";
|
package/src/index.ts
CHANGED
|
@@ -2,7 +2,111 @@ import "@recursica/adapter-common/style.css";
|
|
|
2
2
|
import * as rawComponents from "./components";
|
|
3
3
|
import { wrapComponent } from "@recursica/adapter-common";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// Pass-through components that have no mantine-specific implementation — each is
|
|
6
|
+
// redeclared in its own components/ folder and re-exported from adapter-common there.
|
|
7
|
+
export {
|
|
8
|
+
Layer,
|
|
9
|
+
EmptyValueRenderer,
|
|
10
|
+
RecursicaThemeProvider,
|
|
11
|
+
} from "./components";
|
|
12
|
+
export type {
|
|
13
|
+
RecursicaLayerProps,
|
|
14
|
+
LayerProps,
|
|
15
|
+
EmptyValueRendererProps,
|
|
16
|
+
RecursicaEmptyValueRendererProps,
|
|
17
|
+
RecursicaThemeProviderProps,
|
|
18
|
+
} from "./components";
|
|
19
|
+
export { markCurrentPageItem } from "@recursica/adapter-common";
|
|
20
|
+
|
|
21
|
+
// Foundational types and utilities re-exported explicitly from @recursica/adapter-common
|
|
22
|
+
export type {
|
|
23
|
+
RecursicaSpacing,
|
|
24
|
+
RecursicaSize,
|
|
25
|
+
RequireAccessibleLabel,
|
|
26
|
+
BlockedStylingKeys,
|
|
27
|
+
ForbiddenStyles,
|
|
28
|
+
WithRecursicaSpacing,
|
|
29
|
+
RecursicaOverStyled,
|
|
30
|
+
RecursicaLabelProps,
|
|
31
|
+
RecursicaFormControlWrapperProps,
|
|
32
|
+
RecursicaComponent,
|
|
33
|
+
} from "@recursica/adapter-common";
|
|
34
|
+
export { RECURSICA_COMPONENTS } from "@recursica/adapter-common";
|
|
35
|
+
export {
|
|
36
|
+
copyToClipboard,
|
|
37
|
+
fileMatchesAccept,
|
|
38
|
+
mergeClassNames,
|
|
39
|
+
mergeStyles,
|
|
40
|
+
normalizeComboboxData,
|
|
41
|
+
omitUnsupportedProps,
|
|
42
|
+
withCallerOverride,
|
|
43
|
+
wrapComponent,
|
|
44
|
+
IS_DEV,
|
|
45
|
+
toggleGlobalOverStyled,
|
|
46
|
+
isGlobalOverStyledActive,
|
|
47
|
+
useGlobalOverStyled,
|
|
48
|
+
injectOverStyledStyles,
|
|
49
|
+
registerOverStyledConsoleCommand,
|
|
50
|
+
} from "@recursica/adapter-common";
|
|
51
|
+
|
|
52
|
+
// Shared Recursica prop types that have no mantine-specific extension — re-exported
|
|
53
|
+
// explicitly since each component only imports these internally, never by name.
|
|
54
|
+
export type {
|
|
55
|
+
ReadOnlyControlProps,
|
|
56
|
+
ReadOnlyFieldType,
|
|
57
|
+
RecursicaAccordionProps,
|
|
58
|
+
RecursicaAccordionItemProps,
|
|
59
|
+
RecursicaAccordionControlProps,
|
|
60
|
+
RecursicaAccordionPanelProps,
|
|
61
|
+
RecursicaAssistiveElementProps,
|
|
62
|
+
RecursicaAutocompleteProps,
|
|
63
|
+
RecursicaAvatarProps,
|
|
64
|
+
RecursicaBadgeProps,
|
|
65
|
+
RecursicaBreadcrumbProps,
|
|
66
|
+
RecursicaButtonProps,
|
|
67
|
+
RecursicaCardProps,
|
|
68
|
+
RecursicaCardSectionProps,
|
|
69
|
+
RecursicaCheckboxProps,
|
|
70
|
+
RecursicaChipProps,
|
|
71
|
+
RecursicaComboboxItem,
|
|
72
|
+
RecursicaComboboxData,
|
|
73
|
+
RecursicaComboboxItemWithLabel,
|
|
74
|
+
RecursicaContainerProps,
|
|
75
|
+
RecursicaFileInputProps,
|
|
76
|
+
RecursicaFileInputItem,
|
|
77
|
+
RecursicaFileUploadProps,
|
|
78
|
+
RecursicaFileUploadItem,
|
|
79
|
+
RecursicaFormControlLayoutProps,
|
|
80
|
+
RecursicaHeadingProps,
|
|
81
|
+
RecursicaHoverCardProps,
|
|
82
|
+
RecursicaLinkProps,
|
|
83
|
+
RecursicaLoaderProps,
|
|
84
|
+
RecursicaMenuProps,
|
|
85
|
+
RecursicaModalProps,
|
|
86
|
+
RecursicaPaginationProps,
|
|
87
|
+
RecursicaPanelProps,
|
|
88
|
+
RecursicaPopoverProps,
|
|
89
|
+
RecursicaRadioProps,
|
|
90
|
+
RecursicaSegmentedControlProps,
|
|
91
|
+
RecursicaStepperProps,
|
|
92
|
+
RecursicaSwitchProps,
|
|
93
|
+
RecursicaTableProps,
|
|
94
|
+
RecursicaTableRowProps,
|
|
95
|
+
RecursicaTableHeaderCellProps,
|
|
96
|
+
RecursicaTableCellProps,
|
|
97
|
+
RecursicaTabsProps,
|
|
98
|
+
TextVariant,
|
|
99
|
+
RecursicaTextProps,
|
|
100
|
+
RecursicaTimelineProps,
|
|
101
|
+
RecursicaTimelineItemProps,
|
|
102
|
+
RecursicaToastProps,
|
|
103
|
+
RecursicaTooltipProps,
|
|
104
|
+
RecursicaTransferListProps,
|
|
105
|
+
RecursicaTransferListItem,
|
|
106
|
+
RecursicaTransferListData,
|
|
107
|
+
RecursicaTreeProps,
|
|
108
|
+
RecursicaTreeNode,
|
|
109
|
+
} from "@recursica/adapter-common";
|
|
6
110
|
|
|
7
111
|
// Expose unwrapped structural layout primitives to preserve their polymorphic types
|
|
8
112
|
export const Flex = rawComponents.Flex;
|