Skip to content

Commit d2a5f48

Browse files
authored
add designTokens to Colors type (#1758)
1 parent 1fbb409 commit d2a5f48

File tree

3 files changed

+67
-3
lines changed

3 files changed

+67
-3
lines changed

generatedTypes/src/components/button/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ declare class Button extends PureComponent<Props, ButtonState> {
157157
get isIconButton(): boolean | 0 | undefined;
158158
getBackgroundColor(): any;
159159
getActiveBackgroundColor(): string | undefined;
160-
getLabelColor(): any;
160+
getLabelColor(): string | undefined;
161161
getLabelSizeStyle(): object;
162162
getContainerSizeStyle(): any;
163163
getOutlineStyle(): {
164164
borderWidth: number;
165-
borderColor: any;
165+
borderColor: string;
166166
} | undefined;
167167
getBorderRadiusStyle(): {
168168
borderRadius: number;

generatedTypes/src/style/colors.d.ts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,66 @@ declare const colorObject: Colors & {
147147
transparent: string;
148148
} & {
149149
primary: string;
150+
} & {
151+
backgroundDefault: string;
152+
backgroundNeutralHeavy: string;
153+
backgroundIdle: string;
154+
backgroundNeutralMedium: string;
155+
backgroundNeutral: string;
156+
backgroundNeutralLight: string;
157+
backgroundPrimaryHeavy: string;
158+
backgroundPrimaryLight: string;
159+
backgroundPrimary: string;
160+
backgroundGeneralHeavy: string;
161+
backgroundGeneralLight: string;
162+
backgroundGeneral: string;
163+
backgroundSuccessHeavy: string;
164+
backgroundSuccess: string;
165+
backgroundWarningHeavy: string;
166+
backgroundWarning: string;
167+
backgroundMajor: string;
168+
backgroundDangerHeavy: string;
169+
backgroundDanger: string;
170+
backgroundDisabled: string;
171+
backgroundDark: string;
172+
textDisabled: string;
173+
textDefault: string;
174+
/**
175+
* Get app's current color scheme
176+
*/
177+
textNeutralHeavy: string;
178+
textNeutral: string;
179+
textNeutralLight: string;
180+
textWhite: string;
181+
textWhiteDisabled: string;
182+
textPrimary: string;
183+
textGeneral: string;
184+
textSuccess: string;
185+
textMajor: string;
186+
textDanger: string;
187+
textDangerLight: string;
188+
iconDefault: string;
189+
iconNeutral: string;
190+
iconWhite: string;
191+
iconWhiteDisabled: string;
192+
iconPrimary: string;
193+
iconPrimaryLight: string;
194+
iconGeneral: string;
195+
iconGeneralLight: string;
196+
iconSuccess: string;
197+
iconSuccessLight: string;
198+
iconMajor: string;
199+
iconDanger: string;
200+
iconDangerLight: string;
201+
iconDisabled: string;
202+
outlineWhite: string;
203+
outlineNeutral: string;
204+
outlineDisabled: string;
205+
outlinePrimary: string;
206+
outlineGeneral: string;
207+
outlineWarning: string;
208+
outlineDanger: string;
209+
dividerNeutral: string;
210+
divider: string;
150211
};
151212
export default colorObject;

src/style/colors.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,10 @@ function threeDigitHexToSix(value: string) {
246246
return value.replace(/./g, '$&$&');
247247
}
248248

249-
const TypedColors = Colors as ExtendTypeWith<typeof Colors, typeof colorsPalette & typeof themeColors>;
249+
const TypedColors = Colors as ExtendTypeWith<
250+
typeof Colors,
251+
typeof colorsPalette & typeof themeColors & typeof designTokens
252+
>;
250253
const colorObject = new TypedColors();
251254
colorObject.loadColors(colorsPalette);
252255
export default colorObject;

0 commit comments

Comments
 (0)