@layers-app/shared 0.4.2 → 0.4.4

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 (194) hide show
  1. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
  2. package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
  3. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
  4. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +15 -16
  5. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
  6. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  7. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  8. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +7 -7
  9. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
  10. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
  11. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  12. package/dist/components/ColorPicker/ColorPicker.module.css.js +24 -24
  13. package/dist/components/CommentComposer/CommentComposer.module.css.js +1 -1
  14. package/dist/components/CommentComposer/index.d.ts.map +1 -1
  15. package/dist/components/CommentComposer/index.js +53 -54
  16. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  17. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  18. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  19. package/dist/components/EmojiPicker/EmojiPanel.js +6 -6
  20. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  21. package/dist/components/EmojiPicker/IconsPanel.js +11 -11
  22. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  23. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  24. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  25. package/dist/components/FilePicker/FilePicker.module.css.js +10 -10
  26. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  27. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  28. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  29. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  30. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  31. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  32. package/dist/components/FormViewer/helpers/steps.d.ts.map +1 -1
  33. package/dist/components/FormViewer/helpers/steps.js +11 -11
  34. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  35. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  36. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
  37. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
  38. package/dist/components/Loaders/styles.module.css.js +6 -6
  39. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  40. package/dist/components/MusicPlayerBar/MusicPlayerBar.d.ts +3 -0
  41. package/dist/components/MusicPlayerBar/MusicPlayerBar.d.ts.map +1 -0
  42. package/dist/components/MusicPlayerBar/MusicPlayerBar.js +239 -0
  43. package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +49 -0
  44. package/dist/components/MusicPlayerBar/components/HiddenAudio.d.ts +10 -0
  45. package/dist/components/MusicPlayerBar/components/HiddenAudio.d.ts.map +1 -0
  46. package/dist/components/MusicPlayerBar/components/HiddenAudio.js +35 -0
  47. package/dist/components/MusicPlayerBar/components/HoverActions.d.ts +20 -0
  48. package/dist/components/MusicPlayerBar/components/HoverActions.d.ts.map +1 -0
  49. package/dist/components/MusicPlayerBar/components/HoverActions.js +88 -0
  50. package/dist/components/MusicPlayerBar/components/MobileActionsDrawer.d.ts +18 -0
  51. package/dist/components/MusicPlayerBar/components/MobileActionsDrawer.d.ts.map +1 -0
  52. package/dist/components/MusicPlayerBar/components/MobileActionsDrawer.js +91 -0
  53. package/dist/components/MusicPlayerBar/components/MobileSpeedDrawer.d.ts +11 -0
  54. package/dist/components/MusicPlayerBar/components/MobileSpeedDrawer.d.ts.map +1 -0
  55. package/dist/components/MusicPlayerBar/components/MobileSpeedDrawer.js +38 -0
  56. package/dist/components/MusicPlayerBar/components/MobileTailControls.d.ts +11 -0
  57. package/dist/components/MusicPlayerBar/components/MobileTailControls.d.ts.map +1 -0
  58. package/dist/components/MusicPlayerBar/components/MobileTailControls.js +50 -0
  59. package/dist/components/MusicPlayerBar/components/PlayButton.d.ts +9 -0
  60. package/dist/components/MusicPlayerBar/components/PlayButton.d.ts.map +1 -0
  61. package/dist/components/MusicPlayerBar/components/PlayButton.js +28 -0
  62. package/dist/components/MusicPlayerBar/components/SpeedPopover.d.ts +11 -0
  63. package/dist/components/MusicPlayerBar/components/SpeedPopover.d.ts.map +1 -0
  64. package/dist/components/MusicPlayerBar/components/SpeedPopover.js +90 -0
  65. package/dist/components/MusicPlayerBar/components/Timer.d.ts +8 -0
  66. package/dist/components/MusicPlayerBar/components/Timer.d.ts.map +1 -0
  67. package/dist/components/MusicPlayerBar/components/Timer.js +25 -0
  68. package/dist/components/MusicPlayerBar/components/VolumePopover.d.ts +15 -0
  69. package/dist/components/MusicPlayerBar/components/VolumePopover.d.ts.map +1 -0
  70. package/dist/components/MusicPlayerBar/components/VolumePopover.js +88 -0
  71. package/dist/components/MusicPlayerBar/components/Waveform.d.ts +12 -0
  72. package/dist/components/MusicPlayerBar/components/Waveform.d.ts.map +1 -0
  73. package/dist/components/MusicPlayerBar/components/Waveform.js +47 -0
  74. package/dist/components/MusicPlayerBar/constants.d.ts +19 -0
  75. package/dist/components/MusicPlayerBar/constants.d.ts.map +1 -0
  76. package/dist/components/MusicPlayerBar/constants.js +21 -0
  77. package/dist/components/MusicPlayerBar/helpers.d.ts +11 -0
  78. package/dist/components/MusicPlayerBar/helpers.d.ts.map +1 -0
  79. package/dist/components/MusicPlayerBar/helpers.js +44 -0
  80. package/dist/components/MusicPlayerBar/hooks/useAudioPlayback.d.ts +23 -0
  81. package/dist/components/MusicPlayerBar/hooks/useAudioPlayback.d.ts.map +1 -0
  82. package/dist/components/MusicPlayerBar/hooks/useAudioPlayback.js +49 -0
  83. package/dist/components/MusicPlayerBar/hooks/useCopyFeedback.d.ts +6 -0
  84. package/dist/components/MusicPlayerBar/hooks/useCopyFeedback.d.ts.map +1 -0
  85. package/dist/components/MusicPlayerBar/hooks/useCopyFeedback.js +17 -0
  86. package/dist/components/MusicPlayerBar/hooks/useHoverPopover.d.ts +9 -0
  87. package/dist/components/MusicPlayerBar/hooks/useHoverPopover.d.ts.map +1 -0
  88. package/dist/components/MusicPlayerBar/hooks/useHoverPopover.js +18 -0
  89. package/dist/components/MusicPlayerBar/hooks/useMusicPlayerLabels.d.ts +3 -0
  90. package/dist/components/MusicPlayerBar/hooks/useMusicPlayerLabels.d.ts.map +1 -0
  91. package/dist/components/MusicPlayerBar/hooks/useMusicPlayerLabels.js +26 -0
  92. package/dist/components/MusicPlayerBar/hooks/useWaveform.d.ts +7 -0
  93. package/dist/components/MusicPlayerBar/hooks/useWaveform.d.ts.map +1 -0
  94. package/dist/components/MusicPlayerBar/hooks/useWaveform.js +28 -0
  95. package/dist/components/MusicPlayerBar/index.d.ts +3 -0
  96. package/dist/components/MusicPlayerBar/index.d.ts.map +1 -0
  97. package/dist/components/MusicPlayerBar/types.d.ts +33 -0
  98. package/dist/components/MusicPlayerBar/types.d.ts.map +1 -0
  99. package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
  100. package/dist/components/NavbarResizer/NavbarResizer.js +1 -1
  101. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  102. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  103. package/dist/components/Notification/Notification.module.css.js +1 -1
  104. package/dist/components/OnboardingTour/OnboardingTourFooter.js +1 -1
  105. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  106. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  107. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  108. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  109. package/dist/components/table/FrontTable.d.ts.map +1 -1
  110. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  111. package/dist/components/table/hooks/useColumnsResizing.js +1 -1
  112. package/dist/helpers/isNoAccessError.d.ts +2 -0
  113. package/dist/helpers/isNoAccessError.d.ts.map +1 -0
  114. package/dist/helpers/isNoAccessError.js +7 -0
  115. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  116. package/dist/helpers/showNotifications.module.css.js +1 -1
  117. package/dist/hooks/useOfficePreviewAvailable.d.ts +2 -0
  118. package/dist/hooks/useOfficePreviewAvailable.d.ts.map +1 -0
  119. package/dist/hooks/useOfficePreviewAvailable.js +20 -0
  120. package/dist/index.css +1 -1
  121. package/dist/index.d.ts +3 -2
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/index.js +307 -305
  124. package/dist/lang/locales/ui_en.json.js +6 -4
  125. package/dist/lang/locales/ui_es.json.js +8 -6
  126. package/dist/lang/locales/ui_ru.json.js +9 -7
  127. package/docs/README.md +499 -499
  128. package/package.json +75 -75
  129. package/dist/assets/images/person.png.js +0 -4
  130. package/dist/assets/images/person2.png.js +0 -4
  131. package/dist/assets/images/person3.png.js +0 -4
  132. package/dist/assets/images/person4.png.js +0 -4
  133. package/dist/components/OnBoarding/OnBoardingPage.d.ts +0 -2
  134. package/dist/components/OnBoarding/OnBoardingPage.d.ts.map +0 -1
  135. package/dist/components/OnBoarding/OnBoardingPage.js +0 -80
  136. package/dist/components/OnBoarding/ProjectBoard.d.ts +0 -5
  137. package/dist/components/OnBoarding/ProjectBoard.d.ts.map +0 -1
  138. package/dist/components/OnBoarding/ProjectBoard.js +0 -141
  139. package/dist/components/OnBoarding/StepsNavBar.d.ts +0 -5
  140. package/dist/components/OnBoarding/StepsNavBar.d.ts.map +0 -1
  141. package/dist/components/OnBoarding/StepsNavBar.js +0 -21
  142. package/dist/components/OnBoarding/index.d.ts +0 -2
  143. package/dist/components/OnBoarding/index.d.ts.map +0 -1
  144. package/dist/components/OnBoarding/steps/AddTasks/AddTasksNav.d.ts +0 -3
  145. package/dist/components/OnBoarding/steps/AddTasks/AddTasksNav.d.ts.map +0 -1
  146. package/dist/components/OnBoarding/steps/AddTasks/AddTasksNav.js +0 -42
  147. package/dist/components/OnBoarding/steps/AddTasks/TasksListBoard.d.ts +0 -3
  148. package/dist/components/OnBoarding/steps/AddTasks/TasksListBoard.d.ts.map +0 -1
  149. package/dist/components/OnBoarding/steps/AddTasks/TasksListBoard.js +0 -51
  150. package/dist/components/OnBoarding/steps/CreateFirstProject.d.ts +0 -3
  151. package/dist/components/OnBoarding/steps/CreateFirstProject.d.ts.map +0 -1
  152. package/dist/components/OnBoarding/steps/CreateFirstProject.js +0 -45
  153. package/dist/components/OnBoarding/steps/DefineStatuses/DefineStatusesNav.d.ts +0 -3
  154. package/dist/components/OnBoarding/steps/DefineStatuses/DefineStatusesNav.d.ts.map +0 -1
  155. package/dist/components/OnBoarding/steps/DefineStatuses/DefineStatusesNav.js +0 -42
  156. package/dist/components/OnBoarding/steps/DefineStatuses/StatusBadge.d.ts +0 -9
  157. package/dist/components/OnBoarding/steps/DefineStatuses/StatusBadge.d.ts.map +0 -1
  158. package/dist/components/OnBoarding/steps/DefineStatuses/StatusBadge.js +0 -22
  159. package/dist/components/OnBoarding/steps/DefineStatuses/StatusesListBoard.d.ts +0 -3
  160. package/dist/components/OnBoarding/steps/DefineStatuses/StatusesListBoard.d.ts.map +0 -1
  161. package/dist/components/OnBoarding/steps/DefineStatuses/StatusesListBoard.js +0 -217
  162. package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsBoard.d.ts +0 -3
  163. package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsBoard.d.ts.map +0 -1
  164. package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsBoard.js +0 -16
  165. package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsNav.d.ts +0 -3
  166. package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsNav.d.ts.map +0 -1
  167. package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsNav.js +0 -56
  168. package/dist/components/OnBoarding/steps/DifferentLayouts/KanbanLayout.d.ts +0 -3
  169. package/dist/components/OnBoarding/steps/DifferentLayouts/KanbanLayout.d.ts.map +0 -1
  170. package/dist/components/OnBoarding/steps/DifferentLayouts/KanbanLayout.js +0 -272
  171. package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +0 -9
  172. package/dist/components/OnBoarding/steps/InviteUsers/BoardModal.d.ts +0 -3
  173. package/dist/components/OnBoarding/steps/InviteUsers/BoardModal.d.ts.map +0 -1
  174. package/dist/components/OnBoarding/steps/InviteUsers/BoardModal.js +0 -86
  175. package/dist/components/OnBoarding/steps/InviteUsers/InviteUsers.d.ts +0 -3
  176. package/dist/components/OnBoarding/steps/InviteUsers/InviteUsers.d.ts.map +0 -1
  177. package/dist/components/OnBoarding/steps/InviteUsers/InviteUsers.js +0 -26
  178. package/dist/components/OnBoarding/steps/SelectCategory/CategorySelect.d.ts +0 -9
  179. package/dist/components/OnBoarding/steps/SelectCategory/CategorySelect.d.ts.map +0 -1
  180. package/dist/components/OnBoarding/steps/SelectCategory/CategorySelect.js +0 -61
  181. package/dist/components/OnBoarding/steps/SelectCategory/SelectCategoryNav.d.ts +0 -3
  182. package/dist/components/OnBoarding/steps/SelectCategory/SelectCategoryNav.d.ts.map +0 -1
  183. package/dist/components/OnBoarding/steps/SelectCategory/SelectCategoryNav.js +0 -42
  184. package/dist/components/OnBoarding/steps/StartedStep.d.ts +0 -3
  185. package/dist/components/OnBoarding/steps/StartedStep.d.ts.map +0 -1
  186. package/dist/components/OnBoarding/steps/StartedStep.js +0 -71
  187. package/dist/components/OnBoarding/steps/Wrapper.d.ts +0 -15
  188. package/dist/components/OnBoarding/steps/Wrapper.d.ts.map +0 -1
  189. package/dist/components/OnBoarding/steps/Wrapper.js +0 -49
  190. package/dist/components/OnBoarding/steps/styles.module.css.js +0 -17
  191. package/dist/components/OnBoarding/styles.module.css.js +0 -15
  192. package/dist/store/onboarding.d.ts +0 -30
  193. package/dist/store/onboarding.d.ts.map +0 -1
  194. package/dist/store/onboarding.js +0 -53
package/docs/README.md CHANGED
@@ -1,499 +1,499 @@
1
- # @layers-app/shared - Usage Guide
2
-
3
- **Version:** 0.2.0
4
- **Type:** ESM Library for React applications
5
-
6
- ---
7
-
8
- ## 📦 Installation
9
-
10
- ```bash
11
- npm install @layers-app/shared
12
- # or
13
- yarn add @layers-app/shared
14
- # or
15
- pnpm add @layers-app/shared
16
- ```
17
-
18
- ---
19
-
20
- ## 🚀 Quick Start
21
-
22
- ### 1. Import Styles (Required)
23
-
24
- Import styles **once** in your application entry point:
25
-
26
- ```typescript
27
- // main.tsx or App.tsx
28
- import '@layers-app/shared/styles';
29
- ```
30
-
31
- ### 2. Use Components
32
-
33
- ```typescript
34
- import {
35
- CustomKBD,
36
- FilePicker,
37
- EmojiPicker,
38
- SearchFilters,
39
- // ... other components
40
- } from '@layers-app/shared';
41
-
42
- function App() {
43
- return (
44
- <>
45
- <CustomKBD value="Ctrl" />
46
- <FilePicker onSelect={(file) => console.log(file)} />
47
- <EmojiPicker onSelect={(emoji) => console.log(emoji)} />
48
- </>
49
- );
50
- }
51
- ```
52
-
53
- ---
54
-
55
- ## 📚 Available Exports
56
-
57
- ### Components
58
-
59
- - `NoData` - Empty state component
60
- - `FilePicker` / `FilePickerUpload` - File selection and upload
61
- - `EmojiPicker` - Emoji selector
62
- - `AppContainer` - Application container
63
- - `CustomKBD` - Keyboard key display
64
- - `SubmitModal` - Submission modal
65
- - `UserAvatar` - User avatar component
66
- - `WorkspaceMenu` / `WorkspaceAvatar` - Workspace components
67
- - `NavbarResizer` - Resizable navbar
68
- - `ErrorPage` / `ErrorAlert` - Error displays
69
- - `OnBoarding` - Onboarding flow
70
- - `ProjectIcon` - Project icon display
71
- - `ColorPicker` / `ColorPickerPopover` / `NewColorPicker` - Color pickers
72
- - `AnimationWrapper` - Animation container
73
- - `SearchFilters` - Search filter components
74
- - `AttachmentsGalleryModal` - Attachment gallery
75
- - `ImageModal` - Image modal viewer
76
- - `Logotype` - Logo component
77
- - `SortableList` - Drag-and-drop sortable list
78
- - `ThemeIndicator` - Theme indicator
79
- - `CommentsPanel` / `CommentComposer` - Comments system
80
- - `PinModal` - Pin modal
81
- - `PaymentSuccess` / `PaymentError` / `PaymentCancel` - Payment status pages
82
- - `StorageUsageProgress` / `StorageUsageEntityList` - Storage components
83
- - `LanguagePicker` - Language selector
84
- - `FrontTable` - Table component
85
- - `CommunitiesDialog` - Communities dialog
86
- - `NotPublicPanel` - Not public panel
87
- - `BottomDrawerWithoutHeader` - Bottom drawer
88
- - `Copyright` - Copyright notice
89
- - `EntityTitle` - Entity title
90
- - `CircleColorPicker` - Circle color picker
91
- - `FormViewer` - Form viewer
92
- - `BouncingLogo` - Animated logo
93
- - `CommentFilterMenu` - Comment filter
94
- - `RemoveConfirmModal` - Confirmation modal
95
- - `AppSidebarButton` - Sidebar button
96
- - `NavMenu` - Navigation menu
97
- - `EntityIcon` - Entity icon
98
-
99
- ### Helpers
100
-
101
- - `showNotifications` - Show notifications
102
- - `pickRandomEmoji` - Random emoji selector
103
- - `themeUtils` - Theme utilities
104
- - `combineStatuses` - Combine statuses
105
- - `download` - Download helper
106
- - `generateLink` - Link generator
107
- - `feature` - Feature flags
108
- - `fileUtils` - File utilities
109
- - `formatBytes` - Format bytes
110
- - `filterHierarchyByTypes` - Filter hierarchy
111
- - `getRandomIconColor` - Random icon color
112
- - `getFileIcons` - File icons
113
- - `getFileType` - File type detection
114
- - `getPartOfTheDay` - Time of day
115
- - `isAppMode` - App mode detection
116
- - `dates` - Date utilities
117
- - `hotjar` - Hotjar integration
118
-
119
- ### Hooks
120
-
121
- - `useMenu` - Menu hook
122
- - `useDateFnsLocale` - Date-fns locale
123
- - `useFormatDistance` - Format distance
124
- - `useSwipeDetect` - Swipe detection
125
- - `useOAuthErrorParams` - OAuth error params
126
- - `useDateUtils` - Date utilities
127
- - `useNumberQueryParam` - Number query param
128
- - `useDisableWindowScroll` - Disable scroll
129
- - `useAsyncStatus` - Async status
130
- - `useAppContainer` - App container
131
- - `useAppContainerStore` - App container store
132
- - `useAppContainerDataStore` - App container data store
133
-
134
- ### Store
135
-
136
- - `searchModal` - Search modal store
137
- - `onboarding` - Onboarding store
138
- - `workspacesOrder` - Workspaces order
139
- - `timezoneStore` - Timezone store
140
- - `plansModal` - Plans modal store
141
- - `discordDialogStore` - Discord dialog store
142
- - `accessOptionsControl` - Access options control
143
-
144
- ### Utils
145
-
146
- - `formatStorage` - Format storage
147
- - `getPlanBadgeColor` - Plan badge color
148
- - `queryParams` - Query params utilities
149
-
150
- ---
151
-
152
- ## 🎨 Styling
153
-
154
- ### CSS Modules
155
-
156
- This library uses **CSS Modules** for component styling. All styles are bundled into a single `index.css` file.
157
-
158
- **Structure:**
159
-
160
- ```
161
- dist/
162
- ├── index.css ← All styles (54 KB)
163
- ├── index.js ← JavaScript
164
- └── components/
165
- └── CustomKBD/
166
- ├── index.js
167
- └── CustomKBD.module.css.js ← CSS classes mapping
168
- ```
169
-
170
- ### How It Works
171
-
172
- 1. **Import styles once:**
173
-
174
- ```typescript
175
- import '@layers-app/shared/styles';
176
- ```
177
-
178
- 2. **All components automatically get correct CSS classes**
179
-
180
- ```typescript
181
- // Component uses CSS Modules internally
182
- import styles from './CustomKBD.module.css';
183
- <Box className={styles.root} /> // ✅ Scoped class applied
184
- ```
185
-
186
- 3. **No naming conflicts** - classes are scoped (e.g., `_root_195do_1`)
187
-
188
- ---
189
-
190
- ## ⚙️ Peer Dependencies
191
-
192
- Install these dependencies in your project:
193
-
194
- ### Required
195
-
196
- ```json
197
- {
198
- "react": "^18.3.1",
199
- "react-dom": "^18.3.1",
200
- "@mantine/core": "8.3.5",
201
- "@mantine/hooks": "8.3.5",
202
- "@mantine/form": "8.3.5",
203
- "@mantine/modals": "8.3.5",
204
- "@mantine/notifications": "8.3.5"
205
- }
206
- ```
207
-
208
- ### Optional (based on usage)
209
-
210
- ```json
211
- {
212
- "@dnd-kit/core": "^6.0.0",
213
- "@dnd-kit/sortable": "^8.0.0",
214
- "@tabler/icons-react": "^3.7.0",
215
- "framer-motion": "^11.3.24",
216
- "date-fns": "^4.1.0",
217
- "i18next": "^25.5.2",
218
- "react-i18next": "^15.7.3",
219
- "react-router-dom": "^7.5.2",
220
- "zustand": "^5.0.3",
221
- "@reduxjs/toolkit": "^2.2.7",
222
- "@tanstack/react-query": "^5.52.2"
223
- }
224
- ```
225
-
226
- Full list available in `package.json` `peerDependencies`.
227
-
228
- ---
229
-
230
- ## 🔧 Configuration
231
-
232
- ### TypeScript
233
-
234
- Types are included. No additional configuration needed.
235
-
236
- ```typescript
237
- import { CustomKBD } from '@layers-app/shared';
238
-
239
- // ✅ Full TypeScript support
240
- ```
241
-
242
- ### Vite
243
-
244
- ```typescript
245
- // vite.config.ts
246
- export default defineConfig({
247
- // No special configuration needed
248
- // Styles are auto-loaded via import '@layers-app/shared/styles'
249
- });
250
- ```
251
-
252
- ### Webpack
253
-
254
- ```javascript
255
- // webpack.config.js
256
- module.exports = {
257
- module: {
258
- rules: [
259
- {
260
- test: /\.css$/,
261
- use: ['style-loader', 'css-loader'],
262
- },
263
- ],
264
- },
265
- };
266
- ```
267
-
268
- ---
269
-
270
- ## 📖 Usage Examples
271
-
272
- ### Using FilePicker
273
-
274
- ```typescript
275
- import { FilePicker } from '@layers-app/shared';
276
-
277
- function MyComponent() {
278
- const handleFileSelect = (file: File) => {
279
- console.log('Selected file:', file);
280
- };
281
-
282
- return (
283
- <FilePicker
284
- onSelect={handleFileSelect}
285
- accept="image/*"
286
- maxSize={5 * 1024 * 1024} // 5MB
287
- />
288
- );
289
- }
290
- ```
291
-
292
- ### Using EmojiPicker
293
-
294
- ```typescript
295
- import { EmojiPicker } from '@layers-app/shared';
296
-
297
- function MyComponent() {
298
- const handleEmojiSelect = (emoji: string) => {
299
- console.log('Selected emoji:', emoji);
300
- };
301
-
302
- return (
303
- <EmojiPicker
304
- onSelect={handleEmojiSelect}
305
- position="bottom-start"
306
- />
307
- );
308
- }
309
- ```
310
-
311
- ### Using SearchFilters
312
-
313
- ```typescript
314
- import { SearchFilters } from '@layers-app/shared';
315
-
316
- function MyComponent() {
317
- const [filters, setFilters] = useState({});
318
-
319
- return (
320
- <SearchFilters
321
- value={filters}
322
- onChange={setFilters}
323
- fields={[
324
- { name: 'status', type: 'select', options: [...] },
325
- { name: 'date', type: 'date' },
326
- ]}
327
- />
328
- );
329
- }
330
- ```
331
-
332
- ### Using SortableList
333
-
334
- ```typescript
335
- import { SortableList } from '@layers-app/shared';
336
-
337
- function MyComponent() {
338
- const [items, setItems] = useState([...]);
339
-
340
- return (
341
- <SortableList
342
- items={items}
343
- onReorder={setItems}
344
- renderItem={(item) => <div>{item.name}</div>}
345
- />
346
- );
347
- }
348
- ```
349
-
350
- ---
351
-
352
- ## 🏗️ Build Information
353
-
354
- ### Output Structure
355
-
356
- ```
357
- dist/
358
- ├── index.js # Main entry point (ESM)
359
- ├── index.d.ts # TypeScript types
360
- ├── index.css # All styles (54 KB)
361
- ├── components/ # Component modules
362
- ├── hooks/ # Hooks modules
363
- ├── helpers/ # Helper modules
364
- └── assets/ # Asset files
365
- ```
366
-
367
- ### Bundle Characteristics
368
-
369
- - **Format:** ESM only
370
- - **Tree-shaking:** Full support
371
- - **CSS:** Scoped CSS Modules
372
- - **TypeScript:** Full type definitions
373
- - **Size:** ~457 KB total (400 KB JS + 54 KB CSS + 3 KB CSS mappings)
374
-
375
- ---
376
-
377
- ## 🔍 Advanced Usage
378
-
379
- ### Accessing Individual CSS
380
-
381
- If you need specific component styles:
382
-
383
- ```typescript
384
- // Import individual component CSS (rarely needed)
385
- import '@layers-app/shared/dist/components/CustomKBD/CustomKBD.module.css.js';
386
- ```
387
-
388
- ### Using Assets
389
-
390
- ```typescript
391
- // Access assets directly
392
- import logo from '@layers-app/shared/assets/logo.svg';
393
- ```
394
-
395
- ### Custom Theme
396
-
397
- ```typescript
398
- // Apply Mantine theme
399
- import { MantineProvider } from '@mantine/core';
400
-
401
- function App() {
402
- return (
403
- <MantineProvider theme={{ /* your theme */ }}>
404
- {/* Your app */}
405
- </MantineProvider>
406
- );
407
- }
408
- ```
409
-
410
- ---
411
-
412
- ## 📊 Performance
413
-
414
- ### Optimization Tips
415
-
416
- 1. **Import only what you need:**
417
-
418
- ```typescript
419
- // ✅ Good - tree-shaking works
420
- import { CustomKBD } from '@layers-app/shared';
421
- // ❌ Bad - imports everything
422
- import * as Shared from '@layers-app/shared';
423
- ```
424
-
425
- 2. **Styles are loaded once:**
426
-
427
- ```typescript
428
- // Import in main.tsx only
429
- import '@layers-app/shared/styles';
430
- ```
431
-
432
- 3. **Use lazy loading for heavy components:**
433
- ```typescript
434
- const FormViewer = lazy(() =>
435
- import('@layers-app/shared').then((m) => ({ default: m.FormViewer })),
436
- );
437
- ```
438
-
439
- ---
440
-
441
- ## 🐛 Troubleshooting
442
-
443
- ### Styles not applied
444
-
445
- **Solution:** Ensure you imported styles:
446
-
447
- ```typescript
448
- import '@layers-app/shared/styles';
449
- ```
450
-
451
- ### TypeScript errors
452
-
453
- **Solution:** Check peer dependencies are installed:
454
-
455
- ```bash
456
- npm install react react-dom @mantine/core @mantine/hooks
457
- ```
458
-
459
- ### Build errors
460
-
461
- **Solution:** Ensure you're using ESM-compatible bundler (Vite, Webpack 5+, etc.)
462
-
463
- ---
464
-
465
- ## 📝 Notes
466
-
467
- ### CSS Modules Explained
468
-
469
- Files like `CustomKBD.module.css.js` are **JavaScript mappings** for CSS Modules:
470
-
471
- ```javascript
472
- // CustomKBD.module.css.js
473
- export default { root: '_root_195do_1' };
474
- ```
475
-
476
- **This is correct behavior!** Actual styles are in `index.css`.
477
-
478
- ### Internal vs External Packages
479
-
480
- - All `@layers-app/*` packages are internal monorepo packages
481
- - External dependencies should be managed through package.json
482
-
483
- ---
484
-
485
- ## 🔗 Links
486
-
487
- - **Repository:** [GitHub](https://github.com/yourusername/layers)
488
- - **Issues:** [Report a bug](https://github.com/yourusername/layers/issues)
489
- - **Documentation:** See `/docs` folder
490
-
491
- ---
492
-
493
- ## 📄 License
494
-
495
- See LICENSE file in the repository.
496
-
497
- ---
498
-
499
- **Made with ❤️ by the Layers team**
1
+ # @layers-app/shared - Usage Guide
2
+
3
+ **Version:** 0.2.0
4
+ **Type:** ESM Library for React applications
5
+
6
+ ---
7
+
8
+ ## 📦 Installation
9
+
10
+ ```bash
11
+ npm install @layers-app/shared
12
+ # or
13
+ yarn add @layers-app/shared
14
+ # or
15
+ pnpm add @layers-app/shared
16
+ ```
17
+
18
+ ---
19
+
20
+ ## 🚀 Quick Start
21
+
22
+ ### 1. Import Styles (Required)
23
+
24
+ Import styles **once** in your application entry point:
25
+
26
+ ```typescript
27
+ // main.tsx or App.tsx
28
+ import '@layers-app/shared/styles';
29
+ ```
30
+
31
+ ### 2. Use Components
32
+
33
+ ```typescript
34
+ import {
35
+ CustomKBD,
36
+ FilePicker,
37
+ EmojiPicker,
38
+ SearchFilters,
39
+ // ... other components
40
+ } from '@layers-app/shared';
41
+
42
+ function App() {
43
+ return (
44
+ <>
45
+ <CustomKBD value="Ctrl" />
46
+ <FilePicker onSelect={(file) => console.log(file)} />
47
+ <EmojiPicker onSelect={(emoji) => console.log(emoji)} />
48
+ </>
49
+ );
50
+ }
51
+ ```
52
+
53
+ ---
54
+
55
+ ## 📚 Available Exports
56
+
57
+ ### Components
58
+
59
+ - `NoData` - Empty state component
60
+ - `FilePicker` / `FilePickerUpload` - File selection and upload
61
+ - `EmojiPicker` - Emoji selector
62
+ - `AppContainer` - Application container
63
+ - `CustomKBD` - Keyboard key display
64
+ - `SubmitModal` - Submission modal
65
+ - `UserAvatar` - User avatar component
66
+ - `WorkspaceMenu` / `WorkspaceAvatar` - Workspace components
67
+ - `NavbarResizer` - Resizable navbar
68
+ - `ErrorPage` / `ErrorAlert` - Error displays
69
+ - `OnBoarding` - Onboarding flow
70
+ - `ProjectIcon` - Project icon display
71
+ - `ColorPicker` / `ColorPickerPopover` / `NewColorPicker` - Color pickers
72
+ - `AnimationWrapper` - Animation container
73
+ - `SearchFilters` - Search filter components
74
+ - `AttachmentsGalleryModal` - Attachment gallery
75
+ - `ImageModal` - Image modal viewer
76
+ - `Logotype` - Logo component
77
+ - `SortableList` - Drag-and-drop sortable list
78
+ - `ThemeIndicator` - Theme indicator
79
+ - `CommentsPanel` / `CommentComposer` - Comments system
80
+ - `PinModal` - Pin modal
81
+ - `PaymentSuccess` / `PaymentError` / `PaymentCancel` - Payment status pages
82
+ - `StorageUsageProgress` / `StorageUsageEntityList` - Storage components
83
+ - `LanguagePicker` - Language selector
84
+ - `FrontTable` - Table component
85
+ - `CommunitiesDialog` - Communities dialog
86
+ - `NotPublicPanel` - Not public panel
87
+ - `BottomDrawerWithoutHeader` - Bottom drawer
88
+ - `Copyright` - Copyright notice
89
+ - `EntityTitle` - Entity title
90
+ - `CircleColorPicker` - Circle color picker
91
+ - `FormViewer` - Form viewer
92
+ - `BouncingLogo` - Animated logo
93
+ - `CommentFilterMenu` - Comment filter
94
+ - `RemoveConfirmModal` - Confirmation modal
95
+ - `AppSidebarButton` - Sidebar button
96
+ - `NavMenu` - Navigation menu
97
+ - `EntityIcon` - Entity icon
98
+
99
+ ### Helpers
100
+
101
+ - `showNotifications` - Show notifications
102
+ - `pickRandomEmoji` - Random emoji selector
103
+ - `themeUtils` - Theme utilities
104
+ - `combineStatuses` - Combine statuses
105
+ - `download` - Download helper
106
+ - `generateLink` - Link generator
107
+ - `feature` - Feature flags
108
+ - `fileUtils` - File utilities
109
+ - `formatBytes` - Format bytes
110
+ - `filterHierarchyByTypes` - Filter hierarchy
111
+ - `getRandomIconColor` - Random icon color
112
+ - `getFileIcons` - File icons
113
+ - `getFileType` - File type detection
114
+ - `getPartOfTheDay` - Time of day
115
+ - `isAppMode` - App mode detection
116
+ - `dates` - Date utilities
117
+ - `hotjar` - Hotjar integration
118
+
119
+ ### Hooks
120
+
121
+ - `useMenu` - Menu hook
122
+ - `useDateFnsLocale` - Date-fns locale
123
+ - `useFormatDistance` - Format distance
124
+ - `useSwipeDetect` - Swipe detection
125
+ - `useOAuthErrorParams` - OAuth error params
126
+ - `useDateUtils` - Date utilities
127
+ - `useNumberQueryParam` - Number query param
128
+ - `useDisableWindowScroll` - Disable scroll
129
+ - `useAsyncStatus` - Async status
130
+ - `useAppContainer` - App container
131
+ - `useAppContainerStore` - App container store
132
+ - `useAppContainerDataStore` - App container data store
133
+
134
+ ### Store
135
+
136
+ - `searchModal` - Search modal store
137
+ - `onboarding` - Onboarding store
138
+ - `workspacesOrder` - Workspaces order
139
+ - `timezoneStore` - Timezone store
140
+ - `plansModal` - Plans modal store
141
+ - `discordDialogStore` - Discord dialog store
142
+ - `accessOptionsControl` - Access options control
143
+
144
+ ### Utils
145
+
146
+ - `formatStorage` - Format storage
147
+ - `getPlanBadgeColor` - Plan badge color
148
+ - `queryParams` - Query params utilities
149
+
150
+ ---
151
+
152
+ ## 🎨 Styling
153
+
154
+ ### CSS Modules
155
+
156
+ This library uses **CSS Modules** for component styling. All styles are bundled into a single `index.css` file.
157
+
158
+ **Structure:**
159
+
160
+ ```
161
+ dist/
162
+ ├── index.css ← All styles (54 KB)
163
+ ├── index.js ← JavaScript
164
+ └── components/
165
+ └── CustomKBD/
166
+ ├── index.js
167
+ └── CustomKBD.module.css.js ← CSS classes mapping
168
+ ```
169
+
170
+ ### How It Works
171
+
172
+ 1. **Import styles once:**
173
+
174
+ ```typescript
175
+ import '@layers-app/shared/styles';
176
+ ```
177
+
178
+ 2. **All components automatically get correct CSS classes**
179
+
180
+ ```typescript
181
+ // Component uses CSS Modules internally
182
+ import styles from './CustomKBD.module.css';
183
+ <Box className={styles.root} /> // ✅ Scoped class applied
184
+ ```
185
+
186
+ 3. **No naming conflicts** - classes are scoped (e.g., `_root_195do_1`)
187
+
188
+ ---
189
+
190
+ ## ⚙️ Peer Dependencies
191
+
192
+ Install these dependencies in your project:
193
+
194
+ ### Required
195
+
196
+ ```json
197
+ {
198
+ "react": "^18.3.1",
199
+ "react-dom": "^18.3.1",
200
+ "@mantine/core": "8.3.5",
201
+ "@mantine/hooks": "8.3.5",
202
+ "@mantine/form": "8.3.5",
203
+ "@mantine/modals": "8.3.5",
204
+ "@mantine/notifications": "8.3.5"
205
+ }
206
+ ```
207
+
208
+ ### Optional (based on usage)
209
+
210
+ ```json
211
+ {
212
+ "@dnd-kit/core": "^6.0.0",
213
+ "@dnd-kit/sortable": "^8.0.0",
214
+ "@tabler/icons-react": "^3.7.0",
215
+ "framer-motion": "^11.3.24",
216
+ "date-fns": "^4.1.0",
217
+ "i18next": "^25.5.2",
218
+ "react-i18next": "^15.7.3",
219
+ "react-router-dom": "^7.5.2",
220
+ "zustand": "^5.0.3",
221
+ "@reduxjs/toolkit": "^2.2.7",
222
+ "@tanstack/react-query": "^5.52.2"
223
+ }
224
+ ```
225
+
226
+ Full list available in `package.json` `peerDependencies`.
227
+
228
+ ---
229
+
230
+ ## 🔧 Configuration
231
+
232
+ ### TypeScript
233
+
234
+ Types are included. No additional configuration needed.
235
+
236
+ ```typescript
237
+ import { CustomKBD } from '@layers-app/shared';
238
+
239
+ // ✅ Full TypeScript support
240
+ ```
241
+
242
+ ### Vite
243
+
244
+ ```typescript
245
+ // vite.config.ts
246
+ export default defineConfig({
247
+ // No special configuration needed
248
+ // Styles are auto-loaded via import '@layers-app/shared/styles'
249
+ });
250
+ ```
251
+
252
+ ### Webpack
253
+
254
+ ```javascript
255
+ // webpack.config.js
256
+ module.exports = {
257
+ module: {
258
+ rules: [
259
+ {
260
+ test: /\.css$/,
261
+ use: ['style-loader', 'css-loader'],
262
+ },
263
+ ],
264
+ },
265
+ };
266
+ ```
267
+
268
+ ---
269
+
270
+ ## 📖 Usage Examples
271
+
272
+ ### Using FilePicker
273
+
274
+ ```typescript
275
+ import { FilePicker } from '@layers-app/shared';
276
+
277
+ function MyComponent() {
278
+ const handleFileSelect = (file: File) => {
279
+ console.log('Selected file:', file);
280
+ };
281
+
282
+ return (
283
+ <FilePicker
284
+ onSelect={handleFileSelect}
285
+ accept="image/*"
286
+ maxSize={5 * 1024 * 1024} // 5MB
287
+ />
288
+ );
289
+ }
290
+ ```
291
+
292
+ ### Using EmojiPicker
293
+
294
+ ```typescript
295
+ import { EmojiPicker } from '@layers-app/shared';
296
+
297
+ function MyComponent() {
298
+ const handleEmojiSelect = (emoji: string) => {
299
+ console.log('Selected emoji:', emoji);
300
+ };
301
+
302
+ return (
303
+ <EmojiPicker
304
+ onSelect={handleEmojiSelect}
305
+ position="bottom-start"
306
+ />
307
+ );
308
+ }
309
+ ```
310
+
311
+ ### Using SearchFilters
312
+
313
+ ```typescript
314
+ import { SearchFilters } from '@layers-app/shared';
315
+
316
+ function MyComponent() {
317
+ const [filters, setFilters] = useState({});
318
+
319
+ return (
320
+ <SearchFilters
321
+ value={filters}
322
+ onChange={setFilters}
323
+ fields={[
324
+ { name: 'status', type: 'select', options: [...] },
325
+ { name: 'date', type: 'date' },
326
+ ]}
327
+ />
328
+ );
329
+ }
330
+ ```
331
+
332
+ ### Using SortableList
333
+
334
+ ```typescript
335
+ import { SortableList } from '@layers-app/shared';
336
+
337
+ function MyComponent() {
338
+ const [items, setItems] = useState([...]);
339
+
340
+ return (
341
+ <SortableList
342
+ items={items}
343
+ onReorder={setItems}
344
+ renderItem={(item) => <div>{item.name}</div>}
345
+ />
346
+ );
347
+ }
348
+ ```
349
+
350
+ ---
351
+
352
+ ## 🏗️ Build Information
353
+
354
+ ### Output Structure
355
+
356
+ ```
357
+ dist/
358
+ ├── index.js # Main entry point (ESM)
359
+ ├── index.d.ts # TypeScript types
360
+ ├── index.css # All styles (54 KB)
361
+ ├── components/ # Component modules
362
+ ├── hooks/ # Hooks modules
363
+ ├── helpers/ # Helper modules
364
+ └── assets/ # Asset files
365
+ ```
366
+
367
+ ### Bundle Characteristics
368
+
369
+ - **Format:** ESM only
370
+ - **Tree-shaking:** Full support
371
+ - **CSS:** Scoped CSS Modules
372
+ - **TypeScript:** Full type definitions
373
+ - **Size:** ~457 KB total (400 KB JS + 54 KB CSS + 3 KB CSS mappings)
374
+
375
+ ---
376
+
377
+ ## 🔍 Advanced Usage
378
+
379
+ ### Accessing Individual CSS
380
+
381
+ If you need specific component styles:
382
+
383
+ ```typescript
384
+ // Import individual component CSS (rarely needed)
385
+ import '@layers-app/shared/dist/components/CustomKBD/CustomKBD.module.css.js';
386
+ ```
387
+
388
+ ### Using Assets
389
+
390
+ ```typescript
391
+ // Access assets directly
392
+ import logo from '@layers-app/shared/assets/logo.svg';
393
+ ```
394
+
395
+ ### Custom Theme
396
+
397
+ ```typescript
398
+ // Apply Mantine theme
399
+ import { MantineProvider } from '@mantine/core';
400
+
401
+ function App() {
402
+ return (
403
+ <MantineProvider theme={{ /* your theme */ }}>
404
+ {/* Your app */}
405
+ </MantineProvider>
406
+ );
407
+ }
408
+ ```
409
+
410
+ ---
411
+
412
+ ## 📊 Performance
413
+
414
+ ### Optimization Tips
415
+
416
+ 1. **Import only what you need:**
417
+
418
+ ```typescript
419
+ // ✅ Good - tree-shaking works
420
+ import { CustomKBD } from '@layers-app/shared';
421
+ // ❌ Bad - imports everything
422
+ import * as Shared from '@layers-app/shared';
423
+ ```
424
+
425
+ 2. **Styles are loaded once:**
426
+
427
+ ```typescript
428
+ // Import in main.tsx only
429
+ import '@layers-app/shared/styles';
430
+ ```
431
+
432
+ 3. **Use lazy loading for heavy components:**
433
+ ```typescript
434
+ const FormViewer = lazy(() =>
435
+ import('@layers-app/shared').then((m) => ({ default: m.FormViewer })),
436
+ );
437
+ ```
438
+
439
+ ---
440
+
441
+ ## 🐛 Troubleshooting
442
+
443
+ ### Styles not applied
444
+
445
+ **Solution:** Ensure you imported styles:
446
+
447
+ ```typescript
448
+ import '@layers-app/shared/styles';
449
+ ```
450
+
451
+ ### TypeScript errors
452
+
453
+ **Solution:** Check peer dependencies are installed:
454
+
455
+ ```bash
456
+ npm install react react-dom @mantine/core @mantine/hooks
457
+ ```
458
+
459
+ ### Build errors
460
+
461
+ **Solution:** Ensure you're using ESM-compatible bundler (Vite, Webpack 5+, etc.)
462
+
463
+ ---
464
+
465
+ ## 📝 Notes
466
+
467
+ ### CSS Modules Explained
468
+
469
+ Files like `CustomKBD.module.css.js` are **JavaScript mappings** for CSS Modules:
470
+
471
+ ```javascript
472
+ // CustomKBD.module.css.js
473
+ export default { root: '_root_195do_1' };
474
+ ```
475
+
476
+ **This is correct behavior!** Actual styles are in `index.css`.
477
+
478
+ ### Internal vs External Packages
479
+
480
+ - All `@layers-app/*` packages are internal monorepo packages
481
+ - External dependencies should be managed through package.json
482
+
483
+ ---
484
+
485
+ ## 🔗 Links
486
+
487
+ - **Repository:** [GitHub](https://github.com/yourusername/layers)
488
+ - **Issues:** [Report a bug](https://github.com/yourusername/layers/issues)
489
+ - **Documentation:** See `/docs` folder
490
+
491
+ ---
492
+
493
+ ## 📄 License
494
+
495
+ See LICENSE file in the repository.
496
+
497
+ ---
498
+
499
+ **Made with ❤️ by the Layers team**