grommet 2.47.0 → 2.48.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/all/stories/AllComponents.stories.js +1 -2
- package/components/Accordion/Accordion.js +1 -2
- package/components/Accordion/stories/CustomHeader.stories.js +1 -2
- package/components/AccordionPanel/AccordionPanel.js +1 -2
- package/components/Anchor/Anchor.js +5 -6
- package/components/Anchor/StyledAnchor.js +1 -2
- package/components/Avatar/Avatar.js +1 -2
- package/components/Box/Box.js +6 -3
- package/components/Box/ResponsiveContainerProvider.js +1 -2
- package/components/Box/StyledBox.js +4 -3
- package/components/Box/stories/ResponsiveContainer.stories.js +1 -2
- package/components/Button/Badge.js +1 -2
- package/components/Button/BusyAnimation.js +1 -2
- package/components/Button/Button.js +1 -2
- package/components/Button/StyledButton.js +4 -3
- package/components/Button/StyledButtonKind.js +4 -3
- package/components/Button/index.d.ts +1 -1
- package/components/Button/propTypes.js +1 -1
- package/components/Button/stories/Busy.stories.js +1 -2
- package/components/Calendar/Calendar.js +152 -130
- package/components/Calendar/StyledCalendar.js +34 -37
- package/components/Calendar/stories/ActiveDate.stories.js +1 -2
- package/components/Calendar/stories/CustomDay.stories.js +1 -2
- package/components/Calendar/stories/CustomHeader.stories.js +1 -2
- package/components/Calendar/stories/CustomThemed/CustomSizeHeading.stories.js +1 -2
- package/components/Calendar/stories/Dual.stories.js +1 -4
- package/components/Calendar/stories/HeaderLevel.stories.js +1 -2
- package/components/Calendar/stories/Multiple.stories.js +1 -2
- package/components/Calendar/stories/ShowAdjacentDays.stories.js +2 -3
- package/components/Calendar/stories/Simple.stories.js +1 -2
- package/components/Card/Card.js +1 -2
- package/components/Cards/Cards.js +1 -2
- package/components/Carousel/Carousel.js +1 -2
- package/components/Carousel/CarouselChild.js +1 -2
- package/components/Carousel/StyledCarousel.js +1 -2
- package/components/Chart/Chart.js +4 -5
- package/components/Chart/StyledChart.js +1 -2
- package/components/Chart/stories/Rich.stories.js +1 -2
- package/components/Chart/stories/Scan.stories.js +1 -2
- package/components/Chart/stories/Window.stories.js +1 -2
- package/components/Chart/stories/Zoom.stories.js +1 -2
- package/components/CheckBox/CheckBox.js +1 -2
- package/components/CheckBox/StyledCheckBox.js +1 -2
- package/components/CheckBox/stories/CustomThemed/Custom.stories.js +1 -2
- package/components/CheckBox/stories/CustomThemed/CustomToggle.stories.js +1 -2
- package/components/CheckBox/stories/Indeterminate.stories.js +1 -2
- package/components/CheckBox/stories/NoLabel.stories.js +1 -2
- package/components/CheckBox/stories/Simple.stories.js +1 -2
- package/components/CheckBox/stories/WithStickyDiv.stories.js +1 -2
- package/components/CheckBoxGroup/CheckBoxGroup.js +15 -4
- package/components/CheckBoxGroup/stories/Children.stories.js +1 -2
- package/components/CheckBoxGroup/stories/InitialValues.stories.js +1 -2
- package/components/Clock/Analog.js +1 -2
- package/components/Clock/Clock.js +1 -2
- package/components/Clock/Digital.js +1 -2
- package/components/Clock/StyledClock.js +1 -2
- package/components/Collapsible/Collapsible.js +1 -2
- package/components/Data/Data.js +1 -2
- package/components/Data/DataForm.js +1 -2
- package/components/Data/index.d.ts +3 -0
- package/components/Data/propTypes.js +4 -1
- package/components/Data/stories/Infinite.stories.js +2 -3
- package/components/Data/stories/Inline.stories.js +1 -2
- package/components/Data/stories/OnSelect.stories.js +2 -3
- package/components/Data/stories/SpaceX.stories.js +2 -3
- package/components/Data/stories/StarWars.stories.js +13 -39
- package/components/DataChart/DataChart.js +4 -5
- package/components/DataChart/Detail.js +1 -2
- package/components/DataChart/Legend.js +1 -2
- package/components/DataChart/XAxis.js +1 -2
- package/components/DataChart/XGuide.js +1 -2
- package/components/DataChart/YAxis.js +1 -2
- package/components/DataChart/YGuide.js +1 -2
- package/components/DataChart/stories/Prediction.stories.js +1 -2
- package/components/DataClearFilters/DataClearFilters.js +1 -2
- package/components/DataClearFilters/stories/Simple.stories.js +1 -2
- package/components/DataFilter/DataFilter.js +5 -3
- package/components/DataFilters/DataFilters.js +1 -2
- package/components/DataSearch/DataSearch.js +1 -2
- package/components/DataSort/DataSort.js +3 -3
- package/components/DataSummary/DataSummary.js +1 -2
- package/components/DataTable/Body.js +106 -35
- package/components/DataTable/Cell.js +1 -2
- package/components/DataTable/DataTable.js +49 -16
- package/components/DataTable/ExpanderCell.js +55 -7
- package/components/DataTable/Footer.js +1 -2
- package/components/DataTable/GroupedBody.js +12 -5
- package/components/DataTable/Header.js +83 -32
- package/components/DataTable/PlaceholderBody.js +1 -2
- package/components/DataTable/Resizer.js +164 -47
- package/components/DataTable/Searcher.js +36 -7
- package/components/DataTable/StyledDataTable.js +2 -3
- package/components/DataTable/index.d.ts +19 -0
- package/components/DataTable/propTypes.js +19 -0
- package/components/DataTable/stories/ControlledGrouped.stories.js +5 -2
- package/components/DataTable/stories/Grouped.stories.js +7 -1
- package/components/DataTable/stories/GroupedOnSelect.stories.js +7 -1
- package/components/DataTable/stories/OnUpdate.stories.js +4 -2
- package/components/DataTable/stories/SpaceX.stories.js +9 -3
- package/components/DataTable/stories/SpaceXUngrouped.stories.js +2 -3
- package/components/DataTable/stories/Styled.stories.js +5 -1
- package/components/DataTable/stories/rowDetails.stories.js +19 -43
- package/components/DataTableColumns/DataTableColumns.js +15 -2
- package/components/DataTableGroupBy/DataTableGroupBy.js +1 -2
- package/components/DataView/DataView.js +1 -2
- package/components/DateInput/DateInput.js +13 -13
- package/components/DateInput/stories/FormatInline.stories.js +1 -2
- package/components/Diagram/Diagram.js +1 -2
- package/components/Diagram/StyledDiagram.js +1 -2
- package/components/Diagram/stories/Animated.stories.js +1 -2
- package/components/Diagram/stories/Progressing.stories.js +1 -2
- package/components/Drop/Drop.js +1 -2
- package/components/Drop/DropContainer.js +1 -2
- package/components/Drop/StyledDrop.js +1 -2
- package/components/Drop/stories/CustomThemed/Lazy.stories.js +1 -2
- package/components/Drop/stories/CustomThemed/Themed.stories.js +1 -2
- package/components/Drop/stories/Inline.stories.js +1 -2
- package/components/Drop/stories/Meter.stories.js +1 -2
- package/components/Drop/stories/Multiple.stories.js +1 -2
- package/components/Drop/stories/Overflow.stories.js +1 -2
- package/components/Drop/stories/Plain.stories.js +1 -2
- package/components/Drop/stories/Progressive.stories.js +1 -2
- package/components/Drop/stories/Simple.stories.js +1 -2
- package/components/Drop/stories/Styled.stories.js +1 -2
- package/components/DropButton/DropButton.js +1 -2
- package/components/FileInput/FileInput.js +38 -6
- package/components/FileInput/index.d.ts +10 -1
- package/components/FileInput/propTypes.js +11 -0
- package/components/FocusedContainer.js +1 -2
- package/components/Form/Form.js +11 -12
- package/components/Form/FormContext.js +1 -2
- package/components/Form/stories/ArrayOfFormFields.stories.js +1 -2
- package/components/Form/stories/Controlled.stories.js +2 -2
- package/components/Form/stories/ControlledInput.stories.js +2 -2
- package/components/Form/stories/ControlledInputLazy.stories.js +2 -2
- package/components/Form/stories/ControlledLazy.stories.js +2 -2
- package/components/Form/stories/CustomThemed/Custom.stories.js +1 -0
- package/components/Form/stories/CustomThemed/FieldBorderPosition.stories.js +1 -2
- package/components/Form/stories/CustomThemed/FieldCustomStates.stories.js +1 -2
- package/components/Form/stories/DynamicFields.stories.js +1 -2
- package/components/Form/stories/FieldStates.stories.js +1 -2
- package/components/Form/stories/FieldWithChildren.stories.js +2 -0
- package/components/Form/stories/SolicitedFeedback.stories.js +1 -2
- package/components/Form/stories/Uncontrolled.stories.js +1 -0
- package/components/Form/stories/UnsolicitedFeedback.stories.js +1 -2
- package/components/Form/stories/ValidateOnBlur.stories.js +1 -1
- package/components/Form/stories/ValidateOnChange.stories.js +1 -2
- package/components/Form/stories/ValidateOnMount.stories.js +1 -2
- package/components/Form/stories/typescript/TypedForm.stories.tsx +7 -1
- package/components/FormField/FormField.js +23 -3
- package/components/FormField/stories/Simple.stories.js +1 -2
- package/components/Grid/Grid.js +1 -2
- package/components/Grid/StyledGrid.js +1 -2
- package/components/Grid/stories/ResponsiveCards.stories.js +1 -2
- package/components/Grommet/Grommet.js +1 -2
- package/components/Grommet/StyledGrommet.js +1 -2
- package/components/Grommet/index.d.ts +30 -0
- package/components/Grommet/propTypes.js +31 -1
- package/components/Header/Header.js +1 -2
- package/components/Header/stories/Sticky.stories.js +1 -2
- package/components/Heading/Heading.js +1 -2
- package/components/Heading/HeadingSkeleton.js +1 -2
- package/components/Heading/StyledHeading.js +1 -2
- package/components/Image/Image.js +1 -2
- package/components/Image/StyledImage.js +1 -2
- package/components/InfiniteScroll/InfiniteScroll.js +1 -2
- package/components/Layer/Layer.js +37 -13
- package/components/Layer/LayerContainer.js +19 -17
- package/components/Layer/StyledLayer.js +1 -2
- package/components/Layer/stories/Form.stories.js +1 -1
- package/components/List/List.js +135 -146
- package/components/List/index.d.ts +3 -0
- package/components/List/propTypes.js +3 -0
- package/components/List/stories/Order.stories.js +1 -2
- package/components/List/stories/Pinned.stories.js +1 -2
- package/components/Markdown/Markdown.js +1 -2
- package/components/MaskedInput/MaskedInput.js +1 -2
- package/components/Menu/Menu.js +1 -2
- package/components/Meter/Bar.js +1 -2
- package/components/Meter/Circle.js +1 -2
- package/components/Meter/Meter.js +1 -2
- package/components/Meter/StyledMeter.js +1 -2
- package/components/Meter/stories/Circle.stories.js +1 -2
- package/components/Meter/stories/VerticalBarMultiple.stories.js +1 -2
- package/components/NameValueList/NameValueList.js +1 -2
- package/components/NameValuePair/NameValuePair.js +1 -2
- package/components/Nav/stories/CustomThemed/JustifySidebar.stories.js +1 -2
- package/components/Nav/stories/Sidebar.stories.js +1 -2
- package/components/Notification/Notification.js +21 -6
- package/components/Notification/index.d.ts +3 -0
- package/components/Notification/propTypes.js +3 -0
- package/components/Notification/stories/Global.stories.js +1 -2
- package/components/Notification/stories/Title.stories.js +1 -2
- package/components/Notification/stories/TitleAndMessage.stories.js +1 -2
- package/components/Page/Page.js +1 -2
- package/components/Page/stories/PageNotificaton.stories.js +1 -2
- package/components/PageContent/PageContent.js +1 -2
- package/components/PageHeader/PageHeader.js +1 -2
- package/components/PageHeader/stories/MultipleActions.stories.js +1 -2
- package/components/Pagination/Pagination.js +1 -2
- package/components/Pagination/PaginationStep.js +1 -2
- package/components/Pagination/PaginationSummary.js +1 -2
- package/components/Pagination/stories/Grid.stories.js +1 -2
- package/components/Paragraph/Paragraph.js +1 -2
- package/components/Paragraph/ParagraphSkeleton.js +1 -2
- package/components/Paragraph/StyledParagraph.js +1 -2
- package/components/RadioButton/RadioButton.js +1 -2
- package/components/RadioButton/StyledRadioButton.js +3 -4
- package/components/RadioButtonGroup/RadioButtonGroup.js +17 -7
- package/components/RadioButtonGroup/stories/Children.stories.js +1 -2
- package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.stories.js +1 -2
- package/components/RadioButtonGroup/stories/Disabled.stories.js +1 -2
- package/components/RangeInput/RangeInput.js +2 -3
- package/components/RangeInput/StyledRangeInput.js +1 -2
- package/components/RangeInput/stories/CustomThemed/Bounds.stories.js +1 -2
- package/components/RangeSelector/EdgeControl.js +56 -13
- package/components/RangeSelector/RangeSelector.js +12 -25
- package/components/RangeSelector/stories/Basic.stories.js +1 -2
- package/components/RangeSelector/stories/CustomThemed/Custom.stories.js +1 -2
- package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.stories.js +1 -2
- package/components/RangeSelector/stories/Label.stories.js +1 -2
- package/components/RangeSelector/stories/Simple.stories.js +1 -2
- package/components/RangeSelector/stories/Step.stories.js +1 -2
- package/components/RangeSelector/stories/Thin.stories.js +1 -2
- package/components/RangeSelector/stories/Vertical.stories.js +1 -2
- package/components/RoutedAnchor/RoutedAnchor.js +1 -2
- package/components/RoutedButton/RoutedButton.js +1 -2
- package/components/Select/DefaultSelectTextInput.js +1 -2
- package/components/Select/Select.js +17 -4
- package/components/Select/SelectContainer.js +33 -10
- package/components/Select/stories/ChildrenRender.stories.js +1 -2
- package/components/Select/stories/Clear.stories.js +1 -2
- package/components/Select/stories/Controlled.stories.js +1 -2
- package/components/Select/stories/CustomThemed/CustomSearch.stories.js +1 -2
- package/components/Select/stories/Disabled.stories.js +1 -2
- package/components/Select/stories/InsideFormField.stories.js +1 -2
- package/components/Select/stories/Multiple.stories.js +1 -2
- package/components/Select/stories/ObjectOptions.stories.js +1 -2
- package/components/Select/stories/Search.stories.js +1 -2
- package/components/Select/stories/Simple.stories.js +1 -2
- package/components/Select/stories/ValueLabel.stories.js +1 -2
- package/components/Select/stories/components/SearchBorderBox.js +1 -2
- package/components/Select/stories/components/SearchInput.js +1 -2
- package/components/Select/utils.js +13 -4
- package/components/SelectMultiple/SelectMultiple.js +32 -19
- package/components/SelectMultiple/SelectMultipleContainer.js +26 -17
- package/components/SelectMultiple/SelectMultipleValue.js +1 -2
- package/components/SelectMultiple/SelectionSummary.js +1 -2
- package/components/SelectMultiple/stories/CustomMessages.stories.js +1 -2
- package/components/SelectMultiple/stories/Default.stories.js +1 -2
- package/components/SelectMultiple/stories/Disabled.stories.js +1 -2
- package/components/SelectMultiple/stories/FormField.stories.js +1 -2
- package/components/SelectMultiple/stories/Help.stories.js +1 -2
- package/components/SelectMultiple/stories/Limited.stories.js +1 -2
- package/components/SelectMultiple/stories/ObjectOptions.stories.js +1 -2
- package/components/SelectMultiple/stories/ShowSelectedInline.stories.js +1 -2
- package/components/Skeleton/Skeleton.js +6 -3
- package/components/Skeleton/SkeletonContext.js +1 -2
- package/components/Skeleton/stories/CustomThemed/Custom.stories.js +1 -4
- package/components/Skeleton/stories/GridContainer.stories.js +1 -2
- package/components/Skeleton/stories/Simple.stories.js +0 -1
- package/components/SkipLink/SkipLink.js +1 -2
- package/components/SkipLinks/SkipLinks.js +1 -2
- package/components/Spinner/Spinner.js +1 -2
- package/components/Spinner/stories/Animation.stories.js +1 -2
- package/components/Spinner/stories/Announced.stories.js +1 -2
- package/components/Stack/Stack.js +1 -2
- package/components/Stack/StyledStack.js +1 -2
- package/components/StarRating/StarRating.js +1 -2
- package/components/Tab/StyledTab.js +1 -2
- package/components/Tab/Tab.js +1 -2
- package/components/Table/StyledTable.js +1 -2
- package/components/Table/Table.js +1 -2
- package/components/Table/stories/InfiniteScrollInTable.stories.js +1 -2
- package/components/TableBody/TableBody.js +1 -2
- package/components/TableCell/TableCell.js +21 -5
- package/components/TableFooter/TableFooter.js +1 -2
- package/components/TableHeader/TableHeader.js +1 -2
- package/components/TableRow/TableRow.js +1 -2
- package/components/Tabs/StyledTabs.js +1 -2
- package/components/Tabs/Tabs.js +1 -2
- package/components/Tabs/stories/CustomThemed/States.stories.js +1 -2
- package/components/Tabs/stories/Responsive.stories.js +1 -2
- package/components/Tag/Tag.js +1 -2
- package/components/Text/StyledText.js +1 -2
- package/components/Text/Text.js +1 -2
- package/components/Text/TextSkeleton.js +1 -2
- package/components/TextArea/StyledTextArea.js +1 -2
- package/components/TextArea/TextArea.js +1 -2
- package/components/TextArea/stories/CustomThemed/Themed.stories.js +1 -2
- package/components/TextArea/stories/InsideFormField.stories.js +1 -2
- package/components/TextArea/stories/NonResizable.stories.js +1 -2
- package/components/TextArea/stories/Simple.stories.js +1 -2
- package/components/TextInput/CopyButton.js +3 -1
- package/components/TextInput/StyledTextInput.js +1 -2
- package/components/TextInput/TextInput.js +5 -3
- package/components/TextInput/stories/InsideFormField.stories.js +1 -2
- package/components/Tip/Tip.js +1 -2
- package/components/Tip/stories/HeaderActions.stories.js +1 -2
- package/components/ToggleGroup/ToggleGroup.js +1 -2
- package/components/ToggleGroup/stories/Controlled.stories.js +1 -2
- package/components/Toolbar/Toolbar.js +1 -2
- package/components/Video/StyledVideo.js +1 -2
- package/components/Video/Video.js +13 -14
- package/components/WorldMap/WorldMap.js +1 -2
- package/contexts/AnalyticsContext/AnalyticsContext.js +1 -2
- package/contexts/AnnounceContext/AnnounceContext.js +28 -5
- package/contexts/AnnounceContext/stories/Polite.stories.js +1 -2
- package/contexts/RootsContext.js +1 -2
- package/contexts/ThemeContext/stories/ThemeContextExtend.stories.js +1 -2
- package/es6/components/Anchor/Anchor.js +4 -4
- package/es6/components/Box/Box.js +5 -1
- package/es6/components/Box/StyledBox.js +4 -2
- package/es6/components/Button/StyledButton.js +3 -1
- package/es6/components/Button/StyledButtonKind.js +3 -1
- package/es6/components/Button/index.d.ts +1 -1
- package/es6/components/Button/propTypes.js +1 -1
- package/es6/components/Calendar/Calendar.js +151 -128
- package/es6/components/Calendar/StyledCalendar.js +34 -36
- package/es6/components/Calendar/stories/Dual.stories.js +0 -2
- package/es6/components/Calendar/stories/ShowAdjacentDays.stories.js +1 -1
- package/es6/components/Chart/Chart.js +3 -3
- package/es6/components/CheckBoxGroup/CheckBoxGroup.js +14 -2
- package/es6/components/Data/index.d.ts +3 -0
- package/es6/components/Data/propTypes.js +4 -1
- package/es6/components/Data/stories/Infinite.stories.js +1 -1
- package/es6/components/Data/stories/OnSelect.stories.js +1 -1
- package/es6/components/Data/stories/SpaceX.stories.js +1 -1
- package/es6/components/Data/stories/StarWars.stories.js +13 -38
- package/es6/components/DataChart/DataChart.js +3 -3
- package/es6/components/DataFilter/DataFilter.js +4 -1
- package/es6/components/DataSort/DataSort.js +2 -1
- package/es6/components/DataTable/Body.js +106 -33
- package/es6/components/DataTable/DataTable.js +48 -14
- package/es6/components/DataTable/ExpanderCell.js +54 -6
- package/es6/components/DataTable/GroupedBody.js +11 -3
- package/es6/components/DataTable/Header.js +82 -30
- package/es6/components/DataTable/Resizer.js +165 -46
- package/es6/components/DataTable/Searcher.js +36 -6
- package/es6/components/DataTable/StyledDataTable.js +1 -1
- package/es6/components/DataTable/index.d.ts +19 -0
- package/es6/components/DataTable/propTypes.js +19 -0
- package/es6/components/DataTable/stories/ControlledGrouped.stories.js +4 -0
- package/es6/components/DataTable/stories/Grouped.stories.js +7 -1
- package/es6/components/DataTable/stories/GroupedOnSelect.stories.js +7 -1
- package/es6/components/DataTable/stories/OnUpdate.stories.js +3 -0
- package/es6/components/DataTable/stories/SpaceX.stories.js +8 -1
- package/es6/components/DataTable/stories/SpaceXUngrouped.stories.js +1 -1
- package/es6/components/DataTable/stories/Styled.stories.js +5 -1
- package/es6/components/DataTable/stories/rowDetails.stories.js +19 -42
- package/es6/components/DataTableColumns/DataTableColumns.js +14 -0
- package/es6/components/DateInput/DateInput.js +13 -12
- package/es6/components/FileInput/FileInput.js +37 -4
- package/es6/components/FileInput/index.d.ts +10 -1
- package/es6/components/FileInput/propTypes.js +11 -0
- package/es6/components/Form/Form.js +10 -10
- package/es6/components/Form/stories/Controlled.stories.js +1 -0
- package/es6/components/Form/stories/ControlledInput.stories.js +1 -0
- package/es6/components/Form/stories/ControlledInputLazy.stories.js +1 -0
- package/es6/components/Form/stories/ControlledLazy.stories.js +1 -0
- package/es6/components/Form/stories/CustomThemed/Custom.stories.js +1 -0
- package/es6/components/Form/stories/FieldWithChildren.stories.js +2 -0
- package/es6/components/Form/stories/Uncontrolled.stories.js +1 -0
- package/es6/components/Form/stories/ValidateOnBlur.stories.js +1 -1
- package/es6/components/Form/stories/typescript/TypedForm.stories.tsx +7 -1
- package/es6/components/FormField/FormField.js +22 -1
- package/es6/components/Grommet/index.d.ts +30 -0
- package/es6/components/Grommet/propTypes.js +31 -1
- package/es6/components/Layer/Layer.js +37 -12
- package/es6/components/Layer/LayerContainer.js +20 -16
- package/es6/components/Layer/stories/Form.stories.js +1 -1
- package/es6/components/List/List.js +136 -146
- package/es6/components/List/index.d.ts +3 -0
- package/es6/components/List/propTypes.js +3 -0
- package/es6/components/Notification/Notification.js +22 -5
- package/es6/components/Notification/index.d.ts +3 -0
- package/es6/components/Notification/propTypes.js +3 -0
- package/es6/components/RadioButton/StyledRadioButton.js +2 -2
- package/es6/components/RadioButtonGroup/RadioButtonGroup.js +16 -5
- package/es6/components/RangeInput/RangeInput.js +1 -1
- package/es6/components/RangeSelector/EdgeControl.js +57 -12
- package/es6/components/RangeSelector/RangeSelector.js +11 -23
- package/es6/components/Select/Select.js +17 -3
- package/es6/components/Select/SelectContainer.js +32 -8
- package/es6/components/Select/utils.js +11 -1
- package/es6/components/SelectMultiple/SelectMultiple.js +32 -18
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +25 -15
- package/es6/components/Skeleton/Skeleton.js +5 -1
- package/es6/components/Skeleton/stories/CustomThemed/Custom.stories.js +0 -2
- package/es6/components/Skeleton/stories/Simple.stories.js +0 -1
- package/es6/components/TableCell/TableCell.js +20 -3
- package/es6/components/TextInput/CopyButton.js +3 -1
- package/es6/components/TextInput/TextInput.js +4 -1
- package/es6/components/Video/Video.js +12 -12
- package/es6/contexts/AnnounceContext/AnnounceContext.js +28 -5
- package/es6/languages/default.json +33 -3
- package/es6/themes/base.d.ts +20 -0
- package/es6/themes/base.js +22 -8
- package/es6/utils/styles.js +53 -45
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +33 -3
- package/package.json +32 -32
- package/themes/base.d.ts +20 -0
- package/themes/base.js +22 -8
- package/utils/styles.js +53 -45
- package/utils/useId.js +1 -2
|
@@ -85,7 +85,7 @@ export var FormLayer = function FormLayer() {
|
|
|
85
85
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
86
86
|
label: "Size",
|
|
87
87
|
name: "select-size",
|
|
88
|
-
htmlFor: "select-
|
|
88
|
+
htmlFor: "select-size",
|
|
89
89
|
required: true,
|
|
90
90
|
validate: function validate(val) {
|
|
91
91
|
if (val === 'small') {
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
var _excluded = ["a11yTitle", "aria-label", "action", "as", "background", "border", "children", "data", "defaultItemProps", "disabled", "focus", "itemKey", "itemProps", "onActive", "onClickItem", "onKeyDown", "onMore", "onOrder", "showIndex", "pad", "paginate", "pinned", "primaryKey", "secondaryKey", "show", "step"];
|
|
1
|
+
var _excluded = ["a11yTitle", "aria-label", "action", "as", "background", "border", "children", "data", "defaultItemProps", "disabled", "focus", "itemKey", "itemProps", "messages", "onActive", "onClickItem", "onKeyDown", "onMore", "onOrder", "showIndex", "pad", "paginate", "pinned", "primaryKey", "secondaryKey", "show", "step"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
-
import React, { Fragment, cloneElement, useContext, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import React, { Fragment, cloneElement, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { DataContext } from '../../contexts/DataContext';
|
|
7
7
|
import { Box } from '../Box';
|
|
8
8
|
import { Button } from '../Button';
|
|
9
9
|
import { InfiniteScroll } from '../InfiniteScroll';
|
|
10
10
|
import { Keyboard } from '../Keyboard';
|
|
11
|
+
import { MessageContext } from '../../contexts/MessageContext';
|
|
11
12
|
import { Pagination } from '../Pagination';
|
|
12
13
|
import { Text } from '../Text';
|
|
13
|
-
import {
|
|
14
|
+
import { genericStyles, normalizeColor, normalizeShow, useForwardedRef, usePagination, styledComponentsConfig } from '../../utils';
|
|
14
15
|
import { useAnalytics } from '../../contexts/AnalyticsContext';
|
|
15
16
|
import { ListPropTypes } from './propTypes';
|
|
16
17
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
@@ -18,27 +19,19 @@ var emptyData = [];
|
|
|
18
19
|
var StyledList = styled.ul.withConfig(styledComponentsConfig).withConfig({
|
|
19
20
|
displayName: "List__StyledList",
|
|
20
21
|
componentId: "sc-130gdqg-0"
|
|
21
|
-
})(["list-style:none;", " padding:0;", "
|
|
22
|
+
})(["list-style:none;", " padding:0;", " ", "}"], function (props) {
|
|
22
23
|
return !props.margin && 'margin: 0;';
|
|
23
24
|
}, genericStyles, function (props) {
|
|
24
|
-
return props.tabIndex >= 0 && focusStyle({
|
|
25
|
-
forceOutline: true,
|
|
26
|
-
skipSvgChildren: true
|
|
27
|
-
});
|
|
28
|
-
}, function (props) {
|
|
29
25
|
return props.theme.list && props.theme.list.extend;
|
|
30
|
-
}
|
|
26
|
+
});
|
|
31
27
|
var StyledItem = styled(Box).withConfig({
|
|
32
28
|
displayName: "List__StyledItem",
|
|
33
29
|
componentId: "sc-130gdqg-1"
|
|
34
|
-
})(["", " ", "
|
|
30
|
+
})(["", " ", " ", " &:hover{", "}", ""], function (props) {
|
|
35
31
|
return props.onClick && !props.isDisabled && "cursor: pointer;";
|
|
36
32
|
}, function (props) {
|
|
37
33
|
return props.draggable && !props.isDisabled && "cursor: move;";
|
|
38
|
-
},
|
|
39
|
-
forceOutline: true,
|
|
40
|
-
skipSvgChildren: true
|
|
41
|
-
}), function (props) {
|
|
34
|
+
}, function (props) {
|
|
42
35
|
var _props$theme$list;
|
|
43
36
|
var disabledStyle;
|
|
44
37
|
if (props.isDisabled && (_props$theme$list = props.theme.list) != null && (_props$theme$list = _props$theme$list.item) != null && _props$theme$list.disabled) {
|
|
@@ -86,15 +79,15 @@ var reorder = function reorder(array, pinnedArray, source, target) {
|
|
|
86
79
|
return result;
|
|
87
80
|
};
|
|
88
81
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
//
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
/** Calculate tabIndex for order control buttons. */
|
|
83
|
+
var calculateTabIndex = function calculateTabIndex(buttonIndex, focused, lastFocused, disabled) {
|
|
84
|
+
if (disabled) return -1;
|
|
85
|
+
// is currently focused
|
|
86
|
+
return focused !== undefined && focused === buttonIndex ||
|
|
87
|
+
// was last focused
|
|
88
|
+
focused === undefined && lastFocused === buttonIndex ||
|
|
89
|
+
// first "move down" button when entering the list for first time
|
|
90
|
+
focused === undefined && lastFocused === undefined && buttonIndex === 1 ? 0 : -1;
|
|
98
91
|
};
|
|
99
92
|
var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
100
93
|
var a11yTitle = _ref.a11yTitle,
|
|
@@ -110,6 +103,7 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
110
103
|
focus = _ref.focus,
|
|
111
104
|
defaultItemKey = _ref.itemKey,
|
|
112
105
|
itemProps = _ref.itemProps,
|
|
106
|
+
messages = _ref.messages,
|
|
113
107
|
onActive = _ref.onActive,
|
|
114
108
|
onClickItem = _ref.onClickItem,
|
|
115
109
|
onKeyDown = _ref.onKeyDown,
|
|
@@ -134,6 +128,8 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
134
128
|
var _useContext = useContext(DataContext),
|
|
135
129
|
contextData = _useContext.data;
|
|
136
130
|
var data = dataProp || contextData || emptyData;
|
|
131
|
+
var _useContext2 = useContext(MessageContext),
|
|
132
|
+
format = _useContext2.format;
|
|
137
133
|
|
|
138
134
|
// fixes issue where itemKey is undefined when only primaryKey is provided
|
|
139
135
|
var itemKey = defaultItemKey || primaryKey || null;
|
|
@@ -149,18 +145,39 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
149
145
|
var _useState = useState(),
|
|
150
146
|
active = _useState[0],
|
|
151
147
|
setActive = _useState[1];
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
setLastActive = _useState2[1];
|
|
148
|
+
/** The item or order control that is most recently interacted with by
|
|
149
|
+
* mouse over or keyboard */
|
|
155
150
|
var updateActive = function updateActive(nextActive) {
|
|
156
151
|
setActive(nextActive);
|
|
157
152
|
// we occasionally call updateActive with undefined when it already is so,
|
|
158
153
|
// no need to call onActive in that case
|
|
159
154
|
if (onActive && onClickItem && nextActive !== active) onActive(nextActive);
|
|
160
155
|
};
|
|
156
|
+
var _useState2 = useState(),
|
|
157
|
+
focused = _useState2[0],
|
|
158
|
+
setFocused = _useState2[1];
|
|
161
159
|
var _useState3 = useState(),
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
lastFocused = _useState3[0],
|
|
161
|
+
setLastFocused = _useState3[1];
|
|
162
|
+
/** Update the item or move up/move down button that is focused
|
|
163
|
+
* in the DOM */
|
|
164
|
+
var updateFocused = function updateFocused(nextFocused) {
|
|
165
|
+
setFocused(nextFocused);
|
|
166
|
+
};
|
|
167
|
+
var handleFocus = function handleFocus(nextFocused) {
|
|
168
|
+
updateActive(nextFocused);
|
|
169
|
+
updateFocused(nextFocused);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// roving tab index, ensure focused item (when onClickItem)
|
|
173
|
+
// or move up / move down button (when onOrder) has DOM focus
|
|
174
|
+
var focusedRef = useRef();
|
|
175
|
+
useEffect(function () {
|
|
176
|
+
if (focused !== undefined) {
|
|
177
|
+
var _focusedRef$current;
|
|
178
|
+
(_focusedRef$current = focusedRef.current) == null || _focusedRef$current.focus();
|
|
179
|
+
}
|
|
180
|
+
}, [focused, data]);
|
|
164
181
|
var _useState4 = useState(),
|
|
165
182
|
dragging = _useState4[0],
|
|
166
183
|
setDragging = _useState4[1];
|
|
@@ -210,73 +227,60 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
210
227
|
var ariaProps = {
|
|
211
228
|
role: onClickItem ? 'listbox' : 'list'
|
|
212
229
|
};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
// We have an item that is 'focused' within the list. This could
|
|
216
|
-
// be the list item or one of the up/down ordering buttons.
|
|
217
|
-
// We need to figure out an id of the thing that will be shown as active
|
|
218
|
-
if (onOrder) {
|
|
219
|
-
// figure out which arrow button will be the active one.
|
|
220
|
-
var buttonId = active % 2 ? 'MoveDown' : 'MoveUp';
|
|
221
|
-
var itemIndex = Math.trunc(active / 2);
|
|
222
|
-
activeId = "" + getItemId(orderableData[itemIndex], itemIndex, itemKey, primaryKey) + buttonId;
|
|
223
|
-
} else if (onClickItem) {
|
|
224
|
-
// The whole list item is active. Figure out an id
|
|
225
|
-
activeId = getItemId(orderableData[active], active, itemKey, primaryKey);
|
|
226
|
-
}
|
|
227
|
-
ariaProps['aria-activedescendant'] = activeId;
|
|
228
|
-
}
|
|
229
|
-
var onSelectOption = function onSelectOption(event) {
|
|
230
|
-
if ((onClickItem || onOrder) && active >= 0) {
|
|
230
|
+
var onSelectOption = function onSelectOption(event, nextFocused) {
|
|
231
|
+
if ((onClickItem || onOrder) && nextFocused >= 0) {
|
|
231
232
|
if (onOrder) {
|
|
232
|
-
var index = Math.trunc(
|
|
233
|
+
var index = Math.trunc(nextFocused / 2);
|
|
233
234
|
// Call onOrder with the re-ordered data.
|
|
234
|
-
// Update the
|
|
235
|
-
//
|
|
235
|
+
// Update the focused control index so that the
|
|
236
|
+
// focused control will stay on the same item
|
|
236
237
|
// even though it moved up or down.
|
|
237
|
-
var newIndex =
|
|
238
|
+
var newIndex = nextFocused % 2 ? index + 1 : index - 1;
|
|
238
239
|
onOrder(reorder(orderableData, pinnedInfo, index, newIndex));
|
|
239
|
-
|
|
240
|
-
|
|
240
|
+
|
|
241
|
+
// distinguish keyboard "click" from mouse "click" event
|
|
242
|
+
// when keyboard, event.detail is always 0
|
|
243
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#usage_notes
|
|
244
|
+
// when keyboard, move focus with the moving item
|
|
245
|
+
if (event.detail === 0) updateFocused(focused % 2 ? Math.min(focused + 2, orderableData.length * 2 - 2) : Math.max(focused - 2, 1));
|
|
246
|
+
// when mouse, keep focused on the same control
|
|
247
|
+
else {
|
|
248
|
+
updateFocused(nextFocused);
|
|
249
|
+
}
|
|
250
|
+
} else if (disabledItems != null && disabledItems.includes(getValue(data[nextFocused], nextFocused, itemKey))) {
|
|
241
251
|
event.preventDefault();
|
|
242
252
|
} else if (onClickItem) {
|
|
243
253
|
event.persist();
|
|
254
|
+
updateFocused(nextFocused);
|
|
244
255
|
var adjustedEvent = event;
|
|
245
|
-
adjustedEvent.item = data[
|
|
246
|
-
adjustedEvent.index =
|
|
256
|
+
adjustedEvent.item = data[nextFocused];
|
|
257
|
+
adjustedEvent.index = nextFocused;
|
|
247
258
|
onClickItem(adjustedEvent);
|
|
248
259
|
sendAnalytics({
|
|
249
260
|
type: 'listItemClick',
|
|
250
261
|
element: listRef.current,
|
|
251
262
|
event: adjustedEvent,
|
|
252
|
-
item: data[
|
|
253
|
-
index:
|
|
263
|
+
item: data[nextFocused],
|
|
264
|
+
index: nextFocused
|
|
254
265
|
});
|
|
255
266
|
}
|
|
256
267
|
}
|
|
257
268
|
};
|
|
258
269
|
return /*#__PURE__*/React.createElement(Container, containterProps, /*#__PURE__*/React.createElement(Keyboard, {
|
|
259
|
-
onEnter: onSelectOption,
|
|
260
|
-
onSpace: function onSpace(event) {
|
|
261
|
-
if (onClickItem || onOrder) {
|
|
262
|
-
event.preventDefault();
|
|
263
|
-
}
|
|
264
|
-
onSelectOption(event);
|
|
265
|
-
},
|
|
266
270
|
onUp: function onUp(event) {
|
|
267
271
|
if (onClickItem || onOrder) {
|
|
268
272
|
event.preventDefault();
|
|
269
|
-
if (
|
|
273
|
+
if (focused >= 0) {
|
|
270
274
|
var min = onOrder ? 1 : 0;
|
|
271
|
-
var
|
|
272
|
-
|
|
275
|
+
var focusedElementIndex = Math.max(focused - 1, min);
|
|
276
|
+
handleFocus(focusedElementIndex);
|
|
273
277
|
|
|
274
|
-
// Ensure the
|
|
275
|
-
// setTimeout for
|
|
278
|
+
// Ensure the focused item is in view
|
|
279
|
+
// setTimeout for focusedElement to be updated
|
|
276
280
|
setTimeout(function () {
|
|
277
281
|
var _listRef$current;
|
|
278
282
|
// eslint-disable max-len
|
|
279
|
-
(_listRef$current = listRef.current) == null || (_listRef$current = _listRef$current.children[
|
|
283
|
+
(_listRef$current = listRef.current) == null || (_listRef$current = _listRef$current.children[focusedElementIndex]) == null || _listRef$current.scrollIntoView({
|
|
280
284
|
behavior: 'smooth',
|
|
281
285
|
block: 'nearest'
|
|
282
286
|
});
|
|
@@ -290,15 +294,15 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
290
294
|
if (orderableData && orderableData.length) {
|
|
291
295
|
var min = onOrder ? 1 : 0;
|
|
292
296
|
var max = onOrder ? orderableData.length * 2 - 2 : data.length - 1;
|
|
293
|
-
var
|
|
294
|
-
|
|
297
|
+
var focusedElementIndex = focused >= min ? Math.min(focused + 1, max) : min;
|
|
298
|
+
handleFocus(focusedElementIndex);
|
|
295
299
|
|
|
296
|
-
// Ensure the
|
|
297
|
-
// setTimeout for
|
|
300
|
+
// Ensure the focused item is in view
|
|
301
|
+
// setTimeout for focusedElement to be updated
|
|
298
302
|
setTimeout(function () {
|
|
299
303
|
var _listRef$current2;
|
|
300
304
|
// eslint-disable max-len
|
|
301
|
-
(_listRef$current2 = listRef.current) == null || (_listRef$current2 = _listRef$current2.children[
|
|
305
|
+
(_listRef$current2 = listRef.current) == null || (_listRef$current2 = _listRef$current2.children[focusedElementIndex]) == null || _listRef$current2.scrollIntoView({
|
|
302
306
|
behavior: 'smooth',
|
|
303
307
|
block: 'nearest'
|
|
304
308
|
});
|
|
@@ -311,20 +315,16 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
311
315
|
"aria-label": ariaLabel || a11yTitle,
|
|
312
316
|
ref: listRef,
|
|
313
317
|
as: as || 'ul',
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
// is currently clicking on
|
|
322
|
-
!active && active !== 0 ? updateActive(lastActive) : updateActive(active)
|
|
323
|
-
);
|
|
318
|
+
onBlur: function onBlur(event) {
|
|
319
|
+
setLastFocused(focused);
|
|
320
|
+
// only reset focused if the focus is leaving the list
|
|
321
|
+
// and not moving to a child element of the list
|
|
322
|
+
if (listRef.current && !listRef.current.contains(event.relatedTarget)) {
|
|
323
|
+
updateFocused(undefined);
|
|
324
|
+
}
|
|
324
325
|
},
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
updateActive(undefined);
|
|
326
|
+
onMouseOut: function onMouseOut() {
|
|
327
|
+
return updateActive(undefined);
|
|
328
328
|
}
|
|
329
329
|
}, ariaProps, passThemeFlag, rest), /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
330
330
|
items: !paginate ? orderingData || data : items,
|
|
@@ -430,8 +430,21 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
430
430
|
if (onClickItem && !onOrder) {
|
|
431
431
|
clickProps = {
|
|
432
432
|
role: 'option',
|
|
433
|
-
tabIndex:
|
|
433
|
+
tabIndex:
|
|
434
|
+
// entering list for first time
|
|
435
|
+
focused === undefined && lastFocused === undefined && index === 0 ||
|
|
436
|
+
// returning to list after already using keyboard
|
|
437
|
+
focused === undefined && lastFocused !== undefined && lastFocused === index ||
|
|
438
|
+
// actively using keyboard
|
|
439
|
+
focused === index ? 0 : -1,
|
|
434
440
|
active: active === index,
|
|
441
|
+
focus: focused === index,
|
|
442
|
+
hoverIndicator: !isDisabled,
|
|
443
|
+
ref: function ref(node) {
|
|
444
|
+
if (focused === index) {
|
|
445
|
+
focusedRef.current = node;
|
|
446
|
+
}
|
|
447
|
+
},
|
|
435
448
|
onClick: function onClick(event) {
|
|
436
449
|
// Only prevent event when disabled. We still want screen
|
|
437
450
|
// readers to be aware that an option exists, but is in a
|
|
@@ -439,34 +452,14 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
439
452
|
if (isDisabled) {
|
|
440
453
|
event.preventDefault();
|
|
441
454
|
} else {
|
|
442
|
-
|
|
443
|
-
event.persist();
|
|
444
|
-
var adjustedEvent = event;
|
|
445
|
-
adjustedEvent.item = item;
|
|
446
|
-
adjustedEvent.index = index;
|
|
447
|
-
onClickItem(adjustedEvent);
|
|
448
|
-
sendAnalytics({
|
|
449
|
-
type: 'listItemClick',
|
|
450
|
-
element: listRef.current,
|
|
451
|
-
event: adjustedEvent,
|
|
452
|
-
item: item,
|
|
453
|
-
index: index
|
|
454
|
-
});
|
|
455
|
+
onSelectOption(event, index);
|
|
455
456
|
}
|
|
456
457
|
},
|
|
457
|
-
onMouseOver: function onMouseOver() {
|
|
458
|
-
return updateActive(index);
|
|
459
|
-
},
|
|
460
|
-
onMouseOut: function onMouseOut() {
|
|
461
|
-
return updateActive(undefined);
|
|
462
|
-
},
|
|
463
458
|
onFocus: function onFocus() {
|
|
464
|
-
|
|
465
|
-
setItemFocus(true);
|
|
459
|
+
handleFocus(index);
|
|
466
460
|
},
|
|
467
|
-
|
|
468
|
-
updateActive(
|
|
469
|
-
setItemFocus(false);
|
|
461
|
+
onMouseOver: function onMouseOver() {
|
|
462
|
+
return updateActive(index);
|
|
470
463
|
}
|
|
471
464
|
};
|
|
472
465
|
}
|
|
@@ -482,7 +475,7 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
482
475
|
// eslint-disable-next-line no-param-reassign
|
|
483
476
|
event.dataTransfer.effectAllowed = 'move';
|
|
484
477
|
setDragging(orderableIndex);
|
|
485
|
-
|
|
478
|
+
updateFocused(undefined);
|
|
486
479
|
},
|
|
487
480
|
onDragEnd: function onDragEnd() {
|
|
488
481
|
setDragging(undefined);
|
|
@@ -508,6 +501,13 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
508
501
|
};
|
|
509
502
|
var Up = theme.list.icons.up;
|
|
510
503
|
var Down = theme.list.icons.down;
|
|
504
|
+
var moveUpIndex = orderableIndex * 2;
|
|
505
|
+
var moveUpTabIndex = calculateTabIndex(moveUpIndex, focused, lastFocused, !orderableIndex // first item can't move up
|
|
506
|
+
);
|
|
507
|
+
var moveDownIndex = orderableIndex * 2 + 1;
|
|
508
|
+
var moveDownTabIndex = calculateTabIndex(moveDownIndex, focused, lastFocused,
|
|
509
|
+
// last item can't move down
|
|
510
|
+
orderableIndex >= orderableData.length - 1);
|
|
511
511
|
orderControls = !isPinned && /*#__PURE__*/React.createElement(Box, {
|
|
512
512
|
direction: "row",
|
|
513
513
|
align: "center",
|
|
@@ -517,54 +517,40 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
517
517
|
a11yTitle: orderableIndex + 1 + " " + key + " move up",
|
|
518
518
|
icon: /*#__PURE__*/React.createElement(Up, null),
|
|
519
519
|
hoverIndicator: true,
|
|
520
|
-
focusIndicator: false,
|
|
521
520
|
disabled: !orderableIndex,
|
|
522
|
-
active:
|
|
521
|
+
active: focused === moveUpIndex,
|
|
523
522
|
onClick: function onClick(event) {
|
|
524
523
|
event.stopPropagation();
|
|
525
|
-
|
|
526
|
-
},
|
|
527
|
-
tabIndex: -1,
|
|
528
|
-
onMouseOver: function onMouseOver() {
|
|
529
|
-
return updateActive(orderableIndex * 2);
|
|
530
|
-
},
|
|
531
|
-
onMouseOut: function onMouseOut() {
|
|
532
|
-
return updateActive(undefined);
|
|
524
|
+
onSelectOption(event, moveUpIndex);
|
|
533
525
|
},
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
updateActive(undefined);
|
|
540
|
-
setItemFocus(false);
|
|
526
|
+
tabIndex: moveUpTabIndex,
|
|
527
|
+
ref: function ref(node) {
|
|
528
|
+
if (focused === moveUpIndex) {
|
|
529
|
+
focusedRef.current = node;
|
|
530
|
+
}
|
|
541
531
|
}
|
|
542
532
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
543
533
|
id: key + "MoveDown",
|
|
544
534
|
a11yTitle: orderableIndex + 1 + " " + key + " move down",
|
|
545
535
|
icon: /*#__PURE__*/React.createElement(Down, null),
|
|
546
536
|
hoverIndicator: true,
|
|
547
|
-
focusIndicator: false,
|
|
548
537
|
disabled: orderableIndex >= orderableData.length - 1,
|
|
549
|
-
active:
|
|
538
|
+
active: focused === moveDownIndex,
|
|
550
539
|
onClick: function onClick(event) {
|
|
551
540
|
event.stopPropagation();
|
|
552
|
-
|
|
541
|
+
onSelectOption(event, moveDownIndex);
|
|
553
542
|
},
|
|
554
|
-
tabIndex:
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
return updateActive(undefined);
|
|
543
|
+
tabIndex: moveDownTabIndex,
|
|
544
|
+
ref: function ref(node) {
|
|
545
|
+
if (focused === moveDownIndex) {
|
|
546
|
+
focusedRef.current = node;
|
|
547
|
+
}
|
|
560
548
|
},
|
|
561
549
|
onFocus: function onFocus() {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
updateActive(undefined);
|
|
567
|
-
setItemFocus(false);
|
|
550
|
+
// make sure first "MoveDown" is focusable
|
|
551
|
+
if (focused === undefined && lastFocused === undefined) {
|
|
552
|
+
handleFocus(moveDownIndex);
|
|
553
|
+
}
|
|
568
554
|
}
|
|
569
555
|
}));
|
|
570
556
|
|
|
@@ -602,6 +588,10 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
602
588
|
pinIcon = /*#__PURE__*/cloneElement(pinIcon, _extends({}, !((_pinIcon$props = pinIcon.props) != null && _pinIcon$props.color) && pinnedColor ? {
|
|
603
589
|
color: pinnedColor
|
|
604
590
|
} : {}, {
|
|
591
|
+
a11yTitle: format({
|
|
592
|
+
id: 'list.pinned',
|
|
593
|
+
messages: messages
|
|
594
|
+
}),
|
|
605
595
|
size: pinSize
|
|
606
596
|
}));
|
|
607
597
|
boxProps = {
|
|
@@ -60,6 +60,9 @@ export interface ListProps<ListItemType> {
|
|
|
60
60
|
[_: string]: { background?: string; border?: BorderType; pad?: PadType };
|
|
61
61
|
};
|
|
62
62
|
margin?: MarginType;
|
|
63
|
+
messages?: {
|
|
64
|
+
pinned?: string;
|
|
65
|
+
};
|
|
63
66
|
onActive?: (index: number) => void;
|
|
64
67
|
onClickItem?: (
|
|
65
68
|
event: React.MouseEvent & { item: ListItemType; index: number },
|
|
@@ -30,6 +30,9 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
30
30
|
showIndex: PropTypes.bool,
|
|
31
31
|
itemKey: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
|
32
32
|
itemProps: PropTypes.shape({}),
|
|
33
|
+
messages: PropTypes.shape({
|
|
34
|
+
pinned: PropTypes.string
|
|
35
|
+
}),
|
|
33
36
|
onActive: PropTypes.func,
|
|
34
37
|
onClickItem: PropTypes.func,
|
|
35
38
|
onMore: PropTypes.func,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _excluded = ["fill", "direction"],
|
|
2
|
-
_excluded2 = ["actions", "message", "onClose", "id", "global", "status", "title", "toast", "icon", "time"];
|
|
2
|
+
_excluded2 = ["actions", "message", "messages", "onClose", "id", "global", "status", "title", "toast", "icon", "time"];
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import React, { useCallback, useEffect, useState, useMemo, Fragment } from 'react';
|
|
5
|
+
import React, { useCallback, useEffect, useState, useMemo, Fragment, useContext } from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import { Anchor } from '../Anchor';
|
|
8
8
|
import { Box } from '../Box';
|
|
@@ -10,6 +10,9 @@ import { Button } from '../Button';
|
|
|
10
10
|
import { Layer } from '../Layer';
|
|
11
11
|
import { Paragraph } from '../Paragraph';
|
|
12
12
|
import { Text } from '../Text';
|
|
13
|
+
// eslint-disable-next-line max-len
|
|
14
|
+
import { AnnounceContext } from '../../contexts/AnnounceContext/AnnounceContext';
|
|
15
|
+
import { MessageContext } from '../../contexts/MessageContext';
|
|
13
16
|
import { NotificationType } from './propTypes';
|
|
14
17
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
15
18
|
var Message = function Message(_ref) {
|
|
@@ -65,9 +68,10 @@ var NotificationAnchor = styled(Anchor).withConfig({
|
|
|
65
68
|
componentId: "sc-1yq09yz-0"
|
|
66
69
|
})(["white-space:nowrap;"]);
|
|
67
70
|
var Notification = function Notification(_ref2) {
|
|
68
|
-
var _theme$notification6, _theme$notification7, _theme$notification8, _theme$notification9, _theme$
|
|
71
|
+
var _theme$notification6, _theme$notification7, _theme$notification8, _theme$notification9, _theme$notification0;
|
|
69
72
|
var actionsProp = _ref2.actions,
|
|
70
73
|
messageProp = _ref2.message,
|
|
74
|
+
messages = _ref2.messages,
|
|
71
75
|
onClose = _ref2.onClose,
|
|
72
76
|
id = _ref2.id,
|
|
73
77
|
global = _ref2.global,
|
|
@@ -85,9 +89,18 @@ var Notification = function Notification(_ref2) {
|
|
|
85
89
|
var _useState = useState(true),
|
|
86
90
|
visible = _useState[0],
|
|
87
91
|
setVisible = _useState[1];
|
|
92
|
+
var _useContext = useContext(MessageContext),
|
|
93
|
+
format = _useContext.format;
|
|
88
94
|
var position = useMemo(function () {
|
|
89
95
|
return toast && (toast == null ? void 0 : toast.position) || 'top';
|
|
90
96
|
}, [toast]);
|
|
97
|
+
var announce = useContext(AnnounceContext);
|
|
98
|
+
useEffect(function () {
|
|
99
|
+
if (visible && toast) {
|
|
100
|
+
var announceText = typeof messageProp === 'string' ? title + ". " + messageProp : title;
|
|
101
|
+
announce(announceText, 'polite', time || theme.notification.toast.time || theme.notification.time);
|
|
102
|
+
}
|
|
103
|
+
}, [announce, visible, toast, messageProp, title, theme.notification.toast.time, theme.notification.time, time]);
|
|
91
104
|
var close = useCallback(function (event) {
|
|
92
105
|
setVisible(false);
|
|
93
106
|
if (onClose) onClose(event);
|
|
@@ -157,7 +170,7 @@ var Notification = function Notification(_ref2) {
|
|
|
157
170
|
}
|
|
158
171
|
}, message), actions) : message;
|
|
159
172
|
}
|
|
160
|
-
var iconDimension = ((_theme$
|
|
173
|
+
var iconDimension = ((_theme$notification0 = theme.notification) == null || (_theme$notification0 = _theme$notification0.message) == null ? void 0 : _theme$notification0.size) || 'medium';
|
|
161
174
|
var content = /*#__PURE__*/React.createElement(Box, _extends({}, theme.notification.container, global ? _extends({}, theme.notification.global.container) : {}, toast ? _extends({}, theme.notification.toast.container) : {}, {
|
|
162
175
|
background: background
|
|
163
176
|
// let internal box control pad
|
|
@@ -182,6 +195,10 @@ var Notification = function Notification(_ref2) {
|
|
|
182
195
|
React.createElement(Box, {
|
|
183
196
|
pad: closeButtonPad
|
|
184
197
|
}, /*#__PURE__*/React.createElement(Box, theme.notification.textContainer, /*#__PURE__*/React.createElement(Button, {
|
|
198
|
+
a11yTitle: format({
|
|
199
|
+
id: 'notification.close',
|
|
200
|
+
messages: messages
|
|
201
|
+
}),
|
|
185
202
|
icon: /*#__PURE__*/React.createElement(CloseIcon, {
|
|
186
203
|
color: closeIconColor,
|
|
187
204
|
height: iconDimension,
|
|
@@ -193,7 +210,7 @@ var Notification = function Notification(_ref2) {
|
|
|
193
210
|
}))));
|
|
194
211
|
if (toast) {
|
|
195
212
|
content = visible && /*#__PURE__*/React.createElement(Layer, _extends({}, theme.notification.toast.layer, {
|
|
196
|
-
role: "
|
|
213
|
+
role: "status",
|
|
197
214
|
modal: false,
|
|
198
215
|
onEsc: onClose,
|
|
199
216
|
id: id,
|
|
@@ -8,6 +8,9 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
8
8
|
global: PropTypes.bool,
|
|
9
9
|
title: PropTypes.string,
|
|
10
10
|
message: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
11
|
+
messages: PropTypes.shape({
|
|
12
|
+
close: PropTypes.string
|
|
13
|
+
}),
|
|
11
14
|
status: PropTypes.oneOf(['critical', 'warning', 'normal', 'info', 'unknown']),
|
|
12
15
|
toast: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
|
13
16
|
autoClose: PropTypes.bool,
|
|
@@ -33,7 +33,7 @@ var StyledRadioButtonLabel = styled.span.withConfig(styledComponentsConfig).with
|
|
|
33
33
|
var StyledRadioButtonIcon = styled.svg.withConfig(styledComponentsConfig).withConfig({
|
|
34
34
|
displayName: "StyledRadioButton__StyledRadioButtonIcon",
|
|
35
35
|
componentId: "sc-g1f6ld-3"
|
|
36
|
-
})(["box-sizing:border-box;width:", ";height:", ";fill:", ";", ";"], function (props) {
|
|
36
|
+
})(["box-sizing:border-box;width:", ";height:", ";fill:", ";transform:scale(1);", ";"], function (props) {
|
|
37
37
|
return props.theme.radioButton.icon.size || props.theme.radioButton.size;
|
|
38
38
|
}, function (props) {
|
|
39
39
|
return props.theme.radioButton.icon.size || props.theme.radioButton.size;
|
|
@@ -45,7 +45,7 @@ var StyledRadioButtonIcon = styled.svg.withConfig(styledComponentsConfig).withCo
|
|
|
45
45
|
var StyledRadioButtonBox = styled(Box).withConfig({
|
|
46
46
|
displayName: "StyledRadioButton__StyledRadioButtonBox",
|
|
47
47
|
componentId: "sc-g1f6ld-4"
|
|
48
|
-
})(["background-color:", ";", ";", ";"], function (props) {
|
|
48
|
+
})(["background-color:", ";transform:scale(1);", ";", ";"], function (props) {
|
|
49
49
|
return props.backgroundColor;
|
|
50
50
|
}, function (props) {
|
|
51
51
|
return props.focus && focusStyle();
|