mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
Make UI Shell HeaderAction panel transition configurable (#419)
* fix(ui-shell): remove fly transition from hamburger menu * feat(header-action): make panel transition configurable * chore: rebuild types, docs * docs(ui-shell): document transition prop in Header app switcher example
This commit is contained in:
parent
1e72ea9942
commit
f4c940d5ee
31 changed files with 244 additions and 160 deletions
2
types/Accordion/AccordionItem.d.ts
vendored
2
types/Accordion/AccordionItem.d.ts
vendored
|
@ -3,7 +3,7 @@
|
|||
export interface AccordionItemProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["li"]> {
|
||||
/**
|
||||
* Specify the title of the accordion item heading
|
||||
* Alternatively, use the named slot "title" (e.g. <div slot="title">...</div>)
|
||||
* Alternatively, use the named slot "title" (e.g., <div slot="title">...</div>)
|
||||
* @default "title"
|
||||
*/
|
||||
title?: string;
|
||||
|
|
2
types/Button/Button.d.ts
vendored
2
types/Button/Button.d.ts
vendored
|
@ -47,7 +47,7 @@ export interface ButtonProps
|
|||
|
||||
/**
|
||||
* Set to `true` to render a custom HTML element
|
||||
* Props are destructured as `props` in the default slot (e.g. <Button let:props><div {...props}>...</div></Button>)
|
||||
* Props are destructured as `props` in the default slot (e.g., <Button let:props><div {...props}>...</div></Button>)
|
||||
* @default false
|
||||
*/
|
||||
as?: boolean;
|
||||
|
|
2
types/CodeSnippet/CodeSnippet.d.ts
vendored
2
types/CodeSnippet/CodeSnippet.d.ts
vendored
|
@ -9,7 +9,7 @@ export interface CodeSnippetProps {
|
|||
|
||||
/**
|
||||
* Set the code snippet text
|
||||
* Alternatively, use the default slot (e.g. <CodeSnippet>{`code`}</CodeSnippet>)
|
||||
* Alternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>)
|
||||
*/
|
||||
code?: string;
|
||||
|
||||
|
|
2
types/ContentSwitcher/Switch.d.ts
vendored
2
types/ContentSwitcher/Switch.d.ts
vendored
|
@ -3,7 +3,7 @@
|
|||
export interface SwitchProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
|
||||
/**
|
||||
* Specify the switch text
|
||||
* Alternatively, use the named slot "text" (e.g. <span slot="text">...</span>)
|
||||
* Alternatively, use the named slot "text" (e.g., <span slot="text">...</span>)
|
||||
* @default "Provide text"
|
||||
*/
|
||||
text?: string;
|
||||
|
|
2
types/Grid/Column.d.ts
vendored
2
types/Grid/Column.d.ts
vendored
|
@ -12,7 +12,7 @@ export type ColumnBreakpoint = ColumnSize | ColumnSizeDescriptor;
|
|||
export interface ColumnProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Set to `true` to render a custom HTML element
|
||||
* Props are destructured as `props` in the default slot (e.g. <Column let:props><article {...props}>...</article></Column>)
|
||||
* Props are destructured as `props` in the default slot (e.g., <Column let:props><article {...props}>...</article></Column>)
|
||||
* @default false
|
||||
*/
|
||||
as?: boolean;
|
||||
|
|
2
types/Grid/Grid.d.ts
vendored
2
types/Grid/Grid.d.ts
vendored
|
@ -3,7 +3,7 @@
|
|||
export interface GridProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Set to `true` to render a custom HTML element
|
||||
* Props are destructured as `props` in the default slot (e.g. <Grid let:props><header {...props}>...</header></Grid>)
|
||||
* Props are destructured as `props` in the default slot (e.g., <Grid let:props><header {...props}>...</header></Grid>)
|
||||
* @default false
|
||||
*/
|
||||
as?: boolean;
|
||||
|
|
2
types/Grid/Row.d.ts
vendored
2
types/Grid/Row.d.ts
vendored
|
@ -3,7 +3,7 @@
|
|||
export interface RowProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Set to `true` to render a custom HTML element
|
||||
* Props are destructured as `props` in the default slot (e.g. <Row let:props><section {...props}>...</section></Row>)
|
||||
* Props are destructured as `props` in the default slot (e.g., <Row let:props><section {...props}>...</section></Row>)
|
||||
* @default false
|
||||
*/
|
||||
as?: boolean;
|
||||
|
|
2
types/Tabs/Tab.d.ts
vendored
2
types/Tabs/Tab.d.ts
vendored
|
@ -3,7 +3,7 @@
|
|||
export interface TabProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["li"]> {
|
||||
/**
|
||||
* Specify the tab label
|
||||
* Alternatively, use the default slot (e.g. <Tab><span>Label</span></Tab>)
|
||||
* Alternatively, use the default slot (e.g., <Tab><span>Label</span></Tab>)
|
||||
* @default ""
|
||||
*/
|
||||
label?: string;
|
||||
|
|
2
types/Tooltip/Tooltip.d.ts
vendored
2
types/Tooltip/Tooltip.d.ts
vendored
|
@ -21,7 +21,7 @@ export interface TooltipProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNa
|
|||
|
||||
/**
|
||||
* Specify the icon from `carbon-icons-svelte` to render for the tooltip button
|
||||
* Icon size must be 16px (e.g. `Add16`, `Task16`)
|
||||
* Icon size must be 16px (e.g., `Add16`, `Task16`)
|
||||
*/
|
||||
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
|
||||
|
||||
|
|
2
types/UIShell/GlobalHeader/Header.d.ts
vendored
2
types/UIShell/GlobalHeader/Header.d.ts
vendored
|
@ -30,7 +30,7 @@ export interface HeaderProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNam
|
|||
|
||||
/**
|
||||
* Specify the platform name
|
||||
* Alternatively, use the named slot "platform" (e.g. <span slot="platform">...</span>)
|
||||
* Alternatively, use the named slot "platform" (e.g., <span slot="platform">...</span>)
|
||||
* @default ""
|
||||
*/
|
||||
platformName?: string;
|
||||
|
|
15
types/UIShell/GlobalHeader/HeaderAction.d.ts
vendored
15
types/UIShell/GlobalHeader/HeaderAction.d.ts
vendored
|
@ -1,5 +1,11 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface HeaderActionSlideTransition {
|
||||
delay?: number;
|
||||
duration?: number;
|
||||
easing?: (t: number) => number;
|
||||
}
|
||||
|
||||
export interface HeaderActionProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
|
||||
/**
|
||||
* Set to `true` to open the panel
|
||||
|
@ -14,7 +20,7 @@ export interface HeaderActionProps extends svelte.JSX.HTMLAttributes<HTMLElement
|
|||
|
||||
/**
|
||||
* Specify the text
|
||||
* Alternatively, use the named slot "text" (e.g. <div slot="text">...</div>)
|
||||
* Alternatively, use the named slot "text" (e.g., <div slot="text">...</div>)
|
||||
*/
|
||||
text?: string;
|
||||
|
||||
|
@ -23,6 +29,13 @@ export interface HeaderActionProps extends svelte.JSX.HTMLAttributes<HTMLElement
|
|||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLButtonElement;
|
||||
|
||||
/**
|
||||
* Customize the panel transition (i.e., `transition:slide`)
|
||||
* Set to `false` to disable the transition
|
||||
* @default { duration: 200 }
|
||||
*/
|
||||
transition?: false | HeaderActionSlideTransition;
|
||||
}
|
||||
|
||||
export default class HeaderAction {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue