@layers-app/shared 0.3.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +10 -10
  2. package/dist/components/AnimatedFigurePage/useParallax.d.ts +2 -2
  3. package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
  4. package/dist/components/AppContainer/components/AppSidebarButton.d.ts +1 -4
  5. package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
  6. package/dist/components/AppContainer/components/AppSidebarButton.js +15 -22
  7. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts.map +1 -1
  8. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +21 -22
  9. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  10. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +91 -48
  11. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
  12. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  13. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts +1 -3
  14. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
  15. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +63 -89
  16. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts +1 -1
  17. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
  18. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +26 -35
  19. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  20. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +1 -1
  21. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
  22. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +36 -43
  23. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts +0 -4
  24. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
  25. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +20 -59
  26. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +18 -28
  27. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  28. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +18 -22
  29. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
  30. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
  31. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  32. package/dist/components/ColorPicker/ColorPicker.d.ts +18 -23
  33. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  34. package/dist/components/ColorPicker/ColorPicker.js +139 -145
  35. package/dist/components/ColorPicker/ColorPicker.module.css.js +8 -8
  36. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  37. package/dist/components/ColorPicker/ColorPickerToolbar.js +88 -71
  38. package/dist/components/ColorPicker/icons.js +4 -4
  39. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  40. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  41. package/dist/components/CommentComposer/CommentEditorHotkeys.js +4 -3
  42. package/dist/components/CommentComposer/index.js +1 -1
  43. package/dist/components/CommentComposer/useVirtualAnchor.d.ts +1 -1
  44. package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -1
  45. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  46. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  47. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  48. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  49. package/dist/components/EmojiPicker/EmojiPanel.js +22 -22
  50. package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -1
  51. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  52. package/dist/components/EmojiPicker/EmojiPicker.js +1 -0
  53. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  54. package/dist/components/EmojiPicker/IconsPanel.js +13 -13
  55. package/dist/components/EntityIcon.d.ts.map +1 -1
  56. package/dist/components/EntityIcon.js +33 -43
  57. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  58. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  59. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  60. package/dist/components/FilePicker/FilePicker.d.ts +4 -2
  61. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  62. package/dist/components/FilePicker/FilePicker.js +241 -226
  63. package/dist/components/FilePicker/FilePicker.module.css.js +14 -12
  64. package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
  65. package/dist/components/FilePicker/FilePickerGallery.js +60 -34
  66. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  67. package/dist/components/FilePicker/FilePickerGiphy.js +38 -39
  68. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  69. package/dist/components/FilePicker/FilePickerLink.js +29 -26
  70. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  71. package/dist/components/FilePicker/FilePickerUnsplash.js +42 -43
  72. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  73. package/dist/components/FilePicker/FilePickerUpload.js +51 -35
  74. package/dist/components/FilePicker/coverCollections.d.ts +4 -0
  75. package/dist/components/FilePicker/coverCollections.d.ts.map +1 -0
  76. package/dist/components/FilePicker/coverCollections.js +164 -0
  77. package/dist/components/FilePicker/index.d.ts +1 -0
  78. package/dist/components/FilePicker/index.d.ts.map +1 -1
  79. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  80. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  81. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  82. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  83. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  84. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  85. package/dist/components/FormViewer/helpers/conditions.d.ts +38 -38
  86. package/dist/components/FormViewer/helpers/helpers.d.ts +38 -38
  87. package/dist/components/FormViewer/helpers/steps.d.ts +38 -38
  88. package/dist/components/FormViewer/hooks/useActiveControl.d.ts +19 -19
  89. package/dist/components/FormViewer/hooks/useActiveStep.d.ts +38 -38
  90. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +0 -6
  91. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts.map +1 -1
  92. package/dist/components/FormViewer/hooks/useFormGlobalTheme.js +3 -4
  93. package/dist/components/FormViewer/hooks/useFormMobile.d.ts +1 -1
  94. package/dist/components/FormViewer/hooks/useFormMobile.d.ts.map +1 -1
  95. package/dist/components/FormViewer/store/formStore.d.ts +248 -248
  96. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  97. package/dist/components/FormViewer/store/formStoreApi.d.ts +124 -124
  98. package/dist/components/FormViewer/store/selectors.d.ts +11655 -11655
  99. package/dist/components/FormViewer/types/form.d.ts +1 -1
  100. package/dist/components/FormViewer/types/form.d.ts.map +1 -1
  101. package/dist/components/FormViewer/types/schemes.d.ts +6358 -381
  102. package/dist/components/FormViewer/types/schemes.d.ts.map +1 -1
  103. package/dist/components/FormViewer/types/schemes.js +1 -1
  104. package/dist/components/GroupAvatar/index.d.ts +1 -3
  105. package/dist/components/GroupAvatar/index.d.ts.map +1 -1
  106. package/dist/components/GroupAvatar/index.js +21 -24
  107. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  108. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
  109. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
  110. package/dist/components/Loaders/styles.module.css.js +6 -6
  111. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  112. package/dist/components/MediaLibrary/MediaLibraryRow.js +7 -7
  113. package/dist/components/NavMenu/NavMenu.d.ts +1 -3
  114. package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
  115. package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
  116. package/dist/components/NavMenu/components/DnDProvider.d.ts +1 -1
  117. package/dist/components/NavMenu/components/DnDProvider.d.ts.map +1 -1
  118. package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts +1 -7
  119. package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts.map +1 -1
  120. package/dist/components/NavMenu/components/NavMenuActionIcon.js +23 -21
  121. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  122. package/dist/components/NewColorPicker/components/Target.d.ts +1 -3
  123. package/dist/components/NewColorPicker/components/Target.d.ts.map +1 -1
  124. package/dist/components/NewColorPicker/components/Target.js +43 -48
  125. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  126. package/dist/components/Notification/Notification.js +1 -3
  127. package/dist/components/Notification/Notification.module.css.js +1 -1
  128. package/dist/components/Notification/NotificationCard.d.ts +1 -3
  129. package/dist/components/Notification/NotificationCard.d.ts.map +1 -1
  130. package/dist/components/Notification/NotificationCard.js +86 -87
  131. package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +3 -3
  132. package/dist/components/OnBoarding/steps/styles.module.css.js +9 -9
  133. package/dist/components/OnBoarding/styles.module.css.js +7 -7
  134. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +1 -1
  135. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -1
  136. package/dist/components/OnboardingTour/OnboardingTourWrapper.js +74 -70
  137. package/dist/components/ProjectIcon/ProjectIcon.d.ts +12 -7
  138. package/dist/components/ProjectIcon/ProjectIcon.d.ts.map +1 -1
  139. package/dist/components/ProjectIcon/ProjectIcon.js +60 -58
  140. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  141. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  142. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  143. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  144. package/dist/components/UserAvatar/index.d.ts +1 -2
  145. package/dist/components/UserAvatar/index.d.ts.map +1 -1
  146. package/dist/components/UserAvatar/index.js +35 -38
  147. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts +3 -3
  148. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts.map +1 -1
  149. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +18 -19
  150. package/dist/components/WorkspaceMenu/WorkspaceItem.js +17 -17
  151. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +7 -7
  152. package/dist/components/table/FrontTable.d.ts.map +1 -1
  153. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  154. package/dist/config/envConfig.d.ts +0 -8
  155. package/dist/config/envConfig.d.ts.map +1 -1
  156. package/dist/config/envConfig.js +13 -21
  157. package/dist/helpers/getFileIcons.d.ts.map +1 -1
  158. package/dist/helpers/getFileIcons.js +45 -63
  159. package/dist/helpers/getFileType.d.ts +1 -1
  160. package/dist/helpers/getFileType.d.ts.map +1 -1
  161. package/dist/helpers/getFileType.js +8 -29
  162. package/dist/helpers/getPartOfTheDay.d.ts +1 -1
  163. package/dist/helpers/platform.d.ts +1 -1
  164. package/dist/helpers/platform.d.ts.map +1 -1
  165. package/dist/helpers/platform.js +4 -5
  166. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  167. package/dist/helpers/showNotifications.d.ts.map +1 -1
  168. package/dist/helpers/showNotifications.js +29 -30
  169. package/dist/helpers/showNotifications.module.css.js +1 -1
  170. package/dist/hooks/useOutsideClick.d.ts +1 -1
  171. package/dist/hooks/useOutsideClick.d.ts.map +1 -1
  172. package/dist/index.css +1 -1
  173. package/dist/index.d.ts +1 -2
  174. package/dist/index.d.ts.map +1 -1
  175. package/dist/index.js +465 -467
  176. package/dist/lang/locales/ui_en.json.js +20 -18
  177. package/dist/lang/locales/ui_es.json.js +14 -12
  178. package/dist/lang/locales/ui_ru.json.js +15 -13
  179. package/dist/node_modules/countries-and-timezones/esm/index.js +4011 -281
  180. package/docs/README.md +499 -499
  181. package/package.json +75 -75
  182. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts +0 -6
  183. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts.map +0 -1
  184. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.js +0 -16
  185. package/dist/components/TextColorIcon.d.ts +0 -8
  186. package/dist/components/TextColorIcon.d.ts.map +0 -1
  187. package/dist/components/TextColorIcon.js +0 -60
  188. package/dist/helpers/offlineSuppression.d.ts +0 -3
  189. package/dist/helpers/offlineSuppression.d.ts.map +0 -1
  190. package/dist/helpers/offlineSuppression.js +0 -8
@@ -6,11 +6,11 @@ import { useDisclosure as M } from "@mantine/hooks";
6
6
  import { getFileIcons as P } from "../../helpers/getFileIcons.js";
7
7
  import { getFileType as A } from "../../helpers/getFileType.js";
8
8
  import { AttachmentsGalleryModal as B } from "../AttachmentsGalleryModal/AttachmentsGalleryModal.js";
9
- import a from "./AttachmentsPreview.module.css.js";
9
+ import t from "./AttachmentsPreview.module.css.js";
10
10
  const U = ({
11
11
  files: o,
12
12
  onRemove: i,
13
- mode: t,
13
+ mode: a,
14
14
  parentIsExisting: u
15
15
  }) => {
16
16
  const [T, { open: w, close: b }] = M(!1), s = o.filter((e) => e.isImage), d = o.filter((e) => !e.isImage), D = s.map((e) => ({
@@ -35,7 +35,7 @@ const U = ({
35
35
  };
36
36
  return o.length === 0 ? null : /* @__PURE__ */ n(C, { children: [
37
37
  /* @__PURE__ */ n(v, { gap: "10px", w: "100%", tabIndex: 0, children: [
38
- s.length > 0 && /* @__PURE__ */ r(z, { gap: "xs", children: s.map((e) => {
38
+ s.length > 0 && /* @__PURE__ */ r(z, { gutter: "xs", children: s.map((e) => {
39
39
  const l = o.indexOf(e);
40
40
  return /* @__PURE__ */ r(z.Col, { span: "content", children: /* @__PURE__ */ n(
41
41
  h,
@@ -43,7 +43,7 @@ const U = ({
43
43
  w: 56,
44
44
  h: 56,
45
45
  pos: "relative",
46
- className: a.imagePreviewWrapper,
46
+ className: t.imagePreviewWrapper,
47
47
  children: [
48
48
  /* @__PURE__ */ r(
49
49
  F,
@@ -62,11 +62,11 @@ const U = ({
62
62
  /* @__PURE__ */ r(
63
63
  f,
64
64
  {
65
- visible: e.isTemp && t === "view" && u,
65
+ visible: e.isTemp && a === "view" && u,
66
66
  loaderProps: { size: 20 }
67
67
  }
68
68
  ),
69
- t === "view" && !e.isTemp && /* @__PURE__ */ r(
69
+ a === "view" && !e.isTemp && /* @__PURE__ */ r(
70
70
  c,
71
71
  {
72
72
  component: "a",
@@ -79,11 +79,11 @@ const U = ({
79
79
  top: 2,
80
80
  right: 2,
81
81
  bg: "var(--mantine-color-dark-filled, #2E2E2E)",
82
- className: a.downloadButton,
82
+ className: t.downloadButton,
83
83
  children: /* @__PURE__ */ r(x, { size: 16, icon: g })
84
84
  }
85
85
  ),
86
- t === "draft" && i && /* @__PURE__ */ r(
86
+ a === "draft" && i && /* @__PURE__ */ r(
87
87
  c,
88
88
  {
89
89
  size: "20px",
@@ -93,7 +93,7 @@ const U = ({
93
93
  pos: "absolute",
94
94
  color: "dark",
95
95
  onClick: () => i(l),
96
- className: a.deleteButton,
96
+ className: t.deleteButton,
97
97
  children: /* @__PURE__ */ r(I, { size: "12px" })
98
98
  }
99
99
  )
@@ -105,15 +105,15 @@ const U = ({
105
105
  h,
106
106
  {
107
107
  w: "100%",
108
- className: a.filePreviewList,
108
+ className: t.filePreviewList,
109
109
  "data-many": d.length >= 4,
110
110
  children: d.map((e) => {
111
111
  const l = o.indexOf(e);
112
- return /* @__PURE__ */ n(h, { className: a.filePreviewWrapper, children: [
112
+ return /* @__PURE__ */ n(h, { className: t.filePreviewWrapper, children: [
113
113
  /* @__PURE__ */ r(
114
114
  f,
115
115
  {
116
- visible: e.isTemp && t === "view" && u,
116
+ visible: e.isTemp && a === "view" && u,
117
117
  loaderProps: { size: 20 }
118
118
  }
119
119
  ),
@@ -134,11 +134,7 @@ const U = ({
134
134
  flex: 1,
135
135
  miw: 0,
136
136
  children: [
137
- P(
138
- A(e.type, !1, e.name),
139
- !1,
140
- 36
141
- ),
137
+ P(A(e.type), !1, 36),
142
138
  /* @__PURE__ */ n(v, { gap: 0, flex: 1, miw: 0, children: [
143
139
  /* @__PURE__ */ r(
144
140
  N,
@@ -146,7 +142,7 @@ const U = ({
146
142
  size: "sm",
147
143
  truncate: !0,
148
144
  title: e.name,
149
- className: a.fileDownloadName,
145
+ className: t.fileDownloadName,
150
146
  component: "a",
151
147
  href: e.url,
152
148
  download: e.name,
@@ -163,7 +159,7 @@ const U = ({
163
159
  ]
164
160
  }
165
161
  ),
166
- t === "view" && !e.isTemp && /* @__PURE__ */ r(
162
+ a === "view" && !e.isTemp && /* @__PURE__ */ r(
167
163
  c,
168
164
  {
169
165
  component: "a",
@@ -173,14 +169,14 @@ const U = ({
173
169
  variant: "subtle",
174
170
  color: "gray",
175
171
  size: "sm",
176
- className: a.downloadButton,
172
+ className: t.downloadButton,
177
173
  children: /* @__PURE__ */ r(x, { size: 16, icon: g })
178
174
  }
179
175
  )
180
176
  ]
181
177
  }
182
178
  ),
183
- t === "draft" && i && /* @__PURE__ */ r(
179
+ a === "draft" && i && /* @__PURE__ */ r(
184
180
  c,
185
181
  {
186
182
  size: "xs",
@@ -189,7 +185,7 @@ const U = ({
189
185
  variant: "filled",
190
186
  color: "dark",
191
187
  onClick: () => i(l),
192
- className: a.deleteButton,
188
+ className: t.deleteButton,
193
189
  children: /* @__PURE__ */ r(I, { size: "12px" })
194
190
  }
195
191
  )
@@ -1,4 +1,4 @@
1
- const e = "_imagePreviewWrapper_qqm20_1", t = "_deleteButton_qqm20_6", o = "_downloadButton_qqm20_13", i = "_filePreviewList_qqm20_32", r = "_fileDownloadName_qqm20_45", a = "_filePreviewWrapper_qqm20_51", l = {
1
+ const e = "_imagePreviewWrapper_1814g_1", t = "_deleteButton_1814g_11", o = "_downloadButton_1814g_25", i = "_filePreviewList_1814g_63", r = "_fileDownloadName_1814g_89", a = "_filePreviewWrapper_1814g_101", l = {
2
2
  imagePreviewWrapper: e,
3
3
  deleteButton: t,
4
4
  downloadButton: o,
@@ -1,15 +1,15 @@
1
- const o = "_wrapper_1y9p0_1", s = "_logo_1y9p0_8", p = "_desktop_1y9p0_23", _ = "_shadow_1y9p0_37", t = "_desktopShadow_1y9p0_50", d = {
1
+ const o = "_wrapper_1n4or_1", s = "_logo_1n4or_15", _ = "_desktop_1n4or_45", t = "_shadow_1n4or_73", d = "_desktopShadow_1n4or_99", p = {
2
2
  wrapper: o,
3
3
  logo: s,
4
- desktop: p,
5
- shadow: _,
6
- desktopShadow: t
4
+ desktop: _,
5
+ shadow: t,
6
+ desktopShadow: d
7
7
  };
8
8
  export {
9
- d as default,
10
- p as desktop,
11
- t as desktopShadow,
9
+ p as default,
10
+ _ as desktop,
11
+ d as desktopShadow,
12
12
  s as logo,
13
- _ as shadow,
13
+ t as shadow,
14
14
  o as wrapper
15
15
  };
@@ -1,4 +1,4 @@
1
- const o = "_accordionRoot_3pkfo_1", c = "_accordionControl_3pkfo_5", n = "_accordionItem_3pkfo_9", t = {
1
+ const o = "_accordionRoot_1of7x_1", c = "_accordionControl_1of7x_9", n = "_accordionItem_1of7x_17", t = {
2
2
  accordionRoot: o,
3
3
  accordionControl: c,
4
4
  accordionItem: n
@@ -1,21 +1,9 @@
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>;
7
- value?: string | null;
8
- onChange?: (v: string) => void;
9
- allowCustomColor?: boolean;
10
- colors?: ColorItem[];
11
- swatchShape?: 'circle' | 'square';
12
- swatchVariant?: 'filled' | 'outline';
13
- withTick?: boolean;
14
- fullWidth?: boolean;
15
- swatchSize?: number;
16
- } & Omit<FlexProps, 'onChange'>;
17
- export interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<React.ComponentPropsWithoutRef<'div'>, keyof Omit<ColorSwatchProps, 'color'>> {
3
+ import type { ColorItem } from './types';
4
+ interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<React.ComponentPropsWithoutRef<'div'>, keyof Omit<ColorSwatchProps, 'color'>> {
18
5
  value?: string | null;
6
+ label?: string;
19
7
  isActive?: boolean;
20
8
  swatchShape?: 'circle' | 'square';
21
9
  swatchVariant?: 'filled' | 'outline';
@@ -23,14 +11,21 @@ export interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<
23
11
  borderColor?: string;
24
12
  bgColor?: string;
25
13
  }
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;
14
+ export declare const ColorCircle: import("react").ForwardRefExoticComponent<ColorCircleProps & import("react").RefAttributes<HTMLDivElement>>;
15
+ export declare const ColorPicker: import("react").ForwardRefExoticComponent<{
16
+ value?: string | null;
17
+ onChange?: (v: string) => void;
18
+ allowCustomColor?: boolean;
19
+ colors?: ColorItem[];
20
+ swatchShape?: "circle" | "square";
21
+ swatchVariant?: "filled" | "outline";
22
+ withTick?: boolean;
23
+ fullWidth?: boolean;
24
+ swatchSize?: number;
25
+ } & Omit<FlexProps, "onChange"> & import("react").RefAttributes<HTMLDivElement>> & {
26
+ ColorCircle: import("react").ForwardRefExoticComponent<ColorCircleProps & import("react").RefAttributes<HTMLDivElement>>;
33
27
  List: typeof ColorPickerList;
34
- Toolbar: React.ForwardRefExoticComponent<import("./ColorPickerToolbar").ColorPickerToolbarProps & React.RefAttributes<HTMLDivElement>>;
28
+ Toolbar: import("react").ForwardRefExoticComponent<import("./ColorPickerToolbar").ColorPickerToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
35
29
  };
30
+ export {};
36
31
  //# sourceMappingURL=ColorPicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,EAIL,gBAAgB,EAEhB,SAAS,EAKV,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAsB,MAAM,SAAS,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAkGhC,MAAM,WAAW,gBACf,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,GAAI,gGAUzB,gBAAgB,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;CAAE,4CA4DxD,CAAC;AASF,eAAO,MAAM,WAAW,+HAlLrB,gBAAgB;kHA6GhB,gBAAgB,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;KAAE;;;CAyEvD,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;AAiHzC,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,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;YAzLd,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;;;;;CAqLnB,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, 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"}