@epam/ai-dial-ui-kit 0.15.0-dev.3 → 0.15.0-dev.31

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 (168) hide show
  1. package/README.md +185 -0
  2. package/dist/CHANGELOG.md +48 -0
  3. package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-BFEh4rXZ.cjs} +26 -26
  4. package/dist/DateCellRenderer-J1V3xwF7.cjs +1 -0
  5. package/dist/IconButton-DHOFapLo.cjs +1 -0
  6. package/dist/{JsonEditor-qv1Z0dLX.cjs → JsonEditor-BDe6elKO.cjs} +1 -1
  7. package/dist/{MarkdownEditor-DHn2pYOJ.cjs → MarkdownEditor-C7BONfsl.cjs} +1 -1
  8. package/dist/{MarkdownEditor-jQ8nDJfx.cjs → MarkdownEditor-FVzYMdkC.cjs} +1 -1
  9. package/dist/{MarkdownEditorContainer-Bzcnoemw.cjs → MarkdownEditorContainer-GvlxX6kx.cjs} +1 -1
  10. package/dist/{Switch-CUKClcEz.cjs → Switch-DE6MrcqJ.cjs} +1 -1
  11. package/dist/components/Button/constants.js +9 -8
  12. package/dist/components/Dropdown/Dropdown.js +70 -65
  13. package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
  14. package/dist/components/Dropdown/constants.js +16 -14
  15. package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
  16. package/dist/components/FileManager/FileManager.js +373 -372
  17. package/dist/components/FileManager/FileManagerProvider.js +266 -264
  18. package/dist/components/FileManager/hooks/use-grid-context-menu.js +59 -59
  19. package/dist/components/New/Accordion/Accordion.js +87 -71
  20. package/dist/components/New/Breadcrumbs/Breadcrumbs.js +159 -0
  21. package/dist/components/New/Breadcrumbs/constants.js +41 -0
  22. package/dist/components/New/Button/Button.js +32 -32
  23. package/dist/components/New/Button/ButtonWrappers.js +93 -37
  24. package/dist/components/New/Button/constants.js +3 -0
  25. package/dist/components/New/Button/utils.js +18 -8
  26. package/dist/components/New/ButtonDropdown/ButtonDropdown.js +26 -16
  27. package/dist/components/New/Calendar/Calendar.js +337 -289
  28. package/dist/components/New/Calendar/constants.js +5 -5
  29. package/dist/components/New/CaptionText/CaptionText.js +18 -15
  30. package/dist/components/New/CardShell/CardShell.js +5 -3
  31. package/dist/components/New/Checkbox/Checkbox.js +67 -56
  32. package/dist/components/New/Checkbox/CheckboxBox.js +5 -3
  33. package/dist/components/New/CloseButton/CloseButton.js +18 -16
  34. package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
  35. package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +44 -39
  36. package/dist/components/New/Dropdown/Dropdown.js +112 -105
  37. package/dist/components/New/Dropdown/DropdownSubMenuItem.js +17 -17
  38. package/dist/components/New/Dropdown/constants.js +22 -17
  39. package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +20 -18
  40. package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
  41. package/dist/components/New/FileIcon/FileIcon.js +55 -0
  42. package/dist/components/New/FileIcon/constants.js +134 -0
  43. package/dist/components/New/FileIcon/icons/FileGlyph.js +150 -0
  44. package/dist/components/New/FileIcon/icons/FolderGlyph.js +50 -0
  45. package/dist/components/New/FileName/FileName.js +78 -0
  46. package/dist/components/New/FilterChips/FilterChips.js +43 -0
  47. package/dist/components/New/FilterChips/constants.js +5 -0
  48. package/dist/components/New/FolderName/FolderName.js +16 -0
  49. package/dist/components/New/FolderPath/FolderPath.js +29 -28
  50. package/dist/components/New/Highlight/Highlight.js +23 -30
  51. package/dist/components/New/IconButton/IconButton.js +30 -28
  52. package/dist/components/New/InfoButton/InfoButton.js +13 -11
  53. package/dist/components/New/InlineSelect/InlineSelect.js +74 -56
  54. package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +41 -39
  55. package/dist/components/New/InteractiveTooltip/constants.js +2 -2
  56. package/dist/components/New/Label/Label.js +13 -8
  57. package/dist/components/New/MenuItem/MenuItem.js +29 -27
  58. package/dist/components/New/MenuItem/constants.js +9 -8
  59. package/dist/components/New/NoDataContent/NoDataContent.js +21 -19
  60. package/dist/components/New/Notification/Notification.js +33 -29
  61. package/dist/components/New/NumberInput/NumberInput.js +42 -33
  62. package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
  63. package/dist/components/New/Popup/Popup.js +46 -44
  64. package/dist/components/New/Popup/constants.js +3 -3
  65. package/dist/components/New/Radio/Radio.js +75 -64
  66. package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
  67. package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
  68. package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
  69. package/dist/components/New/Search/Search.js +29 -27
  70. package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
  71. package/dist/components/New/Select/Select.js +120 -109
  72. package/dist/components/New/Select/constants.js +23 -20
  73. package/dist/components/New/SharedEntityIndicator/SharedEntityIndicator.js +34 -0
  74. package/dist/components/New/Switch/Switch.js +69 -58
  75. package/dist/components/New/Tabs/Tabs.js +125 -61
  76. package/dist/components/New/Tag/Tag.js +42 -40
  77. package/dist/components/New/TagInput/TagInput.js +48 -44
  78. package/dist/components/New/ToggleIconButton/ToggleIconButton.js +26 -24
  79. package/dist/components/New/Tooltip/TooltipContent.js +11 -9
  80. package/dist/components/New/Tooltip/constants.js +1 -1
  81. package/dist/components/New/TransferQueue/TransferQueue.js +124 -0
  82. package/dist/components/New/TransferQueue/TransferQueueHeader.js +71 -0
  83. package/dist/components/New/TransferQueue/TransferQueueRow.js +119 -0
  84. package/dist/components/New/TransferQueue/constants.js +24 -0
  85. package/dist/components/New/constants/overlay.js +15 -9
  86. package/dist/components/Popup/constants.js +8 -8
  87. package/dist/components/ProgressBar/ProgressBar.js +45 -33
  88. package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
  89. package/dist/components/SchemaRenderer/components/SchemaField.js +19 -19
  90. package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +18 -18
  91. package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
  92. package/dist/components/SchemaRenderer/types.js +19 -8
  93. package/dist/components/SchemaRenderer/utils.js +122 -95
  94. package/dist/components/Skeleton/Skeleton.js +25 -19
  95. package/dist/components/Spinner/Spinner.js +7 -5
  96. package/dist/components/Tooltip/TooltipContent.js +11 -11
  97. package/dist/components-manifest.json +830 -31
  98. package/dist/constants/public-class-names.js +198 -0
  99. package/dist/dial-ui-kit.cjs +2 -2
  100. package/dist/dial-ui-kit.js +330 -302
  101. package/dist/editors.cjs +1 -1
  102. package/dist/file-manager.cjs +1 -1
  103. package/dist/grid.cjs +1 -1
  104. package/dist/index.css +2 -2
  105. package/dist/lazy-BEsZqouS.cjs +1 -0
  106. package/dist/merge-classes-BEJXjzkx.cjs +1 -0
  107. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +419 -399
  108. package/dist/src/components/FileManager/FileManager.d.ts +2 -0
  109. package/dist/src/components/FileManager/FileManagerContext.d.ts +1 -0
  110. package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +2 -1
  111. package/dist/src/components/New/Accordion/Accordion.d.ts +6 -1
  112. package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +94 -0
  113. package/dist/src/components/New/Breadcrumbs/constants.d.ts +60 -0
  114. package/dist/src/components/New/Button/Button.d.ts +4 -1
  115. package/dist/src/components/New/Button/ButtonWrappers.d.ts +20 -0
  116. package/dist/src/components/New/Button/utils.d.ts +15 -0
  117. package/dist/src/components/New/ButtonDropdown/ButtonDropdown.d.ts +4 -0
  118. package/dist/src/components/New/Calendar/Calendar.d.ts +14 -1
  119. package/dist/src/components/New/Calendar/constants.d.ts +1 -1
  120. package/dist/src/components/New/Dropdown/Dropdown.d.ts +9 -1
  121. package/dist/src/components/New/Dropdown/constants.d.ts +3 -0
  122. package/dist/src/components/New/FileIcon/FileIcon.d.ts +61 -0
  123. package/dist/src/components/New/FileIcon/constants.d.ts +16 -0
  124. package/dist/src/components/New/FileIcon/icons/FileGlyph.d.ts +18 -0
  125. package/dist/src/components/New/FileIcon/icons/FolderGlyph.d.ts +17 -0
  126. package/dist/src/components/New/FileName/FileName.d.ts +79 -0
  127. package/dist/src/components/New/FilterChips/FilterChips.d.ts +69 -0
  128. package/dist/src/components/New/FilterChips/constants.d.ts +13 -0
  129. package/dist/src/components/New/FolderName/FolderName.d.ts +37 -0
  130. package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +16 -1
  131. package/dist/src/components/New/InteractiveTooltip/constants.d.ts +5 -4
  132. package/dist/src/components/New/Notification/Notification.d.ts +18 -0
  133. package/dist/src/components/New/Popup/constants.d.ts +1 -1
  134. package/dist/src/components/New/Select/constants.d.ts +3 -2
  135. package/dist/src/components/New/SharedEntityIndicator/SharedEntityIndicator.d.ts +35 -0
  136. package/dist/src/components/New/Tabs/Tabs.d.ts +54 -6
  137. package/dist/src/components/New/Tooltip/constants.d.ts +5 -3
  138. package/dist/src/components/New/TransferQueue/TransferQueue.d.ts +139 -0
  139. package/dist/src/components/New/TransferQueue/TransferQueueHeader.d.ts +16 -0
  140. package/dist/src/components/New/TransferQueue/TransferQueueRow.d.ts +10 -0
  141. package/dist/src/components/New/TransferQueue/constants.d.ts +6 -0
  142. package/dist/src/components/New/constants/overlay.d.ts +13 -0
  143. package/dist/src/components/Popup/constants.d.ts +1 -1
  144. package/dist/src/components/SchemaRenderer/types.d.ts +11 -0
  145. package/dist/src/components/SchemaRenderer/utils.d.ts +10 -1
  146. package/dist/src/constants/public-class-names.d.ts +189 -0
  147. package/dist/src/index.d.ts +22 -1
  148. package/dist/src/types/accordion.d.ts +7 -0
  149. package/dist/src/types/breadcrumbs.d.ts +9 -0
  150. package/dist/src/types/button.d.ts +1 -0
  151. package/dist/src/types/transfer-queue.d.ts +10 -0
  152. package/dist/src/utils/__tests__/timezone.spec.d.ts +1 -0
  153. package/dist/src/utils/sub-menu-floating.d.ts +7 -4
  154. package/dist/src/utils/timezone.d.ts +24 -0
  155. package/dist/types/accordion.js +4 -0
  156. package/dist/types/breadcrumbs.js +4 -0
  157. package/dist/types/button.js +3 -3
  158. package/dist/types/transfer-queue.js +4 -0
  159. package/dist/use-file-manager-tabs-C0h1Sq5T.cjs +3 -0
  160. package/dist/utils/merge-classes.js +12 -5
  161. package/dist/utils/sub-menu-floating.js +98 -54
  162. package/dist/utils/timezone.js +19 -0
  163. package/package.json +3 -3
  164. package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
  165. package/dist/IconButton-DWqoaBWf.cjs +0 -1
  166. package/dist/lazy-tfN4sKhq.cjs +0 -1
  167. package/dist/merge-classes-Dipy1Ih1.cjs +0 -1
  168. package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
@@ -1,24 +1,24 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
2
  import { useMemo as F } from "react";
3
- import { DialFileNodeType as r, DialFilePermission as U } from "../../../models/file.js";
3
+ import { DialFileNodeType as i, DialFilePermission as X } from "../../../models/file.js";
4
4
  import { DialFileManagerActions as e } from "../../../types/file-manager.js";
5
- import { IconExternalLink as A, IconCopy as X, IconDownload as _, IconEye as j, IconTrashX as W, IconPencilMinus as $, IconInfoCircle as q, IconUserX as B } from "@tabler/icons-react";
6
- import H from "../../../assets/icons/copy-to.svg.js";
7
- import J from "../../../assets/icons/move-to.svg.js";
8
- import K from "../../../assets/icons/unshare.svg.js";
9
- import Q from "../../../assets/icons/add-child.svg.js";
10
- import V from "../../../assets/icons/add-sibling.svg.js";
5
+ import { IconExternalLink as O, IconCopy as _, IconDownload as j, IconEye as W, IconTrashX as $, IconPencilMinus as q, IconInfoCircle as B, IconUserX as H } from "@tabler/icons-react";
6
+ import J from "../../../assets/icons/copy-to.svg.js";
7
+ import K from "../../../assets/icons/move-to.svg.js";
8
+ import Q from "../../../assets/icons/unshare.svg.js";
9
+ import V from "../../../assets/icons/add-child.svg.js";
10
+ import Y from "../../../assets/icons/add-sibling.svg.js";
11
11
  import { BASE_ICON_PROPS as n } from "../../../constants/icon.js";
12
- import { DropdownItemType as Y } from "../../../types/dropdown.js";
13
- import { cleanForbiddenSymbolsRegExp as Z } from "../utils.js";
14
- const de = ({
12
+ import { DropdownItemType as Z } from "../../../types/dropdown.js";
13
+ import { cleanForbiddenSymbolsRegExp as G } from "../utils.js";
14
+ const ye = ({
15
15
  actionLabels: s,
16
16
  onDuplicate: u,
17
17
  onCopy: a,
18
18
  onMove: k,
19
19
  onDownload: l,
20
- onRename: C,
21
- onDelete: T,
20
+ onRename: T,
21
+ onDelete: C,
22
22
  onInfo: I,
23
23
  onUnshare: x,
24
24
  onRemoveAccess: c,
@@ -31,62 +31,61 @@ const de = ({
31
31
  isRenameFileAvailable: v = !0,
32
32
  isDuplicateFolderAvailable: E = !0,
33
33
  forbiddenSymbolsRegExp: z,
34
- onGridCreateSiblingFolder: w,
35
- onGridCreateChildFolder: M
34
+ skipForbiddenSymbolsCheckForActions: w,
35
+ onGridCreateSiblingFolder: M,
36
+ onGridCreateChildFolder: R
36
37
  }) => F(() => (o) => {
37
38
  const t = [];
38
39
  if (!s)
39
40
  return t;
40
- const p = Z(
41
- z
42
- )?.test(o.name);
43
- s[e.AddSibling] && o.nodeType === r.FOLDER && t.push({
41
+ const p = !w && G(z)?.test(o.name);
42
+ s[e.AddSibling] && o.nodeType === i.FOLDER && t.push({
44
43
  key: "addSibling",
45
44
  label: s[e.AddSibling],
46
- icon: /* @__PURE__ */ i(
47
- V,
45
+ icon: /* @__PURE__ */ r(
46
+ Y,
48
47
  {
49
48
  width: n.size,
50
49
  height: n.size,
51
50
  className: "text-secondary"
52
51
  }
53
52
  ),
54
- onClick: () => w([o])
55
- }), s[e.AddChild] && o.nodeType === r.FOLDER && !p && t.push(
53
+ onClick: () => M([o])
54
+ }), s[e.AddChild] && o.nodeType === i.FOLDER && !p && t.push(
56
55
  {
57
56
  key: "addChild",
58
57
  label: s[e.AddChild],
59
- icon: /* @__PURE__ */ i(
60
- Q,
58
+ icon: /* @__PURE__ */ r(
59
+ V,
61
60
  {
62
61
  width: n.size,
63
62
  height: n.size,
64
63
  className: "text-secondary"
65
64
  }
66
65
  ),
67
- onClick: () => M([o])
66
+ onClick: () => R([o])
68
67
  },
69
68
  {
70
69
  key: "divider",
71
- type: Y.Divider
70
+ type: Z.Divider
72
71
  }
73
- ), s[e.OpenInNewTab] && typeof y == "function" && o.nodeType === r.ITEM && !p && t.push({
72
+ ), s[e.OpenInNewTab] && typeof y == "function" && o.nodeType === i.ITEM && !p && t.push({
74
73
  key: e.OpenInNewTab,
75
74
  label: s[e.OpenInNewTab],
76
- icon: /* @__PURE__ */ i(A, { ...n, className: "text-secondary" }),
75
+ icon: /* @__PURE__ */ r(O, { ...n, className: "text-secondary" }),
77
76
  onClick: () => y?.(o)
78
77
  });
79
- const O = o.nodeType === r.ITEM || o.nodeType === r.FOLDER && E;
80
- s[e.Duplicate] && O && !p && t.push({
78
+ const P = o.nodeType === i.ITEM || o.nodeType === i.FOLDER && E;
79
+ s[e.Duplicate] && P && !p && t.push({
81
80
  key: e.Duplicate,
82
81
  label: s[e.Duplicate],
83
- icon: /* @__PURE__ */ i(X, { ...n, className: "text-secondary" }),
82
+ icon: /* @__PURE__ */ r(_, { ...n, className: "text-secondary" }),
84
83
  onClick: () => u(o)
85
84
  }), s[e.Copy] && !p && t.push({
86
85
  key: e.Copy,
87
86
  label: s[e.Copy],
88
- icon: /* @__PURE__ */ i(
89
- H,
87
+ icon: /* @__PURE__ */ r(
88
+ J,
90
89
  {
91
90
  width: n.size,
92
91
  height: n.size,
@@ -97,8 +96,8 @@ const de = ({
97
96
  }), s[e.Move] && !p && t.push({
98
97
  key: e.Move,
99
98
  label: s[e.Move],
100
- icon: /* @__PURE__ */ i(
101
- J,
99
+ icon: /* @__PURE__ */ r(
100
+ K,
102
101
  {
103
102
  width: n.size,
104
103
  height: n.size,
@@ -109,44 +108,44 @@ const de = ({
109
108
  }), s[e.Download] && !p && t.push({
110
109
  key: e.Download,
111
110
  label: s[e.Download],
112
- icon: /* @__PURE__ */ i(_, { ...n, className: "text-secondary" }),
111
+ icon: /* @__PURE__ */ r(j, { ...n, className: "text-secondary" }),
113
112
  onClick: () => l(o)
114
- }), s[e.ManagePermissions] && typeof m == "function" && o.nodeType === r.FOLDER && !p && t.push({
113
+ }), s[e.ManagePermissions] && typeof m == "function" && o.nodeType === i.FOLDER && !p && t.push({
115
114
  key: e.ManagePermissions,
116
115
  label: s[e.ManagePermissions],
117
- icon: /* @__PURE__ */ i(A, { ...n, className: "text-secondary" }),
116
+ icon: /* @__PURE__ */ r(O, { ...n, className: "text-secondary" }),
118
117
  onClick: () => m?.(o.path)
119
118
  });
120
- const h = o.name.split("."), R = h.length > 1 ? h[h.length - 1] : "", P = R && D?.includes(`.${R}`);
121
- s[e.Preview] && typeof d == "function" && o.nodeType === r.ITEM && P && !p && t.push({
119
+ const h = o.name.split("."), S = h.length > 1 ? h[h.length - 1] : "", f = S && D?.includes(`.${S}`);
120
+ s[e.Preview] && typeof d == "function" && o.nodeType === i.ITEM && f && !p && t.push({
122
121
  key: e.Preview,
123
122
  label: s[e.Preview],
124
- icon: /* @__PURE__ */ i(j, { ...n, className: "text-secondary" }),
123
+ icon: /* @__PURE__ */ r(W, { ...n, className: "text-secondary" }),
125
124
  onClick: () => d?.(o.path)
126
125
  });
127
- const S = !o.permissions || o.permissions.includes(U.WRITE);
128
- s[e.Delete] && S && t.push({
126
+ const A = !o.permissions || o.permissions.includes(X.WRITE);
127
+ s[e.Delete] && A && t.push({
129
128
  key: e.Delete,
130
129
  label: s[e.Delete],
131
- icon: /* @__PURE__ */ i(W, { ...n, className: "text-secondary" }),
132
- onClick: () => T(o, o.parentPath ?? "")
130
+ icon: /* @__PURE__ */ r($, { ...n, className: "text-secondary" }),
131
+ onClick: () => C(o, o.parentPath ?? "")
133
132
  });
134
- const f = o.nodeType === r.FOLDER || o.nodeType === r.ITEM && v;
135
- return s[e.Rename] && f && S && t.push({
133
+ const U = o.nodeType === i.FOLDER || o.nodeType === i.ITEM && v;
134
+ return s[e.Rename] && U && A && t.push({
136
135
  key: e.Rename,
137
136
  label: s[e.Rename],
138
- icon: /* @__PURE__ */ i($, { ...n, className: "text-secondary" }),
139
- onClick: () => C(o.path)
140
- }), s[e.Info] && o.nodeType === r.ITEM && !p && t.push({
137
+ icon: /* @__PURE__ */ r(q, { ...n, className: "text-secondary" }),
138
+ onClick: () => T(o.path)
139
+ }), s[e.Info] && o.nodeType === i.ITEM && !p && t.push({
141
140
  key: e.Info,
142
141
  label: s[e.Info],
143
- icon: /* @__PURE__ */ i(q, { ...n, className: "text-secondary" }),
142
+ icon: /* @__PURE__ */ r(B, { ...n, className: "text-secondary" }),
144
143
  onClick: () => I(o)
145
144
  }), s[e.Unshare] && N?.includes(o.path) && t.push({
146
145
  key: e.Unshare,
147
146
  label: s[e.Unshare],
148
- icon: /* @__PURE__ */ i(
149
- K,
147
+ icon: /* @__PURE__ */ r(
148
+ Q,
150
149
  {
151
150
  width: n.size,
152
151
  height: n.size,
@@ -157,7 +156,7 @@ const de = ({
157
156
  }), s[e.RemoveAccess] && g?.has(o.path) && c && t.push({
158
157
  key: e.RemoveAccess,
159
158
  label: s[e.RemoveAccess],
160
- icon: /* @__PURE__ */ i(B, { size: n.size, className: "text-secondary" }),
159
+ icon: /* @__PURE__ */ r(H, { size: n.size, className: "text-secondary" }),
161
160
  onClick: () => c(o)
162
161
  }), t;
163
162
  }, [
@@ -166,8 +165,8 @@ const de = ({
166
165
  a,
167
166
  k,
168
167
  l,
169
- T,
170
168
  C,
169
+ T,
171
170
  I,
172
171
  x,
173
172
  c,
@@ -180,9 +179,10 @@ const de = ({
180
179
  v,
181
180
  E,
182
181
  z,
183
- M,
184
- w
182
+ w,
183
+ R,
184
+ M
185
185
  ]);
186
186
  export {
187
- de as useGridContextMenu
187
+ ye as useGridContextMenu
188
188
  };
@@ -1,97 +1,113 @@
1
- import { jsxs as i, Fragment as _, jsx as e } from "react/jsx-runtime";
2
- import { IconChevronRight as j } from "@tabler/icons-react";
3
- import { useState as A, useId as C } from "react";
4
- import { DIAL_KIT_ICON_STROKE as S } from "../constants/icon.js";
5
- import { DIAL_ICON_SIZE as k } from "../../../constants/icon.js";
6
- import { resolveAccessibleName as O } from "../../../utils/accessible-name.js";
7
- import { mergeClasses as n } from "../../../utils/merge-classes.js";
8
- const F = ({
9
- title: p,
10
- description: s,
11
- children: h,
1
+ import { jsx as e, jsxs as s, Fragment as j } from "react/jsx-runtime";
2
+ import { IconChevronRight as T } from "@tabler/icons-react";
3
+ import { useState as k, useId as D } from "react";
4
+ import { DIAL_KIT_ICON_STROKE as K } from "../constants/icon.js";
5
+ import { DIAL_ICON_SIZE as O } from "../../../constants/icon.js";
6
+ import { resolveAccessibleName as R } from "../../../utils/accessible-name.js";
7
+ import { mergeClasses as t } from "../../../utils/merge-classes.js";
8
+ import { DIAL_KIT_CLASS as $ } from "../../../constants/public-class-names.js";
9
+ import { AccordionCaretPosition as y } from "../../../types/accordion.js";
10
+ const J = ({
11
+ title: g,
12
+ description: c,
13
+ children: I,
12
14
  expanded: l,
13
- defaultExpanded: y = !1,
14
- disabled: r,
15
- nonCollapsible: o,
16
- ariaLabel: v,
17
- onToggle: I,
18
- className: g,
19
- headerClassName: c,
20
- contentClassName: N
15
+ defaultExpanded: N = !1,
16
+ disabled: o,
17
+ nonCollapsible: n,
18
+ ariaLabel: w,
19
+ onToggle: b,
20
+ caretPosition: A = y.End,
21
+ className: C,
22
+ headerClassName: d,
23
+ contentClassName: S
21
24
  }) => {
22
- const d = l !== void 0, [b, w] = A(y), t = o ? !0 : d ? l : b, m = C(), a = `accordion-header-${m}`, x = `accordion-content-${m}`, E = () => {
23
- if (r) return;
24
- const u = !t;
25
- d || w(u), I?.(u);
26
- }, f = /* @__PURE__ */ i(_, { children: [
27
- /* @__PURE__ */ i("span", { className: "flex min-w-0 flex-col", children: [
28
- /* @__PURE__ */ e("span", { className: "truncate dial-body-text text-primary", children: p }),
29
- s ? /* @__PURE__ */ e("span", { className: "truncate dial-tiny-text text-secondary", children: s }) : null
25
+ const m = l !== void 0, [_, E] = k(N), r = n ? !0 : m ? l : _, f = D(), i = `accordion-header-${f}`, u = `accordion-content-${f}`, L = () => {
26
+ if (o) return;
27
+ const v = !r;
28
+ m || E(v), b?.(v);
29
+ }, a = A === y.Start, p = n ? null : /* @__PURE__ */ e(
30
+ T,
31
+ {
32
+ size: O.SM,
33
+ stroke: K,
34
+ "aria-hidden": "true",
35
+ className: t(
36
+ "shrink-0 text-secondary transition-transform motion-reduce:transition-none",
37
+ r ? "rotate-90" : "rtl:rotate-180"
38
+ )
39
+ }
40
+ ), x = /* @__PURE__ */ s(j, { children: [
41
+ a && p,
42
+ /* @__PURE__ */ s("span", { className: "flex min-w-0 flex-col", children: [
43
+ /* @__PURE__ */ e("span", { className: "truncate dial-body-text text-primary", children: g }),
44
+ c ? /* @__PURE__ */ e("span", { className: "truncate dial-tiny-text text-secondary", children: c }) : null
30
45
  ] }),
31
- !o && // Caret at the leading edge; it turns a quarter turn to point down when open.
32
- /* @__PURE__ */ e(
33
- j,
34
- {
35
- size: k.SM,
36
- stroke: S,
37
- "aria-hidden": "true",
38
- className: n(
39
- "shrink-0 text-secondary transition-transform motion-reduce:transition-none",
40
- t && "rotate-90"
41
- )
42
- }
43
- )
44
- ] });
45
- return /* @__PURE__ */ i(
46
+ !a && p
47
+ ] }), h = a ? "justify-start gap-2" : "justify-between";
48
+ return /* @__PURE__ */ s(
46
49
  "div",
47
50
  {
48
- className: n(
49
- "flex flex-col gap-3 py-3 overflow-hidden bg-transparent ",
50
- g
51
+ className: t(
52
+ "flex flex-col py-3 overflow-hidden bg-transparent",
53
+ C,
54
+ $.accordion
51
55
  ),
52
56
  children: [
53
- o ? /* @__PURE__ */ e(
57
+ n ? /* @__PURE__ */ e(
54
58
  "div",
55
59
  {
56
- id: a,
57
- className: n(
58
- "flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",
59
- c
60
+ id: i,
61
+ className: t(
62
+ "flex w-full px-4 rounded-xl items-center dial-tiny-text",
63
+ h,
64
+ d
60
65
  ),
61
- children: f
66
+ children: x
62
67
  }
63
68
  ) : /* @__PURE__ */ e(
64
69
  "button",
65
70
  {
66
- id: a,
71
+ id: i,
67
72
  type: "button",
68
- "aria-expanded": t,
69
- "aria-controls": t ? x : void 0,
70
- "aria-label": O(v),
71
- disabled: r,
72
- onClick: E,
73
- className: n(
74
- "flex w-full px-4 rounded-xl items-center justify-between dial-tiny-text",
75
- r ? "cursor-not-allowed opacity-75" : (
73
+ "aria-expanded": r,
74
+ "aria-controls": u,
75
+ "aria-label": R(w),
76
+ disabled: o,
77
+ onClick: L,
78
+ className: t(
79
+ "flex w-full px-4 rounded-xl items-center dial-tiny-text",
80
+ h,
81
+ o ? "cursor-not-allowed opacity-75" : (
76
82
  // Applied only to a header that can actually be operated.
77
83
  "cursor-pointer hover:bg-control-accent-alpha-hover focus-visible:outline focus-visible:outline-focus"
78
84
  ),
79
- c
85
+ d
80
86
  ),
81
- children: f
87
+ children: x
82
88
  }
83
89
  ),
84
- t && /* @__PURE__ */ e(
90
+ /* @__PURE__ */ e(
85
91
  "div",
86
92
  {
87
- id: x,
88
- role: "region",
89
- "aria-labelledby": a,
90
- className: n(
91
- "px-4 dial-small-text text-primary",
92
- N
93
+ inert: !r,
94
+ className: t(
95
+ "grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",
96
+ r ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
93
97
  ),
94
- children: h
98
+ children: /* @__PURE__ */ e("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ e("div", { className: "pt-3", children: /* @__PURE__ */ e(
99
+ "div",
100
+ {
101
+ id: u,
102
+ role: "region",
103
+ "aria-labelledby": i,
104
+ className: t(
105
+ "px-4 dial-small-text text-primary",
106
+ S
107
+ ),
108
+ children: I
109
+ }
110
+ ) }) })
95
111
  }
96
112
  )
97
113
  ]
@@ -99,5 +115,5 @@ const F = ({
99
115
  );
100
116
  };
101
117
  export {
102
- F as Accordion
118
+ J as Accordion
103
119
  };
@@ -0,0 +1,159 @@
1
+ import { jsx as a, jsxs as c, Fragment as x } from "react/jsx-runtime";
2
+ import { IconDots as A } from "@tabler/icons-react";
3
+ import { useMemo as u, useCallback as B } from "react";
4
+ import { Dropdown as D } from "../Dropdown/Dropdown.js";
5
+ import { EllipsisTooltip as w } from "../EllipsisTooltip/EllipsisTooltip.js";
6
+ import { DIAL_KIT_ICON_STROKE as F } from "../constants/icon.js";
7
+ import { DIAL_ICON_SIZE as y } from "../../../constants/icon.js";
8
+ import { DIAL_KIT_CLASS as b } from "../../../constants/public-class-names.js";
9
+ import { BreadcrumbsSize as K } from "../../../types/breadcrumbs.js";
10
+ import { mergeClasses as o } from "../../../utils/merge-classes.js";
11
+ import { listClassName as O, overflowButtonClassName as j, defaultSeparator as z, separatorClassName as g, sizeClassName as I, itemClassName as S, navClassName as R, DEFAULT_MAX_VISIBLE_ITEMS as V, MIN_VISIBLE_ITEMS as W, linkSegmentClassName as P, staticSegmentClassName as U, currentSegmentClassName as X, currentSizeClassName as Z, segmentClassName as $, segmentWidthClassName as q } from "./constants.js";
12
+ const te = ({
13
+ items: s,
14
+ maxVisibleItems: k = V,
15
+ size: i = K.Small,
16
+ separator: f = z,
17
+ ariaLabel: _ = "Breadcrumb",
18
+ overflowAriaLabel: M = "Show hidden path segments",
19
+ className: E,
20
+ itemClassName: L
21
+ }) => {
22
+ const m = Math.max(k, W), n = u(
23
+ () => s.length > m ? s.slice(1, -(m - 2)) : [],
24
+ [s, m]
25
+ ), T = u(
26
+ () => n.map((e, l) => ({
27
+ key: String(l),
28
+ label: e.label,
29
+ icon: e.icon
30
+ })),
31
+ [n]
32
+ ), v = B(
33
+ ({ key: e, domEvent: l }) => {
34
+ const r = n[Number(e)];
35
+ r && (r.onClick?.(l), !r.onClick && r.href && !l.defaultPrevented && (window.location.href = r.href));
36
+ },
37
+ [n]
38
+ );
39
+ if (s.length === 0) return null;
40
+ const d = s.slice(n.length + 1), C = (e, {
41
+ index: l,
42
+ isFirst: r,
43
+ isCurrent: t
44
+ }) => {
45
+ const N = !t && (!!e.href || !!e.onClick), h = o(
46
+ $,
47
+ N ? P : t ? o(X, Z[i]) : U,
48
+ L,
49
+ b.breadcrumbsItem
50
+ ), p = /* @__PURE__ */ c(x, { children: [
51
+ e.icon,
52
+ /* @__PURE__ */ a(w, { text: e.label })
53
+ ] });
54
+ return /* @__PURE__ */ c(
55
+ "li",
56
+ {
57
+ className: o(
58
+ S,
59
+ I[i],
60
+ q[t ? "last" : r ? "first" : "middle"]
61
+ ),
62
+ children: [
63
+ N ? e.href ? /* @__PURE__ */ a(
64
+ "a",
65
+ {
66
+ href: e.href,
67
+ onClick: e.onClick,
68
+ className: h,
69
+ children: p
70
+ }
71
+ ) : /* @__PURE__ */ a(
72
+ "button",
73
+ {
74
+ type: "button",
75
+ onClick: e.onClick,
76
+ className: h,
77
+ children: p
78
+ }
79
+ ) : /* @__PURE__ */ a(
80
+ "span",
81
+ {
82
+ className: h,
83
+ "aria-current": t ? "page" : void 0,
84
+ children: p
85
+ }
86
+ ),
87
+ !t && /* @__PURE__ */ a("span", { className: g, "aria-hidden": "true", children: f })
88
+ ]
89
+ },
90
+ `segment-${l}`
91
+ );
92
+ };
93
+ return /* @__PURE__ */ a(
94
+ "nav",
95
+ {
96
+ "aria-label": _,
97
+ className: o(
98
+ R,
99
+ E,
100
+ b.breadcrumbs
101
+ ),
102
+ children: /* @__PURE__ */ c("ol", { className: O, children: [
103
+ C(s[0], {
104
+ index: 0,
105
+ isFirst: !0,
106
+ isCurrent: s.length === 1
107
+ }),
108
+ n.length > 0 && /* @__PURE__ */ c(
109
+ "li",
110
+ {
111
+ className: o(
112
+ S,
113
+ I[i],
114
+ "shrink-0"
115
+ ),
116
+ children: [
117
+ /* @__PURE__ */ a(
118
+ D,
119
+ {
120
+ items: T,
121
+ onItemClick: v,
122
+ placement: "bottom-start",
123
+ matchReferenceWidth: !1,
124
+ children: /* @__PURE__ */ a(
125
+ "button",
126
+ {
127
+ type: "button",
128
+ "aria-label": M,
129
+ className: j,
130
+ children: /* @__PURE__ */ a(
131
+ A,
132
+ {
133
+ size: y.SM,
134
+ stroke: F,
135
+ "aria-hidden": "true"
136
+ }
137
+ )
138
+ }
139
+ )
140
+ }
141
+ ),
142
+ /* @__PURE__ */ a("span", { className: g, "aria-hidden": "true", children: f })
143
+ ]
144
+ }
145
+ ),
146
+ d.map(
147
+ (e, l) => C(e, {
148
+ index: s.length - d.length + l,
149
+ isFirst: !1,
150
+ isCurrent: l === d.length - 1
151
+ })
152
+ )
153
+ ] })
154
+ }
155
+ );
156
+ };
157
+ export {
158
+ te as Breadcrumbs
159
+ };
@@ -0,0 +1,41 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { IconChevronRight as s } from "@tabler/icons-react";
3
+ import { DIAL_KIT_ICON_STROKE as n } from "../constants/icon.js";
4
+ import { DIAL_ICON_SIZE as i } from "../../../constants/icon.js";
5
+ import { BreadcrumbsSize as e } from "../../../types/breadcrumbs.js";
6
+ const c = "w-full overflow-hidden", f = "flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap", u = "flex min-w-0 items-center gap-2", d = {
7
+ [e.Small]: "dial-small-text",
8
+ [e.Heading]: "dial-h2-text"
9
+ }, x = {
10
+ [e.Small]: "dial-small-semi-text",
11
+ [e.Heading]: "dial-h2-text"
12
+ }, N = {
13
+ first: "shrink-0",
14
+ middle: "min-w-0 max-w-[30%] shrink",
15
+ last: "min-w-0 max-w-[51%] shrink"
16
+ }, p = "flex min-w-0 flex-1 items-center gap-1 rounded-sm transition-colors", C = "text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus", S = "cursor-default text-primary", h = "cursor-default text-secondary", I = "inline-flex flex-none items-center leading-none text-secondary", g = "dial-kit-minimum-target flex shrink-0 items-center rounded-sm text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus", w = 3, v = 4, _ = /* @__PURE__ */ t(
17
+ s,
18
+ {
19
+ size: i.SM,
20
+ stroke: n,
21
+ "aria-hidden": "true",
22
+ className: "rtl:scale-x-[-1]"
23
+ }
24
+ );
25
+ export {
26
+ v as DEFAULT_MAX_VISIBLE_ITEMS,
27
+ w as MIN_VISIBLE_ITEMS,
28
+ S as currentSegmentClassName,
29
+ x as currentSizeClassName,
30
+ _ as defaultSeparator,
31
+ u as itemClassName,
32
+ C as linkSegmentClassName,
33
+ f as listClassName,
34
+ c as navClassName,
35
+ g as overflowButtonClassName,
36
+ p as segmentClassName,
37
+ N as segmentWidthClassName,
38
+ I as separatorClassName,
39
+ d as sizeClassName,
40
+ h as staticSegmentClassName
41
+ };