aristid-ds 3.0.0 → 4.0.0-3ef6e97

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 (57) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +19 -0
  3. package/dist/Kit/App/index.js +1 -1
  4. package/dist/Kit/DataDisplay/Avatar/index.js +26 -22
  5. package/dist/Kit/DataDisplay/Avatar/types.d.ts +3 -0
  6. package/dist/Kit/DataDisplay/Card/index.js +2 -2
  7. package/dist/Kit/DataDisplay/Card/types.d.ts +3 -9
  8. package/dist/Kit/DataDisplay/Collapse/index.js +1 -1
  9. package/dist/Kit/DataDisplay/IdCard/index.js +12 -12
  10. package/dist/Kit/DataDisplay/ItemCard/index.js +1 -1
  11. package/dist/Kit/DataDisplay/ItemList/index.d.ts +2 -2
  12. package/dist/Kit/DataDisplay/ItemList/index.js +18 -7
  13. package/dist/Kit/DataDisplay/ItemList/types.d.ts +8 -16
  14. package/dist/Kit/DataDisplay/LegacyCard/index.js +1 -1
  15. package/dist/Kit/DataDisplay/Tag/index.js +1 -1
  16. package/dist/Kit/DataDisplay/index.js +1 -1
  17. package/dist/Kit/DataDisplay/types.d.ts +8 -0
  18. package/dist/Kit/DataEntry/DatePicker/index.js +14 -14
  19. package/dist/Kit/DataEntry/Select/guard.d.ts +3 -0
  20. package/dist/Kit/DataEntry/Select/index.d.ts +2 -2
  21. package/dist/Kit/DataEntry/Select/index.js +3 -8
  22. package/dist/Kit/DataEntry/Select/renders.d.ts +15 -0
  23. package/dist/Kit/DataEntry/Select/types.d.ts +27 -8
  24. package/dist/Kit/DataEntry/Select/useIcons.d.ts +12 -0
  25. package/dist/Kit/DataEntry/index.js +1 -1
  26. package/dist/Kit/Feedback/Modal/index.js +59 -64
  27. package/dist/Kit/Feedback/Notification/index.js +1 -1
  28. package/dist/Kit/Feedback/index.js +1 -1
  29. package/dist/Kit/Layout/Section/index.js +1 -1
  30. package/dist/Kit/Navigation/Header/index.js +1 -1
  31. package/dist/Kit/Navigation/Menu/index.js +1 -1
  32. package/dist/Kit/Navigation/PageHeader/index.js +2 -2
  33. package/dist/Kit/Navigation/Pagination/index.js +1 -1
  34. package/dist/Kit/Navigation/index.js +1 -1
  35. package/dist/Kit/index.d.ts +3 -3
  36. package/dist/Kit/index.js +141 -141
  37. package/dist/assets/index2.css +1 -1
  38. package/dist/assets/index20.css +1 -1
  39. package/dist/assets/index21.css +1 -1
  40. package/dist/assets/index23.css +1 -1
  41. package/dist/assets/index28.css +1 -1
  42. package/dist/assets/index31.css +1 -1
  43. package/dist/assets/styles.css +1 -1
  44. package/dist/assets/styles2.css +1 -1
  45. package/dist/chunks/{KitNotification.ZqndZ_Jo.js → KitNotification.-Rnvel2X.js} +1 -1
  46. package/dist/chunks/index.KNNpudCD.js +526 -0
  47. package/dist/chunks/{styles.module.cDfGpFWX.js → styles.module.tkXR5gsa.js} +1 -1
  48. package/dist/chunks/{styles.module.h70MuyQF.js → styles.module.x1Oajwjm.js} +1 -1
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.es.js +145 -144
  51. package/dist/index.umd.js +4 -4
  52. package/dist/theme/utils/tokens-mapper/DataEntry/Select/index.d.ts +1 -0
  53. package/dist/theme/utils/tokens-mapper/DataEntry/Select/index.js +5 -4
  54. package/package.json +4 -3
  55. package/dist/chunks/index.5Ttd0fY8.js +0 -496
  56. package/dist/theme/utils/index.d.ts +0 -1
  57. package/dist/theme/utils/index.js +0 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.0.0](https://www.npmjs.com/package/aristid-ds/v/4.0.0) (2024-03-28)
4
+ ### ✨ Features
5
+ * **Select:**
6
+ * Add `idCard` property to option to display a `KitIdCard` instead of the label (@philippechevieux)
7
+ * **Avatar:**
8
+ * Add a new property `imageFit` to change how image will fit (@philippechevieux)
9
+
10
+ ### 🐛 Bug Fixes
11
+ * **IdCard:**
12
+ * Add default ellipsis to `title` and `description` (@philippechevieux)
13
+ * Add missing exports for `useKitLocale`, `KitEmpty`, `KitIdCard`, `KitInputWrapper` and `KitSection` (@philippechevieux)
14
+ * **DatePicker / RangePicker:**
15
+ * Fix calendar icon disapearing on hover when a default value is set (@evoiron)
16
+ * **⚠️ Breaking change - ItemList:**
17
+ * Refactor ItemList (@P0ppoff / @Delmotte-Vincent / @renaudamsellem / @philippechevieux)
18
+ * **Modal:**
19
+ * Remove use of getComputedStyle which can be time consuming in tests (@evoiron)
20
+
3
21
  ## [3.0.0](https://www.npmjs.com/package/aristid-ds/v/3.0.0) (2024-03-15)
4
22
  ### ✨ Features
5
23
  * **Empty:**
package/README.md CHANGED
@@ -460,6 +460,25 @@ A nightly version of the package is published on daily basis on branch develop (
460
460
  ```
461
461
  **Note:** Though it is useful to test upcoming feature, this version should **NEVER** be used in production
462
462
 
463
+ ## Tests
464
+ Tests can be slow when using the Design system. It is caused by jsdom which heavily use Window.GetComputedStyle. To workaround this performance issue, you shoud update the version of jsdom used by you test library (typically jest) to 21.1.0 or even 24.0.0. To achieve this, update your projects package.json and add these lines:
465
+
466
+ if using yarn:
467
+ ```sh
468
+ "resolutions": {
469
+ "jsdom": "21.1.0"
470
+ }
471
+ ```
472
+
473
+ if using npm and jest:
474
+ ```sh
475
+ "overrides": {
476
+ "jest-environment-jsdom": {
477
+ "jsdom": "21.1.0"
478
+ }
479
+ }
480
+ ```
481
+
463
482
  ## Important
464
483
  Every import of antd library should pass by `antd` or `ant/es`. `lib` import will lead to issues in the build process.
465
484
 
@@ -17,7 +17,7 @@ import { mapKitLocaleToAntdLocale as I } from "../../translation/utils/index.js"
17
17
  import { d as $ } from "../../chunks/notification-provider.9tbQyfg7.js";
18
18
  import "../DataDisplay/Avatar/index.js";
19
19
  import "../DataDisplay/Badge/index.js";
20
- import "../../chunks/index.5Ttd0fY8.js";
20
+ import "../../chunks/index.KNNpudCD.js";
21
21
  import { KitEmpty as p } from "../DataDisplay/Empty/index.js";
22
22
  import "../DataDisplay/IdCard/index.js";
23
23
  import "../DataDisplay/LegacyCard/index.js";
@@ -1,32 +1,36 @@
1
1
  import "../../../assets/index21.css";
2
2
  import { jsx as m } from "react/jsx-runtime";
3
- import { useMemo as y } from "react";
3
+ import { useMemo as C } from "react";
4
4
  import { Avatar as p } from "antd";
5
- import { u as n } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
6
- import { getInitials as C, isValidColor as K, getColor as _, isSecondaryColor as x, getLighterColor as h, getContrastColor as N } from "../../../utils/functions/index.js";
7
- import { kitAvatarCssTokens as e } from "../../../theme/aristid/components/DataDisplay/Avatar/index.js";
8
- import l from "classnames";
9
- const u = {
10
- "kit-avatar": "_kit-avatar_w3aj4_2",
11
- "kit-avatar-group": "_kit-avatar-group_w3aj4_7"
12
- }, j = (t, a) => !t || !K(t) ? null : {
13
- [e.colors.background.default]: _(t, a),
14
- [e.colors.typography.default]: x(t) ? h(t, a) : N(t)
15
- }, c = ({ label: t, initialsMaxChars: a, color: r, className: i, style: o, secondaryColorInvert: s = !1, children: g, ...f }) => {
16
- const { appId: d } = n(), k = y(() => ({ ...o, ...j(r, s) }), [r, s, o]), A = l(d, u["kit-avatar"], i);
17
- return m(p, { style: k, className: A, ...f, children: t !== void 0 ? C(t, a) : g });
5
+ import { u as l } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
6
+ import { getInitials as K, isValidColor as _, getColor as x, isSecondaryColor as h, getLighterColor as N, getContrastColor as G } from "../../../utils/functions/index.js";
7
+ import { kitAvatarCssTokens as n } from "../../../theme/aristid/components/DataDisplay/Avatar/index.js";
8
+ import c from "classnames";
9
+ const v = {
10
+ "kit-avatar": "_kit-avatar_48vkr_2",
11
+ "kit-avatar-group": "_kit-avatar-group_48vkr_16"
12
+ }, S = (t, a) => !t || !_(t) ? null : {
13
+ [n.colors.background.default]: x(t, a),
14
+ [n.colors.typography.default]: h(t) ? N(t, a) : G(t)
15
+ }, u = ({ label: t, initialsMaxChars: a, color: r, className: o, style: i, secondaryColorInvert: e = !1, children: k, imageFit: s = "cover", ...g }) => {
16
+ const { appId: d } = l(), A = C(() => ({ ...i, ...S(r, e) }), [r, e, i]), y = c(d, v["kit-avatar"], o, {
17
+ "kit-avatar-image-fit-cover": s === "cover",
18
+ "kit-avatar-image-fit-contain": s === "contain",
19
+ "kit-avatar-image-fit-fill": s === "fill"
20
+ });
21
+ return m(p, { style: A, className: y, ...g, children: t !== void 0 ? K(t, a) : k });
18
22
  };
19
- c.displayName = "KitAvatar";
20
- const G = ({ className: t, maxCount: a, ...r }) => {
21
- const { appId: i } = n(), o = l(i, u["kit-avatar-group"], t, {
23
+ u.displayName = "KitAvatar";
24
+ const T = ({ className: t, maxCount: a, ...r }) => {
25
+ const { appId: o } = l(), i = c(o, v["kit-avatar-group"], t, {
22
26
  "override-last": a
23
27
  });
24
- return m(p.Group, { ...r, maxCount: a, className: o, maxStyle: {
28
+ return m(p.Group, { ...r, maxCount: a, className: i, maxStyle: {
25
29
  cursor: r.maxPopoverTrigger === "click" ? "pointer" : "initial"
26
30
  } });
27
- }, S = G, v = c;
28
- v.displayName = "KitAvatar";
29
- v.Group = S;
31
+ }, I = T, f = u;
32
+ f.displayName = "KitAvatar";
33
+ f.Group = I;
30
34
  export {
31
- v as KitAvatar
35
+ f as KitAvatar
32
36
  };
@@ -7,11 +7,14 @@ import {KitColorProp} from '../../../utils/functions/types';
7
7
  type AntdAvatarTypesToOmit = '';
8
8
  type AntdAvatarGroupTypesToOmit = 'maxStyle';
9
9
 
10
+ type KitImageFit = 'cover' | 'contain' | 'fill';
11
+
10
12
  export interface IKitAvatar extends Omit<AvatarProps, AntdAvatarTypesToOmit>, KitHTMLAttributes<HTMLSpanElement> {
11
13
  label?: string;
12
14
  initialsMaxChars?: number;
13
15
  color?: KitColorProp;
14
16
  secondaryColorInvert?: boolean;
17
+ imageFit?: KitImageFit;
15
18
  }
16
19
 
17
20
  export interface IKitAvatarGroup
@@ -8,7 +8,7 @@ import "../../DataEntry/Input/index.js";
8
8
  import "../../DataEntry/InputNumber/index.js";
9
9
  import "../../DataEntry/Radio/index.js";
10
10
  import "../../DataEntry/Rate/index.js";
11
- import { K as y } from "../../../chunks/index.5Ttd0fY8.js";
11
+ import { K as y } from "../../../chunks/index.KNNpudCD.js";
12
12
  import "../../DataEntry/Switch/index.js";
13
13
  import "../../DataEntry/DatePicker/index.js";
14
14
  import "../../DataEntry/AutoComplete/index.js";
@@ -22,7 +22,7 @@ import "../../Navigation/DropDown/index.js";
22
22
  import "../../Navigation/Steps/index.js";
23
23
  import "antd";
24
24
  import "../../../chunks/useKitTheme.KSAU-Pdv.js";
25
- import "../../../chunks/styles.module.h70MuyQF.js";
25
+ import "../../../chunks/styles.module.x1Oajwjm.js";
26
26
  export {
27
27
  y as KitCard
28
28
  };
@@ -1,11 +1,12 @@
1
- import {CSSProperties, ReactNode} from 'react';
1
+ import {CSSProperties} from 'react';
2
2
  import {IKitTagConfig} from '../../DataDisplay/Tag/types';
3
3
  import {CheckboxChangeEvent} from 'antd/es/checkbox';
4
4
  import {SwitchChangeEventHandler} from 'antd/es/switch';
5
+ import {IKitActionButton} from '../../DataDisplay/types';
5
6
 
6
7
  export interface IKitCard {
7
8
  title: string;
8
- actions?: IKitCardAction[];
9
+ actions?: IKitActionButton[];
9
10
  activated?: boolean;
10
11
  brandingBar?: boolean;
11
12
  className?: string;
@@ -20,13 +21,6 @@ export interface IKitCard {
20
21
  tags?: IKitTagConfig[];
21
22
  }
22
23
 
23
- export interface IKitCardAction {
24
- key: string;
25
- label: string;
26
- icon: ReactNode;
27
- onClick: (e: unknown) => void;
28
- }
29
-
30
24
  export interface IStyledKitCard {
31
25
  $brandingBar: boolean;
32
26
  }
@@ -1,4 +1,4 @@
1
- import { b as e } from "../../../chunks/index.5Ttd0fY8.js";
1
+ import { b as e } from "../../../chunks/index.KNNpudCD.js";
2
2
  export {
3
3
  e as KitCollapse
4
4
  };
@@ -1,21 +1,21 @@
1
1
  import "../../../assets/index2.css";
2
- import { jsxs as c, jsx as s } from "react/jsx-runtime";
3
- import l from "classnames";
2
+ import { jsxs as a, jsx as r } from "react/jsx-runtime";
3
+ import c from "classnames";
4
4
  import { u as x } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
5
5
  import "../../General/Button/index.js";
6
- import { KitTypography as n } from "../../General/Typography/index.js";
6
+ import { KitTypography as m } from "../../General/Typography/index.js";
7
7
  import "../../General/Icon/index.js";
8
8
  const y = {
9
- "kit-id-card": "_kit-id-card_stmwg_2"
10
- }, v = (r, i) => {
11
- const t = l({ "kit-id-card-title-large": i === "large" });
12
- return s(n.Text, { className: t, size: "large", weight: "bold", children: r });
13
- }, f = (r, i) => {
9
+ "kit-id-card": "_kit-id-card_mmcks_2"
10
+ }, v = (s, i) => {
11
+ const t = c({ "kit-id-card-title-large": i === "large" });
12
+ return r(m.Text, { className: t, size: "large", weight: "bold", ellipsis: { tooltip: !0 }, children: s });
13
+ }, f = (s, i) => {
14
14
  const t = i === "medium" ? "small" : "large";
15
- return s(n.Text, { size: t, children: r });
16
- }, D = ({ className: r, title: i, description: t, avatar: d, size: o = "medium", ...m }) => {
17
- const { appId: p } = x(), h = l(p, y["kit-id-card"], r), u = d !== void 0, e = i !== void 0, a = t !== void 0, g = e || a;
18
- return c("div", { className: `${h} id-card-grid`, ...m, children: [u && s("div", { className: "card-avatar", children: d }), g && c("div", { className: "card-info", children: [e && v(i, o), a && f(t, o)] })] });
15
+ return r(m.Text, { size: t, ellipsis: { tooltip: !0 }, children: s });
16
+ }, D = ({ className: s, title: i, description: t, avatar: o, size: e = "medium", ...n }) => {
17
+ const { appId: p } = x(), u = c(p, y["kit-id-card"], s), h = o !== void 0, d = i !== void 0, l = t !== void 0, g = d || l;
18
+ return a("div", { className: `${u} id-card-grid`, ...n, children: [h && r("div", { className: "card-avatar", children: o }), g && a("div", { className: "card-info", children: [d && v(i, e), l && f(t, e)] })] });
19
19
  };
20
20
  D.displayName = "KitIdCard";
21
21
  export {
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "classnames";
4
- import { a as u } from "../../../chunks/index.5Ttd0fY8.js";
4
+ import { a as u } from "../../../chunks/index.KNNpudCD.js";
5
5
  import "../../General/Button/index.js";
6
6
  import "../../General/Typography/index.js";
7
7
  import "../../General/Icon/index.js";
@@ -1,3 +1,3 @@
1
- import { FunctionComponent } from 'react';
1
+ import React from 'react';
2
2
  import { IKitItemList } from './types';
3
- export declare const KitItemList: FunctionComponent<IKitItemList>;
3
+ export declare const KitItemList: React.ForwardRefExoticComponent<IKitItemList & React.RefAttributes<HTMLDivElement>>;
@@ -5,23 +5,34 @@ import "../../DataEntry/Input/index.js";
5
5
  import "../../DataEntry/InputNumber/index.js";
6
6
  import "../../DataEntry/Radio/index.js";
7
7
  import "../../DataEntry/Rate/index.js";
8
- import { c as v } from "../../../chunks/index.5Ttd0fY8.js";
8
+ import { c as H } from "../../../chunks/index.KNNpudCD.js";
9
9
  import "../../DataEntry/Switch/index.js";
10
10
  import "../../DataEntry/DatePicker/index.js";
11
11
  import "../../DataEntry/AutoComplete/index.js";
12
12
  import "../../DataEntry/Upload/index.js";
13
13
  import "../../DataEntry/Slider/index.js";
14
14
  import "../../DataEntry/ColorPicker/index.js";
15
+ import "../Avatar/index.js";
16
+ import "../Badge/index.js";
17
+ import "../Empty/index.js";
18
+ import "../IdCard/index.js";
19
+ import "../../../chunks/index.91q8JHRn.js";
20
+ import "../LegacyCard/index.js";
21
+ import "../Tabs/index.js";
22
+ import "../Tree/index.js";
23
+ import "../Tooltip/index.js";
24
+ import "antd";
25
+ import "../../../chunks/useKitTheme.KSAU-Pdv.js";
26
+ import "classnames";
15
27
  import "../../General/Button/index.js";
16
28
  import "../../General/Typography/index.js";
17
29
  import "../../General/Icon/index.js";
18
- import "../../../chunks/useKitTheme.KSAU-Pdv.js";
19
- import "../../../chunks/index.91q8JHRn.js";
30
+ import "../../Navigation/Breadcrumb/index.js";
31
+ import "../../Navigation/DropDown/index.js";
32
+ import "../../Navigation/Steps/index.js";
33
+ import "../../../chunks/styles.module.x1Oajwjm.js";
20
34
  import "@fortawesome/react-fontawesome";
21
- import "@fortawesome/free-regular-svg-icons";
22
35
  import "@fortawesome/free-solid-svg-icons";
23
- import "../../../hooks/useSecureClick/index.js";
24
- import "classnames";
25
36
  export {
26
- v as KitItemList
37
+ H as KitItemList
27
38
  };
@@ -1,21 +1,13 @@
1
- import {KitHTMLAttributes} from '../../../types';
2
1
  import {ReactNode} from 'react';
3
- import {CheckboxChangeEvent} from 'antd/es/checkbox';
2
+ import {IKitIdCard} from '../../DataDisplay/IdCard/types';
3
+ import {IKitActionButton} from '../../DataDisplay/types';
4
+ import {KitHTMLAttributes} from '../../../types';
4
5
 
5
6
  export interface IKitItemList extends KitHTMLAttributes<HTMLDivElement> {
6
- title?: string;
7
- description?: string;
8
- picture?: ReactNode;
9
- onSelect?: (e: CheckboxChangeEvent) => void;
10
- tagNumber?: number;
11
- onRafterClick?: () => void;
12
- disabled?: boolean;
7
+ idCardProps: IKitIdCard;
8
+ draggableHandler?: ReactNode;
9
+ onSelect?: (isChecked: boolean) => void;
13
10
  onClick?: () => void;
14
- selected?: boolean;
15
- disableSecureClick?: boolean;
16
- draggable?: boolean;
17
- }
18
-
19
- export interface IStyledKitItemList {
20
- $gridTemplateColumns: string;
11
+ actions?: IKitActionButton[];
12
+ content?: ReactNode;
21
13
  }
@@ -12,7 +12,7 @@ import { KitSpace as k } from "../../Layout/Space/index.js";
12
12
  import "color-convert";
13
13
  import "color-string";
14
14
  import "lodash/isEmpty";
15
- import "../../../chunks/styles.module.cDfGpFWX.js";
15
+ import "../../../chunks/styles.module.tkXR5gsa.js";
16
16
  import { u as K } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
17
17
  import { FontAwesomeIcon as A } from "@fortawesome/react-fontawesome";
18
18
  import { faLink as E } from "@fortawesome/free-solid-svg-icons";
@@ -1,4 +1,4 @@
1
- import { d as r } from "../../../chunks/index.5Ttd0fY8.js";
1
+ import { d as r } from "../../../chunks/index.KNNpudCD.js";
2
2
  export {
3
3
  r as KitTag
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { KitAvatar as o } from "./Avatar/index.js";
2
2
  import { KitBadge as e } from "./Badge/index.js";
3
- import { K, b as m, a as p, c as f, d as x } from "../../chunks/index.5Ttd0fY8.js";
3
+ import { K, b as m, a as p, c as f, d as x } from "../../chunks/index.KNNpudCD.js";
4
4
  import { KitEmpty as d } from "./Empty/index.js";
5
5
  import { KitIdCard as T } from "./IdCard/index.js";
6
6
  import { K as I } from "../../chunks/index.91q8JHRn.js";
@@ -0,0 +1,8 @@
1
+ import {ReactNode} from 'react';
2
+
3
+ export interface IKitActionButton {
4
+ key: string;
5
+ label: string;
6
+ icon: ReactNode;
7
+ onClick: (e: unknown) => void;
8
+ }
@@ -1,21 +1,21 @@
1
1
  import "../../../assets/index23.css";
2
2
  import { jsx as e } from "react/jsx-runtime";
3
- import { faCircleXmark as I, faClock as K, faCalendar as R } from "@fortawesome/free-regular-svg-icons";
3
+ import { faCircleXmark as I, faClock as K, faCalendar as g } from "@fortawesome/free-regular-svg-icons";
4
4
  import { FontAwesomeIcon as i } from "@fortawesome/react-fontawesome";
5
- import { K as h } from "../../../chunks/InputWrapper.NQtlTzQk.js";
6
- import { u as v } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
7
- import { DatePicker as C } from "antd";
8
- import D from "classnames";
9
- import { forwardRef as g } from "react";
5
+ import { K as R } from "../../../chunks/InputWrapper.NQtlTzQk.js";
6
+ import { u as h } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
7
+ import { DatePicker as v } from "antd";
8
+ import C from "classnames";
9
+ import { forwardRef as D } from "react";
10
10
  const w = {
11
- "kit-datepicker": "_kit-datepicker_n1csk_2",
12
- "kit-rangepicker": "_kit-rangepicker_n1csk_117"
13
- }, N = g(({ label: o, helper: s, suffixIcon: a, className: r, wrapperClassName: l, picker: c = "date", allowClear: d = !0, required: m, infoIcon: f, actions: u, onInfoClick: t, ...n }, k) => {
14
- const { appId: p } = v(), b = () => c === "time" ? e(i, { icon: K }) : e(i, { icon: R }), _ = D(p, w["kit-datepicker"], r);
15
- return e(h, { label: o, helper: s, disabled: n.disabled, status: n.status, className: l, required: m, infoIcon: f, actions: u, onInfoClick: t, children: e("div", { children: e(C, { ...n, picker: c, ref: k, suffixIcon: a ?? b(), allowClear: d ? { clearIcon: e(i, { "aria-label": "clear", icon: I }) } : !1, className: _ }) }) });
16
- }), y = g(({ label: o, className: s, helper: a, suffixIcon: r, picker: l, allowClear: c = !0, required: d, infoIcon: m, actions: f, onInfoClick: u, ...t }, n) => {
17
- const { appId: k } = v(), p = () => l === "time" ? e(i, { icon: K }) : e(i, { icon: R }), b = () => t.disabled === void 0 ? !1 : typeof t.disabled == "boolean" ? t.disabled : t.disabled[0] && t.disabled[1], _ = D(k, w["kit-rangepicker"], s);
18
- return e(h, { label: o, helper: a, disabled: b(), status: t.status, required: d, infoIcon: m, actions: f, onInfoClick: u, children: e("div", { children: e(C.RangePicker, { ...t, picker: l, ref: n, suffixIcon: r ?? p(), allowClear: c ? { clearIcon: e(i, { "aria-label": "clear", icon: I }) } : !1, className: _ }) }) });
11
+ "kit-datepicker": "_kit-datepicker_1tfpg_2",
12
+ "kit-rangepicker": "_kit-rangepicker_1tfpg_118"
13
+ }, N = D(({ label: c, helper: s, suffixIcon: a, className: r, wrapperClassName: n, picker: o = "date", allowClear: d = !0, required: m, infoIcon: f, actions: u, onInfoClick: t, ...l }, p) => {
14
+ const { appId: k } = h(), b = () => o === "time" ? e(i, { icon: K }) : e(i, { icon: g }), _ = C(k, w["kit-datepicker"], r);
15
+ return e(R, { label: c, helper: s, disabled: l.disabled, status: l.status, className: n, required: m, infoIcon: f, actions: u, onInfoClick: t, children: e("div", { children: e(v, { ...l, picker: o, ref: p, suffixIcon: a ?? b(), allowClear: d ? { clearIcon: e(i, { "aria-label": "clear", icon: I }) } : !1, className: _ }) }) });
16
+ }), y = D(({ label: c, className: s, helper: a, suffixIcon: r, picker: n, allowClear: o = !0, required: d, infoIcon: m, actions: f, onInfoClick: u, ...t }, l) => {
17
+ const { appId: p } = h(), k = () => n === "time" ? e(i, { icon: K }) : e(i, { icon: g }), b = () => t.disabled === void 0 ? !1 : typeof t.disabled == "boolean" ? t.disabled : t.disabled[0] && t.disabled[1], _ = C(p, w["kit-rangepicker"], s);
18
+ return e(R, { label: c, helper: a, disabled: b(), status: t.status, required: d, infoIcon: m, actions: f, onInfoClick: u, children: e("div", { children: e(v.RangePicker, { ...t, picker: n, ref: l, suffixIcon: r ?? k(), allowClear: o ? { clearIcon: e(i, { "aria-label": "clear", icon: I }) } : !1, className: _ }) }) });
19
19
  }), S = y, x = N;
20
20
  x.displayName = "KitDatePicker";
21
21
  x.RangePicker = S;
@@ -0,0 +1,3 @@
1
+ import { ClassicOption, IKitOption, IdCard } from './types';
2
+ export declare const isClassicOption: (option: IKitOption) => option is ClassicOption;
3
+ export declare const isIdCardOption: (option: IKitOption) => option is IdCard;
@@ -1,4 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { RefSelectProps } from 'antd';
2
- import React from 'react';
3
3
  import { IKitSelect } from './types';
4
- export declare const KitSelect: React.ForwardRefExoticComponent<IKitSelect & React.RefAttributes<RefSelectProps>>;
4
+ export declare const KitSelect: import("react").ForwardRefExoticComponent<IKitSelect & import("react").RefAttributes<RefSelectProps>>;
@@ -1,18 +1,13 @@
1
1
  import "react/jsx-runtime";
2
- import "@fortawesome/free-regular-svg-icons";
3
- import "@fortawesome/free-solid-svg-icons";
4
- import "@fortawesome/react-fontawesome";
5
- import { e as d } from "../../../chunks/index.5Ttd0fY8.js";
6
2
  import "../../../chunks/InputWrapper.NQtlTzQk.js";
7
- import "../../General/Button/index.js";
8
- import "../../General/Typography/index.js";
9
- import "../../General/Icon/index.js";
10
3
  import "../../../chunks/useKitTheme.KSAU-Pdv.js";
11
4
  import "antd";
12
5
  import "classnames";
13
6
  import "react";
14
7
  import "short-unique-id";
15
8
  import "use-debounce";
9
+ import { e as s } from "../../../chunks/index.KNNpudCD.js";
10
+ import "lodash/flatten";
16
11
  export {
17
- d as KitSelect
12
+ s as KitSelect
18
13
  };
@@ -0,0 +1,15 @@
1
+ import { ReactElement } from 'react';
2
+ import { IKitInternalOption, IKitOption, IKitSelect } from './types';
3
+ import { LabelInValueType } from 'rc-select/es/Select';
4
+ import type { CustomTagProps } from 'rc-select/es/BaseSelect';
5
+ import { FlattenOptionData } from 'rc-select/lib/interface';
6
+ import { BaseOptionType } from 'antd/es/select';
7
+ export declare const getLabelRender: ({ value }: LabelInValueType | CustomTagProps, selectedOption?: IKitInternalOption | IKitInternalOption[]) => import("react").ReactNode;
8
+ export declare const getTagRender: (customTag: CustomTagProps, disabled: IKitSelect['disabled'], status: IKitSelect['status'], selectedOption?: IKitInternalOption | IKitInternalOption[]) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const getMaxTagRender: (omittedValues: {
10
+ length: number;
11
+ }, disabled: IKitSelect['disabled'], status: IKitSelect['status']) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const getDropdownRender: (menu: ReactElement, dropdownRender?: IKitSelect['dropdownRender']) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const fixSelectRender: (id: string) => void;
14
+ export declare const getOptionRender: ({ value, label }: FlattenOptionData<BaseOptionType>, flattenInternalOptions: IKitInternalOption[]) => import("react").ReactNode;
15
+ export declare const getOptionLabelRender: (selectOption: IKitOption, labelOnly?: IKitSelect['labelOnly']) => ReactElement | string;
@@ -1,7 +1,7 @@
1
1
  import {SelectProps} from 'antd';
2
- import type {OptionProps} from 'rc-select/es/Option';
3
2
  import {KitHTMLAttributes} from '../../../types';
4
3
  import {ReactNode, ReactElement, MouseEvent} from 'react';
4
+ import {IKitIdCard} from '../../DataDisplay/IdCard/types';
5
5
 
6
6
  type AntdSelectTypesToOmit =
7
7
  | 'dropdownMatchSelectWidth'
@@ -16,17 +16,42 @@ type AntdSelectTypesToOmit =
16
16
  | 'optionLabelProp'
17
17
  | 'removeIcon'
18
18
  | 'searchValue'
19
- | 'showSearch'
20
19
  | 'size'
21
20
  | 'tokenSeparators'
22
21
  | 'virtual'
22
+ | 'variant'
23
23
  | 'clearIcon'
24
24
  | 'onDeselect'
25
25
  | 'onInputKeyDown'
26
26
  | 'dropdownStyle'
27
27
  | 'menuItemSelectedIcon'
28
+ | 'labelRender'
29
+ | 'optionRender'
28
30
  | 'suffixIcon';
29
31
 
32
+ type OptionCommons = {
33
+ label?: string;
34
+ value?: string | number | null;
35
+ className?: string;
36
+ disabled?: boolean;
37
+ };
38
+
39
+ export type IdCard = OptionCommons & {
40
+ idCard?: IKitIdCard;
41
+ };
42
+
43
+ export type ClassicOption = OptionCommons & {
44
+ icon?: ReactNode;
45
+ color?: string;
46
+ options?: Omit<IKitOption, 'options'>[];
47
+ };
48
+
49
+ export type IKitOption = IdCard & ClassicOption;
50
+
51
+ export type IKitInternalOption = IKitOption & {
52
+ labelToDisplay?: ReactNode;
53
+ };
54
+
30
55
  export interface IKitSelect extends Omit<SelectProps, AntdSelectTypesToOmit>, KitHTMLAttributes<HTMLDivElement> {
31
56
  label?: string;
32
57
  helper?: string;
@@ -40,9 +65,3 @@ export interface IKitSelect extends Omit<SelectProps, AntdSelectTypesToOmit>, Ki
40
65
  actions?: ReactElement[];
41
66
  onInfoClick?: (e: MouseEvent<HTMLElement, MouseEvent>) => void;
42
67
  }
43
-
44
- interface IKitOption extends Omit<OptionProps, ''> {
45
- icon?: ReactNode;
46
- color?: string;
47
- label: string;
48
- }
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { IKitSelect } from './types';
3
+ type UseIcons = {
4
+ clearIcon?: JSX.Element;
5
+ suffixIcon: JSX.Element;
6
+ selectedItemIcon: JSX.Element;
7
+ };
8
+ export default function useIcons({ allowClear, loading }: {
9
+ allowClear: IKitSelect['allowClear'];
10
+ loading: IKitSelect['loading'];
11
+ }): UseIcons;
12
+ export {};
@@ -4,7 +4,7 @@ import { KitInputNumber as m } from "./InputNumber/index.js";
4
4
  import { K } from "../../chunks/InputWrapper.NQtlTzQk.js";
5
5
  import { KitRadio as a } from "./Radio/index.js";
6
6
  import { KitRate as l } from "./Rate/index.js";
7
- import { e as d } from "../../chunks/index.5Ttd0fY8.js";
7
+ import { e as d } from "../../chunks/index.KNNpudCD.js";
8
8
  import { KitSwitch as n } from "./Switch/index.js";
9
9
  import { KitDatePicker as I } from "./DatePicker/index.js";
10
10
  import { KitAutoComplete as b } from "./AutoComplete/index.js";