@epam/ai-dial-ui-kit 0.16.0-dev.44 → 0.16.0-dev.46

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 (217) hide show
  1. package/README.md +7 -10
  2. package/dist/CHANGELOG.md +9 -2
  3. package/dist/DateCellRenderer-Bx79kGGv.cjs +63 -0
  4. package/dist/MarkdownEditor-BtLY7OVq.cjs +1 -0
  5. package/dist/components/New/Grid/Grid.js +19 -14
  6. package/dist/components/New/Popup/constants.js +1 -1
  7. package/dist/components-manifest.json +520 -3036
  8. package/dist/constants/public-class-names.js +0 -7
  9. package/dist/dial-ui-kit.cjs +3 -3
  10. package/dist/dial-ui-kit.js +373 -456
  11. package/dist/editors.cjs +1 -1
  12. package/dist/editors.js +4 -10
  13. package/dist/grid.cjs +1 -1
  14. package/dist/grid.js +23 -31
  15. package/dist/{merge-classes-B0SnCG4i.cjs → icon-D93YIwGJ.cjs} +1 -1
  16. package/dist/index.css +1 -1
  17. package/dist/migration-guides/0.16.0/legacy-file-manager-removal.md +5 -3
  18. package/dist/migration-guides/0.16.0/unused-legacy-components-removal.md +128 -0
  19. package/dist/migration-guides/README.md +1 -0
  20. package/dist/node_modules/react-dnd/dist/internals/registration.js +5 -13
  21. package/dist/src/components/New/MarkdownEditor/lazy.d.ts +8 -2
  22. package/dist/src/components/New/Popup/constants.d.ts +1 -1
  23. package/dist/src/components/New/SegmentedControl/SegmentedControl.d.ts +2 -2
  24. package/dist/src/constants/public-class-names.d.ts +0 -7
  25. package/dist/src/index.d.ts +2 -53
  26. package/dist/src/subpaths/editors.d.ts +9 -15
  27. package/dist/src/subpaths/grid.d.ts +2 -8
  28. package/dist/src/types/editor.d.ts +0 -6
  29. package/dist/src/types/grid.d.ts +2 -2
  30. package/dist/src/utils/grid-registration.d.ts +6 -8
  31. package/package.json +1 -12
  32. package/dist/DateCellRenderer-FseALDXV.cjs +0 -63
  33. package/dist/IconButton-CsePS6PY.cjs +0 -1
  34. package/dist/JsonEditor-DQhHSm93.cjs +0 -1
  35. package/dist/MarkdownEditor-CvIPIbPq.cjs +0 -1
  36. package/dist/MarkdownEditor-TR6X_gdl.cjs +0 -1
  37. package/dist/MarkdownEditorContainer-JIn_VNUX.cjs +0 -1
  38. package/dist/Switch-HEL_aq23.cjs +0 -1
  39. package/dist/assets/icons/file/c.svg.js +0 -5
  40. package/dist/assets/icons/file/cpp.svg.js +0 -5
  41. package/dist/assets/icons/file/cs.svg.js +0 -5
  42. package/dist/assets/icons/file/ini.svg.js +0 -5
  43. package/dist/assets/icons/file/json.svg.js +0 -5
  44. package/dist/assets/icons/file/md.svg.js +0 -5
  45. package/dist/assets/icons/file/py.svg.js +0 -5
  46. package/dist/assets/icons/open-popup.svg.js +0 -5
  47. package/dist/components/AutocompleteInput/AutocompleteInputValue.js +0 -21
  48. package/dist/components/ButtonDropdown/ButtonDropdown.js +0 -33
  49. package/dist/components/ButtonDropdown/constants.js +0 -8
  50. package/dist/components/Checkbox/Checkbox.js +0 -64
  51. package/dist/components/Checkbox/constants.js +0 -4
  52. package/dist/components/CollapsibleSidebar/CollapsibleSidebar.js +0 -84
  53. package/dist/components/ConfirmationPopup/ConfirmationPopup.js +0 -75
  54. package/dist/components/ConfirmationPopup/constants.js +0 -32
  55. package/dist/components/DraggableItem/DraggableItem.js +0 -61
  56. package/dist/components/DraggableItem/constants.js +0 -6
  57. package/dist/components/DropdownIcon/DropdownIcon.js +0 -103
  58. package/dist/components/FileIcon/FileIcon.js +0 -37
  59. package/dist/components/FileIcon/constants.js +0 -60
  60. package/dist/components/FileName/FileName.js +0 -68
  61. package/dist/components/FolderName/FolderName.js +0 -57
  62. package/dist/components/FormItem/FormItem.js +0 -90
  63. package/dist/components/FormItem/constants.js +0 -9
  64. package/dist/components/FormPopup/FormPopup.js +0 -59
  65. package/dist/components/FormPopup/constants.js +0 -6
  66. package/dist/components/Grid/Grid.js +0 -333
  67. package/dist/components/Grid/constants.js +0 -33
  68. package/dist/components/Grid/renderers/DateCellRenderer.js +0 -27
  69. package/dist/components/Grid/renderers/constants.js +0 -25
  70. package/dist/components/InputPopup/InputPopup.js +0 -174
  71. package/dist/components/JsonEditor/JsonEditor.js +0 -65
  72. package/dist/components/JsonEditor/lazy.js +0 -4
  73. package/dist/components/MarkdownEditor/MarkdownEditor.js +0 -39
  74. package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +0 -82
  75. package/dist/components/MarkdownEditor/lazy.js +0 -4
  76. package/dist/components/Notification/Notification.js +0 -67
  77. package/dist/components/Notification/constants.js +0 -24
  78. package/dist/components/NumberInput/NumberInput.js +0 -41
  79. package/dist/components/Pagination/Pagination.js +0 -80
  80. package/dist/components/Pagination/utils.js +0 -10
  81. package/dist/components/PasswordInput/Icons/HideIcon.js +0 -16
  82. package/dist/components/PasswordInput/Icons/ShowIcon.js +0 -16
  83. package/dist/components/PasswordInput/PasswordInput.js +0 -21
  84. package/dist/components/Popup/Popup.js +0 -110
  85. package/dist/components/Popup/constants.js +0 -12
  86. package/dist/components/RadioButton/RadioButton.js +0 -103
  87. package/dist/components/RadioGroup/RadioGroup.js +0 -92
  88. package/dist/components/RadioGroup/constants.js +0 -10
  89. package/dist/components/RadioGroupPopupField/RadioGroupPopupField.js +0 -101
  90. package/dist/components/ResizableContainer/ConditionalResizableContainer.js +0 -6
  91. package/dist/components/ResizableContainer/ResizableContainer.js +0 -79
  92. package/dist/components/ResizableContainer/components/ResizeHandle.js +0 -20
  93. package/dist/components/ResizableContainer/components/ResizeIcon.js +0 -11
  94. package/dist/components/SchemaRenderer/SchemaRenderer.js +0 -151
  95. package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +0 -56
  96. package/dist/components/SchemaRenderer/components/SchemaAnyOfEditor.js +0 -74
  97. package/dist/components/SchemaRenderer/components/SchemaArrayEditor.js +0 -118
  98. package/dist/components/SchemaRenderer/components/SchemaField.js +0 -78
  99. package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +0 -114
  100. package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +0 -272
  101. package/dist/components/SchemaRenderer/components/SchemaObjectEditor.js +0 -36
  102. package/dist/components/SchemaRenderer/components/SchemaOneOfEditor.js +0 -192
  103. package/dist/components/SchemaRenderer/components/SchemaPrimitiveField.js +0 -161
  104. package/dist/components/SchemaRenderer/components/SchemaSection.js +0 -81
  105. package/dist/components/SchemaRenderer/context.js +0 -12
  106. package/dist/components/Search/Search.js +0 -63
  107. package/dist/components/Search/constants.js +0 -27
  108. package/dist/components/SegmentedControl/SegmentedControl.js +0 -87
  109. package/dist/components/SegmentedControl/constants.js +0 -8
  110. package/dist/components/Select/MultiSelectTags.js +0 -23
  111. package/dist/components/Select/Select.js +0 -435
  112. package/dist/components/Select/SelectSubMenuItem.js +0 -90
  113. package/dist/components/Select/constants.js +0 -15
  114. package/dist/components/SelectField/SelectField.js +0 -66
  115. package/dist/components/SharedEntityIndicator/SharedEntityIndicator.js +0 -34
  116. package/dist/components/Slider/Slider.js +0 -158
  117. package/dist/components/Switch/Switch.js +0 -70
  118. package/dist/components/TagInput/TagInput.js +0 -179
  119. package/dist/components/Textarea/Textarea.js +0 -43
  120. package/dist/constants/editor.js +0 -52
  121. package/dist/icon-CrGVkVpG.cjs +0 -1
  122. package/dist/icon-DhjrDQ8I.cjs +0 -1
  123. package/dist/lazy-kq-xfXXv.cjs +0 -1
  124. package/dist/node_modules/react-dnd/dist/hooks/useDrag/DragSourceImpl.js +0 -25
  125. package/dist/node_modules/react-dnd/dist/hooks/useDrag/connectors.js +0 -21
  126. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useDrag.js +0 -20
  127. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useDragSource.js +0 -19
  128. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useDragSourceConnector.js +0 -22
  129. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useDragSourceMonitor.js +0 -15
  130. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useDragType.js +0 -13
  131. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useRegisteredDragSource.js +0 -23
  132. package/dist/node_modules/react-dnd/dist/internals/DragSourceMonitorImpl.js +0 -88
  133. package/dist/node_modules/react-dnd/dist/internals/SourceConnector.js +0 -87
  134. package/dist/src/components/AutocompleteInput/AutocompleteInputValue.d.ts +0 -34
  135. package/dist/src/components/ButtonDropdown/ButtonDropdown.d.ts +0 -24
  136. package/dist/src/components/ButtonDropdown/constants.d.ts +0 -2
  137. package/dist/src/components/Checkbox/Checkbox.d.ts +0 -36
  138. package/dist/src/components/Checkbox/constants.d.ts +0 -1
  139. package/dist/src/components/CollapsibleSidebar/CollapsibleSidebar.d.ts +0 -46
  140. package/dist/src/components/ConfirmationPopup/ConfirmationPopup.d.ts +0 -55
  141. package/dist/src/components/ConfirmationPopup/constants.d.ts +0 -18
  142. package/dist/src/components/DraggableItem/DraggableItem.d.ts +0 -33
  143. package/dist/src/components/DraggableItem/constants.d.ts +0 -3
  144. package/dist/src/components/DropdownIcon/DropdownIcon.d.ts +0 -38
  145. package/dist/src/components/FileIcon/FileIcon.d.ts +0 -33
  146. package/dist/src/components/FileIcon/constants.d.ts +0 -9
  147. package/dist/src/components/FileName/FileName.d.ts +0 -49
  148. package/dist/src/components/FolderName/FolderName.d.ts +0 -37
  149. package/dist/src/components/FormItem/FormItem.d.ts +0 -66
  150. package/dist/src/components/FormItem/constants.d.ts +0 -3
  151. package/dist/src/components/FormPopup/FormPopup.d.ts +0 -46
  152. package/dist/src/components/FormPopup/constants.d.ts +0 -3
  153. package/dist/src/components/Grid/Grid.d.ts +0 -120
  154. package/dist/src/components/Grid/comparators/base-column-comparator.d.ts +0 -1
  155. package/dist/src/components/Grid/constants.d.ts +0 -28
  156. package/dist/src/components/Grid/renderers/DateCellRenderer.d.ts +0 -34
  157. package/dist/src/components/Grid/renderers/constants.d.ts +0 -7
  158. package/dist/src/components/Grid/renderers/utils.d.ts +0 -1
  159. package/dist/src/components/InputPopup/InputPopup.d.ts +0 -61
  160. package/dist/src/components/JsonEditor/JsonEditor.d.ts +0 -25
  161. package/dist/src/components/JsonEditor/lazy.d.ts +0 -14
  162. package/dist/src/components/MarkdownEditor/MarkdownEditor.d.ts +0 -38
  163. package/dist/src/components/MarkdownEditor/MarkdownEditorContainer.d.ts +0 -51
  164. package/dist/src/components/MarkdownEditor/lazy.d.ts +0 -7
  165. package/dist/src/components/Notification/Notification.d.ts +0 -58
  166. package/dist/src/components/Notification/constants.d.ts +0 -8
  167. package/dist/src/components/NumberInput/NumberInput.d.ts +0 -34
  168. package/dist/src/components/Pagination/Pagination.d.ts +0 -11
  169. package/dist/src/components/Pagination/utils.d.ts +0 -9
  170. package/dist/src/components/PasswordInput/Icons/HideIcon.d.ts +0 -16
  171. package/dist/src/components/PasswordInput/Icons/ShowIcon.d.ts +0 -16
  172. package/dist/src/components/PasswordInput/PasswordInput.d.ts +0 -26
  173. package/dist/src/components/Popup/Popup.d.ts +0 -64
  174. package/dist/src/components/Popup/constants.d.ts +0 -5
  175. package/dist/src/components/RadioButton/RadioButton.d.ts +0 -54
  176. package/dist/src/components/RadioGroup/RadioGroup.d.ts +0 -66
  177. package/dist/src/components/RadioGroup/constants.d.ts +0 -5
  178. package/dist/src/components/RadioGroupPopupField/RadioGroupPopupField.d.ts +0 -74
  179. package/dist/src/components/ResizableContainer/ConditionalResizableContainer.d.ts +0 -35
  180. package/dist/src/components/ResizableContainer/ResizableContainer.d.ts +0 -72
  181. package/dist/src/components/ResizableContainer/components/ResizeHandle.d.ts +0 -10
  182. package/dist/src/components/ResizableContainer/components/ResizeIcon.d.ts +0 -8
  183. package/dist/src/components/SchemaRenderer/SchemaRenderer.d.ts +0 -30
  184. package/dist/src/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.d.ts +0 -20
  185. package/dist/src/components/SchemaRenderer/components/SchemaAnyOfEditor.d.ts +0 -31
  186. package/dist/src/components/SchemaRenderer/components/SchemaArrayEditor.d.ts +0 -31
  187. package/dist/src/components/SchemaRenderer/components/SchemaField.d.ts +0 -29
  188. package/dist/src/components/SchemaRenderer/components/SchemaFieldContent.d.ts +0 -25
  189. package/dist/src/components/SchemaRenderer/components/SchemaKeyValueEditor.d.ts +0 -33
  190. package/dist/src/components/SchemaRenderer/components/SchemaObjectEditor.d.ts +0 -31
  191. package/dist/src/components/SchemaRenderer/components/SchemaOneOfEditor.d.ts +0 -31
  192. package/dist/src/components/SchemaRenderer/components/SchemaPrimitiveField.d.ts +0 -31
  193. package/dist/src/components/SchemaRenderer/components/SchemaSection.d.ts +0 -33
  194. package/dist/src/components/SchemaRenderer/context.d.ts +0 -19
  195. package/dist/src/components/SchemaRenderer/types.d.ts +0 -62
  196. package/dist/src/components/SchemaRenderer/utils.d.ts +0 -1
  197. package/dist/src/components/Search/Search.d.ts +0 -35
  198. package/dist/src/components/Search/constants.d.ts +0 -8
  199. package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +0 -40
  200. package/dist/src/components/SegmentedControl/constants.d.ts +0 -5
  201. package/dist/src/components/Select/MultiSelectTags.d.ts +0 -8
  202. package/dist/src/components/Select/Select.d.ts +0 -100
  203. package/dist/src/components/Select/SelectSubMenuItem.d.ts +0 -8
  204. package/dist/src/components/Select/constants.d.ts +0 -9
  205. package/dist/src/components/SelectField/SelectField.d.ts +0 -42
  206. package/dist/src/components/SharedEntityIndicator/SharedEntityIndicator.d.ts +0 -31
  207. package/dist/src/components/Slider/Slider.d.ts +0 -57
  208. package/dist/src/components/Switch/Switch.d.ts +0 -34
  209. package/dist/src/components/TagInput/TagInput.d.ts +0 -52
  210. package/dist/src/components/Textarea/Textarea.d.ts +0 -39
  211. package/dist/src/constants/editor.d.ts +0 -2
  212. package/dist/src/constants/storybook/form-item.d.ts +0 -3
  213. package/dist/src/models/segmented-control.d.ts +0 -7
  214. package/dist/src/types/form-item.d.ts +0 -31
  215. package/dist/src/types/select.d.ts +0 -8
  216. package/dist/types/form-item.js +0 -4
  217. package/dist/types/select.js +0 -5
@@ -1,435 +0,0 @@
1
- import { jsx as t, jsxs as b, Fragment as ne } from "react/jsx-runtime";
2
- import { IconX as Te, IconClipboardX as Be } from "@tabler/icons-react";
3
- import I from "classnames";
4
- import { useId as Le, useState as j, useCallback as g, useRef as le, useMemo as y, useEffect as G, useImperativeHandle as Pe } from "react";
5
- import { DialIcon as A } from "../Icon/Icon.js";
6
- import { DialButton as ze } from "../Button/Button.js";
7
- import { DialDropdown as Re } from "../Dropdown/Dropdown.js";
8
- import { DialNoDataContent as qe } from "../NoDataContent/NoDataContent.js";
9
- import { DialCheckbox as se } from "../Checkbox/Checkbox.js";
10
- import { DialSearch as He } from "../Search/Search.js";
11
- import { SIZE_CONFIG as _e } from "../Search/constants.js";
12
- import { DialEllipsisTooltip as ie } from "../EllipsisTooltip/EllipsisTooltip.js";
13
- import { DialMultiSelectTags as je } from "./MultiSelectTags.js";
14
- import { SelectVariant as oe, SelectSize as ce } from "../../types/select.js";
15
- import { ElementSize as Ge } from "../../types/size.js";
16
- import { DIAL_ICON_SIZE as de } from "../../constants/icon.js";
17
- import { dropdownMenuMaxHeight as Ke, selectChevronIcon as Qe, selectTriggerBaseClassName as Ue, selectOverlayBaseClassName as Xe, selectOptionBaseClassName as K, selectOptionSelectedClassName as Ze, selectOptionDisabledClassName as fe, selectOptionSingleSelectedClassName as Je } from "./constants.js";
18
- import { mergeClasses as me } from "../../utils/merge-classes.js";
19
- import { SelectSubMenuItem as We } from "./SelectSubMenuItem.js";
20
- const vt = ({
21
- options: s,
22
- multiple: a = !1,
23
- elementId: N,
24
- value: O,
25
- defaultValue: ue,
26
- variant: ge = oe.Primary,
27
- size: pe = ce.Md,
28
- prefix: E,
29
- customSelectedValue: p,
30
- placeholder: S = "Select...",
31
- searchable: T = !1,
32
- searchSize: Q = Ge.Standard,
33
- searchPlaceholder: U,
34
- selectAll: he = !1,
35
- invalid: ve,
36
- selectAllLabel: X = "Select all",
37
- emptyStateTitle: be = "No options available",
38
- emptyStateDescription: Ne,
39
- emptyStateIcon: xe,
40
- disabled: c = !1,
41
- className: ye,
42
- listClassName: Ce,
43
- closable: B = !1,
44
- header: k,
45
- footer: M,
46
- onClose: Z,
47
- onChange: J,
48
- inlineSearch: n = !1,
49
- dismissRef: we,
50
- onFooterClick: W,
51
- open: Y,
52
- onOpenChange: V,
53
- onInlineQueryChange: ee,
54
- customMultiSelectTagsRenderer: te
55
- }) => {
56
- const x = Le(), [De, Ie] = j(!1), L = Y !== void 0, i = L ? !!Y : De, d = g(
57
- (e) => {
58
- L || Ie(e), V?.(e);
59
- },
60
- [L, V]
61
- ), [f, Oe] = j(
62
- n && p || ""
63
- ), P = le(null), m = g(
64
- (e) => {
65
- e !== f && (Oe(e || ""), ee?.(e || ""));
66
- },
67
- [ee, f]
68
- ), z = O !== void 0, [Se, ke] = j(ue), C = z ? O : Se, l = y(() => a ? Array.isArray(C) ? C : [] : typeof C == "string" ? [C] : [], [C, a]), w = y(() => {
69
- const e = f.trim().toLowerCase();
70
- return e ? s.filter((r) => r.label.toLowerCase().includes(e)) : s;
71
- }, [s, f]);
72
- G(() => {
73
- !i && !n && m("");
74
- }, [n, i, m]);
75
- const re = le(p);
76
- G(() => {
77
- n && p !== re.current && (i || (re.current = p, m(p || "")));
78
- }, [p, n, i, m]);
79
- const h = g(
80
- (e) => {
81
- z || ke(e), J?.(e);
82
- },
83
- [z, J]
84
- ), D = g(
85
- (e) => {
86
- if (a) {
87
- const r = new Set(l);
88
- r.has(e) ? r.delete(e) : r.add(e), h(Array.from(r));
89
- return;
90
- }
91
- if (h(e), n) {
92
- const r = s.find((v) => v.value === e) ?? s.flatMap((v) => v.children ?? []).find((v) => v.value === e);
93
- r && m(r.label);
94
- }
95
- d(!1);
96
- },
97
- [
98
- a,
99
- h,
100
- n,
101
- d,
102
- l,
103
- s,
104
- m
105
- ]
106
- ), R = g(
107
- (e, r) => {
108
- if (e.stopPropagation(), !a) {
109
- h("");
110
- return;
111
- }
112
- const v = l.filter((Ee) => Ee !== r);
113
- h(v);
114
- },
115
- [a, l, h]
116
- ), u = y(
117
- () => w.filter((e) => !e.disabled),
118
- [w]
119
- ), q = y(
120
- () => u.filter((e) => l.includes(e.value)).length,
121
- [u, l]
122
- ), Me = g(
123
- (e) => {
124
- n && !a && !e && D(f), d(e);
125
- },
126
- [D, n, a, f, d]
127
- ), { allSelectedInFiltered: H, someSelectedInFiltered: Fe } = y(() => {
128
- const e = u.length > 0 && q === u.length;
129
- return {
130
- allSelectedInFiltered: e,
131
- someSelectedInFiltered: q > 0 && !e
132
- };
133
- }, [u, q]), $e = g(() => {
134
- if (!(!a || u.length === 0))
135
- if (H) {
136
- const e = new Set(u.map((r) => r.value));
137
- h(l.filter((r) => !e.has(r)));
138
- } else {
139
- const e = new Set(l);
140
- u.forEach((r) => e.add(r.value)), h(Array.from(e));
141
- }
142
- }, [
143
- H,
144
- a,
145
- u,
146
- l,
147
- h
148
- ]), _ = l.length > 0;
149
- G(() => {
150
- i && n && !a && !c && requestAnimationFrame(() => {
151
- const e = P.current;
152
- if (!e) return;
153
- e.focus();
154
- const r = e.value?.length ?? 0;
155
- e.setSelectionRange?.(r, r);
156
- });
157
- }, [i, n, a, c]);
158
- const F = !a && _ ? l[0] : void 0, o = y(
159
- () => F ? s.find((e) => e.value === F) ?? s.flatMap((e) => e.children ?? []).find((e) => e.value === F) : void 0,
160
- [s, F]
161
- ), Ae = g(() => a ? _ ? te?.(
162
- s,
163
- l,
164
- R
165
- ) || /* @__PURE__ */ t(
166
- je,
167
- {
168
- options: s,
169
- selectedValues: l,
170
- handleRemoveTag: R
171
- }
172
- ) : /* @__PURE__ */ t("span", { className: "text-secondary truncate", children: S }) : o ? /* @__PURE__ */ b(ne, { children: [
173
- o.icon && /* @__PURE__ */ t(A, { icon: o.icon }),
174
- /* @__PURE__ */ t(
175
- ie,
176
- {
177
- text: o.labelNode ?? (E ? `${E} ${o.label}` : o.label)
178
- }
179
- ),
180
- o?.description && /* @__PURE__ */ t("div", { className: "text-secondary dial-small-text", children: o.description })
181
- ] }) : p && O ? p : /* @__PURE__ */ t("span", { className: "text-secondary truncate", children: S }), [
182
- _,
183
- a,
184
- p,
185
- E,
186
- O,
187
- S,
188
- o,
189
- s,
190
- l,
191
- R,
192
- te
193
- ]);
194
- Pe(we, () => ({
195
- dismiss: () => {
196
- d(!1);
197
- }
198
- }));
199
- const $ = g(() => {
200
- m(
201
- l.length === 1 ? o?.label ?? f : ""
202
- );
203
- }, [f, l.length, m, o?.label]), ae = g(() => {
204
- c || (d(!i), n && !a && ($(), P.current?.focus()));
205
- }, [c, n, i, a, $, d]);
206
- return /* @__PURE__ */ t(
207
- Re,
208
- {
209
- open: i,
210
- onOpenChange: Me,
211
- disabled: c,
212
- closable: B,
213
- onClose: Z,
214
- placement: "bottom-start",
215
- allowedPlacements: ["bottom-start", "top-start"],
216
- maxDropdownHeight: T ? null : Ke,
217
- listClassName: Ce,
218
- renderOverlay: () => /* @__PURE__ */ b(
219
- "div",
220
- {
221
- id: `list-${N || x}`,
222
- role: "listbox",
223
- "aria-multiselectable": a || void 0,
224
- className: Xe,
225
- children: [
226
- k && /* @__PURE__ */ t(ne, { children: typeof k == "function" ? k() : k }),
227
- (T || B) && s.length > 8 && /* @__PURE__ */ b("div", { className: "flex items-center gap-2 px-2 pt-2", children: [
228
- T && /* @__PURE__ */ t(
229
- He,
230
- {
231
- size: Q,
232
- placeholder: U,
233
- onChange: m,
234
- value: f,
235
- id: `search-${N || x}`,
236
- containerClassName: me(
237
- _e[Q].containerClassName,
238
- "w-full"
239
- )
240
- }
241
- ),
242
- B && /* @__PURE__ */ t(
243
- ze,
244
- {
245
- "aria-label": "Close select",
246
- className: "shrink-0",
247
- iconBefore: /* @__PURE__ */ t(Te, { size: de.SM }),
248
- onClick: (e) => {
249
- Z?.(e), d(!1);
250
- }
251
- }
252
- )
253
- ] }),
254
- a && he && u.length > 0 && /* @__PURE__ */ t("div", { className: I(K, "mt-2"), children: /* @__PURE__ */ t(
255
- se,
256
- {
257
- id: `${N || x}-selectAll`,
258
- label: X,
259
- checked: H,
260
- indeterminate: Fe,
261
- onChange: $e,
262
- ariaLabel: X
263
- }
264
- ) }),
265
- /* @__PURE__ */ t(
266
- "div",
267
- {
268
- className: I(
269
- "overflow-y-auto max-h-[352px]",
270
- n && w.length === 0 ? "" : "py-1"
271
- ),
272
- children: w.length === 0 ? !n && /* @__PURE__ */ t("div", { className: "px-2 py-3", children: /* @__PURE__ */ t(
273
- qe,
274
- {
275
- icon: xe ?? /* @__PURE__ */ t(
276
- Be,
277
- {
278
- size: de.LG,
279
- stroke: 0.5
280
- }
281
- ),
282
- title: be,
283
- description: Ne
284
- }
285
- ) }) : w.map((e) => {
286
- const r = l.includes(e.value);
287
- return a ? /* @__PURE__ */ b(
288
- "div",
289
- {
290
- role: "option",
291
- "aria-selected": r,
292
- "aria-disabled": !!e.disabled,
293
- className: I(
294
- K,
295
- r && Ze,
296
- e.disabled && fe,
297
- "w-full"
298
- ),
299
- children: [
300
- /* @__PURE__ */ t(
301
- se,
302
- {
303
- id: `${N || x}-${e.value}`,
304
- label: /* @__PURE__ */ b("span", { className: "flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary", children: [
305
- e.icon && /* @__PURE__ */ t(A, { icon: e.icon }),
306
- /* @__PURE__ */ t("span", { className: "truncate", children: e.labelNode ?? e.label })
307
- ] }),
308
- checked: r,
309
- disabled: e.disabled,
310
- onChange: () => !e.disabled && D(e.value),
311
- ariaLabel: e.label
312
- }
313
- ),
314
- e.description && /* @__PURE__ */ t("div", { className: "text-secondary dial-small-text", children: e.description })
315
- ]
316
- },
317
- e.value
318
- ) : e.children?.length ? /* @__PURE__ */ t(
319
- We,
320
- {
321
- opt: e,
322
- selectedValues: l,
323
- onSelect: D
324
- },
325
- e.value
326
- ) : /* @__PURE__ */ t(
327
- "button",
328
- {
329
- role: "option",
330
- type: "button",
331
- "aria-selected": r,
332
- "aria-disabled": !!e.disabled,
333
- disabled: e.disabled,
334
- className: I(
335
- K,
336
- r && Je,
337
- e.disabled && fe
338
- ),
339
- onClick: () => !e.disabled && D(e.value),
340
- children: /* @__PURE__ */ b("div", { className: "flex items-center gap-2 w-full", children: [
341
- e.icon && /* @__PURE__ */ t(A, { icon: e.icon }),
342
- /* @__PURE__ */ t(
343
- ie,
344
- {
345
- text: e.labelNode ?? e.label
346
- }
347
- ),
348
- e.description && /* @__PURE__ */ t("div", { className: "text-secondary dial-small-text", children: e.description })
349
- ] })
350
- },
351
- e.value
352
- );
353
- })
354
- }
355
- ),
356
- M && /* @__PURE__ */ t(
357
- "div",
358
- {
359
- onClick: (e) => {
360
- W?.(e), W && d(!1);
361
- },
362
- children: typeof M == "function" ? M() : M
363
- }
364
- )
365
- ]
366
- }
367
- ),
368
- children: /* @__PURE__ */ b(
369
- "div",
370
- {
371
- role: "button",
372
- tabIndex: 0,
373
- "aria-roledescription": "button to open select list",
374
- "aria-haspopup": "listbox",
375
- "aria-expanded": i,
376
- "aria-controls": `list-${N || x}`,
377
- className: me(
378
- Ue,
379
- c && "opacity-75 !cursor-not-allowed !border-primary",
380
- pe === ce.Sm ? "min-h-[25px] px-1.5 py-1" : "min-h-[38px] px-3 py-2",
381
- ve && "dial-input-error",
382
- ge === oe.Secondary ? "!bg-layer-4 !h-auto" : "",
383
- ye
384
- ),
385
- onMouseDown: (e) => {
386
- c || n && !a && ($(), e.preventDefault());
387
- },
388
- onClick: () => {
389
- ae();
390
- },
391
- onKeyDown: (e) => {
392
- (e.key === " " || e.code === "Space") && (e.preventDefault(), ae());
393
- },
394
- children: [
395
- n && !a ? /* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-2 text-primary flex-1", children: /* @__PURE__ */ t(
396
- "input",
397
- {
398
- id: `inline-${N || x}`,
399
- type: "text",
400
- placeholder: U ?? S,
401
- value: f || "",
402
- onChange: (e) => m(e.currentTarget.value.trimStart()),
403
- onFocus: () => !c && d(!0),
404
- onMouseDown: (e) => {
405
- $(), e.stopPropagation();
406
- },
407
- onClick: (e) => {
408
- e.stopPropagation();
409
- },
410
- onKeyDown: (e) => {
411
- e.stopPropagation();
412
- },
413
- className: "bg-transparent outline-hidden w-full dial-small-text",
414
- ref: P,
415
- disabled: c,
416
- "aria-disabled": c,
417
- autoComplete: "off"
418
- }
419
- ) }) : /* @__PURE__ */ t("div", { className: "flex w-full min-w-0 items-center gap-2 text-primary", children: Ae() }),
420
- !n && /* @__PURE__ */ t(
421
- A,
422
- {
423
- icon: Qe,
424
- className: I("text-primary", i && "rotate-180")
425
- }
426
- )
427
- ]
428
- }
429
- )
430
- }
431
- );
432
- };
433
- export {
434
- vt as DialSelect
435
- };
@@ -1,90 +0,0 @@
1
- import { jsxs as s, Fragment as v, jsx as l } from "react/jsx-runtime";
2
- import { IconChevronRight as C } from "@tabler/icons-react";
3
- import d from "classnames";
4
- import "react";
5
- import { DialIcon as c } from "../Icon/Icon.js";
6
- import { DialEllipsisTooltip as m } from "../EllipsisTooltip/EllipsisTooltip.js";
7
- import { useSubMenuFloating as w, SubMenuPanel as y } from "../../utils/sub-menu-floating.js";
8
- import { selectSubMenuGap as M, selectOptionBaseClassName as b, selectOptionSingleSelectedClassName as u, selectOptionDisabledClassName as p } from "./constants.js";
9
- const k = ({
10
- opt: a,
11
- selectedValues: i,
12
- onSelect: f
13
- }) => {
14
- const {
15
- isOpen: n,
16
- refs: t,
17
- floatingStyles: x,
18
- context: N,
19
- getReferenceProps: g,
20
- getFloatingProps: S
21
- } = w(M, "listbox", !!a.disabled), o = a.children?.some(
22
- (e) => i.includes(e.value)
23
- );
24
- return /* @__PURE__ */ s(v, { children: [
25
- /* @__PURE__ */ s(
26
- "button",
27
- {
28
- ref: t.setReference,
29
- type: "button",
30
- role: "option",
31
- "aria-haspopup": "listbox",
32
- "aria-expanded": n,
33
- "aria-selected": !!o,
34
- "aria-disabled": !!a.disabled,
35
- disabled: a.disabled,
36
- className: d(
37
- b,
38
- o && u,
39
- a.disabled && p
40
- ),
41
- ...g(),
42
- children: [
43
- /* @__PURE__ */ s("div", { className: "flex items-center gap-2 w-full min-w-0", children: [
44
- a.icon && /* @__PURE__ */ l(c, { icon: a.icon }),
45
- /* @__PURE__ */ l(m, { text: a.labelNode ?? a.label })
46
- ] }),
47
- /* @__PURE__ */ l(C, { size: 14, className: "shrink-0" })
48
- ]
49
- }
50
- ),
51
- n && /* @__PURE__ */ l(
52
- y,
53
- {
54
- refs: t,
55
- floatingStyles: x,
56
- context: N,
57
- getFloatingProps: S,
58
- role: "listbox",
59
- className: "w-max py-1",
60
- children: a.children.map((e) => {
61
- const r = i.includes(e.value);
62
- return /* @__PURE__ */ l(
63
- "button",
64
- {
65
- type: "button",
66
- role: "option",
67
- "aria-selected": r,
68
- "aria-disabled": !!e.disabled,
69
- disabled: e.disabled,
70
- className: d(
71
- b,
72
- r && u,
73
- e.disabled && p
74
- ),
75
- onClick: () => !e.disabled && f(e.value),
76
- children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2 w-full", children: [
77
- e.icon && /* @__PURE__ */ l(c, { icon: e.icon }),
78
- /* @__PURE__ */ l(m, { text: e.labelNode ?? e.label })
79
- ] })
80
- },
81
- e.value
82
- );
83
- })
84
- }
85
- )
86
- ] });
87
- };
88
- export {
89
- k as SelectSubMenuItem
90
- };
@@ -1,15 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { DIAL_ICON_SIZE as t } from "../../constants/icon.js";
3
- import { IconChevronDown as a } from "@tabler/icons-react";
4
- const o = "dial-input flex w-full items-center justify-between gap-2 dial-small-text cursor-pointer", n = "w-full rounded flex flex-col", r = "flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small-text text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-hidden", i = "bg-accent-primary-alpha", p = "bg-accent-primary-alpha border-l border-accent-primary", m = "opacity-75", u = 352, d = 4, f = /* @__PURE__ */ e(a, { size: t.SM });
5
- export {
6
- u as dropdownMenuMaxHeight,
7
- f as selectChevronIcon,
8
- r as selectOptionBaseClassName,
9
- m as selectOptionDisabledClassName,
10
- i as selectOptionSelectedClassName,
11
- p as selectOptionSingleSelectedClassName,
12
- n as selectOverlayBaseClassName,
13
- d as selectSubMenuGap,
14
- o as selectTriggerBaseClassName
15
- };
@@ -1,66 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { useCallback as D } from "react";
3
- import { DialFormItem as N } from "../FormItem/FormItem.js";
4
- import { DialSelect as g } from "../Select/Select.js";
5
- import { DialMultiSelectTags as h } from "../Select/MultiSelectTags.js";
6
- const k = ({
7
- label: a,
8
- required: s,
9
- captionDescription: l,
10
- containerClassName: m,
11
- selectClassName: c,
12
- error: e,
13
- id: t,
14
- caption: p,
15
- readonly: d,
16
- value: i,
17
- defaultEmptyText: n,
18
- ...r
19
- }) => {
20
- const f = D(() => {
21
- if (!i || Array.isArray(i) && i.length === 0)
22
- return n ?? "None";
23
- if (Array.isArray(i))
24
- return /* @__PURE__ */ o(
25
- h,
26
- {
27
- options: r.options,
28
- selectedValues: i
29
- }
30
- );
31
- {
32
- const y = r.options?.find(
33
- (A) => A.value === i
34
- );
35
- return /* @__PURE__ */ o("span", { "aria-readonly": !0, className: "text-primary", children: y?.label || i });
36
- }
37
- }, [i, r.options, n]);
38
- return /* @__PURE__ */ o(
39
- N,
40
- {
41
- id: t,
42
- label: a,
43
- required: s,
44
- description: p,
45
- error: e,
46
- captionDescription: l,
47
- className: m,
48
- readonly: d,
49
- value: f(),
50
- defaultEmptyText: n,
51
- children: /* @__PURE__ */ o(
52
- g,
53
- {
54
- className: c,
55
- value: i,
56
- elementId: t,
57
- invalid: !!e,
58
- ...r
59
- }
60
- )
61
- }
62
- );
63
- };
64
- export {
65
- k as DialSelectField
66
- };
@@ -1,34 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { DialIcon as l } from "../Icon/Icon.js";
3
- import { mergeClasses as n } from "../../utils/merge-classes.js";
4
- import { IconArrowUpRight as p } from "@tabler/icons-react";
5
- import { DialTooltip as c } from "../Tooltip/Tooltip.js";
6
- const y = ({
7
- label: o = "Shared entity",
8
- size: t = 14,
9
- className: i,
10
- containerClassName: e,
11
- stroke: a = 1.5,
12
- sharedIndicatorTooltip: m
13
- }) => /* @__PURE__ */ r(c, { tooltip: m || "Shared", children: /* @__PURE__ */ r(
14
- l,
15
- {
16
- className: n(
17
- "text-accent-primary flex bg-layer-3",
18
- e
19
- ),
20
- icon: /* @__PURE__ */ r(
21
- p,
22
- {
23
- size: t,
24
- stroke: a,
25
- "aria-label": typeof o == "string" ? o : void 0,
26
- className: i,
27
- role: "img"
28
- }
29
- )
30
- }
31
- ) });
32
- export {
33
- y as DialSharedEntityIndicator
34
- };