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

Commit

Permalink
BlankWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
pelusanchez committed Dec 26, 2023
1 parent 25b9dfc commit 0b073b1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
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 0b073b1

Please sign in to comment.