globalfy-design-system 0.112.0 → 0.114.0
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.
|
@@ -6,9 +6,11 @@ export declare const Input: React.ForwardRefExoticComponent<{
|
|
|
6
6
|
message?: string | undefined;
|
|
7
7
|
icon?: React.ReactNode;
|
|
8
8
|
isInvalid?: boolean | undefined;
|
|
9
|
+
isRequired?: boolean | undefined;
|
|
9
10
|
isValid?: boolean | undefined;
|
|
10
11
|
disabled?: boolean | undefined;
|
|
11
12
|
value?: string | undefined;
|
|
12
13
|
isDatePicker?: boolean | undefined;
|
|
13
14
|
iconAction?: (() => void) | undefined;
|
|
14
|
-
|
|
15
|
+
handleBlur?: ((event: React.FocusEvent<HTMLInputElement, Element>) => unknown) | undefined;
|
|
16
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "color" | "onFocus" | "onBlur" | "onBlurCapture" | "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -8,12 +8,14 @@ declare const meta: {
|
|
|
8
8
|
message?: string | undefined;
|
|
9
9
|
icon?: import('react').ReactNode;
|
|
10
10
|
isInvalid?: boolean | undefined;
|
|
11
|
+
isRequired?: boolean | undefined;
|
|
11
12
|
isValid?: boolean | undefined;
|
|
12
13
|
disabled?: boolean | undefined;
|
|
13
14
|
value?: string | undefined;
|
|
14
15
|
isDatePicker?: boolean | undefined;
|
|
15
16
|
iconAction?: (() => void) | undefined;
|
|
16
|
-
|
|
17
|
+
handleBlur?: ((event: import('react').FocusEvent<HTMLInputElement, Element>) => unknown) | undefined;
|
|
18
|
+
} & Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "color" | "onFocus" | "onBlur" | "onBlurCapture" | "size"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
17
19
|
tags: string[];
|
|
18
20
|
};
|
|
19
21
|
export default meta;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { FocusEvent } from 'react';
|
|
2
|
+
|
|
2
3
|
export type InputProps = {
|
|
3
4
|
label: string;
|
|
4
5
|
placeholder?: string;
|
|
5
6
|
message?: string;
|
|
6
7
|
icon?: React.ReactNode;
|
|
7
8
|
isInvalid?: boolean;
|
|
9
|
+
isRequired?: boolean;
|
|
8
10
|
isValid?: boolean;
|
|
9
11
|
disabled?: boolean;
|
|
10
12
|
value?: string;
|
|
11
13
|
isDatePicker?: boolean;
|
|
12
14
|
iconAction?: () => void;
|
|
13
|
-
|
|
15
|
+
handleBlur?: (event: FocusEvent<HTMLInputElement>) => unknown;
|
|
16
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "defaultValue" | "color" | "onFocus" | "onBlur" | "onBlurCapture">;
|
|
14
17
|
export type InputPasswordProps = Omit<InputProps, "icon" | "type" | "isDatePicker">;
|
|
@@ -20943,13 +20943,15 @@ const bC = uC, vC = fC, yC = hC, xC = gC, wD = ({
|
|
|
20943
20943
|
isDatePicker: t,
|
|
20944
20944
|
isInvalid: n,
|
|
20945
20945
|
isValid: r,
|
|
20946
|
-
|
|
20947
|
-
|
|
20948
|
-
|
|
20949
|
-
|
|
20950
|
-
|
|
20951
|
-
|
|
20952
|
-
|
|
20946
|
+
isRequired: o,
|
|
20947
|
+
className: a,
|
|
20948
|
+
icon: i,
|
|
20949
|
+
message: s,
|
|
20950
|
+
iconAction: l,
|
|
20951
|
+
handleBlur: c,
|
|
20952
|
+
...u
|
|
20953
|
+
}, d) => {
|
|
20954
|
+
const f = be({
|
|
20953
20955
|
base: "[&_input]:data-[filled-within=true]:!bg-transparent [&_label]:data-[filled-within=true]:!left-[15px] [&_label]:data-[filled-within=true]:!top-[20px] [&_label]:data-[filled-within=true]:!ml-[1px] [&_label]:data-[filled-within=true]:!text-xs [&_label]:data-[filled-within=true]:!text-primary-grey-800",
|
|
20954
20956
|
variants: {
|
|
20955
20957
|
isInvalid: {
|
|
@@ -20962,8 +20964,8 @@ const bC = uC, vC = fC, yC = hC, xC = gC, wD = ({
|
|
|
20962
20964
|
true: "[&_label]:data-[filled-within=true]:!text-primary-grey-700"
|
|
20963
20965
|
}
|
|
20964
20966
|
}
|
|
20965
|
-
}),
|
|
20966
|
-
base: "left-[16px] top-6 font-satoshi text-sm text-primary-grey-800",
|
|
20967
|
+
}), p = be({
|
|
20968
|
+
base: "left-[16px] top-6 max-w-[calc(100%-40px)] font-satoshi text-sm text-primary-grey-800",
|
|
20967
20969
|
variants: {
|
|
20968
20970
|
isInvalid: {
|
|
20969
20971
|
true: "text-complementary-red-500"
|
|
@@ -20973,9 +20975,12 @@ const bC = uC, vC = fC, yC = hC, xC = gC, wD = ({
|
|
|
20973
20975
|
},
|
|
20974
20976
|
disabled: {
|
|
20975
20977
|
true: "text-primary-grey-700"
|
|
20978
|
+
},
|
|
20979
|
+
isRequired: {
|
|
20980
|
+
true: "after:content-['*']"
|
|
20976
20981
|
}
|
|
20977
20982
|
}
|
|
20978
|
-
}),
|
|
20983
|
+
}), m = be({
|
|
20979
20984
|
base: "text-left font-satoshi text-base",
|
|
20980
20985
|
variants: {
|
|
20981
20986
|
disabled: {
|
|
@@ -20985,7 +20990,7 @@ const bC = uC, vC = fC, yC = hC, xC = gC, wD = ({
|
|
|
20985
20990
|
true: "!cursor-pointer"
|
|
20986
20991
|
}
|
|
20987
20992
|
}
|
|
20988
|
-
}),
|
|
20993
|
+
}), h = be({
|
|
20989
20994
|
base: "h-12 rounded-lg border border-primary-grey-700 !bg-white px-[15px] text-black !ring-0 !ring-offset-0",
|
|
20990
20995
|
variants: {
|
|
20991
20996
|
isInvalid: {
|
|
@@ -21001,7 +21006,7 @@ const bC = uC, vC = fC, yC = hC, xC = gC, wD = ({
|
|
|
21001
21006
|
true: "!cursor-pointer"
|
|
21002
21007
|
}
|
|
21003
21008
|
}
|
|
21004
|
-
}),
|
|
21009
|
+
}), g = be({
|
|
21005
21010
|
base: "mt-[5px] pl-3 font-satoshi",
|
|
21006
21011
|
variants: {
|
|
21007
21012
|
isInvalid: {
|
|
@@ -21011,7 +21016,7 @@ const bC = uC, vC = fC, yC = hC, xC = gC, wD = ({
|
|
|
21011
21016
|
true: "text-secondary-green-500"
|
|
21012
21017
|
}
|
|
21013
21018
|
}
|
|
21014
|
-
}),
|
|
21019
|
+
}), v = be({
|
|
21015
21020
|
base: "text-primary-grey-800",
|
|
21016
21021
|
variants: {
|
|
21017
21022
|
iconAction: {
|
|
@@ -21019,77 +21024,78 @@ const bC = uC, vC = fC, yC = hC, xC = gC, wD = ({
|
|
|
21019
21024
|
}
|
|
21020
21025
|
}
|
|
21021
21026
|
}), {
|
|
21022
|
-
Component:
|
|
21023
|
-
label:
|
|
21024
|
-
domRef:
|
|
21025
|
-
startContent:
|
|
21026
|
-
shouldLabelBeOutside:
|
|
21027
|
-
shouldLabelBeInside:
|
|
21028
|
-
getBaseProps:
|
|
21029
|
-
getLabelProps:
|
|
21030
|
-
getInputProps:
|
|
21031
|
-
getInnerWrapperProps:
|
|
21032
|
-
getInputWrapperProps:
|
|
21033
|
-
getDescriptionProps:
|
|
21027
|
+
Component: y,
|
|
21028
|
+
label: x,
|
|
21029
|
+
domRef: I,
|
|
21030
|
+
startContent: P,
|
|
21031
|
+
shouldLabelBeOutside: T,
|
|
21032
|
+
shouldLabelBeInside: D,
|
|
21033
|
+
getBaseProps: C,
|
|
21034
|
+
getLabelProps: R,
|
|
21035
|
+
getInputProps: $,
|
|
21036
|
+
getInnerWrapperProps: j,
|
|
21037
|
+
getInputWrapperProps: F,
|
|
21038
|
+
getDescriptionProps: A
|
|
21034
21039
|
} = K9({
|
|
21035
|
-
...
|
|
21040
|
+
...u,
|
|
21036
21041
|
disabled: e,
|
|
21037
21042
|
labelPlacement: "outside",
|
|
21038
|
-
ref:
|
|
21043
|
+
ref: d,
|
|
21044
|
+
onBlurCapture: c,
|
|
21039
21045
|
classNames: {
|
|
21040
|
-
input:
|
|
21041
|
-
inputWrapper:
|
|
21046
|
+
input: m({ disabled: e, isDatePicker: t }),
|
|
21047
|
+
inputWrapper: h({
|
|
21042
21048
|
isInvalid: n,
|
|
21043
21049
|
isValid: r,
|
|
21044
21050
|
disabled: e,
|
|
21045
21051
|
isDatePicker: t
|
|
21046
21052
|
}),
|
|
21047
|
-
base:
|
|
21053
|
+
base: f({
|
|
21048
21054
|
isInvalid: n,
|
|
21049
21055
|
isValid: r,
|
|
21050
21056
|
disabled: e,
|
|
21051
|
-
className:
|
|
21057
|
+
className: a
|
|
21052
21058
|
}),
|
|
21053
|
-
label:
|
|
21054
|
-
description:
|
|
21059
|
+
label: p({ isInvalid: n, isValid: r, disabled: e, isRequired: o }),
|
|
21060
|
+
description: g({ isInvalid: n, isValid: r })
|
|
21055
21061
|
}
|
|
21056
|
-
}),
|
|
21057
|
-
|
|
21058
|
-
/* @__PURE__ */ S.jsx("input", {
|
|
21059
|
-
|
|
21062
|
+
}), N = /* @__PURE__ */ S.jsx("label", { ...R(), children: x }), V = se.useMemo(() => P || i ? /* @__PURE__ */ S.jsxs("div", { ...j(), children: [
|
|
21063
|
+
P,
|
|
21064
|
+
/* @__PURE__ */ S.jsx("input", { ...$() }),
|
|
21065
|
+
i && (typeof i == "string" ? /* @__PURE__ */ S.jsx(
|
|
21060
21066
|
lt,
|
|
21061
21067
|
{
|
|
21062
|
-
onClick:
|
|
21063
|
-
name:
|
|
21064
|
-
className:
|
|
21068
|
+
onClick: l,
|
|
21069
|
+
name: i,
|
|
21070
|
+
className: v({ iconAction: !!l })
|
|
21065
21071
|
}
|
|
21066
|
-
) :
|
|
21067
|
-
] }) : /* @__PURE__ */ S.jsx("input", {
|
|
21068
|
-
|
|
21069
|
-
|
|
21070
|
-
|
|
21071
|
-
|
|
21072
|
-
|
|
21073
|
-
|
|
21072
|
+
) : i)
|
|
21073
|
+
] }) : /* @__PURE__ */ S.jsx("input", { ...$() }), [
|
|
21074
|
+
P,
|
|
21075
|
+
l,
|
|
21076
|
+
v,
|
|
21077
|
+
i,
|
|
21078
|
+
$,
|
|
21079
|
+
j
|
|
21074
21080
|
]);
|
|
21075
|
-
return /* @__PURE__ */ S.jsx("div", { className: "w-full", children: /* @__PURE__ */ S.jsxs(
|
|
21076
|
-
|
|
21081
|
+
return /* @__PURE__ */ S.jsx("div", { className: "w-full", children: /* @__PURE__ */ S.jsxs(y, { ...C(), children: [
|
|
21082
|
+
T ? N : null,
|
|
21077
21083
|
/* @__PURE__ */ S.jsxs(
|
|
21078
21084
|
"div",
|
|
21079
21085
|
{
|
|
21080
|
-
|
|
21086
|
+
...F(),
|
|
21081
21087
|
role: "button",
|
|
21082
21088
|
onClick: () => {
|
|
21083
|
-
var
|
|
21084
|
-
(
|
|
21089
|
+
var _;
|
|
21090
|
+
(_ = I.current) == null || _.focus();
|
|
21085
21091
|
},
|
|
21086
21092
|
children: [
|
|
21087
|
-
|
|
21088
|
-
|
|
21093
|
+
D ? N : null,
|
|
21094
|
+
V
|
|
21089
21095
|
]
|
|
21090
21096
|
}
|
|
21091
21097
|
),
|
|
21092
|
-
|
|
21098
|
+
s && /* @__PURE__ */ S.jsx("div", { ...A(), children: s })
|
|
21093
21099
|
] }) });
|
|
21094
21100
|
}
|
|
21095
21101
|
), ID = Ie(
|