@ucalgary-design-system/chip-group 1.0.2 → 1.0.3

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 (3) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/index.js +78 -73
  3. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @ucalgary-design-system/chip-group
2
2
 
3
+ ## 1.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - c3fdd31: Updated dependencies and modified build
8
+ - Updated dependencies [386b04a]
9
+ - Updated dependencies [c3fdd31]
10
+ - @ucalgary-design-system/icon@1.0.3
11
+ - @ucalgary-design-system/core@1.0.3
12
+
3
13
  ## 1.0.2
4
14
 
5
15
  ### Patch Changes
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { unsafeCSS as C, html as U } from "lit";
2
- import { BaseElement as v } from "@ucalgary-design-system/core";
1
+ import { unsafeCSS as C, html as O } from "lit";
2
+ import { BaseElement as b } from "@ucalgary-design-system/core";
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2017 Google LLC
6
6
  * SPDX-License-Identifier: BSD-3-Clause
7
7
  */
8
- const O = (r) => (t, e) => {
8
+ const U = (r) => (t, e) => {
9
9
  e !== void 0 ? e.addInitializer(() => {
10
10
  customElements.define(r, t);
11
11
  }) : customElements.define(r, t);
@@ -15,18 +15,18 @@ const O = (r) => (t, e) => {
15
15
  * Copyright 2019 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
17
  */
18
- const d = globalThis, m = d.ShadowRoot && (d.ShadyCSS === void 0 || d.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, b = Symbol(), _ = /* @__PURE__ */ new WeakMap();
18
+ const u = globalThis, y = u.ShadowRoot && (u.ShadyCSS === void 0 || u.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, g = Symbol(), E = /* @__PURE__ */ new WeakMap();
19
19
  let A = class {
20
20
  constructor(t, e, s) {
21
- if (this._$cssResult$ = !0, s !== b) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
21
+ if (this._$cssResult$ = !0, s !== g) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
22
22
  this.cssText = t, this.t = e;
23
23
  }
24
24
  get styleSheet() {
25
25
  let t = this.o;
26
26
  const e = this.t;
27
- if (m && t === void 0) {
27
+ if (y && t === void 0) {
28
28
  const s = e !== void 0 && e.length === 1;
29
- s && (t = _.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && _.set(e, t));
29
+ s && (t = E.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && E.set(e, t));
30
30
  }
31
31
  return t;
32
32
  }
@@ -34,13 +34,13 @@ let A = class {
34
34
  return this.cssText;
35
35
  }
36
36
  };
37
- const R = (r) => new A(typeof r == "string" ? r : r + "", void 0, b), x = (r, t) => {
38
- if (m) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
37
+ const R = (r) => new A(typeof r == "string" ? r : r + "", void 0, g), x = (r, t) => {
38
+ if (y) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
39
39
  else for (const e of t) {
40
- const s = document.createElement("style"), i = d.litNonce;
40
+ const s = document.createElement("style"), i = u.litNonce;
41
41
  i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
42
42
  }
43
- }, E = m ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
43
+ }, $ = y ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
44
44
  let e = "";
45
45
  for (const s of t.cssRules) e += s.cssText;
46
46
  return R(e);
@@ -50,10 +50,10 @@ const R = (r) => new A(typeof r == "string" ? r : r + "", void 0, b), x = (r, t)
50
50
  * Copyright 2017 Google LLC
51
51
  * SPDX-License-Identifier: BSD-3-Clause
52
52
  */
53
- const { is: M, defineProperty: k, getOwnPropertyDescriptor: z, getOwnPropertyNames: T, getOwnPropertySymbols: j, getPrototypeOf: L } = Object, a = globalThis, $ = a.trustedTypes, N = $ ? $.emptyScript : "", u = a.reactiveElementPolyfillSupport, l = (r, t) => r, f = { toAttribute(r, t) {
53
+ const { is: M, defineProperty: j, getOwnPropertyDescriptor: k, getOwnPropertyNames: z, getOwnPropertySymbols: T, getPrototypeOf: L } = Object, h = globalThis, S = h.trustedTypes, D = S ? S.emptyScript : "", m = h.reactiveElementPolyfillSupport, d = (r, t) => r, _ = { toAttribute(r, t) {
54
54
  switch (t) {
55
55
  case Boolean:
56
- r = r ? N : null;
56
+ r = r ? D : null;
57
57
  break;
58
58
  case Object:
59
59
  case Array:
@@ -78,46 +78,44 @@ const { is: M, defineProperty: k, getOwnPropertyDescriptor: z, getOwnPropertyNam
78
78
  }
79
79
  }
80
80
  return e;
81
- } }, g = (r, t) => !M(r, t), S = { attribute: !0, type: String, converter: f, reflect: !1, hasChanged: g };
82
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), a.litPropertyMetadata ?? (a.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
83
- class c extends HTMLElement {
81
+ } }, w = (r, t) => !M(r, t), v = { attribute: !0, type: String, converter: _, reflect: !1, useDefault: !1, hasChanged: w };
82
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), h.litPropertyMetadata ?? (h.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
83
+ class l extends HTMLElement {
84
84
  static addInitializer(t) {
85
85
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
86
86
  }
87
87
  static get observedAttributes() {
88
88
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
89
89
  }
90
- static createProperty(t, e = S) {
91
- if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
90
+ static createProperty(t, e = v) {
91
+ if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
92
92
  const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
93
- i !== void 0 && k(this.prototype, t, i);
93
+ i !== void 0 && j(this.prototype, t, i);
94
94
  }
95
95
  }
96
96
  static getPropertyDescriptor(t, e, s) {
97
- const { get: i, set: n } = z(this.prototype, t) ?? { get() {
97
+ const { get: i, set: o } = k(this.prototype, t) ?? { get() {
98
98
  return this[e];
99
- }, set(o) {
100
- this[e] = o;
99
+ }, set(n) {
100
+ this[e] = n;
101
101
  } };
102
- return { get() {
103
- return i == null ? void 0 : i.call(this);
104
- }, set(o) {
105
- const h = i == null ? void 0 : i.call(this);
106
- n.call(this, o), this.requestUpdate(t, h, s);
102
+ return { get: i, set(n) {
103
+ const a = i == null ? void 0 : i.call(this);
104
+ o == null || o.call(this, n), this.requestUpdate(t, a, s);
107
105
  }, configurable: !0, enumerable: !0 };
108
106
  }
109
107
  static getPropertyOptions(t) {
110
- return this.elementProperties.get(t) ?? S;
108
+ return this.elementProperties.get(t) ?? v;
111
109
  }
112
110
  static _$Ei() {
113
- if (this.hasOwnProperty(l("elementProperties"))) return;
111
+ if (this.hasOwnProperty(d("elementProperties"))) return;
114
112
  const t = L(this);
115
113
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
116
114
  }
117
115
  static finalize() {
118
- if (this.hasOwnProperty(l("finalized"))) return;
119
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(l("properties"))) {
120
- const e = this.properties, s = [...T(e), ...j(e)];
116
+ if (this.hasOwnProperty(d("finalized"))) return;
117
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(d("properties"))) {
118
+ const e = this.properties, s = [...z(e), ...T(e)];
121
119
  for (const i of s) this.createProperty(i, e[i]);
122
120
  }
123
121
  const t = this[Symbol.metadata];
@@ -136,8 +134,8 @@ class c extends HTMLElement {
136
134
  const e = [];
137
135
  if (Array.isArray(t)) {
138
136
  const s = new Set(t.flat(1 / 0).reverse());
139
- for (const i of s) e.unshift(E(i));
140
- } else t !== void 0 && e.push(E(t));
137
+ for (const i of s) e.unshift($(i));
138
+ } else t !== void 0 && e.push($(t));
141
139
  return e;
142
140
  }
143
141
  static _$Eu(t, e) {
@@ -187,33 +185,37 @@ class c extends HTMLElement {
187
185
  attributeChangedCallback(t, e, s) {
188
186
  this._$AK(t, s);
189
187
  }
190
- _$EC(t, e) {
191
- var n;
188
+ _$ET(t, e) {
189
+ var o;
192
190
  const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
193
191
  if (i !== void 0 && s.reflect === !0) {
194
- const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : f).toAttribute(e, s.type);
195
- this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
192
+ const n = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter : _).toAttribute(e, s.type);
193
+ this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
196
194
  }
197
195
  }
198
196
  _$AK(t, e) {
199
- var n;
197
+ var o, n;
200
198
  const s = this.constructor, i = s._$Eh.get(t);
201
199
  if (i !== void 0 && this._$Em !== i) {
202
- const o = s.getPropertyOptions(i), h = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : f;
203
- this._$Em = i, this[i] = h.fromAttribute(e, o.type), this._$Em = null;
200
+ const a = s.getPropertyOptions(i), c = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((o = a.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? a.converter : _;
201
+ this._$Em = i;
202
+ const p = c.fromAttribute(e, a.type);
203
+ this[i] = p ?? ((n = this._$Ej) == null ? void 0 : n.get(i)) ?? p, this._$Em = null;
204
204
  }
205
205
  }
206
206
  requestUpdate(t, e, s) {
207
+ var i;
207
208
  if (t !== void 0) {
208
- if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? g)(this[t], e)) return;
209
- this.P(t, e, s);
209
+ const o = this.constructor, n = this[t];
210
+ if (s ?? (s = o.getPropertyOptions(t)), !((s.hasChanged ?? w)(n, e) || s.useDefault && s.reflect && n === ((i = this._$Ej) == null ? void 0 : i.get(t)) && !this.hasAttribute(o._$Eu(t, s)))) return;
211
+ this.C(t, e, s);
210
212
  }
211
- this.isUpdatePending === !1 && (this._$ES = this._$ET());
213
+ this.isUpdatePending === !1 && (this._$ES = this._$EP());
212
214
  }
213
- P(t, e, s) {
214
- this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
215
+ C(t, e, { useDefault: s, reflect: i, wrapped: o }, n) {
216
+ s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
215
217
  }
216
- async _$ET() {
218
+ async _$EP() {
217
219
  this.isUpdatePending = !0;
218
220
  try {
219
221
  await this._$ES;
@@ -231,21 +233,24 @@ class c extends HTMLElement {
231
233
  if (!this.isUpdatePending) return;
232
234
  if (!this.hasUpdated) {
233
235
  if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
234
- for (const [n, o] of this._$Ep) this[n] = o;
236
+ for (const [o, n] of this._$Ep) this[o] = n;
235
237
  this._$Ep = void 0;
236
238
  }
237
239
  const i = this.constructor.elementProperties;
238
- if (i.size > 0) for (const [n, o] of i) o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], o);
240
+ if (i.size > 0) for (const [o, n] of i) {
241
+ const { wrapped: a } = n, c = this[o];
242
+ a !== !0 || this._$AL.has(o) || c === void 0 || this.C(o, void 0, n, c);
243
+ }
239
244
  }
240
245
  let t = !1;
241
246
  const e = this._$AL;
242
247
  try {
243
248
  t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
244
- var n;
245
- return (n = i.hostUpdate) == null ? void 0 : n.call(i);
246
- }), this.update(e)) : this._$EU();
249
+ var o;
250
+ return (o = i.hostUpdate) == null ? void 0 : o.call(i);
251
+ }), this.update(e)) : this._$EM();
247
252
  } catch (i) {
248
- throw t = !1, this._$EU(), i;
253
+ throw t = !1, this._$EM(), i;
249
254
  }
250
255
  t && this._$AE(e);
251
256
  }
@@ -258,7 +263,7 @@ class c extends HTMLElement {
258
263
  return (i = s.hostUpdated) == null ? void 0 : i.call(s);
259
264
  }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
260
265
  }
261
- _$EU() {
266
+ _$EM() {
262
267
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
263
268
  }
264
269
  get updateComplete() {
@@ -271,20 +276,20 @@ class c extends HTMLElement {
271
276
  return !0;
272
277
  }
273
278
  update(t) {
274
- this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
279
+ this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM();
275
280
  }
276
281
  updated(t) {
277
282
  }
278
283
  firstUpdated(t) {
279
284
  }
280
285
  }
281
- c.elementStyles = [], c.shadowRootOptions = { mode: "open" }, c[l("elementProperties")] = /* @__PURE__ */ new Map(), c[l("finalized")] = /* @__PURE__ */ new Map(), u == null || u({ ReactiveElement: c }), (a.reactiveElementVersions ?? (a.reactiveElementVersions = [])).push("2.0.4");
286
+ l.elementStyles = [], l.shadowRootOptions = { mode: "open" }, l[d("elementProperties")] = /* @__PURE__ */ new Map(), l[d("finalized")] = /* @__PURE__ */ new Map(), m == null || m({ ReactiveElement: l }), (h.reactiveElementVersions ?? (h.reactiveElementVersions = [])).push("2.1.1");
282
287
  /**
283
288
  * @license
284
289
  * Copyright 2017 Google LLC
285
290
  * SPDX-License-Identifier: BSD-3-Clause
286
291
  */
287
- const D = (r, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(r, t, e), e);
292
+ const N = (r, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(r, t, e), e);
288
293
  /**
289
294
  * @license
290
295
  * Copyright 2021 Google LLC
@@ -292,21 +297,21 @@ const D = (r, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate
292
297
  */
293
298
  function q(r) {
294
299
  return (t, e) => {
295
- const { slot: s, selector: i } = {}, n = "slot" + (s ? `[name=${s}]` : ":not([name])");
296
- return D(t, e, { get() {
297
- var y;
298
- const o = (y = this.renderRoot) == null ? void 0 : y.querySelector(n), h = (o == null ? void 0 : o.assignedElements(r)) ?? [];
299
- return i === void 0 ? h : h.filter((w) => w.matches(i));
300
+ const { slot: s, selector: i } = {}, o = "slot" + (s ? `[name=${s}]` : ":not([name])");
301
+ return N(t, e, { get() {
302
+ var c;
303
+ const n = (c = this.renderRoot) == null ? void 0 : c.querySelector(o), a = (n == null ? void 0 : n.assignedElements(r)) ?? [];
304
+ return i === void 0 ? a : a.filter((p) => p.matches(i));
300
305
  } });
301
306
  };
302
307
  }
303
308
  const B = ":host{display:block}.chip-group{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:16px}";
304
309
  var H = Object.defineProperty, I = Object.getOwnPropertyDescriptor, P = (r, t, e, s) => {
305
- for (var i = s > 1 ? void 0 : s ? I(t, e) : t, n = r.length - 1, o; n >= 0; n--)
306
- (o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
310
+ for (var i = s > 1 ? void 0 : s ? I(t, e) : t, o = r.length - 1, n; o >= 0; o--)
311
+ (n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i);
307
312
  return s && i && H(t, e, i), i;
308
313
  };
309
- let p = class extends v {
314
+ let f = class extends b {
310
315
  // Focus the next sibling of the Chip being removed.
311
316
  _focusNextSiblingOf(r) {
312
317
  const t = this._defaultSlotNodes, e = t.indexOf(r);
@@ -327,23 +332,23 @@ let p = class extends v {
327
332
  super.disconnectedCallback && super.disconnectedCallback(), this.removeEventListener("chipRemoved", this._onChildRemove);
328
333
  }
329
334
  render() {
330
- return U`
335
+ return O`
331
336
  <div class="chip-group">
332
337
  <slot></slot>
333
338
  </div>
334
339
  `;
335
340
  }
336
341
  };
337
- p.styles = [
338
- v.styles,
342
+ f.styles = [
343
+ b.styles,
339
344
  C(B)
340
345
  ];
341
346
  P([
342
347
  q()
343
- ], p.prototype, "_defaultSlotNodes", 2);
344
- p = P([
345
- O("ucds-chip-group")
346
- ], p);
348
+ ], f.prototype, "_defaultSlotNodes", 2);
349
+ f = P([
350
+ U("ucds-chip-group")
351
+ ], f);
347
352
  export {
348
- p as ChipGroup
353
+ f as ChipGroup
349
354
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucalgary-design-system/chip-group",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -10,9 +10,10 @@
10
10
  "require": "./index.js"
11
11
  }
12
12
  },
13
- "dependencies": {
14
- "@ucalgary-design-system/core": "^1.0.2",
13
+ "peerDependencies": {
14
+ "@ucalgary-design-system/core": "^1.0.3",
15
15
  "@ucalgary-design-system/tokens": "^1.0.3",
16
+ "@ucalgary-design-system/icon": "^1.0.3",
16
17
  "lit": "^3.2.1"
17
18
  },
18
19
  "description": "A web component for ChipGroup",