@tcn/ui 0.11.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/feedback/index.d.ts +1 -0
  2. package/dist/feedback/index.d.ts.map +1 -1
  3. package/dist/feedback/index.js +6 -4
  4. package/dist/feedback/index.js.map +1 -1
  5. package/dist/feedback/progress/progress.d.ts +7 -0
  6. package/dist/feedback/progress/progress.d.ts.map +1 -0
  7. package/dist/feedback/progress/progress.js +38 -0
  8. package/dist/feedback/progress/progress.js.map +1 -0
  9. package/dist/feedback/progress/progress_bar.d.ts +0 -1
  10. package/dist/feedback/progress/progress_bar.d.ts.map +1 -1
  11. package/dist/feedback/progress/progress_bar.js +6 -46
  12. package/dist/feedback/progress/progress_bar.js.map +1 -1
  13. package/dist/form/field/common/status_input/status_input.js +4 -3
  14. package/dist/form/field/common/status_input/status_input.js.map +1 -1
  15. package/dist/inputs/suggestions/suggestion_list.d.ts.map +1 -1
  16. package/dist/inputs/suggestions/suggestion_list.js +145 -127
  17. package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
  18. package/dist/overlay/frame/frame.d.ts.map +1 -1
  19. package/dist/overlay/frame/frame.js +65 -65
  20. package/dist/overlay/frame/frame.js.map +1 -1
  21. package/dist/progress_bar-CPP0Jyv-.js +38 -0
  22. package/dist/progress_bar-CPP0Jyv-.js.map +1 -0
  23. package/dist/progress_bar.css +1 -1
  24. package/dist/stacks/box/bottom_resize_handle.d.ts +2 -8
  25. package/dist/stacks/box/bottom_resize_handle.d.ts.map +1 -1
  26. package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
  27. package/dist/stacks/box/box.d.ts +2 -2
  28. package/dist/stacks/box/box.d.ts.map +1 -1
  29. package/dist/stacks/box/box.js.map +1 -1
  30. package/dist/stacks/box/end_resize_handle.d.ts +2 -8
  31. package/dist/stacks/box/end_resize_handle.d.ts.map +1 -1
  32. package/dist/stacks/box/end_resize_handle.js.map +1 -1
  33. package/dist/stacks/box/left_resize_handle.d.ts +2 -8
  34. package/dist/stacks/box/left_resize_handle.d.ts.map +1 -1
  35. package/dist/stacks/box/left_resize_handle.js.map +1 -1
  36. package/dist/stacks/box/resize_handlers.d.ts +3 -2
  37. package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
  38. package/dist/stacks/box/resize_handlers.js +36 -32
  39. package/dist/stacks/box/resize_handlers.js.map +1 -1
  40. package/dist/stacks/box/right_resize_handle.d.ts +2 -8
  41. package/dist/stacks/box/right_resize_handle.d.ts.map +1 -1
  42. package/dist/stacks/box/right_resize_handle.js.map +1 -1
  43. package/dist/stacks/box/start_resize_handle.d.ts +2 -8
  44. package/dist/stacks/box/start_resize_handle.d.ts.map +1 -1
  45. package/dist/stacks/box/start_resize_handle.js.map +1 -1
  46. package/dist/stacks/box/top_resize_handle.d.ts +2 -8
  47. package/dist/stacks/box/top_resize_handle.d.ts.map +1 -1
  48. package/dist/stacks/box/top_resize_handle.js.map +1 -1
  49. package/dist/stacks/box/types.d.ts +18 -0
  50. package/dist/stacks/box/types.d.ts.map +1 -0
  51. package/dist/stacks/h_collapsible_box.js +25 -25
  52. package/dist/stacks/h_collapsible_box.js.map +1 -1
  53. package/dist/stacks/index.d.ts +1 -0
  54. package/dist/stacks/index.d.ts.map +1 -1
  55. package/dist/stacks/v_collapsible_box.js +25 -25
  56. package/dist/stacks/v_collapsible_box.js.map +1 -1
  57. package/dist/surfaces/modal/modal.d.ts +3 -4
  58. package/dist/surfaces/modal/modal.d.ts.map +1 -1
  59. package/dist/surfaces/modal/modal.js +10 -8
  60. package/dist/surfaces/modal/modal.js.map +1 -1
  61. package/dist/surfaces/pop_confirm/pop_confirm.d.ts.map +1 -1
  62. package/dist/surfaces/pop_confirm/pop_confirm.js +18 -12
  63. package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
  64. package/dist/surfaces/tooltip/tooltip.d.ts.map +1 -1
  65. package/dist/surfaces/tooltip/tooltip.js +22 -20
  66. package/dist/surfaces/tooltip/tooltip.js.map +1 -1
  67. package/dist/surfaces/window/window.d.ts +3 -4
  68. package/dist/surfaces/window/window.d.ts.map +1 -1
  69. package/dist/surfaces/window/window.js +20 -18
  70. package/dist/surfaces/window/window.js.map +1 -1
  71. package/dist/themes/themes/ergo/ergo_theme.css +1 -1
  72. package/dist/themes/themes/ergo/ergo_theme.js +3 -1
  73. package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
  74. package/package.json +1 -1
  75. package/src/feedback/index.ts +1 -0
  76. package/src/feedback/progress/progress.module.css +5 -0
  77. package/src/feedback/progress/progress.stories.tsx +48 -0
  78. package/src/feedback/progress/progress.tsx +39 -0
  79. package/src/feedback/progress/progress_bar.module.css +4 -28
  80. package/src/feedback/progress/progress_bar.stories.tsx +1 -1
  81. package/src/feedback/progress/progress_bar.tsx +14 -26
  82. package/src/inputs/select/select.stories.tsx +23 -2
  83. package/src/inputs/suggestions/suggestion_list.tsx +58 -39
  84. package/src/overlay/frame/frame.tsx +10 -12
  85. package/src/stacks/box/bottom_resize_handle.tsx +2 -13
  86. package/src/stacks/box/box.tsx +4 -2
  87. package/src/stacks/box/end_resize_handle.tsx +3 -13
  88. package/src/stacks/box/left_resize_handle.tsx +3 -13
  89. package/src/stacks/box/resize_handlers.ts +22 -18
  90. package/src/stacks/box/right_resize_handle.tsx +2 -13
  91. package/src/stacks/box/start_resize_handle.tsx +3 -13
  92. package/src/stacks/box/top_resize_handle.tsx +3 -12
  93. package/src/stacks/box/types.ts +44 -0
  94. package/src/stacks/h_collapsible_box.tsx +2 -2
  95. package/src/stacks/index.ts +1 -0
  96. package/src/stacks/v_collapsible_box.tsx +2 -2
  97. package/src/surfaces/modal/modal.tsx +6 -4
  98. package/src/surfaces/pop_confirm/pop_confirm.tsx +8 -2
  99. package/src/surfaces/tooltip/tooltip.tsx +2 -1
  100. package/src/surfaces/window/window.stories.tsx +9 -1
  101. package/src/surfaces/window/window.tsx +6 -4
  102. package/src/themes/themes/ergo/ergo_theme.css +3 -1
@@ -1,4 +1,5 @@
1
1
  export * from './loading/loading.js';
2
2
  export * from './progress/progress_bar.js';
3
+ export * from './progress/progress.js';
3
4
  export * from './lazy/lazy.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -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"}
@@ -1,9 +1,11 @@
1
1
  import { Loading as e } from "./loading/loading.js";
2
- import { ProgressBar as f } from "./progress/progress_bar.js";
3
- import { Lazy as p } from "./lazy/lazy.js";
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
- p as Lazy,
6
+ t as Lazy,
6
7
  e as Loading,
7
- f as ProgressBar
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;AAU9C,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,WAAW,yFAgCtB,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 { jsxs as e, jsx as r } from "react/jsx-runtime";
2
- import m from "react";
3
- import { BodyText as t } 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 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
- T as ProgressBar
7
+ s as ProgressBar
48
8
  };
49
9
  //# sourceMappingURL=progress_bar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress_bar.js","sources":["../../../src/feedback/progress/progress_bar.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 { ZStack } from '../../stacks/z_stack.js';\nimport clsx from 'clsx';\n\nimport styles from './progress_bar.module.css';\n\nexport interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {\n message: string;\n value: number;\n}\n\nexport const ProgressBar = React.forwardRef(function ProgressBar(\n { message, value, ...props }: ProgressBarProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const progressPercent = `${(value * 100).toFixed(0)}%`;\n const styleVariables: any = { '--progress-percentage': progressPercent };\n\n return (\n <VStack\n ref={ref}\n className={clsx(styles['progress-bar-container'], 'tcn-progress-bar')}\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 <ZStack height=\"8px\" hAlign=\"start\">\n <div className={styles['progress-bar-background']}></div>\n <div\n data-finished={progressPercent === '100%'}\n style={styleVariables}\n className={styles['progress-bar-fill']}\n />\n <div className={styles['progress-bar']}></div>\n </ZStack>\n </VStack>\n );\n});\n"],"names":["ProgressBar","React","message","value","props","ref","progressPercent","styleVariables","jsxs","VStack","clsx","styles","HStack","jsx","BodyText","Spacer","ZStack"],"mappings":";;;;;;;;;;;;;;8SAeaA,IAAcC,EAAM,WAAW,SAC1C,EAAE,SAAAC,GAAS,OAAAC,GAAO,GAAGC,EAAA,GACrBC,GACA;AACA,QAAMC,IAAkB,IAAIH,IAAQ,KAAK,QAAQ,CAAC,CAAC,KAC7CI,IAAsB,EAAE,yBAAyBD,EAAA;AAEvD,SACE,gBAAAE;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAJ;AAAA,MACA,WAAWK,EAAKC,EAAO,wBAAwB,GAAG,kBAAkB;AAAA,MACnE,GAAGP;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAI,EAACI,GAAA,EAAO,QAAO,QAAO,QAAO,OAC3B,UAAA;AAAA,UAAA,gBAAAC,EAACC,KAAU,UAAAZ,EAAA,CAAQ;AAAA,4BAClBa,GAAA,EAAO;AAAA,UACR,gBAAAF,EAACE,GAAA,EAAO,OAAM,MAAA,CAAM;AAAA,UACpB,gBAAAF,EAACC,KAAS,MAAK,MAAK,OAAO,EAAE,YAAY,EAAA,GACtC,UAAAR,EAAA,CACH;AAAA,QAAA,GACF;AAAA,QACA,gBAAAE,EAACQ,GAAA,EAAO,QAAO,OAAM,QAAO,SAC1B,UAAA;AAAA,UAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWF,EAAO,yBAAyB,EAAA,CAAG;AAAA,UACnD,gBAAAE;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,iBAAeP,MAAoB;AAAA,cACnC,OAAOC;AAAA,cACP,WAAWI,EAAO,mBAAmB;AAAA,YAAA;AAAA,UAAA;AAAA,UAEvC,gBAAAE,EAAC,OAAA,EAAI,WAAWF,EAAO,cAAc,EAAA,CAAG;AAAA,QAAA,EAAA,CAC1C;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
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 "../../../../feedback/progress/progress_bar.js";
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
- }, v = p.forwardRef(function({ children: i, state: t = "default", className: s, ...l }, c) {
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
- v as FieldStatusInput
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":";;;;;;;;;;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
+ {"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,2CAyYrB"}
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 P, Fragment as fe } from "react/jsx-runtime";
2
- import { BodyText as de } from "../../typography/body_text/body_text.js";
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 W } from "../../stacks/v_stack.js";
10
- import { ZStack as ge } from "../../stacks/z_stack.js";
11
- import { clsx as D } from "clsx";
12
- import { Children as he, isValidElement as me, useState as a, useRef as F, useLayoutEffect as b } from "react";
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 we } from "../../utils/focus_redirect.js";
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 be } from "./suggestion_item.js";
20
- import { Option as $ } from "../options/option.js";
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 xe } from "../../actions/button/button/button.js";
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 ke = "_suggestion-list_711fb17", ye = "_input_a0df060", H = { "suggestion-list": ke, input: ye }, I = 50, Se = 50;
30
- function Qe({
31
- value: _ = "",
32
- initialSearchValue: B,
33
- scrollToValue: g,
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: M = !1,
36
- children: j,
37
- onOptionSelect: h,
38
- noSuggestionMessage: q = "-- No Matches --",
39
- onClose: x,
40
- onChange: K,
41
- onKeyUp: E,
42
- onKeyDown: N,
43
- trimCustomInput: Z = !1,
44
- haveValueAsOption: X = !1,
45
- restoreFocus: z = !0,
46
- ...G
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 L = he.toArray(j).filter(
49
- (e) => me(e) && e.type === $
50
- ), [k, J] = a(() => {
51
- if (g != null) {
52
- const e = L.findIndex((i) => i.props.value === g);
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
- }), C = F(""), v = F(!1), [Q, O] = a(I), [d, y] = a(k), [m, T] = a(_), c = F(null), [Y, ee] = a(L.length), [n, U] = a(
58
- () => R(_, I)
59
- ), [te, se] = a(), [ne, ie] = a();
60
- function oe(e) {
61
- if (!v.current)
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
- v.current = !1;
64
- const i = e.key, t = e.currentTarget, s = C.current = i;
65
- if (C.current = "", s)
66
- switch (i) {
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 p = Z ? t.value.trim() : t.value;
70
- if (p === "")
72
+ const u = G ? t.value.trim() : t.value;
73
+ if (u === "")
71
74
  return;
72
- const S = p.toLocaleLowerCase(), o = L.find(
73
- (A) => A.props.value.toLocaleLowerCase() === S || A.props.label != null && A.props.label.toLocaleLowerCase() === S
74
- ), V = o != null, f = o?.props.label || p, pe = o?.props.value || p;
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
- h && h(
77
- pe,
79
+ w && w(
78
80
  f,
79
- V,
80
- o?.props.obfuscate ?? !1
81
+ $,
82
+ p,
83
+ g?.props.obfuscate ?? !1
81
84
  );
82
85
  });
83
86
  break;
84
87
  }
85
- const u = n[d].props;
86
- if (u.disabled)
88
+ const i = n[d].props;
89
+ if (i.disabled)
87
90
  break;
88
91
  requestAnimationFrame(() => {
89
- h && h(
90
- u.value,
91
- u.label,
92
+ w && w(
93
+ i.value,
94
+ i.label,
92
95
  !0,
93
- u.obfuscate ?? !1
96
+ i.obfuscate ?? !1
94
97
  );
95
98
  });
96
99
  break;
97
100
  }
98
101
  case "Escape": {
99
- x && x(t.value, t.selectionStart, t.selectionEnd);
102
+ L && L(t.value, t.selectionStart, t.selectionEnd);
100
103
  break;
101
104
  }
102
105
  }
103
- E && E(e);
106
+ T && T(e);
104
107
  }
105
- function re(e) {
106
- const i = e.key;
107
- switch (C.current = i, v.current = !0, i) {
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
- y(t), e.preventDefault();
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
- y(s), e.preventDefault();
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
- y(t), e.preventDefault();
154
+ S(t), e.preventDefault();
152
155
  break;
153
156
  }
154
157
  }
155
- N && N(e);
158
+ U && U(e);
156
159
  }
157
- function R(e, i) {
158
- const t = L.filter((s) => {
159
- const w = s.props, u = String(w.label).toLocaleLowerCase(), p = w.keywords?.map((f) => f.toLocaleLowerCase()) || [], S = String(w.value).toLocaleLowerCase(), o = e.toLocaleLowerCase();
160
- return w.obfuscate ?? !1 ? u.includes(o) || p.some((f) => f.includes(o)) : u.includes(o) || p.some((f) => f.includes(o)) || S.includes(o);
161
- });
162
- return X && e.trim().length > 0 && !t.some((s) => s.props.value === e) && t.unshift(
163
- /* @__PURE__ */ r($, { value: e, label: e, keywords: [e], children: e }, "value")
164
- ), ee(t.length), t.slice(0, i);
165
- }
166
- function le() {
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 ce() {
176
+ function ue() {
171
177
  const e = c.current;
172
- e != null && x && x(e.value, e.selectionStart, e.selectionEnd);
178
+ e != null && L && L(e.value, e.selectionStart, e.selectionEnd);
173
179
  }
174
- function ae(e) {
175
- const i = e.currentTarget;
176
- O(I), T(e.target.value);
177
- const t = R(i.value, I);
178
- U(t), K && K(e.target.value);
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 ue() {
181
- const e = Q + Se;
182
- O(e);
183
- const i = R(m, e);
184
- U(i);
186
+ function fe() {
187
+ const e = ee + Me;
188
+ V(e);
189
+ const o = M(x, e);
190
+ D(o);
185
191
  }
186
- return b(() => {
192
+ return h(() => {
187
193
  const e = c.current;
188
- M && (e != null && e.value.length > 0 ? e.select() : e?.focus());
189
- }, [M]), b(() => {
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
- se(`${e.width}px`), ie(`${e.height}px`), c.current != null && l instanceof HTMLInputElement && (c.current.value = l.value, c.current.selectionStart = l.selectionStart, c.current.selectionEnd = l.selectionEnd);
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]), b(() => {
195
- if (g != null) {
200
+ }, [l]), h(() => {
201
+ if (m != null) {
196
202
  const e = n.findIndex(
197
- (i) => i.props.value === g
203
+ (o) => o.props.value === m
198
204
  );
199
- J(e);
205
+ Y(e);
200
206
  }
201
- }, [n, g]), b(() => {
202
- y(m === "" ? k : -1);
203
- }, [m, k]), b(() => {
204
- T(B ?? "");
205
- }, [B]), /* @__PURE__ */ r(
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: M,
217
+ open: v,
209
218
  anchorElement: l,
210
- onClose: ce,
219
+ onClose: ue,
211
220
  verticalAnchor: "top",
212
221
  verticalOrigin: "top",
213
222
  verticalOffset: -4,
214
- restoreFocus: z,
215
- children: /* @__PURE__ */ P(
216
- W,
223
+ restoreFocus: J,
224
+ children: /* @__PURE__ */ j(
225
+ q,
217
226
  {
218
- minHeight: `calc(${ne}, 8px)`,
227
+ minHeight: `calc(${ie}, 8px)`,
219
228
  maxHeight: "300px",
220
- minWidth: te,
229
+ minWidth: ne,
221
230
  width: "auto",
222
231
  hAlign: "start",
223
- className: D(H["suggestion-list"], "tcn-suggestion-list"),
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: m,
230
- onKeyUp: oe,
231
- onKeyDown: re,
232
- onChange: ae,
233
- className: D(H.input, "tcn-suggestion-list-search-input"),
234
- ...G
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__ */ P(W, { children: [
239
- n.map((e, i) => /* @__PURE__ */ r(
240
- be,
247
+ /* @__PURE__ */ j(q, { children: [
248
+ n.map((e, o) => /* @__PURE__ */ r(
249
+ xe,
241
250
  {
242
251
  option: e,
243
- isSelected: i === k && m !== "",
244
- isFocused: i === d,
245
- onClick: h
252
+ isSelected: o === y && x !== "",
253
+ isFocused: o === d,
254
+ onClick: w
246
255
  },
247
- i
256
+ o
248
257
  )),
249
- Y > n.length && /* @__PURE__ */ r(fe, { children: /* @__PURE__ */ r(xe, { marginBlock: "8px", hierarchy: "tertiary", onClick: ue, children: "Show More" }) })
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
- ge,
270
+ he,
253
271
  {
254
272
  padding: "8px",
255
- className: D(H["no-results"], "tcn-suggestion-list-no-results"),
256
- children: /* @__PURE__ */ r(de, { children: q })
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(we, { onRedirect: le }, n.length + 1)
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
- Qe as SuggestionList
285
+ Ye as SuggestionList
268
286
  };
269
287
  //# sourceMappingURL=suggestion_list.js.map