@qasa/qds-ui 0.10.0-next.1 → 0.10.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1322 -1328
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/checkbox/checkbox.d.ts +70 -0
- package/dist/cjs/types/components/checkbox/index.d.ts +1 -0
- package/dist/cjs/types/components/display-text/display-text.d.ts +29 -0
- package/dist/cjs/types/components/display-text/index.d.ts +1 -0
- package/dist/cjs/types/components/dropdown-menu/dropdown-menu-content.d.ts +67 -0
- package/dist/cjs/types/components/dropdown-menu/dropdown-menu-divider.d.ts +4 -0
- package/dist/cjs/types/components/dropdown-menu/dropdown-menu-item.d.ts +28 -0
- package/dist/cjs/types/components/dropdown-menu/dropdown-menu-trigger.d.ts +5 -0
- package/dist/cjs/types/components/dropdown-menu/dropdown-menu.d.ts +29 -0
- package/dist/cjs/types/components/dropdown-menu/index.d.ts +1 -0
- package/dist/cjs/types/components/heading/heading.d.ts +1 -445
- package/dist/cjs/types/components/index.d.ts +5 -1
- package/dist/cjs/types/components/radio-group/radio-card.d.ts +5 -2
- package/dist/cjs/types/components/radio-group/radio-group-label.d.ts +2 -2
- package/dist/cjs/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/cjs/types/components/switch/index.d.ts +1 -0
- package/dist/cjs/types/components/switch/switch.d.ts +35 -0
- package/dist/cjs/types/components/toast/index.d.ts +1 -0
- package/dist/cjs/types/components/toast/toast-provider.d.ts +4 -0
- package/dist/cjs/types/components/toast/toast-store.d.ts +44 -0
- package/dist/cjs/types/components/toast/toast-styles.d.ts +410 -0
- package/dist/cjs/types/components/toast/toast.d.ts +13 -0
- package/dist/cjs/types/styles/common-styles.d.ts +1 -1
- package/dist/cjs/types/theme/foundations/radius.d.ts +1 -1
- package/dist/cjs/types/utils/html-attributes.d.ts +1 -0
- package/dist/esm/index.js +1323 -1328
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/checkbox/checkbox.d.ts +70 -0
- package/dist/esm/types/components/checkbox/index.d.ts +1 -0
- package/dist/esm/types/components/display-text/display-text.d.ts +29 -0
- package/dist/esm/types/components/display-text/index.d.ts +1 -0
- package/dist/esm/types/components/dropdown-menu/dropdown-menu-content.d.ts +67 -0
- package/dist/esm/types/components/dropdown-menu/dropdown-menu-divider.d.ts +4 -0
- package/dist/esm/types/components/dropdown-menu/dropdown-menu-item.d.ts +28 -0
- package/dist/esm/types/components/dropdown-menu/dropdown-menu-trigger.d.ts +5 -0
- package/dist/esm/types/components/dropdown-menu/dropdown-menu.d.ts +29 -0
- package/dist/esm/types/components/dropdown-menu/index.d.ts +1 -0
- package/dist/esm/types/components/heading/heading.d.ts +1 -445
- package/dist/esm/types/components/index.d.ts +5 -1
- package/dist/esm/types/components/radio-group/radio-card.d.ts +5 -2
- package/dist/esm/types/components/radio-group/radio-group-label.d.ts +2 -2
- package/dist/esm/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/esm/types/components/switch/index.d.ts +1 -0
- package/dist/esm/types/components/switch/switch.d.ts +35 -0
- package/dist/esm/types/components/toast/index.d.ts +1 -0
- package/dist/esm/types/components/toast/toast-provider.d.ts +4 -0
- package/dist/esm/types/components/toast/toast-store.d.ts +44 -0
- package/dist/esm/types/components/toast/toast-styles.d.ts +410 -0
- package/dist/esm/types/components/toast/toast.d.ts +13 -0
- package/dist/esm/types/styles/common-styles.d.ts +1 -1
- package/dist/esm/types/theme/foundations/radius.d.ts +1 -1
- package/dist/esm/types/utils/html-attributes.d.ts +1 -0
- package/dist/index.d.ts +352 -543
- package/package.json +11 -4
- package/dist/cjs/types/components/image/image.d.ts +0 -16
- package/dist/cjs/types/components/image/index.d.ts +0 -1
- package/dist/esm/types/components/image/image.d.ts +0 -16
- package/dist/esm/types/components/image/index.d.ts +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
+
interface CheckboxOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The label for the checkbox. Accepts a string, or a React component for rendering links within the label.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```jsx
|
|
9
|
+
* <Checkbox label="I agree to the terms and conditions" />
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```jsx
|
|
14
|
+
* <Checkbox
|
|
15
|
+
* label={
|
|
16
|
+
* <>
|
|
17
|
+
* I agree to <Link href="/terms">the terms and conditions</Link>
|
|
18
|
+
* </>
|
|
19
|
+
* }
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
label: string | ReactElement<unknown>;
|
|
24
|
+
/**
|
|
25
|
+
* The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
|
|
26
|
+
*/
|
|
27
|
+
isDefaultChecked?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
|
|
30
|
+
*/
|
|
31
|
+
defaultChecked?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The controlled checked state of the checkbox. Must be used in conjunction with `onCheckedChange`.
|
|
34
|
+
*/
|
|
35
|
+
isChecked?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The controlled checked state of the checkbox. Must be used in conjunction with `onCheckedChange`.
|
|
38
|
+
*/
|
|
39
|
+
checked?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Event handler called when the checked state of the checkbox changes.
|
|
42
|
+
*/
|
|
43
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
44
|
+
/**
|
|
45
|
+
* If `true` the checkbox will render in its invalid state.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
isInvalid?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* If `true` it prevents the user from interacting with the checkbox.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
isDisabled?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* If `true` the user must check the checkbox before the owning form can be submitted.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
isRequired?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The name of the checkbox. Submitted with its owning form as part of a name/value pair.
|
|
61
|
+
*/
|
|
62
|
+
name?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The value given as data when submitted with a `name`.
|
|
65
|
+
*/
|
|
66
|
+
value?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare type CheckboxProps = Omit<CheckboxPrimitive.CheckboxProps, 'asChild' | 'children' | 'checked' | 'defaultChecked' | keyof CheckboxOptions> & CheckboxOptions;
|
|
69
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps, "children" | "asChild" | keyof CheckboxOptions> & CheckboxOptions & import("react").RefAttributes<HTMLButtonElement>>;
|
|
70
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './checkbox';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type * as Polymorphic from '../../utils/polymorphic';
|
|
2
|
+
import type { Theme } from '../../theme';
|
|
3
|
+
declare type DisplaySize = keyof Theme['typography']['display'];
|
|
4
|
+
declare type DisplayTextAlign = 'left' | 'center' | 'right';
|
|
5
|
+
declare type DisplayTextWrap = 'pretty' | 'balance' | 'wrap' | 'nowrap' | 'stable';
|
|
6
|
+
interface DisplayTextOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Sets the visual size of the display text.
|
|
9
|
+
* To override the rendered tag, use the `as` prop.
|
|
10
|
+
*
|
|
11
|
+
* @default 'md'
|
|
12
|
+
*/
|
|
13
|
+
size?: DisplaySize;
|
|
14
|
+
/**
|
|
15
|
+
* Sets the text alignment
|
|
16
|
+
* @default 'left'
|
|
17
|
+
*/
|
|
18
|
+
textAlign?: DisplayTextAlign;
|
|
19
|
+
/**
|
|
20
|
+
* Sets the text wrapping
|
|
21
|
+
* @default 'pretty'
|
|
22
|
+
* Read more on [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/text-wrap)
|
|
23
|
+
*/
|
|
24
|
+
textWrap?: DisplayTextWrap;
|
|
25
|
+
}
|
|
26
|
+
declare type DisplayTextComponent = Polymorphic.ForwardRefComponent<'h2', DisplayTextOptions>;
|
|
27
|
+
export declare type DisplayTextProps = Polymorphic.PropsOf<DisplayTextComponent>;
|
|
28
|
+
export declare const DisplayText: DisplayTextComponent;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './display-text';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as DropdownPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
import type { HTMLQdsProps } from '../../types';
|
|
4
|
+
declare type PrimitiveContentProps = DropdownPrimitive.MenuContentProps;
|
|
5
|
+
interface DropdownMenuContentOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Event handler called when focus moves to the trigger after closing.
|
|
8
|
+
* It can be prevented by calling `event.preventDefault`.
|
|
9
|
+
*/
|
|
10
|
+
onCloseAutofocus?: PrimitiveContentProps['onCloseAutoFocus'];
|
|
11
|
+
/**
|
|
12
|
+
* Event handler called when the escape key is down.
|
|
13
|
+
* It can be prevented by calling `event.preventDefault`.
|
|
14
|
+
*/
|
|
15
|
+
onEscapeKeyDown?: PrimitiveContentProps['onEscapeKeyDown'];
|
|
16
|
+
/**
|
|
17
|
+
* Event handler called when a pointer event occurs outside the bounds of the component.
|
|
18
|
+
* It can be prevented by calling `event.preventDefault`.
|
|
19
|
+
*/
|
|
20
|
+
onPointerDownOutside?: PrimitiveContentProps['onPointerDownOutside'];
|
|
21
|
+
/**
|
|
22
|
+
* Event handler called when focus moves outside the bounds of the component.
|
|
23
|
+
* It can be prevented by calling `event.preventDefault`.
|
|
24
|
+
*/
|
|
25
|
+
onFocusOutside?: PrimitiveContentProps['onFocusOutside'];
|
|
26
|
+
/**
|
|
27
|
+
* Event handler called when an interaction (pointer or focus event) happens outside the bounds of the component.
|
|
28
|
+
* It can be prevented by calling `event.preventDefault`.
|
|
29
|
+
*/
|
|
30
|
+
onInteractOutside?: PrimitiveContentProps['onInteractOutside'];
|
|
31
|
+
/**
|
|
32
|
+
* The preferred side of the trigger to render against when open.
|
|
33
|
+
* Will be reversed when collisions occur and `avoidCollisions` is enabled.
|
|
34
|
+
*
|
|
35
|
+
* @default "bottom"
|
|
36
|
+
*/
|
|
37
|
+
side?: PrimitiveContentProps['side'];
|
|
38
|
+
/**
|
|
39
|
+
* The distance in pixels from the trigger.
|
|
40
|
+
*
|
|
41
|
+
* @default 8
|
|
42
|
+
*/
|
|
43
|
+
sideOffset?: PrimitiveContentProps['sideOffset'];
|
|
44
|
+
/**
|
|
45
|
+
* The preferred alignment against the trigger. May change when collisions occur.
|
|
46
|
+
*
|
|
47
|
+
* @default "center"
|
|
48
|
+
*/
|
|
49
|
+
align?: PrimitiveContentProps['align'];
|
|
50
|
+
/**
|
|
51
|
+
* The element used as the collision boundary.
|
|
52
|
+
* By default this is the viewport, though you can provide additional element(s) to be included in this check.
|
|
53
|
+
*
|
|
54
|
+
* @default []
|
|
55
|
+
*/
|
|
56
|
+
collisionBoundary?: PrimitiveContentProps['collisionBoundary'];
|
|
57
|
+
/**
|
|
58
|
+
* Whether to hide the content when the trigger becomes fully occluded.
|
|
59
|
+
*
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
hideWhenDetached?: PrimitiveContentProps['hideWhenDetached'];
|
|
63
|
+
}
|
|
64
|
+
export interface DropdownMenuContentProps extends HTMLQdsProps<'div'>, DropdownMenuContentOptions {
|
|
65
|
+
}
|
|
66
|
+
export declare const DropdownMenuContent: import("react").ForwardRefExoticComponent<DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { HTMLQdsProps } from '../../types';
|
|
3
|
+
export declare type DropdownMenuDividerProps = HTMLQdsProps<'div'>;
|
|
4
|
+
export declare const DropdownMenuDivider: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import * as DropdownPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
import type { IconProps } from '../icon';
|
|
4
|
+
interface DropdownMenuItemOptions {
|
|
5
|
+
/**
|
|
6
|
+
* If `true`, the item will be disabled
|
|
7
|
+
*/
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Event handler called when the user selects an item (via mouse or keyboard).
|
|
11
|
+
* Calling `event.preventDefault` in this handler will prevent the dropdown from closing when selecting that item.
|
|
12
|
+
*/
|
|
13
|
+
onSelect?: (event: Event) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Optional text used for typeahead purposes.
|
|
16
|
+
* By default the typeahead behavior will use the `.textContent` of the item.
|
|
17
|
+
* Use this when the content is complex, or you have non-textual content inside.
|
|
18
|
+
*/
|
|
19
|
+
textValue?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional icon to display on the left side of the item content.
|
|
22
|
+
*/
|
|
23
|
+
icon?: ElementType<IconProps>;
|
|
24
|
+
}
|
|
25
|
+
export interface DropdownMenuItemProps extends Omit<DropdownPrimitive.DropdownMenuItemProps, 'asChild' | keyof DropdownMenuItemOptions>, DropdownMenuItemOptions {
|
|
26
|
+
}
|
|
27
|
+
export declare const DropdownMenuItem: import("react").ForwardRefExoticComponent<DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as Polymorphic from '../../utils/polymorphic';
|
|
2
|
+
declare type DropdownTriggerComponent = Polymorphic.ForwardRefComponent<'button'>;
|
|
3
|
+
export declare type DropdownMenuTriggerProps = Polymorphic.PropsOf<DropdownTriggerComponent>;
|
|
4
|
+
export declare const DropdownMenuTrigger: DropdownTriggerComponent;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type DropdownMenuContentProps } from './dropdown-menu-content';
|
|
3
|
+
import { type DropdownMenuDividerProps } from './dropdown-menu-divider';
|
|
4
|
+
import { type DropdownMenuItemProps } from './dropdown-menu-item';
|
|
5
|
+
import type { DropdownMenuTriggerProps } from './dropdown-menu-trigger';
|
|
6
|
+
interface DropdownMenuRootProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* If `true` the dropdown menu will be open
|
|
10
|
+
*/
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The open state of the submenu when it is initially rendered.
|
|
14
|
+
* Use when you do not need to control its open state.
|
|
15
|
+
*/
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Callback invoked open state changes
|
|
19
|
+
*/
|
|
20
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
21
|
+
}
|
|
22
|
+
declare function DropdownMenuRoot(props: DropdownMenuRootProps): JSX.Element;
|
|
23
|
+
export declare const DropdownMenu: typeof DropdownMenuRoot & {
|
|
24
|
+
Trigger: import("../../utils/polymorphic").ForwardRefComponent<"button", {}>;
|
|
25
|
+
Content: import("react").ForwardRefExoticComponent<DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
Item: import("react").ForwardRefExoticComponent<DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
+
Divider: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
};
|
|
29
|
+
export type { DropdownMenuRootProps, DropdownMenuTriggerProps, DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuDividerProps, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dropdown-menu';
|