@ni/nimble-components 16.0.0 → 16.1.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.
@@ -23,6 +23,7 @@ import './number-field';
23
23
  import './radio';
24
24
  import './radio-group';
25
25
  import './select';
26
+ import './spinner';
26
27
  import './switch';
27
28
  import './tab';
28
29
  import './tab-panel';
@@ -23,6 +23,7 @@ import './number-field';
23
23
  import './radio';
24
24
  import './radio-group';
25
25
  import './select';
26
+ import './spinner';
26
27
  import './switch';
27
28
  import './tab';
28
29
  import './tab-panel';
@@ -1 +1 @@
1
- {"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,UAAU,CAAC;AAClB,OAAO,iBAAiB,CAAC;AACzB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,eAAe,CAAC;AACvB,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,UAAU,CAAC;AAClB,OAAO,UAAU,CAAC;AAClB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,SAAS,CAAC;AACjB,OAAO,eAAe,CAAC;AACvB,OAAO,UAAU,CAAC;AAClB,OAAO,UAAU,CAAC;AAClB,OAAO,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,SAAS,CAAC;AACjB,OAAO,QAAQ,CAAC;AAChB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC"}
1
+ {"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,UAAU,CAAC;AAClB,OAAO,iBAAiB,CAAC;AACzB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,eAAe,CAAC;AACvB,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,UAAU,CAAC;AAClB,OAAO,UAAU,CAAC;AAClB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,SAAS,CAAC;AACjB,OAAO,eAAe,CAAC;AACvB,OAAO,UAAU,CAAC;AAClB,OAAO,WAAW,CAAC;AACnB,OAAO,UAAU,CAAC;AAClB,OAAO,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,SAAS,CAAC;AACjB,OAAO,QAAQ,CAAC;AAChB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { FoundationElement } from '@microsoft/fast-foundation';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'nimble-spinner': Spinner;
5
+ }
6
+ }
7
+ /**
8
+ * A Nimble-styled spinner component.
9
+ * A spinner is an animating indicator that can be placed in a particular region of a page to represent loading progress, or an ongoing operation, of an indeterminate / unknown duration.
10
+ */
11
+ export declare class Spinner extends FoundationElement {
12
+ }
@@ -0,0 +1,16 @@
1
+ import { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';
2
+ import { styles } from './styles';
3
+ import { template } from './template';
4
+ /**
5
+ * A Nimble-styled spinner component.
6
+ * A spinner is an animating indicator that can be placed in a particular region of a page to represent loading progress, or an ongoing operation, of an indeterminate / unknown duration.
7
+ */
8
+ export class Spinner extends FoundationElement {
9
+ }
10
+ const nimbleSpinner = Spinner.compose({
11
+ baseName: 'spinner',
12
+ template,
13
+ styles
14
+ });
15
+ DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSpinner());
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/spinner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;;GAGG;AACH,MAAM,OAAO,OAAQ,SAAQ,iBAAiB;CAAG;AAEjD,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IAClC,QAAQ,EAAE,SAAS;IACnB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const styles: import("@microsoft/fast-element").ElementStyles;
@@ -0,0 +1,149 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ import { display } from '@microsoft/fast-foundation';
3
+ import { Black15, Black91, White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';
4
+ import { Theme } from '../theme-provider/types';
5
+ import { themeBehavior } from '../utilities/style/theme';
6
+ export const styles = css `
7
+ ${display('inline-flex')}
8
+
9
+ :host {
10
+ width: 16px;
11
+ height: 16px;
12
+ }
13
+
14
+ div.container {
15
+ margin: max(2px, 6.25%);
16
+ flex: 1;
17
+ ${
18
+ /**
19
+ * At some spinner sizes / browser zoom levels, the spinner bits/squares appear to slightly overlap visually.
20
+ * If we set a color with transparency on each bit, it'll look wrong in the overlapping region (since the opacity
21
+ * combines and affects the color at the overlapping spot).
22
+ * Currently all 3 themes use a color with opacity = 0.6, so that's applied here on the parent element instead,
23
+ * which avoids that issue.
24
+ */
25
+ ''}
26
+ opacity: 0.6;
27
+ }
28
+
29
+ div.bit1,
30
+ div.bit2 {
31
+ background: var(--ni-private-spinner-bits-background-color);
32
+ width: 50%;
33
+ height: 50%;
34
+ margin: auto;
35
+ animation-duration: 1600ms;
36
+ animation-iteration-count: infinite;
37
+ animation-timing-function: cubic-bezier(0.65, 0, 0.35, 0);
38
+ }
39
+
40
+ div.bit1 {
41
+ animation-name: ni-private-spinner-keyframes-1;
42
+ }
43
+
44
+ div.bit2 {
45
+ animation-name: ni-private-spinner-keyframes-2;
46
+ }
47
+
48
+ @media (prefers-reduced-motion) {
49
+ div.bit1,
50
+ div.bit2 {
51
+ animation-timing-function: ease-in-out, steps(1);
52
+ animation-duration: 3200ms;
53
+ }
54
+
55
+ div.bit1 {
56
+ animation-name: ni-private-spinner-no-motion-opacity-keyframes,
57
+ ni-private-spinner-no-motion-transform-keyframes-1;
58
+ }
59
+
60
+ div.bit2 {
61
+ animation-name: ni-private-spinner-no-motion-opacity-keyframes,
62
+ ni-private-spinner-no-motion-transform-keyframes-2;
63
+ }
64
+ }
65
+
66
+ @keyframes ni-private-spinner-keyframes-1 {
67
+ 0%,
68
+ 100% {
69
+ transform: translate(-50%, 0);
70
+ }
71
+
72
+ 25% {
73
+ transform: translate(50%, 0);
74
+ }
75
+
76
+ 50% {
77
+ transform: translate(50%, 100%);
78
+ }
79
+
80
+ 75% {
81
+ transform: translate(-50%, 100%);
82
+ }
83
+ }
84
+
85
+ @keyframes ni-private-spinner-keyframes-2 {
86
+ 0%,
87
+ 100% {
88
+ transform: translate(50%, 0);
89
+ }
90
+
91
+ 25% {
92
+ transform: translate(-50%, 0);
93
+ }
94
+
95
+ 50% {
96
+ transform: translate(-50%, -100%);
97
+ }
98
+
99
+ 75% {
100
+ transform: translate(50%, -100%);
101
+ }
102
+ }
103
+
104
+ @keyframes ni-private-spinner-no-motion-opacity-keyframes {
105
+ 0%,
106
+ 50%,
107
+ 100% {
108
+ opacity: 0;
109
+ }
110
+
111
+ 25%,
112
+ 75% {
113
+ opacity: 1;
114
+ }
115
+ }
116
+
117
+ @keyframes ni-private-spinner-no-motion-transform-keyframes-1 {
118
+ 0%,
119
+ 100% {
120
+ transform: translate(-50%, 0);
121
+ }
122
+ 50% {
123
+ transform: translate(50%, 0);
124
+ }
125
+ }
126
+
127
+ @keyframes ni-private-spinner-no-motion-transform-keyframes-2 {
128
+ 0%,
129
+ 100% {
130
+ transform: translate(50%, 0);
131
+ }
132
+
133
+ 50% {
134
+ transform: translate(-50%, 0);
135
+ }
136
+ }
137
+ `.withBehaviors(themeBehavior(Theme.light, css `
138
+ :host {
139
+ --ni-private-spinner-bits-background-color: ${Black91}
140
+ `), themeBehavior(Theme.dark, css `
141
+ :host {
142
+ --ni-private-spinner-bits-background-color: ${Black15};
143
+ }
144
+ `), themeBehavior(Theme.color, css `
145
+ :host {
146
+ --ni-private-spinner-bits-background-color: ${White};
147
+ }
148
+ `));
149
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/spinner/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,OAAO,EACP,OAAO,EACP,KAAK,EACR,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;;;;;;;;;;UAUlB;AACE;;;;;;GAMG;AACH,EACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgHP,CAAC,aAAa,CACX,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;8DAEmD,OAAO;SAC5D,CACJ,EACD,aAAa,CACT,KAAK,CAAC,IAAI,EACV,GAAG,CAAA;;8DAEmD,OAAO;;SAE5D,CACJ,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;8DAEmD,KAAK;;SAE1D,CACJ,CACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Spinner } from '.';
2
+ export declare const template: import("@microsoft/fast-element").ViewTemplate<Spinner, any>;
@@ -0,0 +1,10 @@
1
+ import { html } from '@microsoft/fast-element';
2
+ export const template = html `
3
+ <template role="progressbar">
4
+ <div class="container">
5
+ <div class="bit1"></div>
6
+ <div class="bit2"></div>
7
+ </div>
8
+ </template>
9
+ `;
10
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/spinner/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAS;;;;;;;CAOpC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ni/nimble-components",
3
- "version": "16.0.0",
3
+ "version": "16.1.0",
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",
@@ -63,7 +63,7 @@
63
63
  "@babel/cli": "^7.13.16",
64
64
  "@babel/core": "^7.14.6",
65
65
  "@babel/preset-env": "^7.13.15",
66
- "@mdx-js/react": "*",
66
+ "@mdx-js/react": "^1.6.22",
67
67
  "@ni/eslint-config-javascript": "^4.0.0",
68
68
  "@ni/eslint-config-typescript": "^4.1.0",
69
69
  "@rollup/plugin-commonjs": "^21.0.2",