@layers-app/shared 0.3.9 → 0.4.1

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 (103) hide show
  1. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +10 -10
  2. package/dist/components/AppContainer/AppContainer.d.ts +6 -1
  3. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  4. package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
  5. package/dist/components/AppContainer/components/ToolbarNewButton.d.ts +7 -2
  6. package/dist/components/AppContainer/components/ToolbarNewButton.d.ts.map +1 -1
  7. package/dist/components/AppContainer/components/ToolbarNewButton.js +14 -14
  8. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
  9. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  10. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
  11. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +33 -27
  12. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
  13. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +60 -47
  14. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  15. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts +2 -1
  16. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts.map +1 -1
  17. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.js +13 -12
  18. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +17 -17
  19. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
  20. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
  21. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  22. package/dist/components/ColorPicker/ColorPicker.d.ts +9 -13
  23. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  24. package/dist/components/ColorPicker/ColorPicker.js +139 -145
  25. package/dist/components/ColorPicker/ColorPicker.module.css.js +8 -8
  26. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  27. package/dist/components/ColorPicker/ColorPickerToolbar.js +88 -71
  28. package/dist/components/ColorPicker/icons.js +4 -4
  29. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  30. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  31. package/dist/components/CommentComposer/CommentEditorHotkeys.js +4 -3
  32. package/dist/components/CommentComposer/index.js +1 -1
  33. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  34. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  35. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  36. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  37. package/dist/components/EmojiPicker/EmojiPanel.js +22 -22
  38. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  39. package/dist/components/EmojiPicker/EmojiPicker.js +1 -0
  40. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  41. package/dist/components/EmojiPicker/IconsPanel.js +13 -13
  42. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  43. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  44. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  45. package/dist/components/FilePicker/FilePicker.d.ts +4 -2
  46. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  47. package/dist/components/FilePicker/FilePicker.js +241 -226
  48. package/dist/components/FilePicker/FilePicker.module.css.js +14 -12
  49. package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
  50. package/dist/components/FilePicker/FilePickerGallery.js +60 -34
  51. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  52. package/dist/components/FilePicker/FilePickerGiphy.js +38 -39
  53. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  54. package/dist/components/FilePicker/FilePickerLink.js +29 -26
  55. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  56. package/dist/components/FilePicker/FilePickerUnsplash.js +42 -43
  57. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  58. package/dist/components/FilePicker/FilePickerUpload.js +51 -35
  59. package/dist/components/FilePicker/coverCollections.d.ts +4 -0
  60. package/dist/components/FilePicker/coverCollections.d.ts.map +1 -0
  61. package/dist/components/FilePicker/coverCollections.js +164 -0
  62. package/dist/components/FilePicker/index.d.ts +1 -0
  63. package/dist/components/FilePicker/index.d.ts.map +1 -1
  64. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  65. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  66. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  67. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  68. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  69. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  70. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  71. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  72. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
  73. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
  74. package/dist/components/Loaders/styles.module.css.js +6 -6
  75. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  76. package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
  77. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  78. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  79. package/dist/components/Notification/Notification.module.css.js +1 -1
  80. package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +3 -3
  81. package/dist/components/OnBoarding/steps/styles.module.css.js +9 -9
  82. package/dist/components/OnBoarding/styles.module.css.js +7 -7
  83. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  84. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  85. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  86. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  87. package/dist/components/table/FrontTable.d.ts.map +1 -1
  88. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  89. package/dist/helpers/getFileType.d.ts +1 -1
  90. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  91. package/dist/helpers/showNotifications.module.css.js +1 -1
  92. package/dist/index.css +1 -1
  93. package/dist/index.d.ts +1 -1
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +466 -463
  96. package/dist/lang/locales/ui_en.json.js +20 -18
  97. package/dist/lang/locales/ui_es.json.js +14 -12
  98. package/dist/lang/locales/ui_ru.json.js +15 -13
  99. package/docs/README.md +499 -499
  100. package/package.json +75 -75
  101. package/dist/components/TextColorIcon.d.ts +0 -8
  102. package/dist/components/TextColorIcon.d.ts.map +0 -1
  103. package/dist/components/TextColorIcon.js +0 -60
@@ -1,9 +1,7 @@
1
- import React from 'react';
2
1
  import { ColorSwatchProps, FlexProps } from '@mantine/core';
3
2
  import { ColorPickerList } from './ColorPickerList';
4
- import { ColorItem } from './types';
5
- export type ColorPickerProps = {
6
- ref?: React.Ref<HTMLDivElement>;
3
+ import type { ColorItem } from './types';
4
+ type ColorPickerProps = {
7
5
  value?: string | null;
8
6
  onChange?: (v: string) => void;
9
7
  allowCustomColor?: boolean;
@@ -14,8 +12,9 @@ export type ColorPickerProps = {
14
12
  fullWidth?: boolean;
15
13
  swatchSize?: number;
16
14
  } & Omit<FlexProps, 'onChange'>;
17
- export interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<React.ComponentPropsWithoutRef<'div'>, keyof Omit<ColorSwatchProps, 'color'>> {
15
+ interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<React.ComponentPropsWithoutRef<'div'>, keyof Omit<ColorSwatchProps, 'color'>> {
18
16
  value?: string | null;
17
+ label?: string;
19
18
  isActive?: boolean;
20
19
  swatchShape?: 'circle' | 'square';
21
20
  swatchVariant?: 'filled' | 'outline';
@@ -23,14 +22,11 @@ export interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<
23
22
  borderColor?: string;
24
23
  bgColor?: string;
25
24
  }
26
- export declare const ColorCircle: ({ value, isActive, swatchShape, swatchVariant, withTick, borderColor, bgColor, ref, ...props }: ColorCircleProps & {
27
- ref?: React.Ref<HTMLDivElement>;
28
- }) => import("react/jsx-runtime").JSX.Element;
29
- export declare const ColorPicker: (({ value, onChange, allowCustomColor, colors, swatchShape, swatchVariant, withTick, fullWidth, swatchSize, ref, ...props }: ColorPickerProps) => import("react/jsx-runtime").JSX.Element) & {
30
- ColorCircle: ({ value, isActive, swatchShape, swatchVariant, withTick, borderColor, bgColor, ref, ...props }: ColorCircleProps & {
31
- ref?: React.Ref<HTMLDivElement>;
32
- }) => import("react/jsx-runtime").JSX.Element;
25
+ export declare const ColorCircle: import("react").ForwardRefExoticComponent<ColorCircleProps & import("react").RefAttributes<HTMLDivElement>>;
26
+ export declare const ColorPicker: import("react").ForwardRefExoticComponent<Omit<ColorPickerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
27
+ ColorCircle: import("react").ForwardRefExoticComponent<ColorCircleProps & import("react").RefAttributes<HTMLDivElement>>;
33
28
  List: typeof ColorPickerList;
34
- Toolbar: React.ForwardRefExoticComponent<import("./ColorPickerToolbar").ColorPickerToolbarProps & React.RefAttributes<HTMLDivElement>>;
29
+ Toolbar: import("react").ForwardRefExoticComponent<import("./ColorPickerToolbar").ColorPickerToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
35
30
  };
31
+ export {};
36
32
  //# sourceMappingURL=ColorPicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","s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C,EACrC,MAAM,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CACtC;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,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;;;;CAItB,CAAC"}
@@ -1,159 +1,153 @@
1
- import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
- import { useState as k } 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 I, getThemeColor as y, Flex as x, Tooltip as R, ColorSwatch as U, parseThemeColor as V, ColorInput as D, ActionIcon as w } from "@mantine/core";
7
- import { IconPalette as F, IconPencil as H } from "@tabler/icons-react";
8
- import M from "styled-components";
9
- import { DEFAULT_VALUES as C } from "../../constants.js";
10
- import { ColorPickerList as q } from "./ColorPickerList.js";
11
- import { ColorPickerToolbar as _ } from "./ColorPickerToolbar.js";
1
+ import { jsx as e, jsxs as h } from "react/jsx-runtime";
2
+ 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";
10
+ import { ColorPickerList as _ } from "./ColorPickerList.js";
12
11
  import { normalizeColorItem as B } from "./types.js";
13
- const G = ({
14
- value: o,
15
- onChange: e,
16
- allowCustomColor: n,
17
- colors: s,
18
- swatchShape: a = "circle",
19
- swatchVariant: m = "filled",
20
- withTick: p = !1,
21
- fullWidth: d = !1,
22
- swatchSize: u = 30,
23
- ref: c,
24
- ...f
25
- }) => {
26
- const t = I(), i = V({
27
- color: o || C.COLORS[0],
28
- theme: t
29
- }), [h, O] = k(i.value), [P, g] = k(!1);
30
- return P ? /* @__PURE__ */ b(x, { align: "center", mih: 30, children: [
31
- /* @__PURE__ */ r(
12
+ const G = y(
13
+ ({
14
+ value: o,
15
+ onChange: l,
16
+ allowCustomColor: n,
17
+ colors: s,
18
+ swatchShape: a = "circle",
19
+ swatchVariant: m = "filled",
20
+ withTick: d = !1,
21
+ fullWidth: p = !1,
22
+ swatchSize: i = 30,
23
+ ...u
24
+ }, 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: [
30
+ /* @__PURE__ */ e(
31
+ H,
32
+ {
33
+ w: "100%",
34
+ popoverProps: {
35
+ withinPortal: !1,
36
+ keepMounted: !1
37
+ },
38
+ maxLength: 7,
39
+ withEyeDropper: !1,
40
+ size: "xs",
41
+ value: z,
42
+ onChange: I,
43
+ onChangeEnd: l,
44
+ placeholder: "Select custom color"
45
+ }
46
+ ),
47
+ /* @__PURE__ */ e(
48
+ v,
49
+ {
50
+ radius: "xl",
51
+ variant: "default",
52
+ color: "gray",
53
+ onClick: () => b(!1),
54
+ children: /* @__PURE__ */ e(M, { size: 16 })
55
+ }
56
+ )
57
+ ] }, 1) : /* @__PURE__ */ h(
58
+ C,
59
+ {
60
+ ref: f,
61
+ ...u,
62
+ justify: p ? "space-between" : "flex-start",
63
+ align: "center",
64
+ children: [
65
+ (s || g.COLORS).map((P, S) => {
66
+ const { value: c, border: T, bg: L, label: $ } = B(P);
67
+ return /* @__PURE__ */ e(
68
+ J,
69
+ {
70
+ value: c,
71
+ label: $,
72
+ isActive: c === o,
73
+ size: i - 4,
74
+ swatchShape: a,
75
+ swatchVariant: m,
76
+ withTick: d,
77
+ borderColor: T,
78
+ bgColor: L,
79
+ onClick: () => l?.(c)
80
+ },
81
+ c || S
82
+ );
83
+ }),
84
+ n && /* @__PURE__ */ e(
85
+ v,
86
+ {
87
+ radius: "xl",
88
+ variant: "default",
89
+ color: "gray",
90
+ onClick: () => b(!0),
91
+ children: /* @__PURE__ */ e(U, { size: 16 })
92
+ }
93
+ )
94
+ ]
95
+ },
96
+ 2
97
+ );
98
+ }
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(
32
103
  D,
33
104
  {
34
- w: "100%",
35
- popoverProps: {
36
- withinPortal: !1,
37
- keepMounted: !1
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
38
117
  },
39
- maxLength: 7,
40
- withEyeDropper: !1,
41
- size: "xs",
42
- value: h,
43
- onChange: O,
44
- onChangeEnd: e,
45
- placeholder: "Select custom color"
46
- }
47
- ),
48
- /* @__PURE__ */ r(
49
- w,
50
- {
51
- radius: "xl",
52
- variant: "default",
53
- color: "gray",
54
- onClick: () => g(!1),
55
- children: /* @__PURE__ */ r(F, { size: 16 })
56
- }
57
- )
58
- ] }, 1) : /* @__PURE__ */ b(
59
- x,
60
- {
61
- ref: c,
62
- ...f,
63
- justify: d ? "space-between" : "flex-start",
64
- align: "center",
65
- mih: 32,
66
- children: [
67
- (s || C.COLORS).map((S, T) => {
68
- const { value: l, border: $, bg: z } = B(S), v = l === o || !o && l === C.COLORS[0];
69
- return /* @__PURE__ */ r(
70
- J,
118
+ ...i,
119
+ children: [
120
+ n && /* @__PURE__ */ e(
121
+ "span",
71
122
  {
72
- value: l,
73
- isActive: v,
74
- size: u - 4,
75
- swatchShape: a,
76
- swatchVariant: m,
77
- withTick: p,
78
- borderColor: $,
79
- bgColor: z,
80
- onClick: () => e?.(l)
81
- },
82
- l || T
83
- );
84
- }),
85
- n && /* @__PURE__ */ r(
86
- w,
87
- {
88
- radius: "xl",
89
- variant: "default",
90
- color: "gray",
91
- onClick: () => g(!0),
92
- children: /* @__PURE__ */ r(H, { size: 16 })
93
- }
94
- )
95
- ]
96
- },
97
- 2
98
- );
99
- }, L = ({
100
- value: o,
101
- isActive: e,
102
- swatchShape: n,
103
- swatchVariant: s = "filled",
104
- withTick: a,
105
- borderColor: m,
106
- bgColor: p,
107
- ref: d,
108
- ...u
109
- }) => {
110
- const c = I(), { t: f } = j("ui"), t = s === "outline", i = o ? y(o, c) : "", h = o ? f(`colorPicker.colors.${o}`, {
111
- defaultValue: o.charAt(0).toUpperCase() + o.slice(1)
112
- }) : "";
113
- return /* @__PURE__ */ r(x, { miw: 32, justify: "center", align: "center", children: /* @__PURE__ */ r(R, { label: h, withArrow: !0, children: /* @__PURE__ */ b(
114
- U,
115
- {
116
- ref: d,
117
- color: t ? "transparent" : i,
118
- radius: n === "circle" ? "xl" : "sm",
119
- style: {
120
- cursor: "pointer",
121
- color: "var(--mantine-color-white)",
122
- background: t ? p || `var(--mantine-color-${o}-light, ${i}20)` : void 0,
123
- border: t ? `2px solid ${m || `var(--mantine-color-${o}-outline, ${i})`}` : void 0
124
- },
125
- ...u,
126
- children: [
127
- e && /* @__PURE__ */ r(
128
- "span",
129
- {
130
- style: {
131
- position: "absolute",
132
- top: -4,
133
- left: -4,
134
- right: -4,
135
- bottom: -4,
136
- border: `2px solid ${o ? y(o, c) : ""}`,
137
- borderRadius: n === "circle" ? "var(--mantine-radius-xl)" : "var(--mantine-radius-sm)",
138
- pointerEvents: "none",
139
- boxSizing: "border-box"
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
+ }
140
134
  }
141
- }
142
- ),
143
- a && e && /* @__PURE__ */ r(E, { size: 20, icon: A })
144
- ]
145
- }
146
- ) }) });
147
- }, J = M(L)`
135
+ ),
136
+ m && n && /* @__PURE__ */ e(A, { size: 20, icon: j })
137
+ ]
138
+ }
139
+ ) }) });
140
+ }
141
+ ), J = V(k)`
148
142
  .mantine-ColorSwatch-colorOverlay {
149
143
  border-radius: ${({ swatchShape: o }) => o === "square" ? "3px" : "50%"};
150
144
  }
151
145
  `, lo = Object.assign(G, {
152
- ColorCircle: L,
153
- List: q,
154
- Toolbar: _
146
+ ColorCircle: k,
147
+ List: _,
148
+ Toolbar: q
155
149
  });
156
150
  export {
157
- L as ColorCircle,
151
+ k as ColorCircle,
158
152
  lo as ColorPicker
159
153
  };
@@ -1,4 +1,4 @@
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 = {
1
+ const t = "_section_tyqb8_3", i = "_sectionLabel_tyqb8_29", n = "_listItem_tyqb8_91", e = "_listItemActive_tyqb8_143", c = "_listItemLabel_tyqb8_151", l = "_listItemSwatch_tyqb8_167", _ = "_grid_tyqb8_183", s = "_inlineSection_tyqb8_323", o = "_inlineSectionLabel_tyqb8_343", a = "_inlineRow_tyqb8_359", b = "_inlineSwatch_tyqb8_377", S = "_inlineSwatchActive_tyqb8_429", w = "_inlineSwatchRound_tyqb8_449", y = {
2
2
  section: t,
3
3
  sectionLabel: i,
4
4
  listItem: n,
@@ -8,20 +8,20 @@ const t = "_section_ux1w4_2", i = "_sectionLabel_ux1w4_15", n = "_listItem_ux1w4
8
8
  grid: _,
9
9
  inlineSection: s,
10
10
  inlineSectionLabel: o,
11
- inlineRow: w,
12
- inlineSwatch: a,
11
+ inlineRow: a,
12
+ inlineSwatch: b,
13
13
  inlineSwatchActive: S,
14
- inlineSwatchRound: u
14
+ inlineSwatchRound: w
15
15
  };
16
16
  export {
17
- x as default,
17
+ y as default,
18
18
  _ as grid,
19
- w as inlineRow,
19
+ a as inlineRow,
20
20
  s as inlineSection,
21
21
  o as inlineSectionLabel,
22
- a as inlineSwatch,
22
+ b as inlineSwatch,
23
23
  S as inlineSwatchActive,
24
- u as inlineSwatchRound,
24
+ w as inlineSwatchRound,
25
25
  n as listItem,
26
26
  e as listItemActive,
27
27
  c as listItemLabel,
@@ -1 +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"}
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;AAsCD,eAAO,MAAM,kBAAkB,oHA2K7B,CAAC"}
@@ -1,121 +1,138 @@
1
- import { jsxs as C, jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as D, useState as M, useCallback as w, useMemo as T } from "react";
3
- import { useMantineColorScheme as z, Box as u, Flex as x, UnstyledButton as H } from "@mantine/core";
4
- import { TextColorIcon as F, HighlightSwatch as N } from "./icons.js";
5
- import { isDefaultColor as I, normalizeColorItem as L } from "./types.js";
6
- import { useRecentColors as j } from "./useRecentColors.js";
7
- import t from "./ColorPicker.module.css.js";
1
+ import { jsxs as S, jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as T, useState as y, useCallback as w, useMemo as H } from "react";
3
+ import { useMantineColorScheme as j, Box as h, Flex as B, Tooltip as P, UnstyledButton as U } from "@mantine/core";
4
+ import { TextColorIcon as K, HighlightSwatch as z } from "./icons.js";
5
+ import { normalizeColorItem as $, isDefaultColor as q } from "./types.js";
6
+ import { useRecentColors as E } from "./useRecentColors.js";
7
+ import c from "./ColorPicker.module.css.js";
8
8
  function k({
9
- isActive: i,
9
+ isActive: s,
10
10
  round: m,
11
- disabled: a,
12
- onClick: h,
13
- children: c
11
+ disabled: u,
12
+ onClick: d,
13
+ children: i,
14
+ tooltipLabel: f
14
15
  }) {
15
- return /* @__PURE__ */ o(
16
- H,
16
+ const v = /* @__PURE__ */ r(
17
+ U,
17
18
  {
18
19
  type: "button",
19
- className: `${t.inlineSwatch}${m ? ` ${t.inlineSwatchRound}` : ""}${i ? ` ${t.inlineSwatchActive}` : ""}`,
20
- onMouseDown: (p) => p.preventDefault(),
21
- onClick: h,
22
- disabled: a,
23
- children: c
20
+ className: `${c.inlineSwatch}${m ? ` ${c.inlineSwatchRound}` : ""}${s ? ` ${c.inlineSwatchActive}` : ""}`,
21
+ onMouseDown: (C) => C.preventDefault(),
22
+ onClick: d,
23
+ disabled: u,
24
+ children: i
24
25
  }
25
26
  );
27
+ return f ? /* @__PURE__ */ r(P, { label: f, withArrow: !0, zIndex: 300, children: v }) : v;
26
28
  }
27
- const Q = D(({ sections: i, onChange: m, withRecentColors: a, maxRecentColors: h = 9, disabled: c, recentColorsLabel: p = "Recently used" }, R) => {
28
- const { colorScheme: y } = z(), S = y === "dark", { recentColors: B, addRecent: g } = j({ maxItems: h }), [v, K] = M(B), d = w(
29
- (e, r, n) => {
30
- a && (g(e, r, n), K((l) => {
31
- const f = l.filter(
32
- (s) => !(s.value === e && s.sectionKey === r)
29
+ const Y = T(({ sections: s, onChange: m, withRecentColors: u, maxRecentColors: d = 9, disabled: i, recentColorsLabel: f = "Recently used" }, v) => {
30
+ const { colorScheme: C } = j(), x = C === "dark", { recentColors: D, addRecent: F } = E({ maxItems: d }), [L, I] = y(D), p = w(
31
+ (e, o, t) => {
32
+ u && (F(e, o, t), I((l) => {
33
+ const n = l.filter(
34
+ (a) => !(a.value === e && a.sectionKey === o)
33
35
  );
34
- return [{ value: e, sectionKey: r, border: n }, ...f].slice(0, h);
35
- })), m(e, r);
36
+ return [{ value: e, sectionKey: o, border: t }, ...n].slice(0, d);
37
+ })), m(e, o);
36
38
  },
37
- [m, a, g]
38
- ), A = T(() => {
39
+ [m, u, F]
40
+ ), g = H(() => {
39
41
  const e = {};
40
- for (const r of i) e[r.key] = r;
42
+ for (const o of s) e[o.key] = o;
41
43
  return e;
42
- }, [i]), b = w(
43
- (e) => I(e) ? S ? "#FFFFFF" : "#000000" : e,
44
- [S]
44
+ }, [s]), M = w(
45
+ (e, o) => {
46
+ if (!o) return;
47
+ const t = g[o];
48
+ if (!t) return;
49
+ const l = t.colors.find((b) => $(b).value === e);
50
+ if (!l) return;
51
+ const { label: n, value: a } = $(l);
52
+ return n || a;
53
+ },
54
+ [g]
55
+ ), N = w(
56
+ (e) => q(e) ? x ? "#FFFFFF" : "#000000" : e,
57
+ [x]
45
58
  );
46
- return /* @__PURE__ */ C(u, { ref: R, children: [
47
- a && v.length > 0 && /* @__PURE__ */ C(u, { className: t.inlineSection, children: [
48
- /* @__PURE__ */ o(u, { className: t.inlineSectionLabel, children: p }),
49
- /* @__PURE__ */ o(x, { className: t.inlineRow, gap: 2, children: v.map((e, r) => {
50
- const n = e.sectionKey ? A[e.sectionKey] : void 0;
51
- return n?.key === "textColor" || n?.key === "color" || e.sectionKey === "color" ? /* @__PURE__ */ o(
59
+ return /* @__PURE__ */ S(h, { ref: v, children: [
60
+ u && L.length > 0 && /* @__PURE__ */ S(h, { className: c.inlineSection, children: [
61
+ /* @__PURE__ */ r(h, { className: c.inlineSectionLabel, children: f }),
62
+ /* @__PURE__ */ r(B, { className: c.inlineRow, gap: 2, children: L.map((e, o) => {
63
+ const t = e.sectionKey ? g[e.sectionKey] : void 0, l = t?.key === "textColor" || t?.key === "color" || e.sectionKey === "color", n = M(e.value, e.sectionKey);
64
+ return l ? /* @__PURE__ */ r(
52
65
  k,
53
66
  {
54
67
  isActive: !1,
55
- disabled: c,
56
- onClick: () => d(e.value, e.sectionKey ?? ""),
57
- children: /* @__PURE__ */ o(
58
- F,
68
+ disabled: i,
69
+ tooltipLabel: n,
70
+ onClick: () => p(e.value, e.sectionKey ?? ""),
71
+ children: /* @__PURE__ */ r(
72
+ K,
59
73
  {
60
74
  size: 20,
61
- color: b(e.value),
75
+ color: N(e.value),
62
76
  showBorder: !0
63
77
  }
64
78
  )
65
79
  },
66
- `${e.sectionKey}-${e.value}-${r}`
67
- ) : /* @__PURE__ */ o(
80
+ `${e.sectionKey}-${e.value}-${o}`
81
+ ) : /* @__PURE__ */ r(
68
82
  k,
69
83
  {
70
84
  isActive: !1,
71
85
  round: !0,
72
- disabled: c,
73
- onClick: () => d(e.value, e.sectionKey ?? ""),
74
- children: /* @__PURE__ */ o(
75
- N,
86
+ disabled: i,
87
+ tooltipLabel: n,
88
+ onClick: () => p(e.value, e.sectionKey ?? ""),
89
+ children: /* @__PURE__ */ r(
90
+ z,
76
91
  {
77
92
  bgColor: e.value,
78
93
  borderColor: e.border || "var(--mantine-color-default-border)"
79
94
  }
80
95
  )
81
96
  },
82
- `${e.sectionKey}-${e.value}-${r}`
97
+ `${e.sectionKey}-${e.value}-${o}`
83
98
  );
84
99
  }) })
85
100
  ] }),
86
- i.map((e) => {
87
- const r = e.key === "highlight" || e.key === "background" || e.key === "textHighlight";
88
- return /* @__PURE__ */ C(u, { className: t.inlineSection, children: [
89
- e.label && /* @__PURE__ */ o(u, { className: t.inlineSectionLabel, children: e.label }),
90
- /* @__PURE__ */ o(x, { className: t.inlineRow, gap: 2, children: e.colors.map((n) => {
91
- const { value: l, border: f } = L(n), s = l === e.value, $ = b(l);
92
- return r ? /* @__PURE__ */ o(
101
+ s.map((e) => {
102
+ const o = e.key === "highlight" || e.key === "background" || e.key === "textHighlight";
103
+ return /* @__PURE__ */ S(h, { className: c.inlineSection, children: [
104
+ e.label && /* @__PURE__ */ r(h, { className: c.inlineSectionLabel, children: e.label }),
105
+ /* @__PURE__ */ r(B, { className: c.inlineRow, gap: 2, children: e.colors.map((t) => {
106
+ const { value: l, border: n, label: a } = $(t), b = l === e.value, R = N(l), A = a || l;
107
+ return o ? /* @__PURE__ */ r(
93
108
  k,
94
109
  {
95
- isActive: s,
110
+ isActive: b,
96
111
  round: !0,
97
- disabled: c,
98
- onClick: () => d(l, e.key, f),
99
- children: /* @__PURE__ */ o(
100
- N,
112
+ disabled: i,
113
+ tooltipLabel: A,
114
+ onClick: () => p(l, e.key, n),
115
+ children: /* @__PURE__ */ r(
116
+ z,
101
117
  {
102
118
  bgColor: l,
103
- borderColor: f || $
119
+ borderColor: n || R
104
120
  }
105
121
  )
106
122
  },
107
123
  l
108
- ) : /* @__PURE__ */ o(
124
+ ) : /* @__PURE__ */ r(
109
125
  k,
110
126
  {
111
- isActive: s,
112
- disabled: c,
113
- onClick: () => d(l, e.key),
114
- children: /* @__PURE__ */ o(
115
- F,
127
+ isActive: b,
128
+ disabled: i,
129
+ tooltipLabel: A,
130
+ onClick: () => p(l, e.key),
131
+ children: /* @__PURE__ */ r(
132
+ K,
116
133
  {
117
134
  size: 20,
118
- color: $,
135
+ color: R,
119
136
  showBorder: !0
120
137
  }
121
138
  )
@@ -128,5 +145,5 @@ const Q = D(({ sections: i, onChange: m, withRecentColors: a, maxRecentColors: h
128
145
  ] });
129
146
  });
130
147
  export {
131
- Q as ColorPickerToolbar
148
+ Y as ColorPickerToolbar
132
149
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as c } from "react/jsx-runtime";
2
2
  function s({
3
3
  size: t = 20,
4
4
  color: r = "var(--mantine-color-white)",
@@ -26,7 +26,7 @@ function s({
26
26
  fill: "none"
27
27
  }
28
28
  ),
29
- /* @__PURE__ */ n("g", { transform: "translate(4.3, 2.85) scale(0.95)", children: /* @__PURE__ */ n(
29
+ /* @__PURE__ */ n("g", { transform: "translate(4.54, 4.2) scale(0.95)", children: /* @__PURE__ */ n(
30
30
  "path",
31
31
  {
32
32
  d: "M5.74945 0C6.57421 0 7.09678 0.678265 7.50336 1.43555C7.93323 2.23628 8.38332 3.42022 8.95843 4.92676L11.4623 11.4873C11.5716 11.7742 11.4279 12.0955 11.1411 12.2051C10.8541 12.3144 10.5329 12.1706 10.4233 11.8838L8.5766 7.04883H2.9223L1.07562 11.8838C0.965974 12.1707 0.644849 12.3146 0.357848 12.2051C0.0710441 12.0955 -0.0726477 11.7742 0.0365593 11.4873L2.54047 4.92676C3.11563 3.42012 3.56662 2.23629 3.99652 1.43555C4.40306 0.678393 4.92485 8.51363e-05 5.74945 0ZM5.74945 1.11328C5.62925 1.11335 5.38778 1.19685 4.97699 1.96191C4.5893 2.68404 4.16803 3.7852 3.5805 5.32422L3.34711 5.93555H8.15179L7.9184 5.32422C7.33089 3.78522 6.9096 2.68403 6.52191 1.96191C6.11099 1.19664 5.86959 1.11328 5.74945 1.11328Z",
@@ -42,7 +42,7 @@ function d({
42
42
  bgColor: r,
43
43
  borderColor: e
44
44
  }) {
45
- const o = r === "inherit" || r === "" || r === "default", i = t * 0.375, l = o ? "var(--mantine-color-body)" : r, h = o ? "var(--mantine-color-default-border)" : e;
45
+ const o = r === "inherit" || r === "" || r === "default", i = t / 2 - 2, l = o ? "var(--mantine-color-body)" : r, h = o ? "var(--mantine-color-default-border)" : e;
46
46
  return /* @__PURE__ */ n(
47
47
  "svg",
48
48
  {
@@ -59,7 +59,7 @@ function d({
59
59
  r: i,
60
60
  fill: l,
61
61
  stroke: h,
62
- strokeWidth: "1.5"
62
+ strokeWidth: "1"
63
63
  }
64
64
  )
65
65
  }