@wavv/ui 1.9.4 → 1.9.5
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/build/cjs/types/theme/colorsIndex.d.ts +3 -0
- package/build/colors.ts +150 -0
- package/build/esm/types/theme/colorsIndex.d.ts +3 -0
- package/build/types/assets/icons/ActivityHistory.d.ts +3 -0
- package/build/types/assets/icons/Add.d.ts +3 -0
- package/build/types/assets/icons/AddCircle.d.ts +3 -0
- package/build/types/assets/icons/AddCircleOutline.d.ts +3 -0
- package/build/types/assets/icons/AddPerson.d.ts +3 -0
- package/build/types/assets/icons/ArrowDown.d.ts +3 -0
- package/build/types/assets/icons/ArrowLeft.d.ts +3 -0
- package/build/types/assets/icons/ArrowRight.d.ts +3 -0
- package/build/types/assets/icons/ArrowUp.d.ts +3 -0
- package/build/types/assets/icons/Attachment.d.ts +3 -0
- package/build/types/assets/icons/Calendar.d.ts +3 -0
- package/build/types/assets/icons/Camera.d.ts +3 -0
- package/build/types/assets/icons/Card.d.ts +3 -0
- package/build/types/assets/icons/CaretDown.d.ts +3 -0
- package/build/types/assets/icons/CaretUp.d.ts +3 -0
- package/build/types/assets/icons/Check.d.ts +3 -0
- package/build/types/assets/icons/CheckBadge.d.ts +3 -0
- package/build/types/assets/icons/CheckCircle.d.ts +3 -0
- package/build/types/assets/icons/CheckCircleOutline.d.ts +3 -0
- package/build/types/assets/icons/Checkbox.d.ts +3 -0
- package/build/types/assets/icons/CheckboxOff.d.ts +3 -0
- package/build/types/assets/icons/CheckboxPartial.d.ts +3 -0
- package/build/types/assets/icons/ChevronDown.d.ts +3 -0
- package/build/types/assets/icons/ChevronLeft.d.ts +3 -0
- package/build/types/assets/icons/ChevronRight.d.ts +3 -0
- package/build/types/assets/icons/ChevronUp.d.ts +3 -0
- package/build/types/assets/icons/Clapperboard.d.ts +3 -0
- package/build/types/assets/icons/ClapperboardOpen.d.ts +3 -0
- package/build/types/assets/icons/Close.d.ts +3 -0
- package/build/types/assets/icons/CloseCircle.d.ts +3 -0
- package/build/types/assets/icons/CloseCircleOutline.d.ts +3 -0
- package/build/types/assets/icons/Copy.d.ts +3 -0
- package/build/types/assets/icons/Devices.d.ts +3 -0
- package/build/types/assets/icons/Dialpad.d.ts +3 -0
- package/build/types/assets/icons/DoubleArrowLeft.d.ts +3 -0
- package/build/types/assets/icons/DoubleArrowRight.d.ts +3 -0
- package/build/types/assets/icons/Download.d.ts +3 -0
- package/build/types/assets/icons/Drag.d.ts +3 -0
- package/build/types/assets/icons/Edit.d.ts +3 -0
- package/build/types/assets/icons/Emoji.d.ts +3 -0
- package/build/types/assets/icons/EyeOff.d.ts +3 -0
- package/build/types/assets/icons/EyeOn.d.ts +3 -0
- package/build/types/assets/icons/Facebook.d.ts +3 -0
- package/build/types/assets/icons/Filter.d.ts +3 -0
- package/build/types/assets/icons/Flask.d.ts +3 -0
- package/build/types/assets/icons/Group.d.ts +3 -0
- package/build/types/assets/icons/Heart.d.ts +3 -0
- package/build/types/assets/icons/HeartOutline.d.ts +3 -0
- package/build/types/assets/icons/Help.d.ts +3 -0
- package/build/types/assets/icons/Hourglass.d.ts +3 -0
- package/build/types/assets/icons/Info.d.ts +3 -0
- package/build/types/assets/icons/Instagram.d.ts +3 -0
- package/build/types/assets/icons/KebabMenu.d.ts +3 -0
- package/build/types/assets/icons/Link.d.ts +3 -0
- package/build/types/assets/icons/Linkedin.d.ts +3 -0
- package/build/types/assets/icons/Loading.d.ts +3 -0
- package/build/types/assets/icons/Logout.d.ts +3 -0
- package/build/types/assets/icons/Maximize.d.ts +3 -0
- package/build/types/assets/icons/Menu.d.ts +3 -0
- package/build/types/assets/icons/Merge.d.ts +3 -0
- package/build/types/assets/icons/MergeField.d.ts +3 -0
- package/build/types/assets/icons/Message.d.ts +3 -0
- package/build/types/assets/icons/Mic.d.ts +3 -0
- package/build/types/assets/icons/MicOff.d.ts +3 -0
- package/build/types/assets/icons/Minimize.d.ts +3 -0
- package/build/types/assets/icons/Mobile.d.ts +3 -0
- package/build/types/assets/icons/NotAllowed.d.ts +3 -0
- package/build/types/assets/icons/Open.d.ts +3 -0
- package/build/types/assets/icons/Pause.d.ts +3 -0
- package/build/types/assets/icons/PauseOutline.d.ts +3 -0
- package/build/types/assets/icons/Person.d.ts +3 -0
- package/build/types/assets/icons/Phone.d.ts +3 -0
- package/build/types/assets/icons/PhoneBlocked.d.ts +3 -0
- package/build/types/assets/icons/PhoneCallback.d.ts +3 -0
- package/build/types/assets/icons/PhoneEnd.d.ts +3 -0
- package/build/types/assets/icons/PhoneForward.d.ts +3 -0
- package/build/types/assets/icons/PhoneHistory.d.ts +3 -0
- package/build/types/assets/icons/PhoneHold.d.ts +3 -0
- package/build/types/assets/icons/PhoneTalk.d.ts +3 -0
- package/build/types/assets/icons/PhoneTransfer.d.ts +3 -0
- package/build/types/assets/icons/Play.d.ts +3 -0
- package/build/types/assets/icons/PlayOutline.d.ts +3 -0
- package/build/types/assets/icons/ProfileUser.d.ts +3 -0
- package/build/types/assets/icons/RadioButton.d.ts +3 -0
- package/build/types/assets/icons/RadioButtonOff.d.ts +3 -0
- package/build/types/assets/icons/Record.d.ts +3 -0
- package/build/types/assets/icons/Refresh.d.ts +3 -0
- package/build/types/assets/icons/Rocket.d.ts +3 -0
- package/build/types/assets/icons/Schedule.d.ts +3 -0
- package/build/types/assets/icons/ScheduleOutline.d.ts +3 -0
- package/build/types/assets/icons/Screenshot.d.ts +3 -0
- package/build/types/assets/icons/Search.d.ts +3 -0
- package/build/types/assets/icons/Settings.d.ts +3 -0
- package/build/types/assets/icons/Share.d.ts +3 -0
- package/build/types/assets/icons/ShieldCheck.d.ts +3 -0
- package/build/types/assets/icons/ShieldSlash.d.ts +3 -0
- package/build/types/assets/icons/Sort.d.ts +3 -0
- package/build/types/assets/icons/Spotify.d.ts +3 -0
- package/build/types/assets/icons/Star.d.ts +3 -0
- package/build/types/assets/icons/StarOutline.d.ts +3 -0
- package/build/types/assets/icons/Stop.d.ts +3 -0
- package/build/types/assets/icons/StopOutline.d.ts +3 -0
- package/build/types/assets/icons/Template.d.ts +3 -0
- package/build/types/assets/icons/ToggleOff.d.ts +3 -0
- package/build/types/assets/icons/ToggleOn.d.ts +3 -0
- package/build/types/assets/icons/Transfer.d.ts +3 -0
- package/build/types/assets/icons/TransferCancel.d.ts +3 -0
- package/build/types/assets/icons/Trash.d.ts +3 -0
- package/build/types/assets/icons/Twitter.d.ts +3 -0
- package/build/types/assets/icons/Upload.d.ts +3 -0
- package/build/types/assets/icons/Video.d.ts +3 -0
- package/build/types/assets/icons/Voicemail.d.ts +3 -0
- package/build/types/assets/icons/VolOn.d.ts +3 -0
- package/build/types/assets/icons/Warning.d.ts +3 -0
- package/build/types/assets/icons/WarningCircleOutline.d.ts +3 -0
- package/build/types/assets/icons/Youtube.d.ts +3 -0
- package/build/types/components/Accordion.d.ts +45 -0
- package/build/types/components/Audio.d.ts +29 -0
- package/build/types/components/BarChart.d.ts +25 -0
- package/build/types/components/Button/Button.d.ts +17 -0
- package/build/types/components/Button/ButtonLoader.d.ts +4 -0
- package/build/types/components/Button/ButtonTypes.d.ts +150 -0
- package/build/types/components/Button/Group.d.ts +18 -0
- package/build/types/components/Button/index.d.ts +2 -0
- package/build/types/components/Calendar.d.ts +14 -0
- package/build/types/components/ChartHelpers.d.ts +36 -0
- package/build/types/components/Checkbox.d.ts +20 -0
- package/build/types/components/Code/Code.d.ts +26 -0
- package/build/types/components/Code/Copy.d.ts +4 -0
- package/build/types/components/Code/Endpoint.d.ts +5 -0
- package/build/types/components/Code/index.d.ts +2 -0
- package/build/types/components/DocTable.d.ts +7 -0
- package/build/types/components/DraftEditor.d.ts +56 -0
- package/build/types/components/Dropdown/Dropdown.d.ts +85 -0
- package/build/types/components/Dropdown/DropdownUtils.d.ts +56 -0
- package/build/types/components/Dropdown/index.d.ts +4 -0
- package/build/types/components/DropdownMenu.d.ts +78 -0
- package/build/types/components/Form.d.ts +174 -0
- package/build/types/components/FormControl.d.ts +18 -0
- package/build/types/components/Grid.d.ts +55 -0
- package/build/types/components/Icon/Icon.d.ts +38 -0
- package/build/types/components/Icon/icons.d.ts +222 -0
- package/build/types/components/Icon/index.d.ts +2 -0
- package/build/types/components/ImageViewer.d.ts +20 -0
- package/build/types/components/InlineCode.d.ts +7 -0
- package/build/types/components/Input.d.ts +192 -0
- package/build/types/components/InputHelpers.d.ts +90 -0
- package/build/types/components/Label.d.ts +16 -0
- package/build/types/components/LineChart.d.ts +3 -0
- package/build/types/components/Menu.d.ts +53 -0
- package/build/types/components/Message.d.ts +25 -0
- package/build/types/components/MessageHr.d.ts +11 -0
- package/build/types/components/Modal.d.ts +66 -0
- package/build/types/components/MultiSelect.d.ts +46 -0
- package/build/types/components/Notification.d.ts +14 -0
- package/build/types/components/Options.d.ts +45 -0
- package/build/types/components/Pagination.d.ts +13 -0
- package/build/types/components/PieChart.d.ts +18 -0
- package/build/types/components/Progress/CirclePercent.d.ts +10 -0
- package/build/types/components/Progress/Progress.d.ts +23 -0
- package/build/types/components/Progress/index.d.ts +2 -0
- package/build/types/components/Radio.d.ts +16 -0
- package/build/types/components/Slider.d.ts +15 -0
- package/build/types/components/Spacer.d.ts +6 -0
- package/build/types/components/Spinner.d.ts +16 -0
- package/build/types/components/Table/Body.d.ts +8 -0
- package/build/types/components/Table/Column.d.ts +10 -0
- package/build/types/components/Table/Content.d.ts +19 -0
- package/build/types/components/Table/Header.d.ts +7 -0
- package/build/types/components/Table/HeaderCell.d.ts +14 -0
- package/build/types/components/Table/Row.d.ts +3 -0
- package/build/types/components/Table/Table.d.ts +28 -0
- package/build/types/components/Table/context.d.ts +4 -0
- package/build/types/components/Table/index.d.ts +2 -0
- package/build/types/components/Table/types.d.ts +43 -0
- package/build/types/components/Table/utils.d.ts +4 -0
- package/build/types/components/Tabs.d.ts +31 -0
- package/build/types/components/Toggle.d.ts +18 -0
- package/build/types/components/Tooltip.d.ts +50 -0
- package/build/types/components/TransferList.d.ts +47 -0
- package/build/types/components/draftUtils.d.ts +49 -0
- package/build/types/components/helpers/getIcon.d.ts +8 -0
- package/build/types/components/helpers/getPopPosition.d.ts +6 -0
- package/build/types/components/helpers/isPropAllowed.d.ts +2 -0
- package/build/types/components/helpers/styledProps.d.ts +26 -0
- package/build/types/components/types.d.ts +80 -0
- package/build/types/global-styles/ResetStyles.d.ts +9 -0
- package/build/types/global-styles/ScrollbarStyles.d.ts +2 -0
- package/build/types/global-styles/ToastStyles.d.ts +2 -0
- package/build/types/global-styles/index.d.ts +3 -0
- package/build/types/hooks/index.d.ts +7 -0
- package/build/types/hooks/useConfirm.d.ts +13 -0
- package/build/types/hooks/useElementObserver.d.ts +8 -0
- package/build/types/hooks/useEventListener.d.ts +3 -0
- package/build/types/hooks/useOnClickOutside.d.ts +3 -0
- package/build/types/hooks/usePrevious.d.ts +2 -0
- package/build/types/hooks/useSelect.d.ts +20 -0
- package/build/types/hooks/useSelectAll.d.ts +12 -0
- package/build/types/hooks/useWindowSize.d.ts +5 -0
- package/build/types/index.d.ts +64 -0
- package/build/types/theme/ThemeTypes.d.ts +294 -0
- package/build/types/theme/colors.d.ts +201 -0
- package/build/types/theme/colorsIndex.d.ts +3 -0
- package/build/types/theme/common/button.d.ts +24 -0
- package/build/types/theme/common/common.d.ts +103 -0
- package/build/types/theme/common/index.d.ts +3 -0
- package/build/types/theme/dark.d.ts +3 -0
- package/build/types/theme/darkScale.d.ts +22 -0
- package/build/types/theme/index.d.ts +10 -0
- package/build/types/theme/light.d.ts +3 -0
- package/build/types/theme/lightScale.d.ts +22 -0
- package/build/types/utils/chunk.d.ts +2 -0
- package/build/types/utils/copyToClipboard.d.ts +2 -0
- package/build/types/utils/formatDate.d.ts +7 -0
- package/build/types/utils/index.d.ts +5 -0
- package/build/types/utils/numberWithCommas.d.ts +2 -0
- package/build/types/utils/range.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { EditorState, CompositeDecorator, RawDraftContentState, ContentState, RawDraftEntity } from 'draft-js';
|
|
2
|
+
import { MergeField } from './types';
|
|
3
|
+
export declare const decorator: CompositeDecorator;
|
|
4
|
+
export declare const decode: (data: RawDraftContentState) => string;
|
|
5
|
+
export declare const encode: (text: string, fields: MergeField[], displayValue: boolean) => ContentState;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a new EditorState using the content passed in.
|
|
8
|
+
* @param {string} value - The string of text to go in the editor
|
|
9
|
+
* @param {array} fields - Array of field objects
|
|
10
|
+
* @param {boolean} displayValue - Flag to display the merge fields value or label
|
|
11
|
+
*/
|
|
12
|
+
export declare const createStateWithContent: (value: string, fields: MergeField[], displayValue: boolean) => EditorState;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the raw form of the Editor content.
|
|
15
|
+
* @param {EditorState} state - The current state of the editor
|
|
16
|
+
* @param {boolean} decoded - Whether or not the state is to be decoded into plain text
|
|
17
|
+
*/
|
|
18
|
+
export declare const getRawState: (state: EditorState, decoded?: boolean) => string | RawDraftContentState;
|
|
19
|
+
/**
|
|
20
|
+
* Returns an array of entities contained in the EditorState.
|
|
21
|
+
* @param {EditorState} state - The current state of the editor
|
|
22
|
+
*/
|
|
23
|
+
export declare const getEntities: (state: EditorState) => RawDraftEntity<{
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}>[];
|
|
26
|
+
/**
|
|
27
|
+
* Checks if the editor contains any merged but unknown fields. Returns a true or false
|
|
28
|
+
* @param {EditorState} state - The current state of the editor
|
|
29
|
+
*/
|
|
30
|
+
export declare const hasMissingEntities: (state: EditorState) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Returns a new EditorState with a merge field inserted at the cursor, then places the cursor at the end of the newly inserted text.
|
|
33
|
+
* @param {object} field - The merge field object to be inserted
|
|
34
|
+
* @param {array} fields - Array of field objects
|
|
35
|
+
* @param {EditorState} state - The current state of the editor
|
|
36
|
+
* @param {boolean} displayValue - Flag to display the merge fields value or label
|
|
37
|
+
*/
|
|
38
|
+
export declare const insertFieldEntity: (field: MergeField, fields: MergeField[], state: EditorState, displayValue: boolean) => EditorState;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a new EditorState with the cursor focused at the end of the text.
|
|
41
|
+
* @param {EditorState} state - The current state of the editor
|
|
42
|
+
*/
|
|
43
|
+
export declare const getFocusStateAtEnd: (state: EditorState) => EditorState;
|
|
44
|
+
/**
|
|
45
|
+
* Returns a new EditorState with the pasted content merged in with the current state.
|
|
46
|
+
* @param {string} text - The text string being pasted
|
|
47
|
+
* @param {EditorState} state - The current state of the editor
|
|
48
|
+
*/
|
|
49
|
+
export declare const getPastedState: (text: string, state: EditorState) => EditorState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { IconProps } from '../Icon/Icon';
|
|
3
|
+
import { IconNames } from '../Icon/icons';
|
|
4
|
+
import { TooltipProps } from '../Tooltip';
|
|
5
|
+
export type IconType = IconNames | IconProps | ReactElement<IconProps> | ReactElement<TooltipProps>;
|
|
6
|
+
type ReducedIconProps = Omit<IconProps, 'name' | 'svg'>;
|
|
7
|
+
declare const getIcon: (icon: IconType, props?: ReducedIconProps) => ReactElement<IconProps | TooltipProps>;
|
|
8
|
+
export default getIcon;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Position, Margin, Padding, WidthHeight } from '../types';
|
|
2
|
+
export declare const widthHeightProps: ({ width, height }: WidthHeight) => {
|
|
3
|
+
width: string | number | undefined;
|
|
4
|
+
height: string | number | undefined;
|
|
5
|
+
};
|
|
6
|
+
export declare const paddingProps: ({ padding, paddingTop, paddingBottom, paddingRight, paddingLeft }: Padding) => {
|
|
7
|
+
padding: string | number | undefined;
|
|
8
|
+
paddingTop: string | number | undefined;
|
|
9
|
+
paddingBottom: string | number | undefined;
|
|
10
|
+
paddingRight: string | number | undefined;
|
|
11
|
+
paddingLeft: string | number | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare const marginProps: ({ margin, marginTop, marginBottom, marginRight, marginLeft }: Margin) => {
|
|
14
|
+
margin: string | number | undefined;
|
|
15
|
+
marginTop: string | number | undefined;
|
|
16
|
+
marginBottom: string | number | undefined;
|
|
17
|
+
marginRight: string | number | undefined;
|
|
18
|
+
marginLeft: string | number | undefined;
|
|
19
|
+
};
|
|
20
|
+
export declare const positionProps: ({ position, top, bottom, right, left }: Position) => {
|
|
21
|
+
position: import("../types").PositionType | undefined;
|
|
22
|
+
top: string | number | undefined;
|
|
23
|
+
bottom: string | number | undefined;
|
|
24
|
+
right: string | number | undefined;
|
|
25
|
+
left: string | number | undefined;
|
|
26
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ElementType, FocusEvent } from 'react';
|
|
2
|
+
export type { ThemeProp } from '../theme';
|
|
3
|
+
export type Margin = {
|
|
4
|
+
margin?: number | string;
|
|
5
|
+
marginTop?: number | string;
|
|
6
|
+
marginBottom?: number | string;
|
|
7
|
+
marginRight?: number | string;
|
|
8
|
+
marginLeft?: number | string;
|
|
9
|
+
};
|
|
10
|
+
export type Padding = {
|
|
11
|
+
padding?: number | string;
|
|
12
|
+
paddingTop?: number | string;
|
|
13
|
+
paddingBottom?: number | string;
|
|
14
|
+
paddingRight?: number | string;
|
|
15
|
+
paddingLeft?: number | string;
|
|
16
|
+
};
|
|
17
|
+
export type PositionType = 'static' | 'relative' | 'absolute' | 'sticky' | 'fixed';
|
|
18
|
+
export type Position = {
|
|
19
|
+
position?: PositionType;
|
|
20
|
+
top?: number | string;
|
|
21
|
+
bottom?: number | string;
|
|
22
|
+
right?: number | string;
|
|
23
|
+
left?: number | string;
|
|
24
|
+
};
|
|
25
|
+
export type MinWidth = {
|
|
26
|
+
minWidth?: number | string;
|
|
27
|
+
};
|
|
28
|
+
export type MinHeight = {
|
|
29
|
+
minHeight?: number | string;
|
|
30
|
+
};
|
|
31
|
+
export type MaxWidth = {
|
|
32
|
+
maxWidth?: number | string;
|
|
33
|
+
};
|
|
34
|
+
export type MaxHeight = {
|
|
35
|
+
maxHeight?: number | string;
|
|
36
|
+
};
|
|
37
|
+
export type Width = {
|
|
38
|
+
width?: number | string;
|
|
39
|
+
};
|
|
40
|
+
export type Height = {
|
|
41
|
+
height?: number | string;
|
|
42
|
+
};
|
|
43
|
+
export type WidthHeight = Width & Height;
|
|
44
|
+
export type MaxWidthHeight = MaxWidth & MaxHeight;
|
|
45
|
+
export type MinWidthHeight = MinWidth & MinHeight;
|
|
46
|
+
export type MarginPadding = Margin & Padding;
|
|
47
|
+
export type FlexPosition = 'start' | 'end' | 'center' | 'space-around' | 'space-between';
|
|
48
|
+
export type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
49
|
+
export type As = {
|
|
50
|
+
as?: ElementType<unknown>;
|
|
51
|
+
};
|
|
52
|
+
export type InputFocusEvent = FocusEvent<HTMLInputElement>;
|
|
53
|
+
export type MergeField = {
|
|
54
|
+
id: string;
|
|
55
|
+
label: string;
|
|
56
|
+
value?: string;
|
|
57
|
+
};
|
|
58
|
+
export type InputRef = {
|
|
59
|
+
focus: () => void;
|
|
60
|
+
blur: () => void;
|
|
61
|
+
select: () => void;
|
|
62
|
+
hasFocus: boolean;
|
|
63
|
+
};
|
|
64
|
+
export type MultiSelectRef = Omit<InputRef, 'hasFocus' | 'select'>;
|
|
65
|
+
export type AudioRef = {
|
|
66
|
+
play?: () => void;
|
|
67
|
+
pause?: () => void;
|
|
68
|
+
stop?: () => void;
|
|
69
|
+
};
|
|
70
|
+
export type DraftEditorRef = {
|
|
71
|
+
insertField: (field: MergeField) => void;
|
|
72
|
+
focusAtEnd: () => void;
|
|
73
|
+
};
|
|
74
|
+
type Top = 'top center' | 'top left' | 'top right';
|
|
75
|
+
type Bottom = 'bottom center' | 'bottom left' | 'bottom right';
|
|
76
|
+
type Left = 'left center' | 'left top' | 'left bottom';
|
|
77
|
+
type Right = 'right center' | 'right top' | 'right bottom';
|
|
78
|
+
export type PopSide = 'top' | 'bottom' | 'right' | 'left';
|
|
79
|
+
export type PopPosition = PopSide | Top | Bottom | Left | Right;
|
|
80
|
+
export type ArrowAlign = 'center' | 'start' | 'end';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import 'sanitize.css';
|
|
2
|
+
type ResetStylesProps = {
|
|
3
|
+
/** An array of font families to pass to the font loader */
|
|
4
|
+
families?: string[];
|
|
5
|
+
/** The default font family to set */
|
|
6
|
+
fontFamily?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const ResetStyles: ({ families, fontFamily }: ResetStylesProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default ResetStyles;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as useOnClickOutside } from './useOnClickOutside';
|
|
2
|
+
export { default as useWindowSize } from './useWindowSize';
|
|
3
|
+
export { default as useSelectAll } from './useSelectAll';
|
|
4
|
+
export { default as useEventListener } from './useEventListener';
|
|
5
|
+
export { default as useSelect } from './useSelect';
|
|
6
|
+
export { default as useElementObserver } from './useElementObserver';
|
|
7
|
+
export { default as usePrevious } from './usePrevious';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
header?: string;
|
|
3
|
+
text?: string;
|
|
4
|
+
cancelText?: string;
|
|
5
|
+
confirmText?: string;
|
|
6
|
+
input?: boolean;
|
|
7
|
+
inputLabel?: string;
|
|
8
|
+
inputPlaceholder?: string;
|
|
9
|
+
inputValue?: string;
|
|
10
|
+
negative?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const useConfirm: ({ header, text, cancelText, confirmText, negative, input, inputLabel, inputPlaceholder, inputValue, }?: Props) => readonly [() => Promise<boolean | string>, () => import("react/jsx-runtime").JSX.Element];
|
|
13
|
+
export default useConfirm;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A React hook that fires a callback whenever ResizeObserver detects a change to its size
|
|
4
|
+
* @param target A React ref created by useRef()
|
|
5
|
+
* @param callback Invoked with a single HTMLElement any time the target resizes
|
|
6
|
+
*/
|
|
7
|
+
declare const useElementObserver: <T extends HTMLElement>(target: RefObject<T>, callback: (node: T) => void) => void;
|
|
8
|
+
export default useElementObserver;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
declare const useEventListener: <T extends Event>(element: MutableRefObject<HTMLElement> | HTMLElement | Document | Window, type: keyof WindowEventMap, listener: (event: T) => void, condition?: boolean, dependencies?: unknown[]) => void;
|
|
3
|
+
export default useEventListener;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { OptionItem, SetValueFunc } from '../components/Dropdown/DropdownUtils';
|
|
3
|
+
type UseSelectProps<OptionType> = {
|
|
4
|
+
/** The options that will be displayed in the list */
|
|
5
|
+
options: OptionType[];
|
|
6
|
+
/** The function called when an option is selected */
|
|
7
|
+
select: SetValueFunc;
|
|
8
|
+
/** The function to close the open option list */
|
|
9
|
+
close: Function;
|
|
10
|
+
/** The function to open the closed option list */
|
|
11
|
+
open: Function;
|
|
12
|
+
/** The condition for when the list of options is open */
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
/** The condition for when the select element is focused */
|
|
15
|
+
isFocused?: boolean;
|
|
16
|
+
/** The text from a search Droppdown */
|
|
17
|
+
searchText?: string;
|
|
18
|
+
};
|
|
19
|
+
declare const useSelect: <OptionType extends OptionItem>({ options, select, close, open, searchText, isOpen, isFocused, }: UseSelectProps<OptionType>) => readonly [number, import("react").RefObject<HTMLDivElement>];
|
|
20
|
+
export default useSelect;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type ListItem = {
|
|
2
|
+
id: number | string;
|
|
3
|
+
[otherProps: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
declare const useSelectAll: (items: ListItem[], defaultSelected?: boolean) => {
|
|
6
|
+
list: ListItem[];
|
|
7
|
+
partial: boolean;
|
|
8
|
+
allSelected: boolean;
|
|
9
|
+
onSelectAll: (selectAll: boolean) => void;
|
|
10
|
+
onChildChange: (val: boolean, id: number | string) => void;
|
|
11
|
+
};
|
|
12
|
+
export default useSelectAll;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export { default as Accordion } from './components/Accordion';
|
|
2
|
+
export { default as Audio } from './components/Audio';
|
|
3
|
+
export { default as BarChart } from './components/BarChart';
|
|
4
|
+
export { default as Button } from './components/Button';
|
|
5
|
+
export { default as Calendar } from './components/Calendar';
|
|
6
|
+
export { default as Checkbox } from './components/Checkbox';
|
|
7
|
+
export { default as Code } from './components/Code';
|
|
8
|
+
export { default as DocTable } from './components/DocTable';
|
|
9
|
+
export { default as DraftEditor } from './components/DraftEditor';
|
|
10
|
+
export { default as Dropdown } from './components/Dropdown';
|
|
11
|
+
export { default as DropdownMenu } from './components/DropdownMenu';
|
|
12
|
+
export { default as Form } from './components/Form';
|
|
13
|
+
export { default as Grid } from './components/Grid';
|
|
14
|
+
export { default as Icon } from './components/Icon';
|
|
15
|
+
export { default as ImageViewer } from './components/ImageViewer';
|
|
16
|
+
export { default as InlineCode } from './components/InlineCode';
|
|
17
|
+
export { default as Input } from './components/Input';
|
|
18
|
+
export { default as InputUtils } from './components/InputHelpers';
|
|
19
|
+
export { default as Label } from './components/Label';
|
|
20
|
+
export { default as LineChart } from './components/LineChart';
|
|
21
|
+
export { default as Menu } from './components/Menu';
|
|
22
|
+
export { default as Message } from './components/Message';
|
|
23
|
+
export { default as MessageHr } from './components/MessageHr';
|
|
24
|
+
export { default as Modal } from './components/Modal';
|
|
25
|
+
export { default as MultiSelect } from './components/MultiSelect';
|
|
26
|
+
export { default as Notification } from './components/Notification';
|
|
27
|
+
export { default as Options } from './components/Options';
|
|
28
|
+
export { default as Pagination } from './components/Pagination';
|
|
29
|
+
export { default as PieChart } from './components/PieChart';
|
|
30
|
+
export { default as Progress } from './components/Progress';
|
|
31
|
+
export { default as Radio } from './components/Radio';
|
|
32
|
+
export { default as ResetStyles } from './global-styles/ResetStyles';
|
|
33
|
+
export { default as ScrollbarStyles } from './global-styles/ScrollbarStyles';
|
|
34
|
+
export { default as ToastStyles } from './global-styles/ToastStyles';
|
|
35
|
+
export { default as Slider } from './components/Slider';
|
|
36
|
+
export { default as Spacer } from './components/Spacer';
|
|
37
|
+
export { default as Spinner } from './components/Spinner';
|
|
38
|
+
export { default as TransferList } from './components/TransferList';
|
|
39
|
+
export { default as Table } from './components/Table';
|
|
40
|
+
export { default as Toggle } from './components/Toggle';
|
|
41
|
+
export { default as Tooltip } from './components/Tooltip';
|
|
42
|
+
export { default as Tabs } from './components/Tabs';
|
|
43
|
+
export { default as theme } from './theme';
|
|
44
|
+
export { default as colors } from './theme/colors';
|
|
45
|
+
export { default as darkScale } from './theme/darkScale';
|
|
46
|
+
export { default as lightScale } from './theme/lightScale';
|
|
47
|
+
export type { ITheme, ThemeProp } from './theme/ThemeTypes';
|
|
48
|
+
export type { IconNames } from './components/Icon/icons';
|
|
49
|
+
export type { TabItem } from './components/Tabs';
|
|
50
|
+
export type { DropdownOption } from './components/Dropdown';
|
|
51
|
+
export type { Item as TransferItem, Action as TransferAction, Next as TransferNext } from './components/TransferList';
|
|
52
|
+
export type { AudioRef, DraftEditorRef, InputRef, MultiSelectRef, Margin, Padding, Position, MinWidth, MaxWidth, MinHeight, MaxHeight, MinWidthHeight, MaxWidthHeight, Width, Height, WidthHeight, MarginPadding, FlexPosition, As, } from './components/types';
|
|
53
|
+
export { default as useEventListener } from './hooks/useEventListener';
|
|
54
|
+
export { default as useOnClickOutside } from './hooks/useOnClickOutside';
|
|
55
|
+
export { default as useSelect } from './hooks/useSelect';
|
|
56
|
+
export { default as useSelectAll } from './hooks/useSelectAll';
|
|
57
|
+
export { default as useWindowSize } from './hooks/useWindowSize';
|
|
58
|
+
export { default as useConfirm } from './hooks/useConfirm';
|
|
59
|
+
export { default as useElementObserver } from './hooks/useElementObserver';
|
|
60
|
+
export { default as usePrevious } from './hooks/usePrevious';
|
|
61
|
+
export { default as formatDate } from './utils/formatDate';
|
|
62
|
+
export { default as copyToClipboard } from './utils/copyToClipboard';
|
|
63
|
+
export { default as numberWithCommas } from './utils/numberWithCommas';
|
|
64
|
+
export { widthHeightProps, paddingProps, marginProps, positionProps } from './components/helpers/styledProps';
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { IColors } from './colors';
|
|
2
|
+
type ButtonSize = {
|
|
3
|
+
height: number;
|
|
4
|
+
iconSize: number;
|
|
5
|
+
font: number;
|
|
6
|
+
padding: number;
|
|
7
|
+
iconOnlyPadding: number;
|
|
8
|
+
};
|
|
9
|
+
type LinkColors = {
|
|
10
|
+
secondaryColor: {
|
|
11
|
+
default: string;
|
|
12
|
+
hover: string;
|
|
13
|
+
active: string;
|
|
14
|
+
};
|
|
15
|
+
positiveColor: {
|
|
16
|
+
default: string;
|
|
17
|
+
hover: string;
|
|
18
|
+
active: string;
|
|
19
|
+
};
|
|
20
|
+
negativeColor: {
|
|
21
|
+
default: string;
|
|
22
|
+
hover: string;
|
|
23
|
+
active: string;
|
|
24
|
+
};
|
|
25
|
+
cautionColor: {
|
|
26
|
+
default: string;
|
|
27
|
+
hover: string;
|
|
28
|
+
active: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type ButtonState = {
|
|
32
|
+
color: {
|
|
33
|
+
default: string;
|
|
34
|
+
hover: string;
|
|
35
|
+
active: string;
|
|
36
|
+
};
|
|
37
|
+
outlineColor: {
|
|
38
|
+
default: string;
|
|
39
|
+
hover: string;
|
|
40
|
+
active: string;
|
|
41
|
+
};
|
|
42
|
+
background: {
|
|
43
|
+
default: string;
|
|
44
|
+
hover: string;
|
|
45
|
+
active: string;
|
|
46
|
+
};
|
|
47
|
+
outlineBackground: {
|
|
48
|
+
default: string;
|
|
49
|
+
hover: string;
|
|
50
|
+
active: string;
|
|
51
|
+
};
|
|
52
|
+
border: {
|
|
53
|
+
default: string;
|
|
54
|
+
hover: string;
|
|
55
|
+
active: string;
|
|
56
|
+
};
|
|
57
|
+
divider: string;
|
|
58
|
+
};
|
|
59
|
+
export interface ITheme {
|
|
60
|
+
name: 'light' | 'dark';
|
|
61
|
+
accent: string;
|
|
62
|
+
accentShade: string;
|
|
63
|
+
background0: string;
|
|
64
|
+
background1: string;
|
|
65
|
+
background2: string;
|
|
66
|
+
background3: string;
|
|
67
|
+
background4: string;
|
|
68
|
+
background5: string;
|
|
69
|
+
/** 5% opacity */
|
|
70
|
+
scale0: string;
|
|
71
|
+
/** 10% opacity */
|
|
72
|
+
scale1: string;
|
|
73
|
+
/** 20% opacity */
|
|
74
|
+
scale2: string;
|
|
75
|
+
/** 30% opacity */
|
|
76
|
+
scale3: string;
|
|
77
|
+
/** 40% opacity */
|
|
78
|
+
scale4: string;
|
|
79
|
+
/** 50% opacity */
|
|
80
|
+
scale5: string;
|
|
81
|
+
/** 60% opacity */
|
|
82
|
+
scale6: string;
|
|
83
|
+
/** 70% opacity */
|
|
84
|
+
scale7: string;
|
|
85
|
+
/** 80% opacity */
|
|
86
|
+
scale8: string;
|
|
87
|
+
/** 90% opacity */
|
|
88
|
+
scale9: string;
|
|
89
|
+
/** 100% opacity */
|
|
90
|
+
scale10: string;
|
|
91
|
+
button: {
|
|
92
|
+
small: ButtonSize;
|
|
93
|
+
medium: ButtonSize;
|
|
94
|
+
large: ButtonSize;
|
|
95
|
+
primary: ButtonState;
|
|
96
|
+
secondary: ButtonState;
|
|
97
|
+
negative: ButtonState;
|
|
98
|
+
positive: ButtonState;
|
|
99
|
+
caution: ButtonState;
|
|
100
|
+
subtle: ButtonState & LinkColors;
|
|
101
|
+
link: ButtonState & LinkColors;
|
|
102
|
+
disabled: ButtonState;
|
|
103
|
+
color: {
|
|
104
|
+
default: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
calendar: {
|
|
108
|
+
background: {
|
|
109
|
+
container: string;
|
|
110
|
+
hover: string;
|
|
111
|
+
active: string;
|
|
112
|
+
activeHover: string;
|
|
113
|
+
};
|
|
114
|
+
color: {
|
|
115
|
+
disabled: string;
|
|
116
|
+
default: string;
|
|
117
|
+
active: string;
|
|
118
|
+
current: string;
|
|
119
|
+
outside: string;
|
|
120
|
+
weekday: string;
|
|
121
|
+
monthYear: string;
|
|
122
|
+
iconDefault: string;
|
|
123
|
+
iconHover: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
color: IColors;
|
|
127
|
+
defaultBorder: string;
|
|
128
|
+
/** '0px 2px 4px 2px rgba(0, 0, 0, 0.05)' */
|
|
129
|
+
elevation0: string;
|
|
130
|
+
/** '0px 2px 4px 2px rgba(0, 0, 0, 0.1)' */
|
|
131
|
+
elevation1: string;
|
|
132
|
+
/** '0px 2px 4px 2px rgba(0, 0, 0, 0.15)' */
|
|
133
|
+
elevation2: string;
|
|
134
|
+
/** '0px 4px 8px 2px rgba(0, 0, 0, 0.2)' */
|
|
135
|
+
elevation3: string;
|
|
136
|
+
/** '0px 4px 8px 2px rgba(0, 0, 0, 0.25)' */
|
|
137
|
+
elevation4: string;
|
|
138
|
+
size: {
|
|
139
|
+
/** 4px */
|
|
140
|
+
xs: number;
|
|
141
|
+
/** 8px */
|
|
142
|
+
sm: number;
|
|
143
|
+
/** 16px */
|
|
144
|
+
md: number;
|
|
145
|
+
/** 24px */
|
|
146
|
+
lg: number;
|
|
147
|
+
};
|
|
148
|
+
font: {
|
|
149
|
+
weight: {
|
|
150
|
+
/** 400 */
|
|
151
|
+
default: number;
|
|
152
|
+
/** 500 */
|
|
153
|
+
medium: number;
|
|
154
|
+
/** 600 */
|
|
155
|
+
semiBold: number;
|
|
156
|
+
/** 700 */
|
|
157
|
+
bold: number;
|
|
158
|
+
};
|
|
159
|
+
size: {
|
|
160
|
+
/** 10px */
|
|
161
|
+
xs: number;
|
|
162
|
+
/** 12px */
|
|
163
|
+
sm: number;
|
|
164
|
+
/** 14px */
|
|
165
|
+
md: number;
|
|
166
|
+
/** 16px */
|
|
167
|
+
lg: number;
|
|
168
|
+
/** 18px */
|
|
169
|
+
xl: number;
|
|
170
|
+
};
|
|
171
|
+
family: {
|
|
172
|
+
/** "'Roboto', sans-serif" */
|
|
173
|
+
default: string;
|
|
174
|
+
/** "'Roboto', sans-serif" */
|
|
175
|
+
medium: string;
|
|
176
|
+
/** "'Roboto', sans-serif" */
|
|
177
|
+
light: string;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
formControl: {
|
|
181
|
+
color: {
|
|
182
|
+
default: string;
|
|
183
|
+
hover: string;
|
|
184
|
+
active: string;
|
|
185
|
+
activeHover: string;
|
|
186
|
+
disabled: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
input: {
|
|
190
|
+
borderRadius: number;
|
|
191
|
+
background: {
|
|
192
|
+
default: string;
|
|
193
|
+
hover: string;
|
|
194
|
+
focused: string;
|
|
195
|
+
disabled: string;
|
|
196
|
+
};
|
|
197
|
+
color: {
|
|
198
|
+
default: string;
|
|
199
|
+
disabled: string;
|
|
200
|
+
placeholder: string;
|
|
201
|
+
description: string;
|
|
202
|
+
descriptionError: string;
|
|
203
|
+
};
|
|
204
|
+
borderColor: {
|
|
205
|
+
default: string;
|
|
206
|
+
hover: string;
|
|
207
|
+
focused: string;
|
|
208
|
+
disabled: string;
|
|
209
|
+
error: string;
|
|
210
|
+
};
|
|
211
|
+
labelColor: {
|
|
212
|
+
default: string;
|
|
213
|
+
hover: string;
|
|
214
|
+
filled: string;
|
|
215
|
+
focused: string;
|
|
216
|
+
disabled: string;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
menu: {
|
|
220
|
+
background: string;
|
|
221
|
+
};
|
|
222
|
+
menuItem: {
|
|
223
|
+
borderColor: string;
|
|
224
|
+
background: {
|
|
225
|
+
active: string;
|
|
226
|
+
hover: string;
|
|
227
|
+
inactive: string;
|
|
228
|
+
};
|
|
229
|
+
color: {
|
|
230
|
+
active: string;
|
|
231
|
+
hover: string;
|
|
232
|
+
inactive: string;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
modal: {
|
|
236
|
+
background: string;
|
|
237
|
+
color: {
|
|
238
|
+
header: string;
|
|
239
|
+
body: string;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
options: {
|
|
243
|
+
background: string;
|
|
244
|
+
};
|
|
245
|
+
optionItem: {
|
|
246
|
+
background: {
|
|
247
|
+
active: string;
|
|
248
|
+
inactive: string;
|
|
249
|
+
};
|
|
250
|
+
color: {
|
|
251
|
+
active: string;
|
|
252
|
+
inactive: string;
|
|
253
|
+
accent: string;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
table: {
|
|
257
|
+
color: {
|
|
258
|
+
header: string;
|
|
259
|
+
body: string;
|
|
260
|
+
};
|
|
261
|
+
borderColor: string;
|
|
262
|
+
};
|
|
263
|
+
toast: {
|
|
264
|
+
color: string;
|
|
265
|
+
background: {
|
|
266
|
+
deafult: string;
|
|
267
|
+
info: string;
|
|
268
|
+
success: string;
|
|
269
|
+
warning: string;
|
|
270
|
+
error: string;
|
|
271
|
+
};
|
|
272
|
+
border: {
|
|
273
|
+
deafult: string;
|
|
274
|
+
info: string;
|
|
275
|
+
success: string;
|
|
276
|
+
warning: string;
|
|
277
|
+
error: string;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
toggle: {
|
|
281
|
+
slider: string;
|
|
282
|
+
};
|
|
283
|
+
tooltip: {
|
|
284
|
+
background: string;
|
|
285
|
+
color: {
|
|
286
|
+
default: string;
|
|
287
|
+
subtext: string;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
export type ThemeProp = {
|
|
292
|
+
theme?: ITheme;
|
|
293
|
+
};
|
|
294
|
+
export {};
|