From 250ad0dd71c98eca3dab2b114b7828077101021d Mon Sep 17 00:00:00 2001 From: Marcus Notheis Date: Mon, 5 Feb 2024 17:26:39 +0100 Subject: [PATCH] feat: update `@ui5/webcomponents` to `~1.22.0` (#5219) And create a new (private) `cli` package which exposes our wrapper creation script to third-party web component libraries mid term. --------- Co-authored-by: Lukas Harbarth --- .eslintignore | 3 + .github/workflows/test-web-components.yml | 34 -- .storybook/components/DocsHeader.tsx | 2 +- package.json | 13 +- packages/base/package.json | 2 +- packages/charts/package.json | 4 +- packages/cli/.gitignore | 2 + packages/cli/package.json | 39 ++ packages/cli/src/bin/index.ts | 55 +++ .../create-wrappers/AbstractRenderer.ts | 19 + .../create-wrappers/AttributesRenderer.ts | 102 ++++++ .../create-wrappers/ComponentRenderer.ts | 99 +++++ .../scripts/create-wrappers/DomRefRenderer.ts | 167 +++++++++ .../create-wrappers/ExportsRenderer.ts | 14 + .../create-wrappers/ImportsRenderer.ts | 59 +++ .../create-wrappers/PropTypesRenderer.ts | 181 ++++++++++ .../create-wrappers/WebComponentWrapper.ts | 106 ++++++ .../cli/src/scripts/create-wrappers/main.ts | 83 +++++ packages/cli/src/util/cem-reader.ts | 23 ++ packages/cli/src/util/formatters.ts | 86 +++++ .../cli/src/util/recursiveManifestResolver.ts | 88 +++++ packages/cli/src/util/referenceResolver.ts | 51 +++ packages/cli/tsconfig.json | 18 + .../test/UI5WebComponentsChild.cy.tsx | 75 ++-- packages/main/package.json | 8 +- .../main/src/components/ActionSheet/index.tsx | 2 +- .../main/src/components/Modals/Modals.cy.tsx | 2 +- packages/main/src/components/Modals/index.tsx | 2 +- .../components/Toolbar/OverflowPopover.tsx | 6 +- .../src/components/Toolbar/Toolbar.cy.tsx | 3 +- .../main/src/internal/withWebComponent.tsx | 2 +- packages/main/src/types/index.ts | 4 +- .../src/webComponents/Avatar/Avatar.cy.tsx | 11 - .../webComponents/Avatar/Avatar.stories.mdx | 3 - .../webComponents/Avatar/AvatarDescription.md | 4 - .../main/src/webComponents/Avatar/index.tsx | 58 ++- .../AvatarGroup/AvatarGroup.cy.tsx | 16 - .../AvatarGroup/AvatarGroup.stories.mdx | 3 - .../AvatarGroup/AvatarGroupDescription.md | 33 -- .../src/webComponents/AvatarGroup/index.tsx | 59 ++- .../main/src/webComponents/Badge/Badge.cy.tsx | 11 - .../src/webComponents/Badge/Badge.stories.mdx | 3 - .../webComponents/Badge/BadgeDescription.md | 5 - .../main/src/webComponents/Badge/index.tsx | 63 +++- .../main/src/webComponents/Bar/Bar.cy.tsx | 15 - .../src/webComponents/Bar/Bar.stories.mdx | 3 - .../src/webComponents/Bar/BarDescription.md | 21 -- packages/main/src/webComponents/Bar/index.tsx | 36 +- .../BarcodeScannerDialog.cy.tsx | 11 - .../BarcodeScannerDialog/index.tsx | 14 +- .../Breadcrumbs/Breadcrumbs.cy.tsx | 16 - .../webComponents/Breadcrumbs/Breadcrumbs.mdx | 8 +- .../Breadcrumbs/BreadcrumbsDescription.md | 13 - .../src/webComponents/Breadcrumbs/index.tsx | 33 +- .../BreadcrumbsItem/BreadcrumbsItem.cy.tsx | 11 - .../BreadcrumbsItemDescription.md | 4 - .../webComponents/BreadcrumbsItem/index.tsx | 17 +- .../BusyIndicator/BusyIndicator.cy.tsx | 11 - .../BusyIndicator/BusyIndicator.mdx | 3 - .../BusyIndicator/BusyIndicatorDescription.md | 17 - .../src/webComponents/BusyIndicator/index.tsx | 39 +- .../src/webComponents/Button/Button.cy.tsx | 10 - .../main/src/webComponents/Button/Button.mdx | 3 - .../webComponents/Button/ButtonDescription.md | 14 - .../main/src/webComponents/Button/index.tsx | 46 ++- .../webComponents/Calendar/Calendar.cy.tsx | 11 - .../src/webComponents/Calendar/Calendar.mdx | 8 +- .../Calendar/CalendarDescription.md | 60 ---- .../main/src/webComponents/Calendar/index.tsx | 129 +++++-- .../CalendarDate/CalendarDate.cy.tsx | 11 - .../CalendarDate/CalendarDateDescription.md | 3 - .../src/webComponents/CalendarDate/index.tsx | 7 +- .../main/src/webComponents/Card/Card.cy.tsx | 11 - packages/main/src/webComponents/Card/Card.mdx | 6 +- .../src/webComponents/Card/CardDescription.md | 3 - .../main/src/webComponents/Card/index.tsx | 15 +- .../CardHeader/CardHeader.cy.tsx | 11 - .../CardHeader/CardHeaderDescription.md | 17 - .../src/webComponents/CardHeader/index.tsx | 23 +- .../webComponents/Carousel/Carousel.cy.tsx | 11 - .../Carousel/Carousel.stories.mdx | 3 - .../Carousel/CarouselDescription.md | 31 -- .../main/src/webComponents/Carousel/index.tsx | 81 +++-- .../webComponents/CheckBox/CheckBox.cy.tsx | 11 - .../CheckBox/CheckBox.stories.mdx | 3 - .../CheckBox/CheckBoxDescription.md | 19 - .../main/src/webComponents/CheckBox/index.tsx | 50 ++- .../ColorPalette/ColorPalette.cy.tsx | 11 - .../ColorPalette/ColorPalette.mdx | 8 +- .../ColorPalette/ColorPaletteDescription.md | 3 - .../src/webComponents/ColorPalette/index.tsx | 10 +- .../ColorPaletteItem/ColorPaletteItem.cy.tsx | 11 - .../ColorPaletteItemDescription.md | 4 - .../webComponents/ColorPaletteItem/index.tsx | 11 +- .../ColorPalettePopover.cy.tsx | 11 - .../ColorPalettePopover.mdx | 8 +- .../ColorPalettePopoverDescription.md | 3 - .../ColorPalettePopover/index.tsx | 36 +- .../ColorPicker/ColorPicker.cy.tsx | 11 - .../ColorPicker/ColorPicker.stories.mdx | 3 - .../ColorPicker/ColorPickerDescription.md | 9 - .../src/webComponents/ColorPicker/index.tsx | 15 +- .../webComponents/ComboBox/ComboBox.cy.tsx | 11 - .../src/webComponents/ComboBox/ComboBox.mdx | 11 +- .../ComboBox/ComboBoxDescription.md | 21 -- .../main/src/webComponents/ComboBox/index.tsx | 82 ++++- .../ComboBoxGroupItem.cy.tsx | 11 - .../ComboBoxGroupItemDescription.md | 4 - .../webComponents/ComboBoxGroupItem/index.tsx | 9 +- .../ComboBoxItem/ComboBoxItem.cy.tsx | 11 - .../ComboBoxItem/ComboBoxItemDescription.md | 3 - .../src/webComponents/ComboBoxItem/index.tsx | 10 +- .../CustomListItem/CustomListItem.cy.tsx | 11 - .../CustomListItemDescription.md | 13 - .../webComponents/CustomListItem/index.tsx | 34 +- .../DatePicker/DatePicker.cy.tsx | 11 - .../DatePicker/DatePicker.stories.mdx | 3 - .../DatePicker/DatePickerDescription.md | 46 --- .../src/webComponents/DatePicker/index.tsx | 176 ++++++--- .../DateRangePicker/DateRangePicker.cy.tsx | 11 - .../DateRangePicker.stories.mdx | 3 - .../DateRangePickerDescription.md | 3 - .../webComponents/DateRangePicker/index.tsx | 169 ++++++--- .../DateTimePicker/DateTimePicker.cy.tsx | 11 - .../DateTimePicker/DateTimePicker.stories.mdx | 3 - .../DateTimePickerDescription.md | 32 -- .../webComponents/DateTimePicker/index.tsx | 164 ++++++--- .../src/webComponents/Dialog/Dialog.cy.tsx | 11 - .../main/src/webComponents/Dialog/Dialog.mdx | 3 - .../webComponents/Dialog/DialogDescription.md | 19 - .../main/src/webComponents/Dialog/index.tsx | 144 +++++--- .../DynamicSideContent.cy.tsx | 40 --- .../DynamicSideContent.stories.mdx | 3 - .../DynamicSideContentDescription.md | 24 -- .../DynamicSideContent/index.tsx | 58 ++- .../FileUploader/FileUploader.cy.tsx | 11 - .../src/webComponents/FileUploader/index.tsx | 30 +- .../FilterItem/FilterItem.cy.tsx | 11 - .../FilterItem/FilterItemDescription.md | 6 - .../src/webComponents/FilterItem/index.tsx | 14 +- .../FilterItemOption/FilterItemOption.cy.tsx | 11 - .../FilterItemOptionDescription.md | 6 - .../webComponents/FilterItemOption/index.tsx | 11 +- .../FlexibleColumnLayout.cy.tsx | 11 - .../FlexibleColumnLayout.stories.mdx | 3 - .../FlexibleColumnLayoutDescription.md | 18 - .../FlexibleColumnLayout/index.tsx | 101 ++++-- .../GroupHeaderListItem.cy.tsx | 11 - .../GroupHeaderListItemDescription.md | 1 - .../GroupHeaderListItem/index.tsx | 12 +- .../main/src/webComponents/Icon/Icon.cy.tsx | 12 - .../src/webComponents/Icon/Icon.stories.mdx | 3 - .../src/webComponents/Icon/IconDescription.md | 47 --- .../main/src/webComponents/Icon/index.tsx | 62 +++- .../IllustratedMessage.cy.tsx | 11 - .../IllustratedMessage/IllustratedMessage.mdx | 3 - .../IllustratedMessageDescription.md | 12 - .../IllustratedMessage/index.tsx | 53 ++- .../main/src/webComponents/Input/Input.cy.tsx | 11 - .../main/src/webComponents/Input/Input.mdx | 11 +- .../webComponents/Input/InputDescription.md | 12 - .../main/src/webComponents/Input/index.tsx | 105 ++++-- .../main/src/webComponents/Label/Label.cy.tsx | 11 - .../main/src/webComponents/Label/index.tsx | 16 +- .../main/src/webComponents/Link/Link.cy.tsx | 11 - .../src/webComponents/Link/Link.stories.mdx | 3 - .../src/webComponents/Link/LinkDescription.md | 11 - .../main/src/webComponents/Link/index.tsx | 44 ++- .../main/src/webComponents/List/List.cy.tsx | 22 -- packages/main/src/webComponents/List/List.mdx | 14 +- .../src/webComponents/List/ListDescription.md | 18 - .../main/src/webComponents/List/index.tsx | 86 ++++- .../MediaGallery/MediaGallery.cy.tsx | 11 - .../MediaGallery/MediaGallery.mdx | 8 +- .../MediaGallery/MediaGalleryDescription.md | 9 - .../src/webComponents/MediaGallery/index.tsx | 54 ++- .../MediaGalleryItem/MediaGalleryItem.cy.tsx | 11 - .../MediaGalleryItemDescription.md | 11 - .../webComponents/MediaGalleryItem/index.tsx | 29 +- .../main/src/webComponents/Menu/Menu.cy.tsx | 11 - packages/main/src/webComponents/Menu/Menu.mdx | 9 +- .../src/webComponents/Menu/MenuDescription.md | 13 - .../main/src/webComponents/Menu/index.tsx | 73 +++- .../webComponents/MenuItem/MenuItem.cy.tsx | 11 - .../MenuItem/MenuItemDescription.md | 8 - .../main/src/webComponents/MenuItem/index.tsx | 33 +- .../MessageStrip/MessageStrip.cy.tsx | 11 - .../MessageStrip/MessageStrip.stories.mdx | 3 - .../MessageStrip/MessageStripDescription.md | 9 - .../src/webComponents/MessageStrip/index.tsx | 32 +- .../MultiComboBox/MultiComboBox.cy.tsx | 11 - .../MultiComboBox/MultiComboBox.mdx | 14 +- .../MultiComboBox/MultiComboBoxDescription.md | 29 -- .../src/webComponents/MultiComboBox/index.tsx | 97 +++-- .../MultiComboBoxGroupItem.cy.tsx | 11 - .../MultiComboBoxGroupItemDescription.md | 4 - .../MultiComboBoxGroupItem/index.tsx | 9 +- .../MultiComboBoxItem.cy.tsx | 11 - .../MultiComboBoxItemDescription.md | 3 - .../webComponents/MultiComboBoxItem/index.tsx | 20 +- .../MultiInput/MultiInput.cy.tsx | 11 - .../webComponents/MultiInput/MultiInput.mdx | 11 +- .../src/webComponents/MultiInput/index.tsx | 158 ++++---- .../NotificationAction.cy.tsx | 11 - .../NotificationActionDescription.md | 3 - .../NotificationAction/index.tsx | 22 +- .../NotificationListGroupItem.cy.tsx | 11 - .../NotificationListGroupItem.mdx | 8 +- .../NotificationListGroupItemDescription.md | 10 - .../NotificationListGroupItem/index.tsx | 78 ++-- .../NotificationListItem.cy.tsx | 20 -- .../NotificationListItem.mdx | 7 +- .../NotificationListItemDescription.md | 10 - .../NotificationListItem/index.tsx | 90 +++-- .../src/webComponents/Option/Option.cy.tsx | 11 - .../webComponents/Option/OptionDescription.md | 3 - .../main/src/webComponents/Option/index.tsx | 22 +- .../main/src/webComponents/Page/Page.cy.tsx | 11 - packages/main/src/webComponents/Page/Page.mdx | 3 - .../src/webComponents/Page/PageDescription.md | 20 -- .../main/src/webComponents/Page/index.tsx | 40 ++- .../main/src/webComponents/Panel/Panel.cy.tsx | 11 - .../src/webComponents/Panel/Panel.stories.mdx | 3 - .../webComponents/Panel/PanelDescription.md | 34 -- .../main/src/webComponents/Panel/index.tsx | 61 +++- .../src/webComponents/Popover/Popover.cy.tsx | 11 - .../webComponents/Popover/Popover.stories.mdx | 3 - .../Popover/PopoverDescription.md | 18 - .../main/src/webComponents/Popover/index.tsx | 167 +++++---- .../ProductSwitch/ProductSwitch.cy.tsx | 16 - .../ProductSwitch/ProductSwitch.mdx | 8 +- .../ProductSwitch/ProductSwitchDescription.md | 7 - .../src/webComponents/ProductSwitch/index.tsx | 20 +- .../ProductSwitchItem.cy.tsx | 11 - .../ProductSwitchItemDescription.md | 11 - .../webComponents/ProductSwitchItem/index.tsx | 20 +- .../ProgressIndicator.cy.tsx | 11 - .../ProgressIndicator.stories.mdx | 3 - .../ProgressIndicatorDescription.md | 3 - .../webComponents/ProgressIndicator/index.tsx | 27 +- .../RadioButton/RadioButton.cy.tsx | 11 - .../RadioButton/RadioButton.stories.mdx | 3 - .../RadioButton/RadioButtonDescription.md | 5 - .../src/webComponents/RadioButton/index.tsx | 36 +- .../RangeSlider/RangeSlider.cy.tsx | 11 - .../RangeSlider/RangeSlider.stories.mdx | 3 - .../RangeSlider/RangeSliderDescription.md | 47 --- .../src/webComponents/RangeSlider/index.tsx | 87 +++-- .../RatingIndicator/RatingIndicator.cy.tsx | 11 - .../RatingIndicator.stories.mdx | 3 - .../RatingIndicatorDescription.md | 19 - .../webComponents/RatingIndicator/index.tsx | 41 ++- .../ResponsivePopover.cy.tsx | 11 - .../ResponsivePopover.stories.mdx | 3 - .../ResponsivePopoverDescription.md | 12 - .../webComponents/ResponsivePopover/index.tsx | 157 +++++--- .../SegmentedButton/SegmentedButton.cy.tsx | 18 - .../SegmentedButton/SegmentedButton.mdx | 5 +- .../webComponents/SegmentedButton/index.tsx | 32 +- .../SegmentedButtonItem.cy.tsx | 11 - .../SegmentedButtonItemDescription.md | 5 - .../SegmentedButtonItem/index.tsx | 63 +++- .../src/webComponents/Select/Select.cy.tsx | 11 - .../main/src/webComponents/Select/Select.mdx | 17 +- .../webComponents/Select/SelectDescription.md | 19 - .../main/src/webComponents/Select/index.tsx | 88 +++-- .../SelectMenu/SelectMenu.cy.tsx | 11 - .../SelectMenu/SelectMenuDescription.md | 11 - .../src/webComponents/SelectMenu/index.tsx | 12 +- .../SelectMenuOption/SelectMenuOption.cy.tsx | 11 - .../SelectMenuOptionDescription.md | 7 - .../webComponents/SelectMenuOption/index.tsx | 72 +++- .../webComponents/ShellBar/ShellBar.cy.tsx | 11 - .../src/webComponents/ShellBar/ShellBar.mdx | 9 +- .../ShellBar/ShellBarDescription.md | 23 -- .../main/src/webComponents/ShellBar/index.tsx | 161 ++++++--- .../ShellBarItem/ShellBarItem.cy.tsx | 11 - .../ShellBarItem/ShellBarItemDescription.md | 3 - .../src/webComponents/ShellBarItem/index.tsx | 9 +- .../SideNavigation/SideNavigation.cy.tsx | 39 -- .../SideNavigation/SideNavigation.mdx | 11 +- .../SideNavigationDescription.md | 9 - .../webComponents/SideNavigation/index.tsx | 31 +- .../SideNavigationItem.cy.tsx | 11 - .../SideNavigationItemDescription.md | 4 - .../SideNavigationItem/index.tsx | 38 +- .../SideNavigationSubItem.cy.tsx | 11 - .../SideNavigationSubItemDescription.md | 4 - .../SideNavigationSubItem/index.tsx | 24 +- .../src/webComponents/Slider/Slider.cy.tsx | 11 - .../webComponents/Slider/Slider.stories.mdx | 3 - .../webComponents/Slider/SliderDescription.md | 45 --- .../main/src/webComponents/Slider/index.tsx | 74 +++- .../webComponents/SortItem/SortItem.cy.tsx | 11 - .../SortItem/SortItemDescription.md | 6 - .../main/src/webComponents/SortItem/index.tsx | 11 +- .../SplitButton/SplitButton.cy.tsx | 11 - .../SplitButton/SplitButton.stories.mdx | 3 - .../SplitButton/SplitButtonDescription.md | 20 -- .../src/webComponents/SplitButton/index.tsx | 49 ++- .../StandardListItem/StandardListItem.cy.tsx | 11 - .../StandardListItemDescription.md | 17 - .../webComponents/StandardListItem/index.tsx | 62 ++-- .../webComponents/StepInput/StepInput.cy.tsx | 11 - .../StepInput/StepInput.stories.mdx | 3 - .../StepInput/StepInputDescription.md | 14 - .../src/webComponents/StepInput/index.tsx | 61 +++- .../SuggestionGroupItem.cy.tsx | 11 - .../SuggestionGroupItemDescription.md | 4 - .../SuggestionGroupItem/index.tsx | 9 +- .../SuggestionItem/SuggestionItem.cy.tsx | 11 - .../SuggestionItemDescription.md | 3 - .../webComponents/SuggestionItem/index.tsx | 31 +- .../src/webComponents/Switch/Switch.cy.tsx | 11 - .../webComponents/Switch/Switch.stories.mdx | 3 - .../webComponents/Switch/SwitchDescription.md | 13 - .../main/src/webComponents/Switch/index.tsx | 27 +- .../main/src/webComponents/Tab/Tab.cy.tsx | 11 - .../src/webComponents/Tab/TabDescription.md | 3 - packages/main/src/webComponents/Tab/index.tsx | 36 +- .../TabContainer/TabContainer.cy.tsx | 16 - .../TabContainer/TabContainer.mdx | 11 +- .../TabContainer/TabContainerDescription.md | 24 -- .../src/webComponents/TabContainer/index.tsx | 80 +++-- .../TabSeparator/TabSeparator.cy.tsx | 11 - .../TabSeparator/TabSeparatorDescription.md | 3 - .../src/webComponents/TabSeparator/index.tsx | 15 +- .../main/src/webComponents/Table/Table.cy.tsx | 11 - .../main/src/webComponents/Table/Table.mdx | 18 +- .../webComponents/Table/TableDescription.md | 26 -- .../main/src/webComponents/Table/index.tsx | 108 ++++-- .../webComponents/TableCell/TableCell.cy.tsx | 11 - .../TableCell/TableCellDescription.md | 8 - .../src/webComponents/TableCell/index.tsx | 8 +- .../TableColumn/TableColumn.cy.tsx | 11 - .../TableColumn/TableColumnDescription.md | 8 - .../src/webComponents/TableColumn/index.tsx | 25 +- .../TableGroupRow/TableGroupRow.cy.tsx | 11 - .../TableGroupRow/TableGroupRowDescription.md | 10 - .../src/webComponents/TableGroupRow/index.tsx | 8 +- .../webComponents/TableRow/TableRow.cy.tsx | 11 - .../TableRow/TableRowDescription.md | 9 - .../main/src/webComponents/TableRow/index.tsx | 30 +- .../webComponents/TextArea/TextArea.cy.tsx | 11 - .../TextArea/TextArea.stories.mdx | 3 - .../TextArea/TextAreaDescription.md | 6 - .../main/src/webComponents/TextArea/index.tsx | 48 ++- .../TimePicker/TimePicker.cy.tsx | 11 - .../TimePicker/TimePicker.stories.mdx | 3 - .../TimePicker/TimePickerDescription.md | 40 --- .../src/webComponents/TimePicker/index.tsx | 112 ++++-- .../webComponents/Timeline/Timeline.cy.tsx | 11 - .../src/webComponents/Timeline/Timeline.mdx | 5 +- .../main/src/webComponents/Timeline/index.tsx | 18 +- .../TimelineItem/TimelineItem.cy.tsx | 11 - .../TimelineItem/TimelineItemDescription.md | 1 - .../src/webComponents/TimelineItem/index.tsx | 19 +- .../main/src/webComponents/Title/Title.cy.tsx | 11 - .../main/src/webComponents/Title/index.tsx | 19 +- .../main/src/webComponents/Toast/Toast.cy.tsx | 11 - .../src/webComponents/Toast/Toast.stories.mdx | 3 - .../webComponents/Toast/ToastDescription.md | 14 - .../main/src/webComponents/Toast/index.tsx | 32 +- .../ToggleButton/ToggleButton.cy.tsx | 11 - .../src/webComponents/ToggleButton/index.tsx | 50 +-- .../main/src/webComponents/Token/Token.cy.tsx | 11 - .../webComponents/Token/TokenDescription.md | 3 - .../main/src/webComponents/Token/index.tsx | 14 +- .../src/webComponents/Toolbar/Toolbar.mdx | 48 +++ .../Toolbar.stories.tsx} | 20 +- .../main/src/webComponents/Toolbar/index.tsx | 66 ++++ .../ToolbarButton/ToolbarButton.cy.tsx | 11 - .../ToolbarButton/ToolbarButtonDescription.md | 4 - .../src/webComponents/ToolbarButton/index.tsx | 67 ++-- .../ToolbarSelect/ToolbarSelect.cy.tsx | 11 - .../ToolbarSelect/ToolbarSelectDescription.md | 4 - .../src/webComponents/ToolbarSelect/index.tsx | 53 +-- .../ToolbarSelectOption.cy.tsx | 11 - .../ToolbarSelectOptionDescription.md | 4 - .../ToolbarSelectOption/index.tsx | 12 +- .../webComponents/ToolbarSeparator/index.tsx | 50 +++ .../ToolbarSeparatorV2.cy.tsx | 11 - .../ToolbarSeparatorV2Description.md | 4 - .../ToolbarSeparatorV2/index.tsx | 54 --- .../index.tsx | 46 ++- .../ToolbarSpacerV2/ToolbarSpacerV2.cy.tsx | 11 - .../ToolbarSpacerV2Description.md | 4 - .../webComponents/ToolbarV2/ToolbarV2.cy.tsx | 11 - .../src/webComponents/ToolbarV2/ToolbarV2.mdx | 61 ---- .../ToolbarV2/ToolbarV2Description.md | 6 - .../src/webComponents/ToolbarV2/index.tsx | 52 --- .../main/src/webComponents/Tree/Tree.cy.tsx | 11 - packages/main/src/webComponents/Tree/Tree.mdx | 12 +- .../src/webComponents/Tree/TreeDescription.md | 25 -- .../main/src/webComponents/Tree/index.tsx | 77 +++- .../webComponents/TreeItem/TreeItem.cy.tsx | 11 - .../TreeItem/TreeItemDescription.md | 13 - .../main/src/webComponents/TreeItem/index.tsx | 65 ++-- .../TreeItemCustom/TreeItemCustom.cy.tsx | 11 - .../TreeItemCustomDescription.md | 13 - .../webComponents/TreeItemCustom/index.tsx | 70 ++-- .../UploadCollection/UploadCollection.cy.tsx | 11 - .../UploadCollection/UploadCollection.mdx | 6 +- .../webComponents/UploadCollection/index.tsx | 35 +- .../UploadCollectionItem.cy.tsx | 11 - .../UploadCollectionItemDescription.md | 3 - .../UploadCollectionItem/index.tsx | 113 +++--- .../ViewSettingsDialog.cy.tsx | 11 - .../ViewSettingsDialog/ViewSettingsDialog.mdx | 10 - .../ViewSettingsDialogDescription.md | 7 - .../ViewSettingsDialog/index.tsx | 49 ++- .../src/webComponents/Wizard/Wizard.cy.tsx | 11 - .../main/src/webComponents/Wizard/Wizard.mdx | 9 +- .../webComponents/Wizard/WizardDescription.md | 70 ---- .../main/src/webComponents/Wizard/index.tsx | 78 +++- .../WizardStep/WizardStep.cy.tsx | 11 - .../WizardStep/WizardStepDescription.md | 15 - .../src/webComponents/WizardStep/index.tsx | 28 +- packages/main/src/webComponents/index.ts | 15 +- .../web-component-wrappers/version-info.json | 3 +- tsconfig.json | 3 + yarn.lock | 339 ++++++++++++++---- 422 files changed, 5673 insertions(+), 5109 deletions(-) delete mode 100644 .github/workflows/test-web-components.yml create mode 100644 packages/cli/.gitignore create mode 100644 packages/cli/package.json create mode 100755 packages/cli/src/bin/index.ts create mode 100644 packages/cli/src/scripts/create-wrappers/AbstractRenderer.ts create mode 100644 packages/cli/src/scripts/create-wrappers/AttributesRenderer.ts create mode 100644 packages/cli/src/scripts/create-wrappers/ComponentRenderer.ts create mode 100644 packages/cli/src/scripts/create-wrappers/DomRefRenderer.ts create mode 100644 packages/cli/src/scripts/create-wrappers/ExportsRenderer.ts create mode 100644 packages/cli/src/scripts/create-wrappers/ImportsRenderer.ts create mode 100644 packages/cli/src/scripts/create-wrappers/PropTypesRenderer.ts create mode 100644 packages/cli/src/scripts/create-wrappers/WebComponentWrapper.ts create mode 100644 packages/cli/src/scripts/create-wrappers/main.ts create mode 100644 packages/cli/src/util/cem-reader.ts create mode 100644 packages/cli/src/util/formatters.ts create mode 100644 packages/cli/src/util/recursiveManifestResolver.ts create mode 100644 packages/cli/src/util/referenceResolver.ts create mode 100644 packages/cli/tsconfig.json delete mode 100644 packages/main/src/webComponents/Avatar/Avatar.cy.tsx delete mode 100644 packages/main/src/webComponents/Avatar/AvatarDescription.md delete mode 100644 packages/main/src/webComponents/AvatarGroup/AvatarGroup.cy.tsx delete mode 100644 packages/main/src/webComponents/AvatarGroup/AvatarGroupDescription.md delete mode 100644 packages/main/src/webComponents/Badge/Badge.cy.tsx delete mode 100644 packages/main/src/webComponents/Badge/BadgeDescription.md delete mode 100644 packages/main/src/webComponents/Bar/Bar.cy.tsx delete mode 100644 packages/main/src/webComponents/Bar/BarDescription.md delete mode 100644 packages/main/src/webComponents/BarcodeScannerDialog/BarcodeScannerDialog.cy.tsx delete mode 100644 packages/main/src/webComponents/Breadcrumbs/Breadcrumbs.cy.tsx delete mode 100644 packages/main/src/webComponents/Breadcrumbs/BreadcrumbsDescription.md delete mode 100644 packages/main/src/webComponents/BreadcrumbsItem/BreadcrumbsItem.cy.tsx delete mode 100644 packages/main/src/webComponents/BreadcrumbsItem/BreadcrumbsItemDescription.md delete mode 100644 packages/main/src/webComponents/BusyIndicator/BusyIndicator.cy.tsx delete mode 100644 packages/main/src/webComponents/BusyIndicator/BusyIndicatorDescription.md delete mode 100644 packages/main/src/webComponents/Button/Button.cy.tsx delete mode 100644 packages/main/src/webComponents/Button/ButtonDescription.md delete mode 100644 packages/main/src/webComponents/Calendar/Calendar.cy.tsx delete mode 100644 packages/main/src/webComponents/Calendar/CalendarDescription.md delete mode 100644 packages/main/src/webComponents/CalendarDate/CalendarDate.cy.tsx delete mode 100644 packages/main/src/webComponents/CalendarDate/CalendarDateDescription.md delete mode 100644 packages/main/src/webComponents/Card/Card.cy.tsx delete mode 100644 packages/main/src/webComponents/Card/CardDescription.md delete mode 100644 packages/main/src/webComponents/CardHeader/CardHeader.cy.tsx delete mode 100644 packages/main/src/webComponents/CardHeader/CardHeaderDescription.md delete mode 100644 packages/main/src/webComponents/Carousel/Carousel.cy.tsx delete mode 100644 packages/main/src/webComponents/Carousel/CarouselDescription.md delete mode 100644 packages/main/src/webComponents/CheckBox/CheckBox.cy.tsx delete mode 100644 packages/main/src/webComponents/CheckBox/CheckBoxDescription.md delete mode 100644 packages/main/src/webComponents/ColorPalette/ColorPalette.cy.tsx delete mode 100644 packages/main/src/webComponents/ColorPalette/ColorPaletteDescription.md delete mode 100644 packages/main/src/webComponents/ColorPaletteItem/ColorPaletteItem.cy.tsx delete mode 100644 packages/main/src/webComponents/ColorPaletteItem/ColorPaletteItemDescription.md delete mode 100644 packages/main/src/webComponents/ColorPalettePopover/ColorPalettePopover.cy.tsx delete mode 100644 packages/main/src/webComponents/ColorPalettePopover/ColorPalettePopoverDescription.md delete mode 100644 packages/main/src/webComponents/ColorPicker/ColorPicker.cy.tsx delete mode 100644 packages/main/src/webComponents/ColorPicker/ColorPickerDescription.md delete mode 100644 packages/main/src/webComponents/ComboBox/ComboBox.cy.tsx delete mode 100644 packages/main/src/webComponents/ComboBox/ComboBoxDescription.md delete mode 100644 packages/main/src/webComponents/ComboBoxGroupItem/ComboBoxGroupItem.cy.tsx delete mode 100644 packages/main/src/webComponents/ComboBoxGroupItem/ComboBoxGroupItemDescription.md delete mode 100644 packages/main/src/webComponents/ComboBoxItem/ComboBoxItem.cy.tsx delete mode 100644 packages/main/src/webComponents/ComboBoxItem/ComboBoxItemDescription.md delete mode 100644 packages/main/src/webComponents/CustomListItem/CustomListItem.cy.tsx delete mode 100644 packages/main/src/webComponents/CustomListItem/CustomListItemDescription.md delete mode 100644 packages/main/src/webComponents/DatePicker/DatePicker.cy.tsx delete mode 100644 packages/main/src/webComponents/DatePicker/DatePickerDescription.md delete mode 100644 packages/main/src/webComponents/DateRangePicker/DateRangePicker.cy.tsx delete mode 100644 packages/main/src/webComponents/DateRangePicker/DateRangePickerDescription.md delete mode 100644 packages/main/src/webComponents/DateTimePicker/DateTimePicker.cy.tsx delete mode 100644 packages/main/src/webComponents/DateTimePicker/DateTimePickerDescription.md delete mode 100644 packages/main/src/webComponents/Dialog/Dialog.cy.tsx delete mode 100644 packages/main/src/webComponents/Dialog/DialogDescription.md delete mode 100644 packages/main/src/webComponents/DynamicSideContent/DynamicSideContent.cy.tsx delete mode 100644 packages/main/src/webComponents/DynamicSideContent/DynamicSideContentDescription.md delete mode 100644 packages/main/src/webComponents/FileUploader/FileUploader.cy.tsx delete mode 100644 packages/main/src/webComponents/FilterItem/FilterItem.cy.tsx delete mode 100644 packages/main/src/webComponents/FilterItem/FilterItemDescription.md delete mode 100644 packages/main/src/webComponents/FilterItemOption/FilterItemOption.cy.tsx delete mode 100644 packages/main/src/webComponents/FilterItemOption/FilterItemOptionDescription.md delete mode 100644 packages/main/src/webComponents/FlexibleColumnLayout/FlexibleColumnLayout.cy.tsx delete mode 100644 packages/main/src/webComponents/FlexibleColumnLayout/FlexibleColumnLayoutDescription.md delete mode 100644 packages/main/src/webComponents/GroupHeaderListItem/GroupHeaderListItem.cy.tsx delete mode 100644 packages/main/src/webComponents/GroupHeaderListItem/GroupHeaderListItemDescription.md delete mode 100644 packages/main/src/webComponents/Icon/Icon.cy.tsx delete mode 100644 packages/main/src/webComponents/Icon/IconDescription.md delete mode 100644 packages/main/src/webComponents/IllustratedMessage/IllustratedMessage.cy.tsx delete mode 100644 packages/main/src/webComponents/IllustratedMessage/IllustratedMessageDescription.md delete mode 100644 packages/main/src/webComponents/Input/Input.cy.tsx delete mode 100644 packages/main/src/webComponents/Input/InputDescription.md delete mode 100644 packages/main/src/webComponents/Label/Label.cy.tsx delete mode 100644 packages/main/src/webComponents/Link/Link.cy.tsx delete mode 100644 packages/main/src/webComponents/Link/LinkDescription.md delete mode 100644 packages/main/src/webComponents/List/List.cy.tsx delete mode 100644 packages/main/src/webComponents/List/ListDescription.md delete mode 100644 packages/main/src/webComponents/MediaGallery/MediaGallery.cy.tsx delete mode 100644 packages/main/src/webComponents/MediaGallery/MediaGalleryDescription.md delete mode 100644 packages/main/src/webComponents/MediaGalleryItem/MediaGalleryItem.cy.tsx delete mode 100644 packages/main/src/webComponents/MediaGalleryItem/MediaGalleryItemDescription.md delete mode 100644 packages/main/src/webComponents/Menu/Menu.cy.tsx delete mode 100644 packages/main/src/webComponents/Menu/MenuDescription.md delete mode 100644 packages/main/src/webComponents/MenuItem/MenuItem.cy.tsx delete mode 100644 packages/main/src/webComponents/MenuItem/MenuItemDescription.md delete mode 100644 packages/main/src/webComponents/MessageStrip/MessageStrip.cy.tsx delete mode 100644 packages/main/src/webComponents/MessageStrip/MessageStripDescription.md delete mode 100644 packages/main/src/webComponents/MultiComboBox/MultiComboBox.cy.tsx delete mode 100644 packages/main/src/webComponents/MultiComboBox/MultiComboBoxDescription.md delete mode 100644 packages/main/src/webComponents/MultiComboBoxGroupItem/MultiComboBoxGroupItem.cy.tsx delete mode 100644 packages/main/src/webComponents/MultiComboBoxGroupItem/MultiComboBoxGroupItemDescription.md delete mode 100644 packages/main/src/webComponents/MultiComboBoxItem/MultiComboBoxItem.cy.tsx delete mode 100644 packages/main/src/webComponents/MultiComboBoxItem/MultiComboBoxItemDescription.md delete mode 100644 packages/main/src/webComponents/MultiInput/MultiInput.cy.tsx delete mode 100644 packages/main/src/webComponents/NotificationAction/NotificationAction.cy.tsx delete mode 100644 packages/main/src/webComponents/NotificationAction/NotificationActionDescription.md delete mode 100644 packages/main/src/webComponents/NotificationListGroupItem/NotificationListGroupItem.cy.tsx delete mode 100644 packages/main/src/webComponents/NotificationListGroupItem/NotificationListGroupItemDescription.md delete mode 100644 packages/main/src/webComponents/NotificationListItem/NotificationListItem.cy.tsx delete mode 100644 packages/main/src/webComponents/NotificationListItem/NotificationListItemDescription.md delete mode 100644 packages/main/src/webComponents/Option/Option.cy.tsx delete mode 100644 packages/main/src/webComponents/Option/OptionDescription.md delete mode 100644 packages/main/src/webComponents/Page/Page.cy.tsx delete mode 100644 packages/main/src/webComponents/Page/PageDescription.md delete mode 100644 packages/main/src/webComponents/Panel/Panel.cy.tsx delete mode 100644 packages/main/src/webComponents/Panel/PanelDescription.md delete mode 100644 packages/main/src/webComponents/Popover/Popover.cy.tsx delete mode 100644 packages/main/src/webComponents/Popover/PopoverDescription.md delete mode 100644 packages/main/src/webComponents/ProductSwitch/ProductSwitch.cy.tsx delete mode 100644 packages/main/src/webComponents/ProductSwitch/ProductSwitchDescription.md delete mode 100644 packages/main/src/webComponents/ProductSwitchItem/ProductSwitchItem.cy.tsx delete mode 100644 packages/main/src/webComponents/ProductSwitchItem/ProductSwitchItemDescription.md delete mode 100644 packages/main/src/webComponents/ProgressIndicator/ProgressIndicator.cy.tsx delete mode 100644 packages/main/src/webComponents/ProgressIndicator/ProgressIndicatorDescription.md delete mode 100644 packages/main/src/webComponents/RadioButton/RadioButton.cy.tsx delete mode 100644 packages/main/src/webComponents/RadioButton/RadioButtonDescription.md delete mode 100644 packages/main/src/webComponents/RangeSlider/RangeSlider.cy.tsx delete mode 100644 packages/main/src/webComponents/RangeSlider/RangeSliderDescription.md delete mode 100644 packages/main/src/webComponents/RatingIndicator/RatingIndicator.cy.tsx delete mode 100644 packages/main/src/webComponents/RatingIndicator/RatingIndicatorDescription.md delete mode 100644 packages/main/src/webComponents/ResponsivePopover/ResponsivePopover.cy.tsx delete mode 100644 packages/main/src/webComponents/ResponsivePopover/ResponsivePopoverDescription.md delete mode 100644 packages/main/src/webComponents/SegmentedButton/SegmentedButton.cy.tsx delete mode 100644 packages/main/src/webComponents/SegmentedButtonItem/SegmentedButtonItem.cy.tsx delete mode 100644 packages/main/src/webComponents/SegmentedButtonItem/SegmentedButtonItemDescription.md delete mode 100644 packages/main/src/webComponents/Select/Select.cy.tsx delete mode 100644 packages/main/src/webComponents/Select/SelectDescription.md delete mode 100644 packages/main/src/webComponents/SelectMenu/SelectMenu.cy.tsx delete mode 100644 packages/main/src/webComponents/SelectMenu/SelectMenuDescription.md delete mode 100644 packages/main/src/webComponents/SelectMenuOption/SelectMenuOption.cy.tsx delete mode 100644 packages/main/src/webComponents/SelectMenuOption/SelectMenuOptionDescription.md delete mode 100644 packages/main/src/webComponents/ShellBar/ShellBar.cy.tsx delete mode 100644 packages/main/src/webComponents/ShellBar/ShellBarDescription.md delete mode 100644 packages/main/src/webComponents/ShellBarItem/ShellBarItem.cy.tsx delete mode 100644 packages/main/src/webComponents/ShellBarItem/ShellBarItemDescription.md delete mode 100644 packages/main/src/webComponents/SideNavigation/SideNavigation.cy.tsx delete mode 100644 packages/main/src/webComponents/SideNavigation/SideNavigationDescription.md delete mode 100644 packages/main/src/webComponents/SideNavigationItem/SideNavigationItem.cy.tsx delete mode 100644 packages/main/src/webComponents/SideNavigationItem/SideNavigationItemDescription.md delete mode 100644 packages/main/src/webComponents/SideNavigationSubItem/SideNavigationSubItem.cy.tsx delete mode 100644 packages/main/src/webComponents/SideNavigationSubItem/SideNavigationSubItemDescription.md delete mode 100644 packages/main/src/webComponents/Slider/Slider.cy.tsx delete mode 100644 packages/main/src/webComponents/Slider/SliderDescription.md delete mode 100644 packages/main/src/webComponents/SortItem/SortItem.cy.tsx delete mode 100644 packages/main/src/webComponents/SortItem/SortItemDescription.md delete mode 100644 packages/main/src/webComponents/SplitButton/SplitButton.cy.tsx delete mode 100644 packages/main/src/webComponents/SplitButton/SplitButtonDescription.md delete mode 100644 packages/main/src/webComponents/StandardListItem/StandardListItem.cy.tsx delete mode 100644 packages/main/src/webComponents/StandardListItem/StandardListItemDescription.md delete mode 100644 packages/main/src/webComponents/StepInput/StepInput.cy.tsx delete mode 100644 packages/main/src/webComponents/StepInput/StepInputDescription.md delete mode 100644 packages/main/src/webComponents/SuggestionGroupItem/SuggestionGroupItem.cy.tsx delete mode 100644 packages/main/src/webComponents/SuggestionGroupItem/SuggestionGroupItemDescription.md delete mode 100644 packages/main/src/webComponents/SuggestionItem/SuggestionItem.cy.tsx delete mode 100644 packages/main/src/webComponents/SuggestionItem/SuggestionItemDescription.md delete mode 100644 packages/main/src/webComponents/Switch/Switch.cy.tsx delete mode 100644 packages/main/src/webComponents/Switch/SwitchDescription.md delete mode 100644 packages/main/src/webComponents/Tab/Tab.cy.tsx delete mode 100644 packages/main/src/webComponents/Tab/TabDescription.md delete mode 100644 packages/main/src/webComponents/TabContainer/TabContainer.cy.tsx delete mode 100644 packages/main/src/webComponents/TabContainer/TabContainerDescription.md delete mode 100644 packages/main/src/webComponents/TabSeparator/TabSeparator.cy.tsx delete mode 100644 packages/main/src/webComponents/TabSeparator/TabSeparatorDescription.md delete mode 100644 packages/main/src/webComponents/Table/Table.cy.tsx delete mode 100644 packages/main/src/webComponents/Table/TableDescription.md delete mode 100644 packages/main/src/webComponents/TableCell/TableCell.cy.tsx delete mode 100644 packages/main/src/webComponents/TableCell/TableCellDescription.md delete mode 100644 packages/main/src/webComponents/TableColumn/TableColumn.cy.tsx delete mode 100644 packages/main/src/webComponents/TableColumn/TableColumnDescription.md delete mode 100644 packages/main/src/webComponents/TableGroupRow/TableGroupRow.cy.tsx delete mode 100644 packages/main/src/webComponents/TableGroupRow/TableGroupRowDescription.md delete mode 100644 packages/main/src/webComponents/TableRow/TableRow.cy.tsx delete mode 100644 packages/main/src/webComponents/TableRow/TableRowDescription.md delete mode 100644 packages/main/src/webComponents/TextArea/TextArea.cy.tsx delete mode 100644 packages/main/src/webComponents/TextArea/TextAreaDescription.md delete mode 100644 packages/main/src/webComponents/TimePicker/TimePicker.cy.tsx delete mode 100644 packages/main/src/webComponents/TimePicker/TimePickerDescription.md delete mode 100644 packages/main/src/webComponents/Timeline/Timeline.cy.tsx delete mode 100644 packages/main/src/webComponents/TimelineItem/TimelineItem.cy.tsx delete mode 100644 packages/main/src/webComponents/TimelineItem/TimelineItemDescription.md delete mode 100644 packages/main/src/webComponents/Title/Title.cy.tsx delete mode 100644 packages/main/src/webComponents/Toast/Toast.cy.tsx delete mode 100644 packages/main/src/webComponents/Toast/ToastDescription.md delete mode 100644 packages/main/src/webComponents/ToggleButton/ToggleButton.cy.tsx delete mode 100644 packages/main/src/webComponents/Token/Token.cy.tsx delete mode 100644 packages/main/src/webComponents/Token/TokenDescription.md create mode 100644 packages/main/src/webComponents/Toolbar/Toolbar.mdx rename packages/main/src/webComponents/{ToolbarV2/ToolbarV2.stories.tsx => Toolbar/Toolbar.stories.tsx} (76%) create mode 100644 packages/main/src/webComponents/Toolbar/index.tsx delete mode 100644 packages/main/src/webComponents/ToolbarButton/ToolbarButton.cy.tsx delete mode 100644 packages/main/src/webComponents/ToolbarButton/ToolbarButtonDescription.md delete mode 100644 packages/main/src/webComponents/ToolbarSelect/ToolbarSelect.cy.tsx delete mode 100644 packages/main/src/webComponents/ToolbarSelect/ToolbarSelectDescription.md delete mode 100644 packages/main/src/webComponents/ToolbarSelectOption/ToolbarSelectOption.cy.tsx delete mode 100644 packages/main/src/webComponents/ToolbarSelectOption/ToolbarSelectOptionDescription.md create mode 100644 packages/main/src/webComponents/ToolbarSeparator/index.tsx delete mode 100644 packages/main/src/webComponents/ToolbarSeparatorV2/ToolbarSeparatorV2.cy.tsx delete mode 100644 packages/main/src/webComponents/ToolbarSeparatorV2/ToolbarSeparatorV2Description.md delete mode 100644 packages/main/src/webComponents/ToolbarSeparatorV2/index.tsx rename packages/main/src/webComponents/{ToolbarSpacerV2 => ToolbarSpacer}/index.tsx (54%) delete mode 100644 packages/main/src/webComponents/ToolbarSpacerV2/ToolbarSpacerV2.cy.tsx delete mode 100644 packages/main/src/webComponents/ToolbarSpacerV2/ToolbarSpacerV2Description.md delete mode 100644 packages/main/src/webComponents/ToolbarV2/ToolbarV2.cy.tsx delete mode 100644 packages/main/src/webComponents/ToolbarV2/ToolbarV2.mdx delete mode 100644 packages/main/src/webComponents/ToolbarV2/ToolbarV2Description.md delete mode 100644 packages/main/src/webComponents/ToolbarV2/index.tsx delete mode 100644 packages/main/src/webComponents/Tree/Tree.cy.tsx delete mode 100644 packages/main/src/webComponents/Tree/TreeDescription.md delete mode 100644 packages/main/src/webComponents/TreeItem/TreeItem.cy.tsx delete mode 100644 packages/main/src/webComponents/TreeItem/TreeItemDescription.md delete mode 100644 packages/main/src/webComponents/TreeItemCustom/TreeItemCustom.cy.tsx delete mode 100644 packages/main/src/webComponents/TreeItemCustom/TreeItemCustomDescription.md delete mode 100644 packages/main/src/webComponents/UploadCollection/UploadCollection.cy.tsx delete mode 100644 packages/main/src/webComponents/UploadCollectionItem/UploadCollectionItem.cy.tsx delete mode 100644 packages/main/src/webComponents/UploadCollectionItem/UploadCollectionItemDescription.md delete mode 100644 packages/main/src/webComponents/ViewSettingsDialog/ViewSettingsDialog.cy.tsx delete mode 100644 packages/main/src/webComponents/ViewSettingsDialog/ViewSettingsDialogDescription.md delete mode 100644 packages/main/src/webComponents/Wizard/Wizard.cy.tsx delete mode 100644 packages/main/src/webComponents/Wizard/WizardDescription.md delete mode 100644 packages/main/src/webComponents/WizardStep/WizardStep.cy.tsx delete mode 100644 packages/main/src/webComponents/WizardStep/WizardStepDescription.md diff --git a/.eslintignore b/.eslintignore index fac21f80da9..129d53100bd 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,6 +5,9 @@ packages/base/types # build results for charts package packages/charts/dist +# build results for cli package +packages/cli/dist + # build results for main package packages/main/dist packages/main/ssr diff --git a/.github/workflows/test-web-components.yml b/.github/workflows/test-web-components.yml deleted file mode 100644 index 0865cf29075..00000000000 --- a/.github/workflows/test-web-components.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Test (Web Components) - -on: - push: - branches: - - 'main' - paths: - - 'packages/main/src/webComponents/**/*' - pull_request: - paths: - - 'packages/main/src/webComponents/**/*' - -jobs: - cypress-test: - name: 'Cypress' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Cypress run - uses: cypress-io/github-action@v5 - with: - build: yarn build - browser: chrome - component: true - spec: | - packages/main/src/webComponents - - - uses: actions/upload-artifact@v4 - if: always() - with: - name: web-components-coverage - path: temp/cypress-coverage diff --git a/.storybook/components/DocsHeader.tsx b/.storybook/components/DocsHeader.tsx index 8cb76017a8d..5d02573ce73 100644 --- a/.storybook/components/DocsHeader.tsx +++ b/.storybook/components/DocsHeader.tsx @@ -66,8 +66,8 @@ export const DocsHeader = ({ since }) => { - + ); }; diff --git a/package.json b/package.json index b2b3b5e4d3a..4d8aeb7f1ba 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,9 @@ "prettier:all": "prettier --write --config ./prettier.config.cjs \"packages/**/*.{js,jsx,ts,tsx,mdx,json,md}\"", "lint": "eslint packages --ext .ts,.tsx", "lerna:version-dryrun": "lerna version --conventional-graduate --no-git-tag-version --no-push", - "create-webcomponents-wrapper": "node --experimental-json-modules ./packages/main/scripts/create-web-components-wrapper.mjs && node --experimental-json-modules ./scripts/generate-theming-parameters.js", + "wrappers:main": "WITH_WEB_COMPONENT_IMPORT_PATH='../../internal/withWebComponent.js' INTERFACES_IMPORT_PATH='../../types/index.js' node packages/cli/dist/bin/index.js create-wrappers --packageName @ui5/webcomponents --out ./packages/main/src/webComponents --additionalComponentNote 'This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/playground/)'", + "wrappers:fiori": "WITH_WEB_COMPONENT_IMPORT_PATH='../../internal/withWebComponent.js' INTERFACES_IMPORT_PATH='../../types/index.js' node packages/cli/dist/bin/index.js create-wrappers --packageName @ui5/webcomponents-fiori --out ./packages/main/src/webComponents --additionalComponentNote 'This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/playground/)'", + "create-webcomponents-wrapper": "yarn run wrappers:main && yarn run wrappers:fiori && prettier --log-level silent --write ./packages/main/src/webComponents && eslint --fix ./packages/main/src/webComponents/*/index.tsx", "chromatic": "cross-env STORYBOOK_ENV=chromatic npx chromatic --build-script-name build:storybook", "postinstall": "husky && yarn prepare", "create-cypress-commands-docs": "typedoc && rimraf temp/typedoc" @@ -35,9 +37,9 @@ "@storybook/react": "7.6.12", "@storybook/react-vite": "7.6.12", "@storybook/theming": "7.6.12", - "@ui5/webcomponents": "1.21.2", - "@ui5/webcomponents-fiori": "1.21.2", - "@ui5/webcomponents-icons": "1.21.2", + "@ui5/webcomponents": "1.22.0", + "@ui5/webcomponents-fiori": "1.22.0", + "@ui5/webcomponents-icons": "1.22.0", "react": "18.2.0", "react-dom": "18.2.0", "remark-gfm": "^3.0.1", @@ -55,9 +57,10 @@ "@types/node": "^20.0.0", "@types/react": "^18.2.23", "@types/react-dom": "^18.2.7", + "@types/turndown": "^5.0.4", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", - "@ui5/webcomponents-tools": "1.21.2", + "@ui5/webcomponents-tools": "1.22.0", "@vitejs/plugin-react": "^4.2.0", "chromatic": "^10.0.0", "cssnano": "^6.0.1", diff --git a/packages/base/package.json b/packages/base/package.json index 7432d79f1e0..33688525c26 100644 --- a/packages/base/package.json +++ b/packages/base/package.json @@ -30,7 +30,7 @@ }, "peerDependencies": { "@types/react": "*", - "@ui5/webcomponents-base": "~1.21.0", + "@ui5/webcomponents-base": "~1.22.0", "react": "^16.14.0 || ^17.0.0 || ^18.0.0" }, "peerDependenciesMeta": { diff --git a/packages/charts/package.json b/packages/charts/package.json index 76d3f0bc950..c5f65c076e8 100644 --- a/packages/charts/package.json +++ b/packages/charts/package.json @@ -34,8 +34,8 @@ "recharts": "2.11.0" }, "peerDependencies": { - "@ui5/webcomponents-react": "~1.24.0", - "@ui5/webcomponents-react-base": "~1.24.0", + "@ui5/webcomponents-react": "~1.25.0", + "@ui5/webcomponents-react-base": "~1.25.0", "react": "^16.14.0 || ^17.0.0 || ^18.0.0", "react-jss": "^10.10.0" }, diff --git a/packages/cli/.gitignore b/packages/cli/.gitignore new file mode 100644 index 00000000000..be3f0c7e2b0 --- /dev/null +++ b/packages/cli/.gitignore @@ -0,0 +1,2 @@ +dist +test \ No newline at end of file diff --git a/packages/cli/package.json b/packages/cli/package.json new file mode 100644 index 00000000000..a13dcd7e065 --- /dev/null +++ b/packages/cli/package.json @@ -0,0 +1,39 @@ +{ + "name": "@ui5/webcomponents-react-cli", + "private": true, + "description": "CLI for UI5 Web Components for React", + "author": "SAP SE (https://www.sap.com)", + "license": "Apache-2.0", + "version": "1.22.0", + "type": "module", + "types": "./dist/index.d.ts", + "main": "./dist/index.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "bin": { + "ui5-wcr": "./dist/bin/index.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/SAP/ui5-webcomponents-react", + "directory": "packages/cli" + }, + "scripts": { + "clean": "rimraf dist" + }, + "publishConfig": { + "access": "public" + }, + "files": [ + "dist" + ], + "dependencies": { + "dedent": "^1.5.1", + "turndown": "^7.1.2" + } +} diff --git a/packages/cli/src/bin/index.ts b/packages/cli/src/bin/index.ts new file mode 100755 index 00000000000..b2087be1d32 --- /dev/null +++ b/packages/cli/src/bin/index.ts @@ -0,0 +1,55 @@ +#!/usr/bin/env node +import { resolve } from 'node:path'; +import { parseArgs } from 'node:util'; +import * as process from 'process'; + +const options = { + packageName: { + type: 'string' as const + }, + out: { + type: 'string' as const, + short: 'o' + }, + additionalComponentNote: { + type: 'string' as const + } +}; +const { values, positionals } = parseArgs({ options, allowPositionals: true }); + +const [command] = positionals; + +console.log(command); + +switch (command) { + case 'create-wrappers': + const { packageName, out, additionalComponentNote } = values; + const missingParameters = []; + if (!packageName) { + missingParameters.push('--packageName'); + } + if (!out) { + missingParameters.push('--out'); + } + + if (missingParameters.length > 0) { + console.error(` + Missing parameters: ${missingParameters.join(', ')} + Example: ui5-wcr create-wrappers --packageName @ui5/webcomponents --out ./src/components + + Please add the missing parameters and try again. + `); + process.exit(1); + } + + const createWrapperModule = await import('../scripts/create-wrappers/main.js'); + + const outDir = resolve(process.cwd(), values.out!); + // eslint-disable-next-line @typescript-eslint/await-thenable + await createWrapperModule.default(packageName!, outDir, { additionalComponentNote }); + process.exit(0); + break; + default: + console.warn('Unknown command', command); + process.exit(1); +} diff --git a/packages/cli/src/scripts/create-wrappers/AbstractRenderer.ts b/packages/cli/src/scripts/create-wrappers/AbstractRenderer.ts new file mode 100644 index 00000000000..7301440533c --- /dev/null +++ b/packages/cli/src/scripts/create-wrappers/AbstractRenderer.ts @@ -0,0 +1,19 @@ +import type { WebComponentWrapper } from './WebComponentWrapper.js'; + +export enum RenderingPhase { + imports = 'imports', + attributes = 'attributes', + props = 'props', + domRef = 'domRef', + component = 'component', + exports = 'exports' +} + +export abstract class AbstractRenderer { + public readonly phase!: RenderingPhase; + + public prepare(context: WebComponentWrapper) { + // optional + } + abstract render(context: WebComponentWrapper): string; +} diff --git a/packages/cli/src/scripts/create-wrappers/AttributesRenderer.ts b/packages/cli/src/scripts/create-wrappers/AttributesRenderer.ts new file mode 100644 index 00000000000..f0cdd869a49 --- /dev/null +++ b/packages/cli/src/scripts/create-wrappers/AttributesRenderer.ts @@ -0,0 +1,102 @@ +import type * as CEM from '@ui5/webcomponents-tools/lib/cem/types-internal.d.ts'; +import dedent from 'dedent'; +import { + mapWebComponentTypeToPrimitive, + propDescriptionFormatter, + snakeCaseToCamelCase +} from '../../util/formatters.js'; +import { resolveReferenceImports } from '../../util/referenceResolver.js'; +import { AbstractRenderer, RenderingPhase } from './AbstractRenderer.js'; +import { WebComponentWrapper } from './WebComponentWrapper.js'; + +const loggedTypes = new Set(); + +function mapWebComponentTypeToTsType(type: string) { + const primitive = mapWebComponentTypeToPrimitive(type); + if (primitive) { + return primitive; + } + switch (type) { + case 'HTMLElement | string | undefined': + case 'HTMLElement | string': + // opener props only accept strings as prop types + return 'string'; + + default: + if (!loggedTypes.has(type)) { + console.log('-> Attributes type', type); + loggedTypes.add(type); + } + return type; + } +} + +export class AttributesRenderer extends AbstractRenderer { + public phase = RenderingPhase.attributes; + + private _attributes: CEM.ClassField[] = []; + + setAttributes(value: CEM.Attribute[]) { + this._attributes = value.toSorted((a, b) => a.name.localeCompare(b.name)) as CEM.ClassField[]; + return this; + } + + private descriptionBuilder(attribute: CEM.ClassField) { + const parts: string[] = []; + + parts.push(` * ${propDescriptionFormatter(attribute.description ?? '')}`); + if (attribute.default && attribute.default.length > 0 && attribute.default !== '""') { + parts.push(` * @default ${attribute.default}`); + } + + if (attribute.deprecated) { + parts.push(` * @deprecated ${attribute.deprecated}`); + } + + return `/**\n${parts.join('\n')}\n */`; + } + + private propTyping(attribute: CEM.ClassField, context: WebComponentWrapper) { + let type = attribute.type?.text ?? 'unknown'; + type = mapWebComponentTypeToTsType(type); + + const references = attribute.type?.references; + const isEnum = references != null && references?.length > 0; + + if (isEnum) { + type += ` | keyof typeof ${type}`; + } + if (attribute._ui5validator === 'CSSColor') { + type = `CSSProperties['color']`; + } else if (attribute._ui5validator === 'CSSSize') { + type = `CSSProperties['width'] | CSSProperties['height']`; + } + + context.addAttribute(snakeCaseToCamelCase(attribute.name), type); + + return `${snakeCaseToCamelCase(attribute.name)}?: ${type};`; + } + + prepare(context: WebComponentWrapper) { + for (const attribute of this._attributes) { + // special css handling + if (attribute._ui5validator === 'CSSSize' || attribute._ui5validator === 'CSSColor') { + context.addTypeImport('react', 'CSSProperties'); + } else { + resolveReferenceImports(attribute.type?.references ?? [], context); + } + } + } + + render(context: WebComponentWrapper): string { + return dedent` + interface ${context.componentName}Attributes { + ${this._attributes + .map((attribute) => { + return `${this.descriptionBuilder(attribute)}\n${this.propTyping(attribute, context)}`; + }) + .join('\n\n')} + } + `; + } +} diff --git a/packages/cli/src/scripts/create-wrappers/ComponentRenderer.ts b/packages/cli/src/scripts/create-wrappers/ComponentRenderer.ts new file mode 100644 index 00000000000..b8b7a7ca0d1 --- /dev/null +++ b/packages/cli/src/scripts/create-wrappers/ComponentRenderer.ts @@ -0,0 +1,99 @@ +import type * as CEM from '@ui5/webcomponents-tools/lib/cem/types-internal.d.ts'; +import dedent from 'dedent'; +import { snakeCaseToCamelCase, summaryFormatter } from '../../util/formatters.js'; +import { AbstractRenderer, RenderingPhase } from './AbstractRenderer.js'; +import { WebComponentWrapper } from './WebComponentWrapper.js'; + +export class ComponentRenderer extends AbstractRenderer { + public phase = RenderingPhase.component; + + private dynamicImportPath: string | undefined; + private attributes: CEM.ClassField[] = []; + private slots: CEM.Slot[] = []; + private events: CEM.Event[] = []; + private description: string = ''; + private note: string = ''; + private isAbstract: boolean = false; + + setDynamicImportPath(value: string) { + this.dynamicImportPath = value; + return this; + } + + setAttributes(attrs: CEM.ClassField[]) { + this.attributes.push(...attrs); + return this; + } + + setSlots(slots: CEM.Slot[]) { + this.slots.push(...slots); + return this; + } + + setEvents(events: CEM.Event[]) { + this.events.push(...events); + return this; + } + + setDescription(value: string) { + this.description = value; + return this; + } + + setNote(value: string) { + this.note = value; + return this; + } + + setIsAbstract(value: boolean) { + this.isAbstract = value; + return this; + } + + prepare(context: WebComponentWrapper) { + context.exportSet.add(context.componentName); + } + + render(context: WebComponentWrapper): string { + let comment = `/**\n * ${summaryFormatter(this.description)}\n *\n`; + + if (this.isAbstract) { + comment += ' * @abstract\n'; + } + if (this.note) { + comment += ` * __Note__: ${this.note}\n`; + } + comment += '*/'; + + const component = dedent` + const ${context.componentName} = withWebComponent<${context.componentName}PropTypes, ${ + context.componentName + }DomRef>('${context.tagName}', + [${this.attributes + .filter((attr) => attr.type?.text !== 'boolean') + .map((attr) => `'${snakeCaseToCamelCase(attr.name)}'`) + .toSorted((a, b) => a.localeCompare(b)) + .join(', ')}], + [${this.attributes + .filter((attr) => attr.type?.text === 'boolean') + .map((attr) => `'${snakeCaseToCamelCase(attr.name)}'`) + .toSorted((a, b) => a.localeCompare(b)) + .join(', ')}], + [${this.slots + ?.filter((slot) => slot.name !== 'default') + .map((slot) => `'${snakeCaseToCamelCase(slot.name)}'`) + .toSorted((a, b) => a.localeCompare(b)) + .join(', ')}], + [${this.events + ?.map((event) => `'${event.name}'`) + .toSorted((a, b) => a.localeCompare(b)) + .join(', ')}], + () => import('${this.dynamicImportPath}') + ); + + ${context.componentName}.displayName = '${context.componentName}'; + `; + + return [comment, component].join('\n'); + } +} diff --git a/packages/cli/src/scripts/create-wrappers/DomRefRenderer.ts b/packages/cli/src/scripts/create-wrappers/DomRefRenderer.ts new file mode 100644 index 00000000000..6e070a51258 --- /dev/null +++ b/packages/cli/src/scripts/create-wrappers/DomRefRenderer.ts @@ -0,0 +1,167 @@ +import type * as CEM from '@ui5/webcomponents-tools/lib/cem/types-internal.d.ts'; +import dedent from 'dedent'; +import { mapWebComponentTypeToPrimitive, propDescriptionFormatter } from '../../util/formatters.js'; +import { resolveReferenceImports } from '../../util/referenceResolver.js'; +import { AbstractRenderer, RenderingPhase } from './AbstractRenderer.js'; +import { WebComponentWrapper } from './WebComponentWrapper.js'; + +const loggedTypes = new Set(); + +function mapWebComponentTypeToTsType(type: string = 'unknown') { + const primitive = mapWebComponentTypeToPrimitive(type); + if (primitive) { + return primitive; + } + switch (type) { + case 'function': + return 'Function'; + case 'HTMLElement': + // we need to extend HTMLElement with | EventTarget to allow opening popovers from event handlers + // example: ); - cy.get('ui5-button').click(); - cy.get('@onClickSpy').should('have.been.calledOnce'); - }); -}); diff --git a/packages/main/src/webComponents/Button/Button.mdx b/packages/main/src/webComponents/Button/Button.mdx index ca7625a5684..0a57e67d494 100644 --- a/packages/main/src/webComponents/Button/Button.mdx +++ b/packages/main/src/webComponents/Button/Button.mdx @@ -1,6 +1,5 @@ import { Canvas, Markdown, Meta } from '@storybook/blocks'; import { ControlsWithNote, DocsHeader, DomRefTable, Footer } from '@sb/components'; -import Description from './ButtonDescription.md?raw'; import ButtonDomRef from './ButtonDomRef.json'; import * as ComponentStories from './Button.stories'; @@ -18,8 +17,6 @@ import * as ComponentStories from './Button.stories'; -{Description} -