Add JSDoc comments
Yay
This commit is contained in:
@@ -42,9 +42,13 @@
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "div"> & {
|
||||
/** Whether the `Dialog` is open */
|
||||
open?: boolean;
|
||||
/** The element that should receive focus when the Dialog is first opened */
|
||||
initialFocus?: HTMLElement | null;
|
||||
/** Whether the element should ignore the internally managed open/closed state */
|
||||
static?: boolean;
|
||||
/** Whether the element should be unmounted, instead of just hidden, based on the open/closed state */
|
||||
unmount?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "div"> & {
|
||||
/** Whether the `Disclosure` should be open by default */
|
||||
defaultOpen?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "div"> & {
|
||||
unmount?: boolean;
|
||||
/** Whether the element should ignore the internally managed open/closed state */
|
||||
static?: boolean;
|
||||
/** Whether the element should be unmounted, instead of just hidden, based on the open/closed state */
|
||||
unmount?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -50,12 +50,16 @@
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
type TListboxProps<
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "div"> & {
|
||||
/** Whether the entire `Listbox` and its children should be disabled */
|
||||
disabled?: boolean;
|
||||
/** Whether the entire `Listbox` should be oriented horizontally instead of vertically */
|
||||
horizontal?: boolean;
|
||||
/** The selected value */
|
||||
value?: StateDefinition["value"];
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "li"> & {
|
||||
/** The option value */
|
||||
value: unknown;
|
||||
/** Whether the option should be disabled for keyboard navigation and ARIA purposes */
|
||||
disabled?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "ul"> & {
|
||||
unmount?: boolean;
|
||||
/** Whether the element should ignore the internally managed open/closed state */
|
||||
static?: boolean;
|
||||
/** Whether the element should be unmounted, instead of just hidden, based on the open/closed state */
|
||||
unmount?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
type TMenuItemProps<
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "a"> & {};
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "a"> & {
|
||||
/** Whether the item should be disabled for keyboard navigation and ARIA purposes */
|
||||
disabled?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
TSlotProp extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProp, TAsProp, "div"> & {
|
||||
/** Whether the element should ignore the internally managed open/closed state */
|
||||
static?: boolean;
|
||||
/** Whether the element should be unmounted, instead of just hidden, based on the open/closed state */
|
||||
unmount?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -12,8 +12,15 @@
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "div"> & {
|
||||
/**
|
||||
* Whether the `PopoverPanel` should trap focus.
|
||||
* If true, focus will move inside the `PopoverPanel` when it is opened,
|
||||
* and if focus leaves the `PopoverPanel` it will close.
|
||||
*/
|
||||
focus?: boolean;
|
||||
/** Whether the element should ignore the internally managed open/closed state */
|
||||
static?: boolean;
|
||||
/** Whether the element should be unmounted, instead of just hidden, based on the open/closed state */
|
||||
unmount?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -48,7 +48,9 @@
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "div"> & {
|
||||
/** The currently selected value in the `RadioGroup` */
|
||||
value: StateDefinition["value"];
|
||||
/** Whether the `RadioGroup` and all of its `RadioGroupOption`s are disabled */
|
||||
disabled?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -3,7 +3,12 @@
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "div"> & {
|
||||
/**
|
||||
* The value of the `RadioGroupOption`.
|
||||
* The type should match the type of the value prop in the `RadioGroup`
|
||||
*/
|
||||
value: unknown;
|
||||
/** Whether the `RadioGroupOption` is disabled */
|
||||
disabled?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "button"> & {
|
||||
/** Whether the switch is checked */
|
||||
checked: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "button"> & {
|
||||
/** Whether the `Tab` is currently disabled */
|
||||
disabled?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -41,8 +41,15 @@
|
||||
TSlotProps extends {},
|
||||
TAsProp extends SupportedAs
|
||||
> = TPassThroughProps<TSlotProps, TAsProp, "div"> & {
|
||||
/** The index of the default selected tab */
|
||||
defaultIndex?: number;
|
||||
/** Whether the orientation of the `TabList` is vertical instead of horizontal */
|
||||
vertical?: boolean;
|
||||
/**
|
||||
* Whether, in keyboard navigation, the Enter or Space key is necessary to change tabs.
|
||||
* By default, the arrow keys will change tabs automatically without hitting Enter/Space.
|
||||
* This has no impact on mouse behavior
|
||||
*/
|
||||
manual?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -2,15 +2,27 @@
|
||||
export type TTransitionChildProps<
|
||||
TAsProp extends SupportedAs,
|
||||
TDefaultAs
|
||||
> = TPassThroughProps<{}, TAsProp, TDefaultAs> & {
|
||||
> = Omit<TPassThroughProps<{}, TAsProp, TDefaultAs>, "class"> & {
|
||||
/** Classes to add to the transitioning element during the entire enter phase */
|
||||
enter?: string;
|
||||
/** Classes to add to the transitioning element before the enter phase starts */
|
||||
enterFrom?: string;
|
||||
/** Classes to add to the transitioning element immediately after the enter phase starts */
|
||||
enterTo?: string;
|
||||
/**
|
||||
* Classes to add to the transitioning element once the transition is done.
|
||||
* These classes will persist after that until the leave phase
|
||||
*/
|
||||
entered?: string;
|
||||
/** Classes to add to the transitioning element during the entire leave phase */
|
||||
leave?: string;
|
||||
/** Classes to add to the transitioning element before the leave phase starts */
|
||||
leaveFrom?: string;
|
||||
/** Classes to add to the transitioning element immediately after the leave phase starts */
|
||||
leaveTo?: string;
|
||||
/** Whether the element should be unmounted, instead of just hidden, based on the open/closed state */
|
||||
unmount?: boolean;
|
||||
/** The class attribute for the transition element. These classes will always be present. */
|
||||
class?: string;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
TAsProp extends SupportedAs,
|
||||
TDefaultAs
|
||||
> = TTransitionChildProps<TAsProp, TDefaultAs> & {
|
||||
/** Whether the children should be shown */
|
||||
show?: boolean;
|
||||
/** Whether the transition should run on initial mount */
|
||||
appear?: boolean;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -44,15 +44,36 @@
|
||||
TDefaultAs
|
||||
> = TRestProps<TResolveAs<TAsProp, TDefaultAs>> & {
|
||||
name: string;
|
||||
as: TAsProp;
|
||||
slotProps: TSlotProps;
|
||||
el?: HTMLElement | null;
|
||||
use?: HTMLActionArray;
|
||||
visible?: boolean;
|
||||
features?: Features;
|
||||
as: TAsProp;
|
||||
static?: boolean;
|
||||
unmount?: boolean;
|
||||
/**
|
||||
* A list of actions to apply to the component's HTML element.
|
||||
*
|
||||
* Each action must take the form `[action]` or `[action, options]`:
|
||||
*
|
||||
* use={[[action1], [action2, action2Options], [action3]]}
|
||||
*/
|
||||
use?: HTMLActionArray;
|
||||
/**
|
||||
* The class attribute for this component.
|
||||
*
|
||||
* In addition to a regular string, this may be a function that returns a string.
|
||||
* In that case, the function will be passed this component's slot props as an argument,
|
||||
* allowing you to conditionally apply classes. See the component's documentation for more.
|
||||
*/
|
||||
class?: ((props: TSlotProps) => string) | string;
|
||||
/**
|
||||
* The style attribute for this component.
|
||||
*
|
||||
* In addition to a regular string, this may be a function that returns a string.
|
||||
* In that case, the function will be passed this component's slot props as an argument,
|
||||
* allowing you to conditionally apply styles. See the component's documentation for more.
|
||||
*/
|
||||
style?: ((props: TSlotProps) => string) | string;
|
||||
};
|
||||
|
||||
@@ -66,6 +87,7 @@
|
||||
TRenderProps<TSlotProps, TAsProp, TDefaultAs>,
|
||||
TInternalProps | "as" | "static" | "unmount"
|
||||
> & {
|
||||
/** The HTML element the component should render as */
|
||||
as?: TAsProp;
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user