@layers-app/shared 0.4.1 → 0.4.2

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 (53) hide show
  1. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
  2. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
  3. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +55 -59
  4. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +24 -22
  5. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  6. package/dist/components/ColorPicker/ColorPicker.js +109 -83
  7. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
  8. package/dist/components/ColorPicker/ColorPickerList.js +62 -63
  9. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  10. package/dist/components/ColorPicker/ColorPickerToolbar.js +128 -120
  11. package/dist/components/ColorPicker/icons.js +3 -3
  12. package/dist/components/ColorPicker/types.d.ts +3 -1
  13. package/dist/components/ColorPicker/types.d.ts.map +1 -1
  14. package/dist/components/ColorPicker/types.js +11 -5
  15. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  16. package/dist/components/CommentComposer/CommentEditorHotkeys.js +55 -45
  17. package/dist/components/FilePicker/FilePicker.d.ts +3 -1
  18. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  19. package/dist/components/FilePicker/FilePicker.js +44 -42
  20. package/dist/components/FilePicker/FilePickerUpload.d.ts +3 -1
  21. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  22. package/dist/components/FilePicker/FilePickerUpload.js +28 -28
  23. package/dist/components/LanguagePicker/LanguagePicker.d.ts +13 -3
  24. package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
  25. package/dist/components/LanguagePicker/LanguagePicker.js +65 -43
  26. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts +6 -1
  27. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts.map +1 -1
  28. package/dist/components/OnboardingTour/OnboardingTourFooter.js +39 -21
  29. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +4 -5
  30. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -1
  31. package/dist/components/OnboardingTour/OnboardingTourWrapper.js +86 -118
  32. package/dist/components/OnboardingTour/index.d.ts +1 -1
  33. package/dist/components/OnboardingTour/index.d.ts.map +1 -1
  34. package/dist/components/OnboardingTour/useOnboardingTour.d.ts +4 -0
  35. package/dist/components/OnboardingTour/useOnboardingTour.d.ts.map +1 -1
  36. package/dist/components/OnboardingTour/useOnboardingTour.js +65 -36
  37. package/dist/components/UserAvatar/index.d.ts.map +1 -1
  38. package/dist/components/UserAvatar/index.js +38 -31
  39. package/dist/config/brand.d.ts +2 -0
  40. package/dist/config/brand.d.ts.map +1 -1
  41. package/dist/config/brand.js +28 -22
  42. package/dist/config/envConfig.d.ts +4 -0
  43. package/dist/config/envConfig.d.ts.map +1 -1
  44. package/dist/index.css +1 -1
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +445 -439
  47. package/dist/lang/locales/ui_ru.json.js +1 -1
  48. package/dist/store/featureProgress.d.ts +3 -6
  49. package/dist/store/featureProgress.d.ts.map +1 -1
  50. package/dist/store/featureProgress.js +56 -22
  51. package/dist/store/plansModal.d.ts.map +1 -1
  52. package/dist/store/plansModal.js +10 -10
  53. package/package.json +2 -2
@@ -1,27 +1,27 @@
1
- const e = "_page_qm43p_5", g = "_figureContainer_qm43p_31", _ = "_figure_qm43p_31", a = "_figureA_qm43p_57", r = "_figureB_qm43p_65", n = "_grainOverlay_qm43p_229", i = "_badgeWrap_qm43p_253", p = "_badge0_qm43p_309", t = "_badge1_qm43p_319", d = "_badge2_qm43p_337", o = "_badge3_qm43p_355", b = {
1
+ const e = "_page_4n9uu_5", u = "_figureContainer_4n9uu_31", g = "_figure_4n9uu_31", _ = "_figureA_4n9uu_57", a = "_figureB_4n9uu_65", n = "_grainOverlay_4n9uu_229", r = "_badgeWrap_4n9uu_253", i = "_badge0_4n9uu_309", t = "_badge1_4n9uu_319", d = "_badge2_4n9uu_337", o = "_badge3_4n9uu_355", b = {
2
2
  page: e,
3
- figureContainer: g,
4
- figure: _,
5
- figureA: a,
6
- figureB: r,
3
+ figureContainer: u,
4
+ figure: g,
5
+ figureA: _,
6
+ figureB: a,
7
7
  grainOverlay: n,
8
- badgeWrap: i,
9
- badge0: p,
8
+ badgeWrap: r,
9
+ badge0: i,
10
10
  badge1: t,
11
11
  badge2: d,
12
12
  badge3: o
13
13
  };
14
14
  export {
15
- p as badge0,
15
+ i as badge0,
16
16
  t as badge1,
17
17
  d as badge2,
18
18
  o as badge3,
19
- i as badgeWrap,
19
+ r as badgeWrap,
20
20
  b as default,
21
- _ as figure,
22
- a as figureA,
23
- r as figureB,
24
- g as figureContainer,
21
+ g as figure,
22
+ _ as figureA,
23
+ a as figureB,
24
+ u as figureContainer,
25
25
  n as grainOverlay,
26
26
  e as page
27
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ModalHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/components/ModalHeader.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAMrD,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,WAAW,iEACK,gBAAgB,6CA6I5C,CAAC"}
1
+ {"version":3,"file":"ModalHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/components/ModalHeader.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAQrD,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,WAAW,iEACK,gBAAgB,6CAwI5C,CAAC"}
@@ -1,32 +1,33 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import { memo as I, useRef as b } from "react";
3
- import { useTranslation as A } from "react-i18next";
4
- import { Box as C, Tooltip as t, ActionIcon as a, Flex as n, Text as p } from "@mantine/core";
5
- import { IconDownload as h, IconMinus as F, IconPlus as R, IconX as k } from "@tabler/icons-react";
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import { memo as v, useRef as I } from "react";
3
+ import { useTranslation as C } from "react-i18next";
4
+ import { Box as F, Tooltip as i, ActionIcon as t, Flex as s, Text as g } from "@mantine/core";
5
+ import { IconDownload as p, IconMinus as N, IconPlus as R, IconX as k } from "@tabler/icons-react";
6
6
  import { getFileIcons as T } from "../../../helpers/getFileIcons.js";
7
7
  import { getFileType as j } from "../../../helpers/getFileType.js";
8
8
  import { useAttachmentsGalleryContext as D } from "../AttachmentsGalleryContext.js";
9
9
  import { zoomStep as f } from "../helpers.js";
10
10
  import { useDownloadFile as M } from "../hooks/useDownloadFile.js";
11
11
  import { useZoomReset as Z } from "../hooks/useZoomReset.js";
12
- const J = I(
13
- ({ onClose: u, attachments: y }) => {
12
+ import n from "../styles.module.css.js";
13
+ const L = v(
14
+ ({ onClose: w, attachments: z }) => {
14
15
  Z();
15
- const { t: r } = A("ui"), c = b(null), { zoomPercentage: w, transformRefs: s, selectedIndex: i } = D(), l = y?.[i], x = () => {
16
+ const { t: r } = C("ui"), c = I(null), { zoomPercentage: y, transformRefs: m, selectedIndex: a } = D(), o = z?.[a], x = () => {
16
17
  f({
17
18
  animationRef: c,
18
19
  dir: "in",
19
- activeRef: s.current[i]
20
+ activeRef: m.current[a]
20
21
  });
21
- }, v = () => {
22
+ }, b = () => {
22
23
  f({
23
24
  animationRef: c,
24
25
  dir: "out",
25
- activeRef: s.current[i]
26
+ activeRef: m.current[a]
26
27
  });
27
- }, { isVideo: z, isFetching: g, onDownload: m, isMobile: d } = M(l);
28
- return /* @__PURE__ */ o(
29
- C,
28
+ }, { isVideo: A, isFetching: d, onDownload: u, isMobile: h } = M(o);
29
+ return /* @__PURE__ */ l(
30
+ F,
30
31
  {
31
32
  style: {
32
33
  borderRadius: 8,
@@ -40,43 +41,41 @@ const J = I(
40
41
  py: 8,
41
42
  bg: "var(--mantine-color-dark-6)",
42
43
  children: [
43
- d ? /* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.download"), children: /* @__PURE__ */ e(
44
- a,
44
+ h ? /* @__PURE__ */ e(i, { withArrow: !0, label: r("gallery.download"), children: /* @__PURE__ */ e(
45
+ t,
45
46
  {
46
- c: "var(--app-gallary-text)",
47
- color: "gray",
47
+ className: n.headerAction,
48
48
  size: "lg",
49
- variant: "light",
50
- loading: g,
51
- onClick: m,
52
- children: /* @__PURE__ */ e(h, { size: 20 })
49
+ variant: "subtle",
50
+ loading: d,
51
+ onClick: u,
52
+ children: /* @__PURE__ */ e(p, { size: 20 })
53
53
  }
54
- ) }) : /* @__PURE__ */ o(n, { align: "center", gap: 8, ml: 6, miw: 0, children: [
55
- l ? T(
54
+ ) }) : /* @__PURE__ */ l(s, { align: "center", gap: 8, ml: 6, miw: 0, children: [
55
+ o ? T(
56
56
  j(
57
- l.contentType ?? "",
57
+ o.contentType ?? "",
58
58
  !1,
59
- l.originalFileName
59
+ o.originalFileName
60
60
  ),
61
61
  !1,
62
62
  20
63
63
  ) : null,
64
- /* @__PURE__ */ e(p, { fw: 500, fz: 14, c: "var(--app-gallary-text)", truncate: !0, children: l?.originalFileName || "" })
64
+ /* @__PURE__ */ e(g, { fw: 500, fz: 14, c: "var(--app-gallary-text)", truncate: !0, children: o?.originalFileName || "" })
65
65
  ] }),
66
- z ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ o(n, { gap: "xs", children: [
67
- /* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.zoomOut"), children: /* @__PURE__ */ e(
68
- a,
66
+ A ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ l(s, { gap: "xs", children: [
67
+ /* @__PURE__ */ e(i, { withArrow: !0, label: r("gallery.zoomOut"), children: /* @__PURE__ */ e(
68
+ t,
69
69
  {
70
- c: "var(--app-gallary-text)",
71
- color: "gray",
70
+ className: n.headerAction,
72
71
  size: "lg",
73
- variant: "light",
74
- onClick: v,
75
- children: /* @__PURE__ */ e(F, { size: 20 })
72
+ variant: "subtle",
73
+ onClick: b,
74
+ children: /* @__PURE__ */ e(N, { size: 20 })
76
75
  }
77
76
  ) }),
78
- /* @__PURE__ */ o(
79
- p,
77
+ /* @__PURE__ */ l(
78
+ g,
80
79
  {
81
80
  fw: 500,
82
81
  fz: 14,
@@ -84,44 +83,41 @@ const J = I(
84
83
  miw: 50,
85
84
  ta: "center",
86
85
  children: [
87
- w,
86
+ y,
88
87
  "%"
89
88
  ]
90
89
  }
91
90
  ),
92
- /* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.zoomIn"), children: /* @__PURE__ */ e(
93
- a,
91
+ /* @__PURE__ */ e(i, { withArrow: !0, label: r("gallery.zoomIn"), children: /* @__PURE__ */ e(
92
+ t,
94
93
  {
95
- c: "var(--app-gallary-text)",
96
- color: "gray",
94
+ className: n.headerAction,
97
95
  size: "lg",
98
- variant: "light",
96
+ variant: "subtle",
99
97
  onClick: x,
100
98
  children: /* @__PURE__ */ e(R, { size: 20 })
101
99
  }
102
100
  ) })
103
101
  ] }),
104
- /* @__PURE__ */ o(n, { justify: "end", gap: "xs", children: [
105
- !d && /* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.download"), children: /* @__PURE__ */ e(
106
- a,
102
+ /* @__PURE__ */ l(s, { justify: "end", gap: "xs", children: [
103
+ !h && /* @__PURE__ */ e(i, { withArrow: !0, label: r("gallery.download"), children: /* @__PURE__ */ e(
104
+ t,
107
105
  {
108
- c: "var(--app-gallary-text)",
106
+ className: n.headerAction,
109
107
  size: "lg",
110
- color: "gray",
111
- variant: "light",
112
- loading: g,
113
- onClick: m,
114
- children: /* @__PURE__ */ e(h, { size: 20 })
108
+ variant: "subtle",
109
+ loading: d,
110
+ onClick: u,
111
+ children: /* @__PURE__ */ e(p, { size: 20 })
115
112
  }
116
113
  ) }),
117
- /* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.close"), children: /* @__PURE__ */ e(
118
- a,
114
+ /* @__PURE__ */ e(i, { withArrow: !0, label: r("gallery.close"), children: /* @__PURE__ */ e(
115
+ t,
119
116
  {
120
- c: "var(--app-gallary-text)",
117
+ className: n.headerAction,
121
118
  size: "lg",
122
- color: "gray",
123
- variant: "light",
124
- onClick: u,
119
+ variant: "subtle",
120
+ onClick: w,
125
121
  children: /* @__PURE__ */ e(k, { size: 20 })
126
122
  }
127
123
  ) })
@@ -132,5 +128,5 @@ const J = I(
132
128
  }
133
129
  );
134
130
  export {
135
- J as ModalHeader
131
+ L as ModalHeader
136
132
  };
@@ -1,39 +1,41 @@
1
- const o = "_container_329fy_1", n = "_root_329fy_13", t = "_carouselRoot_329fy_27", e = "_carouselViewport_329fy_35", a = "_carouselSlide_329fy_43", _ = "_navButton_329fy_57", r = "_navButtonPrev_329fy_83", i = "_navButtonNext_329fy_91", d = "_modalContent_329fy_99", c = "_modalBody_329fy_109", s = "_videoContainer_329fy_121", u = "_imageContainer_329fy_131", f = "_pdfContainer_329fy_145", l = "_pdfFrame_329fy_161", y = "_audioContainer_329fy_175", m = "_audioName_329fy_205", v = "_audioElement_329fy_221", C = {
2
- container: o,
3
- root: n,
1
+ const n = "_container_nqf56_1", o = "_root_nqf56_13", t = "_carouselRoot_nqf56_27", e = "_carouselViewport_nqf56_35", a = "_carouselSlide_nqf56_43", _ = "_navButton_nqf56_57", r = "_navButtonPrev_nqf56_83", i = "_navButtonNext_nqf56_91", c = "_headerAction_nqf56_99", d = "_modalContent_nqf56_127", s = "_modalBody_nqf56_137", u = "_videoContainer_nqf56_149", f = "_imageContainer_nqf56_159", l = "_pdfContainer_nqf56_173", m = "_pdfFrame_nqf56_189", q = "_audioContainer_nqf56_203", v = "_audioName_nqf56_233", C = "_audioElement_nqf56_249", B = {
2
+ container: n,
3
+ root: o,
4
4
  carouselRoot: t,
5
5
  carouselViewport: e,
6
6
  carouselSlide: a,
7
7
  navButton: _,
8
8
  navButtonPrev: r,
9
9
  navButtonNext: i,
10
+ headerAction: c,
10
11
  modalContent: d,
11
- modalBody: c,
12
- videoContainer: s,
13
- imageContainer: u,
14
- pdfContainer: f,
15
- pdfFrame: l,
16
- audioContainer: y,
17
- audioName: m,
18
- audioElement: v
12
+ modalBody: s,
13
+ videoContainer: u,
14
+ imageContainer: f,
15
+ pdfContainer: l,
16
+ pdfFrame: m,
17
+ audioContainer: q,
18
+ audioName: v,
19
+ audioElement: C
19
20
  };
20
21
  export {
21
- y as audioContainer,
22
- v as audioElement,
23
- m as audioName,
22
+ q as audioContainer,
23
+ C as audioElement,
24
+ v as audioName,
24
25
  t as carouselRoot,
25
26
  a as carouselSlide,
26
27
  e as carouselViewport,
27
- o as container,
28
- C as default,
29
- u as imageContainer,
30
- c as modalBody,
28
+ n as container,
29
+ B as default,
30
+ c as headerAction,
31
+ f as imageContainer,
32
+ s as modalBody,
31
33
  d as modalContent,
32
34
  _ as navButton,
33
35
  i as navButtonNext,
34
36
  r as navButtonPrev,
35
- f as pdfContainer,
36
- l as pdfFrame,
37
- n as root,
38
- s as videoContainer
37
+ l as pdfContainer,
38
+ m as pdfFrame,
39
+ o as root,
40
+ u as videoContainer
39
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,gBAAgB,EAEhB,SAAS,EAKV,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,KAAK,gBAAg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
- import { forwardRef as y, useState as x } from "react";
3
- import { Tick02Icon as j } from "@hugeicons/core-free-icons";
4
- import { HugeiconsIcon as A } from "@hugeicons/react";
5
- import { useMantineTheme as w, getThemeColor as E, Flex as C, Tooltip as R, ColorSwatch as D, parseThemeColor as F, ColorInput as H, ActionIcon as v } from "@mantine/core";
6
- import { IconPalette as M, IconPencil as U } from "@tabler/icons-react";
7
- import V from "styled-components";
8
- import { DEFAULT_VALUES as g } from "../../constants.js";
9
- import { ColorPickerToolbar as q } from "./ColorPickerToolbar.js";
1
+ import { jsx as e, jsxs as b } from "react/jsx-runtime";
2
+ import { forwardRef as k, useState as g } from "react";
3
+ import { useTranslation as j } from "react-i18next";
4
+ import { Tick02Icon as A } from "@hugeicons/core-free-icons";
5
+ import { HugeiconsIcon as E } from "@hugeicons/react";
6
+ import { useMantineTheme as z, getThemeColor as R, Flex as x, Tooltip as D, ColorSwatch as F, parseThemeColor as H, ColorInput as M, ActionIcon as y } from "@mantine/core";
7
+ import { IconPalette as U, IconPencil as V } from "@tabler/icons-react";
8
+ import q from "styled-components";
9
+ import { DEFAULT_VALUES as w } from "../../constants.js";
10
10
  import { ColorPickerList as _ } from "./ColorPickerList.js";
11
- import { normalizeColorItem as B } from "./types.js";
12
- const G = y(
11
+ import { ColorPickerToolbar as B } from "./ColorPickerToolbar.js";
12
+ import { resolveColorLabel as G, normalizeColorItem as J } from "./types.js";
13
+ const K = k(
13
14
  ({
14
15
  value: o,
15
16
  onChange: l,
16
17
  allowCustomColor: n,
17
18
  colors: s,
18
- swatchShape: a = "circle",
19
+ swatchShape: c = "circle",
19
20
  swatchVariant: m = "filled",
20
21
  withTick: d = !1,
21
22
  fullWidth: p = !1,
22
23
  swatchSize: i = 30,
23
24
  ...u
24
25
  }, f) => {
25
- const r = w(), t = F({
26
- color: o || g.COLORS[0],
27
- theme: r
28
- }), [z, I] = x(t.value), [O, b] = x(!1);
29
- return O ? /* @__PURE__ */ h(C, { align: "center", mih: 30, children: [
26
+ const h = z(), r = H({
27
+ color: o || w.COLORS[0],
28
+ theme: h
29
+ }), [t, C] = g(r.value), [L, v] = g(!1);
30
+ return L ? /* @__PURE__ */ b(x, { align: "center", mih: 30, children: [
30
31
  /* @__PURE__ */ e(
31
- H,
32
+ M,
32
33
  {
33
34
  w: "100%",
34
35
  popoverProps: {
@@ -38,57 +39,62 @@ const G = y(
38
39
  maxLength: 7,
39
40
  withEyeDropper: !1,
40
41
  size: "xs",
41
- value: z,
42
- onChange: I,
42
+ value: t,
43
+ onChange: C,
43
44
  onChangeEnd: l,
44
45
  placeholder: "Select custom color"
45
46
  }
46
47
  ),
47
48
  /* @__PURE__ */ e(
48
- v,
49
+ y,
49
50
  {
50
51
  radius: "xl",
51
52
  variant: "default",
52
53
  color: "gray",
53
- onClick: () => b(!1),
54
- children: /* @__PURE__ */ e(M, { size: 16 })
54
+ onClick: () => v(!1),
55
+ children: /* @__PURE__ */ e(U, { size: 16 })
55
56
  }
56
57
  )
57
- ] }, 1) : /* @__PURE__ */ h(
58
- C,
58
+ ] }, 1) : /* @__PURE__ */ b(
59
+ x,
59
60
  {
60
61
  ref: f,
61
62
  ...u,
62
63
  justify: p ? "space-between" : "flex-start",
63
64
  align: "center",
64
65
  children: [
65
- (s || g.COLORS).map((P, S) => {
66
- const { value: c, border: T, bg: L, label: $ } = B(P);
66
+ (s || w.COLORS).map((O, T) => {
67
+ const {
68
+ value: a,
69
+ border: P,
70
+ bg: S,
71
+ label: $
72
+ } = J(O);
67
73
  return /* @__PURE__ */ e(
68
- J,
74
+ N,
69
75
  {
70
- value: c,
76
+ value: a,
71
77
  label: $,
72
- isActive: c === o,
78
+ isActive: a === o,
73
79
  size: i - 4,
74
- swatchShape: a,
80
+ swatchShape: c,
75
81
  swatchVariant: m,
76
82
  withTick: d,
77
- borderColor: T,
78
- bgColor: L,
79
- onClick: () => l?.(c)
83
+ borderColor: P,
84
+ bgColor: S,
85
+ onClick: () => l?.(a)
80
86
  },
81
- c || S
87
+ a || T
82
88
  );
83
89
  }),
84
90
  n && /* @__PURE__ */ e(
85
- v,
91
+ y,
86
92
  {
87
93
  radius: "xl",
88
94
  variant: "default",
89
95
  color: "gray",
90
- onClick: () => b(!0),
91
- children: /* @__PURE__ */ e(U, { size: 16 })
96
+ onClick: () => v(!0),
97
+ children: /* @__PURE__ */ e(V, { size: 16 })
92
98
  }
93
99
  )
94
100
  ]
@@ -96,58 +102,78 @@ const G = y(
96
102
  2
97
103
  );
98
104
  }
99
- ), k = y(
100
- ({ value: o, label: l, isActive: n, swatchShape: s, swatchVariant: a = "filled", withTick: m, borderColor: d, bgColor: p, ...i }, u) => {
101
- const f = w(), r = o ? E(o, f) : "", t = a === "outline";
102
- return /* @__PURE__ */ e(C, { w: i.size || 24, h: i.size || 24, justify: "center", align: "center", style: { position: "relative" }, children: /* @__PURE__ */ e(R, { label: l || o || "", withArrow: !0, zIndex: 300, children: /* @__PURE__ */ h(
103
- D,
105
+ ), I = k(
106
+ ({
107
+ value: o,
108
+ label: l,
109
+ isActive: n,
110
+ swatchShape: s,
111
+ swatchVariant: c = "filled",
112
+ withTick: m,
113
+ borderColor: d,
114
+ bgColor: p,
115
+ ...i
116
+ }, u) => {
117
+ const f = z(), { t: h } = j("ui"), r = o ? R(o, f) : "", t = c === "outline", C = G(h, o, l);
118
+ return /* @__PURE__ */ e(
119
+ x,
104
120
  {
105
- ref: u,
106
- color: t ? "transparent" : r,
107
- radius: s === "circle" ? "xl" : "sm",
108
- styles: t ? {
109
- alphaOverlay: { display: "none" },
110
- shadowOverlay: { display: "none" }
111
- } : void 0,
112
- style: {
113
- cursor: "pointer",
114
- color: "var(--mantine-color-white)",
115
- background: t ? p || `var(--mantine-color-${o}-light, ${r}20)` : void 0,
116
- border: t ? `2px solid ${d || `var(--mantine-color-${o}-outline, ${r})`}` : void 0
117
- },
118
- ...i,
119
- children: [
120
- n && /* @__PURE__ */ e(
121
- "span",
122
- {
123
- style: {
124
- position: "absolute",
125
- top: -4,
126
- left: -4,
127
- right: -4,
128
- bottom: -4,
129
- border: `2px solid ${r}`,
130
- borderRadius: s === "circle" ? "var(--mantine-radius-xl)" : "var(--mantine-radius-sm)",
131
- pointerEvents: "none",
132
- boxSizing: "border-box"
133
- }
134
- }
135
- ),
136
- m && n && /* @__PURE__ */ e(A, { size: 20, icon: j })
137
- ]
121
+ w: i.size || 24,
122
+ h: i.size || 24,
123
+ justify: "center",
124
+ align: "center",
125
+ style: { position: "relative" },
126
+ children: /* @__PURE__ */ e(D, { label: C, withArrow: !0, zIndex: 300, children: /* @__PURE__ */ b(
127
+ F,
128
+ {
129
+ ref: u,
130
+ color: t ? "transparent" : r,
131
+ radius: s === "circle" ? "xl" : "sm",
132
+ styles: t ? {
133
+ alphaOverlay: { display: "none" },
134
+ shadowOverlay: { display: "none" }
135
+ } : void 0,
136
+ style: {
137
+ cursor: "pointer",
138
+ color: "var(--mantine-color-white)",
139
+ background: t ? p || `var(--mantine-color-${o}-light, ${r}20)` : void 0,
140
+ border: t ? `2px solid ${d || `var(--mantine-color-${o}-outline, ${r})`}` : void 0
141
+ },
142
+ ...i,
143
+ children: [
144
+ n && /* @__PURE__ */ e(
145
+ "span",
146
+ {
147
+ style: {
148
+ position: "absolute",
149
+ top: -4,
150
+ left: -4,
151
+ right: -4,
152
+ bottom: -4,
153
+ border: `2px solid ${r}`,
154
+ borderRadius: s === "circle" ? "var(--mantine-radius-xl)" : "var(--mantine-radius-sm)",
155
+ pointerEvents: "none",
156
+ boxSizing: "border-box"
157
+ }
158
+ }
159
+ ),
160
+ m && n && /* @__PURE__ */ e(E, { size: 20, icon: A })
161
+ ]
162
+ }
163
+ ) })
138
164
  }
139
- ) }) });
165
+ );
140
166
  }
141
- ), J = V(k)`
167
+ ), N = q(I)`
142
168
  .mantine-ColorSwatch-colorOverlay {
143
169
  border-radius: ${({ swatchShape: o }) => o === "square" ? "3px" : "50%"};
144
170
  }
145
- `, lo = Object.assign(G, {
146
- ColorCircle: k,
171
+ `, ao = Object.assign(K, {
172
+ ColorCircle: I,
147
173
  List: _,
148
- Toolbar: q
174
+ Toolbar: B
149
175
  });
150
176
  export {
151
- k as ColorCircle,
152
- lo as ColorPicker
177
+ I as ColorCircle,
178
+ ao as ColorPicker
153
179
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerList.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerList.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAgB,MAAM,SAAS,CAAC;AA8GlE;;oEAEoE;AACpE,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,OAAW,EACX,gBAAgB,GACjB,EAAE,oBAAoB,2CA4CtB"}
1
+ {"version":3,"file":"ColorPickerList.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerList.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAgB,MAAM,SAAS,CAAC;AAqHlE;;oEAEoE;AACpE,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,OAAW,EACX,gBAAgB,GACjB,EAAE,oBAAoB,2CA4CtB"}