@yamada-ui/input 1.0.41 → 1.0.42-dev-20240917033401

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.
Files changed (43) hide show
  1. package/dist/chunk-3AEWRGHP.mjs +76 -0
  2. package/dist/chunk-3AEWRGHP.mjs.map +1 -0
  3. package/dist/chunk-ITQBVWTU.mjs +71 -0
  4. package/dist/chunk-ITQBVWTU.mjs.map +1 -0
  5. package/dist/chunk-OYJRHTQL.mjs +76 -0
  6. package/dist/chunk-OYJRHTQL.mjs.map +1 -0
  7. package/dist/{chunk-PFAPK5JD.mjs → chunk-ZARK2Q4J.mjs} +3 -3
  8. package/dist/chunk-ZARK2Q4J.mjs.map +1 -0
  9. package/dist/chunk-ZNGNHH5S.mjs +14 -0
  10. package/dist/chunk-ZNGNHH5S.mjs.map +1 -0
  11. package/dist/index.js +73 -66
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +9 -4
  14. package/dist/input-addon.d.mts +4 -3
  15. package/dist/input-addon.d.ts +4 -3
  16. package/dist/input-addon.js +14 -147
  17. package/dist/input-addon.js.map +1 -1
  18. package/dist/input-addon.mjs +2 -2
  19. package/dist/input-context.d.mts +10 -0
  20. package/dist/input-context.d.ts +10 -0
  21. package/dist/input-context.js +38 -0
  22. package/dist/input-context.js.map +1 -0
  23. package/dist/input-context.mjs +10 -0
  24. package/dist/input-context.mjs.map +1 -0
  25. package/dist/input-element.d.mts +4 -3
  26. package/dist/input-element.d.ts +4 -3
  27. package/dist/input-element.js +14 -152
  28. package/dist/input-element.js.map +1 -1
  29. package/dist/input-element.mjs +2 -2
  30. package/dist/input-group.d.mts +4 -6
  31. package/dist/input-group.d.ts +4 -6
  32. package/dist/input-group.js +24 -21
  33. package/dist/input-group.js.map +1 -1
  34. package/dist/input-group.mjs +7 -6
  35. package/dist/input.d.mts +4 -3
  36. package/dist/input.d.ts +4 -3
  37. package/dist/input.js +1 -1
  38. package/dist/input.js.map +1 -1
  39. package/dist/input.mjs +1 -1
  40. package/package.json +6 -6
  41. package/dist/chunk-OCJVHG24.mjs +0 -208
  42. package/dist/chunk-OCJVHG24.mjs.map +0 -1
  43. package/dist/chunk-PFAPK5JD.mjs.map +0 -1
@@ -0,0 +1,76 @@
1
+ "use client"
2
+ import {
3
+ InputLeftAddon,
4
+ InputRightAddon
5
+ } from "./chunk-OYJRHTQL.mjs";
6
+ import {
7
+ InputLeftElement,
8
+ InputRightElement
9
+ } from "./chunk-ITQBVWTU.mjs";
10
+ import {
11
+ InputGroupProvider
12
+ } from "./chunk-ZNGNHH5S.mjs";
13
+ import {
14
+ Input
15
+ } from "./chunk-ZARK2Q4J.mjs";
16
+
17
+ // src/input-group.tsx
18
+ import {
19
+ ui,
20
+ forwardRef,
21
+ useComponentMultiStyle,
22
+ omitThemeProps
23
+ } from "@yamada-ui/core";
24
+ import { FileInput } from "@yamada-ui/file-input";
25
+ import { useToken } from "@yamada-ui/use-token";
26
+ import { cx, filterUndefined, getValidChildren } from "@yamada-ui/utils";
27
+ import { cloneElement } from "react";
28
+ import { jsx } from "react/jsx-runtime";
29
+ var InputGroup = forwardRef((props, ref) => {
30
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
31
+ const [styles] = useComponentMultiStyle("Input", props);
32
+ const { className, children, ...rest } = omitThemeProps(props);
33
+ const css = {
34
+ width: "100%",
35
+ display: "flex",
36
+ position: "relative",
37
+ ...styles.container
38
+ };
39
+ const groupProps = {};
40
+ const minHeight = (_g = (_e = useToken("sizes", (_c = (_a = styles.field) == null ? void 0 : _a.minHeight) != null ? _c : (_b = styles.field) == null ? void 0 : _b.minH)) != null ? _e : (_d = styles.field) == null ? void 0 : _d.minHeight) != null ? _g : (_f = styles.field) == null ? void 0 : _f.minH;
41
+ const height = (_n = (_l = useToken("sizes", (_j = (_h = styles.field) == null ? void 0 : _h.height) != null ? _j : (_i = styles.field) == null ? void 0 : _i.h)) != null ? _l : (_k = styles.field) == null ? void 0 : _k.height) != null ? _n : (_m = styles.field) == null ? void 0 : _m.h;
42
+ const validChildren = getValidChildren(children);
43
+ validChildren.forEach((child) => {
44
+ if ((minHeight || height) && child.type === InputLeftElement)
45
+ groupProps.paddingStart = height != null ? height : minHeight;
46
+ if ((minHeight || height) && child.type === InputRightElement)
47
+ groupProps.paddingEnd = height != null ? height : minHeight;
48
+ if (child.type === InputLeftAddon) groupProps.roundedLeft = 0;
49
+ if (child.type === InputRightAddon) groupProps.roundedRight = 0;
50
+ });
51
+ const cloneChildren = validChildren.map((child) => {
52
+ var _a2, _b2;
53
+ const childProps = filterUndefined({
54
+ size: ((_a2 = child.props) == null ? void 0 : _a2.size) || props.size,
55
+ variant: ((_b2 = child.props) == null ? void 0 : _b2.variant) || props.variant,
56
+ ...child.props
57
+ });
58
+ return child.type !== Input && child.type !== FileInput ? cloneElement(child, childProps) : cloneElement(child, Object.assign(childProps, groupProps));
59
+ });
60
+ return /* @__PURE__ */ jsx(InputGroupProvider, { value: styles, children: /* @__PURE__ */ jsx(
61
+ ui.div,
62
+ {
63
+ ref,
64
+ className: cx("ui-input-group", className),
65
+ role: "group",
66
+ __css: css,
67
+ ...rest,
68
+ children: cloneChildren
69
+ }
70
+ ) });
71
+ });
72
+
73
+ export {
74
+ InputGroup
75
+ };
76
+ //# sourceMappingURL=chunk-3AEWRGHP.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/input-group.tsx"],"sourcesContent":["import type {\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n CSSUIProps,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentMultiStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { FileInput } from \"@yamada-ui/file-input\"\nimport { useToken } from \"@yamada-ui/use-token\"\nimport { cx, filterUndefined, getValidChildren } from \"@yamada-ui/utils\"\nimport { cloneElement } from \"react\"\nimport { Input } from \"./input\"\nimport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nimport { InputGroupProvider } from \"./input-context\"\nimport { InputRightElement, InputLeftElement } 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 css: CSSUIObject = {\n width: \"100%\",\n display: \"flex\",\n position: \"relative\",\n ...styles.container,\n }\n const groupProps: CSSUIProps = {}\n const minHeight: any =\n useToken(\"sizes\", (styles.field?.minHeight ?? styles.field?.minH) as any) ??\n styles.field?.minHeight ??\n styles.field?.minH\n const height: any =\n useToken(\"sizes\", (styles.field?.height ?? styles.field?.h) as any) ??\n styles.field?.height ??\n styles.field?.h\n\n const validChildren = getValidChildren(children)\n\n validChildren.forEach((child: any) => {\n if ((minHeight || height) && child.type === InputLeftElement)\n groupProps.paddingStart = height ?? minHeight\n\n if ((minHeight || height) && child.type === InputRightElement)\n groupProps.paddingEnd = height ?? minHeight\n\n if (child.type === InputLeftAddon) groupProps.roundedLeft = 0\n\n if (child.type === InputRightAddon) groupProps.roundedRight = 0\n })\n\n const cloneChildren = validChildren.map((child) => {\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 child.type !== Input && child.type !== FileInput\n ? cloneElement(child, childProps)\n : cloneElement(child, Object.assign(childProps, groupProps))\n })\n\n return (\n <InputGroupProvider value={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,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,IAAI,iBAAiB,wBAAwB;AACtD,SAAS,oBAAoB;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,OAAO,UAAU,IAC9B,aAAa,OAAO,OAAO,OAAO,YAAY,UAAU,CAAC;AAAA,EAC/D,CAAC;AAED,SACE,oBAAC,sBAAmB,OAAO,QACzB;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;","names":["_a","_b"]}
@@ -0,0 +1,71 @@
1
+ "use client"
2
+ import {
3
+ useInputGroup
4
+ } from "./chunk-ZNGNHH5S.mjs";
5
+
6
+ // src/input-element.tsx
7
+ import { ui, forwardRef } from "@yamada-ui/core";
8
+ import { cx } from "@yamada-ui/utils";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var InputElement = forwardRef(
11
+ ({ className, isClick = false, placement = "left", ...rest }, ref) => {
12
+ var _a, _b, _c, _d, _e, _f, _g, _h;
13
+ const styles = useInputGroup();
14
+ const css = {
15
+ position: "absolute",
16
+ top: "0",
17
+ [placement === "left" ? "insetStart" : "insetEnd"]: "0",
18
+ zIndex: "fallback(kurillin, 9)",
19
+ display: "flex",
20
+ alignItems: "center",
21
+ justifyContent: "center",
22
+ w: (_g = (_e = (_c = (_a = styles.field) == null ? void 0 : _a.height) != null ? _c : (_b = styles.field) == null ? void 0 : _b.h) != null ? _e : (_d = styles.field) == null ? void 0 : _d.minHeight) != null ? _g : (_f = styles.field) == null ? void 0 : _f.minH,
23
+ h: "100%",
24
+ fontSize: (_h = styles.field) == null ? void 0 : _h.fontSize,
25
+ pointerEvents: isClick ? "auto" : "none",
26
+ cursor: isClick ? "pointer" : "auto",
27
+ ...styles.element
28
+ };
29
+ return /* @__PURE__ */ jsx(
30
+ ui.div,
31
+ {
32
+ ref,
33
+ className: cx("ui-input__element", className),
34
+ __css: css,
35
+ ...rest
36
+ }
37
+ );
38
+ }
39
+ );
40
+ var InputLeftElement = forwardRef(
41
+ ({ className, ...rest }, ref) => {
42
+ return /* @__PURE__ */ jsx(
43
+ InputElement,
44
+ {
45
+ ref,
46
+ className: cx("ui-input__element--left", className),
47
+ placement: "left",
48
+ ...rest
49
+ }
50
+ );
51
+ }
52
+ );
53
+ var InputRightElement = forwardRef(
54
+ ({ className, ...rest }, ref) => {
55
+ return /* @__PURE__ */ jsx(
56
+ InputElement,
57
+ {
58
+ ref,
59
+ className: cx("ui-input__element--right", className),
60
+ placement: "right",
61
+ ...rest
62
+ }
63
+ );
64
+ }
65
+ );
66
+
67
+ export {
68
+ InputLeftElement,
69
+ InputRightElement
70
+ };
71
+ //# sourceMappingURL=chunk-ITQBVWTU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/input-element.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } 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 isClick?: 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 ({ className, isClick = false, placement = \"left\", ...rest }, ref) => {\n const styles = useInputGroup()\n\n const css: CSSUIObject = {\n position: \"absolute\",\n top: \"0\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n zIndex: \"fallback(kurillin, 9)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n w:\n styles.field?.height ??\n styles.field?.h ??\n styles.field?.minHeight ??\n styles.field?.minH,\n h: \"100%\",\n fontSize: styles.field?.fontSize,\n pointerEvents: isClick ? \"auto\" : \"none\",\n cursor: isClick ? \"pointer\" : \"auto\",\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,IAAI,kBAAkB;AAC/B,SAAS,UAAU;AA6Cb;AAzBN,IAAM,eAAe;AAAA,EACnB,CAAC,EAAE,WAAW,UAAU,OAAO,YAAY,QAAQ,GAAG,KAAK,GAAG,QAAQ;AAvBxE;AAwBI,UAAM,SAAS,cAAc;AAE7B,UAAM,MAAmB;AAAA,MACvB,UAAU;AAAA,MACV,KAAK;AAAA,MACL,CAAC,cAAc,SAAS,eAAe,UAAU,GAAG;AAAA,MACpD,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,IACE,8BAAO,UAAP,mBAAc,WAAd,aACA,YAAO,UAAP,mBAAc,MADd,aAEA,YAAO,UAAP,mBAAc,cAFd,aAGA,YAAO,UAAP,mBAAc;AAAA,MAChB,GAAG;AAAA,MACH,WAAU,YAAO,UAAP,mBAAc;AAAA,MACxB,eAAe,UAAU,SAAS;AAAA,MAClC,QAAQ,UAAU,YAAY;AAAA,MAC9B,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,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;AAEO,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;","names":[]}
@@ -0,0 +1,76 @@
1
+ "use client"
2
+ import {
3
+ useInputGroup
4
+ } from "./chunk-ZNGNHH5S.mjs";
5
+
6
+ // src/input-addon.tsx
7
+ import { ui, forwardRef } from "@yamada-ui/core";
8
+ import { cx } from "@yamada-ui/utils";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var InputAddon = forwardRef(
11
+ ({ className, placement = "left", ...rest }, ref) => {
12
+ const styles = useInputGroup();
13
+ const placementStyles = {
14
+ left: {
15
+ me: "-1px",
16
+ roundedRight: 0,
17
+ borderEndColor: "transparent"
18
+ },
19
+ right: {
20
+ ms: "-1px",
21
+ roundedLeft: 0,
22
+ borderStartColor: "transparent"
23
+ }
24
+ };
25
+ const css = {
26
+ flex: "0 0 auto",
27
+ w: "auto",
28
+ display: "flex",
29
+ alignItems: "center",
30
+ whiteSpace: "nowrap",
31
+ ...styles.addon,
32
+ ...placementStyles[placement]
33
+ };
34
+ return /* @__PURE__ */ jsx(
35
+ ui.div,
36
+ {
37
+ ref,
38
+ className: cx("ui-input__addon", className),
39
+ __css: css,
40
+ ...rest
41
+ }
42
+ );
43
+ }
44
+ );
45
+ var InputLeftAddon = forwardRef(
46
+ ({ className, ...rest }, ref) => {
47
+ return /* @__PURE__ */ jsx(
48
+ InputAddon,
49
+ {
50
+ ref,
51
+ className: cx("ui-input__addon--left", className),
52
+ placement: "left",
53
+ ...rest
54
+ }
55
+ );
56
+ }
57
+ );
58
+ var InputRightAddon = forwardRef(
59
+ ({ className, ...rest }, ref) => {
60
+ return /* @__PURE__ */ jsx(
61
+ InputAddon,
62
+ {
63
+ ref,
64
+ className: cx("ui-input__addon--right", className),
65
+ placement: "right",
66
+ ...rest
67
+ }
68
+ );
69
+ }
70
+ );
71
+
72
+ export {
73
+ InputLeftAddon,
74
+ InputRightAddon
75
+ };
76
+ //# sourceMappingURL=chunk-OYJRHTQL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/input-addon.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } 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: 0,\n borderEndColor: \"transparent\",\n },\n right: {\n ms: \"-1px\",\n roundedLeft: 0,\n borderStartColor: \"transparent\",\n },\n }\n\n const css: CSSUIObject = {\n flex: \"0 0 auto\",\n w: \"auto\",\n display: \"flex\",\n alignItems: \"center\",\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,IAAI,kBAAkB;AAC/B,SAAS,UAAU;AA0Cb;AA5BN,IAAM,aAAa;AAAA,EACjB,CAAC,EAAE,WAAW,YAAY,QAAQ,GAAG,KAAK,GAAG,QAAQ;AACnD,UAAM,SAAS,cAAc;AAE7B,UAAM,kBAAkB;AAAA,MACtB,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,cAAc;AAAA,QACd,gBAAgB;AAAA,MAClB;AAAA,MACA,OAAO;AAAA,QACL,IAAI;AAAA,QACJ,aAAa;AAAA,QACb,kBAAkB;AAAA,MACpB;AAAA,IACF;AAEA,UAAM,MAAmB;AAAA,MACvB,MAAM;AAAA,MACN,GAAG;AAAA,MACH,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,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":[]}
@@ -5,13 +5,13 @@ import {
5
5
  ui,
6
6
  forwardRef,
7
7
  omitThemeProps,
8
- useMultiComponentStyle
8
+ useComponentMultiStyle
9
9
  } from "@yamada-ui/core";
10
10
  import { useFormControlProps } from "@yamada-ui/form-control";
11
11
  import { cx } from "@yamada-ui/utils";
12
12
  import { jsx } from "react/jsx-runtime";
13
13
  var Input = forwardRef((props, ref) => {
14
- const [styles, mergedProps] = useMultiComponentStyle("Input", props);
14
+ const [styles, mergedProps] = useComponentMultiStyle("Input", props);
15
15
  let { className, htmlSize, __css, ...rest } = omitThemeProps(mergedProps);
16
16
  rest = useFormControlProps(rest);
17
17
  const css = { ...styles.field, ...__css };
@@ -30,4 +30,4 @@ var Input = forwardRef((props, ref) => {
30
30
  export {
31
31
  Input
32
32
  };
33
- //# sourceMappingURL=chunk-PFAPK5JD.mjs.map
33
+ //# sourceMappingURL=chunk-ZARK2Q4J.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/input.tsx"],"sourcesContent":["import type {\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n ColorModeToken,\n CSS,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n omitThemeProps,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\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 focused.\n */\n focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: 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\" | \"required\" | \"readOnly\" | \"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":";;;AAOA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,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":[]}
@@ -0,0 +1,14 @@
1
+ "use client"
2
+
3
+ // src/input-context.tsx
4
+ import { createContext } from "@yamada-ui/utils";
5
+ var [InputGroupProvider, useInputGroup] = createContext({
6
+ name: "InputGroupContext",
7
+ errorMessage: `useInputGroup returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `
8
+ });
9
+
10
+ export {
11
+ InputGroupProvider,
12
+ useInputGroup
13
+ };
14
+ //# sourceMappingURL=chunk-ZNGNHH5S.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/input-context.tsx"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface InputGroupContext {\n [key: string]: CSSUIObject\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":";;;AACA,SAAS,qBAAqB;AAMvB,IAAM,CAAC,oBAAoB,aAAa,IAC7C,cAAiC;AAAA,EAC/B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;","names":[]}
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ var import_form_control = require("@yamada-ui/form-control");
36
36
  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
- const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("Input", props);
39
+ const [styles, mergedProps] = (0, import_core.useComponentMultiStyle)("Input", props);
40
40
  let { className, htmlSize, __css, ...rest } = (0, import_core.omitThemeProps)(mergedProps);
41
41
  rest = (0, import_form_control.useFormControlProps)(rest);
42
42
  const css = { ...styles.field, ...__css };
@@ -53,65 +53,26 @@ var Input = (0, import_core.forwardRef)((props, ref) => {
53
53
  });
54
54
 
55
55
  // src/input-group.tsx
56
- var import_core2 = require("@yamada-ui/core");
56
+ var import_core4 = require("@yamada-ui/core");
57
57
  var import_file_input = require("@yamada-ui/file-input");
58
58
  var import_use_token = require("@yamada-ui/use-token");
59
- var import_utils2 = require("@yamada-ui/utils");
59
+ var import_utils5 = require("@yamada-ui/utils");
60
60
  var import_react = require("react");
61
- var import_jsx_runtime2 = require("react/jsx-runtime");
61
+
62
+ // src/input-addon.tsx
63
+ var import_core2 = require("@yamada-ui/core");
64
+ var import_utils3 = require("@yamada-ui/utils");
65
+
66
+ // src/input-context.tsx
67
+ var import_utils2 = require("@yamada-ui/utils");
62
68
  var [InputGroupProvider, useInputGroup] = (0, import_utils2.createContext)({
63
69
  name: "InputGroupContext",
64
70
  errorMessage: `useInputGroup returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `
65
71
  });
66
- var InputGroup = (0, import_core2.forwardRef)((props, ref) => {
67
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
68
- const [styles] = (0, import_core2.useMultiComponentStyle)("Input", props);
69
- const { className, children, ...rest } = (0, import_core2.omitThemeProps)(props);
70
- const css = {
71
- width: "100%",
72
- display: "flex",
73
- position: "relative",
74
- ...styles.container
75
- };
76
- const groupProps = {};
77
- const minHeight = (_g = (_e = (0, import_use_token.useToken)("sizes", (_c = (_a = styles.field) == null ? void 0 : _a.minHeight) != null ? _c : (_b = styles.field) == null ? void 0 : _b.minH)) != null ? _e : (_d = styles.field) == null ? void 0 : _d.minHeight) != null ? _g : (_f = styles.field) == null ? void 0 : _f.minH;
78
- const height = (_n = (_l = (0, import_use_token.useToken)("sizes", (_j = (_h = styles.field) == null ? void 0 : _h.height) != null ? _j : (_i = styles.field) == null ? void 0 : _i.h)) != null ? _l : (_k = styles.field) == null ? void 0 : _k.height) != null ? _n : (_m = styles.field) == null ? void 0 : _m.h;
79
- const validChildren = (0, import_utils2.getValidChildren)(children);
80
- validChildren.forEach((child) => {
81
- if ((minHeight || height) && child.type === InputLeftElement)
82
- groupProps.paddingStart = height != null ? height : minHeight;
83
- if ((minHeight || height) && child.type === InputRightElement)
84
- groupProps.paddingEnd = height != null ? height : minHeight;
85
- if (child.type === InputLeftAddon) groupProps.roundedLeft = 0;
86
- if (child.type === InputRightAddon) groupProps.roundedRight = 0;
87
- });
88
- const cloneChildren = validChildren.map((child) => {
89
- var _a2, _b2;
90
- const childProps = (0, import_utils2.filterUndefined)({
91
- size: ((_a2 = child.props) == null ? void 0 : _a2.size) || props.size,
92
- variant: ((_b2 = child.props) == null ? void 0 : _b2.variant) || props.variant,
93
- ...child.props
94
- });
95
- return child.type !== Input && child.type !== import_file_input.FileInput ? (0, import_react.cloneElement)(child, childProps) : (0, import_react.cloneElement)(child, Object.assign(childProps, groupProps));
96
- });
97
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InputGroupProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
98
- import_core2.ui.div,
99
- {
100
- ref,
101
- className: (0, import_utils2.cx)("ui-input-group", className),
102
- role: "group",
103
- __css: css,
104
- ...rest,
105
- children: cloneChildren
106
- }
107
- ) });
108
- });
109
72
 
110
73
  // src/input-addon.tsx
111
- var import_core3 = require("@yamada-ui/core");
112
- var import_utils3 = require("@yamada-ui/utils");
113
- var import_jsx_runtime3 = require("react/jsx-runtime");
114
- var InputAddon = (0, import_core3.forwardRef)(
74
+ var import_jsx_runtime2 = require("react/jsx-runtime");
75
+ var InputAddon = (0, import_core2.forwardRef)(
115
76
  ({ className, placement = "left", ...rest }, ref) => {
116
77
  const styles = useInputGroup();
117
78
  const placementStyles = {
@@ -135,8 +96,8 @@ var InputAddon = (0, import_core3.forwardRef)(
135
96
  ...styles.addon,
136
97
  ...placementStyles[placement]
137
98
  };
138
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
139
- import_core3.ui.div,
99
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
100
+ import_core2.ui.div,
140
101
  {
141
102
  ref,
142
103
  className: (0, import_utils3.cx)("ui-input__addon", className),
@@ -146,9 +107,9 @@ var InputAddon = (0, import_core3.forwardRef)(
146
107
  );
147
108
  }
148
109
  );
149
- var InputLeftAddon = (0, import_core3.forwardRef)(
110
+ var InputLeftAddon = (0, import_core2.forwardRef)(
150
111
  ({ className, ...rest }, ref) => {
151
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
112
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
152
113
  InputAddon,
153
114
  {
154
115
  ref,
@@ -159,9 +120,9 @@ var InputLeftAddon = (0, import_core3.forwardRef)(
159
120
  );
160
121
  }
161
122
  );
162
- var InputRightAddon = (0, import_core3.forwardRef)(
123
+ var InputRightAddon = (0, import_core2.forwardRef)(
163
124
  ({ className, ...rest }, ref) => {
164
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
125
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
165
126
  InputAddon,
166
127
  {
167
128
  ref,
@@ -174,10 +135,10 @@ var InputRightAddon = (0, import_core3.forwardRef)(
174
135
  );
175
136
 
176
137
  // src/input-element.tsx
177
- var import_core4 = require("@yamada-ui/core");
138
+ var import_core3 = require("@yamada-ui/core");
178
139
  var import_utils4 = require("@yamada-ui/utils");
179
- var import_jsx_runtime4 = require("react/jsx-runtime");
180
- var InputElement = (0, import_core4.forwardRef)(
140
+ var import_jsx_runtime3 = require("react/jsx-runtime");
141
+ var InputElement = (0, import_core3.forwardRef)(
181
142
  ({ className, isClick = false, placement = "left", ...rest }, ref) => {
182
143
  var _a, _b, _c, _d, _e, _f, _g, _h;
183
144
  const styles = useInputGroup();
@@ -196,8 +157,8 @@ var InputElement = (0, import_core4.forwardRef)(
196
157
  cursor: isClick ? "pointer" : "auto",
197
158
  ...styles.element
198
159
  };
199
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
200
- import_core4.ui.div,
160
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
161
+ import_core3.ui.div,
201
162
  {
202
163
  ref,
203
164
  className: (0, import_utils4.cx)("ui-input__element", className),
@@ -207,9 +168,9 @@ var InputElement = (0, import_core4.forwardRef)(
207
168
  );
208
169
  }
209
170
  );
210
- var InputLeftElement = (0, import_core4.forwardRef)(
171
+ var InputLeftElement = (0, import_core3.forwardRef)(
211
172
  ({ className, ...rest }, ref) => {
212
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
173
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
213
174
  InputElement,
214
175
  {
215
176
  ref,
@@ -220,9 +181,9 @@ var InputLeftElement = (0, import_core4.forwardRef)(
220
181
  );
221
182
  }
222
183
  );
223
- var InputRightElement = (0, import_core4.forwardRef)(
184
+ var InputRightElement = (0, import_core3.forwardRef)(
224
185
  ({ className, ...rest }, ref) => {
225
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
186
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
226
187
  InputElement,
227
188
  {
228
189
  ref,
@@ -233,6 +194,52 @@ var InputRightElement = (0, import_core4.forwardRef)(
233
194
  );
234
195
  }
235
196
  );
197
+
198
+ // src/input-group.tsx
199
+ var import_jsx_runtime4 = require("react/jsx-runtime");
200
+ var InputGroup = (0, import_core4.forwardRef)((props, ref) => {
201
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
202
+ const [styles] = (0, import_core4.useComponentMultiStyle)("Input", props);
203
+ const { className, children, ...rest } = (0, import_core4.omitThemeProps)(props);
204
+ const css = {
205
+ width: "100%",
206
+ display: "flex",
207
+ position: "relative",
208
+ ...styles.container
209
+ };
210
+ const groupProps = {};
211
+ const minHeight = (_g = (_e = (0, import_use_token.useToken)("sizes", (_c = (_a = styles.field) == null ? void 0 : _a.minHeight) != null ? _c : (_b = styles.field) == null ? void 0 : _b.minH)) != null ? _e : (_d = styles.field) == null ? void 0 : _d.minHeight) != null ? _g : (_f = styles.field) == null ? void 0 : _f.minH;
212
+ const height = (_n = (_l = (0, import_use_token.useToken)("sizes", (_j = (_h = styles.field) == null ? void 0 : _h.height) != null ? _j : (_i = styles.field) == null ? void 0 : _i.h)) != null ? _l : (_k = styles.field) == null ? void 0 : _k.height) != null ? _n : (_m = styles.field) == null ? void 0 : _m.h;
213
+ const validChildren = (0, import_utils5.getValidChildren)(children);
214
+ validChildren.forEach((child) => {
215
+ if ((minHeight || height) && child.type === InputLeftElement)
216
+ groupProps.paddingStart = height != null ? height : minHeight;
217
+ if ((minHeight || height) && child.type === InputRightElement)
218
+ groupProps.paddingEnd = height != null ? height : minHeight;
219
+ if (child.type === InputLeftAddon) groupProps.roundedLeft = 0;
220
+ if (child.type === InputRightAddon) groupProps.roundedRight = 0;
221
+ });
222
+ const cloneChildren = validChildren.map((child) => {
223
+ var _a2, _b2;
224
+ const childProps = (0, import_utils5.filterUndefined)({
225
+ size: ((_a2 = child.props) == null ? void 0 : _a2.size) || props.size,
226
+ variant: ((_b2 = child.props) == null ? void 0 : _b2.variant) || props.variant,
227
+ ...child.props
228
+ });
229
+ return child.type !== Input && child.type !== import_file_input.FileInput ? (0, import_react.cloneElement)(child, childProps) : (0, import_react.cloneElement)(child, Object.assign(childProps, groupProps));
230
+ });
231
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InputGroupProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
232
+ import_core4.ui.div,
233
+ {
234
+ ref,
235
+ className: (0, import_utils5.cx)("ui-input-group", className),
236
+ role: "group",
237
+ __css: css,
238
+ ...rest,
239
+ children: cloneChildren
240
+ }
241
+ ) });
242
+ });
236
243
  // Annotate the CommonJS export names for ESM import in node:
237
244
  0 && (module.exports = {
238
245
  Input,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/input.tsx","../src/input-group.tsx","../src/input-addon.tsx","../src/input-element.tsx"],"sourcesContent":["export { Input } from \"./input\"\nexport type { InputProps } from \"./input\"\nexport { InputGroup } from \"./input-group\"\nexport type { InputGroupProps } from \"./input-group\"\nexport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nexport type { InputAddonProps } from \"./input-addon\"\nexport { InputLeftElement, InputRightElement } from \"./input-element\"\nexport type { InputElementProps } from \"./input-element\"\n","import type {\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n ColorModeToken,\n CSS,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n omitThemeProps,\n useMultiComponentStyle,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport { useFormControlProps } from \"@yamada-ui/form-control\"\nimport { cx } from \"@yamada-ui/utils\"\n\ntype InputOptions = {\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: 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 type InputProps = Omit<\n HTMLUIProps<\"input\">,\n \"disabled\" | \"required\" | \"readOnly\" | \"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] = useMultiComponentStyle(\"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 {\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n CSSUIProps,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useMultiComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { FileInput } from \"@yamada-ui/file-input\"\nimport { useToken } from \"@yamada-ui/use-token\"\nimport {\n createContext,\n cx,\n filterUndefined,\n getValidChildren,\n} from \"@yamada-ui/utils\"\nimport { cloneElement } from \"react\"\nimport {\n Input,\n InputRightElement,\n InputLeftElement,\n InputLeftAddon,\n InputRightAddon,\n} from \"./\"\n\nexport type InputGroupProps = HTMLUIProps<\"div\"> & ThemeProps<\"Input\">\n\ntype InputGroupContext = Record<string, CSSUIObject>\n\nconst [InputGroupProvider, useInputGroup] = createContext<InputGroupContext>({\n name: \"InputGroupContext\",\n errorMessage: `useInputGroup returned is 'undefined'. Seems you forgot to wrap the components in \"<InputGroup />\" `,\n})\n\nexport { useInputGroup }\n\nexport const InputGroup = forwardRef<InputGroupProps, \"div\">((props, ref) => {\n const [styles] = useMultiComponentStyle(\"Input\", props)\n const { className, children, ...rest } = omitThemeProps(props)\n\n const css: CSSUIObject = {\n width: \"100%\",\n display: \"flex\",\n position: \"relative\",\n ...styles.container,\n }\n const groupProps: CSSUIProps = {}\n const minHeight: any =\n useToken(\"sizes\", (styles.field?.minHeight ?? styles.field?.minH) as any) ??\n styles.field?.minHeight ??\n styles.field?.minH\n const height: any =\n useToken(\"sizes\", (styles.field?.height ?? styles.field?.h) as any) ??\n styles.field?.height ??\n styles.field?.h\n\n const validChildren = getValidChildren(children)\n\n validChildren.forEach((child: any) => {\n if ((minHeight || height) && child.type === InputLeftElement)\n groupProps.paddingStart = height ?? minHeight\n\n if ((minHeight || height) && child.type === InputRightElement)\n groupProps.paddingEnd = height ?? minHeight\n\n if (child.type === InputLeftAddon) groupProps.roundedLeft = 0\n\n if (child.type === InputRightAddon) groupProps.roundedRight = 0\n })\n\n const cloneChildren = validChildren.map((child) => {\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 child.type !== Input && child.type !== FileInput\n ? cloneElement(child, childProps)\n : cloneElement(child, Object.assign(childProps, groupProps))\n })\n\n return (\n <InputGroupProvider value={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 { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-group\"\n\ntype InputAddonOptions = {\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport type InputAddonProps = HTMLUIProps<\"div\"> & 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: 0,\n borderEndColor: \"transparent\",\n },\n right: {\n ms: \"-1px\",\n roundedLeft: 0,\n borderStartColor: \"transparent\",\n },\n }\n\n const css: CSSUIObject = {\n flex: \"0 0 auto\",\n w: \"auto\",\n display: \"flex\",\n alignItems: \"center\",\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, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useInputGroup } from \"./input-group\"\n\ntype InputElementOptions = {\n /**\n * If `true`, the element clickable.\n *\n * @default false\n */\n isClick?: boolean\n /**\n * The placement of the element.\n *\n * @default 'left'\n */\n placement?: \"left\" | \"right\"\n}\n\nexport type InputElementProps = HTMLUIProps<\"div\"> & InputElementOptions\n\nconst InputElement = forwardRef<InputElementProps, \"div\">(\n ({ className, isClick = false, placement = \"left\", ...rest }, ref) => {\n const styles = useInputGroup()\n\n const css: CSSUIObject = {\n position: \"absolute\",\n top: \"0\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n zIndex: \"fallback(kurillin, 9)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n w:\n styles.field?.height ??\n styles.field?.h ??\n styles.field?.minHeight ??\n styles.field?.minH,\n h: \"100%\",\n fontSize: styles.field?.fontSize,\n pointerEvents: isClick ? \"auto\" : \"none\",\n cursor: isClick ? \"pointer\" : \"auto\",\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;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,kBAKO;AAEP,0BAAoC;AACpC,mBAAmB;AAuCf;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;;;ACx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AAA,IACN;AAAA,EAEJ;AACF;AAEO,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;AAEO,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;","names":["import_core","import_utils","import_jsx_runtime","_a","_b","import_core","import_utils","import_jsx_runtime","import_core","import_utils","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/input.tsx","../src/input-group.tsx","../src/input-addon.tsx","../src/input-context.tsx","../src/input-element.tsx"],"sourcesContent":["export { Input } from \"./input\"\nexport type { InputProps } from \"./input\"\nexport { InputGroup } from \"./input-group\"\nexport type { InputGroupProps } from \"./input-group\"\nexport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nexport type { InputAddonProps } from \"./input-addon\"\nexport { InputLeftElement, InputRightElement } from \"./input-element\"\nexport type { InputElementProps } from \"./input-element\"\n","import type {\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n ColorModeToken,\n CSS,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n omitThemeProps,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\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 focused.\n */\n focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: 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\" | \"required\" | \"readOnly\" | \"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 {\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n CSSUIProps,\n} from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentMultiStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { FileInput } from \"@yamada-ui/file-input\"\nimport { useToken } from \"@yamada-ui/use-token\"\nimport { cx, filterUndefined, getValidChildren } from \"@yamada-ui/utils\"\nimport { cloneElement } from \"react\"\nimport { Input } from \"./input\"\nimport { InputLeftAddon, InputRightAddon } from \"./input-addon\"\nimport { InputGroupProvider } from \"./input-context\"\nimport { InputRightElement, InputLeftElement } 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 css: CSSUIObject = {\n width: \"100%\",\n display: \"flex\",\n position: \"relative\",\n ...styles.container,\n }\n const groupProps: CSSUIProps = {}\n const minHeight: any =\n useToken(\"sizes\", (styles.field?.minHeight ?? styles.field?.minH) as any) ??\n styles.field?.minHeight ??\n styles.field?.minH\n const height: any =\n useToken(\"sizes\", (styles.field?.height ?? styles.field?.h) as any) ??\n styles.field?.height ??\n styles.field?.h\n\n const validChildren = getValidChildren(children)\n\n validChildren.forEach((child: any) => {\n if ((minHeight || height) && child.type === InputLeftElement)\n groupProps.paddingStart = height ?? minHeight\n\n if ((minHeight || height) && child.type === InputRightElement)\n groupProps.paddingEnd = height ?? minHeight\n\n if (child.type === InputLeftAddon) groupProps.roundedLeft = 0\n\n if (child.type === InputRightAddon) groupProps.roundedRight = 0\n })\n\n const cloneChildren = validChildren.map((child) => {\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 child.type !== Input && child.type !== FileInput\n ? cloneElement(child, childProps)\n : cloneElement(child, Object.assign(childProps, groupProps))\n })\n\n return (\n <InputGroupProvider value={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 { ui, forwardRef } 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: 0,\n borderEndColor: \"transparent\",\n },\n right: {\n ms: \"-1px\",\n roundedLeft: 0,\n borderStartColor: \"transparent\",\n },\n }\n\n const css: CSSUIObject = {\n flex: \"0 0 auto\",\n w: \"auto\",\n display: \"flex\",\n alignItems: \"center\",\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 [key: string]: CSSUIObject\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 { ui, forwardRef } 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 isClick?: 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 ({ className, isClick = false, placement = \"left\", ...rest }, ref) => {\n const styles = useInputGroup()\n\n const css: CSSUIObject = {\n position: \"absolute\",\n top: \"0\",\n [placement === \"left\" ? \"insetStart\" : \"insetEnd\"]: \"0\",\n zIndex: \"fallback(kurillin, 9)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n w:\n styles.field?.height ??\n styles.field?.h ??\n styles.field?.minHeight ??\n styles.field?.minH,\n h: \"100%\",\n fontSize: styles.field?.fontSize,\n pointerEvents: isClick ? \"auto\" : \"none\",\n cursor: isClick ? \"pointer\" : \"auto\",\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;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,kBAKO;AAEP,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;;;ACzDD,IAAAA,eAKO;AACP,wBAA0B;AAC1B,uBAAyB;AACzB,IAAAC,gBAAsD;AACtD,mBAA6B;;;ACd7B,IAAAC,e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AAa,YAAW,MAAM;AAAA,MACvC,GAAG,MAAM;AAAA,IACX,CAAC;AAED,WAAO,MAAM,SAAS,SAAS,MAAM,SAAS,kCAC1C,2BAAa,OAAO,UAAU,QAC9B,2BAAa,OAAO,OAAO,OAAO,YAAY,UAAU,CAAC;AAAA,EAC/D,CAAC;AAED,SACE,6CAAC,sBAAmB,OAAO,QACzB;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_core","import_utils","import_utils","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","import_jsx_runtime","_a","_b"]}
package/dist/index.mjs CHANGED
@@ -1,14 +1,19 @@
1
1
  "use client"
2
2
  import {
3
- InputGroup,
3
+ InputGroup
4
+ } from "./chunk-3AEWRGHP.mjs";
5
+ import {
4
6
  InputLeftAddon,
7
+ InputRightAddon
8
+ } from "./chunk-OYJRHTQL.mjs";
9
+ import {
5
10
  InputLeftElement,
6
- InputRightAddon,
7
11
  InputRightElement
8
- } from "./chunk-OCJVHG24.mjs";
12
+ } from "./chunk-ITQBVWTU.mjs";
13
+ import "./chunk-ZNGNHH5S.mjs";
9
14
  import {
10
15
  Input
11
- } from "./chunk-PFAPK5JD.mjs";
16
+ } from "./chunk-ZARK2Q4J.mjs";
12
17
  export {
13
18
  Input,
14
19
  InputGroup,
@@ -1,15 +1,16 @@
1
1
  import * as _yamada_ui_core from '@yamada-ui/core';
2
2
  import { HTMLUIProps } from '@yamada-ui/core';
3
3
 
4
- type InputAddonOptions = {
4
+ interface InputAddonOptions {
5
5
  /**
6
6
  * The placement of the element.
7
7
  *
8
8
  * @default 'left'
9
9
  */
10
10
  placement?: "left" | "right";
11
- };
12
- type InputAddonProps = HTMLUIProps<"div"> & InputAddonOptions;
11
+ }
12
+ interface InputAddonProps extends HTMLUIProps, InputAddonOptions {
13
+ }
13
14
  declare const InputLeftAddon: _yamada_ui_core.Component<"div", InputAddonProps>;
14
15
  declare const InputRightAddon: _yamada_ui_core.Component<"div", InputAddonProps>;
15
16