@ni/nimble-components 8.6.2 → 8.6.3

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.
@@ -8,4 +8,5 @@ declare global {
8
8
  * A nimble-styled tabs control
9
9
  */
10
10
  export declare class Tabs extends FoundationTabs {
11
+ constructor();
11
12
  }
@@ -1,22 +1,22 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  import { display } from '@microsoft/fast-foundation';
3
- import { bodyFont, borderHoverColor, borderWidth, bodyFontColor, bodyDisabledFontColor, controlHeight, fillHoverColor, mediumDelay, standardPadding } from '../theme-provider/design-tokens';
3
+ import { bodyFont, borderHoverColor, borderWidth, bodyFontColor, bodyDisabledFontColor, controlHeight, fillHoverColor, fillHoverSelectedColor, standardPadding, smallDelay } from '../theme-provider/design-tokens';
4
4
  import { focusVisible } from '../utilities/style/focus';
5
5
  export const styles = css `
6
6
  ${display('inline-flex')}
7
7
 
8
8
  :host {
9
+ position: relative;
9
10
  box-sizing: border-box;
10
11
  font: ${bodyFont};
11
12
  height: ${controlHeight};
12
- padding: calc(${standardPadding} / 2) ${standardPadding}
13
- calc(${standardPadding} / 2 - ${borderWidth});
14
13
  color: ${bodyFontColor};
15
14
  align-items: center;
16
15
  justify-content: center;
17
16
  cursor: pointer;
18
- ${ /* Separate focus indicator from active indicator */''}
19
- border-bottom: transparent ${borderWidth} solid;
17
+ --ni-private-active-indicator-width: 2px;
18
+ --ni-private-focus-indicator-width: 1px;
19
+ --ni-private-indicator-lines-gap: 1px;
20
20
  }
21
21
 
22
22
  :host(:hover) {
@@ -27,16 +27,12 @@ export const styles = css `
27
27
  outline: none;
28
28
  }
29
29
 
30
- :host(${focusVisible}) {
31
- outline: none;
32
- box-shadow: 0 calc(${borderWidth} * -1) ${borderHoverColor} inset;
33
- transition: box-shadow ${mediumDelay} ease-in-out;
30
+ :host(:focus:hover) {
31
+ background-color: ${fillHoverSelectedColor};
34
32
  }
35
33
 
36
- @media (prefers-reduced-motion) {
37
- :host(${focusVisible}) {
38
- transition-duration: 0.01s;
39
- }
34
+ :host(${focusVisible}) {
35
+ outline: none;
40
36
  }
41
37
 
42
38
  :host(:active) {
@@ -48,5 +44,56 @@ export const styles = css `
48
44
  color: ${bodyDisabledFontColor};
49
45
  background: none;
50
46
  }
47
+
48
+ slot {
49
+ display: block;
50
+ padding: calc(${standardPadding} / 2) ${standardPadding}
51
+ calc(${standardPadding} / 2 - ${borderWidth});
52
+ }
53
+
54
+ :host::before {
55
+ content: '';
56
+ position: absolute;
57
+ bottom: calc(
58
+ var(--ni-private-active-indicator-width) +
59
+ var(--ni-private-indicator-lines-gap)
60
+ );
61
+ width: 0px;
62
+ height: 0px;
63
+ border-bottom: ${borderHoverColor}
64
+ var(--ni-private-focus-indicator-width) solid;
65
+ transition: width ${smallDelay} ease-in;
66
+ }
67
+
68
+ @media (prefers-reduced-motion) {
69
+ :host::before {
70
+ transition-duration: 0.01s;
71
+ }
72
+ }
73
+
74
+ :host(${focusVisible})::before {
75
+ width: 100%;
76
+ }
77
+
78
+ :host::after {
79
+ content: '';
80
+ position: absolute;
81
+ bottom: 0px;
82
+ width: 0px;
83
+ height: 0px;
84
+ border-bottom: ${borderHoverColor}
85
+ var(--ni-private-active-indicator-width) solid;
86
+ transition: width ${smallDelay} ease-in;
87
+ }
88
+
89
+ @media (prefers-reduced-motion) {
90
+ :host::after {
91
+ transition-duration: 0.01s;
92
+ }
93
+ }
94
+
95
+ :host([aria-selected='true'])::after {
96
+ width: 100%;
97
+ }
51
98
  `;
52
99
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/tab/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,aAAa,E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,gBAAgB;;4BAEb,UAAU;;;;;;;;;;;;CAYrC,CAAC"}
@@ -8,4 +8,5 @@ declare global {
8
8
  * A nimble-styled tabs control
9
9
  */
10
10
  export declare class Tabs extends FoundationTabs {
11
+ constructor();
11
12
  }
@@ -4,6 +4,11 @@ import { styles } from './styles';
4
4
  * A nimble-styled tabs control
5
5
  */
6
6
  export class Tabs extends FoundationTabs {
7
+ constructor() {
8
+ super();
9
+ // We disable the built-in active indicator so that we can implement our own
10
+ this.activeindicator = false;
11
+ }
7
12
  }
8
13
  const nimbleTabs = Tabs.compose({
9
14
  baseName: 'tabs',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,IAAI,IAAI,cAAc,EAEtB,YAAY,IAAI,QAAQ,EAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQlC;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,cAAc;CAAG;AAE3C,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAc;IACzC,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,cAAc;IACzB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,IAAI,IAAI,cAAc,EAEtB,YAAY,IAAI,QAAQ,EAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQlC;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,cAAc;IACpC;QACI,KAAK,EAAE,CAAC;QACR,4EAA4E;QAC5E,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;IACjC,CAAC;CACJ;AAED,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAc;IACzC,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,cAAc;IACzB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
  import { display } from '@microsoft/fast-foundation';
3
- import { borderHoverColor, borderWidth, smallDelay } from '../theme-provider/design-tokens';
4
3
  export const styles = css `
5
4
  ${display('grid')}
6
5
 
@@ -18,22 +17,6 @@ export const styles = css `
18
17
  align-self: end;
19
18
  }
20
19
 
21
- .activeIndicator {
22
- grid-row: 2;
23
- height: calc(${borderWidth} * 2);
24
- background-color: ${borderHoverColor};
25
- }
26
-
27
- .activeIndicatorTransition {
28
- transition: transform ${smallDelay} ease-in-out;
29
- }
30
-
31
- @media (prefers-reduced-motion) {
32
- .activeIndicatorTransition {
33
- transition: transform 0.01s;
34
- }
35
- }
36
-
37
20
  .tabpanel {
38
21
  grid-row: 2;
39
22
  grid-column-start: 1;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/tabs/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,gBAAgB,EAChB,WAAW,EACX,UAAU,EACb,MAAM,iCAAiC,CAAC;AAEzC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;uBAkBE,WAAW;4BACN,gBAAgB;;;;gCAIZ,UAAU;;;;;;;;;;;;;;CAczC,CAAC"}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/tabs/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;CAqBpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ni/nimble-components",
3
- "version": "8.6.2",
3
+ "version": "8.6.3",
4
4
  "description": "Styled web components for the NI Nimble Design System",
5
5
  "scripts": {
6
6
  "build": "npm run generate-icons && npm run build-components && npm run bundle-components && npm run generate-scss && npm run build-storybook",