@latty-ds/web 0.5.0 → 0.6.0

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.
@@ -266,7 +266,7 @@ var buttonStyles = css`
266
266
  import { html } from "lit";
267
267
  import { customElement, property as property2 } from "lit/decorators.js";
268
268
 
269
- // src/components/spinner/spineer.styles.ts
269
+ // src/components/spinner/spinner.styles.ts
270
270
  import { css as css2 } from "lit";
271
271
  var spinnerStyles = css2`
272
272
  :host {
@@ -1836,7 +1836,9 @@ var Combobox = class extends ThemeableElement {
1836
1836
  const inputWrap = this.shadowRoot.querySelector(".input-wrap");
1837
1837
  const dropdown = this.shadowRoot.querySelector(".dropdown");
1838
1838
  if (inputWrap && dropdown) {
1839
- this._floatingCleanup = await openFloating(inputWrap, dropdown, { matchWidth: true });
1839
+ const cleanup = await openFloating(inputWrap, dropdown, { matchWidth: true });
1840
+ if (this.open) this._floatingCleanup = cleanup;
1841
+ else cleanup();
1840
1842
  }
1841
1843
  }
1842
1844
  closeDropdown() {
@@ -2723,8 +2723,11 @@ var DateInput = class extends ThemeableElement {
2723
2723
  const btn = this.shadowRoot?.querySelector("#field-btn");
2724
2724
  const dropdown = this.shadowRoot?.querySelector(".dropdown");
2725
2725
  if (btn && dropdown) {
2726
- this._floatingCleanup = await openFloating(btn, dropdown);
2726
+ const cleanup = await openFloating(btn, dropdown);
2727
+ if (this._open) this._floatingCleanup = cleanup;
2728
+ else cleanup();
2727
2729
  }
2730
+ if (!this._open) return;
2728
2731
  this._cleanupClickOutside = createClickOutsideHandler(this, () => this._closeDropdown());
2729
2732
  }
2730
2733
  _closeDropdown() {
@@ -1723,7 +1723,8 @@ var Dropdown = class extends ThemeableElement {
1723
1723
  const menu = this.shadowRoot.querySelector("lt-surface.menu");
1724
1724
  if (menu) {
1725
1725
  openFloating(triggerEl, menu, { placement: this.placement }).then((cleanup) => {
1726
- this._floatingCleanup = cleanup;
1726
+ if (this.open) this._floatingCleanup = cleanup;
1727
+ else cleanup();
1727
1728
  });
1728
1729
  }
1729
1730
  requestAnimationFrame(() => this._items()[0]?.focus());
@@ -1766,7 +1767,7 @@ var Dropdown = class extends ThemeableElement {
1766
1767
  popover="manual"
1767
1768
  appearance="outlined"
1768
1769
  elevation="2"
1769
- background-color="--lt-bg-default"
1770
+ background="--lt-bg-default"
1770
1771
  role="menu"
1771
1772
  aria-hidden=${this.open ? "false" : "true"}
1772
1773
  >
@@ -2024,7 +2024,8 @@ var Select = class extends ThemeableElement {
2024
2024
  const selectTrigger = this.shadowRoot.querySelector(".select-trigger");
2025
2025
  const listbox = this.shadowRoot.querySelector("lt-surface.dropdown");
2026
2026
  openFloating(selectTrigger, listbox, { matchWidth: true }).then((cleanup) => {
2027
- this._floatingCleanup = cleanup;
2027
+ if (this.isOpen) this._floatingCleanup = cleanup;
2028
+ else cleanup();
2028
2029
  });
2029
2030
  } else {
2030
2031
  this.removeAttribute("open");
@@ -37,7 +37,7 @@ __decorateClass([
37
37
  // src/components/spinner/spinner.ts
38
38
  import { customElement, property as property2 } from "lit/decorators.js";
39
39
 
40
- // src/components/spinner/spineer.styles.ts
40
+ // src/components/spinner/spinner.styles.ts
41
41
  import { css } from "lit";
42
42
  var spinnerStyles = css`
43
43
  :host {
package/dist/index.cjs CHANGED
@@ -2000,7 +2000,7 @@ var buttonStyles = i`
2000
2000
  }
2001
2001
  `;
2002
2002
 
2003
- // src/components/spinner/spineer.styles.ts
2003
+ // src/components/spinner/spinner.styles.ts
2004
2004
  var spinnerStyles = i`
2005
2005
  :host {
2006
2006
  --lt-spinner-size: var(--lt-spacing-4, 1rem);
@@ -5819,7 +5819,8 @@ var Select = class extends ThemeableElement {
5819
5819
  const selectTrigger = this.shadowRoot.querySelector(".select-trigger");
5820
5820
  const listbox = this.shadowRoot.querySelector("lt-surface.dropdown");
5821
5821
  openFloating(selectTrigger, listbox, { matchWidth: true }).then((cleanup) => {
5822
- this._floatingCleanup = cleanup;
5822
+ if (this.isOpen) this._floatingCleanup = cleanup;
5823
+ else cleanup();
5823
5824
  });
5824
5825
  } else {
5825
5826
  this.removeAttribute("open");
@@ -9228,7 +9229,8 @@ var Dropdown = class extends ThemeableElement {
9228
9229
  const menu = this.shadowRoot.querySelector("lt-surface.menu");
9229
9230
  if (menu) {
9230
9231
  openFloating(triggerEl, menu, { placement: this.placement }).then((cleanup) => {
9231
- this._floatingCleanup = cleanup;
9232
+ if (this.open) this._floatingCleanup = cleanup;
9233
+ else cleanup();
9232
9234
  });
9233
9235
  }
9234
9236
  requestAnimationFrame(() => this._items()[0]?.focus());
@@ -9271,7 +9273,7 @@ var Dropdown = class extends ThemeableElement {
9271
9273
  popover="manual"
9272
9274
  appearance="outlined"
9273
9275
  elevation="2"
9274
- background-color="--lt-bg-default"
9276
+ background="--lt-bg-default"
9275
9277
  role="menu"
9276
9278
  aria-hidden=${this.open ? "false" : "true"}
9277
9279
  >
@@ -11953,8 +11955,11 @@ var DateInput = class extends ThemeableElement {
11953
11955
  const btn = this.shadowRoot?.querySelector("#field-btn");
11954
11956
  const dropdown = this.shadowRoot?.querySelector(".dropdown");
11955
11957
  if (btn && dropdown) {
11956
- this._floatingCleanup = await openFloating(btn, dropdown);
11958
+ const cleanup = await openFloating(btn, dropdown);
11959
+ if (this._open) this._floatingCleanup = cleanup;
11960
+ else cleanup();
11957
11961
  }
11962
+ if (!this._open) return;
11958
11963
  this._cleanupClickOutside = createClickOutsideHandler(this, () => this._closeDropdown());
11959
11964
  }
11960
11965
  _closeDropdown() {
@@ -12330,7 +12335,9 @@ var Combobox = class extends ThemeableElement {
12330
12335
  const inputWrap = this.shadowRoot.querySelector(".input-wrap");
12331
12336
  const dropdown = this.shadowRoot.querySelector(".dropdown");
12332
12337
  if (inputWrap && dropdown) {
12333
- this._floatingCleanup = await openFloating(inputWrap, dropdown, { matchWidth: true });
12338
+ const cleanup = await openFloating(inputWrap, dropdown, { matchWidth: true });
12339
+ if (this.open) this._floatingCleanup = cleanup;
12340
+ else cleanup();
12334
12341
  }
12335
12342
  }
12336
12343
  closeDropdown() {
package/dist/index.d.ts CHANGED
@@ -3,35 +3,10 @@
3
3
  *
4
4
  * A collection of reusable, accessible web components built with Lit.
5
5
  *
6
- * Available components:
7
- * - Accordion: Collapsible content using native details/summary
8
- * - Alert: TODO: describe the Alert component
9
- * - Button: Interactive button with multiple variants and loading states
10
- * - Calendar: TODO: describe the Calendar component
11
- * - Checkbox: Checkbox input with support for indeterminate state
12
- * - ColorInput: TODO: describe the ColorInput component
13
- * - Dialog: Modal dialog with backdrop and accessibility features
14
- * - Dropdown: TODO: describe the Dropdown component
15
- * - Header: TODO: describe the Header component
16
- * - IconButton: Accessible icon-only button with ghost, filled, and outlined appearances
17
- * - Image: TODO: describe the Image component
18
- * - Link: TODO: describe the Link component
19
- * - List: Ordered and unordered lists with customizable marker colors
20
- * - Radio: Radio button for single selection within a group
21
- * - RadioGroup: Container for managing radio button groups
22
- * - Switch: Toggle switch with sliding animation
23
- * - Spinner: Loading indicator with customizable size and color
24
- * - Textfield: Text input with validation states and password toggle
25
- * - Select: Dropdown select with customizable options and variants
26
- * - SidePanel: TODO: describe the SidePanel component
27
- * - Slider: TODO: describe the Slider component
28
- * - Snackbar: TODO: describe the Snackbar component
29
- * - Surface: Container component with elevation and surface styling
30
- * - Tab: Individual tab element for use within tab groups
31
- * - TabGroup: Container for managing tabbed interfaces
32
- * - Table: Data table with sorting and responsive design
33
- * - Text: TODO: describe the Text component
34
- * - Tooltip: Floating label anchored to a trigger element
6
+ * Importing this entry point registers every `lt-*` custom element (see the
7
+ * `export *` list below for the full set). Each component also has its own
8
+ * module under `./components/<name>` for granular imports. Per-component docs
9
+ * live at https://latty-ds and in each component's source JSDoc.
35
10
  *
36
11
  * @packageDocumentation
37
12
  *
package/dist/index.js CHANGED
@@ -695,7 +695,7 @@ var buttonStyles = css3`
695
695
  import { html as html3 } from "lit";
696
696
  import { customElement as customElement3, property as property4 } from "lit/decorators.js";
697
697
 
698
- // src/components/spinner/spineer.styles.ts
698
+ // src/components/spinner/spinner.styles.ts
699
699
  import { css as css4 } from "lit";
700
700
  var spinnerStyles = css4`
701
701
  :host {
@@ -4524,7 +4524,8 @@ var Select = class extends ThemeableElement {
4524
4524
  const selectTrigger = this.shadowRoot.querySelector(".select-trigger");
4525
4525
  const listbox = this.shadowRoot.querySelector("lt-surface.dropdown");
4526
4526
  openFloating(selectTrigger, listbox, { matchWidth: true }).then((cleanup) => {
4527
- this._floatingCleanup = cleanup;
4527
+ if (this.isOpen) this._floatingCleanup = cleanup;
4528
+ else cleanup();
4528
4529
  });
4529
4530
  } else {
4530
4531
  this.removeAttribute("open");
@@ -7899,7 +7900,8 @@ var Dropdown = class extends ThemeableElement {
7899
7900
  const menu = this.shadowRoot.querySelector("lt-surface.menu");
7900
7901
  if (menu) {
7901
7902
  openFloating(triggerEl, menu, { placement: this.placement }).then((cleanup) => {
7902
- this._floatingCleanup = cleanup;
7903
+ if (this.open) this._floatingCleanup = cleanup;
7904
+ else cleanup();
7903
7905
  });
7904
7906
  }
7905
7907
  requestAnimationFrame(() => this._items()[0]?.focus());
@@ -7942,7 +7944,7 @@ var Dropdown = class extends ThemeableElement {
7942
7944
  popover="manual"
7943
7945
  appearance="outlined"
7944
7946
  elevation="2"
7945
- background-color="--lt-bg-default"
7947
+ background="--lt-bg-default"
7946
7948
  role="menu"
7947
7949
  aria-hidden=${this.open ? "false" : "true"}
7948
7950
  >
@@ -10686,8 +10688,11 @@ var DateInput = class extends ThemeableElement {
10686
10688
  const btn = this.shadowRoot?.querySelector("#field-btn");
10687
10689
  const dropdown = this.shadowRoot?.querySelector(".dropdown");
10688
10690
  if (btn && dropdown) {
10689
- this._floatingCleanup = await openFloating(btn, dropdown);
10691
+ const cleanup = await openFloating(btn, dropdown);
10692
+ if (this._open) this._floatingCleanup = cleanup;
10693
+ else cleanup();
10690
10694
  }
10695
+ if (!this._open) return;
10691
10696
  this._cleanupClickOutside = createClickOutsideHandler(this, () => this._closeDropdown());
10692
10697
  }
10693
10698
  _closeDropdown() {
@@ -11068,7 +11073,9 @@ var Combobox = class extends ThemeableElement {
11068
11073
  const inputWrap = this.shadowRoot.querySelector(".input-wrap");
11069
11074
  const dropdown = this.shadowRoot.querySelector(".dropdown");
11070
11075
  if (inputWrap && dropdown) {
11071
- this._floatingCleanup = await openFloating(inputWrap, dropdown, { matchWidth: true });
11076
+ const cleanup = await openFloating(inputWrap, dropdown, { matchWidth: true });
11077
+ if (this.open) this._floatingCleanup = cleanup;
11078
+ else cleanup();
11072
11079
  }
11073
11080
  }
11074
11081
  closeDropdown() {
@@ -200,6 +200,64 @@
200
200
  }
201
201
  ]
202
202
  },
203
+ "lt-alert": {
204
+ "members": [
205
+ {
206
+ "name": "variant",
207
+ "description": "Visual style.",
208
+ "type": "select",
209
+ "options": [
210
+ "default",
211
+ "success",
212
+ "warning",
213
+ "error",
214
+ "info"
215
+ ],
216
+ "default": "default"
217
+ },
218
+ {
219
+ "name": "appearance",
220
+ "description": "Visual treatment. `filled` uses a tinted background with border, `outlined` uses a white background with border, `solid` uses a solid color background with no border.",
221
+ "type": "select",
222
+ "options": [
223
+ "filled",
224
+ "outlined",
225
+ "solid"
226
+ ],
227
+ "default": "filled"
228
+ },
229
+ {
230
+ "name": "title",
231
+ "description": "Optional bold heading above the body content.",
232
+ "type": "text",
233
+ "default": ""
234
+ },
235
+ {
236
+ "name": "icon",
237
+ "description": "Icon to show before the body. Leave empty for auto (shows variant icon for status variants),\nset to `\"none\"` to suppress, or pass any icon name to override.",
238
+ "type": "icon",
239
+ "default": ""
240
+ },
241
+ {
242
+ "name": "closable",
243
+ "description": "Show a dismiss button. Clicking it fires lt-close and removes the element.",
244
+ "type": "boolean",
245
+ "default": false
246
+ },
247
+ {
248
+ "name": "background",
249
+ "description": "Background color override. Accepts a hex value (#1a1a2e) or a CSS token name (--lt-color-primary-600).",
250
+ "type": "color",
251
+ "default": ""
252
+ },
253
+ {
254
+ "name": "uppercase",
255
+ "description": "Renders the title in small caps with wider letter spacing.",
256
+ "type": "boolean",
257
+ "default": false
258
+ }
259
+ ]
260
+ },
203
261
  "lt-avatar": {
204
262
  "members": [
205
263
  {
@@ -260,64 +318,6 @@
260
318
  }
261
319
  ]
262
320
  },
263
- "lt-alert": {
264
- "members": [
265
- {
266
- "name": "variant",
267
- "description": "Visual style.",
268
- "type": "select",
269
- "options": [
270
- "default",
271
- "success",
272
- "warning",
273
- "error",
274
- "info"
275
- ],
276
- "default": "default"
277
- },
278
- {
279
- "name": "appearance",
280
- "description": "Visual treatment. `filled` uses a tinted background with border, `outlined` uses a white background with border, `solid` uses a solid color background with no border.",
281
- "type": "select",
282
- "options": [
283
- "filled",
284
- "outlined",
285
- "solid"
286
- ],
287
- "default": "filled"
288
- },
289
- {
290
- "name": "title",
291
- "description": "Optional bold heading above the body content.",
292
- "type": "text",
293
- "default": ""
294
- },
295
- {
296
- "name": "icon",
297
- "description": "Icon to show before the body. Leave empty for auto (shows variant icon for status variants),\nset to `\"none\"` to suppress, or pass any icon name to override.",
298
- "type": "icon",
299
- "default": ""
300
- },
301
- {
302
- "name": "closable",
303
- "description": "Show a dismiss button. Clicking it fires lt-close and removes the element.",
304
- "type": "boolean",
305
- "default": false
306
- },
307
- {
308
- "name": "background",
309
- "description": "Background color override. Accepts a hex value (#1a1a2e) or a CSS token name (--lt-color-primary-600).",
310
- "type": "color",
311
- "default": ""
312
- },
313
- {
314
- "name": "uppercase",
315
- "description": "Renders the title in small caps with wider letter spacing.",
316
- "type": "boolean",
317
- "default": false
318
- }
319
- ]
320
- },
321
321
  "lt-badge": {
322
322
  "members": [
323
323
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latty-ds/web",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Web Components for the Latty design system — framework-agnostic UI components built with Lit",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -8,7 +8,7 @@
8
8
  "url": "https://github.com/penhold3r/latty-ds.git",
9
9
  "directory": "packages/web"
10
10
  },
11
- "homepage": "https://penhold3r.github.io/latty-ds",
11
+ "homepage": "https://latty-ds.com",
12
12
  "keywords": [
13
13
  "design-system",
14
14
  "web-components",
@@ -224,8 +224,8 @@
224
224
  },
225
225
  "dependencies": {
226
226
  "@floating-ui/dom": "^1.7.6",
227
- "@latty-ds/icons": "0.5.0"
227
+ "@latty-ds/icons": "0.6.0"
228
228
  },
229
229
  "customElements": "custom-elements.json",
230
- "gitHead": "e2fcd96cf67d8f9780970cbd16fd96a3e3915995"
230
+ "gitHead": "5f2e9dbee20f32bc24117a40f8f2f65a4de07979"
231
231
  }