@ni/nimble-components 34.3.2 → 34.4.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/all-components-bundle.js +762 -638
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +6091 -6093
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/chip/index.d.ts +30 -0
- package/dist/esm/chip/index.js +62 -0
- package/dist/esm/chip/index.js.map +1 -0
- package/dist/esm/chip/styles.d.ts +1 -0
- package/dist/esm/chip/styles.js +66 -0
- package/dist/esm/chip/styles.js.map +1 -0
- package/dist/esm/chip/template.d.ts +4 -0
- package/dist/esm/chip/template.js +37 -0
- package/dist/esm/chip/template.js.map +1 -0
- package/dist/esm/chip/testing/chip.pageobject.d.ts +14 -0
- package/dist/esm/chip/testing/chip.pageobject.js +37 -0
- package/dist/esm/chip/testing/chip.pageobject.js.map +1 -0
- package/dist/esm/chip/types.d.ts +5 -0
- package/dist/esm/chip/types.js +5 -0
- package/dist/esm/chip/types.js.map +1 -0
- package/dist/esm/label-provider/core/index.d.ts +3 -0
- package/dist/esm/label-provider/core/index.js +6 -2
- package/dist/esm/label-provider/core/index.js.map +1 -1
- package/dist/esm/label-provider/core/label-token-defaults.js +2 -1
- package/dist/esm/label-provider/core/label-token-defaults.js.map +1 -1
- package/dist/esm/label-provider/core/label-tokens.d.ts +1 -0
- package/dist/esm/label-provider/core/label-tokens.js +4 -0
- package/dist/esm/label-provider/core/label-tokens.js.map +1 -1
- package/dist/esm/theme-provider/design-token-values.d.ts +257 -0
- package/dist/esm/theme-provider/design-token-values.js +164 -0
- package/dist/esm/theme-provider/design-token-values.js.map +1 -0
- package/dist/esm/theme-provider/design-tokens.js +153 -201
- package/dist/esm/theme-provider/design-tokens.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,161 +1,146 @@
|
|
|
1
1
|
import { DesignToken } from '@ni/fast-foundation';
|
|
2
|
-
import { parseColorHexRGB } from '@ni/fast-colors';
|
|
3
|
-
import { Black, Black7, Black15, Black80, Black85, Black88, Black91, White, ForestGreen, DigitalGreenLight, Fail100LightUi, SmallDelay, MediumDelay, LargeDelay, Fail100DarkUi, Warning100LightUi, Warning100DarkUi, Pass100LightUi, Pass100DarkUi, BodyFamily, BodySize, BodyWeight, Body2Family, Body2Size, Body2Weight, ControlLabel1Family, ControlLabel1Size, ControlLabel1Weight, GroupLabel1Family, GroupLabel1Size, GroupLabel1Weight, Headline2Size, Headline2Family, Headline2Weight, Headline1Size, Headline1Family, Headline1Weight, Title3Size, Title3Family, Title3Weight, Title2Size, Title2Family, Title2Weight, Title1Size, Title1Family, Title1Weight, Subtitle2Size, Subtitle2Family, Subtitle2Weight, Subtitle1Size, Subtitle1Family, Subtitle1Weight, LinkLightUiSize, LinkLightUiFamily, LinkLightUiWeight, PlaceholderSize, PlaceholderFamily, PlaceholderWeight, BodyEmphasizedSize, BodyEmphasizedFamily, BodyEmphasizedWeight, BodyEmphasized2Size, BodyEmphasized2Family, BodyEmphasized2Weight, ButtonLabel1Size, ButtonLabel1Family, ButtonLabel1Weight, TooltipCaptionSize, TooltipCaptionFamily, TooltipCaptionWeight, ErrorLightUiSize, ErrorLightUiFamily, ErrorLightUiWeight, Headline2LineHeight, Headline1LineHeight, Title3LineHeight, Title2LineHeight, Title1LineHeight, Subtitle2LineHeight, Subtitle1LineHeight, LinkLineHeight, PlaceholderLineHeight, BodyEmphasizedLineHeight, BodyEmphasized2LineHeight, BodyLineHeight, Body2LineHeight, GroupLabel1LineHeight, ControlLabel1LineHeight, ButtonLabel1LineHeight, TooltipCaptionLineHeight, Information100LightUi, Information100DarkUi, DigitalGreenDark, PowerGreen, GridHeaderFamily, GridHeaderWeight, GridHeaderSize, DigitalGreenDark105, NiFern, NiFernDark1, NiHoneyLight, NiIndigo, NiIndigoDark2, NiPlumDark1, NiScarlet, NiScarletDark1, NiScarletDark3, NiSea, NiSeaLight, NiSeaDark2, NiSky, NiTulip, DigitalGreenLight10, PowerGreen10, DigitalGreenDark110, Black82, Black22, PowerGreen30, DigitalGreenLight30, PowerGreenDark50 } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';
|
|
4
2
|
import { Theme } from './types';
|
|
5
3
|
import { tokenNames, styleNameFromTokenName } from './design-token-names';
|
|
6
4
|
import { theme } from '.';
|
|
7
|
-
import {
|
|
8
|
-
//
|
|
9
|
-
export const actionRgbPartialColor =
|
|
10
|
-
export const applicationBackgroundColor =
|
|
11
|
-
export const headerBackgroundColor =
|
|
12
|
-
export const sectionBackgroundColor =
|
|
13
|
-
export const sectionBackgroundImage =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
|
|
33
|
-
export const
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
37
|
-
export const
|
|
38
|
-
export const
|
|
39
|
-
export const
|
|
40
|
-
export const
|
|
41
|
-
export const
|
|
42
|
-
export const
|
|
43
|
-
export const
|
|
44
|
-
export const
|
|
45
|
-
export const
|
|
46
|
-
export const
|
|
47
|
-
export const
|
|
48
|
-
export const
|
|
49
|
-
export const
|
|
50
|
-
export const
|
|
51
|
-
export const
|
|
52
|
-
export const
|
|
53
|
-
export const
|
|
54
|
-
export const
|
|
55
|
-
export const
|
|
56
|
-
export const
|
|
57
|
-
export const
|
|
58
|
-
export const
|
|
59
|
-
export const
|
|
60
|
-
export const
|
|
61
|
-
export const
|
|
62
|
-
export const
|
|
63
|
-
export const
|
|
64
|
-
export const
|
|
65
|
-
export const
|
|
66
|
-
export const
|
|
67
|
-
export const
|
|
68
|
-
export const
|
|
69
|
-
export const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
export const
|
|
73
|
-
|
|
74
|
-
export const
|
|
75
|
-
export const
|
|
76
|
-
export const
|
|
77
|
-
export const
|
|
78
|
-
export const
|
|
79
|
-
export const
|
|
80
|
-
export const
|
|
81
|
-
export const
|
|
82
|
-
export const
|
|
83
|
-
export const
|
|
84
|
-
export const
|
|
85
|
-
export const
|
|
86
|
-
export const
|
|
87
|
-
export const
|
|
88
|
-
export const
|
|
89
|
-
export const
|
|
90
|
-
export const
|
|
91
|
-
export const
|
|
92
|
-
export const
|
|
93
|
-
export const
|
|
94
|
-
export const
|
|
95
|
-
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
export const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
export const
|
|
103
|
-
|
|
104
|
-
export const [
|
|
105
|
-
export const [
|
|
106
|
-
export const [
|
|
107
|
-
export const [
|
|
108
|
-
export const [
|
|
109
|
-
export const [
|
|
110
|
-
export const [
|
|
111
|
-
export const [
|
|
112
|
-
export const [
|
|
113
|
-
export const [
|
|
114
|
-
export const [
|
|
115
|
-
export const [
|
|
116
|
-
export const [
|
|
117
|
-
export const [
|
|
118
|
-
export const [
|
|
119
|
-
export const [
|
|
120
|
-
export const [
|
|
121
|
-
export const [
|
|
122
|
-
export const [
|
|
123
|
-
export const [
|
|
124
|
-
export const [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
//
|
|
130
|
-
export const smallDelay =
|
|
131
|
-
export const mediumDelay =
|
|
132
|
-
export const largeDelay =
|
|
133
|
-
//
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return `${r * 255}, ${g * 255}, ${b * 255}`;
|
|
137
|
-
}
|
|
138
|
-
function createFontTokens(fontTokenName, colorFunction, disabledColorFunction, family, weight, size, lineHeight) {
|
|
139
|
-
if (fontTokenName === ''
|
|
140
|
-
|| family === ''
|
|
141
|
-
|| weight === ''
|
|
142
|
-
|| size === ''
|
|
143
|
-
|| lineHeight === '') {
|
|
144
|
-
throw new Error('createFontTokens parameter unexpectedly set to empty string');
|
|
145
|
-
}
|
|
146
|
-
const familyWithFallback = `${family}, ${family} Fallback`;
|
|
147
|
-
const fontToken = DesignToken.create(styleNameFromTokenName(fontTokenName)).withDefault(`${weight} ${size}/${lineHeight} ${familyWithFallback}`);
|
|
5
|
+
import { tokenValues } from './design-token-values';
|
|
6
|
+
// #region color tokens
|
|
7
|
+
export const actionRgbPartialColor = createThemeColorToken(tokenNames.actionRgbPartialColor, tokenValues.actionRgbPartialColor);
|
|
8
|
+
export const applicationBackgroundColor = createThemeColorToken(tokenNames.applicationBackgroundColor, tokenValues.applicationBackgroundColor);
|
|
9
|
+
export const headerBackgroundColor = createThemeColorToken(tokenNames.headerBackgroundColor, tokenValues.headerBackgroundColor);
|
|
10
|
+
export const sectionBackgroundColor = createThemeColorToken(tokenNames.sectionBackgroundColor, tokenValues.sectionBackgroundColor);
|
|
11
|
+
export const sectionBackgroundImage = createThemeColorToken(tokenNames.sectionBackgroundImage, tokenValues.sectionBackgroundImage);
|
|
12
|
+
export const dividerBackgroundColor = createThemeColorToken(tokenNames.dividerBackgroundColor, tokenValues.dividerBackgroundColor);
|
|
13
|
+
export const fillSelectedColor = createThemeColorToken(tokenNames.fillSelectedColor, tokenValues.fillSelectedColor);
|
|
14
|
+
export const fillSelectedRgbPartialColor = createThemeColorToken(tokenNames.fillSelectedRgbPartialColor, tokenValues.fillSelectedRgbPartialColor);
|
|
15
|
+
export const fillHoverSelectedColor = createThemeColorToken(tokenNames.fillHoverSelectedColor, tokenValues.fillHoverSelectedColor);
|
|
16
|
+
export const fillHoverColor = createThemeColorToken(tokenNames.fillHoverColor, tokenValues.fillHoverColor);
|
|
17
|
+
export const fillHoverRgbPartialColor = createThemeColorToken(tokenNames.fillHoverRgbPartialColor, tokenValues.fillHoverRgbPartialColor);
|
|
18
|
+
export const fillDownColor = createThemeColorToken(tokenNames.fillDownColor, tokenValues.fillDownColor);
|
|
19
|
+
export const borderColor = createThemeColorToken(tokenNames.borderColor, tokenValues.borderColor);
|
|
20
|
+
export const borderRgbPartialColor = createThemeColorToken(tokenNames.borderRgbPartialColor, tokenValues.borderRgbPartialColor);
|
|
21
|
+
export const failColor = createThemeColorToken(tokenNames.failColor, tokenValues.failColor);
|
|
22
|
+
export const warningColor = createThemeColorToken(tokenNames.warningColor, tokenValues.warningColor);
|
|
23
|
+
export const passColor = createThemeColorToken(tokenNames.passColor, tokenValues.passColor);
|
|
24
|
+
export const informationColor = createThemeColorToken(tokenNames.informationColor, tokenValues.informationColor);
|
|
25
|
+
export const borderHoverColor = createThemeColorToken(tokenNames.borderHoverColor, tokenValues.borderHoverColor);
|
|
26
|
+
// #endregion
|
|
27
|
+
// #region component color tokens
|
|
28
|
+
export const iconColor = createThemeColorToken(tokenNames.iconColor, tokenValues.iconColor);
|
|
29
|
+
export const modalBackdropColor = createThemeColorToken(tokenNames.modalBackdropColor, tokenValues.modalBackdropColor);
|
|
30
|
+
export const popupBorderColor = createThemeColorToken(tokenNames.popupBorderColor, tokenValues.popupBorderColor);
|
|
31
|
+
export const cardBorderColor = createThemeColorToken(tokenNames.cardBorderColor, tokenValues.cardBorderColor);
|
|
32
|
+
export const graphGridlineColor = createThemeColorToken(tokenNames.graphGridlineColor, tokenValues.graphGridlineColor);
|
|
33
|
+
export const graphTrace1Color = createThemeColorToken(tokenNames.graphTrace1Color, tokenValues.graphTrace1Color);
|
|
34
|
+
export const graphTrace2Color = createThemeColorToken(tokenNames.graphTrace2Color, tokenValues.graphTrace2Color);
|
|
35
|
+
export const graphTrace3Color = createThemeColorToken(tokenNames.graphTrace3Color, tokenValues.graphTrace3Color);
|
|
36
|
+
export const graphTrace4Color = createThemeColorToken(tokenNames.graphTrace4Color, tokenValues.graphTrace4Color);
|
|
37
|
+
export const graphTrace5Color = createThemeColorToken(tokenNames.graphTrace5Color, tokenValues.graphTrace5Color);
|
|
38
|
+
export const graphTrace6Color = createThemeColorToken(tokenNames.graphTrace6Color, tokenValues.graphTrace6Color);
|
|
39
|
+
export const graphTrace7Color = createThemeColorToken(tokenNames.graphTrace7Color, tokenValues.graphTrace7Color);
|
|
40
|
+
export const graphTrace8Color = createThemeColorToken(tokenNames.graphTrace8Color, tokenValues.graphTrace8Color);
|
|
41
|
+
export const tooltipBackgroundColor = createThemeColorToken(tokenNames.tooltipBackgroundColor, tokenValues.tooltipBackgroundColor);
|
|
42
|
+
export const tableRowBorderColor = createThemeColorToken(tokenNames.tableRowBorderColor, tokenValues.tableRowBorderColor);
|
|
43
|
+
export const tagFillColor = createThemeColorToken(tokenNames.tagFillColor, tokenValues.tagFillColor);
|
|
44
|
+
export const buttonFillPrimaryColor = createThemeColorToken(tokenNames.buttonFillPrimaryColor, tokenValues.buttonFillPrimaryColor);
|
|
45
|
+
export const buttonPrimaryFontColor = createThemeColorToken(tokenNames.buttonPrimaryFontColor, tokenValues.buttonPrimaryFontColor);
|
|
46
|
+
export const buttonFillAccentColor = createThemeColorToken(tokenNames.buttonFillAccentColor, tokenValues.buttonFillAccentColor);
|
|
47
|
+
export const buttonAccentBlockFontColor = createThemeColorToken(tokenNames.buttonAccentBlockFontColor, tokenValues.buttonAccentBlockFontColor);
|
|
48
|
+
export const buttonAccentOutlineFontColor = createThemeColorToken(tokenNames.buttonAccentOutlineFontColor, tokenValues.buttonAccentOutlineFontColor);
|
|
49
|
+
export const buttonBorderAccentOutlineColor = createThemeColorToken(tokenNames.buttonBorderAccentOutlineColor, tokenValues.buttonBorderAccentOutlineColor);
|
|
50
|
+
export const calendarEventBackgroundStaticColor = createThemeColorToken(tokenNames.calendarEventBackgroundStaticColor, tokenValues.calendarEventBackgroundStaticColor);
|
|
51
|
+
export const calendarEventBackgroundDynamicColor = createThemeColorToken(tokenNames.calendarEventBackgroundDynamicColor, tokenValues.calendarEventBackgroundDynamicColor);
|
|
52
|
+
export const calendarEventBackgroundTransientColor = createThemeColorToken(tokenNames.calendarEventBackgroundTransientColor, tokenValues.calendarEventBackgroundTransientColor);
|
|
53
|
+
export const calendarEventBorderStaticColor = createThemeColorToken(tokenNames.calendarEventBorderStaticColor, tokenValues.calendarEventBorderStaticColor);
|
|
54
|
+
export const calendarEventBorderTransientColor = createThemeColorToken(tokenNames.calendarEventBorderTransientColor, tokenValues.calendarEventBorderTransientColor);
|
|
55
|
+
export const calendarEventStaticFontColor = createThemeColorToken(tokenNames.calendarEventStaticFontColor, tokenValues.calendarEventStaticFontColor);
|
|
56
|
+
export const calendarEventDynamicFontColor = createThemeColorToken(tokenNames.calendarEventDynamicFontColor, tokenValues.calendarEventDynamicFontColor);
|
|
57
|
+
export const calendarEventTransientFontColor = createThemeColorToken(tokenNames.calendarEventTransientFontColor, tokenValues.calendarEventTransientFontColor);
|
|
58
|
+
export const calendarEventBackgroundHoverStaticColor = createThemeColorToken(tokenNames.calendarEventBackgroundHoverStaticColor, tokenValues.calendarEventBackgroundHoverStaticColor);
|
|
59
|
+
export const calendarEventBackgroundHoverDynamicColor = createThemeColorToken(tokenNames.calendarEventBackgroundHoverDynamicColor, tokenValues.calendarEventBackgroundHoverDynamicColor);
|
|
60
|
+
export const calendarEventBackgroundHoverTransientColor = createThemeColorToken(tokenNames.calendarEventBackgroundHoverTransientColor, tokenValues.calendarEventBackgroundHoverTransientColor);
|
|
61
|
+
export const calendarEventOuterBorderHighlightedColor = createThemeColorToken(tokenNames.calendarEventOuterBorderHighlightedColor, tokenValues.calendarEventOuterBorderHighlightedColor);
|
|
62
|
+
export const calendarRowBackgroundSelectedColor = createThemeColorToken(tokenNames.calendarRowBackgroundSelectedColor, tokenValues.calendarRowBackgroundSelectedColor);
|
|
63
|
+
export const calendarRowBackgroundConflictColor = createThemeColorToken(tokenNames.calendarRowBackgroundConflictColor, tokenValues.calendarRowBackgroundConflictColor);
|
|
64
|
+
export const calendarEventFillBlockedColor = createThemeColorToken(tokenNames.calendarEventFillBlockedColor, tokenValues.calendarEventFillBlockedColor);
|
|
65
|
+
export const calendarGrabHandleBackgroundColor = createThemeColorToken(tokenNames.calendarGrabHandleBackgroundColor, tokenValues.calendarGrabHandleBackgroundColor);
|
|
66
|
+
export const calendarGridBorderColor = createThemeColorToken(tokenNames.calendarGridBorderColor, tokenValues.calendarGridBorderColor);
|
|
67
|
+
export const calendarGroupHeaderBackgroundColor = createThemeColorToken(tokenNames.calendarGroupHeaderBackgroundColor, tokenValues.calendarGroupHeaderBackgroundColor);
|
|
68
|
+
// #endregion
|
|
69
|
+
// #region size tokens
|
|
70
|
+
export const controlHeight = createStringToken(tokenNames.controlHeight, tokenValues.controlHeight);
|
|
71
|
+
export const controlSlimHeight = createStringToken(tokenNames.controlSlimHeight, tokenValues.controlSlimHeight);
|
|
72
|
+
export const smallPadding = createStringToken(tokenNames.smallPadding, tokenValues.smallPadding);
|
|
73
|
+
export const mediumPadding = createStringToken(tokenNames.mediumPadding, tokenValues.mediumPadding);
|
|
74
|
+
export const standardPadding = createStringToken(tokenNames.standardPadding, tokenValues.standardPadding);
|
|
75
|
+
export const largePadding = createStringToken(tokenNames.largePadding, tokenValues.largePadding);
|
|
76
|
+
export const labelHeight = createStringToken(tokenNames.labelHeight, tokenValues.labelHeight);
|
|
77
|
+
export const borderWidth = createStringToken(tokenNames.borderWidth, tokenValues.borderWidth);
|
|
78
|
+
export const dividerWidth = createStringToken(tokenNames.dividerWidth, tokenValues.dividerWidth);
|
|
79
|
+
export const iconSize = createStringToken(tokenNames.iconSize, tokenValues.iconSize);
|
|
80
|
+
export const drawerWidth = createStringToken(tokenNames.drawerWidth, tokenValues.drawerWidth);
|
|
81
|
+
export const dialogSmallWidth = createStringToken(tokenNames.dialogSmallWidth, tokenValues.dialogSmallWidth);
|
|
82
|
+
export const dialogSmallHeight = createStringToken(tokenNames.dialogSmallHeight, tokenValues.dialogSmallHeight);
|
|
83
|
+
export const dialogSmallMaxHeight = createStringToken(tokenNames.dialogSmallMaxHeight, tokenValues.dialogSmallMaxHeight);
|
|
84
|
+
export const dialogLargeWidth = createStringToken(tokenNames.dialogLargeWidth, tokenValues.dialogLargeWidth);
|
|
85
|
+
export const dialogLargeHeight = createStringToken(tokenNames.dialogLargeHeight, tokenValues.dialogLargeHeight);
|
|
86
|
+
export const dialogLargeMaxHeight = createStringToken(tokenNames.dialogLargeMaxHeight, tokenValues.dialogLargeMaxHeight);
|
|
87
|
+
export const menuMinWidth = createStringToken(tokenNames.menuMinWidth, tokenValues.menuMinWidth);
|
|
88
|
+
export const bannerGapSize = createStringToken(tokenNames.bannerGapSize, tokenValues.bannerGapSize);
|
|
89
|
+
export const spinnerSmallHeight = createStringToken(tokenNames.spinnerSmallHeight, tokenValues.spinnerSmallHeight);
|
|
90
|
+
export const spinnerMediumHeight = createStringToken(tokenNames.spinnerMediumHeight, tokenValues.spinnerMediumHeight);
|
|
91
|
+
export const spinnerLargeHeight = createStringToken(tokenNames.spinnerLargeHeight, tokenValues.spinnerLargeHeight);
|
|
92
|
+
export const tableFitRowsHeight = createStringToken(tokenNames.tableFitRowsHeight, tokenValues.tableFitRowsHeight);
|
|
93
|
+
// #endregion
|
|
94
|
+
// #region drop shadow tokens
|
|
95
|
+
export const elevation1BoxShadow = createThemeColorToken(tokenNames.elevation1BoxShadow, tokenValues.elevation1BoxShadow);
|
|
96
|
+
export const elevation2BoxShadow = createThemeColorToken(tokenNames.elevation2BoxShadow, tokenValues.elevation2BoxShadow);
|
|
97
|
+
export const elevation3BoxShadow = createThemeColorToken(tokenNames.elevation3BoxShadow, tokenValues.elevation3BoxShadow);
|
|
98
|
+
// #endregion
|
|
99
|
+
// #region font tokens
|
|
100
|
+
export const [headlineFont, headlineFontColor, headlineDisabledFontColor, headlineFontFamily, headlineFontWeight, headlineFontSize, headlineFontLineHeight] = createFontTokens(tokenNames.headlineFont, tokenValues.headlineFont, tokenValues.headlineFontColor, tokenValues.headlineDisabledFontColor, tokenValues.headlineFontFamily, tokenValues.headlineFontWeight, tokenValues.headlineFontSize, tokenValues.headlineFontLineHeight);
|
|
101
|
+
export const [headlinePlus1Font, headlinePlus1FontColor, headlinePlus1DisabledFontColor, headlinePlus1FontFamily, headlinePlus1FontWeight, headlinePlus1FontSize, headlinePlus1FontLineHeight] = createFontTokens(tokenNames.headlinePlus1Font, tokenValues.headlinePlus1Font, tokenValues.headlinePlus1FontColor, tokenValues.headlinePlus1DisabledFontColor, tokenValues.headlinePlus1FontFamily, tokenValues.headlinePlus1FontWeight, tokenValues.headlinePlus1FontSize, tokenValues.headlinePlus1FontLineHeight);
|
|
102
|
+
export const [titlePlus2Font, titlePlus2FontColor, titlePlus2DisabledFontColor, titlePlus2FontFamily, titlePlus2FontWeight, titlePlus2FontSize, titlePlus2FontLineHeight] = createFontTokens(tokenNames.titlePlus2Font, tokenValues.titlePlus2Font, tokenValues.titlePlus2FontColor, tokenValues.titlePlus2DisabledFontColor, tokenValues.titlePlus2FontFamily, tokenValues.titlePlus2FontWeight, tokenValues.titlePlus2FontSize, tokenValues.titlePlus2FontLineHeight);
|
|
103
|
+
export const [titlePlus1Font, titlePlus1FontColor, titlePlus1DisabledFontColor, titlePlus1FontFamily, titlePlus1FontWeight, titlePlus1FontSize, titlePlus1FontLineHeight] = createFontTokens(tokenNames.titlePlus1Font, tokenValues.titlePlus1Font, tokenValues.titlePlus1FontColor, tokenValues.titlePlus1DisabledFontColor, tokenValues.titlePlus1FontFamily, tokenValues.titlePlus1FontWeight, tokenValues.titlePlus1FontSize, tokenValues.titlePlus1FontLineHeight);
|
|
104
|
+
export const [titleFont, titleFontColor, titleDisabledFontColor, titleFontFamily, titleFontWeight, titleFontSize, titleFontLineHeight] = createFontTokens(tokenNames.titleFont, tokenValues.titleFont, tokenValues.titleFontColor, tokenValues.titleDisabledFontColor, tokenValues.titleFontFamily, tokenValues.titleFontWeight, tokenValues.titleFontSize, tokenValues.titleFontLineHeight);
|
|
105
|
+
export const [subtitlePlus1Font, subtitlePlus1FontColor, subtitlePlus1DisabledFontColor, subtitlePlus1FontFamily, subtitlePlus1FontWeight, subtitlePlus1FontSize, subtitlePlus1FontLineHeight] = createFontTokens(tokenNames.subtitlePlus1Font, tokenValues.subtitlePlus1Font, tokenValues.subtitlePlus1FontColor, tokenValues.subtitlePlus1DisabledFontColor, tokenValues.subtitlePlus1FontFamily, tokenValues.subtitlePlus1FontWeight, tokenValues.subtitlePlus1FontSize, tokenValues.subtitlePlus1FontLineHeight);
|
|
106
|
+
export const [subtitleFont, subtitleFontColor, subtitleDisabledFontColor, subtitleFontFamily, subtitleFontWeight, subtitleFontSize, subtitleFontLineHeight] = createFontTokens(tokenNames.subtitleFont, tokenValues.subtitleFont, tokenValues.subtitleFontColor, tokenValues.subtitleDisabledFontColor, tokenValues.subtitleFontFamily, tokenValues.subtitleFontWeight, tokenValues.subtitleFontSize, tokenValues.subtitleFontLineHeight);
|
|
107
|
+
export const [linkFont, linkFontColor, linkDisabledFontColor, linkFontFamily, linkFontWeight, linkFontSize, linkFontLineHeight] = createFontTokens(tokenNames.linkFont, tokenValues.linkFont, tokenValues.linkFontColor, tokenValues.linkDisabledFontColor, tokenValues.linkFontFamily, tokenValues.linkFontWeight, tokenValues.linkFontSize, tokenValues.linkFontLineHeight);
|
|
108
|
+
export const [linkActiveFont, linkActiveFontColor, linkActiveDisabledFontColor, linkActiveFontFamily, linkActiveFontWeight, linkActiveFontSize, linkActiveFontLineHeight] = createFontTokens(tokenNames.linkActiveFont, tokenValues.linkActiveFont, tokenValues.linkActiveFontColor, tokenValues.linkActiveDisabledFontColor, tokenValues.linkActiveFontFamily, tokenValues.linkActiveFontWeight, tokenValues.linkActiveFontSize, tokenValues.linkActiveFontLineHeight);
|
|
109
|
+
export const [linkProminentFont, linkProminentFontColor, linkProminentDisabledFontColor, linkProminentFontFamily, linkProminentFontWeight, linkProminentFontSize, linkProminentFontLineHeight] = createFontTokens(tokenNames.linkProminentFont, tokenValues.linkProminentFont, tokenValues.linkProminentFontColor, tokenValues.linkProminentDisabledFontColor, tokenValues.linkProminentFontFamily, tokenValues.linkProminentFontWeight, tokenValues.linkProminentFontSize, tokenValues.linkProminentFontLineHeight);
|
|
110
|
+
export const [linkActiveProminentFont, linkActiveProminentFontColor, linkActiveProminentDisabledFontColor, linkActiveProminentFontFamily, linkActiveProminentFontWeight, linkActiveProminentFontSize, linkActiveProminentFontLineHeight] = createFontTokens(tokenNames.linkActiveProminentFont, tokenValues.linkActiveProminentFont, tokenValues.linkActiveProminentFontColor, tokenValues.linkActiveProminentDisabledFontColor, tokenValues.linkActiveProminentFontFamily, tokenValues.linkActiveProminentFontWeight, tokenValues.linkActiveProminentFontSize, tokenValues.linkActiveProminentFontLineHeight);
|
|
111
|
+
export const [placeholderFont, placeholderFontColor, placeholderDisabledFontColor, placeholderFontFamily, placeholderFontWeight, placeholderFontSize, placeholderFontLineHeight] = createFontTokens(tokenNames.placeholderFont, tokenValues.placeholderFont, tokenValues.placeholderFontColor, tokenValues.placeholderDisabledFontColor, tokenValues.placeholderFontFamily, tokenValues.placeholderFontWeight, tokenValues.placeholderFontSize, tokenValues.placeholderFontLineHeight);
|
|
112
|
+
export const [bodyFont, bodyFontColor, bodyDisabledFontColor, bodyFontFamily, bodyFontWeight, bodyFontSize, bodyFontLineHeight] = createFontTokens(tokenNames.bodyFont, tokenValues.bodyFont, tokenValues.bodyFontColor, tokenValues.bodyDisabledFontColor, tokenValues.bodyFontFamily, tokenValues.bodyFontWeight, tokenValues.bodyFontSize, tokenValues.bodyFontLineHeight);
|
|
113
|
+
export const [bodyEmphasizedFont, bodyEmphasizedFontColor, bodyEmphasizedDisabledFontColor, bodyEmphasizedFontFamily, bodyEmphasizedFontWeight, bodyEmphasizedFontSize, bodyEmphasizedFontLineHeight] = createFontTokens(tokenNames.bodyEmphasizedFont, tokenValues.bodyEmphasizedFont, tokenValues.bodyEmphasizedFontColor, tokenValues.bodyEmphasizedDisabledFontColor, tokenValues.bodyEmphasizedFontFamily, tokenValues.bodyEmphasizedFontWeight, tokenValues.bodyEmphasizedFontSize, tokenValues.bodyEmphasizedFontLineHeight);
|
|
114
|
+
export const [bodyPlus1Font, bodyPlus1FontColor, bodyPlus1DisabledFontColor, bodyPlus1FontFamily, bodyPlus1FontWeight, bodyPlus1FontSize, bodyPlus1FontLineHeight] = createFontTokens(tokenNames.bodyPlus1Font, tokenValues.bodyPlus1Font, tokenValues.bodyPlus1FontColor, tokenValues.bodyPlus1DisabledFontColor, tokenValues.bodyPlus1FontFamily, tokenValues.bodyPlus1FontWeight, tokenValues.bodyPlus1FontSize, tokenValues.bodyPlus1FontLineHeight);
|
|
115
|
+
export const [bodyPlus1EmphasizedFont, bodyPlus1EmphasizedFontColor, bodyPlus1EmphasizedDisabledFontColor, bodyPlus1EmphasizedFontFamily, bodyPlus1EmphasizedFontWeight, bodyPlus1EmphasizedFontSize, bodyPlus1EmphasizedFontLineHeight] = createFontTokens(tokenNames.bodyPlus1EmphasizedFont, tokenValues.bodyPlus1EmphasizedFont, tokenValues.bodyPlus1EmphasizedFontColor, tokenValues.bodyPlus1EmphasizedDisabledFontColor, tokenValues.bodyPlus1EmphasizedFontFamily, tokenValues.bodyPlus1EmphasizedFontWeight, tokenValues.bodyPlus1EmphasizedFontSize, tokenValues.bodyPlus1EmphasizedFontLineHeight);
|
|
116
|
+
export const [groupHeaderFont, groupHeaderFontColor, groupHeaderDisabledFontColor, groupHeaderFontFamily, groupHeaderFontWeight, groupHeaderFontSize, groupHeaderFontLineHeight] = createFontTokens(tokenNames.groupHeaderFont, tokenValues.groupHeaderFont, tokenValues.groupHeaderFontColor, tokenValues.groupHeaderDisabledFontColor, tokenValues.groupHeaderFontFamily, tokenValues.groupHeaderFontWeight, tokenValues.groupHeaderFontSize, tokenValues.groupHeaderFontLineHeight);
|
|
117
|
+
export const [controlLabelFont, controlLabelFontColor, controlLabelDisabledFontColor, controlLabelFontFamily, controlLabelFontWeight, controlLabelFontSize, controlLabelFontLineHeight] = createFontTokens(tokenNames.controlLabelFont, tokenValues.controlLabelFont, tokenValues.controlLabelFontColor, tokenValues.controlLabelDisabledFontColor, tokenValues.controlLabelFontFamily, tokenValues.controlLabelFontWeight, tokenValues.controlLabelFontSize, tokenValues.controlLabelFontLineHeight);
|
|
118
|
+
export const [buttonLabelFont, buttonLabelFontColor, buttonLabelDisabledFontColor, buttonLabelFontFamily, buttonLabelFontWeight, buttonLabelFontSize, buttonLabelFontLineHeight] = createFontTokens(tokenNames.buttonLabelFont, tokenValues.buttonLabelFont, tokenValues.buttonLabelFontColor, tokenValues.buttonLabelDisabledFontColor, tokenValues.buttonLabelFontFamily, tokenValues.buttonLabelFontWeight, tokenValues.buttonLabelFontSize, tokenValues.buttonLabelFontLineHeight);
|
|
119
|
+
export const [tooltipCaptionFont, tooltipCaptionFontColor, tooltipCaptionDisabledFontColor, tooltipCaptionFontFamily, tooltipCaptionFontWeight, tooltipCaptionFontSize, tooltipCaptionFontLineHeight] = createFontTokens(tokenNames.tooltipCaptionFont, tokenValues.tooltipCaptionFont, tokenValues.tooltipCaptionFontColor, tokenValues.tooltipCaptionDisabledFontColor, tokenValues.tooltipCaptionFontFamily, tokenValues.tooltipCaptionFontWeight, tokenValues.tooltipCaptionFontSize, tokenValues.tooltipCaptionFontLineHeight);
|
|
120
|
+
export const [errorTextFont, errorTextFontColor, errorTextDisabledFontColor, errorTextFontFamily, errorTextFontWeight, errorTextFontSize, errorTextFontLineHeight] = createFontTokens(tokenNames.errorTextFont, tokenValues.errorTextFont, tokenValues.errorTextFontColor, tokenValues.errorTextDisabledFontColor, tokenValues.errorTextFontFamily, tokenValues.errorTextFontWeight, tokenValues.errorTextFontSize, tokenValues.errorTextFontLineHeight);
|
|
121
|
+
export const [tableHeaderFont, tableHeaderFontColor, tableHeaderDisabledFontColor, tableHeaderFontFamily, tableHeaderFontWeight, tableHeaderFontSize, tableHeaderFontLineHeight] = createFontTokens(tokenNames.tableHeaderFont, tokenValues.tableHeaderFont, tokenValues.tableHeaderFontColor, tokenValues.tableHeaderDisabledFontColor, tokenValues.tableHeaderFontFamily, tokenValues.tableHeaderFontWeight, tokenValues.tableHeaderFontSize, tokenValues.tableHeaderFontLineHeight);
|
|
122
|
+
export const [mentionFont, mentionFontColor, mentionDisabledFontColor, mentionFontFamily, mentionFontWeight, mentionFontSize, mentionFontLineHeight] = createFontTokens(tokenNames.mentionFont, tokenValues.mentionFont, tokenValues.mentionFontColor, tokenValues.mentionDisabledFontColor, tokenValues.mentionFontFamily, tokenValues.mentionFontWeight, tokenValues.mentionFontSize, tokenValues.mentionFontLineHeight);
|
|
123
|
+
// #endregion
|
|
124
|
+
// #region text transform tokens
|
|
125
|
+
export const groupHeaderTextTransform = createStringToken(tokenNames.groupHeaderTextTransform, tokenValues.groupHeaderTextTransform);
|
|
126
|
+
// #endregion
|
|
127
|
+
// #region animation tokens
|
|
128
|
+
export const smallDelay = createStringToken(tokenNames.smallDelay, tokenValues.smallDelay);
|
|
129
|
+
export const mediumDelay = createStringToken(tokenNames.mediumDelay, tokenValues.mediumDelay);
|
|
130
|
+
export const largeDelay = createStringToken(tokenNames.largeDelay, tokenValues.largeDelay);
|
|
131
|
+
// #endregion
|
|
132
|
+
// #region helpers
|
|
133
|
+
function createFontTokens(fontTokenName, font, fontColor, disabledFontColor, fontFamily, fontWeight, fontSize, fontLineHeight) {
|
|
148
134
|
const fontNameParts = fontTokenName.split('-font');
|
|
149
135
|
const tokenPrefixWithoutFont = fontNameParts[0];
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
const
|
|
154
|
-
const
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
const fontLineHeightToken = DesignToken.create(styleNameFromTokenName(`${tokenPrefixWithoutFont}-font-line-height`)).withDefault(lineHeight);
|
|
136
|
+
const fontFamilyWithFallback = `${fontFamily}, ${fontFamily} Fallback`;
|
|
137
|
+
const fontToken = createStringToken(fontTokenName, font);
|
|
138
|
+
const fontColorToken = createThemeColorToken(`${tokenPrefixWithoutFont}-font-color`, fontColor);
|
|
139
|
+
const fontDisabledColorToken = createThemeColorToken(`${tokenPrefixWithoutFont}-disabled-font-color`, disabledFontColor);
|
|
140
|
+
const fontFamilyToken = createStringToken(`${tokenPrefixWithoutFont}-font-family`, fontFamilyWithFallback);
|
|
141
|
+
const fontWeightToken = createStringToken(`${tokenPrefixWithoutFont}-font-weight`, fontWeight);
|
|
142
|
+
const fontSizeToken = createStringToken(`${tokenPrefixWithoutFont}-font-size`, fontSize);
|
|
143
|
+
const fontLineHeightToken = createStringToken(`${tokenPrefixWithoutFont}-font-line-height`, fontLineHeight);
|
|
159
144
|
return [
|
|
160
145
|
fontToken,
|
|
161
146
|
fontColorToken,
|
|
@@ -166,55 +151,22 @@ function createFontTokens(fontTokenName, colorFunction, disabledColorFunction, f
|
|
|
166
151
|
fontLineHeightToken
|
|
167
152
|
];
|
|
168
153
|
}
|
|
169
|
-
function
|
|
170
|
-
|
|
171
|
-
case Theme.light:
|
|
172
|
-
return lightThemeColor;
|
|
173
|
-
case Theme.dark:
|
|
174
|
-
return darkThemeColor;
|
|
175
|
-
case Theme.color:
|
|
176
|
-
return colorThemeColor;
|
|
177
|
-
default:
|
|
178
|
-
return lightThemeColor;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
function getWarningColorForTheme(element) {
|
|
182
|
-
return getColorForTheme(element, Warning100LightUi, Warning100DarkUi, White);
|
|
183
|
-
}
|
|
184
|
-
function getFailColorForTheme(element) {
|
|
185
|
-
return getColorForTheme(element, Fail100LightUi, Fail100DarkUi, White);
|
|
186
|
-
}
|
|
187
|
-
function getPassColorForTheme(element) {
|
|
188
|
-
return getColorForTheme(element, Pass100LightUi, Pass100DarkUi, White);
|
|
189
|
-
}
|
|
190
|
-
function getInformationColorForTheme(element) {
|
|
191
|
-
return getColorForTheme(element, Information100LightUi, Information100DarkUi, White);
|
|
192
|
-
}
|
|
193
|
-
function getDefaultLineColorForTheme(element) {
|
|
194
|
-
return getColorForTheme(element, Black91, Black15, White);
|
|
195
|
-
}
|
|
196
|
-
function getDefaultFontColorForTheme(element) {
|
|
197
|
-
return getColorForTheme(element, Black91, Black15, White);
|
|
198
|
-
}
|
|
199
|
-
function getFillSelectedColorForTheme(element) {
|
|
200
|
-
return getColorForTheme(element, DigitalGreenLight, PowerGreen, White);
|
|
201
|
-
}
|
|
202
|
-
function getFillHoverColorForTheme(element) {
|
|
203
|
-
return getColorForTheme(element, Black91, Black15, White);
|
|
204
|
-
}
|
|
205
|
-
function getFillDownColorForTheme(element) {
|
|
206
|
-
return getColorForTheme(element, Black91, Black15, White);
|
|
154
|
+
function createStringToken(tokenName, tokenValue) {
|
|
155
|
+
return DesignToken.create(styleNameFromTokenName(tokenName)).withDefault(tokenValue);
|
|
207
156
|
}
|
|
208
|
-
function
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
157
|
+
function createThemeColorToken(tokenName, themeColor) {
|
|
158
|
+
return DesignToken.create(styleNameFromTokenName(tokenName)).withDefault((element) => {
|
|
159
|
+
switch (theme.getValueFor(element)) {
|
|
160
|
+
case Theme.light:
|
|
161
|
+
return themeColor.light;
|
|
162
|
+
case Theme.dark:
|
|
163
|
+
return themeColor.dark;
|
|
164
|
+
case Theme.color:
|
|
165
|
+
return themeColor.color;
|
|
166
|
+
default:
|
|
167
|
+
return themeColor.light;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
219
170
|
}
|
|
171
|
+
// #endregion
|
|
220
172
|
//# sourceMappingURL=design-tokens.js.map
|