grommet 2.43.0 → 2.45.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.js +8 -3
- package/components/Accordion/Accordion.js +1 -1
- package/components/Accordion/stories/CustomThemed/Custom.js +1 -1
- package/components/Accordion/stories/Simple.js +1 -1
- package/components/AccordionPanel/AccordionPanel.js +1 -1
- package/components/Anchor/Anchor.js +3 -2
- package/components/Avatar/Avatar.js +1 -1
- package/components/Box/Box.js +1 -1
- package/components/Box/stories/Background.js +1 -1
- package/components/Button/Button.js +1 -1
- package/components/Button/stories/CustomThemed/Typescript.tsx +1 -1
- package/components/Button/stories/Kind.js +6 -10
- package/components/Calendar/Calendar.js +16 -9
- package/components/Calendar/StyledCalendar.js +6 -5
- package/components/Calendar/index.d.ts +1 -0
- package/components/Calendar/propTypes.js +1 -0
- package/components/Calendar/stories/DaylightSavings.js +1 -1
- package/components/Calendar/stories/HeaderLevel.js +36 -0
- package/components/Calendar/stories/ShowAdjacentDays.js +3 -2
- package/components/Card/stories/CustomThemed/Clickable.js +3 -3
- package/components/Card/stories/CustomThemed/Stacked.js +2 -2
- package/components/Card/stories/CustomThemed/Themed.js +5 -5
- package/components/Cards/Cards.js +1 -1
- package/components/Cards/stories/Children.js +2 -2
- package/components/Carousel/Carousel.js +1 -1
- package/components/Carousel/stories/CustomThemed/Custom.js +1 -1
- package/components/Chart/Chart.js +1 -1
- package/components/CheckBox/CheckBox.js +1 -1
- package/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
- package/components/CheckBox/stories/NoLabel.js +1 -1
- package/components/CheckBox/stories/Simple.js +1 -1
- package/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
- package/components/Clock/Analog.js +1 -1
- package/components/Clock/Clock.js +1 -1
- package/components/Clock/Digital.js +1 -1
- package/components/Collapsible/stories/Nested.js +1 -1
- package/components/Data/Data.js +1 -1
- package/components/Data/DataForm.js +1 -1
- package/components/Data/stories/Inline.js +1 -1
- package/components/DataChart/DataChart.js +1 -1
- package/components/DataChart/Detail.js +55 -25
- package/components/DataChart/Legend.js +1 -0
- package/components/DataChart/XAxis.js +1 -1
- package/components/DataClearFilters/DataClearFilters.js +1 -1
- package/components/DataFilter/DataFilter.js +1 -1
- package/components/DataFilters/DataFilters.js +1 -1
- package/components/DataSearch/DataSearch.js +1 -1
- package/components/DataSort/DataSort.js +1 -1
- package/components/DataSummary/DataSummary.js +1 -1
- package/components/DataTable/Body.js +17 -3
- package/components/DataTable/Cell.js +1 -1
- package/components/DataTable/DataTable.js +1 -1
- package/components/DataTable/ExpanderCell.js +1 -1
- package/components/DataTable/Footer.js +1 -1
- package/components/DataTable/GroupedBody.js +1 -1
- package/components/DataTable/Header.js +2 -2
- package/components/DataTable/StyledDataTable.js +20 -12
- package/components/DataTable/stories/CustomThemed/Custom.js +8 -0
- package/components/DataTable/stories/CustomThemed/Fill.js +1 -0
- package/components/DataTableColumns/DataTableColumns.js +1 -1
- package/components/DataTableGroupBy/DataTableGroupBy.js +1 -1
- package/components/DataView/DataView.js +1 -1
- package/components/DateInput/DateInput.js +1 -1
- package/components/Diagram/Diagram.js +1 -1
- package/components/Diagram/stories/Progressing.js +1 -1
- package/components/Distribution/Distribution.js +1 -1
- package/components/Drop/Drop.js +1 -1
- package/components/Drop/DropContainer.js +1 -1
- package/components/Drop/stories/CustomThemed/Lazy.js +4 -4
- package/components/Drop/stories/CustomThemed/Themed.js +1 -1
- package/components/DropButton/DropButton.js +1 -1
- package/components/FileInput/FileInput.js +1 -1
- package/components/FocusedContainer.js +1 -1
- package/components/Form/Form.js +1 -1
- package/components/Form/stories/AggregateValidation.js +5 -2
- package/components/Form/stories/ArrayOfFormFields.js +19 -6
- package/components/Form/stories/Controlled.js +8 -1
- package/components/Form/stories/ControlledInput.js +8 -1
- package/components/Form/stories/ControlledInputLazy.js +5 -1
- package/components/Form/stories/ControlledLazy.js +5 -1
- package/components/Form/stories/CustomThemed/Custom.js +17 -1
- package/components/Form/stories/CustomThemed/FieldSpacingOptions.js +36 -36
- package/components/Form/stories/CustomThemed/RequiredLabel.js +3 -0
- package/components/Form/stories/CustomThemed/Themed.js +2 -2
- package/components/Form/stories/DynamicFields.js +9 -2
- package/components/Form/stories/FieldWithChildren.js +6 -1
- package/components/Form/stories/TriggerValidationUsingFormField.js +18 -6
- package/components/Form/stories/Uncontrolled.js +6 -1
- package/components/Form/stories/ValidateOnBlur.js +10 -3
- package/components/Form/stories/ValidateOnChange.js +11 -5
- package/components/Form/stories/ValidateOnMount.js +11 -4
- package/components/Form/stories/typescript/TypedForm.tsx +39 -45
- package/components/FormField/FormField.js +73 -18
- package/components/FormField/stories/CustomThemed/Custom.tsx +1 -1
- package/components/Grid/Grid.js +1 -1
- package/components/Grid/stories/AreasPropAlternative.js +4 -1
- package/components/Grid/stories/CustomThemed/Responsive.js +1 -1
- package/components/Grommet/Grommet.js +1 -1
- package/components/Grommet/index.d.ts +4 -0
- package/components/Grommet/propTypes.js +4 -0
- package/components/Header/Header.js +1 -1
- package/components/Heading/Heading.js +1 -1
- package/components/Image/Image.js +1 -1
- package/components/Keyboard/Keyboard.js +1 -1
- package/components/Layer/LayerContainer.js +4 -15
- package/components/Layer/StyledLayer.js +2 -1
- package/components/List/List.js +1 -1
- package/components/Markdown/Markdown.js +1 -1
- package/components/MaskedInput/MaskedInput.js +1 -1
- package/components/Menu/Menu.js +6 -5
- package/components/Menu/stories/CustomThemed/Themed.tsx +4 -0
- package/components/Meter/Bar.js +1 -1
- package/components/Meter/Circle.js +1 -1
- package/components/Meter/Meter.js +1 -1
- package/components/Meter/StyledMeter.js +2 -1
- package/components/NameValueList/NameValueList.js +1 -1
- package/components/Nav/stories/CustomThemed/JustifySidebar.js +2 -2
- package/components/Nav/stories/Sidebar.js +1 -1
- package/components/Notification/Notification.js +38 -27
- package/components/Notification/stories/CustomThemed/ThemedNotification.tsx +2 -1
- package/components/Page/Page.js +1 -1
- package/components/PageContent/PageContent.js +1 -1
- package/components/PageHeader/PageHeader.js +1 -1
- package/components/PageHeader/stories/Level.js +2 -2
- package/components/PageHeader/stories/Size.js +3 -2
- package/components/Pagination/PageControl.js +1 -1
- package/components/Pagination/Pagination.js +1 -1
- package/components/Pagination/PaginationStep.js +1 -1
- package/components/Pagination/PaginationSummary.js +1 -1
- package/components/Paragraph/Paragraph.js +1 -1
- package/components/RadioButton/RadioButton.js +1 -1
- package/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
- package/components/RadioButtonGroup/stories/Disabled.js +1 -1
- package/components/RangeInput/RangeInput.js +1 -1
- package/components/RangeSelector/EdgeControl.js +1 -1
- package/components/RangeSelector/RangeSelector.js +1 -1
- package/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
- package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
- package/components/RangeSelector/stories/Step.js +1 -1
- package/components/RangeSelector/stories/Vertical.js +1 -1
- package/components/RoutedAnchor/RoutedAnchor.js +1 -1
- package/components/RoutedButton/RoutedButton.js +1 -1
- package/components/Select/DefaultSelectTextInput.js +1 -1
- package/components/Select/Select.js +1 -1
- package/components/Select/SelectContainer.js +2 -1
- package/components/Select/StyledSelect.js +4 -1
- package/components/Select/stories/components/SearchBorderBox.js +1 -1
- package/components/Select/stories/components/SearchInput.js +1 -1
- package/components/SelectMultiple/SelectMultiple.js +1 -1
- package/components/SelectMultiple/SelectMultipleContainer.js +2 -1
- package/components/Sidebar/Sidebar.js +1 -1
- package/components/Sidebar/stories/Labels.js +1 -1
- package/components/Skeleton/Skeleton.js +1 -1
- package/components/Skeleton/stories/CustomThemed/Custom.js +2 -0
- package/components/Skeleton/stories/GridContainer.js +2 -2
- package/components/Skeleton/stories/Group.js +1 -1
- package/components/Skeleton/stories/Individual.js +2 -3
- package/components/Skeleton/stories/Simple.js +1 -0
- package/components/SkipLink/SkipLink.js +1 -1
- package/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
- package/components/SkipLinks/stories/CustomThemed/Themed.js +1 -1
- package/components/Spinner/Spinner.js +1 -1
- package/components/Stack/Stack.js +1 -1
- package/components/StarRating/StarRating.js +18 -4
- package/components/Tab/Tab.js +1 -1
- package/components/Table/Table.js +1 -1
- package/components/TableCell/TableCell.js +1 -1
- package/components/Tabs/Tabs.js +2 -2
- package/components/Tabs/stories/CustomThemed/Custom.js +3 -3
- package/components/Tag/Tag.js +1 -1
- package/components/Text/Text.js +1 -1
- package/components/Text/TextSkeleton.js +1 -1
- package/components/TextArea/TextArea.js +1 -1
- package/components/TextArea/stories/CustomThemed/Themed.js +1 -0
- package/components/TextInput/TextInput.js +1 -1
- package/components/TextInput/stories/Simple.js +1 -6
- package/components/TextInput/stories/WithTags.js +1 -1
- package/components/ThumbsRating/ThumbsRating.js +20 -5
- package/components/ToggleGroup/StyledToggleGroup.js +9 -1
- package/components/ToggleGroup/ToggleGroup.js +2 -2
- package/components/Toolbar/Toolbar.js +1 -1
- package/components/Video/Video.js +1 -1
- package/components/WorldMap/WorldMap.js +1 -1
- package/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
- package/es6/all/stories/AllComponents.js +8 -3
- package/es6/components/Accordion/Accordion.js +1 -1
- package/es6/components/Accordion/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/Accordion/stories/Simple.js +1 -1
- package/es6/components/AccordionPanel/AccordionPanel.js +1 -1
- package/es6/components/Anchor/Anchor.js +3 -2
- package/es6/components/Avatar/Avatar.js +1 -1
- package/es6/components/Box/Box.js +1 -1
- package/es6/components/Box/stories/Background.js +1 -1
- package/es6/components/Button/Button.js +1 -1
- package/es6/components/Button/stories/CustomThemed/Typescript.tsx +1 -1
- package/es6/components/Button/stories/Kind.js +6 -10
- package/es6/components/Calendar/Calendar.js +16 -9
- package/es6/components/Calendar/StyledCalendar.js +6 -5
- package/es6/components/Calendar/index.d.ts +1 -0
- package/es6/components/Calendar/propTypes.js +1 -0
- package/es6/components/Calendar/stories/DaylightSavings.js +2 -2
- package/es6/components/Calendar/stories/HeaderLevel.js +30 -0
- package/es6/components/Calendar/stories/ShowAdjacentDays.js +3 -2
- package/es6/components/Card/stories/CustomThemed/Clickable.js +4 -4
- package/es6/components/Card/stories/CustomThemed/Stacked.js +3 -3
- package/es6/components/Card/stories/CustomThemed/Themed.js +6 -6
- package/es6/components/Cards/Cards.js +1 -1
- package/es6/components/Cards/stories/Children.js +3 -3
- package/es6/components/Carousel/Carousel.js +1 -1
- package/es6/components/Carousel/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/Chart/Chart.js +1 -1
- package/es6/components/CheckBox/CheckBox.js +1 -1
- package/es6/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/CheckBox/stories/NoLabel.js +1 -1
- package/es6/components/CheckBox/stories/Simple.js +1 -1
- package/es6/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
- package/es6/components/Clock/Analog.js +1 -1
- package/es6/components/Clock/Clock.js +1 -1
- package/es6/components/Clock/Digital.js +1 -1
- package/es6/components/Collapsible/stories/Nested.js +1 -1
- package/es6/components/Data/Data.js +1 -1
- package/es6/components/Data/DataForm.js +1 -1
- package/es6/components/Data/stories/Inline.js +1 -1
- package/es6/components/DataChart/DataChart.js +1 -1
- package/es6/components/DataChart/Detail.js +55 -25
- package/es6/components/DataChart/Legend.js +1 -0
- package/es6/components/DataChart/XAxis.js +1 -1
- package/es6/components/DataClearFilters/DataClearFilters.js +1 -1
- package/es6/components/DataFilter/DataFilter.js +1 -1
- package/es6/components/DataFilters/DataFilters.js +1 -1
- package/es6/components/DataSearch/DataSearch.js +1 -1
- package/es6/components/DataSort/DataSort.js +1 -1
- package/es6/components/DataSummary/DataSummary.js +1 -1
- package/es6/components/DataTable/Body.js +19 -5
- package/es6/components/DataTable/Cell.js +1 -1
- package/es6/components/DataTable/DataTable.js +1 -1
- package/es6/components/DataTable/ExpanderCell.js +1 -1
- package/es6/components/DataTable/Footer.js +1 -1
- package/es6/components/DataTable/GroupedBody.js +1 -1
- package/es6/components/DataTable/Header.js +3 -3
- package/es6/components/DataTable/StyledDataTable.js +20 -12
- package/es6/components/DataTable/stories/CustomThemed/Custom.js +8 -0
- package/es6/components/DataTable/stories/CustomThemed/Fill.js +1 -0
- package/es6/components/DataTableColumns/DataTableColumns.js +1 -1
- package/es6/components/DataTableGroupBy/DataTableGroupBy.js +1 -1
- package/es6/components/DataView/DataView.js +1 -1
- package/es6/components/DateInput/DateInput.js +1 -1
- package/es6/components/Diagram/Diagram.js +1 -1
- package/es6/components/Diagram/stories/Progressing.js +1 -1
- package/es6/components/Distribution/Distribution.js +1 -1
- package/es6/components/Drop/Drop.js +1 -1
- package/es6/components/Drop/DropContainer.js +1 -1
- package/es6/components/Drop/stories/CustomThemed/Lazy.js +4 -4
- package/es6/components/Drop/stories/CustomThemed/Themed.js +1 -1
- package/es6/components/DropButton/DropButton.js +1 -1
- package/es6/components/FileInput/FileInput.js +1 -1
- package/es6/components/FocusedContainer.js +1 -1
- package/es6/components/Form/Form.js +1 -1
- package/es6/components/Form/stories/AggregateValidation.js +5 -2
- package/es6/components/Form/stories/ArrayOfFormFields.js +20 -7
- package/es6/components/Form/stories/Controlled.js +8 -1
- package/es6/components/Form/stories/ControlledInput.js +8 -1
- package/es6/components/Form/stories/ControlledInputLazy.js +5 -1
- package/es6/components/Form/stories/ControlledLazy.js +5 -1
- package/es6/components/Form/stories/CustomThemed/Custom.js +17 -1
- package/es6/components/Form/stories/CustomThemed/FieldSpacingOptions.js +36 -36
- package/es6/components/Form/stories/CustomThemed/RequiredLabel.js +3 -0
- package/es6/components/Form/stories/CustomThemed/Themed.js +2 -2
- package/es6/components/Form/stories/DynamicFields.js +9 -2
- package/es6/components/Form/stories/FieldWithChildren.js +6 -1
- package/es6/components/Form/stories/TriggerValidationUsingFormField.js +19 -7
- package/es6/components/Form/stories/Uncontrolled.js +6 -1
- package/es6/components/Form/stories/ValidateOnBlur.js +10 -3
- package/es6/components/Form/stories/ValidateOnChange.js +12 -6
- package/es6/components/Form/stories/ValidateOnMount.js +11 -4
- package/es6/components/Form/stories/typescript/TypedForm.tsx +39 -45
- package/es6/components/FormField/FormField.js +73 -18
- package/es6/components/FormField/stories/CustomThemed/Custom.tsx +1 -1
- package/es6/components/Grid/Grid.js +1 -1
- package/es6/components/Grid/stories/AreasPropAlternative.js +4 -1
- package/es6/components/Grid/stories/CustomThemed/Responsive.js +1 -1
- package/es6/components/Grommet/Grommet.js +1 -1
- package/es6/components/Grommet/index.d.ts +4 -0
- package/es6/components/Grommet/propTypes.js +4 -0
- package/es6/components/Header/Header.js +1 -1
- package/es6/components/Heading/Heading.js +1 -1
- package/es6/components/Image/Image.js +1 -1
- package/es6/components/Keyboard/Keyboard.js +1 -1
- package/es6/components/Layer/LayerContainer.js +5 -16
- package/es6/components/Layer/StyledLayer.js +2 -1
- package/es6/components/List/List.js +1 -1
- package/es6/components/Markdown/Markdown.js +1 -1
- package/es6/components/MaskedInput/MaskedInput.js +1 -1
- package/es6/components/Menu/Menu.js +6 -5
- package/es6/components/Menu/stories/CustomThemed/Themed.tsx +4 -0
- package/es6/components/Meter/Bar.js +1 -1
- package/es6/components/Meter/Circle.js +1 -1
- package/es6/components/Meter/Meter.js +1 -1
- package/es6/components/Meter/StyledMeter.js +3 -1
- package/es6/components/NameValueList/NameValueList.js +1 -1
- package/es6/components/Nav/stories/CustomThemed/JustifySidebar.js +2 -2
- package/es6/components/Nav/stories/Sidebar.js +1 -1
- package/es6/components/Notification/Notification.js +38 -27
- package/es6/components/Notification/stories/CustomThemed/ThemedNotification.tsx +2 -1
- package/es6/components/Page/Page.js +1 -1
- package/es6/components/PageContent/PageContent.js +1 -1
- package/es6/components/PageHeader/PageHeader.js +1 -1
- package/es6/components/PageHeader/stories/Level.js +3 -3
- package/es6/components/PageHeader/stories/Size.js +3 -2
- package/es6/components/Pagination/PageControl.js +1 -1
- package/es6/components/Pagination/Pagination.js +1 -1
- package/es6/components/Pagination/PaginationStep.js +1 -1
- package/es6/components/Pagination/PaginationSummary.js +1 -1
- package/es6/components/Paragraph/Paragraph.js +1 -1
- package/es6/components/RadioButton/RadioButton.js +1 -1
- package/es6/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/es6/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
- package/es6/components/RadioButtonGroup/stories/Disabled.js +1 -1
- package/es6/components/RangeInput/RangeInput.js +1 -1
- package/es6/components/RangeSelector/EdgeControl.js +1 -1
- package/es6/components/RangeSelector/RangeSelector.js +1 -1
- package/es6/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
- package/es6/components/RangeSelector/stories/Step.js +1 -1
- package/es6/components/RangeSelector/stories/Vertical.js +1 -1
- package/es6/components/RoutedAnchor/RoutedAnchor.js +1 -1
- package/es6/components/RoutedButton/RoutedButton.js +1 -1
- package/es6/components/Select/DefaultSelectTextInput.js +1 -1
- package/es6/components/Select/Select.js +1 -1
- package/es6/components/Select/SelectContainer.js +2 -1
- package/es6/components/Select/StyledSelect.js +4 -1
- package/es6/components/Select/stories/components/SearchBorderBox.js +1 -1
- package/es6/components/Select/stories/components/SearchInput.js +1 -1
- package/es6/components/SelectMultiple/SelectMultiple.js +1 -1
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +2 -1
- package/es6/components/Sidebar/Sidebar.js +1 -1
- package/es6/components/Sidebar/stories/Labels.js +1 -1
- package/es6/components/Skeleton/Skeleton.js +1 -1
- package/es6/components/Skeleton/stories/CustomThemed/Custom.js +2 -0
- package/es6/components/Skeleton/stories/GridContainer.js +3 -3
- package/es6/components/Skeleton/stories/Group.js +2 -2
- package/es6/components/Skeleton/stories/Individual.js +3 -4
- package/es6/components/Skeleton/stories/Simple.js +1 -0
- package/es6/components/SkipLink/SkipLink.js +1 -1
- package/es6/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
- package/es6/components/SkipLinks/stories/CustomThemed/Themed.js +1 -1
- package/es6/components/Spinner/Spinner.js +1 -1
- package/es6/components/Stack/Stack.js +1 -1
- package/es6/components/StarRating/StarRating.js +17 -4
- package/es6/components/Tab/Tab.js +1 -1
- package/es6/components/Table/Table.js +1 -1
- package/es6/components/TableCell/TableCell.js +1 -1
- package/es6/components/Tabs/Tabs.js +2 -2
- package/es6/components/Tabs/stories/CustomThemed/Custom.js +3 -3
- package/es6/components/Tag/Tag.js +1 -1
- package/es6/components/Text/Text.js +1 -1
- package/es6/components/Text/TextSkeleton.js +1 -1
- package/es6/components/TextArea/TextArea.js +1 -1
- package/es6/components/TextArea/stories/CustomThemed/Themed.js +1 -0
- package/es6/components/TextInput/TextInput.js +1 -1
- package/es6/components/TextInput/stories/Simple.js +2 -7
- package/es6/components/TextInput/stories/WithTags.js +1 -1
- package/es6/components/ThumbsRating/ThumbsRating.js +20 -5
- package/es6/components/ToggleGroup/StyledToggleGroup.js +8 -0
- package/es6/components/ToggleGroup/ToggleGroup.js +3 -3
- package/es6/components/Toolbar/Toolbar.js +1 -1
- package/es6/components/Video/Video.js +1 -1
- package/es6/components/WorldMap/WorldMap.js +1 -1
- package/es6/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
- package/es6/languages/default.json +4 -0
- package/es6/themes/base.d.ts +52 -5
- package/es6/themes/base.js +47 -14
- package/es6/utils/pagination.js +1 -1
- package/es6/utils/responsive.js +1 -0
- package/es6/utils/styles.js +49 -14
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +4 -0
- package/package.json +28 -28
- package/themes/base.d.ts +52 -5
- package/themes/base.js +47 -14
- package/tools/release-stable.js +1 -1
- package/utils/pagination.js +1 -1
- package/utils/responsive.js +1 -0
- package/utils/styles.js +49 -14
- package/components/Form/stories/FieldWithComponentProp.js +0 -138
- package/es6/components/Form/stories/FieldWithComponentProp.js +0 -133
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StatusGood } from "grommet-icons/es6/icons/StatusGood";
|
|
3
|
-
import { Box, Button, Form, FormField, Heading } from 'grommet';
|
|
3
|
+
import { Box, Button, Form, FormField, Heading, TextInput } from 'grommet';
|
|
4
4
|
export var TriggerValidationUsingFormField = function TriggerValidationUsingFormField() {
|
|
5
5
|
return /*#__PURE__*/React.createElement(Box, {
|
|
6
6
|
fill: true,
|
|
@@ -22,7 +22,7 @@ export var TriggerValidationUsingFormField = function TriggerValidationUsingForm
|
|
|
22
22
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
23
23
|
label: "Blur",
|
|
24
24
|
name: "blur",
|
|
25
|
-
|
|
25
|
+
htmlFor: "blur",
|
|
26
26
|
required: true,
|
|
27
27
|
validate: [{
|
|
28
28
|
regexp: /^[a-z]/i
|
|
@@ -39,11 +39,15 @@ export var TriggerValidationUsingFormField = function TriggerValidationUsingForm
|
|
|
39
39
|
return undefined;
|
|
40
40
|
}],
|
|
41
41
|
validateOn: "blur"
|
|
42
|
-
}
|
|
42
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
43
|
+
id: "blur",
|
|
44
|
+
"aria-required": true,
|
|
45
|
+
name: "blur"
|
|
46
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
43
47
|
label: "Submit",
|
|
44
48
|
name: "submit",
|
|
45
|
-
"aria-label": "submit",
|
|
46
49
|
required: true,
|
|
50
|
+
htmlFor: "submit",
|
|
47
51
|
validate: [{
|
|
48
52
|
regexp: /^[a-z]/i
|
|
49
53
|
}, function (name) {
|
|
@@ -59,10 +63,14 @@ export var TriggerValidationUsingFormField = function TriggerValidationUsingForm
|
|
|
59
63
|
return undefined;
|
|
60
64
|
}],
|
|
61
65
|
validateOn: "submit"
|
|
62
|
-
}
|
|
66
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
67
|
+
id: "submit",
|
|
68
|
+
"aria-required": true,
|
|
69
|
+
name: "submit"
|
|
70
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
63
71
|
label: "Change",
|
|
64
72
|
name: "change",
|
|
65
|
-
|
|
73
|
+
htmlFor: "change",
|
|
66
74
|
required: true,
|
|
67
75
|
validate: [{
|
|
68
76
|
regexp: /^[a-z]/i
|
|
@@ -79,7 +87,11 @@ export var TriggerValidationUsingFormField = function TriggerValidationUsingForm
|
|
|
79
87
|
return undefined;
|
|
80
88
|
}],
|
|
81
89
|
validateOn: "change"
|
|
82
|
-
}
|
|
90
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
91
|
+
id: "change",
|
|
92
|
+
"aria-required": true,
|
|
93
|
+
name: "change"
|
|
94
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
83
95
|
direction: "row",
|
|
84
96
|
justify: "between",
|
|
85
97
|
margin: {
|
|
@@ -33,6 +33,7 @@ export var Uncontrolled = function Uncontrolled() {
|
|
|
33
33
|
name: "email",
|
|
34
34
|
required: true
|
|
35
35
|
}, /*#__PURE__*/React.createElement(MaskedInput, {
|
|
36
|
+
"aria-required": true,
|
|
36
37
|
id: "email",
|
|
37
38
|
name: "email",
|
|
38
39
|
mask: [{
|
|
@@ -50,13 +51,17 @@ export var Uncontrolled = function Uncontrolled() {
|
|
|
50
51
|
placeholder: 'com'
|
|
51
52
|
}]
|
|
52
53
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
54
|
+
htmlFor: "subscribe",
|
|
53
55
|
name: "subscribe"
|
|
54
56
|
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
57
|
+
id: "subscribe",
|
|
55
58
|
name: "subscribe",
|
|
56
59
|
label: "Subscribe?"
|
|
57
60
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
61
|
+
htmlFor: "ampm",
|
|
58
62
|
name: "ampm"
|
|
59
63
|
}, /*#__PURE__*/React.createElement(RadioButtonGroup, {
|
|
64
|
+
id: "ampm",
|
|
60
65
|
name: "ampm",
|
|
61
66
|
options: ['morning', 'evening']
|
|
62
67
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -65,7 +70,6 @@ export var Uncontrolled = function Uncontrolled() {
|
|
|
65
70
|
name: "size"
|
|
66
71
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
67
72
|
id: "size",
|
|
68
|
-
"aria-label": "size",
|
|
69
73
|
name: "size",
|
|
70
74
|
options: ['small', 'medium', 'large']
|
|
71
75
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
@@ -91,6 +95,7 @@ export var Uncontrolled = function Uncontrolled() {
|
|
|
91
95
|
htmlFor: "image",
|
|
92
96
|
name: "image"
|
|
93
97
|
}, /*#__PURE__*/React.createElement(FileInput, {
|
|
98
|
+
"aria-required": true,
|
|
94
99
|
id: "image",
|
|
95
100
|
name: "image"
|
|
96
101
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
@@ -23,8 +23,8 @@ export var ValidateOnBlur = function ValidateOnBlur() {
|
|
|
23
23
|
}
|
|
24
24
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
25
25
|
label: "Name",
|
|
26
|
-
"aria-label": "name",
|
|
27
26
|
name: "name",
|
|
27
|
+
htmlFor: "name",
|
|
28
28
|
required: true,
|
|
29
29
|
validate: [{
|
|
30
30
|
regexp: /^[a-z]/i
|
|
@@ -40,13 +40,19 @@ export var ValidateOnBlur = function ValidateOnBlur() {
|
|
|
40
40
|
};
|
|
41
41
|
return undefined;
|
|
42
42
|
}]
|
|
43
|
-
}
|
|
43
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
44
|
+
id: "name",
|
|
45
|
+
"aria-required": true,
|
|
46
|
+
name: "name"
|
|
47
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
48
|
+
htmlFor: "email",
|
|
44
49
|
label: "Email",
|
|
45
50
|
name: "email",
|
|
46
51
|
required: true
|
|
47
52
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
53
|
+
"aria-required": true,
|
|
48
54
|
name: "email",
|
|
49
|
-
|
|
55
|
+
id: "email",
|
|
50
56
|
type: "email"
|
|
51
57
|
})), /*#__PURE__*/React.createElement(FormField, {
|
|
52
58
|
label: "Size",
|
|
@@ -64,6 +70,7 @@ export var ValidateOnBlur = function ValidateOnBlur() {
|
|
|
64
70
|
}
|
|
65
71
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
66
72
|
name: "select-size",
|
|
73
|
+
"aria-required": true,
|
|
67
74
|
id: "select-size",
|
|
68
75
|
options: ['small', 'medium', 'large']
|
|
69
76
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Box, Button, Form, FormField, Select } from 'grommet';
|
|
2
|
+
import { Box, Button, Form, FormField, TextInput, Select } from 'grommet';
|
|
3
3
|
export var ValidateOnChange = function ValidateOnChange() {
|
|
4
4
|
var _useState = useState(false),
|
|
5
5
|
valid = _useState[0],
|
|
@@ -30,7 +30,6 @@ export var ValidateOnChange = function ValidateOnChange() {
|
|
|
30
30
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
31
31
|
label: "First Name",
|
|
32
32
|
htmlFor: "firstName",
|
|
33
|
-
id: "firstName",
|
|
34
33
|
name: "firstName",
|
|
35
34
|
required: true,
|
|
36
35
|
validate: [{
|
|
@@ -39,10 +38,13 @@ export var ValidateOnChange = function ValidateOnChange() {
|
|
|
39
38
|
if (firstName && firstName.length === 1) return 'must be >1 character';
|
|
40
39
|
return undefined;
|
|
41
40
|
}]
|
|
42
|
-
}
|
|
41
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
42
|
+
"aria-required": true,
|
|
43
|
+
id: "firstName",
|
|
44
|
+
name: "firstName"
|
|
45
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
43
46
|
label: "Last Name",
|
|
44
47
|
htmlFor: "lastName",
|
|
45
|
-
id: "lastName",
|
|
46
48
|
name: "lastName",
|
|
47
49
|
required: true,
|
|
48
50
|
validate: [{
|
|
@@ -51,7 +53,11 @@ export var ValidateOnChange = function ValidateOnChange() {
|
|
|
51
53
|
if (lastName && lastName.length === 1) return 'must be >1 character';
|
|
52
54
|
return undefined;
|
|
53
55
|
}]
|
|
54
|
-
}
|
|
56
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
57
|
+
"aria-required": true,
|
|
58
|
+
id: "lastName",
|
|
59
|
+
name: "lastName"
|
|
60
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
55
61
|
label: "Size",
|
|
56
62
|
name: "select-size",
|
|
57
63
|
htmlFor: "select-size",
|
|
@@ -68,8 +74,8 @@ export var ValidateOnChange = function ValidateOnChange() {
|
|
|
68
74
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
69
75
|
name: "select-size",
|
|
70
76
|
htmlFor: "select-size",
|
|
77
|
+
"aria-required": true,
|
|
71
78
|
id: "select-size",
|
|
72
|
-
"aria-label": "select-size",
|
|
73
79
|
options: ['small', 'medium', 'large']
|
|
74
80
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
75
81
|
direction: "row",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { Box, Button, Form, FormField } from 'grommet';
|
|
3
|
+
import { TextInput } from '../../TextInput';
|
|
3
4
|
export var ValidateOnMount = function ValidateOnMount() {
|
|
4
5
|
var defaultValue = {
|
|
5
6
|
firstName: 'J',
|
|
@@ -39,7 +40,6 @@ export var ValidateOnMount = function ValidateOnMount() {
|
|
|
39
40
|
}, /*#__PURE__*/React.createElement(FormField, {
|
|
40
41
|
label: "First Name",
|
|
41
42
|
htmlFor: "firstName",
|
|
42
|
-
id: "firstName",
|
|
43
43
|
name: "firstName",
|
|
44
44
|
required: true,
|
|
45
45
|
validate: [{
|
|
@@ -48,10 +48,13 @@ export var ValidateOnMount = function ValidateOnMount() {
|
|
|
48
48
|
if (firstName && firstName.length === 1) return 'must be >1 character';
|
|
49
49
|
return undefined;
|
|
50
50
|
}]
|
|
51
|
-
}
|
|
51
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
52
|
+
"aria-required": true,
|
|
53
|
+
id: "firstName",
|
|
54
|
+
name: "firstName"
|
|
55
|
+
})), /*#__PURE__*/React.createElement(FormField, {
|
|
52
56
|
label: "Last Name",
|
|
53
57
|
htmlFor: "lastName",
|
|
54
|
-
id: "lastName",
|
|
55
58
|
name: "lastName",
|
|
56
59
|
required: true,
|
|
57
60
|
validate: [{
|
|
@@ -60,7 +63,11 @@ export var ValidateOnMount = function ValidateOnMount() {
|
|
|
60
63
|
if (lastName && lastName.length === 1) return 'must be >1 character';
|
|
61
64
|
return undefined;
|
|
62
65
|
}]
|
|
63
|
-
}
|
|
66
|
+
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
67
|
+
"aria-required": true,
|
|
68
|
+
id: "lastName",
|
|
69
|
+
name: "lastName"
|
|
70
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
64
71
|
direction: "row",
|
|
65
72
|
justify: "between",
|
|
66
73
|
margin: {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
RangeInput,
|
|
11
11
|
Select,
|
|
12
12
|
TextArea,
|
|
13
|
+
TextInput,
|
|
13
14
|
} from 'grommet';
|
|
14
15
|
import { useState } from 'react';
|
|
15
16
|
|
|
@@ -51,66 +52,59 @@ export const TypedForm = () => {
|
|
|
51
52
|
<FormField
|
|
52
53
|
label="Name"
|
|
53
54
|
htmlFor="name"
|
|
54
|
-
id="name"
|
|
55
55
|
name="name"
|
|
56
56
|
required
|
|
57
57
|
validate={{ regexp: /^[a-z]/i }}
|
|
58
|
-
|
|
58
|
+
>
|
|
59
|
+
<TextInput aria-required name="name" id="name" type="name" />
|
|
60
|
+
</FormField>
|
|
59
61
|
<FormField
|
|
60
62
|
label="Email"
|
|
61
63
|
htmlFor="email"
|
|
62
|
-
id="email"
|
|
63
64
|
name="email"
|
|
64
65
|
type="email"
|
|
65
66
|
required
|
|
66
|
-
|
|
67
|
+
>
|
|
68
|
+
<TextInput aria-required name="email" type="email" id="email" />
|
|
69
|
+
</FormField>
|
|
67
70
|
<FormField
|
|
68
71
|
label="Employee ID"
|
|
69
72
|
htmlFor="employeeId"
|
|
70
|
-
id="employeeId"
|
|
71
73
|
name="employeeId"
|
|
72
74
|
required
|
|
73
75
|
validate={{ regexp: /^[0-9]{4,6}$/, message: '4-6 digits' }}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
name="comments"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
htmlFor="age"
|
|
107
|
-
id="age"
|
|
108
|
-
name="age"
|
|
109
|
-
component={RangeInput}
|
|
110
|
-
pad
|
|
111
|
-
min={15}
|
|
112
|
-
max={75}
|
|
113
|
-
/>
|
|
76
|
+
>
|
|
77
|
+
<TextInput
|
|
78
|
+
aria-required
|
|
79
|
+
id="employeeId"
|
|
80
|
+
name="employeeId"
|
|
81
|
+
type="employeeId"
|
|
82
|
+
/>
|
|
83
|
+
</FormField>
|
|
84
|
+
<FormField name="subscribe" pad>
|
|
85
|
+
<CheckBox label="Subscribe?" name="subscribe" id="subscribe" />
|
|
86
|
+
</FormField>
|
|
87
|
+
<FormField name="ampm" pad options={['morning', 'evening']}>
|
|
88
|
+
<RadioButtonGroup
|
|
89
|
+
name="ampm"
|
|
90
|
+
id="ampm"
|
|
91
|
+
options={['morning', 'evening']}
|
|
92
|
+
/>
|
|
93
|
+
</FormField>
|
|
94
|
+
<FormField label="Size" htmlFor="size" name="size">
|
|
95
|
+
<Select
|
|
96
|
+
id="size"
|
|
97
|
+
name="size"
|
|
98
|
+
onChange={(event) => console.log(event)}
|
|
99
|
+
options={['small', 'medium', 'large', 'xlarge']}
|
|
100
|
+
/>
|
|
101
|
+
</FormField>
|
|
102
|
+
<FormField label="Comments" htmlFor="comments" name="comments">
|
|
103
|
+
<TextArea name="comments" id="comments" />
|
|
104
|
+
</FormField>
|
|
105
|
+
<FormField label="Age" htmlFor="age" name="age" pad>
|
|
106
|
+
<RangeInput name="age" id="age" type="age" min={15} max={75} />
|
|
107
|
+
</FormField>
|
|
114
108
|
<Box direction="row" justify="between" margin={{ top: 'medium' }}>
|
|
115
109
|
<Button label="Cancel" />
|
|
116
110
|
<Button type="reset" label="Reset" />
|
|
@@ -2,7 +2,7 @@ var _excluded = ["error", "info", "message", "type"],
|
|
|
2
2
|
_excluded2 = ["component", "disabled", "invalid", "name", "onChange"],
|
|
3
3
|
_excluded3 = ["children", "className", "component", "contentProps", "disabled", "error", "help", "htmlFor", "info", "label", "margin", "name", "onBlur", "onChange", "onFocus", "pad", "required", "style", "validate", "validateOn"];
|
|
4
4
|
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); }
|
|
5
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
5
|
+
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; }
|
|
6
6
|
import React, { Children, cloneElement, forwardRef, useContext, useEffect, useMemo, useState } from 'react';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { containsFocus, shouldKeepFocus, withinDropPortal, PortalContext } from '../../utils';
|
|
@@ -20,42 +20,59 @@ import { FormContext } from '../Form/FormContext';
|
|
|
20
20
|
import { FormFieldPropTypes } from './propTypes';
|
|
21
21
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
22
22
|
import { AnnounceContext } from '../../contexts/AnnounceContext';
|
|
23
|
+
var grommetInputFocusNames = ['CheckBox', 'CheckBoxGroup', 'RadioButton', 'RadioButtonGroup', 'RangeInput', 'RangeSelector', 'StarRating', 'ThumbsRating'];
|
|
23
24
|
var grommetInputNames = ['CheckBox', 'CheckBoxGroup', 'TextInput', 'Select', 'MaskedInput', 'SelectMultiple', 'TextArea', 'DateInput', 'FileInput', 'RadioButton', 'RadioButtonGroup', 'RangeInput', 'RangeSelector', 'StarRating', 'ThumbsRating'];
|
|
24
25
|
var grommetInputPadNames = ['CheckBox', 'CheckBoxGroup', 'RadioButton', 'RadioButtonGroup', 'RangeInput', 'RangeSelector'];
|
|
25
26
|
var isGrommetInput = function isGrommetInput(comp) {
|
|
26
27
|
return comp && (grommetInputNames.indexOf(comp.displayName) !== -1 || grommetInputPadNames.indexOf(comp.displayName) !== -1);
|
|
27
28
|
};
|
|
29
|
+
var getFocusStyle = function getFocusStyle(props) {
|
|
30
|
+
var _props$theme$formFiel;
|
|
31
|
+
if (props.focus && props.containerFocus === false && ((_props$theme$formFiel = props.theme.formField) == null || (_props$theme$formFiel = _props$theme$formFiel.focus) == null ? void 0 : _props$theme$formFiel.containerFocus) === false) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return props.focus ? focusStyle({
|
|
35
|
+
justBorder: true
|
|
36
|
+
}) : undefined;
|
|
37
|
+
};
|
|
28
38
|
var FormFieldBox = styled(Box).withConfig({
|
|
29
39
|
displayName: "FormField__FormFieldBox",
|
|
30
40
|
componentId: "sc-m9hood-0"
|
|
31
41
|
})(["", " ", ""], function (props) {
|
|
32
|
-
return props
|
|
33
|
-
justBorder: true
|
|
34
|
-
});
|
|
42
|
+
return getFocusStyle(props);
|
|
35
43
|
}, function (props) {
|
|
36
|
-
|
|
44
|
+
var _props$theme$formFiel2;
|
|
45
|
+
return (_props$theme$formFiel2 = props.theme.formField) == null ? void 0 : _props$theme$formFiel2.extend;
|
|
37
46
|
});
|
|
38
47
|
var FormFieldContentBox = styled(Box).withConfig({
|
|
39
48
|
displayName: "FormField__FormFieldContentBox",
|
|
40
49
|
componentId: "sc-m9hood-1"
|
|
50
|
+
})(["", " ", ""], function (props) {
|
|
51
|
+
return getFocusStyle(props);
|
|
52
|
+
}, function (props) {
|
|
53
|
+
var _props$theme$formFiel3;
|
|
54
|
+
return props.theme.formField && ((_props$theme$formFiel3 = props.theme.formField[props == null ? void 0 : props.componentName]) == null || (_props$theme$formFiel3 = _props$theme$formFiel3.container) == null ? void 0 : _props$theme$formFiel3.extend);
|
|
55
|
+
});
|
|
56
|
+
var StyledContentsBox = styled(Box).withConfig({
|
|
57
|
+
displayName: "FormField__StyledContentsBox",
|
|
58
|
+
componentId: "sc-m9hood-2"
|
|
41
59
|
})(["", ""], function (props) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
60
|
+
var _props$theme$formFiel4;
|
|
61
|
+
return props.theme.formField && ((_props$theme$formFiel4 = props.theme.formField[props == null ? void 0 : props.componentName]) == null || (_props$theme$formFiel4 = _props$theme$formFiel4.container) == null ? void 0 : _props$theme$formFiel4.extend);
|
|
45
62
|
});
|
|
46
63
|
var StyledMessageContainer = styled(Box).withConfig({
|
|
47
64
|
displayName: "FormField__StyledMessageContainer",
|
|
48
|
-
componentId: "sc-m9hood-
|
|
65
|
+
componentId: "sc-m9hood-3"
|
|
49
66
|
})(["", ""], function (props) {
|
|
50
67
|
return props.messageType && props.theme.formField[props.messageType].container && props.theme.formField[props.messageType].container.extend;
|
|
51
68
|
});
|
|
52
69
|
var RequiredText = styled(Text).withConfig({
|
|
53
70
|
displayName: "FormField__RequiredText",
|
|
54
|
-
componentId: "sc-m9hood-
|
|
71
|
+
componentId: "sc-m9hood-4"
|
|
55
72
|
})(["color:inherit;font-weight:inherit;line-height:inherit;"]);
|
|
56
73
|
var ScreenReaderOnly = styled(Text).withConfig({
|
|
57
74
|
displayName: "FormField__ScreenReaderOnly",
|
|
58
|
-
componentId: "sc-m9hood-
|
|
75
|
+
componentId: "sc-m9hood-5"
|
|
59
76
|
})(["position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0;"]);
|
|
60
77
|
var Message = function Message(_ref) {
|
|
61
78
|
var error = _ref.error,
|
|
@@ -122,7 +139,7 @@ var Input = function Input(_ref2) {
|
|
|
122
139
|
}, rest, extraProps));
|
|
123
140
|
};
|
|
124
141
|
var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
125
|
-
var _theme$global$input;
|
|
142
|
+
var _theme$formField2, _theme$global$input, _formFieldTheme$disab, _formFieldTheme$disab2;
|
|
126
143
|
var children = _ref3.children,
|
|
127
144
|
className = _ref3.className,
|
|
128
145
|
component = _ref3.component,
|
|
@@ -189,6 +206,16 @@ var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
189
206
|
}
|
|
190
207
|
return readOnly;
|
|
191
208
|
}, [children]);
|
|
209
|
+
var containerFocus = useMemo(function () {
|
|
210
|
+
var focusIndicatorFlag = true;
|
|
211
|
+
Children.forEach(children, function (child) {
|
|
212
|
+
var _theme$formField;
|
|
213
|
+
if (child && child.type && grommetInputFocusNames.includes(child.type.displayName) && ((_theme$formField = theme.formField) == null || (_theme$formField = _theme$formField.focus) == null ? void 0 : _theme$formField.containerFocus) !== true) {
|
|
214
|
+
focusIndicatorFlag = false;
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
return focusIndicatorFlag;
|
|
218
|
+
}, [children, (_theme$formField2 = theme.formField) == null || (_theme$formField2 = _theme$formField2.focus) == null ? void 0 : _theme$formField2.containerFocus]);
|
|
192
219
|
|
|
193
220
|
// This is here for backwards compatibility. In case the child is a grommet
|
|
194
221
|
// input component, set plain and focusIndicator props, if they aren't
|
|
@@ -198,11 +225,12 @@ var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
198
225
|
if (child && child.type && grommetInputPadNames.indexOf(child.type.displayName) !== -1) {
|
|
199
226
|
wantContentPad = true;
|
|
200
227
|
}
|
|
201
|
-
|
|
228
|
+
var isInputComponent = child && child.type && grommetInputNames.indexOf(child.type.displayName) !== -1;
|
|
229
|
+
if (isInputComponent && child.props.plain === undefined && child.props.focusIndicator === undefined) {
|
|
202
230
|
var _formFieldTheme$check;
|
|
203
231
|
return /*#__PURE__*/cloneElement(child, {
|
|
204
232
|
plain: true,
|
|
205
|
-
focusIndicator:
|
|
233
|
+
focusIndicator: !containerFocus,
|
|
206
234
|
pad: 'CheckBox'.indexOf(child.type.displayName) !== -1 ? formFieldTheme == null || (_formFieldTheme$check = formFieldTheme.checkBox) == null ? void 0 : _formFieldTheme$check.pad : undefined
|
|
207
235
|
});
|
|
208
236
|
}
|
|
@@ -245,8 +273,21 @@ var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
245
273
|
if (component && component.displayName === 'FileInput' && !isFileInputComponent) {
|
|
246
274
|
isFileInputComponent = true;
|
|
247
275
|
}
|
|
276
|
+
var childName;
|
|
277
|
+
Children.forEach(children, function (child) {
|
|
278
|
+
if (child && child.type) {
|
|
279
|
+
var _childName;
|
|
280
|
+
childName = child.type.displayName;
|
|
281
|
+
// camelCase component name to match theme object key
|
|
282
|
+
if (((_childName = childName) == null ? void 0 : _childName.length) > 0) childName = childName.charAt(0).toLowerCase() + childName.slice(1);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
248
285
|
if (!themeBorder) {
|
|
249
|
-
contents = /*#__PURE__*/React.createElement(
|
|
286
|
+
contents = /*#__PURE__*/React.createElement(StyledContentsBox, _extends({
|
|
287
|
+
disabledProp: disabled,
|
|
288
|
+
error: error,
|
|
289
|
+
componentName: childName
|
|
290
|
+
}, themeContentProps, contentProps), contents);
|
|
250
291
|
}
|
|
251
292
|
var borderColor;
|
|
252
293
|
if (disabled && formFieldTheme.disabled.border && formFieldTheme.disabled.border.color) {
|
|
@@ -274,6 +315,12 @@ var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
274
315
|
if (disabled) {
|
|
275
316
|
labelStyle.color = formFieldTheme.disabled && formFieldTheme.disabled.label ? formFieldTheme.disabled.label.color : labelStyle.color;
|
|
276
317
|
}
|
|
318
|
+
var themeHelpProps = _extends({}, formFieldTheme.help, disabled && {
|
|
319
|
+
color: formFieldTheme == null || (_formFieldTheme$disab = formFieldTheme.disabled) == null || (_formFieldTheme$disab = _formFieldTheme$disab.help) == null ? void 0 : _formFieldTheme$disab.color
|
|
320
|
+
});
|
|
321
|
+
var themeInfoProps = _extends({}, formFieldTheme.info, disabled && {
|
|
322
|
+
color: formFieldTheme == null || (_formFieldTheme$disab2 = formFieldTheme.disabled) == null || (_formFieldTheme$disab2 = _formFieldTheme$disab2.info) == null ? void 0 : _formFieldTheme$disab2.color
|
|
323
|
+
});
|
|
277
324
|
var abut;
|
|
278
325
|
var abutMargin;
|
|
279
326
|
var outerStyle = style;
|
|
@@ -294,7 +341,13 @@ var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
294
341
|
round: formFieldTheme.round,
|
|
295
342
|
focus: isFileInputComponent ? undefined : focus
|
|
296
343
|
} : {};
|
|
297
|
-
contents = /*#__PURE__*/React.createElement(FormFieldContentBox, _extends({
|
|
344
|
+
contents = /*#__PURE__*/React.createElement(FormFieldContentBox, _extends({
|
|
345
|
+
disabledProp: disabled,
|
|
346
|
+
error: error,
|
|
347
|
+
componentName: childName
|
|
348
|
+
}, themeContentProps, innerProps, contentProps, {
|
|
349
|
+
containerFocus: containerFocus // internal prop
|
|
350
|
+
}, passThemeFlag), contents);
|
|
298
351
|
var mergedMargin = margin || formFieldTheme.margin;
|
|
299
352
|
abut = themeBorder.position === 'outer' && (themeBorder.side === 'all' || themeBorder.side === 'horizontal' || !themeBorder.side) && !(mergedMargin && (typeof mergedMargin === 'string' && mergedMargin !== 'none' || mergedMargin.bottom && mergedMargin.bottom !== 'none' || mergedMargin.horizontal && mergedMargin.horizontal !== 'none'));
|
|
300
353
|
if (abut) {
|
|
@@ -353,6 +406,8 @@ var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
353
406
|
margin: abut ? abutMargin : margin || _extends({}, formFieldTheme.margin)
|
|
354
407
|
}, outerProps, {
|
|
355
408
|
style: outerStyle,
|
|
409
|
+
containerFocus: containerFocus // internal prop
|
|
410
|
+
,
|
|
356
411
|
onFocus: function onFocus(event) {
|
|
357
412
|
var _formFieldRef$current;
|
|
358
413
|
var root = (_formFieldRef$current = formFieldRef.current) == null ? void 0 : _formFieldRef$current.getRootNode();
|
|
@@ -386,13 +441,13 @@ var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
386
441
|
htmlFor: htmlFor
|
|
387
442
|
}, labelStyle), label, showRequiredIndicator ? requiredIndicator : undefined), /*#__PURE__*/React.createElement(Message, _extends({
|
|
388
443
|
message: help
|
|
389
|
-
},
|
|
444
|
+
}, themeHelpProps))) : undefined, contents, /*#__PURE__*/React.createElement(Message, _extends({
|
|
390
445
|
type: "error",
|
|
391
446
|
message: error
|
|
392
447
|
}, formFieldTheme.error)), /*#__PURE__*/React.createElement(Message, _extends({
|
|
393
448
|
type: "info",
|
|
394
449
|
message: info
|
|
395
|
-
},
|
|
450
|
+
}, themeInfoProps)));
|
|
396
451
|
});
|
|
397
452
|
FormField.displayName = 'FormField';
|
|
398
453
|
FormField.propTypes = FormFieldPropTypes;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["a11yTitle", "aria-label", "border", "fill", "height", "responsive", "rows", "tag", "as", "width"];
|
|
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
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
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
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import { StyledGrid } from './StyledGrid';
|
|
6
6
|
import { GridPropTypes } from './propTypes';
|
|
@@ -10,8 +10,11 @@ export var GridAreasAlternative = function GridAreasAlternative() {
|
|
|
10
10
|
columns: ['1/4', '3/4'],
|
|
11
11
|
areas: [['header', 'header'], ['sidebar', 'main'], ['footer', 'footer']],
|
|
12
12
|
gap: "small"
|
|
13
|
+
// needed for keyboard accessibility of scroll region
|
|
14
|
+
,
|
|
15
|
+
tabIndex: 0
|
|
13
16
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
14
|
-
background: "
|
|
17
|
+
background: "dark-1",
|
|
15
18
|
gridArea: "header"
|
|
16
19
|
}, "Header"), /*#__PURE__*/React.createElement(Box, {
|
|
17
20
|
background: "light-5",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["children", "overrideColumns", "overrideRows", "areas"];
|
|
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
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
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
4
|
import React from 'react';
|
|
5
5
|
import { Grommet, Box, Grid, Heading, ResponsiveContext } from 'grommet';
|
|
6
6
|
import { grommet } from 'grommet/themes';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["children", "full", "containerTarget", "theme", "options", "messages", "onAnalytics"];
|
|
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
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
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
4
|
import React, { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { createGlobalStyle } from 'styled-components';
|
|
6
6
|
import { ContainerTargetContext, ResponsiveContext, ThemeContext } from '../../contexts';
|
|
@@ -43,6 +43,10 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
43
43
|
enterCalendar: PropTypes.string,
|
|
44
44
|
exitCalendar: PropTypes.string
|
|
45
45
|
}),
|
|
46
|
+
dataChart: PropTypes.shape({
|
|
47
|
+
detailTitle: PropTypes.string,
|
|
48
|
+
detailFocus: PropTypes.string
|
|
49
|
+
}),
|
|
46
50
|
dataFilters: PropTypes.shape({
|
|
47
51
|
clear: PropTypes.string,
|
|
48
52
|
heading: PropTypes.string,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["sticky"];
|
|
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
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
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
4
|
import React, { useEffect } from 'react';
|
|
5
5
|
import { findScrollParent, useForwardedRef } from '../../utils';
|
|
6
6
|
import { Box } from '../Box';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["children", "color", "fill", "level", "overflowWrap", "responsive", "weight"];
|
|
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
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
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
4
|
import React, { forwardRef, useState } from 'react';
|
|
5
5
|
import { useLayoutEffect } from '../../utils/use-isomorphic-layout-effect';
|
|
6
6
|
import { StyledHeading } from './StyledHeading';
|