@melodicdev/components 1.0.3 → 1.0.5

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.
package/README.md CHANGED
@@ -26,7 +26,7 @@ Add a single `<link>` tag to your HTML. It includes design tokens (light + dark
26
26
  > **Production tip:** Pin to a specific version and use the minified build to avoid unexpected changes:
27
27
  > ```html
28
28
  > <link melodic-styles rel="stylesheet"
29
- > href="https://unpkg.com/@melodicdev/components@1.0.3/assets/melodic-components.min.css">
29
+ > href="https://unpkg.com/@melodicdev/components@1.0.4/assets/melodic-components.min.css">
30
30
  > ```
31
31
 
32
32
  The `melodic-styles` attribute has no special browser meaning — it's just a convenient selector if you ever need to find or replace the element from JavaScript:
@@ -80,9 +80,9 @@ If you're not using a bundler, you can load everything — styles, fonts, and al
80
80
  <html data-theme="light">
81
81
  <head>
82
82
  <link melodic-styles rel="stylesheet"
83
- href="https://unpkg.com/@melodicdev/components@1.0.3/assets/melodic-components.min.css">
83
+ href="https://unpkg.com/@melodicdev/components@1.0.4/assets/melodic-components.min.css">
84
84
  <script type="module"
85
- src="https://unpkg.com/@melodicdev/components@1.0.3/assets/melodic-components.min.js"></script>
85
+ src="https://unpkg.com/@melodicdev/components@1.0.4/assets/melodic-components.min.js"></script>
86
86
  </head>
87
87
  <body>
88
88
  <ml-button>Hello</ml-button>
@@ -97,7 +97,7 @@ The theme API is available as a named export from the module:
97
97
 
98
98
  ```html
99
99
  <script type="module">
100
- import { applyTheme } from 'https://unpkg.com/@melodicdev/components@1.0.3/assets/melodic-components.min.js';
100
+ import { applyTheme } from 'https://unpkg.com/@melodicdev/components@1.0.4/assets/melodic-components.min.js';
101
101
  applyTheme('dark');
102
102
  </script>
103
103
  ```
@@ -5564,7 +5564,7 @@ function inputTemplate(c) {
5564
5564
  "ml-input--disabled": c.disabled,
5565
5565
  "ml-input--readonly": c.readonly,
5566
5566
  "ml-input--error": !!c.error,
5567
- "ml-input--focused": c._focused
5567
+ "ml-input--focused": c.focused
5568
5568
  })}
5569
5569
  >
5570
5570
  ${when(!!c.label, () => html`
@@ -5743,7 +5743,7 @@ var InputComponent = class InputComponent$1 {
5743
5743
  this.readonly = false;
5744
5744
  this.required = false;
5745
5745
  this.autocomplete = "off";
5746
- this._focused = false;
5746
+ this.focused = false;
5747
5747
  this.handleInput = (event) => {
5748
5748
  this.value = event.target.value;
5749
5749
  this.elementRef.dispatchEvent(new CustomEvent("ml:input", {
@@ -5761,14 +5761,14 @@ var InputComponent = class InputComponent$1 {
5761
5761
  }));
5762
5762
  };
5763
5763
  this.handleFocus = () => {
5764
- this._focused = true;
5764
+ this.focused = true;
5765
5765
  this.elementRef.dispatchEvent(new CustomEvent("ml:focus", {
5766
5766
  bubbles: true,
5767
5767
  composed: true
5768
5768
  }));
5769
5769
  };
5770
5770
  this.handleBlur = () => {
5771
- this._focused = false;
5771
+ this.focused = false;
5772
5772
  this.elementRef.dispatchEvent(new CustomEvent("ml:blur", {
5773
5773
  bubbles: true,
5774
5774
  composed: true
@@ -5806,7 +5806,7 @@ function textareaTemplate(c) {
5806
5806
  "ml-textarea--disabled": c.disabled,
5807
5807
  "ml-textarea--readonly": c.readonly,
5808
5808
  "ml-textarea--error": !!c.error,
5809
- "ml-textarea--focused": c._focused,
5809
+ "ml-textarea--focused": c.focused,
5810
5810
  "ml-textarea--resize": c.resize
5811
5811
  })}
5812
5812
  >
@@ -5971,7 +5971,7 @@ var TextareaComponent = class TextareaComponent$1 {
5971
5971
  this.readonly = false;
5972
5972
  this.required = false;
5973
5973
  this.resize = false;
5974
- this._focused = false;
5974
+ this.focused = false;
5975
5975
  this.handleInput = (event) => {
5976
5976
  this.value = event.target.value;
5977
5977
  this.elementRef.dispatchEvent(new CustomEvent("ml:input", {
@@ -5989,14 +5989,14 @@ var TextareaComponent = class TextareaComponent$1 {
5989
5989
  }));
5990
5990
  };
5991
5991
  this.handleFocus = () => {
5992
- this._focused = true;
5992
+ this.focused = true;
5993
5993
  this.elementRef.dispatchEvent(new CustomEvent("ml:focus", {
5994
5994
  bubbles: true,
5995
5995
  composed: true
5996
5996
  }));
5997
5997
  };
5998
5998
  this.handleBlur = () => {
5999
- this._focused = false;
5999
+ this.focused = false;
6000
6000
  this.elementRef.dispatchEvent(new CustomEvent("ml:blur", {
6001
6001
  bubbles: true,
6002
6002
  composed: true
@@ -12348,6 +12348,7 @@ const dataGridStyles = () => css`
12348
12348
  display: flex;
12349
12349
  flex-direction: column;
12350
12350
  height: 100%;
12351
+ min-width: 0;
12351
12352
  font-family: var(--ml-font-sans);
12352
12353
  }
12353
12354
 
@@ -12400,6 +12401,7 @@ const dataGridStyles = () => css`
12400
12401
  overflow: auto;
12401
12402
  position: relative;
12402
12403
  min-height: 0;
12404
+ min-width: 0;
12403
12405
  }
12404
12406
 
12405
12407
  .ml-data-grid__viewport::-webkit-scrollbar {
@@ -15892,7 +15894,7 @@ function renderNavGroup(c, group) {
15892
15894
  function renderNavItem(c, item, level) {
15893
15895
  const isActive = c.active === item.value;
15894
15896
  const hasChildren = !!item.children && item.children.length > 0;
15895
- const isExpanded = c._expandedItems.has(item.value);
15897
+ const isExpanded = c.expandedItems.has(item.value);
15896
15898
  const isCollapsed = c.collapsed;
15897
15899
  const linkClasses = classMap({
15898
15900
  "ml-sidebar__item-link": true,
@@ -15906,7 +15908,7 @@ function renderNavItem(c, item, level) {
15906
15908
  if (item.disabled) return;
15907
15909
  if (hasChildren) {
15908
15910
  event.preventDefault();
15909
- c.handleConfigToggle(item, c._expandedItems);
15911
+ c.handleConfigToggle(item);
15910
15912
  return;
15911
15913
  }
15912
15914
  c.handleConfigItemClick(item.value, item.href);
@@ -16271,10 +16273,11 @@ var SidebarComponent = class SidebarComponent$1 {
16271
16273
  this.handleConfigItemClick = (value, href) => {
16272
16274
  this.activateItem(value, href);
16273
16275
  };
16274
- this.handleConfigToggle = (item, expandedItems) => {
16275
- if (expandedItems.has(item.value)) expandedItems.delete(item.value);
16276
- else expandedItems.add(item.value);
16277
- this.elementRef.dispatchEvent(new Event("ml:internal-update"));
16276
+ this.handleConfigToggle = (item) => {
16277
+ const next = new Set(this.expandedItems);
16278
+ if (next.has(item.value)) next.delete(item.value);
16279
+ else next.add(item.value);
16280
+ this.expandedItems = next;
16278
16281
  };
16279
16282
  this.handleKeyDown = (event) => {
16280
16283
  const sidebar = this.elementRef.shadowRoot?.querySelector(".ml-sidebar__main");
@@ -16303,7 +16306,7 @@ var SidebarComponent = class SidebarComponent$1 {
16303
16306
  }
16304
16307
  if (newIndex !== currentIndex && focusable[newIndex]) focusable[newIndex].focus();
16305
16308
  };
16306
- this._expandedItems = /* @__PURE__ */ new Set();
16309
+ this.expandedItems = /* @__PURE__ */ new Set();
16307
16310
  }
16308
16311
  get hasSearch() {
16309
16312
  return this.elementRef?.querySelector("[slot=\"search\"]") !== null;
@@ -19695,8 +19698,8 @@ function appShellTemplate(c) {
19695
19698
  const sidebarRight = c["sidebar-position"] === "right";
19696
19699
  const collapsed = c["sidebar-collapsed"];
19697
19700
  const headerFixed = c["header-fixed"];
19698
- const mobileOpen = c._mobileOpen;
19699
- const isMobile = c.isMobile;
19701
+ const mobileOpen = c.mobileOpen;
19702
+ const isMobile = c.mobile;
19700
19703
  return html`
19701
19704
  <div
19702
19705
  class=${classMap({
@@ -19943,29 +19946,28 @@ var AppShellComponent = class AppShellComponent$1 {
19943
19946
  this["sidebar-position"] = "left";
19944
19947
  this["sidebar-collapsed"] = false;
19945
19948
  this["header-fixed"] = false;
19946
- this._mobileOpen = false;
19949
+ this.mobile = false;
19950
+ this.mobileOpen = false;
19947
19951
  this._mediaQuery = null;
19948
19952
  this._handleMediaChange = this.onMediaChange.bind(this);
19949
19953
  this.toggleMobileSidebar = () => {
19950
- this._mobileOpen = !this._mobileOpen;
19954
+ this.mobileOpen = !this.mobileOpen;
19951
19955
  };
19952
19956
  this.closeMobileSidebar = () => {
19953
- this._mobileOpen = false;
19957
+ this.mobileOpen = false;
19954
19958
  };
19955
19959
  }
19956
- get isMobile() {
19957
- return this._mediaQuery?.matches === false;
19958
- }
19959
19960
  onCreate() {
19960
19961
  this._mediaQuery = window.matchMedia("(min-width: 768px)");
19961
19962
  this._mediaQuery.addEventListener("change", this._handleMediaChange);
19962
- if (!this.isMobile) this._mobileOpen = false;
19963
+ this.mobile = !this._mediaQuery.matches;
19963
19964
  }
19964
19965
  onDestroy() {
19965
19966
  this._mediaQuery?.removeEventListener("change", this._handleMediaChange);
19966
19967
  }
19967
19968
  onMediaChange(event) {
19968
- if (event.matches) this._mobileOpen = false;
19969
+ this.mobile = !event.matches;
19970
+ if (event.matches) this.mobileOpen = false;
19969
19971
  }
19970
19972
  };
19971
19973
  AppShellComponent = __decorate([MelodicComponent({