@widgetic/design-system 0.5.22 → 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 +402 -399
  41. package/dist/components/modals/BaseModal.svelte.d.ts +1 -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 +1 -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,419 +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
- // 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
-
43
- // children prop(svelte 5) to replace the traditional slot(svelte 4)
44
- export let children: any;
45
-
46
- /* CONSTANTS */
47
- // Modal transition and style variables
48
- const transitionDuration = 200;
49
- const backdropOpacity = '0.4';
50
- const backdropBlur = '4px';
51
- const easing = cubicOut;
52
-
53
- // Update constants for modal constraints
54
- const PADDING = 24; // Consistent padding for sides and bottom
55
-
56
- /* STATE VARIABLES */
57
- // Add viewport dimension state
58
- let viewportWidth = 0;
59
- let viewportHeight = 0;
60
-
61
- // Modal vars
62
- let modalHeight = 0; // Height of the modal including borders that's why binded to offsetHeight
63
-
64
-
65
- // All Content Container vars
66
- const contentPadding = 16;
67
- let allContentHeight = 0;
68
- $: allContentHeight = 2 * contentPadding + titleHeight + contentHolderHeight;
69
-
70
- // Title vars
71
- let titleHeight = 0;
72
-
73
- // Content only vars
74
- let contentHolderHeight = 0;
75
- $: contentAvailableHeight = modalHeight - (2 * contentPadding + titleHeight);
76
- let updateContentDimInterval:any;
77
-
78
- // Show logs
79
- let showLogs = false;
80
-
81
-
82
- /* METHODS */
83
- function toggleUpdateContentDimensions(flag: boolean = true) {
84
- if (!flag) {
85
- clearInterval(updateContentDimInterval);
86
- updateContentDimInterval = undefined;
87
- } else {
88
- // updateContentDimInterval = setInterval(() => {updateViewportDimensions()}, 200);
89
- }
90
- }
91
-
92
- /**
93
- * LIFECYCLE HOOKS
94
- * */
95
- // Check stored state on mount and reopen if needed
96
- onMount(() => {
97
- if ($modalState.isOpen && !open) {
98
- // if(showLogs) console.log('Checking modal restoration:', {
99
- // currentType: modalType,
100
- // storedType: $modalState.modalType,
101
- // storedData: $modalState.data
102
- // });
103
-
104
- // Only reopen if this is the correct modal type
105
- if ($modalState.modalType === modalType) {
106
- // if(showLogs) console.log('Restoring modal state for:', modalType);
107
- open = true;
108
- modalData = $modalState.data;
109
- dispatch('restore', $modalState.data);
110
- }
111
- }
112
-
113
- // Initialize update content dimensions
114
- // updateViewportDimensions();
115
-
116
- // Add keydown listener
117
- window.addEventListener('keydown', handleKeydown);
118
-
119
- // Add resize listener
120
- // window.addEventListener('resize', updateViewportDimensions);
121
-
122
- return () => {
123
- // window.removeEventListener('resize', updateViewportDimensions);
124
- window.removeEventListener('keydown', handleKeydown);
125
-
126
- // Close the modal if it is open
127
- if (open) {
128
- closeModal();
129
- toggleUpdateContentDimensions(false);
130
- }
131
- };
132
- });
133
-
134
- // Function to update viewport dimensions
135
- function updateViewportDimensions() {// not used anymore
136
- // read window width and height
137
- // viewportWidth = window.innerWidth;
138
- // viewportHeight = window.innerHeight;
139
-
140
- // update the conetent holder height
141
- // setTimeout(() => {
142
- allContentHeight = 2 * contentPadding + titleHeight + contentHolderHeight;
143
- // if(showLogs) console.log('Modal current height:', allContentHeight);
144
- // let availableHeight = modalHeight - 2 * contentPadding;
145
- // if(showLogs) console.log('Modal current height:', allContentHeight, availableHeight);
146
- // contentHolderHeight = allContentHeight > availableHeight ? (availableHeight - titleHeight) + 'px' : 'auto';
147
- // modalFinalHeight = titleHeight + contentHeight + 2 * PADDING;
148
- // if(showLogs) console.log('Modal current height:', modalHeight, modalFinalHeight);
149
- // modalFinalHeight = Math.min(modalHeight, contentCurrentHeight);
150
- // }, 10);
151
- // if(showLogs) console.log('Updating viewport dimensions:', viewportWidth, viewportHeight);
152
- }
153
-
154
- // Reactive Statement to Calculate dynamic modal position and dimensions
155
- $: modalStyle = (() => {
156
- if (viewportWidth === 0 || viewportHeight === 0) {
157
- // Return default styles during SSR
158
- return {
159
- width: width,
160
- height: height,
161
- maxWidth: `calc(100vw - ${2 * PADDING}px)`,
162
- maxHeight: `calc(100vh - ${2 * PADDING}px)`,
163
- top: '50%',
164
- transform: 'translateY(-50%)'
165
- };
166
- }
167
-
168
- // Parse provided dimensions
169
- const providedWidth = parseInt(width);
170
- const providedHeight = parseInt(height);
171
-
172
- // Calculate maximum dimensions
173
- const maxWidth = viewportWidth - (2 * PADDING);
174
- const maxHeight = viewportHeight - (2 * PADDING);
175
-
176
- // Calculate actual dimensions
177
- const actualWidth = Math.min(providedWidth, maxWidth);
178
- const actualHeight = Math.min(providedHeight, maxHeight);
179
-
180
- // If the actual height is less than maxHeight, center it vertically(but ensure it never goes above PADDING
181
- const centeredTop = Math.max(PADDING, (viewportHeight - actualHeight) / 2);
182
-
183
- // Return the calculated styles
184
- return {
185
- width: `${actualWidth}px`,
186
- height: `${actualHeight}px`,
187
- maxWidth: `${maxWidth}px`,
188
- maxHeight: `${maxHeight}px`,
189
- top: `${centeredTop}px`,
190
- transform: 'none'
191
- };
192
- })();
193
-
194
- function handleKeydown(event: KeyboardEvent) {
195
- if (!open) return;
196
-
197
- // Only log keyboard events that we actually handle
198
- if (['Backspace', 'Escape', 'Space'].includes(event.key)) {
199
- // if(showLogs) console.log('Modal handling key:', event.key, 'Target:', (event.target as HTMLElement).tagName);
200
- }
201
-
202
- const target = event.target as HTMLElement;
203
- const isInput = target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable;
204
-
205
- // Let input fields handle their own events
206
- if (isInput) {
207
- return;
208
- }
209
-
210
- // Prevent backspace navigation when not in input
211
- if (event.key === 'Backspace') {
212
- event.preventDefault();
213
- event.stopPropagation();
214
- return;
215
- }
216
-
217
- if (event.key === 'Escape') {
218
- handleClose();
219
- }
220
-
221
- if (enableSpaceKey && open && event.code === 'Space') {
222
- event.preventDefault();
223
- event.stopPropagation();
224
- dispatch('spaceKey');
225
- }
226
- }
227
-
228
- function handleClose() {
229
- // if(showLogs) console.log('handleClose');
230
-
231
- // change the open state to false
232
- open = false;
233
-
234
- // Close the modal
235
- closeModal();
236
-
237
- // Stop updating the content dimensions
238
- toggleUpdateContentDimensions(false);
239
-
240
- // Dispatch close event
241
- dispatch('close');
242
- }
243
-
244
- // Only update the modal store when the open state actually changes
245
- let previousOpen = open;
246
- $: if (open !== previousOpen) {
247
- previousOpen = open;
248
-
249
- // if(showLogs) console.log('Modal open state changed:', { open, modalType, modalData });
250
-
251
- // Open the modal if the open state is true
252
- if (open) {
253
- openModal(modalType, modalData);
254
- toggleUpdateContentDimensions(true);
255
- } else {
256
- closeModal();
257
- toggleUpdateContentDimensions(false);
258
- }
259
- }
260
-
261
- // Improved backdrop click handler
262
- function handleBackdropClick(event: MouseEvent) {
263
- // Prevent any propagation
264
- event.preventDefault();
265
- event.stopPropagation();
266
-
267
- // Only handle clicks directly on the backdrop
268
- if (event.target === event.currentTarget) {
269
- // if(showLogs) console.log('Modal backdrop clicked!', event.type);
270
- handleClose();
271
- }
272
- }
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
+ }
273
282
  </script>
274
283
 
275
284
  {#if open}
276
- <Portal class="{className ? className + ' ' : ''}base-modal-portal"
277
- target={target || `modal-${modalType || 'default'}`}
278
- style={style}
279
- bind:clientWidth={viewportWidth}
280
- bind:clientHeight={viewportHeight}
281
- >
282
- <!-- Backdrop Container with blur restricted to file browser -->
283
- <!-- svelte-ignore a11y_no_static_element_interactions -->
284
- <!-- svelte-ignore a11y_click_events_have_key_events -->
285
- <div
286
- class="modal-backdrop-container absolute inset-0 pointer-events-auto"
287
- style="background-color: rgba(15, 32, 16, {backdropOpacity}); backdrop-filter: blur({backdropBlur}); z-index: 999;"
288
-
289
- transition:fade={{ duration: transitionDuration, easing }}
290
- on:mousedown={handleBackdropClick}
291
- on:click={handleBackdropClick}
292
- ></div>
293
-
294
- <!-- Close button -->
295
- <div class="modal-close-bt-container absolute top-4 end-4 z-1004" transition:fade={{ duration: transitionDuration, easing }}>
296
- <!-- svelte-ignore a11y-click-events-have-key-events -->
297
- <!-- svelte-ignore a11y-no-static-element-interactions -->
298
- <div
299
- 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"
300
- on:click|stopPropagation|preventDefault={handleClose}
301
- aria-label={closeLabel}
302
- role="button"
303
- tabindex="0"
304
- >
305
- <IconX class="!w-[24px] !h-[24px] text-white" />
306
- </div>
307
- </div>
308
-
309
- <!-- Modal Main Container -->
310
- <div
311
- class="modal-root-container absolute w-full h-full inset-x-0 flex justify-center pointer-events-none items-center"
312
- style="z-index: 1000;"
313
- >
314
- <!-- Modal Content Container -->
315
- <div
316
- class="modal-content-inner-container fixed pointer-events-auto mx-6 overflow-hidden
317
- bg-white modal-shadow widgetic-colors rounded-medium widgetic-radius
318
- border select-text {isSelected && modalType === 'filePreview' ? 'border-[hsl(var(--grey1))]' : 'border-[hsl(var(--grey1))]'}"
319
- 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="
320
312
  width: {modalStyle.width};
321
313
  height: {allContentHeight}px;
322
- min-width: {2 * contentPadding + 100}px;
323
- min-height: {2 * contentPadding + 50}px;
314
+ min-width: {bare ? 100 : 2 * contentPadding + 100}px;
315
+ min-height: {bare ? 50 : 2 * contentPadding + 50}px;
324
316
  max-width: {modalStyle.maxWidth};
325
317
  max-height: {modalStyle.maxHeight};
326
318
  visibility: {viewportWidth === 0 || !shown ? 'hidden' : 'visible'};
327
319
  transition: {animateSize ? 'width 200ms ease, height 200ms ease' : 'none'};
328
- padding: {contentPadding}px 0;
329
320
  user-select: text;
330
321
  -webkit-user-select: text;
331
322
  -moz-user-select: text;
332
323
  -ms-user-select: text;
333
324
  z-index: 1003;
334
325
  "
335
- bind:offsetHeight={modalHeight}
336
- in:scale={{ duration: transitionDuration, start: 0.95, opacity: 0, easing }}
337
- out:scale={{ duration: transitionDuration, start: 0.95, opacity: 0, easing }}
338
- on:click|stopPropagation
339
- >
340
- <!-- Content Title -->
341
- {#if title}
342
- <div bind:clientHeight={titleHeight}
343
- class="modal-title-container h5 text-[hsl(var(--grey7))] overflow-hidden
344
- text-center px-4 {titlePadding === 'small' ? 'pb-2' : 'pb-4'}">
345
- {title}
346
- </div>
347
- {/if}
348
-
349
- <!-- Content Slot Container -->
350
- {#snippet contentSlot()}
351
- <div class="modal-content-slot-container w-full" bind:clientHeight={contentHolderHeight}>
352
- {@render children()}
353
- </div>
354
- {/snippet}
355
-
356
- <!-- Content with Scroll Area -->
357
- {#if showScroll}
358
- <WScrollArea class="modal-content-container scroll-container" type="always" scrollOutside={true}
359
- style="height: {contentAvailableHeight}px"
360
- >
361
- {@render contentSlot()}
362
- </WScrollArea>
363
- {:else}
364
- <div class="modal-content-container"
365
- style="height: {contentAvailableHeight}px;"
366
- >
367
- {@render contentSlot()}
368
- </div>
369
- {/if}
370
-
371
- </div>
372
- </div>
373
- </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>
374
377
  {/if}
375
378
 
376
379
  <style>
377
- .modal-content-container {
378
- width: 100%;
379
- height: 100%;
380
- overflow: hidden;
381
- }
382
-
383
- /* Add specific styling for the backdrop to ensure it captures all clicks */
384
- .modal-backdrop-container {
385
- pointer-events: all !important;
386
- }
387
-
388
- :global(.ScrollAreaViewport) {
389
- width: 100%;
390
- height: 100%;
391
- border-radius: inherit;
392
- }
393
-
394
- :global(.ScrollAreaScrollbar[data-state='hidden']) {
395
- display: none;
396
- }
397
-
398
- /* Ensure text selection works in modals */
399
- :global(.base-modal-portal),
400
- :global(.modal-content-inner-container),
401
- :global(.modal-content-root-container) {
402
- user-select: text !important;
403
- -webkit-user-select: text !important;
404
- -moz-user-select: text !important;
405
- -ms-user-select: text !important;
406
- }
407
-
408
- /* Ensure text selection works in input fields */
409
- :global(.base-modal-portal input),
410
- :global(.base-modal-portal textarea),
411
- :global(.base-modal-portal select),
412
- :global(.base-modal-portal [contenteditable="true"]) {
413
- user-select: text !important;
414
- -webkit-user-select: text !important;
415
- -moz-user-select: text !important;
416
- -ms-user-select: text !important;
417
- cursor: text !important;
418
- }
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
+ }
419
422
  </style>