@codecademy/brand 1.19.0-alpha.fb2b2ae470.0 → 1.20.0-alpha.073c2d7d8e.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/dist/AbbreviatedCommunityEventCard/index.js +7 -8
- package/dist/AppBar/AppBarSection.js +4 -5
- package/dist/AppBar/index.js +6 -7
- package/dist/AppBarDeprecated/AppBarSectionDeprecated.js +5 -6
- package/dist/AppBarDeprecated/index.js +5 -6
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/index.js +5 -6
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/index.js +26 -30
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdown/index.js +12 -14
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderDropdownLink.js +5 -6
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderMenuItem.js +4 -5
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownProvider/index.js +4 -5
- package/dist/AppHeader/AppHeaderElements/AppHeaderLink/index.js +8 -9
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +17 -19
- package/dist/AppHeader/AppHeaderElements/AppHeaderListItem/index.js +8 -11
- package/dist/AppHeader/AppHeaderElements/AppHeaderLogo/index.js +4 -5
- package/dist/AppHeader/AppHeaderElements/AppHeaderMenuProvider/index.js +5 -6
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderDropdownNavButton.js +8 -9
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderMenuNavButton.js +6 -7
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/index.js +6 -7
- package/dist/AppHeader/AppHeaderElements/AppHeaderProvider/index.js +3 -4
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesDropdown/index.js +5 -6
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesSection/index.js +32 -36
- package/dist/AppHeader/Search/DefaultResults.js +7 -9
- package/dist/AppHeader/Search/QuizAndHelpCenterLinks.js +4 -5
- package/dist/AppHeader/Search/SearchButton.js +6 -7
- package/dist/AppHeader/Search/SearchPane.js +23 -27
- package/dist/AppHeader/Search/SearchWorker/PromiseLookup.js +1 -1
- package/dist/AppHeader/Search/SearchWorker/src.js +7 -9
- package/dist/AppHeader/Search/SearchWorker/worker.js +3 -4
- package/dist/AppHeader/Search/hooks/useUrlChangeDetection.js +4 -5
- package/dist/AppHeader/Search/useHeaderSearch.js +6 -7
- package/dist/AppHeader/index.js +13 -14
- package/dist/AppHeader/shared/elements.js +4 -5
- package/dist/AppHeader/shared/keyboardNav.js +7 -8
- package/dist/AppHeader/shared/utils.js +11 -12
- package/dist/AppHeaderMobile/AppHeaderMainMenuMobile/MobileSearchBar.js +3 -4
- package/dist/AppHeaderMobile/AppHeaderMainMenuMobile/index.js +7 -8
- package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/elements.js +5 -6
- package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/index.js +6 -7
- package/dist/AppHeaderMobile/AppHeaderSubMenuTarget/index.js +4 -5
- package/dist/AppHeaderMobile/index.js +15 -18
- package/dist/Avatar/index.js +22 -31
- package/dist/AvatarChooser/index.js +8 -9
- package/dist/BackToTopAnchor/index.js +7 -8
- package/dist/Banner/index.js +8 -9
- package/dist/BetaSticker/index.js +3 -4
- package/dist/CareerPathCard/index.d.ts +2 -0
- package/dist/CareerPathCard/index.js +17 -14
- package/dist/Carousel/elements.d.ts +2 -2
- package/dist/Carousel/index.js +20 -25
- package/dist/CertificationPathCard/index.d.ts +2 -0
- package/dist/CertificationPathCard/index.js +14 -11
- package/dist/CommunityEventCard/EventTypeIcon.js +3 -4
- package/dist/CommunityEventCard/index.js +25 -26
- package/dist/CommunityEventToast/index.js +3 -4
- package/dist/ContentGroupBaseCard/index.d.ts +5 -0
- package/dist/ContentGroupBaseCard/index.js +23 -22
- package/dist/ContentGroupBaseCard/shared.js +6 -8
- package/dist/CourseCard/index.d.ts +2 -0
- package/dist/CourseCard/index.js +19 -16
- package/dist/CurriculumCard/BottomTag/index.js +4 -5
- package/dist/CurriculumCard/Difficulty/index.js +4 -5
- package/dist/CurriculumCard/Footer/index.js +7 -8
- package/dist/CurriculumCard/Image/index.js +5 -6
- package/dist/CurriculumCard/Subtitle/index.js +6 -7
- package/dist/CurriculumCard/index.js +27 -31
- package/dist/DropdownButton/DropdownList.js +6 -7
- package/dist/DropdownButton/index.d.ts +51 -302
- package/dist/DropdownButton/index.js +22 -26
- package/dist/DropdownButton/useDynamicPopoverPosition.js +5 -6
- package/dist/DropdownButton/useDynamicPopoverPosition.test.js +4 -5
- package/dist/EditorialImage/index.js +17 -20
- package/dist/EmptySection/index.js +8 -9
- package/dist/ErrorContents/index.js +44 -50
- package/dist/GlobalFooter/FooterHeading.js +9 -10
- package/dist/GlobalFooter/FooterLegal/LegalLinks.js +4 -6
- package/dist/GlobalFooter/FooterLegal/MadeIn.js +3 -4
- package/dist/GlobalFooter/FooterLegal/index.js +4 -5
- package/dist/GlobalFooter/FooterLinks.js +11 -13
- package/dist/GlobalFooter/FooterNavLinks/CatalogLinks.js +43 -55
- package/dist/GlobalFooter/FooterNavLinks/CompanyLinks.js +22 -26
- package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferAFriendLinkWithModal.js +18 -23
- package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferralForm.js +7 -9
- package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferralLinkSocialMediaSharing.js +50 -65
- package/dist/GlobalFooter/FooterNavLinks/SocialMediaLinks.js +18 -21
- package/dist/GlobalFooter/FooterNavLinks/index.js +8 -9
- package/dist/GlobalFooter/FooterSubHeading.js +5 -6
- package/dist/GlobalFooter/index.js +10 -11
- package/dist/GlobalPage/index.js +19 -23
- package/dist/Grid/GridCollapse.js +55 -66
- package/dist/HeaderHeightArea/index.js +6 -7
- package/dist/HorizontalScrollMenu/index.js +4 -5
- package/dist/HubCard/index.js +34 -37
- package/dist/InfoCard/index.js +98 -120
- package/dist/Konamimojisplosion/Konamimojisplosion.js +3 -4
- package/dist/LandingPage/CTA.js +8 -11
- package/dist/LandingPage/Description.js +11 -14
- package/dist/LandingPage/Feature.js +61 -79
- package/dist/LandingPage/PageFeatures.js +54 -60
- package/dist/LandingPage/PageHero.js +10 -13
- package/dist/LandingPage/PagePrefooter.js +8 -9
- package/dist/LandingPage/PageSingleFeature.js +19 -21
- package/dist/LandingPage/PageVideoGallery.js +32 -35
- package/dist/LandingPage/Title.js +8 -11
- package/dist/LandingPage/TitleWithEyebrow.js +31 -34
- package/dist/LayoutMenu/AccordionMenu.js +10 -14
- package/dist/LayoutMenu/LayoutMenu.js +12 -13
- package/dist/LayoutMenu/LayoutMenuSection.js +28 -31
- package/dist/LayoutMenu/SectionItemLink.js +5 -6
- package/dist/LayoutMenu/SelectedSectionItem.js +3 -4
- package/dist/LayoutMenuVariant/AccordionMenu.js +10 -17
- package/dist/LayoutMenuVariant/LayoutMenu.js +11 -12
- package/dist/LayoutMenuVariant/LayoutMenuSection.js +24 -27
- package/dist/LayoutMenuVariant/SectionItemLink.js +6 -7
- package/dist/LearningOutcomeCard/index.js +8 -9
- package/dist/{LearningOutcomeSkillTile → LearningOutcomeTile}/index.d.ts +2 -2
- package/dist/LearningOutcomeTile/index.js +127 -0
- package/dist/ListSection/index.js +8 -9
- package/dist/Loading/index.js +3 -4
- package/dist/LoadingCurriculumCard/index.js +71 -74
- package/dist/Logo/index.js +5 -6
- package/dist/LogoFromSkillsoft/index.js +7 -8
- package/dist/LogoLXStudio/index.js +7 -8
- package/dist/LogoProCutout/index.js +28 -31
- package/dist/LogoProCutoutTransparent/index.js +28 -31
- package/dist/MarketingToaster/index.js +3 -4
- package/dist/NotFoundContent/index.js +5 -6
- package/dist/NotificationList/NotificationItem.js +8 -12
- package/dist/NotificationList/index.js +6 -7
- package/dist/Notifications/NotificationBell.js +6 -7
- package/dist/Notifications/NotificationsContents.js +5 -6
- package/dist/Notifications/NotificationsDropdown.js +6 -7
- package/dist/Notifications/useHeaderNotifications.js +4 -5
- package/dist/Notifications/useNotificationButtons.js +6 -7
- package/dist/PageAlerts/PageAlerts.js +3 -4
- package/dist/PageAlerts/PageAlertsProvider.js +3 -4
- package/dist/PageLayoutWithSidebarMenu/PageLayoutWithSidebarMenu.js +8 -9
- package/dist/PageSection/index.js +7 -8
- package/dist/PastDue/PastDueModalContents/index.js +6 -7
- package/dist/PastDue/pastDueMessages.js +4 -7
- package/dist/PausableImage/BaseImage/index.js +4 -5
- package/dist/PlanCard/PlanCardBanner.js +4 -5
- package/dist/PlanCard/PlanFeature.js +6 -7
- package/dist/PlanCard/PricingAmount.js +15 -22
- package/dist/PlanCard/index.js +30 -40
- package/dist/PlanCardTeams/index.js +36 -41
- package/dist/PricingSection/PlanFeature.js +8 -9
- package/dist/PricingSection/PricingCard/PricingAmount.js +10 -14
- package/dist/PricingSection/PricingCard/index.js +13 -17
- package/dist/PricingSection/ProductCTA.js +5 -6
- package/dist/PricingSection/Products.js +7 -8
- package/dist/PricingSection/index.js +10 -11
- package/dist/ProLabel/index.js +5 -6
- package/dist/ProLogoAlt/index.js +23 -26
- package/dist/ProductFeatureShowcase/index.js +98 -104
- package/dist/QuizScore/index.js +9 -10
- package/dist/RatingsBar/index.js +4 -5
- package/dist/ResourceCard/index.js +8 -9
- package/dist/ScoreSummary/SubScores.js +117 -126
- package/dist/ScoreSummary/helpers.js +8 -9
- package/dist/ScoreSummary/index.js +16 -17
- package/dist/SkillPathCard/index.d.ts +2 -0
- package/dist/SkillPathCard/index.js +16 -13
- package/dist/SocialMediaSharing/SocialShareIconLink.js +8 -9
- package/dist/SocialMediaSharing/index.js +65 -78
- package/dist/SocialMediaSharingDropdown/index.js +26 -30
- package/dist/Testimonial/index.js +16 -17
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/stories/Atoms/Subgrid.stories.js +10 -13
- package/dist/stories/Molecules/ContentGroupBaseCard.stories.d.ts +1 -0
- package/dist/stories/Molecules/ContentGroupBaseCard.stories.js +28 -2
- package/dist/stories/Molecules/DropdownButton.stories.d.ts +5 -0
- package/dist/stories/Molecules/DropdownButton.stories.js +177 -3
- package/dist/stories/Molecules/GridCollapse.stories.js +10 -13
- package/dist/stories/Molecules/{LearningOutcomeSkillTile.stories.d.ts → LearningOutcomeTile.stories.d.ts} +3 -3
- package/dist/stories/Molecules/{LearningOutcomeSkillTile.stories.js → LearningOutcomeTile.stories.js} +17 -17
- package/package.json +1 -1
- package/dist/AppBarDeprecated/styles/index.module.scss +0 -39
- package/dist/EditorialImage/styles.module.scss +0 -36
- package/dist/GlobalFooter/FooterNavLinks/assets/download-on-the-app-store.svg +0 -45
- package/dist/GlobalFooter/FooterNavLinks/assets/get-it-on-google-play.png +0 -0
- package/dist/LearningOutcomeSkillTile/index.js +0 -128
- package/dist/Loading/styles.module.scss +0 -131
- package/dist/NotFoundContent/404.svg +0 -1
- package/dist/assets/darkQuotes.svg +0 -1
- package/dist/assets/dots.svg +0 -1
- package/dist/assets/lightQuotes.svg +0 -1
- package/dist/assets/navyQuotes.svg +0 -5
- package/dist/assets/orange_squiggle.svg +0 -1
- package/dist/png.d.ts +0 -4
- package/dist/react-freezeframe.d.ts +0 -1
- package/dist/svg.d.ts +0 -8
- package/dist/theme.d.ts +0 -5
|
@@ -2,19 +2,20 @@ import { ContentGroupBaseCard } from '../ContentGroupBaseCard';
|
|
|
2
2
|
import { getPathImageUrl } from '../ContentGroupBaseCard/helpers';
|
|
3
3
|
import { CertificateComponent, CourseCountComponent, Divider } from '../ContentGroupBaseCard/shared';
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
export const SkillPathCard =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
export const SkillPathCard = ({
|
|
6
|
+
title,
|
|
7
|
+
shortDescription,
|
|
8
|
+
difficulty,
|
|
9
|
+
lessonCount,
|
|
10
|
+
imageUrl,
|
|
11
|
+
courseCount,
|
|
12
|
+
enrollmentStatus,
|
|
13
|
+
headingLevel = 'h3',
|
|
14
|
+
isFullSize = false,
|
|
15
|
+
timeToComplete,
|
|
16
|
+
header,
|
|
17
|
+
footer
|
|
18
|
+
}) => {
|
|
18
19
|
return /*#__PURE__*/_jsxs(ContentGroupBaseCard, {
|
|
19
20
|
headerBackgroundColor: "blue-100",
|
|
20
21
|
headerText: "Skill path",
|
|
@@ -28,6 +29,8 @@ export const SkillPathCard = _ref => {
|
|
|
28
29
|
isFullSize: isFullSize,
|
|
29
30
|
enrollmentStatus: enrollmentStatus,
|
|
30
31
|
timeToComplete: timeToComplete,
|
|
32
|
+
header: header,
|
|
33
|
+
footer: footer,
|
|
31
34
|
children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(CourseCountComponent, {
|
|
32
35
|
count: courseCount
|
|
33
36
|
}), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(CertificateComponent, {})]
|
|
@@ -10,15 +10,14 @@ const IconLink = /*#__PURE__*/_styled(Box, {
|
|
|
10
10
|
label: "IconLink"
|
|
11
11
|
});
|
|
12
12
|
const getTitleId = (id, sectionId) => sectionId ? `${sectionId}-${id}` : id;
|
|
13
|
-
export const SocialShareIconLink =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = _ref;
|
|
13
|
+
export const SocialShareIconLink = ({
|
|
14
|
+
icon: IconComponent,
|
|
15
|
+
id,
|
|
16
|
+
href,
|
|
17
|
+
onClick,
|
|
18
|
+
size,
|
|
19
|
+
sectionId
|
|
20
|
+
}) => {
|
|
22
21
|
const onIconClick = e => {
|
|
23
22
|
e.preventDefault();
|
|
24
23
|
onClick?.(e);
|
|
@@ -20,74 +20,64 @@ export const SOCIAL_SHARING_PLATFORMS = [{
|
|
|
20
20
|
displayName: 'Facebook',
|
|
21
21
|
icon: FacebookIcon,
|
|
22
22
|
baseUrl: 'https://www.facebook.com/dialog/share?app_id=212500508799908',
|
|
23
|
-
formatShare:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
hashtag: '#codecademy'
|
|
36
|
-
};
|
|
37
|
-
}
|
|
23
|
+
formatShare: ({
|
|
24
|
+
url,
|
|
25
|
+
message
|
|
26
|
+
}) => ({
|
|
27
|
+
...(url && {
|
|
28
|
+
href: url
|
|
29
|
+
}),
|
|
30
|
+
...(message && {
|
|
31
|
+
quote: message
|
|
32
|
+
}),
|
|
33
|
+
hashtag: '#codecademy'
|
|
34
|
+
})
|
|
38
35
|
}, {
|
|
39
36
|
id: 'twitter',
|
|
40
37
|
displayName: 'Twitter',
|
|
41
38
|
icon: TwitterIcon,
|
|
42
39
|
baseUrl: 'https://twitter.com/intent/tweet?',
|
|
43
|
-
formatShare:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
})
|
|
63
|
-
};
|
|
64
|
-
}
|
|
40
|
+
formatShare: ({
|
|
41
|
+
url,
|
|
42
|
+
message,
|
|
43
|
+
hashtags,
|
|
44
|
+
mention
|
|
45
|
+
}) => ({
|
|
46
|
+
...(url && {
|
|
47
|
+
url
|
|
48
|
+
}),
|
|
49
|
+
...(message && {
|
|
50
|
+
text: message
|
|
51
|
+
}),
|
|
52
|
+
...(hashtags && {
|
|
53
|
+
hashtags: hashtags.join(',')
|
|
54
|
+
}),
|
|
55
|
+
...(mention && {
|
|
56
|
+
via: mention
|
|
57
|
+
})
|
|
58
|
+
})
|
|
65
59
|
}, {
|
|
66
60
|
id: 'linkedin',
|
|
67
61
|
displayName: 'LinkedIn',
|
|
68
62
|
icon: LinkedinIcon,
|
|
69
63
|
baseUrl: 'https://www.linkedin.com/shareArticle',
|
|
70
|
-
formatShare:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
url
|
|
76
|
-
};
|
|
77
|
-
}
|
|
64
|
+
formatShare: ({
|
|
65
|
+
url
|
|
66
|
+
}) => ({
|
|
67
|
+
url
|
|
68
|
+
})
|
|
78
69
|
}];
|
|
79
|
-
export const SocialMediaSharing =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} = _ref4;
|
|
70
|
+
export const SocialMediaSharing = ({
|
|
71
|
+
url,
|
|
72
|
+
message,
|
|
73
|
+
hashtags,
|
|
74
|
+
mention,
|
|
75
|
+
action,
|
|
76
|
+
label,
|
|
77
|
+
sectionId,
|
|
78
|
+
size = 'normal',
|
|
79
|
+
iconStyles
|
|
80
|
+
}) => {
|
|
91
81
|
return /*#__PURE__*/_jsxs(Box, {
|
|
92
82
|
display: "inline-flex",
|
|
93
83
|
flexDirection: "column",
|
|
@@ -103,27 +93,24 @@ export const SocialMediaSharing = _ref4 => {
|
|
|
103
93
|
gridAutoFlow: "column",
|
|
104
94
|
gap: 16,
|
|
105
95
|
className: iconStyles,
|
|
106
|
-
children: SOCIAL_SHARING_PLATFORMS.map(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
onClick: e => action?.(e, `${id}_share`)
|
|
125
|
-
}, id);
|
|
126
|
-
})
|
|
96
|
+
children: SOCIAL_SHARING_PLATFORMS.map(({
|
|
97
|
+
id,
|
|
98
|
+
icon,
|
|
99
|
+
formatShare,
|
|
100
|
+
baseUrl
|
|
101
|
+
}) => /*#__PURE__*/_jsx(SocialShareIconLink, {
|
|
102
|
+
id: id,
|
|
103
|
+
sectionId: sectionId,
|
|
104
|
+
href: createShareLink(formatShare, baseUrl, {
|
|
105
|
+
url,
|
|
106
|
+
message,
|
|
107
|
+
hashtags,
|
|
108
|
+
mention
|
|
109
|
+
}),
|
|
110
|
+
icon: icon,
|
|
111
|
+
size: size,
|
|
112
|
+
onClick: e => action?.(e, `${id}_share`)
|
|
113
|
+
}, id))
|
|
127
114
|
})]
|
|
128
115
|
});
|
|
129
116
|
};
|
|
@@ -17,16 +17,15 @@ export const onClickWrapper = (e, id, href, action) => {
|
|
|
17
17
|
const features = `menubar=no,toolbar=no,status=no,width=${popupSize},height=${popupSize},top=${top},left=${left}`;
|
|
18
18
|
window.open(href, '_blank', features)?.focus();
|
|
19
19
|
};
|
|
20
|
-
export const SocialMediaSharingDropdown =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = _ref;
|
|
20
|
+
export const SocialMediaSharingDropdown = ({
|
|
21
|
+
url,
|
|
22
|
+
message,
|
|
23
|
+
hashtags,
|
|
24
|
+
mention,
|
|
25
|
+
action,
|
|
26
|
+
defaultPosition = 'below',
|
|
27
|
+
addAlert
|
|
28
|
+
}) => {
|
|
30
29
|
const [showClipboardAlert, setShowClipboardAlert] = useState(false);
|
|
31
30
|
const dropdownRef = useRef(null);
|
|
32
31
|
const focusDropdown = () => dropdownRef.current?.focus({
|
|
@@ -52,26 +51,23 @@ export const SocialMediaSharingDropdown = _ref => {
|
|
|
52
51
|
buttonType: "text",
|
|
53
52
|
defaultPosition: defaultPosition,
|
|
54
53
|
px: 0,
|
|
55
|
-
dropdownItems: [...SOCIAL_SHARING_PLATFORMS.map(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}), 'separator', {
|
|
54
|
+
dropdownItems: [...SOCIAL_SHARING_PLATFORMS.map(({
|
|
55
|
+
id,
|
|
56
|
+
formatShare,
|
|
57
|
+
baseUrl,
|
|
58
|
+
displayName
|
|
59
|
+
}) => ({
|
|
60
|
+
id,
|
|
61
|
+
text: displayName,
|
|
62
|
+
clickHandler: e => {
|
|
63
|
+
onClickWrapper(e, id, createShareLink(formatShare, baseUrl, {
|
|
64
|
+
url,
|
|
65
|
+
message,
|
|
66
|
+
hashtags,
|
|
67
|
+
mention
|
|
68
|
+
}), action);
|
|
69
|
+
}
|
|
70
|
+
})), 'separator', {
|
|
75
71
|
id: 'copy-link',
|
|
76
72
|
icon: LinkIcon,
|
|
77
73
|
text: 'Copy link',
|
|
@@ -69,23 +69,22 @@ const TestimonialContent = /*#__PURE__*/_styled(Box, {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9UZXN0aW1vbmlhbC9pbmRleC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBMEMyQiIsImZpbGUiOiIuLi8uLi9zcmMvVGVz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zdGltb25pYWxDb250ZW50IG9yaWVudGF0aW9uPXtvcmllbnRhdGlvbn0+XG4gICAgICAgIHshaGlkZVBob3RvICYmIGltYWdlVXJsICYmIChcbiAgICAgICAgICA8VGVzdGltb25pYWxQaWN0dXJlXG4gICAgICAgICAgICBkYXRhLXRlc3RpZD1cInRlc3RpbW9uaWFsLXBob3RvXCJcbiAgICAgICAgICAgIHNyYz17aW1hZ2VVcmx9XG4gICAgICAgICAgICBhbHQ9XCJ0ZXN0aW1vbmlhbFwiXG4gICAgICAgICAgLz5cbiAgICAgICAgKX1cbiAgICAgICAgPEJveFxuICAgICAgICAgIG15PXt7IF86ICdhdXRvJywgbWQ6IGlzVmVydGljbGVMYXlvdXQgJiYgIWhpZGVQaG90byA/ICdhdXRvJyA6IDAgfX1cbiAgICAgICAgICBtcj17MzJ9XG4gICAgICAgICAgZ3JpZEFyZWE9eyFoaWRlUGhvdG8gPyAnYnlsaW5lJyA6ICdhdmF0YXInfVxuICAgICAgICA+XG4gICAgICAgICAgPFRleHQgdmFyaWFudD1cInAtc21hbGxcIiBhcz1cInBcIiBmb250RmFtaWx5PVwiYWNjZW50XCI+XG4gICAgICAgICAgICB7bGFzdE5hbWUgPyBgJHtmaXJzdE5hbWV9ICR7bGFzdE5hbWVbMF19LmAgOiBgJHtmaXJzdE5hbWV9YH1cbiAgICAgICAgICA8L1RleHQ+XG4gICAgICAgICAgPFRleHQgdmFyaWFudD1cInAtc21hbGxcIiBhcz1cInBcIiBmb250RmFtaWx5PVwiYWNjZW50XCI+XG4gICAgICAgICAgICB7b2NjdXBhdGlvbn1cbiAgICAgICAgICA8L1RleHQ+XG4gICAgICAgICAgeyEhYm90dG9tVGV4dCAmJiAoXG4gICAgICAgICAgICA8VGV4dCB2YXJpYW50PVwicC1zbWFsbFwiIGFzPVwicFwiIGZvbnRGYW1pbHk9XCJhY2NlbnRcIj5cbiAgICAgICAgICAgICAge2JvdHRvbVRleHR9XG4gICAgICAgICAgICA8L1RleHQ+XG4gICAgICAgICAgKX1cbiAgICAgICAgPC9Cb3g+XG4gICAgICAgIDxRdW90ZUFydCBhbHQ9XCJcIiBzcmM9e2RhcmtRdW90ZXN9IC8+XG4gICAgICAgIDxUZXh0XG4gICAgICAgICAgcHQ9e3sgXzogMCwgbWQ6IGlzVmVydGljbGVMYXlvdXQgPyAwIDogNCB9fVxuICAgICAgICAgIHByPXt7IF86IDE2LCBzbTogMCB9fVxuICAgICAgICAgIGdyaWRBcmVhPVwidGV4dFwiXG4gICAgICAgICAgdmFyaWFudD1cInRpdGxlLW1kXCJcbiAgICAgICAgICBhcz1cInBcIlxuICAgICAgICA+XG4gICAgICAgICAge3F1b3RlfVxuICAgICAgICA8L1RleHQ+XG4gICAgICA8L1Rlc3RpbW9uaWFsQ29udGVudD5cbiAgICA8L1Rlc3RpbW9uaWFsQ2FyZD5cbiAgKTtcblxuICBjb25zdCByZW5kZXJUZXN0aW1vbmlhbFdpdGhBbmNob3IgPSAoKSA9PiAoXG4gICAgPEFuY2hvclxuICAgICAgZGlzcGxheT17cmVzdC5kaXNwbGF5fVxuICAgICAgZGF0YS10ZXN0aWQ9XCJ0ZXN0aW1vbmlhbC1saW5rXCJcbiAgICAgIGhyZWY9e2hyZWYgfHwgdW5kZWZpbmVkfVxuICAgICAgdmFyaWFudD1cImludGVyZmFjZVwiXG4gICAgICBvbkNsaWNrPXtvbkNsaWNrfVxuICAgICAgYXJpYS1sYWJlbD17YXJpYUxhYmVsfVxuICAgID5cbiAgICAgIHtyZW5kZXJUZXN0aW1vbmlhbCgpfVxuICAgIDwvQW5jaG9yPlxuICApO1xuXG4gIHJldHVybiBocmVmID8gcmVuZGVyVGVzdGltb25pYWxXaXRoQW5jaG9yKCkgOiByZW5kZXJUZXN0aW1vbmlhbCgpO1xufTtcbiJdfQ== */");
|
|
72
|
-
export const Testimonial =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
} = _ref;
|
|
72
|
+
export const Testimonial = ({
|
|
73
|
+
firstName,
|
|
74
|
+
lastName,
|
|
75
|
+
company,
|
|
76
|
+
occupation,
|
|
77
|
+
location,
|
|
78
|
+
href,
|
|
79
|
+
quote,
|
|
80
|
+
onClick,
|
|
81
|
+
hidePhoto,
|
|
82
|
+
imageUrl,
|
|
83
|
+
variant,
|
|
84
|
+
orientation,
|
|
85
|
+
mode,
|
|
86
|
+
...rest
|
|
87
|
+
}) => {
|
|
89
88
|
const isVerticleLayout = orientation === 'vertical';
|
|
90
89
|
const bottomText = useMemo(() => {
|
|
91
90
|
if (company && location) return `@ ${company}, ${location}`;
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export * from './Konamimojisplosion';
|
|
|
46
46
|
export * from './LandingPage';
|
|
47
47
|
export * from './LayoutMenu';
|
|
48
48
|
export * from './LearningOutcomeCard';
|
|
49
|
-
export * from './
|
|
49
|
+
export * from './LearningOutcomeTile';
|
|
50
50
|
export * from './lib/breakpointHooks';
|
|
51
51
|
export * from './ListSection';
|
|
52
52
|
export * from './Loading';
|
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ export * from './Konamimojisplosion';
|
|
|
46
46
|
export * from './LandingPage';
|
|
47
47
|
export * from './LayoutMenu';
|
|
48
48
|
export * from './LearningOutcomeCard';
|
|
49
|
-
export * from './
|
|
49
|
+
export * from './LearningOutcomeTile';
|
|
50
50
|
export * from './lib/breakpointHooks';
|
|
51
51
|
export * from './ListSection';
|
|
52
52
|
export * from './Loading';
|
|
@@ -6,19 +6,16 @@ const meta = {
|
|
|
6
6
|
args: {}
|
|
7
7
|
};
|
|
8
8
|
export default meta;
|
|
9
|
-
const Item =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
children: children
|
|
20
|
-
});
|
|
21
|
-
};
|
|
9
|
+
const Item = ({
|
|
10
|
+
children
|
|
11
|
+
}) => /*#__PURE__*/_jsx(FlexBox, {
|
|
12
|
+
as: "li",
|
|
13
|
+
p: 8,
|
|
14
|
+
background: "#eee",
|
|
15
|
+
borderRadius: "md",
|
|
16
|
+
center: true,
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
22
19
|
export const Default = {
|
|
23
20
|
render: _args => /*#__PURE__*/_jsxs(LayoutGrid, {
|
|
24
21
|
children: [/*#__PURE__*/_jsx(Column, {
|
|
@@ -10,3 +10,4 @@ export declare const ContentGroupBaseCardWithImage: Story;
|
|
|
10
10
|
export declare const ContentGroupBaseCardWithShadowVariants: Story;
|
|
11
11
|
export declare const ContentGroupBaseCardWithEnrollmentStatus: Story;
|
|
12
12
|
export declare const ContentGroupBaseCardWithTimeToComplete: Story;
|
|
13
|
+
export declare const ContentGroupBaseCardWithCustomHeaderAndFooter: Story;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Column, LayoutGrid, Text } from '@codecademy/gamut';
|
|
2
|
-
import {
|
|
1
|
+
import { Column, FlexBox, LayoutGrid, Text } from '@codecademy/gamut';
|
|
2
|
+
import { CheckFilledIcon } from '@codecademy/gamut-icons';
|
|
3
|
+
import { ContentGroupBaseCard, ContentGroupBaseCardHeaderBackground, CourseDifficulty, EnrollmentStatus } from '../../index';
|
|
3
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
5
|
const meta = {
|
|
5
6
|
component: ContentGroupBaseCard,
|
|
@@ -144,4 +145,29 @@ export const ContentGroupBaseCardWithTimeToComplete = {
|
|
|
144
145
|
})]
|
|
145
146
|
}),
|
|
146
147
|
name: 'ContentGroupBaseCard with Time to Complete'
|
|
148
|
+
};
|
|
149
|
+
export const ContentGroupBaseCardWithCustomHeaderAndFooter = {
|
|
150
|
+
render: args => /*#__PURE__*/_jsx(LayoutGrid, {
|
|
151
|
+
gap: 24,
|
|
152
|
+
children: /*#__PURE__*/_jsx(Column, {
|
|
153
|
+
size: 6,
|
|
154
|
+
children: /*#__PURE__*/_jsx(ContentGroupBaseCard, {
|
|
155
|
+
...args,
|
|
156
|
+
header: /*#__PURE__*/_jsx(ContentGroupBaseCardHeaderBackground, {
|
|
157
|
+
bg: "hyper",
|
|
158
|
+
children: /*#__PURE__*/_jsxs(FlexBox, {
|
|
159
|
+
alignItems: "center",
|
|
160
|
+
justifyContent: "center",
|
|
161
|
+
gap: 4,
|
|
162
|
+
children: [/*#__PURE__*/_jsx(CheckFilledIcon, {}), " Custom Header"]
|
|
163
|
+
})
|
|
164
|
+
}),
|
|
165
|
+
footer: /*#__PURE__*/_jsx(Text, {
|
|
166
|
+
textColor: "navy-500",
|
|
167
|
+
children: "Custom Footer"
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
})
|
|
171
|
+
}),
|
|
172
|
+
name: 'ContentGroupBaseCard with custom header and footer'
|
|
147
173
|
};
|
|
@@ -4,3 +4,8 @@ declare const meta: Meta<typeof DropdownButton>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof DropdownButton>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
|
+
export declare const DropdownButtonTypes: Story;
|
|
8
|
+
export declare const DropdownButtonVariants: Story;
|
|
9
|
+
export declare const DropdownTextButtonSizes: Story;
|
|
10
|
+
export declare const DropdownIconButtonSizes: Story;
|
|
11
|
+
export declare const DropdownPopoverAlignment: Story;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { Box, FlexBox } from '@codecademy/gamut';
|
|
2
|
+
import { SparkleIcon } from '@codecademy/gamut-icons';
|
|
1
3
|
import { DropdownButton } from '../../index';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
5
|
const items = [{
|
|
4
6
|
id: 'one',
|
|
5
7
|
text: 'I have an href',
|
|
@@ -9,25 +11,197 @@ const items = [{
|
|
|
9
11
|
text: 'I have an onClick',
|
|
10
12
|
// eslint-disable-next-line no-console
|
|
11
13
|
clickHandler: () => console.log('hi')
|
|
12
|
-
}
|
|
14
|
+
}];
|
|
15
|
+
const extraItems = [{
|
|
13
16
|
id: 'three',
|
|
14
17
|
text: 'I have an href & onClick',
|
|
15
18
|
href: '#',
|
|
16
19
|
// eslint-disable-next-line no-console
|
|
17
20
|
clickHandler: () => console.log('hi')
|
|
21
|
+
}, {
|
|
22
|
+
id: 'four',
|
|
23
|
+
text: 'I have an href & onClick & icon',
|
|
24
|
+
href: '#',
|
|
25
|
+
// eslint-disable-next-line no-console
|
|
26
|
+
clickHandler: () => console.log('hi'),
|
|
27
|
+
icon: SparkleIcon
|
|
18
28
|
}];
|
|
19
29
|
const meta = {
|
|
20
30
|
component: DropdownButton,
|
|
21
31
|
args: {
|
|
22
32
|
buttonType: 'fill',
|
|
23
|
-
dropdownItems: items
|
|
33
|
+
dropdownItems: items,
|
|
34
|
+
variant: 'primary'
|
|
35
|
+
},
|
|
36
|
+
parameters: {
|
|
37
|
+
controls: {
|
|
38
|
+
include: ['align', 'buttonType', 'children', 'dropDownItems', 'horizontalOffset', 'iconSize', 'isMenu', 'onClick', 'size', 'tipProps', 'variant', 'verticalOffset']
|
|
39
|
+
}
|
|
24
40
|
}
|
|
25
41
|
};
|
|
26
42
|
export default meta;
|
|
27
43
|
export const Default = {
|
|
44
|
+
args: {
|
|
45
|
+
dropdownItems: [...items, ...extraItems],
|
|
46
|
+
isMenu: false
|
|
47
|
+
},
|
|
28
48
|
render: args => /*#__PURE__*/_jsx(DropdownButton, {
|
|
29
49
|
...args,
|
|
30
50
|
children: "click me"
|
|
31
51
|
}),
|
|
32
52
|
name: 'DropdownButton'
|
|
53
|
+
};
|
|
54
|
+
export const DropdownButtonTypes = {
|
|
55
|
+
render: args => /*#__PURE__*/_jsxs(FlexBox, {
|
|
56
|
+
justifyContent: "space-between",
|
|
57
|
+
p: 40,
|
|
58
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
59
|
+
width: "fit-content",
|
|
60
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
61
|
+
...args,
|
|
62
|
+
buttonType: "fill",
|
|
63
|
+
children: "Fill"
|
|
64
|
+
})
|
|
65
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
66
|
+
width: "fit-content",
|
|
67
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
68
|
+
...args,
|
|
69
|
+
buttonType: "stroke",
|
|
70
|
+
children: "Stroke"
|
|
71
|
+
})
|
|
72
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
73
|
+
width: "fit-content",
|
|
74
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
75
|
+
...args,
|
|
76
|
+
buttonType: "text",
|
|
77
|
+
children: "Text"
|
|
78
|
+
})
|
|
79
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
80
|
+
width: "fit-content",
|
|
81
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
82
|
+
...args,
|
|
83
|
+
buttonType: "kebab"
|
|
84
|
+
})
|
|
85
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
86
|
+
width: "fit-content",
|
|
87
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
88
|
+
...args,
|
|
89
|
+
buttonType: "horizontalKebab"
|
|
90
|
+
})
|
|
91
|
+
})]
|
|
92
|
+
})
|
|
93
|
+
};
|
|
94
|
+
export const DropdownButtonVariants = {
|
|
95
|
+
render: args => /*#__PURE__*/_jsxs(FlexBox, {
|
|
96
|
+
justifyContent: "space-around",
|
|
97
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
98
|
+
width: "fit-content",
|
|
99
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
100
|
+
...args,
|
|
101
|
+
buttonType: "stroke",
|
|
102
|
+
children: "Stroke primary"
|
|
103
|
+
})
|
|
104
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
105
|
+
width: "fit-content",
|
|
106
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
107
|
+
...args,
|
|
108
|
+
buttonType: "stroke",
|
|
109
|
+
variant: "secondary",
|
|
110
|
+
children: "Stroke secondary"
|
|
111
|
+
})
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
};
|
|
115
|
+
export const DropdownTextButtonSizes = {
|
|
116
|
+
render: args => /*#__PURE__*/_jsxs(FlexBox, {
|
|
117
|
+
justifyContent: "space-around",
|
|
118
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
119
|
+
alignSelf: "center",
|
|
120
|
+
width: "fit-content",
|
|
121
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
122
|
+
...args,
|
|
123
|
+
buttonType: "fill",
|
|
124
|
+
size: "small",
|
|
125
|
+
children: "Fill small"
|
|
126
|
+
})
|
|
127
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
128
|
+
alignSelf: "center",
|
|
129
|
+
width: "fit-content",
|
|
130
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
131
|
+
...args,
|
|
132
|
+
buttonType: "fill",
|
|
133
|
+
size: "normal",
|
|
134
|
+
children: "Fill normal"
|
|
135
|
+
})
|
|
136
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
137
|
+
alignSelf: "center",
|
|
138
|
+
width: "fit-content",
|
|
139
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
140
|
+
...args,
|
|
141
|
+
buttonType: "fill",
|
|
142
|
+
size: "large",
|
|
143
|
+
children: "Fill large"
|
|
144
|
+
})
|
|
145
|
+
})]
|
|
146
|
+
})
|
|
147
|
+
};
|
|
148
|
+
export const DropdownIconButtonSizes = {
|
|
149
|
+
render: args => /*#__PURE__*/_jsxs(FlexBox, {
|
|
150
|
+
row: true,
|
|
151
|
+
justifyContent: "space-around",
|
|
152
|
+
mt: 16,
|
|
153
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
154
|
+
alignSelf: "center",
|
|
155
|
+
width: "fit-content",
|
|
156
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
157
|
+
...args,
|
|
158
|
+
buttonType: "kebab",
|
|
159
|
+
size: "small",
|
|
160
|
+
iconSize: 12
|
|
161
|
+
})
|
|
162
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
163
|
+
alignSelf: "center",
|
|
164
|
+
width: "fit-content",
|
|
165
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
166
|
+
...args,
|
|
167
|
+
buttonType: "kebab",
|
|
168
|
+
size: "normal"
|
|
169
|
+
})
|
|
170
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
171
|
+
alignSelf: "center",
|
|
172
|
+
width: "fit-content",
|
|
173
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
174
|
+
...args,
|
|
175
|
+
buttonType: "kebab",
|
|
176
|
+
size: "large",
|
|
177
|
+
iconSize: 20
|
|
178
|
+
})
|
|
179
|
+
})]
|
|
180
|
+
})
|
|
181
|
+
};
|
|
182
|
+
export const DropdownPopoverAlignment = {
|
|
183
|
+
render: args => /*#__PURE__*/_jsxs(FlexBox, {
|
|
184
|
+
row: true,
|
|
185
|
+
justifyContent: "space-around",
|
|
186
|
+
mt: 16,
|
|
187
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
188
|
+
width: "fit-content",
|
|
189
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
190
|
+
...args,
|
|
191
|
+
buttonType: "text",
|
|
192
|
+
size: "small",
|
|
193
|
+
align: "left",
|
|
194
|
+
children: "Align left"
|
|
195
|
+
})
|
|
196
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
197
|
+
width: "fit-content",
|
|
198
|
+
children: /*#__PURE__*/_jsx(DropdownButton, {
|
|
199
|
+
...args,
|
|
200
|
+
buttonType: "text",
|
|
201
|
+
size: "small",
|
|
202
|
+
align: "right",
|
|
203
|
+
children: "Align right"
|
|
204
|
+
})
|
|
205
|
+
})]
|
|
206
|
+
})
|
|
33
207
|
};
|