@recursica/mantine-adapter 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.
- package/LICENSE +21 -0
- package/README.md +79 -0
- 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 +240 -0
- package/dist/mantine-adapter.js.map +1 -0
- package/dist/src/RecursicaThemeProvider/RecursicaThemeProvider.d.ts +11 -0
- package/dist/src/components/Accordion/Accordion.d.ts +57 -0
- package/dist/src/components/Accordion/index.d.ts +1 -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/Button/Button.d.ts +9 -0
- package/dist/src/components/Button/index.d.ts +1 -0
- package/dist/src/components/Layer/Layer.d.ts +25 -0
- package/dist/src/components/Layer/index.d.ts +1 -0
- package/dist/src/components/index.d.ts +4 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/types/index.d.ts +6 -0
- package/dist/src/utils/copyToClipboard.d.ts +8 -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 +87 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Border LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# @recursica/mantine-adapter
|
|
2
|
+
|
|
3
|
+
A modern React component library built with TypeScript and **Mantine 8**. This package serves as the core UI kit for Recursica applications, providing reusable UI components, centralized theme configurations, and a comprehensive Storybook environment for development.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @recursica/mantine-adapter
|
|
9
|
+
# or
|
|
10
|
+
yarn add @recursica/mantine-adapter
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @recursica/mantine-adapter
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Peer Dependencies
|
|
16
|
+
|
|
17
|
+
This library requires the following peer dependencies to be installed in your project:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @mantine/core@>=8.0.0 @mantine/dates@>=8.0.0 @mantine/hooks@>=8.0.0 react@>=16.8.0 react-dom@>=16.8.0
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Important**: Make sure you have these exact versions or higher installed, as the components rely on Mantine 8+ features and React 16.8+ hooks.
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
_Components are currently being rebuilt. Documentation will be updated as new components are added._
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import React from "react";
|
|
31
|
+
// import { Button } from "@recursica/mantine-adapter";
|
|
32
|
+
|
|
33
|
+
function App() {
|
|
34
|
+
return (
|
|
35
|
+
// <Button label="Click Me" variant="solid" />
|
|
36
|
+
<div>More components coming soon!</div>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Development and Architecture
|
|
42
|
+
|
|
43
|
+
This project is built using:
|
|
44
|
+
|
|
45
|
+
- **Vite (Library Mode)**: For fast builds, producing optimized ES and CJS modules.
|
|
46
|
+
- **Mantine 8**: Base components, hooks, and native standard styling architecture.
|
|
47
|
+
- **Storybook**: Used heavily for interactive component development, documentation, and prototyping.
|
|
48
|
+
|
|
49
|
+
> **Note:** We do not use Vanilla Extract or PostCSS for this project, relying instead on Mantine's built-in CSS styling and Vite's native CSS/CSS Modules capabilities. No complex CSS-in-JS overhead!
|
|
50
|
+
|
|
51
|
+
## Storybook Documentation
|
|
52
|
+
|
|
53
|
+
This library includes Storybook for all components. You can:
|
|
54
|
+
|
|
55
|
+
- **View live examples** of components.
|
|
56
|
+
- **Test component interactions** and accessibility.
|
|
57
|
+
- **Explore UI tokens** and layout utilities.
|
|
58
|
+
|
|
59
|
+
### Accessing Storybook Locally
|
|
60
|
+
|
|
61
|
+
If you're contributing or developing locally, clone the repository and run:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm run storybook
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
This will spin up a local server (typically at `http://localhost:6006`) with a hot-reloading environment for component prototyping.
|
|
68
|
+
|
|
69
|
+
## TypeScript Support
|
|
70
|
+
|
|
71
|
+
All newly built components will include full TypeScript support with comprehensive prop types exported.
|
|
72
|
+
|
|
73
|
+
## Contributing
|
|
74
|
+
|
|
75
|
+
For development and contribution guidelines, see the [CONTRIBUTING.md](./CONTRIBUTING.md) file.
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),p=require("react"),b=require("@mantine/core"),E="Layer-module__root___uz07-",w="Layer-module__contents___A7K56",A={root:E,contents:w},N=p.forwardRef(function({layer:e,contentsOnly:o,children:n,className:c,style:t,...i},l){const m=o?c?`${A.root} ${A.contents} ${c}`:`${A.root} ${A.contents}`:c?`${A.root} ${c}`:A.root;return r.jsx("div",{ref:l,className:m,style:t,...o?{}:{"data-recursica-layer":String(e)},...i,children:n})});N.displayName="Layer";const I="Button-module__root___Q2R8-",D="Button-module__label___UJ3Zt",V="Button-module__labelText___rFV5p",z="Button-module__iconWrapper___uEKPa",q="Button-module__section___f2mKr",_={root:I,label:D,labelText:V,iconWrapper:z,section:q};function F(a){return a==null||a===""?!1:typeof a=="string"?a.trim()!=="":!0}const P=p.forwardRef(function({variant:e="solid",size:o="default",icon:n,className:c,classNames:t,children:i,style:l,...m},W){const R={solid:"filled",outline:"outline",text:"subtle"},B={default:"md",small:"sm"},y=m,v=!!n||!!y.leftSection,f=!!y.rightSection,d=(v||f)&&!F(i);typeof process<"u"&&process.env.NODE_ENV!=="production"&&d&&!y["aria-label"]&&console.warn('[Recursica Button] Icon-only buttons must provide an accessible name. Pass aria-label (e.g. aria-label="Submit").');const h={root:_.root,section:_.section,label:_.label};if(t&&typeof t=="object"&&!Array.isArray(t)){const g=t;h.root=g.root?`${_.root} ${g.root}`:_.root,h.section=g.section??_.section,h.label=g.label??_.label}return r.jsx(b.Button,{ref:W,className:c,classNames:h,variant:R[e],size:B[o],style:l,leftSection:n!=null?r.jsx("span",{className:_.iconWrapper,"aria-hidden":!0,children:n}):void 0,"data-variant":e,"data-size":o,...d?{"data-icon-only":""}:{},...m,children:r.jsx("span",{className:_.labelText,children:i})})});P.displayName="Button";const K="Accordion-module__root___Dem6d",M="Accordion-module__item___7ryVk",O="Accordion-module__noDivider___Ni2tT",H="Accordion-module__control___b4wgX",J="Accordion-module__label___Ss7uW",U="Accordion-module__chevron___i-HVZ",X="Accordion-module__iconLeftWrapper___5oLen",Z="Accordion-module__panel___Wx50w",G="Accordion-module__content___PEM9t",u={root:K,item:M,noDivider:O,control:H,label:J,chevron:U,iconLeftWrapper:X,panel:Z,content:G},T=function({className:e,classNames:o,variant:n="unstyled",...c}){const t={root:u.root,item:u.item,control:u.control,label:u.label,chevron:u.chevron,panel:u.panel,content:u.content};if(o&&typeof o=="object"&&!Array.isArray(o)){const i=o;Object.keys(i).forEach(l=>{t[l]?t[l]=`${t[l]} ${i[l]}`:t[l]=i[l]})}return r.jsx(b.Accordion,{variant:n,className:e,classNames:t,...c})};T.displayName="Accordion";const S=p.forwardRef(function({title:e,leftIcon:o,divider:n=!0,children:c,...t},i){return r.jsx(b.Accordion.Item,{ref:i,className:n?void 0:u.noDivider,...t,children:e?r.jsxs(r.Fragment,{children:[r.jsx(x,{leftIcon:o,children:e}),r.jsx($,{children:c})]}):c})});S.displayName="AccordionItem";const x=p.forwardRef(function({leftIcon:e,children:o,...n},c){return r.jsx(b.Accordion.Control,{ref:c,icon:e?r.jsx("span",{className:u.iconLeftWrapper,"aria-hidden":!0,children:e}):void 0,...n,children:o})});x.displayName="AccordionControl";const $=p.forwardRef(function(e,o){return r.jsx(b.Accordion.Panel,{ref:o,...e})});$.displayName="AccordionPanel";const j=T;j.Item=S;j.Control=x;j.Panel=$;const Q="Avatar-module__root___fXu-J",Y="Avatar-module__iconWrapper___ojly2",k="Avatar-module__textWrapper___zp-jD",oo="Avatar-module__image___ieqGp",eo="Avatar-module__placeholder___IDW7-",s={root:Q,iconWrapper:Y,textWrapper:k,image:oo,placeholder:eo},C=p.forwardRef(function({size:e="default",variant:o="solid",icon:n,className:c,classNames:t,children:i,style:l,src:m,...W},R){const B={solid:"filled",outline:"outline",ghost:"transparent"},y={default:"md",small:"sm",large:"lg"};let v="text";m?v="image":n&&(v="icon");const f={root:s.root,image:s.image,placeholder:s.placeholder};if(t&&typeof t=="object"&&!Array.isArray(t)){const d=t;f.root=d.root?`${s.root} ${d.root}`:s.root,f.image=d.image?`${s.image} ${d.image}`:s.image,f.placeholder=d.placeholder?`${s.placeholder} ${d.placeholder}`:s.placeholder}return r.jsx(b.Avatar,{ref:R,className:c,classNames:f,variant:B[o],size:y[e],style:l,src:m,"data-variant":o,"data-size":e,"data-style":v,...W,children:n!=null?r.jsx("span",{className:s.iconWrapper,"aria-hidden":!0,children:n}):i!=null?r.jsx("span",{className:s.textWrapper,children:i}):void 0})});C.displayName="Avatar";const L="data-recursica-theme";function to({children:a,theme:e="light"}){return p.useEffect(()=>{const o=document.documentElement;return o.setAttribute(L,e),()=>{o.removeAttribute(L)}},[e]),r.jsx(r.Fragment,{children:a})}exports.Accordion=j;exports.AccordionControl=x;exports.AccordionItem=S;exports.AccordionPanel=$;exports.Avatar=C;exports.Button=P;exports.Layer=N;exports.RecursicaThemeProvider=to;
|
|
2
|
+
//# sourceMappingURL=mantine-adapter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mantine-adapter.cjs","sources":["../src/components/Layer/Layer.tsx","../src/components/Button/Button.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Avatar/Avatar.tsx","../src/RecursicaThemeProvider/RecursicaThemeProvider.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport styles from \"./Layer.module.css\";\n\n/**\n * Recursica design-system props for Layer.\n * Sets data-recursica-layer so scoped CSS theme+layer blocks apply that layer's\n * generic brand vars (e.g. --recursica_brand_layer_N_properties_surface) to this element\n * and descendants. Theme is set on the document root (e.g. via RecursicaThemeProvider).\n * See recursica_variables_scoped.css header.\n */\nexport interface RecursicaLayerProps {\n /** Layer (0–3). Sets data-recursica-layer on the root so descendants use this layer's styles. */\n layer: 0 | 1 | 2 | 3;\n /**\n * When true, the root uses display: contents (no box, not styled) and data-recursica-layer\n * is omitted so Recursica layer styling is not applied. Children still participate in the cascade.\n */\n contentsOnly?: boolean;\n children?: React.ReactNode;\n}\n\nexport type LayerProps = RecursicaLayerProps &\n React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * Applies a Recursica layer context. Root has data-recursica-layer so scoped CSS\n * theme+layer blocks (e.g. [data-recursica-theme=\"light\"] [data-recursica-layer=\"1\"])\n * set generic brand vars on this element; descendants inherit. Use with theme on\n * document root (RecursicaThemeProvider). Root is display: block so padding/background apply.\n */\nexport const Layer = forwardRef<HTMLDivElement, LayerProps>(function Layer(\n { layer, contentsOnly, children, className, style, ...rest },\n ref,\n) {\n const rootClassName = contentsOnly\n ? className\n ? `${styles.root} ${styles.contents} ${className}`\n : `${styles.root} ${styles.contents}`\n : className\n ? `${styles.root} ${className}`\n : styles.root;\n return (\n <div\n ref={ref}\n className={rootClassName}\n style={style}\n {...(contentsOnly ? {} : { \"data-recursica-layer\": String(layer) })}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nLayer.displayName = \"Layer\";\n","import React, { forwardRef } from \"react\";\nimport {\n Button as MantineButton,\n type ButtonProps as MantineButtonProps,\n} from \"@mantine/core\";\nimport styles from \"./Button.module.css\";\n\nexport interface RecursicaButtonProps {\n variant?: \"solid\" | \"outline\" | \"text\";\n size?: \"default\" | \"small\";\n icon?: React.ReactNode;\n}\n\nexport type ButtonProps = Omit<\n MantineButtonProps,\n \"variant\" | \"size\" | \"leftSection\"\n> &\n RecursicaButtonProps;\n\nfunction hasVisibleChildren(children: React.ReactNode): boolean {\n if (children == null || children === \"\") return false;\n if (typeof children === \"string\") return children.trim() !== \"\";\n return true;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n variant = \"solid\",\n size = \"default\",\n icon,\n className,\n classNames,\n children,\n style,\n ...rest\n },\n ref,\n ) {\n const mapVariant = {\n solid: \"filled\",\n outline: \"outline\",\n text: \"subtle\",\n } as const;\n\n const mapSize = {\n default: \"md\",\n small: \"sm\",\n } as const;\n\n const restRecord = rest as Record<string, unknown>;\n const hasLeftSection = !!icon || !!restRecord[\"leftSection\"];\n const hasRightSection = !!restRecord[\"rightSection\"];\n const isIconOnly =\n (hasLeftSection || hasRightSection) && !hasVisibleChildren(children);\n\n if (\n typeof process !== \"undefined\" &&\n process.env.NODE_ENV !== \"production\" &&\n isIconOnly &&\n !restRecord[\"aria-label\"]\n ) {\n console.warn(\n '[Recursica Button] Icon-only buttons must provide an accessible name. Pass aria-label (e.g. aria-label=\"Submit\").',\n );\n }\n\n const mergedClassNames: Partial<Record<string, string>> = {\n root: styles.root,\n section: styles.section,\n label: styles.label,\n };\n if (\n classNames &&\n typeof classNames === \"object\" &&\n !Array.isArray(classNames)\n ) {\n const o = classNames as Partial<Record<string, string>>;\n mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;\n mergedClassNames.section = o.section ?? styles.section;\n mergedClassNames.label = o.label ?? styles.label;\n }\n\n return (\n <MantineButton\n ref={ref}\n className={className}\n classNames={mergedClassNames}\n variant={mapVariant[variant]}\n size={mapSize[size]}\n style={style}\n leftSection={\n icon != null ? (\n <span className={styles.iconWrapper} aria-hidden>\n {icon}\n </span>\n ) : undefined\n }\n data-variant={variant}\n data-size={size}\n {...(isIconOnly ? { \"data-icon-only\": \"\" } : {})}\n {...rest}\n >\n <span className={styles.labelText}>{children}</span>\n </MantineButton>\n );\n },\n);\n\nButton.displayName = \"Button\";\n","import React, { forwardRef } from \"react\";\nimport {\n Accordion as MantineAccordion,\n type AccordionProps as MantineAccordionProps,\n type AccordionItemProps,\n type AccordionControlProps,\n type AccordionPanelProps,\n} from \"@mantine/core\";\nimport styles from \"./Accordion.module.css\";\n\n// ==== ACCORDION CONTAINER ====\nexport type AccordionProps = MantineAccordionProps;\n\nconst AccordionBase = function Accordion({\n className,\n classNames,\n variant = \"unstyled\",\n ...rest\n}: AccordionProps) {\n // Bind all deep CSS module references natively into the global class mapping schema\n const mergedClassNames: Record<string, string> = {\n root: styles.root,\n item: styles.item,\n control: styles.control,\n label: styles.label,\n chevron: styles.chevron,\n panel: styles.panel,\n content: styles.content,\n };\n\n if (\n classNames &&\n typeof classNames === \"object\" &&\n !Array.isArray(classNames)\n ) {\n const o = classNames as Record<string, string>;\n Object.keys(o).forEach((key) => {\n if (mergedClassNames[key]) {\n mergedClassNames[key] = `${mergedClassNames[key]} ${o[key]}`;\n } else {\n mergedClassNames[key] = o[key];\n }\n });\n }\n\n return (\n <MantineAccordion\n variant={variant}\n className={className}\n classNames={mergedClassNames}\n {...rest}\n />\n );\n};\nAccordionBase.displayName = \"Accordion\";\n\n// ==== ACCORDION ITEM ====\nexport type RecursicaAccordionItemProps = AccordionItemProps & {\n /**\n * When provided alongside `leftIcon` or independently, this auto-generates the Accordion Control and Panel DOM layers natively.\n */\n title?: React.ReactNode;\n\n /**\n * Leading icon explicitly mapped into the Mantine `Accordion.Control` leftSection boundary natively.\n */\n leftIcon?: React.ReactNode;\n\n /**\n * Toggles the presence of the bottom trailing divider native to AccordionItems.\n * @default true\n */\n divider?: boolean;\n\n // Note on `open` property:\n // Recursica structurally maps an `open` property for active state tracking. However, Mantine inherently demands array-driven states\n // managed by the parent `<Accordion value=\"...\">` wrapper logic to accurately sequence expanding DOM animations. Attempting to force\n // an isolated `open` boolean natively corrupts Mantine's transition observers, so no `open` prop is directly preserved on this wrapper.\n};\n\nexport const AccordionItem = forwardRef<\n HTMLDivElement,\n RecursicaAccordionItemProps\n>(function AccordionItem(\n { title, leftIcon, divider = true, children, ...rest },\n ref,\n) {\n // If the user utilizes the explicit 'title' prop from Recursica, we securely auto-construct the Mantine sub-hierarchy natively!\n // If not, we defer to raw composable children (meaning the integrator maps `<Accordion.Control>` manually).\n return (\n <MantineAccordion.Item\n ref={ref}\n className={divider ? undefined : styles.noDivider}\n {...rest}\n >\n {title ? (\n <>\n <AccordionControl leftIcon={leftIcon}>{title}</AccordionControl>\n <AccordionPanel>{children}</AccordionPanel>\n </>\n ) : (\n children\n )}\n </MantineAccordion.Item>\n );\n});\nAccordionItem.displayName = \"AccordionItem\";\n\n// ==== ACCORDION CONTROL ====\nexport type RecursicaAccordionControlProps = AccordionControlProps & {\n /**\n * Leading icon explicitly mapped into the Mantine `Accordion.Control` leftSection boundary natively.\n */\n leftIcon?: React.ReactNode;\n};\n\nexport const AccordionControl = forwardRef<\n HTMLButtonElement,\n RecursicaAccordionControlProps\n>(function AccordionControl({ leftIcon, children, ...rest }, ref) {\n return (\n <MantineAccordion.Control\n ref={ref}\n icon={\n leftIcon ? (\n <span className={styles.iconLeftWrapper} aria-hidden>\n {leftIcon}\n </span>\n ) : undefined\n }\n {...rest}\n >\n {children}\n </MantineAccordion.Control>\n );\n});\nAccordionControl.displayName = \"AccordionControl\";\n\n// ==== ACCORDION PANEL ====\nexport const AccordionPanel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel(props, ref) {\n return <MantineAccordion.Panel ref={ref} {...props} />;\n },\n);\nAccordionPanel.displayName = \"AccordionPanel\";\n\n// ==== DOT NOTATION EXPORT ====\ntype AccordionComponent = typeof AccordionBase & {\n Item: typeof AccordionItem;\n Control: typeof AccordionControl;\n Panel: typeof AccordionPanel;\n};\n\nexport const Accordion = AccordionBase as AccordionComponent;\nAccordion.Item = AccordionItem;\nAccordion.Control = AccordionControl;\nAccordion.Panel = AccordionPanel;\n","import React, { forwardRef } from \"react\";\nimport {\n Avatar as MantineAvatar,\n type AvatarProps as MantineAvatarProps,\n} from \"@mantine/core\";\nimport styles from \"./Avatar.module.css\";\n\nexport interface RecursicaAvatarProps {\n size?: \"small\" | \"default\" | \"large\";\n variant?: \"solid\" | \"outline\" | \"ghost\";\n icon?: React.ReactNode;\n}\n\nexport type AvatarProps = Omit<\n MantineAvatarProps,\n \"variant\" | \"size\" | \"color\" | \"radius\"\n> &\n RecursicaAvatarProps;\n\nexport const Avatar = forwardRef<HTMLDivElement, AvatarProps>(function Avatar(\n {\n size = \"default\",\n variant = \"solid\",\n icon,\n className,\n classNames,\n children,\n style,\n src,\n ...rest\n },\n ref,\n) {\n const mapVariant = {\n solid: \"filled\",\n outline: \"outline\",\n ghost: \"transparent\",\n } as const;\n\n const mapSize = {\n default: \"md\",\n small: \"sm\",\n large: \"lg\",\n } as const;\n\n // Determine semantic style based on provided props\n let computedStyle = \"text\";\n if (src) {\n computedStyle = \"image\";\n } else if (icon) {\n computedStyle = \"icon\";\n }\n\n const mergedClassNames: Partial<Record<string, string>> = {\n root: styles.root,\n image: styles.image,\n placeholder: styles.placeholder,\n };\n\n if (\n classNames &&\n typeof classNames === \"object\" &&\n !Array.isArray(classNames)\n ) {\n const o = classNames as Partial<Record<string, string>>;\n mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;\n mergedClassNames.image = o.image\n ? `${styles.image} ${o.image}`\n : styles.image;\n mergedClassNames.placeholder = o.placeholder\n ? `${styles.placeholder} ${o.placeholder}`\n : styles.placeholder;\n }\n\n return (\n <MantineAvatar\n ref={ref}\n className={className}\n classNames={mergedClassNames}\n variant={mapVariant[variant]}\n size={mapSize[size]}\n style={style}\n src={src}\n data-variant={variant}\n data-size={size}\n data-style={computedStyle}\n {...rest}\n >\n {icon != null ? (\n <span className={styles.iconWrapper} aria-hidden>\n {icon}\n </span>\n ) : children != null ? (\n <span className={styles.textWrapper}>{children}</span>\n ) : undefined}\n </MantineAvatar>\n );\n});\n\nAvatar.displayName = \"Avatar\";\n","\"use client\";\n\nimport { useEffect } from \"react\";\n\nconst THEME_ATTRIBUTE = \"data-recursica-theme\";\n\nexport interface RecursicaThemeProviderProps {\n /** 'light' | 'dark'. Defaults to 'light' when omitted. */\n theme?: \"light\" | \"dark\";\n children: React.ReactNode;\n}\n\n/**\n * Sets data-recursica-theme on document.documentElement so Recursica scoped CSS\n * (e.g. recursica_variables_scoped.css) applies the correct theme and layer-0 variables.\n * Default is light theme.\n */\nexport function RecursicaThemeProvider({\n children,\n theme = \"light\",\n}: RecursicaThemeProviderProps) {\n useEffect(() => {\n const root = document.documentElement;\n root.setAttribute(THEME_ATTRIBUTE, theme);\n return () => {\n root.removeAttribute(THEME_ATTRIBUTE);\n };\n }, [theme]);\n\n return <>{children}</>;\n}\n"],"names":["Layer","forwardRef","layer","contentsOnly","children","className","style","rest","ref","rootClassName","styles","jsx","hasVisibleChildren","Button","variant","size","icon","classNames","mapVariant","mapSize","restRecord","hasLeftSection","hasRightSection","isIconOnly","mergedClassNames","o","MantineButton","AccordionBase","key","MantineAccordion","AccordionItem","title","leftIcon","divider","jsxs","Fragment","AccordionControl","AccordionPanel","props","Accordion","Avatar","src","computedStyle","MantineAvatar","THEME_ATTRIBUTE","RecursicaThemeProvider","theme","useEffect","root"],"mappings":"2PA8BaA,EAAQC,EAAAA,WAAuC,SAC1D,CAAE,MAAAC,EAAO,aAAAC,EAAc,SAAAC,EAAU,UAAAC,EAAW,MAAAC,EAAO,GAAGC,CAAA,EACtDC,EACA,CACA,MAAMC,EAAgBN,EAClBE,EACE,GAAGK,EAAO,IAAI,IAAIA,EAAO,QAAQ,IAAIL,CAAS,GAC9C,GAAGK,EAAO,IAAI,IAAIA,EAAO,QAAQ,GACnCL,EACE,GAAGK,EAAO,IAAI,IAAIL,CAAS,GAC3BK,EAAO,KACb,OACEC,EAAAA,IAAC,MAAA,CACC,IAAAH,EACA,UAAWC,EACX,MAAAH,EACC,GAAIH,EAAe,CAAA,EAAK,CAAE,uBAAwB,OAAOD,CAAK,CAAA,EAC9D,GAAGK,EAEH,SAAAH,CAAA,CAAA,CAGP,CAAC,EAEDJ,EAAM,YAAc,qPCnCpB,SAASY,EAAmBR,EAAoC,CAC9D,OAAIA,GAAY,MAAQA,IAAa,GAAW,GAC5C,OAAOA,GAAa,SAAiBA,EAAS,SAAW,GACtD,EACT,CAEO,MAAMS,EAASZ,EAAAA,WACpB,SACE,CACE,QAAAa,EAA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K,GAC1Bf,EAAO,MACXc,EAAiB,YAAcC,EAAE,YAC7B,GAAGf,EAAO,WAAW,IAAIe,EAAE,WAAW,GACtCf,EAAO,WACb,CAEA,OACEC,EAAAA,IAACgC,EAAAA,OAAA,CACC,IAAAnC,EACA,UAAAH,EACA,WAAYmB,EACZ,QAASN,EAAWJ,CAAO,EAC3B,KAAMK,EAAQJ,CAAI,EAClB,MAAAT,EACA,IAAAmC,EACA,eAAc3B,EACd,YAAWC,EACX,aAAY2B,EACX,GAAGnC,EAEH,YAAQ,KACPI,EAAAA,IAAC,QAAK,UAAWD,EAAO,YAAa,cAAW,GAC7C,WACH,EACEN,GAAY,KACdO,MAAC,OAAA,CAAK,UAAWD,EAAO,YAAc,SAAAN,EAAS,EAC7C,MAAA,CAAA,CAGV,CAAC,EAEDoC,EAAO,YAAc,SC/FrB,MAAMI,EAAkB,uBAajB,SAASC,GAAuB,CACrC,SAAAzC,EACA,MAAA0C,EAAQ,OACV,EAAgC,CAC9BC,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAO,SAAS,gBACtB,OAAAA,EAAK,aAAaJ,EAAiBE,CAAK,EACjC,IAAM,CACXE,EAAK,gBAAgBJ,CAAe,CACtC,CACF,EAAG,CAACE,CAAK,CAAC,oBAEA,SAAA1C,EAAS,CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Layer-module__root___uz07-{display:block;border-style:solid}.Layer-module__root___uz07-.Layer-module__contents___A7K56{display:contents;border-style:unset}.Layer-module__root___uz07-[data-recursica-layer="0"]{background-color:var(--recursica_brand_layer_0_properties_surface);color:var(--recursica_brand_layer_0_elements_text_color);border-color:var(--recursica_brand_layer_0_properties_border-color);border-width:var(--recursica_brand_layer_0_properties_border-size);border-radius:var(--recursica_brand_layer_0_properties_border-radius);box-shadow:var(--recursica_brand_layer_0_properties_elevation);padding:var(--recursica_brand_layer_0_properties_padding)}.Layer-module__root___uz07-[data-recursica-layer="1"]{background-color:var(--recursica_brand_layer_1_properties_surface);color:var(--recursica_brand_layer_1_elements_text_color);border-color:var(--recursica_brand_layer_1_properties_border-color);border-width:var(--recursica_brand_layer_1_properties_border-size);border-radius:var(--recursica_brand_layer_1_properties_border-radius);box-shadow:var(--recursica_brand_layer_1_properties_elevation);padding:var(--recursica_brand_layer_1_properties_padding)}.Layer-module__root___uz07-[data-recursica-layer="2"]{background-color:var(--recursica_brand_layer_2_properties_surface);color:var(--recursica_brand_layer_2_elements_text_color);border-color:var(--recursica_brand_layer_2_properties_border-color);border-width:var(--recursica_brand_layer_2_properties_border-size);border-radius:var(--recursica_brand_layer_2_properties_border-radius);box-shadow:var(--recursica_brand_layer_2_properties_elevation);padding:var(--recursica_brand_layer_2_properties_padding)}.Layer-module__root___uz07-[data-recursica-layer="3"]{background-color:var(--recursica_brand_layer_3_properties_surface);color:var(--recursica_brand_layer_3_elements_text_color);border-color:var(--recursica_brand_layer_3_properties_border-color);border-width:var(--recursica_brand_layer_3_properties_border-size);border-radius:var(--recursica_brand_layer_3_properties_border-radius);box-shadow:var(--recursica_brand_layer_3_properties_elevation);padding:var(--recursica_brand_layer_3_properties_padding)}.Button-module__root___Q2R8-{box-sizing:border-box;margin:0;border-style:solid;overflow:hidden;position:relative;transition:all .2s ease;font-family:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-family );font-size:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-size );font-style:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-style );font-weight:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-weight );letter-spacing:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_text_letter-spacing );line-height:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_text_line-height );text-decoration:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_text_text-decoration );text-transform:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_text_text-transform )}.Button-module__root___Q2R8->*{min-width:0;width:100%;position:relative;z-index:1}.Button-module__label___UJ3Zt{display:flex;align-items:center;min-width:0;flex:1 1 0}.Button-module__labelText___rFV5p{display:block;min-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:inherit;line-height:inherit}.Button-module__root___Q2R8-[data-size=default]{border-radius:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_border-radius );height:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_height );min-width:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_min-width );max-width:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_max-width );padding:0 var( --recursica_ui-kit_components_button_variants_sizes_default_properties_horizontal-padding )}.Button-module__root___Q2R8-[data-size=small]{border-radius:var( --recursica_ui-kit_components_button_variants_sizes_small_properties_border-radius );height:var( --recursica_ui-kit_components_button_variants_sizes_small_properties_height );min-width:var( --recursica_ui-kit_components_button_variants_sizes_small_properties_min-width );max-width:var( --recursica_ui-kit_components_button_variants_sizes_small_properties_max-width );padding:0 var( --recursica_ui-kit_components_button_variants_sizes_small_properties_horizontal-padding );font-family:var( --recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-family, var( --recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-family ) );font-size:var( --recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-size, var( --recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-size ) );font-weight:var( --recursica_ui-kit_components_button_variants_sizes_small_properties_text_font-weight, var( --recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-weight ) )}.Button-module__iconWrapper___uEKPa{display:flex;align-items:center;justify-content:center;flex-shrink:0}.Button-module__iconWrapper___uEKPa>*{width:100%;height:100%;object-fit:contain}.Button-module__root___Q2R8-[data-size=default] .Button-module__iconWrapper___uEKPa{width:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_icon );height:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_icon )}.Button-module__root___Q2R8-[data-size=small] .Button-module__iconWrapper___uEKPa{width:var( --recursica_ui-kit_components_button_variants_sizes_small_properties_icon );height:var( --recursica_ui-kit_components_button_variants_sizes_small_properties_icon )}.Button-module__section___f2mKr{min-width:0}.Button-module__root___Q2R8-[data-size=default] .Button-module__section___f2mKr{gap:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_icon-text-gap )}.Button-module__root___Q2R8-[data-size=small] .Button-module__section___f2mKr{gap:var( --recursica_ui-kit_components_button_variants_sizes_small_properties_icon-text-gap )}.Button-module__root___Q2R8-[data-icon-only] .Button-module__section___f2mKr{gap:0}.Button-module__root___Q2R8-[data-icon-only] .Button-module__section___f2mKr[data-position=left]{margin-inline-end:0}.Button-module__root___Q2R8-[data-icon-only] .Button-module__section___f2mKr[data-position=right]{margin-inline-start:0}.Button-module__root___Q2R8-:disabled{opacity:var(--recursica_brand_states_disabled);cursor:not-allowed}.Button-module__root___Q2R8-:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;z-index:0;pointer-events:none;transition:opacity .15s ease;opacity:0}.Button-module__root___Q2R8-[data-size=default]:after{background-color:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_hover-color )}.Button-module__root___Q2R8-[data-size=small]:after{background-color:var( --recursica_ui-kit_components_button_variants_sizes_small_properties_hover-color )}.Button-module__root___Q2R8-:hover:not(:disabled):after{opacity:var( --recursica_ui-kit_components_button_variants_sizes_default_properties_hover-opacity, .1 )}.Button-module__root___Q2R8-[data-variant=solid]{border-width:var( --recursica_ui-kit_components_button_variants_styles_solid_properties_border-size );box-shadow:var( --recursica_ui-kit_components_button_variants_styles_solid_properties_elevation );background-color:var( --recursica_ui-kit_components_button_variants_styles_solid_properties_colors_background );border-color:var( --recursica_ui-kit_components_button_variants_styles_solid_properties_colors_border-color );color:var( --recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text )}.Button-module__root___Q2R8-[data-variant=solid]:hover:not(:disabled){color:var( --recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text-hover )}.Button-module__root___Q2R8-[data-variant=outline]{border-width:var( --recursica_ui-kit_components_button_variants_styles_outline_properties_border-size );box-shadow:var( --recursica_ui-kit_components_button_variants_styles_outline_properties_elevation );background-color:var( --recursica_ui-kit_components_button_variants_styles_outline_properties_colors_background );border-color:var( --recursica_ui-kit_components_button_variants_styles_outline_properties_colors_border-color );color:var( --recursica_ui-kit_components_button_variants_styles_outline_properties_colors_text )}.Button-module__root___Q2R8-[data-variant=outline]:hover:not(:disabled){color:var( --recursica_ui-kit_components_button_variants_styles_outline_properties_colors_text-hover )}.Button-module__root___Q2R8-[data-variant=text]{border-width:var( --recursica_ui-kit_components_button_variants_styles_text_properties_border-size );box-shadow:var( --recursica_ui-kit_components_button_variants_styles_text_properties_elevation );background-color:var( --recursica_ui-kit_components_button_variants_styles_text_properties_colors_background );border-color:var( --recursica_ui-kit_components_button_variants_styles_text_properties_colors_border-color );color:var( --recursica_ui-kit_components_button_variants_styles_text_properties_colors_text )}.Button-module__root___Q2R8-[data-variant=text]:hover:not(:disabled){color:var( --recursica_ui-kit_components_button_variants_styles_text_properties_colors_text-hover )}.Accordion-module__root___Dem6d{box-sizing:border-box;margin:0;display:flex;flex-direction:column;border-style:solid;border-width:var( --recursica_ui-kit_components_accordion_properties_border-size );border-radius:var( --recursica_ui-kit_components_accordion_properties_border-radius );border-color:var( --recursica_ui-kit_components_accordion_properties_colors_border-color );background-color:var( --recursica_ui-kit_components_accordion_properties_colors_background );box-shadow:var(--recursica_ui-kit_components_accordion_properties_elevation);max-width:var(--recursica_ui-kit_components_accordion_properties_max-width);min-width:var(--recursica_ui-kit_components_accordion_properties_min-width);padding:var(--recursica_ui-kit_components_accordion_properties_padding);gap:var(--recursica_ui-kit_components_accordion_properties_item-gap)}.Accordion-module__item___7ryVk{box-sizing:border-box;margin:0;position:relative;transition:all .2s ease;border-bottom:none;border-style:solid;border-color:var( --recursica_ui-kit_components_accordion-item_properties_colors_divider );border-width:var( --recursica_ui-kit_components_accordion-item_properties_divider-size );border-radius:var( --recursica_ui-kit_components_accordion-item_properties_border-radius );box-shadow:var( --recursica_ui-kit_components_accordion-item_properties_elevation );background-color:var( --recursica_ui-kit_components_accordion-item_properties_colors_background-collapsed )}.Accordion-module__item___7ryVk[data-active]{background-color:var( --recursica_ui-kit_components_accordion-item_properties_colors_background-expanded )}.Accordion-module__noDivider___Ni2tT{border-bottom:none!important;border-bottom-width:0!important}.Accordion-module__control___b4wgX{box-sizing:border-box;width:100%;display:flex;align-items:center;justify-content:space-between;gap:var(--recursica_ui-kit_components_accordion-item_properties_icon-gap);padding:var( --recursica_ui-kit_components_accordion-item_properties_padding-vertical ) var( --recursica_ui-kit_components_accordion-item_properties_padding-horizontal );background-color:transparent;transition:background-color .15s ease;position:relative;z-index:1;color:var( --recursica_ui-kit_components_accordion-item_properties_colors_text );font-family:var( --recursica_ui-kit_components_accordion-item_properties_header-text_font-family );font-size:var( --recursica_ui-kit_components_accordion-item_properties_header-text_font-size );font-weight:var( --recursica_ui-kit_components_accordion-item_properties_header-text_font-weight );font-style:var( --recursica_ui-kit_components_accordion-item_properties_header-text_font-style );letter-spacing:var( --recursica_ui-kit_components_accordion-item_properties_header-text_letter-spacing );line-height:var( --recursica_ui-kit_components_accordion-item_properties_header-text_line-height );text-decoration:var( --recursica_ui-kit_components_accordion-item_properties_header-text_text-decoration );text-transform:var( --recursica_ui-kit_components_accordion-item_properties_header-text_text-transform )}.Accordion-module__control___b4wgX:hover{background-color:transparent}.Accordion-module__control___b4wgX:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;z-index:-1;pointer-events:none;background-color:var( --recursica_ui-kit_components_accordion-item_properties_hover-color );opacity:0;transition:opacity .15s ease}.Accordion-module__control___b4wgX:hover:not(:disabled):after{opacity:var( --recursica_ui-kit_components_accordion-item_properties_hover-opacity, .1 )}.Accordion-module__label___Ss7uW{flex:1;text-align:left;color:inherit;padding:0}.Accordion-module__chevron___i-HVZ{flex-shrink:0;width:var( --recursica_ui-kit_components_accordion-item_properties_icon-right-size );height:var( --recursica_ui-kit_components_accordion-item_properties_icon-right-size );color:var( --recursica_ui-kit_components_accordion-item_properties_colors_icon );margin:0;transition:transform .2s ease;display:flex;align-items:center;justify-content:center}.Accordion-module__chevron___i-HVZ>*{width:100%;height:100%;object-fit:contain}.Accordion-module__item___7ryVk[data-active] .Accordion-module__chevron___i-HVZ{transform:rotate(180deg)}.Accordion-module__iconLeftWrapper___5oLen{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:var( --recursica_ui-kit_components_accordion-item_properties_icon-left-size );height:var( --recursica_ui-kit_components_accordion-item_properties_icon-left-size );color:var( --recursica_ui-kit_components_accordion-item_properties_colors_icon )}.Accordion-module__iconLeftWrapper___5oLen>*{width:100%;height:100%;object-fit:contain}.Accordion-module__panel___Wx50w{box-sizing:border-box;margin:0;padding:0;background-color:var( --recursica_ui-kit_components_accordion-item_properties_colors_content-background )}.Accordion-module__content___PEM9t{box-sizing:border-box;padding:0 var( --recursica_ui-kit_components_accordion-item_properties_padding-horizontal ) var( --recursica_ui-kit_components_accordion-item_properties_content-bottom-padding );padding-top:var( --recursica_ui-kit_components_accordion-item_properties_header-content-gap );color:var( --recursica_ui-kit_components_accordion-item_properties_colors_content-text );font-family:var( --recursica_ui-kit_components_accordion-item_properties_content-text_font-family );font-size:var( --recursica_ui-kit_components_accordion-item_properties_content-text_font-size );font-weight:var( --recursica_ui-kit_components_accordion-item_properties_content-text_font-weight );font-style:var( --recursica_ui-kit_components_accordion-item_properties_content-text_font-style );letter-spacing:var( --recursica_ui-kit_components_accordion-item_properties_content-text_letter-spacing );line-height:var( --recursica_ui-kit_components_accordion-item_properties_content-text_line-height );text-decoration:var( --recursica_ui-kit_components_accordion-item_properties_content-text_text-decoration );text-transform:var( --recursica_ui-kit_components_accordion-item_properties_content-text_text-transform )}.Avatar-module__root___fXu-J{box-sizing:border-box;margin:0;border-style:solid;overflow:hidden;position:relative;transition:all .2s ease;--avatar-bd: none;--avatar-bg: transparent;--avatar-color: inherit}.Avatar-module__root___fXu-J[data-size=small]{width:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_width );height:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_height );border-width:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_border-size )}.Avatar-module__root___fXu-J[data-size=small] .Avatar-module__iconWrapper___ojly2{width:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_icon-size );height:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_icon-size )}.Avatar-module__root___fXu-J[data-size=small] .Avatar-module__textWrapper___zp-jD{font-family:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_font-family );font-size:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_font-size );font-style:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_font-style );font-weight:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_font-weight );letter-spacing:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_letter-spacing );line-height:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_line-height );text-decoration:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_text-decoration );text-transform:var( --recursica_ui-kit_components_avatar_variants_sizes_small_properties_text_text-transform )}.Avatar-module__root___fXu-J[data-size=default]{width:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_width );height:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_height );border-width:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_border-size )}.Avatar-module__root___fXu-J[data-size=default] .Avatar-module__iconWrapper___ojly2{width:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_icon-size );height:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_icon-size )}.Avatar-module__root___fXu-J[data-size=default] .Avatar-module__textWrapper___zp-jD{font-family:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_font-family );font-size:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_font-size );font-style:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_font-style );font-weight:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_font-weight );letter-spacing:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_letter-spacing );line-height:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_line-height );text-decoration:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_text-decoration );text-transform:var( --recursica_ui-kit_components_avatar_variants_sizes_default_properties_text_text-transform )}.Avatar-module__root___fXu-J[data-size=large]{width:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_width );height:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_height );border-width:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_border-size )}.Avatar-module__root___fXu-J[data-size=large] .Avatar-module__iconWrapper___ojly2{width:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_icon-size );height:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_icon-size )}.Avatar-module__root___fXu-J[data-size=large] .Avatar-module__textWrapper___zp-jD{font-family:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_font-family );font-size:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_font-size );font-style:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_font-style );font-weight:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_font-weight );letter-spacing:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_letter-spacing );line-height:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_line-height );text-decoration:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_text-decoration );text-transform:var( --recursica_ui-kit_components_avatar_variants_sizes_large_properties_text_text-transform )}.Avatar-module__root___fXu-J[data-style=image]{border-radius:var( --recursica_ui-kit_components_avatar_variants_styles_image_properties_border-radius );border-width:var( --recursica_ui-kit_components_avatar_variants_styles_image_properties_border-size );padding:var( --recursica_ui-kit_components_avatar_variants_styles_image_properties_padding );background-color:transparent;border-color:transparent}.Avatar-module__image___ieqGp{object-fit:cover;width:100%;height:100%}.Avatar-module__placeholder___IDW7-{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:inherit;background-color:transparent}.Avatar-module__iconWrapper___ojly2{display:flex;align-items:center;justify-content:center;flex-shrink:0}.Avatar-module__iconWrapper___ojly2>*{width:100%;height:100%;object-fit:contain}.Avatar-module__textWrapper___zp-jD{display:inline-flex;align-items:center;justify-content:center}.Avatar-module__root___fXu-J[data-style=icon]{border-radius:var( --recursica_ui-kit_components_avatar_variants_styles_icon_properties_border-radius );padding:var( --recursica_ui-kit_components_avatar_variants_styles_icon_properties_padding )}.Avatar-module__root___fXu-J[data-style=icon][data-variant=solid]{border-width:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_solid_properties_border-size );background-color:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_solid_properties_colors_background );border-color:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_solid_properties_colors_border-color );color:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_solid_properties_colors_icon-color, var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_solid_properties_colors_text-color ) )}.Avatar-module__root___fXu-J[data-style=icon][data-variant=outline]{border-width:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_outline_properties_border-size );background-color:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_outline_properties_colors_background );border-color:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_outline_properties_colors_border-color );color:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_outline_properties_colors_icon-color, var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_outline_properties_colors_text-color ) )}.Avatar-module__root___fXu-J[data-style=icon][data-variant=ghost]{border-width:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_ghost_properties_border-size );background-color:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_ghost_properties_colors_background );border-color:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_ghost_properties_colors_border-color );color:var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_ghost_properties_colors_icon-color, var( --recursica_ui-kit_components_avatar_variants_styles_icon_variants_ghost_properties_colors_text-color ) )}.Avatar-module__root___fXu-J[data-style=text]{border-radius:var( --recursica_ui-kit_components_avatar_variants_styles_text_properties_border-radius );padding:var( --recursica_ui-kit_components_avatar_variants_styles_text_properties_padding )}.Avatar-module__root___fXu-J[data-style=text][data-variant=solid]{border-width:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_solid_properties_border-size );background-color:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_solid_properties_colors_background );border-color:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_solid_properties_colors_border-color );color:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_solid_properties_colors_text-color )}.Avatar-module__root___fXu-J[data-style=text][data-variant=outline]{border-width:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_outline_properties_border-size );background-color:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_outline_properties_colors_background );border-color:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_outline_properties_colors_border-color );color:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_outline_properties_colors_text-color )}.Avatar-module__root___fXu-J[data-style=text][data-variant=ghost]{border-width:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_ghost_properties_border-size );background-color:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_ghost_properties_colors_background );border-color:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_ghost_properties_colors_border-color );color:var( --recursica_ui-kit_components_avatar_variants_styles_text_variants_ghost_properties_colors_text-color )}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { jsx as a, jsxs as P, Fragment as C } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as A, useEffect as j } from "react";
|
|
3
|
+
import { Button as D, Accordion as $, Avatar as I } from "@mantine/core";
|
|
4
|
+
const R = "Layer-module__root___uz07-", V = "Layer-module__contents___A7K56", f = {
|
|
5
|
+
root: R,
|
|
6
|
+
contents: V
|
|
7
|
+
}, z = A(function({ layer: t, contentsOnly: o, children: n, className: r, style: e, ...l }, i) {
|
|
8
|
+
const m = o ? r ? `${f.root} ${f.contents} ${r}` : `${f.root} ${f.contents}` : r ? `${f.root} ${r}` : f.root;
|
|
9
|
+
return /* @__PURE__ */ a(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
ref: i,
|
|
13
|
+
className: m,
|
|
14
|
+
style: e,
|
|
15
|
+
...o ? {} : { "data-recursica-layer": String(t) },
|
|
16
|
+
...l,
|
|
17
|
+
children: n
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
z.displayName = "Layer";
|
|
22
|
+
const w = "Button-module__root___Q2R8-", K = "Button-module__label___UJ3Zt", F = "Button-module__labelText___rFV5p", H = "Button-module__iconWrapper___uEKPa", J = "Button-module__section___f2mKr", _ = {
|
|
23
|
+
root: w,
|
|
24
|
+
label: K,
|
|
25
|
+
labelText: F,
|
|
26
|
+
iconWrapper: H,
|
|
27
|
+
section: J
|
|
28
|
+
};
|
|
29
|
+
function M(c) {
|
|
30
|
+
return c == null || c === "" ? !1 : typeof c == "string" ? c.trim() !== "" : !0;
|
|
31
|
+
}
|
|
32
|
+
const O = A(
|
|
33
|
+
function({
|
|
34
|
+
variant: t = "solid",
|
|
35
|
+
size: o = "default",
|
|
36
|
+
icon: n,
|
|
37
|
+
className: r,
|
|
38
|
+
classNames: e,
|
|
39
|
+
children: l,
|
|
40
|
+
style: i,
|
|
41
|
+
...m
|
|
42
|
+
}, g) {
|
|
43
|
+
const W = {
|
|
44
|
+
solid: "filled",
|
|
45
|
+
outline: "outline",
|
|
46
|
+
text: "subtle"
|
|
47
|
+
}, x = {
|
|
48
|
+
default: "md",
|
|
49
|
+
small: "sm"
|
|
50
|
+
}, b = m, y = !!n || !!b.leftSection, p = !!b.rightSection, d = (y || p) && !M(l);
|
|
51
|
+
typeof process < "u" && process.env.NODE_ENV !== "production" && d && !b["aria-label"] && console.warn(
|
|
52
|
+
'[Recursica Button] Icon-only buttons must provide an accessible name. Pass aria-label (e.g. aria-label="Submit").'
|
|
53
|
+
);
|
|
54
|
+
const h = {
|
|
55
|
+
root: _.root,
|
|
56
|
+
section: _.section,
|
|
57
|
+
label: _.label
|
|
58
|
+
};
|
|
59
|
+
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
60
|
+
const v = e;
|
|
61
|
+
h.root = v.root ? `${_.root} ${v.root}` : _.root, h.section = v.section ?? _.section, h.label = v.label ?? _.label;
|
|
62
|
+
}
|
|
63
|
+
return /* @__PURE__ */ a(
|
|
64
|
+
D,
|
|
65
|
+
{
|
|
66
|
+
ref: g,
|
|
67
|
+
className: r,
|
|
68
|
+
classNames: h,
|
|
69
|
+
variant: W[t],
|
|
70
|
+
size: x[o],
|
|
71
|
+
style: i,
|
|
72
|
+
leftSection: n != null ? /* @__PURE__ */ a("span", { className: _.iconWrapper, "aria-hidden": !0, children: n }) : void 0,
|
|
73
|
+
"data-variant": t,
|
|
74
|
+
"data-size": o,
|
|
75
|
+
...d ? { "data-icon-only": "" } : {},
|
|
76
|
+
...m,
|
|
77
|
+
children: /* @__PURE__ */ a("span", { className: _.labelText, children: l })
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
O.displayName = "Button";
|
|
83
|
+
const U = "Accordion-module__root___Dem6d", X = "Accordion-module__item___7ryVk", Z = "Accordion-module__noDivider___Ni2tT", q = "Accordion-module__control___b4wgX", G = "Accordion-module__label___Ss7uW", Q = "Accordion-module__chevron___i-HVZ", Y = "Accordion-module__iconLeftWrapper___5oLen", k = "Accordion-module__panel___Wx50w", oo = "Accordion-module__content___PEM9t", u = {
|
|
84
|
+
root: U,
|
|
85
|
+
item: X,
|
|
86
|
+
noDivider: Z,
|
|
87
|
+
control: q,
|
|
88
|
+
label: G,
|
|
89
|
+
chevron: Q,
|
|
90
|
+
iconLeftWrapper: Y,
|
|
91
|
+
panel: k,
|
|
92
|
+
content: oo
|
|
93
|
+
}, E = function({
|
|
94
|
+
className: t,
|
|
95
|
+
classNames: o,
|
|
96
|
+
variant: n = "unstyled",
|
|
97
|
+
...r
|
|
98
|
+
}) {
|
|
99
|
+
const e = {
|
|
100
|
+
root: u.root,
|
|
101
|
+
item: u.item,
|
|
102
|
+
control: u.control,
|
|
103
|
+
label: u.label,
|
|
104
|
+
chevron: u.chevron,
|
|
105
|
+
panel: u.panel,
|
|
106
|
+
content: u.content
|
|
107
|
+
};
|
|
108
|
+
if (o && typeof o == "object" && !Array.isArray(o)) {
|
|
109
|
+
const l = o;
|
|
110
|
+
Object.keys(l).forEach((i) => {
|
|
111
|
+
e[i] ? e[i] = `${e[i]} ${l[i]}` : e[i] = l[i];
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return /* @__PURE__ */ a(
|
|
115
|
+
$,
|
|
116
|
+
{
|
|
117
|
+
variant: n,
|
|
118
|
+
className: t,
|
|
119
|
+
classNames: e,
|
|
120
|
+
...r
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
E.displayName = "Accordion";
|
|
125
|
+
const T = A(function({ title: t, leftIcon: o, divider: n = !0, children: r, ...e }, l) {
|
|
126
|
+
return /* @__PURE__ */ a(
|
|
127
|
+
$.Item,
|
|
128
|
+
{
|
|
129
|
+
ref: l,
|
|
130
|
+
className: n ? void 0 : u.noDivider,
|
|
131
|
+
...e,
|
|
132
|
+
children: t ? /* @__PURE__ */ P(C, { children: [
|
|
133
|
+
/* @__PURE__ */ a(B, { leftIcon: o, children: t }),
|
|
134
|
+
/* @__PURE__ */ a(N, { children: r })
|
|
135
|
+
] }) : r
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
});
|
|
139
|
+
T.displayName = "AccordionItem";
|
|
140
|
+
const B = A(function({ leftIcon: t, children: o, ...n }, r) {
|
|
141
|
+
return /* @__PURE__ */ a(
|
|
142
|
+
$.Control,
|
|
143
|
+
{
|
|
144
|
+
ref: r,
|
|
145
|
+
icon: t ? /* @__PURE__ */ a("span", { className: u.iconLeftWrapper, "aria-hidden": !0, children: t }) : void 0,
|
|
146
|
+
...n,
|
|
147
|
+
children: o
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
});
|
|
151
|
+
B.displayName = "AccordionControl";
|
|
152
|
+
const N = A(
|
|
153
|
+
function(t, o) {
|
|
154
|
+
return /* @__PURE__ */ a($.Panel, { ref: o, ...t });
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
N.displayName = "AccordionPanel";
|
|
158
|
+
const L = E;
|
|
159
|
+
L.Item = T;
|
|
160
|
+
L.Control = B;
|
|
161
|
+
L.Panel = N;
|
|
162
|
+
const to = "Avatar-module__root___fXu-J", eo = "Avatar-module__iconWrapper___ojly2", no = "Avatar-module__textWrapper___zp-jD", ro = "Avatar-module__image___ieqGp", ao = "Avatar-module__placeholder___IDW7-", s = {
|
|
163
|
+
root: to,
|
|
164
|
+
iconWrapper: eo,
|
|
165
|
+
textWrapper: no,
|
|
166
|
+
image: ro,
|
|
167
|
+
placeholder: ao
|
|
168
|
+
}, co = A(function({
|
|
169
|
+
size: t = "default",
|
|
170
|
+
variant: o = "solid",
|
|
171
|
+
icon: n,
|
|
172
|
+
className: r,
|
|
173
|
+
classNames: e,
|
|
174
|
+
children: l,
|
|
175
|
+
style: i,
|
|
176
|
+
src: m,
|
|
177
|
+
...g
|
|
178
|
+
}, W) {
|
|
179
|
+
const x = {
|
|
180
|
+
solid: "filled",
|
|
181
|
+
outline: "outline",
|
|
182
|
+
ghost: "transparent"
|
|
183
|
+
}, b = {
|
|
184
|
+
default: "md",
|
|
185
|
+
small: "sm",
|
|
186
|
+
large: "lg"
|
|
187
|
+
};
|
|
188
|
+
let y = "text";
|
|
189
|
+
m ? y = "image" : n && (y = "icon");
|
|
190
|
+
const p = {
|
|
191
|
+
root: s.root,
|
|
192
|
+
image: s.image,
|
|
193
|
+
placeholder: s.placeholder
|
|
194
|
+
};
|
|
195
|
+
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
196
|
+
const d = e;
|
|
197
|
+
p.root = d.root ? `${s.root} ${d.root}` : s.root, p.image = d.image ? `${s.image} ${d.image}` : s.image, p.placeholder = d.placeholder ? `${s.placeholder} ${d.placeholder}` : s.placeholder;
|
|
198
|
+
}
|
|
199
|
+
return /* @__PURE__ */ a(
|
|
200
|
+
I,
|
|
201
|
+
{
|
|
202
|
+
ref: W,
|
|
203
|
+
className: r,
|
|
204
|
+
classNames: p,
|
|
205
|
+
variant: x[o],
|
|
206
|
+
size: b[t],
|
|
207
|
+
style: i,
|
|
208
|
+
src: m,
|
|
209
|
+
"data-variant": o,
|
|
210
|
+
"data-size": t,
|
|
211
|
+
"data-style": y,
|
|
212
|
+
...g,
|
|
213
|
+
children: n != null ? /* @__PURE__ */ a("span", { className: s.iconWrapper, "aria-hidden": !0, children: n }) : l != null ? /* @__PURE__ */ a("span", { className: s.textWrapper, children: l }) : void 0
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
});
|
|
217
|
+
co.displayName = "Avatar";
|
|
218
|
+
const S = "data-recursica-theme";
|
|
219
|
+
function _o({
|
|
220
|
+
children: c,
|
|
221
|
+
theme: t = "light"
|
|
222
|
+
}) {
|
|
223
|
+
return j(() => {
|
|
224
|
+
const o = document.documentElement;
|
|
225
|
+
return o.setAttribute(S, t), () => {
|
|
226
|
+
o.removeAttribute(S);
|
|
227
|
+
};
|
|
228
|
+
}, [t]), /* @__PURE__ */ a(C, { children: c });
|
|
229
|
+
}
|
|
230
|
+
export {
|
|
231
|
+
L as Accordion,
|
|
232
|
+
B as AccordionControl,
|
|
233
|
+
T as AccordionItem,
|
|
234
|
+
N as AccordionPanel,
|
|
235
|
+
co as Avatar,
|
|
236
|
+
O as Button,
|
|
237
|
+
z as Layer,
|
|
238
|
+
_o as RecursicaThemeProvider
|
|
239
|
+
};
|
|
240
|
+
//# sourceMappingURL=mantine-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mantine-adapter.js","sources":["../src/components/Layer/Layer.tsx","../src/components/Button/Button.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Avatar/Avatar.tsx","../src/RecursicaThemeProvider/RecursicaThemeProvider.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport styles from \"./Layer.module.css\";\n\n/**\n * Recursica design-system props for Layer.\n * Sets data-recursica-layer so scoped CSS theme+layer blocks apply that layer's\n * generic brand vars (e.g. --recursica_brand_layer_N_properties_surface) to this element\n * and descendants. Theme is set on the document root (e.g. via RecursicaThemeProvider).\n * See recursica_variables_scoped.css header.\n */\nexport interface RecursicaLayerProps {\n /** Layer (0–3). Sets data-recursica-layer on the root so descendants use this layer's styles. */\n layer: 0 | 1 | 2 | 3;\n /**\n * When true, the root uses display: contents (no box, not styled) and data-recursica-layer\n * is omitted so Recursica layer styling is not applied. Children still participate in the cascade.\n */\n contentsOnly?: boolean;\n children?: React.ReactNode;\n}\n\nexport type LayerProps = RecursicaLayerProps &\n React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * Applies a Recursica layer context. Root has data-recursica-layer so scoped CSS\n * theme+layer blocks (e.g. [data-recursica-theme=\"light\"] [data-recursica-layer=\"1\"])\n * set generic brand vars on this element; descendants inherit. Use with theme on\n * document root (RecursicaThemeProvider). Root is display: block so padding/background apply.\n */\nexport const Layer = forwardRef<HTMLDivElement, LayerProps>(function Layer(\n { layer, contentsOnly, children, className, style, ...rest },\n ref,\n) {\n const rootClassName = contentsOnly\n ? className\n ? `${styles.root} ${styles.contents} ${className}`\n : `${styles.root} ${styles.contents}`\n : className\n ? `${styles.root} ${className}`\n : styles.root;\n return (\n <div\n ref={ref}\n className={rootClassName}\n style={style}\n {...(contentsOnly ? {} : { \"data-recursica-layer\": String(layer) })}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nLayer.displayName = \"Layer\";\n","import React, { forwardRef } from \"react\";\nimport {\n Button as MantineButton,\n type ButtonProps as MantineButtonProps,\n} from \"@mantine/core\";\nimport styles from \"./Button.module.css\";\n\nexport interface RecursicaButtonProps {\n variant?: \"solid\" | \"outline\" | \"text\";\n size?: \"default\" | \"small\";\n icon?: React.ReactNode;\n}\n\nexport type ButtonProps = Omit<\n MantineButtonProps,\n \"variant\" | \"size\" | \"leftSection\"\n> &\n RecursicaButtonProps;\n\nfunction hasVisibleChildren(children: React.ReactNode): boolean {\n if (children == null || children === \"\") return false;\n if (typeof children === \"string\") return children.trim() !== \"\";\n return true;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n variant = \"solid\",\n size = \"default\",\n icon,\n className,\n classNames,\n children,\n style,\n ...rest\n },\n ref,\n ) {\n const mapVariant = {\n solid: \"filled\",\n outline: \"outline\",\n text: \"subtle\",\n } as const;\n\n const mapSize = {\n default: \"md\",\n small: \"sm\",\n } as const;\n\n const restRecord = rest as Record<string, unknown>;\n const hasLeftSection = !!icon || !!restRecord[\"leftSection\"];\n const hasRightSection = !!restRecord[\"rightSection\"];\n const isIconOnly =\n (hasLeftSection || hasRightSection) && !hasVisibleChildren(children);\n\n if (\n typeof process !== \"undefined\" &&\n process.env.NODE_ENV !== \"production\" &&\n isIconOnly &&\n !restRecord[\"aria-label\"]\n ) {\n console.warn(\n '[Recursica Button] Icon-only buttons must provide an accessible name. Pass aria-label (e.g. aria-label=\"Submit\").',\n );\n }\n\n const mergedClassNames: Partial<Record<string, string>> = {\n root: styles.root,\n section: styles.section,\n label: styles.label,\n };\n if (\n classNames &&\n typeof classNames === \"object\" &&\n !Array.isArray(classNames)\n ) {\n const o = classNames as Partial<Record<string, string>>;\n mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;\n mergedClassNames.section = o.section ?? styles.section;\n mergedClassNames.label = o.label ?? styles.label;\n }\n\n return (\n <MantineButton\n ref={ref}\n className={className}\n classNames={mergedClassNames}\n variant={mapVariant[variant]}\n size={mapSize[size]}\n style={style}\n leftSection={\n icon != null ? (\n <span className={styles.iconWrapper} aria-hidden>\n {icon}\n </span>\n ) : undefined\n }\n data-variant={variant}\n data-size={size}\n {...(isIconOnly ? { \"data-icon-only\": \"\" } : {})}\n {...rest}\n >\n <span className={styles.labelText}>{children}</span>\n </MantineButton>\n );\n },\n);\n\nButton.displayName = \"Button\";\n","import React, { forwardRef } from \"react\";\nimport {\n Accordion as MantineAccordion,\n type AccordionProps as MantineAccordionProps,\n type AccordionItemProps,\n type AccordionControlProps,\n type AccordionPanelProps,\n} from \"@mantine/core\";\nimport styles from \"./Accordion.module.css\";\n\n// ==== ACCORDION CONTAINER ====\nexport type AccordionProps = MantineAccordionProps;\n\nconst AccordionBase = function Accordion({\n className,\n classNames,\n variant = \"unstyled\",\n ...rest\n}: AccordionProps) {\n // Bind all deep CSS module references natively into the global class mapping schema\n const mergedClassNames: Record<string, string> = {\n root: styles.root,\n item: styles.item,\n control: styles.control,\n label: styles.label,\n chevron: styles.chevron,\n panel: styles.panel,\n content: styles.content,\n };\n\n if (\n classNames &&\n typeof classNames === \"object\" &&\n !Array.isArray(classNames)\n ) {\n const o = classNames as Record<string, string>;\n Object.keys(o).forEach((key) => {\n if (mergedClassNames[key]) {\n mergedClassNames[key] = `${mergedClassNames[key]} ${o[key]}`;\n } else {\n mergedClassNames[key] = o[key];\n }\n });\n }\n\n return (\n <MantineAccordion\n variant={variant}\n className={className}\n classNames={mergedClassNames}\n {...rest}\n />\n );\n};\nAccordionBase.displayName = \"Accordion\";\n\n// ==== ACCORDION ITEM ====\nexport type RecursicaAccordionItemProps = AccordionItemProps & {\n /**\n * When provided alongside `leftIcon` or independently, this auto-generates the Accordion Control and Panel DOM layers natively.\n */\n title?: React.ReactNode;\n\n /**\n * Leading icon explicitly mapped into the Mantine `Accordion.Control` leftSection boundary natively.\n */\n leftIcon?: React.ReactNode;\n\n /**\n * Toggles the presence of the bottom trailing divider native to AccordionItems.\n * @default true\n */\n divider?: boolean;\n\n // Note on `open` property:\n // Recursica structurally maps an `open` property for active state tracking. However, Mantine inherently demands array-driven states\n // managed by the parent `<Accordion value=\"...\">` wrapper logic to accurately sequence expanding DOM animations. Attempting to force\n // an isolated `open` boolean natively corrupts Mantine's transition observers, so no `open` prop is directly preserved on this wrapper.\n};\n\nexport const AccordionItem = forwardRef<\n HTMLDivElement,\n RecursicaAccordionItemProps\n>(function AccordionItem(\n { title, leftIcon, divider = true, children, ...rest },\n ref,\n) {\n // If the user utilizes the explicit 'title' prop from Recursica, we securely auto-construct the Mantine sub-hierarchy natively!\n // If not, we defer to raw composable children (meaning the integrator maps `<Accordion.Control>` manually).\n return (\n <MantineAccordion.Item\n ref={ref}\n className={divider ? undefined : styles.noDivider}\n {...rest}\n >\n {title ? (\n <>\n <AccordionControl leftIcon={leftIcon}>{title}</AccordionControl>\n <AccordionPanel>{children}</AccordionPanel>\n </>\n ) : (\n children\n )}\n </MantineAccordion.Item>\n );\n});\nAccordionItem.displayName = \"AccordionItem\";\n\n// ==== ACCORDION CONTROL ====\nexport type RecursicaAccordionControlProps = AccordionControlProps & {\n /**\n * Leading icon explicitly mapped into the Mantine `Accordion.Control` leftSection boundary natively.\n */\n leftIcon?: React.ReactNode;\n};\n\nexport const AccordionControl = forwardRef<\n HTMLButtonElement,\n RecursicaAccordionControlProps\n>(function AccordionControl({ leftIcon, children, ...rest }, ref) {\n return (\n <MantineAccordion.Control\n ref={ref}\n icon={\n leftIcon ? (\n <span className={styles.iconLeftWrapper} aria-hidden>\n {leftIcon}\n </span>\n ) : undefined\n }\n {...rest}\n >\n {children}\n </MantineAccordion.Control>\n );\n});\nAccordionControl.displayName = \"AccordionControl\";\n\n// ==== ACCORDION PANEL ====\nexport const AccordionPanel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel(props, ref) {\n return <MantineAccordion.Panel ref={ref} {...props} />;\n },\n);\nAccordionPanel.displayName = \"AccordionPanel\";\n\n// ==== DOT NOTATION EXPORT ====\ntype AccordionComponent = typeof AccordionBase & {\n Item: typeof AccordionItem;\n Control: typeof AccordionControl;\n Panel: typeof AccordionPanel;\n};\n\nexport const Accordion = AccordionBase as AccordionComponent;\nAccordion.Item = AccordionItem;\nAccordion.Control = AccordionControl;\nAccordion.Panel = AccordionPanel;\n","import React, { forwardRef } from \"react\";\nimport {\n Avatar as MantineAvatar,\n type AvatarProps as MantineAvatarProps,\n} from \"@mantine/core\";\nimport styles from \"./Avatar.module.css\";\n\nexport interface RecursicaAvatarProps {\n size?: \"small\" | \"default\" | \"large\";\n variant?: \"solid\" | \"outline\" | \"ghost\";\n icon?: React.ReactNode;\n}\n\nexport type AvatarProps = Omit<\n MantineAvatarProps,\n \"variant\" | \"size\" | \"color\" | \"radius\"\n> &\n RecursicaAvatarProps;\n\nexport const Avatar = forwardRef<HTMLDivElement, AvatarProps>(function Avatar(\n {\n size = \"default\",\n variant = \"solid\",\n icon,\n className,\n classNames,\n children,\n style,\n src,\n ...rest\n },\n ref,\n) {\n const mapVariant = {\n solid: \"filled\",\n outline: \"outline\",\n ghost: \"transparent\",\n } as const;\n\n const mapSize = {\n default: \"md\",\n small: \"sm\",\n large: \"lg\",\n } as const;\n\n // Determine semantic style based on provided props\n let computedStyle = \"text\";\n if (src) {\n computedStyle = \"image\";\n } else if (icon) {\n computedStyle = \"icon\";\n }\n\n const mergedClassNames: Partial<Record<string, string>> = {\n root: styles.root,\n image: styles.image,\n placeholder: styles.placeholder,\n };\n\n if (\n classNames &&\n typeof classNames === \"object\" &&\n !Array.isArray(classNames)\n ) {\n const o = classNames as Partial<Record<string, string>>;\n mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;\n mergedClassNames.image = o.image\n ? `${styles.image} ${o.image}`\n : styles.image;\n mergedClassNames.placeholder = o.placeholder\n ? `${styles.placeholder} ${o.placeholder}`\n : styles.placeholder;\n }\n\n return (\n <MantineAvatar\n ref={ref}\n className={className}\n classNames={mergedClassNames}\n variant={mapVariant[variant]}\n size={mapSize[size]}\n style={style}\n src={src}\n data-variant={variant}\n data-size={size}\n data-style={computedStyle}\n {...rest}\n >\n {icon != null ? (\n <span className={styles.iconWrapper} aria-hidden>\n {icon}\n </span>\n ) : children != null ? (\n <span className={styles.textWrapper}>{children}</span>\n ) : undefined}\n </MantineAvatar>\n );\n});\n\nAvatar.displayName = \"Avatar\";\n","\"use client\";\n\nimport { useEffect } from \"react\";\n\nconst THEME_ATTRIBUTE = \"data-recursica-theme\";\n\nexport interface RecursicaThemeProviderProps {\n /** 'light' | 'dark'. Defaults to 'light' when omitted. */\n theme?: \"light\" | \"dark\";\n children: React.ReactNode;\n}\n\n/**\n * Sets data-recursica-theme on document.documentElement so Recursica scoped CSS\n * (e.g. recursica_variables_scoped.css) applies the correct theme and layer-0 variables.\n * Default is light theme.\n */\nexport function RecursicaThemeProvider({\n children,\n theme = \"light\",\n}: RecursicaThemeProviderProps) {\n useEffect(() => {\n const root = document.documentElement;\n root.setAttribute(THEME_ATTRIBUTE, theme);\n return () => {\n root.removeAttribute(THEME_ATTRIBUTE);\n };\n }, [theme]);\n\n return <>{children}</>;\n}\n"],"names":["Layer","forwardRef","layer","contentsOnly","children","className","style","rest","ref","rootClassName","styles","jsx","hasVisibleChildren","Button","variant","size","icon","classNames","mapVariant","mapSize","restRecord","hasLeftSection","hasRightSection","isIconOnly","mergedClassNames","o","MantineButton","AccordionBase","key","MantineAccordion","AccordionItem","title","leftIcon","divider","jsxs","Fragment","AccordionControl","AccordionPanel","props","Accordion","Avatar","src","computedStyle","MantineAvatar","THEME_ATTRIBUTE","RecursicaThemeProvider","theme","useEffect","root"],"mappings":";;;;;;GA8BaA,IAAQC,EAAuC,SAC1D,EAAE,OAAAC,GAAO,cAAAC,GAAc,UAAAC,GAAU,WAAAC,GAAW,OAAAC,GAAO,GAAGC,EAAA,GACtDC,GACA;AACA,QAAMC,IAAgBN,IAClBE,IACE,GAAGK,EAAO,IAAI,IAAIA,EAAO,QAAQ,IAAIL,CAAS,KAC9C,GAAGK,EAAO,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KACtCf,EAAO;AAAA,EACb;AAEA,SACE,gBAAAC;AAAA,IAACgC;AAAAA,IAAA;AAAA,MACC,KAAAnC;AAAA,MACA,WAAAH;AAAA,MACA,YAAYmB;AAAA,MACZ,SAASN,EAAWJ,CAAO;AAAA,MAC3B,MAAMK,EAAQJ,CAAI;AAAA,MAClB,OAAAT;AAAA,MACA,KAAAmC;AAAA,MACA,gBAAc3B;AAAA,MACd,aAAWC;AAAA,MACX,cAAY2B;AAAA,MACX,GAAGnC;AAAA,MAEH,eAAQ,OACP,gBAAAI,EAAC,UAAK,WAAWD,EAAO,aAAa,eAAW,IAC7C,aACH,IACEN,KAAY,OACd,gBAAAO,EAAC,QAAA,EAAK,WAAWD,EAAO,aAAc,UAAAN,GAAS,IAC7C;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AAEDoC,GAAO,cAAc;AC/FrB,MAAMI,IAAkB;AAajB,SAASC,GAAuB;AAAA,EACrC,UAAAzC;AAAA,EACA,OAAA0C,IAAQ;AACV,GAAgC;AAC9B,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAO,SAAS;AACtB,WAAAA,EAAK,aAAaJ,GAAiBE,CAAK,GACjC,MAAM;AACX,MAAAE,EAAK,gBAAgBJ,CAAe;AAAA,IACtC;AAAA,EACF,GAAG,CAACE,CAAK,CAAC,0BAEA,UAAA1C,GAAS;AACrB;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface RecursicaThemeProviderProps {
|
|
2
|
+
/** 'light' | 'dark'. Defaults to 'light' when omitted. */
|
|
3
|
+
theme?: "light" | "dark";
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Sets data-recursica-theme on document.documentElement so Recursica scoped CSS
|
|
8
|
+
* (e.g. recursica_variables_scoped.css) applies the correct theme and layer-0 variables.
|
|
9
|
+
* Default is light theme.
|
|
10
|
+
*/
|
|
11
|
+
export declare function RecursicaThemeProvider({ children, theme, }: RecursicaThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AccordionProps as MantineAccordionProps, AccordionItemProps, AccordionControlProps, AccordionPanelProps } from '@mantine/core';
|
|
3
|
+
export type AccordionProps = MantineAccordionProps;
|
|
4
|
+
declare const AccordionBase: {
|
|
5
|
+
({ className, classNames, variant, ...rest }: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
export type RecursicaAccordionItemProps = AccordionItemProps & {
|
|
9
|
+
/**
|
|
10
|
+
* When provided alongside `leftIcon` or independently, this auto-generates the Accordion Control and Panel DOM layers natively.
|
|
11
|
+
*/
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Leading icon explicitly mapped into the Mantine `Accordion.Control` leftSection boundary natively.
|
|
15
|
+
*/
|
|
16
|
+
leftIcon?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Toggles the presence of the bottom trailing divider native to AccordionItems.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
divider?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & {
|
|
24
|
+
/**
|
|
25
|
+
* When provided alongside `leftIcon` or independently, this auto-generates the Accordion Control and Panel DOM layers natively.
|
|
26
|
+
*/
|
|
27
|
+
title?: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Leading icon explicitly mapped into the Mantine `Accordion.Control` leftSection boundary natively.
|
|
30
|
+
*/
|
|
31
|
+
leftIcon?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Toggles the presence of the bottom trailing divider native to AccordionItems.
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
divider?: boolean;
|
|
37
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
export type RecursicaAccordionControlProps = AccordionControlProps & {
|
|
39
|
+
/**
|
|
40
|
+
* Leading icon explicitly mapped into the Mantine `Accordion.Control` leftSection boundary natively.
|
|
41
|
+
*/
|
|
42
|
+
leftIcon?: React.ReactNode;
|
|
43
|
+
};
|
|
44
|
+
export declare const AccordionControl: React.ForwardRefExoticComponent<AccordionControlProps & {
|
|
45
|
+
/**
|
|
46
|
+
* Leading icon explicitly mapped into the Mantine `Accordion.Control` leftSection boundary natively.
|
|
47
|
+
*/
|
|
48
|
+
leftIcon?: React.ReactNode;
|
|
49
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
50
|
+
export declare const AccordionPanel: React.ForwardRefExoticComponent<AccordionPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
51
|
+
type AccordionComponent = typeof AccordionBase & {
|
|
52
|
+
Item: typeof AccordionItem;
|
|
53
|
+
Control: typeof AccordionControl;
|
|
54
|
+
Panel: typeof AccordionPanel;
|
|
55
|
+
};
|
|
56
|
+
export declare const Accordion: AccordionComponent;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Accordion';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AvatarProps as MantineAvatarProps } from '@mantine/core';
|
|
3
|
+
export interface RecursicaAvatarProps {
|
|
4
|
+
size?: "small" | "default" | "large";
|
|
5
|
+
variant?: "solid" | "outline" | "ghost";
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export type AvatarProps = Omit<MantineAvatarProps, "variant" | "size" | "color" | "radius"> & RecursicaAvatarProps;
|
|
9
|
+
export declare const Avatar: React.ForwardRefExoticComponent<Omit<MantineAvatarProps, "color" | "variant" | "size" | "radius"> & RecursicaAvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Avatar';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ButtonProps as MantineButtonProps } from '@mantine/core';
|
|
3
|
+
export interface RecursicaButtonProps {
|
|
4
|
+
variant?: "solid" | "outline" | "text";
|
|
5
|
+
size?: "default" | "small";
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export type ButtonProps = Omit<MantineButtonProps, "variant" | "size" | "leftSection"> & RecursicaButtonProps;
|
|
9
|
+
export declare const Button: React.ForwardRefExoticComponent<Omit<MantineButtonProps, "variant" | "size" | "leftSection"> & RecursicaButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Button';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursica design-system props for Layer.
|
|
3
|
+
* Sets data-recursica-layer so scoped CSS theme+layer blocks apply that layer's
|
|
4
|
+
* generic brand vars (e.g. --recursica_brand_layer_N_properties_surface) to this element
|
|
5
|
+
* and descendants. Theme is set on the document root (e.g. via RecursicaThemeProvider).
|
|
6
|
+
* See recursica_variables_scoped.css header.
|
|
7
|
+
*/
|
|
8
|
+
export interface RecursicaLayerProps {
|
|
9
|
+
/** Layer (0–3). Sets data-recursica-layer on the root so descendants use this layer's styles. */
|
|
10
|
+
layer: 0 | 1 | 2 | 3;
|
|
11
|
+
/**
|
|
12
|
+
* When true, the root uses display: contents (no box, not styled) and data-recursica-layer
|
|
13
|
+
* is omitted so Recursica layer styling is not applied. Children still participate in the cascade.
|
|
14
|
+
*/
|
|
15
|
+
contentsOnly?: boolean;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export type LayerProps = RecursicaLayerProps & React.HTMLAttributes<HTMLDivElement>;
|
|
19
|
+
/**
|
|
20
|
+
* Applies a Recursica layer context. Root has data-recursica-layer so scoped CSS
|
|
21
|
+
* theme+layer blocks (e.g. [data-recursica-theme="light"] [data-recursica-layer="1"])
|
|
22
|
+
* set generic brand vars on this element; descendants inherit. Use with theme on
|
|
23
|
+
* document root (RecursicaThemeProvider). Root is display: block so padding/background apply.
|
|
24
|
+
*/
|
|
25
|
+
export declare const Layer: import('react').ForwardRefExoticComponent<RecursicaLayerProps & import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Layer, type LayerProps, type RecursicaLayerProps } from './Layer';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Helper function for copy text to clipboard
|
|
4
|
+
* @param {string} textToCopy The text string for copying to the clipboard
|
|
5
|
+
* @param {element|node} componentRef The ref of the component that we want to trigger the copy
|
|
6
|
+
*/
|
|
7
|
+
declare const copyToClipboard: (textToCopy: string, componentRef: React.RefObject<HTMLElement | null>) => Promise<void>;
|
|
8
|
+
export { copyToClipboard };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './copyToClipboard';
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@recursica/mantine-adapter",
|
|
3
|
+
"description": "Reusable UI components for Recursica applications based on Mantine 8+",
|
|
4
|
+
"private": false,
|
|
5
|
+
"homepage": "https://github.com/borderux/recursica/tree/main/packages/mantine-adapter",
|
|
6
|
+
"author": "hi@borderux.com",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/borderux/recursica/issues"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/borderux/recursica.git"
|
|
13
|
+
},
|
|
14
|
+
"version": "0.3.0",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/mantine-adapter.cjs",
|
|
17
|
+
"module": "./dist/mantine-adapter.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/mantine-adapter.js",
|
|
23
|
+
"require": "./dist/mantine-adapter.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./style.css": "./dist/mantine-adapter.css"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"keywords": [
|
|
31
|
+
"react",
|
|
32
|
+
"ui",
|
|
33
|
+
"components",
|
|
34
|
+
"typescript",
|
|
35
|
+
"mantine",
|
|
36
|
+
"recursica",
|
|
37
|
+
"design system",
|
|
38
|
+
"design systems"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"dev": "npm run storybook",
|
|
42
|
+
"build": "vite build --mode library",
|
|
43
|
+
"build-storybook": "storybook build -o storybook-static",
|
|
44
|
+
"lint": "eslint .",
|
|
45
|
+
"storybook": "storybook dev -p 6006"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@chromatic-com/storybook": "^5.1.1",
|
|
49
|
+
"@eslint/js": "^9.25.0",
|
|
50
|
+
"@recursica/recursica-postcss-vars": "*",
|
|
51
|
+
"@repo/typescript-config": "*",
|
|
52
|
+
"@storybook/addon-a11y": "^10.3.3",
|
|
53
|
+
"@storybook/addon-docs": "^10.3.3",
|
|
54
|
+
"@storybook/addon-mcp": "^0.4.2",
|
|
55
|
+
"@storybook/addon-onboarding": "^10.3.3",
|
|
56
|
+
"@storybook/addon-vitest": "^10.3.3",
|
|
57
|
+
"@storybook/react-vite": "^10.3.3",
|
|
58
|
+
"@types/react": "^19.1.2",
|
|
59
|
+
"@types/react-dom": "^19.1.2",
|
|
60
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
61
|
+
"@vitest/browser": "^3.2.4",
|
|
62
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
63
|
+
"eslint": "^9.25.0",
|
|
64
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
65
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
66
|
+
"eslint-plugin-storybook": "^10.3.3",
|
|
67
|
+
"globals": "^16.0.0",
|
|
68
|
+
"playwright": "^1.53.0",
|
|
69
|
+
"sass": "^1.89.2",
|
|
70
|
+
"sirv": "^3.0.2",
|
|
71
|
+
"storybook": "^10.3.3",
|
|
72
|
+
"strip-literal": "^3.0.0",
|
|
73
|
+
"typescript": "~5.8.3",
|
|
74
|
+
"typescript-eslint": "^8.30.1",
|
|
75
|
+
"vite": "^6.3.5",
|
|
76
|
+
"vite-plugin-dts": "^4.5.4",
|
|
77
|
+
"vite-plugin-svgr": "^4.3.0",
|
|
78
|
+
"vitest": "^3.2.4"
|
|
79
|
+
},
|
|
80
|
+
"peerDependencies": {
|
|
81
|
+
"@mantine/core": ">=8.0.0",
|
|
82
|
+
"@mantine/dates": ">=8.0.0",
|
|
83
|
+
"@mantine/hooks": ">=8.0.0",
|
|
84
|
+
"react": ">=16.8.0",
|
|
85
|
+
"react-dom": ">=16.8.0"
|
|
86
|
+
}
|
|
87
|
+
}
|