@epam/ai-dial-ui-kit 0.15.0-dev.5 → 0.15.0-dev.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +194 -1
- package/dist/CHANGELOG.md +86 -0
- package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-CZNa4jVJ.cjs} +31 -31
- package/dist/DateCellRenderer-X6vXPDIG.cjs +1 -0
- package/dist/IconButton-DHOFapLo.cjs +1 -0
- package/dist/JsonEditor-Bxui5wJH.cjs +1 -0
- package/dist/{MarkdownEditor-C9-ZMRVi.cjs → MarkdownEditor-BKtFs714.cjs} +1 -1
- package/dist/MarkdownEditor-Bapd1ycU.cjs +1 -0
- package/dist/MarkdownEditorContainer-B5aHwoYF.cjs +1 -0
- package/dist/{Switch-CUKClcEz.cjs → Switch-DE6MrcqJ.cjs} +1 -1
- package/dist/components/Button/constants.js +9 -8
- package/dist/components/Dropdown/Dropdown.js +70 -65
- package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
- package/dist/components/Dropdown/constants.js +16 -14
- package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
- package/dist/components/FileManager/FileManager.js +373 -372
- package/dist/components/FileManager/FileManagerProvider.js +266 -264
- package/dist/components/FileManager/hooks/use-grid-context-menu.js +59 -59
- package/dist/components/MarkdownEditor/MarkdownEditor.js +23 -21
- package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +27 -27
- package/dist/components/New/Accordion/Accordion.js +87 -71
- package/dist/components/New/AutocompleteTagInput/AutocompleteTagInput.js +207 -0
- package/dist/components/New/AutocompleteTagInput/utils.js +11 -0
- package/dist/components/New/Avatar/Avatar.js +70 -0
- package/dist/components/New/Badge/Badge.js +45 -0
- package/dist/components/New/BottomSheet/BottomSheet.js +128 -0
- package/dist/components/New/Breadcrumbs/Breadcrumbs.js +159 -0
- package/dist/components/New/Breadcrumbs/constants.js +41 -0
- package/dist/components/New/Button/Button.js +32 -32
- package/dist/components/New/Button/ButtonWrappers.js +103 -37
- package/dist/components/New/Button/constants.js +3 -0
- package/dist/components/New/Button/utils.js +18 -8
- package/dist/components/New/ButtonDropdown/ButtonDropdown.js +26 -16
- package/dist/components/New/Calendar/Calendar.js +253 -222
- package/dist/components/New/Calendar/constants.js +5 -5
- package/dist/components/New/CaptionText/CaptionText.js +18 -15
- package/dist/components/New/CardShell/CardShell.js +5 -3
- package/dist/components/New/Checkbox/Checkbox.js +67 -56
- package/dist/components/New/Checkbox/CheckboxBox.js +5 -3
- package/dist/components/New/CloseButton/CloseButton.js +18 -16
- package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
- package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +38 -37
- package/dist/components/New/ConfirmationPopup/constants.js +8 -11
- package/dist/components/New/Dropdown/Dropdown.js +112 -105
- package/dist/components/New/Dropdown/DropdownSubMenuItem.js +17 -17
- package/dist/components/New/Dropdown/constants.js +22 -17
- package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +20 -18
- package/dist/components/New/EntityIdentity/EntityIdentity.js +135 -0
- package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
- package/dist/components/New/FileIcon/FileIcon.js +55 -0
- package/dist/components/New/FileIcon/constants.js +134 -0
- package/dist/components/New/FileIcon/icons/FileGlyph.js +150 -0
- package/dist/components/New/FileIcon/icons/FolderGlyph.js +50 -0
- package/dist/components/New/FileName/FileName.js +78 -0
- package/dist/components/New/FilterChips/FilterChips.js +43 -0
- package/dist/components/New/FilterChips/constants.js +5 -0
- package/dist/components/New/FolderName/FolderName.js +16 -0
- package/dist/components/New/FolderPath/FolderPath.js +29 -28
- package/dist/components/New/Highlight/Highlight.js +23 -30
- package/dist/components/New/IconButton/IconButton.js +30 -28
- package/dist/components/New/InfoButton/InfoButton.js +13 -11
- package/dist/components/New/InlineSelect/InlineSelect.js +74 -56
- package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +41 -39
- package/dist/components/New/InteractiveTooltip/constants.js +2 -2
- package/dist/components/New/Label/Label.js +13 -8
- package/dist/components/New/MarkdownEditor/MarkdownEditor.js +29 -27
- package/dist/components/New/MenuItem/MenuItem.js +29 -27
- package/dist/components/New/MenuItem/constants.js +9 -8
- package/dist/components/New/NoDataContent/NoDataContent.js +21 -19
- package/dist/components/New/Notification/Notification.js +33 -29
- package/dist/components/New/NumberInput/NumberInput.js +42 -33
- package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
- package/dist/components/New/Popup/Popup.js +46 -44
- package/dist/components/New/Popup/constants.js +3 -3
- package/dist/components/New/Radio/Radio.js +75 -64
- package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
- package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
- package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
- package/dist/components/New/SchemaRenderer/SchemaRenderer.js +164 -0
- package/dist/components/New/SchemaRenderer/components/SchemaAnyOfEditor.js +65 -0
- package/dist/components/New/SchemaRenderer/components/SchemaArrayEditor.js +109 -0
- package/dist/components/New/SchemaRenderer/components/SchemaField.js +83 -0
- package/dist/components/New/SchemaRenderer/components/SchemaFieldContent.js +72 -0
- package/dist/components/New/SchemaRenderer/components/SchemaJsonEditor.js +41 -0
- package/dist/components/New/SchemaRenderer/components/SchemaKeyValueEditor.js +250 -0
- package/dist/components/New/SchemaRenderer/components/SchemaObjectEditor.js +36 -0
- package/dist/components/New/SchemaRenderer/components/SchemaOneOfEditor.js +163 -0
- package/dist/components/New/SchemaRenderer/components/SchemaPrimitiveField.js +150 -0
- package/dist/components/New/SchemaRenderer/components/SchemaSection.js +135 -0
- package/dist/components/New/SchemaRenderer/context.js +17 -0
- package/dist/components/New/Search/Search.js +29 -27
- package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
- package/dist/components/New/Select/CollapsedSelectTags.js +127 -0
- package/dist/components/New/Select/MultiSelectTags.js +18 -15
- package/dist/components/New/Select/Select.js +219 -197
- package/dist/components/New/Select/constants.js +23 -20
- package/dist/components/New/SharedEntityIndicator/SharedEntityIndicator.js +34 -0
- package/dist/components/New/SideDrawer/SideDrawer.js +148 -0
- package/dist/components/New/Slider/Slider.js +151 -90
- package/dist/components/New/Slider/utils.js +12 -0
- package/dist/components/New/Switch/Switch.js +69 -58
- package/dist/components/New/Tabs/Tabs.js +125 -61
- package/dist/components/New/Tag/Tag.js +42 -40
- package/dist/components/New/TagInput/TagInput.js +48 -44
- package/dist/components/New/Textarea/Textarea.js +21 -20
- package/dist/components/New/ToggleIconButton/ToggleIconButton.js +26 -24
- package/dist/components/New/Tooltip/TooltipContent.js +11 -9
- package/dist/components/New/Tooltip/constants.js +1 -1
- package/dist/components/New/TransferQueue/TransferQueue.js +124 -0
- package/dist/components/New/TransferQueue/TransferQueueHeader.js +71 -0
- package/dist/components/New/TransferQueue/TransferQueueRow.js +119 -0
- package/dist/components/New/TransferQueue/constants.js +24 -0
- package/dist/components/New/constants/overlay.js +17 -9
- package/dist/components/Popup/constants.js +8 -8
- package/dist/components/ProgressBar/ProgressBar.js +45 -33
- package/dist/components/SchemaRenderer/SchemaRenderer.js +16 -15
- package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
- package/dist/components/SchemaRenderer/components/SchemaAnyOfEditor.js +2 -2
- package/dist/components/SchemaRenderer/components/SchemaArrayEditor.js +1 -1
- package/dist/components/SchemaRenderer/components/SchemaField.js +23 -23
- package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +19 -19
- package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
- package/dist/components/SchemaRenderer/components/SchemaObjectEditor.js +1 -1
- package/dist/components/SchemaRenderer/components/SchemaOneOfEditor.js +13 -13
- package/dist/components/SchemaRenderer/components/SchemaPrimitiveField.js +5 -5
- package/dist/components/Skeleton/Skeleton.js +25 -19
- package/dist/components/Spinner/Spinner.js +7 -5
- package/dist/components/Tooltip/TooltipContent.js +11 -11
- package/dist/components-manifest.json +1837 -84
- package/dist/constants/public-class-names.js +218 -0
- package/dist/constants/schema-renderer.js +33 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +356 -307
- package/dist/editors.cjs +1 -1
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +2 -2
- package/dist/lazy-_W6FYhKg.cjs +1 -0
- package/dist/merge-classes-BEJXjzkx.cjs +1 -0
- package/dist/migration-guides/0.15.0/legacy-theme-variable-fallbacks-removal.md +69 -0
- package/dist/migration-guides/0.15.0/slider-redesign.md +110 -0
- package/dist/migration-guides/README.md +2 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +419 -399
- package/dist/src/components/FileManager/FileManager.d.ts +2 -0
- package/dist/src/components/FileManager/FileManagerContext.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +2 -1
- package/dist/src/components/MarkdownEditor/MarkdownEditor.d.ts +2 -0
- package/dist/src/components/MarkdownEditor/MarkdownEditorContainer.d.ts +2 -0
- package/dist/src/components/New/Accordion/Accordion.d.ts +6 -1
- package/dist/src/components/New/AutocompleteTagInput/AutocompleteTagInput.d.ts +97 -0
- package/dist/src/components/New/AutocompleteTagInput/utils.d.ts +17 -0
- package/dist/src/components/New/AutocompleteTagInput/utils.spec.d.ts +1 -0
- package/dist/src/components/New/Avatar/Avatar.d.ts +55 -0
- package/dist/src/components/New/Badge/Badge.d.ts +47 -0
- package/dist/src/components/New/BottomSheet/BottomSheet.d.ts +84 -0
- package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +94 -0
- package/dist/src/components/New/Breadcrumbs/constants.d.ts +60 -0
- package/dist/src/components/New/Button/Button.d.ts +4 -1
- package/dist/src/components/New/Button/ButtonWrappers.d.ts +21 -0
- package/dist/src/components/New/Button/utils.d.ts +15 -0
- package/dist/src/components/New/ButtonDropdown/ButtonDropdown.d.ts +4 -0
- package/dist/src/components/New/Calendar/constants.d.ts +1 -1
- package/dist/src/components/New/ConfirmationPopup/constants.d.ts +0 -1
- package/dist/src/components/New/Dropdown/Dropdown.d.ts +9 -1
- package/dist/src/components/New/Dropdown/constants.d.ts +3 -0
- package/dist/src/components/New/EntityIdentity/EntityIdentity.d.ts +85 -0
- package/dist/src/components/New/FileIcon/FileIcon.d.ts +61 -0
- package/dist/src/components/New/FileIcon/constants.d.ts +16 -0
- package/dist/src/components/New/FileIcon/icons/FileGlyph.d.ts +18 -0
- package/dist/src/components/New/FileIcon/icons/FolderGlyph.d.ts +17 -0
- package/dist/src/components/New/FileName/FileName.d.ts +79 -0
- package/dist/src/components/New/FilterChips/FilterChips.d.ts +69 -0
- package/dist/src/components/New/FilterChips/constants.d.ts +13 -0
- package/dist/src/components/New/FolderName/FolderName.d.ts +37 -0
- package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +16 -1
- package/dist/src/components/New/InteractiveTooltip/constants.d.ts +5 -4
- package/dist/src/components/New/MarkdownEditor/MarkdownEditor.d.ts +3 -0
- package/dist/src/components/New/Notification/Notification.d.ts +18 -0
- package/dist/src/components/New/Popup/constants.d.ts +1 -1
- package/dist/src/components/New/SchemaRenderer/SchemaRenderer.d.ts +38 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaAnyOfEditor.d.ts +37 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaArrayEditor.d.ts +35 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaField.d.ts +33 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaFieldContent.d.ts +30 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaJsonEditor.d.ts +29 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaKeyValueEditor.d.ts +37 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaObjectEditor.d.ts +32 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaOneOfEditor.d.ts +39 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaPrimitiveField.d.ts +38 -0
- package/dist/src/components/New/SchemaRenderer/components/SchemaSection.d.ts +39 -0
- package/dist/src/components/New/SchemaRenderer/context.d.ts +8 -0
- package/dist/src/components/New/SchemaRenderer/types.d.ts +76 -0
- package/dist/src/components/New/Select/CollapsedSelectTags.d.ts +22 -0
- package/dist/src/components/New/Select/MultiSelectTags.d.ts +5 -0
- package/dist/src/components/New/Select/Select.d.ts +9 -0
- package/dist/src/components/New/Select/constants.d.ts +3 -2
- package/dist/src/components/New/SharedEntityIndicator/SharedEntityIndicator.d.ts +35 -0
- package/dist/src/components/New/SideDrawer/SideDrawer.d.ts +100 -0
- package/dist/src/components/New/Slider/Slider.d.ts +20 -1
- package/dist/src/components/New/Slider/utils.d.ts +6 -0
- package/dist/src/components/New/Slider/utils.spec.d.ts +1 -0
- package/dist/src/components/New/Tabs/Tabs.d.ts +54 -6
- package/dist/src/components/New/Tooltip/constants.d.ts +5 -3
- package/dist/src/components/New/TransferQueue/TransferQueue.d.ts +139 -0
- package/dist/src/components/New/TransferQueue/TransferQueueHeader.d.ts +16 -0
- package/dist/src/components/New/TransferQueue/TransferQueueRow.d.ts +10 -0
- package/dist/src/components/New/TransferQueue/constants.d.ts +6 -0
- package/dist/src/components/New/constants/overlay.d.ts +13 -0
- package/dist/src/components/Popup/constants.d.ts +1 -1
- package/dist/src/components/SchemaRenderer/types.d.ts +5 -82
- package/dist/src/components/SchemaRenderer/utils.d.ts +1 -13
- package/dist/src/constants/public-class-names.d.ts +209 -0
- package/dist/src/constants/schema-renderer.d.ts +2 -0
- package/dist/src/index.d.ts +39 -2
- package/dist/src/models/json-schema.d.ts +71 -0
- package/dist/src/types/accordion.d.ts +7 -0
- package/dist/src/types/avatar.d.ts +7 -0
- package/dist/src/types/badge.d.ts +16 -0
- package/dist/src/types/breadcrumbs.d.ts +9 -0
- package/dist/src/types/button.d.ts +1 -0
- package/dist/src/types/entity-type.d.ts +9 -0
- package/dist/src/types/json-schema.d.ts +22 -0
- package/dist/src/types/transfer-queue.d.ts +10 -0
- package/dist/src/utils/__tests__/avatar.spec.d.ts +1 -0
- package/dist/src/utils/avatar.d.ts +12 -0
- package/dist/src/utils/json-schema.d.ts +23 -0
- package/dist/src/utils/sub-menu-floating.d.ts +7 -4
- package/dist/types/accordion.js +4 -0
- package/dist/types/avatar.js +4 -0
- package/dist/types/badge.js +5 -0
- package/dist/types/breadcrumbs.js +4 -0
- package/dist/types/button.js +3 -3
- package/dist/types/entity-type.js +4 -0
- package/dist/types/json-schema.js +7 -0
- package/dist/types/transfer-queue.js +4 -0
- package/dist/use-file-manager-tabs-Bzzwwcgk.cjs +3 -0
- package/dist/utils/avatar.js +22 -0
- package/dist/{components/SchemaRenderer/utils.js → utils/json-schema.js} +122 -95
- package/dist/utils/merge-classes.js +12 -5
- package/dist/utils/sub-menu-floating.js +99 -54
- package/package.json +4 -9
- package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
- package/dist/IconButton-DWqoaBWf.cjs +0 -1
- package/dist/JsonEditor-D2jSlRFi.cjs +0 -1
- package/dist/MarkdownEditor-BzEbdj7R.cjs +0 -1
- package/dist/MarkdownEditorContainer-BvwJjkiZ.cjs +0 -1
- package/dist/components/SchemaRenderer/types.js +0 -27
- package/dist/editor-_174x-qy.cjs +0 -1
- package/dist/lazy-DM-7dL0Y.cjs +0 -1
- package/dist/merge-classes-Dipy1Ih1.cjs +0 -1
- package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
|
@@ -1,54 +1,56 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback as f } from "react";
|
|
3
|
-
import { ButtonAppearance as
|
|
3
|
+
import { ButtonAppearance as B, ButtonVariant as b } from "../../../types/button.js";
|
|
4
4
|
import { ElementSize as C } from "../../../types/size.js";
|
|
5
|
-
import { mergeClasses as
|
|
6
|
-
import { resolveAccessibleName as
|
|
7
|
-
import { IconButton as
|
|
8
|
-
import { Tooltip as
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { mergeClasses as I } from "../../../utils/merge-classes.js";
|
|
6
|
+
import { resolveAccessibleName as g } from "../../../utils/accessible-name.js";
|
|
7
|
+
import { IconButton as A } from "../IconButton/IconButton.js";
|
|
8
|
+
import { Tooltip as h } from "../Tooltip/Tooltip.js";
|
|
9
|
+
import { DIAL_KIT_CLASS as v } from "../../../constants/public-class-names.js";
|
|
10
|
+
const y = ({
|
|
11
|
+
icon: t,
|
|
11
12
|
selectedIcon: l,
|
|
12
|
-
isSelected:
|
|
13
|
-
onToggle:
|
|
13
|
+
isSelected: o = !1,
|
|
14
|
+
onToggle: a,
|
|
14
15
|
onClick: m,
|
|
15
|
-
tooltipProps:
|
|
16
|
+
tooltipProps: r,
|
|
16
17
|
size: s = C.Small,
|
|
17
18
|
className: c,
|
|
18
19
|
...n
|
|
19
20
|
}) => {
|
|
20
21
|
const p = f(
|
|
21
22
|
(u) => {
|
|
22
|
-
m?.(u),
|
|
23
|
+
m?.(u), a?.(!o);
|
|
23
24
|
},
|
|
24
|
-
[m,
|
|
25
|
+
[m, a, o]
|
|
25
26
|
), e = /* @__PURE__ */ i(
|
|
26
|
-
|
|
27
|
+
A,
|
|
27
28
|
{
|
|
28
29
|
...n,
|
|
29
30
|
size: s,
|
|
30
|
-
variant:
|
|
31
|
-
appearance:
|
|
32
|
-
icon:
|
|
33
|
-
"aria-pressed":
|
|
34
|
-
"aria-label":
|
|
31
|
+
variant: b.Primary,
|
|
32
|
+
appearance: B.Ghost,
|
|
33
|
+
icon: o ? l ?? t : t,
|
|
34
|
+
"aria-pressed": o,
|
|
35
|
+
"aria-label": g(
|
|
35
36
|
n["aria-label"],
|
|
36
|
-
|
|
37
|
+
r?.tooltip
|
|
37
38
|
),
|
|
38
39
|
onClick: p,
|
|
39
|
-
className:
|
|
40
|
+
className: I(
|
|
40
41
|
"!rounded",
|
|
41
42
|
// The glyph stays 16px at every size tier — only the tint square grows.
|
|
42
43
|
// CSS outranks the width/height attributes Tabler renders, so callers
|
|
43
44
|
// need not pass a size and the two icons can never disagree.
|
|
44
45
|
"[&_svg]:size-4",
|
|
45
|
-
|
|
46
|
-
c
|
|
46
|
+
o && "!text-accent",
|
|
47
|
+
c,
|
|
48
|
+
v.toggleIconButton
|
|
47
49
|
)
|
|
48
50
|
}
|
|
49
51
|
);
|
|
50
|
-
return
|
|
52
|
+
return r ? /* @__PURE__ */ i(h, { asChild: !0, ...r, children: e }) : e;
|
|
51
53
|
};
|
|
52
54
|
export {
|
|
53
|
-
|
|
55
|
+
y as ToggleIconButton
|
|
54
56
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useMergeRefs as i, FloatingPortal as
|
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { useMergeRefs as i, FloatingPortal as p, FloatingArrow as c } from "@floating-ui/react";
|
|
3
3
|
import f from "classnames";
|
|
4
4
|
import { useRef as g } from "react";
|
|
5
5
|
import { useThemeScope as u } from "../ThemeScope/ThemeScope.js";
|
|
6
6
|
import { useHasHover as x } from "../../../hooks/use-has-hover.js";
|
|
7
7
|
import { arrowClassName as d, tooltipClassName as h } from "./constants.js";
|
|
8
8
|
import { useTooltipContext as N } from "./TooltipContext.js";
|
|
9
|
-
|
|
9
|
+
import { DIAL_KIT_CLASS as C } from "../../../constants/public-class-names.js";
|
|
10
|
+
const j = ({
|
|
10
11
|
style: r,
|
|
11
12
|
...t
|
|
12
13
|
}) => {
|
|
13
|
-
const o = N(), s = x(), l = u(), a = g(null),
|
|
14
|
-
return !o.open || !s ? null : /* @__PURE__ */ e(
|
|
14
|
+
const o = N(), s = x(), l = u(), a = g(null), m = i([o.refs.setFloating, a]);
|
|
15
|
+
return !o.open || !s ? null : /* @__PURE__ */ e(p, { id: "tooltip-portal", children: /* @__PURE__ */ n(
|
|
15
16
|
"div",
|
|
16
17
|
{
|
|
17
|
-
ref:
|
|
18
|
+
ref: m,
|
|
18
19
|
"data-placement": o.placement,
|
|
19
20
|
style: {
|
|
20
21
|
...o.floatingStyles,
|
|
@@ -24,12 +25,13 @@ const T = ({
|
|
|
24
25
|
className: f(
|
|
25
26
|
h,
|
|
26
27
|
l,
|
|
27
|
-
o.getFloatingProps(t).className
|
|
28
|
+
o.getFloatingProps(t).className,
|
|
29
|
+
C.tooltip
|
|
28
30
|
),
|
|
29
31
|
children: [
|
|
30
32
|
t.children,
|
|
31
33
|
/* @__PURE__ */ e(
|
|
32
|
-
|
|
34
|
+
c,
|
|
33
35
|
{
|
|
34
36
|
ref: o.arrowRef,
|
|
35
37
|
context: o.context,
|
|
@@ -41,5 +43,5 @@ const T = ({
|
|
|
41
43
|
) });
|
|
42
44
|
};
|
|
43
45
|
export {
|
|
44
|
-
|
|
46
|
+
j as TooltipContent
|
|
45
47
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const t = 7, o = 2, e = 500, r = "fill-control-inverted", s = "z-
|
|
1
|
+
const t = 7, o = 2, e = 500, r = "fill-control-inverted", s = "z-tooltip max-w-[376px] whitespace-pre-wrap break-words rounded-lg bg-control-inverted px-3 py-2 dial-small-text text-control-inverted shadow-xs";
|
|
2
2
|
export {
|
|
3
3
|
o as ARROW_GAP,
|
|
4
4
|
t as ARROW_HEIGHT,
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { jsxs as b, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useId as Q, useCallback as m, useEffect as w } from "react";
|
|
3
|
+
import { ConfirmationPopup as D } from "../ConfirmationPopup/ConfirmationPopup.js";
|
|
4
|
+
import { ProgressBar as U } from "../../ProgressBar/ProgressBar.js";
|
|
5
|
+
import { DIAL_KIT_CLASS as F } from "../../../constants/public-class-names.js";
|
|
6
|
+
import { ConfirmationPopupVariant as R } from "../../../types/confirmation-popup.js";
|
|
7
|
+
import { ElementSize as N } from "../../../types/size.js";
|
|
8
|
+
import { TransferQueueItemStatus as l } from "../../../types/transfer-queue.js";
|
|
9
|
+
import { mergeClasses as T } from "../../../utils/merge-classes.js";
|
|
10
|
+
import { DEFAULT_TRANSFER_QUEUE_LABELS as O, TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS as y } from "./constants.js";
|
|
11
|
+
import { TransferQueueHeader as M } from "./TransferQueueHeader.js";
|
|
12
|
+
import { TransferQueueRow as j } from "./TransferQueueRow.js";
|
|
13
|
+
const q = (n) => Math.round(
|
|
14
|
+
n.reduce(
|
|
15
|
+
(e, r) => e + (r.percent ?? (r.status === l.InProgress ? 0 : 100)),
|
|
16
|
+
0
|
|
17
|
+
) / n.length
|
|
18
|
+
), z = (n, e, r) => n && e ? r.closeConfirmDescriptionMixed : e ? r.closeConfirmDescriptionFailed : r.closeConfirmDescriptionInProgress, ee = ({
|
|
19
|
+
title: n,
|
|
20
|
+
items: e,
|
|
21
|
+
onClose: r,
|
|
22
|
+
onCancelItem: E,
|
|
23
|
+
labels: S,
|
|
24
|
+
autoCloseDelay: i = y,
|
|
25
|
+
className: v,
|
|
26
|
+
bodyClassName: x
|
|
27
|
+
}) => {
|
|
28
|
+
const [c, I] = h(!1), [L, f] = h(!1), p = Q(), s = { ...O, ...S }, d = e.filter(
|
|
29
|
+
(o) => o.status === l.InProgress
|
|
30
|
+
).length, a = d > 0, g = e.filter(
|
|
31
|
+
(o) => o.status === l.Failed
|
|
32
|
+
).length, u = g > 0, C = e.length > 0 && e.every((o) => o.status === l.Success), P = m(() => {
|
|
33
|
+
a || u ? f(!0) : r();
|
|
34
|
+
}, [a, u, r]), A = m(() => {
|
|
35
|
+
f(!1), r();
|
|
36
|
+
}, [r]), _ = m(() => {
|
|
37
|
+
I((o) => !o);
|
|
38
|
+
}, []);
|
|
39
|
+
return w(() => {
|
|
40
|
+
if (!C || i <= 0) return;
|
|
41
|
+
const o = setTimeout(r, i);
|
|
42
|
+
return () => clearTimeout(o);
|
|
43
|
+
}, [C, i, r]), e.length === 0 ? null : /* @__PURE__ */ b(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
role: "status",
|
|
47
|
+
"aria-live": "polite",
|
|
48
|
+
className: T(
|
|
49
|
+
"w-[370px] max-w-[calc(100vw-2rem)] rounded-xl bg-layer-raised shadow-md",
|
|
50
|
+
v,
|
|
51
|
+
F.transferQueue
|
|
52
|
+
),
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ t(
|
|
55
|
+
M,
|
|
56
|
+
{
|
|
57
|
+
title: n,
|
|
58
|
+
failedCount: g,
|
|
59
|
+
isCollapsed: c,
|
|
60
|
+
itemsId: p,
|
|
61
|
+
labels: s,
|
|
62
|
+
onToggleCollapse: _,
|
|
63
|
+
onClose: P
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
c && a && /*
|
|
67
|
+
* Only while collapsed: expanded, every running row already shows its
|
|
68
|
+
* own spinner, so an aggregate bar would restate what is on screen.
|
|
69
|
+
*/
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
U,
|
|
72
|
+
{
|
|
73
|
+
value: q(e),
|
|
74
|
+
size: N.Small,
|
|
75
|
+
"aria-label": s.queueProgressAriaLabel,
|
|
76
|
+
"aria-valuetext": s.queueProgressValueText(
|
|
77
|
+
e.length - d,
|
|
78
|
+
e.length
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
!c && /* @__PURE__ */ t(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
id: p,
|
|
86
|
+
className: T(
|
|
87
|
+
"flex max-h-[40vh] flex-col overflow-y-auto py-1",
|
|
88
|
+
x
|
|
89
|
+
),
|
|
90
|
+
children: e.map((o) => /* @__PURE__ */ t(
|
|
91
|
+
j,
|
|
92
|
+
{
|
|
93
|
+
item: o,
|
|
94
|
+
labels: s,
|
|
95
|
+
onCancel: E
|
|
96
|
+
},
|
|
97
|
+
o.id
|
|
98
|
+
))
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ t(
|
|
102
|
+
D,
|
|
103
|
+
{
|
|
104
|
+
open: L,
|
|
105
|
+
header: s.closeConfirmHeader,
|
|
106
|
+
description: z(
|
|
107
|
+
a,
|
|
108
|
+
u,
|
|
109
|
+
s
|
|
110
|
+
),
|
|
111
|
+
confirmLabel: s.closeConfirmLabel,
|
|
112
|
+
cancelLabel: s.closeCancelLabel,
|
|
113
|
+
variant: R.Danger,
|
|
114
|
+
onConfirm: A,
|
|
115
|
+
onClose: () => f(!1)
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
export {
|
|
123
|
+
ee as TransferQueue
|
|
124
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { IconChevronUp as f, IconChevronDown as S, IconX as I } from "@tabler/icons-react";
|
|
3
|
+
import { GhostIconButton as t } from "../IconButton/IconButtonWrappers.js";
|
|
4
|
+
import { DIAL_KIT_ICON_STROKE as o } from "../constants/icon.js";
|
|
5
|
+
import { DIAL_ICON_SIZE as s } from "../../../constants/icon.js";
|
|
6
|
+
import { ElementSize as m } from "../../../types/size.js";
|
|
7
|
+
import { STATUS_SLOT_CLASS as c } from "./constants.js";
|
|
8
|
+
const k = ({
|
|
9
|
+
title: l,
|
|
10
|
+
failedCount: n,
|
|
11
|
+
isCollapsed: r,
|
|
12
|
+
itemsId: p,
|
|
13
|
+
labels: a,
|
|
14
|
+
onToggleCollapse: d,
|
|
15
|
+
onClose: x
|
|
16
|
+
}) => {
|
|
17
|
+
const h = r ? f : S;
|
|
18
|
+
return /* @__PURE__ */ i("div", { className: "mx-4 flex items-center justify-between border-b border-tertiary py-3", children: [
|
|
19
|
+
/* @__PURE__ */ i("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
20
|
+
/* @__PURE__ */ e("span", { className: "dial-small-paragraph-semi-text truncate text-primary", children: l }),
|
|
21
|
+
n > 0 && /*
|
|
22
|
+
* On the filled --bg-control-error swatch, so it takes the on-control
|
|
23
|
+
* token; --text-tertiary would contrast at under 2:1 over that fill.
|
|
24
|
+
*/
|
|
25
|
+
/* @__PURE__ */ e("span", { className: "dial-small-paragraph-semi-text inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-control-error px-1 text-control-permanent", children: n })
|
|
26
|
+
] }),
|
|
27
|
+
/* @__PURE__ */ i("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
28
|
+
/* @__PURE__ */ e(
|
|
29
|
+
t,
|
|
30
|
+
{
|
|
31
|
+
"aria-label": r ? a.expandAriaLabel : a.collapseAriaLabel,
|
|
32
|
+
"aria-expanded": !r,
|
|
33
|
+
"aria-controls": p,
|
|
34
|
+
size: m.Small,
|
|
35
|
+
icon: /* @__PURE__ */ e(
|
|
36
|
+
h,
|
|
37
|
+
{
|
|
38
|
+
size: s.SM,
|
|
39
|
+
stroke: o,
|
|
40
|
+
className: "text-secondary",
|
|
41
|
+
"aria-hidden": !0
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
onClick: d,
|
|
45
|
+
className: c
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ e(
|
|
49
|
+
t,
|
|
50
|
+
{
|
|
51
|
+
"aria-label": a.closeAriaLabel,
|
|
52
|
+
size: m.Small,
|
|
53
|
+
icon: /* @__PURE__ */ e(
|
|
54
|
+
I,
|
|
55
|
+
{
|
|
56
|
+
size: s.SM,
|
|
57
|
+
stroke: o,
|
|
58
|
+
className: "text-secondary",
|
|
59
|
+
"aria-hidden": !0
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
onClick: x,
|
|
63
|
+
className: c
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] })
|
|
67
|
+
] });
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
k as TransferQueueHeader
|
|
71
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { IconX as d, IconCheck as u, IconAlertCircleFilled as f, IconAlertTriangleFilled as g } from "@tabler/icons-react";
|
|
3
|
+
import { EllipsisTooltip as I } from "../EllipsisTooltip/EllipsisTooltip.js";
|
|
4
|
+
import { FileIcon as h } from "../FileIcon/FileIcon.js";
|
|
5
|
+
import { GhostIconButton as S } from "../IconButton/IconButtonWrappers.js";
|
|
6
|
+
import { Tooltip as x } from "../Tooltip/Tooltip.js";
|
|
7
|
+
import { DIAL_KIT_ICON_STROKE as m } from "../constants/icon.js";
|
|
8
|
+
import { Spinner as y } from "../../Spinner/Spinner.js";
|
|
9
|
+
import { DIAL_ICON_SIZE as t } from "../../../constants/icon.js";
|
|
10
|
+
import { DialItemType as N } from "../../../types/item.js";
|
|
11
|
+
import { ElementSize as T } from "../../../types/size.js";
|
|
12
|
+
import { TransferQueueItemStatus as s } from "../../../types/transfer-queue.js";
|
|
13
|
+
import { mergeClasses as i } from "../../../utils/merge-classes.js";
|
|
14
|
+
import { STATUS_SLOT_CLASS as c } from "./constants.js";
|
|
15
|
+
const p = ({ message: e, isError: a }) => /* @__PURE__ */ r(x, { tooltip: e, asChild: !0, children: /* @__PURE__ */ r(
|
|
16
|
+
"span",
|
|
17
|
+
{
|
|
18
|
+
className: c,
|
|
19
|
+
role: "img",
|
|
20
|
+
"aria-label": e,
|
|
21
|
+
tabIndex: 0,
|
|
22
|
+
children: /* @__PURE__ */ r(
|
|
23
|
+
a ? f : g,
|
|
24
|
+
{
|
|
25
|
+
size: t.SM,
|
|
26
|
+
className: a ? "text-error" : "text-warning-icon",
|
|
27
|
+
"aria-hidden": !0
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
) }), j = ({
|
|
32
|
+
item: e,
|
|
33
|
+
labels: a,
|
|
34
|
+
onCancel: o
|
|
35
|
+
}) => {
|
|
36
|
+
const n = e.status === s.Canceled;
|
|
37
|
+
return /* @__PURE__ */ l("div", { className: "group flex items-center gap-2 px-4 py-2", children: [
|
|
38
|
+
/* @__PURE__ */ r(
|
|
39
|
+
h,
|
|
40
|
+
{
|
|
41
|
+
type: N.File,
|
|
42
|
+
name: e.name,
|
|
43
|
+
size: t.MD,
|
|
44
|
+
className: i(n && "opacity-50"),
|
|
45
|
+
decorative: !0
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ r(
|
|
49
|
+
I,
|
|
50
|
+
{
|
|
51
|
+
text: e.name,
|
|
52
|
+
className: i(
|
|
53
|
+
"dial-small-text",
|
|
54
|
+
n ? "text-secondary" : "text-primary"
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
e.status === s.InProgress && /* @__PURE__ */ l("div", { className: i(c, "grid"), children: [
|
|
59
|
+
/* @__PURE__ */ r(
|
|
60
|
+
y,
|
|
61
|
+
{
|
|
62
|
+
size: t.SM,
|
|
63
|
+
ariaLabel: a.itemProgressAriaLabel(e.name),
|
|
64
|
+
className: i(
|
|
65
|
+
"pointer-events-none col-start-1 row-start-1 transition-opacity",
|
|
66
|
+
o && "group-focus-within:opacity-0 group-hover:opacity-0"
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
o && /* @__PURE__ */ r(
|
|
71
|
+
S,
|
|
72
|
+
{
|
|
73
|
+
"aria-label": a.cancelItemAriaLabel(e.name),
|
|
74
|
+
size: T.Small,
|
|
75
|
+
icon: /* @__PURE__ */ r(
|
|
76
|
+
d,
|
|
77
|
+
{
|
|
78
|
+
size: t.SM,
|
|
79
|
+
stroke: m,
|
|
80
|
+
className: "text-secondary",
|
|
81
|
+
"aria-hidden": !0
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
onClick: () => o(e.id),
|
|
85
|
+
className: "col-start-1 row-start-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] }),
|
|
89
|
+
e.status === s.Success && /* @__PURE__ */ r(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: c,
|
|
93
|
+
role: "img",
|
|
94
|
+
"aria-label": a.successLabel,
|
|
95
|
+
children: /* @__PURE__ */ r(
|
|
96
|
+
u,
|
|
97
|
+
{
|
|
98
|
+
size: t.SM,
|
|
99
|
+
stroke: m,
|
|
100
|
+
className: "text-accent",
|
|
101
|
+
"aria-hidden": !0
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
e.status === s.Warning && /* @__PURE__ */ r(
|
|
107
|
+
p,
|
|
108
|
+
{
|
|
109
|
+
message: e.message || a.warningMessage,
|
|
110
|
+
isError: !1
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
e.status === s.Failed && /* @__PURE__ */ r(p, { message: e.message || a.failedMessage, isError: !0 }),
|
|
114
|
+
n && /* @__PURE__ */ r("span", { className: "dial-small-text shrink-0 text-secondary", children: a.canceledLabel })
|
|
115
|
+
] });
|
|
116
|
+
};
|
|
117
|
+
export {
|
|
118
|
+
j as TransferQueueRow
|
|
119
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const l = 8e3, a = "flex size-7 shrink-0 items-center justify-center", i = {
|
|
2
|
+
cancelItemAriaLabel: (e) => `Cancel "${e}"`,
|
|
3
|
+
itemProgressAriaLabel: (e) => `"${e}" in progress`,
|
|
4
|
+
successLabel: "Completed",
|
|
5
|
+
canceledLabel: "Canceled",
|
|
6
|
+
failedMessage: "Failed",
|
|
7
|
+
warningMessage: "Completed with warnings",
|
|
8
|
+
queueProgressAriaLabel: "Progress",
|
|
9
|
+
queueProgressValueText: (e, s) => `${e} of ${s}`,
|
|
10
|
+
collapseAriaLabel: "Collapse",
|
|
11
|
+
expandAriaLabel: "Expand",
|
|
12
|
+
closeAriaLabel: "Close",
|
|
13
|
+
closeConfirmHeader: "Close?",
|
|
14
|
+
closeConfirmDescriptionInProgress: "Some items are still in progress.",
|
|
15
|
+
closeConfirmDescriptionFailed: "Some items have failed.",
|
|
16
|
+
closeConfirmDescriptionMixed: "Some items are still in progress, and some have failed.",
|
|
17
|
+
closeConfirmLabel: "Close",
|
|
18
|
+
closeCancelLabel: "Cancel"
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
i as DEFAULT_TRANSFER_QUEUE_LABELS,
|
|
22
|
+
a as STATUS_SLOT_CLASS,
|
|
23
|
+
l as TRANSFER_QUEUE_AUTO_CLOSE_DELAY_MS
|
|
24
|
+
};
|
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
import { mergeClasses as e } from "../../../utils/merge-classes.js";
|
|
2
|
-
const a = "rounded-xl bg-layer-raised p-1 shadow-md", l = e(
|
|
2
|
+
const a = "rounded-xl bg-layer-raised p-1 shadow-md", s = "flex flex-col gap-0.5", l = e(
|
|
3
3
|
a,
|
|
4
4
|
"w-max"
|
|
5
5
|
), r = e(
|
|
6
|
-
|
|
6
|
+
l,
|
|
7
|
+
s,
|
|
8
|
+
"py-2"
|
|
9
|
+
), n = e(
|
|
10
|
+
// `shrink-0` keeps the 40px: a column squeezed by the panel's height cap
|
|
11
|
+
// would otherwise collapse the rows to their content.
|
|
12
|
+
"flex w-full shrink-0 cursor-pointer items-center gap-2 px-3 h-[40px] rounded-lg",
|
|
7
13
|
"dial-small-text text-primary truncate",
|
|
8
14
|
// Hover sits one step up the accent-alpha ramp from the selected tint, so a
|
|
9
15
|
// hovered row reads as hovered whether or not it is also selected.
|
|
10
16
|
"hover:bg-control-accent-alpha-hover",
|
|
11
17
|
"focus-visible:outline focus-visible:outline-focus"
|
|
12
|
-
), t = "bg-control-accent-alpha",
|
|
18
|
+
), t = "bg-control-accent-alpha", c = e(
|
|
13
19
|
t,
|
|
14
20
|
"text-accent"
|
|
15
|
-
),
|
|
21
|
+
), m = e(
|
|
16
22
|
"cursor-not-allowed text-control-disable-primary",
|
|
17
23
|
"bg-transparent hover:bg-transparent"
|
|
18
|
-
),
|
|
24
|
+
), i = 4;
|
|
19
25
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
i as overlayGap,
|
|
27
|
+
n as overlayItemClassName,
|
|
28
|
+
m as overlayItemDisabledClassName,
|
|
29
|
+
c as overlayItemHighlightClassName,
|
|
24
30
|
t as overlayItemSelectedClassName,
|
|
31
|
+
s as overlayListClassName,
|
|
25
32
|
l as overlaySubMenuClassName,
|
|
33
|
+
r as overlaySubMenuListClassName,
|
|
26
34
|
a as overlaySurfaceClassName
|
|
27
35
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PopupSize as
|
|
2
|
-
const
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
1
|
+
import { PopupSize as p } from "../../types/popup.js";
|
|
2
|
+
const o = "z-popup flex items-center justify-center bg-blackout md:p-4", s = "divide-tertiary divide-y", i = "flex flex-row justify-between py-4 px-6 items-center", t = {
|
|
3
|
+
[p.Sm]: "dial-sm-popup",
|
|
4
|
+
[p.Md]: "dial-md-popup",
|
|
5
|
+
[p.Lg]: "dial-lg-popup"
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
o as overlayBaseClassName,
|
|
9
|
+
s as popupDividerClassName,
|
|
10
|
+
i as popupHeaderClassName,
|
|
11
11
|
t as popupSizeClassMap
|
|
12
12
|
};
|
|
@@ -1,58 +1,70 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { Label as
|
|
1
|
+
import { jsx as i, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useId as y } from "react";
|
|
3
|
+
import { Label as S } from "../New/Label/Label.js";
|
|
4
4
|
import { ElementSize as f } from "../../types/size.js";
|
|
5
|
-
import { resolveAccessibleName as
|
|
6
|
-
import { mergeClasses as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { resolveAccessibleName as B } from "../../utils/accessible-name.js";
|
|
6
|
+
import { mergeClasses as h } from "../../utils/merge-classes.js";
|
|
7
|
+
import { DIAL_KIT_CLASS as p } from "../../constants/public-class-names.js";
|
|
8
|
+
const z = ({
|
|
9
|
+
value: s,
|
|
10
|
+
max: l = 100,
|
|
10
11
|
size: u = f.Standard,
|
|
11
12
|
labelProps: e,
|
|
12
|
-
valueLabel:
|
|
13
|
-
id:
|
|
14
|
-
className:
|
|
15
|
-
"aria-label":
|
|
16
|
-
...
|
|
13
|
+
valueLabel: r,
|
|
14
|
+
id: b,
|
|
15
|
+
className: g,
|
|
16
|
+
"aria-label": x,
|
|
17
|
+
...v
|
|
17
18
|
}) => {
|
|
18
|
-
const
|
|
19
|
+
const N = y(), t = b ?? N, a = !!e?.label, n = a ? e?.id ?? `${t}-label` : void 0, o = l > 0 ? l : 0, w = Number.isFinite(s) ? s : 0, d = Math.min(Math.max(w, 0), o), I = o > 0 ? d / o * 100 : 0, m = /* @__PURE__ */ i(
|
|
19
20
|
"div",
|
|
20
21
|
{
|
|
21
|
-
...
|
|
22
|
+
...v,
|
|
22
23
|
id: t,
|
|
23
24
|
role: "progressbar",
|
|
24
25
|
"aria-valuenow": d,
|
|
25
26
|
"aria-valuemin": 0,
|
|
26
|
-
"aria-valuemax":
|
|
27
|
+
"aria-valuemax": o,
|
|
27
28
|
"aria-labelledby": n,
|
|
28
|
-
"aria-label":
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
"aria-label": B(
|
|
30
|
+
x,
|
|
31
|
+
a ? void 0 : "Progress"
|
|
31
32
|
),
|
|
32
|
-
className:
|
|
33
|
+
className: h(
|
|
33
34
|
"w-full overflow-hidden rounded-full bg-control-disable-primary",
|
|
34
35
|
u === f.Small ? "h-1" : "h-2",
|
|
35
|
-
|
|
36
|
+
g,
|
|
37
|
+
/* The track is the component's root when there is no label and no
|
|
38
|
+
readout to wrap it, and the public class belongs on whichever
|
|
39
|
+
element that is. */
|
|
40
|
+
!a && !r && p.progressBar
|
|
36
41
|
),
|
|
37
|
-
children: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ i(
|
|
38
43
|
"div",
|
|
39
44
|
{
|
|
40
|
-
style: { width: `${
|
|
45
|
+
style: { width: `${I}%` },
|
|
41
46
|
className: "h-full rounded-full bg-control-accent transition-[width] duration-300 motion-reduce:transition-none"
|
|
42
47
|
}
|
|
43
48
|
)
|
|
44
49
|
}
|
|
45
50
|
);
|
|
46
|
-
return !
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
return !a && !r ? m : /* @__PURE__ */ c(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
className: h(
|
|
55
|
+
"flex w-full flex-col gap-1",
|
|
56
|
+
p.progressBar
|
|
57
|
+
),
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ c("div", { className: "flex items-baseline gap-2", children: [
|
|
60
|
+
e && /* @__PURE__ */ i(S, { ...e, id: n }),
|
|
61
|
+
r && /* @__PURE__ */ i("span", { className: "dial-tiny-text text-secondary ml-auto shrink-0", children: r })
|
|
62
|
+
] }),
|
|
63
|
+
m
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
55
67
|
};
|
|
56
68
|
export {
|
|
57
|
-
|
|
69
|
+
z as ProgressBar
|
|
58
70
|
};
|