aristid-ds 14.0.0-d129b0e → 14.0.0-e1a6d31

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +49 -17
  2. package/dist/Kit/App/index.js +1 -1
  3. package/dist/Kit/DataDisplay/Avatar/index.js +1 -1
  4. package/dist/Kit/DataDisplay/Avatar/types.d.ts +1 -0
  5. package/dist/Kit/DataDisplay/IdCard/index.js +59 -24
  6. package/dist/Kit/DataDisplay/IdCard/types.d.ts +1 -1
  7. package/dist/Kit/DataDisplay/Tabs/index.js +36 -22
  8. package/dist/Kit/DataDisplay/Tabs/types.d.ts +1 -1
  9. package/dist/Kit/DataDisplay/Tag/index.js +20 -20
  10. package/dist/Kit/DataEntry/AutoComplete/index.js +2 -2
  11. package/dist/Kit/DataEntry/Checkbox/index.js +1 -1
  12. package/dist/Kit/DataEntry/ColorPicker/index.js +69 -65
  13. package/dist/Kit/DataEntry/ColorPicker/types.d.ts +3 -1
  14. package/dist/Kit/DataEntry/DatePicker/RangePicker.d.ts +1 -12
  15. package/dist/Kit/DataEntry/DatePicker/index.js +30 -28
  16. package/dist/Kit/DataEntry/DatePicker/types.d.ts +4 -2
  17. package/dist/Kit/DataEntry/Input/index.js +34 -30
  18. package/dist/Kit/DataEntry/Input/types.d.ts +3 -1
  19. package/dist/Kit/DataEntry/InputNumber/index.js +20 -19
  20. package/dist/Kit/DataEntry/InputNumber/types.d.ts +2 -1
  21. package/dist/Kit/DataEntry/InputWrapper/InputWrapper.d.ts +2 -2
  22. package/dist/Kit/DataEntry/InputWrapper/index.js +1 -1
  23. package/dist/Kit/DataEntry/Radio/index.js +1 -1
  24. package/dist/Kit/DataEntry/RichText/index.js +51 -50
  25. package/dist/Kit/DataEntry/RichText/types.d.ts +1 -0
  26. package/dist/Kit/DataEntry/Select/index.js +67 -66
  27. package/dist/Kit/DataEntry/Select/types.d.ts +3 -1
  28. package/dist/Kit/DataEntry/TreeSelect/index.js +3 -3
  29. package/dist/Kit/DataEntry/Upload/index.js +21 -21
  30. package/dist/Kit/Feedback/SnackBar/SnackBarProvider.d.ts +3 -1
  31. package/dist/Kit/Feedback/SnackBar/index.d.ts +4 -3
  32. package/dist/Kit/Feedback/SnackBar/index.js +20 -19
  33. package/dist/Kit/Feedback/SnackBar/snack-bar-function.d.ts +2 -2
  34. package/dist/Kit/Feedback/SnackBar/types.d.ts +4 -0
  35. package/dist/Kit/General/Button/index.js +53 -53
  36. package/dist/Kit/General/Button/types.d.ts +0 -1
  37. package/dist/Kit/Navigation/DropDown/index.js +40 -40
  38. package/dist/Kit/Navigation/Header/index.js +28 -28
  39. package/dist/Kit/Navigation/SideMenu/index.js +33 -33
  40. package/dist/Kit/Navigation/SidePanel/index.js +1 -1
  41. package/dist/Kit/Navigation/SidePanel/types.d.ts +1 -1
  42. package/dist/Kit/index.js +1 -1
  43. package/dist/assets/Avatar.css +1 -1
  44. package/dist/assets/index2.css +1 -1
  45. package/dist/assets/index26.css +1 -1
  46. package/dist/assets/index34.css +1 -1
  47. package/dist/assets/index35.css +1 -1
  48. package/dist/assets/index39.css +1 -1
  49. package/dist/assets/index42.css +1 -1
  50. package/dist/assets/index44.css +1 -1
  51. package/dist/assets/index45.css +1 -1
  52. package/dist/assets/index5.css +1 -1
  53. package/dist/assets/index7.css +1 -1
  54. package/dist/assets/index9.css +1 -1
  55. package/dist/assets/styles2.css +1 -1
  56. package/dist/assets/useGetPopupContainer.css +1 -1
  57. package/dist/chunks/Avatar.BvI60jet.js +47 -0
  58. package/dist/chunks/InputWrapper.hIFFr5AB.js +27 -0
  59. package/dist/chunks/SnackBarProvider.hc5vyNRJ.js +23 -0
  60. package/dist/chunks/{styles.module.iV2bcv-5.js → styles.module.V-A2OGgm.js} +1 -1
  61. package/dist/chunks/useGetPopupContainer.efPkxYe1.js +18 -0
  62. package/dist/index.es.js +1 -1
  63. package/dist/index.umd.js +4 -4
  64. package/dist/theme/types/components/Navigation/SidePanel/index.d.ts +6 -1
  65. package/package.json +3 -3
  66. package/dist/chunks/Avatar.N2w2jq_C.js +0 -30
  67. package/dist/chunks/InputWrapper.XK7lKnUm.js +0 -24
  68. package/dist/chunks/SnackBarProvider.nqDzpFo3.js +0 -23
  69. package/dist/chunks/useGetPopupContainer.1ha3p9Qd.js +0 -18
package/CHANGELOG.md CHANGED
@@ -2,40 +2,62 @@
2
2
 
3
3
  ## [X.Y.Z](https://www.npmjs.com/package/aristid-ds/v/X.Y.Z) (2025-MM-DD)
4
4
 
5
- ### ✨ Features
6
- - **AutoComplete**:
5
+ ### ✨ Features
6
+
7
+ - **⚠️ Breaking change - Button**:
8
+ - Remove `checked` prop from segmented button (@evoiron)
9
+ - **⚠️ Breaking change - IdCard**:
10
+ - Replacing `size` options (@fatb38)
11
+ - removing `medium` and `large`
12
+ - adding `xxs-medium`, `xs-medium`, `xs-bold`, `s`, `m`, `l`, `xl`
13
+ - **⚠️ Breaking change - Input**:
14
+ - Rename `readonly` property to `readonlyLight` (@philippechevieux)
15
+ - Add `readonly` property whith a render similar to disabled state (@philippechevieux)
16
+ - **⚠️ Breaking change - DatePicker/RangePicker**:
17
+ - Rename `readonly` property to `readonlyLight` (@philippechevieux)
18
+ - Add `readonly` property whith a render similar to disabled state (@philippechevieux)
7
19
  - Add `size` property to enable `small`, `middle` and `large` sizes (@fatb38)
8
-
9
- - **ColorPicker**:
20
+ - **⚠️ Breaking change - RichText**:
21
+ - Rename `readonly` property to `readonlyLight` (@philippechevieux)
22
+ - Add `readonly` property whith a render similar to disabled state (@philippechevieux)
23
+ - **⚠️ Breaking change - Select**:
24
+ - Rename `readonly` property to `readonlyLight` (@philippechevieux)
25
+ - Add `readonly` property whith a render similar to disabled state (@philippechevieux)
10
26
  - Add `size` property to enable `small`, `middle` and `large` sizes (@fatb38)
11
-
12
- - **DatePicker/RangePicker**:
27
+ - **⚠️ Breaking change - Avatar**:
28
+ - Replace `size` option by : `xs`, `s`, `m`, `l`, `xl` (@fatb38)
29
+ - **Header**:
30
+ - Change 'height' to 48px instead of 64px
31
+ - **SideMenu**:
32
+ - Change 'width' to 48px instead of 64px
33
+ - **AutoComplete**:
13
34
  - Add `size` property to enable `small`, `middle` and `large` sizes (@fatb38)
14
-
15
- - **Input**:
35
+ - **ColorPicker**:
16
36
  - Add `size` property to enable `small`, `middle` and `large` sizes (@fatb38)
17
-
37
+ - Add `readonly` property whith a render similar to disabled state (@philippechevieux)
18
38
  - **InputNumber**:
19
39
  - Add `size` property to enable `small`, `middle` and `large` sizes (@fatb38)
20
-
21
- - **Select**:
22
- - Add `size` property to enable `small`, `middle` and `large` sizes (@fatb38)
23
-
40
+ - Add `readonly` property whith a render similar to disabled state (@philippechevieux)
24
41
  - **SidePanel**:
25
42
  - Add opening and closing animations (@philippechevieux)
26
-
27
- - **SidePanel:**
43
+ - Add `l` size (@7Remy)
28
44
  - Add `useChildrenOnly` property to display the side panel as a container for other components or not. Also export two new components `KitSidePanelHeader` and `KitSidePanelContent` for layout purpose (@philippechevieux)
29
45
  - Add `headerExtraButtons` property to display buttons or any components on the right side of the header next to the close button (@philippechevieux)
30
46
  - Add `showSeparator` property to display a separator between header and content (@philippechevieux)
31
47
  - Allow user to use `size` property when using `idCardProps` (@philippechevieux)
32
48
  - Reduce internal paddings to save space (@philippechevieux)
33
-
34
49
  - **IdCard:**
35
50
  - Add support for ReactNode in `title` and `descriptions` props to allow custom rendering (@philippechevieux)
36
-
51
+ - **Tabs:**
52
+ - Add `xsmall` size (@florianSimonAristid)
37
53
  - **All components with a DropDown:**
38
54
  - All components using a dropdown inside a `SidePanel` component, will render the dropdown inside the `SidePanel`, to avoid issues with the `closeOnOutsideClick` property of `SidePanel` (@evoiron)
55
+ - **Snackbar**
56
+ - Allow multiple snackbar areas (@evoiron)
57
+ - **Button**
58
+ - Add size `m`and `s` to segmented button (@evoiron)
59
+ - **InputWrapper**:
60
+ - Add forwardRef support to enable ref forwarding to the wrapper element (@philippechevieux)
39
61
 
40
62
  ### 🐛 Bug Fixes
41
63
 
@@ -44,6 +66,16 @@
44
66
  - **DropDown:**
45
67
  - Clicking outside the `DropDown` now closes it even when inside an iframe (@philippechevieux)
46
68
  - Keep the `DropDown` open when selecting items (@philippechevieux)
69
+ - Fix double toggle issue when clicking the trigger after closing via blur (@philippechevieux)
70
+ - **Upload:**
71
+ - Fix upload dragger height unexpectedly growing in some cases (@evoiron)
72
+
73
+ ### 📚 Documentation
74
+
75
+ - **Table**:
76
+ - Add `onRow` usage (@philippechevieux)
77
+ - **Filter**:
78
+ - Update `With custom Action` exemple implementation (@philippechevieux)
47
79
 
48
80
  ## [14.0.0](https://www.npmjs.com/package/aristid-ds/v/14.0.0) (2025-05-20)
49
81
 
@@ -2,7 +2,7 @@ import "../../assets/index29.css";
2
2
  import { jsx as n, jsxs as f, Fragment as h } from "react/jsx-runtime";
3
3
  import { useState as u, useLayoutEffect as L, useRef as S, useEffect as P } from "react";
4
4
  import { ConfigProvider as C } from "antd";
5
- import { I as b } from "../../chunks/SnackBarProvider.nqDzpFo3.js";
5
+ import { I as b } from "../../chunks/SnackBarProvider.hc5vyNRJ.js";
6
6
  import { toCssVariables as g, uuid as y } from "../../utils/functions/index.js";
7
7
  import a from "lodash/merge";
8
8
  import { Style as m } from "react-style-tag";
@@ -1,4 +1,4 @@
1
- import { s as t, K as n } from "../../../chunks/Avatar.N2w2jq_C.js";
1
+ import { s as t, K as n } from "../../../chunks/Avatar.BvI60jet.js";
2
2
  import { jsx as u } from "react/jsx-runtime";
3
3
  import { Avatar as c } from "antd";
4
4
  import { u as d } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
@@ -16,6 +16,7 @@ export interface IKitAvatar extends Omit<AvatarProps, AntdAvatarTypesToOmit>, Ki
16
16
  secondaryColorInvert?: boolean;
17
17
  imageFit?: KitImageFit;
18
18
  disabled?: boolean;
19
+ size?: 'xs' | 's' | 'm' | 'l' | 'xl';
19
20
  }
20
21
 
21
22
  export interface IKitAvatarGroup
@@ -1,37 +1,72 @@
1
1
  import "../../../assets/index2.css";
2
- import { jsxs as c, jsx as i } from "react/jsx-runtime";
2
+ import { jsxs as y, jsx as a } from "react/jsx-runtime";
3
3
  import n from "classnames";
4
- import { t as D } from "../../../chunks/styles.module.shsViPAW.js";
5
- import { u as v } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
6
- import { K as N } from "../../../chunks/Avatar.N2w2jq_C.js";
7
- import { KitTooltip as y } from "../Tooltip/index.js";
4
+ import { t as S } from "../../../chunks/styles.module.shsViPAW.js";
5
+ import { u as T } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
6
+ import { K as v } from "../../../chunks/Avatar.BvI60jet.js";
7
+ import { KitTooltip as d } from "../Tooltip/index.js";
8
8
  import { T as m } from "../../../chunks/constants.DINGxt3I.js";
9
- const T = {
10
- "kit-id-card": "_kit-id-card_1go5o_2"
9
+ const D = {
10
+ "kit-id-card": "_kit-id-card_1vabr_2"
11
11
  }, h = [
12
- D["kit-typography-text"],
12
+ S["kit-typography-text"],
13
13
  "ant-typography",
14
14
  "ant-typography-text",
15
15
  "ant-typography-ellipsis",
16
16
  "ant-typography-ellipsis-single-line"
17
- ], _ = (r, t, a, o) => {
18
- const s = n("kit-id-card-title", ...h, "kit-typography-fontSize5", "ant-typography-bold", {
19
- "kit-id-card-title-large": t === "large",
20
- "ant-typography-disabled": a
17
+ ], z = (t) => {
18
+ switch (t) {
19
+ case "xl":
20
+ return "kit-typography-fontSize5";
21
+ case "l":
22
+ return "kit-typography-fontSize6";
23
+ default:
24
+ return "kit-typography-fontSize7";
25
+ }
26
+ }, N = (t) => {
27
+ switch (t) {
28
+ case "xl":
29
+ return "kit-typography-fontSize1";
30
+ case "l":
31
+ return "kit-typography-fontSize2";
32
+ case "m":
33
+ return "kit-typography-fontSize3";
34
+ case "s":
35
+ return "kit-typography-fontSize4";
36
+ case "xs-bold":
37
+ case "xs-medium":
38
+ case "xxs-medium":
39
+ return "kit-typography-fontSize5";
40
+ }
41
+ }, _ = (t) => {
42
+ switch (t) {
43
+ case "xl":
44
+ case "l":
45
+ return "xl";
46
+ case "m":
47
+ case "s":
48
+ return "l";
49
+ case "xxs-medium":
50
+ return "s";
51
+ default:
52
+ return "m";
53
+ }
54
+ }, E = (t, e, r, i) => {
55
+ const s = n("kit-id-card-title", ...h, N(e), {
56
+ "ant-typography-bold": e !== "xs-medium",
57
+ "ant-typography-disabled": r
21
58
  });
22
- return i("span", { className: s, children: i(y, { title: o ? "" : r, mouseEnterDelay: m, children: i("span", { children: r }) }) });
23
- }, E = (r, t, a, o) => {
24
- const s = n("kit-id-card-description", ...h, "ant-typography-regular", {
25
- "kit-typography-fontSize5": t !== "medium",
26
- "kit-typography-fontSize7": t === "medium",
27
- "ant-typography-disabled": a
59
+ return a("span", { className: s, children: a(d, { title: i ? "" : t, mouseEnterDelay: m, children: a("span", { children: t }) }) });
60
+ }, K = (t, e, r, i) => {
61
+ const s = n("kit-id-card-description", ...h, "ant-typography-regular", z(e), {
62
+ "ant-typography-disabled": r
28
63
  });
29
- return i("span", { className: s, children: i(y, { title: o ? "" : r, mouseEnterDelay: m, children: i("span", { children: r }) }) });
30
- }, K = ({ className: r, title: t, description: a, avatarProps: o, size: s = "medium", disabled: e = !1, disableTooltip: p = !1, ...g }) => {
31
- const { appId: f } = v(), u = n(f, T["kit-id-card"], r), k = o !== void 0, l = t !== void 0, d = a !== void 0, x = l || d;
32
- return c("div", { className: `${u} id-card-grid`, ...g, children: [k && i("div", { className: "card-avatar", children: i(N, { ...o, disabled: e }) }), x && c("div", { className: "card-info", children: [l && typeof t == "string" ? _(t, s, e, p) : t, d && typeof a == "string" ? E(a, s, e, p) : a] })] });
64
+ return a("span", { className: s, children: a(d, { title: i ? "" : t, mouseEnterDelay: m, children: a("span", { children: t }) }) });
65
+ }, I = ({ className: t, title: e, description: r, avatarProps: i, size: s = "xs-bold", disabled: o = !1, disableTooltip: c = !1, ...u }) => {
66
+ const { appId: g } = T(), f = n(g, D["kit-id-card"], t), x = i !== void 0, p = e !== void 0, l = r !== void 0, k = p || l;
67
+ return y("div", { className: `${f} id-card-grid`, ...u, children: [x && a("div", { className: "card-avatar", children: a(v, { size: _(s), ...i, disabled: o }) }), k && y("div", { className: "card-info", children: [p && typeof e == "string" ? E(e, s, o, c) : e, l && typeof r == "string" ? K(r, s, o, c) : r] })] });
33
68
  };
34
- K.displayName = "KitIdCard";
69
+ I.displayName = "KitIdCard";
35
70
  export {
36
- K as KitIdCard
71
+ I as KitIdCard
37
72
  };
@@ -4,7 +4,7 @@ import {IKitAvatar} from '../Avatar/types';
4
4
 
5
5
  export interface IKitIdCard extends KitHTMLAttributes<HTMLDivElement> {
6
6
  avatarProps?: IKitAvatar;
7
- size?: 'medium' | 'large';
7
+ size?: 'xxs-medium' | 'xs-medium' | 'xs-bold' | 's' | 'm' | 'l' | 'xl';
8
8
  title?: ReactNode;
9
9
  description?: ReactNode;
10
10
  disabled?: boolean;
@@ -1,30 +1,44 @@
1
1
  import "../../../assets/index5.css";
2
- import { jsxs as r, Fragment as I, jsx as l } from "react/jsx-runtime";
3
- import { useState as S } from "react";
4
- import { u as D } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
5
- import K from "classnames";
6
- import { KitButton as E } from "../../General/Button/index.js";
7
- import { KitTypography as j } from "../../General/Typography/index.js";
2
+ import { jsxs as a, Fragment as I, jsx as e } from "react/jsx-runtime";
3
+ import { useState as D } from "react";
4
+ import { u as E } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
5
+ import x from "classnames";
6
+ import { KitButton as j } from "../../General/Button/index.js";
7
+ import { KitTypography as z } from "../../General/Typography/index.js";
8
8
  import { KitBadge as C } from "../Badge/index.js";
9
9
  import { FontAwesomeIcon as O } from "@fortawesome/react-fontawesome";
10
10
  import { faPlus as U } from "@fortawesome/free-solid-svg-icons";
11
- import { F as z } from "../../../chunks/constants.DINGxt3I.js";
12
- const L = {
13
- "kit-tabs": "_kit-tabs_1i9lf_2"
14
- }, P = ({ addTab: v, centered: h, className: w, activeKey: n, defaultKey: a, items: o, onChange: i, fullwidthTab: u, size: b = "small", variant: s = "classic" }) => {
15
- var m, d;
16
- const { appId: x } = D(), [y, f] = S(a ?? ((m = o[0]) === null || m === void 0 ? void 0 : m.key)), k = n ?? y, N = (d = o.find((t) => t.key === k)) === null || d === void 0 ? void 0 : d.tabContent, A = K(x, w, L["kit-tabs"], h ? "centered" : "", b === "small" ? "small" : "medium", s, u ? "fullwidth" : "", N && s === "pill" ? "tabs-bottom-spacing" : ""), T = (t) => {
17
- f(t), i == null || i(t);
18
- }, B = (t, c) => {
19
- t.code === "Enter" && (f(c), i == null || i(c));
11
+ import { F as L } from "../../../chunks/constants.DINGxt3I.js";
12
+ const P = {
13
+ "kit-tabs": "_kit-tabs_1kygn_2"
14
+ }, X = (s) => {
15
+ switch (s) {
16
+ case "xsmall":
17
+ return "fontSize7";
18
+ case "small":
19
+ return "fontSize6";
20
+ case "medium":
21
+ return "fontSize4";
22
+ default:
23
+ return "fontSize4";
24
+ }
25
+ }, g = ({ addTab: s, centered: _, className: h, activeKey: m, defaultKey: d, items: i, onChange: o, fullwidthTab: b, size: l = "small", variant: n = "classic" }) => {
26
+ var u, p;
27
+ const { appId: w } = E(), [y, f] = D(d ?? ((u = i[0]) === null || u === void 0 ? void 0 : u.key)), k = m ?? y, N = (p = i.find((t) => t.key === k)) === null || p === void 0 ? void 0 : p.tabContent, K = x(w, h, P["kit-tabs"], _ ? "centered" : "", l ?? "medium", n, b ? "fullwidth" : "", N && n === "pill" ? "tabs-bottom-spacing" : ""), T = (t) => {
28
+ f(t), o == null || o(t);
29
+ }, A = (t, r) => {
30
+ t.code === "Enter" && (f(r), o == null || o(r));
20
31
  };
21
- return r(I, { children: [r("div", { className: A, role: "tablist", children: [o == null ? void 0 : o.map(({ icon: t, label: c, badgeCount: _, key: e, disabled: p }) => r("div", { className: K("kit-tab", s, {
22
- disabled: p,
23
- active: k === e,
24
- fullwidth: u
25
- }), role: "tab", tabIndex: z, onClick: p ? void 0 : () => T(e), onKeyDown: p ? void 0 : (F) => B(F, e), children: [t && l("div", { className: "kit-tab-icon", children: t }), r("div", { className: "kit-tab-label-wrapper", children: [l(j.Text, { className: "kit-tab-label", size: b === "medium" ? "fontSize4" : void 0, children: c }), !!_ && l(C, { className: "kit-tab-count", count: _ })] })] }, e)), v && s === "classic" && l(E, { disableSecureClick: !0, type: "tertiary", icon: l(O, { icon: U }), onClick: v })] }), N] });
32
+ return a(I, { children: [a("div", { className: K, role: "tablist", children: [i == null ? void 0 : i.map(({ icon: t, label: r, badgeCount: S, key: c, disabled: v }) => {
33
+ const B = k === c;
34
+ return a("div", { className: x("kit-tab", "kit-tab-" + l, n, {
35
+ disabled: v,
36
+ active: B,
37
+ fullwidth: b
38
+ }), role: "tab", tabIndex: L, onClick: v ? void 0 : () => T(c), onKeyDown: v ? void 0 : (F) => A(F, c), children: [t && e("div", { className: "kit-tab-icon", children: t }), a("div", { className: "kit-tab-label-wrapper", children: [e(z.Text, { className: "kit-tab-label", size: X(l), children: r }), !!S && e(C, { className: "kit-tab-count", count: S })] })] }, c);
39
+ }), s && n === "classic" && e(j, { disableSecureClick: !0, type: "tertiary", icon: e(O, { icon: U }), onClick: s })] }), N] });
26
40
  };
27
- P.displayName = "KitTabs";
41
+ g.displayName = "KitTabs";
28
42
  export {
29
- P as KitTabs
43
+ g as KitTabs
30
44
  };
@@ -8,7 +8,7 @@ type IKitTabs = {
8
8
  activeKey?: string;
9
9
  defaultKey?: string;
10
10
  onChange?: (tabKey: string) => void;
11
- size?: 'small' | 'medium';
11
+ size?: 'xsmall' | 'small' | 'medium';
12
12
  fullwidthTab?: boolean;
13
13
  variant?: 'classic' | 'pill';
14
14
  };
@@ -1,9 +1,9 @@
1
1
  import "../../../assets/index38.css";
2
- import { jsx as t, Fragment as E, jsxs as W } from "react/jsx-runtime";
2
+ import { jsx as t, Fragment as A, jsxs as W } from "react/jsx-runtime";
3
3
  import { forwardRef as D, useState as G, useRef as O, useLayoutEffect as L } from "react";
4
- import $ from "classnames";
4
+ import E from "classnames";
5
5
  import { Tag as z } from "antd";
6
- import { u as x } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
6
+ import { u as $ } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
7
7
  import { FontAwesomeIcon as P } from "@fortawesome/react-fontawesome";
8
8
  import { faXmark as X } from "@fortawesome/free-solid-svg-icons";
9
9
  import { KitIdCard as j } from "../IdCard/index.js";
@@ -16,31 +16,31 @@ const I = {
16
16
  "kit-tag-group": "_kit-tag-group_6ocqb_111",
17
17
  "kit-tag-group-measure": "_kit-tag-group-measure_6ocqb_117",
18
18
  "kit-tag-group-container": "_kit-tag-group-container_6ocqb_124"
19
- }, h = D(({ className: r, closeIcon: s, type: a = "neutral", disabled: i, disableTooltip: c = !1, onClick: p, idCardProps: o, ...d }, u) => {
20
- const { appId: b } = x(), _ = $(b, I["kit-tag"], r, {
21
- [`kit-tag-${a}`]: a,
19
+ }, h = D(({ className: r, closeIcon: s, type: c = "neutral", disabled: i, disableTooltip: a = !1, onClick: p, idCardProps: o, ...d }, u) => {
20
+ const { appId: b } = $(), _ = E(b, I["kit-tag"], r, {
21
+ [`kit-tag-${c}`]: c,
22
22
  "kit-tag-disabled": i,
23
23
  "kit-tag-clickable": p
24
24
  });
25
- return t(z, { tabIndex: i ? M : R, ref: u, ...d, className: _, closeIcon: s ?? t(P, { icon: X }), onClick: p, closable: !!d.onClose, children: t(j, { disabled: i, disableTooltip: c, avatarProps: o != null && o.avatarProps ? { ...o == null ? void 0 : o.avatarProps, size: "small" } : void 0, description: o == null ? void 0 : o.description }) });
26
- }), H = ({ tags: r, containerRef: s, measureRef: a, handleCloseTag: i }) => {
27
- var c;
28
- const [p, o] = G([]), [d, u] = G(0), [b, _] = G(t(E, {})), v = O(null), { locale: T } = F();
25
+ return t(z, { tabIndex: i ? M : R, ref: u, ...d, className: _, closeIcon: s ?? t(P, { icon: X }), onClick: p, closable: !!d.onClose, children: t(j, { disabled: i, disableTooltip: a, avatarProps: o != null && o.avatarProps ? { ...o == null ? void 0 : o.avatarProps, size: "xs" } : void 0, description: o == null ? void 0 : o.description }) });
26
+ }), H = ({ tags: r, containerRef: s, measureRef: c, handleCloseTag: i }) => {
27
+ var a;
28
+ const [p, o] = G([]), [d, u] = G(0), [b, _] = G(t(A, {})), v = O(null), { locale: T } = F();
29
29
  return L(() => {
30
30
  const K = () => {
31
31
  var k, g, e;
32
- const l = s.current, f = a.current;
32
+ const l = s.current, f = c.current;
33
33
  if (!l || !f)
34
34
  return;
35
- _(W(E, { children: [r.map((n, y) => t(h, { type: n == null ? void 0 : n.type, disabled: n == null ? void 0 : n.disabled, idCardProps: n.idCardProps, onClose: () => {
35
+ _(W(A, { children: [r.map((n, y) => t(h, { type: n == null ? void 0 : n.type, disabled: n == null ? void 0 : n.disabled, idCardProps: n.idCardProps, onClose: () => {
36
36
  i == null || i(y);
37
37
  } }, y)), t(h, { idCardProps: { description: `+${d} ${(k = T.General) === null || k === void 0 ? void 0 : k.others}` } })] }));
38
38
  const q = l == null ? void 0 : l.clientWidth, w = Array.from(f.children), B = (g = w[w.length - 1]) === null || g === void 0 ? void 0 : g.clientWidth;
39
- let A = 0, C = 0;
39
+ let x = 0, C = 0;
40
40
  for (let n = 0; n < w.length - 1; n++) {
41
41
  const y = ((e = w[n]) === null || e === void 0 ? void 0 : e.clientWidth) + 8;
42
- if (A + y + 8 + (n < r.length - 1 ? B : 0) <= q)
43
- A += y, C++;
42
+ if (x + y + 8 + (n < r.length - 1 ? B : 0) <= q)
43
+ x += y, C++;
44
44
  else
45
45
  break;
46
46
  }
@@ -53,20 +53,20 @@ const I = {
53
53
  return K(), v.current = new ResizeObserver(N), s.current && v.current.observe(s.current), () => {
54
54
  v.current && v.current.disconnect(), clearTimeout(m);
55
55
  };
56
- }, [s, i, d, (c = T.General) === null || c === void 0 ? void 0 : c.others, a, r]), {
56
+ }, [s, i, d, (a = T.General) === null || a === void 0 ? void 0 : a.others, c, r]), {
57
57
  measureTags: b,
58
58
  visibleTags: p,
59
59
  hiddenCount: d
60
60
  };
61
- }, J = ({ tags: r, style: s, className: a, handleCloseTag: i, othersTagType: c = "neutral", othersTagDisabled: p }) => {
61
+ }, J = ({ tags: r, style: s, className: c, handleCloseTag: i, othersTagType: a = "neutral", othersTagDisabled: p }) => {
62
62
  var o;
63
- const d = O(null), u = O(null), { locale: b } = F(), { appId: _ } = x(), [v, T] = G(!1), { measureTags: K, visibleTags: m, hiddenCount: N } = H({ tags: r, containerRef: d, measureRef: u, handleCloseTag: i }), k = () => r.slice(m.length).map((e, l) => {
63
+ const d = O(null), u = O(null), { locale: b } = F(), { appId: _ } = $(), [v, T] = G(!1), { measureTags: K, visibleTags: m, hiddenCount: N } = H({ tags: r, containerRef: d, measureRef: u, handleCloseTag: i }), k = () => r.slice(m.length).map((e, l) => {
64
64
  var f;
65
65
  return t("div", { children: (f = e.idCardProps) === null || f === void 0 ? void 0 : f.description }, l);
66
- }), g = $(_, I["kit-tag-group"], a);
66
+ }), g = E(_, I["kit-tag-group"], c);
67
67
  return W("div", { className: I["kit-tag-group-container"], children: [W("div", { ref: d, style: s, className: g, children: [m.map((e, l) => t(h, { type: e == null ? void 0 : e.type, disabled: e == null ? void 0 : e.disabled, idCardProps: e.idCardProps, onClose: i ? () => {
68
68
  i(l);
69
- } : void 0 }, l)), N > 0 && t(V, { overlay: k(), children: t(h, { type: c, disabled: p, disableTooltip: !0, idCardProps: { description: `+${N} ${(o = b.General) === null || o === void 0 ? void 0 : o.others}` }, onClick: () => T(!0) }) }), t(U, { isOpen: v, close: () => T(!1), showCloseIcon: !0, title: "Tags", appElement: document.body, children: t("div", { style: { display: "flex", flexWrap: "wrap", rowGap: "8px" }, children: r.map((e, l) => t(h, { id: `tag-${l}`, type: e == null ? void 0 : e.type, disabled: e == null ? void 0 : e.disabled, idCardProps: e.idCardProps, onClose: i ? () => {
69
+ } : void 0 }, l)), N > 0 && t(V, { overlay: k(), children: t(h, { type: a, disabled: p, disableTooltip: !0, idCardProps: { description: `+${N} ${(o = b.General) === null || o === void 0 ? void 0 : o.others}` }, onClick: () => T(!0) }) }), t(U, { isOpen: v, close: () => T(!1), showCloseIcon: !0, title: "Tags", appElement: document.body, children: t("div", { style: { display: "flex", flexWrap: "wrap", rowGap: "8px" }, children: r.map((e, l) => t(h, { id: `tag-${l}`, type: e == null ? void 0 : e.type, disabled: e == null ? void 0 : e.disabled, idCardProps: e.idCardProps, onClose: i ? () => {
70
70
  i(l);
71
71
  } : void 0 }, l)) }) })] }), t("div", { ref: u, className: I["kit-tag-group-measure"], "aria-hidden": "true", children: K })] });
72
72
  }, Q = J, S = h;
@@ -3,11 +3,11 @@ import { jsx as e } from "react/jsx-runtime";
3
3
  import { forwardRef as O, useState as b, useRef as j } from "react";
4
4
  import { AutoComplete as B } from "antd";
5
5
  import { KitInput as M } from "../Input/index.js";
6
- import { K as S } from "../../../chunks/InputWrapper.XK7lKnUm.js";
6
+ import { K as S } from "../../../chunks/InputWrapper.hIFFr5AB.js";
7
7
  import { FontAwesomeIcon as W } from "@fortawesome/react-fontawesome";
8
8
  import { faMagnifyingGlass as q } from "@fortawesome/free-solid-svg-icons";
9
9
  import z from "classnames";
10
- import { u as D } from "../../../chunks/useGetPopupContainer.1ha3p9Qd.js";
10
+ import { u as D } from "../../../chunks/useGetPopupContainer.efPkxYe1.js";
11
11
  const E = {
12
12
  "kit-autocomplete": "_kit-autocomplete_kox09_2"
13
13
  }, H = (t, r, o) => z(t, "ant-select-dropdown", "kit-select-dropdown-bottom", {
@@ -7,7 +7,7 @@ import { u as ae } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
7
7
  import ne from "rc-util/es/omit";
8
8
  import { ConfigContext as ie } from "antd/es/config-provider/";
9
9
  import ce from "antd/es/checkbox/style";
10
- import { K as ue } from "../../../chunks/InputWrapper.XK7lKnUm.js";
10
+ import { K as ue } from "../../../chunks/InputWrapper.hIFFr5AB.js";
11
11
  const j = P(null), te = ({ defaultValue: b, children: v, options: a = [], prefixCls: f, className: e, wrapperClassName: x, status: g, rootClassName: t, style: i, onChange: d, label: h, helper: o, required: r, actions: B, extra: k, ...n }, D) => {
12
12
  const { getPrefixCls: E, direction: T } = R(ie), [m, K] = w(n.value || b || []), [W, S] = w([]);
13
13
  I(() => {
@@ -1,87 +1,91 @@
1
1
  import "../../../assets/index26.css";
2
- import { forwardRef as J, useRef as Q, useState as d, useEffect as b, useImperativeHandle as Z, createElement as V } from "react";
3
- import { jsxs as oo, jsx as s } from "react/jsx-runtime";
4
- import { K as to } from "../../../chunks/InputWrapper.XK7lKnUm.js";
5
- import { u as eo } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
6
- import { ColorPicker as ro } from "antd";
7
- import N from "classnames";
8
- import { FontAwesomeIcon as io } from "@fortawesome/react-fontawesome";
9
- import { faCircleXmark as no } from "@fortawesome/free-solid-svg-icons";
10
- import { u as co } from "../../../chunks/useKitLocale.96CdK3og.js";
11
- import { u as lo } from "../../../chunks/useGetPopupContainer.1ha3p9Qd.js";
12
- const u = {
13
- "kit-colorpicker": "_kit-colorpicker_7zhkg_2",
14
- "kit-color-picker-clear": "_kit-color-picker-clear_7zhkg_37",
15
- "kit-color-picker-placeholder": "_kit-color-picker-placeholder_7zhkg_41",
16
- "kit-color-picker-text": "_kit-color-picker-text_7zhkg_45"
17
- }, so = 9, ao = 16, po = 255, ko = (o) => {
18
- if (o.length === so) {
19
- const r = o.slice(-2), e = Math.round(parseInt(r, ao) / po * 100);
20
- return `${o.slice(0, 7)},${e}%`;
2
+ import { forwardRef as Z, useRef as V, useState as d, useEffect as T, useImperativeHandle as oo, createElement as to } from "react";
3
+ import { jsxs as ro, jsx as l } from "react/jsx-runtime";
4
+ import { K as eo } from "../../../chunks/InputWrapper.hIFFr5AB.js";
5
+ import { u as io } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
6
+ import { ColorPicker as no } from "antd";
7
+ import O from "classnames";
8
+ import { FontAwesomeIcon as co } from "@fortawesome/react-fontawesome";
9
+ import { faCircleXmark as lo } from "@fortawesome/free-solid-svg-icons";
10
+ import { u as so } from "../../../chunks/useKitLocale.96CdK3og.js";
11
+ import { u as ao } from "../../../chunks/useGetPopupContainer.efPkxYe1.js";
12
+ const f = {
13
+ "kit-colorpicker": "_kit-colorpicker_19hvp_2",
14
+ "kit-color-picker-clear": "_kit-color-picker-clear_19hvp_40",
15
+ "kit-color-picker-placeholder": "_kit-color-picker-placeholder_19hvp_44",
16
+ "kit-color-picker-text": "_kit-color-picker-text_19hvp_48"
17
+ }, po = 9, ko = 16, uo = 255, mo = (o) => {
18
+ if (o.length === po) {
19
+ const e = o.slice(-2), r = Math.round(parseInt(e, ko) / uo * 100);
20
+ return `${o.slice(0, 7)},${r}%`;
21
21
  }
22
22
  return o;
23
- }, mo = (o, r) => {
24
- switch (r) {
23
+ }, ho = (o, e) => {
24
+ switch (e) {
25
25
  case "hex":
26
- return ko(o.toHexString());
26
+ return mo(o.toHexString());
27
27
  case "rgb":
28
28
  return o.toRgbString();
29
29
  case "hsb":
30
30
  return o.toHsbString();
31
31
  }
32
- }, uo = (o, r, e, n) => n ? s("span", { className: u["kit-color-picker-placeholder"], children: e }) : s("span", { children: mo(o, r) }), ho = ({ color: o, format: r, showText: e, placeholder: n, isColorPickerValueEmpty: h, allowClear: f, onClear: p }) => {
33
- var c;
34
- const { locale: l } = co(), a = e === !0, _ = typeof e == "function" && e !== void 0, i = f === !0, k = n ?? ((c = l.ColorPicker) === null || c === void 0 ? void 0 : c.selectAColor);
35
- return oo("div", { className: u["kit-color-picker-text"], children: [a && uo(o, r, k, h), _ && s("span", { children: e(o) }), i && s(io, { className: u["kit-color-picker-clear"], "aria-label": "clear", icon: no, onClick: (v) => {
36
- v.stopPropagation(), p();
32
+ }, fo = (o, e, r, c, a) => {
33
+ if (!(a && c))
34
+ return c ? l("span", { className: f["kit-color-picker-placeholder"], children: r }) : l("span", { children: ho(o, e) });
35
+ }, vo = ({ color: o, format: e, showText: r, placeholder: c, isColorPickerValueEmpty: a, allowClear: v, readonly: p, onClear: k }) => {
36
+ var i;
37
+ const { locale: s } = so(), _ = r === !0, n = typeof r == "function" && r !== void 0, u = v === !0, C = c ?? ((i = s.ColorPicker) === null || i === void 0 ? void 0 : i.selectAColor);
38
+ return ro("div", { className: f["kit-color-picker-text"], children: [_ && fo(o, e, C, a, p), n && l("span", { children: r(o) }), u && l(co, { className: f["kit-color-picker-clear"], "aria-label": "clear", icon: lo, onClick: (m) => {
39
+ m.stopPropagation(), k();
37
40
  } })] });
38
- }, fo = J(({ label: o, className: r, helper: e, rootClassName: n, required: h, actions: f, extra: p, showText: c, allowClear: l, open: a = !1, placeholder: _, defaultValue: i, value: k, getPopupContainer: v, onChange: C, onClear: x, onOpenChange: g, onFormatChange: I, format: O = "hex", size: R = "large", ...S }, z) => {
39
- const { appId: T } = eo(), E = Q(null), [L, m] = d(a), [P, y] = d(i ?? k), [A, H] = d(l), [K, X] = d(O), [w, D] = d(0), G = lo(E, v), j = c || A, F = N(T, "kit-colorpicker-panel", n), M = N(T, u["kit-colorpicker"], { "kit-colorpicker-with-text": !!c }, r);
40
- b(() => {
41
- H(l);
42
- }, [l]), b(() => {
43
- m(a);
44
- }, [a]), b(() => {
45
- y(i ?? k);
46
- }, [i, k]), Z(z, () => ({
41
+ }, _o = Z(({ label: o, className: e, helper: r, rootClassName: c, required: a, actions: v, extra: p, showText: k, allowClear: i, open: s = !1, placeholder: _, defaultValue: n, value: u, getPopupContainer: C, onChange: m, onClear: x, onOpenChange: I, onFormatChange: P, disabled: K, readonly: g = !1, format: R = "hex", size: L = "large", ...X }, w) => {
42
+ const { appId: N } = io(), b = V(null), [D, h] = d(s), [A, y] = d(n ?? u), [H, S] = d(i), [E, G] = d(R), [j, F] = d(0), M = ao(b, C), W = k || H, $ = O(N, "kit-colorpicker-panel", c), B = O(N, f["kit-colorpicker"], { "kit-colorpicker-with-text": !!k, "kit-colorpicker-readonly": g }, e);
43
+ T(() => {
44
+ S(i);
45
+ }, [i]), T(() => {
46
+ h(s);
47
+ }, [s]), T(() => {
48
+ y(n ?? u);
49
+ }, [n, u]), oo(w, () => ({
47
50
  focus: () => {
48
- m(!0);
51
+ h(!0);
49
52
  },
50
53
  blur: () => {
51
- m(!1);
54
+ h(!1);
52
55
  },
53
- value: P
56
+ value: A
54
57
  }));
55
- const W = () => {
56
- l && H(!1), y(void 0), D((t) => t + 1), x == null || x();
57
- }, $ = (t, q) => {
58
- l && !A && H(!0), y(t), C == null || C(t, q);
59
- }, B = (t) => {
60
- a || m(t), g == null || g(t);
61
- }, U = (t) => {
62
- X(t), I == null || I(t);
63
- }, Y = P === void 0;
64
- return s(to, { label: o, helper: e, disabled: S.disabled, required: h, extra: p ?? f, children: s("div", { ref: E, children: V(ro, {
65
- ...S,
58
+ const U = () => {
59
+ i && S(!1), y(void 0), F((t) => t + 1), x == null || x();
60
+ }, Y = (t, Q) => {
61
+ i && !H && S(!0), y(t), m == null || m(t, Q);
62
+ }, q = (t) => {
63
+ s || h(t), I == null || I(t);
64
+ }, z = (t) => {
65
+ G(t), P == null || P(t);
66
+ }, J = A === void 0;
67
+ return l(eo, { label: o, helper: r, disabled: K, required: a, extra: p ?? v, children: l("div", { ref: b, children: to(no, {
68
+ ...X,
66
69
  // This is a hack to force the color picker to re-render and display a clear value
67
70
  // https://react.dev/learn/preserving-and-resetting-state#option-2-resetting-state-with-a-key
68
- key: w,
69
- getPopupContainer: G,
70
- rootClassName: F,
71
- className: M,
72
- format: K,
73
- size: R,
74
- value: P,
75
- ...j && {
76
- showText: (t) => s(ho, { color: t, format: K, showText: c, placeholder: _, isColorPickerValueEmpty: Y, allowClear: A, onClear: W })
71
+ key: j,
72
+ getPopupContainer: M,
73
+ rootClassName: $,
74
+ className: B,
75
+ format: E,
76
+ size: L,
77
+ value: A,
78
+ disabled: K || g,
79
+ ...W && {
80
+ showText: (t) => l(vo, { color: t, format: E, showText: k, placeholder: _, readonly: g, isColorPickerValueEmpty: J, allowClear: H, onClear: U })
77
81
  },
78
- open: L,
79
- onOpenChange: B,
80
- onFormatChange: U,
81
- onChange: $
82
+ open: D,
83
+ onOpenChange: q,
84
+ onFormatChange: z,
85
+ onChange: Y
82
86
  }) }) });
83
87
  });
84
- fo.displayName = "KitColorPicker";
88
+ _o.displayName = "KitColorPicker";
85
89
  export {
86
- fo as KitColorPicker
90
+ _o as KitColorPicker
87
91
  };
@@ -3,7 +3,7 @@ import {KitHTMLAttributes} from '../../../types';
3
3
  import type {Color} from 'antd/es/color-picker';
4
4
  import {IKitInputWrapperBase} from '../InputWrapper/types';
5
5
 
6
- type AntdColorPickerTypesInherited = Omit<ColorPickerProps, 'mode'>;
6
+ type AntdColorPickerTypesInherited = Omit<ColorPickerProps, 'mode' | 'readOnly'>;
7
7
 
8
8
  export interface KitColorPickerProps
9
9
  extends AntdColorPickerTypesInherited,
@@ -11,6 +11,7 @@ export interface KitColorPickerProps
11
11
  IKitInputWrapperBase {
12
12
  required?: boolean;
13
13
  placeholder?: string;
14
+ readonly?: boolean;
14
15
  }
15
16
 
16
17
  export type KitColor = Color;
@@ -22,6 +23,7 @@ export type KitColorPickerInternalTextProps = {
22
23
  placeholder: KitColorPickerProps['placeholder'];
23
24
  isColorPickerValueEmpty: boolean;
24
25
  allowClear: KitColorPickerProps['allowClear'];
26
+ readonly: KitColorPickerProps['readonly'];
25
27
  onClear: () => void;
26
28
  };
27
29