@koide-labs/ui 0.0.3 → 0.0.5
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 +12 -12
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/alert-dialog/index.js +2 -1
- package/dist/components/anchor/index.d.ts +1 -1
- package/dist/components/anchor/index.js +14 -27
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/badge/index.js +14 -13
- package/dist/components/button/index.js +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/code/index.js +3 -2
- package/dist/components/collapse/index.js +6 -5
- package/dist/components/command/index.js +1 -0
- package/dist/components/context-menu/index.js +1 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/heading/index.js +11 -10
- package/dist/components/icon/index.js +27 -26
- package/dist/components/icon-button/index.js +9 -9
- package/dist/components/inline-code/index.js +10 -9
- package/dist/components/input/index.js +7 -6
- package/dist/components/meter/index.js +1 -0
- package/dist/components/multiline-input/index.js +1 -0
- package/dist/components/number-input/index.js +1 -0
- package/dist/components/password-input/index.js +4 -3
- package/dist/components/pill/index.js +11 -10
- package/dist/components/popover/index.js +1 -0
- package/dist/components/preview-card/index.js +70 -69
- package/dist/components/radio/index.js +39 -38
- package/dist/components/search-bar/index.js +1 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/separator/index.js +3 -2
- package/dist/components/slider/index.js +1 -0
- package/dist/components/spinner/index.js +5 -4
- package/dist/components/stacked-avatars/index.js +1 -0
- package/dist/components/status-banner/index.js +1 -0
- package/dist/components/surface/index.js +14 -13
- package/dist/components/switch/index.js +1 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/text/index.js +2 -1
- package/dist/components/theme-provider/index.js +3 -2
- package/dist/components/timestamp/index.js +1 -0
- package/dist/components/toast/index.js +4 -3
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/view/index.js +1 -0
- package/dist/components/visually-hidden/index.js +3 -2
- package/dist/index.js +16 -16
- package/dist/index11.css +1 -1
- package/dist/index12.css +1 -1
- package/dist/index13.css +1 -1
- package/dist/index14.css +1 -1
- package/dist/index15.css +1 -1
- package/dist/index16.css +1 -1
- package/dist/index17.css +1 -1
- package/dist/index18.css +1 -1
- package/dist/index6.css +1 -1
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Accessible, fresh, and simple.
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
pnpm add @koide-labs/ui
|
|
12
|
+
pnpm add @koide-labs/ui remixicon
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Because we import CSS modules for each component, you must add this to your Vite config.
|
|
@@ -24,17 +24,7 @@ export default defineConfig({
|
|
|
24
24
|
});
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
I highly recommend using TailwindCSS.
|
|
30
|
-
|
|
31
|
-
```css
|
|
32
|
-
@import "tailwindcss" important;
|
|
33
|
-
@import "@koide-labs/integrations/tailwind.css";
|
|
34
|
-
@import "@koide-labs/styles/core.css";
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Fonts
|
|
27
|
+
Then, include the necessary fonts.
|
|
38
28
|
|
|
39
29
|
- IBM Plex Sans
|
|
40
30
|
- IBM Plex Mono
|
|
@@ -52,6 +42,16 @@ I highly recommend using TailwindCSS.
|
|
|
52
42
|
/>
|
|
53
43
|
```
|
|
54
44
|
|
|
45
|
+
## Styling
|
|
46
|
+
|
|
47
|
+
I highly recommend using TailwindCSS.
|
|
48
|
+
|
|
49
|
+
```css
|
|
50
|
+
@import "tailwindcss" important;
|
|
51
|
+
@import "@koide-labs/ui/integrations/tailwind.css";
|
|
52
|
+
@import "@koide-labs/ui/styles/core.css";
|
|
53
|
+
```
|
|
54
|
+
|
|
55
55
|
## Development
|
|
56
56
|
|
|
57
57
|
Run the Storybook development server.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as o, jsxs as g } from "react/jsx-runtime";
|
|
2
3
|
import { c as _ } from "../../clsx-OuTLNxxd.js";
|
|
3
4
|
import { Button as v } from "../button/index.js";
|
|
@@ -8,7 +9,7 @@ import { t as D } from "../../transitions.module-CWX8e5cx.js";
|
|
|
8
9
|
import { u as R, a as I, D as T, b, c as w, d as N, e as O, f as S, s as n, g as k, h as B, i as j } from "../../dialog.module-BeF-6XAo.js";
|
|
9
10
|
import * as A from "react";
|
|
10
11
|
import { a as V } from "../../useRenderElement-DwToLA61.js";
|
|
11
|
-
import '../../
|
|
12
|
+
import '../../index18.css';function $(t) {
|
|
12
13
|
const {
|
|
13
14
|
children: r,
|
|
14
15
|
open: i,
|
|
@@ -5,4 +5,4 @@ export type AnchorProps = useRender.ComponentProps<"a"> & {
|
|
|
5
5
|
*/
|
|
6
6
|
external?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare function Anchor({ external, render,
|
|
8
|
+
export declare function Anchor({ external, render, ...props }: AnchorProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
@@ -1,38 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
anchor: l,
|
|
7
|
-
anchor__icon: h
|
|
1
|
+
"use client";
|
|
2
|
+
import { u as o } from "../../useRender-CLx7dR_1.js";
|
|
3
|
+
import { m as t } from "../../useRenderElement-DwToLA61.js";
|
|
4
|
+
import '../../index6.css';const a = "_anchor_zl00p_1", s = {
|
|
5
|
+
anchor: a
|
|
8
6
|
};
|
|
9
|
-
function
|
|
10
|
-
return
|
|
7
|
+
function p({ external: e, render: r, ...n }) {
|
|
8
|
+
return o({
|
|
11
9
|
defaultTagName: "a",
|
|
12
|
-
render:
|
|
13
|
-
props:
|
|
10
|
+
render: r,
|
|
11
|
+
props: t(
|
|
14
12
|
{
|
|
15
|
-
className:
|
|
16
|
-
...
|
|
13
|
+
className: s.anchor,
|
|
14
|
+
...e ? {
|
|
17
15
|
target: "_blank",
|
|
18
16
|
rel: "noreferrer"
|
|
19
|
-
} : {}
|
|
20
|
-
children: /* @__PURE__ */ c(s, { children: [
|
|
21
|
-
e,
|
|
22
|
-
n ? /* @__PURE__ */ m(
|
|
23
|
-
t,
|
|
24
|
-
{
|
|
25
|
-
name: "external-link-line",
|
|
26
|
-
size: "sm",
|
|
27
|
-
className: r.anchor__icon
|
|
28
|
-
}
|
|
29
|
-
) : null
|
|
30
|
-
] })
|
|
17
|
+
} : {}
|
|
31
18
|
},
|
|
32
|
-
|
|
19
|
+
n
|
|
33
20
|
)
|
|
34
21
|
});
|
|
35
22
|
}
|
|
36
23
|
export {
|
|
37
|
-
|
|
24
|
+
p as Anchor
|
|
38
25
|
};
|
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as c, Fragment as g } from "react/jsx-runtime";
|
|
2
3
|
import { c as p } from "../../clsx-OuTLNxxd.js";
|
|
3
4
|
import { Icon as f } from "../icon/index.js";
|
|
4
|
-
import { Text as
|
|
5
|
-
import { Tooltip as
|
|
6
|
-
import { View as
|
|
7
|
-
import { u } from "../../useRender-CLx7dR_1.js";
|
|
5
|
+
import { Text as u } from "../text/index.js";
|
|
6
|
+
import { Tooltip as _ } from "../tooltip/index.js";
|
|
7
|
+
import { View as b } from "../view/index.js";
|
|
8
|
+
import { u as h } from "../../useRender-CLx7dR_1.js";
|
|
8
9
|
import { m as x } from "../../useRenderElement-DwToLA61.js";
|
|
9
|
-
import '../../index7.css';const y = "_badge_sf2gl_1", T = "_badge_shiny_sf2gl_16",
|
|
10
|
+
import '../../index7.css';const y = "_badge_sf2gl_1", T = "_badge_shiny_sf2gl_16", t = {
|
|
10
11
|
badge: y,
|
|
11
12
|
badge_shiny: T
|
|
12
13
|
};
|
|
13
14
|
function R({
|
|
14
15
|
icon: r,
|
|
15
|
-
name:
|
|
16
|
+
name: m,
|
|
16
17
|
color: n,
|
|
17
18
|
shiny: i,
|
|
18
19
|
tagline: s,
|
|
19
20
|
render: a,
|
|
20
21
|
...l
|
|
21
22
|
}) {
|
|
22
|
-
const d =
|
|
23
|
+
const d = h({
|
|
23
24
|
defaultTagName: "span",
|
|
24
25
|
render: a,
|
|
25
26
|
props: x(
|
|
26
27
|
{
|
|
27
|
-
className: p(
|
|
28
|
-
children: /* @__PURE__ */ g
|
|
28
|
+
className: p(t.badge, i && t.badge_shiny),
|
|
29
|
+
children: /* @__PURE__ */ c(g, { children: [
|
|
29
30
|
r ? /* @__PURE__ */ e(f, { name: r }) : null,
|
|
30
|
-
|
|
31
|
+
m
|
|
31
32
|
] })
|
|
32
33
|
},
|
|
33
34
|
l
|
|
34
35
|
)
|
|
35
|
-
}), o = /* @__PURE__ */ e(
|
|
36
|
-
return s ? /* @__PURE__ */ e(
|
|
36
|
+
}), o = /* @__PURE__ */ e(b, { color: n, children: d });
|
|
37
|
+
return s ? /* @__PURE__ */ e(_, { trigger: o, children: /* @__PURE__ */ e(u, { size: "sm", multiline: !0, children: s }) }) : o;
|
|
37
38
|
}
|
|
38
39
|
export {
|
|
39
40
|
R as Badge
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import "react/jsx-runtime";
|
|
2
3
|
import "../../clsx-OuTLNxxd.js";
|
|
3
|
-
import { C
|
|
4
|
+
import { C } from "../../index-BX1XbbRk.js";
|
|
4
5
|
import "react";
|
|
5
6
|
import "../surface/index.js";
|
|
6
7
|
import "../text/index.js";
|
|
7
8
|
import "../view/index.js";
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
C as Code
|
|
10
11
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { c as p } from "../../clsx-OuTLNxxd.js";
|
|
2
3
|
import { useRef as d, useState as i, useLayoutEffect as m } from "react";
|
|
3
4
|
import { u } from "../../useRender-CLx7dR_1.js";
|
|
@@ -8,8 +9,8 @@ import '../../index9.css';const f = "_collapse_ejmjl_1", h = "_collapse_expand_e
|
|
|
8
9
|
collapse_hidden: x
|
|
9
10
|
};
|
|
10
11
|
function R({
|
|
11
|
-
expand:
|
|
12
|
-
render:
|
|
12
|
+
expand: s = !0,
|
|
13
|
+
render: o,
|
|
13
14
|
recalculate: c,
|
|
14
15
|
...a
|
|
15
16
|
}) {
|
|
@@ -21,14 +22,14 @@ function R({
|
|
|
21
22
|
e.removeAttribute("style"), e.style.width = `${l.current.offsetWidth}px`, e.className = t.collapse_hidden, document.body.appendChild(e), r(e.offsetHeight), e.remove();
|
|
22
23
|
}, [c]), u({
|
|
23
24
|
defaultTagName: "div",
|
|
24
|
-
render:
|
|
25
|
+
render: o,
|
|
25
26
|
ref: l,
|
|
26
27
|
props: _(
|
|
27
28
|
{
|
|
28
|
-
"aria-hidden": !
|
|
29
|
+
"aria-hidden": !s,
|
|
29
30
|
className: p(
|
|
30
31
|
t.collapse,
|
|
31
|
-
|
|
32
|
+
s && t.collapse_expand
|
|
32
33
|
),
|
|
33
34
|
style: { "--collapse-height": `${n}px` }
|
|
34
35
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as f, useContext as i } from "react";
|
|
3
4
|
import { Text as x } from "../text/index.js";
|
|
4
5
|
import { u as c } from "../../useRender-CLx7dR_1.js";
|
|
5
6
|
import { m as g } from "../../useRenderElement-DwToLA61.js";
|
|
@@ -12,7 +13,7 @@ import '../../index10.css';const p = "_heading_qlffn_1", v = {
|
|
|
12
13
|
4: "lg",
|
|
13
14
|
5: "md",
|
|
14
15
|
6: "md"
|
|
15
|
-
},
|
|
16
|
+
}, s = f(0);
|
|
16
17
|
function _({
|
|
17
18
|
level: e,
|
|
18
19
|
size: t,
|
|
@@ -20,8 +21,8 @@ function _({
|
|
|
20
21
|
render: o,
|
|
21
22
|
...r
|
|
22
23
|
}) {
|
|
23
|
-
const l = i(
|
|
24
|
-
defaultTagName: `h${
|
|
24
|
+
const l = i(s), a = d(e || l), u = c({
|
|
25
|
+
defaultTagName: `h${a}`,
|
|
25
26
|
render: o,
|
|
26
27
|
props: g(
|
|
27
28
|
{
|
|
@@ -30,22 +31,22 @@ function _({
|
|
|
30
31
|
r
|
|
31
32
|
)
|
|
32
33
|
});
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ m(
|
|
34
35
|
x,
|
|
35
36
|
{
|
|
36
|
-
render:
|
|
37
|
-
size: t || h[
|
|
37
|
+
render: u,
|
|
38
|
+
size: t || h[a],
|
|
38
39
|
color: n
|
|
39
40
|
}
|
|
40
41
|
);
|
|
41
42
|
}
|
|
42
43
|
function M({ level: e, render: t, ...n }) {
|
|
43
|
-
const o = i(
|
|
44
|
+
const o = i(s) ?? 0, r = d(e || o + 1), l = c({
|
|
44
45
|
defaultTagName: "section",
|
|
45
46
|
render: t,
|
|
46
47
|
props: n
|
|
47
48
|
});
|
|
48
|
-
return /* @__PURE__ */ s
|
|
49
|
+
return /* @__PURE__ */ m(s.Provider, { value: r, children: l });
|
|
49
50
|
}
|
|
50
51
|
function d(e = 1) {
|
|
51
52
|
return Math.max(Math.min(e, 6), 1);
|