@recursica/mantine-adapter 0.6.0 → 0.7.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.
Files changed (140) hide show
  1. package/.storybook/commonArgTypes.ts +148 -0
  2. package/CHANGELOG.md +69 -0
  3. package/dist/mantine-adapter.cjs +1 -1
  4. package/dist/mantine-adapter.cjs.map +1 -1
  5. package/dist/mantine-adapter.css +1 -1
  6. package/dist/mantine-adapter.js +660 -586
  7. package/dist/mantine-adapter.js.map +1 -1
  8. package/dist/src/components/Checkbox/CheckboxGroup.d.ts +1 -1
  9. package/dist/src/components/Chip/Chip.d.ts +14 -2
  10. package/package.json +5 -2
  11. package/src/OverStyling.stories.tsx +174 -0
  12. package/src/Version.stories.tsx +56 -0
  13. package/src/components/Accordion/ACCORDION_IMPLEMENTATION_NOTES.md +48 -0
  14. package/src/components/Accordion/Accordion.module.css +261 -0
  15. package/src/components/Accordion/Accordion.stories.tsx +145 -0
  16. package/src/components/Accordion/Accordion.tsx +200 -0
  17. package/src/components/Accordion/index.ts +1 -0
  18. package/src/components/AssistiveElement/AssistiveElement.module.css +111 -0
  19. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +73 -0
  20. package/src/components/AssistiveElement/AssistiveElement.tsx +91 -0
  21. package/src/components/Avatar/AVATAR_IMPLEMENTATION_NOTES.md +24 -0
  22. package/src/components/Avatar/Avatar.module.css +340 -0
  23. package/src/components/Avatar/Avatar.stories.tsx +102 -0
  24. package/src/components/Avatar/Avatar.tsx +100 -0
  25. package/src/components/Avatar/index.ts +1 -0
  26. package/src/components/Badge/BADGE_IMPLEMENTATION_NOTES.md +18 -0
  27. package/src/components/Badge/Badge.module.css +124 -0
  28. package/src/components/Badge/Badge.stories.tsx +77 -0
  29. package/src/components/Badge/Badge.tsx +66 -0
  30. package/src/components/Breadcrumb/BREADCRUMB_IMPLEMENTATION_NOTES.md +14 -0
  31. package/src/components/Breadcrumb/Breadcrumb.module.css +26 -0
  32. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +77 -0
  33. package/src/components/Breadcrumb/Breadcrumb.tsx +64 -0
  34. package/src/components/Button/Button.module.css +275 -0
  35. package/src/components/Button/Button.stories.tsx +105 -0
  36. package/src/components/Button/Button.tsx +122 -0
  37. package/src/components/Button/IMPLEMENTATION_NOTES.md +45 -0
  38. package/src/components/Button/index.ts +1 -0
  39. package/src/components/Card/CARD_IMPLEMENTATION_NOTES.md +10 -0
  40. package/src/components/Card/Card.module.css +60 -0
  41. package/src/components/Card/Card.stories.tsx +141 -0
  42. package/src/components/Card/Card.tsx +176 -0
  43. package/src/components/Checkbox/CHECKBOX_IMPLEMENTATION_NOTES.md +25 -0
  44. package/src/components/Checkbox/Checkbox.module.css +204 -0
  45. package/src/components/Checkbox/Checkbox.stories.tsx +73 -0
  46. package/src/components/Checkbox/Checkbox.tsx +111 -0
  47. package/src/components/Checkbox/CheckboxGroup.stories.tsx +138 -0
  48. package/src/components/Checkbox/CheckboxGroup.tsx +140 -0
  49. package/src/components/Chip/CHIP_IMPLEMENTATION_NOTES.md +35 -0
  50. package/src/components/Chip/Chip.module.css +218 -0
  51. package/src/components/Chip/Chip.stories.tsx +115 -0
  52. package/src/components/Chip/Chip.tsx +143 -0
  53. package/src/components/DatePicker/DatePicker.stories.tsx +22 -0
  54. package/src/components/DatePicker/DatePicker.tsx +7 -0
  55. package/src/components/Dropdown/Dropdown.stories.tsx +22 -0
  56. package/src/components/Dropdown/Dropdown.tsx +7 -0
  57. package/src/components/FileInput/FileInput.stories.tsx +22 -0
  58. package/src/components/FileInput/FileInput.tsx +7 -0
  59. package/src/components/FileUpload/FileUpload.stories.tsx +22 -0
  60. package/src/components/FileUpload/FileUpload.tsx +7 -0
  61. package/src/components/FormControlWrapper/FORMCONTROLWRAPPER_IMPLEMENTATION_NOTES.md +32 -0
  62. package/src/components/FormControlWrapper/FormControlWrapper.module.css +46 -0
  63. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +116 -0
  64. package/src/components/FormControlWrapper/FormControlWrapper.tsx +170 -0
  65. package/src/components/HoverCard/HoverCard.stories.tsx +17 -0
  66. package/src/components/HoverCard/HoverCard.tsx +7 -0
  67. package/src/components/Label/LABEL_IMPLEMENTATION_NOTES.md +48 -0
  68. package/src/components/Label/Label.module.css +177 -0
  69. package/src/components/Label/Label.stories.tsx +123 -0
  70. package/src/components/Label/Label.tsx +132 -0
  71. package/src/components/Label/index.ts +1 -0
  72. package/src/components/Link/Link.stories.tsx +17 -0
  73. package/src/components/Link/Link.tsx +7 -0
  74. package/src/components/Loader/Loader.stories.tsx +17 -0
  75. package/src/components/Loader/Loader.tsx +7 -0
  76. package/src/components/Menu/Menu.stories.tsx +17 -0
  77. package/src/components/Menu/Menu.tsx +7 -0
  78. package/src/components/Modal/Modal.stories.tsx +17 -0
  79. package/src/components/Modal/Modal.tsx +7 -0
  80. package/src/components/NumberInput/NumberInput.stories.tsx +22 -0
  81. package/src/components/NumberInput/NumberInput.tsx +7 -0
  82. package/src/components/Pagination/Pagination.stories.tsx +17 -0
  83. package/src/components/Pagination/Pagination.tsx +7 -0
  84. package/src/components/Panel/Panel.stories.tsx +17 -0
  85. package/src/components/Panel/Panel.tsx +7 -0
  86. package/src/components/Popover/Popover.stories.tsx +17 -0
  87. package/src/components/Popover/Popover.tsx +7 -0
  88. package/src/components/Radio/Radio.stories.tsx +22 -0
  89. package/src/components/Radio/Radio.tsx +7 -0
  90. package/src/components/ReadOnlyField/READ_ONLY_FIELD_IMPLEMENTATION_NOTES.md +15 -0
  91. package/src/components/ReadOnlyField/ReadOnlyField.module.css +49 -0
  92. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +120 -0
  93. package/src/components/ReadOnlyField/ReadOnlyField.tsx +75 -0
  94. package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +46 -0
  95. package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +85 -0
  96. package/src/components/ReadOnlyField/index.ts +3 -0
  97. package/src/components/Search/Search.stories.tsx +17 -0
  98. package/src/components/Search/Search.tsx +7 -0
  99. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +22 -0
  100. package/src/components/SegmentedControl/SegmentedControl.tsx +7 -0
  101. package/src/components/Slider/Slider.stories.tsx +22 -0
  102. package/src/components/Slider/Slider.tsx +7 -0
  103. package/src/components/Stepper/Stepper.stories.tsx +17 -0
  104. package/src/components/Stepper/Stepper.tsx +7 -0
  105. package/src/components/Switch/Switch.stories.tsx +22 -0
  106. package/src/components/Switch/Switch.tsx +7 -0
  107. package/src/components/Table/Table.stories.tsx +17 -0
  108. package/src/components/Table/Table.tsx +7 -0
  109. package/src/components/Tabs/Tabs.stories.tsx +17 -0
  110. package/src/components/Tabs/Tabs.tsx +7 -0
  111. package/src/components/Text/Text.stories.tsx +88 -0
  112. package/src/components/Text/Text.tsx +54 -0
  113. package/src/components/TextArea/TextArea.stories.tsx +22 -0
  114. package/src/components/TextArea/TextArea.tsx +7 -0
  115. package/src/components/TextField/TEXTFIELD_IMPLEMENTATION_NOTES.md +19 -0
  116. package/src/components/TextField/TextField.module.css +225 -0
  117. package/src/components/TextField/TextField.stories.tsx +162 -0
  118. package/src/components/TextField/TextField.tsx +138 -0
  119. package/src/components/TimePicker/TimePicker.stories.tsx +22 -0
  120. package/src/components/TimePicker/TimePicker.tsx +7 -0
  121. package/src/components/Timeline/Timeline.stories.tsx +17 -0
  122. package/src/components/Timeline/Timeline.tsx +7 -0
  123. package/src/components/Title/Title.stories.tsx +63 -0
  124. package/src/components/Title/Title.tsx +45 -0
  125. package/src/components/Toast/Toast.stories.tsx +17 -0
  126. package/src/components/Toast/Toast.tsx +7 -0
  127. package/src/components/Tooltip/Tooltip.stories.tsx +17 -0
  128. package/src/components/Tooltip/Tooltip.tsx +7 -0
  129. package/src/components/TransferList/TransferList.stories.tsx +17 -0
  130. package/src/components/TransferList/TransferList.tsx +7 -0
  131. package/src/components/index.ts +39 -0
  132. package/src/env.d.ts +7 -0
  133. package/src/index.ts +3 -0
  134. package/src/types/index.ts +9 -0
  135. package/src/types/mantine.d.ts +7 -0
  136. package/src/types/scss-modules.d.ts +9 -0
  137. package/src/utils/ColorSchemeWrapper.tsx +27 -0
  138. package/src/utils/copyToClipboard.ts +36 -0
  139. package/src/utils/filterStylingProps.ts +139 -0
  140. package/src/utils/index.ts +1 -0
@@ -0,0 +1,46 @@
1
+ /* FormControlWrapper.module.css */
2
+
3
+ .root {
4
+ display: flex;
5
+ margin: 0; /* Hardcoded structural reset */
6
+ padding: 0; /* Hardcoded structural reset */
7
+ max-width: var(--form-control-max-width, 100%);
8
+ min-width: var(--form-control-min-width, auto);
9
+ }
10
+
11
+ /* Base Structural Stacked Layout */
12
+ .root[data-form-layout="stacked"] {
13
+ flex-direction: column;
14
+ }
15
+
16
+ /* Base Structural Grid Layout */
17
+ .root[data-form-layout="side-by-side"] {
18
+ flex-direction: row;
19
+ align-items: flex-start;
20
+ flex-wrap: wrap; /* Allows collapse if screen is too thin, though standard flex width should hold */
21
+ }
22
+
23
+ /* Left structural justification defaults (push input mapping) */
24
+ .root[data-form-alignment="left"] {
25
+ /* Inherited naturally via row/column flows */
26
+ }
27
+
28
+ /* Right structural justification defaults */
29
+ .root[data-form-alignment="right"] {
30
+ /* To justify entire form control components to the right */
31
+ justify-content: flex-end;
32
+ }
33
+
34
+ .labelSection {
35
+ /* Width dimensions are strictly governed natively inside Label.module.css's sizing variant mapping */
36
+ flex-shrink: 0;
37
+ display: flex;
38
+ flex-direction: column;
39
+ }
40
+
41
+ .inputSection {
42
+ display: flex; /* Groups internal field alongside subsequent errors/descriptions */
43
+ flex-direction: column;
44
+ flex: 1; /* Consumes the remaining x-axis in grid columns natively */
45
+ min-width: 0; /* Break boundary preventing internal flex explosion */
46
+ }
@@ -0,0 +1,116 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import {
4
+ FormControlWrapper,
5
+ type FormControlWrapperProps,
6
+ } from "./FormControlWrapper";
7
+ import { TextField } from "../TextField/TextField";
8
+ import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
9
+
10
+ type WrapperStoryProps = FormControlWrapperProps;
11
+
12
+ const meta: Meta<WrapperStoryProps> = {
13
+ title: "UI-Kit/FormControlWrapper",
14
+ component: FormControlWrapper,
15
+ tags: ["autodocs"],
16
+ parameters: {
17
+ docs: {
18
+ description: {
19
+ component:
20
+ "The `FormControlWrapper` is the ultimate structural replacement for Mantine's built-in `Input.Wrapper`. By abandoning Mantine's opinionated wrappers entirely, we centralize all label tracking, error rendering, ARIA generation, and grid layouts natively inside this single component.\n\n### Usage with Naked Primitives\nThis component wraps 'naked' elements like `<Input>` directly. The demonstration stories below utilize `<TextField>` as a native display vehicle, since `<TextField>` natively pipes all its properties structurally back into this wrapper.",
21
+ },
22
+ },
23
+ },
24
+ argTypes: {
25
+ ...formControlArgTypes,
26
+ error: {
27
+ control: "text",
28
+ description:
29
+ "Error string driving native assistive component and validation markers.",
30
+ },
31
+ assistiveText: {
32
+ control: "text",
33
+ description:
34
+ "Helper instructions safely dynamically anchored below the input box.",
35
+ },
36
+ assistiveWithIcon: {
37
+ control: "boolean",
38
+ },
39
+ required: {
40
+ control: "boolean",
41
+ },
42
+ },
43
+ };
44
+
45
+ export default meta;
46
+
47
+ type Story = StoryObj<WrapperStoryProps>;
48
+
49
+ const renderWithTextField = (args: WrapperStoryProps) => (
50
+ <TextField placeholder="Form Control primitive mapped..." {...args} />
51
+ );
52
+
53
+ export const Default: Story = {
54
+ args: {
55
+ label: "Account Username",
56
+ formLayout: "stacked",
57
+ assistiveText: "Validation occurs immediately natively.",
58
+ },
59
+ render: renderWithTextField,
60
+ };
61
+
62
+ export const VisualErrorState: Story = {
63
+ args: {
64
+ label: "Encryption Protocol",
65
+ formLayout: "stacked",
66
+ error: "Strict validation limits reached. Handshake rejected securely.",
67
+ },
68
+ render: renderWithTextField,
69
+ };
70
+
71
+ export const RequiredArchitecture: Story = {
72
+ args: {
73
+ label: "Root Password",
74
+ formLayout: "side-by-side",
75
+ required: true,
76
+ assistiveText: "Bypass string structure required to initiate protocol.",
77
+ },
78
+ render: renderWithTextField,
79
+ };
80
+
81
+ export const WithoutAssistiveIcons: Story = {
82
+ args: {
83
+ label: "Server Domain",
84
+ assistiveText:
85
+ "A standard text boundary without default native icon parameters bounding.",
86
+ assistiveWithIcon: false,
87
+ },
88
+ render: renderWithTextField,
89
+ };
90
+
91
+ export const NativeChildrenDirectly: Story = {
92
+ description:
93
+ "Bypassing the TextField map to show exactly how native `<input>` hooks execute inside the raw wrapper natively perfectly.",
94
+ args: {
95
+ label: "Raw HTML Checkbox",
96
+ formLayout: "side-by-side",
97
+ assistiveText: "This wraps a raw HTML input tag mapping correctly.",
98
+ },
99
+ render: (args) => (
100
+ <div
101
+ style={{
102
+ display: "flex",
103
+ gap: "10px",
104
+ alignItems: "center",
105
+ }}
106
+ >
107
+ {/* We can cleanly wrap even un-styled HTML primitives! */}
108
+ <FormControlWrapper {...args}>
109
+ <input
110
+ type="checkbox"
111
+ style={{ margin: 0, width: "16px", height: "16px" }}
112
+ />
113
+ </FormControlWrapper>
114
+ </div>
115
+ ),
116
+ };
@@ -0,0 +1,170 @@
1
+ import React, { forwardRef, useId } from "react";
2
+ import { type InputWrapperProps, Box } from "@mantine/core";
3
+ import {
4
+ filterStylingProps,
5
+ type RecursicaOverStyled,
6
+ } from "../../utils/filterStylingProps";
7
+ import { Label, type RecursicaLabelProps } from "../Label/Label";
8
+ import { AssistiveElement } from "../AssistiveElement/AssistiveElement";
9
+ import styles from "./FormControlWrapper.module.css";
10
+
11
+ export interface RecursicaFormControlWrapperProps extends RecursicaLabelProps {
12
+ /** Securely replaces standard Mantine descriptions safely providing standard Assistive properties. */
13
+ assistiveText?: React.ReactNode;
14
+ /** Explicit toggle to suppress the Info icon rendering natively alongside the assistiveText. Defaults to true. */
15
+ assistiveWithIcon?: boolean;
16
+ /** Custom action area to render alongside the label instead of the default edit icon. */
17
+ labelActionArea?: React.ReactNode;
18
+ /** Pass the native maximum width design variable dynamically bounding the specific wrapper width exclusively. */
19
+ controlMaxWidth: string | undefined;
20
+ /** Pass the native minimum width design variable dynamically bounding the specific wrapper width exclusively. */
21
+ controlMinWidth: string | undefined;
22
+ }
23
+
24
+ export type FormControlWrapperProps = RecursicaOverStyled<
25
+ Omit<InputWrapperProps, "labelProps" | "inputWrapperOrder"> &
26
+ RecursicaFormControlWrapperProps
27
+ >;
28
+
29
+ export const FormControlWrapper = forwardRef<
30
+ HTMLDivElement,
31
+ FormControlWrapperProps
32
+ >(function FormControlWrapper(
33
+ {
34
+ formLayout,
35
+ labelSize,
36
+ labelAlignment,
37
+ labelOptionalText,
38
+ labelWithEditIcon,
39
+ labelActionArea,
40
+ onLabelEditClick,
41
+
42
+ label,
43
+ description,
44
+ assistiveText,
45
+ assistiveWithIcon = true,
46
+ controlMaxWidth,
47
+ controlMinWidth,
48
+ error,
49
+ required,
50
+ withAsterisk,
51
+ id: userProvidedId,
52
+ children,
53
+ className,
54
+ overStyled = false,
55
+ labelElement, // Extracted safely preventing bleeding into HTML domains
56
+ ...rest
57
+ },
58
+ ref,
59
+ ) {
60
+ // Generate a reliable ID to map the Label's HTML context down to the component array natively.
61
+ const generatedId = useId();
62
+ const id = userProvidedId || `recursica-fc-${generatedId}`;
63
+
64
+ // Evaluate explicit assistive fallbacks ensuring assistiveText correctly prioritizes natively over underlying Mantine configurations!
65
+ const resolvedAssistive = assistiveText || description;
66
+ const assistiveId = resolvedAssistive ? `${id}-assistive` : undefined;
67
+ const errorId = error ? `${id}-error` : undefined;
68
+
69
+ const sanitizedProps = filterStylingProps(rest, overStyled);
70
+ const restRecord = sanitizedProps as Record<string, unknown>;
71
+
72
+ const classNameProp =
73
+ className || (restRecord.className as string | undefined);
74
+ const rootClass = styles.root;
75
+ const finalClass = classNameProp
76
+ ? `${rootClass} ${classNameProp}`
77
+ : rootClass;
78
+
79
+ // Clone ARIA identifiers directly back down into the nested children wrapper so screen-readers natively hook the external strings
80
+ const content = React.isValidElement(children)
81
+ ? React.cloneElement(
82
+ children as React.ReactElement<Record<string, unknown>>,
83
+ {
84
+ ...(resolvedAssistive &&
85
+ !(children.props as Record<string, unknown>)["aria-describedby"]
86
+ ? { "aria-describedby": assistiveId }
87
+ : {}),
88
+ ...(error &&
89
+ !(children.props as Record<string, unknown>)["aria-errormessage"]
90
+ ? { "aria-errormessage": errorId }
91
+ : {}),
92
+ },
93
+ )
94
+ : children;
95
+
96
+ return (
97
+ <Box
98
+ ref={ref}
99
+ className={finalClass}
100
+ data-form-layout={formLayout || "stacked"}
101
+ data-form-alignment={labelAlignment || "left"}
102
+ style={
103
+ {
104
+ ...((restRecord.style as React.CSSProperties) || {}),
105
+ ...(controlMaxWidth
106
+ ? { "--form-control-max-width": controlMaxWidth }
107
+ : {}),
108
+ ...(controlMinWidth
109
+ ? { "--form-control-min-width": controlMinWidth }
110
+ : {}),
111
+ } as React.CSSProperties
112
+ }
113
+ {...restRecord}
114
+ >
115
+ {/*
116
+ Section 1: The Native Custom Label
117
+ Bypasses Mantine's built-in Input.Wrapper Label entirely in favor of explicit Recursica formatting.
118
+ */}
119
+ {label && (
120
+ <div className={styles.labelSection}>
121
+ <Label
122
+ id={id} // Directly binds ARIA references down
123
+ formLayout={formLayout}
124
+ labelSize={labelSize}
125
+ labelAlignment={labelAlignment}
126
+ labelOptionalText={labelOptionalText}
127
+ labelWithEditIcon={labelWithEditIcon}
128
+ labelActionArea={labelActionArea}
129
+ onLabelEditClick={onLabelEditClick}
130
+ required={withAsterisk ?? required}
131
+ // Manually propagate relevant structural logic if underlying groups dictate Label to act as generic wrapper
132
+ {...(labelElement === "div" ? { as: "div" } : {})}
133
+ >
134
+ {label}
135
+ </Label>
136
+ </div>
137
+ )}
138
+
139
+ {/*
140
+ Section 2: The Core Input Wrapper & Controls
141
+ Nakedly inject the actual field elements alongside natively bridged Assistive components mapped dynamically.
142
+ */}
143
+ <div className={styles.inputSection}>
144
+ {content}
145
+
146
+ {error && (
147
+ <AssistiveElement
148
+ id={errorId}
149
+ assistiveVariant="error"
150
+ assistiveWithIcon={assistiveWithIcon}
151
+ >
152
+ {error}
153
+ </AssistiveElement>
154
+ )}
155
+
156
+ {!error && resolvedAssistive && (
157
+ <AssistiveElement
158
+ id={assistiveId}
159
+ assistiveVariant="help"
160
+ assistiveWithIcon={assistiveWithIcon}
161
+ >
162
+ {resolvedAssistive}
163
+ </AssistiveElement>
164
+ )}
165
+ </div>
166
+ </Box>
167
+ );
168
+ });
169
+
170
+ FormControlWrapper.displayName = "FormControlWrapper";
@@ -0,0 +1,17 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { HoverCard } from "./HoverCard";
3
+ import { ComingSoon } from "@recursica/storybook-template";
4
+
5
+ const meta: Meta<typeof HoverCard> = {
6
+ title: "UI-Kit/🚧 HoverCard",
7
+ component: HoverCard,
8
+ tags: ["autodocs"],
9
+ };
10
+
11
+ export default meta;
12
+
13
+ type Story = StoryObj<typeof HoverCard>;
14
+
15
+ export const Default: Story = {
16
+ render: () => <ComingSoon componentName="HoverCard" />,
17
+ };
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+
3
+ export type HoverCardProps = React.HTMLAttributes<HTMLDivElement>;
4
+
5
+ export const HoverCard: React.FC<HoverCardProps> = (props) => {
6
+ return <div {...props}>HoverCard</div>;
7
+ };
@@ -0,0 +1,48 @@
1
+ # Label Implementation Notes
2
+
3
+ ## Architecture Overview
4
+
5
+ The `Label` component is fundamentally built as a strict, localized wrapper around Mantine's native `Input.Label`. The core goal is to preserve context, ref-forwarding, and native accessibility links, while completely overriding visual behaviors via Recursica design variables in scoped CSS.
6
+
7
+ ## Key Design Decisions
8
+
9
+ ### **Layout Architecture**
10
+
11
+ - Because Recursica dictates complex alignments between primary label text, asterisks, edit icons, and optional strings, Mantine's rigid form label flow could not be used out-of-the-box.
12
+ - Implemented `display: flex; flex-wrap: wrap;` directly on `.root`.
13
+ - Injected strict integer-based flex `order` properties (e.g. `order: 1` for text, `order: 2` for `required`, `order: 5` for `optionalText`) to physically decouple DOM rendering from markup flow.
14
+ - Because `optionalText` often acts as secondary contextual detail, it forces `flex-basis: 100%`, securely wrapping to a secondary line underneath the primary label properties and transforming the horizontal gap spacing seamlessly into a `margin-top` vector.
15
+
16
+ ### **Optional Text & Required Mutually Exclusive Parsing**
17
+
18
+ - By design standards, a component cannot logically be both "Required" and mapped as "Optional".
19
+ - To bulletproof implementations natively, the adapter forcibly suppresses rendering of the `resolvedOptionalText` strings if the parent wrapper invokes `required={true}`.
20
+ - `optionalText` can operate as dynamic data or specifically as a boolean `true`, which forces the adapter to natively render the formal `(Optional)` string map.
21
+
22
+ ### **The "Edit Icon" Replacer Logic**
23
+
24
+ - Passing `withEditIcon={true}` evaluates it as fundamentally mutually exclusive to the standard required indicator asterisk.
25
+ - `required={required && !withEditIcon}` is passed to the underlying Mantine structure so the native `*` is entirely suppressed.
26
+ - Added localized styling via `data-replaces-asterisk={required ? "true" : undefined}` onto the `.editIconWrapper` element. If an editable instance is simultaneously designated as required, the edit icon functionally assumes the indicator role natively, overriding its default icon metrics explicitly to match `--recursica_ui-kit_components_label_properties_colors_asterisk`.
27
+
28
+ ### **Bypassing `Input.Wrapper` Integrations**
29
+
30
+ - By decoupling from Mantine's standard `Input.Wrapper`, the `Label` component is exclusively mapped manually through `FormControlWrapper`. This grants us exact visual sync regarding where the label renders based on `formLayout="stacked"` or `formLayout="side-by-side"`, without fighting internal Mantine positional hooks that assume vertical stacking by default.
31
+
32
+ ### **Label Size Container Constraints**
33
+
34
+ - The `labelSize` parameter (mapping values like `"small"`) internally **does not scale typographic font metrics**. Instead, it dynamically defines the explicit horizontal bounding width limit of the block container itself.
35
+ - **Architectural Rule:** `labelSize` modifications are strictly designed to execute exclusively when `formLayout="side-by-side"` is active. It acts as an optical grid threshold ensuring left-aligned string wrappers constrain correctly uniformly down a column without bleeding into the physical input arrays alongside them.
36
+
37
+ ## Outstanding Technical Debt / Issues
38
+
39
+ ### **Description Property Omission**
40
+
41
+ - **Issue:** Currently, the adapter `Label` does not natively parse or support a structured `description` node directly attached beneath it.
42
+ - **Context:** Standard forms often attach subtext beneath inputs, but mapping a description purely within the `<Label>` (distinct from an overall form-control description) is omitted structurally until subsequent UI Kit requirements mandate dedicated `description` styles locally on the label component itself.
43
+
44
+ ### **Global Interactive Hover Mappings**
45
+
46
+ - **Issue:** Currently, the `editIconWrapper` lacks a dedicated hover background layer.
47
+ - **Context:** While the global theme abstracts interactive hover environments deeply using layered variable syntax (e.g., `--recursica_brand_layer_1_elements_interactive_hover-color`), Recursica's token generation framework natively fails to expose a universally generic placeholder token (e.g., `--recursica_elements_interactive_hover-color`) which downstream wrappers can map their `<Layer>` injections directly into safely.
48
+ - **Resolution Path:** We are explicitly ignoring the `.editIconWrapper:hover` background color assignment until the raw Figma token exports directly scaffold a generic token placeholder that we can interface cleanly with across arbitrary `<Layer>` contexts, avoiding manually mapping statically hardcoded depths (`layer-0`, `layer-1`).
@@ -0,0 +1,177 @@
1
+ /* HARDCODED VALUES:
2
+ - display: flex helps us leverage flex 'order' to perfectly position Mantine's injected asterisk.
3
+ - align-items: baseline ensures text logic lines up nicely if font sizes differ slightly.
4
+ - margin/padding resets.
5
+ */
6
+
7
+ .root {
8
+ display: flex;
9
+ flex-wrap: wrap;
10
+ align-items: baseline;
11
+ box-sizing: border-box;
12
+ margin: 0;
13
+ color: var(--recursica_ui-kit_components_label_properties_colors_text);
14
+ }
15
+
16
+ .root[data-alignment="left"] {
17
+ justify-content: flex-start;
18
+ text-align: left;
19
+ }
20
+
21
+ .root[data-alignment="right"] {
22
+ justify-content: flex-end;
23
+ text-align: right;
24
+ }
25
+
26
+ .root[data-layout="stacked"] {
27
+ padding-bottom: var(
28
+ --recursica_ui-kit_components_label_variants_layouts_stacked_properties_bottom-padding
29
+ );
30
+ min-height: var(
31
+ --recursica_ui-kit_components_label_variants_layouts_stacked_properties_min-height
32
+ );
33
+ }
34
+
35
+ .root[data-layout="side-by-side"] {
36
+ padding-top: var(
37
+ --recursica_ui-kit_components_label_variants_layouts_side-by-side_properties_vertical-padding
38
+ );
39
+ padding-bottom: var(
40
+ --recursica_ui-kit_components_label_variants_layouts_side-by-side_properties_vertical-padding
41
+ );
42
+ min-height: var(
43
+ --recursica_ui-kit_components_label_variants_layouts_side-by-side_properties_min-height
44
+ );
45
+ /* In side-by-side, the label exists to the left of its input, so we use the gutter gap here. */
46
+ margin-right: var(
47
+ --recursica_ui-kit_components_label_variants_layouts_side-by-side_properties_gutter
48
+ );
49
+ }
50
+
51
+ .root[data-layout="side-by-side"][data-size="default"] {
52
+ width: var(
53
+ --recursica_ui-kit_components_label_variants_layouts_side-by-side_variants_sizes_default_properties_width
54
+ );
55
+ }
56
+
57
+ .root[data-layout="side-by-side"][data-size="small"] {
58
+ width: var(
59
+ --recursica_ui-kit_components_label_variants_layouts_side-by-side_variants_sizes_small_properties_width
60
+ );
61
+ }
62
+
63
+ .labelText {
64
+ order: 1;
65
+ font-family: var(
66
+ --recursica_ui-kit_components_label_properties_label-text_font-family
67
+ );
68
+ font-size: var(
69
+ --recursica_ui-kit_components_label_properties_label-text_font-size
70
+ );
71
+ font-weight: var(
72
+ --recursica_ui-kit_components_label_properties_label-text_font-weight
73
+ );
74
+ letter-spacing: var(
75
+ --recursica_ui-kit_components_label_properties_label-text_letter-spacing
76
+ );
77
+ line-height: var(
78
+ --recursica_ui-kit_components_label_properties_label-text_line-height
79
+ );
80
+ font-style: var(
81
+ --recursica_ui-kit_components_label_properties_label-text_font-style,
82
+ normal
83
+ );
84
+ text-decoration: var(
85
+ --recursica_ui-kit_components_label_properties_label-text_text-decoration,
86
+ none
87
+ );
88
+ text-transform: var(
89
+ --recursica_ui-kit_components_label_properties_label-text_text-transform,
90
+ none
91
+ );
92
+ }
93
+
94
+ .required {
95
+ order: 2;
96
+ margin-left: var(
97
+ --recursica_ui-kit_components_label_properties_required-indicator-gap
98
+ );
99
+ color: var(--recursica_ui-kit_components_label_properties_colors_asterisk);
100
+
101
+ /* Inherit identical typography bounds to prevent flex row line-height stretching */
102
+ font-family: var(
103
+ --recursica_ui-kit_components_label_properties_label-text_font-family
104
+ );
105
+ font-size: var(
106
+ --recursica_ui-kit_components_label_properties_label-text_font-size
107
+ );
108
+ line-height: var(
109
+ --recursica_ui-kit_components_label_properties_label-text_line-height
110
+ );
111
+ }
112
+
113
+ .optionalText {
114
+ order: 5;
115
+ flex-basis: 100%;
116
+ margin-top: var(
117
+ --recursica_ui-kit_components_label_properties_label-optional-text-gap
118
+ );
119
+ margin-left: 0;
120
+ font-family: var(
121
+ --recursica_ui-kit_components_label_properties_optional-text_font-family
122
+ );
123
+ font-size: var(
124
+ --recursica_ui-kit_components_label_properties_optional-text_font-size
125
+ );
126
+ font-weight: var(
127
+ --recursica_ui-kit_components_label_properties_optional-text_font-weight
128
+ );
129
+ letter-spacing: var(
130
+ --recursica_ui-kit_components_label_properties_optional-text_letter-spacing
131
+ );
132
+ line-height: var(
133
+ --recursica_ui-kit_components_label_properties_optional-text_line-height
134
+ );
135
+ font-style: normal;
136
+ text-decoration: var(
137
+ --recursica_ui-kit_components_label_properties_optional-text_text-decoration,
138
+ none
139
+ );
140
+ text-transform: var(
141
+ --recursica_ui-kit_components_label_properties_optional-text_text-transform,
142
+ none
143
+ );
144
+ color: inherit;
145
+ opacity: var(
146
+ --recursica_ui-kit_components_label_properties_colors_optional-text-opacity
147
+ );
148
+ }
149
+
150
+ .actionAreaWrapper {
151
+ order: 4;
152
+ margin-left: var(
153
+ --recursica_ui-kit_components_label_properties_edit-icon-gap
154
+ );
155
+ display: inline-flex;
156
+ align-items: center;
157
+ justify-content: center;
158
+ }
159
+
160
+ .editIconWrapper {
161
+ order: 4;
162
+ margin-left: var(
163
+ --recursica_ui-kit_components_label_properties_edit-icon-gap
164
+ );
165
+ background: none;
166
+ border: none;
167
+ padding: 0;
168
+ cursor: pointer;
169
+ display: inline-flex;
170
+ align-items: center;
171
+ justify-content: center;
172
+ color: inherit;
173
+ }
174
+
175
+ .editIconWrapper[data-replaces-asterisk="true"] {
176
+ color: var(--recursica_ui-kit_components_label_properties_colors_asterisk);
177
+ }