@yamada-ui/input 1.0.45-dev-20241015000703 → 1.0.45-dev-20241015003618
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-DS6HSFES.mjs → chunk-HSHTS6CU.mjs} +7 -1
- package/dist/chunk-HSHTS6CU.mjs.map +1 -0
- package/dist/{chunk-LWLGMJZM.mjs → chunk-LAVL5JMX.mjs} +3 -1
- package/dist/{chunk-LWLGMJZM.mjs.map → chunk-LAVL5JMX.mjs.map} +1 -1
- package/dist/{chunk-NGZKNBSX.mjs → chunk-MFPW4EYD.mjs} +7 -1
- package/dist/chunk-MFPW4EYD.mjs.map +1 -0
- package/dist/{chunk-2ZHWNLLK.mjs → chunk-ODVOBSDG.mjs} +5 -3
- package/dist/{chunk-2ZHWNLLK.mjs.map → chunk-ODVOBSDG.mjs.map} +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/input-addon.js +6 -0
- package/dist/input-addon.js.map +1 -1
- package/dist/input-addon.mjs +1 -1
- package/dist/input-element.js +6 -0
- package/dist/input-element.js.map +1 -1
- package/dist/input-element.mjs +1 -1
- package/dist/input-group.js +14 -0
- package/dist/input-group.js.map +1 -1
- package/dist/input-group.mjs +3 -3
- package/dist/input.js +2 -0
- package/dist/input.js.map +1 -1
- package/dist/input.mjs +1 -1
- package/package.json +5 -5
- package/dist/chunk-DS6HSFES.mjs.map +0 -1
- package/dist/chunk-NGZKNBSX.mjs.map +0 -1
@@ -40,6 +40,8 @@ var InputAddon = forwardRef(
|
|
40
40
|
);
|
41
41
|
}
|
42
42
|
);
|
43
|
+
InputAddon.displayName = "InputAddon";
|
44
|
+
InputAddon.__ui__ = "InputAddon";
|
43
45
|
var InputLeftAddon = forwardRef(
|
44
46
|
({ className, ...rest }, ref) => {
|
45
47
|
return /* @__PURE__ */ jsx(
|
@@ -53,6 +55,8 @@ var InputLeftAddon = forwardRef(
|
|
53
55
|
);
|
54
56
|
}
|
55
57
|
);
|
58
|
+
InputLeftAddon.displayName = "InputLeftAddon";
|
59
|
+
InputLeftAddon.__ui__ = "InputLeftAddon";
|
56
60
|
var InputRightAddon = forwardRef(
|
57
61
|
({ className, ...rest }, ref) => {
|
58
62
|
return /* @__PURE__ */ jsx(
|
@@ -66,9 +70,11 @@ var InputRightAddon = forwardRef(
|
|
66
70
|
);
|
67
71
|
}
|
68
72
|
);
|
73
|
+
InputRightAddon.displayName = "InputRightAddon";
|
74
|
+
InputRightAddon.__ui__ = "InputRightAddon";
|
69
75
|
|
70
76
|
export {
|
71
77
|
InputLeftAddon,
|
72
78
|
InputRightAddon
|
73
79
|
};
|
74
|
-
//# sourceMappingURL=chunk-
|
80
|
+
//# sourceMappingURL=chunk-HSHTS6CU.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/input-addon.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputAddonOptions {\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputAddonProps extends HTMLUIProps, InputAddonOptions {}\n\nconst InputAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, placement = \"left\", ...rest }, ref) => {\n const { styles } = useInputGroup()\n\n const placementStyles = {\n left: {\n me: \"-1px\",\n roundedRight: \"0px !important\",\n },\n right: {\n ms: \"-1px\",\n roundedLeft: \"0px !important\",\n },\n }\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n flex: \"0 0 auto\",\n w: \"auto\",\n whiteSpace: \"nowrap\",\n ...styles.addon,\n ...placementStyles[placement],\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__addon\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nInputAddon.displayName = \"InputAddon\"\nInputAddon.__ui__ = \"InputAddon\"\n\nexport const InputLeftAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nInputLeftAddon.displayName = \"InputLeftAddon\"\nInputLeftAddon.__ui__ = \"InputLeftAddon\"\n\nexport const InputRightAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n\nInputRightAddon.displayName = \"InputRightAddon\"\nInputRightAddon.__ui__ = \"InputRightAddon\"\n"],"mappings":";;;;;;AACA,SAAS,YAAY,UAAU;AAC/B,SAAS,UAAU;AAwCb;AA1BN,IAAM,aAAa;AAAA,EACjB,CAAC,EAAE,WAAW,YAAY,QAAQ,GAAG,KAAK,GAAG,QAAQ;AACnD,UAAM,EAAE,OAAO,IAAI,cAAc;AAEjC,UAAM,kBAAkB;AAAA,MACtB,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,cAAc;AAAA,MAChB;AAAA,MACA,OAAO;AAAA,QACL,IAAI;AAAA,QACJ,aAAa;AAAA,MACf;AAAA,IACF;AAEA,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,MAAM;AAAA,MACN,GAAG;AAAA,MACH,YAAY;AAAA,MACZ,GAAG,OAAO;AAAA,MACV,GAAG,gBAAgB,SAAS;AAAA,IAC9B;AAEA,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,WAAW,GAAG,mBAAmB,SAAS;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;AACzB,WAAW,SAAS;AAEb,IAAM,iBAAiB;AAAA,EAC5B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,yBAAyB,SAAS;AAAA,QAChD,WAAU;AAAA,QACT,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAC7B,eAAe,SAAS;AAEjB,IAAM,kBAAkB;AAAA,EAC7B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,0BAA0B,SAAS;AAAA,QACjD,WAAU;AAAA,QACT,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,gBAAgB,cAAc;AAC9B,gBAAgB,SAAS;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/input.tsx"],"sourcesContent":["import type {\n ColorModeToken,\n CSS,\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { useFormControlProps } from \"@yamada-ui/form-control\"\nimport { cx } from \"@yamada-ui/utils\"\n\ninterface InputOptions {\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The native HTML `size` attribute to be passed to the `input`.\n */\n htmlSize?: number\n}\n\nexport interface InputProps\n extends Omit<\n HTMLUIProps<\"input\">,\n \"disabled\" | \"readOnly\" | \"required\" | \"size\"\n >,\n ThemeProps<\"Input\">,\n InputOptions,\n FormControlOptions {}\n\n/**\n * `Input` is a component used to obtain text input from the user.\n *\n * @see Docs https://yamada-ui.com/components/forms/input\n */\nexport const Input = forwardRef<InputProps, \"input\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Input\", props)\n let { className, htmlSize, __css, ...rest } = omitThemeProps(mergedProps)\n\n rest = useFormControlProps(rest)\n\n const css: CSSUIObject = { ...styles.field, ...__css }\n\n return (\n <ui.input\n ref={ref}\n className={cx(\"ui-input\", className)}\n size={htmlSize}\n __css={css}\n {...rest}\n />\n )\n})\n"],"mappings":";;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,2BAA2B;AACpC,SAAS,UAAU;AAwCf;AATG,IAAM,QAAQ,WAAgC,CAAC,OAAO,QAAQ;AACnE,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,SAAS,KAAK;AACnE,MAAI,EAAE,WAAW,UAAU,OAAO,GAAG,KAAK,IAAI,eAAe,WAAW;AAExE,SAAO,oBAAoB,IAAI;AAE/B,QAAM,MAAmB,EAAE,GAAG,OAAO,OAAO,GAAG,MAAM;AAErD,SACE;AAAA,IAAC,GAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,WAAW,GAAG,YAAY,SAAS;AAAA,MACnC,MAAM;AAAA,MACN,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;","names":[]}
|
1
|
+
{"version":3,"sources":["../src/input.tsx"],"sourcesContent":["import type {\n ColorModeToken,\n CSS,\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { useFormControlProps } from \"@yamada-ui/form-control\"\nimport { cx } from \"@yamada-ui/utils\"\n\ninterface InputOptions {\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The native HTML `size` attribute to be passed to the `input`.\n */\n htmlSize?: number\n}\n\nexport interface InputProps\n extends Omit<\n HTMLUIProps<\"input\">,\n \"disabled\" | \"readOnly\" | \"required\" | \"size\"\n >,\n ThemeProps<\"Input\">,\n InputOptions,\n FormControlOptions {}\n\n/**\n * `Input` is a component used to obtain text input from the user.\n *\n * @see Docs https://yamada-ui.com/components/forms/input\n */\nexport const Input = forwardRef<InputProps, \"input\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Input\", props)\n let { className, htmlSize, __css, ...rest } = omitThemeProps(mergedProps)\n\n rest = useFormControlProps(rest)\n\n const css: CSSUIObject = { ...styles.field, ...__css }\n\n return (\n <ui.input\n ref={ref}\n className={cx(\"ui-input\", className)}\n size={htmlSize}\n __css={css}\n {...rest}\n />\n )\n})\n\nInput.displayName = \"Input\"\nInput.__ui__ = \"Input\"\n"],"mappings":";;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,2BAA2B;AACpC,SAAS,UAAU;AAwCf;AATG,IAAM,QAAQ,WAAgC,CAAC,OAAO,QAAQ;AACnE,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,SAAS,KAAK;AACnE,MAAI,EAAE,WAAW,UAAU,OAAO,GAAG,KAAK,IAAI,eAAe,WAAW;AAExE,SAAO,oBAAoB,IAAI;AAE/B,QAAM,MAAmB,EAAE,GAAG,OAAO,OAAO,GAAG,MAAM;AAErD,SACE;AAAA,IAAC,GAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,WAAW,GAAG,YAAY,SAAS;AAAA,MACnC,MAAM;AAAA,MACN,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AAED,MAAM,cAAc;AACpB,MAAM,SAAS;","names":[]}
|
@@ -37,6 +37,8 @@ var InputElement = forwardRef(
|
|
37
37
|
);
|
38
38
|
}
|
39
39
|
);
|
40
|
+
InputElement.displayName = "InputElement";
|
41
|
+
InputElement.__ui__ = "InputElement";
|
40
42
|
var InputLeftElement = forwardRef(
|
41
43
|
({ className, ...rest }, ref) => {
|
42
44
|
return /* @__PURE__ */ jsx(
|
@@ -50,6 +52,8 @@ var InputLeftElement = forwardRef(
|
|
50
52
|
);
|
51
53
|
}
|
52
54
|
);
|
55
|
+
InputLeftElement.displayName = "InputLeftElement";
|
56
|
+
InputLeftElement.__ui__ = "InputLeftElement";
|
53
57
|
var InputRightElement = forwardRef(
|
54
58
|
({ className, ...rest }, ref) => {
|
55
59
|
return /* @__PURE__ */ jsx(
|
@@ -63,9 +67,11 @@ var InputRightElement = forwardRef(
|
|
63
67
|
);
|
64
68
|
}
|
65
69
|
);
|
70
|
+
InputRightElement.displayName = "InputRightElement";
|
71
|
+
InputRightElement.__ui__ = "InputRightElement";
|
66
72
|
|
67
73
|
export {
|
68
74
|
InputLeftElement,
|
69
75
|
InputRightElement
|
70
76
|
};
|
71
|
-
//# sourceMappingURL=chunk-
|
77
|
+
//# sourceMappingURL=chunk-MFPW4EYD.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/input-element.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputElementOptions {\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `isClickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n */\n isClickable?: boolean\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputElementProps extends HTMLUIProps, InputElementOptions {}\n\nconst InputElement = forwardRef<InputElementProps, \"div\">(\n (\n { className, isClick = false, isClickable, placement = \"left\", ...rest },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n isClickable ??= isClick\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: isClickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: isClickable ? \"auto\" : \"none\",\n position: \"absolute\",\n top: \"0\",\n w: fieldHeight,\n zIndex: \"fallback(kurillin, 9)\",\n ...styles.element,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__element\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nInputElement.displayName = \"InputElement\"\nInputElement.__ui__ = \"InputElement\"\n\nexport const InputLeftElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nInputLeftElement.displayName = \"InputLeftElement\"\nInputLeftElement.__ui__ = \"InputLeftElement\"\n\nexport const InputRightElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n\nInputRightElement.displayName = \"InputRightElement\"\nInputRightElement.__ui__ = \"InputRightElement\"\n"],"mappings":";;;;;;AACA,SAAS,YAAY,UAAU;AAC/B,SAAS,UAAU;AAsDb;AA1BN,IAAM,eAAe;AAAA,EACnB,CACE,EAAE,WAAW,UAAU,OAAO,aAAa,YAAY,QAAQ,GAAG,KAAK,GACvE,QACG;AACH,UAAM,EAAE,eAAe,aAAa,OAAO,IAAI,cAAc;AAE7D,sDAAgB;AAEhB,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,QAAQ,cAAc,YAAY;AAAA,MAClC,SAAS;AAAA,MACT,UAAU;AAAA,MACV,GAAG;AAAA,MACH,gBAAgB;AAAA,MAChB,CAAC,cAAc,SAAS,eAAe,UAAU,GAAG;AAAA,MACpD,eAAe,cAAc,SAAS;AAAA,MACtC,UAAU;AAAA,MACV,KAAK;AAAA,MACL,GAAG;AAAA,MACH,QAAQ;AAAA,MACR,GAAG,OAAO;AAAA,IACZ;AAEA,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,WAAW,GAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;AAEf,IAAM,mBAAmB;AAAA,EAC9B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,2BAA2B,SAAS;AAAA,QAClD,WAAU;AAAA,QACT,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,iBAAiB,cAAc;AAC/B,iBAAiB,SAAS;AAEnB,IAAM,oBAAoB;AAAA,EAC/B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,4BAA4B,SAAS;AAAA,QACnD,WAAU;AAAA,QACT,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAChC,kBAAkB,SAAS;","names":[]}
|
@@ -2,11 +2,11 @@
|
|
2
2
|
import {
|
3
3
|
InputLeftAddon,
|
4
4
|
InputRightAddon
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-HSHTS6CU.mjs";
|
6
6
|
import {
|
7
7
|
InputLeftElement,
|
8
8
|
InputRightElement
|
9
|
-
} from "./chunk-
|
9
|
+
} from "./chunk-MFPW4EYD.mjs";
|
10
10
|
import {
|
11
11
|
InputGroupProvider
|
12
12
|
} from "./chunk-N7GDIMME.mjs";
|
@@ -86,8 +86,10 @@ var InputGroup = forwardRef((props, ref) => {
|
|
86
86
|
}
|
87
87
|
) });
|
88
88
|
});
|
89
|
+
InputGroup.displayName = "InputGroup";
|
90
|
+
InputGroup.__ui__ = "InputGroup";
|
89
91
|
|
90
92
|
export {
|
91
93
|
InputGroup
|
92
94
|
};
|
93
|
-
//# sourceMappingURL=chunk-
|
95
|
+
//# sourceMappingURL=chunk-ODVOBSDG.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/input-group.tsx"],"sourcesContent":["import type {\n CSSUIObject,\n CSSUIProps,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n useCreateVars,\n} from \"@yamada-ui/core\"\nimport { cx, filterUndefined, getValidChildren } from \"@yamada-ui/utils\"\nimport { cloneElement } from \"react\"\nimport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nimport { InputGroupProvider } from \"./input-context\"\nimport { InputLeftElement, InputRightElement } from \"./input-element\"\n\nexport interface InputGroupProps extends HTMLUIProps, ThemeProps<\"Input\"> {}\n\nexport const InputGroup = forwardRef<InputGroupProps, \"div\">((props, ref) => {\n const [styles] = useComponentMultiStyle(\"Input\", props)\n const { className, children, ...rest } = omitThemeProps(props)\n\n const [vars, variableProps] = useCreateVars({ ...styles.field, ...rest }, [\n \"minHeight\",\n \"minH\",\n \"height\",\n \"h\",\n \"fontSize\",\n ])\n const minHeight = variableProps.minHeight ?? variableProps.minH\n const height = variableProps.height ?? variableProps.h\n const fieldHeight = minHeight ?? height\n const fieldFontSize = variableProps.fontSize\n\n const css: CSSUIObject = {\n display: \"flex\",\n position: \"relative\",\n vars,\n width: \"100%\",\n ...styles.container,\n }\n\n const groupProps: CSSUIProps = {}\n\n const validChildren = getValidChildren(children)\n\n validChildren.forEach((child: any) => {\n if (fieldHeight && child.type === InputLeftElement)\n groupProps.paddingStart = `${fieldHeight} !important`\n\n if (fieldHeight && child.type === InputRightElement)\n groupProps.paddingEnd = `${fieldHeight} !important`\n\n if (child.type === InputLeftAddon) groupProps.roundedLeft = \"0px !important\"\n\n if (child.type === InputRightAddon)\n groupProps.roundedRight = \"0px !important\"\n })\n\n const cloneChildren = validChildren.map((child) => {\n const isAddonElement = [\n InputLeftAddon,\n InputRightAddon,\n InputLeftElement,\n InputRightElement,\n ].some((type) => child.type === type)\n\n if (isAddonElement) {\n return child\n } else {\n const childProps = filterUndefined({\n size: child.props?.size ?? props.size,\n variant: child.props?.variant ?? props.variant,\n ...child.props,\n })\n\n return cloneElement(child, Object.assign(childProps, groupProps))\n }\n })\n\n return (\n <InputGroupProvider value={{ fieldFontSize, fieldHeight, styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-input-group\", className)}\n role=\"group\"\n __css={css}\n {...rest}\n >\n {cloneChildren}\n </ui.div>\n </InputGroupProvider>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,IAAI,iBAAiB,wBAAwB;AACtD,SAAS,oBAAoB;AAuEvB;AAhEC,IAAM,aAAa,WAAmC,CAAC,OAAO,QAAQ;AArB7E;AAsBE,QAAM,CAAC,MAAM,IAAI,uBAAuB,SAAS,KAAK;AACtD,QAAM,EAAE,WAAW,UAAU,GAAG,KAAK,IAAI,eAAe,KAAK;AAE7D,QAAM,CAAC,MAAM,aAAa,IAAI,cAAc,EAAE,GAAG,OAAO,OAAO,GAAG,KAAK,GAAG;AAAA,IACxE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,aAAY,mBAAc,cAAd,YAA2B,cAAc;AAC3D,QAAM,UAAS,mBAAc,WAAd,YAAwB,cAAc;AACrD,QAAM,cAAc,gCAAa;AACjC,QAAM,gBAAgB,cAAc;AAEpC,QAAM,MAAmB;AAAA,IACvB,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AAA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SUIProps,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n useCreateVars,\n} from \"@yamada-ui/core\"\nimport { cx, filterUndefined, getValidChildren } from \"@yamada-ui/utils\"\nimport { cloneElement } from \"react\"\nimport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nimport { InputGroupProvider } from \"./input-context\"\nimport { InputLeftElement, InputRightElement } from \"./input-element\"\n\nexport interface InputGroupProps extends HTMLUIProps, ThemeProps<\"Input\"> {}\n\nexport const InputGroup = forwardRef<InputGroupProps, \"div\">((props, ref) => {\n const [styles] = useComponentMultiStyle(\"Input\", props)\n const { className, children, ...rest } = omitThemeProps(props)\n\n const [vars, variableProps] = useCreateVars({ ...styles.field, ...rest }, [\n \"minHeight\",\n \"minH\",\n \"height\",\n \"h\",\n \"fontSize\",\n ])\n const minHeight = variableProps.minHeight ?? variableProps.minH\n const height = variableProps.height ?? variableProps.h\n const fieldHeight = minHeight ?? height\n const fieldFontSize = variableProps.fontSize\n\n const css: CSSUIObject = {\n display: \"flex\",\n position: \"relative\",\n vars,\n width: \"100%\",\n ...styles.container,\n }\n\n const groupProps: CSSUIProps = {}\n\n const validChildren = getValidChildren(children)\n\n validChildren.forEach((child: any) => {\n if (fieldHeight && child.type === InputLeftElement)\n groupProps.paddingStart = `${fieldHeight} !important`\n\n if (fieldHeight && child.type === InputRightElement)\n groupProps.paddingEnd = `${fieldHeight} !important`\n\n if (child.type === InputLeftAddon) groupProps.roundedLeft = \"0px !important\"\n\n if (child.type === InputRightAddon)\n groupProps.roundedRight = \"0px !important\"\n })\n\n const cloneChildren = validChildren.map((child) => {\n const isAddonElement = [\n InputLeftAddon,\n InputRightAddon,\n InputLeftElement,\n InputRightElement,\n ].some((type) => child.type === type)\n\n if (isAddonElement) {\n return child\n } else {\n const childProps = filterUndefined({\n size: child.props?.size ?? props.size,\n variant: child.props?.variant ?? props.variant,\n ...child.props,\n })\n\n return cloneElement(child, Object.assign(childProps, groupProps))\n }\n })\n\n return (\n <InputGroupProvider value={{ fieldFontSize, fieldHeight, styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-input-group\", className)}\n role=\"group\"\n __css={css}\n {...rest}\n >\n {cloneChildren}\n </ui.div>\n </InputGroupProvider>\n )\n})\n\nInputGroup.displayName = \"InputGroup\"\nInputGroup.__ui__ = \"InputGroup\"\n"],"mappings":";;;;;;;;;;;;;;AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,IAAI,iBAAiB,wBAAwB;AACtD,SAAS,oBAAoB;AAuEvB;AAhEC,IAAM,aAAa,WAAmC,CAAC,OAAO,QAAQ;AArB7E;AAsBE,QAAM,CAAC,MAAM,IAAI,uBAAuB,SAAS,KAAK;AACtD,QAAM,EAAE,WAAW,UAAU,GAAG,KAAK,IAAI,eAAe,KAAK;AAE7D,QAAM,CAAC,MAAM,aAAa,IAAI,cAAc,EAAE,GAAG,OAAO,OAAO,GAAG,KAAK,GAAG;AAAA,IACxE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,aAAY,mBAAc,cAAd,YAA2B,cAAc;AAC3D,QAAM,UAAS,mBAAc,WAAd,YAAwB,cAAc;AACrD,QAAM,cAAc,gCAAa;AACjC,QAAM,gBAAgB,cAAc;AAEpC,QAAM,MAAmB;AAAA,IACvB,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AAAA,IACA,OAAO;AAAA,IACP,GAAG,OAAO;AAAA,EACZ;AAEA,QAAM,aAAyB,CAAC;AAEhC,QAAM,gBAAgB,iBAAiB,QAAQ;AAE/C,gBAAc,QAAQ,CAAC,UAAe;AACpC,QAAI,eAAe,MAAM,SAAS;AAChC,iBAAW,eAAe,GAAG,WAAW;AAE1C,QAAI,eAAe,MAAM,SAAS;AAChC,iBAAW,aAAa,GAAG,WAAW;AAExC,QAAI,MAAM,SAAS,eAAgB,YAAW,cAAc;AAE5D,QAAI,MAAM,SAAS;AACjB,iBAAW,eAAe;AAAA,EAC9B,CAAC;AAED,QAAM,gBAAgB,cAAc,IAAI,CAAC,UAAU;AA9DrD,QAAAA,KAAAC,KAAA;AA+DI,UAAM,iBAAiB;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,KAAK,CAAC,SAAS,MAAM,SAAS,IAAI;AAEpC,QAAI,gBAAgB;AAClB,aAAO;AAAA,IACT,OAAO;AACL,YAAM,aAAa,gBAAgB;AAAA,QACjC,OAAMA,OAAAD,MAAA,MAAM,UAAN,gBAAAA,IAAa,SAAb,OAAAC,MAAqB,MAAM;AAAA,QACjC,UAAS,iBAAM,UAAN,mBAAa,YAAb,YAAwB,MAAM;AAAA,QACvC,GAAG,MAAM;AAAA,MACX,CAAC;AAED,aAAO,aAAa,OAAO,OAAO,OAAO,YAAY,UAAU,CAAC;AAAA,IAClE;AAAA,EACF,CAAC;AAED,SACE,oBAAC,sBAAmB,OAAO,EAAE,eAAe,aAAa,OAAO,GAC9D;AAAA,IAAC,GAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,WAAW,GAAG,kBAAkB,SAAS;AAAA,MACzC,MAAK;AAAA,MACL,OAAO;AAAA,MACN,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AAED,WAAW,cAAc;AACzB,WAAW,SAAS;","names":["_a","_b"]}
|
package/dist/index.js
CHANGED
@@ -51,6 +51,8 @@ var Input = (0, import_core.forwardRef)((props, ref) => {
|
|
51
51
|
}
|
52
52
|
);
|
53
53
|
});
|
54
|
+
Input.displayName = "Input";
|
55
|
+
Input.__ui__ = "Input";
|
54
56
|
|
55
57
|
// src/input-addon.tsx
|
56
58
|
var import_core2 = require("@yamada-ui/core");
|
@@ -98,6 +100,8 @@ var InputAddon = (0, import_core2.forwardRef)(
|
|
98
100
|
);
|
99
101
|
}
|
100
102
|
);
|
103
|
+
InputAddon.displayName = "InputAddon";
|
104
|
+
InputAddon.__ui__ = "InputAddon";
|
101
105
|
var InputLeftAddon = (0, import_core2.forwardRef)(
|
102
106
|
({ className, ...rest }, ref) => {
|
103
107
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
@@ -111,6 +115,8 @@ var InputLeftAddon = (0, import_core2.forwardRef)(
|
|
111
115
|
);
|
112
116
|
}
|
113
117
|
);
|
118
|
+
InputLeftAddon.displayName = "InputLeftAddon";
|
119
|
+
InputLeftAddon.__ui__ = "InputLeftAddon";
|
114
120
|
var InputRightAddon = (0, import_core2.forwardRef)(
|
115
121
|
({ className, ...rest }, ref) => {
|
116
122
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
@@ -124,6 +130,8 @@ var InputRightAddon = (0, import_core2.forwardRef)(
|
|
124
130
|
);
|
125
131
|
}
|
126
132
|
);
|
133
|
+
InputRightAddon.displayName = "InputRightAddon";
|
134
|
+
InputRightAddon.__ui__ = "InputRightAddon";
|
127
135
|
|
128
136
|
// src/input-element.tsx
|
129
137
|
var import_core3 = require("@yamada-ui/core");
|
@@ -159,6 +167,8 @@ var InputElement = (0, import_core3.forwardRef)(
|
|
159
167
|
);
|
160
168
|
}
|
161
169
|
);
|
170
|
+
InputElement.displayName = "InputElement";
|
171
|
+
InputElement.__ui__ = "InputElement";
|
162
172
|
var InputLeftElement = (0, import_core3.forwardRef)(
|
163
173
|
({ className, ...rest }, ref) => {
|
164
174
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
@@ -172,6 +182,8 @@ var InputLeftElement = (0, import_core3.forwardRef)(
|
|
172
182
|
);
|
173
183
|
}
|
174
184
|
);
|
185
|
+
InputLeftElement.displayName = "InputLeftElement";
|
186
|
+
InputLeftElement.__ui__ = "InputLeftElement";
|
175
187
|
var InputRightElement = (0, import_core3.forwardRef)(
|
176
188
|
({ className, ...rest }, ref) => {
|
177
189
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
@@ -185,6 +197,8 @@ var InputRightElement = (0, import_core3.forwardRef)(
|
|
185
197
|
);
|
186
198
|
}
|
187
199
|
);
|
200
|
+
InputRightElement.displayName = "InputRightElement";
|
201
|
+
InputRightElement.__ui__ = "InputRightElement";
|
188
202
|
|
189
203
|
// src/input-group.tsx
|
190
204
|
var import_core4 = require("@yamada-ui/core");
|
@@ -255,6 +269,8 @@ var InputGroup = (0, import_core4.forwardRef)((props, ref) => {
|
|
255
269
|
}
|
256
270
|
) });
|
257
271
|
});
|
272
|
+
InputGroup.displayName = "InputGroup";
|
273
|
+
InputGroup.__ui__ = "InputGroup";
|
258
274
|
// Annotate the CommonJS export names for ESM import in node:
|
259
275
|
0 && (module.exports = {
|
260
276
|
Input,
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/input.tsx","../src/input-addon.tsx","../src/input-context.tsx","../src/input-element.tsx","../src/input-group.tsx"],"sourcesContent":["export { Input } from \"./input\"\nexport type { InputProps } from \"./input\"\nexport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nexport type { InputAddonProps } from \"./input-addon\"\nexport { InputLeftElement, InputRightElement } from \"./input-element\"\nexport type { InputElementProps } from \"./input-element\"\nexport { InputGroup } from \"./input-group\"\nexport type { InputGroupProps } from \"./input-group\"\n","import type {\n ColorModeToken,\n CSS,\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { useFormControlProps } from \"@yamada-ui/form-control\"\nimport { cx } from \"@yamada-ui/utils\"\n\ninterface InputOptions {\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The native HTML `size` attribute to be passed to the `input`.\n */\n htmlSize?: number\n}\n\nexport interface InputProps\n extends Omit<\n HTMLUIProps<\"input\">,\n \"disabled\" | \"readOnly\" | \"required\" | \"size\"\n >,\n ThemeProps<\"Input\">,\n InputOptions,\n FormControlOptions {}\n\n/**\n * `Input` is a component used to obtain text input from the user.\n *\n * @see Docs https://yamada-ui.com/components/forms/input\n */\nexport const Input = forwardRef<InputProps, \"input\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Input\", props)\n let { className, htmlSize, __css, ...rest } = omitThemeProps(mergedProps)\n\n rest = useFormControlProps(rest)\n\n const css: CSSUIObject = { ...styles.field, ...__css }\n\n return (\n <ui.input\n ref={ref}\n className={cx(\"ui-input\", className)}\n size={htmlSize}\n __css={css}\n {...rest}\n />\n )\n})\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputAddonOptions {\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputAddonProps extends HTMLUIProps, InputAddonOptions {}\n\nconst InputAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, placement = \"left\", ...rest }, ref) => {\n const { styles } = useInputGroup()\n\n const placementStyles = {\n left: {\n me: \"-1px\",\n roundedRight: \"0px !important\",\n },\n right: {\n ms: \"-1px\",\n roundedLeft: \"0px !important\",\n },\n }\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n flex: \"0 0 auto\",\n w: \"auto\",\n whiteSpace: \"nowrap\",\n ...styles.addon,\n ...placementStyles[placement],\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__addon\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport const InputLeftAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nexport const InputRightAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface InputGroupContext {\n fieldFontSize: string | undefined\n fieldHeight: string | undefined\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [InputGroupProvider, useInputGroup] =\n createContext<InputGroupContext>({\n name: \"InputGroupContext\",\n errorMessage: `useInputGroup returned is 'undefined'. Seems you forgot to wrap the components in \"<InputGroup />\" `,\n })\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputElementOptions {\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `isClickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n */\n isClickable?: boolean\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputElementProps extends HTMLUIProps, InputElementOptions {}\n\nconst InputElement = forwardRef<InputElementProps, \"div\">(\n (\n { className, isClick = false, isClickable, placement = \"left\", ...rest },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n isClickable ??= isClick\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: isClickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: isClickable ? \"auto\" : \"none\",\n position: \"absolute\",\n top: \"0\",\n w: fieldHeight,\n zIndex: \"fallback(kurillin, 9)\",\n ...styles.element,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__element\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport const InputLeftElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nexport const InputRightElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n","import type {\n CSSUIObject,\n CSSUIProps,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n useCreateVars,\n} from \"@yamada-ui/core\"\nimport { cx, filterUndefined, getValidChildren } from \"@yamada-ui/utils\"\nimport { cloneElement } from \"react\"\nimport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nimport { InputGroupProvider } from \"./input-context\"\nimport { InputLeftElement, InputRightElement } from \"./input-element\"\n\nexport interface InputGroupProps extends HTMLUIProps, ThemeProps<\"Input\"> {}\n\nexport const InputGroup = forwardRef<InputGroupProps, \"div\">((props, ref) => {\n const [styles] = useComponentMultiStyle(\"Input\", props)\n const { className, children, ...rest } = omitThemeProps(props)\n\n const [vars, variableProps] = useCreateVars({ ...styles.field, ...rest }, [\n \"minHeight\",\n \"minH\",\n \"height\",\n \"h\",\n \"fontSize\",\n ])\n const minHeight = variableProps.minHeight ?? variableProps.minH\n const height = variableProps.height ?? variableProps.h\n const fieldHeight = minHeight ?? height\n const fieldFontSize = variableProps.fontSize\n\n const css: CSSUIObject = {\n display: \"flex\",\n position: \"relative\",\n vars,\n width: \"100%\",\n ...styles.container,\n }\n\n const groupProps: CSSUIProps = {}\n\n const validChildren = getValidChildren(children)\n\n validChildren.forEach((child: any) => {\n if (fieldHeight && child.type === InputLeftElement)\n groupProps.paddingStart = `${fieldHeight} !important`\n\n if (fieldHeight && child.type === InputRightElement)\n groupProps.paddingEnd = `${fieldHeight} !important`\n\n if (child.type === InputLeftAddon) groupProps.roundedLeft = \"0px !important\"\n\n if (child.type === InputRightAddon)\n groupProps.roundedRight = \"0px !important\"\n })\n\n const cloneChildren = validChildren.map((child) => {\n const isAddonElement = [\n InputLeftAddon,\n InputRightAddon,\n InputLeftElement,\n InputRightElement,\n ].some((type) => child.type === type)\n\n if (isAddonElement) {\n return child\n } else {\n const childProps = filterUndefined({\n size: child.props?.size ?? props.size,\n variant: child.props?.variant ?? props.variant,\n ...child.props,\n })\n\n return cloneElement(child, Object.assign(childProps, groupProps))\n }\n })\n\n return (\n <InputGroupProvider value={{ fieldFontSize, fieldHeight, styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-input-group\", className)}\n role=\"group\"\n __css={css}\n {...rest}\n >\n {cloneChildren}\n </ui.div>\n </InputGroupProvider>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQA,kBAKO;AACP,0BAAoC;AACpC,mBAAmB;AAwCf;AATG,IAAM,YAAQ,wBAAgC,CAAC,OAAO,QAAQ;AACnE,QAAM,CAAC,QAAQ,WAAW,QAAI,oCAAuB,SAAS,KAAK;AACnE,MAAI,EAAE,WAAW,UAAU,OAAO,GAAG,KAAK,QAAI,4BAAe,WAAW;AAExE,aAAO,yCAAoB,IAAI;AAE/B,QAAM,MAAmB,EAAE,GAAG,OAAO,OAAO,GAAG,MAAM;AAErD,SACE;AAAA,IAAC,eAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,eAAW,iBAAG,YAAY,SAAS;AAAA,MACnC,MAAM;AAAA,MACN,OAAO;AAAA,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aAAO;AAAA,IACT,OAAO;AACL,YAAM,iBAAa,+BAAgB;AAAA,QACjC,OAAMA,OAAAD,MAAA,MAAM,UAAN,gBAAAA,IAAa,SAAb,OAAAC,MAAqB,MAAM;AAAA,QACjC,UAAS,iBAAM,UAAN,mBAAa,YAAb,YAAwB,MAAM;AAAA,QACvC,GAAG,MAAM;AAAA,MACX,CAAC;AAED,iBAAO,2BAAa,OAAO,OAAO,OAAO,YAAY,UAAU,CAAC;AAAA,IAClE;AAAA,EACF,CAAC;AAED,SACE,6CAAC,sBAAmB,OAAO,EAAE,eAAe,aAAa,OAAO,GAC9D;AAAA,IAAC,gBAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,eAAW,kBAAG,kBAAkB,SAAS;AAAA,MACzC,MAAK;AAAA,MACL,OAAO;AAAA,MACN,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;","names":["import_core","import_utils","import_utils","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","_a","_b"]}
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/input.tsx","../src/input-addon.tsx","../src/input-context.tsx","../src/input-element.tsx","../src/input-group.tsx"],"sourcesContent":["export { Input } from \"./input\"\nexport type { InputProps } from \"./input\"\nexport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nexport type { InputAddonProps } from \"./input-addon\"\nexport { InputLeftElement, InputRightElement } from \"./input-element\"\nexport type { InputElementProps } from \"./input-element\"\nexport { InputGroup } from \"./input-group\"\nexport type { InputGroupProps } from \"./input-group\"\n","import type {\n ColorModeToken,\n CSS,\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { useFormControlProps } from \"@yamada-ui/form-control\"\nimport { cx } from \"@yamada-ui/utils\"\n\ninterface InputOptions {\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The native HTML `size` attribute to be passed to the `input`.\n */\n htmlSize?: number\n}\n\nexport interface InputProps\n extends Omit<\n HTMLUIProps<\"input\">,\n \"disabled\" | \"readOnly\" | \"required\" | \"size\"\n >,\n ThemeProps<\"Input\">,\n InputOptions,\n FormControlOptions {}\n\n/**\n * `Input` is a component used to obtain text input from the user.\n *\n * @see Docs https://yamada-ui.com/components/forms/input\n */\nexport const Input = forwardRef<InputProps, \"input\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Input\", props)\n let { className, htmlSize, __css, ...rest } = omitThemeProps(mergedProps)\n\n rest = useFormControlProps(rest)\n\n const css: CSSUIObject = { ...styles.field, ...__css }\n\n return (\n <ui.input\n ref={ref}\n className={cx(\"ui-input\", className)}\n size={htmlSize}\n __css={css}\n {...rest}\n />\n )\n})\n\nInput.displayName = \"Input\"\nInput.__ui__ = \"Input\"\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputAddonOptions {\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputAddonProps extends HTMLUIProps, InputAddonOptions {}\n\nconst InputAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, placement = \"left\", ...rest }, ref) => {\n const { styles } = useInputGroup()\n\n const placementStyles = {\n left: {\n me: \"-1px\",\n roundedRight: \"0px !important\",\n },\n right: {\n ms: \"-1px\",\n roundedLeft: \"0px !important\",\n },\n }\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n flex: \"0 0 auto\",\n w: \"auto\",\n whiteSpace: \"nowrap\",\n ...styles.addon,\n ...placementStyles[placement],\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__addon\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nInputAddon.displayName = \"InputAddon\"\nInputAddon.__ui__ = \"InputAddon\"\n\nexport const InputLeftAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nInputLeftAddon.displayName = \"InputLeftAddon\"\nInputLeftAddon.__ui__ = \"InputLeftAddon\"\n\nexport const InputRightAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n\nInputRightAddon.displayName = \"InputRightAddon\"\nInputRightAddon.__ui__ = \"InputRightAddon\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface InputGroupContext {\n fieldFontSize: string | undefined\n fieldHeight: string | undefined\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [InputGroupProvider, useInputGroup] =\n createContext<InputGroupContext>({\n name: \"InputGroupContext\",\n errorMessage: `useInputGroup returned is 'undefined'. Seems you forgot to wrap the components in \"<InputGroup />\" `,\n })\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputElementOptions {\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `isClickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n */\n isClickable?: boolean\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputElementProps extends HTMLUIProps, InputElementOptions {}\n\nconst InputElement = forwardRef<InputElementProps, \"div\">(\n (\n { className, isClick = false, isClickable, placement = \"left\", ...rest },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n isClickable ??= isClick\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: isClickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: isClickable ? \"auto\" : \"none\",\n position: \"absolute\",\n top: \"0\",\n w: fieldHeight,\n zIndex: \"fallback(kurillin, 9)\",\n ...styles.element,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__element\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nInputElement.displayName = \"InputElement\"\nInputElement.__ui__ = \"InputElement\"\n\nexport const InputLeftElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nInputLeftElement.displayName = \"InputLeftElement\"\nInputLeftElement.__ui__ = \"InputLeftElement\"\n\nexport const InputRightElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n\nInputRightElement.displayName = \"InputRightElement\"\nInputRightElement.__ui__ = \"InputRightElement\"\n","import type {\n CSSUIObject,\n CSSUIProps,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n useCreateVars,\n} from \"@yamada-ui/core\"\nimport { cx, filterUndefined, getValidChildren } from \"@yamada-ui/utils\"\nimport { cloneElement } from \"react\"\nimport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nimport { InputGroupProvider } from \"./input-context\"\nimport { InputLeftElement, InputRightElement } from \"./input-element\"\n\nexport interface InputGroupProps extends HTMLUIProps, ThemeProps<\"Input\"> {}\n\nexport const InputGroup = forwardRef<InputGroupProps, \"div\">((props, ref) => {\n const [styles] = useComponentMultiStyle(\"Input\", props)\n const { className, children, ...rest } = omitThemeProps(props)\n\n const [vars, variableProps] = useCreateVars({ ...styles.field, ...rest }, [\n \"minHeight\",\n \"minH\",\n \"height\",\n \"h\",\n \"fontSize\",\n ])\n const minHeight = variableProps.minHeight ?? variableProps.minH\n const height = variableProps.height ?? variableProps.h\n const fieldHeight = minHeight ?? height\n const fieldFontSize = variableProps.fontSize\n\n const css: CSSUIObject = {\n display: \"flex\",\n position: \"relative\",\n vars,\n width: \"100%\",\n ...styles.container,\n }\n\n const groupProps: CSSUIProps = {}\n\n const validChildren = getValidChildren(children)\n\n validChildren.forEach((child: any) => {\n if (fieldHeight && child.type === InputLeftElement)\n groupProps.paddingStart = `${fieldHeight} !important`\n\n if (fieldHeight && child.type === InputRightElement)\n groupProps.paddingEnd = `${fieldHeight} !important`\n\n if (child.type === InputLeftAddon) groupProps.roundedLeft = \"0px !important\"\n\n if (child.type === InputRightAddon)\n groupProps.roundedRight = \"0px !important\"\n })\n\n const cloneChildren = validChildren.map((child) => {\n const isAddonElement = [\n InputLeftAddon,\n InputRightAddon,\n InputLeftElement,\n InputRightElement,\n ].some((type) => child.type === type)\n\n if (isAddonElement) {\n return child\n } else {\n const childProps = filterUndefined({\n size: child.props?.size ?? props.size,\n variant: child.props?.variant ?? props.variant,\n ...child.props,\n })\n\n return cloneElement(child, Object.assign(childProps, groupProps))\n }\n })\n\n return (\n <InputGroupProvider value={{ fieldFontSize, fieldHeight, styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-input-group\", className)}\n role=\"group\"\n __css={css}\n {...rest}\n >\n {cloneChildren}\n </ui.div>\n </InputGroupProvider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Aa,OAAO,GAC9D;AAAA,IAAC,gBAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,eAAW,kBAAG,kBAAkB,SAAS;AAAA,MACzC,MAAK;AAAA,MACL,OAAO;AAAA,MACN,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AAED,WAAW,cAAc;AACzB,WAAW,SAAS;","names":["import_core","import_utils","import_utils","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","_a","_b"]}
|
package/dist/index.mjs
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
InputGroup
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-ODVOBSDG.mjs";
|
5
5
|
import {
|
6
6
|
InputLeftAddon,
|
7
7
|
InputRightAddon
|
8
|
-
} from "./chunk-
|
8
|
+
} from "./chunk-HSHTS6CU.mjs";
|
9
9
|
import {
|
10
10
|
InputLeftElement,
|
11
11
|
InputRightElement
|
12
|
-
} from "./chunk-
|
12
|
+
} from "./chunk-MFPW4EYD.mjs";
|
13
13
|
import "./chunk-N7GDIMME.mjs";
|
14
14
|
import {
|
15
15
|
Input
|
16
|
-
} from "./chunk-
|
16
|
+
} from "./chunk-LAVL5JMX.mjs";
|
17
17
|
export {
|
18
18
|
Input,
|
19
19
|
InputGroup,
|
package/dist/input-addon.js
CHANGED
@@ -70,6 +70,8 @@ var InputAddon = (0, import_core.forwardRef)(
|
|
70
70
|
);
|
71
71
|
}
|
72
72
|
);
|
73
|
+
InputAddon.displayName = "InputAddon";
|
74
|
+
InputAddon.__ui__ = "InputAddon";
|
73
75
|
var InputLeftAddon = (0, import_core.forwardRef)(
|
74
76
|
({ className, ...rest }, ref) => {
|
75
77
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -83,6 +85,8 @@ var InputLeftAddon = (0, import_core.forwardRef)(
|
|
83
85
|
);
|
84
86
|
}
|
85
87
|
);
|
88
|
+
InputLeftAddon.displayName = "InputLeftAddon";
|
89
|
+
InputLeftAddon.__ui__ = "InputLeftAddon";
|
86
90
|
var InputRightAddon = (0, import_core.forwardRef)(
|
87
91
|
({ className, ...rest }, ref) => {
|
88
92
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -96,6 +100,8 @@ var InputRightAddon = (0, import_core.forwardRef)(
|
|
96
100
|
);
|
97
101
|
}
|
98
102
|
);
|
103
|
+
InputRightAddon.displayName = "InputRightAddon";
|
104
|
+
InputRightAddon.__ui__ = "InputRightAddon";
|
99
105
|
// Annotate the CommonJS export names for ESM import in node:
|
100
106
|
0 && (module.exports = {
|
101
107
|
InputLeftAddon,
|
package/dist/input-addon.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/input-addon.tsx","../src/input-context.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputAddonOptions {\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputAddonProps extends HTMLUIProps, InputAddonOptions {}\n\nconst InputAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, placement = \"left\", ...rest }, ref) => {\n const { styles } = useInputGroup()\n\n const placementStyles = {\n left: {\n me: \"-1px\",\n roundedRight: \"0px !important\",\n },\n right: {\n ms: \"-1px\",\n roundedLeft: \"0px !important\",\n },\n }\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n flex: \"0 0 auto\",\n w: \"auto\",\n whiteSpace: \"nowrap\",\n ...styles.addon,\n ...placementStyles[placement],\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__addon\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport const InputLeftAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nexport const InputRightAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface InputGroupContext {\n fieldFontSize: string | undefined\n fieldHeight: string | undefined\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [InputGroupProvider, useInputGroup] =\n createContext<InputGroupContext>({\n name: \"InputGroupContext\",\n errorMessage: `useInputGroup returned is 'undefined'. Seems you forgot to wrap the components in \"<InputGroup />\" `,\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,IAAAA,gBAAmB;;;ACDnB,mBAA8B;AAQvB,IAAM,CAAC,oBAAoB,aAAa,QAC7C,4BAAiC;AAAA,EAC/B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AD6BG;AA1BN,IAAM,iBAAa;AAAA,EACjB,CAAC,EAAE,WAAW,YAAY,QAAQ,GAAG,KAAK,GAAG,QAAQ;AACnD,UAAM,EAAE,OAAO,IAAI,cAAc;AAEjC,UAAM,kBAAkB;AAAA,MACtB,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,cAAc;AAAA,MAChB;AAAA,MACA,OAAO;AAAA,QACL,IAAI;AAAA,QACJ,aAAa;AAAA,MACf;AAAA,IACF;AAEA,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,MAAM;AAAA,MACN,GAAG;AAAA,MACH,YAAY;AAAA,MACZ,GAAG,OAAO;AAAA,MACV,GAAG,gBAAgB,SAAS;AAAA,IAC9B;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,mBAAmB,SAAS;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;
|
1
|
+
{"version":3,"sources":["../src/input-addon.tsx","../src/input-context.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputAddonOptions {\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputAddonProps extends HTMLUIProps, InputAddonOptions {}\n\nconst InputAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, placement = \"left\", ...rest }, ref) => {\n const { styles } = useInputGroup()\n\n const placementStyles = {\n left: {\n me: \"-1px\",\n roundedRight: \"0px !important\",\n },\n right: {\n ms: \"-1px\",\n roundedLeft: \"0px !important\",\n },\n }\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n flex: \"0 0 auto\",\n w: \"auto\",\n whiteSpace: \"nowrap\",\n ...styles.addon,\n ...placementStyles[placement],\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__addon\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nInputAddon.displayName = \"InputAddon\"\nInputAddon.__ui__ = \"InputAddon\"\n\nexport const InputLeftAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nInputLeftAddon.displayName = \"InputLeftAddon\"\nInputLeftAddon.__ui__ = \"InputLeftAddon\"\n\nexport const InputRightAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n\nInputRightAddon.displayName = \"InputRightAddon\"\nInputRightAddon.__ui__ = \"InputRightAddon\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface InputGroupContext {\n fieldFontSize: string | undefined\n fieldHeight: string | undefined\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [InputGroupProvider, useInputGroup] =\n createContext<InputGroupContext>({\n name: \"InputGroupContext\",\n errorMessage: `useInputGroup returned is 'undefined'. Seems you forgot to wrap the components in \"<InputGroup />\" `,\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,IAAAA,gBAAmB;;;ACDnB,mBAA8B;AAQvB,IAAM,CAAC,oBAAoB,aAAa,QAC7C,4BAAiC;AAAA,EAC/B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AD6BG;AA1BN,IAAM,iBAAa;AAAA,EACjB,CAAC,EAAE,WAAW,YAAY,QAAQ,GAAG,KAAK,GAAG,QAAQ;AACnD,UAAM,EAAE,OAAO,IAAI,cAAc;AAEjC,UAAM,kBAAkB;AAAA,MACtB,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,cAAc;AAAA,MAChB;AAAA,MACA,OAAO;AAAA,QACL,IAAI;AAAA,QACJ,aAAa;AAAA,MACf;AAAA,IACF;AAEA,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,MAAM;AAAA,MACN,GAAG;AAAA,MACH,YAAY;AAAA,MACZ,GAAG,OAAO;AAAA,MACV,GAAG,gBAAgB,SAAS;AAAA,IAC9B;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,mBAAmB,SAAS;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;AACzB,WAAW,SAAS;AAEb,IAAM,qBAAiB;AAAA,EAC5B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,yBAAyB,SAAS;AAAA,QAChD,WAAU;AAAA,QACT,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAC7B,eAAe,SAAS;AAEjB,IAAM,sBAAkB;AAAA,EAC7B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,0BAA0B,SAAS;AAAA,QACjD,WAAU;AAAA,QACT,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,gBAAgB,cAAc;AAC9B,gBAAgB,SAAS;","names":["import_utils"]}
|
package/dist/input-addon.mjs
CHANGED
package/dist/input-element.js
CHANGED
@@ -67,6 +67,8 @@ var InputElement = (0, import_core.forwardRef)(
|
|
67
67
|
);
|
68
68
|
}
|
69
69
|
);
|
70
|
+
InputElement.displayName = "InputElement";
|
71
|
+
InputElement.__ui__ = "InputElement";
|
70
72
|
var InputLeftElement = (0, import_core.forwardRef)(
|
71
73
|
({ className, ...rest }, ref) => {
|
72
74
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -80,6 +82,8 @@ var InputLeftElement = (0, import_core.forwardRef)(
|
|
80
82
|
);
|
81
83
|
}
|
82
84
|
);
|
85
|
+
InputLeftElement.displayName = "InputLeftElement";
|
86
|
+
InputLeftElement.__ui__ = "InputLeftElement";
|
83
87
|
var InputRightElement = (0, import_core.forwardRef)(
|
84
88
|
({ className, ...rest }, ref) => {
|
85
89
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -93,6 +97,8 @@ var InputRightElement = (0, import_core.forwardRef)(
|
|
93
97
|
);
|
94
98
|
}
|
95
99
|
);
|
100
|
+
InputRightElement.displayName = "InputRightElement";
|
101
|
+
InputRightElement.__ui__ = "InputRightElement";
|
96
102
|
// Annotate the CommonJS export names for ESM import in node:
|
97
103
|
0 && (module.exports = {
|
98
104
|
InputLeftElement,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/input-element.tsx","../src/input-context.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputElementOptions {\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `isClickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n */\n isClickable?: boolean\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputElementProps extends HTMLUIProps, InputElementOptions {}\n\nconst InputElement = forwardRef<InputElementProps, \"div\">(\n (\n { className, isClick = false, isClickable, placement = \"left\", ...rest },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n isClickable ??= isClick\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: isClickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: isClickable ? \"auto\" : \"none\",\n position: \"absolute\",\n top: \"0\",\n w: fieldHeight,\n zIndex: \"fallback(kurillin, 9)\",\n ...styles.element,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__element\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport const InputLeftElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nexport const InputRightElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface InputGroupContext {\n fieldFontSize: string | undefined\n fieldHeight: string | undefined\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [InputGroupProvider, useInputGroup] =\n createContext<InputGroupContext>({\n name: \"InputGroupContext\",\n errorMessage: `useInputGroup returned is 'undefined'. Seems you forgot to wrap the components in \"<InputGroup />\" `,\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,IAAAA,gBAAmB;;;ACDnB,mBAA8B;AAQvB,IAAM,CAAC,oBAAoB,aAAa,QAC7C,4BAAiC;AAAA,EAC/B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AD2CG;AA1BN,IAAM,mBAAe;AAAA,EACnB,CACE,EAAE,WAAW,UAAU,OAAO,aAAa,YAAY,QAAQ,GAAG,KAAK,GACvE,QACG;AACH,UAAM,EAAE,eAAe,aAAa,OAAO,IAAI,cAAc;AAE7D,sDAAgB;AAEhB,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,QAAQ,cAAc,YAAY;AAAA,MAClC,SAAS;AAAA,MACT,UAAU;AAAA,MACV,GAAG;AAAA,MACH,gBAAgB;AAAA,MAChB,CAAC,cAAc,SAAS,eAAe,UAAU,GAAG;AAAA,MACpD,eAAe,cAAc,SAAS;AAAA,MACtC,UAAU;AAAA,MACV,KAAK;AAAA,MACL,GAAG;AAAA,MACH,QAAQ;AAAA,MACR,GAAG,OAAO;AAAA,IACZ;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;
|
1
|
+
{"version":3,"sources":["../src/input-element.tsx","../src/input-context.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputElementOptions {\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `isClickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n */\n isClickable?: boolean\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputElementProps extends HTMLUIProps, InputElementOptions {}\n\nconst InputElement = forwardRef<InputElementProps, \"div\">(\n (\n { className, isClick = false, isClickable, placement = \"left\", ...rest },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n isClickable ??= isClick\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: isClickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: isClickable ? \"auto\" : \"none\",\n position: \"absolute\",\n top: \"0\",\n w: fieldHeight,\n zIndex: \"fallback(kurillin, 9)\",\n ...styles.element,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__element\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nInputElement.displayName = \"InputElement\"\nInputElement.__ui__ = \"InputElement\"\n\nexport const InputLeftElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nInputLeftElement.displayName = \"InputLeftElement\"\nInputLeftElement.__ui__ = \"InputLeftElement\"\n\nexport const InputRightElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n\nInputRightElement.displayName = \"InputRightElement\"\nInputRightElement.__ui__ = \"InputRightElement\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface InputGroupContext {\n fieldFontSize: string | undefined\n fieldHeight: string | undefined\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [InputGroupProvider, useInputGroup] =\n createContext<InputGroupContext>({\n name: \"InputGroupContext\",\n errorMessage: `useInputGroup returned is 'undefined'. Seems you forgot to wrap the components in \"<InputGroup />\" `,\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,IAAAA,gBAAmB;;;ACDnB,mBAA8B;AAQvB,IAAM,CAAC,oBAAoB,aAAa,QAC7C,4BAAiC;AAAA,EAC/B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AD2CG;AA1BN,IAAM,mBAAe;AAAA,EACnB,CACE,EAAE,WAAW,UAAU,OAAO,aAAa,YAAY,QAAQ,GAAG,KAAK,GACvE,QACG;AACH,UAAM,EAAE,eAAe,aAAa,OAAO,IAAI,cAAc;AAE7D,sDAAgB;AAEhB,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,QAAQ,cAAc,YAAY;AAAA,MAClC,SAAS;AAAA,MACT,UAAU;AAAA,MACV,GAAG;AAAA,MACH,gBAAgB;AAAA,MAChB,CAAC,cAAc,SAAS,eAAe,UAAU,GAAG;AAAA,MACpD,eAAe,cAAc,SAAS;AAAA,MACtC,UAAU;AAAA,MACV,KAAK;AAAA,MACL,GAAG;AAAA,MACH,QAAQ;AAAA,MACR,GAAG,OAAO;AAAA,IACZ;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;AAEf,IAAM,uBAAmB;AAAA,EAC9B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,2BAA2B,SAAS;AAAA,QAClD,WAAU;AAAA,QACT,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,iBAAiB,cAAc;AAC/B,iBAAiB,SAAS;AAEnB,IAAM,wBAAoB;AAAA,EAC/B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,4BAA4B,SAAS;AAAA,QACnD,WAAU;AAAA,QACT,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAChC,kBAAkB,SAAS;","names":["import_utils"]}
|
package/dist/input-element.mjs
CHANGED
package/dist/input-group.js
CHANGED
@@ -74,6 +74,8 @@ var InputAddon = (0, import_core.forwardRef)(
|
|
74
74
|
);
|
75
75
|
}
|
76
76
|
);
|
77
|
+
InputAddon.displayName = "InputAddon";
|
78
|
+
InputAddon.__ui__ = "InputAddon";
|
77
79
|
var InputLeftAddon = (0, import_core.forwardRef)(
|
78
80
|
({ className, ...rest }, ref) => {
|
79
81
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -87,6 +89,8 @@ var InputLeftAddon = (0, import_core.forwardRef)(
|
|
87
89
|
);
|
88
90
|
}
|
89
91
|
);
|
92
|
+
InputLeftAddon.displayName = "InputLeftAddon";
|
93
|
+
InputLeftAddon.__ui__ = "InputLeftAddon";
|
90
94
|
var InputRightAddon = (0, import_core.forwardRef)(
|
91
95
|
({ className, ...rest }, ref) => {
|
92
96
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -100,6 +104,8 @@ var InputRightAddon = (0, import_core.forwardRef)(
|
|
100
104
|
);
|
101
105
|
}
|
102
106
|
);
|
107
|
+
InputRightAddon.displayName = "InputRightAddon";
|
108
|
+
InputRightAddon.__ui__ = "InputRightAddon";
|
103
109
|
|
104
110
|
// src/input-element.tsx
|
105
111
|
var import_core2 = require("@yamada-ui/core");
|
@@ -135,6 +141,8 @@ var InputElement = (0, import_core2.forwardRef)(
|
|
135
141
|
);
|
136
142
|
}
|
137
143
|
);
|
144
|
+
InputElement.displayName = "InputElement";
|
145
|
+
InputElement.__ui__ = "InputElement";
|
138
146
|
var InputLeftElement = (0, import_core2.forwardRef)(
|
139
147
|
({ className, ...rest }, ref) => {
|
140
148
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
@@ -148,6 +156,8 @@ var InputLeftElement = (0, import_core2.forwardRef)(
|
|
148
156
|
);
|
149
157
|
}
|
150
158
|
);
|
159
|
+
InputLeftElement.displayName = "InputLeftElement";
|
160
|
+
InputLeftElement.__ui__ = "InputLeftElement";
|
151
161
|
var InputRightElement = (0, import_core2.forwardRef)(
|
152
162
|
({ className, ...rest }, ref) => {
|
153
163
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
@@ -161,6 +171,8 @@ var InputRightElement = (0, import_core2.forwardRef)(
|
|
161
171
|
);
|
162
172
|
}
|
163
173
|
);
|
174
|
+
InputRightElement.displayName = "InputRightElement";
|
175
|
+
InputRightElement.__ui__ = "InputRightElement";
|
164
176
|
|
165
177
|
// src/input-group.tsx
|
166
178
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
@@ -228,6 +240,8 @@ var InputGroup = (0, import_core3.forwardRef)((props, ref) => {
|
|
228
240
|
}
|
229
241
|
) });
|
230
242
|
});
|
243
|
+
InputGroup.displayName = "InputGroup";
|
244
|
+
InputGroup.__ui__ = "InputGroup";
|
231
245
|
// Annotate the CommonJS export names for ESM import in node:
|
232
246
|
0 && (module.exports = {
|
233
247
|
InputGroup
|
package/dist/input-group.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/input-group.tsx","../src/input-addon.tsx","../src/input-context.tsx","../src/input-element.tsx"],"sourcesContent":["import type {\n CSSUIObject,\n CSSUIProps,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n useCreateVars,\n} from \"@yamada-ui/core\"\nimport { cx, filterUndefined, getValidChildren } from \"@yamada-ui/utils\"\nimport { cloneElement } from \"react\"\nimport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nimport { InputGroupProvider } from \"./input-context\"\nimport { InputLeftElement, InputRightElement } from \"./input-element\"\n\nexport interface InputGroupProps extends HTMLUIProps, ThemeProps<\"Input\"> {}\n\nexport const InputGroup = forwardRef<InputGroupProps, \"div\">((props, ref) => {\n const [styles] = useComponentMultiStyle(\"Input\", props)\n const { className, children, ...rest } = omitThemeProps(props)\n\n const [vars, variableProps] = useCreateVars({ ...styles.field, ...rest }, [\n \"minHeight\",\n \"minH\",\n \"height\",\n \"h\",\n \"fontSize\",\n ])\n const minHeight = variableProps.minHeight ?? variableProps.minH\n const height = variableProps.height ?? variableProps.h\n const fieldHeight = minHeight ?? height\n const fieldFontSize = variableProps.fontSize\n\n const css: CSSUIObject = {\n display: \"flex\",\n position: \"relative\",\n vars,\n width: \"100%\",\n ...styles.container,\n }\n\n const groupProps: CSSUIProps = {}\n\n const validChildren = getValidChildren(children)\n\n validChildren.forEach((child: any) => {\n if (fieldHeight && child.type === InputLeftElement)\n groupProps.paddingStart = `${fieldHeight} !important`\n\n if (fieldHeight && child.type === InputRightElement)\n groupProps.paddingEnd = `${fieldHeight} !important`\n\n if (child.type === InputLeftAddon) groupProps.roundedLeft = \"0px !important\"\n\n if (child.type === InputRightAddon)\n groupProps.roundedRight = \"0px !important\"\n })\n\n const cloneChildren = validChildren.map((child) => {\n const isAddonElement = [\n InputLeftAddon,\n InputRightAddon,\n InputLeftElement,\n InputRightElement,\n ].some((type) => child.type === type)\n\n if (isAddonElement) {\n return child\n } else {\n const childProps = filterUndefined({\n size: child.props?.size ?? props.size,\n variant: child.props?.variant ?? props.variant,\n ...child.props,\n })\n\n return cloneElement(child, Object.assign(childProps, groupProps))\n }\n })\n\n return (\n <InputGroupProvider value={{ fieldFontSize, fieldHeight, styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-input-group\", className)}\n role=\"group\"\n __css={css}\n {...rest}\n >\n {cloneChildren}\n </ui.div>\n </InputGroupProvider>\n )\n})\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputAddonOptions {\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputAddonProps extends HTMLUIProps, InputAddonOptions {}\n\nconst InputAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, placement = \"left\", ...rest }, ref) => {\n const { styles } = useInputGroup()\n\n const placementStyles = {\n left: {\n me: \"-1px\",\n roundedRight: \"0px !important\",\n },\n right: {\n ms: \"-1px\",\n roundedLeft: \"0px !important\",\n },\n }\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n flex: \"0 0 auto\",\n w: \"auto\",\n whiteSpace: \"nowrap\",\n ...styles.addon,\n ...placementStyles[placement],\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__addon\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport const InputLeftAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nexport const InputRightAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface InputGroupContext {\n fieldFontSize: string | undefined\n fieldHeight: string | undefined\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [InputGroupProvider, useInputGroup] =\n createContext<InputGroupContext>({\n name: \"InputGroupContext\",\n errorMessage: `useInputGroup returned is 'undefined'. Seems you forgot to wrap the components in \"<InputGroup />\" `,\n })\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputElementOptions {\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `isClickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n */\n isClickable?: boolean\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputElementProps extends HTMLUIProps, InputElementOptions {}\n\nconst InputElement = forwardRef<InputElementProps, \"div\">(\n (\n { className, isClick = false, isClickable, placement = \"left\", ...rest },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n isClickable ??= isClick\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: isClickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: isClickable ? \"auto\" : \"none\",\n position: \"absolute\",\n top: \"0\",\n w: fieldHeight,\n zIndex: \"fallback(kurillin, 9)\",\n ...styles.element,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__element\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport const InputLeftElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nexport const InputRightElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAAA,eAMO;AACP,IAAAC,gBAAsD;AACtD,mBAA6B;;;ACb7B,kBAA+B;AAC/B,IAAAC,gBAAmB;;;ACDnB,mBAA8B;AAQvB,IAAM,CAAC,oBAAoB,aAAa,QAC7C,4BAAiC;AAAA,EAC/B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AD6BG;AA1BN,IAAM,iBAAa;AAAA,EACjB,CAAC,EAAE,WAAW,YAAY,QAAQ,GAAG,KAAK,GAAG,QAAQ;AACnD,UAAM,EAAE,OAAO,IAAI,cAAc;AAEjC,UAAM,kBAAkB;AAAA,MACtB,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,cAAc;AAAA,MAChB;AAAA,MACA,OAAO;AAAA,QACL,IAAI;AAAA,QACJ,aAAa;AAAA,MACf;AAAA,IACF;AAEA,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,MAAM;AAAA,MACN,GAAG;AAAA,MACH,YAAY;AAAA,MACZ,GAAG,OAAO;AAAA,MACV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AAM,oBAAgB,gCAAiB,QAAQ;AAE/C,gBAAc,QAAQ,CAAC,UAAe;AACpC,QAAI,eAAe,MAAM,SAAS;AAChC,iBAAW,eAAe,GAAG,WAAW;AAE1C,QAAI,eAAe,MAAM,SAAS;AAChC,iBAAW,aAAa,GAAG,WAAW;AAExC,QAAI,MAAM,SAAS,eAAgB,YAAW,cAAc;AAE5D,QAAI,MAAM,SAAS;AACjB,iBAAW,eAAe;AAAA,EAC9B,CAAC;AAED,QAAM,gBAAgB,cAAc,IAAI,CAAC,UAAU;AA9DrD,QAAAC,KAAAC,KAAA;AA+DI,UAAM,iBAAiB;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,KAAK,CAAC,SAAS,MAAM,SAAS,IAAI;AAEpC,QAAI,gBAAgB;AAClB,aAAO;AAAA,IACT,OAAO;AACL,YAAM,iBAAa,+BAAgB;AAAA,QACjC,OAAMA,OAAAD,MAAA,MAAM,UAAN,gBAAAA,IAAa,SAAb,OAAAC,MAAqB,MAAM;AAAA,QACjC,UAAS,iBAAM,UAAN,mBAAa,YAAb,YAAwB,MAAM;AAAA,QACvC,GAAG,MAAM;AAAA,MACX,CAAC;AAED,iBAAO,2BAAa,OAAO,OAAO,OAAO,YAAY,UAAU,CAAC;AAAA,IAClE;AAAA,EACF,CAAC;AAED,SACE,6CAAC,sBAAmB,OAAO,EAAE,eAAe,aAAa,OAAO,GAC9D;AAAA,IAAC,gBAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,eAAW,kBAAG,kBAAkB,SAAS;AAAA,MACzC,MAAK;AAAA,MACL,OAAO;AAAA,MACN,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;","names":["import_core","import_utils","import_utils","import_core","import_utils","import_jsx_runtime","import_jsx_runtime","_a","_b"]}
|
1
|
+
{"version":3,"sources":["../src/input-group.tsx","../src/input-addon.tsx","../src/input-context.tsx","../src/input-element.tsx"],"sourcesContent":["import type {\n CSSUIObject,\n CSSUIProps,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n useCreateVars,\n} from \"@yamada-ui/core\"\nimport { cx, filterUndefined, getValidChildren } from \"@yamada-ui/utils\"\nimport { cloneElement } from \"react\"\nimport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nimport { InputGroupProvider } from \"./input-context\"\nimport { InputLeftElement, InputRightElement } from \"./input-element\"\n\nexport interface InputGroupProps extends HTMLUIProps, ThemeProps<\"Input\"> {}\n\nexport const InputGroup = forwardRef<InputGroupProps, \"div\">((props, ref) => {\n const [styles] = useComponentMultiStyle(\"Input\", props)\n const { className, children, ...rest } = omitThemeProps(props)\n\n const [vars, variableProps] = useCreateVars({ ...styles.field, ...rest }, [\n \"minHeight\",\n \"minH\",\n \"height\",\n \"h\",\n \"fontSize\",\n ])\n const minHeight = variableProps.minHeight ?? variableProps.minH\n const height = variableProps.height ?? variableProps.h\n const fieldHeight = minHeight ?? height\n const fieldFontSize = variableProps.fontSize\n\n const css: CSSUIObject = {\n display: \"flex\",\n position: \"relative\",\n vars,\n width: \"100%\",\n ...styles.container,\n }\n\n const groupProps: CSSUIProps = {}\n\n const validChildren = getValidChildren(children)\n\n validChildren.forEach((child: any) => {\n if (fieldHeight && child.type === InputLeftElement)\n groupProps.paddingStart = `${fieldHeight} !important`\n\n if (fieldHeight && child.type === InputRightElement)\n groupProps.paddingEnd = `${fieldHeight} !important`\n\n if (child.type === InputLeftAddon) groupProps.roundedLeft = \"0px !important\"\n\n if (child.type === InputRightAddon)\n groupProps.roundedRight = \"0px !important\"\n })\n\n const cloneChildren = validChildren.map((child) => {\n const isAddonElement = [\n InputLeftAddon,\n InputRightAddon,\n InputLeftElement,\n InputRightElement,\n ].some((type) => child.type === type)\n\n if (isAddonElement) {\n return child\n } else {\n const childProps = filterUndefined({\n size: child.props?.size ?? props.size,\n variant: child.props?.variant ?? props.variant,\n ...child.props,\n })\n\n return cloneElement(child, Object.assign(childProps, groupProps))\n }\n })\n\n return (\n <InputGroupProvider value={{ fieldFontSize, fieldHeight, styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-input-group\", className)}\n role=\"group\"\n __css={css}\n {...rest}\n >\n {cloneChildren}\n </ui.div>\n </InputGroupProvider>\n )\n})\n\nInputGroup.displayName = \"InputGroup\"\nInputGroup.__ui__ = \"InputGroup\"\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputAddonOptions {\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputAddonProps extends HTMLUIProps, InputAddonOptions {}\n\nconst InputAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, placement = \"left\", ...rest }, ref) => {\n const { styles } = useInputGroup()\n\n const placementStyles = {\n left: {\n me: \"-1px\",\n roundedRight: \"0px !important\",\n },\n right: {\n ms: \"-1px\",\n roundedLeft: \"0px !important\",\n },\n }\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n flex: \"0 0 auto\",\n w: \"auto\",\n whiteSpace: \"nowrap\",\n ...styles.addon,\n ...placementStyles[placement],\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__addon\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nInputAddon.displayName = \"InputAddon\"\nInputAddon.__ui__ = \"InputAddon\"\n\nexport const InputLeftAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nInputLeftAddon.displayName = \"InputLeftAddon\"\nInputLeftAddon.__ui__ = \"InputLeftAddon\"\n\nexport const InputRightAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n\nInputRightAddon.displayName = \"InputRightAddon\"\nInputRightAddon.__ui__ = \"InputRightAddon\"\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface InputGroupContext {\n fieldFontSize: string | undefined\n fieldHeight: string | undefined\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [InputGroupProvider, useInputGroup] =\n createContext<InputGroupContext>({\n name: \"InputGroupContext\",\n errorMessage: `useInputGroup returned is 'undefined'. Seems you forgot to wrap the components in \"<InputGroup />\" `,\n })\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputElementOptions {\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `isClickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n */\n isClickable?: boolean\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputElementProps extends HTMLUIProps, InputElementOptions {}\n\nconst InputElement = forwardRef<InputElementProps, \"div\">(\n (\n { className, isClick = false, isClickable, placement = \"left\", ...rest },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n isClickable ??= isClick\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: isClickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: isClickable ? \"auto\" : \"none\",\n position: \"absolute\",\n top: \"0\",\n w: fieldHeight,\n zIndex: \"fallback(kurillin, 9)\",\n ...styles.element,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__element\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nInputElement.displayName = \"InputElement\"\nInputElement.__ui__ = \"InputElement\"\n\nexport const InputLeftElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nInputLeftElement.displayName = \"InputLeftElement\"\nInputLeftElement.__ui__ = \"InputLeftElement\"\n\nexport const InputRightElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n\nInputRightElement.displayName = \"InputRightElement\"\nInputRightElement.__ui__ = \"InputRightElement\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAAA,eAMO;AACP,IAAAC,gBAAsD;AACtD,mBAA6B;;;ACb7B,kBAA+B;AAC/B,IAAAC,gBAAmB;;;ACDnB,mBAA8B;AAQvB,IAAM,CAAC,oBAAoB,aAAa,QAC7C,4BAAiC;AAAA,EAC/B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AD6BG;AA1BN,IAAM,iBAAa;AAAA,EACjB,CAAC,EAAE,WAAW,YAAY,QAAQ,GAAG,KAAK,GAAG,QAAQ;AACnD,UAAM,EAAE,OAAO,IAAI,cAAc;AAEjC,UAAM,kBAAkB;AAAA,MACtB,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,cAAc;AAAA,MAChB;AAAA,MACA,OAAO;AAAA,QACL,IAAI;AAAA,QACJ,aAAa;AAAA,MACf;AAAA,IACF;AAEA,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,MAAM;AAA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A,MACC;AAAA,MACA,eAAW,kBAAG,kBAAkB,SAAS;AAAA,MACzC,MAAK;AAAA,MACL,OAAO;AAAA,MACN,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AAED,WAAW,cAAc;AACzB,WAAW,SAAS;","names":["import_core","import_utils","import_utils","import_core","import_utils","import_jsx_runtime","import_jsx_runtime","_a","_b"]}
|
package/dist/input-group.mjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
InputGroup
|
4
|
-
} from "./chunk-
|
5
|
-
import "./chunk-
|
6
|
-
import "./chunk-
|
4
|
+
} from "./chunk-ODVOBSDG.mjs";
|
5
|
+
import "./chunk-HSHTS6CU.mjs";
|
6
|
+
import "./chunk-MFPW4EYD.mjs";
|
7
7
|
import "./chunk-N7GDIMME.mjs";
|
8
8
|
export {
|
9
9
|
InputGroup
|
package/dist/input.js
CHANGED
package/dist/input.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/input.tsx"],"sourcesContent":["import type {\n ColorModeToken,\n CSS,\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { useFormControlProps } from \"@yamada-ui/form-control\"\nimport { cx } from \"@yamada-ui/utils\"\n\ninterface InputOptions {\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The native HTML `size` attribute to be passed to the `input`.\n */\n htmlSize?: number\n}\n\nexport interface InputProps\n extends Omit<\n HTMLUIProps<\"input\">,\n \"disabled\" | \"readOnly\" | \"required\" | \"size\"\n >,\n ThemeProps<\"Input\">,\n InputOptions,\n FormControlOptions {}\n\n/**\n * `Input` is a component used to obtain text input from the user.\n *\n * @see Docs https://yamada-ui.com/components/forms/input\n */\nexport const Input = forwardRef<InputProps, \"input\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Input\", props)\n let { className, htmlSize, __css, ...rest } = omitThemeProps(mergedProps)\n\n rest = useFormControlProps(rest)\n\n const css: CSSUIObject = { ...styles.field, ...__css }\n\n return (\n <ui.input\n ref={ref}\n className={cx(\"ui-input\", className)}\n size={htmlSize}\n __css={css}\n {...rest}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,kBAKO;AACP,0BAAoC;AACpC,mBAAmB;AAwCf;AATG,IAAM,YAAQ,wBAAgC,CAAC,OAAO,QAAQ;AACnE,QAAM,CAAC,QAAQ,WAAW,QAAI,oCAAuB,SAAS,KAAK;AACnE,MAAI,EAAE,WAAW,UAAU,OAAO,GAAG,KAAK,QAAI,4BAAe,WAAW;AAExE,aAAO,yCAAoB,IAAI;AAE/B,QAAM,MAAmB,EAAE,GAAG,OAAO,OAAO,GAAG,MAAM;AAErD,SACE;AAAA,IAAC,eAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,eAAW,iBAAG,YAAY,SAAS;AAAA,MACnC,MAAM;AAAA,MACN,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;","names":[]}
|
1
|
+
{"version":3,"sources":["../src/input.tsx"],"sourcesContent":["import type {\n ColorModeToken,\n CSS,\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { useFormControlProps } from \"@yamada-ui/form-control\"\nimport { cx } from \"@yamada-ui/utils\"\n\ninterface InputOptions {\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The native HTML `size` attribute to be passed to the `input`.\n */\n htmlSize?: number\n}\n\nexport interface InputProps\n extends Omit<\n HTMLUIProps<\"input\">,\n \"disabled\" | \"readOnly\" | \"required\" | \"size\"\n >,\n ThemeProps<\"Input\">,\n InputOptions,\n FormControlOptions {}\n\n/**\n * `Input` is a component used to obtain text input from the user.\n *\n * @see Docs https://yamada-ui.com/components/forms/input\n */\nexport const Input = forwardRef<InputProps, \"input\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"Input\", props)\n let { className, htmlSize, __css, ...rest } = omitThemeProps(mergedProps)\n\n rest = useFormControlProps(rest)\n\n const css: CSSUIObject = { ...styles.field, ...__css }\n\n return (\n <ui.input\n ref={ref}\n className={cx(\"ui-input\", className)}\n size={htmlSize}\n __css={css}\n {...rest}\n />\n )\n})\n\nInput.displayName = \"Input\"\nInput.__ui__ = \"Input\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,kBAKO;AACP,0BAAoC;AACpC,mBAAmB;AAwCf;AATG,IAAM,YAAQ,wBAAgC,CAAC,OAAO,QAAQ;AACnE,QAAM,CAAC,QAAQ,WAAW,QAAI,oCAAuB,SAAS,KAAK;AACnE,MAAI,EAAE,WAAW,UAAU,OAAO,GAAG,KAAK,QAAI,4BAAe,WAAW;AAExE,aAAO,yCAAoB,IAAI;AAE/B,QAAM,MAAmB,EAAE,GAAG,OAAO,OAAO,GAAG,MAAM;AAErD,SACE;AAAA,IAAC,eAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,eAAW,iBAAG,YAAY,SAAS;AAAA,MACnC,MAAM;AAAA,MACN,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AAED,MAAM,cAAc;AACpB,MAAM,SAAS;","names":[]}
|
package/dist/input.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@yamada-ui/input",
|
3
|
-
"version": "1.0.45-dev-
|
3
|
+
"version": "1.0.45-dev-20241015003618",
|
4
4
|
"description": "Yamada UI input component",
|
5
5
|
"keywords": [
|
6
6
|
"yamada",
|
@@ -36,10 +36,10 @@
|
|
36
36
|
"url": "https://github.com/yamada-ui/yamada-ui/issues"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@yamada-ui/core": "1.15.3-dev-
|
40
|
-
"@yamada-ui/file-input": "1.0.45-dev-
|
41
|
-
"@yamada-ui/form-control": "2.1.5-dev-
|
42
|
-
"@yamada-ui/use-token": "1.1.28-dev-
|
39
|
+
"@yamada-ui/core": "1.15.3-dev-20241015003618",
|
40
|
+
"@yamada-ui/file-input": "1.0.45-dev-20241015003618",
|
41
|
+
"@yamada-ui/form-control": "2.1.5-dev-20241015003618",
|
42
|
+
"@yamada-ui/use-token": "1.1.28-dev-20241015003618",
|
43
43
|
"@yamada-ui/utils": "1.5.3"
|
44
44
|
},
|
45
45
|
"devDependencies": {
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../src/input-addon.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputAddonOptions {\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputAddonProps extends HTMLUIProps, InputAddonOptions {}\n\nconst InputAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, placement = \"left\", ...rest }, ref) => {\n const { styles } = useInputGroup()\n\n const placementStyles = {\n left: {\n me: \"-1px\",\n roundedRight: \"0px !important\",\n },\n right: {\n ms: \"-1px\",\n roundedLeft: \"0px !important\",\n },\n }\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n flex: \"0 0 auto\",\n w: \"auto\",\n whiteSpace: \"nowrap\",\n ...styles.addon,\n ...placementStyles[placement],\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__addon\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport const InputLeftAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nexport const InputRightAddon = forwardRef<InputAddonProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputAddon\n ref={ref}\n className={cx(\"ui-input__addon--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;;;;AACA,SAAS,YAAY,UAAU;AAC/B,SAAS,UAAU;AAwCb;AA1BN,IAAM,aAAa;AAAA,EACjB,CAAC,EAAE,WAAW,YAAY,QAAQ,GAAG,KAAK,GAAG,QAAQ;AACnD,UAAM,EAAE,OAAO,IAAI,cAAc;AAEjC,UAAM,kBAAkB;AAAA,MACtB,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,cAAc;AAAA,MAChB;AAAA,MACA,OAAO;AAAA,QACL,IAAI;AAAA,QACJ,aAAa;AAAA,MACf;AAAA,IACF;AAEA,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,MAAM;AAAA,MACN,GAAG;AAAA,MACH,YAAY;AAAA,MACZ,GAAG,OAAO;AAAA,MACV,GAAG,gBAAgB,SAAS;AAAA,IAC9B;AAEA,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,WAAW,GAAG,mBAAmB,SAAS;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEO,IAAM,iBAAiB;AAAA,EAC5B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,yBAAyB,SAAS;AAAA,QAChD,WAAU;AAAA,QACT,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEO,IAAM,kBAAkB;AAAA,EAC7B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,0BAA0B,SAAS;AAAA,QACjD,WAAU;AAAA,QACT,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../src/input-element.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-context\"\n\ninterface InputElementOptions {\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `isClickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n */\n isClickable?: boolean\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport interface InputElementProps extends HTMLUIProps, InputElementOptions {}\n\nconst InputElement = forwardRef<InputElementProps, \"div\">(\n (\n { className, isClick = false, isClickable, placement = \"left\", ...rest },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n isClickable ??= isClick\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: isClickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: isClickable ? \"auto\" : \"none\",\n position: \"absolute\",\n top: \"0\",\n w: fieldHeight,\n zIndex: \"fallback(kurillin, 9)\",\n ...styles.element,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-input__element\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport const InputLeftElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--left\", className)}\n placement=\"left\"\n {...rest}\n />\n )\n },\n)\n\nexport const InputRightElement = forwardRef<InputElementProps, \"div\">(\n ({ className, ...rest }, ref) => {\n return (\n <InputElement\n ref={ref}\n className={cx(\"ui-input__element--right\", className)}\n placement=\"right\"\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;;;;AACA,SAAS,YAAY,UAAU;AAC/B,SAAS,UAAU;AAsDb;AA1BN,IAAM,eAAe;AAAA,EACnB,CACE,EAAE,WAAW,UAAU,OAAO,aAAa,YAAY,QAAQ,GAAG,KAAK,GACvE,QACG;AACH,UAAM,EAAE,eAAe,aAAa,OAAO,IAAI,cAAc;AAE7D,sDAAgB;AAEhB,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,QAAQ,cAAc,YAAY;AAAA,MAClC,SAAS;AAAA,MACT,UAAU;AAAA,MACV,GAAG;AAAA,MACH,gBAAgB;AAAA,MAChB,CAAC,cAAc,SAAS,eAAe,UAAU,GAAG;AAAA,MACpD,eAAe,cAAc,SAAS;AAAA,MACtC,UAAU;AAAA,MACV,KAAK;AAAA,MACL,GAAG;AAAA,MACH,QAAQ;AAAA,MACR,GAAG,OAAO;AAAA,IACZ;AAEA,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,WAAW,GAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEO,IAAM,mBAAmB;AAAA,EAC9B,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,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