@adgytec/adgytec-web-ui-components 2.1.4 → 2.1.6
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/assets/NavigationScrollContainer.css +1 -1
- package/dist/assets/core9.css +1 -1
- package/dist/chunks/Input2 +94 -94
- package/dist/chunks/Input2.map +1 -1
- package/dist/chunks/NavigationScrollContainer +1 -1
- package/dist/chunks/NavigationScrollContainer.map +1 -1
- package/dist/chunks/core8 +3 -3
- package/dist/chunks/core8.map +1 -1
- package/dist/chunks/useGlobalListeners +294 -0
- package/dist/chunks/useGlobalListeners.map +1 -0
- package/dist/chunks/useHover +86 -86
- package/dist/chunks/usePress +282 -568
- package/dist/chunks/usePress.map +1 -1
- package/dist/components/Input/TextArea/index.js +1 -1
- package/dist/components/Input/TextArea/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer adgytec.comps{.
|
|
1
|
+
@layer adgytec.comps{._container_1tvqz_2{padding-inline:var(--md-sys-layout-space-16);gap:var(--_md-navigation-items-gap);padding-block:calc(6 * var(--dp,1px));align-content:start;display:grid;overflow-y:auto}}
|
package/dist/assets/core9.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer adgytec.comps{.
|
|
1
|
+
@layer adgytec.comps{._navigation_157wr_9{--_md-navigation-background:var(--md-navigation-background,var(--md-sys-color-surface));--_md-navigation-drawer-background:var(--md-navigation-drawer-background,var(--md-sys-color-surface-container));--_background:var(--_md-navigation-background);background-color:var(--_background);border-radius:inherit;gap:calc(10 * var(--dp,1px));padding-block:var(--md-sys-layout-space-16);grid-template-rows:1fr;display:grid;position:absolute;inset:0}._navigation_157wr_9[data-modal]{--_background:var(--_md-navigation-drawer-background)}._navigation_157wr_9[data-header]{grid-template-rows:auto 1fr}._navigation_157wr_9[data-sub-nav]{opacity:0;transition:opacity var(--md-sys-motion-expressive-fast-effects) var(--md-sys-motion-expressive-fast-effects-duration), translate var(--md-sys-motion-expressive-fast-effects) var(--md-sys-motion-expressive-fast-effects-duration);translate:-100%}@media (prefers-reduced-motion){._navigation_157wr_9[data-sub-nav]{transition:none}}._navigation_157wr_9[data-sub-nav][data-status=entered]{opacity:1;translate:0}._nav-header_157wr_62{align-items:center;gap:var(--md-sys-layout-space-8);padding-inline-start:var(--md-sys-layout-space-32);padding-inline-end:var(--md-sys-layout-space-24);display:flex}._nav-header_157wr_62>[data-close-button]{margin-inline-start:auto}._sub-nav-header_157wr_76{align-items:center;gap:var(--md-sys-layout-space-8);padding-inline-start:var(--md-sys-layout-space-24);padding-inline-end:var(--md-sys-layout-space-32);display:flex}}
|
package/dist/chunks/Input2
CHANGED
|
@@ -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 {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import v from "
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
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
|
|
18
|
-
let 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
|
|
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
|
|
38
|
-
className: (e) =>
|
|
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
|
|
48
|
-
return !
|
|
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
|
|
56
|
-
let
|
|
57
|
-
value:
|
|
58
|
-
defaultValue:
|
|
59
|
-
onChange:
|
|
60
|
-
}), { isFocused:
|
|
61
|
-
|
|
62
|
-
|
|
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__ */
|
|
67
|
-
className: (e) =>
|
|
68
|
-
maxLength:
|
|
69
|
-
value:
|
|
70
|
-
defaultValue:
|
|
71
|
-
onChange:
|
|
72
|
-
...
|
|
73
|
-
...
|
|
74
|
-
children: ({ isDisabled:
|
|
75
|
-
let
|
|
76
|
-
...
|
|
77
|
-
"data-hovered":
|
|
78
|
-
"data-focused":
|
|
79
|
-
"data-focus-visible":
|
|
80
|
-
"data-disabled":
|
|
81
|
-
"data-invalid":
|
|
82
|
-
}, m =
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
n && /* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
93
|
-
icon:
|
|
92
|
+
M && /* @__PURE__ */ w(t, {
|
|
93
|
+
icon: M,
|
|
94
94
|
size: 24
|
|
95
95
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
className:
|
|
96
|
+
/* @__PURE__ */ T("span", {
|
|
97
|
+
className: _(o, e.bodyLarge),
|
|
98
98
|
children: [
|
|
99
|
-
|
|
100
|
-
isDisabled:
|
|
101
|
-
isInvalid:
|
|
102
|
-
}) :
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
ref:
|
|
105
|
-
className:
|
|
106
|
-
...
|
|
107
|
-
placeholder:
|
|
108
|
-
dir:
|
|
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
|
-
|
|
112
|
-
isDisabled:
|
|
113
|
-
isInvalid:
|
|
114
|
-
}) :
|
|
111
|
+
A && typeof A == "function" ? A({
|
|
112
|
+
isDisabled: s,
|
|
113
|
+
isInvalid: u
|
|
114
|
+
}) : A
|
|
115
115
|
]
|
|
116
116
|
}),
|
|
117
|
-
|
|
118
|
-
isDisabled:
|
|
119
|
-
isInvalid:
|
|
120
|
-
}) :
|
|
121
|
-
node:
|
|
122
|
-
isDisabled:
|
|
123
|
-
isInvalid:
|
|
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__ */
|
|
128
|
-
...
|
|
129
|
-
className:
|
|
130
|
-
children: [/* @__PURE__ */
|
|
131
|
-
count:
|
|
132
|
-
maxLength:
|
|
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 &&
|
|
136
|
-
...
|
|
137
|
-
className:
|
|
138
|
-
children: [/* @__PURE__ */
|
|
139
|
-
count:
|
|
140
|
-
maxLength:
|
|
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 || !
|
|
144
|
-
className:
|
|
145
|
-
children:
|
|
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 {
|
|
152
|
+
export { A as n, M as t };
|
|
153
153
|
|
|
154
154
|
//# sourceMappingURL=Input2.map
|
package/dist/chunks/Input2.map
CHANGED
|
@@ -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>\n );\n};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;AAaA,SAAS,EAA0C,GAAK;CACpD,IAAM,IAAaA,EAAe,IAAI,GAChC,IAAiBA,EAAe,KAAA,CAAS,GACzC,IAAgBC,GAAqB,MAAW;EAClD,IAAI,OAAO,KAAQ,YAAY;GAC3B,IAAM,IAAc,GACd,IAAa,EAAY,CAAQ;GACvC,aAAW;IACP,AAAI,OAAO,KAAe,aAAY,EAAW,IAC5C,EAAY,IAAI;GACzB;EACJ,OAAO,IAAI,GAEP,OADA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,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_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;AAaA,SAAS,EAA0C,GAAK;CACpD,IAAM,IAAaA,EAAe,IAAI,GAChC,IAAiBA,EAAe,KAAA,CAAS,GACzC,IAAgBC,GAAqB,MAAW;EAClD,IAAI,OAAO,KAAQ,YAAY;GAC3B,IAAM,IAAc,GACd,IAAa,EAAY,CAAQ;GACvC,aAAW;IACP,AAAI,OAAO,KAAe,aAAY,EAAW,IAC5C,EAAY,IAAI;GACzB;EACJ,OAAO,IAAI,GAEP,OADA,EAAI,UAAU,S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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"}
|
|
@@ -4,7 +4,7 @@ import r from "clsx";
|
|
|
4
4
|
import { useLayoutEffect as i } from "react";
|
|
5
5
|
import { jsx as a } from "react/jsx-runtime";
|
|
6
6
|
import { useObjectRef as o } from "react-aria";
|
|
7
|
-
import '../assets/NavigationScrollContainer.css';var s = { container: "
|
|
7
|
+
import '../assets/NavigationScrollContainer.css';var s = { container: "_container_1tvqz_2" }, c = ({ ref: c, className: l, ...u }) => {
|
|
8
8
|
let d = o(c), { registerNavigationContainer: f, saveNavigationScrollTopProgress: p } = t(), { id: m } = n();
|
|
9
9
|
return i(() => {
|
|
10
10
|
let e = d.current;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationScrollContainer","names":[],"sources":["../../src/components/Navigation/NavigationScrollContainer/navigationScrollContainer.module.css","../../src/components/Navigation/NavigationScrollContainer/NavigationScrollContainer.tsx"],"sourcesContent":["@layer adgytec.comps {\n .container {\n padding-inline: var(--md-sys-layout-space-16);\n overflow-y: auto;\n\n display: grid;\n gap: var(--_md-navigation-items-gap);\n align-content: start;\n }\n}\n","import clsx from \"clsx\";\nimport { useLayoutEffect } from \"react\";\nimport { useObjectRef } from \"react-aria\";\nimport { getScrollProgress } from \"@/utils\";\nimport { useNavigationInfo } from \"../core\";\nimport { useNavigationState } from \"../NavigationState\";\nimport styles from \"./navigationScrollContainer.module.css\";\n\nexport const NavigationScrollContainer: React.FC<\n React.ComponentPropsWithRef<\"div\">\n> = ({ ref, className, ...props }) => {\n const scrollContainerRef = useObjectRef(ref);\n\n const { registerNavigationContainer, saveNavigationScrollTopProgress } =\n useNavigationState();\n const { id } = useNavigationInfo();\n\n useLayoutEffect(() => {\n const container = scrollContainerRef.current;\n if (!container) {\n return;\n }\n\n return registerNavigationContainer(id, container);\n }, [scrollContainerRef, id, registerNavigationContainer]);\n\n return (\n <div\n ref={scrollContainerRef}\n onScroll={(e) => {\n saveNavigationScrollTopProgress(\n id,\n getScrollProgress({\n scrollHeight: e.currentTarget.scrollHeight,\n clientHeight: e.currentTarget.clientHeight,\n scrollTop: e.currentTarget.scrollTop,\n })\n );\n }}\n className={clsx(styles[\"container\"], className)}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;6CCQa,KAER,EAAE,QAAK,cAAW,GAAG,QAAY;CAClC,IAAM,IAAqB,EAAa,CAAG,GAErC,EAAE,gCAA6B,uCACjC,EAAmB,GACjB,EAAE,UAAO,EAAkB;CAWjC,OATA,QAAsB;EAClB,IAAM,IAAY,EAAmB;EAChC,OAIL,OAAO,EAA4B,GAAI,CAAS;CACpD,GAAG;EAAC;EAAoB;EAAI;CAA2B,CAAC,GAGpD,kBAAC,OAAD;EACI,KAAK;EACL,WAAW,MAAM;GACb,EACI,GACA,EAAkB;IACd,cAAc,EAAE,cAAc;IAC9B,cAAc,EAAE,cAAc;IAC9B,WAAW,EAAE,cAAc;GAC/B,CAAC,CACL;EACJ;EACA,WAAW,EAAK,EAAO,WAAc,CAAS;EAC9C,GAAI;CACP,CAAA;AAET"}
|
|
1
|
+
{"version":3,"file":"NavigationScrollContainer","names":[],"sources":["../../src/components/Navigation/NavigationScrollContainer/navigationScrollContainer.module.css","../../src/components/Navigation/NavigationScrollContainer/NavigationScrollContainer.tsx"],"sourcesContent":["@layer adgytec.comps {\n .container {\n padding-inline: var(--md-sys-layout-space-16);\n overflow-y: auto;\n\n display: grid;\n gap: var(--_md-navigation-items-gap);\n align-content: start;\n\n /* 2dp for focus outline offset and 3dp for focus outline width + 1dp to prevent clipping */\n padding-block: calc(6 * var(--dp, 1px));\n }\n}\n","import clsx from \"clsx\";\nimport { useLayoutEffect } from \"react\";\nimport { useObjectRef } from \"react-aria\";\nimport { getScrollProgress } from \"@/utils\";\nimport { useNavigationInfo } from \"../core\";\nimport { useNavigationState } from \"../NavigationState\";\nimport styles from \"./navigationScrollContainer.module.css\";\n\nexport const NavigationScrollContainer: React.FC<\n React.ComponentPropsWithRef<\"div\">\n> = ({ ref, className, ...props }) => {\n const scrollContainerRef = useObjectRef(ref);\n\n const { registerNavigationContainer, saveNavigationScrollTopProgress } =\n useNavigationState();\n const { id } = useNavigationInfo();\n\n useLayoutEffect(() => {\n const container = scrollContainerRef.current;\n if (!container) {\n return;\n }\n\n return registerNavigationContainer(id, container);\n }, [scrollContainerRef, id, registerNavigationContainer]);\n\n return (\n <div\n ref={scrollContainerRef}\n onScroll={(e) => {\n saveNavigationScrollTopProgress(\n id,\n getScrollProgress({\n scrollHeight: e.currentTarget.scrollHeight,\n clientHeight: e.currentTarget.clientHeight,\n scrollTop: e.currentTarget.scrollTop,\n })\n );\n }}\n className={clsx(styles[\"container\"], className)}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;6CCQa,KAER,EAAE,QAAK,cAAW,GAAG,QAAY;CAClC,IAAM,IAAqB,EAAa,CAAG,GAErC,EAAE,gCAA6B,uCACjC,EAAmB,GACjB,EAAE,UAAO,EAAkB;CAWjC,OATA,QAAsB;EAClB,IAAM,IAAY,EAAmB;EAChC,OAIL,OAAO,EAA4B,GAAI,CAAS;CACpD,GAAG;EAAC;EAAoB;EAAI;CAA2B,CAAC,GAGpD,kBAAC,OAAD;EACI,KAAK;EACL,WAAW,MAAM;GACb,EACI,GACA,EAAkB;IACd,cAAc,EAAE,cAAc;IAC9B,cAAc,EAAE,cAAc;IAC9B,WAAW,EAAE,cAAc;GAC/B,CAAC,CACL;EACJ;EACA,WAAW,EAAK,EAAO,WAAc,CAAS;EAC9C,GAAI;CACP,CAAA;AAET"}
|
package/dist/chunks/core8
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createContext as e, useContext as t } from "react";
|
|
2
2
|
import '../assets/core9.css';var n = {
|
|
3
|
-
navigation: "
|
|
4
|
-
"nav-header": "_nav-
|
|
5
|
-
"sub-nav-header": "_sub-nav-
|
|
3
|
+
navigation: "_navigation_157wr_9",
|
|
4
|
+
"nav-header": "_nav-header_157wr_62",
|
|
5
|
+
"sub-nav-header": "_sub-nav-header_157wr_76"
|
|
6
6
|
}, r = n.navigation, i = n["nav-header"], a = n["sub-nav-header"], o = e(null);
|
|
7
7
|
function s() {
|
|
8
8
|
let e = t(o);
|
package/dist/chunks/core8.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core8","names":[],"sources":["../../src/components/Navigation/core/navigation.module.css","../../src/components/Navigation/core/navigation.ts","../../src/components/Navigation/core/navigationInfo.ts","../../src/components/Navigation/core/navLabelContext.ts"],"sourcesContent":["/* configurable tokens\n*\n* --md-navigation-background\n* --md-navigation-drawer-background\n*\n* configurable tokens end */\n\n@layer adgytec.comps {\n .navigation {\n --_md-navigation-background: var(\n --md-navigation-background,\n var(--md-sys-color-surface)\n );\n --_md-navigation-drawer-background: var(\n --md-navigation-drawer-background,\n var(--md-sys-color-surface-container)\n );\n\n --_background: var(--_md-navigation-background);\n\n background-color: var(--_background);\n\n position: absolute;\n inset: 0;\n border-radius: inherit;\n\n display: grid;\n grid-template-rows: 1fr;\n gap: var(--
|
|
1
|
+
{"version":3,"file":"core8","names":[],"sources":["../../src/components/Navigation/core/navigation.module.css","../../src/components/Navigation/core/navigation.ts","../../src/components/Navigation/core/navigationInfo.ts","../../src/components/Navigation/core/navLabelContext.ts"],"sourcesContent":["/* configurable tokens\n*\n* --md-navigation-background\n* --md-navigation-drawer-background\n*\n* configurable tokens end */\n\n@layer adgytec.comps {\n .navigation {\n --_md-navigation-background: var(\n --md-navigation-background,\n var(--md-sys-color-surface)\n );\n --_md-navigation-drawer-background: var(\n --md-navigation-drawer-background,\n var(--md-sys-color-surface-container)\n );\n\n --_background: var(--_md-navigation-background);\n\n background-color: var(--_background);\n\n position: absolute;\n inset: 0;\n border-radius: inherit;\n\n display: grid;\n grid-template-rows: 1fr;\n gap: calc(10 * var(--dp, 1px));\n\n padding-block: var(--md-sys-layout-space-16);\n\n &[data-modal] {\n --_background: var(--_md-navigation-drawer-background);\n }\n\n &[data-header] {\n grid-template-rows: auto 1fr;\n }\n }\n\n .navigation[data-sub-nav] {\n opacity: 0;\n translate: -100%;\n\n transition:\n opacity var(--md-sys-motion-expressive-fast-effects)\n var(--md-sys-motion-expressive-fast-effects-duration),\n translate var(--md-sys-motion-expressive-fast-effects)\n var(--md-sys-motion-expressive-fast-effects-duration);\n\n @media (prefers-reduced-motion) {\n transition: none;\n }\n\n &[data-status=\"entered\"] {\n opacity: 1;\n translate: 0;\n }\n }\n\n .nav-header {\n display: flex;\n align-items: center;\n\n gap: var(--md-sys-layout-space-8);\n\n padding-inline-start: var(--md-sys-layout-space-32);\n padding-inline-end: var(--md-sys-layout-space-24);\n\n > [data-close-button] {\n margin-inline-start: auto;\n }\n }\n\n .sub-nav-header {\n display: flex;\n align-items: center;\n\n gap: var(--md-sys-layout-space-8);\n\n padding-inline-start: var(--md-sys-layout-space-24);\n padding-inline-end: var(--md-sys-layout-space-32);\n }\n}\n","import styles from \"./navigation.module.css\";\n\nexport const NavigationStyles = styles[\"navigation\"];\n\nexport const NavigationHeaderStyles = styles[\"nav-header\"];\nexport const SubNavigationHeaderStyles = styles[\"sub-nav-header\"];\n","import { createContext, useContext } from \"react\";\n\nexport type NavigationInfoContextType = {\n id: string;\n depth: number;\n};\n\nexport const NavigationInfoContext =\n createContext<NavigationInfoContextType | null>(null);\n\nexport function useNavigationInfo() {\n const ctx = useContext(NavigationInfoContext);\n if (ctx == null) {\n throw new Error(\n \"Missing navigation information. Ensure this component is rendered within a Navigation or SubNavigation component.\"\n );\n }\n\n return ctx;\n}\n","import { createContext, type ReactNode } from \"react\";\n\nexport type NavLabelContextType = ReactNode;\nexport const NavLabelContext = createContext<NavLabelContextType>(undefined);\n"],"mappings":";;;;;GCEa,IAAmB,EAAO,YAE1B,IAAyB,EAAO,eAChC,IAA4B,EAAO,mBCEnC,IACT,EAAgD,IAAI;AAExD,SAAgB,IAAoB;CAChC,IAAM,IAAM,EAAW,CAAqB;CAC5C,IAAI,KAAO,MACP,MAAU,MACN,mHACJ;CAGJ,OAAO;AACX;;;AChBA,IAAa,IAAkB,EAAmC,KAAA,CAAS"}
|