@ni/nimble-components 35.5.0 → 35.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-components-bundle.js +327 -160
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +3746 -3641
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/custom-elements.json +105 -2
- package/dist/custom-elements.md +31 -15
- package/dist/esm/anchor-step/template.js +14 -19
- package/dist/esm/anchor-step/template.js.map +1 -1
- package/dist/esm/anchor-step/testing/anchor-step.pageobject.d.ts +7 -0
- package/dist/esm/anchor-step/testing/anchor-step.pageobject.js +7 -0
- package/dist/esm/anchor-step/testing/anchor-step.pageobject.js.map +1 -0
- package/dist/esm/label-provider/core/index.d.ts +6 -0
- package/dist/esm/label-provider/core/index.js +9 -1
- package/dist/esm/label-provider/core/index.js.map +1 -1
- package/dist/esm/label-provider/core/label-token-defaults.js +2 -0
- package/dist/esm/label-provider/core/label-token-defaults.js.map +1 -1
- package/dist/esm/label-provider/core/label-tokens.d.ts +2 -0
- package/dist/esm/label-provider/core/label-tokens.js +8 -0
- package/dist/esm/label-provider/core/label-tokens.js.map +1 -1
- package/dist/esm/patterns/severity/styles.js +4 -6
- package/dist/esm/patterns/severity/styles.js.map +1 -1
- package/dist/esm/patterns/severity/template.js +1 -0
- package/dist/esm/patterns/severity/template.js.map +1 -1
- package/dist/esm/patterns/severity/testing/severity-pattern.pageobject.d.ts +1 -0
- package/dist/esm/patterns/severity/testing/severity-pattern.pageobject.js +7 -0
- package/dist/esm/patterns/severity/testing/severity-pattern.pageobject.js.map +1 -1
- package/dist/esm/patterns/step/models/step-internals.d.ts +1 -0
- package/dist/esm/patterns/step/models/step-internals.js +4 -0
- package/dist/esm/patterns/step/models/step-internals.js.map +1 -1
- package/dist/esm/patterns/step/styles.js +154 -46
- package/dist/esm/patterns/step/styles.js.map +1 -1
- package/dist/esm/patterns/step/testing/step-base.pageobject.d.ts +12 -0
- package/dist/esm/patterns/step/testing/step-base.pageobject.js +40 -0
- package/dist/esm/patterns/step/testing/step-base.pageobject.js.map +1 -0
- package/dist/esm/patterns/step/types.d.ts +3 -2
- package/dist/esm/patterns/step/types.js.map +1 -1
- package/dist/esm/step/template.js +14 -19
- package/dist/esm/step/template.js.map +1 -1
- package/dist/esm/step/testing/step.pageobject.d.ts +7 -0
- package/dist/esm/step/testing/step.pageobject.js +7 -0
- package/dist/esm/step/testing/step.pageobject.js.map +1 -0
- package/dist/esm/stepper/index.d.ts +8 -0
- package/dist/esm/stepper/index.js +30 -0
- package/dist/esm/stepper/index.js.map +1 -1
- package/dist/esm/stepper/styles.js +18 -1
- package/dist/esm/stepper/styles.js.map +1 -1
- package/dist/esm/stepper/template.js +6 -5
- package/dist/esm/stepper/template.js.map +1 -1
- package/package.json +2 -2
|
@@ -29,6 +29,13 @@ export class SeverityPatternPageObject {
|
|
|
29
29
|
severityTextDiv.dispatchEvent(event);
|
|
30
30
|
processUpdates();
|
|
31
31
|
}
|
|
32
|
+
clickSeverityText() {
|
|
33
|
+
const severityTextDiv = this.getSeverityTextElement();
|
|
34
|
+
if (!severityTextDiv) {
|
|
35
|
+
throw new Error('Severity text element not found');
|
|
36
|
+
}
|
|
37
|
+
severityTextDiv.click();
|
|
38
|
+
}
|
|
32
39
|
getSeverityTextElement() {
|
|
33
40
|
return this.element.shadowRoot.querySelector('.severity-text');
|
|
34
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"severity-pattern.pageobject.js","sourceRoot":"","sources":["../../../../../src/patterns/severity/testing/severity-pattern.pageobject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAClC,YAAoC,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAAG,CAAC;IAE3D,wBAAwB;QAC3B,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACtD,IACI,CAAC,eAAe;eACb,gBAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,KAAK,MAAM,EACzD,CAAC;YACC,OAAO,EAAE,CAAC;QACd,CAAC;QACD,OAAO,eAAe,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACrD,CAAC;IAEM,oBAAoB;QACvB,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACtD,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,eAAe,CAAC,KAAK,CAAC;IACjC,CAAC;IAEM,2BAA2B,CAAC,KAAiB;QAChD,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACtD,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvD,CAAC;QACD,eAAe,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACrC,cAAc,EAAE,CAAC;IACrB,CAAC;IAEO,sBAAsB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAW,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACpE,CAAC;CACJ","sourcesContent":["import type { FoundationElement } from '@ni/fast-foundation';\nimport { processUpdates } from '../../../testing/async-helpers';\n\n/**\n * A page object for the elements that use the error pattern mixin.\n */\nexport class SeverityPatternPageObject {\n public constructor(private readonly element: FoundationElement) {}\n\n public getDisplayedSeverityText(): string {\n const severityTextDiv = this.getSeverityTextElement();\n if (\n !severityTextDiv\n || getComputedStyle(severityTextDiv).display === 'none'\n ) {\n return '';\n }\n return severityTextDiv.textContent?.trim() ?? '';\n }\n\n public getSeverityTextTitle(): string {\n const severityTextDiv = this.getSeverityTextElement();\n if (!severityTextDiv) {\n throw new Error('Severity text element not found');\n }\n return severityTextDiv.title;\n }\n\n public dispatchEventToSeverityText(event: MouseEvent): void {\n const severityTextDiv = this.getSeverityTextElement();\n if (!severityTextDiv) {\n throw new Error('Severity text element not found');\n }\n severityTextDiv.dispatchEvent(event);\n processUpdates();\n }\n\n private getSeverityTextElement(): HTMLDivElement | null {\n return this.element.shadowRoot!.querySelector('.severity-text');\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"severity-pattern.pageobject.js","sourceRoot":"","sources":["../../../../../src/patterns/severity/testing/severity-pattern.pageobject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAClC,YAAoC,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAAG,CAAC;IAE3D,wBAAwB;QAC3B,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACtD,IACI,CAAC,eAAe;eACb,gBAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,KAAK,MAAM,EACzD,CAAC;YACC,OAAO,EAAE,CAAC;QACd,CAAC;QACD,OAAO,eAAe,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACrD,CAAC;IAEM,oBAAoB;QACvB,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACtD,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,eAAe,CAAC,KAAK,CAAC;IACjC,CAAC;IAEM,2BAA2B,CAAC,KAAiB;QAChD,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACtD,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvD,CAAC;QACD,eAAe,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACrC,cAAc,EAAE,CAAC;IACrB,CAAC;IAEM,iBAAiB;QACpB,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACtD,IAAI,CAAC,eAAe,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvD,CAAC;QACD,eAAe,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IAEO,sBAAsB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAW,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACpE,CAAC;CACJ","sourcesContent":["import type { FoundationElement } from '@ni/fast-foundation';\nimport { processUpdates } from '../../../testing/async-helpers';\n\n/**\n * A page object for the elements that use the error pattern mixin.\n */\nexport class SeverityPatternPageObject {\n public constructor(private readonly element: FoundationElement) {}\n\n public getDisplayedSeverityText(): string {\n const severityTextDiv = this.getSeverityTextElement();\n if (\n !severityTextDiv\n || getComputedStyle(severityTextDiv).display === 'none'\n ) {\n return '';\n }\n return severityTextDiv.textContent?.trim() ?? '';\n }\n\n public getSeverityTextTitle(): string {\n const severityTextDiv = this.getSeverityTextElement();\n if (!severityTextDiv) {\n throw new Error('Severity text element not found');\n }\n return severityTextDiv.title;\n }\n\n public dispatchEventToSeverityText(event: MouseEvent): void {\n const severityTextDiv = this.getSeverityTextElement();\n if (!severityTextDiv) {\n throw new Error('Severity text element not found');\n }\n severityTextDiv.dispatchEvent(event);\n processUpdates();\n }\n\n public clickSeverityText(): void {\n const severityTextDiv = this.getSeverityTextElement();\n if (!severityTextDiv) {\n throw new Error('Severity text element not found');\n }\n severityTextDiv.click();\n }\n\n private getSeverityTextElement(): HTMLDivElement | null {\n return this.element.shadowRoot!.querySelector('.severity-text');\n }\n}\n"]}
|
|
@@ -8,6 +8,7 @@ export class StepInternals {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
this.orientation = StepperOrientation.horizontal;
|
|
10
10
|
this.last = false;
|
|
11
|
+
this.position = 1;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
__decorate([
|
|
@@ -16,4 +17,7 @@ __decorate([
|
|
|
16
17
|
__decorate([
|
|
17
18
|
observable
|
|
18
19
|
], StepInternals.prototype, "last", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
observable
|
|
22
|
+
], StepInternals.prototype, "position", void 0);
|
|
19
23
|
//# sourceMappingURL=step-internals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-internals.js","sourceRoot":"","sources":["../../../../../src/patterns/step/models/step-internals.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;GAEG;AACH,MAAM,OAAO,aAAa;IAA1B;QAEW,gBAAW,GAAuB,kBAAkB,CAAC,UAAU,CAAC;QAGhE,SAAI,GAAG,KAAK,CAAC;IACxB,CAAC;CAAA;
|
|
1
|
+
{"version":3,"file":"step-internals.js","sourceRoot":"","sources":["../../../../../src/patterns/step/models/step-internals.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;GAEG;AACH,MAAM,OAAO,aAAa;IAA1B;QAEW,gBAAW,GAAuB,kBAAkB,CAAC,UAAU,CAAC;QAGhE,SAAI,GAAG,KAAK,CAAC;QAGb,aAAQ,GAAG,CAAC,CAAC;IACxB,CAAC;CAAA;AAPU;IADN,UAAU;kDAC4D;AAGhE;IADN,UAAU;2CACS;AAGb;IADN,UAAU;+CACS","sourcesContent":["import { observable } from '@ni/fast-element';\nimport { StepperOrientation } from '../../../stepper/types';\n\n/**\n * Internal properties configurable for a step\n */\nexport class StepInternals {\n @observable\n public orientation: StepperOrientation = StepperOrientation.horizontal;\n\n @observable\n public last = false;\n\n @observable\n public position = 1;\n}\n"]}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { css } from '@ni/fast-element';
|
|
2
2
|
import { Black15, Black91, White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';
|
|
3
3
|
import { display } from '../../utilities/style/display';
|
|
4
|
-
import { buttonLabelFont, buttonLabelFontColor, smallPadding, bodyFont, errorTextFont, controlSlimHeight, borderRgbPartialColor, borderHoverColor, borderWidth, smallDelay, fillSelectedColor, passColor, failColor, warningColor, buttonLabelDisabledFontColor, iconColor,
|
|
4
|
+
import { buttonLabelFont, buttonLabelFontColor, smallPadding, bodyFont, errorTextFont, controlSlimHeight, borderRgbPartialColor, borderHoverColor, borderWidth, smallDelay, fillSelectedColor, passColor, failColor, warningColor, buttonLabelDisabledFontColor, iconColor, standardPadding, controlHeight, errorTextFontLineHeight, } from '../../theme-provider/design-tokens';
|
|
5
5
|
import { styles as severityStyles } from '../severity/styles';
|
|
6
6
|
import { focusVisible } from '../../utilities/style/focus';
|
|
7
7
|
import { userSelectNone } from '../../utilities/style/user-select';
|
|
8
8
|
import { themeBehavior } from '../../utilities/style/theme';
|
|
9
9
|
import { Theme } from '../../theme-provider/types';
|
|
10
|
+
import { accessiblyHidden } from '../../utilities/style/accessibly-hidden';
|
|
10
11
|
export const styles = css `
|
|
11
12
|
@layer base, hover, focusVisible, active, disabled, top;
|
|
12
13
|
|
|
@@ -14,9 +15,6 @@ export const styles = css `
|
|
|
14
15
|
${display('inline-flex')}
|
|
15
16
|
${severityStyles}
|
|
16
17
|
:host {
|
|
17
|
-
${'' /* Based on text layout: Top padding + title height + subtitle height + bottom padding */}
|
|
18
|
-
height: calc(${smallPadding} + ${controlSlimHeight} + ${errorTextFontLineHeight} + ${smallPadding});
|
|
19
|
-
width: ${menuMinWidth};
|
|
20
18
|
color: ${buttonLabelFontColor};
|
|
21
19
|
font: ${buttonLabelFont};
|
|
22
20
|
white-space: nowrap;
|
|
@@ -30,21 +28,36 @@ export const styles = css `
|
|
|
30
28
|
width: 100%;
|
|
31
29
|
height: 100%;
|
|
32
30
|
position: relative;
|
|
31
|
+
list-style: none;
|
|
32
|
+
--ni-private-step-content-height: calc(${smallPadding} + ${controlSlimHeight} + ${errorTextFontLineHeight});
|
|
33
|
+
--ni-private-step-content-offset: calc(${controlHeight} + ${smallPadding});
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
.control {
|
|
36
|
-
display: inline-
|
|
37
|
-
align-items: start;
|
|
38
|
-
justify-content: flex-start;
|
|
36
|
+
.control {
|
|
37
|
+
display: inline-grid;
|
|
39
38
|
height: 100%;
|
|
40
39
|
width: 100%;
|
|
40
|
+
grid-template-areas:
|
|
41
|
+
"icon top-spacer top-spacer"
|
|
42
|
+
"icon title line"
|
|
43
|
+
"icon subtitle subtitle";
|
|
44
|
+
grid-template-columns:
|
|
45
|
+
${controlHeight} ${'' /* Icon width */}
|
|
46
|
+
min-content ${'' /* Show the full title and subtitle */}
|
|
47
|
+
1fr; ${'' /* Line is only fr unit so fills remaining space */}
|
|
48
|
+
grid-template-rows:
|
|
49
|
+
${smallPadding}
|
|
50
|
+
${controlSlimHeight}
|
|
51
|
+
min-content;
|
|
52
|
+
column-gap: 4px;
|
|
53
|
+
|
|
54
|
+
align-items: start;
|
|
55
|
+
margin: 0;
|
|
56
|
+
padding: 0;
|
|
41
57
|
color: inherit;
|
|
42
58
|
background-color: transparent;
|
|
43
|
-
gap: ${smallPadding};
|
|
44
59
|
cursor: pointer;
|
|
45
60
|
outline: none;
|
|
46
|
-
margin: 0;
|
|
47
|
-
padding: 0 ${smallPadding} 0 0;
|
|
48
61
|
--ni-private-step-icon-background-full-size: 100% 100%;
|
|
49
62
|
${'' /* 6px = (2px icon border + 1px inset) * 2 sides */}
|
|
50
63
|
--ni-private-step-icon-background-inset-size: calc(100% - 6px) calc(100% - 6px);
|
|
@@ -58,6 +71,70 @@ export const styles = css `
|
|
|
58
71
|
--ni-private-step-line-color: rgba(${borderRgbPartialColor}, 0.1);
|
|
59
72
|
}
|
|
60
73
|
|
|
74
|
+
.container.last .control {
|
|
75
|
+
grid-template-areas:
|
|
76
|
+
"icon top-spacer"
|
|
77
|
+
"icon title"
|
|
78
|
+
"icon subtitle";
|
|
79
|
+
grid-template-columns:
|
|
80
|
+
${controlHeight}
|
|
81
|
+
min-content;
|
|
82
|
+
grid-template-rows:
|
|
83
|
+
${smallPadding}
|
|
84
|
+
${controlSlimHeight}
|
|
85
|
+
min-content;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.container.vertical .control {
|
|
89
|
+
${'' /*
|
|
90
|
+
Defines an interaction area clip-path that leaves out the severity text so it is easily selectable:
|
|
91
|
+
1----------------2
|
|
92
|
+
| title |
|
|
93
|
+
| subtitle |
|
|
94
|
+
| 4-------------3
|
|
95
|
+
| | severity-text
|
|
96
|
+
| |
|
|
97
|
+
6--5
|
|
98
|
+
*/}
|
|
99
|
+
clip-path: polygon(
|
|
100
|
+
0% 0%,
|
|
101
|
+
100% 0%,
|
|
102
|
+
100% var(--ni-private-step-content-height),
|
|
103
|
+
var(--ni-private-step-content-offset) var(--ni-private-step-content-height),
|
|
104
|
+
var(--ni-private-step-content-offset) 100%,
|
|
105
|
+
0% 100%
|
|
106
|
+
);
|
|
107
|
+
grid-template-areas:
|
|
108
|
+
"icon top-spacer"
|
|
109
|
+
"icon title"
|
|
110
|
+
"icon subtitle"
|
|
111
|
+
"line subtitle"
|
|
112
|
+
"line .";
|
|
113
|
+
grid-template-columns:
|
|
114
|
+
${controlHeight}
|
|
115
|
+
min-content;
|
|
116
|
+
grid-template-rows:
|
|
117
|
+
${smallPadding}
|
|
118
|
+
${controlSlimHeight}
|
|
119
|
+
calc(${controlHeight} - ${smallPadding} - ${controlSlimHeight})
|
|
120
|
+
min-content
|
|
121
|
+
1fr;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.container.vertical.last .control {
|
|
125
|
+
grid-template-areas:
|
|
126
|
+
"icon top-spacer"
|
|
127
|
+
"icon title"
|
|
128
|
+
"icon subtitle";
|
|
129
|
+
grid-template-columns:
|
|
130
|
+
${controlHeight}
|
|
131
|
+
min-content;
|
|
132
|
+
grid-template-rows:
|
|
133
|
+
${smallPadding}
|
|
134
|
+
${controlSlimHeight}
|
|
135
|
+
min-content;
|
|
136
|
+
}
|
|
137
|
+
|
|
61
138
|
:host([severity="error"]) .control {
|
|
62
139
|
--ni-private-step-icon-color: ${failColor};
|
|
63
140
|
--ni-private-step-icon-border-color: ${failColor};
|
|
@@ -91,6 +168,7 @@ export const styles = css `
|
|
|
91
168
|
}
|
|
92
169
|
|
|
93
170
|
.icon {
|
|
171
|
+
grid-area: icon;
|
|
94
172
|
display: inline-flex;
|
|
95
173
|
align-items: center;
|
|
96
174
|
justify-content: center;
|
|
@@ -110,7 +188,7 @@ export const styles = css `
|
|
|
110
188
|
${'' /* Workaround to prevent aliasing on radial-gradient boundaries, see:
|
|
111
189
|
https://frontendmasters.com/blog/obsessing-over-smooth-radial-gradient-disc-edges
|
|
112
190
|
*/}
|
|
113
|
-
var(--ni-private-step-icon-background-color) calc(100% - 1px/var(--ni-private-device-
|
|
191
|
+
var(--ni-private-step-icon-background-color) calc(100% - 1px/var(--ni-private-device-pixel-ratio, 1)),
|
|
114
192
|
transparent 100%
|
|
115
193
|
);
|
|
116
194
|
background-origin: border-box;
|
|
@@ -148,18 +226,22 @@ export const styles = css `
|
|
|
148
226
|
outline-offset ${smallDelay} ease-in-out;
|
|
149
227
|
}
|
|
150
228
|
|
|
151
|
-
.
|
|
229
|
+
.current-label {
|
|
230
|
+
${accessiblyHidden}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.step-indicator {
|
|
152
234
|
display: contents;
|
|
153
235
|
}
|
|
154
236
|
|
|
155
|
-
:host([severity="error"]) .
|
|
156
|
-
:host([severity="warning"]) .
|
|
157
|
-
:host([severity="success"]) .
|
|
237
|
+
:host([severity="error"]) .step-indicator,
|
|
238
|
+
:host([severity="warning"]) .step-indicator,
|
|
239
|
+
:host([severity="success"]) .step-indicator {
|
|
158
240
|
display: none;
|
|
159
241
|
}
|
|
160
242
|
|
|
161
|
-
:host([selected]) .
|
|
162
|
-
:host([disabled]) .
|
|
243
|
+
:host([selected]) .step-indicator,
|
|
244
|
+
:host([disabled]) .step-indicator {
|
|
163
245
|
display: contents;
|
|
164
246
|
}
|
|
165
247
|
|
|
@@ -178,62 +260,80 @@ export const styles = css `
|
|
|
178
260
|
display: none;
|
|
179
261
|
}
|
|
180
262
|
|
|
181
|
-
.
|
|
182
|
-
|
|
183
|
-
${
|
|
184
|
-
width: calc(100% - 32px);
|
|
185
|
-
flex-direction: column;
|
|
186
|
-
padding-top: ${smallPadding};
|
|
187
|
-
padding-bottom: ${smallPadding};
|
|
263
|
+
.top-spacer {
|
|
264
|
+
grid-area: top-spacer;
|
|
265
|
+
height: ${smallPadding};
|
|
188
266
|
}
|
|
189
267
|
|
|
190
|
-
.title
|
|
191
|
-
|
|
268
|
+
.title {
|
|
269
|
+
grid-area: title;
|
|
270
|
+
min-width: min-content;
|
|
192
271
|
height: ${controlSlimHeight};
|
|
193
|
-
|
|
194
|
-
align-
|
|
195
|
-
justify-content: start;
|
|
196
|
-
gap: ${smallPadding};
|
|
272
|
+
display: inline-block;
|
|
273
|
+
align-content: center;
|
|
197
274
|
font: ${bodyFont};
|
|
275
|
+
white-space: nowrap;
|
|
276
|
+
overflow: hidden;
|
|
277
|
+
text-overflow: ellipsis;
|
|
198
278
|
}
|
|
199
279
|
|
|
200
280
|
[part='start'] {
|
|
201
281
|
display: none;
|
|
202
282
|
}
|
|
203
283
|
|
|
204
|
-
.title {
|
|
205
|
-
display: inline-block;
|
|
206
|
-
flex: none;
|
|
207
|
-
white-space: nowrap;
|
|
208
|
-
overflow: hidden;
|
|
209
|
-
text-overflow: ellipsis;
|
|
210
|
-
${'' /* Content width - (gap + line min width) */}
|
|
211
|
-
max-width: calc(100% - (${smallPadding} + ${standardPadding}));
|
|
212
|
-
}
|
|
213
|
-
|
|
214
284
|
[part='end'] {
|
|
215
285
|
display: none;
|
|
216
286
|
}
|
|
217
|
-
|
|
287
|
+
|
|
218
288
|
.line {
|
|
289
|
+
grid-area: line;
|
|
290
|
+
align-self: center;
|
|
291
|
+
justify-self: center;
|
|
219
292
|
display: inline-block;
|
|
220
|
-
|
|
293
|
+
width: 100%;
|
|
221
294
|
min-width: ${standardPadding};
|
|
222
295
|
height: 1px;
|
|
296
|
+
min-height: 1px;
|
|
223
297
|
background: var(--ni-private-step-line-color);
|
|
298
|
+
background-clip: content-box;
|
|
224
299
|
transform: scale(1, 1);
|
|
225
300
|
transition:
|
|
226
301
|
background-color ${smallDelay} ease-in-out,
|
|
227
302
|
transform ${smallDelay} ease-in-out;
|
|
228
303
|
}
|
|
229
304
|
|
|
305
|
+
.container.last .line {
|
|
306
|
+
display: none;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.container.vertical .line {
|
|
310
|
+
width: 1px;
|
|
311
|
+
min-width: 1px;
|
|
312
|
+
height: 100%;
|
|
313
|
+
padding-top: ${smallPadding};
|
|
314
|
+
min-height: ${standardPadding};
|
|
315
|
+
}
|
|
316
|
+
|
|
230
317
|
.subtitle {
|
|
318
|
+
grid-area: subtitle;
|
|
319
|
+
display: inline-block;
|
|
320
|
+
min-width: min-content;
|
|
321
|
+
height: ${errorTextFontLineHeight};
|
|
322
|
+
align-content: center;
|
|
231
323
|
font: ${errorTextFont};
|
|
232
324
|
white-space: nowrap;
|
|
233
325
|
overflow: hidden;
|
|
234
326
|
text-overflow: ellipsis;
|
|
235
|
-
|
|
236
|
-
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.severity-text {
|
|
330
|
+
left: 0px;
|
|
331
|
+
top: var(--ni-private-step-content-height);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.container.vertical .severity-text {
|
|
335
|
+
width: calc(100% - var(--ni-private-step-content-offset));
|
|
336
|
+
left: var(--ni-private-step-content-offset);
|
|
237
337
|
}
|
|
238
338
|
}
|
|
239
339
|
|
|
@@ -277,6 +377,10 @@ export const styles = css `
|
|
|
277
377
|
.control:hover .line {
|
|
278
378
|
transform: scale(1, 2);
|
|
279
379
|
}
|
|
380
|
+
|
|
381
|
+
.container.vertical .control:hover .line {
|
|
382
|
+
transform: scale(2, 1);
|
|
383
|
+
}
|
|
280
384
|
}
|
|
281
385
|
|
|
282
386
|
@layer focusVisible {
|
|
@@ -316,7 +420,7 @@ export const styles = css `
|
|
|
316
420
|
--ni-private-step-icon-outline-inset-color: ${borderHoverColor};
|
|
317
421
|
--ni-private-step-line-color: ${borderHoverColor};
|
|
318
422
|
}
|
|
319
|
-
|
|
423
|
+
|
|
320
424
|
.control${focusVisible} .icon {
|
|
321
425
|
border-width: 2px;
|
|
322
426
|
}
|
|
@@ -329,6 +433,10 @@ export const styles = css `
|
|
|
329
433
|
.control${focusVisible} .line {
|
|
330
434
|
transform: scale(1, 2);
|
|
331
435
|
}
|
|
436
|
+
|
|
437
|
+
.container.vertical .control${focusVisible} .line {
|
|
438
|
+
transform: scale(2, 1);
|
|
439
|
+
}
|
|
332
440
|
}
|
|
333
441
|
|
|
334
442
|
@layer active {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/patterns/step/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EACH,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,YAAY,EACZ,4BAA4B,EAC5B,SAAS,EACT,YAAY,EACZ,eAAe,EACf,aAAa,EACb,uBAAuB,EAC1B,MAAM,oCAAoC,CAA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4DAGiD,KAAK;;;SAGxD,CACJ,EACD,aAAa,CACT,KAAK,CAAC,IAAI,EACV,GAAG,CAAA;;;4DAGiD,OAAO;;;SAG1D,CACJ,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;;4DAGiD,OAAO;;;;wEAIK,SAAS;;;SAGxE,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport { Black15, Black91, White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';\nimport { display } from '../../utilities/style/display';\nimport {\n buttonLabelFont,\n buttonLabelFontColor,\n smallPadding,\n bodyFont,\n errorTextFont,\n controlSlimHeight,\n borderRgbPartialColor,\n borderHoverColor,\n borderWidth,\n smallDelay,\n fillSelectedColor,\n passColor,\n failColor,\n warningColor,\n buttonLabelDisabledFontColor,\n iconColor,\n menuMinWidth,\n standardPadding,\n controlHeight,\n errorTextFontLineHeight\n} from '../../theme-provider/design-tokens';\nimport { styles as severityStyles } from '../severity/styles';\nimport { focusVisible } from '../../utilities/style/focus';\nimport { userSelectNone } from '../../utilities/style/user-select';\nimport { themeBehavior } from '../../utilities/style/theme';\nimport { Theme } from '../../theme-provider/types';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled, top;\n\n @layer base {\n ${display('inline-flex')}\n ${severityStyles}\n :host {\n ${'' /* Based on text layout: Top padding + title height + subtitle height + bottom padding */}\n height: calc(${smallPadding} + ${controlSlimHeight} + ${errorTextFontLineHeight} + ${smallPadding});\n width: ${menuMinWidth};\n color: ${buttonLabelFontColor};\n font: ${buttonLabelFont};\n white-space: nowrap;\n outline: none;\n border: none;\n }\n\n ${'' /* Container wrapper for severity text to position against */}\n .container {\n display: inline-flex;\n width: 100%;\n height: 100%;\n position: relative;\n }\n\n .control { \n display: inline-flex;\n align-items: start;\n justify-content: flex-start;\n height: 100%;\n width: 100%;\n color: inherit;\n background-color: transparent;\n gap: ${smallPadding};\n cursor: pointer;\n outline: none;\n margin: 0; \n padding: 0 ${smallPadding} 0 0;\n --ni-private-step-icon-background-full-size: 100% 100%;\n ${'' /* 6px = (2px icon border + 1px inset) * 2 sides */}\n --ni-private-step-icon-background-inset-size: calc(100% - 6px) calc(100% - 6px);\n --ni-private-step-icon-background-none-size: 0% 0%;\n\n --ni-private-step-icon-color: ${buttonLabelFontColor};\n --ni-private-step-icon-border-color: transparent;\n --ni-private-step-icon-background-color: rgba(${borderRgbPartialColor}, 0.1);\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-full-size);\n --ni-private-step-icon-outline-inset-color: transparent;\n --ni-private-step-line-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([severity=\"error\"]) .control {\n --ni-private-step-icon-color: ${failColor};\n --ni-private-step-icon-border-color: ${failColor};\n --ni-private-step-icon-background-color: rgb(from ${failColor} r g b / 30%);\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-line-color: ${failColor};\n }\n\n :host([severity=\"warning\"]) .control {\n --ni-private-step-icon-color: ${warningColor};\n --ni-private-step-icon-border-color: ${warningColor};\n --ni-private-step-icon-background-color: rgb(from ${warningColor} r g b / 30%);\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-line-color: ${warningColor};\n }\n\n :host([severity=\"success\"]) .control {\n --ni-private-step-icon-color: var(--ni-private-step-icon-inverse-color);\n --ni-private-step-icon-border-color: ${passColor};\n --ni-private-step-icon-background-color: ${passColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-full-size);\n --ni-private-step-line-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([selected]) .control {\n --ni-private-step-icon-color: ${borderHoverColor};\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-color: rgb(from ${borderHoverColor} r g b / 30%);\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n .icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n height: ${controlHeight};\n width: ${controlHeight};\n ${userSelectNone};\n font: ${buttonLabelFont};\n color: var(--ni-private-step-icon-color);\n ${iconColor.cssCustomProperty}: var(--ni-private-step-icon-color);\n border-style: solid;\n border-radius: 100%;\n border-color: var(--ni-private-step-icon-border-color);\n border-width: 1px;\n background-image: radial-gradient(\n closest-side,\n ${'' /* Workaround to prevent aliasing on radial-gradient boundaries, see:\n https://frontendmasters.com/blog/obsessing-over-smooth-radial-gradient-disc-edges\n */}\n var(--ni-private-step-icon-background-color) calc(100% - 1px/var(--ni-private-device-resolution)),\n transparent 100%\n );\n background-origin: border-box;\n background-size: var(--ni-private-step-icon-background-size);\n background-repeat: no-repeat;\n background-position: center center;\n position: relative;\n transition:\n border-color ${smallDelay} ease-in-out,\n border-width ${smallDelay} ease-in-out,\n background-size ${smallDelay} ease-out;\n }\n\n :host([selected]) .icon {\n border-width: 2px;\n }\n\n .icon::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n outline-color: var(--ni-private-step-icon-outline-inset-color);\n outline-style: solid;\n outline-width: 0px;\n outline-offset: 0px;\n border: 1px solid transparent;\n border-radius: 100%;\n color: transparent;\n background-clip: border-box;\n transition:\n outline-color ${smallDelay} ease-in-out,\n outline-width ${smallDelay} ease-in-out,\n outline-offset ${smallDelay} ease-in-out;\n }\n\n .icon-slot {\n display: contents;\n }\n\n :host([severity=\"error\"]) .icon-slot,\n :host([severity=\"warning\"]) .icon-slot,\n :host([severity=\"success\"]) .icon-slot {\n display: none;\n }\n\n :host([selected]) .icon-slot,\n :host([disabled]) .icon-slot {\n display: contents;\n }\n\n .icon-severity {\n display: none;\n }\n\n :host([severity=\"error\"]) .icon-severity,\n :host([severity=\"warning\"]) .icon-severity,\n :host([severity=\"success\"]) .icon-severity {\n display: contents;\n }\n\n :host([selected]) .icon-severity,\n :host([disabled]) .icon-severity {\n display: none;\n }\n\n .content {\n display: inline-flex;\n ${'' /* Control width - icon size */}\n width: calc(100% - 32px);\n flex-direction: column;\n padding-top: ${smallPadding};\n padding-bottom: ${smallPadding};\n }\n\n .title-wrapper {\n display: inline-flex;\n height: ${controlSlimHeight};\n flex-direction: row;\n align-items: center;\n justify-content: start;\n gap: ${smallPadding};\n font: ${bodyFont};\n }\n\n [part='start'] {\n display: none;\n }\n\n .title {\n display: inline-block;\n flex: none;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n ${'' /* Content width - (gap + line min width) */}\n max-width: calc(100% - (${smallPadding} + ${standardPadding}));\n }\n\n [part='end'] {\n display: none;\n }\n \n .line {\n display: inline-block;\n flex: 1;\n min-width: ${standardPadding};\n height: 1px;\n background: var(--ni-private-step-line-color);\n transform: scale(1, 1);\n transition:\n background-color ${smallDelay} ease-in-out,\n transform ${smallDelay} ease-in-out;\n }\n\n .subtitle {\n font: ${errorTextFont};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n ${'' /* Content width */}\n max-width: 100%;\n }\n }\n\n @layer hover {\n .control:hover {\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n :host([severity=\"error\"]) .control:hover {\n --ni-private-step-icon-border-color: ${failColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-line-color: ${failColor};\n }\n\n :host([severity=\"warning\"]) .control:hover {\n --ni-private-step-icon-border-color: ${warningColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-line-color: ${warningColor};\n }\n\n :host([severity=\"success\"]) .control:hover {\n --ni-private-step-icon-color: var(--ni-private-step-icon-inverse-color);\n --ni-private-step-icon-border-color: ${passColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);\n --ni-private-step-line-color: ${passColor};\n }\n\n :host([selected]) .control:hover {\n --ni-private-step-icon-color: ${buttonLabelFontColor};\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n .control:hover .icon {\n border-width: 2px;\n }\n\n .control:hover .line {\n transform: scale(1, 2);\n }\n }\n\n @layer focusVisible {\n .control${focusVisible} {\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-outline-inset-color: ${borderHoverColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n :host([severity=\"error\"]) .control${focusVisible} {\n --ni-private-step-icon-border-color: ${failColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-icon-outline-inset-color: ${failColor};\n --ni-private-step-line-color: ${failColor};\n }\n\n :host([severity=\"warning\"]) .control${focusVisible} {\n --ni-private-step-icon-border-color: ${warningColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-icon-outline-inset-color: ${warningColor};\n --ni-private-step-line-color: ${warningColor};\n }\n\n :host([severity=\"success\"]) .control${focusVisible} {\n --ni-private-step-icon-color: var(--ni-private-step-icon-inverse-color);\n --ni-private-step-icon-border-color: ${passColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);\n --ni-private-step-icon-outline-inset-color: transparent;\n --ni-private-step-line-color: ${passColor};\n }\n\n :host([selected]) .control${focusVisible} {\n --ni-private-step-icon-color: ${borderHoverColor};\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-icon-outline-inset-color: ${borderHoverColor};\n --ni-private-step-line-color: ${borderHoverColor};\n }\n \n .control${focusVisible} .icon {\n border-width: 2px;\n }\n\n .control${focusVisible} .icon::before {\n outline-width: ${borderWidth};\n outline-offset: -2px;\n }\n\n .control${focusVisible} .line {\n transform: scale(1, 2);\n }\n }\n\n @layer active {\n .control:active {\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-color: ${fillSelectedColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-full-size);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n :host([severity=\"error\"]) .control:active {\n --ni-private-step-icon-border-color: ${failColor};\n --ni-private-step-icon-background-color: rgb(from ${failColor} r g b / 30%);\n --ni-private-step-line-color: ${failColor};\n }\n\n :host([severity=\"warning\"]) .control:active {\n --ni-private-step-icon-border-color: ${warningColor};\n --ni-private-step-icon-background-color: rgb(from ${warningColor} r g b / 30%);\n --ni-private-step-line-color: ${warningColor};\n }\n\n :host([severity=\"success\"]) .control:active {\n --ni-private-step-icon-color: ${buttonLabelFontColor};\n --ni-private-step-icon-border-color: ${passColor};\n --ni-private-step-icon-background-color: rgb(from ${passColor} r g b / 30%);\n --ni-private-step-line-color: ${passColor};\n }\n\n :host([selected]) .control:active {\n --ni-private-step-icon-color: ${buttonLabelFontColor};\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-color: rgb(from ${borderHoverColor} r g b / 30%);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n .control:active .icon {\n border-width: 2px;\n }\n\n .control:active .icon::before {\n outline-width: 0px;\n outline-offset: 0px;\n }\n\n .control:active .line {\n transform: scale(1, 1);\n }\n }\n\n @layer disabled {\n :host([disabled]) .control {\n cursor: default;\n color: ${buttonLabelDisabledFontColor};\n --ni-private-step-icon-color: rgb(from ${buttonLabelFontColor} r g b / 30%);\n --ni-private-step-icon-border-color: transparent;\n --ni-private-step-icon-background-color: rgba(${borderRgbPartialColor}, 0.1);\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-full-size);\n --ni-private-step-icon-outline-inset-color: transparent;\n --ni-private-step-line-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([disabled]) .line {\n transform: scale(1, 1);\n }\n }\n\n @layer top {\n @media (prefers-reduced-motion) {\n .control {\n transition-duration: 0s;\n }\n }\n }\n`.withBehaviors(\n themeBehavior(\n Theme.light,\n css`\n @layer base {\n .control {\n --ni-private-step-icon-inverse-color: ${White};\n }\n }\n `\n ),\n themeBehavior(\n Theme.dark,\n css`\n @layer base {\n .control {\n --ni-private-step-icon-inverse-color: ${Black91};\n }\n }\n `\n ),\n themeBehavior(\n Theme.color,\n css`\n @layer base {\n .control {\n --ni-private-step-icon-inverse-color: ${Black15};\n }\n\n :host([severity=\"success\"]) .control {\n --ni-private-step-icon-background-color: rgb(from ${passColor} r g b / 30%);\n }\n }\n `\n )\n);\n"]}
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/patterns/step/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EACH,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,YAAY,EACZ,4BAA4B,EAC5B,SAAS,EACT,eAAe,EACf,aAAa,EACb,uBAAuB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;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AAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;;4DAGiD,KAAK;;;SAGxD,CACJ,EACD,aAAa,CACT,KAAK,CAAC,IAAI,EACV,GAAG,CAAA;;;4DAGiD,OAAO;;;SAG1D,CACJ,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;;4DAGiD,OAAO;;;;wEAIK,SAAS;;;SAGxE,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport { Black15, Black91, White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';\nimport { display } from '../../utilities/style/display';\nimport {\n buttonLabelFont,\n buttonLabelFontColor,\n smallPadding,\n bodyFont,\n errorTextFont,\n controlSlimHeight,\n borderRgbPartialColor,\n borderHoverColor,\n borderWidth,\n smallDelay,\n fillSelectedColor,\n passColor,\n failColor,\n warningColor,\n buttonLabelDisabledFontColor,\n iconColor,\n standardPadding,\n controlHeight,\n errorTextFontLineHeight,\n} from '../../theme-provider/design-tokens';\nimport { styles as severityStyles } from '../severity/styles';\nimport { focusVisible } from '../../utilities/style/focus';\nimport { userSelectNone } from '../../utilities/style/user-select';\nimport { themeBehavior } from '../../utilities/style/theme';\nimport { Theme } from '../../theme-provider/types';\nimport { accessiblyHidden } from '../../utilities/style/accessibly-hidden';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled, top;\n\n @layer base {\n ${display('inline-flex')}\n ${severityStyles}\n :host {\n color: ${buttonLabelFontColor};\n font: ${buttonLabelFont};\n white-space: nowrap;\n outline: none;\n border: none;\n }\n\n ${'' /* Container wrapper for severity text to position against */}\n .container {\n display: inline-flex;\n width: 100%;\n height: 100%;\n position: relative;\n list-style: none;\n --ni-private-step-content-height: calc(${smallPadding} + ${controlSlimHeight} + ${errorTextFontLineHeight});\n --ni-private-step-content-offset: calc(${controlHeight} + ${smallPadding});\n }\n\n .control {\n display: inline-grid;\n height: 100%;\n width: 100%;\n grid-template-areas:\n \"icon top-spacer top-spacer\"\n \"icon title line\"\n \"icon subtitle subtitle\";\n grid-template-columns:\n ${controlHeight} ${'' /* Icon width */}\n min-content ${'' /* Show the full title and subtitle */}\n 1fr; ${'' /* Line is only fr unit so fills remaining space */}\n grid-template-rows:\n ${smallPadding}\n ${controlSlimHeight}\n min-content;\n column-gap: 4px;\n\n align-items: start;\n margin: 0;\n padding: 0;\n color: inherit;\n background-color: transparent;\n cursor: pointer;\n outline: none;\n --ni-private-step-icon-background-full-size: 100% 100%;\n ${'' /* 6px = (2px icon border + 1px inset) * 2 sides */}\n --ni-private-step-icon-background-inset-size: calc(100% - 6px) calc(100% - 6px);\n --ni-private-step-icon-background-none-size: 0% 0%;\n\n --ni-private-step-icon-color: ${buttonLabelFontColor};\n --ni-private-step-icon-border-color: transparent;\n --ni-private-step-icon-background-color: rgba(${borderRgbPartialColor}, 0.1);\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-full-size);\n --ni-private-step-icon-outline-inset-color: transparent;\n --ni-private-step-line-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n .container.last .control {\n grid-template-areas:\n \"icon top-spacer\"\n \"icon title\"\n \"icon subtitle\";\n grid-template-columns:\n ${controlHeight}\n min-content;\n grid-template-rows:\n ${smallPadding}\n ${controlSlimHeight}\n min-content;\n }\n\n .container.vertical .control {\n ${''/*\n Defines an interaction area clip-path that leaves out the severity text so it is easily selectable:\n 1----------------2\n | title |\n | subtitle |\n | 4-------------3\n | | severity-text\n | |\n 6--5\n */}\n clip-path: polygon(\n 0% 0%,\n 100% 0%,\n 100% var(--ni-private-step-content-height),\n var(--ni-private-step-content-offset) var(--ni-private-step-content-height),\n var(--ni-private-step-content-offset) 100%,\n 0% 100%\n );\n grid-template-areas:\n \"icon top-spacer\"\n \"icon title\"\n \"icon subtitle\"\n \"line subtitle\"\n \"line .\";\n grid-template-columns:\n ${controlHeight}\n min-content;\n grid-template-rows:\n ${smallPadding}\n ${controlSlimHeight}\n calc(${controlHeight} - ${smallPadding} - ${controlSlimHeight})\n min-content\n 1fr;\n }\n\n .container.vertical.last .control {\n grid-template-areas:\n \"icon top-spacer\"\n \"icon title\"\n \"icon subtitle\";\n grid-template-columns:\n ${controlHeight}\n min-content;\n grid-template-rows:\n ${smallPadding}\n ${controlSlimHeight}\n min-content;\n }\n\n :host([severity=\"error\"]) .control {\n --ni-private-step-icon-color: ${failColor};\n --ni-private-step-icon-border-color: ${failColor};\n --ni-private-step-icon-background-color: rgb(from ${failColor} r g b / 30%);\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-line-color: ${failColor};\n }\n\n :host([severity=\"warning\"]) .control {\n --ni-private-step-icon-color: ${warningColor};\n --ni-private-step-icon-border-color: ${warningColor};\n --ni-private-step-icon-background-color: rgb(from ${warningColor} r g b / 30%);\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-line-color: ${warningColor};\n }\n\n :host([severity=\"success\"]) .control {\n --ni-private-step-icon-color: var(--ni-private-step-icon-inverse-color);\n --ni-private-step-icon-border-color: ${passColor};\n --ni-private-step-icon-background-color: ${passColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-full-size);\n --ni-private-step-line-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([selected]) .control {\n --ni-private-step-icon-color: ${borderHoverColor};\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-color: rgb(from ${borderHoverColor} r g b / 30%);\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n .icon {\n grid-area: icon;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n height: ${controlHeight};\n width: ${controlHeight};\n ${userSelectNone};\n font: ${buttonLabelFont};\n color: var(--ni-private-step-icon-color);\n ${iconColor.cssCustomProperty}: var(--ni-private-step-icon-color);\n border-style: solid;\n border-radius: 100%;\n border-color: var(--ni-private-step-icon-border-color);\n border-width: 1px;\n background-image: radial-gradient(\n closest-side,\n ${'' /* Workaround to prevent aliasing on radial-gradient boundaries, see:\n https://frontendmasters.com/blog/obsessing-over-smooth-radial-gradient-disc-edges\n */}\n var(--ni-private-step-icon-background-color) calc(100% - 1px/var(--ni-private-device-pixel-ratio, 1)),\n transparent 100%\n );\n background-origin: border-box;\n background-size: var(--ni-private-step-icon-background-size);\n background-repeat: no-repeat;\n background-position: center center;\n position: relative;\n transition:\n border-color ${smallDelay} ease-in-out,\n border-width ${smallDelay} ease-in-out,\n background-size ${smallDelay} ease-out;\n }\n\n :host([selected]) .icon {\n border-width: 2px;\n }\n\n .icon::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n outline-color: var(--ni-private-step-icon-outline-inset-color);\n outline-style: solid;\n outline-width: 0px;\n outline-offset: 0px;\n border: 1px solid transparent;\n border-radius: 100%;\n color: transparent;\n background-clip: border-box;\n transition:\n outline-color ${smallDelay} ease-in-out,\n outline-width ${smallDelay} ease-in-out,\n outline-offset ${smallDelay} ease-in-out;\n }\n\n .current-label {\n ${accessiblyHidden}\n }\n\n .step-indicator {\n display: contents;\n }\n\n :host([severity=\"error\"]) .step-indicator,\n :host([severity=\"warning\"]) .step-indicator,\n :host([severity=\"success\"]) .step-indicator {\n display: none;\n }\n\n :host([selected]) .step-indicator,\n :host([disabled]) .step-indicator {\n display: contents;\n }\n\n .icon-severity {\n display: none;\n }\n\n :host([severity=\"error\"]) .icon-severity,\n :host([severity=\"warning\"]) .icon-severity,\n :host([severity=\"success\"]) .icon-severity {\n display: contents;\n }\n\n :host([selected]) .icon-severity,\n :host([disabled]) .icon-severity {\n display: none;\n }\n\n .top-spacer {\n grid-area: top-spacer;\n height: ${smallPadding};\n }\n\n .title {\n grid-area: title;\n min-width: min-content;\n height: ${controlSlimHeight};\n display: inline-block;\n align-content: center;\n font: ${bodyFont};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n [part='start'] {\n display: none;\n }\n\n [part='end'] {\n display: none;\n }\n\n .line {\n grid-area: line;\n align-self: center;\n justify-self: center;\n display: inline-block;\n width: 100%;\n min-width: ${standardPadding};\n height: 1px;\n min-height: 1px;\n background: var(--ni-private-step-line-color);\n background-clip: content-box;\n transform: scale(1, 1);\n transition:\n background-color ${smallDelay} ease-in-out,\n transform ${smallDelay} ease-in-out;\n }\n\n .container.last .line {\n display: none;\n }\n\n .container.vertical .line {\n width: 1px;\n min-width: 1px;\n height: 100%;\n padding-top: ${smallPadding};\n min-height: ${standardPadding};\n }\n\n .subtitle {\n grid-area: subtitle;\n display: inline-block;\n min-width: min-content;\n height: ${errorTextFontLineHeight};\n align-content: center;\n font: ${errorTextFont};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .severity-text {\n left: 0px;\n top: var(--ni-private-step-content-height);\n }\n\n .container.vertical .severity-text {\n width: calc(100% - var(--ni-private-step-content-offset));\n left: var(--ni-private-step-content-offset);\n }\n }\n\n @layer hover {\n .control:hover {\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n :host([severity=\"error\"]) .control:hover {\n --ni-private-step-icon-border-color: ${failColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-line-color: ${failColor};\n }\n\n :host([severity=\"warning\"]) .control:hover {\n --ni-private-step-icon-border-color: ${warningColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-line-color: ${warningColor};\n }\n\n :host([severity=\"success\"]) .control:hover {\n --ni-private-step-icon-color: var(--ni-private-step-icon-inverse-color);\n --ni-private-step-icon-border-color: ${passColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);\n --ni-private-step-line-color: ${passColor};\n }\n\n :host([selected]) .control:hover {\n --ni-private-step-icon-color: ${buttonLabelFontColor};\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n .control:hover .icon {\n border-width: 2px;\n }\n\n .control:hover .line {\n transform: scale(1, 2);\n }\n\n .container.vertical .control:hover .line {\n transform: scale(2, 1);\n }\n }\n\n @layer focusVisible {\n .control${focusVisible} {\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-outline-inset-color: ${borderHoverColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n :host([severity=\"error\"]) .control${focusVisible} {\n --ni-private-step-icon-border-color: ${failColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-icon-outline-inset-color: ${failColor};\n --ni-private-step-line-color: ${failColor};\n }\n\n :host([severity=\"warning\"]) .control${focusVisible} {\n --ni-private-step-icon-border-color: ${warningColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-icon-outline-inset-color: ${warningColor};\n --ni-private-step-line-color: ${warningColor};\n }\n\n :host([severity=\"success\"]) .control${focusVisible} {\n --ni-private-step-icon-color: var(--ni-private-step-icon-inverse-color);\n --ni-private-step-icon-border-color: ${passColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-inset-size);\n --ni-private-step-icon-outline-inset-color: transparent;\n --ni-private-step-line-color: ${passColor};\n }\n\n :host([selected]) .control${focusVisible} {\n --ni-private-step-icon-color: ${borderHoverColor};\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-none-size);\n --ni-private-step-icon-outline-inset-color: ${borderHoverColor};\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n .control${focusVisible} .icon {\n border-width: 2px;\n }\n\n .control${focusVisible} .icon::before {\n outline-width: ${borderWidth};\n outline-offset: -2px;\n }\n\n .control${focusVisible} .line {\n transform: scale(1, 2);\n }\n\n .container.vertical .control${focusVisible} .line {\n transform: scale(2, 1);\n }\n }\n\n @layer active {\n .control:active {\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-color: ${fillSelectedColor};\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-full-size);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n :host([severity=\"error\"]) .control:active {\n --ni-private-step-icon-border-color: ${failColor};\n --ni-private-step-icon-background-color: rgb(from ${failColor} r g b / 30%);\n --ni-private-step-line-color: ${failColor};\n }\n\n :host([severity=\"warning\"]) .control:active {\n --ni-private-step-icon-border-color: ${warningColor};\n --ni-private-step-icon-background-color: rgb(from ${warningColor} r g b / 30%);\n --ni-private-step-line-color: ${warningColor};\n }\n\n :host([severity=\"success\"]) .control:active {\n --ni-private-step-icon-color: ${buttonLabelFontColor};\n --ni-private-step-icon-border-color: ${passColor};\n --ni-private-step-icon-background-color: rgb(from ${passColor} r g b / 30%);\n --ni-private-step-line-color: ${passColor};\n }\n\n :host([selected]) .control:active {\n --ni-private-step-icon-color: ${buttonLabelFontColor};\n --ni-private-step-icon-border-color: ${borderHoverColor};\n --ni-private-step-icon-background-color: rgb(from ${borderHoverColor} r g b / 30%);\n --ni-private-step-line-color: ${borderHoverColor};\n }\n\n .control:active .icon {\n border-width: 2px;\n }\n\n .control:active .icon::before {\n outline-width: 0px;\n outline-offset: 0px;\n }\n\n .control:active .line {\n transform: scale(1, 1);\n }\n }\n\n @layer disabled {\n :host([disabled]) .control {\n cursor: default;\n color: ${buttonLabelDisabledFontColor};\n --ni-private-step-icon-color: rgb(from ${buttonLabelFontColor} r g b / 30%);\n --ni-private-step-icon-border-color: transparent;\n --ni-private-step-icon-background-color: rgba(${borderRgbPartialColor}, 0.1);\n --ni-private-step-icon-background-size: var(--ni-private-step-icon-background-full-size);\n --ni-private-step-icon-outline-inset-color: transparent;\n --ni-private-step-line-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([disabled]) .line {\n transform: scale(1, 1);\n }\n }\n\n @layer top {\n @media (prefers-reduced-motion) {\n .control {\n transition-duration: 0s;\n }\n }\n }\n`.withBehaviors(\n themeBehavior(\n Theme.light,\n css`\n @layer base {\n .control {\n --ni-private-step-icon-inverse-color: ${White};\n }\n }\n `\n ),\n themeBehavior(\n Theme.dark,\n css`\n @layer base {\n .control {\n --ni-private-step-icon-inverse-color: ${Black91};\n }\n }\n `\n ),\n themeBehavior(\n Theme.color,\n css`\n @layer base {\n .control {\n --ni-private-step-icon-inverse-color: ${Black15};\n }\n\n :host([severity=\"success\"]) .control {\n --ni-private-step-icon-background-color: rgb(from ${passColor} r g b / 30%);\n }\n }\n `\n )\n);\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StepPattern } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Page object base for step and anchor step
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class StepBasePageObject<T extends StepPattern = StepPattern> {
|
|
6
|
+
protected readonly element: T;
|
|
7
|
+
constructor(element: T);
|
|
8
|
+
getSuccessSeverityLabel(): string;
|
|
9
|
+
getErrorSeverityLabel(): string;
|
|
10
|
+
getWarningSeverityLabel(): string;
|
|
11
|
+
getSelectedStateLabel(): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { iconCheckTag } from '../../../icons/check';
|
|
2
|
+
import { iconExclamationMarkTag } from '../../../icons/exclamation-mark';
|
|
3
|
+
import { iconTriangleFilledTag } from '../../../icons/triangle-filled';
|
|
4
|
+
/**
|
|
5
|
+
* Page object base for step and anchor step
|
|
6
|
+
*/
|
|
7
|
+
export class StepBasePageObject {
|
|
8
|
+
constructor(element) {
|
|
9
|
+
this.element = element;
|
|
10
|
+
}
|
|
11
|
+
getSuccessSeverityLabel() {
|
|
12
|
+
const label = this.element.shadowRoot?.querySelector(`.icon-severity ${iconCheckTag}[aria-label]`)?.ariaLabel;
|
|
13
|
+
if (typeof label !== 'string') {
|
|
14
|
+
throw new Error('Success severity label not found');
|
|
15
|
+
}
|
|
16
|
+
return label;
|
|
17
|
+
}
|
|
18
|
+
getErrorSeverityLabel() {
|
|
19
|
+
const label = this.element.shadowRoot?.querySelector(`.icon-severity ${iconExclamationMarkTag}[aria-label]`)?.ariaLabel;
|
|
20
|
+
if (typeof label !== 'string') {
|
|
21
|
+
throw new Error('Error severity label not found');
|
|
22
|
+
}
|
|
23
|
+
return label;
|
|
24
|
+
}
|
|
25
|
+
getWarningSeverityLabel() {
|
|
26
|
+
const label = this.element.shadowRoot?.querySelector(`.icon-severity ${iconTriangleFilledTag}[aria-label]`)?.ariaLabel;
|
|
27
|
+
if (typeof label !== 'string') {
|
|
28
|
+
throw new Error('Warning severity label not found');
|
|
29
|
+
}
|
|
30
|
+
return label;
|
|
31
|
+
}
|
|
32
|
+
getSelectedStateLabel() {
|
|
33
|
+
const label = this.element.shadowRoot?.querySelector('.current-label')?.textContent;
|
|
34
|
+
if (typeof label !== 'string') {
|
|
35
|
+
throw new Error('Selected state label not found');
|
|
36
|
+
}
|
|
37
|
+
return label;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=step-base.pageobject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-base.pageobject.js","sourceRoot":"","sources":["../../../../../src/patterns/step/testing/step-base.pageobject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAGvE;;GAEG;AACH,MAAM,OAAgB,kBAAkB;IACpC,YACuB,OAAU;QAAV,YAAO,GAAP,OAAO,CAAG;IAC9B,CAAC;IAEG,uBAAuB;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,kBAAkB,YAAY,cAAc,CAAC,EAAE,SAAS,CAAC;QAC9G,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,qBAAqB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,kBAAkB,sBAAsB,cAAc,CAAC,EAAE,SAAS,CAAC;QACxH,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,uBAAuB;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,kBAAkB,qBAAqB,cAAc,CAAC,EAAE,SAAS,CAAC;QACvH,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,qBAAqB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC;QACpF,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ","sourcesContent":["import { iconCheckTag } from '../../../icons/check';\nimport { iconExclamationMarkTag } from '../../../icons/exclamation-mark';\nimport { iconTriangleFilledTag } from '../../../icons/triangle-filled';\nimport type { StepPattern } from '../types';\n\n/**\n * Page object base for step and anchor step\n */\nexport abstract class StepBasePageObject<T extends StepPattern = StepPattern> {\n public constructor(\n protected readonly element: T,\n ) {}\n\n public getSuccessSeverityLabel(): string {\n const label = this.element.shadowRoot?.querySelector(`.icon-severity ${iconCheckTag}[aria-label]`)?.ariaLabel;\n if (typeof label !== 'string') {\n throw new Error('Success severity label not found');\n }\n return label;\n }\n\n public getErrorSeverityLabel(): string {\n const label = this.element.shadowRoot?.querySelector(`.icon-severity ${iconExclamationMarkTag}[aria-label]`)?.ariaLabel;\n if (typeof label !== 'string') {\n throw new Error('Error severity label not found');\n }\n return label;\n }\n\n public getWarningSeverityLabel(): string {\n const label = this.element.shadowRoot?.querySelector(`.icon-severity ${iconTriangleFilledTag}[aria-label]`)?.ariaLabel;\n if (typeof label !== 'string') {\n throw new Error('Warning severity label not found');\n }\n return label;\n }\n\n public getSelectedStateLabel(): string {\n const label = this.element.shadowRoot?.querySelector('.current-label')?.textContent;\n if (typeof label !== 'string') {\n throw new Error('Selected state label not found');\n }\n return label;\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SeverityPattern } from '../severity/types';
|
|
2
2
|
import type { StepInternals } from './models/step-internals';
|
|
3
|
-
export interface StepPattern extends SeverityPattern {
|
|
3
|
+
export interface StepPattern extends SeverityPattern, HTMLElement {
|
|
4
4
|
/**
|
|
5
5
|
* Whether or not the step is disabled.
|
|
6
6
|
*/
|
|
@@ -14,7 +14,8 @@ export interface StepPattern extends SeverityPattern {
|
|
|
14
14
|
*/
|
|
15
15
|
selected: boolean;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Internal step state set by the stepper
|
|
18
|
+
* @internal
|
|
18
19
|
*/
|
|
19
20
|
stepInternals: StepInternals;
|
|
20
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/step/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SeverityPattern } from '../severity/types';\nimport type { StepInternals } from './models/step-internals';\n\nexport interface StepPattern extends SeverityPattern {\n /**\n * Whether or not the step is disabled.\n */\n disabled: boolean;\n\n /**\n * Whether or not the step is readOnly.\n */\n readOnly: boolean;\n\n /**\n * Whether or not the step is selected.\n */\n selected: boolean;\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/step/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SeverityPattern } from '../severity/types';\nimport type { StepInternals } from './models/step-internals';\n\nexport interface StepPattern extends SeverityPattern, HTMLElement {\n /**\n * Whether or not the step is disabled.\n */\n disabled: boolean;\n\n /**\n * Whether or not the step is readOnly.\n */\n readOnly: boolean;\n\n /**\n * Whether or not the step is selected.\n */\n selected: boolean;\n\n /**\n * Internal step state set by the stepper\n * @internal\n */\n stepInternals: StepInternals;\n}\n"]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { html, ref,
|
|
1
|
+
import { html, ref, ViewTemplate, when } from '@ni/fast-element';
|
|
2
2
|
import { endSlotTemplate, startSlotTemplate } from '@ni/fast-foundation';
|
|
3
3
|
import { severityTextTemplate } from '../patterns/severity/template';
|
|
4
4
|
import { iconCheckTag } from '../icons/check';
|
|
5
5
|
import { iconExclamationMarkTag } from '../icons/exclamation-mark';
|
|
6
6
|
import { iconTriangleFilledTag } from '../icons/triangle-filled';
|
|
7
7
|
import { Severity } from '../patterns/severity/types';
|
|
8
|
+
import { popupIconCompletedLabel, popupIconCurrentLabel, popupIconErrorLabel, popupIconWarningLabel } from '../label-provider/core/label-tokens';
|
|
8
9
|
export const template = (context, definition) => html `
|
|
9
10
|
<template slot="step">
|
|
10
|
-
<
|
|
11
|
+
<li class="
|
|
11
12
|
container
|
|
12
13
|
${x => (x.stepInternals.orientation === 'vertical' ? 'vertical' : '')}
|
|
13
14
|
${x => (x.stepInternals.last ? 'last' : '')}
|
|
@@ -50,28 +51,22 @@ export const template = (context, definition) => html `
|
|
|
50
51
|
aria-roledescription="${x => x.ariaRoledescription}"
|
|
51
52
|
${ref('control')}
|
|
52
53
|
>
|
|
53
|
-
<div class="icon">
|
|
54
|
-
<
|
|
54
|
+
<div class="icon">
|
|
55
|
+
<span class="current-label">${x => (x.selected ? popupIconCurrentLabel.getValueFor(x) : '')}</span>
|
|
56
|
+
<div class="step-indicator"><slot name="step-indicator"><span aria-hidden="true">${x => x.stepInternals.position}</span></slot></div>
|
|
55
57
|
<div class="icon-severity">
|
|
56
|
-
${when(x => x.severity === Severity.error, html `<${iconExclamationMarkTag}></${iconExclamationMarkTag}>`)}
|
|
57
|
-
${when(x => x.severity === Severity.warning, html `<${iconTriangleFilledTag}></${iconTriangleFilledTag}>`)}
|
|
58
|
-
${when(x => x.severity === Severity.success, html `<${iconCheckTag}></${iconCheckTag}>`)}
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
<div class="content">
|
|
62
|
-
<div class="title-wrapper">
|
|
63
|
-
${startSlotTemplate(context, definition)}
|
|
64
|
-
<div class="title"><slot name="title"></slot></div>
|
|
65
|
-
${endSlotTemplate(context, definition)}
|
|
66
|
-
<div class="line"></div>
|
|
67
|
-
</div>
|
|
68
|
-
<div class="subtitle">
|
|
69
|
-
<slot name="subtitle"></slot>
|
|
58
|
+
${when(x => x.severity === Severity.error, html `<${iconExclamationMarkTag} role="img" aria-label="${x => popupIconErrorLabel.getValueFor(x)}"></${iconExclamationMarkTag}>`)}
|
|
59
|
+
${when(x => x.severity === Severity.warning, html `<${iconTriangleFilledTag} role="img" aria-label="${x => popupIconWarningLabel.getValueFor(x)}"></${iconTriangleFilledTag}>`)}
|
|
60
|
+
${when(x => x.severity === Severity.success, html `<${iconCheckTag} role="img" aria-label="${x => popupIconCompletedLabel.getValueFor(x)}"></${iconCheckTag}>`)}
|
|
70
61
|
</div>
|
|
71
62
|
</div>
|
|
63
|
+
<div class="top-spacer"></div>
|
|
64
|
+
<div class="title">${startSlotTemplate(context, definition)}<slot name="title"></slot>${endSlotTemplate(context, definition)}</div>
|
|
65
|
+
<div class="line"></div>
|
|
66
|
+
<div class="subtitle"><slot name="subtitle"></slot></div>
|
|
72
67
|
</button>
|
|
73
68
|
${severityTextTemplate}
|
|
74
|
-
</
|
|
69
|
+
</li>
|
|
75
70
|
</template>
|
|
76
71
|
`;
|
|
77
72
|
//# sourceMappingURL=template.js.map
|