Skip to content

Commit a3cac28

Browse files
author
Hector Arce De Las Heras
committed
Include loader styles on wireframe theme
1 parent 1638e3a commit a3cac28

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './styles';
2+
export * from './variants';
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { LoaderStylesType } from '@/components/loader/types';
2+
3+
import { buildPrimaryLoader } from '../../assets/animations';
4+
import { SIZES } from '../../foundations';
5+
import { LoaderVariantType } from './variants';
6+
7+
const container = {
8+
display: 'inline-block',
9+
width: SIZES.size_200,
10+
height: SIZES.size_200,
11+
};
12+
const transparent = 'transparent';
13+
14+
export const getLoaderStyles = (COLORS: {
15+
[key: string]: { [key: string]: string };
16+
}): LoaderStylesType<LoaderVariantType> => {
17+
return {
18+
[LoaderVariantType.PRIMARY_WHITE]: {
19+
container,
20+
animation: buildPrimaryLoader(COLORS.NEUTRAL.color_neutral_icon_250, transparent),
21+
},
22+
[LoaderVariantType.PRIMARY_RED]: {
23+
container,
24+
animation: buildPrimaryLoader(COLORS.SECONDARY.color_secondary_icon_100, transparent),
25+
},
26+
[LoaderVariantType.PRIMARY_BLACK]: {
27+
container,
28+
animation: buildPrimaryLoader(COLORS.NEUTRAL.color_neutral_icon_50, transparent),
29+
},
30+
};
31+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export enum LoaderVariantType {
2+
PRIMARY_WHITE = 'PRIMARY_WHITE',
3+
PRIMARY_RED = 'PRIMARY_RED',
4+
PRIMARY_BLACK = 'PRIMARY_BLACK',
5+
}

src/designSystem/kubitWireframe/commons/components/styles.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { LAYOUT_STYLES } from './layout';
3131
import { getLineSeparatorStyles } from './lineSeparator';
3232
import { getLinkStyles } from './link';
3333
import { getListOptionsStyles } from './listOptions';
34+
import { getLoaderStyles } from './loader';
3435
import { getMessageStyles } from './message';
3536
import { getModalStyles } from './modal';
3637
import { getNavigationCardStyles } from './navigationCard';
@@ -114,4 +115,5 @@ export const getComponentsStyles = (COLORS: {
114115
TOGGLE_STYLES: getToggleStyles(COLORS),
115116
TOOLTIP_STYLES: getTooltipStyles(COLORS),
116117
VALIDATION_STATUS_STYLES: getValidationStatusStyles(COLORS),
118+
LOADER_STYLES: getLoaderStyles(COLORS),
117119
});

src/designSystem/kubitWireframe/commons/components/variants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ export * from './thirdPartyAnimation/variants';
5454
export * from './toggle/variants';
5555
export * from './tooltip/variants';
5656
export * from './validationStatus/variants';
57+
export * from './loader/variants';

0 commit comments

Comments
 (0)