@coinloger/dev-ui 0.1.1 → 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.
Files changed (39) hide show
  1. package/dist/cjs/components/Badge/Badge.cjs +1 -1
  2. package/dist/cjs/components/Button/Button.cjs +1 -1
  3. package/dist/cjs/components/Card/Card.cjs +1 -1
  4. package/dist/cjs/components/Checkbox/Checkbox.cjs +1 -1
  5. package/dist/cjs/components/Container/Container.cjs +1 -1
  6. package/dist/cjs/components/Flex/Flex.cjs +1 -1
  7. package/dist/cjs/components/Flex/FlexItem.cjs +1 -1
  8. package/dist/cjs/components/Input/Input.cjs +1 -1
  9. package/dist/cjs/components/Modal/Modal.cjs +1 -1
  10. package/dist/cjs/components/Radio/Radio.cjs +1 -1
  11. package/dist/cjs/components/Select/Select.cjs +1 -1
  12. package/dist/cjs/components/Switch/Switch.cjs +1 -1
  13. package/dist/cjs/components/Table/Table.cjs +1 -1
  14. package/dist/cjs/components/Tabs/Tabs.cjs +1 -1
  15. package/dist/cjs/components/Typography/Heading.cjs +1 -1
  16. package/dist/cjs/components/Typography/Text.cjs +1 -1
  17. package/dist/cjs/theme.cjs +1 -1
  18. package/dist/esm/components/Badge/Badge.js +14 -22
  19. package/dist/esm/components/Button/Button.js +12 -24
  20. package/dist/esm/components/Card/Card.js +10 -18
  21. package/dist/esm/components/Checkbox/Checkbox.js +17 -33
  22. package/dist/esm/components/Container/Container.js +11 -18
  23. package/dist/esm/components/Flex/Flex.js +26 -44
  24. package/dist/esm/components/Flex/FlexItem.js +24 -38
  25. package/dist/esm/components/Input/Input.js +16 -46
  26. package/dist/esm/components/Modal/Modal.d.ts +0 -35
  27. package/dist/esm/components/Modal/Modal.js +60 -83
  28. package/dist/esm/components/Radio/Radio.js +16 -32
  29. package/dist/esm/components/Select/Select.d.ts +1 -17
  30. package/dist/esm/components/Select/Select.js +62 -79
  31. package/dist/esm/components/Switch/Switch.js +18 -34
  32. package/dist/esm/components/Table/Table.js +13 -22
  33. package/dist/esm/components/Tabs/Tabs.d.ts +0 -25
  34. package/dist/esm/components/Tabs/Tabs.js +45 -70
  35. package/dist/esm/components/Typography/Heading.js +15 -25
  36. package/dist/esm/components/Typography/Text.js +19 -32
  37. package/dist/esm/theme.d.ts +0 -5
  38. package/dist/esm/theme.js +11 -16
  39. package/package.json +15 -5
@@ -1,53 +1,37 @@
1
- import { jsxs as m, jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as p } from "react";
3
- import { clsx as h } from "clsx";
4
- import * as e from "prop-types";
1
+ import { jsxs as m, jsx as i } from "react/jsx-runtime";
2
+ import { forwardRef as l } from "react";
3
+ import { clsx as o } from "clsx";
5
4
  /* empty css */
6
- const a = p(
7
- ({ className: o, label: i, error: u, disabled: r, size: t = "md", variant: c = "primary", ...n }, l) => /* @__PURE__ */ m(
5
+ const p = l(
6
+ ({ className: c, label: s, error: u, disabled: t, size: r = "md", variant: a = "primary", ...e }, h) => /* @__PURE__ */ m(
8
7
  "label",
9
8
  {
10
- className: h(
9
+ className: o(
11
10
  "ui-switch-label",
12
- `ui-switch-${t}`,
13
- `ui-switch-${c}`,
14
- r && "ui-switch-disabled",
15
- o
11
+ `ui-switch-${r}`,
12
+ `ui-switch-${a}`,
13
+ t && "ui-switch-disabled",
14
+ c
16
15
  ),
17
16
  children: [
18
- /* @__PURE__ */ s(
17
+ /* @__PURE__ */ i(
19
18
  "input",
20
19
  {
21
20
  type: "checkbox",
22
21
  className: "ui-switch-input",
23
- disabled: r,
24
- ref: l,
22
+ disabled: t,
23
+ ref: h,
25
24
  role: "switch",
26
- ...n
25
+ ...e
27
26
  }
28
27
  ),
29
- /* @__PURE__ */ s("span", { className: "ui-switch-track", children: /* @__PURE__ */ s("span", { className: "ui-switch-thumb" }) }),
30
- i && /* @__PURE__ */ s("span", { className: "ui-switch-text", children: i })
28
+ /* @__PURE__ */ i("span", { className: "ui-switch-track", children: /* @__PURE__ */ i("span", { className: "ui-switch-thumb" }) }),
29
+ s && /* @__PURE__ */ i("span", { className: "ui-switch-text", children: s })
31
30
  ]
32
31
  }
33
32
  )
34
33
  );
35
- a.displayName = "Switch";
36
- a.propTypes = {
37
- label: e.node,
38
- error: e.bool,
39
- size: e.oneOf(["sm", "md", "lg", "xl"]),
40
- variant: e.oneOf(["primary", "success", "warning", "danger"]),
41
- checked: e.bool,
42
- defaultChecked: e.bool,
43
- onChange: e.func,
44
- name: e.string,
45
- value: e.oneOfType([e.string, e.number]),
46
- disabled: e.bool,
47
- required: e.bool,
48
- id: e.string,
49
- className: e.string
50
- };
34
+ p.displayName = "Switch";
51
35
  export {
52
- a as Switch
36
+ p as Switch
53
37
  };
@@ -1,29 +1,20 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as n } from "react";
3
- import * as e from "prop-types";
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as d } from "react";
4
3
  /* empty css */
5
- const r = n(
6
- ({ className: s, bordered: a = !0, striped: i, hover: l, size: t = "md", children: m, ...b }, d) => {
7
- const p = [
4
+ const u = d(
5
+ ({ className: a, bordered: r = !0, striped: t, hover: i, size: l = "md", children: s, ...o }, m) => {
6
+ const b = [
8
7
  "ui-table",
9
- a && "ui-table-bordered",
10
- i && "ui-table-striped",
11
- l && "ui-table-hover",
12
- t === "sm" && "ui-table-sm",
13
- s
8
+ r && "ui-table-bordered",
9
+ t && "ui-table-striped",
10
+ i && "ui-table-hover",
11
+ l === "sm" && "ui-table-sm",
12
+ a
14
13
  ].filter(Boolean).join(" ");
15
- return /* @__PURE__ */ o("div", { className: "ui-table-responsive", children: /* @__PURE__ */ o("table", { ref: d, className: p, ...b, children: m }) });
14
+ return /* @__PURE__ */ e("div", { className: "ui-table-responsive", children: /* @__PURE__ */ e("table", { ref: m, className: b, ...o, children: s }) });
16
15
  }
17
16
  );
18
- r.displayName = "Table";
19
- r.propTypes = {
20
- bordered: e.bool,
21
- striped: e.bool,
22
- hover: e.bool,
23
- size: e.oneOf(["sm", "md"]),
24
- children: e.node,
25
- className: e.string
26
- };
17
+ u.displayName = "Table";
27
18
  export {
28
- r as Table
19
+ u as Table
29
20
  };
@@ -1,6 +1,5 @@
1
1
  import { ReactNode, MouseEventHandler } from 'react';
2
2
 
3
- import * as PropTypes from 'prop-types';
4
3
  /**
5
4
  * Tabs Root properties.
6
5
  */
@@ -40,41 +39,17 @@ export interface TabsContentProps {
40
39
  export declare const Tabs: {
41
40
  ({ defaultValue, value, onValueChange, children, className }: TabsProps): import("react/jsx-runtime").JSX.Element;
42
41
  displayName: string;
43
- propTypes: {
44
- defaultValue: PropTypes.Requireable<string>;
45
- value: PropTypes.Requireable<string>;
46
- onValueChange: PropTypes.Requireable<(...args: any[]) => any>;
47
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
48
- className: PropTypes.Requireable<string>;
49
- };
50
42
  } & {
51
43
  List: {
52
44
  ({ className, children, variant, ...props }: TabsListProps): import("react/jsx-runtime").JSX.Element;
53
45
  displayName: string;
54
- propTypes: {
55
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
56
- variant: PropTypes.Requireable<string>;
57
- className: PropTypes.Requireable<string>;
58
- };
59
46
  };
60
47
  Trigger: {
61
48
  ({ value, className, children, onClick, ...props }: TabsTriggerProps): import("react/jsx-runtime").JSX.Element;
62
49
  displayName: string;
63
- propTypes: {
64
- value: PropTypes.Validator<string>;
65
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
66
- className: PropTypes.Requireable<string>;
67
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
68
- disabled: PropTypes.Requireable<boolean>;
69
- };
70
50
  };
71
51
  Content: {
72
52
  ({ value, className, children, ...props }: TabsContentProps): import("react/jsx-runtime").JSX.Element | null;
73
53
  displayName: string;
74
- propTypes: {
75
- value: PropTypes.Validator<string>;
76
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
77
- className: PropTypes.Requireable<string>;
78
- };
79
54
  };
80
55
  };
@@ -1,92 +1,67 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { createContext as N, useState as v, useId as y, useContext as f } from "react";
3
- import { clsx as d } from "clsx";
4
- import * as t from "prop-types";
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { createContext as x, useState as $, useId as N, useContext as m } from "react";
3
+ import { clsx as b } from "clsx";
5
4
  /* empty css */
6
- const p = N(null), m = ({ defaultValue: e, value: n, onValueChange: i, children: r, className: a }) => {
7
- const [s, o] = v(e || ""), c = n !== void 0, b = c ? n : s, u = y(), g = (I) => {
8
- c || o(I), i?.(I);
5
+ const u = x(null), C = ({ defaultValue: t, value: s, onValueChange: a, children: o, className: n }) => {
6
+ const [e, i] = $(t || ""), r = s !== void 0, l = r ? s : e, d = N(), g = (T) => {
7
+ r || i(T), a?.(T);
9
8
  };
10
- return /* @__PURE__ */ l(p.Provider, { value: { value: b, onChange: g, baseId: u }, children: /* @__PURE__ */ l("div", { className: d("ui-tabs", a), children: r }) });
11
- }, T = ({ className: e, children: n, variant: i = "line", ...r }) => /* @__PURE__ */ l(
9
+ return /* @__PURE__ */ c(u.Provider, { value: { value: l, onChange: g, baseId: d }, children: /* @__PURE__ */ c("div", { className: b("ui-tabs", n), children: o }) });
10
+ }, I = ({ className: t, children: s, variant: a = "line", ...o }) => /* @__PURE__ */ c(
12
11
  "div",
13
12
  {
14
13
  role: "tablist",
15
- className: d("ui-tabs-list", `ui-tabs-list-${i}`, e),
16
- ...r,
17
- children: n
14
+ className: b("ui-tabs-list", `ui-tabs-list-${a}`, t),
15
+ ...o,
16
+ children: s
18
17
  }
19
- ), h = ({ value: e, className: n, children: i, onClick: r, ...a }) => {
20
- const s = f(p);
21
- if (!s) throw new Error("TabsTrigger must be used within Tabs");
22
- const o = s.value === e, c = `${s.baseId}-trigger-${e}`, b = `${s.baseId}-content-${e}`, u = (g) => {
23
- s.onChange(e), r?.(g);
18
+ ), p = ({ value: t, className: s, children: a, onClick: o, ...n }) => {
19
+ const e = m(u);
20
+ if (!e) throw new Error("TabsTrigger must be used within Tabs");
21
+ const i = e.value === t, r = `${e.baseId}-trigger-${t}`, l = `${e.baseId}-content-${t}`, d = (g) => {
22
+ e.onChange(t), o?.(g);
24
23
  };
25
- return /* @__PURE__ */ l(
24
+ return /* @__PURE__ */ c(
26
25
  "button",
27
26
  {
28
27
  type: "button",
29
28
  role: "tab",
30
- "aria-selected": o,
31
- "aria-controls": b,
32
- id: c,
33
- tabIndex: o ? 0 : -1,
34
- "data-state": o ? "active" : "inactive",
35
- className: d("ui-tabs-trigger", n),
36
- onClick: u,
37
- ...a,
38
- children: i
29
+ "aria-selected": i,
30
+ "aria-controls": l,
31
+ id: r,
32
+ tabIndex: i ? 0 : -1,
33
+ "data-state": i ? "active" : "inactive",
34
+ className: b("ui-tabs-trigger", s),
35
+ onClick: d,
36
+ ...n,
37
+ children: a
39
38
  }
40
39
  );
41
- }, C = ({ value: e, className: n, children: i, ...r }) => {
42
- const a = f(p);
43
- if (!a) throw new Error("TabsContent must be used within Tabs");
44
- const s = a.value === e, o = `${a.baseId}-trigger-${e}`, c = `${a.baseId}-content-${e}`;
45
- return s ? /* @__PURE__ */ l(
40
+ }, h = ({ value: t, className: s, children: a, ...o }) => {
41
+ const n = m(u);
42
+ if (!n) throw new Error("TabsContent must be used within Tabs");
43
+ const e = n.value === t, i = `${n.baseId}-trigger-${t}`, r = `${n.baseId}-content-${t}`;
44
+ return e ? /* @__PURE__ */ c(
46
45
  "div",
47
46
  {
48
47
  role: "tabpanel",
49
- id: c,
50
- "aria-labelledby": o,
48
+ id: r,
49
+ "aria-labelledby": i,
51
50
  tabIndex: 0,
52
- className: d("ui-tabs-content", n),
53
- ...r,
54
- children: i
51
+ className: b("ui-tabs-content", s),
52
+ ...o,
53
+ children: a
55
54
  }
56
55
  ) : null;
57
- }, k = Object.assign(m, {
58
- List: T,
59
- Trigger: h,
60
- Content: C
56
+ }, L = Object.assign(C, {
57
+ List: I,
58
+ Trigger: p,
59
+ Content: h
61
60
  });
62
- m.displayName = "Tabs";
63
- T.displayName = "TabsList";
64
- h.displayName = "TabsTrigger";
65
- C.displayName = "TabsContent";
66
- m.propTypes = {
67
- defaultValue: t.string,
68
- value: t.string,
69
- onValueChange: t.func,
70
- children: t.node,
71
- className: t.string
72
- };
73
- T.propTypes = {
74
- children: t.node,
75
- variant: t.oneOf(["line", "pills"]),
76
- className: t.string
77
- };
78
- h.propTypes = {
79
- value: t.string.isRequired,
80
- children: t.node,
81
- className: t.string,
82
- onClick: t.func,
83
- disabled: t.bool
84
- };
85
- C.propTypes = {
86
- value: t.string.isRequired,
87
- children: t.node,
88
- className: t.string
89
- };
61
+ C.displayName = "Tabs";
62
+ I.displayName = "TabsList";
63
+ p.displayName = "TabsTrigger";
64
+ h.displayName = "TabsContent";
90
65
  export {
91
- k as Tabs
66
+ L as Tabs
92
67
  };
@@ -1,39 +1,29 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { forwardRef as u } from "react";
3
- import { clsx as f } from "clsx";
4
- import * as e from "prop-types";
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { forwardRef as d } from "react";
3
+ import { clsx as s } from "clsx";
5
4
  /* empty css */
6
- const i = u(
7
- ({ className: n, children: a, level: o = 1, truncate: m, lines: t, style: r, ...p }, s) => {
8
- const c = `h${o}`, l = t ? { ...r, "--ui-line-clamp": t } : r;
9
- return /* @__PURE__ */ d(
5
+ const f = d(
6
+ ({ className: i, children: r, level: o = 1, truncate: m, lines: t, style: a, ...e }, n) => {
7
+ const c = `h${o}`, p = t ? { ...a, "--ui-line-clamp": t } : a;
8
+ return /* @__PURE__ */ u(
10
9
  c,
11
10
  {
12
- ref: s,
13
- className: f(
11
+ ref: n,
12
+ className: s(
14
13
  "ui-heading",
15
14
  `ui-heading-h${o}`,
16
15
  m && "ui-text-truncate",
17
16
  t && "ui-text-clamp",
18
- n
17
+ i
19
18
  ),
20
- style: l,
21
- ...p,
22
- children: a
19
+ style: p,
20
+ ...e,
21
+ children: r
23
22
  }
24
23
  );
25
24
  }
26
25
  );
27
- i.displayName = "Heading";
28
- i.propTypes = {
29
- level: e.oneOf([1, 2, 3, 4, 5, 6]),
30
- truncate: e.bool,
31
- lines: e.number,
32
- children: e.node,
33
- className: e.string,
34
- style: e.object,
35
- id: e.string
36
- };
26
+ f.displayName = "Heading";
37
27
  export {
38
- i as Heading
28
+ f as Heading
39
29
  };
@@ -1,44 +1,31 @@
1
- import { jsx as x } from "react/jsx-runtime";
2
- import { forwardRef as b } from "react";
3
- import { clsx as f } from "clsx";
4
- import * as t from "prop-types";
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { forwardRef as l } from "react";
3
+ import { clsx as n } from "clsx";
5
4
  /* empty css */
6
- const r = b(
7
- ({ className: i, children: a, variant: l = "body", weight: o, muted: n, truncate: p, lines: e, as: s = "p", style: m, ...u }, c) => {
8
- const d = e ? { ...m, "--ui-line-clamp": e } : m;
9
- return /* @__PURE__ */ x(
10
- s,
5
+ const d = l(
6
+ ({ className: m, children: r, variant: i = "body", weight: e, muted: x, truncate: p, lines: t, as: u = "p", style: o, ...a }, c) => {
7
+ const s = t ? { ...o, "--ui-line-clamp": t } : o;
8
+ return /* @__PURE__ */ f(
9
+ u,
11
10
  {
12
11
  ref: c,
13
- className: f(
12
+ className: n(
14
13
  "ui-text",
15
- `ui-text-${l}`,
16
- o && `ui-text-weight-${o}`,
17
- n && "ui-text-muted",
14
+ `ui-text-${i}`,
15
+ e && `ui-text-weight-${e}`,
16
+ x && "ui-text-muted",
18
17
  p && "ui-text-truncate",
19
- e && "ui-text-clamp",
20
- i
18
+ t && "ui-text-clamp",
19
+ m
21
20
  ),
22
- style: d,
23
- ...u,
24
- children: a
21
+ style: s,
22
+ ...a,
23
+ children: r
25
24
  }
26
25
  );
27
26
  }
28
27
  );
29
- r.displayName = "Text";
30
- r.propTypes = {
31
- variant: t.oneOf(["body", "small", "caption", "lead"]),
32
- weight: t.oneOf(["normal", "medium", "semibold", "bold"]),
33
- muted: t.bool,
34
- truncate: t.bool,
35
- lines: t.number,
36
- as: t.elementType,
37
- children: t.node,
38
- className: t.string,
39
- style: t.object,
40
- id: t.string
41
- };
28
+ d.displayName = "Text";
42
29
  export {
43
- r as Text
30
+ d as Text
44
31
  };
@@ -1,15 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { ThemeConfig } from './types';
3
3
 
4
- import * as PropTypes from 'prop-types';
5
4
  export declare const ThemeProvider: {
6
5
  ({ theme, children }: {
7
6
  theme: ThemeConfig;
8
7
  children: React.ReactNode;
9
8
  }): import("react/jsx-runtime").JSX.Element;
10
9
  displayName: string;
11
- propTypes: {
12
- theme: PropTypes.Validator<object>;
13
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
14
- };
15
10
  };
package/dist/esm/theme.js CHANGED
@@ -1,14 +1,13 @@
1
- import { jsx as y } from "react/jsx-runtime";
2
- import { useMemo as u } from "react";
3
- import * as t from "prop-types";
4
- function e(o) {
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { useMemo as p } from "react";
3
+ function u(o) {
5
4
  return o && typeof o == "object" && !Array.isArray(o);
6
5
  }
7
- function d(o) {
6
+ function y(o) {
8
7
  const i = {}, s = (r, n) => {
9
8
  Object.keys(r).forEach((a) => {
10
- const c = r[a], p = `${n}-${a}`;
11
- e(c) ? s(c, p) : i[`-${p}`] = c;
9
+ const c = r[a], t = `${n}-${a}`;
10
+ u(c) ? s(c, t) : i[`-${t}`] = c;
12
11
  });
13
12
  };
14
13
  return o.colors && Object.keys(o.colors).forEach((r) => {
@@ -18,15 +17,11 @@ function d(o) {
18
17
  n && s(n, `-ui-${r.toLowerCase()}`);
19
18
  }), o.spacing && s(o.spacing, "-ui-spacing"), o.radius && s(o.radius, "-ui-radius"), o.shadows && s(o.shadows, "-ui-shadow"), o.typography && s(o.typography, "-ui-typography"), i;
20
19
  }
21
- const f = ({ theme: o, children: i }) => {
22
- const s = u(() => d(o), [o]);
23
- return /* @__PURE__ */ y("div", { style: { display: "contents", ...s }, children: i });
24
- };
25
- f.displayName = "ThemeProvider";
26
- f.propTypes = {
27
- theme: t.object.isRequired,
28
- children: t.node
20
+ const d = ({ theme: o, children: i }) => {
21
+ const s = p(() => y(o), [o]);
22
+ return /* @__PURE__ */ f("div", { style: { display: "contents", ...s }, children: i });
29
23
  };
24
+ d.displayName = "ThemeProvider";
30
25
  export {
31
- f as ThemeProvider
26
+ d as ThemeProvider
32
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinloger/dev-ui",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.cjs",
@@ -10,6 +10,14 @@
10
10
  "dist",
11
11
  "style.css"
12
12
  ],
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/esm/index.d.ts",
16
+ "import": "./dist/esm/index.js",
17
+ "require": "./dist/cjs/index.cjs"
18
+ },
19
+ "./style.css": "./style.css"
20
+ },
13
21
  "style": "./style.css",
14
22
  "scripts": {
15
23
  "dev": "vite",
@@ -24,13 +32,15 @@
24
32
  "react": "^19.2.0",
25
33
  "react-dom": "^19.2.0"
26
34
  },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/coinloger/dev-ui.git"
38
+ },
27
39
  "dependencies": {
28
- "clsx": "^2.1.0",
29
- "prop-types": "^15.8.1"
40
+ "clsx": "^2.1.0"
30
41
  },
31
42
  "devDependencies": {
32
43
  "@eslint/js": "^9.39.1",
33
- "@types/prop-types": "^15.7.15",
34
44
  "@types/react": "^19.2.5",
35
45
  "@types/react-dom": "^19.2.3",
36
46
  "@vitejs/plugin-react": "^5.1.1",
@@ -46,4 +56,4 @@
46
56
  "vite": "^7.2.4",
47
57
  "vite-plugin-dts": "^3.7.3"
48
58
  }
49
- }
59
+ }