@layers-app/shared 0.3.0 → 0.3.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 (142) hide show
  1. package/dist/assets/default-workspace-avatar.jpg.js +4 -0
  2. package/dist/assets/layers-logo-full.svg.js +2 -3
  3. package/dist/assets/layers-logo-full.svg2.js +3 -2
  4. package/dist/assets/layers-logo-icon.svg.js +2 -3
  5. package/dist/assets/layers-logo-icon.svg2.js +3 -2
  6. package/dist/assets/projects/figureA.svg.js +4 -0
  7. package/dist/assets/projects/figureB.svg.js +4 -0
  8. package/dist/assets/qwebchannel.d.ts +15 -0
  9. package/dist/assets/qwebchannel.d.ts.map +1 -0
  10. package/dist/assets/taskPriorities/high.svg.js +5 -0
  11. package/dist/assets/taskPriorities/low.svg.js +5 -0
  12. package/dist/assets/taskPriorities/none.svg.js +5 -0
  13. package/dist/assets/taskPriorities/normal.svg.js +5 -0
  14. package/dist/assets/taskPriorities/urgent.svg.js +5 -0
  15. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts +3 -0
  16. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts.map +1 -0
  17. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.js +69 -0
  18. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +27 -0
  19. package/dist/components/AnimatedFigurePage/types.d.ts +15 -0
  20. package/dist/components/AnimatedFigurePage/types.d.ts.map +1 -0
  21. package/dist/components/AnimatedFigurePage/useParallax.d.ts +6 -0
  22. package/dist/components/AnimatedFigurePage/useParallax.d.ts.map +1 -0
  23. package/dist/components/AnimatedFigurePage/useParallax.js +29 -0
  24. package/dist/components/AppContainer/AppContainer.d.ts +1 -1
  25. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  26. package/dist/components/AppContainer/AppContainer.js +37 -36
  27. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  28. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +80 -45
  29. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
  30. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +60 -69
  31. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  32. package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
  33. package/dist/components/AppContainer/hooks/useAppContainer.js +57 -51
  34. package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
  35. package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +3 -1
  36. package/dist/components/AppContainer/types.d.ts +3 -0
  37. package/dist/components/AppContainer/types.d.ts.map +1 -1
  38. package/dist/components/ColorPicker/ColorPicker.d.ts +9 -1
  39. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  40. package/dist/components/ColorPicker/ColorPicker.js +88 -74
  41. package/dist/components/ColorPicker/ColorPicker.module.css.js +31 -0
  42. package/dist/components/ColorPicker/ColorPickerList.d.ts +6 -0
  43. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -0
  44. package/dist/components/ColorPicker/ColorPickerList.js +134 -0
  45. package/dist/components/ColorPicker/ColorPickerPopover.d.ts +6 -6
  46. package/dist/components/ColorPicker/ColorPickerPopover.d.ts.map +1 -1
  47. package/dist/components/ColorPicker/ColorPickerPopover.js +29 -31
  48. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +13 -0
  49. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -0
  50. package/dist/components/ColorPicker/ColorPickerToolbar.js +132 -0
  51. package/dist/components/ColorPicker/icons.d.ts +11 -0
  52. package/dist/components/ColorPicker/icons.d.ts.map +1 -0
  53. package/dist/components/ColorPicker/icons.js +71 -0
  54. package/dist/components/ColorPicker/types.d.ts +49 -0
  55. package/dist/components/ColorPicker/types.d.ts.map +1 -0
  56. package/dist/components/ColorPicker/types.js +10 -0
  57. package/dist/components/ColorPicker/useRecentColors.d.ts +13 -0
  58. package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -0
  59. package/dist/components/ColorPicker/useRecentColors.js +39 -0
  60. package/dist/components/CommentComposer/index.d.ts.map +1 -1
  61. package/dist/components/CommentComposer/index.js +115 -111
  62. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  63. package/dist/components/EmojiPicker/EmojiPanel.js +12 -10
  64. package/dist/components/EmojiPicker/EmojiPicker.d.ts +3 -1
  65. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  66. package/dist/components/EmojiPicker/EmojiPicker.js +49 -46
  67. package/dist/components/EmojiPicker/IconsPanel.d.ts +2 -1
  68. package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
  69. package/dist/components/EmojiPicker/IconsPanel.js +47 -45
  70. package/dist/components/EmojiPicker/custom-icons/customIcons.d.ts.map +1 -1
  71. package/dist/components/EmojiPicker/custom-icons/customIcons.js +66 -31
  72. package/dist/components/EntityIcon.d.ts +3 -3
  73. package/dist/components/EntityIcon.d.ts.map +1 -1
  74. package/dist/components/EntityIcon.js +59 -35
  75. package/dist/components/EntityTitle/EntityTitle.d.ts +1 -1
  76. package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
  77. package/dist/components/EntityTitle/EntityTitle.js +34 -34
  78. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  79. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  80. package/dist/components/FilePicker/FilePicker.js +111 -123
  81. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  82. package/dist/components/FilePicker/FilePickerUpload.js +41 -39
  83. package/dist/components/FormViewer/components/fields/UploadField/UploadField.d.ts.map +1 -1
  84. package/dist/components/FormViewer/components/fields/UploadField/UploadField.js +34 -33
  85. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +3 -3
  86. package/dist/components/Logotype.d.ts +2 -1
  87. package/dist/components/Logotype.d.ts.map +1 -1
  88. package/dist/components/Logotype.js +58 -49
  89. package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
  90. package/dist/components/NavMenu/components/NavMenuItem.js +122 -107
  91. package/dist/components/NavMenu/types.d.ts +1 -0
  92. package/dist/components/NavMenu/types.d.ts.map +1 -1
  93. package/dist/components/ProjectIcon/ProjectIcon.js +13 -13
  94. package/dist/components/TreeIndent/TreeIndent.d.ts +9 -0
  95. package/dist/components/TreeIndent/TreeIndent.d.ts.map +1 -0
  96. package/dist/components/TreeIndent/TreeIndent.js +15 -0
  97. package/dist/components/TreeIndent/TreeIndent.module.css.js +11 -0
  98. package/dist/components/TreeIndent/index.d.ts +2 -0
  99. package/dist/components/TreeIndent/index.d.ts.map +1 -0
  100. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +11 -11
  101. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
  102. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +97 -101
  103. package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
  104. package/dist/config/brand.d.ts +1 -0
  105. package/dist/config/brand.d.ts.map +1 -1
  106. package/dist/config/brand.js +42 -34
  107. package/dist/config/envConfig.d.ts +40 -0
  108. package/dist/config/envConfig.d.ts.map +1 -1
  109. package/dist/config/envConfig.js +29 -10
  110. package/dist/constants.d.ts.map +1 -1
  111. package/dist/constants.js +15 -4
  112. package/dist/helpers/getFileIcons.d.ts.map +1 -1
  113. package/dist/helpers/getFileIcons.js +34 -29
  114. package/dist/helpers/getFileType.d.ts +1 -1
  115. package/dist/helpers/getFileType.d.ts.map +1 -1
  116. package/dist/helpers/getFileType.js +3 -3
  117. package/dist/helpers/hotjar.d.ts.map +1 -1
  118. package/dist/helpers/hotjar.js +11 -7
  119. package/dist/helpers/platform.js +4 -4
  120. package/dist/helpers/showNotifications.d.ts +3 -0
  121. package/dist/helpers/showNotifications.d.ts.map +1 -1
  122. package/dist/helpers/showNotifications.js +79 -44
  123. package/dist/hooks/useDateFnsLocale.d.ts +2 -0
  124. package/dist/hooks/useDateFnsLocale.d.ts.map +1 -1
  125. package/dist/hooks/useDateFnsLocale.js +9 -8
  126. package/dist/hooks/useDateUtils.d.ts.map +1 -1
  127. package/dist/hooks/useDateUtils.js +19 -19
  128. package/dist/hooks/useFormatDistance.d.ts.map +1 -1
  129. package/dist/hooks/useFormatDistance.js +6 -6
  130. package/dist/hooks/useNumberQueryParam.d.ts +1 -1
  131. package/dist/hooks/useNumberQueryParam.d.ts.map +1 -1
  132. package/dist/index.css +1 -1
  133. package/dist/index.d.ts +8 -0
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +516 -494
  136. package/dist/lang/locales/ui_en.json.js +7 -7
  137. package/dist/lang/locales/ui_es.json.js +1 -1
  138. package/dist/lang/locales/ui_ru.json.js +11 -11
  139. package/dist/utils/formatStorage.d.ts +9 -0
  140. package/dist/utils/formatStorage.d.ts.map +1 -1
  141. package/dist/utils/formatStorage.js +14 -10
  142. package/package.json +1 -1
@@ -1,22 +1,30 @@
1
1
  import { ColorSwatchProps, FlexProps } from '@mantine/core';
2
+ import { ColorPickerList } from './ColorPickerList';
3
+ import type { ColorItem } from './types';
2
4
  interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<React.ComponentPropsWithoutRef<'div'>, keyof Omit<ColorSwatchProps, 'color'>> {
3
5
  value?: string | null;
4
6
  isActive?: boolean;
5
7
  swatchShape?: 'circle' | 'square';
8
+ swatchVariant?: 'filled' | 'outline';
6
9
  withTick?: boolean;
10
+ borderColor?: string;
11
+ bgColor?: string;
7
12
  }
8
13
  export declare const ColorCircle: import("react").ForwardRefExoticComponent<ColorCircleProps & import("react").RefAttributes<HTMLDivElement>>;
9
14
  export declare const ColorPicker: import("react").ForwardRefExoticComponent<{
10
15
  value?: string | null;
11
16
  onChange?: (v: string) => void;
12
17
  allowCustomColor?: boolean;
13
- colors?: string[];
18
+ colors?: ColorItem[];
14
19
  swatchShape?: "circle" | "square";
20
+ swatchVariant?: "filled" | "outline";
15
21
  withTick?: boolean;
16
22
  fullWidth?: boolean;
17
23
  swatchSize?: number;
18
24
  } & Omit<FlexProps, "onChange"> & import("react").RefAttributes<HTMLDivElement>> & {
19
25
  ColorCircle: import("react").ForwardRefExoticComponent<ColorCircleProps & import("react").RefAttributes<HTMLDivElement>>;
26
+ List: typeof ColorPickerList;
27
+ Toolbar: import("react").ForwardRefExoticComponent<import("./ColorPickerToolbar").ColorPickerToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
20
28
  };
21
29
  export {};
22
30
  //# sourceMappingURL=ColorPicker.d.ts.map
@@ -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;AA+GvB,UAAU,gBACR,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,EACrC,IAAI,CACF,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,MAAM,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CACtC;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,6GA2CvB,CAAC;AASF,eAAO,MAAM,WAAW;YAxKd,MAAM,GAAG,IAAI;eACV,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;uBACX,OAAO;aACjB,MAAM,EAAE;kBACH,QAAQ,GAAG,QAAQ;eACtB,OAAO;gBACN,OAAO;iBACN,MAAM;;;CAmKnB,CAAC"}
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;AAgHzC,UAAU,gBACR,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,EACrC,IAAI,CACF,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,MAAM,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CACtC;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,6GAmDvB,CAAC;AASF,eAAO,MAAM,WAAW;YAvLd,MAAM,GAAG,IAAI;eACV,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;uBACX,OAAO;aACjB,SAAS,EAAE;kBACN,QAAQ,GAAG,QAAQ;oBACjB,QAAQ,GAAG,SAAS;eACzB,OAAO;gBACN,OAAO;iBACN,MAAM;;;;;CAmLnB,CAAC"}
@@ -1,30 +1,34 @@
1
- import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
- import { forwardRef as C, useState as u } from "react";
3
- import { Tick02Icon as P } from "@hugeicons/core-free-icons";
4
- import { HugeiconsIcon as T } from "@hugeicons/react";
5
- import { useMantineTheme as x, Flex as p, Tooltip as j, ColorSwatch as v, getThemeColor as f, parseThemeColor as E, ColorInput as R, ActionIcon as h } from "@mantine/core";
6
- import { IconPalette as A, IconPencil as D } from "@tabler/icons-react";
7
- import F from "styled-components";
8
- import { DEFAULT_VALUES as a } from "../../constants.js";
9
- const H = C(
1
+ import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
+ import { forwardRef as g, useState as b } from "react";
3
+ import { Tick02Icon as $ } from "@hugeicons/core-free-icons";
4
+ import { HugeiconsIcon as j } from "@hugeicons/react";
5
+ import { useMantineTheme as y, getThemeColor as A, Flex as h, Tooltip as E, ColorSwatch as R, parseThemeColor as D, ColorInput as F, ActionIcon as x } from "@mantine/core";
6
+ import { IconPalette as H, IconPencil as M } from "@tabler/icons-react";
7
+ import U from "styled-components";
8
+ import { DEFAULT_VALUES as v } from "../../constants.js";
9
+ import { ColorPickerToolbar as V } from "./ColorPickerToolbar.js";
10
+ import { ColorPickerList as q } from "./ColorPickerList.js";
11
+ import { normalizeColorItem as _ } from "./types.js";
12
+ const B = g(
10
13
  ({
11
- value: e,
12
- onChange: o,
13
- allowCustomColor: i,
14
- colors: l,
15
- swatchShape: s = "circle",
16
- withTick: c = !1,
17
- fullWidth: n = !1,
18
- swatchSize: b = 30,
19
- ...w
20
- }, y) => {
21
- const S = x(), I = E({
22
- color: e || a.COLORS[0],
23
- theme: S
24
- }), [O, k] = u(I.value), [z, d] = u(!1);
25
- return z ? /* @__PURE__ */ m(p, { align: "center", mih: 30, children: [
26
- /* @__PURE__ */ r(
27
- R,
14
+ value: o,
15
+ onChange: i,
16
+ allowCustomColor: n,
17
+ colors: c,
18
+ swatchShape: a = "circle",
19
+ swatchVariant: m = "filled",
20
+ withTick: d = !1,
21
+ fullWidth: l = !1,
22
+ swatchSize: p = 30,
23
+ ...u
24
+ }, r) => {
25
+ const t = y(), k = D({
26
+ color: o || v.COLORS[0],
27
+ theme: t
28
+ }), [z, I] = b(k.value), [O, C] = b(!1);
29
+ return O ? /* @__PURE__ */ f(h, { align: "center", mih: 30, children: [
30
+ /* @__PURE__ */ e(
31
+ F,
28
32
  {
29
33
  w: "100%",
30
34
  popoverProps: {
@@ -34,54 +38,56 @@ const H = C(
34
38
  maxLength: 7,
35
39
  withEyeDropper: !1,
36
40
  size: "xs",
37
- value: O,
38
- onChange: k,
39
- onChangeEnd: o,
41
+ value: z,
42
+ onChange: I,
43
+ onChangeEnd: i,
40
44
  placeholder: "Select custom color"
41
45
  }
42
46
  ),
43
- /* @__PURE__ */ r(
44
- h,
47
+ /* @__PURE__ */ e(
48
+ x,
45
49
  {
46
50
  radius: "xl",
47
51
  variant: "default",
48
52
  color: "gray",
49
- onClick: () => d(!1),
50
- children: /* @__PURE__ */ r(A, { size: 16 })
53
+ onClick: () => C(!1),
54
+ children: /* @__PURE__ */ e(H, { size: 16 })
51
55
  }
52
56
  )
53
- ] }, 1) : /* @__PURE__ */ m(
54
- p,
57
+ ] }, 1) : /* @__PURE__ */ f(
58
+ h,
55
59
  {
56
- ref: y,
57
- ...w,
58
- justify: n ? "space-between" : "flex-start",
60
+ ref: r,
61
+ ...u,
62
+ justify: l ? "space-between" : "flex-start",
59
63
  align: "center",
60
- mih: 32,
61
64
  children: [
62
- (l || a.COLORS).map((t) => {
63
- const L = t === e || !e && t === a.COLORS[0];
64
- return /* @__PURE__ */ r(
65
- M,
65
+ (c || v.COLORS).map((P, S) => {
66
+ const { value: s, border: T, bg: L } = _(P);
67
+ return /* @__PURE__ */ e(
68
+ G,
66
69
  {
67
- value: t,
68
- isActive: L,
69
- size: b - 4,
70
- swatchShape: s,
71
- withTick: c,
72
- onClick: () => o?.(t)
70
+ value: s,
71
+ isActive: s === o,
72
+ size: p - 4,
73
+ swatchShape: a,
74
+ swatchVariant: m,
75
+ withTick: d,
76
+ borderColor: T,
77
+ bgColor: L,
78
+ onClick: () => i?.(s)
73
79
  },
74
- t
80
+ s || S
75
81
  );
76
82
  }),
77
- i && /* @__PURE__ */ r(
78
- h,
83
+ n && /* @__PURE__ */ e(
84
+ x,
79
85
  {
80
86
  radius: "xl",
81
87
  variant: "default",
82
88
  color: "gray",
83
- onClick: () => d(!0),
84
- children: /* @__PURE__ */ r(D, { size: 16 })
89
+ onClick: () => C(!0),
90
+ children: /* @__PURE__ */ e(M, { size: 16 })
85
91
  }
86
92
  )
87
93
  ]
@@ -89,22 +95,28 @@ const H = C(
89
95
  2
90
96
  );
91
97
  }
92
- ), g = C(
93
- ({ value: e, isActive: o, swatchShape: i, withTick: l, ...s }, c) => {
94
- const n = x();
95
- return /* @__PURE__ */ r(p, { miw: 32, justify: "center", align: "center", children: /* @__PURE__ */ r(j, { label: e || "", withArrow: !0, children: /* @__PURE__ */ m(
96
- v,
98
+ ), w = g(
99
+ ({ value: o, isActive: i, swatchShape: n, swatchVariant: c = "filled", withTick: a, borderColor: m, bgColor: d, ...l }, p) => {
100
+ const u = y(), r = o ? A(o, u) : "", t = c === "outline";
101
+ return /* @__PURE__ */ e(h, { w: l.size || 24, h: l.size || 24, justify: "center", align: "center", style: { position: "relative" }, children: /* @__PURE__ */ e(E, { label: o || "", withArrow: !0, children: /* @__PURE__ */ f(
102
+ R,
97
103
  {
98
- ref: c,
99
- color: e ? f(e, n) : "",
100
- radius: i === "circle" ? "xl" : "sm",
104
+ ref: p,
105
+ color: t ? "transparent" : r,
106
+ radius: n === "circle" ? "xl" : "sm",
107
+ styles: t ? {
108
+ alphaOverlay: { display: "none" },
109
+ shadowOverlay: { display: "none" }
110
+ } : void 0,
101
111
  style: {
102
112
  cursor: "pointer",
103
- color: "var(--mantine-color-white)"
113
+ color: "var(--mantine-color-white)",
114
+ background: t ? d || `var(--mantine-color-${o}-light, ${r}20)` : void 0,
115
+ border: t ? `2px solid ${m || `var(--mantine-color-${o}-outline, ${r})`}` : void 0
104
116
  },
105
- ...s,
117
+ ...l,
106
118
  children: [
107
- o && /* @__PURE__ */ r(
119
+ i && /* @__PURE__ */ e(
108
120
  "span",
109
121
  {
110
122
  style: {
@@ -113,26 +125,28 @@ const H = C(
113
125
  left: -4,
114
126
  right: -4,
115
127
  bottom: -4,
116
- border: `2px solid ${e ? f(e, n) : ""}`,
117
- borderRadius: i === "circle" ? "var(--mantine-radius-xl)" : "var(--mantine-radius-sm)",
128
+ border: `2px solid ${r}`,
129
+ borderRadius: n === "circle" ? "var(--mantine-radius-xl)" : "var(--mantine-radius-sm)",
118
130
  pointerEvents: "none",
119
131
  boxSizing: "border-box"
120
132
  }
121
133
  }
122
134
  ),
123
- l && o && /* @__PURE__ */ r(T, { size: 20, icon: P })
135
+ a && i && /* @__PURE__ */ e(j, { size: 20, icon: $ })
124
136
  ]
125
137
  }
126
138
  ) }) });
127
139
  }
128
- ), M = F(g)`
140
+ ), G = U(w)`
129
141
  .mantine-ColorSwatch-colorOverlay {
130
- border-radius: ${({ swatchShape: e }) => e === "square" ? "3px" : "50%"};
142
+ border-radius: ${({ swatchShape: o }) => o === "square" ? "3px" : "50%"};
131
143
  }
132
- `, K = Object.assign(H, {
133
- ColorCircle: g
144
+ `, io = Object.assign(B, {
145
+ ColorCircle: w,
146
+ List: q,
147
+ Toolbar: V
134
148
  });
135
149
  export {
136
- g as ColorCircle,
137
- K as ColorPicker
150
+ w as ColorCircle,
151
+ io as ColorPicker
138
152
  };
@@ -0,0 +1,31 @@
1
+ const t = "_section_ux1w4_2", i = "_sectionLabel_ux1w4_15", n = "_listItem_ux1w4_46", e = "_listItemActive_ux1w4_72", c = "_listItemLabel_ux1w4_76", l = "_listItemSwatch_ux1w4_84", _ = "_grid_ux1w4_92", s = "_inlineSection_ux1w4_162", o = "_inlineSectionLabel_ux1w4_172", w = "_inlineRow_ux1w4_180", a = "_inlineSwatch_ux1w4_189", S = "_inlineSwatchActive_ux1w4_214", u = "_inlineSwatchRound_ux1w4_220", x = {
2
+ section: t,
3
+ sectionLabel: i,
4
+ listItem: n,
5
+ listItemActive: e,
6
+ listItemLabel: c,
7
+ listItemSwatch: l,
8
+ grid: _,
9
+ inlineSection: s,
10
+ inlineSectionLabel: o,
11
+ inlineRow: w,
12
+ inlineSwatch: a,
13
+ inlineSwatchActive: S,
14
+ inlineSwatchRound: u
15
+ };
16
+ export {
17
+ x as default,
18
+ _ as grid,
19
+ w as inlineRow,
20
+ s as inlineSection,
21
+ o as inlineSectionLabel,
22
+ a as inlineSwatch,
23
+ S as inlineSwatchActive,
24
+ u as inlineSwatchRound,
25
+ n as listItem,
26
+ e as listItemActive,
27
+ c as listItemLabel,
28
+ l as listItemSwatch,
29
+ t as section,
30
+ i as sectionLabel
31
+ };
@@ -0,0 +1,6 @@
1
+ import type { ColorPickerListProps } from './types';
2
+ /** Vertical list or multi-column grid with sections.
3
+ * Use in drawers, mobile menus, slash-menu dropdowns.
4
+ * columns=1 (default) = vertical list, columns=2+ = grid layout. */
5
+ export declare function ColorPickerList({ sections, colors, value, onChange, columns, withRecentColors, }: ColorPickerListProps): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=ColorPickerList.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,134 @@
1
+ import { jsxs as y, jsx as t } from "react/jsx-runtime";
2
+ import { Tick02Icon as C } from "@hugeicons/core-free-icons";
3
+ import { HugeiconsIcon as I } from "@hugeicons/react";
4
+ import { useMantineColorScheme as g, Box as k, useMantineTheme as x, getThemeColor as F, ColorSwatch as N } from "@mantine/core";
5
+ import { TextColorIcon as S } from "./icons.js";
6
+ import { isDefaultColor as b, normalizeColorItem as L } from "./types.js";
7
+ import { useRecentColors as T } from "./useRecentColors.js";
8
+ import i from "./ColorPicker.module.css.js";
9
+ function z({
10
+ type: e,
11
+ colorValue: l,
12
+ resolvedColor: a,
13
+ border: s,
14
+ bg: c
15
+ }) {
16
+ if (e === "text")
17
+ return /* @__PURE__ */ t(
18
+ S,
19
+ {
20
+ size: 16,
21
+ color: a,
22
+ showBorder: !0
23
+ }
24
+ );
25
+ const n = b(l);
26
+ return /* @__PURE__ */ t(
27
+ N,
28
+ {
29
+ color: n ? "var(--mantine-color-body)" : c || s || l,
30
+ size: 16,
31
+ radius: "xl",
32
+ className: i.listItemSwatch,
33
+ styles: {
34
+ root: {
35
+ border: `1.5px solid ${n ? "var(--mantine-color-default-border)" : s || a}`
36
+ },
37
+ alphaOverlay: { display: "none" },
38
+ shadowOverlay: { display: "none" }
39
+ }
40
+ }
41
+ );
42
+ }
43
+ function v({
44
+ section: e,
45
+ columns: l,
46
+ onChange: a,
47
+ isDark: s
48
+ }) {
49
+ const c = x(), n = l > 1;
50
+ return /* @__PURE__ */ y("div", { className: i.section, children: [
51
+ e.label && /* @__PURE__ */ t("div", { className: i.sectionLabel, children: e.label }),
52
+ /* @__PURE__ */ t(
53
+ "div",
54
+ {
55
+ className: n ? i.grid : void 0,
56
+ style: n ? { gridTemplateColumns: `repeat(${l}, minmax(0, 1fr))` } : void 0,
57
+ children: e.colors.map((p) => {
58
+ const { value: r, label: m, border: f, bg: d } = L(p), h = b(r), o = r === e.value, u = h ? s ? "#FFFFFF" : "#000000" : F(r, c);
59
+ return /* @__PURE__ */ y(
60
+ "button",
61
+ {
62
+ type: "button",
63
+ className: `${i.listItem} ${o ? i.listItemActive : ""}`,
64
+ onClick: () => a(r, e.key),
65
+ children: [
66
+ /* @__PURE__ */ t(
67
+ z,
68
+ {
69
+ type: e.type,
70
+ colorValue: r,
71
+ resolvedColor: u,
72
+ border: f,
73
+ bg: d
74
+ }
75
+ ),
76
+ /* @__PURE__ */ t("span", { className: i.listItemLabel, children: m }),
77
+ o && /* @__PURE__ */ t(
78
+ I,
79
+ {
80
+ size: 16,
81
+ icon: C,
82
+ color: "var(--mantine-primary-color-filled)"
83
+ }
84
+ )
85
+ ]
86
+ },
87
+ r
88
+ );
89
+ })
90
+ }
91
+ )
92
+ ] });
93
+ }
94
+ function R({
95
+ sections: e,
96
+ colors: l,
97
+ value: a,
98
+ onChange: s,
99
+ columns: c = 1,
100
+ withRecentColors: n
101
+ }) {
102
+ const { colorScheme: p } = g(), r = p === "dark", { recentColors: m, addRecent: f } = T(), d = (o, u) => {
103
+ n && f(o, u), s?.(o, u);
104
+ }, h = e || (l ? [{ key: "default", label: "", colors: l, value: a }] : []);
105
+ return /* @__PURE__ */ y(k, { children: [
106
+ n && m.length > 0 && /* @__PURE__ */ t(
107
+ v,
108
+ {
109
+ section: {
110
+ key: "__recent",
111
+ label: "Recently used",
112
+ colors: m.map((o) => o.value),
113
+ value: a
114
+ },
115
+ columns: 1,
116
+ onChange: d,
117
+ isDark: r
118
+ }
119
+ ),
120
+ h.map((o) => /* @__PURE__ */ t(
121
+ v,
122
+ {
123
+ section: o,
124
+ columns: c,
125
+ onChange: d,
126
+ isDark: r
127
+ },
128
+ o.key
129
+ ))
130
+ ] });
131
+ }
132
+ export {
133
+ R as ColorPickerList
134
+ };
@@ -1,11 +1,11 @@
1
1
  import { PropsWithChildren } from 'react';
2
- interface ColorPickerPopoverProps {
2
+ import { PopoverProps } from '@mantine/core';
3
+ type ColorPickerPopoverProps = {
3
4
  value?: string;
4
5
  onChange?: (v: string) => void;
5
- defaultOpened?: boolean;
6
- size?: number;
7
- radius?: number;
8
- }
9
- export declare const ColorPickerPopover: ({ value, onChange, defaultOpened, size, radius, children, }: PropsWithChildren<ColorPickerPopoverProps>) => import("react/jsx-runtime").JSX.Element;
6
+ opened?: boolean;
7
+ setOpened?: (opened: boolean) => void;
8
+ } & Pick<PopoverProps, 'withinPortal' | 'floatingStrategy'>;
9
+ export declare const ColorPickerPopover: ({ value, onChange, opened, setOpened, children, withinPortal, floatingStrategy, }: PropsWithChildren<ColorPickerPopoverProps>) => import("react/jsx-runtime").JSX.Element;
10
10
  export {};
11
11
  //# sourceMappingURL=ColorPickerPopover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerPopover.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAMpD,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,kBAAkB,GAAI,6DAOhC,iBAAiB,CAAC,uBAAuB,CAAC,4CAgC5C,CAAC"}
1
+ {"version":3,"file":"ColorPickerPopover.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAQ,YAAY,EAAE,MAAM,eAAe,CAAC;AAInD,KAAK,uBAAuB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC,GAAG,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,kBAAkB,CAAC,CAAC;AAE5D,eAAO,MAAM,kBAAkB,GAAI,mFAQhC,iBAAiB,CAAC,uBAAuB,CAAC,4CA0B5C,CAAC"}
@@ -1,42 +1,40 @@
1
- import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
- import { useState as h } from "react";
3
- import { Popover as t } from "@mantine/core";
4
- import { ColorPicker as n } from "./ColorPicker.js";
5
- const w = ({
6
- value: r,
7
- onChange: i,
8
- defaultOpened: c,
9
- size: l = 18,
10
- radius: d,
11
- children: p
1
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
+ import { useTranslation as a } from "react-i18next";
3
+ import { Menu as r } from "@mantine/core";
4
+ import { ColorPicker as d } from "./ColorPicker.js";
5
+ const x = ({
6
+ value: i,
7
+ onChange: t,
8
+ opened: c,
9
+ setOpened: e,
10
+ children: n,
11
+ withinPortal: m,
12
+ floatingStrategy: p
12
13
  }) => {
13
- const [s, e] = h(c);
14
- return /* @__PURE__ */ f(
15
- t,
14
+ const { t: s } = a("ui");
15
+ return /* @__PURE__ */ l(
16
+ r,
16
17
  {
17
- opened: s,
18
+ opened: c,
18
19
  onChange: e,
19
20
  position: "bottom-start",
20
- withArrow: !0,
21
+ withinPortal: m,
22
+ floatingStrategy: p,
21
23
  children: [
22
- /* @__PURE__ */ o(t.Target, { children: /* @__PURE__ */ o("div", { onClick: () => e((m) => !m), style: { cursor: "pointer" }, children: p || /* @__PURE__ */ o(
23
- n.ColorCircle,
24
- {
25
- value: r,
26
- size: l,
27
- radius: d
28
- }
29
- ) }) }),
30
- /* @__PURE__ */ o(t.Dropdown, { maw: 270, children: /* @__PURE__ */ o("div", { onClick: () => e(!1), children: /* @__PURE__ */ o(
31
- n,
32
- {
33
- ...i ? { value: r, onChange: i } : { defaultValue: r ?? void 0 }
34
- }
35
- ) }) })
24
+ /* @__PURE__ */ o(r.Target, { children: n }),
25
+ /* @__PURE__ */ l(r.Dropdown, { children: [
26
+ /* @__PURE__ */ o(r.Label, { px: 4, py: 0, mih: 17, mb: 6, children: s("colorPicker.color") }),
27
+ /* @__PURE__ */ o("div", { onClick: () => e?.(!1), children: /* @__PURE__ */ o(
28
+ d,
29
+ {
30
+ ...t ? { value: i, onChange: t } : { defaultValue: i ?? void 0 }
31
+ }
32
+ ) })
33
+ ] })
36
34
  ]
37
35
  }
38
36
  );
39
37
  };
40
38
  export {
41
- w as ColorPickerPopover
39
+ x as ColorPickerPopover
42
40
  };
@@ -0,0 +1,13 @@
1
+ import type { ColorPickerOnChange, ColorSection } from './types';
2
+ /** Toolbar dropdown with text colors (A icons) + highlights (circles) + recently used.
3
+ * Use inside Menu.Dropdown, Popover, or floating toolbar. */
4
+ export interface ColorPickerToolbarProps {
5
+ sections: ColorSection[];
6
+ onChange: ColorPickerOnChange;
7
+ withRecentColors?: boolean;
8
+ maxRecentColors?: number;
9
+ disabled?: boolean;
10
+ recentColorsLabel?: string;
11
+ }
12
+ export declare const ColorPickerToolbar: import("react").ForwardRefExoticComponent<ColorPickerToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
13
+ //# sourceMappingURL=ColorPickerToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorPickerToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerToolbar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMjE;6DAC6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AA4BD,eAAO,MAAM,kBAAkB,oHAuJ7B,CAAC"}