@ni/nimble-components 29.1.2 → 29.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/all-components-bundle.js +593 -149
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +3623 -3573
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/anchor/index.d.ts +6 -0
  6. package/dist/esm/anchor/index.js +4 -1
  7. package/dist/esm/anchor/index.js.map +1 -1
  8. package/dist/esm/anchor/template.js +1 -0
  9. package/dist/esm/anchor/template.js.map +1 -1
  10. package/dist/esm/button/index.d.ts +6 -0
  11. package/dist/esm/button/index.js +6 -2
  12. package/dist/esm/button/index.js.map +1 -1
  13. package/dist/esm/button/template.d.ts +4 -0
  14. package/dist/esm/button/template.js +49 -0
  15. package/dist/esm/button/template.js.map +1 -0
  16. package/dist/esm/checkbox/index.d.ts +10 -0
  17. package/dist/esm/checkbox/index.js +14 -1
  18. package/dist/esm/checkbox/index.js.map +1 -1
  19. package/dist/esm/checkbox/template.d.ts +4 -0
  20. package/dist/esm/checkbox/template.js +32 -0
  21. package/dist/esm/checkbox/template.js.map +1 -0
  22. package/dist/esm/menu-button/index.d.ts +1 -0
  23. package/dist/esm/menu-button/index.js +4 -1
  24. package/dist/esm/menu-button/index.js.map +1 -1
  25. package/dist/esm/menu-button/template.js +1 -0
  26. package/dist/esm/menu-button/template.js.map +1 -1
  27. package/dist/esm/select/styles.js +2 -1
  28. package/dist/esm/select/styles.js.map +1 -1
  29. package/dist/esm/text-field/styles.js +6 -2
  30. package/dist/esm/text-field/styles.js.map +1 -1
  31. package/dist/esm/toggle-button/index.d.ts +10 -0
  32. package/dist/esm/toggle-button/index.js +11 -1
  33. package/dist/esm/toggle-button/index.js.map +1 -1
  34. package/dist/esm/toggle-button/template.js +17 -7
  35. package/dist/esm/toggle-button/template.js.map +1 -1
  36. package/package.json +1 -1
@@ -21,6 +21,12 @@ export declare class Anchor extends AnchorBase {
21
21
  * HTML Attribute: appearance
22
22
  */
23
23
  appearance: AnchorAppearance;
24
+ /**
25
+ * @public
26
+ * @remarks
27
+ * HTML Attribute: tabindex
28
+ */
29
+ tabIndex: number;
24
30
  /**
25
31
  * @public
26
32
  * @remarks
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { attr } from '@microsoft/fast-element';
2
+ import { attr, nullableNumberConverter } from '@microsoft/fast-element';
3
3
  import { DesignSystem, Anchor as FoundationAnchor } from '@microsoft/fast-foundation';
4
4
  import { AnchorBase } from '../anchor-base';
5
5
  import { styles } from './styles';
@@ -24,6 +24,9 @@ __decorate([
24
24
  __decorate([
25
25
  attr
26
26
  ], Anchor.prototype, "appearance", void 0);
27
+ __decorate([
28
+ attr({ attribute: 'tabindex', converter: nullableNumberConverter })
29
+ ], Anchor.prototype, "tabIndex", void 0);
27
30
  __decorate([
28
31
  attr({ attribute: 'contenteditable' })
29
32
  ], Anchor.prototype, "contentEditable", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/anchor/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACH,YAAY,EACZ,MAAM,IAAI,gBAAgB,EAE7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAStC;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU;IAAtC;;QACI;;;;WAIG;QAEI,oBAAe,GAAG,KAAK,CAAC;IAsBnC,CAAC;CAAA;AAtBU;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;+CAC1B;AAQxB;IADN,IAAI;0CAC+B;AAapB;IADf,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;+CACE;AAG7C,uFAAuF;AAEvF,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAgB;IAC/C,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,gBAAgB;IAC3B,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["import { attr } from '@microsoft/fast-element';\nimport {\n DesignSystem,\n Anchor as FoundationAnchor,\n AnchorOptions\n} from '@microsoft/fast-foundation';\nimport { AnchorBase } from '../anchor-base';\nimport { styles } from './styles';\nimport { template } from './template';\nimport type { AnchorAppearance } from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-anchor': Anchor;\n }\n}\n\n/**\n * A nimble-styled anchor\n */\nexport class Anchor extends AnchorBase {\n /**\n * @public\n * @remarks\n * HTML Attribute: underline-hidden\n */\n @attr({ attribute: 'underline-hidden', mode: 'boolean' })\n public underlineHidden = false;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: appearance\n */\n @attr\n public appearance: AnchorAppearance;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: contenteditable\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable\n *\n * Ideally, proper support for contenteditable should come from FAST.\n * I have filed bug https://github.com/microsoft/fast/issues/6870 to them.\n * If/when it is fixed, we can remove this workaround.\n */\n @attr({ attribute: 'contenteditable' })\n public override contentEditable!: string;\n}\n\n// FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.\n\nconst nimbleAnchor = Anchor.compose<AnchorOptions>({\n baseName: 'anchor',\n baseClass: FoundationAnchor,\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchor());\nexport const anchorTag = 'nimble-anchor';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/anchor/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EACH,YAAY,EACZ,MAAM,IAAI,gBAAgB,EAE7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAStC;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU;IAAtC;;QACI;;;;WAIG;QAEI,oBAAe,GAAG,KAAK,CAAC;IA8BnC,CAAC;CAAA;AA9BU;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;+CAC1B;AAQxB;IADN,IAAI;0CAC+B;AAQpB;IADf,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;wCAClC;AAalB;IADf,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;+CACE;AAG7C,uFAAuF;AAEvF,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAgB;IAC/C,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,gBAAgB;IAC3B,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["import { attr, nullableNumberConverter } from '@microsoft/fast-element';\nimport {\n DesignSystem,\n Anchor as FoundationAnchor,\n AnchorOptions\n} from '@microsoft/fast-foundation';\nimport { AnchorBase } from '../anchor-base';\nimport { styles } from './styles';\nimport { template } from './template';\nimport type { AnchorAppearance } from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-anchor': Anchor;\n }\n}\n\n/**\n * A nimble-styled anchor\n */\nexport class Anchor extends AnchorBase {\n /**\n * @public\n * @remarks\n * HTML Attribute: underline-hidden\n */\n @attr({ attribute: 'underline-hidden', mode: 'boolean' })\n public underlineHidden = false;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: appearance\n */\n @attr\n public appearance: AnchorAppearance;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: tabindex\n */\n @attr({ attribute: 'tabindex', converter: nullableNumberConverter })\n public override tabIndex!: number;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: contenteditable\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable\n *\n * Ideally, proper support for contenteditable should come from FAST.\n * I have filed bug https://github.com/microsoft/fast/issues/6870 to them.\n * If/when it is fixed, we can remove this workaround.\n */\n @attr({ attribute: 'contenteditable' })\n public override contentEditable!: string;\n}\n\n// FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.\n\nconst nimbleAnchor = Anchor.compose<AnchorOptions>({\n baseName: 'anchor',\n baseClass: FoundationAnchor,\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchor());\nexport const anchorTag = 'nimble-anchor';\n"]}
@@ -17,6 +17,7 @@ export const template = (_context, definition) => html `${
17
17
  rel="${x => x.rel}"
18
18
  target="${x => x.target}"
19
19
  type="${x => x.type}"
20
+ tabindex="${x => x.tabIndex}"
20
21
  aria-atomic="${x => x.ariaAtomic}"
21
22
  aria-busy="${x =>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ViewTemplate } from '@microsoft/fast-element';\nimport type {\n AnchorOptions,\n FoundationElementTemplate\n} from '@microsoft/fast-foundation';\nimport type { Anchor } from '.';\n\n// prettier-ignore\nexport const template: FoundationElementTemplate<\nViewTemplate<Anchor>,\nAnchorOptions\n> = (_context, definition) => html<Anchor>`${\n /* top-container div is necessary because setting contenteditable directly on the native anchor instead\n leaves it focusable, unlike the behavior you get when the anchor is _within_ a contenteditable element.\n */ ''\n}<div\n class=\"top-container\"\n contenteditable=\"${x => x.contentEditable}\"\n ><a\n class=\"control\"\n part=\"control\"\n download=\"${x => x.download}\"\n href=${x => x.href}\n hreflang=\"${x => x.hreflang}\"\n ping=\"${x => x.ping}\"\n referrerpolicy=\"${x => x.referrerpolicy}\"\n rel=\"${x => x.rel}\"\n target=\"${x => x.target}\"\n type=\"${x => x.type}\"\n aria-atomic=\"${x => x.ariaAtomic}\"\n aria-busy=\"${x => x.ariaBusy}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-current=\"${x => x.ariaCurrent}\"\n aria-describedby=\"${x => x.ariaDescribedby}\"\n aria-details=\"${x => x.ariaDetails}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-errormessage=\"${x => x.ariaErrormessage}\"\n aria-expanded=\"${x => x.ariaExpanded}\"\n aria-flowto=\"${x => x.ariaFlowto}\"\n aria-haspopup=\"${x => x.ariaHaspopup}\"\n aria-hidden=\"${x => x.ariaHidden}\"\n aria-invalid=\"${x => x.ariaInvalid}\"\n aria-keyshortcuts=\"${x => x.ariaKeyshortcuts}\"\n aria-label=\"${x => x.ariaLabel}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-live=\"${x => x.ariaLive}\"\n aria-owns=\"${x => x.ariaOwns}\"\n aria-relevant=\"${x => x.ariaRelevant}\"\n aria-roledescription=\"${x => x.ariaRoledescription}\"\n ${ref('control')}\n >${\n /* Start and End slot templates inlined to avoid extra whitespace.\n See https://github.com/microsoft/fast/issues/6557\n\n Whitespace intentionally avoided between tags for inline styles */ ''\n}<span\n part=\"start\"\n ${ref('startContainer')}\n class=\"${_x => (definition.start ? 'start' : null)}\"\n ><slot\n name=\"start\"\n ${ref('start')}\n @slotchange=\"${x => x.handleStartContentChange()}\">\n ${definition.start || ''}\n </slot\n ></span\n ><span\n class=\"content\"\n part=\"content\"\n ><slot\n ${slotted('defaultSlottedContent')}\n ></slot\n ></span\n ><span\n part=\"end\"\n ${ref('endContainer')}\n class=${_x => (definition.end ? 'end' : null)}\n ><slot\n name=\"end\"\n ${ref('end')}\n @slotchange=\"${x => x.handleEndContentChange()}\">\n ${definition.end || ''}\n </slot\n ></span></a></div>`;\n"]}
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/anchor/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAgB,MAAM,yBAAyB,CAAC;AAO3E,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAGjB,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,CAAC,IAAI,CAAQ,GAAG;AACzC;;EAEE,CAAC,EACP;;2BAE2B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe;;;;oBAI7B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;eACpB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;oBACN,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;gBACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;0BACD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc;eAChC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;kBACP,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;gBACf,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;oBACP,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;uBACZ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UA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AAwB,EAAE;cAC9C,UAAU,CAAC,KAAK,IAAI,EAAE;;;;;;;cAOtB,OAAO,CAAC,uBAAuB,CAAC;;;;;UAKpC,GAAG,CAAC,cAAc,CAAC;gBACb,EAAE,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;;;cAGvC,GAAG,CAAC,KAAK,CAAC;2BACG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,sBAAsB,EAAE;cAC5C,UAAU,CAAC,GAAG,IAAI,EAAE;;uBAEX,CAAC","sourcesContent":["import { html, ref, slotted, ViewTemplate } from '@microsoft/fast-element';\nimport type {\n AnchorOptions,\n FoundationElementTemplate\n} from '@microsoft/fast-foundation';\nimport type { Anchor } from '.';\n\n// prettier-ignore\nexport const template: FoundationElementTemplate<\nViewTemplate<Anchor>,\nAnchorOptions\n> = (_context, definition) => html<Anchor>`${\n /* top-container div is necessary because setting contenteditable directly on the native anchor instead\n leaves it focusable, unlike the behavior you get when the anchor is _within_ a contenteditable element.\n */ ''\n}<div\n class=\"top-container\"\n contenteditable=\"${x => x.contentEditable}\"\n ><a\n class=\"control\"\n part=\"control\"\n download=\"${x => x.download}\"\n href=${x => x.href}\n hreflang=\"${x => x.hreflang}\"\n ping=\"${x => x.ping}\"\n referrerpolicy=\"${x => x.referrerpolicy}\"\n rel=\"${x => x.rel}\"\n target=\"${x => x.target}\"\n type=\"${x => x.type}\"\n tabindex=\"${x => x.tabIndex}\"\n aria-atomic=\"${x => x.ariaAtomic}\"\n aria-busy=\"${x => x.ariaBusy}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-current=\"${x => x.ariaCurrent}\"\n aria-describedby=\"${x => x.ariaDescribedby}\"\n aria-details=\"${x => x.ariaDetails}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-errormessage=\"${x => x.ariaErrormessage}\"\n aria-expanded=\"${x => x.ariaExpanded}\"\n aria-flowto=\"${x => x.ariaFlowto}\"\n aria-haspopup=\"${x => x.ariaHaspopup}\"\n aria-hidden=\"${x => x.ariaHidden}\"\n aria-invalid=\"${x => x.ariaInvalid}\"\n aria-keyshortcuts=\"${x => x.ariaKeyshortcuts}\"\n aria-label=\"${x => x.ariaLabel}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-live=\"${x => x.ariaLive}\"\n aria-owns=\"${x => x.ariaOwns}\"\n aria-relevant=\"${x => x.ariaRelevant}\"\n aria-roledescription=\"${x => x.ariaRoledescription}\"\n ${ref('control')}\n >${\n /* Start and End slot templates inlined to avoid extra whitespace.\n See https://github.com/microsoft/fast/issues/6557\n\n Whitespace intentionally avoided between tags for inline styles */ ''\n}<span\n part=\"start\"\n ${ref('startContainer')}\n class=\"${_x => (definition.start ? 'start' : null)}\"\n ><slot\n name=\"start\"\n ${ref('start')}\n @slotchange=\"${x => x.handleStartContentChange()}\">\n ${definition.start || ''}\n </slot\n ></span\n ><span\n class=\"content\"\n part=\"content\"\n ><slot\n ${slotted('defaultSlottedContent')}\n ></slot\n ></span\n ><span\n part=\"end\"\n ${ref('endContainer')}\n class=${_x => (definition.end ? 'end' : null)}\n ><slot\n name=\"end\"\n ${ref('end')}\n @slotchange=\"${x => x.handleEndContentChange()}\">\n ${definition.end || ''}\n </slot\n ></span></a></div>`;\n"]}
@@ -28,5 +28,11 @@ export declare class Button extends FoundationButton implements ButtonPattern, B
28
28
  * HTML Attribute: content-hidden
29
29
  */
30
30
  contentHidden: boolean;
31
+ /**
32
+ * @public
33
+ * @remarks
34
+ * HTML Attribute: tabindex
35
+ */
36
+ tabIndex: number;
31
37
  }
32
38
  export declare const buttonTag = "nimble-button";
@@ -1,7 +1,8 @@
1
1
  import { __decorate } from "tslib";
2
- import { attr } from '@microsoft/fast-element';
3
- import { Button as FoundationButton, buttonTemplate as template, DesignSystem } from '@microsoft/fast-foundation';
2
+ import { attr, nullableNumberConverter } from '@microsoft/fast-element';
3
+ import { Button as FoundationButton, DesignSystem } from '@microsoft/fast-foundation';
4
4
  import { styles } from './styles';
5
+ import { template } from './template';
5
6
  import { ButtonAppearance } from './types';
6
7
  /**
7
8
  * A nimble-styled HTML button
@@ -32,6 +33,9 @@ __decorate([
32
33
  __decorate([
33
34
  attr({ attribute: 'content-hidden', mode: 'boolean' })
34
35
  ], Button.prototype, "contentHidden", void 0);
36
+ __decorate([
37
+ attr({ attribute: 'tabindex', converter: nullableNumberConverter })
38
+ ], Button.prototype, "tabIndex", void 0);
35
39
  /**
36
40
  * A function that returns a nimble-button registration for configuring the component with a DesignSystem.
37
41
  * Implements {@link @microsoft/fast-foundation#buttonTemplate}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACH,MAAM,IAAI,gBAAgB,EAE1B,cAAc,IAAI,QAAQ,EAC1B,YAAY,EACf,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAA2B,MAAM,SAAS,CAAC;AAQpE;;GAEG;AACH,MAAM,OAAO,MACT,SAAQ,gBAAgB;IAD5B;;QAGI;;;;WAIG;QAEI,eAAU,GAAqB,gBAAgB,CAAC,OAAO,CAAC;QAU/D;;;;WAIG;QAEI,kBAAa,GAAG,KAAK,CAAC;IACjC,CAAC;CAAA;AAjBU;IADN,IAAI;0CAC0D;AAQxD;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;iDACQ;AAQ3C;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;6CAC1B;AAGjC;;;;;;;;GAQG;AACH,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAgB;IAC/C,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,gBAAgB;IAC3B,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["import { attr } from '@microsoft/fast-element';\nimport {\n Button as FoundationButton,\n ButtonOptions,\n buttonTemplate as template,\n DesignSystem\n} from '@microsoft/fast-foundation';\nimport type {\n ButtonPattern,\n ButtonAppearanceVariantPattern\n} from '../patterns/button/types';\nimport { styles } from './styles';\nimport { ButtonAppearance, ButtonAppearanceVariant } from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-button': Button;\n }\n}\n\n/**\n * A nimble-styled HTML button\n */\nexport class Button\n extends FoundationButton\n implements ButtonPattern, ButtonAppearanceVariantPattern {\n /**\n * @public\n * @remarks\n * HTML Attribute: appearance\n */\n @attr\n public appearance: ButtonAppearance = ButtonAppearance.outline;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: appearance-variant\n */\n @attr({ attribute: 'appearance-variant' })\n public appearanceVariant: ButtonAppearanceVariant;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: content-hidden\n */\n @attr({ attribute: 'content-hidden', mode: 'boolean' })\n public contentHidden = false;\n}\n\n/**\n * A function that returns a nimble-button registration for configuring the component with a DesignSystem.\n * Implements {@link @microsoft/fast-foundation#buttonTemplate}\n *\n * @public\n * @remarks\n * Generates HTML Element: \\<nimble-button\\>\n *\n */\nconst nimbleButton = Button.compose<ButtonOptions>({\n baseName: 'button',\n baseClass: FoundationButton,\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleButton());\nexport const buttonTag = 'nimble-button';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EACH,MAAM,IAAI,gBAAgB,EAE1B,YAAY,EACf,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAA2B,MAAM,SAAS,CAAC;AAQpE;;GAEG;AACH,MAAM,OAAO,MACT,SAAQ,gBAAgB;IAD5B;;QAGI;;;;WAIG;QAEI,eAAU,GAAqB,gBAAgB,CAAC,OAAO,CAAC;QAU/D;;;;WAIG;QAEI,kBAAa,GAAG,KAAK,CAAC;IASjC,CAAC;CAAA;AAzBU;IADN,IAAI;0CAC0D;AAQxD;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;iDACQ;AAQ3C;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;6CAC1B;AAQb;IADf,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;wCAClC;AAGtC;;;;;;;;GAQG;AACH,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAgB;IAC/C,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,gBAAgB;IAC3B,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["import { attr, nullableNumberConverter } from '@microsoft/fast-element';\nimport {\n Button as FoundationButton,\n ButtonOptions,\n DesignSystem\n} from '@microsoft/fast-foundation';\nimport type {\n ButtonPattern,\n ButtonAppearanceVariantPattern\n} from '../patterns/button/types';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { ButtonAppearance, ButtonAppearanceVariant } from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-button': Button;\n }\n}\n\n/**\n * A nimble-styled HTML button\n */\nexport class Button\n extends FoundationButton\n implements ButtonPattern, ButtonAppearanceVariantPattern {\n /**\n * @public\n * @remarks\n * HTML Attribute: appearance\n */\n @attr\n public appearance: ButtonAppearance = ButtonAppearance.outline;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: appearance-variant\n */\n @attr({ attribute: 'appearance-variant' })\n public appearanceVariant: ButtonAppearanceVariant;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: content-hidden\n */\n @attr({ attribute: 'content-hidden', mode: 'boolean' })\n public contentHidden = false;\n\n /**\n * @public\n * @remarks\n * HTML Attribute: tabindex\n */\n @attr({ attribute: 'tabindex', converter: nullableNumberConverter })\n public override tabIndex!: number;\n}\n\n/**\n * A function that returns a nimble-button registration for configuring the component with a DesignSystem.\n * Implements {@link @microsoft/fast-foundation#buttonTemplate}\n *\n * @public\n * @remarks\n * Generates HTML Element: \\<nimble-button\\>\n *\n */\nconst nimbleButton = Button.compose<ButtonOptions>({\n baseName: 'button',\n baseClass: FoundationButton,\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleButton());\nexport const buttonTag = 'nimble-button';\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ViewTemplate } from '@microsoft/fast-element';
2
+ import { ButtonOptions, FoundationElementTemplate } from '@microsoft/fast-foundation';
3
+ import type { Button } from '.';
4
+ export declare const template: FoundationElementTemplate<ViewTemplate<Button>, ButtonOptions>;
@@ -0,0 +1,49 @@
1
+ import { html, ref, slotted } from '@microsoft/fast-element';
2
+ import { endSlotTemplate, startSlotTemplate } from '@microsoft/fast-foundation';
3
+ export const template = (context, definition) => html `
4
+ <button
5
+ class="control"
6
+ part="control"
7
+ ?autofocus="${x => x.autofocus}"
8
+ ?disabled="${x => x.disabled}"
9
+ form="${x => x.formId}"
10
+ formaction="${x => x.formaction}"
11
+ formenctype="${x => x.formenctype}"
12
+ formmethod="${x => x.formmethod}"
13
+ formnovalidate="${x => x.formnovalidate}"
14
+ formtarget="${x => x.formtarget}"
15
+ name="${x => x.name}"
16
+ type="${x => x.type}"
17
+ value="${x => x.value}"
18
+ tabindex="${x => x.tabIndex}"
19
+ aria-atomic="${x => x.ariaAtomic}"
20
+ aria-busy="${x => x.ariaBusy}"
21
+ aria-controls="${x => x.ariaControls}"
22
+ aria-current="${x => x.ariaCurrent}"
23
+ aria-describedby="${x => x.ariaDescribedby}"
24
+ aria-details="${x => x.ariaDetails}"
25
+ aria-disabled="${x => x.ariaDisabled}"
26
+ aria-errormessage="${x => x.ariaErrormessage}"
27
+ aria-expanded="${x => x.ariaExpanded}"
28
+ aria-flowto="${x => x.ariaFlowto}"
29
+ aria-haspopup="${x => x.ariaHaspopup}"
30
+ aria-hidden="${x => x.ariaHidden}"
31
+ aria-invalid="${x => x.ariaInvalid}"
32
+ aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
33
+ aria-label="${x => x.ariaLabel}"
34
+ aria-labelledby="${x => x.ariaLabelledby}"
35
+ aria-live="${x => x.ariaLive}"
36
+ aria-owns="${x => x.ariaOwns}"
37
+ aria-pressed="${x => x.ariaPressed}"
38
+ aria-relevant="${x => x.ariaRelevant}"
39
+ aria-roledescription="${x => x.ariaRoledescription}"
40
+ ${ref('control')}
41
+ >
42
+ ${startSlotTemplate(context, definition)}
43
+ <span class="content" part="content">
44
+ <slot ${slotted('defaultSlottedContent')}></slot>
45
+ </span>
46
+ ${endSlotTemplate(context, definition)}
47
+ </button>
48
+ `;
49
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":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CAAC,CAAC,CAAC,gBAAgB;yBAC3B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;uBACrB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU;yBACf,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;uBACrB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU;wBAChB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW;6BACb,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB;sBAC9B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;2BACX,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc;qBAC3B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;qBACf,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;wBACZ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW;yBACjB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;gCACZ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAmB;UAChD,GAAG,CAAC,SAAS,CAAC;;UAEd,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC;;oBAE5B,OAAO,CAAC,uBAAuB,CAAC;;UAE1C,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC;;CAE7C,CAAC","sourcesContent":["import { html, ref, slotted } from '@microsoft/fast-element';\nimport type { ViewTemplate } from '@microsoft/fast-element';\nimport {\n ButtonOptions,\n endSlotTemplate,\n FoundationElementTemplate,\n startSlotTemplate\n} from '@microsoft/fast-foundation';\nimport type { Button } from '.';\n\nexport const template: FoundationElementTemplate<\nViewTemplate<Button>,\nButtonOptions\n> = (context, definition) => html`\n <button\n class=\"control\"\n part=\"control\"\n ?autofocus=\"${x => x.autofocus}\"\n ?disabled=\"${x => x.disabled}\"\n form=\"${x => x.formId}\"\n formaction=\"${x => x.formaction}\"\n formenctype=\"${x => x.formenctype}\"\n formmethod=\"${x => x.formmethod}\"\n formnovalidate=\"${x => x.formnovalidate}\"\n formtarget=\"${x => x.formtarget}\"\n name=\"${x => x.name}\"\n type=\"${x => x.type}\"\n value=\"${x => x.value}\"\n tabindex=\"${x => x.tabIndex}\"\n aria-atomic=\"${x => x.ariaAtomic}\"\n aria-busy=\"${x => x.ariaBusy}\"\n aria-controls=\"${x => x.ariaControls}\"\n aria-current=\"${x => x.ariaCurrent}\"\n aria-describedby=\"${x => x.ariaDescribedby}\"\n aria-details=\"${x => x.ariaDetails}\"\n aria-disabled=\"${x => x.ariaDisabled}\"\n aria-errormessage=\"${x => x.ariaErrormessage}\"\n aria-expanded=\"${x => x.ariaExpanded}\"\n aria-flowto=\"${x => x.ariaFlowto}\"\n aria-haspopup=\"${x => x.ariaHaspopup}\"\n aria-hidden=\"${x => x.ariaHidden}\"\n aria-invalid=\"${x => x.ariaInvalid}\"\n aria-keyshortcuts=\"${x => x.ariaKeyshortcuts}\"\n aria-label=\"${x => x.ariaLabel}\"\n aria-labelledby=\"${x => x.ariaLabelledby}\"\n aria-live=\"${x => x.ariaLive}\"\n aria-owns=\"${x => x.ariaOwns}\"\n aria-pressed=\"${x => x.ariaPressed}\"\n aria-relevant=\"${x => x.ariaRelevant}\"\n aria-roledescription=\"${x => x.ariaRoledescription}\"\n ${ref('control')}\n >\n ${startSlotTemplate(context, definition)}\n <span class=\"content\" part=\"content\">\n <slot ${slotted('defaultSlottedContent')}></slot>\n </span>\n ${endSlotTemplate(context, definition)}\n </button>\n`;\n"]}
@@ -8,5 +8,15 @@ declare global {
8
8
  * A nimble-styled checkbox control.
9
9
  */
10
10
  export declare class Checkbox extends FoundationCheckbox {
11
+ /**
12
+ * @public
13
+ * @remarks
14
+ * HTML Attribute: tabindex
15
+ */
16
+ tabIndex: number;
17
+ /**
18
+ * @internal
19
+ */
20
+ get resolvedTabindex(): string | undefined;
11
21
  }
12
22
  export declare const checkboxTag = "nimble-checkbox";
@@ -1,11 +1,24 @@
1
- import { DesignSystem, Checkbox as FoundationCheckbox, checkboxTemplate as template } from '@microsoft/fast-foundation';
1
+ import { __decorate } from "tslib";
2
+ import { attr, nullableNumberConverter } from '@microsoft/fast-element';
3
+ import { DesignSystem, Checkbox as FoundationCheckbox } from '@microsoft/fast-foundation';
2
4
  import { check16X16, minus16X16 } from '@ni/nimble-tokens/dist/icons/js';
3
5
  import { styles } from './styles';
6
+ import { template } from './template';
4
7
  /**
5
8
  * A nimble-styled checkbox control.
6
9
  */
7
10
  export class Checkbox extends FoundationCheckbox {
11
+ /**
12
+ * @internal
13
+ */
14
+ get resolvedTabindex() {
15
+ const tabIndex = this.tabIndex ?? 0;
16
+ return this.disabled ? undefined : `${tabIndex}`;
17
+ }
8
18
  }
19
+ __decorate([
20
+ attr({ attribute: 'tabindex', converter: nullableNumberConverter })
21
+ ], Checkbox.prototype, "tabIndex", void 0);
9
22
  const nimbleCheckbox = Checkbox.compose({
10
23
  baseName: 'checkbox',
11
24
  baseClass: FoundationCheckbox,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,QAAQ,IAAI,kBAAkB,EAE9B,gBAAgB,IAAI,QAAQ,EAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQlC;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,kBAAkB;CAAG;AAEnD,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAkB;IACrD,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,kBAAkB;IAC7B,QAAQ;IACR,MAAM;IACN,gBAAgB,EAAE,UAAU,CAAC,IAAI;IACjC,sBAAsB,EAAE,UAAU,CAAC,IAAI;CAC1C,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import {\n DesignSystem,\n Checkbox as FoundationCheckbox,\n CheckboxOptions,\n checkboxTemplate as template\n} from '@microsoft/fast-foundation';\nimport { check16X16, minus16X16 } from '@ni/nimble-tokens/dist/icons/js';\nimport { styles } from './styles';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-checkbox': Checkbox;\n }\n}\n\n/**\n * A nimble-styled checkbox control.\n */\nexport class Checkbox extends FoundationCheckbox {}\n\nconst nimbleCheckbox = Checkbox.compose<CheckboxOptions>({\n baseName: 'checkbox',\n baseClass: FoundationCheckbox,\n template,\n styles,\n checkedIndicator: check16X16.data,\n indeterminateIndicator: minus16X16.data\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCheckbox());\nexport const checkboxTag = 'nimble-checkbox';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/checkbox/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EACH,YAAY,EACZ,QAAQ,IAAI,kBAAkB,EAEjC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,kBAAkB;IAS5C;;OAEG;IACH,IAAW,gBAAgB;QACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAC;IACrD,CAAC;CACJ;AATmB;IADf,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;0CAClC;AAWtC,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAkB;IACrD,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,kBAAkB;IAC7B,QAAQ;IACR,MAAM;IACN,gBAAgB,EAAE,UAAU,CAAC,IAAI;IACjC,sBAAsB,EAAE,UAAU,CAAC,IAAI;CAC1C,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import { attr, nullableNumberConverter } from '@microsoft/fast-element';\nimport {\n DesignSystem,\n Checkbox as FoundationCheckbox,\n CheckboxOptions\n} from '@microsoft/fast-foundation';\nimport { check16X16, minus16X16 } from '@ni/nimble-tokens/dist/icons/js';\nimport { styles } from './styles';\nimport { template } from './template';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-checkbox': Checkbox;\n }\n}\n\n/**\n * A nimble-styled checkbox control.\n */\nexport class Checkbox extends FoundationCheckbox {\n /**\n * @public\n * @remarks\n * HTML Attribute: tabindex\n */\n @attr({ attribute: 'tabindex', converter: nullableNumberConverter })\n public override tabIndex!: number;\n\n /**\n * @internal\n */\n public get resolvedTabindex(): string | undefined {\n const tabIndex = this.tabIndex ?? 0;\n return this.disabled ? undefined : `${tabIndex}`;\n }\n}\n\nconst nimbleCheckbox = Checkbox.compose<CheckboxOptions>({\n baseName: 'checkbox',\n baseClass: FoundationCheckbox,\n template,\n styles,\n checkedIndicator: check16X16.data,\n indeterminateIndicator: minus16X16.data\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCheckbox());\nexport const checkboxTag = 'nimble-checkbox';\n"]}
@@ -0,0 +1,4 @@
1
+ import { type ViewTemplate } from '@microsoft/fast-element';
2
+ import type { CheckboxOptions, FoundationElementTemplate } from '@microsoft/fast-foundation';
3
+ import type { Checkbox } from '.';
4
+ export declare const template: FoundationElementTemplate<ViewTemplate<Checkbox>, CheckboxOptions>;
@@ -0,0 +1,32 @@
1
+ import { html, slotted } from '@microsoft/fast-element';
2
+ export const template = (_context, definition) => html `
3
+ <template
4
+ role="checkbox"
5
+ aria-checked="${x => x.checked}"
6
+ aria-required="${x => x.required}"
7
+ aria-disabled="${x => x.disabled}"
8
+ aria-readonly="${x => x.readOnly}"
9
+ tabindex="${x => x.resolvedTabindex}"
10
+ @keypress="${(x, c) => x.keypressHandler(c.event)}"
11
+ @click="${(x, c) => x.clickHandler(c.event)}"
12
+ class="${x => (x.readOnly ? 'readonly' : '')} ${x => (x.checked ? 'checked' : '')} ${x => (x.indeterminate ? 'indeterminate' : '')}"
13
+ >
14
+ <div part="control" class="control">
15
+ <slot name="checked-indicator">
16
+ ${definition.checkedIndicator || ''}
17
+ </slot>
18
+ <slot name="indeterminate-indicator">
19
+ ${definition.indeterminateIndicator || ''}
20
+ </slot>
21
+ </div>
22
+ <label
23
+ part="label"
24
+ class="${x => (x.defaultSlottedNodes?.length
25
+ ? 'label'
26
+ : 'label label__hidden')}"
27
+ >
28
+ <slot ${slotted('defaultSlottedNodes')}></slot>
29
+ </label>
30
+ </template>
31
+ `;
32
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/checkbox/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAqB,MAAM,yBAAyB,CAAC;AAO3E,MAAM,CAAC,MAAM,QAAQ,GAGjB,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,CAAC,IAAI,CAAA;;;wBAGV,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;yBACb,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;yBACf,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;yBACf,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;oBACpB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB;qBACtB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,KAAsB,CAAC;kBACxD,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAmB,CAAC;iBAChD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;;;;kBAIxH,UAAU,CAAC,gBAAgB,IAAI,EAAE;;;kBAGjC,UAAU,CAAC,sBAAsB,IAAI,EAAE;;;;;qBAKpC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,mBAAmB,EAAE,MAAM;IAChD,CAAC,CAAC,OAAO;IACT,CAAC,CAAC,qBAAqB,CAAC;;oBAEZ,OAAO,CAAC,qBAAqB,CAAC;;;CAGjD,CAAC","sourcesContent":["import { html, slotted, type ViewTemplate } from '@microsoft/fast-element';\nimport type {\n CheckboxOptions,\n FoundationElementTemplate\n} from '@microsoft/fast-foundation';\nimport type { Checkbox } from '.';\n\nexport const template: FoundationElementTemplate<\nViewTemplate<Checkbox>,\nCheckboxOptions\n> = (_context, definition) => html`\n <template\n role=\"checkbox\"\n aria-checked=\"${x => x.checked}\"\n aria-required=\"${x => x.required}\"\n aria-disabled=\"${x => x.disabled}\"\n aria-readonly=\"${x => x.readOnly}\"\n tabindex=\"${x => x.resolvedTabindex}\"\n @keypress=\"${(x, c) => x.keypressHandler(c.event as KeyboardEvent)}\"\n @click=\"${(x, c) => x.clickHandler(c.event as MouseEvent)}\"\n class=\"${x => (x.readOnly ? 'readonly' : '')} ${x => (x.checked ? 'checked' : '')} ${x => (x.indeterminate ? 'indeterminate' : '')}\"\n >\n <div part=\"control\" class=\"control\">\n <slot name=\"checked-indicator\">\n ${definition.checkedIndicator || ''}\n </slot>\n <slot name=\"indeterminate-indicator\">\n ${definition.indeterminateIndicator || ''}\n </slot>\n </div>\n <label\n part=\"label\"\n class=\"${x => (x.defaultSlottedNodes?.length\n ? 'label'\n : 'label label__hidden')}\"\n >\n <slot ${slotted('defaultSlottedNodes')}></slot>\n </label>\n </template>\n`;\n"]}
@@ -16,6 +16,7 @@ export declare class MenuButton extends FoundationElement implements ButtonPatte
16
16
  appearanceVariant: ButtonAppearanceVariant;
17
17
  disabled: boolean;
18
18
  contentHidden: boolean;
19
+ tabIndex: number;
19
20
  /**
20
21
  * Specifies whether or not the menu is open.
21
22
  */
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { attr, observable } from '@microsoft/fast-element';
2
+ import { attr, nullableNumberConverter, observable } from '@microsoft/fast-element';
3
3
  import { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';
4
4
  import { eventChange, keyArrowDown, keyArrowUp, keyEscape } from '@microsoft/fast-web-utilities';
5
5
  import { ButtonAppearance, MenuButtonPosition } from './types';
@@ -190,6 +190,9 @@ __decorate([
190
190
  __decorate([
191
191
  attr({ attribute: 'content-hidden', mode: 'boolean' })
192
192
  ], MenuButton.prototype, "contentHidden", void 0);
193
+ __decorate([
194
+ attr({ attribute: 'tabindex', converter: nullableNumberConverter })
195
+ ], MenuButton.prototype, "tabIndex", void 0);
193
196
  __decorate([
194
197
  attr({ mode: 'boolean' })
195
198
  ], MenuButton.prototype, "open", void 0);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SAAS,EAAE,MAAM,EAAE;YACnB,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAgB,CAAC;YACpE,YAAY,CAAC,KAAK,EAAE,CAAC;SACxB;IACL,CAAC;CAMJ;AAhOU;IADN,IAAI;8CAC0D;AAGxD;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;qDACQ;AAG3C;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;4CACF;AAGjB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;iDAC1B;AAMtB;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;wCACN;AAMb;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;4CAC8B;AAI9C;IADf,UAAU;gDACiC;AAI5B;IADf,UAAU;0CAC6B;AAIxB;IADf,UAAU;gDACkC;AAiMjD,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,CAAC;IACxC,QAAQ,EAAE,aAAa;IACvB,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAAC","sourcesContent":["import { attr, observable } from '@microsoft/fast-element';\nimport { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';\nimport {\n eventChange,\n keyArrowDown,\n keyArrowUp,\n keyEscape\n} from '@microsoft/fast-web-utilities';\nimport {\n ButtonAppearance,\n ButtonAppearanceVariant,\n MenuButtonToggleEventDetail,\n MenuButtonPosition\n} from './types';\nimport type { ToggleButton } from '../toggle-button';\nimport { styles } from './styles';\nimport { template } from './template';\nimport type { ButtonPattern } from '../patterns/button/types';\nimport type { AnchoredRegion } from '../anchored-region';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-menu-button': MenuButton;\n }\n}\n\n/**\n * A nimble-styled menu button control.\n */\nexport class MenuButton extends FoundationElement implements ButtonPattern {\n @attr\n public appearance: ButtonAppearance = ButtonAppearance.outline;\n\n @attr({ attribute: 'appearance-variant' })\n public appearanceVariant: ButtonAppearanceVariant;\n\n @attr({ mode: 'boolean' })\n public disabled = false;\n\n @attr({ attribute: 'content-hidden', mode: 'boolean' })\n public contentHidden = false;\n\n /**\n * Specifies whether or not the menu is open.\n */\n @attr({ mode: 'boolean' })\n public open = false;\n\n /**\n * Configures where the menu should be placed relative to the button that opens the menu.\n */\n @attr({ attribute: 'position' })\n public position: MenuButtonPosition = MenuButtonPosition.auto;\n\n /** @internal */\n @observable\n public readonly toggleButton?: ToggleButton;\n\n /** @internal */\n @observable\n public readonly region?: AnchoredRegion;\n\n /** @internal */\n @observable\n public readonly slottedMenus?: HTMLElement[];\n\n /**\n * Used to maintain the internal state of whether the last menu item should be focused instead\n * of the first menu item the next time the menu is opened.\n */\n private focusLastItemWhenOpened = false;\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this.region) {\n this.region.removeEventListener(\n eventChange,\n this.menuChangeHandler\n );\n }\n }\n\n public toggleButtonChanged(\n _prev: ToggleButton | undefined,\n _next: ToggleButton | undefined\n ): void {\n if (this.region && this.toggleButton) {\n this.region.anchorElement = this.toggleButton;\n }\n }\n\n public regionChanged(\n prev: AnchoredRegion | undefined,\n _next: AnchoredRegion | undefined\n ): void {\n if (prev) {\n prev.removeEventListener(eventChange, this.menuChangeHandler);\n }\n\n if (this.region) {\n if (this.toggleButton) {\n this.region.anchorElement = this.toggleButton;\n }\n this.region.addEventListener(eventChange, this.menuChangeHandler, {\n capture: true\n });\n }\n }\n\n public openChanged(_prev: boolean | undefined, _next: boolean): void {\n if (this.toggleButton) {\n this.toggleButton.checked = this.open;\n }\n\n if (!this.open) {\n // Only fire an event here if the menu is changing to being closed. Otherwise,\n // wait until the menu is actually opened before firing the event.\n const eventDetail: MenuButtonToggleEventDetail = {\n oldState: true,\n newState: false\n };\n this.$emit('toggle', eventDetail);\n }\n }\n\n public regionLoadedHandler(): void {\n if (this.focusLastItemWhenOpened) {\n this.focusLastMenuItem();\n this.focusLastItemWhenOpened = false;\n } else {\n this.focusMenu();\n }\n\n const eventDetail: MenuButtonToggleEventDetail = {\n oldState: false,\n newState: true\n };\n this.$emit('toggle', eventDetail);\n }\n\n public focusoutHandler(e: FocusEvent): boolean {\n if (!this.open) {\n return true;\n }\n\n const focusTarget = e.relatedTarget as HTMLElement;\n if (\n !this.contains(focusTarget)\n && !this.getMenu()?.contains(focusTarget)\n ) {\n this.setOpen(false);\n return false;\n }\n\n return true;\n }\n\n public toggleButtonCheckedChangeHandler(e: Event): boolean {\n this.setOpen(this.toggleButton!.checked);\n // Don't bubble the 'change' event from the toggle button because\n // the menu button has its own 'toggle' event.\n e.stopPropagation();\n return false;\n }\n\n public toggleButtonKeyDownHandler(e: KeyboardEvent): boolean {\n switch (e.key) {\n case keyArrowUp:\n this.focusLastItemWhenOpened = true;\n this.setOpen(true);\n return false;\n case keyArrowDown:\n this.setOpen(true);\n return false;\n default:\n return true;\n }\n }\n\n public menuKeyDownHandler(e: KeyboardEvent): boolean {\n switch (e.key) {\n case keyEscape:\n this.setOpen(false);\n this.toggleButton!.focus();\n return false;\n default:\n return true;\n }\n }\n\n private setOpen(newValue: boolean): void {\n if (this.open === newValue) {\n return;\n }\n\n const eventDetail: MenuButtonToggleEventDetail = {\n oldState: this.open,\n newState: newValue\n };\n this.$emit('beforetoggle', eventDetail);\n\n this.open = newValue;\n }\n\n private getMenu(): HTMLElement | undefined {\n // Get the menu that is slotted within the menu-button, taking into account\n // that it may be nested within multiple 'slot' elements, such as when used\n // within a table.\n if (!this.slottedMenus?.length) {\n return undefined;\n }\n\n let currentItem: HTMLElement | undefined = this.slottedMenus[0];\n while (currentItem) {\n if (currentItem.getAttribute('role') === 'menu') {\n return currentItem;\n }\n\n if (this.isSlotElement(currentItem)) {\n const firstNode = currentItem.assignedNodes()[0];\n if (firstNode instanceof HTMLElement) {\n currentItem = firstNode;\n } else {\n currentItem = undefined;\n }\n } else {\n return undefined;\n }\n }\n\n return undefined;\n }\n\n private isSlotElement(\n element: HTMLElement | undefined\n ): element is HTMLSlotElement {\n return element?.nodeName === 'SLOT';\n }\n\n private focusMenu(): void {\n this.getMenu()?.focus();\n }\n\n private focusLastMenuItem(): void {\n const menuItems = this.getMenu()?.querySelectorAll('[role=menuitem]');\n if (menuItems?.length) {\n const lastMenuItem = menuItems[menuItems.length - 1] as HTMLElement;\n lastMenuItem.focus();\n }\n }\n\n private readonly menuChangeHandler = (): void => {\n this.setOpen(false);\n this.toggleButton!.focus();\n };\n}\n\nconst nimbleMenuButton = MenuButton.compose({\n baseName: 'menu-button',\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenuButton());\nexport const menuButtonTag = 'nimble-menu-button';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/menu-button/index.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,IAAI,EACJ,uBAAuB,EACvB,UAAU,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EACH,WAAW,EACX,YAAY,EACZ,UAAU,EACV,SAAS,EACZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,gBAAgB,EAGhB,kBAAkB,EACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAUtC;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAAj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B;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;wCACN;AAMb;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;4CAC8B;AAI9C;IADf,UAAU;gDACiC;AAI5B;IADf,UAAU;0CAC6B;AAIxB;IADf,UAAU;gDACkC;AAiMjD,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,CAAC;IACxC,QAAQ,EAAE,aAAa;IACvB,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAAC","sourcesContent":["import {\n attr,\n nullableNumberConverter,\n observable\n} from '@microsoft/fast-element';\nimport { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';\nimport {\n eventChange,\n keyArrowDown,\n keyArrowUp,\n keyEscape\n} from '@microsoft/fast-web-utilities';\nimport {\n ButtonAppearance,\n ButtonAppearanceVariant,\n MenuButtonToggleEventDetail,\n MenuButtonPosition\n} from './types';\nimport type { ToggleButton } from '../toggle-button';\nimport { styles } from './styles';\nimport { template } from './template';\nimport type { ButtonPattern } from '../patterns/button/types';\nimport type { AnchoredRegion } from '../anchored-region';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-menu-button': MenuButton;\n }\n}\n\n/**\n * A nimble-styled menu button control.\n */\nexport class MenuButton extends FoundationElement implements ButtonPattern {\n @attr\n public appearance: ButtonAppearance = ButtonAppearance.outline;\n\n @attr({ attribute: 'appearance-variant' })\n public appearanceVariant: ButtonAppearanceVariant;\n\n @attr({ mode: 'boolean' })\n public disabled = false;\n\n @attr({ attribute: 'content-hidden', mode: 'boolean' })\n public contentHidden = false;\n\n @attr({ attribute: 'tabindex', converter: nullableNumberConverter })\n public override tabIndex!: number;\n\n /**\n * Specifies whether or not the menu is open.\n */\n @attr({ mode: 'boolean' })\n public open = false;\n\n /**\n * Configures where the menu should be placed relative to the button that opens the menu.\n */\n @attr({ attribute: 'position' })\n public position: MenuButtonPosition = MenuButtonPosition.auto;\n\n /** @internal */\n @observable\n public readonly toggleButton?: ToggleButton;\n\n /** @internal */\n @observable\n public readonly region?: AnchoredRegion;\n\n /** @internal */\n @observable\n public readonly slottedMenus?: HTMLElement[];\n\n /**\n * Used to maintain the internal state of whether the last menu item should be focused instead\n * of the first menu item the next time the menu is opened.\n */\n private focusLastItemWhenOpened = false;\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this.region) {\n this.region.removeEventListener(\n eventChange,\n this.menuChangeHandler\n );\n }\n }\n\n public toggleButtonChanged(\n _prev: ToggleButton | undefined,\n _next: ToggleButton | undefined\n ): void {\n if (this.region && this.toggleButton) {\n this.region.anchorElement = this.toggleButton;\n }\n }\n\n public regionChanged(\n prev: AnchoredRegion | undefined,\n _next: AnchoredRegion | undefined\n ): void {\n if (prev) {\n prev.removeEventListener(eventChange, this.menuChangeHandler);\n }\n\n if (this.region) {\n if (this.toggleButton) {\n this.region.anchorElement = this.toggleButton;\n }\n this.region.addEventListener(eventChange, this.menuChangeHandler, {\n capture: true\n });\n }\n }\n\n public openChanged(_prev: boolean | undefined, _next: boolean): void {\n if (this.toggleButton) {\n this.toggleButton.checked = this.open;\n }\n\n if (!this.open) {\n // Only fire an event here if the menu is changing to being closed. Otherwise,\n // wait until the menu is actually opened before firing the event.\n const eventDetail: MenuButtonToggleEventDetail = {\n oldState: true,\n newState: false\n };\n this.$emit('toggle', eventDetail);\n }\n }\n\n public regionLoadedHandler(): void {\n if (this.focusLastItemWhenOpened) {\n this.focusLastMenuItem();\n this.focusLastItemWhenOpened = false;\n } else {\n this.focusMenu();\n }\n\n const eventDetail: MenuButtonToggleEventDetail = {\n oldState: false,\n newState: true\n };\n this.$emit('toggle', eventDetail);\n }\n\n public focusoutHandler(e: FocusEvent): boolean {\n if (!this.open) {\n return true;\n }\n\n const focusTarget = e.relatedTarget as HTMLElement;\n if (\n !this.contains(focusTarget)\n && !this.getMenu()?.contains(focusTarget)\n ) {\n this.setOpen(false);\n return false;\n }\n\n return true;\n }\n\n public toggleButtonCheckedChangeHandler(e: Event): boolean {\n this.setOpen(this.toggleButton!.checked);\n // Don't bubble the 'change' event from the toggle button because\n // the menu button has its own 'toggle' event.\n e.stopPropagation();\n return false;\n }\n\n public toggleButtonKeyDownHandler(e: KeyboardEvent): boolean {\n switch (e.key) {\n case keyArrowUp:\n this.focusLastItemWhenOpened = true;\n this.setOpen(true);\n return false;\n case keyArrowDown:\n this.setOpen(true);\n return false;\n default:\n return true;\n }\n }\n\n public menuKeyDownHandler(e: KeyboardEvent): boolean {\n switch (e.key) {\n case keyEscape:\n this.setOpen(false);\n this.toggleButton!.focus();\n return false;\n default:\n return true;\n }\n }\n\n private setOpen(newValue: boolean): void {\n if (this.open === newValue) {\n return;\n }\n\n const eventDetail: MenuButtonToggleEventDetail = {\n oldState: this.open,\n newState: newValue\n };\n this.$emit('beforetoggle', eventDetail);\n\n this.open = newValue;\n }\n\n private getMenu(): HTMLElement | undefined {\n // Get the menu that is slotted within the menu-button, taking into account\n // that it may be nested within multiple 'slot' elements, such as when used\n // within a table.\n if (!this.slottedMenus?.length) {\n return undefined;\n }\n\n let currentItem: HTMLElement | undefined = this.slottedMenus[0];\n while (currentItem) {\n if (currentItem.getAttribute('role') === 'menu') {\n return currentItem;\n }\n\n if (this.isSlotElement(currentItem)) {\n const firstNode = currentItem.assignedNodes()[0];\n if (firstNode instanceof HTMLElement) {\n currentItem = firstNode;\n } else {\n currentItem = undefined;\n }\n } else {\n return undefined;\n }\n }\n\n return undefined;\n }\n\n private isSlotElement(\n element: HTMLElement | undefined\n ): element is HTMLSlotElement {\n return element?.nodeName === 'SLOT';\n }\n\n private focusMenu(): void {\n this.getMenu()?.focus();\n }\n\n private focusLastMenuItem(): void {\n const menuItems = this.getMenu()?.querySelectorAll('[role=menuitem]');\n if (menuItems?.length) {\n const lastMenuItem = menuItems[menuItems.length - 1] as HTMLElement;\n lastMenuItem.focus();\n }\n }\n\n private readonly menuChangeHandler = (): void => {\n this.setOpen(false);\n this.toggleButton!.focus();\n };\n}\n\nconst nimbleMenuButton = MenuButton.compose({\n baseName: 'menu-button',\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenuButton());\nexport const menuButtonTag = 'nimble-menu-button';\n"]}
@@ -14,6 +14,7 @@ export const template = html `
14
14
  ?content-hidden="${x => x.contentHidden}"
15
15
  ?checked="${x => x.open}"
16
16
  ?disabled="${x => x.disabled}"
17
+ tabindex="${x => x.tabIndex}"
17
18
  aria-haspopup="true"
18
19
  aria-expanded="${x => x.open}"
19
20
  @change="${(x, c) => x.toggleButtonCheckedChangeHandler(c.event)}"
@@ -1 +1 @@
1
- {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/menu-button/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,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,eAAe;;0BAEA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU;kCACT,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB;+BAC3B,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,eAAe;UACjB,IAAI,CACN,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EACX,IAAI,CAAY;eACT,iBAAiB;;;;;6CAKa,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,CAAC;;gBAE7D,iBAAiB;SACxB,CACJ;;CAEJ,CAAC","sourcesContent":["import { html, ref, slotted, when } from '@microsoft/fast-element';\nimport type { MenuButton } from '.';\nimport { toggleButtonTag } from '../toggle-button';\nimport { anchoredRegionTag } from '../anchored-region';\n\n// prettier-ignore\nexport const template = html<MenuButton>`\n <template\n ?open=\"${x => x.open}\"\n @focusout=\"${(x, c) => x.focusoutHandler(c.event as FocusEvent)}\"\n >\n <${toggleButtonTag}\n part=\"button\"\n appearance=\"${x => x.appearance}\"\n appearance-variant=\"${x => x.appearanceVariant}\"\n ?content-hidden=\"${x => x.contentHidden}\"\n ?checked=\"${x => x.open}\"\n ?disabled=\"${x => x.disabled}\"\n aria-haspopup=\"true\"\n aria-expanded=\"${x => x.open}\"\n @change=\"${(x, c) => x.toggleButtonCheckedChangeHandler(c.event)}\"\n @keydown=\"${(x, c) => x.toggleButtonKeyDownHandler(c.event as KeyboardEvent)}\"\n ${ref('toggleButton')}\n exportparts=\"start,end\"\n >\n ${'' /* Forward the contents of the 'start', 'end', and default slots to the toggle button */}\n <slot slot=\"start\" name=\"start\"></slot>\n <slot></slot>\n <slot slot=\"end\" name=\"end\"></slot>\n </${toggleButtonTag}>\n ${when(\n x => x.open,\n html<MenuButton>`\n <${anchoredRegionTag}\n fixed-placement=\"true\"\n auto-update-mode=\"auto\"\n horizontal-inset=\"true\"\n horizontal-positioning-mode=\"dynamic\"\n vertical-positioning-mode=\"${x => (x.position === 'auto' ? 'dynamic' : 'locktodefault')}\"\n vertical-default-position=\"${x => (x.position === 'above' ? 'top' : 'bottom')}\"\n @loaded=\"${x => x.regionLoadedHandler()}\"\n @keydown=\"${(x, c) => x.menuKeyDownHandler(c.event as KeyboardEvent)}\"\n ${ref('region')}\n >\n <span part=\"menu\">\n <slot name=\"menu\" ${slotted({ property: 'slottedMenus' })}></slot>\n </span>\n </${anchoredRegionTag}>\n `\n )}\n </template>\n`;\n"]}
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/menu-button/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,iBAA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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,CAAC;;gBAE7D,iBAAiB;SACxB,CACJ;;CAEJ,CAAC","sourcesContent":["import { html, ref, slotted, when } from '@microsoft/fast-element';\nimport type { MenuButton } from '.';\nimport { toggleButtonTag } from '../toggle-button';\nimport { anchoredRegionTag } from '../anchored-region';\n\n// prettier-ignore\nexport const template = html<MenuButton>`\n <template\n ?open=\"${x => x.open}\"\n @focusout=\"${(x, c) => x.focusoutHandler(c.event as FocusEvent)}\"\n >\n <${toggleButtonTag}\n part=\"button\"\n appearance=\"${x => x.appearance}\"\n appearance-variant=\"${x => x.appearanceVariant}\"\n ?content-hidden=\"${x => x.contentHidden}\"\n ?checked=\"${x => x.open}\"\n ?disabled=\"${x => x.disabled}\"\n tabindex=\"${x => x.tabIndex}\"\n aria-haspopup=\"true\"\n aria-expanded=\"${x => x.open}\"\n @change=\"${(x, c) => x.toggleButtonCheckedChangeHandler(c.event)}\"\n @keydown=\"${(x, c) => x.toggleButtonKeyDownHandler(c.event as KeyboardEvent)}\"\n ${ref('toggleButton')}\n exportparts=\"start,end\"\n >\n ${'' /* Forward the contents of the 'start', 'end', and default slots to the toggle button */}\n <slot slot=\"start\" name=\"start\"></slot>\n <slot></slot>\n <slot slot=\"end\" name=\"end\"></slot>\n </${toggleButtonTag}>\n ${when(\n x => x.open,\n html<MenuButton>`\n <${anchoredRegionTag}\n fixed-placement=\"true\"\n auto-update-mode=\"auto\"\n horizontal-inset=\"true\"\n horizontal-positioning-mode=\"dynamic\"\n vertical-positioning-mode=\"${x => (x.position === 'auto' ? 'dynamic' : 'locktodefault')}\"\n vertical-default-position=\"${x => (x.position === 'above' ? 'top' : 'bottom')}\"\n @loaded=\"${x => x.regionLoadedHandler()}\"\n @keydown=\"${(x, c) => x.menuKeyDownHandler(c.event as KeyboardEvent)}\"\n ${ref('region')}\n >\n <span part=\"menu\">\n <slot name=\"menu\" ${slotted({ property: 'slottedMenus' })}></slot>\n </span>\n </${anchoredRegionTag}>\n `\n )}\n </template>\n`;\n"]}
@@ -2,7 +2,7 @@ import { css } from '@microsoft/fast-element';
2
2
  import { White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';
3
3
  import { styles as dropdownStyles } from '../patterns/dropdown/styles';
4
4
  import { styles as errorStyles } from '../patterns/error/styles';
5
- import { borderRgbPartialColor, borderWidth, controlHeight, controlSlimHeight, fillHoverColor, fillHoverSelectedColor, fillSelectedColor, mediumPadding, placeholderFontColor, smallPadding } from '../theme-provider/design-tokens';
5
+ import { borderRgbPartialColor, borderWidth, controlHeight, controlSlimHeight, fillHoverColor, fillHoverSelectedColor, fillSelectedColor, iconColor, mediumPadding, placeholderFontColor, smallPadding } from '../theme-provider/design-tokens';
6
6
  import { appearanceBehavior } from '../utilities/style/appearance';
7
7
  import { DropdownAppearance } from './types';
8
8
  import { focusVisible } from '../utilities/style/focus';
@@ -89,6 +89,7 @@ export const styles = css `
89
89
 
90
90
  .filter-icon {
91
91
  padding-left: ${smallPadding};
92
+ ${iconColor.cssCustomProperty}: ${placeholderFontColor};
92
93
  }
93
94
 
94
95
  .filter-input {
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/select/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACH,qBAAqB,EAC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IAAI,CAAC;;SAEnD,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport { White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';\nimport { styles as dropdownStyles } from '../patterns/dropdown/styles';\nimport { styles as errorStyles } from '../patterns/error/styles';\nimport {\n borderRgbPartialColor,\n borderWidth,\n controlHeight,\n controlSlimHeight,\n fillHoverColor,\n fillHoverSelectedColor,\n fillSelectedColor,\n mediumPadding,\n placeholderFontColor,\n smallPadding\n} from '../theme-provider/design-tokens';\nimport { appearanceBehavior } from '../utilities/style/appearance';\nimport { DropdownAppearance } from './types';\nimport { focusVisible } from '../utilities/style/focus';\nimport { themeBehavior } from '../utilities/style/theme';\nimport { Theme } from '../theme-provider/types';\nimport { hexToRgbaCssColor } from '../utilities/style/colors';\n\nexport const styles = css`\n ${dropdownStyles}\n ${errorStyles}\n\n ${\n /* We are using flex `order` to define the visual ordering of the selected value,\n error icon, and dropdown arrow because they are not \"interactive\" i.e. part of the tab order */ ''\n }\n\n .selected-value.placeholder {\n color: ${placeholderFontColor};\n }\n\n .selected-value {\n order: 1;\n }\n\n .clear-button {\n order: 3;\n height: ${controlSlimHeight};\n margin-left: ${smallPadding};\n }\n\n [part='indicator'] {\n order: 4;\n }\n\n .error-icon {\n order: 2;\n }\n\n [part='end'] {\n display: contents;\n }\n\n .listbox {\n overflow-x: clip;\n }\n\n .listbox.empty slot {\n display: none;\n }\n\n .listbox.above {\n flex-flow: column-reverse;\n }\n\n .filter-field {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: ${controlHeight};\n background: transparent;\n }\n\n .filter-field::before {\n content: '';\n position: absolute;\n height: 0px;\n border-bottom: rgba(${borderRgbPartialColor}, 0.1) 2px solid;\n bottom: calc(${controlHeight} + ${smallPadding} - ${borderWidth});\n }\n\n .filter-field.above::before {\n width: calc(100% - (2 * ${borderWidth}));\n }\n\n .filter-field::after {\n content: '';\n position: absolute;\n height: 0px;\n border-bottom: rgba(${borderRgbPartialColor}, 0.1) 2px solid;\n top: calc(${controlHeight} + ${smallPadding} - ${borderWidth});\n }\n\n .filter-field:not(.above)::after {\n width: calc(100% - (2 * ${borderWidth}));\n }\n\n .filter-icon {\n padding-left: ${smallPadding};\n }\n\n .filter-input {\n background: transparent;\n border: none;\n color: inherit;\n font: inherit;\n height: var(--ni-nimble-control-height);\n padding: 0 ${smallPadding} 0 ${mediumPadding};\n width: 100%;\n }\n\n .filter-input::placeholder {\n color: ${placeholderFontColor};\n }\n\n .filter-input${focusVisible} {\n outline: 0px;\n }\n\n .scrollable-region {\n overflow: auto;\n }\n\n ::slotted([role='option']) {\n background-color: transparent;\n }\n\n ::slotted([role='option']:hover) {\n background-color: ${fillHoverColor};\n }\n\n ::slotted([role='option'][active-option]) {\n background-color: ${fillSelectedColor};\n }\n\n ::slotted([role='option'][active-option]:hover) {\n background-color: ${fillHoverSelectedColor};\n }\n\n .no-results-label {\n color: ${placeholderFontColor};\n height: ${controlHeight};\n display: inline-flex;\n align-items: center;\n padding: ${smallPadding} ${mediumPadding};\n }\n`.withBehaviors(\n appearanceBehavior(\n DropdownAppearance.block,\n css`\n :host([error-visible]) .control {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n `\n ),\n themeBehavior(\n Theme.color,\n css`\n .filter-field,\n .no-results-label {\n background: ${hexToRgbaCssColor(White, 0.15)};\n }\n `\n )\n);\n"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/select/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACH,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,cAAc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AK,EAAE,IAAI,CAAC;;SAEnD,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport { White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';\nimport { styles as dropdownStyles } from '../patterns/dropdown/styles';\nimport { styles as errorStyles } from '../patterns/error/styles';\nimport {\n borderRgbPartialColor,\n borderWidth,\n controlHeight,\n controlSlimHeight,\n fillHoverColor,\n fillHoverSelectedColor,\n fillSelectedColor,\n iconColor,\n mediumPadding,\n placeholderFontColor,\n smallPadding\n} from '../theme-provider/design-tokens';\nimport { appearanceBehavior } from '../utilities/style/appearance';\nimport { DropdownAppearance } from './types';\nimport { focusVisible } from '../utilities/style/focus';\nimport { themeBehavior } from '../utilities/style/theme';\nimport { Theme } from '../theme-provider/types';\nimport { hexToRgbaCssColor } from '../utilities/style/colors';\n\nexport const styles = css`\n ${dropdownStyles}\n ${errorStyles}\n\n ${\n /* We are using flex `order` to define the visual ordering of the selected value,\n error icon, and dropdown arrow because they are not \"interactive\" i.e. part of the tab order */ ''\n }\n\n .selected-value.placeholder {\n color: ${placeholderFontColor};\n }\n\n .selected-value {\n order: 1;\n }\n\n .clear-button {\n order: 3;\n height: ${controlSlimHeight};\n margin-left: ${smallPadding};\n }\n\n [part='indicator'] {\n order: 4;\n }\n\n .error-icon {\n order: 2;\n }\n\n [part='end'] {\n display: contents;\n }\n\n .listbox {\n overflow-x: clip;\n }\n\n .listbox.empty slot {\n display: none;\n }\n\n .listbox.above {\n flex-flow: column-reverse;\n }\n\n .filter-field {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: ${controlHeight};\n background: transparent;\n }\n\n .filter-field::before {\n content: '';\n position: absolute;\n height: 0px;\n border-bottom: rgba(${borderRgbPartialColor}, 0.1) 2px solid;\n bottom: calc(${controlHeight} + ${smallPadding} - ${borderWidth});\n }\n\n .filter-field.above::before {\n width: calc(100% - (2 * ${borderWidth}));\n }\n\n .filter-field::after {\n content: '';\n position: absolute;\n height: 0px;\n border-bottom: rgba(${borderRgbPartialColor}, 0.1) 2px solid;\n top: calc(${controlHeight} + ${smallPadding} - ${borderWidth});\n }\n\n .filter-field:not(.above)::after {\n width: calc(100% - (2 * ${borderWidth}));\n }\n\n .filter-icon {\n padding-left: ${smallPadding};\n ${iconColor.cssCustomProperty}: ${placeholderFontColor};\n }\n\n .filter-input {\n background: transparent;\n border: none;\n color: inherit;\n font: inherit;\n height: var(--ni-nimble-control-height);\n padding: 0 ${smallPadding} 0 ${mediumPadding};\n width: 100%;\n }\n\n .filter-input::placeholder {\n color: ${placeholderFontColor};\n }\n\n .filter-input${focusVisible} {\n outline: 0px;\n }\n\n .scrollable-region {\n overflow: auto;\n }\n\n ::slotted([role='option']) {\n background-color: transparent;\n }\n\n ::slotted([role='option']:hover) {\n background-color: ${fillHoverColor};\n }\n\n ::slotted([role='option'][active-option]) {\n background-color: ${fillSelectedColor};\n }\n\n ::slotted([role='option'][active-option]:hover) {\n background-color: ${fillHoverSelectedColor};\n }\n\n .no-results-label {\n color: ${placeholderFontColor};\n height: ${controlHeight};\n display: inline-flex;\n align-items: center;\n padding: ${smallPadding} ${mediumPadding};\n }\n`.withBehaviors(\n appearanceBehavior(\n DropdownAppearance.block,\n css`\n :host([error-visible]) .control {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n `\n ),\n themeBehavior(\n Theme.color,\n css`\n .filter-field,\n .no-results-label {\n background: ${hexToRgbaCssColor(White, 0.15)};\n }\n `\n )\n);\n"]}
@@ -1,6 +1,6 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  import { display } from '../utilities/style/display';
3
- import { borderRgbPartialColor, borderHoverColor, borderWidth, bodyFontColor, bodyDisabledFontColor, controlHeight, failColor, smallDelay, controlLabelFont, bodyFont, controlLabelFontColor, controlLabelDisabledFontColor, mediumPadding, iconColor } from '../theme-provider/design-tokens';
3
+ import { borderRgbPartialColor, borderHoverColor, borderWidth, bodyFontColor, bodyDisabledFontColor, controlHeight, failColor, smallDelay, controlLabelFont, bodyFont, controlLabelFontColor, controlLabelDisabledFontColor, mediumPadding } from '../theme-provider/design-tokens';
4
4
  import { appearanceBehavior } from '../utilities/style/appearance';
5
5
  import { TextFieldAppearance } from './types';
6
6
  import { Theme } from '../theme-provider/types';
@@ -101,7 +101,11 @@ export const styles = css `
101
101
 
102
102
  slot[name='start']::slotted(*) {
103
103
  flex: none;
104
- ${iconColor.cssCustomProperty}: currentcolor;
104
+ opacity: 0.6;
105
+ }
106
+
107
+ :host([disabled]) slot[name='start']::slotted(*) {
108
+ opacity: 0.3;
105
109
  }
106
110
 
107
111
  .control {
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/text-field/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,OAAO,EACH,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,qBAAqB,EACrB,6BAA6B,EAC7B,aAAa,EACb,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,cAAc,CAAC;MACvB,WAAW;;;gBAGD,QAAQ;;UAEd,cAAc;iBACP,aAAa;mDACq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CAAC,EACzB,GAAG,CAAA;;;;SAIF,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport { display } from '../utilities/style/display';\n\nimport {\n borderRgbPartialColor,\n borderHoverColor,\n borderWidth,\n bodyFontColor,\n bodyDisabledFontColor,\n controlHeight,\n failColor,\n smallDelay,\n controlLabelFont,\n bodyFont,\n controlLabelFontColor,\n controlLabelDisabledFontColor,\n mediumPadding,\n iconColor\n} from '../theme-provider/design-tokens';\nimport { appearanceBehavior } from '../utilities/style/appearance';\nimport { TextFieldAppearance } from './types';\nimport { Theme } from '../theme-provider/types';\nimport { themeBehavior } from '../utilities/style/theme';\nimport { styles as errorStyles } from '../patterns/error/styles';\nimport { userSelectNone } from '../utilities/style/user-select';\n\nexport const styles = css`\n ${display('inline-block')}\n ${errorStyles}\n\n :host {\n font: ${bodyFont};\n outline: none;\n ${userSelectNone}\n color: ${bodyFontColor};\n --ni-private-hover-indicator-width: calc(${borderWidth} + 1px);\n --ni-private-height-within-border: calc(\n ${controlHeight} - 2 * ${borderWidth}\n );\n }\n\n :host([disabled]) {\n color: ${bodyDisabledFontColor};\n }\n\n .label {\n display: flex;\n color: ${controlLabelFontColor};\n font: ${controlLabelFont};\n }\n\n :host([disabled]) .label {\n color: ${controlLabelDisabledFontColor};\n }\n\n .root {\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-direction: row;\n border-radius: 0px;\n font: inherit;\n align-items: center;\n justify-content: center;\n border: 0px solid rgba(${borderRgbPartialColor}, 0.3);\n gap: ${mediumPadding};\n padding: ${borderWidth};\n }\n\n :host([readonly]) .root {\n border-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([disabled]) .root {\n border-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([error-visible]) .root {\n border-bottom-color: ${failColor};\n }\n\n .root:focus-within {\n border-bottom-color: ${borderHoverColor};\n }\n\n :host([appearance='frameless'][full-bleed]) .root {\n padding-left: 0px;\n padding-right: 0px;\n }\n\n .root::before {\n ${/* Empty string causes alignment issue */ ''}\n content: ' ';\n color: transparent;\n width: 0px;\n ${userSelectNone}\n }\n\n :host([appearance='frameless'][full-bleed]) .root::before {\n display: none;\n }\n\n .root::after {\n ${/* Empty string causes alignment issue */ ''}\n content: ' ';\n color: transparent;\n width: 0px;\n ${userSelectNone}\n }\n\n :host([appearance='frameless'][full-bleed]) .root::after {\n display: none;\n }\n\n [part='start'] {\n display: contents;\n }\n\n slot[name='start']::slotted(*) {\n flex: none;\n ${iconColor.cssCustomProperty}: currentcolor;\n }\n\n .control {\n -webkit-appearance: none;\n font: inherit;\n background: transparent;\n color: inherit;\n padding: 0px;\n height: var(--ni-private-height-within-border);\n width: 100%;\n margin-top: auto;\n margin-bottom: auto;\n border: none;\n text-overflow: ellipsis;\n }\n\n .control:hover,\n .control:focus,\n .control:disabled,\n .control:active {\n outline: none;\n }\n\n .control:disabled {\n ${\n /* There's an issue with the input element where the ellipsized\n overflowed text is blank when scrolled into view, so just clip instead.\n See https://webcompat.com/issues/104481 */ ''\n }\n text-overflow: clip;\n }\n\n .control::placeholder {\n color: ${controlLabelFontColor};\n }\n\n .control[disabled]::placeholder {\n color: ${bodyDisabledFontColor};\n }\n\n [part='end'] {\n display: contents;\n }\n\n [part='end']::after {\n content: '';\n position: absolute;\n bottom: calc(-1 * ${borderWidth});\n width: 0px;\n height: 0px;\n border-bottom: ${borderHoverColor}\n var(--ni-private-hover-indicator-width) solid;\n transition: width ${smallDelay} ease-in;\n }\n\n @media (prefers-reduced-motion) {\n [part='end']::after {\n transition-duration: 0s;\n }\n }\n\n :host([error-visible]) [part='end']::after {\n border-bottom-color: ${failColor};\n }\n\n :host(:hover) [part='end']::after {\n width: 100%;\n }\n\n :host([disabled]:hover) [part='end']::after,\n :host([readonly]:hover) [part='end']::after {\n width: 0px;\n }\n\n [part='actions'] {\n display: contents;\n }\n\n slot[name='actions']::slotted(*) {\n ${controlHeight.cssCustomProperty}: 24px;\n }\n`.withBehaviors(\n appearanceBehavior(\n TextFieldAppearance.underline,\n css`\n .root {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n `\n ),\n appearanceBehavior(\n TextFieldAppearance.block,\n css`\n .root {\n background-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n .control {\n padding-left: ${borderWidth};\n padding-right: ${borderWidth};\n }\n\n .root:focus-within,\n :host([error-visible]) .root {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n\n :host(:hover) .root {\n padding-bottom: 0;\n }\n\n :host([readonly]) .root {\n background-color: rgba(${borderRgbPartialColor}, 0.07);\n border-color: transparent;\n }\n\n :host([disabled]) .root {\n background-color: rgba(${borderRgbPartialColor}, 0.07);\n }\n `\n ),\n appearanceBehavior(\n TextFieldAppearance.outline,\n css`\n .root {\n border-width: ${borderWidth};\n padding: 0;\n }\n `\n ),\n appearanceBehavior(\n TextFieldAppearance.frameless,\n css`\n .control {\n padding-left: ${borderWidth};\n padding-right: ${borderWidth};\n }\n\n :host([readonly]) .root {\n border-color: transparent;\n }\n `\n ),\n themeBehavior(\n Theme.light,\n css`\n .control::-ms-reveal {\n filter: invert(0%);\n }\n `\n ),\n themeBehavior(\n [Theme.dark, Theme.color],\n css`\n .control::-ms-reveal {\n filter: invert(100%);\n }\n `\n )\n);\n"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/text-field/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,OAAO,EACH,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,qBAAqB,EACrB,6BAA6B,EAC7B,aAAa,EAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,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L,WAAW;;;;;;;;;yCAST,qBAAqB;;;;;yCAKrB,qBAAqB;;SAErD,CACJ,EACD,kBAAkB,CACd,mBAAmB,CAAC,OAAO,EAC3B,GAAG,CAAA;;gCAEqB,WAAW;;;SAGlC,CACJ,EACD,kBAAkB,CACd,mBAAmB,CAAC,SAAS,EAC7B,GAAG,CAAA;;gCAEqB,WAAW;iCACV,WAAW;;;;;;SAMnC,CACJ,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;;;SAIF,CACJ,EACD,aAAa,CACT,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,EACzB,GAAG,CAAA;;;;SAIF,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport { display } from '../utilities/style/display';\n\nimport {\n borderRgbPartialColor,\n borderHoverColor,\n borderWidth,\n bodyFontColor,\n bodyDisabledFontColor,\n controlHeight,\n failColor,\n smallDelay,\n controlLabelFont,\n bodyFont,\n controlLabelFontColor,\n controlLabelDisabledFontColor,\n mediumPadding\n} from '../theme-provider/design-tokens';\nimport { appearanceBehavior } from '../utilities/style/appearance';\nimport { TextFieldAppearance } from './types';\nimport { Theme } from '../theme-provider/types';\nimport { themeBehavior } from '../utilities/style/theme';\nimport { styles as errorStyles } from '../patterns/error/styles';\nimport { userSelectNone } from '../utilities/style/user-select';\n\nexport const styles = css`\n ${display('inline-block')}\n ${errorStyles}\n\n :host {\n font: ${bodyFont};\n outline: none;\n ${userSelectNone}\n color: ${bodyFontColor};\n --ni-private-hover-indicator-width: calc(${borderWidth} + 1px);\n --ni-private-height-within-border: calc(\n ${controlHeight} - 2 * ${borderWidth}\n );\n }\n\n :host([disabled]) {\n color: ${bodyDisabledFontColor};\n }\n\n .label {\n display: flex;\n color: ${controlLabelFontColor};\n font: ${controlLabelFont};\n }\n\n :host([disabled]) .label {\n color: ${controlLabelDisabledFontColor};\n }\n\n .root {\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-direction: row;\n border-radius: 0px;\n font: inherit;\n align-items: center;\n justify-content: center;\n border: 0px solid rgba(${borderRgbPartialColor}, 0.3);\n gap: ${mediumPadding};\n padding: ${borderWidth};\n }\n\n :host([readonly]) .root {\n border-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([disabled]) .root {\n border-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([error-visible]) .root {\n border-bottom-color: ${failColor};\n }\n\n .root:focus-within {\n border-bottom-color: ${borderHoverColor};\n }\n\n :host([appearance='frameless'][full-bleed]) .root {\n padding-left: 0px;\n padding-right: 0px;\n }\n\n .root::before {\n ${/* Empty string causes alignment issue */ ''}\n content: ' ';\n color: transparent;\n width: 0px;\n ${userSelectNone}\n }\n\n :host([appearance='frameless'][full-bleed]) .root::before {\n display: none;\n }\n\n .root::after {\n ${/* Empty string causes alignment issue */ ''}\n content: ' ';\n color: transparent;\n width: 0px;\n ${userSelectNone}\n }\n\n :host([appearance='frameless'][full-bleed]) .root::after {\n display: none;\n }\n\n [part='start'] {\n display: contents;\n }\n\n slot[name='start']::slotted(*) {\n flex: none;\n opacity: 0.6;\n }\n\n :host([disabled]) slot[name='start']::slotted(*) {\n opacity: 0.3;\n }\n\n .control {\n -webkit-appearance: none;\n font: inherit;\n background: transparent;\n color: inherit;\n padding: 0px;\n height: var(--ni-private-height-within-border);\n width: 100%;\n margin-top: auto;\n margin-bottom: auto;\n border: none;\n text-overflow: ellipsis;\n }\n\n .control:hover,\n .control:focus,\n .control:disabled,\n .control:active {\n outline: none;\n }\n\n .control:disabled {\n ${\n /* There's an issue with the input element where the ellipsized\n overflowed text is blank when scrolled into view, so just clip instead.\n See https://webcompat.com/issues/104481 */ ''\n }\n text-overflow: clip;\n }\n\n .control::placeholder {\n color: ${controlLabelFontColor};\n }\n\n .control[disabled]::placeholder {\n color: ${bodyDisabledFontColor};\n }\n\n [part='end'] {\n display: contents;\n }\n\n [part='end']::after {\n content: '';\n position: absolute;\n bottom: calc(-1 * ${borderWidth});\n width: 0px;\n height: 0px;\n border-bottom: ${borderHoverColor}\n var(--ni-private-hover-indicator-width) solid;\n transition: width ${smallDelay} ease-in;\n }\n\n @media (prefers-reduced-motion) {\n [part='end']::after {\n transition-duration: 0s;\n }\n }\n\n :host([error-visible]) [part='end']::after {\n border-bottom-color: ${failColor};\n }\n\n :host(:hover) [part='end']::after {\n width: 100%;\n }\n\n :host([disabled]:hover) [part='end']::after,\n :host([readonly]:hover) [part='end']::after {\n width: 0px;\n }\n\n [part='actions'] {\n display: contents;\n }\n\n slot[name='actions']::slotted(*) {\n ${controlHeight.cssCustomProperty}: 24px;\n }\n`.withBehaviors(\n appearanceBehavior(\n TextFieldAppearance.underline,\n css`\n .root {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n `\n ),\n appearanceBehavior(\n TextFieldAppearance.block,\n css`\n .root {\n background-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n .control {\n padding-left: ${borderWidth};\n padding-right: ${borderWidth};\n }\n\n .root:focus-within,\n :host([error-visible]) .root {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n\n :host(:hover) .root {\n padding-bottom: 0;\n }\n\n :host([readonly]) .root {\n background-color: rgba(${borderRgbPartialColor}, 0.07);\n border-color: transparent;\n }\n\n :host([disabled]) .root {\n background-color: rgba(${borderRgbPartialColor}, 0.07);\n }\n `\n ),\n appearanceBehavior(\n TextFieldAppearance.outline,\n css`\n .root {\n border-width: ${borderWidth};\n padding: 0;\n }\n `\n ),\n appearanceBehavior(\n TextFieldAppearance.frameless,\n css`\n .control {\n padding-left: ${borderWidth};\n padding-right: ${borderWidth};\n }\n\n :host([readonly]) .root {\n border-color: transparent;\n }\n `\n ),\n themeBehavior(\n Theme.light,\n css`\n .control::-ms-reveal {\n filter: invert(0%);\n }\n `\n ),\n themeBehavior(\n [Theme.dark, Theme.color],\n css`\n .control::-ms-reveal {\n filter: invert(100%);\n }\n `\n )\n);\n"]}
@@ -28,8 +28,18 @@ export declare class ToggleButton extends FoundationSwitch implements ButtonPatt
28
28
  * HTML Attribute: content-hidden
29
29
  */
30
30
  contentHidden: boolean;
31
+ /**
32
+ * @public
33
+ * @remarks
34
+ * HTML Attribute: tabindex
35
+ */
36
+ tabIndex: number;
31
37
  /** @internal */
32
38
  readonly control: HTMLElement;
39
+ /**
40
+ * @internal
41
+ */
42
+ get resolvedTabindex(): string | undefined;
33
43
  }
34
44
  export interface ToggleButton extends StartEnd, DelegatesARIAButton {
35
45
  }