@recursica/mantine-adapter 0.42.0 → 0.43.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 (86) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/index.d.ts +93 -15
  3. package/dist/mantine-adapter.cjs +2 -2
  4. package/dist/mantine-adapter.cjs.map +1 -1
  5. package/dist/mantine-adapter.css +1 -1
  6. package/dist/mantine-adapter.js +3546 -3250
  7. package/dist/mantine-adapter.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/GlobalExemptions.modules.css +0 -6
  10. package/src/components/Accordion/Accordion.module.css +0 -8
  11. package/src/components/Accordion/Accordion.tsx +32 -33
  12. package/src/components/AssistiveElement/AssistiveElement.tsx +1 -1
  13. package/src/components/AutoComplete/AutoComplete.module.css +0 -7
  14. package/src/components/AutoComplete/AutoComplete.tsx +26 -38
  15. package/src/components/Avatar/Avatar.module.css +0 -8
  16. package/src/components/Avatar/Avatar.tsx +22 -23
  17. package/src/components/Badge/Badge.tsx +12 -18
  18. package/src/components/Breadcrumb/Breadcrumb.tsx +10 -18
  19. package/src/components/Button/Button.tsx +31 -30
  20. package/src/components/Card/Card.tsx +48 -27
  21. package/src/components/Checkbox/Checkbox.tsx +29 -42
  22. package/src/components/Checkbox/CheckboxGroup.tsx +12 -5
  23. package/src/components/Chip/Chip.module.css +0 -16
  24. package/src/components/Chip/Chip.tsx +34 -27
  25. package/src/components/DatePicker/DATEPICKER_IMPLEMENTATION_NOTES.md +14 -1
  26. package/src/components/DatePicker/DatePicker.icons.tsx +27 -0
  27. package/src/components/DatePicker/DatePicker.module.css +256 -7
  28. package/src/components/DatePicker/DatePicker.stories.tsx +0 -7
  29. package/src/components/DatePicker/DatePicker.tsx +68 -33
  30. package/src/components/DatePicker/USAGE.md +6 -2
  31. package/src/components/Dropdown/BareDropdown.tsx +25 -13
  32. package/src/components/Dropdown/Dropdown.module.css +0 -7
  33. package/src/components/Dropdown/Dropdown.tsx +25 -38
  34. package/src/components/FileInput/FileInput.module.css +0 -21
  35. package/src/components/FileInput/FileInput.tsx +1 -1
  36. package/src/components/FileUpload/FileUpload.module.css +0 -11
  37. package/src/components/FileUpload/FileUpload.tsx +1 -1
  38. package/src/components/HoverCard/HoverCard.module.css +1 -7
  39. package/src/components/HoverCard/HoverCard.tsx +18 -34
  40. package/src/components/Label/Label.module.css +0 -6
  41. package/src/components/Label/Label.tsx +20 -21
  42. package/src/components/Link/Link.module.css +1 -6
  43. package/src/components/Link/Link.tsx +6 -14
  44. package/src/components/Loader/Loader.tsx +8 -16
  45. package/src/components/Menu/Menu.module.css +0 -6
  46. package/src/components/Menu/Menu.tsx +55 -48
  47. package/src/components/Modal/Modal.module.css +0 -11
  48. package/src/components/Modal/Modal.tsx +134 -96
  49. package/src/components/NumberInput/NumberInput.module.css +0 -7
  50. package/src/components/NumberInput/NumberInput.tsx +14 -7
  51. package/src/components/Pagination/Pagination.module.css +0 -81
  52. package/src/components/Pagination/Pagination.tsx +25 -34
  53. package/src/components/Panel/Panel.tsx +19 -26
  54. package/src/components/Popover/Popover.tsx +19 -31
  55. package/src/components/Radio/Radio.tsx +32 -43
  56. package/src/components/Radio/RadioGroup.tsx +11 -4
  57. package/src/components/ReadOnlyField/ReadOnlyField.tsx +1 -1
  58. package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +1 -1
  59. package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +1 -1
  60. package/src/components/SegmentedControl/SegmentedControl.module.css +0 -1
  61. package/src/components/SegmentedControl/SegmentedControl.tsx +29 -33
  62. package/src/components/Slider/Slider.tsx +30 -43
  63. package/src/components/Stepper/Stepper.tsx +20 -13
  64. package/src/components/Switch/Switch.tsx +45 -45
  65. package/src/components/Switch/SwitchGroup.tsx +11 -4
  66. package/src/components/Table/Table.tsx +1 -1
  67. package/src/components/Tabs/Tabs.tsx +13 -6
  68. package/src/components/Text/Text.tsx +1 -1
  69. package/src/components/TextArea/TextArea.module.css +0 -7
  70. package/src/components/TextArea/TextArea.tsx +21 -25
  71. package/src/components/TextField/TextField.module.css +0 -7
  72. package/src/components/TextField/TextField.tsx +23 -30
  73. package/src/components/TimePicker/TimePicker.module.css +0 -16
  74. package/src/components/TimePicker/TimePicker.tsx +26 -12
  75. package/src/components/Timeline/Timeline.module.css +0 -6
  76. package/src/components/Timeline/Timeline.tsx +7 -21
  77. package/src/components/Timeline/TimelineItem.tsx +14 -26
  78. package/src/components/Title/Title.tsx +12 -2
  79. package/src/components/Toast/Toast.module.css +0 -7
  80. package/src/components/Toast/Toast.tsx +32 -31
  81. package/src/components/Tooltip/Tooltip.module.css +0 -9
  82. package/src/components/Tooltip/Tooltip.tsx +18 -34
  83. package/src/components/TransferList/TransferList.module.css +0 -8
  84. package/src/components/TransferList/TransferList.tsx +1 -1
  85. package/src/components/Tree/Tree.tsx +8 -8
  86. package/src/utils/filterStylingProps.ts +4 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @recursica/mantine-adapter
2
2
 
3
+ ## 0.43.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d171a96: Update revision to latest
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [d171a96]
12
+ - @recursica/adapter-common@0.19.0
13
+
14
+ ## 0.42.1
15
+
16
+ ### Patch Changes
17
+
18
+ - 015c809: DatePicker's calendar (hover, today, weekend, disabled/outside days, in-range, header nav/month-label as Recursica text buttons, popover border/shadow) is now fully token-driven. Default value format is `MM/DD/YY`, `highlightToday` defaults to `true`, a default calendar icon is provided (overridable via `leftSection`), and the field no longer wraps its value/placeholder to a second line. Default placeholder is `"MM / DD / YY"` (overridable via `placeholder`).
19
+ - 56e0d63: Remove all `recursica-ignore` exemption comments so the token analyzer report reflects true unused/unimplemented Figma variables. No runtime behavior change.
20
+
3
21
  ## 0.42.0
4
22
 
5
23
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -49,7 +49,7 @@ import { MenuSubDropdownProps as MenuSubDropdownProps_2 } from '@mantine/core';
49
49
  import { MenuSubProps as MenuSubProps_2 } from '@mantine/core';
50
50
  import { MenuSubTargetProps as MenuSubTargetProps_2 } from '@mantine/core';
51
51
  import { MenuTargetProps as MenuTargetProps_2 } from '@mantine/core';
52
- import { ModalBodyProps } from '@mantine/core';
52
+ import { ModalBodyProps as ModalBodyProps_2 } from '@mantine/core';
53
53
  import { ModalCloseButtonProps as ModalCloseButtonProps_2 } from '@mantine/core';
54
54
  import { ModalContentProps as ModalContentProps_2 } from '@mantine/core';
55
55
  import { ModalHeaderProps as ModalHeaderProps_2 } from '@mantine/core';
@@ -253,9 +253,6 @@ declare const CardFooter: ForwardRefExoticComponent<CardFooterProps & RefAttribu
253
253
 
254
254
  declare type CardFooterProps = RecursicaOverStyled<RecursicaCardSectionProps>;
255
255
 
256
- /**
257
- * Replaces standard generic Mantine `<Card.Section>` wrappers by directly injecting the strict Recursica design tokens for header sizing, background drops, and intrinsic padding limits.
258
- */
259
256
  declare const CardHeader: ForwardRefExoticComponent<CardHeaderProps & RefAttributes<HTMLDivElement>>;
260
257
 
261
258
  declare type CardHeaderProps = RecursicaOverStyled<RecursicaCardSectionProps>;
@@ -721,7 +718,7 @@ export declare const HoverCard: typeof rawComponents.HoverCard;
721
718
  declare const HoverCard_2: HoverCardComponent;
722
719
 
723
720
  declare const HoverCardBase: {
724
- ({ overStyled, withBeak, ...rest }: HoverCardProps): JSX.Element;
721
+ ({ overStyled, withBeak, position, arrowSize, withArrow, ...rest }: HoverCardProps): JSX.Element;
725
722
  displayName: string;
726
723
  };
727
724
 
@@ -883,8 +880,7 @@ renderRoot?: (props: Record<string, any>) => any;
883
880
  /**
884
881
  * An individual actionable item within the menu dropdown.
885
882
  *
886
- * **Note:** Mantine's `color` prop is stripped in strict mode to enforce
887
- * design token adherence. Use `overStyled={true}` if you need to bypass.
883
+ * **Note:** Mantine's `color` prop is stripped to enforce design token adherence.
888
884
  */
889
885
  declare type MenuItemProps = RecursicaOverStyled<Omit<MenuItemProps_2, "color">>;
890
886
 
@@ -960,7 +956,7 @@ declare const MenuSubTarget: {
960
956
  declare type MenuSubTargetProps = MenuSubTargetProps_2;
961
957
 
962
958
  declare const MenuTarget: {
963
- (props: MenuTargetProps): JSX.Element;
959
+ ({ overStyled, ...rest }: MenuTargetProps): JSX.Element;
964
960
  displayName: string;
965
961
  };
966
962
 
@@ -968,7 +964,46 @@ declare const MenuTarget: {
968
964
  * Wrapper for the element that triggers the menu.
969
965
  * Requires a single child element that supports ref forwarding.
970
966
  */
971
- declare type MenuTargetProps = MenuTargetProps_2;
967
+ declare type MenuTargetProps = RecursicaOverStyled<MenuTargetProps_2>;
968
+
969
+ /**
970
+ * mergeClassNames
971
+ *
972
+ * Per-slot merge for a `classNames` prop against Recursica's own CSS-module classes. This is
973
+ * NOT the same shape as `withCallerOverride`: the caller's value must never fully replace ours,
974
+ * because the underlying library's `classNames` slots are singular strings — replacing one
975
+ * outright would drop the component's own module styles, not just extend them. Each slot keeps
976
+ * Recursica's class and appends the caller's class for that slot if they supplied one.
977
+ *
978
+ * Merges over the UNION of slots in `ours` and `callerValue`, not just `ours`'s keys — a caller
979
+ * may target a slot Recursica doesn't set a default class for (e.g. a library slot we never
980
+ * needed to style ourselves). Restricting the loop to `ours`'s keys would silently drop that
981
+ * slot instead of passing it through, the same class of prop-leakage bug this whole pattern
982
+ * exists to prevent.
983
+ *
984
+ * @param ours - Recursica's own per-slot classNames (CSS module classes)
985
+ * @param callerValue - The caller's `classNames` prop, if any
986
+ * @returns a new classNames object covering every slot named by either side
987
+ */
988
+ export declare function mergeClassNames<T extends Record<string, string | undefined>>(ours: T, callerValue: Partial<Record<keyof T, string>> | undefined): T;
989
+
990
+ /**
991
+ * mergeStyles
992
+ *
993
+ * Per-slot merge for a `styles` prop (e.g. Mantine's StylesApi) against Recursica's own default
994
+ * inline styles for that slot. Mirrors `mergeClassNames`'s shape but the merge is a plain object
995
+ * merge instead of a string concat, since each slot's value is a `CSSProperties` object, not a
996
+ * class list: the caller's individual style properties override ours property-by-property
997
+ * without dropping properties they didn't touch.
998
+ *
999
+ * Merges over the UNION of slots in `ours` and `callerValue`, not just `ours`'s keys — same
1000
+ * reasoning as `mergeClassNames`: a caller may target a slot Recursica has no default for.
1001
+ *
1002
+ * @param ours - Recursica's own per-slot default styles, if any
1003
+ * @param callerValue - The caller's `styles` prop, if any
1004
+ * @returns a new styles object covering every slot named by either side
1005
+ */
1006
+ export declare function mergeStyles<T extends Record<string, default_2.CSSProperties | undefined>>(ours: T, callerValue: Partial<Record<keyof T, default_2.CSSProperties>> | undefined): T;
972
1007
 
973
1008
  export declare const Modal: typeof rawComponents.Modal;
974
1009
 
@@ -976,10 +1011,9 @@ declare const Modal_2: ModalComponent & {
976
1011
  Footer: typeof ModalFooter;
977
1012
  };
978
1013
 
979
- declare const ModalBody: default_2.ForwardRefExoticComponent<Omit<ModalBodyProps & default_2.RefAttributes<HTMLDivElement> & {
980
- component?: any;
981
- renderRoot?: (props: Record<string, any>) => default_2.ReactNode;
982
- }, "ref"> & default_2.RefAttributes<HTMLDivElement>>;
1014
+ declare const ModalBody: default_2.ForwardRefExoticComponent<ModalBodyProps & default_2.RefAttributes<HTMLDivElement>>;
1015
+
1016
+ declare type ModalBodyProps = RecursicaOverStyled<ModalBodyProps_2>;
983
1017
 
984
1018
  declare const ModalCloseButton: default_2.ForwardRefExoticComponent<ModalCloseButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
985
1019
 
@@ -1045,6 +1079,32 @@ declare const NumberInput_2: default_2.ForwardRefExoticComponent<NumberInputProp
1045
1079
 
1046
1080
  declare type NumberInputProps_2 = RecursicaOverStyled<RecursicaNumberInputProps>;
1047
1081
 
1082
+ /**
1083
+ * omitUnsupportedProps
1084
+ *
1085
+ * Shared across every adapter. Where `filterStylingProps` blocks the fixed set of styling
1086
+ * escape hatches (className, style, sx, etc.), this utility deletes a component-declared list
1087
+ * of named props that component doesn't support at all — e.g. a native prop the underlying
1088
+ * library exposes but Recursica intentionally doesn't map (`size`, `color`, `radius`, ...).
1089
+ *
1090
+ * `Omit<LibraryProps, "size">` on the public type already stops well-typed callers. This is the
1091
+ * runtime backstop: a plain-JavaScript caller (or anyone forcing the type) can still put `size`
1092
+ * on the props object, and without this it would leak straight through `...rest` into the
1093
+ * wrapped component. Call this immediately after `filterStylingProps`, on every component
1094
+ * (including sub-components merged onto a parent, e.g. `Table.Th`), declaring the omitted keys
1095
+ * as a local `UNSUPPORTED_PROPS` const with a comment per prop explaining why it's unsupported.
1096
+ *
1097
+ * @param props - Props already run through `filterStylingProps`
1098
+ * @param unsupportedProps - Component-declared list of prop names to delete. Typed as
1099
+ * `PropertyKey`, not `keyof T`, on purpose: `T` is the already-narrowed `rest`/`sanitizedProps`
1100
+ * type, which typically has these props `Omit<>`'d out of it already — the whole point of
1101
+ * `UNSUPPORTED_PROPS` is to still catch them at runtime. Type `UNSUPPORTED_PROPS` itself
1102
+ * against the underlying library's full props type instead, e.g.
1103
+ * `as const satisfies readonly (keyof MantineButtonProps)[]`.
1104
+ * @returns `props` with every key in `unsupportedProps` removed
1105
+ */
1106
+ export declare function omitUnsupportedProps<T extends Record<string, unknown>>(props: T, unsupportedProps: readonly PropertyKey[]): Partial<T>;
1107
+
1048
1108
  export declare const Pagination: typeof rawComponents.Pagination;
1049
1109
 
1050
1110
  declare const _Pagination: default_2.ForwardRefExoticComponent<PaginationProps & default_2.RefAttributes<HTMLDivElement>>;
@@ -1245,7 +1305,7 @@ export declare const Popover: typeof rawComponents.Popover;
1245
1305
  declare const Popover_2: PopoverComponent;
1246
1306
 
1247
1307
  declare const PopoverBase: {
1248
- ({ overStyled, withBeak, ...rest }: PopoverProps): JSX.Element;
1308
+ ({ overStyled, withBeak, position, ...rest }: PopoverProps): JSX.Element;
1249
1309
  displayName: string;
1250
1310
  };
1251
1311
 
@@ -1401,6 +1461,7 @@ declare namespace rawComponents {
1401
1461
  Menu_2 as Menu,
1402
1462
  ModalProps,
1403
1463
  ModalFooterProps,
1464
+ ModalBodyProps,
1404
1465
  ModalRootProps,
1405
1466
  ModalOverlayProps,
1406
1467
  ModalContentProps,
@@ -3087,7 +3148,7 @@ export declare const Tooltip: typeof rawComponents.Tooltip;
3087
3148
  declare const Tooltip_2: TooltipComponent;
3088
3149
 
3089
3150
  declare const TooltipBase: {
3090
- ({ overStyled, withBeak, ...rest }: TooltipProps): JSX.Element;
3151
+ ({ overStyled, withBeak, position, arrowSize, ...rest }: TooltipProps): JSX.Element;
3091
3152
  displayName: string;
3092
3153
  };
3093
3154
 
@@ -3149,6 +3210,23 @@ declare type TreeProps = RecursicaOverStyled<RecursicaTreeProps & Omit<default_2
3149
3210
  */
3150
3211
  export declare function useGlobalOverStyled(): boolean;
3151
3212
 
3213
+ /**
3214
+ * withCallerOverride
3215
+ *
3216
+ * Resolves a single prop where Recursica supplies a default but the caller should be able to
3217
+ * override it. Use this only when the default can't be expressed as a plain destructured default
3218
+ * (`const { variant = "solid" } = props`) — e.g. the default is computed from other props/state
3219
+ * inside the component body, so it isn't known until after `rest` has already been destructured.
3220
+ *
3221
+ * Do not rely on spread order for this (`{...sanitizedProps, ...overrides}` never carries this
3222
+ * intent implicitly) — resolve the value explicitly and place the result in `overrides`.
3223
+ *
3224
+ * @param ourDefault - The value Recursica falls back to when the caller didn't supply one
3225
+ * @param callerValue - The raw value from the caller's props, if any
3226
+ * @returns `callerValue` if defined, else `ourDefault`
3227
+ */
3228
+ export declare function withCallerOverride<T>(ourDefault: T, callerValue: T | undefined): T;
3229
+
3152
3230
  /**
3153
3231
  * Universal execution barrier trapping readOnly states globally.
3154
3232
  * Natively delegates active logic down avoiding duplicative internal component bindings dynamically.