@epam/ai-dial-settings-panel 1.2.0-dev.46 → 1.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SettingsPanel/SettingsPanel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SettingsPanel/SettingsPanel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAEnE,OAAO,KAAK,EAEV,kBAAkB,EACnB,MAAM,mCAAmC,CAAC;AA0B3C,kFAAkF;AAClF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAwIhD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const SETTINGS_PANEL_CLASS: {
|
|
2
|
+
/** The panel root, which carries the themed CSS variables. */
|
|
3
|
+
readonly panel: "dial-settings-panel-panel";
|
|
4
|
+
/** The vertical tab list holding the section rows. */
|
|
5
|
+
readonly tabList: "dial-settings-panel-tab-list";
|
|
6
|
+
/** Every section row, selected or not. */
|
|
7
|
+
readonly tab: "dial-settings-panel-tab";
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=public-class-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,oBAAoB;IAC/B,8DAA8D;;IAE9D,sDAAsD;;IAEtD,0CAA0C;;CAElC,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
._sectionLabel_7wog3_1{color:var(--sp-section-label-text,var(--text-primary,#161b2d))}._row_7wog3_5{color:var(--sp-row-text,var(--text-secondary,#57647a))}._row_7wog3_5:focus-visible{outline-color:var(--sp-row-focus-outline,var(--stroke-focus-black,#161b2d))}@media (hover:hover){._row_7wog3_5:hover:not(:disabled):not(._rowActive_7wog3_12){background-color:var(--sp-row-bg-hover,var(--bg-control-accent-alpha-hover,#2764d924))}}._row_7wog3_5:disabled{cursor:not-allowed}._row_7wog3_5._rowActive_7wog3_12{color:var(--sp-active-row-text,var(--text-accent,#1d4ed8));background-color:var(--sp-active-row-bg,var(--bg-control-accent-alpha,#2764d90f))}@media (hover:hover){._row_7wog3_5._rowActive_7wog3_12:hover{background-color:var(--sp-active-row-bg-hover,var(--bg-control-accent-alpha-hover,#2764d924))}}
|
|
2
|
-
/*$vite$:1*/.flex{display:flex}.h-11{height:2.75rem}.h-16{height:4rem}.w-full{width:100%}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.items-center{align-items:center}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.rounded-lg{border-radius:.5rem}.bg-layer-raised{background-color:var(--bg-layer-raised,#fcfcfc)}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.text-start{text-align:start}.text-primary{color:var(--text-primary,#161b2d)}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\:outline:focus-visible{outline-style:solid;outline-width:1px}.focus-visible\:-outline-offset-1:focus-visible{outline-offset:-1px}@media (min-width:1280px){.desktop\:h-10{height:2.5rem}}
|
|
2
|
+
/*$vite$:1*/.flex{display:flex}.h-11{height:2.75rem}.h-16{height:4rem}.w-full{width:100%}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.items-center{align-items:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.rounded-lg{border-radius:.5rem}.bg-layer-raised{background-color:var(--bg-layer-raised,#fcfcfc)}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.text-start{text-align:start}.text-primary{color:var(--text-primary,#161b2d)}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\:outline:focus-visible{outline-style:solid;outline-width:1px}.focus-visible\:-outline-offset-1:focus-visible{outline-offset:-1px}@media (min-width:1280px){.desktop\:h-10{height:2.5rem}}
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { SettingsPanel } from './components/SettingsPanel/SettingsPanel';
|
|
2
2
|
export type { SettingsPanelItem, SettingsPanelProps, SettingsPanelStyles, SettingsPanelColors, SettingsPanelTypography, } from './models/settings-panel-props';
|
|
3
|
+
export { SETTINGS_PANEL_CLASS } from './constants/public-class-names';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,72 +1,77 @@
|
|
|
1
1
|
import { buildCssVars as e, mergeClasses as t } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { useId as n, useRef as r } from "react";
|
|
3
3
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
//#region src/constants/public-class-names.ts
|
|
4
5
|
var o = {
|
|
6
|
+
panel: "dial-settings-panel-panel",
|
|
7
|
+
tabList: "dial-settings-panel-tab-list",
|
|
8
|
+
tab: "dial-settings-panel-tab"
|
|
9
|
+
}, s = {
|
|
5
10
|
sectionLabel: "_sectionLabel_7wog3_1",
|
|
6
11
|
row: "_row_7wog3_5",
|
|
7
12
|
rowActive: "_rowActive_7wog3_12"
|
|
8
|
-
},
|
|
13
|
+
}, c = (e, t, n) => {
|
|
9
14
|
let r = e.length;
|
|
10
15
|
for (let i = 1; i <= r; i += 1) {
|
|
11
16
|
let a = (t + n * i + r) % r;
|
|
12
17
|
if (!e[a].disabled) return a;
|
|
13
18
|
}
|
|
14
19
|
return t;
|
|
15
|
-
},
|
|
20
|
+
}, l = (e) => e.findIndex((e) => !e.disabled), u = (e) => {
|
|
16
21
|
for (let t = e.length - 1; t >= 0; --t) if (!e[t].disabled) return t;
|
|
17
22
|
return -1;
|
|
18
|
-
},
|
|
19
|
-
let
|
|
20
|
-
"--sp-section-label-text":
|
|
21
|
-
"--sp-row-text":
|
|
22
|
-
"--sp-row-bg-hover":
|
|
23
|
-
"--sp-active-row-bg":
|
|
24
|
-
"--sp-active-row-bg-hover":
|
|
25
|
-
"--sp-active-row-text":
|
|
26
|
-
"--sp-row-focus-outline":
|
|
27
|
-
}),
|
|
28
|
-
if (e < 0 || e ===
|
|
29
|
-
let t =
|
|
30
|
-
|
|
23
|
+
}, d = ({ items: d, activeId: f, onSelect: p, sectionLabel: m, styles: h, className: g }) => {
|
|
24
|
+
let _ = n(), v = r(/* @__PURE__ */ new Map()), { sectionLabelClassName: y = "dial-h1-text", itemLabelClassName: b = "dial-small-text", activeItemLabelClassName: x = "dial-small-semi-text" } = h?.typography ?? {}, S = h?.colors, C = e({
|
|
25
|
+
"--sp-section-label-text": S?.sectionLabelText,
|
|
26
|
+
"--sp-row-text": S?.rowText,
|
|
27
|
+
"--sp-row-bg-hover": S?.rowBackgroundHover,
|
|
28
|
+
"--sp-active-row-bg": S?.activeRowBackground,
|
|
29
|
+
"--sp-active-row-bg-hover": S?.activeRowBackgroundHover,
|
|
30
|
+
"--sp-active-row-text": S?.activeRowText,
|
|
31
|
+
"--sp-row-focus-outline": S?.rowFocusOutline
|
|
32
|
+
}), w = d.findIndex((e) => e.id === f), T = (e) => {
|
|
33
|
+
if (e < 0 || e === w) return;
|
|
34
|
+
let t = d[e];
|
|
35
|
+
v.current.get(t.id)?.focus(), p(t.id);
|
|
31
36
|
};
|
|
32
37
|
return /* @__PURE__ */ a("div", {
|
|
33
|
-
className: t("flex flex-col gap-3 bg-layer-raised",
|
|
34
|
-
style:
|
|
35
|
-
children: [
|
|
38
|
+
className: t("flex flex-col gap-3 bg-layer-raised", g, o.panel),
|
|
39
|
+
style: C,
|
|
40
|
+
children: [m && /* @__PURE__ */ i("div", {
|
|
36
41
|
className: "flex h-16 shrink-0 items-center px-4",
|
|
37
42
|
children: /* @__PURE__ */ i("span", {
|
|
38
|
-
id:
|
|
39
|
-
className: t(
|
|
40
|
-
children:
|
|
43
|
+
id: _,
|
|
44
|
+
className: t(s.sectionLabel, y),
|
|
45
|
+
children: m
|
|
41
46
|
})
|
|
42
47
|
}), /* @__PURE__ */ i("div", {
|
|
43
48
|
role: "tablist",
|
|
44
49
|
"aria-orientation": "vertical",
|
|
45
|
-
"aria-labelledby":
|
|
50
|
+
"aria-labelledby": m ? _ : void 0,
|
|
46
51
|
onKeyDown: (e) => {
|
|
47
52
|
switch (e.key) {
|
|
48
53
|
case "ArrowDown":
|
|
49
|
-
e.preventDefault(),
|
|
54
|
+
e.preventDefault(), T(c(d, w, 1));
|
|
50
55
|
break;
|
|
51
56
|
case "ArrowUp":
|
|
52
|
-
e.preventDefault(),
|
|
57
|
+
e.preventDefault(), T(c(d, w, -1));
|
|
53
58
|
break;
|
|
54
59
|
case "Home":
|
|
55
|
-
e.preventDefault(),
|
|
60
|
+
e.preventDefault(), T(l(d));
|
|
56
61
|
break;
|
|
57
62
|
case "End":
|
|
58
|
-
e.preventDefault(),
|
|
63
|
+
e.preventDefault(), T(u(d));
|
|
59
64
|
break;
|
|
60
65
|
default: break;
|
|
61
66
|
}
|
|
62
67
|
},
|
|
63
68
|
tabIndex: -1,
|
|
64
|
-
className: "flex flex-col px-2",
|
|
65
|
-
children:
|
|
66
|
-
let n = e.id ===
|
|
69
|
+
className: t("flex flex-col gap-1 px-2", o.tabList),
|
|
70
|
+
children: d.map((e) => {
|
|
71
|
+
let n = e.id === f, r = n && d.length > 1;
|
|
67
72
|
return /* @__PURE__ */ a("button", {
|
|
68
73
|
ref: (t) => {
|
|
69
|
-
t ?
|
|
74
|
+
t ? v.current.set(e.id, t) : v.current.delete(e.id);
|
|
70
75
|
},
|
|
71
76
|
type: "button",
|
|
72
77
|
role: "tab",
|
|
@@ -75,11 +80,11 @@ var o = {
|
|
|
75
80
|
disabled: e.disabled,
|
|
76
81
|
tabIndex: n ? 0 : -1,
|
|
77
82
|
onClick: () => {
|
|
78
|
-
!e.disabled && !n &&
|
|
83
|
+
!e.disabled && !n && p(e.id);
|
|
79
84
|
},
|
|
80
|
-
className: t("flex h-11 w-full items-center gap-2 rounded-lg px-3 text-start desktop:h-10", "focus-visible:outline focus-visible:-outline-offset-1",
|
|
85
|
+
className: t("flex h-11 w-full items-center gap-2 rounded-lg px-3 text-start desktop:h-10", "focus-visible:outline focus-visible:-outline-offset-1", s.row, r && s.rowActive, o.tab),
|
|
81
86
|
children: [e.icon, /* @__PURE__ */ i("span", {
|
|
82
|
-
className: t(r ?
|
|
87
|
+
className: t(r ? x : b, !r && "text-primary"),
|
|
83
88
|
children: e.label
|
|
84
89
|
})]
|
|
85
90
|
}, e.id);
|
|
@@ -88,4 +93,4 @@ var o = {
|
|
|
88
93
|
});
|
|
89
94
|
};
|
|
90
95
|
//#endregion
|
|
91
|
-
export {
|
|
96
|
+
export { o as SETTINGS_PANEL_CLASS, d as SettingsPanel };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-settings-panel",
|
|
3
3
|
"description": "Presentational vertical settings navigation panel with icon-labeled rows and active-row highlighting",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.50",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
21
|
-
"@epam/ai-dial-ui-kit": "^0.
|
|
20
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.50",
|
|
21
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.7",
|
|
22
22
|
"react": "^19.2.8"
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|