@recursica/mantine-adapter 0.4.0 → 0.6.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 (56) hide show
  1. package/dist/mantine-adapter.cjs +1 -1
  2. package/dist/mantine-adapter.cjs.map +1 -1
  3. package/dist/mantine-adapter.css +1 -1
  4. package/dist/mantine-adapter.js +1038 -198
  5. package/dist/mantine-adapter.js.map +1 -1
  6. package/dist/src/components/Accordion/Accordion.d.ts +13 -28
  7. package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +10 -0
  8. package/dist/src/components/Avatar/Avatar.d.ts +1 -1
  9. package/dist/src/components/Badge/Badge.d.ts +8 -0
  10. package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +6 -0
  11. package/dist/src/components/Button/Button.d.ts +3 -2
  12. package/dist/src/components/Card/Card.d.ts +38 -0
  13. package/dist/src/components/Checkbox/Checkbox.d.ts +11 -0
  14. package/dist/src/components/Checkbox/CheckboxGroup.d.ts +9 -0
  15. package/dist/src/components/Chip/Chip.d.ts +3 -0
  16. package/dist/src/components/DatePicker/DatePicker.d.ts +3 -0
  17. package/dist/src/components/Dropdown/Dropdown.d.ts +3 -0
  18. package/dist/src/components/FileInput/FileInput.d.ts +3 -0
  19. package/dist/src/components/FileUpload/FileUpload.d.ts +3 -0
  20. package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +18 -0
  21. package/dist/src/components/HoverCard/HoverCard.d.ts +3 -0
  22. package/dist/src/components/Label/Label.d.ts +21 -0
  23. package/dist/src/components/Label/index.d.ts +1 -0
  24. package/dist/src/components/Link/Link.d.ts +3 -0
  25. package/dist/src/components/Loader/Loader.d.ts +3 -0
  26. package/dist/src/components/Menu/Menu.d.ts +3 -0
  27. package/dist/src/components/Modal/Modal.d.ts +3 -0
  28. package/dist/src/components/NumberInput/NumberInput.d.ts +3 -0
  29. package/dist/src/components/Pagination/Pagination.d.ts +3 -0
  30. package/dist/src/components/Panel/Panel.d.ts +3 -0
  31. package/dist/src/components/Popover/Popover.d.ts +3 -0
  32. package/dist/src/components/Radio/Radio.d.ts +3 -0
  33. package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +20 -0
  34. package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +8 -0
  35. package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +22 -0
  36. package/dist/src/components/ReadOnlyField/index.d.ts +3 -0
  37. package/dist/src/components/Search/Search.d.ts +3 -0
  38. package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  39. package/dist/src/components/Slider/Slider.d.ts +3 -0
  40. package/dist/src/components/Stepper/Stepper.d.ts +3 -0
  41. package/dist/src/components/Switch/Switch.d.ts +3 -0
  42. package/dist/src/components/Table/Table.d.ts +3 -0
  43. package/dist/src/components/Tabs/Tabs.d.ts +3 -0
  44. package/dist/src/components/Text/Text.d.ts +17 -0
  45. package/dist/src/components/TextArea/TextArea.d.ts +3 -0
  46. package/dist/src/components/TextField/TextField.d.ts +9 -0
  47. package/dist/src/components/TimePicker/TimePicker.d.ts +3 -0
  48. package/dist/src/components/Timeline/Timeline.d.ts +3 -0
  49. package/dist/src/components/Title/Title.d.ts +13 -0
  50. package/dist/src/components/Toast/Toast.d.ts +3 -0
  51. package/dist/src/components/Tooltip/Tooltip.d.ts +3 -0
  52. package/dist/src/components/TransferList/TransferList.d.ts +3 -0
  53. package/dist/src/components/index.d.ts +37 -1
  54. package/dist/src/utils/ColorSchemeWrapper.d.ts +3 -0
  55. package/dist/src/utils/filterStylingProps.d.ts +35 -0
  56. package/package.json +5 -4
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ import { ReadOnlyFieldType } from '@recursica/adapter-common';
3
+ import { RecursicaOverStyled } from '../../utils/filterStylingProps';
4
+ import { FormControlWrapperProps } from '../FormControlWrapper/FormControlWrapper';
5
+ export interface RecursicaReadOnlyFieldProps extends Omit<FormControlWrapperProps, "children" | "overStyled"> {
6
+ /** The specific value to be rendered in read-only mode explicitly matching the original field input */
7
+ value?: any;
8
+ /** The data type formatting rules bounding how the string is presented to the user */
9
+ type?: ReadOnlyFieldType;
10
+ /** Custom renderer explicitly responsible for formatting missing/empty value mappings (overriding default 'N/A') */
11
+ emptyValueComponent?: React.ElementType<{
12
+ value?: any;
13
+ }>;
14
+ }
15
+ export type ReadOnlyFieldProps = RecursicaOverStyled<RecursicaReadOnlyFieldProps>;
16
+ /**
17
+ * A native generic form control wrapper exclusively responsible for displaying fixed data.
18
+ * Internally maps to structural ReadOnly primitive blocks bridging standard `FormControlWrapper` layouts natively.
19
+ */
20
+ export declare const ReadOnlyField: React.ForwardRefExoticComponent<ReadOnlyFieldProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { RecursicaOverStyled } from '../../utils/filterStylingProps';
3
+ export interface RecursicaReadOnlyTextFieldProps {
4
+ /** The value strictly rendered as text output */
5
+ value?: any;
6
+ }
7
+ export type ReadOnlyTextFieldProps = RecursicaOverStyled<RecursicaReadOnlyTextFieldProps>;
8
+ export declare const ReadOnlyTextField: React.FC<ReadOnlyTextFieldProps>;
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ import { ReadOnlyFieldType } from '@recursica/adapter-common';
3
+ import { FormControlWrapperProps } from '../FormControlWrapper/FormControlWrapper';
4
+ export interface WithReadOnlyWrapperProps extends Omit<FormControlWrapperProps, "children" | "overStyled"> {
5
+ /** Injects whether the field defaults to reading mode natively */
6
+ readOnly?: boolean;
7
+ /** Explicit React component directly overtaking the baseline text renderer when read-only mode is active */
8
+ readOnlyComponent?: React.ReactNode;
9
+ /** Instructs the underlying generic ReadOnlyField which raw visual structure to bridge automatically */
10
+ readOnlyType?: ReadOnlyFieldType;
11
+ /** The isolated raw data value intercepted explicitly into the ReadOnly formatters */
12
+ readOnlyValue?: any;
13
+ /** Safely enables deep Mantine overrides transparently bypassing block filters */
14
+ overStyled?: boolean;
15
+ /** The nested active node dynamically exposed exclusively when read-only bounds are disabled */
16
+ activeComponent: React.ReactNode;
17
+ }
18
+ /**
19
+ * Universal execution barrier trapping readOnly states globally.
20
+ * Natively delegates active logic down avoiding duplicative internal component bindings dynamically.
21
+ */
22
+ export declare const WithReadOnlyWrapper: React.ForwardRefExoticComponent<WithReadOnlyWrapperProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,3 @@
1
+ export * from './ReadOnlyField';
2
+ export * from './WithReadOnlyWrapper';
3
+ export * from './ReadOnlyTextField';
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type SearchProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const Search: React.FC<SearchProps>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type SegmentedControlProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const SegmentedControl: React.FC<SegmentedControlProps>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type SliderProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const Slider: React.FC<SliderProps>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type StepperProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const Stepper: React.FC<StepperProps>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type SwitchProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const Switch: React.FC<SwitchProps>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type TableProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const Table: React.FC<TableProps>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type TabsProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const Tabs: React.FC<TabsProps>;
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ import { TextProps as MantineTextProps } from '@mantine/core';
3
+ import { RecursicaOverStyled } from '../../utils/filterStylingProps';
4
+ export type TextVariant = "body" | "body-small" | "caption" | "overline" | "subtitle" | "subtitle-small";
5
+ export type RecursicaTextProps = Omit<MantineTextProps, "variant"> & {
6
+ /**
7
+ * The explicit typography hierarchy dictated by Recursica's global design tokens.
8
+ */
9
+ variant?: TextVariant;
10
+ children?: ReactNode;
11
+ };
12
+ export type TextProps = RecursicaOverStyled<RecursicaTextProps>;
13
+ /**
14
+ * A generalized typographical wrapper limiting text properties to bounded Recursica UI-kit tokens inherently.
15
+ * Do not use for semantic headings; use the explicit `<Title>` component for `<h1>` - `<h6>`.
16
+ */
17
+ export declare const Text: import('react').ForwardRefExoticComponent<TextProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type TextAreaProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const TextArea: React.FC<TextAreaProps>;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { InputProps, InputWrapperProps } from '@mantine/core';
3
+ import { ReadOnlyControlProps } from '@recursica/adapter-common';
4
+ import { RecursicaOverStyled } from '../../utils/filterStylingProps';
5
+ import { RecursicaFormControlWrapperProps } from '../FormControlWrapper/FormControlWrapper';
6
+ export interface RecursicaTextFieldProps extends Omit<InputProps, "size" | "variant" | "radius" | "wrapperProps">, Pick<InputWrapperProps, "label" | "error" | "required" | "withAsterisk" | "id">, Omit<React.ComponentPropsWithoutRef<"input">, "size" | "style" | "className" | "id">, Omit<RecursicaFormControlWrapperProps, "controlMaxWidth" | "controlMinWidth">, ReadOnlyControlProps {
7
+ }
8
+ export type TextFieldProps = RecursicaOverStyled<RecursicaTextFieldProps>;
9
+ export declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type TimePickerProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const TimePicker: React.FC<TimePickerProps>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type TimelineProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const Timeline: React.FC<TimelineProps>;
@@ -0,0 +1,13 @@
1
+ import { TitleProps as MantineTitleProps } from '@mantine/core';
2
+ import { RecursicaOverStyled } from '../../utils/filterStylingProps';
3
+ export type RecursicaTitleProps = Omit<MantineTitleProps, "order"> & {
4
+ /**
5
+ * Enforces semantic HTML headers (h1-h6) cleanly bound to native typographic scaling variables in the design system.
6
+ */
7
+ order?: 1 | 2 | 3 | 4 | 5 | 6;
8
+ };
9
+ export type TitleProps = RecursicaOverStyled<RecursicaTitleProps>;
10
+ /**
11
+ * Enforces highly accessible structural markup utilizing semantic `<h1>` through `<h6>` tags securely bound directly to Recursica typographic scales.
12
+ */
13
+ export declare const Title: import('react').ForwardRefExoticComponent<TitleProps & import('react').RefAttributes<HTMLHeadingElement>>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type ToastProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const Toast: React.FC<ToastProps>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type TooltipProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const Tooltip: React.FC<TooltipProps>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export type TransferListProps = React.HTMLAttributes<HTMLDivElement>;
3
+ export declare const TransferList: React.FC<TransferListProps>;
@@ -1,3 +1,39 @@
1
- export * from './Button';
2
1
  export * from './Accordion';
3
2
  export * from './Avatar';
3
+ export * from './Badge/Badge';
4
+ export * from './Breadcrumb/Breadcrumb';
5
+ export * from './Button';
6
+ export * from './Card/Card';
7
+ export * from './Checkbox/Checkbox';
8
+ export * from './Checkbox/CheckboxGroup';
9
+ export * from './Chip/Chip';
10
+ export * from './DatePicker/DatePicker';
11
+ export * from './Dropdown/Dropdown';
12
+ export * from './FileInput/FileInput';
13
+ export * from './FileUpload/FileUpload';
14
+ export * from './HoverCard/HoverCard';
15
+ export * from './Link/Link';
16
+ export * from './Loader/Loader';
17
+ export * from './Label';
18
+ export * from './Menu/Menu';
19
+ export * from './Modal/Modal';
20
+ export * from './NumberInput/NumberInput';
21
+ export * from './Pagination/Pagination';
22
+ export * from './Panel/Panel';
23
+ export * from './Popover/Popover';
24
+ export * from './Radio/Radio';
25
+ export * from './ReadOnlyField';
26
+ export * from './Search/Search';
27
+ export * from './SegmentedControl/SegmentedControl';
28
+ export * from './Slider/Slider';
29
+ export * from './Stepper/Stepper';
30
+ export * from './Switch/Switch';
31
+ export * from './Table/Table';
32
+ export * from './Tabs/Tabs';
33
+ export * from './TextArea/TextArea';
34
+ export * from './TextField/TextField';
35
+ export * from './TimePicker/TimePicker';
36
+ export * from './Timeline/Timeline';
37
+ export * from './Toast/Toast';
38
+ export * from './Tooltip/Tooltip';
39
+ export * from './TransferList/TransferList';
@@ -0,0 +1,3 @@
1
+ export declare function ColorSchemeWrapper({ children, }: {
2
+ children: React.ReactNode;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * filterStylingProps
3
+ *
4
+ * This utility acts as the central gatekeeper for strict design-system adherence across
5
+ * all Recursica components mapped over Mantine.
6
+ *
7
+ * PHILOSOPHY:
8
+ * Recursica components are designed to be explicitly sandboxed tokens. Allowing external
9
+ * `className` or Mantine style system props (`bg`, `p`, etc.) breaks the design system by
10
+ * allowing developers to leak arbitrary designs into components.
11
+ *
12
+ * By default (`overStyled=false`), this utility actively prevents developers from overriding
13
+ * internal component styles (such as background, colors, typography, or internal classNames).
14
+ * It safely *permits* external layout overrides (like `margin` / `m`) so that components can
15
+ * easily be spaced alongside other DOM elements.
16
+ *
17
+ * If a developer passes `overStyled={true}`, this filter allows all styling properties to
18
+ * flow through to the underlying Mantine component natively, at the developer's own risk.
19
+ *
20
+ * @param props - The raw component props passed down to the wrapper
21
+ * @param overStyled - Boolean toggle to allow raw external styling. Defaults to false.
22
+ * @returns Sanitized component props safe for internal styling merging
23
+ */
24
+ export declare const BLOCKED_STYLING_KEYS: readonly ["className", "classNames", "style", "styles", "vars", "p", "px", "py", "pt", "pb", "pl", "pr", "bg", "c", "opacity", "ff", "fz", "fw", "lts", "ta", "lh", "fs", "tt", "td", "bd", "bdw", "bds", "bdc", "bdr", "shadow", "w", "miw", "maw", "h", "mih", "mah"];
25
+ export type BlockedStylingKeys = (typeof BLOCKED_STYLING_KEYS)[number];
26
+ export type RecursicaSpacing = "rec-none" | "rec-sm" | "rec-default" | "rec-md" | "rec-lg" | "rec-xl" | "rec-2xl";
27
+ export type ForbiddenStyles = {
28
+ [K in BlockedStylingKeys]?: never;
29
+ };
30
+ export type RecursicaOverStyled<T> = (Omit<T, BlockedStylingKeys> & ForbiddenStyles & {
31
+ overStyled?: false | undefined;
32
+ }) | (T & {
33
+ overStyled: true;
34
+ });
35
+ export declare function filterStylingProps<T extends Record<string, unknown>>(props: T, overStyled?: boolean): Partial<T>;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "git+https://github.com/borderux/recursica.git"
13
13
  },
14
- "version": "0.4.0",
14
+ "version": "0.6.0",
15
15
  "type": "module",
16
16
  "main": "./dist/mantine-adapter.cjs",
17
17
  "module": "./dist/mantine-adapter.js",
@@ -72,6 +72,7 @@
72
72
  "sass": "^1.89.2",
73
73
  "sirv": "^3.0.2",
74
74
  "storybook": "^10.3.3",
75
+ "storybook-dark-mode": "^5.0.0",
75
76
  "strip-literal": "^3.0.0",
76
77
  "typescript": "~5.8.3",
77
78
  "typescript-eslint": "^8.30.1",
@@ -81,9 +82,9 @@
81
82
  "vitest": "^3.2.4"
82
83
  },
83
84
  "peerDependencies": {
84
- "@mantine/core": ">=8.0.0",
85
- "@mantine/dates": ">=8.0.0",
86
- "@mantine/hooks": ">=8.0.0",
85
+ "@mantine/core": "^8.0.0",
86
+ "@mantine/dates": "^8.0.0",
87
+ "@mantine/hooks": "^8.0.0",
87
88
  "react": ">=16.8.0",
88
89
  "react-dom": ">=16.8.0"
89
90
  }