@recursica/adapter-mantine-v8 1.3.2 → 1.3.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/adapter-mantine-v8.cjs +1 -1
  3. package/dist/adapter-mantine-v8.cjs.map +1 -1
  4. package/dist/adapter-mantine-v8.js +338 -331
  5. package/dist/adapter-mantine-v8.js.map +1 -1
  6. package/dist/index.d.ts +5 -1
  7. package/docs/PHILOSOPHY.md +4 -0
  8. package/package.json +4 -8
  9. package/src/components/Heading/HEADING_IMPLEMENTATION_NOTES.md +9 -0
  10. package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +8 -0
  11. package/src/components/Panel/Panel.tsx +23 -6
  12. package/src/components/Text/TEXT_IMPLEMENTATION_NOTES.md +10 -0
  13. package/src/components/Text/Text.headings.dom.test.tsx +51 -0
  14. package/src/components/Text/Text.tsx +9 -0
  15. package/.storybook/commonArgTypes.ts +0 -148
  16. package/recursica_brand.json +0 -2610
  17. package/recursica_tokens.json +0 -769
  18. package/recursica_ui-kit.json +0 -9049
  19. package/recursica_variables_scoped.css +0 -6178
  20. package/src/Introduction.stories.tsx +0 -149
  21. package/src/components/Accordion/Accordion.stories.tsx +0 -189
  22. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +0 -68
  23. package/src/components/AutoComplete/AutoComplete.stories.tsx +0 -336
  24. package/src/components/Avatar/Avatar.stories.tsx +0 -92
  25. package/src/components/Badge/Badge.stories.tsx +0 -78
  26. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +0 -114
  27. package/src/components/Button/Button.stories.tsx +0 -192
  28. package/src/components/Card/Card.stories.tsx +0 -76
  29. package/src/components/Checkbox/Checkbox.stories.tsx +0 -97
  30. package/src/components/Checkbox/CheckboxGroup.stories.tsx +0 -139
  31. package/src/components/Chip/Chip.stories.tsx +0 -128
  32. package/src/components/Container/Container.stories.tsx +0 -118
  33. package/src/components/DatePicker/DatePicker.stories.tsx +0 -158
  34. package/src/components/Dropdown/Dropdown.stories.tsx +0 -252
  35. package/src/components/FileInput/FileInput.stories.tsx +0 -313
  36. package/src/components/FileUpload/FileUpload.stories.tsx +0 -362
  37. package/src/components/Flex/Flex.stories.tsx +0 -128
  38. package/src/components/FormControlLayout/FormControlLayout.stories.tsx +0 -118
  39. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +0 -129
  40. package/src/components/Group/Group.stories.tsx +0 -120
  41. package/src/components/Heading/Heading.stories.tsx +0 -112
  42. package/src/components/HoverCard/HoverCard.stories.tsx +0 -172
  43. package/src/components/Label/Label.stories.tsx +0 -131
  44. package/src/components/LayoutGrid/LayoutGrid.stories.tsx +0 -61
  45. package/src/components/Link/Link.stories.tsx +0 -58
  46. package/src/components/Loader/Loader.stories.tsx +0 -123
  47. package/src/components/Menu/Menu.stories.tsx +0 -370
  48. package/src/components/Modal/Modal.stories.tsx +0 -105
  49. package/src/components/NumberInput/NumberInput.stories.tsx +0 -96
  50. package/src/components/Pagination/Pagination.stories.tsx +0 -48
  51. package/src/components/Panel/Panel.stories.tsx +0 -227
  52. package/src/components/Popover/Popover.stories.tsx +0 -133
  53. package/src/components/Radio/Radio.stories.tsx +0 -93
  54. package/src/components/Radio/RadioGroup.stories.tsx +0 -117
  55. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +0 -163
  56. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +0 -106
  57. package/src/components/Slider/Slider.stories.tsx +0 -282
  58. package/src/components/Stack/Stack.stories.tsx +0 -108
  59. package/src/components/Stepper/Stepper.stories.tsx +0 -148
  60. package/src/components/Switch/Switch.stories.tsx +0 -114
  61. package/src/components/Switch/SwitchGroup.stories.tsx +0 -132
  62. package/src/components/Table/Table.stories.tsx +0 -140
  63. package/src/components/Tabs/Tabs.stories.tsx +0 -154
  64. package/src/components/Text/Text.stories.tsx +0 -123
  65. package/src/components/TextArea/TextArea.stories.tsx +0 -94
  66. package/src/components/TextField/TextField.stories.tsx +0 -162
  67. package/src/components/TimePicker/TimePicker.stories.tsx +0 -141
  68. package/src/components/Timeline/Timeline.stories.tsx +0 -128
  69. package/src/components/Toast/Toast.stories.tsx +0 -67
  70. package/src/components/Tooltip/Tooltip.stories.tsx +0 -165
  71. package/src/components/TransferList/TransferList.stories.tsx +0 -121
  72. package/src/components/Tree/Tree.stories.tsx +0 -104
@@ -1,118 +0,0 @@
1
- import React from "react";
2
- import type { Meta, StoryObj } from "@storybook/react";
3
- import { Container } from "./Container";
4
- import { Text } from "../Text/Text";
5
-
6
- type ContainerStoryProps = React.ComponentProps<typeof Container>;
7
-
8
- const meta: Meta<ContainerStoryProps> = {
9
- title: "UI-Kit/Container",
10
- component: Container,
11
- tags: ["autodocs"],
12
- parameters: {
13
- docs: {
14
- description: {
15
- component:
16
- "Container is a generic layout wrapper that safely maps to Mantine's Container, standardizing maximum content widths across the application.",
17
- },
18
- },
19
- },
20
- args: {
21
- size: "md",
22
- fluid: false,
23
- },
24
- argTypes: {
25
- size: {
26
- control: "select",
27
- options: [
28
- "xs",
29
- "sm",
30
- "md",
31
- "lg",
32
- "xl",
33
- "rec-sm",
34
- "rec-default",
35
- "rec-md",
36
- "rec-lg",
37
- "rec-xl",
38
- "rec-2xl",
39
- ],
40
- description:
41
- "Maximum width defined by Mantine system sizes or Recursica sizes",
42
- },
43
- fluid: {
44
- control: "boolean",
45
- description: "If true, overrides size and sets max-width to 100%",
46
- },
47
- defaultChecked: {
48
- table: { disable: true },
49
- },
50
- },
51
- };
52
-
53
- export default meta;
54
-
55
- type Story = StoryObj<ContainerStoryProps>;
56
-
57
- export const Default: Story = {
58
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
59
- render: ({ withLayer, layer, ...args }: any) => (
60
- <div style={{ backgroundColor: "#f0f0f0", padding: "16px" }}>
61
- <Container
62
- {...args}
63
- style={{
64
- backgroundColor: "white",
65
- padding: "16px",
66
- border: "1px solid #ccc",
67
- }}
68
- >
69
- <Text>
70
- This is a Container holding centered content. The background and
71
- border are added just to demonstrate the layout bounds visually.
72
- </Text>
73
- </Container>
74
- </div>
75
- ),
76
- };
77
-
78
- export const SmallContainer: Story = {
79
- args: {
80
- size: "sm",
81
- },
82
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
83
- render: ({ withLayer, layer, ...args }: any) => (
84
- <div style={{ backgroundColor: "#f0f0f0", padding: "16px" }}>
85
- <Container
86
- {...args}
87
- style={{
88
- backgroundColor: "white",
89
- padding: "16px",
90
- border: "1px solid #ccc",
91
- }}
92
- >
93
- <Text>Small Container Layout</Text>
94
- </Container>
95
- </div>
96
- ),
97
- };
98
-
99
- export const FluidContainer: Story = {
100
- args: {
101
- fluid: true,
102
- },
103
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
104
- render: ({ withLayer, layer, ...args }: any) => (
105
- <div style={{ backgroundColor: "#f0f0f0", padding: "16px" }}>
106
- <Container
107
- {...args}
108
- style={{
109
- backgroundColor: "white",
110
- padding: "16px",
111
- border: "1px solid #ccc",
112
- }}
113
- >
114
- <Text>Fluid Container Layout</Text>
115
- </Container>
116
- </div>
117
- ),
118
- };
@@ -1,158 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { DatePicker } from "./DatePicker";
3
- import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
4
-
5
- const meta: Meta<typeof DatePicker> = {
6
- title: "UI-Kit/DatePicker",
7
- component: DatePicker,
8
- tags: ["autodocs"],
9
- parameters: {
10
- docs: {
11
- description: {
12
- component: `
13
- The \`DatePicker\` primitive provides a unified calendar date selection input integrated directly into the \`FormControlWrapper\` architecture.
14
-
15
- ### Architectural Decoupling
16
- Recursica overrides the internal Mantine \`DatePickerInput\` wrapper defaults, safely injecting the date picker into our rigid structural layout systems. State modifiers (e.g. Focus, Errors, ReadOnly) hook seamlessly back onto our native CSS mapping architecture.
17
-
18
- ### Examples
19
- Always structure horizontal architectures via the generic \`formLayout\` parameter.
20
- \`\`\`tsx
21
- <DatePicker
22
- label="Start Date"
23
- assistiveText="Select the deployment kick-off date."
24
- formLayout="stacked"
25
- />
26
- \`\`\`
27
- `,
28
- },
29
- },
30
- },
31
- argTypes: {
32
- ...formControlArgTypes,
33
- disabled: {
34
- control: "boolean",
35
- description:
36
- "Maps the formal disabled variable states structurally to the input core.",
37
- },
38
- error: {
39
- control: "text",
40
- description:
41
- "Applies the strict error string boundary rendering invalid structures seamlessly.",
42
- },
43
- required: {
44
- control: "boolean",
45
- },
46
- label: {
47
- control: "text",
48
- },
49
- assistiveText: {
50
- control: "text",
51
- },
52
- readOnly: {
53
- control: "boolean",
54
- description:
55
- "Toggles structural read-only data presentation explicitly blocking standard component bindings.",
56
- },
57
- },
58
- };
59
-
60
- export default meta;
61
-
62
- type Story = StoryObj<typeof DatePicker>;
63
-
64
- export const Default: Story = {
65
- args: {
66
- disabled: false,
67
- label: "Project Deadline",
68
- assistiveText: "Specify the absolute cutoff for code submission.",
69
- },
70
- };
71
-
72
- export const FormsSideBySide: Story = {
73
- args: {
74
- label: "Incident Start Date",
75
- assistiveText: "When did the incident originally occur?",
76
- formLayout: "side-by-side",
77
- },
78
- };
79
-
80
- export const WithLeadingIcon: Story = {
81
- args: {
82
- label: "Launch Date",
83
- leftSection: (
84
- <svg
85
- width="24"
86
- height="24"
87
- viewBox="0 0 24 24"
88
- fill="none"
89
- stroke="currentColor"
90
- strokeWidth="2"
91
- strokeLinecap="round"
92
- strokeLinejoin="round"
93
- >
94
- <rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
95
- <line x1="16" y1="2" x2="16" y2="6"></line>
96
- <line x1="8" y1="2" x2="8" y2="6"></line>
97
- <line x1="3" y1="10" x2="21" y2="10"></line>
98
- </svg>
99
- ),
100
- },
101
- };
102
-
103
- export const Disabled: Story = {
104
- args: {
105
- label: "Disabled Date Range",
106
- disabled: true,
107
- },
108
- };
109
-
110
- export const ErrorState: Story = {
111
- args: {
112
- label: "Execution Date",
113
- error: "The chosen date conflicts with an existing deployment freeze.",
114
- required: true,
115
- },
116
- };
117
-
118
- export const OpenedCalendar: Story = {
119
- args: {
120
- label: "Meeting Date",
121
- assistiveText: "Calendar rendered open by default for styling review.",
122
- // `popoverProps.opened` overrides Mantine's own internal disclosure state (see
123
- // PickerInputBase's `opened: dropdownOpened, ...popoverProps` spread order), so the
124
- // dropdown stays open with no click interaction needed — same convention as Menu's
125
- // `opened: true` stories.
126
- popoverProps: { opened: true },
127
- // Fixed (not computed) so the selected-day fill is visible on load, alongside the
128
- // today marker, for styling review. Local-component constructor, not an ISO date
129
- // string — `new Date("2026-08-26")` parses as UTC midnight, which renders as the
130
- // 25th in any timezone behind UTC.
131
- defaultValue: new Date(2026, 7, 26),
132
- },
133
- parameters: {
134
- docs: {
135
- description: {
136
- story:
137
- "The calendar dropdown renders open by default so its styling can be reviewed without a click interaction.",
138
- },
139
- },
140
- },
141
- };
142
-
143
- export const StaticReadOnly: Story = {
144
- args: {
145
- label: "Static ReadOnly Review",
146
- value: new Date("2026-05-21"),
147
- readOnly: true,
148
- },
149
- };
150
-
151
- export const EditableReadOnly: Story = {
152
- args: {
153
- label: "Editable ReadOnly Review",
154
- defaultValue: new Date("2026-06-01"),
155
- readOnly: true,
156
- labelWithEditIcon: true,
157
- },
158
- };
@@ -1,252 +0,0 @@
1
- import React from "react";
2
- import type { Meta, StoryObj } from "@storybook/react";
3
- import { Dropdown } from "./Dropdown";
4
- import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
5
- import { renderRichOption } from "../../utils/renderRichOption";
6
- import styles from "./Dropdown.module.css";
7
-
8
- type DropdownStoryProps = React.ComponentProps<typeof Dropdown>;
9
-
10
- const meta: Meta<DropdownStoryProps> = {
11
- title: "UI-Kit/Dropdown",
12
- component: Dropdown,
13
- tags: ["autodocs"],
14
- parameters: {
15
- docs: {
16
- description: {
17
- component:
18
- "Dropdown provides a selectable list of options, mapping natively over Mantine's Select component encapsulated within the standardized FormControlWrapper.",
19
- },
20
- },
21
- },
22
- args: {
23
- label: "Country Selection",
24
- assistiveText: "Select your country of origin.",
25
- placeholder: "Pick value",
26
- data: ["United States", "Canada", "Mexico", "United Kingdom", "France"],
27
- disabled: false,
28
- required: false,
29
- readOnly: false,
30
- clearable: false,
31
- },
32
- argTypes: {
33
- disabled: {
34
- control: "boolean",
35
- },
36
- ...formControlArgTypes,
37
- readOnly: {
38
- control: "boolean",
39
- },
40
- clearable: {
41
- control: "boolean",
42
- },
43
- wrapItemText: {
44
- control: "boolean",
45
- description:
46
- "Wraps option label/supportingText onto additional lines instead of truncating with an ellipsis.",
47
- },
48
- containerWidth: {
49
- table: { disable: true },
50
- },
51
- },
52
- };
53
-
54
- export default meta;
55
-
56
- type Story = StoryObj<DropdownStoryProps>;
57
-
58
- export const Default: Story = {
59
- args: {},
60
- };
61
-
62
- export const Clearable: Story = {
63
- args: {
64
- label: "Clearable Options",
65
- clearable: true,
66
- },
67
- };
68
-
69
- export const WithLeadingIcon: Story = {
70
- args: {
71
- label: "Destination",
72
- leftSection: (
73
- <svg
74
- width="24"
75
- height="24"
76
- viewBox="0 0 24 24"
77
- fill="none"
78
- stroke="currentColor"
79
- strokeWidth="2"
80
- strokeLinecap="round"
81
- strokeLinejoin="round"
82
- >
83
- <path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path>
84
- <circle cx="12" cy="10" r="3"></circle>
85
- </svg>
86
- ),
87
- },
88
- };
89
-
90
- const UserIcon = (
91
- <svg
92
- width="16"
93
- height="16"
94
- viewBox="0 0 24 24"
95
- fill="none"
96
- stroke="currentColor"
97
- strokeWidth="2"
98
- strokeLinecap="round"
99
- strokeLinejoin="round"
100
- >
101
- <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
102
- <circle cx="12" cy="7" r="4"></circle>
103
- </svg>
104
- );
105
-
106
- export const WithRichOptions: Story = {
107
- args: {
108
- label: "Assignee",
109
- placeholder: "Pick a team member",
110
- assistiveText:
111
- "Each option can show a leading icon and supporting text — see MANTINE_ADAPTER_RICH_OPTION_DATA.md.",
112
- data: [
113
- {
114
- value: "jdoe",
115
- label: "Jane Doe",
116
- leadingIcon: UserIcon,
117
- supportingText: "jane.doe@example.com",
118
- },
119
- {
120
- value: "asmith",
121
- label: "Alex Smith",
122
- leadingIcon: UserIcon,
123
- supportingText: "alex.smith@example.com",
124
- },
125
- { value: "unassigned", label: "Unassigned" },
126
- ],
127
- },
128
- };
129
-
130
- export const WithRichOptionsWrapped: Story = {
131
- args: {
132
- label: "Assignee",
133
- placeholder: "Pick a team member",
134
- wrapItemText: true,
135
- data: [
136
- {
137
- value: "jdoe",
138
- label: "Jane Doe, Senior Staff Engineer, Platform Infrastructure",
139
- leadingIcon: UserIcon,
140
- supportingText:
141
- "jane.doe@example.com — Platform Infrastructure team, on-call rotation lead",
142
- },
143
- { value: "unassigned", label: "Unassigned" },
144
- ],
145
- assistiveText:
146
- "wrapItemText=true — long label/supportingText wrap instead of truncating.",
147
- },
148
- };
149
-
150
- const optionRowPreviewClassNames = {
151
- optionContent: styles.optionContent,
152
- optionIcon: styles.optionIcon,
153
- optionText: styles.optionText,
154
- optionTextWrap: styles.optionTextWrap,
155
- optionSupportingText: styles.optionSupportingText,
156
- };
157
-
158
- const OPTION_ROW_PREVIEW_ITEMS = [
159
- {
160
- value: "icon-and-supporting",
161
- label: "Jane Doe",
162
- leadingIcon: UserIcon,
163
- supportingText: "jane.doe@example.com",
164
- },
165
- {
166
- value: "no-icon",
167
- label: "Alex Smith",
168
- supportingText:
169
- "No leadingIcon — label/supportingText shift left, no reserved icon space",
170
- },
171
- {
172
- value: "no-supporting-text",
173
- label: "Taylor Rivera",
174
- leadingIcon: UserIcon,
175
- },
176
- {
177
- value: "plain",
178
- label: "Plain option — no leadingIcon, no supportingText",
179
- },
180
- {
181
- value: "long-text",
182
- label:
183
- "A very long option label that, with wrapItemText, wraps onto a second line instead of overflowing the fixed-width dropdown — otherwise it truncates with an ellipsis",
184
- leadingIcon: UserIcon,
185
- supportingText:
186
- "A similarly long supporting text string, to confirm the same wrap-or-truncate behavior applies to it too",
187
- },
188
- ];
189
-
190
- // Renders the option row content directly — outside the floating/portal menu — inside a
191
- // container sized to Dropdown's own max-width token. Spacing between rows, icon/supportingText
192
- // presence-or-absence alignment, and long-text wrapping/truncation are all much easier to inspect
193
- // this way than by opening the real (portal-rendered) combobox dropdown. See
194
- // MANTINE_ADAPTER_RICH_OPTION_DATA.md.
195
- const renderOptionRowPreview = (wrapItemText: boolean) => (
196
- <div
197
- className={styles.dropdown}
198
- style={{
199
- width:
200
- "var(--recursica_ui-kit_components_dropdown_variants_layouts_stacked_properties_max-width)",
201
- }}
202
- >
203
- {OPTION_ROW_PREVIEW_ITEMS.map((item) => (
204
- <div key={item.value} className={styles.option}>
205
- {renderRichOption(
206
- { option: item },
207
- optionRowPreviewClassNames,
208
- wrapItemText,
209
- )}
210
- </div>
211
- ))}
212
- </div>
213
- );
214
-
215
- // Default: `wrapItemText` is false — label/supportingText truncate to a single line with an
216
- // ellipsis instead of wrapping.
217
- export const RichOptionRowPreview: Story = {
218
- parameters: {
219
- controls: { disable: true },
220
- },
221
- render: () => renderOptionRowPreview(false),
222
- };
223
-
224
- // `wrapItemText: true` — label/supportingText wrap onto additional lines instead of truncating.
225
- export const RichOptionRowPreviewWrapped: Story = {
226
- parameters: {
227
- controls: { disable: true },
228
- },
229
- render: () => renderOptionRowPreview(true),
230
- };
231
-
232
- export const StaticError: Story = {
233
- args: {
234
- error: "You must choose a valid destination.",
235
- value: "Invalid Island",
236
- },
237
- };
238
-
239
- export const StaticDisabled: Story = {
240
- args: {
241
- disabled: true,
242
- value: "United States",
243
- },
244
- };
245
-
246
- export const StaticReadOnly: Story = {
247
- args: {
248
- label: "Read Only View",
249
- readOnly: true,
250
- value: "Canada",
251
- },
252
- };