@ohos-ports/sprucelabs-react-heartwood-components 9.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +59 -0
- package/lib/__mocks__/stubs/events.js +166 -0
- package/lib/__mocks__/stubs/events.js.map +1 -0
- package/lib/__mocks__/stubs/location.js +34 -0
- package/lib/__mocks__/stubs/location.js.map +1 -0
- package/lib/__mocks__/stubs/users.js +225 -0
- package/lib/__mocks__/stubs/users.js.map +1 -0
- package/lib/__tests__/components/Pagination/Pagination.test.js +127 -0
- package/lib/__tests__/components/Pagination/Pagination.test.js.map +1 -0
- package/lib/components/Avatar/Avatar-story.js +34 -0
- package/lib/components/Avatar/Avatar-story.js.map +1 -0
- package/lib/components/Avatar/Avatar.d.ts +40 -0
- package/lib/components/Avatar/Avatar.d.ts.map +1 -0
- package/lib/components/Avatar/Avatar.js +91 -0
- package/lib/components/Avatar/Avatar.js.map +1 -0
- package/lib/components/Avatar/UserAvatar.js +45 -0
- package/lib/components/Avatar/UserAvatar.js.map +1 -0
- package/lib/components/BotText/BotText-story.d.ts +2 -0
- package/lib/components/BotText/BotText-story.d.ts.map +1 -0
- package/lib/components/BotText/BotText-story.js +21 -0
- package/lib/components/BotText/BotText-story.js.map +1 -0
- package/lib/components/BotText/BotText.d.ts +12 -0
- package/lib/components/BotText/BotText.d.ts.map +1 -0
- package/lib/components/BotText/BotText.js +52 -0
- package/lib/components/BotText/BotText.js.map +1 -0
- package/lib/components/Button/Button-story.js +109 -0
- package/lib/components/Button/Button-story.js.map +1 -0
- package/lib/components/Button/Button.d.ts +47 -0
- package/lib/components/Button/Button.d.ts.map +1 -0
- package/lib/components/Button/Button.js +155 -0
- package/lib/components/Button/Button.js.map +1 -0
- package/lib/components/ButtonGroup/ButtonGroup-story.js +27 -0
- package/lib/components/ButtonGroup/ButtonGroup-story.js.map +1 -0
- package/lib/components/ButtonGroup/ButtonGroup.d.ts +19 -0
- package/lib/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
- package/lib/components/ButtonGroup/ButtonGroup.js +64 -0
- package/lib/components/ButtonGroup/ButtonGroup.js.map +1 -0
- package/lib/components/Card/Card-story.d.ts +2 -0
- package/lib/components/Card/Card-story.d.ts.map +1 -0
- package/lib/components/Card/Card-story.js +389 -0
- package/lib/components/Card/Card-story.js.map +1 -0
- package/lib/components/Card/Card.d.ts +69 -0
- package/lib/components/Card/Card.d.ts.map +1 -0
- package/lib/components/Card/Card.js +113 -0
- package/lib/components/Card/Card.js.map +1 -0
- package/lib/components/Card/components/CardBody.d.ts +27 -0
- package/lib/components/Card/components/CardBody.d.ts.map +1 -0
- package/lib/components/Card/components/CardBody.js +45 -0
- package/lib/components/Card/components/CardBody.js.map +1 -0
- package/lib/components/Card/components/CardBuilder.d.ts +50 -0
- package/lib/components/Card/components/CardBuilder.d.ts.map +1 -0
- package/lib/components/Card/components/CardBuilder.js +139 -0
- package/lib/components/Card/components/CardBuilder.js.map +1 -0
- package/lib/components/Card/components/CardFooter.d.ts +11 -0
- package/lib/components/Card/components/CardFooter.d.ts.map +1 -0
- package/lib/components/Card/components/CardFooter.js +22 -0
- package/lib/components/Card/components/CardFooter.js.map +1 -0
- package/lib/components/Card/components/CardHeader.d.ts +28 -0
- package/lib/components/Card/components/CardHeader.d.ts.map +1 -0
- package/lib/components/Card/components/CardHeader.js +70 -0
- package/lib/components/Card/components/CardHeader.js.map +1 -0
- package/lib/components/Card/components/CardSection.d.ts +10 -0
- package/lib/components/Card/components/CardSection.d.ts.map +1 -0
- package/lib/components/Card/components/CardSection.js +27 -0
- package/lib/components/Card/components/CardSection.js.map +1 -0
- package/lib/components/Card/components/OnboardingCard.d.ts +27 -0
- package/lib/components/Card/components/OnboardingCard.d.ts.map +1 -0
- package/lib/components/Card/components/OnboardingCard.js +129 -0
- package/lib/components/Card/components/OnboardingCard.js.map +1 -0
- package/lib/components/Card/components/Scores.d.ts +15 -0
- package/lib/components/Card/components/Scores.d.ts.map +1 -0
- package/lib/components/Card/components/Scores.js +39 -0
- package/lib/components/Card/components/Scores.js.map +1 -0
- package/lib/components/Card/index.d.ts +11 -0
- package/lib/components/Card/index.d.ts.map +1 -0
- package/lib/components/Card/index.js +120 -0
- package/lib/components/Card/index.js.map +1 -0
- package/lib/components/CircleLoader/CircleLoader-story.d.ts +2 -0
- package/lib/components/CircleLoader/CircleLoader-story.d.ts.map +1 -0
- package/lib/components/CircleLoader/CircleLoader-story.js +20 -0
- package/lib/components/CircleLoader/CircleLoader-story.js.map +1 -0
- package/lib/components/CircleLoader/CircleLoader.d.ts +13 -0
- package/lib/components/CircleLoader/CircleLoader.d.ts.map +1 -0
- package/lib/components/CircleLoader/CircleLoader.js +28 -0
- package/lib/components/CircleLoader/CircleLoader.js.map +1 -0
- package/lib/components/ContextMenu/ContextMenu-story.js +31 -0
- package/lib/components/ContextMenu/ContextMenu-story.js.map +1 -0
- package/lib/components/ContextMenu/ContextMenu.d.ts +70 -0
- package/lib/components/ContextMenu/ContextMenu.d.ts.map +1 -0
- package/lib/components/ContextMenu/ContextMenu.js +315 -0
- package/lib/components/ContextMenu/ContextMenu.js.map +1 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder-story.js +101 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder-story.js.map +1 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder.js +290 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/FooterPrimary.js +20 -0
- package/lib/components/Core/components/FooterPrimary/FooterPrimary.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/components/HelpButton/HelpButton.js +52 -0
- package/lib/components/Core/components/FooterPrimary/components/HelpButton/HelpButton.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/components/Legal/Legal.js +38 -0
- package/lib/components/Core/components/FooterPrimary/components/Legal/Legal.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/index.js +30 -0
- package/lib/components/Core/components/FooterPrimary/index.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary-story.js +134 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary-story.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary.js +238 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/DefaultLockup/DefaultLockup.js +32 -0
- package/lib/components/Core/components/HeaderPrimary/components/DefaultLockup/DefaultLockup.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/Hamburger/Hamburger.js +58 -0
- package/lib/components/Core/components/HeaderPrimary/components/Hamburger/Hamburger.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/LocationMenu/LocationMenu.js +169 -0
- package/lib/components/Core/components/HeaderPrimary/components/LocationMenu/LocationMenu.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/UserMenu/UserMenu.js +56 -0
- package/lib/components/Core/components/HeaderPrimary/components/UserMenu/UserMenu.js.map +1 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary-story.js +26 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary-story.js.map +1 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary.js +46 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary.js.map +1 -0
- package/lib/components/Core/components/SaveBar/SaveBar-story.js +68 -0
- package/lib/components/Core/components/SaveBar/SaveBar-story.js.map +1 -0
- package/lib/components/Core/components/SaveBar/SaveBar.js +127 -0
- package/lib/components/Core/components/SaveBar/SaveBar.js.map +1 -0
- package/lib/components/Core/components/Sidebar/Sidebar-story.js +204 -0
- package/lib/components/Core/components/Sidebar/Sidebar-story.js.map +1 -0
- package/lib/components/Core/components/Sidebar/Sidebar.js +87 -0
- package/lib/components/Core/components/Sidebar/Sidebar.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarExpander/SidebarExpander.js +48 -0
- package/lib/components/Core/components/Sidebar/components/SidebarExpander/SidebarExpander.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarFooter/SidebarFooter.js +25 -0
- package/lib/components/Core/components/Sidebar/components/SidebarFooter/SidebarFooter.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.d.ts +12 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.d.ts.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.js +47 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarItem/SidebarItem.js +115 -0
- package/lib/components/Core/components/Sidebar/components/SidebarItem/SidebarItem.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarSection/SidebarSection.js +38 -0
- package/lib/components/Core/components/Sidebar/components/SidebarSection/SidebarSection.js.map +1 -0
- package/lib/components/Core/index.js +80 -0
- package/lib/components/Core/index.js.map +1 -0
- package/lib/components/Dropzone/Dropzone-story.js +119 -0
- package/lib/components/Dropzone/Dropzone-story.js.map +1 -0
- package/lib/components/Dropzone/Dropzone.js +317 -0
- package/lib/components/Dropzone/Dropzone.js.map +1 -0
- package/lib/components/EmptyState/EmptyState-story.d.ts +2 -0
- package/lib/components/EmptyState/EmptyState-story.d.ts.map +1 -0
- package/lib/components/EmptyState/EmptyState-story.js +60 -0
- package/lib/components/EmptyState/EmptyState-story.js.map +1 -0
- package/lib/components/EmptyState/EmptyState.d.ts +28 -0
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/lib/components/EmptyState/EmptyState.js +54 -0
- package/lib/components/EmptyState/EmptyState.js.map +1 -0
- package/lib/components/EventDetails/EventDetails-story.d.ts +2 -0
- package/lib/components/EventDetails/EventDetails-story.d.ts.map +1 -0
- package/lib/components/EventDetails/EventDetails-story.js +112 -0
- package/lib/components/EventDetails/EventDetails-story.js.map +1 -0
- package/lib/components/EventDetails/EventDetails.d.ts +18 -0
- package/lib/components/EventDetails/EventDetails.d.ts.map +1 -0
- package/lib/components/EventDetails/EventDetails.js +75 -0
- package/lib/components/EventDetails/EventDetails.js.map +1 -0
- package/lib/components/EventDetails/EventDetailsUtilities.d.ts +11 -0
- package/lib/components/EventDetails/EventDetailsUtilities.d.ts.map +1 -0
- package/lib/components/EventDetails/EventDetailsUtilities.js +56 -0
- package/lib/components/EventDetails/EventDetailsUtilities.js.map +1 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.d.ts +18 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.d.ts.map +1 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.js +111 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.js.map +1 -0
- package/lib/components/EventDetails/eventDetailsMock.d.ts +10 -0
- package/lib/components/EventDetails/eventDetailsMock.d.ts.map +1 -0
- package/lib/components/EventDetails/eventDetailsMock.js +840 -0
- package/lib/components/EventDetails/eventDetailsMock.js.map +1 -0
- package/lib/components/FontLoader/FontLoader-story.js +16 -0
- package/lib/components/FontLoader/FontLoader-story.js.map +1 -0
- package/lib/components/FontLoader/FontLoader.js +148 -0
- package/lib/components/FontLoader/FontLoader.js.map +1 -0
- package/lib/components/Forms/FormPartials.js +70 -0
- package/lib/components/Forms/FormPartials.js.map +1 -0
- package/lib/components/Forms/Forms-story.js +297 -0
- package/lib/components/Forms/Forms-story.js.map +1 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.d.ts +71 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.d.ts.map +1 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.js +372 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.js.map +1 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.d.ts +23 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.js +162 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.js.map +1 -0
- package/lib/components/Forms/components/DatePicker/DatePicker.js +236 -0
- package/lib/components/Forms/components/DatePicker/DatePicker.js.map +1 -0
- package/lib/components/Forms/components/DomainInput/DomainInput.js +29 -0
- package/lib/components/Forms/components/DomainInput/DomainInput.js.map +1 -0
- package/lib/components/Forms/components/DurationInput/DurationInput.js +270 -0
- package/lib/components/Forms/components/DurationInput/DurationInput.js.map +1 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder-story.js +357 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder-story.js.map +1 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder.js +121 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder.js.map +1 -0
- package/lib/components/Forms/components/FormBuilder/components/FormInner/FormInner.js +201 -0
- package/lib/components/Forms/components/FormBuilder/components/FormInner/FormInner.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/FormLayout.js +35 -0
- package/lib/components/Forms/components/FormLayout/FormLayout.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutGroup/FormLayoutGroup.js +30 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutItem/FormLayoutItem.js +32 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutItem/FormLayoutItem.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/index.js +32 -0
- package/lib/components/Forms/components/FormLayout/index.js.map +1 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.d.ts +30 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.d.ts.map +1 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.js +119 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.js.map +1 -0
- package/lib/components/Forms/components/Radio/Radio.d.ts +15 -0
- package/lib/components/Forms/components/Radio/Radio.d.ts.map +1 -0
- package/lib/components/Forms/components/Radio/Radio.js +92 -0
- package/lib/components/Forms/components/Radio/Radio.js.map +1 -0
- package/lib/components/Forms/components/Search/Search.js +96 -0
- package/lib/components/Forms/components/Search/Search.js.map +1 -0
- package/lib/components/Forms/components/Select/Select.js +95 -0
- package/lib/components/Forms/components/Select/Select.js.map +1 -0
- package/lib/components/Forms/components/Slider/Slider.js +100 -0
- package/lib/components/Forms/components/Slider/Slider.js.map +1 -0
- package/lib/components/Forms/components/Stars/Stars.js +101 -0
- package/lib/components/Forms/components/Stars/Stars.js.map +1 -0
- package/lib/components/Forms/components/Tag/Tag.js +60 -0
- package/lib/components/Forms/components/Tag/Tag.js.map +1 -0
- package/lib/components/Forms/components/TextArea/TextArea.js +55 -0
- package/lib/components/Forms/components/TextArea/TextArea.js.map +1 -0
- package/lib/components/Forms/components/TextInput/TextInput.d.ts +28 -0
- package/lib/components/Forms/components/TextInput/TextInput.d.ts.map +1 -0
- package/lib/components/Forms/components/TextInput/TextInput.js +57 -0
- package/lib/components/Forms/components/TextInput/TextInput.js.map +1 -0
- package/lib/components/Forms/components/Toggle/Toggle.d.ts +9 -0
- package/lib/components/Forms/components/Toggle/Toggle.d.ts.map +1 -0
- package/lib/components/Forms/components/Toggle/Toggle.js +43 -0
- package/lib/components/Forms/components/Toggle/Toggle.js.map +1 -0
- package/lib/components/Forms/index.d.ts +18 -0
- package/lib/components/Forms/index.d.ts.map +1 -0
- package/lib/components/Forms/index.js +182 -0
- package/lib/components/Forms/index.js.map +1 -0
- package/lib/components/Heading/Heading-story.js +18 -0
- package/lib/components/Heading/Heading-story.js.map +1 -0
- package/lib/components/Heading/Heading.d.ts +13 -0
- package/lib/components/Heading/Heading.d.ts.map +1 -0
- package/lib/components/Heading/Heading.js +32 -0
- package/lib/components/Heading/Heading.js.map +1 -0
- package/lib/components/Icon/Icon-story.d.ts +2 -0
- package/lib/components/Icon/Icon-story.d.ts.map +1 -0
- package/lib/components/Icon/Icon-story.js +44 -0
- package/lib/components/Icon/Icon-story.js.map +1 -0
- package/lib/components/Icon/Icon.d.ts +13 -0
- package/lib/components/Icon/Icon.d.ts.map +1 -0
- package/lib/components/Icon/Icon.js +52 -0
- package/lib/components/Icon/Icon.js.map +1 -0
- package/lib/components/Image/Image.d.ts +11 -0
- package/lib/components/Image/Image.d.ts.map +1 -0
- package/lib/components/Image/Image.js +32 -0
- package/lib/components/Image/Image.js.map +1 -0
- package/lib/components/ImageCropper/ImageCropper-story.js +219 -0
- package/lib/components/ImageCropper/ImageCropper-story.js.map +1 -0
- package/lib/components/ImageCropper/ImageCropper.js +256 -0
- package/lib/components/ImageCropper/ImageCropper.js.map +1 -0
- package/lib/components/ImageSSR/ImageSSR.js +32 -0
- package/lib/components/ImageSSR/ImageSSR.js.map +1 -0
- package/lib/components/Layout/Layout-story.js +128 -0
- package/lib/components/Layout/Layout-story.js.map +1 -0
- package/lib/components/Layout/Layout.js +43 -0
- package/lib/components/Layout/Layout.js.map +1 -0
- package/lib/components/Layout/components/LayoutSection/LayoutSection.js +38 -0
- package/lib/components/Layout/components/LayoutSection/LayoutSection.js.map +1 -0
- package/lib/components/Layout/index.js +24 -0
- package/lib/components/Layout/index.js.map +1 -0
- package/lib/components/List/List-story.d.ts +2 -0
- package/lib/components/List/List-story.d.ts.map +1 -0
- package/lib/components/List/List-story.js +241 -0
- package/lib/components/List/List-story.js.map +1 -0
- package/lib/components/List/List.d.ts +34 -0
- package/lib/components/List/List.d.ts.map +1 -0
- package/lib/components/List/List.js +83 -0
- package/lib/components/List/List.js.map +1 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.d.ts +27 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.d.ts.map +1 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.js +93 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.js.map +1 -0
- package/lib/components/List/components/ListHeader/ListHeader.d.ts +16 -0
- package/lib/components/List/components/ListHeader/ListHeader.d.ts.map +1 -0
- package/lib/components/List/components/ListHeader/ListHeader.js +51 -0
- package/lib/components/List/components/ListHeader/ListHeader.js.map +1 -0
- package/lib/components/List/components/ListItem/ListItem.d.ts +67 -0
- package/lib/components/List/components/ListItem/ListItem.d.ts.map +1 -0
- package/lib/components/List/components/ListItem/ListItem.js +206 -0
- package/lib/components/List/components/ListItem/ListItem.js.map +1 -0
- package/lib/components/List/components/SortableList/SortableList.d.ts +35 -0
- package/lib/components/List/components/SortableList/SortableList.d.ts.map +1 -0
- package/lib/components/List/components/SortableList/SortableList.js +180 -0
- package/lib/components/List/components/SortableList/SortableList.js.map +1 -0
- package/lib/components/List/index.d.ts +6 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +74 -0
- package/lib/components/List/index.js.map +1 -0
- package/lib/components/Loader/Loader-story.js +30 -0
- package/lib/components/Loader/Loader-story.js.map +1 -0
- package/lib/components/Loader/Loader.js +36 -0
- package/lib/components/Loader/Loader.js.map +1 -0
- package/lib/components/Loader/Loader.test.js +17 -0
- package/lib/components/Loader/Loader.test.js.map +1 -0
- package/lib/components/MarkdownText/MarkdownText.d.ts +8 -0
- package/lib/components/MarkdownText/MarkdownText.d.ts.map +1 -0
- package/lib/components/MarkdownText/MarkdownText.js +26 -0
- package/lib/components/MarkdownText/MarkdownText.js.map +1 -0
- package/lib/components/Message/Message-story.js +135 -0
- package/lib/components/Message/Message-story.js.map +1 -0
- package/lib/components/Message/Message.js +147 -0
- package/lib/components/Message/Message.js.map +1 -0
- package/lib/components/Message/components/MessageBuilder.js +132 -0
- package/lib/components/Message/components/MessageBuilder.js.map +1 -0
- package/lib/components/Message/index.js +24 -0
- package/lib/components/Message/index.js.map +1 -0
- package/lib/components/Modal/Modal-story.js +239 -0
- package/lib/components/Modal/Modal-story.js.map +1 -0
- package/lib/components/Modal/Modal.js +86 -0
- package/lib/components/Modal/Modal.js.map +1 -0
- package/lib/components/Modal/components/ModalBody/ModalBody.js +30 -0
- package/lib/components/Modal/components/ModalBody/ModalBody.js.map +1 -0
- package/lib/components/Modal/components/ModalFooter/ModalFooter.js +31 -0
- package/lib/components/Modal/components/ModalFooter/ModalFooter.js.map +1 -0
- package/lib/components/Modal/components/ModalHeader/ModalHeader.js +84 -0
- package/lib/components/Modal/components/ModalHeader/ModalHeader.js.map +1 -0
- package/lib/components/Page/Page-story.js +115 -0
- package/lib/components/Page/Page-story.js.map +1 -0
- package/lib/components/Page/Page.js +55 -0
- package/lib/components/Page/Page.js.map +1 -0
- package/lib/components/Page/components/PageContent/PageContent.js +22 -0
- package/lib/components/Page/components/PageContent/PageContent.js.map +1 -0
- package/lib/components/Page/components/PageHeader/PageHeader.js +127 -0
- package/lib/components/Page/components/PageHeader/PageHeader.js.map +1 -0
- package/lib/components/Page/index.js +32 -0
- package/lib/components/Page/index.js.map +1 -0
- package/lib/components/PagedModal/PagedModal-story.js +121 -0
- package/lib/components/PagedModal/PagedModal-story.js.map +1 -0
- package/lib/components/PagedModal/PagedModal.js +84 -0
- package/lib/components/PagedModal/PagedModal.js.map +1 -0
- package/lib/components/Pagination/Pagination-story.js +35 -0
- package/lib/components/Pagination/Pagination-story.js.map +1 -0
- package/lib/components/Pagination/Pagination.js +157 -0
- package/lib/components/Pagination/Pagination.js.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectList-story.js +491 -0
- package/lib/components/RecordSelectionList/RecordSelectList-story.js.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.d.ts +112 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.d.ts.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.js +702 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.js.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.d.ts +5 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.d.ts.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.js +20 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.js.map +1 -0
- package/lib/components/RecordTable/RecordTable-story.d.ts +2 -0
- package/lib/components/RecordTable/RecordTable-story.d.ts.map +1 -0
- package/lib/components/RecordTable/RecordTable-story.js +242 -0
- package/lib/components/RecordTable/RecordTable-story.js.map +1 -0
- package/lib/components/RecordTable/RecordTable.d.ts +133 -0
- package/lib/components/RecordTable/RecordTable.d.ts.map +1 -0
- package/lib/components/RecordTable/RecordTable.js +523 -0
- package/lib/components/RecordTable/RecordTable.js.map +1 -0
- package/lib/components/SplitButton/SplitButton-story.js +60 -0
- package/lib/components/SplitButton/SplitButton-story.js.map +1 -0
- package/lib/components/SplitButton/SplitButton.d.ts +47 -0
- package/lib/components/SplitButton/SplitButton.d.ts.map +1 -0
- package/lib/components/SplitButton/SplitButton.js +296 -0
- package/lib/components/SplitButton/SplitButton.js.map +1 -0
- package/lib/components/Subheading/Subheading-story.js +18 -0
- package/lib/components/Subheading/Subheading-story.js.map +1 -0
- package/lib/components/Subheading/Subheading.js +40 -0
- package/lib/components/Subheading/Subheading.js.map +1 -0
- package/lib/components/Table/Table-story.js +428 -0
- package/lib/components/Table/Table-story.js.map +1 -0
- package/lib/components/Table/Table.d.ts +63 -0
- package/lib/components/Table/Table.d.ts.map +1 -0
- package/lib/components/Table/Table.js +395 -0
- package/lib/components/Table/Table.js.map +1 -0
- package/lib/components/Table/components/TableFilters/TableFilters.js +31 -0
- package/lib/components/Table/components/TableFilters/TableFilters.js.map +1 -0
- package/lib/components/Table/components/TableSearch/TableSearch.d.ts +7 -0
- package/lib/components/Table/components/TableSearch/TableSearch.d.ts.map +1 -0
- package/lib/components/Table/components/TableSearch/TableSearch.js +30 -0
- package/lib/components/Table/components/TableSearch/TableSearch.js.map +1 -0
- package/lib/components/Table/index.d.ts +4 -0
- package/lib/components/Table/index.d.ts.map +1 -0
- package/lib/components/Table/index.js +40 -0
- package/lib/components/Table/index.js.map +1 -0
- package/lib/components/Tabs/Tabs-story.d.ts +2 -0
- package/lib/components/Tabs/Tabs-story.d.ts.map +1 -0
- package/lib/components/Tabs/Tabs-story.js +36 -0
- package/lib/components/Tabs/Tabs-story.js.map +1 -0
- package/lib/components/Tabs/Tabs.d.ts +40 -0
- package/lib/components/Tabs/Tabs.d.ts.map +1 -0
- package/lib/components/Tabs/Tabs.js +244 -0
- package/lib/components/Tabs/Tabs.js.map +1 -0
- package/lib/components/Tabs/components/Tab/Tab.d.ts +26 -0
- package/lib/components/Tabs/components/Tab/Tab.d.ts.map +1 -0
- package/lib/components/Tabs/components/Tab/Tab.js +46 -0
- package/lib/components/Tabs/components/Tab/Tab.js.map +1 -0
- package/lib/components/Text/Text-story.d.ts +2 -0
- package/lib/components/Text/Text-story.d.ts.map +1 -0
- package/lib/components/Text/Text-story.js +51 -0
- package/lib/components/Text/Text-story.js.map +1 -0
- package/lib/components/Text/Text.d.ts +18 -0
- package/lib/components/Text/Text.d.ts.map +1 -0
- package/lib/components/Text/Text.js +123 -0
- package/lib/components/Text/Text.js.map +1 -0
- package/lib/components/TextContainer/TextContainer-story.js +32 -0
- package/lib/components/TextContainer/TextContainer-story.js.map +1 -0
- package/lib/components/TextContainer/TextContainer.js +33 -0
- package/lib/components/TextContainer/TextContainer.js.map +1 -0
- package/lib/components/TextStyle/TextStyle-story.js +28 -0
- package/lib/components/TextStyle/TextStyle-story.js.map +1 -0
- package/lib/components/TextStyle/TextStyle.js +41 -0
- package/lib/components/TextStyle/TextStyle.js.map +1 -0
- package/lib/components/Toast/Toast-story.d.ts +2 -0
- package/lib/components/Toast/Toast-story.d.ts.map +1 -0
- package/lib/components/Toast/Toast-story.js +210 -0
- package/lib/components/Toast/Toast-story.js.map +1 -0
- package/lib/components/Toast/Toast.d.ts +24 -0
- package/lib/components/Toast/Toast.d.ts.map +1 -0
- package/lib/components/Toast/Toast.js +76 -0
- package/lib/components/Toast/Toast.js.map +1 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.d.ts +24 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.d.ts.map +1 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.js +131 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.js.map +1 -0
- package/lib/components/TruncatedList/TruncatedList-story.js +222 -0
- package/lib/components/TruncatedList/TruncatedList-story.js.map +1 -0
- package/lib/components/TruncatedList/TruncatedList.d.ts +49 -0
- package/lib/components/TruncatedList/TruncatedList.d.ts.map +1 -0
- package/lib/components/TruncatedList/TruncatedList.js +188 -0
- package/lib/components/TruncatedList/TruncatedList.js.map +1 -0
- package/lib/components/View/View-story.js +485 -0
- package/lib/components/View/View-story.js.map +1 -0
- package/lib/components/View/View.d.ts +26 -0
- package/lib/components/View/View.d.ts.map +1 -0
- package/lib/components/View/View.js +91 -0
- package/lib/components/View/View.js.map +1 -0
- package/lib/components/_utilities/Anchor.js +28 -0
- package/lib/components/_utilities/Anchor.js.map +1 -0
- package/lib/custom-types.d.js +2 -0
- package/lib/custom-types.d.js.map +1 -0
- package/lib/icons.js +3328 -0
- package/lib/icons.js.map +1 -0
- package/lib/index.d.ts +46 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +707 -0
- package/lib/index.js.map +1 -0
- package/lib/stubs/events.js +166 -0
- package/lib/stubs/events.js.map +1 -0
- package/lib/stubs/location.js +34 -0
- package/lib/stubs/location.js.map +1 -0
- package/lib/stubs/users.js +225 -0
- package/lib/stubs/users.js.map +1 -0
- package/lib/utilities.js +23 -0
- package/lib/utilities.js.map +1 -0
- package/package.json +174 -0
- package/static/android-chrome-192x192.png +0 -0
- package/static/android-chrome-256x256.png +0 -0
- package/static/apple-touch-icon.png +0 -0
- package/static/assets/bg.jpeg +0 -0
- package/static/assets/icons/Design/Rotate/rotate-back.svg +9 -0
- package/static/assets/icons/Design/Rotate/rotate-forward.svg +9 -0
- package/static/assets/icons/Interface-Essential/Alerts/alert-triangle--16w.svg +3 -0
- package/static/assets/icons/Interface-Essential/Alerts/alert-triangle--56w.svg +5 -0
- package/static/assets/icons/Interface-Essential/Alerts/alert-triangle.svg +3 -0
- package/static/assets/icons/Interface-Essential/Dashboard/gauge-dashboard-1.svg +11 -0
- package/static/assets/icons/Interface-Essential/Date/Calendar/calendar-3.svg +12 -0
- package/static/assets/icons/Interface-Essential/Date/Calendar/calendar-date.svg +9 -0
- package/static/assets/icons/Interface-Essential/Delete/bin.svg +7 -0
- package/static/assets/icons/Interface-Essential/Edit/pencil-write.svg +5 -0
- package/static/assets/icons/Interface-Essential/Form-Edition/paper-write.svg +8 -0
- package/static/assets/icons/Interface-Essential/Form-Validation/check-circle-1.svg +4 -0
- package/static/assets/icons/Interface-Essential/Help/question-help-square--16w.svg +5 -0
- package/static/assets/icons/Interface-Essential/Help/question-help-square.svg +5 -0
- package/static/assets/icons/Interface-Essential/Home/house-1--16w.svg +4 -0
- package/static/assets/icons/Interface-Essential/Home/house-1.svg +4 -0
- package/static/assets/icons/Interface-Essential/Lists/list-bullets-1.svg +8 -0
- package/static/assets/icons/Interface-Essential/Lock/Unlock/Lock/Unlock-4.svg +5 -0
- package/static/assets/icons/Interface-Essential/Lock/Unlock/lock-6--16w.svg +3 -0
- package/static/assets/icons/Interface-Essential/Lock/Unlock/lock-6.svg +5 -0
- package/static/assets/icons/Interface-Essential/Login/Logout/logout.svg +5 -0
- package/static/assets/icons/Interface-Essential/Menu/navigation-menu-horizontal.svg +5 -0
- package/static/assets/icons/Interface-Essential/Select/cursor-select-4.svg +14 -0
- package/static/assets/icons/Interface-Essential/Time/stopwatch.svg +8 -0
- package/static/assets/icons/Interface-Essential/Time-Files/time-clock-file-check.svg +7 -0
- package/static/assets/icons/Interface-Essential/Time-Files/time-clock-file-upload.svg +9 -0
- package/static/assets/icons/Maps-Navigation/Pins/pin-2.svg +4 -0
- package/static/assets/icons/Maps-Navigation/Pins/pin.svg +4 -0
- package/static/assets/icons/Messages-Chat-Smileys/Conversation/conversation-text--16w.svg +8 -0
- package/static/assets/icons/Messages-Chat-Smileys/Conversation/conversation-text.svg +8 -0
- package/static/assets/icons/Messages-Chat-Smileys/Messages-Speech-Bubbles/messages-bubble-square-text.svg +5 -0
- package/static/assets/icons/Phones-Mobile-Devices/Phone/phone-retro-1.svg +7 -0
- package/static/assets/icons/Programming-Apps-Websites/Plugins/Modules/module-puzzle.svg +3 -0
- package/static/assets/icons/Shopping-E-Commerce/Shops/shop-1--56w.svg +6 -0
- package/static/assets/icons/Shopping-E-Commerce/Shops/shop-1.svg +7 -0
- package/static/assets/icons/Social-Medias-Rewards-Rating/Rating/rating-star-1-1.svg +3 -0
- package/static/assets/icons/Social-Medias-Rewards-Rating/Rating/rating-star-1.svg +3 -0
- package/static/assets/icons/Transportation/Aircraft/aircraft-military-plane.svg +18 -0
- package/static/assets/icons/Users/Geometric-Close-Up-Single-User-Actions-Neutral/single-neutral-actions-image--56w.svg +7 -0
- package/static/assets/icons/Users/Geometric-Close-Up-Single-User-Actions-Neutral/single-neutral-actions-up-down.svg +8 -0
- package/static/assets/icons/Users/Geometric-Close-Up-Single-User-Neutral/single-neutral-id-card-3.svg +8 -0
- package/static/assets/icons/Users/Geometric-Full-Body-Multiple-Users/multiple-users-1.svg +8 -0
- package/static/assets/icons/Work-Office-Companies/Human-Resources/human-resources-search-team--16w.svg +8 -0
- package/static/assets/icons/Work-Office-Companies/Human-Resources/human-resources-search-team.svg +8 -0
- package/static/assets/icons/ic_add.svg +5 -0
- package/static/assets/icons/ic_add_circle_outline.svg +3 -0
- package/static/assets/icons/ic_arrow_back.svg +3 -0
- package/static/assets/icons/ic_arrow_drop_down.svg +3 -0
- package/static/assets/icons/ic_arrow_forward.svg +3 -0
- package/static/assets/icons/ic_button.svg +3 -0
- package/static/assets/icons/ic_calendar.svg +12 -0
- package/static/assets/icons/ic_cancel.svg +8 -0
- package/static/assets/icons/ic_caution.svg +3 -0
- package/static/assets/icons/ic_caution_light_large.svg +5 -0
- package/static/assets/icons/ic_check_box.svg +3 -0
- package/static/assets/icons/ic_check_box_outline_blank.svg +3 -0
- package/static/assets/icons/ic_check_circle.svg +3 -0
- package/static/assets/icons/ic_close.svg +3 -0
- package/static/assets/icons/ic_colors.svg +8 -0
- package/static/assets/icons/ic_complete.svg +4 -0
- package/static/assets/icons/ic_css.svg +7 -0
- package/static/assets/icons/ic_dashboard.svg +11 -0
- package/static/assets/icons/ic_date.svg +9 -0
- package/static/assets/icons/ic_date_disable.svg +8 -0
- package/static/assets/icons/ic_delete.svg +7 -0
- package/static/assets/icons/ic_disable.svg +3 -0
- package/static/assets/icons/ic_drag_handle.svg +3 -0
- package/static/assets/icons/ic_drop_light_large.svg +14 -0
- package/static/assets/icons/ic_edit.svg +5 -0
- package/static/assets/icons/ic_email.svg +6 -0
- package/static/assets/icons/ic_fonts.svg +6 -0
- package/static/assets/icons/ic_fullscreen.svg +3 -0
- package/static/assets/icons/ic_fullscreen_exit.svg +3 -0
- package/static/assets/icons/ic_guests.svg +8 -0
- package/static/assets/icons/ic_help.svg +5 -0
- package/static/assets/icons/ic_home.svg +4 -0
- package/static/assets/icons/ic_indeterminate_check_box.svg +3 -0
- package/static/assets/icons/ic_keyboard_arrow_left.svg +3 -0
- package/static/assets/icons/ic_keyboard_arrow_right.svg +3 -0
- package/static/assets/icons/ic_late.svg +5 -0
- package/static/assets/icons/ic_launch.svg +18 -0
- package/static/assets/icons/ic_location.svg +4 -0
- package/static/assets/icons/ic_logout.svg +5 -0
- package/static/assets/icons/ic_menu.svg +3 -0
- package/static/assets/icons/ic_message.svg +5 -0
- package/static/assets/icons/ic_message_failed.svg +7 -0
- package/static/assets/icons/ic_messages.svg +8 -0
- package/static/assets/icons/ic_more.svg +5 -0
- package/static/assets/icons/ic_new_tab.svg +3 -0
- package/static/assets/icons/ic_note.svg +8 -0
- package/static/assets/icons/ic_payment_failed_solid.svg +5 -0
- package/static/assets/icons/ic_payment_success_solid.svg +5 -0
- package/static/assets/icons/ic_phone.svg +7 -0
- package/static/assets/icons/ic_pin.svg +4 -0
- package/static/assets/icons/ic_pin_outline.svg +4 -0
- package/static/assets/icons/ic_power.svg +4 -0
- package/static/assets/icons/ic_private.svg +5 -0
- package/static/assets/icons/ic_profile_image_light_large.svg +7 -0
- package/static/assets/icons/ic_public.svg +5 -0
- package/static/assets/icons/ic_radio_button_checked.svg +3 -0
- package/static/assets/icons/ic_radio_button_unchecked.svg +3 -0
- package/static/assets/icons/ic_rotate_left.svg +9 -0
- package/static/assets/icons/ic_rotate_right.svg +9 -0
- package/static/assets/icons/ic_search.svg +3 -0
- package/static/assets/icons/ic_settings.svg +4 -0
- package/static/assets/icons/ic_shop_light_large.svg +6 -0
- package/static/assets/icons/ic_show.svg +4 -0
- package/static/assets/icons/ic_skill.svg +3 -0
- package/static/assets/icons/ic_star_outline.svg +3 -0
- package/static/assets/icons/ic_star_solid.svg +3 -0
- package/static/assets/icons/ic_status.svg +8 -0
- package/static/assets/icons/ic_store.svg +7 -0
- package/static/assets/icons/ic_switch_users.svg +8 -0
- package/static/assets/icons/ic_team.svg +8 -0
- package/static/assets/icons/ic_teammates.svg +8 -0
- package/static/assets/icons/ic_unordered_list.svg +8 -0
- package/static/assets/icons/ic_upload.svg +8 -0
- package/static/assets/icons/ic_upload_file_light_large.svg +9 -0
- package/static/assets/icons/ic_upload_file_success_light_large.svg +7 -0
- package/static/assets/icons/ic_user_avatar.svg +3 -0
- package/static/assets/icons/ic_wifi.svg +9 -0
- package/static/assets/icons/s-ic_spruce-logo-02.svg +3 -0
- package/static/assets/icons/s-ic_spruce-logo.svg +3 -0
- package/static/assets/logo.png +0 -0
- package/static/assets/users/user-01--96w.png +0 -0
- package/static/assets/users/user-01.png +0 -0
- package/static/assets/users/user-02--96w.png +0 -0
- package/static/assets/users/user-03--96w.png +0 -0
- package/static/assets/users/user-04--96w.png +0 -0
- package/static/assets/users/user-04.png +0 -0
- package/static/assets/users/user-05--96w.png +0 -0
- package/static/assets/users/user-05.png +0 -0
- package/static/assets/users/user-06--96w.png +0 -0
- package/static/assets/users/user-06.png +0 -0
- package/static/assets/users/user-07--96w.png +0 -0
- package/static/assets/users/user-07.png +0 -0
- package/static/assets/users/user-08--96w.png +0 -0
- package/static/assets/users/user-08.png +0 -0
- package/static/assets/users/user-09--96w.png +0 -0
- package/static/assets/users/user-09.png +0 -0
- package/static/assets/users/user-placeholder--96w.png +0 -0
- package/static/assets/users/user-placeholder.png +0 -0
- package/static/browserconfig.xml +9 -0
- package/static/favicon-16x16.png +0 -0
- package/static/favicon-32x32.png +0 -0
- package/static/favicon.ico +0 -0
- package/static/mstile-150x150.png +0 -0
- package/static/safari-pinned-tab.svg +26 -0
- package/static/site.webmanifest +19 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
+
|
|
18
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
+
|
|
20
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
+
|
|
22
|
+
var _getPrototypeOf4 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
+
|
|
24
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
25
|
+
|
|
26
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
27
|
+
|
|
28
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
+
|
|
30
|
+
var _react = _interopRequireDefault(require("react"));
|
|
31
|
+
|
|
32
|
+
var _index = require("../../../../index");
|
|
33
|
+
|
|
34
|
+
var _List = require("../../../../../List");
|
|
35
|
+
|
|
36
|
+
var _Button = _interopRequireDefault(require("../../../../../Button/Button"));
|
|
37
|
+
|
|
38
|
+
var BooleanField =
|
|
39
|
+
/*#__PURE__*/
|
|
40
|
+
function (_React$PureComponent) {
|
|
41
|
+
(0, _inherits2["default"])(BooleanField, _React$PureComponent);
|
|
42
|
+
|
|
43
|
+
function BooleanField() {
|
|
44
|
+
var _getPrototypeOf2;
|
|
45
|
+
|
|
46
|
+
var _this;
|
|
47
|
+
|
|
48
|
+
(0, _classCallCheck2["default"])(this, BooleanField);
|
|
49
|
+
|
|
50
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
|
+
args[_key] = arguments[_key];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf4["default"])(BooleanField)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
55
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleChange", function (e) {
|
|
56
|
+
var _this$props = _this.props,
|
|
57
|
+
onBlur = _this$props.onBlur,
|
|
58
|
+
name = _this$props.name;
|
|
59
|
+
var setFieldValue = _this.props.formikProps.setFieldValue;
|
|
60
|
+
setFieldValue(name, e.target.checked);
|
|
61
|
+
onBlur(e);
|
|
62
|
+
});
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
(0, _createClass2["default"])(BooleanField, [{
|
|
67
|
+
key: "render",
|
|
68
|
+
value: function render() {
|
|
69
|
+
var _this$props2 = this.props,
|
|
70
|
+
label = _this$props2.label,
|
|
71
|
+
helper = _this$props2.helper,
|
|
72
|
+
value = _this$props2.value,
|
|
73
|
+
rest = (0, _objectWithoutProperties2["default"])(_this$props2, ["label", "helper", "value"]);
|
|
74
|
+
var toggleId = this.props.name || '';
|
|
75
|
+
var toggleProps = (0, _objectSpread2["default"])({}, rest, {
|
|
76
|
+
onChange: this.handleChange
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
if (value) {
|
|
80
|
+
toggleProps.defaultChecked = true;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return _react["default"].createElement(_List.List, {
|
|
84
|
+
items: [{
|
|
85
|
+
title: label,
|
|
86
|
+
subtitle: helper,
|
|
87
|
+
toggleId: toggleId,
|
|
88
|
+
toggleProps: toggleProps
|
|
89
|
+
}]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}]);
|
|
93
|
+
return BooleanField;
|
|
94
|
+
}(_react["default"].PureComponent);
|
|
95
|
+
|
|
96
|
+
var FormInner =
|
|
97
|
+
/*#__PURE__*/
|
|
98
|
+
function (_React$PureComponent2) {
|
|
99
|
+
(0, _inherits2["default"])(FormInner, _React$PureComponent2);
|
|
100
|
+
|
|
101
|
+
function FormInner() {
|
|
102
|
+
var _getPrototypeOf3;
|
|
103
|
+
|
|
104
|
+
var _this2;
|
|
105
|
+
|
|
106
|
+
(0, _classCallCheck2["default"])(this, FormInner);
|
|
107
|
+
|
|
108
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
109
|
+
args[_key2] = arguments[_key2];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
_this2 = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf3 = (0, _getPrototypeOf4["default"])(FormInner)).call.apply(_getPrototypeOf3, [this].concat(args)));
|
|
113
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "handleChange", function (name, type, eOrValue, eOrNull) {
|
|
114
|
+
var value = eOrNull ? eOrValue : eOrValue.target.value;
|
|
115
|
+
var shouldValidate = true;
|
|
116
|
+
|
|
117
|
+
switch (type) {
|
|
118
|
+
case 'boolean':
|
|
119
|
+
value = value === 'on';
|
|
120
|
+
shouldValidate = false; // it can only be valid values
|
|
121
|
+
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
var setFieldValue = _this2.props.formikProps.setFieldValue;
|
|
126
|
+
setFieldValue(name, value, shouldValidate);
|
|
127
|
+
var onChange = _this2.props.onChange;
|
|
128
|
+
onChange && onChange(value, eOrNull || eOrValue);
|
|
129
|
+
});
|
|
130
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "renderChild", function (child) {
|
|
131
|
+
var Elements = {
|
|
132
|
+
text: _index.TextInput,
|
|
133
|
+
"boolean": BooleanField,
|
|
134
|
+
select: _index.Select,
|
|
135
|
+
duration: _index.DurationInput
|
|
136
|
+
};
|
|
137
|
+
var formikProps = _this2.props.formikProps;
|
|
138
|
+
var Handler = child && child.type && Elements[child.type] || _index.TextInput;
|
|
139
|
+
var props = (0, _objectSpread2["default"])({}, child.props, {
|
|
140
|
+
name: child.name,
|
|
141
|
+
formikProps: formikProps
|
|
142
|
+
});
|
|
143
|
+
return !Handler.prototype.render ? Handler(props) : _react["default"].createElement(Handler, props);
|
|
144
|
+
});
|
|
145
|
+
return _this2;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
(0, _createClass2["default"])(FormInner, [{
|
|
149
|
+
key: "render",
|
|
150
|
+
value: function render() {
|
|
151
|
+
var _this3 = this;
|
|
152
|
+
|
|
153
|
+
var _this$props3 = this.props,
|
|
154
|
+
formLayout = _this$props3.formLayout,
|
|
155
|
+
formikProps = _this$props3.formikProps,
|
|
156
|
+
fields = _this$props3.fields,
|
|
157
|
+
primaryCTA = _this$props3.primaryCTA,
|
|
158
|
+
secondaryCTA = _this$props3.secondaryCTA;
|
|
159
|
+
var handleBlur = formikProps.handleBlur,
|
|
160
|
+
values = formikProps.values,
|
|
161
|
+
errors = formikProps.errors,
|
|
162
|
+
touched = formikProps.touched,
|
|
163
|
+
isValid = formikProps.isValid,
|
|
164
|
+
isSubmitting = formikProps.isSubmitting;
|
|
165
|
+
return _react["default"].createElement(_index.FormLayout, formLayout, fields && fields.length > 0 && fields.map(function (field) {
|
|
166
|
+
var type = field.type,
|
|
167
|
+
props = field.props;
|
|
168
|
+
return _react["default"].createElement(_index.FormLayoutItem, {
|
|
169
|
+
key: field.name
|
|
170
|
+
}, _this3.renderChild({
|
|
171
|
+
type: type,
|
|
172
|
+
name: field.name,
|
|
173
|
+
props: (0, _objectSpread2["default"])({}, props, {
|
|
174
|
+
onChange: function onChange(eOrValue, eOrNull) {
|
|
175
|
+
_this3.handleChange(field.name, field.type, eOrValue, eOrNull);
|
|
176
|
+
},
|
|
177
|
+
onBlur: handleBlur,
|
|
178
|
+
value: values ? values[field.name] : '',
|
|
179
|
+
error: touched[field.name] && errors[field.name]
|
|
180
|
+
})
|
|
181
|
+
}));
|
|
182
|
+
}), primaryCTA && _react["default"].createElement(_index.FormLayoutGroup, null, secondaryCTA && _react["default"].createElement(_index.FormLayoutItem, null, _react["default"].createElement(_Button["default"], (0, _extends2["default"])({
|
|
183
|
+
disabled: isSubmitting
|
|
184
|
+
}, secondaryCTA))), _react["default"].createElement(_index.FormLayoutItem, null, _react["default"].createElement(_Button["default"], (0, _extends2["default"])({
|
|
185
|
+
kind: "primary",
|
|
186
|
+
type: "submit",
|
|
187
|
+
disabled: !isValid || isSubmitting,
|
|
188
|
+
isLoading: isSubmitting
|
|
189
|
+
}, primaryCTA)))));
|
|
190
|
+
}
|
|
191
|
+
}]);
|
|
192
|
+
return FormInner;
|
|
193
|
+
}(_react["default"].PureComponent);
|
|
194
|
+
|
|
195
|
+
(0, _defineProperty2["default"])(FormInner, "defaultProps", {
|
|
196
|
+
primaryCTA: null,
|
|
197
|
+
secondaryCTA: null
|
|
198
|
+
});
|
|
199
|
+
var _default = FormInner;
|
|
200
|
+
exports["default"] = _default;
|
|
201
|
+
//# sourceMappingURL=FormInner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/components/Forms/components/FormBuilder/components/FormInner/FormInner.js"],"names":["BooleanField","e","props","onBlur","name","setFieldValue","formikProps","target","checked","label","helper","value","rest","toggleId","toggleProps","onChange","handleChange","defaultChecked","title","subtitle","React","PureComponent","FormInner","type","eOrValue","eOrNull","shouldValidate","child","Elements","text","TextInput","select","Select","duration","DurationInput","Handler","prototype","render","formLayout","fields","primaryCTA","secondaryCTA","handleBlur","values","errors","touched","isValid","isSubmitting","length","map","field","renderChild","error"],"mappings":"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","sourcesContent":["// @flow\nimport React from 'react'\n\nimport {\n\tTextInput,\n\tFormLayout,\n\tFormLayoutGroup,\n\tFormLayoutItem,\n\tSelect,\n\tDurationInput\n} from '../../../../index'\n\nimport { List } from '../../../../../List'\n\nimport Button from '../../../../../Button/Button'\n\nimport type { FormikProps } from 'formik'\nimport type { FormLayoutProps } from '../../../FormLayout/FormLayout'\nimport type { Props as ButtonProps } from '../../../../../Button/Button'\nimport type { Props as ToggleProps } from '../../../../components/Toggle/Toggle'\n\nexport type FormInnerFieldProps = {\n\t/** Unique name/id for the field */\n\tname: string,\n\n\t/** The type of element to render */\n\ttype: string,\n\n\t/** Props to pass through to the field */\n\tprops?: Object\n}\n\nexport type FormInnerProps = {\n\t/** Fields in this form */\n\tfields: Array<FormInnerFieldProps>,\n\n\t/** Layout properties for the form layout */\n\tformLayout: FormLayoutProps,\n\n\t/** Props to pass through from Formik */\n\tformikProps: FormikProps,\n\n\t/** Optional when using a primary cta in the form */\n\tprimaryCTA?: ?ButtonProps,\n\n\t/** Optional when including a secondary cta in the form */\n\tsecondaryCTA?: ?ButtonProps,\n\n\t/** handle some on change */\n\tonChange?: Function\n}\n\ntype BooleanProps = ToggleProps & {\n\tname: string,\n\tlabel?: string,\n\tvalue?: boolean,\n\thelper?: string,\n\tdefaultValue?: boolean,\n\tonBlur: Function,\n\tformikProps: FormikProps\n}\n\nclass BooleanField extends React.PureComponent<BooleanProps> {\n\thandleChange = e => {\n\t\tconst { onBlur, name } = this.props\n\t\tconst {\n\t\t\tformikProps: { setFieldValue }\n\t\t} = this.props\n\t\tsetFieldValue(name, e.target.checked)\n\t\tonBlur(e)\n\t}\n\trender() {\n\t\tconst { label, helper, value, ...rest } = this.props\n\t\tconst toggleId = this.props.name || ''\n\t\tconst toggleProps = { ...rest, onChange: this.handleChange }\n\t\tif (value) {\n\t\t\ttoggleProps.defaultChecked = true\n\t\t}\n\n\t\treturn (\n\t\t\t<List\n\t\t\t\titems={[\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: label,\n\t\t\t\t\t\tsubtitle: helper,\n\t\t\t\t\t\ttoggleId,\n\t\t\t\t\t\ttoggleProps\n\t\t\t\t\t}\n\t\t\t\t]}\n\t\t\t/>\n\t\t)\n\t}\n}\n\nclass FormInner extends React.PureComponent<FormInnerProps> {\n\tstatic defaultProps = {\n\t\tprimaryCTA: null,\n\t\tsecondaryCTA: null\n\t}\n\n\thandleChange = (\n\t\tname: string,\n\t\ttype: string,\n\t\teOrValue: KeyboardEvent | any,\n\t\teOrNull: KeyboardEvent | null\n\t) => {\n\t\tlet value: any = eOrNull ? eOrValue : eOrValue.target.value\n\t\tlet shouldValidate = true\n\t\tswitch (type) {\n\t\t\tcase 'boolean':\n\t\t\t\tvalue = value === 'on'\n\t\t\t\tshouldValidate = false // it can only be valid values\n\t\t\t\tbreak\n\t\t}\n\t\tconst {\n\t\t\tformikProps: { setFieldValue }\n\t\t} = this.props\n\n\t\tsetFieldValue(name, value, shouldValidate)\n\t\tconst { onChange } = this.props\n\t\tonChange && onChange(value, eOrNull || eOrValue)\n\t}\n\n\trenderChild = (child: FormInnerFieldProps) => {\n\t\tconst Elements = {\n\t\t\ttext: TextInput,\n\t\t\tboolean: BooleanField,\n\t\t\tselect: Select,\n\t\t\tduration: DurationInput\n\t\t}\n\t\tconst { formikProps } = this.props\n\t\tconst Handler = (child && child.type && Elements[child.type]) || TextInput\n\t\tconst props = { ...child.props, name: child.name, formikProps }\n\t\treturn !Handler.prototype.render ? Handler(props) : <Handler {...props} />\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tformLayout,\n\t\t\tformikProps,\n\t\t\tfields,\n\t\t\tprimaryCTA,\n\t\t\tsecondaryCTA\n\t\t} = this.props\n\n\t\tconst {\n\t\t\thandleBlur,\n\t\t\tvalues,\n\t\t\terrors,\n\t\t\ttouched,\n\t\t\tisValid,\n\t\t\tisSubmitting\n\t\t} = formikProps\n\n\t\treturn (\n\t\t\t<FormLayout {...formLayout}>\n\t\t\t\t{fields &&\n\t\t\t\t\tfields.length > 0 &&\n\t\t\t\t\tfields.map(field => {\n\t\t\t\t\t\tconst { type, props } = field\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<FormLayoutItem key={field.name}>\n\t\t\t\t\t\t\t\t{this.renderChild({\n\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t\tname: field.name,\n\t\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\t\t...props,\n\t\t\t\t\t\t\t\t\t\tonChange: (eOrValue, eOrNull) => {\n\t\t\t\t\t\t\t\t\t\t\tthis.handleChange(\n\t\t\t\t\t\t\t\t\t\t\t\tfield.name,\n\t\t\t\t\t\t\t\t\t\t\t\tfield.type,\n\t\t\t\t\t\t\t\t\t\t\t\teOrValue,\n\t\t\t\t\t\t\t\t\t\t\t\teOrNull\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonBlur: handleBlur,\n\t\t\t\t\t\t\t\t\t\tvalue: values ? values[field.name] : '',\n\t\t\t\t\t\t\t\t\t\terror: touched[field.name] && errors[field.name]\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</FormLayoutItem>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t{primaryCTA && (\n\t\t\t\t\t<FormLayoutGroup>\n\t\t\t\t\t\t{secondaryCTA && (\n\t\t\t\t\t\t\t<FormLayoutItem>\n\t\t\t\t\t\t\t\t<Button disabled={isSubmitting} {...secondaryCTA} />\n\t\t\t\t\t\t\t</FormLayoutItem>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<FormLayoutItem>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tkind=\"primary\"\n\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\tdisabled={!isValid || isSubmitting}\n\t\t\t\t\t\t\t\tisLoading={isSubmitting}\n\t\t\t\t\t\t\t\t{...primaryCTA}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FormLayoutItem>\n\t\t\t\t\t</FormLayoutGroup>\n\t\t\t\t)}\n\t\t\t</FormLayout>\n\t\t)\n\t}\n}\n\nexport default FormInner\n"],"file":"FormInner.js"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
18
|
+
var FormLayout = function FormLayout(props) {
|
|
19
|
+
var children = props.children,
|
|
20
|
+
className = props.className,
|
|
21
|
+
spacing = props.spacing,
|
|
22
|
+
rest = (0, _objectWithoutProperties2["default"])(props, ["children", "className", "spacing"]);
|
|
23
|
+
return _react["default"].createElement("div", (0, _extends2["default"])({
|
|
24
|
+
className: (0, _classnames["default"])('form-layout', className, {
|
|
25
|
+
'form-layout--spacing-tight': spacing === 'tight'
|
|
26
|
+
})
|
|
27
|
+
}, rest), children);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
FormLayout.defaultProps = {
|
|
31
|
+
spacing: 'base'
|
|
32
|
+
};
|
|
33
|
+
var _default = FormLayout;
|
|
34
|
+
exports["default"] = _default;
|
|
35
|
+
//# sourceMappingURL=FormLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Forms/components/FormLayout/FormLayout.js"],"names":["FormLayout","props","children","className","spacing","rest","defaultProps"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;AAaA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,KAAD,EAA4B;AAAA,MACtCC,QADsC,GACID,KADJ,CACtCC,QADsC;AAAA,MAC5BC,SAD4B,GACIF,KADJ,CAC5BE,SAD4B;AAAA,MACjBC,OADiB,GACIH,KADJ,CACjBG,OADiB;AAAA,MACLC,IADK,6CACIJ,KADJ;AAG9C,SACC;AACC,IAAA,SAAS,EAAE,4BAAG,aAAH,EAAkBE,SAAlB,EAA6B;AACvC,oCAA8BC,OAAO,KAAK;AADH,KAA7B;AADZ,KAIKC,IAJL,GAMEH,QANF,CADD;AAUA,CAbD;;AAeAF,UAAU,CAACM,YAAX,GAA0B;AACzBF,EAAAA,OAAO,EAAE;AADgB,CAA1B;eAIeJ,U","sourcesContent":["// @flow\nimport React from 'react'\nimport cx from 'classnames'\n\nexport type FormLayoutProps = {\n\t/** Contents of the Form Layout. Should be FormLayoutItem or FormLayoutGroup components */\n\tchildren?: Node,\n\n\t/** Class name for the layout */\n\tclassName?: string,\n\n\t/** Vertical spacing of the FormLayoutItem components */\n\tspacing?: 'base' | 'tight'\n}\n\nconst FormLayout = (props: FormLayoutProps) => {\n\tconst { children, className, spacing, ...rest } = props\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cx('form-layout', className, {\n\t\t\t\t'form-layout--spacing-tight': spacing === 'tight'\n\t\t\t})}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n\nFormLayout.defaultProps = {\n\tspacing: 'base'\n}\n\nexport default FormLayout\n"],"file":"FormLayout.js"}
|
package/lib/components/Forms/components/FormLayout/components/FormLayoutGroup/FormLayoutGroup.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var FormLayoutGroup = function FormLayoutGroup(props) {
|
|
15
|
+
var children = props.children,
|
|
16
|
+
className = props.className,
|
|
17
|
+
isCondensed = props.isCondensed;
|
|
18
|
+
return _react["default"].createElement("div", {
|
|
19
|
+
className: (0, _classnames["default"])('form-layout__group', className, {
|
|
20
|
+
'form-layout__group--condensed': isCondensed
|
|
21
|
+
})
|
|
22
|
+
}, children);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
FormLayoutGroup.defaultProps = {
|
|
26
|
+
isCondensed: false
|
|
27
|
+
};
|
|
28
|
+
var _default = FormLayoutGroup;
|
|
29
|
+
exports["default"] = _default;
|
|
30
|
+
//# sourceMappingURL=FormLayoutGroup.js.map
|
package/lib/components/Forms/components/FormLayout/components/FormLayoutGroup/FormLayoutGroup.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/components/Forms/components/FormLayout/components/FormLayoutGroup/FormLayoutGroup.js"],"names":["FormLayoutGroup","props","children","className","isCondensed","defaultProps"],"mappings":";;;;;;;;;AACA;;AACA;;AAaA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD,EAAiC;AAAA,MAChDC,QADgD,GACXD,KADW,CAChDC,QADgD;AAAA,MACtCC,SADsC,GACXF,KADW,CACtCE,SADsC;AAAA,MAC3BC,WAD2B,GACXH,KADW,CAC3BG,WAD2B;AAGxD,SACC;AACC,IAAA,SAAS,EAAE,4BAAG,oBAAH,EAAyBD,SAAzB,EAAoC;AAC9C,uCAAiCC;AADa,KAApC;AADZ,KAKEF,QALF,CADD;AASA,CAZD;;AAcAF,eAAe,CAACK,YAAhB,GAA+B;AAC9BD,EAAAA,WAAW,EAAE;AADiB,CAA/B;eAIeJ,e","sourcesContent":["// @flow\nimport React from 'react'\nimport cx from 'classnames'\n\nexport type FormLayoutGroupProps = {\n\t/** Contents of the FormLayoutGroup. Should be FormLayoutItem components */\n\tchildren: Node,\n\n\t/** Class name for the group */\n\tclassName?: string,\n\n\t/** Whether the group item widths can be condensed to fit more items in a row */\n\tisCondensed?: boolean\n}\n\nconst FormLayoutGroup = (props: FormLayoutGroupProps) => {\n\tconst { children, className, isCondensed } = props\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cx('form-layout__group', className, {\n\t\t\t\t'form-layout__group--condensed': isCondensed\n\t\t\t})}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n\nFormLayoutGroup.defaultProps = {\n\tisCondensed: false\n}\n\nexport default FormLayoutGroup\n"],"file":"FormLayoutGroup.js"}
|
package/lib/components/Forms/components/FormLayout/components/FormLayoutItem/FormLayoutItem.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
18
|
+
var FormLayoutItem = function FormLayoutItem(props) {
|
|
19
|
+
var children = props.children,
|
|
20
|
+
className = props.className,
|
|
21
|
+
spacerTop = props.spacerTop,
|
|
22
|
+
rest = (0, _objectWithoutProperties2["default"])(props, ["children", "className", "spacerTop"]);
|
|
23
|
+
return _react["default"].createElement("div", (0, _extends2["default"])({
|
|
24
|
+
className: (0, _classnames["default"])('form-layout__item', className, {
|
|
25
|
+
'form-layout__item--spacer-top': spacerTop
|
|
26
|
+
})
|
|
27
|
+
}, rest), children);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var _default = FormLayoutItem;
|
|
31
|
+
exports["default"] = _default;
|
|
32
|
+
//# sourceMappingURL=FormLayoutItem.js.map
|
package/lib/components/Forms/components/FormLayout/components/FormLayoutItem/FormLayoutItem.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/components/Forms/components/FormLayout/components/FormLayoutItem/FormLayoutItem.js"],"names":["FormLayoutItem","props","children","className","spacerTop","rest"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;AAaA,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAACC,KAAD,EAAgC;AAAA,MAC9CC,QAD8C,GACFD,KADE,CAC9CC,QAD8C;AAAA,MACpCC,SADoC,GACFF,KADE,CACpCE,SADoC;AAAA,MACzBC,SADyB,GACFH,KADE,CACzBG,SADyB;AAAA,MACXC,IADW,6CACFJ,KADE;AAGtD,SACC;AACC,IAAA,SAAS,EAAE,4BAAG,mBAAH,EAAwBE,SAAxB,EAAmC;AAC7C,uCAAiCC;AADY,KAAnC;AADZ,KAIKC,IAJL,GAMEH,QANF,CADD;AAUA,CAbD;;eAeeF,c","sourcesContent":["// @flow\nimport React from 'react'\nimport cx from 'classnames'\n\nexport type FormLayoutItemProps = {\n\t/** Contents of the Form Layout Item */\n\tchildren: Node,\n\n\t/** Class name for the item */\n\tclassName?: string,\n\n\t/** Set to true to add spacer to top if this item doesn't have a label but will be inline with other items that do. */\n\tspacerTop?: boolean\n}\n\nconst FormLayoutItem = (props: FormLayoutItemProps) => {\n\tconst { children, className, spacerTop, ...rest } = props\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cx('form-layout__item', className, {\n\t\t\t\t'form-layout__item--spacer-top': spacerTop\n\t\t\t})}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n\nexport default FormLayoutItem\n"],"file":"FormLayoutItem.js"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "default", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _FormLayout["default"];
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "FormLayoutGroup", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _FormLayoutGroup2["default"];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "FormLayoutItem", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _FormLayoutItem2["default"];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
var _FormLayout = _interopRequireDefault(require("./FormLayout"));
|
|
28
|
+
|
|
29
|
+
var _FormLayoutGroup2 = _interopRequireDefault(require("./components/FormLayoutGroup/FormLayoutGroup"));
|
|
30
|
+
|
|
31
|
+
var _FormLayoutItem2 = _interopRequireDefault(require("./components/FormLayoutItem/FormLayoutItem"));
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"index.js"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { PhoneInputProps, InputComponentProps } from 'react-phone-number-input';
|
|
3
|
+
export { formatPhoneNumber, formatPhoneNumberIntl } from 'react-phone-number-input';
|
|
4
|
+
export declare const isValidPhoneNumber: (phoneNumber: string) => boolean;
|
|
5
|
+
interface IPhoneInputProps {
|
|
6
|
+
/** Label text */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Set true to make the input less tall */
|
|
9
|
+
isSmall?: boolean;
|
|
10
|
+
/** Helper text */
|
|
11
|
+
helper?: string;
|
|
12
|
+
/** Any error message to be rendered */
|
|
13
|
+
error?: string;
|
|
14
|
+
/** Default value for the input */
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
/** Should input autoFocus? */
|
|
17
|
+
autoFocus?: boolean;
|
|
18
|
+
/** Optional input value */
|
|
19
|
+
value?: string;
|
|
20
|
+
}
|
|
21
|
+
interface IPhoneInputState {
|
|
22
|
+
phone: string;
|
|
23
|
+
error: string;
|
|
24
|
+
}
|
|
25
|
+
export default class PhoneInput extends Component<Partial<PhoneInputProps & InputComponentProps> & IPhoneInputProps, IPhoneInputState> {
|
|
26
|
+
constructor(props: any);
|
|
27
|
+
handleChange: (phoneNumber: string) => void;
|
|
28
|
+
render(): React.ReactElement;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=PhoneInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Forms/components/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAwB,EACvB,eAAe,EACf,mBAAmB,EACnB,MAAM,0BAA0B,CAAA;AAKjC,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,MAAM,0BAA0B,CAAA;AAIjC,eAAO,MAAM,kBAAkB,kCAE9B,CAAA;AAED,UAAU,gBAAgB;IACzB,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;IAEb,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,UAAU,gBAAgB;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACb;AAED,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,SAAS,CAChD,OAAO,CAAC,eAAe,GAAG,mBAAmB,CAAC,GAAG,gBAAgB,EACjE,gBAAgB,CAChB;gBACmB,KAAK,KAAA;IASjB,YAAY,gCAIlB;IAEM,MAAM,IAAI,KAAK,CAAC,YAAY;CA8BnC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
Object.defineProperty(exports, "formatPhoneNumber", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _reactPhoneNumberInput.formatPhoneNumber;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "formatPhoneNumberIntl", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function get() {
|
|
19
|
+
return _reactPhoneNumberInput.formatPhoneNumberIntl;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
exports["default"] = exports.isValidPhoneNumber = void 0;
|
|
23
|
+
|
|
24
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
25
|
+
|
|
26
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
27
|
+
|
|
28
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
29
|
+
|
|
30
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
31
|
+
|
|
32
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
33
|
+
|
|
34
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
35
|
+
|
|
36
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
37
|
+
|
|
38
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
39
|
+
|
|
40
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
41
|
+
|
|
42
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
43
|
+
|
|
44
|
+
var _reactPhoneNumberInput = _interopRequireWildcard(require("react-phone-number-input"));
|
|
45
|
+
|
|
46
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
47
|
+
|
|
48
|
+
var _FormPartials = require("../../FormPartials");
|
|
49
|
+
|
|
50
|
+
// for validating and formatting
|
|
51
|
+
// This is a barebones copy of react-phone-number-input's method API:
|
|
52
|
+
// https://github.com/catamphetamine/react-phone-number-input#validation
|
|
53
|
+
var isValidPhoneNumber = function isValidPhoneNumber(phoneNumber) {
|
|
54
|
+
return !!phoneNumber.replace(/[^a-z0-9+]/gi, '').match(/^\+1[\d]{10}$/);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.isValidPhoneNumber = isValidPhoneNumber;
|
|
58
|
+
|
|
59
|
+
var PhoneInput =
|
|
60
|
+
/*#__PURE__*/
|
|
61
|
+
function (_Component) {
|
|
62
|
+
(0, _inherits2["default"])(PhoneInput, _Component);
|
|
63
|
+
|
|
64
|
+
function PhoneInput(props) {
|
|
65
|
+
var _this;
|
|
66
|
+
|
|
67
|
+
(0, _classCallCheck2["default"])(this, PhoneInput);
|
|
68
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(PhoneInput).call(this, props));
|
|
69
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleChange", function (phoneNumber) {
|
|
70
|
+
_this.setState({
|
|
71
|
+
phone: phoneNumber
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
_this.state = {
|
|
75
|
+
phone: props.defaultValue || '',
|
|
76
|
+
error: ''
|
|
77
|
+
};
|
|
78
|
+
return _this;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
(0, _createClass2["default"])(PhoneInput, [{
|
|
82
|
+
key: "render",
|
|
83
|
+
value: function render() {
|
|
84
|
+
var phone = this.state.phone;
|
|
85
|
+
var _this$props = this.props,
|
|
86
|
+
label = _this$props.label,
|
|
87
|
+
error = _this$props.error,
|
|
88
|
+
isSmall = _this$props.isSmall,
|
|
89
|
+
helper = _this$props.helper,
|
|
90
|
+
rest = (0, _objectWithoutProperties2["default"])(_this$props, ["label", "error", "isSmall", "helper"]);
|
|
91
|
+
delete rest.defaultValue;
|
|
92
|
+
return _react["default"].createElement("div", {
|
|
93
|
+
className: (0, _classnames["default"])('text-input', {
|
|
94
|
+
'text-input--has-error': error,
|
|
95
|
+
'text-input-small': isSmall
|
|
96
|
+
})
|
|
97
|
+
}, _react["default"].createElement(_FormPartials.InputPre, {
|
|
98
|
+
label: label
|
|
99
|
+
}), _react["default"].createElement(_reactPhoneNumberInput["default"], (0, _extends2["default"])({
|
|
100
|
+
inputClassName: "text-input__input",
|
|
101
|
+
value: phone,
|
|
102
|
+
countries: ['US'],
|
|
103
|
+
country: "US",
|
|
104
|
+
labels: {
|
|
105
|
+
US: 'United States'
|
|
106
|
+
},
|
|
107
|
+
onChange: this.handleChange,
|
|
108
|
+
international: false
|
|
109
|
+
}, rest)), (helper || error) && _react["default"].createElement(_FormPartials.InputHelper, {
|
|
110
|
+
helper: helper,
|
|
111
|
+
error: error
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
}]);
|
|
115
|
+
return PhoneInput;
|
|
116
|
+
}(_react.Component);
|
|
117
|
+
|
|
118
|
+
exports["default"] = PhoneInput;
|
|
119
|
+
//# sourceMappingURL=PhoneInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Forms/components/PhoneInput/PhoneInput.tsx"],"names":["isValidPhoneNumber","phoneNumber","replace","match","PhoneInput","props","setState","phone","state","defaultValue","error","label","isSmall","helper","rest","US","handleChange","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAIA;;AACA;;AAEA;AAMA;AACA;AACO,IAAMA,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,WAAD,EAAkC;AACnE,SAAO,CAAC,CAACA,WAAW,CAACC,OAAZ,CAAoB,cAApB,EAAoC,EAApC,EAAwCC,KAAxC,CAA8C,eAA9C,CAAT;AACA,CAFM;;;;IAgCcC,U;;;;;AAIpB,sBAAmBC,KAAnB,EAA0B;AAAA;;AAAA;AACzB,sHAAMA,KAAN;AADyB,qGASJ,UAACJ,WAAD,EAAyB;AAC9C,YAAKK,QAAL,CAAc;AACbC,QAAAA,KAAK,EAAEN;AADM,OAAd;AAGA,KAbyB;AAGzB,UAAKO,KAAL,GAAa;AACZD,MAAAA,KAAK,EAAEF,KAAK,CAACI,YAAN,IAAsB,EADjB;AAEZC,MAAAA,KAAK,EAAE;AAFK,KAAb;AAHyB;AAOzB;;;;6BAQmC;AAAA,UAC3BH,KAD2B,GACjB,KAAKC,KADY,CAC3BD,KAD2B;AAAA,wBAEgB,KAAKF,KAFrB;AAAA,UAE3BM,KAF2B,eAE3BA,KAF2B;AAAA,UAEpBD,KAFoB,eAEpBA,KAFoB;AAAA,UAEbE,OAFa,eAEbA,OAFa;AAAA,UAEJC,MAFI,eAEJA,MAFI;AAAA,UAEOC,IAFP;AAInC,aAAOA,IAAI,CAACL,YAAZ;AAEA,aACC;AACC,QAAA,SAAS,EAAE,4BAAG,YAAH,EAAiB;AAC3B,mCAAyBC,KADE;AAE3B,8BAAoBE;AAFO,SAAjB;AADZ,SAMC,gCAAC,sBAAD;AAAU,QAAA,KAAK,EAAED;AAAjB,QAND,EAQC,gCAAC,iCAAD;AACC,QAAA,cAAc,EAAC,mBADhB;AAEC,QAAA,KAAK,EAAEJ,KAFR;AAGC,QAAA,SAAS,EAAE,CAAC,IAAD,CAHZ;AAIC,QAAA,OAAO,EAAC,IAJT;AAKC,QAAA,MAAM,EAAE;AAAEQ,UAAAA,EAAE,EAAE;AAAN,SALT;AAMC,QAAA,QAAQ,EAAE,KAAKC,YANhB;AAOC,QAAA,aAAa,EAAE;AAPhB,SAQKF,IARL,EARD,EAmBE,CAACD,MAAM,IAAIH,KAAX,KAAqB,gCAAC,yBAAD;AAAa,QAAA,MAAM,EAAEG,MAArB;AAA6B,QAAA,KAAK,EAAEH;AAApC,QAnBvB,CADD;AAuBA;;;EAhDsCO,gB","sourcesContent":["import React, { Component } from 'react'\nimport ReactPhoneInput, {\n\tPhoneInputProps,\n\tInputComponentProps\n} from 'react-phone-number-input'\nimport cx from 'classnames'\nimport { InputPre, InputHelper } from '../../FormPartials'\n\n// for validating and formatting\nexport {\n\tformatPhoneNumber,\n\tformatPhoneNumberIntl\n} from 'react-phone-number-input'\n\n// This is a barebones copy of react-phone-number-input's method API:\n// https://github.com/catamphetamine/react-phone-number-input#validation\nexport const isValidPhoneNumber = (phoneNumber: string): boolean => {\n\treturn !!phoneNumber.replace(/[^a-z0-9+]/gi, '').match(/^\\+1[\\d]{10}$/)\n}\n\ninterface IPhoneInputProps {\n\t/** Label text */\n\tlabel: string\n\n\t/** Set true to make the input less tall */\n\tisSmall?: boolean\n\n\t/** Helper text */\n\thelper?: string\n\n\t/** Any error message to be rendered */\n\terror?: string\n\n\t/** Default value for the input */\n\tdefaultValue?: string\n\n\t/** Should input autoFocus? */\n\tautoFocus?: boolean\n\n\t/** Optional input value */\n\tvalue?: string\n}\n\ninterface IPhoneInputState {\n\tphone: string\n\terror: string\n}\n\nexport default class PhoneInput extends Component<\n\tPartial<PhoneInputProps & InputComponentProps> & IPhoneInputProps,\n\tIPhoneInputState\n> {\n\tpublic constructor(props) {\n\t\tsuper(props)\n\n\t\tthis.state = {\n\t\t\tphone: props.defaultValue || '',\n\t\t\terror: ''\n\t\t}\n\t}\n\n\tpublic handleChange = (phoneNumber: string) => {\n\t\tthis.setState({\n\t\t\tphone: phoneNumber\n\t\t})\n\t}\n\n\tpublic render(): React.ReactElement {\n\t\tconst { phone } = this.state\n\t\tconst { label, error, isSmall, helper, ...rest } = this.props\n\n\t\tdelete rest.defaultValue\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={cx('text-input', {\n\t\t\t\t\t'text-input--has-error': error,\n\t\t\t\t\t'text-input-small': isSmall\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<InputPre label={label} />\n\n\t\t\t\t<ReactPhoneInput\n\t\t\t\t\tinputClassName=\"text-input__input\"\n\t\t\t\t\tvalue={phone}\n\t\t\t\t\tcountries={['US']}\n\t\t\t\t\tcountry=\"US\"\n\t\t\t\t\tlabels={{ US: 'United States' }}\n\t\t\t\t\tonChange={this.handleChange}\n\t\t\t\t\tinternational={false}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\n\t\t\t\t{(helper || error) && <InputHelper helper={helper} error={error} />}\n\t\t\t</div>\n\t\t)\n\t}\n}\n"],"file":"PhoneInput.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IHWAction, IHWRadio } from '@sprucelabs/spruce-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface IRadioProps extends Omit<IHWRadio, 'id'> {
|
|
4
|
+
/** optional id for the radio */
|
|
5
|
+
id?: string;
|
|
6
|
+
/** Parent class */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Change handler */
|
|
9
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
/** optional, provide a handler for Actions */
|
|
11
|
+
onAction?: (action: IHWAction) => any;
|
|
12
|
+
}
|
|
13
|
+
declare const Radio: (props: IRadioProps) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>;
|
|
14
|
+
export default Radio;
|
|
15
|
+
//# sourceMappingURL=Radio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../../src/components/Forms/components/Radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxD,gCAAgC;IAChC,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX,mBAAmB;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IAE3D,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,GAAG,CAAA;CACrC;AAED,QAAA,MAAM,KAAK,wOA6CV,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var RadioIconYes = function RadioIconYes(props) {
|
|
15
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
16
|
+
fillRule: "evenodd",
|
|
17
|
+
clipRule: "evenodd",
|
|
18
|
+
d: "M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
RadioIconYes.defaultProps = {
|
|
23
|
+
width: "24",
|
|
24
|
+
height: "24",
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var RadioIconNo = function RadioIconNo(props) {
|
|
30
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
31
|
+
fillRule: "evenodd",
|
|
32
|
+
clipRule: "evenodd",
|
|
33
|
+
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
RadioIconNo.defaultProps = {
|
|
38
|
+
width: "24",
|
|
39
|
+
height: "24",
|
|
40
|
+
viewBox: "0 0 24 24",
|
|
41
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
var Radio = function Radio(props) {
|
|
45
|
+
var action = props.action,
|
|
46
|
+
className = props.className,
|
|
47
|
+
id = props.id,
|
|
48
|
+
isChecked = props.isChecked,
|
|
49
|
+
isDisabled = props.isDisabled,
|
|
50
|
+
label = props.label,
|
|
51
|
+
name = props.name,
|
|
52
|
+
onAction = props.onAction,
|
|
53
|
+
_onChange = props.onChange,
|
|
54
|
+
postText = props.postText;
|
|
55
|
+
var parentClass = (0, _classnames["default"])('checkbox-item', className);
|
|
56
|
+
return _react["default"].createElement("div", {
|
|
57
|
+
className: parentClass
|
|
58
|
+
}, _react["default"].createElement("div", {
|
|
59
|
+
className: "checkbox-item__inner"
|
|
60
|
+
}, _react["default"].createElement("input", {
|
|
61
|
+
checked: isChecked || false,
|
|
62
|
+
className: "checkbox-item__input",
|
|
63
|
+
disabled: isDisabled || false,
|
|
64
|
+
id: id,
|
|
65
|
+
name: name || undefined,
|
|
66
|
+
onChange: function onChange() {
|
|
67
|
+
if (_onChange) {
|
|
68
|
+
_onChange.apply(void 0, arguments);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (onAction && action) {
|
|
72
|
+
onAction(action);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
type: "radio"
|
|
76
|
+
}), _react["default"].createElement("label", {
|
|
77
|
+
className: "checkbox-item__label",
|
|
78
|
+
htmlFor: id
|
|
79
|
+
}, label), _react["default"].createElement("div", {
|
|
80
|
+
className: "checkbox-item__icons"
|
|
81
|
+
}, _react["default"].createElement(RadioIconYes, {
|
|
82
|
+
className: "checkbox-item__icon checkbox-item__icon-yes"
|
|
83
|
+
}), _react["default"].createElement(RadioIconNo, {
|
|
84
|
+
className: "checkbox-item__icon checkbox-item__icon-no"
|
|
85
|
+
}))), postText && _react["default"].createElement("p", {
|
|
86
|
+
className: "checkbox-item__post-text"
|
|
87
|
+
}, postText));
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
var _default = Radio;
|
|
91
|
+
exports["default"] = _default;
|
|
92
|
+
//# sourceMappingURL=Radio.js.map
|