@ni/nimble-components 35.8.0 → 35.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,12 @@ export declare class Checkbox extends Checkbox_base {
24
24
  * HTML Attribute: tabindex
25
25
  */
26
26
  tabIndex: number;
27
+ /**
28
+ * @public
29
+ * @remarks
30
+ * HTML Attribute: appearance-indeterminate
31
+ */
32
+ appearanceIndeterminate: boolean;
27
33
  /**
28
34
  * @internal
29
35
  */
@@ -9,6 +9,15 @@ import { mixinErrorPattern } from '../patterns/error/types';
9
9
  * A nimble-styled checkbox control.
10
10
  */
11
11
  export class Checkbox extends mixinErrorPattern(FoundationCheckbox) {
12
+ constructor() {
13
+ super(...arguments);
14
+ /**
15
+ * @public
16
+ * @remarks
17
+ * HTML Attribute: appearance-indeterminate
18
+ */
19
+ this.appearanceIndeterminate = false;
20
+ }
12
21
  /**
13
22
  * @internal
14
23
  */
@@ -20,6 +29,9 @@ export class Checkbox extends mixinErrorPattern(FoundationCheckbox) {
20
29
  __decorate([
21
30
  attr({ attribute: 'tabindex', converter: nullableNumberConverter })
22
31
  ], Checkbox.prototype, "tabIndex", void 0);
32
+ __decorate([
33
+ attr({ attribute: 'appearance-indeterminate', mode: 'boolean' })
34
+ ], Checkbox.prototype, "appearanceIndeterminate", void 0);
23
35
  const nimbleCheckbox = Checkbox.compose({
24
36
  baseName: 'checkbox',
25
37
  baseClass: FoundationCheckbox,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/checkbox/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EACH,YAAY,EACZ,QAAQ,IAAI,kBAAkB,EAEjC,MAAM,qBAAqB,CAAC;AAC7B,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;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAQ5D;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,iBAAiB,CAAC,kBAAkB,CAAC;IAS/D;;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 '@ni/fast-element';\nimport {\n DesignSystem,\n Checkbox as FoundationCheckbox,\n type CheckboxOptions\n} from '@ni/fast-foundation';\nimport { check16X16, minus16X16 } from '@ni/nimble-tokens/dist/icons/js';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { mixinErrorPattern } from '../patterns/error/types';\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 mixinErrorPattern(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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/checkbox/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EACH,YAAY,EACZ,QAAQ,IAAI,kBAAkB,EAEjC,MAAM,qBAAqB,CAAC;AAC7B,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;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAQ5D;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,iBAAiB,CAAC,kBAAkB,CAAC;IAAnE;;QASI;;;;WAIG;QAEI,4BAAuB,GAAG,KAAK,CAAC;IAS3C,CAAC;IAPG;;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;AAjBmB;IADf,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;0CAClC;AAQ3B;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;yDAC1B;AAW3C,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 '@ni/fast-element';\nimport {\n DesignSystem,\n Checkbox as FoundationCheckbox,\n type CheckboxOptions\n} from '@ni/fast-foundation';\nimport { check16X16, minus16X16 } from '@ni/nimble-tokens/dist/icons/js';\nimport { styles } from './styles';\nimport { template } from './template';\nimport { mixinErrorPattern } from '../patterns/error/types';\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 mixinErrorPattern(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 * @public\n * @remarks\n * HTML Attribute: appearance-indeterminate\n */\n @attr({ attribute: 'appearance-indeterminate', mode: 'boolean' })\n public appearanceIndeterminate = false;\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"]}
@@ -101,7 +101,7 @@ export const styles = css `
101
101
  fill: ${borderColor};
102
102
  }
103
103
 
104
- :host(.checked:not(.indeterminate)) slot[name='checked-indicator'] {
104
+ :host(.checked:not(.indeterminate):not([appearance-indeterminate])) slot[name='checked-indicator'] {
105
105
  display: contents;
106
106
  }
107
107
 
@@ -115,7 +115,8 @@ export const styles = css `
115
115
  overflow: visible;
116
116
  }
117
117
 
118
- :host(.indeterminate) slot[name='indeterminate-indicator'] {
118
+ :host(.indeterminate) slot[name='indeterminate-indicator'],
119
+ :host([appearance-indeterminate]) slot[name='indeterminate-indicator'] {
119
120
  display: contents;
120
121
  }
121
122
 
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/checkbox/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACH,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,kBAAkB,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;MACtB,WAAW;;;gBAGD,QAAQ;;;UAGd,cAAc;sBACF,aAAa;;;;;;;;;;;;;;;;;8BAiBL,kBAAkB;;;;;;iBAM/B,QAAQ;kBACP,QAAQ;kBACR,WAAW,UAAU,WAAW;;;;;iCAKjB,UAAU;UACjC;AACE;;;GAGG,CAAC,EACR;;;;;;;;;;;;;iCAayB,qBAAqB;6BACzB,qBAAqB;;;;wBAI1B,gBAAgB;kCACN,WAAW,IAAI,gBAAgB;;;YAGrD,YAAY;wBACA,gBAAgB;6BACX,gBAAgB;;;;;;iBAM5B,aAAa;wBACN,aAAa;;;;;;;iBAOpB,qBAAqB;;;;;;;;;kBASpB,QAAQ;iBACT,QAAQ;;gBAET,WAAW;;;;;;;;qBAQN,qBAAqB;;;;kBAIxB,QAAQ;iBACT,QAAQ;;;;;;;;;gBAST,WAAW;;;;qBAIN,qBAAqB;;;;;;sBAMpB,YAAY;;CAEjC,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport { display } from '../utilities/style/display';\nimport { focusVisible } from '../utilities/style/focus';\n\nimport {\n borderColor,\n borderHoverColor,\n borderRgbPartialColor,\n bodyFontColor,\n bodyDisabledFontColor,\n controlHeight,\n iconSize,\n borderWidth,\n smallDelay,\n bodyFont,\n smallPadding,\n mediumPadding,\n bodyFontLineHeight\n} from '../theme-provider/design-tokens';\nimport { userSelectNone } from '../utilities/style/user-select';\nimport { styles as errorStyles } from '../patterns/error/styles';\n\nexport const styles = css`\n ${display('inline-grid')}\n ${errorStyles}\n\n :host {\n font: ${bodyFont};\n cursor: pointer;\n outline: none;\n ${userSelectNone}\n min-height: ${controlHeight};\n }\n\n :host([disabled]) {\n cursor: default;\n }\n\n .outer-container {\n height: 100%;\n display: flex;\n align-items: center;\n position: relative;\n }\n\n .container {\n display: grid;\n grid-template-columns: auto 1fr auto;\n grid-template-rows: ${bodyFontLineHeight} auto;\n align-items: center;\n width: 100%;\n }\n\n .control {\n width: ${iconSize};\n height: ${iconSize};\n border: ${borderWidth} solid ${borderColor};\n padding: 2px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: box-shadow ${smallDelay};\n ${\n /*\n * Firefox includes the line height in the outline height calculation (not sure if intended or accidental).\n * Set it to 0 to ensure the outline is just as high as the control.\n */ ''\n }\n line-height: 0;\n grid-column: 1;\n grid-row: 1;\n }\n\n @media (prefers-reduced-motion) {\n .control {\n transition-duration: 0s;\n }\n }\n\n :host([disabled]) .control {\n background-color: rgba(${borderRgbPartialColor}, 0.1);\n border-color: rgba(${borderRgbPartialColor}, 0.2);\n }\n\n :host(:not([disabled]):not(:active):hover) .control {\n border-color: ${borderHoverColor};\n box-shadow: 0px 0px 0px ${borderWidth} ${borderHoverColor} inset;\n }\n\n :host(${focusVisible}) .control {\n border-color: ${borderHoverColor};\n outline: 2px solid ${borderHoverColor};\n outline-offset: 1px;\n }\n\n .label {\n font: inherit;\n color: ${bodyFontColor};\n padding-left: ${mediumPadding};\n grid-column: 2;\n grid-row: 1 / span 2;\n cursor: inherit;\n }\n\n :host([disabled]) .label {\n color: ${bodyDisabledFontColor};\n }\n\n slot[name='checked-indicator'],\n slot[name='indeterminate-indicator'] {\n display: none;\n }\n\n slot[name='checked-indicator'] svg {\n height: ${iconSize};\n width: ${iconSize};\n overflow: visible;\n fill: ${borderColor};\n }\n\n :host(.checked:not(.indeterminate)) slot[name='checked-indicator'] {\n display: contents;\n }\n\n :host([disabled]) slot[name='checked-indicator'] svg {\n fill: rgba(${borderRgbPartialColor}, 0.3);\n }\n\n slot[name='indeterminate-indicator'] svg {\n height: ${iconSize};\n width: ${iconSize};\n overflow: visible;\n }\n\n :host(.indeterminate) slot[name='indeterminate-indicator'] {\n display: contents;\n }\n\n slot[name='indeterminate-indicator'] svg {\n fill: ${borderColor};\n }\n\n :host([disabled]) slot[name='indeterminate-indicator'] svg {\n fill: rgba(${borderRgbPartialColor}, 0.3);\n }\n\n .error-icon {\n grid-column: 3;\n grid-row: 1;\n margin: 0px ${smallPadding};\n }\n`;\n"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/checkbox/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACH,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,kBAAkB,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;MACtB,WAAW;;;gBAGD,QAAQ;;;UAGd,cAAc;sBACF,aAAa;;;;;;;;;;;;;;;;;8BAiBL,kBAAkB;;;;;;iBAM/B,QAAQ;kBACP,QAAQ;kBACR,WAAW,UAAU,WAAW;;;;;iCAKjB,UAAU;UACjC;AACE;;;GAGG,CAAC,EACR;;;;;;;;;;;;;iCAayB,qBAAqB;6BACzB,qBAAqB;;;;wBAI1B,gBAAgB;kCACN,WAAW,IAAI,gBAAgB;;;YAGrD,YAAY;wBACA,gBAAgB;6BACX,gBAAgB;;;;;;iBAM5B,aAAa;wBACN,aAAa;;;;;;;iBAOpB,qBAAqB;;;;;;;;;kBASpB,QAAQ;iBACT,QAAQ;;gBAET,WAAW;;;;;;;;qBAQN,qBAAqB;;;;kBAIxB,QAAQ;iBACT,QAAQ;;;;;;;;;;gBAUT,WAAW;;;;qBAIN,qBAAqB;;;;;;sBAMpB,YAAY;;CAEjC,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport { display } from '../utilities/style/display';\nimport { focusVisible } from '../utilities/style/focus';\n\nimport {\n borderColor,\n borderHoverColor,\n borderRgbPartialColor,\n bodyFontColor,\n bodyDisabledFontColor,\n controlHeight,\n iconSize,\n borderWidth,\n smallDelay,\n bodyFont,\n smallPadding,\n mediumPadding,\n bodyFontLineHeight\n} from '../theme-provider/design-tokens';\nimport { userSelectNone } from '../utilities/style/user-select';\nimport { styles as errorStyles } from '../patterns/error/styles';\n\nexport const styles = css`\n ${display('inline-grid')}\n ${errorStyles}\n\n :host {\n font: ${bodyFont};\n cursor: pointer;\n outline: none;\n ${userSelectNone}\n min-height: ${controlHeight};\n }\n\n :host([disabled]) {\n cursor: default;\n }\n\n .outer-container {\n height: 100%;\n display: flex;\n align-items: center;\n position: relative;\n }\n\n .container {\n display: grid;\n grid-template-columns: auto 1fr auto;\n grid-template-rows: ${bodyFontLineHeight} auto;\n align-items: center;\n width: 100%;\n }\n\n .control {\n width: ${iconSize};\n height: ${iconSize};\n border: ${borderWidth} solid ${borderColor};\n padding: 2px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: box-shadow ${smallDelay};\n ${\n /*\n * Firefox includes the line height in the outline height calculation (not sure if intended or accidental).\n * Set it to 0 to ensure the outline is just as high as the control.\n */ ''\n }\n line-height: 0;\n grid-column: 1;\n grid-row: 1;\n }\n\n @media (prefers-reduced-motion) {\n .control {\n transition-duration: 0s;\n }\n }\n\n :host([disabled]) .control {\n background-color: rgba(${borderRgbPartialColor}, 0.1);\n border-color: rgba(${borderRgbPartialColor}, 0.2);\n }\n\n :host(:not([disabled]):not(:active):hover) .control {\n border-color: ${borderHoverColor};\n box-shadow: 0px 0px 0px ${borderWidth} ${borderHoverColor} inset;\n }\n\n :host(${focusVisible}) .control {\n border-color: ${borderHoverColor};\n outline: 2px solid ${borderHoverColor};\n outline-offset: 1px;\n }\n\n .label {\n font: inherit;\n color: ${bodyFontColor};\n padding-left: ${mediumPadding};\n grid-column: 2;\n grid-row: 1 / span 2;\n cursor: inherit;\n }\n\n :host([disabled]) .label {\n color: ${bodyDisabledFontColor};\n }\n\n slot[name='checked-indicator'],\n slot[name='indeterminate-indicator'] {\n display: none;\n }\n\n slot[name='checked-indicator'] svg {\n height: ${iconSize};\n width: ${iconSize};\n overflow: visible;\n fill: ${borderColor};\n }\n\n :host(.checked:not(.indeterminate):not([appearance-indeterminate])) slot[name='checked-indicator'] {\n display: contents;\n }\n\n :host([disabled]) slot[name='checked-indicator'] svg {\n fill: rgba(${borderRgbPartialColor}, 0.3);\n }\n\n slot[name='indeterminate-indicator'] svg {\n height: ${iconSize};\n width: ${iconSize};\n overflow: visible;\n }\n\n :host(.indeterminate) slot[name='indeterminate-indicator'],\n :host([appearance-indeterminate]) slot[name='indeterminate-indicator'] {\n display: contents;\n }\n\n slot[name='indeterminate-indicator'] svg {\n fill: ${borderColor};\n }\n\n :host([disabled]) slot[name='indeterminate-indicator'] svg {\n fill: rgba(${borderRgbPartialColor}, 0.3);\n }\n\n .error-icon {\n grid-column: 3;\n grid-row: 1;\n margin: 0px ${smallPadding};\n }\n`;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ni/nimble-components",
3
- "version": "35.8.0",
3
+ "version": "35.9.0",
4
4
  "description": "Styled web components for the NI Nimble Design System",
5
5
  "scripts": {
6
6
  "build": "npm run build:icons && npm run build:workers && npm run build:components && npm run build:scss && npm run build:cem",