@ni/spright-components 6.3.2 → 6.3.3

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.
@@ -14803,6 +14803,258 @@
14803
14803
  */
14804
14804
  const focusVisible = `:${focusVisible$1}`;
14805
14805
 
14806
+ const Theme = {
14807
+ light: 'light',
14808
+ dark: 'dark',
14809
+ color: 'color'
14810
+ };
14811
+
14812
+ /**
14813
+ * Design token names should follow the token naming convention:
14814
+ * See: https://github.com/ni/nimble/blob/main/packages/nimble-components/CONTRIBUTING.md#token-naming
14815
+ */
14816
+ const tokenNames = {
14817
+ actionRgbPartialColor: 'action-rgb-partial-color',
14818
+ applicationBackgroundColor: 'application-background-color',
14819
+ dividerBackgroundColor: 'divider-background-color',
14820
+ headerBackgroundColor: 'header-background-color',
14821
+ sectionBackgroundColor: 'section-background-color',
14822
+ sectionBackgroundImage: 'section-background-image',
14823
+ buttonFillPrimaryColor: 'button-fill-primary-color',
14824
+ buttonPrimaryFontColor: 'button-primary-font-color',
14825
+ buttonFillAccentColor: 'button-fill-accent-color',
14826
+ buttonAccentBlockFontColor: 'button-accent-block-font-color',
14827
+ buttonAccentOutlineFontColor: 'button-accent-outline-font-color',
14828
+ buttonBorderAccentOutlineColor: 'button-border-accent-outline-color',
14829
+ fillSelectedColor: 'fill-selected-color',
14830
+ fillSelectedRgbPartialColor: 'fill-selected-rgb-partial-color',
14831
+ fillHoverSelectedColor: 'fill-hover-selected-color',
14832
+ fillHoverColor: 'fill-hover-color',
14833
+ fillHoverRgbPartialColor: 'fill-hover-rgb-partial-color',
14834
+ fillDownColor: 'fill-down-color',
14835
+ borderColor: 'border-color',
14836
+ borderRgbPartialColor: 'border-rgb-partial-color',
14837
+ failColor: 'fail-color',
14838
+ warningColor: 'warning-color',
14839
+ passColor: 'pass-color',
14840
+ informationColor: 'information-color',
14841
+ borderHoverColor: 'border-hover-color',
14842
+ iconColor: 'icon-color',
14843
+ modalBackdropColor: 'modal-backdrop-color',
14844
+ popupBorderColor: 'popup-border-color',
14845
+ cardBorderColor: 'card-border-color',
14846
+ tagFillColor: 'tag-fill-color',
14847
+ controlHeight: 'control-height',
14848
+ controlSlimHeight: 'control-slim-height',
14849
+ smallPadding: 'small-padding',
14850
+ mediumPadding: 'medium-padding',
14851
+ standardPadding: 'standard-padding',
14852
+ largePadding: 'large-padding',
14853
+ labelHeight: 'label-height',
14854
+ borderWidth: 'border-width',
14855
+ dividerWidth: 'divider-width',
14856
+ iconSize: 'icon-size',
14857
+ groupHeaderTextTransform: 'group-header-text-transform',
14858
+ drawerWidth: 'drawer-width',
14859
+ dialogSmallWidth: 'dialog-small-width',
14860
+ dialogSmallHeight: 'dialog-small-height',
14861
+ dialogSmallMaxHeight: 'dialog-small-max-height',
14862
+ dialogLargeWidth: 'dialog-large-width',
14863
+ dialogLargeHeight: 'dialog-large-height',
14864
+ dialogLargeMaxHeight: 'dialog-large-max-height',
14865
+ menuMinWidth: 'menu-min-width',
14866
+ bannerGapSize: 'banner-gap-size',
14867
+ spinnerSmallHeight: 'spinner-small-height',
14868
+ spinnerMediumHeight: 'spinner-medium-height',
14869
+ spinnerLargeHeight: 'spinner-large-height',
14870
+ tableFitRowsHeight: 'table-fit-rows-height',
14871
+ smallDelay: 'small-delay',
14872
+ mediumDelay: 'medium-delay',
14873
+ largeDelay: 'large-delay',
14874
+ headlinePlus1Font: 'headline-plus-1-font',
14875
+ headlineFont: 'headline-font',
14876
+ tableHeaderFont: 'table-header-font',
14877
+ titlePlus2Font: 'title-plus-2-font',
14878
+ titlePlus1Font: 'title-plus-1-font',
14879
+ titleFont: 'title-font',
14880
+ subtitlePlus1Font: 'subtitle-plus-1-font',
14881
+ subtitleFont: 'subtitle-font',
14882
+ linkFont: 'link-font',
14883
+ linkActiveFont: 'link-active-font',
14884
+ linkProminentFont: 'link-prominent-font',
14885
+ linkActiveProminentFont: 'link-active-prominent-font',
14886
+ placeholderFont: 'placeholder-font',
14887
+ bodyFont: 'body-font',
14888
+ bodyEmphasizedFont: 'body-emphasized-font',
14889
+ bodyPlus1Font: 'body-plus-1-font',
14890
+ bodyPlus1EmphasizedFont: 'body-plus-1-emphasized-font',
14891
+ groupHeaderFont: 'group-header-font',
14892
+ controlLabelFont: 'control-label-font',
14893
+ buttonLabelFont: 'button-label-font',
14894
+ tooltipCaptionFont: 'tooltip-caption-font',
14895
+ tooltipBackgroundColor: 'tooltip-background-color',
14896
+ errorTextFont: 'error-text-font',
14897
+ tableRowBorderColor: 'table-row-border-color',
14898
+ elevation1BoxShadow: 'elevation-1-box-shadow',
14899
+ elevation2BoxShadow: 'elevation-2-box-shadow',
14900
+ elevation3BoxShadow: 'elevation-3-box-shadow',
14901
+ graphGridlineColor: 'graph-gridline-color',
14902
+ graphTrace1Color: 'graph-trace-1-color',
14903
+ graphTrace2Color: 'graph-trace-2-color',
14904
+ graphTrace3Color: 'graph-trace-3-color',
14905
+ graphTrace4Color: 'graph-trace-4-color',
14906
+ graphTrace5Color: 'graph-trace-5-color',
14907
+ graphTrace6Color: 'graph-trace-6-color',
14908
+ graphTrace7Color: 'graph-trace-7-color',
14909
+ graphTrace8Color: 'graph-trace-8-color',
14910
+ mentionFont: 'mention-font',
14911
+ calendarEventBackgroundStaticColor: 'calendar-event-background-static-color',
14912
+ calendarEventBackgroundDynamicColor: 'calendar-event-background-dynamic-color',
14913
+ calendarEventBackgroundTransientColor: 'calendar-event-background-transient-color',
14914
+ calendarEventBorderStaticColor: 'calendar-event-border-static-color',
14915
+ calendarEventBorderTransientColor: 'calendar-event-border-transient-color',
14916
+ calendarEventStaticFontColor: 'calendar-event-static-font-color',
14917
+ calendarEventDynamicFontColor: 'calendar-event-dynamic-font-color',
14918
+ calendarEventTransientFontColor: 'calendar-event-transient-font-color',
14919
+ calendarEventBackgroundHoverStaticColor: 'calendar-event-background-hover-static-color',
14920
+ calendarEventBackgroundHoverDynamicColor: 'calendar-event-background-hover-dynamic-color',
14921
+ calendarEventBackgroundHoverTransientColor: 'calendar-event-background-hover-transient-color',
14922
+ calendarEventOuterBorderHighlightedColor: 'calendar-event-outer-border-highlighted-color',
14923
+ calendarRowBackgroundSelectedColor: 'calendar-row-background-selected-color',
14924
+ calendarRowBackgroundConflictColor: 'calendar-row-background-conflict-color',
14925
+ calendarEventFillBlockedColor: 'calendar-event-fill-blocked-color',
14926
+ calendarGrabHandleBackgroundColor: 'calendar-grab-handle-background-color',
14927
+ calendarGridBorderColor: 'calendar-grid-border-color',
14928
+ calendarGroupHeaderBackgroundColor: 'calendar-group-header-background-color'
14929
+ };
14930
+ const prefix = 'ni-nimble';
14931
+ const styleNameFromTokenName = (tokenName) => `${prefix}-${tokenName}`;
14932
+
14933
+ const template$S = html `<slot></slot>`;
14934
+
14935
+ const styles$15 = css `
14936
+ ${display$1('contents')}
14937
+ `;
14938
+
14939
+ /**
14940
+ * Observable class to subscribe to changes in the page's lang attribute
14941
+ */
14942
+ class DocumentElementLang {
14943
+ constructor() {
14944
+ this.lang = document.documentElement.lang;
14945
+ const observer = new MutationObserver(mutations => {
14946
+ for (const mutation of mutations) {
14947
+ if (mutation.type === 'attributes'
14948
+ && mutation.attributeName === 'lang') {
14949
+ this.lang = mutation.target.lang;
14950
+ }
14951
+ }
14952
+ });
14953
+ observer.observe(document.documentElement, {
14954
+ attributeFilter: ['lang']
14955
+ });
14956
+ }
14957
+ }
14958
+ __decorate([
14959
+ observable
14960
+ ], DocumentElementLang.prototype, "lang", void 0);
14961
+ const documentElementLang = new DocumentElementLang();
14962
+
14963
+ function isValidLang(value) {
14964
+ try {
14965
+ // We are relying on the Locale constructor to validate the value
14966
+ // eslint-disable-next-line no-new
14967
+ new Intl.Locale(value);
14968
+ return true;
14969
+ }
14970
+ catch (e) {
14971
+ return false;
14972
+ }
14973
+ }
14974
+ const lang = DesignToken.create({
14975
+ name: 'lang',
14976
+ cssCustomPropertyName: null
14977
+ }).withDefault(() => (isValidLang(documentElementLang.lang) ? documentElementLang.lang : 'en-US'));
14978
+ // Not represented as a CSS Custom Property, instead available
14979
+ // as an attribute of theme provider.
14980
+ const direction = DesignToken.create({
14981
+ name: 'direction',
14982
+ cssCustomPropertyName: null
14983
+ }).withDefault(Direction.ltr);
14984
+ const theme = DesignToken.create({
14985
+ name: 'theme',
14986
+ cssCustomPropertyName: null
14987
+ }).withDefault(Theme.light);
14988
+ /**
14989
+ * The ThemeProvider implementation. Add this component to the page and set its `theme` attribute to control
14990
+ * the values of design tokens that provide colors and fonts as CSS custom properties to any descendant components.
14991
+ * @internal
14992
+ */
14993
+ class ThemeProvider extends FoundationElement {
14994
+ constructor() {
14995
+ super(...arguments);
14996
+ this.theme = Theme.light;
14997
+ this.langIsInvalid = false;
14998
+ }
14999
+ get validity() {
15000
+ return {
15001
+ invalidLang: this.langIsInvalid
15002
+ };
15003
+ }
15004
+ checkValidity() {
15005
+ return !this.langIsInvalid;
15006
+ }
15007
+ langChanged(_prev, next) {
15008
+ if (next === null || next === undefined) {
15009
+ lang.deleteValueFor(this);
15010
+ this.langIsInvalid = false;
15011
+ return;
15012
+ }
15013
+ if (isValidLang(next)) {
15014
+ lang.setValueFor(this, next);
15015
+ this.langIsInvalid = false;
15016
+ }
15017
+ else {
15018
+ lang.deleteValueFor(this);
15019
+ this.langIsInvalid = true;
15020
+ }
15021
+ }
15022
+ directionChanged(_prev, next) {
15023
+ if (next !== undefined && next !== null) {
15024
+ direction.setValueFor(this, next);
15025
+ }
15026
+ else {
15027
+ direction.deleteValueFor(this);
15028
+ }
15029
+ }
15030
+ themeChanged(_prev, next) {
15031
+ if (next !== undefined && next !== null) {
15032
+ theme.setValueFor(this, next);
15033
+ }
15034
+ else {
15035
+ theme.deleteValueFor(this);
15036
+ }
15037
+ }
15038
+ }
15039
+ __decorate([
15040
+ attr()
15041
+ ], ThemeProvider.prototype, "lang", void 0);
15042
+ __decorate([
15043
+ attr()
15044
+ ], ThemeProvider.prototype, "direction", void 0);
15045
+ __decorate([
15046
+ attr()
15047
+ ], ThemeProvider.prototype, "theme", void 0);
15048
+ const nimbleDesignSystemProvider = ThemeProvider.compose({
15049
+ baseName: 'theme-provider',
15050
+ styles: styles$15,
15051
+ template: template$S
15052
+ });
15053
+ DesignSystem.getOrCreate()
15054
+ .withPrefix('nimble')
15055
+ .register(nimbleDesignSystemProvider());
15056
+ const themeProviderTag = 'nimble-theme-provider';
15057
+
14806
15058
  /**
14807
15059
  * Ensures that an input number does not exceed a max value and is not less than a min value.
14808
15060
  * @param i - the number to clamp
@@ -16029,258 +16281,6 @@
16029
16281
  const MediumDelay = "0.15s"; // Medium animation delay for control state change animation
16030
16282
  const LargeDelay = "0.25s"; // Long animation delay used for control state change animation
16031
16283
 
16032
- const Theme = {
16033
- light: 'light',
16034
- dark: 'dark',
16035
- color: 'color'
16036
- };
16037
-
16038
- /**
16039
- * Design token names should follow the token naming convention:
16040
- * See: https://github.com/ni/nimble/blob/main/packages/nimble-components/CONTRIBUTING.md#token-naming
16041
- */
16042
- const tokenNames = {
16043
- actionRgbPartialColor: 'action-rgb-partial-color',
16044
- applicationBackgroundColor: 'application-background-color',
16045
- dividerBackgroundColor: 'divider-background-color',
16046
- headerBackgroundColor: 'header-background-color',
16047
- sectionBackgroundColor: 'section-background-color',
16048
- sectionBackgroundImage: 'section-background-image',
16049
- buttonFillPrimaryColor: 'button-fill-primary-color',
16050
- buttonPrimaryFontColor: 'button-primary-font-color',
16051
- buttonFillAccentColor: 'button-fill-accent-color',
16052
- buttonAccentBlockFontColor: 'button-accent-block-font-color',
16053
- buttonAccentOutlineFontColor: 'button-accent-outline-font-color',
16054
- buttonBorderAccentOutlineColor: 'button-border-accent-outline-color',
16055
- fillSelectedColor: 'fill-selected-color',
16056
- fillSelectedRgbPartialColor: 'fill-selected-rgb-partial-color',
16057
- fillHoverSelectedColor: 'fill-hover-selected-color',
16058
- fillHoverColor: 'fill-hover-color',
16059
- fillHoverRgbPartialColor: 'fill-hover-rgb-partial-color',
16060
- fillDownColor: 'fill-down-color',
16061
- borderColor: 'border-color',
16062
- borderRgbPartialColor: 'border-rgb-partial-color',
16063
- failColor: 'fail-color',
16064
- warningColor: 'warning-color',
16065
- passColor: 'pass-color',
16066
- informationColor: 'information-color',
16067
- borderHoverColor: 'border-hover-color',
16068
- iconColor: 'icon-color',
16069
- modalBackdropColor: 'modal-backdrop-color',
16070
- popupBorderColor: 'popup-border-color',
16071
- cardBorderColor: 'card-border-color',
16072
- tagFillColor: 'tag-fill-color',
16073
- controlHeight: 'control-height',
16074
- controlSlimHeight: 'control-slim-height',
16075
- smallPadding: 'small-padding',
16076
- mediumPadding: 'medium-padding',
16077
- standardPadding: 'standard-padding',
16078
- largePadding: 'large-padding',
16079
- labelHeight: 'label-height',
16080
- borderWidth: 'border-width',
16081
- dividerWidth: 'divider-width',
16082
- iconSize: 'icon-size',
16083
- groupHeaderTextTransform: 'group-header-text-transform',
16084
- drawerWidth: 'drawer-width',
16085
- dialogSmallWidth: 'dialog-small-width',
16086
- dialogSmallHeight: 'dialog-small-height',
16087
- dialogSmallMaxHeight: 'dialog-small-max-height',
16088
- dialogLargeWidth: 'dialog-large-width',
16089
- dialogLargeHeight: 'dialog-large-height',
16090
- dialogLargeMaxHeight: 'dialog-large-max-height',
16091
- menuMinWidth: 'menu-min-width',
16092
- bannerGapSize: 'banner-gap-size',
16093
- spinnerSmallHeight: 'spinner-small-height',
16094
- spinnerMediumHeight: 'spinner-medium-height',
16095
- spinnerLargeHeight: 'spinner-large-height',
16096
- tableFitRowsHeight: 'table-fit-rows-height',
16097
- smallDelay: 'small-delay',
16098
- mediumDelay: 'medium-delay',
16099
- largeDelay: 'large-delay',
16100
- headlinePlus1Font: 'headline-plus-1-font',
16101
- headlineFont: 'headline-font',
16102
- tableHeaderFont: 'table-header-font',
16103
- titlePlus2Font: 'title-plus-2-font',
16104
- titlePlus1Font: 'title-plus-1-font',
16105
- titleFont: 'title-font',
16106
- subtitlePlus1Font: 'subtitle-plus-1-font',
16107
- subtitleFont: 'subtitle-font',
16108
- linkFont: 'link-font',
16109
- linkActiveFont: 'link-active-font',
16110
- linkProminentFont: 'link-prominent-font',
16111
- linkActiveProminentFont: 'link-active-prominent-font',
16112
- placeholderFont: 'placeholder-font',
16113
- bodyFont: 'body-font',
16114
- bodyEmphasizedFont: 'body-emphasized-font',
16115
- bodyPlus1Font: 'body-plus-1-font',
16116
- bodyPlus1EmphasizedFont: 'body-plus-1-emphasized-font',
16117
- groupHeaderFont: 'group-header-font',
16118
- controlLabelFont: 'control-label-font',
16119
- buttonLabelFont: 'button-label-font',
16120
- tooltipCaptionFont: 'tooltip-caption-font',
16121
- tooltipBackgroundColor: 'tooltip-background-color',
16122
- errorTextFont: 'error-text-font',
16123
- tableRowBorderColor: 'table-row-border-color',
16124
- elevation1BoxShadow: 'elevation-1-box-shadow',
16125
- elevation2BoxShadow: 'elevation-2-box-shadow',
16126
- elevation3BoxShadow: 'elevation-3-box-shadow',
16127
- graphGridlineColor: 'graph-gridline-color',
16128
- graphTrace1Color: 'graph-trace-1-color',
16129
- graphTrace2Color: 'graph-trace-2-color',
16130
- graphTrace3Color: 'graph-trace-3-color',
16131
- graphTrace4Color: 'graph-trace-4-color',
16132
- graphTrace5Color: 'graph-trace-5-color',
16133
- graphTrace6Color: 'graph-trace-6-color',
16134
- graphTrace7Color: 'graph-trace-7-color',
16135
- graphTrace8Color: 'graph-trace-8-color',
16136
- mentionFont: 'mention-font',
16137
- calendarEventBackgroundStaticColor: 'calendar-event-background-static-color',
16138
- calendarEventBackgroundDynamicColor: 'calendar-event-background-dynamic-color',
16139
- calendarEventBackgroundTransientColor: 'calendar-event-background-transient-color',
16140
- calendarEventBorderStaticColor: 'calendar-event-border-static-color',
16141
- calendarEventBorderTransientColor: 'calendar-event-border-transient-color',
16142
- calendarEventStaticFontColor: 'calendar-event-static-font-color',
16143
- calendarEventDynamicFontColor: 'calendar-event-dynamic-font-color',
16144
- calendarEventTransientFontColor: 'calendar-event-transient-font-color',
16145
- calendarEventBackgroundHoverStaticColor: 'calendar-event-background-hover-static-color',
16146
- calendarEventBackgroundHoverDynamicColor: 'calendar-event-background-hover-dynamic-color',
16147
- calendarEventBackgroundHoverTransientColor: 'calendar-event-background-hover-transient-color',
16148
- calendarEventOuterBorderHighlightedColor: 'calendar-event-outer-border-highlighted-color',
16149
- calendarRowBackgroundSelectedColor: 'calendar-row-background-selected-color',
16150
- calendarRowBackgroundConflictColor: 'calendar-row-background-conflict-color',
16151
- calendarEventFillBlockedColor: 'calendar-event-fill-blocked-color',
16152
- calendarGrabHandleBackgroundColor: 'calendar-grab-handle-background-color',
16153
- calendarGridBorderColor: 'calendar-grid-border-color',
16154
- calendarGroupHeaderBackgroundColor: 'calendar-group-header-background-color'
16155
- };
16156
- const prefix = 'ni-nimble';
16157
- const styleNameFromTokenName = (tokenName) => `${prefix}-${tokenName}`;
16158
-
16159
- const template$S = html `<slot></slot>`;
16160
-
16161
- const styles$15 = css `
16162
- ${display$1('contents')}
16163
- `;
16164
-
16165
- /**
16166
- * Observable class to subscribe to changes in the page's lang attribute
16167
- */
16168
- class DocumentElementLang {
16169
- constructor() {
16170
- this.lang = document.documentElement.lang;
16171
- const observer = new MutationObserver(mutations => {
16172
- for (const mutation of mutations) {
16173
- if (mutation.type === 'attributes'
16174
- && mutation.attributeName === 'lang') {
16175
- this.lang = mutation.target.lang;
16176
- }
16177
- }
16178
- });
16179
- observer.observe(document.documentElement, {
16180
- attributeFilter: ['lang']
16181
- });
16182
- }
16183
- }
16184
- __decorate([
16185
- observable
16186
- ], DocumentElementLang.prototype, "lang", void 0);
16187
- const documentElementLang = new DocumentElementLang();
16188
-
16189
- function isValidLang(value) {
16190
- try {
16191
- // We are relying on the Locale constructor to validate the value
16192
- // eslint-disable-next-line no-new
16193
- new Intl.Locale(value);
16194
- return true;
16195
- }
16196
- catch (e) {
16197
- return false;
16198
- }
16199
- }
16200
- const lang = DesignToken.create({
16201
- name: 'lang',
16202
- cssCustomPropertyName: null
16203
- }).withDefault(() => (isValidLang(documentElementLang.lang) ? documentElementLang.lang : 'en-US'));
16204
- // Not represented as a CSS Custom Property, instead available
16205
- // as an attribute of theme provider.
16206
- const direction = DesignToken.create({
16207
- name: 'direction',
16208
- cssCustomPropertyName: null
16209
- }).withDefault(Direction.ltr);
16210
- const theme = DesignToken.create({
16211
- name: 'theme',
16212
- cssCustomPropertyName: null
16213
- }).withDefault(Theme.light);
16214
- /**
16215
- * The ThemeProvider implementation. Add this component to the page and set its `theme` attribute to control
16216
- * the values of design tokens that provide colors and fonts as CSS custom properties to any descendant components.
16217
- * @internal
16218
- */
16219
- class ThemeProvider extends FoundationElement {
16220
- constructor() {
16221
- super(...arguments);
16222
- this.theme = Theme.light;
16223
- this.langIsInvalid = false;
16224
- }
16225
- get validity() {
16226
- return {
16227
- invalidLang: this.langIsInvalid
16228
- };
16229
- }
16230
- checkValidity() {
16231
- return !this.langIsInvalid;
16232
- }
16233
- langChanged(_prev, next) {
16234
- if (next === null || next === undefined) {
16235
- lang.deleteValueFor(this);
16236
- this.langIsInvalid = false;
16237
- return;
16238
- }
16239
- if (isValidLang(next)) {
16240
- lang.setValueFor(this, next);
16241
- this.langIsInvalid = false;
16242
- }
16243
- else {
16244
- lang.deleteValueFor(this);
16245
- this.langIsInvalid = true;
16246
- }
16247
- }
16248
- directionChanged(_prev, next) {
16249
- if (next !== undefined && next !== null) {
16250
- direction.setValueFor(this, next);
16251
- }
16252
- else {
16253
- direction.deleteValueFor(this);
16254
- }
16255
- }
16256
- themeChanged(_prev, next) {
16257
- if (next !== undefined && next !== null) {
16258
- theme.setValueFor(this, next);
16259
- }
16260
- else {
16261
- theme.deleteValueFor(this);
16262
- }
16263
- }
16264
- }
16265
- __decorate([
16266
- attr()
16267
- ], ThemeProvider.prototype, "lang", void 0);
16268
- __decorate([
16269
- attr()
16270
- ], ThemeProvider.prototype, "direction", void 0);
16271
- __decorate([
16272
- attr()
16273
- ], ThemeProvider.prototype, "theme", void 0);
16274
- const nimbleDesignSystemProvider = ThemeProvider.compose({
16275
- baseName: 'theme-provider',
16276
- styles: styles$15,
16277
- template: template$S
16278
- });
16279
- DesignSystem.getOrCreate()
16280
- .withPrefix('nimble')
16281
- .register(nimbleDesignSystemProvider());
16282
- const themeProviderTag = 'nimble-theme-provider';
16283
-
16284
16284
  /**
16285
16285
  * Convert a hexadecimal color string to an RGBA CSS color string
16286
16286
  * Example: '#ff0102' to 'rgba(255, 1, 2, 1)'
@@ -16293,157 +16293,305 @@
16293
16293
  return `rgba(${r * 255}, ${g * 255}, ${b * 255}, ${alpha})`;
16294
16294
  }
16295
16295
 
16296
- // Color Tokens
16297
- const actionRgbPartialColor = DesignToken.create(styleNameFromTokenName(tokenNames.actionRgbPartialColor)).withDefault((element) => hexToRgbPartial(getColorForTheme(element, Black91, Black15, White)));
16298
- const applicationBackgroundColor = DesignToken.create(styleNameFromTokenName(tokenNames.applicationBackgroundColor)).withDefault((element) => getColorForTheme(element, White, Black85, ForestGreen));
16299
- DesignToken.create(styleNameFromTokenName(tokenNames.headerBackgroundColor)).withDefault((element) => getColorForTheme(element, Black7, Black88, ForestGreen));
16300
- DesignToken.create(styleNameFromTokenName(tokenNames.sectionBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black80, ForestGreen));
16301
- const sectionBackgroundImage = DesignToken.create(styleNameFromTokenName(tokenNames.sectionBackgroundImage)).withDefault((element) => {
16302
- const start = getColorForTheme(element, Black15, Black82, ForestGreen);
16303
- const end = getColorForTheme(element, hexToRgbaCssColor(Black15, 0), hexToRgbaCssColor(Black82, 0), hexToRgbaCssColor(ForestGreen, 0));
16304
- return `linear-gradient(${start}, ${end})`;
16305
- });
16306
- DesignToken.create(styleNameFromTokenName(tokenNames.dividerBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black80, ForestGreen));
16307
- const fillSelectedColor = DesignToken.create(styleNameFromTokenName(tokenNames.fillSelectedColor)).withDefault((element) => hexToRgbaCssColor(getFillSelectedColorForTheme(element), 0.2));
16308
- const fillSelectedRgbPartialColor = DesignToken.create(styleNameFromTokenName(tokenNames.fillSelectedRgbPartialColor)).withDefault((element) => hexToRgbPartial(getFillSelectedColorForTheme(element)));
16309
- const fillHoverSelectedColor = DesignToken.create(styleNameFromTokenName(tokenNames.fillHoverSelectedColor)).withDefault((element) => hexToRgbaCssColor(getFillSelectedColorForTheme(element), 0.15));
16310
- const fillHoverColor = DesignToken.create(styleNameFromTokenName(tokenNames.fillHoverColor)).withDefault((element) => hexToRgbaCssColor(getFillHoverColorForTheme(element), 0.1));
16311
- DesignToken.create(styleNameFromTokenName(tokenNames.fillHoverRgbPartialColor)).withDefault((element) => hexToRgbPartial(getFillHoverColorForTheme(element)));
16312
- DesignToken.create(styleNameFromTokenName(tokenNames.fillDownColor)).withDefault((element) => hexToRgbaCssColor(getFillDownColorForTheme(element), 0.15));
16313
- const borderColor = DesignToken.create(styleNameFromTokenName(tokenNames.borderColor)).withDefault((element) => getDefaultLineColorForTheme(element));
16314
- const borderRgbPartialColor = DesignToken.create(styleNameFromTokenName(tokenNames.borderRgbPartialColor)).withDefault((element) => hexToRgbPartial(getDefaultLineColorForTheme(element)));
16315
- const failColor = DesignToken.create(styleNameFromTokenName(tokenNames.failColor)).withDefault((element) => getFailColorForTheme(element));
16316
- const warningColor = DesignToken.create(styleNameFromTokenName(tokenNames.warningColor)).withDefault((element) => getWarningColorForTheme(element));
16317
- const passColor = DesignToken.create(styleNameFromTokenName(tokenNames.passColor)).withDefault((element) => getPassColorForTheme(element));
16318
- const informationColor = DesignToken.create(styleNameFromTokenName(tokenNames.informationColor)).withDefault((element) => getInformationColorForTheme(element));
16319
- const borderHoverColor = DesignToken.create(styleNameFromTokenName(tokenNames.borderHoverColor)).withDefault((element) => getColorForTheme(element, DigitalGreenLight, PowerGreen, White));
16320
- // Component Color Tokens
16321
- const iconColor = DesignToken.create(styleNameFromTokenName(tokenNames.iconColor)).withDefault((element) => getColorForTheme(element, Black91, Black15, White));
16322
- const modalBackdropColor = DesignToken.create(styleNameFromTokenName(tokenNames.modalBackdropColor)).withDefault((element) => getModalBackdropForTheme(element));
16323
- const popupBorderColor = DesignToken.create(styleNameFromTokenName(tokenNames.popupBorderColor)).withDefault((element) => hexToRgbaCssColor(getColorForTheme(element, Black91, Black15, White), 0.3));
16324
- const cardBorderColor = DesignToken.create(styleNameFromTokenName(tokenNames.cardBorderColor)).withDefault((element) => hexToRgbaCssColor(getColorForTheme(element, Black91, Black15, White), 0.1));
16325
- DesignToken.create(styleNameFromTokenName(tokenNames.graphGridlineColor)).withDefault((element) => hexToRgbaCssColor(getColorForTheme(element, Black91, Black15, White), 0.2));
16326
- DesignToken.create(styleNameFromTokenName(tokenNames.graphTrace1Color)).withDefault((element) => getColorForTheme(element, NiIndigoDark2, NiSky, White));
16327
- DesignToken.create(styleNameFromTokenName(tokenNames.graphTrace2Color)).withDefault((element) => getColorForTheme(element, NiScarletDark1, NiScarlet, hexToRgbaCssColor(White, 0.7)));
16328
- DesignToken.create(styleNameFromTokenName(tokenNames.graphTrace3Color)).withDefault((element) => getColorForTheme(element, NiFernDark1, NiFern, hexToRgbaCssColor(White, 0.4)));
16329
- DesignToken.create(styleNameFromTokenName(tokenNames.graphTrace4Color)).withDefault((element) => getColorForTheme(element, NiPlumDark1, NiSeaLight, hexToRgbaCssColor(White, 0.25)));
16330
- DesignToken.create(styleNameFromTokenName(tokenNames.graphTrace5Color)).withDefault((element) => getColorForTheme(element, NiSeaDark2, NiSea, hexToRgbaCssColor(White, 0.55)));
16331
- DesignToken.create(styleNameFromTokenName(tokenNames.graphTrace6Color)).withDefault((element) => getColorForTheme(element, NiTulip, NiTulip, hexToRgbaCssColor(White, 0.85)));
16332
- DesignToken.create(styleNameFromTokenName(tokenNames.graphTrace7Color)).withDefault((element) => getColorForTheme(element, NiScarletDark3, NiHoneyLight, hexToRgbaCssColor(White, 0.325)));
16333
- DesignToken.create(styleNameFromTokenName(tokenNames.graphTrace8Color)).withDefault((element) => getColorForTheme(element, NiIndigo, NiIndigo, hexToRgbaCssColor(White, 0.625)));
16334
- DesignToken.create(styleNameFromTokenName(tokenNames.tooltipBackgroundColor)).withDefault((element) => getColorForTheme(element, Black15, Black85, ForestGreen));
16335
- const tableRowBorderColor = DesignToken.create(styleNameFromTokenName(tokenNames.tableRowBorderColor)).withDefault((element) => getColorForTheme(element, Black15, Black80, ForestGreen));
16336
- DesignToken.create(styleNameFromTokenName(tokenNames.tagFillColor)).withDefault((element) => hexToRgbaCssColor(getColorForTheme(element, Black91, Black15, White), 0.1));
16337
- const buttonFillPrimaryColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonFillPrimaryColor)).withDefault((element) => getColorForTheme(element, hexToRgbaCssColor(Black91, 0.75), hexToRgbaCssColor(Black15, 0.3), hexToRgbaCssColor(White, 0.3)));
16338
- const buttonPrimaryFontColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonPrimaryFontColor)).withDefault((element) => getColorForTheme(element, Black15, Black15, White));
16339
- const buttonFillAccentColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonFillAccentColor)).withDefault((element) => getColorForTheme(element, DigitalGreenDark, DigitalGreenLight, hexToRgbaCssColor(White, 0.1)));
16340
- const buttonAccentBlockFontColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonAccentBlockFontColor)).withDefault((element) => getColorForTheme(element, White, Black15, White));
16341
- const buttonAccentOutlineFontColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonAccentOutlineFontColor)).withDefault((element) => getColorForTheme(element, DigitalGreenDark105, PowerGreen, White));
16342
- const buttonBorderAccentOutlineColor = DesignToken.create(styleNameFromTokenName(tokenNames.buttonBorderAccentOutlineColor)).withDefault((element) => getColorForTheme(element, DigitalGreenLight, PowerGreen, hexToRgbaCssColor(White, 0.3)));
16343
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventBackgroundStaticColor)).withDefault((element) => getColorForTheme(element, DigitalGreenLight10, PowerGreen10, PowerGreen10));
16344
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventBackgroundDynamicColor)).withDefault((element) => getColorForTheme(element, DigitalGreenDark105, DigitalGreenDark, DigitalGreenDark));
16345
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventBackgroundTransientColor)).withDefault((element) => getColorForTheme(element, DigitalGreenDark105, DigitalGreenDark, DigitalGreenDark));
16346
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventBorderStaticColor)).withDefault((element) => getColorForTheme(element, DigitalGreenLight, DigitalGreenLight, DigitalGreenLight));
16347
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventBorderTransientColor)).withDefault((element) => getColorForTheme(element, DigitalGreenLight, hexToRgbaCssColor(PowerGreen, 0.85), hexToRgbaCssColor(PowerGreen, 0.85)));
16348
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventStaticFontColor)).withDefault((element) => getColorForTheme(element, DigitalGreenDark110, PowerGreenDark50, PowerGreenDark50));
16349
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventDynamicFontColor)).withDefault((element) => getColorForTheme(element, White, White, White));
16350
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventTransientFontColor)).withDefault((element) => getColorForTheme(element, White, White, White));
16351
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventBackgroundHoverStaticColor)).withDefault((element) => getColorForTheme(element, DigitalGreenLight30, PowerGreen30, PowerGreen30));
16352
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventBackgroundHoverDynamicColor)).withDefault((element) => getColorForTheme(element, DigitalGreenDark110, DigitalGreenDark105, DigitalGreenDark105));
16353
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventBackgroundHoverTransientColor)).withDefault((element) => getColorForTheme(element, DigitalGreenDark110, DigitalGreenDark105, DigitalGreenDark105));
16354
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventOuterBorderHighlightedColor)).withDefault((element) => getColorForTheme(element, Black88, hexToRgbaCssColor(White, 0.85), hexToRgbaCssColor(White, 0.85)));
16355
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarRowBackgroundSelectedColor)).withDefault((element) => getColorForTheme(element, hexToRgbaCssColor(DigitalGreenLight, 0.2), hexToRgbaCssColor(PowerGreen, 0.2), hexToRgbaCssColor(PowerGreen, 0.2)));
16356
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarRowBackgroundConflictColor)).withDefault((element) => getColorForTheme(element, hexToRgbaCssColor(Fail100LightUi, 0.2), hexToRgbaCssColor(Fail100DarkUi, 0.2), hexToRgbaCssColor(Fail100DarkUi, 0.2)));
16357
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarEventFillBlockedColor)).withDefault((element) => getColorForTheme(element, hexToRgbaCssColor(Black91, 0.07), Black82, Black82));
16358
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarGrabHandleBackgroundColor)).withDefault((element) => getColorForTheme(element, DigitalGreenLight, PowerGreen, PowerGreen));
16359
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarGridBorderColor)).withDefault((element) => getColorForTheme(element, Black22, Black80, Black80));
16360
- DesignToken.create(styleNameFromTokenName(tokenNames.calendarGroupHeaderBackgroundColor)).withDefault((element) => getColorForTheme(element, Black7, hexToRgbaCssColor(Black91, 0.1), hexToRgbaCssColor(Black91, 0.1)));
16361
- // Component Sizing Tokens
16362
- const controlHeight = DesignToken.create(styleNameFromTokenName(tokenNames.controlHeight)).withDefault('32px');
16363
- const controlSlimHeight = DesignToken.create(styleNameFromTokenName(tokenNames.controlSlimHeight)).withDefault('24px');
16364
- const smallPadding = DesignToken.create(styleNameFromTokenName(tokenNames.smallPadding)).withDefault('4px');
16365
- const mediumPadding = DesignToken.create(styleNameFromTokenName(tokenNames.mediumPadding)).withDefault('8px');
16366
- const standardPadding = DesignToken.create(styleNameFromTokenName(tokenNames.standardPadding)).withDefault('16px');
16367
- const largePadding = DesignToken.create(styleNameFromTokenName(tokenNames.largePadding)).withDefault('24px');
16368
- DesignToken.create(styleNameFromTokenName(tokenNames.labelHeight)).withDefault('16px');
16369
- const borderWidth = DesignToken.create(styleNameFromTokenName(tokenNames.borderWidth)).withDefault('1px');
16370
- DesignToken.create(styleNameFromTokenName(tokenNames.dividerWidth)).withDefault('2px');
16371
- const iconSize = DesignToken.create(styleNameFromTokenName(tokenNames.iconSize)).withDefault('16px');
16372
- const drawerWidth = DesignToken.create(styleNameFromTokenName(tokenNames.drawerWidth)).withDefault('784px');
16373
- const dialogSmallWidth = DesignToken.create(styleNameFromTokenName(tokenNames.dialogSmallWidth)).withDefault('400px');
16374
- const dialogSmallHeight = DesignToken.create(styleNameFromTokenName(tokenNames.dialogSmallHeight)).withDefault('fit-content');
16375
- const dialogSmallMaxHeight = DesignToken.create(styleNameFromTokenName(tokenNames.dialogSmallMaxHeight)).withDefault('600px');
16376
- DesignToken.create(styleNameFromTokenName(tokenNames.dialogLargeWidth)).withDefault('1024px');
16377
- DesignToken.create(styleNameFromTokenName(tokenNames.dialogLargeHeight)).withDefault('680px');
16378
- DesignToken.create(styleNameFromTokenName(tokenNames.dialogLargeMaxHeight)).withDefault('680px');
16379
- const menuMinWidth = DesignToken.create(styleNameFromTokenName(tokenNames.menuMinWidth)).withDefault('176px');
16380
- DesignToken.create(styleNameFromTokenName(tokenNames.bannerGapSize)).withDefault('1px');
16381
- const spinnerSmallHeight = DesignToken.create(styleNameFromTokenName(tokenNames.spinnerSmallHeight)).withDefault('16px');
16382
- DesignToken.create(styleNameFromTokenName(tokenNames.spinnerMediumHeight)).withDefault('32px');
16383
- DesignToken.create(styleNameFromTokenName(tokenNames.spinnerLargeHeight)).withDefault('64px');
16384
- // The token gets a default value of the table's default height (480px)
16385
- // but is given a calculated value in the table styles.
16386
- const tableFitRowsHeight = DesignToken.create(styleNameFromTokenName(tokenNames.tableFitRowsHeight)).withDefault('480px');
16387
- // Drop Shadow Tokens
16388
- DesignToken.create(styleNameFromTokenName(tokenNames.elevation1BoxShadow)).withDefault((element) => `0px 1px 4px ${hexToRgbaCssColor(getColorForTheme(element, Black, Black, Black), 0.16)}`);
16389
- const elevation2BoxShadow = DesignToken.create(styleNameFromTokenName(tokenNames.elevation2BoxShadow)).withDefault((element) => `0px 2px 4px ${hexToRgbaCssColor(getColorForTheme(element, Black, Black, Black), 0.16)}`);
16390
- const elevation3BoxShadow = DesignToken.create(styleNameFromTokenName(tokenNames.elevation3BoxShadow)).withDefault((element) => `0px 4px 8px ${hexToRgbaCssColor(getColorForTheme(element, Black, Black, Black), 0.3)}`);
16391
- // Font Tokens
16392
- createFontTokens(tokenNames.headlineFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Headline1Family, Headline1Weight, Headline1Size, Headline1LineHeight);
16393
- createFontTokens(tokenNames.headlinePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Headline2Family, Headline2Weight, Headline2Size, Headline2LineHeight);
16394
- createFontTokens(tokenNames.titlePlus2Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title3Family, Title3Weight, Title3Size, Title3LineHeight);
16395
- const [titlePlus1Font, titlePlus1FontColor] = createFontTokens(tokenNames.titlePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title2Family, Title2Weight, Title2Size, Title2LineHeight);
16396
- createFontTokens(tokenNames.titleFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title1Family, Title1Weight, Title1Size, Title1LineHeight);
16397
- const [subtitlePlus1Font] = createFontTokens(tokenNames.subtitlePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Subtitle2Family, Subtitle2Weight, Subtitle2Size, Subtitle2LineHeight);
16398
- const [subtitleFont, subtitleFontColor] = createFontTokens(tokenNames.subtitleFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Subtitle1Family, Subtitle1Weight, Subtitle1Size, Subtitle1LineHeight);
16399
- const [linkFont, linkFontColor, linkDisabledFontColor] = createFontTokens(tokenNames.linkFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight);
16400
- const [linkActiveFont, linkActiveFontColor] = createFontTokens(tokenNames.linkActiveFont, (element) => getColorForTheme(element, DigitalGreenLight, DigitalGreenLight, hexToRgbaCssColor(White, 0.75)), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight);
16401
- const [linkProminentFont, linkProminentFontColor] = createFontTokens(tokenNames.linkProminentFont, (element) => getColorForTheme(element, DigitalGreenDark105, PowerGreen, White), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight);
16402
- const [linkActiveProminentFont, linkActiveProminentFontColor] = createFontTokens(tokenNames.linkActiveProminentFont, (element) => getColorForTheme(element, DigitalGreenLight, DigitalGreenLight, hexToRgbaCssColor(White, 0.75)), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight);
16403
- const [placeholderFont, placeholderFontColor] = createFontTokens(tokenNames.placeholderFont, (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.6), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), PlaceholderFamily, PlaceholderWeight, PlaceholderSize, PlaceholderLineHeight);
16404
- const [bodyFont, bodyFontColor, bodyDisabledFontColor, bodyFontFamily, bodyFontWeight, bodyFontSize, bodyFontLineHeight] = createFontTokens(tokenNames.bodyFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyFamily, BodyWeight, BodySize, BodyLineHeight);
16405
- const [bodyEmphasizedFont, bodyEmphasizedFontColor, bodyEmphasizedDisabledFontColor, bodyEmphasizedFontFamily, bodyEmphasizedFontWeight] = createFontTokens(tokenNames.bodyEmphasizedFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyEmphasizedFamily, BodyEmphasizedWeight, BodyEmphasizedSize, BodyEmphasizedLineHeight);
16406
- createFontTokens(tokenNames.bodyPlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Body2Family, Body2Weight, Body2Size, Body2LineHeight);
16407
- createFontTokens(tokenNames.bodyPlus1EmphasizedFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyEmphasized2Family, BodyEmphasized2Weight, BodyEmphasized2Size, BodyEmphasized2LineHeight);
16408
- const [groupHeaderFont, groupHeaderFontColor] = createFontTokens(tokenNames.groupHeaderFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), GroupLabel1Family, GroupLabel1Weight, GroupLabel1Size, GroupLabel1LineHeight);
16409
- const [controlLabelFont, controlLabelFontColor, controlLabelDisabledFontColor, controlLabelFontFamily, controlLabelFontWeight, controlLabelFontSize, controlLabelFontLineHeight] = createFontTokens(tokenNames.controlLabelFont, (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.6), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), ControlLabel1Family, ControlLabel1Weight, ControlLabel1Size, ControlLabel1LineHeight);
16410
- const [buttonLabelFont, buttonLabelFontColor, buttonLabelDisabledFontColor] = createFontTokens(tokenNames.buttonLabelFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), ButtonLabel1Family, ButtonLabel1Weight, ButtonLabel1Size, ButtonLabel1LineHeight);
16411
- const [tooltipCaptionFont, tooltipCaptionFontColor] = createFontTokens(tokenNames.tooltipCaptionFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), TooltipCaptionFamily, TooltipCaptionWeight, TooltipCaptionSize, TooltipCaptionLineHeight);
16412
- const [errorTextFont, errorTextFontColor, errorTextDisabledFontColor, errorTextFontFamily, errorTextFontWeight, errorTextFontSize, errorTextFontLineHeight] = createFontTokens(tokenNames.errorTextFont, (element) => getFailColorForTheme(element), (element) => hexToRgbaCssColor(getFailColorForTheme(element), 0.3), ErrorLightUiFamily, ErrorLightUiWeight, ErrorLightUiSize, TooltipCaptionLineHeight);
16413
- const [tableHeaderFont, tableHeaderFontColor] = createFontTokens(tokenNames.tableHeaderFont, (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.6), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), GridHeaderFamily, GridHeaderWeight, GridHeaderSize, TooltipCaptionLineHeight);
16414
- createFontTokens(tokenNames.mentionFont, (element) => getColorForTheme(element, DigitalGreenDark, PowerGreen, PowerGreen), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), BodyFamily, BodyEmphasizedWeight, BodySize, BodyLineHeight);
16415
- // Font Transform Tokens
16416
- const groupHeaderTextTransform = DesignToken.create(styleNameFromTokenName(tokenNames.groupHeaderTextTransform)).withDefault('uppercase');
16417
- // Animation Tokens
16418
- const smallDelay = DesignToken.create(styleNameFromTokenName(tokenNames.smallDelay)).withDefault(SmallDelay);
16419
- const mediumDelay = DesignToken.create(styleNameFromTokenName(tokenNames.mediumDelay)).withDefault(MediumDelay);
16420
- const largeDelay = DesignToken.create(styleNameFromTokenName(tokenNames.largeDelay)).withDefault(LargeDelay);
16421
- // Private helpers functions
16296
+ // #region token values
16297
+ const alias = {
16298
+ failColor: createThemeColor(Fail100LightUi, Fail100DarkUi, White),
16299
+ lineColor: createThemeColor(Black91, Black15, White),
16300
+ fillSelectedColor: createThemeColor(DigitalGreenLight, PowerGreen, White),
16301
+ fillHoverColor: createThemeColor(Black91, Black15, White),
16302
+ defaultFontColor: createThemeColor(Black91, Black15, White)
16303
+ };
16304
+ const tokenValues = {
16305
+ actionRgbPartialColor: hexToRgbPartialThemeColor(createThemeColor(Black91, Black15, White)),
16306
+ applicationBackgroundColor: createThemeColor(White, Black85, ForestGreen),
16307
+ headerBackgroundColor: createThemeColor(Black7, Black88, ForestGreen),
16308
+ sectionBackgroundColor: createThemeColor(Black15, Black80, ForestGreen),
16309
+ sectionBackgroundImage: createThemeColor(`linear-gradient(${Black15}, ${hexToRgbaCssColor(Black15, 0)})`, `linear-gradient(${Black82}, ${hexToRgbaCssColor(Black82, 0)})`, `linear-gradient(${ForestGreen}, ${hexToRgbaCssColor(ForestGreen, 0)})`),
16310
+ dividerBackgroundColor: createThemeColor(Black15, Black80, ForestGreen),
16311
+ fillSelectedColor: hexToRgbaCssThemeColor(alias.fillSelectedColor, 0.2, 0.2, 0.2),
16312
+ fillSelectedRgbPartialColor: hexToRgbPartialThemeColor(alias.fillSelectedColor),
16313
+ fillHoverSelectedColor: hexToRgbaCssThemeColor(alias.fillSelectedColor, 0.15, 0.15, 0.15),
16314
+ fillHoverColor: hexToRgbaCssThemeColor(alias.fillHoverColor, 0.1, 0.1, 0.1),
16315
+ fillHoverRgbPartialColor: hexToRgbPartialThemeColor(alias.fillHoverColor),
16316
+ fillDownColor: hexToRgbaCssThemeColor(alias.fillHoverColor, 0.15, 0.15, 0.15),
16317
+ borderColor: alias.lineColor,
16318
+ borderRgbPartialColor: hexToRgbPartialThemeColor(alias.lineColor),
16319
+ failColor: alias.failColor,
16320
+ warningColor: createThemeColor(Warning100LightUi, Warning100DarkUi, White),
16321
+ passColor: createThemeColor(Pass100LightUi, Pass100DarkUi, White),
16322
+ informationColor: createThemeColor(Information100LightUi, Information100DarkUi, White),
16323
+ borderHoverColor: createThemeColor(DigitalGreenLight, PowerGreen, White),
16324
+ iconColor: createThemeColor(Black91, Black15, White),
16325
+ modalBackdropColor: hexToRgbaCssThemeColor(createThemeColor(Black, Black, Black), 0.3, 0.6, 0.6),
16326
+ popupBorderColor: hexToRgbaCssThemeColor(alias.lineColor, 0.3, 0.3, 0.3),
16327
+ cardBorderColor: hexToRgbaCssThemeColor(alias.lineColor, 0.1, 0.1, 0.1),
16328
+ graphGridlineColor: hexToRgbaCssThemeColor(alias.lineColor, 0.2, 0.2, 0.2),
16329
+ graphTrace1Color: createThemeColor(NiIndigoDark2, NiSky, White),
16330
+ graphTrace2Color: createThemeColor(NiScarletDark1, NiScarlet, hexToRgbaCssColor(White, 0.7)),
16331
+ graphTrace3Color: createThemeColor(NiFernDark1, NiFern, hexToRgbaCssColor(White, 0.4)),
16332
+ graphTrace4Color: createThemeColor(NiPlumDark1, NiSeaLight, hexToRgbaCssColor(White, 0.25)),
16333
+ graphTrace5Color: createThemeColor(NiSeaDark2, NiSea, hexToRgbaCssColor(White, 0.55)),
16334
+ graphTrace6Color: createThemeColor(NiTulip, NiTulip, hexToRgbaCssColor(White, 0.85)),
16335
+ graphTrace7Color: createThemeColor(NiScarletDark3, NiHoneyLight, hexToRgbaCssColor(White, 0.325)),
16336
+ graphTrace8Color: createThemeColor(NiIndigo, NiIndigo, hexToRgbaCssColor(White, 0.625)),
16337
+ tooltipBackgroundColor: createThemeColor(Black15, Black85, ForestGreen),
16338
+ tableRowBorderColor: createThemeColor(Black15, Black80, ForestGreen),
16339
+ tagFillColor: hexToRgbaCssThemeColor(alias.lineColor, 0.1, 0.1, 0.1),
16340
+ buttonFillPrimaryColor: hexToRgbaCssThemeColor(createThemeColor(Black91, Black15, White), 0.75, 0.3, 0.3),
16341
+ buttonPrimaryFontColor: createThemeColor(Black15, Black15, White),
16342
+ buttonFillAccentColor: createThemeColor(DigitalGreenDark, DigitalGreenLight, hexToRgbaCssColor(White, 0.1)),
16343
+ buttonAccentBlockFontColor: createThemeColor(White, Black15, White),
16344
+ buttonAccentOutlineFontColor: createThemeColor(DigitalGreenDark105, PowerGreen, White),
16345
+ buttonBorderAccentOutlineColor: createThemeColor(DigitalGreenLight, PowerGreen, hexToRgbaCssColor(White, 0.3)),
16346
+ calendarEventBackgroundStaticColor: createThemeColor(DigitalGreenLight10, PowerGreen10, PowerGreen10),
16347
+ calendarEventBackgroundDynamicColor: createThemeColor(DigitalGreenDark105, DigitalGreenDark, DigitalGreenDark),
16348
+ calendarEventBackgroundTransientColor: createThemeColor(DigitalGreenDark105, DigitalGreenDark, DigitalGreenDark),
16349
+ calendarEventBorderStaticColor: createThemeColor(DigitalGreenLight, DigitalGreenLight, DigitalGreenLight),
16350
+ calendarEventBorderTransientColor: createThemeColor(DigitalGreenLight, hexToRgbaCssColor(PowerGreen, 0.85), hexToRgbaCssColor(PowerGreen, 0.85)),
16351
+ calendarEventStaticFontColor: createThemeColor(DigitalGreenDark110, PowerGreenDark50, PowerGreenDark50),
16352
+ calendarEventDynamicFontColor: createThemeColor(White, White, White),
16353
+ calendarEventTransientFontColor: createThemeColor(White, White, White),
16354
+ calendarEventBackgroundHoverStaticColor: createThemeColor(DigitalGreenLight30, PowerGreen30, PowerGreen30),
16355
+ calendarEventBackgroundHoverDynamicColor: createThemeColor(DigitalGreenDark110, DigitalGreenDark105, DigitalGreenDark105),
16356
+ calendarEventBackgroundHoverTransientColor: createThemeColor(DigitalGreenDark110, DigitalGreenDark105, DigitalGreenDark105),
16357
+ calendarEventOuterBorderHighlightedColor: createThemeColor(Black88, hexToRgbaCssColor(White, 0.85), hexToRgbaCssColor(White, 0.85)),
16358
+ calendarRowBackgroundSelectedColor: hexToRgbaCssThemeColor(createThemeColor(DigitalGreenLight, PowerGreen, PowerGreen), 0.2, 0.2, 0.2),
16359
+ calendarRowBackgroundConflictColor: hexToRgbaCssThemeColor(createThemeColor(Fail100LightUi, Fail100DarkUi, Fail100DarkUi), 0.2, 0.2, 0.2),
16360
+ calendarEventFillBlockedColor: createThemeColor(hexToRgbaCssColor(Black91, 0.07), Black82, Black82),
16361
+ calendarGrabHandleBackgroundColor: createThemeColor(DigitalGreenLight, PowerGreen, PowerGreen),
16362
+ calendarGridBorderColor: createThemeColor(Black22, Black80, Black80),
16363
+ calendarGroupHeaderBackgroundColor: createThemeColor(Black7, hexToRgbaCssColor(Black91, 0.1), hexToRgbaCssColor(Black91, 0.1)),
16364
+ controlHeight: '32px',
16365
+ controlSlimHeight: '24px',
16366
+ smallPadding: '4px',
16367
+ mediumPadding: '8px',
16368
+ standardPadding: '16px',
16369
+ largePadding: '24px',
16370
+ labelHeight: '16px',
16371
+ borderWidth: '1px',
16372
+ dividerWidth: '2px',
16373
+ iconSize: '16px',
16374
+ drawerWidth: '784px',
16375
+ dialogSmallWidth: '400px',
16376
+ dialogSmallHeight: 'fit-content',
16377
+ dialogSmallMaxHeight: '600px',
16378
+ dialogLargeWidth: '1024px',
16379
+ dialogLargeHeight: '680px',
16380
+ dialogLargeMaxHeight: '680px',
16381
+ menuMinWidth: '176px',
16382
+ bannerGapSize: '1px',
16383
+ spinnerSmallHeight: '16px',
16384
+ spinnerMediumHeight: '32px',
16385
+ spinnerLargeHeight: '64px',
16386
+ tableFitRowsHeight: '480px',
16387
+ elevation1BoxShadow: createThemeColor(`0px 1px 4px ${hexToRgbaCssColor(Black, 0.16)}`, `0px 1px 4px ${hexToRgbaCssColor(Black, 0.16)}`, `0px 1px 4px ${hexToRgbaCssColor(Black, 0.16)}`),
16388
+ elevation2BoxShadow: createThemeColor(`0px 2px 4px ${hexToRgbaCssColor(Black, 0.16)}`, `0px 2px 4px ${hexToRgbaCssColor(Black, 0.16)}`, `0px 2px 4px ${hexToRgbaCssColor(Black, 0.16)}`),
16389
+ elevation3BoxShadow: createThemeColor(`0px 4px 8px ${hexToRgbaCssColor(Black, 0.3)}`, `0px 4px 8px ${hexToRgbaCssColor(Black, 0.3)}`, `0px 4px 8px ${hexToRgbaCssColor(Black, 0.3)}`),
16390
+ ...createFont('headline', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), Headline1Family, Headline1Weight, Headline1Size, Headline1LineHeight),
16391
+ ...createFont('headlinePlus1', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), Headline2Family, Headline2Weight, Headline2Size, Headline2LineHeight),
16392
+ ...createFont('titlePlus2', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), Title3Family, Title3Weight, Title3Size, Title3LineHeight),
16393
+ ...createFont('titlePlus1', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), Title2Family, Title2Weight, Title2Size, Title2LineHeight),
16394
+ ...createFont('title', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), Title1Family, Title1Weight, Title1Size, Title1LineHeight),
16395
+ ...createFont('subtitlePlus1', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), Subtitle2Family, Subtitle2Weight, Subtitle2Size, Subtitle2LineHeight),
16396
+ ...createFont('subtitle', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), Subtitle1Family, Subtitle1Weight, Subtitle1Size, Subtitle1LineHeight),
16397
+ ...createFont('link', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight),
16398
+ ...createFont('linkActive', createThemeColor(DigitalGreenLight, DigitalGreenLight, hexToRgbaCssColor(White, 0.75)), hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight),
16399
+ ...createFont('linkProminent', createThemeColor(DigitalGreenDark105, PowerGreen, White), hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight),
16400
+ ...createFont('linkActiveProminent', createThemeColor(DigitalGreenLight, DigitalGreenLight, hexToRgbaCssColor(White, 0.75)), hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight),
16401
+ ...createFont('placeholder', hexToRgbaCssThemeColor(alias.defaultFontColor, 0.6, 0.6, 0.6), hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), PlaceholderFamily, PlaceholderWeight, PlaceholderSize, PlaceholderLineHeight),
16402
+ ...createFont('body', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), BodyFamily, BodyWeight, BodySize, BodyLineHeight),
16403
+ ...createFont('bodyEmphasized', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), BodyEmphasizedFamily, BodyEmphasizedWeight, BodyEmphasizedSize, BodyEmphasizedLineHeight),
16404
+ ...createFont('bodyPlus1', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), Body2Family, Body2Weight, Body2Size, Body2LineHeight),
16405
+ ...createFont('bodyPlus1Emphasized', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), BodyEmphasized2Family, BodyEmphasized2Weight, BodyEmphasized2Size, BodyEmphasized2LineHeight),
16406
+ ...createFont('groupHeader', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), GroupLabel1Family, GroupLabel1Weight, GroupLabel1Size, GroupLabel1LineHeight),
16407
+ ...createFont('controlLabel', hexToRgbaCssThemeColor(alias.defaultFontColor, 0.6, 0.6, 0.6), hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), ControlLabel1Family, ControlLabel1Weight, ControlLabel1Size, ControlLabel1LineHeight),
16408
+ ...createFont('buttonLabel', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), ButtonLabel1Family, ButtonLabel1Weight, ButtonLabel1Size, ButtonLabel1LineHeight),
16409
+ ...createFont('tooltipCaption', alias.defaultFontColor, hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), TooltipCaptionFamily, TooltipCaptionWeight, TooltipCaptionSize, TooltipCaptionLineHeight),
16410
+ ...createFont('errorText', alias.failColor, hexToRgbaCssThemeColor(alias.failColor, 0.3, 0.3, 0.3), ErrorLightUiFamily, ErrorLightUiWeight, ErrorLightUiSize, TooltipCaptionLineHeight),
16411
+ ...createFont('tableHeader', hexToRgbaCssThemeColor(alias.defaultFontColor, 0.6, 0.6, 0.6), hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), GridHeaderFamily, GridHeaderWeight, GridHeaderSize, TooltipCaptionLineHeight),
16412
+ ...createFont('mention', createThemeColor(DigitalGreenDark, PowerGreen, PowerGreen), hexToRgbaCssThemeColor(alias.defaultFontColor, 0.3, 0.3, 0.3), BodyFamily, BodyEmphasizedWeight, BodySize, BodyLineHeight),
16413
+ groupHeaderTextTransform: 'uppercase',
16414
+ smallDelay: SmallDelay,
16415
+ mediumDelay: MediumDelay,
16416
+ largeDelay: LargeDelay
16417
+ };
16418
+ // #endregion
16419
+ function hexToRgbaCssThemeColor(themeColor, lightAlpha, darkAlpha, colorAlpha) {
16420
+ return {
16421
+ light: hexToRgbaCssColor(themeColor.light, lightAlpha),
16422
+ dark: hexToRgbaCssColor(themeColor.dark, darkAlpha),
16423
+ color: hexToRgbaCssColor(themeColor.color, colorAlpha),
16424
+ };
16425
+ }
16422
16426
  function hexToRgbPartial(hexValue) {
16423
16427
  const { r, g, b } = parseColorHexRGB(hexValue);
16424
16428
  return `${r * 255}, ${g * 255}, ${b * 255}`;
16425
16429
  }
16426
- function createFontTokens(fontTokenName, colorFunction, disabledColorFunction, family, weight, size, lineHeight) {
16427
- if (fontTokenName === ''
16428
- || family === ''
16429
- || weight === ''
16430
- || size === ''
16431
- || lineHeight === '') {
16432
- throw new Error('createFontTokens parameter unexpectedly set to empty string');
16433
- }
16430
+ function hexToRgbPartialThemeColor(themeColor) {
16431
+ return {
16432
+ light: hexToRgbPartial(themeColor.light),
16433
+ dark: hexToRgbPartial(themeColor.dark),
16434
+ color: hexToRgbPartial(themeColor.color),
16435
+ };
16436
+ }
16437
+ function createThemeColor(light, dark, color) {
16438
+ return {
16439
+ light,
16440
+ dark,
16441
+ color
16442
+ };
16443
+ }
16444
+ function createFont(token, color, disabledColor, family, weight, size, lineHeight) {
16434
16445
  const familyWithFallback = `${family}, ${family} Fallback`;
16435
- const fontToken = DesignToken.create(styleNameFromTokenName(fontTokenName)).withDefault(`${weight} ${size}/${lineHeight} ${familyWithFallback}`);
16446
+ return {
16447
+ [`${token}Font`]: `${weight} ${size}/${lineHeight} ${familyWithFallback}`,
16448
+ [`${token}FontColor`]: color,
16449
+ [`${token}DisabledFontColor`]: disabledColor,
16450
+ [`${token}FontFamily`]: family,
16451
+ [`${token}FontWeight`]: weight,
16452
+ [`${token}FontSize`]: size,
16453
+ [`${token}FontLineHeight`]: lineHeight,
16454
+ };
16455
+ }
16456
+
16457
+ // #region color tokens
16458
+ const actionRgbPartialColor = createThemeColorToken(tokenNames.actionRgbPartialColor, tokenValues.actionRgbPartialColor);
16459
+ const applicationBackgroundColor = createThemeColorToken(tokenNames.applicationBackgroundColor, tokenValues.applicationBackgroundColor);
16460
+ createThemeColorToken(tokenNames.headerBackgroundColor, tokenValues.headerBackgroundColor);
16461
+ createThemeColorToken(tokenNames.sectionBackgroundColor, tokenValues.sectionBackgroundColor);
16462
+ const sectionBackgroundImage = createThemeColorToken(tokenNames.sectionBackgroundImage, tokenValues.sectionBackgroundImage);
16463
+ createThemeColorToken(tokenNames.dividerBackgroundColor, tokenValues.dividerBackgroundColor);
16464
+ const fillSelectedColor = createThemeColorToken(tokenNames.fillSelectedColor, tokenValues.fillSelectedColor);
16465
+ const fillSelectedRgbPartialColor = createThemeColorToken(tokenNames.fillSelectedRgbPartialColor, tokenValues.fillSelectedRgbPartialColor);
16466
+ const fillHoverSelectedColor = createThemeColorToken(tokenNames.fillHoverSelectedColor, tokenValues.fillHoverSelectedColor);
16467
+ const fillHoverColor = createThemeColorToken(tokenNames.fillHoverColor, tokenValues.fillHoverColor);
16468
+ createThemeColorToken(tokenNames.fillHoverRgbPartialColor, tokenValues.fillHoverRgbPartialColor);
16469
+ createThemeColorToken(tokenNames.fillDownColor, tokenValues.fillDownColor);
16470
+ const borderColor = createThemeColorToken(tokenNames.borderColor, tokenValues.borderColor);
16471
+ const borderRgbPartialColor = createThemeColorToken(tokenNames.borderRgbPartialColor, tokenValues.borderRgbPartialColor);
16472
+ const failColor = createThemeColorToken(tokenNames.failColor, tokenValues.failColor);
16473
+ const warningColor = createThemeColorToken(tokenNames.warningColor, tokenValues.warningColor);
16474
+ const passColor = createThemeColorToken(tokenNames.passColor, tokenValues.passColor);
16475
+ const informationColor = createThemeColorToken(tokenNames.informationColor, tokenValues.informationColor);
16476
+ const borderHoverColor = createThemeColorToken(tokenNames.borderHoverColor, tokenValues.borderHoverColor);
16477
+ // #endregion
16478
+ // #region component color tokens
16479
+ const iconColor = createThemeColorToken(tokenNames.iconColor, tokenValues.iconColor);
16480
+ const modalBackdropColor = createThemeColorToken(tokenNames.modalBackdropColor, tokenValues.modalBackdropColor);
16481
+ const popupBorderColor = createThemeColorToken(tokenNames.popupBorderColor, tokenValues.popupBorderColor);
16482
+ const cardBorderColor = createThemeColorToken(tokenNames.cardBorderColor, tokenValues.cardBorderColor);
16483
+ createThemeColorToken(tokenNames.graphGridlineColor, tokenValues.graphGridlineColor);
16484
+ createThemeColorToken(tokenNames.graphTrace1Color, tokenValues.graphTrace1Color);
16485
+ createThemeColorToken(tokenNames.graphTrace2Color, tokenValues.graphTrace2Color);
16486
+ createThemeColorToken(tokenNames.graphTrace3Color, tokenValues.graphTrace3Color);
16487
+ createThemeColorToken(tokenNames.graphTrace4Color, tokenValues.graphTrace4Color);
16488
+ createThemeColorToken(tokenNames.graphTrace5Color, tokenValues.graphTrace5Color);
16489
+ createThemeColorToken(tokenNames.graphTrace6Color, tokenValues.graphTrace6Color);
16490
+ createThemeColorToken(tokenNames.graphTrace7Color, tokenValues.graphTrace7Color);
16491
+ createThemeColorToken(tokenNames.graphTrace8Color, tokenValues.graphTrace8Color);
16492
+ createThemeColorToken(tokenNames.tooltipBackgroundColor, tokenValues.tooltipBackgroundColor);
16493
+ const tableRowBorderColor = createThemeColorToken(tokenNames.tableRowBorderColor, tokenValues.tableRowBorderColor);
16494
+ createThemeColorToken(tokenNames.tagFillColor, tokenValues.tagFillColor);
16495
+ const buttonFillPrimaryColor = createThemeColorToken(tokenNames.buttonFillPrimaryColor, tokenValues.buttonFillPrimaryColor);
16496
+ const buttonPrimaryFontColor = createThemeColorToken(tokenNames.buttonPrimaryFontColor, tokenValues.buttonPrimaryFontColor);
16497
+ const buttonFillAccentColor = createThemeColorToken(tokenNames.buttonFillAccentColor, tokenValues.buttonFillAccentColor);
16498
+ const buttonAccentBlockFontColor = createThemeColorToken(tokenNames.buttonAccentBlockFontColor, tokenValues.buttonAccentBlockFontColor);
16499
+ const buttonAccentOutlineFontColor = createThemeColorToken(tokenNames.buttonAccentOutlineFontColor, tokenValues.buttonAccentOutlineFontColor);
16500
+ const buttonBorderAccentOutlineColor = createThemeColorToken(tokenNames.buttonBorderAccentOutlineColor, tokenValues.buttonBorderAccentOutlineColor);
16501
+ createThemeColorToken(tokenNames.calendarEventBackgroundStaticColor, tokenValues.calendarEventBackgroundStaticColor);
16502
+ createThemeColorToken(tokenNames.calendarEventBackgroundDynamicColor, tokenValues.calendarEventBackgroundDynamicColor);
16503
+ createThemeColorToken(tokenNames.calendarEventBackgroundTransientColor, tokenValues.calendarEventBackgroundTransientColor);
16504
+ createThemeColorToken(tokenNames.calendarEventBorderStaticColor, tokenValues.calendarEventBorderStaticColor);
16505
+ createThemeColorToken(tokenNames.calendarEventBorderTransientColor, tokenValues.calendarEventBorderTransientColor);
16506
+ createThemeColorToken(tokenNames.calendarEventStaticFontColor, tokenValues.calendarEventStaticFontColor);
16507
+ createThemeColorToken(tokenNames.calendarEventDynamicFontColor, tokenValues.calendarEventDynamicFontColor);
16508
+ createThemeColorToken(tokenNames.calendarEventTransientFontColor, tokenValues.calendarEventTransientFontColor);
16509
+ createThemeColorToken(tokenNames.calendarEventBackgroundHoverStaticColor, tokenValues.calendarEventBackgroundHoverStaticColor);
16510
+ createThemeColorToken(tokenNames.calendarEventBackgroundHoverDynamicColor, tokenValues.calendarEventBackgroundHoverDynamicColor);
16511
+ createThemeColorToken(tokenNames.calendarEventBackgroundHoverTransientColor, tokenValues.calendarEventBackgroundHoverTransientColor);
16512
+ createThemeColorToken(tokenNames.calendarEventOuterBorderHighlightedColor, tokenValues.calendarEventOuterBorderHighlightedColor);
16513
+ createThemeColorToken(tokenNames.calendarRowBackgroundSelectedColor, tokenValues.calendarRowBackgroundSelectedColor);
16514
+ createThemeColorToken(tokenNames.calendarRowBackgroundConflictColor, tokenValues.calendarRowBackgroundConflictColor);
16515
+ createThemeColorToken(tokenNames.calendarEventFillBlockedColor, tokenValues.calendarEventFillBlockedColor);
16516
+ createThemeColorToken(tokenNames.calendarGrabHandleBackgroundColor, tokenValues.calendarGrabHandleBackgroundColor);
16517
+ createThemeColorToken(tokenNames.calendarGridBorderColor, tokenValues.calendarGridBorderColor);
16518
+ createThemeColorToken(tokenNames.calendarGroupHeaderBackgroundColor, tokenValues.calendarGroupHeaderBackgroundColor);
16519
+ // #endregion
16520
+ // #region size tokens
16521
+ const controlHeight = createStringToken(tokenNames.controlHeight, tokenValues.controlHeight);
16522
+ const controlSlimHeight = createStringToken(tokenNames.controlSlimHeight, tokenValues.controlSlimHeight);
16523
+ const smallPadding = createStringToken(tokenNames.smallPadding, tokenValues.smallPadding);
16524
+ const mediumPadding = createStringToken(tokenNames.mediumPadding, tokenValues.mediumPadding);
16525
+ const standardPadding = createStringToken(tokenNames.standardPadding, tokenValues.standardPadding);
16526
+ const largePadding = createStringToken(tokenNames.largePadding, tokenValues.largePadding);
16527
+ createStringToken(tokenNames.labelHeight, tokenValues.labelHeight);
16528
+ const borderWidth = createStringToken(tokenNames.borderWidth, tokenValues.borderWidth);
16529
+ createStringToken(tokenNames.dividerWidth, tokenValues.dividerWidth);
16530
+ const iconSize = createStringToken(tokenNames.iconSize, tokenValues.iconSize);
16531
+ const drawerWidth = createStringToken(tokenNames.drawerWidth, tokenValues.drawerWidth);
16532
+ const dialogSmallWidth = createStringToken(tokenNames.dialogSmallWidth, tokenValues.dialogSmallWidth);
16533
+ const dialogSmallHeight = createStringToken(tokenNames.dialogSmallHeight, tokenValues.dialogSmallHeight);
16534
+ const dialogSmallMaxHeight = createStringToken(tokenNames.dialogSmallMaxHeight, tokenValues.dialogSmallMaxHeight);
16535
+ createStringToken(tokenNames.dialogLargeWidth, tokenValues.dialogLargeWidth);
16536
+ createStringToken(tokenNames.dialogLargeHeight, tokenValues.dialogLargeHeight);
16537
+ createStringToken(tokenNames.dialogLargeMaxHeight, tokenValues.dialogLargeMaxHeight);
16538
+ const menuMinWidth = createStringToken(tokenNames.menuMinWidth, tokenValues.menuMinWidth);
16539
+ createStringToken(tokenNames.bannerGapSize, tokenValues.bannerGapSize);
16540
+ const spinnerSmallHeight = createStringToken(tokenNames.spinnerSmallHeight, tokenValues.spinnerSmallHeight);
16541
+ createStringToken(tokenNames.spinnerMediumHeight, tokenValues.spinnerMediumHeight);
16542
+ createStringToken(tokenNames.spinnerLargeHeight, tokenValues.spinnerLargeHeight);
16543
+ const tableFitRowsHeight = createStringToken(tokenNames.tableFitRowsHeight, tokenValues.tableFitRowsHeight);
16544
+ // #endregion
16545
+ // #region drop shadow tokens
16546
+ createThemeColorToken(tokenNames.elevation1BoxShadow, tokenValues.elevation1BoxShadow);
16547
+ const elevation2BoxShadow = createThemeColorToken(tokenNames.elevation2BoxShadow, tokenValues.elevation2BoxShadow);
16548
+ const elevation3BoxShadow = createThemeColorToken(tokenNames.elevation3BoxShadow, tokenValues.elevation3BoxShadow);
16549
+ // #endregion
16550
+ // #region font tokens
16551
+ createFontTokens(tokenNames.headlineFont, tokenValues.headlineFont, tokenValues.headlineFontColor, tokenValues.headlineDisabledFontColor, tokenValues.headlineFontFamily, tokenValues.headlineFontWeight, tokenValues.headlineFontSize, tokenValues.headlineFontLineHeight);
16552
+ createFontTokens(tokenNames.headlinePlus1Font, tokenValues.headlinePlus1Font, tokenValues.headlinePlus1FontColor, tokenValues.headlinePlus1DisabledFontColor, tokenValues.headlinePlus1FontFamily, tokenValues.headlinePlus1FontWeight, tokenValues.headlinePlus1FontSize, tokenValues.headlinePlus1FontLineHeight);
16553
+ createFontTokens(tokenNames.titlePlus2Font, tokenValues.titlePlus2Font, tokenValues.titlePlus2FontColor, tokenValues.titlePlus2DisabledFontColor, tokenValues.titlePlus2FontFamily, tokenValues.titlePlus2FontWeight, tokenValues.titlePlus2FontSize, tokenValues.titlePlus2FontLineHeight);
16554
+ const [titlePlus1Font, titlePlus1FontColor] = createFontTokens(tokenNames.titlePlus1Font, tokenValues.titlePlus1Font, tokenValues.titlePlus1FontColor, tokenValues.titlePlus1DisabledFontColor, tokenValues.titlePlus1FontFamily, tokenValues.titlePlus1FontWeight, tokenValues.titlePlus1FontSize, tokenValues.titlePlus1FontLineHeight);
16555
+ createFontTokens(tokenNames.titleFont, tokenValues.titleFont, tokenValues.titleFontColor, tokenValues.titleDisabledFontColor, tokenValues.titleFontFamily, tokenValues.titleFontWeight, tokenValues.titleFontSize, tokenValues.titleFontLineHeight);
16556
+ const [subtitlePlus1Font] = createFontTokens(tokenNames.subtitlePlus1Font, tokenValues.subtitlePlus1Font, tokenValues.subtitlePlus1FontColor, tokenValues.subtitlePlus1DisabledFontColor, tokenValues.subtitlePlus1FontFamily, tokenValues.subtitlePlus1FontWeight, tokenValues.subtitlePlus1FontSize, tokenValues.subtitlePlus1FontLineHeight);
16557
+ const [subtitleFont, subtitleFontColor] = createFontTokens(tokenNames.subtitleFont, tokenValues.subtitleFont, tokenValues.subtitleFontColor, tokenValues.subtitleDisabledFontColor, tokenValues.subtitleFontFamily, tokenValues.subtitleFontWeight, tokenValues.subtitleFontSize, tokenValues.subtitleFontLineHeight);
16558
+ const [linkFont, linkFontColor, linkDisabledFontColor] = createFontTokens(tokenNames.linkFont, tokenValues.linkFont, tokenValues.linkFontColor, tokenValues.linkDisabledFontColor, tokenValues.linkFontFamily, tokenValues.linkFontWeight, tokenValues.linkFontSize, tokenValues.linkFontLineHeight);
16559
+ const [linkActiveFont, linkActiveFontColor] = createFontTokens(tokenNames.linkActiveFont, tokenValues.linkActiveFont, tokenValues.linkActiveFontColor, tokenValues.linkActiveDisabledFontColor, tokenValues.linkActiveFontFamily, tokenValues.linkActiveFontWeight, tokenValues.linkActiveFontSize, tokenValues.linkActiveFontLineHeight);
16560
+ const [linkProminentFont, linkProminentFontColor] = createFontTokens(tokenNames.linkProminentFont, tokenValues.linkProminentFont, tokenValues.linkProminentFontColor, tokenValues.linkProminentDisabledFontColor, tokenValues.linkProminentFontFamily, tokenValues.linkProminentFontWeight, tokenValues.linkProminentFontSize, tokenValues.linkProminentFontLineHeight);
16561
+ const [linkActiveProminentFont, linkActiveProminentFontColor] = createFontTokens(tokenNames.linkActiveProminentFont, tokenValues.linkActiveProminentFont, tokenValues.linkActiveProminentFontColor, tokenValues.linkActiveProminentDisabledFontColor, tokenValues.linkActiveProminentFontFamily, tokenValues.linkActiveProminentFontWeight, tokenValues.linkActiveProminentFontSize, tokenValues.linkActiveProminentFontLineHeight);
16562
+ const [placeholderFont, placeholderFontColor] = createFontTokens(tokenNames.placeholderFont, tokenValues.placeholderFont, tokenValues.placeholderFontColor, tokenValues.placeholderDisabledFontColor, tokenValues.placeholderFontFamily, tokenValues.placeholderFontWeight, tokenValues.placeholderFontSize, tokenValues.placeholderFontLineHeight);
16563
+ 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);
16564
+ const [bodyEmphasizedFont, bodyEmphasizedFontColor, bodyEmphasizedDisabledFontColor, bodyEmphasizedFontFamily, bodyEmphasizedFontWeight] = createFontTokens(tokenNames.bodyEmphasizedFont, tokenValues.bodyEmphasizedFont, tokenValues.bodyEmphasizedFontColor, tokenValues.bodyEmphasizedDisabledFontColor, tokenValues.bodyEmphasizedFontFamily, tokenValues.bodyEmphasizedFontWeight, tokenValues.bodyEmphasizedFontSize, tokenValues.bodyEmphasizedFontLineHeight);
16565
+ createFontTokens(tokenNames.bodyPlus1Font, tokenValues.bodyPlus1Font, tokenValues.bodyPlus1FontColor, tokenValues.bodyPlus1DisabledFontColor, tokenValues.bodyPlus1FontFamily, tokenValues.bodyPlus1FontWeight, tokenValues.bodyPlus1FontSize, tokenValues.bodyPlus1FontLineHeight);
16566
+ createFontTokens(tokenNames.bodyPlus1EmphasizedFont, tokenValues.bodyPlus1EmphasizedFont, tokenValues.bodyPlus1EmphasizedFontColor, tokenValues.bodyPlus1EmphasizedDisabledFontColor, tokenValues.bodyPlus1EmphasizedFontFamily, tokenValues.bodyPlus1EmphasizedFontWeight, tokenValues.bodyPlus1EmphasizedFontSize, tokenValues.bodyPlus1EmphasizedFontLineHeight);
16567
+ const [groupHeaderFont, groupHeaderFontColor] = createFontTokens(tokenNames.groupHeaderFont, tokenValues.groupHeaderFont, tokenValues.groupHeaderFontColor, tokenValues.groupHeaderDisabledFontColor, tokenValues.groupHeaderFontFamily, tokenValues.groupHeaderFontWeight, tokenValues.groupHeaderFontSize, tokenValues.groupHeaderFontLineHeight);
16568
+ 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);
16569
+ const [buttonLabelFont, buttonLabelFontColor, buttonLabelDisabledFontColor] = createFontTokens(tokenNames.buttonLabelFont, tokenValues.buttonLabelFont, tokenValues.buttonLabelFontColor, tokenValues.buttonLabelDisabledFontColor, tokenValues.buttonLabelFontFamily, tokenValues.buttonLabelFontWeight, tokenValues.buttonLabelFontSize, tokenValues.buttonLabelFontLineHeight);
16570
+ const [tooltipCaptionFont, tooltipCaptionFontColor] = createFontTokens(tokenNames.tooltipCaptionFont, tokenValues.tooltipCaptionFont, tokenValues.tooltipCaptionFontColor, tokenValues.tooltipCaptionDisabledFontColor, tokenValues.tooltipCaptionFontFamily, tokenValues.tooltipCaptionFontWeight, tokenValues.tooltipCaptionFontSize, tokenValues.tooltipCaptionFontLineHeight);
16571
+ 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);
16572
+ const [tableHeaderFont, tableHeaderFontColor] = createFontTokens(tokenNames.tableHeaderFont, tokenValues.tableHeaderFont, tokenValues.tableHeaderFontColor, tokenValues.tableHeaderDisabledFontColor, tokenValues.tableHeaderFontFamily, tokenValues.tableHeaderFontWeight, tokenValues.tableHeaderFontSize, tokenValues.tableHeaderFontLineHeight);
16573
+ createFontTokens(tokenNames.mentionFont, tokenValues.mentionFont, tokenValues.mentionFontColor, tokenValues.mentionDisabledFontColor, tokenValues.mentionFontFamily, tokenValues.mentionFontWeight, tokenValues.mentionFontSize, tokenValues.mentionFontLineHeight);
16574
+ // #endregion
16575
+ // #region text transform tokens
16576
+ const groupHeaderTextTransform = createStringToken(tokenNames.groupHeaderTextTransform, tokenValues.groupHeaderTextTransform);
16577
+ // #endregion
16578
+ // #region animation tokens
16579
+ const smallDelay = createStringToken(tokenNames.smallDelay, tokenValues.smallDelay);
16580
+ const mediumDelay = createStringToken(tokenNames.mediumDelay, tokenValues.mediumDelay);
16581
+ const largeDelay = createStringToken(tokenNames.largeDelay, tokenValues.largeDelay);
16582
+ // #endregion
16583
+ // #region helpers
16584
+ function createFontTokens(fontTokenName, font, fontColor, disabledFontColor, fontFamily, fontWeight, fontSize, fontLineHeight) {
16436
16585
  const fontNameParts = fontTokenName.split('-font');
16437
16586
  const tokenPrefixWithoutFont = fontNameParts[0];
16438
- if (tokenPrefixWithoutFont === undefined || fontNameParts[1] !== '') {
16439
- throw new Error(`fontTokenName value of ${fontTokenName} did not have the expected '-font' suffix`);
16440
- }
16441
- const fontColorToken = DesignToken.create(styleNameFromTokenName(`${tokenPrefixWithoutFont}-font-color`)).withDefault((element) => colorFunction(element));
16442
- const fontDisabledColorToken = DesignToken.create(styleNameFromTokenName(`${tokenPrefixWithoutFont}-disabled-font-color`)).withDefault((element) => disabledColorFunction(element));
16443
- const fontFamilyToken = DesignToken.create(styleNameFromTokenName(`${tokenPrefixWithoutFont}-font-family`)).withDefault(familyWithFallback);
16444
- const fontWeightToken = DesignToken.create(styleNameFromTokenName(`${tokenPrefixWithoutFont}-font-weight`)).withDefault(weight);
16445
- const fontSizeToken = DesignToken.create(styleNameFromTokenName(`${tokenPrefixWithoutFont}-font-size`)).withDefault(size);
16446
- const fontLineHeightToken = DesignToken.create(styleNameFromTokenName(`${tokenPrefixWithoutFont}-font-line-height`)).withDefault(lineHeight);
16587
+ const fontFamilyWithFallback = `${fontFamily}, ${fontFamily} Fallback`;
16588
+ const fontToken = createStringToken(fontTokenName, font);
16589
+ const fontColorToken = createThemeColorToken(`${tokenPrefixWithoutFont}-font-color`, fontColor);
16590
+ const fontDisabledColorToken = createThemeColorToken(`${tokenPrefixWithoutFont}-disabled-font-color`, disabledFontColor);
16591
+ const fontFamilyToken = createStringToken(`${tokenPrefixWithoutFont}-font-family`, fontFamilyWithFallback);
16592
+ const fontWeightToken = createStringToken(`${tokenPrefixWithoutFont}-font-weight`, fontWeight);
16593
+ const fontSizeToken = createStringToken(`${tokenPrefixWithoutFont}-font-size`, fontSize);
16594
+ const fontLineHeightToken = createStringToken(`${tokenPrefixWithoutFont}-font-line-height`, fontLineHeight);
16447
16595
  return [
16448
16596
  fontToken,
16449
16597
  fontColorToken,
@@ -16454,57 +16602,24 @@
16454
16602
  fontLineHeightToken
16455
16603
  ];
16456
16604
  }
16457
- function getColorForTheme(element, lightThemeColor, darkThemeColor, colorThemeColor) {
16458
- switch (theme.getValueFor(element)) {
16459
- case Theme.light:
16460
- return lightThemeColor;
16461
- case Theme.dark:
16462
- return darkThemeColor;
16463
- case Theme.color:
16464
- return colorThemeColor;
16465
- default:
16466
- return lightThemeColor;
16467
- }
16468
- }
16469
- function getWarningColorForTheme(element) {
16470
- return getColorForTheme(element, Warning100LightUi, Warning100DarkUi, White);
16471
- }
16472
- function getFailColorForTheme(element) {
16473
- return getColorForTheme(element, Fail100LightUi, Fail100DarkUi, White);
16474
- }
16475
- function getPassColorForTheme(element) {
16476
- return getColorForTheme(element, Pass100LightUi, Pass100DarkUi, White);
16477
- }
16478
- function getInformationColorForTheme(element) {
16479
- return getColorForTheme(element, Information100LightUi, Information100DarkUi, White);
16480
- }
16481
- function getDefaultLineColorForTheme(element) {
16482
- return getColorForTheme(element, Black91, Black15, White);
16483
- }
16484
- function getDefaultFontColorForTheme(element) {
16485
- return getColorForTheme(element, Black91, Black15, White);
16486
- }
16487
- function getFillSelectedColorForTheme(element) {
16488
- return getColorForTheme(element, DigitalGreenLight, PowerGreen, White);
16489
- }
16490
- function getFillHoverColorForTheme(element) {
16491
- return getColorForTheme(element, Black91, Black15, White);
16492
- }
16493
- function getFillDownColorForTheme(element) {
16494
- return getColorForTheme(element, Black91, Black15, White);
16495
- }
16496
- function getModalBackdropForTheme(element) {
16497
- switch (theme.getValueFor(element)) {
16498
- case Theme.light:
16499
- return hexToRgbaCssColor(Black, 0.3);
16500
- case Theme.dark:
16501
- return hexToRgbaCssColor(Black, 0.6);
16502
- case Theme.color:
16503
- return hexToRgbaCssColor(Black, 0.6);
16504
- default:
16505
- return hexToRgbaCssColor(Black, 0.3);
16506
- }
16605
+ function createStringToken(tokenName, tokenValue) {
16606
+ return DesignToken.create(styleNameFromTokenName(tokenName)).withDefault(tokenValue);
16607
+ }
16608
+ function createThemeColorToken(tokenName, themeColor) {
16609
+ return DesignToken.create(styleNameFromTokenName(tokenName)).withDefault((element) => {
16610
+ switch (theme.getValueFor(element)) {
16611
+ case Theme.light:
16612
+ return themeColor.light;
16613
+ case Theme.dark:
16614
+ return themeColor.dark;
16615
+ case Theme.color:
16616
+ return themeColor.color;
16617
+ default:
16618
+ return themeColor.light;
16619
+ }
16620
+ });
16507
16621
  }
16622
+ // #endregion
16508
16623
 
16509
16624
  const styles$14 = css `
16510
16625
  @layer base, hover, focusVisible, active, disabled;