@jungherz-de/notionkit-elements 1.3.1 → 1.5.1
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 +5 -5
- package/dist/components/nk-ai-input-row.js +1 -1
- package/dist/components/nk-ai-msg.js +1 -1
- package/dist/components/nk-ai-thread.js +1 -1
- package/dist/components/nk-app.js +1 -1
- package/dist/components/nk-avatar-group.js +1 -1
- package/dist/components/nk-banner.js +2 -2
- package/dist/components/nk-block-host.js +1 -1
- package/dist/components/nk-board-view.js +2 -2
- package/dist/components/nk-breadcrumb.js +1 -1
- package/dist/components/nk-btn.js +1 -1
- package/dist/components/nk-callout.js +1 -1
- package/dist/components/nk-check.js +1 -1
- package/dist/components/nk-cmdk.js +1 -1
- package/dist/components/nk-code.js +1 -1
- package/dist/components/nk-comment.js +1 -1
- package/dist/components/nk-comments.js +1 -1
- package/dist/components/nk-danger-zone.js +1 -1
- package/dist/components/nk-database.js +1 -1
- package/dist/components/nk-divider.js +1 -1
- package/dist/components/nk-emoji-picker.js +1 -1
- package/dist/components/nk-empty.js +1 -1
- package/dist/components/nk-field.js +1 -1
- package/dist/components/nk-fields.js +1 -1
- package/dist/components/nk-filter-bar.js +1 -1
- package/dist/components/nk-heading.js +1 -1
- package/dist/components/nk-input.js +1 -1
- package/dist/components/nk-kbd.js +1 -1
- package/dist/components/nk-member-list.js +1 -1
- package/dist/components/nk-member-row.js +1 -1
- package/dist/components/nk-mention.js +1 -1
- package/dist/components/nk-menu-item.js +1 -1
- package/dist/components/nk-menu.js +1 -1
- package/dist/components/nk-modal.js +1 -1
- package/dist/components/nk-model-card.js +1 -1
- package/dist/components/nk-page-actions.js +1 -1
- package/dist/components/nk-page-cover.js +1 -1
- package/dist/components/nk-page-title.js +1 -1
- package/dist/components/nk-page.js +1 -1
- package/dist/components/nk-pop.js +1 -1
- package/dist/components/nk-profile-row.js +1 -1
- package/dist/components/nk-progress.js +1 -1
- package/dist/components/nk-quote.js +1 -1
- package/dist/components/nk-radio.js +1 -1
- package/dist/components/nk-section-label.js +1 -1
- package/dist/components/nk-segmented.js +1 -1
- package/dist/components/nk-select.js +1 -1
- package/dist/components/nk-settings-pane.js +1 -1
- package/dist/components/nk-settings-user.js +1 -1
- package/dist/components/nk-sidebar.js +27 -4
- package/dist/components/nk-skeleton.js +1 -1
- package/dist/components/nk-slider.js +1 -1
- package/dist/components/nk-stat.js +1 -1
- package/dist/components/nk-stats.js +1 -1
- package/dist/components/nk-switch.js +1 -1
- package/dist/components/nk-synced.js +1 -1
- package/dist/components/nk-tab-bar-item.js +1 -1
- package/dist/components/nk-tab-bar.js +1 -1
- package/dist/components/nk-tab.js +1 -1
- package/dist/components/nk-table-view.js +6 -4
- package/dist/components/nk-tabs.js +1 -1
- package/dist/components/nk-tag.js +4 -3
- package/dist/components/nk-template-btn.js +1 -1
- package/dist/components/nk-textarea.js +1 -1
- package/dist/components/nk-theme-toggle.js +1 -1
- package/dist/components/nk-toast.js +1 -1
- package/dist/components/nk-todo.js +1 -1
- package/dist/components/nk-toggle.js +1 -1
- package/dist/components/nk-topbar.js +1 -1
- package/dist/components/nk-tree-item.js +1 -1
- package/dist/components/nk-tree.js +1 -1
- package/dist/components/nk-workspace-switcher.js +1 -1
- package/dist/components/shared/base-BPIvRI6K.js +347 -0
- package/dist/components/shared/{property-cell-Dn91uFkf.js → property-cell-CtXQpUjQ.js} +2 -2
- package/dist/notionkit-elements.esm.js +39 -13
- package/dist/notionkit-elements.js +39 -13
- package/dist/notionkit-elements.min.js +1 -1
- package/package.json +3 -3
- package/src/components/content/nk-tag.js +3 -2
- package/src/components/data/nk-table-view.js +4 -2
- package/src/components/page/nk-banner.js +1 -1
- package/src/components/shell/nk-sidebar.js +26 -3
- package/src/util/property-cell.js +2 -2
- package/dist/components/shared/base-Bet1FMjb.js +0 -347
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<h1 align="center">🧩 NotionKit Elements</h1>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<a href="https://www.npmjs.com/package/@jungherz-de/notionkit-elements"><img src="https://img.shields.io/badge/version-1.
|
|
4
|
+
<a href="https://www.npmjs.com/package/@jungherz-de/notionkit-elements"><img src="https://img.shields.io/badge/version-1.5.1-2383e2?style=flat-square" alt="Version"></a>
|
|
5
5
|
<a href="#"><img src="https://img.shields.io/badge/vanilla_JS-no_dependencies-448361?style=flat-square" alt="Vanilla JS"></a>
|
|
6
6
|
<a href="#"><img src="https://img.shields.io/badge/elements-71-529cca?style=flat-square" alt="71 Elements"></a>
|
|
7
7
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-9065b0?style=flat-square" alt="MIT License"></a>
|
|
8
|
-
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/changelog-v1.
|
|
8
|
+
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/changelog-v1.5.1-lightgrey?style=flat-square" alt="Changelog"></a>
|
|
9
9
|
<a href="https://www.npmjs.com/package/@jungherz-de/notionkit-elements"><img src="https://img.shields.io/badge/npm-%40jungherz--de%2Fnotionkit--elements-cb3837?style=flat-square&logo=npm" alt="npm"></a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
@@ -71,8 +71,8 @@ It is the **app layer** of the NotionKit family – three layers, one design lan
|
|
|
71
71
|
<!DOCTYPE html>
|
|
72
72
|
<html lang="en" data-theme="light">
|
|
73
73
|
<head>
|
|
74
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.
|
|
75
|
-
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.
|
|
74
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.5.1/notionkit.min.css">
|
|
75
|
+
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.5.1/dist/notionkit-elements.min.js"></script>
|
|
76
76
|
</head>
|
|
77
77
|
<body class="nk-body">
|
|
78
78
|
<nk-field label="Display name" desc="Shown next to your comments">
|
|
@@ -93,7 +93,7 @@ import '@jungherz-de/notionkit-elements'; // everyt
|
|
|
93
93
|
import '@jungherz-de/notionkit-elements/components/nk-btn.js'; // or one element (shared code is one extra chunk)
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
Two prerequisites, always: `notionkit.css` on the document (the peer dependency, `>= 1.
|
|
96
|
+
Two prerequisites, always: `notionkit.css` on the document (the peer dependency, `>= 1.5.1`; 1.5.1 handles the safe areas, 1.5.0 brings the Notion-2025 tokens, the nine tag colours and the filled inputs, 1.4.x segmented scroll/wrap, the fixed tab bar and the dvh shell, 1.3.x the field layouts; from 1.5.0 on, Elements and the foundation share one version number – the elements are built and tested against the same release) and `class="nk-body"` on `<body>`. The elements ship no visual CSS of their own – every rule comes from the foundation. The bundle injects the design tokens once as `@layer notionkit-defaults`, so any plain `:root { --nk-accent: … }` of yours re-brands every element in both themes.
|
|
97
97
|
|
|
98
98
|
## Elements
|
|
99
99
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-ai-input-row placeholder="Ask Mona something …"></nk-ai-input-row>
|
|
4
4
|
// → <div class="nk-ai-input-row"><span>✨</span><input><button class="nk-ai-send">↑</button></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-ai-msg role="user" name="You" avatar="MK">Summarise the open tasks.</nk-ai-msg>
|
|
4
4
|
// <nk-ai-msg role="assistant" name="Mona" badge="· AI" avatar="✨">
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-banner variant="info">ℹ️ <span>Text</span><span slot="action">Open</span></nk-banner>
|
|
4
4
|
// → <div class="nk-banner info">…<span class="b-action">Open</span></div>
|
|
5
|
-
const VARIANTS = ['info', 'success', 'warning'];
|
|
5
|
+
const VARIANTS = ['info', 'success', 'warning', 'danger'];
|
|
6
6
|
|
|
7
7
|
class NkBanner extends NkElement {
|
|
8
8
|
static get observedAttributes() { return ['variant']; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-block-host handle><p>Editable content lives here.</p></nk-block-host>
|
|
4
4
|
// → <div class="nk-block-host"><span class="nk-block-handle">⠿</span>…</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
2
|
-
import { t as tagFor, r as renderPropertyCell } from './shared/property-cell-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
|
+
import { t as tagFor, r as renderPropertyCell } from './shared/property-cell-CtXQpUjQ.js';
|
|
3
3
|
|
|
4
4
|
// <nk-board-view name="board" label="▤ Board" group-by="status" new-row></nk-board-view>
|
|
5
5
|
// Groups rows by a select column (default: the first select column); one
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-btn variant="primary" small>Save</nk-btn> → <button class="nk-btn primary small">
|
|
4
4
|
// <nk-btn href="/docs" variant="secondary">Docs</nk-btn> → <a class="nk-btn secondary">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as NkFormElement } from './shared/base-
|
|
1
|
+
import { a as NkFormElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-check name="mail" value="weekly" checked>Weekly digest</nk-check>
|
|
4
4
|
// → <label class="nk-check"><input type="checkbox"> Weekly digest</label>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
import { l as lockScroll, i as inertOutside, u as unlockScroll } from './shared/focus-DXrK9oLe.js';
|
|
3
3
|
|
|
4
4
|
// Subsequence scoring for the command palette: every query character must
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// Minimal HTML highlighter emitting the .tag / .attr hooks .nk-code styles.
|
|
4
4
|
// Mirrors tools/highlight.mjs in the NotionKit foundation – no third-party
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-comment author="Sara Lindt" time="1 hr ago" avatar="SL" color="#448361">The board view feels close.</nk-comment>
|
|
4
4
|
// → <div class="nk-comment"><span class="mini-avatar">SL</span><div><div class="c-head"><b>Sara Lindt</b> · 1 hr ago</div><div class="c-body">…</div></div></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-empty icon="🗂️" title="No entries yet" desc="Create the first one."><nk-btn variant="primary" small>+ New</nk-btn></nk-empty>
|
|
4
4
|
// → <div class="nk-empty"><div class="e-icon">🗂️</div><div class="e-title">…</div><div class="e-desc">…</div>…</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-filter-bar search placeholder="Search rows …"></nk-filter-bar>
|
|
4
4
|
// bar.filters = [{ key: 'status', label: 'Status: Done', value: 'done' }];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-heading level="2">Section</nk-heading> → <h2 class="nk-heading">
|
|
4
4
|
// The heading level is real markup (h1–h4), so the outline stays honest.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as NkFormElement } from './shared/base-
|
|
1
|
+
import { a as NkFormElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-input name="title" value="…" placeholder="…" wide></nk-input> → <input class="nk-input wide">
|
|
4
4
|
// Takes part in the surrounding <form> through ElementInternals.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-member-list><nk-member-row …></nk-member-row>…</nk-member-list>
|
|
4
4
|
// → <div class="nk-member-list">…</div>; the last row gets `last` (no border).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-mention type="person"><span slot="avatar" class="mini-avatar" style="background:#448361">SL</span>Sara Lindt</nk-mention>
|
|
4
4
|
// <nk-mention type="page">📄 Onboarding</nk-mention> <nk-mention type="date">📅 May 20</nk-mention>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-menu-item icon="✏️" shortcut="⌘E" value="rename">Rename</nk-menu-item>
|
|
4
4
|
// <nk-menu-item type="separator"></nk-menu-item> <nk-menu-item type="label">Danger</nk-menu-item>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
import { l as lockScroll, i as inertOutside, f as firstFocusable, u as unlockScroll } from './shared/focus-DXrK9oLe.js';
|
|
3
3
|
|
|
4
4
|
// <nk-modal id="settings">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as NkFormElement } from './shared/base-
|
|
1
|
+
import { a as NkFormElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-model-card name="model" value="gpt" title="Mona Pro" desc="Best for long documents" selected></nk-model-card>
|
|
4
4
|
// → <div class="nk-model-card selected"><div class="m-radio"></div><div><div class="m-name">…</div><div class="m-desc">…</div></div></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-page-actions><span>👤 Ada</span><span>📅 12 May</span><span>🏷️ <nk-tag color="purple">Design</nk-tag></span></nk-page-actions>
|
|
4
4
|
// → <div class="nk-page-meta">…</div> – the meta row under the title
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-page-title>NotionKit MVP</nk-page-title> → <h1 class="nk-page-title">
|
|
4
4
|
// <nk-page-title editable placeholder="Untitled">…</nk-page-title>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-profile-row avatar="MK"><nk-btn variant="secondary" small>Change photo</nk-btn></nk-profile-row>
|
|
4
4
|
// → <div class="nk-profile-row"><div class="big-avatar">MK</div>…</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.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-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.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-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-sidebar slot="sidebar">
|
|
4
4
|
// <nk-workspace-switcher slot="workspace" name="Acme"></nk-workspace-switcher>
|
|
@@ -12,13 +12,36 @@ import { N as NkElement } from './shared/base-Bet1FMjb.js';
|
|
|
12
12
|
// .nk-app, exactly like the class markup. Below 860px notionkit.css hides the
|
|
13
13
|
// aside; `open` brings it back as an off-canvas drawer (position only – the
|
|
14
14
|
// look is still the stylesheet's).
|
|
15
|
+
//
|
|
16
|
+
// The drawer slides and the scrim fades without a line of JavaScript:
|
|
17
|
+
// `display` transitions with transition-behavior: allow-discrete (the old
|
|
18
|
+
// value is held for the whole duration, so closing animates too) and
|
|
19
|
+
// @starting-style gives the first frame after display: none its start
|
|
20
|
+
// values. `position: fixed` lives on the plain .nk-sidebar, not on the open
|
|
21
|
+
// state – while closing, the aside is still displayed and must not fall
|
|
22
|
+
// back into the flow. Browsers without either feature switch hard, as
|
|
23
|
+
// before; prefers-reduced-motion switches hard on purpose.
|
|
15
24
|
const drawerSheet = new CSSStyleSheet();
|
|
16
25
|
drawerSheet.replaceSync(`
|
|
26
|
+
.nk-sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 59; background: var(--nk-scrim-soft); }
|
|
17
27
|
@media (max-width: 860px) {
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
.nk-sidebar {
|
|
29
|
+
position: fixed; inset: 0 auto 0 0; z-index: 60;
|
|
30
|
+
transform: translateX(-100%);
|
|
31
|
+
transition: background .25s ease, transform .24s cubic-bezier(.2, .8, .25, 1), display .24s;
|
|
32
|
+
transition-behavior: allow-discrete;
|
|
33
|
+
}
|
|
34
|
+
:host([open]) .nk-sidebar { display: flex; transform: none; }
|
|
35
|
+
@starting-style { :host([open]) .nk-sidebar { transform: translateX(-100%); } }
|
|
36
|
+
.nk-sidebar-backdrop {
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transition: opacity .24s ease, display .24s;
|
|
39
|
+
transition-behavior: allow-discrete;
|
|
40
|
+
}
|
|
41
|
+
:host([open]) .nk-sidebar-backdrop { display: block; opacity: 1; }
|
|
42
|
+
@starting-style { :host([open]) .nk-sidebar-backdrop { opacity: 0; } }
|
|
20
43
|
}
|
|
21
|
-
.nk-sidebar-backdrop {
|
|
44
|
+
@media (prefers-reduced-motion: reduce) { .nk-sidebar, .nk-sidebar-backdrop { transition: none; } }
|
|
22
45
|
`);
|
|
23
46
|
|
|
24
47
|
class NkSidebar extends NkElement {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as NkFormElement } from './shared/base-
|
|
1
|
+
import { a as NkFormElement } from './shared/base-BPIvRI6K.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-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.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,14 +1,15 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
2
|
-
import { c as compareBy, r as renderPropertyCell } from './shared/property-cell-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
|
+
import { c as compareBy, r as renderPropertyCell } from './shared/property-cell-CtXQpUjQ.js';
|
|
3
3
|
|
|
4
|
-
// <nk-table-view name="table" label="▦ Table" count new-row sortable></nk-table-view>
|
|
4
|
+
// <nk-table-view name="table" label="▦ Table" count new-row sortable wrap></nk-table-view>
|
|
5
|
+
// `wrap` lets cell text break (`.nk-table.wrap`), like Notion's "wrap column".
|
|
5
6
|
// Standalone: view.columns = […]; view.rows = […]; Inside <nk-database> the
|
|
6
7
|
// database pushes `data`. → <div class="nk-table-wrap"><table class="nk-table">…</table><div class="nk-new-row">+ New page</div></div>
|
|
7
8
|
// Cells are plain markup from renderPropertyCell(); rows fire nk-select,
|
|
8
9
|
// checkboxes nk-change, headers nk-action { action: 'sort' } (and sort locally
|
|
9
10
|
// with `sortable`), the add row nk-action { action: 'new-row' }.
|
|
10
11
|
class NkTableView extends NkElement {
|
|
11
|
-
static get observedAttributes() { return ['name', 'label', 'badge', 'count', 'new-row', 'new-row-label', 'sortable', 'sort-key', 'sort-dir']; }
|
|
12
|
+
static get observedAttributes() { return ['name', 'label', 'badge', 'count', 'new-row', 'new-row-label', 'sortable', 'sort-key', 'sort-dir', 'wrap']; }
|
|
12
13
|
|
|
13
14
|
render() {
|
|
14
15
|
this._wrap = this.createElement('div', ['nk-table-wrap']);
|
|
@@ -33,6 +34,7 @@ class NkTableView extends NkElement {
|
|
|
33
34
|
|
|
34
35
|
_render() {
|
|
35
36
|
if (!this._thead) return;
|
|
37
|
+
this._table.classList.toggle('wrap', this.getBoolAttr('wrap'));
|
|
36
38
|
const tr = document.createElement('tr');
|
|
37
39
|
for (const col of this._columns) {
|
|
38
40
|
const th = this.createElement('th', [], { 'data-key': col.key, scope: 'col' });
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
|
-
// <nk-tag color="blue">Text</nk-tag> — modifier class .blue becomes color="blue"
|
|
4
|
-
|
|
3
|
+
// <nk-tag color="blue">Text</nk-tag> — modifier class .blue becomes color="blue".
|
|
4
|
+
// Notion's nine select colours; without `color` the stylesheet draws the grey tag.
|
|
5
|
+
const COLORS = ['gray', 'brown', 'orange', 'yellow', 'green', 'blue', 'purple', 'pink', 'red'];
|
|
5
6
|
|
|
6
7
|
class NkTag extends NkElement {
|
|
7
8
|
static get observedAttributes() { return ['color']; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-BPIvRI6K.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-
|
|
1
|
+
import { a as NkFormElement } from './shared/base-BPIvRI6K.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.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement, g as getCurrentTheme } from './shared/base-
|
|
1
|
+
import { N as NkElement, g as getCurrentTheme } from './shared/base-BPIvRI6K.js';
|
|
2
2
|
|
|
3
3
|
// <nk-theme-toggle slot="actions"></nk-theme-toggle>
|
|
4
4
|
// → <button class="nk-topbar-btn nk-theme-toggle">🌙</button>
|