@bethinkpl/design-system 41.0.1 → 41.1.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/design-system.css +1 -1
- package/dist/design-system.js +3081 -3046
- package/dist/design-system.js.map +1 -1
- package/dist/lib/js/components/Buttons/IconButton/IconButton.consts.d.ts +1 -0
- package/dist/lib/js/components/Buttons/IconButton/IconButton.vue.d.ts +1 -0
- package/dist/lib/js/components/Cards/Card/Card.consts.d.ts +1 -0
- package/dist/lib/js/components/Chip/Chip.consts.d.ts +1 -0
- package/dist/lib/js/components/ContainerRibbon/ContainerRibbon.consts.d.ts +1 -0
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue.d.ts +1 -0
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.vue.d.ts +3 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +2 -0
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.vue.d.ts +2 -0
- package/dist/lib/js/components/Modals/Modal/Modal.vue.d.ts +2 -0
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.vue.d.ts +2 -0
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +96 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +2 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +2 -0
- package/dist/lib/js/components/Well/Well.consts.d.ts +2 -0
- package/lib/js/components/Buttons/IconButton/IconButton.consts.ts +1 -0
- package/lib/js/components/Buttons/IconButton/IconButton.spec.ts +1 -0
- package/lib/js/components/Chip/Chip.consts.ts +1 -0
- package/lib/js/components/Chip/Chip.spec.ts +2 -0
- package/lib/js/components/Chip/Chip.vue +12 -0
- package/lib/js/components/ContainerRibbon/ContainerRibbon.consts.ts +1 -0
- package/lib/js/components/ContainerRibbon/ContainerRibbon.spec.ts +9 -6
- package/lib/js/components/ContainerRibbon/ContainerRibbon.vue +5 -0
- package/lib/js/components/Pagination/Pagination.spec.ts +18 -1
- package/lib/js/components/Pagination/Pagination.stories.ts +5 -3
- package/lib/js/components/Pagination/Pagination.vue +31 -3
- package/lib/js/components/Well/Well.consts.ts +1 -0
- package/lib/js/components/Well/Well.spec.ts +9 -1
- package/lib/js/components/Well/Well.vue +11 -0
- package/lib/styles/settings/_buttons.scss +42 -0
- package/package.json +1 -1
|
@@ -30,6 +30,7 @@ export declare const ICON_BUTTON_COLORS: {
|
|
|
30
30
|
readonly WARNING: "warning";
|
|
31
31
|
readonly INFO: "info";
|
|
32
32
|
readonly MAGIC: "magic";
|
|
33
|
+
readonly ACCENT: "accent";
|
|
33
34
|
};
|
|
34
35
|
export type IconButtonColor = Value<typeof ICON_BUTTON_COLORS>;
|
|
35
36
|
export declare const ICON_BUTTON_STATES: {
|
|
@@ -379,6 +379,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
379
379
|
readonly WARNING: "warning";
|
|
380
380
|
readonly INFO: "info";
|
|
381
381
|
readonly MAGIC: "magic";
|
|
382
|
+
readonly ACCENT: "accent";
|
|
382
383
|
}>;
|
|
383
384
|
BUTTON_COLORS: Readonly<{
|
|
384
385
|
readonly PRIMARY: "primary";
|
|
@@ -20,6 +20,7 @@ export declare const CARD_RIBBON_COLORS: {
|
|
|
20
20
|
readonly DANGER: "danger";
|
|
21
21
|
readonly FAIL: "fail";
|
|
22
22
|
readonly INFO: "info";
|
|
23
|
+
readonly ACCENT: "accent";
|
|
23
24
|
readonly TRANSPARENT: "transparent";
|
|
24
25
|
};
|
|
25
26
|
export type CardRibbonColors = Value<typeof CARD_RIBBON_COLORS>;
|
|
@@ -16,6 +16,7 @@ export declare const CHIP_COLORS: {
|
|
|
16
16
|
readonly INVERTED: "inverted";
|
|
17
17
|
readonly WARNING: "warning";
|
|
18
18
|
readonly INFO: "info";
|
|
19
|
+
readonly ACCENT: "accent";
|
|
19
20
|
};
|
|
20
21
|
export declare const CHIP_DEFAULT_COLOR: "neutral";
|
|
21
22
|
export type ChipColor = Value<typeof CHIP_COLORS>;
|
|
@@ -17,6 +17,7 @@ export declare const CONTAINER_RIBBON_COLORS: {
|
|
|
17
17
|
readonly DANGER: "danger";
|
|
18
18
|
readonly FAIL: "fail";
|
|
19
19
|
readonly INFO: "info";
|
|
20
|
+
readonly ACCENT: "accent";
|
|
20
21
|
readonly TRANSPARENT: "transparent";
|
|
21
22
|
};
|
|
22
23
|
export type ContainerRibbonColor = Value<typeof CONTAINER_RIBBON_COLORS>;
|
|
@@ -1030,6 +1030,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1030
1030
|
readonly WARNING: "warning";
|
|
1031
1031
|
readonly INFO: "info";
|
|
1032
1032
|
readonly MAGIC: "magic";
|
|
1033
|
+
readonly ACCENT: "accent";
|
|
1033
1034
|
}>;
|
|
1034
1035
|
BUTTON_COLORS: Readonly<{
|
|
1035
1036
|
readonly PRIMARY: "primary";
|
|
@@ -71,6 +71,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
71
71
|
readonly WARNING: "warning";
|
|
72
72
|
readonly INFO: "info";
|
|
73
73
|
readonly MAGIC: "magic";
|
|
74
|
+
readonly ACCENT: "accent";
|
|
74
75
|
};
|
|
75
76
|
ICON_BUTTON_SIZES: {
|
|
76
77
|
readonly XX_SMALL: "xx-small";
|
|
@@ -820,6 +821,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
820
821
|
readonly WARNING: "warning";
|
|
821
822
|
readonly INFO: "info";
|
|
822
823
|
readonly MAGIC: "magic";
|
|
824
|
+
readonly ACCENT: "accent";
|
|
823
825
|
}>;
|
|
824
826
|
SECTION_HEADER_MOBILE_LAYOUTS: Readonly<{
|
|
825
827
|
readonly VERTICAL: "vertical";
|
|
@@ -1372,6 +1374,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1372
1374
|
readonly WARNING: "warning";
|
|
1373
1375
|
readonly INFO: "info";
|
|
1374
1376
|
readonly MAGIC: "magic";
|
|
1377
|
+
readonly ACCENT: "accent";
|
|
1375
1378
|
}>;
|
|
1376
1379
|
BUTTON_COLORS: Readonly<{
|
|
1377
1380
|
readonly PRIMARY: "primary";
|
|
@@ -59,6 +59,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
59
59
|
readonly WARNING: "warning";
|
|
60
60
|
readonly INFO: "info";
|
|
61
61
|
readonly MAGIC: "magic";
|
|
62
|
+
readonly ACCENT: "accent";
|
|
62
63
|
}>;
|
|
63
64
|
ICON_BUTTON_STATES: Readonly<{
|
|
64
65
|
readonly DEFAULT: "default";
|
|
@@ -807,6 +808,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
807
808
|
readonly WARNING: "warning";
|
|
808
809
|
readonly INFO: "info";
|
|
809
810
|
readonly MAGIC: "magic";
|
|
811
|
+
readonly ACCENT: "accent";
|
|
810
812
|
}>;
|
|
811
813
|
BUTTON_COLORS: Readonly<{
|
|
812
814
|
readonly PRIMARY: "primary";
|
|
@@ -377,6 +377,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
377
377
|
readonly WARNING: "warning";
|
|
378
378
|
readonly INFO: "info";
|
|
379
379
|
readonly MAGIC: "magic";
|
|
380
|
+
readonly ACCENT: "accent";
|
|
380
381
|
}>;
|
|
381
382
|
SECTION_HEADER_MOBILE_LAYOUTS: Readonly<{
|
|
382
383
|
readonly VERTICAL: "vertical";
|
|
@@ -929,6 +930,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
929
930
|
readonly WARNING: "warning";
|
|
930
931
|
readonly INFO: "info";
|
|
931
932
|
readonly MAGIC: "magic";
|
|
933
|
+
readonly ACCENT: "accent";
|
|
932
934
|
}>;
|
|
933
935
|
BUTTON_COLORS: Readonly<{
|
|
934
936
|
readonly PRIMARY: "primary";
|
|
@@ -407,6 +407,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
407
407
|
readonly WARNING: "warning";
|
|
408
408
|
readonly INFO: "info";
|
|
409
409
|
readonly MAGIC: "magic";
|
|
410
|
+
readonly ACCENT: "accent";
|
|
410
411
|
};
|
|
411
412
|
ICON_SIZES: {
|
|
412
413
|
XXX_SMALL: string;
|
|
@@ -1060,6 +1061,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1060
1061
|
readonly WARNING: "warning";
|
|
1061
1062
|
readonly INFO: "info";
|
|
1062
1063
|
readonly MAGIC: "magic";
|
|
1064
|
+
readonly ACCENT: "accent";
|
|
1063
1065
|
}>;
|
|
1064
1066
|
BUTTON_COLORS: Readonly<{
|
|
1065
1067
|
readonly PRIMARY: "primary";
|
|
@@ -542,6 +542,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
542
542
|
readonly WARNING: "warning";
|
|
543
543
|
readonly INFO: "info";
|
|
544
544
|
readonly MAGIC: "magic";
|
|
545
|
+
readonly ACCENT: "accent";
|
|
545
546
|
};
|
|
546
547
|
ICON_SIZES: {
|
|
547
548
|
XXX_SMALL: string;
|
|
@@ -1195,6 +1196,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1195
1196
|
readonly WARNING: "warning";
|
|
1196
1197
|
readonly INFO: "info";
|
|
1197
1198
|
readonly MAGIC: "magic";
|
|
1199
|
+
readonly ACCENT: "accent";
|
|
1198
1200
|
}>;
|
|
1199
1201
|
BUTTON_COLORS: Readonly<{
|
|
1200
1202
|
readonly PRIMARY: "primary";
|
|
@@ -10,6 +10,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
10
10
|
type: BooleanConstructor;
|
|
11
11
|
default: boolean;
|
|
12
12
|
};
|
|
13
|
+
isLoading: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: boolean;
|
|
16
|
+
};
|
|
13
17
|
isCentered: {
|
|
14
18
|
type: BooleanConstructor;
|
|
15
19
|
default: boolean;
|
|
@@ -53,6 +57,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
53
57
|
readonly WARNING: "warning";
|
|
54
58
|
readonly INFO: "info";
|
|
55
59
|
readonly MAGIC: "magic";
|
|
60
|
+
readonly ACCENT: "accent";
|
|
56
61
|
}>;
|
|
57
62
|
ICON_BUTTON_STATES: Readonly<{
|
|
58
63
|
readonly DEFAULT: "default";
|
|
@@ -341,6 +346,16 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
341
346
|
readonly FAD_SQUARE: import('@fortawesome/fontawesome-common-types').IconDefinition;
|
|
342
347
|
readonly FAD_SQUARE_CHECK: import('@fortawesome/fontawesome-common-types').IconDefinition;
|
|
343
348
|
}>;
|
|
349
|
+
ICON_SIZES: Readonly<{
|
|
350
|
+
XXX_SMALL: string;
|
|
351
|
+
XX_SMALL: string;
|
|
352
|
+
X_SMALL: string;
|
|
353
|
+
SMALL: string;
|
|
354
|
+
MEDIUM: string;
|
|
355
|
+
LARGE: string;
|
|
356
|
+
X_LARGE: string;
|
|
357
|
+
XX_LARGE: string;
|
|
358
|
+
}>;
|
|
344
359
|
FIRST_PAGE_NUMBER: number;
|
|
345
360
|
}, {
|
|
346
361
|
lastPage(): number;
|
|
@@ -363,6 +378,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
363
378
|
type: BooleanConstructor;
|
|
364
379
|
default: boolean;
|
|
365
380
|
};
|
|
381
|
+
isLoading: {
|
|
382
|
+
type: BooleanConstructor;
|
|
383
|
+
default: boolean;
|
|
384
|
+
};
|
|
366
385
|
isCentered: {
|
|
367
386
|
type: BooleanConstructor;
|
|
368
387
|
default: boolean;
|
|
@@ -379,6 +398,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
379
398
|
}>> & Readonly<{
|
|
380
399
|
"onChange-page"?: ((...args: any[]) => any) | undefined;
|
|
381
400
|
}>, {
|
|
401
|
+
isLoading: boolean;
|
|
382
402
|
currentPage: number;
|
|
383
403
|
forceCompact: boolean;
|
|
384
404
|
isCentered: boolean;
|
|
@@ -761,6 +781,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
761
781
|
readonly WARNING: "warning";
|
|
762
782
|
readonly INFO: "info";
|
|
763
783
|
readonly MAGIC: "magic";
|
|
784
|
+
readonly ACCENT: "accent";
|
|
764
785
|
}>;
|
|
765
786
|
BUTTON_COLORS: Readonly<{
|
|
766
787
|
readonly PRIMARY: "primary";
|
|
@@ -1185,5 +1206,80 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1185
1206
|
};
|
|
1186
1207
|
});
|
|
1187
1208
|
SelectList: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1209
|
+
DsIcon: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
1210
|
+
icon: {
|
|
1211
|
+
type: ObjectConstructor;
|
|
1212
|
+
required: true;
|
|
1213
|
+
validator(icon: unknown): boolean;
|
|
1214
|
+
};
|
|
1215
|
+
size: {
|
|
1216
|
+
type: StringConstructor;
|
|
1217
|
+
default: string;
|
|
1218
|
+
validator: (value: string) => boolean;
|
|
1219
|
+
};
|
|
1220
|
+
rotation: {
|
|
1221
|
+
type: (NumberConstructor | null)[];
|
|
1222
|
+
default: null;
|
|
1223
|
+
};
|
|
1224
|
+
flippedVertical: {
|
|
1225
|
+
type: BooleanConstructor;
|
|
1226
|
+
default: boolean;
|
|
1227
|
+
};
|
|
1228
|
+
flippedHorizontal: {
|
|
1229
|
+
type: BooleanConstructor;
|
|
1230
|
+
default: boolean;
|
|
1231
|
+
};
|
|
1232
|
+
touchableDeprecated: {
|
|
1233
|
+
type: BooleanConstructor;
|
|
1234
|
+
default: boolean;
|
|
1235
|
+
};
|
|
1236
|
+
spinning: {
|
|
1237
|
+
type: BooleanConstructor;
|
|
1238
|
+
default: boolean;
|
|
1239
|
+
};
|
|
1240
|
+
}>, {}, {}, {
|
|
1241
|
+
sizeClassName(): string;
|
|
1242
|
+
isFontawesomeIcon(): boolean;
|
|
1243
|
+
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
1244
|
+
icon: {
|
|
1245
|
+
type: ObjectConstructor;
|
|
1246
|
+
required: true;
|
|
1247
|
+
validator(icon: unknown): boolean;
|
|
1248
|
+
};
|
|
1249
|
+
size: {
|
|
1250
|
+
type: StringConstructor;
|
|
1251
|
+
default: string;
|
|
1252
|
+
validator: (value: string) => boolean;
|
|
1253
|
+
};
|
|
1254
|
+
rotation: {
|
|
1255
|
+
type: (NumberConstructor | null)[];
|
|
1256
|
+
default: null;
|
|
1257
|
+
};
|
|
1258
|
+
flippedVertical: {
|
|
1259
|
+
type: BooleanConstructor;
|
|
1260
|
+
default: boolean;
|
|
1261
|
+
};
|
|
1262
|
+
flippedHorizontal: {
|
|
1263
|
+
type: BooleanConstructor;
|
|
1264
|
+
default: boolean;
|
|
1265
|
+
};
|
|
1266
|
+
touchableDeprecated: {
|
|
1267
|
+
type: BooleanConstructor;
|
|
1268
|
+
default: boolean;
|
|
1269
|
+
};
|
|
1270
|
+
spinning: {
|
|
1271
|
+
type: BooleanConstructor;
|
|
1272
|
+
default: boolean;
|
|
1273
|
+
};
|
|
1274
|
+
}>> & Readonly<{}>, {
|
|
1275
|
+
rotation: number | null;
|
|
1276
|
+
size: string;
|
|
1277
|
+
flippedVertical: boolean;
|
|
1278
|
+
flippedHorizontal: boolean;
|
|
1279
|
+
touchableDeprecated: boolean;
|
|
1280
|
+
spinning: boolean;
|
|
1281
|
+
}, {}, {
|
|
1282
|
+
FontAwesomeIcon: import('vue').DefineComponent<import('@fortawesome/vue-fontawesome').FontAwesomeIconProps>;
|
|
1283
|
+
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1188
1284
|
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1189
1285
|
export default _default;
|
|
@@ -314,6 +314,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
314
314
|
readonly WARNING: "warning";
|
|
315
315
|
readonly INFO: "info";
|
|
316
316
|
readonly MAGIC: "magic";
|
|
317
|
+
readonly ACCENT: "accent";
|
|
317
318
|
}>;
|
|
318
319
|
ICON_SIZES: Readonly<{
|
|
319
320
|
XXX_SMALL: string;
|
|
@@ -1045,6 +1046,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1045
1046
|
readonly WARNING: "warning";
|
|
1046
1047
|
readonly INFO: "info";
|
|
1047
1048
|
readonly MAGIC: "magic";
|
|
1049
|
+
readonly ACCENT: "accent";
|
|
1048
1050
|
}>;
|
|
1049
1051
|
BUTTON_COLORS: Readonly<{
|
|
1050
1052
|
readonly PRIMARY: "primary";
|
package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts
CHANGED
|
@@ -343,6 +343,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
343
343
|
readonly WARNING: "warning";
|
|
344
344
|
readonly INFO: "info";
|
|
345
345
|
readonly MAGIC: "magic";
|
|
346
|
+
readonly ACCENT: "accent";
|
|
346
347
|
}>;
|
|
347
348
|
BUTTON_TYPES: Readonly<{
|
|
348
349
|
readonly FILLED: "filled";
|
|
@@ -1017,6 +1018,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
1017
1018
|
readonly WARNING: "warning";
|
|
1018
1019
|
readonly INFO: "info";
|
|
1019
1020
|
readonly MAGIC: "magic";
|
|
1021
|
+
readonly ACCENT: "accent";
|
|
1020
1022
|
}>;
|
|
1021
1023
|
BUTTON_COLORS: Readonly<{
|
|
1022
1024
|
readonly PRIMARY: "primary";
|
|
@@ -3,6 +3,7 @@ import { Value } from '../../utils/type.utils';
|
|
|
3
3
|
export declare const WELL_PADDINGS: {
|
|
4
4
|
readonly SMALL: "small";
|
|
5
5
|
readonly MEDIUM: "medium";
|
|
6
|
+
readonly LARGE: "large";
|
|
6
7
|
};
|
|
7
8
|
export type WellPadding = Value<typeof WELL_PADDINGS>;
|
|
8
9
|
export declare const WELL_COLORS: {
|
|
@@ -27,6 +28,7 @@ export declare const WELL_RIBBON_COLORS: {
|
|
|
27
28
|
readonly DANGER: "danger";
|
|
28
29
|
readonly FAIL: "fail";
|
|
29
30
|
readonly INFO: "info";
|
|
31
|
+
readonly ACCENT: "accent";
|
|
30
32
|
readonly TRANSPARENT: "transparent";
|
|
31
33
|
};
|
|
32
34
|
export type WellRibbonColor = Value<typeof WELL_RIBBON_COLORS>;
|
|
@@ -38,6 +38,7 @@ describe('IconButton', () => {
|
|
|
38
38
|
[{ props: { state: ICON_BUTTON_STATES.LOADING }, expectedClass: '-ds-loading' }],
|
|
39
39
|
[{ props: { color: ICON_BUTTON_COLORS.PRIMARY }, expectedClass: '-ds-color-primary' }],
|
|
40
40
|
[{ props: { color: ICON_BUTTON_COLORS.MAGIC }, expectedClass: '-ds-color-magic' }],
|
|
41
|
+
[{ props: { color: ICON_BUTTON_COLORS.ACCENT }, expectedClass: '-ds-color-accent' }],
|
|
41
42
|
])('correct class for props', ({ props, expectedClass }) => {
|
|
42
43
|
const component = createComponent(props);
|
|
43
44
|
expect(component.classes()).toContain(expectedClass);
|
|
@@ -133,6 +133,7 @@ describe('Chip', () => {
|
|
|
133
133
|
[CHIP_COLORS.INFO, '-ds-color-info'],
|
|
134
134
|
[CHIP_COLORS.WARNING, '-ds-color-warning'],
|
|
135
135
|
[CHIP_COLORS.INVERTED, '-ds-color-inverted'],
|
|
136
|
+
[CHIP_COLORS.ACCENT, '-ds-color-accent'],
|
|
136
137
|
])(
|
|
137
138
|
'correct class for color: %s prop, expectedClass: %s',
|
|
138
139
|
(color: string, expectedClass: string) => {
|
|
@@ -147,6 +148,7 @@ describe('Chip', () => {
|
|
|
147
148
|
'-ds-color-info',
|
|
148
149
|
'-ds-color-warning',
|
|
149
150
|
'-ds-color-inverted',
|
|
151
|
+
'-ds-color-accent',
|
|
150
152
|
];
|
|
151
153
|
const component = createComponent({ color });
|
|
152
154
|
const componentClasses = component.classes();
|
|
@@ -156,6 +156,17 @@ $chip-colors: (
|
|
|
156
156
|
'background': $color-info-background,
|
|
157
157
|
),
|
|
158
158
|
),
|
|
159
|
+
'accent': (
|
|
160
|
+
'label': $color-accent-text,
|
|
161
|
+
'icon': $color-accent-icon,
|
|
162
|
+
'background': $color-accent-background,
|
|
163
|
+
'background-hover': $color-accent-background-hovered,
|
|
164
|
+
'disabled': (
|
|
165
|
+
'label': $color-accent-text-disabled,
|
|
166
|
+
'icon': $color-accent-icon-disabled,
|
|
167
|
+
'background': $color-accent-background,
|
|
168
|
+
),
|
|
169
|
+
),
|
|
159
170
|
'inverted': (
|
|
160
171
|
'label': $color-neutral-text,
|
|
161
172
|
'icon': $color-neutral-icon,
|
|
@@ -318,6 +329,7 @@ const CHIP_ICON_BUTTONS_COLOR_MAP: Record<ChipColor, IconButtonColor> = {
|
|
|
318
329
|
[CHIP_COLORS.WARNING]: ICON_BUTTON_COLORS.WARNING,
|
|
319
330
|
[CHIP_COLORS.SUCCESS]: ICON_BUTTON_COLORS.SUCCESS,
|
|
320
331
|
[CHIP_COLORS.INFO]: ICON_BUTTON_COLORS.INFO,
|
|
332
|
+
[CHIP_COLORS.ACCENT]: ICON_BUTTON_COLORS.ACCENT,
|
|
321
333
|
};
|
|
322
334
|
|
|
323
335
|
const {
|
|
@@ -33,12 +33,15 @@ describe('ContainerRibbon', () => {
|
|
|
33
33
|
},
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
-
it(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
it.each(Object.values(CONTAINER_RIBBON_COLORS))(
|
|
37
|
+
'applies color class correctly for color "%s"',
|
|
38
|
+
(color) => {
|
|
39
|
+
const wrapper = mount(ContainerRibbon, {
|
|
40
|
+
props: { color },
|
|
41
|
+
});
|
|
42
|
+
expect(wrapper.find('.ds-container-ribbon').classes()).toContain(`-ds-color-${color}`);
|
|
43
|
+
},
|
|
44
|
+
);
|
|
42
45
|
|
|
43
46
|
it('applies layout classes correctly', () => {
|
|
44
47
|
const wrapper = mount(ContainerRibbon, {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
'-ds-color-danger': color === CONTAINER_RIBBON_COLORS.DANGER,
|
|
16
16
|
'-ds-color-fail': color === CONTAINER_RIBBON_COLORS.FAIL,
|
|
17
17
|
'-ds-color-info': color === CONTAINER_RIBBON_COLORS.INFO,
|
|
18
|
+
'-ds-color-accent': color === CONTAINER_RIBBON_COLORS.ACCENT,
|
|
18
19
|
'-ds-color-transparent': color === CONTAINER_RIBBON_COLORS.TRANSPARENT,
|
|
19
20
|
'-ds-layout-vertical': layout === CONTAINER_RIBBON_LAYOUTS.VERTICAL,
|
|
20
21
|
'-ds-layout-horizontal': layout === CONTAINER_RIBBON_LAYOUTS.HORIZONTAL,
|
|
@@ -116,6 +117,10 @@
|
|
|
116
117
|
background-color: $color-info-border;
|
|
117
118
|
}
|
|
118
119
|
|
|
120
|
+
&.-ds-color-accent {
|
|
121
|
+
background-color: $color-accent-border;
|
|
122
|
+
}
|
|
123
|
+
|
|
119
124
|
&.-ds-color-transparent {
|
|
120
125
|
background-color: transparent;
|
|
121
126
|
}
|
|
@@ -4,11 +4,16 @@ import { shallowMount } from '@vue/test-utils';
|
|
|
4
4
|
import Pagination from './Pagination.vue';
|
|
5
5
|
|
|
6
6
|
describe('Pagination', () => {
|
|
7
|
-
const createComponent = ({
|
|
7
|
+
const createComponent = ({
|
|
8
|
+
currentPage = 1,
|
|
9
|
+
itemsTotalAmount = 30,
|
|
10
|
+
isLoading = false,
|
|
11
|
+
} = {}) => {
|
|
8
12
|
return shallowMount(Pagination, {
|
|
9
13
|
props: {
|
|
10
14
|
currentPage,
|
|
11
15
|
itemsTotalAmount,
|
|
16
|
+
isLoading,
|
|
12
17
|
} as any,
|
|
13
18
|
global: {
|
|
14
19
|
stubs: {
|
|
@@ -32,6 +37,18 @@ describe('Pagination', () => {
|
|
|
32
37
|
expect(component.exists()).toBe(true);
|
|
33
38
|
});
|
|
34
39
|
|
|
40
|
+
it('should not render the loading spinner by default', () => {
|
|
41
|
+
const component = createComponent({ itemsTotalAmount: 60 });
|
|
42
|
+
|
|
43
|
+
expect(component.find('.ds-pagination__loading').exists()).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should render the loading spinner when isLoading is true', () => {
|
|
47
|
+
const component = createComponent({ itemsTotalAmount: 60, isLoading: true });
|
|
48
|
+
|
|
49
|
+
expect(component.find('.ds-pagination__loading').exists()).toBe(true);
|
|
50
|
+
});
|
|
51
|
+
|
|
35
52
|
test.each([
|
|
36
53
|
{
|
|
37
54
|
props: {
|
|
@@ -22,9 +22,9 @@ const StoryTemplate: StoryFn<typeof Pagination> = (args) => {
|
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
template: `
|
|
25
|
-
<Pagination v-bind=args @change-page="onChangePage">
|
|
26
|
-
<template #accessory>
|
|
27
|
-
<div
|
|
25
|
+
<Pagination v-bind="args" @change-page="onChangePage">
|
|
26
|
+
<template v-if="args.accessory" #accessory>
|
|
27
|
+
<div v-html="args.accessory" />
|
|
28
28
|
</template>
|
|
29
29
|
</Pagination>`,
|
|
30
30
|
};
|
|
@@ -35,6 +35,7 @@ export const Interactive = StoryTemplate.bind({});
|
|
|
35
35
|
const argTypes = {
|
|
36
36
|
currentPage: { control: { type: 'number', min: 1 } },
|
|
37
37
|
forceCompact: { control: 'boolean' },
|
|
38
|
+
isLoading: { control: 'boolean' },
|
|
38
39
|
isCentered: { control: 'boolean' },
|
|
39
40
|
itemsPerPage: { control: { type: 'number', min: 1 } },
|
|
40
41
|
itemsTotalAmount: { control: { type: 'number', min: 1 } },
|
|
@@ -45,6 +46,7 @@ Interactive.argTypes = argTypes;
|
|
|
45
46
|
Interactive.args = {
|
|
46
47
|
currentPage: 1,
|
|
47
48
|
forceCompact: false,
|
|
49
|
+
isLoading: false,
|
|
48
50
|
isCentered: false,
|
|
49
51
|
itemsPerPage: 30,
|
|
50
52
|
itemsTotalAmount: 600,
|
|
@@ -65,6 +65,10 @@
|
|
|
65
65
|
</dropdown>
|
|
66
66
|
</div>
|
|
67
67
|
</template>
|
|
68
|
+
|
|
69
|
+
<div v-if="isLoading" class="ds-pagination__loading">
|
|
70
|
+
<ds-icon :icon="ICONS.FAD_SPINNER_THIRD" :size="ICON_SIZES.SMALL" spinning />
|
|
71
|
+
</div>
|
|
68
72
|
</div>
|
|
69
73
|
|
|
70
74
|
<div v-if="navigationItems.length > 1" class="ds-pagination__items -ds-compact">
|
|
@@ -109,10 +113,14 @@
|
|
|
109
113
|
"
|
|
110
114
|
@click="changePage(currentPage + 1)"
|
|
111
115
|
/>
|
|
116
|
+
|
|
117
|
+
<div v-if="isLoading" class="ds-pagination__loading">
|
|
118
|
+
<ds-icon :icon="ICONS.FAD_SPINNER_THIRD" :size="ICON_SIZES.SMALL" spinning />
|
|
119
|
+
</div>
|
|
112
120
|
</div>
|
|
113
121
|
</div>
|
|
114
122
|
|
|
115
|
-
<div class="ds-pagination__accessorySlot">
|
|
123
|
+
<div v-if="$slots.accessory" class="ds-pagination__accessorySlot">
|
|
116
124
|
<slot name="accessory" />
|
|
117
125
|
</div>
|
|
118
126
|
</div>
|
|
@@ -138,6 +146,8 @@ $pagination-input-height: 32px;
|
|
|
138
146
|
align-items: stretch;
|
|
139
147
|
flex-direction: row;
|
|
140
148
|
flex-grow: 1;
|
|
149
|
+
// leaves room for the loading spinner so it doesn't overlap the accessory slot
|
|
150
|
+
gap: $space-20;
|
|
141
151
|
|
|
142
152
|
&__itemsWrapper {
|
|
143
153
|
align-content: center;
|
|
@@ -157,6 +167,7 @@ $pagination-input-height: 32px;
|
|
|
157
167
|
align-items: center;
|
|
158
168
|
flex-direction: row;
|
|
159
169
|
padding: 0;
|
|
170
|
+
position: relative;
|
|
160
171
|
|
|
161
172
|
&.-ds-default {
|
|
162
173
|
display: none;
|
|
@@ -260,6 +271,17 @@ $pagination-input-height: 32px;
|
|
|
260
271
|
min-height: 0;
|
|
261
272
|
padding: 0;
|
|
262
273
|
}
|
|
274
|
+
|
|
275
|
+
&__loading {
|
|
276
|
+
align-items: center;
|
|
277
|
+
color: $color-primary-icon;
|
|
278
|
+
display: flex;
|
|
279
|
+
left: 100%;
|
|
280
|
+
margin-left: $space-6;
|
|
281
|
+
position: absolute;
|
|
282
|
+
top: 50%;
|
|
283
|
+
transform: translateY(-50%);
|
|
284
|
+
}
|
|
263
285
|
}
|
|
264
286
|
</style>
|
|
265
287
|
|
|
@@ -267,7 +289,8 @@ $pagination-input-height: 32px;
|
|
|
267
289
|
import { PAGINATION_DEFAULT_ITEMS_PER_PAGE } from './Pagination.consts';
|
|
268
290
|
import IconButton from '../Buttons/IconButton/IconButton.vue';
|
|
269
291
|
import { ICON_BUTTON_COLORS, ICON_BUTTON_SIZES, ICON_BUTTON_STATES } from '../Buttons/IconButton';
|
|
270
|
-
import
|
|
292
|
+
import DsIcon from '../Icons/Icon/Icon.vue';
|
|
293
|
+
import { ICON_SIZES, ICONS } from '../Icons/Icon';
|
|
271
294
|
|
|
272
295
|
import { DROPDOWN_PLACEMENTS, DROPDOWN_RADIUSES } from '../Dropdown/Dropdown.consts';
|
|
273
296
|
import Dropdown from '../Dropdown/Dropdown.vue';
|
|
@@ -283,7 +306,7 @@ const FIRST_PAGE_NUMBER = 1;
|
|
|
283
306
|
|
|
284
307
|
export default defineComponent({
|
|
285
308
|
name: 'Pagination',
|
|
286
|
-
components: { IconButton, Dropdown, SelectListItem, SelectList },
|
|
309
|
+
components: { IconButton, Dropdown, SelectListItem, SelectList, DsIcon },
|
|
287
310
|
props: {
|
|
288
311
|
currentPage: {
|
|
289
312
|
type: Number,
|
|
@@ -296,6 +319,10 @@ export default defineComponent({
|
|
|
296
319
|
type: Boolean,
|
|
297
320
|
default: false,
|
|
298
321
|
},
|
|
322
|
+
isLoading: {
|
|
323
|
+
type: Boolean,
|
|
324
|
+
default: false,
|
|
325
|
+
},
|
|
299
326
|
isCentered: {
|
|
300
327
|
type: Boolean,
|
|
301
328
|
default: false,
|
|
@@ -328,6 +355,7 @@ export default defineComponent({
|
|
|
328
355
|
ICON_BUTTON_COLORS: Object.freeze(ICON_BUTTON_COLORS),
|
|
329
356
|
ICON_BUTTON_STATES: Object.freeze(ICON_BUTTON_STATES),
|
|
330
357
|
ICONS: Object.freeze(ICONS),
|
|
358
|
+
ICON_SIZES: Object.freeze(ICON_SIZES),
|
|
331
359
|
FIRST_PAGE_NUMBER,
|
|
332
360
|
};
|
|
333
361
|
},
|
|
@@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest';
|
|
|
2
2
|
import { ComponentMountingOptions, mount } from '@vue/test-utils';
|
|
3
3
|
|
|
4
4
|
import Well from './Well.vue';
|
|
5
|
-
import { WELL_RIBBON_POSITIONS } from './Well.consts';
|
|
5
|
+
import { WELL_PADDINGS, WELL_RIBBON_POSITIONS } from './Well.consts';
|
|
6
6
|
|
|
7
7
|
describe('Well', () => {
|
|
8
8
|
const createComponent = (options: ComponentMountingOptions<typeof Well> = {}) => {
|
|
@@ -24,6 +24,14 @@ describe('Well', () => {
|
|
|
24
24
|
expect(component.find('.ds-well__content').text()).toContain(content);
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
+
it.each(Object.values(WELL_PADDINGS))('should set the padding class for %s', (padding) => {
|
|
28
|
+
const component = createComponent({
|
|
29
|
+
props: { padding },
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
expect(component.find('.ds-well').classes()).toContain(`-ds-${padding}`);
|
|
33
|
+
});
|
|
34
|
+
|
|
27
35
|
it('should not set no-radius class by default', () => {
|
|
28
36
|
const component = createComponent();
|
|
29
37
|
|