@threadlabs/looma 0.1.2 → 0.1.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 (52) hide show
  1. package/dist/{chunk-YK4MTZGJ.js → chunk-UDP2LUZ2.js} +26 -26
  2. package/dist/cjs/ui-button.cjs.entry.js +3 -4
  3. package/dist/collection/components/ui-button/ui-button.css +22 -12
  4. package/dist/collection/components/ui-button/ui-button.js +7 -7
  5. package/dist/components/ui-button.js +1 -1
  6. package/dist/esm/ui-button.entry.js +3 -4
  7. package/dist/index.cjs +3 -4
  8. package/dist/index.js +1 -1
  9. package/dist/looma/looma.esm.js +1 -1
  10. package/dist/looma/p-5717a4c4.entry.js +1 -0
  11. package/dist/types/components/ui-button/ui-button.d.ts +1 -1
  12. package/dist/types/components.d.ts +9 -3
  13. package/dist/{ui-avatar-group.entry-BZGXBOSE.js → ui-avatar-group.entry-VDMJ7TD3.js} +1 -1
  14. package/dist/{ui-avatar.entry-S2O2W5SA.js → ui-avatar.entry-OV25NM66.js} +1 -1
  15. package/dist/{ui-badge.entry-CVJDISCR.js → ui-badge.entry-MX66BWUJ.js} +1 -1
  16. package/dist/ui-button.entry-UCVR22M7.js +71 -0
  17. package/dist/{ui-checkbox.entry-5RA2CB43.js → ui-checkbox.entry-KL47EXSZ.js} +1 -1
  18. package/dist/{ui-context-menu.entry-UUOCT75F.js → ui-context-menu.entry-677NGG3Q.js} +1 -1
  19. package/dist/{ui-dialog.entry-OEPJTEES.js → ui-dialog.entry-WZIIRD4O.js} +1 -1
  20. package/dist/{ui-disclosure.entry-LRRISGUD.js → ui-disclosure.entry-Z7LSLWFL.js} +1 -1
  21. package/dist/{ui-floating-action-button.entry-7TSAZRXP.js → ui-floating-action-button.entry-ZDMXBJVC.js} +1 -1
  22. package/dist/{ui-form-field.entry-73YOVICF.js → ui-form-field.entry-DZSNUUXG.js} +1 -1
  23. package/dist/{ui-icon-button.entry-MNXGPG36.js → ui-icon-button.entry-QKEQNOKJ.js} +1 -1
  24. package/dist/{ui-input.entry-UWRVAOSW.js → ui-input.entry-BI74QOJP.js} +1 -1
  25. package/dist/{ui-menu-item.entry-5AOJO5MP.js → ui-menu-item.entry-GB462MWK.js} +1 -1
  26. package/dist/{ui-menu.entry-YDS6UMB5.js → ui-menu.entry-RUJ5XZ7Y.js} +1 -1
  27. package/dist/{ui-popover.entry-PGWDCQIX.js → ui-popover.entry-QW26NSSB.js} +1 -1
  28. package/dist/{ui-radio-group.entry-RHP5GNWU.js → ui-radio-group.entry-LC2BSS35.js} +1 -1
  29. package/dist/{ui-radio.entry-5WRWPSTK.js → ui-radio.entry-2RQD4K5L.js} +1 -1
  30. package/dist/{ui-search-result-row.entry-IKJB2SJJ.js → ui-search-result-row.entry-BAHYKCAZ.js} +1 -1
  31. package/dist/{ui-search-shell.entry-ZIWF4ZHH.js → ui-search-shell.entry-PW2AF6HX.js} +1 -1
  32. package/dist/{ui-select.entry-N5TIKHR7.js → ui-select.entry-NHWCGJQH.js} +1 -1
  33. package/dist/{ui-switch.entry-WUSZTXIR.js → ui-switch.entry-76KOUHCH.js} +1 -1
  34. package/dist/{ui-tabs.entry-UFAVAQIF.js → ui-tabs.entry-5PZGTNKM.js} +1 -1
  35. package/dist/{ui-textarea.entry-BYT47RAQ.js → ui-textarea.entry-IQHQHO3L.js} +1 -1
  36. package/dist/{ui-toast-region.entry-6UYR3ZU2.js → ui-toast-region.entry-2LT2RTPJ.js} +1 -1
  37. package/dist/{ui-tooltip.entry-YS7UX4FS.js → ui-tooltip.entry-42V5BSUT.js} +1 -1
  38. package/dist/{ui-top-bar.entry-V27H6NFO.js → ui-top-bar.entry-UZTSRNFZ.js} +1 -1
  39. package/editor/{chunk-PQAV4KXC.js → chunk-CWCXYQMT.js} +4 -4
  40. package/editor/index.js +1 -1
  41. package/editor/ui.js +1 -1
  42. package/editor.css +68 -24
  43. package/package.json +1 -1
  44. package/styles.css +18 -13
  45. package/theme-dark.css +6 -6
  46. package/theme-light.css +3 -3
  47. package/tokens.css +16 -16
  48. package/vue/{chunk-J4UBEIIL.js → chunk-P72L3GWE.js} +1 -0
  49. package/vue/editor/index.js +1 -1
  50. package/vue/index.js +1 -1
  51. package/dist/looma/p-fa4659c4.entry.js +0 -1
  52. package/dist/ui-button.entry-LNJBEJFE.js +0 -72
@@ -65,6 +65,7 @@ function createAdapterComponent(tagName, displayName, additionalEventBindings =
65
65
  return h(
66
66
  tagName,
67
67
  {
68
+ "data-allow-mismatch": forwardedAttrs["data-allow-mismatch"] ?? "class",
68
69
  ...forwardedAttrs,
69
70
  ref: (value) => {
70
71
  elementRef.value = toHTMLElement(value);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createAdapterComponent,
3
3
  toHTMLElement
4
- } from "../chunk-J4UBEIIL.js";
4
+ } from "../chunk-P72L3GWE.js";
5
5
 
6
6
  // src/editor/index.ts
7
7
  import "@threadlabs/looma/editor";
package/vue/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createAdapterComponent
3
- } from "./chunk-J4UBEIIL.js";
3
+ } from "./chunk-P72L3GWE.js";
4
4
 
5
5
  // src/index.ts
6
6
  import "@threadlabs/looma/layout";
@@ -1 +0,0 @@
1
- import{r as t,g as o,h as a,H as r}from"./p-CEeiinfk.js";import{i as e}from"./p-JwSoedEO.js";const i=class{constructor(o){t(this,o)}get host(){return o(this)}variant;size;disabled=!1;slotRef;syncToButton(){const t=this.getButton();t&&(this.host.dataset.variant=this.variant||"",this.host.dataset.size=this.size||"",this.host.dataset.disabled=this.disabled?"true":"",t.disabled=this.disabled)}componentDidLoad(){this.slotRef?.addEventListener("slotchange",(()=>this.syncToButton())),this.syncToButton()}componentDidUpdate(){this.syncToButton()}getButton(){const t=this.host.shadowRoot?.querySelector("slot");return(t?.assignedElements()??Array.from(this.host.children)).find((t=>"BUTTON"===t.tagName))??null}onKeydown=t=>{this.getButton()||this.disabled||!e(t)||(t.preventDefault(),this.host.click())};render(){return a(r,{key:"01011aa13228b9e8d10ed11b99c95ef1df91326d","data-variant":this.variant||void 0,"data-size":this.size||void 0,"data-disabled":this.disabled?"":void 0,onKeyDown:this.onKeydown},a("slot",{key:"2bf0274d2732ea46fdf016a46d85bbe6e0d96bba",ref:t=>this.slotRef=t}))}static get watchers(){return{variant:[{syncToButton:0}],size:[{syncToButton:0}],disabled:[{syncToButton:0}]}}};i.style=":host{display:inline-flex;vertical-align:middle;color:var(--ui-text-primary)}::slotted(button){appearance:none;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-default);color:inherit;font:inherit;font-weight:var(--ui-font-medium, 500);line-height:var(--ui-line-height-tight);padding:var(--ui-space-2) var(--ui-space-3);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), border-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease);margin:0}:host([data-size='sm'])::slotted(button){padding:var(--ui-space-1) var(--ui-space-2);font-size:0.875rem}:host([data-size='lg'])::slotted(button){padding:var(--ui-space-3) var(--ui-space-4);font-size:1rem}::slotted(button:hover:enabled){background:var(--ui-surface-muted);border-color:var(--ui-border-strong)}::slotted(button:active:enabled){background:var(--ui-surface-subtle)}:host([data-variant='solid'])::slotted(button){border-color:var(--ui-accent-solid);background:var(--ui-accent-solid);color:var(--ui-text-on-accent);box-shadow:var(--ui-shadow-xs)}:host([data-variant='solid'])::slotted(button:hover:enabled){background:var(--ui-accent-hover);border-color:var(--ui-accent-hover);box-shadow:var(--ui-shadow-sm)}:host([data-variant='solid'])::slotted(button:active:enabled){background:var(--ui-accent-active);border-color:var(--ui-accent-active);box-shadow:none}:host([data-variant='destructive'])::slotted(button){border-color:var(--ui-danger-solid);background:var(--ui-danger-solid);color:var(--ui-text-on-accent);box-shadow:var(--ui-shadow-xs)}:host([data-variant='destructive'])::slotted(button:hover:enabled){background:var(--ui-danger-hover);border-color:var(--ui-danger-hover);box-shadow:var(--ui-shadow-sm)}:host([data-variant='ghost'])::slotted(button){border-color:transparent;background:transparent}:host([data-variant='ghost'])::slotted(button:hover:enabled){background:var(--ui-surface-muted);border-color:transparent}:host([data-variant='ghost'])::slotted(button:active:enabled){background:var(--ui-surface-subtle);border-color:transparent}::slotted(button:focus-visible){outline:2px solid var(--ui-focus-ring);outline-offset:2px}::slotted(button:disabled),:host([data-disabled]){opacity:0.6;cursor:not-allowed}";export{i as ui_button}
@@ -1,72 +0,0 @@
1
- import {
2
- isActivationKey
3
- } from "./chunk-UL7UIUJZ.js";
4
- import {
5
- Host,
6
- getElement,
7
- h,
8
- registerInstance
9
- } from "./chunk-YK4MTZGJ.js";
10
-
11
- // dist/esm/ui-button.entry.js
12
- var uiButtonCss = () => `:host{display:inline-flex;vertical-align:middle;color:var(--ui-text-primary)}::slotted(button){appearance:none;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-default);color:inherit;font:inherit;font-weight:var(--ui-font-medium, 500);line-height:var(--ui-line-height-tight);padding:var(--ui-space-2) var(--ui-space-3);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), border-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease);margin:0}:host([data-size='sm'])::slotted(button){padding:var(--ui-space-1) var(--ui-space-2);font-size:0.875rem}:host([data-size='lg'])::slotted(button){padding:var(--ui-space-3) var(--ui-space-4);font-size:1rem}::slotted(button:hover:enabled){background:var(--ui-surface-muted);border-color:var(--ui-border-strong)}::slotted(button:active:enabled){background:var(--ui-surface-subtle)}:host([data-variant='solid'])::slotted(button){border-color:var(--ui-accent-solid);background:var(--ui-accent-solid);color:var(--ui-text-on-accent);box-shadow:var(--ui-shadow-xs)}:host([data-variant='solid'])::slotted(button:hover:enabled){background:var(--ui-accent-hover);border-color:var(--ui-accent-hover);box-shadow:var(--ui-shadow-sm)}:host([data-variant='solid'])::slotted(button:active:enabled){background:var(--ui-accent-active);border-color:var(--ui-accent-active);box-shadow:none}:host([data-variant='destructive'])::slotted(button){border-color:var(--ui-danger-solid);background:var(--ui-danger-solid);color:var(--ui-text-on-accent);box-shadow:var(--ui-shadow-xs)}:host([data-variant='destructive'])::slotted(button:hover:enabled){background:var(--ui-danger-hover);border-color:var(--ui-danger-hover);box-shadow:var(--ui-shadow-sm)}:host([data-variant='ghost'])::slotted(button){border-color:transparent;background:transparent}:host([data-variant='ghost'])::slotted(button:hover:enabled){background:var(--ui-surface-muted);border-color:transparent}:host([data-variant='ghost'])::slotted(button:active:enabled){background:var(--ui-surface-subtle);border-color:transparent}::slotted(button:focus-visible){outline:2px solid var(--ui-focus-ring);outline-offset:2px}::slotted(button:disabled),:host([data-disabled]){opacity:0.6;cursor:not-allowed}`;
13
- var UIButton = class {
14
- constructor(hostRef) {
15
- registerInstance(this, hostRef);
16
- }
17
- get host() {
18
- return getElement(this);
19
- }
20
- variant;
21
- size;
22
- disabled = false;
23
- slotRef;
24
- syncToButton() {
25
- const btn = this.getButton();
26
- if (!btn)
27
- return;
28
- this.host.dataset.variant = this.variant || "";
29
- this.host.dataset.size = this.size || "";
30
- this.host.dataset.disabled = this.disabled ? "true" : "";
31
- btn.disabled = this.disabled;
32
- }
33
- componentDidLoad() {
34
- this.slotRef?.addEventListener("slotchange", () => this.syncToButton());
35
- this.syncToButton();
36
- }
37
- componentDidUpdate() {
38
- this.syncToButton();
39
- }
40
- getButton() {
41
- const slot = this.host.shadowRoot?.querySelector("slot");
42
- const nodes = slot?.assignedElements() ?? Array.from(this.host.children);
43
- return nodes.find((el) => el.tagName === "BUTTON") ?? null;
44
- }
45
- onKeydown = (e) => {
46
- const btn = this.getButton();
47
- if (btn || this.disabled || !isActivationKey(e))
48
- return;
49
- e.preventDefault();
50
- this.host.click();
51
- };
52
- render() {
53
- return h(Host, { key: "01011aa13228b9e8d10ed11b99c95ef1df91326d", "data-variant": this.variant || void 0, "data-size": this.size || void 0, "data-disabled": this.disabled ? "" : void 0, onKeyDown: this.onKeydown }, h("slot", { key: "2bf0274d2732ea46fdf016a46d85bbe6e0d96bba", ref: (el) => this.slotRef = el }));
54
- }
55
- static get watchers() {
56
- return {
57
- "variant": [{
58
- "syncToButton": 0
59
- }],
60
- "size": [{
61
- "syncToButton": 0
62
- }],
63
- "disabled": [{
64
- "syncToButton": 0
65
- }]
66
- };
67
- }
68
- };
69
- UIButton.style = uiButtonCss();
70
- export {
71
- UIButton as ui_button
72
- };