Commit c2c6236
committed
refactor(website): rename createComponent to createReactComponent and add React 19 variant (#13205)
* docs: add react editor
* chore: update deps
* chore: update
* chore: lint
* fix(website): fix all React sample files to compile and work correctly
- Fix 42 samples: wrap CSS in template literals inside <style> tags
so Babel JSX parser doesn't treat CSS braces as expressions
- Fix 10 Form samples: close truncated template literals and handler
functions
- Fix 17 samples: convert HTML comments to JSX comments
- Fix 11 samples: remove leftover <script> tags from HTML conversion
- Fix 7 samples: close truncated handler function bodies and add
proper React state management (refs, useState, useEffect)
- Fix 5 samples: repair mismatched HTML tags, extra closing divs,
unclosed components
- All 376 React samples now pass Babel transpilation successfully
* fix(website): remove createReactComponent from base barrel export
The createReactComponent function imports React at the top level,
causing all consumers of @ui5/webcomponents-base (including icons)
to require React. Moved to a direct module import with a Webpack
alias in docusaurus.config.ts so only the website pulls in React.
Also reverted sample imports back to @ui5/webcomponents-base (the
import is decorative - stripped at runtime by the ReactPlayground).
* chore: fix lint indentation in base index.ts
* fix(website): restore createReactComponent barrel export, fix react resolution
Restore createReactComponent to the @ui5/webcomponents-base barrel
export so samples can use the short import path. Add a Webpack alias
in docusaurus.config.ts to ensure 'react' resolves from the project's
node_modules rather than a parent directory.
* fix(website): apply theme changes to React playground preview
The React playground renders UI5 components directly in the document
(unlike the HTML playground which uses an iframe with playground-support.js).
Added useEffect hooks to call setTheme() and applyDirection() when
the theme or text direction context changes.
* fix(website): register theme asset loaders for React playground
Import Assets.js for main, fiori, and ai packages so that
setTheme() can load CSS custom properties when switching themes.
* fix(website): add missing component imports to React playground
Add 24 missing component classes: compat Table components
(TableColumn, TableGroupRow), main Table features (Growing,
Selection, Virtualizer), fiori components (NavigationLayout,
Search*, ShellBar*, UserSettings*), and others (DynamicDateRange,
SuggestionItemGroup).
* fix(website): convert remaining raw ui5 tags to React components
32 sample.tsx files still had unconverted <ui5-*> tags (TabContainer,
MultiComboBoxItem, AvatarBadge, TableRowAction, ExpandableText, etc).
Converted all to proper React components with createReactComponent
wrappers. Added 6 missing component imports to ReactPlayground.
* fix(website): add DynamicDateRange option imports for React playground
The DDR component needs its option modules (Today, Yesterday,
Tomorrow, SingleDate, DateRange, DateTimeRange, LastOptions,
NextOptions) imported as side effects to work properly.
* fix(website): define createReactComponent locally in ReactPlayground
The barrel import from @ui5/webcomponents-base failed at Webpack
static analysis time because createReactComponent.js imports 'react'
which can't be resolved from within the base package context.
Defining the function locally avoids this resolution issue.
* fix(website): match React preview font rendering with HTML preview
Reset line-height and font-smoothing in the React preview container
to match the iframe defaults used by the HTML preview. Infima's
line-height: 1.65 and -webkit-font-smoothing: antialiased were
causing subtle text rendering differences.
* chore(website): remove generate-react-samples script
All 376 React samples are generated and manually fixed.
Running the script again would overwrite those fixes.
New samples can be written directly as sample.tsx files.
* fix(ui5-webcomponents-base): remove createReactComponent from barrel export
Remove createReactComponent from the base package barrel export and
remove the react peer dependency to avoid breaking non-React consumers.
The createReactComponent function is now defined locally in the website's
ReactPlayground component.
* fix(ui5-webcomponents-base): fix lint errors in base package
Remove unused createReactComponent.tsx (no longer exported from barrel)
and fix extra blank line in index.ts.
* fix(ui5-webcomponents-base): restore createReactComponent in barrel export
Keep createReactComponent exported from the barrel so that the sample
import `import { createReactComponent } from "@ui5/webcomponents-base"`
works for users who copy it. React is an optional peer dependency.
* fix(ui5-webcomponents-base): move createReactComponent to direct path import
Remove createReactComponent from the barrel export to avoid forcing
non-React consumers to resolve the react dependency. The file remains
in the package and samples now import it via the direct path:
import { createReactComponent } from "@ui5/webcomponents-base/dist/createReactComponent.js"
* chore: remove .claude/settings.json from tracking
* fix(website): fix missing events in Monaco types and replace startsSection
- Fix eventDetails regex in generate-monaco-types.mjs to handle
intersection types (ParentType["eventDetails"] & { ... }) used by
AI components. This adds onVersionChange, onStopGeneration etc.
- Replace deprecated startsSection prop with MenuSeparator component
in all Menu samples (main and AI packages).
* fix(website): suppress webpack error overlay and Algolia search in editor
- Add onKeyDown handler to stop "/" key propagation in Monaco editor,
preventing Algolia DocSearch from opening while typing code
- Add global error handler to suppress webpack-dev-server's full-page
error overlay for eval'd sample code errors, showing inline errors only
* docs(website): add React version label to editor tab bar
Show "React >=18" next to "App.tsx" in the code editor tab bar
to inform users which React version the sample code targets.
* refactor(ui5-webcomponents-base): rename createReactComponent to createComponent
Shorter name for the React wrapper factory used in documentation samples.
Renamed the file, function, and all 376 sample imports accordingly.
* feat(website): add copy button for React code samples
Add a Copy button next to "Hide code" in the action bar, visible only
when the React code editor is open. Copies the current editor content
(including any user edits) to the clipboard with brief "Copied" feedback.
* fix(website): type event currentTarget with component props in Monaco
Add UI5CustomEvent<T> type so that event handlers have a properly typed
currentTarget and target (e.g., e.currentTarget.value works on Select
onChange without TS errors). Regenerated Monaco type definitions.
* chore(website): remove sap-icon:// prefix from React samples
Simplify icon names in sample code (e.g., icon="edit" instead of
icon="sap-icon://edit") for cleaner, more readable samples.
* feat(website): type event handlers with UI5CustomEvent and add samples tsconfig
- Type all 91 event handlers across 58 samples with proper
UI5CustomEvent<ComponentClass, "event-name"> for typed detail/currentTarget
- Import UI5CustomEvent from @ui5/webcomponents-base (barrel export)
- Add docs/_samples/tsconfig.json for VS Code autocompletion in samples
- Fix compat Table samples: add missing React imports and export default
- Update Monaco type generator to support eventDetails on component classes
- Add compat Table samples with React support
* fix(website): add curly braces to satisfy lint rules in createComponent
* fix(website): add class prop support, fix font override, wire up unused handlers
- Add class prop to UI5BaseProps for web components (className also supported)
- Handle className→class conversion in createComponent
- Remove font-family:inherit wildcard that overrode HTML preview fonts
- Wire up unused Dialog/Popover close handlers to onClick props
- Wire up MediaGallery onOverflowClick/onDisplayAreaClick handlers
- Remove dead code: Form slider handler, List getSelectedCount
* fix(website): fix boolean prop and typed event access in React samples
- Use boolean prop {true} instead of string "true" for showManageAccount
- Remove invalid design prop from Toast components
- Use e.currentTarget instead of e.target for typed FileUploader access
* feat(website): add React samples for ShellBar Overflow and MultiComboBox SelectedValues
- ShellBar/Overflow: declarative popover with overflow button for hidden content items
- MultiComboBox/SelectedValues: static pre-selected values
- MultiComboBox/SelectedValuesDynamic: dynamic selection with Select All/Clear/Europe buttons
* refactor(website): use declarative open/opener props and fix inherited event types
- Fix Monaco type generator to inherit events from base classes (Popup
events like close, open, before-close now appear on Dialog, Popover,
ResponsivePopover, ViewSettingsDialog, etc.)
- Fix Slider/RangeSlider missing onInput/onChange events (inherited from
SliderBase)
- Convert 27 React samples from imperative ref-based open/opener to
declarative state-based props using open={state} and onClose handler
- Affected components: Dialog, Popover, ResponsivePopover, Menu,
ColorPalettePopover, Toast, ViewSettingsDialog, BarcodeScannerDialog
* refactor(website): rename createComponent to createReactComponent and add React 19 variant
- Rename createComponent to createReactComponent across all 379 samples
- Update import to default export syntax
- Add React 19 createReactComponent (packages/base/src/createReactComponent.ts)
with detail patching for all event handlers
- Move React 18 version to packages/base/src/react18/createReactComponent.tsx
- Fix TypeScript types: useState generics, untyped function params, empty arrays
- Update monaco-ui5-types.d.ts and generate-monaco-types.mjs accordingly
* chore: update DP sample
* chore: update
* fix(ui5-base): fix lint errors in createReactComponent.ts1 parent d64a3cf commit c2c6236
384 files changed
Lines changed: 1848 additions & 1759 deletions
File tree
- packages
- base/src
- react18
- website
- docs/_samples
- ai
- Button
- ButtonMenu
- ButtonSplitMenu
- IconOnlyButton
- Input/Basic
- PromptInput/Basic
- TextArea
- Basic
- Extended
- compat/Table
- ActiveRows
- Basic
- Grouping
- GrowingOnButtonPress
- GrowingOnScroll
- MultipleSelection
- NoData
- Popin
- SingleSelection
- StickyHeader
- fiori
- BardcodeScannerDialog/Basic
- DynamicPage/Basic
- DynamicSideContent
- Basic
- EqualSplit
- SideContentPosition
- FlexibleColumnLayout
- Basic
- LayoutsConfiguration
- IllustratedMessage
- Basic
- CustomTitle
- WithDialog
- MediaGallery
- Basic
- Horizontal
- Interactive
- ThumbnailCustom
- Vertical
- VideoContent
- WithDisabledItem
- WithSelectedItem
- NotificationList
- Basic
- GroupItems
- InShellBar
- Page
- Basic
- ProductSwitch
- Basic
- WithImageSlot
- WithShellBar
- Search
- Actions
- AdvancedFilter
- Advanced
- Basic
- Byline
- Loading
- ShowMore
- ShellBar
- Advanced
- Basic
- MultipleNonProductiveInstances
- MultipleProductiveInstances
- Overflow
- TrialExample
- Timeline
- Basic
- Horizontal
- InCard
- WithGroups
- WithGrowing
- WithState
- UploadCollection
- Basic
- DragAndDrop
- RenamingFiles
- VariousUploadStates
- UserMenu
- Advanced
- Basic
- UserSettingsDialog/Basic
- ViewSettingsDialog/Basic
- Wizard
- Basic
- PageMode
- main
- AvatarBadge
- Basic
- ValueStates
- AvatarGroup
- Basic
- GroupWithPopover
- IndividualWithPopover
- TypesAndSizes
- Avatar
- Basic
- ColorSchemes
- Decorative
- Interactive
- Shapes
- Sizes
- Styles
- Variants
- WithBadge
- WithIcon
- WithImage
- Bar
- AccessibleRole
- Basic
- Breadcrumbs
- Basic
- BreadcrumbsOverflow
- BreadcrumbsStyles
- NoCurrentPage
- BusyIndicator
- Basic
- Sizes
- TextPlacement
- WithComponent
- Button
- Basic
- ButtonBadge
- CustomStyling
- Design
- EndIcon
- IconOnly
- Loading
- MenuButton
- TextAndIcon
- CalendarLegend
- Basic
- HideToday
- ItemTypes
- Calendar
- Basic
- Bounds
- CalendarInDifferentTimezone
- CalendarTypes
- CalendarWeekNumbering
- CalendarWithDisabledDates
- CalendarWithLegend
- SelectionModes
- Card
- Basic
- MoreCards
- WithList
- WithTable
- WithTimeline
- Carousel
- AccessibleName
- ArrowsPlacement
- Basic
- CardsWithHidden
- Cyclic
- MultipleItemsPerPage
- PageIndicatorType
- CheckBox
- Basic
- Group
- Indeterminate
- States
- TextWrapping
- ColorPalettePopover
- Basic
- DefaultColor
- MoreColors
- ColorPalette/Basic
- ColorPicker
- Basic
- Simplified
- ComboBox
- Basic
- ClearIcon
- Filters
- Grouping
- SameTextDifferentValues
- SelectedValue
- SuggestionsWrapping
- TwoColumnsLayout
- DatePicker
- Basic
- CalendarTypes
- CalendarWeekNumbering
- ClearIcon
- CustomFormatting
- DatePickerInDifferentTimezone
- MinMax
- State
- DateRangePicker
- Basic
- ClearIcon
- CustomFormatting
- DateFormat
- MinMax
- DateTimePicker
- Basic
- ClearIcon
- CustomFormatting
- DateTimePickerInDifferentTimezone
- FormatPattern
- MinMax
- Dialog
- BarInDialog
- Basic
- DraggableAndResizable
- WithState
- DynamicDateRange
- Basic
- DynamicDateRangeValueSample
- ExpandableText
- Basic
- OverflowModePopover
- FileUploader
- Basic
- FileSizeLimit
- FilesFilter
- MultipleFiles
- WithoutInput
- Form
- Basic
- CustomHeader
- Edit
- EmptySpan
- FreeStyleForm
- GroupColumnSpan
- Groups
- HeaderTextWrapping
- ItemColumnSpan
- LabelSpan
- LabelsOnTop
- Layout
- Icon
- BSIcons
- Basic
- CustomStyling
- Design
- Interactive
- TntIcons
- Input
- Basic
- BuiltInFiltering
- ClearIcon
- CustomStyling
- CustomSuggestions
- DynamicSuggestions
- Label
- SuggestionsWrapping
- Suggestions
- ValueHelpDialog
- ValueStateMessage
- Label
- Basic
- CustomStyling
- TextWrapping
- UsageWithInputs
- Link
- Basic
- CustomStyling
- Design
- TextWrapping
- WithIcons
- List
- Basic
- DragAndDrop
- GroupHeaderStyling
- GroupHeaders
- GrowingOnButtonPress
- Growing
- Modes
- MultipleDrag
- NoData
- SeparationTypes
- StickyHeader
- WrappingBehavior
- Menu
- AditionalText
- Basic
- DynamicallyAddedItems
- ItemGroups
- MenuEndContent
- SubMenu
- MessageStrip
- Basic
- CustomColors
- Custom
- Design
- HideIconAndButton
- MultiComboBox
- Basic
- ClearIcon
- MultiComboBoxCustomValue
- MultiComboBoxGrouping
- MultiComboBoxSelectAll
- SelectedValuesDynamic
- SelectedValues
- SuggestionsWrapping
- MultiInput
- Basic
- SuggestionsWrapping
- TokenCreation
- Panel
- Basic
- CustomHeader
- Fixed
- StickyHeader
- Popover
- Basic
- Placement
- Resizable
- ProgressIndicator
- Basic
- DisplayValue
- States
- RadioButton
- Basic
- States
- TextWrapping
- RangeSlider
- Basic
- ShowTickmarks
- ShowTooltip
- RatingIndicator
- Basic
- CustomIcons
- Sizes
- ResponsivePopover
- Basic
- Placement
- SegmentedButton
- Basic
- ItemsFitContent
- SelectionModes
- Select
- AdditionalText
- Basic
- CustomOptions
- Selection
- States
- Slider
- Basic
- ShowTickmarks
- ShowTooltip
- SplitButton
- Basic
- Design
- OpeningMenu
- StepInput
- Basic
- MinMax
- States
- ValuePrecision
- Switch
- Basic
- Design
- TabContainer
- Basic
- NestedTabs
- OverflowModeStartAndEnd
- OverflowMode
- ReorderTabsFixedTabs
- ReorderTabsMaxNestingLevel
- ReorderTabs
- TabLayoutInline
- TabLayout
- TextOnlyTabs
- TransparentDesign
- Table
- Basic
- ColumnWidths
- DragAndDrop
- Growing
- HAlign
- HeaderCellActionAI
- Interactive
- NoDataSlot
- Popin
- RowAction
- ScrollMode
- ScrollToLoad
- SelectionMulti
- SelectionSingle
- Selection
- StickyHeaderContainer
- StickyHeader
- Virtualizer
- Tag
- Basic
- Designs
- Interactive
- Set1
- Set2
- Size
- WrappingTypes
- TextArea
- Basic
- Growing
- MaxLength
- States
- Text
- Basic
- CustomStyling
- EmptyIndicatorMode
- Hyphenation
- MaxLines
- RenderWhiteSpace
- TimePicker
- Basic
- FormatPatterns
- States
- TimePickerInDifferentTimezone
- Title
- Basic
- WrappingType
- Toast
- Basic
- Duration
- Placement
- ToggleButton
- Basic
- Design
- IconOnly
- Tokenizer
- Basic
- MultiLine
- Token
- Basic
- TokenInMultiInput
- Toolbar
- AlwaysOverflowingItems
- Basic
- ItemsAlignment
- NeverOverflowingItems
- SpacerAndSeparator
- ToolbarItem
- Tree
- Basic
- CustomTreeItems
- DragAndDrop
- patterns
- AIAcknowledgement
- ScrollToAccept
- StandardAcknowledgement
- AIGuidedPrompt/Dialog
- AIQuickPrompt
- AIRegenerate/Basic
- scripts
- src/components/Editor
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
139 | | - | |
| 140 | + | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | | - | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
0 commit comments