mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
parent
ee03b95462
commit
e59e1a9348
5 changed files with 35 additions and 13 deletions
|
@ -1997,9 +1997,11 @@ None.
|
|||
### Slots
|
||||
|
||||
| Slot name | Default | Props | Fallback |
|
||||
| :-------- | :------ | :---- | :------- |
|
||||
| :-------- | :------ | :---- | :---------------------- |
|
||||
| -- | Yes | -- | -- |
|
||||
| actions | No | -- | -- |
|
||||
| subtitle | No | -- | <code>{subtitle}</code> |
|
||||
| title | No | -- | <code>{title}</code> |
|
||||
|
||||
### Events
|
||||
|
||||
|
|
|
@ -5218,7 +5218,19 @@
|
|||
],
|
||||
"slots": [
|
||||
{ "name": "__default__", "default": true, "slot_props": "{}" },
|
||||
{ "name": "actions", "default": false, "slot_props": "{}" }
|
||||
{ "name": "actions", "default": false, "slot_props": "{}" },
|
||||
{
|
||||
"name": "subtitle",
|
||||
"default": false,
|
||||
"fallback": "{subtitle}",
|
||||
"slot_props": "{}"
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"default": false,
|
||||
"fallback": "{title}",
|
||||
"slot_props": "{}"
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
|
|
|
@ -11,6 +11,13 @@ source: Notification/InlineNotification.svelte
|
|||
|
||||
<InlineNotification title="Error:" subtitle="An internal server error occurred." />
|
||||
|
||||
### Slottable title, subtitle
|
||||
|
||||
<InlineNotification>
|
||||
<strong slot="title">Error: </strong>
|
||||
<strong slot="subtitle">An internal server error occurred.</strong>
|
||||
</InlineNotification>
|
||||
|
||||
### Hidden close button
|
||||
|
||||
<InlineNotification hideCloseButton kind="warning" title="Scheduled maintenance:" subtitle="Maintenance will last 2-4 hours." />
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
import { createEventDispatcher, onMount } from "svelte";
|
||||
import NotificationIcon from "./NotificationIcon.svelte";
|
||||
import NotificationTextDetails from "./NotificationTextDetails.svelte";
|
||||
import NotificationButton from "./NotificationButton.svelte";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
@ -78,13 +77,15 @@
|
|||
>
|
||||
<div class:bx--inline-notification__details="{true}">
|
||||
<NotificationIcon notificationType="inline" kind="{kind}" />
|
||||
<NotificationTextDetails
|
||||
title="{title}"
|
||||
subtitle="{subtitle}"
|
||||
notificationType="inline"
|
||||
>
|
||||
<div class:bx--inline-notification__text-wrapper="{true}">
|
||||
<p class:bx--inline-notification__title="{true}">
|
||||
<slot name="title">{title}</slot>
|
||||
</p>
|
||||
<div class:bx--inline-notification__subtitle="{true}">
|
||||
<slot name="subtitle">{subtitle}</slot>
|
||||
</div>
|
||||
<slot />
|
||||
</NotificationTextDetails>
|
||||
</div>
|
||||
</div>
|
||||
<slot name="actions" />
|
||||
{#if !hideCloseButton}
|
||||
|
|
|
@ -67,5 +67,5 @@ export default class InlineNotification extends SvelteComponentTyped<
|
|||
mouseenter: WindowEventMap["mouseenter"];
|
||||
mouseleave: WindowEventMap["mouseleave"];
|
||||
},
|
||||
{ default: {}; actions: {} }
|
||||
{ default: {}; actions: {}; subtitle: {}; title: {} }
|
||||
> {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue