@widgetic/design-system 0.5.21 → 0.5.23

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 (246) hide show
  1. package/README.md +2 -0
  2. package/dist/components/CopyableHeader.svelte +260 -448
  3. package/dist/components/CopyableHeader.svelte.d.ts +8 -5
  4. package/dist/components/EmptyState.svelte +100 -128
  5. package/dist/components/EmptyState.svelte.d.ts +16 -19
  6. package/dist/components/GenerateLoader.svelte +17 -10
  7. package/dist/components/PasswordInput.svelte +41 -44
  8. package/dist/components/PasswordInput.svelte.d.ts +2 -0
  9. package/dist/components/ThumbHashImage.svelte +117 -119
  10. package/dist/components/WScrollArea.svelte +47 -41
  11. package/dist/components/chat/ActivityRow.svelte +115 -0
  12. package/dist/components/chat/ActivityRow.svelte.d.ts +18 -0
  13. package/dist/components/chat/ChatHeader.svelte +114 -0
  14. package/dist/components/chat/ChatHeader.svelte.d.ts +26 -0
  15. package/dist/components/chat/Composer.svelte +172 -0
  16. package/dist/components/chat/Composer.svelte.d.ts +27 -0
  17. package/dist/components/chat/Message.svelte +158 -0
  18. package/dist/components/chat/Message.svelte.d.ts +28 -0
  19. package/dist/components/chat/OptionRow.svelte +59 -0
  20. package/dist/components/chat/OptionRow.svelte.d.ts +14 -0
  21. package/dist/components/chat/PlanCard.svelte +220 -0
  22. package/dist/components/chat/PlanCard.svelte.d.ts +34 -0
  23. package/dist/components/chat/QuestionCard.svelte +265 -0
  24. package/dist/components/chat/QuestionCard.svelte.d.ts +38 -0
  25. package/dist/components/chat/ScrollToBottom.svelte +51 -0
  26. package/dist/components/chat/ScrollToBottom.svelte.d.ts +11 -0
  27. package/dist/components/chat/SuggestionCard.svelte +79 -0
  28. package/dist/components/chat/SuggestionCard.svelte.d.ts +20 -0
  29. package/dist/components/chat/TaskRow.svelte +59 -0
  30. package/dist/components/chat/TaskRow.svelte.d.ts +11 -0
  31. package/dist/components/chat/composerLogic.d.ts +16 -0
  32. package/dist/components/chat/composerLogic.js +29 -0
  33. package/dist/components/chat/index.d.ts +16 -0
  34. package/dist/components/chat/index.js +16 -0
  35. package/dist/components/chat/questionCardLogic.d.ts +11 -0
  36. package/dist/components/chat/questionCardLogic.js +39 -0
  37. package/dist/components/index.d.ts +10 -1
  38. package/dist/components/index.js +10 -0
  39. package/dist/components/modals/ActionModal.svelte +186 -180
  40. package/dist/components/modals/BaseModal.svelte +404 -395
  41. package/dist/components/modals/BaseModal.svelte.d.ts +3 -0
  42. package/dist/components/modals/NewItemDialog.svelte +200 -243
  43. package/dist/components/modals/Portal.svelte +107 -105
  44. package/dist/components/modals/README.md +16 -2
  45. package/dist/components/modals/RenameDialog.svelte +234 -292
  46. package/dist/components/navigation/Breadcrumbs.svelte +415 -377
  47. package/dist/components/navigation/Breadcrumbs.svelte.d.ts +3 -2
  48. package/dist/components/navigation/types.d.ts +2 -0
  49. package/dist/components/pdf/PDFViewer.svelte +54 -1
  50. package/dist/components/search-input/SearchInput.svelte +51 -104
  51. package/dist/components/search-input/SearchInput.svelte.d.ts +9 -27
  52. package/dist/components/shad-editor/editor.css +1 -1
  53. package/dist/components/shad-editor/i18n/messages.d.ts +1 -1
  54. package/dist/components/shad-editor/i18n/messages.js +1 -1
  55. package/dist/components/shell/AppShell.svelte +52 -0
  56. package/dist/components/shell/AppShell.svelte.d.ts +13 -0
  57. package/dist/components/shell/Banner.svelte +90 -0
  58. package/dist/components/shell/Banner.svelte.d.ts +61 -0
  59. package/dist/components/shell/ErrorState.svelte +60 -0
  60. package/dist/components/shell/ErrorState.svelte.d.ts +13 -0
  61. package/dist/components/shell/Link.svelte +63 -0
  62. package/dist/components/shell/Link.svelte.d.ts +53 -0
  63. package/dist/components/shell/NavDrawer.svelte +117 -0
  64. package/dist/components/shell/NavDrawer.svelte.d.ts +10 -0
  65. package/dist/components/shell/NavRow.svelte +128 -0
  66. package/dist/components/shell/NavRow.svelte.d.ts +65 -0
  67. package/dist/components/shell/NavSectionLabel.svelte +27 -0
  68. package/dist/components/shell/NavSectionLabel.svelte.d.ts +9 -0
  69. package/dist/components/shell/NotificationRow.svelte +76 -0
  70. package/dist/components/shell/NotificationRow.svelte.d.ts +16 -0
  71. package/dist/components/shell/PageHeader.svelte +42 -0
  72. package/dist/components/shell/PageHeader.svelte.d.ts +12 -0
  73. package/dist/components/shell/ProfileRow.svelte +95 -0
  74. package/dist/components/shell/ProfileRow.svelte.d.ts +54 -0
  75. package/dist/components/shell/SettingsDialog.svelte +118 -0
  76. package/dist/components/shell/SettingsDialog.svelte.d.ts +19 -0
  77. package/dist/components/shell/SettingsNav.svelte +46 -0
  78. package/dist/components/shell/SettingsNav.svelte.d.ts +11 -0
  79. package/dist/components/shell/Sidebar.svelte +82 -0
  80. package/dist/components/shell/Sidebar.svelte.d.ts +25 -0
  81. package/dist/components/shell/Stat.svelte +63 -0
  82. package/dist/components/shell/Stat.svelte.d.ts +58 -0
  83. package/dist/components/shell/TopBar.svelte +37 -0
  84. package/dist/components/shell/TopBar.svelte.d.ts +11 -0
  85. package/dist/components/shell/WidgetRow.svelte +126 -0
  86. package/dist/components/shell/WidgetRow.svelte.d.ts +78 -0
  87. package/dist/components/shell/error-state-messages.d.ts +7 -0
  88. package/dist/components/shell/error-state-messages.js +9 -0
  89. package/dist/components/shell/index.d.ts +22 -0
  90. package/dist/components/shell/index.js +25 -0
  91. package/dist/components/shell/link-external.d.ts +2 -0
  92. package/dist/components/shell/link-external.js +7 -0
  93. package/dist/components/shell/messages.d.ts +7 -0
  94. package/dist/components/shell/messages.js +5 -0
  95. package/dist/components/shell/settings-nav-types.d.ts +12 -0
  96. package/dist/components/shell/settings-nav-types.js +3 -0
  97. package/dist/components/shell/shell-utils.d.ts +7 -0
  98. package/dist/components/shell/shell-utils.js +27 -0
  99. package/dist/components/shell/stat-tone.d.ts +3 -0
  100. package/dist/components/shell/stat-tone.js +11 -0
  101. package/dist/components/toast/ToasterModal.svelte +102 -168
  102. package/dist/components/toast/ToasterModal.svelte.d.ts +2 -12
  103. package/dist/components/ui/accordion/accordion-content.svelte +3 -2
  104. package/dist/components/ui/accordion/accordion-item.svelte +10 -1
  105. package/dist/components/ui/accordion/accordion-trigger.svelte +4 -3
  106. package/dist/components/ui/alert/alert-description.svelte +5 -1
  107. package/dist/components/ui/alert/alert-title.svelte +2 -1
  108. package/dist/components/ui/alert/index.d.ts +13 -11
  109. package/dist/components/ui/alert/index.js +4 -4
  110. package/dist/components/ui/avatar/avatar-utils.d.ts +2 -0
  111. package/dist/components/ui/avatar/avatar-utils.js +9 -0
  112. package/dist/components/ui/avatar/avatar.svelte +63 -0
  113. package/dist/components/ui/avatar/avatar.svelte.d.ts +80 -0
  114. package/dist/components/ui/avatar/index.d.ts +4 -0
  115. package/dist/components/ui/avatar/index.js +4 -0
  116. package/dist/components/ui/badge/badge.svelte +22 -10
  117. package/dist/components/ui/badge/badge.svelte.d.ts +14 -15
  118. package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +2 -2
  119. package/dist/components/ui/breadcrumb/breadcrumb-link.svelte +1 -1
  120. package/dist/components/ui/breadcrumb/breadcrumb-page.svelte +1 -1
  121. package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +2 -2
  122. package/dist/components/ui/button/button-padding.d.ts +9 -0
  123. package/dist/components/ui/button/button-padding.js +15 -0
  124. package/dist/components/ui/button/button.svelte +81 -31
  125. package/dist/components/ui/button/button.svelte.d.ts +48 -29
  126. package/dist/components/ui/calendar/calendar-cell.svelte +1 -1
  127. package/dist/components/ui/calendar/calendar-head-cell.svelte +1 -1
  128. package/dist/components/ui/calendar/calendar-next-button.svelte +2 -2
  129. package/dist/components/ui/calendar/calendar-prev-button.svelte +2 -2
  130. package/dist/components/ui/card/card-description.svelte +1 -1
  131. package/dist/components/ui/card/card-title.svelte +1 -1
  132. package/dist/components/ui/card/card.svelte +1 -1
  133. package/dist/components/ui/checkbox/checkbox.svelte +9 -5
  134. package/dist/components/ui/chip/chip.svelte +48 -0
  135. package/dist/components/ui/chip/chip.svelte.d.ts +13 -0
  136. package/dist/components/ui/chip/index.d.ts +2 -0
  137. package/dist/components/ui/chip/index.js +2 -0
  138. package/dist/components/ui/command/command-dialog.svelte +1 -1
  139. package/dist/components/ui/command/command-input.svelte +4 -4
  140. package/dist/components/ui/command/command-item.svelte +1 -1
  141. package/dist/components/ui/command/command.svelte +1 -1
  142. package/dist/components/ui/dialog/dialog-content.svelte +4 -4
  143. package/dist/components/ui/dialog/dialog-description.svelte +1 -1
  144. package/dist/components/ui/dialog/dialog-overlay.svelte +1 -1
  145. package/dist/components/ui/dialog/dialog-title.svelte +1 -1
  146. package/dist/components/ui/drawer/drawer-content.svelte +1 -1
  147. package/dist/components/ui/drawer/drawer-overlay.svelte +1 -1
  148. package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +5 -5
  149. package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +1 -1
  150. package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +1 -1
  151. package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +20 -2
  152. package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +4 -0
  153. package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +5 -1
  154. package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +3 -3
  155. package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +2 -1
  156. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +1 -1
  157. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +3 -3
  158. package/dist/components/ui/field/field-ids.d.ts +7 -0
  159. package/dist/components/ui/field/field-ids.js +15 -0
  160. package/dist/components/ui/field/field.svelte +62 -0
  161. package/dist/components/ui/field/field.svelte.d.ts +21 -0
  162. package/dist/components/ui/field/index.d.ts +3 -0
  163. package/dist/components/ui/field/index.js +3 -0
  164. package/dist/components/ui/hover-card/hover-card-content.svelte +1 -1
  165. package/dist/components/ui/icon-button/icon-button.svelte +72 -0
  166. package/dist/components/ui/icon-button/icon-button.svelte.d.ts +90 -0
  167. package/dist/components/ui/icon-button/index.d.ts +2 -0
  168. package/dist/components/ui/icon-button/index.js +4 -0
  169. package/dist/components/ui/input/index.d.ts +1 -0
  170. package/dist/components/ui/input/input.svelte +11 -4
  171. package/dist/components/ui/input/input.svelte.d.ts +4 -1
  172. package/dist/components/ui/input-otp/input-otp-separator.svelte +2 -2
  173. package/dist/components/ui/input-otp/input-otp-slot.svelte +5 -4
  174. package/dist/components/ui/input-otp/input-otp-slot.svelte.d.ts +1 -1
  175. package/dist/components/ui/input-otp/input-otp.svelte +1 -1
  176. package/dist/components/ui/label/label.svelte +3 -2
  177. package/dist/components/ui/popover/popover-content.svelte +1 -1
  178. package/dist/components/ui/progress/progress.svelte +19 -5
  179. package/dist/components/ui/progress/progress.svelte.d.ts +4 -2
  180. package/dist/components/ui/radio-group/radio-group-item.svelte +4 -4
  181. package/dist/components/ui/range-calendar/range-calendar-head-cell.svelte +1 -1
  182. package/dist/components/ui/range-calendar/range-calendar-next-button.svelte +2 -2
  183. package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte +2 -2
  184. package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte +4 -1
  185. package/dist/components/ui/scroll-area/scroll-area.svelte +1 -1
  186. package/dist/components/ui/select/select-content.svelte +1 -3
  187. package/dist/components/ui/select/select-item.svelte +5 -4
  188. package/dist/components/ui/select/select-scroll-down-button.svelte +2 -2
  189. package/dist/components/ui/select/select-scroll-up-button.svelte +2 -2
  190. package/dist/components/ui/select/select-trigger.svelte +4 -3
  191. package/dist/components/ui/skeleton/index.d.ts +2 -0
  192. package/dist/components/ui/skeleton/index.js +2 -0
  193. package/dist/components/ui/skeleton/skeleton.svelte +24 -0
  194. package/dist/components/ui/skeleton/skeleton.svelte.d.ts +8 -0
  195. package/dist/components/ui/slider/slider.svelte +5 -10
  196. package/dist/components/ui/sonner/sonner.svelte +19 -13
  197. package/dist/components/ui/stepper-button/index.d.ts +3 -0
  198. package/dist/components/ui/stepper-button/index.js +2 -0
  199. package/dist/components/ui/stepper-button/stepper-button.svelte +37 -0
  200. package/dist/components/ui/stepper-button/stepper-button.svelte.d.ts +9 -0
  201. package/dist/components/ui/switch/switch.svelte +8 -3
  202. package/dist/components/ui/table/table-cell.svelte +1 -1
  203. package/dist/components/ui/table/table-head.svelte +1 -1
  204. package/dist/components/ui/table/table-row.svelte +1 -1
  205. package/dist/components/ui/tabs/tabs-list.svelte +1 -1
  206. package/dist/components/ui/tabs/tabs-trigger.svelte +1 -1
  207. package/dist/components/ui/tag/index.d.ts +2 -0
  208. package/dist/components/ui/tag/index.js +2 -0
  209. package/dist/components/ui/tag/tag.svelte +42 -0
  210. package/dist/components/ui/tag/tag.svelte.d.ts +11 -0
  211. package/dist/components/ui/textarea/textarea.svelte +4 -3
  212. package/dist/components/ui/textarea/textarea.svelte.d.ts +2 -2
  213. package/dist/components/ui/toggle/toggle.svelte +9 -9
  214. package/dist/components/ui/toggle/toggle.svelte.d.ts +14 -21
  215. package/dist/components/ui/tooltip/tooltip-content.svelte +1 -1
  216. package/dist/fonts/Inter/Inter-Black.woff2 +0 -0
  217. package/dist/fonts/Inter/Inter-BlackItalic.woff2 +0 -0
  218. package/dist/fonts/Inter/Inter-Bold.woff2 +0 -0
  219. package/dist/fonts/Inter/Inter-BoldItalic.woff2 +0 -0
  220. package/dist/fonts/Inter/Inter-ExtraBold.woff2 +0 -0
  221. package/dist/fonts/Inter/Inter-ExtraBoldItalic.woff2 +0 -0
  222. package/dist/fonts/Inter/Inter-ExtraLight-BETA.woff2 +0 -0
  223. package/dist/fonts/Inter/Inter-ExtraLightItalic-BETA.woff2 +0 -0
  224. package/dist/fonts/Inter/Inter-Italic.woff2 +0 -0
  225. package/dist/fonts/Inter/Inter-Light-BETA.woff2 +0 -0
  226. package/dist/fonts/Inter/Inter-LightItalic-BETA.woff2 +0 -0
  227. package/dist/fonts/Inter/Inter-Medium.woff2 +0 -0
  228. package/dist/fonts/Inter/Inter-MediumItalic.woff2 +0 -0
  229. package/dist/fonts/Inter/Inter-Regular.woff2 +0 -0
  230. package/dist/fonts/Inter/Inter-SemiBold.woff2 +0 -0
  231. package/dist/fonts/Inter/Inter-SemiBoldItalic.woff2 +0 -0
  232. package/dist/fonts/Inter/Inter-Thin-BETA.woff2 +0 -0
  233. package/dist/fonts/Inter/Inter-ThinItalic-BETA.woff2 +0 -0
  234. package/dist/fonts/Inter/Inter-italic.var.woff2 +0 -0
  235. package/dist/fonts/Inter/Inter-upright.var.woff2 +0 -0
  236. package/dist/fonts/Inter/Inter.var.woff2 +0 -0
  237. package/dist/fonts/JetBrainsMono/JetBrainsMono-Regular.woff2 +0 -0
  238. package/dist/i18n/audit/designSystemWords.d.ts +1 -1
  239. package/dist/i18n/audit/designSystemWords.js +1 -1
  240. package/dist/styles/fonts.css +18 -14
  241. package/dist/styles/global.css +7 -19
  242. package/dist/styles/tokens.css +332 -0
  243. package/dist/utils.d.ts +27 -0
  244. package/dist/utils.js +33 -2
  245. package/package.json +2 -1
  246. package/tailwind.config.ts +7 -47
@@ -1,413 +1,422 @@
1
1
  <script lang="ts">
2
- // Svelte imports
3
- import { fade, scale } from 'svelte/transition';
4
- import { cubicOut } from 'svelte/easing';
5
- import { createEventDispatcher, onMount } from 'svelte';
6
- const dispatch = createEventDispatcher();
7
-
8
- // Design system componentsimports
9
- import { Button, WScrollArea, Portal } from '..';
10
- import { IconX } from '@tabler/icons-svelte';
11
-
12
- // Modal store
13
- import { modalState, openModal, closeModal } from './modalStore';
14
-
15
- /* COMPONENT PROPS */
16
- // class and style props
17
- let className = '';
18
- export { className as class };
19
- export let style: string = '';
20
- // modal dimensions
21
- export let width: string = '808px';
22
- export let height: string = '500px';
23
- // modal props
24
- export let modalType: string | undefined = undefined;
25
- export let modalData: any = undefined;
26
- // portal target
27
- export let target: string = '';
28
- // title props
29
- export let title: string | undefined = undefined;
30
- export let titlePadding: 'small' | 'large' = 'large';
31
- // modal state props
32
- export let open = false;
33
- export let enableSpaceKey = false;
34
- export let isSelected = false;
35
- export let showScroll = false;
36
- // The words a screen reader says for the close button. A page that shows the modal in another language passes its own.
37
- export let closeLabel: string = 'Close modal';
38
-
39
- // children prop(svelte 5) to replace the traditional slot(svelte 4)
40
- export let children: any;
41
-
42
- /* CONSTANTS */
43
- // Modal transition and style variables
44
- const transitionDuration = 200;
45
- const backdropOpacity = '0.4';
46
- const backdropBlur = '4px';
47
- const easing = cubicOut;
48
-
49
- // Update constants for modal constraints
50
- const PADDING = 24; // Consistent padding for sides and bottom
51
-
52
- /* STATE VARIABLES */
53
- // Add viewport dimension state
54
- let viewportWidth = 0;
55
- let viewportHeight = 0;
56
-
57
- // Modal vars
58
- let modalHeight = 0; // Height of the modal including borders that's why binded to offsetHeight
59
-
60
-
61
- // All Content Container vars
62
- const contentPadding = 16;
63
- let allContentHeight = 0;
64
- $: allContentHeight = 2 * contentPadding + titleHeight + contentHolderHeight;
65
-
66
- // Title vars
67
- let titleHeight = 0;
68
-
69
- // Content only vars
70
- let contentHolderHeight = 0;
71
- $: contentAvailableHeight = modalHeight - (2 * contentPadding + titleHeight);
72
- let updateContentDimInterval:any;
73
-
74
- // Show logs
75
- let showLogs = false;
76
-
77
-
78
- /* METHODS */
79
- function toggleUpdateContentDimensions(flag: boolean = true) {
80
- if (!flag) {
81
- clearInterval(updateContentDimInterval);
82
- updateContentDimInterval = undefined;
83
- } else {
84
- // updateContentDimInterval = setInterval(() => {updateViewportDimensions()}, 200);
85
- }
86
- }
87
-
88
- /**
89
- * LIFECYCLE HOOKS
90
- * */
91
- // Check stored state on mount and reopen if needed
92
- onMount(() => {
93
- if ($modalState.isOpen && !open) {
94
- // if(showLogs) console.log('Checking modal restoration:', {
95
- // currentType: modalType,
96
- // storedType: $modalState.modalType,
97
- // storedData: $modalState.data
98
- // });
99
-
100
- // Only reopen if this is the correct modal type
101
- if ($modalState.modalType === modalType) {
102
- // if(showLogs) console.log('Restoring modal state for:', modalType);
103
- open = true;
104
- modalData = $modalState.data;
105
- dispatch('restore', $modalState.data);
106
- }
107
- }
108
-
109
- // Initialize update content dimensions
110
- // updateViewportDimensions();
111
-
112
- // Add keydown listener
113
- window.addEventListener('keydown', handleKeydown);
114
-
115
- // Add resize listener
116
- // window.addEventListener('resize', updateViewportDimensions);
117
-
118
- return () => {
119
- // window.removeEventListener('resize', updateViewportDimensions);
120
- window.removeEventListener('keydown', handleKeydown);
121
-
122
- // Close the modal if it is open
123
- if (open) {
124
- closeModal();
125
- toggleUpdateContentDimensions(false);
126
- }
127
- };
128
- });
129
-
130
- // Function to update viewport dimensions
131
- function updateViewportDimensions() {// not used anymore
132
- // read window width and height
133
- // viewportWidth = window.innerWidth;
134
- // viewportHeight = window.innerHeight;
135
-
136
- // update the conetent holder height
137
- // setTimeout(() => {
138
- allContentHeight = 2 * contentPadding + titleHeight + contentHolderHeight;
139
- // if(showLogs) console.log('Modal current height:', allContentHeight);
140
- // let availableHeight = modalHeight - 2 * contentPadding;
141
- // if(showLogs) console.log('Modal current height:', allContentHeight, availableHeight);
142
- // contentHolderHeight = allContentHeight > availableHeight ? (availableHeight - titleHeight) + 'px' : 'auto';
143
- // modalFinalHeight = titleHeight + contentHeight + 2 * PADDING;
144
- // if(showLogs) console.log('Modal current height:', modalHeight, modalFinalHeight);
145
- // modalFinalHeight = Math.min(modalHeight, contentCurrentHeight);
146
- // }, 10);
147
- // if(showLogs) console.log('Updating viewport dimensions:', viewportWidth, viewportHeight);
148
- }
149
-
150
- // Reactive Statement to Calculate dynamic modal position and dimensions
151
- $: modalStyle = (() => {
152
- if (viewportWidth === 0 || viewportHeight === 0) {
153
- // Return default styles during SSR
154
- return {
155
- width: width,
156
- height: height,
157
- maxWidth: `calc(100vw - ${2 * PADDING}px)`,
158
- maxHeight: `calc(100vh - ${2 * PADDING}px)`,
159
- top: '50%',
160
- transform: 'translateY(-50%)'
161
- };
162
- }
163
-
164
- // Parse provided dimensions
165
- const providedWidth = parseInt(width);
166
- const providedHeight = parseInt(height);
167
-
168
- // Calculate maximum dimensions
169
- const maxWidth = viewportWidth - (2 * PADDING);
170
- const maxHeight = viewportHeight - (2 * PADDING);
171
-
172
- // Calculate actual dimensions
173
- const actualWidth = Math.min(providedWidth, maxWidth);
174
- const actualHeight = Math.min(providedHeight, maxHeight);
175
-
176
- // If the actual height is less than maxHeight, center it vertically(but ensure it never goes above PADDING
177
- const centeredTop = Math.max(PADDING, (viewportHeight - actualHeight) / 2);
178
-
179
- // Return the calculated styles
180
- return {
181
- width: `${actualWidth}px`,
182
- height: `${actualHeight}px`,
183
- maxWidth: `${maxWidth}px`,
184
- maxHeight: `${maxHeight}px`,
185
- top: `${centeredTop}px`,
186
- transform: 'none'
187
- };
188
- })();
189
-
190
- function handleKeydown(event: KeyboardEvent) {
191
- if (!open) return;
192
-
193
- // Only log keyboard events that we actually handle
194
- if (['Backspace', 'Escape', 'Space'].includes(event.key)) {
195
- // if(showLogs) console.log('Modal handling key:', event.key, 'Target:', (event.target as HTMLElement).tagName);
196
- }
197
-
198
- const target = event.target as HTMLElement;
199
- const isInput = target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable;
200
-
201
- // Let input fields handle their own events
202
- if (isInput) {
203
- return;
204
- }
205
-
206
- // Prevent backspace navigation when not in input
207
- if (event.key === 'Backspace') {
208
- event.preventDefault();
209
- event.stopPropagation();
210
- return;
211
- }
212
-
213
- if (event.key === 'Escape') {
214
- handleClose();
215
- }
216
-
217
- if (enableSpaceKey && open && event.code === 'Space') {
218
- event.preventDefault();
219
- event.stopPropagation();
220
- dispatch('spaceKey');
221
- }
222
- }
223
-
224
- function handleClose() {
225
- // if(showLogs) console.log('handleClose');
226
-
227
- // change the open state to false
228
- open = false;
229
-
230
- // Close the modal
231
- closeModal();
232
-
233
- // Stop updating the content dimensions
234
- toggleUpdateContentDimensions(false);
235
-
236
- // Dispatch close event
237
- dispatch('close');
238
- }
239
-
240
- // Only update the modal store when the open state actually changes
241
- let previousOpen = open;
242
- $: if (open !== previousOpen) {
243
- previousOpen = open;
244
-
245
- // if(showLogs) console.log('Modal open state changed:', { open, modalType, modalData });
246
-
247
- // Open the modal if the open state is true
248
- if (open) {
249
- openModal(modalType, modalData);
250
- toggleUpdateContentDimensions(true);
251
- } else {
252
- closeModal();
253
- toggleUpdateContentDimensions(false);
254
- }
255
- }
256
-
257
- // Improved backdrop click handler
258
- function handleBackdropClick(event: MouseEvent) {
259
- // Prevent any propagation
260
- event.preventDefault();
261
- event.stopPropagation();
262
-
263
- // Only handle clicks directly on the backdrop
264
- if (event.target === event.currentTarget) {
265
- // if(showLogs) console.log('Modal backdrop clicked!', event.type);
266
- handleClose();
267
- }
268
- }
2
+ // Svelte imports
3
+ import { fade, scale } from 'svelte/transition';
4
+ import { cubicOut } from 'svelte/easing';
5
+ import { createEventDispatcher, onMount } from 'svelte';
6
+ const dispatch = createEventDispatcher();
7
+
8
+ // Design system componentsimports
9
+ import { IconButton, WScrollArea, Portal } from '..';
10
+ import { IconX } from '@tabler/icons-svelte';
11
+
12
+ // Modal store
13
+ import { modalState, openModal, closeModal } from './modalStore';
14
+
15
+ /* COMPONENT PROPS */
16
+ // class and style props
17
+ let className = '';
18
+ export { className as class };
19
+ export let style: string = '';
20
+ // modal dimensions
21
+ export let width: string = '808px';
22
+ export let height: string = '500px';
23
+ // modal props
24
+ export let modalType: string | undefined = undefined;
25
+ export let modalData: any = undefined;
26
+ // portal target
27
+ export let target: string = '';
28
+ // title props
29
+ export let title: string | undefined = undefined;
30
+ export let titlePadding: 'small' | 'large' = 'large';
31
+ // modal state props
32
+ export let open = false;
33
+ export let enableSpaceKey = false;
34
+ export let isSelected = false;
35
+ export let showScroll = false;
36
+ // An image preview stays hidden until its real size is known, so the card does not open large and then shrink.
37
+ export let shown = true;
38
+ // Width and height ease to the content, instead of jumping.
39
+ export let animateSize = false;
40
+ // The words a screen reader says for the close button. A page that shows the modal in another language passes its own.
41
+ export let closeLabel: string = 'Close modal';
42
+ // A bare modal has no title row, no close button and no padding: its content draws all of it (the File Browser's
43
+ // search dialog is one: the search field is the top row). Close it with Escape or a click on the backdrop.
44
+ export let bare: boolean = false;
45
+
46
+ // children prop(svelte 5) to replace the traditional slot(svelte 4)
47
+ export let children: any;
48
+
49
+ /* CONSTANTS */
50
+ // Modal transition and style variables
51
+ const transitionDuration = 200;
52
+ const backdropBlur = '4px';
53
+ const easing = cubicOut;
54
+
55
+ // Update constants for modal constraints
56
+ const PADDING = 24; // Consistent padding for sides and bottom
57
+
58
+ /* STATE VARIABLES */
59
+ // Add viewport dimension state
60
+ let viewportWidth = 0;
61
+ let viewportHeight = 0;
62
+
63
+ // Modal vars
64
+ let modalHeight = 0; // Height of the modal including borders that's why binded to offsetHeight
65
+
66
+ // All Content Container vars
67
+ const contentPadding = 16;
68
+ let allContentHeight = 0;
69
+ // The card draws a 1px border and 24px of padding (a bare modal has no padding) around the title row and the content.
70
+ const CARD_BORDER = 1;
71
+ const CARD_PADDING = 24;
72
+ $: cardChromeHeight = 2 * CARD_BORDER + (bare ? 0 : 2 * CARD_PADDING);
73
+ // The title row (a bare modal has none) and the gap under it: 8px for a small title padding, 16px for a large one.
74
+ $: titleRowHeight = bare ? 0 : titleHeight + (titlePadding === 'small' ? 8 : 16);
75
+ // The card is exactly as tall as its content, the title row and what the card draws around them.
76
+ $: allContentHeight = cardChromeHeight + titleRowHeight + contentHolderHeight;
77
+
78
+ // Title vars
79
+ let titleHeight = 0;
80
+
81
+ // Content only vars
82
+ let contentHolderHeight = 0;
83
+ $: contentAvailableHeight = Math.max(0, modalHeight - cardChromeHeight - titleRowHeight);
84
+ let updateContentDimInterval: any;
85
+
86
+ // Show logs
87
+ let showLogs = false;
88
+
89
+ /* METHODS */
90
+ function toggleUpdateContentDimensions(flag: boolean = true) {
91
+ if (!flag) {
92
+ clearInterval(updateContentDimInterval);
93
+ updateContentDimInterval = undefined;
94
+ } else {
95
+ // updateContentDimInterval = setInterval(() => {updateViewportDimensions()}, 200);
96
+ }
97
+ }
98
+
99
+ /**
100
+ * LIFECYCLE HOOKS
101
+ * */
102
+ // Check stored state on mount and reopen if needed
103
+ onMount(() => {
104
+ if ($modalState.isOpen && !open) {
105
+ // if(showLogs) console.log('Checking modal restoration:', {
106
+ // currentType: modalType,
107
+ // storedType: $modalState.modalType,
108
+ // storedData: $modalState.data
109
+ // });
110
+
111
+ // Only reopen if this is the correct modal type
112
+ if ($modalState.modalType === modalType) {
113
+ // if(showLogs) console.log('Restoring modal state for:', modalType);
114
+ open = true;
115
+ modalData = $modalState.data;
116
+ dispatch('restore', $modalState.data);
117
+ }
118
+ }
119
+
120
+ // Initialize update content dimensions
121
+ // updateViewportDimensions();
122
+
123
+ // Add keydown listener
124
+ window.addEventListener('keydown', handleKeydown);
125
+
126
+ // Add resize listener
127
+ // window.addEventListener('resize', updateViewportDimensions);
128
+
129
+ return () => {
130
+ // window.removeEventListener('resize', updateViewportDimensions);
131
+ window.removeEventListener('keydown', handleKeydown);
132
+
133
+ // Close the modal if it is open
134
+ if (open) {
135
+ closeModal();
136
+ toggleUpdateContentDimensions(false);
137
+ }
138
+ };
139
+ });
140
+
141
+ // Function to update viewport dimensions
142
+ function updateViewportDimensions() {
143
+ // not used anymore
144
+ // read window width and height
145
+ // viewportWidth = window.innerWidth;
146
+ // viewportHeight = window.innerHeight;
147
+
148
+ // update the conetent holder height
149
+ // setTimeout(() => {
150
+ allContentHeight = 2 * contentPadding + titleHeight + contentHolderHeight;
151
+ // if(showLogs) console.log('Modal current height:', allContentHeight);
152
+ // let availableHeight = modalHeight - 2 * contentPadding;
153
+ // if(showLogs) console.log('Modal current height:', allContentHeight, availableHeight);
154
+ // contentHolderHeight = allContentHeight > availableHeight ? (availableHeight - titleHeight) + 'px' : 'auto';
155
+ // modalFinalHeight = titleHeight + contentHeight + 2 * PADDING;
156
+ // if(showLogs) console.log('Modal current height:', modalHeight, modalFinalHeight);
157
+ // modalFinalHeight = Math.min(modalHeight, contentCurrentHeight);
158
+ // }, 10);
159
+ // if(showLogs) console.log('Updating viewport dimensions:', viewportWidth, viewportHeight);
160
+ }
161
+
162
+ // Reactive Statement to Calculate dynamic modal position and dimensions
163
+ $: modalStyle = (() => {
164
+ if (viewportWidth === 0 || viewportHeight === 0) {
165
+ // Return default styles during SSR
166
+ return {
167
+ width: width,
168
+ height: height,
169
+ maxWidth: `calc(100vw - ${2 * PADDING}px)`,
170
+ maxHeight: `calc(100vh - ${2 * PADDING}px)`,
171
+ top: '50%',
172
+ transform: 'translateY(-50%)'
173
+ };
174
+ }
175
+
176
+ // Parse provided dimensions
177
+ const providedWidth = parseInt(width);
178
+ const providedHeight = parseInt(height);
179
+
180
+ // Calculate maximum dimensions
181
+ const maxWidth = viewportWidth - 2 * PADDING;
182
+ const maxHeight = viewportHeight - 2 * PADDING;
183
+
184
+ // Calculate actual dimensions
185
+ const actualWidth = Math.min(providedWidth, maxWidth);
186
+ const actualHeight = Math.min(providedHeight, maxHeight);
187
+
188
+ // If the actual height is less than maxHeight, center it vertically(but ensure it never goes above PADDING
189
+ const centeredTop = Math.max(PADDING, (viewportHeight - actualHeight) / 2);
190
+
191
+ // Return the calculated styles
192
+ return {
193
+ width: `${actualWidth}px`,
194
+ height: `${actualHeight}px`,
195
+ maxWidth: `${maxWidth}px`,
196
+ maxHeight: `${maxHeight}px`,
197
+ top: `${centeredTop}px`,
198
+ transform: 'none'
199
+ };
200
+ })();
201
+
202
+ function handleKeydown(event: KeyboardEvent) {
203
+ if (!open) return;
204
+
205
+ // Only log keyboard events that we actually handle
206
+ if (['Backspace', 'Escape', 'Space'].includes(event.key)) {
207
+ // if(showLogs) console.log('Modal handling key:', event.key, 'Target:', (event.target as HTMLElement).tagName);
208
+ }
209
+
210
+ const target = event.target as HTMLElement;
211
+ const isInput =
212
+ target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable;
213
+
214
+ // Let input fields handle their own events
215
+ if (isInput) {
216
+ return;
217
+ }
218
+
219
+ // Prevent backspace navigation when not in input
220
+ if (event.key === 'Backspace') {
221
+ event.preventDefault();
222
+ event.stopPropagation();
223
+ return;
224
+ }
225
+
226
+ if (event.key === 'Escape') {
227
+ handleClose();
228
+ }
229
+
230
+ if (enableSpaceKey && open && event.code === 'Space') {
231
+ event.preventDefault();
232
+ event.stopPropagation();
233
+ dispatch('spaceKey');
234
+ }
235
+ }
236
+
237
+ function handleClose() {
238
+ // if(showLogs) console.log('handleClose');
239
+
240
+ // change the open state to false
241
+ open = false;
242
+
243
+ // Close the modal
244
+ closeModal();
245
+
246
+ // Stop updating the content dimensions
247
+ toggleUpdateContentDimensions(false);
248
+
249
+ // Dispatch close event
250
+ dispatch('close');
251
+ }
252
+
253
+ // Only update the modal store when the open state actually changes
254
+ let previousOpen = open;
255
+ $: if (open !== previousOpen) {
256
+ previousOpen = open;
257
+
258
+ // if(showLogs) console.log('Modal open state changed:', { open, modalType, modalData });
259
+
260
+ // Open the modal if the open state is true
261
+ if (open) {
262
+ openModal(modalType, modalData);
263
+ toggleUpdateContentDimensions(true);
264
+ } else {
265
+ closeModal();
266
+ toggleUpdateContentDimensions(false);
267
+ }
268
+ }
269
+
270
+ // Improved backdrop click handler
271
+ function handleBackdropClick(event: MouseEvent) {
272
+ // Prevent any propagation
273
+ event.preventDefault();
274
+ event.stopPropagation();
275
+
276
+ // Only handle clicks directly on the backdrop
277
+ if (event.target === event.currentTarget) {
278
+ // if(showLogs) console.log('Modal backdrop clicked!', event.type);
279
+ handleClose();
280
+ }
281
+ }
269
282
  </script>
270
283
 
271
284
  {#if open}
272
- <Portal class="{className ? className + ' ' : ''}base-modal-portal"
273
- target={target || `modal-${modalType || 'default'}`}
274
- style={style}
275
- bind:clientWidth={viewportWidth}
276
- bind:clientHeight={viewportHeight}
277
- >
278
- <!-- Backdrop Container with blur restricted to file browser -->
279
- <!-- svelte-ignore a11y_no_static_element_interactions -->
280
- <!-- svelte-ignore a11y_click_events_have_key_events -->
281
- <div
282
- class="modal-backdrop-container absolute inset-0 pointer-events-auto"
283
- style="background-color: rgba(15, 32, 16, {backdropOpacity}); backdrop-filter: blur({backdropBlur}); z-index: 999;"
284
-
285
- transition:fade={{ duration: transitionDuration, easing }}
286
- on:mousedown={handleBackdropClick}
287
- on:click={handleBackdropClick}
288
- ></div>
289
-
290
- <!-- Close button -->
291
- <div class="modal-close-bt-container absolute top-4 end-4 z-1004" transition:fade={{ duration: transitionDuration, easing }}>
292
- <!-- svelte-ignore a11y-click-events-have-key-events -->
293
- <!-- svelte-ignore a11y-no-static-element-interactions -->
294
- <div
295
- class="close-button widgetic-colors p-0 w-10 h-10 bg-[hsl(var(--dark))] hover:bg-[hsl(var(--grey6))] transition-colors duration-200 rounded-full flex items-center justify-center cursor-pointer"
296
- on:click|stopPropagation|preventDefault={handleClose}
297
- aria-label={closeLabel}
298
- role="button"
299
- tabindex="0"
300
- >
301
- <IconX class="!w-[24px] !h-[24px] text-white" />
302
- </div>
303
- </div>
304
-
305
- <!-- Modal Main Container -->
306
- <div
307
- class="modal-root-container absolute w-full h-full inset-x-0 flex justify-center pointer-events-none items-center"
308
- style="z-index: 1000;"
309
- >
310
- <!-- Modal Content Container -->
311
- <div
312
- class="modal-content-inner-container fixed pointer-events-auto mx-6 overflow-hidden
313
- bg-white modal-shadow widgetic-colors rounded-medium widgetic-radius
314
- border select-text {isSelected && modalType === 'filePreview' ? 'border-[hsl(var(--grey1))]' : 'border-[hsl(var(--grey1))]'}"
315
- style="
285
+ <Portal
286
+ class="{className ? className + ' ' : ''}base-modal-portal"
287
+ target={target || `modal-${modalType || 'default'}`}
288
+ {style}
289
+ bind:clientWidth={viewportWidth}
290
+ bind:clientHeight={viewportHeight}
291
+ >
292
+ <!-- Backdrop Container with blur restricted to file browser -->
293
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
294
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
295
+ <div
296
+ class="modal-backdrop-container bg-inverse/40 pointer-events-auto absolute inset-0"
297
+ style="backdrop-filter: blur({backdropBlur}); z-index: 999;"
298
+ transition:fade={{ duration: transitionDuration, easing }}
299
+ on:mousedown={handleBackdropClick}
300
+ on:click={handleBackdropClick}
301
+ ></div>
302
+
303
+ <!-- Modal Main Container -->
304
+ <div
305
+ class="modal-root-container pointer-events-none absolute inset-x-0 flex h-full w-full items-center justify-center"
306
+ style="z-index: 1000;"
307
+ >
308
+ <!-- Modal Content Container -->
309
+ <div
310
+ class="modal-content-inner-container bg-background border-border rounded-panel pointer-events-auto fixed mx-6 overflow-hidden border select-text {bare ? 'p-0' : 'p-6'}"
311
+ style="
316
312
  width: {modalStyle.width};
317
313
  height: {allContentHeight}px;
318
- min-width: {2 * contentPadding + 100}px;
319
- min-height: {2 * contentPadding + 50}px;
314
+ min-width: {bare ? 100 : 2 * contentPadding + 100}px;
315
+ min-height: {bare ? 50 : 2 * contentPadding + 50}px;
320
316
  max-width: {modalStyle.maxWidth};
321
317
  max-height: {modalStyle.maxHeight};
322
- padding: {contentPadding}px 0;
318
+ visibility: {viewportWidth === 0 || !shown ? 'hidden' : 'visible'};
319
+ transition: {animateSize ? 'width 200ms ease, height 200ms ease' : 'none'};
323
320
  user-select: text;
324
321
  -webkit-user-select: text;
325
322
  -moz-user-select: text;
326
323
  -ms-user-select: text;
327
324
  z-index: 1003;
328
325
  "
329
- bind:offsetHeight={modalHeight}
330
- in:scale={{ duration: transitionDuration, start: 0.95, opacity: 0, easing }}
331
- out:scale={{ duration: transitionDuration, start: 0.95, opacity: 0, easing }}
332
- on:click|stopPropagation
333
- >
334
- <!-- Content Title -->
335
- {#if title}
336
- <div bind:clientHeight={titleHeight}
337
- class="modal-title-container h5 text-[hsl(var(--grey7))] overflow-hidden
338
- text-center px-4 {titlePadding === 'small' ? 'pb-2' : 'pb-4'}">
339
- {title}
340
- </div>
341
- {/if}
342
-
343
- <!-- Content Slot Container -->
344
- {#snippet contentSlot()}
345
- <div class="modal-content-slot-container w-full" bind:clientHeight={contentHolderHeight}>
346
- {@render children()}
347
- </div>
348
- {/snippet}
349
-
350
- <!-- Content with Scroll Area -->
351
- {#if showScroll}
352
- <WScrollArea class="modal-content-container scroll-container" type="always" scrollOutside={true}
353
- style="height: {contentAvailableHeight}px"
354
- >
355
- {@render contentSlot()}
356
- </WScrollArea>
357
- {:else}
358
- <div class="modal-content-container"
359
- style="height: {contentAvailableHeight}px;"
360
- >
361
- {@render contentSlot()}
362
- </div>
363
- {/if}
364
-
365
- </div>
366
- </div>
367
- </Portal>
326
+ bind:offsetHeight={modalHeight}
327
+ in:scale={{ duration: transitionDuration, start: 0.95, opacity: 0, easing }}
328
+ out:scale={{ duration: transitionDuration, start: 0.95, opacity: 0, easing }}
329
+ on:click|stopPropagation
330
+ >
331
+ <!-- Content Title (a bare modal has none) -->
332
+ {#if !bare}
333
+ <div
334
+ bind:clientHeight={titleHeight}
335
+ class="modal-title-container flex items-start justify-between gap-2 overflow-hidden {titlePadding ===
336
+ 'small'
337
+ ? 'mb-2'
338
+ : 'mb-4'}"
339
+ aria-selected={isSelected}
340
+ >
341
+ {#if title}
342
+ <h2 class="text-heading-page text-foreground min-w-0 flex-1 text-start">{title}</h2>
343
+ {:else}
344
+ <div class="min-w-0 flex-1"></div>
345
+ {/if}
346
+ <IconButton variant="ghost" label={closeLabel} onclick={handleClose}>
347
+ <IconX class="size-4 stroke-[1.333]" />
348
+ </IconButton>
349
+ </div>
350
+ {/if}
351
+
352
+ <!-- Content Slot Container -->
353
+ {#snippet contentSlot()}
354
+ <div class="modal-content-slot-container w-full" bind:clientHeight={contentHolderHeight}>
355
+ {@render children()}
356
+ </div>
357
+ {/snippet}
358
+
359
+ <!-- Content with Scroll Area -->
360
+ {#if showScroll}
361
+ <WScrollArea
362
+ class="modal-content-container scroll-container"
363
+ type="always"
364
+ scrollOutside={true}
365
+ style="height: {contentAvailableHeight}px"
366
+ >
367
+ {@render contentSlot()}
368
+ </WScrollArea>
369
+ {:else}
370
+ <div class="modal-content-container" style="height: {contentAvailableHeight}px;">
371
+ {@render contentSlot()}
372
+ </div>
373
+ {/if}
374
+ </div>
375
+ </div>
376
+ </Portal>
368
377
  {/if}
369
378
 
370
379
  <style>
371
- .modal-content-container {
372
- width: 100%;
373
- height: 100%;
374
- overflow: hidden;
375
- }
376
-
377
- /* Add specific styling for the backdrop to ensure it captures all clicks */
378
- .modal-backdrop-container {
379
- pointer-events: all !important;
380
- }
381
-
382
- :global(.ScrollAreaViewport) {
383
- width: 100%;
384
- height: 100%;
385
- border-radius: inherit;
386
- }
387
-
388
- :global(.ScrollAreaScrollbar[data-state='hidden']) {
389
- display: none;
390
- }
391
-
392
- /* Ensure text selection works in modals */
393
- :global(.base-modal-portal),
394
- :global(.modal-content-inner-container),
395
- :global(.modal-content-root-container) {
396
- user-select: text !important;
397
- -webkit-user-select: text !important;
398
- -moz-user-select: text !important;
399
- -ms-user-select: text !important;
400
- }
401
-
402
- /* Ensure text selection works in input fields */
403
- :global(.base-modal-portal input),
404
- :global(.base-modal-portal textarea),
405
- :global(.base-modal-portal select),
406
- :global(.base-modal-portal [contenteditable="true"]) {
407
- user-select: text !important;
408
- -webkit-user-select: text !important;
409
- -moz-user-select: text !important;
410
- -ms-user-select: text !important;
411
- cursor: text !important;
412
- }
380
+ .modal-content-container {
381
+ width: 100%;
382
+ height: 100%;
383
+ overflow: hidden;
384
+ }
385
+
386
+ /* Add specific styling for the backdrop to ensure it captures all clicks */
387
+ .modal-backdrop-container {
388
+ pointer-events: all !important;
389
+ }
390
+
391
+ :global(.ScrollAreaViewport) {
392
+ width: 100%;
393
+ height: 100%;
394
+ border-radius: inherit;
395
+ }
396
+
397
+ :global(.ScrollAreaScrollbar[data-state='hidden']) {
398
+ display: none;
399
+ }
400
+
401
+ /* Ensure text selection works in modals */
402
+ :global(.base-modal-portal),
403
+ :global(.modal-content-inner-container),
404
+ :global(.modal-content-root-container) {
405
+ user-select: text !important;
406
+ -webkit-user-select: text !important;
407
+ -moz-user-select: text !important;
408
+ -ms-user-select: text !important;
409
+ }
410
+
411
+ /* Ensure text selection works in input fields */
412
+ :global(.base-modal-portal input),
413
+ :global(.base-modal-portal textarea),
414
+ :global(.base-modal-portal select),
415
+ :global(.base-modal-portal [contenteditable='true']) {
416
+ user-select: text !important;
417
+ -webkit-user-select: text !important;
418
+ -moz-user-select: text !important;
419
+ -ms-user-select: text !important;
420
+ cursor: text !important;
421
+ }
413
422
  </style>