|
| 1 | +from __future__ import annotations |
| 2 | +from typing import Any |
| 3 | +from .types import ( |
| 4 | + AlignSelf, |
| 5 | + CSSProperties, |
| 6 | + DimensionValue, |
| 7 | + JustifySelf, |
| 8 | + LayoutFlex, |
| 9 | + Position, |
| 10 | +) |
| 11 | +from ..types import InlineAlertVariant |
| 12 | +from .basic import component_element |
| 13 | +from ..elements import Element |
| 14 | + |
| 15 | + |
| 16 | +def inline_alert( |
| 17 | + heading: Any, |
| 18 | + content: Any, |
| 19 | + *, |
| 20 | + variant: InlineAlertVariant | None = "neutral", |
| 21 | + auto_focus: bool | None = None, |
| 22 | + flex: LayoutFlex | None = None, |
| 23 | + flex_grow: float | None = None, |
| 24 | + flex_shrink: float | None = None, |
| 25 | + flex_basis: DimensionValue | None = None, |
| 26 | + align_self: AlignSelf | None = None, |
| 27 | + justify_self: JustifySelf | None = None, |
| 28 | + order: int | None = None, |
| 29 | + grid_area: str | None = None, |
| 30 | + grid_row: str | None = None, |
| 31 | + grid_row_start: str | None = None, |
| 32 | + grid_row_end: str | None = None, |
| 33 | + grid_column: str | None = None, |
| 34 | + grid_column_start: str | None = None, |
| 35 | + grid_column_end: str | None = None, |
| 36 | + margin: DimensionValue | None = None, |
| 37 | + margin_top: DimensionValue | None = None, |
| 38 | + margin_bottom: DimensionValue | None = None, |
| 39 | + margin_start: DimensionValue | None = None, |
| 40 | + margin_end: DimensionValue | None = None, |
| 41 | + margin_x: DimensionValue | None = None, |
| 42 | + margin_y: DimensionValue | None = None, |
| 43 | + width: DimensionValue | None = None, |
| 44 | + height: DimensionValue | None = None, |
| 45 | + min_width: DimensionValue | None = None, |
| 46 | + min_height: DimensionValue | None = None, |
| 47 | + max_width: DimensionValue | None = None, |
| 48 | + max_height: DimensionValue | None = None, |
| 49 | + position: Position | None = None, |
| 50 | + top: DimensionValue | None = None, |
| 51 | + bottom: DimensionValue | None = None, |
| 52 | + start: DimensionValue | None = None, |
| 53 | + end: DimensionValue | None = None, |
| 54 | + left: DimensionValue | None = None, |
| 55 | + right: DimensionValue | None = None, |
| 56 | + z_index: int | None = None, |
| 57 | + is_hidden: bool | None = None, |
| 58 | + id: str | None = None, |
| 59 | + UNSAFE_class_name: str | None = None, |
| 60 | + UNSAFE_style: CSSProperties | None = None, |
| 61 | +) -> Element: |
| 62 | + """ |
| 63 | + Inline alerts display non-modal messages related to objects in a view. |
| 64 | +
|
| 65 | + Args: |
| 66 | + heading: The heading of the Inline Alert. |
| 67 | + content: The content of the Inline Alert. |
| 68 | + variant: The visual style of the Inline Alert. |
| 69 | + auto_focus: Whether to automatically focus the Inline Alert when it first renders. |
| 70 | + flex: When used in a flex layout, specifies how the element will grow or shrink to fit the space available. |
| 71 | + flex_grow: When used in a flex layout, specifies how the element will grow to fit the space available. |
| 72 | + flex_shrink: When used in a flex layout, specifies how the element will shrink to fit the space available. |
| 73 | + flex_basis: When used in a flex layout, specifies the initial main size of the element. |
| 74 | + align_self: Overrides the alignItems property of a flex or grid container. |
| 75 | + justify_self: Species how the element is justified inside a flex or grid container. |
| 76 | + order: The layout order for the element within a flex or grid container. |
| 77 | + grid_area: When used in a grid layout specifies, specifies the named grid area that the element should be placed in within the grid. |
| 78 | + grid_row: When used in a grid layout, specifies the row the element should be placed in within the grid. |
| 79 | + grid_column: When used in a grid layout, specifies the column the element should be placed in within the grid. |
| 80 | + grid_row_start: When used in a grid layout, specifies the starting row to span within the grid. |
| 81 | + grid_row_end: When used in a grid layout, specifies the ending row to span within the grid. |
| 82 | + grid_column_start: When used in a grid layout, specifies the starting column to span within the grid. |
| 83 | + grid_column_end: When used in a grid layout, specifies the ending column to span within the grid. |
| 84 | + margin: The margin for all four sides of the element. |
| 85 | + margin_top: The margin for the top side of the element. |
| 86 | + margin_bottom: The margin for the bottom side of the element. |
| 87 | + margin_start: The margin for the logical start side of the element, depending on layout direction. |
| 88 | + margin_end: The margin for the logical end side of the element, depending on layout direction. |
| 89 | + margin_x: The margin for the left and right sides of the element. |
| 90 | + margin_y: The margin for the top and bottom sides of the element. |
| 91 | + width: The width of the element. |
| 92 | + min_width: The minimum width of the element. |
| 93 | + max_width: The maximum width of the element. |
| 94 | + height: The height of the element. |
| 95 | + min_height: The minimum height of the element. |
| 96 | + max_height: The maximum height of the element. |
| 97 | + position: The position of the element. |
| 98 | + top: The distance from the top of the containing element. |
| 99 | + bottom: The distance from the bottom of the containing element. |
| 100 | + left: The distance from the left of the containing element. |
| 101 | + right: The distance from the right of the containing element. |
| 102 | + start: The distance from the start of the containing element, depending on layout direction. |
| 103 | + end: The distance from the end of the containing element, depending on layout direction. |
| 104 | + z_index: The stack order of the element. |
| 105 | + is_hidden: Whether the element is hidden. |
| 106 | + id: The unique identifier of the element. |
| 107 | + UNSAFE_class_name: A CSS class to apply to the element. |
| 108 | + UNSAFE_style: A CSS style to apply to the element. |
| 109 | +
|
| 110 | + Returns: |
| 111 | + The rendered inline alert element. |
| 112 | +
|
| 113 | + """ |
| 114 | + return component_element( |
| 115 | + "InlineAlert", |
| 116 | + heading=heading, |
| 117 | + content=content, |
| 118 | + variant=variant, |
| 119 | + auto_focus=auto_focus, |
| 120 | + flex=flex, |
| 121 | + flex_grow=flex_grow, |
| 122 | + flex_shrink=flex_shrink, |
| 123 | + flex_basis=flex_basis, |
| 124 | + align_self=align_self, |
| 125 | + justify_self=justify_self, |
| 126 | + order=order, |
| 127 | + grid_area=grid_area, |
| 128 | + grid_row=grid_row, |
| 129 | + grid_row_start=grid_row_start, |
| 130 | + grid_row_end=grid_row_end, |
| 131 | + grid_column=grid_column, |
| 132 | + grid_column_start=grid_column_start, |
| 133 | + grid_column_end=grid_column_end, |
| 134 | + margin=margin, |
| 135 | + margin_top=margin_top, |
| 136 | + margin_bottom=margin_bottom, |
| 137 | + margin_start=margin_start, |
| 138 | + margin_end=margin_end, |
| 139 | + margin_x=margin_x, |
| 140 | + margin_y=margin_y, |
| 141 | + width=width, |
| 142 | + height=height, |
| 143 | + min_width=min_width, |
| 144 | + min_height=min_height, |
| 145 | + max_width=max_width, |
| 146 | + max_height=max_height, |
| 147 | + position=position, |
| 148 | + top=top, |
| 149 | + bottom=bottom, |
| 150 | + start=start, |
| 151 | + end=end, |
| 152 | + left=left, |
| 153 | + right=right, |
| 154 | + z_index=z_index, |
| 155 | + is_hidden=is_hidden, |
| 156 | + id=id, |
| 157 | + UNSAFE_class_name=UNSAFE_class_name, |
| 158 | + UNSAFE_style=UNSAFE_style, |
| 159 | + ) |
0 commit comments