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
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "color" | "onFocus" | "onBlur" | "size"> & React.RefAttributes<HTMLInputElement>>;
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
- } & Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "color" | "onFocus" | "onBlur" | "size"> & import('react').RefAttributes<HTMLInputElement>>;
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
- /// <reference types="react" />
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
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "defaultValue" | "color" | "onFocus" | "onBlur">;
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
- className: o,
20947
- icon: a,
20948
- message: i,
20949
- iconAction: s,
20950
- ...l
20951
- }, c) => {
20952
- const u = be({
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
- }), d = be({
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
- }), f = be({
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
- }), p = be({
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
- }), m = be({
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
- }), h = be({
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: g,
21023
- label: v,
21024
- domRef: y,
21025
- startContent: x,
21026
- shouldLabelBeOutside: I,
21027
- shouldLabelBeInside: P,
21028
- getBaseProps: T,
21029
- getLabelProps: D,
21030
- getInputProps: C,
21031
- getInnerWrapperProps: R,
21032
- getInputWrapperProps: $,
21033
- getDescriptionProps: j
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
- ...l,
21040
+ ...u,
21036
21041
  disabled: e,
21037
21042
  labelPlacement: "outside",
21038
- ref: c,
21043
+ ref: d,
21044
+ onBlurCapture: c,
21039
21045
  classNames: {
21040
- input: f({ disabled: e, isDatePicker: t }),
21041
- inputWrapper: p({
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: u({
21053
+ base: f({
21048
21054
  isInvalid: n,
21049
21055
  isValid: r,
21050
21056
  disabled: e,
21051
- className: o
21057
+ className: a
21052
21058
  }),
21053
- label: d({ isInvalid: n, isValid: r, disabled: e }),
21054
- description: m({ isInvalid: n, isValid: r })
21059
+ label: p({ isInvalid: n, isValid: r, disabled: e, isRequired: o }),
21060
+ description: g({ isInvalid: n, isValid: r })
21055
21061
  }
21056
- }), F = /* @__PURE__ */ S.jsx("label", { ...D(), children: v }), A = se.useMemo(() => x || a ? /* @__PURE__ */ S.jsxs("div", { ...R(), children: [
21057
- x,
21058
- /* @__PURE__ */ S.jsx("input", { ...C() }),
21059
- a && (typeof a == "string" ? /* @__PURE__ */ S.jsx(
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: s,
21063
- name: a,
21064
- className: h({ iconAction: !!s })
21068
+ onClick: l,
21069
+ name: i,
21070
+ className: v({ iconAction: !!l })
21065
21071
  }
21066
- ) : a)
21067
- ] }) : /* @__PURE__ */ S.jsx("input", { ...C() }), [
21068
- x,
21069
- s,
21070
- h,
21071
- a,
21072
- C,
21073
- R
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(g, { ...T(), children: [
21076
- I ? F : null,
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 N;
21084
- (N = y.current) == null || N.focus();
21089
+ var _;
21090
+ (_ = I.current) == null || _.focus();
21085
21091
  },
21086
21092
  children: [
21087
- P ? F : null,
21088
- A
21093
+ D ? N : null,
21094
+ V
21089
21095
  ]
21090
21096
  }
21091
21097
  ),
21092
- i && /* @__PURE__ */ S.jsx("div", { ...j(), children: i })
21098
+ s && /* @__PURE__ */ S.jsx("div", { ...A(), children: s })
21093
21099
  ] }) });
21094
21100
  }
21095
21101
  ), ID = Ie(