@shohojdhara/atomix 0.4.2 → 0.4.3
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/dist/atomix.css +12 -12
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +1 -1
- package/dist/atomix.min.css.map +1 -1
- package/dist/core.d.ts +5 -1
- package/dist/core.js +20 -6
- package/dist/core.js.map +1 -1
- package/dist/heavy.js +1 -0
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.esm.js +71 -37
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +69 -35
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +3 -4
- package/src/components/Button/Button.tsx +2 -1
- package/src/components/Card/Card.tsx +31 -11
- package/src/components/Dropdown/Dropdown.tsx +276 -273
- package/src/components/Footer/FooterLink.tsx +2 -2
- package/src/components/Navigation/Nav/NavItem.tsx +6 -3
- package/src/lib/types/components.ts +5 -0
- package/src/styles/02-tools/_tools.utility-api.scss +4 -4
package/package.json
CHANGED
|
@@ -121,14 +121,13 @@ export const BreadcrumbItem = forwardRef<HTMLLIElement, BreadcrumbItemProps>(
|
|
|
121
121
|
...linkProps,
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
const LinkComponent = linkAs
|
|
124
|
+
const LinkComponent = linkAs as React.ComponentType<any>;
|
|
125
125
|
|
|
126
126
|
return (
|
|
127
127
|
<li ref={ref} className={itemClasses} style={style} {...props}>
|
|
128
128
|
{href && !active ? (
|
|
129
|
-
LinkComponent ? (
|
|
130
|
-
|
|
131
|
-
<LinkComponent href={href} {...commonLinkProps}>
|
|
129
|
+
linkAs && LinkComponent ? (
|
|
130
|
+
<LinkComponent href={href} to={href} {...commonLinkProps}>
|
|
132
131
|
{linkContent}
|
|
133
132
|
</LinkComponent>
|
|
134
133
|
) : (
|
|
@@ -10,7 +10,7 @@ export type ButtonAsProp = {
|
|
|
10
10
|
as?: ElementType;
|
|
11
11
|
to?: string;
|
|
12
12
|
href?: string;
|
|
13
|
-
LinkComponent?: React.
|
|
13
|
+
LinkComponent?: React.ElementType;
|
|
14
14
|
[key: string]: any;
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -227,6 +227,7 @@ export const Button = React.memo(
|
|
|
227
227
|
...buttonProps,
|
|
228
228
|
ref: ref as any, // LinkComponent usually forwards ref to anchor
|
|
229
229
|
href,
|
|
230
|
+
to: href,
|
|
230
231
|
target,
|
|
231
232
|
rel: target === '_blank' ? 'noopener noreferrer' : undefined,
|
|
232
233
|
};
|
|
@@ -39,6 +39,8 @@ export const Card = React.memo(
|
|
|
39
39
|
onFocus,
|
|
40
40
|
href,
|
|
41
41
|
target,
|
|
42
|
+
// Custom Link
|
|
43
|
+
LinkComponent,
|
|
42
44
|
// Glass
|
|
43
45
|
glass,
|
|
44
46
|
// Accessibility
|
|
@@ -242,17 +244,35 @@ export const Card = React.memo(
|
|
|
242
244
|
|
|
243
245
|
// Render as anchor if href is provided
|
|
244
246
|
if (href && !isDisabled) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
247
|
+
let anchorElement: React.ReactElement;
|
|
248
|
+
|
|
249
|
+
if (LinkComponent) {
|
|
250
|
+
const LinkComp = LinkComponent as React.ComponentType<any>;
|
|
251
|
+
anchorElement = (
|
|
252
|
+
<LinkComp
|
|
253
|
+
{...commonProps}
|
|
254
|
+
ref={ref as React.Ref<HTMLAnchorElement>}
|
|
255
|
+
href={href}
|
|
256
|
+
to={href}
|
|
257
|
+
target={target}
|
|
258
|
+
rel={target === '_blank' ? 'noopener noreferrer' : undefined}
|
|
259
|
+
>
|
|
260
|
+
{cardContent}
|
|
261
|
+
</LinkComp>
|
|
262
|
+
);
|
|
263
|
+
} else {
|
|
264
|
+
anchorElement = (
|
|
265
|
+
<a
|
|
266
|
+
{...commonProps}
|
|
267
|
+
ref={ref as React.Ref<HTMLAnchorElement>}
|
|
268
|
+
href={href}
|
|
269
|
+
target={target}
|
|
270
|
+
rel={target === '_blank' ? 'noopener noreferrer' : undefined}
|
|
271
|
+
>
|
|
272
|
+
{cardContent}
|
|
273
|
+
</a>
|
|
274
|
+
);
|
|
275
|
+
}
|
|
256
276
|
|
|
257
277
|
if (glass) {
|
|
258
278
|
const glassProps = glass === true ? {} : glass;
|