@domphy/ui 0.1.2 → 0.1.3
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 +74 -69
- package/dist/core-theme-ui.global.js +3 -3
- package/dist/core-theme-ui.global.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,69 +1,74 @@
|
|
|
1
|
-
# @domphy/ui
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
# @domphy/ui
|
|
2
|
+
|
|
3
|
+
Ready-made patches for Domphy.
|
|
4
|
+
|
|
5
|
+
`@domphy/ui` includes `@domphy/core` and `@domphy/theme`, and provides patches for buttons, inputs, dialogs, menus, tabs, tooltips, and more.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @domphy/ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Example
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { ElementNode } from "@domphy/core"
|
|
17
|
+
import { themeApply } from "@domphy/theme"
|
|
18
|
+
import { button, tooltip } from "@domphy/ui"
|
|
19
|
+
|
|
20
|
+
themeApply()
|
|
21
|
+
|
|
22
|
+
const App = {
|
|
23
|
+
div: [
|
|
24
|
+
{
|
|
25
|
+
button: "Save",
|
|
26
|
+
$: [
|
|
27
|
+
button({ color: "primary" }),
|
|
28
|
+
tooltip({ content: "Save changes" }),
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
dataTheme: "light",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
new ElementNode(App).render(document.body)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## What A Patch Is
|
|
39
|
+
|
|
40
|
+
A patch returns a `PartialElement` and merges into a native element.
|
|
41
|
+
|
|
42
|
+
It does not create a wrapper component or own a separate DOM boundary.
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
{
|
|
46
|
+
button: "Save",
|
|
47
|
+
$: [button()],
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Customization
|
|
52
|
+
|
|
53
|
+
Most customization should happen in one of these ways:
|
|
54
|
+
|
|
55
|
+
1. pass patch props
|
|
56
|
+
2. use `dataTone` or `dataSize` context
|
|
57
|
+
3. override inline on the element
|
|
58
|
+
4. copy the patch into your app and create your own variant
|
|
59
|
+
|
|
60
|
+
## CDN
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<script src="https://unpkg.com/@domphy/ui/dist/core-theme-ui.global.js"></script>
|
|
64
|
+
<script>
|
|
65
|
+
const { core, theme, ui } = Domphy
|
|
66
|
+
</script>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Docs
|
|
70
|
+
|
|
71
|
+
- [UI guide](https://www.domphy.com/docs/ui/)
|
|
72
|
+
- [Customization](https://www.domphy.com/docs/ui/customization)
|
|
73
|
+
- [Creation](https://www.domphy.com/docs/ui/creation)
|
|
74
|
+
- [Patch catalog](https://www.domphy.com/docs/ui/patches/button)
|