Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bestax-mcp/data/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -2007,6 +2007,7 @@
"--bulma-notification-background-l": ["Notification"],
"--bulma-notification-code-background-color": ["Notification"],
"--bulma-notification-color-l": ["Notification"],
"--bulma-notification-delete-padding-inline-end": ["Notification"],
"--bulma-notification-h": ["Notification"],
"--bulma-notification-padding": ["Notification"],
"--bulma-notification-radius": ["Notification"],
Expand Down
8 changes: 7 additions & 1 deletion bestax-mcp/data/components/Notification.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"name": "hasDelete",
"type": "boolean",
"default": "false",
"description": "Shows a close (delete) button in the notification. It renders `type=\"button\"`, so it does not submit a form around it.",
"description": "Shows a close (delete) button in the notification. It renders `type=\"button\"`, so it does not submit a form around it. The notification also takes `has-delete`, which pads its end by `--bulma-notification-delete-padding-inline-end` so the text clears the button. That rule ships in bestax's stylesheets, not Bulma's, so an app styled by Bulma's CSS alone keeps Bulma's padding.",
"required": false,
"inherited": false,
"deprecated": false
Expand Down Expand Up @@ -119,6 +119,12 @@
}
],
"cssVars": [
{
"css": "--bulma-notification-delete-padding-inline-end",
"sass": "$notification-delete-padding-inline-end",
"default": "calc(1rem + 1.25rem + 0.75rem)",
"scope": "root"
},
{
"css": "--bulma-notification-h",
"sass": null,
Expand Down
4 changes: 2 additions & 2 deletions bestax-mcp/data/skills.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
{
"id": "modular-build",
"file": "references/modular-build.md",
"bytes": 9583
"bytes": 10113
}
],
"examples": []
Expand All @@ -176,7 +176,7 @@
{
"id": "css-variables",
"file": "references/css-variables.md",
"bytes": 29396
"bytes": 29872
},
{
"id": "themeable-components",
Expand Down
21 changes: 21 additions & 0 deletions bulma-ui/src/elements/Notification.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
notification,
} from './Notification';
import { Button } from './Button';
import { Columns } from '../columns/Columns';
import { Column } from '../columns/Column';

// Separate component for dismissible notification to comply with react-hooks/rules-of-hooks
const DismissibleNotification: React.FC<NotificationProps> = props => {
Expand Down Expand Up @@ -167,6 +169,25 @@ export const WithDelete: Story = {
},
};

/**
* On a narrow column the text wraps before the close button rather than
* running under it.
*/
export const WithDeleteInANarrowColumn: Story = {
render: (args: NotificationProps) => (
<Columns>
<Column size="one-third">
<DismissibleNotification {...args} />
</Column>
</Columns>
),
args: {
color: 'info',
children:
'Your changes were saved, and everyone on the project can see them now.',
},
};

export const WithMargin: Story = {
args: {
children: 'This notification has a margin.',
Expand Down
6 changes: 6 additions & 0 deletions bulma-ui/src/elements/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export interface NotificationProps
/**
* Shows a close (delete) button in the notification. It renders
* `type="button"`, so it does not submit a form around it.
*
* The notification also takes `has-delete`, which pads its end by
* `--bulma-notification-delete-padding-inline-end` so the text clears the
* button. That rule ships in bestax's stylesheets, not Bulma's, so an app
* styled by Bulma's CSS alone keeps Bulma's padding.
*/
hasDelete?: boolean;
/** Callback fired when the delete button is clicked. */
Expand Down Expand Up @@ -83,6 +88,7 @@ export const Notification: React.FC<NotificationProps> = ({
const bulmaClasses = usePrefixedClassNames('notification', {
[`is-${color}`]: color && validColors.includes(color),
'is-light': isLight,
'has-delete': hasDelete,
});

const deleteClasses = usePrefixedClassNames('delete');
Expand Down
Loading
Loading