@genesislcap/foundation-ui 14.291.2-alpha-04c16dc.0 → 14.293.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.
Files changed (26) hide show
  1. package/dist/custom-elements.json +1743 -1147
  2. package/dist/dts/base-components.d.ts +4 -6
  3. package/dist/dts/base-components.d.ts.map +1 -1
  4. package/dist/dts/environment-indicator/environment-indicator.d.ts +143 -0
  5. package/dist/dts/environment-indicator/environment-indicator.d.ts.map +1 -0
  6. package/dist/dts/environment-indicator/environment-indicator.styles.d.ts +2 -0
  7. package/dist/dts/environment-indicator/environment-indicator.styles.d.ts.map +1 -0
  8. package/dist/dts/environment-indicator/environment-indicator.template.d.ts +3 -0
  9. package/dist/dts/environment-indicator/environment-indicator.template.d.ts.map +1 -0
  10. package/dist/dts/environment-indicator/index.d.ts +5 -0
  11. package/dist/dts/environment-indicator/index.d.ts.map +1 -0
  12. package/dist/dts/environment-indicator/utils/configure.d.ts +3 -0
  13. package/dist/dts/environment-indicator/utils/configure.d.ts.map +1 -0
  14. package/dist/dts/environment-indicator/utils/logger.d.ts +2 -0
  15. package/dist/dts/environment-indicator/utils/logger.d.ts.map +1 -0
  16. package/dist/dts/index.d.ts +1 -0
  17. package/dist/dts/index.d.ts.map +1 -1
  18. package/dist/esm/base-components.js +2 -2
  19. package/dist/esm/environment-indicator/environment-indicator.js +224 -0
  20. package/dist/esm/environment-indicator/environment-indicator.styles.js +29 -0
  21. package/dist/esm/environment-indicator/environment-indicator.template.js +29 -0
  22. package/dist/esm/environment-indicator/index.js +4 -0
  23. package/dist/esm/environment-indicator/utils/configure.js +14 -0
  24. package/dist/esm/environment-indicator/utils/logger.js +2 -0
  25. package/dist/esm/index.js +1 -0
  26. package/package.json +18 -18
@@ -282,17 +282,15 @@ export declare const baseComponents: {
282
282
  styles: import("@microsoft/fast-element").ElementStyles;
283
283
  template: import("@microsoft/fast-element").ViewTemplate<import("./status-pill").StatusPill, any>;
284
284
  }, typeof import("./status-pill").StatusPill>;
285
- foundationStepper: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<{
285
+ foundationEnvironmentIndicator: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<{
286
286
  baseName: string;
287
- template: import("@microsoft/fast-element").ViewTemplate<import("./stepper").Stepper, any>;
287
+ template: import("@microsoft/fast-element").ViewTemplate<import("./environment-indicator").EnvironmentIndicator, any>;
288
288
  styles: import("@microsoft/fast-element").ElementStyles;
289
- shadowOptions: ShadowRootInit;
290
289
  }>) => import("@microsoft/fast-foundation").FoundationElementRegistry<{
291
290
  baseName: string;
292
- template: import("@microsoft/fast-element").ViewTemplate<import("./stepper").Stepper, any>;
291
+ template: import("@microsoft/fast-element").ViewTemplate<import("./environment-indicator").EnvironmentIndicator, any>;
293
292
  styles: import("@microsoft/fast-element").ElementStyles;
294
- shadowOptions: ShadowRootInit;
295
- }, typeof import("./stepper").Stepper>;
293
+ }, typeof import("./environment-indicator").EnvironmentIndicator>;
296
294
  foundationStepperTab: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<import("@microsoft/fast-foundation").FoundationElementDefinition>) => import("@microsoft/fast-foundation").FoundationElementRegistry<import("@microsoft/fast-foundation").FoundationElementDefinition, typeof import("./stepper-tab").StepperTab>;
297
295
  foundationStepperTabPanel: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<{
298
296
  baseName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"base-components.d.ts","sourceRoot":"","sources":["../../src/base-components.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAmF5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAmFJ,SAAS,WAAW,GAAG,EAAE;CAe/C,CAAC"}
1
+ {"version":3,"file":"base-components.d.ts","sourceRoot":"","sources":["../../src/base-components.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAmF5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAmFJ,SAAS,WAAW,GAAG,EAAE;CAe/C,CAAC"}
@@ -0,0 +1,143 @@
1
+ import { FoundationElement } from '@microsoft/fast-foundation';
2
+ import { FaSize } from '../icon';
3
+ /**
4
+ * Environment configuration interface
5
+ * @public
6
+ */
7
+ export interface EnvironmentConfig {
8
+ /**
9
+ * The environment level
10
+ */
11
+ level: string;
12
+ /**
13
+ * Whether to show an icon for this environment
14
+ */
15
+ showIcon?: boolean;
16
+ /**
17
+ * The icon name to use
18
+ * Valid values are from the free set of font awesome icons which can be found here https://fontawesome.com/search?ic=free
19
+ */
20
+ icon?: string;
21
+ /**
22
+ * The size of the icon
23
+ */
24
+ iconSize?: FaSize;
25
+ /**
26
+ * The background color for this environment
27
+ */
28
+ backgroundColor?: string;
29
+ /**
30
+ * The text color for this environment
31
+ */
32
+ textColor?: string;
33
+ /**
34
+ * The size of the indicator
35
+ */
36
+ size?: 'sm' | 'lg';
37
+ /**
38
+ * The label to display
39
+ */
40
+ label?: string;
41
+ }
42
+ /**
43
+ * Default environment level configuration
44
+ */
45
+ export declare const DEFAULT_ENVIRONMENT_LEVEL_CONFIG: EnvironmentConfig;
46
+ /**
47
+ * Environment indicator configuration interface
48
+ * @public
49
+ */
50
+ export interface EnvironmentIndicatorConfig {
51
+ currentLevel?: typeof this.level;
52
+ configs: EnvironmentConfig[];
53
+ }
54
+ /**
55
+ * EnvironmentConfigs DI token.
56
+ * @public
57
+ */
58
+ export declare const EnvironmentIndicatorConfigToken: import("@microsoft/fast-foundation").InterfaceSymbol<EnvironmentIndicatorConfig>;
59
+ /**
60
+ * @tagname %%prefix%%-environment-indicator
61
+ * @description Displays an environment indicator with a label and an icon
62
+ * @public
63
+ */
64
+ export declare class EnvironmentIndicator extends FoundationElement {
65
+ /**
66
+ * @attr level - the environment level to display
67
+ */
68
+ level: string;
69
+ /**
70
+ * @attr label - the label to display
71
+ */
72
+ label: string;
73
+ /**
74
+ * @attr show-icon - whether to show an icon next to the environment text
75
+ */
76
+ showIcon: boolean;
77
+ /**
78
+ * @attr size - the size of the indicator. Can be 'sm' or 'lg'
79
+ */
80
+ size: 'sm' | 'lg';
81
+ /**
82
+ * @attr background-color - the background color of the indicator
83
+ */
84
+ backgroundColor: string;
85
+ /**
86
+ * @attr text-color - the text color of the indicator
87
+ */
88
+ textColor: string;
89
+ /**
90
+ * @attr icon - the icon to display
91
+ */
92
+ icon: string;
93
+ /**
94
+ * @attr icon-size - the size of the icon
95
+ */
96
+ iconSize: FaSize;
97
+ /**
98
+ * Current environment configuration
99
+ */
100
+ config: EnvironmentConfig;
101
+ /**
102
+ * Environment configurations
103
+ */
104
+ envConfigs: EnvironmentConfig[];
105
+ envConfigsChanged(): void;
106
+ /**
107
+ * Helper function to get config from attributes
108
+ * @returns the config from attributes
109
+ */
110
+ private getAttributesConfig;
111
+ /**
112
+ * Get the current environment level based on priority order
113
+ */
114
+ private getCurrentEnvironmentLevel;
115
+ getEnvConfigByLevel(): EnvironmentConfig;
116
+ connectedCallback(): void;
117
+ /**
118
+ * Handle config change when attributes change
119
+ */
120
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
121
+ /**
122
+ * Set environment configurations
123
+ * @param envConfigs - the environment configurations
124
+ */
125
+ setEnvConfigs(envConfigs: EnvironmentConfig[]): void;
126
+ }
127
+ /**
128
+ * The Foundation Environment indicator
129
+ *
130
+ * @public
131
+ * @remarks
132
+ * HTML Element: \<foundation-environment-indicator\>
133
+ */
134
+ export declare const foundationEnvironmentIndicator: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<{
135
+ baseName: string;
136
+ template: import("@microsoft/fast-element").ViewTemplate<EnvironmentIndicator, any>;
137
+ styles: import("@microsoft/fast-element").ElementStyles;
138
+ }>) => import("@microsoft/fast-foundation").FoundationElementRegistry<{
139
+ baseName: string;
140
+ template: import("@microsoft/fast-element").ViewTemplate<EnvironmentIndicator, any>;
141
+ styles: import("@microsoft/fast-element").ElementStyles;
142
+ }, typeof EnvironmentIndicator>;
143
+ //# sourceMappingURL=environment-indicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-indicator.d.ts","sourceRoot":"","sources":["../../../src/environment-indicator/environment-indicator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAM,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAKjC;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;I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,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAmBzE;;;OAGG;IACH,aAAa,CAAC,UAAU,EAAE,iBAAiB,EAAE;CAG9C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;+BAIzC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const environmentIndicatorStyles: import("@microsoft/fast-element").ElementStyles;
2
+ //# sourceMappingURL=environment-indicator.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-indicator.styles.d.ts","sourceRoot":"","sources":["../../../src/environment-indicator/environment-indicator.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,iDA2BtC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { EnvironmentIndicator } from './environment-indicator';
2
+ export declare const foundationEnvironmentIndicatorTemplate: import("@microsoft/fast-element").ViewTemplate<EnvironmentIndicator, any>;
3
+ //# sourceMappingURL=environment-indicator.template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-indicator.template.d.ts","sourceRoot":"","sources":["../../../src/environment-indicator/environment-indicator.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAkCpE,eAAO,MAAM,sCAAsC,2EAElD,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './environment-indicator';
2
+ export * from './environment-indicator.styles';
3
+ export * from './environment-indicator.template';
4
+ export { configureEnvironmentIndicator } from './utils/configure';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/environment-indicator/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { EnvironmentIndicatorConfig } from '../environment-indicator';
2
+ export declare function configureEnvironmentIndicator(options?: EnvironmentIndicatorConfig): Promise<void>;
3
+ //# sourceMappingURL=configure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/environment-indicator/utils/configure.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAM3E,wBAAsB,6BAA6B,CACjD,OAAO,GAAE,0BAA4C,iBAYtD"}
@@ -0,0 +1,2 @@
1
+ export declare const environmentIndicatorLogger: import("@genesislcap/foundation-logger").Logger;
2
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/environment-indicator/utils/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,iDAAuC,CAAC"}
@@ -32,6 +32,7 @@ export * from './dialog';
32
32
  export * from './disclosure';
33
33
  export * from './divider';
34
34
  export * from './dropdown-menu';
35
+ export * from './environment-indicator';
35
36
  export * from './error-banner';
36
37
  export * from './error-boundary';
37
38
  export * from './error-dialog';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,CAAC;AAExE,eAAO,MAAM,8BAA8B,yDAAuD,CAAC;AAEnG,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;A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,CAAC"}
@@ -25,6 +25,7 @@ import { foundationDialog } from './dialog';
25
25
  import { foundationDisclosure } from './disclosure';
26
26
  import { foundationDivider } from './divider';
27
27
  import { foundationDropdownMenu } from './dropdown-menu';
28
+ import { foundationEnvironmentIndicator } from './environment-indicator';
28
29
  import { foundationErrorBanner } from './error-banner';
29
30
  import { foundationErrorBoundary } from './error-boundary';
30
31
  import { foundationErrorDialog } from './error-dialog';
@@ -65,7 +66,6 @@ import { foundationSliderLabel } from './slider-label';
65
66
  import { foundationSnackbar } from './snackbar';
66
67
  import { foundationStackingIcons } from './stacking-icons';
67
68
  import { foundationStatusPill } from './status-pill';
68
- import { foundationStepper } from './stepper';
69
69
  import { foundationStepperTab } from './stepper-tab';
70
70
  import { foundationStepperTabPanel } from './stepper-tab-panel';
71
71
  import { foundationSwitch } from './switch';
@@ -147,7 +147,7 @@ export const baseComponents = {
147
147
  foundationSnackbar,
148
148
  foundationStackingIcons,
149
149
  foundationStatusPill,
150
- foundationStepper,
150
+ foundationEnvironmentIndicator,
151
151
  foundationStepperTab,
152
152
  foundationStepperTabPanel,
153
153
  foundationSwitch,
@@ -0,0 +1,224 @@
1
+ import { __decorate } from "tslib";
2
+ import { ENVIRONMENT_LEVEL } from '@genesislcap/foundation-utils';
3
+ import { attr, observable } from '@microsoft/fast-element';
4
+ import { DI, FoundationElement } from '@microsoft/fast-foundation';
5
+ import { environmentIndicatorStyles as styles } from './environment-indicator.styles';
6
+ import { foundationEnvironmentIndicatorTemplate as template } from './environment-indicator.template';
7
+ import { environmentIndicatorLogger } from './utils/logger';
8
+ /**
9
+ * Default environment level
10
+ */
11
+ const DEFAULT_ENVIRONMENT_LEVEL = 'default';
12
+ /**
13
+ * Default environment level configuration
14
+ */
15
+ export const DEFAULT_ENVIRONMENT_LEVEL_CONFIG = {
16
+ level: DEFAULT_ENVIRONMENT_LEVEL,
17
+ showIcon: false,
18
+ iconSize: 'sm',
19
+ backgroundColor: '#2222ff',
20
+ textColor: '#ffffff',
21
+ label: 'DEFAULT',
22
+ };
23
+ /**
24
+ * Default environment configurations
25
+ */
26
+ const DEFAULT_ENVIRONMENT_CONFIGS = [
27
+ DEFAULT_ENVIRONMENT_LEVEL_CONFIG,
28
+ {
29
+ level: 'dev',
30
+ showIcon: false,
31
+ icon: 'code',
32
+ backgroundColor: '#ff6b35',
33
+ label: 'DEV',
34
+ },
35
+ {
36
+ level: 'prod',
37
+ showIcon: false,
38
+ icon: 'check-circle',
39
+ backgroundColor: '#28a745',
40
+ label: 'PROD',
41
+ },
42
+ ];
43
+ /**
44
+ * EnvironmentConfigs DI token.
45
+ * @public
46
+ */
47
+ export const EnvironmentIndicatorConfigToken = DI.createInterface((x) => x.instance({ configs: [] }), (configurator) => configurator.instance({ configs: [] }));
48
+ /**
49
+ * @tagname %%prefix%%-environment-indicator
50
+ * @description Displays an environment indicator with a label and an icon
51
+ * @public
52
+ */
53
+ export class EnvironmentIndicator extends FoundationElement {
54
+ constructor() {
55
+ super(...arguments);
56
+ /**
57
+ * @attr size - the size of the indicator. Can be 'sm' or 'lg'
58
+ */
59
+ this.size = 'sm';
60
+ /**
61
+ * @attr text-color - the text color of the indicator
62
+ */
63
+ this.textColor = '#ffffff';
64
+ /**
65
+ * @attr icon - the icon to display
66
+ */
67
+ this.icon = 'check-circle';
68
+ /**
69
+ * @attr icon-size - the size of the icon
70
+ */
71
+ this.iconSize = 'sm';
72
+ /**
73
+ * Current environment configuration
74
+ */
75
+ this.config = DEFAULT_ENVIRONMENT_LEVEL_CONFIG;
76
+ /**
77
+ * Environment configurations
78
+ */
79
+ this.envConfigs = DEFAULT_ENVIRONMENT_CONFIGS;
80
+ }
81
+ envConfigsChanged() {
82
+ this.config = this.getEnvConfigByLevel();
83
+ }
84
+ /**
85
+ * Helper function to get config from attributes
86
+ * @returns the config from attributes
87
+ */
88
+ getAttributesConfig() {
89
+ const configFromAttributes = {};
90
+ ['label', 'size', 'showIcon', 'icon', 'iconSize', 'backgroundColor', 'textColor']
91
+ .filter((key) => !!this[key])
92
+ .forEach((key) => {
93
+ configFromAttributes[key] = this[key];
94
+ });
95
+ return configFromAttributes || {};
96
+ }
97
+ /**
98
+ * Get the current environment level based on priority order
99
+ */
100
+ getCurrentEnvironmentLevel() {
101
+ // 1. Check if level is set via attribute
102
+ if (this.level) {
103
+ return this.level;
104
+ }
105
+ // 2. Check current config level
106
+ if (this.config && this.config.level && this.config.level !== DEFAULT_ENVIRONMENT_LEVEL) {
107
+ return this.config.level;
108
+ }
109
+ // 3. Check DI configuration
110
+ try {
111
+ const container = DI.getOrCreateDOMContainer();
112
+ const { currentLevel } = container.get(EnvironmentIndicatorConfigToken);
113
+ if (currentLevel) {
114
+ return currentLevel;
115
+ }
116
+ }
117
+ catch (error) {
118
+ environmentIndicatorLogger.error(error);
119
+ }
120
+ // 4. Return environment variable or return default
121
+ return ENVIRONMENT_LEVEL || DEFAULT_ENVIRONMENT_LEVEL;
122
+ }
123
+ getEnvConfigByLevel() {
124
+ const attributesConfig = this.getAttributesConfig();
125
+ const currentLevel = this.getCurrentEnvironmentLevel();
126
+ // If label is set, use attributes as config with current level
127
+ if (this.label) {
128
+ return Object.assign(Object.assign(Object.assign({}, DEFAULT_ENVIRONMENT_LEVEL_CONFIG), { level: currentLevel }), attributesConfig);
129
+ }
130
+ // Try to find config for current level in DI container first
131
+ try {
132
+ const container = DI.getOrCreateDOMContainer();
133
+ const { configs } = container.get(EnvironmentIndicatorConfigToken) || {};
134
+ if (configs && configs.length > 0) {
135
+ const config = configs.find(({ level }) => level === currentLevel);
136
+ if (config) {
137
+ return Object.assign(Object.assign({}, config), attributesConfig);
138
+ }
139
+ }
140
+ }
141
+ catch (error) {
142
+ environmentIndicatorLogger.error(error);
143
+ }
144
+ // Try to find config in envConfigs
145
+ const envConfig = this.envConfigs.find(({ level }) => level === currentLevel);
146
+ // If no env config found, return default config with current level
147
+ if (!envConfig) {
148
+ return Object.assign(Object.assign(Object.assign({}, DEFAULT_ENVIRONMENT_LEVEL_CONFIG), { level: currentLevel }), attributesConfig);
149
+ }
150
+ return Object.assign(Object.assign({}, envConfig), attributesConfig);
151
+ }
152
+ connectedCallback() {
153
+ super.connectedCallback();
154
+ this.config = this.getEnvConfigByLevel();
155
+ }
156
+ /**
157
+ * Handle config change when attributes change
158
+ */
159
+ attributeChangedCallback(name, oldValue, newValue) {
160
+ super.attributeChangedCallback(name, oldValue, newValue);
161
+ const watchedAttributes = [
162
+ 'level',
163
+ 'label',
164
+ 'show-icon',
165
+ 'icon-size',
166
+ 'size',
167
+ 'background-color',
168
+ 'text-color',
169
+ 'icon',
170
+ ];
171
+ if (watchedAttributes.includes(name) && oldValue !== newValue) {
172
+ this.config = this.getEnvConfigByLevel();
173
+ }
174
+ }
175
+ /**
176
+ * Set environment configurations
177
+ * @param envConfigs - the environment configurations
178
+ */
179
+ setEnvConfigs(envConfigs) {
180
+ this.envConfigs = envConfigs;
181
+ }
182
+ }
183
+ __decorate([
184
+ attr
185
+ ], EnvironmentIndicator.prototype, "level", void 0);
186
+ __decorate([
187
+ attr
188
+ ], EnvironmentIndicator.prototype, "label", void 0);
189
+ __decorate([
190
+ attr({ mode: 'boolean', attribute: 'show-icon' })
191
+ ], EnvironmentIndicator.prototype, "showIcon", void 0);
192
+ __decorate([
193
+ attr
194
+ ], EnvironmentIndicator.prototype, "size", void 0);
195
+ __decorate([
196
+ attr({ attribute: 'background-color' })
197
+ ], EnvironmentIndicator.prototype, "backgroundColor", void 0);
198
+ __decorate([
199
+ attr({ attribute: 'text-color' })
200
+ ], EnvironmentIndicator.prototype, "textColor", void 0);
201
+ __decorate([
202
+ attr
203
+ ], EnvironmentIndicator.prototype, "icon", void 0);
204
+ __decorate([
205
+ attr({ attribute: 'icon-size' })
206
+ ], EnvironmentIndicator.prototype, "iconSize", void 0);
207
+ __decorate([
208
+ observable
209
+ ], EnvironmentIndicator.prototype, "config", void 0);
210
+ __decorate([
211
+ observable
212
+ ], EnvironmentIndicator.prototype, "envConfigs", void 0);
213
+ /**
214
+ * The Foundation Environment indicator
215
+ *
216
+ * @public
217
+ * @remarks
218
+ * HTML Element: \<foundation-environment-indicator\>
219
+ */
220
+ export const foundationEnvironmentIndicator = EnvironmentIndicator.compose({
221
+ baseName: 'environment-indicator',
222
+ template,
223
+ styles,
224
+ });
@@ -0,0 +1,29 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ export const environmentIndicatorStyles = css `
3
+ .environment-indicator {
4
+ font-size: 12px;
5
+ display: inline-flex;
6
+ align-items: center;
7
+ gap: calc(var(--design-unit) * 1.4px);
8
+ border-radius: calc(var(--design-unit) * 1px);
9
+ height: calc(var(--design-unit) * 6px);
10
+ padding: calc(var(--design-unit) * 0.5px) calc(var(--design-unit) * 2px);
11
+ line-height: 1;
12
+ font-weight: 600;
13
+ text-transform: uppercase;
14
+ }
15
+
16
+ .environment-indicator.lg {
17
+ border-radius: calc(var(--design-unit) * 4px);
18
+ padding: calc(var(--design-unit) * 1px) calc(var(--design-unit) * 3.5px);
19
+ font-size: calc(var(--design-unit) * 4px);
20
+ }
21
+
22
+ .environment-indicator .icon {
23
+ font-size: calc(var(--design-unit) * 3px);
24
+ }
25
+
26
+ .environment-indicator.lg .icon {
27
+ font-size: calc(var(--design-unit) * 3.5px);
28
+ }
29
+ `;
@@ -0,0 +1,29 @@
1
+ import { html, when } from '@microsoft/fast-element';
2
+ import { getPrefix } from '../utils';
3
+ const getPrefixedEnvironmentIndicatorTemplate = (prefix) => html `
4
+ ${when((x) => x.config, html `
5
+ <div
6
+ data-test-id="environment-indicator"
7
+ part="environment-indicator"
8
+ class="environment-indicator ${({ config }) => config.size}"
9
+ style="${({ config }) => `color: ${config.textColor}; background: ${config.backgroundColor}`}"
10
+ aria-label="Environment indicator: ${({ config }) => config.label}"
11
+ title="Environment: ${({ config }) => config.label}"
12
+ >
13
+ ${when(({ config }) => config.showIcon && config.icon, html `
14
+ <${prefix}-icon
15
+ name="${({ config }) => config.icon}"
16
+ size="${({ config }) => config.iconSize}"
17
+ aria-hidden="true"
18
+ class="icon"
19
+ ></${prefix}-icon>
20
+ `)}
21
+ <span data-test-id="environment-indicator-text" aria-label="Environment label">
22
+ ${({ config }) => config.label}
23
+ </span>
24
+ </div>
25
+ `)}
26
+ `;
27
+ export const foundationEnvironmentIndicatorTemplate = html `
28
+ ${(x) => getPrefixedEnvironmentIndicatorTemplate(getPrefix(x))}
29
+ `;
@@ -0,0 +1,4 @@
1
+ export * from './environment-indicator';
2
+ export * from './environment-indicator.styles';
3
+ export * from './environment-indicator.template';
4
+ export { configureEnvironmentIndicator } from './utils/configure';
@@ -0,0 +1,14 @@
1
+ import { __awaiter } from "tslib";
2
+ import { DI, Registration } from '@microsoft/fast-foundation';
3
+ import { DEFAULT_ENVIRONMENT_LEVEL_CONFIG, EnvironmentIndicatorConfigToken, } from '../environment-indicator';
4
+ export function configureEnvironmentIndicator(options = { configs: [] }) {
5
+ return __awaiter(this, void 0, void 0, function* () {
6
+ const { configs, currentLevel } = options;
7
+ const value = {
8
+ currentLevel,
9
+ configs: configs && configs.length > 0 ? configs : [DEFAULT_ENVIRONMENT_LEVEL_CONFIG],
10
+ };
11
+ const container = DI.getOrCreateDOMContainer();
12
+ container.register(Registration.instance(EnvironmentIndicatorConfigToken, value));
13
+ });
14
+ }
@@ -0,0 +1,2 @@
1
+ import { createLogger } from '@genesislcap/foundation-logger';
2
+ export const environmentIndicatorLogger = createLogger('EnvironmentIndicator');
package/dist/esm/index.js CHANGED
@@ -32,6 +32,7 @@ export * from './dialog';
32
32
  export * from './disclosure';
33
33
  export * from './divider';
34
34
  export * from './dropdown-menu';
35
+ export * from './environment-indicator';
35
36
  export * from './error-banner';
36
37
  export * from './error-boundary';
37
38
  export * from './error-dialog';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-ui",
3
3
  "description": "Genesis Foundation UI",
4
- "version": "14.291.2-alpha-04c16dc.0",
4
+ "version": "14.293.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -83,13 +83,13 @@
83
83
  }
84
84
  },
85
85
  "devDependencies": {
86
- "@genesislcap/foundation-testing": "14.291.2-alpha-04c16dc.0",
87
- "@genesislcap/genx": "14.291.2-alpha-04c16dc.0",
88
- "@genesislcap/rollup-builder": "14.291.2-alpha-04c16dc.0",
89
- "@genesislcap/ts-builder": "14.291.2-alpha-04c16dc.0",
90
- "@genesislcap/uvu-playwright-builder": "14.291.2-alpha-04c16dc.0",
91
- "@genesislcap/vite-builder": "14.291.2-alpha-04c16dc.0",
92
- "@genesislcap/webpack-builder": "14.291.2-alpha-04c16dc.0",
86
+ "@genesislcap/foundation-testing": "14.293.0",
87
+ "@genesislcap/genx": "14.293.0",
88
+ "@genesislcap/rollup-builder": "14.293.0",
89
+ "@genesislcap/ts-builder": "14.293.0",
90
+ "@genesislcap/uvu-playwright-builder": "14.293.0",
91
+ "@genesislcap/vite-builder": "14.293.0",
92
+ "@genesislcap/webpack-builder": "14.293.0",
93
93
  "copyfiles": "^2.4.1",
94
94
  "rimraf": "^5.0.0",
95
95
  "rxjs": "^7.5.4"
@@ -100,15 +100,15 @@
100
100
  "@fortawesome/free-regular-svg-icons": "^6.2.1",
101
101
  "@fortawesome/free-solid-svg-icons": "^6.2.1",
102
102
  "@genesiscommunitysuccess/analyzer-import-alias-plugin": "^5.0.3",
103
- "@genesislcap/expression-builder": "14.291.2-alpha-04c16dc.0",
104
- "@genesislcap/foundation-comms": "14.291.2-alpha-04c16dc.0",
105
- "@genesislcap/foundation-criteria": "14.291.2-alpha-04c16dc.0",
106
- "@genesislcap/foundation-errors": "14.291.2-alpha-04c16dc.0",
107
- "@genesislcap/foundation-events": "14.291.2-alpha-04c16dc.0",
108
- "@genesislcap/foundation-logger": "14.291.2-alpha-04c16dc.0",
109
- "@genesislcap/foundation-notifications": "14.291.2-alpha-04c16dc.0",
110
- "@genesislcap/foundation-user": "14.291.2-alpha-04c16dc.0",
111
- "@genesislcap/foundation-utils": "14.291.2-alpha-04c16dc.0",
103
+ "@genesislcap/expression-builder": "14.293.0",
104
+ "@genesislcap/foundation-comms": "14.293.0",
105
+ "@genesislcap/foundation-criteria": "14.293.0",
106
+ "@genesislcap/foundation-errors": "14.293.0",
107
+ "@genesislcap/foundation-events": "14.293.0",
108
+ "@genesislcap/foundation-logger": "14.293.0",
109
+ "@genesislcap/foundation-notifications": "14.293.0",
110
+ "@genesislcap/foundation-user": "14.293.0",
111
+ "@genesislcap/foundation-utils": "14.293.0",
112
112
  "@microsoft/fast-colors": "5.3.1",
113
113
  "@microsoft/fast-components": "2.30.6",
114
114
  "@microsoft/fast-element": "1.14.0",
@@ -130,5 +130,5 @@
130
130
  "access": "public"
131
131
  },
132
132
  "customElements": "dist/custom-elements.json",
133
- "gitHead": "c253109953075d5847d96ad1f7f2ca3d98d6af72"
133
+ "gitHead": "0e7819599e7be45c7ab25a916124a47278707c12"
134
134
  }