grommet 2.21.0 → 2.22.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/Anchor/index.d.ts +2 -0
- package/components/Anchor/stories/Default.js +17 -8
- package/components/Box/StyledBox.js +1 -3
- package/components/Box/stories/Animation.js +23 -21
- package/components/Box/stories/Background.js +94 -92
- package/components/Box/stories/Border.js +88 -86
- package/components/Box/stories/Custom.js +15 -13
- package/components/Box/stories/Elevation.js +27 -25
- package/components/Box/stories/Fixed.js +43 -41
- package/components/Box/stories/MinMax.js +206 -204
- package/components/Box/stories/OnClick.js +27 -25
- package/components/Box/stories/RTL.js +35 -31
- package/components/Box/stories/Round.js +55 -53
- package/components/Box/stories/Simple.js +46 -44
- package/components/Button/stories/CustomThemed/Active.js +1 -0
- package/components/Button/stories/CustomThemed/Typescript.tsx +1 -1
- package/components/Button/stories/Multiple.js +1 -1
- package/components/Button/stories/typescript/Badge.tsx +58 -0
- package/components/Calendar/Calendar.js +83 -115
- package/components/Calendar/stories/Multiple.js +2 -1
- package/components/Calendar/stories/Simple.js +0 -8
- package/components/Calendar/utils.js +78 -18
- package/components/Carousel/stories/Autoplay.js +6 -3
- package/components/Carousel/stories/ControlVariations.js +9 -9
- package/components/Carousel/stories/Controlled.js +3 -3
- package/components/Carousel/stories/Simple.js +3 -3
- package/components/Chart/stories/Labelled.js +2 -2
- package/components/Chart/utils.js +4 -4
- package/components/CheckBox/stories/Simple.js +9 -3
- package/components/CheckBox/stories/WithStickyDiv.js +1 -1
- package/components/CheckBoxGroup/stories/Disabled.js +7 -1
- package/components/DataChart/DataChart.js +27 -5
- package/components/DataChart/XAxis.js +4 -7
- package/components/DataChart/YAxis.js +4 -7
- package/components/DataChart/YGuide.js +12 -1
- package/components/DataChart/index.d.ts +6 -1
- package/components/DataChart/propTypes.js +4 -1
- package/components/DataChart/stories/Placeholder.js +48 -0
- package/components/DataTable/DataTable.js +57 -45
- package/components/{TextArea/stories/Fill.js → DataTable/PlaceholderBody.js} +14 -42
- package/components/DataTable/stories/MultiplePin.js +1 -1
- package/components/DateInput/DateInput.js +60 -22
- package/components/DateInput/stories/Form.js +2 -1
- package/components/DateInput/stories/Format.js +2 -1
- package/components/DateInput/stories/FormatInline.js +16 -8
- package/components/DateInput/stories/Inline.js +2 -1
- package/components/DateInput/stories/Range.js +2 -1
- package/components/DateInput/stories/RangeFormat.js +2 -1
- package/components/DateInput/stories/Simple.js +2 -1
- package/components/DateInput/stories/typescript/European.tsx +2 -1
- package/components/DateInput/utils.js +2 -2
- package/components/Diagram/stories/Animated.js +43 -41
- package/components/Diagram/stories/Progressing.js +31 -29
- package/components/Diagram/stories/typescript/Connections.tsx +14 -13
- package/components/Distribution/stories/typescript/Simple.tsx +24 -20
- package/components/Drop/Drop.js +12 -6
- package/components/Drop/index.d.ts +1 -0
- package/components/Drop/propTypes.js +1 -0
- package/components/Drop/stories/CustomThemed/Lazy.js +20 -16
- package/components/Drop/stories/CustomThemed/Themed.js +5 -4
- package/components/Drop/stories/Inline.js +69 -0
- package/components/Drop/stories/Meter.js +7 -5
- package/components/Drop/stories/Multiple.js +20 -6
- package/components/Drop/stories/Overflow.js +7 -4
- package/components/Drop/stories/Plain.js +7 -5
- package/components/Drop/stories/Progressive.js +6 -4
- package/components/Drop/stories/Simple.js +6 -4
- package/components/Drop/stories/Styled.js +11 -8
- package/components/Drop/stories/TrapFocus.js +5 -3
- package/components/DropButton/stories/Menu.js +8 -4
- package/components/DropButton/stories/Simple.js +4 -3
- package/components/Footer/stories/DoubleFooter.js +36 -32
- package/components/Footer/stories/Simple.js +24 -20
- package/components/Footer/stories/Sitemap.js +34 -30
- package/components/Footer/stories/Social.js +34 -30
- package/components/Form/stories/AggregateValidation.js +64 -54
- package/components/Form/stories/ArrayOfFormFields.js +58 -54
- package/components/Form/stories/Controlled.js +99 -95
- package/components/Form/stories/ControlledInput.js +129 -125
- package/components/Form/stories/ControlledInputLazy.js +129 -125
- package/components/Form/stories/ControlledLazy.js +97 -93
- package/components/Form/stories/{Custom.js → CustomThemed/Custom.js} +1 -1
- package/components/Form/stories/{FieldBorderPosition.js → CustomThemed/FieldBorderPosition.js} +23 -19
- package/components/Form/stories/{FieldCustomStates.js → CustomThemed/FieldCustomStates.js} +1 -1
- package/components/Form/stories/{FieldSpacingOptions.js → CustomThemed/FieldSpacingOptions.js} +5 -5
- package/components/Form/stories/{RequiredLabel.js → CustomThemed/RequiredLabel.js} +1 -1
- package/components/Form/stories/{Themed.js → CustomThemed/Themed.js} +2 -2
- package/components/Form/stories/DynamicFields.js +62 -58
- package/components/Form/stories/FieldStates.js +62 -60
- package/components/Form/stories/FieldWithChildren.js +109 -105
- package/components/Form/stories/FieldWithComponentProp.js +109 -105
- package/components/Form/stories/HelpAndError.js +39 -18
- package/components/Form/stories/Uncontrolled.js +99 -95
- package/components/Form/stories/ValidateOnBlur.js +65 -61
- package/components/Form/stories/ValidateOnChange.js +82 -78
- package/components/Form/stories/ValidateOnMount.js +67 -63
- package/components/Form/stories/typescript/TypedForm.tsx +69 -66
- package/components/FormField/FormField.js +1 -1
- package/components/FormField/stories/{typescript → CustomThemed}/Custom.tsx +1 -1
- package/components/FormField/stories/Simple.js +22 -20
- package/components/Grid/StyledGrid.js +1 -3
- package/components/Grid/stories/AreasPropAlternative.js +27 -23
- package/components/Grid/stories/Border.js +75 -73
- package/components/Grid/stories/{Responsive.js → CustomThemed/Responsive.js} +1 -1
- package/components/Grid/stories/NColumn.js +28 -24
- package/components/Grid/stories/Percentages.js +30 -26
- package/components/Grid/stories/ResponsiveCards.js +21 -17
- package/components/Grid/stories/typescript/App.tsx +10 -4
- package/components/Image/stories/Fallback.js +10 -8
- package/components/Image/stories/Fill.js +20 -18
- package/components/Image/stories/Fit.js +24 -22
- package/components/Image/stories/Opacity.js +39 -37
- package/components/Image/stories/Simple.js +9 -7
- package/components/InfiniteScroll/stories/Basics.js +18 -16
- package/components/InfiniteScroll/stories/ClassChildren.js +14 -12
- package/components/InfiniteScroll/stories/Grid.js +21 -19
- package/components/InfiniteScroll/stories/GridWithShow.js +22 -20
- package/components/InfiniteScroll/stories/HeightReplace.js +20 -18
- package/components/InfiniteScroll/stories/Marker.js +18 -16
- package/components/InfiniteScroll/stories/Replace.js +19 -17
- package/components/InfiniteScroll/stories/Show.js +18 -16
- package/components/InfiniteScroll/stories/ShowAfter.js +18 -16
- package/components/InfiniteScroll/stories/ShowBefore.js +18 -16
- package/components/InfiniteScroll/stories/Variable.js +19 -17
- package/components/InfiniteScroll/stories/typescript/OnMore.tsx +18 -24
- package/components/InfiniteScroll/stories/typescript/OnMoreStep.tsx +18 -24
- package/components/Keyboard/stories/OnDocument.js +1 -5
- package/components/Layer/stories/Center.js +83 -79
- package/components/Layer/stories/Corner.js +29 -25
- package/components/Layer/stories/{Round.js → CustomThemed/Round.js} +1 -1
- package/components/Layer/stories/Form.js +72 -68
- package/components/Layer/stories/Full.js +37 -33
- package/components/Layer/stories/Notification.js +51 -47
- package/components/Layer/stories/Plain.js +24 -20
- package/components/Layer/stories/RTL.js +32 -28
- package/components/Layer/stories/ScrollBody.js +43 -41
- package/components/Layer/stories/Target.js +74 -70
- package/components/Main/stories/typescript/Simple.tsx +6 -4
- package/components/Markdown/stories/Override.js +14 -12
- package/components/Markdown/stories/Simple.js +12 -10
- package/components/MaskedInput/MaskedInput.js +1 -1
- package/components/MaskedInput/index.d.ts +1 -0
- package/components/MaskedInput/propTypes.js +1 -0
- package/components/MaskedInput/stories/CustomBox.js +48 -44
- package/components/MaskedInput/stories/Date.js +54 -50
- package/components/MaskedInput/stories/DateRange.js +87 -83
- package/components/MaskedInput/stories/DateTimeDrop.js +30 -28
- package/components/MaskedInput/stories/Filtered.js +32 -28
- package/components/MaskedInput/stories/Form.js +34 -32
- package/components/MaskedInput/stories/IPV4Range.js +69 -65
- package/components/MaskedInput/stories/IPv4Address.js +45 -41
- package/components/MaskedInput/stories/Phone.js +43 -39
- package/components/MaskedInput/stories/SizeUnits.js +35 -31
- package/components/MaskedInput/stories/Time.js +46 -42
- package/components/MaskedInput/stories/URL.js +28 -24
- package/components/MaskedInput/stories/typescript/Email.tsx +24 -20
- package/components/Menu/Menu.js +8 -2
- package/components/Menu/stories/Justify.js +4 -4
- package/components/Menu/stories/typescript/Children.tsx +4 -3
- package/components/NameValueList/stories/Align.js +37 -35
- package/components/NameValueList/stories/CustomName.js +23 -21
- package/components/NameValueList/stories/CustomValue.js +64 -62
- package/components/NameValueList/stories/Layout.js +43 -41
- package/components/NameValueList/stories/PairProps.js +24 -22
- package/components/NameValueList/stories/Simple.js +16 -14
- package/components/NameValueList/stories/Width.js +38 -36
- package/components/Nav/stories/Sidebar.js +5 -3
- package/components/Notification/Notification.js +119 -15
- package/components/Notification/index.d.ts +3 -2
- package/components/Notification/propTypes.js +4 -1
- package/components/Notification/stories/Global.js +87 -0
- package/components/{CheckBox/stories/Disabled.js → Page/Page.js} +34 -33
- package/components/Page/PageContext.js +9 -0
- package/components/Page/README.md +2 -0
- package/components/Page/index.d.ts +12 -0
- package/components/Page/index.js +12 -0
- package/components/Page/propTypes.js +19 -0
- package/components/Page/stories/Background.js +42 -0
- package/components/Page/stories/ContentBackground.js +44 -0
- package/components/Page/stories/CustomThemed/LeftColumn.js +78 -0
- package/components/Page/stories/GlobalHeader.js +47 -0
- package/components/Page/stories/MultipleBackgrounds.js +75 -0
- package/components/Page/stories/MultipleContent.js +49 -0
- package/components/Page/stories/PageNotificaton.js +91 -0
- package/components/Page/stories/Simple.js +39 -0
- package/components/{CheckBox/stories/Toggle.js → PageContent/PageContent.js} +28 -32
- package/components/PageContent/README.md +2 -0
- package/components/PageContent/index.d.ts +19 -0
- package/components/PageContent/index.js +8 -0
- package/components/PageContent/propTypes.js +31 -0
- package/components/Pagination/stories/Grid.js +34 -30
- package/components/Pagination/stories/NumberEdgePages.js +18 -16
- package/components/Pagination/stories/NumberMiddlePages.js +18 -16
- package/components/Pagination/stories/Simple.js +19 -17
- package/components/Pagination/stories/Size.js +20 -18
- package/components/RadioButton/stories/CustomThemed/Theme.js +5 -5
- package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +7 -10
- package/components/RadioButtonGroup/stories/typescript/Simple.tsx +11 -11
- package/components/RangeInput/RangeInput.js +9 -5
- package/components/RangeInput/StyledRangeInput.js +11 -5
- package/components/RangeInput/stories/{Bounds.js → CustomThemed/Bounds.js} +1 -1
- package/{es6/components/RangeInput/stories/typescript → components/RangeInput/stories/CustomThemed}/CustomRange.tsx +2 -2
- package/components/RangeInput/stories/{Disabled.js → CustomThemed/Disabled.js} +1 -1
- package/components/RangeInput/stories/{TrackColor.js → CustomThemed/TrackColor.js} +1 -1
- package/components/RangeSelector/stories/Basics.js +32 -30
- package/components/RangeSelector/stories/{Custom.js → CustomThemed/Custom.js} +1 -1
- package/components/RangeSelector/stories/{CustomEdgeControl.js → CustomThemed/CustomEdgeControl.js} +1 -1
- package/components/RangeSelector/stories/Step.js +32 -30
- package/components/RangeSelector/stories/Thin.js +11 -9
- package/components/RangeSelector/stories/Vertical.js +32 -30
- package/components/Select/Select.js +15 -4
- package/components/Select/SelectContainer.js +39 -33
- package/components/Select/index.d.ts +3 -3
- package/components/Select/propTypes.js +1 -1
- package/components/Sidebar/stories/Labels.js +3 -5
- package/components/SkipLinks/SkipLinks.js +1 -0
- package/components/Stack/stories/Simple.js +17 -8
- package/components/TableCell/TableCell.js +1 -1
- package/components/TableCell/propTypes.js +11 -0
- package/components/Tabs/stories/Responsive.js +17 -102
- package/components/Tabs/stories/Rich.js +29 -51
- package/components/Tabs/stories/Scrollable.js +5 -3
- package/components/Tabs/stories/typescript/Controlled.tsx +18 -17
- package/components/Text/stories/All.js +5 -1
- package/components/Tip/Tip.js +6 -14
- package/components/Tip/stories/Caret.js +1 -3
- package/components/Tip/stories/CustomThemed/Themed.tsx +3 -6
- package/components/Tip/stories/typescript/Animated.tsx +2 -2
- package/components/Tip/stories/typescript/Children.tsx +67 -49
- package/components/index.js +16 -0
- package/es6/components/Anchor/index.d.ts +2 -0
- package/es6/components/Anchor/stories/Default.js +16 -7
- package/es6/components/Box/StyledBox.js +1 -3
- package/es6/components/Box/stories/Animation.js +24 -21
- package/es6/components/Box/stories/Background.js +95 -92
- package/es6/components/Box/stories/Border.js +89 -86
- package/es6/components/Box/stories/Custom.js +16 -13
- package/es6/components/Box/stories/Elevation.js +28 -25
- package/es6/components/Box/stories/Fixed.js +44 -41
- package/es6/components/Box/stories/MinMax.js +207 -204
- package/es6/components/Box/stories/OnClick.js +28 -25
- package/es6/components/Box/stories/RTL.js +36 -31
- package/es6/components/Box/stories/Round.js +56 -53
- package/es6/components/Box/stories/Simple.js +47 -44
- package/es6/components/Button/stories/CustomThemed/Active.js +1 -0
- package/es6/components/Button/stories/CustomThemed/Typescript.tsx +1 -1
- package/es6/components/Button/stories/Multiple.js +1 -1
- package/es6/components/Button/stories/typescript/Badge.tsx +58 -0
- package/es6/components/Calendar/Calendar.js +84 -116
- package/es6/components/Calendar/stories/Multiple.js +2 -1
- package/es6/components/Calendar/stories/Simple.js +0 -8
- package/es6/components/Calendar/utils.js +72 -15
- package/es6/components/Carousel/stories/Autoplay.js +6 -3
- package/es6/components/Carousel/stories/ControlVariations.js +9 -9
- package/es6/components/Carousel/stories/Controlled.js +3 -3
- package/es6/components/Carousel/stories/Simple.js +3 -3
- package/es6/components/Chart/stories/Labelled.js +2 -2
- package/es6/components/Chart/utils.js +4 -4
- package/es6/components/CheckBox/stories/Simple.js +9 -3
- package/es6/components/CheckBox/stories/WithStickyDiv.js +1 -1
- package/es6/components/CheckBoxGroup/stories/Disabled.js +7 -1
- package/es6/components/DataChart/DataChart.js +26 -5
- package/es6/components/DataChart/XAxis.js +4 -7
- package/es6/components/DataChart/YAxis.js +4 -7
- package/es6/components/DataChart/YGuide.js +12 -1
- package/es6/components/DataChart/index.d.ts +6 -1
- package/es6/components/DataChart/propTypes.js +4 -1
- package/es6/components/DataChart/stories/Placeholder.js +36 -0
- package/es6/components/DataTable/DataTable.js +56 -45
- package/es6/components/DataTable/PlaceholderBody.js +13 -0
- package/es6/components/DataTable/stories/MultiplePin.js +1 -1
- package/es6/components/DateInput/DateInput.js +60 -22
- package/es6/components/DateInput/stories/Form.js +2 -1
- package/es6/components/DateInput/stories/Format.js +2 -1
- package/es6/components/DateInput/stories/FormatInline.js +16 -8
- package/es6/components/DateInput/stories/Inline.js +2 -1
- package/es6/components/DateInput/stories/Range.js +2 -1
- package/es6/components/DateInput/stories/RangeFormat.js +2 -1
- package/es6/components/DateInput/stories/Simple.js +2 -1
- package/es6/components/DateInput/stories/typescript/European.tsx +2 -1
- package/es6/components/DateInput/utils.js +2 -2
- package/es6/components/Diagram/stories/Animated.js +44 -41
- package/es6/components/Diagram/stories/Progressing.js +32 -29
- package/es6/components/Diagram/stories/typescript/Connections.tsx +14 -13
- package/es6/components/Distribution/stories/typescript/Simple.tsx +24 -20
- package/es6/components/Drop/Drop.js +10 -6
- package/es6/components/Drop/index.d.ts +1 -0
- package/es6/components/Drop/propTypes.js +1 -0
- package/es6/components/Drop/stories/CustomThemed/Lazy.js +20 -16
- package/es6/components/Drop/stories/CustomThemed/Themed.js +5 -4
- package/es6/components/Drop/stories/Inline.js +55 -0
- package/es6/components/Drop/stories/Meter.js +6 -5
- package/es6/components/Drop/stories/Multiple.js +19 -6
- package/es6/components/Drop/stories/Overflow.js +6 -4
- package/es6/components/Drop/stories/Plain.js +6 -5
- package/es6/components/Drop/stories/Progressive.js +5 -4
- package/es6/components/Drop/stories/Simple.js +5 -4
- package/es6/components/Drop/stories/Styled.js +10 -8
- package/es6/components/Drop/stories/TrapFocus.js +4 -3
- package/es6/components/DropButton/stories/Menu.js +8 -4
- package/es6/components/DropButton/stories/Simple.js +4 -3
- package/es6/components/Footer/stories/DoubleFooter.js +37 -33
- package/es6/components/Footer/stories/Simple.js +25 -21
- package/es6/components/Footer/stories/Sitemap.js +35 -31
- package/es6/components/Footer/stories/Social.js +35 -31
- package/es6/components/Form/stories/AggregateValidation.js +65 -54
- package/es6/components/Form/stories/ArrayOfFormFields.js +59 -55
- package/es6/components/Form/stories/Controlled.js +100 -95
- package/es6/components/Form/stories/ControlledInput.js +130 -125
- package/es6/components/Form/stories/ControlledInputLazy.js +130 -125
- package/es6/components/Form/stories/ControlledLazy.js +98 -93
- package/es6/components/Form/stories/{Custom.js → CustomThemed/Custom.js} +1 -1
- package/es6/components/Form/stories/{FieldBorderPosition.js → CustomThemed/FieldBorderPosition.js} +24 -20
- package/es6/components/Form/stories/{FieldCustomStates.js → CustomThemed/FieldCustomStates.js} +1 -1
- package/es6/components/Form/stories/{FieldSpacingOptions.js → CustomThemed/FieldSpacingOptions.js} +5 -5
- package/es6/components/Form/stories/{RequiredLabel.js → CustomThemed/RequiredLabel.js} +1 -1
- package/es6/components/Form/stories/{Themed.js → CustomThemed/Themed.js} +2 -2
- package/es6/components/Form/stories/DynamicFields.js +63 -58
- package/es6/components/Form/stories/FieldStates.js +63 -60
- package/es6/components/Form/stories/FieldWithChildren.js +110 -105
- package/es6/components/Form/stories/FieldWithComponentProp.js +110 -105
- package/es6/components/Form/stories/HelpAndError.js +40 -18
- package/es6/components/Form/stories/Uncontrolled.js +100 -95
- package/es6/components/Form/stories/ValidateOnBlur.js +66 -61
- package/es6/components/Form/stories/ValidateOnChange.js +83 -78
- package/es6/components/Form/stories/ValidateOnMount.js +68 -63
- package/es6/components/Form/stories/typescript/TypedForm.tsx +69 -66
- package/es6/components/FormField/FormField.js +1 -1
- package/es6/components/FormField/stories/{typescript → CustomThemed}/Custom.tsx +1 -1
- package/es6/components/FormField/stories/Simple.js +23 -20
- package/es6/components/Grid/StyledGrid.js +1 -3
- package/es6/components/Grid/stories/AreasPropAlternative.js +28 -23
- package/es6/components/Grid/stories/Border.js +76 -73
- package/es6/components/Grid/stories/{Responsive.js → CustomThemed/Responsive.js} +1 -1
- package/es6/components/Grid/stories/NColumn.js +29 -24
- package/es6/components/Grid/stories/Percentages.js +31 -26
- package/es6/components/Grid/stories/ResponsiveCards.js +22 -18
- package/es6/components/Grid/stories/typescript/App.tsx +10 -4
- package/es6/components/Image/stories/Fallback.js +11 -8
- package/es6/components/Image/stories/Fill.js +21 -18
- package/es6/components/Image/stories/Fit.js +25 -22
- package/es6/components/Image/stories/Opacity.js +40 -37
- package/es6/components/Image/stories/Simple.js +10 -7
- package/es6/components/InfiniteScroll/stories/Basics.js +19 -16
- package/es6/components/InfiniteScroll/stories/ClassChildren.js +15 -12
- package/es6/components/InfiniteScroll/stories/Grid.js +22 -19
- package/es6/components/InfiniteScroll/stories/GridWithShow.js +23 -20
- package/es6/components/InfiniteScroll/stories/HeightReplace.js +21 -18
- package/es6/components/InfiniteScroll/stories/Marker.js +19 -16
- package/es6/components/InfiniteScroll/stories/Replace.js +20 -17
- package/es6/components/InfiniteScroll/stories/Show.js +19 -16
- package/es6/components/InfiniteScroll/stories/ShowAfter.js +19 -16
- package/es6/components/InfiniteScroll/stories/ShowBefore.js +19 -16
- package/es6/components/InfiniteScroll/stories/Variable.js +20 -17
- package/es6/components/InfiniteScroll/stories/typescript/OnMore.tsx +18 -24
- package/es6/components/InfiniteScroll/stories/typescript/OnMoreStep.tsx +18 -24
- package/es6/components/Keyboard/stories/OnDocument.js +2 -5
- package/es6/components/Layer/stories/Center.js +84 -79
- package/es6/components/Layer/stories/Corner.js +30 -25
- package/es6/components/Layer/stories/{Round.js → CustomThemed/Round.js} +1 -1
- package/es6/components/Layer/stories/Form.js +73 -68
- package/es6/components/Layer/stories/Full.js +38 -33
- package/es6/components/Layer/stories/Notification.js +52 -47
- package/es6/components/Layer/stories/Plain.js +25 -20
- package/es6/components/Layer/stories/RTL.js +33 -28
- package/es6/components/Layer/stories/ScrollBody.js +44 -41
- package/es6/components/Layer/stories/Target.js +75 -70
- package/es6/components/Main/stories/typescript/Simple.tsx +6 -4
- package/es6/components/Markdown/stories/Override.js +15 -12
- package/es6/components/Markdown/stories/Simple.js +13 -10
- package/es6/components/MaskedInput/MaskedInput.js +1 -1
- package/es6/components/MaskedInput/index.d.ts +1 -0
- package/es6/components/MaskedInput/propTypes.js +1 -0
- package/es6/components/MaskedInput/stories/CustomBox.js +49 -44
- package/es6/components/MaskedInput/stories/Date.js +55 -50
- package/es6/components/MaskedInput/stories/DateRange.js +88 -83
- package/es6/components/MaskedInput/stories/DateTimeDrop.js +31 -28
- package/es6/components/MaskedInput/stories/Filtered.js +33 -28
- package/es6/components/MaskedInput/stories/Form.js +35 -32
- package/es6/components/MaskedInput/stories/IPV4Range.js +70 -65
- package/es6/components/MaskedInput/stories/IPv4Address.js +46 -41
- package/es6/components/MaskedInput/stories/Phone.js +44 -39
- package/es6/components/MaskedInput/stories/SizeUnits.js +36 -31
- package/es6/components/MaskedInput/stories/Time.js +47 -42
- package/es6/components/MaskedInput/stories/URL.js +29 -24
- package/es6/components/MaskedInput/stories/typescript/Email.tsx +24 -20
- package/es6/components/Menu/Menu.js +8 -2
- package/es6/components/Menu/stories/Justify.js +5 -4
- package/es6/components/Menu/stories/typescript/Children.tsx +4 -3
- package/es6/components/NameValueList/stories/Align.js +38 -35
- package/es6/components/NameValueList/stories/CustomName.js +24 -21
- package/es6/components/NameValueList/stories/CustomValue.js +65 -62
- package/es6/components/NameValueList/stories/Layout.js +44 -41
- package/es6/components/NameValueList/stories/PairProps.js +25 -22
- package/es6/components/NameValueList/stories/Simple.js +17 -14
- package/es6/components/NameValueList/stories/Width.js +39 -36
- package/es6/components/Nav/stories/Sidebar.js +5 -3
- package/es6/components/Notification/Notification.js +119 -16
- package/es6/components/Notification/index.d.ts +3 -2
- package/es6/components/Notification/propTypes.js +3 -1
- package/es6/components/Notification/stories/Global.js +70 -0
- package/es6/components/Page/Page.js +40 -0
- package/es6/components/Page/PageContext.js +2 -0
- package/es6/components/Page/README.md +2 -0
- package/es6/components/Page/index.d.ts +12 -0
- package/es6/components/Page/index.js +2 -0
- package/es6/components/Page/propTypes.js +10 -0
- package/es6/components/Page/stories/Background.js +30 -0
- package/es6/components/Page/stories/ContentBackground.js +32 -0
- package/es6/components/Page/stories/CustomThemed/LeftColumn.js +65 -0
- package/es6/components/Page/stories/GlobalHeader.js +35 -0
- package/es6/components/Page/stories/MultipleBackgrounds.js +63 -0
- package/es6/components/Page/stories/MultipleContent.js +37 -0
- package/es6/components/Page/stories/PageNotificaton.js +77 -0
- package/es6/components/Page/stories/Simple.js +27 -0
- package/es6/components/PageContent/PageContent.js +36 -0
- package/es6/components/PageContent/README.md +2 -0
- package/es6/components/PageContent/index.d.ts +19 -0
- package/es6/components/PageContent/index.js +1 -0
- package/es6/components/PageContent/propTypes.js +21 -0
- package/es6/components/Pagination/stories/Grid.js +35 -30
- package/es6/components/Pagination/stories/NumberEdgePages.js +19 -16
- package/es6/components/Pagination/stories/NumberMiddlePages.js +19 -16
- package/es6/components/Pagination/stories/Simple.js +20 -17
- package/es6/components/Pagination/stories/Size.js +21 -18
- package/es6/components/RadioButton/stories/CustomThemed/Theme.js +5 -5
- package/es6/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +7 -10
- package/es6/components/RadioButtonGroup/stories/typescript/Simple.tsx +11 -11
- package/es6/components/RangeInput/RangeInput.js +9 -5
- package/es6/components/RangeInput/StyledRangeInput.js +11 -5
- package/es6/components/RangeInput/stories/{Bounds.js → CustomThemed/Bounds.js} +1 -1
- package/{components/RangeInput/stories/typescript → es6/components/RangeInput/stories/CustomThemed}/CustomRange.tsx +2 -2
- package/es6/components/RangeInput/stories/{Disabled.js → CustomThemed/Disabled.js} +1 -1
- package/es6/components/RangeInput/stories/{TrackColor.js → CustomThemed/TrackColor.js} +1 -1
- package/es6/components/RangeSelector/stories/Basics.js +33 -30
- package/es6/components/RangeSelector/stories/{Custom.js → CustomThemed/Custom.js} +1 -1
- package/es6/components/RangeSelector/stories/{CustomEdgeControl.js → CustomThemed/CustomEdgeControl.js} +1 -1
- package/es6/components/RangeSelector/stories/Step.js +33 -30
- package/es6/components/RangeSelector/stories/Thin.js +12 -9
- package/es6/components/RangeSelector/stories/Vertical.js +33 -30
- package/es6/components/Select/Select.js +15 -4
- package/es6/components/Select/SelectContainer.js +39 -33
- package/es6/components/Select/index.d.ts +3 -3
- package/es6/components/Select/propTypes.js +1 -1
- package/es6/components/Sidebar/stories/Labels.js +3 -5
- package/es6/components/SkipLinks/SkipLinks.js +1 -0
- package/es6/components/Stack/stories/Simple.js +17 -9
- package/es6/components/TableCell/TableCell.js +1 -1
- package/es6/components/TableCell/propTypes.js +10 -0
- package/es6/components/Tabs/stories/Responsive.js +17 -102
- package/es6/components/Tabs/stories/Rich.js +31 -50
- package/es6/components/Tabs/stories/Scrollable.js +6 -4
- package/es6/components/Tabs/stories/typescript/Controlled.tsx +18 -17
- package/es6/components/Text/stories/All.js +5 -1
- package/es6/components/Tip/Tip.js +6 -15
- package/es6/components/Tip/stories/Caret.js +1 -3
- package/es6/components/Tip/stories/CustomThemed/Themed.tsx +3 -6
- package/es6/components/Tip/stories/typescript/Animated.tsx +2 -2
- package/es6/components/Tip/stories/typescript/Children.tsx +67 -49
- package/es6/components/index.js +2 -0
- package/es6/index.d.ts +2 -0
- package/es6/themes/base.d.ts +69 -0
- package/es6/themes/base.js +134 -6
- package/es6/utils/border.js +40 -36
- package/es6/utils/index.d.ts +11 -12
- package/es6/utils/styles.js +3 -1
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/index.d.ts +2 -0
- package/package.json +23 -23
- package/themes/base.d.ts +69 -0
- package/themes/base.js +135 -6
- package/utils/border.js +46 -42
- package/utils/index.d.ts +11 -12
- package/utils/styles.js +3 -1
- package/components/Accordion/stories/DarkNoAnimation.js +0 -59
- package/components/Anchor/stories/Disabled.js +0 -32
- package/components/Anchor/stories/Inline.js +0 -30
- package/components/Button/stories/CustomThemed/Badge.tsx +0 -129
- package/components/Chart/stories/Types.js +0 -49
- package/components/CheckBox/stories/InsideFormField.js +0 -93
- package/components/CheckBox/stories/Reverse.js +0 -52
- package/components/CheckBoxGroup/stories/FormControlled.js +0 -55
- package/components/CheckBoxGroup/stories/FormUncontrolled.js +0 -69
- package/components/CheckBoxGroup/stories/ObjectOptions.js +0 -71
- package/components/Heading/stories/Color.js +0 -28
- package/components/Layer/stories/Margin.js +0 -61
- package/components/Layer/stories/MarginCenter.js +0 -62
- package/components/Layer/stories/MarginTop.js +0 -71
- package/components/RadioButtonGroup/stories/Simple.js +0 -54
- package/components/Sidebar/stories/typescript/Simple.tsx +0 -68
- package/components/Tabs/stories/CustomThemed/AlignControls.js +0 -83
- package/components/Tabs/stories/CustomThemed/Icon.js +0 -99
- package/components/Tabs/stories/Plain.js +0 -80
- package/components/Tabs/stories/Uncontrolled.js +0 -78
- package/components/Text/stories/Color.js +0 -22
- package/es6/components/Accordion/stories/DarkNoAnimation.js +0 -47
- package/es6/components/Anchor/stories/Disabled.js +0 -21
- package/es6/components/Anchor/stories/Inline.js +0 -19
- package/es6/components/Button/stories/CustomThemed/Badge.tsx +0 -129
- package/es6/components/Chart/stories/Types.js +0 -36
- package/es6/components/CheckBox/stories/Disabled.js +0 -40
- package/es6/components/CheckBox/stories/InsideFormField.js +0 -81
- package/es6/components/CheckBox/stories/Reverse.js +0 -39
- package/es6/components/CheckBox/stories/Toggle.js +0 -39
- package/es6/components/CheckBoxGroup/stories/FormControlled.js +0 -41
- package/es6/components/CheckBoxGroup/stories/FormUncontrolled.js +0 -57
- package/es6/components/CheckBoxGroup/stories/ObjectOptions.js +0 -57
- package/es6/components/Heading/stories/Color.js +0 -16
- package/es6/components/Layer/stories/Margin.js +0 -49
- package/es6/components/Layer/stories/MarginCenter.js +0 -50
- package/es6/components/Layer/stories/MarginTop.js +0 -59
- package/es6/components/RadioButtonGroup/stories/Simple.js +0 -40
- package/es6/components/Sidebar/stories/typescript/Simple.tsx +0 -68
- package/es6/components/Tabs/stories/CustomThemed/AlignControls.js +0 -71
- package/es6/components/Tabs/stories/CustomThemed/Icon.js +0 -85
- package/es6/components/Tabs/stories/Plain.js +0 -68
- package/es6/components/Tabs/stories/Uncontrolled.js +0 -66
- package/es6/components/Text/stories/Color.js +0 -10
- package/es6/components/TextArea/stories/Fill.js +0 -38
|
@@ -93,21 +93,25 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
93
93
|
value = _useFormInput[0],
|
|
94
94
|
setValue = _useFormInput[1];
|
|
95
95
|
|
|
96
|
-
var timestamp
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
} else if (typeof defaultValue === 'string') {
|
|
101
|
-
timestamp = (0, _utils2.getTimestamp)(defaultValue);
|
|
102
|
-
} else if (Array.isArray(value) && value.length) {
|
|
103
|
-
timestamp = (0, _utils2.getTimestamp)(value[0]); // check to see if value is not an empty string
|
|
96
|
+
var timestamp = (0, _react.useMemo)(function () {
|
|
97
|
+
if (Array.isArray(defaultValue) && defaultValue.length) return (0, _utils2.getTimestamp)(defaultValue[0]);
|
|
98
|
+
if (typeof defaultValue === 'string') return (0, _utils2.getTimestamp)(defaultValue);
|
|
99
|
+
if (Array.isArray(value) && value.length) return (0, _utils2.getTimestamp)(value[0]); // check to see if value is not an empty string
|
|
104
100
|
// empty string should behave like undefined
|
|
105
|
-
} else if (typeof value === 'string' && value.length) {
|
|
106
|
-
timestamp = (0, _utils2.getTimestamp)(value);
|
|
107
|
-
} // normalize value based on timestamp vs user's local timezone
|
|
108
101
|
|
|
102
|
+
if (typeof value === 'string' && value.length) return (0, _utils2.getTimestamp)(value);
|
|
103
|
+
return undefined;
|
|
104
|
+
}, [defaultValue, value]); // whether or not we should normalize the date based on the timestamp.
|
|
105
|
+
// will be set to false if the initial timestamp is undefined (meaning
|
|
106
|
+
// a user did not provide a defaultValue or value). in this case, we
|
|
107
|
+
// will just rely on the UTC timestamp and don't need to normalize.
|
|
109
108
|
|
|
110
|
-
var
|
|
109
|
+
var _useState = (0, _react.useState)(true),
|
|
110
|
+
normalize = _useState[0],
|
|
111
|
+
setNormalize = _useState[1]; // normalize value based on timestamp vs user's local timezone
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
var normalizedDate = (0, _utils2.normalizeForTimezone)(value, timestamp, normalize); // do we expect multiple dates?
|
|
111
115
|
|
|
112
116
|
var range = Array.isArray(value) || format && format.includes('-'); // parse format and build a formal schema we can use elsewhere
|
|
113
117
|
|
|
@@ -119,9 +123,9 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
119
123
|
return (0, _utils3.schemaToMask)(schema);
|
|
120
124
|
}, [schema]); // textValue is only used when a format is provided
|
|
121
125
|
|
|
122
|
-
var
|
|
123
|
-
textValue =
|
|
124
|
-
setTextValue =
|
|
126
|
+
var _useState2 = (0, _react.useState)(schema ? (0, _utils3.valueToText)(normalizedDate, schema) : undefined),
|
|
127
|
+
textValue = _useState2[0],
|
|
128
|
+
setTextValue = _useState2[1]; // Setting the icon through `inputProps` is deprecated.
|
|
125
129
|
// The `icon` prop should be used instead.
|
|
126
130
|
|
|
127
131
|
|
|
@@ -149,9 +153,9 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
149
153
|
}
|
|
150
154
|
}, [range, schema, textValue, value, normalizedDate, timestamp]); // when format and not inline, whether to show the Calendar in a Drop
|
|
151
155
|
|
|
152
|
-
var
|
|
153
|
-
open =
|
|
154
|
-
setOpen =
|
|
156
|
+
var _useState3 = (0, _react.useState)(),
|
|
157
|
+
open = _useState3[0],
|
|
158
|
+
setOpen = _useState3[1];
|
|
155
159
|
|
|
156
160
|
var openCalendar = (0, _react.useCallback)(function () {
|
|
157
161
|
setOpen(true);
|
|
@@ -178,15 +182,26 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
178
182
|
dates: range && value.length ? [normalizedDate] : undefined // places focus on days grid when Calendar opens
|
|
179
183
|
,
|
|
180
184
|
initialFocus: open ? 'days' : undefined,
|
|
185
|
+
normalize: normalize,
|
|
181
186
|
onSelect: disabled ? undefined : function (nextValue) {
|
|
182
187
|
var normalizedValue;
|
|
183
188
|
|
|
184
189
|
if (range && Array.isArray(nextValue)) {
|
|
185
190
|
normalizedValue = nextValue[0];
|
|
186
191
|
} // clicking an edge date removes it
|
|
187
|
-
else if (range) normalizedValue = [nextValue, nextValue];else normalizedValue = nextValue;
|
|
192
|
+
else if (range) normalizedValue = [nextValue, nextValue];else normalizedValue = nextValue; // timestamp will be undefined if no defaultValue or value have
|
|
193
|
+
// been passed in, indicating that we should stay local if the
|
|
194
|
+
// user first picks a date via the Calendar.
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
var nextNormalize = normalize;
|
|
188
198
|
|
|
189
|
-
if (
|
|
199
|
+
if (timestamp === undefined) {
|
|
200
|
+
nextNormalize = false;
|
|
201
|
+
setNormalize(nextNormalize);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (schema) setTextValue((0, _utils3.valueToText)((0, _utils2.normalizeForTimezone)(normalizedValue, undefined, nextNormalize), schema));
|
|
190
205
|
setValue(normalizedValue);
|
|
191
206
|
if (_onChange) _onChange({
|
|
192
207
|
value: normalizedValue
|
|
@@ -239,7 +254,10 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
239
254
|
onEsc: open ? function () {
|
|
240
255
|
return closeCalendar();
|
|
241
256
|
} : undefined,
|
|
242
|
-
onSpace:
|
|
257
|
+
onSpace: function onSpace(event) {
|
|
258
|
+
event.preventDefault();
|
|
259
|
+
openCalendar();
|
|
260
|
+
}
|
|
243
261
|
}, /*#__PURE__*/_react["default"].createElement(_Box.Box, {
|
|
244
262
|
ref: containerRef,
|
|
245
263
|
border: !plain,
|
|
@@ -259,7 +277,27 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
259
277
|
onChange: function onChange(event) {
|
|
260
278
|
var nextTextValue = event.target.value;
|
|
261
279
|
setTextValue(nextTextValue);
|
|
262
|
-
var
|
|
280
|
+
var localTimestamp; // get the UTC timestamp relative to the user's timezone
|
|
281
|
+
// once a date is complete
|
|
282
|
+
|
|
283
|
+
if (timestamp === undefined && Date.parse(nextTextValue)) {
|
|
284
|
+
var _Date$toISOString$spl = new Date(nextTextValue).toISOString().split('T');
|
|
285
|
+
|
|
286
|
+
localTimestamp = _Date$toISOString$spl[1];
|
|
287
|
+
} // timestamp will be undefined if no defaultValue or value have
|
|
288
|
+
// been passed in, indicating that we should stay local
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
var nextNormalize = normalize;
|
|
292
|
+
|
|
293
|
+
if (timestamp === undefined) {
|
|
294
|
+
nextNormalize = false;
|
|
295
|
+
setNormalize(nextNormalize);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
var nextValue = (0, _utils3.textToValue)(nextTextValue, schema, range, timestamp || localTimestamp, nextNormalize); // reset to original state
|
|
299
|
+
|
|
300
|
+
if (nextValue === undefined) setNormalize(true); // update value even when undefined
|
|
263
301
|
|
|
264
302
|
setValue(nextValue);
|
|
265
303
|
|
|
@@ -17,7 +17,8 @@ var DateForm = function DateForm() {
|
|
|
17
17
|
setValue = _React$useState[1];
|
|
18
18
|
|
|
19
19
|
var onChange = function onChange(nextValue) {
|
|
20
|
-
console.log('onChange', nextValue);
|
|
20
|
+
console.log('onChange iso date:', nextValue);
|
|
21
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
21
22
|
setValue(nextValue);
|
|
22
23
|
};
|
|
23
24
|
|
|
@@ -16,7 +16,8 @@ var Format = function Format() {
|
|
|
16
16
|
|
|
17
17
|
var onChange = function onChange(event) {
|
|
18
18
|
var nextValue = event.value;
|
|
19
|
-
console.log('onChange', nextValue);
|
|
19
|
+
console.log('onChange iso date:', nextValue);
|
|
20
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
20
21
|
setValue(nextValue);
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -51,49 +51,57 @@ var FormatInline = function FormatInline() {
|
|
|
51
51
|
|
|
52
52
|
var onChangeEmpty = function onChangeEmpty(event) {
|
|
53
53
|
var nextValue = event.value;
|
|
54
|
-
console.log('onChange', nextValue);
|
|
54
|
+
console.log('onChange iso date:', nextValue);
|
|
55
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
55
56
|
setEmptyDate(nextValue);
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
var onChangeTZ = function onChangeTZ(event) {
|
|
59
60
|
var nextValue = event.value;
|
|
60
|
-
console.log('onChange', nextValue);
|
|
61
|
+
console.log('onChange iso date:', nextValue);
|
|
62
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
61
63
|
setDate(nextValue);
|
|
62
64
|
};
|
|
63
65
|
|
|
64
66
|
var onChangeNoTZ = function onChangeNoTZ(event) {
|
|
65
67
|
var nextValue = event.value;
|
|
66
|
-
console.log('onChange', nextValue);
|
|
68
|
+
console.log('onChange iso date:', nextValue);
|
|
69
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
67
70
|
setDateNoTZ(nextValue);
|
|
68
71
|
};
|
|
69
72
|
|
|
70
73
|
var onChangeRange = function onChangeRange(event) {
|
|
71
74
|
var nextValue = event.value;
|
|
72
|
-
console.log('onChange', nextValue);
|
|
75
|
+
console.log('onChange iso date:', nextValue);
|
|
76
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
73
77
|
setDateRange(nextValue);
|
|
74
78
|
};
|
|
75
79
|
|
|
76
80
|
var onChangeRangeNoTZ = function onChangeRangeNoTZ(event) {
|
|
77
81
|
var nextValue = event.value;
|
|
78
|
-
console.log('onChange', nextValue);
|
|
82
|
+
console.log('onChange iso date:', nextValue);
|
|
83
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
79
84
|
setDateRangeNoTZ(nextValue);
|
|
80
85
|
};
|
|
81
86
|
|
|
82
87
|
var onChangeNoDefault = function onChangeNoDefault(event) {
|
|
83
88
|
var nextValue = event.value;
|
|
84
|
-
console.log('onChange', nextValue);
|
|
89
|
+
console.log('onChange iso date:', nextValue);
|
|
90
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
85
91
|
setDateNoDefault(nextValue);
|
|
86
92
|
};
|
|
87
93
|
|
|
88
94
|
var onChangeStateDefault = function onChangeStateDefault(event) {
|
|
89
95
|
var nextValue = event.value;
|
|
90
|
-
console.log('onChange', nextValue);
|
|
96
|
+
console.log('onChange iso date:', nextValue);
|
|
97
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
91
98
|
setDateStateDefault(nextValue);
|
|
92
99
|
};
|
|
93
100
|
|
|
94
101
|
var onChangeStateDefaultNoTZ = function onChangeStateDefaultNoTZ(event) {
|
|
95
102
|
var nextValue = event.value;
|
|
96
|
-
console.log('onChange', nextValue);
|
|
103
|
+
console.log('onChange iso date:', nextValue);
|
|
104
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
97
105
|
setDateStateDefaultNoTZ(nextValue);
|
|
98
106
|
};
|
|
99
107
|
|
|
@@ -16,7 +16,8 @@ var Inline = function Inline() {
|
|
|
16
16
|
|
|
17
17
|
var onChange = function onChange(event) {
|
|
18
18
|
var nextValue = event.value;
|
|
19
|
-
console.log('onChange', nextValue);
|
|
19
|
+
console.log('onChange iso date:', nextValue);
|
|
20
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
20
21
|
setValue(nextValue);
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -21,7 +21,8 @@ var Range = function Range() {
|
|
|
21
21
|
|
|
22
22
|
var onChange = function onChange(event) {
|
|
23
23
|
var nextValue = event.value;
|
|
24
|
-
console.log('onChange', nextValue);
|
|
24
|
+
console.log('onChange iso date:', nextValue);
|
|
25
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
25
26
|
setValue(nextValue);
|
|
26
27
|
};
|
|
27
28
|
|
|
@@ -16,7 +16,8 @@ var RangeFormat = function RangeFormat() {
|
|
|
16
16
|
|
|
17
17
|
var onChange = function onChange(event) {
|
|
18
18
|
var nextValue = event.value;
|
|
19
|
-
console.log('onChange', nextValue);
|
|
19
|
+
console.log('onChange iso date:', nextValue);
|
|
20
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
20
21
|
setValue(nextValue);
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -16,7 +16,8 @@ var Simple = function Simple() {
|
|
|
16
16
|
|
|
17
17
|
var onChange = function onChange(event) {
|
|
18
18
|
var nextValue = event.value;
|
|
19
|
-
console.log('onChange', nextValue);
|
|
19
|
+
console.log('onChange iso date:', nextValue);
|
|
20
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
20
21
|
setValue(nextValue);
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -6,7 +6,8 @@ export const European = () => {
|
|
|
6
6
|
const [value, setValue] = React.useState();
|
|
7
7
|
const onChange = (event) => {
|
|
8
8
|
const nextValue = event.value;
|
|
9
|
-
console.log('onChange', nextValue);
|
|
9
|
+
console.log('onChange iso date:', nextValue);
|
|
10
|
+
console.log('onChange utc date:', new Date(nextValue));
|
|
10
11
|
setValue(nextValue);
|
|
11
12
|
};
|
|
12
13
|
return (
|
|
@@ -137,7 +137,7 @@ var pullDigits = function pullDigits(text, index) {
|
|
|
137
137
|
return text.slice(index, end);
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
-
var textToValue = function textToValue(text, schema, range, timestamp) {
|
|
140
|
+
var textToValue = function textToValue(text, schema, range, timestamp, normalize) {
|
|
141
141
|
if (!text) return range ? [] : undefined;
|
|
142
142
|
var result;
|
|
143
143
|
|
|
@@ -148,7 +148,7 @@ var textToValue = function textToValue(text, schema, range, timestamp) {
|
|
|
148
148
|
if (!parts.m || !parts.d || !parts.y || parts.y.length < 4 || parts.m.length > 2 || parts.d.length > 2 || parts.m > 12 || parts.d > 31 || (parts.m === "02" || parts.m === "2") && parts.d > (leapYear ? 29 : 28)) return parts;
|
|
149
149
|
var date = new Date(parts.y, parts.m - 1, parts.d).toISOString(); // match time and timezone of any supplied valueProp
|
|
150
150
|
|
|
151
|
-
if (timestamp) date = (0, _utils.formatToLocalYYYYMMDD)(date).split('T')[0] + "T" + timestamp;else date = "" + (0, _utils.formatToLocalYYYYMMDD)(date).split('T')[0];
|
|
151
|
+
if (timestamp) date = (0, _utils.formatToLocalYYYYMMDD)(date, normalize).split('T')[0] + "T" + timestamp;else date = "" + (0, _utils.formatToLocalYYYYMMDD)(date, normalize).split('T')[0];
|
|
152
152
|
|
|
153
153
|
if (!range) {
|
|
154
154
|
if (!result) result = date;
|
|
@@ -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
|
var _grommetIcons = require("grommet-icons");
|
|
13
11
|
|
|
14
12
|
var _data = require("./data");
|
|
@@ -111,45 +109,49 @@ var Animated = function Animated() {
|
|
|
111
109
|
}));
|
|
112
110
|
}
|
|
113
111
|
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
112
|
+
return (
|
|
113
|
+
/*#__PURE__*/
|
|
114
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
115
|
+
// <Grommet theme={...}>
|
|
116
|
+
_react["default"].createElement(_grommet.Box, {
|
|
117
|
+
align: "center"
|
|
118
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
119
|
+
pad: "large"
|
|
120
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Stack, null, /*#__PURE__*/_react["default"].createElement(_grommet.Box, null, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
121
|
+
alignSelf: "center",
|
|
122
|
+
margin: {
|
|
123
|
+
bottom: 'large'
|
|
124
|
+
}
|
|
125
|
+
}, /*#__PURE__*/_react["default"].createElement(Container, {
|
|
126
|
+
node: _data.data[0],
|
|
127
|
+
index: 1
|
|
128
|
+
}), /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
129
|
+
pad: "small"
|
|
130
|
+
}), /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
131
|
+
id: "4",
|
|
132
|
+
width: "xsmall",
|
|
133
|
+
margin: {
|
|
134
|
+
bottom: 'large',
|
|
135
|
+
top: 'xlarge'
|
|
136
|
+
}
|
|
137
|
+
})), /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
138
|
+
direction: "row",
|
|
139
|
+
gap: "xlarge"
|
|
140
|
+
}, [2, 3].map(function (id) {
|
|
141
|
+
return /*#__PURE__*/_react["default"].createElement(Container, {
|
|
142
|
+
key: id,
|
|
143
|
+
node: _data.data[id - 1],
|
|
144
|
+
index: id
|
|
145
|
+
});
|
|
146
|
+
}))), /*#__PURE__*/_react["default"].createElement(_grommet.Diagram, {
|
|
147
|
+
animation: {
|
|
148
|
+
type: 'draw',
|
|
149
|
+
duration: 3000
|
|
150
|
+
},
|
|
151
|
+
connections: connections
|
|
152
|
+
})))) // </Grommet>
|
|
153
|
+
|
|
154
|
+
);
|
|
153
155
|
};
|
|
154
156
|
|
|
155
157
|
exports.Animated = Animated;
|
|
@@ -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
|
var _excluded = ["id"],
|
|
13
11
|
_excluded2 = ["color"];
|
|
14
12
|
|
|
@@ -90,33 +88,37 @@ var Progressing = function Progressing() {
|
|
|
90
88
|
}));
|
|
91
89
|
}
|
|
92
90
|
|
|
93
|
-
return
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
91
|
+
return (
|
|
92
|
+
/*#__PURE__*/
|
|
93
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
94
|
+
// <Grommet theme={...}>
|
|
95
|
+
_react["default"].createElement(_grommet.Box, {
|
|
96
|
+
align: "start",
|
|
97
|
+
pad: "large"
|
|
98
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Paragraph, null, "Adding and removing nodes with animated connections. The animation 'draw' is applied to the entire diagram, however, the last connection receives its own animation type of 'pulse'."), /*#__PURE__*/_react["default"].createElement(_grommet.Stack, null, /*#__PURE__*/_react["default"].createElement(_grommet.Box, null, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
99
|
+
direction: "row"
|
|
100
|
+
}, topRow.map(function (id) {
|
|
101
|
+
return /*#__PURE__*/_react["default"].createElement(Node, {
|
|
102
|
+
key: id,
|
|
103
|
+
id: id
|
|
104
|
+
});
|
|
105
|
+
})), /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
106
|
+
direction: "row"
|
|
107
|
+
}, [4, 5].map(function (id) {
|
|
108
|
+
return /*#__PURE__*/_react["default"].createElement(Node, {
|
|
109
|
+
key: id,
|
|
110
|
+
id: id,
|
|
111
|
+
background: "dark-2"
|
|
112
|
+
});
|
|
113
|
+
}))), /*#__PURE__*/_react["default"].createElement(_grommet.Diagram, {
|
|
114
|
+
animation: {
|
|
115
|
+
type: 'draw',
|
|
116
|
+
duration: 3000
|
|
117
|
+
},
|
|
118
|
+
connections: connections
|
|
119
|
+
}))) // </Grommet>
|
|
120
|
+
|
|
121
|
+
);
|
|
120
122
|
};
|
|
121
123
|
|
|
122
124
|
exports.Progressing = Progressing;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { Gremlin, IceCream } from 'grommet-icons';
|
|
4
|
-
import { Stack,
|
|
4
|
+
import { Stack, Box, Diagram } from 'grommet';
|
|
5
5
|
|
|
6
6
|
import { DiagramConnectionAnchor, DiagramConnectionType } from '../../index';
|
|
7
7
|
|
|
@@ -25,19 +25,20 @@ const connections = [connection];
|
|
|
25
25
|
|
|
26
26
|
export const Connections = () => {
|
|
27
27
|
return (
|
|
28
|
-
<Grommet
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<Box align="end" pad={{ vertical: 'large' }}>
|
|
35
|
-
<IceCream id="yummy" color="neutral-2" size="xlarge" />
|
|
36
|
-
</Box>
|
|
28
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
29
|
+
// <Grommet theme={...}>
|
|
30
|
+
<Stack>
|
|
31
|
+
<Box fill pad="xlarge">
|
|
32
|
+
<Box align="start">
|
|
33
|
+
<Gremlin id="gremlin" color="neutral-2" size="xlarge" />
|
|
37
34
|
</Box>
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
<Box align="end" pad={{ vertical: 'large' }}>
|
|
36
|
+
<IceCream id="yummy" color="neutral-2" size="xlarge" />
|
|
37
|
+
</Box>
|
|
38
|
+
</Box>
|
|
39
|
+
<Diagram connections={connections} />
|
|
40
|
+
</Stack>
|
|
41
|
+
// </Grommet>
|
|
41
42
|
);
|
|
42
43
|
};
|
|
43
44
|
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { grommet } from 'grommet/themes';
|
|
3
|
+
import { Box, Distribution, Text } from 'grommet';
|
|
5
4
|
|
|
6
5
|
export const Simple = () => (
|
|
7
|
-
<Grommet
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</
|
|
6
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
7
|
+
// <Grommet theme={...}>
|
|
8
|
+
<Distribution
|
|
9
|
+
fill
|
|
10
|
+
values={[
|
|
11
|
+
{ value: 50, color: 'light-3' },
|
|
12
|
+
{ value: 30, color: 'neutral-1' },
|
|
13
|
+
{ value: 20, color: 'brand' },
|
|
14
|
+
{ value: 10, color: 'light-3' },
|
|
15
|
+
{ value: 5, color: 'neutral-1' },
|
|
16
|
+
]}
|
|
17
|
+
>
|
|
18
|
+
{(value) => (
|
|
19
|
+
<Box pad="xsmall" background={value.color} fill>
|
|
20
|
+
<Text size="large">{value.value}</Text>
|
|
21
|
+
</Box>
|
|
22
|
+
)}
|
|
23
|
+
</Distribution>
|
|
24
|
+
//</Grommet>
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
+
Simple.args = {
|
|
28
|
+
full: true,
|
|
29
|
+
};
|
|
30
|
+
|
|
27
31
|
export default {
|
|
28
32
|
title: 'Visualizations/Distribution/Simple',
|
|
29
33
|
};
|
package/components/Drop/Drop.js
CHANGED
|
@@ -19,7 +19,7 @@ var _ContainerTargetContext = require("../../contexts/ContainerTargetContext");
|
|
|
19
19
|
|
|
20
20
|
var _propTypes = require("./propTypes");
|
|
21
21
|
|
|
22
|
-
var _excluded = ["restrictFocus", "target", "trapFocus"];
|
|
22
|
+
var _excluded = ["inline", "restrictFocus", "target", "trapFocus"];
|
|
23
23
|
|
|
24
24
|
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); }
|
|
25
25
|
|
|
@@ -30,7 +30,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
30
30
|
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; }
|
|
31
31
|
|
|
32
32
|
var Drop = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
33
|
-
var
|
|
33
|
+
var inline = _ref.inline,
|
|
34
|
+
restrictFocus = _ref.restrictFocus,
|
|
34
35
|
dropTarget = _ref.target,
|
|
35
36
|
_ref$trapFocus = _ref.trapFocus,
|
|
36
37
|
trapFocus = _ref$trapFocus === void 0 ? true : _ref$trapFocus,
|
|
@@ -52,8 +53,8 @@ var Drop = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
52
53
|
|
|
53
54
|
var containerTarget = (0, _react.useContext)(_ContainerTargetContext.ContainerTargetContext);
|
|
54
55
|
(0, _react.useEffect)(function () {
|
|
55
|
-
return setDropContainer((0, _utils.getNewContainer)(containerTarget));
|
|
56
|
-
}, [containerTarget]); // just a few things to clean up when the Drop is unmounted
|
|
56
|
+
return setDropContainer(!inline ? (0, _utils.getNewContainer)(containerTarget) : undefined);
|
|
57
|
+
}, [containerTarget, inline]); // just a few things to clean up when the Drop is unmounted
|
|
57
58
|
|
|
58
59
|
(0, _react.useEffect)(function () {
|
|
59
60
|
return function () {
|
|
@@ -71,13 +72,18 @@ var Drop = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
74
|
}, [containerTarget, dropContainer, originalFocusedElement, restrictFocus]);
|
|
74
|
-
|
|
75
|
+
|
|
76
|
+
var content = /*#__PURE__*/_react["default"].createElement(_DropContainer.DropContainer, _extends({
|
|
75
77
|
ref: ref,
|
|
76
78
|
dir: theme && theme.dir,
|
|
77
79
|
dropTarget: dropTarget,
|
|
78
80
|
restrictFocus: restrictFocus,
|
|
79
81
|
trapFocus: trapFocus
|
|
80
|
-
}, rest))
|
|
82
|
+
}, rest));
|
|
83
|
+
|
|
84
|
+
if (inline) return content;
|
|
85
|
+
if (dropContainer) return /*#__PURE__*/(0, _reactDom.createPortal)(content, dropContainer);
|
|
86
|
+
return null;
|
|
81
87
|
});
|
|
82
88
|
exports.Drop = Drop;
|
|
83
89
|
Drop.displayName = 'Drop';
|
|
@@ -27,6 +27,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
27
27
|
}),
|
|
28
28
|
background: _generalPropTypes.backgroundDoc,
|
|
29
29
|
elevation: _propTypes["default"].oneOfType([_propTypes["default"].oneOf(['none', 'xsmall', 'small', 'medium', 'large', 'xlarge']), _propTypes["default"].string]),
|
|
30
|
+
inline: _propTypes["default"].bool,
|
|
30
31
|
margin: _generalPropTypes.marginProp,
|
|
31
32
|
onClickOutside: _propTypes["default"].func,
|
|
32
33
|
onEsc: _propTypes["default"].func,
|