@plitzi/plitzi-ui 1.6.4 → 1.6.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.
@@ -4,7 +4,7 @@ import { default as InputStyles } from '../Input/Input.styles';
4
4
  import { useThemeSharedProps } from '../../hooks/useTheme';
5
5
  import { ReactNode, RefObject, TextareaHTMLAttributes } from 'react';
6
6
  export type TextAreaProps = {
7
- ref?: RefObject<HTMLTextAreaElement>;
7
+ ref?: RefObject<HTMLTextAreaElement | null>;
8
8
  label?: ReactNode;
9
9
  placeholder?: string;
10
10
  loading?: boolean;
@@ -14,5 +14,76 @@ export type TextAreaProps = {
14
14
  error?: ErrorMessageProps['message'] | ErrorMessageProps['error'];
15
15
  onChange?: (value: string) => void;
16
16
  } & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className' | 'onChange' | 'size'> & Omit<useThemeSharedProps<typeof TextAreaStyles & typeof InputStyles, typeof variantKeys>, 'error'>;
17
- declare const TextArea: ({ ref, className, id, children, label, placeholder, loading, disabled, clearable, size, intent, value, error, onChange, ...textareaProps }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
17
+ declare const TextArea: import('react').NamedExoticComponent<{
18
+ ref?: RefObject<HTMLTextAreaElement | null>;
19
+ label?: ReactNode;
20
+ placeholder?: string;
21
+ loading?: boolean;
22
+ disabled?: boolean;
23
+ clearable?: boolean;
24
+ value?: string;
25
+ error?: ErrorMessageProps["message"] | ErrorMessageProps["error"];
26
+ onChange?: (value: string) => void;
27
+ } & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "className" | "onChange" | "size"> & Omit<useThemeSharedProps<{
28
+ input: (props?: ({
29
+ intent?: "custom" | "primary" | null | undefined;
30
+ disabled?: boolean | null | undefined;
31
+ error?: boolean | null | undefined;
32
+ size?: "xs" | "md" | "sm" | "custom" | null | undefined;
33
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
34
+ iconFloatingContainer: (props?: ({
35
+ error?: boolean | null | undefined;
36
+ size?: "xs" | "md" | "sm" | "custom" | null | undefined;
37
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
38
+ inputContainer: (props?: ({
39
+ error?: boolean | null | undefined;
40
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
41
+ } & {
42
+ root: (props?: ({
43
+ intent?: "custom" | "primary" | null | undefined;
44
+ disabled?: boolean | null | undefined;
45
+ size?: "xs" | "md" | "sm" | "custom" | null | undefined;
46
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
47
+ inputContainer: (props?: ({
48
+ intent?: "custom" | "primary" | null | undefined;
49
+ error?: boolean | null | undefined;
50
+ disabled?: boolean | null | undefined;
51
+ size?: "xs" | "md" | "sm" | "custom" | null | undefined;
52
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
53
+ input: (props?: ({
54
+ intent?: "primary" | null | undefined;
55
+ error?: boolean | null | undefined;
56
+ disabled?: boolean | null | undefined;
57
+ size?: "xs" | "md" | "sm" | "custom" | null | undefined;
58
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
59
+ label: (props?: ({
60
+ inline?: boolean | null | undefined;
61
+ disabled?: boolean | null | undefined;
62
+ size?: "xs" | "md" | "sm" | "custom" | null | undefined;
63
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
64
+ iconFloatingContainer: (props?: ({
65
+ intent?: "primary" | null | undefined;
66
+ size?: "xs" | "md" | "sm" | "custom" | null | undefined;
67
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
68
+ icon: (props?: ({
69
+ intent?: "primary" | null | undefined;
70
+ error?: boolean | null | undefined;
71
+ size?: "xs" | "md" | "sm" | "custom" | null | undefined;
72
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
73
+ iconError: (props?: ({
74
+ intent?: "primary" | null | undefined;
75
+ error?: boolean | null | undefined;
76
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
77
+ iconClear: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
78
+ iconLoading: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
79
+ }, {
80
+ readonly intent: readonly ["primary", "custom"];
81
+ readonly size: readonly ["xs", "sm", "md", "custom"];
82
+ readonly disabled: readonly [true, false];
83
+ readonly error: readonly [true, false];
84
+ }>, "error">> & {
85
+ readonly type: ({ ref, className, id, children, label, placeholder, loading, disabled, clearable, size, intent, value, error, onChange, ...textareaProps }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
86
+ } & {
87
+ Icon: ({ className, children, icon, active, disabled, testId, intent, size, cursor, title, ...props }: import('../Icon').IconProps) => string | number | bigint | true | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element;
88
+ };
18
89
  export default TextArea;
@@ -1,12 +1,12 @@
1
1
  import { omit as e } from "../../helpers/lodash/omit.js";
2
2
  import t from "../../hooks/useTheme/index.js";
3
- import n from "../Input/InputContainer.js";
4
- import { useCallback as r, useMemo as i } from "react";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
- //#region src/components/TextArea/TextArea.tsx
7
- var s = ({ ref: s, className: c = "", id: l, children: u, label: d = "", placeholder: f = "", loading: p = !1, disabled: m = !1, clearable: h = !1, size: g, intent: _, value: v = "", error: y = "", onChange: b, ...x }) => {
3
+ import n from "../Icon/index.js";
4
+ import r from "../Input/InputContainer.js";
5
+ import { memo as i, useCallback as a, useMemo as o } from "react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ var l = Object.assign(i(({ ref: n, className: i = "", id: l, children: u, label: d = "", placeholder: f = "", loading: p = !1, disabled: m = !1, clearable: h = !1, size: g, intent: _, value: v = "", error: y = "", onChange: b, ...x }) => {
8
8
  let S = t("TextArea", {
9
- className: c,
9
+ className: i,
10
10
  componentKey: [
11
11
  "root",
12
12
  "inputContainer",
@@ -22,10 +22,10 @@ var s = ({ ref: s, className: c = "", id: l, children: u, label: d = "", placeho
22
22
  disabled: m,
23
23
  error: !!y
24
24
  }
25
- }), C = i(() => e(S, ["input"]), [S]), w = r((e) => {
25
+ }), C = o(() => e(S, ["input"]), [S]), w = a((e) => {
26
26
  b?.(e.target.value);
27
27
  }, [b]);
28
- return /* @__PURE__ */ o(n, {
28
+ return /* @__PURE__ */ c(r, {
29
29
  className: C,
30
30
  id: l,
31
31
  label: d,
@@ -36,9 +36,9 @@ var s = ({ ref: s, className: c = "", id: l, children: u, label: d = "", placeho
36
36
  loading: p,
37
37
  clearable: h,
38
38
  value: v,
39
- onClear: r(() => b?.(""), [b]),
40
- children: [u, /* @__PURE__ */ a("textarea", {
41
- ref: s,
39
+ onClear: a(() => b?.(""), [b]),
40
+ children: [u, /* @__PURE__ */ s("textarea", {
41
+ ref: n,
42
42
  id: l,
43
43
  placeholder: f,
44
44
  className: S.input,
@@ -48,6 +48,6 @@ var s = ({ ref: s, className: c = "", id: l, children: u, label: d = "", placeho
48
48
  ...x
49
49
  })]
50
50
  });
51
- };
51
+ }), { Icon: n });
52
52
  //#endregion
53
- export { s as default };
53
+ export { l as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/plitzi-ui",
3
- "version": "1.6.4",
3
+ "version": "1.6.5",
4
4
  "homepage": "./",
5
5
  "license": "Apache-2.0",
6
6
  "files": [