chop-logic-components 4.2.0 → 4.3.0

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 (68) hide show
  1. package/dist/components/atoms/avatar/Avatar.css +1 -0
  2. package/dist/components/atoms/avatar/Avatar.d.ts +7 -0
  3. package/dist/components/atoms/avatar/Avatar2.js +44 -0
  4. package/dist/components/atoms/button/Button2.js +11 -11
  5. package/dist/components/atoms/button/icon-button/IconButton2.js +4 -4
  6. package/dist/components/atoms/button/inner-button/InnerButton2.js +4 -4
  7. package/dist/components/atoms/button/primary-button/PrimaryButton2.js +4 -4
  8. package/dist/components/atoms/button/secondary-button/SecondaryButton2.js +4 -4
  9. package/dist/components/atoms/editable-text/EditView.js +4 -4
  10. package/dist/components/atoms/editable-text/EditableText2.js +8 -8
  11. package/dist/components/atoms/icon/Icon2.js +10 -10
  12. package/dist/components/atoms/image/BasicImage.d.ts +2 -0
  13. package/dist/components/atoms/image/BasicImage.js +4 -9
  14. package/dist/components/atoms/image/Image.css +1 -1
  15. package/dist/components/atoms/image/Image2.js +16 -16
  16. package/dist/components/atoms/image/ResponsivePicture.d.ts +1 -0
  17. package/dist/components/atoms/image/ResponsivePicture.js +16 -9
  18. package/dist/components/atoms/index.d.ts +2 -0
  19. package/dist/components/atoms/input/Input2.js +5 -5
  20. package/dist/components/atoms/label/Label2.js +4 -4
  21. package/dist/components/atoms/link/Link2.js +4 -4
  22. package/dist/components/atoms/tag/Tag.css +1 -0
  23. package/dist/components/atoms/tag/Tag.d.ts +7 -0
  24. package/dist/components/atoms/tag/Tag2.js +15 -0
  25. package/dist/components/atoms/tooltip/Tooltip2.js +9 -8
  26. package/dist/components/contexts/theme/ThemeProvider.js +8 -8
  27. package/dist/components/hocs/with-error-boundary/with-error-boundary.js +8 -8
  28. package/dist/components/hocs/with-figure-caption/Figure.css +1 -1
  29. package/dist/components/molecules/alert/Alert2.js +19 -19
  30. package/dist/components/molecules/checkbox/CheckboxStateful.js +6 -6
  31. package/dist/components/molecules/checkbox/CheckboxStateless.js +6 -6
  32. package/dist/components/molecules/multi-select/MultiSelect.Combobox.js +6 -6
  33. package/dist/components/molecules/multi-select/MultiSelect.js +7 -7
  34. package/dist/components/molecules/multi-select/Option.js +8 -8
  35. package/dist/components/molecules/numeric-input/NumericInputStateful.js +8 -8
  36. package/dist/components/molecules/numeric-input/NumericInputStateless.js +8 -8
  37. package/dist/components/molecules/search/Search2.js +16 -16
  38. package/dist/components/molecules/select/Select2.js +7 -7
  39. package/dist/components/molecules/select/combobox/Combobox2.js +6 -6
  40. package/dist/components/molecules/select/option/Option2.js +6 -6
  41. package/dist/components/molecules/text-input/TextInputStateless.js +8 -8
  42. package/dist/components/organisms/dialog/Dialog2.js +14 -14
  43. package/dist/components/organisms/form/Form2.js +14 -14
  44. package/dist/components/organisms/gallery/Gallery.helpers.js +2 -2
  45. package/dist/components/organisms/gallery/Gallery2.js +8 -8
  46. package/dist/components/organisms/gallery/full-screen-viewer/FullscreenViewer2.js +7 -7
  47. package/dist/components/organisms/gallery/viewer-navigation/ViewerNavigation2.js +8 -8
  48. package/dist/components/organisms/grid/checkbox/GridCheckbox2.js +4 -4
  49. package/dist/components/organisms/index.d.ts +1 -0
  50. package/dist/components/organisms/menu/Menu2.js +5 -5
  51. package/dist/components/organisms/menu/list-item/MenuListItem2.js +8 -8
  52. package/dist/components/organisms/menu/sub-menu/SubMenu2.js +17 -17
  53. package/dist/components/organisms/preview-card/PreviewCard.css +1 -0
  54. package/dist/components/organisms/preview-card/PreviewCard.d.ts +4 -0
  55. package/dist/components/organisms/preview-card/PreviewCard2.js +57 -0
  56. package/dist/components/organisms/tabs/Tabs2.js +11 -11
  57. package/dist/components/organisms/tabs/button/TabButton2.js +23 -23
  58. package/dist/components/organisms/tabs/edit-input/TabEditInput2.js +9 -9
  59. package/dist/components/organisms/tabs/list/TabList2.js +12 -12
  60. package/dist/enums/index.d.ts +1 -0
  61. package/dist/enums/index.js +1 -0
  62. package/dist/enums/link-target.d.ts +6 -0
  63. package/dist/enums/link-target.js +6 -0
  64. package/dist/index.es.js +61 -57
  65. package/dist/types/image.d.ts +16 -3
  66. package/dist/types/index.d.ts +2 -1
  67. package/dist/types/preview-card.d.ts +38 -0
  68. package/package.json +15 -15
@@ -0,0 +1 @@
1
+ .cl-avatar{border:var(--cl-light-border);border-radius:50%;justify-content:center;align-items:center;display:inline-flex}.cl-avatar__image{width:var(--cl-xl-gap);height:var(--cl-xl-gap);object-fit:cover;border-radius:50%}.cl-avatar__fallback{width:var(--cl-xl-gap);height:var(--cl-xl-gap);background-color:var(--cl-surface-tonal-a10);color:var(--cl-base-font-color);font-family:var(--cl-core-font);font-size:var(--cl-typography-base-mobile);border-radius:50%;justify-content:center;align-items:center;font-weight:700;display:inline-flex}.cl-avatar__link{color:inherit;border-radius:50%;text-decoration:none;display:inline-flex}.cl-avatar__link:focus{outline:2px solid var(--cl-accent-a0);outline-offset:2px}
@@ -0,0 +1,7 @@
1
+ import { AvatarProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Avatar: FC<AvatarProps & {
4
+ tooltip?: string;
5
+ visibleOn?: "hover" | "click" | "focus" | "contextmenu";
6
+ }>;
7
+ export default Avatar;
@@ -0,0 +1,44 @@
1
+ import { withTooltip as e } from "../../hocs/with-tooltip/with-tooltip.js";
2
+ import './Avatar.css';/* empty css */
3
+ import { LinkTarget as t } from "../../../enums/link-target.js";
4
+ import { getClassName as n } from "../../../utils/get-class-name.js";
5
+ import { useState as r } from "react";
6
+ import { jsx as i } from "react/jsx-runtime";
7
+ var a = e(({ name: e, imageUrl: a, link: o, linkTarget: s = t.Self, className: c, tooltip: l, ...u }) => {
8
+ let [d, f] = r(!1), p = n(["cl-avatar", c]), m = d ? /* @__PURE__ */ i("span", {
9
+ className: "cl-avatar__fallback",
10
+ role: "img",
11
+ "aria-label": e,
12
+ children: /* @__PURE__ */ i("span", {
13
+ "aria-hidden": "true",
14
+ children: e.charAt(0).toUpperCase()
15
+ })
16
+ }) : /* @__PURE__ */ i("img", {
17
+ className: "cl-avatar__image",
18
+ src: a,
19
+ alt: e,
20
+ onError: () => f(!0)
21
+ });
22
+ if (o) {
23
+ let n = s === t.Blank;
24
+ return /* @__PURE__ */ i("span", {
25
+ className: p,
26
+ ...u,
27
+ children: /* @__PURE__ */ i("a", {
28
+ href: o,
29
+ target: s,
30
+ rel: n ? "noopener noreferrer" : void 0,
31
+ "aria-label": n ? `${e} (opens in new window)` : e,
32
+ className: "cl-avatar__link",
33
+ children: m
34
+ })
35
+ });
36
+ }
37
+ return /* @__PURE__ */ i("span", {
38
+ className: p,
39
+ ...u,
40
+ children: m
41
+ });
42
+ });
43
+ //#endregion
44
+ export { a as default };
@@ -1,43 +1,43 @@
1
- import { getClassName as e } from "../../../utils/get-class-name.js";
2
- import { withTooltip as t } from "../../hocs/with-tooltip/with-tooltip.js";
1
+ import { withTooltip as e } from "../../hocs/with-tooltip/with-tooltip.js";
2
+ import { ButtonView as t } from "../../../enums/button-view.js";
3
+ import { getClassName as n } from "../../../utils/get-class-name.js";
3
4
  import './Button.css';/* empty css */
4
- import { ButtonView as n } from "../../../enums/button-view.js";
5
5
  import { IconButton as r } from "./icon-button/IconButton2.js";
6
6
  import { InnerButton as i } from "./inner-button/InnerButton2.js";
7
7
  import { PrimaryButton as a } from "./primary-button/PrimaryButton2.js";
8
8
  import { SecondaryButton as o } from "./secondary-button/SecondaryButton2.js";
9
9
  import { jsx as s } from "react/jsx-runtime";
10
- var c = t(({ text: t, icon: c, tooltip: l, extended: u = !1, view: d = n.Primary, label: f, className: p, iconSize: m, ...h }) => {
11
- let g = e([
10
+ var c = e(({ text: e, icon: c, tooltip: l, extended: u = !1, view: d = t.Primary, label: f, className: p, iconSize: m, ...h }) => {
11
+ let g = n([
12
12
  p,
13
13
  "cl-button",
14
14
  { "cl-button_extended": u }
15
15
  ]);
16
16
  switch (d) {
17
- case n.Primary: return /* @__PURE__ */ s(a, {
17
+ case t.Primary: return /* @__PURE__ */ s(a, {
18
18
  className: g,
19
19
  icon: c,
20
- text: t,
20
+ text: e,
21
21
  "aria-label": f,
22
22
  iconSize: m,
23
23
  ...h
24
24
  });
25
- case n.Secondary: return /* @__PURE__ */ s(o, {
25
+ case t.Secondary: return /* @__PURE__ */ s(o, {
26
26
  className: g,
27
27
  icon: c,
28
- text: t,
28
+ text: e,
29
29
  "aria-label": f,
30
30
  iconSize: m,
31
31
  ...h
32
32
  });
33
- case n.Icon: return /* @__PURE__ */ s(r, {
33
+ case t.Icon: return /* @__PURE__ */ s(r, {
34
34
  label: f,
35
35
  icon: c,
36
36
  iconSize: m,
37
37
  ...h,
38
38
  className: p
39
39
  });
40
- case n.Inner: return /* @__PURE__ */ s(i, {
40
+ case t.Inner: return /* @__PURE__ */ s(i, {
41
41
  label: f,
42
42
  icon: c,
43
43
  iconSize: m,
@@ -1,13 +1,13 @@
1
- import { getClassName as e } from "../../../../utils/get-class-name.js";
2
- import { ElementSize as t } from "../../../../enums/element-size.js";
1
+ import { ElementSize as e } from "../../../../enums/element-size.js";
2
+ import { getClassName as t } from "../../../../utils/get-class-name.js";
3
3
  import './IconButton.css';/* empty css */
4
4
  import n from "../../icon/Icon2.js";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  //#region src/components/atoms/button/icon-button/IconButton.tsx
7
- var i = ({ icon: i, className: a, label: o, iconSize: s = t.Medium, ...c }) => /* @__PURE__ */ r("button", {
7
+ var i = ({ icon: i, className: a, label: o, iconSize: s = e.Medium, ...c }) => /* @__PURE__ */ r("button", {
8
8
  ...c,
9
9
  "aria-label": o,
10
- className: e(["cl-icon-button", a]),
10
+ className: t(["cl-icon-button", a]),
11
11
  children: i && /* @__PURE__ */ r(n, {
12
12
  name: i,
13
13
  className: "cl-icon-button__icon",
@@ -1,11 +1,11 @@
1
- import { getClassName as e } from "../../../../utils/get-class-name.js";
2
- import { ElementSize as t } from "../../../../enums/element-size.js";
1
+ import { ElementSize as e } from "../../../../enums/element-size.js";
2
+ import { getClassName as t } from "../../../../utils/get-class-name.js";
3
3
  import './InnerButton.css';/* empty css */
4
4
  import n from "../../icon/Icon2.js";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  //#region src/components/atoms/button/inner-button/InnerButton.tsx
7
- var i = ({ onClick: i, label: a, icon: o, disabled: s, className: c, iconSize: l = t.Small, ...u }) => /* @__PURE__ */ r("button", {
8
- className: e(["cl-inner-button", c]),
7
+ var i = ({ onClick: i, label: a, icon: o, disabled: s, className: c, iconSize: l = e.Small, ...u }) => /* @__PURE__ */ r("button", {
8
+ className: t(["cl-inner-button", c]),
9
9
  onClick: i,
10
10
  "aria-label": a,
11
11
  type: "button",
@@ -1,12 +1,12 @@
1
- import { getClassName as e } from "../../../../utils/get-class-name.js";
2
- import { ElementSize as t } from "../../../../enums/element-size.js";
1
+ import { ElementSize as e } from "../../../../enums/element-size.js";
2
+ import { getClassName as t } from "../../../../utils/get-class-name.js";
3
3
  import './PrimaryButton.css';/* empty css */
4
4
  import n from "../../icon/Icon2.js";
5
5
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
6
  //#region src/components/atoms/button/primary-button/PrimaryButton.tsx
7
- var a = ({ icon: a, text: o, className: s, iconSize: c = t.Small, ...l }) => /* @__PURE__ */ i("button", {
7
+ var a = ({ icon: a, text: o, className: s, iconSize: c = e.Small, ...l }) => /* @__PURE__ */ i("button", {
8
8
  ...l,
9
- className: e(["cl-primary-button", s]),
9
+ className: t(["cl-primary-button", s]),
10
10
  children: [a && /* @__PURE__ */ r(n, {
11
11
  name: a,
12
12
  className: "cl-primary-button__icon",
@@ -1,12 +1,12 @@
1
- import { getClassName as e } from "../../../../utils/get-class-name.js";
2
- import { ElementSize as t } from "../../../../enums/element-size.js";
1
+ import { ElementSize as e } from "../../../../enums/element-size.js";
2
+ import { getClassName as t } from "../../../../utils/get-class-name.js";
3
3
  import './SecondaryButton.css';/* empty css */
4
4
  import n from "../../icon/Icon2.js";
5
5
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
6
  //#region src/components/atoms/button/secondary-button/SecondaryButton.tsx
7
- var a = ({ icon: a, text: o, className: s, iconSize: c = t.Small, ...l }) => /* @__PURE__ */ i("button", {
7
+ var a = ({ icon: a, text: o, className: s, iconSize: c = e.Small, ...l }) => /* @__PURE__ */ i("button", {
8
8
  ...l,
9
- className: e(["cl-secondary-button", s]),
9
+ className: t(["cl-secondary-button", s]),
10
10
  children: [a && /* @__PURE__ */ r(n, {
11
11
  name: a,
12
12
  className: "cl-secondary-button__icon",
@@ -1,10 +1,10 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { useCallback as t } from "react";
1
+ import { useCallback as e } from "react";
2
+ import { jsx as t } from "react/jsx-runtime";
3
3
  //#region src/components/atoms/editable-text/EditView.tsx
4
- var n = ({ multiline: n, value: r, placeholder: i, onChange: a, onBlur: o, onKeyDown: s, className: c, inputRef: l, ...u }) => /* @__PURE__ */ e(n ? "textarea" : "input", {
4
+ var n = ({ multiline: n, value: r, placeholder: i, onChange: a, onBlur: o, onKeyDown: s, className: c, inputRef: l, ...u }) => /* @__PURE__ */ t(n ? "textarea" : "input", {
5
5
  ref: l,
6
6
  value: r,
7
- onChange: t((e) => {
7
+ onChange: e((e) => {
8
8
  a(e.target.value);
9
9
  }, [a]),
10
10
  onBlur: o,
@@ -5,17 +5,17 @@ import { ReadView as n } from "./ReadView.js";
5
5
  import { useEditModeState as r } from "./useEditModeState.js";
6
6
  import { useInputFocus as i } from "./useInputFocus.js";
7
7
  import { useValueState as a } from "./useValueState.js";
8
- import { jsx as o } from "react/jsx-runtime";
9
- import { useCallback as s, useRef as c } from "react";
8
+ import { useCallback as o, useRef as s } from "react";
9
+ import { jsx as c } from "react/jsx-runtime";
10
10
  //#region src/components/atoms/editable-text/EditableText.tsx
11
11
  var l = ({ value: l, isEditMode: u, onChange: d, onClick: f, className: p, autoSelectTextOnEditMode: m = !1, multiline: h = !1, placeholder: g = "Click to edit...", readOnly: _ = !1, ...v }) => {
12
- let y = c(null), { editMode: b, enterEditMode: x, exitEditMode: S } = r(u, _), { internalValue: C, updateValue: w, commitValue: T, resetValue: E } = a(l, d);
12
+ let y = s(null), { editMode: b, enterEditMode: x, exitEditMode: S } = r(u, _), { internalValue: C, updateValue: w, commitValue: T, resetValue: E } = a(l, d);
13
13
  i(y, b, m, _);
14
- let D = s((e) => {
14
+ let D = o((e) => {
15
15
  f?.(e), x();
16
- }, [f, x]), O = s(() => {
16
+ }, [f, x]), O = o(() => {
17
17
  S(), T();
18
- }, [S, T]), k = s((e) => {
18
+ }, [S, T]), k = o((e) => {
19
19
  e.key === "Enter" && !h && (e.preventDefault(), O()), e.key === "Escape" && (E(), S());
20
20
  }, [
21
21
  h,
@@ -31,7 +31,7 @@ var l = ({ value: l, isEditMode: u, onChange: d, onClick: f, className: p, autoS
31
31
  "cl-editable-text_empty": !C
32
32
  }
33
33
  ]);
34
- return b && !_ ? /* @__PURE__ */ o(t, {
34
+ return b && !_ ? /* @__PURE__ */ c(t, {
35
35
  multiline: h,
36
36
  value: C,
37
37
  placeholder: g,
@@ -41,7 +41,7 @@ var l = ({ value: l, isEditMode: u, onChange: d, onClick: f, className: p, autoS
41
41
  className: A,
42
42
  inputRef: y,
43
43
  ...v
44
- }) : /* @__PURE__ */ o(n, {
44
+ }) : /* @__PURE__ */ c(n, {
45
45
  value: C,
46
46
  placeholder: g,
47
47
  onClick: D,
@@ -1,21 +1,21 @@
1
- import { getClassName as e } from "../../../utils/get-class-name.js";
2
- import { ElementSize as t } from "../../../enums/element-size.js";
1
+ import { ElementSize as e } from "../../../enums/element-size.js";
2
+ import { getClassName as t } from "../../../utils/get-class-name.js";
3
3
  import './Icon.css';/* empty css */
4
4
  import { jsx as n } from "react/jsx-runtime";
5
5
  //#region src/components/atoms/icon/Icon.tsx
6
- var r = ({ name: r, testId: i, className: a, hidden: o, size: s = t.Medium, ...c }) => r ? /* @__PURE__ */ n("span", {
6
+ var r = ({ name: r, testId: i, className: a, hidden: o, size: s = e.Medium, ...c }) => r ? /* @__PURE__ */ n("span", {
7
7
  "data-testid": i,
8
- className: e([
8
+ className: t([
9
9
  a,
10
10
  "cl-icon",
11
11
  r,
12
12
  {
13
- "cl-icon_extra-small": s === t.ExtraSmall,
14
- "cl-icon_small": s === t.Small,
15
- "cl-icon_medium": s === t.Medium,
16
- "cl-icon_large": s === t.Large,
17
- "cl-icon_xlarge": s === t.ExtraLarge,
18
- "cl-icon_2xlarge": s === t.ExtraExtraLarge
13
+ "cl-icon_extra-small": s === e.ExtraSmall,
14
+ "cl-icon_small": s === e.Small,
15
+ "cl-icon_medium": s === e.Medium,
16
+ "cl-icon_large": s === e.Large,
17
+ "cl-icon_xlarge": s === e.ExtraLarge,
18
+ "cl-icon_2xlarge": s === e.ExtraExtraLarge
19
19
  }
20
20
  ]),
21
21
  "aria-hidden": o,
@@ -2,11 +2,13 @@ import { FC } from 'react';
2
2
  type Props = {
3
3
  src: string;
4
4
  alt: string;
5
+ srcSet?: string;
5
6
  sizes?: string;
6
7
  width?: number | string;
7
8
  height?: number | string;
8
9
  loading?: 'lazy' | 'eager';
9
10
  decoding?: 'sync' | 'async' | 'auto';
11
+ aspectRatio?: string;
10
12
  onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
11
13
  };
12
14
  export declare const BasicImage: FC<Props>;
@@ -1,15 +1,10 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  //#region src/components/atoms/image/BasicImage.tsx
3
- var t = ({ src: t, alt: n, width: r, height: i, sizes: a, loading: o = "lazy", decoding: s = "async", onError: c }) => /* @__PURE__ */ e("img", {
4
- src: t,
3
+ var t = ({ aspectRatio: t, alt: n, ...r }) => /* @__PURE__ */ e("img", {
4
+ ...r,
5
5
  alt: n,
6
- width: r,
7
- height: i,
8
- loading: o,
9
- decoding: s,
10
- sizes: a,
11
- className: "cl-image__img",
12
- onError: c
6
+ style: { aspectRatio: t },
7
+ className: "cl-image__img"
13
8
  });
14
9
  //#endregion
15
10
  export { t as BasicImage };
@@ -1 +1 @@
1
- .cl-image{object-fit:cover;border-radius:var(--cl-border-radius)}.cl-image__img{border-radius:var(--cl-border-radius);max-width:100%;height:auto}.cl-image__picture{object-fit:cover;border-radius:var(--cl-border-radius);display:block}.cl-image__fallback{flex-direction:column;justify-content:center;align-items:center;height:100%;display:flex}.cl-image__fallback-icon{width:148px;height:148px}.cl-image__fallback-icon:before{font-size:6rem}.cl-image__fallback-text{text-align:center;padding-top:var(--cl-s-gap);color:var(--cl-base-font-color);font-family:var(--cl-core-font);font-size:var(--cl-typography-small-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5}@media (width>=640px){.cl-image__fallback-text{font-size:var(--cl-typography-small-tablet)}}@media (width>=1024px){.cl-image__fallback-text{font-size:var(--cl-typography-small-desktop)}}
1
+ .cl-image{border-radius:var(--cl-border-radius);line-height:0}.cl-image__img{object-fit:cover;border-radius:inherit;max-width:100%;height:auto;display:block}.cl-image__picture{object-fit:cover;border-radius:inherit;display:block}.cl-image__fallback{flex-direction:column;justify-content:center;align-items:center;height:100%;display:flex}.cl-image__fallback-icon{width:148px;height:148px}.cl-image__fallback-icon:before{font-size:6rem}.cl-image__fallback-text{text-align:center;padding-top:var(--cl-s-gap);color:var(--cl-base-font-color);font-family:var(--cl-core-font);font-size:var(--cl-typography-small-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5}@media (width>=640px){.cl-image__fallback-text{font-size:var(--cl-typography-small-tablet)}}@media (width>=1024px){.cl-image__fallback-text{font-size:var(--cl-typography-small-desktop)}}
@@ -1,24 +1,24 @@
1
- import { getClassName as e } from "../../../utils/get-class-name.js";
2
- import { withFigureCaption as t } from "../../hocs/with-figure-caption/with-figure-caption.js";
1
+ import { withFigureCaption as e } from "../../hocs/with-figure-caption/with-figure-caption.js";
2
+ import { getClassName as t } from "../../../utils/get-class-name.js";
3
3
  import { BasicImage as n } from "./BasicImage.js";
4
4
  import { FallbackImage as r } from "./FallBackImage.js";
5
5
  import './Image.css';/* empty css */
6
6
  import { ResponsivePicture as i } from "./ResponsivePicture.js";
7
- import { jsx as a } from "react/jsx-runtime";
8
- import { useState as o } from "react";
9
- var s = t(({ alt: t, sources: s = [], className: c, decorative: l = !1, onError: u, ...d }) => {
10
- let [f, p] = o(!1), m = e(["cl-image", c]), h = s.length > 0, g = l ? "" : t, _ = (e) => {
11
- p(!0), u?.(e);
7
+ import { useState as a } from "react";
8
+ import { jsx as o } from "react/jsx-runtime";
9
+ var s = e(({ alt: e, sources: s = [], decorative: c = !1, onError: l, className: u, ...d }) => {
10
+ let [f, p] = a(!1), m = s.length > 0, h = c ? "" : e, g = t(["cl-image", u]), _ = (e) => {
11
+ p(!0), l?.(e);
12
12
  };
13
- return f ? /* @__PURE__ */ a(r, {}) : h ? /* @__PURE__ */ a(i, {
14
- alt: g,
15
- sources: s,
16
- onError: _,
17
- ...d
18
- }) : /* @__PURE__ */ a("div", {
19
- className: m,
20
- children: /* @__PURE__ */ a(n, {
21
- alt: g,
13
+ return f ? /* @__PURE__ */ o(r, {}) : /* @__PURE__ */ o("div", {
14
+ className: g,
15
+ children: m ? /* @__PURE__ */ o(i, {
16
+ alt: h,
17
+ sources: s,
18
+ onError: _,
19
+ ...d
20
+ }) : /* @__PURE__ */ o(n, {
21
+ alt: h,
22
22
  onError: _,
23
23
  ...d
24
24
  })
@@ -9,6 +9,7 @@ type Props = {
9
9
  height?: number | string;
10
10
  loading?: 'lazy' | 'eager';
11
11
  decoding?: 'sync' | 'async' | 'auto';
12
+ aspectRatio?: string;
12
13
  onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
13
14
  };
14
15
  export declare const ResponsivePicture: FC<Props>;
@@ -1,13 +1,20 @@
1
1
  import { BasicImage as e } from "./BasicImage.js";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
3
  //#region src/components/atoms/image/ResponsivePicture.tsx
4
- var r = ({ sources: r = [], ...i }) => /* @__PURE__ */ n("picture", {
5
- className: "cl-image__picture",
6
- children: [r.map((e) => /* @__PURE__ */ t("source", {
7
- srcSet: e.descriptor ? `${e.src} ${e.descriptor}` : e.src,
8
- media: e.media,
9
- type: e.type
10
- }, e.src)), /* @__PURE__ */ t(e, { ...i })]
11
- });
4
+ var r = (e) => "media" in e && !!e.media, i = (e) => "descriptor" in e && !!e.descriptor, a = ({ sources: a = [], sizes: o, ...s }) => {
5
+ let c = a.filter(r), l = a.filter(i), u = l.length > 0 ? l.map((e) => `${e.src} ${e.descriptor}`).join(", ") : void 0;
6
+ return /* @__PURE__ */ n("picture", {
7
+ className: "cl-image__picture",
8
+ children: [c.map((e) => /* @__PURE__ */ t("source", {
9
+ srcSet: e.src,
10
+ media: e.media,
11
+ type: e.type
12
+ }, e.src)), /* @__PURE__ */ t(e, {
13
+ srcSet: u,
14
+ sizes: u ? o : void 0,
15
+ ...s
16
+ })]
17
+ });
18
+ };
12
19
  //#endregion
13
- export { r as ResponsivePicture };
20
+ export { a as ResponsivePicture };
@@ -1,3 +1,4 @@
1
+ export { default as Avatar } from './avatar/Avatar';
1
2
  export { default as Button } from './button/Button';
2
3
  export { default as EditableText } from './editable-text/EditableText';
3
4
  export { default as ErrorMessage } from './error-message/ErrorMessage';
@@ -8,4 +9,5 @@ export { default as Input } from './input/Input';
8
9
  export { default as Label } from './label/Label';
9
10
  export { default as Link } from './link/Link';
10
11
  export { default as Portal } from './portal/Portal';
12
+ export { default as Tag } from './tag/Tag';
11
13
  export { default as Tooltip } from './tooltip/Tooltip';
@@ -1,13 +1,13 @@
1
1
  import './Input.css';/* empty css */
2
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
3
- import { forwardRef as n } from "react";
4
- var r = n(({ children: n, ...r }, i) => /* @__PURE__ */ t("div", {
2
+ import { forwardRef as e } from "react";
3
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
+ var r = e(({ children: e, ...r }, i) => /* @__PURE__ */ n("div", {
5
5
  className: "cl-input__wrapper",
6
- children: [/* @__PURE__ */ e("input", {
6
+ children: [/* @__PURE__ */ t("input", {
7
7
  ...r,
8
8
  className: "cl-input__field",
9
9
  ref: i
10
- }), n]
10
+ }), e]
11
11
  }));
12
12
  //#endregion
13
13
  export { r as default };
@@ -1,16 +1,16 @@
1
- import { getClassName as e } from "../../../utils/get-class-name.js";
2
- import { ElementSize as t } from "../../../enums/element-size.js";
1
+ import { ElementSize as e } from "../../../enums/element-size.js";
2
+ import { getClassName as t } from "../../../utils/get-class-name.js";
3
3
  import n from "../icon/Icon2.js";
4
4
  import './Label.css';/* empty css */
5
5
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
6
  //#region src/components/atoms/label/Label.tsx
7
- var a = ({ label: a, required: o, inputId: s, icon: c, iconPosition: l, isTextHidden: u = !1, iconSize: d = t.ExtraSmall, disabled: f = !1, className: p, testId: m }) => {
7
+ var a = ({ label: a, required: o, inputId: s, icon: c, iconPosition: l, isTextHidden: u = !1, iconSize: d = e.ExtraSmall, disabled: f = !1, className: p, testId: m }) => {
8
8
  let h = !!c && l === "left", g = !!c && l === "right", _ = /* @__PURE__ */ r(n, {
9
9
  name: c,
10
10
  size: d
11
11
  });
12
12
  return /* @__PURE__ */ i("label", {
13
- className: e([
13
+ className: t([
14
14
  "cl-label",
15
15
  p,
16
16
  { "cl-label_disabled": f }
@@ -1,11 +1,11 @@
1
- import { getClassName as e } from "../../../utils/get-class-name.js";
2
- import { ElementSize as t } from "../../../enums/element-size.js";
1
+ import { ElementSize as e } from "../../../enums/element-size.js";
2
+ import { getClassName as t } from "../../../utils/get-class-name.js";
3
3
  import n from "../icon/Icon2.js";
4
4
  import './Link.css';/* empty css */
5
5
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
6
  //#region src/components/atoms/link/Link.tsx
7
7
  var a = ({ href: a, children: o, icon: s, iconPosition: c = "left", external: l = !1, disabled: u = !1, className: d, target: f, ...p }) => {
8
- let m = e([
8
+ let m = t([
9
9
  "cl-link",
10
10
  d,
11
11
  { "cl-link_disabled": u }
@@ -13,7 +13,7 @@ var a = ({ href: a, children: o, icon: s, iconPosition: c = "left", external: l
13
13
  name: s,
14
14
  className: "cl-link__icon",
15
15
  hidden: !0,
16
- size: t.Small
16
+ size: e.Small
17
17
  }) : null, v = s && c === "left", y = s && c === "right";
18
18
  return /* @__PURE__ */ i("a", {
19
19
  href: a,
@@ -0,0 +1 @@
1
+ .cl-tag{padding:var(--cl-xs-gap) var(--cl-m-gap);border-radius:var(--cl-l-gap);background-color:var(--cl-tag-color,var(--cl-surface-tonal-a0));white-space:nowrap;text-wrap:wrap;text-align:center;text-overflow:ellipsis;max-width:30vw;font-family:var(--cl-core-font);font-size:var(--cl-typography-small-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5;display:inline-block;overflow:hidden}@media (width>=640px){.cl-tag{font-size:var(--cl-typography-small-tablet);padding:var(--cl-s-gap) var(--cl-l-gap);max-width:20vw}}@media (width>=1024px){.cl-tag{font-size:var(--cl-typography-small-desktop);max-width:10vw}}
@@ -0,0 +1,7 @@
1
+ import { TagProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const Tag: FC<TagProps & {
4
+ tooltip?: string;
5
+ visibleOn?: "hover" | "click" | "focus" | "contextmenu";
6
+ }>;
7
+ export default Tag;
@@ -0,0 +1,15 @@
1
+ import { withTooltip as e } from "../../hocs/with-tooltip/with-tooltip.js";
2
+ import { getClassName as t } from "../../../utils/get-class-name.js";
3
+ import './Tag.css';/* empty css */
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ var r = e(({ name: e, color: r, className: i, style: a, tooltip: o, ...s }) => /* @__PURE__ */ n("span", {
6
+ className: t(["cl-tag", i]),
7
+ style: {
8
+ ...a,
9
+ ...r ? { "--cl-tag-color": r } : {}
10
+ },
11
+ ...s,
12
+ children: e
13
+ }));
14
+ //#endregion
15
+ export { r as default };
@@ -1,25 +1,26 @@
1
- import { getClassName as e } from "../../../utils/get-class-name.js";
2
- import { SemanticColor as t } from "../../../enums/semantic-color.js";
3
- import { TooltipContainer as n } from "../../../enums/tooltip-container.js";
1
+ import { SemanticColor as e } from "../../../enums/semantic-color.js";
2
+ import { TooltipContainer as t } from "../../../enums/tooltip-container.js";
3
+ import { getClassName as n } from "../../../utils/get-class-name.js";
4
4
  import r from "../portal/Portal.js";
5
5
  import './Tooltip.css';/* empty css */
6
6
  import { useTooltipController as i } from "./Tooltip.controller.js";
7
7
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
8
  //#region src/components/atoms/tooltip/Tooltip.tsx
9
- var s = ({ children: s, tooltipContent: c, id: l, style: u, className: d, containerTag: f = n.Span, visibleOn: p = "hover", autoClose: m = !1, autoCloseDelay: h = 3e3, color: g = t.Default, ..._ }) => {
9
+ var s = ({ children: s, tooltipContent: c, id: l, style: u, className: d, containerTag: f = t.Span, visibleOn: p = "hover", autoClose: m = !1, autoCloseDelay: h = 3e3, color: g = e.Default, ..._ }) => {
10
10
  let v = f, { openTooltip: y, closeTooltip: b, toggleTooltip: x, handleContextMenu: S, elementId: C, top: w, left: T, isOpened: E, wrapperRef: D, tooltipRef: O } = i({
11
11
  id: l,
12
12
  autoClose: m,
13
13
  autoCloseDelay: h
14
- }), k = e([
14
+ }), k = n([
15
15
  "cl-tooltip",
16
16
  d,
17
- { [`cl-tooltip_${g}`]: g !== t.Default }
17
+ { [`cl-tooltip_${g}`]: g !== e.Default }
18
18
  ]);
19
19
  return /* @__PURE__ */ o(v, {
20
20
  style: {
21
21
  position: "relative",
22
- cursor: "pointer"
22
+ cursor: "pointer",
23
+ lineHeight: 0
23
24
  },
24
25
  onClick: p === "click" ? x : void 0,
25
26
  onMouseOver: p === "hover" ? y : void 0,
@@ -29,7 +30,7 @@ var s = ({ children: s, tooltipContent: c, id: l, style: u, className: d, contai
29
30
  onContextMenu: p === "contextmenu" ? (e) => S(e) : void 0,
30
31
  tabIndex: -1,
31
32
  ref: D,
32
- "aria-describedby": C,
33
+ "aria-describedby": E ? C : void 0,
33
34
  children: [s, E && /* @__PURE__ */ a(r, { children: /* @__PURE__ */ a("div", {
34
35
  style: {
35
36
  ...u,
@@ -1,21 +1,21 @@
1
1
  import { CL_DARK_THEME_CLASS as e, CL_LIGHT_THEME_CLASS as t, ThemeContext as n } from "./ThemeContext.js";
2
- import '../../../styles/main.css';import '../../../styles/icons.css';/* empty css */
2
+ import '../../../styles/icons.css';import '../../../styles/main.css';/* empty css */
3
3
  /* empty css */
4
- import { jsx as r } from "react/jsx-runtime";
5
- import { useEffect as i, useMemo as a, useState as o } from "react";
4
+ import { useEffect as r, useMemo as i, useState as a } from "react";
5
+ import { jsx as o } from "react/jsx-runtime";
6
6
  //#region src/components/contexts/theme/ThemeProvider.tsx
7
7
  var s = ({ children: s, injectedMode: c }) => {
8
- let [l, u] = o(t);
9
- i(() => {
8
+ let [l, u] = a(t);
9
+ r(() => {
10
10
  l && typeof l == "string" && (document.body.classList.remove(t, e), document.body.classList.add(l));
11
- }, [l]), i(() => {
11
+ }, [l]), r(() => {
12
12
  c && typeof c == "string" && (document.body.classList.remove(t, e), document.body.classList.add(c));
13
13
  }, [c]);
14
- let d = a(() => ({
14
+ let d = i(() => ({
15
15
  mode: l,
16
16
  setMode: u
17
17
  }), [l]);
18
- return /* @__PURE__ */ r(n.Provider, {
18
+ return /* @__PURE__ */ o(n.Provider, {
19
19
  value: d,
20
20
  children: s
21
21
  });
@@ -1,8 +1,8 @@
1
1
  import e from "../../atoms/error-message/ErrorMessage2.js";
2
- import { jsx as t } from "react/jsx-runtime";
3
- import { Component as n, useId as r } from "react";
2
+ import { Component as t, useId as n } from "react";
3
+ import { jsx as r } from "react/jsx-runtime";
4
4
  //#region src/components/hocs/with-error-boundary/with-error-boundary.tsx
5
- var i = class extends n {
5
+ var i = class extends t {
6
6
  constructor(e) {
7
7
  super(e), this.state = { hasError: !1 };
8
8
  }
@@ -13,7 +13,7 @@ var i = class extends n {
13
13
  this.props.onError?.();
14
14
  }
15
15
  render() {
16
- return this.state.hasError ? /* @__PURE__ */ t(e, {
16
+ return this.state.hasError ? /* @__PURE__ */ r(e, {
17
17
  errorId: this.props.errorId,
18
18
  message: this.props.errorMessage,
19
19
  visible: !0
@@ -21,11 +21,11 @@ var i = class extends n {
21
21
  }
22
22
  };
23
23
  function a(e) {
24
- return ({ errorMessage: n, onError: a, ...o }) => /* @__PURE__ */ t(i, {
25
- errorId: `cl-error-boundary-${r().replace(/:/g, "")}`,
26
- errorMessage: n,
24
+ return ({ errorMessage: t, onError: a, ...o }) => /* @__PURE__ */ r(i, {
25
+ errorId: `cl-error-boundary-${n().replaceAll(":", "")}`,
26
+ errorMessage: t,
27
27
  onError: a,
28
- children: /* @__PURE__ */ t(e, { ...o })
28
+ children: /* @__PURE__ */ r(e, { ...o })
29
29
  });
30
30
  }
31
31
  //#endregion