@nypl/design-system-react-components 2.0.0 → 2.0.1
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 +37569 -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/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/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 +89 -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/types.d.ts +2 -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 +5 -0
- package/dist/src/hooks/useWindowSize.d.ts +10 -0
- package/dist/src/index.d.ts +83 -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/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/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 +41 -0
- package/dist/styles.css +1 -0
- package/package.json +129 -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,19 +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
|
-
function Container(props) {
|
|
16
|
-
const { modifiers = [], blockName } = props;
|
|
17
|
-
return (React.createElement("div", { className: bem_1.default("container", modifiers, blockName) }, props.children));
|
|
18
|
-
}
|
|
19
|
-
exports.default = Container;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface ModalProps {
|
|
3
|
-
/** Optional modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
|
|
4
|
-
modifiers?: string[];
|
|
5
|
-
/** Optional blockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
6
|
-
blockName?: string;
|
|
7
|
-
}
|
|
8
|
-
export default class Modal extends React.Component<ModalProps, {}> {
|
|
9
|
-
componentDidMount(): void;
|
|
10
|
-
componentWillUnmount(): void;
|
|
11
|
-
render(): JSX.Element;
|
|
12
|
-
}
|
|
@@ -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
|
-
/* Full-screen modal that appears on top of the body */
|
|
16
|
-
class Modal extends React.Component {
|
|
17
|
-
componentDidMount() {
|
|
18
|
-
document.body.classList.add("no-scroll");
|
|
19
|
-
}
|
|
20
|
-
componentWillUnmount() {
|
|
21
|
-
document.body.classList.remove("no-scroll");
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
const { modifiers = [], blockName = "" } = this.props;
|
|
25
|
-
let baseClass = "modal";
|
|
26
|
-
return (React.createElement("div", { tabIndex: 0, className: bem_1.default(baseClass, modifiers, blockName) }, this.props.children));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.default = Modal;
|
|
@@ -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 Modal_1 = __importDefault(require("./Modal"));
|
|
15
|
-
exports.default = {
|
|
16
|
-
title: "Modal",
|
|
17
|
-
component: Modal_1.default,
|
|
18
|
-
};
|
|
19
|
-
exports.modal = () => React.createElement(Modal_1.default, null,
|
|
20
|
-
React.createElement("div", null, "Modal Content"));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface PlaceholderProps {
|
|
3
|
-
modifiers?: string[];
|
|
4
|
-
blockName?: string;
|
|
5
|
-
}
|
|
6
|
-
/** Creates a gray box with an editable string for dropping in spaces
|
|
7
|
-
* within components or on templates where a component will be but
|
|
8
|
-
* that hasn't been created yet
|
|
9
|
-
*/
|
|
10
|
-
export default function Placeholder(props: React.PropsWithChildren<PlaceholderProps>): 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 bem_1 = __importDefault(require("../../utils/bem"));
|
|
15
|
-
/** Creates a gray box with an editable string for dropping in spaces
|
|
16
|
-
* within components or on templates where a component will be but
|
|
17
|
-
* that hasn't been created yet
|
|
18
|
-
*/
|
|
19
|
-
function Placeholder(props) {
|
|
20
|
-
const { modifiers = [], blockName } = props;
|
|
21
|
-
return (React.createElement("div", { className: bem_1.default("placeholder", modifiers, blockName) }, props.children));
|
|
22
|
-
}
|
|
23
|
-
exports.default = Placeholder;
|
|
@@ -1,16 +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 SectionName = ({ children }) => React.createElement("div", { className: bem_1.default('main', ['research']) }, children);
|
|
16
|
-
exports.default = SectionName;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { ButtonTypes, ButtonIconPositions } from "./ButtonTypes";
|
|
3
|
-
export interface ButtonOptions {
|
|
4
|
-
content?: JSX.Element;
|
|
5
|
-
id: string;
|
|
6
|
-
callback?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
7
|
-
attributes?: {};
|
|
8
|
-
modifiers?: string[];
|
|
9
|
-
blockName?: string;
|
|
10
|
-
buttonType?: ButtonTypes;
|
|
11
|
-
type?: "submit" | "button" | "reset";
|
|
12
|
-
mouseDown?: boolean;
|
|
13
|
-
iconPosition?: ButtonIconPositions;
|
|
14
|
-
iconName?: string;
|
|
15
|
-
iconModifiers?: string[];
|
|
16
|
-
iconDecorative?: boolean;
|
|
17
|
-
iconRole?: string;
|
|
18
|
-
}
|
|
19
|
-
interface ButtonProps {
|
|
20
|
-
id: string;
|
|
21
|
-
/** The action to perform on the <button>'s onClick function */
|
|
22
|
-
callback: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
23
|
-
/** Additional attributes passed to the button */
|
|
24
|
-
attributes?: {};
|
|
25
|
-
/** Optional modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
|
|
26
|
-
modifiers?: string[];
|
|
27
|
-
/** Optional blockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
28
|
-
blockName?: string;
|
|
29
|
-
/** The Kind of button */
|
|
30
|
-
buttonType?: ButtonTypes;
|
|
31
|
-
/** The html button attribute */
|
|
32
|
-
type?: "submit" | "button" | "reset";
|
|
33
|
-
mouseDown?: boolean;
|
|
34
|
-
/** If an icon is to be rendered, an `iconPosition` prop is required. */
|
|
35
|
-
iconPosition?: ButtonIconPositions;
|
|
36
|
-
/** The name of the icon. Corresponds with the name of the icon's svg file */
|
|
37
|
-
iconName?: string;
|
|
38
|
-
/** Optional modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
|
|
39
|
-
iconModifiers?: string[];
|
|
40
|
-
/** Is the icon decorative */
|
|
41
|
-
iconDecorative?: boolean;
|
|
42
|
-
/** The role for the icon, if not decorative */
|
|
43
|
-
iconRole?: string;
|
|
44
|
-
}
|
|
45
|
-
export default class Button extends React.Component<ButtonProps, {}> {
|
|
46
|
-
static defaultProps: {
|
|
47
|
-
mouseDown: boolean;
|
|
48
|
-
};
|
|
49
|
-
constructor(props: ButtonProps);
|
|
50
|
-
render(): JSX.Element;
|
|
51
|
-
}
|
|
52
|
-
export {};
|
|
@@ -1,76 +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 Icon_1 = __importDefault(require("../Images/Icons/Icon"));
|
|
15
|
-
const bem_1 = __importDefault(require("../../../utils/bem"));
|
|
16
|
-
const ButtonTypes_1 = require("./ButtonTypes");
|
|
17
|
-
class Button extends React.Component {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
const { id, callback, attributes, modifiers, blockName, buttonType, type = "submit", mouseDown, iconPosition, iconName, iconModifiers, iconDecorative, iconRole, children } = this.props;
|
|
23
|
-
let buttonModifiers = modifiers ? modifiers : [];
|
|
24
|
-
if (!buttonModifiers.find((mod) => mod === buttonType)) {
|
|
25
|
-
buttonModifiers.push(buttonType);
|
|
26
|
-
}
|
|
27
|
-
let button_base_class = "button";
|
|
28
|
-
let iconProps;
|
|
29
|
-
// An icon needs a position in order for it to be created and
|
|
30
|
-
// rendered in the button.
|
|
31
|
-
if (iconPosition) {
|
|
32
|
-
iconProps = {
|
|
33
|
-
name: iconName,
|
|
34
|
-
key: `icon-${id}`,
|
|
35
|
-
blockName: button_base_class,
|
|
36
|
-
modifiers: ["small"],
|
|
37
|
-
decorative: iconDecorative,
|
|
38
|
-
desc: iconDecorative,
|
|
39
|
-
role: iconDecorative ? undefined : iconRole,
|
|
40
|
-
title: iconDecorative
|
|
41
|
-
};
|
|
42
|
-
if (iconModifiers) {
|
|
43
|
-
iconProps.modifiers.push(...iconModifiers);
|
|
44
|
-
}
|
|
45
|
-
buttonModifiers.push("icon");
|
|
46
|
-
switch (iconPosition) {
|
|
47
|
-
case ButtonTypes_1.ButtonIconPositions.Left: {
|
|
48
|
-
buttonModifiers.push("icon-left");
|
|
49
|
-
iconProps.modifiers.push("icon-left");
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
case ButtonTypes_1.ButtonIconPositions.Right: {
|
|
53
|
-
buttonModifiers.push("icon-right");
|
|
54
|
-
iconProps.modifiers.push("icon-right");
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
case ButtonTypes_1.ButtonIconPositions.JustifyRight: {
|
|
58
|
-
buttonModifiers.push("justify-right");
|
|
59
|
-
iconProps.modifiers.push("justify-right");
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
default: {
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
let btnCallback = mouseDown ? { onMouseDown: callback } : { onClick: callback };
|
|
68
|
-
return (React.createElement("button", Object.assign({ id: "btn-" + id, className: bem_1.default(button_base_class, buttonModifiers, blockName), type: type }, attributes, btnCallback),
|
|
69
|
-
React.createElement("span", { className: bem_1.default("label", buttonModifiers, button_base_class) }, children),
|
|
70
|
-
iconProps && React.createElement(Icon_1.default, Object.assign({}, iconProps))));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.default = Button;
|
|
74
|
-
Button.defaultProps = {
|
|
75
|
-
mouseDown: false
|
|
76
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Button from "./Button";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: typeof Button;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
7
|
-
export declare const buttonFilledIcon: () => JSX.Element;
|
|
8
|
-
export declare const buttonOutline: () => JSX.Element;
|
|
9
|
-
export declare const buttonWithSpan: () => JSX.Element;
|
|
10
|
-
export declare const buttonIconChildrenString: () => JSX.Element;
|
|
11
|
-
export declare const buttonIconChildrenElement: () => JSX.Element;
|
|
12
|
-
export declare const buttonFullWidthIconRight: () => JSX.Element;
|
|
13
|
-
export declare const linkLikeButton: () => JSX.Element;
|
|
14
|
-
export declare const linkLikeButtonIconLeft: () => JSX.Element;
|
|
@@ -1,33 +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 Button_1 = __importDefault(require("./Button"));
|
|
15
|
-
const addon_actions_1 = require("@storybook/addon-actions");
|
|
16
|
-
const ButtonTypes_1 = require("./ButtonTypes");
|
|
17
|
-
exports.default = {
|
|
18
|
-
title: "Button",
|
|
19
|
-
component: Button_1.default,
|
|
20
|
-
};
|
|
21
|
-
exports.buttonFilledIcon = () => React.createElement(Button_1.default, { callback: addon_actions_1.action("clicked"), id: "button", buttonType: ButtonTypes_1.ButtonTypes.Filled, type: "submit", iconPosition: ButtonTypes_1.ButtonIconPositions.Left, iconName: "search-small", iconDecorative: true }, "Search");
|
|
22
|
-
exports.buttonOutline = () => React.createElement(Button_1.default, { callback: addon_actions_1.action("clicked"), id: "button", type: "submit", buttonType: ButtonTypes_1.ButtonTypes.Outline }, "Hello World");
|
|
23
|
-
exports.buttonWithSpan = () => React.createElement(Button_1.default, { callback: addon_actions_1.action("clicked"), id: "button", buttonType: ButtonTypes_1.ButtonTypes.Outline },
|
|
24
|
-
React.createElement("span", null, "Style my span!"));
|
|
25
|
-
exports.buttonIconChildrenString = () => React.createElement(Button_1.default, { callback: addon_actions_1.action("clicked"), id: "button", buttonType: ButtonTypes_1.ButtonTypes.Filled, type: "submit", iconPosition: ButtonTypes_1.ButtonIconPositions.Right, iconName: "search-small", iconDecorative: true }, "Search!");
|
|
26
|
-
exports.buttonIconChildrenElement = () => React.createElement(Button_1.default, { callback: addon_actions_1.action("clicked"), id: "button", buttonType: ButtonTypes_1.ButtonTypes.Outline, type: "button", iconPosition: ButtonTypes_1.ButtonIconPositions.Right, iconName: "search-small", iconDecorative: true },
|
|
27
|
-
React.createElement("span", null, "I'm wrapped in a span!"));
|
|
28
|
-
exports.buttonFullWidthIconRight = () => React.createElement(Button_1.default, { callback: addon_actions_1.action("clicked"), id: "button", type: "submit", buttonType: ButtonTypes_1.ButtonTypes.Outline, iconPosition: ButtonTypes_1.ButtonIconPositions.JustifyRight, modifiers: ["large"], iconName: "plus", iconDecorative: true },
|
|
29
|
-
React.createElement("span", null, "button content"));
|
|
30
|
-
exports.linkLikeButton = () => React.createElement(Button_1.default, { callback: addon_actions_1.action["clicked"], id: "button", type: "button", buttonType: ButtonTypes_1.ButtonTypes.Link },
|
|
31
|
-
React.createElement("span", null, "button content"));
|
|
32
|
-
exports.linkLikeButtonIconLeft = () => React.createElement(Button_1.default, { callback: addon_actions_1.action["clicked"], id: "button", type: "button", buttonType: ButtonTypes_1.ButtonTypes.Link, iconPosition: ButtonTypes_1.ButtonIconPositions.Left, iconName: "arrow-xsmall", iconDecorative: true },
|
|
33
|
-
React.createElement("span", null, "button content"));
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var ButtonTypes;
|
|
4
|
-
(function (ButtonTypes) {
|
|
5
|
-
ButtonTypes["Outline"] = "outline";
|
|
6
|
-
ButtonTypes["Filled"] = "filled";
|
|
7
|
-
ButtonTypes["Link"] = "link";
|
|
8
|
-
})(ButtonTypes = exports.ButtonTypes || (exports.ButtonTypes = {}));
|
|
9
|
-
var ButtonIconPositions;
|
|
10
|
-
(function (ButtonIconPositions) {
|
|
11
|
-
ButtonIconPositions["Left"] = "icon-left";
|
|
12
|
-
ButtonIconPositions["Right"] = "icon-right";
|
|
13
|
-
ButtonIconPositions["JustifyRight"] = "justify-right";
|
|
14
|
-
})(ButtonIconPositions = exports.ButtonIconPositions || (exports.ButtonIconPositions = {}));
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { LabelOptions } from "./Label";
|
|
3
|
-
interface CheckboxProps {
|
|
4
|
-
/** name of the checkbox */
|
|
5
|
-
name?: string;
|
|
6
|
-
/** Optional blockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
7
|
-
blockName?: string;
|
|
8
|
-
/** Optional modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
|
|
9
|
-
modifiers?: string[];
|
|
10
|
-
/** Unique ID used by checkbox */
|
|
11
|
-
checkboxId: string;
|
|
12
|
-
labelOptions: LabelOptions;
|
|
13
|
-
isSelected?: boolean;
|
|
14
|
-
/** The action to perform on the <input>'s onChange function */
|
|
15
|
-
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* A Form Checkbox component that can be selected and deselected.
|
|
19
|
-
*/
|
|
20
|
-
export default function Checkbox(props: CheckboxProps): JSX.Element;
|
|
21
|
-
export {};
|
|
@@ -1,27 +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 Label_1 = __importDefault(require("./Label"));
|
|
16
|
-
/**
|
|
17
|
-
* A Form Checkbox component that can be selected and deselected.
|
|
18
|
-
*/
|
|
19
|
-
function Checkbox(props) {
|
|
20
|
-
const { name, modifiers = [], blockName = "", checkboxId, labelOptions, isSelected, onChange } = props;
|
|
21
|
-
const baseClass = "checkbox";
|
|
22
|
-
return (React.createElement("div", { className: bem_1.default(baseClass, modifiers, blockName) },
|
|
23
|
-
React.createElement("input", { id: checkboxId, name: name, className: bem_1.default("input", [], baseClass), onChange: onChange, type: "checkbox", "aria-checked": isSelected, checked: isSelected }),
|
|
24
|
-
React.createElement("span", { className: bem_1.default("label", [], baseClass) },
|
|
25
|
-
React.createElement(Label_1.default, { referenceId: checkboxId, id: labelOptions.id }, labelOptions.labelContent))));
|
|
26
|
-
}
|
|
27
|
-
exports.default = Checkbox;
|
|
@@ -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 Checkbox_1 = __importDefault(require("./Checkbox"));
|
|
15
|
-
const addon_actions_1 = require("@storybook/addon-actions");
|
|
16
|
-
exports.default = {
|
|
17
|
-
title: "Checkbox",
|
|
18
|
-
component: Checkbox_1.default,
|
|
19
|
-
};
|
|
20
|
-
exports.checkbox = () => React.createElement(Checkbox_1.default, { checkboxId: "checkbox", labelOptions: {
|
|
21
|
-
id: "label",
|
|
22
|
-
labelContent: React.createElement(React.Fragment, null, "Label Text")
|
|
23
|
-
}, onChange: addon_actions_1.action("changed") });
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ButtonOptions } from "../Button/Button";
|
|
2
|
-
import { HelperErrorTextOptions } from "./HelperErrorText";
|
|
3
|
-
import { InputOptions } from "./Input";
|
|
4
|
-
import { LabelOptions } from "./Label";
|
|
5
|
-
export interface DateCheckFormProps {
|
|
6
|
-
/** Optional blockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
7
|
-
blockName?: string;
|
|
8
|
-
/** Optional baseClass for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
|
|
9
|
-
baseClass?: string;
|
|
10
|
-
/** The Label to describe the form */
|
|
11
|
-
formLabel: JSX.Element;
|
|
12
|
-
/** The Label to describe the from input */
|
|
13
|
-
fromLabelOpts: LabelOptions;
|
|
14
|
-
/** The from input */
|
|
15
|
-
fromInputOpts: InputOptions;
|
|
16
|
-
/** Helper text for the from input */
|
|
17
|
-
fromHelper?: HelperErrorTextOptions;
|
|
18
|
-
/** The Label to describe the to input */
|
|
19
|
-
toLabelOpts: LabelOptions;
|
|
20
|
-
/** The to input */
|
|
21
|
-
toInputOpts: InputOptions;
|
|
22
|
-
/** Helper text for the to input */
|
|
23
|
-
toHelper?: HelperErrorTextOptions;
|
|
24
|
-
/** Whether the form is currently in an error state */
|
|
25
|
-
showError: boolean;
|
|
26
|
-
/** The error text to render */
|
|
27
|
-
error?: HelperErrorTextOptions;
|
|
28
|
-
/** The submit button */
|
|
29
|
-
buttonOpts?: ButtonOptions;
|
|
30
|
-
}
|
|
31
|
-
export default function DateRangeForm(props: DateCheckFormProps): JSX.Element;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const Button_1 = __importDefault(require("../Button/Button"));
|
|
8
|
-
const HelperErrorText_1 = __importDefault(require("./HelperErrorText"));
|
|
9
|
-
const Input_1 = __importDefault(require("./Input"));
|
|
10
|
-
const bem_1 = __importDefault(require("../../../utils/bem"));
|
|
11
|
-
/* Input fields for date ranges. */
|
|
12
|
-
function DateRangeForm(props) {
|
|
13
|
-
const { blockName = "date-range", baseClass, formLabel, fromLabelOpts, fromInputOpts, fromHelper, toLabelOpts, toInputOpts, toHelper, showError, error, buttonOpts } = props;
|
|
14
|
-
if (showError && !error) {
|
|
15
|
-
throw new Error("Error should be shown, but no Error Content exists");
|
|
16
|
-
}
|
|
17
|
-
return (react_1.default.createElement("fieldset", { className: bem_1.default(blockName, [], baseClass) },
|
|
18
|
-
react_1.default.createElement("legend", null, formLabel),
|
|
19
|
-
react_1.default.createElement("div", { className: "input-row" },
|
|
20
|
-
react_1.default.createElement(Input_1.default, { baseClass: "input-row", labelId: fromLabelOpts.id, labelContent: fromLabelOpts.labelContent, inputId: fromInputOpts.inputId, inputType: "number", inputValue: fromInputOpts.inputValue, onInputChange: fromInputOpts.onInputChange, helperContentOpts: fromHelper }),
|
|
21
|
-
react_1.default.createElement(Input_1.default, { baseClass: "input-row", labelId: toLabelOpts.id, labelContent: toLabelOpts.labelContent, inputId: toInputOpts.inputId, inputType: "number", inputValue: toInputOpts.inputValue, onInputChange: toInputOpts.onInputChange, helperContentOpts: toHelper })),
|
|
22
|
-
showError &&
|
|
23
|
-
react_1.default.createElement(HelperErrorText_1.default, { isError: true, id: error.id }, error.content),
|
|
24
|
-
buttonOpts &&
|
|
25
|
-
react_1.default.createElement(Button_1.default, Object.assign({ callback: buttonOpts.callback, id: buttonOpts.id }, buttonOpts), buttonOpts.content)));
|
|
26
|
-
}
|
|
27
|
-
exports.default = DateRangeForm;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import DateRangeForm from "./DateRangeForm";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: typeof DateRangeForm;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
7
|
-
export declare const defaultState: () => JSX.Element;
|
|
8
|
-
export declare const errorState: () => JSX.Element;
|
|
9
|
-
export declare const noButton: () => 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 DateRangeForm_1 = __importDefault(require("./DateRangeForm"));
|
|
15
|
-
const addon_actions_1 = require("@storybook/addon-actions");
|
|
16
|
-
exports.default = {
|
|
17
|
-
title: "DateRangeForm",
|
|
18
|
-
component: DateRangeForm_1.default,
|
|
19
|
-
};
|
|
20
|
-
let callback = addon_actions_1.action("clicked");
|
|
21
|
-
exports.defaultState = () => React.createElement(DateRangeForm_1.default, { formLabel: React.createElement(React.Fragment, null, "Publication Year"), fromLabelOpts: { labelContent: React.createElement(React.Fragment, null, "From"), id: "FromLabel" }, fromInputOpts: { inputId: "fromInput" }, fromHelper: { content: React.createElement(React.Fragment, null, "E.x., 1901"), id: "fromyearhelper", isError: false }, toLabelOpts: { labelContent: React.createElement(React.Fragment, null, "To"), id: "ToLabel" }, toInputOpts: { inputId: "toInput" }, toHelper: { content: React.createElement(React.Fragment, null, "E.x., 2000"), id: "toYearHelper", isError: false }, showError: false, error: { content: React.createElement(React.Fragment, null), id: "errorId", isError: true }, buttonOpts: { id: "submitButtonId", callback: callback, content: React.createElement(React.Fragment, null, "Submit") } });
|
|
22
|
-
exports.errorState = () => React.createElement(DateRangeForm_1.default, { formLabel: React.createElement(React.Fragment, null, "Publication Year"), fromLabelOpts: { labelContent: React.createElement(React.Fragment, null, "From"), id: "FromLabel" }, fromInputOpts: { inputId: "fromInput" }, fromHelper: { content: React.createElement(React.Fragment, null, "E.x., 1901"), id: "fromyearhelper" }, toLabelOpts: { labelContent: React.createElement(React.Fragment, null, "To"), id: "ToLabel" }, toInputOpts: { inputId: "toInput" }, toHelper: { content: React.createElement(React.Fragment, null, "E.x., 2000"), id: "toYearHelper" }, showError: true, error: { content: React.createElement("div", null, "The end year should be the same year as or later than the start year"), id: "errorId" }, buttonOpts: { id: "submitButtonId", callback: callback, content: React.createElement(React.Fragment, null, "Submit") } });
|
|
23
|
-
exports.noButton = () => React.createElement(DateRangeForm_1.default, { formLabel: React.createElement(React.Fragment, null, "Publication Year"), fromLabelOpts: { labelContent: React.createElement(React.Fragment, null, "From"), id: "FromLabel" }, fromInputOpts: { inputId: "fromInput" }, fromHelper: { content: React.createElement(React.Fragment, null, "E.x., 1901"), id: "fromyearhelper" }, toLabelOpts: { labelContent: React.createElement(React.Fragment, null, "To"), id: "ToLabel" }, toInputOpts: { inputId: "toInput" }, toHelper: { content: React.createElement(React.Fragment, null, "E.x., 2000"), id: "toYearHelper" }, showError: true, error: { content: React.createElement("div", null, "The end year should be the same year as or later than the start year"), id: "errorId" } });
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface FormDropdownProps {
|
|
3
|
-
dropdownId: string;
|
|
4
|
-
blockName?: string;
|
|
5
|
-
modifiers?: string[];
|
|
6
|
-
labelId?: string;
|
|
7
|
-
isRequired: boolean;
|
|
8
|
-
ariaLabel?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
options: string[];
|
|
11
|
-
selectedOption?: string;
|
|
12
|
-
onSelectBlur: (event: React.FormEvent) => void;
|
|
13
|
-
onSelectChange: (event: React.FormEvent) => void;
|
|
14
|
-
}
|
|
15
|
-
export default class FormDropdown extends React.Component<FormDropdownProps, {
|
|
16
|
-
selectedOption: string;
|
|
17
|
-
}> {
|
|
18
|
-
constructor(props: FormDropdownProps);
|
|
19
|
-
componentDidUpdate(): void;
|
|
20
|
-
onSelectChange(event: React.FormEvent, additionalChange: Function): void;
|
|
21
|
-
render(): JSX.Element;
|
|
22
|
-
}
|
|
@@ -1,64 +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-121 Form Dropdown
|
|
14
|
-
const React = __importStar(require("react"));
|
|
15
|
-
const bem_1 = __importDefault(require("../../../utils/bem"));
|
|
16
|
-
const Icon_1 = __importDefault(require("../Images/Icons/Icon"));
|
|
17
|
-
class FormDropdown extends React.Component {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
this.state = { selectedOption: props.selectedOption };
|
|
21
|
-
this.onSelectChange.bind(this);
|
|
22
|
-
}
|
|
23
|
-
componentDidUpdate() {
|
|
24
|
-
if (this.state.selectedOption !== this.props.selectedOption) {
|
|
25
|
-
this.setState({ selectedOption: this.props.selectedOption });
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
onSelectChange(event, additionalChange) {
|
|
29
|
-
let target = event.target;
|
|
30
|
-
if (target) {
|
|
31
|
-
this.setState({ selectedOption: target.value });
|
|
32
|
-
}
|
|
33
|
-
additionalChange(event);
|
|
34
|
-
}
|
|
35
|
-
render() {
|
|
36
|
-
const { dropdownId, blockName = "form-item", options, labelId, isRequired, ariaLabel, disabled = false, selectedOption, onSelectBlur, onSelectChange } = this.props;
|
|
37
|
-
const modifiers = this.props.modifiers ? this.props.modifiers : [];
|
|
38
|
-
if (!labelId && !ariaLabel) {
|
|
39
|
-
throw new Error("Must either have labelId or aria-label");
|
|
40
|
-
}
|
|
41
|
-
let formItemBlockName = blockName;
|
|
42
|
-
let selectProps = {
|
|
43
|
-
id: dropdownId,
|
|
44
|
-
className: bem_1.default("select", modifiers, formItemBlockName),
|
|
45
|
-
"aria-required": isRequired,
|
|
46
|
-
value: this.state.selectedOption ? this.state.selectedOption : undefined,
|
|
47
|
-
disabled: disabled
|
|
48
|
-
};
|
|
49
|
-
if (labelId) {
|
|
50
|
-
selectProps["aria-labelledby"] = labelId;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
selectProps["aria-label"] = ariaLabel;
|
|
54
|
-
}
|
|
55
|
-
if (!options.length)
|
|
56
|
-
return;
|
|
57
|
-
return (React.createElement("div", { className: bem_1.default("dropdown", modifiers, formItemBlockName) },
|
|
58
|
-
React.createElement("select", Object.assign({}, selectProps, { onChange: (e) => this.onSelectChange(e, onSelectChange), onBlur: (e) => this.onSelectChange(e, onSelectBlur) }), options.map((child, key) => {
|
|
59
|
-
return React.createElement("option", { key: key.toString(), "aria-selected": child === this.state.selectedOption, value: child }, child);
|
|
60
|
-
})),
|
|
61
|
-
React.createElement(Icon_1.default, { decorative: true, name: "arrow", modifiers: ["small"] })));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.default = FormDropdown;
|