overview-components 1.0.76 → 1.0.78

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.
@@ -1,127 +1,131 @@
1
1
  function c() {
2
2
  return typeof window < "u";
3
3
  }
4
- function u(e) {
5
- return a(e) ? (e.nodeName || "").toLowerCase() : "#document";
4
+ function s(n) {
5
+ return p(n) ? (n.nodeName || "").toLowerCase() : "#document";
6
6
  }
7
- function i(e) {
7
+ function i(n) {
8
8
  var t;
9
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
9
+ return (n == null || (t = n.ownerDocument) == null ? void 0 : t.defaultView) || window;
10
10
  }
11
- function h(e) {
11
+ function E(n) {
12
12
  var t;
13
- return (t = (a(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
13
+ return (t = (p(n) ? n.ownerDocument : n.document) || window.document) == null ? void 0 : t.documentElement;
14
14
  }
15
- function a(e) {
16
- return c() ? e instanceof Node || e instanceof i(e).Node : !1;
15
+ function p(n) {
16
+ return c() ? n instanceof Node || n instanceof i(n).Node : !1;
17
17
  }
18
- function d(e) {
19
- return c() ? e instanceof Element || e instanceof i(e).Element : !1;
18
+ function m(n) {
19
+ return c() ? n instanceof Element || n instanceof i(n).Element : !1;
20
20
  }
21
- function m(e) {
22
- return c() ? e instanceof HTMLElement || e instanceof i(e).HTMLElement : !1;
21
+ function w(n) {
22
+ return c() ? n instanceof HTMLElement || n instanceof i(n).HTMLElement : !1;
23
23
  }
24
- function f(e) {
25
- return !c() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof i(e).ShadowRoot;
24
+ function a(n) {
25
+ return !c() || typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof i(n).ShadowRoot;
26
26
  }
27
- function p(e) {
27
+ function y(n) {
28
28
  const {
29
29
  overflow: t,
30
- overflowX: n,
30
+ overflowX: e,
31
31
  overflowY: o,
32
32
  display: r
33
- } = y(e);
34
- return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !["inline", "contents"].includes(r);
33
+ } = b(n);
34
+ return /auto|scroll|overlay|hidden|clip/.test(t + o + e) && !["inline", "contents"].includes(r);
35
35
  }
36
- function L(e) {
37
- return ["table", "td", "th"].includes(u(e));
36
+ function D(n) {
37
+ return ["table", "td", "th"].includes(s(n));
38
38
  }
39
- function S(e) {
39
+ function N(n) {
40
40
  return [":popover-open", ":modal"].some((t) => {
41
41
  try {
42
- return e.matches(t);
42
+ return n.matches(t);
43
43
  } catch {
44
44
  return !1;
45
45
  }
46
46
  });
47
47
  }
48
- function N(e) {
49
- const t = E(), n = d(e) ? y(e) : e;
50
- return ["transform", "translate", "scale", "rotate", "perspective"].some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
48
+ function T(n) {
49
+ const t = L(), e = m(n) ? b(n) : n;
50
+ return ["transform", "translate", "scale", "rotate", "perspective"].some((o) => e[o] ? e[o] !== "none" : !1) || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((o) => (e.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (e.contain || "").includes(o));
51
51
  }
52
- function D(e) {
53
- let t = s(e);
54
- for (; m(t) && !w(t); ) {
55
- if (N(t))
52
+ function k(n) {
53
+ let t = u(n);
54
+ for (; w(t) && !g(t); ) {
55
+ if (T(t))
56
56
  return t;
57
- if (S(t))
57
+ if (N(t))
58
58
  return null;
59
- t = s(t);
59
+ t = u(t);
60
60
  }
61
61
  return null;
62
62
  }
63
- function E() {
63
+ function L() {
64
64
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
65
65
  }
66
- function w(e) {
67
- return ["html", "body", "#document"].includes(u(e));
66
+ function g(n) {
67
+ return ["html", "body", "#document"].includes(s(n));
68
68
  }
69
- function y(e) {
70
- return i(e).getComputedStyle(e);
69
+ function b(n) {
70
+ return i(n).getComputedStyle(n);
71
71
  }
72
- function k(e) {
73
- return d(e) ? {
74
- scrollLeft: e.scrollLeft,
75
- scrollTop: e.scrollTop
72
+ function C(n) {
73
+ return m(n) ? {
74
+ scrollLeft: n.scrollLeft,
75
+ scrollTop: n.scrollTop
76
76
  } : {
77
- scrollLeft: e.scrollX,
78
- scrollTop: e.scrollY
77
+ scrollLeft: n.scrollX,
78
+ scrollTop: n.scrollY
79
79
  };
80
80
  }
81
- function s(e) {
82
- if (u(e) === "html")
83
- return e;
81
+ function u(n) {
82
+ if (s(n) === "html")
83
+ return n;
84
84
  const t = (
85
85
  // Step into the shadow DOM of the parent of a slotted node.
86
- e.assignedSlot || // DOM Element detected.
87
- e.parentNode || // ShadowRoot detected.
88
- f(e) && e.host || // Fallback.
89
- h(e)
86
+ n.assignedSlot || // DOM Element detected.
87
+ n.parentNode || // ShadowRoot detected.
88
+ a(n) && n.host || // Fallback.
89
+ E(n)
90
90
  );
91
- return f(t) ? t.host : t;
91
+ return a(t) ? t.host : t;
92
92
  }
93
- function g(e) {
94
- const t = s(e);
95
- return w(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : m(t) && p(t) ? t : g(t);
93
+ function h(n) {
94
+ const t = u(n);
95
+ return g(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : w(t) && y(t) ? t : h(t);
96
96
  }
97
- function v(e, t, n) {
97
+ function d(n, t, e) {
98
98
  var o;
99
- t === void 0 && (t = []);
100
- const r = g(e), b = r === ((o = e.ownerDocument) == null ? void 0 : o.body), l = i(r);
101
- return b ? (T(l), t.concat(l, l.visualViewport || [], p(r) ? r : [], [])) : t.concat(r, v(r, []));
99
+ t === void 0 && (t = []), e === void 0 && (e = !0);
100
+ const r = h(n), S = r === ((o = n.ownerDocument) == null ? void 0 : o.body), l = i(r);
101
+ if (S) {
102
+ const f = v(l);
103
+ return t.concat(l, l.visualViewport || [], y(r) ? r : [], f && e ? d(f) : []);
104
+ }
105
+ return t.concat(r, d(r, [], e));
102
106
  }
103
- function T(e) {
104
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
107
+ function v(n) {
108
+ return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null;
105
109
  }
106
110
  export {
107
- y as getComputedStyle,
108
- D as getContainingBlock,
109
- h as getDocumentElement,
110
- T as getFrameElement,
111
- g as getNearestOverflowAncestor,
112
- u as getNodeName,
113
- k as getNodeScroll,
114
- v as getOverflowAncestors,
115
- s as getParentNode,
111
+ b as getComputedStyle,
112
+ k as getContainingBlock,
113
+ E as getDocumentElement,
114
+ v as getFrameElement,
115
+ h as getNearestOverflowAncestor,
116
+ s as getNodeName,
117
+ C as getNodeScroll,
118
+ d as getOverflowAncestors,
119
+ u as getParentNode,
116
120
  i as getWindow,
117
- N as isContainingBlock,
118
- d as isElement,
119
- m as isHTMLElement,
120
- w as isLastTraversableNode,
121
- a as isNode,
122
- p as isOverflowElement,
123
- f as isShadowRoot,
124
- L as isTableElement,
125
- S as isTopLayer,
126
- E as isWebKit
121
+ T as isContainingBlock,
122
+ m as isElement,
123
+ w as isHTMLElement,
124
+ g as isLastTraversableNode,
125
+ p as isNode,
126
+ y as isOverflowElement,
127
+ a as isShadowRoot,
128
+ D as isTableElement,
129
+ N as isTopLayer,
130
+ L as isWebKit
127
131
  };
@@ -1,19 +1,19 @@
1
- const l = Math.min, m = Math.max, P = Math.round, O = (t) => ({
1
+ const l = Math.min, a = Math.max, P = Math.round, M = Math.floor, O = (t) => ({
2
2
  x: t,
3
3
  y: t
4
- }), p = {
4
+ }), m = {
5
5
  left: "right",
6
6
  right: "left",
7
7
  bottom: "top",
8
8
  top: "bottom"
9
- }, a = {
9
+ }, p = {
10
10
  start: "end",
11
11
  end: "start"
12
12
  };
13
- function M(t, n, e) {
14
- return m(t, l(n, e));
13
+ function S(t, n, e) {
14
+ return a(t, l(n, e));
15
15
  }
16
- function S(t, n) {
16
+ function w(t, n) {
17
17
  return typeof t == "function" ? t(n) : t;
18
18
  }
19
19
  function f(t) {
@@ -34,18 +34,18 @@ function b(t) {
34
34
  function d(t) {
35
35
  return h(b(t));
36
36
  }
37
- function w(t, n, e) {
37
+ function j(t, n, e) {
38
38
  e === void 0 && (e = !1);
39
39
  const r = g(t), o = d(t), i = x(o);
40
40
  let c = o === "x" ? r === (e ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
41
41
  return n.reference[i] > n.floating[i] && (c = u(c)), [c, u(c)];
42
42
  }
43
- function j(t) {
43
+ function C(t) {
44
44
  const n = u(t);
45
45
  return [s(t), n, s(n)];
46
46
  }
47
47
  function s(t) {
48
- return t.replace(/start|end/g, (n) => a[n]);
48
+ return t.replace(/start|end/g, (n) => p[n]);
49
49
  }
50
50
  function A(t, n, e) {
51
51
  const r = ["left", "right"], o = ["right", "left"], i = ["top", "bottom"], c = ["bottom", "top"];
@@ -60,13 +60,13 @@ function A(t, n, e) {
60
60
  return [];
61
61
  }
62
62
  }
63
- function C(t, n, e, r) {
63
+ function L(t, n, e, r) {
64
64
  const o = g(t);
65
65
  let i = A(f(t), e === "start", r);
66
66
  return o && (i = i.map((c) => c + "-" + o), n && (i = i.concat(i.map(s)))), i;
67
67
  }
68
68
  function u(t) {
69
- return t.replace(/left|right|bottom|top/g, (n) => p[n]);
69
+ return t.replace(/left|right|bottom|top/g, (n) => m[n]);
70
70
  }
71
71
  function y(t) {
72
72
  return {
@@ -77,7 +77,7 @@ function y(t) {
77
77
  ...t
78
78
  };
79
79
  }
80
- function L(t) {
80
+ function E(t) {
81
81
  return typeof t != "number" ? y(t) : {
82
82
  top: t,
83
83
  right: t,
@@ -85,7 +85,7 @@ function L(t) {
85
85
  left: t
86
86
  };
87
87
  }
88
- function E(t) {
88
+ function R(t) {
89
89
  const {
90
90
  x: n,
91
91
  y: e,
@@ -104,24 +104,25 @@ function E(t) {
104
104
  };
105
105
  }
106
106
  export {
107
- M as clamp,
107
+ S as clamp,
108
108
  O as createCoords,
109
- S as evaluate,
109
+ w as evaluate,
110
110
  y as expandPaddingObject,
111
+ M as floor,
111
112
  g as getAlignment,
112
113
  d as getAlignmentAxis,
113
- w as getAlignmentSides,
114
+ j as getAlignmentSides,
114
115
  x as getAxisLength,
115
- j as getExpandedPlacements,
116
+ C as getExpandedPlacements,
116
117
  s as getOppositeAlignmentPlacement,
117
118
  h as getOppositeAxis,
118
- C as getOppositeAxisPlacements,
119
+ L as getOppositeAxisPlacements,
119
120
  u as getOppositePlacement,
120
- L as getPaddingObject,
121
+ E as getPaddingObject,
121
122
  f as getSide,
122
123
  b as getSideAxis,
123
- m as max,
124
+ a as max,
124
125
  l as min,
125
- E as rectToClientRect,
126
+ R as rectToClientRect,
126
127
  P as round
127
128
  };
@@ -0,0 +1,34 @@
1
+ import { noChange as o } from "../lit-html.js";
2
+ import { directive as h, Directive as c, PartType as d } from "../directive.js";
3
+ /**
4
+ * @license
5
+ * Copyright 2018 Google LLC
6
+ * SPDX-License-Identifier: BSD-3-Clause
7
+ */
8
+ const f = h(class extends c {
9
+ constructor(s) {
10
+ var e;
11
+ if (super(s), s.type !== d.ATTRIBUTE || s.name !== "class" || ((e = s.strings) == null ? void 0 : e.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
12
+ }
13
+ render(s) {
14
+ return " " + Object.keys(s).filter((e) => s[e]).join(" ") + " ";
15
+ }
16
+ update(s, [e]) {
17
+ var n, i;
18
+ if (this.st === void 0) {
19
+ this.st = /* @__PURE__ */ new Set(), s.strings !== void 0 && (this.nt = new Set(s.strings.join(" ").split(/\s/).filter((t) => t !== "")));
20
+ for (const t in e) e[t] && !((n = this.nt) != null && n.has(t)) && this.st.add(t);
21
+ return this.render(e);
22
+ }
23
+ const r = s.element.classList;
24
+ for (const t of this.st) t in e || (r.remove(t), this.st.delete(t));
25
+ for (const t in e) {
26
+ const a = !!e[t];
27
+ a === this.st.has(t) || (i = this.nt) != null && i.has(t) || (a ? (r.add(t), this.st.add(t)) : (r.remove(t), this.st.delete(t)));
28
+ }
29
+ return o;
30
+ }
31
+ });
32
+ export {
33
+ f as classMap
34
+ };
@@ -0,0 +1,155 @@
1
+ import "../node_modules/@lit/reactive-element/reactive-element.js";
2
+ import { html as p } from "../node_modules/lit-html/lit-html.js";
3
+ import { LitElement as d } from "../node_modules/lit-element/lit-element.js";
4
+ import { customElement as h } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
5
+ import { property as o } from "../node_modules/@lit/reactive-element/decorators/property.js";
6
+ import { classMap as b } from "../node_modules/lit-html/directives/class-map.js";
7
+ import { css as m } from "../node_modules/@lit/reactive-element/css-tag.js";
8
+ var u = Object.defineProperty, f = Object.getOwnPropertyDescriptor, a = (e, i, c, n) => {
9
+ for (var r = n > 1 ? void 0 : n ? f(i, c) : i, s = e.length - 1, l; s >= 0; s--)
10
+ (l = e[s]) && (r = (n ? l(i, c, r) : l(r)) || r);
11
+ return n && r && u(i, c, r), r;
12
+ };
13
+ let t = class extends d {
14
+ constructor() {
15
+ super(...arguments), this.disabled = !1, this.checked = !1, this.indeterminate = !1, this.onChange = () => {
16
+ }, this.value = "", this.label = "";
17
+ }
18
+ // 1) Manually sync the indeterminate property on the <input>
19
+ updated(e) {
20
+ super.updated(e);
21
+ const i = this.renderRoot.querySelector(
22
+ 'input[type="checkbox"]'
23
+ );
24
+ i && (i.indeterminate = this.indeterminate);
25
+ }
26
+ // 2) Intercept clicks when we're indeterminate
27
+ _onClick(e) {
28
+ this.indeterminate && (e.preventDefault(), this.indeterminate = !1, this._notifyChange(e));
29
+ }
30
+ // 3) Handle the native change event when not indeterminate
31
+ _onChange(e) {
32
+ this.checked = e.target.checked, this._notifyChange(e);
33
+ }
34
+ _notifyChange(e) {
35
+ this.dispatchEvent(
36
+ new CustomEvent("change", {
37
+ bubbles: !0,
38
+ composed: !0,
39
+ detail: e.target.checked
40
+ })
41
+ ), typeof this.onChange == "function" && this.onChange(e);
42
+ }
43
+ render() {
44
+ return p`
45
+ <div class="container">
46
+ ${this.label ? p`
47
+ <lit-label label="${this.label}" ?disabled=${this.disabled}> </lit-label>
48
+ ` : ""}
49
+ <input
50
+ class=${b({
51
+ indeterminate: this.indeterminate,
52
+ marginLeft: this.label !== ""
53
+ })}
54
+ type="checkbox"
55
+ .checked=${this.checked}
56
+ ?disabled=${this.disabled}
57
+ @click=${this._onClick}
58
+ @change=${this._onChange}
59
+ .value=${this.value}
60
+ aria-label="${this.label || "checkbox"}"
61
+ aria-checked="${this.indeterminate ? "mixed" : this.checked ? "true" : "false"}"
62
+ aria-disabled="${this.disabled ? "true" : "false"}"
63
+ />
64
+ </div>
65
+ `;
66
+ }
67
+ };
68
+ t.styles = m`
69
+ :host {
70
+ display: inline-block;
71
+ font-family: Inter, sans-serif;
72
+ }
73
+ .container {
74
+ display: flex;
75
+ flex-direction: column;
76
+ }
77
+ /* Hide the default checkbox */
78
+ .marginLeft {
79
+ margin-left: 0.75rem;
80
+ }
81
+ input[type='checkbox'] {
82
+ position: relative;
83
+ appearance: none;
84
+ width: 20px;
85
+ height: 20px;
86
+ border: 1px solid var(--text-primary, #111827);
87
+ border-radius: 6px;
88
+ display: flex;
89
+ align-items: center;
90
+ justify-content: center;
91
+ background-color: var(--background-paper, #fff);
92
+ transition: all 0.1s ease-in-out;
93
+ cursor: pointer;
94
+ }
95
+
96
+ input[type='checkbox'].indeterminate {
97
+ background-color: var(--color-primary-main, #76b703);
98
+ border-color: var(--color-primary-main, #76b703);
99
+ }
100
+
101
+ input[type='checkbox'].indeterminate::after {
102
+ content: '−';
103
+ color: var(--background-default, #111827);
104
+ font-size: 16px;
105
+ }
106
+
107
+ /* Custom checkmark */
108
+ input[type='checkbox']::after {
109
+ content: '✓';
110
+ color: var(--background-paper, #111827);
111
+ font-size: 16px;
112
+ visible: none;
113
+ }
114
+
115
+ /* Checked state */
116
+ input[type='checkbox']:checked {
117
+ background-color: var(--color-primary-main, #76b703);
118
+ border-color: var(--color-primary-main, #76b703);
119
+ }
120
+
121
+ input[type='checkbox']:checked::after {
122
+ visible: visibility;
123
+ }
124
+
125
+ /* Disabled state */
126
+ input[type='checkbox']:disabled {
127
+ background-color: var(--background-paper, #fff);
128
+ border-color: var(--color-primary-disabled, #d0d3db);
129
+ cursor: not-allowed;
130
+ }
131
+ `;
132
+ a([
133
+ o({ type: Boolean })
134
+ ], t.prototype, "disabled", 2);
135
+ a([
136
+ o({ type: Boolean })
137
+ ], t.prototype, "checked", 2);
138
+ a([
139
+ o({ type: Boolean })
140
+ ], t.prototype, "indeterminate", 2);
141
+ a([
142
+ o({ type: Function })
143
+ ], t.prototype, "onChange", 2);
144
+ a([
145
+ o({ type: String })
146
+ ], t.prototype, "value", 2);
147
+ a([
148
+ o({ type: String })
149
+ ], t.prototype, "label", 2);
150
+ t = a([
151
+ h("lit-checkbox")
152
+ ], t);
153
+ export {
154
+ t as LitCheckbox
155
+ };