@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.
- package/dist/assets/default-workspace-avatar.jpg.js +4 -0
- package/dist/assets/layers-logo-full.svg.js +2 -3
- package/dist/assets/layers-logo-full.svg2.js +3 -2
- package/dist/assets/layers-logo-icon.svg.js +2 -3
- package/dist/assets/layers-logo-icon.svg2.js +3 -2
- package/dist/assets/projects/figureA.svg.js +4 -0
- package/dist/assets/projects/figureB.svg.js +4 -0
- package/dist/assets/qwebchannel.d.ts +15 -0
- package/dist/assets/qwebchannel.d.ts.map +1 -0
- package/dist/assets/taskPriorities/high.svg.js +5 -0
- package/dist/assets/taskPriorities/low.svg.js +5 -0
- package/dist/assets/taskPriorities/none.svg.js +5 -0
- package/dist/assets/taskPriorities/normal.svg.js +5 -0
- package/dist/assets/taskPriorities/urgent.svg.js +5 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts +3 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.js +69 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +27 -0
- package/dist/components/AnimatedFigurePage/types.d.ts +15 -0
- package/dist/components/AnimatedFigurePage/types.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/useParallax.d.ts +6 -0
- package/dist/components/AnimatedFigurePage/useParallax.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/useParallax.js +29 -0
- package/dist/components/AppContainer/AppContainer.d.ts +1 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +37 -36
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +80 -45
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +60 -69
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +57 -51
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +3 -1
- package/dist/components/AppContainer/types.d.ts +3 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +9 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +88 -74
- package/dist/components/ColorPicker/ColorPicker.module.css.js +31 -0
- package/dist/components/ColorPicker/ColorPickerList.d.ts +6 -0
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -0
- package/dist/components/ColorPicker/ColorPickerList.js +134 -0
- package/dist/components/ColorPicker/ColorPickerPopover.d.ts +6 -6
- package/dist/components/ColorPicker/ColorPickerPopover.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerPopover.js +29 -31
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +13 -0
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -0
- package/dist/components/ColorPicker/ColorPickerToolbar.js +132 -0
- package/dist/components/ColorPicker/icons.d.ts +11 -0
- package/dist/components/ColorPicker/icons.d.ts.map +1 -0
- package/dist/components/ColorPicker/icons.js +71 -0
- package/dist/components/ColorPicker/types.d.ts +49 -0
- package/dist/components/ColorPicker/types.d.ts.map +1 -0
- package/dist/components/ColorPicker/types.js +10 -0
- package/dist/components/ColorPicker/useRecentColors.d.ts +13 -0
- package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -0
- package/dist/components/ColorPicker/useRecentColors.js +39 -0
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +115 -111
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +12 -10
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +3 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +49 -46
- package/dist/components/EmojiPicker/IconsPanel.d.ts +2 -1
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +47 -45
- package/dist/components/EmojiPicker/custom-icons/customIcons.d.ts.map +1 -1
- package/dist/components/EmojiPicker/custom-icons/customIcons.js +66 -31
- package/dist/components/EntityIcon.d.ts +3 -3
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +59 -35
- package/dist/components/EntityTitle/EntityTitle.d.ts +1 -1
- package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
- package/dist/components/EntityTitle/EntityTitle.js +34 -34
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +111 -123
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +41 -39
- package/dist/components/FormViewer/components/fields/UploadField/UploadField.d.ts.map +1 -1
- package/dist/components/FormViewer/components/fields/UploadField/UploadField.js +34 -33
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +3 -3
- package/dist/components/Logotype.d.ts +2 -1
- package/dist/components/Logotype.d.ts.map +1 -1
- package/dist/components/Logotype.js +58 -49
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +122 -107
- package/dist/components/NavMenu/types.d.ts +1 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/ProjectIcon/ProjectIcon.js +13 -13
- package/dist/components/TreeIndent/TreeIndent.d.ts +9 -0
- package/dist/components/TreeIndent/TreeIndent.d.ts.map +1 -0
- package/dist/components/TreeIndent/TreeIndent.js +15 -0
- package/dist/components/TreeIndent/TreeIndent.module.css.js +11 -0
- package/dist/components/TreeIndent/index.d.ts +2 -0
- package/dist/components/TreeIndent/index.d.ts.map +1 -0
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +11 -11
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +97 -101
- package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
- package/dist/config/brand.d.ts +1 -0
- package/dist/config/brand.d.ts.map +1 -1
- package/dist/config/brand.js +42 -34
- package/dist/config/envConfig.d.ts +40 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +29 -10
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +15 -4
- package/dist/helpers/getFileIcons.d.ts.map +1 -1
- package/dist/helpers/getFileIcons.js +34 -29
- package/dist/helpers/getFileType.d.ts +1 -1
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +3 -3
- package/dist/helpers/hotjar.d.ts.map +1 -1
- package/dist/helpers/hotjar.js +11 -7
- package/dist/helpers/platform.js +4 -4
- package/dist/helpers/showNotifications.d.ts +3 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +79 -44
- package/dist/hooks/useDateFnsLocale.d.ts +2 -0
- package/dist/hooks/useDateFnsLocale.d.ts.map +1 -1
- package/dist/hooks/useDateFnsLocale.js +9 -8
- package/dist/hooks/useDateUtils.d.ts.map +1 -1
- package/dist/hooks/useDateUtils.js +19 -19
- package/dist/hooks/useFormatDistance.d.ts.map +1 -1
- package/dist/hooks/useFormatDistance.js +6 -6
- package/dist/hooks/useNumberQueryParam.d.ts +1 -1
- package/dist/hooks/useNumberQueryParam.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +516 -494
- package/dist/lang/locales/ui_en.json.js +7 -7
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +11 -11
- package/dist/utils/formatStorage.d.ts +9 -0
- package/dist/utils/formatStorage.d.ts.map +1 -1
- package/dist/utils/formatStorage.js +14 -10
- 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?:
|
|
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;
|
|
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
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Tick02Icon as
|
|
4
|
-
import { HugeiconsIcon as
|
|
5
|
-
import { useMantineTheme as
|
|
6
|
-
import { IconPalette as
|
|
7
|
-
import
|
|
8
|
-
import { DEFAULT_VALUES as
|
|
9
|
-
|
|
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:
|
|
12
|
-
onChange:
|
|
13
|
-
allowCustomColor:
|
|
14
|
-
colors:
|
|
15
|
-
swatchShape:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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:
|
|
38
|
-
onChange:
|
|
39
|
-
onChangeEnd:
|
|
41
|
+
value: z,
|
|
42
|
+
onChange: I,
|
|
43
|
+
onChangeEnd: i,
|
|
40
44
|
placeholder: "Select custom color"
|
|
41
45
|
}
|
|
42
46
|
),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
47
|
+
/* @__PURE__ */ e(
|
|
48
|
+
x,
|
|
45
49
|
{
|
|
46
50
|
radius: "xl",
|
|
47
51
|
variant: "default",
|
|
48
52
|
color: "gray",
|
|
49
|
-
onClick: () =>
|
|
50
|
-
children: /* @__PURE__ */
|
|
53
|
+
onClick: () => C(!1),
|
|
54
|
+
children: /* @__PURE__ */ e(H, { size: 16 })
|
|
51
55
|
}
|
|
52
56
|
)
|
|
53
|
-
] }, 1) : /* @__PURE__ */
|
|
54
|
-
|
|
57
|
+
] }, 1) : /* @__PURE__ */ f(
|
|
58
|
+
h,
|
|
55
59
|
{
|
|
56
|
-
ref:
|
|
57
|
-
...
|
|
58
|
-
justify:
|
|
60
|
+
ref: r,
|
|
61
|
+
...u,
|
|
62
|
+
justify: l ? "space-between" : "flex-start",
|
|
59
63
|
align: "center",
|
|
60
|
-
mih: 32,
|
|
61
64
|
children: [
|
|
62
|
-
(
|
|
63
|
-
const
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
|
|
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:
|
|
68
|
-
isActive:
|
|
69
|
-
size:
|
|
70
|
-
swatchShape:
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
80
|
+
s || S
|
|
75
81
|
);
|
|
76
82
|
}),
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
n && /* @__PURE__ */ e(
|
|
84
|
+
x,
|
|
79
85
|
{
|
|
80
86
|
radius: "xl",
|
|
81
87
|
variant: "default",
|
|
82
88
|
color: "gray",
|
|
83
|
-
onClick: () =>
|
|
84
|
-
children: /* @__PURE__ */
|
|
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
|
-
),
|
|
93
|
-
({ value:
|
|
94
|
-
const
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
-
|
|
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:
|
|
99
|
-
color:
|
|
100
|
-
radius:
|
|
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
|
-
...
|
|
117
|
+
...l,
|
|
106
118
|
children: [
|
|
107
|
-
|
|
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 ${
|
|
117
|
-
borderRadius:
|
|
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
|
-
|
|
135
|
+
a && i && /* @__PURE__ */ e(j, { size: 20, icon: $ })
|
|
124
136
|
]
|
|
125
137
|
}
|
|
126
138
|
) }) });
|
|
127
139
|
}
|
|
128
|
-
),
|
|
140
|
+
), G = U(w)`
|
|
129
141
|
.mantine-ColorSwatch-colorOverlay {
|
|
130
|
-
border-radius: ${({ swatchShape:
|
|
142
|
+
border-radius: ${({ swatchShape: o }) => o === "square" ? "3px" : "50%"};
|
|
131
143
|
}
|
|
132
|
-
`,
|
|
133
|
-
ColorCircle:
|
|
144
|
+
`, io = Object.assign(B, {
|
|
145
|
+
ColorCircle: w,
|
|
146
|
+
List: q,
|
|
147
|
+
Toolbar: V
|
|
134
148
|
});
|
|
135
149
|
export {
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
2
|
+
import { PopoverProps } from '@mantine/core';
|
|
3
|
+
type ColorPickerPopoverProps = {
|
|
3
4
|
value?: string;
|
|
4
5
|
onChange?: (v: string) => void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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,
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ColorPicker as
|
|
5
|
-
const
|
|
6
|
-
value:
|
|
7
|
-
onChange:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
14
|
+
const { t: s } = a("ui");
|
|
15
|
+
return /* @__PURE__ */ l(
|
|
16
|
+
r,
|
|
16
17
|
{
|
|
17
|
-
opened:
|
|
18
|
+
opened: c,
|
|
18
19
|
onChange: e,
|
|
19
20
|
position: "bottom-start",
|
|
20
|
-
|
|
21
|
+
withinPortal: m,
|
|
22
|
+
floatingStrategy: p,
|
|
21
23
|
children: [
|
|
22
|
-
/* @__PURE__ */ o(
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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"}
|