@epam/ai-dial-ui-kit 0.15.0-dev.6 → 0.15.0-dev.7
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 +139 -0
- package/dist/CHANGELOG.md +10 -0
- package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-4iMidqal.cjs} +26 -26
- package/dist/DateCellRenderer-CTTAnQjB.cjs +1 -0
- package/dist/JsonEditor-D2jSlRFi.cjs +1 -0
- package/dist/{MarkdownEditor-jQ8nDJfx.cjs → MarkdownEditor-BzEbdj7R.cjs} +1 -1
- package/dist/{MarkdownEditor-DHn2pYOJ.cjs → MarkdownEditor-C9-ZMRVi.cjs} +1 -1
- package/dist/MarkdownEditorContainer-BvwJjkiZ.cjs +1 -0
- package/dist/components/Dropdown/Dropdown.js +70 -65
- package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
- package/dist/components/Dropdown/constants.js +14 -12
- package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
- package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +18 -16
- package/dist/components/New/Accordion/Accordion.js +39 -37
- package/dist/components/New/ButtonDropdown/ButtonDropdown.js +7 -6
- package/dist/components/New/Calendar/Calendar.js +253 -222
- package/dist/components/New/CaptionText/CaptionText.js +18 -15
- package/dist/components/New/CardShell/CardShell.js +4 -2
- package/dist/components/New/Checkbox/Checkbox.js +67 -56
- package/dist/components/New/Checkbox/CheckboxBox.js +4 -2
- 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 +44 -39
- package/dist/components/New/Dropdown/Dropdown.js +101 -95
- package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +19 -17
- package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
- package/dist/components/New/FolderPath/FolderPath.js +29 -28
- package/dist/components/New/Highlight/Highlight.js +23 -30
- package/dist/components/New/InfoButton/InfoButton.js +12 -10
- package/dist/components/New/InlineSelect/InlineSelect.js +43 -41
- package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +40 -38
- package/dist/components/New/Label/Label.js +13 -8
- 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 +20 -18
- package/dist/components/New/Notification/Notification.js +18 -16
- 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 +45 -43
- 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/Search/Search.js +28 -26
- package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
- package/dist/components/New/Select/Select.js +120 -109
- package/dist/components/New/Switch/Switch.js +69 -58
- package/dist/components/New/Tabs/Tabs.js +28 -22
- package/dist/components/New/Tag/Tag.js +42 -40
- package/dist/components/New/TagInput/TagInput.js +44 -42
- package/dist/components/New/ToggleIconButton/ToggleIconButton.js +25 -23
- package/dist/components/New/Tooltip/TooltipContent.js +10 -8
- package/dist/components/ProgressBar/ProgressBar.js +45 -31
- package/dist/components/Skeleton/Skeleton.js +25 -19
- package/dist/components/Spinner/Spinner.js +6 -4
- package/dist/components-manifest.json +7 -2
- package/dist/constants/public-class-names.js +152 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +203 -201
- package/dist/editor-_174x-qy.cjs +1 -0
- package/dist/editors.cjs +1 -1
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/lazy-DM-7dL0Y.cjs +1 -0
- package/dist/src/constants/public-class-names.d.ts +143 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/use-file-manager-tabs-DKmWaOlC.cjs +3 -0
- package/package.json +1 -1
- package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
- package/dist/JsonEditor-qv1Z0dLX.cjs +0 -1
- package/dist/MarkdownEditorContainer-Bzcnoemw.cjs +0 -1
- package/dist/lazy-tfN4sKhq.cjs +0 -1
- package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { jsxs as b, jsx as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { ErrorText as
|
|
4
|
-
import { Label as
|
|
5
|
-
import { Radio as
|
|
6
|
-
import { RadioGroupOrientation as
|
|
1
|
+
import { jsxs as b, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useId as B } from "react";
|
|
3
|
+
import { ErrorText as G, CaptionText as L } from "../CaptionText/CaptionText.js";
|
|
4
|
+
import { Label as R } from "../Label/Label.js";
|
|
5
|
+
import { Radio as S } from "../Radio/Radio.js";
|
|
6
|
+
import { RadioGroupOrientation as y } from "../../../types/radio-group.js";
|
|
7
7
|
import { mergeClasses as i } from "../../../utils/merge-classes.js";
|
|
8
|
-
import { resolveAccessibleName as
|
|
9
|
-
import { selectedContentClassName as
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { resolveAccessibleName as u } from "../../../utils/accessible-name.js";
|
|
9
|
+
import { selectedContentClassName as _, orientationClassMap as w, optionsWrapperBaseClassName as D, groupBaseClassName as E } from "./constants.js";
|
|
10
|
+
import { DIAL_KIT_CLASS as K } from "../../../constants/public-class-names.js";
|
|
11
|
+
const U = ({
|
|
12
|
+
items: v,
|
|
12
13
|
value: f,
|
|
13
14
|
onChange: x,
|
|
14
|
-
name:
|
|
15
|
-
id:
|
|
16
|
-
orientation: I =
|
|
15
|
+
name: C,
|
|
16
|
+
id: N,
|
|
17
|
+
orientation: I = y.Column,
|
|
17
18
|
labelProps: r,
|
|
18
19
|
disabled: s,
|
|
19
20
|
error: l,
|
|
@@ -21,61 +22,71 @@ const Q = ({
|
|
|
21
22
|
ariaLabel: g,
|
|
22
23
|
className: $,
|
|
23
24
|
optionsClassName: h,
|
|
24
|
-
radioClassName:
|
|
25
|
-
contentClassName:
|
|
25
|
+
radioClassName: T,
|
|
26
|
+
contentClassName: j
|
|
26
27
|
}) => {
|
|
27
|
-
const
|
|
28
|
-
return /* @__PURE__ */ b(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
name: N ?? o,
|
|
51
|
-
value: a.value,
|
|
52
|
-
labelProps: a.label == null ? void 0 : { label: a.label },
|
|
53
|
-
"aria-label": a["aria-label"],
|
|
54
|
-
caption: a.caption,
|
|
55
|
-
isSelected: m,
|
|
56
|
-
disabled: s || a.disabled,
|
|
57
|
-
onChange: x,
|
|
58
|
-
className: j
|
|
59
|
-
}
|
|
28
|
+
const A = B(), e = N ?? A, n = `${e}-label`, t = l ? `${e}-error` : void 0, c = !l && d ? `${e}-caption` : void 0, p = u(r?.label);
|
|
29
|
+
return /* @__PURE__ */ b(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: i(
|
|
33
|
+
K.radioGroup,
|
|
34
|
+
E,
|
|
35
|
+
$
|
|
36
|
+
),
|
|
37
|
+
children: [
|
|
38
|
+
r && /* @__PURE__ */ o(R, { ...r, id: n }),
|
|
39
|
+
/* @__PURE__ */ o(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
role: "radiogroup",
|
|
43
|
+
"aria-labelledby": p ? n : void 0,
|
|
44
|
+
"aria-label": p ? void 0 : u(g),
|
|
45
|
+
"aria-describedby": [t, c].filter(Boolean).join(" ") || void 0,
|
|
46
|
+
"aria-disabled": s || void 0,
|
|
47
|
+
className: i(
|
|
48
|
+
D,
|
|
49
|
+
w[I],
|
|
50
|
+
h
|
|
60
51
|
),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
children: v.map((a) => {
|
|
53
|
+
const m = a.value === f;
|
|
54
|
+
return /* @__PURE__ */ b("div", { className: "flex min-w-0 flex-col", children: [
|
|
55
|
+
/* @__PURE__ */ o(
|
|
56
|
+
S,
|
|
57
|
+
{
|
|
58
|
+
id: `${e}-${a.value}`,
|
|
59
|
+
name: C ?? e,
|
|
60
|
+
value: a.value,
|
|
61
|
+
labelProps: a.label == null ? void 0 : { label: a.label },
|
|
62
|
+
"aria-label": a["aria-label"],
|
|
63
|
+
caption: a.caption,
|
|
64
|
+
isSelected: m,
|
|
65
|
+
disabled: s || a.disabled,
|
|
66
|
+
onChange: x,
|
|
67
|
+
className: T
|
|
68
|
+
}
|
|
67
69
|
),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
m && a.content ? /* @__PURE__ */ o(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: i(
|
|
74
|
+
_,
|
|
75
|
+
j
|
|
76
|
+
),
|
|
77
|
+
children: a.content
|
|
78
|
+
}
|
|
79
|
+
) : null
|
|
80
|
+
] }, a.value);
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ o(G, { id: t, text: l }),
|
|
85
|
+
!l && /* @__PURE__ */ o(L, { id: c, text: d })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
78
89
|
};
|
|
79
90
|
export {
|
|
80
|
-
|
|
91
|
+
U as RadioGroup
|
|
81
92
|
};
|
|
@@ -1,138 +1,149 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { IconMaximize as oo } from "@tabler/icons-react";
|
|
3
|
-
import { useId as eo, useState as
|
|
4
|
-
import { NeutralButton as ao, PrimaryButton as
|
|
5
|
-
import { ErrorText as
|
|
3
|
+
import { useId as eo, useState as S, useCallback as i } from "react";
|
|
4
|
+
import { NeutralButton as ao, PrimaryButton as io } from "../Button/ButtonWrappers.js";
|
|
5
|
+
import { ErrorText as lo, CaptionText as to } from "../CaptionText/CaptionText.js";
|
|
6
6
|
import { Label as ro } from "../Label/Label.js";
|
|
7
7
|
import { Popup as so } from "../Popup/Popup.js";
|
|
8
8
|
import { RadioGroup as no } from "../RadioGroup/RadioGroup.js";
|
|
9
|
-
import { DIAL_KIT_ICON_STROKE as
|
|
10
|
-
import { DIAL_ICON_SIZE as
|
|
9
|
+
import { DIAL_KIT_ICON_STROKE as po } from "../constants/icon.js";
|
|
10
|
+
import { DIAL_ICON_SIZE as co } from "../../../constants/icon.js";
|
|
11
11
|
import { PopupSize as mo } from "../../../types/popup.js";
|
|
12
12
|
import { RadioGroupOrientation as fo } from "../../../types/radio-group.js";
|
|
13
|
-
import { mergeClasses as
|
|
14
|
-
import { resolveAccessibleName as
|
|
15
|
-
import { fieldPlaceholderClassName as uo, fieldValueClassName as
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
import { mergeClasses as F } from "../../../utils/merge-classes.js";
|
|
14
|
+
import { resolveAccessibleName as I } from "../../../utils/accessible-name.js";
|
|
15
|
+
import { fieldPlaceholderClassName as uo, fieldValueClassName as Io, fieldIconClassName as No, fieldBaseClassName as bo, popupBodyClassName as Co, popupFooterClassName as xo, defaultCancelLabel as ho, defaultApplyLabel as vo } from "./constants.js";
|
|
16
|
+
import { DIAL_KIT_CLASS as Lo } from "../../../constants/public-class-names.js";
|
|
17
|
+
const zo = ({
|
|
18
|
+
items: N,
|
|
19
|
+
value: l,
|
|
20
|
+
customValue: G,
|
|
21
|
+
header: b,
|
|
21
22
|
onApply: C,
|
|
22
|
-
id:
|
|
23
|
-
labelProps:
|
|
24
|
-
placeholder:
|
|
23
|
+
id: R,
|
|
24
|
+
labelProps: c,
|
|
25
|
+
placeholder: j,
|
|
25
26
|
selectedValue: x,
|
|
26
27
|
onSelectionChange: h,
|
|
27
28
|
onCancel: v,
|
|
28
29
|
onClose: L,
|
|
29
|
-
isValid:
|
|
30
|
-
applyButtonLabel:
|
|
31
|
-
cancelButtonLabel:
|
|
32
|
-
size:
|
|
30
|
+
isValid: z = !0,
|
|
31
|
+
applyButtonLabel: E = vo,
|
|
32
|
+
cancelButtonLabel: K = ho,
|
|
33
|
+
size: M = mo.Md,
|
|
33
34
|
portalId: w,
|
|
34
|
-
disabled:
|
|
35
|
+
disabled: t,
|
|
35
36
|
invalid: U,
|
|
36
37
|
error: r,
|
|
37
|
-
caption:
|
|
38
|
+
caption: D,
|
|
38
39
|
ariaLabel: V,
|
|
39
40
|
className: Z,
|
|
40
41
|
fieldClassName: q
|
|
41
42
|
}) => {
|
|
42
|
-
const H = eo(), e =
|
|
43
|
-
|
|
44
|
-
}, [
|
|
45
|
-
|
|
46
|
-
}, [L]),
|
|
43
|
+
const H = eo(), e = R ?? H, $ = `${e}-label`, k = `${e}-value`, y = r ? `${e}-error` : void 0, T = !r && D ? `${e}-caption` : void 0, [_, O] = S(!1), a = x !== void 0, [J, P] = S(l), m = a ? x : J, Q = i(() => {
|
|
44
|
+
t || (a || P(l), O(!0));
|
|
45
|
+
}, [t, a, l]), s = i(() => {
|
|
46
|
+
O(!1), L?.();
|
|
47
|
+
}, [L]), g = i(() => {
|
|
47
48
|
v?.(), s();
|
|
48
|
-
}, [v, s]), W =
|
|
49
|
+
}, [v, s]), W = i(() => {
|
|
49
50
|
C(m), s();
|
|
50
|
-
}, [C, m, s]), X =
|
|
51
|
+
}, [C, m, s]), X = i(
|
|
51
52
|
(d) => {
|
|
52
|
-
a ||
|
|
53
|
+
a || P(d), h?.(d);
|
|
53
54
|
},
|
|
54
55
|
[a, h]
|
|
55
|
-
), n =
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
type: "button",
|
|
64
|
-
id: e,
|
|
65
|
-
disabled: i,
|
|
66
|
-
"aria-haspopup": "dialog",
|
|
67
|
-
"aria-expanded": T,
|
|
68
|
-
"aria-labelledby": u ? `${u} ${y}` : void 0,
|
|
69
|
-
"aria-describedby": [D, O].filter(Boolean).join(" ") || void 0,
|
|
70
|
-
onClick: Q,
|
|
71
|
-
className: z(
|
|
72
|
-
Io,
|
|
73
|
-
U && "dial-kit-input-error",
|
|
74
|
-
i && "dial-kit-input-disable",
|
|
75
|
-
q
|
|
76
|
-
),
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ o(
|
|
79
|
-
"span",
|
|
80
|
-
{
|
|
81
|
-
id: y,
|
|
82
|
-
className: R == null ? uo : No,
|
|
83
|
-
children: R ?? F
|
|
84
|
-
}
|
|
85
|
-
),
|
|
86
|
-
/* @__PURE__ */ o(
|
|
87
|
-
oo,
|
|
88
|
-
{
|
|
89
|
-
size: po.MD,
|
|
90
|
-
stroke: co,
|
|
91
|
-
"aria-hidden": "true",
|
|
92
|
-
className: bo
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
]
|
|
96
|
-
}
|
|
56
|
+
), n = I(c?.label), f = n ? void 0 : I(V), u = n ? $ : f && `${e}-name`, A = I(b), Y = N.find((d) => d.value === l)?.label, B = G ?? Y;
|
|
57
|
+
return /* @__PURE__ */ p(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: F(
|
|
61
|
+
Lo.radioGroupPopupField,
|
|
62
|
+
"flex w-full flex-col gap-2",
|
|
63
|
+
Z
|
|
97
64
|
),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
open: T,
|
|
105
|
-
header: I,
|
|
106
|
-
ariaLabel: _ ? void 0 : n,
|
|
107
|
-
portalId: w,
|
|
108
|
-
size: K,
|
|
109
|
-
onClose: P,
|
|
110
|
-
footer: /* @__PURE__ */ c("div", { className: xo, children: [
|
|
111
|
-
/* @__PURE__ */ o(ao, { label: S, onClick: P }),
|
|
112
|
-
/* @__PURE__ */ o(
|
|
113
|
-
lo,
|
|
65
|
+
children: [
|
|
66
|
+
c && /* @__PURE__ */ o(ro, { ...c, id: $, htmlFor: e }),
|
|
67
|
+
/* @__PURE__ */ p("div", { className: "flex flex-col gap-1", children: [
|
|
68
|
+
f && /* @__PURE__ */ o("span", { id: u, className: "sr-only", children: f }),
|
|
69
|
+
/* @__PURE__ */ p(
|
|
70
|
+
"button",
|
|
114
71
|
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
72
|
+
type: "button",
|
|
73
|
+
id: e,
|
|
74
|
+
disabled: t,
|
|
75
|
+
"aria-haspopup": "dialog",
|
|
76
|
+
"aria-expanded": _,
|
|
77
|
+
"aria-labelledby": u ? `${u} ${k}` : void 0,
|
|
78
|
+
"aria-describedby": [y, T].filter(Boolean).join(" ") || void 0,
|
|
79
|
+
onClick: Q,
|
|
80
|
+
className: F(
|
|
81
|
+
bo,
|
|
82
|
+
U && "dial-kit-input-error",
|
|
83
|
+
t && "dial-kit-input-disable",
|
|
84
|
+
q
|
|
85
|
+
),
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ o(
|
|
88
|
+
"span",
|
|
89
|
+
{
|
|
90
|
+
id: k,
|
|
91
|
+
className: B == null ? uo : Io,
|
|
92
|
+
children: B ?? j
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ o(
|
|
96
|
+
oo,
|
|
97
|
+
{
|
|
98
|
+
size: co.MD,
|
|
99
|
+
stroke: po,
|
|
100
|
+
"aria-hidden": "true",
|
|
101
|
+
className: No
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
]
|
|
118
105
|
}
|
|
119
|
-
)
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ o(lo, { id: y, text: r }),
|
|
108
|
+
!r && /* @__PURE__ */ o(to, { id: T, text: D })
|
|
120
109
|
] }),
|
|
121
|
-
|
|
122
|
-
|
|
110
|
+
/* @__PURE__ */ o(
|
|
111
|
+
so,
|
|
123
112
|
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
113
|
+
open: _,
|
|
114
|
+
header: b,
|
|
115
|
+
ariaLabel: A ? void 0 : n,
|
|
116
|
+
portalId: w,
|
|
117
|
+
size: M,
|
|
118
|
+
onClose: g,
|
|
119
|
+
footer: /* @__PURE__ */ p("div", { className: xo, children: [
|
|
120
|
+
/* @__PURE__ */ o(ao, { label: K, onClick: g }),
|
|
121
|
+
/* @__PURE__ */ o(
|
|
122
|
+
io,
|
|
123
|
+
{
|
|
124
|
+
label: E,
|
|
125
|
+
disabled: !z,
|
|
126
|
+
onClick: W
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] }),
|
|
130
|
+
children: /* @__PURE__ */ o("div", { className: Co, children: /* @__PURE__ */ o(
|
|
131
|
+
no,
|
|
132
|
+
{
|
|
133
|
+
id: `${e}-options`,
|
|
134
|
+
items: N,
|
|
135
|
+
value: m,
|
|
136
|
+
onChange: X,
|
|
137
|
+
orientation: fo.Column,
|
|
138
|
+
ariaLabel: n ?? A
|
|
139
|
+
}
|
|
140
|
+
) })
|
|
130
141
|
}
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
142
|
+
)
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
);
|
|
135
146
|
};
|
|
136
147
|
export {
|
|
137
|
-
|
|
148
|
+
zo as RadioGroupPopupField
|
|
138
149
|
};
|
|
@@ -1,56 +1,57 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { Resizable as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { ResizableContainerSide as
|
|
5
|
-
import { mergeClasses as
|
|
6
|
-
import { ResizeHandle as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { Resizable as E } from "../../../node_modules/re-resizable/lib/index.js";
|
|
3
|
+
import { useState as I, useRef as H, useCallback as d, useMemo as T } from "react";
|
|
4
|
+
import { ResizableContainerSide as _ } from "../../../types/resizable-container.js";
|
|
5
|
+
import { mergeClasses as y } from "../../../utils/merge-classes.js";
|
|
6
|
+
import { ResizeHandle as B } from "./components/ResizeHandle.js";
|
|
7
|
+
import { DIAL_KIT_CLASS as K } from "../../../constants/public-class-names.js";
|
|
8
|
+
const j = 16, J = ({
|
|
9
|
+
children: M,
|
|
10
|
+
minWidth: r,
|
|
10
11
|
maxWidth: s,
|
|
11
12
|
width: h,
|
|
12
|
-
defaultWidth:
|
|
13
|
+
defaultWidth: w,
|
|
13
14
|
onResizeStop: i,
|
|
14
15
|
onResize: l,
|
|
15
|
-
side: a =
|
|
16
|
+
side: a = _.Right,
|
|
16
17
|
keyboardStep: u = j,
|
|
17
18
|
ariaLabel: g = "Resize panel",
|
|
18
|
-
className:
|
|
19
|
+
className: x,
|
|
19
20
|
resizeHandlerClassName: p,
|
|
20
21
|
resizeHandler: z
|
|
21
22
|
}) => {
|
|
22
|
-
const [m, C] =
|
|
23
|
+
const [m, C] = I(!1), [A, R] = I(w ?? r), n = h !== void 0, o = n ? h : A, f = H(null), S = d(() => {
|
|
23
24
|
C(!0);
|
|
24
|
-
}, []),
|
|
25
|
+
}, []), b = d(() => {
|
|
25
26
|
C(!1);
|
|
26
|
-
const t = f.current?.resizable?.getBoundingClientRect(), e = t ? Math.round(t.width) :
|
|
27
|
-
|
|
28
|
-
}, [i,
|
|
27
|
+
const t = f.current?.resizable?.getBoundingClientRect(), e = t ? Math.round(t.width) : r;
|
|
28
|
+
n || R(e), i?.(e);
|
|
29
|
+
}, [i, n, r]), v = d(
|
|
29
30
|
(t) => {
|
|
30
|
-
const e = Math.min(s, Math.max(
|
|
31
|
-
e !== o && (
|
|
31
|
+
const e = Math.min(s, Math.max(r, t));
|
|
32
|
+
e !== o && (n || (R(e), f.current?.updateSize({ width: e, height: "100%" })), l?.(e), i?.(e));
|
|
32
33
|
},
|
|
33
|
-
[s,
|
|
34
|
-
),
|
|
35
|
-
const t = a ===
|
|
36
|
-
|
|
34
|
+
[s, r, o, n, l, i]
|
|
35
|
+
), L = T(() => {
|
|
36
|
+
const t = a === _.Left, e = /* @__PURE__ */ c(
|
|
37
|
+
B,
|
|
37
38
|
{
|
|
38
39
|
side: a,
|
|
39
40
|
isResizing: m,
|
|
40
41
|
width: o,
|
|
41
|
-
minWidth:
|
|
42
|
+
minWidth: r,
|
|
42
43
|
maxWidth: s,
|
|
43
44
|
step: u,
|
|
44
45
|
ariaLabel: g,
|
|
45
|
-
onWidthChange:
|
|
46
|
+
onWidthChange: v,
|
|
46
47
|
customHandler: z,
|
|
47
48
|
handlerClassName: p
|
|
48
49
|
}
|
|
49
50
|
);
|
|
50
51
|
return {
|
|
51
|
-
size:
|
|
52
|
-
defaultSize:
|
|
53
|
-
minWidth:
|
|
52
|
+
size: n ? { width: o, height: "100%" } : void 0,
|
|
53
|
+
defaultSize: n ? void 0 : { width: o, height: "100%" },
|
|
54
|
+
minWidth: r,
|
|
54
55
|
maxWidth: s,
|
|
55
56
|
enable: {
|
|
56
57
|
left: t,
|
|
@@ -68,39 +69,40 @@ const j = 16, q = ({
|
|
|
68
69
|
left: t ? e : void 0,
|
|
69
70
|
right: t ? void 0 : e
|
|
70
71
|
},
|
|
71
|
-
onResizeStart:
|
|
72
|
-
onResize: (k, F,
|
|
73
|
-
l?.(Math.round(
|
|
72
|
+
onResizeStart: S,
|
|
73
|
+
onResize: (k, F, D) => {
|
|
74
|
+
l?.(Math.round(D.offsetWidth));
|
|
74
75
|
},
|
|
75
|
-
onResizeStop:
|
|
76
|
+
onResizeStop: b
|
|
76
77
|
};
|
|
77
78
|
}, [
|
|
78
79
|
a,
|
|
79
|
-
r,
|
|
80
|
-
o,
|
|
81
80
|
n,
|
|
81
|
+
o,
|
|
82
|
+
r,
|
|
82
83
|
s,
|
|
83
84
|
u,
|
|
84
85
|
g,
|
|
85
|
-
|
|
86
|
+
v,
|
|
86
87
|
z,
|
|
87
88
|
p,
|
|
88
89
|
m,
|
|
90
|
+
S,
|
|
89
91
|
b,
|
|
90
|
-
v,
|
|
91
92
|
l
|
|
92
93
|
]);
|
|
93
|
-
return /* @__PURE__ */ c(
|
|
94
|
+
return /* @__PURE__ */ c(E, { ref: f, ...L, children: /* @__PURE__ */ c(
|
|
94
95
|
"div",
|
|
95
96
|
{
|
|
96
|
-
className:
|
|
97
|
+
className: y(
|
|
98
|
+
K.resizableContainer,
|
|
97
99
|
"group flex size-full flex-col bg-layer-raised transition-all motion-reduce:transition-none",
|
|
98
|
-
|
|
100
|
+
x
|
|
99
101
|
),
|
|
100
|
-
children:
|
|
102
|
+
children: M
|
|
101
103
|
}
|
|
102
104
|
) });
|
|
103
105
|
};
|
|
104
106
|
export {
|
|
105
|
-
|
|
107
|
+
J as ResizableContainer
|
|
106
108
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { IconX as _, IconSearch as h } from "@tabler/icons-react";
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useMergeRefs as
|
|
5
|
-
import { GhostIconButton as
|
|
6
|
-
import { Input as
|
|
3
|
+
import { useRef as A, useCallback as R } from "react";
|
|
4
|
+
import { useMergeRefs as k } from "@floating-ui/react";
|
|
5
|
+
import { GhostIconButton as D } from "../IconButton/IconButtonWrappers.js";
|
|
6
|
+
import { Input as E } from "../Input/Input.js";
|
|
7
7
|
import { DIAL_KIT_ICON_STROKE as n } from "../constants/icon.js";
|
|
8
|
-
import { DIAL_ICON_SIZE as
|
|
8
|
+
import { DIAL_ICON_SIZE as e } from "../../../constants/icon.js";
|
|
9
9
|
import { ElementSize as r } from "../../../types/size.js";
|
|
10
|
-
import { mergeClasses as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
[r.
|
|
14
|
-
[r.
|
|
15
|
-
|
|
10
|
+
import { mergeClasses as L } from "../../../utils/merge-classes.js";
|
|
11
|
+
import { DIAL_KIT_CLASS as M } from "../../../constants/public-class-names.js";
|
|
12
|
+
const N = {
|
|
13
|
+
[r.Small]: e.SM,
|
|
14
|
+
[r.Standard]: e.MD,
|
|
15
|
+
[r.Large]: e.MD
|
|
16
|
+
}, v = ({
|
|
16
17
|
size: s = r.Standard,
|
|
17
18
|
placeholder: c = "Search...",
|
|
18
19
|
withoutBorder: f = !1,
|
|
@@ -22,43 +23,44 @@ const D = {
|
|
|
22
23
|
onChange: t,
|
|
23
24
|
wrapperClassName: p,
|
|
24
25
|
inputRef: S,
|
|
25
|
-
...
|
|
26
|
+
...I
|
|
26
27
|
}) => {
|
|
27
|
-
const m =
|
|
28
|
+
const m = A(null), u = k([S, m]), d = !!i && !a, C = R(() => {
|
|
28
29
|
t?.(void 0), m.current?.focus();
|
|
29
30
|
}, [t]);
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
|
|
31
|
+
return /* @__PURE__ */ o(
|
|
32
|
+
E,
|
|
32
33
|
{
|
|
33
|
-
...
|
|
34
|
+
...I,
|
|
34
35
|
size: s,
|
|
35
36
|
value: i,
|
|
36
37
|
disabled: a,
|
|
37
38
|
onChange: t,
|
|
38
39
|
placeholder: c,
|
|
39
|
-
inputRef:
|
|
40
|
-
wrapperClassName:
|
|
40
|
+
inputRef: u,
|
|
41
|
+
wrapperClassName: L(
|
|
42
|
+
M.search,
|
|
41
43
|
f && "dial-kit-input-borderless",
|
|
42
44
|
p
|
|
43
45
|
),
|
|
44
|
-
iconBefore: /* @__PURE__ */
|
|
46
|
+
iconBefore: /* @__PURE__ */ o(
|
|
45
47
|
h,
|
|
46
48
|
{
|
|
47
|
-
size:
|
|
49
|
+
size: N[s],
|
|
48
50
|
stroke: n,
|
|
49
51
|
className: "text-secondary",
|
|
50
52
|
"aria-hidden": "true"
|
|
51
53
|
}
|
|
52
54
|
),
|
|
53
|
-
iconAfter: d ? /* @__PURE__ */
|
|
54
|
-
|
|
55
|
+
iconAfter: d ? /* @__PURE__ */ o(
|
|
56
|
+
D,
|
|
55
57
|
{
|
|
56
58
|
size: r.Small,
|
|
57
59
|
"aria-label": l,
|
|
58
|
-
icon: /* @__PURE__ */
|
|
60
|
+
icon: /* @__PURE__ */ o(
|
|
59
61
|
_,
|
|
60
62
|
{
|
|
61
|
-
size:
|
|
63
|
+
size: e.SM,
|
|
62
64
|
stroke: n,
|
|
63
65
|
"aria-hidden": "true"
|
|
64
66
|
}
|
|
@@ -70,5 +72,5 @@ const D = {
|
|
|
70
72
|
);
|
|
71
73
|
};
|
|
72
74
|
export {
|
|
73
|
-
|
|
75
|
+
v as Search
|
|
74
76
|
};
|