@artsy/palette 41.8.1 → 42.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Theme.d.ts +2 -70
- package/dist/Theme.js +3 -6
- package/dist/Theme.js.map +1 -1
- package/dist/elements/AutocompleteInput/AutocompleteInput.js +3 -4
- package/dist/elements/AutocompleteInput/AutocompleteInput.js.map +1 -1
- package/dist/elements/AutocompleteInput/AutocompleteInput.story.js +8 -14
- package/dist/elements/AutocompleteInput/AutocompleteInput.story.js.map +1 -1
- package/dist/elements/AutocompleteInput/AutocompleteInputOption.js +1 -2
- package/dist/elements/AutocompleteInput/AutocompleteInputOption.js.map +1 -1
- package/dist/elements/AutocompleteInput/AutocompleteInputOptionLabel.js +1 -2
- package/dist/elements/AutocompleteInput/AutocompleteInputOptionLabel.js.map +1 -1
- package/dist/elements/Avatar/Avatar.js +3 -4
- package/dist/elements/Avatar/Avatar.js.map +1 -1
- package/dist/elements/Avatar/Avatar.story.js +5 -10
- package/dist/elements/Avatar/Avatar.story.js.map +1 -1
- package/dist/elements/Banner/Banner.d.ts +1 -1
- package/dist/elements/Banner/Banner.js +4 -6
- package/dist/elements/Banner/Banner.js.map +1 -1
- package/dist/elements/Banner/Banner.story.js +2 -4
- package/dist/elements/Banner/Banner.story.js.map +1 -1
- package/dist/elements/BaseTabs/BaseTab.d.ts +9 -9
- package/dist/elements/BaseTabs/BaseTab.js +1 -2
- package/dist/elements/BaseTabs/BaseTab.js.map +1 -1
- package/dist/elements/BaseTabs/BaseTabs.d.ts +1 -1
- package/dist/elements/BaseTabs/BaseTabs.js +1 -2
- package/dist/elements/BaseTabs/BaseTabs.js.map +1 -1
- package/dist/elements/BaseTabs/BaseTabs.story.js +10 -20
- package/dist/elements/BaseTabs/BaseTabs.story.js.map +1 -1
- package/dist/elements/BaseTabs/tokens.js +1 -2
- package/dist/elements/BaseTabs/tokens.js.map +1 -1
- package/dist/elements/BorderBox/BorderBox.d.ts +2 -3
- package/dist/elements/BorderBox/BorderBox.js +1 -2
- package/dist/elements/BorderBox/BorderBox.js.map +1 -1
- package/dist/elements/BorderBox/BorderBoxBase.d.ts +1 -2
- package/dist/elements/BorderBox/BorderBoxBase.js +1 -2
- package/dist/elements/BorderBox/BorderBoxBase.js.map +1 -1
- package/dist/elements/BorderedRadio/BorderedRadio.d.ts +1 -2
- package/dist/elements/BorderedRadio/BorderedRadio.js +1 -2
- package/dist/elements/BorderedRadio/BorderedRadio.js.map +1 -1
- package/dist/elements/BorderedRadio/BorderedRadio.story.js +2 -4
- package/dist/elements/BorderedRadio/BorderedRadio.story.js.map +1 -1
- package/dist/elements/Box/Box.d.ts +1 -2
- package/dist/elements/Box/Box.js +5 -8
- package/dist/elements/Box/Box.js.map +1 -1
- package/dist/elements/Box/Box.story.js +2 -4
- package/dist/elements/Box/Box.story.js.map +1 -1
- package/dist/elements/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/elements/Breadcrumbs/Breadcrumbs.js +1 -2
- package/dist/elements/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/elements/Breadcrumbs/Breadcrumbs.story.js +2 -4
- package/dist/elements/Breadcrumbs/Breadcrumbs.story.js.map +1 -1
- package/dist/elements/Button/Button.js +2 -4
- package/dist/elements/Button/Button.js.map +1 -1
- package/dist/elements/Button/Button.story.js +12 -22
- package/dist/elements/Button/Button.story.js.map +1 -1
- package/dist/elements/Button/tokens.d.ts +1 -1
- package/dist/elements/Button/tokens.js +4 -8
- package/dist/elements/Button/tokens.js.map +1 -1
- package/dist/elements/Button/types.d.ts +3 -3
- package/dist/elements/Button/types.js +5 -6
- package/dist/elements/Button/types.js.map +1 -1
- package/dist/elements/CSSGrid/CSSGrid.d.ts +1 -2
- package/dist/elements/CSSGrid/CSSGrid.js +1 -2
- package/dist/elements/CSSGrid/CSSGrid.js.map +1 -1
- package/dist/elements/CSSGrid/CSSGrid.story.js +2 -4
- package/dist/elements/CSSGrid/CSSGrid.story.js.map +1 -1
- package/dist/elements/Cards/Card.js +1 -2
- package/dist/elements/Cards/Card.js.map +1 -1
- package/dist/elements/Cards/Cards.story.js +3 -6
- package/dist/elements/Cards/Cards.story.js.map +1 -1
- package/dist/elements/Cards/TriptychCard.d.ts +1 -1
- package/dist/elements/Cards/TriptychCard.js +4 -5
- package/dist/elements/Cards/TriptychCard.js.map +1 -1
- package/dist/elements/Carousel/Carousel.d.ts +4 -4
- package/dist/elements/Carousel/Carousel.js +6 -10
- package/dist/elements/Carousel/Carousel.js.map +1 -1
- package/dist/elements/Carousel/Carousel.story.js +21 -40
- package/dist/elements/Carousel/Carousel.story.js.map +1 -1
- package/dist/elements/Carousel/CarouselNavigation.d.ts +7 -8
- package/dist/elements/Carousel/CarouselNavigation.js +2 -4
- package/dist/elements/Carousel/CarouselNavigation.js.map +1 -1
- package/dist/elements/Carousel/paginate.d.ts +2 -2
- package/dist/elements/Carousel/paginate.js +5 -7
- package/dist/elements/Carousel/paginate.js.map +1 -1
- package/dist/elements/CarouselBar/CarouselBar.d.ts +1 -1
- package/dist/elements/CarouselBar/CarouselBar.js +1 -2
- package/dist/elements/CarouselBar/CarouselBar.js.map +1 -1
- package/dist/elements/CarouselBar/CarouselBar.story.js +2 -4
- package/dist/elements/CarouselBar/CarouselBar.story.js.map +1 -1
- package/dist/elements/Checkbox/Check.js +1 -2
- package/dist/elements/Checkbox/Check.js.map +1 -1
- package/dist/elements/Checkbox/Check.story.js +2 -4
- package/dist/elements/Checkbox/Check.story.js.map +1 -1
- package/dist/elements/Checkbox/Checkbox.js +1 -2
- package/dist/elements/Checkbox/Checkbox.js.map +1 -1
- package/dist/elements/Checkbox/Checkbox.story.js +6 -10
- package/dist/elements/Checkbox/Checkbox.story.js.map +1 -1
- package/dist/elements/Checkbox/tokens.js +2 -4
- package/dist/elements/Checkbox/tokens.js.map +1 -1
- package/dist/elements/CleanTag/CleanTag.d.ts +1 -1
- package/dist/elements/CleanTag/CleanTag.js +4 -7
- package/dist/elements/CleanTag/CleanTag.js.map +1 -1
- package/dist/elements/Clickable/Clickable.d.ts +2 -2
- package/dist/elements/Clickable/Clickable.js +2 -4
- package/dist/elements/Clickable/Clickable.js.map +1 -1
- package/dist/elements/Clickable/Clickable.story.js +5 -8
- package/dist/elements/Clickable/Clickable.story.js.map +1 -1
- package/dist/elements/Collapse/Collapse.js +38 -29
- package/dist/elements/Collapse/Collapse.js.map +1 -1
- package/dist/elements/Drawer/Drawer.js +1 -2
- package/dist/elements/Drawer/Drawer.js.map +1 -1
- package/dist/elements/Drawer/Drawer.story.js +5 -8
- package/dist/elements/Drawer/Drawer.story.js.map +1 -1
- package/dist/elements/Dropdown/Dropdown.d.ts +1 -1
- package/dist/elements/Dropdown/Dropdown.js +3 -4
- package/dist/elements/Dropdown/Dropdown.js.map +1 -1
- package/dist/elements/Dropdown/Dropdown.story.js +11 -20
- package/dist/elements/Dropdown/Dropdown.story.js.map +1 -1
- package/dist/elements/EntityHeader/EntityHeader.js +1 -2
- package/dist/elements/EntityHeader/EntityHeader.js.map +1 -1
- package/dist/elements/EntityHeader/EntityHeader.story.js +2 -4
- package/dist/elements/EntityHeader/EntityHeader.story.js.map +1 -1
- package/dist/elements/Expandable/Expandable.d.ts +1 -1
- package/dist/elements/Expandable/Expandable.js +3 -4
- package/dist/elements/Expandable/Expandable.js.map +1 -1
- package/dist/elements/Expandable/Expandable.story.js +3 -6
- package/dist/elements/Expandable/Expandable.story.js.map +1 -1
- package/dist/elements/FilterSelect/Components/FilterInput.d.ts +1 -1
- package/dist/elements/FilterSelect/Components/FilterInput.js +4 -4
- package/dist/elements/FilterSelect/Components/FilterInput.js.map +1 -1
- package/dist/elements/FilterSelect/Components/FilterSelectContext.d.ts +2 -2
- package/dist/elements/FilterSelect/Components/FilterSelectContext.js +4 -6
- package/dist/elements/FilterSelect/Components/FilterSelectContext.js.map +1 -1
- package/dist/elements/FilterSelect/Components/FilterSelectResultItem.js +1 -2
- package/dist/elements/FilterSelect/Components/FilterSelectResultItem.js.map +1 -1
- package/dist/elements/FilterSelect/FilterSelect.d.ts +1 -1
- package/dist/elements/FilterSelect/FilterSelect.js +3 -5
- package/dist/elements/FilterSelect/FilterSelect.js.map +1 -1
- package/dist/elements/FilterSelect/FilterSelect.story.js +2 -4
- package/dist/elements/FilterSelect/FilterSelect.story.js.map +1 -1
- package/dist/elements/Flex/Flex.d.ts +2 -3
- package/dist/elements/Flex/Flex.js +1 -2
- package/dist/elements/Flex/Flex.js.map +1 -1
- package/dist/elements/FullBleed/FullBleed.d.ts +2 -3
- package/dist/elements/FullBleed/FullBleed.js +1 -2
- package/dist/elements/FullBleed/FullBleed.js.map +1 -1
- package/dist/elements/FullBleed/FullBleed.story.js +2 -4
- package/dist/elements/FullBleed/FullBleed.story.js.map +1 -1
- package/dist/elements/GridColumns/GridColumns.d.ts +4 -4
- package/dist/elements/GridColumns/GridColumns.js +2 -4
- package/dist/elements/GridColumns/GridColumns.js.map +1 -1
- package/dist/elements/GridColumns/GridColumns.story.js +4 -8
- package/dist/elements/GridColumns/GridColumns.story.js.map +1 -1
- package/dist/elements/GridColumns/calculateGridColumn.d.ts +2 -2
- package/dist/elements/GridColumns/calculateGridColumn.js +5 -10
- package/dist/elements/GridColumns/calculateGridColumn.js.map +1 -1
- package/dist/elements/HTML/HTML.d.ts +1 -1
- package/dist/elements/HTML/HTML.js +2 -4
- package/dist/elements/HTML/HTML.js.map +1 -1
- package/dist/elements/HTML/HTML.story.js +3 -6
- package/dist/elements/HTML/HTML.story.js.map +1 -1
- package/dist/elements/HorizontalOverflow/HorizontalOverflow.d.ts +1 -1
- package/dist/elements/HorizontalOverflow/HorizontalOverflow.js +3 -4
- package/dist/elements/HorizontalOverflow/HorizontalOverflow.js.map +1 -1
- package/dist/elements/HorizontalOverflow/HorizontalOverflow.story.js +3 -6
- package/dist/elements/HorizontalOverflow/HorizontalOverflow.story.js.map +1 -1
- package/dist/elements/Image/Image.js +3 -4
- package/dist/elements/Image/Image.js.map +1 -1
- package/dist/elements/Image/Image.story.js +8 -16
- package/dist/elements/Image/Image.story.js.map +1 -1
- package/dist/elements/Input/Input.js +3 -4
- package/dist/elements/Input/Input.js.map +1 -1
- package/dist/elements/Input/Input.story.js +8 -14
- package/dist/elements/Input/Input.story.js.map +1 -1
- package/dist/elements/Input/tokens.js +1 -2
- package/dist/elements/Input/tokens.js.map +1 -1
- package/dist/elements/Input/types.d.ts +1 -1
- package/dist/elements/Join/Join.js +1 -2
- package/dist/elements/Join/Join.js.map +1 -1
- package/dist/elements/Join/Join.story.js +27 -24
- package/dist/elements/Join/Join.story.js.map +1 -1
- package/dist/elements/Label/Label.d.ts +1 -1
- package/dist/elements/Label/Label.js +2 -4
- package/dist/elements/Label/Label.js.map +1 -1
- package/dist/elements/Label/Label.story.js +3 -6
- package/dist/elements/Label/Label.story.js.map +1 -1
- package/dist/elements/LabeledInput/LabeledInput.js +3 -4
- package/dist/elements/LabeledInput/LabeledInput.js.map +1 -1
- package/dist/elements/LabeledInput/LabeledInput.story.js +6 -10
- package/dist/elements/LabeledInput/LabeledInput.story.js.map +1 -1
- package/dist/elements/Link/Link.d.ts +0 -1
- package/dist/elements/Link/Link.js +1 -2
- package/dist/elements/Link/Link.js.map +1 -1
- package/dist/elements/Marquee/Marquee.js +3 -4
- package/dist/elements/Marquee/Marquee.js.map +1 -1
- package/dist/elements/Marquee/Marquee.story.js +2 -4
- package/dist/elements/Marquee/Marquee.story.js.map +1 -1
- package/dist/elements/Message/Message.d.ts +1 -1
- package/dist/elements/Message/Message.js +2 -4
- package/dist/elements/Message/Message.js.map +1 -1
- package/dist/elements/Message/Message.story.js +3 -5
- package/dist/elements/Message/Message.story.js.map +1 -1
- package/dist/elements/Modal/ModalBase.d.ts +1 -1
- package/dist/elements/Modal/ModalBase.js +5 -8
- package/dist/elements/Modal/ModalBase.js.map +1 -1
- package/dist/elements/Modal/ModalBase.story.js +7 -12
- package/dist/elements/Modal/ModalBase.story.js.map +1 -1
- package/dist/elements/ModalDialog/ModalDialog.d.ts +1 -1
- package/dist/elements/ModalDialog/ModalDialog.js +3 -4
- package/dist/elements/ModalDialog/ModalDialog.js.map +1 -1
- package/dist/elements/ModalDialog/ModalDialog.story.js +4 -6
- package/dist/elements/ModalDialog/ModalDialog.story.js.map +1 -1
- package/dist/elements/ModalDialog/ModalDialogContent.d.ts +1 -1
- package/dist/elements/ModalDialog/ModalDialogContent.js +2 -4
- package/dist/elements/ModalDialog/ModalDialogContent.js.map +1 -1
- package/dist/elements/ModalDialog/ModalDialogContent.story.js +2 -4
- package/dist/elements/ModalDialog/ModalDialogContent.story.js.map +1 -1
- package/dist/elements/MultiSelect/MultiSelect.js +3 -4
- package/dist/elements/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/elements/MultiSelect/MultiSelect.story.js +5 -8
- package/dist/elements/MultiSelect/MultiSelect.story.js.map +1 -1
- package/dist/elements/MultiSelect/tokens.js +1 -2
- package/dist/elements/MultiSelect/tokens.js.map +1 -1
- package/dist/elements/Pagination/Pagination.js +3 -6
- package/dist/elements/Pagination/Pagination.js.map +1 -1
- package/dist/elements/Pagination/Pagination.story.js +3 -6
- package/dist/elements/Pagination/Pagination.story.js.map +1 -1
- package/dist/elements/PasswordInput/PasswordInput.js +3 -4
- package/dist/elements/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/elements/PasswordInput/PasswordInput.story.js +2 -4
- package/dist/elements/PasswordInput/PasswordInput.story.js.map +1 -1
- package/dist/elements/PhoneInput/PhoneInput.js +3 -4
- package/dist/elements/PhoneInput/PhoneInput.js.map +1 -1
- package/dist/elements/PhoneInput/PhoneInput.story.js +2 -4
- package/dist/elements/PhoneInput/PhoneInput.story.js.map +1 -1
- package/dist/elements/PhoneInput/tokens.js +1 -2
- package/dist/elements/PhoneInput/tokens.js.map +1 -1
- package/dist/elements/Pill/Pill.d.ts +3 -3
- package/dist/elements/Pill/Pill.js +3 -4
- package/dist/elements/Pill/Pill.js.map +1 -1
- package/dist/elements/Pill/Pill.story.js +12 -22
- package/dist/elements/Pill/Pill.story.js.map +1 -1
- package/dist/elements/Pill/tokens.js +1 -2
- package/dist/elements/Pill/tokens.js.map +1 -1
- package/dist/elements/Pointer/Pointer.d.ts +1 -1
- package/dist/elements/Pointer/Pointer.js +3 -4
- package/dist/elements/Pointer/Pointer.js.map +1 -1
- package/dist/elements/Popover/Popover.d.ts +1 -1
- package/dist/elements/Popover/Popover.js +4 -6
- package/dist/elements/Popover/Popover.js.map +1 -1
- package/dist/elements/Popover/Popover.story.js +6 -12
- package/dist/elements/Popover/Popover.story.js.map +1 -1
- package/dist/elements/ProgressBar/ProgressBar.js +1 -2
- package/dist/elements/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/elements/ProgressBar/ProgressBar.story.js +5 -8
- package/dist/elements/ProgressBar/ProgressBar.story.js.map +1 -1
- package/dist/elements/ProgressDots/ProgressDots.d.ts +1 -1
- package/dist/elements/ProgressDots/ProgressDots.js +1 -2
- package/dist/elements/ProgressDots/ProgressDots.js.map +1 -1
- package/dist/elements/ProgressDots/ProgressDots.story.js +5 -8
- package/dist/elements/ProgressDots/ProgressDots.story.js.map +1 -1
- package/dist/elements/Radio/Radio.js +1 -2
- package/dist/elements/Radio/Radio.js.map +1 -1
- package/dist/elements/Radio/Radio.story.js +3 -6
- package/dist/elements/Radio/Radio.story.js.map +1 -1
- package/dist/elements/Radio/RadioDot.d.ts +1 -2
- package/dist/elements/Radio/RadioDot.js +1 -2
- package/dist/elements/Radio/RadioDot.js.map +1 -1
- package/dist/elements/Radio/tokens.js +3 -6
- package/dist/elements/Radio/tokens.js.map +1 -1
- package/dist/elements/RadioGroup/RadioGroup.js +37 -28
- package/dist/elements/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/elements/RadioGroup/RadioGroup.story.js +6 -10
- package/dist/elements/RadioGroup/RadioGroup.story.js.map +1 -1
- package/dist/elements/Range/Range.js +11 -12
- package/dist/elements/Range/Range.js.map +1 -1
- package/dist/elements/Range/Range.story.js +7 -12
- package/dist/elements/Range/Range.story.js.map +1 -1
- package/dist/elements/ReadMore/ReadMore.js +3 -4
- package/dist/elements/ReadMore/ReadMore.js.map +1 -1
- package/dist/elements/ReadMore/ReadMore.story.js +9 -18
- package/dist/elements/ReadMore/ReadMore.story.js.map +1 -1
- package/dist/elements/ResponsiveBox/ResponsiveBox.d.ts +2 -2
- package/dist/elements/ResponsiveBox/ResponsiveBox.js +1 -2
- package/dist/elements/ResponsiveBox/ResponsiveBox.js.map +1 -1
- package/dist/elements/ResponsiveBox/ResponsiveBox.story.js +6 -10
- package/dist/elements/ResponsiveBox/ResponsiveBox.story.js.map +1 -1
- package/dist/elements/Select/Select.js +4 -6
- package/dist/elements/Select/Select.js.map +1 -1
- package/dist/elements/Select/Select.story.js +2 -4
- package/dist/elements/Select/Select.story.js.map +1 -1
- package/dist/elements/Select/tokens.js +1 -2
- package/dist/elements/Select/tokens.js.map +1 -1
- package/dist/elements/Select/types.d.ts +1 -1
- package/dist/elements/Separator/Separator.d.ts +0 -1
- package/dist/elements/Separator/Separator.js +1 -2
- package/dist/elements/Separator/Separator.js.map +1 -1
- package/dist/elements/Separator/Separator.story.js +2 -4
- package/dist/elements/Separator/Separator.story.js.map +1 -1
- package/dist/elements/Shelf/Shelf.d.ts +1 -1
- package/dist/elements/Shelf/Shelf.js +3 -4
- package/dist/elements/Shelf/Shelf.js.map +1 -1
- package/dist/elements/Shelf/Shelf.story.js +7 -12
- package/dist/elements/Shelf/Shelf.story.js.map +1 -1
- package/dist/elements/Shelf/ShelfNavigation.js +2 -4
- package/dist/elements/Shelf/ShelfNavigation.js.map +1 -1
- package/dist/elements/Shelf/ShelfScrollBar.js +4 -6
- package/dist/elements/Shelf/ShelfScrollBar.js.map +1 -1
- package/dist/elements/Shelf/useClickScroll.d.ts +0 -1
- package/dist/elements/Shelf/useClickScroll.js +1 -2
- package/dist/elements/Shelf/useClickScroll.js.map +1 -1
- package/dist/elements/Shelf/useDragScroll.d.ts +0 -1
- package/dist/elements/Shelf/useDragScroll.js +1 -2
- package/dist/elements/Shelf/useDragScroll.js.map +1 -1
- package/dist/elements/ShowMore/ShowMore.js +4 -6
- package/dist/elements/ShowMore/ShowMore.js.map +1 -1
- package/dist/elements/ShowMore/ShowMore.story.js +3 -6
- package/dist/elements/ShowMore/ShowMore.story.js.map +1 -1
- package/dist/elements/Skeleton/Skeleton.d.ts +4 -4
- package/dist/elements/Skeleton/Skeleton.js +5 -8
- package/dist/elements/Skeleton/Skeleton.js.map +1 -1
- package/dist/elements/Skeleton/Skeleton.story.js +5 -10
- package/dist/elements/Skeleton/Skeleton.story.js.map +1 -1
- package/dist/elements/Skip/Skip.d.ts +1 -1
- package/dist/elements/Skip/Skip.js +1 -2
- package/dist/elements/Skip/Skip.js.map +1 -1
- package/dist/elements/Skip/Skip.story.js +4 -8
- package/dist/elements/Skip/Skip.story.js.map +1 -1
- package/dist/elements/Spacer/Spacer.d.ts +1 -1
- package/dist/elements/Spacer/Spacer.js +1 -2
- package/dist/elements/Spacer/Spacer.js.map +1 -1
- package/dist/elements/Spacer/Spacer.story.js +3 -5
- package/dist/elements/Spacer/Spacer.story.js.map +1 -1
- package/dist/elements/Spinner/Spinner.d.ts +1 -1
- package/dist/elements/Spinner/Spinner.js +3 -4
- package/dist/elements/Spinner/Spinner.js.map +1 -1
- package/dist/elements/Spinner/Spinner.story.js +4 -8
- package/dist/elements/Spinner/Spinner.story.js.map +1 -1
- package/dist/elements/Stack/Stack.d.ts +2 -3
- package/dist/elements/Stack/Stack.js +1 -2
- package/dist/elements/Stack/Stack.js.map +1 -1
- package/dist/elements/Stack/Stack.story.js +2 -4
- package/dist/elements/Stack/Stack.story.js.map +1 -1
- package/dist/elements/StackableBorderBox/StackableBorderBox.d.ts +2 -3
- package/dist/elements/StackableBorderBox/StackableBorderBox.js +1 -2
- package/dist/elements/StackableBorderBox/StackableBorderBox.js.map +1 -1
- package/dist/elements/StackableBorderBox/StackableBorderBox.story.js +2 -4
- package/dist/elements/StackableBorderBox/StackableBorderBox.story.js.map +1 -1
- package/dist/elements/Stepper/Stepper.d.ts +1 -1
- package/dist/elements/Stepper/Stepper.js +3 -4
- package/dist/elements/Stepper/Stepper.js.map +1 -1
- package/dist/elements/Stepper/Stepper.story.js +5 -8
- package/dist/elements/Stepper/Stepper.story.js.map +1 -1
- package/dist/elements/Sup/Sup.d.ts +9 -10
- package/dist/elements/Sup/Sup.js +1 -2
- package/dist/elements/Sup/Sup.js.map +1 -1
- package/dist/elements/Sup/Sup.story.js +2 -4
- package/dist/elements/Sup/Sup.story.js.map +1 -1
- package/dist/elements/Swiper/Swiper.d.ts +8 -8
- package/dist/elements/Swiper/Swiper.js +4 -6
- package/dist/elements/Swiper/Swiper.js.map +1 -1
- package/dist/elements/Swiper/Swiper.story.js +15 -28
- package/dist/elements/Swiper/Swiper.story.js.map +1 -1
- package/dist/elements/Swiper/activeIndex.js +1 -2
- package/dist/elements/Swiper/activeIndex.js.map +1 -1
- package/dist/elements/Swiper/percentage.js +1 -2
- package/dist/elements/Swiper/percentage.js.map +1 -1
- package/dist/elements/Tabs/Tabs.js +5 -8
- package/dist/elements/Tabs/Tabs.js.map +1 -1
- package/dist/elements/Tabs/Tabs.story.js +11 -20
- package/dist/elements/Tabs/Tabs.story.js.map +1 -1
- package/dist/elements/Text/Text.d.ts +4 -5
- package/dist/elements/Text/Text.js +5 -8
- package/dist/elements/Text/Text.js.map +1 -1
- package/dist/elements/Text/Text.story.js +7 -12
- package/dist/elements/Text/Text.story.js.map +1 -1
- package/dist/elements/TextArea/TextArea.js +3 -4
- package/dist/elements/TextArea/TextArea.js.map +1 -1
- package/dist/elements/TextArea/TextArea.story.js +3 -6
- package/dist/elements/TextArea/TextArea.story.js.map +1 -1
- package/dist/elements/TextArea/tokens.js +1 -2
- package/dist/elements/TextArea/tokens.js.map +1 -1
- package/dist/elements/TextArea/types.d.ts +1 -1
- package/dist/elements/Toasts/Toast.d.ts +1 -1
- package/dist/elements/Toasts/Toast.js +2 -4
- package/dist/elements/Toasts/Toast.js.map +1 -1
- package/dist/elements/Toasts/Toast.story.js +2 -4
- package/dist/elements/Toasts/Toast.story.js.map +1 -1
- package/dist/elements/Toasts/Toasts.js +1 -2
- package/dist/elements/Toasts/Toasts.js.map +1 -1
- package/dist/elements/Toasts/Toasts.story.js +4 -6
- package/dist/elements/Toasts/Toasts.story.js.map +1 -1
- package/dist/elements/Toasts/useToasts.d.ts +2 -2
- package/dist/elements/Toasts/useToasts.js +5 -8
- package/dist/elements/Toasts/useToasts.js.map +1 -1
- package/dist/elements/Toggle/Toggle.js +1 -2
- package/dist/elements/Toggle/Toggle.js.map +1 -1
- package/dist/elements/Toggle/Toggle.story.js +5 -8
- package/dist/elements/Toggle/Toggle.story.js.map +1 -1
- package/dist/elements/Toggle/tokens.js +2 -4
- package/dist/elements/Toggle/tokens.js.map +1 -1
- package/dist/elements/Tooltip/Tooltip.d.ts +1 -1
- package/dist/elements/Tooltip/Tooltip.js +4 -6
- package/dist/elements/Tooltip/Tooltip.js.map +1 -1
- package/dist/elements/Tooltip/Tooltip.story.js +11 -20
- package/dist/elements/Tooltip/Tooltip.story.js.map +1 -1
- package/dist/elements/VisuallyHidden/VisuallyHidden.d.ts +1 -2
- package/dist/elements/VisuallyHidden/VisuallyHidden.js +3 -6
- package/dist/elements/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/helpers/color.js +1 -2
- package/dist/helpers/color.js.map +1 -1
- package/dist/helpers/flattenChildren.d.ts +1 -1
- package/dist/helpers/flattenChildren.js +3 -4
- package/dist/helpers/flattenChildren.js.map +1 -1
- package/dist/helpers/injectGlobalStyles.d.ts +0 -1
- package/dist/helpers/isText.js +3 -4
- package/dist/helpers/isText.js.map +1 -1
- package/dist/helpers/media.d.ts +1 -1
- package/dist/helpers/media.js +3 -4
- package/dist/helpers/media.js.map +1 -1
- package/dist/helpers/space.js +1 -2
- package/dist/helpers/space.js.map +1 -1
- package/dist/helpers/transition.js +1 -2
- package/dist/helpers/transition.js.map +1 -1
- package/dist/helpers/visuallyDisableScrollbar.js +1 -2
- package/dist/helpers/visuallyDisableScrollbar.js.map +1 -1
- package/dist/shared/RequiredField.js +1 -2
- package/dist/shared/RequiredField.js.map +1 -1
- package/dist/themes/Themes.story.js +12 -22
- package/dist/themes/Themes.story.js.map +1 -1
- package/dist/utils/FocusLocking.story.js +6 -10
- package/dist/utils/FocusLocking.story.js.map +1 -1
- package/dist/utils/remapValue.d.ts +1 -1
- package/dist/utils/remapValue.js +1 -2
- package/dist/utils/remapValue.js.map +1 -1
- package/dist/utils/splitProps.d.ts +1 -1
- package/dist/utils/splitProps.js +6 -6
- package/dist/utils/splitProps.js.map +1 -1
- package/dist/utils/useClickOutside.d.ts +0 -1
- package/dist/utils/useClickOutside.js +1 -2
- package/dist/utils/useClickOutside.js.map +1 -1
- package/dist/utils/useContainsFocus.d.ts +0 -1
- package/dist/utils/useContainsFocus.js +1 -2
- package/dist/utils/useContainsFocus.js.map +1 -1
- package/dist/utils/useDidMount.d.ts +2 -2
- package/dist/utils/useDidMount.js +3 -4
- package/dist/utils/useDidMount.js.map +1 -1
- package/dist/utils/useIsomorphicLayoutEffect.js +1 -2
- package/dist/utils/useIsomorphicLayoutEffect.js.map +1 -1
- package/dist/utils/useLatest.d.ts +1 -2
- package/dist/utils/useLatest.js +1 -2
- package/dist/utils/useLatest.js.map +1 -1
- package/dist/utils/useMutationObserver.d.ts +1 -1
- package/dist/utils/useMutationObserver.js +1 -2
- package/dist/utils/useMutationObserver.js.map +1 -1
- package/dist/utils/usePortal.js +1 -2
- package/dist/utils/usePortal.js.map +1 -1
- package/dist/utils/usePosition.d.ts +8 -9
- package/dist/utils/usePosition.js +10 -18
- package/dist/utils/usePosition.js.map +1 -1
- package/dist/utils/useResizeObserver.d.ts +2 -3
- package/dist/utils/useResizeObserver.js +3 -5
- package/dist/utils/useResizeObserver.js.map +1 -1
- package/dist/utils/useSentinelVisibility.js +3 -4
- package/dist/utils/useSentinelVisibility.js.map +1 -1
- package/dist/utils/useUpdateEffect.js +1 -2
- package/dist/utils/useUpdateEffect.js.map +1 -1
- package/dist/utils/useWidthOf.d.ts +0 -1
- package/dist/utils/useWidthOf.js +3 -4
- package/dist/utils/useWidthOf.js.map +1 -1
- package/package.json +26 -18
|
@@ -17,11 +17,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
17
17
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
18
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
19
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
20
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
21
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0)
|
|
20
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
21
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
22
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
23
|
/** ReadMore */
|
|
24
|
-
var ReadMore = function ReadMore(_ref) {
|
|
24
|
+
var ReadMore = exports.ReadMore = function ReadMore(_ref) {
|
|
25
25
|
var expandedHTML = _ref.content,
|
|
26
26
|
disabled = _ref.disabled,
|
|
27
27
|
_ref$inlineReadMoreLi = _ref.inlineReadMoreLink,
|
|
@@ -85,7 +85,6 @@ var ReadMore = function ReadMore(_ref) {
|
|
|
85
85
|
}
|
|
86
86
|
}, "Read more")));
|
|
87
87
|
};
|
|
88
|
-
exports.ReadMore = ReadMore;
|
|
89
88
|
ReadMore.displayName = "ReadMore";
|
|
90
89
|
var Container = _styledComponents.default.div.withConfig({
|
|
91
90
|
displayName: "ReadMore__Container",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadMore.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_truncHtml","_Clickable","_Text","_Box","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","ReadMore","_ref","expandedHTML","content","disabled","_ref$inlineReadMoreLi","inlineReadMoreLink","isExpanded","_ref$maxChars","maxChars","Infinity","onReadLessClicked","onReadMoreClicked","_useState","useState","_useState2","expanded","setExpanded","charCount","replace","HTML_TAG_REGEX","truncatedHTML","truncate","html","visible","handleClick","expandedState","createElement","dangerouslySetInnerHTML","__html","Container","Fragment","Box","Clickable","cursor","textDecoration","onClick","Text","variant","fontWeight","as","style","
|
|
1
|
+
{"version":3,"file":"ReadMore.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_truncHtml","_Clickable","_Text","_Box","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","ReadMore","exports","_ref","expandedHTML","content","disabled","_ref$inlineReadMoreLi","inlineReadMoreLink","isExpanded","_ref$maxChars","maxChars","Infinity","onReadLessClicked","onReadMoreClicked","_useState","useState","_useState2","expanded","setExpanded","charCount","replace","HTML_TAG_REGEX","truncatedHTML","truncate","html","visible","handleClick","expandedState","createElement","dangerouslySetInnerHTML","__html","Container","Fragment","Box","Clickable","cursor","textDecoration","onClick","Text","variant","fontWeight","as","style","displayName","styled","div","withConfig","componentId"],"sources":["../../../src/elements/ReadMore/ReadMore.tsx"],"sourcesContent":["import React, { useState } from \"react\"\nimport styled from \"styled-components\"\nimport truncate from \"trunc-html\"\nimport { Clickable } from \"../Clickable\"\nimport { Text } from \"../Text\"\nimport { Box } from \"../Box\"\n\nexport interface ReadMoreProps {\n content: string\n disabled?: boolean\n inlineReadMoreLink?: boolean\n isExpanded?: boolean\n maxChars?: number\n onReadLessClicked?: () => void\n onReadMoreClicked?: () => void\n}\n\n/** ReadMore */\nexport const ReadMore: React.FC<React.PropsWithChildren<ReadMoreProps>> = ({\n content: expandedHTML,\n disabled,\n inlineReadMoreLink = true,\n isExpanded,\n maxChars = Infinity,\n onReadLessClicked,\n onReadMoreClicked,\n}) => {\n const [expanded, setExpanded] = useState(!!isExpanded)\n\n if (typeof expandedHTML !== \"string\") return null\n\n const charCount = expandedHTML.replace(HTML_TAG_REGEX, \"\").length\n\n const truncatedHTML = truncate(expandedHTML, maxChars).html\n\n const visible = charCount > maxChars\n\n const handleClick = () => {\n if (disabled) return\n setExpanded((expandedState) => !expandedState)\n\n expanded\n ? onReadLessClicked && onReadLessClicked()\n : onReadMoreClicked && onReadMoreClicked()\n }\n\n if (!visible) {\n return (\n <span\n dangerouslySetInnerHTML={{\n __html: expandedHTML,\n }}\n />\n )\n }\n\n return (\n <Container aria-expanded={expanded}>\n {expanded ? (\n <>\n <Box dangerouslySetInnerHTML={{ __html: expandedHTML }} />\n\n <Clickable\n cursor=\"pointer\"\n textDecoration=\"underline\"\n onClick={handleClick}\n >\n <Text variant=\"xs\" fontWeight=\"bold\">\n Read less\n </Text>\n </Clickable>\n </>\n ) : (\n <Clickable onClick={handleClick}>\n {inlineReadMoreLink ? (\n <>\n <span dangerouslySetInnerHTML={{ __html: truncatedHTML }} />{\" \"}\n </>\n ) : (\n <Box dangerouslySetInnerHTML={{ __html: truncatedHTML }} />\n )}\n\n <Text\n as=\"span\"\n variant=\"xs\"\n fontWeight=\"bold\"\n style={{ textDecoration: \"underline\" }}\n >\n Read more\n </Text>\n </Clickable>\n )}\n </Container>\n )\n}\n\nconst Container = styled.div`\n > * > span > *:last-child {\n display: inherit;\n }\n`\n\nContainer.displayName = \"Container\"\n\nconst HTML_TAG_REGEX = /(<([^>]+)>)/gi\n"],"mappings":";;;;;;;AAAA,IAAAA,M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@@ -9,66 +9,60 @@ var _HTML = require("../HTML");
|
|
|
9
9
|
var _ReadMore = require("./ReadMore");
|
|
10
10
|
var _Box = require("../Box");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
var _default = {
|
|
12
|
+
var _default = exports.default = {
|
|
13
13
|
title: "Components/ReadMore"
|
|
14
14
|
};
|
|
15
|
-
exports.
|
|
16
|
-
var WithCharacterCap = function WithCharacterCap() {
|
|
15
|
+
var WithCharacterCap = exports.WithCharacterCap = function WithCharacterCap() {
|
|
17
16
|
return /*#__PURE__*/_react.default.createElement(_ReadMore.ReadMore, {
|
|
18
17
|
maxChars: 300,
|
|
19
18
|
content: "<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>"
|
|
20
19
|
});
|
|
21
20
|
};
|
|
22
|
-
exports.WithCharacterCap = WithCharacterCap;
|
|
23
21
|
WithCharacterCap.displayName = "WithCharacterCap";
|
|
24
22
|
WithCharacterCap.story = {
|
|
25
23
|
name: "With character cap"
|
|
26
24
|
};
|
|
27
|
-
var ShortContent = function ShortContent() {
|
|
25
|
+
var ShortContent = exports.ShortContent = function ShortContent() {
|
|
28
26
|
return /*#__PURE__*/_react.default.createElement(_ReadMore.ReadMore, {
|
|
29
27
|
maxChars: 300,
|
|
30
28
|
content: "<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>.\n </div>"
|
|
31
29
|
});
|
|
32
30
|
};
|
|
33
|
-
exports.ShortContent = ShortContent;
|
|
34
31
|
ShortContent.displayName = "ShortContent";
|
|
35
32
|
ShortContent.story = {
|
|
36
33
|
name: "Short content"
|
|
37
34
|
};
|
|
38
|
-
var AsString = function AsString() {
|
|
35
|
+
var AsString = exports.AsString = function AsString() {
|
|
39
36
|
return /*#__PURE__*/_react.default.createElement(_ReadMore.ReadMore, {
|
|
40
37
|
maxChars: 300,
|
|
41
38
|
content: "Donald Judd, widely regarded as one of the most significant American artists of the post-war period, is perhaps best-known for the large-scale outdoor installations and long, spacious interiors he designed in Marfa. Donald Judd, widely regarded as one of the most significant American artists of the post-war period, is perhaps best-known for the large-scale outdoor installations and long, spacious interiors he designed in Marfa."
|
|
42
39
|
});
|
|
43
40
|
};
|
|
44
|
-
exports.AsString = AsString;
|
|
45
41
|
AsString.displayName = "AsString";
|
|
46
42
|
AsString.story = {
|
|
47
43
|
name: "As string"
|
|
48
44
|
};
|
|
49
|
-
var CharacterCapWithHtml = function CharacterCapWithHtml() {
|
|
45
|
+
var CharacterCapWithHtml = exports.CharacterCapWithHtml = function CharacterCapWithHtml() {
|
|
50
46
|
return /*#__PURE__*/_react.default.createElement(_ReadMore.ReadMore, {
|
|
51
47
|
maxChars: 300,
|
|
52
48
|
content: "<p>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur adipisicing\n elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est temporibus\n labore sint aliquam, laudantium tempore. Tenetur adipisci cumque\n alias facilis animi. Illum.\n </p>"
|
|
53
49
|
});
|
|
54
50
|
};
|
|
55
|
-
exports.CharacterCapWithHtml = CharacterCapWithHtml;
|
|
56
51
|
CharacterCapWithHtml.displayName = "CharacterCapWithHtml";
|
|
57
52
|
CharacterCapWithHtml.story = {
|
|
58
53
|
name: "Character cap with HTML"
|
|
59
54
|
};
|
|
60
|
-
var WithCustomizableTypography = function WithCustomizableTypography() {
|
|
55
|
+
var WithCustomizableTypography = exports.WithCustomizableTypography = function WithCustomizableTypography() {
|
|
61
56
|
return /*#__PURE__*/_react.default.createElement(_HTML.HTML, null, /*#__PURE__*/_react.default.createElement(_ReadMore.ReadMore, {
|
|
62
57
|
maxChars: 300,
|
|
63
58
|
content: "\n <p>\n Donald Judd, widely regarded as one of the most significant\n American artists of <a href=\"#\">the post-war period</a>, is\n perhaps best-known for the large-scale outdoor installations and\n long, spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur\n adipisicing elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum\n assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est\n temporibus labore sint aliquam, laudantium tempore. Tenetur\n adipisci cumque alias facilis animi. Illum.\n </p>"
|
|
64
59
|
}));
|
|
65
60
|
};
|
|
66
|
-
exports.WithCustomizableTypography = WithCustomizableTypography;
|
|
67
61
|
WithCustomizableTypography.displayName = "WithCustomizableTypography";
|
|
68
62
|
WithCustomizableTypography.story = {
|
|
69
63
|
name: "With customizable typography"
|
|
70
64
|
};
|
|
71
|
-
var WithCustomizableTypography2 = function WithCustomizableTypography2() {
|
|
65
|
+
var WithCustomizableTypography2 = exports.WithCustomizableTypography2 = function WithCustomizableTypography2() {
|
|
72
66
|
return /*#__PURE__*/_react.default.createElement(_HTML.HTML, {
|
|
73
67
|
variant: "lg"
|
|
74
68
|
}, /*#__PURE__*/_react.default.createElement(_ReadMore.ReadMore, {
|
|
@@ -76,24 +70,22 @@ var WithCustomizableTypography2 = function WithCustomizableTypography2() {
|
|
|
76
70
|
content: "<p>\n Donald Judd, widely regarded as one of the most significant\n American artists of <a href=\"#\">the post-war period</a>, is\n perhaps best-known for the large-scale outdoor installations and\n long, spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur\n adipisicing elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum\n assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est\n temporibus labore sint aliquam, laudantium tempore. Tenetur\n adipisci cumque alias facilis animi. Illum.\n </p>"
|
|
77
71
|
}));
|
|
78
72
|
};
|
|
79
|
-
exports.WithCustomizableTypography2 = WithCustomizableTypography2;
|
|
80
73
|
WithCustomizableTypography2.displayName = "WithCustomizableTypography2";
|
|
81
74
|
WithCustomizableTypography2.story = {
|
|
82
75
|
name: "With customizable typography (2)"
|
|
83
76
|
};
|
|
84
|
-
var CharacterCapWithHtmlDisabled = function CharacterCapWithHtmlDisabled() {
|
|
77
|
+
var CharacterCapWithHtmlDisabled = exports.CharacterCapWithHtmlDisabled = function CharacterCapWithHtmlDisabled() {
|
|
85
78
|
return /*#__PURE__*/_react.default.createElement(_ReadMore.ReadMore, {
|
|
86
79
|
disabled: true,
|
|
87
80
|
maxChars: 300,
|
|
88
81
|
content: "<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>"
|
|
89
82
|
});
|
|
90
83
|
};
|
|
91
|
-
exports.CharacterCapWithHtmlDisabled = CharacterCapWithHtmlDisabled;
|
|
92
84
|
CharacterCapWithHtmlDisabled.displayName = "CharacterCapWithHtmlDisabled";
|
|
93
85
|
CharacterCapWithHtmlDisabled.story = {
|
|
94
86
|
name: "Character cap with html (disabled)"
|
|
95
87
|
};
|
|
96
|
-
var WithBottomReadMore = function WithBottomReadMore() {
|
|
88
|
+
var WithBottomReadMore = exports.WithBottomReadMore = function WithBottomReadMore() {
|
|
97
89
|
return /*#__PURE__*/_react.default.createElement(_Box.Box, {
|
|
98
90
|
textAlign: "center",
|
|
99
91
|
width: 600
|
|
@@ -105,7 +97,6 @@ var WithBottomReadMore = function WithBottomReadMore() {
|
|
|
105
97
|
content: "<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>"
|
|
106
98
|
})));
|
|
107
99
|
};
|
|
108
|
-
exports.WithBottomReadMore = WithBottomReadMore;
|
|
109
100
|
WithBottomReadMore.displayName = "WithBottomReadMore";
|
|
110
101
|
WithBottomReadMore.story = {
|
|
111
102
|
name: "With bottom placed 'Read More'"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadMore.story.js","names":["_react","_interopRequireDefault","require","_HTML","_ReadMore","_Box","obj","__esModule","default","_default","title","exports","WithCharacterCap","createElement","ReadMore","maxChars","content","displayName","story","name","ShortContent","AsString","CharacterCapWithHtml","WithCustomizableTypography","HTML","WithCustomizableTypography2","variant","CharacterCapWithHtmlDisabled","disabled","WithBottomReadMore","Box","textAlign","width","inlineReadMoreLink"],"sources":["../../../src/elements/ReadMore/ReadMore.story.tsx"],"sourcesContent":["import React from \"react\"\nimport { HTML } from \"../HTML\"\nimport { ReadMore } from \"./ReadMore\"\nimport { Box } from \"../Box\"\n\nexport default {\n title: \"Components/ReadMore\",\n}\n\nexport const WithCharacterCap = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>`}\n />\n )\n}\n\nWithCharacterCap.story = {\n name: \"With character cap\",\n}\n\nexport const ShortContent = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>.\n </div>`}\n />\n )\n}\n\nShortContent.story = {\n name: \"Short content\",\n}\n\nexport const AsString = () => {\n return (\n <ReadMore\n maxChars={300}\n content=\"Donald Judd, widely regarded as one of the most significant American artists of the post-war period, is perhaps best-known for the large-scale outdoor installations and long, spacious interiors he designed in Marfa. Donald Judd, widely regarded as one of the most significant American artists of the post-war period, is perhaps best-known for the large-scale outdoor installations and long, spacious interiors he designed in Marfa.\"\n />\n )\n}\n\nAsString.story = {\n name: \"As string\",\n}\n\nexport const CharacterCapWithHtml = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<p>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur adipisicing\n elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est temporibus\n labore sint aliquam, laudantium tempore. Tenetur adipisci cumque\n alias facilis animi. Illum.\n </p>`}\n />\n )\n}\n\nCharacterCapWithHtml.story = {\n name: \"Character cap with HTML\",\n}\n\nexport const WithCustomizableTypography = () => {\n return (\n <HTML>\n <ReadMore\n maxChars={300}\n content={`\n <p>\n Donald Judd, widely regarded as one of the most significant\n American artists of <a href=\"#\">the post-war period</a>, is\n perhaps best-known for the large-scale outdoor installations and\n long, spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur\n adipisicing elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum\n assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est\n temporibus labore sint aliquam, laudantium tempore. Tenetur\n adipisci cumque alias facilis animi. Illum.\n </p>`}\n />\n </HTML>\n )\n}\n\nWithCustomizableTypography.story = {\n name: \"With customizable typography\",\n}\n\nexport const WithCustomizableTypography2 = () => {\n return (\n <HTML variant=\"lg\">\n <ReadMore\n maxChars={300}\n content={`<p>\n Donald Judd, widely regarded as one of the most significant\n American artists of <a href=\"#\">the post-war period</a>, is\n perhaps best-known for the large-scale outdoor installations and\n long, spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur\n adipisicing elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum\n assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est\n temporibus labore sint aliquam, laudantium tempore. Tenetur\n adipisci cumque alias facilis animi. Illum.\n </p>`}\n />\n </HTML>\n )\n}\n\nWithCustomizableTypography2.story = {\n name: \"With customizable typography (2)\",\n}\n\nexport const CharacterCapWithHtmlDisabled = () => {\n return (\n <ReadMore\n disabled\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>`}\n />\n )\n}\n\nCharacterCapWithHtmlDisabled.story = {\n name: \"Character cap with html (disabled)\",\n}\n\nexport const WithBottomReadMore = () => {\n return (\n <Box textAlign=\"center\" width={600}>\n <HTML variant=\"lg\">\n <ReadMore\n inlineReadMoreLink={false}\n maxChars={280}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>`}\n />\n </HTML>\n </Box>\n )\n}\n\nWithBottomReadMore.story = {\n name: \"With bottom placed 'Read More'\",\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AAA4B,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAEb;EACbC,KAAK,EAAE;AACT,CAAC;AAAAC,OAAA,CAAAH,OAAA,GAAAC,QAA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nCC,IAAI,EAAE;AACR,CAAC;AAEM,IAAMU,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAA,EAAS;EACtC,oBACE7B,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACR,IAAA,CAAAyB,GAAG;IAACC,SAAS,EAAC,QAAQ;IAACC,KAAK,EAAE;EAAI,gBACjChC,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACV,KAAA,CAAAqB,IAAI;IAACE,OAAO,EAAC;EAAI,gBAChB1B,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACT,SAAA,CAAAU,QAAQ;IACPmB,kBAAkB,EAAE,KAAM;IAC1BlB,QAAQ,EAAE,GAAI;IACdC,OAAO;EAQD,EACN,CACG,CACH;AAEV,CAAC;AAAAL,OAAA,CAAAkB,kBAAA,GAAAA,kBAAA;AApBYA,kBAAkB,CAAAZ,WAAA;AAsB/BY,kBAAkB,CAACX,KAAK,GAAG;EACzBC,IAAI,EAAE;AACR,CAAC"}
|
|
1
|
+
{"version":3,"file":"ReadMore.story.js","names":["_react","_interopRequireDefault","require","_HTML","_ReadMore","_Box","obj","__esModule","default","_default","exports","title","WithCharacterCap","createElement","ReadMore","maxChars","content","displayName","story","name","ShortContent","AsString","CharacterCapWithHtml","WithCustomizableTypography","HTML","WithCustomizableTypography2","variant","CharacterCapWithHtmlDisabled","disabled","WithBottomReadMore","Box","textAlign","width","inlineReadMoreLink"],"sources":["../../../src/elements/ReadMore/ReadMore.story.tsx"],"sourcesContent":["import React from \"react\"\nimport { HTML } from \"../HTML\"\nimport { ReadMore } from \"./ReadMore\"\nimport { Box } from \"../Box\"\n\nexport default {\n title: \"Components/ReadMore\",\n}\n\nexport const WithCharacterCap = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>`}\n />\n )\n}\n\nWithCharacterCap.story = {\n name: \"With character cap\",\n}\n\nexport const ShortContent = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>.\n </div>`}\n />\n )\n}\n\nShortContent.story = {\n name: \"Short content\",\n}\n\nexport const AsString = () => {\n return (\n <ReadMore\n maxChars={300}\n content=\"Donald Judd, widely regarded as one of the most significant American artists of the post-war period, is perhaps best-known for the large-scale outdoor installations and long, spacious interiors he designed in Marfa. Donald Judd, widely regarded as one of the most significant American artists of the post-war period, is perhaps best-known for the large-scale outdoor installations and long, spacious interiors he designed in Marfa.\"\n />\n )\n}\n\nAsString.story = {\n name: \"As string\",\n}\n\nexport const CharacterCapWithHtml = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<p>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur adipisicing\n elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est temporibus\n labore sint aliquam, laudantium tempore. Tenetur adipisci cumque\n alias facilis animi. Illum.\n </p>`}\n />\n )\n}\n\nCharacterCapWithHtml.story = {\n name: \"Character cap with HTML\",\n}\n\nexport const WithCustomizableTypography = () => {\n return (\n <HTML>\n <ReadMore\n maxChars={300}\n content={`\n <p>\n Donald Judd, widely regarded as one of the most significant\n American artists of <a href=\"#\">the post-war period</a>, is\n perhaps best-known for the large-scale outdoor installations and\n long, spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur\n adipisicing elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum\n assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est\n temporibus labore sint aliquam, laudantium tempore. Tenetur\n adipisci cumque alias facilis animi. Illum.\n </p>`}\n />\n </HTML>\n )\n}\n\nWithCustomizableTypography.story = {\n name: \"With customizable typography\",\n}\n\nexport const WithCustomizableTypography2 = () => {\n return (\n <HTML variant=\"lg\">\n <ReadMore\n maxChars={300}\n content={`<p>\n Donald Judd, widely regarded as one of the most significant\n American artists of <a href=\"#\">the post-war period</a>, is\n perhaps best-known for the large-scale outdoor installations and\n long, spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur\n adipisicing elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum\n assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est\n temporibus labore sint aliquam, laudantium tempore. Tenetur\n adipisci cumque alias facilis animi. Illum.\n </p>`}\n />\n </HTML>\n )\n}\n\nWithCustomizableTypography2.story = {\n name: \"With customizable typography (2)\",\n}\n\nexport const CharacterCapWithHtmlDisabled = () => {\n return (\n <ReadMore\n disabled\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>`}\n />\n )\n}\n\nCharacterCapWithHtmlDisabled.story = {\n name: \"Character cap with html (disabled)\",\n}\n\nexport const WithBottomReadMore = () => {\n return (\n <Box textAlign=\"center\" width={600}>\n <HTML variant=\"lg\">\n <ReadMore\n inlineReadMoreLink={false}\n maxChars={280}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>`}\n />\n </HTML>\n </Box>\n )\n}\n\nWithBottomReadMore.story = {\n name: \"With bottom placed 'Read More'\",\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AAA4B,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEb;EACbG,KAAK,EAAE;AACT,CAAC;AAEM,IAAMC,gBAAgB,GAAAF,OAAA,CAAAE,gBAAA,GAAG,SAAnBA,gBAAgBA,CAAA,EAAS;EACpC,oBACEZ,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACT,SAAA,CAAAU,QAAQ;IACPC,QAAQ,EAAE,GAAI;IACdC,OAAO;EAQG,EACV;AAEN,CAAC;AAfYJ,gBAAgB,CAAAK,WAAA;AAiB7BL,g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A,CAAAK,aAAA,CAACT,SAAA,CAAAU,QAAQ;IACPmB,kBAAkB,EAAE,KAAM;IAC1BlB,QAAQ,EAAE,GAAI;IACdC,OAAO;EAQD,EACN,CACG,CACH;AAEV,CAAC;AApBYa,kBAAkB,CAAAZ,WAAA;AAsB/BY,kBAAkB,CAACX,KAAK,GAAG;EACzBC,IAAI,EAAE;AACR,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BoxProps } from "../Box";
|
|
3
3
|
/** ResponsiveBoxMaxDimensions */
|
|
4
|
-
export
|
|
4
|
+
export type ResponsiveBoxMaxDimensions = {
|
|
5
5
|
maxWidth: number;
|
|
6
6
|
maxHeight: number;
|
|
7
7
|
} | {
|
|
@@ -16,6 +16,6 @@ export interface ResponsiveBoxAspectDimensions {
|
|
|
16
16
|
aspectHeight: number;
|
|
17
17
|
}
|
|
18
18
|
/** ResponsiveBoxProps */
|
|
19
|
-
export
|
|
19
|
+
export type ResponsiveBoxProps = Omit<BoxProps, "maxWidth" | "maxHeight"> & ResponsiveBoxAspectDimensions & ResponsiveBoxMaxDimensions;
|
|
20
20
|
/** ResponsiveBox */
|
|
21
21
|
export declare const ResponsiveBox: React.FC<React.PropsWithChildren<ResponsiveBoxProps>>;
|
|
@@ -47,7 +47,7 @@ var responsiveScale = function responsiveScale(args) {
|
|
|
47
47
|
/** ResponsiveBoxProps */
|
|
48
48
|
|
|
49
49
|
/** ResponsiveBox */
|
|
50
|
-
var ResponsiveBox = function ResponsiveBox(_ref) {
|
|
50
|
+
var ResponsiveBox = exports.ResponsiveBox = function ResponsiveBox(_ref) {
|
|
51
51
|
var aspectWidth = _ref.aspectWidth,
|
|
52
52
|
aspectHeight = _ref.aspectHeight,
|
|
53
53
|
children = _ref.children,
|
|
@@ -66,7 +66,6 @@ var ResponsiveBox = function ResponsiveBox(_ref) {
|
|
|
66
66
|
}
|
|
67
67
|
}, rest), children);
|
|
68
68
|
};
|
|
69
|
-
exports.ResponsiveBox = ResponsiveBox;
|
|
70
69
|
ResponsiveBox.displayName = "ResponsiveBox";
|
|
71
70
|
ResponsiveBox.displayName = "ResponsiveBox";
|
|
72
71
|
//# sourceMappingURL=ResponsiveBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveBox.js","names":["_proportionalScale","require","_react","_interopRequireDefault","_Box","_excluded","_excluded2","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","_typeof","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","responsiveScale","args","maxWidth","paddingBottom","width","aspectWidth","height","aspectHeight","rest","scaled","scale","concat","ResponsiveBox","_ref","children","createElement","Box","position","overflow","style","aspectRatio","
|
|
1
|
+
{"version":3,"file":"ResponsiveBox.js","names":["_proportionalScale","require","_react","_interopRequireDefault","_Box","_excluded","_excluded2","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","_typeof","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","responsiveScale","args","maxWidth","paddingBottom","width","aspectWidth","height","aspectHeight","rest","scaled","scale","concat","ResponsiveBox","exports","_ref","children","createElement","Box","position","overflow","style","aspectRatio","displayName"],"sources":["../../../src/elements/ResponsiveBox/ResponsiveBox.tsx"],"sourcesContent":["import { paddingBottom, scale } from \"proportional-scale\"\nimport React from \"react\"\nimport { Box, BoxProps } from \"../Box\"\n\n/** ResponsiveBoxMaxDimensions */\nexport type ResponsiveBoxMaxDimensions =\n | {\n maxWidth: number\n maxHeight: number\n }\n | { maxWidth: number }\n | { maxHeight: number }\n | { maxWidth: \"100%\" }\n\nexport interface ResponsiveBoxAspectDimensions {\n aspectWidth: number\n aspectHeight: number\n}\n\nconst responsiveScale = (\n args: ResponsiveBoxAspectDimensions & ResponsiveBoxMaxDimensions\n) => {\n if (\"maxWidth\" in args && args.maxWidth === \"100%\") {\n return {\n maxWidth: \"100%\",\n paddingBottom: paddingBottom({\n width: args.aspectWidth,\n height: args.aspectHeight,\n }),\n }\n }\n\n const { aspectWidth: width, aspectHeight: height, ...rest } = args\n const scaled = scale({ width, height, ...rest })\n\n return {\n maxWidth: `${scaled.width}px`,\n paddingBottom: scaled.paddingBottom,\n }\n}\n\n/** ResponsiveBoxProps */\nexport type ResponsiveBoxProps = Omit<BoxProps, \"maxWidth\" | \"maxHeight\"> &\n ResponsiveBoxAspectDimensions &\n ResponsiveBoxMaxDimensions\n\n/** ResponsiveBox */\nexport const ResponsiveBox: React.FC<React.PropsWithChildren<ResponsiveBoxProps>> = ({\n aspectWidth,\n aspectHeight,\n children,\n ...rest\n}) => {\n const scaled = responsiveScale({ aspectHeight, aspectWidth, ...rest })\n\n return (\n <Box\n position=\"relative\"\n width=\"100%\"\n overflow=\"hidden\"\n style={{\n aspectRatio: `${aspectWidth} / ${aspectHeight}`,\n maxWidth: scaled.maxWidth,\n }}\n {...rest}\n >\n {children}\n </Box>\n )\n}\n\nResponsiveBox.displayName = \"ResponsiveBox\"\n"],"mappings":";;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CA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,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
18
18
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
19
19
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
20
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
22
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0)
|
|
21
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
22
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
23
23
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
24
|
var Measure = function Measure(props) {
|
|
25
25
|
var _useState = (0, _react.useState)({
|
|
@@ -82,11 +82,10 @@ var EXAMPLE_MAXIMUMS = [{
|
|
|
82
82
|
maxHeight: 1024,
|
|
83
83
|
maxWidth: 1024
|
|
84
84
|
}];
|
|
85
|
-
var _default = {
|
|
85
|
+
var _default = exports.default = {
|
|
86
86
|
title: "Components/ResponsiveBox"
|
|
87
87
|
};
|
|
88
|
-
exports.
|
|
89
|
-
var Basic = function Basic() {
|
|
88
|
+
var Basic = exports.Basic = function Basic() {
|
|
90
89
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, EXAMPLE_ASPECTS.map(function (aspect, i) {
|
|
91
90
|
return EXAMPLE_MAXIMUMS.map(function (maximum, j) {
|
|
92
91
|
return /*#__PURE__*/_react.default.createElement(_ResponsiveBox.ResponsiveBox, _extends({
|
|
@@ -98,8 +97,7 @@ var Basic = function Basic() {
|
|
|
98
97
|
});
|
|
99
98
|
}));
|
|
100
99
|
};
|
|
101
|
-
exports.
|
|
102
|
-
var MaxWidth100 = function MaxWidth100() {
|
|
100
|
+
var MaxWidth100 = exports.MaxWidth100 = function MaxWidth100() {
|
|
103
101
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, EXAMPLE_ASPECTS.map(function (aspect, i) {
|
|
104
102
|
return /*#__PURE__*/_react.default.createElement(_ResponsiveBox.ResponsiveBox, _extends({
|
|
105
103
|
key: i
|
|
@@ -112,7 +110,6 @@ var MaxWidth100 = function MaxWidth100() {
|
|
|
112
110
|
})));
|
|
113
111
|
}));
|
|
114
112
|
};
|
|
115
|
-
exports.MaxWidth100 = MaxWidth100;
|
|
116
113
|
MaxWidth100.story = {
|
|
117
114
|
name: "maxWidth: 100%"
|
|
118
115
|
};
|
|
@@ -120,7 +117,7 @@ var Masonry = (0, _styledComponents.default)(_Box.Box).withConfig({
|
|
|
120
117
|
displayName: "ResponsiveBoxstory__Masonry",
|
|
121
118
|
componentId: "sc-m69kz2-0"
|
|
122
119
|
})(["column-count:3;*{break-inside:avoid;}"]);
|
|
123
|
-
var ColumnsWithResponsiveImages = function ColumnsWithResponsiveImages() {
|
|
120
|
+
var ColumnsWithResponsiveImages = exports.ColumnsWithResponsiveImages = function ColumnsWithResponsiveImages() {
|
|
124
121
|
return /*#__PURE__*/_react.default.createElement(Masonry, null, new Array(12).fill(0).map(function (_, i) {
|
|
125
122
|
var orientation = i % 3 === 0 ? "portrait" : "landscape";
|
|
126
123
|
var width = orientation === "portrait" ? 200 : 300;
|
|
@@ -146,6 +143,5 @@ var ColumnsWithResponsiveImages = function ColumnsWithResponsiveImages() {
|
|
|
146
143
|
);
|
|
147
144
|
}));
|
|
148
145
|
};
|
|
149
|
-
exports.ColumnsWithResponsiveImages = ColumnsWithResponsiveImages;
|
|
150
146
|
ColumnsWithResponsiveImages.displayName = "ColumnsWithResponsiveImages";
|
|
151
147
|
//# sourceMappingURL=ResponsiveBox.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveBox.story.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_Box","_Text","_Image","_ResponsiveBox","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","Measure","props","_useState","useState","width","height","_useState2","dimensions","setDimensions","ref","useRef","check","current","offsetWidth","offsetHeight","useEffect","window","addEventListener","removeEventListener","createElement","Box","p","Text","variant","color","aspectWidth","aspectHeight","Fragment","maxHeight","maxWidth","join","displayName","EXAMPLE_ASPECTS","EXAMPLE_MAXIMUMS","_default","title","exports","Basic","map","aspect","maximum","j","ResponsiveBox","bg","my","MaxWidth100","story","Masonry","styled","withConfig","componentId","ColumnsWithResponsiveImages","fill","_","orientation","mb","Image","lazyLoad","src","concat","srcSet"],"sources":["../../../src/elements/ResponsiveBox/ResponsiveBox.story.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\"\nimport styled from \"styled-components\"\nimport { Box } from \"../Box\"\nimport { Text } from \"../Text\"\nimport { Image } from \"../Image\"\nimport {\n ResponsiveBox,\n ResponsiveBoxAspectDimensions,\n ResponsiveBoxMaxDimensions,\n ResponsiveBoxProps,\n} from \"./ResponsiveBox\"\n\nconst Measure: React.FC<React.PropsWithChildren<ResponsiveBoxProps>> = (\n props\n) => {\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n const ref = useRef<null | HTMLDivElement>(null)\n\n const check = () => {\n if (!ref.current) return\n setDimensions({\n width: ref.current!.offsetWidth,\n height: ref.current!.offsetHeight,\n })\n }\n\n useEffect(() => {\n check()\n window.addEventListener(\"resize\", check)\n return () => {\n window.removeEventListener(\"resize\", check)\n }\n })\n\n return (\n <Box width=\"100%\" height=\"100%\" p={1} ref={ref as any}>\n <Text variant=\"xs\" color=\"mono0\">\n {props.aspectWidth}:{props.aspectHeight}\n <br />\n {(\"maxWidth\" in props || \"maxHeight\" in props) && (\n <>\n with max dimensions of{\" \"}\n {[\n (props as any).maxHeight || 0,\n (props as any).maxWidth || \"_\",\n ].join(\" × \")}\n <br />\n </>\n )}\n Renders @ {dimensions.width} × {dimensions.height}\n </Text>\n </Box>\n )\n}\n\nconst EXAMPLE_ASPECTS: ResponsiveBoxAspectDimensions[] = [\n { aspectWidth: 300, aspectHeight: 400 },\n { aspectWidth: 400, aspectHeight: 300 },\n]\n\nconst EXAMPLE_MAXIMUMS: ResponsiveBoxMaxDimensions[] = [\n { maxHeight: 200, maxWidth: 200 },\n { maxHeight: 400, maxWidth: 400 },\n { maxHeight: 400 },\n { maxWidth: 400 },\n { maxHeight: 600, maxWidth: 600 },\n { maxHeight: 100, maxWidth: 600 },\n { maxHeight: 1024, maxWidth: 1024 },\n]\n\nexport default { title: \"Components/ResponsiveBox\" }\n\nexport const Basic = () => {\n return (\n <>\n {EXAMPLE_ASPECTS.map((aspect, i) =>\n EXAMPLE_MAXIMUMS.map((maximum, j) => {\n return (\n <ResponsiveBox\n key={[i, j].join(\".\")}\n {...aspect}\n {...maximum}\n bg=\"brand\"\n my={2}\n >\n <Measure {...aspect} {...maximum} />\n </ResponsiveBox>\n )\n })\n )}\n </>\n )\n}\n\nexport const MaxWidth100 = () => {\n return (\n <>\n {EXAMPLE_ASPECTS.map((aspect, i) => {\n return (\n <ResponsiveBox key={i} {...aspect} maxWidth=\"100%\" bg=\"brand\" my={2}>\n <Measure {...aspect} maxWidth=\"100%\" />\n </ResponsiveBox>\n )\n })}\n </>\n )\n}\n\nMaxWidth100.story = {\n name: \"maxWidth: 100%\",\n}\n\nconst Masonry = styled(Box)`\n column-count: 3;\n\n * {\n break-inside: avoid;\n }\n`\n\nexport const ColumnsWithResponsiveImages = () => {\n return (\n <Masonry>\n {new Array(12).fill(0).map((_, i) => {\n const orientation = i % 3 === 0 ? \"portrait\" : \"landscape\"\n const width = orientation === \"portrait\" ? 200 : 300\n const height = orientation === \"portrait\" ? 300 : 200\n\n return (\n // Simply being wrapped in an extra `Box` causes a image loading bug in Chrome\n <Box key={i}>\n <ResponsiveBox\n aspectWidth={width}\n aspectHeight={height}\n maxWidth=\"100%\"\n bg=\"mono10\"\n mb={2}\n >\n <Image\n lazyLoad\n width=\"100%\"\n height=\"100%\"\n src={`https://picsum.photos/seed/${i}/${width}/${height}`}\n srcSet={`https://picsum.photos/seed/${i}/${width}/${height} 1x, https://picsum.photos/seed/${i}/${\n width * 2\n }/${height * 2} 2x`}\n />\n </ResponsiveBox>\n </Box>\n )\n })}\n </Masonry>\n )\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AAKwB,SAAAE,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAZ,wBAAAQ,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAQ,OAAA,CAAAR,GAAA,yBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAS,KAAA,GAAAN,wBAAA,CAAAC,WAAA,OAAAK,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAV,GAAA,YAAAS,KAAA,CAAAE,GAAA,CAAAX,GAAA,SAAAY,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAjB,GAAA,QAAAiB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAApB,GAAA,EAAAiB,GAAA,SA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,QAAQ;QACRrD,KAAK,EAAC,MAAM;QACZC,MAAM,EAAC,MAAM;QACbqD,GAAG,gCAAAC,MAAA,CAAgCrG,CAAC,OAAAqG,MAAA,CAAIvD,KAAK,OAAAuD,MAAA,CAAItD,MAAM,CAAG;QAC1DuD,MAAM,gCAAAD,MAAA,CAAgCrG,CAAC,OAAAqG,MAAA,CAAIvD,KAAK,OAAAuD,MAAA,CAAItD,MAAM,sCAAAsD,MAAA,CAAmCrG,CAAC,OAAAqG,MAAA,CAC5FvD,KAAK,GAAG,CAAC,OAAAuD,MAAA,CACPtD,MAAM,GAAG,CAAC;MAAM,EACpB,CACY;IACZ;EAEV,CAAC,CAAC,CACM;AAEd,CAAC;AAAA+B,OAAA,CAAAe,2BAAA,GAAAA,2BAAA;AAjCYA,2BAA2B,CAAApB,WAAA"}
|
|
1
|
+
{"version":3,"file":"ResponsiveBox.story.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_Box","_Text","_Image","_ResponsiveBox","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","Measure","props","_useState","useState","width","height","_useState2","dimensions","setDimensions","ref","useRef","check","current","offsetWidth","offsetHeight","useEffect","window","addEventListener","removeEventListener","createElement","Box","p","Text","variant","color","aspectWidth","aspectHeight","Fragment","maxHeight","maxWidth","join","displayName","EXAMPLE_ASPECTS","EXAMPLE_MAXIMUMS","_default","exports","title","Basic","map","aspect","maximum","j","ResponsiveBox","bg","my","MaxWidth100","story","Masonry","styled","withConfig","componentId","ColumnsWithResponsiveImages","fill","_","orientation","mb","Image","lazyLoad","src","concat","srcSet"],"sources":["../../../src/elements/ResponsiveBox/ResponsiveBox.story.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\"\nimport styled from \"styled-components\"\nimport { Box } from \"../Box\"\nimport { Text } from \"../Text\"\nimport { Image } from \"../Image\"\nimport {\n ResponsiveBox,\n ResponsiveBoxAspectDimensions,\n ResponsiveBoxMaxDimensions,\n ResponsiveBoxProps,\n} from \"./ResponsiveBox\"\n\nconst Measure: React.FC<React.PropsWithChildren<ResponsiveBoxProps>> = (\n props\n) => {\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n const ref = useRef<null | HTMLDivElement>(null)\n\n const check = () => {\n if (!ref.current) return\n setDimensions({\n width: ref.current!.offsetWidth,\n height: ref.current!.offsetHeight,\n })\n }\n\n useEffect(() => {\n check()\n window.addEventListener(\"resize\", check)\n return () => {\n window.removeEventListener(\"resize\", check)\n }\n })\n\n return (\n <Box width=\"100%\" height=\"100%\" p={1} ref={ref as any}>\n <Text variant=\"xs\" color=\"mono0\">\n {props.aspectWidth}:{props.aspectHeight}\n <br />\n {(\"maxWidth\" in props || \"maxHeight\" in props) && (\n <>\n with max dimensions of{\" \"}\n {[\n (props as any).maxHeight || 0,\n (props as any).maxWidth || \"_\",\n ].join(\" × \")}\n <br />\n </>\n )}\n Renders @ {dimensions.width} × {dimensions.height}\n </Text>\n </Box>\n )\n}\n\nconst EXAMPLE_ASPECTS: ResponsiveBoxAspectDimensions[] = [\n { aspectWidth: 300, aspectHeight: 400 },\n { aspectWidth: 400, aspectHeight: 300 },\n]\n\nconst EXAMPLE_MAXIMUMS: ResponsiveBoxMaxDimensions[] = [\n { maxHeight: 200, maxWidth: 200 },\n { maxHeight: 400, maxWidth: 400 },\n { maxHeight: 400 },\n { maxWidth: 400 },\n { maxHeight: 600, maxWidth: 600 },\n { maxHeight: 100, maxWidth: 600 },\n { maxHeight: 1024, maxWidth: 1024 },\n]\n\nexport default { title: \"Components/ResponsiveBox\" }\n\nexport const Basic = () => {\n return (\n <>\n {EXAMPLE_ASPECTS.map((aspect, i) =>\n EXAMPLE_MAXIMUMS.map((maximum, j) => {\n return (\n <ResponsiveBox\n key={[i, j].join(\".\")}\n {...aspect}\n {...maximum}\n bg=\"brand\"\n my={2}\n >\n <Measure {...aspect} {...maximum} />\n </ResponsiveBox>\n )\n })\n )}\n </>\n )\n}\n\nexport const MaxWidth100 = () => {\n return (\n <>\n {EXAMPLE_ASPECTS.map((aspect, i) => {\n return (\n <ResponsiveBox key={i} {...aspect} maxWidth=\"100%\" bg=\"brand\" my={2}>\n <Measure {...aspect} maxWidth=\"100%\" />\n </ResponsiveBox>\n )\n })}\n </>\n )\n}\n\nMaxWidth100.story = {\n name: \"maxWidth: 100%\",\n}\n\nconst Masonry = styled(Box)`\n column-count: 3;\n\n * {\n break-inside: avoid;\n }\n`\n\nexport const ColumnsWithResponsiveImages = () => {\n return (\n <Masonry>\n {new Array(12).fill(0).map((_, i) => {\n const orientation = i % 3 === 0 ? \"portrait\" : \"landscape\"\n const width = orientation === \"portrait\" ? 200 : 300\n const height = orientation === \"portrait\" ? 300 : 200\n\n return (\n // Simply being wrapped in an extra `Box` causes a image loading bug in Chrome\n <Box key={i}>\n <ResponsiveBox\n aspectWidth={width}\n aspectHeight={height}\n maxWidth=\"100%\"\n bg=\"mono10\"\n mb={2}\n >\n <Image\n lazyLoad\n width=\"100%\"\n height=\"100%\"\n src={`https://picsum.photos/seed/${i}/${width}/${height}`}\n srcSet={`https://picsum.photos/seed/${i}/${width}/${height} 1x, https://picsum.photos/seed/${i}/${\n width * 2\n }/${height * 2} 2x`}\n />\n </ResponsiveBox>\n </Box>\n )\n })}\n </Masonry>\n )\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,O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A,CAAmCrG,CAAC,OAAAqG,MAAA,CAC5FvD,KAAK,GAAG,CAAC,OAAAuD,MAAA,CACPtD,MAAM,GAAG,CAAC;MAAM,EACpB,CACY;IACZ;EAEV,CAAC,CAAC,CACM;AAEd,CAAC;AAjCY8C,2BAA2B,CAAApB,WAAA"}
|
|
@@ -21,13 +21,13 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
21
21
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
22
22
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
23
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
25
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0)
|
|
24
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
25
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
26
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
27
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
28
28
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
29
|
/** A drop-down select menu */
|
|
30
|
-
var Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
30
|
+
var Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
31
31
|
var description = _ref.description,
|
|
32
32
|
disabled = _ref.disabled,
|
|
33
33
|
error = _ref.error,
|
|
@@ -121,15 +121,13 @@ var Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
121
121
|
color: "red100"
|
|
122
122
|
}, error));
|
|
123
123
|
});
|
|
124
|
-
exports.Select = Select;
|
|
125
124
|
Select.displayName = "Select";
|
|
126
125
|
var resetMixin = (0, _styledComponents.css)(["appearance:none;background:none;border:none;outline:0;text-indent:0.01px;text-overflow:\"\";border-radius:0;&:-moz-focusring{color:transparent;text-shadow:0 0 0 black;}option:not(:checked){color:black;}"]);
|
|
127
126
|
/** Creates a small caret */
|
|
128
|
-
var caretMixin = (0, _styledComponents.css)(["&::after{content:\"\";cursor:inherit;width:0;height:0;position:absolute;top:50%;transform:translateY(-50%);right:", ";pointer-events:none;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid ", ";}"], (0, _themeGet.themeGet)("space.1"), function (_ref3) {
|
|
127
|
+
var caretMixin = exports.caretMixin = (0, _styledComponents.css)(["&::after{content:\"\";cursor:inherit;width:0;height:0;position:absolute;top:50%;transform:translateY(-50%);right:", ";pointer-events:none;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid ", ";}"], (0, _themeGet.themeGet)("space.1"), function (_ref3) {
|
|
129
128
|
var disabled = _ref3.disabled;
|
|
130
129
|
return disabled ? (0, _themeGet.themeGet)("colors.mono10") : (0, _themeGet.themeGet)("colors.mono100");
|
|
131
130
|
});
|
|
132
|
-
exports.caretMixin = caretMixin;
|
|
133
131
|
var Container = (0, _styledComponents.default)(_Box.Box).withConfig({
|
|
134
132
|
displayName: "Select__Container",
|
|
135
133
|
componentId: "sc-1weszjl-0"
|