@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 +22 -0
- package/dist/NavList/index.d.ts +1 -1
- package/package.json +4 -4
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:**
|
package/dist/NavList/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/components",
|
|
3
|
-
"version": "2.6.
|
|
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/
|
|
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
|
},
|