@epam/ai-dial-ui-kit 0.16.0-dev.14 → 0.16.0-dev.16

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),u=require("./editor-BH6_A1k2.cjs"),d=require("@monaco-editor/react");function f(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const m=f(d),b=({value:e,onChange:o,onValidateJSON:t,options:a,currentTheme:n,themesConfig:i=u.EDITOR_THEMES_CONFIG})=>{function s(r){r?.editor?.defineTheme(n,i[n]),r.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}=m;return c.jsx(l,{beforeMount:s,height:"100%",defaultLanguage:"json",value:e,onChange:o,theme:n,onValidate:t,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},...a??{}}})};exports.DialJsonEditor=b;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),O=require("@uiw/react-md-editor"),_=require("./lazy-_W6FYhKg.cjs"),k=require("./merge-classes-BEJXjzkx.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 h=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:g,strikethrough:x,table:j,unorderedListCommand:C}=h;return[s(n,e.jsx(o.IconBold,{...t})),s(l,e.jsx(o.IconItalic,{...t})),s(x,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(g,e.jsx(o.IconQuote,{...t})),s(m,e.jsx(o.IconLink,{...t})),s(i,e.jsx(o.IconCode,{...t})),r,s(j,e.jsx(o.IconTable,{...t}))]},S=()=>{const{codeEdit:n,codeLive:i,codePreview:r,divider:c,fullscreen:a}=h;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,showDragbar:I=!0})=>{const g=b.useMemo(()=>M(),[]),x=b.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:j=>i?.(j||""),height:r,preview:u,visibleDragbar:I,commands:g,extraCommands:x,textareaProps:{placeholder:d,id:l,"aria-label":m}})})};exports.MarkdownEditor=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),O=require("@uiw/react-md-editor"),_=require("./lazy-DMVYJhUR.cjs"),k=require("./merge-classes-BEJXjzkx.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 h=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:g,strikethrough:x,table:j,unorderedListCommand:C}=h;return[s(n,e.jsx(o.IconBold,{...t})),s(l,e.jsx(o.IconItalic,{...t})),s(x,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(g,e.jsx(o.IconQuote,{...t})),s(m,e.jsx(o.IconLink,{...t})),s(i,e.jsx(o.IconCode,{...t})),r,s(j,e.jsx(o.IconTable,{...t}))]},S=()=>{const{codeEdit:n,codeLive:i,codePreview:r,divider:c,fullscreen:a}=h;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,showDragbar:I=!0})=>{const g=b.useMemo(()=>M(),[]),x=b.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:j=>i?.(j||""),height:r,preview:u,visibleDragbar:I,commands:g,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"),m=require("@uiw/react-md-editor"),u=require("./lazy-_W6FYhKg.cjs"),x=require("./merge-classes-BEJXjzkx.cjs"),g=({value:r,onChange:s,height:o=300,preview:i="edit",theme:a=u.EditorThemes.dark,className:n,placeholder:t,showDragbar:d=!0})=>{const l=t!==void 0&&!r;return e.jsxs("div",{"data-color-mode":a,className:x.mergeClasses("relative",n),children:[e.jsx(m,{value:r,onChange:c=>s?.(c||""),height:o,preview:i,visibleDragbar:d}),l&&e.jsx("div",{className:"pointer-events-none absolute left-0 top-8 px-2 dial-small-text text-secondary opacity-40",children:t})]})};exports.DialMarkdownEditor=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("@uiw/react-md-editor"),u=require("./lazy-DMVYJhUR.cjs"),x=require("./merge-classes-BEJXjzkx.cjs"),g=({value:r,onChange:s,height:o=300,preview:i="edit",theme:a=u.EditorThemes.dark,className:n,placeholder:t,showDragbar:d=!0})=>{const l=t!==void 0&&!r;return e.jsxs("div",{"data-color-mode":a,className:x.mergeClasses("relative",n),children:[e.jsx(m,{value:r,onChange:c=>s?.(c||""),height:o,preview:i,visibleDragbar:d}),l&&e.jsx("div",{className:"pointer-events-none absolute left-0 top-8 px-2 dial-small-text text-secondary opacity-40",children:t})]})};exports.DialMarkdownEditor=g;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react");require("./editor-BH6_A1k2.cjs");const N=require("./lazy-DMVYJhUR.cjs");require("@monaco-editor/react");const m=require("./Switch-DAaAOaIu.cjs"),b=require("./MarkdownEditor-Dav_pp0T.cjs"),g=({value:o,onChangeValue:l,label:i,headerContent:a,switcherLabel:d,height:c=300,theme:u=N.EditorThemes.dark,onValidateJSON:x,preview:j="edit",showDragbar:w=!0})=>{const C=n.useId(),[t,p]=n.useState(!1),[f,S]=n.useState(null);n.useEffect(()=>{t&&typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-eAV7SaKu.cjs")).then(s=>{S(()=>s.DialJsonEditor)})},[t]);const h=n.useCallback(s=>{l?.(s)},[l]),E=n.useCallback(s=>{x?.(s)},[x]),r=!!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||r)&&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,r&&e.jsx("label",{className:"flex items-center gap-2 cursor-pointer",children:e.jsx(m.DialSwitch,{isOn:t,label:d,switchId:C,onChange:s=>p(s)})})]})]}),r&&t?e.jsx("div",{className:"border border-primary rounded",style:{height:`${c}px`},children:f&&e.jsx(f,{value:o,onChange:h,onValidateJSON:E,currentTheme:u})}):e.jsx(b.DialMarkdownEditor,{value:o,onChange:h,height:c,preview:j,showDragbar:w,theme:u})]})})})};exports.DialMarkdownEditorContainer=g;
@@ -1,27 +1,29 @@
1
1
  import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
2
  import { useId as J, useState as u, useEffect as S, useCallback as x } from "react";
3
- import { DialSwitch as b } from "../Switch/Switch.js";
4
- import { EditorThemes as v } from "../../types/editor.js";
3
+ import "../../constants/editor.js";
4
+ import { EditorThemes as b } from "../../types/editor.js";
5
+ import "@monaco-editor/react";
6
+ import { DialSwitch as v } from "../Switch/Switch.js";
5
7
  import { DialMarkdownEditor as y } from "./MarkdownEditor.js";
6
8
  import { DialLabel as j } from "../Label/Label.js";
7
- const B = ({
9
+ const q = ({
8
10
  value: s,
9
11
  onChangeValue: l,
10
- label: t,
12
+ label: i,
11
13
  headerContent: d,
12
14
  switcherLabel: a,
13
15
  height: c = 300,
14
- theme: m = v.dark,
16
+ theme: m = b.dark,
15
17
  onValidateJSON: f,
16
18
  preview: C = "edit",
17
19
  showDragbar: N = !0
18
20
  }) => {
19
- const w = J(), [n, D] = u(!1), [p, E] = u(null);
21
+ const w = J(), [t, D] = u(!1), [p, E] = u(null);
20
22
  S(() => {
21
- n && typeof window < "u" && import("../JsonEditor/JsonEditor.js").then((o) => {
23
+ t && typeof window < "u" && import("../JsonEditor/JsonEditor.js").then((o) => {
22
24
  E(() => o.DialJsonEditor);
23
25
  });
24
- }, [n]);
26
+ }, [t]);
25
27
  const h = x(
26
28
  (o) => {
27
29
  l?.(o);
@@ -32,16 +34,16 @@ const B = ({
32
34
  f?.(o);
33
35
  },
34
36
  [f]
35
- ), i = !!a;
37
+ ), n = !!a;
36
38
  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: [
37
- (t || d || i) && /* @__PURE__ */ r("div", { className: "flex justify-between items-center mb-2", children: [
38
- t && /* @__PURE__ */ e(j, { label: t }),
39
+ (i || d || n) && /* @__PURE__ */ r("div", { className: "flex justify-between items-center mb-2", children: [
40
+ i && /* @__PURE__ */ e(j, { label: i }),
39
41
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2 flex-1 justify-end", children: [
40
42
  d,
41
- i && /* @__PURE__ */ e("label", { className: "flex items-center gap-2 cursor-pointer", children: /* @__PURE__ */ e(
42
- b,
43
+ n && /* @__PURE__ */ e("label", { className: "flex items-center gap-2 cursor-pointer", children: /* @__PURE__ */ e(
44
+ v,
43
45
  {
44
- isOn: n,
46
+ isOn: t,
45
47
  label: a,
46
48
  switchId: w,
47
49
  onChange: (o) => D(o)
@@ -49,7 +51,7 @@ const B = ({
49
51
  ) })
50
52
  ] })
51
53
  ] }),
52
- i && n ? /* @__PURE__ */ e(
54
+ n && t ? /* @__PURE__ */ e(
53
55
  "div",
54
56
  {
55
57
  className: "border border-primary rounded",
@@ -78,5 +80,5 @@ const B = ({
78
80
  ] }) }) });
79
81
  };
80
82
  export {
81
- B as DialMarkdownEditorContainer
83
+ q as DialMarkdownEditorContainer
82
84
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as p, jsx as c } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as c } from "react/jsx-runtime";
2
2
  import { useId as u, useCallback as x } from "react";
3
3
  import { ElementSize as v } from "../../../types/size.js";
4
4
  import { mergeClasses as f } from "../../../utils/merge-classes.js";
@@ -11,31 +11,33 @@ const D = ({
11
11
  labelProps: e,
12
12
  isSelected: t = !1,
13
13
  isIndeterminate: r = !1,
14
- invalid: i = !1,
14
+ invalid: m = !1,
15
15
  disabled: s,
16
16
  onChange: l,
17
- caption: m,
17
+ caption: i,
18
18
  className: y,
19
19
  boxClassName: b,
20
20
  ...n
21
21
  }) => {
22
- const k = u(), a = h ?? k, d = m ? `${a}-caption` : void 0, g = x(
23
- (o) => {
24
- l?.(o.target.checked);
22
+ const g = u(), o = h ?? g, p = i ? `${o}-caption` : void 0, k = x(
23
+ (a) => {
24
+ l?.(a.target.checked);
25
25
  },
26
26
  [l]
27
27
  ), N = x(
28
- (o) => {
29
- o && (o.indeterminate = r);
28
+ (a) => {
29
+ a && (a.indeterminate = r);
30
30
  },
31
31
  [r]
32
32
  );
33
- return /* @__PURE__ */ p("div", { className: "flex flex-col gap-1", children: [
34
- /* @__PURE__ */ p(
33
+ return /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
34
+ /* @__PURE__ */ d(
35
35
  "div",
36
36
  {
37
37
  className: f(
38
- "flex items-center gap-2",
38
+ // Named group: the control shows its hover state while either of its
39
+ // two <label>s (the control or the text) is hovered.
40
+ "group/choice flex items-center gap-2",
39
41
  y,
40
42
  L.checkbox
41
43
  ),
@@ -46,26 +48,26 @@ const D = ({
46
48
  ...n,
47
49
  ref: N,
48
50
  type: "checkbox",
49
- id: a,
51
+ id: o,
50
52
  checked: t,
51
53
  disabled: s,
52
- onChange: g,
54
+ onChange: k,
53
55
  "aria-checked": r ? "mixed" : t,
54
- "aria-invalid": i || void 0,
56
+ "aria-invalid": m || void 0,
55
57
  "aria-label": C(
56
58
  typeof e?.label != "string" ? n["aria-label"] : void 0
57
59
  ),
58
- "aria-describedby": d,
60
+ "aria-describedby": p,
59
61
  className: "peer sr-only"
60
62
  }
61
63
  ),
62
64
  /* @__PURE__ */ c(
63
65
  A,
64
66
  {
65
- htmlFor: a,
67
+ htmlFor: o,
66
68
  isSelected: t,
67
69
  isIndeterminate: r,
68
- invalid: i,
70
+ invalid: m,
69
71
  disabled: s,
70
72
  className: b
71
73
  }
@@ -75,7 +77,7 @@ const D = ({
75
77
  {
76
78
  size: v.Standard,
77
79
  ...e,
78
- htmlFor: a,
80
+ htmlFor: o,
79
81
  className: f(
80
82
  // `Label` defaults to the secondary colour; a checkbox's own label
81
83
  // is primary while the control is usable.
@@ -88,12 +90,12 @@ const D = ({
88
90
  ]
89
91
  }
90
92
  ),
91
- m && /* @__PURE__ */ c(
93
+ i && /* @__PURE__ */ c(
92
94
  "span",
93
95
  {
94
- id: d,
96
+ id: p,
95
97
  className: "dial-tiny-text text-secondary ml-[28px]",
96
- children: m
98
+ children: i
97
99
  }
98
100
  )
99
101
  ] });
@@ -1,17 +1,17 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { IconMinus as u, IconCheck as d } from "@tabler/icons-react";
3
- import { mergeClasses as b } from "../../../utils/merge-classes.js";
4
- import { CHECKBOX_ICON_PROPS as p } from "./constants.js";
5
- import { DIAL_KIT_CLASS as f } from "../../../constants/public-class-names.js";
6
- const v = ({
7
- isSelected: n = !1,
8
- isIndeterminate: c = !1,
2
+ import { IconMinus as m, IconCheck as u } from "@tabler/icons-react";
3
+ import { mergeClasses as h } from "../../../utils/merge-classes.js";
4
+ import { CHECKBOX_ICON_PROPS as i } from "./constants.js";
5
+ import { DIAL_KIT_CLASS as g } from "../../../constants/public-class-names.js";
6
+ const k = ({
7
+ isSelected: c = !1,
8
+ isIndeterminate: n = !1,
9
9
  invalid: r = !1,
10
10
  disabled: a = !1,
11
- htmlFor: s,
12
- className: m
11
+ htmlFor: l,
12
+ className: p
13
13
  }) => {
14
- const o = c || n, e = !!s, l = b(
14
+ const o = n || c, e = !!l, s = h(
15
15
  "grid size-[20px] shrink-0 place-items-center rounded border transition-colors duration-200",
16
16
  // 20px is below the 24x24 minimum target, so grow the pointer target
17
17
  // without touching the rendered size. The 44px enhanced target would
@@ -19,18 +19,25 @@ const v = ({
19
19
  // box is not a target at all — the row around it is.
20
20
  e && "dial-kit-minimum-target",
21
21
  e && "peer-focus-visible:outline peer-focus-visible:outline-focus",
22
- a ? "border-transparent bg-control-disable-primary text-control-disable-primary" : b(
22
+ a ? "border-transparent bg-control-disable-primary text-control-disable-primary" : h(
23
23
  r && o && "border-transparent bg-control-error text-control-permanent",
24
24
  r && !o && "border-error bg-control-neutral",
25
- !r && o && "border-transparent bg-control-accent text-control-permanent hover:bg-control-accent-hover",
26
- !r && !o && "border-default bg-control-neutral hover:border-accent hover:bg-control-accent-alpha-hover"
25
+ !r && o && "border-transparent bg-control-accent text-control-permanent",
26
+ !r && !o && "border-default bg-control-neutral",
27
+ /*
28
+ * A control box reacts while either label of its `Checkbox` is hovered
29
+ * (the `group/choice` root); a decorative box only to its own hover,
30
+ * since the row around it owns the interaction.
31
+ */
32
+ !r && o && (e ? "group-has-[label:hover]/choice:bg-control-accent-hover" : "hover:bg-control-accent-hover"),
33
+ !r && !o && (e ? "group-has-[label:hover]/choice:border-accent group-has-[label:hover]/choice:bg-control-accent-alpha-hover" : "hover:border-accent hover:bg-control-accent-alpha-hover")
27
34
  ),
28
35
  a ? "cursor-not-allowed" : e && "cursor-pointer",
29
- m,
30
- f.checkboxBox
31
- ), i = c ? /* @__PURE__ */ t(u, { ...p }) : n && /* @__PURE__ */ t(d, { ...p });
32
- return e ? /* @__PURE__ */ t("label", { htmlFor: s, className: l, children: i }) : /* @__PURE__ */ t("span", { "aria-hidden": "true", className: l, children: i });
36
+ p,
37
+ g.checkboxBox
38
+ ), b = n ? /* @__PURE__ */ t(m, { ...i }) : c && /* @__PURE__ */ t(u, { ...i });
39
+ return e ? /* @__PURE__ */ t("label", { htmlFor: l, className: s, children: b }) : /* @__PURE__ */ t("span", { "aria-hidden": "true", className: s, children: b });
33
40
  };
34
41
  export {
35
- v as CheckboxBox
42
+ k as CheckboxBox
36
43
  };
@@ -1,65 +1,111 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { IconFolder as I, IconChevronRight as f } from "@tabler/icons-react";
3
- import { DialBreadcrumb as h } from "../../Breadcrumb/Breadcrumb.js";
4
- import { DialIcon as t } from "../../Icon/Icon.js";
5
- import { DIAL_KIT_ICON_STROKE as s } from "../constants/icon.js";
6
- import { DIAL_ICON_SIZE as x } from "../../../constants/icon.js";
7
- import { mergeClasses as l } from "../../../utils/merge-classes.js";
8
- import { DIAL_KIT_CLASS as N } from "../../../constants/public-class-names.js";
9
- const y = ({
1
+ import { jsx as r, jsxs as l, Fragment as C } from "react/jsx-runtime";
2
+ import { IconFolder as S, IconDots as _, IconChevronRight as L } from "@tabler/icons-react";
3
+ import { DialBreadcrumbItem as x } from "../../Breadcrumb/BreadcrumbItem.js";
4
+ import { breadcrumbListClassName as D, breadcrumbSeparatorClassName as y, breadcrumbItemBaseClassName as A, breadcrumbBaseClassName as B } from "../../Breadcrumb/constants.js";
5
+ import { DialIcon as m } from "../../Icon/Icon.js";
6
+ import { DIAL_KIT_ICON_STROKE as t } from "../constants/icon.js";
7
+ import { Tooltip as E } from "../Tooltip/Tooltip.js";
8
+ import { DIAL_ICON_SIZE as n } from "../../../constants/icon.js";
9
+ import { mergeClasses as i } from "../../../utils/merge-classes.js";
10
+ import { DIAL_KIT_CLASS as F } from "../../../constants/public-class-names.js";
11
+ const T = 3, G = ({
10
12
  segments: e,
11
- labelClassName: m = "dial-small-text",
12
- leafClassName: i = "dial-small-semi-text",
13
- className: c,
14
- ariaLabel: d = "Folder path"
13
+ labelClassName: d = "dial-small-text",
14
+ leafClassName: h = "dial-small-semi-text",
15
+ className: p,
16
+ ariaLabel: N = "Folder path"
15
17
  }) => {
16
- const n = /* @__PURE__ */ r(
17
- t,
18
+ const I = /* @__PURE__ */ r(
19
+ m,
18
20
  {
19
21
  icon: /* @__PURE__ */ r(
20
- I,
22
+ S,
21
23
  {
22
- size: x.SM,
23
- stroke: s,
24
+ size: n.SM,
25
+ stroke: t,
24
26
  "aria-hidden": "true"
25
27
  }
26
28
  ),
27
29
  className: "text-secondary"
28
30
  }
29
- ), p = e.map((o, a) => ({
30
- label: a === e.length - 1 ? /* @__PURE__ */ r("span", { className: i, children: o }) : o,
31
- disabled: !0,
32
- ...a === 0 ? { iconBefore: n } : {}
33
- }));
34
- return /* @__PURE__ */ r(
35
- h,
31
+ ), c = /* @__PURE__ */ r(
32
+ m,
36
33
  {
37
- className: l(c, N.folderPath),
38
- ariaLabel: d,
39
- separator: /* @__PURE__ */ r(
40
- t,
34
+ icon: /* @__PURE__ */ r(
35
+ L,
41
36
  {
42
- icon: /* @__PURE__ */ r(
43
- f,
44
- {
45
- size: 14,
46
- stroke: s,
47
- "aria-hidden": "true",
48
- className: "rtl:scale-x-[-1]"
49
- }
50
- ),
51
- className: "text-secondary"
37
+ size: 14,
38
+ stroke: t,
39
+ "aria-hidden": "true",
40
+ className: "rtl:scale-x-[-1]"
52
41
  }
53
42
  ),
54
- pathItems: p,
55
- labelClassName: l(
56
- m,
57
- "text-secondary",
58
- "!cursor-default"
59
- )
43
+ className: "text-secondary"
44
+ }
45
+ ), f = i(
46
+ d,
47
+ "text-secondary",
48
+ "!cursor-default"
49
+ ), o = (a) => {
50
+ const s = a === e.length - 1;
51
+ return /* @__PURE__ */ r(
52
+ x,
53
+ {
54
+ label: s ? /* @__PURE__ */ r("span", { className: h, children: e[a] }) : e[a],
55
+ disabled: !0,
56
+ iconBefore: a === 0 ? I : void 0,
57
+ isFirst: a === 0 && e.length > 1,
58
+ isLast: s,
59
+ separator: c,
60
+ labelClassName: f
61
+ },
62
+ `item-${a}`
63
+ );
64
+ }, u = e.length > T, b = e.slice(1, -2);
65
+ return /* @__PURE__ */ r(
66
+ "nav",
67
+ {
68
+ "aria-label": N,
69
+ className: i(
70
+ B,
71
+ p,
72
+ F.folderPath
73
+ ),
74
+ children: /* @__PURE__ */ r("ol", { className: D, children: u ? /* @__PURE__ */ l(C, { children: [
75
+ o(0),
76
+ /* @__PURE__ */ l(
77
+ "li",
78
+ {
79
+ className: i(A, "shrink-0"),
80
+ children: [
81
+ /* @__PURE__ */ l(
82
+ E,
83
+ {
84
+ tooltip: e.join(" > "),
85
+ triggerClassName: "inline-flex cursor-default items-center text-secondary",
86
+ children: [
87
+ /* @__PURE__ */ r(
88
+ _,
89
+ {
90
+ size: n.SM,
91
+ stroke: t,
92
+ "aria-hidden": "true"
93
+ }
94
+ ),
95
+ /* @__PURE__ */ r("span", { className: "sr-only", children: b.join(", ") })
96
+ ]
97
+ }
98
+ ),
99
+ /* @__PURE__ */ r("span", { className: y, children: c })
100
+ ]
101
+ }
102
+ ),
103
+ o(e.length - 2),
104
+ o(e.length - 1)
105
+ ] }) : e.map((a, s) => o(s)) })
60
106
  }
61
107
  );
62
108
  };
63
109
  export {
64
- y as FolderPath
110
+ G as FolderPath
65
111
  };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
- import { useId as h, useCallback as y } from "react";
2
+ import { useId as x, useCallback as y } from "react";
3
3
  import { ElementSize as N } from "../../../types/size.js";
4
4
  import { mergeClasses as r } from "../../../utils/merge-classes.js";
5
5
  import { resolveAccessibleName as v } from "../../../utils/accessible-name.js";
@@ -11,15 +11,15 @@ const F = ({
11
11
  value: i,
12
12
  labelProps: o,
13
13
  isSelected: l = !1,
14
- disabled: t,
14
+ disabled: a,
15
15
  onChange: s,
16
16
  caption: c,
17
- className: f,
17
+ className: b,
18
18
  ...n
19
19
  }) => {
20
- const b = h(), a = p ?? b, d = c ? `${a}-caption` : void 0, g = y(
21
- (x) => {
22
- x.target.checked && s?.(i);
20
+ const f = x(), t = p ?? f, d = c ? `${t}-caption` : void 0, g = y(
21
+ (h) => {
22
+ h.target.checked && s?.(i);
23
23
  },
24
24
  [s, i]
25
25
  );
@@ -28,8 +28,10 @@ const F = ({
28
28
  "div",
29
29
  {
30
30
  className: r(
31
- "flex items-center gap-2 ",
32
- f,
31
+ // Named group: the control shows its hover state while either of its
32
+ // two <label>s (the control or the text) is hovered.
33
+ "group/choice flex items-center gap-2",
34
+ b,
33
35
  k.radio
34
36
  ),
35
37
  children: [
@@ -38,11 +40,11 @@ const F = ({
38
40
  {
39
41
  ...n,
40
42
  type: "radio",
41
- id: a,
43
+ id: t,
42
44
  name: u,
43
45
  value: i,
44
46
  checked: l,
45
- disabled: t,
47
+ disabled: a,
46
48
  onChange: g,
47
49
  "aria-label": v(
48
50
  typeof o?.label != "string" ? n["aria-label"] : void 0
@@ -54,16 +56,16 @@ const F = ({
54
56
  /* @__PURE__ */ e(
55
57
  "label",
56
58
  {
57
- htmlFor: a,
59
+ htmlFor: t,
58
60
  className: r(
59
- "group grid size-[20px] shrink-0 place-items-center rounded-full border transition-colors duration-200 hover:bg-control-accent-alpha-hover",
61
+ "group grid size-[20px] shrink-0 place-items-center rounded-full border transition-colors duration-200",
60
62
  // 20px is below the 24x24 minimum target, so grow the pointer target
61
63
  // without touching the rendered size. The 44px enhanced target would
62
64
  // overhang by 12px per side and swallow the adjacent label.
63
65
  "dial-kit-minimum-target",
64
66
  "peer-focus-visible:outline peer-focus-visible:outline-focus",
65
- t ? "cursor-not-allowed border-default bg-control-disable-primary" : r(
66
- "cursor-pointer",
67
+ a ? "cursor-not-allowed border-default bg-control-disable-primary" : r(
68
+ "cursor-pointer group-has-[label:hover]/choice:bg-control-accent-alpha-hover",
67
69
  l ? "border border-accent bg-control-neutral" : "border-default bg-control-neutral"
68
70
  )
69
71
  ),
@@ -72,7 +74,7 @@ const F = ({
72
74
  {
73
75
  className: r(
74
76
  "size-3 rounded-full",
75
- t ? "bg-control-disable-secondary" : "bg-control-accent"
77
+ a ? "bg-control-disable-secondary" : "bg-control-accent"
76
78
  )
77
79
  }
78
80
  )
@@ -83,12 +85,12 @@ const F = ({
83
85
  {
84
86
  size: N.Standard,
85
87
  ...o,
86
- htmlFor: a,
88
+ htmlFor: t,
87
89
  className: r(
88
90
  // `Label` defaults to the secondary colour; a radio's own label is
89
91
  // primary while the control is usable.
90
92
  "py-[1px]",
91
- t ? "cursor-not-allowed text-control-disable-primary" : "cursor-pointer text-primary",
93
+ a ? "cursor-not-allowed text-control-disable-primary" : "cursor-pointer text-primary",
92
94
  o.className
93
95
  )
94
96
  }
@@ -9,15 +9,15 @@ const C = ({
9
9
  id: d,
10
10
  labelProps: o,
11
11
  isOn: t = !1,
12
- disabled: l,
12
+ disabled: c,
13
13
  onChange: a,
14
- caption: c,
14
+ caption: s,
15
15
  className: u,
16
16
  ...i
17
17
  }) => {
18
- const p = b(), s = d ?? p, n = c ? `${s}-caption` : void 0, f = g(
19
- (h) => {
20
- a?.(h.target.checked);
18
+ const p = b(), l = d ?? p, n = s ? `${l}-caption` : void 0, h = g(
19
+ (f) => {
20
+ a?.(f.target.checked);
21
21
  },
22
22
  [a]
23
23
  );
@@ -26,7 +26,9 @@ const C = ({
26
26
  "div",
27
27
  {
28
28
  className: r(
29
- "flex items-center gap-2",
29
+ // Named group: the control shows its hover state while either of its
30
+ // two <label>s (the control or the text) is hovered.
31
+ "group/choice flex items-center gap-2",
30
32
  u,
31
33
  N.switch
32
34
  ),
@@ -37,11 +39,11 @@ const C = ({
37
39
  ...i,
38
40
  type: "checkbox",
39
41
  role: "switch",
40
- id: s,
42
+ id: l,
41
43
  checked: t,
42
44
  "aria-checked": t,
43
- disabled: l,
44
- onChange: f,
45
+ disabled: c,
46
+ onChange: h,
45
47
  "aria-label": y(
46
48
  typeof o?.label != "string" ? i["aria-label"] : void 0
47
49
  ),
@@ -52,14 +54,14 @@ const C = ({
52
54
  /* @__PURE__ */ e(
53
55
  "label",
54
56
  {
55
- htmlFor: s,
57
+ htmlFor: l,
56
58
  className: r(
57
59
  "flex h-[18px] w-[36px] shrink-0 items-center rounded-full p-0.5 transition-colors duration-200",
58
60
  "peer-focus-visible:outline peer-focus-visible:outline-offset-2 peer-focus-visible:outline-focus",
59
61
  t ? "justify-end" : "justify-start",
60
- l ? "cursor-not-allowed bg-control-disable-primary" : r(
62
+ c ? "cursor-not-allowed bg-control-disable-primary" : r(
61
63
  "cursor-pointer",
62
- t ? "bg-control-accent hover:bg-control-accent-hover" : "bg-control-neutral-default hover:bg-control-neutral-hover-strong"
64
+ t ? "bg-control-accent group-has-[label:hover]/choice:bg-control-accent-hover" : "bg-control-neutral-default group-has-[label:hover]/choice:bg-control-neutral-hover-strong"
63
65
  )
64
66
  ),
65
67
  children: /* @__PURE__ */ e(
@@ -67,7 +69,7 @@ const C = ({
67
69
  {
68
70
  className: r(
69
71
  "size-3.5 shrink-0 rounded-full",
70
- l ? "bg-control-disable-secondary" : "bg-control-neutral"
72
+ c ? "bg-control-disable-secondary" : "bg-control-neutral"
71
73
  )
72
74
  }
73
75
  )
@@ -78,12 +80,12 @@ const C = ({
78
80
  {
79
81
  size: x.Standard,
80
82
  ...o,
81
- htmlFor: s,
83
+ htmlFor: l,
82
84
  className: r(
83
85
  // `Label` defaults to the secondary colour; the switch's own label
84
86
  // has always been primary while the control is usable.
85
87
  "py-[1px]",
86
- l ? "cursor-not-allowed text-control-disable-primary" : "cursor-pointer text-primary",
88
+ c ? "cursor-not-allowed text-control-disable-primary" : "cursor-pointer text-primary",
87
89
  o.className
88
90
  )
89
91
  }
@@ -91,12 +93,12 @@ const C = ({
91
93
  ]
92
94
  }
93
95
  ),
94
- c && /* @__PURE__ */ e(
96
+ s && /* @__PURE__ */ e(
95
97
  "span",
96
98
  {
97
99
  id: n,
98
100
  className: "dial-tiny-text text-secondary ml-[44px]",
99
- children: c
101
+ children: s
100
102
  }
101
103
  )
102
104
  ] });