mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
Alignment with Carbon version 10.31 (#571)
* chore(deps-dev): upgrade carbon-components to v10.31.0 * fix(slider): use CSS to hide input if hideTextInput is true * docs(slider): add hidden text input, invalid, disabled examples * feat(tabs): support "container" type for TabsSkeleton * chore(list-box): remove hotfix inline style to center dropdown chevron * fix(number-input): use add, subtract icons and update markup * feat(select): add warning state * docs(select): add invalid state example * docs(select): add helper text example * fix(structured-list): add "rowgroup" role to StructuredListBody * docs: release code snippet max-width * docs(select): add skeleton hidden label example * feat(popover): add Popover component * feat(pagination): dispatch button click events to be consistent with PaginationNav * fix(multi-select): type clear as a custom event * docs(radio-button): add disabled buttons example * chore(tabs): use absolute icon import * fix(link): remove line breaks within anchor link * docs(radio-button): adjust section copy verbiage * chore(deps-dev): upgrade carbon-icons-svelte to v10.27 v10.27 uses the SvelteComponentTyped interface * docs(accordion): adjust section title verbiage * test(types): fix warnings from svelte-check * fix(search): only set autofocus attribute if equals true * feat(popover): add closeOnOutsideClick prop * docs: style [data-outline] as relative positioned * feat(context-menu): add initial ContextMenu * feat(context-menu): annotate props, generate types * feat(context-menu): add initial focus logic * fix(context-menu): correctly tab in/out of nested menus * chore(context-menu): update types * fix(context-menu): obtain radio id from node directly * docs(context-menu): add examples and test * fix(context-menu): prevent default keydown behavior
This commit is contained in:
parent
afed4fa2fa
commit
5fad0cb3c7
52 changed files with 1758 additions and 103 deletions
41
types/ContextMenu/ContextMenu.d.ts
vendored
Normal file
41
types/ContextMenu/ContextMenu.d.ts
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface ContextMenuProps
|
||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["ul"]> {
|
||||
/**
|
||||
* Set to `true` to open the menu
|
||||
* Either `x` and `y` must be greater than zero
|
||||
* @default false
|
||||
*/
|
||||
open?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the horizontal offset of the menu position
|
||||
* @default 0
|
||||
*/
|
||||
x?: number;
|
||||
|
||||
/**
|
||||
* Specify the vertical offset of the menu position
|
||||
* @default 0
|
||||
*/
|
||||
y?: number;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the unordered list HTML element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLUListElement;
|
||||
}
|
||||
|
||||
export default class ContextMenu extends SvelteComponentTyped<
|
||||
ContextMenuProps,
|
||||
{
|
||||
click: WindowEventMap["click"];
|
||||
keydown: WindowEventMap["keydown"];
|
||||
open: CustomEvent<any>;
|
||||
close: CustomEvent<any>;
|
||||
},
|
||||
{ default: {} }
|
||||
> {}
|
10
types/ContextMenu/ContextMenuDivider.d.ts
vendored
Normal file
10
types/ContextMenu/ContextMenuDivider.d.ts
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface ContextMenuDividerProps {}
|
||||
|
||||
export default class ContextMenuDivider extends SvelteComponentTyped<
|
||||
ContextMenuDividerProps,
|
||||
{},
|
||||
{}
|
||||
> {}
|
21
types/ContextMenu/ContextMenuGroup.d.ts
vendored
Normal file
21
types/ContextMenu/ContextMenuGroup.d.ts
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface ContextMenuGroupProps {
|
||||
/**
|
||||
* @default []
|
||||
*/
|
||||
selectedIds?: string[];
|
||||
|
||||
/**
|
||||
* Specify the label text
|
||||
* @default ""
|
||||
*/
|
||||
labelText?: string;
|
||||
}
|
||||
|
||||
export default class ContextMenuGroup extends SvelteComponentTyped<
|
||||
ContextMenuGroupProps,
|
||||
{},
|
||||
{ default: {} }
|
||||
> {}
|
74
types/ContextMenu/ContextMenuOption.d.ts
vendored
Normal file
74
types/ContextMenu/ContextMenuOption.d.ts
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface ContextMenuOptionProps
|
||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["li"]> {
|
||||
/**
|
||||
* Set to `true` to enable the disabled state
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to indent the label
|
||||
* @default false
|
||||
*/
|
||||
indented?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the icon from `carbon-icons-svelte` to render
|
||||
* Icon is rendered to the left of the label text
|
||||
*/
|
||||
icon?: typeof import("carbon-icons-svelte").CarbonIcon;
|
||||
|
||||
/**
|
||||
* Specify the label text
|
||||
* Alternatively, use the "labelText" slot (e.g., <span slot="labelText">...</span>)
|
||||
* @default ""
|
||||
*/
|
||||
labelText?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to use the selected variant
|
||||
* @default false
|
||||
*/
|
||||
selected?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to enable the selectable variant
|
||||
* Automatically set to `true` if `selected` is `true`
|
||||
* @default false
|
||||
*/
|
||||
selectable?: boolean;
|
||||
|
||||
/**
|
||||
* Specify the shortcut text
|
||||
* Alternatively, use the "shortcutText" slot (e.g., <span slot="shortcutText">...</span>)
|
||||
* @default ""
|
||||
*/
|
||||
shortcutText?: string;
|
||||
|
||||
/**
|
||||
* Specify the id
|
||||
* It's recommended to provide an id as a value to bind to within a selectable/radio menu group
|
||||
* @default "ccs-" + Math.random().toString(36)
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the list item HTML element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLLIElement;
|
||||
}
|
||||
|
||||
export default class ContextMenuOption extends SvelteComponentTyped<
|
||||
ContextMenuOptionProps,
|
||||
{
|
||||
keydown: WindowEventMap["keydown"];
|
||||
mouseenter: WindowEventMap["mouseenter"];
|
||||
mouseleave: WindowEventMap["mouseleave"];
|
||||
click: CustomEvent<any>;
|
||||
},
|
||||
{ default: {}; labelText: {}; shortcutText: {} }
|
||||
> {}
|
22
types/ContextMenu/ContextMenuRadioGroup.d.ts
vendored
Normal file
22
types/ContextMenu/ContextMenuRadioGroup.d.ts
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
|
||||
export interface ContextMenuRadioGroupProps {
|
||||
/**
|
||||
* Set the selected radio group id
|
||||
* @default ""
|
||||
*/
|
||||
selectedId?: string;
|
||||
|
||||
/**
|
||||
* Specify the label text
|
||||
* @default ""
|
||||
*/
|
||||
labelText?: string;
|
||||
}
|
||||
|
||||
export default class ContextMenuRadioGroup extends SvelteComponentTyped<
|
||||
ContextMenuRadioGroupProps,
|
||||
{},
|
||||
{ default: {} }
|
||||
> {}
|
Loading…
Add table
Add a link
Reference in a new issue