@aquera/nile-elements 2.0.5 → 2.0.6

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 (199) hide show
  1. package/README.md +4 -0
  2. package/demo/nxtgen-classes.css +15 -12
  3. package/demo/nxtgen-dark.css +24 -24
  4. package/demo/nxtgen-properties.css +27 -24
  5. package/demo/nxtgen-utilities.css +39 -36
  6. package/demo/nxtgen.css +15 -12
  7. package/demo/utilities.css +3 -0
  8. package/demo/variables.css +3 -0
  9. package/dist/index.cjs.js +1 -1
  10. package/dist/index.esm.js +1 -1
  11. package/dist/index.js +1353 -340
  12. package/dist/internal/glyph.cjs.js +1 -1
  13. package/dist/internal/glyph.cjs.js.map +1 -1
  14. package/dist/internal/glyph.esm.js +6 -5
  15. package/dist/nile-app-shell/index.cjs.js +2 -0
  16. package/dist/nile-app-shell/index.cjs.js.map +1 -0
  17. package/dist/nile-app-shell/index.esm.js +1 -0
  18. package/dist/nile-app-shell/nile-app-shell.cjs.js +2 -0
  19. package/dist/nile-app-shell/nile-app-shell.cjs.js.map +1 -0
  20. package/dist/nile-app-shell/nile-app-shell.css.cjs.js +2 -0
  21. package/dist/nile-app-shell/nile-app-shell.css.cjs.js.map +1 -0
  22. package/dist/nile-app-shell/nile-app-shell.css.esm.js +554 -0
  23. package/dist/nile-app-shell/nile-app-shell.esm.js +155 -0
  24. package/dist/nile-app-shell/shell-controller.cjs.js +2 -0
  25. package/dist/nile-app-shell/shell-controller.cjs.js.map +1 -0
  26. package/dist/nile-app-shell/shell-controller.esm.js +1 -0
  27. package/dist/nile-app-shell-main/index.cjs.js +2 -0
  28. package/dist/nile-app-shell-main/index.cjs.js.map +1 -0
  29. package/dist/nile-app-shell-main/index.esm.js +1 -0
  30. package/dist/nile-app-shell-main/nile-app-shell-main.cjs.js +2 -0
  31. package/dist/nile-app-shell-main/nile-app-shell-main.cjs.js.map +1 -0
  32. package/dist/nile-app-shell-main/nile-app-shell-main.css.cjs.js +2 -0
  33. package/dist/nile-app-shell-main/nile-app-shell-main.css.cjs.js.map +1 -0
  34. package/dist/nile-app-shell-main/nile-app-shell-main.css.esm.js +18 -0
  35. package/dist/nile-app-shell-main/nile-app-shell-main.esm.js +1 -0
  36. package/dist/nile-app-shell-nav-toggle/index.cjs.js +2 -0
  37. package/dist/nile-app-shell-nav-toggle/index.cjs.js.map +1 -0
  38. package/dist/nile-app-shell-nav-toggle/index.esm.js +1 -0
  39. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.cjs.js +2 -0
  40. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.cjs.js.map +1 -0
  41. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.cjs.js +2 -0
  42. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.cjs.js.map +1 -0
  43. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.esm.js +29 -0
  44. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.esm.js +16 -0
  45. package/dist/nile-app-shell-panel/index.cjs.js +2 -0
  46. package/dist/nile-app-shell-panel/index.cjs.js.map +1 -0
  47. package/dist/nile-app-shell-panel/index.esm.js +1 -0
  48. package/dist/nile-app-shell-panel/nile-app-shell-panel.cjs.js +2 -0
  49. package/dist/nile-app-shell-panel/nile-app-shell-panel.cjs.js.map +1 -0
  50. package/dist/nile-app-shell-panel/nile-app-shell-panel.css.cjs.js +2 -0
  51. package/dist/nile-app-shell-panel/nile-app-shell-panel.css.cjs.js.map +1 -0
  52. package/dist/nile-app-shell-panel/nile-app-shell-panel.css.esm.js +103 -0
  53. package/dist/nile-app-shell-panel/nile-app-shell-panel.esm.js +33 -0
  54. package/dist/nile-app-shell-side-nav/index.cjs.js +2 -0
  55. package/dist/nile-app-shell-side-nav/index.cjs.js.map +1 -0
  56. package/dist/nile-app-shell-side-nav/index.esm.js +1 -0
  57. package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.cjs.js +2 -0
  58. package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.cjs.js.map +1 -0
  59. package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.css.cjs.js +2 -0
  60. package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.css.cjs.js.map +1 -0
  61. package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.css.esm.js +55 -0
  62. package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.esm.js +5 -0
  63. package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
  64. package/dist/nile-floating-panel/nile-floating-panel.cjs.js.map +1 -1
  65. package/dist/nile-floating-panel/nile-floating-panel.css.cjs.js +1 -1
  66. package/dist/nile-floating-panel/nile-floating-panel.css.cjs.js.map +1 -1
  67. package/dist/nile-floating-panel/nile-floating-panel.css.esm.js +46 -8
  68. package/dist/nile-floating-panel/nile-floating-panel.esm.js +1 -1
  69. package/dist/nile-popover/nile-popover.cjs.js +1 -1
  70. package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
  71. package/dist/nile-popover/nile-popover.css.cjs.js +1 -1
  72. package/dist/nile-popover/nile-popover.css.cjs.js.map +1 -1
  73. package/dist/nile-popover/nile-popover.css.esm.js +32 -17
  74. package/dist/nile-popover/nile-popover.esm.js +1 -1
  75. package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
  76. package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
  77. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
  78. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +1 -1
  79. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +1 -1
  80. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.esm.js +1 -1
  81. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +1 -1
  82. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.esm.js +1 -1
  83. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +1 -1
  84. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -1
  85. package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +1 -1
  86. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js +1 -1
  87. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js.map +1 -1
  88. package/dist/nile-wysiwyg-editor/ui/embed-menu.esm.js +2 -2
  89. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js +1 -1
  90. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js.map +1 -1
  91. package/dist/nile-wysiwyg-editor/ui/image-menu.esm.js +4 -4
  92. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +1 -1
  93. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -1
  94. package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +1 -1
  95. package/dist/src/index.d.ts +7 -2
  96. package/dist/src/index.js +6 -1
  97. package/dist/src/index.js.map +1 -1
  98. package/dist/src/internal/glyph.d.ts +6 -1
  99. package/dist/src/internal/glyph.js +8 -1
  100. package/dist/src/internal/glyph.js.map +1 -1
  101. package/dist/src/nile-app-shell/index.d.ts +7 -0
  102. package/dist/src/nile-app-shell/index.js +8 -0
  103. package/dist/src/nile-app-shell/index.js.map +1 -0
  104. package/dist/src/nile-app-shell/nile-app-shell-regions.test.d.ts +4 -0
  105. package/dist/src/nile-app-shell/nile-app-shell-regions.test.js +177 -0
  106. package/dist/src/nile-app-shell/nile-app-shell-regions.test.js.map +1 -0
  107. package/dist/src/nile-app-shell/nile-app-shell.css.d.ts +18 -0
  108. package/dist/src/nile-app-shell/nile-app-shell.css.js +572 -0
  109. package/dist/src/nile-app-shell/nile-app-shell.css.js.map +1 -0
  110. package/dist/src/nile-app-shell/nile-app-shell.d.ts +292 -0
  111. package/dist/src/nile-app-shell/nile-app-shell.js +796 -0
  112. package/dist/src/nile-app-shell/nile-app-shell.js.map +1 -0
  113. package/dist/src/nile-app-shell/nile-app-shell.test.d.ts +3 -0
  114. package/dist/src/nile-app-shell/nile-app-shell.test.js +454 -0
  115. package/dist/src/nile-app-shell/nile-app-shell.test.js.map +1 -0
  116. package/dist/src/nile-app-shell/shell-controller.d.ts +34 -0
  117. package/dist/src/nile-app-shell/shell-controller.js +80 -0
  118. package/dist/src/nile-app-shell/shell-controller.js.map +1 -0
  119. package/dist/src/nile-app-shell-main/index.d.ts +7 -0
  120. package/dist/src/nile-app-shell-main/index.js +8 -0
  121. package/dist/src/nile-app-shell-main/index.js.map +1 -0
  122. package/dist/src/nile-app-shell-main/nile-app-shell-main.css.d.ts +9 -0
  123. package/dist/src/nile-app-shell-main/nile-app-shell-main.css.js +27 -0
  124. package/dist/src/nile-app-shell-main/nile-app-shell-main.css.js.map +1 -0
  125. package/dist/src/nile-app-shell-main/nile-app-shell-main.d.ts +38 -0
  126. package/dist/src/nile-app-shell-main/nile-app-shell-main.js +51 -0
  127. package/dist/src/nile-app-shell-main/nile-app-shell-main.js.map +1 -0
  128. package/dist/src/nile-app-shell-nav-toggle/index.d.ts +7 -0
  129. package/dist/src/nile-app-shell-nav-toggle/index.js +8 -0
  130. package/dist/src/nile-app-shell-nav-toggle/index.js.map +1 -0
  131. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.d.ts +13 -0
  132. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.js +42 -0
  133. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.js.map +1 -0
  134. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.d.ts +56 -0
  135. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.js +126 -0
  136. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.js.map +1 -0
  137. package/dist/src/nile-app-shell-panel/index.d.ts +7 -0
  138. package/dist/src/nile-app-shell-panel/index.js +8 -0
  139. package/dist/src/nile-app-shell-panel/index.js.map +1 -0
  140. package/dist/src/nile-app-shell-panel/nile-app-shell-panel.css.d.ts +9 -0
  141. package/dist/src/nile-app-shell-panel/nile-app-shell-panel.css.js +112 -0
  142. package/dist/src/nile-app-shell-panel/nile-app-shell-panel.css.js.map +1 -0
  143. package/dist/src/nile-app-shell-panel/nile-app-shell-panel.d.ts +73 -0
  144. package/dist/src/nile-app-shell-panel/nile-app-shell-panel.js +158 -0
  145. package/dist/src/nile-app-shell-panel/nile-app-shell-panel.js.map +1 -0
  146. package/dist/src/nile-app-shell-side-nav/index.d.ts +7 -0
  147. package/dist/src/nile-app-shell-side-nav/index.js +8 -0
  148. package/dist/src/nile-app-shell-side-nav/index.js.map +1 -0
  149. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.d.ts +13 -0
  150. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.js +68 -0
  151. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.js.map +1 -0
  152. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.d.ts +54 -0
  153. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.js +83 -0
  154. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.js.map +1 -0
  155. package/dist/src/nile-floating-panel/nile-floating-panel.css.js +46 -8
  156. package/dist/src/nile-floating-panel/nile-floating-panel.css.js.map +1 -1
  157. package/dist/src/nile-floating-panel/nile-floating-panel.js +13 -1
  158. package/dist/src/nile-floating-panel/nile-floating-panel.js.map +1 -1
  159. package/dist/src/nile-popover/nile-popover.css.js +30 -15
  160. package/dist/src/nile-popover/nile-popover.css.js.map +1 -1
  161. package/dist/src/nile-popover/nile-popover.js +1 -1
  162. package/dist/src/nile-popover/nile-popover.js.map +1 -1
  163. package/dist/src/nile-popover/nile-popover.test.js +1 -1
  164. package/dist/src/nile-popover/nile-popover.test.js.map +1 -1
  165. package/dist/src/version.d.ts +11 -1
  166. package/dist/src/version.js +51 -8
  167. package/dist/src/version.js.map +1 -1
  168. package/dist/tsconfig.tsbuildinfo +1 -1
  169. package/dist/version.cjs.js +1 -1
  170. package/dist/version.cjs.js.map +1 -1
  171. package/dist/version.esm.js +1 -1
  172. package/package.json +7 -2
  173. package/src/index.ts +16 -4
  174. package/src/internal/glyph.ts +12 -1
  175. package/src/nile-app-shell/index.ts +8 -0
  176. package/src/nile-app-shell/nile-app-shell-regions.test.ts +215 -0
  177. package/src/nile-app-shell/nile-app-shell.css.ts +574 -0
  178. package/src/nile-app-shell/nile-app-shell.test.ts +536 -0
  179. package/src/nile-app-shell/nile-app-shell.ts +838 -0
  180. package/src/nile-app-shell/shell-controller.ts +100 -0
  181. package/src/nile-app-shell-main/index.ts +8 -0
  182. package/src/nile-app-shell-main/nile-app-shell-main.css.ts +29 -0
  183. package/src/nile-app-shell-main/nile-app-shell-main.ts +52 -0
  184. package/src/nile-app-shell-nav-toggle/index.ts +8 -0
  185. package/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.ts +44 -0
  186. package/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.ts +138 -0
  187. package/src/nile-app-shell-panel/index.ts +8 -0
  188. package/src/nile-app-shell-panel/nile-app-shell-panel.css.ts +114 -0
  189. package/src/nile-app-shell-panel/nile-app-shell-panel.ts +161 -0
  190. package/src/nile-app-shell-side-nav/index.ts +8 -0
  191. package/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.ts +70 -0
  192. package/src/nile-app-shell-side-nav/nile-app-shell-side-nav.ts +86 -0
  193. package/src/nile-floating-panel/nile-floating-panel.css.ts +46 -8
  194. package/src/nile-floating-panel/nile-floating-panel.ts +19 -1
  195. package/src/nile-popover/nile-popover.css.ts +30 -15
  196. package/src/nile-popover/nile-popover.test.ts +1 -1
  197. package/src/nile-popover/nile-popover.ts +1 -1
  198. package/src/version.ts +55 -7
  199. package/vscode-html-custom-data.json +216 -5
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { css } from 'lit';
9
+
10
+ /**
11
+ * AppShellSideNav CSS. The shell owns the track width; this owns what happens
12
+ * inside it — a pinned header, a scrolling body, a pinned footer.
13
+ */
14
+ export const styles = css`
15
+ :host {
16
+ box-sizing: border-box;
17
+ display: flex;
18
+ flex-direction: column;
19
+ width: 100%;
20
+ height: 100%;
21
+ overflow: hidden;
22
+ /* The nav and the page share one surface. */
23
+ background: var(--nile-app-shell-side-nav-bg, transparent);
24
+ }
25
+
26
+ :host([hidden]) {
27
+ display: none;
28
+ }
29
+
30
+ .header,
31
+ .footer {
32
+ flex: 0 0 auto;
33
+ display: block;
34
+ }
35
+
36
+ .body {
37
+ flex: 1 1 auto;
38
+ min-height: 0;
39
+ overflow-y: auto;
40
+ overflow-x: hidden;
41
+ padding: var(
42
+ --nile-app-shell-side-nav-padding,
43
+ var(--nile-spacing-lg, var(--ng-spacing-lg))
44
+ );
45
+ scrollbar-width: thin;
46
+ }
47
+
48
+ .body::-webkit-scrollbar {
49
+ width: 6px;
50
+ }
51
+
52
+ .body::-webkit-scrollbar-track {
53
+ background: transparent;
54
+ }
55
+
56
+ .body::-webkit-scrollbar-thumb {
57
+ background-color: var(
58
+ --nile-colors-neutral-500,
59
+ var(--ng-colors-border-primary)
60
+ );
61
+ border-radius: 10px;
62
+ }
63
+
64
+ /* A rail has no room for a horizontal scrollbar or for wide children. */
65
+ :host([collapsed]) .body {
66
+ overflow-x: hidden;
67
+ }
68
+ `;
69
+
70
+ export default [styles];
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { html, CSSResultArray, TemplateResult } from 'lit';
9
+ import { customElement, property } from 'lit/decorators.js';
10
+ import { styles } from './nile-app-shell-side-nav.css';
11
+ import { AppShellController } from '../nile-app-shell/shell-controller';
12
+ import NileElement from '../internal/nile-element';
13
+
14
+ /**
15
+ * @summary The shell's left region — the navigation track. Assigns itself to the
16
+ * shell's `side-nav` slot and mirrors the shell's rail state, so nav content can
17
+ * style against it.
18
+ *
19
+ * @status stable
20
+ * @since 2.0
21
+ *
22
+ * @tag nile-app-shell-side-nav
23
+ *
24
+ * @dependency nile-app-shell
25
+ *
26
+ * @slot - The nav body. Scrolls.
27
+ * @slot header - Pinned above the scroll region — a wordmark or product switcher.
28
+ * @slot footer - Pinned below it — an account row or help link.
29
+ *
30
+ * @csspart header - The pinned header.
31
+ * @csspart body - The scrolling nav body.
32
+ * @csspart footer - The pinned footer.
33
+ *
34
+ * @cssproperty [--nile-app-shell-side-nav-padding=12px] - Body inset. 12 + 40 +
35
+ * 12 is what makes a 64px rail.
36
+ * @cssproperty [--nile-app-shell-side-nav-bg=transparent] - Surface behind the
37
+ * nav. Transparent by default: the nav and the page share one.
38
+ */
39
+ @customElement('nile-app-shell-side-nav')
40
+ export class NileAppShellSideNav extends NileElement {
41
+ public static get styles(): CSSResultArray {
42
+ return [styles];
43
+ }
44
+
45
+ private shellLink = new AppShellController(this);
46
+
47
+ /**
48
+ * Mirrors the shell's effective rail state — the user's preference, or a rail
49
+ * forced by the shell's width. Set by the shell; treat it as read-only and
50
+ * style against it (`nile-app-shell-side-nav[collapsed] .label`).
51
+ */
52
+ @property({ type: Boolean, reflect: true })
53
+ collapsed: boolean = false;
54
+
55
+ /** Id of the shell to follow. Defaults to the nearest ancestor. */
56
+ @property({ type: String })
57
+ shell?: string;
58
+
59
+ public connectedCallback(): void {
60
+ super.connectedCallback();
61
+ // Claim the shell's left region unless the author placed it elsewhere.
62
+ if (!this.hasAttribute('slot')) this.setAttribute('slot', 'side-nav');
63
+ }
64
+
65
+ protected willUpdate(): void {
66
+ this.shellLink.shellId = this.shell;
67
+ const shell = this.shellLink.shell;
68
+ if (shell) this.collapsed = shell.rail;
69
+ }
70
+
71
+ public render(): TemplateResult {
72
+ return html`
73
+ <slot name="header" part="header" class="header"></slot>
74
+ <div class="body" part="body"><slot></slot></div>
75
+ <slot name="footer" part="footer" class="footer"></slot>
76
+ `;
77
+ }
78
+ }
79
+
80
+ export default NileAppShellSideNav;
81
+
82
+ declare global {
83
+ interface HTMLElementTagNameMap {
84
+ 'nile-app-shell-side-nav': NileAppShellSideNav;
85
+ }
86
+ }
@@ -81,26 +81,24 @@ export const styles = css`
81
81
  display: none;
82
82
  }
83
83
 
84
+ /* Offset arrow by 0.5px so its outline aligns with the panel border and its fill fully covers it. */
84
85
  .tippy-box[data-theme~='floating-panel'][data-placement^='top'] > .tippy-svg-arrow { bottom: 0; }
85
- .tippy-box[data-theme~='floating-panel'][data-placement^='top'] > .tippy-svg-arrow:after,
86
86
  .tippy-box[data-theme~='floating-panel'][data-placement^='top'] > .tippy-svg-arrow > svg {
87
- top: 16px;
87
+ top: 15.5px;
88
88
  transform: rotate(180deg);
89
89
  }
90
90
  .tippy-box[data-theme~='floating-panel'][data-placement^='bottom'] > .tippy-svg-arrow { top: 0; }
91
- .tippy-box[data-theme~='floating-panel'][data-placement^='bottom'] > .tippy-svg-arrow > svg { bottom: 16px; }
91
+ .tippy-box[data-theme~='floating-panel'][data-placement^='bottom'] > .tippy-svg-arrow > svg { bottom: 15.5px; }
92
92
  .tippy-box[data-theme~='floating-panel'][data-placement^='left'] > .tippy-svg-arrow { right: 0; }
93
- .tippy-box[data-theme~='floating-panel'][data-placement^='left'] > .tippy-svg-arrow:after,
94
93
  .tippy-box[data-theme~='floating-panel'][data-placement^='left'] > .tippy-svg-arrow > svg {
95
94
  transform: rotate(90deg);
96
- top: calc(50% - 3px);
95
+ top: calc(50% - 3.5px);
97
96
  left: 11px;
98
97
  }
99
98
  .tippy-box[data-theme~='floating-panel'][data-placement^='right'] > .tippy-svg-arrow { left: 0; }
100
- .tippy-box[data-theme~='floating-panel'][data-placement^='right'] > .tippy-svg-arrow:after,
101
99
  .tippy-box[data-theme~='floating-panel'][data-placement^='right'] > .tippy-svg-arrow > svg {
102
100
  transform: rotate(-90deg);
103
- top: calc(50% - 3px);
101
+ top: calc(50% - 3.5px);
104
102
  right: 11px;
105
103
  }
106
104
 
@@ -113,6 +111,14 @@ export const styles = css`
113
111
 
114
112
  .tippy-box[data-theme~='floating-panel'] > .tippy-svg-arrow > svg {
115
113
  position: absolute;
114
+ overflow: visible;
115
+ }
116
+
117
+ .tippy-box[data-theme~='floating-panel'] > .tippy-svg-arrow > svg > .nile-floating-panel__arrow-outline {
118
+ fill: none;
119
+ stroke: var(--nile-colors-dark-200, var(--ng-colors-border-secondary-alt));
120
+ stroke-width: 1;
121
+ vector-effect: non-scaling-stroke;
116
122
  }
117
123
 
118
124
  .tippy-box[data-theme~='floating-panel'][data-placement^='top'] > .tippy-arrow {
@@ -123,6 +129,13 @@ export const styles = css`
123
129
  border-width: 8px 8px 0;
124
130
  border-top-color: initial;
125
131
  }
132
+ .tippy-box[data-theme~='floating-panel'][data-placement^='top'] > .tippy-arrow:after {
133
+ bottom: -8px;
134
+ left: -1px;
135
+ border-width: 9px 9px 0;
136
+ border-top-color: var(--nile-colors-dark-200, var(--ng-colors-border-secondary-alt));
137
+ clip-path: inset(2px 0 0 0);
138
+ }
126
139
  .tippy-box[data-theme~='floating-panel'][data-placement^='bottom'] > .tippy-arrow {
127
140
  top: 0;
128
141
  }
@@ -131,6 +144,13 @@ export const styles = css`
131
144
  border-width: 0 8px 8px;
132
145
  border-bottom-color: initial;
133
146
  }
147
+ .tippy-box[data-theme~='floating-panel'][data-placement^='bottom'] > .tippy-arrow:after {
148
+ top: -8px;
149
+ left: -1px;
150
+ border-width: 0 9px 9px;
151
+ border-bottom-color: var(--nile-colors-dark-200, var(--ng-colors-border-secondary-alt));
152
+ clip-path: inset(0 0 2px 0);
153
+ }
134
154
  .tippy-box[data-theme~='floating-panel'][data-placement^='left'] > .tippy-arrow {
135
155
  right: 0;
136
156
  }
@@ -139,6 +159,13 @@ export const styles = css`
139
159
  border-width: 8px 0 8px 8px;
140
160
  border-left-color: initial;
141
161
  }
162
+ .tippy-box[data-theme~='floating-panel'][data-placement^='left'] > .tippy-arrow:after {
163
+ right: -8px;
164
+ top: -1px;
165
+ border-width: 9px 0 9px 9px;
166
+ border-left-color: var(--nile-colors-dark-200, var(--ng-colors-border-secondary-alt));
167
+ clip-path: inset(0 0 0 2px);
168
+ }
142
169
  .tippy-box[data-theme~='floating-panel'][data-placement^='right'] > .tippy-arrow {
143
170
  left: 0;
144
171
  }
@@ -147,18 +174,29 @@ export const styles = css`
147
174
  border-width: 8px 8px 8px 0;
148
175
  border-right-color: initial;
149
176
  }
177
+ .tippy-box[data-theme~='floating-panel'][data-placement^='right'] > .tippy-arrow:after {
178
+ left: -8px;
179
+ top: -1px;
180
+ border-width: 9px 9px 9px 0;
181
+ border-right-color: var(--nile-colors-dark-200, var(--ng-colors-border-secondary-alt));
182
+ clip-path: inset(0 2px 0 0);
183
+ }
150
184
 
151
185
  .tippy-box[data-theme~='floating-panel'] > .tippy-arrow {
152
186
  width: 16px;
153
187
  height: 16px;
154
188
  color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
155
189
  }
156
- .tippy-box[data-theme~='floating-panel'] > .tippy-arrow:before {
190
+ /* :after is a 1px-larger triangle in the border colour, stacked behind :before, so the border continues around the arrow. */
191
+ .tippy-box[data-theme~='floating-panel'] > .tippy-arrow:before,
192
+ .tippy-box[data-theme~='floating-panel'] > .tippy-arrow:after {
157
193
  content: '';
158
194
  position: absolute;
159
195
  border-color: transparent;
160
196
  border-style: solid;
161
197
  }
198
+ .tippy-box[data-theme~='floating-panel'] > .tippy-arrow:before { z-index: 1; }
199
+ .tippy-box[data-theme~='floating-panel'] > .tippy-arrow:after { z-index: 0; }
162
200
  `;
163
201
 
164
202
  export function injectGlobalFloatingPanelStyles(): void {
@@ -21,6 +21,24 @@ import {
21
21
  } from '../nile-lite-tooltip/utils';
22
22
  import { VisibilityManager } from '../utilities/visibility-manager.js';
23
23
 
24
+ const TIPPY_ROUND_ARROW =
25
+ /^<svg width="(\d+)" height="(\d+)"[^>]*><path d="(.+?)H0z"/.exec(roundArrow);
26
+
27
+ const NILE_ROUND_ARROW = ((): string => {
28
+ if (!TIPPY_ROUND_ARROW) return roundArrow;
29
+
30
+ const [, rawWidth, rawHeight, curve] = TIPPY_ROUND_ARROW;
31
+ const width = Number(rawWidth);
32
+ const height = Number(rawHeight) + 1; // + the skirt that covers the border
33
+
34
+ return (
35
+ `<svg width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg">` +
36
+ `<path d="${curve}V${height}H0Z"></path>` +
37
+ `<path class="nile-floating-panel__arrow-outline" d="${curve}"></path>` +
38
+ `</svg>`
39
+ );
40
+ })();
41
+
24
42
  /**
25
43
  * Nile floating-panel component.
26
44
  *
@@ -482,7 +500,7 @@ export class NileFloatingPanel extends NileElement {
482
500
 
483
501
  private _resolveArrow() {
484
502
  switch (this.arrow) {
485
- case 'round': return roundArrow;
503
+ case 'round': return NILE_ROUND_ARROW;
486
504
  case 'none': return false as const;
487
505
  default: return true as const;
488
506
  }
@@ -40,10 +40,6 @@ export const styles = css`
40
40
  background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
41
41
  border: solid 1px var(--nile-colors-dark-200, var(--ng-colors-border-secondary-alt));
42
42
  box-shadow: var(--nile-box-shadow-2, var(--ng-shadow-lg));
43
- --arrow-size: 18px;
44
- --arrow-size-diagonal: calc(var(--arrow-size) * 0.7071);
45
- --arrow-padding-offset: calc(var(--arrow-size-diagonal) - var(--arrow-size));
46
- --arrow-color: var(--nile-colors-white-base, var(--ng-colors-text-white));
47
43
  }
48
44
 
49
45
  .popover__action {
@@ -52,19 +48,38 @@ export const styles = css`
52
48
  }
53
49
 
54
50
  nile-popup {
55
- --arrow-size: 18px;
56
- --arrow-color: var(--nile-colors-white-base, var(--ng-colors-text-white));
51
+ --arrow-size: 10px;
52
+ --arrow-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
53
+ --arrow-border-color: var(
54
+ --nile-colors-dark-200,
55
+ var(--ng-colors-border-secondary-alt)
56
+ );
57
57
  }
58
58
 
59
- .popup__arrow {
60
- position: absolute;
61
- width: calc(var(--arrow-size-diagonal) * 2);
62
- height: calc(var(--arrow-size-diagonal) * 2);
63
- rotate: 45deg;
64
- background: var(--arrow-color);
65
- z-index: -1;
66
- border: solid 1px var(--nile-colors-dark-200, var(--ng-colors-border-secondary-alt));
67
- box-shadow: var(--nile-box-shadow-2, var(--ng-shadow-lg));
59
+ nile-popup::part(arrow) {
60
+ z-index: 1;
61
+ border: none;
62
+ box-shadow: none;
63
+ }
64
+
65
+ nile-popup[data-current-placement^='bottom']::part(arrow) {
66
+ border-top: solid 1px var(--arrow-border-color);
67
+ border-left: solid 1px var(--arrow-border-color);
68
+ }
69
+
70
+ nile-popup[data-current-placement^='top']::part(arrow) {
71
+ border-bottom: solid 1px var(--arrow-border-color);
72
+ border-right: solid 1px var(--arrow-border-color);
73
+ }
74
+
75
+ nile-popup[data-current-placement^='left']::part(arrow) {
76
+ border-top: solid 1px var(--arrow-border-color);
77
+ border-right: solid 1px var(--arrow-border-color);
78
+ }
79
+
80
+ nile-popup[data-current-placement^='right']::part(arrow) {
81
+ border-bottom: solid 1px var(--arrow-border-color);
82
+ border-left: solid 1px var(--arrow-border-color);
68
83
  }
69
84
  `;
70
85
 
@@ -7,7 +7,7 @@ describe('NilePopover', () => {
7
7
  it('2. shadow root', async () => { const el = await fixture<NilePopover>(html`<nile-popover></nile-popover>`); expect(el.shadowRoot).to.not.be.null; });
8
8
  it('3. tag name', async () => { const el = await fixture<NilePopover>(html`<nile-popover></nile-popover>`); expect(el.tagName.toLowerCase()).to.equal('nile-popover'); });
9
9
  it('4. placement defaults top', async () => { const el = await fixture<NilePopover>(html`<nile-popover></nile-popover>`); expect(el.placement).to.equal('top'); });
10
- it('5. distance defaults 18', async () => { const el = await fixture<NilePopover>(html`<nile-popover></nile-popover>`); expect(el.distance).to.equal(18); });
10
+ it('5. distance defaults 12', async () => { const el = await fixture<NilePopover>(html`<nile-popover></nile-popover>`); expect(el.distance).to.equal(12); });
11
11
  it('6. preventOverlayClose defaults false', async () => { const el = await fixture<NilePopover>(html`<nile-popover></nile-popover>`); expect(el.preventOverlayClose).to.equal(false); });
12
12
  it('7. arrow defaults true', async () => { const el = await fixture<NilePopover>(html`<nile-popover></nile-popover>`); expect(el.arrow).to.equal(true); });
13
13
  it('8. title defaults empty', async () => { const el = await fixture<NilePopover>(html`<nile-popover></nile-popover>`); expect(el.title).to.equal(''); });
@@ -56,7 +56,7 @@ export class NilePopover extends NileElement {
56
56
  | 'left-end' = 'top';
57
57
 
58
58
  /** The distance in pixels from which to offset the popover away from its target. */
59
- @property({ type: Number }) distance = 18;
59
+ @property({ type: Number }) distance = 12;
60
60
 
61
61
  @property({ type: Boolean, reflect: true }) preventOverlayClose = false;
62
62
 
package/src/version.ts CHANGED
@@ -3,17 +3,65 @@
3
3
  // NILE_ELEMENTS_VERSION is this package's own version and is still substituted
4
4
  // at build time by scripts/replace-version.cjs.
5
5
  //
6
- // NILE_VERSION is read from the installed @aquera/nile at runtime, so publishing
7
- // @aquera/nile on its own is enough to update window.nileVersion - consumers do
8
- // not need a rebuild of this package to pick up a new tokens version.
9
- import { NILE_VERSION as INSTALLED_NILE_VERSION } from '@aquera/nile/lib/version.js';
6
+ // The tokens version is read from the loaded Nile stylesheet's --nile-version
7
+ // custom property (stamped by @aquera/nile's scripts/stamp-css-version.mjs),
8
+ // falling back to the @aquera/nile installed alongside this package.
9
+ //
10
+ // Reading the stylesheet is what makes a tokens-only release visible. The
11
+ // imported constant alone is not enough: rollup.config.js bundles
12
+ // @aquera/nile/lib/version.js into dist/index.js, so on the CDN build it is
13
+ // frozen at this package's build time. The stylesheet is the live source.
14
+ import { NILE_VERSION as BUILT_IN_NILE_VERSION } from '@aquera/nile/lib/version.js';
10
15
 
11
16
  export const NILE_ELEMENTS_VERSION = '__NILE_ELEMENTS_VERSION__';
12
- export const NILE_VERSION = INSTALLED_NILE_VERSION;
17
+
18
+ function readStylesheetNileVersion(): string | null {
19
+ if (typeof window === 'undefined' || typeof getComputedStyle !== 'function') {
20
+ return null;
21
+ }
22
+
23
+ try {
24
+ const value = getComputedStyle(document.documentElement)
25
+ .getPropertyValue('--nile-version')
26
+ .trim()
27
+ .replace(/^["']|["']$/g, '');
28
+
29
+ return value || null;
30
+ } catch {
31
+ return null;
32
+ }
33
+ }
34
+
35
+ /**
36
+ * The version of @aquera/nile (tokens/stylesheets) whose CSS is loaded in the
37
+ * page, falling back to the @aquera/nile bundled into this package when no
38
+ * stamped stylesheet is present.
39
+ *
40
+ * This is the canonical runtime API. It resolves on every call rather than
41
+ * caching, so it is correct even when the Nile stylesheet is added to the page
42
+ * after this module evaluates - which is the common case, and why no
43
+ * module-evaluation-time snapshot of it is exported.
44
+ */
45
+ export function getNileVersion(): string {
46
+ return readStylesheetNileVersion() ?? BUILT_IN_NILE_VERSION;
47
+ }
13
48
 
14
49
  // Set global versions for runtime access
15
50
  if (typeof window !== 'undefined') {
16
51
  (window as any).nileElementsVersion = NILE_ELEMENTS_VERSION;
17
- (window as any).nileVersion = NILE_VERSION;
18
- window.process = window.process || { env: { NODE_ENV: 'production' } };
52
+
53
+ // A getter rather than a value, so window.nileVersion reflects whichever
54
+ // stylesheet is loaded at read time regardless of script/style ordering.
55
+ let override: string | null = null;
56
+ Object.defineProperty(window, 'nileVersion', {
57
+ configurable: true,
58
+ get: () => override ?? getNileVersion(),
59
+ set: (value: string) => {
60
+ override = value;
61
+ },
62
+ });
63
+
64
+ (window as any).process = (window as any).process || {
65
+ env: { NODE_ENV: 'production' },
66
+ };
19
67
  }