@recursica/mui-adapter 0.2.0 → 0.3.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 (84) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/mui-adapter.cjs +1 -1
  3. package/dist/mui-adapter.cjs.map +1 -1
  4. package/dist/mui-adapter.css +1 -1
  5. package/dist/mui-adapter.js +249 -90
  6. package/dist/mui-adapter.js.map +1 -1
  7. package/dist/src/components/Box/Box.d.ts +2 -3
  8. package/dist/src/components/Button/Button.d.ts +33 -2
  9. package/dist/src/components/Container/Container.d.ts +8 -2
  10. package/dist/src/components/Flex/Flex.d.ts +25 -2
  11. package/dist/src/components/Group/Group.d.ts +10 -2
  12. package/dist/src/components/Link/Link.d.ts +13 -2
  13. package/dist/src/components/Stack/Stack.d.ts +8 -2
  14. package/dist/src/components/Text/Text.d.ts +18 -2
  15. package/dist/src/components/Title/Title.d.ts +17 -2
  16. package/dist/src/components/Typography/Typography.d.ts +27 -0
  17. package/dist/src/utils/filterStylingProps.d.ts +3 -0
  18. package/package.json +2 -1
  19. package/src/Introduction.stories.tsx +113 -110
  20. package/src/OverStyling.tsx +18 -23
  21. package/src/Version.tsx +14 -21
  22. package/src/components/Accordion/Accordion.stories.tsx +19 -0
  23. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +19 -0
  24. package/src/components/Avatar/Avatar.stories.tsx +19 -0
  25. package/src/components/Badge/Badge.stories.tsx +19 -0
  26. package/src/components/Box/Box.stories.tsx +19 -10
  27. package/src/components/Box/Box.tsx +11 -14
  28. package/src/components/Box/IMPLEMENTATION_NOTES.md +5 -0
  29. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +19 -0
  30. package/src/components/Button/BUTTON_IMPLEMENTATION_NOTES.md +17 -0
  31. package/src/components/Button/Button.module.css +300 -0
  32. package/src/components/Button/Button.stories.tsx +136 -5
  33. package/src/components/Button/Button.tsx +116 -5
  34. package/src/components/Card/Card.stories.tsx +19 -0
  35. package/src/components/Checkbox/Checkbox.stories.tsx +19 -0
  36. package/src/components/Chip/Chip.stories.tsx +19 -0
  37. package/src/components/Container/Container.stories.tsx +19 -0
  38. package/src/components/Container/Container.tsx +56 -5
  39. package/src/components/Container/IMPLEMENTATION_NOTES.md +5 -0
  40. package/src/components/DatePicker/DatePicker.stories.tsx +19 -0
  41. package/src/components/Dropdown/Dropdown.stories.tsx +19 -0
  42. package/src/components/FileInput/FileInput.stories.tsx +19 -0
  43. package/src/components/FileUpload/FileUpload.stories.tsx +19 -0
  44. package/src/components/Flex/Flex.stories.tsx +19 -0
  45. package/src/components/Flex/Flex.tsx +77 -5
  46. package/src/components/FormControlLayout/FormControlLayout.stories.tsx +19 -0
  47. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +19 -0
  48. package/src/components/Group/Group.stories.tsx +133 -5
  49. package/src/components/Group/Group.tsx +57 -5
  50. package/src/components/HoverCard/HoverCard.stories.tsx +19 -0
  51. package/src/components/Label/Label.stories.tsx +19 -0
  52. package/src/components/Link/Link.module.css +133 -0
  53. package/src/components/Link/Link.stories.tsx +52 -4
  54. package/src/components/Link/Link.tsx +47 -5
  55. package/src/components/Loader/Loader.stories.tsx +19 -0
  56. package/src/components/Menu/Menu.stories.tsx +19 -0
  57. package/src/components/Modal/Modal.stories.tsx +19 -0
  58. package/src/components/NumberInput/NumberInput.stories.tsx +19 -0
  59. package/src/components/Pagination/Pagination.stories.tsx +19 -0
  60. package/src/components/Panel/Panel.stories.tsx +19 -0
  61. package/src/components/Radio/Radio.stories.tsx +19 -0
  62. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +19 -0
  63. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +19 -0
  64. package/src/components/Slider/Slider.stories.tsx +19 -0
  65. package/src/components/Stack/Stack.stories.tsx +118 -5
  66. package/src/components/Stack/Stack.tsx +37 -5
  67. package/src/components/Stepper/Stepper.stories.tsx +19 -0
  68. package/src/components/Switch/Switch.stories.tsx +19 -0
  69. package/src/components/Table/Table.stories.tsx +19 -0
  70. package/src/components/Tabs/Tabs.stories.tsx +19 -0
  71. package/src/components/Text/Text.stories.tsx +87 -3
  72. package/src/components/Text/Text.tsx +27 -4
  73. package/src/components/TextArea/TextArea.stories.tsx +19 -0
  74. package/src/components/TextField/TextField.stories.tsx +19 -0
  75. package/src/components/TimePicker/TimePicker.stories.tsx +19 -0
  76. package/src/components/Timeline/Timeline.stories.tsx +19 -0
  77. package/src/components/Title/Title.stories.tsx +68 -3
  78. package/src/components/Title/Title.tsx +29 -5
  79. package/src/components/Toast/Toast.stories.tsx +19 -0
  80. package/src/components/Tooltip/Tooltip.stories.tsx +19 -0
  81. package/src/components/TransferList/TransferList.stories.tsx +19 -0
  82. package/src/components/Typography/Typography.tsx +42 -0
  83. package/src/utils/ColorSchemeWrapper.tsx +1 -5
  84. package/src/utils/filterStylingProps.ts +13 -1
@@ -1,3 +1,26 @@
1
1
  import { default as React } from 'react';
2
- export type FlexProps = React.HTMLAttributes<HTMLDivElement>;
3
- export declare const Flex: React.FC<FlexProps>;
2
+ import { BoxProps as MUIBoxProps } from '@mui/material';
3
+ import { RecursicaSpacing, OmitSx } from '../../utils/filterStylingProps';
4
+ export interface RecursicaFlexProps {
5
+ /**
6
+ * Content to render inside the flex container.
7
+ */
8
+ children?: React.ReactNode;
9
+ /**
10
+ * The gap between flex items. Accepts standard MUI spacing or Recursica gap tokens
11
+ * (e.g. "rec-md").
12
+ */
13
+ gap?: string | number | RecursicaSpacing;
14
+ /**
15
+ * The vertical gap between flex items when wrapping. Accepts standard MUI spacing
16
+ * or Recursica gap tokens.
17
+ */
18
+ rowGap?: string | number | RecursicaSpacing;
19
+ /**
20
+ * The horizontal gap between flex items when wrapping. Accepts standard MUI spacing
21
+ * or Recursica gap tokens.
22
+ */
23
+ columnGap?: string | number | RecursicaSpacing;
24
+ }
25
+ export type FlexProps = OmitSx<MUIBoxProps & RecursicaFlexProps>;
26
+ export declare const Flex: React.ForwardRefExoticComponent<Omit<FlexProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,11 @@
1
1
  import { default as React } from 'react';
2
- export type GroupProps = React.HTMLAttributes<HTMLDivElement>;
3
- export declare const Group: React.FC<GroupProps>;
2
+ import { StackProps as MUIStackProps } from '@mui/material';
3
+ import { RecursicaSpacing, OmitSx } from '../../utils/filterStylingProps';
4
+ export interface RecursicaGroupProps {
5
+ children?: React.ReactNode;
6
+ gap?: MUIStackProps["spacing"] | RecursicaSpacing;
7
+ rowGap?: MUIStackProps["spacing"] | RecursicaSpacing;
8
+ columnGap?: MUIStackProps["spacing"] | RecursicaSpacing;
9
+ }
10
+ export type GroupProps = OmitSx<Omit<MUIStackProps, "spacing" | "direction"> & RecursicaGroupProps>;
11
+ export declare const Group: React.ForwardRefExoticComponent<Omit<GroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,14 @@
1
1
  import { default as React } from 'react';
2
- export type LinkProps = React.HTMLAttributes<HTMLDivElement>;
3
- export declare const Link: React.FC<LinkProps>;
2
+ import { LinkProps as MUILinkProps } from '@mui/material';
3
+ import { RecursicaOverStyled } from '../../utils/filterStylingProps';
4
+ export interface RecursicaLinkProps {
5
+ icon?: React.ReactNode;
6
+ children?: React.ReactNode;
7
+ component?: React.ElementType;
8
+ }
9
+ export type LinkProps = RecursicaOverStyled<Omit<MUILinkProps, "underline"> & RecursicaLinkProps>;
10
+ export declare const Link: React.ForwardRefExoticComponent<(Omit<Omit<Omit<MUILinkProps, "underline"> & RecursicaLinkProps, "style" | "className" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "bgcolor" | "color" | "zIndex" | "position" | "boxShadow" | "typography" | "fontFamily" | "fontSize" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "backgroundColor" | "sx"> & import('../../utils/filterStylingProps').ForbiddenStyles & {
11
+ overStyled?: false | undefined;
12
+ }, "ref"> | Omit<Omit<MUILinkProps, "underline"> & RecursicaLinkProps & {
13
+ overStyled: true;
14
+ }, "ref">) & React.RefAttributes<HTMLAnchorElement>>;
@@ -1,3 +1,9 @@
1
1
  import { default as React } from 'react';
2
- export type StackProps = React.HTMLAttributes<HTMLDivElement>;
3
- export declare const Stack: React.FC<StackProps>;
2
+ import { StackProps as MUIStackProps } from '@mui/material';
3
+ import { RecursicaSpacing, OmitSx } from '../../utils/filterStylingProps';
4
+ export interface RecursicaStackProps {
5
+ children?: React.ReactNode;
6
+ gap?: MUIStackProps["spacing"] | RecursicaSpacing;
7
+ }
8
+ export type StackProps = OmitSx<Omit<MUIStackProps, "spacing"> & RecursicaStackProps>;
9
+ export declare const Stack: React.ForwardRefExoticComponent<Omit<StackProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,19 @@
1
1
  import { default as React } from 'react';
2
- export type TextProps = React.HTMLAttributes<HTMLDivElement>;
3
- export declare const Text: React.FC<TextProps>;
2
+ import { RecursicaOverStyled } from '../../utils/filterStylingProps';
3
+ import { TypographyProps as MuiTypographyProps } from '@mui/material';
4
+ export type TextVariant = "body" | "body-small" | "caption" | "overline" | "subtitle" | "subtitle-small";
5
+ export type RecursicaTextProps = Omit<MuiTypographyProps, "variant"> & {
6
+ variant?: TextVariant;
7
+ children?: React.ReactNode;
8
+ component?: React.ElementType;
9
+ };
10
+ export type TextProps = RecursicaOverStyled<RecursicaTextProps>;
11
+ export declare const Text: React.ForwardRefExoticComponent<(Omit<Omit<RecursicaTextProps, "style" | "className" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "bgcolor" | "color" | "zIndex" | "position" | "boxShadow" | "typography" | "fontFamily" | "fontSize" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "backgroundColor" | "sx"> & import('../../utils/filterStylingProps').ForbiddenStyles & {
12
+ overStyled?: false | undefined;
13
+ }, "ref"> | Omit<Omit<MuiTypographyProps, "variant"> & {
14
+ variant?: TextVariant;
15
+ children?: React.ReactNode;
16
+ component?: React.ElementType;
17
+ } & {
18
+ overStyled: true;
19
+ }, "ref">) & React.RefAttributes<HTMLElement>>;
@@ -1,3 +1,18 @@
1
1
  import { default as React } from 'react';
2
- export type TitleProps = React.HTMLAttributes<HTMLDivElement>;
3
- export declare const Title: React.FC<TitleProps>;
2
+ import { RecursicaOverStyled } from '../../utils/filterStylingProps';
3
+ import { TypographyProps as MuiTypographyProps } from '@mui/material';
4
+ export type RecursicaTitleProps = Omit<MuiTypographyProps, "variant"> & {
5
+ order?: 1 | 2 | 3 | 4 | 5 | 6;
6
+ children?: React.ReactNode;
7
+ component?: React.ElementType;
8
+ };
9
+ export type TitleProps = RecursicaOverStyled<RecursicaTitleProps>;
10
+ export declare const Title: React.ForwardRefExoticComponent<(Omit<Omit<RecursicaTitleProps, "style" | "className" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "bgcolor" | "color" | "zIndex" | "position" | "boxShadow" | "typography" | "fontFamily" | "fontSize" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "backgroundColor" | "sx"> & import('../../utils/filterStylingProps').ForbiddenStyles & {
11
+ overStyled?: false | undefined;
12
+ }, "ref"> | Omit<Omit<MuiTypographyProps, "variant"> & {
13
+ order?: 1 | 2 | 3 | 4 | 5 | 6;
14
+ children?: React.ReactNode;
15
+ component?: React.ElementType;
16
+ } & {
17
+ overStyled: true;
18
+ }, "ref">) & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,27 @@
1
+ import { default as React } from 'react';
2
+ import { TypographyProps as MuiTypographyProps } from '@mui/material';
3
+ import { RecursicaOverStyled } from '../../utils/filterStylingProps';
4
+ export type TypographyProps = RecursicaOverStyled<Omit<MuiTypographyProps, "variant"> & {
5
+ /**
6
+ * Internal typography class mapping
7
+ */
8
+ typographyClass: string;
9
+ component?: React.ElementType;
10
+ }>;
11
+ export declare const Typography: React.ForwardRefExoticComponent<(Omit<Omit<Omit<MuiTypographyProps, "variant"> & {
12
+ /**
13
+ * Internal typography class mapping
14
+ */
15
+ typographyClass: string;
16
+ component?: React.ElementType;
17
+ }, "style" | "className" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "bgcolor" | "color" | "zIndex" | "position" | "boxShadow" | "typography" | "fontFamily" | "fontSize" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "backgroundColor" | "sx"> & import('../../utils/filterStylingProps').ForbiddenStyles & {
18
+ overStyled?: false | undefined;
19
+ }, "ref"> | Omit<Omit<MuiTypographyProps, "variant"> & {
20
+ /**
21
+ * Internal typography class mapping
22
+ */
23
+ typographyClass: string;
24
+ component?: React.ElementType;
25
+ } & {
26
+ overStyled: true;
27
+ }, "ref">) & React.RefAttributes<HTMLElement>>;
@@ -25,9 +25,12 @@ export declare const BLOCKED_STYLING_KEYS: readonly ["className", "classes", "st
25
25
  export type BlockedStylingKeys = (typeof BLOCKED_STYLING_KEYS)[number];
26
26
  export type RecursicaSpacing = "rec-none" | "rec-sm" | "rec-default" | "rec-md" | "rec-lg" | "rec-xl" | "rec-2xl";
27
27
  export type RecursicaSize = "small" | "default" | "large";
28
+ export declare const SPACING_MAP: Record<string, string>;
28
29
  export type ForbiddenStyles = {
29
30
  [K in BlockedStylingKeys]?: never;
30
31
  };
32
+ export type OmitSx<T> = Omit<T, "sx">;
33
+ export declare function filterSxProp<T extends Record<string, unknown>>(props: T): Omit<T, "sx">;
31
34
  export type RecursicaOverStyled<T> = (Omit<T, BlockedStylingKeys> & ForbiddenStyles & {
32
35
  overStyled?: false | undefined;
33
36
  }) | (T & {
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "url": "git+https://github.com/borderux/recursica.git",
14
14
  "directory": "packages/mui-adapter"
15
15
  },
16
- "version": "0.2.0",
16
+ "version": "0.3.0",
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
@@ -82,6 +82,7 @@
82
82
  "storybook": "^10.3.3",
83
83
  "storybook-dark-mode": "^5.0.0",
84
84
  "strip-literal": "^3.0.0",
85
+ "ts-morph": "^28.0.0",
85
86
  "typescript": "~5.8.3",
86
87
  "typescript-eslint": "^8.30.1",
87
88
  "vite": "^6.3.5",
@@ -1,157 +1,160 @@
1
1
  import type { Meta } from "@storybook/react-vite";
2
2
  import { AdaptersContent, MuiLogo } from "@recursica/storybook-template";
3
- import { Button } from "./components/Button/Button";
4
3
  import { VersionInfo } from "./Version";
5
4
  import { OverStylingInfo } from "./OverStyling";
6
5
 
7
6
  const DOCS_URL = "https://recursica.com";
8
7
  const FORGE_URL = "https://forge.recursica.com";
9
8
 
10
- const sectionStyle: React.CSSProperties = {
11
- marginBottom: 32,
12
- };
13
-
14
- const headingStyle: React.CSSProperties = {
15
- fontSize: 14,
16
- fontWeight: 600,
17
- color: "#333",
18
- marginBottom: 8,
19
- marginTop: 0,
20
- };
21
-
22
- const bodyStyle: React.CSSProperties = {
23
- fontSize: 14,
24
- lineHeight: 1.6,
25
- color: "#444",
26
- margin: 0,
27
- };
28
-
29
- const linkStyle: React.CSSProperties = {
30
- color: "#0066cc",
31
- textDecoration: "none",
32
- };
9
+ import { Container, Box, Group, Title, Text, Link } from "./components";
33
10
 
34
11
  function IntroductionContent() {
35
12
  return (
36
- <div style={{ padding: 24, maxWidth: 640 }}>
37
- <div
38
- style={{
39
- display: "flex",
40
- alignItems: "center",
41
- gap: "16px",
42
- marginBottom: "16px",
43
- }}
44
- >
13
+ <Container size="md" style={{ padding: "32px 0", maxWidth: 640 }}>
14
+ <Group gap="rec-md" mb={2}>
45
15
  <MuiLogo width={40} height={40} />
46
- <div>
47
- <h1 style={{ fontSize: 24, fontWeight: 700, margin: 0 }}>
16
+ <Box>
17
+ <Title order={1} m={0}>
48
18
  Recursica Design System (MUI Adapter)
49
- </h1>
50
- <a
51
- href="https://mui.com"
52
- target="_blank"
53
- rel="noreferrer"
54
- style={linkStyle}
55
- >
19
+ </Title>
20
+ <Link href="https://mui.com" target="_blank" rel="noreferrer">
56
21
  mui.com
57
- </a>
58
- </div>
59
- </div>
60
- <p style={{ ...bodyStyle, marginBottom: 24 }}>
22
+ </Link>
23
+ </Box>
24
+ </Group>
25
+ <Text mb={4}>
61
26
  This Storybook showcases the Recursica design system implemented for the{" "}
62
27
  <strong>Material UI (MUI) Kit</strong>. It provides reusable components
63
28
  that map our design tokens to MUI's robust component layer.
64
- </p>
29
+ </Text>
65
30
 
66
- <section style={sectionStyle}>
67
- <h2 style={headingStyle}>Looking for another UI Kit?</h2>
68
- <p style={bodyStyle}>
31
+ <Box component="section" sx={{ mb: 4 }}>
32
+ <Title order={2} mb={1}>
33
+ Looking for another UI Kit?
34
+ </Title>
35
+ <Text>
69
36
  Are you using a different UI Kit (like Mantine)? Recursica provides
70
37
  multiple adapters for different frameworks.
71
- </p>
72
- <div style={{ marginTop: "16px" }}>
73
- <Button
38
+ </Text>
39
+ <Box sx={{ mt: 2 }}>
40
+ <a
74
41
  href="./?path=/story/introduction--adapters"
75
42
  target="_parent"
76
- variant="solid"
43
+ className="adapter-btn"
44
+ style={{
45
+ display: "inline-flex",
46
+ alignItems: "center",
47
+ justifyContent: "center",
48
+ backgroundColor:
49
+ "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_background)",
50
+ color:
51
+ "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text)",
52
+ textDecoration: "none",
53
+ borderRadius:
54
+ "var(--recursica_ui-kit_components_button_variants_sizes_default_properties_border-radius)",
55
+ height:
56
+ "var(--recursica_ui-kit_components_button_variants_sizes_default_properties_height)",
57
+ padding:
58
+ "0 var(--recursica_ui-kit_components_button_variants_sizes_default_properties_horizontal-padding)",
59
+ fontFamily:
60
+ "var(--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-family)",
61
+ fontSize:
62
+ "var(--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-size)",
63
+ fontWeight:
64
+ "var(--recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-weight)",
65
+ boxShadow:
66
+ "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_elevation)",
67
+ border:
68
+ "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_border-size) solid var(--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_border-color)",
69
+ transition: "opacity 0.2s ease",
70
+ }}
71
+ onMouseOver={(e) => {
72
+ e.currentTarget.style.opacity = "0.85";
73
+ e.currentTarget.style.color =
74
+ "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text-hover)";
75
+ }}
76
+ onMouseOut={(e) => {
77
+ e.currentTarget.style.opacity = "1";
78
+ e.currentTarget.style.color =
79
+ "var(--recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text)";
80
+ }}
77
81
  >
78
82
  View Supported Adapters
79
- </Button>
80
- </div>
81
- </section>
82
-
83
- <section style={sectionStyle}>
84
- <h2 style={headingStyle}>Installation</h2>
85
- <p style={bodyStyle}>
86
- To install the MUI adapter in your project, run:
87
- </p>
88
- <pre
89
- style={{
90
- padding: 12,
91
- backgroundColor: "#f5f5f5",
92
- borderRadius: 6,
83
+ </a>
84
+ </Box>
85
+ </Box>
86
+
87
+ <Box component="section" sx={{ mb: 4 }}>
88
+ <Title order={2} mb={1}>
89
+ Installation
90
+ </Title>
91
+ <Text>To install the MUI adapter in your project, run:</Text>
92
+ <Box
93
+ component="pre"
94
+ sx={{
95
+ p: 1.5,
96
+ bgcolor: "grey.100",
97
+ borderRadius: 1,
93
98
  fontSize: 13,
94
- marginTop: 8,
99
+ mt: 1,
95
100
  }}
96
101
  >
97
102
  <code>
98
103
  npm install @recursica/mui-adapter @mui/material @emotion/react
99
104
  @emotion/styled
100
105
  </code>
101
- </pre>
102
- </section>
103
-
104
- <section style={sectionStyle}>
105
- <h2 style={headingStyle}>Tokens</h2>
106
- <p style={bodyStyle}>
106
+ </Box>
107
+ </Box>
108
+
109
+ <Box component="section" sx={{ mb: 4 }}>
110
+ <Title order={2} mb={1}>
111
+ Tokens
112
+ </Title>
113
+ <Text>
107
114
  Raw design tokens (colors, sizes, font weights, opacities, etc.) that
108
115
  feed the theme and components. These are the primitive values defined
109
116
  in your token set and exposed as CSS custom properties.
110
- </p>
111
- </section>
112
-
113
- <section style={sectionStyle}>
114
- <h2 style={headingStyle}>Theme</h2>
115
- <p style={bodyStyle}>
117
+ </Text>
118
+ </Box>
119
+
120
+ <Box component="section" sx={{ mb: 4 }}>
121
+ <Title order={2} mb={1}>
122
+ Theme
123
+ </Title>
124
+ <Text>
116
125
  Brand and theme layer built on top of tokens. Typography types,
117
126
  dimensions, and layout grids are defined here. Theme uses the tokens
118
127
  and exposes both CSS variables and helper classes (e.g. typography
119
128
  classes) for consistent styling across the product.
120
- </p>
121
- </section>
122
-
123
- <section style={sectionStyle}>
124
- <h2 style={headingStyle}>Configuring Recursica</h2>
125
- <p style={bodyStyle}>
129
+ </Text>
130
+ </Box>
131
+
132
+ <Box component="section" sx={{ mb: 4 }}>
133
+ <Title order={2} mb={1}>
134
+ Configuring Recursica
135
+ </Title>
136
+ <Text>
126
137
  To modify the Recursica configuration (tokens, brand, theme), go to{" "}
127
- <a
128
- href={FORGE_URL}
129
- target="_blank"
130
- rel="noopener noreferrer"
131
- style={linkStyle}
132
- >
138
+ <Link href={FORGE_URL} target="_blank" rel="noopener noreferrer">
133
139
  {FORGE_URL}
134
- </a>
140
+ </Link>
135
141
  . Changes there drive the tokens and theme you see in this Storybook.
136
- </p>
137
- </section>
138
-
139
- <section style={sectionStyle}>
140
- <h2 style={headingStyle}>Documentation</h2>
141
- <p style={bodyStyle}>
142
+ </Text>
143
+ </Box>
144
+
145
+ <Box component="section" sx={{ mb: 4 }}>
146
+ <Title order={2} mb={1}>
147
+ Documentation
148
+ </Title>
149
+ <Text>
142
150
  For full documentation, guides, and API reference, visit{" "}
143
- <a
144
- href={DOCS_URL}
145
- target="_blank"
146
- rel="noopener noreferrer"
147
- style={linkStyle}
148
- >
151
+ <Link href={DOCS_URL} target="_blank" rel="noopener noreferrer">
149
152
  {DOCS_URL}
150
- </a>
153
+ </Link>
151
154
  .
152
- </p>
153
- </section>
154
- </div>
155
+ </Text>
156
+ </Box>
157
+ </Container>
155
158
  );
156
159
  }
157
160
 
@@ -1,20 +1,14 @@
1
- import {
2
- Container,
3
- Paper,
4
- Typography as Text,
5
- Divider,
6
- Stack,
7
- Box,
8
- } from "@mui/material";
1
+ import { Paper, Divider } from "@mui/material";
2
+ import { Container, Stack, Box, Text, Title } from "./components";
9
3
  import { Button } from "./components/Button/Button";
10
4
 
11
5
  export const OverStylingInfo = () => {
12
6
  return (
13
- <Container maxWidth="md" sx={{ py: 4 }}>
7
+ <Container size="md" style={{ padding: "32px 0" }}>
14
8
  <Paper variant="outlined" sx={{ p: 4, borderRadius: 2 }}>
15
- <Text variant="h4" mb={2}>
9
+ <Title order={4} mb={2}>
16
10
  Over Styling (<code>overStyled</code>)
17
- </Text>
11
+ </Title>
18
12
  <Text mb={2}>
19
13
  By default, all Recursica components are strictly sandboxed. This
20
14
  means they are protected against arbitrary styling configurations
@@ -31,9 +25,9 @@ export const OverStylingInfo = () => {
31
25
  <code>overStyled={`{true}`}</code>.
32
26
  </Text>
33
27
 
34
- <Text variant="h6" mb={1} mt={4}>
28
+ <Title order={6} mb={1} mt={4}>
35
29
  The Core Philosophy
36
- </Text>
30
+ </Title>
37
31
  <Text mb={1}>
38
32
  **You should not over-style components.** Using{" "}
39
33
  <code>overStyled</code> explicitly signifies that you are breaking
@@ -77,9 +71,9 @@ export const OverStylingInfo = () => {
77
71
 
78
72
  <Divider sx={{ mb: 4 }} />
79
73
 
80
- <Text variant="h6" mb={1}>
74
+ <Title order={6} mb={1}>
81
75
  Permitted Layout Properties
82
- </Text>
76
+ </Title>
83
77
  <Text mb={1}>
84
78
  Unlike deep styling bounds (colors, typography, padding, dimensions),
85
79
  external <strong>layout spacing properties</strong> like Margins (
@@ -113,7 +107,7 @@ export const OverStylingInfo = () => {
113
107
  </Text>
114
108
  </li>
115
109
  </Box>
116
- <Text mb={1} sx={{ fontWeight: 500 }}>
110
+ <Text mb={1} overStyled sx={{ fontWeight: 500 }}>
117
111
  Available Recursica Layout Tokens:
118
112
  </Text>
119
113
  <Box component="ul" sx={{ pl: 4, mb: 4 }}>
@@ -156,9 +150,9 @@ export const OverStylingInfo = () => {
156
150
 
157
151
  <Divider sx={{ mb: 4 }} />
158
152
 
159
- <Text variant="h6" mb={1}>
153
+ <Title order={6} mb={1}>
160
154
  Primitive Layout Components Exemption
161
- </Text>
155
+ </Title>
162
156
  <Text mb={1}>
163
157
  Unlike complex UI components (Buttons, Tabs, Inputs) which are
164
158
  strictly protected, <strong>Primitive Layout Components</strong> (
@@ -178,9 +172,9 @@ export const OverStylingInfo = () => {
178
172
 
179
173
  <Divider sx={{ mb: 4 }} />
180
174
 
181
- <Text variant="h6" mb={2}>
175
+ <Title order={6} mb={2}>
182
176
  Live Example
183
- </Text>
177
+ </Title>
184
178
  <Text mb={4}>
185
179
  Below is a side-by-side comparison. The first is a standard Recursica
186
180
  Button protected by the design tokens mapping. The second flagrantly
@@ -188,26 +182,27 @@ export const OverStylingInfo = () => {
188
182
  styling generics to punch right through the sandbox layout.
189
183
  </Text>
190
184
 
191
- <Stack direction="row" spacing={4}>
185
+ <Stack direction="row" gap="rec-default">
192
186
  <Box>
193
187
  <Text
194
188
  variant="caption"
189
+ overStyled
195
190
  sx={{ color: "text.secondary", mb: 1, display: "block" }}
196
191
  >
197
192
  Strict Baseline (Default)
198
193
  </Text>
199
- {/* Note: In mui-adapter, Button is currently a stub so we just pass standard React props */}
200
194
  <Button>Standard UI Kit Button</Button>
201
195
  </Box>
202
196
  <Box>
203
197
  <Text
204
198
  variant="caption"
199
+ overStyled
205
200
  sx={{ color: "text.secondary", mb: 1, display: "block" }}
206
201
  >
207
202
  overStyled={`{true}`}
208
203
  </Text>
209
- {/* Note: Button props are just standard HTML div props for the stub */}
210
204
  <Button
205
+ overStyled={true}
211
206
  style={{
212
207
  backgroundColor: "pink",
213
208
  color: "black",
package/src/Version.tsx CHANGED
@@ -1,43 +1,36 @@
1
1
  import ReactMarkdown from "react-markdown";
2
- import {
3
- Container,
4
- Paper,
5
- Title,
6
- TypographyStylesProvider,
7
- Group,
8
- Anchor,
9
- Divider,
10
- } from "@mantine/core";
2
+ import { Paper, Divider } from "@mui/material";
3
+ import { Container, Title, Group, Link, Box } from "./components";
11
4
  import pkg from "../package.json";
12
5
  import changelog from "../CHANGELOG.md?raw";
13
6
 
14
7
  export const VersionInfo = () => {
15
8
  return (
16
- <Container size="md" py="xl">
17
- <Paper withBorder p="xl" radius="md">
18
- <Title order={1} mb="xs">
19
- Mantine Adapter v{pkg.version}
9
+ <Container size="md" style={{ padding: "32px 0" }}>
10
+ <Paper variant="outlined" sx={{ p: 4, borderRadius: 2 }}>
11
+ <Title order={1} mb={1}>
12
+ MUI Adapter v{pkg.version}
20
13
  </Title>
21
- <Group mb="xl" gap="md">
22
- <Anchor
14
+ <Group mb={4} gap="rec-md">
15
+ <Link
23
16
  href="https://github.com/borderux/recursica"
24
17
  target="_blank"
25
18
  rel="noopener noreferrer"
26
19
  >
27
20
  GitHub Repository
28
- </Anchor>
29
- <Anchor
21
+ </Link>
22
+ <Link
30
23
  href="https://recursica.com"
31
24
  target="_blank"
32
25
  rel="noopener noreferrer"
33
26
  >
34
27
  Documentation & Website
35
- </Anchor>
28
+ </Link>
36
29
  </Group>
37
- <Divider mb="xl" />
38
- <TypographyStylesProvider>
30
+ <Divider sx={{ mb: 4 }} />
31
+ <Box className="markdown-body">
39
32
  <ReactMarkdown>{changelog}</ReactMarkdown>
40
- </TypographyStylesProvider>
33
+ </Box>
41
34
  </Paper>
42
35
  </Container>
43
36
  );
@@ -6,6 +6,25 @@ const meta: Meta<typeof Accordion> = {
6
6
  title: "UI-Kit/🚧 Accordion",
7
7
  component: Accordion,
8
8
  tags: ["autodocs"],
9
+ parameters: {
10
+ controls: {
11
+ include: [
12
+ "layer",
13
+ "withLayer",
14
+ "children",
15
+ "component",
16
+ "variant",
17
+ "size",
18
+ "icon",
19
+ "disabled",
20
+ "href",
21
+ "onClick",
22
+ "onChange",
23
+ "value",
24
+ "checked",
25
+ ],
26
+ },
27
+ },
9
28
  };
10
29
 
11
30
  export default meta;