grommet 2.19.1 → 2.21.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/components/Accordion/Accordion.js +26 -23
- package/components/Accordion/stories/CustomHeader.js +36 -34
- package/components/Accordion/stories/CustomThemed/Custom.js +2 -9
- package/components/Accordion/stories/{typescript → CustomThemed}/Rich.tsx +2 -2
- package/components/Accordion/stories/DarkNoAnimation.js +34 -32
- package/components/Accordion/stories/Multiple.js +32 -30
- package/components/Accordion/stories/Simple.js +33 -31
- package/components/Anchor/propTypes.js +1 -1
- package/components/Anchor/stories/Color.js +1 -5
- package/components/Anchor/stories/Default.js +2 -6
- package/components/Anchor/stories/Disabled.js +2 -6
- package/components/Anchor/stories/Gap.js +2 -6
- package/components/Anchor/stories/Inline.js +2 -6
- package/components/Anchor/stories/Size.js +2 -6
- package/components/Anchor/stories/Weight.js +2 -6
- package/components/Avatar/Avatar.js +12 -11
- package/components/Avatar/stories/Basic.js +23 -21
- package/components/Avatar/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/components/Avatar/stories/Round.js +35 -33
- package/components/Avatar/stories/Sizes.js +80 -78
- package/components/Avatar/stories/typescript/Stacked.tsx +10 -11
- package/components/Button/Button.js +3 -3
- package/components/Button/StyledButton.js +3 -1
- package/components/Button/StyledButtonKind.js +5 -9
- package/components/Calendar/Calendar.js +113 -87
- package/components/Calendar/StyledCalendar.js +1 -1
- package/components/Calendar/index.d.ts +4 -0
- package/components/Calendar/stories/ActiveDate.js +35 -34
- package/components/Calendar/stories/CustomDay.js +69 -67
- package/components/Calendar/stories/CustomHeader.js +39 -37
- package/{es6/components/Calendar/stories/typescript → components/Calendar/stories/CustomThemed}/CustomDate.tsx +1 -1
- package/components/Calendar/stories/{CustomSizeHeading.js → CustomThemed/CustomSizeHeading.js} +1 -1
- package/components/Calendar/stories/DaylightSavings.js +55 -53
- package/components/Calendar/stories/Dual.js +86 -84
- package/components/Calendar/stories/Fill.js +16 -14
- package/components/Calendar/stories/Multiple.js +26 -24
- package/components/Calendar/stories/Range.js +13 -11
- package/components/Calendar/stories/ShowAdjacentDays.js +36 -34
- package/components/Calendar/stories/Simple.js +24 -22
- package/components/Calendar/stories/SundayFirstDay.js +13 -11
- package/components/Calendar/utils.js +60 -10
- package/components/Card/stories/{Clickable.js → CustomThemed/Clickable.js} +2 -2
- package/components/Card/stories/{Stacked.js → CustomThemed/Stacked.js} +2 -2
- package/components/Card/stories/{Themed.js → CustomThemed/Themed.js} +2 -2
- package/components/Card/stories/Simple.js +26 -23
- package/components/Carousel/Carousel.js +145 -93
- package/components/Carousel/CarouselChild.js +17 -27
- package/components/Carousel/StyledCarousel.js +44 -0
- package/components/Carousel/index.d.ts +5 -0
- package/components/Carousel/propTypes.js +13 -9
- package/components/Carousel/stories/Autoplay.js +52 -0
- package/components/Carousel/stories/ControlVariations.js +170 -0
- package/components/Carousel/stories/Controlled.js +43 -37
- package/components/Carousel/stories/{Custom.js → CustomThemed/Custom.js} +1 -1
- package/components/Carousel/stories/CustomThemed/Icons.tsx +50 -0
- package/components/Carousel/stories/InteractiveChild.js +73 -0
- package/components/Carousel/stories/Multiple.js +7 -1
- package/components/Carousel/stories/Simple.js +25 -19
- package/components/Chart/Chart.js +16 -7
- package/components/Chart/calcs.js +1 -1
- package/components/Chart/utils.js +1 -1
- package/components/CheckBox/StyledCheckBox.js +1 -1
- package/components/Clock/Clock.js +1 -1
- package/components/Clock/StyledClock.js +1 -1
- package/components/Collapsible/stories/Horizontal.js +54 -50
- package/components/Collapsible/stories/Nested.js +78 -76
- package/components/Collapsible/stories/Simple.js +24 -22
- package/components/DataChart/DataChart.js +84 -21
- package/components/DataChart/Detail.js +8 -0
- package/components/DataChart/XAxis.js +19 -10
- package/components/DataChart/index.d.ts +10 -2
- package/components/DataChart/propTypes.js +2 -1
- package/components/DataChart/stories/Offset.js +82 -0
- package/components/DataChart/stories/StackedAreas.js +77 -0
- package/components/DataChart/stories/StackedLines.js +73 -0
- package/components/DataChart/utils.js +1 -1
- package/components/DataTable/DataTable.js +1 -1
- package/components/DataTable/StyledDataTable.js +1 -1
- package/components/DataTable/buildState.js +3 -2
- package/components/DataTable/index.d.ts +3 -3
- package/components/DataTable/stories/ColumnSize.js +63 -61
- package/components/DataTable/stories/Controlled.js +34 -32
- package/components/DataTable/stories/ControlledGrouped.js +16 -14
- package/components/DataTable/stories/{Fill.js → CustomThemed/Fill.js} +2 -2
- package/components/DataTable/stories/Grouped.js +15 -13
- package/components/DataTable/stories/GroupedOnSelect.js +16 -14
- package/components/DataTable/stories/InfiniteScrollDataTable.js +22 -20
- package/components/DataTable/stories/MultiplePin.js +48 -44
- package/components/DataTable/stories/NoPrimary.js +15 -13
- package/components/DataTable/stories/OnUpdate.js +24 -22
- package/components/DataTable/stories/Placeholder.js +27 -25
- package/components/DataTable/stories/ResizableColumns.js +17 -15
- package/components/DataTable/stories/Served.js +18 -16
- package/components/DataTable/stories/Show.js +29 -23
- package/components/DataTable/stories/Simple.js +14 -12
- package/components/DataTable/stories/Sized.js +14 -12
- package/components/DataTable/stories/Sort.js +20 -18
- package/components/DataTable/stories/SpaceX.js +36 -34
- package/components/DataTable/stories/SpaceXUngrouped.js +26 -24
- package/components/DataTable/stories/Styled.js +43 -41
- package/components/DataTable/stories/Tunable.js +19 -17
- package/components/DataTable/stories/Units.js +16 -14
- package/components/DataTable/stories/data.js +1 -1
- package/components/DataTable/stories/rowDetails.js +40 -38
- package/components/DataTable/stories/typescript/Clickable.tsx +30 -29
- package/components/DataTable/stories/typescript/OnSelect.tsx +13 -13
- package/components/DataTable/stories/typescript/Paginated.tsx +15 -15
- package/components/DateInput/DateInput.js +85 -30
- package/components/DateInput/index.d.ts +1 -0
- package/components/DateInput/propTypes.js +1 -0
- package/components/DateInput/stories/FormatInline.js +172 -16
- package/components/DateInput/stories/ResetDate.js +1 -1
- package/components/DateInput/utils.js +20 -17
- package/components/Drop/DropContainer.js +16 -9
- package/components/Drop/stories/AllNotStretched.js +166 -164
- package/components/Drop/stories/{Lazy.js → CustomThemed/Lazy.js} +1 -1
- package/components/Drop/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/components/Drop/stories/Meter.js +35 -30
- package/components/Drop/stories/Multiple.js +56 -52
- package/components/Drop/stories/Overflow.js +54 -50
- package/components/Drop/stories/Plain.js +30 -26
- package/components/Drop/stories/Progressive.js +52 -48
- package/components/Drop/stories/Simple.js +28 -24
- package/components/Drop/stories/Styled.js +45 -41
- package/components/Drop/stories/TrapFocus.js +21 -16
- package/components/DropButton/stories/Menu.js +5 -7
- package/components/DropButton/stories/Simple.js +2 -6
- package/components/DropButton/stories/typescript/Calendar.tsx +17 -20
- package/components/FileInput/stories/CustomThemed/Custom.js +5 -7
- package/components/Footer/stories/data.js +1 -1
- package/components/Form/Form.js +321 -265
- package/components/Form/stories/ArrayOfFormFields.js +161 -0
- package/components/Form/stories/FieldBorderPosition.js +1 -0
- package/components/Form/stories/FieldWithChildren.js +4 -4
- package/components/FormField/FormField.js +5 -1
- package/components/Grommet/Grommet.js +8 -1
- package/components/Layer/LayerContainer.js +9 -4
- package/components/Layer/StyledLayer.js +1 -1
- package/components/List/List.js +11 -2
- package/components/List/index.d.ts +1 -0
- package/components/List/propTypes.js +1 -0
- package/components/Markdown/Markdown.js +4 -2
- package/components/MaskedInput/StyledMaskedInput.js +1 -1
- package/components/Menu/Menu.js +39 -12
- package/components/Menu/stories/BottomControlButton.js +2 -6
- package/components/Menu/stories/{typescript → CustomThemed}/Themed.tsx +1 -1
- package/components/Menu/stories/ItemWithIcon.js +2 -6
- package/components/Menu/stories/Justify.js +2 -6
- package/components/Menu/stories/Reverse.js +2 -6
- package/components/Menu/stories/Simple.js +2 -6
- package/components/Menu/stories/typescript/Children.tsx +10 -13
- package/components/Meter/utils.js +1 -1
- package/components/NameValueList/NameValueList.js +8 -5
- package/components/NameValueList/stories/CustomValue.js +1 -1
- package/components/NameValueList/stories/data.js +1 -1
- package/components/NameValuePair/NameValuePair.js +1 -4
- package/components/Nav/stories/Collapsable.js +39 -37
- package/components/Nav/stories/{CustomAnchor.js → CustomThemed/CustomAnchor.js} +2 -2
- package/components/Nav/stories/{JustifySidebar.js → CustomThemed/JustifySidebar.js} +1 -1
- package/components/Nav/stories/OnHeader.js +29 -27
- package/components/Nav/stories/Sidebar.js +24 -18
- package/components/Nav/stories/Simple.js +15 -13
- package/components/Notification/Notification.js +17 -6
- package/components/Notification/index.d.ts +7 -1
- package/components/Notification/propTypes.js +4 -1
- package/components/Pagination/StyledPageControl.js +2 -2
- package/components/RadioButton/StyledRadioButton.js +1 -1
- package/components/RadioButtonGroup/RadioButtonGroup.js +3 -1
- package/components/RangeInput/StyledRangeInput.js +1 -1
- package/components/RangeInput/stories/SimpleRange.js +2 -6
- package/components/Select/Select.js +45 -12
- package/components/Select/SelectContainer.js +22 -6
- package/components/Select/stories/ChildrenRender.js +37 -33
- package/components/Select/stories/Clear.js +7 -3
- package/components/Select/stories/Controlled.js +32 -28
- package/components/Select/stories/{CustomSearch.js → CustomThemed/CustomSearch.js} +2 -2
- package/components/Select/stories/Disabled.js +29 -25
- package/components/Select/stories/InsideFormField.js +29 -27
- package/components/Select/stories/LazyLoadingOptions.js +27 -25
- package/components/Select/stories/ManyOptions.js +47 -43
- package/components/Select/stories/Multiple.js +25 -21
- package/components/Select/stories/ObjectOptions.js +27 -25
- package/components/Select/stories/Search.js +62 -58
- package/components/Select/stories/Simple.js +26 -22
- package/components/Select/stories/Uncontrolled.js +24 -20
- package/components/Select/stories/ValueLabel.js +40 -36
- package/components/Select/stories/typescript/CreateOption.tsx +34 -30
- package/components/Sidebar/stories/Labels.js +25 -19
- package/components/Sidebar/stories/typescript/Simple.tsx +17 -12
- package/components/SkipLinks/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/components/SkipLinks/stories/Simple.js +82 -78
- package/components/Stack/stories/Fill.js +15 -11
- package/components/Stack/stories/Simple.js +15 -9
- package/components/Tab/Tab.js +6 -1
- package/components/Table/StyledTable.js +1 -1
- package/components/Table/stories/Default.js +30 -28
- package/components/Table/stories/InfiniteScrollInTable.js +39 -35
- package/components/Table/stories/MeterInTable.js +26 -24
- package/components/Table/stories/data.js +1 -1
- package/components/Tabs/StyledTabs.js +1 -1
- package/components/Tabs/Tabs.js +23 -19
- package/components/Tabs/stories/{AlignControls.js → CustomThemed/AlignControls.js} +1 -1
- package/components/Tabs/stories/{Custom.js → CustomThemed/Custom.js} +3 -3
- package/components/Tabs/stories/{Icon.js → CustomThemed/Icon.js} +1 -1
- package/components/Tabs/stories/{States.js → CustomThemed/States.js} +1 -1
- package/components/Tabs/stories/Plain.js +45 -41
- package/components/Tabs/stories/Responsive.js +191 -189
- package/components/Tabs/stories/Rich.js +30 -28
- package/components/Tabs/stories/Scrollable.js +32 -28
- package/components/Tabs/stories/Uncontrolled.js +45 -41
- package/components/Tabs/stories/typescript/Controlled.tsx +21 -21
- package/components/Tag/README.md +2 -0
- package/components/Tag/StyledTag.js +35 -0
- package/components/Tag/Tag.js +94 -0
- package/components/Tag/index.d.ts +35 -0
- package/components/Tag/index.js +8 -0
- package/components/Tag/propTypes.js +28 -0
- package/components/Tag/stories/OnClick.js +34 -0
- package/components/Tag/stories/OnRemove.js +38 -0
- package/components/Tag/stories/Simple.js +32 -0
- package/components/Tag/stories/Size.js +45 -0
- package/components/Text/Text.js +23 -9
- package/components/TextArea/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/components/TextArea/stories/Fill.js +18 -16
- package/components/TextArea/stories/InsideFormField.js +43 -41
- package/components/TextArea/stories/NonResizable.js +13 -11
- package/components/TextArea/stories/Simple.js +13 -11
- package/components/TextInput/StyledTextInput.js +1 -1
- package/components/TextInput/TextInput.js +13 -4
- package/components/TextInput/index.d.ts +6 -1
- package/{es6/components/TextInput/stories/typescript → components/TextInput/stories/CustomThemed}/CustomSuggestions.tsx +1 -1
- package/components/TextInput/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/components/TextInput/stories/DefaultSuggestion.js +20 -19
- package/components/TextInput/stories/Icon.js +22 -21
- package/components/TextInput/stories/InsideFormField.js +32 -30
- package/components/TextInput/stories/OnSelect.js +20 -19
- package/components/TextInput/stories/Password.js +30 -29
- package/components/TextInput/stories/Simple.js +17 -16
- package/components/TextInput/stories/StyledPlaceholder.js +10 -9
- package/components/TextInput/stories/Suggestions.js +19 -18
- package/components/TextInput/stories/Uncontrolled.js +18 -17
- package/components/TextInput/stories/WithTags.js +19 -18
- package/components/Tip/stories/Caret.js +37 -31
- package/components/Tip/stories/{ResponsiveTip.js → CustomThemed/ResponsiveTip.js} +1 -1
- package/components/Tip/stories/{SidebarTip.js → CustomThemed/SidebarTip.js} +1 -1
- package/{es6/components/Tip/stories/typescript → components/Tip/stories/CustomThemed}/Themed.tsx +1 -1
- package/components/Tip/stories/HeaderActions.js +66 -60
- package/components/Tip/stories/InfoTip.js +59 -56
- package/components/Tip/stories/typescript/Animated.tsx +26 -21
- package/components/Tip/stories/typescript/Children.tsx +52 -51
- package/components/Tip/stories/typescript/Simple.tsx +12 -7
- package/components/Video/Video.js +98 -38
- package/components/Video/index.d.ts +15 -2
- package/components/Video/propTypes.js +8 -1
- package/components/Video/stories/typescript/TheaterMode.tsx +46 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +8 -0
- package/contexts/MessageContext/MessageContext.js +3 -2
- package/contexts/MessageContext/index.js +1 -1
- package/es6/components/Accordion/Accordion.js +26 -23
- package/es6/components/Accordion/stories/CustomHeader.js +37 -34
- package/es6/components/Accordion/stories/CustomThemed/Custom.js +2 -9
- package/es6/components/Accordion/stories/{typescript → CustomThemed}/Rich.tsx +2 -2
- package/es6/components/Accordion/stories/DarkNoAnimation.js +35 -32
- package/es6/components/Accordion/stories/Multiple.js +33 -30
- package/es6/components/Accordion/stories/Simple.js +34 -31
- package/es6/components/Anchor/propTypes.js +1 -1
- package/es6/components/Anchor/stories/Color.js +2 -5
- package/es6/components/Anchor/stories/Default.js +3 -6
- package/es6/components/Anchor/stories/Disabled.js +3 -6
- package/es6/components/Anchor/stories/Gap.js +3 -6
- package/es6/components/Anchor/stories/Inline.js +3 -6
- package/es6/components/Anchor/stories/Size.js +3 -6
- package/es6/components/Anchor/stories/Weight.js +3 -6
- package/es6/components/Avatar/Avatar.js +13 -12
- package/es6/components/Avatar/stories/Basic.js +24 -21
- package/es6/components/Avatar/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/es6/components/Avatar/stories/Round.js +36 -33
- package/es6/components/Avatar/stories/Sizes.js +81 -78
- package/es6/components/Avatar/stories/typescript/Stacked.tsx +10 -11
- package/es6/components/Button/Button.js +3 -3
- package/es6/components/Button/StyledButton.js +3 -1
- package/es6/components/Button/StyledButtonKind.js +5 -9
- package/es6/components/Calendar/Calendar.js +114 -88
- package/es6/components/Calendar/index.d.ts +4 -0
- package/es6/components/Calendar/stories/ActiveDate.js +36 -34
- package/es6/components/Calendar/stories/CustomDay.js +70 -67
- package/es6/components/Calendar/stories/CustomHeader.js +40 -37
- package/{components/Calendar/stories/typescript → es6/components/Calendar/stories/CustomThemed}/CustomDate.tsx +1 -1
- package/es6/components/Calendar/stories/{CustomSizeHeading.js → CustomThemed/CustomSizeHeading.js} +1 -1
- package/es6/components/Calendar/stories/DaylightSavings.js +56 -53
- package/es6/components/Calendar/stories/Dual.js +87 -84
- package/es6/components/Calendar/stories/Fill.js +17 -14
- package/es6/components/Calendar/stories/Multiple.js +25 -22
- package/es6/components/Calendar/stories/Range.js +14 -11
- package/es6/components/Calendar/stories/ShowAdjacentDays.js +37 -34
- package/es6/components/Calendar/stories/Simple.js +25 -22
- package/es6/components/Calendar/stories/SundayFirstDay.js +14 -11
- package/es6/components/Calendar/utils.js +48 -4
- package/es6/components/Card/stories/{Clickable.js → CustomThemed/Clickable.js} +2 -2
- package/es6/components/Card/stories/{Stacked.js → CustomThemed/Stacked.js} +2 -2
- package/es6/components/Card/stories/{Themed.js → CustomThemed/Themed.js} +2 -2
- package/es6/components/Card/stories/Simple.js +27 -24
- package/es6/components/Carousel/Carousel.js +145 -94
- package/es6/components/Carousel/CarouselChild.js +17 -25
- package/es6/components/Carousel/StyledCarousel.js +31 -0
- package/es6/components/Carousel/index.d.ts +5 -0
- package/es6/components/Carousel/propTypes.js +13 -9
- package/es6/components/Carousel/stories/Autoplay.js +41 -0
- package/es6/components/Carousel/stories/ControlVariations.js +161 -0
- package/es6/components/Carousel/stories/Controlled.js +44 -38
- package/es6/components/Carousel/stories/{Custom.js → CustomThemed/Custom.js} +1 -1
- package/es6/components/Carousel/stories/CustomThemed/Icons.tsx +50 -0
- package/es6/components/Carousel/stories/InteractiveChild.js +61 -0
- package/es6/components/Carousel/stories/Multiple.js +8 -2
- package/es6/components/Carousel/stories/Simple.js +26 -20
- package/es6/components/Chart/Chart.js +16 -7
- package/es6/components/Clock/Clock.js +1 -1
- package/es6/components/Collapsible/stories/Horizontal.js +55 -50
- package/es6/components/Collapsible/stories/Nested.js +79 -76
- package/es6/components/Collapsible/stories/Simple.js +25 -22
- package/es6/components/DataChart/DataChart.js +84 -21
- package/es6/components/DataChart/Detail.js +7 -0
- package/es6/components/DataChart/XAxis.js +19 -10
- package/es6/components/DataChart/index.d.ts +10 -2
- package/es6/components/DataChart/propTypes.js +2 -1
- package/es6/components/DataChart/stories/Offset.js +70 -0
- package/es6/components/DataChart/stories/StackedAreas.js +65 -0
- package/es6/components/DataChart/stories/StackedLines.js +61 -0
- package/es6/components/DataTable/DataTable.js +1 -1
- package/es6/components/DataTable/buildState.js +2 -1
- package/es6/components/DataTable/index.d.ts +3 -3
- package/es6/components/DataTable/stories/ColumnSize.js +64 -61
- package/es6/components/DataTable/stories/Controlled.js +35 -32
- package/es6/components/DataTable/stories/ControlledGrouped.js +17 -14
- package/es6/components/DataTable/stories/{Fill.js → CustomThemed/Fill.js} +2 -2
- package/es6/components/DataTable/stories/Grouped.js +16 -13
- package/es6/components/DataTable/stories/GroupedOnSelect.js +17 -14
- package/es6/components/DataTable/stories/InfiniteScrollDataTable.js +23 -20
- package/es6/components/DataTable/stories/MultiplePin.js +49 -45
- package/es6/components/DataTable/stories/NoPrimary.js +16 -13
- package/es6/components/DataTable/stories/OnUpdate.js +25 -22
- package/es6/components/DataTable/stories/Placeholder.js +28 -25
- package/es6/components/DataTable/stories/ResizableColumns.js +18 -15
- package/es6/components/DataTable/stories/Served.js +19 -16
- package/es6/components/DataTable/stories/Show.js +27 -21
- package/es6/components/DataTable/stories/Simple.js +15 -12
- package/es6/components/DataTable/stories/Sized.js +15 -12
- package/es6/components/DataTable/stories/Sort.js +21 -18
- package/es6/components/DataTable/stories/SpaceX.js +37 -34
- package/es6/components/DataTable/stories/SpaceXUngrouped.js +27 -24
- package/es6/components/DataTable/stories/Styled.js +44 -41
- package/es6/components/DataTable/stories/Tunable.js +20 -17
- package/es6/components/DataTable/stories/Units.js +17 -14
- package/es6/components/DataTable/stories/rowDetails.js +41 -38
- package/es6/components/DataTable/stories/typescript/Clickable.tsx +30 -29
- package/es6/components/DataTable/stories/typescript/OnSelect.tsx +13 -13
- package/es6/components/DataTable/stories/typescript/Paginated.tsx +15 -15
- package/es6/components/DateInput/DateInput.js +80 -28
- package/es6/components/DateInput/index.d.ts +1 -0
- package/es6/components/DateInput/propTypes.js +1 -0
- package/es6/components/DateInput/stories/FormatInline.js +169 -16
- package/es6/components/DateInput/utils.js +18 -13
- package/es6/components/Drop/DropContainer.js +15 -9
- package/es6/components/Drop/stories/AllNotStretched.js +167 -164
- package/es6/components/Drop/stories/{Lazy.js → CustomThemed/Lazy.js} +1 -1
- package/es6/components/Drop/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/es6/components/Drop/stories/Meter.js +36 -30
- package/es6/components/Drop/stories/Multiple.js +57 -52
- package/es6/components/Drop/stories/Overflow.js +55 -50
- package/es6/components/Drop/stories/Plain.js +31 -26
- package/es6/components/Drop/stories/Progressive.js +53 -48
- package/es6/components/Drop/stories/Simple.js +29 -24
- package/es6/components/Drop/stories/Styled.js +46 -41
- package/es6/components/Drop/stories/TrapFocus.js +22 -17
- package/es6/components/DropButton/stories/Menu.js +6 -7
- package/es6/components/DropButton/stories/Simple.js +3 -6
- package/es6/components/DropButton/stories/typescript/Calendar.tsx +17 -20
- package/es6/components/FileInput/stories/CustomThemed/Custom.js +5 -7
- package/es6/components/Form/Form.js +321 -265
- package/es6/components/Form/stories/ArrayOfFormFields.js +147 -0
- package/es6/components/Form/stories/FieldBorderPosition.js +1 -0
- package/es6/components/Form/stories/FieldWithChildren.js +4 -4
- package/es6/components/FormField/FormField.js +6 -2
- package/es6/components/Grommet/Grommet.js +8 -1
- package/es6/components/Layer/LayerContainer.js +9 -4
- package/es6/components/List/List.js +11 -2
- package/es6/components/List/index.d.ts +1 -0
- package/es6/components/List/propTypes.js +1 -0
- package/es6/components/Markdown/Markdown.js +4 -2
- package/es6/components/Menu/Menu.js +40 -13
- package/es6/components/Menu/stories/BottomControlButton.js +3 -6
- package/es6/components/Menu/stories/{typescript → CustomThemed}/Themed.tsx +1 -1
- package/es6/components/Menu/stories/ItemWithIcon.js +3 -6
- package/es6/components/Menu/stories/Justify.js +3 -6
- package/es6/components/Menu/stories/Reverse.js +3 -6
- package/es6/components/Menu/stories/Simple.js +3 -6
- package/es6/components/Menu/stories/typescript/Children.tsx +10 -13
- package/es6/components/NameValueList/NameValueList.js +9 -6
- package/es6/components/NameValueList/stories/CustomValue.js +1 -1
- package/es6/components/NameValuePair/NameValuePair.js +1 -4
- package/es6/components/Nav/stories/Collapsable.js +40 -37
- package/es6/components/Nav/stories/{CustomAnchor.js → CustomThemed/CustomAnchor.js} +2 -2
- package/es6/components/Nav/stories/{JustifySidebar.js → CustomThemed/JustifySidebar.js} +1 -1
- package/es6/components/Nav/stories/OnHeader.js +30 -27
- package/es6/components/Nav/stories/Sidebar.js +25 -19
- package/es6/components/Nav/stories/Simple.js +16 -13
- package/es6/components/Notification/Notification.js +18 -7
- package/es6/components/Notification/index.d.ts +7 -1
- package/es6/components/Notification/propTypes.js +4 -1
- package/es6/components/Pagination/StyledPageControl.js +1 -1
- package/es6/components/RadioButtonGroup/RadioButtonGroup.js +3 -1
- package/es6/components/RangeInput/StyledRangeInput.js +1 -1
- package/es6/components/RangeInput/stories/SimpleRange.js +3 -6
- package/es6/components/Select/Select.js +45 -12
- package/es6/components/Select/SelectContainer.js +22 -6
- package/es6/components/Select/stories/ChildrenRender.js +38 -33
- package/es6/components/Select/stories/Clear.js +8 -4
- package/es6/components/Select/stories/Controlled.js +33 -28
- package/es6/components/Select/stories/{CustomSearch.js → CustomThemed/CustomSearch.js} +2 -2
- package/es6/components/Select/stories/Disabled.js +30 -25
- package/es6/components/Select/stories/InsideFormField.js +30 -27
- package/es6/components/Select/stories/LazyLoadingOptions.js +28 -25
- package/es6/components/Select/stories/ManyOptions.js +48 -43
- package/es6/components/Select/stories/Multiple.js +26 -21
- package/es6/components/Select/stories/ObjectOptions.js +28 -25
- package/es6/components/Select/stories/Search.js +63 -58
- package/es6/components/Select/stories/Simple.js +27 -22
- package/es6/components/Select/stories/Uncontrolled.js +25 -20
- package/es6/components/Select/stories/ValueLabel.js +41 -36
- package/es6/components/Select/stories/typescript/CreateOption.tsx +34 -30
- package/es6/components/Sidebar/stories/Labels.js +26 -20
- package/es6/components/Sidebar/stories/typescript/Simple.tsx +17 -12
- package/es6/components/SkipLinks/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/es6/components/SkipLinks/stories/Simple.js +83 -79
- package/es6/components/Stack/stories/Fill.js +16 -11
- package/es6/components/Stack/stories/Simple.js +16 -10
- package/es6/components/Tab/Tab.js +6 -1
- package/es6/components/Table/stories/Default.js +31 -28
- package/es6/components/Table/stories/InfiniteScrollInTable.js +40 -36
- package/es6/components/Table/stories/MeterInTable.js +27 -24
- package/es6/components/Tabs/Tabs.js +23 -20
- package/es6/components/Tabs/stories/{AlignControls.js → CustomThemed/AlignControls.js} +1 -1
- package/es6/components/Tabs/stories/{Custom.js → CustomThemed/Custom.js} +3 -3
- package/es6/components/Tabs/stories/{Icon.js → CustomThemed/Icon.js} +1 -1
- package/es6/components/Tabs/stories/{States.js → CustomThemed/States.js} +1 -1
- package/es6/components/Tabs/stories/Plain.js +45 -40
- package/es6/components/Tabs/stories/Responsive.js +191 -188
- package/es6/components/Tabs/stories/Rich.js +30 -27
- package/es6/components/Tabs/stories/Scrollable.js +32 -27
- package/es6/components/Tabs/stories/Uncontrolled.js +45 -40
- package/es6/components/Tabs/stories/typescript/Controlled.tsx +21 -21
- package/es6/components/Tag/README.md +2 -0
- package/es6/components/Tag/StyledTag.js +22 -0
- package/es6/components/Tag/Tag.js +77 -0
- package/es6/components/Tag/index.d.ts +35 -0
- package/es6/components/Tag/index.js +1 -0
- package/es6/components/Tag/propTypes.js +18 -0
- package/es6/components/Tag/stories/OnClick.js +22 -0
- package/es6/components/Tag/stories/OnRemove.js +26 -0
- package/es6/components/Tag/stories/Simple.js +20 -0
- package/es6/components/Tag/stories/Size.js +33 -0
- package/es6/components/Text/Text.js +23 -10
- package/es6/components/TextArea/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/es6/components/TextArea/stories/Fill.js +19 -16
- package/es6/components/TextArea/stories/InsideFormField.js +44 -41
- package/es6/components/TextArea/stories/NonResizable.js +14 -11
- package/es6/components/TextArea/stories/Simple.js +14 -11
- package/es6/components/TextInput/TextInput.js +13 -4
- package/es6/components/TextInput/index.d.ts +6 -1
- package/{components/TextInput/stories/typescript → es6/components/TextInput/stories/CustomThemed}/CustomSuggestions.tsx +1 -1
- package/es6/components/TextInput/stories/{Themed.js → CustomThemed/Themed.js} +1 -1
- package/es6/components/TextInput/stories/DefaultSuggestion.js +21 -19
- package/es6/components/TextInput/stories/Icon.js +23 -21
- package/es6/components/TextInput/stories/InsideFormField.js +33 -30
- package/es6/components/TextInput/stories/OnSelect.js +21 -19
- package/es6/components/TextInput/stories/Password.js +31 -29
- package/es6/components/TextInput/stories/Simple.js +18 -16
- package/es6/components/TextInput/stories/StyledPlaceholder.js +11 -9
- package/es6/components/TextInput/stories/Suggestions.js +20 -18
- package/es6/components/TextInput/stories/Uncontrolled.js +19 -17
- package/es6/components/TextInput/stories/WithTags.js +20 -18
- package/es6/components/Tip/stories/Caret.js +38 -32
- package/es6/components/Tip/stories/{ResponsiveTip.js → CustomThemed/ResponsiveTip.js} +1 -1
- package/es6/components/Tip/stories/{SidebarTip.js → CustomThemed/SidebarTip.js} +1 -1
- package/{components/Tip/stories/typescript → es6/components/Tip/stories/CustomThemed}/Themed.tsx +1 -1
- package/es6/components/Tip/stories/HeaderActions.js +67 -61
- package/es6/components/Tip/stories/InfoTip.js +60 -57
- package/es6/components/Tip/stories/typescript/Animated.tsx +26 -21
- package/es6/components/Tip/stories/typescript/Children.tsx +52 -51
- package/es6/components/Tip/stories/typescript/Simple.tsx +12 -7
- package/es6/components/Video/Video.js +99 -39
- package/es6/components/Video/index.d.ts +15 -2
- package/es6/components/Video/propTypes.js +8 -1
- package/es6/components/Video/stories/typescript/TheaterMode.tsx +46 -0
- package/es6/components/index.d.ts +1 -0
- package/es6/components/index.js +1 -0
- package/es6/contexts/MessageContext/MessageContext.js +2 -1
- package/es6/index.d.ts +1 -0
- package/es6/languages/default.json +11 -3
- package/es6/themes/base.d.ts +59 -12
- package/es6/themes/base.js +60 -2
- package/es6/utils/DOM.js +13 -3
- package/es6/utils/background.js +2 -1
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/index.d.ts +1 -0
- package/languages/default.json +11 -3
- package/package.json +59 -58
- package/themes/base.d.ts +59 -12
- package/themes/base.js +61 -3
- package/themes/index.js +1 -1
- package/utils/DOM.js +20 -4
- package/utils/animation.js +1 -1
- package/utils/background.js +3 -2
- package/utils/border.js +1 -1
- package/utils/colors.js +1 -1
- package/utils/general-prop-types.js +1 -1
- package/utils/graphics.js +1 -1
- package/utils/mixins.js +1 -1
- package/utils/object.js +1 -1
- package/utils/responsive.js +1 -1
- package/utils/styles.js +1 -1
- package/utils/use-isomorphic-layout-effect.js +1 -1
- package/components/Carousel/stories/InitialChild.js +0 -43
- package/components/Carousel/stories/WithClickableChild.js +0 -51
- package/components/Carousel/stories/WithoutControls.js +0 -44
- package/es6/components/Carousel/stories/InitialChild.js +0 -32
- package/es6/components/Carousel/stories/WithClickableChild.js +0 -40
- package/es6/components/Carousel/stories/WithoutControls.js +0 -33
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = exports.Size = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _grommet = require("grommet");
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
var Size = function Size() {
|
|
13
|
+
return /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
14
|
+
pad: "large",
|
|
15
|
+
direction: "row",
|
|
16
|
+
gap: "medium",
|
|
17
|
+
wrap: true
|
|
18
|
+
}, ['xsmall', 'small', 'medium', 'large', 'xlarge'].map(function (size) {
|
|
19
|
+
return /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
20
|
+
gap: "medium",
|
|
21
|
+
align: "start",
|
|
22
|
+
key: size
|
|
23
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Text, {
|
|
24
|
+
size: size,
|
|
25
|
+
weight: "bold"
|
|
26
|
+
}, size), /*#__PURE__*/_react["default"].createElement(_grommet.Tag, {
|
|
27
|
+
name: "Name",
|
|
28
|
+
value: "Value",
|
|
29
|
+
size: size
|
|
30
|
+
}), /*#__PURE__*/_react["default"].createElement(_grommet.Tag, {
|
|
31
|
+
value: "Value",
|
|
32
|
+
size: size
|
|
33
|
+
}), /*#__PURE__*/_react["default"].createElement(_grommet.Tag, {
|
|
34
|
+
value: "Value",
|
|
35
|
+
size: size,
|
|
36
|
+
onRemove: function onRemove() {}
|
|
37
|
+
}));
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.Size = Size;
|
|
42
|
+
var _default = {
|
|
43
|
+
title: 'Type/Tag/Size'
|
|
44
|
+
};
|
|
45
|
+
exports["default"] = _default;
|
package/components/Text/Text.js
CHANGED
|
@@ -5,6 +5,8 @@ exports.Text = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
8
|
+
var _useIsomorphicLayoutEffect = require("../../utils/use-isomorphic-layout-effect");
|
|
9
|
+
|
|
8
10
|
var _StyledText = require("./StyledText");
|
|
9
11
|
|
|
10
12
|
var _Tip = require("../Tip");
|
|
@@ -38,17 +40,23 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
38
40
|
|
|
39
41
|
var _useState = (0, _react.useState)(false),
|
|
40
42
|
textTruncated = _useState[0],
|
|
41
|
-
setTextTruncated = _useState[1];
|
|
42
|
-
// and the text has been truncated
|
|
43
|
+
setTextTruncated = _useState[1];
|
|
43
44
|
|
|
45
|
+
(0, _useIsomorphicLayoutEffect.useLayoutEffect)(function () {
|
|
46
|
+
var updateTip = function updateTip() {
|
|
47
|
+
setTextTruncated(false);
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
if (truncate === 'tip') {
|
|
47
|
-
if (textRef.current && textRef.current.scrollWidth > textRef.current.offsetWidth) {
|
|
49
|
+
if (truncate === 'tip' && textRef.current && textRef.current.scrollWidth > textRef.current.offsetWidth) {
|
|
48
50
|
setTextTruncated(true);
|
|
49
51
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
window.addEventListener('resize', updateTip);
|
|
55
|
+
updateTip();
|
|
56
|
+
return function () {
|
|
57
|
+
return window.removeEventListener('resize', updateTip);
|
|
58
|
+
};
|
|
59
|
+
}, [textRef, truncate]);
|
|
52
60
|
|
|
53
61
|
var styledTextResult = /*#__PURE__*/_react["default"].createElement(_StyledText.StyledText, _extends({
|
|
54
62
|
as: !as && tag ? tag : as,
|
|
@@ -60,13 +68,19 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
60
68
|
}), children);
|
|
61
69
|
|
|
62
70
|
if (tipProp || textTruncated) {
|
|
71
|
+
// place the text content in a tip if truncate === 'tip'
|
|
72
|
+
// and the text has been truncated
|
|
63
73
|
if (textTruncated) {
|
|
64
74
|
return /*#__PURE__*/_react["default"].createElement(_Tip.Tip, _extends({
|
|
65
75
|
content: children
|
|
66
76
|
}, tipProp), styledTextResult);
|
|
67
|
-
}
|
|
77
|
+
} // place the text content in a tip if truncate !== 'tip'
|
|
78
|
+
// it displays even if the text has not truncated
|
|
79
|
+
|
|
68
80
|
|
|
69
|
-
|
|
81
|
+
if (truncate !== 'tip') {
|
|
82
|
+
return /*#__PURE__*/_react["default"].createElement(_Tip.Tip, tipProp, styledTextResult);
|
|
83
|
+
}
|
|
70
84
|
}
|
|
71
85
|
|
|
72
86
|
return styledTextResult;
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
11
|
|
|
14
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -22,20 +20,24 @@ var Fill = function Fill() {
|
|
|
22
20
|
return setValue(event.target.value);
|
|
23
21
|
};
|
|
24
22
|
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
return (
|
|
24
|
+
/*#__PURE__*/
|
|
25
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
26
|
+
// <Grommet theme={...}>
|
|
27
|
+
_react["default"].createElement(_grommet.Box, {
|
|
28
|
+
width: "large",
|
|
29
|
+
height: "medium",
|
|
30
|
+
border: {
|
|
31
|
+
color: 'brand',
|
|
32
|
+
size: 'medium'
|
|
33
|
+
}
|
|
34
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextArea, {
|
|
35
|
+
value: value,
|
|
36
|
+
onChange: onChange,
|
|
37
|
+
fill: true
|
|
38
|
+
})) // </Grommet>
|
|
39
|
+
|
|
40
|
+
);
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
exports.Fill = Fill;
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
11
|
|
|
14
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -22,45 +20,49 @@ var InsideFormField = function InsideFormField() {
|
|
|
22
20
|
value = _useState[0],
|
|
23
21
|
setValue = _useState[1];
|
|
24
22
|
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
23
|
+
return (
|
|
24
|
+
/*#__PURE__*/
|
|
25
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
26
|
+
// <Grommet theme={...}>
|
|
27
|
+
_react["default"].createElement(_grommet.Box, null, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
28
|
+
align: "center",
|
|
29
|
+
pad: "large"
|
|
30
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Text, {
|
|
31
|
+
weight: "bold"
|
|
32
|
+
}, "TextArea as component prop of FormField"), /*#__PURE__*/_react["default"].createElement(_grommet.Form, null, /*#__PURE__*/_react["default"].createElement(_grommet.FormField, {
|
|
33
|
+
label: "FormField label",
|
|
34
|
+
htmlFor: "text-area",
|
|
35
|
+
component: _grommet.TextArea,
|
|
36
|
+
placeholder: "placeholder from FormField"
|
|
37
|
+
}), /*#__PURE__*/_react["default"].createElement(_grommet.Button, {
|
|
38
|
+
type: "submit",
|
|
39
|
+
label: "submit"
|
|
40
|
+
}))), /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
41
|
+
align: "center",
|
|
42
|
+
pad: "large"
|
|
43
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Text, {
|
|
44
|
+
weight: "bold"
|
|
45
|
+
}, "TextArea inside FormField"), /*#__PURE__*/_react["default"].createElement(_grommet.Form, {
|
|
46
|
+
value: value,
|
|
47
|
+
onChange: function onChange(nextValue) {
|
|
48
|
+
return setValue(nextValue);
|
|
49
|
+
},
|
|
50
|
+
onSubmit: function onSubmit() {
|
|
51
|
+
return console.log(value);
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.FormField, {
|
|
54
|
+
name: "value",
|
|
55
|
+
label: "FormField label",
|
|
56
|
+
required: true
|
|
57
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextArea, {
|
|
58
|
+
name: "value",
|
|
59
|
+
placeholder: "placeholder from TextArea"
|
|
60
|
+
})), /*#__PURE__*/_react["default"].createElement(_grommet.Button, {
|
|
61
|
+
type: "submit",
|
|
62
|
+
label: "submit"
|
|
63
|
+
})))) // </Grommet>
|
|
64
|
+
|
|
65
|
+
);
|
|
64
66
|
};
|
|
65
67
|
|
|
66
68
|
exports.InsideFormField = InsideFormField;
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
11
|
|
|
14
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -24,15 +22,19 @@ var Resize = function Resize(props) {
|
|
|
24
22
|
return setValue(event.target.value);
|
|
25
23
|
};
|
|
26
24
|
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
return (
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
28
|
+
// <Grommet theme={...}>
|
|
29
|
+
_react["default"].createElement(_grommet.Box, {
|
|
30
|
+
align: "center",
|
|
31
|
+
pad: "large"
|
|
32
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextArea, _extends({
|
|
33
|
+
value: value,
|
|
34
|
+
onChange: onChange
|
|
35
|
+
}, props))) // </Grommet>
|
|
36
|
+
|
|
37
|
+
);
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
var NonResizable = function NonResizable() {
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
11
|
|
|
14
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -24,15 +22,19 @@ var Resize = function Resize(props) {
|
|
|
24
22
|
return setValue(event.target.value);
|
|
25
23
|
};
|
|
26
24
|
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
return (
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
28
|
+
// <Grommet theme={...}>
|
|
29
|
+
_react["default"].createElement(_grommet.Box, {
|
|
30
|
+
align: "center",
|
|
31
|
+
pad: "large"
|
|
32
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextArea, _extends({
|
|
33
|
+
value: value,
|
|
34
|
+
onChange: onChange
|
|
35
|
+
}, props))) // </Grommet>
|
|
36
|
+
|
|
37
|
+
);
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
var Simple = function Simple() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.StyledTextInputContainer = exports.StyledTextInput = exports.StyledSuggestions = exports.StyledPlaceholder = exports.StyledIcon = void 0;
|
|
5
5
|
|
|
6
6
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
7
7
|
|
|
@@ -160,7 +160,10 @@ var TextInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
160
160
|
|
|
161
161
|
setShowDrop(false);
|
|
162
162
|
if (onSuggestionsClose) onSuggestionsClose();
|
|
163
|
-
}, [onSuggestionsClose, suggestions]);
|
|
163
|
+
}, [onSuggestionsClose, suggestions]);
|
|
164
|
+
var clickOutside = (0, _react.useCallback)(function (event) {
|
|
165
|
+
if (event.target !== inputRef.current) closeDrop();
|
|
166
|
+
}, [inputRef, closeDrop]); // Handle scenarios where we have focus, the drop isn't showing,
|
|
164
167
|
// and the suggestions change. We don't want to open the drop if
|
|
165
168
|
// the drop has been closed by onEsc and the suggestions haven't
|
|
166
169
|
// changed. So, we remember the suggestions we are showing when
|
|
@@ -174,7 +177,9 @@ var TextInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
174
177
|
}, [focus, openDrop, showDrop, suggestions, suggestionsAtClose]); // if we have no suggestions, close drop if it's open
|
|
175
178
|
|
|
176
179
|
(0, _react.useEffect)(function () {
|
|
177
|
-
if (showDrop && (!suggestions || !suggestions.length))
|
|
180
|
+
if (showDrop && (!suggestions || !suggestions.length)) {
|
|
181
|
+
closeDrop();
|
|
182
|
+
}
|
|
178
183
|
}, [closeDrop, showDrop, suggestions]);
|
|
179
184
|
var valueSuggestionIndex = (0, _react.useMemo)(function () {
|
|
180
185
|
return suggestions ? suggestions.map(function (suggestion) {
|
|
@@ -287,7 +292,7 @@ var TextInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
287
292
|
align: dropAlign,
|
|
288
293
|
responsive: false,
|
|
289
294
|
target: dropTarget || inputRef.current,
|
|
290
|
-
onClickOutside:
|
|
295
|
+
onClickOutside: clickOutside,
|
|
291
296
|
onEsc: closeDrop
|
|
292
297
|
}, dropProps), /*#__PURE__*/_react["default"].createElement(ContainerBox, {
|
|
293
298
|
overflow: "auto",
|
|
@@ -318,7 +323,7 @@ var TextInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
318
323
|
ref: itemRef
|
|
319
324
|
}, /*#__PURE__*/_react["default"].createElement(_Button.Button, {
|
|
320
325
|
active: activeSuggestionIndex === index,
|
|
321
|
-
fill:
|
|
326
|
+
fill: "horizontal",
|
|
322
327
|
plain: !child ? undefined : true,
|
|
323
328
|
align: "start",
|
|
324
329
|
kind: !child ? 'option' : undefined,
|
|
@@ -413,6 +418,10 @@ var TextInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
413
418
|
// will come from this onChange and remove the placeholder
|
|
414
419
|
// so we need to update state to ensure the styled
|
|
415
420
|
// placeholder only appears when there is no value
|
|
421
|
+
if (suggestions && focus && !showDrop) {
|
|
422
|
+
openDrop();
|
|
423
|
+
}
|
|
424
|
+
|
|
416
425
|
setValue(event.target.value);
|
|
417
426
|
setActiveSuggestionIndex(resetSuggestionIndex);
|
|
418
427
|
if (onChange) onChange(event);
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
A11yTitleType,
|
|
4
|
+
Omit,
|
|
5
|
+
PlaceHolderType,
|
|
6
|
+
TextAlignType,
|
|
7
|
+
} from '../../utils';
|
|
3
8
|
import { DropProps } from '../Drop';
|
|
4
9
|
|
|
5
10
|
export interface TextInputProps
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
11
|
|
|
14
12
|
var suggestions = Array(100).fill().map(function (_, i) {
|
|
@@ -28,23 +26,26 @@ var DefaultSuggestion = function DefaultSuggestion() {
|
|
|
28
26
|
return setValue(event.suggestion);
|
|
29
27
|
};
|
|
30
28
|
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
return (
|
|
30
|
+
/*#__PURE__*/
|
|
31
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
32
|
+
// <Grommet theme={...}>
|
|
33
|
+
_react["default"].createElement(_grommet.Box, {
|
|
34
|
+
fill: true,
|
|
35
|
+
align: "center",
|
|
36
|
+
justify: "start",
|
|
37
|
+
pad: "large"
|
|
38
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
39
|
+
width: "medium"
|
|
40
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
41
|
+
value: value,
|
|
42
|
+
onChange: onChange,
|
|
43
|
+
onSelect: onSelect,
|
|
44
|
+
suggestions: suggestions,
|
|
45
|
+
defaultSuggestion: 1
|
|
46
|
+
}))) // </Grommet>
|
|
47
|
+
|
|
48
|
+
);
|
|
48
49
|
};
|
|
49
50
|
|
|
50
51
|
exports.DefaultSuggestion = DefaultSuggestion;
|
|
@@ -9,30 +9,31 @@ var _grommetIcons = require("grommet-icons");
|
|
|
9
9
|
|
|
10
10
|
var _grommet = require("grommet");
|
|
11
11
|
|
|
12
|
-
var _themes = require("grommet/themes");
|
|
13
|
-
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
13
|
|
|
16
14
|
var Icon = function Icon() {
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
return (
|
|
16
|
+
/*#__PURE__*/
|
|
17
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
18
|
+
// <Grommet theme={...}>
|
|
19
|
+
_react["default"].createElement(_grommet.Box, {
|
|
20
|
+
fill: true,
|
|
21
|
+
align: "center",
|
|
22
|
+
justify: "start",
|
|
23
|
+
pad: "large"
|
|
24
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
25
|
+
width: "medium",
|
|
26
|
+
gap: "medium"
|
|
27
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
28
|
+
icon: /*#__PURE__*/_react["default"].createElement(_grommetIcons.Search, null),
|
|
29
|
+
placeholder: "search ..."
|
|
30
|
+
}), /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
31
|
+
icon: /*#__PURE__*/_react["default"].createElement(_grommetIcons.Search, null),
|
|
32
|
+
reverse: true,
|
|
33
|
+
placeholder: "search ..."
|
|
34
|
+
}))) // </Grommet>
|
|
35
|
+
|
|
36
|
+
);
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
exports.Icon = Icon;
|
|
@@ -7,8 +7,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _grommet = require("grommet");
|
|
9
9
|
|
|
10
|
-
var _themes = require("grommet/themes");
|
|
11
|
-
|
|
12
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
11
|
|
|
14
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -51,34 +49,38 @@ var InsideFormField = function InsideFormField(props) {
|
|
|
51
49
|
}));
|
|
52
50
|
};
|
|
53
51
|
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
52
|
+
return (
|
|
53
|
+
/*#__PURE__*/
|
|
54
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
55
|
+
// <Grommet theme={...}>
|
|
56
|
+
_react["default"].createElement(_grommet.Box, {
|
|
57
|
+
align: "center",
|
|
58
|
+
pad: "large"
|
|
59
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Form, {
|
|
60
|
+
onSubmit: function onSubmit(_ref) {
|
|
61
|
+
var nextValue = _ref.value;
|
|
62
|
+
console.log(nextValue);
|
|
63
|
+
setState({
|
|
64
|
+
value: '',
|
|
65
|
+
suggestions: allSuggestions
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.FormField, _extends({
|
|
69
|
+
label: "Label",
|
|
70
|
+
htmlFor: "text-input"
|
|
71
|
+
}, props), /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
72
|
+
id: "text-input",
|
|
73
|
+
placeholder: "placeholder",
|
|
74
|
+
value: state.value,
|
|
75
|
+
onChange: onChange,
|
|
76
|
+
onSelect: onSelect,
|
|
77
|
+
suggestions: state.suggestions
|
|
78
|
+
})), /*#__PURE__*/_react["default"].createElement(_grommet.Button, {
|
|
79
|
+
type: "submit",
|
|
80
|
+
label: "submit"
|
|
81
|
+
}))) // </Grommet>
|
|
82
|
+
|
|
83
|
+
);
|
|
82
84
|
};
|
|
83
85
|
|
|
84
86
|
exports.InsideFormField = InsideFormField;
|