@yamada-ui/input 1.0.51-dev-20241213213653 → 1.0.51-dev-20241215203956
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-LAVL5JMX.mjs → chunk-2SDIXUVN.mjs} +3 -3
- package/dist/{chunk-LAVL5JMX.mjs.map → chunk-2SDIXUVN.mjs.map} +1 -1
- package/dist/{chunk-IK4KCBCL.mjs → chunk-3TI2NWMJ.mjs} +3 -5
- package/dist/chunk-3TI2NWMJ.mjs.map +1 -0
- package/dist/{chunk-PWDS3F3C.mjs → chunk-ILDQLKLF.mjs} +2 -2
- package/dist/index.js +4 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/input-element.js +2 -4
- package/dist/input-element.js.map +1 -1
- package/dist/input-element.mjs +1 -1
- package/dist/input-group.js +2 -4
- package/dist/input-group.js.map +1 -1
- package/dist/input-group.mjs +2 -2
- package/dist/input.js +2 -2
- package/dist/input.js.map +1 -1
- package/dist/input.mjs +1 -1
- package/package.json +6 -6
- package/dist/chunk-IK4KCBCL.mjs.map +0 -1
- /package/dist/{chunk-PWDS3F3C.mjs.map → chunk-ILDQLKLF.mjs.map} +0 -0
@@ -12,8 +12,8 @@ import { cx } from "@yamada-ui/utils";
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
13
13
|
var Input = forwardRef((props, ref) => {
|
14
14
|
const [styles, mergedProps] = useComponentMultiStyle("Input", props);
|
15
|
-
|
16
|
-
rest = useFormControlProps(
|
15
|
+
const computedProps = omitThemeProps(mergedProps);
|
16
|
+
const { className, htmlSize, __css, ...rest } = useFormControlProps(computedProps);
|
17
17
|
const css = { ...styles.field, ...__css };
|
18
18
|
return /* @__PURE__ */ jsx(
|
19
19
|
ui.input,
|
@@ -32,4 +32,4 @@ Input.__ui__ = "Input";
|
|
32
32
|
export {
|
33
33
|
Input
|
34
34
|
};
|
35
|
-
//# sourceMappingURL=chunk-
|
35
|
+
//# sourceMappingURL=chunk-2SDIXUVN.mjs.map
|
@@ -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
|
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 const computedProps = omitThemeProps(mergedProps)\n const { className, htmlSize, __css, ...rest } =\n useFormControlProps(computedProps)\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,QAAM,gBAAgB,eAAe,WAAW;AAChD,QAAM,EAAE,WAAW,UAAU,OAAO,GAAG,KAAK,IAC1C,oBAAoB,aAAa;AAEnC,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":[]}
|
@@ -10,15 +10,13 @@ import { jsx } from "react/jsx-runtime";
|
|
10
10
|
var InputElement = forwardRef(
|
11
11
|
({
|
12
12
|
className,
|
13
|
-
clickable,
|
14
13
|
isClick = false,
|
15
|
-
isClickable,
|
14
|
+
isClickable = isClick,
|
15
|
+
clickable = isClickable,
|
16
16
|
placement = "left",
|
17
17
|
...rest
|
18
18
|
}, ref) => {
|
19
19
|
const { fieldFontSize, fieldHeight, styles } = useInputGroup();
|
20
|
-
isClickable != null ? isClickable : isClickable = isClick;
|
21
|
-
clickable != null ? clickable : clickable = isClickable;
|
22
20
|
const css = {
|
23
21
|
alignItems: "center",
|
24
22
|
cursor: clickable ? "pointer" : "auto",
|
@@ -82,4 +80,4 @@ export {
|
|
82
80
|
InputLeftElement,
|
83
81
|
InputRightElement
|
84
82
|
};
|
85
|
-
//# sourceMappingURL=chunk-
|
83
|
+
//# sourceMappingURL=chunk-3TI2NWMJ.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 clickable?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\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 {\n className,\n isClick = false,\n isClickable = isClick,\n clickable = isClickable,\n placement = \"left\",\n ...rest\n },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: clickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: clickable ? \"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;AAmEb;AA/BN,IAAM,eAAe;AAAA,EACnB,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,EAAE,eAAe,aAAa,OAAO,IAAI,cAAc;AAE7D,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,QAAQ,YAAY,YAAY;AAAA,MAChC,SAAS;AAAA,MACT,UAAU;AAAA,MACV,GAAG;AAAA,MACH,gBAAgB;AAAA,MAChB,CAAC,cAAc,SAAS,eAAe,UAAU,GAAG;AAAA,MACpD,eAAe,YAAY,SAAS;AAAA,MACpC,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":[]}
|
@@ -6,7 +6,7 @@ import {
|
|
6
6
|
import {
|
7
7
|
InputLeftElement,
|
8
8
|
InputRightElement
|
9
|
-
} from "./chunk-
|
9
|
+
} from "./chunk-3TI2NWMJ.mjs";
|
10
10
|
import {
|
11
11
|
InputGroupProvider
|
12
12
|
} from "./chunk-N7GDIMME.mjs";
|
@@ -92,4 +92,4 @@ InputGroup.__ui__ = "InputGroup";
|
|
92
92
|
export {
|
93
93
|
InputGroup
|
94
94
|
};
|
95
|
-
//# sourceMappingURL=chunk-
|
95
|
+
//# sourceMappingURL=chunk-ILDQLKLF.mjs.map
|
package/dist/index.js
CHANGED
@@ -37,8 +37,8 @@ var import_utils = require("@yamada-ui/utils");
|
|
37
37
|
var import_jsx_runtime = require("react/jsx-runtime");
|
38
38
|
var Input = (0, import_core.forwardRef)((props, ref) => {
|
39
39
|
const [styles, mergedProps] = (0, import_core.useComponentMultiStyle)("Input", props);
|
40
|
-
|
41
|
-
rest = (0, import_form_control.useFormControlProps)(
|
40
|
+
const computedProps = (0, import_core.omitThemeProps)(mergedProps);
|
41
|
+
const { className, htmlSize, __css, ...rest } = (0, import_form_control.useFormControlProps)(computedProps);
|
42
42
|
const css = { ...styles.field, ...__css };
|
43
43
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
44
44
|
import_core.ui.input,
|
@@ -140,15 +140,13 @@ var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
140
140
|
var InputElement = (0, import_core3.forwardRef)(
|
141
141
|
({
|
142
142
|
className,
|
143
|
-
clickable,
|
144
143
|
isClick = false,
|
145
|
-
isClickable,
|
144
|
+
isClickable = isClick,
|
145
|
+
clickable = isClickable,
|
146
146
|
placement = "left",
|
147
147
|
...rest
|
148
148
|
}, ref) => {
|
149
149
|
const { fieldFontSize, fieldHeight, styles } = useInputGroup();
|
150
|
-
isClickable != null ? isClickable : isClickable = isClick;
|
151
|
-
clickable != null ? clickable : clickable = isClickable;
|
152
150
|
const css = {
|
153
151
|
alignItems: "center",
|
154
152
|
cursor: clickable ? "pointer" : "auto",
|
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\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 clickable?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\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 {\n className,\n clickable,\n isClick = false,\n isClickable,\n placement = \"left\",\n ...rest\n },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n isClickable ??= isClick\n clickable ??= isClickable\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: clickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: clickable ? \"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>\n )\n})\n\nInputGroup.displayName = \"InputGroup\"\nInputGroup.__ui__ = \"InputGroup\"\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,MACN,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AAED,MAAM,cAAc;AACpB,MAAM,SAAS;;;ACjEf,IAAAA,eAA+B;AAC/B,IAAAC,gBAAmB;;;ACDnB,IAAAC,gBAA8B;AAQvB,IAAM,CAAC,oBAAoB,aAAa,QAC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,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;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"]}
|
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 const computedProps = omitThemeProps(mergedProps)\n const { className, htmlSize, __css, ...rest } =\n useFormControlProps(computedProps)\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 clickable?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\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 {\n className,\n isClick = false,\n isClickable = isClick,\n clickable = isClickable,\n placement = \"left\",\n ...rest\n },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: clickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: clickable ? \"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>\n )\n})\n\nInputGroup.displayName = \"InputGroup\"\nInputGroup.__ui__ = \"InputGroup\"\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,QAAM,oBAAgB,4BAAe,WAAW;AAChD,QAAM,EAAE,WAAW,UAAU,OAAO,GAAG,KAAK,QAC1C,yCAAoB,aAAa;AAEnC,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;;;ACjEf,IAAAA,eAA+B;AAC/B,IAAAC,gBAAmB;;;ACDnB,IAAAC,gBAA8B;AAQvB,IAAM,CAAC,oBAAoB,aAAa,QAC7C,6BAAiC;AAAA,EAC/B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;AD6BG,IAAAC,sBAAA;AA1BN,IAAM,iBAAa;AAAA,EACjB,CAAC,EAAE,WAAW,YAAY,QAAQ,GAAG,KAAK,GAAG,QAAQ;AACn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AAA,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;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,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
InputGroup
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-ILDQLKLF.mjs";
|
5
5
|
import {
|
6
6
|
InputLeftAddon,
|
7
7
|
InputRightAddon
|
@@ -9,11 +9,11 @@ import {
|
|
9
9
|
import {
|
10
10
|
InputLeftElement,
|
11
11
|
InputRightElement
|
12
|
-
} from "./chunk-
|
12
|
+
} from "./chunk-3TI2NWMJ.mjs";
|
13
13
|
import "./chunk-N7GDIMME.mjs";
|
14
14
|
import {
|
15
15
|
Input
|
16
|
-
} from "./chunk-
|
16
|
+
} from "./chunk-2SDIXUVN.mjs";
|
17
17
|
export {
|
18
18
|
Input,
|
19
19
|
InputGroup,
|
package/dist/input-element.js
CHANGED
@@ -40,15 +40,13 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
40
|
var InputElement = (0, import_core.forwardRef)(
|
41
41
|
({
|
42
42
|
className,
|
43
|
-
clickable,
|
44
43
|
isClick = false,
|
45
|
-
isClickable,
|
44
|
+
isClickable = isClick,
|
45
|
+
clickable = isClickable,
|
46
46
|
placement = "left",
|
47
47
|
...rest
|
48
48
|
}, ref) => {
|
49
49
|
const { fieldFontSize, fieldHeight, styles } = useInputGroup();
|
50
|
-
isClickable != null ? isClickable : isClickable = isClick;
|
51
|
-
clickable != null ? clickable : clickable = isClickable;
|
52
50
|
const css = {
|
53
51
|
alignItems: "center",
|
54
52
|
cursor: clickable ? "pointer" : "auto",
|
@@ -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 clickable?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\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 {\n className,\n
|
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 clickable?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\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 {\n className,\n isClick = false,\n isClickable = isClick,\n clickable = isClickable,\n placement = \"left\",\n ...rest\n },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: clickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: clickable ? \"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;;;ADwDG;AA/BN,IAAM,mBAAe;AAAA,EACnB,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,EAAE,eAAe,aAAa,OAAO,IAAI,cAAc;AAE7D,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,QAAQ,YAAY,YAAY;AAAA,MAChC,SAAS;AAAA,MACT,UAAU;AAAA,MACV,GAAG;AAAA,MACH,gBAAgB;AAAA,MAChB,CAAC,cAAc,SAAS,eAAe,UAAU,GAAG;AAAA,MACpD,eAAe,YAAY,SAAS;AAAA,MACpC,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
@@ -114,15 +114,13 @@ var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
114
114
|
var InputElement = (0, import_core2.forwardRef)(
|
115
115
|
({
|
116
116
|
className,
|
117
|
-
clickable,
|
118
117
|
isClick = false,
|
119
|
-
isClickable,
|
118
|
+
isClickable = isClick,
|
119
|
+
clickable = isClickable,
|
120
120
|
placement = "left",
|
121
121
|
...rest
|
122
122
|
}, ref) => {
|
123
123
|
const { fieldFontSize, fieldHeight, styles } = useInputGroup();
|
124
|
-
isClickable != null ? isClickable : isClickable = isClick;
|
125
|
-
clickable != null ? clickable : clickable = isClickable;
|
126
124
|
const css = {
|
127
125
|
alignItems: "center",
|
128
126
|
cursor: clickable ? "pointer" : "auto",
|
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\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 clickable?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\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 {\n className,\n clickable,\n isClick = false,\n isClickable,\n placement = \"left\",\n ...rest\n },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n isClickable ??= isClick\n clickable ??= isClickable\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: clickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: clickable ? \"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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,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;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"]}
|
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 clickable?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\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 {\n className,\n isClick = false,\n isClickable = isClick,\n clickable = isClickable,\n placement = \"left\",\n ...rest\n },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: clickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: clickable ? \"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,IAAA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,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;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
package/dist/input.js
CHANGED
@@ -30,8 +30,8 @@ var import_utils = require("@yamada-ui/utils");
|
|
30
30
|
var import_jsx_runtime = require("react/jsx-runtime");
|
31
31
|
var Input = (0, import_core.forwardRef)((props, ref) => {
|
32
32
|
const [styles, mergedProps] = (0, import_core.useComponentMultiStyle)("Input", props);
|
33
|
-
|
34
|
-
rest = (0, import_form_control.useFormControlProps)(
|
33
|
+
const computedProps = (0, import_core.omitThemeProps)(mergedProps);
|
34
|
+
const { className, htmlSize, __css, ...rest } = (0, import_form_control.useFormControlProps)(computedProps);
|
35
35
|
const css = { ...styles.field, ...__css };
|
36
36
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
37
37
|
import_core.ui.input,
|
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
|
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 const computedProps = omitThemeProps(mergedProps)\n const { className, htmlSize, __css, ...rest } =\n useFormControlProps(computedProps)\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,QAAM,oBAAgB,4BAAe,WAAW;AAChD,QAAM,EAAE,WAAW,UAAU,OAAO,GAAG,KAAK,QAC1C,yCAAoB,aAAa;AAEnC,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.51-dev-
|
3
|
+
"version": "1.0.51-dev-20241215203956",
|
4
4
|
"description": "Yamada UI input component",
|
5
5
|
"keywords": [
|
6
6
|
"yamada",
|
@@ -36,11 +36,11 @@
|
|
36
36
|
"url": "https://github.com/yamada-ui/yamada-ui/issues"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@yamada-ui/core": "1.16.2-dev-
|
40
|
-
"@yamada-ui/file-input": "1.0.51-dev-
|
41
|
-
"@yamada-ui/form-control": "2.1.11-dev-
|
42
|
-
"@yamada-ui/use-token": "1.1.34-dev-
|
43
|
-
"@yamada-ui/utils": "1.6.2-dev-
|
39
|
+
"@yamada-ui/core": "1.16.2-dev-20241215203956",
|
40
|
+
"@yamada-ui/file-input": "1.0.51-dev-20241215203956",
|
41
|
+
"@yamada-ui/form-control": "2.1.11-dev-20241215203956",
|
42
|
+
"@yamada-ui/use-token": "1.1.34-dev-20241215203956",
|
43
|
+
"@yamada-ui/utils": "1.6.2-dev-20241215203956"
|
44
44
|
},
|
45
45
|
"devDependencies": {
|
46
46
|
"clean-package": "2.2.0",
|
@@ -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 clickable?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\n */\n isClick?: boolean\n /**\n * If `true`, the element clickable.\n *\n * @default false\n *\n * @deprecated Use `clickable` instead.\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 {\n className,\n clickable,\n isClick = false,\n isClickable,\n placement = \"left\",\n ...rest\n },\n ref,\n ) => {\n const { fieldFontSize, fieldHeight, styles } = useInputGroup()\n\n isClickable ??= isClick\n clickable ??= isClickable\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n cursor: clickable ? \"pointer\" : \"auto\",\n display: \"flex\",\n fontSize: fieldFontSize,\n h: \"100%\",\n justifyContent: \"center\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n pointerEvents: clickable ? \"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;AAsEb;AAlCN,IAAM,eAAe;AAAA,EACnB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,YAAY;AAAA,I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