@recursica/mantine-adapter 0.9.3 → 0.10.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 +88 -0
- package/README.md +48 -332
- package/dist/index.d.ts +2 -0
- 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 +1797 -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 +11 -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/FormControlWrapper/FormControlWrapper.d.ts +18 -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 +21 -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 +11 -0
- package/dist/src/components/Radio/RadioGroup.d.ts +9 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +20 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +8 -0
- package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +22 -0
- package/dist/src/components/ReadOnlyField/index.d.ts +3 -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 +11 -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 +47 -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/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 +73 -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 +102 -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 +77 -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 +105 -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 +73 -0
- package/src/components/Checkbox/Checkbox.tsx +102 -0
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +138 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +140 -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 +115 -0
- package/src/components/Container/Container.tsx +89 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +22 -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 +94 -0
- package/src/components/Dropdown/Dropdown.tsx +173 -0
- package/src/components/FileInput/FileInput.stories.tsx +22 -0
- package/src/components/FileInput/FileInput.tsx +7 -0
- package/src/components/FileUpload/FileUpload.stories.tsx +22 -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 +125 -0
- package/src/components/Flex/Flex.tsx +68 -0
- package/src/components/FormControlWrapper/FORMCONTROLWRAPPER_IMPLEMENTATION_NOTES.md +32 -0
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +46 -0
- package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +116 -0
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +170 -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 +117 -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 +177 -0
- package/src/components/Label/Label.stories.tsx +123 -0
- package/src/components/Label/Label.tsx +132 -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 +98 -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 +22 -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 +76 -0
- package/src/components/Radio/Radio.tsx +115 -0
- package/src/components/Radio/RadioGroup.stories.tsx +98 -0
- package/src/components/Radio/RadioGroup.tsx +138 -0
- package/src/components/ReadOnlyField/READ_ONLY_FIELD_IMPLEMENTATION_NOTES.md +15 -0
- package/src/components/ReadOnlyField/ReadOnlyField.module.css +49 -0
- package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +120 -0
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +75 -0
- package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +46 -0
- package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +85 -0
- package/src/components/ReadOnlyField/index.ts +3 -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 +22 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +7 -0
- package/src/components/Slider/Slider.stories.tsx +22 -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 +105 -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 +207 -0
- package/src/components/Switch/Switch.stories.tsx +96 -0
- package/src/components/Switch/Switch.tsx +119 -0
- package/src/components/Switch/SwitchGroup.stories.tsx +112 -0
- package/src/components/Switch/SwitchGroup.tsx +138 -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 +94 -0
- package/src/components/TextArea/TextArea.tsx +151 -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 +138 -0
- package/src/components/TimePicker/TimePicker.stories.tsx +22 -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 +47 -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/copyToClipboard.ts +36 -0
- package/src/utils/filterStylingProps.ts +141 -0
- package/src/utils/index.ts +1 -0
- package/dist/index.js +0 -917
- package/dist/index.js.map +0 -1
- package/dist/main.cjs +0 -924
- package/dist/main.cjs.map +0 -1
- package/dist/main.js +0 -922
- package/dist/main.js.map +0 -1
- package/dist/webworker.js +0 -787
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { Loader } from "./Loader";
|
|
4
|
+
import { Layer } from "@recursica/adapter-common";
|
|
5
|
+
|
|
6
|
+
type LoaderStoryArgs = React.ComponentProps<typeof Loader> & {
|
|
7
|
+
layer?: 0 | 1 | 2 | 3;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const meta: Meta<LoaderStoryArgs> = {
|
|
11
|
+
title: "UI-Kit/Loader",
|
|
12
|
+
component: Loader as React.ComponentType<LoaderStoryArgs>,
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
parameters: {
|
|
15
|
+
docs: {
|
|
16
|
+
description: {
|
|
17
|
+
component:
|
|
18
|
+
"The Loader bridges the Recursica UI-Kit `loader` variables to the generic primitive, rendering deterministic sizes and variants visually mapped strictly from the explicit design boundary tokens.",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
argTypes: {
|
|
23
|
+
variant: {
|
|
24
|
+
control: "select",
|
|
25
|
+
options: ["oval", "bars", "dots"],
|
|
26
|
+
description: "The structural layout variant of the loading indicator",
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
control: "select",
|
|
30
|
+
options: ["sm", "md", "lg", "small", "default", "large"],
|
|
31
|
+
description:
|
|
32
|
+
"Scales the dimensional and thickness layout constrained to the explicit UI variables",
|
|
33
|
+
},
|
|
34
|
+
color: {
|
|
35
|
+
control: "color",
|
|
36
|
+
description:
|
|
37
|
+
"Optional inline dynamic color override spanning the token defaults",
|
|
38
|
+
},
|
|
39
|
+
layer: {
|
|
40
|
+
control: { type: "range", min: 0, max: 3, step: 1 },
|
|
41
|
+
description:
|
|
42
|
+
"Applies a wrapping context to observe rendering logic externally",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default meta;
|
|
48
|
+
|
|
49
|
+
type Story = StoryObj<LoaderStoryArgs>;
|
|
50
|
+
|
|
51
|
+
export const Default: Story = {
|
|
52
|
+
args: {
|
|
53
|
+
variant: "oval",
|
|
54
|
+
size: "default",
|
|
55
|
+
layer: 0,
|
|
56
|
+
},
|
|
57
|
+
render: ({ layer, ...args }) => (
|
|
58
|
+
<Layer layer={layer ?? 0} style={{ padding: "24px" }}>
|
|
59
|
+
<Loader {...args} />
|
|
60
|
+
</Layer>
|
|
61
|
+
),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const StaticOvalDefault: Story = {
|
|
65
|
+
args: {
|
|
66
|
+
variant: "oval",
|
|
67
|
+
size: "default",
|
|
68
|
+
},
|
|
69
|
+
render: (args) => <Loader {...args} />,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const StaticBarsLarge: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
variant: "bars",
|
|
75
|
+
size: "large",
|
|
76
|
+
},
|
|
77
|
+
render: (args) => <Loader {...args} />,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const StaticDotsSmall: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
variant: "dots",
|
|
83
|
+
size: "sm",
|
|
84
|
+
},
|
|
85
|
+
render: (args) => <Loader {...args} />,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const LayerTwoOval: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
variant: "oval",
|
|
91
|
+
size: "default",
|
|
92
|
+
},
|
|
93
|
+
render: (args) => (
|
|
94
|
+
<Layer layer={2} style={{ padding: "24px" }}>
|
|
95
|
+
<Loader {...args} />
|
|
96
|
+
</Layer>
|
|
97
|
+
),
|
|
98
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Loader as MantineLoader,
|
|
4
|
+
type LoaderProps as MantineLoaderProps,
|
|
5
|
+
} from "@mantine/core";
|
|
6
|
+
import {
|
|
7
|
+
filterStylingProps,
|
|
8
|
+
type RecursicaOverStyled,
|
|
9
|
+
type RecursicaSize,
|
|
10
|
+
} from "../../utils/filterStylingProps";
|
|
11
|
+
import styles from "./Loader.module.css";
|
|
12
|
+
|
|
13
|
+
export interface RecursicaLoaderProps {
|
|
14
|
+
/** Map to the component styles defined in variables */
|
|
15
|
+
variant?: "oval" | "bars" | "dots";
|
|
16
|
+
/** Map to Recursica sizes */
|
|
17
|
+
size?: "sm" | "md" | "lg" | RecursicaSize;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type LoaderProps = RecursicaOverStyled<
|
|
21
|
+
Omit<MantineLoaderProps, "variant" | "size" | "type"> & RecursicaLoaderProps
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
export const Loader = forwardRef<HTMLSpanElement, LoaderProps>(function Loader(
|
|
25
|
+
{ variant = "oval", size = "default", overStyled = false, ...rest },
|
|
26
|
+
ref,
|
|
27
|
+
) {
|
|
28
|
+
const mapSize = {
|
|
29
|
+
sm: "small",
|
|
30
|
+
md: "default",
|
|
31
|
+
lg: "large",
|
|
32
|
+
small: "small",
|
|
33
|
+
default: "default",
|
|
34
|
+
large: "large",
|
|
35
|
+
} as const;
|
|
36
|
+
|
|
37
|
+
const resolvedSize = mapSize[size] || "default";
|
|
38
|
+
|
|
39
|
+
// Strip all visual override injections unless developer has specifically opted into overStyling.
|
|
40
|
+
// External layout props like margins are safely preserved.
|
|
41
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
42
|
+
|
|
43
|
+
const mergedClassNames: Partial<Record<string, string>> = {
|
|
44
|
+
root: styles.root,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const classNamesProp = (sanitizedProps as Record<string, unknown>).classNames;
|
|
48
|
+
if (
|
|
49
|
+
classNamesProp &&
|
|
50
|
+
typeof classNamesProp === "object" &&
|
|
51
|
+
!Array.isArray(classNamesProp)
|
|
52
|
+
) {
|
|
53
|
+
const o = classNamesProp as Partial<Record<string, string>>;
|
|
54
|
+
mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const classNameProp = (sanitizedProps as Record<string, unknown>)
|
|
58
|
+
.className as string | undefined;
|
|
59
|
+
const finalClass = classNameProp
|
|
60
|
+
? `${styles.root} ${classNameProp}`
|
|
61
|
+
: styles.root;
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<MantineLoader
|
|
65
|
+
ref={ref}
|
|
66
|
+
type={variant}
|
|
67
|
+
data-variant={variant}
|
|
68
|
+
data-size={resolvedSize}
|
|
69
|
+
{...sanitizedProps}
|
|
70
|
+
className={finalClass}
|
|
71
|
+
classNames={mergedClassNames}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
Loader.displayName = "Loader";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Menu } from "./Menu";
|
|
3
|
+
import { ComingSoon } from "@recursica/storybook-template";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Menu> = {
|
|
6
|
+
title: "UI-Kit/🚧 Menu",
|
|
7
|
+
component: Menu,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Menu>;
|
|
14
|
+
|
|
15
|
+
export const Default: Story = {
|
|
16
|
+
render: () => <ComingSoon componentName="Menu" />,
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Modal } from "./Modal";
|
|
3
|
+
import { ComingSoon } from "@recursica/storybook-template";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Modal> = {
|
|
6
|
+
title: "UI-Kit/🚧 Modal",
|
|
7
|
+
component: Modal,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Modal>;
|
|
14
|
+
|
|
15
|
+
export const Default: Story = {
|
|
16
|
+
render: () => <ComingSoon componentName="Modal" />,
|
|
17
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { NumberInput } from "./NumberInput";
|
|
3
|
+
import { ComingSoon } from "@recursica/storybook-template";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof NumberInput> = {
|
|
6
|
+
title: "UI-Kit/🚧 NumberInput",
|
|
7
|
+
component: NumberInput,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
disabled: {
|
|
11
|
+
control: "boolean",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
type Story = StoryObj<typeof NumberInput>;
|
|
19
|
+
|
|
20
|
+
export const Default: Story = {
|
|
21
|
+
render: () => <ComingSoon componentName="NumberInput" />,
|
|
22
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Pagination } from "./Pagination";
|
|
3
|
+
import { ComingSoon } from "@recursica/storybook-template";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Pagination> = {
|
|
6
|
+
title: "UI-Kit/🚧 Pagination",
|
|
7
|
+
component: Pagination,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Pagination>;
|
|
14
|
+
|
|
15
|
+
export const Default: Story = {
|
|
16
|
+
render: () => <ComingSoon componentName="Pagination" />,
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Panel } from "./Panel";
|
|
3
|
+
import { ComingSoon } from "@recursica/storybook-template";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Panel> = {
|
|
6
|
+
title: "UI-Kit/🚧 Panel",
|
|
7
|
+
component: Panel,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Panel>;
|
|
14
|
+
|
|
15
|
+
export const Default: Story = {
|
|
16
|
+
render: () => <ComingSoon componentName="Panel" />,
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Popover } from "./Popover";
|
|
3
|
+
import { ComingSoon } from "@recursica/storybook-template";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Popover> = {
|
|
6
|
+
title: "UI-Kit/🚧 Popover",
|
|
7
|
+
component: Popover,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Popover>;
|
|
14
|
+
|
|
15
|
+
export const Default: Story = {
|
|
16
|
+
render: () => <ComingSoon componentName="Popover" />,
|
|
17
|
+
};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Radio.module.css
|
|
3
|
+
*
|
|
4
|
+
* HARDCODED VALUES:
|
|
5
|
+
* - margin / padding: 0 — Structural resets; consider token if spacing needed.
|
|
6
|
+
* - cursor: pointer / not-allowed — Baseline interactive indications.
|
|
7
|
+
* - appearance / box-sizing / border-style — necessary normalization for inputs.
|
|
8
|
+
* - transition: all 0.2s ease — Animation curve; consider a transition token.
|
|
9
|
+
* - min-width: 0 — Forces text wrap boundary in flex children.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* --- GROUP STYLES --- */
|
|
13
|
+
.groupRoot {
|
|
14
|
+
padding: var(
|
|
15
|
+
--recursica_ui-kit_components_radio-button-group_properties_padding,
|
|
16
|
+
0
|
|
17
|
+
);
|
|
18
|
+
margin: 0; /* HARDCODE: structural reset; consider token if layout needs change */
|
|
19
|
+
display: flex !important;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: var(
|
|
22
|
+
--recursica_ui-kit_components_radio-button-group_properties_item-gap,
|
|
23
|
+
16px
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* SideBySide Variant */
|
|
28
|
+
.groupRoot[data-layout="side-by-side"] {
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
flex-wrap: wrap;
|
|
31
|
+
padding-top: var(
|
|
32
|
+
--recursica_ui-kit_components_radio-button-group_variants_layouts_side-by-side_properties_vertical-padding
|
|
33
|
+
);
|
|
34
|
+
padding-bottom: var(
|
|
35
|
+
--recursica_ui-kit_components_radio-button-group_variants_layouts_side-by-side_properties_vertical-padding
|
|
36
|
+
);
|
|
37
|
+
margin-top: var(
|
|
38
|
+
--recursica_ui-kit_components_radio-button-group_variants_layouts_side-by-side_properties_top-bottom-margin
|
|
39
|
+
);
|
|
40
|
+
margin-bottom: var(
|
|
41
|
+
--recursica_ui-kit_components_radio-button-group_variants_layouts_side-by-side_properties_top-bottom-margin
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Stacked Variant */
|
|
46
|
+
.groupRoot[data-layout="stacked"] {
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
margin-top: var(
|
|
49
|
+
--recursica_ui-kit_components_radio-button-group_variants_layouts_stacked_properties_top-bottom-margin
|
|
50
|
+
);
|
|
51
|
+
margin-bottom: var(
|
|
52
|
+
--recursica_ui-kit_components_radio-button-group_variants_layouts_stacked_properties_top-bottom-margin
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* --- PRIMITIVE RADIO STYLES --- */
|
|
57
|
+
|
|
58
|
+
.root {
|
|
59
|
+
max-width: var(
|
|
60
|
+
--recursica_ui-kit_components_radio-button-item_properties_max-width
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.body {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: flex-start;
|
|
67
|
+
gap: var(
|
|
68
|
+
--recursica_ui-kit_components_radio-button-item_properties_label-gap
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.inner {
|
|
73
|
+
display: flex !important;
|
|
74
|
+
align-items: center !important;
|
|
75
|
+
justify-content: center !important;
|
|
76
|
+
margin: 0 !important; /* HARDCODE: structural reset */
|
|
77
|
+
width: var(
|
|
78
|
+
--recursica_ui-kit_components_radio-button_properties_size
|
|
79
|
+
) !important;
|
|
80
|
+
height: var(
|
|
81
|
+
--recursica_ui-kit_components_radio-button_properties_size
|
|
82
|
+
) !important;
|
|
83
|
+
/* Mathematically syncs the physical input radio bounding block visually with the center of the text's first line natively. */
|
|
84
|
+
margin-top: calc(
|
|
85
|
+
(
|
|
86
|
+
var(
|
|
87
|
+
--recursica_ui-kit_components_radio-button-item_properties_text_line-height
|
|
88
|
+
) *
|
|
89
|
+
var(
|
|
90
|
+
--recursica_ui-kit_components_radio-button-item_properties_text_font-size
|
|
91
|
+
) -
|
|
92
|
+
var(--recursica_ui-kit_components_radio-button_properties_size)
|
|
93
|
+
) /
|
|
94
|
+
2
|
|
95
|
+
) !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Base explicit reset masking underlying framework defaults */
|
|
99
|
+
.radio {
|
|
100
|
+
cursor: pointer; /* HARDCODE: core interaction behavior */
|
|
101
|
+
appearance: none; /* HARDCODE: reset native widget */
|
|
102
|
+
box-sizing: border-box !important; /* HARDCODE: ensures size includes borders */
|
|
103
|
+
width: var(
|
|
104
|
+
--recursica_ui-kit_components_radio-button_properties_size
|
|
105
|
+
) !important;
|
|
106
|
+
height: var(
|
|
107
|
+
--recursica_ui-kit_components_radio-button_properties_size
|
|
108
|
+
) !important;
|
|
109
|
+
border-radius: var(
|
|
110
|
+
--recursica_ui-kit_components_radio-button_properties_border-radius
|
|
111
|
+
) !important;
|
|
112
|
+
border-width: var(
|
|
113
|
+
--recursica_ui-kit_components_radio-button_properties_border-size
|
|
114
|
+
) !important;
|
|
115
|
+
border-style: solid; /* HARDCODE: normalize primitive border-style */
|
|
116
|
+
|
|
117
|
+
/* Standard unchecked state */
|
|
118
|
+
background-color: var(
|
|
119
|
+
--recursica_ui-kit_components_radio-button_properties_colors_background-unselected
|
|
120
|
+
) !important;
|
|
121
|
+
border-color: var(
|
|
122
|
+
--recursica_ui-kit_components_radio-button_properties_colors_border-unselected
|
|
123
|
+
) !important;
|
|
124
|
+
transition: all 0.2s ease; /* HARDCODE: consider global transition token */
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Checked State */
|
|
128
|
+
.radio:checked {
|
|
129
|
+
background-color: var(
|
|
130
|
+
--recursica_ui-kit_components_radio-button_properties_colors_background-selected
|
|
131
|
+
) !important;
|
|
132
|
+
border-color: var(
|
|
133
|
+
--recursica_ui-kit_components_radio-button_properties_colors_border-selected
|
|
134
|
+
) !important;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Disabled State */
|
|
138
|
+
.radio:disabled {
|
|
139
|
+
cursor: not-allowed; /* HARDCODE: disabled state default */
|
|
140
|
+
opacity: var(
|
|
141
|
+
--recursica_ui-kit_components_radio-button_properties_disabled-opacity
|
|
142
|
+
) !important;
|
|
143
|
+
background-color: var(
|
|
144
|
+
--recursica_ui-kit_components_radio-button_properties_colors_disabled-background
|
|
145
|
+
) !important;
|
|
146
|
+
border-color: var(
|
|
147
|
+
--recursica_ui-kit_components_radio-button_properties_colors_disabled-border
|
|
148
|
+
) !important;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.icon {
|
|
152
|
+
position: absolute;
|
|
153
|
+
inset: 0;
|
|
154
|
+
margin: auto;
|
|
155
|
+
pointer-events: none;
|
|
156
|
+
width: var(
|
|
157
|
+
--recursica_ui-kit_components_radio-button_properties_icon-size
|
|
158
|
+
) !important;
|
|
159
|
+
height: var(
|
|
160
|
+
--recursica_ui-kit_components_radio-button_properties_icon-size
|
|
161
|
+
) !important;
|
|
162
|
+
color: var(
|
|
163
|
+
--recursica_ui-kit_components_radio-button_properties_colors_icon-color
|
|
164
|
+
) !important;
|
|
165
|
+
}
|
|
166
|
+
.radio:disabled + .iconWrapper .icon,
|
|
167
|
+
.radio:disabled + .icon {
|
|
168
|
+
color: var(
|
|
169
|
+
--recursica_ui-kit_components_radio-button_properties_colors_disabled-icon
|
|
170
|
+
) !important;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.labelWrapper {
|
|
174
|
+
padding: 0 !important; /* HARDCODE: structural layout reset */
|
|
175
|
+
margin: 0 !important; /* HARDCODE: structural layout reset */
|
|
176
|
+
flex: 1;
|
|
177
|
+
min-width: 0; /* HARDCODE: forces text wrap boundary in flex child */
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.label {
|
|
181
|
+
cursor: pointer; /* HARDCODE: interactive affordance */
|
|
182
|
+
padding: 0 !important; /* HARDCODE: reset layout */
|
|
183
|
+
margin: 0 !important; /* HARDCODE: reset layout */
|
|
184
|
+
word-wrap: break-word;
|
|
185
|
+
white-space: normal;
|
|
186
|
+
color: var(
|
|
187
|
+
--recursica_ui-kit_components_radio-button-item_properties_text_color
|
|
188
|
+
) !important;
|
|
189
|
+
font-family: var(
|
|
190
|
+
--recursica_ui-kit_components_radio-button-item_properties_text_font-family
|
|
191
|
+
);
|
|
192
|
+
font-size: var(
|
|
193
|
+
--recursica_ui-kit_components_radio-button-item_properties_text_font-size
|
|
194
|
+
);
|
|
195
|
+
font-weight: var(
|
|
196
|
+
--recursica_ui-kit_components_radio-button-item_properties_text_font-weight
|
|
197
|
+
);
|
|
198
|
+
line-height: var(
|
|
199
|
+
--recursica_ui-kit_components_radio-button-item_properties_text_line-height
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
.root[data-disabled] .label {
|
|
203
|
+
cursor: not-allowed; /* HARDCODE: disabled interaction */
|
|
204
|
+
opacity: var(
|
|
205
|
+
--recursica_ui-kit_components_radio-button_properties_disabled-opacity
|
|
206
|
+
);
|
|
207
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Radio } from "./Radio";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Radio> = {
|
|
5
|
+
title: "UI-Kit/Radio",
|
|
6
|
+
component: Radio,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: `
|
|
12
|
+
The \`Radio\` component represents a fundamental standalone boolean selection node mapping to the native HTML \`<input type="radio">\`.
|
|
13
|
+
|
|
14
|
+
> [!WARNING]
|
|
15
|
+
> This component represents the isolated primitive structure. If you need macro form configurations, standard vertical alignments, side-by-side array wrappers, or integrated assistive text and error borders natively, you MUST use the \`<Radio.Group>\` orchestrator instead!
|
|
16
|
+
`,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
argTypes: {
|
|
21
|
+
disabled: {
|
|
22
|
+
control: "boolean",
|
|
23
|
+
},
|
|
24
|
+
checked: {
|
|
25
|
+
control: "boolean",
|
|
26
|
+
},
|
|
27
|
+
readOnly: {
|
|
28
|
+
control: "boolean",
|
|
29
|
+
},
|
|
30
|
+
error: {
|
|
31
|
+
control: "boolean",
|
|
32
|
+
},
|
|
33
|
+
defaultChecked: {
|
|
34
|
+
control: "boolean",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default meta;
|
|
40
|
+
|
|
41
|
+
type Story = StoryObj<typeof Radio>;
|
|
42
|
+
|
|
43
|
+
export const Default: Story = {
|
|
44
|
+
args: {
|
|
45
|
+
label: "Standard Radio Primitive",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const CheckedState: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
...Default.args,
|
|
52
|
+
defaultChecked: true,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const DisabledUnchecked: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
...Default.args,
|
|
59
|
+
disabled: true,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const DisabledChecked: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
...Default.args,
|
|
66
|
+
disabled: true,
|
|
67
|
+
defaultChecked: true,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const ReadOnlyStandalone: Story = {
|
|
72
|
+
args: {
|
|
73
|
+
readOnly: true,
|
|
74
|
+
readOnlyComponent: <span>Locked Native Value</span>,
|
|
75
|
+
},
|
|
76
|
+
};
|