@beaubrain/web-design-system 0.1.14 → 0.1.16
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/assets/web-design-system.css +1 -1
- package/dist/components/Calendar/calendar.helpers.d.ts +24 -0
- package/dist/components/CheckableSelectBox/checkableSelectBox.base.d.ts +53 -5
- package/dist/components/CheckableSelectBox/index.d.ts +18 -18
- package/dist/components/ConfirmDialog/index.d.ts +23 -0
- package/dist/components/Popup/index.d.ts +23 -0
- package/dist/components/Popup/popup.base.d.ts +53 -0
- package/dist/components/Popup/popup.defs.d.ts +27 -0
- package/dist/components/Popup/popup.helpers.d.ts +14 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/index.js +1914 -1259
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ButtonProps } from '../Button';
|
|
2
|
+
import { PopupContentPropDefs, PopupContentProps, PopupRootProps } from '../Popup';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
type PopupContentSize = (typeof PopupContentPropDefs.size.values)[number];
|
|
5
|
+
type ConfirmDialogSize = PopupContentSize extends `${infer N extends number}` ? N : never;
|
|
6
|
+
interface ConfirmDialogProps extends Pick<PopupRootProps, 'closeOnEscape' | 'closeOnOverlayClick' | 'lockScroll' | 'onOpenChange' | 'open'> {
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
onConfirm: () => void | Promise<void>;
|
|
10
|
+
onCancel?: () => void | Promise<void>;
|
|
11
|
+
confirmText?: React.ReactNode;
|
|
12
|
+
confirmDisabled?: boolean;
|
|
13
|
+
cancelText?: React.ReactNode;
|
|
14
|
+
closeOnConfirm?: boolean;
|
|
15
|
+
closeOnCancel?: boolean;
|
|
16
|
+
size?: ConfirmDialogSize;
|
|
17
|
+
contentWidth?: PopupContentProps['contentWidth'];
|
|
18
|
+
buttonSize?: ButtonProps['size'];
|
|
19
|
+
buttonRadius?: ButtonProps['radius'];
|
|
20
|
+
}
|
|
21
|
+
declare const ConfirmDialog: React.ForwardRefExoticComponent<ConfirmDialogProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export default ConfirmDialog;
|
|
23
|
+
export type { ConfirmDialogProps };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PopupBody, PopupContent, PopupFooter, PopupHeader, PopupIcon, PopupMessage, PopupOverlay, PopupPortal, PopupRoot, PopupTitle } from './popup.base';
|
|
2
|
+
export declare const Popup: (({ __scopePopup, children, open, onOpenChange, closeOnEscape, closeOnOverlayClick, lockScroll, }: import('./popup.base').PopupRootProps & {
|
|
3
|
+
__scopePopup?: import('../../core/react').Scope;
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
5
|
+
Root: ({ __scopePopup, children, open, onOpenChange, closeOnEscape, closeOnOverlayClick, lockScroll, }: import('./popup.base').PopupRootProps & {
|
|
6
|
+
__scopePopup?: import('../../core/react').Scope;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Portal: ({ __scopePopup, children, container, forceMount, }: import('./popup.base').PopupPortalProps & {
|
|
9
|
+
__scopePopup?: import('../../core/react').Scope;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
Overlay: import('react').ForwardRefExoticComponent<import('./popup.base').PopupOverlayProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
|
+
Content: import('react').ForwardRefExoticComponent<import('./popup.base').PopupContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
|
+
Header: import('react').ForwardRefExoticComponent<import('./popup.base').PopupHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Title: import('react').ForwardRefExoticComponent<import('./popup.base').PopupTitleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
|
+
Icon: import('react').ForwardRefExoticComponent<import('./popup.base').PopupIconProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
16
|
+
Message: import('react').ForwardRefExoticComponent<import('./popup.base').PopupMessageProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
17
|
+
Body: import('react').ForwardRefExoticComponent<import('./popup.base').PopupBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
18
|
+
Footer: import('react').ForwardRefExoticComponent<import('./popup.base').PopupFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
19
|
+
};
|
|
20
|
+
export default Popup;
|
|
21
|
+
export { PopupRoot as Root, PopupPortal as Portal, PopupOverlay as Overlay, PopupContent as Content, PopupHeader as Header, PopupTitle as Title, PopupIcon as Icon, PopupMessage as Message, PopupBody as Body, PopupFooter as Footer, };
|
|
22
|
+
export { PopupContentPropDefs, PopupFooterPropDefs } from './popup.defs';
|
|
23
|
+
export type { PopupRootProps, PopupPortalProps, PopupOverlayProps, PopupContentProps, PopupHeaderProps, PopupTitleProps, PopupIconProps, PopupMessageProps, PopupBodyProps, PopupFooterProps, } from './popup.base';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Scope } from '../../core/react';
|
|
2
|
+
import { Base } from '../__internal';
|
|
3
|
+
import { PopupContentDefProps, PopupFooterDefProps } from './popup.defs';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
type ScopedProps<P> = P & {
|
|
6
|
+
__scopePopup?: Scope;
|
|
7
|
+
};
|
|
8
|
+
interface PopupRootProps {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
open: boolean;
|
|
11
|
+
onOpenChange: (open: boolean) => void;
|
|
12
|
+
closeOnEscape?: boolean;
|
|
13
|
+
closeOnOverlayClick?: boolean;
|
|
14
|
+
lockScroll?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const PopupRoot: ({ __scopePopup, children, open, onOpenChange, closeOnEscape, closeOnOverlayClick, lockScroll, }: ScopedProps<PopupRootProps>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
interface PopupPortalProps {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
container?: HTMLElement | null;
|
|
20
|
+
forceMount?: true;
|
|
21
|
+
}
|
|
22
|
+
declare const PopupPortal: ({ __scopePopup, children, container, forceMount, }: ScopedProps<PopupPortalProps>) => import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
type BaseDivProps = React.ComponentPropsWithoutRef<typeof Base.div>;
|
|
24
|
+
interface PopupOverlayProps extends BaseDivProps {
|
|
25
|
+
}
|
|
26
|
+
declare const PopupOverlay: React.ForwardRefExoticComponent<PopupOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
type PopupContentOwnProps = React.ComponentPropsWithoutRef<typeof Base.div> & PopupContentDefProps & {
|
|
28
|
+
contentWidth?: number | string;
|
|
29
|
+
};
|
|
30
|
+
interface PopupContentProps extends PopupContentOwnProps {
|
|
31
|
+
}
|
|
32
|
+
declare const PopupContent: React.ForwardRefExoticComponent<PopupContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
interface PopupHeaderProps extends React.ComponentPropsWithoutRef<typeof Base.div> {
|
|
34
|
+
}
|
|
35
|
+
declare const PopupHeader: React.ForwardRefExoticComponent<PopupHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
interface PopupTitleProps extends React.ComponentPropsWithoutRef<typeof Base.div> {
|
|
37
|
+
}
|
|
38
|
+
declare const PopupTitle: React.ForwardRefExoticComponent<PopupTitleProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
interface PopupIconProps extends React.ComponentPropsWithoutRef<typeof Base.div> {
|
|
40
|
+
}
|
|
41
|
+
declare const PopupIcon: React.ForwardRefExoticComponent<PopupIconProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
interface PopupMessageProps extends React.ComponentPropsWithoutRef<typeof Base.div> {
|
|
43
|
+
}
|
|
44
|
+
declare const PopupMessage: React.ForwardRefExoticComponent<PopupMessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
interface PopupBodyProps extends React.ComponentPropsWithoutRef<typeof Base.div> {
|
|
46
|
+
}
|
|
47
|
+
declare const PopupBody: React.ForwardRefExoticComponent<PopupBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
48
|
+
type PopupFooterOwnProps = React.ComponentPropsWithoutRef<typeof Base.div> & PopupFooterDefProps;
|
|
49
|
+
interface PopupFooterProps extends PopupFooterOwnProps {
|
|
50
|
+
}
|
|
51
|
+
declare const PopupFooter: React.ForwardRefExoticComponent<PopupFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
52
|
+
export { PopupRoot, PopupPortal, PopupOverlay, PopupContent, PopupHeader, PopupTitle, PopupIcon, PopupMessage, PopupBody, PopupFooter, };
|
|
53
|
+
export type { PopupRootProps, PopupPortalProps, PopupOverlayProps, PopupContentProps, PopupHeaderProps, PopupTitleProps, PopupIconProps, PopupMessageProps, PopupBodyProps, PopupFooterProps, };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GetPropDefTypes } from '../../core/defs';
|
|
2
|
+
declare const PopupContentPropDefs: {
|
|
3
|
+
size: {
|
|
4
|
+
type: "enum";
|
|
5
|
+
className: string;
|
|
6
|
+
values: readonly ["1", "2"];
|
|
7
|
+
default: "2";
|
|
8
|
+
};
|
|
9
|
+
variant: {
|
|
10
|
+
type: "enum";
|
|
11
|
+
className: string;
|
|
12
|
+
values: readonly ["basic", "notice", "status"];
|
|
13
|
+
default: "basic";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
declare const PopupFooterPropDefs: {
|
|
17
|
+
layout: {
|
|
18
|
+
type: "enum";
|
|
19
|
+
className: string;
|
|
20
|
+
values: readonly ["right", "fill", "left"];
|
|
21
|
+
default: "left";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type PopupContentDefProps = GetPropDefTypes<typeof PopupContentPropDefs>;
|
|
25
|
+
type PopupFooterDefProps = GetPropDefTypes<typeof PopupFooterPropDefs>;
|
|
26
|
+
export { PopupContentPropDefs, PopupFooterPropDefs };
|
|
27
|
+
export type { PopupContentDefProps, PopupFooterDefProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Scope } from '../../core/react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type PopupLayoutVariant = 'basic' | 'notice' | 'status';
|
|
4
|
+
type PopupPart = 'body' | 'footer' | 'header' | 'icon' | 'message';
|
|
5
|
+
declare function markPopupPart(component: unknown, part: PopupPart): void;
|
|
6
|
+
declare function resolvePopupContentWidth(contentWidth: number | string | undefined): string | undefined;
|
|
7
|
+
declare function getPopupContentChildren(variant: PopupLayoutVariant, children: React.ReactNode): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
8
|
+
declare function getFocusableElements(container: HTMLElement): HTMLElement[];
|
|
9
|
+
declare function stripPopupScope<P extends {
|
|
10
|
+
__scopePopup?: Scope;
|
|
11
|
+
}>(props: P): Omit<P, '__scopePopup'>;
|
|
12
|
+
declare function trapFocus(event: React.KeyboardEvent, container: HTMLElement | null): void;
|
|
13
|
+
export { getFocusableElements, getPopupContentChildren, markPopupPart, resolvePopupContentWidth, stripPopupScope, trapFocus, };
|
|
14
|
+
export type { PopupLayoutVariant };
|
|
@@ -3,7 +3,9 @@ export { default as Flex, type FlexProps } from './Flex/index.js';
|
|
|
3
3
|
export { default as Button, type ButtonProps } from './Button/index.js';
|
|
4
4
|
export { default as Spinner, type SpinnerProps } from './Spinner/index.js';
|
|
5
5
|
export { default as Checkbox, type CheckboxProps } from './Checkbox/index.js';
|
|
6
|
-
export { default as
|
|
6
|
+
export { default as ConfirmDialog, type ConfirmDialogProps } from './ConfirmDialog/index.js';
|
|
7
|
+
export { default as CheckableSelectBox, type CheckableSelectBoxProps, type CheckableSelectBoxRootProps, type CheckableSelectBoxTriggerProps, type CheckableSelectBoxContentProps, type CheckableSelectBoxItemProps, type CheckableSelectBoxItemRenderState, type CheckableSelectBoxValueProps, type CheckableSelectBoxSlotProps, type CheckableSelectBoxValueLabelMap, type CheckableSelectItem, } from './CheckableSelectBox/index.js';
|
|
8
|
+
export { default as Popup, type PopupRootProps, type PopupPortalProps, type PopupOverlayProps, type PopupContentProps, type PopupHeaderProps, type PopupTitleProps, type PopupIconProps, type PopupMessageProps, type PopupBodyProps, type PopupFooterProps, } from './Popup/index.js';
|
|
7
9
|
export { default as CheckboxGroup, type CheckboxGroupRootProps, type CheckboxGroupItemProps, } from './CheckboxGroup';
|
|
8
10
|
export { default as Radio, type RadioProps } from './Radio/index.js';
|
|
9
11
|
export { default as RadioGroup, type RadioGroupRootProps, type RadioGroupItemProps, } from './RadioGroup';
|