@widgetic/design-system 0.3.68
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.
- package/README.md +730 -0
- package/dist/components/CopyableHeader.svelte +456 -0
- package/dist/components/CopyableHeader.svelte.d.ts +40 -0
- package/dist/components/EmptyState.svelte +145 -0
- package/dist/components/EmptyState.svelte.d.ts +36 -0
- package/dist/components/PasswordInput.svelte +46 -0
- package/dist/components/PasswordInput.svelte.d.ts +26 -0
- package/dist/components/ThumbHashImage.svelte +124 -0
- package/dist/components/ThumbHashImage.svelte.d.ts +26 -0
- package/dist/components/WScrollArea.svelte +47 -0
- package/dist/components/WScrollArea.svelte.d.ts +38 -0
- package/dist/components/debug-grid/DebugGrid.svelte +207 -0
- package/dist/components/debug-grid/DebugGrid.svelte.d.ts +32 -0
- package/dist/components/ic/browser/BrowserInputController.svelte +481 -0
- package/dist/components/ic/browser/BrowserInputController.svelte.d.ts +34 -0
- package/dist/components/ic/browser/icons/audio.svg +7 -0
- package/dist/components/ic/browser/icons/document.svg +11 -0
- package/dist/components/ic/browser/icons/error.svg +5 -0
- package/dist/components/ic/browser/icons/folder.svg +28 -0
- package/dist/components/ic/browser/icons/info-icon.svg +3 -0
- package/dist/components/ic/browser/icons/player-pause.svg +12 -0
- package/dist/components/ic/browser/icons/player-play.svg +1 -0
- package/dist/components/ic/types.d.ts +14 -0
- package/dist/components/ic/types.js +18 -0
- package/dist/components/index.d.ts +51 -0
- package/dist/components/index.js +52 -0
- package/dist/components/modals/ActionModal.svelte +189 -0
- package/dist/components/modals/ActionModal.svelte.d.ts +49 -0
- package/dist/components/modals/BaseModal.svelte +409 -0
- package/dist/components/modals/BaseModal.svelte.d.ts +38 -0
- package/dist/components/modals/NewItemDialog.svelte +189 -0
- package/dist/components/modals/NewItemDialog.svelte.d.ts +39 -0
- package/dist/components/modals/Portal.svelte +104 -0
- package/dist/components/modals/Portal.svelte.d.ts +34 -0
- package/dist/components/modals/README.md +99 -0
- package/dist/components/modals/RenameDialog.svelte +316 -0
- package/dist/components/modals/RenameDialog.svelte.d.ts +39 -0
- package/dist/components/modals/modalStore.d.ts +10 -0
- package/dist/components/modals/modalStore.js +45 -0
- package/dist/components/navigation/Breadcrumbs.svelte +348 -0
- package/dist/components/navigation/Breadcrumbs.svelte.d.ts +35 -0
- package/dist/components/navigation/index.d.ts +2 -0
- package/dist/components/navigation/index.js +2 -0
- package/dist/components/navigation/types.d.ts +12 -0
- package/dist/components/navigation/types.js +1 -0
- package/dist/components/pdf/PDFViewer.svelte +608 -0
- package/dist/components/pdf/PDFViewer.svelte.d.ts +32 -0
- package/dist/components/search-input/SearchInput.svelte +115 -0
- package/dist/components/search-input/SearchInput.svelte.d.ts +46 -0
- package/dist/components/search-input/index.d.ts +14 -0
- package/dist/components/search-input/index.js +4 -0
- package/dist/components/shad-editor/colorpicker.svelte +17 -0
- package/dist/components/shad-editor/colorpicker.svelte.d.ts +6 -0
- package/dist/components/shad-editor/custom/Extentions/ColorHighlighter.d.ts +2 -0
- package/dist/components/shad-editor/custom/Extentions/ColorHighlighter.js +25 -0
- package/dist/components/shad-editor/custom/Extentions/ImageExtention.d.ts +1 -0
- package/dist/components/shad-editor/custom/Extentions/ImageExtention.js +30 -0
- package/dist/components/shad-editor/custom/Extentions/SearchAndReplace.d.ts +57 -0
- package/dist/components/shad-editor/custom/Extentions/SearchAndReplace.js +232 -0
- package/dist/components/shad-editor/custom/Extentions/SmilieReplacer.d.ts +2 -0
- package/dist/components/shad-editor/custom/Extentions/SmilieReplacer.js +131 -0
- package/dist/components/shad-editor/custom/code-extended.svelte +78 -0
- package/dist/components/shad-editor/custom/code-extended.svelte.d.ts +4 -0
- package/dist/components/shad-editor/custom/image-extended-component.svelte +251 -0
- package/dist/components/shad-editor/custom/image-extended-component.svelte.d.ts +4 -0
- package/dist/components/shad-editor/custom/utils.d.ts +5 -0
- package/dist/components/shad-editor/custom/utils.js +35 -0
- package/dist/components/shad-editor/editor-toolbar.svelte +59 -0
- package/dist/components/shad-editor/editor-toolbar.svelte.d.ts +8 -0
- package/dist/components/shad-editor/editor.css +179 -0
- package/dist/components/shad-editor/icons/block-quote.svelte +26 -0
- package/dist/components/shad-editor/icons/block-quote.svelte.d.ts +7 -0
- package/dist/components/shad-editor/icons/bold.svelte +26 -0
- package/dist/components/shad-editor/icons/bold.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/buttle-list.svelte +27 -0
- package/dist/components/shad-editor/icons/buttle-list.svelte.d.ts +7 -0
- package/dist/components/shad-editor/icons/code.svelte +27 -0
- package/dist/components/shad-editor/icons/code.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/highlighter.svelte +75 -0
- package/dist/components/shad-editor/icons/highlighter.svelte.d.ts +9 -0
- package/dist/components/shad-editor/icons/image.svelte +73 -0
- package/dist/components/shad-editor/icons/image.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/index.d.ts +22 -0
- package/dist/components/shad-editor/icons/index.js +24 -0
- package/dist/components/shad-editor/icons/italic.svelte +26 -0
- package/dist/components/shad-editor/icons/italic.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/link.svelte +72 -0
- package/dist/components/shad-editor/icons/link.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/ordered-list.svelte +26 -0
- package/dist/components/shad-editor/icons/ordered-list.svelte.d.ts +7 -0
- package/dist/components/shad-editor/icons/quickcolor.svelte +95 -0
- package/dist/components/shad-editor/icons/quickcolor.svelte.d.ts +7 -0
- package/dist/components/shad-editor/icons/redo.svelte +26 -0
- package/dist/components/shad-editor/icons/redo.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/search-replace.svelte +146 -0
- package/dist/components/shad-editor/icons/search-replace.svelte.d.ts +7 -0
- package/dist/components/shad-editor/icons/strikethrough.svelte +26 -0
- package/dist/components/shad-editor/icons/strikethrough.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/subscript.svelte +26 -0
- package/dist/components/shad-editor/icons/subscript.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/superscript.svelte +26 -0
- package/dist/components/shad-editor/icons/superscript.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/table.svelte +111 -0
- package/dist/components/shad-editor/icons/table.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/task-list.svelte +26 -0
- package/dist/components/shad-editor/icons/task-list.svelte.d.ts +7 -0
- package/dist/components/shad-editor/icons/text.svelte +95 -0
- package/dist/components/shad-editor/icons/text.svelte.d.ts +7 -0
- package/dist/components/shad-editor/icons/textalign.svelte +82 -0
- package/dist/components/shad-editor/icons/textalign.svelte.d.ts +7 -0
- package/dist/components/shad-editor/icons/textcolor.svelte +75 -0
- package/dist/components/shad-editor/icons/textcolor.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/underline.svelte +26 -0
- package/dist/components/shad-editor/icons/underline.svelte.d.ts +8 -0
- package/dist/components/shad-editor/icons/undo.svelte +26 -0
- package/dist/components/shad-editor/icons/undo.svelte.d.ts +8 -0
- package/dist/components/shad-editor/index.d.ts +4 -0
- package/dist/components/shad-editor/index.js +5 -0
- package/dist/components/shad-editor/onedark.css +87 -0
- package/dist/components/shad-editor/shad-editor.svelte +153 -0
- package/dist/components/shad-editor/shad-editor.svelte.d.ts +34 -0
- package/dist/components/toast/ToasterModal.svelte +128 -0
- package/dist/components/toast/ToasterModal.svelte.d.ts +30 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +2 -0
- package/dist/components/ui/accordion/accordion-content.svelte +24 -0
- package/dist/components/ui/accordion/accordion-content.svelte.d.ts +4 -0
- package/dist/components/ui/accordion/accordion-item.svelte +12 -0
- package/dist/components/ui/accordion/accordion-item.svelte.d.ts +4 -0
- package/dist/components/ui/accordion/accordion-trigger.svelte +29 -0
- package/dist/components/ui/accordion/accordion-trigger.svelte.d.ts +7 -0
- package/dist/components/ui/accordion/index.d.ts +6 -0
- package/dist/components/ui/accordion/index.js +6 -0
- package/dist/components/ui/alert/alert-description.svelte +13 -0
- package/dist/components/ui/alert/alert-description.svelte.d.ts +28 -0
- package/dist/components/ui/alert/alert-title.svelte +21 -0
- package/dist/components/ui/alert/alert-title.svelte.d.ts +31 -0
- package/dist/components/ui/alert/alert.svelte +17 -0
- package/dist/components/ui/alert/alert.svelte.d.ts +31 -0
- package/dist/components/ui/alert/index.d.ts +43 -0
- package/dist/components/ui/alert/index.js +19 -0
- package/dist/components/ui/badge/badge.svelte +50 -0
- package/dist/components/ui/badge/badge.svelte.d.ts +60 -0
- package/dist/components/ui/badge/index.d.ts +2 -0
- package/dist/components/ui/badge/index.js +2 -0
- package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +23 -0
- package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte.d.ts +5 -0
- package/dist/components/ui/breadcrumb/breadcrumb-item.svelte +16 -0
- package/dist/components/ui/breadcrumb/breadcrumb-item.svelte.d.ts +5 -0
- package/dist/components/ui/breadcrumb/breadcrumb-link.svelte +31 -0
- package/dist/components/ui/breadcrumb/breadcrumb-link.svelte.d.ts +11 -0
- package/dist/components/ui/breadcrumb/breadcrumb-list.svelte +23 -0
- package/dist/components/ui/breadcrumb/breadcrumb-list.svelte.d.ts +5 -0
- package/dist/components/ui/breadcrumb/breadcrumb-page.svelte +23 -0
- package/dist/components/ui/breadcrumb/breadcrumb-page.svelte.d.ts +5 -0
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +27 -0
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte.d.ts +5 -0
- package/dist/components/ui/breadcrumb/breadcrumb.svelte +15 -0
- package/dist/components/ui/breadcrumb/breadcrumb.svelte.d.ts +5 -0
- package/dist/components/ui/breadcrumb/index.d.ts +8 -0
- package/dist/components/ui/breadcrumb/index.js +10 -0
- package/dist/components/ui/button/button.svelte +74 -0
- package/dist/components/ui/button/button.svelte.d.ts +118 -0
- package/dist/components/ui/button/index.d.ts +2 -0
- package/dist/components/ui/button/index.js +4 -0
- package/dist/components/ui/calendar/calendar-cell.svelte +19 -0
- package/dist/components/ui/calendar/calendar-cell.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar-day.svelte +30 -0
- package/dist/components/ui/calendar/calendar-day.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar-grid-body.svelte +12 -0
- package/dist/components/ui/calendar/calendar-grid-body.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar-grid-head.svelte +12 -0
- package/dist/components/ui/calendar/calendar-grid-head.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar-grid-row.svelte +12 -0
- package/dist/components/ui/calendar/calendar-grid-row.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar-grid.svelte +16 -0
- package/dist/components/ui/calendar/calendar-grid.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar-head-cell.svelte +16 -0
- package/dist/components/ui/calendar/calendar-head-cell.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar-header.svelte +16 -0
- package/dist/components/ui/calendar/calendar-header.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar-heading.svelte +12 -0
- package/dist/components/ui/calendar/calendar-heading.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar-months.svelte +20 -0
- package/dist/components/ui/calendar/calendar-months.svelte.d.ts +5 -0
- package/dist/components/ui/calendar/calendar-next-button.svelte +28 -0
- package/dist/components/ui/calendar/calendar-next-button.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar-prev-button.svelte +28 -0
- package/dist/components/ui/calendar/calendar-prev-button.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar.svelte +61 -0
- package/dist/components/ui/calendar/calendar.svelte.d.ts +5 -0
- package/dist/components/ui/calendar/index.d.ts +14 -0
- package/dist/components/ui/calendar/index.js +16 -0
- package/dist/components/ui/card/card-content.svelte +16 -0
- package/dist/components/ui/card/card-content.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-description.svelte +16 -0
- package/dist/components/ui/card/card-description.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-footer.svelte +16 -0
- package/dist/components/ui/card/card-footer.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-header.svelte +16 -0
- package/dist/components/ui/card/card-header.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-title.svelte +25 -0
- package/dist/components/ui/card/card-title.svelte.d.ts +8 -0
- package/dist/components/ui/card/card.svelte +20 -0
- package/dist/components/ui/card/card.svelte.d.ts +5 -0
- package/dist/components/ui/card/index.d.ts +7 -0
- package/dist/components/ui/card/index.js +7 -0
- package/dist/components/ui/checkbox/checkbox.svelte +35 -0
- package/dist/components/ui/checkbox/checkbox.svelte.d.ts +4 -0
- package/dist/components/ui/checkbox/index.d.ts +2 -0
- package/dist/components/ui/checkbox/index.js +4 -0
- package/dist/components/ui/collapsible/index.d.ts +16 -0
- package/dist/components/ui/collapsible/index.js +7 -0
- package/dist/components/ui/command/command-dialog.svelte +35 -0
- package/dist/components/ui/command/command-dialog.svelte.d.ts +9 -0
- package/dist/components/ui/command/command-empty.svelte +12 -0
- package/dist/components/ui/command/command-empty.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-group.svelte +29 -0
- package/dist/components/ui/command/command-group.svelte.d.ts +7 -0
- package/dist/components/ui/command/command-input.svelte +25 -0
- package/dist/components/ui/command/command-input.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-item.svelte +19 -0
- package/dist/components/ui/command/command-item.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-link-item.svelte +19 -0
- package/dist/components/ui/command/command-link-item.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-list.svelte +16 -0
- package/dist/components/ui/command/command-list.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-separator.svelte +12 -0
- package/dist/components/ui/command/command-separator.svelte.d.ts +4 -0
- package/dist/components/ui/command/command-shortcut.svelte +20 -0
- package/dist/components/ui/command/command-shortcut.svelte.d.ts +5 -0
- package/dist/components/ui/command/command.svelte +21 -0
- package/dist/components/ui/command/command.svelte.d.ts +4 -0
- package/dist/components/ui/command/index.d.ts +13 -0
- package/dist/components/ui/command/index.js +15 -0
- package/dist/components/ui/dialog/dialog-content.svelte +38 -0
- package/dist/components/ui/dialog/dialog-content.svelte.d.ts +9 -0
- package/dist/components/ui/dialog/dialog-description.svelte +16 -0
- package/dist/components/ui/dialog/dialog-description.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/dialog-footer.svelte +20 -0
- package/dist/components/ui/dialog/dialog-footer.svelte.d.ts +5 -0
- package/dist/components/ui/dialog/dialog-header.svelte +20 -0
- package/dist/components/ui/dialog/dialog-header.svelte.d.ts +5 -0
- package/dist/components/ui/dialog/dialog-overlay.svelte +19 -0
- package/dist/components/ui/dialog/dialog-overlay.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/dialog-title.svelte +16 -0
- package/dist/components/ui/dialog/dialog-title.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/index.d.ts +12 -0
- package/dist/components/ui/dialog/index.js +14 -0
- package/dist/components/ui/drawer/drawer-content.svelte +30 -0
- package/dist/components/ui/drawer/drawer-content.svelte.d.ts +7 -0
- package/dist/components/ui/drawer/drawer-description.svelte +16 -0
- package/dist/components/ui/drawer/drawer-description.svelte.d.ts +4 -0
- package/dist/components/ui/drawer/drawer-footer.svelte +16 -0
- package/dist/components/ui/drawer/drawer-footer.svelte.d.ts +5 -0
- package/dist/components/ui/drawer/drawer-header.svelte +20 -0
- package/dist/components/ui/drawer/drawer-header.svelte.d.ts +5 -0
- package/dist/components/ui/drawer/drawer-nested.svelte +12 -0
- package/dist/components/ui/drawer/drawer-nested.svelte.d.ts +3 -0
- package/dist/components/ui/drawer/drawer-overlay.svelte +16 -0
- package/dist/components/ui/drawer/drawer-overlay.svelte.d.ts +4 -0
- package/dist/components/ui/drawer/drawer-title.svelte +16 -0
- package/dist/components/ui/drawer/drawer-title.svelte.d.ts +4 -0
- package/dist/components/ui/drawer/drawer.svelte +12 -0
- package/dist/components/ui/drawer/drawer.svelte.d.ts +3 -0
- package/dist/components/ui/drawer/index.d.ts +13 -0
- package/dist/components/ui/drawer/index.js +15 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +40 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +8 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +26 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +7 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +19 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +7 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +23 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +7 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +23 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +8 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +30 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +4 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +16 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +4 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +5 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +19 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +4 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +28 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +7 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +25 -0
- package/dist/components/ui/dropdown-menu/index.js +17 -0
- package/dist/components/ui/hover-card/hover-card-content.svelte +28 -0
- package/dist/components/ui/hover-card/hover-card-content.svelte.d.ts +7 -0
- package/dist/components/ui/hover-card/index.d.ts +5 -0
- package/dist/components/ui/hover-card/index.js +5 -0
- package/dist/components/ui/input/index.d.ts +2 -0
- package/dist/components/ui/input/index.js +4 -0
- package/dist/components/ui/input/input.svelte +22 -0
- package/dist/components/ui/input/input.svelte.d.ts +5 -0
- package/dist/components/ui/input-otp/index.d.ts +5 -0
- package/dist/components/ui/input-otp/index.js +7 -0
- package/dist/components/ui/input-otp/input-otp-group.svelte +16 -0
- package/dist/components/ui/input-otp/input-otp-group.svelte.d.ts +5 -0
- package/dist/components/ui/input-otp/input-otp-separator.svelte +19 -0
- package/dist/components/ui/input-otp/input-otp-separator.svelte.d.ts +5 -0
- package/dist/components/ui/input-otp/input-otp-slot.svelte +30 -0
- package/dist/components/ui/input-otp/input-otp-slot.svelte.d.ts +12 -0
- package/dist/components/ui/input-otp/input-otp.svelte +22 -0
- package/dist/components/ui/input-otp/input-otp.svelte.d.ts +3 -0
- package/dist/components/ui/label/index.d.ts +2 -0
- package/dist/components/ui/label/index.js +4 -0
- package/dist/components/ui/label/label.svelte +19 -0
- package/dist/components/ui/label/label.svelte.d.ts +4 -0
- package/dist/components/ui/popover/index.d.ts +6 -0
- package/dist/components/ui/popover/index.js +6 -0
- package/dist/components/ui/popover/popover-content.svelte +28 -0
- package/dist/components/ui/popover/popover-content.svelte.d.ts +7 -0
- package/dist/components/ui/progress/index.d.ts +2 -0
- package/dist/components/ui/progress/index.js +4 -0
- package/dist/components/ui/progress/progress.svelte +25 -0
- package/dist/components/ui/progress/progress.svelte.d.ts +4 -0
- package/dist/components/ui/radio-group/index.d.ts +3 -0
- package/dist/components/ui/radio-group/index.js +5 -0
- package/dist/components/ui/radio-group/radio-group-item.svelte +28 -0
- package/dist/components/ui/radio-group/radio-group-item.svelte.d.ts +4 -0
- package/dist/components/ui/radio-group/radio-group.svelte +13 -0
- package/dist/components/ui/radio-group/radio-group.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/index.d.ts +15 -0
- package/dist/components/ui/range-calendar/index.js +17 -0
- package/dist/components/ui/range-calendar/range-calendar-cell.svelte +19 -0
- package/dist/components/ui/range-calendar/range-calendar-cell.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/range-calendar-day.svelte +34 -0
- package/dist/components/ui/range-calendar/range-calendar-day.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/range-calendar-grid-row.svelte +12 -0
- package/dist/components/ui/range-calendar/range-calendar-grid-row.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/range-calendar-grid.svelte +16 -0
- package/dist/components/ui/range-calendar/range-calendar-grid.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/range-calendar-head-cell.svelte +16 -0
- package/dist/components/ui/range-calendar/range-calendar-head-cell.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/range-calendar-header.svelte +16 -0
- package/dist/components/ui/range-calendar/range-calendar-header.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/range-calendar-heading.svelte +16 -0
- package/dist/components/ui/range-calendar/range-calendar-heading.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/range-calendar-months.svelte +20 -0
- package/dist/components/ui/range-calendar/range-calendar-months.svelte.d.ts +5 -0
- package/dist/components/ui/range-calendar/range-calendar-next-button.svelte +28 -0
- package/dist/components/ui/range-calendar/range-calendar-next-button.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte +28 -0
- package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/range-calendar.svelte +57 -0
- package/dist/components/ui/range-calendar/range-calendar.svelte.d.ts +5 -0
- package/dist/components/ui/scroll-area/index.d.ts +3 -0
- package/dist/components/ui/scroll-area/index.js +6 -0
- package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte +29 -0
- package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte.d.ts +4 -0
- package/dist/components/ui/scroll-area/scroll-area.svelte +32 -0
- package/dist/components/ui/scroll-area/scroll-area.svelte.d.ts +9 -0
- package/dist/components/ui/select/index.d.ts +11 -0
- package/dist/components/ui/select/index.js +13 -0
- package/dist/components/ui/select/select-content.svelte +39 -0
- package/dist/components/ui/select/select-content.svelte.d.ts +7 -0
- package/dist/components/ui/select/select-group-heading.svelte +16 -0
- package/dist/components/ui/select/select-group-heading.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-item.svelte +37 -0
- package/dist/components/ui/select/select-item.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-scroll-down-button.svelte +19 -0
- package/dist/components/ui/select/select-scroll-down-button.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-scroll-up-button.svelte +19 -0
- package/dist/components/ui/select/select-scroll-up-button.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-separator.svelte +13 -0
- package/dist/components/ui/select/select-separator.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-trigger.svelte +24 -0
- package/dist/components/ui/select/select-trigger.svelte.d.ts +4 -0
- package/dist/components/ui/separator/index.d.ts +2 -0
- package/dist/components/ui/separator/index.js +4 -0
- package/dist/components/ui/separator/separator.svelte +22 -0
- package/dist/components/ui/separator/separator.svelte.d.ts +4 -0
- package/dist/components/ui/slider/index.d.ts +3 -0
- package/dist/components/ui/slider/index.js +5 -0
- package/dist/components/ui/slider/slider.svelte +34 -0
- package/dist/components/ui/slider/slider.svelte.d.ts +4 -0
- package/dist/components/ui/sonner/index.d.ts +2 -0
- package/dist/components/ui/sonner/index.js +2 -0
- package/dist/components/ui/sonner/sonner.svelte +20 -0
- package/dist/components/ui/sonner/sonner.svelte.d.ts +4 -0
- package/dist/components/ui/switch/index.d.ts +2 -0
- package/dist/components/ui/switch/index.js +4 -0
- package/dist/components/ui/switch/switch.svelte +27 -0
- package/dist/components/ui/switch/switch.svelte.d.ts +4 -0
- package/dist/components/ui/table/index.d.ts +9 -0
- package/dist/components/ui/table/index.js +11 -0
- package/dist/components/ui/table/table-body.svelte +16 -0
- package/dist/components/ui/table/table-body.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-caption.svelte +16 -0
- package/dist/components/ui/table/table-caption.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-cell.svelte +20 -0
- package/dist/components/ui/table/table-cell.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-footer.svelte +16 -0
- package/dist/components/ui/table/table-footer.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-head.svelte +23 -0
- package/dist/components/ui/table/table-head.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-header.svelte +16 -0
- package/dist/components/ui/table/table-header.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-row.svelte +23 -0
- package/dist/components/ui/table/table-row.svelte.d.ts +5 -0
- package/dist/components/ui/table/table.svelte +18 -0
- package/dist/components/ui/table/table.svelte.d.ts +5 -0
- package/dist/components/ui/tabs/index.d.ts +6 -0
- package/dist/components/ui/tabs/index.js +8 -0
- package/dist/components/ui/tabs/tabs-content.svelte +19 -0
- package/dist/components/ui/tabs/tabs-content.svelte.d.ts +4 -0
- package/dist/components/ui/tabs/tabs-list.svelte +19 -0
- package/dist/components/ui/tabs/tabs-list.svelte.d.ts +4 -0
- package/dist/components/ui/tabs/tabs-trigger.svelte +19 -0
- package/dist/components/ui/tabs/tabs-trigger.svelte.d.ts +4 -0
- package/dist/components/ui/textarea/index.d.ts +19 -0
- package/dist/components/ui/textarea/index.js +4 -0
- package/dist/components/ui/textarea/textarea.svelte +22 -0
- package/dist/components/ui/textarea/textarea.svelte.d.ts +5 -0
- package/dist/components/ui/toggle/index.d.ts +3 -0
- package/dist/components/ui/toggle/index.js +5 -0
- package/dist/components/ui/toggle/toggle.svelte +51 -0
- package/dist/components/ui/toggle/toggle.svelte.d.ts +83 -0
- package/dist/components/ui/toggle-group/index.d.ts +3 -0
- package/dist/components/ui/toggle-group/index.js +5 -0
- package/dist/components/ui/toggle-group/toggle-group-item.svelte +30 -0
- package/dist/components/ui/toggle-group/toggle-group-item.svelte.d.ts +6 -0
- package/dist/components/ui/toggle-group/toggle-group.svelte +41 -0
- package/dist/components/ui/toggle-group/toggle-group.svelte.d.ts +8 -0
- package/dist/components/ui/tooltip/index.d.ts +6 -0
- package/dist/components/ui/tooltip/index.js +8 -0
- package/dist/components/ui/tooltip/tooltip-content.svelte +21 -0
- package/dist/components/ui/tooltip/tooltip-content.svelte.d.ts +4 -0
- package/dist/components/widget-system/EditableWidget.svelte +106 -0
- package/dist/components/widget-system/EditableWidget.svelte.d.ts +44 -0
- package/dist/components/widget-system/Moveable.svelte +661 -0
- package/dist/components/widget-system/Moveable.svelte.d.ts +56 -0
- package/dist/components/widget-system/index.d.ts +2 -0
- package/dist/components/widget-system/index.js +3 -0
- package/dist/fonts/BLMelody/BLMelody-Bold.woff2 +0 -0
- package/dist/fonts/BLMelody/BLMelody-Medium.woff2 +0 -0
- package/dist/fonts/BLMelody/BLMelody-SemiBold.woff2 +0 -0
- package/dist/fonts/Riegla/Riegla-Bold Italic.otf +0 -0
- package/dist/fonts/Riegla/Riegla-Bold.otf +0 -0
- package/dist/fonts/Riegla/Riegla-Italic.otf +0 -0
- package/dist/fonts/Riegla/Riegla-Regular.otf +0 -0
- package/dist/fonts/Riegla/RieglaMedium-Regular.otf +0 -0
- package/dist/fonts/index.d.ts +0 -0
- package/dist/fonts/index.js +1 -0
- package/dist/hooks/is-mobile.svelte.d.ts +5 -0
- package/dist/hooks/is-mobile.svelte.js +23 -0
- package/dist/icons/Checked.svelte +19 -0
- package/dist/icons/Checked.svelte.d.ts +20 -0
- package/dist/icons/CheckerBoardBackground.svelte +16 -0
- package/dist/icons/CheckerBoardBackground.svelte.d.ts +3 -0
- package/dist/icons/Close.svelte +22 -0
- package/dist/icons/Close.svelte.d.ts +20 -0
- package/dist/icons/Close.svg +8 -0
- package/dist/icons/Error.svg +5 -0
- package/dist/icons/Exclamation.svelte +5 -0
- package/dist/icons/Exclamation.svelte.d.ts +26 -0
- package/dist/icons/FileBrowser.svelte +38 -0
- package/dist/icons/FileBrowser.svelte.d.ts +20 -0
- package/dist/icons/FileBrowser.svg +28 -0
- package/dist/icons/LogoWidgetic.svelte +24 -0
- package/dist/icons/LogoWidgetic.svelte.d.ts +20 -0
- package/dist/icons/LogoWidgeticType.svelte +12 -0
- package/dist/icons/LogoWidgeticType.svelte.d.ts +20 -0
- package/dist/icons/LogoWidgeticType.svg +4 -0
- package/dist/icons/OpacitySliderArrows.svelte +46 -0
- package/dist/icons/OpacitySliderArrows.svelte.d.ts +3 -0
- package/dist/icons/TestIcon.svelte +1 -0
- package/dist/icons/TestIcon.svelte.d.ts +26 -0
- package/dist/icons/checked.svg +4 -0
- package/dist/icons/index.d.ts +11 -0
- package/dist/icons/index.js +15 -0
- package/dist/icons/lucide.d.ts +1 -0
- package/dist/icons/lucide.js +1 -0
- package/dist/icons/tabler.d.ts +1 -0
- package/dist/icons/tabler.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -0
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.js +1 -0
- package/dist/stores/pdfCache.d.ts +16 -0
- package/dist/stores/pdfCache.js +101 -0
- package/dist/styles/fonts.css +172 -0
- package/dist/styles/global.css +893 -0
- package/dist/utils/MediaManager.d.ts +35 -0
- package/dist/utils/MediaManager.js +59 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +5 -0
- package/package.json +183 -0
- package/tailwind.config.ts +97 -0
package/README.md
ADDED
|
@@ -0,0 +1,730 @@
|
|
|
1
|
+
# Widgetic Design System
|
|
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
|
+
0. Styles: it uses tailwindcss and exports global styles and design tokens that are imported in the project where the design system is imported:
|
|
8
|
+
|
|
9
|
+
```svelte
|
|
10
|
+
<script>
|
|
11
|
+
import '@widgetic/design-system/styles';
|
|
12
|
+
</script>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
0.1. To add new fonts:
|
|
16
|
+
- Add the font in the fonts folder.
|
|
17
|
+
- 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:
|
|
18
|
+
```css
|
|
19
|
+
/* First font-face rule */
|
|
20
|
+
@font-face {
|
|
21
|
+
font-family: 'BL Melody';
|
|
22
|
+
src: url('@widgetic/design-system/fonts/BLMelody/BLMelody-ExtraLight.woff2') format('woff2');
|
|
23
|
+
font-weight: 200;
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-display: swap;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Second fonte class(can be any custom name) */
|
|
29
|
+
.font-bl-melody-extra-light {
|
|
30
|
+
font-family: 'BL Melody';
|
|
31
|
+
font-weight: 200;
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- Use the font-family in any class in the global.css file if needed like this:
|
|
36
|
+
```css
|
|
37
|
+
.my-button-class {
|
|
38
|
+
/* other CSS properties */
|
|
39
|
+
background-color: red;
|
|
40
|
+
|
|
41
|
+
/* font-family properties here */
|
|
42
|
+
font-family: 'BL Melody', sans-serif;
|
|
43
|
+
font-weight: 200;
|
|
44
|
+
font-style: normal;
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
1.1. Components: It uses the SHADCN UI components for basic ui components and custom components for the Widgetic platform.
|
|
49
|
+
|
|
50
|
+
a. (Re)Install latest all shadcn components:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm run i-shadcn
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
At prompt answer like this:
|
|
57
|
+
```bash
|
|
58
|
+
Which style would you like to use?
|
|
59
|
+
│ Default
|
|
60
|
+
│
|
|
61
|
+
◇ Which base color would you like to use?
|
|
62
|
+
│ Slate
|
|
63
|
+
│
|
|
64
|
+
◇ Where is your global CSS file? (this file will be overwritten)
|
|
65
|
+
│ src/app.css (!!! add local project's css file as we don't want to overwrite our project's global styles)
|
|
66
|
+
│
|
|
67
|
+
◇ Where is your Tailwind config located? (this file will be overwritten)
|
|
68
|
+
│ tailwind.config.ts
|
|
69
|
+
│
|
|
70
|
+
◇ Configure the import alias for components:
|
|
71
|
+
│ $lib/components
|
|
72
|
+
│
|
|
73
|
+
◆ Configure the import alias for utils:
|
|
74
|
+
│ $lib/utils
|
|
75
|
+
│
|
|
76
|
+
◆ Configure the import alias for hooks:
|
|
77
|
+
│ $lib/hooks
|
|
78
|
+
│
|
|
79
|
+
◆ Configure the import alias for ui:
|
|
80
|
+
│ $lib/components/ui
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
Components to install:
|
|
84
|
+
│ accordion, badge, button, calendar, range-calendar, card, checkbox, collapsible, dialog,
|
|
85
|
+
│ drawer, dropdown-menu, input, input-otp, label, popover, progress, radio-group, scroll-area,
|
|
86
|
+
│ select, separator, slider, switch, table, tabs, textarea, tooltip
|
|
87
|
+
│
|
|
88
|
+
◆ Ready to install components and dependencies?
|
|
89
|
+
│ ● Yes / ○ No
|
|
90
|
+
...
|
|
91
|
+
tooltip installed at src/lib/components/ui/tooltip
|
|
92
|
+
│
|
|
93
|
+
◇ Dependencies installed with npm
|
|
94
|
+
│
|
|
95
|
+
◇ Config file components.json updated
|
|
96
|
+
│
|
|
97
|
+
└ Success! Component installation completed.
|
|
98
|
+
|
|
99
|
+
!!! On commit the change uncheck the grouped components(Table, Select, etc.) baerel file.
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
b. Installing the shadcn-svelte package:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npx shadcn-svelte@next init
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
c. Add one or more SHADCN UI components:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npx shadcn-svelte@next add <component-name component-name2>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
d. Check tailwind.config.ts file to see if you didn't lose any of the project's config.
|
|
115
|
+
|
|
116
|
+
e. Check /src/lib/utils/utils.ts file to see if you didn't lose any of the project's utils.
|
|
117
|
+
|
|
118
|
+
f. Check /src/lib/hooks/hooks.ts file to see if you didn't lose any of the project's hooks.
|
|
119
|
+
|
|
120
|
+
g. Check SHADCN UI Grouped components(eg. Table or Select) barel file to export a constant with the subcomponents.
|
|
121
|
+
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".
|
|
122
|
+
```ts
|
|
123
|
+
// src/lib/components/ui/table/index.ts
|
|
124
|
+
const Table = {
|
|
125
|
+
Root,
|
|
126
|
+
Body,
|
|
127
|
+
Caption,
|
|
128
|
+
Cell,
|
|
129
|
+
Footer,
|
|
130
|
+
Head,
|
|
131
|
+
Header,
|
|
132
|
+
Row
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export {
|
|
136
|
+
Table, // add the constant name "Table" that will be the namespace for the grouped components
|
|
137
|
+
Root as TableRoot, // Change the name of the Root component from "Table" to "TableRoot"
|
|
138
|
+
Body as TableBody,
|
|
139
|
+
Caption as TableCaption,
|
|
140
|
+
Cell as TableCell,
|
|
141
|
+
Footer as TableFooter,
|
|
142
|
+
Head as TableHead,
|
|
143
|
+
Header as TableHeader,
|
|
144
|
+
Row as TableRow,
|
|
145
|
+
};
|
|
146
|
+
```
|
|
147
|
+
Then you can import and use the namespace in the project:
|
|
148
|
+
```svelte
|
|
149
|
+
import { Table } from '@widgetic/design-system';
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
h. If there is a component that looks compound but is not, add the @notCompound marker in the file:
|
|
153
|
+
```ts
|
|
154
|
+
// @notCompound
|
|
155
|
+
export {
|
|
156
|
+
Root,
|
|
157
|
+
Scrollbar,
|
|
158
|
+
//,
|
|
159
|
+
Root as ScrollArea,
|
|
160
|
+
Scrollbar as ScrollAreaScrollbar,
|
|
161
|
+
};
|
|
162
|
+
```
|
|
163
|
+
ScrollArea is not a compound component but it looks like one.
|
|
164
|
+
|
|
165
|
+
h. If you want to export only the main component and not the subcomponents, add the @noSubcomponents marker in the file:
|
|
166
|
+
```ts
|
|
167
|
+
// @noSubcomponents
|
|
168
|
+
export {
|
|
169
|
+
Day,
|
|
170
|
+
Cell,
|
|
171
|
+
Grid,
|
|
172
|
+
Header,
|
|
173
|
+
Months,
|
|
174
|
+
GridRow,
|
|
175
|
+
Heading,
|
|
176
|
+
GridBody,
|
|
177
|
+
GridHead,
|
|
178
|
+
HeadCell,
|
|
179
|
+
NextButton,
|
|
180
|
+
PrevButton,
|
|
181
|
+
//
|
|
182
|
+
Root as RangeCalendar,
|
|
183
|
+
};
|
|
184
|
+
```
|
|
185
|
+
RangeCalendar share the same subcomponents with Calendar so we don't want to export them.
|
|
186
|
+
|
|
187
|
+
1.2. In general we should follow the shadcn-svelte approach to export the components with more subcomponents or compound components.
|
|
188
|
+
|
|
189
|
+
2. Icons: It also uses the Lucide and Tabler icons or custom icons for the platform.
|
|
190
|
+
|
|
191
|
+
```svelte
|
|
192
|
+
import { IconName } from '@widgetic/design-system/icons';
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
3. Fonts: The design system uses Google Fonts that we need to import in the project where the design system is imported.
|
|
197
|
+
|
|
198
|
+
```svelte
|
|
199
|
+
import { FontName } from '@widgetic/design-system/fonts';
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
## Performance Optimization for Linked Design System
|
|
204
|
+
|
|
205
|
+
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.
|
|
206
|
+
|
|
207
|
+
### Common Issues:
|
|
208
|
+
- Long initial loading time (>1 minute)
|
|
209
|
+
- "Pending" status on network requests when navigating between pages
|
|
210
|
+
- High CPU usage during development
|
|
211
|
+
|
|
212
|
+
### Solution:
|
|
213
|
+
|
|
214
|
+
#### 1. For consuming projects (like site, context-chat, etc.):
|
|
215
|
+
|
|
216
|
+
Optimize your `vite.config.ts` with these settings:
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
server: {
|
|
220
|
+
watch: {
|
|
221
|
+
// Don't use polling (which causes high CPU usage)
|
|
222
|
+
// Remove the following if present:
|
|
223
|
+
// usePolling: true,
|
|
224
|
+
// interval: 2000,
|
|
225
|
+
// binaryInterval: 2000,
|
|
226
|
+
|
|
227
|
+
// Ignore all node_modules EXCEPT the design system dist folder if needed
|
|
228
|
+
ignored: [
|
|
229
|
+
'**/node_modules/**',
|
|
230
|
+
'**/*.map',
|
|
231
|
+
'**/*.d.ts',
|
|
232
|
+
'**/*.log'
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
hmr: {
|
|
236
|
+
// Reduce timeout for faster updates
|
|
237
|
+
timeout: 2000
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
optimizeDeps: {
|
|
241
|
+
// Don't include the design system in optimizeDeps
|
|
242
|
+
// Remove this if present:
|
|
243
|
+
// include: ['@widgetic/design-system']
|
|
244
|
+
|
|
245
|
+
// Keep other settings
|
|
246
|
+
exclude: ['@sveltejs/kit']
|
|
247
|
+
},
|
|
248
|
+
build: {
|
|
249
|
+
// Add these for faster builds
|
|
250
|
+
sourcemap: false,
|
|
251
|
+
reportCompressedSize: false
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### 2. For production deployments:
|
|
256
|
+
|
|
257
|
+
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.
|
|
258
|
+
|
|
259
|
+
#### 3. Development vs. Production Mode:
|
|
260
|
+
|
|
261
|
+
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.
|
|
262
|
+
|
|
263
|
+
**Note:** These optimizations are only needed during development with linked packages and won't affect the published npm package performance.
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
## How to link DS into another project and develop it(first time)
|
|
267
|
+
|
|
268
|
+
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`
|
|
269
|
+
|
|
270
|
+
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:
|
|
271
|
+
|
|
272
|
+
```json
|
|
273
|
+
"dependencies": {
|
|
274
|
+
"tailwindcss": "^3.4.16",
|
|
275
|
+
"@tailwindcss/postcss": "^4.1.2",
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
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.
|
|
280
|
+
(optional)If not already in the project follow the install guide at: https://tailwindcss.com/docs/installation/using-postcss.
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
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:
|
|
284
|
+
```json package.json
|
|
285
|
+
"dependencies": {
|
|
286
|
+
"@sveltejs/kit": "^2.20.2",
|
|
287
|
+
"svelte": "^5.25.6",
|
|
288
|
+
"@tabler/icons-svelte": "^3.24.0",
|
|
289
|
+
"lucide-svelte": "^0.468.0",
|
|
290
|
+
"bits-ui": "^1.3.0",
|
|
291
|
+
"svelte-sonner": "^0.3.28",
|
|
292
|
+
|
|
293
|
+
"tailwind-merge": "^2.5.2",
|
|
294
|
+
"tailwind-variants": "^0.2.1",
|
|
295
|
+
"tailwindcss-animate": "^1.0.7",
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
"overrides": {
|
|
299
|
+
"bits-ui": {
|
|
300
|
+
"@melt-ui/svelte": "^0.86.3"
|
|
301
|
+
},
|
|
302
|
+
"vaul-svelte": {
|
|
303
|
+
"bits-ui": {
|
|
304
|
+
"@melt-ui/svelte": "^0.86.3"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"svelte": "^5.25.6"
|
|
308
|
+
},
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
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.
|
|
312
|
+
|
|
313
|
+
3. Also add this "i"(install) and "lds"(link) scripts into the package.json file exactly as following:
|
|
314
|
+
"i": "rm -rf node_modules && npm i && npm run lds",
|
|
315
|
+
"lds": "volta run npm link @widgetic/design-system",
|
|
316
|
+
Then run it with: `npm run i`
|
|
317
|
+
|
|
318
|
+
4. Also add these "dev" scripts into the package.json file for usual start of the consuming project:
|
|
319
|
+
"dev": "npm run dev-sv -- --open",
|
|
320
|
+
"dev-sv": "NODE_ENV=development vite dev",
|
|
321
|
+
|
|
322
|
+
5. Import DS config into the tailwind.config.ts file(of consuming project) and add it in the presets array:
|
|
323
|
+
```ts
|
|
324
|
+
// tailwind.config.ts
|
|
325
|
+
|
|
326
|
+
import designSystemPreset from '@widgetic/design-system/tailwind.config';
|
|
327
|
+
|
|
328
|
+
const config = {
|
|
329
|
+
// add here the DS preset
|
|
330
|
+
presets: [
|
|
331
|
+
designSystemPreset
|
|
332
|
+
],
|
|
333
|
+
// add here the '@widgetic/*/dist/...' to scan also the DS package files
|
|
334
|
+
content: [
|
|
335
|
+
"./src/**/*.{html,js,svelte,ts}",
|
|
336
|
+
// Include all @widgetic packages from node_modules(for development only) to be sure Tailwind scans all the files
|
|
337
|
+
"./node_modules/@widgetic/*/dist/**/*.{html,js,svelte,ts}"
|
|
338
|
+
],
|
|
339
|
+
// the rest of the config properties
|
|
340
|
+
theme: {
|
|
341
|
+
extend: {
|
|
342
|
+
// current extend config...
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
export default config;
|
|
348
|
+
```
|
|
349
|
+
Also make sure you remove the type of the config to avoid conflicts with the DS config.
|
|
350
|
+
Then leave the rest of the config as it is.
|
|
351
|
+
|
|
352
|
+
6. Import styles and a test component from DS in the consuming project:
|
|
353
|
+
a. In the root layout of the project import the global styles:
|
|
354
|
+
```svelte
|
|
355
|
+
<!-- +layout.svelte -->
|
|
356
|
+
<script>
|
|
357
|
+
import '@widgetic/design-system/styles';
|
|
358
|
+
</script>
|
|
359
|
+
```
|
|
360
|
+
b. In the root page of the consuming project import any component(e.g. Button) and use it:
|
|
361
|
+
```svelte
|
|
362
|
+
<!-- +page.svelte -->
|
|
363
|
+
<script>
|
|
364
|
+
import { Button } from '@widgetic/design-system/';
|
|
365
|
+
</script>
|
|
366
|
+
|
|
367
|
+
<!-- HTML zone -->
|
|
368
|
+
<Button>Click me</Button>
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
7. Finally: go into the in the consuming project's folder and start the development server with:
|
|
372
|
+
```bash
|
|
373
|
+
npm run dev
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
This automatically opens the http://localhost:5173 (default port) for the consuming project and you can see how DS components work in it.
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
## Developing inside this project:
|
|
381
|
+
|
|
382
|
+
1. Install dependencies with `npm install`
|
|
383
|
+
|
|
384
|
+
2. Link the package in the system with npm:
|
|
385
|
+
```bash
|
|
386
|
+
npm link
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
3. Start the development server with:
|
|
390
|
+
```bash
|
|
391
|
+
npm run dev
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
3. Test the design system in action:
|
|
395
|
+
- In the root layout of the DS project there is a global styles import to test the design system's global styles.
|
|
396
|
+
- In the root page of the project there is a button component import to test the design system's components.
|
|
397
|
+
|
|
398
|
+
Open in new tab in browser with address: http://localhost:5173/ to see the design system in action.
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
### Global Tailwind CSS and Design Tokens:
|
|
403
|
+
|
|
404
|
+
```css
|
|
405
|
+
/* src/lib/styles/global.css */
|
|
406
|
+
@tailwind base;
|
|
407
|
+
@tailwind components;
|
|
408
|
+
@tailwind utilities;
|
|
409
|
+
|
|
410
|
+
/* CUSTOM GLOBAL STYLES */
|
|
411
|
+
/* ADD HERE CLASSES AND CSS VARIABLES that are used in the projects where the design system is imported */
|
|
412
|
+
|
|
413
|
+
/* Base styles */
|
|
414
|
+
@layer base {
|
|
415
|
+
:root {
|
|
416
|
+
/* Design tokens */
|
|
417
|
+
--color-primary: 30 158 210; /* RGB values for easier theming */
|
|
418
|
+
--color-secondary: 46 204 113;
|
|
419
|
+
--radius: 0.5rem;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* Dark mode tokens */
|
|
423
|
+
.dark {
|
|
424
|
+
--color-primary: 100 200 255;
|
|
425
|
+
--color-secondary: 100 255 150;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/* Reusable component classes */
|
|
430
|
+
@layer components {
|
|
431
|
+
.btn-primary {
|
|
432
|
+
@apply bg-[rgb(var(--color-primary))] text-white rounded-[var(--radius)];
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.card {
|
|
436
|
+
@apply shadow-md rounded-lg p-4 bg-white dark:bg-gray-800;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/* Custom utility classes */
|
|
441
|
+
@layer utilities {
|
|
442
|
+
.text-balance {
|
|
443
|
+
text-wrap: balance;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
2. In the project where the design system is imported:
|
|
449
|
+
- Import the global styles in the +layout.svelte file:
|
|
450
|
+
```svelte
|
|
451
|
+
<script>
|
|
452
|
+
import '@widgetic/design-system/styles';
|
|
453
|
+
</script>
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
### Create a Custom Shared Component in the Design System project using a SHADCN UI component and classes from the global styles:
|
|
458
|
+
|
|
459
|
+
src/lib/components/MyButton.svelte:
|
|
460
|
+
```svelte
|
|
461
|
+
<script>
|
|
462
|
+
<!-- Import Button from the SHADCN UI components -->
|
|
463
|
+
import { Button } from './components/ui';
|
|
464
|
+
</script>
|
|
465
|
+
|
|
466
|
+
<MyButton
|
|
467
|
+
{type}
|
|
468
|
+
class="btn-primary"
|
|
469
|
+
on:click
|
|
470
|
+
>
|
|
471
|
+
<slot />
|
|
472
|
+
</MyButton>
|
|
473
|
+
```
|
|
474
|
+
Then export the component in the "src/lib/components/index.ts" file:
|
|
475
|
+
```ts
|
|
476
|
+
export {default as MyButton } from './components/MyButton.svelte';
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
## Deployment of Design System
|
|
481
|
+
|
|
482
|
+
To deploy the design system, run the following command:
|
|
483
|
+
```bash
|
|
484
|
+
npm run prepublishOnly
|
|
485
|
+
```
|
|
486
|
+
This will create a `dist` folder with the production build of the design system.
|
|
487
|
+
|
|
488
|
+
To publish the design system to the npm registry, run the following command:
|
|
489
|
+
```bash
|
|
490
|
+
npm run publish-package
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
## Grid System
|
|
494
|
+
|
|
495
|
+
The design system implements three distinct responsive grid layouts:
|
|
496
|
+
|
|
497
|
+
1. Site Grid
|
|
498
|
+
2. Dashboard Grid
|
|
499
|
+
3. App Grid
|
|
500
|
+
|
|
501
|
+
### Grid Breakpoints
|
|
502
|
+
- Desktop: > 744px
|
|
503
|
+
- Tablet: 393px - 744px
|
|
504
|
+
- Mobile: ≤ 393px
|
|
505
|
+
|
|
506
|
+
### 1. Site Grid
|
|
507
|
+
|
|
508
|
+
**Desktop (>744px)**
|
|
509
|
+
- 12 columns
|
|
510
|
+
- 144px margins
|
|
511
|
+
- 24px gutters
|
|
512
|
+
- Stretching columns with auto width
|
|
513
|
+
|
|
514
|
+
**Tablet (≤744px)**
|
|
515
|
+
- 8 columns
|
|
516
|
+
- 32px margins
|
|
517
|
+
- 16px gutters
|
|
518
|
+
- Stretching columns with auto width
|
|
519
|
+
|
|
520
|
+
**Mobile (≤393px)**
|
|
521
|
+
- 4 columns
|
|
522
|
+
- 16px margins
|
|
523
|
+
- 16px gutters
|
|
524
|
+
- Stretching columns with auto width
|
|
525
|
+
|
|
526
|
+
### 2. Dashboard Grid
|
|
527
|
+
|
|
528
|
+
**Desktop (>744px)**
|
|
529
|
+
- Header: 12 columns, 24px margins, 20px gutters
|
|
530
|
+
- Sidebar: 240px fixed width
|
|
531
|
+
- Main Content: 12 columns, 24px margins, 20px gutters
|
|
532
|
+
- 56px header height
|
|
533
|
+
|
|
534
|
+
**Tablet (≤744px)**
|
|
535
|
+
- Header: 8 columns
|
|
536
|
+
- Sidebar: 200px fixed width
|
|
537
|
+
- Main Content: 8 columns
|
|
538
|
+
- 16px margins and gutters
|
|
539
|
+
|
|
540
|
+
**Mobile (≤393px)**
|
|
541
|
+
- Header: 4 columns
|
|
542
|
+
- Sidebar replaced with menu component
|
|
543
|
+
- Main Content: 4 columns
|
|
544
|
+
- 16px margins and gutters
|
|
545
|
+
|
|
546
|
+
### 3. App Grid
|
|
547
|
+
|
|
548
|
+
**Desktop (>744px)**
|
|
549
|
+
- Header: 12 columns, 24px margins, 20px gutters
|
|
550
|
+
- Main Content: 12 columns, 144px margins, 20px gutters
|
|
551
|
+
- 56px header height
|
|
552
|
+
|
|
553
|
+
**Tablet (≤744px)**
|
|
554
|
+
- Header: 8 columns
|
|
555
|
+
- Main Content: 8 columns, 32px margins
|
|
556
|
+
- 16px gutters
|
|
557
|
+
|
|
558
|
+
**Mobile (≤393px)**
|
|
559
|
+
- Header: 4 columns
|
|
560
|
+
- Menu component added below header
|
|
561
|
+
- Main Content: 4 columns
|
|
562
|
+
- 16px margins and gutters
|
|
563
|
+
|
|
564
|
+
### Usage Example
|
|
565
|
+
|
|
566
|
+
```svelte
|
|
567
|
+
<!-- Site Grid -->
|
|
568
|
+
<div class="site-grid">
|
|
569
|
+
<div class="grid-margin-left"></div>
|
|
570
|
+
<header class="grid-header">Header Content</header>
|
|
571
|
+
<main class="grid-main">Main Content</main>
|
|
572
|
+
<footer class="grid-footer">Footer Content</footer>
|
|
573
|
+
<div class="grid-margin-right"></div>
|
|
574
|
+
</div>
|
|
575
|
+
|
|
576
|
+
<!-- Dashboard Grid -->
|
|
577
|
+
<div class="dashboard-grid">
|
|
578
|
+
<div class="grid-margin-left"></div>
|
|
579
|
+
<header class="dashboard-header-grid">
|
|
580
|
+
<!-- Header content with 12/8/4 columns based on viewport -->
|
|
581
|
+
</header>
|
|
582
|
+
<nav class="grid-sidebar">
|
|
583
|
+
<!-- Sidebar content (hidden on mobile) -->
|
|
584
|
+
</nav>
|
|
585
|
+
<main class="dashboard-main-grid">
|
|
586
|
+
<!-- Main content with 12/8/4 columns based on viewport -->
|
|
587
|
+
</main>
|
|
588
|
+
<div class="grid-margin-right"></div>
|
|
589
|
+
<!-- Mobile menu appears automatically on small screens -->
|
|
590
|
+
<div class="grid-menu">
|
|
591
|
+
<!-- Mobile menu content -->
|
|
592
|
+
</div>
|
|
593
|
+
</div>
|
|
594
|
+
|
|
595
|
+
<!-- App Grid -->
|
|
596
|
+
<div class="app-grid">
|
|
597
|
+
<div class="grid-margin-left"></div>
|
|
598
|
+
<header class="app-header-grid">
|
|
599
|
+
<!-- Header content with 12/8/4 columns based on viewport -->
|
|
600
|
+
</header>
|
|
601
|
+
<main class="app-main-grid">
|
|
602
|
+
<!-- Main content with 12/8/4 columns based on viewport -->
|
|
603
|
+
</main>
|
|
604
|
+
<div class="grid-margin-right"></div>
|
|
605
|
+
<!-- Mobile menu appears automatically on small screens -->
|
|
606
|
+
<div class="grid-menu">
|
|
607
|
+
<!-- Mobile menu content -->
|
|
608
|
+
</div>
|
|
609
|
+
</div>
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
### Grid Area Classes
|
|
613
|
+
The following classes are available to position elements within the grid:
|
|
614
|
+
```css
|
|
615
|
+
.grid-header /* Header area */
|
|
616
|
+
.grid-main /* Main content area */
|
|
617
|
+
.grid-sidebar /* Sidebar area (dashboard only) */
|
|
618
|
+
.grid-footer /* Footer area (site only) */
|
|
619
|
+
.grid-toolbar /* Toolbar area (app only) */
|
|
620
|
+
.grid-margin-left /* Left margin area */
|
|
621
|
+
.grid-margin-right/* Right margin area */
|
|
622
|
+
.grid-menu /* Mobile menu area */
|
|
623
|
+
.grid-gap /* Gap area (dashboard only) */
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
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).
|
|
627
|
+
|
|
628
|
+
## DeleteConfirmation Component
|
|
629
|
+
|
|
630
|
+
The `DeleteConfirmation` component is a reusable confirmation dialog that can be used across different parts of the project for confirming deletion actions.
|
|
631
|
+
|
|
632
|
+
### Features
|
|
633
|
+
|
|
634
|
+
- Independent of any specific store or state management system
|
|
635
|
+
- Customizable title, message, and button labels
|
|
636
|
+
- Works with any type of items to be deleted
|
|
637
|
+
- Dispatches events for both confirmation and cancellation
|
|
638
|
+
|
|
639
|
+
### Usage
|
|
640
|
+
|
|
641
|
+
```svelte
|
|
642
|
+
<script>
|
|
643
|
+
import { DeleteConfirmation } from '@widgetic/design-system/components';
|
|
644
|
+
|
|
645
|
+
let showDeleteConfirmation = false;
|
|
646
|
+
let itemsToDelete = [
|
|
647
|
+
{ id: '1', name: 'Document.pdf', type: 'file' },
|
|
648
|
+
{ id: '2', name: 'Images', type: 'folder' }
|
|
649
|
+
];
|
|
650
|
+
|
|
651
|
+
function handleDelete(event) {
|
|
652
|
+
const deletedItems = event.detail.items;
|
|
653
|
+
console.log('Items to delete:', deletedItems);
|
|
654
|
+
// Perform deletion logic here
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
function handleCancel() {
|
|
658
|
+
showDeleteConfirmation = false;
|
|
659
|
+
console.log('Deletion cancelled');
|
|
660
|
+
}
|
|
661
|
+
</script>
|
|
662
|
+
|
|
663
|
+
<button on:click={() => showDeleteConfirmation = true}>
|
|
664
|
+
Delete Items
|
|
665
|
+
</button>
|
|
666
|
+
|
|
667
|
+
<DeleteConfirmation
|
|
668
|
+
bind:isOpen={showDeleteConfirmation}
|
|
669
|
+
items={itemsToDelete}
|
|
670
|
+
modalId="my-delete-confirmation"
|
|
671
|
+
on:delete={handleDelete}
|
|
672
|
+
on:cancel={handleCancel}
|
|
673
|
+
/>
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
### Props
|
|
677
|
+
|
|
678
|
+
| Prop | Type | Default | Description |
|
|
679
|
+
|------|------|---------|-------------|
|
|
680
|
+
| `isOpen` | boolean | `false` | Controls the visibility of the modal |
|
|
681
|
+
| `items` | array | `[]` | Array of items to be deleted |
|
|
682
|
+
| `title` | string | `''` | Custom title for the modal (autogenerated if empty) |
|
|
683
|
+
| `message` | string | `''` | Custom message for the modal (autogenerated if empty) |
|
|
684
|
+
| `confirmLabel` | string | `'Confirm'` | Label for the confirm button |
|
|
685
|
+
| `cancelLabel` | string | `'Cancel'` | Label for the cancel button |
|
|
686
|
+
| `width` | string | `'410px'` | Width of the modal |
|
|
687
|
+
| `height` | string | `'168px'` | Height of the modal |
|
|
688
|
+
| `modalId` | string | `'delete-confirmation-modal'` | ID for targeting the modal |
|
|
689
|
+
|
|
690
|
+
### Events
|
|
691
|
+
|
|
692
|
+
- `delete` - Dispatched when the user confirms deletion, with `items` in the event detail
|
|
693
|
+
- `cancel` - Dispatched when the user cancels deletion
|
|
694
|
+
|
|
695
|
+
### Custom Title and Message Example
|
|
696
|
+
|
|
697
|
+
You can provide custom title and message for specific contexts:
|
|
698
|
+
|
|
699
|
+
```svelte
|
|
700
|
+
<script>
|
|
701
|
+
import { DeleteConfirmation } from '@widgetic/design-system/components';
|
|
702
|
+
|
|
703
|
+
let showDeleteConfirmation = false;
|
|
704
|
+
let selectedItems = [
|
|
705
|
+
{ id: '1', name: 'Document.pdf', type: 'file' },
|
|
706
|
+
{ id: '2', name: 'Images', type: 'folder' }
|
|
707
|
+
];
|
|
708
|
+
|
|
709
|
+
function handleDelete(event) {
|
|
710
|
+
const deletedItems = event.detail.items;
|
|
711
|
+
console.log('Items to delete:', deletedItems);
|
|
712
|
+
// Perform deletion logic here
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
function handleCancel() {
|
|
716
|
+
showDeleteConfirmation = false;
|
|
717
|
+
console.log('Deletion cancelled');
|
|
718
|
+
}
|
|
719
|
+
</script>
|
|
720
|
+
|
|
721
|
+
<DeleteConfirmation
|
|
722
|
+
bind:isOpen={showDeleteConfirmation}
|
|
723
|
+
items={selectedItems}
|
|
724
|
+
title="Delete Assets"
|
|
725
|
+
message="These assets will be permanently deleted. This action cannot be undone."
|
|
726
|
+
confirmLabel="Delete Permanently"
|
|
727
|
+
on:delete={handleDelete}
|
|
728
|
+
on:cancel={handleCancel}
|
|
729
|
+
/>
|
|
730
|
+
```
|