@kahitsan/ksui 0.10.2 → 0.11.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.
- package/README.md +19 -21
- package/package.json +3 -7
- package/src/components/base/CameraCapture.tsx +2 -2
- package/src/components/base/DataTable.tsx +940 -0
- package/src/components/base/ExistingAttachmentTile.tsx +3 -3
- package/src/components/base/ImageCropper.tsx +3 -3
- package/src/components/base/Modal.tsx +198 -0
- package/src/components/composite/ComboBox.tsx +2 -2
- package/src/components/composite/FormActions.tsx +4 -4
- package/src/components/composite/MarkdownNotes.tsx +8 -11
- package/src/index.ts +47 -14
- package/src/utils/accounts-index.tsx +7 -6
- package/src/utils/confirm.tsx +84 -0
- package/src/utils/dom.ts +197 -0
- package/src/utils/highlight.tsx +67 -0
- package/src/utils/integration.ts +49 -0
- package/host-ui.d.ts +0 -145
package/README.md
CHANGED
|
@@ -31,12 +31,12 @@ There are two ways to use KSUI.
|
|
|
31
31
|
plugins, these are the shared components you reuse instead of writing your
|
|
32
32
|
own copy.
|
|
33
33
|
|
|
34
|
-
One honest note so nothing surprises you.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
One honest note so nothing surprises you. Every component is self-contained: the
|
|
35
|
+
library depends only on `solid-js` and `lucide-solid` and injects its own CSS, so
|
|
36
|
+
there is no host UI kit and no Tailwind to wire up. A handful of components (the
|
|
37
|
+
voucher and payment account pickers, the attachment tiles) call a backend that
|
|
38
|
+
answers certain requests, so they shine inside an app built the KahitSan way, but
|
|
39
|
+
they degrade gracefully without one. Each component page says what it needs.
|
|
40
40
|
|
|
41
41
|
## What is inside
|
|
42
42
|
|
|
@@ -97,24 +97,22 @@ import { AccountAvatar } from "@kahitsan/ksui";
|
|
|
97
97
|
|
|
98
98
|
## The honest setup note
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
One thing this library expects from the app around it:
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
- **`solid-js` stays external.** This library ships as source, and your own
|
|
103
|
+
`vite-plugin-solid` compiles it. Keep `solid-js` as a single shared copy in
|
|
104
|
+
your app (not bundled twice), so there is only one Solid instance running.
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
That is the whole setup. There is no host UI kit, no Tailwind, and no app-provided
|
|
107
|
+
primitives to wire up — every component injects its own CSS and depends only on
|
|
108
|
+
`solid-js` + `lucide-solid`. A few components can do *more* when the surrounding
|
|
109
|
+
app feeds them context (a permission check, the active workspace id) through the
|
|
110
|
+
optional `configurePermissions` / `configureActiveWorkspace` helpers, but they
|
|
111
|
+
degrade gracefully when those are not configured.
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
backend that answers calls like `/api/clients`. The docs site walks through how
|
|
117
|
-
to mock the host kit and stub those calls so you can see every component render.
|
|
113
|
+
Some components (the voucher and payment account pickers, the attachment tiles)
|
|
114
|
+
call a backend at paths like `/api/financial-accounts`. The docs site stubs those
|
|
115
|
+
calls so you can see every component render with no server.
|
|
118
116
|
|
|
119
117
|
## Docs
|
|
120
118
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kahitsan/ksui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "ksui is a set of
|
|
3
|
+
"version": "0.11.0",
|
|
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",
|
|
7
7
|
"types": "./src/index.ts",
|
|
@@ -12,9 +12,6 @@
|
|
|
12
12
|
"development": "./src/index.ts",
|
|
13
13
|
"import": "./src/index.ts"
|
|
14
14
|
},
|
|
15
|
-
"./host-ui": {
|
|
16
|
-
"types": "./host-ui.d.ts"
|
|
17
|
-
},
|
|
18
15
|
"./components/*": {
|
|
19
16
|
"solid": "./src/components/*.tsx",
|
|
20
17
|
"types": "./src/components/*.tsx",
|
|
@@ -23,8 +20,7 @@
|
|
|
23
20
|
}
|
|
24
21
|
},
|
|
25
22
|
"files": [
|
|
26
|
-
"src"
|
|
27
|
-
"host-ui.d.ts"
|
|
23
|
+
"src"
|
|
28
24
|
],
|
|
29
25
|
"scripts": {
|
|
30
26
|
"typecheck": "tsc --noEmit",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Source: KahitSan/kserp src/components/CameraCapture.tsx (vendored into the plugin remote).
|
|
2
|
-
// getUserMedia camera capture modal. Button
|
|
2
|
+
// getUserMedia camera capture modal. Button is ksui's own base primitive.
|
|
3
3
|
|
|
4
4
|
import { createSignal, onCleanup, onMount, Show } from "solid-js";
|
|
5
|
-
import
|
|
5
|
+
import Button from "./Button";
|
|
6
6
|
import Camera from "lucide-solid/icons/camera";
|
|
7
7
|
import X from "lucide-solid/icons/x";
|
|
8
8
|
|