@salesql/sql_components_vue3 3.32.0 → 3.33.0
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/constants/events.d.ts +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.es.js +4614 -4023
- package/dist/index.es.js.map +1 -1
- package/dist/sql_components_vue3.css +1 -1
- package/dist/ui/DsAccountMenu/DsAccountMenu.types.d.ts +3 -10
- package/dist/ui/DsAccountMenu/DsAccountMenu.vue.d.ts +1 -1
- package/dist/ui/DsActionMenu/DsActionMenu.types.d.ts +8 -0
- package/dist/ui/DsColumnList/DsColumnList.types.d.ts +26 -0
- package/dist/ui/DsColumnList/DsColumnList.vue.d.ts +66 -0
- package/dist/ui/DsColumnList/index.d.ts +2 -0
- package/dist/ui/DsContactCard/DsContactCard.types.d.ts +30 -0
- package/dist/ui/DsContactCard/DsContactCard.vue.d.ts +103 -0
- package/dist/ui/DsContactCard/index.d.ts +2 -0
- package/dist/ui/DsCreditsChip/DsCreditsChip.types.d.ts +23 -0
- package/dist/ui/DsCreditsChip/DsCreditsChip.vue.d.ts +56 -0
- package/dist/ui/DsCreditsChip/index.d.ts +2 -0
- package/dist/ui/DsCreditsNotice/DsCreditsNotice.types.d.ts +15 -0
- package/dist/ui/DsCreditsNotice/DsCreditsNotice.vue.d.ts +46 -0
- package/dist/ui/DsCreditsNotice/index.d.ts +2 -0
- package/dist/ui/DsCreditsPopover/DsCreditsPopover.types.d.ts +46 -0
- package/dist/ui/DsCreditsPopover/DsCreditsPopover.vue.d.ts +108 -0
- package/dist/ui/DsCreditsPopover/index.d.ts +2 -0
- package/dist/ui/DsCreditsSummary/DsCreditsSummary.types.d.ts +42 -0
- package/dist/ui/DsCreditsSummary/DsCreditsSummary.vue.d.ts +51 -0
- package/dist/ui/DsCreditsSummary/creditsLevel.d.ts +13 -0
- package/dist/ui/DsCreditsSummary/index.d.ts +3 -0
- package/dist/ui/DsEmptyState/DsEmptyState.types.d.ts +11 -0
- package/dist/ui/DsEmptyState/DsEmptyState.vue.d.ts +29 -0
- package/dist/ui/DsPopover/DsPopover.types.d.ts +8 -0
- package/dist/ui/DsPopover/DsPopover.vue.d.ts +18 -0
- package/dist/ui/DsSavedButton/DsSavedButton.types.d.ts +3 -1
- package/dist/ui/DsSavedButton/DsSavedButton.vue.d.ts +9 -0
- package/llms-full.txt +236 -4
- package/llms.txt +6 -0
- package/package.json +1 -1
- package/src/icons/manifest.json +3 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DsCredits } from '../../ui/DsCreditsSummary';
|
|
1
2
|
export declare const DS_MAILBOX_PROVIDERS: {
|
|
2
3
|
readonly GOOGLE: "google";
|
|
3
4
|
readonly MICROSOFT: "microsoft";
|
|
@@ -11,16 +12,8 @@ export interface DsAccountMenuUser {
|
|
|
11
12
|
/** Plan chip («Premium», «Free»). Empty = no chip. */
|
|
12
13
|
plan?: string;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
used?: number | null;
|
|
17
|
-
/** The period's allowance. `null`, `0` or omitted = unknown: no bar and no «X of Y used». */
|
|
18
|
-
total?: number | null;
|
|
19
|
-
/** «N available». Omitted = `total - used` (not below 0). Given, it wins, even above `total`. */
|
|
20
|
-
available?: number | null;
|
|
21
|
-
/** Reset date, already formatted by the app («Dec 1»). Empty = no reset text. */
|
|
22
|
-
resetsOn?: string;
|
|
23
|
-
}
|
|
15
|
+
/** The credits block's data: the shared `DsCredits` of DsCreditsSummary. */
|
|
16
|
+
export type DsAccountMenuCredits = DsCredits;
|
|
24
17
|
export interface DsAccountMenuMailbox {
|
|
25
18
|
/** Stable key. */
|
|
26
19
|
id: string | number;
|
|
@@ -124,7 +124,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
124
124
|
copy: Partial<DsAccountMenuCopy>;
|
|
125
125
|
open: boolean;
|
|
126
126
|
language: string;
|
|
127
|
-
credits:
|
|
127
|
+
credits: import("../../ui/DsCreditsSummary").DsCredits | null;
|
|
128
128
|
mailboxes: DsAccountMenuMailbox[] | null;
|
|
129
129
|
getStarted: DsAccountMenuProgress | null;
|
|
130
130
|
showBulkSave: boolean;
|
|
@@ -6,6 +6,14 @@ export interface DsActionMenuItem {
|
|
|
6
6
|
label: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
danger?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Makes the item a choice (`menuitemradio`): `true` draws a check where the icon would be, `false`
|
|
11
|
+
* keeps the space blank so the labels line up. The consumer keeps exactly one `true`. An `icon` is
|
|
12
|
+
* ignored on a choice. Leave it out on plain actions.
|
|
13
|
+
*/
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
/** A hairline separator under this item, to split a group of choices from the actions below. */
|
|
16
|
+
separatorAfter?: boolean;
|
|
9
17
|
}
|
|
10
18
|
/** Item text weight. `bold` is for menus that sit on a bold surface (a table header). */
|
|
11
19
|
export declare const DS_ACTION_MENU_WEIGHTS: {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface DsColumnListItem {
|
|
2
|
+
/** Stable key; the payload of `toggle` and an entry of `reorder`. */
|
|
3
|
+
id: string;
|
|
4
|
+
/** The column's name. App copy. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** The column is shown in the table: its checkbox is checked. */
|
|
7
|
+
visible: boolean;
|
|
8
|
+
/** Cannot be toggled (it does not apply here). It can still be reordered. */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Small text at the right end, e.g. why it is disabled. App copy. */
|
|
11
|
+
hint?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface DsColumnListProps {
|
|
14
|
+
/** Every column, in table order, hidden ones included. */
|
|
15
|
+
columns: DsColumnListItem[];
|
|
16
|
+
/** The always-first column («Profile»): a lock and a checked, disabled row above the list. Empty draws none. App copy. */
|
|
17
|
+
lockedLabel?: string;
|
|
18
|
+
/** Hint of the locked row («Always first»). App copy. */
|
|
19
|
+
lockedHint?: string;
|
|
20
|
+
/** Tooltip of the drag handle («Drag to reorder»). App copy. */
|
|
21
|
+
dragLabel?: string;
|
|
22
|
+
/** Accessible name of the list. App copy. */
|
|
23
|
+
ariaLabel?: string;
|
|
24
|
+
/** Spoken description of the keyboard shortcut («Press Alt and an arrow key to move a column»). Empty draws none. App copy. */
|
|
25
|
+
reorderHint?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { DsColumnListItem } from './DsColumnList.types';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
columns: {
|
|
5
|
+
type: PropType<DsColumnListItem[]>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
lockedLabel: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
lockedHint: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
dragLabel: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
ariaLabel: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
reorderHint: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
+
toggle: (...args: any[]) => void;
|
|
30
|
+
reorder: (...args: any[]) => void;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
32
|
+
columns: {
|
|
33
|
+
type: PropType<DsColumnListItem[]>;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
lockedLabel: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
40
|
+
lockedHint: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
dragLabel: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
ariaLabel: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
reorderHint: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
}>> & Readonly<{
|
|
57
|
+
onToggle?: ((...args: any[]) => any) | undefined;
|
|
58
|
+
onReorder?: ((...args: any[]) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
ariaLabel: string;
|
|
61
|
+
lockedLabel: string;
|
|
62
|
+
lockedHint: string;
|
|
63
|
+
dragLabel: string;
|
|
64
|
+
reorderHint: string;
|
|
65
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
66
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface DsContactCardRow {
|
|
2
|
+
/** Stable key; handed back by the `row` slot so the app knows which cell to draw. */
|
|
3
|
+
id: string;
|
|
4
|
+
/** The column's name, drawn uppercase. App copy. */
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DsContactCardProps {
|
|
8
|
+
firstName?: string;
|
|
9
|
+
lastName?: string;
|
|
10
|
+
/** Job title, one line with an ellipsis. Empty draws none. */
|
|
11
|
+
jobTitle?: string;
|
|
12
|
+
/** Photo URL. Empty, or failing to load, falls back to DsAvatar's initials. */
|
|
13
|
+
image?: string;
|
|
14
|
+
/** Seeds the colour of the initials fallback (DsAvatar). */
|
|
15
|
+
uid?: string;
|
|
16
|
+
/** Draws a checkbox before the photo. Off by default: selection is opt-in. */
|
|
17
|
+
selectable?: boolean;
|
|
18
|
+
/** v-model:selected — the checkbox, and the accent background of the card. */
|
|
19
|
+
selected?: boolean;
|
|
20
|
+
/** Accessible name of the checkbox (it has no visible label), e.g. «Select Ada Lovelace». App copy. */
|
|
21
|
+
selectLabel?: string;
|
|
22
|
+
/** Accessible name of the open button. Optional: the visible name already names it; when set it must contain it (WCAG 2.5.3). App copy. */
|
|
23
|
+
openLabel?: string;
|
|
24
|
+
/** The labelled rows under the head, in order. None draws no body. */
|
|
25
|
+
rows?: DsContactCardRow[];
|
|
26
|
+
}
|
|
27
|
+
/** Scope of the `row` slot. */
|
|
28
|
+
export interface DsContactCardRowSlotProps {
|
|
29
|
+
row: DsContactCardRow;
|
|
30
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { DsContactCardRow } from './DsContactCard.types';
|
|
3
|
+
declare var __VLS_13: {
|
|
4
|
+
row: DsContactCardRow;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
row?: (props: typeof __VLS_13) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
firstName: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
lastName: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
jobTitle: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
image: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
uid: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
selectable: BooleanConstructor;
|
|
31
|
+
selected: BooleanConstructor;
|
|
32
|
+
selectLabel: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
openLabel: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
40
|
+
rows: {
|
|
41
|
+
type: PropType<DsContactCardRow[]>;
|
|
42
|
+
default: () => never[];
|
|
43
|
+
};
|
|
44
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
45
|
+
open: (...args: any[]) => void;
|
|
46
|
+
"update:selected": (...args: any[]) => void;
|
|
47
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
|
+
firstName: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
lastName: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
jobTitle: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
image: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
default: string;
|
|
63
|
+
};
|
|
64
|
+
uid: {
|
|
65
|
+
type: StringConstructor;
|
|
66
|
+
default: string;
|
|
67
|
+
};
|
|
68
|
+
selectable: BooleanConstructor;
|
|
69
|
+
selected: BooleanConstructor;
|
|
70
|
+
selectLabel: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
openLabel: {
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
default: string;
|
|
77
|
+
};
|
|
78
|
+
rows: {
|
|
79
|
+
type: PropType<DsContactCardRow[]>;
|
|
80
|
+
default: () => never[];
|
|
81
|
+
};
|
|
82
|
+
}>> & Readonly<{
|
|
83
|
+
onOpen?: ((...args: any[]) => any) | undefined;
|
|
84
|
+
"onUpdate:selected"?: ((...args: any[]) => any) | undefined;
|
|
85
|
+
}>, {
|
|
86
|
+
image: string;
|
|
87
|
+
selected: boolean;
|
|
88
|
+
firstName: string;
|
|
89
|
+
lastName: string;
|
|
90
|
+
uid: string;
|
|
91
|
+
rows: DsContactCardRow[];
|
|
92
|
+
selectable: boolean;
|
|
93
|
+
jobTitle: string;
|
|
94
|
+
openLabel: string;
|
|
95
|
+
selectLabel: string;
|
|
96
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
97
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
98
|
+
export default _default;
|
|
99
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
100
|
+
new (): {
|
|
101
|
+
$slots: S;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type DsCreditsLevel } from '../../ui/DsCreditsSummary';
|
|
2
|
+
export interface DsCreditsChipCopy {
|
|
3
|
+
/**
|
|
4
|
+
* The accessible name. `formatted` is the balance as drawn («12,000»). It also says `low`,
|
|
5
|
+
* which the chip otherwise shows only in colour.
|
|
6
|
+
*/
|
|
7
|
+
label: (formatted: string, available: number, level: DsCreditsLevel) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare const DS_CREDITS_CHIP_COPY: DsCreditsChipCopy;
|
|
10
|
+
export interface DsCreditsChipProps {
|
|
11
|
+
/** The balance. Drawn `en-US` («12,000»), never below 0. */
|
|
12
|
+
available: number;
|
|
13
|
+
/** `normal`, `low` (amber) or `out` (red). Default `normal`. */
|
|
14
|
+
level?: DsCreditsLevel;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the popover it opens is showing. Left out, the chip is a plain action: no
|
|
17
|
+
* `aria-expanded` or `aria-haspopup`. Passed (even `false`), it is a disclosure for a `dialog`.
|
|
18
|
+
*/
|
|
19
|
+
open?: boolean;
|
|
20
|
+
/** Tooltip text («412 credits · resets Dec 1»). Empty = none. Off while open. */
|
|
21
|
+
tooltip?: string;
|
|
22
|
+
copy?: Partial<DsCreditsChipCopy>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type DsCreditsLevel } from '../../ui/DsCreditsSummary';
|
|
3
|
+
import { type DsCreditsChipCopy } from './DsCreditsChip.types';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
available: {
|
|
6
|
+
type: NumberConstructor;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
level: {
|
|
10
|
+
type: PropType<DsCreditsLevel>;
|
|
11
|
+
default: "normal";
|
|
12
|
+
};
|
|
13
|
+
open: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
tooltip: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
copy: {
|
|
22
|
+
type: PropType<Partial<DsCreditsChipCopy>>;
|
|
23
|
+
default: undefined;
|
|
24
|
+
};
|
|
25
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
|
+
click: (...args: any[]) => void;
|
|
27
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
available: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
level: {
|
|
33
|
+
type: PropType<DsCreditsLevel>;
|
|
34
|
+
default: "normal";
|
|
35
|
+
};
|
|
36
|
+
open: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: undefined;
|
|
39
|
+
};
|
|
40
|
+
tooltip: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
copy: {
|
|
45
|
+
type: PropType<Partial<DsCreditsChipCopy>>;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
48
|
+
}>> & Readonly<{
|
|
49
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
copy: Partial<DsCreditsChipCopy>;
|
|
52
|
+
open: boolean;
|
|
53
|
+
tooltip: string;
|
|
54
|
+
level: DsCreditsLevel;
|
|
55
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
56
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const DS_CREDITS_NOTICE_TONES: {
|
|
2
|
+
readonly INFO: "info";
|
|
3
|
+
readonly LOW: "low";
|
|
4
|
+
readonly OUT: "out";
|
|
5
|
+
};
|
|
6
|
+
export type DsCreditsNoticeTone = (typeof DS_CREDITS_NOTICE_TONES)[keyof typeof DS_CREDITS_NOTICE_TONES];
|
|
7
|
+
export interface DsCreditsNoticeProps {
|
|
8
|
+
/** Already translated by the app. */
|
|
9
|
+
text: string;
|
|
10
|
+
tone?: DsCreditsNoticeTone;
|
|
11
|
+
/** An inline link right after the text («More info.»). Empty = no link. */
|
|
12
|
+
linkLabel?: string;
|
|
13
|
+
/** Where the link goes, in a new tab. Omitted, the link is a button that emits `click`. */
|
|
14
|
+
href?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
import { type DsCreditsNoticeTone } from './DsCreditsNotice.types';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
text: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
tone: {
|
|
9
|
+
type: PropType<DsCreditsNoticeTone>;
|
|
10
|
+
default: "info";
|
|
11
|
+
};
|
|
12
|
+
linkLabel: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
href: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
click: (...args: any[]) => void;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
text: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
tone: {
|
|
28
|
+
type: PropType<DsCreditsNoticeTone>;
|
|
29
|
+
default: "info";
|
|
30
|
+
};
|
|
31
|
+
linkLabel: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
href: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
}>> & Readonly<{
|
|
40
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
tone: DsCreditsNoticeTone;
|
|
43
|
+
href: string;
|
|
44
|
+
linkLabel: string;
|
|
45
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
46
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { DsCreditsChipCopy } from '../../ui/DsCreditsChip';
|
|
2
|
+
import type { DsCredits, DsCreditsCopy, DsCreditsLevel } from '../../ui/DsCreditsSummary';
|
|
3
|
+
export declare const DS_CREDITS_ACTION_KINDS: {
|
|
4
|
+
readonly UPGRADE: "upgrade";
|
|
5
|
+
readonly SEE_PLANS: "see_plans";
|
|
6
|
+
readonly UPDATE_PAYMENT: "update_payment";
|
|
7
|
+
};
|
|
8
|
+
export type DsCreditsActionKind = (typeof DS_CREDITS_ACTION_KINDS)[keyof typeof DS_CREDITS_ACTION_KINDS];
|
|
9
|
+
export interface DsCreditsAction {
|
|
10
|
+
kind: DsCreditsActionKind;
|
|
11
|
+
/** The button text («Upgrade», «See plans», «Update payment»). App copy. */
|
|
12
|
+
label: string;
|
|
13
|
+
}
|
|
14
|
+
/** Every string of the chip and the popover. Pass a partial: it overrides only its keys. */
|
|
15
|
+
export interface DsCreditsPopoverCopy extends DsCreditsCopy {
|
|
16
|
+
/** The chip's accessible name. */
|
|
17
|
+
chipLabel: DsCreditsChipCopy['label'];
|
|
18
|
+
/** The dialog's accessible name. */
|
|
19
|
+
dialog: string;
|
|
20
|
+
/** The amber notice at level `low`. `resetsOn` may be empty. */
|
|
21
|
+
lowNotice: (available: number, resetsOn: string) => string;
|
|
22
|
+
/** The red notice at level `out`. `resetsOn` may be empty. */
|
|
23
|
+
outNotice: (resetsOn: string) => string;
|
|
24
|
+
}
|
|
25
|
+
export declare const DS_CREDITS_POPOVER_COPY: DsCreditsPopoverCopy;
|
|
26
|
+
export interface DsCreditsPopoverProps {
|
|
27
|
+
/** Visibility. Omit it and the popover manages itself; bind `v-model:open` to control it. */
|
|
28
|
+
open?: boolean;
|
|
29
|
+
credits: DsCredits;
|
|
30
|
+
/** Colours the chip, the balance and the meter, and shows the low / out notice. */
|
|
31
|
+
level?: DsCreditsLevel;
|
|
32
|
+
/** The plan chip («Pro plan»). Empty = none. */
|
|
33
|
+
planLabel?: string;
|
|
34
|
+
/** The button under the summary. `null` = none. */
|
|
35
|
+
action?: DsCreditsAction | null;
|
|
36
|
+
/** A line instead of a button, with the `group` icon («Your team admin manages the plan»). */
|
|
37
|
+
note?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Panel width, also its max (DsPopover's 320 cap does not apply; the viewport's does): a number
|
|
40
|
+
* is px, a string any CSS length. Default 264.
|
|
41
|
+
*/
|
|
42
|
+
width?: number | string;
|
|
43
|
+
/** The chip's tooltip. Empty = none. */
|
|
44
|
+
tooltip?: string;
|
|
45
|
+
copy?: Partial<DsCreditsPopoverCopy>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type DsCredits, type DsCreditsLevel } from '../../ui/DsCreditsSummary';
|
|
3
|
+
import { type DsCreditsAction, type DsCreditsPopoverCopy } from './DsCreditsPopover.types';
|
|
4
|
+
declare var __VLS_11: {
|
|
5
|
+
open: boolean;
|
|
6
|
+
}, __VLS_25: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
trigger?: (props: typeof __VLS_11) => any;
|
|
9
|
+
} & {
|
|
10
|
+
notice?: (props: typeof __VLS_25) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
13
|
+
open: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
credits: {
|
|
18
|
+
type: PropType<DsCredits>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
level: {
|
|
22
|
+
type: PropType<DsCreditsLevel>;
|
|
23
|
+
default: "normal";
|
|
24
|
+
};
|
|
25
|
+
planLabel: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
action: {
|
|
30
|
+
type: PropType<DsCreditsAction | null>;
|
|
31
|
+
default: null;
|
|
32
|
+
};
|
|
33
|
+
note: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
width: {
|
|
38
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
39
|
+
default: number;
|
|
40
|
+
};
|
|
41
|
+
tooltip: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
default: string;
|
|
44
|
+
};
|
|
45
|
+
copy: {
|
|
46
|
+
type: PropType<Partial<DsCreditsPopoverCopy>>;
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
50
|
+
"update:open": (...args: any[]) => void;
|
|
51
|
+
action: (...args: any[]) => void;
|
|
52
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
53
|
+
open: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
57
|
+
credits: {
|
|
58
|
+
type: PropType<DsCredits>;
|
|
59
|
+
required: true;
|
|
60
|
+
};
|
|
61
|
+
level: {
|
|
62
|
+
type: PropType<DsCreditsLevel>;
|
|
63
|
+
default: "normal";
|
|
64
|
+
};
|
|
65
|
+
planLabel: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
default: string;
|
|
68
|
+
};
|
|
69
|
+
action: {
|
|
70
|
+
type: PropType<DsCreditsAction | null>;
|
|
71
|
+
default: null;
|
|
72
|
+
};
|
|
73
|
+
note: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
77
|
+
width: {
|
|
78
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
79
|
+
default: number;
|
|
80
|
+
};
|
|
81
|
+
tooltip: {
|
|
82
|
+
type: StringConstructor;
|
|
83
|
+
default: string;
|
|
84
|
+
};
|
|
85
|
+
copy: {
|
|
86
|
+
type: PropType<Partial<DsCreditsPopoverCopy>>;
|
|
87
|
+
default: undefined;
|
|
88
|
+
};
|
|
89
|
+
}>> & Readonly<{
|
|
90
|
+
"onUpdate:open"?: ((...args: any[]) => any) | undefined;
|
|
91
|
+
onAction?: ((...args: any[]) => any) | undefined;
|
|
92
|
+
}>, {
|
|
93
|
+
width: string | number;
|
|
94
|
+
copy: Partial<DsCreditsPopoverCopy>;
|
|
95
|
+
action: DsCreditsAction | null;
|
|
96
|
+
open: boolean;
|
|
97
|
+
tooltip: string;
|
|
98
|
+
level: DsCreditsLevel;
|
|
99
|
+
planLabel: string;
|
|
100
|
+
note: string;
|
|
101
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
102
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
103
|
+
export default _default;
|
|
104
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
105
|
+
new (): {
|
|
106
|
+
$slots: S;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** How the balance reads: `normal`, `low` (amber) or `out` (red). See `getCreditsLevel`. */
|
|
2
|
+
export declare const DS_CREDITS_LEVELS: {
|
|
3
|
+
readonly NORMAL: "normal";
|
|
4
|
+
readonly LOW: "low";
|
|
5
|
+
readonly OUT: "out";
|
|
6
|
+
};
|
|
7
|
+
export type DsCreditsLevel = (typeof DS_CREDITS_LEVELS)[keyof typeof DS_CREDITS_LEVELS];
|
|
8
|
+
export interface DsCredits {
|
|
9
|
+
/** Used this period. Only read with a `total`. Omitted = `total - available` (not below 0), else 0. */
|
|
10
|
+
used?: number | null;
|
|
11
|
+
/** The period's allowance. `null`, `0` or omitted = unknown: no bar and no «X of Y used». */
|
|
12
|
+
total?: number | null;
|
|
13
|
+
/** «N available», never below 0. Omitted = `total - used`. Given, it wins, even above `total`. */
|
|
14
|
+
available?: number | null;
|
|
15
|
+
/** Reset date, already formatted by the app («Dec 1»). Empty = no reset text. */
|
|
16
|
+
resetsOn?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Every string of the block. Pass a partial: it overrides only its keys. */
|
|
19
|
+
export interface DsCreditsCopy {
|
|
20
|
+
title: string;
|
|
21
|
+
/** The row layout's «N available». */
|
|
22
|
+
available: (available: number) => string;
|
|
23
|
+
/** The word next to the prominent figure. */
|
|
24
|
+
availableLabel: string;
|
|
25
|
+
used: (used: number, total: number) => string;
|
|
26
|
+
/** Never «Renews»: the credits reset. */
|
|
27
|
+
resets: (date: string) => string;
|
|
28
|
+
/** The progress bar's accessible name. */
|
|
29
|
+
progress: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const formatCredits: (n: number) => string;
|
|
32
|
+
export declare const DS_CREDITS_COPY: DsCreditsCopy;
|
|
33
|
+
export interface DsCreditsSummaryProps {
|
|
34
|
+
credits: DsCredits;
|
|
35
|
+
/** Colours the balance and makes the meter solid (amber / red). Default `normal`. */
|
|
36
|
+
level?: DsCreditsLevel;
|
|
37
|
+
/** The popover layout: «Credits» + plan chip, then the balance as a 26px figure. */
|
|
38
|
+
prominent?: boolean;
|
|
39
|
+
/** The plan chip of the prominent header («Pro plan»). Empty = no chip. Prominent only. */
|
|
40
|
+
planLabel?: string;
|
|
41
|
+
copy?: Partial<DsCreditsCopy>;
|
|
42
|
+
}
|