@recursica/mantine-adapter 0.14.0 → 0.16.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 (33) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/mantine-adapter.cjs +1 -1
  3. package/dist/mantine-adapter.cjs.map +1 -1
  4. package/dist/mantine-adapter.css +1 -1
  5. package/dist/mantine-adapter.js +1439 -1251
  6. package/dist/mantine-adapter.js.map +1 -1
  7. package/dist/src/components/Button/Button.d.ts +7 -1
  8. package/dist/src/components/Link/Link.d.ts +32 -2
  9. package/dist/src/components/Link/index.d.ts +1 -0
  10. package/dist/src/components/Pagination/Pagination.d.ts +50 -2
  11. package/dist/src/components/Pagination/Pagination.icons.d.ts +8 -0
  12. package/dist/src/components/Pagination/index.d.ts +1 -0
  13. package/dist/src/components/Panel/Panel.d.ts +10 -2
  14. package/package.json +1 -1
  15. package/src/components/Button/Button.stories.tsx +11 -0
  16. package/src/components/Button/Button.tsx +7 -1
  17. package/src/components/Card/Card.module.css +1 -0
  18. package/src/components/Card/Card.stories.tsx +48 -58
  19. package/src/components/Link/IMPLEMENTATION_NOTES.md +26 -0
  20. package/src/components/Link/Link.module.css +133 -0
  21. package/src/components/Link/Link.stories.tsx +46 -4
  22. package/src/components/Link/Link.tsx +82 -5
  23. package/src/components/Link/index.ts +1 -0
  24. package/src/components/Pagination/IMPLEMENTATION_NOTES.md +16 -0
  25. package/src/components/Pagination/Pagination.icons.tsx +66 -0
  26. package/src/components/Pagination/Pagination.module.css +225 -0
  27. package/src/components/Pagination/Pagination.stories.tsx +44 -4
  28. package/src/components/Pagination/Pagination.tsx +214 -4
  29. package/src/components/Pagination/index.ts +5 -0
  30. package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +3 -3
  31. package/src/components/Panel/Panel.module.css +11 -0
  32. package/src/components/Panel/Panel.stories.tsx +12 -1
  33. package/src/components/Panel/Panel.tsx +12 -2
@@ -86,11 +86,11 @@ Mantine's Drawer content does not set `border-style` natively. Without this, the
86
86
 
87
87
  ---
88
88
 
89
- ## 7. header-style Token Reference Bug
89
+ ## 7. `header-style` Typography Utility Class
90
90
 
91
- **Decision:** The `header-style: "h3"` token currently outputs as a raw string in the UI kit JSON, breaking our PostCSS compiler when mapped as CSS variable fallbacks. We have explicitly removed these fallbacks.
91
+ **Decision:** The `header-style` token exports as the string `"h3"`, so we use the generated global utility class `.recursica_brand_typography_h3`.
92
92
 
93
- **Implementation:** The design system intended for the `header-style` token to act as a proper typography reference, which would compile into fully expanded properties like `--recursica_ui-kit_components_panel_properties_header-style_fontFamily`. Because the JSON export currently passes it as the raw string `"h3"`, attempting to bind to the non-existent variables breaks the build plugin. Until the JSON export is fixed to compile proper reference nodes, we are stripping typography bindings from the `.title` class and relying purely on `color` and Mantine's defaults.
93
+ **Implementation:** The PostCSS compiler generates `.recursica_brand_typography_<typeName>` classes at the bottom of the scoped variables file to apply full typography definitions without assigning variables inline. We apply this to the `.title` class via `composes: recursica_brand_typography_h3 from global;`.
94
94
 
95
95
  ---
96
96
 
@@ -64,6 +64,17 @@
64
64
 
65
65
  .title {
66
66
  color: var(--recursica_ui-kit_components_panel_properties_colors_title);
67
+ composes: recursica_brand_typography_h3 from global;
68
+ }
69
+
70
+ .titleTruncate {
71
+ composes: title;
72
+ white-space: nowrap;
73
+ overflow: hidden;
74
+ text-overflow: ellipsis;
75
+ display: block;
76
+ flex: 1;
77
+ min-width: 0;
67
78
  }
68
79
 
69
80
  /* ======================================
@@ -29,6 +29,11 @@ const meta: Meta = {
29
29
  control: "boolean",
30
30
  description: "Whether to display the close button in the header.",
31
31
  },
32
+ wrapHeaderText: {
33
+ control: "boolean",
34
+ description:
35
+ "If true, forces the header text to a single line and truncates with an ellipsis.",
36
+ },
32
37
  // Hide auto-detected HTML attributes
33
38
  defaultChecked: { table: { disable: true } },
34
39
  defaultValue: { table: { disable: true } },
@@ -77,8 +82,9 @@ export const Default: Story = {
77
82
  title: "Panel Title",
78
83
  withOverlay: true,
79
84
  withCloseButton: true,
85
+ wrapHeaderText: false,
80
86
  },
81
- render: () => {
87
+ render: ({ wrapHeaderText, ...args }: PanelStoryArgs) => {
82
88
  // eslint-disable-next-line react-hooks/rules-of-hooks
83
89
  const [opened, setOpened] = useState(false);
84
90
 
@@ -92,6 +98,8 @@ export const Default: Story = {
92
98
  onClose={() => setOpened(false)}
93
99
  title="Panel Title"
94
100
  position="right"
101
+ wrapHeaderText={wrapHeaderText}
102
+ {...(args as PanelProps)}
95
103
  >
96
104
  <Text>
97
105
  This is the panel body content area. Panels slide in from the edge
@@ -116,6 +124,7 @@ export const LeftPosition: Story = {
116
124
  title: "Navigation",
117
125
  withOverlay: true,
118
126
  withCloseButton: true,
127
+ wrapHeaderText: false,
119
128
  },
120
129
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
121
130
  render: ({ withLayer, layer, ...args }: PanelStoryArgs) => {
@@ -148,6 +157,7 @@ export const ScrollableContent: Story = {
148
157
  title: "Scrollable Panel",
149
158
  withOverlay: true,
150
159
  withCloseButton: true,
160
+ wrapHeaderText: false,
151
161
  },
152
162
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
153
163
  render: ({ withLayer, layer, ...args }: PanelStoryArgs) => {
@@ -190,6 +200,7 @@ export const LongTitle: Story = {
190
200
  "This is a ridiculously long panel title designed to test how the header CSS handles text overflow and whether it truncates correctly or breaks the layout",
191
201
  withOverlay: true,
192
202
  withCloseButton: true,
203
+ wrapHeaderText: true,
193
204
  },
194
205
  render: ({ ...args }: PanelStoryArgs) => {
195
206
  // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -13,10 +13,19 @@ import styles from "./Panel.module.css";
13
13
  // PANEL (Drawer)
14
14
  // ============================================================
15
15
 
16
+ export interface RecursicaPanelProps extends MantineDrawerProps {
17
+ /**
18
+ * If true, forces the header text to a single line and truncates with an ellipsis.
19
+ * Note: While the prop is named `wrapHeaderText` for backward compatibility,
20
+ * setting it to `true` actually PREVENTS wrapping (it forces truncation).
21
+ */
22
+ wrapHeaderText?: boolean;
23
+ }
24
+
16
25
  /**
17
26
  * Recursica Panel root props. Extends Mantine Drawer.
18
27
  */
19
- export type PanelProps = RecursicaOverStyled<MantineDrawerProps>;
28
+ export type PanelProps = RecursicaOverStyled<RecursicaPanelProps>;
20
29
 
21
30
  /**
22
31
  * Recursica Panel component wrapping Mantine's Drawer.
@@ -48,6 +57,7 @@ const PanelBase = function Panel({
48
57
  overStyled = false,
49
58
  position = "right",
50
59
  keepMounted = true,
60
+ wrapHeaderText = false,
51
61
  ...rest
52
62
  }: PanelProps) {
53
63
  const sanitizedProps = filterStylingProps(rest, overStyled);
@@ -56,7 +66,7 @@ const PanelBase = function Panel({
56
66
  const mergedClassNames: Partial<Record<string, string>> = {
57
67
  content: styles.content,
58
68
  header: styles.header,
59
- title: styles.title,
69
+ title: wrapHeaderText ? styles.titleTruncate : styles.title,
60
70
  body: styles.body,
61
71
  inner: styles.inner,
62
72
  };