@epam/ai-dial-ui-kit 0.15.0-dev.10 → 0.15.0-dev.12
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 +1 -0
- package/dist/CHANGELOG.md +8 -1
- package/dist/{DateCellRenderer-xGfSaQHO.cjs → DateCellRenderer-Ba9tlNbk.cjs} +1 -1
- package/dist/{DateCellRenderer-CHi2CB33.cjs → DateCellRenderer-S5QJV-Wp.cjs} +1 -1
- package/dist/JsonEditor-qv1Z0dLX.cjs +1 -0
- package/dist/{MarkdownEditor-C9-ZMRVi.cjs → MarkdownEditor-DHn2pYOJ.cjs} +1 -1
- package/dist/{MarkdownEditor-BzEbdj7R.cjs → MarkdownEditor-jQ8nDJfx.cjs} +1 -1
- package/dist/MarkdownEditorContainer-Bzcnoemw.cjs +1 -0
- package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +16 -18
- package/dist/components/New/Breadcrumbs/Breadcrumbs.js +97 -84
- package/dist/components/New/Breadcrumbs/constants.js +29 -20
- package/dist/components/New/Tabs/Tabs.js +35 -32
- package/dist/components-manifest.json +34 -4
- package/dist/constants/public-class-names.js +7 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +162 -160
- 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-tfN4sKhq.cjs +1 -0
- package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +11 -0
- package/dist/src/components/New/Breadcrumbs/constants.d.ts +14 -2
- package/dist/src/components/New/Tabs/Tabs.d.ts +7 -0
- package/dist/src/constants/public-class-names.d.ts +7 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/types/breadcrumbs.d.ts +9 -0
- package/dist/types/breadcrumbs.js +4 -0
- package/dist/{use-file-manager-tabs-C_UUfS-F.cjs → use-file-manager-tabs-Ff6KIQOF.cjs} +1 -1
- package/package.json +1 -1
- package/dist/JsonEditor-D2jSlRFi.cjs +0 -1
- package/dist/MarkdownEditorContainer-BvwJjkiZ.cjs +0 -1
- package/dist/editor-_174x-qy.cjs +0 -1
- package/dist/lazy-DM-7dL0Y.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),a=require("./lazy-tfN4sKhq.cjs"),c=require("@monaco-editor/react");function g(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const f=g(c),b={[a.EditorThemes.dark]:{base:"vs-dark",inherit:!1,rules:[{token:"string.key.json",foreground:"#37BABC"},{token:"string.value.json",foreground:"#5C8DEA"},{token:"number",foreground:"#D97C27"},{token:"keyword.json",foreground:"#F4CE46"},{token:"delimiter",foreground:"#EEF1F7"},{token:"delimiter.bracket.json",foreground:"#A972FF"},{token:"delimiter.parenthesis",foreground:"#A972FF"}],colors:{"editor.foreground":"#F76464","editor.background":"#161B2D","editorCursor.foreground":"#EEF1F7","editor.selectionBackground":"#5C8DEA2B","editorLineNumber.foreground":"#242C42","scrollbarSlider.background":"#242C42","scrollbarSlider.hoverBackground":"#242C42","scrollbarSlider.activeBackground":"#242C42"}},[a.EditorThemes.light]:{base:"vs",inherit:!1,rules:[{token:"string.key.json",foreground:"#009D9F"},{token:"string.value.json",foreground:"#2764D9"},{token:"number",foreground:"#B25500"},{token:"keyword.json",foreground:"#3F3D25"},{token:"delimiter",foreground:"#161B2D"},{token:"delimiter.bracket.json",foreground:"#7E39EC"},{token:"delimiter.parenthesis",foreground:"#7E39EC"}],colors:{"editor.foreground":"#AE2F2F","editor.background":"#EEF1F7","editorCursor.foreground":"#161B2D","editor.selectionBackground":"#5C8DEA2B","editorLineNumber.foreground":"#242C42","scrollbarSlider.background":"#242C42","scrollbarSlider.hoverBackground":"#242C42","scrollbarSlider.activeBackground":"#242C42"}}},k=({value:e,onChange:o,onValidateJSON:r,options:t,currentTheme:n,themesConfig:s=b})=>{function d(i){i?.editor?.defineTheme(n,s[n]),i.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:[{uri:"http://custom-schema/object-required.json",fileMatch:["*"],schema:{type:"object",description:"Top-level value must be an object",additionalProperties:!0}}]})}const{Editor:l}=f;return u.jsx(l,{beforeMount:d,height:"100%",defaultLanguage:"json",value:e,onChange:o,theme:n,onValidate:r,options:{minimap:{enabled:!1},formatOnType:!0,formatOnPaste:!0,selectOnLineNumbers:!1,automaticLayout:!0,scrollBeyondLastLine:!1,wordWrap:"on",smoothScrolling:!0,overviewRulerLanes:0,scrollbar:{horizontal:"hidden",verticalScrollbarSize:4,verticalSliderSize:4},...t??{}}})};exports.DialJsonEditor=k;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),O=require("@uiw/react-md-editor"),_=require("./lazy-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),O=require("@uiw/react-md-editor"),_=require("./lazy-tfN4sKhq.cjs"),k=require("./merge-classes-Dipy1Ih1.cjs"),o=require("@tabler/icons-react"),p=require("./icon-DhjrDQ8I.cjs"),f=require("./icon-CrGVkVpG.cjs");function E(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(i,r,c.get?c:{enumerable:!0,get:()=>n[r]})}}return i.default=n,Object.freeze(i)}const b=E(O),L=f.DIAL_ICON_SIZE.SM,t={size:L,stroke:p.DIAL_KIT_ICON_STROKE},s=(n,i)=>({...n,icon:i}),M=()=>{const{bold:n,code:i,divider:r,group:c,heading1:a,heading2:d,heading3:u,italic:l,link:m,orderedListCommand:I,quote:x,strikethrough:g,table:h,unorderedListCommand:C}=b;return[s(n,e.jsx(o.IconBold,{...t})),s(l,e.jsx(o.IconItalic,{...t})),s(g,e.jsx(o.IconStrikethrough,{...t})),r,c([a,d,u],{name:"heading",groupName:"heading",icon:e.jsx(o.IconTextSize,{...t}),buttonProps:{"aria-label":"Text style",title:"Text style"}}),r,s(C,e.jsx(o.IconList,{...t})),s(I,e.jsx(o.IconListNumbers,{...t})),r,s(x,e.jsx(o.IconQuote,{...t})),s(m,e.jsx(o.IconLink,{...t})),s(i,e.jsx(o.IconCode,{...t})),r,s(h,e.jsx(o.IconTable,{...t}))]},S=()=>{const{codeEdit:n,codeLive:i,codePreview:r,divider:c,fullscreen:a}=b;return[s(n,e.jsx(o.IconPencil,{...t})),s(i,e.jsx(o.IconLayoutColumns,{...t})),s(r,e.jsx(o.IconEye,{...t})),c,s(a,e.jsx(o.IconMaximize,{...t}))]},T=({value:n,onChange:i,height:r=300,theme:c=_.EditorThemes.light,className:a,placeholder:d,defaultPreview:u="edit",id:l,ariaLabel:m})=>{const I=j.useMemo(()=>M(),[]),x=j.useMemo(()=>S(),[]);return e.jsx("div",{"data-color-mode":c,className:k.mergeClasses("dial-kit-markdown-editor",a),children:e.jsx(O,{value:n,onChange:g=>i?.(g||""),height:r,preview:u,commands:I,extraCommands:x,textareaProps:{placeholder:d,id:l,"aria-label":m}})})};exports.MarkdownEditor=T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@uiw/react-md-editor"),m=require("./lazy-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@uiw/react-md-editor"),m=require("./lazy-tfN4sKhq.cjs"),u=require("./merge-classes-Dipy1Ih1.cjs"),x=({value:t,onChange:s,height:o=300,preview:i="edit",theme:a=m.EditorThemes.dark,className:n,placeholder:r})=>{const d=r!==void 0&&!t;return e.jsxs("div",{"data-color-mode":a,className:u.mergeClasses("relative",n),children:[e.jsx(c,{value:t,onChange:l=>s?.(l||""),height:o,preview:i}),d&&e.jsx("div",{className:"pointer-events-none absolute left-0 top-8 px-2 dial-small-text text-secondary opacity-40",children:r})]})};exports.DialMarkdownEditor=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),m=require("./Switch-CUKClcEz.cjs"),E=require("./lazy-tfN4sKhq.cjs"),N=require("./MarkdownEditor-jQ8nDJfx.cjs"),b=({value:r,onChangeValue:l,label:i,headerContent:a,switcherLabel:d,height:c=300,theme:u=E.EditorThemes.dark,onValidateJSON:x,preview:j="edit"})=>{const w=n.useId(),[t,C]=n.useState(!1),[f,p]=n.useState(null);n.useEffect(()=>{t&&typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-qv1Z0dLX.cjs")).then(s=>{p(()=>s.DialJsonEditor)})},[t]);const h=n.useCallback(s=>{l?.(s)},[l]),S=n.useCallback(s=>{x?.(s)},[x]),o=!!d;return e.jsx("div",{className:"size-full flex flex-col",children:e.jsx("div",{className:"flex flex-col gap-8",children:e.jsxs("div",{children:[(i||a||o)&&e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i&&e.jsx(m.DialLabel,{label:i}),e.jsxs("div",{className:"flex items-center gap-2 flex-1 justify-end",children:[a,o&&e.jsx("label",{className:"flex items-center gap-2 cursor-pointer",children:e.jsx(m.DialSwitch,{isOn:t,label:d,switchId:w,onChange:s=>C(s)})})]})]}),o&&t?e.jsx("div",{className:"border border-primary rounded",style:{height:`${c}px`},children:f&&e.jsx(f,{value:r,onChange:h,onValidateJSON:S,currentTheme:u})}):e.jsx(N.DialMarkdownEditor,{value:r,onChange:h,height:c,preview:j,theme:u})]})})})};exports.DialMarkdownEditorContainer=b;
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { useId as g, useState as x, useEffect as J, useCallback as u } from "react";
|
|
3
|
-
import "
|
|
4
|
-
import { EditorThemes as
|
|
5
|
-
import "@monaco-editor/react";
|
|
6
|
-
import { DialSwitch as b } from "../Switch/Switch.js";
|
|
3
|
+
import { DialSwitch as S } from "../Switch/Switch.js";
|
|
4
|
+
import { EditorThemes as b } from "../../types/editor.js";
|
|
7
5
|
import { DialMarkdownEditor as v } from "./MarkdownEditor.js";
|
|
8
6
|
import { DialLabel as y } from "../Label/Label.js";
|
|
9
|
-
const
|
|
7
|
+
const z = ({
|
|
10
8
|
value: s,
|
|
11
9
|
onChangeValue: l,
|
|
12
|
-
label:
|
|
10
|
+
label: i,
|
|
13
11
|
headerContent: d,
|
|
14
12
|
switcherLabel: a,
|
|
15
13
|
height: c = 300,
|
|
16
|
-
theme: m =
|
|
14
|
+
theme: m = b.dark,
|
|
17
15
|
onValidateJSON: f,
|
|
18
16
|
preview: C = "edit"
|
|
19
17
|
}) => {
|
|
20
|
-
const N = g(), [
|
|
18
|
+
const N = g(), [n, w] = x(!1), [p, D] = x(null);
|
|
21
19
|
J(() => {
|
|
22
|
-
|
|
20
|
+
n && typeof window < "u" && import("../JsonEditor/JsonEditor.js").then((o) => {
|
|
23
21
|
D(() => o.DialJsonEditor);
|
|
24
22
|
});
|
|
25
|
-
}, [
|
|
23
|
+
}, [n]);
|
|
26
24
|
const h = u(
|
|
27
25
|
(o) => {
|
|
28
26
|
l?.(o);
|
|
@@ -33,16 +31,16 @@ const $ = ({
|
|
|
33
31
|
f?.(o);
|
|
34
32
|
},
|
|
35
33
|
[f]
|
|
36
|
-
),
|
|
34
|
+
), t = !!a;
|
|
37
35
|
return /* @__PURE__ */ e("div", { className: "size-full flex flex-col", children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-8", children: /* @__PURE__ */ r("div", { children: [
|
|
38
|
-
(
|
|
39
|
-
|
|
36
|
+
(i || d || t) && /* @__PURE__ */ r("div", { className: "flex justify-between items-center mb-2", children: [
|
|
37
|
+
i && /* @__PURE__ */ e(y, { label: i }),
|
|
40
38
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 flex-1 justify-end", children: [
|
|
41
39
|
d,
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
t && /* @__PURE__ */ e("label", { className: "flex items-center gap-2 cursor-pointer", children: /* @__PURE__ */ e(
|
|
41
|
+
S,
|
|
44
42
|
{
|
|
45
|
-
isOn:
|
|
43
|
+
isOn: n,
|
|
46
44
|
label: a,
|
|
47
45
|
switchId: N,
|
|
48
46
|
onChange: (o) => w(o)
|
|
@@ -50,7 +48,7 @@ const $ = ({
|
|
|
50
48
|
) })
|
|
51
49
|
] })
|
|
52
50
|
] }),
|
|
53
|
-
|
|
51
|
+
t && n ? /* @__PURE__ */ e(
|
|
54
52
|
"div",
|
|
55
53
|
{
|
|
56
54
|
className: "border border-primary rounded",
|
|
@@ -78,5 +76,5 @@ const $ = ({
|
|
|
78
76
|
] }) }) });
|
|
79
77
|
};
|
|
80
78
|
export {
|
|
81
|
-
|
|
79
|
+
z as DialMarkdownEditorContainer
|
|
82
80
|
};
|
|
@@ -1,87 +1,90 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { IconDots as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { Dropdown as
|
|
5
|
-
import { EllipsisTooltip as
|
|
6
|
-
import { DIAL_KIT_ICON_STROKE as
|
|
7
|
-
import { DIAL_ICON_SIZE as
|
|
8
|
-
import { DIAL_KIT_CLASS as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
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 = ({
|
|
12
13
|
items: s,
|
|
13
|
-
maxVisibleItems:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
19
21
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
() => s.length >
|
|
22
|
-
[s,
|
|
23
|
-
),
|
|
24
|
-
() =>
|
|
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) => ({
|
|
25
27
|
key: String(l),
|
|
26
28
|
label: e.label,
|
|
27
29
|
icon: e.icon
|
|
28
30
|
})),
|
|
29
|
-
[
|
|
30
|
-
),
|
|
31
|
+
[n]
|
|
32
|
+
), v = B(
|
|
31
33
|
({ key: e, domEvent: l }) => {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
+
const r = n[Number(e)];
|
|
35
|
+
r && (r.onClick?.(l), !r.onClick && r.href && !l.defaultPrevented && (window.location.href = r.href));
|
|
34
36
|
},
|
|
35
|
-
[
|
|
37
|
+
[n]
|
|
36
38
|
);
|
|
37
39
|
if (s.length === 0) return null;
|
|
38
|
-
const
|
|
40
|
+
const d = s.slice(n.length + 1), C = (e, {
|
|
39
41
|
index: l,
|
|
40
|
-
isFirst:
|
|
41
|
-
isCurrent:
|
|
42
|
+
isFirst: r,
|
|
43
|
+
isCurrent: t
|
|
42
44
|
}) => {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
),
|
|
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: [
|
|
49
51
|
e.icon,
|
|
50
|
-
/* @__PURE__ */ a(
|
|
52
|
+
/* @__PURE__ */ a(w, { text: e.label })
|
|
51
53
|
] });
|
|
52
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ c(
|
|
53
55
|
"li",
|
|
54
56
|
{
|
|
55
|
-
className:
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
className: o(
|
|
58
|
+
S,
|
|
59
|
+
I[i],
|
|
60
|
+
q[t ? "last" : r ? "first" : "middle"]
|
|
58
61
|
),
|
|
59
62
|
children: [
|
|
60
|
-
|
|
63
|
+
N ? e.href ? /* @__PURE__ */ a(
|
|
61
64
|
"a",
|
|
62
65
|
{
|
|
63
66
|
href: e.href,
|
|
64
67
|
onClick: e.onClick,
|
|
65
|
-
className:
|
|
66
|
-
children:
|
|
68
|
+
className: h,
|
|
69
|
+
children: p
|
|
67
70
|
}
|
|
68
71
|
) : /* @__PURE__ */ a(
|
|
69
72
|
"button",
|
|
70
73
|
{
|
|
71
74
|
type: "button",
|
|
72
75
|
onClick: e.onClick,
|
|
73
|
-
className:
|
|
74
|
-
children:
|
|
76
|
+
className: h,
|
|
77
|
+
children: p
|
|
75
78
|
}
|
|
76
79
|
) : /* @__PURE__ */ a(
|
|
77
80
|
"span",
|
|
78
81
|
{
|
|
79
|
-
className:
|
|
80
|
-
"aria-current":
|
|
81
|
-
children:
|
|
82
|
+
className: h,
|
|
83
|
+
"aria-current": t ? "page" : void 0,
|
|
84
|
+
children: p
|
|
82
85
|
}
|
|
83
86
|
),
|
|
84
|
-
!
|
|
87
|
+
!t && /* @__PURE__ */ a("span", { className: g, "aria-hidden": "true", children: f })
|
|
85
88
|
]
|
|
86
89
|
},
|
|
87
90
|
`segment-${l}`
|
|
@@ -90,51 +93,61 @@ const ae = ({
|
|
|
90
93
|
return /* @__PURE__ */ a(
|
|
91
94
|
"nav",
|
|
92
95
|
{
|
|
93
|
-
"aria-label":
|
|
94
|
-
className:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
"aria-label": _,
|
|
97
|
+
className: o(
|
|
98
|
+
R,
|
|
99
|
+
E,
|
|
100
|
+
b.breadcrumbs
|
|
98
101
|
),
|
|
99
|
-
children: /* @__PURE__ */
|
|
100
|
-
|
|
102
|
+
children: /* @__PURE__ */ c("ol", { className: O, children: [
|
|
103
|
+
C(s[0], {
|
|
101
104
|
index: 0,
|
|
102
105
|
isFirst: !0,
|
|
103
106
|
isCurrent: s.length === 1
|
|
104
107
|
}),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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,
|
|
115
119
|
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
items: T,
|
|
121
|
+
onItemClick: v,
|
|
122
|
+
placement: "bottom-start",
|
|
123
|
+
matchReferenceWidth: !1,
|
|
119
124
|
children: /* @__PURE__ */ a(
|
|
120
|
-
|
|
125
|
+
"button",
|
|
121
126
|
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
+
)
|
|
125
138
|
}
|
|
126
139
|
)
|
|
127
140
|
}
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
(e, l) =>
|
|
135
|
-
index: s.length -
|
|
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,
|
|
136
149
|
isFirst: !1,
|
|
137
|
-
isCurrent: l ===
|
|
150
|
+
isCurrent: l === d.length - 1
|
|
138
151
|
})
|
|
139
152
|
)
|
|
140
153
|
] })
|
|
@@ -142,5 +155,5 @@ const ae = ({
|
|
|
142
155
|
);
|
|
143
156
|
};
|
|
144
157
|
export {
|
|
145
|
-
|
|
158
|
+
te as Breadcrumbs
|
|
146
159
|
};
|
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { IconChevronRight as
|
|
3
|
-
import { DIAL_KIT_ICON_STROKE as
|
|
4
|
-
import { DIAL_ICON_SIZE as
|
|
5
|
-
|
|
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 = {
|
|
6
13
|
first: "shrink-0",
|
|
7
14
|
middle: "min-w-0 max-w-[30%] shrink",
|
|
8
15
|
last: "min-w-0 max-w-[51%] shrink"
|
|
9
|
-
},
|
|
10
|
-
|
|
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,
|
|
11
18
|
{
|
|
12
|
-
size:
|
|
13
|
-
stroke:
|
|
19
|
+
size: i.SM,
|
|
20
|
+
stroke: n,
|
|
14
21
|
"aria-hidden": "true",
|
|
15
22
|
className: "rtl:scale-x-[-1]"
|
|
16
23
|
}
|
|
17
24
|
);
|
|
18
25
|
export {
|
|
19
|
-
|
|
26
|
+
v as DEFAULT_MAX_VISIBLE_ITEMS,
|
|
20
27
|
w as MIN_VISIBLE_ITEMS,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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,
|
|
30
38
|
I as separatorClassName,
|
|
31
|
-
|
|
39
|
+
d as sizeClassName,
|
|
40
|
+
h as staticSegmentClassName
|
|
32
41
|
};
|
|
@@ -1,57 +1,59 @@
|
|
|
1
1
|
import { jsx as s, jsxs as I } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as j, useId as R, useCallback as _ } from "react";
|
|
3
3
|
import { mergeClasses as l } from "../../../utils/merge-classes.js";
|
|
4
|
-
import { DIAL_KIT_CLASS as
|
|
4
|
+
import { DIAL_KIT_CLASS as a } from "../../../constants/public-class-names.js";
|
|
5
5
|
import { TabOrientation as u } from "../../../types/tab.js";
|
|
6
|
-
const
|
|
6
|
+
const z = {
|
|
7
7
|
[u.Horizontal]: { next: "ArrowRight", previous: "ArrowLeft" },
|
|
8
8
|
[u.Vertical]: { next: "ArrowDown", previous: "ArrowUp" }
|
|
9
|
-
},
|
|
9
|
+
}, M = ({
|
|
10
10
|
tabs: n,
|
|
11
|
-
activeTabId:
|
|
11
|
+
activeTabId: c,
|
|
12
12
|
onTabChange: f,
|
|
13
13
|
orientation: m = u.Horizontal,
|
|
14
|
-
sectionLabel:
|
|
14
|
+
sectionLabel: d,
|
|
15
15
|
ariaLabel: k,
|
|
16
16
|
className: v,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
tabListClassName: D,
|
|
18
|
+
tabClassName: S,
|
|
19
|
+
sectionLabelClassName: H
|
|
19
20
|
}) => {
|
|
20
|
-
const w =
|
|
21
|
+
const w = j({}), A = R(), i = m === u.Vertical, h = n.find((e) => e.id === c), K = h && !h.disabled ? h.id : n.find((e) => !e.disabled)?.id, V = _(
|
|
21
22
|
(e) => {
|
|
22
|
-
const { next: t, previous: r } =
|
|
23
|
+
const { next: t, previous: r } = z[m];
|
|
23
24
|
if (![t, r, "Home", "End"].includes(e.key) || n.length === 0)
|
|
24
25
|
return;
|
|
25
26
|
const o = n.filter((g) => !g.disabled);
|
|
26
27
|
if (o.length === 0) return;
|
|
27
|
-
const
|
|
28
|
-
o.findIndex((g) => g.id ===
|
|
28
|
+
const p = Math.max(
|
|
29
|
+
o.findIndex((g) => g.id === c),
|
|
29
30
|
0
|
|
30
31
|
), b = o.length - 1;
|
|
31
|
-
let
|
|
32
|
-
e.key === t ?
|
|
33
|
-
const y = o[
|
|
34
|
-
w.current[y.id]?.focus(), y.id !==
|
|
32
|
+
let x = p;
|
|
33
|
+
e.key === t ? x = p === b ? 0 : p + 1 : e.key === r ? x = p === 0 ? b : p - 1 : e.key === "Home" ? x = 0 : x = b, e.preventDefault();
|
|
34
|
+
const y = o[x];
|
|
35
|
+
w.current[y.id]?.focus(), y.id !== c && f(y.id);
|
|
35
36
|
},
|
|
36
|
-
[n,
|
|
37
|
+
[n, c, f, m]
|
|
37
38
|
), N = /* @__PURE__ */ s(
|
|
38
39
|
"div",
|
|
39
40
|
{
|
|
40
41
|
role: "tablist",
|
|
41
42
|
"aria-orientation": i ? "vertical" : void 0,
|
|
42
43
|
"aria-label": k,
|
|
43
|
-
"aria-labelledby": !k &&
|
|
44
|
-
onKeyDown:
|
|
44
|
+
"aria-labelledby": !k && d ? A : void 0,
|
|
45
|
+
onKeyDown: V,
|
|
45
46
|
className: l(
|
|
46
47
|
i ? "flex flex-col gap-1 px-2" : "flex justify-start gap-1",
|
|
47
48
|
// Without a heading the list is the root, so it takes the caller's
|
|
48
49
|
// classes — and the root kit class below — itself.
|
|
49
|
-
!
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
!d && v,
|
|
51
|
+
D,
|
|
52
|
+
a.tabList,
|
|
53
|
+
!d && a.tabs
|
|
52
54
|
),
|
|
53
55
|
children: n.map((e) => {
|
|
54
|
-
const t =
|
|
56
|
+
const t = c === e.id, r = !!e.disabled;
|
|
55
57
|
return /* @__PURE__ */ I(
|
|
56
58
|
"button",
|
|
57
59
|
{
|
|
@@ -62,7 +64,7 @@ const _ = {
|
|
|
62
64
|
role: "tab",
|
|
63
65
|
"aria-selected": t,
|
|
64
66
|
disabled: r,
|
|
65
|
-
tabIndex: e.id ===
|
|
67
|
+
tabIndex: e.id === K ? 0 : -1,
|
|
66
68
|
onClick: () => f(e.id),
|
|
67
69
|
className: l(
|
|
68
70
|
"dial-kit-enhanced-target flex items-center gap-2 text-start",
|
|
@@ -78,8 +80,9 @@ const _ = {
|
|
|
78
80
|
],
|
|
79
81
|
r && (i ? "cursor-not-allowed text-control-disable-primary" : "cursor-not-allowed border-control-disable-primary text-control-disable-primary"),
|
|
80
82
|
!r && (i ? t ? "bg-control-accent-alpha text-accent hover:bg-control-accent-alpha-hover" : "hover:bg-control-accent-alpha-hover" : t ? "dial-kit-tab-selected-underline text-primary" : "border-transparent text-secondary"),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
S,
|
|
84
|
+
a.tab,
|
|
85
|
+
t && a.tabSelected
|
|
83
86
|
),
|
|
84
87
|
children: [
|
|
85
88
|
e.icon && // The label names the tab, so the icon beside it is decorative —
|
|
@@ -116,13 +119,13 @@ const _ = {
|
|
|
116
119
|
})
|
|
117
120
|
}
|
|
118
121
|
);
|
|
119
|
-
return
|
|
122
|
+
return d ? /* @__PURE__ */ I(
|
|
120
123
|
"div",
|
|
121
124
|
{
|
|
122
125
|
className: l(
|
|
123
126
|
"flex flex-col gap-3",
|
|
124
127
|
v,
|
|
125
|
-
|
|
128
|
+
a.tabs
|
|
126
129
|
),
|
|
127
130
|
children: [
|
|
128
131
|
/* @__PURE__ */ s(
|
|
@@ -138,10 +141,10 @@ const _ = {
|
|
|
138
141
|
id: A,
|
|
139
142
|
className: l(
|
|
140
143
|
"dial-h1-text text-primary",
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
H,
|
|
145
|
+
a.tabsSectionLabel
|
|
143
146
|
),
|
|
144
|
-
children:
|
|
147
|
+
children: d
|
|
145
148
|
}
|
|
146
149
|
)
|
|
147
150
|
}
|
|
@@ -152,5 +155,5 @@ const _ = {
|
|
|
152
155
|
) : N;
|
|
153
156
|
};
|
|
154
157
|
export {
|
|
155
|
-
|
|
158
|
+
M as Tabs
|
|
156
159
|
};
|