@kahitsan/ksui 0.13.0 → 0.13.2
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/package.json +1 -1
- package/src/components/base/AccountAvatar.tsx +1 -1
- package/src/components/base/AddAttachmentTile.tsx +1 -1
- package/src/components/base/CameraCapture.tsx +1 -1
- package/src/components/base/DataTable.tsx +4 -4
- package/src/components/base/DatePicker.tsx +2 -2
- package/src/components/base/Modal.tsx +3 -3
- package/src/components/base/ProgressBar.tsx +2 -2
- package/src/components/composite/MarkdownNotes.tsx +1 -1
- package/src/components/composite/MentionTextarea.tsx +1 -1
- package/src/components/composite/NotFound.tsx +1 -1
- package/src/components/composite/VoucherPicker.tsx +1 -1
- package/src/index.ts +2 -2
- package/src/utils/account-icons.ts +1 -1
- package/src/utils/account-logo-url.ts +1 -1
- package/src/utils/accounts-index.tsx +1 -1
- package/src/utils/confirm.tsx +1 -1
- package/src/utils/highlight.tsx +1 -1
- package/src/utils/integration.ts +1 -1
- package/src/utils/parse-date.ts +1 -1
- package/tailwind.js +10 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kahitsan/ksui",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "ksui is a standalone set of SolidJS UI components for KahitSan/Hilinga and any SolidJS app. Published to the public npm registry and consumed as a normal dependency. Ships source under a `solid` export condition so the consumer's vite-plugin-solid compiles it with only solid-js externalized; it depends on nothing but solid-js + lucide-solid and injects its own CSS.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -25,7 +25,7 @@ import { getAccountIcon } from "../../utils/account-icons";
|
|
|
25
25
|
import { buildLogoSrc } from "../../utils/account-logo-url";
|
|
26
26
|
|
|
27
27
|
// Shared 16-color palette and initials algorithm. Keep in lockstep with
|
|
28
|
-
// the
|
|
28
|
+
// the original ~/lib/avatar.ts so the host runtime and the plugin fleet
|
|
29
29
|
// render the same chip for the same user. Exported so any future widget
|
|
30
30
|
// (or a caller's inline use) can derive a user's color/initials without
|
|
31
31
|
// rendering the chip itself.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vendored into plugin remotes.
|
|
2
2
|
// Dashed "Add" tile with a small Camera / Image-or-file popover menu.
|
|
3
3
|
|
|
4
4
|
import { createSignal, onCleanup, onMount, Show } from "solid-js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vendored into plugin remotes.
|
|
2
2
|
// getUserMedia camera capture modal. Button is ksui's own base primitive.
|
|
3
3
|
|
|
4
4
|
import { createSignal, onCleanup, onMount, Show } from "solid-js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source:
|
|
1
|
+
// Source: the host's Tailwind-
|
|
2
2
|
// classed table). Ported into ksui as a DOMAIN-FREE base primitive: a
|
|
3
3
|
// server-side (fetchFn) OR client-side (data) table with debounced search,
|
|
4
4
|
// column sort, pagination / "Show more" load mode, a filters JSX slot, an
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// library carries no host primitive and no native `<input type="date">`.
|
|
17
17
|
//
|
|
18
18
|
// The public type surface (DataTableRow / DataTableColumn / FetchResult /
|
|
19
|
-
// FetchParams / DataTableProps) mirrors the
|
|
19
|
+
// FetchParams / DataTableProps) mirrors the ambient host-ui type
|
|
20
20
|
// contract EXACTLY, so a caller written against host-ui works unchanged here.
|
|
21
21
|
//
|
|
22
22
|
// Composition note: the date filter renders ksui's own `DatePicker` (a sibling
|
|
@@ -58,7 +58,7 @@ const STYLE_ID = "ksui-datatable-style";
|
|
|
58
58
|
// ---------------------------------------------------------------------------
|
|
59
59
|
//
|
|
60
60
|
// Every color in the injected stylesheet is driven by a `--ksui-dt-*` CSS
|
|
61
|
-
// custom property; the fallback after each `var(...)` is the host
|
|
61
|
+
// custom property; the fallback after each `var(...)` is the host
|
|
62
62
|
// DataTable's exact value (resolved from its Tailwind classes — zinc/amber
|
|
63
63
|
// dark theme). To retint, wrap the table in a container that sets the vars,
|
|
64
64
|
// e.g. `<div style={{ "--ksui-dt-card-bg": "#000", "--ksui-dt-accent": "#0af" }}>`.
|
|
@@ -148,7 +148,7 @@ function ensureDataTableStyle(): void {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
// ---------------------------------------------------------------------------
|
|
151
|
-
// Types (mirror the
|
|
151
|
+
// Types (mirror the host UI kit's type contract exactly)
|
|
152
152
|
// ---------------------------------------------------------------------------
|
|
153
153
|
|
|
154
154
|
export interface DataTableRow {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Source:
|
|
1
|
+
// Source: the host's Tailwind-
|
|
2
2
|
// classed picker). Ported into ksui as a DOMAIN-FREE base primitive: a trigger
|
|
3
3
|
// button labeled with the selected date (or "Pick date"), a calendar popover
|
|
4
4
|
// (month grid, prev/next nav, day selection), single-date AND range mode, an
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
// Shares the DataTable's `--ksui-dt-*` palette (accent / control-bg / border /
|
|
51
51
|
// fg / text / muted / faint), so wrapping a date filter and a table in the same
|
|
52
52
|
// retint container restyles both. Picker-only tones use `--ksui-dp-*`. Fallback
|
|
53
|
-
// after each `var(...)` = the host
|
|
53
|
+
// after each `var(...)` = the host DatePicker's exact Tailwind value.
|
|
54
54
|
//
|
|
55
55
|
// --ksui-dt-control-bg popover + trigger + input bg (zinc-900, #18181b)
|
|
56
56
|
// --ksui-dt-border borders / dividers (zinc-800/50, rgba(39,39,42,0.5))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Self-contained modal dialog. Promoted into ksui from the former host kit so
|
|
2
|
-
// the library no longer depends on
|
|
2
|
+
// the library no longer depends on the host UI kit: ImageCropper (the only
|
|
3
3
|
// in-library consumer) now imports Modal from here.
|
|
4
4
|
//
|
|
5
5
|
// Like Button/ProgressBar, ksui publishes no sidecar .css — the styles are
|
|
@@ -46,9 +46,9 @@ function ensureModalStyle(): void {
|
|
|
46
46
|
.ksui-modal-sheet-overlay{position:fixed;inset:0;z-index:50;display:flex;align-items:flex-end;justify-content:center;}
|
|
47
47
|
@media (min-width:640px){.ksui-modal-sheet-overlay{align-items:center;padding:1rem;}}
|
|
48
48
|
.ksui-modal-sheet-backdrop{position:absolute;inset:0;background:rgba(0,0,0,0.7);backdrop-filter:blur(6px);}
|
|
49
|
-
.ksui-modal-card{position:relative;z-index:10;width:100%;background:var(--ksui-modal-bg,#
|
|
49
|
+
.ksui-modal-card{position:relative;z-index:10;width:100%;background:var(--ksui-modal-bg,#18181b);color:var(--ksui-modal-fg,inherit);border:1px solid var(--ksui-modal-border,rgba(245,158,11,0.3));border-radius:0.75rem;padding:1.5rem;box-shadow:0 25px 50px -12px rgba(0,0,0,0.6);max-height:90vh;overflow-x:hidden;overflow-y:auto;}
|
|
50
50
|
.ksui-modal-card.danger{border-color:var(--ksui-modal-border-danger,rgba(239,68,68,0.3));}
|
|
51
|
-
.ksui-modal-sheet-card{position:relative;z-index:10;width:100%;background:var(--ksui-modal-bg,#
|
|
51
|
+
.ksui-modal-sheet-card{position:relative;z-index:10;width:100%;background:var(--ksui-modal-bg,#18181b);color:var(--ksui-modal-fg,inherit);border:1px solid var(--ksui-modal-border,rgba(245,158,11,0.3));box-shadow:0 25px 50px -12px rgba(0,0,0,0.6);max-height:92vh;overflow:hidden;overscroll-behavior:contain;}
|
|
52
52
|
.ksui-modal-sheet-card.danger{border-color:var(--ksui-modal-border-danger,rgba(239,68,68,0.3));}
|
|
53
53
|
@media (min-width:640px){.ksui-modal-sheet-card{width:auto;border-radius:0.75rem;max-height:88vh;}}
|
|
54
54
|
`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Source: archive/pillar app/pillar-ui/base/ProgressBar/ProgressBar.tsx
|
|
2
|
-
// Ported into
|
|
2
|
+
// Ported into the library so the counter cards can reuse the same realtime
|
|
3
3
|
// progress visualization the session manager uses on the home page.
|
|
4
|
-
// Adapted to
|
|
4
|
+
// Adapted to the library's TS + lucide-solid conventions.
|
|
5
5
|
|
|
6
6
|
import type { Component, JSX } from "solid-js";
|
|
7
7
|
import { createMemo, splitProps, Show } from "solid-js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vendored into plugin remotes.
|
|
2
2
|
//
|
|
3
3
|
// Renders transaction `notes` with a restricted markdown subset and inline
|
|
4
4
|
// client-mention chips (@[Name](client:N)). Adapted for the remote: routing is
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vendored into plugin remotes.
|
|
2
2
|
//
|
|
3
3
|
// contenteditable rich-text input with an @-trigger client autocomplete that
|
|
4
4
|
// renders selected mentions as chips. Canonical value is the @[Name](client:ID)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// is hard-coded.
|
|
6
6
|
//
|
|
7
7
|
// Unlike the host-owned Button, this is a standalone primitive: it imports only
|
|
8
|
-
// solid-js and lucide-solid, never
|
|
8
|
+
// solid-js and lucide-solid, never the host UI kit or a router. The default
|
|
9
9
|
// action renders a plain, self-styled button. Navigation is left to the caller
|
|
10
10
|
// via `onButtonClick` (or `href`, which renders an anchor instead). Callers who
|
|
11
11
|
// want the host Button can pass it through the `action` slot, which fully
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vendored into plugin remotes.
|
|
2
2
|
//
|
|
3
3
|
// Cross-plugin picker: fetches the SIBLING vouchers plugin's public API at
|
|
4
4
|
// /api/vouchers and degrades gracefully: when the vouchers plugin isn't
|
package/src/index.ts
CHANGED
|
@@ -87,7 +87,7 @@ export { default as DatePicker, type DatePickerProps, type DateRangeValue } from
|
|
|
87
87
|
// Server-side / client-side data table with debounced search, column sort,
|
|
88
88
|
// pagination + "Show more" load mode, a filters slot, optional date filter, and
|
|
89
89
|
// an onRefetch handle. Ported from the host kit; injects its own CSS, no Tailwind.
|
|
90
|
-
// The type surface mirrors the
|
|
90
|
+
// The type surface mirrors the host UI kit's type contract exactly, so a
|
|
91
91
|
// caller written against host-ui works unchanged here.
|
|
92
92
|
export {
|
|
93
93
|
default as DataTable,
|
|
@@ -175,7 +175,7 @@ export {
|
|
|
175
175
|
export type { ParsedDate } from "./utils/parse-date";
|
|
176
176
|
|
|
177
177
|
// Self-contained helpers promoted from the former host kit so the library has no
|
|
178
|
-
//
|
|
178
|
+
// the host UI kit dependency.
|
|
179
179
|
export { highlightMatch, HighlightedText, matchesQuery, matchesAny } from "./utils/highlight";
|
|
180
180
|
export { confirm, type ConfirmOptions } from "./utils/confirm";
|
|
181
181
|
export { useFocusTrap, autoFocusOnMount, lockPullToRefresh, unlockPullToRefresh } from "./utils/dom";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vendored into plugin remotes.
|
|
2
2
|
//
|
|
3
3
|
// Build the <img src> for a financial account logo. Logos are object-storage
|
|
4
4
|
// only now: s3_link is the public URL and the sole reference (the legacy
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Promoted into the SDK.
|
|
2
2
|
//
|
|
3
3
|
// Session-scoped index of financial accounts keyed by id. The list rows, the
|
|
4
4
|
// detail payments list, etc. surface accounts by name only (server denormalises
|
package/src/utils/confirm.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Promise-based confirm dialog. Ported into ksui from the former host kit so the
|
|
2
2
|
// library is self-contained: ExistingAttachmentTile used to import `confirm`
|
|
3
|
-
// from
|
|
3
|
+
// from the host UI kit; it now imports it from here.
|
|
4
4
|
//
|
|
5
5
|
// Renders a ksui Modal + Buttons imperatively (outside any component tree) into
|
|
6
6
|
// a transient container appended to <body>, resolves the returned promise when
|
package/src/utils/highlight.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Search-match highlighting + tiny string-match helpers. Ported into ksui from
|
|
2
2
|
// the former host kit so the library is self-contained: ComboBox and
|
|
3
|
-
// MarkdownNotes used to import `highlightMatch` from
|
|
3
|
+
// MarkdownNotes used to import `highlightMatch` from the host UI kit; they now
|
|
4
4
|
// import it from here. Pure functions plus a `<mark>` wrapper.
|
|
5
5
|
//
|
|
6
6
|
// The default highlight tint ships as injected CSS (a `.ksui-mark` class) so the
|
package/src/utils/integration.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// runtime context — a permission check (MarkdownNotes gates its client-mention
|
|
5
5
|
// hover card on "clients.view") and the active workspace id (useAccountsIndex
|
|
6
6
|
// re-keys its fetch per workspace). The library used to pull these from
|
|
7
|
-
//
|
|
7
|
+
// the host UI kit; it now owns a tiny opt-in registry instead, so it stays a
|
|
8
8
|
// standalone dependency-free package.
|
|
9
9
|
//
|
|
10
10
|
// Default behavior with nothing configured (any plain SolidJS consumer):
|
package/src/utils/parse-date.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Natural-language date parser + date string formatters.
|
|
2
2
|
//
|
|
3
|
-
// Ported verbatim from the host
|
|
3
|
+
// Ported verbatim from the host DatePicker's `parse-date.ts` so ksui's
|
|
4
4
|
// DatePicker carries no host dependency. Pure functions, no UI, no framework —
|
|
5
5
|
// depends on nothing. Lives in utils/ (not components/) because it renders
|
|
6
6
|
// nothing; the DatePicker component calls it.
|
package/tailwind.js
CHANGED
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
* @kahitsan/ksui Tailwind CSS plugin
|
|
3
3
|
*
|
|
4
4
|
* Registers all ksui component utility classes so consumers don't need
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* // tailwind.config.js (v3)
|
|
8
|
-
* plugins: [require("@kahitsan/ksui/tailwind")]
|
|
5
|
+
* manual safelisting. Load from CSS:
|
|
9
6
|
*
|
|
10
7
|
* // app.css (v4)
|
|
11
8
|
* @plugin "@kahitsan/ksui/tailwind";
|
|
12
9
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* This plugin registers .ks-* component classes via addComponents/addUtilities.
|
|
11
|
+
* Raw Tailwind utilities used by ksui components (bg-amber-600/20, etc.)
|
|
12
|
+
* require a separate @source directive pointing at the ksui src directory.
|
|
13
|
+
*
|
|
14
|
+
* IMPORTANT: This file uses ESM (export default) because the ksui package.json
|
|
15
|
+
* sets "type": "module". CommonJS (module.exports) will fail to load under
|
|
16
|
+
* Tailwind v4's @plugin directive, which uses dynamic import().
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
19
|
/** @type {import('tailwindcss').Plugin} */
|
|
19
|
-
|
|
20
|
+
export default function ksuiTailwindPlugin({ addUtilities, addComponents }) {
|
|
20
21
|
// ─── Button intents ────────────────────────────────────────────────
|
|
21
22
|
// Primary (amber)
|
|
22
23
|
addUtilities({
|
|
@@ -272,6 +273,6 @@ module.exports = function ksuiTailwindPlugin({ addUtilities, addComponents }) {
|
|
|
272
273
|
});
|
|
273
274
|
};
|
|
274
275
|
|
|
275
|
-
|
|
276
|
+
export const meta = {
|
|
276
277
|
name: "@kahitsan/ksui",
|
|
277
278
|
};
|