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
@@ -1,12 +1,12 @@
1
- import { getClassName as e } from "../../../utils/get-class-name.js";
2
- import { ButtonView as t } from "../../../enums/button-view.js";
3
- import { IconName as n } from "../../../enums/icon-name.js";
1
+ import { ButtonView as e } from "../../../enums/button-view.js";
2
+ import { IconName as t } from "../../../enums/icon-name.js";
3
+ import { getClassName as n } from "../../../utils/get-class-name.js";
4
4
  import r from "../../atoms/button/Button2.js";
5
5
  import { FormContext as i } from "../../contexts/form/FormContext.js";
6
6
  import { useFormController as a } from "./Form.controller.js";
7
7
  import './Form.css';/* empty css */
8
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
9
- import { useMemo as c } from "react";
8
+ import { useMemo as o } from "react";
9
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
10
10
  //#region src/components/organisms/form/Form.tsx
11
11
  var l = ({ children: l, initialValues: u, onReset: d, onSubmit: f, onClickSubmit: p, hasReset: m = !0, className: h, ...g }) => {
12
12
  let { handleInputChange: _, handleSubmit: v, handleReset: y, resetSignal: b, valid: x } = a({
@@ -14,7 +14,7 @@ var l = ({ children: l, initialValues: u, onReset: d, onSubmit: f, onClickSubmit
14
14
  onReset: d,
15
15
  onSubmit: f,
16
16
  onClickSubmit: p
17
- }), S = e(["cl-form", h]), C = c(() => ({
17
+ }), S = n(["cl-form", h]), C = o(() => ({
18
18
  onChangeFormInput: _,
19
19
  initialValues: u,
20
20
  resetSignal: b
@@ -23,24 +23,24 @@ var l = ({ children: l, initialValues: u, onReset: d, onSubmit: f, onClickSubmit
23
23
  u,
24
24
  b
25
25
  ]);
26
- return /* @__PURE__ */ o("form", {
26
+ return /* @__PURE__ */ s("form", {
27
27
  onSubmit: v,
28
28
  onReset: y,
29
29
  ...g,
30
30
  className: S,
31
- children: /* @__PURE__ */ s(i.Provider, {
31
+ children: /* @__PURE__ */ c(i.Provider, {
32
32
  value: C,
33
- children: [l, /* @__PURE__ */ s("div", {
33
+ children: [l, /* @__PURE__ */ c("div", {
34
34
  className: "cl-form__buttons",
35
- children: [m && /* @__PURE__ */ o(r, {
35
+ children: [m && /* @__PURE__ */ s(r, {
36
36
  type: "reset",
37
37
  text: "Reset",
38
- icon: n.Delete,
39
- view: t.Secondary
40
- }), /* @__PURE__ */ o(r, {
38
+ icon: t.Delete,
39
+ view: e.Secondary
40
+ }), /* @__PURE__ */ s(r, {
41
41
  type: "submit",
42
42
  text: "Submit",
43
- icon: n.ArrowRight,
43
+ icon: t.ArrowRight,
44
44
  extended: !m,
45
45
  disabled: !x
46
46
  })]
@@ -4,7 +4,7 @@ var e = (e) => {
4
4
  let t, n = 0;
5
5
  for (let r of e) {
6
6
  let e = r.descriptor?.trim();
7
- if (e && e.endsWith("w")) {
7
+ if (e?.endsWith("w")) {
8
8
  let i = e.slice(0, -1), a = Number.parseInt(i, 10);
9
9
  !Number.isNaN(a) && a > n && (n = a, t = r);
10
10
  }
@@ -26,4 +26,4 @@ var e = (e) => {
26
26
  };
27
27
  };
28
28
  //#endregion
29
- export { t as getFullscreenImageProps };
29
+ export { t as getFullscreenImageProps, e as getLargestImageSource };
@@ -5,11 +5,11 @@ import './Gallery.css';/* empty css */
5
5
  import r from "./gallery-image-item/GalleryImageItem2.js";
6
6
  import { useCarouselScroll as i } from "./hooks/use-carousel-scroll.js";
7
7
  import { useFullscreenViewer as a } from "./hooks/use-fullscreen-viewer.js";
8
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
9
- import { useRef as c } from "react";
8
+ import { useRef as o } from "react";
9
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
10
10
  //#region src/components/organisms/gallery/Gallery.tsx
11
11
  var l = ({ images: l = [], layout: u = "grid", columns: d = 3, rows: f, gap: p, label: m, className: h, title: g, enableFullscreen: _ = !1, ...v }) => {
12
- let y = c(null), { isViewerOpen: b, currentImageIndex: x, openViewer: S, closeViewer: C, handleNavigate: w } = a(), { showPrev: T, showNext: E, scrollForward: D, scrollBackward: O } = i(y, u), k = e(["cl-gallery", h]), A = e([
12
+ let y = o(null), { isViewerOpen: b, currentImageIndex: x, openViewer: S, closeViewer: C, handleNavigate: w } = a(), { showPrev: T, showNext: E, scrollForward: D, scrollBackward: O } = i(y, u), k = e(["cl-gallery", h]), A = e([
13
13
  "cl-gallery__container",
14
14
  { "cl-gallery__container_grid": u === "grid" },
15
15
  { "cl-gallery__container_masonry": u === "masonry" },
@@ -19,31 +19,31 @@ var l = ({ images: l = [], layout: u = "grid", columns: d = 3, rows: f, gap: p,
19
19
  "--gallery-rows": f,
20
20
  "--gallery-gap": p
21
21
  };
22
- return /* @__PURE__ */ s("section", {
22
+ return /* @__PURE__ */ c("section", {
23
23
  className: k,
24
24
  "aria-label": m ?? g ?? "Image gallery",
25
25
  title: g,
26
26
  ...v,
27
27
  children: [
28
- /* @__PURE__ */ o("div", {
28
+ /* @__PURE__ */ s("div", {
29
29
  ref: y,
30
30
  className: A,
31
31
  style: j,
32
32
  tabIndex: u === "carousel" ? 0 : void 0,
33
- children: l.map((e, t) => /* @__PURE__ */ o(r, {
33
+ children: l.map((e, t) => /* @__PURE__ */ s(r, {
34
34
  item: e,
35
35
  index: t,
36
36
  enableFullscreen: _,
37
37
  onOpenViewer: S
38
38
  }, e.src))
39
39
  }),
40
- u === "carousel" && /* @__PURE__ */ o(t, {
40
+ u === "carousel" && /* @__PURE__ */ s(t, {
41
41
  showPrev: T,
42
42
  showNext: E,
43
43
  onScrollBackward: O,
44
44
  onScrollForward: D
45
45
  }),
46
- _ && /* @__PURE__ */ o(n, {
46
+ _ && /* @__PURE__ */ s(n, {
47
47
  images: l,
48
48
  currentIndex: x,
49
49
  isOpen: b,
@@ -7,11 +7,11 @@ import './FullscreenViewer.css';/* empty css */
7
7
  import { getFullscreenImageProps as a } from "../Gallery.helpers.js";
8
8
  import o from "../viewer-close-button/ViewerCloseButton2.js";
9
9
  import s from "../viewer-overlay/ViewerOverlay2.js";
10
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
11
- import { useEffect as u, useMemo as d, useRef as f } from "react";
10
+ import { useEffect as c, useMemo as l, useRef as u } from "react";
11
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
12
12
  //#region src/components/organisms/gallery/full-screen-viewer/FullscreenViewer.tsx
13
13
  var p = ({ images: p, currentIndex: m, isOpen: h, onClose: g, onNavigate: _ }) => {
14
- let v = f(null), y = n(h, 300), b = y && !h;
14
+ let v = u(null), y = n(h, 300), b = y && !h;
15
15
  i({
16
16
  modalRef: v,
17
17
  isOpened: h
@@ -19,7 +19,7 @@ var p = ({ images: p, currentIndex: m, isOpen: h, onClose: g, onNavigate: _ }) =
19
19
  keyCode: "Escape",
20
20
  ref: v,
21
21
  onKeyPress: g
22
- }), u(() => {
22
+ }), c(() => {
23
23
  let e = (e) => {
24
24
  e.code === "ArrowLeft" && m > 0 ? _(m - 1) : e.code === "ArrowRight" && m < p.length - 1 && _(m + 1);
25
25
  };
@@ -29,12 +29,12 @@ var p = ({ images: p, currentIndex: m, isOpen: h, onClose: g, onNavigate: _ }) =
29
29
  p.length,
30
30
  _
31
31
  ]);
32
- let x = p[m], S = d(() => x ? a(x) : null, [x]);
33
- return !y || !x || !S ? null : /* @__PURE__ */ c(t, { children: /* @__PURE__ */ l("div", {
32
+ let x = p[m], S = l(() => x ? a(x) : null, [x]);
33
+ return !y || !x || !S ? null : /* @__PURE__ */ d(t, { children: /* @__PURE__ */ f("div", {
34
34
  ref: v,
35
35
  className: e(["cl-fullscreen-viewer", { "cl-fullscreen-viewer_closing": b }]),
36
36
  "data-testid": "fullscreen-image-viewer",
37
- children: [/* @__PURE__ */ c(o, { onClose: g }), /* @__PURE__ */ c(s, {
37
+ children: [/* @__PURE__ */ d(o, { onClose: g }), /* @__PURE__ */ d(s, {
38
38
  fullscreenImageProps: S,
39
39
  caption: x.caption,
40
40
  currentIndex: m,
@@ -1,6 +1,6 @@
1
- import { getClassName as e } from "../../../../utils/get-class-name.js";
2
- import { ButtonView as t } from "../../../../enums/button-view.js";
3
- import { IconName as n } from "../../../../enums/icon-name.js";
1
+ import { ButtonView as e } from "../../../../enums/button-view.js";
2
+ import { IconName as t } from "../../../../enums/icon-name.js";
3
+ import { getClassName as n } from "../../../../utils/get-class-name.js";
4
4
  import r from "../../../atoms/button/Button2.js";
5
5
  import './ViewerNavigation.css';/* empty css */
6
6
  import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
@@ -10,16 +10,16 @@ var s = ({ currentIndex: s, totalImages: c, onNavigate: l }) => {
10
10
  l(s - 1);
11
11
  }, p = () => {
12
12
  l(s + 1);
13
- }, m = e(["cl-fullscreen-viewer__nav-button", "cl-fullscreen-viewer__nav-button_prev"]), h = e(["cl-fullscreen-viewer__nav-button", "cl-fullscreen-viewer__nav-button_next"]);
13
+ }, m = n(["cl-fullscreen-viewer__nav-button", "cl-fullscreen-viewer__nav-button_prev"]), h = n(["cl-fullscreen-viewer__nav-button", "cl-fullscreen-viewer__nav-button_next"]);
14
14
  return /* @__PURE__ */ o(i, { children: [u && /* @__PURE__ */ a(r, {
15
- view: t.Icon,
16
- icon: n.ChevronLeft,
15
+ view: e.Icon,
16
+ icon: t.ChevronLeft,
17
17
  label: "Previous image",
18
18
  onClick: f,
19
19
  className: m
20
20
  }), d && /* @__PURE__ */ a(r, {
21
- view: t.Icon,
22
- icon: n.ChevronRight,
21
+ view: e.Icon,
22
+ icon: t.ChevronRight,
23
23
  label: "Next image",
24
24
  onClick: p,
25
25
  className: h
@@ -1,5 +1,5 @@
1
- import { getClassName as e } from "../../../../utils/get-class-name.js";
2
- import { IconName as t } from "../../../../enums/icon-name.js";
1
+ import { IconName as e } from "../../../../enums/icon-name.js";
2
+ import { getClassName as t } from "../../../../utils/get-class-name.js";
3
3
  import n from "../../../atoms/label/Label2.js";
4
4
  import { useElementIds as r } from "../../../../hooks/use-element-ids/use-element-ids.js";
5
5
  import './GridCheckbox.css';/* empty css */
@@ -8,7 +8,7 @@ import { jsx as i, jsxs as a } from "react/jsx-runtime";
8
8
  var o = ({ name: o, label: s, disabled: c, required: l = !1, onChange: u, checked: d = !1, ...f }) => {
9
9
  let { elementId: p } = r(f?.id);
10
10
  return /* @__PURE__ */ a("div", {
11
- className: e(["cl-grid-checkbox", {
11
+ className: t(["cl-grid-checkbox", {
12
12
  "cl-grid-checkbox_disabled": !!c,
13
13
  "cl-grid-checkbox_checked": !!d
14
14
  }]),
@@ -27,7 +27,7 @@ var o = ({ name: o, label: s, disabled: c, required: l = !1, onChange: u, checke
27
27
  inputId: p,
28
28
  isTextHidden: !0,
29
29
  iconPosition: "left",
30
- icon: d ? t.CheckSquare : t.Square
30
+ icon: d ? e.CheckSquare : e.Square
31
31
  })]
32
32
  });
33
33
  };
@@ -3,4 +3,5 @@ export { default as Form } from './form/Form';
3
3
  export { default as Gallery } from './gallery/Gallery';
4
4
  export { default as Grid } from './grid/Grid';
5
5
  export { default as Menu } from './menu/Menu';
6
+ export { default as PreviewCard } from './preview-card/PreviewCard';
6
7
  export { default as Tabs } from './tabs/Tabs';
@@ -1,14 +1,14 @@
1
- import { getClassName as e } from "../../../utils/get-class-name.js";
2
- import { OrientationMode as t } from "../../../enums/orientation-mode.js";
1
+ import { OrientationMode as e } from "../../../enums/orientation-mode.js";
2
+ import { getClassName as t } from "../../../utils/get-class-name.js";
3
3
  import { MenuListItem as n } from "./list-item/MenuListItem2.js";
4
4
  import './Menu.css';/* empty css */
5
5
  import { jsx as r } from "react/jsx-runtime";
6
6
  //#region src/components/organisms/menu/Menu.tsx
7
- var i = ({ items: i = [], mode: a = t.Vertical, openedOn: o = "click", className: s, ...c }) => {
8
- let l = e([
7
+ var i = ({ items: i = [], mode: a = e.Vertical, openedOn: o = "click", className: s, ...c }) => {
8
+ let l = t([
9
9
  "cl-menu-bar",
10
10
  s,
11
- { "cl-menu-bar_vertical": a === t.Vertical }
11
+ { "cl-menu-bar_vertical": a === e.Vertical }
12
12
  ]);
13
13
  return /* @__PURE__ */ r("menu", {
14
14
  ...c,
@@ -1,14 +1,14 @@
1
- import { getClassName as e } from "../../../../utils/get-class-name.js";
2
- import { OrientationMode as t } from "../../../../enums/orientation-mode.js";
1
+ import { OrientationMode as e } from "../../../../enums/orientation-mode.js";
2
+ import { getClassName as t } from "../../../../utils/get-class-name.js";
3
3
  import { MenuLeaf as n } from "../leaf/MenuLeaf2.js";
4
4
  import { SubMenu as r } from "../sub-menu/SubMenu2.js";
5
5
  import './MenuListItem.css';/* empty css */
6
- import { jsx as i } from "react/jsx-runtime";
7
- import { useState as a } from "react";
6
+ import { useState as i } from "react";
7
+ import { jsx as a } from "react/jsx-runtime";
8
8
  //#region src/components/organisms/menu/list-item/MenuListItem.tsx
9
9
  var o = ({ item: s, mode: c, openedOn: l }) => {
10
- let u = !s?.nestedItems?.length, [d, f] = a(!1), p = e(["cl-sub-menu-bar", { "cl-sub-menu-bar_horizontal": c === t.Horizontal }]);
11
- return u ? /* @__PURE__ */ i(n, { item: s }) : /* @__PURE__ */ i(r, {
10
+ let u = !s?.nestedItems?.length, [d, f] = i(!1), p = t(["cl-sub-menu-bar", { "cl-sub-menu-bar_horizontal": c === e.Horizontal }]);
11
+ return u ? /* @__PURE__ */ a(n, { item: s }) : /* @__PURE__ */ a(r, {
12
12
  item: s,
13
13
  isSubMenuOpened: d,
14
14
  toggleSubMenu: () => {
@@ -22,11 +22,11 @@ var o = ({ item: s, mode: c, openedOn: l }) => {
22
22
  },
23
23
  mode: c,
24
24
  openedOn: l,
25
- children: /* @__PURE__ */ i("ul", {
25
+ children: /* @__PURE__ */ a("ul", {
26
26
  className: p,
27
27
  role: "menu",
28
28
  "aria-label": s.label,
29
- children: s?.nestedItems?.map((e) => /* @__PURE__ */ i(o, {
29
+ children: s?.nestedItems?.map((e) => /* @__PURE__ */ a(o, {
30
30
  item: e,
31
31
  mode: c,
32
32
  openedOn: l
@@ -1,25 +1,25 @@
1
- import { getClassName as e } from "../../../../utils/get-class-name.js";
2
- import { ElementSize as t } from "../../../../enums/element-size.js";
3
- import { IconName as n } from "../../../../enums/icon-name.js";
4
- import { OrientationMode as r } from "../../../../enums/orientation-mode.js";
1
+ import { ElementSize as e } from "../../../../enums/element-size.js";
2
+ import { IconName as t } from "../../../../enums/icon-name.js";
3
+ import { OrientationMode as n } from "../../../../enums/orientation-mode.js";
4
+ import { getClassName as r } from "../../../../utils/get-class-name.js";
5
5
  import i from "../../../atoms/icon/Icon2.js";
6
6
  import { useClickOutside as a } from "../../../../hooks/use-click-outside/use-click-outside.js";
7
7
  import './SubMenu.css';/* empty css */
8
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
9
- import { useRef as c } from "react";
8
+ import { useRef as o } from "react";
9
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
10
10
  //#region src/components/organisms/menu/sub-menu/SubMenu.tsx
11
11
  var l = ({ item: l, isSubMenuOpened: u, toggleSubMenu: d, closeSubMenu: f, openSubMenu: p, openedOn: m, mode: h, children: g }) => {
12
- let { icon: _, link: v, label: y } = l, b = c(null), x = c(null), S = e(["cl-sub-menu__icon", { "cl-sub-menu__icon_opened": u }]), C = v ? /* @__PURE__ */ s("a", {
12
+ let { icon: _, link: v, label: y } = l, b = o(null), x = o(null), S = r(["cl-sub-menu__icon", { "cl-sub-menu__icon_opened": u }]), C = v ? /* @__PURE__ */ c("a", {
13
13
  href: v,
14
14
  target: "_blank",
15
15
  rel: "noreferrer",
16
- children: [/* @__PURE__ */ o(i, {
16
+ children: [/* @__PURE__ */ s(i, {
17
17
  name: _,
18
- size: t.Small
18
+ size: e.Small
19
19
  }), y]
20
- }) : /* @__PURE__ */ s("span", { children: [/* @__PURE__ */ o(i, {
20
+ }) : /* @__PURE__ */ c("span", { children: [/* @__PURE__ */ s(i, {
21
21
  name: _,
22
- size: t.Small
22
+ size: e.Small
23
23
  }), y] }), w = (e) => {
24
24
  e.stopPropagation(), e.key === " " && d();
25
25
  };
@@ -27,9 +27,9 @@ var l = ({ item: l, isSubMenuOpened: u, toggleSubMenu: d, closeSubMenu: f, openS
27
27
  ref: b,
28
28
  dependentRef: x,
29
29
  onClickOutsideHandler: () => {
30
- h !== r.Vertical && f();
30
+ h !== n.Vertical && f();
31
31
  }
32
- }), /* @__PURE__ */ s("li", {
32
+ }), /* @__PURE__ */ c("li", {
33
33
  className: "cl-sub-menu",
34
34
  tabIndex: 0,
35
35
  role: "menuitem",
@@ -39,15 +39,15 @@ var l = ({ item: l, isSubMenuOpened: u, toggleSubMenu: d, closeSubMenu: f, openS
39
39
  onMouseEnter: m === "hover" ? p : void 0,
40
40
  onMouseLeave: m === "hover" ? f : void 0,
41
41
  ref: b,
42
- children: [/* @__PURE__ */ s("span", {
42
+ children: [/* @__PURE__ */ c("span", {
43
43
  className: "cl-sub-menu__text",
44
44
  ref: x,
45
45
  onClick: d,
46
46
  onKeyDown: w,
47
- children: [C, /* @__PURE__ */ o(i, {
48
- name: n.ChevronDown,
47
+ children: [C, /* @__PURE__ */ s(i, {
48
+ name: t.ChevronDown,
49
49
  className: S,
50
- size: t.Small
50
+ size: e.Small
51
51
  })]
52
52
  }), u && g]
53
53
  });
@@ -0,0 +1 @@
1
+ .cl-preview-card{border:var(--cl-light-border);border-radius:var(--cl-border-radius);background-color:var(--cl-surface-a0);color:var(--cl-base-font-color);font-family:var(--cl-core-font);box-shadow:var(--cl-box-shadow);flex-direction:column;width:30rem;display:flex;overflow:hidden}.cl-preview-card__image{border-bottom:var(--cl-light-border);border-radius:0!important}.cl-preview-card__image-link{line-height:0;text-decoration:none;display:block}.cl-preview-card__image-link:focus{outline:2px solid var(--cl-accent-a0);outline-offset:-2px}.cl-preview-card__title{padding:var(--cl-l-gap) var(--cl-l-gap) var(--cl-s-gap);margin:0}.cl-preview-card__summary{padding:0 var(--cl-l-gap) var(--cl-m-gap);margin:0}.cl-preview-card__authors{gap:var(--cl-m-gap);padding:var(--cl-m-gap) var(--cl-l-gap);flex-wrap:wrap;margin:0;list-style:none;display:flex}.cl-preview-card__author-item{align-items:center;gap:var(--cl-s-gap);font-style:italic;display:inline-flex}.cl-preview-card__tags{gap:var(--cl-s-gap);padding:var(--cl-m-gap) var(--cl-l-gap) var(--cl-l-gap);flex-wrap:wrap;margin:0;list-style:none;display:flex}.cl-preview-card__tag-item{display:inline-flex}.cl-preview-card__summary,.cl-preview-card__author-item{font-family:var(--cl-core-font);font-size:var(--cl-typography-base-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.2}@media (width>=640px){.cl-preview-card__summary,.cl-preview-card__author-item{font-size:var(--cl-typography-base-tablet)}}@media (width>=1024px){.cl-preview-card__summary,.cl-preview-card__author-item{font-size:var(--cl-typography-base-desktop)}}
@@ -0,0 +1,4 @@
1
+ import { PreviewCardProps } from '../../../types';
2
+ import { FC } from 'react';
3
+ declare const PreviewCard: FC<PreviewCardProps>;
4
+ export default PreviewCard;
@@ -0,0 +1,57 @@
1
+ import { LinkTarget as e } from "../../../enums/link-target.js";
2
+ import { getClassName as t } from "../../../utils/get-class-name.js";
3
+ import n from "../../atoms/avatar/Avatar2.js";
4
+ import r from "../../atoms/header/Header2.js";
5
+ import i from "../../atoms/image/Image2.js";
6
+ import a from "../../atoms/tag/Tag2.js";
7
+ import './PreviewCard.css';/* empty css */
8
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
9
+ //#region src/components/organisms/preview-card/PreviewCard.tsx
10
+ var c = ({ link: c, linkTarget: l = e.Self, image: u, title: d, summary: f, authors: p = [], tags: m = [], className: h, ...g }) => {
11
+ let _ = t(["cl-preview-card", h]), v = l === e.Blank, y = d || "Preview card", b = `View article: ${d}`;
12
+ return /* @__PURE__ */ s("article", {
13
+ className: _,
14
+ "aria-label": y,
15
+ ...g,
16
+ children: [
17
+ /* @__PURE__ */ o("a", {
18
+ href: c,
19
+ target: l,
20
+ rel: v ? "noopener noreferrer" : void 0,
21
+ "aria-label": b,
22
+ className: "cl-preview-card__image-link",
23
+ children: /* @__PURE__ */ o(i, {
24
+ ...u,
25
+ className: "cl-preview-card__image"
26
+ })
27
+ }),
28
+ /* @__PURE__ */ o(r, {
29
+ as: "h6",
30
+ className: "cl-preview-card__title",
31
+ children: d
32
+ }),
33
+ f && /* @__PURE__ */ o("p", {
34
+ className: "cl-preview-card__summary",
35
+ children: f
36
+ }),
37
+ p.length > 0 && /* @__PURE__ */ o("ul", {
38
+ className: "cl-preview-card__authors",
39
+ "aria-label": "Authors",
40
+ children: p.map((e) => /* @__PURE__ */ s("li", {
41
+ className: "cl-preview-card__author-item",
42
+ children: [/* @__PURE__ */ o(n, { ...e }), /* @__PURE__ */ o("span", { children: e.name })]
43
+ }, e.id))
44
+ }),
45
+ m.length > 0 && /* @__PURE__ */ o("ul", {
46
+ className: "cl-preview-card__tags",
47
+ "aria-label": "Tags",
48
+ children: m.map((e) => /* @__PURE__ */ o("li", {
49
+ className: "cl-preview-card__tag-item",
50
+ children: /* @__PURE__ */ o(a, { ...e })
51
+ }, e.id))
52
+ })
53
+ ]
54
+ });
55
+ };
56
+ //#endregion
57
+ export { c as default };
@@ -1,16 +1,16 @@
1
- import { getClassName as e } from "../../../utils/get-class-name.js";
2
- import { OrientationMode as t } from "../../../enums/orientation-mode.js";
1
+ import { OrientationMode as e } from "../../../enums/orientation-mode.js";
2
+ import { getClassName as t } from "../../../utils/get-class-name.js";
3
3
  import { TabContent as n } from "./content/TabContent2.js";
4
4
  import { TabList as r } from "./list/TabList2.js";
5
5
  import './Tabs.css';/* empty css */
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { useState as o } from "react";
6
+ import { useState as i } from "react";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
8
  //#region src/components/organisms/tabs/Tabs.tsx
9
- var s = ({ tabs: s, defaultTabId: c, className: l, mode: u = t.Horizontal, stretched: d = !1, editable: f = !1, extendable: p = !1, extendedTabLabel: m = "New Tab", extendedTabContent: h, onTabTitleChange: g, onTabAdd: _, onTabSelect: v, onTabDelete: y, ...b }) => {
10
- let [x, S] = o(s), C = s.length, [w, T] = o(C + 1), E = x.map((e) => e.id), D = E.map((e) => `tabpanel_${e}`), [O, k] = o(c && E.includes(c) ? c : E[0]), A = e([
9
+ var s = ({ tabs: s, defaultTabId: c, className: l, mode: u = e.Horizontal, stretched: d = !1, editable: f = !1, extendable: p = !1, extendedTabLabel: m = "New Tab", extendedTabContent: h, onTabTitleChange: g, onTabAdd: _, onTabSelect: v, onTabDelete: y, ...b }) => {
10
+ let [x, S] = i(s), C = s.length, [w, T] = i(C + 1), E = x.map((e) => e.id), D = E.map((e) => `tabpanel_${e}`), [O, k] = i(c && E.includes(c) ? c : E[0]), A = t([
11
11
  "cl-tabs",
12
12
  l,
13
- { "cl-tabs_vertical": u === t.Vertical }
13
+ { "cl-tabs_vertical": u === e.Vertical }
14
14
  ]), j = (e) => {
15
15
  k(e), v?.(e);
16
16
  }, M = (e, t) => {
@@ -22,7 +22,7 @@ var s = ({ tabs: s, defaultTabId: c, className: l, mode: u = t.Horizontal, stret
22
22
  let e = `added-tab-${w}`, t = {
23
23
  id: e,
24
24
  title: m || `Tab ${w}`,
25
- content: h || /* @__PURE__ */ i("div", {})
25
+ content: h || /* @__PURE__ */ a("div", {})
26
26
  };
27
27
  S((e) => [...e, t]), T((e) => e + 1), _?.(), j(e);
28
28
  }, P = (e) => {
@@ -32,10 +32,10 @@ var s = ({ tabs: s, defaultTabId: c, className: l, mode: u = t.Horizontal, stret
32
32
  }
33
33
  y?.(e);
34
34
  };
35
- return /* @__PURE__ */ a("div", {
35
+ return /* @__PURE__ */ o("div", {
36
36
  ...b,
37
37
  className: A,
38
- children: [/* @__PURE__ */ i(r, {
38
+ children: [/* @__PURE__ */ a(r, {
39
39
  tabs: x,
40
40
  selectedTabId: O,
41
41
  tabPanelIds: D,
@@ -48,7 +48,7 @@ var s = ({ tabs: s, defaultTabId: c, className: l, mode: u = t.Horizontal, stret
48
48
  extendable: p,
49
49
  onTabAdd: N,
50
50
  onTabDelete: P
51
- }), /* @__PURE__ */ i(n, {
51
+ }), /* @__PURE__ */ a(n, {
52
52
  tabs: x,
53
53
  selectedTabId: O,
54
54
  extendedTabContent: h,
@@ -1,26 +1,26 @@
1
- import { getClassName as e } from "../../../../utils/get-class-name.js";
2
- import { ButtonView as t } from "../../../../enums/button-view.js";
3
- import { ElementSize as n } from "../../../../enums/element-size.js";
4
- import { IconName as r } from "../../../../enums/icon-name.js";
5
- import { OrientationMode as i } from "../../../../enums/orientation-mode.js";
1
+ import { ButtonView as e } from "../../../../enums/button-view.js";
2
+ import { ElementSize as t } from "../../../../enums/element-size.js";
3
+ import { IconName as n } from "../../../../enums/icon-name.js";
4
+ import { OrientationMode as r } from "../../../../enums/orientation-mode.js";
5
+ import { getClassName as i } from "../../../../utils/get-class-name.js";
6
6
  import a from "../../../atoms/button/Button2.js";
7
7
  import { TabEditInput as o } from "../edit-input/TabEditInput2.js";
8
8
  import './TabButton.css';/* empty css */
9
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
10
- import { useEffect as u, useId as d, useRef as f, useState as p } from "react";
9
+ import { useEffect as s, useId as c, useRef as l, useState as u } from "react";
10
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
11
11
  //#region src/components/organisms/tabs/button/TabButton.tsx
12
12
  var m = ({ title: m, onTabSelect: h, onTabTitleChange: g, onTabDelete: _, tabId: v, isSelected: y, isDisabled: b = !1, stretched: x = !1, editable: S = !1, extendable: C = !1, tabPanelId: w, mode: T }) => {
13
- let [E, D] = p(!1), [O, k] = p(m), A = f(null), j = d(), M = S && !b && y, N = C && !b && !!_ && y, P = M || N, F = e(["cl-tab__wrapper", {
13
+ let [E, D] = u(!1), [O, k] = u(m), A = l(null), j = c(), M = S && !b && y, N = C && !b && !!_ && y, P = M || N, F = i(["cl-tab__wrapper", {
14
14
  "cl-tab__wrapper_disabled": b,
15
- "cl-tab__wrapper_vertical": T === i.Vertical,
15
+ "cl-tab__wrapper_vertical": T === r.Vertical,
16
16
  "cl-tab__wrapper_selected": y,
17
17
  "cl-tab__wrapper_stretched": x,
18
18
  "cl-tab__wrapper_editable": S,
19
19
  "cl-tab__wrapper_inactive": !y
20
20
  }]);
21
- u(() => {
21
+ s(() => {
22
22
  E && A.current && (A.current.focus(), A.current.select());
23
- }, [E]), u(() => {
23
+ }, [E]), s(() => {
24
24
  k(m);
25
25
  }, [m]);
26
26
  let I = () => {
@@ -38,9 +38,9 @@ var m = ({ title: m, onTabSelect: h, onTabTitleChange: g, onTabDelete: _, tabId:
38
38
  }, H = () => {
39
39
  k(m), D(!1);
40
40
  };
41
- return /* @__PURE__ */ c("span", {
41
+ return /* @__PURE__ */ f("span", {
42
42
  className: F,
43
- children: E ? /* @__PURE__ */ c(o, {
43
+ children: E ? /* @__PURE__ */ f(o, {
44
44
  tabId: v,
45
45
  editValue: O,
46
46
  isEditMode: E,
@@ -50,7 +50,7 @@ var m = ({ title: m, onTabSelect: h, onTabTitleChange: g, onTabDelete: _, tabId:
50
50
  onSave: V,
51
51
  onCancel: H,
52
52
  cancelButtonId: j
53
- }) : /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("button", {
53
+ }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("button", {
54
54
  role: "tab",
55
55
  id: v,
56
56
  onClick: L,
@@ -59,22 +59,22 @@ var m = ({ title: m, onTabSelect: h, onTabTitleChange: g, onTabDelete: _, tabId:
59
59
  className: "cl-tab",
60
60
  disabled: b,
61
61
  children: O
62
- }), P && /* @__PURE__ */ l("span", {
62
+ }), P && /* @__PURE__ */ p("span", {
63
63
  className: "cl-tab__buttons",
64
- children: [M && /* @__PURE__ */ c(a, {
65
- view: t.Icon,
66
- icon: r.Edit3,
64
+ children: [M && /* @__PURE__ */ f(a, {
65
+ view: e.Icon,
66
+ icon: n.Edit3,
67
67
  onClick: I,
68
68
  label: "Edit tab",
69
69
  tooltip: "Edit tab",
70
- iconSize: n.Small
71
- }), N && /* @__PURE__ */ c(a, {
72
- view: t.Icon,
73
- icon: r.Trash2,
70
+ iconSize: t.Small
71
+ }), N && /* @__PURE__ */ f(a, {
72
+ view: e.Icon,
73
+ icon: n.Trash2,
74
74
  onClick: () => _?.(v),
75
75
  label: "Delete tab",
76
76
  tooltip: "Delete tab",
77
- iconSize: n.Small
77
+ iconSize: t.Small
78
78
  })]
79
79
  })] })
80
80
  });
@@ -3,16 +3,16 @@ import { ElementSize as t } from "../../../../enums/element-size.js";
3
3
  import { IconName as n } from "../../../../enums/icon-name.js";
4
4
  import r from "../../../atoms/button/Button2.js";
5
5
  import './TabEditInput.css';/* empty css */
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { useEffect as o, useRef as s } from "react";
6
+ import { useEffect as i, useRef as a } from "react";
7
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
8
  //#region src/components/organisms/tabs/edit-input/TabEditInput.tsx
9
9
  var c = ({ tabId: c, isEditMode: l, editValue: u, onInputChange: d, onInputBlur: f, onInputKeyDown: p, onSave: m, onCancel: h, cancelButtonId: g }) => {
10
- let _ = s(null);
11
- return o(() => {
10
+ let _ = a(null);
11
+ return i(() => {
12
12
  l && _.current && (_.current.focus(), _.current.select());
13
- }, [l]), /* @__PURE__ */ a("div", {
13
+ }, [l]), /* @__PURE__ */ s("div", {
14
14
  className: "cl-tab-edit-container",
15
- children: [/* @__PURE__ */ i("input", {
15
+ children: [/* @__PURE__ */ o("input", {
16
16
  ref: _,
17
17
  id: `${c}-input`,
18
18
  type: "text",
@@ -22,15 +22,15 @@ var c = ({ tabId: c, isEditMode: l, editValue: u, onInputChange: d, onInputBlur:
22
22
  onKeyDown: p,
23
23
  className: "cl-tab-edit-container__input",
24
24
  maxLength: 50
25
- }), /* @__PURE__ */ a("span", {
25
+ }), /* @__PURE__ */ s("span", {
26
26
  className: "cl-tab-edit-container__buttons",
27
- children: [/* @__PURE__ */ i(r, {
27
+ children: [/* @__PURE__ */ o(r, {
28
28
  view: e.Icon,
29
29
  icon: n.Check,
30
30
  onClick: m,
31
31
  label: "Save tab title",
32
32
  iconSize: t.Small
33
- }), /* @__PURE__ */ i(r, {
33
+ }), /* @__PURE__ */ o(r, {
34
34
  view: e.Icon,
35
35
  icon: n.X,
36
36
  onClick: h,