@liujip0/components 0.2.0 → 0.2.2

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.
@@ -1,17 +1,19 @@
1
1
  type InputProps = {
2
2
  value: string | number;
3
- onChange?: (event: string) => void;
3
+ onChange?: (value: string) => void;
4
4
  type?: "text" | "password" | "email" | "number" | "search";
5
5
  id: string;
6
- onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
7
6
  startIcon?: React.ReactNode;
8
7
  endIcon?: React.ReactNode;
9
- placeholder?: string;
10
8
  label?: string;
11
9
  error?: boolean;
12
10
  helperText?: string;
13
11
  disabled?: boolean;
14
12
  className?: string;
15
- };
16
- export declare function Input({ value, onChange, type, id, onKeyDown, startIcon, endIcon, placeholder, label, error, helperText, disabled, className, }: InputProps): import("react/jsx-runtime").JSX.Element;
13
+ outlineClassName?: string;
14
+ labelClassName?: string;
15
+ helperTextClassName?: string;
16
+ inputClassName?: string;
17
+ } & React.InputHTMLAttributes<HTMLInputElement>;
18
+ export declare function Input({ value, onChange, type, id, startIcon, endIcon, label, error, helperText, disabled, className, outlineClassName, labelClassName, helperTextClassName, inputClassName, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
17
19
  export {};
@@ -1,63 +1,65 @@
1
1
  import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
2
  import { s as e } from "../../Input.module-C7oR_KDs.js";
3
- function j({
3
+ function g({
4
4
  value: m,
5
5
  onChange: t,
6
6
  type: o = "text",
7
7
  id: l,
8
- onKeyDown: u,
9
- startIcon: p,
10
- endIcon: h,
11
- placeholder: x,
8
+ startIcon: u,
9
+ endIcon: p,
12
10
  label: s,
13
11
  error: n,
14
12
  helperText: a,
15
13
  disabled: i,
16
- className: N
14
+ className: h,
15
+ outlineClassName: x,
16
+ labelClassName: N,
17
+ helperTextClassName: d,
18
+ inputClassName: f,
19
+ ...v
17
20
  }) {
18
- return /* @__PURE__ */ c("div", { className: e.container + " " + (N || ""), children: [
21
+ return /* @__PURE__ */ c("div", { className: e.container + " " + (h || ""), children: [
19
22
  s && /* @__PURE__ */ r(
20
23
  "label",
21
24
  {
22
25
  htmlFor: l,
23
- className: e.label,
26
+ className: e.label + " " + (N || ""),
24
27
  children: s
25
28
  }
26
29
  ),
27
30
  /* @__PURE__ */ c(
28
31
  "div",
29
32
  {
30
- className: e.outline + " " + (n ? e.errorOutline : ""),
33
+ className: e.outline + " " + (x || "") + " " + (n ? e.errorOutline : ""),
31
34
  children: [
32
- p,
35
+ u,
33
36
  /* @__PURE__ */ r(
34
37
  "input",
35
38
  {
36
- className: e.input + " " + (i ? e.inputDisabled : ""),
39
+ className: e.input + " " + (f || "") + " " + (i ? e.inputDisabled : ""),
37
40
  value: m,
38
- onChange: (d) => {
39
- t && t(d.currentTarget.value);
41
+ onChange: (j) => {
42
+ t && t(j.currentTarget.value);
40
43
  },
41
44
  type: o,
42
45
  id: l,
43
- onKeyDown: u,
44
- placeholder: x,
45
- disabled: i
46
+ disabled: i,
47
+ ...v
46
48
  }
47
49
  ),
48
- h
50
+ p
49
51
  ]
50
52
  }
51
53
  ),
52
54
  a && /* @__PURE__ */ r(
53
55
  "p",
54
56
  {
55
- className: e.helperText + " " + (n ? e.helperTextError : ""),
57
+ className: e.helperText + " " + (d || "") + " " + (n ? e.helperTextError : ""),
56
58
  children: a
57
59
  }
58
60
  )
59
61
  ] });
60
62
  }
61
63
  export {
62
- j as Input
64
+ g as Input
63
65
  };
@@ -1,15 +1,16 @@
1
1
  type TextAreaProps = {
2
2
  value: string | number;
3
- onChange?: (event: string) => void;
3
+ onChange?: (value: string) => void;
4
4
  id: string;
5
- onKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
6
- placeholder?: string;
7
5
  label?: string;
8
6
  error?: boolean;
9
7
  helperText?: string;
10
8
  disabled?: boolean;
11
9
  className?: string;
12
10
  outlineClassName?: string;
13
- };
14
- export declare function TextArea({ value, onChange, id, onKeyDown, placeholder, label, error, helperText, disabled, className, outlineClassName, }: TextAreaProps): import("react/jsx-runtime").JSX.Element;
11
+ labelClassName?: string;
12
+ helperTextClassName?: string;
13
+ textAreaClassName?: string;
14
+ } & React.TextareaHTMLAttributes<HTMLTextAreaElement>;
15
+ export declare function TextArea({ value, onChange, id, label, error, helperText, disabled, className, outlineClassName, labelClassName, helperTextClassName, textAreaClassName, ...props }: TextAreaProps): import("react/jsx-runtime").JSX.Element;
15
16
  export {};
@@ -1,43 +1,44 @@
1
- import { jsxs as x, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
2
  import { s as e } from "../../Input.module-C7oR_KDs.js";
3
- function f({
3
+ function T({
4
4
  value: c,
5
5
  onChange: a,
6
6
  id: t,
7
- onKeyDown: m,
8
- placeholder: o,
9
7
  label: l,
10
8
  error: s,
11
9
  helperText: i,
12
10
  disabled: n,
13
- className: u,
14
- outlineClassName: p
11
+ className: m,
12
+ outlineClassName: o,
13
+ labelClassName: u,
14
+ helperTextClassName: p,
15
+ textAreaClassName: h,
16
+ ...x
15
17
  }) {
16
- return /* @__PURE__ */ x("div", { className: e.container + " " + (u || ""), children: [
18
+ return /* @__PURE__ */ d("div", { className: e.container + " " + (m || ""), children: [
17
19
  l && /* @__PURE__ */ r(
18
20
  "label",
19
21
  {
20
22
  htmlFor: t,
21
- className: e.label,
23
+ className: e.label + " " + (u || ""),
22
24
  children: l
23
25
  }
24
26
  ),
25
27
  /* @__PURE__ */ r(
26
28
  "div",
27
29
  {
28
- className: e.outline + " " + (s ? e.errorOutline : "") + " " + (p || ""),
30
+ className: e.outline + " " + (s ? e.errorOutline : "") + " " + (o || ""),
29
31
  children: /* @__PURE__ */ r(
30
32
  "textarea",
31
33
  {
32
- className: e.input + " " + (n ? e.inputDisabled : ""),
34
+ className: e.input + " " + (h || "") + " " + (n ? e.inputDisabled : ""),
33
35
  value: c,
34
- onChange: (h) => {
35
- a && a(h.currentTarget.value);
36
+ onChange: (N) => {
37
+ a && a(N.currentTarget.value);
36
38
  },
37
39
  id: t,
38
- onKeyDown: m,
39
- placeholder: o,
40
- disabled: n
40
+ disabled: n,
41
+ ...x
41
42
  }
42
43
  )
43
44
  }
@@ -45,12 +46,12 @@ function f({
45
46
  i && /* @__PURE__ */ r(
46
47
  "p",
47
48
  {
48
- className: e.helperText + " " + (s ? e.helperTextError : ""),
49
+ className: e.helperText + " " + (p || "") + " " + (s ? e.helperTextError : ""),
49
50
  children: i
50
51
  }
51
52
  )
52
53
  ] });
53
54
  }
54
55
  export {
55
- f as TextArea
56
+ T as TextArea
56
57
  };
package/dist/main.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ declare const _default: "./main.css";
2
+ export default _default;
1
3
  export { Button } from './components/Button/Button.tsx';
2
4
  export { IconButton } from './components/Button/IconButton/IconButton.tsx';
3
5
  export { ToggleButton } from './components/Button/ToggleButton/ToggleButton.tsx';
package/dist/main.js CHANGED
@@ -1,46 +1,48 @@
1
- import { Button as t } from "./components/Button/Button.js";
2
- import { IconButton as p } from "./components/Button/IconButton/IconButton.js";
3
- import { ToggleButton as f } from "./components/Button/ToggleButton/ToggleButton.js";
4
- import { ToggleButtonGroup as a } from "./components/Button/ToggleButton/ToggleButtonGroup.js";
5
- import { Dialog as i, DialogActions as l, DialogContent as n, DialogTitle as g } from "./components/Dialog/Dialog.js";
6
- import { Divider as b } from "./components/Divider/Divider.js";
7
- import { Input as d } from "./components/Input/Input.js";
1
+ import { Button as e } from "./components/Button/Button.js";
2
+ import { IconButton as x } from "./components/Button/IconButton/IconButton.js";
3
+ import { ToggleButton as a } from "./components/Button/ToggleButton/ToggleButton.js";
4
+ import { ToggleButtonGroup as n } from "./components/Button/ToggleButton/ToggleButtonGroup.js";
5
+ import { Dialog as l, DialogActions as T, DialogContent as u, DialogTitle as g } from "./components/Dialog/Dialog.js";
6
+ import { Divider as c } from "./components/Divider/Divider.js";
7
+ import { Input as s } from "./components/Input/Input.js";
8
8
  import { TextArea as D } from "./components/Input/TextArea.js";
9
9
  import { Checkbox as h } from "./components/Input/Checkbox/Checkbox.js";
10
- import { Counter as s } from "./components/Input/Counter/Counter.js";
11
- import { Radio as G } from "./components/Input/Radio/Radio.js";
12
- import { RadioGroup as R } from "./components/Input/Radio/RadioGroup.js";
13
- import { Select as v } from "./components/Input/Select/Select.js";
14
- import { Snackbar as j } from "./components/Snackbar/Snackbar.js";
15
- import { Table as w, TableHead as y, Td as z, Th as E } from "./components/Table/Table.js";
16
- import { Tab as J } from "./components/Tabs/Tab.js";
17
- import { TabBar as L } from "./components/Tabs/TabBar.js";
18
- import { Tabs as N } from "./components/Tabs/Tabs.js";
19
- import { Tooltip as P } from "./components/Tooltip/Tooltip.js";
20
- import './assets/main.css';export {
21
- t as Button,
10
+ import { Counter as A } from "./components/Input/Counter/Counter.js";
11
+ import { Radio as I } from "./components/Input/Radio/Radio.js";
12
+ import { RadioGroup as S } from "./components/Input/Radio/RadioGroup.js";
13
+ import { Select as H } from "./components/Input/Select/Select.js";
14
+ import { Snackbar as q } from "./components/Snackbar/Snackbar.js";
15
+ import { Table as y, TableHead as z, Td as E, Th as F } from "./components/Table/Table.js";
16
+ import { Tab as K } from "./components/Tabs/Tab.js";
17
+ import { TabBar as M } from "./components/Tabs/TabBar.js";
18
+ import { Tabs as O } from "./components/Tabs/Tabs.js";
19
+ import { Tooltip as Q } from "./components/Tooltip/Tooltip.js";
20
+ import './assets/main.css';const o = "./main.css";
21
+ export {
22
+ e as Button,
22
23
  h as Checkbox,
23
- s as Counter,
24
- i as Dialog,
25
- l as DialogActions,
26
- n as DialogContent,
24
+ A as Counter,
25
+ l as Dialog,
26
+ T as DialogActions,
27
+ u as DialogContent,
27
28
  g as DialogTitle,
28
- b as Divider,
29
- p as IconButton,
30
- d as Input,
31
- G as Radio,
32
- R as RadioGroup,
33
- v as Select,
34
- j as Snackbar,
35
- J as Tab,
36
- L as TabBar,
37
- w as Table,
38
- y as TableHead,
39
- N as Tabs,
40
- z as Td,
29
+ c as Divider,
30
+ x as IconButton,
31
+ s as Input,
32
+ I as Radio,
33
+ S as RadioGroup,
34
+ H as Select,
35
+ q as Snackbar,
36
+ K as Tab,
37
+ M as TabBar,
38
+ y as Table,
39
+ z as TableHead,
40
+ O as Tabs,
41
+ E as Td,
41
42
  D as TextArea,
42
- E as Th,
43
- f as ToggleButton,
44
- a as ToggleButtonGroup,
45
- P as Tooltip
43
+ F as Th,
44
+ a as ToggleButton,
45
+ n as ToggleButtonGroup,
46
+ Q as Tooltip,
47
+ o as default
46
48
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@liujip0/components",
3
3
  "private": false,
4
- "version": "0.2.0",
4
+ "version": "0.2.2",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",