@ni/nimble-components 11.15.1 → 12.0.1
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 +460 -416
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +929 -911
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/breadcrumb/index.d.ts +2 -0
- package/dist/esm/breadcrumb/index.js +5 -0
- package/dist/esm/breadcrumb/index.js.map +1 -1
- package/dist/esm/breadcrumb/styles.js +4 -4
- package/dist/esm/breadcrumb/types.d.ts +9 -0
- package/dist/esm/breadcrumb/types.js +9 -0
- package/dist/esm/breadcrumb/types.js.map +1 -0
- package/dist/esm/button/index.d.ts +9 -3
- package/dist/esm/button/index.js +3 -0
- package/dist/esm/button/index.js.map +1 -1
- package/dist/esm/button/styles.js +17 -14
- package/dist/esm/button/styles.js.map +1 -1
- package/dist/esm/button/types.d.ts +9 -0
- package/dist/esm/button/types.js +8 -0
- package/dist/esm/button/types.js.map +1 -1
- package/dist/esm/combobox/index.d.ts +6 -6
- package/dist/esm/combobox/index.js +15 -9
- package/dist/esm/combobox/index.js.map +1 -1
- package/dist/esm/combobox/styles.js +5 -5
- package/dist/esm/drawer/styles.js +0 -4
- package/dist/esm/drawer/styles.js.map +1 -1
- package/dist/esm/icon-base/index.d.ts +9 -2
- package/dist/esm/icon-base/index.js +6 -1
- package/dist/esm/icon-base/index.js.map +1 -1
- package/dist/esm/icon-base/styles.js +4 -4
- package/dist/esm/icon-base/types.d.ts +6 -6
- package/dist/esm/icon-base/types.js +5 -5
- package/dist/esm/icon-base/types.js.map +1 -1
- package/dist/esm/list-option/styles.js +2 -2
- package/dist/esm/menu-button/index.d.ts +5 -5
- package/dist/esm/menu-button/index.js.map +1 -1
- package/dist/esm/menu-button/template.d.ts +1 -3
- package/dist/esm/menu-button/template.js +6 -5
- package/dist/esm/menu-button/template.js.map +1 -1
- package/dist/esm/number-field/index.d.ts +4 -5
- package/dist/esm/number-field/index.js +23 -12
- package/dist/esm/number-field/index.js.map +1 -1
- package/dist/esm/number-field/styles.js +5 -4
- package/dist/esm/number-field/styles.js.map +1 -1
- package/dist/esm/patterns/button/types.d.ts +1 -1
- package/dist/esm/patterns/dropdown/styles.js +1 -1
- package/dist/esm/patterns/dropdown/types.d.ts +8 -0
- package/dist/esm/patterns/dropdown/types.js +2 -3
- package/dist/esm/patterns/dropdown/types.js.map +1 -1
- package/dist/esm/patterns/error/styles.js +4 -4
- package/dist/esm/patterns/error/template.d.ts +2 -2
- package/dist/esm/patterns/error/template.js.map +1 -1
- package/dist/esm/patterns/error/types.d.ts +5 -4
- package/dist/esm/text-field/index.d.ts +5 -5
- package/dist/esm/text-field/index.js +13 -8
- package/dist/esm/text-field/index.js.map +1 -1
- package/dist/esm/text-field/styles.js +6 -6
- package/dist/esm/toggle-button/index.d.ts +2 -2
- package/dist/esm/tooltip/index.d.ts +8 -0
- package/dist/esm/tooltip/index.js +12 -0
- package/dist/esm/tooltip/index.js.map +1 -1
- package/dist/esm/tooltip/styles.js +8 -8
- package/dist/esm/tooltip/template.d.ts +1 -3
- package/dist/esm/tooltip/template.js +13 -8
- package/dist/esm/tooltip/template.js.map +1 -1
- package/dist/esm/tooltip/types.d.ts +4 -4
- package/dist/esm/tooltip/types.js +3 -3
- package/dist/esm/tooltip/types.js.map +1 -1
- package/dist/esm/tree-item/styles.d.ts +1 -3
- package/dist/esm/tree-item/styles.js +181 -176
- package/dist/esm/tree-item/styles.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/menu-button/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EACH,WAAW,EACX,YAAY,EACZ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} from '@microsoft/fast-element';
|
|
2
|
-
import type { FoundationElementTemplate } from '@microsoft/fast-foundation';
|
|
3
1
|
import type { MenuButton } from '.';
|
|
4
|
-
export declare const template:
|
|
2
|
+
export declare const template: import("@microsoft/fast-element").ViewTemplate<MenuButton, any>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { elements, html, ref, slotted, when } from '@microsoft/fast-element';
|
|
2
|
+
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
2
3
|
import { ToggleButton } from '../toggle-button';
|
|
3
4
|
import { AnchoredRegion } from '../anchored-region';
|
|
4
5
|
// prettier-ignore
|
|
5
|
-
export const template =
|
|
6
|
+
export const template = html `
|
|
6
7
|
<template
|
|
7
8
|
?open="${x => x.open}"
|
|
8
9
|
@focusout="${(x, c) => x.focusoutHandler(c.event)}"
|
|
9
10
|
>
|
|
10
|
-
<${
|
|
11
|
+
<${DesignSystem.tagFor(ToggleButton)}
|
|
11
12
|
part="button"
|
|
12
13
|
appearance="${x => x.appearance}"
|
|
13
14
|
?content-hidden="${x => x.contentHidden}"
|
|
@@ -24,9 +25,9 @@ export const template = context => html `
|
|
|
24
25
|
<slot slot="start" name="start"></slot>
|
|
25
26
|
<slot></slot>
|
|
26
27
|
<slot slot="end" name="end"></slot>
|
|
27
|
-
</${
|
|
28
|
+
</${DesignSystem.tagFor(ToggleButton)}>
|
|
28
29
|
${when(x => x.open, html `
|
|
29
|
-
<${
|
|
30
|
+
<${DesignSystem.tagFor(AnchoredRegion)}
|
|
30
31
|
fixed-placement="true"
|
|
31
32
|
auto-update-mode="auto"
|
|
32
33
|
horizontal-inset="true"
|
|
@@ -40,7 +41,7 @@ export const template = context => html `
|
|
|
40
41
|
<span part="menu">
|
|
41
42
|
<slot name="menu" ${slotted({ property: 'slottedMenus', filter: elements('[role=menu]') })}></slot>
|
|
42
43
|
</span>
|
|
43
|
-
</${
|
|
44
|
+
</${DesignSystem.tagFor(AnchoredRegion)}>
|
|
44
45
|
`)}
|
|
45
46
|
</template>
|
|
46
47
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/menu-button/template.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/menu-button/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAY;;iBAEvB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;qBACP,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,KAAmB,CAAC;;WAE5D,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC;;0BAElB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU;+BACZ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa;wBAC3B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;yBACV,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;;6BAEX,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;uBACjB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,KAAK,CAAC;wBACpD,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,KAAsB,CAAC;cAC1E,GAAG,CAAC,cAAc,CAAC;;;cAGnB,EAAE,CAAC,wFAAwF;;;;YAI7F,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC;UACnC,IAAI,CACN,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EACX,IAAI,CAAY;eACT,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC;;;;;6CAKL,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC;6CAC1D,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;2BAClE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAmB,EAAE;4BAC3B,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,KAAsB,CAAC;kBAClE,GAAG,CAAC,QAAQ,CAAC;;;wCAGS,OAAO,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;;gBAE9F,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC;SAC1C,CACJ;;CAEJ,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { NumberField as FoundationNumberField } from '@microsoft/fast-foundation';
|
|
2
2
|
import { NumberFieldAppearance } from './types';
|
|
3
|
-
import '../
|
|
4
|
-
import '../icons/exclamation-mark';
|
|
5
|
-
import '../icons/minus-wide';
|
|
3
|
+
import type { ErrorPattern } from '../patterns/error/types';
|
|
6
4
|
declare global {
|
|
7
5
|
interface HTMLElementTagNameMap {
|
|
8
6
|
'nimble-number-field': NumberField;
|
|
@@ -11,7 +9,7 @@ declare global {
|
|
|
11
9
|
/**
|
|
12
10
|
* A nimble-styled HTML number input
|
|
13
11
|
*/
|
|
14
|
-
export declare class NumberField extends FoundationNumberField {
|
|
12
|
+
export declare class NumberField extends FoundationNumberField implements ErrorPattern {
|
|
15
13
|
appearance: NumberFieldAppearance;
|
|
16
14
|
/**
|
|
17
15
|
* A message explaining why the value is invalid.
|
|
@@ -20,6 +18,7 @@ export declare class NumberField extends FoundationNumberField {
|
|
|
20
18
|
* @remarks
|
|
21
19
|
* HTML Attribute: error-text
|
|
22
20
|
*/
|
|
23
|
-
errorText
|
|
21
|
+
errorText?: string;
|
|
22
|
+
errorVisible: boolean;
|
|
24
23
|
connectedCallback(): void;
|
|
25
24
|
}
|
|
@@ -4,9 +4,10 @@ import { DesignSystem, NumberField as FoundationNumberField, numberFieldTemplate
|
|
|
4
4
|
import { styles } from './styles';
|
|
5
5
|
import { NumberFieldAppearance } from './types';
|
|
6
6
|
import { errorTextTemplate } from '../patterns/error/template';
|
|
7
|
-
import '../
|
|
8
|
-
import '../icons/
|
|
9
|
-
import '../icons/
|
|
7
|
+
import { Button } from '../button';
|
|
8
|
+
import { IconMinusWide } from '../icons/minus-wide';
|
|
9
|
+
import { IconAdd } from '../icons/add';
|
|
10
|
+
import { IconExclamationMark } from '../icons/exclamation-mark';
|
|
10
11
|
/**
|
|
11
12
|
* A nimble-styled HTML number input
|
|
12
13
|
*/
|
|
@@ -14,6 +15,7 @@ export class NumberField extends FoundationNumberField {
|
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
17
|
this.appearance = NumberFieldAppearance.underline;
|
|
18
|
+
this.errorVisible = false;
|
|
17
19
|
}
|
|
18
20
|
connectedCallback() {
|
|
19
21
|
super.connectedCallback();
|
|
@@ -27,6 +29,9 @@ __decorate([
|
|
|
27
29
|
__decorate([
|
|
28
30
|
attr({ attribute: 'error-text' })
|
|
29
31
|
], NumberField.prototype, "errorText", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
attr({ attribute: 'error-visible', mode: 'boolean' })
|
|
34
|
+
], NumberField.prototype, "errorVisible", void 0);
|
|
30
35
|
/**
|
|
31
36
|
* A function that returns a number-field registration for configuring the component with a DesignSystem.
|
|
32
37
|
*
|
|
@@ -44,31 +49,37 @@ const nimbleNumberField = NumberField.compose({
|
|
|
44
49
|
delegatesFocus: true
|
|
45
50
|
},
|
|
46
51
|
stepDownGlyph: html `
|
|
47
|
-
|
|
52
|
+
<${DesignSystem.tagFor(Button)}
|
|
48
53
|
class="step-up-down-button"
|
|
49
54
|
appearance="ghost"
|
|
50
55
|
content-hidden
|
|
51
56
|
tabindex="-1"
|
|
52
57
|
>
|
|
53
58
|
"Decrement"
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
<${DesignSystem.tagFor(IconMinusWide)}
|
|
60
|
+
slot="start"
|
|
61
|
+
>
|
|
62
|
+
</${DesignSystem.tagFor(IconMinusWide)}>
|
|
63
|
+
</${DesignSystem.tagFor(Button)}>
|
|
56
64
|
`,
|
|
57
65
|
stepUpGlyph: html `
|
|
58
|
-
|
|
66
|
+
<${DesignSystem.tagFor(Button)}
|
|
59
67
|
class="step-up-down-button"
|
|
60
68
|
appearance="ghost"
|
|
61
69
|
content-hidden
|
|
62
70
|
tabindex="-1"
|
|
63
71
|
>
|
|
64
72
|
"Increment"
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
<${DesignSystem.tagFor(IconAdd)}
|
|
74
|
+
slot="start">
|
|
75
|
+
</${DesignSystem.tagFor(IconAdd)}>
|
|
76
|
+
</${DesignSystem.tagFor(Button)}>
|
|
67
77
|
`,
|
|
68
78
|
end: html `
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
<${DesignSystem.tagFor(IconExclamationMark)}
|
|
80
|
+
severity="error"
|
|
81
|
+
class="error-icon"
|
|
82
|
+
></${DesignSystem.tagFor(IconExclamationMark)}>
|
|
72
83
|
${errorTextTemplate}
|
|
73
84
|
`
|
|
74
85
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/number-field/index.ts"],"names":[],"mappings":";AAAA,OAAO,E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CACsE;AAU3E;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CACR;AAG1B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;iDAC1B;AAUhC;;;;;;;GAOG;AACH,MAAM,iBAAiB,GAAG,WAAW,CAAC,OAAO,CAAqB;IAC9D,QAAQ,EAAE,cAAc;IACxB,SAAS,EAAE,qBAAqB;IAChC,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;IACD,aAAa,EAAE,IAAI,CAAA;WACZ,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC;;;;;;;eAOvB,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC;;;gBAGjC,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC;YACtC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC;KAClC;IACD,WAAW,EAAE,IAAI,CAAA;WACV,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC;;;;;;;eAOvB,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC;;gBAE3B,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC;YAChC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC;KAClC;IACD,GAAG,EAAE,IAAI,CAAa;WACf,YAAY,CAAC,MAAM,CAAC,mBAAmB,CAAC;;;aAGtC,YAAY,CAAC,MAAM,CAAC,mBAAmB,CAAC;UAC3C,iBAAiB;KACtB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,CAAC"}
|
|
@@ -55,7 +55,7 @@ export const styles = css `
|
|
|
55
55
|
border-color: rgba(${borderRgbPartialColor}, 0.1);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
:host(
|
|
58
|
+
:host([error-visible]) .root {
|
|
59
59
|
border-bottom-color: ${failColor};
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -84,7 +84,7 @@ export const styles = css `
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
:host(
|
|
87
|
+
:host([error-visible]) .root::after {
|
|
88
88
|
border-bottom-color: ${failColor};
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -132,7 +132,8 @@ export const styles = css `
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
${
|
|
135
|
-
/* We are using flex `order` to define the visual ordering of the inc/dec buttons
|
|
135
|
+
/* We are using flex `order` to define the visual ordering of the inc/dec buttons
|
|
136
|
+
and the invalid icon because they are not "interactive" i.e. part of the tab order */ ''}
|
|
136
137
|
.step-up {
|
|
137
138
|
order: 3;
|
|
138
139
|
padding-right: calc(${standardPadding} / 4);
|
|
@@ -165,7 +166,7 @@ export const styles = css `
|
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
.root:focus-within,
|
|
168
|
-
:host(
|
|
169
|
+
:host([error-visible]) .root {
|
|
169
170
|
border-bottom-width: ${borderWidth};
|
|
170
171
|
padding-bottom: 0;
|
|
171
172
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/number-field/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,eAAe,EACf,6BAA6B,EAChC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;A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,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,cAAc,CAAC;MACvB,WAAW;;;gBAGD,QAAQ;;;iBAGP,aAAa;uBACP,WAAW,MAAM,aAAa;mDACF,WAAW;;cAEhD,aAAa,UAAU,WAAW;;;;;iBAK/B,qBAAqB;;;;;;iBAMrB,qBAAqB;gBACtB,gBAAgB;;;;iBAIf,6BAA6B;;;;;;;;;;;iCAWb,qBAAqB;mBACnC,WAAW;;;;+BAIC,gBAAgB;;;;6BAIlB,qBAAqB;;;;+BAInB,SAAS;;;;UAI9B,CAAA,yCAA0C,EAAE;;;;;;;;;;4BAU1B,WAAW;;;yBAGd,gBAAgB;;4BAEb,UAAU;;;;;;;;;;+BAUP,SAAS;;;;;;;;;;;;;;;;;;;;;;;;6BAwBX,eAAe;;;;;;;;;;;iBAW3B,qBAAqB;;;;iBAIrB,qBAAqB;;;;;;;MAOhC;AACE;sFACsF,CAAC,EAC3F;;;8BAG0B,eAAe;;;;;;;;UAQnC,aAAa,CAAC,iBAAiB;;;;;;;;;8BASX,eAAe;;CAE5C,CAAC,aAAa,CACX,kBAAkB,CACd,qBAAqB,CAAC,SAAS,EAC/B,GAAG,CAAA;;uCAE4B,WAAW;;;SAGzC,CACJ,EACD,kBAAkB,CACd,qBAAqB,CAAC,KAAK,EAC3B,GAAG,CAAA;;yCAE8B,qBAAqB;;;;;uCAKvB,WAAW;;;;;;;;;yCAST,qBAAqB;;SAErD,CACJ,EACD,kBAAkB,CACd,qBAAqB,CAAC,OAAO,EAC7B,GAAG,CAAA;;gCAEqB,WAAW;;;SAGlC,CACJ,CACJ,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import type { ErrorPattern } from '../error/types';
|
|
2
|
+
/**
|
|
3
|
+
* The interface that dropdowns of various types implement. The properties in this interface
|
|
4
|
+
* are leveraged by the shared dropdown pattern css.
|
|
5
|
+
*/
|
|
6
|
+
export interface DropdownPattern extends ErrorPattern {
|
|
7
|
+
position?: DropdownPosition;
|
|
8
|
+
}
|
|
1
9
|
export declare const DropdownPosition: {
|
|
2
10
|
readonly above: "above";
|
|
3
11
|
readonly below: "below";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/dropdown/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/patterns/dropdown/types.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACR,CAAC;AAIX,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACR,CAAC"}
|
|
@@ -5,7 +5,7 @@ export const styles = css `
|
|
|
5
5
|
display: none;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
:host(
|
|
8
|
+
:host([error-visible]) .error-icon {
|
|
9
9
|
display: inline-flex;
|
|
10
10
|
width: ${iconSize};
|
|
11
11
|
height: ${iconSize};
|
|
@@ -16,7 +16,7 @@ export const styles = css `
|
|
|
16
16
|
display: none;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
:host(
|
|
19
|
+
:host([error-visible]) .error-text {
|
|
20
20
|
display: block;
|
|
21
21
|
font: ${errorTextFont};
|
|
22
22
|
color: ${failColor};
|
|
@@ -29,11 +29,11 @@ export const styles = css `
|
|
|
29
29
|
white-space: nowrap;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
:host(
|
|
32
|
+
:host([error-visible][readonly]:not([disabled])) .error-text {
|
|
33
33
|
top: calc(${controlHeight} - ${borderWidth});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
:host(
|
|
36
|
+
:host([error-visible]) .error-text:empty {
|
|
37
37
|
display: none;
|
|
38
38
|
}
|
|
39
39
|
`;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const errorTextTemplate: import("@microsoft/fast-element").ViewTemplate<
|
|
1
|
+
import type { ErrorPattern } from './types';
|
|
2
|
+
export declare const errorTextTemplate: import("@microsoft/fast-element").ViewTemplate<ErrorPattern, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/patterns/error/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/patterns/error/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAc;qCACd,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;UAC3C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;;CAEzB,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This interface should be used by components that want to leverage the
|
|
2
|
+
* This interface should be used by components that want to leverage the error pattern. The error pattern conditionally adds error text to the template when an error is configured to be visible.
|
|
3
3
|
*/
|
|
4
|
-
export interface
|
|
4
|
+
export interface ErrorPattern {
|
|
5
5
|
/**
|
|
6
|
-
* The error text that will be displayed when a component
|
|
6
|
+
* The error text that will be displayed when a component is in the error appearance
|
|
7
7
|
*/
|
|
8
|
-
errorText
|
|
8
|
+
errorText?: string;
|
|
9
|
+
errorVisible: boolean;
|
|
9
10
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TextField as FoundationTextField } from '@microsoft/fast-foundation';
|
|
2
|
-
import '../icons/exclamation-mark';
|
|
3
2
|
import { TextFieldAppearance } from './types';
|
|
4
|
-
import type {
|
|
3
|
+
import type { ErrorPattern } from '../patterns/error/types';
|
|
5
4
|
declare global {
|
|
6
5
|
interface HTMLElementTagNameMap {
|
|
7
6
|
'nimble-text-field': TextField;
|
|
@@ -10,7 +9,7 @@ declare global {
|
|
|
10
9
|
/**
|
|
11
10
|
* A nimble-styed HTML text input
|
|
12
11
|
*/
|
|
13
|
-
export declare class TextField extends FoundationTextField implements
|
|
12
|
+
export declare class TextField extends FoundationTextField implements ErrorPattern {
|
|
14
13
|
/**
|
|
15
14
|
* The appearance the text field should have.
|
|
16
15
|
*
|
|
@@ -26,6 +25,7 @@ export declare class TextField extends FoundationTextField implements IHasErrorT
|
|
|
26
25
|
* @remarks
|
|
27
26
|
* HTML Attribute: error-text
|
|
28
27
|
*/
|
|
29
|
-
errorText
|
|
30
|
-
|
|
28
|
+
errorText?: string;
|
|
29
|
+
errorVisible: boolean;
|
|
30
|
+
fullBleed: boolean;
|
|
31
31
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { attr, html } from '@microsoft/fast-element';
|
|
3
3
|
import { DesignSystem, TextField as FoundationTextField, textFieldTemplate as template } from '@microsoft/fast-foundation';
|
|
4
|
-
import '../icons/exclamation-mark';
|
|
5
4
|
import { styles } from './styles';
|
|
6
5
|
import { TextFieldAppearance } from './types';
|
|
7
6
|
import { errorTextTemplate } from '../patterns/error/template';
|
|
7
|
+
import { IconExclamationMark } from '../icons/exclamation-mark';
|
|
8
8
|
/**
|
|
9
9
|
* A nimble-styed HTML text input
|
|
10
10
|
*/
|
|
@@ -19,10 +19,8 @@ export class TextField extends FoundationTextField {
|
|
|
19
19
|
* HTML Attribute: appearance
|
|
20
20
|
*/
|
|
21
21
|
this.appearance = TextFieldAppearance.underline;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
super.connectedCallback();
|
|
25
|
-
this.control.setAttribute('aria-errormessage', 'errortext');
|
|
22
|
+
this.errorVisible = false;
|
|
23
|
+
this.fullBleed = false;
|
|
26
24
|
}
|
|
27
25
|
}
|
|
28
26
|
__decorate([
|
|
@@ -31,6 +29,12 @@ __decorate([
|
|
|
31
29
|
__decorate([
|
|
32
30
|
attr({ attribute: 'error-text' })
|
|
33
31
|
], TextField.prototype, "errorText", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
attr({ attribute: 'error-visible', mode: 'boolean' })
|
|
34
|
+
], TextField.prototype, "errorVisible", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
attr({ attribute: 'full-bleed', mode: 'boolean' })
|
|
37
|
+
], TextField.prototype, "fullBleed", void 0);
|
|
34
38
|
const nimbleTextField = TextField.compose({
|
|
35
39
|
baseName: 'text-field',
|
|
36
40
|
baseClass: FoundationTextField,
|
|
@@ -40,9 +44,10 @@ const nimbleTextField = TextField.compose({
|
|
|
40
44
|
delegatesFocus: true
|
|
41
45
|
},
|
|
42
46
|
end: html `
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
<${DesignSystem.tagFor(IconExclamationMark)}
|
|
48
|
+
severity="error"
|
|
49
|
+
class="error-icon"
|
|
50
|
+
></${DesignSystem.tagFor(IconExclamationMark)}>
|
|
46
51
|
<span part="actions">
|
|
47
52
|
<slot name="actions"></slot>
|
|
48
53
|
</span>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/text-field/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACH,YAAY,EACZ,SAAS,IAAI,mBAAmB,EAEhC,iBAAiB,IAAI,QAAQ,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/text-field/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACH,YAAY,EACZ,SAAS,IAAI,mBAAmB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
59
|
border-color: rgba(${borderRgbPartialColor}, 0.1);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
:host(
|
|
62
|
+
:host([error-visible]) .root {
|
|
63
63
|
border-bottom-color: ${failColor};
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -67,7 +67,7 @@ export const styles = css `
|
|
|
67
67
|
border-bottom-color: ${borderHoverColor};
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
:host([appearance='frameless']
|
|
70
|
+
:host([appearance='frameless'][full-bleed]) .root {
|
|
71
71
|
padding-left: 0px;
|
|
72
72
|
padding-right: 0px;
|
|
73
73
|
}
|
|
@@ -80,7 +80,7 @@ export const styles = css `
|
|
|
80
80
|
user-select: none;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
:host([appearance='frameless']
|
|
83
|
+
:host([appearance='frameless'][full-bleed]) .root::before {
|
|
84
84
|
display: none;
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -92,7 +92,7 @@ export const styles = css `
|
|
|
92
92
|
user-select: none;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
:host([appearance='frameless']
|
|
95
|
+
:host([appearance='frameless'][full-bleed]) .root::after {
|
|
96
96
|
display: none;
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -162,7 +162,7 @@ export const styles = css `
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
:host(
|
|
165
|
+
:host([error-visible]) [part='end']::after {
|
|
166
166
|
border-bottom-color: ${failColor};
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -198,7 +198,7 @@ export const styles = css `
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
.root:focus-within,
|
|
201
|
-
:host(
|
|
201
|
+
:host([error-visible]) .root {
|
|
202
202
|
border-bottom-width: ${borderWidth};
|
|
203
203
|
padding-bottom: 0;
|
|
204
204
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DelegatesARIAButton, StartEnd, Switch as FoundationSwitch } from '@microsoft/fast-foundation';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ButtonPattern } from '../patterns/button/types';
|
|
3
3
|
import { ButtonAppearance } from './types';
|
|
4
4
|
declare global {
|
|
5
5
|
interface HTMLElementTagNameMap {
|
|
@@ -9,7 +9,7 @@ declare global {
|
|
|
9
9
|
/**
|
|
10
10
|
* A nimble-styled toggle button control.
|
|
11
11
|
*/
|
|
12
|
-
export declare class ToggleButton extends FoundationSwitch implements
|
|
12
|
+
export declare class ToggleButton extends FoundationSwitch implements ButtonPattern {
|
|
13
13
|
/**
|
|
14
14
|
* @public
|
|
15
15
|
* @remarks
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Tooltip as FoundationTooltip } from '@microsoft/fast-foundation';
|
|
2
|
+
import type { TooltipSeverity } from './types';
|
|
2
3
|
declare global {
|
|
3
4
|
interface HTMLElementTagNameMap {
|
|
4
5
|
'nimble-tooltip': Tooltip;
|
|
@@ -8,4 +9,11 @@ declare global {
|
|
|
8
9
|
* A nimble-styled tooltip control.
|
|
9
10
|
*/
|
|
10
11
|
export declare class Tooltip extends FoundationTooltip {
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
* @remarks
|
|
15
|
+
* HTML Attribute: severity
|
|
16
|
+
*/
|
|
17
|
+
severity: TooltipSeverity;
|
|
18
|
+
iconVisible: boolean;
|
|
11
19
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr } from '@microsoft/fast-element';
|
|
1
3
|
import { DesignSystem, Tooltip as FoundationTooltip } from '@microsoft/fast-foundation';
|
|
2
4
|
import { styles } from './styles';
|
|
3
5
|
import { template } from './template';
|
|
@@ -5,7 +7,17 @@ import { template } from './template';
|
|
|
5
7
|
* A nimble-styled tooltip control.
|
|
6
8
|
*/
|
|
7
9
|
export class Tooltip extends FoundationTooltip {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.iconVisible = false;
|
|
13
|
+
}
|
|
8
14
|
}
|
|
15
|
+
__decorate([
|
|
16
|
+
attr
|
|
17
|
+
], Tooltip.prototype, "severity", void 0);
|
|
18
|
+
__decorate([
|
|
19
|
+
attr({ attribute: 'icon-visible', mode: 'boolean' })
|
|
20
|
+
], Tooltip.prototype, "iconVisible", void 0);
|
|
9
21
|
const nimbleTooltip = Tooltip.compose({
|
|
10
22
|
baseName: 'tooltip',
|
|
11
23
|
baseClass: FoundationTooltip,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,OAAO,IAAI,iBAAiB,EAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tooltip/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACH,YAAY,EACZ,OAAO,IAAI,iBAAiB,EAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAStC;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,iBAAiB;IAA9C;;QAUW,gBAAW,GAAG,KAAK,CAAC;IAC/B,CAAC;CAAA;AAJG;IADC,IAAI;yCAC4B;AAGjC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;4CAC1B;AAG/B,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IAClC,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,iBAAiB;IAC5B,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC"}
|
|
@@ -37,22 +37,22 @@ export const styles = css `
|
|
|
37
37
|
padding-right: 8px;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
:host(
|
|
40
|
+
:host([severity='error'][icon-visible]) [severity='error'] {
|
|
41
41
|
display: flex;
|
|
42
42
|
flex: 0 0 auto;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
:host(
|
|
45
|
+
:host([severity='information'][icon-visible]) [severity='information'] {
|
|
46
46
|
display: flex;
|
|
47
47
|
flex: 0 0 auto;
|
|
48
48
|
}
|
|
49
49
|
`.withBehaviors(themeBehavior(Theme.light, css `
|
|
50
|
-
:host(
|
|
50
|
+
:host([severity='error']) {
|
|
51
51
|
--ni-private-tooltip-border-color: ${BannerFail100DarkUi};
|
|
52
52
|
--ni-private-tooltip-background-color: ${White};
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
:host(
|
|
55
|
+
:host([severity='information']) {
|
|
56
56
|
--ni-private-tooltip-border-color: ${Information100LightUi};
|
|
57
57
|
--ni-private-tooltip-background-color: ${White};
|
|
58
58
|
}
|
|
@@ -62,11 +62,11 @@ export const styles = css `
|
|
|
62
62
|
--ni-private-tooltip-background-color: ${Black85};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
:host(
|
|
65
|
+
:host([severity='information']) {
|
|
66
66
|
--ni-private-tooltip-border-color: ${Information100DarkUi};
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
:host(
|
|
69
|
+
:host([severity='error']) {
|
|
70
70
|
--ni-private-tooltip-border-color: ${BannerFail100DarkUi};
|
|
71
71
|
}
|
|
72
72
|
`), themeBehavior(Theme.color, css `
|
|
@@ -79,11 +79,11 @@ export const styles = css `
|
|
|
79
79
|
--ni-private-tooltip-background-color: ${hexToRgbaCssColor(White, 0.15)};
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
:host(
|
|
82
|
+
:host([severity='error']) {
|
|
83
83
|
--ni-private-tooltip-border-color: ${White};
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
:host(
|
|
86
|
+
:host([severity='information']) {
|
|
87
87
|
--ni-private-tooltip-border-color: ${White};
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { ViewTemplate } from '@microsoft/fast-element';
|
|
2
|
-
import type { FoundationElementTemplate } from '@microsoft/fast-foundation';
|
|
3
1
|
import type { Tooltip } from '.';
|
|
4
|
-
export declare const template:
|
|
2
|
+
export declare const template: import("@microsoft/fast-element").ViewTemplate<Tooltip, any>;
|