@ttoss/components 2.6.1 → 2.6.2

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/README.md CHANGED
@@ -224,6 +224,28 @@ import NextLink from 'next/link';
224
224
  LinkComponent={NextLink}
225
225
  onItemClick={(item) => console.log('Clicked:', item)}
226
226
  />
227
+
228
+ // Custom Link Component
229
+ // IMPORTANT: Always spread {...props} to preserve styling
230
+ // React Router example (uses 'to' instead of 'href')
231
+ import { Link as RouterLink } from 'react-router-dom';
232
+
233
+ const ReactRouterLink = ({
234
+ href,
235
+ children,
236
+ ...props
237
+ }: React.PropsWithChildren<LinkComponentProps>) => {
238
+ return (
239
+ <RouterLink
240
+ to={href}
241
+ {...props} // Required to preserve NavList styles
242
+ >
243
+ {children}
244
+ </RouterLink>
245
+ );
246
+ };
247
+
248
+ <NavList items={items} LinkComponent={ReactRouterLink} />
227
249
  ```
228
250
 
229
251
  **Variants:**
@@ -52,4 +52,4 @@ declare const NavList: {
52
52
  displayName: string;
53
53
  };
54
54
 
55
- export { NavList, type NavListGroup, type NavListItem, type NavListProps };
55
+ export { type LinkComponentProps, NavList, type NavListGroup, type NavListItem, type NavListProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/components",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "description": "React components for ttoss ecosystem.",
5
5
  "license": "MIT",
6
6
  "author": "ttoss",
@@ -116,11 +116,11 @@
116
116
  "react": "^19.2.0",
117
117
  "tsup": "^8.5.0",
118
118
  "tsx": "^4.19.2",
119
- "@ttoss/react-hooks": "^2.1.5",
120
119
  "@ttoss/config": "^1.35.9",
121
- "@ttoss/i18n-cli": "^0.7.35",
122
- "@ttoss/react-icons": "^0.5.0",
120
+ "@ttoss/react-hooks": "^2.1.5",
123
121
  "@ttoss/react-i18n": "^2.0.19",
122
+ "@ttoss/react-icons": "^0.5.0",
123
+ "@ttoss/i18n-cli": "^0.7.35",
124
124
  "@ttoss/test-utils": "^3.0.1",
125
125
  "@ttoss/ui": "^5.10.4"
126
126
  },