@genesislcap/foundation-ui 14.285.0 → 14.285.2-alpha-a57a535.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 +793 -260
  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 +117 -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 +197 -0
  20. package/dist/esm/environment-indicator/environment-indicator.styles.js +29 -0
  21. package/dist/esm/environment-indicator/environment-indicator.template.js +28 -0
  22. package/dist/esm/environment-indicator/index.js +4 -0
  23. package/dist/esm/environment-indicator/utils/configure.js +10 -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,117 @@
1
+ import { FoundationElement } from '@microsoft/fast-foundation';
2
+ /**
3
+ * Environment configuration interface
4
+ * @public
5
+ */
6
+ export interface EnvironmentConfig {
7
+ /**
8
+ * The environment level
9
+ */
10
+ level: string;
11
+ /**
12
+ * Whether to show an icon for this environment
13
+ */
14
+ showIcon?: boolean;
15
+ /**
16
+ * The icon name to use
17
+ */
18
+ icon?: string;
19
+ /**
20
+ * The background color for this environment
21
+ */
22
+ backgroundColor?: string;
23
+ /**
24
+ * The text color for this environment
25
+ */
26
+ textColor?: string;
27
+ /**
28
+ * The size of the indicator
29
+ */
30
+ size?: 'sm' | 'lg';
31
+ /**
32
+ * The label to display
33
+ */
34
+ label?: string;
35
+ }
36
+ /**
37
+ * Default environment level configuration
38
+ */
39
+ export declare const DEFAULT_ENVIRONMENT_LEVEL_CONFIG: EnvironmentConfig;
40
+ /**
41
+ * EnvironmentConfigs DI token.
42
+ * @public
43
+ */
44
+ export declare const EnvironmentConfigs: import("@microsoft/fast-foundation").InterfaceSymbol<EnvironmentConfig[]>;
45
+ /**
46
+ * @tagname %%prefix%%-environment-indicator
47
+ * @description Displays an environment indicator with a label and an icon
48
+ * @public
49
+ */
50
+ export declare class EnvironmentIndicator extends FoundationElement {
51
+ /**
52
+ * @attr label - the label to display
53
+ */
54
+ label: string;
55
+ /**
56
+ * @attr show-icon - whether to show an icon next to the environment text
57
+ */
58
+ showIcon: boolean;
59
+ /**
60
+ * @attr size - the size of the indicator. Can be 'sm' or 'lg'
61
+ */
62
+ size: 'sm' | 'lg';
63
+ /**
64
+ * @attr background-color - the background color of the indicator
65
+ */
66
+ backgroundColor: string;
67
+ /**
68
+ * @attr text-color - the text color of the indicator
69
+ */
70
+ textColor: string;
71
+ /**
72
+ * @attr icon - the icon to display
73
+ */
74
+ icon: string;
75
+ /**
76
+ * Current environment configuration
77
+ */
78
+ config: EnvironmentConfig;
79
+ /**
80
+ * Environment configurations
81
+ */
82
+ envConfigs: EnvironmentConfig[];
83
+ envConfigsChanged(): void;
84
+ /**
85
+ * Helper function to get config from attributes
86
+ * @returns the config from attributes
87
+ */
88
+ private getAttributesConfig;
89
+ getEnvConfigByLevel(): EnvironmentConfig;
90
+ connectedCallback(): void;
91
+ /**
92
+ * Handle config change when attributes change
93
+ */
94
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
95
+ /**
96
+ * Set environment configurations
97
+ * @param envConfigs - the environment configurations
98
+ */
99
+ setEnvConfigs(envConfigs: EnvironmentConfig[]): void;
100
+ }
101
+ /**
102
+ * The Foundation Environment indicator
103
+ *
104
+ * @public
105
+ * @remarks
106
+ * HTML Element: \<foundation-environment-indicator\>
107
+ */
108
+ export declare const foundationEnvironmentIndicator: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<{
109
+ baseName: string;
110
+ template: import("@microsoft/fast-element").ViewTemplate<EnvironmentIndicator, any>;
111
+ styles: import("@microsoft/fast-element").ElementStyles;
112
+ }>) => import("@microsoft/fast-foundation").FoundationElementRegistry<{
113
+ baseName: string;
114
+ template: import("@microsoft/fast-element").ViewTemplate<EnvironmentIndicator, any>;
115
+ styles: import("@microsoft/fast-element").ElementStyles;
116
+ }, typeof EnvironmentIndicator>;
117
+ //# 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;AAKnE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAOD;;GAEG;AACH,eAAO,MAAM,gCAAgC,EAAE,iBAM9C,CAAC;AAsCF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,2EAG9B,CAAC;AAEF;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD;;OAEG;IACG,KAAK,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACgD,QAAQ,EAAE,OAAO,CAAC;IAErE;;OAEG;IACG,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IACsC,eAAe,EAAE,MAAM,CAAC;IAEjE;;OAEG;IACgC,SAAS,EAAE,MAAM,CAAa;IAEjE;;OAEG;IACG,IAAI,EAAE,MAAM,CAAkB;IAEpC;;OAEG;IACS,MAAM,EAAE,iBAAiB,CAAoC;IAEzE;;OAEG;IACS,UAAU,EAAE,iBAAiB,EAAE,CAA+B;IAC1E,iBAAiB;IAIjB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAU3B,mBAAmB,IAAI,iBAAiB;IAsCxC,iBAAiB;IAKjB;;OAEG;IACH,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAiBzE;;;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;AAiCpE,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 { EnvironmentConfig } from '../environment-indicator';
2
+ export declare function configureEnvironmentIndicator(config: Partial<EnvironmentConfig[]>): 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,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,wBAAsB,6BAA6B,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,EAAE,CAAC,iBAMvF"}
@@ -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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AAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,SAAS,IAAI,qBAAqB,EAAE,MAAM,aAAa,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,197 @@
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
+ backgroundColor: '#2222ff',
19
+ textColor: '#ffffff',
20
+ label: 'DEFAULT',
21
+ };
22
+ /**
23
+ * Default environment configurations
24
+ */
25
+ const DEFAULT_ENVIRONMENT_CONFIGS = [
26
+ DEFAULT_ENVIRONMENT_LEVEL_CONFIG,
27
+ {
28
+ level: 'dev',
29
+ showIcon: false,
30
+ icon: 'code',
31
+ backgroundColor: '#ff6b35',
32
+ label: 'DEV',
33
+ },
34
+ {
35
+ level: 'staging',
36
+ showIcon: false,
37
+ icon: 'flask',
38
+ backgroundColor: '#ffd700',
39
+ textColor: '#000000',
40
+ label: 'STAGING',
41
+ },
42
+ {
43
+ level: 'prod',
44
+ showIcon: false,
45
+ icon: 'check-circle',
46
+ backgroundColor: '#28a745',
47
+ label: 'PROD',
48
+ },
49
+ {
50
+ level: 'test',
51
+ showIcon: false,
52
+ icon: 'vial',
53
+ backgroundColor: '#17a2b8',
54
+ label: 'TEST',
55
+ },
56
+ ];
57
+ /**
58
+ * EnvironmentConfigs DI token.
59
+ * @public
60
+ */
61
+ export const EnvironmentConfigs = DI.createInterface((x) => x.instance([]), (configurator) => configurator.instance([]));
62
+ /**
63
+ * @tagname %%prefix%%-environment-indicator
64
+ * @description Displays an environment indicator with a label and an icon
65
+ * @public
66
+ */
67
+ export class EnvironmentIndicator extends FoundationElement {
68
+ constructor() {
69
+ super(...arguments);
70
+ /**
71
+ * @attr size - the size of the indicator. Can be 'sm' or 'lg'
72
+ */
73
+ this.size = 'sm';
74
+ /**
75
+ * @attr text-color - the text color of the indicator
76
+ */
77
+ this.textColor = '#ffffff';
78
+ /**
79
+ * @attr icon - the icon to display
80
+ */
81
+ this.icon = 'check-circle';
82
+ /**
83
+ * Current environment configuration
84
+ */
85
+ this.config = DEFAULT_ENVIRONMENT_LEVEL_CONFIG;
86
+ /**
87
+ * Environment configurations
88
+ */
89
+ this.envConfigs = DEFAULT_ENVIRONMENT_CONFIGS;
90
+ }
91
+ envConfigsChanged() {
92
+ this.config = this.getEnvConfigByLevel();
93
+ }
94
+ /**
95
+ * Helper function to get config from attributes
96
+ * @returns the config from attributes
97
+ */
98
+ getAttributesConfig() {
99
+ const configFromAttributes = {};
100
+ ['label', 'size', 'showIcon', 'icon', 'backgroundColor', 'textColor']
101
+ .filter((key) => !!this[key])
102
+ .forEach((key) => {
103
+ configFromAttributes[key] = this[key];
104
+ });
105
+ return configFromAttributes || {};
106
+ }
107
+ getEnvConfigByLevel() {
108
+ const attributesConfig = this.getAttributesConfig();
109
+ // If label is set, use attributes as config with default
110
+ if (this.label) {
111
+ return Object.assign(Object.assign({}, DEFAULT_ENVIRONMENT_LEVEL_CONFIG), attributesConfig);
112
+ }
113
+ // If no label is set, try to get configured value from DI container first
114
+ try {
115
+ const container = DI.getOrCreateDOMContainer();
116
+ const configuredConfig = container.get(EnvironmentConfigs);
117
+ if (configuredConfig && configuredConfig.length > 0) {
118
+ const config = configuredConfig.find(({ level }) => level === ENVIRONMENT_LEVEL);
119
+ if (config) {
120
+ return Object.assign(Object.assign({}, config), attributesConfig);
121
+ }
122
+ }
123
+ }
124
+ catch (error) {
125
+ environmentIndicatorLogger.error(error);
126
+ }
127
+ const envConfig = this.envConfigs.find(({ level }) => level === ENVIRONMENT_LEVEL) || null;
128
+ // If no env config found, return null
129
+ if (!envConfig)
130
+ return null;
131
+ return Object.assign(Object.assign({}, envConfig), attributesConfig);
132
+ }
133
+ connectedCallback() {
134
+ super.connectedCallback();
135
+ this.config = this.getEnvConfigByLevel();
136
+ }
137
+ /**
138
+ * Handle config change when attributes change
139
+ */
140
+ attributeChangedCallback(name, oldValue, newValue) {
141
+ super.attributeChangedCallback(name, oldValue, newValue);
142
+ const watchedAttributes = [
143
+ 'label',
144
+ 'show-icon',
145
+ 'size',
146
+ 'background-color',
147
+ 'text-color',
148
+ 'icon',
149
+ ];
150
+ if (watchedAttributes.includes(name) && oldValue !== newValue) {
151
+ this.config = this.getEnvConfigByLevel();
152
+ }
153
+ }
154
+ /**
155
+ * Set environment configurations
156
+ * @param envConfigs - the environment configurations
157
+ */
158
+ setEnvConfigs(envConfigs) {
159
+ this.envConfigs = envConfigs;
160
+ }
161
+ }
162
+ __decorate([
163
+ attr
164
+ ], EnvironmentIndicator.prototype, "label", void 0);
165
+ __decorate([
166
+ attr({ mode: 'boolean', attribute: 'show-icon' })
167
+ ], EnvironmentIndicator.prototype, "showIcon", void 0);
168
+ __decorate([
169
+ attr
170
+ ], EnvironmentIndicator.prototype, "size", void 0);
171
+ __decorate([
172
+ attr({ attribute: 'background-color' })
173
+ ], EnvironmentIndicator.prototype, "backgroundColor", void 0);
174
+ __decorate([
175
+ attr({ attribute: 'text-color' })
176
+ ], EnvironmentIndicator.prototype, "textColor", void 0);
177
+ __decorate([
178
+ attr
179
+ ], EnvironmentIndicator.prototype, "icon", void 0);
180
+ __decorate([
181
+ observable
182
+ ], EnvironmentIndicator.prototype, "config", void 0);
183
+ __decorate([
184
+ observable
185
+ ], EnvironmentIndicator.prototype, "envConfigs", void 0);
186
+ /**
187
+ * The Foundation Environment indicator
188
+ *
189
+ * @public
190
+ * @remarks
191
+ * HTML Element: \<foundation-environment-indicator\>
192
+ */
193
+ export const foundationEnvironmentIndicator = EnvironmentIndicator.compose({
194
+ baseName: 'environment-indicator',
195
+ template,
196
+ styles,
197
+ });
@@ -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 foundation-icon {
23
+ font-size: calc(var(--design-unit) * 3px);
24
+ }
25
+
26
+ .environment-indicator.lg foundation-icon {
27
+ font-size: calc(var(--design-unit) * 3.5px);
28
+ }
29
+ `;
@@ -0,0 +1,28 @@
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="sm"
17
+ aria-hidden="true"
18
+ ></${prefix}-icon>
19
+ `)}
20
+ <span data-test-id="environment-indicator-text" aria-label="Environment label">
21
+ ${({ config }) => config.label}
22
+ </span>
23
+ </div>
24
+ `)}
25
+ `;
26
+ export const foundationEnvironmentIndicatorTemplate = html `
27
+ ${(x) => getPrefixedEnvironmentIndicatorTemplate(getPrefix(x))}
28
+ `;
@@ -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,10 @@
1
+ import { __awaiter } from "tslib";
2
+ import { DI, Registration } from '@microsoft/fast-foundation';
3
+ import { DEFAULT_ENVIRONMENT_LEVEL_CONFIG, EnvironmentConfigs } from '../environment-indicator';
4
+ export function configureEnvironmentIndicator(config) {
5
+ return __awaiter(this, void 0, void 0, function* () {
6
+ const value = config && config.length > 0 ? config : [DEFAULT_ENVIRONMENT_LEVEL_CONFIG];
7
+ const container = DI.getOrCreateDOMContainer();
8
+ container.register(Registration.instance(EnvironmentConfigs, value));
9
+ });
10
+ }
@@ -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.285.0",
4
+ "version": "14.285.2-alpha-a57a535.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.285.0",
87
- "@genesislcap/genx": "14.285.0",
88
- "@genesislcap/rollup-builder": "14.285.0",
89
- "@genesislcap/ts-builder": "14.285.0",
90
- "@genesislcap/uvu-playwright-builder": "14.285.0",
91
- "@genesislcap/vite-builder": "14.285.0",
92
- "@genesislcap/webpack-builder": "14.285.0",
86
+ "@genesislcap/foundation-testing": "14.285.2-alpha-a57a535.0",
87
+ "@genesislcap/genx": "14.285.2-alpha-a57a535.0",
88
+ "@genesislcap/rollup-builder": "14.285.2-alpha-a57a535.0",
89
+ "@genesislcap/ts-builder": "14.285.2-alpha-a57a535.0",
90
+ "@genesislcap/uvu-playwright-builder": "14.285.2-alpha-a57a535.0",
91
+ "@genesislcap/vite-builder": "14.285.2-alpha-a57a535.0",
92
+ "@genesislcap/webpack-builder": "14.285.2-alpha-a57a535.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.285.0",
104
- "@genesislcap/foundation-comms": "14.285.0",
105
- "@genesislcap/foundation-criteria": "14.285.0",
106
- "@genesislcap/foundation-errors": "14.285.0",
107
- "@genesislcap/foundation-events": "14.285.0",
108
- "@genesislcap/foundation-logger": "14.285.0",
109
- "@genesislcap/foundation-notifications": "14.285.0",
110
- "@genesislcap/foundation-user": "14.285.0",
111
- "@genesislcap/foundation-utils": "14.285.0",
103
+ "@genesislcap/expression-builder": "14.285.2-alpha-a57a535.0",
104
+ "@genesislcap/foundation-comms": "14.285.2-alpha-a57a535.0",
105
+ "@genesislcap/foundation-criteria": "14.285.2-alpha-a57a535.0",
106
+ "@genesislcap/foundation-errors": "14.285.2-alpha-a57a535.0",
107
+ "@genesislcap/foundation-events": "14.285.2-alpha-a57a535.0",
108
+ "@genesislcap/foundation-logger": "14.285.2-alpha-a57a535.0",
109
+ "@genesislcap/foundation-notifications": "14.285.2-alpha-a57a535.0",
110
+ "@genesislcap/foundation-user": "14.285.2-alpha-a57a535.0",
111
+ "@genesislcap/foundation-utils": "14.285.2-alpha-a57a535.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": "45006991dfd619837fe3093077405efeb710c5cd"
133
+ "gitHead": "fde8ace8951fac4bb34cdad920272c5750f3e1af"
134
134
  }