love-ui 1.0.0
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 +214 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/license.md +7 -0
- package/package.json +61 -0
- package/packages/announcement/index.tsx +53 -0
- package/packages/announcement/node_modules/.bin/tsc +21 -0
- package/packages/announcement/node_modules/.bin/tsserver +21 -0
- package/packages/announcement/package.json +17 -0
- package/packages/announcement/tsconfig.json +13 -0
- package/packages/avatar-stack/index.tsx +51 -0
- package/packages/avatar-stack/node_modules/.bin/tsc +21 -0
- package/packages/avatar-stack/node_modules/.bin/tsserver +21 -0
- package/packages/avatar-stack/package.json +17 -0
- package/packages/avatar-stack/tsconfig.json +13 -0
- package/packages/banner/index.tsx +142 -0
- package/packages/banner/node_modules/.bin/tsc +21 -0
- package/packages/banner/node_modules/.bin/tsserver +21 -0
- package/packages/banner/package.json +19 -0
- package/packages/banner/tsconfig.json +13 -0
- package/packages/calendar/index.tsx +496 -0
- package/packages/calendar/node_modules/.bin/tsc +21 -0
- package/packages/calendar/node_modules/.bin/tsserver +21 -0
- package/packages/calendar/package.json +20 -0
- package/packages/calendar/tsconfig.json +13 -0
- package/packages/choicebox/index.tsx +113 -0
- package/packages/choicebox/node_modules/.bin/tsc +21 -0
- package/packages/choicebox/node_modules/.bin/tsserver +21 -0
- package/packages/choicebox/package.json +19 -0
- package/packages/choicebox/tsconfig.json +13 -0
- package/packages/code-block/index.tsx +638 -0
- package/packages/code-block/node_modules/.bin/tsc +21 -0
- package/packages/code-block/node_modules/.bin/tsserver +21 -0
- package/packages/code-block/package.json +22 -0
- package/packages/code-block/server.tsx +63 -0
- package/packages/code-block/tsconfig.json +13 -0
- package/packages/color-picker/index.tsx +467 -0
- package/packages/color-picker/node_modules/.bin/tsc +21 -0
- package/packages/color-picker/node_modules/.bin/tsserver +21 -0
- package/packages/color-picker/package.json +21 -0
- package/packages/color-picker/tsconfig.json +13 -0
- package/packages/combobox/index.tsx +309 -0
- package/packages/combobox/node_modules/.bin/tsc +21 -0
- package/packages/combobox/node_modules/.bin/tsserver +21 -0
- package/packages/combobox/package.json +19 -0
- package/packages/combobox/tsconfig.json +13 -0
- package/packages/comparison/index.tsx +209 -0
- package/packages/comparison/node_modules/.bin/tsc +21 -0
- package/packages/comparison/node_modules/.bin/tsserver +21 -0
- package/packages/comparison/package.json +19 -0
- package/packages/comparison/tsconfig.json +13 -0
- package/packages/contribution-graph/index.tsx +517 -0
- package/packages/contribution-graph/node_modules/.bin/tsc +21 -0
- package/packages/contribution-graph/node_modules/.bin/tsserver +21 -0
- package/packages/contribution-graph/package.json +18 -0
- package/packages/contribution-graph/tsconfig.json +13 -0
- package/packages/credit-card/index.tsx +348 -0
- package/packages/credit-card/node_modules/.bin/tsc +21 -0
- package/packages/credit-card/node_modules/.bin/tsserver +21 -0
- package/packages/credit-card/package.json +18 -0
- package/packages/credit-card/tsconfig.json +13 -0
- package/packages/cursor/index.tsx +62 -0
- package/packages/cursor/node_modules/.bin/tsc +21 -0
- package/packages/cursor/node_modules/.bin/tsserver +21 -0
- package/packages/cursor/package.json +17 -0
- package/packages/cursor/tsconfig.json +13 -0
- package/packages/deck/index.tsx +297 -0
- package/packages/deck/node_modules/.bin/tsc +21 -0
- package/packages/deck/node_modules/.bin/tsserver +21 -0
- package/packages/deck/package.json +20 -0
- package/packages/deck/tsconfig.json +13 -0
- package/packages/dialog-stack/index.tsx +484 -0
- package/packages/dialog-stack/node_modules/.bin/tsc +21 -0
- package/packages/dialog-stack/node_modules/.bin/tsserver +21 -0
- package/packages/dialog-stack/package.json +19 -0
- package/packages/dialog-stack/tsconfig.json +13 -0
- package/packages/dropzone/index.tsx +202 -0
- package/packages/dropzone/node_modules/.bin/tsc +21 -0
- package/packages/dropzone/node_modules/.bin/tsserver +21 -0
- package/packages/dropzone/package.json +19 -0
- package/packages/dropzone/tsconfig.json +13 -0
- package/packages/editor/index.tsx +1980 -0
- package/packages/editor/node_modules/.bin/tsc +21 -0
- package/packages/editor/node_modules/.bin/tsserver +21 -0
- package/packages/editor/package.json +35 -0
- package/packages/editor/tsconfig.json +13 -0
- package/packages/gantt/index.tsx +1469 -0
- package/packages/gantt/node_modules/.bin/tsc +21 -0
- package/packages/gantt/node_modules/.bin/tsserver +21 -0
- package/packages/gantt/package.json +25 -0
- package/packages/gantt/tsconfig.json +13 -0
- package/packages/glimpse/index.tsx +67 -0
- package/packages/glimpse/node_modules/.bin/tsc +21 -0
- package/packages/glimpse/node_modules/.bin/tsserver +21 -0
- package/packages/glimpse/package.json +17 -0
- package/packages/glimpse/server.tsx +21 -0
- package/packages/glimpse/tsconfig.json +13 -0
- package/packages/image-crop/index.tsx +368 -0
- package/packages/image-crop/node_modules/.bin/tsc +21 -0
- package/packages/image-crop/node_modules/.bin/tsserver +21 -0
- package/packages/image-crop/package.json +20 -0
- package/packages/image-crop/tsconfig.json +13 -0
- package/packages/image-zoom/index.tsx +52 -0
- package/packages/image-zoom/node_modules/.bin/tsc +21 -0
- package/packages/image-zoom/node_modules/.bin/tsserver +21 -0
- package/packages/image-zoom/package.json +18 -0
- package/packages/image-zoom/tsconfig.json +13 -0
- package/packages/kanban/index.tsx +338 -0
- package/packages/kanban/node_modules/.bin/tsc +21 -0
- package/packages/kanban/node_modules/.bin/tsserver +21 -0
- package/packages/kanban/package.json +21 -0
- package/packages/kanban/tsconfig.json +13 -0
- package/packages/list/index.tsx +152 -0
- package/packages/list/node_modules/.bin/tsc +21 -0
- package/packages/list/node_modules/.bin/tsserver +21 -0
- package/packages/list/package.json +19 -0
- package/packages/list/tsconfig.json +13 -0
- package/packages/love-ui/components/alert.tsx +95 -0
- package/packages/love-ui/components/auth-layout.tsx +11 -0
- package/packages/love-ui/components/avatar.tsx +87 -0
- package/packages/love-ui/components/badge.tsx +82 -0
- package/packages/love-ui/components/button.tsx +204 -0
- package/packages/love-ui/components/checkbox.tsx +157 -0
- package/packages/love-ui/components/combobox.tsx +188 -0
- package/packages/love-ui/components/description-list.tsx +37 -0
- package/packages/love-ui/components/dialog.tsx +86 -0
- package/packages/love-ui/components/divider.tsx +20 -0
- package/packages/love-ui/components/dropdown.tsx +183 -0
- package/packages/love-ui/components/fieldset.tsx +91 -0
- package/packages/love-ui/components/heading.tsx +27 -0
- package/packages/love-ui/components/input.tsx +92 -0
- package/packages/love-ui/components/link.tsx +21 -0
- package/packages/love-ui/components/listbox.tsx +177 -0
- package/packages/love-ui/components/navbar.tsx +96 -0
- package/packages/love-ui/components/pagination.tsx +98 -0
- package/packages/love-ui/components/password-input.tsx +38 -0
- package/packages/love-ui/components/radio.tsx +142 -0
- package/packages/love-ui/components/select.tsx +68 -0
- package/packages/love-ui/components/sidebar-layout.tsx +82 -0
- package/packages/love-ui/components/sidebar.tsx +169 -0
- package/packages/love-ui/components/stacked-layout.tsx +117 -0
- package/packages/love-ui/components/switch.tsx +195 -0
- package/packages/love-ui/components/table.tsx +124 -0
- package/packages/love-ui/components/text.tsx +40 -0
- package/packages/love-ui/components/textarea.tsx +54 -0
- package/packages/love-ui/index.ts +28 -0
- package/packages/love-ui/node_modules/.bin/tsc +21 -0
- package/packages/love-ui/node_modules/.bin/tsserver +21 -0
- package/packages/love-ui/tsconfig.json +13 -0
- package/packages/marquee/index.tsx +59 -0
- package/packages/marquee/node_modules/.bin/tsc +21 -0
- package/packages/marquee/node_modules/.bin/tsserver +21 -0
- package/packages/marquee/package.json +18 -0
- package/packages/marquee/tsconfig.json +13 -0
- package/packages/mini-calendar/index.tsx +230 -0
- package/packages/mini-calendar/node_modules/.bin/tsc +21 -0
- package/packages/mini-calendar/node_modules/.bin/tsserver +21 -0
- package/packages/mini-calendar/package.json +21 -0
- package/packages/mini-calendar/tsconfig.json +13 -0
- package/packages/patterns/accordion/form/accordion-form-1.tsx +83 -0
- package/packages/patterns/accordion/form/accordion-form-2.tsx +89 -0
- package/packages/patterns/accordion/multi-level/accordion-multi-level-1.tsx +83 -0
- package/packages/patterns/accordion/multi-level/accordion-multi-level-2.tsx +92 -0
- package/packages/patterns/accordion/multi-level/accordion-multi-level-3.tsx +89 -0
- package/packages/patterns/accordion/multi-level/accordion-multi-level-4.tsx +89 -0
- package/packages/patterns/accordion/standard/accordion-standard-1.tsx +43 -0
- package/packages/patterns/accordion/standard/accordion-standard-2.tsx +45 -0
- package/packages/patterns/accordion/standard/accordion-standard-3.tsx +52 -0
- package/packages/patterns/accordion/standard/accordion-standard-4.tsx +52 -0
- package/packages/patterns/accordion/standard/accordion-standard-5.tsx +59 -0
- package/packages/patterns/accordion/standard/accordion-standard-6.tsx +72 -0
- package/packages/patterns/accordion/standard/accordion-standard-7.tsx +79 -0
- package/packages/patterns/accordion/subtitle/accordion-subtitle-1.tsx +56 -0
- package/packages/patterns/accordion/subtitle/accordion-subtitle-2.tsx +66 -0
- package/packages/patterns/accordion/subtitle/accordion-subtitle-3.tsx +63 -0
- package/packages/patterns/accordion/subtitle/accordion-subtitle-4.tsx +66 -0
- package/packages/patterns/accordion/tabs/accordion-tabs-1.tsx +52 -0
- package/packages/patterns/accordion/tabs/accordion-tabs-2.tsx +43 -0
- package/packages/patterns/accordion/tabs/accordion-tabs-3.tsx +52 -0
- package/packages/patterns/accordion/tabs/accordion-tabs-4.tsx +45 -0
- package/packages/patterns/alert/error/alert-error-1.tsx +11 -0
- package/packages/patterns/alert/error/alert-error-2.tsx +14 -0
- package/packages/patterns/alert/error/alert-error-3.tsx +22 -0
- package/packages/patterns/alert/error/alert-error-4.tsx +27 -0
- package/packages/patterns/alert/error/alert-error-5.tsx +29 -0
- package/packages/patterns/alert/info/alert-info-1.tsx +11 -0
- package/packages/patterns/alert/info/alert-info-2.tsx +14 -0
- package/packages/patterns/alert/info/alert-info-3.tsx +26 -0
- package/packages/patterns/alert/info/alert-info-4.tsx +31 -0
- package/packages/patterns/alert/info/alert-info-5.tsx +34 -0
- package/packages/patterns/alert/standard/alert-standard-1.tsx +11 -0
- package/packages/patterns/alert/standard/alert-standard-2.tsx +14 -0
- package/packages/patterns/alert/standard/alert-standard-3.tsx +22 -0
- package/packages/patterns/alert/standard/alert-standard-4.tsx +27 -0
- package/packages/patterns/alert/standard/alert-standard-5.tsx +29 -0
- package/packages/patterns/alert/success/alert-success-1.tsx +11 -0
- package/packages/patterns/alert/success/alert-success-2.tsx +14 -0
- package/packages/patterns/alert/success/alert-success-3.tsx +26 -0
- package/packages/patterns/alert/success/alert-success-4.tsx +31 -0
- package/packages/patterns/alert/success/alert-success-5.tsx +33 -0
- package/packages/patterns/alert/warning/alert-warning-1.tsx +11 -0
- package/packages/patterns/alert/warning/alert-warning-2.tsx +14 -0
- package/packages/patterns/alert/warning/alert-warning-3.tsx +26 -0
- package/packages/patterns/alert/warning/alert-warning-4.tsx +32 -0
- package/packages/patterns/alert/warning/alert-warning-5.tsx +33 -0
- package/packages/patterns/alert-dialog/confirmation/alert-dialog-confirmation-1.tsx +37 -0
- package/packages/patterns/alert-dialog/confirmation/alert-dialog-confirmation-2.tsx +41 -0
- package/packages/patterns/alert-dialog/confirmation/alert-dialog-confirmation-3.tsx +43 -0
- package/packages/patterns/alert-dialog/confirmation/alert-dialog-confirmation-4.tsx +37 -0
- package/packages/patterns/alert-dialog/confirmation/alert-dialog-confirmation-5.tsx +36 -0
- package/packages/patterns/alert-dialog/confirmation/alert-dialog-confirmation-6.tsx +40 -0
- package/packages/patterns/alert-dialog/custom-actions/alert-dialog-custom-actions-1.tsx +41 -0
- package/packages/patterns/alert-dialog/custom-actions/alert-dialog-custom-actions-2.tsx +42 -0
- package/packages/patterns/alert-dialog/custom-actions/alert-dialog-custom-actions-3.tsx +41 -0
- package/packages/patterns/alert-dialog/custom-actions/alert-dialog-custom-actions-4.tsx +54 -0
- package/packages/patterns/alert-dialog/custom-actions/alert-dialog-custom-actions-5.tsx +40 -0
- package/packages/patterns/alert-dialog/destructive/alert-dialog-destructive-1.tsx +39 -0
- package/packages/patterns/alert-dialog/destructive/alert-dialog-destructive-2.tsx +43 -0
- package/packages/patterns/alert-dialog/destructive/alert-dialog-destructive-3.tsx +51 -0
- package/packages/patterns/alert-dialog/destructive/alert-dialog-destructive-4.tsx +46 -0
- package/packages/patterns/alert-dialog/destructive/alert-dialog-destructive-5.tsx +46 -0
- package/packages/patterns/alert-dialog/destructive/alert-dialog-destructive-6.tsx +46 -0
- package/packages/patterns/alert-dialog/destructive/alert-dialog-destructive-7.tsx +43 -0
- package/packages/patterns/alert-dialog/form/alert-dialog-form-1.tsx +47 -0
- package/packages/patterns/alert-dialog/form/alert-dialog-form-2.tsx +53 -0
- package/packages/patterns/alert-dialog/form/alert-dialog-form-3.tsx +64 -0
- package/packages/patterns/alert-dialog/form/alert-dialog-form-4.tsx +47 -0
- package/packages/patterns/alert-dialog/form/alert-dialog-form-5.tsx +55 -0
- package/packages/patterns/alert-dialog/form/alert-dialog-form-6.tsx +69 -0
- package/packages/patterns/alert-dialog/form/alert-dialog-form-7.tsx +73 -0
- package/packages/patterns/alert-dialog/informational/alert-dialog-informational-1.tsx +35 -0
- package/packages/patterns/alert-dialog/informational/alert-dialog-informational-2.tsx +39 -0
- package/packages/patterns/alert-dialog/informational/alert-dialog-informational-3.tsx +48 -0
- package/packages/patterns/alert-dialog/informational/alert-dialog-informational-4.tsx +41 -0
- package/packages/patterns/alert-dialog/informational/alert-dialog-informational-5.tsx +42 -0
- package/packages/patterns/alert-dialog/informational/alert-dialog-informational-6.tsx +43 -0
- package/packages/patterns/alert-dialog/informational/alert-dialog-informational-7.tsx +58 -0
- package/packages/patterns/alert-dialog/success/alert-dialog-success-1.tsx +34 -0
- package/packages/patterns/alert-dialog/success/alert-dialog-success-2.tsx +39 -0
- package/packages/patterns/alert-dialog/success/alert-dialog-success-3.tsx +39 -0
- package/packages/patterns/alert-dialog/success/alert-dialog-success-4.tsx +52 -0
- package/packages/patterns/alert-dialog/success/alert-dialog-success-5.tsx +50 -0
- package/packages/patterns/alert-dialog/success/alert-dialog-success-6.tsx +41 -0
- package/packages/patterns/alert-dialog/success/alert-dialog-success-7.tsx +44 -0
- package/packages/patterns/aspect-ratio/standard/aspect-ratio-standard-1.tsx +15 -0
- package/packages/patterns/aspect-ratio/standard/aspect-ratio-standard-2.tsx +15 -0
- package/packages/patterns/aspect-ratio/standard/aspect-ratio-standard-3.tsx +15 -0
- package/packages/patterns/aspect-ratio/standard/aspect-ratio-standard-4.tsx +15 -0
- package/packages/patterns/aspect-ratio/standard/aspect-ratio-standard-5.tsx +15 -0
- package/packages/patterns/aspect-ratio/standard/aspect-ratio-standard-6.tsx +15 -0
- package/packages/patterns/aspect-ratio/standard/aspect-ratio-standard-7.tsx +15 -0
- package/packages/patterns/avatar/square/avatar-square-1.tsx +15 -0
- package/packages/patterns/avatar/square/avatar-square-2.tsx +11 -0
- package/packages/patterns/avatar/square/avatar-square-3.tsx +14 -0
- package/packages/patterns/avatar/square/avatar-square-4.tsx +18 -0
- package/packages/patterns/avatar/square/avatar-square-5.tsx +18 -0
- package/packages/patterns/avatar/square/avatar-square-6.tsx +21 -0
- package/packages/patterns/avatar/square/avatar-square-7.tsx +20 -0
- package/packages/patterns/avatar/standard/avatar-standard-1.tsx +15 -0
- package/packages/patterns/avatar/standard/avatar-standard-2.tsx +11 -0
- package/packages/patterns/avatar/standard/avatar-standard-3.tsx +14 -0
- package/packages/patterns/avatar/standard/avatar-standard-4.tsx +18 -0
- package/packages/patterns/avatar/standard/avatar-standard-5.tsx +18 -0
- package/packages/patterns/avatar/standard/avatar-standard-6.tsx +21 -0
- package/packages/patterns/avatar/standard/avatar-standard-7.tsx +20 -0
- package/packages/patterns/badge/destructive/badge-destructive-1.tsx +7 -0
- package/packages/patterns/badge/destructive/badge-destructive-2.tsx +13 -0
- package/packages/patterns/badge/destructive/badge-destructive-3.tsx +13 -0
- package/packages/patterns/badge/destructive/badge-destructive-4.tsx +13 -0
- package/packages/patterns/badge/destructive/badge-destructive-5.tsx +14 -0
- package/packages/patterns/badge/outline/badge-outline-1.tsx +7 -0
- package/packages/patterns/badge/outline/badge-outline-2.tsx +13 -0
- package/packages/patterns/badge/outline/badge-outline-3.tsx +13 -0
- package/packages/patterns/badge/outline/badge-outline-4.tsx +13 -0
- package/packages/patterns/badge/outline/badge-outline-5.tsx +14 -0
- package/packages/patterns/badge/secondary/badge-secondary-1.tsx +7 -0
- package/packages/patterns/badge/secondary/badge-secondary-2.tsx +13 -0
- package/packages/patterns/badge/secondary/badge-secondary-3.tsx +13 -0
- package/packages/patterns/badge/secondary/badge-secondary-4.tsx +13 -0
- package/packages/patterns/badge/secondary/badge-secondary-5.tsx +14 -0
- package/packages/patterns/badge/standard/badge-standard-1.tsx +7 -0
- package/packages/patterns/badge/standard/badge-standard-2.tsx +13 -0
- package/packages/patterns/badge/standard/badge-standard-3.tsx +13 -0
- package/packages/patterns/badge/standard/badge-standard-4.tsx +13 -0
- package/packages/patterns/badge/standard/badge-standard-5.tsx +11 -0
- package/packages/patterns/breadcrumb/home-icon/breadcrumb-home-icon-1.tsx +38 -0
- package/packages/patterns/breadcrumb/home-icon/breadcrumb-home-icon-2.tsx +52 -0
- package/packages/patterns/breadcrumb/home-icon/breadcrumb-home-icon-3.tsx +42 -0
- package/packages/patterns/breadcrumb/home-icon/breadcrumb-home-icon-4.tsx +33 -0
- package/packages/patterns/breadcrumb/home-icon/breadcrumb-home-icon-5.tsx +33 -0
- package/packages/patterns/breadcrumb/home-icon/breadcrumb-home-icon-6.tsx +37 -0
- package/packages/patterns/breadcrumb/home-icon/breadcrumb-home-icon-7.tsx +49 -0
- package/packages/patterns/breadcrumb/standard/breadcrumb-standard-1.tsx +35 -0
- package/packages/patterns/breadcrumb/standard/breadcrumb-standard-2.tsx +50 -0
- package/packages/patterns/breadcrumb/standard/breadcrumb-standard-3.tsx +43 -0
- package/packages/patterns/breadcrumb/standard/breadcrumb-standard-4.tsx +30 -0
- package/packages/patterns/breadcrumb/standard/breadcrumb-standard-5.tsx +30 -0
- package/packages/patterns/breadcrumb/standard/breadcrumb-standard-6.tsx +35 -0
- package/packages/patterns/breadcrumb/standard/breadcrumb-standard-7.tsx +46 -0
- package/packages/patterns/button/destructive/button-destructive-1.tsx +7 -0
- package/packages/patterns/button/destructive/button-destructive-2.tsx +13 -0
- package/packages/patterns/button/destructive/button-destructive-3.tsx +13 -0
- package/packages/patterns/button/destructive/button-destructive-4.tsx +11 -0
- package/packages/patterns/button/destructive/button-destructive-5.tsx +13 -0
- package/packages/patterns/button/destructive/button-destructive-6.tsx +15 -0
- package/packages/patterns/button/destructive/button-destructive-7.tsx +13 -0
- package/packages/patterns/button/link/button-link-1.tsx +7 -0
- package/packages/patterns/button/link/button-link-2.tsx +13 -0
- package/packages/patterns/button/link/button-link-3.tsx +13 -0
- package/packages/patterns/button/link/button-link-4.tsx +11 -0
- package/packages/patterns/button/link/button-link-5.tsx +13 -0
- package/packages/patterns/button/link/button-link-6.tsx +15 -0
- package/packages/patterns/button/link/button-link-7.tsx +13 -0
- package/packages/patterns/button/outline/button-outline-1.tsx +7 -0
- package/packages/patterns/button/outline/button-outline-2.tsx +13 -0
- package/packages/patterns/button/outline/button-outline-3.tsx +13 -0
- package/packages/patterns/button/outline/button-outline-4.tsx +11 -0
- package/packages/patterns/button/outline/button-outline-5.tsx +13 -0
- package/packages/patterns/button/outline/button-outline-6.tsx +15 -0
- package/packages/patterns/button/outline/button-outline-7.tsx +13 -0
- package/packages/patterns/button/secondary/button-secondary-1.tsx +7 -0
- package/packages/patterns/button/secondary/button-secondary-2.tsx +13 -0
- package/packages/patterns/button/secondary/button-secondary-3.tsx +13 -0
- package/packages/patterns/button/secondary/button-secondary-4.tsx +11 -0
- package/packages/patterns/button/secondary/button-secondary-5.tsx +13 -0
- package/packages/patterns/button/secondary/button-secondary-6.tsx +15 -0
- package/packages/patterns/button/secondary/button-secondary-7.tsx +13 -0
- package/packages/patterns/button/standard/button-standard-1.tsx +7 -0
- package/packages/patterns/button/standard/button-standard-2.tsx +13 -0
- package/packages/patterns/button/standard/button-standard-3.tsx +13 -0
- package/packages/patterns/button/standard/button-standard-4.tsx +7 -0
- package/packages/patterns/button/standard/button-standard-5.tsx +13 -0
- package/packages/patterns/button/standard/button-standard-6.tsx +15 -0
- package/packages/patterns/button/standard/button-standard-7.tsx +13 -0
- package/packages/patterns/button-group/actions/button-group-actions-1.tsx +37 -0
- package/packages/patterns/button-group/actions/button-group-actions-2.tsx +44 -0
- package/packages/patterns/button-group/actions/button-group-actions-3.tsx +46 -0
- package/packages/patterns/button-group/actions/button-group-actions-4.tsx +41 -0
- package/packages/patterns/button-group/advanced/button-group-advanced-1.tsx +54 -0
- package/packages/patterns/button-group/advanced/button-group-advanced-2.tsx +49 -0
- package/packages/patterns/button-group/advanced/button-group-advanced-3.tsx +55 -0
- package/packages/patterns/button-group/advanced/button-group-advanced-4.tsx +78 -0
- package/packages/patterns/button-group/badges/button-group-badges-1.tsx +28 -0
- package/packages/patterns/button-group/badges/button-group-badges-2.tsx +32 -0
- package/packages/patterns/button-group/badges/button-group-badges-3.tsx +32 -0
- package/packages/patterns/button-group/badges/button-group-badges-4.tsx +39 -0
- package/packages/patterns/button-group/display/button-group-display-1.tsx +68 -0
- package/packages/patterns/button-group/display/button-group-display-2.tsx +67 -0
- package/packages/patterns/button-group/display/button-group-display-3.tsx +85 -0
- package/packages/patterns/button-group/display/button-group-display-4.tsx +78 -0
- package/packages/patterns/button-group/forms/button-group-forms-1.tsx +78 -0
- package/packages/patterns/button-group/forms/button-group-forms-2.tsx +78 -0
- package/packages/patterns/button-group/forms/button-group-forms-3.tsx +71 -0
- package/packages/patterns/button-group/forms/button-group-forms-4.tsx +60 -0
- package/packages/patterns/button-group/interactive/button-group-interactive-1.tsx +68 -0
- package/packages/patterns/button-group/interactive/button-group-interactive-2.tsx +79 -0
- package/packages/patterns/button-group/interactive/button-group-interactive-3.tsx +82 -0
- package/packages/patterns/button-group/interactive/button-group-interactive-4.tsx +79 -0
- package/packages/patterns/button-group/media/button-group-media-1.tsx +66 -0
- package/packages/patterns/button-group/media/button-group-media-2.tsx +62 -0
- package/packages/patterns/button-group/media/button-group-media-3.tsx +67 -0
- package/packages/patterns/button-group/media/button-group-media-4.tsx +62 -0
- package/packages/patterns/button-group/navigation/button-group-navigation-1.tsx +76 -0
- package/packages/patterns/button-group/navigation/button-group-navigation-2.tsx +70 -0
- package/packages/patterns/button-group/navigation/button-group-navigation-3.tsx +73 -0
- package/packages/patterns/button-group/patterns/button-group-patterns-1.tsx +73 -0
- package/packages/patterns/button-group/patterns/button-group-patterns-2.tsx +60 -0
- package/packages/patterns/button-group/patterns/button-group-patterns-3.tsx +79 -0
- package/packages/patterns/button-group/patterns/button-group-patterns-4.tsx +53 -0
- package/packages/patterns/button-group/standard/button-group-standard-1.tsx +32 -0
- package/packages/patterns/button-group/standard/button-group-standard-2.tsx +30 -0
- package/packages/patterns/button-group/standard/button-group-standard-3.tsx +20 -0
- package/packages/patterns/button-group/standard/button-group-standard-4.tsx +39 -0
- package/packages/patterns/calendar/dialog/calendar-dialog-1.tsx +58 -0
- package/packages/patterns/calendar/dialog/calendar-dialog-2.tsx +97 -0
- package/packages/patterns/calendar/dialog/calendar-dialog-3.tsx +78 -0
- package/packages/patterns/calendar/dialog/calendar-dialog-4.tsx +62 -0
- package/packages/patterns/calendar/dialog/calendar-dialog-5.tsx +82 -0
- package/packages/patterns/calendar/dialog/calendar-dialog-6.tsx +63 -0
- package/packages/patterns/calendar/dialog/calendar-dialog-7.tsx +59 -0
- package/packages/patterns/calendar/dialog/calendar-dialog-8.tsx +78 -0
- package/packages/patterns/calendar/standard/calendar-standard-1.tsx +40 -0
- package/packages/patterns/calendar/standard/calendar-standard-2.tsx +77 -0
- package/packages/patterns/calendar/standard/calendar-standard-3.tsx +59 -0
- package/packages/patterns/calendar/standard/calendar-standard-4.tsx +44 -0
- package/packages/patterns/calendar/standard/calendar-standard-5.tsx +65 -0
- package/packages/patterns/calendar/standard/calendar-standard-6.tsx +45 -0
- package/packages/patterns/calendar/standard/calendar-standard-7.tsx +41 -0
- package/packages/patterns/calendar/standard/calendar-standard-8.tsx +60 -0
- package/packages/patterns/card/standard/card-standard-1.tsx +29 -0
- package/packages/patterns/card/standard/card-standard-2.tsx +72 -0
- package/packages/patterns/card/standard/card-standard-3.tsx +57 -0
- package/packages/patterns/card/standard/card-standard-4.tsx +56 -0
- package/packages/patterns/carousel/standard/carousel-standard-1.tsx +35 -0
- package/packages/patterns/carousel/standard/carousel-standard-2.tsx +65 -0
- package/packages/patterns/carousel/standard/carousel-standard-3.tsx +80 -0
- package/packages/patterns/carousel/standard/carousel-standard-4.tsx +50 -0
- package/packages/patterns/chart/area/chart-area-axes.tsx +76 -0
- package/packages/patterns/chart/area/chart-area-default.tsx +65 -0
- package/packages/patterns/chart/area/chart-area-gradient.tsx +101 -0
- package/packages/patterns/chart/area/chart-area-icons.tsx +84 -0
- package/packages/patterns/chart/area/chart-area-interactive.tsx +206 -0
- package/packages/patterns/chart/area/chart-area-legend.tsx +81 -0
- package/packages/patterns/chart/area/chart-area-linear.tsx +64 -0
- package/packages/patterns/chart/area/chart-area-stacked-expand.tsx +92 -0
- package/packages/patterns/chart/area/chart-area-stacked.tsx +78 -0
- package/packages/patterns/chart/area/chart-area-step.tsx +67 -0
- package/packages/patterns/chart/bar/chart-bar-active.tsx +86 -0
- package/packages/patterns/chart/bar/chart-bar-default.tsx +52 -0
- package/packages/patterns/chart/bar/chart-bar-horizontal.tsx +60 -0
- package/packages/patterns/chart/bar/chart-bar-interactive.tsx +176 -0
- package/packages/patterns/chart/bar/chart-bar-label-custom.tsx +96 -0
- package/packages/patterns/chart/bar/chart-bar-label.tsx +65 -0
- package/packages/patterns/chart/bar/chart-bar-mixed.tsx +80 -0
- package/packages/patterns/chart/bar/chart-bar-multiple.tsx +57 -0
- package/packages/patterns/chart/bar/chart-bar-negative.tsx +52 -0
- package/packages/patterns/chart/bar/chart-bar-stacked.tsx +67 -0
- package/packages/patterns/chart/line/chart-line-default.tsx +65 -0
- package/packages/patterns/chart/line/chart-line-dots-colors.tsx +93 -0
- package/packages/patterns/chart/line/chart-line-dots-custom.tsx +83 -0
- package/packages/patterns/chart/line/chart-line-dots.tsx +74 -0
- package/packages/patterns/chart/line/chart-line-interactive.tsx +182 -0
- package/packages/patterns/chart/line/chart-line-label-custom.tsx +100 -0
- package/packages/patterns/chart/line/chart-line-label.tsx +82 -0
- package/packages/patterns/chart/line/chart-line-linear.tsx +65 -0
- package/packages/patterns/chart/line/chart-line-multiple.tsx +73 -0
- package/packages/patterns/chart/line/chart-line-step.tsx +65 -0
- package/packages/patterns/chart/pie/chart-pie-donut-active.tsx +76 -0
- package/packages/patterns/chart/pie/chart-pie-donut-text.tsx +101 -0
- package/packages/patterns/chart/pie/chart-pie-donut.tsx +70 -0
- package/packages/patterns/chart/pie/chart-pie-interactive.tsx +125 -0
- package/packages/patterns/chart/pie/chart-pie-label-custom.tsx +82 -0
- package/packages/patterns/chart/pie/chart-pie-label-list.tsx +74 -0
- package/packages/patterns/chart/pie/chart-pie-label.tsx +62 -0
- package/packages/patterns/chart/pie/chart-pie-legend.tsx +65 -0
- package/packages/patterns/chart/pie/chart-pie-separator-none.tsx +65 -0
- package/packages/patterns/chart/pie/chart-pie-simple.tsx +65 -0
- package/packages/patterns/chart/pie/chart-pie-stacked.tsx +94 -0
- package/packages/patterns/chart/radar/chart-radar-default.tsx +50 -0
- package/packages/patterns/chart/radar/chart-radar-dots.tsx +54 -0
- package/packages/patterns/chart/radar/chart-radar-grid-circle-fill.tsx +53 -0
- package/packages/patterns/chart/radar/chart-radar-grid-circle-no-lines.tsx +57 -0
- package/packages/patterns/chart/radar/chart-radar-grid-circle.tsx +57 -0
- package/packages/patterns/chart/radar/chart-radar-grid-custom.tsx +53 -0
- package/packages/patterns/chart/radar/chart-radar-grid-fill.tsx +53 -0
- package/packages/patterns/chart/radar/chart-radar-grid-none.tsx +56 -0
- package/packages/patterns/chart/radar/chart-radar-icons.tsx +70 -0
- package/packages/patterns/chart/radar/chart-radar-label-custom.tsx +95 -0
- package/packages/patterns/chart/radar/chart-radar-legend.tsx +67 -0
- package/packages/patterns/chart/radar/chart-radar-lines-only.tsx +66 -0
- package/packages/patterns/chart/radar/chart-radar-multiple.tsx +58 -0
- package/packages/patterns/chart/radar/chart-radar-radius.tsx +63 -0
- package/packages/patterns/chart/radial/chart-radial-grid.tsx +66 -0
- package/packages/patterns/chart/radial/chart-radial-label.tsx +78 -0
- package/packages/patterns/chart/radial/chart-radial-shape.tsx +85 -0
- package/packages/patterns/chart/radial/chart-radial-simple.tsx +65 -0
- package/packages/patterns/chart/radial/chart-radial-stacked.tsx +88 -0
- package/packages/patterns/chart/radial/chart-radial-text.tsx +86 -0
- package/packages/patterns/chart/tooltip/chart-tooltip-advanced.tsx +107 -0
- package/packages/patterns/chart/tooltip/chart-tooltip-default.tsx +74 -0
- package/packages/patterns/chart/tooltip/chart-tooltip-formatter.tsx +86 -0
- package/packages/patterns/chart/tooltip/chart-tooltip-icons.tsx +74 -0
- package/packages/patterns/chart/tooltip/chart-tooltip-indicator-line.tsx +74 -0
- package/packages/patterns/chart/tooltip/chart-tooltip-indicator-none.tsx +71 -0
- package/packages/patterns/chart/tooltip/chart-tooltip-label-custom.tsx +76 -0
- package/packages/patterns/chart/tooltip/chart-tooltip-label-formatter.tsx +81 -0
- package/packages/patterns/chart/tooltip/chart-tooltip-label-none.tsx +71 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-1.tsx +13 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-11.tsx +18 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-12.tsx +22 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-13.tsx +64 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-2.tsx +26 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-3.tsx +16 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-4.tsx +23 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-5.tsx +33 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-6.tsx +19 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-7.tsx +25 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-8.tsx +25 -0
- package/packages/patterns/checkbox/standard/checkbox-standard-9.tsx +23 -0
- package/packages/patterns/collapsible/card/collapsible-card-1.tsx +26 -0
- package/packages/patterns/collapsible/card/collapsible-card-2.tsx +27 -0
- package/packages/patterns/collapsible/card/collapsible-card-3.tsx +33 -0
- package/packages/patterns/collapsible/card/collapsible-card-4.tsx +27 -0
- package/packages/patterns/collapsible/card/collapsible-card-5.tsx +24 -0
- package/packages/patterns/collapsible/faq/collapsible-faq-1.tsx +26 -0
- package/packages/patterns/collapsible/faq/collapsible-faq-2.tsx +25 -0
- package/packages/patterns/collapsible/faq/collapsible-faq-3.tsx +23 -0
- package/packages/patterns/collapsible/faq/collapsible-faq-4.tsx +26 -0
- package/packages/patterns/collapsible/faq/collapsible-faq-5.tsx +30 -0
- package/packages/patterns/collapsible/outline/collapsible-outline-1.tsx +32 -0
- package/packages/patterns/collapsible/outline/collapsible-outline-2.tsx +30 -0
- package/packages/patterns/collapsible/outline/collapsible-outline-3.tsx +25 -0
- package/packages/patterns/collapsible/outline/collapsible-outline-4.tsx +30 -0
- package/packages/patterns/collapsible/sidebar/collapsible-sidebar-1.tsx +39 -0
- package/packages/patterns/collapsible/sidebar/collapsible-sidebar-2.tsx +40 -0
- package/packages/patterns/collapsible/sidebar/collapsible-sidebar-3.tsx +35 -0
- package/packages/patterns/collapsible/sidebar/collapsible-sidebar-4.tsx +32 -0
- package/packages/patterns/collapsible/standard/collapsible-standard-1.tsx +26 -0
- package/packages/patterns/collapsible/standard/collapsible-standard-2.tsx +23 -0
- package/packages/patterns/collapsible/standard/collapsible-standard-3.tsx +28 -0
- package/packages/patterns/collapsible/standard/collapsible-standard-4.tsx +25 -0
- package/packages/patterns/collapsible/standard/collapsible-standard-5.tsx +35 -0
- package/packages/patterns/combobox/custom-actions/combobox-custom-actions-1.tsx +108 -0
- package/packages/patterns/combobox/custom-actions/combobox-custom-actions-2.tsx +95 -0
- package/packages/patterns/combobox/custom-actions/combobox-custom-actions-3.tsx +115 -0
- package/packages/patterns/combobox/custom-actions/combobox-custom-actions-4.tsx +119 -0
- package/packages/patterns/combobox/custom-actions/combobox-custom-actions-5.tsx +118 -0
- package/packages/patterns/combobox/custom-actions/combobox-custom-actions-6.tsx +88 -0
- package/packages/patterns/combobox/custom-actions/combobox-custom-actions-7.tsx +94 -0
- package/packages/patterns/combobox/grouped/combobox-grouped-1.tsx +109 -0
- package/packages/patterns/combobox/grouped/combobox-grouped-2.tsx +134 -0
- package/packages/patterns/combobox/grouped/combobox-grouped-3.tsx +97 -0
- package/packages/patterns/combobox/grouped/combobox-grouped-4.tsx +105 -0
- package/packages/patterns/combobox/grouped/combobox-grouped-5.tsx +118 -0
- package/packages/patterns/combobox/grouped/combobox-grouped-6.tsx +117 -0
- package/packages/patterns/combobox/grouped/combobox-grouped-7.tsx +116 -0
- package/packages/patterns/combobox/multi-select/combobox-multi-select-1.tsx +117 -0
- package/packages/patterns/combobox/multi-select/combobox-multi-select-2.tsx +109 -0
- package/packages/patterns/combobox/multi-select/combobox-multi-select-3.tsx +96 -0
- package/packages/patterns/combobox/multi-select/combobox-multi-select-4.tsx +83 -0
- package/packages/patterns/combobox/multi-select/combobox-multi-select-5.tsx +104 -0
- package/packages/patterns/combobox/multi-select/combobox-multi-select-6.tsx +109 -0
- package/packages/patterns/combobox/multi-select/combobox-multi-select-7.tsx +102 -0
- package/packages/patterns/combobox/rich-content/combobox-rich-content-1.tsx +114 -0
- package/packages/patterns/combobox/rich-content/combobox-rich-content-2.tsx +98 -0
- package/packages/patterns/combobox/rich-content/combobox-rich-content-3.tsx +94 -0
- package/packages/patterns/combobox/rich-content/combobox-rich-content-4.tsx +119 -0
- package/packages/patterns/combobox/rich-content/combobox-rich-content-5.tsx +102 -0
- package/packages/patterns/combobox/rich-content/combobox-rich-content-6.tsx +95 -0
- package/packages/patterns/combobox/rich-content/combobox-rich-content-7.tsx +114 -0
- package/packages/patterns/combobox/standard/combobox-standard-1.tsx +82 -0
- package/packages/patterns/combobox/standard/combobox-standard-2.tsx +82 -0
- package/packages/patterns/combobox/standard/combobox-standard-3.tsx +96 -0
- package/packages/patterns/combobox/standard/combobox-standard-4.tsx +85 -0
- package/packages/patterns/combobox/standard/combobox-standard-5.tsx +85 -0
- package/packages/patterns/combobox/standard/combobox-standard-6.tsx +81 -0
- package/packages/patterns/combobox/standard/combobox-standard-7.tsx +84 -0
- package/packages/patterns/combobox/with-states/combobox-with-states-1.tsx +91 -0
- package/packages/patterns/combobox/with-states/combobox-with-states-2.tsx +100 -0
- package/packages/patterns/combobox/with-states/combobox-with-states-3.tsx +95 -0
- package/packages/patterns/combobox/with-states/combobox-with-states-4.tsx +84 -0
- package/packages/patterns/combobox/with-states/combobox-with-states-5.tsx +89 -0
- package/packages/patterns/combobox/with-states/combobox-with-states-6.tsx +86 -0
- package/packages/patterns/combobox/with-states/combobox-with-states-7.tsx +29 -0
- package/packages/patterns/command/dialog/command-dialog-1.tsx +37 -0
- package/packages/patterns/command/dialog/command-dialog-2.tsx +72 -0
- package/packages/patterns/command/dialog/command-dialog-3.tsx +66 -0
- package/packages/patterns/command/dialog/command-dialog-4.tsx +64 -0
- package/packages/patterns/command/dialog/command-dialog-5.tsx +65 -0
- package/packages/patterns/command/dialog/command-dialog-6.tsx +68 -0
- package/packages/patterns/command/dialog/command-dialog-7.tsx +62 -0
- package/packages/patterns/command/popover/command-popover-1.tsx +39 -0
- package/packages/patterns/command/popover/command-popover-2.tsx +74 -0
- package/packages/patterns/command/popover/command-popover-3.tsx +68 -0
- package/packages/patterns/command/popover/command-popover-4.tsx +66 -0
- package/packages/patterns/command/popover/command-popover-5.tsx +67 -0
- package/packages/patterns/command/popover/command-popover-6.tsx +70 -0
- package/packages/patterns/command/popover/command-popover-7.tsx +64 -0
- package/packages/patterns/command/standard/command-standard-1.tsx +26 -0
- package/packages/patterns/command/standard/command-standard-2.tsx +61 -0
- package/packages/patterns/command/standard/command-standard-3.tsx +55 -0
- package/packages/patterns/command/standard/command-standard-4.tsx +53 -0
- package/packages/patterns/command/standard/command-standard-5.tsx +54 -0
- package/packages/patterns/command/standard/command-standard-6.tsx +57 -0
- package/packages/patterns/command/standard/command-standard-7.tsx +43 -0
- package/packages/patterns/context-menu/canvas/context-menu-canvas-1.tsx +49 -0
- package/packages/patterns/context-menu/canvas/context-menu-canvas-2.tsx +78 -0
- package/packages/patterns/context-menu/canvas/context-menu-canvas-3.tsx +44 -0
- package/packages/patterns/context-menu/canvas/context-menu-canvas-4.tsx +46 -0
- package/packages/patterns/context-menu/canvas/context-menu-canvas-5.tsx +57 -0
- package/packages/patterns/context-menu/file/context-menu-file-1.tsx +45 -0
- package/packages/patterns/context-menu/file/context-menu-file-2.tsx +47 -0
- package/packages/patterns/context-menu/file/context-menu-file-3.tsx +56 -0
- package/packages/patterns/context-menu/file/context-menu-file-4.tsx +56 -0
- package/packages/patterns/context-menu/file/context-menu-file-5.tsx +42 -0
- package/packages/patterns/context-menu/standard/context-menu-standard-1.tsx +24 -0
- package/packages/patterns/context-menu/standard/context-menu-standard-2.tsx +47 -0
- package/packages/patterns/context-menu/standard/context-menu-standard-3.tsx +44 -0
- package/packages/patterns/context-menu/standard/context-menu-standard-4.tsx +45 -0
- package/packages/patterns/context-menu/standard/context-menu-standard-5.tsx +49 -0
- package/packages/patterns/context-menu/standard/context-menu-standard-6.tsx +38 -0
- package/packages/patterns/context-menu/standard/context-menu-standard-7.tsx +79 -0
- package/packages/patterns/context-menu/table/context-menu-table-1.tsx +32 -0
- package/packages/patterns/context-menu/table/context-menu-table-2.tsx +46 -0
- package/packages/patterns/context-menu/table/context-menu-table-3.tsx +56 -0
- package/packages/patterns/context-menu/table/context-menu-table-4.tsx +49 -0
- package/packages/patterns/context-menu/table/context-menu-table-5.tsx +56 -0
- package/packages/patterns/context-menu/text/context-menu-text-1.tsx +40 -0
- package/packages/patterns/context-menu/text/context-menu-text-2.tsx +45 -0
- package/packages/patterns/context-menu/text/context-menu-text-3.tsx +54 -0
- package/packages/patterns/context-menu/text/context-menu-text-4.tsx +40 -0
- package/packages/patterns/context-menu/text/context-menu-text-5.tsx +63 -0
- package/packages/patterns/data-table/advanced/data-table-advanced-1.tsx +201 -0
- package/packages/patterns/data-table/advanced/data-table-advanced-2.tsx +212 -0
- package/packages/patterns/data-table/advanced/data-table-advanced-3.tsx +191 -0
- package/packages/patterns/data-table/advanced/data-table-advanced-4.tsx +189 -0
- package/packages/patterns/data-table/standard/data-table-standard-1.tsx +183 -0
- package/packages/patterns/data-table/standard/data-table-standard-2.tsx +180 -0
- package/packages/patterns/data-table/standard/data-table-standard-3.tsx +205 -0
- package/packages/patterns/data-table/standard/data-table-standard-4.tsx +212 -0
- package/packages/patterns/date-picker/standard/date-picker-standard-1.tsx +75 -0
- package/packages/patterns/date-picker/standard/date-picker-standard-2.tsx +103 -0
- package/packages/patterns/date-picker/standard/date-picker-standard-3.tsx +91 -0
- package/packages/patterns/date-picker/standard/date-picker-standard-4.tsx +73 -0
- package/packages/patterns/date-picker/standard/date-picker-standard-5.tsx +89 -0
- package/packages/patterns/date-picker/standard/date-picker-standard-6.tsx +69 -0
- package/packages/patterns/date-picker/standard/date-picker-standard-7.tsx +64 -0
- package/packages/patterns/date-picker/standard/date-picker-standard-8.tsx +84 -0
- package/packages/patterns/dialog/standard/dialog-standard-1.tsx +47 -0
- package/packages/patterns/dialog/standard/dialog-standard-10.tsx +84 -0
- package/packages/patterns/dialog/standard/dialog-standard-11.tsx +63 -0
- package/packages/patterns/dialog/standard/dialog-standard-12.tsx +70 -0
- package/packages/patterns/dialog/standard/dialog-standard-13.tsx +65 -0
- package/packages/patterns/dialog/standard/dialog-standard-14.tsx +109 -0
- package/packages/patterns/dialog/standard/dialog-standard-15.tsx +113 -0
- package/packages/patterns/dialog/standard/dialog-standard-16.tsx +127 -0
- package/packages/patterns/dialog/standard/dialog-standard-17.tsx +116 -0
- package/packages/patterns/dialog/standard/dialog-standard-2.tsx +72 -0
- package/packages/patterns/dialog/standard/dialog-standard-3.tsx +78 -0
- package/packages/patterns/dialog/standard/dialog-standard-4.tsx +98 -0
- package/packages/patterns/dialog/standard/dialog-standard-5.tsx +65 -0
- package/packages/patterns/dialog/standard/dialog-standard-6.tsx +42 -0
- package/packages/patterns/dialog/standard/dialog-standard-7.tsx +46 -0
- package/packages/patterns/dialog/standard/dialog-standard-8.tsx +84 -0
- package/packages/patterns/dialog/standard/dialog-standard-9.tsx +70 -0
- package/packages/patterns/drawer/bottom/drawer-bottom-1.tsx +44 -0
- package/packages/patterns/drawer/bottom/drawer-bottom-2.tsx +55 -0
- package/packages/patterns/drawer/bottom/drawer-bottom-3.tsx +68 -0
- package/packages/patterns/drawer/bottom/drawer-bottom-4.tsx +49 -0
- package/packages/patterns/drawer/bottom/drawer-bottom-5.tsx +72 -0
- package/packages/patterns/drawer/bottom/drawer-bottom-6.tsx +40 -0
- package/packages/patterns/drawer/bottom/drawer-bottom-7.tsx +69 -0
- package/packages/patterns/drawer/left/drawer-left-1.tsx +46 -0
- package/packages/patterns/drawer/left/drawer-left-2.tsx +53 -0
- package/packages/patterns/drawer/left/drawer-left-3.tsx +123 -0
- package/packages/patterns/drawer/left/drawer-left-4.tsx +58 -0
- package/packages/patterns/drawer/left/drawer-left-5.tsx +131 -0
- package/packages/patterns/drawer/right/drawer-right-1.tsx +45 -0
- package/packages/patterns/drawer/right/drawer-right-2.tsx +107 -0
- package/packages/patterns/drawer/right/drawer-right-3.tsx +84 -0
- package/packages/patterns/drawer/right/drawer-right-4.tsx +98 -0
- package/packages/patterns/drawer/right/drawer-right-5.tsx +108 -0
- package/packages/patterns/drawer/top/drawer-top-1.tsx +44 -0
- package/packages/patterns/drawer/top/drawer-top-2.tsx +62 -0
- package/packages/patterns/drawer/top/drawer-top-3.tsx +50 -0
- package/packages/patterns/drawer/top/drawer-top-4.tsx +63 -0
- package/packages/patterns/drawer/top/drawer-top-5.tsx +59 -0
- package/packages/patterns/dropdown-menu/actions/dropdown-menu-actions-1.tsx +63 -0
- package/packages/patterns/dropdown-menu/actions/dropdown-menu-actions-2.tsx +61 -0
- package/packages/patterns/dropdown-menu/actions/dropdown-menu-actions-3.tsx +83 -0
- package/packages/patterns/dropdown-menu/actions/dropdown-menu-actions-4.tsx +68 -0
- package/packages/patterns/dropdown-menu/actions/dropdown-menu-actions-5.tsx +78 -0
- package/packages/patterns/dropdown-menu/editor/dropdown-menu-editor-1.tsx +61 -0
- package/packages/patterns/dropdown-menu/editor/dropdown-menu-editor-2.tsx +81 -0
- package/packages/patterns/dropdown-menu/editor/dropdown-menu-editor-3.tsx +58 -0
- package/packages/patterns/dropdown-menu/editor/dropdown-menu-editor-4.tsx +53 -0
- package/packages/patterns/dropdown-menu/editor/dropdown-menu-editor-5.tsx +65 -0
- package/packages/patterns/dropdown-menu/profile/dropdown-menu-profile-1.tsx +61 -0
- package/packages/patterns/dropdown-menu/profile/dropdown-menu-profile-2.tsx +75 -0
- package/packages/patterns/dropdown-menu/profile/dropdown-menu-profile-3.tsx +99 -0
- package/packages/patterns/dropdown-menu/profile/dropdown-menu-profile-4.tsx +87 -0
- package/packages/patterns/dropdown-menu/profile/dropdown-menu-profile-5.tsx +85 -0
- package/packages/patterns/dropdown-menu/settings/dropdown-menu-settings-1.tsx +50 -0
- package/packages/patterns/dropdown-menu/settings/dropdown-menu-settings-2.tsx +75 -0
- package/packages/patterns/dropdown-menu/settings/dropdown-menu-settings-3.tsx +70 -0
- package/packages/patterns/dropdown-menu/settings/dropdown-menu-settings-4.tsx +82 -0
- package/packages/patterns/dropdown-menu/settings/dropdown-menu-settings-5.tsx +74 -0
- package/packages/patterns/dropdown-menu/standard/dropdown-menu-standard-1.tsx +48 -0
- package/packages/patterns/dropdown-menu/standard/dropdown-menu-standard-2.tsx +71 -0
- package/packages/patterns/dropdown-menu/standard/dropdown-menu-standard-3.tsx +68 -0
- package/packages/patterns/dropdown-menu/standard/dropdown-menu-standard-4.tsx +56 -0
- package/packages/patterns/dropdown-menu/standard/dropdown-menu-standard-5.tsx +43 -0
- package/packages/patterns/dropdown-menu/standard/dropdown-menu-standard-6.tsx +72 -0
- package/packages/patterns/dropdown-menu/standard/dropdown-menu-standard-7.tsx +99 -0
- package/packages/patterns/dropdown-menu/support/dropdown-menu-support-1.tsx +52 -0
- package/packages/patterns/dropdown-menu/support/dropdown-menu-support-2.tsx +64 -0
- package/packages/patterns/dropdown-menu/support/dropdown-menu-support-3.tsx +77 -0
- package/packages/patterns/empty/actions/empty-actions-1.tsx +36 -0
- package/packages/patterns/empty/actions/empty-actions-2.tsx +42 -0
- package/packages/patterns/empty/actions/empty-actions-3.tsx +36 -0
- package/packages/patterns/empty/actions/empty-actions-4.tsx +37 -0
- package/packages/patterns/empty/actions/empty-actions-5.tsx +40 -0
- package/packages/patterns/empty/data/empty-data-1.tsx +37 -0
- package/packages/patterns/empty/data/empty-data-2.tsx +29 -0
- package/packages/patterns/empty/data/empty-data-3.tsx +28 -0
- package/packages/patterns/empty/data/empty-data-4.tsx +36 -0
- package/packages/patterns/empty/data/empty-data-5.tsx +43 -0
- package/packages/patterns/empty/search/empty-search-1.tsx +28 -0
- package/packages/patterns/empty/search/empty-search-2.tsx +33 -0
- package/packages/patterns/empty/search/empty-search-3.tsx +33 -0
- package/packages/patterns/empty/search/empty-search-4.tsx +29 -0
- package/packages/patterns/empty/search/empty-search-5.tsx +40 -0
- package/packages/patterns/empty/standard/empty-standard-1.tsx +24 -0
- package/packages/patterns/empty/standard/empty-standard-2.tsx +28 -0
- package/packages/patterns/empty/standard/empty-standard-3.tsx +29 -0
- package/packages/patterns/empty/standard/empty-standard-4.tsx +28 -0
- package/packages/patterns/empty/standard/empty-standard-5.tsx +31 -0
- package/packages/patterns/empty/standard/empty-standard-6.tsx +23 -0
- package/packages/patterns/empty/standard/empty-standard-7.tsx +29 -0
- package/packages/patterns/field/advanced/field-advanced-1.tsx +32 -0
- package/packages/patterns/field/advanced/field-advanced-2.tsx +34 -0
- package/packages/patterns/field/advanced/field-advanced-3.tsx +53 -0
- package/packages/patterns/field/advanced/field-advanced-4.tsx +55 -0
- package/packages/patterns/field/advanced/field-advanced-5.tsx +57 -0
- package/packages/patterns/field/advanced/field-advanced-6.tsx +71 -0
- package/packages/patterns/field/advanced/field-advanced-7.tsx +59 -0
- package/packages/patterns/field/basic-inputs/field-basic-inputs-1.tsx +20 -0
- package/packages/patterns/field/basic-inputs/field-basic-inputs-2.tsx +23 -0
- package/packages/patterns/field/basic-inputs/field-basic-inputs-3.tsx +21 -0
- package/packages/patterns/field/basic-inputs/field-basic-inputs-4.tsx +42 -0
- package/packages/patterns/field/basic-inputs/field-basic-inputs-5.tsx +22 -0
- package/packages/patterns/field/layouts/field-layouts-1.tsx +41 -0
- package/packages/patterns/field/layouts/field-layouts-2.tsx +44 -0
- package/packages/patterns/field/layouts/field-layouts-3.tsx +33 -0
- package/packages/patterns/field/layouts/field-layouts-4.tsx +62 -0
- package/packages/patterns/field/layouts/field-layouts-5.tsx +64 -0
- package/packages/patterns/field/layouts/field-layouts-6.tsx +51 -0
- package/packages/patterns/field/selects/field-selects-1.tsx +32 -0
- package/packages/patterns/field/selects/field-selects-2.tsx +36 -0
- package/packages/patterns/field/selects/field-selects-3.tsx +43 -0
- package/packages/patterns/field/selects/field-selects-4.tsx +49 -0
- package/packages/patterns/field/selects/field-selects-5.tsx +34 -0
- package/packages/patterns/field/selects/field-selects-6.tsx +30 -0
- package/packages/patterns/field/selects/field-selects-7.tsx +32 -0
- package/packages/patterns/field/text-areas/field-text-areas-1.tsx +19 -0
- package/packages/patterns/field/text-areas/field-text-areas-2.tsx +23 -0
- package/packages/patterns/field/text-areas/field-text-areas-3.tsx +34 -0
- package/packages/patterns/field/text-areas/field-text-areas-4.tsx +23 -0
- package/packages/patterns/field/text-areas/field-text-areas-5.tsx +42 -0
- package/packages/patterns/field/text-areas/field-text-areas-6.tsx +24 -0
- package/packages/patterns/field/toggles/field-toggles-1.tsx +17 -0
- package/packages/patterns/field/toggles/field-toggles-2.tsx +50 -0
- package/packages/patterns/field/toggles/field-toggles-3.tsx +40 -0
- package/packages/patterns/field/toggles/field-toggles-4.tsx +42 -0
- package/packages/patterns/field/toggles/field-toggles-5.tsx +15 -0
- package/packages/patterns/field/toggles/field-toggles-6.tsx +26 -0
- package/packages/patterns/field/toggles/field-toggles-7.tsx +28 -0
- package/packages/patterns/form/advanced/form-advanced-1.tsx +83 -0
- package/packages/patterns/form/advanced/form-advanced-2.tsx +75 -0
- package/packages/patterns/form/advanced/form-advanced-3.tsx +114 -0
- package/packages/patterns/form/advanced/form-advanced-4.tsx +91 -0
- package/packages/patterns/form/advanced/form-advanced-5.tsx +121 -0
- package/packages/patterns/form/advanced/form-advanced-6.tsx +163 -0
- package/packages/patterns/form/advanced/form-advanced-7.tsx +182 -0
- package/packages/patterns/form/basic-forms/form-basic-forms-1.tsx +69 -0
- package/packages/patterns/form/basic-forms/form-basic-forms-2.tsx +70 -0
- package/packages/patterns/form/basic-forms/form-basic-forms-3.tsx +70 -0
- package/packages/patterns/form/basic-forms/form-basic-forms-4.tsx +75 -0
- package/packages/patterns/form/basic-forms/form-basic-forms-5.tsx +70 -0
- package/packages/patterns/form/basic-forms/form-basic-forms-6.tsx +70 -0
- package/packages/patterns/form/basic-forms/form-basic-forms-7.tsx +70 -0
- package/packages/patterns/form/layouts/form-layouts-1.tsx +113 -0
- package/packages/patterns/form/layouts/form-layouts-2.tsx +89 -0
- package/packages/patterns/form/layouts/form-layouts-3.tsx +166 -0
- package/packages/patterns/form/layouts/form-layouts-4.tsx +129 -0
- package/packages/patterns/form/layouts/form-layouts-5.tsx +69 -0
- package/packages/patterns/form/layouts/form-layouts-6.tsx +85 -0
- package/packages/patterns/form/layouts/form-layouts-7.tsx +166 -0
- package/packages/patterns/form/multi-field/form-multi-field-1.tsx +90 -0
- package/packages/patterns/form/multi-field/form-multi-field-2.tsx +114 -0
- package/packages/patterns/form/multi-field/form-multi-field-3.tsx +132 -0
- package/packages/patterns/form/multi-field/form-multi-field-4.tsx +131 -0
- package/packages/patterns/form/multi-field/form-multi-field-5.tsx +154 -0
- package/packages/patterns/form/multi-field/form-multi-field-6.tsx +159 -0
- package/packages/patterns/form/multi-field/form-multi-field-7.tsx +232 -0
- package/packages/patterns/form/patterns/form-patterns-1.tsx +110 -0
- package/packages/patterns/form/patterns/form-patterns-2.tsx +160 -0
- package/packages/patterns/form/patterns/form-patterns-3.tsx +160 -0
- package/packages/patterns/form/patterns/form-patterns-4.tsx +159 -0
- package/packages/patterns/form/patterns/form-patterns-5.tsx +222 -0
- package/packages/patterns/form/patterns/form-patterns-6.tsx +258 -0
- package/packages/patterns/form/patterns/form-patterns-7.tsx +249 -0
- package/packages/patterns/form/validation/form-validation-1.tsx +94 -0
- package/packages/patterns/form/validation/form-validation-2.tsx +93 -0
- package/packages/patterns/form/validation/form-validation-3.tsx +100 -0
- package/packages/patterns/form/validation/form-validation-4.tsx +106 -0
- package/packages/patterns/form/validation/form-validation-5.tsx +126 -0
- package/packages/patterns/form/validation/form-validation-6.tsx +126 -0
- package/packages/patterns/form/validation/form-validation-7.tsx +96 -0
- package/packages/patterns/hover-card/info/hover-card-info-1.tsx +29 -0
- package/packages/patterns/hover-card/info/hover-card-info-2.tsx +35 -0
- package/packages/patterns/hover-card/info/hover-card-info-3.tsx +38 -0
- package/packages/patterns/hover-card/info/hover-card-info-4.tsx +37 -0
- package/packages/patterns/hover-card/info/hover-card-info-5.tsx +46 -0
- package/packages/patterns/hover-card/preview/hover-card-preview-1.tsx +44 -0
- package/packages/patterns/hover-card/preview/hover-card-preview-2.tsx +48 -0
- package/packages/patterns/hover-card/preview/hover-card-preview-3.tsx +40 -0
- package/packages/patterns/hover-card/preview/hover-card-preview-4.tsx +51 -0
- package/packages/patterns/hover-card/preview/hover-card-preview-5.tsx +48 -0
- package/packages/patterns/hover-card/profile/hover-card-profile-1.tsx +36 -0
- package/packages/patterns/hover-card/profile/hover-card-profile-2.tsx +50 -0
- package/packages/patterns/hover-card/profile/hover-card-profile-3.tsx +45 -0
- package/packages/patterns/hover-card/profile/hover-card-profile-4.tsx +50 -0
- package/packages/patterns/hover-card/profile/hover-card-profile-5.tsx +54 -0
- package/packages/patterns/hover-card/stats/hover-card-stats-1.tsx +45 -0
- package/packages/patterns/hover-card/stats/hover-card-stats-2.tsx +50 -0
- package/packages/patterns/hover-card/stats/hover-card-stats-3.tsx +53 -0
- package/packages/patterns/hover-card/stats/hover-card-stats-4.tsx +56 -0
- package/packages/patterns/hover-card/stats/hover-card-stats-5.tsx +54 -0
- package/packages/patterns/input/special/input-special-1.tsx +65 -0
- package/packages/patterns/input/special/input-special-2.tsx +19 -0
- package/packages/patterns/input/special/input-special-3.tsx +35 -0
- package/packages/patterns/input/special/input-special-4.tsx +24 -0
- package/packages/patterns/input/special/input-special-5.tsx +27 -0
- package/packages/patterns/input/standard/input-standard-1.tsx +15 -0
- package/packages/patterns/input/standard/input-standard-2.tsx +18 -0
- package/packages/patterns/input/standard/input-standard-3.tsx +23 -0
- package/packages/patterns/input/standard/input-standard-4.tsx +23 -0
- package/packages/patterns/input/standard/input-standard-5.tsx +24 -0
- package/packages/patterns/input/standard/input-standard-6.tsx +33 -0
- package/packages/patterns/input/standard/input-standard-7.tsx +22 -0
- package/packages/patterns/input/types/input-types-1.tsx +24 -0
- package/packages/patterns/input/types/input-types-2.tsx +42 -0
- package/packages/patterns/input/types/input-types-3.tsx +47 -0
- package/packages/patterns/input/types/input-types-4.tsx +24 -0
- package/packages/patterns/input/types/input-types-5.tsx +19 -0
- package/packages/patterns/input/types/input-types-6.tsx +25 -0
- package/packages/patterns/input/types/input-types-7.tsx +25 -0
- package/packages/patterns/input/validation/input-validation-1.tsx +27 -0
- package/packages/patterns/input/validation/input-validation-2.tsx +25 -0
- package/packages/patterns/input/validation/input-validation-3.tsx +26 -0
- package/packages/patterns/input/validation/input-validation-4.tsx +37 -0
- package/packages/patterns/input/validation/input-validation-5.tsx +54 -0
- package/packages/patterns/input-group/ai/input-group-ai-1.tsx +68 -0
- package/packages/patterns/input-group/ai/input-group-ai-2.tsx +42 -0
- package/packages/patterns/input-group/ai/input-group-ai-3.tsx +60 -0
- package/packages/patterns/input-group/ai/input-group-ai-4.tsx +61 -0
- package/packages/patterns/input-group/buttons/input-group-buttons-1.tsx +34 -0
- package/packages/patterns/input-group/buttons/input-group-buttons-2.tsx +39 -0
- package/packages/patterns/input-group/buttons/input-group-buttons-3.tsx +23 -0
- package/packages/patterns/input-group/buttons/input-group-buttons-4.tsx +42 -0
- package/packages/patterns/input-group/custom/input-group-custom-1.tsx +24 -0
- package/packages/patterns/input-group/custom/input-group-custom-2.tsx +31 -0
- package/packages/patterns/input-group/custom/input-group-custom-3.tsx +38 -0
- package/packages/patterns/input-group/custom/input-group-custom-4.tsx +33 -0
- package/packages/patterns/input-group/dropdown/input-group-dropdown-1.tsx +37 -0
- package/packages/patterns/input-group/dropdown/input-group-dropdown-2.tsx +37 -0
- package/packages/patterns/input-group/dropdown/input-group-dropdown-3.tsx +56 -0
- package/packages/patterns/input-group/dropdown/input-group-dropdown-4.tsx +45 -0
- package/packages/patterns/input-group/icons/input-group-icons-1.tsx +19 -0
- package/packages/patterns/input-group/icons/input-group-icons-2.tsx +27 -0
- package/packages/patterns/input-group/icons/input-group-icons-3.tsx +33 -0
- package/packages/patterns/input-group/icons/input-group-icons-4.tsx +36 -0
- package/packages/patterns/input-group/label/input-group-label-1.tsx +27 -0
- package/packages/patterns/input-group/label/input-group-label-2.tsx +43 -0
- package/packages/patterns/input-group/label/input-group-label-3.tsx +36 -0
- package/packages/patterns/input-group/label/input-group-label-4.tsx +23 -0
- package/packages/patterns/input-group/spinner/input-group-spinner-1.tsx +27 -0
- package/packages/patterns/input-group/spinner/input-group-spinner-2.tsx +21 -0
- package/packages/patterns/input-group/spinner/input-group-spinner-3.tsx +25 -0
- package/packages/patterns/input-group/spinner/input-group-spinner-4.tsx +32 -0
- package/packages/patterns/input-group/text/input-group-text-1.tsx +33 -0
- package/packages/patterns/input-group/text/input-group-text-2.tsx +22 -0
- package/packages/patterns/input-group/text/input-group-text-3.tsx +19 -0
- package/packages/patterns/input-group/text/input-group-text-4.tsx +19 -0
- package/packages/patterns/input-group/textarea/input-group-textarea-1.tsx +37 -0
- package/packages/patterns/input-group/textarea/input-group-textarea-2.tsx +23 -0
- package/packages/patterns/input-group/textarea/input-group-textarea-3.tsx +43 -0
- package/packages/patterns/input-group/textarea/input-group-textarea-4.tsx +31 -0
- package/packages/patterns/input-group/tooltip/input-group-tooltip-1.tsx +54 -0
- package/packages/patterns/input-group/tooltip/input-group-tooltip-2.tsx +34 -0
- package/packages/patterns/input-group/tooltip/input-group-tooltip-3.tsx +34 -0
- package/packages/patterns/input-otp/behavior/input-otp-behavior-1.tsx +90 -0
- package/packages/patterns/input-otp/behavior/input-otp-behavior-2.tsx +46 -0
- package/packages/patterns/input-otp/behavior/input-otp-behavior-3.tsx +59 -0
- package/packages/patterns/input-otp/behavior/input-otp-behavior-4.tsx +70 -0
- package/packages/patterns/input-otp/standard/input-otp-standard-1.tsx +26 -0
- package/packages/patterns/input-otp/standard/input-otp-standard-2.tsx +25 -0
- package/packages/patterns/input-otp/standard/input-otp-standard-3.tsx +29 -0
- package/packages/patterns/input-otp/standard/input-otp-standard-4.tsx +42 -0
- package/packages/patterns/input-otp/standard/input-otp-standard-5.tsx +83 -0
- package/packages/patterns/input-otp/states/input-otp-states-1.tsx +29 -0
- package/packages/patterns/input-otp/states/input-otp-states-2.tsx +54 -0
- package/packages/patterns/input-otp/states/input-otp-states-3.tsx +51 -0
- package/packages/patterns/input-otp/states/input-otp-states-4.tsx +59 -0
- package/packages/patterns/input-otp/use-cases/input-otp-use-cases-1.tsx +106 -0
- package/packages/patterns/input-otp/use-cases/input-otp-use-cases-2.tsx +137 -0
- package/packages/patterns/input-otp/use-cases/input-otp-use-cases-3.tsx +128 -0
- package/packages/patterns/input-otp/use-cases/input-otp-use-cases-4.tsx +115 -0
- package/packages/patterns/input-otp/variants/input-otp-variants-1.tsx +34 -0
- package/packages/patterns/input-otp/variants/input-otp-variants-2.tsx +58 -0
- package/packages/patterns/input-otp/variants/input-otp-variants-3.tsx +60 -0
- package/packages/patterns/item/interactive/item-interactive-1.tsx +43 -0
- package/packages/patterns/item/interactive/item-interactive-2.tsx +70 -0
- package/packages/patterns/item/layout/item-layout-1.tsx +45 -0
- package/packages/patterns/item/layout/item-layout-2.tsx +65 -0
- package/packages/patterns/item/layout/item-layout-3.tsx +55 -0
- package/packages/patterns/item/media/item-media-1.tsx +35 -0
- package/packages/patterns/item/media/item-media-2.tsx +42 -0
- package/packages/patterns/item/media/item-media-3.tsx +71 -0
- package/packages/patterns/item/standard/item-standard-1.tsx +30 -0
- package/packages/patterns/item/standard/item-standard-2.tsx +30 -0
- package/packages/patterns/kbd/arrow-keys/kbd-arrow-keys-1.tsx +18 -0
- package/packages/patterns/kbd/arrow-keys/kbd-arrow-keys-2.tsx +14 -0
- package/packages/patterns/kbd/arrow-keys/kbd-arrow-keys-3.tsx +18 -0
- package/packages/patterns/kbd/arrow-keys/kbd-arrow-keys-4.tsx +16 -0
- package/packages/patterns/kbd/function-keys/kbd-function-keys-1.tsx +11 -0
- package/packages/patterns/kbd/function-keys/kbd-function-keys-2.tsx +11 -0
- package/packages/patterns/kbd/function-keys/kbd-function-keys-3.tsx +15 -0
- package/packages/patterns/kbd/function-keys/kbd-function-keys-4.tsx +15 -0
- package/packages/patterns/kbd/function-keys/kbd-function-keys-5.tsx +15 -0
- package/packages/patterns/kbd/function-keys/kbd-function-keys-6.tsx +16 -0
- package/packages/patterns/kbd/platform-specific/kbd-platform-specific-1.tsx +14 -0
- package/packages/patterns/kbd/platform-specific/kbd-platform-specific-2.tsx +14 -0
- package/packages/patterns/kbd/platform-specific/kbd-platform-specific-3.tsx +14 -0
- package/packages/patterns/kbd/platform-specific/kbd-platform-specific-4.tsx +22 -0
- package/packages/patterns/kbd/platform-specific/kbd-platform-specific-5.tsx +14 -0
- package/packages/patterns/kbd/pressed-state/kbd-pressed-state-1.tsx +14 -0
- package/packages/patterns/kbd/pressed-state/kbd-pressed-state-2.tsx +11 -0
- package/packages/patterns/kbd/pressed-state/kbd-pressed-state-3.tsx +16 -0
- package/packages/patterns/kbd/pressed-state/kbd-pressed-state-4.tsx +14 -0
- package/packages/patterns/kbd/pressed-state/kbd-pressed-state-5.tsx +18 -0
- package/packages/patterns/kbd/sequence/kbd-sequence-1.tsx +18 -0
- package/packages/patterns/kbd/sequence/kbd-sequence-2.tsx +15 -0
- package/packages/patterns/kbd/sequence/kbd-sequence-3.tsx +21 -0
- package/packages/patterns/kbd/sequence/kbd-sequence-4.tsx +15 -0
- package/packages/patterns/kbd/shortcut/kbd-shortcut-1.tsx +14 -0
- package/packages/patterns/kbd/shortcut/kbd-shortcut-2.tsx +14 -0
- package/packages/patterns/kbd/shortcut/kbd-shortcut-3.tsx +14 -0
- package/packages/patterns/kbd/shortcut/kbd-shortcut-4.tsx +15 -0
- package/packages/patterns/kbd/shortcut/kbd-shortcut-5.tsx +14 -0
- package/packages/patterns/kbd/sizes/kbd-sizes-1.tsx +14 -0
- package/packages/patterns/kbd/sizes/kbd-sizes-2.tsx +14 -0
- package/packages/patterns/kbd/sizes/kbd-sizes-3.tsx +14 -0
- package/packages/patterns/kbd/sizes/kbd-sizes-4.tsx +13 -0
- package/packages/patterns/kbd/sizes/kbd-sizes-5.tsx +14 -0
- package/packages/patterns/kbd/with-icons/kbd-with-icons-1.tsx +17 -0
- package/packages/patterns/kbd/with-icons/kbd-with-icons-2.tsx +17 -0
- package/packages/patterns/kbd/with-icons/kbd-with-icons-3.tsx +25 -0
- package/packages/patterns/kbd/with-icons/kbd-with-icons-4.tsx +17 -0
- package/packages/patterns/kbd/with-icons/kbd-with-icons-5.tsx +15 -0
- package/packages/patterns/label/standard/label-standard-1.tsx +11 -0
- package/packages/patterns/label/standard/label-standard-2.tsx +14 -0
- package/packages/patterns/label/standard/label-standard-3.tsx +26 -0
- package/packages/patterns/label/standard/label-standard-4.tsx +15 -0
- package/packages/patterns/label/standard/label-standard-5.tsx +12 -0
- package/packages/patterns/label/standard/label-standard-6.tsx +12 -0
- package/packages/patterns/label/standard/label-standard-7.tsx +12 -0
- package/packages/patterns/label/standard/label-standard-8.tsx +9 -0
- package/packages/patterns/menubar/standard/menubar-standard-1.tsx +24 -0
- package/packages/patterns/menubar/standard/menubar-standard-10.tsx +26 -0
- package/packages/patterns/menubar/standard/menubar-standard-2.tsx +34 -0
- package/packages/patterns/menubar/standard/menubar-standard-3.tsx +34 -0
- package/packages/patterns/menubar/standard/menubar-standard-4.tsx +24 -0
- package/packages/patterns/menubar/standard/menubar-standard-5.tsx +29 -0
- package/packages/patterns/menubar/standard/menubar-standard-6.tsx +34 -0
- package/packages/patterns/menubar/standard/menubar-standard-7.tsx +27 -0
- package/packages/patterns/menubar/standard/menubar-standard-8.tsx +63 -0
- package/packages/patterns/menubar/standard/menubar-standard-9.tsx +31 -0
- package/packages/patterns/navigation-menu/complex/navigation-menu-complex-1.tsx +238 -0
- package/packages/patterns/navigation-menu/complex/navigation-menu-complex-2.tsx +100 -0
- package/packages/patterns/navigation-menu/complex/navigation-menu-complex-3.tsx +151 -0
- package/packages/patterns/navigation-menu/complex/navigation-menu-complex-4.tsx +187 -0
- package/packages/patterns/navigation-menu/complex/navigation-menu-complex-5.tsx +168 -0
- package/packages/patterns/navigation-menu/features/navigation-menu-features-1.tsx +92 -0
- package/packages/patterns/navigation-menu/features/navigation-menu-features-2.tsx +118 -0
- package/packages/patterns/navigation-menu/features/navigation-menu-features-3.tsx +122 -0
- package/packages/patterns/navigation-menu/features/navigation-menu-features-4.tsx +101 -0
- package/packages/patterns/navigation-menu/features/navigation-menu-features-5.tsx +176 -0
- package/packages/patterns/navigation-menu/marketing/navigation-menu-marketing-1.tsx +107 -0
- package/packages/patterns/navigation-menu/marketing/navigation-menu-marketing-2.tsx +116 -0
- package/packages/patterns/navigation-menu/marketing/navigation-menu-marketing-3.tsx +119 -0
- package/packages/patterns/navigation-menu/marketing/navigation-menu-marketing-4.tsx +140 -0
- package/packages/patterns/navigation-menu/marketing/navigation-menu-marketing-5.tsx +107 -0
- package/packages/patterns/navigation-menu/standard/navigation-menu-standard-1.tsx +73 -0
- package/packages/patterns/navigation-menu/standard/navigation-menu-standard-2.tsx +51 -0
- package/packages/patterns/navigation-menu/standard/navigation-menu-standard-3.tsx +68 -0
- package/packages/patterns/navigation-menu/standard/navigation-menu-standard-4.tsx +60 -0
- package/packages/patterns/navigation-menu/standard/navigation-menu-standard-5.tsx +82 -0
- package/packages/patterns/node_modules/.bin/tsc +21 -0
- package/packages/patterns/node_modules/.bin/tsserver +21 -0
- package/packages/patterns/package.json +26 -0
- package/packages/patterns/pagination/advanced/pagination-advanced-1.tsx +43 -0
- package/packages/patterns/pagination/advanced/pagination-advanced-2.tsx +43 -0
- package/packages/patterns/pagination/advanced/pagination-advanced-3.tsx +49 -0
- package/packages/patterns/pagination/advanced/pagination-advanced-4.tsx +24 -0
- package/packages/patterns/pagination/advanced/pagination-advanced-5.tsx +39 -0
- package/packages/patterns/pagination/basic/pagination-basic-1.tsx +28 -0
- package/packages/patterns/pagination/basic/pagination-basic-2.tsx +34 -0
- package/packages/patterns/pagination/basic/pagination-basic-3.tsx +36 -0
- package/packages/patterns/pagination/basic/pagination-basic-4.tsx +35 -0
- package/packages/patterns/pagination/basic/pagination-basic-5.tsx +43 -0
- package/packages/patterns/pagination/navigation/pagination-navigation-1.tsx +24 -0
- package/packages/patterns/pagination/navigation/pagination-navigation-2.tsx +27 -0
- package/packages/patterns/pagination/navigation/pagination-navigation-3.tsx +32 -0
- package/packages/patterns/pagination/navigation/pagination-navigation-4.tsx +40 -0
- package/packages/patterns/pagination/sizes/pagination-sizes-1.tsx +40 -0
- package/packages/patterns/pagination/sizes/pagination-sizes-2.tsx +36 -0
- package/packages/patterns/pagination/sizes/pagination-sizes-3.tsx +40 -0
- package/packages/patterns/pagination/sizes/pagination-sizes-4.tsx +28 -0
- package/packages/patterns/pagination/sizes/pagination-sizes-5.tsx +28 -0
- package/packages/patterns/popover/standard/popover-standard-1.tsx +21 -0
- package/packages/patterns/popover/standard/popover-standard-10.tsx +30 -0
- package/packages/patterns/popover/standard/popover-standard-11.tsx +54 -0
- package/packages/patterns/popover/standard/popover-standard-12.tsx +51 -0
- package/packages/patterns/popover/standard/popover-standard-13.tsx +52 -0
- package/packages/patterns/popover/standard/popover-standard-14.tsx +49 -0
- package/packages/patterns/popover/standard/popover-standard-15.tsx +35 -0
- package/packages/patterns/popover/standard/popover-standard-2.tsx +24 -0
- package/packages/patterns/popover/standard/popover-standard-3.tsx +29 -0
- package/packages/patterns/popover/standard/popover-standard-4.tsx +26 -0
- package/packages/patterns/popover/standard/popover-standard-5.tsx +24 -0
- package/packages/patterns/popover/standard/popover-standard-6.tsx +25 -0
- package/packages/patterns/popover/standard/popover-standard-7.tsx +25 -0
- package/packages/patterns/popover/standard/popover-standard-8.tsx +26 -0
- package/packages/patterns/popover/standard/popover-standard-9.tsx +23 -0
- package/packages/patterns/progress/basic/progress-basic-1.tsx +7 -0
- package/packages/patterns/progress/basic/progress-basic-2.tsx +7 -0
- package/packages/patterns/progress/basic/progress-basic-3.tsx +7 -0
- package/packages/patterns/progress/basic/progress-basic-4.tsx +7 -0
- package/packages/patterns/progress/basic/progress-basic-5.tsx +7 -0
- package/packages/patterns/progress/colored/progress-colored-1.tsx +12 -0
- package/packages/patterns/progress/colored/progress-colored-2.tsx +12 -0
- package/packages/patterns/progress/colored/progress-colored-3.tsx +12 -0
- package/packages/patterns/progress/colored/progress-colored-4.tsx +12 -0
- package/packages/patterns/progress/colored/progress-colored-5.tsx +12 -0
- package/packages/patterns/progress/sizes/progress-sizes-1.tsx +7 -0
- package/packages/patterns/progress/sizes/progress-sizes-2.tsx +7 -0
- package/packages/patterns/progress/sizes/progress-sizes-3.tsx +7 -0
- package/packages/patterns/progress/sizes/progress-sizes-4.tsx +7 -0
- package/packages/patterns/progress/sizes/progress-sizes-5.tsx +7 -0
- package/packages/patterns/progress/with-label/progress-with-label-1.tsx +18 -0
- package/packages/patterns/progress/with-label/progress-with-label-2.tsx +15 -0
- package/packages/patterns/progress/with-label/progress-with-label-3.tsx +15 -0
- package/packages/patterns/progress/with-label/progress-with-label-4.tsx +23 -0
- package/packages/patterns/progress/with-label/progress-with-label-5.tsx +23 -0
- package/packages/patterns/radio-group/advanced/radio-group-advanced-1.tsx +39 -0
- package/packages/patterns/radio-group/advanced/radio-group-advanced-2.tsx +71 -0
- package/packages/patterns/radio-group/form/radio-group-form-1.tsx +83 -0
- package/packages/patterns/radio-group/form/radio-group-form-2.tsx +52 -0
- package/packages/patterns/radio-group/layout/radio-group-layout-1.tsx +23 -0
- package/packages/patterns/radio-group/layout/radio-group-layout-2.tsx +44 -0
- package/packages/patterns/radio-group/layout/radio-group-layout-3.tsx +35 -0
- package/packages/patterns/radio-group/standard/radio-group-standard-1.tsx +23 -0
- package/packages/patterns/radio-group/standard/radio-group-standard-2.tsx +38 -0
- package/packages/patterns/scroll-area/advanced/scroll-area-advanced-1.tsx +54 -0
- package/packages/patterns/scroll-area/advanced/scroll-area-advanced-2.tsx +54 -0
- package/packages/patterns/scroll-area/advanced/scroll-area-advanced-3.tsx +89 -0
- package/packages/patterns/scroll-area/layout/scroll-area-layout-1.tsx +37 -0
- package/packages/patterns/scroll-area/layout/scroll-area-layout-2.tsx +45 -0
- package/packages/patterns/scroll-area/layout/scroll-area-layout-3.tsx +99 -0
- package/packages/patterns/scroll-area/standard/scroll-area-standard-1.tsx +52 -0
- package/packages/patterns/scroll-area/standard/scroll-area-standard-2.tsx +56 -0
- package/packages/patterns/separator/basic/separator-basic-1.tsx +13 -0
- package/packages/patterns/separator/basic/separator-basic-2.tsx +15 -0
- package/packages/patterns/separator/basic/separator-basic-3.tsx +21 -0
- package/packages/patterns/separator/basic/separator-basic-4.tsx +19 -0
- package/packages/patterns/separator/basic/separator-basic-5.tsx +7 -0
- package/packages/patterns/separator/spacing/separator-spacing-1.tsx +13 -0
- package/packages/patterns/separator/spacing/separator-spacing-2.tsx +13 -0
- package/packages/patterns/separator/spacing/separator-spacing-3.tsx +13 -0
- package/packages/patterns/separator/spacing/separator-spacing-4.tsx +13 -0
- package/packages/patterns/separator/spacing/separator-spacing-5.tsx +13 -0
- package/packages/patterns/separator/styled/separator-styled-1.tsx +13 -0
- package/packages/patterns/separator/styled/separator-styled-2.tsx +13 -0
- package/packages/patterns/separator/styled/separator-styled-3.tsx +13 -0
- package/packages/patterns/separator/styled/separator-styled-4.tsx +11 -0
- package/packages/patterns/separator/styled/separator-styled-5.tsx +16 -0
- package/packages/patterns/separator/with-text/separator-with-text-1.tsx +17 -0
- package/packages/patterns/separator/with-text/separator-with-text-2.tsx +16 -0
- package/packages/patterns/separator/with-text/separator-with-text-3.tsx +14 -0
- package/packages/patterns/sheet/details/sheet-details-1.tsx +51 -0
- package/packages/patterns/sheet/details/sheet-details-2.tsx +56 -0
- package/packages/patterns/sheet/details/sheet-details-3.tsx +65 -0
- package/packages/patterns/sheet/details/sheet-details-4.tsx +45 -0
- package/packages/patterns/sheet/details/sheet-details-5.tsx +114 -0
- package/packages/patterns/sheet/form/sheet-form-1.tsx +46 -0
- package/packages/patterns/sheet/form/sheet-form-2.tsx +45 -0
- package/packages/patterns/sheet/form/sheet-form-3.tsx +60 -0
- package/packages/patterns/sheet/form/sheet-form-4.tsx +50 -0
- package/packages/patterns/sheet/form/sheet-form-5.tsx +50 -0
- package/packages/patterns/sheet/multi-section/sheet-multi-section-1.tsx +42 -0
- package/packages/patterns/sheet/multi-section/sheet-multi-section-2.tsx +79 -0
- package/packages/patterns/sheet/multi-section/sheet-multi-section-3.tsx +42 -0
- package/packages/patterns/sheet/multi-section/sheet-multi-section-4.tsx +50 -0
- package/packages/patterns/sheet/multi-section/sheet-multi-section-5.tsx +66 -0
- package/packages/patterns/sheet/navigation/sheet-navigation-1.tsx +39 -0
- package/packages/patterns/sheet/navigation/sheet-navigation-2.tsx +57 -0
- package/packages/patterns/sheet/navigation/sheet-navigation-3.tsx +73 -0
- package/packages/patterns/sheet/navigation/sheet-navigation-4.tsx +55 -0
- package/packages/patterns/sheet/navigation/sheet-navigation-5.tsx +46 -0
- package/packages/patterns/sheet/settings/sheet-settings-1.tsx +47 -0
- package/packages/patterns/sheet/settings/sheet-settings-2.tsx +47 -0
- package/packages/patterns/sheet/settings/sheet-settings-3.tsx +55 -0
- package/packages/patterns/sheet/settings/sheet-settings-4.tsx +62 -0
- package/packages/patterns/sheet/settings/sheet-settings-5.tsx +52 -0
- package/packages/patterns/sheet/standard/sheet-standard-1.tsx +29 -0
- package/packages/patterns/sheet/standard/sheet-standard-2.tsx +30 -0
- package/packages/patterns/sheet/standard/sheet-standard-3.tsx +29 -0
- package/packages/patterns/sheet/standard/sheet-standard-4.tsx +29 -0
- package/packages/patterns/skeleton/card/skeleton-card-1.tsx +13 -0
- package/packages/patterns/skeleton/card/skeleton-card-2.tsx +20 -0
- package/packages/patterns/skeleton/card/skeleton-card-3.tsx +21 -0
- package/packages/patterns/skeleton/card/skeleton-card-4.tsx +21 -0
- package/packages/patterns/skeleton/card/skeleton-card-5.tsx +20 -0
- package/packages/patterns/skeleton/content/skeleton-content-1.tsx +26 -0
- package/packages/patterns/skeleton/content/skeleton-content-2.tsx +30 -0
- package/packages/patterns/skeleton/content/skeleton-content-3.tsx +27 -0
- package/packages/patterns/skeleton/content/skeleton-content-4.tsx +31 -0
- package/packages/patterns/skeleton/content/skeleton-content-5.tsx +41 -0
- package/packages/patterns/skeleton/form/skeleton-form-1.tsx +22 -0
- package/packages/patterns/skeleton/form/skeleton-form-2.tsx +27 -0
- package/packages/patterns/skeleton/form/skeleton-form-3.tsx +35 -0
- package/packages/patterns/skeleton/form/skeleton-form-4.tsx +37 -0
- package/packages/patterns/skeleton/form/skeleton-form-5.tsx +28 -0
- package/packages/patterns/skeleton/list/skeleton-list-1.tsx +16 -0
- package/packages/patterns/skeleton/list/skeleton-list-2.tsx +19 -0
- package/packages/patterns/skeleton/list/skeleton-list-3.tsx +20 -0
- package/packages/patterns/skeleton/list/skeleton-list-4.tsx +21 -0
- package/packages/patterns/skeleton/list/skeleton-list-5.tsx +30 -0
- package/packages/patterns/skeleton/profile/skeleton-profile-1.tsx +19 -0
- package/packages/patterns/skeleton/profile/skeleton-profile-2.tsx +33 -0
- package/packages/patterns/skeleton/profile/skeleton-profile-3.tsx +27 -0
- package/packages/patterns/skeleton/profile/skeleton-profile-4.tsx +33 -0
- package/packages/patterns/skeleton/profile/skeleton-profile-5.tsx +22 -0
- package/packages/patterns/skeleton/table/skeleton-table-1.tsx +24 -0
- package/packages/patterns/skeleton/table/skeleton-table-2.tsx +29 -0
- package/packages/patterns/skeleton/table/skeleton-table-3.tsx +27 -0
- package/packages/patterns/skeleton/table/skeleton-table-4.tsx +42 -0
- package/packages/patterns/skeleton/table/skeleton-table-5.tsx +36 -0
- package/packages/patterns/slider/interactive/slider-interactive-1.tsx +38 -0
- package/packages/patterns/slider/interactive/slider-interactive-2.tsx +46 -0
- package/packages/patterns/slider/interactive/slider-interactive-3.tsx +38 -0
- package/packages/patterns/slider/interactive/slider-interactive-4.tsx +34 -0
- package/packages/patterns/slider/interactive/slider-interactive-5.tsx +33 -0
- package/packages/patterns/slider/range/slider-range-1.tsx +26 -0
- package/packages/patterns/slider/range/slider-range-2.tsx +30 -0
- package/packages/patterns/slider/range/slider-range-3.tsx +31 -0
- package/packages/patterns/slider/range/slider-range-4.tsx +39 -0
- package/packages/patterns/slider/range/slider-range-5.tsx +36 -0
- package/packages/patterns/slider/settings/slider-settings-1.tsx +27 -0
- package/packages/patterns/slider/settings/slider-settings-2.tsx +32 -0
- package/packages/patterns/slider/settings/slider-settings-3.tsx +38 -0
- package/packages/patterns/slider/settings/slider-settings-4.tsx +43 -0
- package/packages/patterns/slider/standard/slider-standard-1.tsx +18 -0
- package/packages/patterns/slider/standard/slider-standard-2.tsx +20 -0
- package/packages/patterns/slider/standard/slider-standard-3.tsx +23 -0
- package/packages/patterns/slider/standard/slider-standard-4.tsx +30 -0
- package/packages/patterns/slider/standard/slider-standard-5.tsx +37 -0
- package/packages/patterns/slider/styled/slider-styled-1.tsx +28 -0
- package/packages/patterns/slider/styled/slider-styled-2.tsx +28 -0
- package/packages/patterns/slider/styled/slider-styled-3.tsx +28 -0
- package/packages/patterns/slider/styled/slider-styled-4.tsx +28 -0
- package/packages/patterns/slider/styled/slider-styled-5.tsx +28 -0
- package/packages/patterns/slider/vertical/slider-vertical-1.tsx +27 -0
- package/packages/patterns/slider/vertical/slider-vertical-2.tsx +29 -0
- package/packages/patterns/slider/vertical/slider-vertical-3.tsx +36 -0
- package/packages/patterns/slider/vertical/slider-vertical-4.tsx +31 -0
- package/packages/patterns/slider/vertical/slider-vertical-5.tsx +37 -0
- package/packages/patterns/sonner/content/sonner-content-1.tsx +21 -0
- package/packages/patterns/sonner/content/sonner-content-2.tsx +23 -0
- package/packages/patterns/sonner/content/sonner-content-3.tsx +21 -0
- package/packages/patterns/sonner/content/sonner-content-4.tsx +22 -0
- package/packages/patterns/sonner/content/sonner-content-5.tsx +35 -0
- package/packages/patterns/sonner/interactive/sonner-interactive-1.tsx +24 -0
- package/packages/patterns/sonner/interactive/sonner-interactive-2.tsx +24 -0
- package/packages/patterns/sonner/interactive/sonner-interactive-3.tsx +28 -0
- package/packages/patterns/sonner/interactive/sonner-interactive-4.tsx +22 -0
- package/packages/patterns/sonner/position/sonner-position-1.tsx +21 -0
- package/packages/patterns/sonner/position/sonner-position-2.tsx +21 -0
- package/packages/patterns/sonner/position/sonner-position-3.tsx +21 -0
- package/packages/patterns/sonner/position/sonner-position-4.tsx +21 -0
- package/packages/patterns/sonner/position/sonner-position-5.tsx +21 -0
- package/packages/patterns/sonner/position/sonner-position-6.tsx +21 -0
- package/packages/patterns/sonner/promise/sonner-promise-1.tsx +28 -0
- package/packages/patterns/sonner/promise/sonner-promise-2.tsx +28 -0
- package/packages/patterns/sonner/promise/sonner-promise-3.tsx +28 -0
- package/packages/patterns/sonner/promise/sonner-promise-4.tsx +20 -0
- package/packages/patterns/sonner/standard/sonner-standard-1.tsx +14 -0
- package/packages/patterns/sonner/standard/sonner-standard-2.tsx +17 -0
- package/packages/patterns/sonner/standard/sonner-standard-3.tsx +14 -0
- package/packages/patterns/sonner/standard/sonner-standard-4.tsx +17 -0
- package/packages/patterns/sonner/standard/sonner-standard-5.tsx +17 -0
- package/packages/patterns/spinner/applications/spinner-applications-1.tsx +38 -0
- package/packages/patterns/spinner/applications/spinner-applications-2.tsx +34 -0
- package/packages/patterns/spinner/applications/spinner-applications-3.tsx +33 -0
- package/packages/patterns/spinner/button/spinner-button-1.tsx +13 -0
- package/packages/patterns/spinner/button/spinner-button-2.tsx +13 -0
- package/packages/patterns/spinner/button/spinner-button-3.tsx +12 -0
- package/packages/patterns/spinner/button/spinner-button-4.tsx +13 -0
- package/packages/patterns/spinner/button/spinner-button-5.tsx +13 -0
- package/packages/patterns/spinner/inline/spinner-inline-1.tsx +12 -0
- package/packages/patterns/spinner/inline/spinner-inline-2.tsx +12 -0
- package/packages/patterns/spinner/inline/spinner-inline-3.tsx +12 -0
- package/packages/patterns/spinner/inline/spinner-inline-4.tsx +21 -0
- package/packages/patterns/spinner/standard/spinner-standard-1.tsx +7 -0
- package/packages/patterns/spinner/standard/spinner-standard-2.tsx +7 -0
- package/packages/patterns/spinner/standard/spinner-standard-3.tsx +7 -0
- package/packages/patterns/spinner/standard/spinner-standard-4.tsx +7 -0
- package/packages/patterns/spinner/standard/spinner-standard-5.tsx +7 -0
- package/packages/patterns/switch/cards/switch-cards-1.tsx +27 -0
- package/packages/patterns/switch/cards/switch-cards-2.tsx +28 -0
- package/packages/patterns/switch/cards/switch-cards-3.tsx +35 -0
- package/packages/patterns/switch/cards/switch-cards-4.tsx +25 -0
- package/packages/patterns/switch/icons/switch-icons-1.tsx +16 -0
- package/packages/patterns/switch/icons/switch-icons-2.tsx +19 -0
- package/packages/patterns/switch/icons/switch-icons-3.tsx +16 -0
- package/packages/patterns/switch/labeled/switch-labeled-1.tsx +15 -0
- package/packages/patterns/switch/labeled/switch-labeled-2.tsx +14 -0
- package/packages/patterns/switch/labeled/switch-labeled-3.tsx +22 -0
- package/packages/patterns/switch/labeled/switch-labeled-4.tsx +20 -0
- package/packages/patterns/switch/square/switch-square-1.tsx +14 -0
- package/packages/patterns/switch/square/switch-square-2.tsx +36 -0
- package/packages/patterns/switch/square/switch-square-3.tsx +20 -0
- package/packages/patterns/switch/square/switch-square-4.tsx +27 -0
- package/packages/patterns/switch/standard/switch-standard-1.tsx +9 -0
- package/packages/patterns/switch/standard/switch-standard-2.tsx +9 -0
- package/packages/patterns/switch/standard/switch-standard-3.tsx +9 -0
- package/packages/patterns/switch/standard/switch-standard-4.tsx +9 -0
- package/packages/patterns/table/advanced/table-advanced-1.tsx +66 -0
- package/packages/patterns/table/advanced/table-advanced-2.tsx +86 -0
- package/packages/patterns/table/advanced/table-advanced-3.tsx +42 -0
- package/packages/patterns/table/advanced/table-advanced-4.tsx +114 -0
- package/packages/patterns/table/standard/table-standard-1.tsx +70 -0
- package/packages/patterns/table/standard/table-standard-2.tsx +75 -0
- package/packages/patterns/table/standard/table-standard-3.tsx +64 -0
- package/packages/patterns/table/standard/table-standard-4.tsx +73 -0
- package/packages/patterns/tabs/advanced/tabs-advanced-1.tsx +101 -0
- package/packages/patterns/tabs/advanced/tabs-advanced-2.tsx +118 -0
- package/packages/patterns/tabs/advanced/tabs-advanced-3.tsx +187 -0
- package/packages/patterns/tabs/content/tabs-content-1.tsx +85 -0
- package/packages/patterns/tabs/content/tabs-content-2.tsx +105 -0
- package/packages/patterns/tabs/content/tabs-content-3.tsx +149 -0
- package/packages/patterns/tabs/layout/tabs-layout-1.tsx +62 -0
- package/packages/patterns/tabs/layout/tabs-layout-2.tsx +60 -0
- package/packages/patterns/tabs/layout/tabs-layout-3.tsx +61 -0
- package/packages/patterns/tabs/standard/tabs-standard-1.tsx +52 -0
- package/packages/patterns/tabs/standard/tabs-standard-2.tsx +105 -0
- package/packages/patterns/textarea/form/textarea-form-1.tsx +20 -0
- package/packages/patterns/textarea/form/textarea-form-2.tsx +20 -0
- package/packages/patterns/textarea/form/textarea-form-3.tsx +22 -0
- package/packages/patterns/textarea/form/textarea-form-4.tsx +20 -0
- package/packages/patterns/textarea/form/textarea-form-5.tsx +31 -0
- package/packages/patterns/textarea/labeled/textarea-labeled-1.tsx +17 -0
- package/packages/patterns/textarea/labeled/textarea-labeled-2.tsx +18 -0
- package/packages/patterns/textarea/labeled/textarea-labeled-3.tsx +30 -0
- package/packages/patterns/textarea/labeled/textarea-labeled-4.tsx +20 -0
- package/packages/patterns/textarea/standard/textarea-standard-1.tsx +12 -0
- package/packages/patterns/textarea/standard/textarea-standard-2.tsx +13 -0
- package/packages/patterns/textarea/standard/textarea-standard-3.tsx +14 -0
- package/packages/patterns/textarea/standard/textarea-standard-4.tsx +13 -0
- package/packages/patterns/toggle/sizes/toggle-sizes-1.tsx +14 -0
- package/packages/patterns/toggle/sizes/toggle-sizes-2.tsx +14 -0
- package/packages/patterns/toggle/sizes/toggle-sizes-3.tsx +14 -0
- package/packages/patterns/toggle/standard/toggle-standard-1.tsx +14 -0
- package/packages/patterns/toggle/standard/toggle-standard-2.tsx +14 -0
- package/packages/patterns/toggle/standard/toggle-standard-3.tsx +14 -0
- package/packages/patterns/toggle/standard/toggle-standard-4.tsx +15 -0
- package/packages/patterns/toggle-group/sizes/toggle-group-sizes-1.tsx +22 -0
- package/packages/patterns/toggle-group/sizes/toggle-group-sizes-2.tsx +22 -0
- package/packages/patterns/toggle-group/sizes/toggle-group-sizes-3.tsx +22 -0
- package/packages/patterns/toggle-group/standard/toggle-group-standard-1.tsx +22 -0
- package/packages/patterns/toggle-group/standard/toggle-group-standard-2.tsx +22 -0
- package/packages/patterns/toggle-group/standard/toggle-group-standard-3.tsx +22 -0
- package/packages/patterns/toggle-group/standard/toggle-group-standard-4.tsx +22 -0
- package/packages/patterns/tooltip/content/tooltip-content-1.tsx +28 -0
- package/packages/patterns/tooltip/content/tooltip-content-2.tsx +27 -0
- package/packages/patterns/tooltip/content/tooltip-content-3.tsx +27 -0
- package/packages/patterns/tooltip/content/tooltip-content-4.tsx +36 -0
- package/packages/patterns/tooltip/standard/tooltip-standard-1.tsx +23 -0
- package/packages/patterns/tooltip/standard/tooltip-standard-2.tsx +49 -0
- package/packages/patterns/tooltip/standard/tooltip-standard-3.tsx +26 -0
- package/packages/patterns/tooltip/standard/tooltip-standard-4.tsx +25 -0
- package/packages/patterns/tsconfig.json +13 -0
- package/packages/pill/index.tsx +166 -0
- package/packages/pill/node_modules/.bin/tsc +21 -0
- package/packages/pill/node_modules/.bin/tsserver +21 -0
- package/packages/pill/package.json +18 -0
- package/packages/pill/tsconfig.json +13 -0
- package/packages/qr-code/index.tsx +88 -0
- package/packages/qr-code/node_modules/.bin/qrcode +21 -0
- package/packages/qr-code/node_modules/.bin/tsc +21 -0
- package/packages/qr-code/node_modules/.bin/tsserver +21 -0
- package/packages/qr-code/package.json +21 -0
- package/packages/qr-code/server.tsx +42 -0
- package/packages/qr-code/tsconfig.json +13 -0
- package/packages/rating/index.tsx +243 -0
- package/packages/rating/node_modules/.bin/tsc +21 -0
- package/packages/rating/node_modules/.bin/tsserver +21 -0
- package/packages/rating/package.json +19 -0
- package/packages/rating/tsconfig.json +13 -0
- package/packages/reel/index.tsx +745 -0
- package/packages/reel/node_modules/.bin/tsc +21 -0
- package/packages/reel/node_modules/.bin/tsserver +21 -0
- package/packages/reel/package.json +20 -0
- package/packages/reel/reel-controlled.tsx +327 -0
- package/packages/reel/tsconfig.json +13 -0
- package/packages/relative-time/index.tsx +181 -0
- package/packages/relative-time/node_modules/.bin/tsc +21 -0
- package/packages/relative-time/node_modules/.bin/tsserver +21 -0
- package/packages/relative-time/package.json +18 -0
- package/packages/relative-time/tsconfig.json +13 -0
- package/packages/sandbox/index.tsx +251 -0
- package/packages/sandbox/node_modules/.bin/tsc +21 -0
- package/packages/sandbox/node_modules/.bin/tsserver +21 -0
- package/packages/sandbox/package.json +18 -0
- package/packages/sandbox/tsconfig.json +13 -0
- package/packages/shadcn-ui/components/ui/accordion.tsx +66 -0
- package/packages/shadcn-ui/components/ui/alert-dialog.tsx +157 -0
- package/packages/shadcn-ui/components/ui/alert.tsx +66 -0
- package/packages/shadcn-ui/components/ui/aspect-ratio.tsx +11 -0
- package/packages/shadcn-ui/components/ui/avatar.tsx +53 -0
- package/packages/shadcn-ui/components/ui/badge.tsx +46 -0
- package/packages/shadcn-ui/components/ui/breadcrumb.tsx +109 -0
- package/packages/shadcn-ui/components/ui/button-group.tsx +83 -0
- package/packages/shadcn-ui/components/ui/button.tsx +60 -0
- package/packages/shadcn-ui/components/ui/calendar.tsx +213 -0
- package/packages/shadcn-ui/components/ui/card.tsx +92 -0
- package/packages/shadcn-ui/components/ui/carousel.tsx +241 -0
- package/packages/shadcn-ui/components/ui/chart.tsx +357 -0
- package/packages/shadcn-ui/components/ui/checkbox.tsx +32 -0
- package/packages/shadcn-ui/components/ui/collapsible.tsx +33 -0
- package/packages/shadcn-ui/components/ui/command.tsx +184 -0
- package/packages/shadcn-ui/components/ui/context-menu.tsx +252 -0
- package/packages/shadcn-ui/components/ui/dialog.tsx +143 -0
- package/packages/shadcn-ui/components/ui/drawer.tsx +135 -0
- package/packages/shadcn-ui/components/ui/dropdown-menu.tsx +257 -0
- package/packages/shadcn-ui/components/ui/empty.tsx +104 -0
- package/packages/shadcn-ui/components/ui/field.tsx +244 -0
- package/packages/shadcn-ui/components/ui/form.tsx +167 -0
- package/packages/shadcn-ui/components/ui/hover-card.tsx +44 -0
- package/packages/shadcn-ui/components/ui/input-group.tsx +170 -0
- package/packages/shadcn-ui/components/ui/input-otp.tsx +77 -0
- package/packages/shadcn-ui/components/ui/input.tsx +21 -0
- package/packages/shadcn-ui/components/ui/item.tsx +193 -0
- package/packages/shadcn-ui/components/ui/kbd.tsx +28 -0
- package/packages/shadcn-ui/components/ui/label.tsx +24 -0
- package/packages/shadcn-ui/components/ui/menubar.tsx +276 -0
- package/packages/shadcn-ui/components/ui/navigation-menu.tsx +168 -0
- package/packages/shadcn-ui/components/ui/pagination.tsx +127 -0
- package/packages/shadcn-ui/components/ui/popover.tsx +48 -0
- package/packages/shadcn-ui/components/ui/progress.tsx +31 -0
- package/packages/shadcn-ui/components/ui/radio-group.tsx +45 -0
- package/packages/shadcn-ui/components/ui/resizable.tsx +56 -0
- package/packages/shadcn-ui/components/ui/scroll-area.tsx +58 -0
- package/packages/shadcn-ui/components/ui/select.tsx +187 -0
- package/packages/shadcn-ui/components/ui/separator.tsx +28 -0
- package/packages/shadcn-ui/components/ui/sheet.tsx +139 -0
- package/packages/shadcn-ui/components/ui/sidebar.tsx +726 -0
- package/packages/shadcn-ui/components/ui/skeleton.tsx +13 -0
- package/packages/shadcn-ui/components/ui/slider.tsx +63 -0
- package/packages/shadcn-ui/components/ui/sonner.tsx +25 -0
- package/packages/shadcn-ui/components/ui/spinner.tsx +16 -0
- package/packages/shadcn-ui/components/ui/switch.tsx +31 -0
- package/packages/shadcn-ui/components/ui/table.tsx +116 -0
- package/packages/shadcn-ui/components/ui/tabs.tsx +66 -0
- package/packages/shadcn-ui/components/ui/textarea.tsx +18 -0
- package/packages/shadcn-ui/components/ui/toast.tsx +128 -0
- package/packages/shadcn-ui/components/ui/toaster.tsx +35 -0
- package/packages/shadcn-ui/components/ui/toggle-group.tsx +73 -0
- package/packages/shadcn-ui/components/ui/toggle.tsx +47 -0
- package/packages/shadcn-ui/components/ui/tooltip.tsx +61 -0
- package/packages/shadcn-ui/components.json +21 -0
- package/packages/shadcn-ui/hooks/use-mobile.ts +19 -0
- package/packages/shadcn-ui/hooks/use-mobile.tsx +19 -0
- package/packages/shadcn-ui/hooks/use-toast.ts +194 -0
- package/packages/shadcn-ui/lib/utils.ts +6 -0
- package/packages/shadcn-ui/package.json +33 -0
- package/packages/shadcn-ui/tsconfig.json +17 -0
- package/packages/snippet/index.tsx +123 -0
- package/packages/snippet/node_modules/.bin/tsc +21 -0
- package/packages/snippet/node_modules/.bin/tsserver +21 -0
- package/packages/snippet/package.json +17 -0
- package/packages/snippet/tsconfig.json +13 -0
- package/packages/spinner/index.tsx +271 -0
- package/packages/spinner/node_modules/.bin/tsc +21 -0
- package/packages/spinner/node_modules/.bin/tsserver +21 -0
- package/packages/spinner/package.json +18 -0
- package/packages/spinner/tsconfig.json +13 -0
- package/packages/status/index.tsx +62 -0
- package/packages/status/node_modules/.bin/tsc +21 -0
- package/packages/status/node_modules/.bin/tsserver +21 -0
- package/packages/status/package.json +17 -0
- package/packages/status/tsconfig.json +13 -0
- package/packages/stories/index.tsx +232 -0
- package/packages/stories/node_modules/.bin/tsc +21 -0
- package/packages/stories/node_modules/.bin/tsserver +21 -0
- package/packages/stories/package.json +17 -0
- package/packages/stories/tsconfig.json +13 -0
- package/packages/table/index.tsx +246 -0
- package/packages/table/node_modules/.bin/tsc +21 -0
- package/packages/table/node_modules/.bin/tsserver +21 -0
- package/packages/table/package.json +20 -0
- package/packages/table/tsconfig.json +13 -0
- package/packages/tags/index.tsx +221 -0
- package/packages/tags/node_modules/.bin/tsc +21 -0
- package/packages/tags/node_modules/.bin/tsserver +21 -0
- package/packages/tags/package.json +17 -0
- package/packages/tags/tsconfig.json +13 -0
- package/packages/theme-switcher/index.tsx +99 -0
- package/packages/theme-switcher/node_modules/.bin/tsc +21 -0
- package/packages/theme-switcher/node_modules/.bin/tsserver +21 -0
- package/packages/theme-switcher/package.json +20 -0
- package/packages/theme-switcher/tsconfig.json +13 -0
- package/packages/ticker/index.tsx +195 -0
- package/packages/ticker/node_modules/.bin/tsc +21 -0
- package/packages/ticker/node_modules/.bin/tsserver +21 -0
- package/packages/ticker/package.json +17 -0
- package/packages/ticker/tsconfig.json +13 -0
- package/packages/tree/index.tsx +445 -0
- package/packages/tree/node_modules/.bin/tsc +21 -0
- package/packages/tree/node_modules/.bin/tsserver +21 -0
- package/packages/tree/package.json +19 -0
- package/packages/tree/tsconfig.json +13 -0
- package/packages/typescript-config/base.json +21 -0
- package/packages/typescript-config/nextjs.json +18 -0
- package/packages/typescript-config/package.json +9 -0
- package/packages/typescript-config/react-library.json +8 -0
- package/packages/typography/node_modules/.bin/tsc +21 -0
- package/packages/typography/node_modules/.bin/tsserver +21 -0
- package/packages/typography/package.json +20 -0
- package/packages/typography/styles.css +326 -0
- package/packages/typography/tsconfig.json +13 -0
- package/packages/video-player/index.tsx +125 -0
- package/packages/video-player/node_modules/.bin/tsc +21 -0
- package/packages/video-player/node_modules/.bin/tsserver +21 -0
- package/packages/video-player/package.json +18 -0
- package/packages/video-player/tsconfig.json +13 -0
|
@@ -0,0 +1,1980 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { Editor, Range } from "@tiptap/core";
|
|
4
|
+
import { mergeAttributes, Node } from "@tiptap/core";
|
|
5
|
+
import CodeBlockLowlight from "@tiptap/extension-code-block-lowlight";
|
|
6
|
+
import { TaskItem, TaskList } from "@tiptap/extension-list";
|
|
7
|
+
import Subscript from "@tiptap/extension-subscript";
|
|
8
|
+
import Superscript from "@tiptap/extension-superscript";
|
|
9
|
+
import {
|
|
10
|
+
Table,
|
|
11
|
+
TableCell,
|
|
12
|
+
TableHeader,
|
|
13
|
+
TableRow,
|
|
14
|
+
} from "@tiptap/extension-table";
|
|
15
|
+
import { TextStyleKit } from "@tiptap/extension-text-style";
|
|
16
|
+
import Typography from "@tiptap/extension-typography";
|
|
17
|
+
import { CharacterCount, Placeholder } from "@tiptap/extensions";
|
|
18
|
+
import type { DOMOutputSpec, Node as ProseMirrorNode } from "@tiptap/pm/model";
|
|
19
|
+
import { PluginKey } from "@tiptap/pm/state";
|
|
20
|
+
import {
|
|
21
|
+
ReactRenderer,
|
|
22
|
+
EditorProvider as TiptapEditorProvider,
|
|
23
|
+
type EditorProviderProps as TiptapEditorProviderProps,
|
|
24
|
+
useCurrentEditor,
|
|
25
|
+
} from "@tiptap/react";
|
|
26
|
+
import {
|
|
27
|
+
BubbleMenu,
|
|
28
|
+
type BubbleMenuProps,
|
|
29
|
+
FloatingMenu,
|
|
30
|
+
type FloatingMenuProps,
|
|
31
|
+
} from "@tiptap/react/menus";
|
|
32
|
+
import { Button } from "@/components/ui/button";
|
|
33
|
+
import {
|
|
34
|
+
Command,
|
|
35
|
+
CommandEmpty,
|
|
36
|
+
CommandItem,
|
|
37
|
+
CommandList,
|
|
38
|
+
} from "@/components/ui/command";
|
|
39
|
+
import {
|
|
40
|
+
DropdownMenu,
|
|
41
|
+
DropdownMenuContent,
|
|
42
|
+
DropdownMenuItem,
|
|
43
|
+
DropdownMenuTrigger,
|
|
44
|
+
} from "@/components/ui/dropdown-menu";
|
|
45
|
+
import {
|
|
46
|
+
Popover,
|
|
47
|
+
PopoverContent,
|
|
48
|
+
PopoverTrigger,
|
|
49
|
+
} from "@/components/ui/popover";
|
|
50
|
+
import { Separator } from "@/components/ui/separator";
|
|
51
|
+
import {
|
|
52
|
+
Tooltip,
|
|
53
|
+
TooltipContent,
|
|
54
|
+
TooltipProvider,
|
|
55
|
+
TooltipTrigger,
|
|
56
|
+
} from "@/components/ui/tooltip";
|
|
57
|
+
import { cn } from "@/lib/utils";
|
|
58
|
+
|
|
59
|
+
export type { Editor, JSONContent } from "@tiptap/react";
|
|
60
|
+
|
|
61
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
62
|
+
import Suggestion, { type SuggestionOptions } from "@tiptap/suggestion";
|
|
63
|
+
import Fuse from "fuse.js";
|
|
64
|
+
import { all, createLowlight } from "lowlight";
|
|
65
|
+
import {
|
|
66
|
+
ArrowDownIcon,
|
|
67
|
+
ArrowLeftIcon,
|
|
68
|
+
ArrowRightIcon,
|
|
69
|
+
ArrowUpIcon,
|
|
70
|
+
BoldIcon,
|
|
71
|
+
BoltIcon,
|
|
72
|
+
CheckIcon,
|
|
73
|
+
CheckSquareIcon,
|
|
74
|
+
ChevronDownIcon,
|
|
75
|
+
CodeIcon,
|
|
76
|
+
ColumnsIcon,
|
|
77
|
+
EllipsisIcon,
|
|
78
|
+
EllipsisVerticalIcon,
|
|
79
|
+
ExternalLinkIcon,
|
|
80
|
+
Heading1Icon,
|
|
81
|
+
Heading2Icon,
|
|
82
|
+
Heading3Icon,
|
|
83
|
+
ItalicIcon,
|
|
84
|
+
ListIcon,
|
|
85
|
+
ListOrderedIcon,
|
|
86
|
+
type LucideIcon,
|
|
87
|
+
type LucideProps,
|
|
88
|
+
RemoveFormattingIcon,
|
|
89
|
+
RowsIcon,
|
|
90
|
+
StrikethroughIcon,
|
|
91
|
+
SubscriptIcon,
|
|
92
|
+
SuperscriptIcon,
|
|
93
|
+
TableCellsMergeIcon,
|
|
94
|
+
TableColumnsSplitIcon,
|
|
95
|
+
TableIcon,
|
|
96
|
+
TextIcon,
|
|
97
|
+
TextQuoteIcon,
|
|
98
|
+
TrashIcon,
|
|
99
|
+
UnderlineIcon,
|
|
100
|
+
} from "lucide-react";
|
|
101
|
+
import type { FormEventHandler, HTMLAttributes, ReactNode } from "react";
|
|
102
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
103
|
+
import tippy, { type Instance as TippyInstance } from "tippy.js";
|
|
104
|
+
|
|
105
|
+
type SlashNodeAttrs = {
|
|
106
|
+
id: string | null;
|
|
107
|
+
label?: string | null;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
type SlashOptions<
|
|
111
|
+
SlashOptionSuggestionItem = unknown,
|
|
112
|
+
Attrs = SlashNodeAttrs,
|
|
113
|
+
> = {
|
|
114
|
+
HTMLAttributes: Record<string, unknown>;
|
|
115
|
+
renderText: (props: {
|
|
116
|
+
options: SlashOptions<SlashOptionSuggestionItem, Attrs>;
|
|
117
|
+
node: ProseMirrorNode;
|
|
118
|
+
}) => string;
|
|
119
|
+
renderHTML: (props: {
|
|
120
|
+
options: SlashOptions<SlashOptionSuggestionItem, Attrs>;
|
|
121
|
+
node: ProseMirrorNode;
|
|
122
|
+
}) => DOMOutputSpec;
|
|
123
|
+
deleteTriggerWithBackspace: boolean;
|
|
124
|
+
suggestion: Omit<
|
|
125
|
+
SuggestionOptions<SlashOptionSuggestionItem, Attrs>,
|
|
126
|
+
"editor"
|
|
127
|
+
>;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const SlashPluginKey = new PluginKey("slash");
|
|
131
|
+
|
|
132
|
+
export type SuggestionItem = {
|
|
133
|
+
title: string;
|
|
134
|
+
description: string;
|
|
135
|
+
icon: LucideIcon;
|
|
136
|
+
searchTerms: string[];
|
|
137
|
+
command: (props: { editor: Editor; range: Range }) => void;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const defaultSlashSuggestions: SuggestionOptions<SuggestionItem>["items"] =
|
|
141
|
+
() => [
|
|
142
|
+
{
|
|
143
|
+
title: "Text",
|
|
144
|
+
description: "Just start typing with plain text.",
|
|
145
|
+
searchTerms: ["p", "paragraph"],
|
|
146
|
+
icon: TextIcon,
|
|
147
|
+
command: ({ editor, range }) => {
|
|
148
|
+
editor
|
|
149
|
+
.chain()
|
|
150
|
+
.focus()
|
|
151
|
+
.deleteRange(range)
|
|
152
|
+
.toggleNode("paragraph", "paragraph")
|
|
153
|
+
.run();
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
title: "To-do List",
|
|
158
|
+
description: "Track tasks with a to-do list.",
|
|
159
|
+
searchTerms: ["todo", "task", "list", "check", "checkbox"],
|
|
160
|
+
icon: CheckSquareIcon,
|
|
161
|
+
command: ({ editor, range }) => {
|
|
162
|
+
editor
|
|
163
|
+
.chain()
|
|
164
|
+
.focus()
|
|
165
|
+
.deleteRange(range)
|
|
166
|
+
.toggleList("taskList", "taskItem")
|
|
167
|
+
.run();
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
title: "Heading 1",
|
|
172
|
+
description: "Big section heading.",
|
|
173
|
+
searchTerms: ["title", "big", "large"],
|
|
174
|
+
icon: Heading1Icon,
|
|
175
|
+
command: ({ editor, range }) => {
|
|
176
|
+
editor
|
|
177
|
+
.chain()
|
|
178
|
+
.focus()
|
|
179
|
+
.deleteRange(range)
|
|
180
|
+
.setNode("heading", { level: 1 })
|
|
181
|
+
.run();
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
title: "Heading 2",
|
|
186
|
+
description: "Medium section heading.",
|
|
187
|
+
searchTerms: ["subtitle", "medium"],
|
|
188
|
+
icon: Heading2Icon,
|
|
189
|
+
command: ({ editor, range }) => {
|
|
190
|
+
editor
|
|
191
|
+
.chain()
|
|
192
|
+
.focus()
|
|
193
|
+
.deleteRange(range)
|
|
194
|
+
.setNode("heading", { level: 2 })
|
|
195
|
+
.run();
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
title: "Heading 3",
|
|
200
|
+
description: "Small section heading.",
|
|
201
|
+
searchTerms: ["subtitle", "small"],
|
|
202
|
+
icon: Heading3Icon,
|
|
203
|
+
command: ({ editor, range }) => {
|
|
204
|
+
editor
|
|
205
|
+
.chain()
|
|
206
|
+
.focus()
|
|
207
|
+
.deleteRange(range)
|
|
208
|
+
.setNode("heading", { level: 3 })
|
|
209
|
+
.run();
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
title: "Bullet List",
|
|
214
|
+
description: "Create a simple bullet list.",
|
|
215
|
+
searchTerms: ["unordered", "point"],
|
|
216
|
+
icon: ListIcon,
|
|
217
|
+
command: ({ editor, range }) => {
|
|
218
|
+
editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
title: "Numbered List",
|
|
223
|
+
description: "Create a list with numbering.",
|
|
224
|
+
searchTerms: ["ordered"],
|
|
225
|
+
icon: ListOrderedIcon,
|
|
226
|
+
command: ({ editor, range }) => {
|
|
227
|
+
editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
title: "Quote",
|
|
232
|
+
description: "Capture a quote.",
|
|
233
|
+
searchTerms: ["blockquote"],
|
|
234
|
+
icon: TextQuoteIcon,
|
|
235
|
+
command: ({ editor, range }) =>
|
|
236
|
+
editor
|
|
237
|
+
.chain()
|
|
238
|
+
.focus()
|
|
239
|
+
.deleteRange(range)
|
|
240
|
+
.toggleNode("paragraph", "paragraph")
|
|
241
|
+
.toggleBlockquote()
|
|
242
|
+
.run(),
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
title: "Code",
|
|
246
|
+
description: "Capture a code snippet.",
|
|
247
|
+
searchTerms: ["codeblock"],
|
|
248
|
+
icon: CodeIcon,
|
|
249
|
+
command: ({ editor, range }) =>
|
|
250
|
+
editor.chain().focus().deleteRange(range).toggleCodeBlock().run(),
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
title: "Table",
|
|
254
|
+
description: "Add a table view to organize data.",
|
|
255
|
+
searchTerms: ["table"],
|
|
256
|
+
icon: TableIcon,
|
|
257
|
+
command: ({ editor, range }) =>
|
|
258
|
+
editor
|
|
259
|
+
.chain()
|
|
260
|
+
.focus()
|
|
261
|
+
.deleteRange(range)
|
|
262
|
+
.insertTable({ rows: 3, cols: 3, withHeaderRow: true })
|
|
263
|
+
.run(),
|
|
264
|
+
},
|
|
265
|
+
];
|
|
266
|
+
|
|
267
|
+
const Slash = Node.create<SlashOptions>({
|
|
268
|
+
name: "slash",
|
|
269
|
+
priority: 101,
|
|
270
|
+
addOptions() {
|
|
271
|
+
return {
|
|
272
|
+
HTMLAttributes: {},
|
|
273
|
+
renderText({ options, node }) {
|
|
274
|
+
return `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`;
|
|
275
|
+
},
|
|
276
|
+
deleteTriggerWithBackspace: false,
|
|
277
|
+
renderHTML({ options, node }) {
|
|
278
|
+
return [
|
|
279
|
+
"span",
|
|
280
|
+
mergeAttributes(this.HTMLAttributes, options.HTMLAttributes),
|
|
281
|
+
`${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`,
|
|
282
|
+
];
|
|
283
|
+
},
|
|
284
|
+
suggestion: {
|
|
285
|
+
char: "/",
|
|
286
|
+
pluginKey: SlashPluginKey,
|
|
287
|
+
command: ({ editor, range, props }) => {
|
|
288
|
+
// increase range.to by one when the next node is of type "text"
|
|
289
|
+
// and starts with a space character
|
|
290
|
+
const nodeAfter = editor.view.state.selection.$to.nodeAfter;
|
|
291
|
+
const overrideSpace = nodeAfter?.text?.startsWith(" ");
|
|
292
|
+
|
|
293
|
+
if (overrideSpace) {
|
|
294
|
+
range.to += 1;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
editor
|
|
298
|
+
.chain()
|
|
299
|
+
.focus()
|
|
300
|
+
.insertContentAt(range, [
|
|
301
|
+
{
|
|
302
|
+
type: this.name,
|
|
303
|
+
attrs: props,
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
type: "text",
|
|
307
|
+
text: " ",
|
|
308
|
+
},
|
|
309
|
+
])
|
|
310
|
+
.run();
|
|
311
|
+
|
|
312
|
+
// get reference to `window` object from editor element, to support cross-frame JS usage
|
|
313
|
+
editor.view.dom.ownerDocument.defaultView
|
|
314
|
+
?.getSelection()
|
|
315
|
+
?.collapseToEnd();
|
|
316
|
+
},
|
|
317
|
+
allow: ({ state, range }) => {
|
|
318
|
+
const $from = state.doc.resolve(range.from);
|
|
319
|
+
const type = state.schema.nodes[this.name];
|
|
320
|
+
const allow = !!$from.parent.type.contentMatch.matchType(type);
|
|
321
|
+
|
|
322
|
+
return allow;
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
},
|
|
327
|
+
|
|
328
|
+
group: "inline",
|
|
329
|
+
|
|
330
|
+
inline: true,
|
|
331
|
+
|
|
332
|
+
selectable: false,
|
|
333
|
+
|
|
334
|
+
atom: true,
|
|
335
|
+
|
|
336
|
+
addAttributes() {
|
|
337
|
+
return {
|
|
338
|
+
id: {
|
|
339
|
+
default: null,
|
|
340
|
+
parseHTML: (element) => element.getAttribute("data-id"),
|
|
341
|
+
renderHTML: (attributes) => {
|
|
342
|
+
if (!attributes.id) {
|
|
343
|
+
return {};
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
return {
|
|
347
|
+
"data-id": attributes.id,
|
|
348
|
+
};
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
|
|
352
|
+
label: {
|
|
353
|
+
default: null,
|
|
354
|
+
parseHTML: (element) => element.getAttribute("data-label"),
|
|
355
|
+
renderHTML: (attributes) => {
|
|
356
|
+
if (!attributes.label) {
|
|
357
|
+
return {};
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
return {
|
|
361
|
+
"data-label": attributes.label,
|
|
362
|
+
};
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
};
|
|
366
|
+
},
|
|
367
|
+
|
|
368
|
+
parseHTML() {
|
|
369
|
+
return [
|
|
370
|
+
{
|
|
371
|
+
tag: `span[data-type="${this.name}"]`,
|
|
372
|
+
},
|
|
373
|
+
];
|
|
374
|
+
},
|
|
375
|
+
|
|
376
|
+
renderHTML({ node, HTMLAttributes }) {
|
|
377
|
+
const mergedOptions = { ...this.options };
|
|
378
|
+
|
|
379
|
+
mergedOptions.HTMLAttributes = mergeAttributes(
|
|
380
|
+
{ "data-type": this.name },
|
|
381
|
+
this.options.HTMLAttributes,
|
|
382
|
+
HTMLAttributes
|
|
383
|
+
);
|
|
384
|
+
const html = this.options.renderHTML({
|
|
385
|
+
options: mergedOptions,
|
|
386
|
+
node,
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
if (typeof html === "string") {
|
|
390
|
+
return [
|
|
391
|
+
"span",
|
|
392
|
+
mergeAttributes(
|
|
393
|
+
{ "data-type": this.name },
|
|
394
|
+
this.options.HTMLAttributes,
|
|
395
|
+
HTMLAttributes
|
|
396
|
+
),
|
|
397
|
+
html,
|
|
398
|
+
];
|
|
399
|
+
}
|
|
400
|
+
return html;
|
|
401
|
+
},
|
|
402
|
+
|
|
403
|
+
renderText({ node }) {
|
|
404
|
+
return this.options.renderText({
|
|
405
|
+
options: this.options,
|
|
406
|
+
node,
|
|
407
|
+
});
|
|
408
|
+
},
|
|
409
|
+
|
|
410
|
+
addKeyboardShortcuts() {
|
|
411
|
+
return {
|
|
412
|
+
Backspace: () =>
|
|
413
|
+
this.editor.commands.command(({ tr, state }) => {
|
|
414
|
+
let isMention = false;
|
|
415
|
+
const { selection } = state;
|
|
416
|
+
const { empty, anchor } = selection;
|
|
417
|
+
|
|
418
|
+
if (!empty) {
|
|
419
|
+
return false;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
state.doc.nodesBetween(anchor - 1, anchor, (node, pos) => {
|
|
423
|
+
if (node.type.name === this.name) {
|
|
424
|
+
isMention = true;
|
|
425
|
+
tr.insertText(
|
|
426
|
+
this.options.deleteTriggerWithBackspace
|
|
427
|
+
? ""
|
|
428
|
+
: this.options.suggestion.char || "",
|
|
429
|
+
pos,
|
|
430
|
+
pos + node.nodeSize
|
|
431
|
+
);
|
|
432
|
+
|
|
433
|
+
return false;
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
return isMention;
|
|
438
|
+
}),
|
|
439
|
+
};
|
|
440
|
+
},
|
|
441
|
+
|
|
442
|
+
addProseMirrorPlugins() {
|
|
443
|
+
return [
|
|
444
|
+
Suggestion({
|
|
445
|
+
editor: this.editor,
|
|
446
|
+
...this.options.suggestion,
|
|
447
|
+
}),
|
|
448
|
+
];
|
|
449
|
+
},
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
// Create a lowlight instance with all languages loaded
|
|
453
|
+
const lowlight = createLowlight(all);
|
|
454
|
+
|
|
455
|
+
type EditorSlashMenuProps = {
|
|
456
|
+
items: SuggestionItem[];
|
|
457
|
+
command: (item: SuggestionItem) => void;
|
|
458
|
+
editor: Editor;
|
|
459
|
+
range: Range;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
const EditorSlashMenu = ({ items, editor, range }: EditorSlashMenuProps) => (
|
|
463
|
+
<Command
|
|
464
|
+
className="border shadow"
|
|
465
|
+
id="slash-command"
|
|
466
|
+
onKeyDown={(e) => {
|
|
467
|
+
e.stopPropagation();
|
|
468
|
+
}}
|
|
469
|
+
>
|
|
470
|
+
<CommandEmpty className="flex w-full items-center justify-center p-4 text-muted-foreground text-sm">
|
|
471
|
+
<p>No results</p>
|
|
472
|
+
</CommandEmpty>
|
|
473
|
+
<CommandList>
|
|
474
|
+
{items.map((item) => (
|
|
475
|
+
<CommandItem
|
|
476
|
+
className="flex items-center gap-3 pr-3"
|
|
477
|
+
key={item.title}
|
|
478
|
+
onSelect={() => item.command({ editor, range })}
|
|
479
|
+
>
|
|
480
|
+
<div className="flex size-9 shrink-0 items-center justify-center rounded border bg-secondary">
|
|
481
|
+
<item.icon className="text-muted-foreground" size={16} />
|
|
482
|
+
</div>
|
|
483
|
+
<div className="flex flex-col">
|
|
484
|
+
<span className="font-medium text-sm">{item.title}</span>
|
|
485
|
+
<span className="text-muted-foreground text-xs">
|
|
486
|
+
{item.description}
|
|
487
|
+
</span>
|
|
488
|
+
</div>
|
|
489
|
+
</CommandItem>
|
|
490
|
+
))}
|
|
491
|
+
</CommandList>
|
|
492
|
+
</Command>
|
|
493
|
+
);
|
|
494
|
+
|
|
495
|
+
const handleCommandNavigation = (event: KeyboardEvent) => {
|
|
496
|
+
if (["ArrowUp", "ArrowDown", "Enter"].includes(event.key)) {
|
|
497
|
+
const slashCommand = document.querySelector("#slash-command");
|
|
498
|
+
|
|
499
|
+
if (slashCommand) {
|
|
500
|
+
event.preventDefault();
|
|
501
|
+
|
|
502
|
+
slashCommand.dispatchEvent(
|
|
503
|
+
new KeyboardEvent("keydown", {
|
|
504
|
+
key: event.key,
|
|
505
|
+
cancelable: true,
|
|
506
|
+
bubbles: true,
|
|
507
|
+
})
|
|
508
|
+
);
|
|
509
|
+
|
|
510
|
+
return true;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
export type EditorProviderProps = TiptapEditorProviderProps & {
|
|
516
|
+
className?: string;
|
|
517
|
+
limit?: number;
|
|
518
|
+
placeholder?: string;
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
export const EditorProvider = ({
|
|
522
|
+
className,
|
|
523
|
+
extensions,
|
|
524
|
+
limit,
|
|
525
|
+
placeholder,
|
|
526
|
+
...props
|
|
527
|
+
}: EditorProviderProps) => {
|
|
528
|
+
const defaultExtensions = [
|
|
529
|
+
StarterKit.configure({
|
|
530
|
+
codeBlock: false,
|
|
531
|
+
bulletList: {
|
|
532
|
+
HTMLAttributes: {
|
|
533
|
+
class: cn("list-outside list-disc pl-4"),
|
|
534
|
+
},
|
|
535
|
+
},
|
|
536
|
+
orderedList: {
|
|
537
|
+
HTMLAttributes: {
|
|
538
|
+
class: cn("list-outside list-decimal pl-4"),
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
listItem: {
|
|
542
|
+
HTMLAttributes: {
|
|
543
|
+
class: cn("leading-normal"),
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
|
+
blockquote: {
|
|
547
|
+
HTMLAttributes: {
|
|
548
|
+
class: cn("border-l border-l-2 pl-2"),
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
code: {
|
|
552
|
+
HTMLAttributes: {
|
|
553
|
+
class: cn("rounded-md bg-muted px-1.5 py-1 font-medium font-mono"),
|
|
554
|
+
spellcheck: "false",
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
horizontalRule: {
|
|
558
|
+
HTMLAttributes: {
|
|
559
|
+
class: cn("mt-4 mb-6 border-muted-foreground border-t"),
|
|
560
|
+
},
|
|
561
|
+
},
|
|
562
|
+
dropcursor: {
|
|
563
|
+
color: "var(--border)",
|
|
564
|
+
width: 4,
|
|
565
|
+
},
|
|
566
|
+
}),
|
|
567
|
+
Typography,
|
|
568
|
+
Placeholder.configure({
|
|
569
|
+
placeholder,
|
|
570
|
+
emptyEditorClass:
|
|
571
|
+
"before:text-muted-foreground before:content-[attr(data-placeholder)] before:float-left before:h-0 before:pointer-events-none",
|
|
572
|
+
}),
|
|
573
|
+
CharacterCount.configure({
|
|
574
|
+
limit,
|
|
575
|
+
}),
|
|
576
|
+
CodeBlockLowlight.configure({
|
|
577
|
+
lowlight,
|
|
578
|
+
HTMLAttributes: {
|
|
579
|
+
class: cn(
|
|
580
|
+
"rounded-md border p-4 text-sm",
|
|
581
|
+
"bg-background text-foreground",
|
|
582
|
+
"[&_.hljs-doctag]:text-[#d73a49] [&_.hljs-keyword]:text-[#d73a49] [&_.hljs-meta_.hljs-keyword]:text-[#d73a49] [&_.hljs-template-tag]:text-[#d73a49] [&_.hljs-template-variable]:text-[#d73a49] [&_.hljs-type]:text-[#d73a49] [&_.hljs-variable.language_]:text-[#d73a49]",
|
|
583
|
+
"[&_.hljs-title.class_.inherited__]:text-[#6f42c1] [&_.hljs-title.class_]:text-[#6f42c1] [&_.hljs-title.function_]:text-[#6f42c1] [&_.hljs-title]:text-[#6f42c1]",
|
|
584
|
+
"[&_.hljs-attr]:text-[#005cc5] [&_.hljs-attribute]:text-[#005cc5] [&_.hljs-literal]:text-[#005cc5] [&_.hljs-meta]:text-[#005cc5] [&_.hljs-number]:text-[#005cc5] [&_.hljs-operator]:text-[#005cc5] [&_.hljs-selector-attr]:text-[#005cc5] [&_.hljs-selector-class]:text-[#005cc5] [&_.hljs-selector-id]:text-[#005cc5] [&_.hljs-variable]:text-[#005cc5]",
|
|
585
|
+
"[&_.hljs-meta_.hljs-string]:text-[#032f62] [&_.hljs-regexp]:text-[#032f62] [&_.hljs-string]:text-[#032f62]",
|
|
586
|
+
"[&_.hljs-built_in]:text-[#e36209] [&_.hljs-symbol]:text-[#e36209]",
|
|
587
|
+
"[&_.hljs-code]:text-[#6a737d] [&_.hljs-comment]:text-[#6a737d] [&_.hljs-formula]:text-[#6a737d]",
|
|
588
|
+
"[&_.hljs-name]:text-[#22863a] [&_.hljs-quote]:text-[#22863a] [&_.hljs-selector-pseudo]:text-[#22863a] [&_.hljs-selector-tag]:text-[#22863a]",
|
|
589
|
+
"[&_.hljs-subst]:text-[#24292e]",
|
|
590
|
+
"[&_.hljs-section]:font-bold [&_.hljs-section]:text-[#005cc5]",
|
|
591
|
+
"[&_.hljs-bullet]:text-[#735c0f]",
|
|
592
|
+
"[&_.hljs-emphasis]:text-[#24292e] [&_.hljs-emphasis]:italic",
|
|
593
|
+
"[&_.hljs-strong]:font-bold [&_.hljs-strong]:text-[#24292e]",
|
|
594
|
+
"[&_.hljs-addition]:bg-[#f0fff4] [&_.hljs-addition]:text-[#22863a]",
|
|
595
|
+
"[&_.hljs-deletion]:bg-[#ffeef0] [&_.hljs-deletion]:text-[#b31d28]"
|
|
596
|
+
),
|
|
597
|
+
},
|
|
598
|
+
}),
|
|
599
|
+
Superscript,
|
|
600
|
+
Subscript,
|
|
601
|
+
Slash.configure({
|
|
602
|
+
suggestion: {
|
|
603
|
+
items: async ({ editor, query }) => {
|
|
604
|
+
const items = await defaultSlashSuggestions({ editor, query });
|
|
605
|
+
|
|
606
|
+
if (!query) {
|
|
607
|
+
return items;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
const slashFuse = new Fuse(items, {
|
|
611
|
+
keys: ["title", "description", "searchTerms"],
|
|
612
|
+
threshold: 0.2,
|
|
613
|
+
minMatchCharLength: 1,
|
|
614
|
+
});
|
|
615
|
+
|
|
616
|
+
const results = slashFuse.search(query);
|
|
617
|
+
|
|
618
|
+
return results.map((result) => result.item);
|
|
619
|
+
},
|
|
620
|
+
char: "/",
|
|
621
|
+
render: () => {
|
|
622
|
+
let component: ReactRenderer<EditorSlashMenuProps>;
|
|
623
|
+
let popup: TippyInstance;
|
|
624
|
+
|
|
625
|
+
return {
|
|
626
|
+
onStart: (onStartProps) => {
|
|
627
|
+
component = new ReactRenderer(EditorSlashMenu, {
|
|
628
|
+
props: onStartProps,
|
|
629
|
+
editor: onStartProps.editor,
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
popup = tippy(document.body, {
|
|
633
|
+
getReferenceClientRect: () =>
|
|
634
|
+
onStartProps.clientRect?.() || new DOMRect(),
|
|
635
|
+
appendTo: () => document.body,
|
|
636
|
+
content: component.element,
|
|
637
|
+
showOnCreate: true,
|
|
638
|
+
interactive: true,
|
|
639
|
+
trigger: "manual",
|
|
640
|
+
placement: "bottom-start",
|
|
641
|
+
});
|
|
642
|
+
},
|
|
643
|
+
|
|
644
|
+
onUpdate(onUpdateProps) {
|
|
645
|
+
component.updateProps(onUpdateProps);
|
|
646
|
+
|
|
647
|
+
popup.setProps({
|
|
648
|
+
getReferenceClientRect: () =>
|
|
649
|
+
onUpdateProps.clientRect?.() || new DOMRect(),
|
|
650
|
+
});
|
|
651
|
+
},
|
|
652
|
+
|
|
653
|
+
onKeyDown(onKeyDownProps) {
|
|
654
|
+
if (onKeyDownProps.event.key === "Escape") {
|
|
655
|
+
popup.hide();
|
|
656
|
+
component.destroy();
|
|
657
|
+
|
|
658
|
+
return true;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
return handleCommandNavigation(onKeyDownProps.event) ?? false;
|
|
662
|
+
},
|
|
663
|
+
|
|
664
|
+
onExit() {
|
|
665
|
+
popup.destroy();
|
|
666
|
+
component.destroy();
|
|
667
|
+
},
|
|
668
|
+
};
|
|
669
|
+
},
|
|
670
|
+
},
|
|
671
|
+
}),
|
|
672
|
+
Table.configure({
|
|
673
|
+
HTMLAttributes: {
|
|
674
|
+
class: cn(
|
|
675
|
+
"relative m-0 mx-auto my-3 w-full table-fixed border-collapse overflow-hidden rounded-none text-sm"
|
|
676
|
+
),
|
|
677
|
+
},
|
|
678
|
+
allowTableNodeSelection: true,
|
|
679
|
+
}),
|
|
680
|
+
TableRow.configure({
|
|
681
|
+
HTMLAttributes: {
|
|
682
|
+
class: cn(
|
|
683
|
+
"relative box-border min-w-[1em] border p-1 text-start align-top"
|
|
684
|
+
),
|
|
685
|
+
},
|
|
686
|
+
}),
|
|
687
|
+
TableCell.configure({
|
|
688
|
+
HTMLAttributes: {
|
|
689
|
+
class: cn(
|
|
690
|
+
"relative box-border min-w-[1em] border p-1 text-start align-top"
|
|
691
|
+
),
|
|
692
|
+
},
|
|
693
|
+
}),
|
|
694
|
+
TableHeader.configure({
|
|
695
|
+
HTMLAttributes: {
|
|
696
|
+
class: cn(
|
|
697
|
+
"relative box-border min-w-[1em] border bg-secondary p-1 text-start align-top font-medium font-semibold text-muted-foreground"
|
|
698
|
+
),
|
|
699
|
+
},
|
|
700
|
+
}),
|
|
701
|
+
TaskList.configure({
|
|
702
|
+
HTMLAttributes: {
|
|
703
|
+
// 17px = the width of the checkbox + the gap between the checkbox and the text
|
|
704
|
+
class: "before:translate-x-[17px]",
|
|
705
|
+
},
|
|
706
|
+
}),
|
|
707
|
+
TaskItem.configure({
|
|
708
|
+
HTMLAttributes: {
|
|
709
|
+
class: "flex items-start gap-1",
|
|
710
|
+
},
|
|
711
|
+
}),
|
|
712
|
+
];
|
|
713
|
+
|
|
714
|
+
return (
|
|
715
|
+
<TooltipProvider>
|
|
716
|
+
<div className={cn(className, "[&_.ProseMirror-focused]:outline-none")}>
|
|
717
|
+
<TiptapEditorProvider
|
|
718
|
+
editorProps={{
|
|
719
|
+
handleKeyDown: (_view, event) => {
|
|
720
|
+
handleCommandNavigation(event);
|
|
721
|
+
},
|
|
722
|
+
}}
|
|
723
|
+
extensions={[
|
|
724
|
+
...defaultExtensions,
|
|
725
|
+
TextStyleKit,
|
|
726
|
+
...(extensions ?? []),
|
|
727
|
+
]}
|
|
728
|
+
immediatelyRender={false}
|
|
729
|
+
{...props}
|
|
730
|
+
/>
|
|
731
|
+
</div>
|
|
732
|
+
</TooltipProvider>
|
|
733
|
+
);
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
export type EditorFloatingMenuProps = Omit<FloatingMenuProps, "editor">;
|
|
737
|
+
|
|
738
|
+
export const EditorFloatingMenu = ({
|
|
739
|
+
className,
|
|
740
|
+
...props
|
|
741
|
+
}: EditorFloatingMenuProps) => {
|
|
742
|
+
const { editor } = useCurrentEditor();
|
|
743
|
+
return (
|
|
744
|
+
<FloatingMenu
|
|
745
|
+
className={cn("flex items-center bg-secondary", className)}
|
|
746
|
+
editor={editor ?? null}
|
|
747
|
+
{...props}
|
|
748
|
+
/>
|
|
749
|
+
);
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
export type EditorBubbleMenuProps = Omit<BubbleMenuProps, "editor">;
|
|
753
|
+
|
|
754
|
+
export const EditorBubbleMenu = ({
|
|
755
|
+
className,
|
|
756
|
+
children,
|
|
757
|
+
...props
|
|
758
|
+
}: EditorBubbleMenuProps) => {
|
|
759
|
+
const { editor } = useCurrentEditor();
|
|
760
|
+
return (
|
|
761
|
+
<BubbleMenu
|
|
762
|
+
className={cn(
|
|
763
|
+
"flex rounded-xl border bg-background p-0.5 shadow",
|
|
764
|
+
"[&>*:first-child]:rounded-l-[9px]",
|
|
765
|
+
"[&>*:last-child]:rounded-r-[9px]",
|
|
766
|
+
className
|
|
767
|
+
)}
|
|
768
|
+
editor={editor ?? undefined}
|
|
769
|
+
{...props}
|
|
770
|
+
>
|
|
771
|
+
{children && Array.isArray(children)
|
|
772
|
+
? children.reduce((acc: ReactNode[], child, index) => {
|
|
773
|
+
if (index === 0) {
|
|
774
|
+
return [child];
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: "only iterator we have"
|
|
778
|
+
acc.push(<Separator key={index} orientation="vertical" />);
|
|
779
|
+
acc.push(child);
|
|
780
|
+
return acc;
|
|
781
|
+
}, [])
|
|
782
|
+
: children}
|
|
783
|
+
</BubbleMenu>
|
|
784
|
+
);
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
type EditorButtonProps = {
|
|
788
|
+
name: string;
|
|
789
|
+
isActive: () => boolean;
|
|
790
|
+
command: () => void;
|
|
791
|
+
icon: LucideIcon | ((props: LucideProps) => ReactNode);
|
|
792
|
+
hideName?: boolean;
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
const BubbleMenuButton = ({
|
|
796
|
+
name,
|
|
797
|
+
isActive,
|
|
798
|
+
command,
|
|
799
|
+
icon: Icon,
|
|
800
|
+
hideName,
|
|
801
|
+
}: EditorButtonProps) => (
|
|
802
|
+
<Button
|
|
803
|
+
className={`flex gap-4 ${hideName ? "" : "w-full"}`}
|
|
804
|
+
onClick={() => command()}
|
|
805
|
+
size="sm"
|
|
806
|
+
variant="ghost"
|
|
807
|
+
>
|
|
808
|
+
<Icon className="shrink-0 text-muted-foreground" size={12} />
|
|
809
|
+
{!hideName && <span className="flex-1 text-left">{name}</span>}
|
|
810
|
+
{isActive() ? (
|
|
811
|
+
<CheckIcon className="shrink-0 text-muted-foreground" size={12} />
|
|
812
|
+
) : null}
|
|
813
|
+
</Button>
|
|
814
|
+
);
|
|
815
|
+
|
|
816
|
+
export type EditorClearFormattingProps = Pick<EditorButtonProps, "hideName">;
|
|
817
|
+
|
|
818
|
+
export const EditorClearFormatting = ({
|
|
819
|
+
hideName = true,
|
|
820
|
+
}: EditorClearFormattingProps) => {
|
|
821
|
+
const { editor } = useCurrentEditor();
|
|
822
|
+
|
|
823
|
+
if (!editor) {
|
|
824
|
+
return null;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
return (
|
|
828
|
+
<BubbleMenuButton
|
|
829
|
+
command={() => editor.chain().focus().clearNodes().unsetAllMarks().run()}
|
|
830
|
+
hideName={hideName}
|
|
831
|
+
icon={RemoveFormattingIcon}
|
|
832
|
+
isActive={() => false}
|
|
833
|
+
name="Clear Formatting"
|
|
834
|
+
/>
|
|
835
|
+
);
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
export type EditorNodeTextProps = Pick<EditorButtonProps, "hideName">;
|
|
839
|
+
|
|
840
|
+
export const EditorNodeText = ({
|
|
841
|
+
hideName = false,
|
|
842
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
843
|
+
const { editor } = useCurrentEditor();
|
|
844
|
+
|
|
845
|
+
if (!editor) {
|
|
846
|
+
return null;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
return (
|
|
850
|
+
<BubbleMenuButton
|
|
851
|
+
command={() =>
|
|
852
|
+
editor.chain().focus().toggleNode("paragraph", "paragraph").run()
|
|
853
|
+
}
|
|
854
|
+
hideName={hideName}
|
|
855
|
+
// I feel like there has to be a more efficient way to do this – feel free to PR if you know how!
|
|
856
|
+
icon={TextIcon}
|
|
857
|
+
isActive={() =>
|
|
858
|
+
(editor &&
|
|
859
|
+
!editor.isActive("paragraph") &&
|
|
860
|
+
!editor.isActive("bulletList") &&
|
|
861
|
+
!editor.isActive("orderedList")) ??
|
|
862
|
+
false
|
|
863
|
+
}
|
|
864
|
+
name="Text"
|
|
865
|
+
/>
|
|
866
|
+
);
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
export type EditorNodeHeading1Props = Pick<EditorButtonProps, "hideName">;
|
|
870
|
+
|
|
871
|
+
export const EditorNodeHeading1 = ({
|
|
872
|
+
hideName = false,
|
|
873
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
874
|
+
const { editor } = useCurrentEditor();
|
|
875
|
+
|
|
876
|
+
if (!editor) {
|
|
877
|
+
return null;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
return (
|
|
881
|
+
<BubbleMenuButton
|
|
882
|
+
command={() => editor.chain().focus().toggleHeading({ level: 1 }).run()}
|
|
883
|
+
hideName={hideName}
|
|
884
|
+
icon={Heading1Icon}
|
|
885
|
+
isActive={() => editor.isActive("heading", { level: 1 }) ?? false}
|
|
886
|
+
name="Heading 1"
|
|
887
|
+
/>
|
|
888
|
+
);
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
export type EditorNodeHeading2Props = Pick<EditorButtonProps, "hideName">;
|
|
892
|
+
|
|
893
|
+
export const EditorNodeHeading2 = ({
|
|
894
|
+
hideName = false,
|
|
895
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
896
|
+
const { editor } = useCurrentEditor();
|
|
897
|
+
|
|
898
|
+
if (!editor) {
|
|
899
|
+
return null;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
return (
|
|
903
|
+
<BubbleMenuButton
|
|
904
|
+
command={() => editor.chain().focus().toggleHeading({ level: 2 }).run()}
|
|
905
|
+
hideName={hideName}
|
|
906
|
+
icon={Heading2Icon}
|
|
907
|
+
isActive={() => editor.isActive("heading", { level: 2 }) ?? false}
|
|
908
|
+
name="Heading 2"
|
|
909
|
+
/>
|
|
910
|
+
);
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
export type EditorNodeHeading3Props = Pick<EditorButtonProps, "hideName">;
|
|
914
|
+
|
|
915
|
+
export const EditorNodeHeading3 = ({
|
|
916
|
+
hideName = false,
|
|
917
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
918
|
+
const { editor } = useCurrentEditor();
|
|
919
|
+
|
|
920
|
+
if (!editor) {
|
|
921
|
+
return null;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
return (
|
|
925
|
+
<BubbleMenuButton
|
|
926
|
+
command={() => editor.chain().focus().toggleHeading({ level: 3 }).run()}
|
|
927
|
+
hideName={hideName}
|
|
928
|
+
icon={Heading3Icon}
|
|
929
|
+
isActive={() => editor.isActive("heading", { level: 3 }) ?? false}
|
|
930
|
+
name="Heading 3"
|
|
931
|
+
/>
|
|
932
|
+
);
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
export type EditorNodeBulletListProps = Pick<EditorButtonProps, "hideName">;
|
|
936
|
+
|
|
937
|
+
export const EditorNodeBulletList = ({
|
|
938
|
+
hideName = false,
|
|
939
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
940
|
+
const { editor } = useCurrentEditor();
|
|
941
|
+
|
|
942
|
+
if (!editor) {
|
|
943
|
+
return null;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
return (
|
|
947
|
+
<BubbleMenuButton
|
|
948
|
+
command={() => editor.chain().focus().toggleBulletList().run()}
|
|
949
|
+
hideName={hideName}
|
|
950
|
+
icon={ListIcon}
|
|
951
|
+
isActive={() => editor.isActive("bulletList") ?? false}
|
|
952
|
+
name="Bullet List"
|
|
953
|
+
/>
|
|
954
|
+
);
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
export type EditorNodeOrderedListProps = Pick<EditorButtonProps, "hideName">;
|
|
958
|
+
|
|
959
|
+
export const EditorNodeOrderedList = ({
|
|
960
|
+
hideName = false,
|
|
961
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
962
|
+
const { editor } = useCurrentEditor();
|
|
963
|
+
|
|
964
|
+
if (!editor) {
|
|
965
|
+
return null;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
return (
|
|
969
|
+
<BubbleMenuButton
|
|
970
|
+
command={() => editor.chain().focus().toggleOrderedList().run()}
|
|
971
|
+
hideName={hideName}
|
|
972
|
+
icon={ListOrderedIcon}
|
|
973
|
+
isActive={() => editor.isActive("orderedList") ?? false}
|
|
974
|
+
name="Numbered List"
|
|
975
|
+
/>
|
|
976
|
+
);
|
|
977
|
+
};
|
|
978
|
+
|
|
979
|
+
export type EditorNodeTaskListProps = Pick<EditorButtonProps, "hideName">;
|
|
980
|
+
|
|
981
|
+
export const EditorNodeTaskList = ({
|
|
982
|
+
hideName = false,
|
|
983
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
984
|
+
const { editor } = useCurrentEditor();
|
|
985
|
+
|
|
986
|
+
if (!editor) {
|
|
987
|
+
return null;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
return (
|
|
991
|
+
<BubbleMenuButton
|
|
992
|
+
command={() =>
|
|
993
|
+
editor.chain().focus().toggleList("taskList", "taskItem").run()
|
|
994
|
+
}
|
|
995
|
+
hideName={hideName}
|
|
996
|
+
icon={CheckSquareIcon}
|
|
997
|
+
isActive={() => editor.isActive("taskItem") ?? false}
|
|
998
|
+
name="To-do List"
|
|
999
|
+
/>
|
|
1000
|
+
);
|
|
1001
|
+
};
|
|
1002
|
+
|
|
1003
|
+
export type EditorNodeQuoteProps = Pick<EditorButtonProps, "hideName">;
|
|
1004
|
+
|
|
1005
|
+
export const EditorNodeQuote = ({
|
|
1006
|
+
hideName = false,
|
|
1007
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
1008
|
+
const { editor } = useCurrentEditor();
|
|
1009
|
+
|
|
1010
|
+
if (!editor) {
|
|
1011
|
+
return null;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
return (
|
|
1015
|
+
<BubbleMenuButton
|
|
1016
|
+
command={() =>
|
|
1017
|
+
editor
|
|
1018
|
+
.chain()
|
|
1019
|
+
.focus()
|
|
1020
|
+
.toggleNode("paragraph", "paragraph")
|
|
1021
|
+
.toggleBlockquote()
|
|
1022
|
+
.run()
|
|
1023
|
+
}
|
|
1024
|
+
hideName={hideName}
|
|
1025
|
+
icon={TextQuoteIcon}
|
|
1026
|
+
isActive={() => editor.isActive("blockquote") ?? false}
|
|
1027
|
+
name="Quote"
|
|
1028
|
+
/>
|
|
1029
|
+
);
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1032
|
+
export type EditorNodeCodeProps = Pick<EditorButtonProps, "hideName">;
|
|
1033
|
+
|
|
1034
|
+
export const EditorNodeCode = ({
|
|
1035
|
+
hideName = false,
|
|
1036
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
1037
|
+
const { editor } = useCurrentEditor();
|
|
1038
|
+
|
|
1039
|
+
if (!editor) {
|
|
1040
|
+
return null;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
return (
|
|
1044
|
+
<BubbleMenuButton
|
|
1045
|
+
command={() => editor.chain().focus().toggleCodeBlock().run()}
|
|
1046
|
+
hideName={hideName}
|
|
1047
|
+
icon={CodeIcon}
|
|
1048
|
+
isActive={() => editor.isActive("codeBlock") ?? false}
|
|
1049
|
+
name="Code"
|
|
1050
|
+
/>
|
|
1051
|
+
);
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1054
|
+
export type EditorNodeTableProps = Pick<EditorButtonProps, "hideName">;
|
|
1055
|
+
|
|
1056
|
+
export const EditorNodeTable = ({
|
|
1057
|
+
hideName = false,
|
|
1058
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
1059
|
+
const { editor } = useCurrentEditor();
|
|
1060
|
+
|
|
1061
|
+
if (!editor) {
|
|
1062
|
+
return null;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
return (
|
|
1066
|
+
<BubbleMenuButton
|
|
1067
|
+
command={() =>
|
|
1068
|
+
editor
|
|
1069
|
+
.chain()
|
|
1070
|
+
.focus()
|
|
1071
|
+
.insertTable({ rows: 3, cols: 3, withHeaderRow: true })
|
|
1072
|
+
.run()
|
|
1073
|
+
}
|
|
1074
|
+
hideName={hideName}
|
|
1075
|
+
icon={TableIcon}
|
|
1076
|
+
isActive={() => editor.isActive("table") ?? false}
|
|
1077
|
+
name="Table"
|
|
1078
|
+
/>
|
|
1079
|
+
);
|
|
1080
|
+
};
|
|
1081
|
+
|
|
1082
|
+
export type EditorSelectorProps = HTMLAttributes<HTMLDivElement> & {
|
|
1083
|
+
open?: boolean;
|
|
1084
|
+
onOpenChange?: (open: boolean) => void;
|
|
1085
|
+
title: string;
|
|
1086
|
+
};
|
|
1087
|
+
|
|
1088
|
+
export const EditorSelector = ({
|
|
1089
|
+
open,
|
|
1090
|
+
onOpenChange,
|
|
1091
|
+
title,
|
|
1092
|
+
className,
|
|
1093
|
+
children,
|
|
1094
|
+
...props
|
|
1095
|
+
}: EditorSelectorProps) => {
|
|
1096
|
+
const { editor } = useCurrentEditor();
|
|
1097
|
+
|
|
1098
|
+
if (!editor) {
|
|
1099
|
+
return null;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
return (
|
|
1103
|
+
<Popover onOpenChange={onOpenChange} open={open}>
|
|
1104
|
+
<PopoverTrigger asChild>
|
|
1105
|
+
<Button
|
|
1106
|
+
className="gap-2 rounded-none border-none"
|
|
1107
|
+
size="sm"
|
|
1108
|
+
variant="ghost"
|
|
1109
|
+
>
|
|
1110
|
+
<span className="whitespace-nowrap text-xs">{title}</span>
|
|
1111
|
+
<ChevronDownIcon size={12} />
|
|
1112
|
+
</Button>
|
|
1113
|
+
</PopoverTrigger>
|
|
1114
|
+
<PopoverContent
|
|
1115
|
+
align="start"
|
|
1116
|
+
className={cn("w-48 p-1", className)}
|
|
1117
|
+
sideOffset={5}
|
|
1118
|
+
{...props}
|
|
1119
|
+
>
|
|
1120
|
+
{children}
|
|
1121
|
+
</PopoverContent>
|
|
1122
|
+
</Popover>
|
|
1123
|
+
);
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1126
|
+
export type EditorFormatBoldProps = Pick<EditorButtonProps, "hideName">;
|
|
1127
|
+
|
|
1128
|
+
export const EditorFormatBold = ({
|
|
1129
|
+
hideName = false,
|
|
1130
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
1131
|
+
const { editor } = useCurrentEditor();
|
|
1132
|
+
|
|
1133
|
+
if (!editor) {
|
|
1134
|
+
return null;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
return (
|
|
1138
|
+
<BubbleMenuButton
|
|
1139
|
+
command={() => editor.chain().focus().toggleBold().run()}
|
|
1140
|
+
hideName={hideName}
|
|
1141
|
+
icon={BoldIcon}
|
|
1142
|
+
isActive={() => editor.isActive("bold") ?? false}
|
|
1143
|
+
name="Bold"
|
|
1144
|
+
/>
|
|
1145
|
+
);
|
|
1146
|
+
};
|
|
1147
|
+
|
|
1148
|
+
export type EditorFormatItalicProps = Pick<EditorButtonProps, "hideName">;
|
|
1149
|
+
|
|
1150
|
+
export const EditorFormatItalic = ({
|
|
1151
|
+
hideName = false,
|
|
1152
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
1153
|
+
const { editor } = useCurrentEditor();
|
|
1154
|
+
|
|
1155
|
+
if (!editor) {
|
|
1156
|
+
return null;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
return (
|
|
1160
|
+
<BubbleMenuButton
|
|
1161
|
+
command={() => editor.chain().focus().toggleItalic().run()}
|
|
1162
|
+
hideName={hideName}
|
|
1163
|
+
icon={ItalicIcon}
|
|
1164
|
+
isActive={() => editor.isActive("italic") ?? false}
|
|
1165
|
+
name="Italic"
|
|
1166
|
+
/>
|
|
1167
|
+
);
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
export type EditorFormatStrikeProps = Pick<EditorButtonProps, "hideName">;
|
|
1171
|
+
|
|
1172
|
+
export const EditorFormatStrike = ({
|
|
1173
|
+
hideName = false,
|
|
1174
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
1175
|
+
const { editor } = useCurrentEditor();
|
|
1176
|
+
|
|
1177
|
+
if (!editor) {
|
|
1178
|
+
return null;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
return (
|
|
1182
|
+
<BubbleMenuButton
|
|
1183
|
+
command={() => editor.chain().focus().toggleStrike().run()}
|
|
1184
|
+
hideName={hideName}
|
|
1185
|
+
icon={StrikethroughIcon}
|
|
1186
|
+
isActive={() => editor.isActive("strike") ?? false}
|
|
1187
|
+
name="Strikethrough"
|
|
1188
|
+
/>
|
|
1189
|
+
);
|
|
1190
|
+
};
|
|
1191
|
+
|
|
1192
|
+
export type EditorFormatCodeProps = Pick<EditorButtonProps, "hideName">;
|
|
1193
|
+
|
|
1194
|
+
export const EditorFormatCode = ({
|
|
1195
|
+
hideName = false,
|
|
1196
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
1197
|
+
const { editor } = useCurrentEditor();
|
|
1198
|
+
|
|
1199
|
+
if (!editor) {
|
|
1200
|
+
return null;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
return (
|
|
1204
|
+
<BubbleMenuButton
|
|
1205
|
+
command={() => editor.chain().focus().toggleCode().run()}
|
|
1206
|
+
hideName={hideName}
|
|
1207
|
+
icon={CodeIcon}
|
|
1208
|
+
isActive={() => editor.isActive("code") ?? false}
|
|
1209
|
+
name="Code"
|
|
1210
|
+
/>
|
|
1211
|
+
);
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1214
|
+
export type EditorFormatSubscriptProps = Pick<EditorButtonProps, "hideName">;
|
|
1215
|
+
|
|
1216
|
+
export const EditorFormatSubscript = ({
|
|
1217
|
+
hideName = false,
|
|
1218
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
1219
|
+
const { editor } = useCurrentEditor();
|
|
1220
|
+
|
|
1221
|
+
if (!editor) {
|
|
1222
|
+
return null;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
return (
|
|
1226
|
+
<BubbleMenuButton
|
|
1227
|
+
command={() => editor.chain().focus().toggleSubscript().run()}
|
|
1228
|
+
hideName={hideName}
|
|
1229
|
+
icon={SubscriptIcon}
|
|
1230
|
+
isActive={() => editor.isActive("subscript") ?? false}
|
|
1231
|
+
name="Subscript"
|
|
1232
|
+
/>
|
|
1233
|
+
);
|
|
1234
|
+
};
|
|
1235
|
+
|
|
1236
|
+
export type EditorFormatSuperscriptProps = Pick<EditorButtonProps, "hideName">;
|
|
1237
|
+
|
|
1238
|
+
export const EditorFormatSuperscript = ({
|
|
1239
|
+
hideName = false,
|
|
1240
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
1241
|
+
const { editor } = useCurrentEditor();
|
|
1242
|
+
|
|
1243
|
+
if (!editor) {
|
|
1244
|
+
return null;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
return (
|
|
1248
|
+
<BubbleMenuButton
|
|
1249
|
+
command={() => editor.chain().focus().toggleSuperscript().run()}
|
|
1250
|
+
hideName={hideName}
|
|
1251
|
+
icon={SuperscriptIcon}
|
|
1252
|
+
isActive={() => editor.isActive("superscript") ?? false}
|
|
1253
|
+
name="Superscript"
|
|
1254
|
+
/>
|
|
1255
|
+
);
|
|
1256
|
+
};
|
|
1257
|
+
|
|
1258
|
+
export type EditorFormatUnderlineProps = Pick<EditorButtonProps, "hideName">;
|
|
1259
|
+
|
|
1260
|
+
export const EditorFormatUnderline = ({
|
|
1261
|
+
hideName = false,
|
|
1262
|
+
}: Pick<EditorButtonProps, "hideName">) => {
|
|
1263
|
+
const { editor } = useCurrentEditor();
|
|
1264
|
+
|
|
1265
|
+
if (!editor) {
|
|
1266
|
+
return null;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
return (
|
|
1270
|
+
<BubbleMenuButton
|
|
1271
|
+
command={() => editor.chain().focus().toggleUnderline().run()}
|
|
1272
|
+
hideName={hideName}
|
|
1273
|
+
icon={UnderlineIcon}
|
|
1274
|
+
isActive={() => editor.isActive("underline") ?? false}
|
|
1275
|
+
name="Underline"
|
|
1276
|
+
/>
|
|
1277
|
+
);
|
|
1278
|
+
};
|
|
1279
|
+
|
|
1280
|
+
export type EditorLinkSelectorProps = {
|
|
1281
|
+
open?: boolean;
|
|
1282
|
+
onOpenChange?: (open: boolean) => void;
|
|
1283
|
+
};
|
|
1284
|
+
|
|
1285
|
+
export const EditorLinkSelector = ({
|
|
1286
|
+
open,
|
|
1287
|
+
onOpenChange,
|
|
1288
|
+
}: EditorLinkSelectorProps) => {
|
|
1289
|
+
const [url, setUrl] = useState<string>("");
|
|
1290
|
+
const inputReference = useRef<HTMLInputElement>(null);
|
|
1291
|
+
const { editor } = useCurrentEditor();
|
|
1292
|
+
|
|
1293
|
+
const isValidUrl = (text: string): boolean => {
|
|
1294
|
+
try {
|
|
1295
|
+
new URL(text);
|
|
1296
|
+
return true;
|
|
1297
|
+
} catch {
|
|
1298
|
+
return false;
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
const getUrlFromString = (text: string): string | null => {
|
|
1303
|
+
if (isValidUrl(text)) {
|
|
1304
|
+
return text;
|
|
1305
|
+
}
|
|
1306
|
+
try {
|
|
1307
|
+
if (text.includes(".") && !text.includes(" ")) {
|
|
1308
|
+
return new URL(`https://${text}`).toString();
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
return null;
|
|
1312
|
+
} catch {
|
|
1313
|
+
return null;
|
|
1314
|
+
}
|
|
1315
|
+
};
|
|
1316
|
+
|
|
1317
|
+
useEffect(() => {
|
|
1318
|
+
inputReference.current?.focus();
|
|
1319
|
+
}, []);
|
|
1320
|
+
|
|
1321
|
+
if (!editor) {
|
|
1322
|
+
return null;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
const handleSubmit: FormEventHandler<HTMLFormElement> = (event) => {
|
|
1326
|
+
event.preventDefault();
|
|
1327
|
+
|
|
1328
|
+
const href = getUrlFromString(url);
|
|
1329
|
+
|
|
1330
|
+
if (href) {
|
|
1331
|
+
editor.chain().focus().setLink({ href }).run();
|
|
1332
|
+
onOpenChange?.(false);
|
|
1333
|
+
}
|
|
1334
|
+
};
|
|
1335
|
+
|
|
1336
|
+
const defaultValue = (editor.getAttributes("link") as { href?: string }).href;
|
|
1337
|
+
|
|
1338
|
+
return (
|
|
1339
|
+
<Popover modal onOpenChange={onOpenChange} open={open}>
|
|
1340
|
+
<PopoverTrigger asChild>
|
|
1341
|
+
<Button
|
|
1342
|
+
className="gap-2 rounded-none border-none"
|
|
1343
|
+
size="sm"
|
|
1344
|
+
variant="ghost"
|
|
1345
|
+
>
|
|
1346
|
+
<ExternalLinkIcon size={12} />
|
|
1347
|
+
<p
|
|
1348
|
+
className={cn(
|
|
1349
|
+
"text-xs underline decoration-text-muted underline-offset-4",
|
|
1350
|
+
{
|
|
1351
|
+
"text-primary": editor.isActive("link"),
|
|
1352
|
+
}
|
|
1353
|
+
)}
|
|
1354
|
+
>
|
|
1355
|
+
Link
|
|
1356
|
+
</p>
|
|
1357
|
+
</Button>
|
|
1358
|
+
</PopoverTrigger>
|
|
1359
|
+
<PopoverContent align="start" className="w-60 p-0" sideOffset={10}>
|
|
1360
|
+
<form className="flex p-1" onSubmit={handleSubmit}>
|
|
1361
|
+
<input
|
|
1362
|
+
aria-label="Link URL"
|
|
1363
|
+
className="flex-1 bg-background p-1 text-sm outline-none"
|
|
1364
|
+
defaultValue={defaultValue ?? ""}
|
|
1365
|
+
onChange={(event) => setUrl(event.target.value)}
|
|
1366
|
+
placeholder="Paste a link"
|
|
1367
|
+
ref={inputReference}
|
|
1368
|
+
type="text"
|
|
1369
|
+
value={url}
|
|
1370
|
+
/>
|
|
1371
|
+
{editor.getAttributes("link").href ? (
|
|
1372
|
+
<Button
|
|
1373
|
+
className="flex h-8 items-center rounded-sm p-1 text-destructive transition-all hover:bg-destructive-foreground dark:hover:bg-destructive"
|
|
1374
|
+
onClick={() => {
|
|
1375
|
+
editor.chain().focus().unsetLink().run();
|
|
1376
|
+
onOpenChange?.(false);
|
|
1377
|
+
}}
|
|
1378
|
+
size="icon"
|
|
1379
|
+
type="button"
|
|
1380
|
+
variant="outline"
|
|
1381
|
+
>
|
|
1382
|
+
<TrashIcon size={12} />
|
|
1383
|
+
</Button>
|
|
1384
|
+
) : (
|
|
1385
|
+
<Button className="h-8" size="icon" variant="secondary">
|
|
1386
|
+
<CheckIcon size={12} />
|
|
1387
|
+
</Button>
|
|
1388
|
+
)}
|
|
1389
|
+
</form>
|
|
1390
|
+
</PopoverContent>
|
|
1391
|
+
</Popover>
|
|
1392
|
+
);
|
|
1393
|
+
};
|
|
1394
|
+
|
|
1395
|
+
export type EditorTableMenuProps = {
|
|
1396
|
+
children: ReactNode;
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1399
|
+
export const EditorTableMenu = ({ children }: EditorTableMenuProps) => {
|
|
1400
|
+
const { editor } = useCurrentEditor();
|
|
1401
|
+
|
|
1402
|
+
if (!editor) {
|
|
1403
|
+
return null;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
const isActive = editor.isActive("table");
|
|
1407
|
+
|
|
1408
|
+
return (
|
|
1409
|
+
<div
|
|
1410
|
+
className={cn({
|
|
1411
|
+
hidden: !isActive,
|
|
1412
|
+
})}
|
|
1413
|
+
>
|
|
1414
|
+
{children}
|
|
1415
|
+
</div>
|
|
1416
|
+
);
|
|
1417
|
+
};
|
|
1418
|
+
|
|
1419
|
+
export type EditorTableGlobalMenuProps = {
|
|
1420
|
+
children: ReactNode;
|
|
1421
|
+
};
|
|
1422
|
+
|
|
1423
|
+
export const EditorTableGlobalMenu = ({
|
|
1424
|
+
children,
|
|
1425
|
+
}: EditorTableGlobalMenuProps) => {
|
|
1426
|
+
const { editor } = useCurrentEditor();
|
|
1427
|
+
const [top, setTop] = useState(0);
|
|
1428
|
+
const [left, setLeft] = useState(0);
|
|
1429
|
+
|
|
1430
|
+
useEffect(() => {
|
|
1431
|
+
if (!editor) {
|
|
1432
|
+
return;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
editor.on("selectionUpdate", () => {
|
|
1436
|
+
const selection = window.getSelection();
|
|
1437
|
+
|
|
1438
|
+
if (!selection) {
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
const range = selection.getRangeAt(0);
|
|
1443
|
+
let startContainer = range.startContainer as HTMLElement | string;
|
|
1444
|
+
|
|
1445
|
+
if (!(startContainer instanceof HTMLElement)) {
|
|
1446
|
+
startContainer = range.startContainer.parentElement as HTMLElement;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
const tableNode = startContainer.closest("table");
|
|
1450
|
+
|
|
1451
|
+
if (!tableNode) {
|
|
1452
|
+
return;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
const tableRect = tableNode.getBoundingClientRect();
|
|
1456
|
+
|
|
1457
|
+
setTop(tableRect.top + tableRect.height);
|
|
1458
|
+
setLeft(tableRect.left + tableRect.width / 2);
|
|
1459
|
+
});
|
|
1460
|
+
|
|
1461
|
+
return () => {
|
|
1462
|
+
editor.off("selectionUpdate");
|
|
1463
|
+
};
|
|
1464
|
+
}, [editor]);
|
|
1465
|
+
|
|
1466
|
+
return (
|
|
1467
|
+
<div
|
|
1468
|
+
className={cn(
|
|
1469
|
+
"-translate-x-1/2 absolute flex translate-y-1/2 items-center rounded-full border bg-background shadow-xl",
|
|
1470
|
+
{
|
|
1471
|
+
hidden: !(left || top),
|
|
1472
|
+
}
|
|
1473
|
+
)}
|
|
1474
|
+
style={{ top, left }}
|
|
1475
|
+
>
|
|
1476
|
+
{children}
|
|
1477
|
+
</div>
|
|
1478
|
+
);
|
|
1479
|
+
};
|
|
1480
|
+
|
|
1481
|
+
export type EditorTableColumnMenuProps = {
|
|
1482
|
+
children: ReactNode;
|
|
1483
|
+
};
|
|
1484
|
+
|
|
1485
|
+
export const EditorTableColumnMenu = ({
|
|
1486
|
+
children,
|
|
1487
|
+
}: EditorTableColumnMenuProps) => {
|
|
1488
|
+
const { editor } = useCurrentEditor();
|
|
1489
|
+
const [top, setTop] = useState(0);
|
|
1490
|
+
const [left, setLeft] = useState(0);
|
|
1491
|
+
|
|
1492
|
+
useEffect(() => {
|
|
1493
|
+
if (!editor) {
|
|
1494
|
+
return;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
editor.on("selectionUpdate", () => {
|
|
1498
|
+
const selection = window.getSelection();
|
|
1499
|
+
|
|
1500
|
+
if (!selection) {
|
|
1501
|
+
return;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
const range = selection.getRangeAt(0);
|
|
1505
|
+
let startContainer = range.startContainer as HTMLElement | string;
|
|
1506
|
+
|
|
1507
|
+
if (!(startContainer instanceof HTMLElement)) {
|
|
1508
|
+
startContainer = range.startContainer.parentElement as HTMLElement;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
// Get the closest table cell (td or th)
|
|
1512
|
+
const tableCell = startContainer.closest("td, th");
|
|
1513
|
+
|
|
1514
|
+
if (!tableCell) {
|
|
1515
|
+
return;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
const cellRect = tableCell.getBoundingClientRect();
|
|
1519
|
+
|
|
1520
|
+
setTop(cellRect.top);
|
|
1521
|
+
setLeft(cellRect.left + cellRect.width / 2);
|
|
1522
|
+
});
|
|
1523
|
+
|
|
1524
|
+
return () => {
|
|
1525
|
+
editor.off("selectionUpdate");
|
|
1526
|
+
};
|
|
1527
|
+
}, [editor]);
|
|
1528
|
+
|
|
1529
|
+
return (
|
|
1530
|
+
<DropdownMenu>
|
|
1531
|
+
<DropdownMenuTrigger
|
|
1532
|
+
asChild
|
|
1533
|
+
className={cn(
|
|
1534
|
+
"-translate-x-1/2 -translate-y-1/2 absolute flex h-4 w-7 overflow-hidden rounded-md border bg-background shadow-xl",
|
|
1535
|
+
{
|
|
1536
|
+
hidden: !(left || top),
|
|
1537
|
+
}
|
|
1538
|
+
)}
|
|
1539
|
+
style={{ top, left }}
|
|
1540
|
+
>
|
|
1541
|
+
<Button size="icon" variant="ghost">
|
|
1542
|
+
<EllipsisIcon className="text-muted-foreground" size={16} />
|
|
1543
|
+
</Button>
|
|
1544
|
+
</DropdownMenuTrigger>
|
|
1545
|
+
<DropdownMenuContent>{children}</DropdownMenuContent>
|
|
1546
|
+
</DropdownMenu>
|
|
1547
|
+
);
|
|
1548
|
+
};
|
|
1549
|
+
|
|
1550
|
+
export type EditorTableRowMenuProps = {
|
|
1551
|
+
children: ReactNode;
|
|
1552
|
+
};
|
|
1553
|
+
|
|
1554
|
+
export const EditorTableRowMenu = ({ children }: EditorTableRowMenuProps) => {
|
|
1555
|
+
const { editor } = useCurrentEditor();
|
|
1556
|
+
const [top, setTop] = useState(0);
|
|
1557
|
+
const [left, setLeft] = useState(0);
|
|
1558
|
+
|
|
1559
|
+
useEffect(() => {
|
|
1560
|
+
if (!editor) {
|
|
1561
|
+
return;
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
editor.on("selectionUpdate", () => {
|
|
1565
|
+
const selection = window.getSelection();
|
|
1566
|
+
|
|
1567
|
+
if (!selection) {
|
|
1568
|
+
return;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
const range = selection.getRangeAt(0);
|
|
1572
|
+
let startContainer = range.startContainer as HTMLElement | string;
|
|
1573
|
+
|
|
1574
|
+
if (!(startContainer instanceof HTMLElement)) {
|
|
1575
|
+
startContainer = range.startContainer.parentElement as HTMLElement;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
const tableRow = startContainer.closest("tr");
|
|
1579
|
+
|
|
1580
|
+
if (!tableRow) {
|
|
1581
|
+
return;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
const rowRect = tableRow.getBoundingClientRect();
|
|
1585
|
+
|
|
1586
|
+
setTop(rowRect.top + rowRect.height / 2);
|
|
1587
|
+
setLeft(rowRect.left);
|
|
1588
|
+
});
|
|
1589
|
+
|
|
1590
|
+
return () => {
|
|
1591
|
+
editor.off("selectionUpdate");
|
|
1592
|
+
};
|
|
1593
|
+
}, [editor]);
|
|
1594
|
+
|
|
1595
|
+
return (
|
|
1596
|
+
<DropdownMenu>
|
|
1597
|
+
<DropdownMenuTrigger asChild>
|
|
1598
|
+
<Button
|
|
1599
|
+
className={cn(
|
|
1600
|
+
"-translate-x-1/2 -translate-y-1/2 absolute flex h-7 w-4 overflow-hidden rounded-md border bg-background shadow-xl",
|
|
1601
|
+
{
|
|
1602
|
+
hidden: !(left || top),
|
|
1603
|
+
}
|
|
1604
|
+
)}
|
|
1605
|
+
size="icon"
|
|
1606
|
+
style={{ top, left }}
|
|
1607
|
+
variant="ghost"
|
|
1608
|
+
>
|
|
1609
|
+
<EllipsisVerticalIcon className="text-muted-foreground" size={12} />
|
|
1610
|
+
</Button>
|
|
1611
|
+
</DropdownMenuTrigger>
|
|
1612
|
+
<DropdownMenuContent>{children}</DropdownMenuContent>
|
|
1613
|
+
</DropdownMenu>
|
|
1614
|
+
);
|
|
1615
|
+
};
|
|
1616
|
+
|
|
1617
|
+
export const EditorTableColumnBefore = () => {
|
|
1618
|
+
const { editor } = useCurrentEditor();
|
|
1619
|
+
|
|
1620
|
+
const handleClick = useCallback(() => {
|
|
1621
|
+
if (editor) {
|
|
1622
|
+
editor.chain().focus().addColumnBefore().run();
|
|
1623
|
+
}
|
|
1624
|
+
}, [editor]);
|
|
1625
|
+
|
|
1626
|
+
if (!editor) {
|
|
1627
|
+
return null;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
return (
|
|
1631
|
+
<DropdownMenuItem className="flex items-center gap-2" onClick={handleClick}>
|
|
1632
|
+
<ArrowLeftIcon className="text-muted-foreground" size={16} />
|
|
1633
|
+
<span>Add column before</span>
|
|
1634
|
+
</DropdownMenuItem>
|
|
1635
|
+
);
|
|
1636
|
+
};
|
|
1637
|
+
|
|
1638
|
+
export const EditorTableColumnAfter = () => {
|
|
1639
|
+
const { editor } = useCurrentEditor();
|
|
1640
|
+
|
|
1641
|
+
const handleClick = useCallback(() => {
|
|
1642
|
+
if (editor) {
|
|
1643
|
+
editor.chain().focus().addColumnAfter().run();
|
|
1644
|
+
}
|
|
1645
|
+
}, [editor]);
|
|
1646
|
+
|
|
1647
|
+
if (!editor) {
|
|
1648
|
+
return null;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
return (
|
|
1652
|
+
<DropdownMenuItem className="flex items-center gap-2" onClick={handleClick}>
|
|
1653
|
+
<ArrowRightIcon className="text-muted-foreground" size={16} />
|
|
1654
|
+
<span>Add column after</span>
|
|
1655
|
+
</DropdownMenuItem>
|
|
1656
|
+
);
|
|
1657
|
+
};
|
|
1658
|
+
|
|
1659
|
+
export const EditorTableRowBefore = () => {
|
|
1660
|
+
const { editor } = useCurrentEditor();
|
|
1661
|
+
|
|
1662
|
+
const handleClick = useCallback(() => {
|
|
1663
|
+
if (editor) {
|
|
1664
|
+
editor.chain().focus().addRowBefore().run();
|
|
1665
|
+
}
|
|
1666
|
+
}, [editor]);
|
|
1667
|
+
|
|
1668
|
+
if (!editor) {
|
|
1669
|
+
return null;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
return (
|
|
1673
|
+
<DropdownMenuItem className="flex items-center gap-2" onClick={handleClick}>
|
|
1674
|
+
<ArrowUpIcon className="text-muted-foreground" size={16} />
|
|
1675
|
+
<span>Add row before</span>
|
|
1676
|
+
</DropdownMenuItem>
|
|
1677
|
+
);
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1680
|
+
export const EditorTableRowAfter = () => {
|
|
1681
|
+
const { editor } = useCurrentEditor();
|
|
1682
|
+
|
|
1683
|
+
const handleClick = useCallback(() => {
|
|
1684
|
+
if (editor) {
|
|
1685
|
+
editor.chain().focus().addRowAfter().run();
|
|
1686
|
+
}
|
|
1687
|
+
}, [editor]);
|
|
1688
|
+
|
|
1689
|
+
if (!editor) {
|
|
1690
|
+
return null;
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
return (
|
|
1694
|
+
<DropdownMenuItem className="flex items-center gap-2" onClick={handleClick}>
|
|
1695
|
+
<ArrowDownIcon className="text-muted-foreground" size={16} />
|
|
1696
|
+
<span>Add row after</span>
|
|
1697
|
+
</DropdownMenuItem>
|
|
1698
|
+
);
|
|
1699
|
+
};
|
|
1700
|
+
|
|
1701
|
+
export const EditorTableColumnDelete = () => {
|
|
1702
|
+
const { editor } = useCurrentEditor();
|
|
1703
|
+
|
|
1704
|
+
const handleClick = useCallback(() => {
|
|
1705
|
+
if (editor) {
|
|
1706
|
+
editor.chain().focus().deleteColumn().run();
|
|
1707
|
+
}
|
|
1708
|
+
}, [editor]);
|
|
1709
|
+
|
|
1710
|
+
if (!editor) {
|
|
1711
|
+
return null;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
return (
|
|
1715
|
+
<DropdownMenuItem className="flex items-center gap-2" onClick={handleClick}>
|
|
1716
|
+
<TrashIcon className="text-destructive" size={16} />
|
|
1717
|
+
<span>Delete column</span>
|
|
1718
|
+
</DropdownMenuItem>
|
|
1719
|
+
);
|
|
1720
|
+
};
|
|
1721
|
+
|
|
1722
|
+
export const EditorTableRowDelete = () => {
|
|
1723
|
+
const { editor } = useCurrentEditor();
|
|
1724
|
+
|
|
1725
|
+
const handleClick = useCallback(() => {
|
|
1726
|
+
if (editor) {
|
|
1727
|
+
editor.chain().focus().deleteRow().run();
|
|
1728
|
+
}
|
|
1729
|
+
}, [editor]);
|
|
1730
|
+
|
|
1731
|
+
if (!editor) {
|
|
1732
|
+
return null;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
return (
|
|
1736
|
+
<DropdownMenuItem className="flex items-center gap-2" onClick={handleClick}>
|
|
1737
|
+
<TrashIcon className="text-destructive" size={16} />
|
|
1738
|
+
<span>Delete row</span>
|
|
1739
|
+
</DropdownMenuItem>
|
|
1740
|
+
);
|
|
1741
|
+
};
|
|
1742
|
+
|
|
1743
|
+
export const EditorTableHeaderColumnToggle = () => {
|
|
1744
|
+
const { editor } = useCurrentEditor();
|
|
1745
|
+
|
|
1746
|
+
const handleClick = useCallback(() => {
|
|
1747
|
+
if (editor) {
|
|
1748
|
+
editor.chain().focus().toggleHeaderColumn().run();
|
|
1749
|
+
}
|
|
1750
|
+
}, [editor]);
|
|
1751
|
+
|
|
1752
|
+
if (!editor) {
|
|
1753
|
+
return null;
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
return (
|
|
1757
|
+
<Tooltip>
|
|
1758
|
+
<TooltipTrigger asChild>
|
|
1759
|
+
<Button
|
|
1760
|
+
className="flex items-center gap-2 rounded-full"
|
|
1761
|
+
onClick={handleClick}
|
|
1762
|
+
size="icon"
|
|
1763
|
+
variant="ghost"
|
|
1764
|
+
>
|
|
1765
|
+
<ColumnsIcon className="text-muted-foreground" size={16} />
|
|
1766
|
+
</Button>
|
|
1767
|
+
</TooltipTrigger>
|
|
1768
|
+
<TooltipContent>
|
|
1769
|
+
<span>Toggle header column</span>
|
|
1770
|
+
</TooltipContent>
|
|
1771
|
+
</Tooltip>
|
|
1772
|
+
);
|
|
1773
|
+
};
|
|
1774
|
+
|
|
1775
|
+
export const EditorTableHeaderRowToggle = () => {
|
|
1776
|
+
const { editor } = useCurrentEditor();
|
|
1777
|
+
|
|
1778
|
+
const handleClick = useCallback(() => {
|
|
1779
|
+
if (editor) {
|
|
1780
|
+
editor.chain().focus().toggleHeaderRow().run();
|
|
1781
|
+
}
|
|
1782
|
+
}, [editor]);
|
|
1783
|
+
|
|
1784
|
+
if (!editor) {
|
|
1785
|
+
return null;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
return (
|
|
1789
|
+
<Tooltip>
|
|
1790
|
+
<TooltipTrigger asChild>
|
|
1791
|
+
<Button
|
|
1792
|
+
className="flex items-center gap-2 rounded-full"
|
|
1793
|
+
onClick={handleClick}
|
|
1794
|
+
size="icon"
|
|
1795
|
+
variant="ghost"
|
|
1796
|
+
>
|
|
1797
|
+
<RowsIcon className="text-muted-foreground" size={16} />
|
|
1798
|
+
</Button>
|
|
1799
|
+
</TooltipTrigger>
|
|
1800
|
+
<TooltipContent>
|
|
1801
|
+
<span>Toggle header row</span>
|
|
1802
|
+
</TooltipContent>
|
|
1803
|
+
</Tooltip>
|
|
1804
|
+
);
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
export const EditorTableDelete = () => {
|
|
1808
|
+
const { editor } = useCurrentEditor();
|
|
1809
|
+
|
|
1810
|
+
const handleClick = useCallback(() => {
|
|
1811
|
+
if (editor) {
|
|
1812
|
+
editor.chain().focus().deleteTable().run();
|
|
1813
|
+
}
|
|
1814
|
+
}, [editor]);
|
|
1815
|
+
|
|
1816
|
+
if (!editor) {
|
|
1817
|
+
return null;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
return (
|
|
1821
|
+
<Tooltip>
|
|
1822
|
+
<TooltipTrigger asChild>
|
|
1823
|
+
<Button
|
|
1824
|
+
className="flex items-center gap-2 rounded-full"
|
|
1825
|
+
onClick={handleClick}
|
|
1826
|
+
size="icon"
|
|
1827
|
+
variant="ghost"
|
|
1828
|
+
>
|
|
1829
|
+
<TrashIcon className="text-destructive" size={16} />
|
|
1830
|
+
</Button>
|
|
1831
|
+
</TooltipTrigger>
|
|
1832
|
+
<TooltipContent>
|
|
1833
|
+
<span>Delete table</span>
|
|
1834
|
+
</TooltipContent>
|
|
1835
|
+
</Tooltip>
|
|
1836
|
+
);
|
|
1837
|
+
};
|
|
1838
|
+
|
|
1839
|
+
export const EditorTableMergeCells = () => {
|
|
1840
|
+
const { editor } = useCurrentEditor();
|
|
1841
|
+
|
|
1842
|
+
const handleClick = useCallback(() => {
|
|
1843
|
+
if (editor) {
|
|
1844
|
+
editor.chain().focus().mergeCells().run();
|
|
1845
|
+
}
|
|
1846
|
+
}, [editor]);
|
|
1847
|
+
|
|
1848
|
+
if (!editor) {
|
|
1849
|
+
return null;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
return (
|
|
1853
|
+
<Tooltip>
|
|
1854
|
+
<TooltipTrigger asChild>
|
|
1855
|
+
<Button
|
|
1856
|
+
className="flex items-center gap-2 rounded-full"
|
|
1857
|
+
onClick={handleClick}
|
|
1858
|
+
size="icon"
|
|
1859
|
+
variant="ghost"
|
|
1860
|
+
>
|
|
1861
|
+
<TableCellsMergeIcon className="text-muted-foreground" size={16} />
|
|
1862
|
+
</Button>
|
|
1863
|
+
</TooltipTrigger>
|
|
1864
|
+
<TooltipContent>
|
|
1865
|
+
<span>Merge cells</span>
|
|
1866
|
+
</TooltipContent>
|
|
1867
|
+
</Tooltip>
|
|
1868
|
+
);
|
|
1869
|
+
};
|
|
1870
|
+
|
|
1871
|
+
export const EditorTableSplitCell = () => {
|
|
1872
|
+
const { editor } = useCurrentEditor();
|
|
1873
|
+
|
|
1874
|
+
const handleClick = useCallback(() => {
|
|
1875
|
+
if (editor) {
|
|
1876
|
+
editor.chain().focus().splitCell().run();
|
|
1877
|
+
}
|
|
1878
|
+
}, [editor]);
|
|
1879
|
+
|
|
1880
|
+
if (!editor) {
|
|
1881
|
+
return null;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
return (
|
|
1885
|
+
<Tooltip>
|
|
1886
|
+
<TooltipTrigger asChild>
|
|
1887
|
+
<Button
|
|
1888
|
+
className="flex items-center gap-2 rounded-full"
|
|
1889
|
+
onClick={handleClick}
|
|
1890
|
+
size="icon"
|
|
1891
|
+
variant="ghost"
|
|
1892
|
+
>
|
|
1893
|
+
<TableColumnsSplitIcon className="text-muted-foreground" size={16} />
|
|
1894
|
+
</Button>
|
|
1895
|
+
</TooltipTrigger>
|
|
1896
|
+
<TooltipContent>
|
|
1897
|
+
<span>Split cell</span>
|
|
1898
|
+
</TooltipContent>
|
|
1899
|
+
</Tooltip>
|
|
1900
|
+
);
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1903
|
+
export const EditorTableFix = () => {
|
|
1904
|
+
const { editor } = useCurrentEditor();
|
|
1905
|
+
|
|
1906
|
+
const handleClick = useCallback(() => {
|
|
1907
|
+
if (editor) {
|
|
1908
|
+
editor.chain().focus().fixTables().run();
|
|
1909
|
+
}
|
|
1910
|
+
}, [editor]);
|
|
1911
|
+
|
|
1912
|
+
if (!editor) {
|
|
1913
|
+
return null;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
return (
|
|
1917
|
+
<Tooltip>
|
|
1918
|
+
<TooltipTrigger asChild>
|
|
1919
|
+
<Button
|
|
1920
|
+
className="flex items-center gap-2 rounded-full"
|
|
1921
|
+
onClick={handleClick}
|
|
1922
|
+
size="icon"
|
|
1923
|
+
variant="ghost"
|
|
1924
|
+
>
|
|
1925
|
+
<BoltIcon className="text-muted-foreground" size={16} />
|
|
1926
|
+
</Button>
|
|
1927
|
+
</TooltipTrigger>
|
|
1928
|
+
<TooltipContent>
|
|
1929
|
+
<span>Fix table</span>
|
|
1930
|
+
</TooltipContent>
|
|
1931
|
+
</Tooltip>
|
|
1932
|
+
);
|
|
1933
|
+
};
|
|
1934
|
+
|
|
1935
|
+
export type EditorCharacterCountProps = {
|
|
1936
|
+
children: ReactNode;
|
|
1937
|
+
className?: string;
|
|
1938
|
+
};
|
|
1939
|
+
|
|
1940
|
+
export const EditorCharacterCount = {
|
|
1941
|
+
Characters({ children, className }: EditorCharacterCountProps) {
|
|
1942
|
+
const { editor } = useCurrentEditor();
|
|
1943
|
+
|
|
1944
|
+
if (!editor) {
|
|
1945
|
+
return null;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
return (
|
|
1949
|
+
<div
|
|
1950
|
+
className={cn(
|
|
1951
|
+
"absolute right-4 bottom-4 rounded-md border bg-background p-2 text-muted-foreground text-sm shadow",
|
|
1952
|
+
className
|
|
1953
|
+
)}
|
|
1954
|
+
>
|
|
1955
|
+
{children}
|
|
1956
|
+
{editor.storage.characterCount.characters()}
|
|
1957
|
+
</div>
|
|
1958
|
+
);
|
|
1959
|
+
},
|
|
1960
|
+
|
|
1961
|
+
Words({ children, className }: EditorCharacterCountProps) {
|
|
1962
|
+
const { editor } = useCurrentEditor();
|
|
1963
|
+
|
|
1964
|
+
if (!editor) {
|
|
1965
|
+
return null;
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
return (
|
|
1969
|
+
<div
|
|
1970
|
+
className={cn(
|
|
1971
|
+
"absolute right-4 bottom-4 rounded-md border bg-background p-2 text-muted-foreground text-sm shadow",
|
|
1972
|
+
className
|
|
1973
|
+
)}
|
|
1974
|
+
>
|
|
1975
|
+
{children}
|
|
1976
|
+
{editor.storage.characterCount.words()}
|
|
1977
|
+
</div>
|
|
1978
|
+
);
|
|
1979
|
+
},
|
|
1980
|
+
};
|