grommet 2.58.0 → 2.59.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 +2 -1
- package/components/Accordion/Accordion.js +2 -1
- package/components/Accordion/stories/CustomHeader.stories.js +2 -1
- package/components/AccordionPanel/AccordionPanel.js +2 -1
- package/components/Anchor/Anchor.js +2 -1
- package/components/Anchor/StyledAnchor.js +2 -1
- package/components/Avatar/Avatar.js +2 -1
- package/components/Box/Box.js +2 -1
- package/components/Box/ResponsiveContainerProvider.js +2 -1
- package/components/Box/StyledBox.js +2 -1
- package/components/Box/stories/ResponsiveContainer.stories.js +2 -1
- package/components/Button/Badge.js +2 -1
- package/components/Button/BusyAnimation.js +2 -1
- package/components/Button/Button.js +2 -1
- package/components/Button/StyledButton.js +2 -1
- package/components/Button/StyledButtonKind.js +2 -1
- package/components/Button/stories/Busy.stories.js +2 -1
- package/components/Calendar/Calendar.js +2 -1
- package/components/Calendar/StyledCalendar.js +2 -1
- package/components/Calendar/stories/ActiveDate.stories.js +2 -1
- package/components/Calendar/stories/CustomDay.stories.js +2 -1
- package/components/Calendar/stories/CustomHeader.stories.js +2 -1
- package/components/Calendar/stories/CustomThemed/CustomSizeHeading.stories.js +2 -1
- package/components/Calendar/stories/Dual.stories.js +2 -1
- package/components/Calendar/stories/HeaderLevel.stories.js +2 -1
- package/components/Calendar/stories/Multiple.stories.js +2 -1
- package/components/Calendar/stories/ShowAdjacentDays.stories.js +2 -1
- package/components/Calendar/stories/Simple.stories.js +2 -1
- package/components/Card/Card.js +2 -1
- package/components/Cards/Cards.js +2 -1
- package/components/Cards/index.d.ts +2 -16
- package/components/Carousel/Carousel.js +2 -1
- package/components/Carousel/CarouselChild.js +2 -1
- package/components/Carousel/StyledCarousel.js +2 -1
- package/components/Chart/Chart.js +2 -1
- package/components/Chart/StyledChart.js +2 -1
- package/components/Chart/stories/Rich.stories.js +2 -1
- package/components/Chart/stories/Scan.stories.js +2 -1
- package/components/Chart/stories/Window.stories.js +2 -1
- package/components/Chart/stories/Zoom.stories.js +2 -1
- package/components/CheckBox/CheckBox.js +2 -1
- package/components/CheckBox/README.md +95 -0
- package/components/CheckBox/StyledCheckBox.js +104 -16
- package/components/CheckBox/stories/CustomThemed/Appearance.stories.tsx +160 -0
- package/components/CheckBox/stories/CustomThemed/Custom.stories.js +2 -1
- package/components/CheckBox/stories/CustomThemed/CustomToggle.stories.js +2 -1
- package/components/CheckBox/stories/Indeterminate.stories.js +2 -1
- package/components/CheckBox/stories/NoLabel.stories.js +2 -1
- package/components/CheckBox/stories/Simple.stories.js +2 -1
- package/components/CheckBox/stories/WithStickyDiv.stories.js +2 -1
- package/components/CheckBoxGroup/CheckBoxGroup.js +2 -1
- package/components/CheckBoxGroup/stories/Children.stories.js +2 -1
- package/components/CheckBoxGroup/stories/InitialValues.stories.js +2 -1
- package/components/Clock/Analog.js +2 -1
- package/components/Clock/Clock.js +2 -1
- package/components/Clock/Digital.js +2 -1
- package/components/Clock/StyledClock.js +2 -1
- package/components/Collapsible/Collapsible.js +2 -1
- package/components/Data/Data.js +2 -1
- package/components/Data/DataForm.js +2 -1
- package/components/Data/stories/Infinite.stories.js +2 -1
- package/components/Data/stories/Inline.stories.js +2 -1
- package/components/Data/stories/OnSelect.stories.js +2 -1
- package/components/Data/stories/SpaceX.stories.js +2 -1
- package/components/Data/stories/StarWars.stories.js +2 -1
- package/components/DataChart/DataChart.js +2 -1
- package/components/DataChart/Detail.js +2 -1
- package/components/DataChart/Legend.js +2 -1
- package/components/DataChart/XAxis.js +2 -1
- package/components/DataChart/XGuide.js +2 -1
- package/components/DataChart/YAxis.js +2 -1
- package/components/DataChart/YGuide.js +2 -1
- package/components/DataChart/stories/Prediction.stories.js +2 -1
- package/components/DataClearFilters/DataClearFilters.js +2 -1
- package/components/DataClearFilters/stories/Simple.stories.js +2 -1
- package/components/DataFilter/DataFilter.js +2 -1
- package/components/DataFilters/DataFilters.js +2 -1
- package/components/DataSearch/DataSearch.js +2 -1
- package/components/DataSort/DataSort.js +2 -1
- package/components/DataSummary/DataSummary.js +2 -1
- package/components/DataTable/Body.js +2 -1
- package/components/DataTable/Cell.js +2 -1
- package/components/DataTable/DataTable.js +2 -1
- package/components/DataTable/ExpanderCell.js +2 -1
- package/components/DataTable/Footer.js +2 -1
- package/components/DataTable/GroupedBody.js +2 -1
- package/components/DataTable/Header.js +2 -1
- package/components/DataTable/PlaceholderBody.js +2 -1
- package/components/DataTable/Resizer.js +2 -1
- package/components/DataTable/Searcher.js +2 -1
- package/components/DataTable/StyledDataTable.js +2 -1
- package/components/DataTable/stories/ControlledGrouped.stories.js +2 -1
- package/components/DataTable/stories/OnUpdate.stories.js +2 -1
- package/components/DataTable/stories/SpaceX.stories.js +2 -1
- package/components/DataTable/stories/SpaceXUngrouped.stories.js +2 -1
- package/components/DataTable/stories/rowDetails.stories.js +2 -1
- package/components/DataTableColumns/DataTableColumns.js +2 -1
- package/components/DataTableGroupBy/DataTableGroupBy.js +2 -1
- package/components/DataView/DataView.js +2 -1
- package/components/DateInput/DateInput.js +11 -4
- package/components/DateInput/stories/FormatInline.stories.js +2 -1
- package/components/DateTimeInput/DateTimeInput.js +4 -1
- package/components/DateTimeInput/StyledDateTimeInput.js +11 -2
- package/components/Diagram/Diagram.js +2 -1
- package/components/Diagram/StyledDiagram.js +2 -1
- package/components/Diagram/stories/Animated.stories.js +2 -1
- package/components/Diagram/stories/Progressing.stories.js +2 -1
- package/components/Drop/Drop.js +2 -1
- package/components/Drop/DropContainer.js +2 -1
- package/components/Drop/StyledDrop.js +2 -1
- package/components/Drop/stories/CustomThemed/Lazy.stories.js +2 -1
- package/components/Drop/stories/CustomThemed/Themed.stories.js +2 -1
- package/components/Drop/stories/Inline.stories.js +2 -1
- package/components/Drop/stories/Meter.stories.js +2 -1
- package/components/Drop/stories/Multiple.stories.js +2 -1
- package/components/Drop/stories/Overflow.stories.js +2 -1
- package/components/Drop/stories/Plain.stories.js +2 -1
- package/components/Drop/stories/Progressive.stories.js +2 -1
- package/components/Drop/stories/Simple.stories.js +2 -1
- package/components/Drop/stories/Styled.stories.js +2 -1
- package/components/DropButton/DropButton.js +2 -1
- package/components/FileInput/FileInput.js +78 -21
- package/components/FileInput/README.md +5 -0
- package/components/FocusedContainer.js +2 -1
- package/components/Form/Form.js +2 -1
- package/components/Form/FormContext.js +2 -1
- package/components/Form/stories/ArrayOfFormFields.stories.js +2 -1
- package/components/Form/stories/Controlled.stories.js +2 -1
- package/components/Form/stories/ControlledInput.stories.js +2 -1
- package/components/Form/stories/ControlledInputLazy.stories.js +2 -1
- package/components/Form/stories/ControlledLazy.stories.js +2 -1
- package/components/Form/stories/CustomThemed/FieldBorderPosition.stories.js +2 -1
- package/components/Form/stories/CustomThemed/FieldCustomStates.stories.js +2 -1
- package/components/Form/stories/DynamicFields.stories.js +2 -1
- package/components/Form/stories/FieldStates.stories.js +2 -1
- package/components/Form/stories/SolicitedFeedback.stories.js +2 -1
- package/components/Form/stories/UnsolicitedFeedback.stories.js +2 -1
- package/components/Form/stories/ValidateOnChange.stories.js +2 -1
- package/components/Form/stories/ValidateOnMount.stories.js +2 -1
- package/components/FormField/FormField.js +207 -69
- package/components/FormField/README.md +56 -1
- package/components/FormField/stories/CustomThemed/Appearance.stories.tsx +630 -0
- package/components/FormField/stories/Simple.stories.js +2 -1
- package/components/Grid/Grid.js +2 -1
- package/components/Grid/StyledGrid.js +2 -1
- package/components/Grid/stories/ResponsiveCards.stories.js +2 -1
- package/components/Grommet/Grommet.js +2 -1
- package/components/Grommet/StyledGrommet.js +2 -1
- package/components/Grommet/index.d.ts +4 -0
- package/components/Grommet/propTypes.js +4 -1
- package/components/Header/Header.js +2 -1
- package/components/Header/stories/Sticky.stories.js +2 -1
- package/components/Heading/Heading.js +2 -1
- package/components/Heading/HeadingSkeleton.js +2 -1
- package/components/Heading/StyledHeading.js +2 -1
- package/components/Image/Image.js +2 -1
- package/components/Image/StyledImage.js +2 -1
- package/components/InfiniteScroll/InfiniteScroll.js +2 -1
- package/components/Layer/Layer.js +2 -1
- package/components/Layer/LayerContainer.js +2 -1
- package/components/Layer/StyledLayer.js +2 -1
- package/components/List/List.js +2 -1
- package/components/List/stories/Order.stories.js +2 -1
- package/components/List/stories/Pinned.stories.js +2 -1
- package/components/Markdown/Markdown.js +2 -1
- package/components/MaskedInput/MaskedInput.js +2 -1
- package/components/Menu/Menu.js +2 -1
- package/components/Meter/Bar.js +2 -1
- package/components/Meter/Circle.js +2 -1
- package/components/Meter/Meter.js +2 -1
- package/components/Meter/StyledMeter.js +2 -1
- package/components/Meter/stories/Circle.stories.js +2 -1
- package/components/Meter/stories/VerticalBarMultiple.stories.js +2 -1
- package/components/NameValueList/NameValueList.js +2 -1
- package/components/NameValuePair/NameValuePair.js +2 -1
- package/components/Nav/stories/CustomThemed/JustifySidebar.stories.js +2 -1
- package/components/Nav/stories/Sidebar.stories.js +2 -1
- package/components/Notification/Notification.js +2 -1
- package/components/Notification/stories/Global.stories.js +2 -1
- package/components/Notification/stories/Title.stories.js +2 -1
- package/components/Notification/stories/TitleAndMessage.stories.js +2 -1
- package/components/Page/Page.js +2 -1
- package/components/Page/stories/PageNotificaton.stories.js +2 -1
- package/components/PageContent/PageContent.js +2 -1
- package/components/PageHeader/PageHeader.js +2 -1
- package/components/PageHeader/stories/MultipleActions.stories.js +2 -1
- package/components/Pagination/Pagination.js +2 -1
- package/components/Pagination/PaginationStep.js +2 -1
- package/components/Pagination/PaginationSummary.js +2 -1
- package/components/Pagination/stories/Grid.stories.js +2 -1
- package/components/Paragraph/Paragraph.js +2 -1
- package/components/Paragraph/ParagraphSkeleton.js +2 -1
- package/components/Paragraph/StyledParagraph.js +2 -1
- package/components/RadioButton/README.md +93 -1
- package/components/RadioButton/RadioButton.js +13 -5
- package/components/RadioButton/StyledRadioButton.js +103 -10
- package/components/RadioButton/stories/CustomThemed/Appearance.stories.tsx +190 -0
- package/components/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/components/RadioButtonGroup/stories/Children.stories.js +2 -1
- package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.stories.js +2 -1
- package/components/RadioButtonGroup/stories/Disabled.stories.js +2 -1
- package/components/RangeInput/RangeInput.js +2 -1
- package/components/RangeInput/StyledRangeInput.js +2 -1
- package/components/RangeInput/stories/CustomThemed/Bounds.stories.js +2 -1
- package/components/RangeSelector/EdgeControl.js +2 -1
- package/components/RangeSelector/RangeSelector.js +2 -1
- package/components/RangeSelector/index.d.ts +1 -10
- package/components/RangeSelector/stories/Basic.stories.js +2 -1
- package/components/RangeSelector/stories/CustomThemed/Custom.stories.js +2 -1
- package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.stories.js +2 -1
- package/components/RangeSelector/stories/Label.stories.js +2 -1
- package/components/RangeSelector/stories/Simple.stories.js +2 -1
- package/components/RangeSelector/stories/Step.stories.js +2 -1
- package/components/RangeSelector/stories/Thin.stories.js +2 -1
- package/components/RangeSelector/stories/Vertical.stories.js +2 -1
- package/components/RoutedAnchor/RoutedAnchor.js +2 -1
- package/components/RoutedButton/RoutedButton.js +2 -1
- package/components/Select/DefaultSelectTextInput.js +2 -1
- package/components/Select/Select.js +2 -1
- package/components/Select/SelectContainer.js +2 -1
- package/components/Select/StyledSelect.js +11 -3
- package/components/Select/stories/ChildrenRender.stories.js +2 -1
- package/components/Select/stories/Clear.stories.js +2 -1
- package/components/Select/stories/Controlled.stories.js +2 -1
- package/components/Select/stories/CustomThemed/CustomSearch.stories.js +2 -1
- package/components/Select/stories/Disabled.stories.js +2 -1
- package/components/Select/stories/InsideFormField.stories.js +2 -1
- package/components/Select/stories/Multiple.stories.js +2 -1
- package/components/Select/stories/ObjectOptions.stories.js +2 -1
- package/components/Select/stories/Search.stories.js +2 -1
- package/components/Select/stories/Simple.stories.js +2 -1
- package/components/Select/stories/ValueLabel.stories.js +2 -1
- package/components/Select/stories/components/SearchBorderBox.js +2 -1
- package/components/Select/stories/components/SearchInput.js +2 -1
- package/components/Select/utils.js +2 -1
- package/components/SelectMultiple/SelectMultiple.js +10 -4
- package/components/SelectMultiple/SelectMultipleContainer.js +2 -1
- package/components/SelectMultiple/SelectMultipleValue.js +2 -1
- package/components/SelectMultiple/SelectionSummary.js +2 -1
- package/components/SelectMultiple/stories/CustomMessages.stories.js +2 -1
- package/components/SelectMultiple/stories/Default.stories.js +2 -1
- package/components/SelectMultiple/stories/Disabled.stories.js +2 -1
- package/components/SelectMultiple/stories/FormField.stories.js +2 -1
- package/components/SelectMultiple/stories/Help.stories.js +2 -1
- package/components/SelectMultiple/stories/Limited.stories.js +2 -1
- package/components/SelectMultiple/stories/ObjectOptions.stories.js +2 -1
- package/components/SelectMultiple/stories/ShowSelectedInline.stories.js +2 -1
- package/components/Skeleton/Skeleton.js +2 -1
- package/components/Skeleton/SkeletonContext.js +2 -1
- package/components/Skeleton/stories/CustomThemed/Custom.stories.js +2 -1
- package/components/Skeleton/stories/GridContainer.stories.js +2 -1
- package/components/SkipLink/SkipLink.js +2 -1
- package/components/SkipLinks/SkipLinks.js +2 -1
- package/components/Spinner/Spinner.js +2 -1
- package/components/Spinner/stories/Animation.stories.js +2 -1
- package/components/Spinner/stories/Announced.stories.js +2 -1
- package/components/Stack/Stack.js +2 -1
- package/components/Stack/StyledStack.js +2 -1
- package/components/StarRating/StarRating.js +2 -1
- package/components/Stepper/Stepper.js +138 -101
- package/components/Stepper/StepperContext.js +5 -4
- package/components/Stepper/StepperDescription.js +6 -8
- package/components/Stepper/StepperHelperText.js +13 -15
- package/components/Stepper/StepperIndicator.js +37 -34
- package/components/Stepper/StepperLabel.js +11 -23
- package/components/Stepper/StepperStep.js +139 -82
- package/components/Stepper/StyledStepper.js +168 -115
- package/components/Stepper/index.d.ts +25 -13
- package/components/Stepper/index.js +5 -1
- package/components/Stepper/propTypes.js +3 -0
- package/components/Stepper/stories/Children.stories.tsx +73 -0
- package/components/Stepper/stories/CustomThemed.stories.tsx +301 -0
- package/components/Stepper/stories/CustomThemedHpe.stories.tsx +328 -0
- package/components/Stepper/stories/DisabledSteps.stories.js +2 -1
- package/components/Stepper/stories/ErrorStates.stories.js +2 -1
- package/components/Stepper/stories/HorizontalSteps.stories.js +2 -1
- package/components/Stepper/stories/Interactive.stories.js +2 -1
- package/components/Stepper/stories/KeyboardNavigation.stories.js +2 -1
- package/components/Stepper/stories/NestedSubSteps.stories.js +2 -1
- package/components/Stepper/stories/ThemingLightDark.stories.js +2 -1
- package/components/Stepper/stories/VerticalSteps.stories.js +2 -1
- package/components/Stepper/utils.js +54 -0
- package/components/Tab/StyledTab.js +2 -1
- package/components/Tab/Tab.js +2 -1
- package/components/Table/StyledTable.js +2 -1
- package/components/Table/Table.js +2 -1
- package/components/Table/stories/InfiniteScrollInTable.stories.js +2 -1
- package/components/TableBody/TableBody.js +2 -1
- package/components/TableCell/TableCell.js +2 -1
- package/components/TableFooter/TableFooter.js +2 -1
- package/components/TableHeader/TableHeader.js +2 -1
- package/components/TableRow/TableRow.js +2 -1
- package/components/Tabs/StyledTabs.js +2 -1
- package/components/Tabs/Tabs.js +2 -1
- package/components/Tabs/stories/CustomThemed/States.stories.js +2 -1
- package/components/Tabs/stories/Responsive.stories.js +2 -1
- package/components/Tag/Tag.js +2 -1
- package/components/Text/StyledText.js +2 -1
- package/components/Text/Text.js +2 -1
- package/components/Text/TextSkeleton.js +2 -1
- package/components/TextArea/StyledTextArea.js +2 -1
- package/components/TextArea/TextArea.js +2 -1
- package/components/TextArea/stories/CustomThemed/Themed.stories.js +2 -1
- package/components/TextArea/stories/InsideFormField.stories.js +2 -1
- package/components/TextArea/stories/NonResizable.stories.js +2 -1
- package/components/TextArea/stories/Simple.stories.js +2 -1
- package/components/TextInput/CopyButton.js +2 -1
- package/components/TextInput/README.md +29 -1
- package/components/TextInput/StyledTextInput.js +20 -6
- package/components/TextInput/TextInput.js +103 -26
- package/components/TextInput/index.d.ts +2 -0
- package/components/TextInput/propTypes.js +2 -0
- package/components/TextInput/stories/Clear.stories.tsx +68 -0
- package/components/TextInput/stories/ClearFormField.stories.tsx +45 -0
- package/components/TextInput/stories/InsideFormField.stories.js +2 -1
- package/components/TimeInput/StyledTimeInput.js +28 -18
- package/components/TimeInput/TimeInput.js +4 -1
- package/components/TimeInput/TimeInputPopup.js +2 -1
- package/components/TimeInput/stories/Inline.stories.tsx +28 -0
- package/components/Tip/Tip.js +2 -1
- package/components/Tip/stories/HeaderActions.stories.js +2 -1
- package/components/ToggleGroup/ToggleGroup.js +2 -1
- package/components/ToggleGroup/stories/Controlled.stories.js +2 -1
- package/components/Toolbar/Toolbar.js +2 -1
- package/components/Video/StyledVideo.js +2 -1
- package/components/Video/Video.js +2 -1
- package/components/Wizard/Wizard.js +13 -2
- package/components/Wizard/WizardContent.js +2 -1
- package/components/Wizard/WizardContext.js +2 -1
- package/components/Wizard/WizardProgress.js +1 -4
- package/components/Wizard/stories/BasicLinear.stories.js +2 -1
- package/components/Wizard/stories/Branching.stories.js +2 -1
- package/components/Wizard/stories/ClickableSteps.stories.js +2 -1
- package/components/Wizard/stories/Composable.stories.js +2 -1
- package/components/Wizard/stories/Controlled.stories.js +2 -1
- package/components/Wizard/stories/ExternalForm.stories.js +2 -1
- package/components/Wizard/stories/LongContent.stories.js +2 -1
- package/components/Wizard/stories/Modal.stories.js +2 -1
- package/components/Wizard/stories/NestedSubSteps.stories.js +2 -1
- package/components/Wizard/stories/NonClosableHeader.stories.js +2 -1
- package/components/Wizard/stories/ProgressiveSubSteps.stories.tsx +209 -0
- package/components/Wizard/stories/Validation.stories.js +2 -1
- package/components/WorldMap/WorldMap.js +2 -1
- package/contexts/AnalyticsContext/AnalyticsContext.js +2 -1
- package/contexts/AnnounceContext/stories/Polite.stories.js +2 -1
- package/contexts/RootsContext.js +2 -1
- package/contexts/ThemeContext/stories/ThemeContextExtend.stories.js +2 -1
- package/es6/components/Cards/index.d.ts +2 -16
- package/es6/components/CheckBox/README.md +95 -0
- package/es6/components/CheckBox/StyledCheckBox.js +103 -14
- package/es6/components/CheckBox/stories/CustomThemed/Appearance.stories.tsx +160 -0
- package/es6/components/DateInput/DateInput.js +10 -3
- package/es6/components/DateTimeInput/DateTimeInput.js +2 -0
- package/es6/components/DateTimeInput/StyledDateTimeInput.js +10 -2
- package/es6/components/FileInput/FileInput.js +77 -20
- package/es6/components/FileInput/README.md +5 -0
- package/es6/components/FormField/FormField.js +203 -66
- package/es6/components/FormField/README.md +56 -1
- package/es6/components/FormField/stories/CustomThemed/Appearance.stories.tsx +630 -0
- package/es6/components/Grommet/index.d.ts +4 -0
- package/es6/components/Grommet/propTypes.js +4 -1
- package/es6/components/RadioButton/README.md +93 -1
- package/es6/components/RadioButton/RadioButton.js +11 -4
- package/es6/components/RadioButton/StyledRadioButton.js +102 -8
- package/es6/components/RadioButton/stories/CustomThemed/Appearance.stories.tsx +190 -0
- package/es6/components/RangeSelector/index.d.ts +1 -10
- package/es6/components/Select/StyledSelect.js +10 -3
- package/es6/components/SelectMultiple/SelectMultiple.js +9 -3
- package/es6/components/Stepper/Stepper.js +137 -101
- package/es6/components/Stepper/StepperContext.js +5 -4
- package/es6/components/Stepper/StepperDescription.js +6 -8
- package/es6/components/Stepper/StepperHelperText.js +13 -15
- package/es6/components/Stepper/StepperIndicator.js +38 -35
- package/es6/components/Stepper/StepperLabel.js +11 -23
- package/es6/components/Stepper/StepperStep.js +137 -81
- package/es6/components/Stepper/StyledStepper.js +167 -113
- package/es6/components/Stepper/index.d.ts +25 -13
- package/es6/components/Stepper/index.js +2 -1
- package/es6/components/Stepper/propTypes.js +3 -0
- package/es6/components/Stepper/stories/Children.stories.tsx +73 -0
- package/es6/components/Stepper/stories/CustomThemed.stories.tsx +301 -0
- package/es6/components/Stepper/stories/CustomThemedHpe.stories.tsx +328 -0
- package/es6/components/Stepper/utils.js +50 -0
- package/es6/components/TextInput/README.md +29 -1
- package/es6/components/TextInput/StyledTextInput.js +19 -6
- package/es6/components/TextInput/TextInput.js +101 -25
- package/es6/components/TextInput/index.d.ts +2 -0
- package/es6/components/TextInput/propTypes.js +2 -0
- package/es6/components/TextInput/stories/Clear.stories.tsx +68 -0
- package/es6/components/TextInput/stories/ClearFormField.stories.tsx +45 -0
- package/es6/components/TimeInput/StyledTimeInput.js +27 -18
- package/es6/components/TimeInput/TimeInput.js +2 -0
- package/es6/components/TimeInput/stories/Inline.stories.tsx +28 -0
- package/es6/components/Wizard/Wizard.js +10 -1
- package/es6/components/Wizard/WizardProgress.js +1 -4
- package/es6/components/Wizard/stories/ProgressiveSubSteps.stories.tsx +209 -0
- package/es6/languages/default.json +5 -1
- package/es6/themes/base.d.ts +88 -95
- package/es6/themes/base.js +198 -167
- package/es6/utils/border.js +7 -0
- package/es6/utils/styles.js +144 -24
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +5 -1
- package/package.json +35 -35
- package/themes/base.d.ts +88 -95
- package/themes/base.js +198 -167
- package/tools/draft-release-version-pr.js +1 -1
- package/tools/generate-release-notes.js +1 -1
- package/tools/license-header.js +1 -1
- package/tools/pack.js +1 -1
- package/tools/release-checklist.js +1 -1
- package/tools/release-notes-utils.js +1 -1
- package/tools/release-preparation.md +55 -0
- package/tools/release-stable.js +1 -1
- package/tools/release-styled-components-beta-stable.js +1 -1
- package/utils/border.js +8 -1
- package/utils/styles.js +145 -27
- package/utils/useId.js +2 -1
- package/components/Stepper/StepConnector.js +0 -38
- package/es6/components/Stepper/StepConnector.js +0 -33
package/themes/base.js
CHANGED
|
@@ -355,6 +355,12 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
355
355
|
}
|
|
356
356
|
},
|
|
357
357
|
input: {
|
|
358
|
+
// any BoxPartThemeType
|
|
359
|
+
// disabled: undefined, // any BoxStateThemeType
|
|
360
|
+
// focus: undefined, // any BoxStateThemeType
|
|
361
|
+
// hover: undefined, // any BoxStateThemeType
|
|
362
|
+
// pad: undefined,
|
|
363
|
+
// placeholder: undefined, // any TextThemeType
|
|
358
364
|
padding: {
|
|
359
365
|
horizontal: (0, _mixins.parseMetricToNum)(baseSpacing / 2 + "px") - (0, _mixins.parseMetricToNum)(controlBorderWidth + "px") + "px",
|
|
360
366
|
vertical: (0, _mixins.parseMetricToNum)(baseSpacing / 2 + "px") - (0, _mixins.parseMetricToNum)(controlBorderWidth + "px") + "px"
|
|
@@ -367,6 +373,7 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
367
373
|
// deprecate in v3
|
|
368
374
|
// weight: undefined,
|
|
369
375
|
readOnly: {
|
|
376
|
+
// any BoxStateThemeType
|
|
370
377
|
// background: undefined,
|
|
371
378
|
// border: {
|
|
372
379
|
// color: undefined,
|
|
@@ -898,6 +905,18 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
898
905
|
// extend: undefined,
|
|
899
906
|
},
|
|
900
907
|
checkBox: {
|
|
908
|
+
// control: {
|
|
909
|
+
// // any BoxPartThemeType
|
|
910
|
+
// hover: // any BoxStateThemeType
|
|
911
|
+
// selected: {
|
|
912
|
+
// // any BoxStateThemeType
|
|
913
|
+
// hover: // any BoxStateThemeType,
|
|
914
|
+
// },
|
|
915
|
+
// },
|
|
916
|
+
// container: {
|
|
917
|
+
// // any BoxPartThemeType
|
|
918
|
+
// hover: // any BoxStateThemeType,
|
|
919
|
+
// },
|
|
901
920
|
border: {
|
|
902
921
|
color: {
|
|
903
922
|
dark: 'rgba(255, 255, 255, 0.5)',
|
|
@@ -907,7 +926,7 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
907
926
|
},
|
|
908
927
|
check: {
|
|
909
928
|
// extend: undefined,
|
|
910
|
-
radius: '4px'
|
|
929
|
+
radius: '4px' /** @deprecated Use checkBox.control.round instead. */,
|
|
911
930
|
thickness: '4px'
|
|
912
931
|
},
|
|
913
932
|
label: {
|
|
@@ -923,6 +942,7 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
923
942
|
light: 'black'
|
|
924
943
|
}
|
|
925
944
|
}
|
|
945
|
+
/** @deprecated Use checkBox.container.hover.background instead. */
|
|
926
946
|
// background: undefined,
|
|
927
947
|
// extend: undefined,
|
|
928
948
|
},
|
|
@@ -934,6 +954,7 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
934
954
|
// checked: undefined,
|
|
935
955
|
// indeterminate: undefined,
|
|
936
956
|
},
|
|
957
|
+
/** @deprecated Use checkBox.container.pad instead. */
|
|
937
958
|
// pad: undefined,
|
|
938
959
|
size: baseSpacing + "px",
|
|
939
960
|
toggle: {
|
|
@@ -1385,7 +1406,10 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
1385
1406
|
gap: 'medium'
|
|
1386
1407
|
},
|
|
1387
1408
|
formField: {
|
|
1409
|
+
// background: undefined, // input area only, not labels or messages
|
|
1388
1410
|
// [inputname]: {
|
|
1411
|
+
// background: undefined, // 'transparent' opts out of shared background
|
|
1412
|
+
// error: undefined, // any BoxStateThemeType
|
|
1389
1413
|
// container: {
|
|
1390
1414
|
// extend: undefined,
|
|
1391
1415
|
// },
|
|
@@ -2240,30 +2264,49 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2240
2264
|
}
|
|
2241
2265
|
},
|
|
2242
2266
|
radioButton: {
|
|
2267
|
+
// control: {
|
|
2268
|
+
// // any BoxPartThemeType
|
|
2269
|
+
// hover: // any BoxStateThemeType
|
|
2270
|
+
// selected: {
|
|
2271
|
+
// // any BoxStateThemeType
|
|
2272
|
+
// hover: // any BoxStateThemeType,
|
|
2273
|
+
// },
|
|
2274
|
+
// },
|
|
2243
2275
|
border: {
|
|
2276
|
+
/** @deprecated Use radioButton.control.border.color instead. */
|
|
2244
2277
|
color: {
|
|
2245
2278
|
dark: 'rgba(255, 255, 255, 0.5)',
|
|
2246
2279
|
light: 'rgba(0, 0, 0, 0.15)'
|
|
2247
2280
|
},
|
|
2281
|
+
/** @deprecated Use radioButton.control.border.size instead. */
|
|
2248
2282
|
width: '2px'
|
|
2249
2283
|
},
|
|
2284
|
+
/** @deprecated Use radioButton.control.background instead. */
|
|
2250
2285
|
// background: {
|
|
2251
2286
|
// color: undefined,
|
|
2252
2287
|
// },
|
|
2253
2288
|
check: {
|
|
2289
|
+
/** @deprecated Use radioButton.control.round instead. */
|
|
2254
2290
|
radius: '100%'
|
|
2291
|
+
/** @deprecated Use radioButton.control.selected.background instead. */
|
|
2255
2292
|
// background: {
|
|
2256
2293
|
// color: undefined,
|
|
2257
2294
|
// },
|
|
2258
2295
|
// color: { dark: undefined, light: undefined },
|
|
2259
2296
|
// extend: undefined,
|
|
2260
2297
|
},
|
|
2298
|
+
/** @deprecated Use radioButton.control.selected.border.color instead. */
|
|
2261
2299
|
// color: undefined,
|
|
2262
2300
|
hover: {
|
|
2301
|
+
/** @deprecated Use radioButton.container.hover.background instead. */
|
|
2263
2302
|
// background: {
|
|
2264
2303
|
// color: undefined,
|
|
2265
2304
|
// },
|
|
2266
2305
|
border: {
|
|
2306
|
+
/**
|
|
2307
|
+
* @deprecated Use radioButton.control.hover.border.color and
|
|
2308
|
+
* radioButton.control.selected.hover.border.color instead.
|
|
2309
|
+
*/
|
|
2267
2310
|
color: {
|
|
2268
2311
|
dark: 'white',
|
|
2269
2312
|
light: 'black'
|
|
@@ -2283,6 +2326,8 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2283
2326
|
// weight: undefined,
|
|
2284
2327
|
},
|
|
2285
2328
|
container: {
|
|
2329
|
+
// any BoxPartThemeType
|
|
2330
|
+
// hover: // any BoxStateThemeType,
|
|
2286
2331
|
// extend: undefined
|
|
2287
2332
|
}
|
|
2288
2333
|
},
|
|
@@ -2461,137 +2506,69 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2461
2506
|
// unselected: undefined,
|
|
2462
2507
|
// },
|
|
2463
2508
|
},
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
// background: undefined,
|
|
2470
|
-
border: {
|
|
2471
|
-
side: 'bottom',
|
|
2472
|
-
size: 'small',
|
|
2473
|
-
color: {
|
|
2474
|
-
dark: 'accent-1',
|
|
2475
|
-
light: 'brand'
|
|
2476
|
-
},
|
|
2477
|
-
active: {
|
|
2478
|
-
color: {
|
|
2479
|
-
dark: 'white',
|
|
2480
|
-
light: 'black'
|
|
2481
|
-
}
|
|
2482
|
-
},
|
|
2483
|
-
disabled: {
|
|
2484
|
-
// color: undefined,
|
|
2485
|
-
},
|
|
2486
|
-
hover: {
|
|
2487
|
-
color: {
|
|
2488
|
-
dark: 'white',
|
|
2489
|
-
light: 'black'
|
|
2490
|
-
}
|
|
2491
|
-
// extend: undefined,
|
|
2492
|
-
}
|
|
2493
|
-
},
|
|
2494
|
-
color: 'control',
|
|
2495
|
-
// disabled: {
|
|
2496
|
-
// color: undefined,
|
|
2497
|
-
// },
|
|
2498
|
-
// extend: undefined,
|
|
2499
|
-
gap: 'small',
|
|
2500
|
-
hover: {
|
|
2501
|
-
// background: undefined,
|
|
2502
|
-
// extend: undefined,
|
|
2503
|
-
color: {
|
|
2504
|
-
dark: 'white',
|
|
2505
|
-
light: 'black'
|
|
2506
|
-
}
|
|
2507
|
-
},
|
|
2508
|
-
margin: {
|
|
2509
|
-
vertical: 'xxsmall',
|
|
2510
|
-
horizontal: 'small'
|
|
2511
|
-
},
|
|
2512
|
-
pad: {
|
|
2513
|
-
bottom: 'xsmall'
|
|
2514
|
-
}
|
|
2515
|
-
},
|
|
2516
|
-
tabs: {
|
|
2517
|
-
// background: undefined,
|
|
2518
|
-
// extend: undefined,
|
|
2519
|
-
// gap: undefined,
|
|
2520
|
-
header: {
|
|
2521
|
-
// alignSelf: undefined,
|
|
2522
|
-
// background: undefined,
|
|
2523
|
-
// border: {
|
|
2524
|
-
// side: undefined,
|
|
2525
|
-
// size: undefined,
|
|
2526
|
-
// style: undefined,
|
|
2527
|
-
// color: undefined,
|
|
2528
|
-
// },
|
|
2529
|
-
// extend: undefined,
|
|
2530
|
-
nextButton: {
|
|
2531
|
-
// icon: undefined,
|
|
2532
|
-
pad: {
|
|
2533
|
-
horizontal: 'small',
|
|
2534
|
-
vertical: 'xsmall'
|
|
2535
|
-
}
|
|
2536
|
-
},
|
|
2537
|
-
previousButton: {
|
|
2538
|
-
// icon: undefined,
|
|
2539
|
-
pad: {
|
|
2540
|
-
horizontal: 'small',
|
|
2541
|
-
vertical: 'xsmall'
|
|
2542
|
-
}
|
|
2509
|
+
stepper: {
|
|
2510
|
+
container: {
|
|
2511
|
+
gap: {
|
|
2512
|
+
row: 'medium',
|
|
2513
|
+
column: 'small'
|
|
2543
2514
|
}
|
|
2544
2515
|
},
|
|
2545
|
-
panel: {
|
|
2546
|
-
// extend: undefined,
|
|
2547
|
-
},
|
|
2548
|
-
step: {
|
|
2549
|
-
small: 1,
|
|
2550
|
-
medium: 3,
|
|
2551
|
-
large: 3
|
|
2552
|
-
}
|
|
2553
|
-
},
|
|
2554
|
-
stepper: {
|
|
2555
2516
|
indicator: {
|
|
2556
2517
|
size: 'medium',
|
|
2557
2518
|
// 'small' | 'medium' | 'large'
|
|
2519
|
+
iconSize: 'medium',
|
|
2558
2520
|
border: {
|
|
2559
|
-
|
|
2560
|
-
}
|
|
2521
|
+
size: 'small'
|
|
2522
|
+
},
|
|
2523
|
+
round: '50%',
|
|
2524
|
+
align: 'center',
|
|
2525
|
+
justify: 'center'
|
|
2561
2526
|
},
|
|
2562
2527
|
label: {
|
|
2563
2528
|
size: 'medium',
|
|
2564
|
-
|
|
2565
|
-
size: 'small'
|
|
2566
|
-
}
|
|
2529
|
+
color: 'text'
|
|
2567
2530
|
},
|
|
2568
2531
|
connector: {
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2532
|
+
thickness: 'small',
|
|
2533
|
+
color: 'border',
|
|
2534
|
+
gap: baseSpacing / 6 + "px" // 4,
|
|
2572
2535
|
},
|
|
2573
2536
|
description: {
|
|
2574
2537
|
size: 'small',
|
|
2575
2538
|
color: 'text-weak'
|
|
2576
2539
|
},
|
|
2577
|
-
|
|
2540
|
+
errorText: {
|
|
2541
|
+
size: 'xsmall',
|
|
2542
|
+
color: 'status-critical'
|
|
2543
|
+
},
|
|
2544
|
+
disabledReason: {
|
|
2578
2545
|
size: 'xsmall',
|
|
2579
2546
|
color: 'text-weak'
|
|
2580
2547
|
},
|
|
2581
2548
|
button: {
|
|
2582
|
-
pad: 'xxsmall'
|
|
2549
|
+
pad: 'xxsmall',
|
|
2550
|
+
gap: 'xsmall',
|
|
2551
|
+
align: 'center'
|
|
2583
2552
|
},
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
margin: 'xxsmall'
|
|
2587
|
-
},
|
|
2588
|
-
button: {
|
|
2589
|
-
gap: 'xsmall'
|
|
2590
|
-
}
|
|
2553
|
+
children: {
|
|
2554
|
+
pad: 'none'
|
|
2591
2555
|
},
|
|
2592
2556
|
vertical: {
|
|
2593
2557
|
button: {
|
|
2594
|
-
gap: 'small'
|
|
2558
|
+
gap: 'small',
|
|
2559
|
+
direction: 'row',
|
|
2560
|
+
// baseline pairs with the StyledIndicator baseline strut to
|
|
2561
|
+
// center the label's first line against the indicator
|
|
2562
|
+
align: 'baseline'
|
|
2563
|
+
}
|
|
2564
|
+
},
|
|
2565
|
+
subStep: {
|
|
2566
|
+
indicator: {
|
|
2567
|
+
size: 'small',
|
|
2568
|
+
iconSize: 'small'
|
|
2569
|
+
},
|
|
2570
|
+
label: {
|
|
2571
|
+
size: 'small'
|
|
2595
2572
|
}
|
|
2596
2573
|
},
|
|
2597
2574
|
// States: [component].[state].[element].[property]
|
|
@@ -2599,34 +2576,18 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2599
2576
|
indicator: {
|
|
2600
2577
|
background: 'background-front',
|
|
2601
2578
|
color: 'text-strong',
|
|
2602
|
-
border:
|
|
2603
|
-
|
|
2604
|
-
iconSize: 'small'
|
|
2605
|
-
},
|
|
2606
|
-
hover: {
|
|
2607
|
-
background: 'background-front',
|
|
2608
|
-
border: 'text-strong'
|
|
2579
|
+
border: {
|
|
2580
|
+
color: 'text-xweak'
|
|
2609
2581
|
}
|
|
2610
|
-
},
|
|
2611
|
-
label: {
|
|
2612
|
-
color: 'text'
|
|
2613
|
-
},
|
|
2614
|
-
connector: {
|
|
2615
|
-
color: 'border'
|
|
2616
2582
|
}
|
|
2617
2583
|
},
|
|
2618
2584
|
current: {
|
|
2619
2585
|
indicator: {
|
|
2620
2586
|
icon: _StatusGoodSmall.StatusGoodSmall,
|
|
2621
|
-
iconSize: 'medium',
|
|
2622
2587
|
background: 'brand',
|
|
2623
|
-
color: '
|
|
2624
|
-
border:
|
|
2625
|
-
|
|
2626
|
-
iconSize: 'small'
|
|
2627
|
-
},
|
|
2628
|
-
hover: {
|
|
2629
|
-
color: 'white'
|
|
2588
|
+
color: 'background-front',
|
|
2589
|
+
border: {
|
|
2590
|
+
color: 'brand'
|
|
2630
2591
|
}
|
|
2631
2592
|
},
|
|
2632
2593
|
label: {
|
|
@@ -2639,15 +2600,10 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2639
2600
|
currentCompleted: {
|
|
2640
2601
|
indicator: {
|
|
2641
2602
|
icon: _FormCheckmark.FormCheckmark,
|
|
2642
|
-
iconSize: 'medium',
|
|
2643
2603
|
background: 'brand',
|
|
2644
2604
|
color: 'white',
|
|
2645
|
-
border:
|
|
2646
|
-
|
|
2647
|
-
iconSize: 'small'
|
|
2648
|
-
},
|
|
2649
|
-
hover: {
|
|
2650
|
-
color: 'white'
|
|
2605
|
+
border: {
|
|
2606
|
+
color: 'brand'
|
|
2651
2607
|
}
|
|
2652
2608
|
},
|
|
2653
2609
|
label: {
|
|
@@ -2655,20 +2611,17 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2655
2611
|
dark: 'text-strong',
|
|
2656
2612
|
light: 'brand'
|
|
2657
2613
|
}
|
|
2614
|
+
},
|
|
2615
|
+
connector: {
|
|
2616
|
+
color: 'brand'
|
|
2658
2617
|
}
|
|
2659
2618
|
},
|
|
2660
2619
|
completed: {
|
|
2661
2620
|
indicator: {
|
|
2662
2621
|
icon: _FormCheckmark.FormCheckmark,
|
|
2663
|
-
iconSize: 'medium',
|
|
2664
|
-
background: 'background-front',
|
|
2665
2622
|
color: 'brand',
|
|
2666
|
-
border:
|
|
2667
|
-
|
|
2668
|
-
iconSize: 'small'
|
|
2669
|
-
},
|
|
2670
|
-
hover: {
|
|
2671
|
-
background: 'background-front'
|
|
2623
|
+
border: {
|
|
2624
|
+
color: 'brand'
|
|
2672
2625
|
}
|
|
2673
2626
|
},
|
|
2674
2627
|
label: {
|
|
@@ -2681,58 +2634,135 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2681
2634
|
error: {
|
|
2682
2635
|
indicator: {
|
|
2683
2636
|
icon: _StatusCriticalSmall.StatusCriticalSmall,
|
|
2637
|
+
iconSize: 'small',
|
|
2684
2638
|
background: 'background-front',
|
|
2685
2639
|
color: 'status-critical',
|
|
2686
|
-
border:
|
|
2687
|
-
|
|
2688
|
-
iconSize: 'small'
|
|
2689
|
-
},
|
|
2690
|
-
hover: {
|
|
2691
|
-
background: 'background-front'
|
|
2640
|
+
border: {
|
|
2641
|
+
color: 'status-critical'
|
|
2692
2642
|
}
|
|
2693
2643
|
},
|
|
2694
|
-
label: {
|
|
2695
|
-
color: 'text'
|
|
2696
|
-
},
|
|
2697
2644
|
connector: {
|
|
2698
2645
|
color: 'status-critical'
|
|
2699
|
-
},
|
|
2700
|
-
helperText: {
|
|
2701
|
-
color: 'status-critical'
|
|
2702
2646
|
}
|
|
2703
2647
|
},
|
|
2704
2648
|
currentError: {
|
|
2705
2649
|
indicator: {
|
|
2706
2650
|
icon: _StatusCriticalSmall.StatusCriticalSmall,
|
|
2651
|
+
iconSize: 'small',
|
|
2707
2652
|
background: 'status-critical',
|
|
2708
2653
|
color: 'white',
|
|
2709
|
-
border:
|
|
2710
|
-
|
|
2711
|
-
iconSize: 'small'
|
|
2712
|
-
},
|
|
2713
|
-
hover: {
|
|
2714
|
-
color: 'white'
|
|
2654
|
+
border: {
|
|
2655
|
+
color: 'status-critical'
|
|
2715
2656
|
}
|
|
2716
2657
|
},
|
|
2717
2658
|
label: {
|
|
2718
2659
|
color: 'status-critical'
|
|
2660
|
+
},
|
|
2661
|
+
connector: {
|
|
2662
|
+
color: 'status-critical'
|
|
2719
2663
|
}
|
|
2720
2664
|
},
|
|
2721
2665
|
disabled: {
|
|
2722
2666
|
indicator: {
|
|
2723
2667
|
background: 'background-contrast',
|
|
2724
2668
|
color: 'text-weak',
|
|
2725
|
-
border:
|
|
2726
|
-
|
|
2727
|
-
iconSize: 'small'
|
|
2669
|
+
border: {
|
|
2670
|
+
color: 'border'
|
|
2728
2671
|
}
|
|
2729
2672
|
},
|
|
2730
2673
|
label: {
|
|
2731
2674
|
color: 'text-weak'
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
},
|
|
2678
|
+
tab: {
|
|
2679
|
+
active: {
|
|
2680
|
+
color: 'text'
|
|
2681
|
+
// background: undefined,
|
|
2682
|
+
},
|
|
2683
|
+
// background: undefined,
|
|
2684
|
+
border: {
|
|
2685
|
+
side: 'bottom',
|
|
2686
|
+
size: 'small',
|
|
2687
|
+
color: {
|
|
2688
|
+
dark: 'accent-1',
|
|
2689
|
+
light: 'brand'
|
|
2732
2690
|
},
|
|
2733
|
-
|
|
2734
|
-
color:
|
|
2691
|
+
active: {
|
|
2692
|
+
color: {
|
|
2693
|
+
dark: 'white',
|
|
2694
|
+
light: 'black'
|
|
2695
|
+
}
|
|
2696
|
+
},
|
|
2697
|
+
disabled: {
|
|
2698
|
+
// color: undefined,
|
|
2699
|
+
},
|
|
2700
|
+
hover: {
|
|
2701
|
+
color: {
|
|
2702
|
+
dark: 'white',
|
|
2703
|
+
light: 'black'
|
|
2704
|
+
}
|
|
2705
|
+
// extend: undefined,
|
|
2706
|
+
}
|
|
2707
|
+
},
|
|
2708
|
+
color: 'control',
|
|
2709
|
+
// disabled: {
|
|
2710
|
+
// color: undefined,
|
|
2711
|
+
// },
|
|
2712
|
+
// extend: undefined,
|
|
2713
|
+
gap: 'small',
|
|
2714
|
+
hover: {
|
|
2715
|
+
// background: undefined,
|
|
2716
|
+
// extend: undefined,
|
|
2717
|
+
color: {
|
|
2718
|
+
dark: 'white',
|
|
2719
|
+
light: 'black'
|
|
2735
2720
|
}
|
|
2721
|
+
},
|
|
2722
|
+
margin: {
|
|
2723
|
+
vertical: 'xxsmall',
|
|
2724
|
+
horizontal: 'small'
|
|
2725
|
+
},
|
|
2726
|
+
pad: {
|
|
2727
|
+
bottom: 'xsmall'
|
|
2728
|
+
}
|
|
2729
|
+
},
|
|
2730
|
+
tabs: {
|
|
2731
|
+
// background: undefined,
|
|
2732
|
+
// extend: undefined,
|
|
2733
|
+
// gap: undefined,
|
|
2734
|
+
header: {
|
|
2735
|
+
// alignSelf: undefined,
|
|
2736
|
+
// background: undefined,
|
|
2737
|
+
// border: {
|
|
2738
|
+
// side: undefined,
|
|
2739
|
+
// size: undefined,
|
|
2740
|
+
// style: undefined,
|
|
2741
|
+
// color: undefined,
|
|
2742
|
+
// },
|
|
2743
|
+
// extend: undefined,
|
|
2744
|
+
nextButton: {
|
|
2745
|
+
// icon: undefined,
|
|
2746
|
+
pad: {
|
|
2747
|
+
horizontal: 'small',
|
|
2748
|
+
vertical: 'xsmall'
|
|
2749
|
+
}
|
|
2750
|
+
},
|
|
2751
|
+
previousButton: {
|
|
2752
|
+
// icon: undefined,
|
|
2753
|
+
pad: {
|
|
2754
|
+
horizontal: 'small',
|
|
2755
|
+
vertical: 'xsmall'
|
|
2756
|
+
}
|
|
2757
|
+
}
|
|
2758
|
+
},
|
|
2759
|
+
panel: {
|
|
2760
|
+
// extend: undefined,
|
|
2761
|
+
},
|
|
2762
|
+
step: {
|
|
2763
|
+
small: 1,
|
|
2764
|
+
medium: 3,
|
|
2765
|
+
large: 3
|
|
2736
2766
|
}
|
|
2737
2767
|
},
|
|
2738
2768
|
table: {
|
|
@@ -2900,6 +2930,7 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2900
2930
|
// extend: undefined,
|
|
2901
2931
|
// disabled: { opacity: undefined },
|
|
2902
2932
|
icons: {
|
|
2933
|
+
clear: _FormClose.FormClose,
|
|
2903
2934
|
// copy: undefined,
|
|
2904
2935
|
hidePassword: _Hide.Hide,
|
|
2905
2936
|
showPassword: _View.View
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFileSync,writeFileSync,appendFileSync}from"fs";const NOTES_PATH="RELEASE_NOTES_DRAFT.md",CHECKLIST_PATH="RELEASE_CHECKLIST.md",PACKAGE_PATH="package.json",CHANGELOG_PATH="CHANGELOG.md";function suggestBump(e){const
|
|
1
|
+
import{readFileSync,writeFileSync,appendFileSync}from"fs";const NOTES_PATH="RELEASE_NOTES_DRAFT.md",CHECKLIST_PATH="RELEASE_CHECKLIST.md",PACKAGE_PATH="package.json",CHANGELOG_PATH="CHANGELOG.md";function suggestBump(e){const t=e.match(/── Suggested semver bump ─+\n\n(MAJOR|MINOR|PATCH)\b/);if(!t)throw new Error("Could not find a suggested semver bump in RELEASE_CHECKLIST.md");return t[1].toLowerCase()}function bumpVersion(e,t){const[n,s,r]=e.split(".").map(Number);return"major"===t?`${n+1}.0.0`:"minor"===t?`${n}.${s+1}.0`:`${n}.${s}.${r+1}`}function setGithubOutput(e,t){const n=process.env.GITHUB_OUTPUT;n&&appendFileSync(n,`${e}=${t}\n`)}const notes=readFileSync(NOTES_PATH,"utf8").trim(),checklist=readFileSync(CHECKLIST_PATH,"utf8"),bump=process.env.BUMP_OVERRIDE;if("true"!==process.env.CHECKLIST_REVIEWED)throw new Error("Review the release checklist before creating a release PR.");if(!["patch","minor","major"].includes(bump))throw new Error("Explicitly select patch, minor, or major after review.");const suggested=suggestBump(checklist);if(!notes||!/^[-*] /m.test(notes))throw new Error("Release notes must contain reviewed change entries.");const pkg=JSON.parse(readFileSync(PACKAGE_PATH,"utf8"));if(!/^\d+\.\d+\.\d+$/.test(pkg.version))throw new Error("Expected a stable package version in package.json.");const nextVersion=bumpVersion(pkg.version,bump);pkg.version=nextVersion,writeFileSync(PACKAGE_PATH,`${JSON.stringify(pkg,null,2)}\n`,"utf8");const changelog=readFileSync("CHANGELOG.md","utf8"),entry=`# ${nextVersion}\n\n${notes}\n\n`;writeFileSync("CHANGELOG.md",entry+changelog,"utf8"),console.log(`Checklist suggestion: ${suggested}; selected: ${bump} -> v${nextVersion}`),setGithubOutput("version",nextVersion),setGithubOutput("bump",bump);const template=readFileSync(".github/PULL_REQUEST_TEMPLATE.md","utf8"),answers={"What does this PR do?":`Prepares Grommet v${nextVersion} with a maintainer-selected ${bump} bump.\n\nCopies the reviewed release-note draft unchanged into CHANGELOG.md.`,"Where should the reviewer start?":`Review package.json and the new CHANGELOG.md section.\n\nChecklist suggestion: **${suggested}**; selected bump: **${bump}**.\n\n- Patch: backwards-compatible bug fixes.\n- Minor: new components, props, or compatible functionality.\n- Major: incompatible public API or behavior changes.\n\nConfirm the version, PR title/branch, and changelog heading agree.`,"What testing has been done on this PR?":"The release checklist completed for the reviewed commit. Its findings were acknowledged before creating this PR. This is not a test coverage guarantee.\n\nReview PR CI results separately; no build or browser QA is claimed here.","How should this be manually tested?":"- [ ] Confirm version scope and release-note wording.\n- [ ] Resolve or explicitly accept missing-test findings.\n- [ ] Complete the listed component QA in Chrome, Firefox, and Safari.\n- [ ] Wait for required CI checks before merging.","Do Jest tests follow these best practices?":"Not applicable to this version/changelog PR; template checklist follows.","Any background context you want to provide?":`Merging triggers tag creation after merge-commit CI, then package build and npm staging. Public npm publication requires manual approval.\n\n<details><summary>Reviewed release checklist</summary>\n\n\`\`\`text\n${checklist.trim()}\n\`\`\`\n\n</details>`,"What are the relevant issues?":"See the linked PRs in the release notes.","Screenshots (if appropriate)":"Not applicable.","Do the grommet docs need to be updated?":"Review documentation requirements for the included changes.","Should this PR be mentioned in the release notes?":"No. This PR only prepares the version and changelog.","Is this change backwards compatible or is it a breaking change?":"major"===bump?"Major release selected; review the documented breaking changes.":"Backwards-compatible release selected; confirm during final review."},body=template.replace(/^#### (.+)$/gm,(e,t)=>answers[t]?`${e}\n\n${answers[t]}`:e);writeFileSync("PR_BODY.md",body,"utf8");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync,readdirSync,readFileSync,statSync,writeFileSync}from"fs";import{join}from"path";import{formatReleaseSentence,getSkipReason,isTypeScriptChange}from"./release-notes-utils";const OWNER="grommet",REPO="grommet",API=`https://api.github.com/repos/${OWNER}/${REPO}`,GH_PR_URL=`https://github.com/${OWNER}/${REPO}/pull`,GH_RELEASE_URL=`https://github.com/${OWNER}/${REPO}/releases/tag`,GH_COMPARE_URL=`https://github.com/${OWNER}/${REPO}/compare`,DEFAULT_CHANGELOG_FILE="CHANGELOG.md",PLACEHOLDER_VERSION="X.X.X",LABEL_SECTION_MAP=new Map([["DataTable","DataTable"],["DateInput","DateInput"],["DateTimeInput","DateTimeInput"],["TimeInput","TimeInput"],["FileInput","FileInput"],["Select","Select / SelectMultiple"],["SelectMultiple","Select / SelectMultiple"],["List","List"],["RadioButton","RadioButton / RadioButtonGroup"],["RadioButtonGroup","RadioButton / RadioButtonGroup"],["RangeSelector","RangeSelector"],["TypeScript","TypeScript"],["typescript","TypeScript"],["Beta","Beta"],["beta","Beta"],["Calendar","Calendar"],["TextInput","TextInput"],["MaskedInput","MaskedInput"],["Notification","Notification"],["Layer","Layer"],["Button","Button"],["Form","Form"],["FormField","FormField"],["Stepper","Stepper"],["Wizard","Wizard"],["Tabs","Tabs"],["Pagination","Pagination"],["Menu","Menu"],["Anchor","Anchor"],["CheckBox","CheckBox / CheckBoxGroup"],["CheckBoxGroup","CheckBoxGroup / CheckBox"],["Data","Data"],["DataChart","Chart / DataChart"],["Chart","Chart / DataChart"],["DataFilter","DataFilter"]]),SECTION_ORDER=["General","Anchor","Button","Calendar","Chart / DataChart","CheckBox","Data","DataFilter","DataTable","DateInput","DateTimeInput","FileInput","Form","FormField","Layer","List","MaskedInput","Menu","Notification","Pagination","RadioButton / RadioButtonGroup","RangeSelector","Select / SelectMultiple","Stepper","Tabs","TextInput","TimeInput","TypeScript","Beta"],BETA_LABELS=new Set(["beta","Beta"]),DEFAULT_BETA_COMPONENT_SECTIONS=new Set(["DateTimeInput","Stepper","TimeInput","Wizard"]),MIN_COMPONENT_SECTION_SIZE=3,BETA_WARNING_PATTERN=/currently in beta[\s\S]*api is subject\s+to\s+change/i;function getSourceBetaComponentSections(){const e=join(process.cwd(),"src","js","components");if(!existsSync(e))return new Set;const t=new Set,n=readdirSync(e);for(const o of n){const n=join(e,o);if(!statSync(n).isDirectory())continue;const r=join(n,`${o}.js`);if(existsSync(r))try{const e=readFileSync(r,"utf8");BETA_WARNING_PATTERN.test(e)&&t.add(o)}catch{}}return t}const BETA_COMPONENT_SECTIONS=new Set([...Array.from(DEFAULT_BETA_COMPONENT_SECTIONS),...Array.from(getSourceBetaComponentSections())]);function parseArgs(){const e=process.argv.slice(2),t={from:null,to:null,format:(process.argv[1]||"").includes("announcement")?"announcement":"release-notes",output:null,changelog:null,version:null,token:process.env.GH_TOKEN||null};for(let n=0;n<e.length;n++){const o=e[n];if("--from"===o)t.from=e[++n];else if("--to"===o)t.to=e[++n];else if("--format"===o)t.format=e[++n];else if("--output"===o)t.output=e[++n];else if("--changelog"===o){const o=e[n+1];t.changelog=o&&!o.startsWith("--")?e[++n]:"CHANGELOG.md"}else"--no-changelog"===o?t.changelog=!1:"--version"===o?t.version=e[++n]:"--token"===o?t.token=e[++n]:o.startsWith("--")||t.from?o.startsWith("--")||t.to||(t.to=o):t.from=o}return t}function getRequestHeaders(e){return{...e?{Authorization:`Bearer ${e}`}:{},Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}}async function ghGet(e,t){const n=await fetch(e,{headers:getRequestHeaders(t)});if(!n.ok){const t=await n.text();if(403===n.status&&t.includes("API rate limit exceeded"))throw new Error("GitHub API rate limit exceeded. Set GH_TOKEN or pass --token to generate release output.");throw new Error(`GitHub API ${n.status} at ${e}:\n${t}`)}return n.json()}async function resolveRef(e,t){if(!e||"HEAD"===e){const e=await ghGet(`${API}`,t),n=await ghGet(`${API}/branches/${e.default_branch}`,t);return{sha:n.commit.sha,date:n.commit.commit.committer.date}}try{const n=await ghGet(`${API}/git/refs/tags/${e}`,t);let{sha:o}=n.object;return"tag"===n.object.type&&(o=(await ghGet(`${API}/git/tags/${o}`,t)).object.sha),{sha:o,date:(await ghGet(`${API}/commits/${o}`,t)).commit.committer.date}}catch{const n=await ghGet(`${API}/commits/${e}`,t);return{sha:n.sha,date:n.commit.committer.date}}}async function getLatestTag(e){const t=await ghGet(`${API}/tags?per_page=5`,e);if(!t.length)throw new Error("No tags found in repository.");return t[0].name}function getSection(e){const t=e.labels.map((e=>e.name));if(isTypeScriptChange(e))return"TypeScript";if(t.some((e=>BETA_LABELS.has(e))))return"Beta";for(const e of t){const t=LABEL_SECTION_MAP.get(e);if(t)return t}const n=e.title.match(/^[A-Za-z]+\(([^)]+)\):/);if(n){const e=n[1].trim();for(const[t,n]of LABEL_SECTION_MAP)if(t.toLowerCase()===e.toLowerCase())return n}const o=e.title.toLowerCase();for(const[e,t]of LABEL_SECTION_MAP){const n=e.toLowerCase();if(o.startsWith(`${n} `)||o.startsWith(`${n}:`)||o.startsWith(`${n}-`)||o.startsWith(`${n},`))return t}return"General"}function formatEntry(e){return`- ${formatReleaseSentence(e).replace(/[.!?]+$/,"")}. ([#${e.number}](${GH_PR_URL}/${e.number}))`}function formatTitlePhrase(e){const t=e.trim().replace(/[.!?]+$/,"");return t.charAt(0).toLowerCase()+t.slice(1)}function humanJoin(e){return 0===e.length?"":1===e.length?e[0]:2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function unique(e){return e.filter(((t,n)=>t&&e.indexOf(t)===n))}function getAnnouncementHighlights(e){const t=[/^added\b/i,/^enhanced\b/i,/^improved\b/i];return e.filter((e=>t.some((t=>t.test(e.title))))).slice(0,2).map((e=>formatTitlePhrase(e.title)))}function getFixSummary(e){const t=unique(e.filter((e=>/^fixed\b/i.test(e.title))).map((e=>e.section)).filter((e=>e&&"General"!==e&&"Beta"!==e)));if(0===t.length)return null;const n=t.slice(0,5),o=t.length>5?", and more":"";return`There are also fixes across ${humanJoin(n)}${o}.`}function formatContributors(e){const t=unique(e.map((e=>e.user?.login)).filter((e=>e&&"app/dependabot"!==e)));return 0===t.length?null:`Thank you to everyone who contributed to this release ${humanJoin(t.map((e=>`<https://github.com/${e}|${e}>`)))}!`}function inferNextReleaseTag(e,t){if(t&&/^v\d+\.\d+\.\d+$/i.test(t))return t;const n=(e||"").match(/^v(\d+)\./i);return n?`v${n[1]}.x.x`:"v2.x.x"}function extractComponentName(e){const t=(e.title||"").trim(),n=t.match(/^[A-Za-z]+\(([^)]+)\):/);if(n)return n[1].trim();const o=t.match(/^([A-Za-z][A-Za-z0-9]+)/);return o?o[1].trim():null}function inferComponentFromText(e){const t=e.title||"";for(const[e,n]of LABEL_SECTION_MAP)if(new RegExp(`\\b${e}\\b`,"i").test(t))return n;return null}function resolveHighlightComponent(e){return e.section&&"General"!==e.section?e.section:extractComponentName(e)||inferComponentFromText(e)||e.section}function getFixComponents(e){const t=[];for(const n of e){const e=(n.title||"").toLowerCase();if(!/\bfix(e[ds])?\b/.test(e))continue;const o=resolveHighlightComponent(n);o&&"General"!==o&&"Beta"!==o&&(t.includes(o)||t.push(o))}return t}function getEnhancementComponents(e){const t=[];for(const n of e){const e=(n.title||"").toLowerCase();if(/\bfix(e[ds])?\b/.test(e))continue;const o=resolveHighlightComponent(n);o&&"General"!==o&&"Beta"!==o&&(t.includes(o)||t.push(o))}return t}function formatBetaDescription(e){const t=(e.title||"").trim().replace(/[.!?]+$/,"").toLowerCase(),n=extractComponentName(e)||"Component";return/feat\(|\badd\b/.test(t)?`${n} - allows you to guide users through multi-step forms.`:/fix/.test(t)?`${n} - includes important bug fixes.`:`${n} - includes beta updates.`}function getNewBetaComponentLines(e){const t=e.filter((e=>{const t=(e.title||"").toLowerCase();return!("Beta"!==e.section||!t.startsWith("feat(")&&(!t.startsWith("add")||!t.includes("component")))})),n=new Set,o=[];for(const e of t){const t=extractComponentName(e);t&&!n.has(t.toLowerCase())&&(n.add(t.toLowerCase()),o.push(`- **${t}** - allows you to guide users through multi-step forms.`))}return o}function normalizeSection(e){return BETA_COMPONENT_SECTIONS.has(e)?"Beta":e}function mentionsBetaComponent(e){const t=`${e.title||""}\n${e.body||""}`.toLowerCase();return Array.from(BETA_COMPONENT_SECTIONS).some((e=>t.includes(e.toLowerCase())))}function shouldForceIncludeAsBeta(e){return!isTypeScriptChange(e)&&(!!mentionsBetaComponent(e)||"Beta"===normalizeSection(getSection(e)))}function buildReleaseSections(e){const t=new Map(SECTION_ORDER.map((e=>[e,[]]))),n=new Map;for(const t of e){const e=normalizeSection(t.section);n.set(e,(n.get(e)||0)+1)}for(const o of e){const e=normalizeSection(o.section);let r=e;!("General"===e||"Beta"===e||"TypeScript"===e)&&(n.get(e)||0)<3&&(r="General"),t.has(r)||t.set(r,[]),t.get(r).push(formatEntry(o))}return t}function buildSectionOrder(e){const t=new Set(SECTION_ORDER),n=Array.from(e.keys()).filter((e=>!t.has(e))).sort();return[...SECTION_ORDER.slice(0,-2),...n,...SECTION_ORDER.slice(-2)]}function formatReleaseNotes(e){const t=buildSectionOrder(e),n=[];for(const o of t){const t=e.get(o);if(!t||0===t.length)continue;const r="Beta"===o?"Beta - APIs are subject to change:":`${o}:`;n.push({heading:r,entries:t})}const o=[];if(1===n.length&&"General:"===n[0].heading)for(const e of n[0].entries)o.push(e);else for(const{heading:e,entries:t}of n){o.push(e),o.push("");for(const e of t)o.push(e);o.push("")}return o.join("\n").trim()}function normalizeVersionHeading(e){return String(e).trim().replace(/^v/i,"")}function updateChangelog(e,t,n){const o=`# ${normalizeVersionHeading(t)}`,r=`${o}\n\n${n}\n`,s=existsSync(e)?readFileSync(e,"utf8"):"",a=s.split("\n"),i=a.findIndex((e=>e.trim()===o));let c;if(-1===i)c=`${r}\n${s}`;else{let e=i+1;for(;e<a.length&&!/^# /.test(a[e]);)e+=1;const t=a.slice(0,i).join("\n");c=`${t&&!t.endsWith("\n")?`${t}\n`:t}${r}\n${a.slice(e).join("\n")}`}writeFileSync(e,c,"utf8"),console.error(`Changelog updated at ${e} under "${o}".`)}function describeHighlightGroup(e,t,n,o){return 0===e.length?null:1===e.length?`${o} ${t} to ${e[0]}`:`${n} to ${humanJoin(e)}`}function formatAnnouncement(e){const t=getFixComponents(e.prs),n=getEnhancementComponents(e.prs),o=getNewBetaComponentLines(e.prs),r=[describeHighlightGroup(t,"fix","fixes","a"),describeHighlightGroup(n,"enhancement","enhancements","an")].filter(Boolean),s=r.length>0?`This release included ${r.join(" as well as ")}. Check out the full <${e.releaseUrl}|release notes> for details.`:`Check out the full <${e.releaseUrl}|release notes> for details.`,a=[`Grommet ${e.releaseLabel} is released`,"",s];return o.length>0&&(a.push(""),a.push("**New BETA components** *(APIs are subject to change)*:"),a.push(""),a.push(...o)),a.join("\n").trim()}const args=parseArgs();(async()=>{let e=args.from;e||(e=await getLatestTag(args.token),console.error(`Auto-detected --from: ${e}`));const t=args.to||"HEAD";console.error(`Resolving refs: ${e} → ${t}`);const n=await resolveRef(e,args.token),o=await resolveRef(t,args.token);console.error(`Fetching commits between ${e} and ${t}...`);const r=await ghGet(`${API}/compare/${n.sha}...${o.sha}`,args.token);if(r.total_commits>r.commits.length)throw new Error(`Compare API returned only ${r.commits.length} of ${r.total_commits} commits. The release range is too large; please choose a smaller range or switch to a paginated strategy.`);const s=new Set;for(const e of r.commits){const t=e.commit.message.matchAll(/#(\d+)/g);for(const e of t)s.add(Number(e[1]))}0===s.size?console.error("No PR references found in commits. Output will be empty."):console.error(`Found ${s.size} PR reference(s) in commits.`);const a=Array.from(s),i=[],c=[];for(let e=0;e<a.length;e+=5){const t=a.slice(e,e+5),n=await Promise.all(t.map((e=>ghGet(`${API}/pulls/${e}`,args.token).then((e=>({pr:e}))).catch((t=>({error:t,number:e}))))));i.push(...n.filter((e=>e.pr)).map((e=>e.pr))),c.push(...n.filter((e=>e.error)).map((e=>e.error)))}if(0===i.length&&c.length>0)throw c[0];c.length>0&&console.error(`Warning: failed to fetch ${c.length} PR(s).`);const l=[];let u=0,m=0;for(const e of i){const t=getSkipReason(e);if(t){console.error(` skip [${t}] #${e.number}: ${e.title}`),m++;continue}const n=shouldForceIncludeAsBeta(e)?"Beta":getSection(e);console.error(` include [${n}] #${e.number}: ${e.title}`),l.push({...e,section:n}),u++}const h=buildReleaseSections(l);console.error(`\nSummary: ${u} included, ${m} skipped.\n`);const p=inferNextReleaseTag(e,t),f="HEAD"!==t&&/^v\d/.test(t)?t:p||`changes through ${t}`,g="HEAD"!==t&&/^v\d/.test(t)?`${GH_RELEASE_URL}/${t}`:`${GH_COMPARE_URL}/${e}...${o.sha}`,d="announcement"===args.format?formatAnnouncement({prs:l,releaseLabel:f,releaseUrl:g,sections:h}):formatReleaseNotes(h);args.output?(writeFileSync(args.output,`${d}\n`,"utf8"),console.error(`Release notes written to ${args.output}`)):process.stdout.write(`${d}\n`);const $=!1===args.changelog||"announcement"===args.format?null:args.changelog||(args.output?null:"CHANGELOG.md");$&&updateChangelog($,args.version||(/^v?\d+\.\d+\.\d+$/i.test(t)?t:"X.X.X"),d)})().catch((e=>{console.error(e.message||e),process.exit(1)}));
|
|
1
|
+
import{existsSync,readdirSync,readFileSync,statSync,writeFileSync}from"fs";import{join}from"path";import{formatReleaseSentence,getSkipReason,isTypeScriptChange}from"./release-notes-utils";const OWNER="grommet",REPO="grommet",API=`https://api.github.com/repos/${OWNER}/${REPO}`,GH_PR_URL=`https://github.com/${OWNER}/${REPO}/pull`,GH_RELEASE_URL=`https://github.com/${OWNER}/${REPO}/releases/tag`,GH_COMPARE_URL=`https://github.com/${OWNER}/${REPO}/compare`,DEFAULT_CHANGELOG_FILE="CHANGELOG.md",PLACEHOLDER_VERSION="X.X.X",LABEL_SECTION_MAP=new Map([["DataTable","DataTable"],["DateInput","DateInput"],["DateTimeInput","DateTimeInput"],["TimeInput","TimeInput"],["FileInput","FileInput"],["Select","Select / SelectMultiple"],["SelectMultiple","Select / SelectMultiple"],["List","List"],["RadioButton","RadioButton / RadioButtonGroup"],["RadioButtonGroup","RadioButton / RadioButtonGroup"],["RangeSelector","RangeSelector"],["TypeScript","TypeScript"],["typescript","TypeScript"],["Beta","Beta"],["beta","Beta"],["Calendar","Calendar"],["TextInput","TextInput"],["MaskedInput","MaskedInput"],["Notification","Notification"],["Layer","Layer"],["Button","Button"],["Form","Form"],["FormField","FormField"],["Stepper","Stepper"],["Wizard","Wizard"],["Tabs","Tabs"],["Pagination","Pagination"],["Menu","Menu"],["Anchor","Anchor"],["CheckBox","CheckBox / CheckBoxGroup"],["CheckBoxGroup","CheckBoxGroup / CheckBox"],["Data","Data"],["DataChart","Chart / DataChart"],["Chart","Chart / DataChart"],["DataFilter","DataFilter"]]),SECTION_ORDER=["General","Anchor","Button","Calendar","Chart / DataChart","CheckBox","Data","DataFilter","DataTable","DateInput","DateTimeInput","FileInput","Form","FormField","Layer","List","MaskedInput","Menu","Notification","Pagination","RadioButton / RadioButtonGroup","RangeSelector","Select / SelectMultiple","Stepper","Tabs","TextInput","TimeInput","TypeScript","Beta"],BETA_LABELS=new Set(["beta","Beta"]),DEFAULT_BETA_COMPONENT_SECTIONS=new Set(["DateTimeInput","Stepper","TimeInput","Wizard"]),MIN_COMPONENT_SECTION_SIZE=3,BETA_WARNING_PATTERN=/currently in beta[\s\S]*api is subject\s+to\s+change/i;function getSourceBetaComponentSections(){const e=join(process.cwd(),"src","js","components");if(!existsSync(e))return new Set;const t=new Set,n=readdirSync(e);for(const o of n){const n=join(e,o);if(!statSync(n).isDirectory())continue;const r=join(n,`${o}.js`);if(existsSync(r))try{const e=readFileSync(r,"utf8");BETA_WARNING_PATTERN.test(e)&&t.add(o)}catch{}}return t}const BETA_COMPONENT_SECTIONS=new Set([...Array.from(DEFAULT_BETA_COMPONENT_SECTIONS),...Array.from(getSourceBetaComponentSections())]);function parseArgs(){const e=process.argv.slice(2),t={from:null,to:null,format:(process.argv[1]||"").includes("announcement")?"announcement":"release-notes",output:null,changelog:null,version:null,token:process.env.GH_TOKEN||null};for(let n=0;n<e.length;n++){const o=e[n];if("--from"===o)t.from=e[++n];else if("--to"===o)t.to=e[++n];else if("--format"===o)t.format=e[++n];else if("--output"===o)t.output=e[++n];else if("--changelog"===o){const o=e[n+1];t.changelog=o&&!o.startsWith("--")?e[++n]:"CHANGELOG.md"}else"--no-changelog"===o?t.changelog=!1:"--version"===o?t.version=e[++n]:"--token"===o?t.token=e[++n]:o.startsWith("--")||t.from?o.startsWith("--")||t.to||(t.to=o):t.from=o}return t}function getRequestHeaders(e){return{...e?{Authorization:`Bearer ${e}`}:{},Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}}async function ghGet(e,t){const n=await fetch(e,{headers:getRequestHeaders(t)});if(!n.ok){const t=await n.text();if(403===n.status&&t.includes("API rate limit exceeded"))throw new Error("GitHub API rate limit exceeded. Set GH_TOKEN or pass --token to generate release output.");throw new Error(`GitHub API ${n.status} at ${e}:\n${t}`)}return n.json()}async function resolveRef(e,t){if(!e||"HEAD"===e){const e=await ghGet(`${API}`,t),n=await ghGet(`${API}/branches/${e.default_branch}`,t);return{sha:n.commit.sha,date:n.commit.commit.committer.date}}try{const n=await ghGet(`${API}/git/refs/tags/${e}`,t);let{sha:o}=n.object;return"tag"===n.object.type&&(o=(await ghGet(`${API}/git/tags/${o}`,t)).object.sha),{sha:o,date:(await ghGet(`${API}/commits/${o}`,t)).commit.committer.date}}catch{const n=await ghGet(`${API}/commits/${e}`,t);return{sha:n.sha,date:n.commit.committer.date}}}async function getLatestTag(e){const t=await ghGet(`${API}/tags?per_page=5`,e);if(!t.length)throw new Error("No tags found in repository.");return t[0].name}function getSection(e){const t=e.labels.map(e=>e.name);if(isTypeScriptChange(e))return"TypeScript";if(t.some(e=>BETA_LABELS.has(e)))return"Beta";for(const e of t){const t=LABEL_SECTION_MAP.get(e);if(t)return t}const n=e.title.match(/^[A-Za-z]+\(([^)]+)\):/);if(n){const e=n[1].trim();for(const[t,n]of LABEL_SECTION_MAP)if(t.toLowerCase()===e.toLowerCase())return n}const o=e.title.toLowerCase();for(const[e,t]of LABEL_SECTION_MAP){const n=e.toLowerCase();if(o.startsWith(`${n} `)||o.startsWith(`${n}:`)||o.startsWith(`${n}-`)||o.startsWith(`${n},`))return t}return"General"}function formatEntry(e){return`- ${formatReleaseSentence(e).replace(/[.!?]+$/,"")}. ([#${e.number}](${GH_PR_URL}/${e.number}))`}function formatTitlePhrase(e){const t=e.trim().replace(/[.!?]+$/,"");return t.charAt(0).toLowerCase()+t.slice(1)}function humanJoin(e){return 0===e.length?"":1===e.length?e[0]:2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function unique(e){return e.filter((t,n)=>t&&e.indexOf(t)===n)}function getAnnouncementHighlights(e){const t=[/^added\b/i,/^enhanced\b/i,/^improved\b/i];return e.filter(e=>t.some(t=>t.test(e.title))).slice(0,2).map(e=>formatTitlePhrase(e.title))}function getFixSummary(e){const t=unique(e.filter(e=>/^fixed\b/i.test(e.title)).map(e=>e.section).filter(e=>e&&"General"!==e&&"Beta"!==e));if(0===t.length)return null;const n=t.slice(0,5),o=t.length>5?", and more":"";return`There are also fixes across ${humanJoin(n)}${o}.`}function formatContributors(e){const t=unique(e.map(e=>e.user?.login).filter(e=>e&&"app/dependabot"!==e));return 0===t.length?null:`Thank you to everyone who contributed to this release ${humanJoin(t.map(e=>`<https://github.com/${e}|${e}>`))}!`}function inferNextReleaseTag(e,t){if(t&&/^v\d+\.\d+\.\d+$/i.test(t))return t;const n=(e||"").match(/^v(\d+)\./i);return n?`v${n[1]}.x.x`:"v2.x.x"}function extractComponentName(e){const t=(e.title||"").trim(),n=t.match(/^[A-Za-z]+\(([^)]+)\):/);if(n)return n[1].trim();const o=t.match(/^([A-Za-z][A-Za-z0-9]+)/);return o?o[1].trim():null}function inferComponentFromText(e){const t=e.title||"";for(const[e,n]of LABEL_SECTION_MAP)if(new RegExp(`\\b${e}\\b`,"i").test(t))return n;return null}function resolveHighlightComponent(e){return e.section&&"General"!==e.section?e.section:extractComponentName(e)||inferComponentFromText(e)||e.section}function getFixComponents(e){const t=[];for(const n of e){const e=(n.title||"").toLowerCase();if(!/\bfix(e[ds])?\b/.test(e))continue;const o=resolveHighlightComponent(n);o&&"General"!==o&&"Beta"!==o&&(t.includes(o)||t.push(o))}return t}function getEnhancementComponents(e){const t=[];for(const n of e){const e=(n.title||"").toLowerCase();if(/\bfix(e[ds])?\b/.test(e))continue;const o=resolveHighlightComponent(n);o&&"General"!==o&&"Beta"!==o&&(t.includes(o)||t.push(o))}return t}function formatBetaDescription(e){const t=(e.title||"").trim().replace(/[.!?]+$/,"").toLowerCase(),n=extractComponentName(e)||"Component";return/feat\(|\badd\b/.test(t)?`${n} - allows you to guide users through multi-step forms.`:/fix/.test(t)?`${n} - includes important bug fixes.`:`${n} - includes beta updates.`}function getNewBetaComponentLines(e){const t=e.filter(e=>{const t=(e.title||"").toLowerCase();return!("Beta"!==e.section||!t.startsWith("feat(")&&(!t.startsWith("add")||!t.includes("component")))}),n=new Set,o=[];for(const e of t){const t=extractComponentName(e);t&&!n.has(t.toLowerCase())&&(n.add(t.toLowerCase()),o.push(`- **${t}** - allows you to guide users through multi-step forms.`))}return o}function normalizeSection(e){return BETA_COMPONENT_SECTIONS.has(e)?"Beta":e}function mentionsBetaComponent(e){const t=`${e.title||""}\n${e.body||""}`.toLowerCase();return Array.from(BETA_COMPONENT_SECTIONS).some(e=>t.includes(e.toLowerCase()))}function shouldForceIncludeAsBeta(e){return!isTypeScriptChange(e)&&(!!mentionsBetaComponent(e)||"Beta"===normalizeSection(getSection(e)))}function buildReleaseSections(e){const t=new Map(SECTION_ORDER.map(e=>[e,[]])),n=new Map;for(const t of e){const e=normalizeSection(t.section);n.set(e,(n.get(e)||0)+1)}for(const o of e){const e=normalizeSection(o.section);let r=e;!("General"===e||"Beta"===e||"TypeScript"===e)&&(n.get(e)||0)<3&&(r="General"),t.has(r)||t.set(r,[]),t.get(r).push(formatEntry(o))}return t}function buildSectionOrder(e){const t=new Set(SECTION_ORDER),n=Array.from(e.keys()).filter(e=>!t.has(e)).sort();return[...SECTION_ORDER.slice(0,-2),...n,...SECTION_ORDER.slice(-2)]}function formatReleaseNotes(e){const t=buildSectionOrder(e),n=[];for(const o of t){const t=e.get(o);if(!t||0===t.length)continue;const r="Beta"===o?"Beta - APIs are subject to change:":`${o}:`;n.push({heading:r,entries:t})}const o=[];if(1===n.length&&"General:"===n[0].heading)for(const e of n[0].entries)o.push(e);else for(const{heading:e,entries:t}of n){o.push(e),o.push("");for(const e of t)o.push(e);o.push("")}return o.join("\n").trim()}function normalizeVersionHeading(e){return String(e).trim().replace(/^v/i,"")}function updateChangelog(e,t,n){const o=`# ${normalizeVersionHeading(t)}`,r=`${o}\n\n${n}\n`,s=existsSync(e)?readFileSync(e,"utf8"):"",a=s.split("\n"),i=a.findIndex(e=>e.trim()===o);let c;if(-1===i)c=`${r}\n${s}`;else{let e=i+1;for(;e<a.length&&!/^# /.test(a[e]);)e+=1;const t=a.slice(0,i).join("\n");c=`${t&&!t.endsWith("\n")?`${t}\n`:t}${r}\n${a.slice(e).join("\n")}`}writeFileSync(e,c,"utf8"),console.error(`Changelog updated at ${e} under "${o}".`)}function describeHighlightGroup(e,t,n,o){return 0===e.length?null:1===e.length?`${o} ${t} to ${e[0]}`:`${n} to ${humanJoin(e)}`}function formatAnnouncement(e){const t=getFixComponents(e.prs),n=getEnhancementComponents(e.prs),o=getNewBetaComponentLines(e.prs),r=[describeHighlightGroup(t,"fix","fixes","a"),describeHighlightGroup(n,"enhancement","enhancements","an")].filter(Boolean),s=r.length>0?`This release included ${r.join(" as well as ")}. Check out the full <${e.releaseUrl}|release notes> for details.`:`Check out the full <${e.releaseUrl}|release notes> for details.`,a=[`Grommet ${e.releaseLabel} is released`,"",s];return o.length>0&&(a.push(""),a.push("**New BETA components** *(APIs are subject to change)*:"),a.push(""),a.push(...o)),a.join("\n").trim()}const args=parseArgs();(async()=>{let e=args.from;e||(e=await getLatestTag(args.token),console.error(`Auto-detected --from: ${e}`));const t=args.to||"HEAD";console.error(`Resolving refs: ${e} → ${t}`);const n=await resolveRef(e,args.token),o=await resolveRef(t,args.token);console.error(`Fetching commits between ${e} and ${t}...`);const r=await ghGet(`${API}/compare/${n.sha}...${o.sha}`,args.token);if(r.total_commits>r.commits.length)throw new Error(`Compare API returned only ${r.commits.length} of ${r.total_commits} commits. The release range is too large; please choose a smaller range or switch to a paginated strategy.`);const s=new Set;for(const e of r.commits){const t=e.commit.message.matchAll(/#(\d+)/g);for(const e of t)s.add(Number(e[1]))}0===s.size?console.error("No PR references found in commits. Output will be empty."):console.error(`Found ${s.size} PR reference(s) in commits.`);const a=Array.from(s),i=[],c=[];for(let e=0;e<a.length;e+=5){const t=a.slice(e,e+5),n=await Promise.all(t.map(e=>ghGet(`${API}/pulls/${e}`,args.token).then(e=>({pr:e})).catch(t=>({error:t,number:e}))));i.push(...n.filter(e=>e.pr).map(e=>e.pr)),c.push(...n.filter(e=>e.error).map(e=>e.error))}if(0===i.length&&c.length>0)throw c[0];c.length>0&&console.error(`Warning: failed to fetch ${c.length} PR(s).`);const l=[];let u=0,m=0;for(const e of i){const t=getSkipReason(e);if(t){console.error(` skip [${t}] #${e.number}: ${e.title}`),m++;continue}const n=shouldForceIncludeAsBeta(e)?"Beta":getSection(e);console.error(` include [${n}] #${e.number}: ${e.title}`),l.push({...e,section:n}),u++}const h=buildReleaseSections(l);console.error(`\nSummary: ${u} included, ${m} skipped.\n`);const p=inferNextReleaseTag(e,t),f="HEAD"!==t&&/^v\d/.test(t)?t:p||`changes through ${t}`,g="HEAD"!==t&&/^v\d/.test(t)?`${GH_RELEASE_URL}/${t}`:`${GH_COMPARE_URL}/${e}...${o.sha}`,d="announcement"===args.format?formatAnnouncement({prs:l,releaseLabel:f,releaseUrl:g,sections:h}):formatReleaseNotes(h);args.output?(writeFileSync(args.output,`${d}\n`,"utf8"),console.error(`Release notes written to ${args.output}`)):process.stdout.write(`${d}\n`);const $=!1===args.changelog||"announcement"===args.format?null:args.changelog||(args.output?null:"CHANGELOG.md");$&&updateChangelog($,args.version||(/^v?\d+\.\d+\.\d+$/i.test(t)?t:"X.X.X"),d)})().catch(e=>{console.error(e.message||e),process.exit(1)});
|
package/tools/license-header.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const fs=require("fs"),path=require("path"),{execFileSync}=require("child_process"),HEADER="// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP\n// SPDX-License-Identifier: Apache-2.0\n",ROOTS=["src","e2e","storybook","tools"],EXTENSIONS=new Set([".js",".jsx",".ts",".tsx",".mjs",".cjs"]),EXCLUDED_DIRS=new Set(["node_modules","dist","coverage",".git",".yarn","storybook-static","__snapshots__"]);function isIncluded(e){return!e.endsWith(".snap")&&EXTENSIONS.has(path.extname(e))}function collectStagedFiles(){return execFileSync("git",["diff","--cached","--name-only","--diff-filter=ACMR"],{encoding:"utf8"}).split("\n").map(
|
|
2
|
+
const fs=require("fs"),path=require("path"),{execFileSync}=require("child_process"),HEADER="// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP\n// SPDX-License-Identifier: Apache-2.0\n",ROOTS=["src","e2e","storybook","tools"],EXTENSIONS=new Set([".js",".jsx",".ts",".tsx",".mjs",".cjs"]),EXCLUDED_DIRS=new Set(["node_modules","dist","coverage",".git",".yarn","storybook-static","__snapshots__"]);function isIncluded(e){return!e.endsWith(".snap")&&EXTENSIONS.has(path.extname(e))}function collectStagedFiles(){return execFileSync("git",["diff","--cached","--name-only","--diff-filter=ACMR"],{encoding:"utf8"}).split("\n").map(e=>e.trim()).filter(Boolean).filter(e=>ROOTS.some(t=>e===t||e.startsWith(`${t}/`))).filter(e=>isIncluded(e)).filter(e=>fs.existsSync(e))}function collectFiles(e,t){if(!fs.existsSync(e))return;const s=fs.statSync(e);s.isDirectory()?fs.readdirSync(e,{withFileTypes:!0}).forEach(s=>{s.isDirectory()&&EXCLUDED_DIRS.has(s.name)||collectFiles(path.join(e,s.name),t)}):s.isFile()&&isIncluded(e)&&t.push(e)}function buildExpected(e){let t="",s=e;if(e.startsWith("#!")){const i=e.indexOf("\n");t=-1===i?`${e}\n`:e.slice(0,i+1),s=-1===i?"":e.slice(i+1)}const i=s.split("\n");let n=0;for(;n<i.length&&/^\/\/\s*SPDX-/i.test(i[n]);)n+=1;n>0&&""===i[n]?.trim()&&(n+=1);const c=i.slice(n),l=/^\s*(['"])use [\w-]+\1;?\s*$/.test(c[0]??"");return`${t}${HEADER}${l?"\n":""}${c.join("\n")}`}function main(){const e=process.argv.slice(2),t=e.includes("--check"),s=e.includes("--staged"),i=e.filter(e=>!e.startsWith("--"));let n;if(s)n=collectStagedFiles();else{const e=i.length>0?i:ROOTS;n=[],e.forEach(e=>collectFiles(e,n))}const c=[];if(n.forEach(e=>{const s=fs.readFileSync(e,"utf8"),i=buildExpected(s);i!==s&&(c.push(e),t||fs.writeFileSync(e,i))}),s&&!t&&c.length>0&&execFileSync("git",["add","--",...c]),t)return c.length>0&&(console.error(`License header check failed: ${c.length} file(s) missing or with an incorrect SPDX header.`),c.forEach(e=>console.error(` ${e}`)),console.error('\nRun "yarn license" to fix the headers.'),process.exit(1)),void console.log(`License header check passed (${n.length} file(s)).`);c.length>0?console.log(`Updated SPDX header in ${c.length} file(s).`):console.log(`All ${n.length} file(s) already compliant.`)}main();
|
package/tools/pack.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import path from"path";import del from"del";import fs from"fs";import cp from"child_process";import tarball from"tarball-extract";const packageJSON=path.resolve(__dirname,"../package.json"),packageJSONAsString=fs.readFileSync(packageJSON),json=JSON.parse(packageJSONAsString);json.dependencies&&(json.bundledDependencies=Object.keys(json.dependencies),fs.writeFileSync(packageJSON,JSON.stringify(json,null,2)));try{cp.exec("npm pack",
|
|
1
|
+
import path from"path";import del from"del";import fs from"fs";import cp from"child_process";import tarball from"tarball-extract";const packageJSON=path.resolve(__dirname,"../package.json"),packageJSONAsString=fs.readFileSync(packageJSON),json=JSON.parse(packageJSONAsString);json.dependencies&&(json.bundledDependencies=Object.keys(json.dependencies),fs.writeFileSync(packageJSON,JSON.stringify(json,null,2)));try{cp.exec("npm pack",e=>{if(e)throw e;const n={name:json.name,version:json.version,dependencies:{licenseNotFound:[]}},s=`${json.name}-${json.version}.tgz`;tarball.extractTarball(s,"./tmp",e=>{if(e)throw e;fs.renameSync(path.resolve(__dirname,`../${s}`),path.resolve(__dirname,`../${json.name}-${json.version}-src-with-dependecies.tgz`)),fs.readdirSync(path.resolve(__dirname,"../tmp/package/node_modules")).forEach(e=>{const s=path.resolve(__dirname,`../node_modules/${e}/package.json`);if(fs.existsSync(s)){const a=fs.readFileSync(s),r=JSON.parse(a);let i=r.license;!i&&r.licenses&&(i=r.licenses[0]),i?i.type?n.dependencies[e]=i.type:n.dependencies[e]=i:n.dependencies.licenseNotFound.push(e)}});const a=path.resolve(__dirname,`../${json.name}-${json.version}-licenses.json`);fs.writeFileSync(a,JSON.stringify(n,null,2)),fs.writeFileSync(packageJSON,`${JSON.stringify(JSON.parse(packageJSONAsString),null,2)}\n`),del.sync(["./tmp"])})})}catch(e){console.log(e),fs.writeFileSync(packageJSON,`${JSON.stringify(JSON.parse(packageJSONAsString),null,2)}\n`)}
|