@adgytec/adgytec-web-ui-components 2.1.4 → 2.1.5

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.
@@ -1,21 +1,20 @@
1
1
  import { t as e } from "./base";
2
2
  import { t } from "./Icon";
3
3
  import { IconButton as n } from "../components/Button/IconButton/index.js";
4
- import { t as r } from "./usePress";
5
- import { Description as i } from "../components/Input/Description/index.js";
6
- import { t as a } from "./FieldError";
7
- import { Label as o } from "../components/Input/Label/index.js";
8
- import { a as s, c, d as l, l as u, n as d, o as f, s as p } from "./core4";
9
- import { n as m, t as h } from "./useHover";
10
- import { CharacterCount as g } from "../components/Input/CharacterCount/index.js";
11
- import { useControllableState as _ } from "../components/Input/hooks/index.js";
12
- import v from "clsx";
13
- import { cloneElement as y, isValidElement as b, useCallback as x, useMemo as S, useRef as C } from "react";
14
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
15
- import { Input as D, TextField as O } from "react-aria-components";
4
+ import { Description as r } from "../components/Input/Description/index.js";
5
+ import { t as i } from "./FieldError";
6
+ import { Label as a } from "../components/Input/Label/index.js";
7
+ import { a as o, c as s, d as c, l, n as u, o as d, s as f } from "./core4";
8
+ import { n as p, t as m } from "./useHover";
9
+ import { CharacterCount as h } from "../components/Input/CharacterCount/index.js";
10
+ import { useControllableState as g } from "../components/Input/hooks/index.js";
11
+ import _ from "clsx";
12
+ import { cloneElement as v, isValidElement as y, useCallback as b, useMemo as x, useRef as S } from "react";
13
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
14
+ import { Input as E, TextField as D } from "react-aria-components";
16
15
  import '../assets/Input2.css';//#region node_modules/react-aria/dist/private/utils/useObjectRef.mjs
17
- function k(e) {
18
- let t = C(null), n = C(void 0), r = x((t) => {
16
+ function O(e) {
17
+ let t = S(null), n = S(void 0), r = b((t) => {
19
18
  if (typeof e == "function") {
20
19
  let n = e, r = n(t);
21
20
  return () => {
@@ -25,7 +24,7 @@ function k(e) {
25
24
  e.current = null;
26
25
  };
27
26
  }, [e]);
28
- return S(() => ({
27
+ return x(() => ({
29
28
  get current() {
30
29
  return t.current;
31
30
  },
@@ -34,8 +33,8 @@ function k(e) {
34
33
  }
35
34
  }), [r]);
36
35
  }
37
- var A = { button: "_button_650ys_2" }, j = ({ icon: e, className: t, ...r }) => /* @__PURE__ */ T(n, {
38
- className: (e) => v(A.button, typeof t == "function" ? t(e) : t),
36
+ var k = { button: "_button_650ys_2" }, A = ({ icon: e, className: t, ...r }) => /* @__PURE__ */ w(n, {
37
+ className: (e) => _(k.button, typeof t == "function" ? t(e) : t),
39
38
  icon: e,
40
39
  color: "standard",
41
40
  size: "small",
@@ -44,111 +43,112 @@ var A = { button: "_button_650ys_2" }, j = ({ icon: e, className: t, ...r }) =>
44
43
  });
45
44
  //#endregion
46
45
  //#region src/components/Input/Input/handleInputButton.ts
47
- function M({ node: e, isInvalid: t, isDisabled: n }) {
48
- return !b(e) || e.type !== j ? e : y(e, {
46
+ function j({ node: e, isInvalid: t, isDisabled: n }) {
47
+ return !y(e) || e.type !== A ? e : v(e, {
49
48
  "data-invalid": t || void 0,
50
49
  isDisabled: n
51
50
  });
52
51
  }
53
52
  //#endregion
54
53
  //#region src/components/Input/Input/Input.tsx
55
- var N = ({ label: n, description: y, errorMessage: b, showDescriptionOnInvalid: x = !1, placeholder: S, editorDir: C, prefix: A, suffix: j, leadingIcon: N, trailing: P, className: F, showCharacterCount: I, maxLength: L, value: R, defaultValue: z, ref: B, onChange: V, ...H }) => {
56
- let U = k(B), { currentValue: W, setValue: G } = _({
57
- value: R,
58
- defaultValue: z,
59
- onChange: V
60
- }), { isFocused: K, isFocusVisible: q, focusProps: J } = m(), { isHovered: Y, hoverProps: X } = h({}), { pressProps: Z } = r({ onPress: () => {
61
- U.current?.focus();
62
- } }), Q = {
63
- "data-trailing": P ? !0 : void 0,
64
- "data-leading": N ? !0 : void 0
54
+ var M = ({ label: n, description: v, errorMessage: y, showDescriptionOnInvalid: b = !1, placeholder: x, editorDir: S, prefix: k, suffix: A, leadingIcon: M, trailing: N, className: P, showCharacterCount: F, maxLength: I, value: L, defaultValue: R, ref: z, onChange: B, ...V }) => {
55
+ let H = O(z), { currentValue: U, setValue: W } = g({
56
+ value: L,
57
+ defaultValue: R,
58
+ onChange: B
59
+ }), { isFocused: G, isFocusVisible: K, focusProps: q } = p(), { isHovered: J, hoverProps: Y } = m({}), X = {
60
+ "data-trailing": N ? !0 : void 0,
61
+ "data-leading": M ? !0 : void 0
65
62
  };
66
- return /* @__PURE__ */ T(O, {
67
- className: (e) => v(d, c, typeof F == "function" ? F(e) : F),
68
- maxLength: L,
69
- value: R,
70
- defaultValue: z,
71
- onChange: G,
72
- ...H,
73
- ...Q,
74
- children: ({ isDisabled: r, isInvalid: c }) => {
75
- let d = {
76
- ...Q,
77
- "data-hovered": Y || void 0,
78
- "data-focused": K || void 0,
79
- "data-focus-visible": q || void 0,
80
- "data-disabled": r || void 0,
81
- "data-invalid": c || void 0
82
- }, m = y && (!c || c && x);
83
- return /* @__PURE__ */ E(w, { children: [
84
- n && /* @__PURE__ */ T(o, { children: n }),
85
- /* @__PURE__ */ E("span", {
86
- ...Z,
87
- ...X,
88
- ...d,
89
- className: v(p),
63
+ return /* @__PURE__ */ w(D, {
64
+ className: (e) => _(u, s, typeof P == "function" ? P(e) : P),
65
+ maxLength: I,
66
+ value: U,
67
+ defaultValue: R,
68
+ onChange: W,
69
+ ...V,
70
+ ...X,
71
+ children: ({ isDisabled: s, isInvalid: u }) => {
72
+ let p = {
73
+ ...X,
74
+ "data-hovered": J || void 0,
75
+ "data-focused": G || void 0,
76
+ "data-focus-visible": K || void 0,
77
+ "data-disabled": s || void 0,
78
+ "data-invalid": u || void 0
79
+ }, m = v && (!u || u && b);
80
+ return /* @__PURE__ */ T(C, { children: [
81
+ n && /* @__PURE__ */ w(a, { children: n }),
82
+ /* @__PURE__ */ T("span", {
83
+ onPointerDown: (e) => {
84
+ let t = e.target;
85
+ H.current?.contains(t) || t.closest("button, a, [role='button']") || (e.preventDefault(), H.current?.focus());
86
+ },
87
+ ...Y,
88
+ ...p,
89
+ className: _(f),
90
90
  "data-input": !0,
91
91
  children: [
92
- N && /* @__PURE__ */ T(t, {
93
- icon: N,
92
+ M && /* @__PURE__ */ w(t, {
93
+ icon: M,
94
94
  size: 24
95
95
  }),
96
- /* @__PURE__ */ E("span", {
97
- className: v(s, e.bodyLarge),
96
+ /* @__PURE__ */ T("span", {
97
+ className: _(o, e.bodyLarge),
98
98
  children: [
99
- A && typeof A == "function" ? A({
100
- isDisabled: r,
101
- isInvalid: c
102
- }) : A,
103
- /* @__PURE__ */ T(D, {
104
- ref: U,
105
- className: v(l, f, e.bodyLarge),
106
- ...J,
107
- placeholder: S,
108
- dir: C,
99
+ k && typeof k == "function" ? k({
100
+ isDisabled: s,
101
+ isInvalid: u
102
+ }) : k,
103
+ /* @__PURE__ */ w(E, {
104
+ ref: H,
105
+ className: _(c, d, e.bodyLarge),
106
+ ...q,
107
+ placeholder: x,
108
+ dir: S,
109
109
  "data-input": !0
110
110
  }),
111
- j && typeof j == "function" ? j({
112
- isDisabled: r,
113
- isInvalid: c
114
- }) : j
111
+ A && typeof A == "function" ? A({
112
+ isDisabled: s,
113
+ isInvalid: u
114
+ }) : A
115
115
  ]
116
116
  }),
117
- P && typeof P == "function" ? P({
118
- isDisabled: r,
119
- isInvalid: c
120
- }) : M({
121
- node: P,
122
- isDisabled: r,
123
- isInvalid: c
117
+ N && typeof N == "function" ? N({
118
+ isDisabled: s,
119
+ isInvalid: u
120
+ }) : j({
121
+ node: N,
122
+ isDisabled: s,
123
+ isInvalid: u
124
124
  })
125
125
  ]
126
126
  }),
127
- m && /* @__PURE__ */ E("span", {
128
- ...Q,
129
- className: v(u),
130
- children: [/* @__PURE__ */ T(i, { children: y }), I && /* @__PURE__ */ T(g, {
131
- count: W.length,
132
- maxLength: L
127
+ m && /* @__PURE__ */ T("span", {
128
+ ...X,
129
+ className: _(l),
130
+ children: [/* @__PURE__ */ w(r, { children: v }), F && /* @__PURE__ */ w(h, {
131
+ count: U.length,
132
+ maxLength: I
133
133
  })]
134
134
  }),
135
- !m && I && /* @__PURE__ */ E("span", {
136
- ...Q,
137
- className: v(u),
138
- children: [/* @__PURE__ */ T(a, { children: b }), /* @__PURE__ */ T(g, {
139
- count: W.length,
140
- maxLength: L
135
+ !m && F && /* @__PURE__ */ T("span", {
136
+ ...X,
137
+ className: _(l),
138
+ children: [/* @__PURE__ */ w(i, { children: y }), /* @__PURE__ */ w(h, {
139
+ count: U.length,
140
+ maxLength: I
141
141
  })]
142
142
  }),
143
- m || !I ? /* @__PURE__ */ T(a, {
144
- className: v(u),
145
- children: b
143
+ m || !F ? /* @__PURE__ */ w(i, {
144
+ className: _(l),
145
+ children: y
146
146
  }) : null
147
147
  ] });
148
148
  }
149
149
  });
150
150
  };
151
151
  //#endregion
152
- export { j as n, N as t };
152
+ export { A as n, M as t };
153
153
 
154
154
  //# sourceMappingURL=Input2.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input2","names":["$i6EpZ$useRef","$i6EpZ$useCallback","$i6EpZ$useMemo"],"sources":["../../node_modules/react-aria/dist/private/utils/useObjectRef.mjs","../../src/components/Input/Input/input.module.css","../../src/components/Input/Input/InputButton.tsx","../../src/components/Input/Input/handleInputButton.ts","../../src/components/Input/Input/Input.tsx"],"sourcesContent":["import {useRef as $i6EpZ$useRef, useCallback as $i6EpZ$useCallback, useMemo as $i6EpZ$useMemo} from \"react\";\n\n/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \nfunction $03e8ab2d84d7657a$export$4338b53315abf666(ref) {\n const objRef = (0, $i6EpZ$useRef)(null);\n const cleanupRef = (0, $i6EpZ$useRef)(undefined);\n const refEffect = (0, $i6EpZ$useCallback)((instance)=>{\n if (typeof ref === 'function') {\n const refCallback = ref;\n const refCleanup = refCallback(instance);\n return ()=>{\n if (typeof refCleanup === 'function') refCleanup();\n else refCallback(null);\n };\n } else if (ref) {\n ref.current = instance;\n return ()=>{\n ref.current = null;\n };\n }\n }, [\n ref\n ]);\n return (0, $i6EpZ$useMemo)(()=>({\n get current () {\n return objRef.current;\n },\n set current (value){\n objRef.current = value;\n if (cleanupRef.current) {\n cleanupRef.current();\n cleanupRef.current = undefined;\n }\n if (value != null) cleanupRef.current = refEffect(value);\n }\n }), [\n refEffect\n ]);\n}\n\n\nexport {$03e8ab2d84d7657a$export$4338b53315abf666 as useObjectRef};\n//# sourceMappingURL=useObjectRef.mjs.map\n","@layer adgytec.overrides {\n .button[data-invalid] {\n --md-button-color: var(--group-color);\n }\n}\n","import clsx from \"clsx\";\nimport { IconButton, type IconButtonProps } from \"@/components/Button\";\nimport styles from \"./input.module.css\";\n\nexport const InputButton: React.FC<\n Omit<IconButtonProps, \"color\" | \"size\" | \"width\">\n> = ({ icon, className, ...props }) => {\n return (\n <IconButton\n className={(renderProps) =>\n clsx(\n styles[\"button\"],\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n icon={icon}\n color=\"standard\"\n size=\"small\"\n width=\"default\"\n {...props}\n />\n );\n};\n","import { cloneElement, isValidElement, type ReactNode } from \"react\";\nimport { InputButton } from \"./InputButton\";\n\ntype InputButtonProps = React.ComponentProps<typeof InputButton> & {\n \"data-invalid\"?: boolean;\n};\n\nexport function addStateAttrsToInputButton({\n node,\n isInvalid,\n isDisabled,\n}: {\n node: ReactNode;\n isInvalid: boolean;\n isDisabled: boolean;\n}) {\n if (!isValidElement<InputButtonProps>(node)) {\n return node;\n }\n\n if (node.type !== InputButton) return node;\n\n return cloneElement(node, {\n \"data-invalid\": isInvalid || undefined,\n isDisabled,\n });\n}\n","import clsx from \"clsx\";\nimport { useFocusRing } from \"react-aria/useFocusRing\";\nimport { useHover } from \"react-aria/useHover\";\nimport { useObjectRef } from \"react-aria/useObjectRef\";\nimport { usePress } from \"react-aria/usePress\";\nimport {\n Input as AriaInput,\n TextField as AriaTextField,\n} from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { typography } from \"@/utils\";\nimport { CharacterCount } from \"../CharacterCount\";\nimport {\n Colors,\n EditorInputGroupStyles,\n EditorInputStyles,\n EditorStyles,\n InputGroupStyles,\n SupportingTextStyles,\n TextFieldIconSize,\n UnsetStyles,\n} from \"../core\";\nimport { Description } from \"../Description\";\nimport { FieldError } from \"../FieldError\";\nimport { useControllableState } from \"../hooks\";\nimport { Label } from \"../Label\";\nimport { addStateAttrsToInputButton } from \"./handleInputButton\";\nimport type { InputProps } from \"./types\";\n\nexport const Input: React.FC<InputProps> = ({\n label,\n description,\n errorMessage,\n showDescriptionOnInvalid = false,\n placeholder,\n editorDir,\n prefix,\n suffix,\n leadingIcon,\n trailing,\n className,\n showCharacterCount: hasCharacterCount,\n maxLength,\n value,\n defaultValue,\n ref,\n onChange,\n ...props\n}) => {\n const inputRef = useObjectRef(ref);\n\n const { currentValue, setValue } = useControllableState({\n value,\n defaultValue,\n onChange,\n });\n\n const { isFocused, isFocusVisible, focusProps } = useFocusRing();\n const { isHovered, hoverProps } = useHover({});\n const { pressProps } = usePress({\n onPress: () => {\n inputRef.current?.focus();\n },\n });\n\n const layoutDataAttrs = {\n \"data-trailing\": trailing ? true : undefined,\n \"data-leading\": leadingIcon ? true : undefined,\n };\n\n return (\n <AriaTextField\n className={(renderProps) =>\n clsx(\n Colors,\n InputGroupStyles,\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n maxLength={maxLength}\n value={value}\n defaultValue={defaultValue}\n onChange={setValue}\n {...props}\n {...layoutDataAttrs}\n >\n {({ isDisabled, isInvalid }) => {\n const dataAttrs = {\n ...layoutDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-invalid\": isInvalid || undefined,\n };\n\n const hasDescription =\n description &&\n (!isInvalid || (isInvalid && showDescriptionOnInvalid));\n\n return (\n <>\n {label && <Label>{label}</Label>}\n\n <span\n {...pressProps}\n {...hoverProps}\n {...dataAttrs}\n className={clsx(EditorStyles)}\n data-input={true}\n >\n {leadingIcon && (\n <Icon\n icon={leadingIcon}\n size={TextFieldIconSize}\n />\n )}\n <span\n className={clsx(\n EditorInputGroupStyles,\n typography.bodyLarge\n )}\n >\n {prefix && typeof prefix === \"function\"\n ? prefix({ isDisabled, isInvalid })\n : prefix}\n <AriaInput\n ref={inputRef}\n className={clsx(\n UnsetStyles,\n EditorInputStyles,\n typography.bodyLarge\n )}\n {...focusProps}\n placeholder={placeholder}\n dir={editorDir}\n data-input={true}\n />\n {suffix && typeof suffix === \"function\"\n ? suffix({ isDisabled, isInvalid })\n : suffix}\n </span>\n\n {trailing && typeof trailing === \"function\"\n ? trailing({ isDisabled, isInvalid })\n : addStateAttrsToInputButton({\n node: trailing,\n isDisabled,\n isInvalid,\n })}\n </span>\n\n {hasDescription && (\n <span\n {...layoutDataAttrs}\n className={clsx(SupportingTextStyles)}\n >\n <Description>{description}</Description>\n\n {hasCharacterCount && (\n <CharacterCount\n count={currentValue.length}\n maxLength={maxLength}\n />\n )}\n </span>\n )}\n\n {!hasDescription && hasCharacterCount && (\n <span\n {...layoutDataAttrs}\n className={clsx(SupportingTextStyles)}\n >\n <FieldError>{errorMessage}</FieldError>\n\n <CharacterCount\n count={currentValue.length}\n maxLength={maxLength}\n />\n </span>\n )}\n\n {/* Error placement */}\n {hasDescription || !hasCharacterCount ? (\n <FieldError className={clsx(SupportingTextStyles)}>\n {errorMessage}\n </FieldError>\n ) : null}\n </>\n );\n }}\n </AriaTextField>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OAAE;OAAY;MAAU,CAAC,IAClC,EAA2B;OACvB,MAAM;OACN;OACA;MACJ,CAAC;KACL;;IAEL,KACG,kBAAC,QAAD;KACI,GAAI;KACJ,WAAW,EAAK,CAAoB;eAFxC,CAII,kBAAC,GAAD,EAAA,UAAc,EAAyB,CAAA,GAEtC,KACG,kBAAC,GAAD;MACI,OAAO,EAAa;MACT;KACd,CAAA,CAEH;;IAGT,CAAC,KAAkB,KAChB,kBAAC,QAAD;KACI,GAAI;KACJ,WAAW,EAAK,CAAoB;eAFxC,CAII,kBAAC,GAAD,EAAA,UAAa,EAAyB,CAAA,GAEtC,kBAAC,GAAD;MACI,OAAO,EAAa;MACT;KACd,CAAA,CACC;;IAIT,KAAkB,CAAC,IAChB,kBAAC,GAAD;KAAY,WAAW,EAAK,CAAoB;eAC3C;IACO,CAAA,IACZ;GACN,EAAA,CAAA;EAEV;CACW,CAAA;AAEvB"}
1
+ {"version":3,"file":"Input2","names":["$i6EpZ$useRef","$i6EpZ$useCallback","$i6EpZ$useMemo"],"sources":["../../node_modules/react-aria/dist/private/utils/useObjectRef.mjs","../../src/components/Input/Input/input.module.css","../../src/components/Input/Input/InputButton.tsx","../../src/components/Input/Input/handleInputButton.ts","../../src/components/Input/Input/Input.tsx"],"sourcesContent":["import {useRef as $i6EpZ$useRef, useCallback as $i6EpZ$useCallback, useMemo as $i6EpZ$useMemo} from \"react\";\n\n/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \nfunction $03e8ab2d84d7657a$export$4338b53315abf666(ref) {\n const objRef = (0, $i6EpZ$useRef)(null);\n const cleanupRef = (0, $i6EpZ$useRef)(undefined);\n const refEffect = (0, $i6EpZ$useCallback)((instance)=>{\n if (typeof ref === 'function') {\n const refCallback = ref;\n const refCleanup = refCallback(instance);\n return ()=>{\n if (typeof refCleanup === 'function') refCleanup();\n else refCallback(null);\n };\n } else if (ref) {\n ref.current = instance;\n return ()=>{\n ref.current = null;\n };\n }\n }, [\n ref\n ]);\n return (0, $i6EpZ$useMemo)(()=>({\n get current () {\n return objRef.current;\n },\n set current (value){\n objRef.current = value;\n if (cleanupRef.current) {\n cleanupRef.current();\n cleanupRef.current = undefined;\n }\n if (value != null) cleanupRef.current = refEffect(value);\n }\n }), [\n refEffect\n ]);\n}\n\n\nexport {$03e8ab2d84d7657a$export$4338b53315abf666 as useObjectRef};\n//# sourceMappingURL=useObjectRef.mjs.map\n","@layer adgytec.overrides {\n .button[data-invalid] {\n --md-button-color: var(--group-color);\n }\n}\n","import clsx from \"clsx\";\nimport { IconButton, type IconButtonProps } from \"@/components/Button\";\nimport styles from \"./input.module.css\";\n\nexport const InputButton: React.FC<\n Omit<IconButtonProps, \"color\" | \"size\" | \"width\">\n> = ({ icon, className, ...props }) => {\n return (\n <IconButton\n className={(renderProps) =>\n clsx(\n styles[\"button\"],\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n icon={icon}\n color=\"standard\"\n size=\"small\"\n width=\"default\"\n {...props}\n />\n );\n};\n","import { cloneElement, isValidElement, type ReactNode } from \"react\";\nimport { InputButton } from \"./InputButton\";\n\ntype InputButtonProps = React.ComponentProps<typeof InputButton> & {\n \"data-invalid\"?: boolean;\n};\n\nexport function addStateAttrsToInputButton({\n node,\n isInvalid,\n isDisabled,\n}: {\n node: ReactNode;\n isInvalid: boolean;\n isDisabled: boolean;\n}) {\n if (!isValidElement<InputButtonProps>(node)) {\n return node;\n }\n\n if (node.type !== InputButton) return node;\n\n return cloneElement(node, {\n \"data-invalid\": isInvalid || undefined,\n isDisabled,\n });\n}\n","import clsx from \"clsx\";\nimport { useFocusRing } from \"react-aria/useFocusRing\";\nimport { useHover } from \"react-aria/useHover\";\nimport { useObjectRef } from \"react-aria/useObjectRef\";\nimport {\n Input as AriaInput,\n TextField as AriaTextField,\n} from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { typography } from \"@/utils\";\nimport { CharacterCount } from \"../CharacterCount\";\nimport {\n Colors,\n EditorInputGroupStyles,\n EditorInputStyles,\n EditorStyles,\n InputGroupStyles,\n SupportingTextStyles,\n TextFieldIconSize,\n UnsetStyles,\n} from \"../core\";\nimport { Description } from \"../Description\";\nimport { FieldError } from \"../FieldError\";\nimport { useControllableState } from \"../hooks\";\nimport { Label } from \"../Label\";\nimport { addStateAttrsToInputButton } from \"./handleInputButton\";\nimport type { InputProps } from \"./types\";\n\nexport const Input: React.FC<InputProps> = ({\n label,\n description,\n errorMessage,\n showDescriptionOnInvalid = false,\n placeholder,\n editorDir,\n prefix,\n suffix,\n leadingIcon,\n trailing,\n className,\n showCharacterCount: hasCharacterCount,\n maxLength,\n value,\n defaultValue,\n ref,\n onChange,\n ...props\n}) => {\n const inputRef = useObjectRef(ref);\n\n const { currentValue, setValue } = useControllableState({\n value,\n defaultValue,\n onChange,\n });\n\n const { isFocused, isFocusVisible, focusProps } = useFocusRing();\n const { isHovered, hoverProps } = useHover({});\n\n const layoutDataAttrs = {\n \"data-trailing\": trailing ? true : undefined,\n \"data-leading\": leadingIcon ? true : undefined,\n };\n\n return (\n <AriaTextField\n className={(renderProps) =>\n clsx(\n Colors,\n InputGroupStyles,\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n maxLength={maxLength}\n value={currentValue}\n defaultValue={defaultValue}\n onChange={setValue}\n {...props}\n {...layoutDataAttrs}\n >\n {({ isDisabled, isInvalid }) => {\n const dataAttrs = {\n ...layoutDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-invalid\": isInvalid || undefined,\n };\n\n const hasDescription =\n description &&\n (!isInvalid || (isInvalid && showDescriptionOnInvalid));\n\n return (\n <>\n {label && <Label>{label}</Label>}\n\n <span\n onPointerDown={(e) => {\n const target = e.target as HTMLElement;\n\n if (\n inputRef.current?.contains(target) ||\n target.closest(\"button, a, [role='button']\")\n ) {\n return;\n }\n\n e.preventDefault();\n inputRef.current?.focus();\n }}\n {...hoverProps}\n {...dataAttrs}\n className={clsx(EditorStyles)}\n data-input={true}\n >\n {leadingIcon && (\n <Icon\n icon={leadingIcon}\n size={TextFieldIconSize}\n />\n )}\n <span\n className={clsx(\n EditorInputGroupStyles,\n typography.bodyLarge\n )}\n >\n {prefix && typeof prefix === \"function\"\n ? prefix({ isDisabled, isInvalid })\n : prefix}\n <AriaInput\n ref={inputRef}\n className={clsx(\n UnsetStyles,\n EditorInputStyles,\n typography.bodyLarge\n )}\n {...focusProps}\n placeholder={placeholder}\n dir={editorDir}\n data-input={true}\n />\n {suffix && typeof suffix === \"function\"\n ? suffix({ isDisabled, isInvalid })\n : suffix}\n </span>\n\n {trailing && typeof trailing === \"function\"\n ? trailing({ isDisabled, isInvalid })\n : addStateAttrsToInputButton({\n node: trailing,\n isDisabled,\n isInvalid,\n })}\n </span>\n\n {hasDescription && (\n <span\n {...layoutDataAttrs}\n className={clsx(SupportingTextStyles)}\n >\n <Description>{description}</Description>\n\n {hasCharacterCount && (\n <CharacterCount\n count={currentValue.length}\n maxLength={maxLength}\n />\n )}\n </span>\n )}\n\n {!hasDescription && hasCharacterCount && (\n <span\n {...layoutDataAttrs}\n className={clsx(SupportingTextStyles)}\n >\n <FieldError>{errorMessage}</FieldError>\n\n <CharacterCount\n count={currentValue.length}\n maxLength={maxLength}\n />\n </span>\n )}\n\n {/* Error placement */}\n {hasDescription || !hasCharacterCount ? (\n <FieldError className={clsx(SupportingTextStyles)}>\n {errorMessage}\n </FieldError>\n ) : null}\n </>\n );\n }}\n </AriaTextField>\n );\n};\n"],"x_google_ign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C;OACJ;;MAEL,KAAY,OAAO,KAAa,aAC3B,EAAS;OAAE;OAAY;MAAU,CAAC,IAClC,EAA2B;OACvB,MAAM;OACN;OACA;MACJ,CAAC;KACL;;IAEL,KACG,kBAAC,QAAD;KACI,GAAI;KACJ,WAAW,EAAK,CAAoB;eAFxC,CAII,kBAAC,GAAD,EAAA,UAAc,EAAyB,CAAA,GAEtC,KACG,kBAAC,GAAD;MACI,OAAO,EAAa;MACT;KACd,CAAA,CAEH;;IAGT,CAAC,KAAkB,KAChB,kBAAC,QAAD;KACI,GAAI;KACJ,WAAW,EAAK,CAAoB;eAFxC,CAII,kBAAC,GAAD,EAAA,UAAa,EAAyB,CAAA,GAEtC,kBAAC,GAAD;MACI,OAAO,EAAa;MACT;KACd,CAAA,CACC;;IAIT,KAAkB,CAAC,IAChB,kBAAC,GAAD;KAAY,WAAW,EAAK,CAAoB;eAC3C;IACO,CAAA,IACZ;GACN,EAAA,CAAA;EAEV;CACW,CAAA;AAEvB"}
@@ -0,0 +1,294 @@
1
+ import e, { useCallback as t, useEffect as n, useRef as r } from "react";
2
+ //#region node_modules/react-aria/dist/private/utils/focusWithoutScrolling.mjs
3
+ function i(e) {
4
+ if (o()) e.focus({ preventScroll: !0 });
5
+ else {
6
+ let t = s(e);
7
+ e.focus(), c(t);
8
+ }
9
+ }
10
+ var a = null;
11
+ function o() {
12
+ if (a == null) {
13
+ a = !1;
14
+ try {
15
+ document.createElement("div").focus({ get preventScroll() {
16
+ return a = !0, !0;
17
+ } });
18
+ } catch {}
19
+ }
20
+ return a;
21
+ }
22
+ function s(e) {
23
+ let t = e.parentNode, n = [], r = document.scrollingElement || document.documentElement;
24
+ for (; t instanceof HTMLElement && t !== r;) (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && n.push({
25
+ element: t,
26
+ scrollTop: t.scrollTop,
27
+ scrollLeft: t.scrollLeft
28
+ }), t = t.parentNode;
29
+ return r instanceof HTMLElement && n.push({
30
+ element: r,
31
+ scrollTop: r.scrollTop,
32
+ scrollLeft: r.scrollLeft
33
+ }), n;
34
+ }
35
+ function c(e) {
36
+ for (let { element: t, scrollTop: n, scrollLeft: r } of e) t.scrollTop = n, t.scrollLeft = r;
37
+ }
38
+ //#endregion
39
+ //#region node_modules/react-aria/dist/private/utils/domHelpers.mjs
40
+ var l = (e) => e?.ownerDocument ?? document, u = (e) => e && "window" in e && e.window === e ? e : l(e).defaultView || window;
41
+ function d(e) {
42
+ return typeof e == "object" && !!e && "nodeType" in e && typeof e.nodeType == "number";
43
+ }
44
+ function f(e) {
45
+ return d(e) && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in e;
46
+ }
47
+ //#endregion
48
+ //#region node_modules/react-stately/dist/private/flags/flags.mjs
49
+ var p = !1;
50
+ function m() {
51
+ return p;
52
+ }
53
+ //#endregion
54
+ //#region node_modules/react-aria/dist/private/utils/shadowdom/DOMFunctions.mjs
55
+ function h(e, t) {
56
+ if (!m()) return t && e ? e.contains(t) : !1;
57
+ if (!e || !t) return !1;
58
+ let n = t;
59
+ for (; n !== null;) {
60
+ if (n === e) return !0;
61
+ n = n.tagName === "SLOT" && n.assignedSlot ? n.assignedSlot.parentNode : f(n) ? n.host : n.parentNode;
62
+ }
63
+ return !1;
64
+ }
65
+ var g = (e = document) => {
66
+ if (!m()) return e.activeElement;
67
+ let t = e.activeElement;
68
+ for (; t && "shadowRoot" in t && t.shadowRoot?.activeElement;) t = t.shadowRoot.activeElement;
69
+ return t;
70
+ };
71
+ function _(e) {
72
+ if (m() && e.target instanceof Element && e.target.shadowRoot) {
73
+ if ("composedPath" in e) return e.composedPath()[0] ?? null;
74
+ if ("composedPath" in e.nativeEvent) return e.nativeEvent.composedPath()[0] ?? null;
75
+ }
76
+ return e.target;
77
+ }
78
+ //#endregion
79
+ //#region node_modules/react-aria/dist/private/utils/isElementVisible.mjs
80
+ var v = typeof Element < "u" && "checkVisibility" in Element.prototype;
81
+ function y(e) {
82
+ let t = u(e);
83
+ if (!(e instanceof t.HTMLElement) && !(e instanceof t.SVGElement)) return !1;
84
+ let { display: n, visibility: r } = e.style, i = n !== "none" && r !== "hidden" && r !== "collapse";
85
+ if (i) {
86
+ let { getComputedStyle: t } = e.ownerDocument.defaultView, { display: n, visibility: r } = t(e);
87
+ i = n !== "none" && r !== "hidden" && r !== "collapse";
88
+ }
89
+ return i;
90
+ }
91
+ function b(e, t) {
92
+ return !e.hasAttribute("hidden") && !e.hasAttribute("data-react-aria-prevent-focus") && (e.nodeName === "DETAILS" && t && t.nodeName !== "SUMMARY" ? e.hasAttribute("open") : !0);
93
+ }
94
+ function x(e, t) {
95
+ return v ? e.checkVisibility({ visibilityProperty: !0 }) && !e.closest("[data-react-aria-prevent-focus]") : e.nodeName !== "#comment" && y(e) && b(e, t) && (!e.parentElement || x(e.parentElement, e));
96
+ }
97
+ //#endregion
98
+ //#region node_modules/react-aria/dist/private/utils/isFocusable.mjs
99
+ var S = [
100
+ "input:not([disabled]):not([type=hidden])",
101
+ "select:not([disabled])",
102
+ "textarea:not([disabled])",
103
+ "button:not([disabled])",
104
+ "a[href]",
105
+ "area[href]",
106
+ "summary",
107
+ "iframe",
108
+ "object",
109
+ "embed",
110
+ "audio[controls]",
111
+ "video[controls]",
112
+ "[contenteditable]:not([contenteditable^=\"false\"])",
113
+ "permission"
114
+ ], C = S.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
115
+ S.push("[tabindex]:not([tabindex=\"-1\"]):not([disabled])"), S.join(":not([hidden]):not([tabindex=\"-1\"]),");
116
+ function w(e, t) {
117
+ return e.matches(C) && !T(e) && (t?.skipVisibilityCheck || x(e));
118
+ }
119
+ function T(e) {
120
+ let t = e;
121
+ for (; t != null;) {
122
+ if (t instanceof t.ownerDocument.defaultView.HTMLElement && t.inert) return !0;
123
+ t = t.parentElement;
124
+ }
125
+ return !1;
126
+ }
127
+ //#endregion
128
+ //#region node_modules/react-aria/dist/private/utils/useLayoutEffect.mjs
129
+ var E = typeof document < "u" ? e.useLayoutEffect : () => {};
130
+ //#endregion
131
+ //#region node_modules/react-aria/dist/private/interactions/utils.mjs
132
+ function D(e) {
133
+ let t = e;
134
+ return t.nativeEvent = e, t.isDefaultPrevented = () => t.defaultPrevented, t.isPropagationStopped = () => t.cancelBubble, t.persist = () => {}, t;
135
+ }
136
+ function O(e, t) {
137
+ Object.defineProperty(e, "target", { value: t }), Object.defineProperty(e, "currentTarget", { value: t });
138
+ }
139
+ function k(e) {
140
+ let n = r({
141
+ isFocused: !1,
142
+ observer: null
143
+ });
144
+ return E(() => {
145
+ let e = n.current;
146
+ return () => {
147
+ e.observer &&= (e.observer.disconnect(), null);
148
+ };
149
+ }, []), t((t) => {
150
+ let r = _(t);
151
+ if (r instanceof HTMLButtonElement || r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement) {
152
+ n.current.isFocused = !0;
153
+ let t = r;
154
+ t.addEventListener("focusout", (r) => {
155
+ if (n.current.isFocused = !1, t.disabled) {
156
+ let t = D(r);
157
+ e?.(t);
158
+ }
159
+ n.current.observer && (n.current.observer.disconnect(), n.current.observer = null);
160
+ }, { once: !0 }), n.current.observer = new MutationObserver(() => {
161
+ if (n.current.isFocused && t.disabled) {
162
+ n.current.observer?.disconnect();
163
+ let e = t === g() ? null : g();
164
+ t.dispatchEvent(new FocusEvent("blur", { relatedTarget: e })), t.dispatchEvent(new FocusEvent("focusout", {
165
+ bubbles: !0,
166
+ relatedTarget: e
167
+ }));
168
+ }
169
+ }), n.current.observer.observe(t, {
170
+ attributes: !0,
171
+ attributeFilter: ["disabled"]
172
+ });
173
+ }
174
+ }, [e]);
175
+ }
176
+ var A = !1;
177
+ function j(e) {
178
+ for (; e && !w(e, { skipVisibilityCheck: !0 });) e = e.parentElement;
179
+ let t = u(e), n = t.document.activeElement;
180
+ if (!n || n === e) return;
181
+ A = !0;
182
+ let r = !1, a = (e) => {
183
+ (_(e) === n || r) && e.stopImmediatePropagation();
184
+ }, o = (t) => {
185
+ (_(t) === n || r) && (t.stopImmediatePropagation(), !e && !r && (r = !0, i(n), l()));
186
+ }, s = (t) => {
187
+ (_(t) === e || r) && t.stopImmediatePropagation();
188
+ }, c = (t) => {
189
+ (_(t) === e || r) && (t.stopImmediatePropagation(), r || (r = !0, i(n), l()));
190
+ };
191
+ t.addEventListener("blur", a, !0), t.addEventListener("focusout", o, !0), t.addEventListener("focusin", c, !0), t.addEventListener("focus", s, !0);
192
+ let l = () => {
193
+ cancelAnimationFrame(d), t.removeEventListener("blur", a, !0), t.removeEventListener("focusout", o, !0), t.removeEventListener("focusin", c, !0), t.removeEventListener("focus", s, !0), A = !1, r = !1;
194
+ }, d = requestAnimationFrame(l);
195
+ return l;
196
+ }
197
+ //#endregion
198
+ //#region node_modules/react-aria/dist/private/utils/platform.mjs
199
+ function M(e) {
200
+ if (typeof window > "u" || window.navigator == null) return !1;
201
+ let t = window.navigator.userAgentData?.brands;
202
+ return Array.isArray(t) && t.some((t) => e.test(t.brand)) || e.test(window.navigator.userAgent);
203
+ }
204
+ function N(e) {
205
+ return typeof window < "u" && window.navigator != null ? e.test(window.navigator.userAgentData?.platform || window.navigator.platform) : !1;
206
+ }
207
+ function P(e) {
208
+ if (process.env.NODE_ENV === "test") return e;
209
+ let t = null;
210
+ return () => (t ??= e(), t);
211
+ }
212
+ var F = P(function() {
213
+ return N(/^Mac/i);
214
+ }), I = P(function() {
215
+ return N(/^iPhone/i);
216
+ }), L = P(function() {
217
+ return N(/^iPad/i) || F() && navigator.maxTouchPoints > 1;
218
+ }), R = P(function() {
219
+ return I() || L();
220
+ });
221
+ P(function() {
222
+ return F() || R();
223
+ });
224
+ var z = P(function() {
225
+ return M(/AppleWebKit/i) && !B();
226
+ }), B = P(function() {
227
+ return M(/Chrome/i);
228
+ }), V = P(function() {
229
+ return M(/Android/i);
230
+ }), H = P(function() {
231
+ return M(/Firefox/i);
232
+ });
233
+ //#endregion
234
+ //#region node_modules/react-aria/dist/private/utils/isVirtualEvent.mjs
235
+ function U(e) {
236
+ return e.pointerType === "" && e.isTrusted ? !0 : V() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
237
+ }
238
+ function W(e) {
239
+ return !V() && e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
240
+ }
241
+ //#endregion
242
+ //#region node_modules/react-aria/dist/private/utils/openLink.mjs
243
+ function G(e, t, n = !0) {
244
+ let { metaKey: r, ctrlKey: a, altKey: o, shiftKey: s } = t;
245
+ H() && window.event?.type?.startsWith("key") && e.target === "_blank" && (F() ? r = !0 : a = !0);
246
+ let c = z() && F() && !L() && process.env.NODE_ENV !== "test" ? new KeyboardEvent("keydown", {
247
+ keyIdentifier: "Enter",
248
+ metaKey: r,
249
+ ctrlKey: a,
250
+ altKey: o,
251
+ shiftKey: s
252
+ }) : new MouseEvent("click", {
253
+ metaKey: r,
254
+ ctrlKey: a,
255
+ altKey: o,
256
+ shiftKey: s,
257
+ detail: 1,
258
+ bubbles: !0,
259
+ cancelable: !0
260
+ });
261
+ G.isOpening = n, i(e), e.dispatchEvent(c), G.isOpening = !1;
262
+ }
263
+ G.isOpening = !1;
264
+ //#endregion
265
+ //#region node_modules/react-aria/dist/private/utils/useGlobalListeners.mjs
266
+ function K() {
267
+ let e = r(/* @__PURE__ */ new Map()), i = t((t, n, r, i) => {
268
+ let a = i?.once ? (...t) => {
269
+ e.current.delete(r), r(...t);
270
+ } : r;
271
+ e.current.set(r, {
272
+ type: n,
273
+ eventTarget: t,
274
+ fn: a,
275
+ options: i
276
+ }), t.addEventListener(n, a, i);
277
+ }, []), a = t((t, n, r, i) => {
278
+ let a = e.current.get(r)?.fn || r;
279
+ t.removeEventListener(n, a, i), e.current.delete(r);
280
+ }, []), o = t(() => {
281
+ e.current.forEach((e, t) => {
282
+ a(e.eventTarget, e.type, t, e.options);
283
+ });
284
+ }, [a]);
285
+ return n(() => o, [o]), {
286
+ addGlobalListener: i,
287
+ removeGlobalListener: a,
288
+ removeAllGlobalListeners: o
289
+ };
290
+ }
291
+ //#endregion
292
+ export { u as _, F as a, k as c, A as d, E as f, l as g, _ as h, U as i, O as l, g as m, G as n, R as o, h as p, W as r, D as s, K as t, j as u, i as v };
293
+
294
+ //# sourceMappingURL=useGlobalListeners.map