@jungherz-de/notionkit-elements 1.0.1 → 1.2.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.
Files changed (90) hide show
  1. package/README.md +11 -11
  2. package/dist/components/nk-ai-input-row.js +1 -1
  3. package/dist/components/nk-ai-msg.js +1 -1
  4. package/dist/components/nk-ai-thread.js +1 -1
  5. package/dist/components/nk-app.js +1 -1
  6. package/dist/components/nk-avatar-group.js +1 -1
  7. package/dist/components/nk-banner.js +1 -1
  8. package/dist/components/nk-block-host.js +1 -1
  9. package/dist/components/nk-board-view.js +1 -1
  10. package/dist/components/nk-breadcrumb.js +1 -1
  11. package/dist/components/nk-btn.js +1 -1
  12. package/dist/components/nk-callout.js +1 -1
  13. package/dist/components/nk-check.js +9 -3
  14. package/dist/components/nk-cmdk.js +1 -1
  15. package/dist/components/nk-code.js +1 -1
  16. package/dist/components/nk-comment.js +1 -1
  17. package/dist/components/nk-comments.js +1 -1
  18. package/dist/components/nk-danger-zone.js +1 -1
  19. package/dist/components/nk-database.js +1 -1
  20. package/dist/components/nk-divider.js +1 -1
  21. package/dist/components/nk-emoji-picker.js +1 -1
  22. package/dist/components/nk-empty.js +1 -1
  23. package/dist/components/nk-field.js +45 -7
  24. package/dist/components/nk-fields.js +22 -0
  25. package/dist/components/nk-filter-bar.js +1 -1
  26. package/dist/components/nk-heading.js +1 -1
  27. package/dist/components/nk-input.js +2 -2
  28. package/dist/components/nk-kbd.js +1 -1
  29. package/dist/components/nk-member-list.js +1 -1
  30. package/dist/components/nk-member-row.js +1 -1
  31. package/dist/components/nk-mention.js +1 -1
  32. package/dist/components/nk-menu-item.js +1 -1
  33. package/dist/components/nk-menu.js +1 -1
  34. package/dist/components/nk-modal.js +1 -1
  35. package/dist/components/nk-model-card.js +1 -1
  36. package/dist/components/nk-page-actions.js +1 -1
  37. package/dist/components/nk-page-cover.js +1 -1
  38. package/dist/components/nk-page-title.js +1 -1
  39. package/dist/components/nk-page.js +1 -1
  40. package/dist/components/nk-pop.js +1 -1
  41. package/dist/components/nk-profile-row.js +1 -1
  42. package/dist/components/nk-progress.js +1 -1
  43. package/dist/components/nk-quote.js +1 -1
  44. package/dist/components/nk-radio.js +9 -3
  45. package/dist/components/nk-section-label.js +1 -1
  46. package/dist/components/nk-segmented.js +1 -1
  47. package/dist/components/nk-select.js +6 -3
  48. package/dist/components/nk-settings-pane.js +1 -1
  49. package/dist/components/nk-settings-user.js +1 -1
  50. package/dist/components/nk-sidebar.js +1 -1
  51. package/dist/components/nk-skeleton.js +1 -1
  52. package/dist/components/nk-slider.js +1 -1
  53. package/dist/components/nk-stat.js +1 -1
  54. package/dist/components/nk-stats.js +1 -1
  55. package/dist/components/nk-switch.js +32 -4
  56. package/dist/components/nk-synced.js +1 -1
  57. package/dist/components/nk-tab-bar-item.js +83 -0
  58. package/dist/components/nk-tab-bar.js +83 -0
  59. package/dist/components/nk-tab.js +1 -1
  60. package/dist/components/nk-table-view.js +1 -1
  61. package/dist/components/nk-tabs.js +1 -1
  62. package/dist/components/nk-tag.js +1 -1
  63. package/dist/components/nk-template-btn.js +1 -1
  64. package/dist/components/nk-textarea.js +2 -2
  65. package/dist/components/nk-theme-toggle.js +1 -1
  66. package/dist/components/nk-toast.js +1 -1
  67. package/dist/components/nk-todo.js +1 -1
  68. package/dist/components/nk-toggle.js +1 -1
  69. package/dist/components/nk-topbar.js +1 -1
  70. package/dist/components/nk-tree-item.js +1 -1
  71. package/dist/components/nk-tree.js +1 -1
  72. package/dist/components/nk-workspace-switcher.js +1 -1
  73. package/dist/components/shared/base-EVtzqKmc.js +347 -0
  74. package/dist/notionkit-elements.esm.js +311 -21
  75. package/dist/notionkit-elements.js +313 -20
  76. package/dist/notionkit-elements.min.js +1 -1
  77. package/package.json +3 -3
  78. package/src/base.js +31 -1
  79. package/src/components/forms/nk-check.js +8 -2
  80. package/src/components/forms/nk-field.js +44 -6
  81. package/src/components/forms/nk-fields.js +21 -0
  82. package/src/components/forms/nk-input.js +1 -1
  83. package/src/components/forms/nk-radio.js +8 -2
  84. package/src/components/forms/nk-select.js +5 -2
  85. package/src/components/forms/nk-switch.js +31 -3
  86. package/src/components/forms/nk-textarea.js +1 -1
  87. package/src/components/shell/nk-tab-bar-item.js +82 -0
  88. package/src/components/shell/nk-tab-bar.js +82 -0
  89. package/src/index.js +3 -0
  90. package/dist/components/shared/base-6gEcoatG.js +0 -317
@@ -1,4 +1,4 @@
1
- import { a as NkFormElement } from './shared/base-6gEcoatG.js';
1
+ import { a as NkFormElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-select name="role" value="editor">
4
4
  // <option value="viewer">Viewer</option>
@@ -9,7 +9,7 @@ import { a as NkFormElement } from './shared/base-6gEcoatG.js';
9
9
  // MutationObserver keeps the copy in step when a framework swaps them; the
10
10
  // empty string is a valid value; the live selection survives a rebuild.
11
11
  class NkSelect extends NkFormElement {
12
- static get observedAttributes() { return ['value', 'name', 'disabled', 'required', 'compact', 'aria-label']; }
12
+ static get observedAttributes() { return ['value', 'name', 'disabled', 'required', 'compact', 'wide', 'aria-label']; }
13
13
  static get observesLightDom() { return true; }
14
14
 
15
15
  render() {
@@ -27,9 +27,10 @@ class NkSelect extends NkFormElement {
27
27
  name ? this._select.setAttribute('name', name) : this._select.removeAttribute('name');
28
28
  const label = this.getAttribute('aria-label');
29
29
  label ? this._select.setAttribute('aria-label', label) : this._select.removeAttribute('aria-label');
30
- this._select.disabled = this.getBoolAttr('disabled');
30
+ this._select.disabled = this.getBoolAttr('disabled') || !!this._formDisabled;
31
31
  this._select.required = this.getBoolAttr('required');
32
32
  this._select.classList.toggle('compact', this.getBoolAttr('compact'));
33
+ this._select.classList.toggle('wide', this.getBoolAttr('wide'));
33
34
  }
34
35
 
35
36
  projectLightDom() {
@@ -120,6 +121,8 @@ class NkSelect extends NkFormElement {
120
121
  set required(v) { this.setBoolAttr('required', v); }
121
122
  get compact() { return this.getBoolAttr('compact'); }
122
123
  set compact(v) { this.setBoolAttr('compact', v); }
124
+ get wide() { return this.getBoolAttr('wide'); }
125
+ set wide(v) { this.setBoolAttr('wide', v); }
123
126
  }
124
127
 
125
128
  customElements.define('nk-select', NkSelect);
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-settings-pane name="profile" label="My profile" icon="👤" group="Account" title="My profile" active>…</nk-settings-pane>
4
4
  // → <section class="nk-settings-pane active"><h2>My profile</h2>…</section>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-settings-user slot="user" name="Marcel Karas" mail="marcel@…" avatar="MK"></nk-settings-user>
4
4
  // → <div class="nk-settings-user"><div class="avatar">MK</div><div class="u-text"><div class="name">…</div><div class="mail">…</div></div></div>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-sidebar slot="sidebar">
4
4
  // <nk-workspace-switcher slot="workspace" name="Acme"></nk-workspace-switcher>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-skeleton height="18" width="60%"></nk-skeleton>
4
4
  // <nk-skeleton lines="3" widths="100%,85%,40%"></nk-skeleton>
@@ -1,4 +1,4 @@
1
- import { a as NkFormElement } from './shared/base-6gEcoatG.js';
1
+ import { a as NkFormElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-slider name="size" min="12" max="18" value="14" show-value></nk-slider>
4
4
  // → <input type="range" class="nk-slider"> <div class="nk-slider-value">14</div>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-stat label="Active pages" value="128" delta="▲ 12 this week" trend="up"></nk-stat>
4
4
  // → <div class="nk-stat"><div class="s-label">…</div><div class="s-value">…</div><div class="s-delta up">…</div></div>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-stats><nk-stat …></nk-stat>…</nk-stats> → <div class="nk-stats">
4
4
  class NkStats extends NkElement {
@@ -1,16 +1,30 @@
1
- import { a as NkFormElement } from './shared/base-6gEcoatG.js';
1
+ import { a as NkFormElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-switch name="notify" checked></nk-switch>
4
4
  // → <button class="nk-switch" role="switch" aria-checked="true">
5
5
  // notionkit.css styles the state through [aria-checked]; the toggling is here.
6
+ //
7
+ // <nk-switch checked>Waiting</nk-switch> (or text="Waiting")
8
+ // → <label class="nk-switch-label"><button class="nk-switch" …></button><span>Waiting</span></label>
9
+ // Visible text beside the switch, for several switches in one row where no
10
+ // nk-field row names them. Without text the label wrapper is layout-
11
+ // transparent (display: contents), so the bare button stays the bare button.
6
12
  class NkSwitch extends NkFormElement {
7
- static get observedAttributes() { return ['checked', 'disabled', 'name', 'value', 'label']; }
13
+ static get observedAttributes() { return ['checked', 'disabled', 'name', 'value', 'label', 'text']; }
8
14
 
9
15
  render() {
16
+ this._row = this.createElement('label', ['nk-switch-label']);
10
17
  this._btn = this.createElement('button', ['nk-switch'], { type: 'button', role: 'switch' });
18
+ this._text = document.createElement('span');
19
+ this._slot = document.createElement('slot');
20
+ this._textNode = document.createTextNode('');
21
+ this._slot.appendChild(this._textNode);
22
+ this._text.appendChild(this._slot);
23
+ this._row.append(this._btn, this._text);
11
24
  this._defaultChecked = this.getBoolAttr('checked');
12
25
  this._apply();
13
- this._wrapper.appendChild(this._btn);
26
+ this._syncText();
27
+ this._wrapper.appendChild(this._row);
14
28
  this._syncFormValue();
15
29
  }
16
30
 
@@ -21,13 +35,24 @@ class NkSwitch extends NkFormElement {
21
35
  label ? this._btn.setAttribute('aria-label', label) : this._btn.removeAttribute('aria-label');
22
36
  }
23
37
 
38
+ _syncText() {
39
+ this._textNode.data = this.getAttribute('text') ?? '';
40
+ const hasText = !!(this.getAttribute('text') || this._slot.assignedNodes().some(n => n.nodeType === Node.ELEMENT_NODE || n.data.trim()));
41
+ this._text.hidden = !hasText;
42
+ this._row.style.display = hasText ? '' : 'contents';
43
+ }
44
+
24
45
  setupEvents() {
25
46
  this._onClick = () => this.toggle();
47
+ this._onSlot = () => this._syncText();
26
48
  this._btn.addEventListener('click', this._onClick);
49
+ this._slot.addEventListener('slotchange', this._onSlot);
50
+ this._syncText();
27
51
  }
28
52
 
29
53
  teardownEvents() {
30
54
  this._btn?.removeEventListener('click', this._onClick);
55
+ this._slot?.removeEventListener('slotchange', this._onSlot);
31
56
  }
32
57
 
33
58
  toggle() {
@@ -37,8 +62,9 @@ class NkSwitch extends NkFormElement {
37
62
  this.dispatchEvent(new Event('change', { bubbles: true }));
38
63
  }
39
64
 
40
- onAttributeChanged() {
65
+ onAttributeChanged(name) {
41
66
  if (!this._btn) return;
67
+ if (name === 'text') { this._syncText(); return; }
42
68
  this._apply();
43
69
  this._syncFormValue();
44
70
  }
@@ -62,6 +88,8 @@ class NkSwitch extends NkFormElement {
62
88
  set name(v) { this.setAttribute('name', v); }
63
89
  get value() { return this.getAttribute('value') || 'on'; }
64
90
  set value(v) { this.setAttribute('value', v); }
91
+ get text() { return this.getAttribute('text'); }
92
+ set text(v) { v == null ? this.removeAttribute('text') : this.setAttribute('text', v); }
65
93
  }
66
94
 
67
95
  customElements.define('nk-switch', NkSwitch);
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-synced badge="⟳ 3 places">…</nk-synced>
4
4
  // → <div class="nk-synced"><span class="synced-badge">⟳ 3 places</span>…</div>
@@ -0,0 +1,83 @@
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
+
3
+ // <nk-tab-bar-item icon="📥" value="inbox" active>Inbox</nk-tab-bar-item>
4
+ // → <button class="nk-tab-bar-item active" type="button">
5
+ // <span class="icon">📥</span><span class="label">Inbox</span></button>
6
+ //
7
+ // One destination of <nk-tab-bar>. A click emits nk-select (cancelable);
8
+ // inside a bar it then moves the bar's `value`, standalone it sets its own
9
+ // `active`. With `href` it navigates afterwards, with `drawer` it opens the
10
+ // nearest <nk-sidebar> as a drawer instead of becoming active – the usual
11
+ // fifth item ("More"). The icon is an attribute or a `slot="icon"` node.
12
+ class NkTabBarItem extends NkElement {
13
+ static get observedAttributes() { return ['icon', 'label', 'value', 'href', 'active', 'disabled', 'drawer']; }
14
+
15
+ render() {
16
+ this._btn = this.createElement('button', ['nk-tab-bar-item'], { type: 'button' });
17
+ this._iconSlot = this.createElement('slot', [], { name: 'icon' });
18
+ this._icon = this.createElement('span', ['icon'], { 'aria-hidden': 'true' });
19
+ this._iconSlot.appendChild(this._icon);
20
+ this._label = this.createElement('span', ['label']);
21
+ this._labelSlot = document.createElement('slot');
22
+ this._labelText = document.createTextNode('');
23
+ this._labelSlot.appendChild(this._labelText);
24
+ this._label.appendChild(this._labelSlot);
25
+ this._btn.append(this._iconSlot, this._label);
26
+ this._wrapper.appendChild(this._btn);
27
+ this._sync();
28
+ }
29
+
30
+ _sync() {
31
+ this._icon.textContent = this.getAttribute('icon') ?? '';
32
+ this._labelText.data = this.getAttribute('label') ?? '';
33
+ const active = this.getBoolAttr('active');
34
+ this._btn.classList.toggle('active', active);
35
+ active ? this._btn.setAttribute('aria-current', 'page') : this._btn.removeAttribute('aria-current');
36
+ this._btn.disabled = this.getBoolAttr('disabled');
37
+ const href = this.getAttribute('href');
38
+ href ? this._btn.setAttribute('data-href', href) : this._btn.removeAttribute('data-href');
39
+ }
40
+
41
+ setupEvents() {
42
+ this._onClick = () => this.select();
43
+ this._btn.addEventListener('click', this._onClick);
44
+ }
45
+
46
+ teardownEvents() {
47
+ this._btn?.removeEventListener('click', this._onClick);
48
+ }
49
+
50
+ select() {
51
+ if (this.getBoolAttr('disabled')) return;
52
+ const href = this.getAttribute('href');
53
+ const ok = this.emit('nk-select', { value: this.value, label: this.label, href, item: this, drawer: this.getBoolAttr('drawer') });
54
+ if (!ok) return;
55
+ if (this.getBoolAttr('drawer')) {
56
+ const sidebar = this.closest('nk-app')?.querySelector('nk-sidebar') ?? document.querySelector('nk-sidebar');
57
+ sidebar?.toggle?.();
58
+ return;
59
+ }
60
+ const bar = this.closest('nk-tab-bar');
61
+ if (bar) bar.value = this.value;
62
+ else this.setBoolAttr('active', true);
63
+ if (href) location.assign(href);
64
+ }
65
+
66
+ onAttributeChanged() { this._sync(); }
67
+ focus(o) { this._btn?.focus(o); }
68
+
69
+ get value() { return this.getAttribute('value') ?? this.label; }
70
+ set value(v) { this.setAttribute('value', v); }
71
+ get label() { return this.getAttribute('label') ?? this.textContent.trim(); }
72
+ set label(v) { this.setAttribute('label', v); }
73
+ get active() { return this.getBoolAttr('active'); }
74
+ set active(v) { this.setBoolAttr('active', v); }
75
+ get disabled() { return this.getBoolAttr('disabled'); }
76
+ set disabled(v) { this.setBoolAttr('disabled', v); }
77
+ get drawer() { return this.getBoolAttr('drawer'); }
78
+ set drawer(v) { this.setBoolAttr('drawer', v); }
79
+ }
80
+
81
+ customElements.define('nk-tab-bar-item', NkTabBarItem);
82
+
83
+ export { NkTabBarItem };
@@ -0,0 +1,83 @@
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
+
3
+ // <nk-tab-bar value="inbox">
4
+ // <nk-tab-bar-item icon="🏠" value="home">Home</nk-tab-bar-item>
5
+ // <nk-tab-bar-item icon="📥" value="inbox">Inbox</nk-tab-bar-item>
6
+ // <nk-tab-bar-item icon="☰" drawer>More</nk-tab-bar-item>
7
+ // </nk-tab-bar>
8
+ // → <nav class="nk-tab-bar">…</nav>
9
+ //
10
+ // The thumb-reachable twin of the sidebar for phones and installed PWAs. As
11
+ // the last child of <nk-app> it is slotted into .nk-main below the scrolling
12
+ // page, so it never moves and needs no bottom padding anywhere. The
13
+ // stylesheet hides it above 860px – there the sidebar is the navigation –
14
+ // and shows it below; `always` shows it at every width (previews, phone
15
+ // frames), `floating` makes it a capsule. Exactly one item is `active`; a
16
+ // `drawer` item opens the sidebar instead of becoming active.
17
+ class NkTabBar extends NkElement {
18
+ static get observedAttributes() { return ['value', 'always', 'floating', 'label']; }
19
+
20
+ render() {
21
+ this._bar = this.createElement('nav', ['nk-tab-bar']);
22
+ this._slot = document.createElement('slot');
23
+ this._bar.appendChild(this._slot);
24
+ this._wrapper.appendChild(this._bar);
25
+ this._syncBar();
26
+ this._sync();
27
+ }
28
+
29
+ get items() { return [...this.querySelectorAll(':scope > nk-tab-bar-item')]; }
30
+
31
+ // Attribute access only: on the first connect the children are in the DOM
32
+ // but not yet upgraded, so their accessors do not exist.
33
+ _valueOf(item) { return item.getAttribute('value') ?? item.getAttribute('label') ?? item.textContent.trim(); }
34
+
35
+ _syncBar() {
36
+ this._bar.classList.toggle('always', this.getBoolAttr('always'));
37
+ this._bar.classList.toggle('floating', this.getBoolAttr('floating'));
38
+ const label = this.getAttribute('label');
39
+ label ? this._bar.setAttribute('aria-label', label) : this._bar.removeAttribute('aria-label');
40
+ }
41
+
42
+ _sync() {
43
+ const items = this.items.filter(i => !i.hasAttribute('drawer'));
44
+ if (!items.length) return;
45
+ let value = this.getAttribute('value');
46
+ if (value === null || !items.some(i => this._valueOf(i) === value)) {
47
+ const preset = items.find(i => i.hasAttribute('active')) || items[0];
48
+ value = this._valueOf(preset);
49
+ }
50
+ for (const item of items) {
51
+ if (this._valueOf(item) === value) item.setAttribute('active', ''); else item.removeAttribute('active');
52
+ }
53
+ this._value = value;
54
+ }
55
+
56
+ setupEvents() {
57
+ this._onSlot = () => this._sync();
58
+ this._slot.addEventListener('slotchange', this._onSlot);
59
+ this._sync();
60
+ }
61
+
62
+ teardownEvents() {
63
+ this._slot?.removeEventListener('slotchange', this._onSlot);
64
+ }
65
+
66
+ onAttributeChanged(name) {
67
+ if (name !== 'value') { this._syncBar(); return; }
68
+ const before = this._value;
69
+ this._sync();
70
+ if (this._value !== before) this.emit('nk-change', { value: this._value });
71
+ }
72
+
73
+ get value() { return this._value ?? this.getAttribute('value'); }
74
+ set value(v) { this.setAttribute('value', v); }
75
+ get always() { return this.getBoolAttr('always'); }
76
+ set always(v) { this.setBoolAttr('always', v); }
77
+ get floating() { return this.getBoolAttr('floating'); }
78
+ set floating(v) { this.setBoolAttr('floating', v); }
79
+ }
80
+
81
+ customElements.define('nk-tab-bar', NkTabBar);
82
+
83
+ export { NkTabBar };
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-tab value="notes" active>📝 Notes</nk-tab> → <span class="nk-tab active" role="tab">
4
4
  class NkTab extends NkElement {
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
  import { c as compareBy, r as renderPropertyCell } from './shared/property-cell-Dn91uFkf.js';
3
3
 
4
4
  // <nk-table-view name="table" label="▦ Table" count new-row sortable></nk-table-view>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-tabs value="notes">
4
4
  // <nk-tab value="notes">📝 Notes</nk-tab>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-tag color="blue">Text</nk-tag> — modifier class .blue becomes color="blue"
4
4
  const COLORS = ['blue', 'green', 'orange', 'purple'];
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-template-btn icon="📅" value="week-plan">Insert week plan</nk-template-btn>
4
4
  // → <button class="nk-template-btn">📅 Insert week plan</button>
@@ -1,4 +1,4 @@
1
- import { a as NkFormElement } from './shared/base-6gEcoatG.js';
1
+ import { a as NkFormElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-textarea name="bio" rows="3" wide>Text</nk-textarea> → <textarea class="nk-textarea wide">
4
4
  // The initial value is the `value` attribute, or the element's text content.
@@ -19,7 +19,7 @@ class NkTextarea extends NkFormElement {
19
19
 
20
20
  _forward(attr) {
21
21
  if (BOOLEANS.includes(attr)) {
22
- this._input[attr === 'readonly' ? 'readOnly' : attr] = this.getBoolAttr(attr);
22
+ this._input[attr === 'readonly' ? 'readOnly' : attr] = this.getBoolAttr(attr) || (attr === 'disabled' && !!this._formDisabled);
23
23
  return;
24
24
  }
25
25
  const v = this.getAttribute(attr);
@@ -1,4 +1,4 @@
1
- import { N as NkElement, g as getCurrentTheme } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement, g as getCurrentTheme } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-theme-toggle slot="actions"></nk-theme-toggle>
4
4
  // → <button class="nk-topbar-btn nk-theme-toggle">🌙</button>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-toast id="toast"></nk-toast> … toast.show('Saved');
4
4
  // → <div class="nk-toast show">✓ Saved</div>
@@ -1,4 +1,4 @@
1
- import { a as NkFormElement } from './shared/base-6gEcoatG.js';
1
+ import { a as NkFormElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-todo name="task" value="1" checked>Write the docs</nk-todo>
4
4
  // → <label class="nk-todo"><input type="checkbox"><span>Write the docs</span></label>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-toggle label="Details" open>Body…</nk-toggle>
4
4
  // → <details class="nk-toggle" open><summary>Details</summary><div class="toggle-body">…</div></details>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-topbar>
4
4
  // <nk-breadcrumb>…</nk-breadcrumb>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-tree-item icon="📊" value="overview" open>
4
4
  // Project overview
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-tree>
4
4
  // <nk-section-label addable>Favourites</nk-section-label>
@@ -1,4 +1,4 @@
1
- import { N as NkElement } from './shared/base-6gEcoatG.js';
1
+ import { N as NkElement } from './shared/base-EVtzqKmc.js';
2
2
 
3
3
  // <nk-workspace-switcher slot="workspace" name="Acme" avatar="A">
4
4
  // <nk-menu slot="menu">…</nk-menu>