mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
refactor(types): shorten ref, id JSDocs, use CarbonIcon type, export component props
This commit is contained in:
parent
d38e6d8be6
commit
75d4b4cf03
219 changed files with 5168 additions and 5259 deletions
87
types/ComposedModal/ComposedModal.d.ts
vendored
87
types/ComposedModal/ComposedModal.d.ts
vendored
|
@ -1,49 +1,50 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface ComposedModalProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Set the size of the composed modal
|
||||
*/
|
||||
size?: "xs" | "sm" | "lg";
|
||||
|
||||
/**
|
||||
* Set to `true` to open the modal
|
||||
* @default false
|
||||
*/
|
||||
open?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to use the danger variant
|
||||
* @default false
|
||||
*/
|
||||
danger?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to prevent the modal from closing when clicking outside
|
||||
* @default false
|
||||
*/
|
||||
preventCloseOnClickOutside?: boolean;
|
||||
|
||||
/**
|
||||
* Specify a class for the inner modal
|
||||
* @default ""
|
||||
*/
|
||||
containerClass?: string;
|
||||
|
||||
/**
|
||||
* Specify a selector to be focused when opening the modal
|
||||
* @default "[data-modal-primary-focus]"
|
||||
*/
|
||||
selectorPrimaryFocus?: string;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the top-level HTML element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLDivElement;
|
||||
}
|
||||
|
||||
export default class ComposedModal {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
|
||||
/**
|
||||
* Set the size of the composed modal
|
||||
*/
|
||||
size?: "xs" | "sm" | "lg";
|
||||
|
||||
/**
|
||||
* Set to `true` to open the modal
|
||||
* @default false
|
||||
*/
|
||||
open?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to use the danger variant
|
||||
* @default false
|
||||
*/
|
||||
danger?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` to prevent the modal from closing when clicking outside
|
||||
* @default false
|
||||
*/
|
||||
preventCloseOnClickOutside?: boolean;
|
||||
|
||||
/**
|
||||
* Specify a class for the inner modal
|
||||
* @default ""
|
||||
*/
|
||||
containerClass?: string;
|
||||
|
||||
/**
|
||||
* Specify a selector to be focused when opening the modal
|
||||
* @default "[data-modal-primary-focus]"
|
||||
*/
|
||||
selectorPrimaryFocus?: string;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the top-level HTML element
|
||||
* @default null
|
||||
*/
|
||||
ref?: null | HTMLDivElement;
|
||||
};
|
||||
|
||||
$$prop_def: ComposedModalProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
|
29
types/ComposedModal/ModalBody.d.ts
vendored
29
types/ComposedModal/ModalBody.d.ts
vendored
|
@ -1,20 +1,21 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface ModalBodyProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Set to `true` if the modal contains form elements
|
||||
* @default false
|
||||
*/
|
||||
hasForm?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` if the modal contains scrolling content
|
||||
* @default false
|
||||
*/
|
||||
hasScrollingContent?: boolean;
|
||||
}
|
||||
|
||||
export default class ModalBody {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
|
||||
/**
|
||||
* Set to `true` if the modal contains form elements
|
||||
* @default false
|
||||
*/
|
||||
hasForm?: boolean;
|
||||
|
||||
/**
|
||||
* Set to `true` if the modal contains scrolling content
|
||||
* @default false
|
||||
*/
|
||||
hasScrollingContent?: boolean;
|
||||
};
|
||||
|
||||
$$prop_def: ModalBodyProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
|
73
types/ComposedModal/ModalFooter.d.ts
vendored
73
types/ComposedModal/ModalFooter.d.ts
vendored
|
@ -1,42 +1,43 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface ModalFooterProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Specify the primary button text
|
||||
* @default ""
|
||||
*/
|
||||
primaryButtonText?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the primary button
|
||||
* @default false
|
||||
*/
|
||||
primaryButtonDisabled?: boolean;
|
||||
|
||||
/**
|
||||
* Specify a class for the primary button
|
||||
*/
|
||||
primaryClass?: string;
|
||||
|
||||
/**
|
||||
* Specify the secondary button text
|
||||
* @default ""
|
||||
*/
|
||||
secondaryButtonText?: string;
|
||||
|
||||
/**
|
||||
* Specify a class for the secondary button
|
||||
*/
|
||||
secondaryClass?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to use the danger variant
|
||||
* @default false
|
||||
*/
|
||||
danger?: boolean;
|
||||
}
|
||||
|
||||
export default class ModalFooter {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
|
||||
/**
|
||||
* Specify the primary button text
|
||||
* @default ""
|
||||
*/
|
||||
primaryButtonText?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the primary button
|
||||
* @default false
|
||||
*/
|
||||
primaryButtonDisabled?: boolean;
|
||||
|
||||
/**
|
||||
* Specify a class for the primary button
|
||||
*/
|
||||
primaryClass?: string;
|
||||
|
||||
/**
|
||||
* Specify the secondary button text
|
||||
* @default ""
|
||||
*/
|
||||
secondaryButtonText?: string;
|
||||
|
||||
/**
|
||||
* Specify a class for the secondary button
|
||||
*/
|
||||
secondaryClass?: string;
|
||||
|
||||
/**
|
||||
* Set to `true` to use the danger variant
|
||||
* @default false
|
||||
*/
|
||||
danger?: boolean;
|
||||
};
|
||||
|
||||
$$prop_def: ModalFooterProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
|
89
types/ComposedModal/ModalHeader.d.ts
vendored
89
types/ComposedModal/ModalHeader.d.ts
vendored
|
@ -1,50 +1,51 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface ModalHeaderProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
|
||||
/**
|
||||
* Specify the modal title
|
||||
* @default ""
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Specify the modal label
|
||||
* @default ""
|
||||
*/
|
||||
label?: string;
|
||||
|
||||
/**
|
||||
* Specify the label class
|
||||
* @default ""
|
||||
*/
|
||||
labelClass?: string;
|
||||
|
||||
/**
|
||||
* Specify the title class
|
||||
* @default ""
|
||||
*/
|
||||
titleClass?: string;
|
||||
|
||||
/**
|
||||
* Specify the close class
|
||||
* @default ""
|
||||
*/
|
||||
closeClass?: string;
|
||||
|
||||
/**
|
||||
* Specify the close icon class
|
||||
* @default ""
|
||||
*/
|
||||
closeIconClass?: string;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the close icon
|
||||
* @default "Close"
|
||||
*/
|
||||
iconDescription?: string;
|
||||
}
|
||||
|
||||
export default class ModalHeader {
|
||||
$$prop_def: svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> & {
|
||||
/**
|
||||
* Specify the modal title
|
||||
* @default ""
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* Specify the modal label
|
||||
* @default ""
|
||||
*/
|
||||
label?: string;
|
||||
|
||||
/**
|
||||
* Specify the label class
|
||||
* @default ""
|
||||
*/
|
||||
labelClass?: string;
|
||||
|
||||
/**
|
||||
* Specify the title class
|
||||
* @default ""
|
||||
*/
|
||||
titleClass?: string;
|
||||
|
||||
/**
|
||||
* Specify the close class
|
||||
* @default ""
|
||||
*/
|
||||
closeClass?: string;
|
||||
|
||||
/**
|
||||
* Specify the close icon class
|
||||
* @default ""
|
||||
*/
|
||||
closeIconClass?: string;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the close icon
|
||||
* @default "Close"
|
||||
*/
|
||||
iconDescription?: string;
|
||||
};
|
||||
|
||||
$$prop_def: ModalHeaderProps;
|
||||
$$slot_def: {
|
||||
default: {};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue