kelt-ui-kit-react 2.1.7 → 2.1.8

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.
@@ -3,9 +3,10 @@ export type BadgeInterface = {
3
3
  className?: string;
4
4
  onClick?: (e: React.MouseEvent) => void;
5
5
  title?: string;
6
+ tooltip?: string;
6
7
  sizeIcon?: IconSizeEnum;
7
8
  classIcon?: string;
8
9
  color?: string;
9
10
  onRemove?: (event: React.MouseEvent) => void;
10
11
  };
11
- export declare const Badge: ({ className, onClick, title, sizeIcon, classIcon, color, onRemove, }: BadgeInterface) => import('react/jsx-runtime').JSX.Element;
12
+ export declare const Badge: ({ className, onClick, title, tooltip, sizeIcon, classIcon, color, onRemove, }: BadgeInterface) => import('react/jsx-runtime').JSX.Element;
package/dist/index.js CHANGED
@@ -178,26 +178,27 @@ var ue = () => ({ getTokenValidate: o(() => {
178
178
  }, z = ({ classIcon: e, size: t, onClick: n }) => /* @__PURE__ */ y("i", {
179
179
  className: `bi ${e} ${t ?? "sm"}`,
180
180
  onClick: n
181
- }), pe = ({ className: e, onClick: t, title: n, sizeIcon: r, classIcon: i, color: a, onRemove: s }) => {
182
- let c = o((e) => {
181
+ }), pe = ({ className: e, onClick: t, title: n, tooltip: r, sizeIcon: i, classIcon: a, color: s, onRemove: c }) => {
182
+ let l = o((e) => {
183
183
  e.stopPropagation(), t && t(e);
184
184
  }, [t]);
185
185
  return /* @__PURE__ */ b("div", {
186
- onClick: c,
187
- style: a ? { backgroundColor: a } : void 0,
186
+ onClick: l,
187
+ title: r,
188
+ style: s ? { backgroundColor: s } : void 0,
188
189
  className: `badge ${e || ""}`,
189
190
  children: [
190
- i && /* @__PURE__ */ y(z, {
191
- size: r,
192
- classIcon: i
191
+ a && /* @__PURE__ */ y(z, {
192
+ size: i,
193
+ classIcon: a
193
194
  }),
194
195
  /* @__PURE__ */ y("span", { children: n }),
195
- s && /* @__PURE__ */ y("button", {
196
+ c && /* @__PURE__ */ y("button", {
196
197
  type: "button",
197
198
  className: "badge-remove",
198
199
  "aria-label": `Retirer ${n ?? "le filtre"}`,
199
200
  onClick: (e) => {
200
- e.stopPropagation(), s(e);
201
+ e.stopPropagation(), c(e);
201
202
  },
202
203
  children: /* @__PURE__ */ y(z, { classIcon: "bi-x" })
203
204
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kelt-ui-kit-react",
3
3
  "type": "module",
4
- "version": "2.1.7",
4
+ "version": "2.1.8",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",
@@ -6,6 +6,7 @@ export type BadgeInterface = {
6
6
  className?: string;
7
7
  onClick?: (e: React.MouseEvent) => void;
8
8
  title?: string;
9
+ tooltip?: string;
9
10
  sizeIcon?: IconSizeEnum;
10
11
  classIcon?: string;
11
12
  color?: string;
@@ -15,6 +16,7 @@ export const Badge = ({
15
16
  className,
16
17
  onClick,
17
18
  title,
19
+ tooltip,
18
20
  sizeIcon,
19
21
  classIcon,
20
22
  color,
@@ -29,6 +31,7 @@ export const Badge = ({
29
31
  return (
30
32
  <div
31
33
  onClick={handleClick}
34
+ title={tooltip}
32
35
  style={color ? { backgroundColor: color } : undefined}
33
36
  className={`badge ${className ? className : ""}`}
34
37
  >
@@ -6,6 +6,7 @@ export const BadgeView = (): JSX.Element => {
6
6
  <Badge
7
7
  className="badge--primary"
8
8
  title="Badge"
9
+ tooltip="Texte affiché au survol"
9
10
  sizeIcon={undefined}
10
11
  classIcon="bi-check-circle"
11
12
  onClick={() => console.log("Badge clicked")}