@widgetic/design-system 0.3.79 → 0.3.81

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 (254) hide show
  1. package/README.md +828 -123
  2. package/dist/components/CopyableHeader.svelte +13 -11
  3. package/dist/components/CopyableHeader.svelte.d.ts +34 -38
  4. package/dist/components/EmptyState.svelte +2 -9
  5. package/dist/components/EmptyState.svelte.d.ts +30 -35
  6. package/dist/components/PasswordInput.svelte +1 -5
  7. package/dist/components/PasswordInput.svelte.d.ts +19 -23
  8. package/dist/components/ThumbHashImage.svelte.d.ts +20 -24
  9. package/dist/components/WScrollArea.svelte +3 -3
  10. package/dist/components/WScrollArea.svelte.d.ts +25 -36
  11. package/dist/components/debug-grid/DebugGrid.svelte +1 -1
  12. package/dist/components/debug-grid/DebugGrid.svelte.d.ts +26 -30
  13. package/dist/components/ic/browser/BrowserInputController.svelte +1 -1
  14. package/dist/components/ic/browser/BrowserInputController.svelte.d.ts +26 -31
  15. package/dist/components/index.d.ts +1 -1
  16. package/dist/components/index.js +1 -1
  17. package/dist/components/modals/ActionModal.svelte.d.ts +36 -47
  18. package/dist/components/modals/BaseModal.svelte +1 -1
  19. package/dist/components/modals/BaseModal.svelte.d.ts +32 -36
  20. package/dist/components/modals/NewItemDialog.svelte +1 -1
  21. package/dist/components/modals/NewItemDialog.svelte.d.ts +33 -37
  22. package/dist/components/modals/Portal.svelte.d.ts +21 -32
  23. package/dist/components/modals/RenameDialog.svelte +6 -7
  24. package/dist/components/modals/RenameDialog.svelte.d.ts +33 -37
  25. package/dist/components/modals/modalStore.js +21 -26
  26. package/dist/components/navigation/Breadcrumbs.svelte +9 -9
  27. package/dist/components/navigation/Breadcrumbs.svelte.d.ts +28 -32
  28. package/dist/components/pdf/PDFViewer.svelte +19 -10
  29. package/dist/components/pdf/PDFViewer.svelte.d.ts +26 -30
  30. package/dist/components/search-input/SearchInput.svelte +8 -3
  31. package/dist/components/search-input/SearchInput.svelte.d.ts +40 -44
  32. package/dist/components/search-input/index.d.ts +14 -3
  33. package/dist/components/search-input/index.js +2 -1
  34. package/dist/components/shad-editor/colorpicker.svelte.d.ts +13 -5
  35. package/dist/components/shad-editor/custom/code-extended.svelte.d.ts +14 -4
  36. package/dist/components/shad-editor/custom/image-extended-component.svelte +1 -1
  37. package/dist/components/shad-editor/custom/image-extended-component.svelte.d.ts +14 -4
  38. package/dist/components/shad-editor/editor-toolbar.svelte.d.ts +13 -7
  39. package/dist/components/shad-editor/editor.css +4 -8
  40. package/dist/components/shad-editor/icons/block-quote.svelte.d.ts +13 -6
  41. package/dist/components/shad-editor/icons/bold.svelte.d.ts +13 -7
  42. package/dist/components/shad-editor/icons/buttle-list.svelte.d.ts +13 -6
  43. package/dist/components/shad-editor/icons/code.svelte.d.ts +13 -7
  44. package/dist/components/shad-editor/icons/highlighter.svelte.d.ts +13 -8
  45. package/dist/components/shad-editor/icons/image.svelte.d.ts +13 -7
  46. package/dist/components/shad-editor/icons/italic.svelte.d.ts +13 -7
  47. package/dist/components/shad-editor/icons/link.svelte.d.ts +13 -7
  48. package/dist/components/shad-editor/icons/ordered-list.svelte.d.ts +13 -6
  49. package/dist/components/shad-editor/icons/quickcolor.svelte.d.ts +13 -6
  50. package/dist/components/shad-editor/icons/redo.svelte.d.ts +13 -7
  51. package/dist/components/shad-editor/icons/search-replace.svelte.d.ts +13 -6
  52. package/dist/components/shad-editor/icons/strikethrough.svelte.d.ts +13 -7
  53. package/dist/components/shad-editor/icons/subscript.svelte.d.ts +13 -7
  54. package/dist/components/shad-editor/icons/superscript.svelte.d.ts +13 -7
  55. package/dist/components/shad-editor/icons/table.svelte +3 -3
  56. package/dist/components/shad-editor/icons/table.svelte.d.ts +13 -7
  57. package/dist/components/shad-editor/icons/task-list.svelte.d.ts +13 -6
  58. package/dist/components/shad-editor/icons/text.svelte +1 -1
  59. package/dist/components/shad-editor/icons/text.svelte.d.ts +13 -6
  60. package/dist/components/shad-editor/icons/textalign.svelte.d.ts +13 -6
  61. package/dist/components/shad-editor/icons/textcolor.svelte.d.ts +13 -7
  62. package/dist/components/shad-editor/icons/underline.svelte.d.ts +13 -7
  63. package/dist/components/shad-editor/icons/undo.svelte.d.ts +13 -7
  64. package/dist/components/shad-editor/onedark.css +0 -3
  65. package/dist/components/shad-editor/shad-editor.svelte +1 -1
  66. package/dist/components/shad-editor/shad-editor.svelte.d.ts +20 -30
  67. package/dist/components/toast/ToasterModal.svelte +11 -15
  68. package/dist/components/toast/ToasterModal.svelte.d.ts +11 -16
  69. package/dist/components/ui/accordion/accordion-content.svelte.d.ts +14 -4
  70. package/dist/components/ui/accordion/accordion-item.svelte.d.ts +14 -4
  71. package/dist/components/ui/accordion/accordion-trigger.svelte.d.ts +13 -6
  72. package/dist/components/ui/accordion/index.d.ts +1 -1
  73. package/dist/components/ui/alert/alert-description.svelte.d.ts +14 -25
  74. package/dist/components/ui/alert/alert-title.svelte.d.ts +16 -27
  75. package/dist/components/ui/alert/alert.svelte.d.ts +16 -27
  76. package/dist/components/ui/badge/badge.svelte +1 -1
  77. package/dist/components/ui/badge/badge.svelte.d.ts +15 -9
  78. package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte.d.ts +14 -5
  79. package/dist/components/ui/breadcrumb/breadcrumb-item.svelte.d.ts +14 -5
  80. package/dist/components/ui/breadcrumb/breadcrumb-link.svelte.d.ts +13 -10
  81. package/dist/components/ui/breadcrumb/breadcrumb-list.svelte.d.ts +14 -5
  82. package/dist/components/ui/breadcrumb/breadcrumb-page.svelte.d.ts +14 -5
  83. package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte.d.ts +14 -5
  84. package/dist/components/ui/breadcrumb/breadcrumb.svelte.d.ts +14 -5
  85. package/dist/components/ui/button/button.svelte +1 -1
  86. package/dist/components/ui/button/button.svelte.d.ts +16 -5
  87. package/dist/components/ui/calendar/calendar-cell.svelte.d.ts +14 -4
  88. package/dist/components/ui/calendar/calendar-day.svelte +4 -4
  89. package/dist/components/ui/calendar/calendar-day.svelte.d.ts +14 -4
  90. package/dist/components/ui/calendar/calendar-grid-body.svelte.d.ts +14 -4
  91. package/dist/components/ui/calendar/calendar-grid-head.svelte.d.ts +14 -4
  92. package/dist/components/ui/calendar/calendar-grid-row.svelte.d.ts +14 -4
  93. package/dist/components/ui/calendar/calendar-grid.svelte.d.ts +14 -4
  94. package/dist/components/ui/calendar/calendar-head-cell.svelte.d.ts +14 -4
  95. package/dist/components/ui/calendar/calendar-header.svelte.d.ts +14 -4
  96. package/dist/components/ui/calendar/calendar-heading.svelte.d.ts +14 -4
  97. package/dist/components/ui/calendar/calendar-months.svelte.d.ts +14 -5
  98. package/dist/components/ui/calendar/calendar-next-button.svelte.d.ts +14 -4
  99. package/dist/components/ui/calendar/calendar-prev-button.svelte.d.ts +14 -4
  100. package/dist/components/ui/calendar/calendar.svelte.d.ts +14 -5
  101. package/dist/components/ui/card/card-content.svelte.d.ts +14 -5
  102. package/dist/components/ui/card/card-description.svelte.d.ts +14 -5
  103. package/dist/components/ui/card/card-footer.svelte.d.ts +14 -5
  104. package/dist/components/ui/card/card-header.svelte.d.ts +14 -5
  105. package/dist/components/ui/card/card-title.svelte.d.ts +13 -7
  106. package/dist/components/ui/card/card.svelte +1 -1
  107. package/dist/components/ui/card/card.svelte.d.ts +14 -5
  108. package/dist/components/ui/checkbox/checkbox.svelte +1 -1
  109. package/dist/components/ui/checkbox/checkbox.svelte.d.ts +14 -4
  110. package/dist/components/ui/collapsible/index.d.ts +1 -1
  111. package/dist/components/ui/command/command-dialog.svelte +1 -1
  112. package/dist/components/ui/command/command-dialog.svelte.d.ts +13 -8
  113. package/dist/components/ui/command/command-empty.svelte.d.ts +14 -4
  114. package/dist/components/ui/command/command-group.svelte.d.ts +13 -6
  115. package/dist/components/ui/command/command-input.svelte +1 -1
  116. package/dist/components/ui/command/command-input.svelte.d.ts +14 -4
  117. package/dist/components/ui/command/command-item.svelte +1 -1
  118. package/dist/components/ui/command/command-item.svelte.d.ts +14 -4
  119. package/dist/components/ui/command/command-link-item.svelte +1 -1
  120. package/dist/components/ui/command/command-link-item.svelte.d.ts +14 -4
  121. package/dist/components/ui/command/command-list.svelte.d.ts +14 -4
  122. package/dist/components/ui/command/command-separator.svelte.d.ts +14 -4
  123. package/dist/components/ui/command/command-shortcut.svelte.d.ts +14 -5
  124. package/dist/components/ui/command/command.svelte.d.ts +14 -4
  125. package/dist/components/ui/dialog/dialog-content.svelte +1 -1
  126. package/dist/components/ui/dialog/dialog-content.svelte.d.ts +13 -8
  127. package/dist/components/ui/dialog/dialog-description.svelte.d.ts +14 -4
  128. package/dist/components/ui/dialog/dialog-footer.svelte.d.ts +14 -5
  129. package/dist/components/ui/dialog/dialog-header.svelte.d.ts +14 -5
  130. package/dist/components/ui/dialog/dialog-overlay.svelte.d.ts +14 -4
  131. package/dist/components/ui/dialog/dialog-title.svelte.d.ts +14 -4
  132. package/dist/components/ui/drawer/drawer-content.svelte.d.ts +13 -6
  133. package/dist/components/ui/drawer/drawer-description.svelte.d.ts +14 -4
  134. package/dist/components/ui/drawer/drawer-footer.svelte.d.ts +14 -5
  135. package/dist/components/ui/drawer/drawer-header.svelte.d.ts +14 -5
  136. package/dist/components/ui/drawer/drawer-nested.svelte.d.ts +14 -3
  137. package/dist/components/ui/drawer/drawer-overlay.svelte.d.ts +14 -4
  138. package/dist/components/ui/drawer/drawer-title.svelte.d.ts +14 -4
  139. package/dist/components/ui/drawer/drawer.svelte.d.ts +14 -3
  140. package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +1 -1
  141. package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +13 -7
  142. package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +1 -1
  143. package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +13 -6
  144. package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +13 -6
  145. package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +1 -1
  146. package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +13 -6
  147. package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +13 -7
  148. package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +1 -1
  149. package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +14 -4
  150. package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +14 -4
  151. package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +14 -5
  152. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +1 -1
  153. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +14 -4
  154. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +1 -1
  155. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +13 -6
  156. package/dist/components/ui/dropdown-menu/index.d.ts +1 -1
  157. package/dist/components/ui/hover-card/hover-card-content.svelte +1 -1
  158. package/dist/components/ui/hover-card/hover-card-content.svelte.d.ts +13 -6
  159. package/dist/components/ui/input/input.svelte +1 -1
  160. package/dist/components/ui/input/input.svelte.d.ts +14 -5
  161. package/dist/components/ui/input-otp/input-otp-group.svelte.d.ts +14 -5
  162. package/dist/components/ui/input-otp/input-otp-separator.svelte.d.ts +14 -5
  163. package/dist/components/ui/input-otp/input-otp-slot.svelte.d.ts +14 -12
  164. package/dist/components/ui/input-otp/input-otp.svelte +1 -1
  165. package/dist/components/ui/input-otp/input-otp.svelte.d.ts +14 -3
  166. package/dist/components/ui/label/label.svelte.d.ts +14 -4
  167. package/dist/components/ui/popover/popover-content.svelte +1 -1
  168. package/dist/components/ui/popover/popover-content.svelte.d.ts +13 -6
  169. package/dist/components/ui/progress/progress.svelte.d.ts +14 -4
  170. package/dist/components/ui/radio-group/radio-group-item.svelte +1 -1
  171. package/dist/components/ui/radio-group/radio-group-item.svelte.d.ts +14 -4
  172. package/dist/components/ui/radio-group/radio-group.svelte.d.ts +14 -4
  173. package/dist/components/ui/range-calendar/range-calendar-cell.svelte.d.ts +14 -4
  174. package/dist/components/ui/range-calendar/range-calendar-day.svelte +6 -6
  175. package/dist/components/ui/range-calendar/range-calendar-day.svelte.d.ts +14 -4
  176. package/dist/components/ui/range-calendar/range-calendar-grid-row.svelte.d.ts +14 -4
  177. package/dist/components/ui/range-calendar/range-calendar-grid.svelte.d.ts +14 -4
  178. package/dist/components/ui/range-calendar/range-calendar-head-cell.svelte.d.ts +14 -4
  179. package/dist/components/ui/range-calendar/range-calendar-header.svelte.d.ts +14 -4
  180. package/dist/components/ui/range-calendar/range-calendar-heading.svelte.d.ts +14 -4
  181. package/dist/components/ui/range-calendar/range-calendar-months.svelte.d.ts +14 -5
  182. package/dist/components/ui/range-calendar/range-calendar-next-button.svelte.d.ts +14 -4
  183. package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte.d.ts +14 -4
  184. package/dist/components/ui/range-calendar/range-calendar.svelte.d.ts +14 -5
  185. package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte.d.ts +14 -4
  186. package/dist/components/ui/scroll-area/scroll-area.svelte.d.ts +13 -8
  187. package/dist/components/ui/select/index.d.ts +1 -1
  188. package/dist/components/ui/select/select-content.svelte.d.ts +13 -6
  189. package/dist/components/ui/select/select-group-heading.svelte.d.ts +14 -4
  190. package/dist/components/ui/select/select-item.svelte +1 -1
  191. package/dist/components/ui/select/select-item.svelte.d.ts +14 -4
  192. package/dist/components/ui/select/select-scroll-down-button.svelte.d.ts +14 -4
  193. package/dist/components/ui/select/select-scroll-up-button.svelte.d.ts +14 -4
  194. package/dist/components/ui/select/select-separator.svelte.d.ts +14 -4
  195. package/dist/components/ui/select/select-trigger.svelte +1 -1
  196. package/dist/components/ui/select/select-trigger.svelte.d.ts +14 -4
  197. package/dist/components/ui/separator/separator.svelte.d.ts +14 -4
  198. package/dist/components/ui/slider/slider.svelte +1 -1
  199. package/dist/components/ui/slider/slider.svelte.d.ts +14 -4
  200. package/dist/components/ui/sonner/sonner.svelte.d.ts +14 -4
  201. package/dist/components/ui/switch/switch.svelte +1 -1
  202. package/dist/components/ui/switch/switch.svelte.d.ts +14 -4
  203. package/dist/components/ui/table/table-body.svelte.d.ts +14 -5
  204. package/dist/components/ui/table/table-caption.svelte.d.ts +14 -5
  205. package/dist/components/ui/table/table-cell.svelte.d.ts +14 -5
  206. package/dist/components/ui/table/table-footer.svelte.d.ts +14 -5
  207. package/dist/components/ui/table/table-head.svelte.d.ts +14 -5
  208. package/dist/components/ui/table/table-header.svelte.d.ts +14 -5
  209. package/dist/components/ui/table/table-row.svelte.d.ts +14 -5
  210. package/dist/components/ui/table/table.svelte.d.ts +14 -5
  211. package/dist/components/ui/tabs/index.d.ts +1 -1
  212. package/dist/components/ui/tabs/tabs-content.svelte +1 -1
  213. package/dist/components/ui/tabs/tabs-content.svelte.d.ts +14 -4
  214. package/dist/components/ui/tabs/tabs-list.svelte.d.ts +14 -4
  215. package/dist/components/ui/tabs/tabs-trigger.svelte +1 -1
  216. package/dist/components/ui/tabs/tabs-trigger.svelte.d.ts +14 -4
  217. package/dist/components/ui/textarea/textarea.svelte +1 -1
  218. package/dist/components/ui/textarea/textarea.svelte.d.ts +14 -5
  219. package/dist/components/ui/toggle/toggle.svelte +1 -1
  220. package/dist/components/ui/toggle/toggle.svelte.d.ts +15 -9
  221. package/dist/components/ui/toggle-group/toggle-group-item.svelte.d.ts +14 -6
  222. package/dist/components/ui/toggle-group/toggle-group.svelte.d.ts +14 -5
  223. package/dist/components/ui/tooltip/tooltip-content.svelte.d.ts +14 -4
  224. package/dist/components/widget-system/EditableWidget.svelte.d.ts +30 -42
  225. package/dist/components/widget-system/Moveable.svelte +62 -19
  226. package/dist/components/widget-system/Moveable.svelte.d.ts +37 -49
  227. package/dist/icons/Checked.svelte.d.ts +14 -18
  228. package/dist/icons/CheckerBoardBackground.svelte.d.ts +14 -3
  229. package/dist/icons/Close.svelte.d.ts +14 -18
  230. package/dist/icons/Exclamation.svelte.d.ts +19 -22
  231. package/dist/icons/FileBrowser.svelte.d.ts +14 -18
  232. package/dist/icons/LogoWidgetic.svelte +6 -17
  233. package/dist/icons/LogoWidgetic.svelte.d.ts +14 -18
  234. package/dist/icons/LogoWidgeticGreen.svelte +13 -0
  235. package/dist/icons/LogoWidgeticGreen.svelte.d.ts +16 -0
  236. package/dist/icons/LogoWidgeticType-old.svelte +13 -0
  237. package/dist/icons/LogoWidgeticType-old.svelte.d.ts +16 -0
  238. package/dist/icons/LogoWidgeticType-old.svg +4 -0
  239. package/dist/icons/LogoWidgeticType.svelte +18 -10
  240. package/dist/icons/LogoWidgeticType.svelte.d.ts +14 -18
  241. package/dist/icons/LogoWidgeticType.svg +10 -3
  242. package/dist/icons/OpacitySliderArrows.svelte.d.ts +14 -3
  243. package/dist/icons/TestIcon.svelte.d.ts +19 -22
  244. package/dist/icons/index.d.ts +3 -1
  245. package/dist/icons/index.js +3 -1
  246. package/dist/styles/fonts.css +39 -50
  247. package/dist/styles/global.css +45 -68
  248. package/package.json +36 -47
  249. package/tailwind.config.ts +6 -1
  250. package/dist/components/search-input/index2.d.ts +0 -14
  251. package/dist/components/shad-editor/README.md +0 -18
  252. package/dist/icons/eye-off.svg +0 -1
  253. package/dist/icons/eye.svg +0 -1
  254. /package/dist/icons/{checked.svg → Checked.svg} +0 -0
package/README.md CHANGED
@@ -1,163 +1,868 @@
1
- # Widgetic Design System (`@widgetic/design-system`)
2
-
3
- This is the official design system package for the Widgetic platform.
4
-
5
- Built with SvelteKit and Tailwind CSS (using shadcn-svelte components as a base), it provides reusable UI components, global styles, design tokens, icons, and fonts for building consistent interfaces across Widgetic projects.
6
-
7
- ## Features
8
-
9
- * **Styles:** Exports global CSS styles, including CSS variables for design tokens (colors, spacing, etc.) and utility classes based on Tailwind CSS v4.
10
- * **UI Components:** A library of Svelte components built upon [shadcn-svelte](https://shadcn-svelte.com/), providing elements like Buttons, Cards, Dialogs, Input fields, Accordions, etc. Includes both base shadcn components and custom Widgetic components.
11
- * **Icons:** Exports icons from [Lucide Svelte](https://lucide.dev/) and potentially [Tabler Icons](https://tabler-icons.io/), accessible via named imports.
12
- * **Fonts:** Includes specific font families used across the Widgetic platform. Font files themselves are exported, but consuming projects need to ensure they are loaded correctly (e.g., via CSS `@import` or `<link>`).
13
-
14
- ## Installation
15
-
16
- 1. **Install the package:**
17
- ```bash
18
- npm install @widgetic/design-system
19
- ```
20
-
21
- 2. **Install Peer Dependencies:** This package relies on several peer dependencies that you need to install in your project if you haven't already. Ensure your `package.json` includes compatible versions:
22
- ```json
23
- "devDependencies": {
24
- // Required by Tailwind v4 setup
25
- "postcss": "^8.x.x",
26
- "@tailwindcss/postcss": "^4.x.x",
27
- "tailwindcss": "^4.x.x",
28
- // Required by SvelteKit/Svelte 5
29
- "svelte": "^5.x.x",
30
- "@sveltejs/kit": "^2.x.x",
31
- // Required by shadcn-svelte components used internally
32
- "bits-ui": "^1.x.x",
33
- "clsx": "^2.x.x",
34
- "tailwind-merge": "^2.x.x",
35
- "tailwind-variants": "^0.x.x",
36
- "svelte-sonner": "^0.x.x",
37
- // Required by specific components if used
38
- "@internationalized/date": "^3.x.x",
39
- "lucide-svelte": "^0.x.x",
40
- "@tabler/icons-svelte": "^3.x.x",
41
- "vaul-svelte": "^1.x.x-next.x"
42
- // ... other project devDependencies
43
- }
44
- ```
45
- *Note: Replace `x.x` with appropriate version numbers compatible with the design system's requirements (check its `package.json` `peerDependencies` for specifics).* Make sure you have `postcss.config.js` (or `.mjs`) set up.
46
-
47
- ## Setup
48
-
49
- ### 1. Tailwind Configuration
50
-
51
- To ensure Tailwind processes the design system's classes and applies your project's customizations correctly, configure your project's `tailwind.config.ts` (or `.js`) to use the design system's configuration as a preset:
1
+ # Widgetic Design System
52
2
 
3
+ This is the design system package for the Widgetic platform.
4
+
5
+ It is built with SvelteKit and TailwindCSS and exports styles(with tailwind), ui components(with shadcn), icons and fonts for the entire platform.
6
+
7
+ ## Initial Setup (Required for Team Development)
8
+
9
+ After cloning the repository, run the install script which handles dependencies and Git configuration:
10
+
11
+ ```bash
12
+ npm run i
13
+ ```
14
+
15
+ This script installs dependencies, links the package, and automatically configures Git for proper case sensitivity. This prevents file case conflicts between different operating systems (macOS, Windows, Linux). **All team members should run this** when first working with the design system.
16
+
17
+ 0. Styles: it uses tailwindcss and exports global styles and design tokens that are imported in the project where the design system is imported:
18
+
19
+ ```svelte
20
+ <script>
21
+ import '@widgetic/design-system/styles';
22
+ </script>
23
+ ```
24
+
25
+ 0.1. To add new fonts:
26
+ - Add the font in the fonts folder.
27
+ - Add the font-face rule and the class in the fonts.css file and then the class can be used anywhere in the projects that import the design system's styles:
28
+ ```css
29
+ /* First font-face rule */
30
+ @font-face {
31
+ font-family: 'BL Melody';
32
+ src: url('@widgetic/design-system/fonts/BLMelody/BLMelody-ExtraLight.woff2') format('woff2');
33
+ font-weight: 200;
34
+ font-style: normal;
35
+ font-display: swap;
36
+ }
37
+
38
+ /* Second fonte class(can be any custom name) */
39
+ .font-bl-melody-extra-light {
40
+ font-family: 'BL Melody';
41
+ font-weight: 200;
42
+ }
43
+ ```
44
+
45
+ - Use the font-family in any class in the global.css file if needed like this:
46
+ ```css
47
+ .my-button-class {
48
+ /* other CSS properties */
49
+ background-color: red;
50
+
51
+ /* font-family properties here */
52
+ font-family: 'BL Melody', sans-serif;
53
+ font-weight: 200;
54
+ font-style: normal;
55
+ }
56
+ ```
57
+
58
+ 1.1. Components: It uses the SHADCN UI components for basic ui components and custom components for the Widgetic platform.
59
+
60
+ a. (Re)Install latest all shadcn components:
61
+
62
+ ```bash
63
+ npm run i-shadcn
64
+ ```
65
+
66
+ At prompt answer like this:
67
+ ```bash
68
+ Which style would you like to use?
69
+ │ Default
70
+ │
71
+ ◇ Which base color would you like to use?
72
+ │ Slate
73
+ │
74
+ ◇ Where is your global CSS file? (this file will be overwritten)
75
+ │ src/app.css (!!! add local project's css file as we don't want to overwrite our project's global styles)
76
+ │
77
+ ◇ Where is your Tailwind config located? (this file will be overwritten)
78
+ │ tailwind.config.ts
79
+ │
80
+ ◇ Configure the import alias for components:
81
+ │ $lib/components
82
+ │
83
+ ◆ Configure the import alias for utils:
84
+ │ $lib/utils
85
+ │
86
+ ◆ Configure the import alias for hooks:
87
+ │ $lib/hooks
88
+ │
89
+ ◆ Configure the import alias for ui:
90
+ │ $lib/components/ui
91
+
92
+
93
+ Components to install:
94
+ │ accordion, badge, button, calendar, range-calendar, card, checkbox, collapsible, dialog,
95
+ │ drawer, dropdown-menu, input, input-otp, label, popover, progress, radio-group, scroll-area,
96
+ │ select, separator, slider, switch, table, tabs, textarea, tooltip
97
+ │
98
+ ◆ Ready to install components and dependencies?
99
+ │ ● Yes / ○ No
100
+ ...
101
+ tooltip installed at src/lib/components/ui/tooltip
102
+ │
103
+ ◇ Dependencies installed with npm
104
+ │
105
+ ◇ Config file components.json updated
106
+ │
107
+ └ Success! Component installation completed.
108
+
109
+ !!! On commit the change uncheck the grouped components(Table, Select, etc.) baerel file.
110
+ ```
111
+
112
+ b. Installing the shadcn-svelte package:
113
+
114
+ ```bash
115
+ npx shadcn-svelte@next init
116
+ ```
117
+
118
+ c. Add one or more SHADCN UI components:
119
+
120
+ ```bash
121
+ npx shadcn-svelte@next add <component-name component-name2>
122
+ ```
123
+
124
+ d. Check tailwind.config.ts file to see if you didn't lose any of the project's config.
125
+
126
+ e. Check /src/lib/utils/utils.ts file to see if you didn't lose any of the project's utils.
127
+
128
+ f. Check /src/lib/hooks/hooks.ts file to see if you didn't lose any of the project's hooks.
129
+
130
+ g. Check SHADCN UI Grouped components(eg. Table or Select) barel file to export a constant with the subcomponents.
131
+ We do that just be wrapping the first part of the export statement with a constant named as the component ("Table" here) and replace the exported subcomponent: "Table" in this case with "TableRoot".
53
132
  ```ts
54
- // tailwind.config.ts
55
- import type { Config } from 'tailwindcss';
56
- import designSystemPreset from '@widgetic/design-system/tailwind.config'; // Import the preset
133
+ // src/lib/components/ui/table/index.ts
134
+ const Table = {
135
+ Root,
136
+ Body,
137
+ Caption,
138
+ Cell,
139
+ Footer,
140
+ Head,
141
+ Header,
142
+ Row
143
+ };
144
+
145
+ export {
146
+ Table, // add the constant name "Table" that will be the namespace for the grouped components
147
+ Root as TableRoot, // Change the name of the Root component from "Table" to "TableRoot"
148
+ Body as TableBody,
149
+ Caption as TableCaption,
150
+ Cell as TableCell,
151
+ Footer as TableFooter,
152
+ Head as TableHead,
153
+ Header as TableHeader,
154
+ Row as TableRow,
155
+ };
156
+ ```
157
+ Then you can import and use the namespace in the project:
158
+ ```svelte
159
+ import { Table } from '@widgetic/design-system';
160
+ ```
57
161
 
58
- const config = {
59
- // Use the design system preset
60
- presets: [designSystemPreset],
61
-
62
- // Add your project's paths AND the design system's path to the content array
63
- content: [
64
- './src/**/*.{html,js,svelte,ts}', // Your project files
65
- './node_modules/@widgetic/design-system/dist/**/*.{html,js,svelte,ts}' // Design system package files
66
- ],
67
-
68
- // You can optionally extend the theme further here
69
- theme: {
70
- extend: {
71
- // Your project-specific theme extensions
72
- }
73
- },
74
-
75
- plugins: [
76
- // Your project-specific plugins (if any)
162
+ h. If there is a component that looks compound but is not, add the @notCompound marker in the file:
163
+ ```ts
164
+ // @notCompound
165
+ export {
166
+ Root,
167
+ Scrollbar,
168
+ //,
169
+ Root as ScrollArea,
170
+ Scrollbar as ScrollAreaScrollbar,
171
+ };
172
+ ```
173
+ ScrollArea is not a compound component but it looks like one.
174
+
175
+ h. If you want to export only the main component and not the subcomponents, add the @noSubcomponents marker in the file:
176
+ ```ts
177
+ // @noSubcomponents
178
+ export {
179
+ Day,
180
+ Cell,
181
+ Grid,
182
+ Header,
183
+ Months,
184
+ GridRow,
185
+ Heading,
186
+ GridBody,
187
+ GridHead,
188
+ HeadCell,
189
+ NextButton,
190
+ PrevButton,
191
+ //
192
+ Root as RangeCalendar,
193
+ };
194
+ ```
195
+ RangeCalendar share the same subcomponents with Calendar so we don't want to export them.
196
+
197
+ 1.2. In general we should follow the shadcn-svelte approach to export the components with more subcomponents or compound components.
198
+
199
+ 2. Icons: It also uses the Lucide and Tabler icons or custom icons for the platform.
200
+
201
+ ```svelte
202
+ import { IconName } from '@widgetic/design-system/icons';
203
+ ```
204
+
205
+
206
+ 3. Fonts: The design system uses Google Fonts that we need to import in the project where the design system is imported.
207
+
208
+ ```svelte
209
+ import { FontName } from '@widgetic/design-system/fonts';
210
+ ```
211
+
212
+
213
+ ## Performance Optimization for Linked Design System
214
+
215
+ When using the linked design system in development mode, you may experience slow initial load times and delayed navigation. This is because Vite's default file watching behavior can create performance issues when working with linked packages.
216
+
217
+ ### Common Issues:
218
+ - Long initial loading time (>1 minute)
219
+ - "Pending" status on network requests when navigating between pages
220
+ - High CPU usage during development
221
+
222
+ ### Solution:
223
+
224
+ #### 1. For consuming projects (like site, context-chat, etc.):
225
+
226
+ Optimize your `vite.config.ts` with these settings:
227
+
228
+ ```ts
229
+ server: {
230
+ watch: {
231
+ // Don't use polling (which causes high CPU usage)
232
+ // Remove the following if present:
233
+ // usePolling: true,
234
+ // interval: 2000,
235
+ // binaryInterval: 2000,
236
+
237
+ // Ignore all node_modules EXCEPT the design system dist folder if needed
238
+ ignored: [
239
+ '**/node_modules/**',
240
+ '**/*.map',
241
+ '**/*.d.ts',
242
+ '**/*.log'
77
243
  ]
78
- } satisfies Config;
244
+ },
245
+ hmr: {
246
+ // Reduce timeout for faster updates
247
+ timeout: 2000
248
+ }
249
+ },
250
+ optimizeDeps: {
251
+ // Don't include the design system in optimizeDeps
252
+ // Remove this if present:
253
+ // include: ['@widgetic/design-system']
254
+
255
+ // Keep other settings
256
+ exclude: ['@sveltejs/kit']
257
+ },
258
+ build: {
259
+ // Add these for faster builds
260
+ sourcemap: false,
261
+ reportCompressedSize: false
262
+ }
263
+ ```
79
264
 
80
- export default config;
265
+ #### 2. For production deployments:
266
+
267
+ When deploying to production, you'll use the published npm package instead of the linked development version. No special configuration is needed beyond the optimizations above.
268
+
269
+ #### 3. Development vs. Production Mode:
270
+
271
+ The design system's `vite.config.ts` already includes development-specific optimizations. When publishing the package to npm, the built version will be used, and these configurations won't affect end users.
272
+
273
+ **Note:** These optimizations are only needed during development with linked packages and won't affect the published npm package performance.
274
+
275
+
276
+ ## How to link DS into another project and develop it(first time)
277
+
278
+ 0. Go into the DS project and link it in the system and start it with: `cd Frontend/design-system && npm link && npm run dev`
279
+
280
+ 1. Go into the consuming project and make sure you have installed tailwindcss and postcss by checking in package.json if it has these dependencies:
281
+
282
+ ```json
283
+ "dependencies": {
284
+ "tailwindcss": "^3.4.16",
285
+ "@tailwindcss/postcss": "^4.1.2",
286
+ }
81
287
  ```
82
288
 
83
- * **Presets:** The `presets` array applies the design system's base configuration (colors, fonts, plugins like `tailwindcss-animate`).
84
- * **Content:** It's crucial to include the path to the installed design system package (`./node_modules/@widgetic/design-system/dist/...`) in your `content` array. This allows Tailwind to scan the design system's components and generate the necessary utility classes.
289
+ Also make sure you have a 'tailwind.config.ts'(if there is a '.js' version rename it to '.ts') and a 'postcss.config.js' file.
290
+ (optional)If not already in the project follow the install guide at: https://tailwindcss.com/docs/installation/using-postcss.
291
+
292
+
293
+ 2. Also add these dependencies and overrides(that are needed for DS) with these exact versions into the package.json file of the consuming project:
294
+ ```json package.json
295
+ "dependencies": {
296
+ "@sveltejs/kit": "^2.20.2",
297
+ "svelte": "^5.25.6",
298
+ "@tabler/icons-svelte": "^3.24.0",
299
+ "lucide-svelte": "^0.468.0",
300
+ "bits-ui": "^1.3.0",
301
+ "svelte-sonner": "^0.3.28",
302
+
303
+ "tailwind-merge": "^2.5.2",
304
+ "tailwind-variants": "^0.2.1",
305
+ "tailwindcss-animate": "^1.0.7",
306
+ }
307
+
308
+ "overrides": {
309
+ "bits-ui": {
310
+ "@melt-ui/svelte": "^0.86.3"
311
+ },
312
+ "vaul-svelte": {
313
+ "bits-ui": {
314
+ "@melt-ui/svelte": "^0.86.3"
315
+ }
316
+ },
317
+ "svelte": "^5.25.6"
318
+ },
319
+ ```
320
+
321
+ Also keep the exact versions mentioned above and check and remove these dependencies from devDependencies or peerDependencies in the package.json of the consuming project.
322
+
323
+ 3. Also add this "i"(install) and "lds"(link) scripts into the package.json file exactly as following:
324
+ "i": "rm -rf node_modules && npm i && npm run lds",
325
+ "lds": "volta run npm link @widgetic/design-system",
326
+ Then run it with: `npm run i`
327
+
328
+ 4. Also add these "dev" scripts into the package.json file for usual start of the consuming project:
329
+ "dev": "npm run dev-sv -- --open",
330
+ "dev-sv": "NODE_ENV=development vite dev",
85
331
 
86
- ### 2. Global Styles
332
+ 5. Import DS config into the tailwind.config.ts file(of consuming project) and add it in the presets array:
333
+ ```ts
334
+ // tailwind.config.ts
335
+
336
+ import designSystemPreset from '@widgetic/design-system/tailwind.config';
337
+
338
+ const config = {
339
+ // add here the DS preset
340
+ presets: [
341
+ designSystemPreset
342
+ ],
343
+ // add here the '@widgetic/*/dist/...' to scan also the DS package files
344
+ content: [
345
+ "./src/**/*.{html,js,svelte,ts}",
346
+ // Include all @widgetic packages from node_modules(for development only) to be sure Tailwind scans all the files
347
+ "./node_modules/@widgetic/*/dist/**/*.{html,js,svelte,ts}"
348
+ ],
349
+ // the rest of the config properties
350
+ theme: {
351
+ extend: {
352
+ // current extend config...
353
+ }
354
+ }
355
+ };
87
356
 
88
- Import the design system's global CSS file into your main layout file (e.g., `src/routes/+layout.svelte`). This file includes base styles, CSS variables (design tokens), and imports necessary fonts.
357
+ export default config;
358
+ ```
359
+ Also make sure you remove the type of the config to avoid conflicts with the DS config.
360
+ Then leave the rest of the config as it is.
89
361
 
362
+ 6. Import styles and a test component from DS in the consuming project:
363
+ a. In the root layout of the project import the global styles:
90
364
  ```svelte
91
- <!-- src/routes/+layout.svelte -->
365
+ <!-- +layout.svelte -->
92
366
  <script>
93
- import '@widgetic/design-system/styles'; // Import global styles
94
-
95
- // Your layout script...
367
+ import '@widgetic/design-system/styles';
96
368
  </script>
369
+ ```
370
+ b. In the root page of the consuming project import any component(e.g. Button) and use it:
371
+ ```svelte
372
+ <!-- +page.svelte -->
373
+ <script>
374
+ import { Button } from '@widgetic/design-system/';
375
+ </script>
376
+
377
+ <!-- HTML zone -->
378
+ <Button>Click me</Button>
379
+ ```
380
+
381
+ 7. Finally: go into the in the consuming project's folder and start the development server with:
382
+ ```bash
383
+ npm run dev
384
+ ```
385
+
386
+ This automatically opens the http://localhost:5173 (default port) for the consuming project and you can see how DS components work in it.
387
+
388
+
97
389
 
98
- <slot />
390
+ ## Developing inside this project:
391
+
392
+ 1. Install dependencies with `npm install`
393
+
394
+ 2. Link the package in the system with npm:
395
+ ```bash
396
+ npm link
397
+ ```
398
+
399
+ 3. Start the development server with:
400
+ ```bash
401
+ npm run dev
402
+ ```
403
+
404
+ 3. Test the design system in action:
405
+ - In the root layout of the DS project there is a global styles import to test the design system's global styles.
406
+ - In the root page of the project there is a button component import to test the design system's components.
407
+
408
+ Open in new tab in browser with address: http://localhost:5173/ to see the design system in action.
409
+
410
+
411
+
412
+ ### Global Tailwind CSS and Design Tokens:
413
+
414
+ ```css
415
+ /* src/lib/styles/global.css */
416
+ @tailwind base;
417
+ @tailwind components;
418
+ @tailwind utilities;
419
+
420
+ /* CUSTOM GLOBAL STYLES */
421
+ /* ADD HERE CLASSES AND CSS VARIABLES that are used in the projects where the design system is imported */
422
+
423
+ /* Base styles */
424
+ @layer base {
425
+ :root {
426
+ /* Design tokens */
427
+ --color-primary: 30 158 210; /* RGB values for easier theming */
428
+ --color-secondary: 46 204 113;
429
+ --radius: 0.5rem;
430
+ }
431
+
432
+ /* Dark mode tokens */
433
+ .dark {
434
+ --color-primary: 100 200 255;
435
+ --color-secondary: 100 255 150;
436
+ }
437
+ }
438
+
439
+ /* Reusable component classes */
440
+ @layer components {
441
+ .btn-primary {
442
+ @apply bg-[rgb(var(--color-primary))] text-white rounded-[var(--radius)];
443
+ }
444
+
445
+ .card {
446
+ @apply shadow-md rounded-lg p-4 bg-white dark:bg-gray-800;
447
+ }
448
+ }
449
+
450
+ /* Custom utility classes */
451
+ @layer utilities {
452
+ .text-balance {
453
+ text-wrap: balance;
454
+ }
455
+ }
99
456
  ```
100
457
 
101
- ## Usage
458
+ 2. In the project where the design system is imported:
459
+ - Import the global styles in the +layout.svelte file:
460
+ ```svelte
461
+ <script>
462
+ import '@widgetic/design-system/styles';
463
+ </script>
464
+ ```
102
465
 
103
- ### Components
104
466
 
105
- Import components directly from the package:
467
+ ### Create a Custom Shared Component in the Design System project using a SHADCN UI component and classes from the global styles:
106
468
 
469
+ src/lib/components/MyButton.svelte:
107
470
  ```svelte
108
471
  <script>
109
- import { Button, Card, CardHeader, CardTitle, CardContent } from '@widgetic/design-system';
110
- // For grouped components (like Table, Accordion), use the namespace
111
- import { Table } from '@widgetic/design-system';
472
+ // Import Button from the SHADCN UI components
473
+ import { Button } from './components/ui';
112
474
  </script>
113
475
 
114
- <Button>Click Me</Button>
476
+ <MyButton
477
+ {type}
478
+ class="btn-primary"
479
+ on:click
480
+ >
481
+ <slot />
482
+ </MyButton>
483
+ ```
484
+ Then export the component in the "src/lib/components/index.ts" file:
485
+ ```ts
486
+ export {default as MyButton } from './components/MyButton.svelte';
487
+ ```
488
+
489
+
490
+ ## Deployment of Design System
491
+
492
+ To deploy the design system, run the following command:
493
+ ```bash
494
+ npm run prepublishOnly
495
+ ```
496
+ This will create a `dist` folder with the production build of the design system.
497
+
498
+ To publish the design system to the npm registry, run the following command:
499
+ ```bash
500
+ npm run publish-package
501
+ ```
502
+
503
+ ## Grid System
504
+
505
+ The design system implements three distinct responsive grid layouts:
506
+
507
+ 1. Site Grid
508
+ 2. Dashboard Grid
509
+ 3. App Grid
510
+
511
+ ### Grid Breakpoints
512
+ - Desktop: > 744px
513
+ - Tablet: 393px - 744px
514
+ - Mobile: ≤ 393px
515
+
516
+ ### 1. Site Grid
517
+
518
+ **Desktop (>744px)**
519
+ - 12 columns
520
+ - 144px margins
521
+ - 24px gutters
522
+ - Stretching columns with auto width
523
+
524
+ **Tablet (≤744px)**
525
+ - 8 columns
526
+ - 32px margins
527
+ - 16px gutters
528
+ - Stretching columns with auto width
529
+
530
+ **Mobile (≤393px)**
531
+ - 4 columns
532
+ - 16px margins
533
+ - 16px gutters
534
+ - Stretching columns with auto width
535
+
536
+ ### 2. Dashboard Grid
537
+
538
+ **Desktop (>744px)**
539
+ - Header: 12 columns, 24px margins, 20px gutters
540
+ - Sidebar: 240px fixed width
541
+ - Main Content: 12 columns, 24px margins, 20px gutters
542
+ - 56px header height
115
543
 
116
- <Card.Root>
117
- <Card.Header>
118
- <Card.Title>Card Title</Card.Title>
119
- </Card.Header>
120
- <Card.Content>
121
- <p>Card body content...</p>
122
- </Card.Content>
123
- </Card.Root>
544
+ **Tablet (≤744px)**
545
+ - Header: 8 columns
546
+ - Sidebar: 200px fixed width
547
+ - Main Content: 8 columns
548
+ - 16px margins and gutters
549
+
550
+ **Mobile (≤393px)**
551
+ - Header: 4 columns
552
+ - Sidebar replaced with menu component
553
+ - Main Content: 4 columns
554
+ - 16px margins and gutters
555
+
556
+ ### 3. App Grid
557
+
558
+ **Desktop (>744px)**
559
+ - Header: 12 columns, 24px margins, 20px gutters
560
+ - Main Content: 12 columns, 144px margins, 20px gutters
561
+ - 56px header height
562
+
563
+ **Tablet (≤744px)**
564
+ - Header: 8 columns
565
+ - Main Content: 8 columns, 32px margins
566
+ - 16px gutters
567
+
568
+ **Mobile (≤393px)**
569
+ - Header: 4 columns
570
+ - Menu component added below header
571
+ - Main Content: 4 columns
572
+ - 16px margins and gutters
573
+
574
+ ### Usage Example
575
+
576
+ ```svelte
577
+ <!-- Site Grid -->
578
+ <div class="site-grid">
579
+ <div class="grid-margin-left"></div>
580
+ <header class="grid-header">Header Content</header>
581
+ <main class="grid-main">Main Content</main>
582
+ <footer class="grid-footer">Footer Content</footer>
583
+ <div class="grid-margin-right"></div>
584
+ </div>
585
+
586
+ <!-- Dashboard Grid -->
587
+ <div class="dashboard-grid">
588
+ <div class="grid-margin-left"></div>
589
+ <header class="dashboard-header-grid">
590
+ <!-- Header content with 12/8/4 columns based on viewport -->
591
+ </header>
592
+ <nav class="grid-sidebar">
593
+ <!-- Sidebar content (hidden on mobile) -->
594
+ </nav>
595
+ <main class="dashboard-main-grid">
596
+ <!-- Main content with 12/8/4 columns based on viewport -->
597
+ </main>
598
+ <div class="grid-margin-right"></div>
599
+ <!-- Mobile menu appears automatically on small screens -->
600
+ <div class="grid-menu">
601
+ <!-- Mobile menu content -->
602
+ </div>
603
+ </div>
604
+
605
+ <!-- App Grid -->
606
+ <div class="app-grid">
607
+ <div class="grid-margin-left"></div>
608
+ <header class="app-header-grid">
609
+ <!-- Header content with 12/8/4 columns based on viewport -->
610
+ </header>
611
+ <main class="app-main-grid">
612
+ <!-- Main content with 12/8/4 columns based on viewport -->
613
+ </main>
614
+ <div class="grid-margin-right"></div>
615
+ <!-- Mobile menu appears automatically on small screens -->
616
+ <div class="grid-menu">
617
+ <!-- Mobile menu content -->
618
+ </div>
619
+ </div>
620
+ ```
124
621
 
125
- <Table.Root>
126
- <Table.Header>
127
- <Table.Row>
128
- <Table.Head>Header 1</Table.Head>
129
- </Table.Row>
130
- </Table.Header>
131
- <Table.Body>
132
- <Table.Row>
133
- <Table.Cell>Cell 1</Table.Cell>
134
- </Table.Row>
135
- </Table.Body>
136
- </Table.Root>
622
+ ### Grid Area Classes
623
+ The following classes are available to position elements within the grid:
624
+ ```css
625
+ .grid-header /* Header area */
626
+ .grid-main /* Main content area */
627
+ .grid-sidebar /* Sidebar area (dashboard only) */
628
+ .grid-footer /* Footer area (site only) */
629
+ .grid-toolbar /* Toolbar area (app only) */
630
+ .grid-margin-left /* Left margin area */
631
+ .grid-margin-right/* Right margin area */
632
+ .grid-menu /* Mobile menu area */
633
+ .grid-gap /* Gap area (dashboard only) */
137
634
  ```
138
635
 
139
- Refer to the specific component documentation or source code for available props and variants.
636
+ The grid system is designed to maintain consistent spacing and layout across different viewport sizes while adapting to the specific needs of each layout type (site, dashboard, and app).
140
637
 
141
- ### Icons
638
+ ## DeleteConfirmation Component
142
639
 
143
- Import required icons by name:
640
+ The `DeleteConfirmation` component is a reusable confirmation dialog that can be used across different parts of the project for confirming deletion actions.
641
+
642
+ ### Features
643
+
644
+ - Independent of any specific store or state management system
645
+ - Customizable title, message, and button labels
646
+ - Works with any type of items to be deleted
647
+ - Dispatches events for both confirmation and cancellation
648
+
649
+ ### Usage
144
650
 
145
651
  ```svelte
146
652
  <script>
147
- import { ChevronUp, IconSettings } from '@widgetic/design-system/icons'; // Example names
653
+ import { DeleteConfirmation } from '@widgetic/design-system/components';
654
+
655
+ let showDeleteConfirmation = false;
656
+ let itemsToDelete = [
657
+ { id: '1', name: 'Document.pdf', type: 'file' },
658
+ { id: '2', name: 'Images', type: 'folder' }
659
+ ];
660
+
661
+ function handleDelete(event) {
662
+ const deletedItems = event.detail.items;
663
+ console.log('Items to delete:', deletedItems);
664
+ // Perform deletion logic here
665
+ }
666
+
667
+ function handleCancel() {
668
+ showDeleteConfirmation = false;
669
+ console.log('Deletion cancelled');
670
+ }
148
671
  </script>
149
672
 
150
- <button>
151
- <ChevronUp class="size-4" /> Settings <IconSettings class="size-4" />
673
+ <button on:click={() => showDeleteConfirmation = true}>
674
+ Delete Items
152
675
  </button>
676
+
677
+ <DeleteConfirmation
678
+ bind:isOpen={showDeleteConfirmation}
679
+ items={itemsToDelete}
680
+ modalId="my-delete-confirmation"
681
+ on:delete={handleDelete}
682
+ on:cancel={handleCancel}
683
+ />
153
684
  ```
154
685
 
155
- ### Fonts & Typography
686
+ ### Props
687
+
688
+ | Prop | Type | Default | Description |
689
+ |------|------|---------|-------------|
690
+ | `isOpen` | boolean | `false` | Controls the visibility of the modal |
691
+ | `items` | array | `[]` | Array of items to be deleted |
692
+ | `title` | string | `''` | Custom title for the modal (autogenerated if empty) |
693
+ | `message` | string | `''` | Custom message for the modal (autogenerated if empty) |
694
+ | `confirmLabel` | string | `'Confirm'` | Label for the confirm button |
695
+ | `cancelLabel` | string | `'Cancel'` | Label for the cancel button |
696
+ | `width` | string | `'410px'` | Width of the modal |
697
+ | `height` | string | `'168px'` | Height of the modal |
698
+ | `modalId` | string | `'delete-confirmation-modal'` | ID for targeting the modal |
156
699
 
157
- The global styles load the necessary `@font-face` rules. You can apply typography using standard Tailwind utility classes (e.g., `text-lg`, `font-semibold`) or the custom typography utility classes exported by the design system (defined in `fonts.css`, like `h1`, `body-medium`, `subtext`).
700
+ ### Events
701
+
702
+ - `delete` - Dispatched when the user confirms deletion, with `items` in the event detail
703
+ - `cancel` - Dispatched when the user cancels deletion
704
+
705
+ ### Custom Title and Message Example
706
+
707
+ You can provide custom title and message for specific contexts:
158
708
 
159
709
  ```svelte
160
- <h1 class="h1">Main Title</h1>
161
- <p class="body-medium">This is body text.</p>
162
- <span class="subtext">Some smaller text.</span>
163
- ```
710
+ <script>
711
+ import { DeleteConfirmation } from '@widgetic/design-system/components';
712
+
713
+ let showDeleteConfirmation = false;
714
+ let selectedItems = [
715
+ { id: '1', name: 'Document.pdf', type: 'file' },
716
+ { id: '2', name: 'Images', type: 'folder' }
717
+ ];
718
+
719
+ function handleDelete(event) {
720
+ const deletedItems = event.detail.items;
721
+ console.log('Items to delete:', deletedItems);
722
+ // Perform deletion logic here
723
+ }
724
+
725
+ function handleCancel() {
726
+ showDeleteConfirmation = false;
727
+ console.log('Deletion cancelled');
728
+ }
729
+ </script>
730
+
731
+ <DeleteConfirmation
732
+ bind:isOpen={showDeleteConfirmation}
733
+ items={selectedItems}
734
+ title="Delete Assets"
735
+ message="These assets will be permanently deleted. This action cannot be undone."
736
+ confirmLabel="Delete Permanently"
737
+ on:delete={handleDelete}
738
+ on:cancel={handleCancel}
739
+ />
740
+ ```
741
+
742
+
743
+ ## Troubleshooting
744
+
745
+ ### File Case Sensitivity Issues (macOS/Windows Teams)
746
+
747
+ **Problem:** Component imports break inconsistently across team members, with errors like:
748
+ - `Cannot resolve module './checked.svelte'` vs `'./Checked.svelte'`
749
+ - Barrel file exports pointing to wrong case filenames
750
+ - One developer's changes cause import errors for others
751
+
752
+ **Root Cause:** Different operating systems handle file case differently:
753
+ - **macOS/Windows:** Case-insensitive but case-preserving file systems
754
+ - **Linux:** Case-sensitive file system
755
+ - **Git:** May not properly sync case-only file renames between different systems
756
+
757
+ **Solutions:**
758
+
759
+ 1. **Quick Setup (Recommended):** Run the install script which includes Git configuration:
760
+ ```bash
761
+ npm run i # Installs dependencies and configures Git automatically
762
+ ```
763
+
764
+ 2. **Git Only:** If you just need to configure Git case sensitivity:
765
+ ```bash
766
+ npm run set-git
767
+ ```
768
+
769
+ 3. **Manual Setup:** Configure Git to be case-sensitive in your local repository:
770
+ ```bash
771
+ git config core.ignorecase false
772
+ ```
773
+
774
+ 4. **Team Setup:** After the above configuration, if you encounter existing case conflicts:
775
+ ```bash
776
+ git pull # Get latest changes
777
+ npm run dev # Auto-fixes any remaining case issues via Vite plugin
778
+ ```
779
+
780
+ **Prevention:**
781
+ - All team members should run `npm run i` when first working with the design system
782
+ - Always use PascalCase for `.svelte` component files (e.g., `MyComponent.svelte`)
783
+ - The development server automatically renames files to follow PascalCase convention
784
+
785
+ ### Cursor IDE: TypeScript Parser Not Recognizing Svelte Files
786
+
787
+ **Problem:** After updating Cursor IDE, you may see TypeScript parsing errors in `.svelte` files that use design system components, such as:
788
+ - `Cannot find name 'script'`
789
+ - `'>': expected`
790
+ - `Cannot find name 'lang'`
791
+ - Other syntax errors in valid Svelte code
792
+
793
+ **Root Cause:** Mixed tabs and spaces in the file can confuse the TypeScript parser, preventing it from properly recognizing the file as a Svelte component. This issue commonly occurs after Cursor IDE updates.
794
+
795
+ **Solution:**
796
+ 1. Select the file showing the error
797
+ 2. In the bottom-right corner of Cursor IDE, click the "TypeScript" box
798
+ 3. When you hover over it, it shows "Select Language Mode"
799
+ 4. Select **"Svelte"** from the dropdown
800
+ 5. The file should now be parsed correctly as a Svelte component
801
+
802
+ **Prevention:** Ensure your project has proper Svelte language support configured:
803
+ - Install the Svelte extension for Cursor/VS Code
804
+ - Check that `svelte.config.js` is properly configured
805
+ - Ensure consistent indentation (spaces vs tabs) in your `.svelte` files
806
+
807
+ ### Design System Import Errors
808
+
809
+ **Problem:** Cannot import components or getting module resolution errors.
810
+
811
+ **Solutions:**
812
+ 1. **Check peer dependencies:** Ensure all required peer dependencies are installed with compatible versions
813
+ 2. **Restart development server:** After installing the design system or updating dependencies
814
+ 3. **Clear caches:** Run your project's cache clearing commands (e.g., `npm run clean-svelte-cache`)
815
+ 4. **Verify Tailwind config:** Ensure the design system preset is properly imported in your `tailwind.config.ts`
816
+
817
+ ### Styling Issues
818
+
819
+ **Problem:** Components appear unstyled or with incorrect styling.
820
+
821
+ **Solutions:**
822
+ 1. **Import global styles:** Ensure you've imported `@widgetic/design-system/styles/global.css` in your root layout
823
+ 2. **Check Tailwind setup:** Verify your `tailwind.config.ts` includes the design system preset
824
+ 3. **PostCSS configuration:** Ensure `postcss.config.js` is set up for Tailwind v4
825
+ 4. **Content paths:** Make sure your Tailwind config includes the design system in content paths:
826
+ ```js
827
+ content: [
828
+ "./src/**/*.{html,js,svelte,ts}",
829
+ "./node_modules/@widgetic/*/dist/**/*.{html,js,svelte,ts}"
830
+ ]
831
+ ```
832
+
833
+ ### Version Compatibility Issues
834
+
835
+ **Problem:** Getting errors after updating Svelte, SvelteKit, or other dependencies.
836
+
837
+ **Solutions:**
838
+ 1. **Check compatibility:** Ensure your project's Svelte/SvelteKit versions are compatible with the design system
839
+ 2. **Update together:** Consider updating both the design system and your project dependencies together
840
+ 3. **Check breaking changes:** Review changelogs for any breaking changes
841
+ 4. **Use exact versions:** For critical projects, consider pinning exact versions instead of ranges
842
+
843
+ ### Performance Issues
844
+
845
+ **Problem:** Slow build times or large bundle sizes.
846
+
847
+ **Solutions:**
848
+ 1. **Tree shaking:** Import only the components you need:
849
+ ```js
850
+ // Good: Import specific components
851
+ import { Button } from '@widgetic/design-system/components';
852
+
853
+ // Avoid: Importing everything
854
+ import * as DS from '@widgetic/design-system';
855
+ ```
856
+ 2. **Check Tailwind purging:** Ensure Tailwind is properly purging unused styles
857
+ 3. **Optimize imports:** Use direct imports when possible to improve tree shaking
858
+
859
+ ### Getting Help
860
+
861
+ If you continue to experience issues:
862
+ 1. Check the latest documentation in this README
863
+ 2. Review the `__docs/how-to-link-ds.md` guide for setup instructions
864
+ 3. Check for updates to the design system package
865
+ 4. Report persistent issues to the development team with:
866
+ - Your project's `package.json` dependencies
867
+ - Complete error messages
868
+ - Steps to reproduce the issue