@recursica/mantine-adapter 0.50.2 → 0.50.5

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 (73) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/index.d.ts +107 -139
  3. package/dist/mantine-adapter.cjs +1 -1
  4. package/dist/mantine-adapter.cjs.map +1 -1
  5. package/dist/mantine-adapter.css +1 -1
  6. package/dist/mantine-adapter.js +535 -532
  7. package/dist/mantine-adapter.js.map +1 -1
  8. package/package.json +5 -4
  9. package/src/components/Accordion/Accordion.test.tsx +1 -0
  10. package/src/components/AssistiveElement/AssistiveElement.test.tsx +1 -0
  11. package/src/components/AutoComplete/AutoComplete.test.tsx +1 -0
  12. package/src/components/Avatar/Avatar.test.tsx +1 -0
  13. package/src/components/Badge/Badge.test.tsx +1 -0
  14. package/src/components/Breadcrumb/Breadcrumb.test.tsx +1 -0
  15. package/src/components/Button/Button.module.css +1 -0
  16. package/src/components/Button/Button.styleIsolation.dom.test.tsx +98 -0
  17. package/src/components/Button/IMPLEMENTATION_NOTES.md +2 -0
  18. package/src/components/Card/Card.test.tsx +1 -0
  19. package/src/components/Checkbox/Checkbox.test.tsx +1 -0
  20. package/src/components/Chip/CHIP_IMPLEMENTATION_NOTES.md +13 -0
  21. package/src/components/Chip/Chip.stories.tsx +11 -0
  22. package/src/components/Chip/Chip.test.tsx +1 -0
  23. package/src/components/Chip/Chip.tsx +6 -1
  24. package/src/components/Container/Container.test.tsx +1 -0
  25. package/src/components/DatePicker/DatePicker.test.tsx +1 -0
  26. package/src/components/Dropdown/Dropdown.test.tsx +1 -0
  27. package/src/components/FileInput/FileInput.test.tsx +1 -0
  28. package/src/components/FileUpload/FileUpload.test.tsx +1 -0
  29. package/src/components/Flex/Flex.test.tsx +1 -0
  30. package/src/components/Flex/Flex.tsx +5 -5
  31. package/src/components/FormControlLayout/FormControlLayout.test.tsx +1 -0
  32. package/src/components/FormControlWrapper/FormControlWrapper.test.tsx +1 -0
  33. package/src/components/Grid/GRID_IMPLEMENTATION_NOTES.md +2 -2
  34. package/src/components/Grid/Grid.stories.tsx +11 -11
  35. package/src/components/Grid/Grid.test.tsx +1 -0
  36. package/src/components/Grid/Grid.tsx +10 -15
  37. package/src/components/Grid/USAGE.md +3 -3
  38. package/src/components/Group/Group.test.tsx +1 -0
  39. package/src/components/Group/Group.tsx +5 -5
  40. package/src/components/HoverCard/HoverCard.test.tsx +1 -0
  41. package/src/components/Label/Label.test.tsx +1 -0
  42. package/src/components/Link/Link.test.tsx +1 -0
  43. package/src/components/Loader/Loader.test.tsx +1 -0
  44. package/src/components/Menu/Menu.test.tsx +1 -0
  45. package/src/components/Modal/Modal.test.tsx +1 -0
  46. package/src/components/NumberInput/NumberInput.test.tsx +1 -0
  47. package/src/components/Pagination/Pagination.test.tsx +1 -0
  48. package/src/components/Panel/Panel.test.tsx +1 -0
  49. package/src/components/Popover/Popover.test.tsx +1 -0
  50. package/src/components/Radio/Radio.test.tsx +1 -0
  51. package/src/components/ReadOnlyField/ReadOnlyField.test.tsx +1 -0
  52. package/src/components/SegmentedControl/SegmentedControl.test.tsx +1 -0
  53. package/src/components/Slider/Slider.test.tsx +1 -0
  54. package/src/components/Stack/Stack.test.tsx +1 -0
  55. package/src/components/Stack/Stack.tsx +5 -5
  56. package/src/components/Stepper/Stepper.test.tsx +1 -0
  57. package/src/components/Switch/Switch.test.tsx +1 -0
  58. package/src/components/Table/Table.test.tsx +1 -0
  59. package/src/components/Tabs/Tabs.test.tsx +1 -0
  60. package/src/components/Text/Text.stories.tsx +3 -16
  61. package/src/components/Text/Text.test.tsx +1 -0
  62. package/src/components/TextArea/TextArea.test.tsx +1 -0
  63. package/src/components/TextField/TextField.test.tsx +1 -0
  64. package/src/components/TimePicker/TimePicker.test.tsx +1 -0
  65. package/src/components/Timeline/Timeline.test.tsx +1 -0
  66. package/src/components/Title/Title.stories.tsx +3 -16
  67. package/src/components/Title/Title.test.tsx +1 -0
  68. package/src/components/Toast/Toast.test.tsx +1 -0
  69. package/src/components/Tooltip/Tooltip.test.tsx +1 -0
  70. package/src/components/TransferList/TransferList.test.tsx +1 -0
  71. package/src/components/Tree/Tree.test.tsx +1 -0
  72. package/src/utils/filterStylingProps.test.ts +85 -0
  73. package/src/utils/filterStylingProps.ts +1 -0
@@ -1,6 +1,5 @@
1
1
  import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Title } from "./Title";
3
- import { Layer } from "@recursica/adapter-common";
4
3
 
5
4
  const meta: Meta<typeof Title> = {
6
5
  title: "UI-Kit/Title",
@@ -33,31 +32,19 @@ export const Default: Story = {
33
32
  order: 1,
34
33
  children: "Semantic H1 Document Boundary",
35
34
  },
36
- render: ({ ...args }) => (
37
- <Layer layer={0} style={{ padding: "48px" }}>
38
- <Title {...args} />
39
- </Layer>
40
- ),
35
+ render: ({ ...args }) => <Title {...args} />,
41
36
  };
42
37
 
43
38
  export const StaticVariations: Story = {
44
39
  args: {},
45
40
  render: () => (
46
- <Layer
47
- layer={0}
48
- style={{
49
- padding: "48px",
50
- display: "flex",
51
- flexDirection: "column",
52
- gap: "24px",
53
- }}
54
- >
41
+ <div style={{ display: "flex", flexDirection: "column", gap: "24px" }}>
55
42
  <Title order={1}>H1 Title</Title>
56
43
  <Title order={2}>H2 Title</Title>
57
44
  <Title order={3}>H3 Title</Title>
58
45
  <Title order={4}>H4 Title</Title>
59
46
  <Title order={5}>H5 Title</Title>
60
47
  <Title order={6}>H6 Title</Title>
61
- </Layer>
48
+ </div>
62
49
  ),
63
50
  };
@@ -0,0 +1 @@
1
+ // Placeholder for future Title component tests. Add tests here if/when needed.
@@ -0,0 +1 @@
1
+ // Placeholder for future Toast component tests. Add tests here if/when needed.
@@ -0,0 +1 @@
1
+ // Placeholder for future Tooltip component tests. Add tests here if/when needed.
@@ -0,0 +1 @@
1
+ // Placeholder for future TransferList component tests. Add tests here if/when needed.
@@ -0,0 +1 @@
1
+ // Placeholder for future Tree component tests. Add tests here if/when needed.
@@ -0,0 +1,85 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import {
3
+ BLOCKED_STYLING_KEYS,
4
+ SPACING_MAP,
5
+ filterStylingProps,
6
+ mapLayoutProps,
7
+ } from "./filterStylingProps";
8
+
9
+ describe("filterStylingProps", () => {
10
+ it("strips every blocked styling key by default", () => {
11
+ const props = Object.fromEntries(
12
+ BLOCKED_STYLING_KEYS.map((key) => [key, "should-be-removed"]),
13
+ );
14
+
15
+ const sanitized = filterStylingProps(props);
16
+
17
+ for (const key of BLOCKED_STYLING_KEYS) {
18
+ expect(sanitized).not.toHaveProperty(key);
19
+ }
20
+ });
21
+
22
+ it("keeps props that aren't blocked styling keys", () => {
23
+ const sanitized = filterStylingProps({
24
+ disabled: true,
25
+ "aria-label": "Submit",
26
+ });
27
+
28
+ expect(sanitized).toEqual({ disabled: true, "aria-label": "Submit" });
29
+ });
30
+
31
+ it("keeps layout props (e.g. margin) untouched when not a rec- token", () => {
32
+ const sanitized = filterStylingProps({ m: "16px" });
33
+
34
+ expect(sanitized).toEqual({ m: "16px" });
35
+ });
36
+
37
+ it("maps rec- spacing tokens on layout props to their CSS variable", () => {
38
+ const sanitized = filterStylingProps({ m: "rec-lg", gap: "rec-sm" });
39
+
40
+ expect(sanitized).toEqual({
41
+ m: SPACING_MAP["rec-lg"],
42
+ gap: SPACING_MAP["rec-sm"],
43
+ });
44
+ });
45
+
46
+ it("does not map rec- tokens on props that aren't layout props", () => {
47
+ const sanitized = filterStylingProps({ "data-testid": "rec-lg" });
48
+
49
+ expect(sanitized).toEqual({ "data-testid": "rec-lg" });
50
+ });
51
+
52
+ it("leaves an unrecognized rec- value alone", () => {
53
+ const sanitized = filterStylingProps({ m: "rec-not-a-real-token" });
54
+
55
+ expect(sanitized).toEqual({ m: "rec-not-a-real-token" });
56
+ });
57
+
58
+ it("bypasses all filtering when overStyled is true", () => {
59
+ const props = { className: "custom", bg: "red", m: "rec-lg" };
60
+
61
+ expect(filterStylingProps(props, true)).toEqual(props);
62
+ });
63
+
64
+ it("does not mutate the input props object", () => {
65
+ const props = { className: "custom", m: "rec-lg" };
66
+
67
+ filterStylingProps(props);
68
+
69
+ expect(props).toEqual({ className: "custom", m: "rec-lg" });
70
+ });
71
+ });
72
+
73
+ describe("mapLayoutProps", () => {
74
+ it("maps rec- spacing tokens on layout props", () => {
75
+ expect(mapLayoutProps({ mt: "rec-xl" })).toEqual({
76
+ mt: SPACING_MAP["rec-xl"],
77
+ });
78
+ });
79
+
80
+ it("leaves non-layout props untouched even if they look like a token", () => {
81
+ expect(mapLayoutProps({ variant: "rec-xl" })).toEqual({
82
+ variant: "rec-xl",
83
+ });
84
+ });
85
+ });
@@ -84,6 +84,7 @@ const LAYOUT_PROPS = new Set([
84
84
  "gap",
85
85
  "rowGap",
86
86
  "columnGap",
87
+ "gutter",
87
88
  "top",
88
89
  "left",
89
90
  "bottom",