Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #62 from ecmwf-projects/COPDS-1398-blank-widget-ne…
Browse files Browse the repository at this point in the history
…eded

Copds 1398 blank widget needed
  • Loading branch information
pelusanchez authored Dec 26, 2023
2 parents 25b9dfc + e56ab99 commit 5bf5278
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ecmwf-projects/cads-ui-library",
"version": "8.2.2",
"version": "8.2.3",
"description": "Common UI kit library",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export { StringListWidget } from './widgets/StringListWidget'
export { StringChoiceWidget } from './widgets/StringChoiceWidget'
export { DateRangeWidget } from './widgets/DateRangeWidget'
export { FreeformInputWidget } from './widgets/FreeformInputWidget'
export { BlankWidget } from './widgets/BlankWidget'

export { StringListArrayWidget } from './widgets/StringListArrayWidget'
/**
Expand Down
38 changes: 38 additions & 0 deletions src/widgets/BlankWidget.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from 'react'

import { Widget, WidgetHeader, WidgetTitle } from './Widget'

/**
* BlankWidget.
* Widget to display a block of any element.
*/
const BlankWidget = ({
name,
label,
children,
labelAriaHidden = true
}: {
name?: string
label?: string
children: React.ReactNode
labelAriaHidden?: boolean
}) => {
return (
<Widget data-stylizable='widget'>
{label && (
<WidgetHeader>
<WidgetTitle
data-stylizable='widget-title'
htmlFor={name}
aria-hidden={labelAriaHidden}
>
{label}
</WidgetTitle>
</WidgetHeader>
)}
<div data-stylizable='widget blank-widget-text'>{children}</div>
</Widget>
)
}

export { BlankWidget }

0 comments on commit 5bf5278

Please sign in to comment.