@arc-ui/community-components 3.1.0 → 3.3.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.
- package/.turbo/turbo-build.log +14 -14
- package/CHANGELOG.md +31 -0
- package/lib/Accordion/Accordion.cjs +2 -3
- package/lib/Accordion/Accordion.mjs +2 -3
- package/lib/ActionTile/ActionTile.cjs +4 -5
- package/lib/ActionTile/ActionTile.mjs +2 -3
- package/lib/ActionTile/styles.css +1 -1
- package/lib/ArticleSidebar/ArticleSidebar.cjs +9 -10
- package/lib/ArticleSidebar/ArticleSidebar.mjs +4 -5
- package/lib/Author/Author.cjs +2 -3
- package/lib/Author/Author.mjs +2 -3
- package/lib/BannerWithTabs/BannerWithTabs.cjs +4 -5
- package/lib/BannerWithTabs/BannerWithTabs.mjs +4 -5
- package/lib/ContentInfoWidget/ContentInfoWidget.cjs +3 -2
- package/lib/ContentInfoWidget/ContentInfoWidget.mjs +3 -2
- package/lib/CopyLead/CopyLead.cjs +15 -16
- package/lib/CopyLead/CopyLead.mjs +3 -4
- package/lib/DownloadList/DownloadList.cjs +6 -8
- package/lib/DownloadList/DownloadList.mjs +6 -8
- package/lib/FAQs/FAQs.cjs +15 -12
- package/lib/FAQs/FAQs.mjs +13 -10
- package/lib/FeaturePost/FeaturePost.cjs +23 -17
- package/lib/FeaturePost/FeaturePost.mjs +18 -12
- package/lib/Highlights/Highlights.cjs +11 -12
- package/lib/Highlights/Highlights.mjs +11 -12
- package/lib/InlineLinkGroup/InlineLinkGroup.cjs +25 -0
- package/lib/InlineLinkGroup/InlineLinkGroup.mjs +23 -0
- package/lib/InlineLinkGroup/styles.css +1 -0
- package/lib/LinkTile/LinkTile.cjs +6 -6
- package/lib/LinkTile/LinkTile.mjs +4 -4
- package/lib/LinkTile/styles.css +1 -1
- package/lib/ProductNavigation/ProductNavigation.cjs +6 -7
- package/lib/ProductNavigation/ProductNavigation.mjs +3 -4
- package/lib/PromoListing/PromoListing.cjs +7 -8
- package/lib/PromoListing/PromoListing.mjs +5 -6
- package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.cjs +27 -0
- package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.mjs +25 -0
- package/lib/PromoListingThumbnailSignpost/styles.css +1 -0
- package/lib/Quote/Quote.cjs +5 -6
- package/lib/Quote/Quote.mjs +3 -4
- package/lib/SectionHeading/SectionHeading.cjs +2 -3
- package/lib/SectionHeading/SectionHeading.mjs +2 -3
- package/lib/Statistics/Statistics.cjs +21 -19
- package/lib/Statistics/Statistics.mjs +21 -19
- package/lib/Statistics/styles.css +1 -1
- package/lib/Summary/Summary.cjs +4 -4
- package/lib/Summary/Summary.mjs +4 -4
- package/lib/ThumbnailSignpost/ThumbnailSignpost.cjs +14 -0
- package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +8 -0
- package/lib/ThumbnailSignpost/styles.css +1 -0
- package/lib/_shared/cjs/{Accordion-BCJIm1Gq.cjs → Accordion-QqDoB3pY.cjs} +9 -10
- package/lib/_shared/cjs/{Author-D4dKNQem.cjs → Author-aL8YXi7C.cjs} +4 -5
- package/lib/_shared/cjs/{SectionHeading-DeSFM0HV.cjs → SectionHeading-Dj-dJfv3.cjs} +4 -5
- package/lib/_shared/cjs/ThumbnailSignpost-SBnrGooA.cjs +38 -0
- package/lib/_shared/cjs/{tslib.es6-BxB9I209.cjs → filter-attrs-C26zOt4_.cjs} +25 -0
- package/lib/_shared/cjs/{index.es-DzI6hGjj.cjs → index.es-Dq8bYrbW.cjs} +1 -1
- package/lib/_shared/esm/{Accordion-BN_lZk6L.mjs → Accordion-DrOTh90S.mjs} +2 -3
- package/lib/_shared/esm/{Author-HnYsFTPT.mjs → Author-BVCRPgkl.mjs} +1 -2
- package/lib/_shared/esm/{SectionHeading-CpDLCndw.mjs → SectionHeading-DZOg_gYi.mjs} +1 -2
- package/lib/_shared/esm/ThumbnailSignpost-DaZByYIH.mjs +36 -0
- package/lib/_shared/esm/{tslib.es6-D6Wu-xwB.mjs → filter-attrs-D-1kWaCP.mjs} +25 -1
- package/lib/_shared/esm/{index.es-B6Bolkcx.mjs → index.es-Bfdys5__.mjs} +1 -1
- package/lib/index.cjs +218 -173
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +60 -64
- package/lib/index.d.mts +60 -64
- package/lib/index.mjs +216 -173
- package/lib/index.mjs.map +1 -1
- package/lib/styles.css +1 -1
- package/package.json +13 -13
- package/src/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.tsx +1 -1
- package/src/components/ActionTile/ActionTile.module.css +56 -37
- package/src/components/ActionTile/ActionTile.tsx +1 -1
- package/src/components/ArticleSidebar/ArticleSidebar.tsx +4 -6
- package/src/components/Author/Author.tsx +0 -3
- package/src/components/BannerWithTabs/BannerWithTabs.tsx +4 -6
- package/src/components/ContentInfoWidget/ContentInfoWidget.tsx +3 -4
- package/src/components/DownloadList/DownloadList.tsx +8 -8
- package/src/components/FAQs/FAQs.tsx +13 -6
- package/src/components/FeaturePost/FeaturePost.tsx +9 -9
- package/src/components/FeaturePost/components/Image/Image.tsx +31 -7
- package/src/components/FeaturePost/types/feature-post-image.ts +2 -0
- package/src/components/Highlights/Highlights.tsx +3 -2
- package/src/components/Highlights/components/HighlightItem/HighlightItem.tsx +3 -2
- package/src/components/Highlights/components/HighlightList/HighlightList.tsx +5 -2
- package/src/components/InlineLinkGroup/InlineLinkGroup.module.css +81 -0
- package/src/components/InlineLinkGroup/InlineLinkGroup.tsx +67 -0
- package/src/components/InlineLinkGroup/index.ts +5 -0
- package/src/components/LinkTile/LinkTile.module.css +62 -26
- package/src/components/LinkTile/LinkTile.tsx +8 -1
- package/src/components/PromoListing/PromoListing.tsx +3 -11
- package/src/components/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.module.css +54 -0
- package/src/components/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.tsx +53 -0
- package/src/components/PromoListingThumbnailSignpost/index.ts +4 -0
- package/src/components/Quote/Quote.tsx +1 -7
- package/src/components/Statistics/Statistics.module.css +0 -10
- package/src/components/Statistics/Statistics.tsx +35 -32
- package/src/components/Summary/Summary.tsx +3 -1
- package/src/components/ThumbnailSignpost/ThumbnailSignpost.module.css +112 -0
- package/src/components/ThumbnailSignpost/ThumbnailSignpost.tsx +100 -0
- package/src/components/ThumbnailSignpost/index.ts +4 -0
- package/src/components/index.ts +3 -1
- package/versions.json +1 -1
- package/lib/HeroLink/HeroLink.cjs +0 -35
- package/lib/HeroLink/HeroLink.mjs +0 -33
- package/lib/HeroLink/styles.css +0 -1
- package/lib/_shared/cjs/filter-attrs-BizjMsy0.cjs +0 -27
- package/lib/_shared/esm/filter-attrs-DZ7RCEZm.mjs +0 -25
- package/src/components/HeroLink/HeroLink.module.css +0 -44
- package/src/components/HeroLink/HeroLink.tsx +0 -136
- package/src/components/HeroLink/index.ts +0 -2
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
@import url("@arc-ui/tokens-arc/dist/custom-media.css");
|
|
2
|
+
|
|
3
|
+
.thumbnailSignpost button {
|
|
4
|
+
all: unset;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.thumbnailSignpost {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
gap: var(--arc-size-grid-gutter-s);
|
|
12
|
+
max-width: 720px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.isLink:focus {
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
outline: var(--focus-border-weight-s) solid
|
|
18
|
+
var(--focus-colors-light-border-subtle);
|
|
19
|
+
outline-offset: 2px;
|
|
20
|
+
border-radius: calc(var(--thumbnail-signpost-border-radius-s) + 2px);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.isLink:hover {
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.content {
|
|
28
|
+
width: 100%;
|
|
29
|
+
font: var(--sem-type-body-reg-s);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.heading {
|
|
33
|
+
display: block;
|
|
34
|
+
font: var(--sem-type-mobile-semi-xxs);
|
|
35
|
+
font-family: var(--sem-font-family-heading);
|
|
36
|
+
font-size: 1em;
|
|
37
|
+
font-weight: var(--sem-font-weight-semi-bold);
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.isLink:hover .heading,
|
|
42
|
+
.isLink:focus .heading {
|
|
43
|
+
color: var(--button-v2-colors-light-text-hover);
|
|
44
|
+
text-decoration: underline;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.image {
|
|
48
|
+
width: calc(
|
|
49
|
+
(((100% + var(--arc-size-grid-gutter-s)) / 12) * 6) -
|
|
50
|
+
var(--arc-size-grid-gutter-s)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* stylelint-disable-next-line plugin/selector-bem-pattern */
|
|
55
|
+
.image img {
|
|
56
|
+
border-radius: var(--thumbnail-signpost-border-radius-s);
|
|
57
|
+
width: 100%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media (--arc-custom-media-min-width-s-px) {
|
|
61
|
+
.image {
|
|
62
|
+
width: calc(
|
|
63
|
+
(((100% + var(--arc-size-grid-gutter-s)) / 12) * 6) -
|
|
64
|
+
var(--arc-size-grid-gutter-m)
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.thumbnailSignpost {
|
|
69
|
+
gap: var(--arc-size-grid-gutter-m);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.heading {
|
|
73
|
+
font: var(--sem-type-mobile-semi-xs);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media (--arc-custom-media-min-width-xl-px) {
|
|
78
|
+
.thumbnailSignpost {
|
|
79
|
+
gap: var(--arc-size-grid-gutter-l);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.thumbnailButton {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: var(--button-v2-gap-xs);
|
|
87
|
+
color: var(--button-v2-colors-light-text-default);
|
|
88
|
+
font: var(--sem-type-interface-button-s);
|
|
89
|
+
height: var(--button-v2-size-s);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.buttonIcon {
|
|
93
|
+
background: var(--icon-color-brand-alt-light);
|
|
94
|
+
display: block;
|
|
95
|
+
height: 100%;
|
|
96
|
+
line-height: 0;
|
|
97
|
+
mask-position: center;
|
|
98
|
+
mask-size: contain;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.isLink:focus .buttonIcon,
|
|
103
|
+
.isLink:hover .buttonIcon {
|
|
104
|
+
background: var(--button-v2-colors-light-text-hover);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.isLink:hover .thumbnailButton,
|
|
108
|
+
.isLink:focus .thumbnailButton {
|
|
109
|
+
background: none;
|
|
110
|
+
color: var(--button-v2-colors-light-text-hover);
|
|
111
|
+
text-decoration: var(--sem-underline);
|
|
112
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import styles from "./ThumbnailSignpost.module.css";
|
|
5
|
+
|
|
6
|
+
import { filterAttrs } from "@arc-ui/community-utils/filter-attrs";
|
|
7
|
+
|
|
8
|
+
import { BtIconArrowRightFill } from "@arc-ui/icons/BtIconArrowRightFill";
|
|
9
|
+
|
|
10
|
+
import { Image, type ImageProps } from "@arc-ui/components/Image";
|
|
11
|
+
import { VerticalSpace } from "@arc-ui/components/VerticalSpace";
|
|
12
|
+
import { Heading } from "@arc-ui/components/Heading";
|
|
13
|
+
|
|
14
|
+
/** Use `ThumbnailSignpost` to highlight key information or navigation points with an accompanying thumbnail image or icon. */
|
|
15
|
+
export const ThumbnailSignpost = ({
|
|
16
|
+
text,
|
|
17
|
+
title,
|
|
18
|
+
img,
|
|
19
|
+
onClick,
|
|
20
|
+
buttonLabel,
|
|
21
|
+
...props
|
|
22
|
+
}: ThumbnailSignpostProps) => {
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
className={classNames(styles.thumbnailSignpost, {
|
|
26
|
+
[styles.isLink]: onClick,
|
|
27
|
+
})}
|
|
28
|
+
onClick={onClick}
|
|
29
|
+
aria-label={title}
|
|
30
|
+
tabIndex={onClick ? 0 : -1}
|
|
31
|
+
{...(onClick && { role: "button" })}
|
|
32
|
+
{...filterAttrs(props)}
|
|
33
|
+
>
|
|
34
|
+
{img && (
|
|
35
|
+
<div className={styles.image}>
|
|
36
|
+
<Image {...img} />
|
|
37
|
+
</div>
|
|
38
|
+
)}
|
|
39
|
+
<div className={styles.content}>
|
|
40
|
+
<span className={styles.heading}>{title}</span>
|
|
41
|
+
<VerticalSpace size="8" />
|
|
42
|
+
{text}
|
|
43
|
+
{buttonLabel && onClick && (
|
|
44
|
+
<>
|
|
45
|
+
<VerticalSpace size="8" />
|
|
46
|
+
<div className={styles.thumbnailButton}>
|
|
47
|
+
<span
|
|
48
|
+
className={styles.buttonIcon}
|
|
49
|
+
role="img"
|
|
50
|
+
style={{
|
|
51
|
+
height: 24,
|
|
52
|
+
width: 24,
|
|
53
|
+
maskImage: `url("${BtIconArrowRightFill}")`,
|
|
54
|
+
WebkitMaskImage: `url("${BtIconArrowRightFill}")`,
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
<Heading size="xxs">{buttonLabel}</Heading>
|
|
58
|
+
</div>
|
|
59
|
+
</>
|
|
60
|
+
)}
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export interface ThumbnailSignpostProps {
|
|
67
|
+
/**
|
|
68
|
+
* Title for the ThumbnailSignpost.
|
|
69
|
+
*/
|
|
70
|
+
title: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Text content for the ThumbnailSignpost.
|
|
74
|
+
*/
|
|
75
|
+
text: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Label for the button in the ThumbnailSignpost.
|
|
79
|
+
*/
|
|
80
|
+
buttonLabel?: string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Image properties for the ThumbnailSignpost.
|
|
84
|
+
*/
|
|
85
|
+
img?: Pick<
|
|
86
|
+
ImageProps,
|
|
87
|
+
| "src"
|
|
88
|
+
| "alt"
|
|
89
|
+
| "loading"
|
|
90
|
+
| "sizes"
|
|
91
|
+
| "srcSet"
|
|
92
|
+
| "anchor"
|
|
93
|
+
| "fadeOnLoad"
|
|
94
|
+
| "fetchPriority"
|
|
95
|
+
>;
|
|
96
|
+
/**
|
|
97
|
+
* Optional click handler for the ThumbnailSignpost.
|
|
98
|
+
*/
|
|
99
|
+
onClick?: () => void;
|
|
100
|
+
}
|
package/src/components/index.ts
CHANGED
|
@@ -14,6 +14,8 @@ export * from "./ArticleSidebar";
|
|
|
14
14
|
export * from "./ProductNavigation";
|
|
15
15
|
export * from "./SectionHeading";
|
|
16
16
|
export * from "./ContentInfoWidget";
|
|
17
|
-
export * from "./HeroLink";
|
|
18
17
|
export * from "./ActionTile";
|
|
19
18
|
export * from "./LinkTile";
|
|
19
|
+
export * from "./InlineLinkGroup";
|
|
20
|
+
export * from "./ThumbnailSignpost";
|
|
21
|
+
export * from "./PromoListingThumbnailSignpost";
|
package/versions.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
["v3.1.0","v3.0.1","v3.0.0","v2.0.0","v1.1.0","v1.0.2","v1.0.1","v1.0.0","v0.1.0"]
|
|
1
|
+
["v3.3.0","v3.2.0","v3.1.0","v3.0.1","v3.0.0","v2.0.0","v1.1.0","v1.0.2","v1.0.1","v1.0.0","v0.1.0"]
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var tslib_es6 = require('../_shared/cjs/tslib.es6-BxB9I209.cjs');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var index = require('../_shared/cjs/index-Bp6Dd2i1.cjs');
|
|
6
|
-
var BtIconArrowAltRight = require('../_shared/cjs/BtIconArrowAltRight-CLQdP61r.cjs');
|
|
7
|
-
var Icon = require('@arc-ui/components/Icon');
|
|
8
|
-
|
|
9
|
-
var styles = {"heroLink":"HeroLink-module_heroLink__WUqWB","heroLink-inner":"HeroLink-module_heroLink-inner__RE5i8","heroLink-label":"HeroLink-module_heroLink-label__93HPY","heroLink-icon":"HeroLink-module_heroLink-icon__l7o4U","heroLink--emptyLabel":"HeroLink-module_heroLink--emptyLabel__XY2sa"};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Pill-style HeroLink component with default and hover states
|
|
13
|
-
*/
|
|
14
|
-
var HeroLink = function (_a) {
|
|
15
|
-
var _b;
|
|
16
|
-
var label = _a.label, onClick = _a.onClick, href = _a.href, id = _a.id, rel = _a.rel, target = _a.target, ariaLabel = _a.ariaLabel, ref = _a.ref, props = tslib_es6.__rest(_a, ["label", "onClick", "href", "id", "rel", "target", "ariaLabel", "ref"]);
|
|
17
|
-
var HeroLinkClasses = index.classNames(styles.heroLink, (_b = {},
|
|
18
|
-
_b[styles["heroLink--emptyLabel"]] = !label,
|
|
19
|
-
_b));
|
|
20
|
-
var commonProps = tslib_es6.__assign({ id: id, onClick: onClick, ref: ref }, props);
|
|
21
|
-
if (href) {
|
|
22
|
-
return (React.createElement("a", tslib_es6.__assign({}, commonProps, { className: HeroLinkClasses, href: href, rel: rel, "aria-label": ariaLabel, target: target }),
|
|
23
|
-
React.createElement("span", { className: styles["heroLink-inner"] },
|
|
24
|
-
label && React.createElement("span", { className: styles["heroLink-label"] }, label),
|
|
25
|
-
React.createElement("span", { className: styles["heroLink-icon"] },
|
|
26
|
-
React.createElement(Icon.Icon, { testId: "hero-link-icon", size: 24, icon: BtIconArrowAltRight.BtIconArrowAltRight })))));
|
|
27
|
-
}
|
|
28
|
-
return (React.createElement("button", tslib_es6.__assign({}, commonProps, { className: HeroLinkClasses, "aria-label": ariaLabel }),
|
|
29
|
-
React.createElement("span", { className: styles["heroLink-inner"] },
|
|
30
|
-
label && React.createElement("span", { className: styles["heroLink-label"] }, label),
|
|
31
|
-
React.createElement("span", { className: styles["heroLink-icon"] },
|
|
32
|
-
React.createElement(Icon.Icon, { testId: "hero-link-icon", size: 24, icon: BtIconArrowAltRight.BtIconArrowAltRight })))));
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
exports.HeroLink = HeroLink;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { a as __rest, _ as __assign } from '../_shared/esm/tslib.es6-D6Wu-xwB.mjs';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { c as classNames } from '../_shared/esm/index-BfTCfPZ1.mjs';
|
|
4
|
-
import { B as BtIconArrowAltRight } from '../_shared/esm/BtIconArrowAltRight-VH6RTTnL.mjs';
|
|
5
|
-
import { Icon } from '@arc-ui/components/Icon';
|
|
6
|
-
|
|
7
|
-
var styles = {"heroLink":"HeroLink-module_heroLink__WUqWB","heroLink-inner":"HeroLink-module_heroLink-inner__RE5i8","heroLink-label":"HeroLink-module_heroLink-label__93HPY","heroLink-icon":"HeroLink-module_heroLink-icon__l7o4U","heroLink--emptyLabel":"HeroLink-module_heroLink--emptyLabel__XY2sa"};
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Pill-style HeroLink component with default and hover states
|
|
11
|
-
*/
|
|
12
|
-
var HeroLink = function (_a) {
|
|
13
|
-
var _b;
|
|
14
|
-
var label = _a.label, onClick = _a.onClick, href = _a.href, id = _a.id, rel = _a.rel, target = _a.target, ariaLabel = _a.ariaLabel, ref = _a.ref, props = __rest(_a, ["label", "onClick", "href", "id", "rel", "target", "ariaLabel", "ref"]);
|
|
15
|
-
var HeroLinkClasses = classNames(styles.heroLink, (_b = {},
|
|
16
|
-
_b[styles["heroLink--emptyLabel"]] = !label,
|
|
17
|
-
_b));
|
|
18
|
-
var commonProps = __assign({ id: id, onClick: onClick, ref: ref }, props);
|
|
19
|
-
if (href) {
|
|
20
|
-
return (React.createElement("a", __assign({}, commonProps, { className: HeroLinkClasses, href: href, rel: rel, "aria-label": ariaLabel, target: target }),
|
|
21
|
-
React.createElement("span", { className: styles["heroLink-inner"] },
|
|
22
|
-
label && React.createElement("span", { className: styles["heroLink-label"] }, label),
|
|
23
|
-
React.createElement("span", { className: styles["heroLink-icon"] },
|
|
24
|
-
React.createElement(Icon, { testId: "hero-link-icon", size: 24, icon: BtIconArrowAltRight })))));
|
|
25
|
-
}
|
|
26
|
-
return (React.createElement("button", __assign({}, commonProps, { className: HeroLinkClasses, "aria-label": ariaLabel }),
|
|
27
|
-
React.createElement("span", { className: styles["heroLink-inner"] },
|
|
28
|
-
label && React.createElement("span", { className: styles["heroLink-label"] }, label),
|
|
29
|
-
React.createElement("span", { className: styles["heroLink-icon"] },
|
|
30
|
-
React.createElement(Icon, { testId: "hero-link-icon", size: 24, icon: BtIconArrowAltRight })))));
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { HeroLink };
|
package/lib/HeroLink/styles.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.HeroLink-module_heroLink__WUqWB{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:16px 16px 16px 24px;border:2px solid #e5e5e5;border-radius:32px;background:transparent;color:#5514b4;text-decoration:none;font-size:14px;font-weight:500;line-height:1;cursor:pointer;transition:all 0.2s ease;width:-moz-fit-content;width:fit-content;height:-moz-fit-content;height:fit-content}.HeroLink-module_heroLink__WUqWB:hover{border-color:#3f187f;color:#3f187f}.HeroLink-module_heroLink-inner__RE5i8{display:flex;align-items:center;gap:4px}.HeroLink-module_heroLink-label__93HPY{white-space:nowrap}.HeroLink-module_heroLink-icon__l7o4U{display:flex;align-items:center;justify-content:center}.HeroLink-module_heroLink--emptyLabel__XY2sa{padding:16px}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Filters out attributes from the given props object based on a pattern.
|
|
5
|
-
*
|
|
6
|
-
* This function extracts all properties that match either the `data-*` or `aria-*` attribute patterns
|
|
7
|
-
* and returns a new object containing only those properties.
|
|
8
|
-
*
|
|
9
|
-
* @param props - The object containing properties to filter.
|
|
10
|
-
* @returns A new object containing only the matched attributes (`data-*` and `aria-*`) from the input props.
|
|
11
|
-
*/
|
|
12
|
-
var attributePrefixes = ["data-", "aria-"];
|
|
13
|
-
var filterAttrs = function (props) {
|
|
14
|
-
var filteredProps = {};
|
|
15
|
-
var _loop_1 = function (prop) {
|
|
16
|
-
if (Object.prototype.hasOwnProperty.call(props, prop) &&
|
|
17
|
-
attributePrefixes.some(function (prefix) { return prop.startsWith(prefix); })) {
|
|
18
|
-
filteredProps[prop] = props[prop];
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
for (var prop in props) {
|
|
22
|
-
_loop_1(prop);
|
|
23
|
-
}
|
|
24
|
-
return filteredProps;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
exports.filterAttrs = filterAttrs;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Filters out attributes from the given props object based on a pattern.
|
|
3
|
-
*
|
|
4
|
-
* This function extracts all properties that match either the `data-*` or `aria-*` attribute patterns
|
|
5
|
-
* and returns a new object containing only those properties.
|
|
6
|
-
*
|
|
7
|
-
* @param props - The object containing properties to filter.
|
|
8
|
-
* @returns A new object containing only the matched attributes (`data-*` and `aria-*`) from the input props.
|
|
9
|
-
*/
|
|
10
|
-
var attributePrefixes = ["data-", "aria-"];
|
|
11
|
-
var filterAttrs = function (props) {
|
|
12
|
-
var filteredProps = {};
|
|
13
|
-
var _loop_1 = function (prop) {
|
|
14
|
-
if (Object.prototype.hasOwnProperty.call(props, prop) &&
|
|
15
|
-
attributePrefixes.some(function (prefix) { return prop.startsWith(prefix); })) {
|
|
16
|
-
filteredProps[prop] = props[prop];
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
for (var prop in props) {
|
|
20
|
-
_loop_1(prop);
|
|
21
|
-
}
|
|
22
|
-
return filteredProps;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export { filterAttrs as f };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
.heroLink {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
gap: 4px;
|
|
6
|
-
padding: 16px 16px 16px 24px;
|
|
7
|
-
border: 2px solid #e5e5e5;
|
|
8
|
-
border-radius: 32px;
|
|
9
|
-
background: transparent;
|
|
10
|
-
color: #5514b4;
|
|
11
|
-
text-decoration: none;
|
|
12
|
-
font-size: 14px;
|
|
13
|
-
font-weight: 500;
|
|
14
|
-
line-height: 1;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
transition: all 0.2s ease;
|
|
17
|
-
width: fit-content;
|
|
18
|
-
height: fit-content;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.heroLink:hover {
|
|
22
|
-
border-color: #3f187f;
|
|
23
|
-
color: #3f187f;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.heroLink-inner {
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
gap: 4px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.heroLink-label {
|
|
33
|
-
white-space: nowrap;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.heroLink-icon {
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.heroLink--emptyLabel {
|
|
43
|
-
padding: 16px;
|
|
44
|
-
}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import React, { type Ref } from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import { BtIconArrowAltRight } from "@arc-ui/icons/BtIconArrowAltRight";
|
|
4
|
-
import { Icon } from "@arc-ui/components/Icon";
|
|
5
|
-
import styles from "./HeroLink.module.css";
|
|
6
|
-
|
|
7
|
-
export type ElementUnion = HTMLButtonElement | HTMLAnchorElement;
|
|
8
|
-
export type ButtonRef = Ref<ElementUnion> | null;
|
|
9
|
-
type AnchorElProps = React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
10
|
-
type ButtonElProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
11
|
-
type CommonElProps = AnchorElProps & ButtonElProps & { ref?: ButtonRef | null };
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Pill-style HeroLink component with default and hover states
|
|
15
|
-
*/
|
|
16
|
-
export const HeroLink = ({
|
|
17
|
-
label,
|
|
18
|
-
onClick,
|
|
19
|
-
href,
|
|
20
|
-
id,
|
|
21
|
-
rel,
|
|
22
|
-
target,
|
|
23
|
-
ariaLabel,
|
|
24
|
-
ref,
|
|
25
|
-
...props
|
|
26
|
-
}: HeroLinkProps) => {
|
|
27
|
-
const HeroLinkClasses = classNames(styles.heroLink, {
|
|
28
|
-
[styles["heroLink--emptyLabel"]]: !label,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const commonProps: CommonElProps = {
|
|
32
|
-
id,
|
|
33
|
-
onClick,
|
|
34
|
-
ref,
|
|
35
|
-
...props,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
if (href) {
|
|
39
|
-
return (
|
|
40
|
-
<a
|
|
41
|
-
{...(commonProps as AnchorElProps)}
|
|
42
|
-
className={HeroLinkClasses}
|
|
43
|
-
href={href}
|
|
44
|
-
rel={rel}
|
|
45
|
-
aria-label={ariaLabel}
|
|
46
|
-
target={target}
|
|
47
|
-
>
|
|
48
|
-
<span className={styles["heroLink-inner"]}>
|
|
49
|
-
{label && <span className={styles["heroLink-label"]}>{label}</span>}
|
|
50
|
-
<span className={styles["heroLink-icon"]}>
|
|
51
|
-
<Icon
|
|
52
|
-
testId="hero-link-icon"
|
|
53
|
-
size={24}
|
|
54
|
-
icon={BtIconArrowAltRight}
|
|
55
|
-
/>
|
|
56
|
-
</span>
|
|
57
|
-
</span>
|
|
58
|
-
</a>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
return (
|
|
62
|
-
<button
|
|
63
|
-
{...(commonProps as ButtonElProps)}
|
|
64
|
-
className={HeroLinkClasses}
|
|
65
|
-
aria-label={ariaLabel}
|
|
66
|
-
>
|
|
67
|
-
<span className={styles["heroLink-inner"]}>
|
|
68
|
-
{label && <span className={styles["heroLink-label"]}>{label}</span>}
|
|
69
|
-
<span className={styles["heroLink-icon"]}>
|
|
70
|
-
<Icon testId="hero-link-icon" size={24} icon={BtIconArrowAltRight} />
|
|
71
|
-
</span>
|
|
72
|
-
</span>
|
|
73
|
-
</button>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
interface LinkElementProps {
|
|
78
|
-
/**
|
|
79
|
-
* URL to link to if `HeroButton` elementType is 'a'.
|
|
80
|
-
*/
|
|
81
|
-
href?: string;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Target window for the `HeroButton` href URL.
|
|
85
|
-
*/
|
|
86
|
-
target?: string;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Relationship between the Button href URL and the current page. See
|
|
90
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).
|
|
91
|
-
*/
|
|
92
|
-
rel?: string;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
interface HeroButtonElementProps {
|
|
96
|
-
/**
|
|
97
|
-
* Default behavior of the Button element. If not provided, 'submit' will
|
|
98
|
-
* be inferred. Type 'reset' deliberately excluded.
|
|
99
|
-
*/
|
|
100
|
-
type?: "button" | "submit";
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Refers to the id of a form so it can be submitted if the button exists outside of it.
|
|
104
|
-
*/
|
|
105
|
-
form?: string;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface HeroLinkProps
|
|
109
|
-
extends HeroButtonElementProps,
|
|
110
|
-
LinkElementProps {
|
|
111
|
-
/**
|
|
112
|
-
* Label for `HeroLink`
|
|
113
|
-
*/
|
|
114
|
-
label?: string;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Optional click handler for the `HeroLink`.
|
|
118
|
-
*/
|
|
119
|
-
onClick?: () => void;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Optional property to provide component Ref
|
|
123
|
-
*/
|
|
124
|
-
ref?: ButtonRef;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Text to override `label` with additional, more precise information
|
|
128
|
-
* specifically for screen reader users.
|
|
129
|
-
*/
|
|
130
|
-
ariaLabel?: string;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* HTML ID for the `HeroLink`
|
|
134
|
-
*/
|
|
135
|
-
id?: string;
|
|
136
|
-
}
|