@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,47 @@
|
|
|
1
|
+
import { IHWButton, IHWButtonTypes as ButtonTypes, IHWButtonKinds as ButtonKinds, IHWAction } from '@sprucelabs/spruce-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { IIconProps } from '../Icon/Icon';
|
|
4
|
+
export { IHWButtonKinds as ButtonKinds, IHWButtonTypes as ButtonTypes } from '@sprucelabs/spruce-types';
|
|
5
|
+
export interface IButtonProps extends Omit<IHWButton, 'id' | 'icon'> {
|
|
6
|
+
/** Optional ID for view caching */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** The kind of button, primary, secondary, etc. */
|
|
9
|
+
kind?: ButtonKinds | null;
|
|
10
|
+
/** Submit/Button */
|
|
11
|
+
type?: ButtonTypes | null;
|
|
12
|
+
/** Optional class to add to the button. */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Optional children passed into button */
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
/** Icon for the button. */
|
|
17
|
+
icon?: IIconProps | null;
|
|
18
|
+
/** Click handler. */
|
|
19
|
+
onClick?: Function;
|
|
20
|
+
/** Component used to render anchor */
|
|
21
|
+
AnchorComponent?: any;
|
|
22
|
+
/** optional target, whatever an anchor tag takes */
|
|
23
|
+
target?: string;
|
|
24
|
+
/** optional payload to be sent with onclick (different than the payload attached to action.) */
|
|
25
|
+
payload?: Record<string, any>;
|
|
26
|
+
/** optional, provide a handler for Actions */
|
|
27
|
+
onAction?: (action: IHWAction) => any;
|
|
28
|
+
}
|
|
29
|
+
export declare type Action = IButtonProps | IHWButton;
|
|
30
|
+
declare const Button: {
|
|
31
|
+
(props: IHWButton | IButtonProps): 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>)>;
|
|
32
|
+
defaultProps: {
|
|
33
|
+
className: string;
|
|
34
|
+
kind: string;
|
|
35
|
+
isSmall: boolean;
|
|
36
|
+
isFullWidth: boolean;
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
isIconOnly: boolean;
|
|
39
|
+
text: string;
|
|
40
|
+
href: string;
|
|
41
|
+
icon: null;
|
|
42
|
+
type: string;
|
|
43
|
+
onClick: () => null;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export default Button;
|
|
47
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,cAAc,IAAI,WAAW,EAC7B,cAAc,IAAI,WAAW,EAC7B,SAAS,EACT,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAG/C,OAAO,EACN,cAAc,IAAI,WAAW,EAC7B,cAAc,IAAI,WAAW,EAC7B,MAAM,0BAA0B,CAAA;AAEjC,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IACnE,mCAAmC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX,mDAAmD;IACnD,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAEzB,oBAAoB;IACpB,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAEzB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE1B,2BAA2B;IAC3B,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IAExB,qBAAqB;IACrB,OAAO,CAAC,EAAE,QAAQ,CAAA;IAElB,sCAAsC;IACtC,eAAe,CAAC,EAAE,GAAG,CAAA;IAErB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAE7B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,GAAG,CAAA;CACrC;AAED,oBAAY,MAAM,GAAG,YAAY,GAAG,SAAS,CAAA;AAE7C,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;CA0HX,CAAA;AAgBD,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,155 @@
|
|
|
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, "ButtonKinds", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _spruceTypes.IHWButtonKinds;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "ButtonTypes", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function get() {
|
|
19
|
+
return _spruceTypes.IHWButtonTypes;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
exports["default"] = void 0;
|
|
23
|
+
|
|
24
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
25
|
+
|
|
26
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
+
|
|
28
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
29
|
+
|
|
30
|
+
var _spruceTypes = require("@sprucelabs/spruce-types");
|
|
31
|
+
|
|
32
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
33
|
+
|
|
34
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
35
|
+
|
|
36
|
+
var _CircleLoader = _interopRequireDefault(require("../CircleLoader/CircleLoader"));
|
|
37
|
+
|
|
38
|
+
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
39
|
+
|
|
40
|
+
var _Anchor = _interopRequireDefault(require("../_utilities/Anchor"));
|
|
41
|
+
|
|
42
|
+
var Button = function Button(props) {
|
|
43
|
+
var reactHeartwoodProps = props;
|
|
44
|
+
var action = reactHeartwoodProps.action,
|
|
45
|
+
_reactHeartwoodProps$ = reactHeartwoodProps.AnchorComponent,
|
|
46
|
+
AnchorComponent = _reactHeartwoodProps$ === void 0 ? _Anchor["default"] : _reactHeartwoodProps$,
|
|
47
|
+
children = reactHeartwoodProps.children,
|
|
48
|
+
className = reactHeartwoodProps.className,
|
|
49
|
+
href = reactHeartwoodProps.href,
|
|
50
|
+
icon = reactHeartwoodProps.icon,
|
|
51
|
+
isFullWidth = reactHeartwoodProps.isFullWidth,
|
|
52
|
+
isIconOnly = reactHeartwoodProps.isIconOnly,
|
|
53
|
+
isLoading = reactHeartwoodProps.isLoading,
|
|
54
|
+
isSmall = reactHeartwoodProps.isSmall,
|
|
55
|
+
kind = reactHeartwoodProps.kind,
|
|
56
|
+
onAction = reactHeartwoodProps.onAction,
|
|
57
|
+
onClick = reactHeartwoodProps.onClick,
|
|
58
|
+
text = reactHeartwoodProps.text,
|
|
59
|
+
type = reactHeartwoodProps.type,
|
|
60
|
+
payload = reactHeartwoodProps.payload,
|
|
61
|
+
rest = (0, _objectWithoutProperties2["default"])(reactHeartwoodProps, ["action", "AnchorComponent", "children", "className", "href", "icon", "isFullWidth", "isIconOnly", "isLoading", "isSmall", "kind", "onAction", "onClick", "text", "type", "payload"]);
|
|
62
|
+
var btnClass = (0, _classnames["default"])(className, {
|
|
63
|
+
btn: true,
|
|
64
|
+
'btn-primary': kind === _spruceTypes.IHWButtonKinds.Primary,
|
|
65
|
+
'btn-secondary': kind === _spruceTypes.IHWButtonKinds.Secondary,
|
|
66
|
+
'btn-caution': kind === _spruceTypes.IHWButtonKinds.Caution,
|
|
67
|
+
'btn-simple': kind === _spruceTypes.IHWButtonKinds.Simple,
|
|
68
|
+
'btn-full-width': isFullWidth,
|
|
69
|
+
'btn--loading': isLoading,
|
|
70
|
+
'btn-small': isSmall,
|
|
71
|
+
'btn-icon-only': !children && !text || isIconOnly
|
|
72
|
+
});
|
|
73
|
+
var textClass = (0, _classnames["default"])('btn__text', {
|
|
74
|
+
'visually-hidden': isIconOnly
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
var handleClick = function handleClick(e) {
|
|
78
|
+
e.currentTarget.blur();
|
|
79
|
+
|
|
80
|
+
if (onAction && action) {
|
|
81
|
+
onAction(action);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (onClick) {
|
|
85
|
+
onClick(e, payload);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var Inner = function Inner() {
|
|
90
|
+
var _cx;
|
|
91
|
+
|
|
92
|
+
return _react["default"].createElement("span", {
|
|
93
|
+
className: "btn__inner"
|
|
94
|
+
}, children ? children : _react["default"].createElement(_react.Fragment, null, icon && (icon.customIcon || icon.name) && _react["default"].createElement("span", {
|
|
95
|
+
className: "btn__icon-wrapper"
|
|
96
|
+
}, _react["default"].createElement(_Icon["default"], {
|
|
97
|
+
id: icon.id,
|
|
98
|
+
customIcon: icon.customIcon,
|
|
99
|
+
name: icon.name,
|
|
100
|
+
isLineIcon: icon.isLineIcon,
|
|
101
|
+
className: (0, _classnames["default"])((_cx = {}, (0, _defineProperty2["default"])(_cx, 'btn__icon', true), (0, _defineProperty2["default"])(_cx, 'btn__line-icon', icon.isLineIcon), _cx), icon.className)
|
|
102
|
+
})), text && _react["default"].createElement("span", {
|
|
103
|
+
className: textClass
|
|
104
|
+
}, text), isLoading && _react["default"].createElement(_CircleLoader["default"], {
|
|
105
|
+
light: kind === _spruceTypes.IHWButtonKinds.Primary || kind === _spruceTypes.IHWButtonKinds.Caution
|
|
106
|
+
})));
|
|
107
|
+
}; // TODO: We probably need to create explicit whitelists of what we want to
|
|
108
|
+
// allow to be spread onto native DOM elements, since applying non-standard
|
|
109
|
+
// attributes throws a warning.
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
var isDisabled = rest.isDisabled;
|
|
113
|
+
|
|
114
|
+
var button = _react["default"].createElement("button", {
|
|
115
|
+
className: btnClass,
|
|
116
|
+
type: type || 'button',
|
|
117
|
+
onClick: handleClick,
|
|
118
|
+
disabled: isDisabled || false
|
|
119
|
+
}, _react["default"].createElement(Inner, null));
|
|
120
|
+
|
|
121
|
+
var anchor = _react["default"].createElement(AnchorComponent, (0, _extends2["default"])({
|
|
122
|
+
href: href,
|
|
123
|
+
className: btnClass,
|
|
124
|
+
onClick: handleClick
|
|
125
|
+
}, rest), _react["default"].createElement(Inner, null));
|
|
126
|
+
|
|
127
|
+
if (!children && !text && !icon) {
|
|
128
|
+
// TODO: Handle Logging
|
|
129
|
+
// console.error(
|
|
130
|
+
// '<Button /> must have text, icon, or both. Please check the props your passing.'
|
|
131
|
+
// )
|
|
132
|
+
return _react["default"].createElement(_react.Fragment, null);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return href ? anchor : button;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
Button.defaultProps = {
|
|
139
|
+
className: '',
|
|
140
|
+
kind: '',
|
|
141
|
+
isSmall: false,
|
|
142
|
+
isFullWidth: false,
|
|
143
|
+
isLoading: false,
|
|
144
|
+
isIconOnly: false,
|
|
145
|
+
text: '',
|
|
146
|
+
href: '',
|
|
147
|
+
icon: null,
|
|
148
|
+
type: 'button',
|
|
149
|
+
onClick: function onClick() {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
var _default = Button;
|
|
154
|
+
exports["default"] = _default;
|
|
155
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/Button.tsx"],"names":["Button","props","reactHeartwoodProps","action","AnchorComponent","BasicAnchor","children","className","href","icon","isFullWidth","isIconOnly","isLoading","isSmall","kind","onAction","onClick","text","type","payload","rest","btnClass","btn","ButtonKinds","Primary","Secondary","Caution","Simple","textClass","handleClick","e","currentTarget","blur","Inner","customIcon","name","id","isLineIcon","isDisabled","button","anchor","defaultProps"],"mappings":"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","sourcesContent":["import {\n\tIHWButton,\n\tIHWButtonTypes as ButtonTypes,\n\tIHWButtonKinds as ButtonKinds,\n\tIHWAction\n} from '@sprucelabs/spruce-types'\nimport cx from 'classnames'\nimport React, { Fragment } from 'react'\nimport CircleLoader from '../CircleLoader/CircleLoader'\nimport Icon, { IIconProps } from '../Icon/Icon'\nimport BasicAnchor from '../_utilities/Anchor'\n\nexport {\n\tIHWButtonKinds as ButtonKinds,\n\tIHWButtonTypes as ButtonTypes\n} from '@sprucelabs/spruce-types'\n\nexport interface IButtonProps extends Omit<IHWButton, 'id' | 'icon'> {\n\t/** Optional ID for view caching */\n\tid?: string\n\n\t/** The kind of button, primary, secondary, etc. */\n\tkind?: ButtonKinds | null\n\n\t/** Submit/Button */\n\ttype?: ButtonTypes | null\n\n\t/** Optional class to add to the button. */\n\tclassName?: string\n\n\t/** Optional children passed into button */\n\tchildren?: React.ReactNode\n\n\t/** Icon for the button. */\n\ticon?: IIconProps | null\n\n\t/** Click handler. */\n\tonClick?: Function\n\n\t/** Component used to render anchor */\n\tAnchorComponent?: any\n\n\t/** optional target, whatever an anchor tag takes */\n\ttarget?: string\n\n\t/** optional payload to be sent with onclick (different than the payload attached to action.) */\n\tpayload?: Record<string, any>\n\n\t/** optional, provide a handler for Actions */\n\tonAction?: (action: IHWAction) => any\n}\n\nexport type Action = IButtonProps | IHWButton\n\nconst Button = (props: IButtonProps | IHWButton): React.ReactElement => {\n\tconst reactHeartwoodProps = props as IButtonProps\n\n\tconst {\n\t\taction,\n\t\tAnchorComponent = BasicAnchor,\n\t\tchildren,\n\t\tclassName,\n\t\thref,\n\t\ticon,\n\t\tisFullWidth,\n\t\tisIconOnly,\n\t\tisLoading,\n\t\tisSmall,\n\t\tkind,\n\t\tonAction,\n\t\tonClick,\n\t\ttext,\n\t\ttype,\n\t\tpayload,\n\t\t...rest\n\t} = reactHeartwoodProps\n\n\tconst btnClass = cx(className, {\n\t\tbtn: true,\n\t\t'btn-primary': kind === ButtonKinds.Primary,\n\t\t'btn-secondary': kind === ButtonKinds.Secondary,\n\t\t'btn-caution': kind === ButtonKinds.Caution,\n\t\t'btn-simple': kind === ButtonKinds.Simple,\n\t\t'btn-full-width': isFullWidth,\n\t\t'btn--loading': isLoading,\n\t\t'btn-small': isSmall,\n\t\t'btn-icon-only': (!children && !text) || isIconOnly\n\t})\n\tconst textClass = cx('btn__text', {\n\t\t'visually-hidden': isIconOnly\n\t})\n\n\tconst handleClick = (e: any): any => {\n\t\te.currentTarget.blur()\n\n\t\tif (onAction && action) {\n\t\t\tonAction(action)\n\t\t}\n\n\t\tif (onClick) {\n\t\t\tonClick(e, payload)\n\t\t}\n\t}\n\n\tconst Inner = (): React.ReactElement => (\n\t\t<span className=\"btn__inner\">\n\t\t\t{children ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<Fragment>\n\t\t\t\t\t{icon && (icon.customIcon || icon.name) && (\n\t\t\t\t\t\t<span className=\"btn__icon-wrapper\">\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\tid={icon.id}\n\t\t\t\t\t\t\t\tcustomIcon={icon.customIcon}\n\t\t\t\t\t\t\t\tname={icon.name}\n\t\t\t\t\t\t\t\tisLineIcon={icon.isLineIcon}\n\t\t\t\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t['btn__icon']: true,\n\t\t\t\t\t\t\t\t\t\t'btn__line-icon': icon.isLineIcon\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\ticon.className\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t\t{text && <span className={textClass}>{text}</span>}\n\t\t\t\t\t{isLoading && (\n\t\t\t\t\t\t<CircleLoader\n\t\t\t\t\t\t\tlight={\n\t\t\t\t\t\t\t\tkind === ButtonKinds.Primary || kind === ButtonKinds.Caution\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Fragment>\n\t\t\t)}\n\t\t</span>\n\t)\n\n\t// TODO: We probably need to create explicit whitelists of what we want to\n\t// allow to be spread onto native DOM elements, since applying non-standard\n\t// attributes throws a warning.\n\tconst { isDisabled } = rest\n\n\tconst button = (\n\t\t<button\n\t\t\tclassName={btnClass}\n\t\t\ttype={type || 'button'}\n\t\t\tonClick={handleClick}\n\t\t\tdisabled={isDisabled || false}\n\t\t>\n\t\t\t<Inner />\n\t\t</button>\n\t)\n\n\tconst anchor = (\n\t\t<AnchorComponent\n\t\t\thref={href}\n\t\t\tclassName={btnClass}\n\t\t\tonClick={handleClick}\n\t\t\t{...rest}\n\t\t>\n\t\t\t<Inner />\n\t\t</AnchorComponent>\n\t)\n\n\tif (!children && !text && !icon) {\n\t\t// TODO: Handle Logging\n\t\t// console.error(\n\t\t// \t'<Button /> must have text, icon, or both. Please check the props your passing.'\n\t\t// )\n\t\treturn <Fragment />\n\t}\n\n\treturn href ? anchor : button\n}\n\nButton.defaultProps = {\n\tclassName: '',\n\tkind: '',\n\tisSmall: false,\n\tisFullWidth: false,\n\tisLoading: false,\n\tisIconOnly: false,\n\ttext: '',\n\thref: '',\n\ticon: null,\n\ttype: 'button',\n\tonClick: () => null\n}\n\nexport default Button\n"],"file":"Button.js"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@storybook/react");
|
|
8
|
+
|
|
9
|
+
var _react3 = require("@storybook/addon-knobs/react");
|
|
10
|
+
|
|
11
|
+
var _ButtonGroup = _interopRequireDefault(require("./ButtonGroup"));
|
|
12
|
+
|
|
13
|
+
var stories = (0, _react2.storiesOf)('ButtonGroup', module);
|
|
14
|
+
stories.addDecorator(_react3.withKnobs);
|
|
15
|
+
stories.add('Button Group', function () {
|
|
16
|
+
return _react["default"].createElement(_ButtonGroup["default"], {
|
|
17
|
+
kind: (0, _react3.text)('kind', ''),
|
|
18
|
+
actions: (0, _react3.object)('actions', [{
|
|
19
|
+
text: 'Confirm Changes',
|
|
20
|
+
kind: 'primary'
|
|
21
|
+
}, {
|
|
22
|
+
text: 'Cancel',
|
|
23
|
+
kind: 'secondary'
|
|
24
|
+
}])
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=ButtonGroup-story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonGroup/ButtonGroup-story.js"],"names":["stories","module","addDecorator","withKnobs","add","text","kind"],"mappings":";;;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,OAAO,GAAG,uBAAU,aAAV,EAAyBC,MAAzB,CAAhB;AAEAD,OAAO,CAACE,YAAR,CAAqBC,iBAArB;AAEAH,OAAO,CAACI,GAAR,CAAY,cAAZ,EAA4B;AAAA,SAC3B,gCAAC,uBAAD;AACC,IAAA,IAAI,EAAE,kBAAK,MAAL,EAAa,EAAb,CADP;AAEC,IAAA,OAAO,EAAE,oBAAO,SAAP,EAAkB,CAC1B;AAAEC,MAAAA,IAAI,EAAE,iBAAR;AAA2BC,MAAAA,IAAI,EAAE;AAAjC,KAD0B,EAE1B;AAAED,MAAAA,IAAI,EAAE,QAAR;AAAkBC,MAAAA,IAAI,EAAE;AAAxB,KAF0B,CAAlB;AAFV,IAD2B;AAAA,CAA5B","sourcesContent":["// @flow\nimport React from 'react'\nimport { storiesOf } from '@storybook/react'\nimport { withKnobs, text, object } from '@storybook/addon-knobs/react'\nimport ButtonGroup from './ButtonGroup'\n\nconst stories = storiesOf('ButtonGroup', module)\n\nstories.addDecorator(withKnobs)\n\nstories.add('Button Group', () => (\n\t<ButtonGroup\n\t\tkind={text('kind', '')}\n\t\tactions={object('actions', [\n\t\t\t{ text: 'Confirm Changes', kind: 'primary' },\n\t\t\t{ text: 'Cancel', kind: 'secondary' }\n\t\t])}\n\t/>\n))\n"],"file":"ButtonGroup-story.js"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IHWAction, IHWButtonGroup } from '@sprucelabs/spruce-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Action } from '../Button/Button';
|
|
4
|
+
export interface IButtonGroupProps extends Omit<IHWButtonGroup, 'actions'> {
|
|
5
|
+
/** Array of actions to render the group's buttons. */
|
|
6
|
+
actions: Action[];
|
|
7
|
+
/** optional, provide a handler for Actions */
|
|
8
|
+
onAction?: (action: IHWAction) => any;
|
|
9
|
+
}
|
|
10
|
+
declare const ButtonGroup: {
|
|
11
|
+
(props: IHWButtonGroup | IButtonGroupProps): 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>)>;
|
|
12
|
+
defaultProps: {
|
|
13
|
+
kind: string;
|
|
14
|
+
isFullWidth: boolean;
|
|
15
|
+
highlightedIndex: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default ButtonGroup;
|
|
19
|
+
//# sourceMappingURL=ButtonGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEpE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAe,EAAe,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAG9D,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC;IACzE,sDAAsD;IACtD,OAAO,EAAE,MAAM,EAAE,CAAA;IAEjB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,GAAG,CAAA;CACrC;AAED,QAAA,MAAM,WAAW;;;;;;;CA8ChB,CAAA;AAQD,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
|
|
18
|
+
var _Button = _interopRequireWildcard(require("../Button/Button"));
|
|
19
|
+
|
|
20
|
+
var _ = require("../..");
|
|
21
|
+
|
|
22
|
+
var ButtonGroup = function ButtonGroup(props) {
|
|
23
|
+
var reactHeartwoodProps = props;
|
|
24
|
+
var commonProps = props;
|
|
25
|
+
var actions = commonProps.actions,
|
|
26
|
+
kind = commonProps.kind,
|
|
27
|
+
isFullWidth = commonProps.isFullWidth,
|
|
28
|
+
highlightedIndex = commonProps.highlightedIndex;
|
|
29
|
+
var onAction = reactHeartwoodProps.onAction;
|
|
30
|
+
var parentClass = (0, _classnames["default"])('button-group', {
|
|
31
|
+
'button-group-segmented': kind === 'segmented',
|
|
32
|
+
'button-group-floating': kind === 'floating',
|
|
33
|
+
'button-group--is-full-width': isFullWidth
|
|
34
|
+
});
|
|
35
|
+
return _react["default"].createElement("ul", {
|
|
36
|
+
className: parentClass
|
|
37
|
+
}, (0, _.unionArray)(actions).map(function (action, idx) {
|
|
38
|
+
return _react["default"].createElement("li", {
|
|
39
|
+
key: action.id,
|
|
40
|
+
className: (0, _classnames["default"])('button-group__item', {
|
|
41
|
+
'button-group__item--is-highlighted': highlightedIndex === idx
|
|
42
|
+
})
|
|
43
|
+
}, _react["default"].createElement(_Button["default"], (0, _extends2["default"])({
|
|
44
|
+
isFullWidth: kind === 'floating' // TODO: This is necessary since the older "action" interface
|
|
45
|
+
// (meaning a button) doesn't work with the newer IHWAction
|
|
46
|
+
// interface. We need to refactor the legacy case broadly to
|
|
47
|
+
// remove this.
|
|
48
|
+
,
|
|
49
|
+
action: action
|
|
50
|
+
}, action, {
|
|
51
|
+
kind: kind === 'floating' ? _Button.ButtonKinds.Simple : kind === 'segmented' ? _Button.ButtonKinds.Secondary : action.kind,
|
|
52
|
+
onAction: onAction
|
|
53
|
+
})));
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
ButtonGroup.defaultProps = {
|
|
58
|
+
kind: 'default',
|
|
59
|
+
isFullWidth: false,
|
|
60
|
+
highlightedIndex: -1
|
|
61
|
+
};
|
|
62
|
+
var _default = ButtonGroup;
|
|
63
|
+
exports["default"] = _default;
|
|
64
|
+
//# sourceMappingURL=ButtonGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ButtonGroup/ButtonGroup.tsx"],"names":["ButtonGroup","props","reactHeartwoodProps","commonProps","actions","kind","isFullWidth","highlightedIndex","onAction","parentClass","map","action","idx","id","ButtonKinds","Simple","Secondary","defaultProps"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AAUA,IAAMA,WAAW,GAAG,SAAdA,WAAc,CACnBC,KADmB,EAEK;AACxB,MAAMC,mBAAmB,GAAGD,KAA5B;AACA,MAAME,WAAW,GAAGF,KAApB;AAFwB,MAIhBG,OAJgB,GAIiCD,WAJjC,CAIhBC,OAJgB;AAAA,MAIPC,IAJO,GAIiCF,WAJjC,CAIPE,IAJO;AAAA,MAIDC,WAJC,GAIiCH,WAJjC,CAIDG,WAJC;AAAA,MAIYC,gBAJZ,GAIiCJ,WAJjC,CAIYI,gBAJZ;AAAA,MAKhBC,QALgB,GAKHN,mBALG,CAKhBM,QALgB;AAOxB,MAAMC,WAAW,GAAG,4BAAG,cAAH,EAAmB;AACtC,8BAA0BJ,IAAI,KAAK,WADG;AAEtC,6BAAyBA,IAAI,KAAK,UAFI;AAGtC,mCAA+BC;AAHO,GAAnB,CAApB;AAKA,SACC;AAAI,IAAA,SAAS,EAAEG;AAAf,KACE,kBAAWL,OAAX,EAAoBM,GAApB,CAAwB,UAACC,MAAD,EAASC,GAAT,EAAiB;AACzC,WACC;AACC,MAAA,GAAG,EAAED,MAAM,CAACE,EADb;AAEC,MAAA,SAAS,EAAE,4BAAG,oBAAH,EAAyB;AACnC,8CAAsCN,gBAAgB,KAAKK;AADxB,OAAzB;AAFZ,OAMC,gCAAC,kBAAD;AACC,MAAA,WAAW,EAAEP,IAAI,KAAK,UADvB,CAEC;AACA;AACA;AACA;AALD;AAMC,MAAA,MAAM,EAAGM;AANV,OAOKA,MAPL;AAQC,MAAA,IAAI,EACHN,IAAI,KAAK,UAAT,GACGS,oBAAYC,MADf,GAEGV,IAAI,KAAK,WAAT,GACAS,oBAAYE,SADZ,GAEAL,MAAM,CAACN,IAbZ;AAeC,MAAA,QAAQ,EAAEG;AAfX,OAND,CADD;AA0BA,GA3BA,CADF,CADD;AAgCA,CA9CD;;AAgDAR,WAAW,CAACiB,YAAZ,GAA2B;AAC1BZ,EAAAA,IAAI,EAAE,SADoB;AAE1BC,EAAAA,WAAW,EAAE,KAFa;AAG1BC,EAAAA,gBAAgB,EAAE,CAAC;AAHO,CAA3B;eAMeP,W","sourcesContent":["import { IHWAction, IHWButtonGroup } from '@sprucelabs/spruce-types'\nimport cx from 'classnames'\nimport React from 'react'\nimport Button, { ButtonKinds, Action } from '../Button/Button'\nimport { unionArray } from '../..'\n\nexport interface IButtonGroupProps extends Omit<IHWButtonGroup, 'actions'> {\n\t/** Array of actions to render the group's buttons. */\n\tactions: Action[]\n\n\t/** optional, provide a handler for Actions */\n\tonAction?: (action: IHWAction) => any\n}\n\nconst ButtonGroup = (\n\tprops: IButtonGroupProps | IHWButtonGroup\n): React.ReactElement => {\n\tconst reactHeartwoodProps = props as IButtonGroupProps\n\tconst commonProps = props as IHWButtonGroup\n\n\tconst { actions, kind, isFullWidth, highlightedIndex } = commonProps\n\tconst { onAction } = reactHeartwoodProps\n\n\tconst parentClass = cx('button-group', {\n\t\t'button-group-segmented': kind === 'segmented',\n\t\t'button-group-floating': kind === 'floating',\n\t\t'button-group--is-full-width': isFullWidth\n\t})\n\treturn (\n\t\t<ul className={parentClass}>\n\t\t\t{unionArray(actions).map((action, idx) => {\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tkey={action.id}\n\t\t\t\t\t\tclassName={cx('button-group__item', {\n\t\t\t\t\t\t\t'button-group__item--is-highlighted': highlightedIndex === idx\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tisFullWidth={kind === 'floating'}\n\t\t\t\t\t\t\t// TODO: This is necessary since the older \"action\" interface\n\t\t\t\t\t\t\t// (meaning a button) doesn't work with the newer IHWAction\n\t\t\t\t\t\t\t// interface. We need to refactor the legacy case broadly to\n\t\t\t\t\t\t\t// remove this.\n\t\t\t\t\t\t\taction={(action as unknown) as IHWAction}\n\t\t\t\t\t\t\t{...action}\n\t\t\t\t\t\t\tkind={\n\t\t\t\t\t\t\t\tkind === 'floating'\n\t\t\t\t\t\t\t\t\t? ButtonKinds.Simple\n\t\t\t\t\t\t\t\t\t: kind === 'segmented'\n\t\t\t\t\t\t\t\t\t? ButtonKinds.Secondary\n\t\t\t\t\t\t\t\t\t: action.kind\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonAction={onAction}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t)\n\t\t\t})}\n\t\t</ul>\n\t)\n}\n\nButtonGroup.defaultProps = {\n\tkind: 'default',\n\tisFullWidth: false,\n\thighlightedIndex: -1\n}\n\nexport default ButtonGroup\n"],"file":"ButtonGroup.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card-story.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card-story.tsx"],"names":[],"mappings":""}
|