@tcn/ui 0.11.0 → 0.12.0
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/feedback/index.d.ts +1 -0
- package/dist/feedback/index.d.ts.map +1 -1
- package/dist/feedback/index.js +6 -4
- package/dist/feedback/index.js.map +1 -1
- package/dist/feedback/progress/progress.d.ts +7 -0
- package/dist/feedback/progress/progress.d.ts.map +1 -0
- package/dist/feedback/progress/progress.js +38 -0
- package/dist/feedback/progress/progress.js.map +1 -0
- package/dist/feedback/progress/progress_bar.d.ts +0 -1
- package/dist/feedback/progress/progress_bar.d.ts.map +1 -1
- package/dist/feedback/progress/progress_bar.js +6 -46
- package/dist/feedback/progress/progress_bar.js.map +1 -1
- package/dist/form/field/common/status_input/status_input.js +4 -3
- package/dist/form/field/common/status_input/status_input.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.d.ts.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +145 -127
- package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
- package/dist/overlay/frame/frame.d.ts.map +1 -1
- package/dist/overlay/frame/frame.js +65 -65
- package/dist/overlay/frame/frame.js.map +1 -1
- package/dist/progress_bar-CPP0Jyv-.js +38 -0
- package/dist/progress_bar-CPP0Jyv-.js.map +1 -0
- package/dist/progress_bar.css +1 -1
- package/dist/stacks/box/bottom_resize_handle.d.ts +2 -8
- package/dist/stacks/box/bottom_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
- package/dist/stacks/box/box.d.ts +2 -2
- package/dist/stacks/box/box.d.ts.map +1 -1
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/box/end_resize_handle.d.ts +2 -8
- package/dist/stacks/box/end_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/end_resize_handle.js.map +1 -1
- package/dist/stacks/box/left_resize_handle.d.ts +2 -8
- package/dist/stacks/box/left_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/left_resize_handle.js.map +1 -1
- package/dist/stacks/box/resize_handlers.d.ts +3 -2
- package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
- package/dist/stacks/box/resize_handlers.js +36 -32
- package/dist/stacks/box/resize_handlers.js.map +1 -1
- package/dist/stacks/box/right_resize_handle.d.ts +2 -8
- package/dist/stacks/box/right_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/right_resize_handle.js.map +1 -1
- package/dist/stacks/box/start_resize_handle.d.ts +2 -8
- package/dist/stacks/box/start_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/start_resize_handle.js.map +1 -1
- package/dist/stacks/box/top_resize_handle.d.ts +2 -8
- package/dist/stacks/box/top_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/top_resize_handle.js.map +1 -1
- package/dist/stacks/box/types.d.ts +18 -0
- package/dist/stacks/box/types.d.ts.map +1 -0
- package/dist/stacks/h_collapsible_box.js +25 -25
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/index.d.ts +1 -0
- package/dist/stacks/index.d.ts.map +1 -1
- package/dist/stacks/v_collapsible_box.js +25 -25
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/surfaces/modal/modal.d.ts +3 -4
- package/dist/surfaces/modal/modal.d.ts.map +1 -1
- package/dist/surfaces/modal/modal.js +10 -8
- package/dist/surfaces/modal/modal.js.map +1 -1
- package/dist/surfaces/window/window.d.ts +3 -4
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/surfaces/window/window.js +20 -18
- package/dist/surfaces/window/window.js.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +3 -1
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/package.json +1 -1
- package/src/feedback/index.ts +1 -0
- package/src/feedback/progress/progress.module.css +5 -0
- package/src/feedback/progress/progress.stories.tsx +48 -0
- package/src/feedback/progress/progress.tsx +39 -0
- package/src/feedback/progress/progress_bar.module.css +4 -28
- package/src/feedback/progress/progress_bar.stories.tsx +1 -1
- package/src/feedback/progress/progress_bar.tsx +14 -26
- package/src/inputs/select/select.stories.tsx +23 -2
- package/src/inputs/suggestions/suggestion_list.tsx +58 -39
- package/src/overlay/frame/frame.tsx +10 -12
- package/src/stacks/box/bottom_resize_handle.tsx +2 -13
- package/src/stacks/box/box.tsx +4 -2
- package/src/stacks/box/end_resize_handle.tsx +3 -13
- package/src/stacks/box/left_resize_handle.tsx +3 -13
- package/src/stacks/box/resize_handlers.ts +22 -18
- package/src/stacks/box/right_resize_handle.tsx +2 -13
- package/src/stacks/box/start_resize_handle.tsx +3 -13
- package/src/stacks/box/top_resize_handle.tsx +3 -12
- package/src/stacks/box/types.ts +44 -0
- package/src/stacks/h_collapsible_box.tsx +2 -2
- package/src/stacks/index.ts +1 -0
- package/src/stacks/v_collapsible_box.tsx +2 -2
- package/src/surfaces/modal/modal.tsx +6 -4
- package/src/surfaces/window/window.stories.tsx +9 -1
- package/src/surfaces/window/window.tsx +6 -4
- package/src/themes/themes/ergo/ergo_theme.css +3 -1
package/dist/feedback/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feedback/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feedback/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC"}
|
package/dist/feedback/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Loading as e } from "./loading/loading.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { P as a } from "../progress_bar-CPP0Jyv-.js";
|
|
3
|
+
import { Progress as m } from "./progress/progress.js";
|
|
4
|
+
import { Lazy as t } from "./lazy/lazy.js";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
t as Lazy,
|
|
6
7
|
e as Loading,
|
|
7
|
-
|
|
8
|
+
m as Progress,
|
|
9
|
+
a as ProgressBar
|
|
8
10
|
};
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React, HTMLAttributes } from 'react';
|
|
2
|
+
export interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
message: string;
|
|
4
|
+
value: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/feedback/progress/progress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAU9C,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,QAAQ,sFAuBnB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import c from "react";
|
|
3
|
+
import { BodyText as e } from "../../typography/body_text/body_text.js";
|
|
4
|
+
import "../../typography/callout/callout.js";
|
|
5
|
+
import "../../typography/caption/caption.js";
|
|
6
|
+
import "../../typography/footnote/footnote.js";
|
|
7
|
+
import "../../typography/headline/headline.js";
|
|
8
|
+
import "../../typography/subheadline/subheadline.js";
|
|
9
|
+
import "../../typography/title/title.js";
|
|
10
|
+
import { HStack as a } from "../../stacks/h_stack.js";
|
|
11
|
+
import { Spacer as s } from "../../stacks/spacer.js";
|
|
12
|
+
import { VStack as f } from "../../stacks/v_stack.js";
|
|
13
|
+
import d from "clsx";
|
|
14
|
+
import { P as l, s as g } from "../../progress_bar-CPP0Jyv-.js";
|
|
15
|
+
const H = c.forwardRef(function({ message: i, value: o, ...m }, p) {
|
|
16
|
+
const n = `${(o * 100).toFixed(0)}%`;
|
|
17
|
+
return /* @__PURE__ */ t(
|
|
18
|
+
f,
|
|
19
|
+
{
|
|
20
|
+
ref: p,
|
|
21
|
+
className: d(g["progress-container"], "tcn-progress-container"),
|
|
22
|
+
...m,
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ t(a, { height: "auto", vAlign: "end", children: [
|
|
25
|
+
/* @__PURE__ */ r(e, { children: i }),
|
|
26
|
+
/* @__PURE__ */ r(s, {}),
|
|
27
|
+
/* @__PURE__ */ r(s, { width: "8px" }),
|
|
28
|
+
/* @__PURE__ */ r(e, { size: "sm", style: { flexShrink: 0 }, children: n })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ r(l, { value: o })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
H as Progress
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sources":["../../../src/feedback/progress/progress.tsx"],"sourcesContent":["import React, { HTMLAttributes } from 'react';\nimport { BodyText } from '../../typography/index.js';\nimport { HStack } from '../../stacks/h_stack.js';\nimport { Spacer } from '../../stacks/spacer.js';\nimport { VStack } from '../../stacks/v_stack.js';\nimport clsx from 'clsx';\n\nimport styles from './progress_bar.module.css';\nimport { ProgressBar } from './progress_bar.js';\n\nexport interface ProgressProps extends HTMLAttributes<HTMLDivElement> {\n message: string;\n value: number;\n}\n\nexport const Progress = React.forwardRef(function Progress(\n { message, value, ...props }: ProgressProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const progressPercent = `${(value * 100).toFixed(0)}%`;\n\n return (\n <VStack\n ref={ref}\n className={clsx(styles['progress-container'], 'tcn-progress-container')}\n {...props}\n >\n <HStack height=\"auto\" vAlign=\"end\">\n <BodyText>{message}</BodyText>\n <Spacer />\n <Spacer width=\"8px\" />\n <BodyText size=\"sm\" style={{ flexShrink: 0 }}>\n {progressPercent}\n </BodyText>\n </HStack>\n <ProgressBar value={value} />\n </VStack>\n );\n});\n"],"names":["Progress","React","message","value","props","ref","progressPercent","jsxs","VStack","clsx","styles","HStack","jsx","BodyText","Spacer","ProgressBar"],"mappings":";;;;;;;;;;;;;;AAeO,MAAMA,IAAWC,EAAM,WAAW,SACvC,EAAE,SAAAC,GAAS,OAAAC,GAAO,GAAGC,EAAA,GACrBC,GACA;AACA,QAAMC,IAAkB,IAAIH,IAAQ,KAAK,QAAQ,CAAC,CAAC;AAEnD,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,WAAWI,EAAKC,EAAO,oBAAoB,GAAG,wBAAwB;AAAA,MACrE,GAAGN;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAG,EAACI,GAAA,EAAO,QAAO,QAAO,QAAO,OAC3B,UAAA;AAAA,UAAA,gBAAAC,EAACC,KAAU,UAAAX,EAAA,CAAQ;AAAA,4BAClBY,GAAA,EAAO;AAAA,UACR,gBAAAF,EAACE,GAAA,EAAO,OAAM,MAAA,CAAM;AAAA,UACpB,gBAAAF,EAACC,KAAS,MAAK,MAAK,OAAO,EAAE,YAAY,EAAA,GACtC,UAAAP,EAAA,CACH;AAAA,QAAA,GACF;AAAA,QACA,gBAAAM,EAACG,KAAY,OAAAZ,EAAA,CAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGjC,CAAC;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as React, HTMLAttributes } from 'react';
|
|
2
2
|
export interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
message: string;
|
|
4
3
|
value: number;
|
|
5
4
|
}
|
|
6
5
|
export declare const ProgressBar: React.ForwardRefExoticComponent<ProgressBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress_bar.d.ts","sourceRoot":"","sources":["../../../src/feedback/progress/progress_bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"progress_bar.d.ts","sourceRoot":"","sources":["../../../src/feedback/progress/progress_bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAM9C,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,WAAW,yFAyBtB,CAAC"}
|
|
@@ -1,49 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
import "../../
|
|
6
|
-
import "../../typography/footnote/footnote.js";
|
|
7
|
-
import "../../typography/headline/headline.js";
|
|
8
|
-
import "../../typography/subheadline/subheadline.js";
|
|
9
|
-
import "../../typography/title/title.js";
|
|
10
|
-
import { HStack as l } from "../../stacks/h_stack.js";
|
|
11
|
-
import { Spacer as a } from "../../stacks/spacer.js";
|
|
12
|
-
import { VStack as d } from "../../stacks/v_stack.js";
|
|
13
|
-
import { ZStack as b } from "../../stacks/z_stack.js";
|
|
14
|
-
import f from "clsx";
|
|
15
|
-
import '../../progress_bar.css';const h = "_progress-bar-container_014b4d9", _ = "_progress-bar-background_9176cc0", x = "_progress-bar_057c33d", k = "_progress-bar-fill_00854f0", u = "_moveStripes_d219e85", s = { "progress-bar-container": h, "progress-bar-background": _, "progress-bar": x, "progress-bar-fill": k, moveStripes: u }, T = m.forwardRef(function({ message: i, value: p, ...c }, n) {
|
|
16
|
-
const o = `${(p * 100).toFixed(0)}%`, g = { "--progress-percentage": o };
|
|
17
|
-
return /* @__PURE__ */ e(
|
|
18
|
-
d,
|
|
19
|
-
{
|
|
20
|
-
ref: n,
|
|
21
|
-
className: f(s["progress-bar-container"], "tcn-progress-bar"),
|
|
22
|
-
...c,
|
|
23
|
-
children: [
|
|
24
|
-
/* @__PURE__ */ e(l, { height: "auto", vAlign: "end", children: [
|
|
25
|
-
/* @__PURE__ */ r(t, { children: i }),
|
|
26
|
-
/* @__PURE__ */ r(a, {}),
|
|
27
|
-
/* @__PURE__ */ r(a, { width: "8px" }),
|
|
28
|
-
/* @__PURE__ */ r(t, { size: "sm", style: { flexShrink: 0 }, children: o })
|
|
29
|
-
] }),
|
|
30
|
-
/* @__PURE__ */ e(b, { height: "8px", hAlign: "start", children: [
|
|
31
|
-
/* @__PURE__ */ r("div", { className: s["progress-bar-background"] }),
|
|
32
|
-
/* @__PURE__ */ r(
|
|
33
|
-
"div",
|
|
34
|
-
{
|
|
35
|
-
"data-finished": o === "100%",
|
|
36
|
-
style: g,
|
|
37
|
-
className: s["progress-bar-fill"]
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
/* @__PURE__ */ r("div", { className: s["progress-bar"] })
|
|
41
|
-
] })
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
});
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "../../stacks/z_stack.js";
|
|
4
|
+
import "clsx";
|
|
5
|
+
import { P as s } from "../../progress_bar-CPP0Jyv-.js";
|
|
46
6
|
export {
|
|
47
|
-
|
|
7
|
+
s as ProgressBar
|
|
48
8
|
};
|
|
49
9
|
//# sourceMappingURL=progress_bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress_bar.js","sources":[
|
|
1
|
+
{"version":3,"file":"progress_bar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -4,7 +4,8 @@ import { LockTwoIcon as f } from "@tcn/icons/lock_two_icon.js";
|
|
|
4
4
|
import { HStack as m } from "../../../../stacks/h_stack.js";
|
|
5
5
|
import p from "react";
|
|
6
6
|
import { Loading as g } from "../../../../feedback/loading/loading.js";
|
|
7
|
-
import "../../../../
|
|
7
|
+
import "../../../../progress_bar-CPP0Jyv-.js";
|
|
8
|
+
import "../../../../feedback/progress/progress.js";
|
|
8
9
|
import "@tcn/state";
|
|
9
10
|
import "../../../../stacks/v_stack.js";
|
|
10
11
|
import { clsx as o } from "clsx";
|
|
@@ -25,7 +26,7 @@ import '../../../../status_input.css';const A = "_field-error_6d015c9", x = "_fi
|
|
|
25
26
|
default:
|
|
26
27
|
return null;
|
|
27
28
|
}
|
|
28
|
-
},
|
|
29
|
+
}, y = p.forwardRef(function({ children: i, state: t = "default", className: s, ...l }, c) {
|
|
29
30
|
const d = t === "default" || t === "error";
|
|
30
31
|
return /* @__PURE__ */ a(
|
|
31
32
|
m,
|
|
@@ -51,6 +52,6 @@ import '../../../../status_input.css';const A = "_field-error_6d015c9", x = "_fi
|
|
|
51
52
|
});
|
|
52
53
|
export {
|
|
53
54
|
I as AdornmentMap,
|
|
54
|
-
|
|
55
|
+
y as FieldStatusInput
|
|
55
56
|
};
|
|
56
57
|
//# sourceMappingURL=status_input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status_input.js","sources":["../../../../../src/form/field/common/status_input/status_input.tsx"],"sourcesContent":["import { AlertTriangleIcon } from '@tcn/icons/alert_triangle_icon.js';\nimport { LockTwoIcon } from '@tcn/icons/lock_two_icon.js';\nimport { HStack } from '../../../../stacks/h_stack.js';\nimport type { HStackOwnProps } from '../../../../stacks/h_stack.js';\nimport type { WithDetailedHTMLProps } from '../../../../stacks/types/as.js';\nimport React from 'react';\nimport { Loading } from '../../../../feedback/index.js';\nimport { clsx } from 'clsx';\nimport styles from './status_input.module.css';\n\n/*\n TODO: I really want to make these themeable.\n The way we do that is simply put a div placeholder with\n a class that the theme can override. They can use svgs as \n backgrounds for icons. This would make it so the component\n library doesn't dictate the icon set used. \n*/\nconst LockedAdornment: React.FC = () => {\n return <LockTwoIcon className=\"tcn-field-lock\" size=\"lg\" />;\n};\n\nconst LoadingAdornment: React.FC = () => {\n return <Loading size=\"20px\" className=\"tcn-field-loader\" />;\n};\n\nconst ErroredAdornment: React.FC = () => {\n return (\n <AlertTriangleIcon\n className={clsx(styles['field-error'], 'tcn-field-error')}\n size=\"lg\"\n />\n );\n};\n\nexport const AdornmentMap: React.FC<{ state: StatusInputState }> = ({ state }) => {\n switch (state) {\n case 'locked':\n return <LockedAdornment />;\n case 'loading':\n return <LoadingAdornment />;\n case 'error':\n return <ErroredAdornment />;\n default:\n return null;\n }\n};\n\nexport type StatusInputState = 'locked' | 'loading' | 'error' | 'default';\nexport interface StatusInputOwnProps {\n children: React.ReactNode;\n state?: StatusInputState;\n}\n\nexport type StatusInputProps = WithDetailedHTMLProps<\n StatusInputOwnProps & HStackOwnProps,\n 'div'\n>;\n\nexport const FieldStatusInput = React.forwardRef(function StatusInput(\n { children: Control, state = 'default', className, ...props }: StatusInputProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const showControl = state === 'default' || state === 'error';\n\n return (\n <HStack\n ref={ref}\n data-state={state}\n className={clsx(\n 'tcn-field-status-input',\n styles['field-status-input'],\n className,\n 'tcn-field-status-input'\n )}\n vAlign=\"center\"\n hAlign=\"end\"\n gap=\"4px\"\n {...props}\n >\n {showControl && Control}\n <AdornmentMap state={state} />\n </HStack>\n );\n});\n"],"names":["LockedAdornment","jsx","LockTwoIcon","LoadingAdornment","Loading","ErroredAdornment","AlertTriangleIcon","clsx","styles","AdornmentMap","state","FieldStatusInput","React","Control","className","props","ref","showControl","jsxs","HStack"],"mappings":"
|
|
1
|
+
{"version":3,"file":"status_input.js","sources":["../../../../../src/form/field/common/status_input/status_input.tsx"],"sourcesContent":["import { AlertTriangleIcon } from '@tcn/icons/alert_triangle_icon.js';\nimport { LockTwoIcon } from '@tcn/icons/lock_two_icon.js';\nimport { HStack } from '../../../../stacks/h_stack.js';\nimport type { HStackOwnProps } from '../../../../stacks/h_stack.js';\nimport type { WithDetailedHTMLProps } from '../../../../stacks/types/as.js';\nimport React from 'react';\nimport { Loading } from '../../../../feedback/index.js';\nimport { clsx } from 'clsx';\nimport styles from './status_input.module.css';\n\n/*\n TODO: I really want to make these themeable.\n The way we do that is simply put a div placeholder with\n a class that the theme can override. They can use svgs as \n backgrounds for icons. This would make it so the component\n library doesn't dictate the icon set used. \n*/\nconst LockedAdornment: React.FC = () => {\n return <LockTwoIcon className=\"tcn-field-lock\" size=\"lg\" />;\n};\n\nconst LoadingAdornment: React.FC = () => {\n return <Loading size=\"20px\" className=\"tcn-field-loader\" />;\n};\n\nconst ErroredAdornment: React.FC = () => {\n return (\n <AlertTriangleIcon\n className={clsx(styles['field-error'], 'tcn-field-error')}\n size=\"lg\"\n />\n );\n};\n\nexport const AdornmentMap: React.FC<{ state: StatusInputState }> = ({ state }) => {\n switch (state) {\n case 'locked':\n return <LockedAdornment />;\n case 'loading':\n return <LoadingAdornment />;\n case 'error':\n return <ErroredAdornment />;\n default:\n return null;\n }\n};\n\nexport type StatusInputState = 'locked' | 'loading' | 'error' | 'default';\nexport interface StatusInputOwnProps {\n children: React.ReactNode;\n state?: StatusInputState;\n}\n\nexport type StatusInputProps = WithDetailedHTMLProps<\n StatusInputOwnProps & HStackOwnProps,\n 'div'\n>;\n\nexport const FieldStatusInput = React.forwardRef(function StatusInput(\n { children: Control, state = 'default', className, ...props }: StatusInputProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const showControl = state === 'default' || state === 'error';\n\n return (\n <HStack\n ref={ref}\n data-state={state}\n className={clsx(\n 'tcn-field-status-input',\n styles['field-status-input'],\n className,\n 'tcn-field-status-input'\n )}\n vAlign=\"center\"\n hAlign=\"end\"\n gap=\"4px\"\n {...props}\n >\n {showControl && Control}\n <AdornmentMap state={state} />\n </HStack>\n );\n});\n"],"names":["LockedAdornment","jsx","LockTwoIcon","LoadingAdornment","Loading","ErroredAdornment","AlertTriangleIcon","clsx","styles","AdornmentMap","state","FieldStatusInput","React","Control","className","props","ref","showControl","jsxs","HStack"],"mappings":";;;;;;;;;;;wHAiBMA,IAA4B,MACzB,gBAAAC,EAACC,GAAA,EAAY,WAAU,kBAAiB,MAAK,MAAK,GAGrDC,IAA6B,MAC1B,gBAAAF,EAACG,GAAA,EAAQ,MAAK,QAAO,WAAU,oBAAmB,GAGrDC,IAA6B,MAE/B,gBAAAJ;AAAA,EAACK;AAAA,EAAA;AAAA,IACC,WAAWC,EAAKC,EAAO,aAAa,GAAG,iBAAiB;AAAA,IACxD,MAAK;AAAA,EAAA;AAAA,GAKEC,IAAsD,CAAC,EAAE,OAAAC,QAAY;AAChF,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,+BAAQV,GAAA,EAAgB;AAAA,IAC1B,KAAK;AACH,+BAAQG,GAAA,EAAiB;AAAA,IAC3B,KAAK;AACH,+BAAQE,GAAA,EAAiB;AAAA,IAC3B;AACE,aAAO;AAAA,EAAA;AAEb,GAaaM,IAAmBC,EAAM,WAAW,SAC/C,EAAE,UAAUC,GAAS,OAAAH,IAAQ,WAAW,WAAAI,GAAW,GAAGC,EAAA,GACtDC,GACA;AACA,QAAMC,IAAcP,MAAU,aAAaA,MAAU;AAErD,SACE,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,cAAYN;AAAA,MACZ,WAAWH;AAAA,QACT;AAAA,QACAC,EAAO,oBAAoB;AAAA,QAC3BM;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,QAAO;AAAA,MACP,QAAO;AAAA,MACP,KAAI;AAAA,MACH,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAE,KAAeJ;AAAA,QAChB,gBAAAZ,EAACQ,KAAa,OAAAC,EAAA,CAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGlC,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion_list.d.ts","sourceRoot":"","sources":["../../../src/inputs/suggestions/suggestion_list.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAazE,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,OAAO,KACf,IAAI,CAAC;IACV,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,CACR,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,MAAM,GAAG,IAAI,EAClC,iBAAiB,EAAE,MAAM,GAAG,IAAI,KAC7B,IAAI,CAAC;CACX;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAU,EACV,kBAAkB,EAAE,WAAW,EAC/B,aAAa,EACb,aAAa,EACb,IAAY,EACZ,QAAQ,EACR,cAAc,EACd,mBAAwC,EACxC,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,eAAuB,EACvB,iBAAyB,EACzB,YAAmB,EACnB,GAAG,KAAK,EACT,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"suggestion_list.d.ts","sourceRoot":"","sources":["../../../src/inputs/suggestions/suggestion_list.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAazE,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,OAAO,KACf,IAAI,CAAC;IACV,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,CACR,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,MAAM,GAAG,IAAI,EAClC,iBAAiB,EAAE,MAAM,GAAG,IAAI,KAC7B,IAAI,CAAC;CACX;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAU,EACV,kBAAkB,EAAE,WAAW,EAC/B,aAAa,EACb,aAAa,EACb,IAAY,EACZ,QAAQ,EACR,cAAc,EACd,mBAAwC,EACxC,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,eAAuB,EACvB,iBAAyB,EACzB,YAAmB,EACnB,GAAG,KAAK,EACT,EAAE,mBAAmB,2CA4ZrB"}
|
|
@@ -1,110 +1,113 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { BodyText as
|
|
1
|
+
import { jsx as r, jsxs as j, Fragment as de } from "react/jsx-runtime";
|
|
2
|
+
import { BodyText as ge } from "../../typography/body_text/body_text.js";
|
|
3
3
|
import "../../typography/callout/callout.js";
|
|
4
4
|
import "../../typography/caption/caption.js";
|
|
5
5
|
import "../../typography/footnote/footnote.js";
|
|
6
6
|
import "../../typography/headline/headline.js";
|
|
7
7
|
import "../../typography/subheadline/subheadline.js";
|
|
8
8
|
import "../../typography/title/title.js";
|
|
9
|
-
import { VStack as
|
|
10
|
-
import { ZStack as
|
|
11
|
-
import { clsx as
|
|
12
|
-
import { Children as
|
|
9
|
+
import { VStack as q } from "../../stacks/v_stack.js";
|
|
10
|
+
import { ZStack as he } from "../../stacks/z_stack.js";
|
|
11
|
+
import { clsx as H } from "clsx";
|
|
12
|
+
import Z, { Children as me, isValidElement as we, useState as a, useRef as B, useLayoutEffect as h } from "react";
|
|
13
13
|
import "../../utils/click_away_listener.js";
|
|
14
|
-
import { FocusRedirect as
|
|
14
|
+
import { FocusRedirect as be } from "../../utils/focus_redirect.js";
|
|
15
15
|
import "../../utils/scroll_away_listener.js";
|
|
16
16
|
import "../../utils/hooks/use_resize_observer.js";
|
|
17
17
|
import "../../utils/dnd/context.js";
|
|
18
18
|
import "../../draggable.module-BgelQsuJ.js";
|
|
19
|
-
import { SuggestionItem as
|
|
20
|
-
import { Option as
|
|
19
|
+
import { SuggestionItem as xe } from "./suggestion_item.js";
|
|
20
|
+
import { Option as X } from "../options/option.js";
|
|
21
21
|
import "../../actions/button/base_button/base_button.js";
|
|
22
22
|
import "../../actions/button/button_group/button_group.js";
|
|
23
23
|
import "../../actions/button/slim_button/slim_button.js";
|
|
24
|
-
import { Button as
|
|
24
|
+
import { Button as ke } from "../../actions/button/button/button.js";
|
|
25
25
|
import "../../actions/button/select_group/select_group.js";
|
|
26
26
|
import "../../actions/button/select_group/single_select_group.js";
|
|
27
27
|
import "../../actions/toggle/toggle.js";
|
|
28
28
|
import { Popper as Le } from "../../overlay/popper/legacy/popper.js";
|
|
29
|
-
import '../../suggestion_list.css';const
|
|
30
|
-
function
|
|
31
|
-
value:
|
|
32
|
-
initialSearchValue:
|
|
33
|
-
scrollToValue:
|
|
29
|
+
import '../../suggestion_list.css';const ye = "_suggestion-list_711fb17", Se = "_input_a0df060", K = { "suggestion-list": ye, input: Se }, C = 50, Me = 50;
|
|
30
|
+
function Ye({
|
|
31
|
+
value: R = "",
|
|
32
|
+
initialSearchValue: E,
|
|
33
|
+
scrollToValue: m,
|
|
34
34
|
anchorElement: l,
|
|
35
|
-
open:
|
|
36
|
-
children:
|
|
37
|
-
onOptionSelect:
|
|
38
|
-
noSuggestionMessage:
|
|
39
|
-
onClose:
|
|
40
|
-
onChange:
|
|
41
|
-
onKeyUp:
|
|
42
|
-
onKeyDown:
|
|
43
|
-
trimCustomInput:
|
|
44
|
-
haveValueAsOption:
|
|
45
|
-
restoreFocus:
|
|
46
|
-
...
|
|
35
|
+
open: v = !1,
|
|
36
|
+
children: N,
|
|
37
|
+
onOptionSelect: w,
|
|
38
|
+
noSuggestionMessage: z = "-- No Matches --",
|
|
39
|
+
onClose: L,
|
|
40
|
+
onChange: O,
|
|
41
|
+
onKeyUp: T,
|
|
42
|
+
onKeyDown: U,
|
|
43
|
+
trimCustomInput: G = !1,
|
|
44
|
+
haveValueAsOption: P = !1,
|
|
45
|
+
restoreFocus: J = !0,
|
|
46
|
+
...Q
|
|
47
47
|
}) {
|
|
48
|
-
const
|
|
49
|
-
(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
const b = Z.useMemo(
|
|
49
|
+
() => me.toArray(N).filter(
|
|
50
|
+
(e) => we(e) && e.type === X
|
|
51
|
+
),
|
|
52
|
+
[N]
|
|
53
|
+
), [y, Y] = a(() => {
|
|
54
|
+
if (m != null) {
|
|
55
|
+
const e = b.findIndex((o) => o.props.value === m);
|
|
53
56
|
if (e !== -1)
|
|
54
57
|
return e;
|
|
55
58
|
}
|
|
56
59
|
return -1;
|
|
57
|
-
}),
|
|
58
|
-
() =>
|
|
59
|
-
), [
|
|
60
|
-
function
|
|
61
|
-
if (!
|
|
60
|
+
}), A = B(""), _ = B(!1), [ee, V] = a(C), [d, S] = a(y), [x, W] = a(R), c = B(null), [te, se] = a(b.length), [n, D] = a(
|
|
61
|
+
() => []
|
|
62
|
+
), [ne, oe] = a(), [ie, re] = a();
|
|
63
|
+
function le(e) {
|
|
64
|
+
if (!_.current)
|
|
62
65
|
return;
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
switch (
|
|
66
|
+
_.current = !1;
|
|
67
|
+
const o = e.key, t = e.currentTarget, s = A.current = o;
|
|
68
|
+
if (A.current = "", s)
|
|
69
|
+
switch (o) {
|
|
67
70
|
case "Enter": {
|
|
68
71
|
if (n[d] == null) {
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
72
|
+
const u = G ? t.value.trim() : t.value;
|
|
73
|
+
if (u === "")
|
|
71
74
|
return;
|
|
72
|
-
const
|
|
73
|
-
(
|
|
74
|
-
),
|
|
75
|
+
const k = u.toLocaleLowerCase(), g = b.find(
|
|
76
|
+
(F) => F.props.value.toLocaleLowerCase() === k || F.props.label != null && F.props.label.toLocaleLowerCase() === k
|
|
77
|
+
), p = g != null, $ = g?.props.label || u, f = g?.props.value || u;
|
|
75
78
|
requestAnimationFrame(() => {
|
|
76
|
-
|
|
77
|
-
pe,
|
|
79
|
+
w && w(
|
|
78
80
|
f,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
$,
|
|
82
|
+
p,
|
|
83
|
+
g?.props.obfuscate ?? !1
|
|
81
84
|
);
|
|
82
85
|
});
|
|
83
86
|
break;
|
|
84
87
|
}
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
88
|
+
const i = n[d].props;
|
|
89
|
+
if (i.disabled)
|
|
87
90
|
break;
|
|
88
91
|
requestAnimationFrame(() => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
w && w(
|
|
93
|
+
i.value,
|
|
94
|
+
i.label,
|
|
92
95
|
!0,
|
|
93
|
-
|
|
96
|
+
i.obfuscate ?? !1
|
|
94
97
|
);
|
|
95
98
|
});
|
|
96
99
|
break;
|
|
97
100
|
}
|
|
98
101
|
case "Escape": {
|
|
99
|
-
|
|
102
|
+
L && L(t.value, t.selectionStart, t.selectionEnd);
|
|
100
103
|
break;
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
|
-
|
|
106
|
+
T && T(e);
|
|
104
107
|
}
|
|
105
|
-
function
|
|
106
|
-
const
|
|
107
|
-
switch (
|
|
108
|
+
function ce(e) {
|
|
109
|
+
const o = e.key;
|
|
110
|
+
switch (A.current = o, _.current = !0, o) {
|
|
108
111
|
case "ArrowDown": {
|
|
109
112
|
let t = d + 1;
|
|
110
113
|
for (; t < n.length && n[t]?.props.disabled; )
|
|
@@ -114,7 +117,7 @@ function Qe({
|
|
|
114
117
|
t++;
|
|
115
118
|
t === n.length && (t = -1);
|
|
116
119
|
}
|
|
117
|
-
|
|
120
|
+
S(t), e.preventDefault();
|
|
118
121
|
break;
|
|
119
122
|
}
|
|
120
123
|
case "Tab": {
|
|
@@ -136,7 +139,7 @@ function Qe({
|
|
|
136
139
|
s--;
|
|
137
140
|
s === -1 && (s = -1);
|
|
138
141
|
}
|
|
139
|
-
|
|
142
|
+
S(s), e.preventDefault();
|
|
140
143
|
break;
|
|
141
144
|
}
|
|
142
145
|
case "ArrowUp": {
|
|
@@ -148,115 +151,130 @@ function Qe({
|
|
|
148
151
|
t--;
|
|
149
152
|
t === -1 && (t = -1);
|
|
150
153
|
}
|
|
151
|
-
|
|
154
|
+
S(t), e.preventDefault();
|
|
152
155
|
break;
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
|
-
|
|
158
|
+
U && U(e);
|
|
156
159
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
const M = Z.useCallback(
|
|
161
|
+
function(o, t) {
|
|
162
|
+
const s = b.filter((I) => {
|
|
163
|
+
const i = I.props, u = String(i.label).toLocaleLowerCase(), k = i.keywords?.map((f) => f.toLocaleLowerCase()) || [], g = String(i.value).toLocaleLowerCase(), p = o.toLocaleLowerCase();
|
|
164
|
+
return i.obfuscate ?? !1 ? u.includes(p) || k.some((f) => f.includes(p)) : u.includes(p) || k.some((f) => f.includes(p)) || g.includes(p);
|
|
165
|
+
});
|
|
166
|
+
return P && o.trim().length > 0 && !s.some((I) => I.props.value === o) && s.unshift(
|
|
167
|
+
/* @__PURE__ */ r(X, { value: o, label: o, keywords: [o], children: o }, "value")
|
|
168
|
+
), se(s.length), s.slice(0, t);
|
|
169
|
+
},
|
|
170
|
+
[b, P]
|
|
171
|
+
);
|
|
172
|
+
function ae() {
|
|
167
173
|
const e = c.current;
|
|
168
174
|
e?.focus();
|
|
169
175
|
}
|
|
170
|
-
function
|
|
176
|
+
function ue() {
|
|
171
177
|
const e = c.current;
|
|
172
|
-
e != null &&
|
|
178
|
+
e != null && L && L(e.value, e.selectionStart, e.selectionEnd);
|
|
173
179
|
}
|
|
174
|
-
function
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
const t =
|
|
178
|
-
|
|
180
|
+
function pe(e) {
|
|
181
|
+
const o = e.currentTarget;
|
|
182
|
+
V(C), W(e.target.value);
|
|
183
|
+
const t = M(o.value, C);
|
|
184
|
+
D(t), O && O(e.target.value);
|
|
179
185
|
}
|
|
180
|
-
function
|
|
181
|
-
const e =
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
|
|
186
|
+
function fe() {
|
|
187
|
+
const e = ee + Me;
|
|
188
|
+
V(e);
|
|
189
|
+
const o = M(x, e);
|
|
190
|
+
D(o);
|
|
185
191
|
}
|
|
186
|
-
return
|
|
192
|
+
return h(() => {
|
|
187
193
|
const e = c.current;
|
|
188
|
-
|
|
189
|
-
}, [
|
|
194
|
+
v && (e != null && e.value.length > 0 ? e.select() : e?.focus());
|
|
195
|
+
}, [v]), h(() => {
|
|
190
196
|
if (l != null) {
|
|
191
197
|
const e = l.getBoundingClientRect();
|
|
192
|
-
|
|
198
|
+
oe(`${e.width}px`), re(`${e.height}px`), c.current != null && l instanceof HTMLInputElement && (c.current.value = l.value, c.current.selectionStart = l.selectionStart, c.current.selectionEnd = l.selectionEnd);
|
|
193
199
|
}
|
|
194
|
-
}, [l]),
|
|
195
|
-
if (
|
|
200
|
+
}, [l]), h(() => {
|
|
201
|
+
if (m != null) {
|
|
196
202
|
const e = n.findIndex(
|
|
197
|
-
(
|
|
203
|
+
(o) => o.props.value === m
|
|
198
204
|
);
|
|
199
|
-
|
|
205
|
+
Y(e);
|
|
200
206
|
}
|
|
201
|
-
}, [n,
|
|
202
|
-
|
|
203
|
-
}, [
|
|
204
|
-
|
|
205
|
-
}, [
|
|
207
|
+
}, [n, m]), h(() => {
|
|
208
|
+
S(x === "" ? y : -1);
|
|
209
|
+
}, [x, y]), h(() => {
|
|
210
|
+
W(E ?? "");
|
|
211
|
+
}, [E]), h(() => {
|
|
212
|
+
const e = M(R, C);
|
|
213
|
+
D(e);
|
|
214
|
+
}, [R, M]), /* @__PURE__ */ r(
|
|
206
215
|
Le,
|
|
207
216
|
{
|
|
208
|
-
open:
|
|
217
|
+
open: v,
|
|
209
218
|
anchorElement: l,
|
|
210
|
-
onClose:
|
|
219
|
+
onClose: ue,
|
|
211
220
|
verticalAnchor: "top",
|
|
212
221
|
verticalOrigin: "top",
|
|
213
222
|
verticalOffset: -4,
|
|
214
|
-
restoreFocus:
|
|
215
|
-
children: /* @__PURE__ */
|
|
216
|
-
|
|
223
|
+
restoreFocus: J,
|
|
224
|
+
children: /* @__PURE__ */ j(
|
|
225
|
+
q,
|
|
217
226
|
{
|
|
218
|
-
minHeight: `calc(${
|
|
227
|
+
minHeight: `calc(${ie}, 8px)`,
|
|
219
228
|
maxHeight: "300px",
|
|
220
|
-
minWidth:
|
|
229
|
+
minWidth: ne,
|
|
221
230
|
width: "auto",
|
|
222
231
|
hAlign: "start",
|
|
223
|
-
className:
|
|
232
|
+
className: H(K["suggestion-list"], "tcn-suggestion-list"),
|
|
224
233
|
children: [
|
|
225
234
|
/* @__PURE__ */ r(
|
|
226
235
|
"input",
|
|
227
236
|
{
|
|
228
237
|
ref: c,
|
|
229
|
-
value:
|
|
230
|
-
onKeyUp:
|
|
231
|
-
onKeyDown:
|
|
232
|
-
onChange:
|
|
233
|
-
className:
|
|
234
|
-
...
|
|
238
|
+
value: x,
|
|
239
|
+
onKeyUp: le,
|
|
240
|
+
onKeyDown: ce,
|
|
241
|
+
onChange: pe,
|
|
242
|
+
className: H(K.input, "tcn-suggestion-list-search-input"),
|
|
243
|
+
...Q
|
|
235
244
|
},
|
|
236
245
|
-1
|
|
237
246
|
),
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
n.map((e,
|
|
240
|
-
|
|
247
|
+
/* @__PURE__ */ j(q, { children: [
|
|
248
|
+
n.map((e, o) => /* @__PURE__ */ r(
|
|
249
|
+
xe,
|
|
241
250
|
{
|
|
242
251
|
option: e,
|
|
243
|
-
isSelected:
|
|
244
|
-
isFocused:
|
|
245
|
-
onClick:
|
|
252
|
+
isSelected: o === y && x !== "",
|
|
253
|
+
isFocused: o === d,
|
|
254
|
+
onClick: w
|
|
246
255
|
},
|
|
247
|
-
|
|
256
|
+
o
|
|
248
257
|
)),
|
|
249
|
-
|
|
258
|
+
te > n.length && /* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(
|
|
259
|
+
ke,
|
|
260
|
+
{
|
|
261
|
+
marginBlock: "8px",
|
|
262
|
+
hierarchy: "tertiary",
|
|
263
|
+
onClick: fe,
|
|
264
|
+
children: "Show More"
|
|
265
|
+
},
|
|
266
|
+
"show-more"
|
|
267
|
+
) })
|
|
250
268
|
] }),
|
|
251
269
|
n.length === 0 && /* @__PURE__ */ r(
|
|
252
|
-
|
|
270
|
+
he,
|
|
253
271
|
{
|
|
254
272
|
padding: "8px",
|
|
255
|
-
className:
|
|
256
|
-
children: /* @__PURE__ */ r(
|
|
273
|
+
className: H(K["no-results"], "tcn-suggestion-list-no-results"),
|
|
274
|
+
children: /* @__PURE__ */ r(ge, { children: z })
|
|
257
275
|
}
|
|
258
276
|
),
|
|
259
|
-
/* @__PURE__ */ r(
|
|
277
|
+
/* @__PURE__ */ r(be, { onRedirect: ae }, n.length + 1)
|
|
260
278
|
]
|
|
261
279
|
}
|
|
262
280
|
)
|
|
@@ -264,6 +282,6 @@ function Qe({
|
|
|
264
282
|
);
|
|
265
283
|
}
|
|
266
284
|
export {
|
|
267
|
-
|
|
285
|
+
Ye as SuggestionList
|
|
268
286
|
};
|
|
269
287
|
//# sourceMappingURL=suggestion_list.js.map
|