@koide-labs/ui 0.0.3 → 0.0.4

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.
Files changed (53) hide show
  1. package/README.md +12 -12
  2. package/dist/components/accordion/index.js +1 -0
  3. package/dist/components/alert-dialog/index.js +2 -1
  4. package/dist/components/anchor/index.js +14 -13
  5. package/dist/components/avatar/index.js +1 -0
  6. package/dist/components/badge/index.js +14 -13
  7. package/dist/components/button/index.js +1 -0
  8. package/dist/components/checkbox/index.js +1 -0
  9. package/dist/components/code/index.js +3 -2
  10. package/dist/components/collapse/index.js +6 -5
  11. package/dist/components/command/index.js +1 -0
  12. package/dist/components/context-menu/index.js +1 -0
  13. package/dist/components/dialog/index.js +1 -0
  14. package/dist/components/heading/index.js +11 -10
  15. package/dist/components/icon/index.js +27 -26
  16. package/dist/components/icon-button/index.js +9 -9
  17. package/dist/components/inline-code/index.js +10 -9
  18. package/dist/components/input/index.js +7 -6
  19. package/dist/components/meter/index.js +1 -0
  20. package/dist/components/multiline-input/index.js +1 -0
  21. package/dist/components/number-input/index.js +1 -0
  22. package/dist/components/password-input/index.js +4 -3
  23. package/dist/components/pill/index.js +11 -10
  24. package/dist/components/popover/index.js +1 -0
  25. package/dist/components/preview-card/index.js +70 -69
  26. package/dist/components/radio/index.js +39 -38
  27. package/dist/components/search-bar/index.js +1 -0
  28. package/dist/components/select/index.js +1 -0
  29. package/dist/components/separator/index.js +3 -2
  30. package/dist/components/slider/index.js +1 -0
  31. package/dist/components/spinner/index.js +5 -4
  32. package/dist/components/stacked-avatars/index.js +1 -0
  33. package/dist/components/status-banner/index.js +1 -0
  34. package/dist/components/surface/index.js +14 -13
  35. package/dist/components/switch/index.js +1 -0
  36. package/dist/components/tabs/index.js +1 -0
  37. package/dist/components/text/index.js +2 -1
  38. package/dist/components/theme-provider/index.js +3 -2
  39. package/dist/components/timestamp/index.js +1 -0
  40. package/dist/components/toast/index.js +4 -3
  41. package/dist/components/tooltip/index.js +1 -0
  42. package/dist/components/view/index.js +1 -0
  43. package/dist/components/visually-hidden/index.js +3 -2
  44. package/dist/index.js +16 -16
  45. package/dist/index11.css +1 -1
  46. package/dist/index12.css +1 -1
  47. package/dist/index13.css +1 -1
  48. package/dist/index14.css +1 -1
  49. package/dist/index15.css +1 -1
  50. package/dist/index16.css +1 -1
  51. package/dist/index17.css +1 -1
  52. package/dist/index18.css +1 -1
  53. 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
- ## Styling
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 k, jsxs as ne } from "react/jsx-runtime";
2
3
  import { c as Ce } from "../../clsx-OuTLNxxd.js";
3
4
  import { textify as te } from "../../-utils.js";
@@ -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 '../../index17.css';function $(t) {
12
+ import '../../index18.css';function $(t) {
12
13
  const {
13
14
  children: r,
14
15
  open: i,
@@ -1,16 +1,17 @@
1
- import { jsxs as c, Fragment as s, jsx as m } from "react/jsx-runtime";
2
- import { Icon as t } from "../icon/index.js";
3
- import { u as _ } from "../../useRender-CLx7dR_1.js";
4
- import { m as i } from "../../useRenderElement-DwToLA61.js";
5
- import '../../index6.css';const l = "_anchor_71aa4_1", h = "_anchor__icon_71aa4_14", r = {
6
- anchor: l,
1
+ "use client";
2
+ import { jsxs as c, Fragment as s, jsx as t } from "react/jsx-runtime";
3
+ import { Icon as m } from "../icon/index.js";
4
+ import { u as i } from "../../useRender-CLx7dR_1.js";
5
+ import { m as l } from "../../useRenderElement-DwToLA61.js";
6
+ import '../../index6.css';const _ = "_anchor_71aa4_1", h = "_anchor__icon_71aa4_14", r = {
7
+ anchor: _,
7
8
  anchor__icon: h
8
9
  };
9
- function x({ external: n, render: o, children: e, ...a }) {
10
- return _({
10
+ function x({ external: n, render: e, children: o, ...a }) {
11
+ return i({
11
12
  defaultTagName: "a",
12
- render: o,
13
- props: i(
13
+ render: e,
14
+ props: l(
14
15
  {
15
16
  className: r.anchor,
16
17
  ...n ? {
@@ -18,9 +19,9 @@ function x({ external: n, render: o, children: e, ...a }) {
18
19
  rel: "noreferrer"
19
20
  } : {},
20
21
  children: /* @__PURE__ */ c(s, { children: [
21
- e,
22
- n ? /* @__PURE__ */ m(
23
- t,
22
+ o,
23
+ n ? /* @__PURE__ */ t(
24
+ m,
24
25
  {
25
26
  name: "external-link-line",
26
27
  size: "sm",
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as m, jsxs as L } from "react/jsx-runtime";
2
3
  import { c as R } from "../../clsx-OuTLNxxd.js";
3
4
  import * as o from "react";
@@ -1,39 +1,40 @@
1
- import { jsx as e, jsxs as g, Fragment as c } from "react/jsx-runtime";
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 _ } from "../text/index.js";
5
- import { Tooltip as b } from "../tooltip/index.js";
6
- import { View as h } from "../view/index.js";
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", m = {
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: t,
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 = u({
23
+ const d = h({
23
24
  defaultTagName: "span",
24
25
  render: a,
25
26
  props: x(
26
27
  {
27
- className: p(m.badge, i && m.badge_shiny),
28
- children: /* @__PURE__ */ g(c, { children: [
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
- t
31
+ m
31
32
  ] })
32
33
  },
33
34
  l
34
35
  )
35
- }), o = /* @__PURE__ */ e(h, { color: n, children: d });
36
- return s ? /* @__PURE__ */ e(b, { trigger: o, children: /* @__PURE__ */ e(_, { size: "sm", multiline: !0, children: s }) }) : o;
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,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs as b, jsx as _ } from "react/jsx-runtime";
2
3
  import { c as l } from "../../clsx-OuTLNxxd.js";
3
4
  import { textify as g } from "../../-utils.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs as A, jsx as m } from "react/jsx-runtime";
2
3
  import { Icon as we } from "../icon/index.js";
3
4
  import { Text as Fe } from "../text/index.js";
@@ -1,10 +1,11 @@
1
+ "use client";
1
2
  import "react/jsx-runtime";
2
3
  import "../../clsx-OuTLNxxd.js";
3
- import { C as a } from "../../index-BX1XbbRk.js";
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
- a as Code
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: o = !0,
12
- render: s,
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: s,
25
+ render: o,
25
26
  ref: l,
26
27
  props: _(
27
28
  {
28
- "aria-hidden": !o,
29
+ "aria-hidden": !s,
29
30
  className: p(
30
31
  t.collapse,
31
- o && t.collapse_expand
32
+ s && t.collapse_expand
32
33
  ),
33
34
  style: { "--collapse-height": `${n}px` }
34
35
  },
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as E, jsxs as oe, Fragment as Qe } from "react/jsx-runtime";
2
3
  import { c as We } from "../../clsx-OuTLNxxd.js";
3
4
  import * as a from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as c, jsxs as ee } from "react/jsx-runtime";
2
3
  import { c as de } from "../../clsx-OuTLNxxd.js";
3
4
  import * as t from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
3
  import { c as f } from "../../clsx-OuTLNxxd.js";
3
4
  import { Button as y } from "../button/index.js";
@@ -1,5 +1,6 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { createContext as u, useContext as i } from "react";
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
- }, a = u(0);
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(a), m = d(e || l), f = c({
24
- defaultTagName: `h${m}`,
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__ */ s(
34
+ return /* @__PURE__ */ m(
34
35
  x,
35
36
  {
36
- render: f,
37
- size: t || h[m],
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(a) ?? 0, r = d(e || o + 1), l = c({
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(a.Provider, { value: r, children: l });
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);