@epam/ai-dial-ui-kit 0.15.0-dev.4 → 0.15.0-dev.41

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 (193) hide show
  1. package/README.md +190 -0
  2. package/dist/CHANGELOG.md +73 -0
  3. package/dist/DateCellRenderer-DFknFcs1.cjs +1 -0
  4. package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-J9A5gyDz.cjs} +31 -31
  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/Avatar/Avatar.js +70 -0
  21. package/dist/components/New/Badge/Badge.js +45 -0
  22. package/dist/components/New/BottomSheet/BottomSheet.js +128 -0
  23. package/dist/components/New/Breadcrumbs/Breadcrumbs.js +159 -0
  24. package/dist/components/New/Breadcrumbs/constants.js +41 -0
  25. package/dist/components/New/Button/Button.js +32 -32
  26. package/dist/components/New/Button/ButtonWrappers.js +93 -37
  27. package/dist/components/New/Button/constants.js +3 -0
  28. package/dist/components/New/Button/utils.js +18 -8
  29. package/dist/components/New/ButtonDropdown/ButtonDropdown.js +26 -16
  30. package/dist/components/New/Calendar/Calendar.js +301 -265
  31. package/dist/components/New/Calendar/constants.js +5 -5
  32. package/dist/components/New/CaptionText/CaptionText.js +18 -15
  33. package/dist/components/New/CardShell/CardShell.js +5 -3
  34. package/dist/components/New/Checkbox/Checkbox.js +67 -56
  35. package/dist/components/New/Checkbox/CheckboxBox.js +5 -3
  36. package/dist/components/New/CloseButton/CloseButton.js +18 -16
  37. package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
  38. package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +38 -37
  39. package/dist/components/New/ConfirmationPopup/constants.js +8 -11
  40. package/dist/components/New/Dropdown/Dropdown.js +112 -105
  41. package/dist/components/New/Dropdown/DropdownSubMenuItem.js +17 -17
  42. package/dist/components/New/Dropdown/constants.js +22 -17
  43. package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +20 -18
  44. package/dist/components/New/EntityIdentity/EntityIdentity.js +135 -0
  45. package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
  46. package/dist/components/New/FileIcon/FileIcon.js +55 -0
  47. package/dist/components/New/FileIcon/constants.js +134 -0
  48. package/dist/components/New/FileIcon/icons/FileGlyph.js +150 -0
  49. package/dist/components/New/FileIcon/icons/FolderGlyph.js +50 -0
  50. package/dist/components/New/FileName/FileName.js +78 -0
  51. package/dist/components/New/FilterChips/FilterChips.js +43 -0
  52. package/dist/components/New/FilterChips/constants.js +5 -0
  53. package/dist/components/New/FolderName/FolderName.js +16 -0
  54. package/dist/components/New/FolderPath/FolderPath.js +29 -28
  55. package/dist/components/New/Highlight/Highlight.js +23 -30
  56. package/dist/components/New/IconButton/IconButton.js +30 -28
  57. package/dist/components/New/InfoButton/InfoButton.js +13 -11
  58. package/dist/components/New/InlineSelect/InlineSelect.js +74 -56
  59. package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +41 -39
  60. package/dist/components/New/InteractiveTooltip/constants.js +2 -2
  61. package/dist/components/New/Label/Label.js +13 -8
  62. package/dist/components/New/MenuItem/MenuItem.js +29 -27
  63. package/dist/components/New/MenuItem/constants.js +9 -8
  64. package/dist/components/New/NoDataContent/NoDataContent.js +21 -19
  65. package/dist/components/New/Notification/Notification.js +33 -29
  66. package/dist/components/New/NumberInput/NumberInput.js +42 -33
  67. package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
  68. package/dist/components/New/Popup/Popup.js +46 -44
  69. package/dist/components/New/Popup/constants.js +3 -3
  70. package/dist/components/New/Radio/Radio.js +75 -64
  71. package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
  72. package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
  73. package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
  74. package/dist/components/New/Search/Search.js +29 -27
  75. package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
  76. package/dist/components/New/Select/CollapsedSelectTags.js +127 -0
  77. package/dist/components/New/Select/MultiSelectTags.js +18 -15
  78. package/dist/components/New/Select/Select.js +219 -197
  79. package/dist/components/New/Select/constants.js +23 -20
  80. package/dist/components/New/SharedEntityIndicator/SharedEntityIndicator.js +34 -0
  81. package/dist/components/New/SideDrawer/SideDrawer.js +148 -0
  82. package/dist/components/New/Switch/Switch.js +69 -58
  83. package/dist/components/New/Tabs/Tabs.js +125 -61
  84. package/dist/components/New/Tag/Tag.js +42 -40
  85. package/dist/components/New/TagInput/TagInput.js +48 -44
  86. package/dist/components/New/ToggleIconButton/ToggleIconButton.js +26 -24
  87. package/dist/components/New/Tooltip/TooltipContent.js +11 -9
  88. package/dist/components/New/Tooltip/constants.js +1 -1
  89. package/dist/components/New/TransferQueue/TransferQueue.js +124 -0
  90. package/dist/components/New/TransferQueue/TransferQueueHeader.js +71 -0
  91. package/dist/components/New/TransferQueue/TransferQueueRow.js +119 -0
  92. package/dist/components/New/TransferQueue/constants.js +24 -0
  93. package/dist/components/New/constants/overlay.js +17 -9
  94. package/dist/components/Popup/constants.js +8 -8
  95. package/dist/components/ProgressBar/ProgressBar.js +45 -33
  96. package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
  97. package/dist/components/SchemaRenderer/components/SchemaField.js +19 -19
  98. package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +18 -18
  99. package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
  100. package/dist/components/SchemaRenderer/types.js +19 -8
  101. package/dist/components/SchemaRenderer/utils.js +122 -95
  102. package/dist/components/Skeleton/Skeleton.js +25 -19
  103. package/dist/components/Spinner/Spinner.js +7 -5
  104. package/dist/components/Tooltip/TooltipContent.js +11 -11
  105. package/dist/components-manifest.json +1478 -59
  106. package/dist/constants/public-class-names.js +208 -0
  107. package/dist/dial-ui-kit.cjs +2 -2
  108. package/dist/dial-ui-kit.js +337 -292
  109. package/dist/editors.cjs +1 -1
  110. package/dist/file-manager.cjs +1 -1
  111. package/dist/grid.cjs +1 -1
  112. package/dist/index.css +2 -2
  113. package/dist/lazy-BEsZqouS.cjs +1 -0
  114. package/dist/merge-classes-BEJXjzkx.cjs +1 -0
  115. package/dist/migration-guides/0.15.0/legacy-theme-variable-fallbacks-removal.md +69 -0
  116. package/dist/migration-guides/README.md +1 -0
  117. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +419 -399
  118. package/dist/src/components/FileManager/FileManager.d.ts +2 -0
  119. package/dist/src/components/FileManager/FileManagerContext.d.ts +1 -0
  120. package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +2 -1
  121. package/dist/src/components/New/Accordion/Accordion.d.ts +6 -1
  122. package/dist/src/components/New/Avatar/Avatar.d.ts +55 -0
  123. package/dist/src/components/New/Badge/Badge.d.ts +47 -0
  124. package/dist/src/components/New/BottomSheet/BottomSheet.d.ts +84 -0
  125. package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +94 -0
  126. package/dist/src/components/New/Breadcrumbs/constants.d.ts +60 -0
  127. package/dist/src/components/New/Button/Button.d.ts +4 -1
  128. package/dist/src/components/New/Button/ButtonWrappers.d.ts +20 -0
  129. package/dist/src/components/New/Button/utils.d.ts +15 -0
  130. package/dist/src/components/New/ButtonDropdown/ButtonDropdown.d.ts +4 -0
  131. package/dist/src/components/New/Calendar/Calendar.d.ts +7 -1
  132. package/dist/src/components/New/Calendar/constants.d.ts +1 -1
  133. package/dist/src/components/New/ConfirmationPopup/constants.d.ts +0 -1
  134. package/dist/src/components/New/Dropdown/Dropdown.d.ts +9 -1
  135. package/dist/src/components/New/Dropdown/constants.d.ts +3 -0
  136. package/dist/src/components/New/EntityIdentity/EntityIdentity.d.ts +85 -0
  137. package/dist/src/components/New/FileIcon/FileIcon.d.ts +61 -0
  138. package/dist/src/components/New/FileIcon/constants.d.ts +16 -0
  139. package/dist/src/components/New/FileIcon/icons/FileGlyph.d.ts +18 -0
  140. package/dist/src/components/New/FileIcon/icons/FolderGlyph.d.ts +17 -0
  141. package/dist/src/components/New/FileName/FileName.d.ts +79 -0
  142. package/dist/src/components/New/FilterChips/FilterChips.d.ts +69 -0
  143. package/dist/src/components/New/FilterChips/constants.d.ts +13 -0
  144. package/dist/src/components/New/FolderName/FolderName.d.ts +37 -0
  145. package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +16 -1
  146. package/dist/src/components/New/InteractiveTooltip/constants.d.ts +5 -4
  147. package/dist/src/components/New/Notification/Notification.d.ts +18 -0
  148. package/dist/src/components/New/Popup/constants.d.ts +1 -1
  149. package/dist/src/components/New/Select/CollapsedSelectTags.d.ts +22 -0
  150. package/dist/src/components/New/Select/MultiSelectTags.d.ts +5 -0
  151. package/dist/src/components/New/Select/Select.d.ts +9 -0
  152. package/dist/src/components/New/Select/constants.d.ts +3 -2
  153. package/dist/src/components/New/SharedEntityIndicator/SharedEntityIndicator.d.ts +35 -0
  154. package/dist/src/components/New/SideDrawer/SideDrawer.d.ts +100 -0
  155. package/dist/src/components/New/Tabs/Tabs.d.ts +54 -6
  156. package/dist/src/components/New/Tooltip/constants.d.ts +5 -3
  157. package/dist/src/components/New/TransferQueue/TransferQueue.d.ts +139 -0
  158. package/dist/src/components/New/TransferQueue/TransferQueueHeader.d.ts +16 -0
  159. package/dist/src/components/New/TransferQueue/TransferQueueRow.d.ts +10 -0
  160. package/dist/src/components/New/TransferQueue/constants.d.ts +6 -0
  161. package/dist/src/components/New/constants/overlay.d.ts +13 -0
  162. package/dist/src/components/Popup/constants.d.ts +1 -1
  163. package/dist/src/components/SchemaRenderer/types.d.ts +11 -0
  164. package/dist/src/components/SchemaRenderer/utils.d.ts +10 -1
  165. package/dist/src/constants/public-class-names.d.ts +199 -0
  166. package/dist/src/index.d.ts +34 -1
  167. package/dist/src/types/accordion.d.ts +7 -0
  168. package/dist/src/types/avatar.d.ts +7 -0
  169. package/dist/src/types/badge.d.ts +16 -0
  170. package/dist/src/types/breadcrumbs.d.ts +9 -0
  171. package/dist/src/types/button.d.ts +1 -0
  172. package/dist/src/types/entity-type.d.ts +9 -0
  173. package/dist/src/types/transfer-queue.d.ts +10 -0
  174. package/dist/src/utils/__tests__/avatar.spec.d.ts +1 -0
  175. package/dist/src/utils/avatar.d.ts +12 -0
  176. package/dist/src/utils/sub-menu-floating.d.ts +7 -4
  177. package/dist/types/accordion.js +4 -0
  178. package/dist/types/avatar.js +4 -0
  179. package/dist/types/badge.js +5 -0
  180. package/dist/types/breadcrumbs.js +4 -0
  181. package/dist/types/button.js +3 -3
  182. package/dist/types/entity-type.js +4 -0
  183. package/dist/types/transfer-queue.js +4 -0
  184. package/dist/use-file-manager-tabs-Bj_ENNKt.cjs +3 -0
  185. package/dist/utils/avatar.js +22 -0
  186. package/dist/utils/merge-classes.js +12 -5
  187. package/dist/utils/sub-menu-floating.js +99 -54
  188. package/package.json +4 -7
  189. package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
  190. package/dist/IconButton-DWqoaBWf.cjs +0 -1
  191. package/dist/lazy-tfN4sKhq.cjs +0 -1
  192. package/dist/merge-classes-Dipy1Ih1.cjs +0 -1
  193. package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
@@ -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
+ };
@@ -1,76 +1,76 @@
1
1
  import { jsx as t, jsxs as I, Fragment as j } from "react/jsx-runtime";
2
- import { DialIcon as u } from "../../Icon/Icon.js";
3
- import { ButtonAppearance as s } from "../../../types/button.js";
2
+ import { DialIcon as f } from "../../Icon/Icon.js";
3
+ import { ButtonAppearance as c } from "../../../types/button.js";
4
4
  import { ElementSize as o } from "../../../types/size.js";
5
5
  import { mergeClasses as y } from "../../../utils/merge-classes.js";
6
6
  import { resolveAccessibleName as A } from "../../../utils/accessible-name.js";
7
- import { Tooltip as F } from "../Tooltip/Tooltip.js";
8
- import { getButtonClassNames as L } from "./utils.js";
9
- const J = ({
7
+ import { Tooltip as D } from "../Tooltip/Tooltip.js";
8
+ import { getButtonClassNames as F, getDisabledButtonProps as L } from "./utils.js";
9
+ const K = ({
10
10
  label: a,
11
- variant: c,
12
- appearance: l = s.Solid,
11
+ variant: s,
12
+ appearance: r = c.Solid,
13
13
  size: n = o.Standard,
14
14
  className: k,
15
- textClassName: S,
16
- iconAfter: g,
15
+ textClassName: g,
16
+ iconAfter: S,
17
17
  iconBefore: v,
18
- type: N = "button",
19
- tooltipProps: r,
18
+ type: C = "button",
19
+ tooltipProps: l,
20
20
  href: d,
21
- target: p,
22
- rel: C,
21
+ target: b,
22
+ rel: N,
23
23
  disabled: i,
24
24
  ...e
25
25
  }) => {
26
26
  const h = y(
27
27
  "dial-kit-base-button",
28
- c && L(c, l),
28
+ s && F(s, r),
29
29
  n === o.Small ? "dial-tiny-semi-text" : "dial-small-paragraph-semi-text",
30
30
  n === o.Small ? "h-[24px] gap-1" : "h-[40px] gap-2",
31
31
  // Corner radius is themable per size — see the radius tokens in
32
32
  // `buttons.scss`; the standard radius comes from `dial-kit-base-button`.
33
33
  n === o.Small && "dial-kit-base-button-small",
34
- l !== s.Link && (n === o.Small ? "px-2" : "px-4"),
34
+ r !== c.Link && (n === o.Small ? "px-2" : "px-4"),
35
35
  // A link-appearance button sits inline in text, where WCAG 2.5.5 exempts
36
36
  // it and an expanded target would overlap the surrounding copy.
37
- n !== o.Small && l !== s.Link && "dial-kit-enhanced-target",
37
+ n !== o.Small && r !== c.Link && "dial-kit-enhanced-target",
38
38
  k
39
- ), B = a ? void 0 : r?.tooltip, x = A(
39
+ ), B = a ? void 0 : l?.tooltip, p = A(
40
40
  typeof a == "string" ? a : void 0,
41
41
  e["aria-label"],
42
42
  B
43
- ), b = /* @__PURE__ */ I(j, { children: [
44
- /* @__PURE__ */ t(u, { icon: v }),
45
- a && /* @__PURE__ */ t("span", { className: S, children: a }),
46
- /* @__PURE__ */ t(u, { icon: g })
47
- ] }), m = e, f = d !== void 0 ? /* @__PURE__ */ t(
43
+ ), u = /* @__PURE__ */ I(j, { children: [
44
+ /* @__PURE__ */ t(f, { icon: v }),
45
+ a && /* @__PURE__ */ t("span", { className: g, children: a }),
46
+ /* @__PURE__ */ t(f, { icon: S })
47
+ ] }), m = e, x = d !== void 0 ? /* @__PURE__ */ t(
48
48
  "a",
49
49
  {
50
50
  ...m,
51
51
  href: i ? void 0 : d,
52
- target: p,
53
- rel: C ?? (p === "_blank" ? "noopener noreferrer" : void 0),
52
+ target: b,
53
+ rel: N ?? (b === "_blank" ? "noopener noreferrer" : void 0),
54
54
  "aria-disabled": i || void 0,
55
55
  tabIndex: i ? -1 : m.tabIndex,
56
56
  onClick: i ? void 0 : m.onClick,
57
57
  className: h,
58
- "aria-label": x,
59
- children: b
58
+ "aria-label": p,
59
+ children: u
60
60
  }
61
61
  ) : /* @__PURE__ */ t(
62
62
  "button",
63
63
  {
64
64
  ...e,
65
- type: N,
66
- disabled: i,
65
+ ...L(i, l, e.onClick),
66
+ type: C,
67
67
  className: h,
68
- "aria-label": x,
69
- children: b
68
+ "aria-label": p,
69
+ children: u
70
70
  }
71
71
  );
72
- return r ? /* @__PURE__ */ t(F, { asChild: !0, ...r, children: f }) : f;
72
+ return l ? /* @__PURE__ */ t(D, { asChild: !0, ...l, children: x }) : x;
73
73
  };
74
74
  export {
75
- J as Button
75
+ K as Button
76
76
  };
@@ -1,44 +1,100 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { ButtonAppearance as t, ButtonVariant as r } from "../../../types/button.js";
3
- import { Button as B } from "./Button.js";
4
- const u = (n, o) => ({ appearance: a, ...e }) => /* @__PURE__ */ i(
5
- B,
1
+ import { jsx as r, jsxs as B, Fragment as f } from "react/jsx-runtime";
2
+ import { useId as h } from "react";
3
+ import { ButtonAppearance as n, ButtonVariant as o } from "../../../types/button.js";
4
+ import { Button as d } from "./Button.js";
5
+ const l = (a, t) => ({ appearance: s, ...u }) => /* @__PURE__ */ r(
6
+ d,
6
7
  {
7
- ...e,
8
- variant: n,
9
- appearance: a || o
8
+ ...u,
9
+ variant: a,
10
+ appearance: s || t
10
11
  }
11
- ), p = (n, o) => ({ variant: a, ...e }) => /* @__PURE__ */ i(
12
- B,
12
+ ), p = (a, t) => ({ variant: s, ...u }) => /* @__PURE__ */ r(
13
+ d,
13
14
  {
14
- ...e,
15
- variant: a || o,
16
- appearance: n
15
+ ...u,
16
+ variant: s || t,
17
+ appearance: a
17
18
  }
18
- ), d = u(
19
- r.Primary,
20
- t.Solid
21
- ), y = u(
22
- r.Neutral,
23
- t.Solid
24
- ), P = u(
25
- r.Danger,
26
- t.Solid
27
- ), W = p(
28
- t.Link,
29
- r.Primary
30
- ), f = p(
31
- t.Ghost,
32
- r.Primary
33
- ), N = p(
34
- t.Outlined,
35
- r.Neutral
19
+ ), N = l(
20
+ o.Primary,
21
+ n.Solid
22
+ ), C = l(
23
+ o.Neutral,
24
+ n.Solid
25
+ ), G = l(
26
+ o.Danger,
27
+ n.Solid
28
+ ), e = {
29
+ x1: "-5.06",
30
+ y1: "2.26",
31
+ x2: "30.62",
32
+ y2: "22.63",
33
+ from: "var(--stroke-gradient-1, #5976E9)",
34
+ to: "var(--stroke-gradient-2, #885DF2)"
35
+ }, O = ({
36
+ appearance: a = n.Outlined,
37
+ iconBefore: t,
38
+ iconAfter: i,
39
+ style: s,
40
+ ...u
41
+ }) => {
42
+ const c = `dial-kit-starter-gradient-${h().replace(/[^\w-]/g, "")}`, g = /* @__PURE__ */ r(
43
+ "svg",
44
+ {
45
+ className: "pointer-events-none absolute size-0 overflow-hidden",
46
+ "aria-hidden": "true",
47
+ focusable: "false",
48
+ children: /* @__PURE__ */ r("defs", { children: /* @__PURE__ */ B(
49
+ "linearGradient",
50
+ {
51
+ id: c,
52
+ x1: e.x1,
53
+ y1: e.y1,
54
+ x2: e.x2,
55
+ y2: e.y2,
56
+ gradientUnits: "userSpaceOnUse",
57
+ children: [
58
+ /* @__PURE__ */ r("stop", { stopColor: e.from }),
59
+ /* @__PURE__ */ r("stop", { offset: "1", stopColor: e.to })
60
+ ]
61
+ }
62
+ ) })
63
+ }
64
+ ), m = (y) => /* @__PURE__ */ B(f, { children: [
65
+ g,
66
+ y
67
+ ] });
68
+ return /* @__PURE__ */ r(
69
+ d,
70
+ {
71
+ ...u,
72
+ variant: o.Starter,
73
+ appearance: a,
74
+ iconBefore: t ? m(t) : void 0,
75
+ iconAfter: i && !t ? m(i) : i,
76
+ style: {
77
+ "--dial-kit-starter-icon-stroke": `url(#${c})`,
78
+ ...s
79
+ }
80
+ }
81
+ );
82
+ }, D = p(
83
+ n.Link,
84
+ o.Primary
85
+ ), I = p(
86
+ n.Ghost,
87
+ o.Primary
88
+ ), P = p(
89
+ n.Outlined,
90
+ o.Neutral
36
91
  );
37
92
  export {
38
- P as DangerButton,
39
- f as GhostButton,
40
- W as LinkButton,
41
- y as NeutralButton,
42
- N as OutlinedButton,
43
- d as PrimaryButton
93
+ G as DangerButton,
94
+ I as GhostButton,
95
+ D as LinkButton,
96
+ C as NeutralButton,
97
+ P as OutlinedButton,
98
+ N as PrimaryButton,
99
+ O as StarterButton
44
100
  };
@@ -17,6 +17,9 @@ const o = {
17
17
  [i.Static]: {
18
18
  [t.Solid]: "dial-kit-static-solid-button"
19
19
  },
20
+ [i.Starter]: {
21
+ [t.Outlined]: "dial-kit-starter-outlined-button"
22
+ },
20
23
  // TODO: remove these once we have a design for the icon button variants
21
24
  [i.Success]: {},
22
25
  [i.Secondary]: {},
@@ -1,11 +1,21 @@
1
- import { ButtonVariant as o, ButtonAppearance as a } from "../../../types/button.js";
2
- import { variantClassMap as i } from "./constants.js";
3
- const l = (t = o.Primary, r = a.Solid) => {
4
- const n = i[t]?.[r];
5
- return n || (console.warn(
6
- `Could not find Button styles for variant: ${t} and appearance: ${r}. Using default primary solid button styles.`
7
- ), i[o.Primary][a.Solid]);
1
+ import { ButtonVariant as o, ButtonAppearance as r } from "../../../types/button.js";
2
+ import { variantClassMap as a } from "./constants.js";
3
+ const l = (t) => {
4
+ t.preventDefault();
5
+ }, d = (t, n, i) => {
6
+ const e = n != null && !n.hideTooltip && n.tooltip != null && n.tooltip !== "";
7
+ return t && e ? {
8
+ disabled: void 0,
9
+ "aria-disabled": !0,
10
+ onClick: l
11
+ } : { disabled: t, onClick: i };
12
+ }, c = (t = o.Primary, n = r.Solid) => {
13
+ const i = a[t]?.[n];
14
+ return i || (console.warn(
15
+ `Could not find Button styles for variant: ${t} and appearance: ${n}. Using default primary solid button styles.`
16
+ ), a[o.Primary][r.Solid]);
8
17
  };
9
18
  export {
10
- l as getButtonClassNames
19
+ c as getButtonClassNames,
20
+ d as getDisabledButtonProps
11
21
  };
@@ -1,28 +1,38 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { useState as s, useMemo as u } from "react";
3
- import { ButtonAppearance as d, ButtonVariant as c } from "../../../types/button.js";
4
- import { Button as f } from "../Button/Button.js";
2
+ import { useState as u, useMemo as d } from "react";
3
+ import { ButtonAppearance as c, ButtonVariant as f } from "../../../types/button.js";
4
+ import { Button as D } from "../Button/Button.js";
5
5
  import { Dropdown as h } from "../Dropdown/Dropdown.js";
6
- import { getButtonChevron as B } from "./constants.js";
7
- const g = ({
6
+ import { getButtonChevron as l } from "./constants.js";
7
+ import { DIAL_KIT_CLASS as w } from "../../../constants/public-class-names.js";
8
+ const O = ({
8
9
  variant: n,
9
10
  appearance: t,
10
11
  items: e,
11
- ...p
12
+ dropdownProps: p,
13
+ ...a
12
14
  }) => {
13
- const [o, a] = s(!1), i = u(() => B(o), [o]);
14
- return /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(h, { items: e, onOpenChange: (m) => a(m), children: /* @__PURE__ */ r(
15
- f,
15
+ const [o, i] = u(!1), m = d(() => l(o), [o]);
16
+ return /* @__PURE__ */ r("div", { className: w.buttonDropdown, children: /* @__PURE__ */ r(
17
+ h,
16
18
  {
17
19
  ...p,
18
- iconAfter: i,
19
- variant: n || c.Primary,
20
- appearance: t || d.Solid,
21
- "aria-haspopup": "menu",
22
- "aria-expanded": o
20
+ items: e,
21
+ onOpenChange: (s) => i(s),
22
+ children: /* @__PURE__ */ r(
23
+ D,
24
+ {
25
+ ...a,
26
+ iconAfter: m,
27
+ variant: n || f.Primary,
28
+ appearance: t || c.Solid,
29
+ "aria-haspopup": "menu",
30
+ "aria-expanded": o
31
+ }
32
+ )
23
33
  }
24
- ) }) });
34
+ ) });
25
35
  };
26
36
  export {
27
- g as ButtonDropdown
37
+ O as ButtonDropdown
28
38
  };