aristid-ds 15.1.0 → 15.2.0-26e842e
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/CHANGELOG.md +38 -0
- package/README.md +14 -0
- package/dist/Kit/App/index.js +46 -52
- package/dist/Kit/DataDisplay/Comment/index.js +1 -1
- package/dist/Kit/DataDisplay/IdCard/index.js +25 -24
- package/dist/Kit/DataDisplay/Table/index.js +1 -1
- package/dist/Kit/DataDisplay/Tabs/index.js +64 -61
- package/dist/Kit/DataEntry/DatePicker/index.js +19 -19
- package/dist/Kit/DataEntry/Input/index.js +15 -15
- package/dist/Kit/DataEntry/Select/index.js +104 -94
- package/dist/Kit/DataEntry/Select/renders.d.ts +1 -1
- package/dist/Kit/DataEntry/TreeSelect/index.js +1 -1
- package/dist/Kit/DataEntry/Upload/index.js +1 -1
- package/dist/Kit/Feedback/Modal/ModalContent.d.ts +4 -0
- package/dist/Kit/Feedback/Modal/ModalFooter.d.ts +3 -0
- package/dist/Kit/Feedback/Modal/ModalHeader.d.ts +4 -0
- package/dist/Kit/Feedback/Modal/index.d.ts +5 -0
- package/dist/Kit/Feedback/Modal/index.js +107 -95
- package/dist/Kit/Feedback/Modal/types.d.ts +13 -0
- package/dist/Kit/Feedback/Progress/index.js +7 -7
- package/dist/Kit/Feedback/Skeleton/index.js +1 -1
- package/dist/Kit/General/Button/index.js +1 -1
- package/dist/Kit/Navigation/Header/index.js +1 -1
- package/dist/Kit/Navigation/SideMenu/index.js +60 -52
- package/dist/Kit/Navigation/SideMenu/types.d.ts +4 -3
- package/dist/Kit/index.js +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/assets/index45.css +1 -1
- package/dist/assets/index46.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/assets/index48.css +1 -1
- package/dist/assets/index49.css +1 -1
- package/dist/assets/styles2.css +1 -1
- package/dist/chunks/{Thread.DHhk0Z5U.js → Thread.DfvaoSxN.js} +9 -9
- package/dist/chunks/index.CKC2Gl0d.js +23 -0
- package/dist/chunks/{styles.module.wk7xi4kS.js → styles.module.BXy_AJ3y.js} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/translation/pt-PT/components/DataDisplay/Collapse/index.d.ts +2 -0
- package/dist/translation/pt-PT/components/DataDisplay/Collapse/index.js +7 -0
- package/dist/translation/pt-PT/components/DataDisplay/Empty/index.d.ts +2 -0
- package/dist/translation/pt-PT/components/DataDisplay/Empty/index.js +6 -0
- package/dist/translation/pt-PT/components/DataDisplay/Error/index.d.ts +2 -0
- package/dist/translation/pt-PT/components/DataDisplay/Error/index.js +6 -0
- package/dist/translation/pt-PT/components/DataDisplay/Image/index.d.ts +2 -0
- package/dist/translation/pt-PT/components/DataDisplay/Image/index.js +6 -0
- package/dist/translation/pt-PT/components/DataDisplay/ItemList/index.d.ts +2 -0
- package/dist/translation/pt-PT/components/DataDisplay/ItemList/index.js +8 -0
- package/dist/translation/pt-PT/components/DataDisplay/Tabs/index.d.ts +2 -0
- package/dist/translation/pt-PT/components/DataDisplay/Tabs/index.js +6 -0
- package/dist/translation/pt-PT/components/DataEntry/ColorPicker/index.d.ts +2 -0
- package/dist/translation/pt-PT/components/DataEntry/ColorPicker/index.js +6 -0
- package/dist/translation/pt-PT/components/DataEntry/RichText/index.d.ts +2 -0
- package/dist/translation/pt-PT/components/DataEntry/RichText/index.js +31 -0
- package/dist/translation/pt-PT/components/DataEntry/Upload/index.d.ts +2 -0
- package/dist/translation/pt-PT/components/DataEntry/Upload/index.js +11 -0
- package/dist/translation/pt-PT/components/Feedback/Alert/index.d.ts +2 -0
- package/dist/translation/pt-PT/components/Feedback/Alert/index.js +6 -0
- package/dist/translation/pt-PT/components/General/Button/index.d.ts +2 -0
- package/dist/translation/pt-PT/components/General/Button/index.js +7 -0
- package/dist/translation/pt-PT/general/index.d.ts +2 -0
- package/dist/translation/pt-PT/general/index.js +13 -0
- package/dist/translation/pt-PT/index.d.ts +2 -0
- package/dist/translation/pt-PT/index.js +28 -0
- package/dist/translation/types/index.d.ts +1 -1
- package/dist/translation/utils/index.js +2 -13
- package/dist/translation/utils/localesByLang.d.ts +11 -0
- package/package.json +154 -154
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [X.Y.Z](https://www.npmjs.com/package/aristid-ds/v/X.Y.Z) (2026-MM-DD)
|
|
4
|
+
|
|
5
|
+
### ✨ Features
|
|
6
|
+
|
|
7
|
+
- **Modal:**
|
|
8
|
+
- Add `useChildrenOnly` property to display the modal panel as a container for other components or not. Also export two new components `KitModalHeader` and `KitModalContent` for layout purpose (@renaudamsellem)
|
|
9
|
+
- Add `shouldCloseOnOverlayClick` property close the modal on click outside. (@renaudamsellem)
|
|
10
|
+
- Add `showFooterButtons` prop to display / hide the footer buttons in confirm modal (@renaudamsellem)
|
|
11
|
+
- **⚠️ Breaking change - SideMenu:**
|
|
12
|
+
- Rename `autoCompleteOptions` prop to `searchOptions` and update its type to `IKitInput` as `AutoComplete` component has been replaced by `SearchInput` component (@philippechevieux)
|
|
13
|
+
- Add `tooltip` prop to SideMenuItem component (@philippechevieux)
|
|
14
|
+
- Add `group` type to SideMenuItem component (@philippechevieux)
|
|
15
|
+
- Add padding bottom to group items (@philippechevieux)
|
|
16
|
+
|
|
17
|
+
### 🐛 Bug Fixes
|
|
18
|
+
|
|
19
|
+
- **IdCard:**
|
|
20
|
+
- Fix avatar color from `avatarProps` being overwritten when `color` prop is not set on IdCard (@philippechevieux)
|
|
21
|
+
- **SideMenu:**
|
|
22
|
+
- Fix scrolling so that only the menu items list scrolls while keeping the header fixed (@philippechevieux)
|
|
23
|
+
- **Select:**
|
|
24
|
+
- Fix search feature (@evoiron)
|
|
25
|
+
- Fix wrong height for select/TreeSelect with multiple attribute (@alechapelain)
|
|
26
|
+
- Fix wrong tag size not matching select size (@alechapelain)
|
|
27
|
+
|
|
28
|
+
## [15.2.0](https://www.npmjs.com/package/aristid-ds/v/15.2.0) (2026-0226)
|
|
29
|
+
|
|
30
|
+
### ✨ Features
|
|
31
|
+
|
|
32
|
+
- **Locales:**
|
|
33
|
+
- Add `portuguese` locale (@evoiron)
|
|
34
|
+
- Update locale context to simplify the process of adding a locale (@evoiron)
|
|
35
|
+
|
|
36
|
+
### 🐛 Bug Fixes
|
|
37
|
+
|
|
38
|
+
- **Tabs:**
|
|
39
|
+
- Fix alignment issue causing Pill Tabs not to be centered within their parent element (@YanDevDz)
|
|
40
|
+
|
|
3
41
|
## [15.1.0](https://www.npmjs.com/package/aristid-ds/v/15.1.0) (2026-02-24)
|
|
4
42
|
|
|
5
43
|
### ✨ Features
|
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ ARiSTiD Design System Readme.
|
|
|
22
22
|
- [Component code](#component-code)
|
|
23
23
|
- [Component theming](#component-theming)
|
|
24
24
|
- [Component documentation](#component-documentation)
|
|
25
|
+
- [Adding a locale](#add-a-locale)
|
|
25
26
|
- [Nightly build](#nightly-build)
|
|
26
27
|
- [Important](#important)
|
|
27
28
|
- [Contributing](#contributing)
|
|
@@ -456,6 +457,19 @@ Every components **style** of the design system can be **override** by tokens.
|
|
|
456
457
|
|
|
457
458
|
After the script run, section `Design Tokens` documentation is up to date with all design tokens.
|
|
458
459
|
|
|
460
|
+
#### Add a new locale
|
|
461
|
+
|
|
462
|
+
1. **create a new directory for the new locale in `src/translation`**
|
|
463
|
+
|
|
464
|
+
You can duplicate src/translations/enUS and name it according to the locale code you're adding (ptPT for ortuguese, enUS for english, etc.). Then update your tranlsations in each fileinside his new directory.
|
|
465
|
+
|
|
466
|
+
2. **Add the locale code to the list of known languages**
|
|
467
|
+
|
|
468
|
+
- Edit the file `src/translation/utils/localesByLang.ts`, and your locale datas. import the translations from `antd` and the translations from the directory you created in previous step. Then Update `localesByLang` and `antdLocalesByLang` objects . Be careful of the naming, it must match the locale. Refer to the existing locales in this file.
|
|
469
|
+
- Edit `src/translation/types/index.d.ts`, and add your locale code to `LanguageSupported``
|
|
470
|
+
|
|
471
|
+
That's it. The locale is now available. It is also available in th locale selector in storybook.
|
|
472
|
+
|
|
459
473
|
## Nightly build
|
|
460
474
|
|
|
461
475
|
A nightly version of the package is published on daily basis on branch develop (assuming new commits have been pushed on develop branch). To use it just install the more recent next version :
|
package/dist/Kit/App/index.js
CHANGED
|
@@ -1,66 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { ConfigProvider as
|
|
4
|
-
import { K as
|
|
5
|
-
import { toCssVariables as
|
|
6
|
-
import
|
|
7
|
-
import { Style as
|
|
8
|
-
import { K as
|
|
9
|
-
import { KitAristidThemeGeneral as
|
|
10
|
-
import { antdThemeConfig as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
import '../../assets/index28.css';const A = "aristid-ds-global", F = (t, e) => {
|
|
17
|
-
const o = g(t);
|
|
1
|
+
import { jsx as a, jsxs as g, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { useState as K, useLayoutEffect as S, useRef as b, useEffect as y } from "react";
|
|
3
|
+
import { ConfigProvider as C } from "antd";
|
|
4
|
+
import { K as P } from "../../chunks/SnackBarProvider.D44OffUd.js";
|
|
5
|
+
import { toCssVariables as L, uuid as T } from "../../utils/functions/index.js";
|
|
6
|
+
import p from "lodash/merge";
|
|
7
|
+
import { Style as u } from "react-style-tag";
|
|
8
|
+
import { K as $ } from "../../chunks/useKitTheme.BdeSOGoj.js";
|
|
9
|
+
import { KitAristidThemeGeneral as c } from "../../theme/aristid/general/index.js";
|
|
10
|
+
import { antdThemeConfig as j } from "../../theme/utils/tokens-mapper/index.js";
|
|
11
|
+
import { K as k, u as E } from "../../chunks/useKitLocale.C5F-tmnC.js";
|
|
12
|
+
import { l as m, f, m as x } from "../../chunks/index.CKC2Gl0d.js";
|
|
13
|
+
import { KitEmpty as v } from "../DataDisplay/Empty/index.js";
|
|
14
|
+
import '../../assets/index28.css';const A = "aristid-ds-global", I = (o, e) => {
|
|
15
|
+
const r = L(o);
|
|
18
16
|
return `
|
|
19
17
|
.${e} {
|
|
20
|
-
${Object.keys(
|
|
18
|
+
${Object.keys(r).map((t) => `${t}: ${r[t]}`).join(";")}
|
|
21
19
|
}
|
|
22
20
|
`;
|
|
23
|
-
},
|
|
24
|
-
const [
|
|
25
|
-
return
|
|
26
|
-
const
|
|
27
|
-
i(
|
|
28
|
-
}, []),
|
|
21
|
+
}, _ = ({ children: o, customTheme: e, id: r }) => {
|
|
22
|
+
const [t, i] = K(null), { theme: n, appId: s, spacing: d } = B(r, e);
|
|
23
|
+
return S(() => {
|
|
24
|
+
const l = L(c, "--general");
|
|
25
|
+
i(l);
|
|
26
|
+
}, []), a($.Provider, { value: { theme: n, appId: s, spacing: d }, children: t !== null && g(h, { children: [a(u, { id: A, hasSourceMap: !1, children: `
|
|
29
27
|
:root {
|
|
30
|
-
${Object.keys(
|
|
28
|
+
${Object.keys(t).map((l) => `${l}: ${t[l]}`).join(";")}
|
|
31
29
|
}
|
|
32
|
-
` }), e &&
|
|
33
|
-
},
|
|
34
|
-
var
|
|
35
|
-
const
|
|
30
|
+
` }), e && a(u, { hasSourceMap: !1, children: I(p({ general: { utilities: c.utilities } }, e), s) }), o] }) });
|
|
31
|
+
}, B = (o, e) => {
|
|
32
|
+
var r;
|
|
33
|
+
const t = b(o || "ds-" + T().substring(0, 8)), i = p(c.spacing, (r = e?.general) === null || r === void 0 ? void 0 : r.spacing);
|
|
36
34
|
return {
|
|
37
|
-
theme:
|
|
38
|
-
appId:
|
|
35
|
+
theme: c,
|
|
36
|
+
appId: t.current,
|
|
39
37
|
spacing: i
|
|
40
38
|
};
|
|
41
|
-
},
|
|
42
|
-
const e =
|
|
43
|
-
return
|
|
44
|
-
},
|
|
45
|
-
const [
|
|
46
|
-
return { locale:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} else {
|
|
51
|
-
const i = a($, r);
|
|
52
|
-
e(i);
|
|
53
|
-
}
|
|
39
|
+
}, D = ({ children: o }) => {
|
|
40
|
+
const e = F();
|
|
41
|
+
return a(k.Provider, { value: e, children: o });
|
|
42
|
+
}, F = () => {
|
|
43
|
+
const [o, e] = K(m.frFR);
|
|
44
|
+
return { locale: o, setKitLocale: (t) => {
|
|
45
|
+
var i, n;
|
|
46
|
+
const s = (n = m[(i = t.locale) !== null && i !== void 0 ? i : f]) !== null && n !== void 0 ? n : m[f], d = p(s, t);
|
|
47
|
+
e(d);
|
|
54
48
|
} };
|
|
55
|
-
},
|
|
56
|
-
const { locale:
|
|
57
|
-
return
|
|
58
|
-
e !== void 0 &&
|
|
59
|
-
}, [e,
|
|
49
|
+
}, X = ({ children: o, locale: e, customTheme: r, id: t }) => a(_, { customTheme: r, id: t, children: a(D, { children: a(M, { locale: e, children: o }) }) }), M = ({ children: o, locale: e }) => {
|
|
50
|
+
const { locale: r, setKitLocale: t } = E();
|
|
51
|
+
return y(() => {
|
|
52
|
+
e !== void 0 && t(e);
|
|
53
|
+
}, [e, t]), g(C, { theme: j, locale: x(e), renderEmpty: () => {
|
|
60
54
|
var i;
|
|
61
|
-
return
|
|
62
|
-
}, children: [
|
|
55
|
+
return a(v, { className: "default-render", image: v.ASSET_LIST, description: (i = r.Empty) === null || i === void 0 ? void 0 : i.noData });
|
|
56
|
+
}, children: [a(P, {}), o] });
|
|
63
57
|
};
|
|
64
58
|
export {
|
|
65
|
-
|
|
59
|
+
X as KitApp
|
|
66
60
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { t as
|
|
4
|
-
import { u as
|
|
5
|
-
import { K as
|
|
6
|
-
import { KitTooltip as
|
|
7
|
-
import { T as
|
|
8
|
-
import '../../../assets/index2.css';const
|
|
1
|
+
import { jsxs as h, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import p from "classnames";
|
|
3
|
+
import { t as z } from "../../../chunks/styles.module.BiErj37W.js";
|
|
4
|
+
import { u as N } from "../../../chunks/useKitTheme.BdeSOGoj.js";
|
|
5
|
+
import { K as _ } from "../../../chunks/Avatar.B2Q0k3WU.js";
|
|
6
|
+
import { KitTooltip as u } from "../Tooltip/index.js";
|
|
7
|
+
import { T as g } from "../../../chunks/constants.CctH0M4n.js";
|
|
8
|
+
import '../../../assets/index2.css';const E = {
|
|
9
9
|
"kit-id-card": "_kit-id-card_1m63u_2"
|
|
10
|
-
},
|
|
11
|
-
|
|
10
|
+
}, f = [
|
|
11
|
+
z["kit-typography-text"],
|
|
12
12
|
"ant-typography",
|
|
13
13
|
"ant-typography-text",
|
|
14
14
|
"ant-typography-ellipsis",
|
|
15
15
|
"ant-typography-ellipsis-single-line"
|
|
16
|
-
],
|
|
16
|
+
], K = (t) => {
|
|
17
17
|
switch (t) {
|
|
18
18
|
case "xl":
|
|
19
19
|
return "kit-typography-fontSize5";
|
|
@@ -22,7 +22,7 @@ import '../../../assets/index2.css';const _ = {
|
|
|
22
22
|
default:
|
|
23
23
|
return "kit-typography-fontSize7";
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, C = (t) => {
|
|
26
26
|
switch (t) {
|
|
27
27
|
case "xl":
|
|
28
28
|
return "kit-typography-fontSize1";
|
|
@@ -37,7 +37,7 @@ import '../../../assets/index2.css';const _ = {
|
|
|
37
37
|
case "xxs-medium":
|
|
38
38
|
return "kit-typography-fontSize5";
|
|
39
39
|
}
|
|
40
|
-
},
|
|
40
|
+
}, I = (t) => {
|
|
41
41
|
switch (t) {
|
|
42
42
|
case "xl":
|
|
43
43
|
case "l":
|
|
@@ -50,22 +50,23 @@ import '../../../assets/index2.css';const _ = {
|
|
|
50
50
|
default:
|
|
51
51
|
return "m";
|
|
52
52
|
}
|
|
53
|
-
},
|
|
54
|
-
const
|
|
53
|
+
}, A = (t, e, r, s) => {
|
|
54
|
+
const o = p("kit-id-card-title", ...f, C(e), {
|
|
55
55
|
"ant-typography-bold": e !== "xs-medium",
|
|
56
56
|
"ant-typography-disabled": r
|
|
57
57
|
});
|
|
58
|
-
return
|
|
59
|
-
},
|
|
60
|
-
const
|
|
58
|
+
return i("span", { className: o, children: i(u, { title: s ? "" : t, mouseEnterDelay: g, children: i("span", { children: t }) }) });
|
|
59
|
+
}, b = (t, e, r, s) => {
|
|
60
|
+
const o = p("kit-id-card-description", ...f, "ant-typography-regular", K(e), {
|
|
61
61
|
"ant-typography-disabled": r
|
|
62
62
|
});
|
|
63
|
-
return
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
return i("span", { className: o, children: i(u, { title: s ? "" : t, mouseEnterDelay: g, children: i("span", { children: t }) }) });
|
|
64
|
+
}, w = ({ className: t, title: e, description: r, avatarProps: s, avatar: o, color: a, size: n = "xs-bold", disabled: l = !1, disableTooltip: d = !1, ...x }) => {
|
|
65
|
+
var c;
|
|
66
|
+
const { appId: k } = N(), S = p(k, E["kit-id-card"], t), v = s !== void 0 || o !== void 0, y = e !== void 0, D = a !== void 0, m = r !== void 0, T = y || m;
|
|
67
|
+
return h("div", { className: `${S} id-card-grid`, ...x, children: [D && i("div", { className: "card-color", style: { backgroundColor: a } }), v && i("div", { className: "card-avatar", children: o ?? i(_, { size: I(n), ...s, color: (c = s?.color) !== null && c !== void 0 ? c : a, disabled: l }) }), T && h("div", { className: "card-info", children: [y && typeof e == "string" ? A(e, n, l, d) : e, m && typeof r == "string" ? b(r, n, l, d) : r] })] });
|
|
67
68
|
};
|
|
68
|
-
|
|
69
|
+
w.displayName = "KitIdCard";
|
|
69
70
|
export {
|
|
70
|
-
|
|
71
|
+
w as KitIdCard
|
|
71
72
|
};
|
|
@@ -8,7 +8,7 @@ import { KitIcon as R } from "../../General/Icon/index.js";
|
|
|
8
8
|
import { FontAwesomeIcon as g } from "@fortawesome/react-fontawesome";
|
|
9
9
|
import { faUpDown as W, faArrowDown as $, faArrowUp as E, faGripLines as M, faCaretDown as G, faCaretRight as X } from "@fortawesome/free-solid-svg-icons";
|
|
10
10
|
import { KitButton as T } from "../../General/Button/index.js";
|
|
11
|
-
import '../../../assets/
|
|
11
|
+
import '../../../assets/index44.css';const p = {
|
|
12
12
|
"kit-table": "_kit-table_1gybl_22",
|
|
13
13
|
"expand-button": "_expand-button_1gybl_816"
|
|
14
14
|
}, I = (l) => {
|
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as F, useState as
|
|
3
|
-
import { u as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as _, Fragment as A, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as F, useState as R, useLayoutEffect as G } from "react";
|
|
3
|
+
import { u as H } from "../../../chunks/useKitTheme.BdeSOGoj.js";
|
|
4
|
+
import O from "classnames";
|
|
5
5
|
import { KitButton as B } from "../../General/Button/index.js";
|
|
6
6
|
import { FontAwesomeIcon as D } from "@fortawesome/react-fontawesome";
|
|
7
|
-
import { faPlus as
|
|
8
|
-
import { F as
|
|
9
|
-
import { KitDropDown as
|
|
10
|
-
import { u as
|
|
11
|
-
import { KitTypography as
|
|
12
|
-
import { KitBadge as
|
|
13
|
-
import '../../../assets/index30.css';const
|
|
14
|
-
"kit-tabs": "_kit-
|
|
7
|
+
import { faPlus as J, faEllipsisVertical as M } from "@fortawesome/free-solid-svg-icons";
|
|
8
|
+
import { F as Q } from "../../../chunks/constants.CctH0M4n.js";
|
|
9
|
+
import { KitDropDown as Y } from "../../Navigation/DropDown/index.js";
|
|
10
|
+
import { u as Z } from "../../../chunks/useKitLocale.C5F-tmnC.js";
|
|
11
|
+
import { KitTypography as tt } from "../../General/Typography/index.js";
|
|
12
|
+
import { KitBadge as et } from "../Badge/index.js";
|
|
13
|
+
import '../../../assets/index30.css';const I = {
|
|
14
|
+
"kit-tabs-wrapper": "_kit-tabs-wrapper_htrca_2",
|
|
15
|
+
"kit-tabs": "_kit-tabs_htrca_2"
|
|
15
16
|
};
|
|
16
|
-
function
|
|
17
|
-
const o = F(null), s = F({}), u = F(null),
|
|
18
|
-
return
|
|
17
|
+
function ot({ items: e, addTab: n, disableOverflow: i }) {
|
|
18
|
+
const o = F(null), s = F({}), u = F(null), a = 16, v = 40, r = n ? 56 : 0, [d, w] = R([]), [h, f] = R(!1);
|
|
19
|
+
return G(() => {
|
|
19
20
|
const p = () => {
|
|
20
21
|
if (i) {
|
|
21
22
|
f(!0);
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
25
|
+
const k = o.current;
|
|
26
|
+
if (!k)
|
|
26
27
|
return;
|
|
27
|
-
const m =
|
|
28
|
-
let
|
|
29
|
-
const
|
|
30
|
-
for (let
|
|
31
|
-
const K =
|
|
32
|
-
if (!
|
|
28
|
+
const m = nt(k);
|
|
29
|
+
let y = r;
|
|
30
|
+
const g = [];
|
|
31
|
+
for (let c = 0; c < e.length; c++) {
|
|
32
|
+
const K = e[c], T = s.current[K.key];
|
|
33
|
+
if (!T)
|
|
33
34
|
return;
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
y += T.offsetWidth + a;
|
|
36
|
+
const C = c === e.length - 1 ? 0 : v;
|
|
37
|
+
y > m - C + a && g.push(K.key);
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
w((c) => c.join() === g.join() ? c : g), f(!0);
|
|
39
40
|
};
|
|
40
41
|
let S;
|
|
41
42
|
const x = () => {
|
|
@@ -44,16 +45,16 @@ function te({ items: t, addTab: n, disableOverflow: i }) {
|
|
|
44
45
|
return p(), window.addEventListener("resize", x), () => {
|
|
45
46
|
window.removeEventListener("resize", x);
|
|
46
47
|
};
|
|
47
|
-
}, [
|
|
48
|
+
}, [e, r, o, u, i]), {
|
|
48
49
|
containerRef: o,
|
|
49
50
|
tabRefs: s,
|
|
50
51
|
overflowedKeys: d,
|
|
51
|
-
overflowedItems:
|
|
52
|
-
overflowCalculated:
|
|
52
|
+
overflowedItems: e.filter((p) => d.includes(p.key)),
|
|
53
|
+
overflowCalculated: h
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
let n =
|
|
56
|
+
function nt(e) {
|
|
57
|
+
let n = e.parentElement;
|
|
57
58
|
for (; n; ) {
|
|
58
59
|
const i = window.getComputedStyle(n), o = i.width;
|
|
59
60
|
if (o !== "auto" && o !== "fit-content" && o !== "min-content" && o !== "max-content" && n.clientWidth > 0)
|
|
@@ -65,9 +66,9 @@ function oe(t) {
|
|
|
65
66
|
}
|
|
66
67
|
return window.innerWidth;
|
|
67
68
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
70
|
-
switch (
|
|
69
|
+
const j = ({ icon: e, label: n, size: i, badgeCount: o, badgeOverflowCount: s }) => _(A, { children: [e && l("div", { className: "kit-tab-icon", children: e }), _("div", { className: "kit-tab-label-wrapper", children: [l(tt.Text, { className: "kit-tab-label", size: it(i), children: n }), !!o && l(et, { className: "kit-tab-count", count: o, overflowCount: s })] })] });
|
|
70
|
+
function it(e) {
|
|
71
|
+
switch (e) {
|
|
71
72
|
case "xsmall":
|
|
72
73
|
return "fontSize7";
|
|
73
74
|
case "small":
|
|
@@ -78,38 +79,40 @@ function ne(t) {
|
|
|
78
79
|
return "fontSize4";
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
|
-
const
|
|
82
|
-
var
|
|
83
|
-
const { appId: p } =
|
|
82
|
+
const lt = ({ addTab: e, centered: n, className: i, activeKey: o, defaultKey: s, items: u, onChange: a, fullwidthTab: v, size: r = "small", variant: d = "classic" }) => {
|
|
83
|
+
var w, h, f;
|
|
84
|
+
const { appId: p } = H(), { locale: S } = Z(), [x, k] = R(s ?? ((w = u[0]) === null || w === void 0 ? void 0 : w.key)), m = o ?? x, y = (h = u.find((t) => t.key === m)) === null || h === void 0 ? void 0 : h.tabContent, g = O(p, i, I["kit-tabs"], r ?? "medium", d, v ? "fullwidth" : "", y && d === "pill" ? "tabs-bottom-spacing" : ""), c = O(I["kit-tabs-wrapper"], {
|
|
85
|
+
centered: n
|
|
86
|
+
}), { containerRef: K, tabRefs: T, overflowedKeys: C, overflowedItems: z, overflowCalculated: U } = ot({
|
|
84
87
|
items: u,
|
|
85
|
-
addTab: !!
|
|
86
|
-
disableOverflow: !!
|
|
87
|
-
}), L = (
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
88
|
+
addTab: !!e,
|
|
89
|
+
disableOverflow: !!v
|
|
90
|
+
}), L = (t) => {
|
|
91
|
+
k(t), a?.(t);
|
|
92
|
+
}, P = (t, N) => {
|
|
93
|
+
t.code === "Enter" && (k(N), a?.(N));
|
|
91
94
|
};
|
|
92
|
-
return
|
|
93
|
-
const
|
|
94
|
-
return
|
|
95
|
-
visible:
|
|
95
|
+
return _(A, { children: [l("div", { className: c, ref: K, children: _("div", { className: g, role: "tablist", children: [u.map(({ icon: t, label: N, badgeCount: V, badgeOverflowCount: X, key: b, disabled: E }) => {
|
|
96
|
+
const $ = C.includes(b), q = m === b;
|
|
97
|
+
return l("div", { ref: (W) => T.current[b] = W, className: O("kit-tab", "kit-tab-" + r, d, {
|
|
98
|
+
visible: U && !$,
|
|
96
99
|
// hide tabs until overflow is calculated to avoid layout shift
|
|
97
|
-
disabled:
|
|
98
|
-
active:
|
|
99
|
-
fullwidth:
|
|
100
|
-
}), role: "tab", tabIndex:
|
|
101
|
-
}),
|
|
102
|
-
items:
|
|
103
|
-
label:
|
|
100
|
+
disabled: E,
|
|
101
|
+
active: q,
|
|
102
|
+
fullwidth: v
|
|
103
|
+
}), role: "tab", tabIndex: Q, onClick: E ? void 0 : () => L(b), onKeyDown: E ? void 0 : (W) => P(W, b), children: l(j, { icon: t, label: N, size: r, badgeCount: V, badgeOverflowCount: X }) }, b);
|
|
104
|
+
}), e && d === "classic" && l(B, { disableSecureClick: !0, type: "tertiary", icon: l(D, { icon: J }), onClick: e, size: r === "xsmall" ? "s" : "m" }), C.length > 0 && l(Y, { menu: {
|
|
105
|
+
items: z.map((t) => ({
|
|
106
|
+
label: l("div", { className: O("kit-tab-dropdown", `kit-tab-dropdown-${r}`), children: l(j, { icon: t.icon, label: t.label, size: r, badgeCount: t.badgeCount, badgeOverflowCount: t.badgeOverflowCount }) }),
|
|
104
107
|
type: "item",
|
|
105
|
-
key:
|
|
106
|
-
disabled:
|
|
107
|
-
onClick: () => !
|
|
108
|
+
key: t.key,
|
|
109
|
+
disabled: t.disabled,
|
|
110
|
+
onClick: () => !t.disabled && L(t.key)
|
|
108
111
|
})),
|
|
109
112
|
selectedKeys: [m]
|
|
110
|
-
}, trigger: ["click"], children:
|
|
113
|
+
}, trigger: ["click"], children: l(B, { icon: l(D, { icon: M }), type: C.includes(m) ? "primary" : "tertiary", "aria-label": (f = S.Tabs) === null || f === void 0 ? void 0 : f.moreOptions, size: r === "xsmall" ? "s" : "m" }) })] }) }), y] });
|
|
111
114
|
};
|
|
112
|
-
|
|
115
|
+
lt.displayName = "KitTabs";
|
|
113
116
|
export {
|
|
114
|
-
|
|
117
|
+
lt as KitTabs
|
|
115
118
|
};
|
|
@@ -3,30 +3,30 @@ import { forwardRef as g, useRef as T } from "react";
|
|
|
3
3
|
import { DatePicker as X } from "antd";
|
|
4
4
|
import $ from "classnames";
|
|
5
5
|
import { FontAwesomeIcon as n } from "@fortawesome/react-fontawesome";
|
|
6
|
-
import { faChevronLeft as N, faChevronRight as _, faClock as
|
|
7
|
-
import { K as
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
import '../../../assets/
|
|
11
|
-
"kit-datepicker": "_kit-
|
|
12
|
-
"kit-rangepicker": "_kit-
|
|
13
|
-
},
|
|
6
|
+
import { faChevronLeft as N, faChevronRight as _, faClock as q, faCalendar as z, faCircleXmark as B, faArrowRight as V } from "@fortawesome/free-solid-svg-icons";
|
|
7
|
+
import { K as E } from "../../../chunks/InputWrapper.D7QArlvo.js";
|
|
8
|
+
import { u as H } from "../../../chunks/useKitTheme.BdeSOGoj.js";
|
|
9
|
+
import { u as J } from "../../../chunks/useGetPopupContainer.bCZKSUsz.js";
|
|
10
|
+
import '../../../assets/index45.css';const M = {
|
|
11
|
+
"kit-datepicker": "_kit-datepicker_1tqav_2",
|
|
12
|
+
"kit-rangepicker": "_kit-rangepicker_1tqav_210"
|
|
13
|
+
}, O = () => W("div", { className: "double-chevron", children: [e(n, { className: "chevron-icon double-chevron-left-icon", icon: N }), e(n, { className: "chevron-icon", icon: N })] }), Q = () => W("div", { className: "double-chevron", children: [e(n, { className: "chevron-icon", icon: _ }), e(n, { className: "chevron-icon double-chevron-right-icon", icon: _ })] }), Y = g(({ label: C, helper: R, htmlFor: m, suffixIcon: f, className: x, wrapperClassName: b, prefix: t, required: v, actions: h, extra: u, disabled: s, placeholder: K, getPopupContainer: l, picker: r = "date", size: D = "large", allowClear: I = !0, readonlyLight: o = !1, readonly: i = !1, ...a }, c) => {
|
|
14
14
|
var p, d;
|
|
15
|
-
const { appId: w } =
|
|
15
|
+
const { appId: w } = H(), k = T(null), G = (p = c) !== null && p !== void 0 ? p : k, j = J(G, l), A = $(w, M["kit-datepicker"], x, {
|
|
16
16
|
"kit-picker-readonly-light": o,
|
|
17
17
|
"kit-picker-readonly": i
|
|
18
|
-
}),
|
|
19
|
-
return e(
|
|
20
|
-
}),
|
|
18
|
+
}), U = t ?? (r === "time" ? e(n, { icon: q }) : e(n, { icon: z }));
|
|
19
|
+
return e(E, { label: C, helper: R, htmlFor: m, disabled: s, status: a.status, className: b, required: v, extra: u ?? h, children: e(X, { ...a, id: (d = a.id) !== null && d !== void 0 ? d : m, required: v, picker: r, disabled: o || i || s, variant: o ? "borderless" : void 0, ref: c ?? k, size: D, getPopupContainer: j, placeholder: !o && !i ? K : void 0, allowClear: !o && !i && I && { clearIcon: e(n, { "aria-label": "clear", icon: B }) }, prefix: U, suffixIcon: I ? void 0 : f, className: A, prevIcon: e(n, { className: "chevron-icon", icon: N }), nextIcon: e(n, { className: "chevron-icon", icon: _ }), superPrevIcon: e(O, {}), superNextIcon: e(Q, {}) }) });
|
|
20
|
+
}), Z = g(({ label: C, className: R, helper: m, htmlFor: f, suffixIcon: x, picker: b, prefix: t, allowClear: v = !0, required: h, actions: u, extra: s, placeholder: K, readonlyLight: l = !1, readonly: r = !1, getPopupContainer: D, size: I = "large", ...o }, i) => {
|
|
21
21
|
var a, c;
|
|
22
|
-
const { appId: p } =
|
|
22
|
+
const { appId: p } = H(), d = T(null), w = (a = i) !== null && a !== void 0 ? a : d, k = J(w, D), G = () => o.disabled === void 0 ? !1 : typeof o.disabled == "boolean" ? o.disabled : o.disabled[0] && o.disabled[1], j = $(p, M["kit-rangepicker"], R, {
|
|
23
23
|
"kit-picker-readonly-light": l,
|
|
24
24
|
"kit-picker-readonly": r
|
|
25
|
-
}), A = t ?? (b === "time" ? e(n, { icon:
|
|
26
|
-
return e(
|
|
27
|
-
}),
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
}), A = t ?? (b === "time" ? e(n, { icon: q }) : e(n, { icon: z }));
|
|
26
|
+
return e(E, { label: C, helper: m, htmlFor: f, disabled: G(), status: o.status, required: h, extra: s ?? u, children: e(X.RangePicker, { ...o, id: (c = o.id) !== null && c !== void 0 ? c : f, picker: b, ref: i ?? d, getPopupContainer: k, required: h, size: I, disabled: l || r || o.disabled, variant: l ? "borderless" : void 0, placeholder: !l && !r ? K : void 0, suffixIcon: v ? void 0 : x, allowClear: v && { clearIcon: e(n, { "aria-label": "clear", icon: B }) }, className: j, prefix: A, separator: e(n, { icon: V }), prevIcon: e(n, { className: "chevron-icon", icon: N }), nextIcon: e(n, { className: "chevron-icon", icon: _ }), superPrevIcon: e(O, {}), superNextIcon: e(Q, {}) }) });
|
|
27
|
+
}), S = Y;
|
|
28
|
+
S.displayName = "KitDatePicker";
|
|
29
|
+
S.RangePicker = Z;
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
S as KitDatePicker
|
|
32
32
|
};
|
|
@@ -8,27 +8,27 @@ import { u as b } from "../../../chunks/useKitTheme.BdeSOGoj.js";
|
|
|
8
8
|
import g from "classnames";
|
|
9
9
|
import { KitTypography as S } from "../../General/Typography/index.js";
|
|
10
10
|
import '../../../assets/index39.css';const z = {
|
|
11
|
-
"kit-input": "_kit-
|
|
12
|
-
"kit-password": "_kit-
|
|
13
|
-
"kit-textarea": "_kit-
|
|
14
|
-
}, W = h(({ label: u, className: m, helper:
|
|
15
|
-
var
|
|
11
|
+
"kit-input": "_kit-input_10dra_2",
|
|
12
|
+
"kit-password": "_kit-password_10dra_206",
|
|
13
|
+
"kit-textarea": "_kit-textarea_10dra_353"
|
|
14
|
+
}, W = h(({ label: u, className: m, helper: f, htmlFor: o, wrapperClassName: s, allowClear: p = !0, required: c, actions: d, extra: i, disabled: r, placeholder: v, readonly: e = !1, readonlyLight: n = !1, size: k = "large", ...a }, I) => {
|
|
15
|
+
var l;
|
|
16
16
|
const { appId: _ } = b(), w = g(_, z["kit-input"], m, {
|
|
17
|
-
"kit-input-readonly":
|
|
17
|
+
"kit-input-readonly": e
|
|
18
18
|
});
|
|
19
|
-
return t(T, { label: u, helper:
|
|
20
|
-
}), X = h(({ label: u, className: m, helper:
|
|
21
|
-
var
|
|
19
|
+
return t(T, { label: u, helper: f, htmlFor: o, disabled: r, status: a.status, className: s, required: c, extra: i ?? d, children: n ? t(S.Text, { weight: "bold", size: "fontSize5", color: a.status === "error" ? "error" : void 0, children: a.value }) : t(x, { ...a, ref: I, id: (l = a.id) !== null && l !== void 0 ? l : o, className: w, disabled: r || e, required: c, size: k, placeholder: !e && !n ? v : void 0, allowClear: p ? { clearIcon: t(K, { "aria-label": "clear", icon: N }) } : void 0 }) });
|
|
20
|
+
}), X = h(({ label: u, className: m, helper: f, htmlFor: o, wrapperClassName: s, allowClear: p = !0, required: c, actions: d, extra: i, disabled: r, placeholder: v, readonly: e = !1, readonlyLight: n = !1, size: k = "large", ...a }, I) => {
|
|
21
|
+
var l;
|
|
22
22
|
const { appId: _ } = b(), w = g(_, z["kit-textarea"], m, {
|
|
23
|
-
"kit-textarea-readonly":
|
|
23
|
+
"kit-textarea-readonly": e
|
|
24
24
|
});
|
|
25
|
-
return t(T, { label: u, helper:
|
|
26
|
-
}), $ = h(({ label: u, className: m, helper:
|
|
27
|
-
var
|
|
25
|
+
return t(T, { label: u, helper: f, htmlFor: o, disabled: r, status: a.status, className: s, required: c, extra: i ?? d, children: n ? t(S.Text, { weight: "bold", size: "fontSize5", color: a.status === "error" ? "error" : void 0, children: a.value }) : t(x.TextArea, { ...a, ref: I, id: (l = a.id) !== null && l !== void 0 ? l : o, className: w, disabled: r || e, required: c, size: k, placeholder: !e && !n ? v : void 0, allowClear: p ? { clearIcon: t(K, { "aria-label": "clear", icon: N }) } : void 0 }) });
|
|
26
|
+
}), $ = h(({ label: u, className: m, helper: f, htmlFor: o, iconRender: s, wrapperClassName: p, allowClear: c = !0, disabled: d, readonly: i = !1, required: r, actions: v, extra: e, placeholder: n, size: k = "large", ...a }, I) => {
|
|
27
|
+
var l;
|
|
28
28
|
const { appId: _ } = b(), w = g(_, z["kit-password"], m, {
|
|
29
|
-
"kit-password-readonly":
|
|
29
|
+
"kit-password-readonly": i
|
|
30
30
|
}), E = (j) => j ? t(K, { icon: y }) : t(K, { icon: R });
|
|
31
|
-
return t(T, { label: u, helper:
|
|
31
|
+
return t(T, { label: u, helper: f, htmlFor: o, disabled: d, status: a.status, className: p, required: r, extra: e ?? v, children: t(x.Password, { ...a, className: w, placeholder: i ? void 0 : n, disabled: d || i, required: r, id: (l = a.id) !== null && l !== void 0 ? l : o, ref: I, size: k, allowClear: c ? { clearIcon: t(K, { "aria-label": "clear", icon: N }) } : void 0, iconRender: s ?? E }) });
|
|
32
32
|
}), C = W;
|
|
33
33
|
C.displayName = "KitInput";
|
|
34
34
|
C.TextArea = X;
|