@ni/ok-components 1.8.0 → 1.8.2

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.
@@ -1723,6 +1723,83 @@
1723
1723
  }
1724
1724
  ]
1725
1725
  },
1726
+ {
1727
+ "kind": "javascript-module",
1728
+ "path": "src/fv/sticky-header/index.ts",
1729
+ "declarations": [
1730
+ {
1731
+ "kind": "class",
1732
+ "description": "Displays an alternate header in a sticky overlay after the primary header leaves the viewport.",
1733
+ "name": "FvStickyHeader",
1734
+ "members": [
1735
+ {
1736
+ "kind": "field",
1737
+ "name": "headerVisibility",
1738
+ "privacy": "private",
1739
+ "readonly": true,
1740
+ "default": "new Map<Element, boolean>()"
1741
+ },
1742
+ {
1743
+ "kind": "field",
1744
+ "name": "headerIntersectionObserver",
1745
+ "privacy": "private",
1746
+ "readonly": true,
1747
+ "default": "new IntersectionObserver(entries => { this.handleHeaderIntersection(entries); })"
1748
+ },
1749
+ {
1750
+ "kind": "method",
1751
+ "name": "observeHeader",
1752
+ "privacy": "private",
1753
+ "return": {
1754
+ "type": {
1755
+ "text": "void"
1756
+ }
1757
+ }
1758
+ },
1759
+ {
1760
+ "kind": "method",
1761
+ "name": "updateStickyHeaderContent",
1762
+ "privacy": "private",
1763
+ "return": {
1764
+ "type": {
1765
+ "text": "void"
1766
+ }
1767
+ }
1768
+ }
1769
+ ],
1770
+ "superclass": {
1771
+ "name": "FoundationElement",
1772
+ "package": "@ni/fast-foundation"
1773
+ }
1774
+ },
1775
+ {
1776
+ "kind": "variable",
1777
+ "name": "fvStickyHeaderTag",
1778
+ "type": {
1779
+ "text": "string"
1780
+ },
1781
+ "default": "'ok-fv-sticky-header'"
1782
+ }
1783
+ ],
1784
+ "exports": [
1785
+ {
1786
+ "kind": "js",
1787
+ "name": "FvStickyHeader",
1788
+ "declaration": {
1789
+ "name": "FvStickyHeader",
1790
+ "module": "src/fv/sticky-header/index.ts"
1791
+ }
1792
+ },
1793
+ {
1794
+ "kind": "js",
1795
+ "name": "fvStickyHeaderTag",
1796
+ "declaration": {
1797
+ "name": "fvStickyHeaderTag",
1798
+ "module": "src/fv/sticky-header/index.ts"
1799
+ }
1800
+ }
1801
+ ]
1802
+ },
1726
1803
  {
1727
1804
  "kind": "javascript-module",
1728
1805
  "path": "src/fv/summary-panel/index.ts",
@@ -308,6 +308,16 @@
308
308
 
309
309
  <hr/>
310
310
 
311
+ ## class: `FvStickyHeader`
312
+
313
+ ### Superclass
314
+
315
+ | Name | Module | Package |
316
+ | ------------------- | ------ | ------------------- |
317
+ | `FoundationElement` | | @ni/fast-foundation |
318
+
319
+ <hr/>
320
+
311
321
  ## class: `FvSummaryPanel`
312
322
 
313
323
  ### Superclass
@@ -6,6 +6,7 @@ import './master-detail-list-item';
6
6
  import './master-detail-list';
7
7
  import './split-button';
8
8
  import './split-button-anchor';
9
+ import './sticky-header';
9
10
  import './summary-panel';
10
11
  import './summary-panel-tile';
11
12
  import './search-input';
@@ -6,6 +6,7 @@ import './master-detail-list-item';
6
6
  import './master-detail-list';
7
7
  import './split-button';
8
8
  import './split-button-anchor';
9
+ import './sticky-header';
9
10
  import './summary-panel';
10
11
  import './summary-panel-tile';
11
12
  import './search-input';
@@ -1 +1 @@
1
- {"version":3,"file":"all-fv.js","sourceRoot":"","sources":["../../../src/fv/all-fv.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,QAAQ,CAAC;AAChB,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,iBAAiB,CAAC;AACzB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC","sourcesContent":["import './accordion-item';\nimport './card';\nimport './chip-selector';\nimport './context-help';\nimport './master-detail-list-item';\nimport './master-detail-list';\nimport './split-button';\nimport './split-button-anchor';\nimport './summary-panel';\nimport './summary-panel-tile';\nimport './search-input';\n"]}
1
+ {"version":3,"file":"all-fv.js","sourceRoot":"","sources":["../../../src/fv/all-fv.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,QAAQ,CAAC;AAChB,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC","sourcesContent":["import './accordion-item';\nimport './card';\nimport './chip-selector';\nimport './context-help';\nimport './master-detail-list-item';\nimport './master-detail-list';\nimport './split-button';\nimport './split-button-anchor';\nimport './sticky-header';\nimport './summary-panel';\nimport './summary-panel-tile';\nimport './search-input';\n"]}
@@ -0,0 +1,38 @@
1
+ import { FoundationElement } from '@ni/fast-foundation';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'ok-fv-sticky-header': FvStickyHeader;
5
+ }
6
+ }
7
+ /**
8
+ * Displays an alternate header in a sticky overlay after the primary header leaves the viewport.
9
+ */
10
+ export declare class FvStickyHeader extends FoundationElement {
11
+ /** @internal */
12
+ hasHeader: boolean;
13
+ /** @internal */
14
+ hasStickyHeader: boolean;
15
+ /** @internal */
16
+ headerIsVisible: boolean;
17
+ /** @internal */
18
+ showStickyHeader: boolean;
19
+ /** @internal */
20
+ readonly headerSlot: HTMLSlotElement;
21
+ /** @internal */
22
+ readonly stickyHeaderSlot: HTMLSlotElement;
23
+ private readonly headerVisibility;
24
+ private readonly headerIntersectionObserver;
25
+ /** @internal */
26
+ connectedCallback(): void;
27
+ /** @internal */
28
+ disconnectedCallback(): void;
29
+ /** @internal */
30
+ handleHeaderSlotChange(): void;
31
+ /** @internal */
32
+ handleStickyHeaderSlotChange(event: Event): void;
33
+ /** @internal */
34
+ handleHeaderIntersection(entries: IntersectionObserverEntry[]): void;
35
+ private observeHeader;
36
+ private updateStickyHeaderContent;
37
+ }
38
+ export declare const fvStickyHeaderTag = "ok-fv-sticky-header";
@@ -0,0 +1,90 @@
1
+ import { __decorate } from "tslib";
2
+ import { observable } from '@ni/fast-element';
3
+ import { DesignSystem, FoundationElement } from '@ni/fast-foundation';
4
+ import { styles } from './styles';
5
+ import { template } from './template';
6
+ /**
7
+ * Displays an alternate header in a sticky overlay after the primary header leaves the viewport.
8
+ */
9
+ export class FvStickyHeader extends FoundationElement {
10
+ constructor() {
11
+ super(...arguments);
12
+ /** @internal */
13
+ this.hasHeader = false;
14
+ /** @internal */
15
+ this.hasStickyHeader = false;
16
+ /** @internal */
17
+ this.headerIsVisible = true;
18
+ /** @internal */
19
+ this.showStickyHeader = false;
20
+ this.headerVisibility = new Map();
21
+ this.headerIntersectionObserver = new IntersectionObserver(entries => {
22
+ this.handleHeaderIntersection(entries);
23
+ });
24
+ }
25
+ /** @internal */
26
+ connectedCallback() {
27
+ super.connectedCallback();
28
+ this.updateStickyHeaderContent();
29
+ this.observeHeader();
30
+ }
31
+ /** @internal */
32
+ disconnectedCallback() {
33
+ super.disconnectedCallback();
34
+ this.headerIntersectionObserver.disconnect();
35
+ }
36
+ /** @internal */
37
+ handleHeaderSlotChange() {
38
+ this.observeHeader();
39
+ }
40
+ /** @internal */
41
+ handleStickyHeaderSlotChange(event) {
42
+ this.hasStickyHeader = event.target.assignedElements({ flatten: true }).length > 0;
43
+ this.updateStickyHeaderContent();
44
+ }
45
+ /** @internal */
46
+ handleHeaderIntersection(entries) {
47
+ entries.forEach(entry => {
48
+ const hasLeftViewport = !entry.isIntersecting && entry.boundingClientRect.top < 0;
49
+ this.headerVisibility.set(entry.target, !hasLeftViewport);
50
+ });
51
+ this.headerIsVisible = Array.from(this.headerVisibility.values()).some(Boolean);
52
+ this.updateStickyHeaderContent();
53
+ }
54
+ observeHeader() {
55
+ this.headerIntersectionObserver.disconnect();
56
+ const headerElements = this.headerSlot.assignedElements({ flatten: true });
57
+ this.hasHeader = headerElements.length > 0;
58
+ this.headerIsVisible = true;
59
+ this.headerVisibility.clear();
60
+ headerElements.forEach(element => {
61
+ this.headerVisibility.set(element, true);
62
+ this.headerIntersectionObserver.observe(element);
63
+ });
64
+ this.updateStickyHeaderContent();
65
+ }
66
+ updateStickyHeaderContent() {
67
+ this.hasStickyHeader = this.stickyHeaderSlot.assignedElements({ flatten: true }).length > 0;
68
+ this.showStickyHeader = this.hasHeader && this.hasStickyHeader && !this.headerIsVisible;
69
+ }
70
+ }
71
+ __decorate([
72
+ observable
73
+ ], FvStickyHeader.prototype, "hasHeader", void 0);
74
+ __decorate([
75
+ observable
76
+ ], FvStickyHeader.prototype, "hasStickyHeader", void 0);
77
+ __decorate([
78
+ observable
79
+ ], FvStickyHeader.prototype, "headerIsVisible", void 0);
80
+ __decorate([
81
+ observable
82
+ ], FvStickyHeader.prototype, "showStickyHeader", void 0);
83
+ const okFvStickyHeader = FvStickyHeader.compose({
84
+ baseName: 'fv-sticky-header',
85
+ template,
86
+ styles
87
+ });
88
+ DesignSystem.getOrCreate().withPrefix('ok').register(okFvStickyHeader());
89
+ export const fvStickyHeaderTag = 'ok-fv-sticky-header';
90
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/fv/sticky-header/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB;IAArD;;QACI,gB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C,OAAO,CAAC;IAC5C,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC","sourcesContent":["import { observable } from '@ni/fast-element';\nimport { DesignSystem, FoundationElement } from '@ni/fast-foundation';\nimport { styles } from './styles';\nimport { template } from './template';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ok-fv-sticky-header': FvStickyHeader;\n }\n}\n\n/**\n * Displays an alternate header in a sticky overlay after the primary header leaves the viewport.\n */\nexport class FvStickyHeader extends FoundationElement {\n /** @internal */\n @observable\n public hasHeader = false;\n\n /** @internal */\n @observable\n public hasStickyHeader = false;\n\n /** @internal */\n @observable\n public headerIsVisible = true;\n\n /** @internal */\n @observable\n public showStickyHeader = false;\n\n /** @internal */\n public readonly headerSlot!: HTMLSlotElement;\n\n /** @internal */\n public readonly stickyHeaderSlot!: HTMLSlotElement;\n\n private readonly headerVisibility = new Map<Element, boolean>();\n private readonly headerIntersectionObserver = new IntersectionObserver(entries => {\n this.handleHeaderIntersection(entries);\n });\n\n /** @internal */\n public override connectedCallback(): void {\n super.connectedCallback();\n this.updateStickyHeaderContent();\n this.observeHeader();\n }\n\n /** @internal */\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.headerIntersectionObserver.disconnect();\n }\n\n /** @internal */\n public handleHeaderSlotChange(): void {\n this.observeHeader();\n }\n\n /** @internal */\n public handleStickyHeaderSlotChange(event: Event): void {\n this.hasStickyHeader = (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length > 0;\n this.updateStickyHeaderContent();\n }\n\n /** @internal */\n public handleHeaderIntersection(entries: IntersectionObserverEntry[]): void {\n entries.forEach(entry => {\n const hasLeftViewport = !entry.isIntersecting && entry.boundingClientRect.top < 0;\n this.headerVisibility.set(entry.target, !hasLeftViewport);\n });\n this.headerIsVisible = Array.from(this.headerVisibility.values()).some(Boolean);\n this.updateStickyHeaderContent();\n }\n\n private observeHeader(): void {\n this.headerIntersectionObserver.disconnect();\n const headerElements = this.headerSlot.assignedElements({ flatten: true });\n this.hasHeader = headerElements.length > 0;\n this.headerIsVisible = true;\n this.headerVisibility.clear();\n headerElements.forEach(element => {\n this.headerVisibility.set(element, true);\n this.headerIntersectionObserver.observe(element);\n });\n this.updateStickyHeaderContent();\n }\n\n private updateStickyHeaderContent(): void {\n this.hasStickyHeader = this.stickyHeaderSlot.assignedElements({ flatten: true }).length > 0;\n this.showStickyHeader = this.hasHeader && this.hasStickyHeader && !this.headerIsVisible;\n }\n}\n\nconst okFvStickyHeader = FvStickyHeader.compose({\n baseName: 'fv-sticky-header',\n template,\n styles\n});\n\nDesignSystem.getOrCreate().withPrefix('ok').register(okFvStickyHeader());\nexport const fvStickyHeaderTag = 'ok-fv-sticky-header';\n"]}
@@ -0,0 +1 @@
1
+ export declare const styles: import("@ni/fast-element").ElementStyles;
@@ -0,0 +1,22 @@
1
+ import { css } from '@ni/fast-element';
2
+ import { elevation2BoxShadow, headerBackgroundColor } from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';
3
+ import { display } from '../../utilities/style/display';
4
+ export const styles = css `
5
+ ${display('block')}
6
+
7
+ .sticky-header {
8
+ position: fixed;
9
+ inset-block-start: 0;
10
+ inset-inline: 0;
11
+ z-index: 1;
12
+ box-sizing: border-box;
13
+ width: 100%;
14
+ background-color: var(${headerBackgroundColor.cssCustomProperty});
15
+ box-shadow: var(${elevation2BoxShadow.cssCustomProperty});
16
+ }
17
+
18
+ .sticky-header[hidden] {
19
+ display: none;
20
+ }
21
+ `;
22
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/fv/sticky-header/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AACzH,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,OAAO,CAAC;;;;;;;;;gCASU,qBAAqB,CAAC,iBAAiB;0BAC7C,mBAAmB,CAAC,iBAAiB;;;;;;CAM9D,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport { elevation2BoxShadow, headerBackgroundColor } from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n ${display('block')}\n\n .sticky-header {\n position: fixed;\n inset-block-start: 0;\n inset-inline: 0;\n z-index: 1;\n box-sizing: border-box;\n width: 100%;\n background-color: var(${headerBackgroundColor.cssCustomProperty});\n box-shadow: var(${elevation2BoxShadow.cssCustomProperty});\n }\n\n .sticky-header[hidden] {\n display: none;\n }\n`;\n"]}
@@ -0,0 +1,2 @@
1
+ import type { FvStickyHeader } from '.';
2
+ export declare const template: import("@ni/fast-element").ViewTemplate<FvStickyHeader, any>;
@@ -0,0 +1,22 @@
1
+ import { html, ref } from '@ni/fast-element';
2
+ export const template = html `
3
+ <div class="header" part="header">
4
+ <slot
5
+ name="header"
6
+ ${ref('headerSlot')}
7
+ @slotchange="${x => x.handleHeaderSlotChange()}"
8
+ ></slot>
9
+ </div>
10
+ <div
11
+ class="sticky-header"
12
+ part="sticky-header"
13
+ ?hidden="${x => !x.showStickyHeader}"
14
+ >
15
+ <slot
16
+ name="sticky-header"
17
+ ${ref('stickyHeaderSlot')}
18
+ @slotchange="${(x, c) => x.handleStickyHeaderSlotChange(c.event)}"
19
+ ></slot>
20
+ </div>
21
+ `;
22
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/fv/sticky-header/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAG7C,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAgB;;;;cAI9B,GAAG,CAAC,YAAY,CAAC;2BACJ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,sBAAsB,EAAE;;;;;;mBAMvC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB;;;;cAI7B,GAAG,CAAC,kBAAkB,CAAC;2BACV,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,KAAK,CAAC;;;CAG3E,CAAC","sourcesContent":["import { html, ref } from '@ni/fast-element';\nimport type { FvStickyHeader } from '.';\n\nexport const template = html<FvStickyHeader>`\n <div class=\"header\" part=\"header\">\n <slot\n name=\"header\"\n ${ref('headerSlot')}\n @slotchange=\"${x => x.handleHeaderSlotChange()}\"\n ></slot>\n </div>\n <div\n class=\"sticky-header\"\n part=\"sticky-header\"\n ?hidden=\"${x => !x.showStickyHeader}\"\n >\n <slot\n name=\"sticky-header\"\n ${ref('stickyHeaderSlot')}\n @slotchange=\"${(x, c) => x.handleStickyHeaderSlotChange(c.event)}\"\n ></slot>\n </div>\n`;\n"]}
@@ -1,5 +1,5 @@
1
1
  import { css } from '@ni/fast-element';
2
- import { mediumPadding, smallPadding, standardPadding } from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';
2
+ import { borderWidth, smallPadding, standardPadding } from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';
3
3
  import { display } from '../../utilities/style/display';
4
4
  export const styles = css `
5
5
  @layer base, hover, focusVisible, active, disabled, top;
@@ -31,8 +31,7 @@ export const styles = css `
31
31
  box-sizing: border-box;
32
32
  overflow-x: auto;
33
33
  overflow-y: hidden;
34
- gap: ${mediumPadding};
35
- padding: calc(${standardPadding} - ${smallPadding});
34
+ gap: ${smallPadding};
36
35
  scrollbar-width: none;
37
36
  }
38
37
 
@@ -53,6 +52,10 @@ export const styles = css `
53
52
  ::slotted(*) {
54
53
  flex: 0 0 auto;
55
54
  }
55
+
56
+ :host([size='compact']) ::slotted(ok-fv-summary-panel-tile) {
57
+ margin: calc(2 * ${borderWidth});
58
+ }
56
59
  }
57
60
 
58
61
  @layer hover {}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/fv/summary-panel/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,aAAa,EACb,YAAY,EACZ,eAAe,EAClB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;UAIf,OAAO,CAAC,OAAO,CAAC;;;;;;0BAMA,eAAe;;;;;;;mBAOtB,eAAe;;;;;;;;;;;;;mBAaf,aAAa;4BACJ,eAAe,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC5D,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n mediumPadding,\n smallPadding,\n standardPadding\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled, top;\n\n @layer base {\n ${display('block')}\n\n .summary-panel {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: flex-start;\n column-gap: ${standardPadding};\n }\n\n .summary-item-container {\n display: flex;\n flex-wrap: wrap;\n align-items: stretch;\n gap: ${standardPadding};\n min-width: 0;\n }\n\n .summary-item-container:empty {\n display: none;\n }\n\n :host([size='compact']) .summary-item-container {\n flex-wrap: nowrap;\n box-sizing: border-box;\n overflow-x: auto;\n overflow-y: hidden;\n gap: ${mediumPadding};\n padding: calc(${standardPadding} - ${smallPadding});\n scrollbar-width: none;\n }\n\n :host([size='compact']) .summary-item-container.has-overflow {\n -webkit-mask-image: linear-gradient(to right, black calc(100% - 48px), transparent);\n mask-image: linear-gradient(to right, black calc(100% - 48px), transparent);\n }\n\n :host([size='compact']) .summary-item-container::-webkit-scrollbar {\n display: none;\n }\n\n .edit-items-button {\n align-self: start;\n justify-self: end;\n }\n\n ::slotted(*) {\n flex: 0 0 auto;\n }\n }\n\n @layer hover {}\n\n @layer focusVisible {}\n\n @layer active {}\n\n @layer disabled {}\n\n @layer top {}\n`;"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/fv/summary-panel/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,WAAW,EACX,YAAY,EACZ,eAAe,EAClB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;UAIf,OAAO,CAAC,OAAO,CAAC;;;;;;0BAMA,eAAe;;;;;;;mBAOtB,eAAe;;;;;;;;;;;;;mBAaf,YAAY;;;;;;;;;;;;;;;;;;;;;;;+BAuBA,WAAW;;;;;;;;;;;;;CAazC,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n borderWidth,\n smallPadding,\n standardPadding\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled, top;\n\n @layer base {\n ${display('block')}\n\n .summary-panel {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: flex-start;\n column-gap: ${standardPadding};\n }\n\n .summary-item-container {\n display: flex;\n flex-wrap: wrap;\n align-items: stretch;\n gap: ${standardPadding};\n min-width: 0;\n }\n\n .summary-item-container:empty {\n display: none;\n }\n\n :host([size='compact']) .summary-item-container {\n flex-wrap: nowrap;\n box-sizing: border-box;\n overflow-x: auto;\n overflow-y: hidden;\n gap: ${smallPadding};\n scrollbar-width: none;\n }\n\n :host([size='compact']) .summary-item-container.has-overflow {\n -webkit-mask-image: linear-gradient(to right, black calc(100% - 48px), transparent);\n mask-image: linear-gradient(to right, black calc(100% - 48px), transparent);\n }\n\n :host([size='compact']) .summary-item-container::-webkit-scrollbar {\n display: none;\n }\n\n .edit-items-button {\n align-self: start;\n justify-self: end;\n }\n\n ::slotted(*) {\n flex: 0 0 auto;\n }\n\n :host([size='compact']) ::slotted(ok-fv-summary-panel-tile) {\n margin: calc(2 * ${borderWidth});\n }\n }\n\n @layer hover {}\n\n @layer focusVisible {}\n\n @layer active {}\n\n @layer disabled {}\n\n @layer top {}\n`;"]}
@@ -53,6 +53,7 @@ export const styles = css `
53
53
  flex-direction: column;
54
54
  align-items: center;
55
55
  gap: ${smallPadding};
56
+ margin-top: calc(${largePadding} - ${smallPadding});
56
57
  text-align: center;
57
58
  }
58
59
 
@@ -83,6 +84,10 @@ export const styles = css `
83
84
  margin: 10px 14px;
84
85
  }
85
86
 
87
+ :host([size='compact']) .summary-panel-tile-content.under {
88
+ margin-top: ${mediumPadding};
89
+ }
90
+
86
91
  :host([size='compact']) .count {
87
92
  font-size: 24px;
88
93
  line-height: normal;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/fv/summary-panel-tile/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,mBAAmB,EACtB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;UAIf,OAAO,CAAC,cAAc,CAAC;;;;;;;;;;;qCAWI,UAAU;;;4DAGa,gBAAgB;;;;;;;;;;;uCAWrC,UAAU;;;;gCAIjB,eAAe;;;+BAGhB,UAAU;+BACV,UAAU;;;;;;mBAMtB,aAAa;sBACV,YAAY,SAAS,YAAY,MAAM,eAAe;oBACxD,QAAQ;;;;;;mBAMT,YAAY;;;;;qBAKV,mBAAmB;;;;;;;;6BAQX,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAkCN,gBAAgB;;;;;;;;;;;;;;;;8BAgBtB,mBAAmB,CAAC,iBAAiB;;;;;sBAK7C,mBAAmB,CAAC,iBAAiB;4BAC/B,gBAAgB;;;;8BAId,mBAAmB,CAAC,iBAAiB;;;;4BAIvC,gBAAgB;;;;;;;;gCAQZ,gBAAgB;;;;;;;;;;;;;;;CAe/C,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n bodyFont,\n borderHoverColor,\n cardBorderColor,\n elevation2BoxShadow,\n largePadding,\n mediumPadding,\n smallPadding,\n smallDelay,\n standardPadding,\n titlePlus2FontColor\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled, top;\n\n @layer base {\n ${display('inline-block')}\n\n :host {\n min-width: max-content;\n }\n\n :host(:not([legacy-style])) .summary-panel-tile {\n position: relative;\n border-radius: 8px;\n overflow: clip;\n box-shadow: none;\n transition: box-shadow ${smallDelay} ease-in-out;\n --ni-private-card-button-background-hover-color: transparent;\n --ni-private-card-button-background-active-color: transparent;\n --ni-private-card-button-border-active-color: ${borderHoverColor};\n }\n\n :host(:not([legacy-style])) .summary-panel-tile::after {\n content: '';\n position: absolute;\n inset: 0;\n box-sizing: border-box;\n border: 2px solid transparent;\n border-radius: inherit;\n pointer-events: none;\n transition: border-color ${smallDelay} ease-in-out;\n }\n\n :host(:not([legacy-style])) .summary-panel-tile::part(control) {\n border: 2px solid ${cardBorderColor};\n border-radius: 8px;\n transition:\n border-color ${smallDelay} ease-in-out,\n border-width ${smallDelay} ease-in-out;\n }\n\n .summary-panel-tile-content {\n display: flex;\n align-items: center;\n gap: ${mediumPadding};\n margin: ${largePadding} calc(${largePadding} + ${standardPadding});\n font: ${bodyFont};\n }\n\n .summary-panel-tile-content.under {\n flex-direction: column;\n align-items: center;\n gap: ${smallPadding};\n text-align: center;\n }\n\n .count {\n color: ${titlePlus2FontColor};\n font-size: 32px;\n font-weight: 400;\n line-height: 40px;\n white-space: nowrap;\n }\n\n .summary-panel-tile-content.beside .count {\n padding-right: ${mediumPadding};\n }\n\n .summary-panel-tile-content.under .count {\n padding-right: 0;\n }\n\n .label {\n font-weight: 600;\n text-transform: uppercase;\n white-space: nowrap;\n }\n\n :host([size='compact']) .summary-panel-tile-content {\n gap: 6px;\n margin: 10px 14px;\n }\n\n :host([size='compact']) .count {\n font-size: 24px;\n line-height: normal;\n }\n\n :host([size='compact']) .summary-panel-tile-content.beside .count {\n padding-right: 0;\n }\n\n :host([size='compact']) .label {\n font-size: 11px;\n }\n }\n\n @layer hover {\n :host(:not([legacy-style])) .summary-panel-tile:hover {\n box-shadow: 0 0 0 2px ${borderHoverColor};\n }\n\n :host(:not([legacy-style])) .summary-panel-tile::part(control):hover {\n border-color: transparent;\n }\n }\n\n @layer focusVisible {}\n\n @layer active {\n :host(:not([legacy-style])) .summary-panel-tile:active {\n box-shadow: none;\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected] {\n box-shadow: var(${elevation2BoxShadow.cssCustomProperty});\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected]:hover {\n box-shadow:\n var(${elevation2BoxShadow.cssCustomProperty}),\n 0 0 0 2px ${borderHoverColor};\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected]:active {\n box-shadow: var(${elevation2BoxShadow.cssCustomProperty});\n }\n\n :host(:not([legacy-style])) .summary-panel-tile:active::after {\n border-color: ${borderHoverColor};\n }\n\n :host(:not([legacy-style])) .summary-panel-tile::part(control):active {\n border: 2px solid transparent;\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected]::part(control) {\n border: 2px solid ${borderHoverColor};\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected]::part(control):hover {\n border: 2px solid transparent;\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected]::part(control):active {\n border: 2px solid transparent;\n }\n }\n\n @layer disabled {}\n\n @layer top {}\n`;"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/fv/summary-panel-tile/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,mBAAmB,EACtB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;UAIf,OAAO,CAAC,cAAc,CAAC;;;;;;;;;;;qCAWI,UAAU;;;4DAGa,gBAAgB;;;;;;;;;;;uCAWrC,UAAU;;;;gCAIjB,eAAe;;;+BAGhB,UAAU;+BACV,UAAU;;;;;;mBAMtB,aAAa;sBACV,YAAY,SAAS,YAAY,MAAM,eAAe;oBACxD,QAAQ;;;;;;mBAMT,YAAY;+BACA,YAAY,MAAM,YAAY;;;;;qBAKxC,mBAAmB;;;;;;;;6BAQX,aAAa;;;;;;;;;;;;;;;;;;;0BAmBhB,aAAa;;;;;;;;;;;;;;;;;;;oCAmBH,gBAAgB;;;;;;;;;;;;;;;;8BAgBtB,mBAAmB,CAAC,iBAAiB;;;;;sBAK7C,mBAAmB,CAAC,iBAAiB;4BAC/B,gBAAgB;;;;8BAId,mBAAmB,CAAC,iBAAiB;;;;4BAIvC,gBAAgB;;;;;;;;gCAQZ,gBAAgB;;;;;;;;;;;;;;;CAe/C,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n bodyFont,\n borderHoverColor,\n cardBorderColor,\n elevation2BoxShadow,\n largePadding,\n mediumPadding,\n smallPadding,\n smallDelay,\n standardPadding,\n titlePlus2FontColor\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled, top;\n\n @layer base {\n ${display('inline-block')}\n\n :host {\n min-width: max-content;\n }\n\n :host(:not([legacy-style])) .summary-panel-tile {\n position: relative;\n border-radius: 8px;\n overflow: clip;\n box-shadow: none;\n transition: box-shadow ${smallDelay} ease-in-out;\n --ni-private-card-button-background-hover-color: transparent;\n --ni-private-card-button-background-active-color: transparent;\n --ni-private-card-button-border-active-color: ${borderHoverColor};\n }\n\n :host(:not([legacy-style])) .summary-panel-tile::after {\n content: '';\n position: absolute;\n inset: 0;\n box-sizing: border-box;\n border: 2px solid transparent;\n border-radius: inherit;\n pointer-events: none;\n transition: border-color ${smallDelay} ease-in-out;\n }\n\n :host(:not([legacy-style])) .summary-panel-tile::part(control) {\n border: 2px solid ${cardBorderColor};\n border-radius: 8px;\n transition:\n border-color ${smallDelay} ease-in-out,\n border-width ${smallDelay} ease-in-out;\n }\n\n .summary-panel-tile-content {\n display: flex;\n align-items: center;\n gap: ${mediumPadding};\n margin: ${largePadding} calc(${largePadding} + ${standardPadding});\n font: ${bodyFont};\n }\n\n .summary-panel-tile-content.under {\n flex-direction: column;\n align-items: center;\n gap: ${smallPadding};\n margin-top: calc(${largePadding} - ${smallPadding});\n text-align: center;\n }\n\n .count {\n color: ${titlePlus2FontColor};\n font-size: 32px;\n font-weight: 400;\n line-height: 40px;\n white-space: nowrap;\n }\n\n .summary-panel-tile-content.beside .count {\n padding-right: ${mediumPadding};\n }\n\n .summary-panel-tile-content.under .count {\n padding-right: 0;\n }\n\n .label {\n font-weight: 600;\n text-transform: uppercase;\n white-space: nowrap;\n }\n\n :host([size='compact']) .summary-panel-tile-content {\n gap: 6px;\n margin: 10px 14px;\n }\n\n :host([size='compact']) .summary-panel-tile-content.under {\n margin-top: ${mediumPadding};\n }\n\n :host([size='compact']) .count {\n font-size: 24px;\n line-height: normal;\n }\n\n :host([size='compact']) .summary-panel-tile-content.beside .count {\n padding-right: 0;\n }\n\n :host([size='compact']) .label {\n font-size: 11px;\n }\n }\n\n @layer hover {\n :host(:not([legacy-style])) .summary-panel-tile:hover {\n box-shadow: 0 0 0 2px ${borderHoverColor};\n }\n\n :host(:not([legacy-style])) .summary-panel-tile::part(control):hover {\n border-color: transparent;\n }\n }\n\n @layer focusVisible {}\n\n @layer active {\n :host(:not([legacy-style])) .summary-panel-tile:active {\n box-shadow: none;\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected] {\n box-shadow: var(${elevation2BoxShadow.cssCustomProperty});\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected]:hover {\n box-shadow:\n var(${elevation2BoxShadow.cssCustomProperty}),\n 0 0 0 2px ${borderHoverColor};\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected]:active {\n box-shadow: var(${elevation2BoxShadow.cssCustomProperty});\n }\n\n :host(:not([legacy-style])) .summary-panel-tile:active::after {\n border-color: ${borderHoverColor};\n }\n\n :host(:not([legacy-style])) .summary-panel-tile::part(control):active {\n border: 2px solid transparent;\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected]::part(control) {\n border: 2px solid ${borderHoverColor};\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected]::part(control):hover {\n border: 2px solid transparent;\n }\n\n :host(:not([legacy-style])) .summary-panel-tile[selected]::part(control):active {\n border: 2px solid transparent;\n }\n }\n\n @layer disabled {}\n\n @layer top {}\n`;"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ni/ok-components",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "description": "NI Ok Components",
5
5
  "scripts": {
6
6
  "build": "npm run build:components && npm run build:cem",