@nldd/design-system 0.8.85 → 0.8.86

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 (80) hide show
  1. package/custom-elements.json +156 -18
  2. package/dist/components/components.js +406 -128
  3. package/dist/components/layout/collection/collection.d.ts +15 -8
  4. package/dist/components/layout/collection/collection.d.ts.map +1 -1
  5. package/dist/components/layout/collection/collection.js +38 -13
  6. package/dist/components/layout/collection/collection.js.map +1 -1
  7. package/dist/components/layout/collection/collection.styles.d.ts.map +1 -1
  8. package/dist/components/layout/collection/collection.styles.js +36 -23
  9. package/dist/components/layout/collection/collection.styles.js.map +1 -1
  10. package/dist/components/layout/container/container.d.ts +11 -3
  11. package/dist/components/layout/container/container.d.ts.map +1 -1
  12. package/dist/components/layout/container/container.js +30 -17
  13. package/dist/components/layout/container/container.js.map +1 -1
  14. package/dist/components/layout/container/container.styles.d.ts.map +1 -1
  15. package/dist/components/layout/container/container.styles.js +19 -21
  16. package/dist/components/layout/container/container.styles.js.map +1 -1
  17. package/dist/components/layout/page/page.d.ts +23 -2
  18. package/dist/components/layout/page/page.d.ts.map +1 -1
  19. package/dist/components/layout/page/page.js +56 -2
  20. package/dist/components/layout/page/page.js.map +1 -1
  21. package/dist/components/layout/page/page.styles.d.ts.map +1 -1
  22. package/dist/components/layout/page/page.styles.js +33 -8
  23. package/dist/components/layout/page/page.styles.js.map +1 -1
  24. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.d.ts.map +1 -1
  25. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js +7 -5
  26. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js.map +1 -1
  27. package/dist/components/layout/sheet/sheet.styles.js +2 -2
  28. package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +1 -1
  29. package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts.map +1 -1
  30. package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +13 -13
  31. package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
  32. package/dist/components/layout/split-views/bar-split-view/bar-split-view.styles.js +1 -1
  33. package/dist/components/lists-and-tables/list/list.d.ts +13 -3
  34. package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
  35. package/dist/components/lists-and-tables/list/list.js +39 -3
  36. package/dist/components/lists-and-tables/list/list.js.map +1 -1
  37. package/dist/components/lists-and-tables/list/list.styles.d.ts.map +1 -1
  38. package/dist/components/lists-and-tables/list/list.styles.js +8 -1
  39. package/dist/components/lists-and-tables/list/list.styles.js.map +1 -1
  40. package/dist/components/lists-and-tables/list/list.template.d.ts +4 -1
  41. package/dist/components/lists-and-tables/list/list.template.d.ts.map +1 -1
  42. package/dist/components/lists-and-tables/list/list.template.js +31 -12
  43. package/dist/components/lists-and-tables/list/list.template.js.map +1 -1
  44. package/dist/components/lists-and-tables/list-item/list-item.d.ts +8 -3
  45. package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
  46. package/dist/components/lists-and-tables/list-item/list-item.js +35 -9
  47. package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
  48. package/dist/components/lists-and-tables/list-item/list-item.template.d.ts +1 -1
  49. package/dist/components/lists-and-tables/list-item/list-item.template.d.ts.map +1 -1
  50. package/dist/components/lists-and-tables/list-item/list-item.template.js +18 -1
  51. package/dist/components/lists-and-tables/list-item/list-item.template.js.map +1 -1
  52. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.d.ts.map +1 -1
  53. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +50 -12
  54. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
  55. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.js +3 -3
  56. package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.d.ts.map +1 -1
  57. package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.js +15 -0
  58. package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.js.map +1 -1
  59. package/dist/components/status-and-feedback/progress-circle/progress-circle.template.d.ts.map +1 -1
  60. package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js +4 -3
  61. package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js.map +1 -1
  62. package/dist/components/visibility-mixin-BU1vIMW7.js +161 -0
  63. package/dist/favicon.svg +4 -0
  64. package/dist/nldd.min.js +775 -646
  65. package/dist/touch-icon.png +0 -0
  66. package/dist/types/vue.d.ts +24 -10
  67. package/dist/utilities/spacing-scale.d.ts +26 -0
  68. package/dist/utilities/spacing-scale.d.ts.map +1 -0
  69. package/dist/utilities/spacing-scale.js +54 -0
  70. package/dist/utilities/spacing-scale.js.map +1 -0
  71. package/dist/utilities/visibility-mixin.d.ts +11 -8
  72. package/dist/utilities/visibility-mixin.d.ts.map +1 -1
  73. package/dist/utilities/visibility-mixin.js +58 -45
  74. package/dist/utilities/visibility-mixin.js.map +1 -1
  75. package/dist/utilities/visibility-mixin.styles.d.ts +14 -0
  76. package/dist/utilities/visibility-mixin.styles.d.ts.map +1 -0
  77. package/dist/utilities/visibility-mixin.styles.js +52 -0
  78. package/dist/utilities/visibility-mixin.styles.js.map +1 -0
  79. package/package.json +5 -2
  80. package/dist/components/visibility-mixin-vbfhyo7f.js +0 -104
@@ -1,104 +0,0 @@
1
- import { t as __decorate } from "./decorate-lwt_OrAG.js";
2
- import { t as breakpoints } from "./breakpoints-CkxsiRgH.js";
3
- import { property } from "lit/decorators.js";
4
- //#region src/utilities/visibility-mixin.ts
5
- function resolveHideBelow(value) {
6
- if (value === "md") return breakpoints.smMax;
7
- if (value === "lg") return breakpoints.mdMax;
8
- if (value === "sm") return null;
9
- return value;
10
- }
11
- function resolveHideAbove(value) {
12
- if (value === "sm") return breakpoints.mdMin;
13
- if (value === "md") return breakpoints.lgMin;
14
- if (value === "lg") return null;
15
- return value;
16
- }
17
- /**
18
- * The open edges resolve to null, so the attribute is written but nothing ever
19
- * hides. That reads like a working value, and the name invites it: `hide-below`
20
- * names the breakpoint you hide BELOW, so "hide it at sm" comes out as
21
- * `hide-below="md"` and `hide-below="sm"` does nothing at all. Say so once,
22
- * rather than let it look applied.
23
- */
24
- function warnNoOp(host, attribute, value, resolved, openEdge, edgeLabel) {
25
- if (value !== openEdge || resolved !== null) return;
26
- console.warn(`[${host.localName}] ${attribute}="${openEdge}" never hides anything: there is no breakpoint ${edgeLabel}. The value names the breakpoint you hide below, so the smallest one that hides is "${attribute === "hide-below" ? "md" : "sm"}". Leave the attribute off if you meant "always visible".`);
27
- }
28
- /**
29
- * Adds `hide-below` and `hide-above` attributes that toggle visibility based
30
- * on the inline-size of an ancestor CSS container.
31
- *
32
- * Without a `containerName` argument the generated rule is an anonymous
33
- * `@container (…)` query — it matches the nearest ancestor that declares
34
- * `container-type: inline-size`. Pass a name to target a specific container
35
- * (e.g. `'cells-container'` for cells inside `nldd-list`, which sets that
36
- * name inline on its host as a Safari shadow-DOM workaround).
37
- *
38
- * Values are either a named breakpoint — `sm` / `md` / `lg` — or a CSS length
39
- * (e.g. '320px', '20rem'). Named values resolve to the standard breakpoint
40
- * thresholds: `hide-below` uses the breakpoint's lower bound (e.g.
41
- * `hide-below="lg"` hides in sm+md and shows in lg), `hide-above` its upper
42
- * bound; the open edges (below sm, above lg) are no-ops. Container queries can't
43
- * read CSS variables in their conditions, so the query rule is generated at
44
- * runtime and injected as a <style> element in the component's shadow root,
45
- * wrapped in `:host { @container <name>? (…) { display: none !important; } }`
46
- * (nested form — the flattened `@container { :host { … } }` is unreliable in
47
- * Safari).
48
- *
49
- * @mixin VisibilityMixin
50
- *
51
- * @attr {string} hide-below - Hides the element below this breakpoint: `sm` | `md` | `lg`, or a CSS length. The value names the breakpoint you hide BELOW, so `hide-below="md"` is hidden in sm and visible from md up. `sm` is the open edge and never hides (DEV-warns).
52
- * @attr {string} hide-above - Hides the element above this breakpoint: `sm` | `md` | `lg`, or a CSS length. `hide-above="sm"` is hidden in md and lg. `lg` is the open edge and never hides (DEV-warns).
53
- *
54
- * @example
55
- * ```ts
56
- * // Cell inside nldd-list — target the named cells-container
57
- * class NLDDTextCell extends VisibilityMixin(LitElement, 'cells-container') { … }
58
- *
59
- * // Other component — fall back to the nearest unnamed container
60
- * class SomeComponent extends VisibilityMixin(LitElement) { … }
61
- * ```
62
- */
63
- function VisibilityMixin(Base, containerName) {
64
- class WithVisibility extends Base {
65
- updated(changed) {
66
- super.updated(changed);
67
- if (changed.has("hideBelow") || changed.has("hideAbove")) this._updateVisibilityStyle();
68
- }
69
- _updateVisibilityStyle() {
70
- if (!this.shadowRoot) return;
71
- const containerPrefix = containerName ? `${containerName} ` : "";
72
- const rules = [];
73
- const below = this.hideBelow ? resolveHideBelow(this.hideBelow) : null;
74
- warnNoOp(this, "hide-below", this.hideBelow, below, "sm", "below sm");
75
- if (below) rules.push(`:host { @container ${containerPrefix}(max-width: ${below}) { display: none !important; } }`);
76
- const above = this.hideAbove ? resolveHideAbove(this.hideAbove) : null;
77
- warnNoOp(this, "hide-above", this.hideAbove, above, "lg", "above lg");
78
- if (above) rules.push(`:host { @container ${containerPrefix}(min-width: ${above}) { display: none !important; } }`);
79
- if (rules.length === 0) {
80
- this._visibilityStyle?.remove();
81
- this._visibilityStyle = void 0;
82
- return;
83
- }
84
- if (!this._visibilityStyle) {
85
- this._visibilityStyle = document.createElement("style");
86
- this.shadowRoot.appendChild(this._visibilityStyle);
87
- }
88
- this._visibilityStyle.textContent = rules.join("\n");
89
- }
90
- }
91
- __decorate([property({
92
- type: String,
93
- reflect: true,
94
- attribute: "hide-below"
95
- })], WithVisibility.prototype, "hideBelow", void 0);
96
- __decorate([property({
97
- type: String,
98
- reflect: true,
99
- attribute: "hide-above"
100
- })], WithVisibility.prototype, "hideAbove", void 0);
101
- return WithVisibility;
102
- }
103
- //#endregion
104
- export { VisibilityMixin as t };