@apple-pie/slice 0.1.8 → 0.1.10
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/README.md +4 -3
- package/dist/cjs/chunks/{Avatar-8XLnVICd.js → Avatar-Czt-12Ih.js} +26 -12
- package/dist/cjs/chunks/{AvatarGroup-BhKZvX8M.js → AvatarGroup-CGH2zY7a.js} +9 -7
- package/dist/cjs/chunks/{Button-D8_eyuOA.js → Button-mVVfNCqC.js} +40 -29
- package/dist/cjs/chunks/ButtonBar-CFAb4bfQ.js +73 -0
- package/dist/cjs/chunks/{Camera-CxHdYGEa.js → Camera-BGV_tNUP.js} +12 -4
- package/dist/cjs/chunks/{CheckBox-CmTQ6KW1.js → CheckBox-DyOgP15i.js} +1 -1
- package/dist/cjs/chunks/{Chip-CwMJOnBV.js → Chip-Z8erRdWG.js} +24 -31
- package/dist/cjs/chunks/{FileList-tivoUJSP.js → FileList-CCAtVNDo.js} +1 -1
- package/dist/cjs/chunks/IndexedDB-BaVmQgkK.js +148 -0
- package/dist/cjs/chunks/{ProgressIndicator-opbbADog.js → ProgressIndicator-CyFcr6Dk.js} +13 -4
- package/dist/cjs/chunks/{PromptInput-tA4fpOTk.js → PromptInput-D317oh1e.js} +1 -1
- package/dist/cjs/chunks/{TextArea-DXcMRUfI.js → TextArea-2w4E6d2H.js} +2 -2
- package/dist/cjs/chunks/{TextField-CkfTNM6_.js → TextField-BAcYBHb1.js} +2 -2
- package/dist/cjs/chunks/{UploadArea-B8mJRc0a.js → UploadArea-CxYAAs7Q.js} +1 -1
- package/dist/cjs/chunks/localDBStore-BHEk_9fJ.js +257 -0
- package/dist/cjs/components/Avatar/index.js +1 -1
- package/dist/cjs/components/AvatarGroup/index.js +2 -2
- package/dist/cjs/components/Button/index.js +2 -2
- package/dist/cjs/components/ButtonBar/index.js +3 -5
- package/dist/cjs/components/Camera/index.js +2 -2
- package/dist/cjs/components/CheckBox/index.js +1 -1
- package/dist/cjs/components/Chip/index.js +2 -2
- package/dist/cjs/components/FileList/index.js +2 -2
- package/dist/cjs/components/Progress/index.js +1 -1
- package/dist/cjs/components/PromptInput/index.js +4 -4
- package/dist/cjs/components/TextArea/index.js +3 -3
- package/dist/cjs/components/Textfield/index.js +3 -3
- package/dist/cjs/components/UploadArea/index.js +7 -8
- package/dist/cjs/index.js +10 -11
- package/dist/cjs/stores/LocalDB.js +9 -0
- package/dist/cjs/stores.js +5 -1
- package/dist/cjs/utils/index.js +3 -3
- package/dist/cjs/utils/objects/index.js +3 -3
- package/dist/esm/chunks/{Avatar-DGRMsHdO.mjs → Avatar-DCCbj2eA.mjs} +26 -12
- package/dist/esm/chunks/{AvatarGroup-C9Ka1e9P.mjs → AvatarGroup-BaD2Xmda.mjs} +9 -7
- package/dist/esm/chunks/{Button-DAvVj4YV.mjs → Button-m0XAJsq5.mjs} +40 -29
- package/dist/esm/chunks/ButtonBar-CNQHRn77.mjs +83 -0
- package/dist/esm/chunks/{Camera-BrdJGlv6.mjs → Camera-7TuowjX_.mjs} +12 -4
- package/dist/esm/chunks/{CheckBox-B7UCZvRv.mjs → CheckBox-DO9hTdv8.mjs} +1 -1
- package/dist/esm/chunks/{Chip-BPF7fBba.mjs → Chip-BqneFUOR.mjs} +25 -34
- package/dist/esm/chunks/{FileList-BHCGzX_0.mjs → FileList-Ckix8gUY.mjs} +1 -1
- package/dist/esm/chunks/IndexedDB-CJgzPHPB.mjs +148 -0
- package/dist/esm/chunks/{ProgressIndicator-BVwQNOcV.mjs → ProgressIndicator-CfM2c4ty.mjs} +13 -4
- package/dist/esm/chunks/{PromptInput-pKwwzyAd.mjs → PromptInput-C6liKbFf.mjs} +3 -3
- package/dist/esm/chunks/{TextArea-yF2pGeel.mjs → TextArea-DKRF4Irr.mjs} +2 -2
- package/dist/esm/chunks/{TextField-CgnPj6oK.mjs → TextField-CGOR6507.mjs} +2 -2
- package/dist/esm/chunks/{UploadArea-BNf1y8Ep.mjs → UploadArea-DNAH-Bu5.mjs} +3 -3
- package/dist/esm/chunks/localDBStore-C-Ch2MFq.mjs +265 -0
- package/dist/esm/components/Avatar/index.mjs +1 -1
- package/dist/esm/components/AvatarGroup/index.mjs +2 -2
- package/dist/esm/components/Button/index.mjs +2 -2
- package/dist/esm/components/ButtonBar/index.mjs +5 -15
- package/dist/esm/components/Camera/index.mjs +2 -2
- package/dist/esm/components/CheckBox/index.mjs +1 -1
- package/dist/esm/components/Chip/index.mjs +5 -5
- package/dist/esm/components/FileList/index.mjs +2 -2
- package/dist/esm/components/Progress/index.mjs +1 -1
- package/dist/esm/components/PromptInput/index.mjs +4 -4
- package/dist/esm/components/TextArea/index.mjs +3 -3
- package/dist/esm/components/Textfield/index.mjs +3 -3
- package/dist/esm/components/UploadArea/index.mjs +7 -7
- package/dist/esm/index.mjs +13 -17
- package/dist/esm/stores/LocalDB.mjs +11 -0
- package/dist/esm/stores.mjs +8 -0
- package/dist/esm/utils/index.mjs +2 -0
- package/dist/esm/utils/objects/index.mjs +2 -0
- package/dist/types/components/Avatar/_types.d.ts +6 -4
- package/dist/types/components/AvatarGroup/_types.d.ts +4 -2
- package/dist/types/components/Button/Button.d.ts +4 -2
- package/dist/types/components/Button/_types.d.ts +2 -1
- package/dist/types/components/ButtonBar/ButtonBar.d.ts +16 -1
- package/dist/types/components/ButtonBar/_types.d.ts +14 -4
- package/dist/types/components/Camera/_types.d.ts +2 -2
- package/dist/types/components/Chip/_types.d.ts +18 -7
- package/dist/types/index.d.ts +0 -4
- package/dist/types/stores/LocalDB/_types.d.ts +43 -0
- package/dist/types/stores/LocalDB/index.d.ts +2 -0
- package/dist/types/stores/LocalDB/localDBStore.d.ts +18 -0
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/utils/functions/files.d.ts +1 -1
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/objects/IndexedDB/IndexedDB.d.ts +62 -0
- package/dist/types/utils/objects/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cjs/chunks/ButtonBar-DwMLfvi8.js +0 -49
- package/dist/cjs/chunks/Card-D4YkmNC7.js +0 -34
- package/dist/cjs/chunks/DocIcons-BZI6JMyw.js +0 -108
- package/dist/cjs/components/Card/index.js +0 -10
- package/dist/cjs/components/DocIcon/index.js +0 -9
- package/dist/esm/chunks/ButtonBar-Cw73kooJ.mjs +0 -62
- package/dist/esm/chunks/Card-DGlv1PII.mjs +0 -42
- package/dist/esm/chunks/DocIcons-B4xsPrXM.mjs +0 -114
- package/dist/esm/components/Card/index.mjs +0 -31
- package/dist/esm/components/DocIcon/index.mjs +0 -25
- package/dist/types/components/Card/Card.d.ts +0 -3
- package/dist/types/components/Card/_types.d.ts +0 -14
- package/dist/types/components/Card/index.d.ts +0 -2
- package/dist/types/components/DocIcon/DocIcons.d.ts +0 -3
- package/dist/types/components/DocIcon/_types.d.ts +0 -7
- package/dist/types/components/DocIcon/index.d.ts +0 -2
|
@@ -3,18 +3,20 @@ import type { ToolTip } from '../sharedTypes';
|
|
|
3
3
|
export type AvatarBaseProps = {
|
|
4
4
|
size?: number | string;
|
|
5
5
|
frame?: number | string;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
name?: string;
|
|
7
|
+
email?: string;
|
|
8
8
|
image?: string;
|
|
9
|
-
border?: number;
|
|
10
9
|
color?: string;
|
|
10
|
+
borderSize?: number;
|
|
11
11
|
borderColor?: string;
|
|
12
|
+
borderColorHover?: string;
|
|
12
13
|
bgColor?: string;
|
|
13
|
-
firstOnly?: boolean;
|
|
14
14
|
fontSize?: number | string;
|
|
15
15
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
16
16
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
17
17
|
onKeyDown?: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
18
18
|
tabIndex?: number;
|
|
19
|
+
outerBorderSize?: number;
|
|
20
|
+
outerBorderColor?: string;
|
|
19
21
|
};
|
|
20
22
|
export type AvatarProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof AvatarBaseProps> & AvatarBaseProps;
|
|
@@ -13,11 +13,13 @@ export type AvatarGroupBaseProps = {
|
|
|
13
13
|
avatars?: AvatarInfo[] | null;
|
|
14
14
|
size?: number;
|
|
15
15
|
overlap?: number;
|
|
16
|
-
|
|
16
|
+
borderSize?: number;
|
|
17
17
|
borderColor?: string;
|
|
18
|
+
borderColorHover?: string;
|
|
18
19
|
gap?: number;
|
|
19
20
|
margin?: number;
|
|
20
|
-
|
|
21
|
+
outerBorderSize?: number;
|
|
22
|
+
outerBorderColor?: string;
|
|
21
23
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
22
24
|
};
|
|
23
25
|
export type AvatarGroupProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof AvatarGroupBaseProps> & AvatarGroupBaseProps;
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import type { ToolTip } from '../sharedTypes';
|
|
3
3
|
import type { ButtonHandle } from './_types';
|
|
4
4
|
export declare const Button: React.NamedExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof {
|
|
5
|
-
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
size?: "large" | "medium" | "small";
|
|
6
7
|
variant?: "solid" | "outline" | "text";
|
|
7
8
|
state?: "normal" | "hover" | "disabled";
|
|
8
9
|
width?: string;
|
|
@@ -37,7 +38,8 @@ export declare const Button: React.NamedExoticComponent<Omit<React.ButtonHTMLAtt
|
|
|
37
38
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
38
39
|
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent> | undefined) => void;
|
|
39
40
|
}> & {
|
|
40
|
-
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
size?: "large" | "medium" | "small";
|
|
41
43
|
variant?: "solid" | "outline" | "text";
|
|
42
44
|
state?: "normal" | "hover" | "disabled";
|
|
43
45
|
width?: string;
|
|
@@ -2,7 +2,8 @@ import type { Transition, Variants } from 'motion/react';
|
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { ToolTip } from '../sharedTypes';
|
|
4
4
|
type ButtonBaseProps = {
|
|
5
|
-
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
size?: 'large' | 'medium' | 'small';
|
|
6
7
|
variant?: 'solid' | 'outline' | 'text';
|
|
7
8
|
state?: 'normal' | 'hover' | 'disabled';
|
|
8
9
|
width?: string;
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ToolTip } from '../sharedTypes';
|
|
1
3
|
import type { ButtonBarProps } from './_types';
|
|
2
|
-
export declare
|
|
4
|
+
export declare const ButtonBar: React.NamedExoticComponent<Readonly<ButtonBarProps>>;
|
|
5
|
+
interface ButtonProps {
|
|
6
|
+
classNames?: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
iconSize: number;
|
|
9
|
+
iconColor?: string;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
onMouseEnter?: () => void;
|
|
12
|
+
onMouseLeave?: () => void;
|
|
13
|
+
toolTip?: string;
|
|
14
|
+
onToolTip?: (tip: ToolTip | null) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const BarButton: React.NamedExoticComponent<Readonly<ButtonProps>>;
|
|
17
|
+
export {};
|
|
@@ -2,14 +2,24 @@ import type React from 'react';
|
|
|
2
2
|
import type { ToolTip } from '../sharedTypes';
|
|
3
3
|
export type BarButton = {
|
|
4
4
|
icon?: string;
|
|
5
|
-
|
|
5
|
+
action?: string;
|
|
6
6
|
label?: string;
|
|
7
7
|
tip: string;
|
|
8
8
|
};
|
|
9
9
|
type ButtonBarBaseProps = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
buttons?: BarButton[];
|
|
11
|
+
buttonSize?: number;
|
|
12
|
+
iconSize?: number;
|
|
13
|
+
toggle?: boolean;
|
|
14
|
+
selected?: number;
|
|
15
|
+
borderRadius?: number | string;
|
|
16
|
+
borderSize?: number;
|
|
17
|
+
borderColor?: string;
|
|
18
|
+
bgColor?: string;
|
|
19
|
+
bgColorHover?: string;
|
|
20
|
+
bgColorActive?: string;
|
|
21
|
+
labelColor?: string;
|
|
22
|
+
onClick?: (button: BarButton) => void;
|
|
13
23
|
onChange?: (option: BarButton) => void;
|
|
14
24
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
15
25
|
};
|
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { ToolTip } from '../sharedTypes';
|
|
3
3
|
type ChipBaseProps = {
|
|
4
|
+
children?: React.ReactNode;
|
|
4
5
|
label?: string;
|
|
6
|
+
labelSize?: 's' | 'm' | 'l';
|
|
7
|
+
labelColor?: string;
|
|
8
|
+
labelColorHover?: string;
|
|
5
9
|
icon?: string;
|
|
10
|
+
iconSize?: number;
|
|
11
|
+
iconPosition?: 'left' | 'right';
|
|
12
|
+
iconColor?: string;
|
|
13
|
+
iconColorHover?: string;
|
|
14
|
+
bgColor?: string;
|
|
15
|
+
bgColorHover?: string;
|
|
6
16
|
disabled?: boolean;
|
|
7
17
|
focused?: boolean;
|
|
8
18
|
tooltip?: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
borderSize?: number;
|
|
20
|
+
borderColor?: string;
|
|
21
|
+
borderColorHover?: string;
|
|
22
|
+
borderColorDisabled?: string;
|
|
23
|
+
borderRadius?: number;
|
|
24
|
+
gap?: number;
|
|
25
|
+
paddingTops?: number;
|
|
26
|
+
paddingSides?: number;
|
|
15
27
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
16
28
|
onClick?: (e: React.MouseEvent<HTMLDivElement> | undefined) => void;
|
|
17
|
-
onMouseDown?: (e: React.MouseEvent<HTMLDivElement> | undefined) => void;
|
|
18
29
|
};
|
|
19
30
|
export type ChipProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof ChipBaseProps> & ChipBaseProps;
|
|
20
31
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,8 +17,6 @@ export { CheckBox } from './components/CheckBox';
|
|
|
17
17
|
export type { CheckBoxProps } from './components/CheckBox';
|
|
18
18
|
export { DivInput } from './components/DivInput';
|
|
19
19
|
export type { DivInputProps } from './components/DivInput';
|
|
20
|
-
export { DocIcons } from './components/DocIcon';
|
|
21
|
-
export type { DocsProps } from './components/DocIcon';
|
|
22
20
|
export { Dot } from './components/Dot';
|
|
23
21
|
export type { DotProps } from './components/Dot';
|
|
24
22
|
export { DraggablePanel } from './components/DraggablePanel';
|
|
@@ -69,8 +67,6 @@ export { Icon, SliceIcons } from './components/Icon';
|
|
|
69
67
|
export type { IconProps } from './components/Icon/_types';
|
|
70
68
|
export { ButtonBar } from './components/ButtonBar';
|
|
71
69
|
export type { BarButton, ButtonBarProps } from './components/ButtonBar/_types';
|
|
72
|
-
export { Card } from './components/Card';
|
|
73
|
-
export type { CardProps } from './components/Card/_types';
|
|
74
70
|
export { Label } from './components/Label';
|
|
75
71
|
export type { LabelProps } from './components/Label';
|
|
76
72
|
export { UploadArea } from './components/UploadArea';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { IndexedDB, IndexedDBOptions } from '../../utils';
|
|
2
|
+
export interface LocalDBRecord<TValue = unknown> {
|
|
3
|
+
key: IDBValidKey;
|
|
4
|
+
value: TValue;
|
|
5
|
+
}
|
|
6
|
+
export interface LocalDBConnection<TValue = unknown> {
|
|
7
|
+
name: string;
|
|
8
|
+
connection: IndexedDB<TValue>;
|
|
9
|
+
key: string | null;
|
|
10
|
+
records: LocalDBRecord<TValue>[];
|
|
11
|
+
initialized: boolean;
|
|
12
|
+
error: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface LocalDBStoreOptions extends Omit<IndexedDBOptions, 'databaseName'> {
|
|
15
|
+
create?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type LocalDBActionResult = {
|
|
18
|
+
ok: true;
|
|
19
|
+
} | {
|
|
20
|
+
ok: false;
|
|
21
|
+
error: Error;
|
|
22
|
+
};
|
|
23
|
+
export type LocalDBActionValueResult<TValue> = {
|
|
24
|
+
ok: true;
|
|
25
|
+
value: TValue;
|
|
26
|
+
} | {
|
|
27
|
+
ok: false;
|
|
28
|
+
error: Error;
|
|
29
|
+
};
|
|
30
|
+
export interface LocalDBActions {
|
|
31
|
+
addStore: (name: string, options?: LocalDBStoreOptions) => Promise<LocalDBActionResult>;
|
|
32
|
+
removeStore: (name: string) => Promise<LocalDBActionResult>;
|
|
33
|
+
refreshStore: (name: string) => Promise<LocalDBActionResult>;
|
|
34
|
+
setValue: (name: string, value: unknown | unknown[]) => Promise<LocalDBActionValueResult<IDBValidKey | IDBValidKey[]>>;
|
|
35
|
+
addValue: (name: string, value: unknown | unknown[]) => Promise<LocalDBActionValueResult<IDBValidKey | IDBValidKey[]>>;
|
|
36
|
+
removeValue: (name: string, value: unknown | unknown[]) => Promise<LocalDBActionResult>;
|
|
37
|
+
clearStore: (name: string) => Promise<LocalDBActionResult>;
|
|
38
|
+
destroyStore: (name: string) => Promise<LocalDBActionResult>;
|
|
39
|
+
}
|
|
40
|
+
export interface LocalDBStoreState {
|
|
41
|
+
stores: LocalDBConnection[];
|
|
42
|
+
actions: LocalDBActions;
|
|
43
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LocalDBActions, LocalDBStoreState } from './_types';
|
|
2
|
+
export declare const useLocalDBStore: import("zustand").UseBoundStore<import("zustand").StoreApi<LocalDBStoreState>>;
|
|
3
|
+
type BoundLocalDBActions = {
|
|
4
|
+
refresh: () => ReturnType<LocalDBActions['refreshStore']>;
|
|
5
|
+
set: (value: unknown) => ReturnType<LocalDBActions['setValue']>;
|
|
6
|
+
add: (value: unknown) => ReturnType<LocalDBActions['addValue']>;
|
|
7
|
+
remove: (value: unknown) => ReturnType<LocalDBActions['removeValue']>;
|
|
8
|
+
clear: () => ReturnType<LocalDBActions['clearStore']>;
|
|
9
|
+
destroy: () => ReturnType<LocalDBActions['destroyStore']>;
|
|
10
|
+
};
|
|
11
|
+
export declare const useLocalDB: (name: string) => BoundLocalDBActions;
|
|
12
|
+
export declare function useLocalDBValues<TValue = Record<string, unknown>>(name: string): TValue[];
|
|
13
|
+
export declare function useLocalDBValues<TValue = Record<string, unknown>>(name: string, key: IDBValidKey): TValue | null;
|
|
14
|
+
export declare function useLocalDBValues<TValue = Record<string, unknown>>(name: string, field: keyof TValue, value: TValue[keyof TValue]): TValue[];
|
|
15
|
+
export declare const useLocalDBError: (name: string) => string | null;
|
|
16
|
+
export declare const useManageLocalDB: () => LocalDBActions;
|
|
17
|
+
export declare const localDBActions: LocalDBActions;
|
|
18
|
+
export {};
|
|
@@ -8,7 +8,7 @@ export declare function nameAndExtension(fileName: string): {
|
|
|
8
8
|
/**
|
|
9
9
|
* Map a file extension to the corresponding file icon name.
|
|
10
10
|
*/
|
|
11
|
-
export declare function fileIconName(extension: string): "other" | "text" | "sheet" | "image" | "video" | "audio" | "
|
|
11
|
+
export declare function fileIconName(extension: string): "other" | "text" | "sheet" | "image" | "video" | "audio" | "code" | "md" | "preso" | "pdf" | "clipboard";
|
|
12
12
|
/**
|
|
13
13
|
* Create a clipboard-text file with a guaranteed `.clipboard` extension.
|
|
14
14
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { copyToClipboard, hexToRgb } from './functions/misc';
|
|
2
2
|
export { debounce } from './functions/debounce';
|
|
3
3
|
export * from './functions/colors';
|
|
4
|
-
export { SSEConnection, WSConnection } from './objects';
|
|
5
|
-
export type { SSECustomEvent, SSEConnectionCloseOption, SSEConnectionOptions, SSEEventMap, SSEUnifiedBuiltInMessage, SSEUnifiedCustomMessage, SSEUnifiedMessage, UnifiedMessageEvent, WSConnectionOptions, } from './objects';
|
|
4
|
+
export { IndexedDB, SSEConnection, WSConnection } from './objects';
|
|
5
|
+
export type { IndexedDBOptions, SSECustomEvent, SSEConnectionCloseOption, SSEConnectionOptions, SSEEventMap, SSEUnifiedBuiltInMessage, SSEUnifiedCustomMessage, SSEUnifiedMessage, UnifiedMessageEvent, WSConnectionOptions, } from './objects';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export interface IndexedDBOptions {
|
|
2
|
+
databaseName?: string;
|
|
3
|
+
version?: number;
|
|
4
|
+
key?: string;
|
|
5
|
+
autoIncrement?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class IndexedDB<T> {
|
|
8
|
+
private readonly databaseName;
|
|
9
|
+
private readonly storeName;
|
|
10
|
+
private readonly version;
|
|
11
|
+
private readonly key?;
|
|
12
|
+
private readonly autoIncrement;
|
|
13
|
+
private db;
|
|
14
|
+
constructor(storeName: string, options?: IndexedDBOptions);
|
|
15
|
+
/**
|
|
16
|
+
* Initialize the IndexedDB connection.
|
|
17
|
+
*/
|
|
18
|
+
initialize(create?: boolean): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Get a single DB value by key.
|
|
21
|
+
*/
|
|
22
|
+
get(key: IDBValidKey): Promise<T | null>;
|
|
23
|
+
/**
|
|
24
|
+
* Get all the values in the store.
|
|
25
|
+
*/
|
|
26
|
+
getAll(): Promise<T[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Get all keys in the store.
|
|
29
|
+
*/
|
|
30
|
+
getAllKeys(): Promise<IDBValidKey[]>;
|
|
31
|
+
set(key: IDBValidKey, value: T): Promise<IDBValidKey>;
|
|
32
|
+
/**
|
|
33
|
+
* Adds a new value to the store with or without a key.
|
|
34
|
+
* If a key already exists it will error.
|
|
35
|
+
*/
|
|
36
|
+
add(value: T, key?: IDBValidKey): Promise<IDBValidKey>;
|
|
37
|
+
/**
|
|
38
|
+
* Updates a value by key. This uses IndexedDB put semantics.
|
|
39
|
+
*/
|
|
40
|
+
update(key: IDBValidKey, value: T): Promise<IDBValidKey>;
|
|
41
|
+
/**
|
|
42
|
+
* Removes a value from the store by key.
|
|
43
|
+
*/
|
|
44
|
+
remove(key: IDBValidKey): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Clear all the store values
|
|
47
|
+
*/
|
|
48
|
+
clear(): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Cleanly close the IndexedDB connection.
|
|
51
|
+
*/
|
|
52
|
+
close(): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Deletes an indexedDB database.
|
|
55
|
+
*/
|
|
56
|
+
destroy(): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Private executor of request of the indexedDB
|
|
59
|
+
* Returns the result of the indexedDB request including the error if there is one
|
|
60
|
+
*/
|
|
61
|
+
private runRequest;
|
|
62
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { IndexedDB } from './IndexedDB/IndexedDB';
|
|
2
|
+
export type { IndexedDBOptions } from './IndexedDB/IndexedDB';
|
|
1
3
|
export { SSEConnection } from './SSEConnection/SSEConnection';
|
|
2
4
|
export { WSConnection } from './WSConnection/WSConnection';
|
|
3
5
|
export type { SSECustomEvent, SSEConnectionCloseOption, SSEConnectionOptions, SSEEventMap, SSEUnifiedBuiltInMessage, SSEUnifiedCustomMessage, SSEUnifiedMessage, } from './SSEConnection/SSEConnection';
|
package/package.json
CHANGED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), hooks_useTheme = require("../hooks/useTheme.js");
|
|
4
|
-
|
|
5
|
-
require("../theme/colors.js"), require("../hooks/useWindow.js");
|
|
6
|
-
|
|
7
|
-
var IconButton = require("./IconButton-BXotgG2u.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_wrapper = "ButtonBar-module_wrapper__FYZ3s flexBox-module_rowStart__4tcxS", css_label = "ButtonBar-module_label__UcAS1 flexBox-module_rowStart__4tcxS type-module_body-s-regular__vRHSP", css_button = "ButtonBar-module_button__bMR3h flexBox-module_rowStart__4tcxS", css_selected = "ButtonBar-module_selected__wKvmi", css_divider = "ButtonBar-module_divider__HkWJw", css_last = "ButtonBar-module_last__S9VdD";
|
|
8
|
-
|
|
9
|
-
styleInject_es.styleInject(".flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.ButtonBar-module_wrapper__FYZ3s {\n}\n\n.ButtonBar-module_label__UcAS1 {\n\tcolor: var(--core-text-disabled);\n\tpadding-right: 4px;\n}\n\n.ButtonBar-module_button__bMR3h {\n\theight: 32px;\n\tgap: 0;\n\tcursor: pointer;\n\tbackground: var(--core-surface-primary);\n\tcolor: var(--core-text-disabled);\n\t&:last-child {\n\t\t&:hover {\n\t\t\tbackground: var(--core-surface-primary);\n\t\t}\n\t}\n\t&:first-child {\n\t\t&:hover {\n\t\t\tbackground: var(--core-surface-primary);\n\t\t}\n\t}\n\t&:hover {\n\t\tbackground: var(--core-surface-primary);\n\t\tcolor: var(--core-text-primary);\n\t}\n}\n\n.ButtonBar-module_selected__wKvmi {\n\tbackground: var(--core-surface-primary);\n\tcolor: var(--core-link-primary);\n}\n\n.ButtonBar-module_divider__HkWJw {\n\tdisplay: block;\n\tbackground: var(--core-outline-primary);\n\twidth: 1px;\n\theight: 16px;\n\tmargin: 0 4px;\n}\n\n.ButtonBar-module_last__S9VdD {\n\tdisplay: none;\n}\n"),
|
|
10
|
-
exports.ButtonBar = function(props) {
|
|
11
|
-
const theme = hooks_useTheme.useTheme(), {options: options = [], current: current = 0, label: label, onChange: onChange = () => null, onToolTip: onToolTip = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "options", "current", "label", "onChange", "onToolTip" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [hovered, setHovered] = React.useState(-1), [currentPage, setCurrentPage] = React.useState(current);
|
|
12
|
-
React.useEffect(() => setCurrentPage(current), [ current ]);
|
|
13
|
-
const handleMouseEnter = React.useCallback(index => {
|
|
14
|
-
setHovered(index);
|
|
15
|
-
}, []), handleMouseLeave = React.useCallback(() => {
|
|
16
|
-
setHovered(-1);
|
|
17
|
-
}, []), handleClick = React.useCallback((button, index) => {
|
|
18
|
-
setCurrentPage(index), onChange(button);
|
|
19
|
-
}, [ onChange ]), display = React.useCallback(index => index === options.length - 1 ? css_last : "", [ options.length ]), selected = React.useCallback(index => currentPage === index ? css_selected : "", [ currentPage ]), iconColor = React.useCallback(index => {
|
|
20
|
-
const isHovered = hovered === index;
|
|
21
|
-
return currentPage === index ? theme.current.colors["core-icon-primary"] : isHovered ? theme.current.colors["core-button-primary"] : theme.current.colors["core-text-disabled"];
|
|
22
|
-
}, [ currentPage, hovered, theme ]);
|
|
23
|
-
return jsxRuntime.jsxs("div", Object.assign({
|
|
24
|
-
id: divId,
|
|
25
|
-
className: `${css_wrapper}${divClass}`,
|
|
26
|
-
style: divStyle
|
|
27
|
-
}, rest, {
|
|
28
|
-
children: [ label && jsxRuntime.jsx("div", {
|
|
29
|
-
className: css_label,
|
|
30
|
-
children: label
|
|
31
|
-
}), null == options ? void 0 : options.map((button, index) => jsxRuntime.jsxs("div", {
|
|
32
|
-
className: `${css_button} ${selected(index)}`,
|
|
33
|
-
onMouseEnter: () => handleMouseEnter(index),
|
|
34
|
-
onMouseLeave: () => handleMouseLeave(),
|
|
35
|
-
children: [ jsxRuntime.jsx(IconButton.IconButton, {
|
|
36
|
-
icon: button.icon,
|
|
37
|
-
color: iconColor(index),
|
|
38
|
-
label: button.label,
|
|
39
|
-
tooltip: button.tip,
|
|
40
|
-
onToolTip: onToolTip,
|
|
41
|
-
onClick: () => handleClick(button, index),
|
|
42
|
-
hover: !0,
|
|
43
|
-
toggle: !1
|
|
44
|
-
}), jsxRuntime.jsx("div", {
|
|
45
|
-
className: `${css_divider} ${display(index)}`
|
|
46
|
-
}) ]
|
|
47
|
-
}, `button-bar-${button.icon}-${index}`)) ]
|
|
48
|
-
}));
|
|
49
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), Icon = require("./Icon-N0YJuKQf.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_card = "Card-module_card__Cb1o4 flexBox-module_rowStart__4tcxS type-module_body-m-regular__LuQBA", css_icon = "Card-module_icon__jzes9 flexBox-module_row__z24tF", css_label = "Card-module_label__K9JXx";
|
|
4
|
-
|
|
5
|
-
styleInject_es.styleInject(".flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.Card-module_card__Cb1o4 {\n\tpadding: 8px 14px 8px 8px !important;\n\tcolor: var(--core-text-primary);\n\twidth: var(--card-width);\n\tmax-width: min-content;\n\tflex: var(--card-flex);\n\tgap: 8px;\n\tborder-radius: 8px;\n\tborder: 1px solid var(--core-outline-primary);\n\tcursor: pointer;\n\ttransition: all var(--motion-water-duration) var(--motion-water) 0s;\n\tappearance: none;\n\t-webkit-appearance: none;\n\tbackground-image: none;\n\toutline: none;\n\t&:hover {\n\t\tcolor: var(--core-button-primary);\n\t\tborder: 1px solid var(--core-button-primary);\n\t}\n}\n\n.Card-module_icon__jzes9 {\n\tmin-width: 20px;\n\tmin-height: 20px;\n\tmax-width: 20px;\n\tmax-height: 20px;\n}\n\n.Card-module_label__K9JXx {\n\tflex: 1;\n\tword-break: break-all;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\toverflow-wrap: anywhere;\n\tdisplay: -webkit-box;\n\twhite-space: nowrap;\n\t-webkit-line-clamp: 1;\n\t-webkit-box-orient: vertical;\n}\n");
|
|
6
|
-
|
|
7
|
-
const Card = React.memo(function(props) {
|
|
8
|
-
const {id: id, icon: icon, label: label, command: command, width: width, onCommand: onCommand = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "id", "icon", "label", "command", "width", "onCommand" ]), {className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", setStyle = React.useCallback(value => void 0 === value || "fill" === value ? "unset" : "string" == typeof value ? value : `${value}px`, []), cssVars = React.useMemo(() => ({
|
|
9
|
-
"--card-width": setStyle(width),
|
|
10
|
-
"--card-flex": "fill" === width ? "1" : "unset"
|
|
11
|
-
}), [ setStyle, width ]);
|
|
12
|
-
return jsxRuntime.jsxs("button", Object.assign({
|
|
13
|
-
id: id,
|
|
14
|
-
type: "button",
|
|
15
|
-
className: `${css_card}${divClass}`,
|
|
16
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
17
|
-
onClick: () => onCommand({
|
|
18
|
-
id: id,
|
|
19
|
-
command: command
|
|
20
|
-
})
|
|
21
|
-
}, rest, {
|
|
22
|
-
children: [ icon && jsxRuntime.jsx("div", {
|
|
23
|
-
className: css_icon,
|
|
24
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
25
|
-
name: icon
|
|
26
|
-
})
|
|
27
|
-
}), label && jsxRuntime.jsx("div", {
|
|
28
|
-
className: css_label,
|
|
29
|
-
children: label
|
|
30
|
-
}) ]
|
|
31
|
-
}));
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
exports.Card = Card;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), hooks_useTheme = require("../hooks/useTheme.js");
|
|
4
|
-
|
|
5
|
-
require("../theme/colors.js"), require("../hooks/useWindow.js");
|
|
6
|
-
|
|
7
|
-
const DocIcons = React.memo(props => {
|
|
8
|
-
const theme = hooks_useTheme.useTheme(), {type: type = "pdf", height: height = 36} = props, divAttributes = tslib_es6.__rest(props, [ "type", "height" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", renderIcon = React.useMemo(() => {
|
|
9
|
-
const item = [ {
|
|
10
|
-
name: "not supported",
|
|
11
|
-
svg: jsxRuntime.jsxs("svg", {
|
|
12
|
-
viewBox: "0 0 24 24",
|
|
13
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
-
height: height,
|
|
15
|
-
"aria-label": "Not supported",
|
|
16
|
-
children: [ jsxRuntime.jsx("title", {
|
|
17
|
-
children: "Not supported"
|
|
18
|
-
}), jsxRuntime.jsx("path", {
|
|
19
|
-
d: "M 13.944 0 L 21.798 8 L 21.798 21.2 C 21.798 22.746 20.568 24 19.049 24 L 4.911 24 C 3.393 24 2.162 22.745 2.162 21.2 L 2.162 2.8 C 2.162 1.254 3.393 0 4.911 0 Z",
|
|
20
|
-
fill: "rgb(102, 113, 127)"
|
|
21
|
-
}), jsxRuntime.jsx("path", {
|
|
22
|
-
d: "M 12.021 16.249 C 12.461 16.249 12.733 15.968 12.733 15.625 L 12.733 15.52 C 12.733 15.028 13.014 14.711 13.63 14.307 C 14.482 13.744 15.089 13.235 15.089 12.18 C 15.089 10.72 13.788 9.93 12.294 9.93 C 10.782 9.93 9.789 10.65 9.552 11.46 C 9.508 11.6 9.482 11.74 9.482 11.89 C 9.482 12.285 9.789 12.496 10.079 12.496 C 10.378 12.496 10.571 12.356 10.729 12.145 L 10.887 11.934 C 11.195 11.424 11.652 11.125 12.241 11.125 C 13.041 11.125 13.559 11.582 13.559 12.25 C 13.559 12.848 13.19 13.138 12.426 13.674 C 11.793 14.114 11.318 14.579 11.318 15.441 L 11.318 15.555 C 11.318 16.012 11.573 16.249 12.021 16.249 Z M 12.004 18.869 C 12.514 18.869 12.953 18.464 12.953 17.954 C 12.953 17.444 12.523 17.04 12.003 17.04 C 11.485 17.04 11.054 17.453 11.054 17.954 C 11.054 18.455 11.494 18.868 12.004 18.868 Z",
|
|
23
|
-
fill: "rgb(255, 255, 255)"
|
|
24
|
-
}), jsxRuntime.jsx("path", {
|
|
25
|
-
d: "M 21.798 8 L 16.832 8 C 15.314 8 13.944 6.605 13.944 5.058 L 13.944 0 Z",
|
|
26
|
-
fill: "rgba(255,255,255,0.4)"
|
|
27
|
-
}) ]
|
|
28
|
-
})
|
|
29
|
-
}, {
|
|
30
|
-
name: "text",
|
|
31
|
-
svg: jsxRuntime.jsxs("svg", {
|
|
32
|
-
viewBox: "0 0 1024 1024",
|
|
33
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
34
|
-
height: height,
|
|
35
|
-
"aria-label": "Text document",
|
|
36
|
-
children: [ jsxRuntime.jsx("title", {
|
|
37
|
-
children: "Text document"
|
|
38
|
-
}), jsxRuntime.jsx("path", {
|
|
39
|
-
d: "M137.902 0a48.573 48.573 0 0 0-35.589 15.294 53.965 53.965 0 0 0-15.273 35.64v917.412a48.707 48.707 0 0 0 15.273 35.64 49.971 49.971 0 0 0 35.59 15.293h746.336a48.64 48.64 0 0 0 35.59-15.293 50.37 50.37 0 0 0 15.273-35.64V288.717L646.728 0H137.902z",
|
|
40
|
-
fill: "#FD7541"
|
|
41
|
-
}), jsxRuntime.jsx("path", {
|
|
42
|
-
d: "M935.102 288.717H697.656c-27.822-.666-50.227-23.076-50.928-50.934V0l288.374 288.717z",
|
|
43
|
-
fill: "#FFFFFF",
|
|
44
|
-
opacity: .4
|
|
45
|
-
}), jsxRuntime.jsx("path", {
|
|
46
|
-
d: "M248.126 365.184h220.518a25.518 25.518 0 0 0 24.192-25.497 25.518 25.518 0 0 0-24.197-25.503H248.126a25.518 25.518 0 0 0-24.197 25.498 25.518 25.518 0 0 0 24.197 25.497zm0 169.825H773.95a25.446 25.446 0 0 0 25.43-25.466 25.446 25.446 0 0 0-25.43-25.467H248.126a25.446 25.446 0 0 0-25.431 25.467 25.446 25.446 0 0 0 25.43 25.466zM773.95 653.896H248.126a25.518 25.518 0 0 0-24.197 25.497 25.518 25.518 0 0 0 24.197 25.503H773.95a25.518 25.518 0 0 0 24.197-25.497A25.518 25.518 0 0 0 773.95 653.9z",
|
|
47
|
-
fill: "#FFF"
|
|
48
|
-
}) ]
|
|
49
|
-
})
|
|
50
|
-
}, {
|
|
51
|
-
name: "docx",
|
|
52
|
-
svg: jsxRuntime.jsxs("svg", {
|
|
53
|
-
viewBox: "0 0 1024 1024",
|
|
54
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
55
|
-
height: height,
|
|
56
|
-
"aria-label": "Word document",
|
|
57
|
-
children: [ jsxRuntime.jsx("title", {
|
|
58
|
-
children: "Word document"
|
|
59
|
-
}), jsxRuntime.jsx("path", {
|
|
60
|
-
d: "m594.944 0 335.124 341.32v563.2c0 65.996-52.5 119.48-117.294 119.48H209.546c-64.793 0-117.299-53.53-117.299-119.48V119.48C92.252 53.484 144.757 0 209.551 0h385.393z",
|
|
61
|
-
fill: theme.current.colors["core-button-primary"]
|
|
62
|
-
}), jsxRuntime.jsx("path", {
|
|
63
|
-
d: "M930.068 341.32H718.152c-64.748 0-123.208-59.49-123.208-125.492V0l335.124 341.32z",
|
|
64
|
-
fill: "#ffffff",
|
|
65
|
-
fillOpacity: ".7"
|
|
66
|
-
}), jsxRuntime.jsx("path", {
|
|
67
|
-
d: "M427.377 725.32V768H259.814v-42.68h167.563zM594.944 640v42.68h-335.13V640h335.13zm0-85.32v42.64h-335.13v-42.64h335.13zm0-85.36V512h-335.13v-42.68h335.13z",
|
|
68
|
-
fill: "#FFF"
|
|
69
|
-
}) ]
|
|
70
|
-
})
|
|
71
|
-
}, {
|
|
72
|
-
name: "pdf",
|
|
73
|
-
svg: jsxRuntime.jsxs("svg", {
|
|
74
|
-
viewBox: "0 0 1024 1024",
|
|
75
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
76
|
-
height: height,
|
|
77
|
-
"aria-label": "PDF document",
|
|
78
|
-
children: [ jsxRuntime.jsx("title", {
|
|
79
|
-
children: "PDF document"
|
|
80
|
-
}), jsxRuntime.jsx("path", {
|
|
81
|
-
d: "m594.944 0 335.124 341.32v563.2c0 65.996-52.5 119.48-117.294 119.48H209.546c-64.793 0-117.299-53.53-117.299-119.48V119.48C92.252 53.484 144.757 0 209.551 0h385.393z",
|
|
82
|
-
fill: "#E94848"
|
|
83
|
-
}), jsxRuntime.jsx("path", {
|
|
84
|
-
d: "M482.954 375.48a40.586 40.586 0 0 0-40.028 40.776c0 27.786 15.17 62.326 31.18 94.771-12.564 39.834-26.715 82.473-44.82 118.503-37.094 14.796-70.195 25.83-90.06 42.168a41.708 41.708 0 0 0-12.39 29.926c0 22.344 18.063 40.776 40.038 40.776a39.332 39.332 0 0 0 29.27-12.472c14.618-17.828 31.888-50.13 47.294-79.642 35.42-14.198 72.607-28.672 108.447-37.325 26.163 21.453 64.051 35.65 95.186 35.65 21.97 0 40.033-18.385 40.033-40.775a40.586 40.586 0 0 0-40.033-40.724c-24.991 0-61.297 9.072-89.037 18.616a301.338 301.338 0 0 1-58.092-76.984c10.66-33.332 23.04-66.658 23.04-92.488a40.586 40.586 0 0 0-40.028-40.776zm0 24.438c8.98 0 16.01 7.168 16.01 16.292 0 12.237-6.42 34.816-13.87 59.018-9.958-23.552-18.15-46.172-18.15-58.972 0-9.165 7.025-16.292 16.01-16.292v-.046zm6.887 139.546a323.574 323.574 0 0 0 41.523 53.76c-23.742 6.604-46.92 15.078-69.822 23.92 11.08-25.364 19.917-51.758 28.299-77.726v.046zm157.235 52.126c8.98 0 16.01 7.122 16.01 16.292 0 9.124-7.03 16.292-16.015 16.292-18.059 0-43.659-8.284-64.185-19.876 23.552-6.794 49.204-12.749 64.185-12.749v.041zM408.15 664.576c-11.264 20.48-22.436 39.562-30.26 49.152a15.078 15.078 0 0 1-11.028 4.188 15.964 15.964 0 0 1-16.01-16.292 17.707 17.707 0 0 1 4.234-11.356c9.4-7.398 29.835-16.292 53.064-25.692z",
|
|
85
|
-
fill: "#FFF"
|
|
86
|
-
}), jsxRuntime.jsx("path", {
|
|
87
|
-
d: "M930.068 341.32H718.152c-64.748 0-123.208-59.49-123.208-125.492V0l335.124 341.32z",
|
|
88
|
-
fill: "#FFF",
|
|
89
|
-
fillOpacity: ".4"
|
|
90
|
-
}) ]
|
|
91
|
-
})
|
|
92
|
-
} ].filter(data => type === data.name);
|
|
93
|
-
return item ? item[0].svg : null;
|
|
94
|
-
}, [ height, type, theme ]);
|
|
95
|
-
return jsxRuntime.jsx("div", Object.assign({
|
|
96
|
-
id: divId,
|
|
97
|
-
className: divClass.trim(),
|
|
98
|
-
style: Object.assign(Object.assign({}, divStyle), {
|
|
99
|
-
display: "flex",
|
|
100
|
-
justifyContent: "center",
|
|
101
|
-
alignItems: "center"
|
|
102
|
-
})
|
|
103
|
-
}, rest, {
|
|
104
|
-
children: renderIcon
|
|
105
|
-
}));
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
exports.DocIcons = DocIcons;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var Card = require("../../chunks/Card-D4YkmNC7.js");
|
|
4
|
-
|
|
5
|
-
require("../../chunks/tslib.es6-C8dZW5nY.js"), require("react/jsx-runtime"), require("react"),
|
|
6
|
-
require("../../chunks/Icon-N0YJuKQf.js"), require("../../hooks/useTheme.js"), require("../../theme/themes.js"),
|
|
7
|
-
require("../../theme/colors.js"), require("../../theme/corners.js"), require("../../theme/elevations.js"),
|
|
8
|
-
require("../../theme/motion.js"), require("../../theme/type.js"), require("../../hooks/useObserveTheme.js"),
|
|
9
|
-
require("../../hooks/useWindow.js"), require("../../chunks/misc-BTF7BCZW.js"), require("../../chunks/style-inject.es-CMuL-BfJ.js"),
|
|
10
|
-
exports.Card = Card.Card;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var DocIcons = require("../../chunks/DocIcons-BZI6JMyw.js");
|
|
4
|
-
|
|
5
|
-
require("../../chunks/tslib.es6-C8dZW5nY.js"), require("react/jsx-runtime"), require("react"),
|
|
6
|
-
require("../../hooks/useTheme.js"), require("../../theme/themes.js"), require("../../theme/colors.js"),
|
|
7
|
-
require("../../theme/corners.js"), require("../../theme/elevations.js"), require("../../theme/motion.js"),
|
|
8
|
-
require("../../theme/type.js"), require("../../hooks/useObserveTheme.js"), require("../../hooks/useWindow.js"),
|
|
9
|
-
exports.DocIcons = DocIcons.DocIcons;
|