@nypl/design-system-react-components 2.0.0 → 2.1.0-rc
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 +466 -17
- package/dist/design-system-react-components.cjs +528 -0
- package/dist/design-system-react-components.js +37957 -0
- package/dist/src/components/Accordion/Accordion.d.ts +29 -0
- package/dist/src/components/AlphabetFilter/AlphabetFilter.d.ts +23 -0
- package/dist/src/components/AudioPlayer/AudioPlayer.d.ts +43 -0
- package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts +24 -0
- package/dist/src/components/Button/Button.d.ts +35 -0
- package/dist/src/components/ButtonGroup/ButtonGroup.d.ts +25 -0
- package/dist/src/components/Card/Card.d.ts +55 -0
- package/dist/src/components/Checkbox/Checkbox.d.ts +47 -0
- package/dist/src/components/CheckboxGroup/CheckboxGroup.d.ts +51 -0
- package/dist/src/components/ComponentWrapper/ComponentWrapper.d.ts +31 -0
- package/dist/src/components/DatePicker/DatePicker.d.ts +82 -0
- package/dist/src/components/FeaturedContent/FeaturedContent.d.ts +29 -0
- package/dist/src/components/FeedbackBox/FeedbackBox.d.ts +64 -0
- package/dist/src/components/FeedbackBox/useFeedbackBoxReducer.d.ts +19 -0
- package/dist/src/components/Fieldset/Fieldset.d.ts +24 -0
- package/dist/src/components/Form/Form.d.ts +31 -0
- package/dist/src/components/Grid/SimpleGrid.d.ts +20 -0
- package/dist/src/components/Heading/Heading.d.ts +42 -0
- package/dist/src/components/HelperErrorText/HelperErrorText.d.ts +34 -0
- package/dist/src/components/Hero/Hero.d.ts +49 -0
- package/dist/src/components/HorizontalRule/HorizontalRule.d.ts +11 -0
- package/dist/src/components/Icons/Icon.d.ts +41 -0
- package/dist/src/components/Icons/IconSvgs.d.ts +196 -0
- package/dist/src/components/Icons/iconVariables.d.ts +6 -0
- package/dist/src/components/Image/Image.d.ts +68 -0
- package/dist/src/components/Label/Label.d.ts +25 -0
- package/dist/src/components/Link/Link.d.ts +32 -0
- package/dist/src/components/List/List.d.ts +43 -0
- package/dist/src/components/Logo/Logo.d.ts +29 -0
- package/dist/src/components/Logo/LogoSvgs.d.ts +166 -0
- package/dist/src/components/Logo/logoVariables.d.ts +2 -0
- package/dist/src/components/Modal/Modal.d.ts +35 -0
- package/dist/src/components/NewsletterSignup/NewsletterSignup.d.ts +46 -0
- package/dist/src/components/Notification/Notification.d.ts +52 -0
- package/dist/src/components/Pagination/Pagination.d.ts +27 -0
- package/dist/src/components/ProgressIndicator/ProgressIndicator.d.ts +32 -0
- package/dist/src/components/Radio/Radio.d.ts +43 -0
- package/dist/src/components/RadioGroup/RadioGroup.d.ts +51 -0
- package/dist/src/components/SearchBar/SearchBar.d.ts +58 -0
- package/dist/src/components/Select/Select.d.ts +59 -0
- package/dist/src/components/SkeletonLoader/SkeletonLoader.d.ts +42 -0
- package/dist/src/components/SkipNavigation/SkipNavigation.d.ts +19 -0
- package/dist/src/components/Slider/Slider.d.ts +65 -0
- package/dist/src/components/SocialMediaLinks/SocialMediaLinks.d.ts +42 -0
- package/dist/src/components/SocialMediaLinks/SocialMediaLinksUtils.d.ts +7 -0
- package/dist/src/components/StatusBadge/StatusBadge.d.ts +19 -0
- package/dist/src/components/StructuredContent/StructuredContent.d.ts +30 -0
- package/dist/src/components/StyleGuide/ColorCard.d.ts +348 -0
- package/dist/src/components/StyledList/StyledList.d.ts +26 -0
- package/dist/src/components/Table/Table.d.ts +32 -0
- package/dist/src/components/Tabs/Tabs.d.ts +28 -0
- package/dist/src/components/TagSet/TagSet.d.ts +24 -0
- package/dist/src/components/TagSet/TagSetExplore.d.ts +28 -0
- package/dist/src/components/TagSet/TagSetFilter.d.ts +25 -0
- package/dist/src/components/TagSet/TooltipWrapper.d.ts +9 -0
- package/dist/src/components/Template/Template.d.ts +140 -0
- package/dist/src/components/Text/Text.d.ts +27 -0
- package/dist/src/components/TextInput/TextInput.d.ts +92 -0
- package/dist/src/components/Toggle/Toggle.d.ts +43 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/src/components/VideoPlayer/VideoPlayer.d.ts +42 -0
- package/dist/src/helpers/getSectionColors.d.ts +8 -0
- package/dist/src/helpers/types.d.ts +50 -0
- package/dist/src/hooks/useCarouselStyles.d.ts +17 -0
- package/dist/src/hooks/useCloseDropDown.d.ts +7 -0
- package/dist/src/hooks/useNYPLBreakpoints.d.ts +13 -0
- package/dist/src/hooks/useNYPLTheme.d.ts +75 -0
- package/dist/src/hooks/useStateWithDependencies.d.ts +8 -0
- package/dist/src/hooks/useWindowSize.d.ts +10 -0
- package/dist/src/index.d.ts +87 -0
- package/dist/src/theme/components/accordion.d.ts +34 -0
- package/dist/src/theme/components/alphabetFilter.d.ts +40 -0
- package/dist/src/theme/components/audioPlayer.d.ts +16 -0
- package/dist/src/theme/components/breadcrumb.d.ts +158 -0
- package/dist/src/theme/components/button.d.ts +152 -0
- package/dist/src/theme/components/buttonGroup.d.ts +11 -0
- package/dist/src/theme/components/card.d.ts +485 -0
- package/dist/src/theme/components/checkbox.d.ts +178 -0
- package/dist/src/theme/components/checkboxGroup.d.ts +14 -0
- package/dist/src/theme/components/componentWrapper.d.ts +12 -0
- package/dist/src/theme/components/customTable.d.ts +739 -0
- package/dist/src/theme/components/datePicker.d.ts +17 -0
- package/dist/src/theme/components/featuredContent.d.ts +70 -0
- package/dist/src/theme/components/feedbackBox.d.ts +100 -0
- package/dist/src/theme/components/fieldset.d.ts +24 -0
- package/dist/src/theme/components/filterBar.d.ts +46 -0
- package/dist/src/theme/components/global.d.ts +141 -0
- package/dist/src/theme/components/globalMixins.d.ts +40 -0
- package/dist/src/theme/components/heading.d.ts +372 -0
- package/dist/src/theme/components/helperErrorText.d.ts +18 -0
- package/dist/src/theme/components/hero.d.ts +639 -0
- package/dist/src/theme/components/horizontalRule.d.ts +18 -0
- package/dist/src/theme/components/icon.d.ts +62251 -0
- package/dist/src/theme/components/image.d.ts +754 -0
- package/dist/src/theme/components/label.d.ts +22 -0
- package/dist/src/theme/components/link.d.ts +152 -0
- package/dist/src/theme/components/list.d.ts +230 -0
- package/dist/src/theme/components/logo.d.ts +477 -0
- package/dist/src/theme/components/modal.d.ts +27 -0
- package/dist/src/theme/components/multiSelect.d.ts +29 -0
- package/dist/src/theme/components/multiSelectMenuButton.d.ts +99 -0
- package/dist/src/theme/components/newsletterSignup.d.ts +93 -0
- package/dist/src/theme/components/notification.d.ts +137 -0
- package/dist/src/theme/components/pagination.d.ts +19 -0
- package/dist/src/theme/components/progressIndicator.d.ts +69 -0
- package/dist/src/theme/components/radio.d.ts +202 -0
- package/dist/src/theme/components/radioGroup.d.ts +14 -0
- package/dist/src/theme/components/searchBar.d.ts +34 -0
- package/dist/src/theme/components/select.d.ts +126 -0
- package/dist/src/theme/components/skeletonLoader.d.ts +105 -0
- package/dist/src/theme/components/skipNavigation.d.ts +28 -0
- package/dist/src/theme/components/slider.d.ts +78 -0
- package/dist/src/theme/components/socialmedialinks.d.ts +192 -0
- package/dist/src/theme/components/statusBadge.d.ts +37 -0
- package/dist/src/theme/components/structuredContent.d.ts +454 -0
- package/dist/src/theme/components/styledList.d.ts +51 -0
- package/dist/src/theme/components/tabs.d.ts +172 -0
- package/dist/src/theme/components/tagSet.d.ts +154 -0
- package/dist/src/theme/components/template.d.ts +98 -0
- package/dist/src/theme/components/text.d.ts +59 -0
- package/dist/src/theme/components/textInput.d.ts +360 -0
- package/dist/src/theme/components/toggle.d.ts +129 -0
- package/dist/src/theme/components/tooltip.d.ts +21 -0
- package/dist/src/theme/components/videoPlayer.d.ts +47 -0
- package/dist/src/theme/foundations/breakpoints.d.ts +23 -0
- package/dist/src/theme/foundations/colors.d.ts +3 -0
- package/dist/src/theme/foundations/global.d.ts +68 -0
- package/dist/src/theme/foundations/radii.d.ts +11 -0
- package/dist/src/theme/foundations/shadows.d.ts +4 -0
- package/dist/src/theme/foundations/spacing.d.ts +96 -0
- package/dist/src/theme/foundations/typography.d.ts +8 -0
- package/dist/src/theme/index.d.ts +20 -0
- package/dist/src/theme/internalChakraProvider.d.ts +67 -0
- package/dist/src/theme/provider.d.ts +4 -0
- package/dist/src/theme/types.d.ts +1 -0
- package/dist/src/utils/colorUtils.d.ts +5 -0
- package/dist/src/utils/interfaces.d.ts +5 -0
- package/dist/src/utils/utils.d.ts +42 -0
- package/dist/styles.css +1 -0
- package/package.json +132 -24
- package/CHANGELOG.md +0 -139
- package/dist/design-system-react-components.min.js +0 -23
- package/dist/design-system-react-components.min.js.map +0 -1
- package/lib/components/00-base/Container/Container.d.ts +0 -6
- package/lib/components/00-base/Container/Container.js +0 -19
- package/lib/components/00-base/Container/Modal.d.ts +0 -12
- package/lib/components/00-base/Container/Modal.js +0 -29
- package/lib/components/00-base/Container/Modal.stories.d.ts +0 -7
- package/lib/components/00-base/Container/Modal.stories.js +0 -20
- package/lib/components/00-base/Placeholder.d.ts +0 -10
- package/lib/components/00-base/Placeholder.js +0 -23
- package/lib/components/00-base/SectionName.d.ts +0 -4
- package/lib/components/00-base/SectionName.js +0 -16
- package/lib/components/01-atoms/Button/Button.d.ts +0 -52
- package/lib/components/01-atoms/Button/Button.js +0 -76
- package/lib/components/01-atoms/Button/Button.stories.d.ts +0 -14
- package/lib/components/01-atoms/Button/Button.stories.js +0 -33
- package/lib/components/01-atoms/Button/ButtonTypes.d.ts +0 -10
- package/lib/components/01-atoms/Button/ButtonTypes.js +0 -14
- package/lib/components/01-atoms/Forms/Checkbox.d.ts +0 -21
- package/lib/components/01-atoms/Forms/Checkbox.js +0 -27
- package/lib/components/01-atoms/Forms/Checkbox.stories.d.ts +0 -7
- package/lib/components/01-atoms/Forms/Checkbox.stories.js +0 -23
- package/lib/components/01-atoms/Forms/DateRangeForm.d.ts +0 -31
- package/lib/components/01-atoms/Forms/DateRangeForm.js +0 -27
- package/lib/components/01-atoms/Forms/DateRangeForm.stories.d.ts +0 -9
- package/lib/components/01-atoms/Forms/DateRangeForm.stories.js +0 -23
- package/lib/components/01-atoms/Forms/FormDropdown.d.ts +0 -22
- package/lib/components/01-atoms/Forms/FormDropdown.js +0 -64
- package/lib/components/01-atoms/Forms/FormDropdown.stories.d.ts +0 -8
- package/lib/components/01-atoms/Forms/FormDropdown.stories.js +0 -22
- package/lib/components/01-atoms/Forms/HelperErrorText.d.ts +0 -26
- package/lib/components/01-atoms/Forms/HelperErrorText.js +0 -29
- package/lib/components/01-atoms/Forms/HelperErrorText.stories.d.ts +0 -9
- package/lib/components/01-atoms/Forms/HelperErrorText.stories.js +0 -23
- package/lib/components/01-atoms/Forms/Input.d.ts +0 -47
- package/lib/components/01-atoms/Forms/Input.js +0 -39
- package/lib/components/01-atoms/Forms/Input.stories.d.ts +0 -10
- package/lib/components/01-atoms/Forms/Input.stories.js +0 -22
- package/lib/components/01-atoms/Forms/Label.d.ts +0 -19
- package/lib/components/01-atoms/Forms/Label.js +0 -22
- package/lib/components/01-atoms/Forms/Label.stories.d.ts +0 -7
- package/lib/components/01-atoms/Forms/Label.stories.js +0 -20
- package/lib/components/01-atoms/Forms/TextField.d.ts +0 -26
- package/lib/components/01-atoms/Forms/TextField.js +0 -36
- package/lib/components/01-atoms/Forms/TextField.stories.d.ts +0 -7
- package/lib/components/01-atoms/Forms/TextField.stories.js +0 -20
- package/lib/components/01-atoms/Images/Icons/Icon.d.ts +0 -14
- package/lib/components/01-atoms/Images/Icons/Icon.js +0 -38
- package/lib/components/01-atoms/Images/Image/Image.d.ts +0 -8
- package/lib/components/01-atoms/Images/Image/Image.js +0 -32
- package/lib/components/01-atoms/Images/Image/Image.stories.d.ts +0 -8
- package/lib/components/01-atoms/Images/Image/Image.stories.js +0 -24
- package/lib/components/01-atoms/Links/BasicLink.d.ts +0 -15
- package/lib/components/01-atoms/Links/BasicLink.js +0 -50
- package/lib/components/01-atoms/Links/BasicLink.stories.d.ts +0 -8
- package/lib/components/01-atoms/Links/BasicLink.stories.js +0 -21
- package/lib/components/01-atoms/Links/IconLink.d.ts +0 -13
- package/lib/components/01-atoms/Links/IconLink.js +0 -44
- package/lib/components/01-atoms/Links/IconLink.stories.d.ts +0 -10
- package/lib/components/01-atoms/Links/IconLink.stories.js +0 -24
- package/lib/components/01-atoms/Links/Link.d.ts +0 -13
- package/lib/components/01-atoms/Links/Link.js +0 -51
- package/lib/components/01-atoms/Links/UnderlineLink.d.ts +0 -11
- package/lib/components/01-atoms/Links/UnderlineLink.js +0 -29
- package/lib/components/01-atoms/Links/UnderlineLink.stories.d.ts +0 -8
- package/lib/components/01-atoms/Links/UnderlineLink.stories.js +0 -21
- package/lib/components/01-atoms/Text/Headings/Heading.d.ts +0 -16
- package/lib/components/01-atoms/Text/Headings/Heading.js +0 -40
- package/lib/components/01-atoms/Text/Headings/Heading.stories.d.ts +0 -12
- package/lib/components/01-atoms/Text/Headings/Heading.stories.js +0 -35
- package/lib/components/01-atoms/Text/Headings/RNSectionTitle.d.ts +0 -2
- package/lib/components/01-atoms/Text/Headings/RNSectionTitle.js +0 -18
- package/lib/components/01-atoms/Text/Headings/RNSectionTitle.stories.d.ts +0 -7
- package/lib/components/01-atoms/Text/Headings/RNSectionTitle.stories.js +0 -24
- package/lib/components/01-atoms/Text/Text/BodyText.d.ts +0 -12
- package/lib/components/01-atoms/Text/Text/BodyText.js +0 -73
- package/lib/components/01-atoms/Text/Text/BodyText.stories.d.ts +0 -14
- package/lib/components/01-atoms/Text/Text/BodyText.stories.js +0 -54
- package/lib/components/02-molecules/Cards/EditionCard.d.ts +0 -31
- package/lib/components/02-molecules/Cards/EditionCard.js +0 -51
- package/lib/components/02-molecules/Cards/EditionCard.stories.d.ts +0 -13
- package/lib/components/02-molecules/Cards/EditionCard.stories.js +0 -26
- package/lib/components/02-molecules/Cards/SearchResultItem.d.ts +0 -17
- package/lib/components/02-molecules/Cards/SearchResultItem.js +0 -40
- package/lib/components/02-molecules/Cards/SearchResultItem.stories.d.ts +0 -8
- package/lib/components/02-molecules/Cards/SearchResultItem.stories.js +0 -31
- package/lib/components/02-molecules/Dropdown/Dropdown.d.ts +0 -21
- package/lib/components/02-molecules/Dropdown/Dropdown.js +0 -55
- package/lib/components/02-molecules/Dropdown/Dropdown.stories.d.ts +0 -14
- package/lib/components/02-molecules/Dropdown/Dropdown.stories.js +0 -33
- package/lib/components/02-molecules/Headings/SectionTitle.d.ts +0 -17
- package/lib/components/02-molecules/Headings/SectionTitle.js +0 -42
- package/lib/components/02-molecules/Headings/SectionTitle.stories.d.ts +0 -8
- package/lib/components/02-molecules/Headings/SectionTitle.stories.js +0 -20
- package/lib/components/02-molecules/Menus/Breadcrumbs/Breadcrumbs.d.ts +0 -14
- package/lib/components/02-molecules/Menus/Breadcrumbs/Breadcrumbs.js +0 -51
- package/lib/components/02-molecules/Menus/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -8
- package/lib/components/02-molecules/Menus/Breadcrumbs/Breadcrumbs.stories.js +0 -30
- package/lib/components/02-molecules/Menus/Pagination/Pagination.d.ts +0 -11
- package/lib/components/02-molecules/Menus/Pagination/Pagination.js +0 -57
- package/lib/components/02-molecules/Menus/Pagination/Pagination.stories.d.ts +0 -7
- package/lib/components/02-molecules/Menus/Pagination/Pagination.stories.js +0 -20
- package/lib/components/02-molecules/SearchBar/SearchBar.d.ts +0 -26
- package/lib/components/02-molecules/SearchBar/SearchBar.js +0 -69
- package/lib/components/02-molecules/SearchBar/SearchBar.stories.d.ts +0 -11
- package/lib/components/02-molecules/SearchBar/SearchBar.stories.js +0 -24
- package/lib/components/03-organisms/Accordion/Accordion.d.ts +0 -19
- package/lib/components/03-organisms/Accordion/Accordion.js +0 -41
- package/lib/components/03-organisms/Accordion/Accordion.stories.d.ts +0 -7
- package/lib/components/03-organisms/Accordion/Accordion.stories.js +0 -30
- package/lib/components/03-organisms/Headers/HeaderImgRight.d.ts +0 -12
- package/lib/components/03-organisms/Headers/HeaderImgRight.js +0 -32
- package/lib/components/03-organisms/Headers/HeaderImgRight.stories.d.ts +0 -7
- package/lib/components/03-organisms/Headers/HeaderImgRight.stories.js +0 -19
- package/lib/components/03-organisms/Headers/RNHeaderWithSearch.d.ts +0 -19
- package/lib/components/03-organisms/Headers/RNHeaderWithSearch.js +0 -27
- package/lib/components/03-organisms/Headers/RNHeaderWithSearch.stories.d.ts +0 -7
- package/lib/components/03-organisms/Headers/RNHeaderWithSearch.stories.js +0 -26
- package/lib/components/03-organisms/Hero/Hero.d.ts +0 -31
- package/lib/components/03-organisms/Hero/Hero.js +0 -62
- package/lib/components/03-organisms/Hero/Hero.stories.d.ts +0 -11
- package/lib/components/03-organisms/Hero/Hero.stories.js +0 -35
- package/lib/components/03-organisms/Hero/HeroTypes.d.ts +0 -6
- package/lib/components/03-organisms/Hero/HeroTypes.js +0 -9
- package/lib/components/03-organisms/List/UnorderedList.d.ts +0 -18
- package/lib/components/03-organisms/List/UnorderedList.js +0 -28
- package/lib/components/03-organisms/List/UnorderedList.stories.d.ts +0 -11
- package/lib/components/03-organisms/List/UnorderedList.stories.js +0 -73
- package/lib/components/03-organisms/SearchPromo/SearchPromo.d.ts +0 -22
- package/lib/components/03-organisms/SearchPromo/SearchPromo.js +0 -30
- package/lib/components/03-organisms/SearchPromo/SearchPromo.stories.d.ts +0 -8
- package/lib/components/03-organisms/SearchPromo/SearchPromo.stories.js +0 -28
- package/lib/helpers/hoc/WithOneChild.d.ts +0 -8
- package/lib/helpers/hoc/WithOneChild.js +0 -63
- package/lib/index.d.ts +0 -24
- package/lib/index.js +0 -51
- package/lib/utils/bem.d.ts +0 -1
- package/lib/utils/bem.js +0 -35
- package/tsd.d.ts +0 -4
- package/webpack.prod.js +0 -38
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import FormDropdown from "./FormDropdown";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: typeof FormDropdown;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
7
|
-
export declare const dropdown: () => JSX.Element;
|
|
8
|
-
export declare const dropdownWithSelected: () => JSX.Element;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const React = __importStar(require("react"));
|
|
14
|
-
const FormDropdown_1 = __importDefault(require("./FormDropdown"));
|
|
15
|
-
const addon_actions_1 = require("@storybook/addon-actions");
|
|
16
|
-
const addon_knobs_1 = require("@storybook/addon-knobs");
|
|
17
|
-
exports.default = {
|
|
18
|
-
title: "FormDropdown",
|
|
19
|
-
component: FormDropdown_1.default
|
|
20
|
-
};
|
|
21
|
-
exports.dropdown = () => React.createElement(FormDropdown_1.default, { dropdownId: "baaah", isRequired: false, ariaLabel: "search", options: ["one", "two", addon_knobs_1.text("third option", "three")], onSelectBlur: addon_actions_1.action("blur"), onSelectChange: addon_actions_1.action("changed") });
|
|
22
|
-
exports.dropdownWithSelected = () => React.createElement(FormDropdown_1.default, { dropdownId: "baaah", isRequired: false, ariaLabel: "search", selectedOption: "two", options: ["one", "two"], onSelectBlur: addon_actions_1.action("blur"), onSelectChange: addon_actions_1.action("changed") });
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface HelperErrorTextOptions {
|
|
3
|
-
content?: JSX.Element;
|
|
4
|
-
id?: string;
|
|
5
|
-
isError?: boolean;
|
|
6
|
-
modifiers?: string[];
|
|
7
|
-
blockName?: string;
|
|
8
|
-
baseClass?: string;
|
|
9
|
-
}
|
|
10
|
-
interface HelperErrorTextProps {
|
|
11
|
-
/** unique ID for helper */
|
|
12
|
-
id: string;
|
|
13
|
-
/** Toggles between helper and error styling */
|
|
14
|
-
isError: boolean;
|
|
15
|
-
/** Optional modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
|
|
16
|
-
modifiers?: string[];
|
|
17
|
-
/** Optional blockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
18
|
-
blockName?: string;
|
|
19
|
-
/** Optional baseClass for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
20
|
-
baseClass?: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Helper or Error text for forms
|
|
24
|
-
*/
|
|
25
|
-
export default function HelperErrorText(props: React.PropsWithChildren<HelperErrorTextProps>): JSX.Element;
|
|
26
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const React = __importStar(require("react"));
|
|
14
|
-
const bem_1 = __importDefault(require("../../../utils/bem"));
|
|
15
|
-
/**
|
|
16
|
-
* Helper or Error text for forms
|
|
17
|
-
*/
|
|
18
|
-
function HelperErrorText(props) {
|
|
19
|
-
const { id, blockName = "input-description", baseClass = "form-item", isError } = props;
|
|
20
|
-
let modifiers = [];
|
|
21
|
-
if (isError) {
|
|
22
|
-
modifiers.push("error");
|
|
23
|
-
}
|
|
24
|
-
if (props.modifiers) {
|
|
25
|
-
modifiers.push(...props.modifiers);
|
|
26
|
-
}
|
|
27
|
-
return React.createElement("span", { id: id, className: bem_1.default(blockName, modifiers, baseClass) }, props.children);
|
|
28
|
-
}
|
|
29
|
-
exports.default = HelperErrorText;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import HelperErrorText from "./HelperErrorText";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: typeof HelperErrorText;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
7
|
-
export declare const helperTextWithLink: () => JSX.Element;
|
|
8
|
-
export declare const errorText: () => JSX.Element;
|
|
9
|
-
export declare const longHelperText: () => JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const React = __importStar(require("react"));
|
|
14
|
-
const HelperErrorText_1 = __importDefault(require("./HelperErrorText"));
|
|
15
|
-
exports.default = {
|
|
16
|
-
title: "HelperErrorText",
|
|
17
|
-
component: HelperErrorText_1.default,
|
|
18
|
-
};
|
|
19
|
-
exports.helperTextWithLink = () => React.createElement(HelperErrorText_1.default, { id: "helperTextWithLink", isError: false },
|
|
20
|
-
"If you're unsure of your size, please view the ",
|
|
21
|
-
React.createElement("a", { href: "#sizing-chart" }, "Sizing Chart"));
|
|
22
|
-
exports.errorText = () => React.createElement(HelperErrorText_1.default, { id: "helpertextWithError", isError: true }, "Error Message");
|
|
23
|
-
exports.longHelperText = () => React.createElement(HelperErrorText_1.default, { id: "longHelperText", isError: false }, "Souffl\u00E9 jujubes cupcake chocolate bar topping. Lollipop sesame snaps tootsie roll liquorice sweet chupa chups. Gummi bears tart sweet roll tiramisu biscuit cookie cake. Cookie chocolate jelly-o topping. Halvah bear claw wafer cupcake tiramisu ice cream tart gummi bears. Lemon drops chocolate cake croissant lemon drops gummies ice cream sugar plum.");
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { HelperErrorTextOptions } from "./HelperErrorText";
|
|
3
|
-
export interface InputOptions {
|
|
4
|
-
baseClass?: string;
|
|
5
|
-
blockName?: string;
|
|
6
|
-
labelId?: string;
|
|
7
|
-
labelContent?: JSX.Element;
|
|
8
|
-
inputId?: string;
|
|
9
|
-
inputType?: string;
|
|
10
|
-
inputValue?: string | number;
|
|
11
|
-
onInputChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
-
isRequired?: boolean;
|
|
13
|
-
helperContentOpts?: HelperErrorTextOptions;
|
|
14
|
-
errorContentOpts?: HelperErrorTextOptions;
|
|
15
|
-
showError?: boolean;
|
|
16
|
-
}
|
|
17
|
-
interface InputProps {
|
|
18
|
-
/** Optional baseClass for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
19
|
-
baseClass?: string;
|
|
20
|
-
/** Optional blockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
21
|
-
blockName?: string;
|
|
22
|
-
/** The Label ID for the input */
|
|
23
|
-
labelId: string;
|
|
24
|
-
/** The label content for the input */
|
|
25
|
-
labelContent: JSX.Element;
|
|
26
|
-
/** The unique ID of the input */
|
|
27
|
-
inputId: string;
|
|
28
|
-
/** The HTML inputType */
|
|
29
|
-
inputType?: string;
|
|
30
|
-
/** The current input value */
|
|
31
|
-
inputValue?: string | number;
|
|
32
|
-
/** The action to perform on the <input>'s onChange function */
|
|
33
|
-
onInputChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
34
|
-
/** Whether the "required" flag is shown */
|
|
35
|
-
isRequired?: boolean;
|
|
36
|
-
/** The input helper text */
|
|
37
|
-
helperContentOpts?: HelperErrorTextOptions;
|
|
38
|
-
/** The input error text */
|
|
39
|
-
errorContentOpts?: HelperErrorTextOptions;
|
|
40
|
-
/** Whether the input is currently in an error state */
|
|
41
|
-
showError?: boolean;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* An Input field that labels a TextField and has Helpers or Errors
|
|
45
|
-
*/
|
|
46
|
-
export default function Input(props: InputProps): JSX.Element;
|
|
47
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const React = __importStar(require("react"));
|
|
14
|
-
const bem_1 = __importDefault(require("../../../utils/bem"));
|
|
15
|
-
const TextField_1 = __importDefault(require("../../01-atoms/Forms/TextField"));
|
|
16
|
-
const Label_1 = __importDefault(require("./Label"));
|
|
17
|
-
const HelperErrorText_1 = __importDefault(require("./HelperErrorText"));
|
|
18
|
-
/**
|
|
19
|
-
* An Input field that labels a TextField and has Helpers or Errors
|
|
20
|
-
*/
|
|
21
|
-
function Input(props) {
|
|
22
|
-
const { baseClass = "input", blockName = "form-item", labelId, labelContent, inputId, inputType = "text", inputValue, onInputChange, isRequired, helperContentOpts, errorContentOpts, showError } = props;
|
|
23
|
-
if (showError && !errorContentOpts) {
|
|
24
|
-
throw new Error("Error should be shown, but no errorContentOpts passed");
|
|
25
|
-
}
|
|
26
|
-
let labelOptions = { id: labelId, labelContent: labelContent, referenceId: inputId };
|
|
27
|
-
let textFieldOptions = { id: inputId, ariaLabelledBy: labelId, value: inputValue, isRequired: isRequired, type: inputType, onChange: onInputChange };
|
|
28
|
-
return (React.createElement("div", { className: bem_1.default(blockName, [], baseClass) },
|
|
29
|
-
React.createElement("div", { className: "label-container" },
|
|
30
|
-
React.createElement("div", { className: bem_1.default("label", [], baseClass) },
|
|
31
|
-
React.createElement(Label_1.default, { referenceId: labelOptions.referenceId, id: labelOptions.id }, labelOptions.labelContent)),
|
|
32
|
-
isRequired && React.createElement("span", { className: bem_1.default("required-message", [], baseClass) }, "Required")),
|
|
33
|
-
React.createElement(TextField_1.default, Object.assign({ id: inputId }, textFieldOptions)),
|
|
34
|
-
helperContentOpts && React.createElement("div", { className: bem_1.default("help-text", [], baseClass) },
|
|
35
|
-
React.createElement(HelperErrorText_1.default, { id: helperContentOpts.id, isError: false }, helperContentOpts.content)),
|
|
36
|
-
showError && React.createElement("div", { className: bem_1.default("error-text", [], baseClass) },
|
|
37
|
-
React.createElement(HelperErrorText_1.default, { id: errorContentOpts.id, isError: true }, errorContentOpts.content))));
|
|
38
|
-
}
|
|
39
|
-
exports.default = Input;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import Input from "./Input";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: typeof Input;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
7
|
-
export declare const input: () => JSX.Element;
|
|
8
|
-
export declare const inputWithHelper: () => JSX.Element;
|
|
9
|
-
export declare const inputRequiredWithError: () => JSX.Element;
|
|
10
|
-
export declare const inputRequiredWithHelperAndError: () => JSX.Element;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const React = __importStar(require("react"));
|
|
14
|
-
const Input_1 = __importDefault(require("./Input"));
|
|
15
|
-
exports.default = {
|
|
16
|
-
title: "Input",
|
|
17
|
-
component: Input_1.default,
|
|
18
|
-
};
|
|
19
|
-
exports.input = () => React.createElement(Input_1.default, { labelId: "blah", labelContent: React.createElement(React.Fragment, null, "Label"), inputId: "blah", isRequired: false });
|
|
20
|
-
exports.inputWithHelper = () => React.createElement(Input_1.default, { labelId: "blah", labelContent: React.createElement(React.Fragment, null, "Label"), inputId: "blah", helperContentOpts: { id: "blah", content: React.createElement(React.Fragment, null, "This is some helpful text") } });
|
|
21
|
-
exports.inputRequiredWithError = () => React.createElement(Input_1.default, { labelId: "blah", labelContent: React.createElement(React.Fragment, null, "Label"), inputId: "blah", isRequired: true, errorContentOpts: { id: "blah", content: React.createElement(React.Fragment, null, "Error Message Lorem Ipsum") }, showError: true });
|
|
22
|
-
exports.inputRequiredWithHelperAndError = () => React.createElement(Input_1.default, { labelId: "blah", labelContent: React.createElement(React.Fragment, null, "Label"), inputId: "blah", isRequired: true, helperContentOpts: { id: "blah", content: React.createElement(React.Fragment, null, "This is some helpful text") }, errorContentOpts: { id: "blah", content: React.createElement(React.Fragment, null, "Error Message Lorem Ipsum") }, showError: true });
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface LabelOptions {
|
|
3
|
-
labelContent?: JSX.Element;
|
|
4
|
-
id: string;
|
|
5
|
-
referenceId?: string;
|
|
6
|
-
}
|
|
7
|
-
interface LabelProps {
|
|
8
|
-
id: string;
|
|
9
|
-
/** The id of the html element that this Label is describing */
|
|
10
|
-
referenceId: string;
|
|
11
|
-
}
|
|
12
|
-
/** A Label for form inputs.
|
|
13
|
-
* It should never be used alone.
|
|
14
|
-
*/
|
|
15
|
-
export default function Label(props: React.PropsWithChildren<LabelProps>): React.DetailedReactHTMLElement<{
|
|
16
|
-
id: string;
|
|
17
|
-
htmlFor: string;
|
|
18
|
-
}, HTMLElement>;
|
|
19
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
const React = __importStar(require("react"));
|
|
11
|
-
/** A Label for form inputs.
|
|
12
|
-
* It should never be used alone.
|
|
13
|
-
*/
|
|
14
|
-
function Label(props) {
|
|
15
|
-
const { id, referenceId } = props;
|
|
16
|
-
let attributes = {
|
|
17
|
-
id: id,
|
|
18
|
-
htmlFor: referenceId
|
|
19
|
-
};
|
|
20
|
-
return React.createElement("label", attributes, props.children);
|
|
21
|
-
}
|
|
22
|
-
exports.default = Label;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const React = __importStar(require("react"));
|
|
14
|
-
const Label_1 = __importDefault(require("./Label"));
|
|
15
|
-
exports.default = {
|
|
16
|
-
title: "Label",
|
|
17
|
-
component: Label_1.default,
|
|
18
|
-
};
|
|
19
|
-
exports.label = () => React.createElement(Label_1.default, { id: "label-id", referenceId: "should-never-be-used-alone" },
|
|
20
|
-
React.createElement("div", null, "Lonely"));
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface TextFieldOptions {
|
|
3
|
-
id?: string;
|
|
4
|
-
ariaLabel?: string;
|
|
5
|
-
ariaLabelledBy?: string;
|
|
6
|
-
isRequired?: boolean;
|
|
7
|
-
blockName?: string;
|
|
8
|
-
modifiers?: string[];
|
|
9
|
-
value?: string | number;
|
|
10
|
-
placeholderText?: string;
|
|
11
|
-
type?: string;
|
|
12
|
-
onChange?: (event: React.FormEvent) => void;
|
|
13
|
-
}
|
|
14
|
-
export interface TextFieldProps {
|
|
15
|
-
id: string;
|
|
16
|
-
ariaLabel?: string;
|
|
17
|
-
ariaLabelledBy?: string;
|
|
18
|
-
isRequired?: boolean;
|
|
19
|
-
blockName?: string;
|
|
20
|
-
modifiers?: string[];
|
|
21
|
-
value?: string | number;
|
|
22
|
-
placeholderText?: string;
|
|
23
|
-
type?: string;
|
|
24
|
-
onChange?: (event: React.FormEvent) => void;
|
|
25
|
-
}
|
|
26
|
-
export default function TextField(props: TextFieldProps): JSX.Element;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
// AF-239 Text Field
|
|
14
|
-
const React = __importStar(require("react"));
|
|
15
|
-
const bem_1 = __importDefault(require("../../../utils/bem"));
|
|
16
|
-
function TextField(props) {
|
|
17
|
-
const { id, ariaLabel, ariaLabelledBy, isRequired = "false", blockName, modifiers, value, placeholderText, type = "text", onChange } = props;
|
|
18
|
-
let textfieldBlockName = blockName ? blockName : "form-item";
|
|
19
|
-
if (!ariaLabel && !ariaLabelledBy) {
|
|
20
|
-
throw new Error("Either label or ariaLabel must be defined");
|
|
21
|
-
}
|
|
22
|
-
let textFieldProps = {
|
|
23
|
-
className: bem_1.default("input", modifiers, textfieldBlockName),
|
|
24
|
-
type: type,
|
|
25
|
-
value: value,
|
|
26
|
-
onChange: onChange,
|
|
27
|
-
"aria-label": !ariaLabelledBy ? ariaLabel : undefined,
|
|
28
|
-
"aria-labelledby": ariaLabelledBy
|
|
29
|
-
};
|
|
30
|
-
if (isRequired) {
|
|
31
|
-
textFieldProps["aria-required"] = true;
|
|
32
|
-
}
|
|
33
|
-
let transformedTextField = React.createElement("input", Object.assign({ id: `input-${id}` }, textFieldProps, { placeholder: placeholderText }));
|
|
34
|
-
return transformedTextField;
|
|
35
|
-
}
|
|
36
|
-
exports.default = TextField;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const React = __importStar(require("react"));
|
|
14
|
-
const TextField_1 = __importDefault(require("./TextField"));
|
|
15
|
-
const addon_actions_1 = require("@storybook/addon-actions");
|
|
16
|
-
exports.default = {
|
|
17
|
-
title: "TextField",
|
|
18
|
-
component: TextField_1.default,
|
|
19
|
-
};
|
|
20
|
-
exports.textField = () => React.createElement(TextField_1.default, { id: "text-field", ariaLabel: "text field", isRequired: false, onChange: addon_actions_1.action("changed") });
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface IconProps {
|
|
3
|
-
name: string;
|
|
4
|
-
blockName?: string;
|
|
5
|
-
modifiers?: string[];
|
|
6
|
-
decorative: boolean;
|
|
7
|
-
role?: string;
|
|
8
|
-
title?: boolean;
|
|
9
|
-
desc?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export default class Icon extends React.Component<IconProps, {}> {
|
|
12
|
-
constructor(props: IconProps);
|
|
13
|
-
render(): JSX.Element;
|
|
14
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const React = __importStar(require("react"));
|
|
14
|
-
const sprite_svg_1 = __importDefault(require("@nypl/design-system-icons/dist/sprite/sprite.svg"));
|
|
15
|
-
const bem_1 = __importDefault(require("../../../../utils/bem"));
|
|
16
|
-
class Icon extends React.Component {
|
|
17
|
-
constructor(props) {
|
|
18
|
-
super(props);
|
|
19
|
-
}
|
|
20
|
-
render() {
|
|
21
|
-
let { modifiers, blockName, name, decorative, role, title, desc } = this.props;
|
|
22
|
-
let icon_base_class = "icon";
|
|
23
|
-
let iconProps = {
|
|
24
|
-
"className": bem_1.default(icon_base_class, modifiers, blockName),
|
|
25
|
-
"role": decorative ? "img" : role,
|
|
26
|
-
"aria-hidden": decorative,
|
|
27
|
-
"aria-labelledby": title ? "title-" + name : undefined,
|
|
28
|
-
"aria-describedby": desc ? "desc-" + name : undefined
|
|
29
|
-
};
|
|
30
|
-
return (React.createElement("svg", Object.assign({}, iconProps),
|
|
31
|
-
title &&
|
|
32
|
-
React.createElement("title", { id: `title-${name}` }, title),
|
|
33
|
-
desc &&
|
|
34
|
-
React.createElement("desc", { id: `title-${name}` }, desc),
|
|
35
|
-
React.createElement("use", { href: `${sprite_svg_1.default}#${name}` })));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.default = Icon;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
// Images
|
|
14
|
-
const React = __importStar(require("react"));
|
|
15
|
-
const bem_1 = __importDefault(require("../../../../utils/bem"));
|
|
16
|
-
function Image(props) {
|
|
17
|
-
const image_base_class = "image";
|
|
18
|
-
const { src, isDecorative, altText, imageModifiers, imageBlockname } = props;
|
|
19
|
-
if (!isDecorative && !altText) {
|
|
20
|
-
throw new Error("If image is decorative, alt text is required");
|
|
21
|
-
}
|
|
22
|
-
if (altText && altText.length > 300) {
|
|
23
|
-
throw new Error("Alt Text must be less than 300 characters");
|
|
24
|
-
}
|
|
25
|
-
let imageProps = {
|
|
26
|
-
className: bem_1.default(image_base_class, imageModifiers, imageBlockname),
|
|
27
|
-
src: src,
|
|
28
|
-
alt: isDecorative ? "" : altText
|
|
29
|
-
};
|
|
30
|
-
return React.createElement("img", Object.assign({}, imageProps));
|
|
31
|
-
}
|
|
32
|
-
exports.default = Image;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const React = __importStar(require("react"));
|
|
14
|
-
const Image_1 = __importDefault(require("./Image"));
|
|
15
|
-
exports.default = {
|
|
16
|
-
title: "Image",
|
|
17
|
-
component: Image_1.default,
|
|
18
|
-
};
|
|
19
|
-
exports.twoByOne = () => [React.createElement(Image_1.default, { src: "https://placeimg.com/200/100/arch", isDecorative: true }),
|
|
20
|
-
React.createElement(Image_1.default, { src: "https://placeimg.com/400/200/arch", isDecorative: true }),
|
|
21
|
-
React.createElement(Image_1.default, { src: "https://placeimg.com/1600/800/arch", isDecorative: true }),
|
|
22
|
-
React.createElement(Image_1.default, { src: "https://placeimg.com/2000/1000/arch", isDecorative: true })];
|
|
23
|
-
exports.threeByFour = () => [React.createElement(Image_1.default, { src: "https://placeimg.com/150/200/arch", isDecorative: true }),
|
|
24
|
-
React.createElement(Image_1.default, { src: "https://placeimg.com/300/400/arch", isDecorative: true })];
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface BasicLinkProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
icon?: {
|
|
5
|
-
element: JSX.Element;
|
|
6
|
-
};
|
|
7
|
-
url?: string;
|
|
8
|
-
attributes?: {};
|
|
9
|
-
}
|
|
10
|
-
export declare class BasicLinkBase extends React.Component<BasicLinkProps, {}> {
|
|
11
|
-
constructor(props: BasicLinkProps);
|
|
12
|
-
render(): JSX.Element;
|
|
13
|
-
}
|
|
14
|
-
declare const BasicLink: React.ComponentType<BasicLinkProps>;
|
|
15
|
-
export default BasicLink;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
-
if (mod && mod.__esModule) return mod;
|
|
4
|
-
var result = {};
|
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
-
result["default"] = mod;
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
// Base Link Helper Class
|
|
14
|
-
const React = __importStar(require("react"));
|
|
15
|
-
const WithOneChild_1 = __importDefault(require("../../../helpers/hoc/WithOneChild"));
|
|
16
|
-
class BasicLinkBase extends React.Component {
|
|
17
|
-
constructor(props) {
|
|
18
|
-
super(props);
|
|
19
|
-
}
|
|
20
|
-
render() {
|
|
21
|
-
const { url, className, attributes, icon } = this.props;
|
|
22
|
-
let props = Object.assign({ className: className }, attributes);
|
|
23
|
-
let linkElement;
|
|
24
|
-
// If the value is a string, then it's only one element but wrap it in a fragment.
|
|
25
|
-
if (typeof this.props.children === "string") {
|
|
26
|
-
if (!url) {
|
|
27
|
-
throw new Error(`if children ${this.props.children} has no anchor tag, please pass prop: url`);
|
|
28
|
-
}
|
|
29
|
-
props["href"] = url;
|
|
30
|
-
let linkChildren = [React.createElement(React.Fragment, null, this.props.children)];
|
|
31
|
-
if (icon) {
|
|
32
|
-
linkChildren.push(icon.element);
|
|
33
|
-
}
|
|
34
|
-
linkElement = React.createElement("a", props, linkChildren);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
let passedInChild = this.props.children;
|
|
38
|
-
let linkChildren = [passedInChild.props.children];
|
|
39
|
-
if (icon) {
|
|
40
|
-
linkChildren.push(icon.element);
|
|
41
|
-
}
|
|
42
|
-
// TODO Check that there is a href attribute and that this is indeed a link.
|
|
43
|
-
linkElement = React.cloneElement(passedInChild, props, linkChildren);
|
|
44
|
-
}
|
|
45
|
-
return linkElement;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.BasicLinkBase = BasicLinkBase;
|
|
49
|
-
const BasicLink = WithOneChild_1.default(BasicLinkBase);
|
|
50
|
-
exports.default = BasicLink;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: React.ComponentType<import("./BasicLink").BasicLinkProps>;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
7
|
-
export declare const passedInBasicLink: () => JSX.Element;
|
|
8
|
-
export declare const generatedBasicLink: () => JSX.Element;
|