@julianoczkowski/create-trimble-app 2.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 +191 -0
- package/bin/create-trimble-app.js +9 -0
- package/package.json +67 -0
- package/src/cli.js +134 -0
- package/src/frameworks.js +28 -0
- package/src/scaffold.js +209 -0
- package/src/utils/file.js +47 -0
- package/src/utils/git.js +140 -0
- package/src/utils/install.js +25 -0
- package/src/utils/logger.js +124 -0
- package/templates/angular/.cursor/commands/remove-dev-content.md +394 -0
- package/templates/angular/.cursor/mcp.json +13 -0
- package/templates/angular/.cursor/rules/modus-angular-20.mdc +82 -0
- package/templates/angular/.cursor/rules/modus-angular-accordion-state-management-short.mdc +45 -0
- package/templates/angular/.cursor/rules/modus-angular-accordion-state-management.mdc +322 -0
- package/templates/angular/.cursor/rules/modus-angular-best-practices.mdc +472 -0
- package/templates/angular/.cursor/rules/modus-angular-border-usage-short.mdc +48 -0
- package/templates/angular/.cursor/rules/modus-angular-border-usage.mdc +286 -0
- package/templates/angular/.cursor/rules/modus-angular-button-group-usage-short.mdc +47 -0
- package/templates/angular/.cursor/rules/modus-angular-button-group-usage.mdc +263 -0
- package/templates/angular/.cursor/rules/modus-angular-checkbox-value-inversion-short.mdc +36 -0
- package/templates/angular/.cursor/rules/modus-angular-checkbox-value-inversion.mdc +92 -0
- package/templates/angular/.cursor/rules/modus-angular-chrome-devtools-testing-short.mdc +34 -0
- package/templates/angular/.cursor/rules/modus-angular-chrome-devtools-testing.mdc +185 -0
- package/templates/angular/.cursor/rules/modus-angular-color-usage-short.mdc +56 -0
- package/templates/angular/.cursor/rules/modus-angular-color-usage.mdc +208 -0
- package/templates/angular/.cursor/rules/modus-angular-components-reference.mdc +114 -0
- package/templates/angular/.cursor/rules/modus-angular-design-system.mdc +273 -0
- package/templates/angular/.cursor/rules/modus-angular-development-workflow-short.mdc +43 -0
- package/templates/angular/.cursor/rules/modus-angular-development-workflow.mdc +145 -0
- package/templates/angular/.cursor/rules/modus-angular-essentials.mdc +272 -0
- package/templates/angular/.cursor/rules/modus-angular-forms-validation-short.mdc +56 -0
- package/templates/angular/.cursor/rules/modus-angular-forms-validation.mdc +124 -0
- package/templates/angular/.cursor/rules/modus-angular-icon-names.mdc +70 -0
- package/templates/angular/.cursor/rules/modus-angular-icons-short.mdc +40 -0
- package/templates/angular/.cursor/rules/modus-angular-icons.mdc +137 -0
- package/templates/angular/.cursor/rules/modus-angular-implementation-guides-short.mdc +36 -0
- package/templates/angular/.cursor/rules/modus-angular-implementation-guides.mdc +301 -0
- package/templates/angular/.cursor/rules/modus-angular-integration-short.mdc +60 -0
- package/templates/angular/.cursor/rules/modus-angular-integration.mdc +1096 -0
- package/templates/angular/.cursor/rules/modus-angular-master.mdc +164 -0
- package/templates/angular/.cursor/rules/modus-angular-modal-usage-short.mdc +51 -0
- package/templates/angular/.cursor/rules/modus-angular-modal-usage.mdc +115 -0
- package/templates/angular/.cursor/rules/modus-angular-navbar-usage-short.mdc +49 -0
- package/templates/angular/.cursor/rules/modus-angular-navbar-usage.mdc +146 -0
- package/templates/angular/.cursor/rules/modus-angular-no-emojis.mdc +66 -0
- package/templates/angular/.cursor/rules/modus-angular-opacity-utilities-short.mdc +43 -0
- package/templates/angular/.cursor/rules/modus-angular-opacity-utilities.mdc +160 -0
- package/templates/angular/.cursor/rules/modus-angular-select-vs-dropdown-menu-short.mdc +51 -0
- package/templates/angular/.cursor/rules/modus-angular-select-vs-dropdown-menu.mdc +83 -0
- package/templates/angular/.cursor/rules/modus-angular-semantic-html-short.mdc +36 -0
- package/templates/angular/.cursor/rules/modus-angular-semantic-html.mdc +81 -0
- package/templates/angular/.cursor/rules/modus-angular-side-navigation-usage-short.mdc +50 -0
- package/templates/angular/.cursor/rules/modus-angular-side-navigation-usage.mdc +136 -0
- package/templates/angular/.cursor/rules/modus-angular-table-usage-short.mdc +52 -0
- package/templates/angular/.cursor/rules/modus-angular-table-usage.mdc +151 -0
- package/templates/angular/.cursor/rules/modus-angular-tailwind-usage-short.mdc +44 -0
- package/templates/angular/.cursor/rules/modus-angular-tailwind-usage.mdc +242 -0
- package/templates/angular/.cursor/rules/modus-angular-themes-short.mdc +54 -0
- package/templates/angular/.cursor/rules/modus-angular-themes.mdc +222 -0
- package/templates/angular/.cursor/rules/modus-angular-utility-panel-usage-short.mdc +52 -0
- package/templates/angular/.cursor/rules/modus-angular-utility-panel-usage.mdc +130 -0
- package/templates/angular/.cursor/rules/ux/gestalt-laws-detailed.mdc +514 -0
- package/templates/angular/.cursor/rules/ux/ux-ui-foundations.mdc +235 -0
- package/templates/angular/.cursor/skills/run-lint-checks/SKILL.md +169 -0
- package/templates/angular/.editorconfig +17 -0
- package/templates/angular/.github/dependabot.yml +19 -0
- package/templates/angular/.github/workflows/a11y-check.yml +135 -0
- package/templates/angular/.github/workflows/ci.yml +44 -0
- package/templates/angular/.husky/pre-commit +32 -0
- package/templates/angular/.postcssrc.json +5 -0
- package/templates/angular/.vscode/extensions.json +4 -0
- package/templates/angular/.vscode/launch.json +20 -0
- package/templates/angular/.vscode/tasks.json +42 -0
- package/templates/angular/CLAUDE.md +148 -0
- package/templates/angular/README.md +92 -0
- package/templates/angular/amplify.yml +25 -0
- package/templates/angular/angular.json +106 -0
- package/templates/angular/data/modusIcons.ts +861 -0
- package/templates/angular/package-lock.json +11030 -0
- package/templates/angular/package.json +66 -0
- package/templates/angular/public/angular-icon.svg +12 -0
- package/templates/angular/public/favicon.ico +0 -0
- package/templates/angular/public/modus-icons.css +49 -0
- package/templates/angular/public/vite.svg +1 -0
- package/templates/angular/scripts/README.md +410 -0
- package/templates/angular/scripts/check-border-violations.js +352 -0
- package/templates/angular/scripts/check-icon-names.js +402 -0
- package/templates/angular/scripts/check-inline-styles.js +292 -0
- package/templates/angular/scripts/check-modus-colors.js +282 -0
- package/templates/angular/scripts/check-modus-icons.js +263 -0
- package/templates/angular/scripts/check-opacity-utilities.js +426 -0
- package/templates/angular/scripts/check-semantic-html.js +452 -0
- package/templates/angular/scripts/check-typescript.js +109 -0
- package/templates/angular/src/app/app.config.ts +29 -0
- package/templates/angular/src/app/app.css +0 -0
- package/templates/angular/src/app/app.html +4 -0
- package/templates/angular/src/app/app.routes.ts +351 -0
- package/templates/angular/src/app/app.spec.ts +27 -0
- package/templates/angular/src/app/app.ts +47 -0
- package/templates/angular/src/app/components/README.md +77 -0
- package/templates/angular/src/app/components/index.ts +53 -0
- package/templates/angular/src/app/components/modus-accordion.component.ts +50 -0
- package/templates/angular/src/app/components/modus-alert.component.ts +133 -0
- package/templates/angular/src/app/components/modus-autocomplete.component.ts +262 -0
- package/templates/angular/src/app/components/modus-avatar.component.ts +75 -0
- package/templates/angular/src/app/components/modus-badge.component.ts +84 -0
- package/templates/angular/src/app/components/modus-breadcrumbs.component.ts +65 -0
- package/templates/angular/src/app/components/modus-button-group.component.ts +82 -0
- package/templates/angular/src/app/components/modus-button.component.ts +292 -0
- package/templates/angular/src/app/components/modus-card.component.ts +73 -0
- package/templates/angular/src/app/components/modus-checkbox.component.ts +117 -0
- package/templates/angular/src/app/components/modus-chip.component.ts +97 -0
- package/templates/angular/src/app/components/modus-collapse.component.ts +118 -0
- package/templates/angular/src/app/components/modus-date.component.ts +165 -0
- package/templates/angular/src/app/components/modus-dropdown-menu.component.ts +108 -0
- package/templates/angular/src/app/components/modus-file-dropzone.component.ts +121 -0
- package/templates/angular/src/app/components/modus-handle.component.ts +96 -0
- package/templates/angular/src/app/components/modus-icon.component.ts +81 -0
- package/templates/angular/src/app/components/modus-input-feedback.component.ts +54 -0
- package/templates/angular/src/app/components/modus-input-label.component.ts +62 -0
- package/templates/angular/src/app/components/modus-loader.component.ts +48 -0
- package/templates/angular/src/app/components/modus-logo.component.ts +115 -0
- package/templates/angular/src/app/components/modus-menu-item.component.ts +116 -0
- package/templates/angular/src/app/components/modus-menu.component.ts +58 -0
- package/templates/angular/src/app/components/modus-modal.component.ts +70 -0
- package/templates/angular/src/app/components/modus-navbar.component.ts +303 -0
- package/templates/angular/src/app/components/modus-number-input.component.ts +174 -0
- package/templates/angular/src/app/components/modus-pagination.component.ts +74 -0
- package/templates/angular/src/app/components/modus-panel.component.ts +61 -0
- package/templates/angular/src/app/components/modus-progress.component.ts +62 -0
- package/templates/angular/src/app/components/modus-radio.component.ts +102 -0
- package/templates/angular/src/app/components/modus-rating.component.ts +80 -0
- package/templates/angular/src/app/components/modus-select.component.ts +131 -0
- package/templates/angular/src/app/components/modus-side-navigation.component.ts +90 -0
- package/templates/angular/src/app/components/modus-skeleton.component.ts +54 -0
- package/templates/angular/src/app/components/modus-slider.component.ts +132 -0
- package/templates/angular/src/app/components/modus-stepper.component.ts +65 -0
- package/templates/angular/src/app/components/modus-switch.component.ts +118 -0
- package/templates/angular/src/app/components/modus-table.component.ts +204 -0
- package/templates/angular/src/app/components/modus-tabs.component.ts +82 -0
- package/templates/angular/src/app/components/modus-text-input.component.ts +221 -0
- package/templates/angular/src/app/components/modus-textarea.component.ts +168 -0
- package/templates/angular/src/app/components/modus-theme-switcher.component.ts +45 -0
- package/templates/angular/src/app/components/modus-time-input.component.ts +172 -0
- package/templates/angular/src/app/components/modus-toast.component.ts +63 -0
- package/templates/angular/src/app/components/modus-toolbar.component.ts +43 -0
- package/templates/angular/src/app/components/modus-tooltip.component.ts +83 -0
- package/templates/angular/src/app/components/modus-typography.component.ts +79 -0
- package/templates/angular/src/app/components/modus-utility-panel.component.ts +275 -0
- package/templates/angular/src/app/components/theme-demo.component.ts +1242 -0
- package/templates/angular/src/app/data/component-demos.ts +360 -0
- package/templates/angular/src/app/data/modus-icons.ts +806 -0
- package/templates/angular/src/app/demos/accordion/accordion-demo.component.ts +212 -0
- package/templates/angular/src/app/demos/alert/alert-demo.component.ts +108 -0
- package/templates/angular/src/app/demos/autocomplete/autocomplete-demo.component.ts +174 -0
- package/templates/angular/src/app/demos/avatar/avatar-demo.component.ts +149 -0
- package/templates/angular/src/app/demos/badge/badge-demo.component.ts +148 -0
- package/templates/angular/src/app/demos/breadcrumbs/breadcrumbs-demo.component.ts +96 -0
- package/templates/angular/src/app/demos/button/button-demo.component.ts +256 -0
- package/templates/angular/src/app/demos/button-group/button-group-demo.component.ts +215 -0
- package/templates/angular/src/app/demos/card/card-demo.component.ts +180 -0
- package/templates/angular/src/app/demos/checkbox/checkbox-demo.component.ts +71 -0
- package/templates/angular/src/app/demos/chip/chip-demo.component.ts +183 -0
- package/templates/angular/src/app/demos/date/date-demo.component.ts +193 -0
- package/templates/angular/src/app/demos/dropdown/dropdown-demo.component.ts +196 -0
- package/templates/angular/src/app/demos/file-dropzone/file-dropzone-demo.component.ts +176 -0
- package/templates/angular/src/app/demos/handle/handle-demo.component.ts +265 -0
- package/templates/angular/src/app/demos/icon/icon-demo.component.ts +65 -0
- package/templates/angular/src/app/demos/input-feedback/input-feedback-demo.component.ts +189 -0
- package/templates/angular/src/app/demos/input-label/input-label-demo.component.ts +330 -0
- package/templates/angular/src/app/demos/loader/loader-demo.component.ts +143 -0
- package/templates/angular/src/app/demos/logo/logo-demo.component.ts +191 -0
- package/templates/angular/src/app/demos/menu/menu-demo.component.ts +72 -0
- package/templates/angular/src/app/demos/modal/modal-demo.component.ts +278 -0
- package/templates/angular/src/app/demos/navbar/navbar-demo.component.ts +135 -0
- package/templates/angular/src/app/demos/number-input/number-input-demo.component.ts +175 -0
- package/templates/angular/src/app/demos/pagination/pagination-demo.component.ts +134 -0
- package/templates/angular/src/app/demos/panel/panel-demo.component.ts +235 -0
- package/templates/angular/src/app/demos/progress/progress-demo.component.ts +169 -0
- package/templates/angular/src/app/demos/radio/radio-demo.component.ts +161 -0
- package/templates/angular/src/app/demos/rating/rating-demo.component.ts +97 -0
- package/templates/angular/src/app/demos/select/select-demo.component.ts +107 -0
- package/templates/angular/src/app/demos/shared/demo-example-clean.component.ts +41 -0
- package/templates/angular/src/app/demos/shared/demo-example.component.ts +42 -0
- package/templates/angular/src/app/demos/shared/demo-page.component.ts +97 -0
- package/templates/angular/src/app/demos/shared/index.ts +3 -0
- package/templates/angular/src/app/demos/side-navigation/side-navigation-demo.component.ts +524 -0
- package/templates/angular/src/app/demos/skeleton/skeleton-demo.component.ts +112 -0
- package/templates/angular/src/app/demos/slider/slider-demo.component.ts +76 -0
- package/templates/angular/src/app/demos/stepper/stepper-demo.component.ts +79 -0
- package/templates/angular/src/app/demos/switch/switch-demo.component.ts +113 -0
- package/templates/angular/src/app/demos/table/table-demo.component.ts +405 -0
- package/templates/angular/src/app/demos/tabs/tabs-demo.component.ts +318 -0
- package/templates/angular/src/app/demos/text-input/text-input-demo.component.ts +160 -0
- package/templates/angular/src/app/demos/textarea/textarea-demo.component.ts +95 -0
- package/templates/angular/src/app/demos/theme-switcher/theme-switcher-demo.component.ts +38 -0
- package/templates/angular/src/app/demos/time-input/time-input-demo.component.ts +130 -0
- package/templates/angular/src/app/demos/toast/toast-demo.component.ts +258 -0
- package/templates/angular/src/app/demos/toolbar/toolbar-demo.component.ts +54 -0
- package/templates/angular/src/app/demos/tooltip/tooltip-demo.component.ts +163 -0
- package/templates/angular/src/app/demos/utility-panel/utility-panel-demo.component.ts +197 -0
- package/templates/angular/src/app/dev/dev-config.ts +119 -0
- package/templates/angular/src/app/dev/dev-panel/dev-panel.component.ts +215 -0
- package/templates/angular/src/app/dev/dev-panel.service.ts +63 -0
- package/templates/angular/src/app/dev/index.ts +8 -0
- package/templates/angular/src/app/dev/theme-switcher-dropdown/theme-switcher-dropdown.component.ts +134 -0
- package/templates/angular/src/app/dev-pages/color-palette/color-palette.component.ts +229 -0
- package/templates/angular/src/app/dev-pages/components-gallery/components-gallery.component.ts +486 -0
- package/templates/angular/src/app/dev-pages/icons/icons.component.ts +149 -0
- package/templates/angular/src/app/pages/home/home.component.ts +251 -0
- package/templates/angular/src/app/services/README.md +57 -0
- package/templates/angular/src/app/services/theme.service.ts +163 -0
- package/templates/angular/src/environments/environment.development.ts +8 -0
- package/templates/angular/src/environments/environment.ts +8 -0
- package/templates/angular/src/index.html +14 -0
- package/templates/angular/src/main.ts +6 -0
- package/templates/angular/src/styles.css +1328 -0
- package/templates/angular/tsconfig.app.json +15 -0
- package/templates/angular/tsconfig.json +35 -0
- package/templates/angular/tsconfig.spec.json +14 -0
- package/templates/config.json +23 -0
- package/templates/react/.cursor/commands/remove-dev-content.md +311 -0
- package/templates/react/.cursor/mcp.json +13 -0
- package/templates/react/.cursor/rules/README.md +240 -0
- package/templates/react/.cursor/rules/border-usage-guidelines-short.mdc +22 -0
- package/templates/react/.cursor/rules/border-usage-guidelines.mdc +380 -0
- package/templates/react/.cursor/rules/chrome-devtools-testing-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/development-workflow-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/development-workflow-react.mdc +292 -0
- package/templates/react/.cursor/rules/implementation-guides-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/implementation-guides-react.mdc +446 -0
- package/templates/react/.cursor/rules/modus-accordion-state-management-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-accordion-state-management-react.mdc +445 -0
- package/templates/react/.cursor/rules/modus-button-group-usage-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-button-group-usage-react.mdc +117 -0
- package/templates/react/.cursor/rules/modus-checkbox-value-inversion-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-checkbox-value-inversion-react.mdc +492 -0
- package/templates/react/.cursor/rules/modus-color-usage-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-color-usage-react.mdc +420 -0
- package/templates/react/.cursor/rules/modus-components-reference.mdc +366 -0
- package/templates/react/.cursor/rules/modus-icon-names.mdc +63 -0
- package/templates/react/.cursor/rules/modus-icons-react-short.mdc +24 -0
- package/templates/react/.cursor/rules/modus-icons-react.mdc +402 -0
- package/templates/react/.cursor/rules/modus-modal-implementation-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-modal-implementation-react.mdc +831 -0
- package/templates/react/.cursor/rules/modus-navbar-side-navigation-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-navbar-side-navigation-react.mdc +247 -0
- package/templates/react/.cursor/rules/modus-no-emojis-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-opacity-utilities-react-short.mdc +70 -0
- package/templates/react/.cursor/rules/modus-opacity-utilities-react.mdc +208 -0
- package/templates/react/.cursor/rules/modus-react-best-practices-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-react-best-practices.mdc +508 -0
- package/templates/react/.cursor/rules/modus-react-essentials.mdc +209 -0
- package/templates/react/.cursor/rules/modus-react-integration-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-react-integration.mdc +509 -0
- package/templates/react/.cursor/rules/modus-react-key-warnings-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-react-key-warnings.mdc +805 -0
- package/templates/react/.cursor/rules/modus-react-master.mdc +160 -0
- package/templates/react/.cursor/rules/modus-select-vs-dropdown-menu-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-select-vs-dropdown-menu-react.mdc +442 -0
- package/templates/react/.cursor/rules/modus-semantic-html-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-semantic-html-react.mdc +427 -0
- package/templates/react/.cursor/rules/modus-tailwind-usage-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-tailwind-usage-react.mdc +642 -0
- package/templates/react/.cursor/rules/modus-themes-react-short.mdc +23 -0
- package/templates/react/.cursor/rules/modus-themes-react.mdc +506 -0
- package/templates/react/.cursor/rules/ux/gestalt-laws-detailed.mdc +456 -0
- package/templates/react/.cursor/rules/ux/ux-ui-foundations.mdc +211 -0
- package/templates/react/.cursor/skills/create-modus-form-component/SKILL.md +518 -0
- package/templates/react/.cursor/skills/create-modus-wrapper-component/SKILL.md +252 -0
- package/templates/react/.cursor/skills/fix-modus-component-event-issues/SKILL.md +345 -0
- package/templates/react/.cursor/skills/handle-modus-checkbox-value-bug/SKILL.md +202 -0
- package/templates/react/.cursor/skills/implement-modus-modal-with-refs/SKILL.md +386 -0
- package/templates/react/.cursor/skills/integrate-modus-icons/SKILL.md +300 -0
- package/templates/react/.cursor/skills/run-lint-checks/SKILL.md +235 -0
- package/templates/react/.cursor/skills/set-up-modus-event-listeners/SKILL.md +284 -0
- package/templates/react/.cursor/skills/style-modus-components-with-tailwind/SKILL.md +382 -0
- package/templates/react/.env.development +3 -0
- package/templates/react/.env.production +3 -0
- package/templates/react/.github/CODEOWNERS +28 -0
- package/templates/react/.github/ISSUE_TEMPLATE/bug_report.yml +176 -0
- package/templates/react/.github/ISSUE_TEMPLATE/config.yml +20 -0
- package/templates/react/.github/ISSUE_TEMPLATE/documentation.yml +115 -0
- package/templates/react/.github/ISSUE_TEMPLATE/feature_request.yml +171 -0
- package/templates/react/.github/ISSUE_TEMPLATE/question.yml +139 -0
- package/templates/react/.github/copilot-instructions.md +80 -0
- package/templates/react/.github/instructions/components.instructions.md +82 -0
- package/templates/react/.github/instructions/demos.instructions.md +82 -0
- package/templates/react/.github/instructions/pages.instructions.md +76 -0
- package/templates/react/.github/instructions/styles.instructions.md +77 -0
- package/templates/react/.github/instructions/typescript.instructions.md +101 -0
- package/templates/react/.github/pull_request_template.md +188 -0
- package/templates/react/.github/workflows/ci.yml +43 -0
- package/templates/react/.github/workflows/claude-code-review.yml +44 -0
- package/templates/react/.github/workflows/claude.yml +50 -0
- package/templates/react/.husky/pre-commit +28 -0
- package/templates/react/.vscode/extensions.json +8 -0
- package/templates/react/CLAUDE.md +119 -0
- package/templates/react/CODE_OF_CONDUCT.md +79 -0
- package/templates/react/CONTRIBUTING.md +65 -0
- package/templates/react/LICENSE +21 -0
- package/templates/react/README.md +728 -0
- package/templates/react/SECURITY.md +50 -0
- package/templates/react/eslint.config.js +23 -0
- package/templates/react/index.html +13 -0
- package/templates/react/package-lock.json +5209 -0
- package/templates/react/package.json +49 -0
- package/templates/react/postcss.config.js +6 -0
- package/templates/react/public/react.svg +1 -0
- package/templates/react/public/vite.svg +1 -0
- package/templates/react/readme_assets/getting_started_header.png +0 -0
- package/templates/react/readme_assets/hero.png +0 -0
- package/templates/react/readme_assets/modus_comp.png +0 -0
- package/templates/react/readme_assets/modus_figma_mcp.png +0 -0
- package/templates/react/readme_assets/teaser_comp.gif +0 -0
- package/templates/react/scripts/README.md +343 -0
- package/templates/react/scripts/check-border-violations.js +483 -0
- package/templates/react/scripts/check-icon-names.js +486 -0
- package/templates/react/scripts/check-inline-styles.js +364 -0
- package/templates/react/scripts/check-modus-colors.js +247 -0
- package/templates/react/scripts/check-modus-icons.js +256 -0
- package/templates/react/scripts/check-opacity-utilities.js +481 -0
- package/templates/react/scripts/check-semantic-html.js +476 -0
- package/templates/react/scripts/check-typescript.js +109 -0
- package/templates/react/src/App.css +42 -0
- package/templates/react/src/App.tsx +54 -0
- package/templates/react/src/assets/react.svg +1 -0
- package/templates/react/src/components/DemoExample.tsx +61 -0
- package/templates/react/src/components/DemoPage.tsx +81 -0
- package/templates/react/src/components/ModusAccordion.tsx +89 -0
- package/templates/react/src/components/ModusAlert.tsx +85 -0
- package/templates/react/src/components/ModusAutocomplete.tsx +207 -0
- package/templates/react/src/components/ModusAvatar.tsx +50 -0
- package/templates/react/src/components/ModusBadge.tsx +82 -0
- package/templates/react/src/components/ModusBreadcrumbs.tsx +75 -0
- package/templates/react/src/components/ModusButton.tsx +244 -0
- package/templates/react/src/components/ModusButtonGroup.tsx +91 -0
- package/templates/react/src/components/ModusCard.tsx +70 -0
- package/templates/react/src/components/ModusCheckbox.tsx +168 -0
- package/templates/react/src/components/ModusChip.tsx +93 -0
- package/templates/react/src/components/ModusDate.tsx +154 -0
- package/templates/react/src/components/ModusDropdownMenu.tsx +148 -0
- package/templates/react/src/components/ModusFileDropzone.tsx +140 -0
- package/templates/react/src/components/ModusHandle.tsx +101 -0
- package/templates/react/src/components/ModusIcon.tsx +49 -0
- package/templates/react/src/components/ModusInputFeedback.tsx +52 -0
- package/templates/react/src/components/ModusInputLabel.tsx +50 -0
- package/templates/react/src/components/ModusLoader.tsx +42 -0
- package/templates/react/src/components/ModusLogo.tsx +102 -0
- package/templates/react/src/components/ModusMenu.tsx +119 -0
- package/templates/react/src/components/ModusMenuItem.tsx +86 -0
- package/templates/react/src/components/ModusModal.tsx +145 -0
- package/templates/react/src/components/ModusNavbar.tsx +504 -0
- package/templates/react/src/components/ModusNumberInput.tsx +230 -0
- package/templates/react/src/components/ModusPagination.tsx +94 -0
- package/templates/react/src/components/ModusPanel.tsx +92 -0
- package/templates/react/src/components/ModusProgress.tsx +70 -0
- package/templates/react/src/components/ModusProvider.tsx +18 -0
- package/templates/react/src/components/ModusRadio.tsx +114 -0
- package/templates/react/src/components/ModusRating.tsx +108 -0
- package/templates/react/src/components/ModusSelect.tsx +171 -0
- package/templates/react/src/components/ModusSideNavigation.tsx +149 -0
- package/templates/react/src/components/ModusSkeleton.tsx +42 -0
- package/templates/react/src/components/ModusSlider.tsx +128 -0
- package/templates/react/src/components/ModusStepper.tsx +85 -0
- package/templates/react/src/components/ModusSwitch.tsx +130 -0
- package/templates/react/src/components/ModusTable.tsx +309 -0
- package/templates/react/src/components/ModusTabs.tsx +114 -0
- package/templates/react/src/components/ModusTextInput.tsx +179 -0
- package/templates/react/src/components/ModusTextarea.tsx +164 -0
- package/templates/react/src/components/ModusThemeSwitcher.tsx +58 -0
- package/templates/react/src/components/ModusTimeInput.tsx +176 -0
- package/templates/react/src/components/ModusToast.tsx +207 -0
- package/templates/react/src/components/ModusToolbar.tsx +70 -0
- package/templates/react/src/components/ModusTooltip.tsx +97 -0
- package/templates/react/src/components/ModusUtilityPanel.tsx +198 -0
- package/templates/react/src/components/ThemeSwitcherDropdown.tsx +117 -0
- package/templates/react/src/components/ThemeToggleSimple.tsx +157 -0
- package/templates/react/src/config/routes.ts +196 -0
- package/templates/react/src/contexts/ThemeContext.tsx +81 -0
- package/templates/react/src/contexts/ThemeContextData.tsx +89 -0
- package/templates/react/src/data/modusIcons.ts +865 -0
- package/templates/react/src/demos/accordion-demo/page.tsx +236 -0
- package/templates/react/src/demos/alert-demo/page.tsx +94 -0
- package/templates/react/src/demos/autocomplete-demo/page.tsx +166 -0
- package/templates/react/src/demos/avatar-demo/page.tsx +135 -0
- package/templates/react/src/demos/badge-demo/page.tsx +174 -0
- package/templates/react/src/demos/breadcrumbs-demo/page.tsx +88 -0
- package/templates/react/src/demos/button-demo/page.tsx +261 -0
- package/templates/react/src/demos/button-group-demo/page.tsx +231 -0
- package/templates/react/src/demos/card-demo/page.tsx +241 -0
- package/templates/react/src/demos/checkbox-demo/page.tsx +79 -0
- package/templates/react/src/demos/chip-demo/page.tsx +197 -0
- package/templates/react/src/demos/date-demo/page.tsx +179 -0
- package/templates/react/src/demos/dropdown-demo/page.tsx +150 -0
- package/templates/react/src/demos/file-dropzone-demo/page.tsx +186 -0
- package/templates/react/src/demos/handle-demo/page.tsx +313 -0
- package/templates/react/src/demos/icon-demo/page.tsx +72 -0
- package/templates/react/src/demos/input-feedback-demo/page.tsx +202 -0
- package/templates/react/src/demos/input-label-demo/page.tsx +392 -0
- package/templates/react/src/demos/loader-demo/page.tsx +138 -0
- package/templates/react/src/demos/logo-demo/page.tsx +292 -0
- package/templates/react/src/demos/menu-demo/page.tsx +70 -0
- package/templates/react/src/demos/modal-demo/page.tsx +332 -0
- package/templates/react/src/demos/navbar-demo/page.tsx +141 -0
- package/templates/react/src/demos/number-input-demo/page.tsx +180 -0
- package/templates/react/src/demos/pagination-demo/page.tsx +147 -0
- package/templates/react/src/demos/panel-demo/page.tsx +376 -0
- package/templates/react/src/demos/progress-demo/page.tsx +185 -0
- package/templates/react/src/demos/radio-demo/page.tsx +242 -0
- package/templates/react/src/demos/rating-demo/page.tsx +97 -0
- package/templates/react/src/demos/select-demo/page.tsx +111 -0
- package/templates/react/src/demos/side-navigation-demo/page.tsx +775 -0
- package/templates/react/src/demos/skeleton-demo/page.tsx +107 -0
- package/templates/react/src/demos/slider-demo/page.tsx +78 -0
- package/templates/react/src/demos/stepper-demo/page.tsx +86 -0
- package/templates/react/src/demos/switch-demo/page.tsx +146 -0
- package/templates/react/src/demos/table-demo/page.tsx +489 -0
- package/templates/react/src/demos/tabs-demo/page.tsx +187 -0
- package/templates/react/src/demos/text-input-demo/page.tsx +151 -0
- package/templates/react/src/demos/textarea-demo/page.tsx +73 -0
- package/templates/react/src/demos/theme-switcher-demo/page.tsx +26 -0
- package/templates/react/src/demos/time-input-demo/page.tsx +148 -0
- package/templates/react/src/demos/toast-demo/page.tsx +302 -0
- package/templates/react/src/demos/toolbar-demo/page.tsx +49 -0
- package/templates/react/src/demos/tooltip-demo/page.tsx +209 -0
- package/templates/react/src/demos/typography-test/page.tsx +28 -0
- package/templates/react/src/demos/utility-panel-demo/page.tsx +197 -0
- package/templates/react/src/dev/DevPanel.tsx +219 -0
- package/templates/react/src/dev/DevPanelContext.ts +14 -0
- package/templates/react/src/dev/DevPanelProvider.tsx +63 -0
- package/templates/react/src/dev/DevRoutes.tsx +98 -0
- package/templates/react/src/dev/config.ts +127 -0
- package/templates/react/src/dev/index.ts +8 -0
- package/templates/react/src/dev/useDevPanel.ts +17 -0
- package/templates/react/src/dev-pages/ColorPalettePage.tsx +347 -0
- package/templates/react/src/dev-pages/ComponentsGalleryPage.tsx +489 -0
- package/templates/react/src/dev-pages/IconsPage.tsx +137 -0
- package/templates/react/src/dev-pages/index.ts +3 -0
- package/templates/react/src/hooks/useTheme.ts +15 -0
- package/templates/react/src/index.css +635 -0
- package/templates/react/src/main.tsx +14 -0
- package/templates/react/src/pages/HomePage.tsx +283 -0
- package/templates/react/src/vite-env.d.ts +9 -0
- package/templates/react/tailwind.config.js +58 -0
- package/templates/react/tsconfig.app.json +27 -0
- package/templates/react/tsconfig.json +7 -0
- package/templates/react/tsconfig.node.json +25 -0
- package/templates/react/vite.config.ts +18 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { Component, signal } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { DemoPageComponent } from '../shared/demo-page.component';
|
|
4
|
+
import { DemoExampleComponent } from '../shared/demo-example.component';
|
|
5
|
+
import { ModusDateComponent } from '../../components/modus-date.component';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Demo page showcasing the Modus Date component.
|
|
9
|
+
*
|
|
10
|
+
* Demonstrates date input features including:
|
|
11
|
+
* - Basic date input
|
|
12
|
+
* - Different sizes (sm, md, lg)
|
|
13
|
+
* - Date formats
|
|
14
|
+
* - Min and max date constraints
|
|
15
|
+
* - Feedback messages
|
|
16
|
+
* - Disabled and read-only states
|
|
17
|
+
* - Required field
|
|
18
|
+
*/
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'app-date-demo-page',
|
|
21
|
+
standalone: true,
|
|
22
|
+
imports: [CommonModule, DemoPageComponent, DemoExampleComponent, ModusDateComponent],
|
|
23
|
+
template: `
|
|
24
|
+
<demo-page
|
|
25
|
+
title="Modus Date"
|
|
26
|
+
description="Date inputs allow users to select dates from a calendar picker or enter dates manually. Use date inputs for birth dates, appointment scheduling, date ranges, and any scenario requiring date selection."
|
|
27
|
+
>
|
|
28
|
+
<demo-example
|
|
29
|
+
title="Basic Date Input"
|
|
30
|
+
description="Simple date input with label for date selection."
|
|
31
|
+
>
|
|
32
|
+
<div class="flex flex-col gap-4">
|
|
33
|
+
<modus-date label="Select Date" [value]="selectedDate()" (inputChange)="handleDateChange($event)" />
|
|
34
|
+
@if (selectedDate()) {
|
|
35
|
+
<div class="mt-4 p-4 rounded-lg bg-muted text-muted-foreground">
|
|
36
|
+
<div class="font-semibold mb-2">Selected Date:</div>
|
|
37
|
+
<div class="text-sm">{{ selectedDate() }}</div>
|
|
38
|
+
</div>
|
|
39
|
+
}
|
|
40
|
+
</div>
|
|
41
|
+
</demo-example>
|
|
42
|
+
|
|
43
|
+
<demo-example
|
|
44
|
+
title="Date Sizes"
|
|
45
|
+
description="Different sizes for various contexts and visual hierarchy."
|
|
46
|
+
>
|
|
47
|
+
<div class="flex flex-col gap-4">
|
|
48
|
+
<modus-date label="Small Date Input" size="sm" />
|
|
49
|
+
<modus-date label="Medium Date Input (Default)" size="md" />
|
|
50
|
+
<modus-date label="Large Date Input" size="lg" />
|
|
51
|
+
</div>
|
|
52
|
+
</demo-example>
|
|
53
|
+
|
|
54
|
+
<demo-example
|
|
55
|
+
title="Date Formats"
|
|
56
|
+
description="Different date format options for various locales and preferences."
|
|
57
|
+
>
|
|
58
|
+
<div class="flex flex-col gap-4">
|
|
59
|
+
<modus-date label="YYYY-MM-DD Format" format="yyyy-mm-dd" />
|
|
60
|
+
<modus-date label="DD-MM-YYYY Format" format="dd-mm-yyyy" />
|
|
61
|
+
<modus-date label="YYYY/MM/DD Format" format="yyyy/mm/dd" />
|
|
62
|
+
<modus-date label="DD/MM/YYYY Format" format="dd/mm/yyyy" />
|
|
63
|
+
<modus-date label="MMM DD, YYYY Format" format="MMM DD, YYYY" />
|
|
64
|
+
</div>
|
|
65
|
+
</demo-example>
|
|
66
|
+
|
|
67
|
+
<demo-example
|
|
68
|
+
title="Date Constraints"
|
|
69
|
+
description="Set minimum and maximum dates to restrict date selection."
|
|
70
|
+
>
|
|
71
|
+
<div class="flex flex-col gap-4">
|
|
72
|
+
<modus-date
|
|
73
|
+
label="Start Date (Min: Today)"
|
|
74
|
+
[min]="minDate()"
|
|
75
|
+
[value]="startDate()"
|
|
76
|
+
(inputChange)="handleStartDateChange($event)"
|
|
77
|
+
/>
|
|
78
|
+
<modus-date
|
|
79
|
+
label="End Date (Max: 1 Year from Start)"
|
|
80
|
+
[min]="startDate()"
|
|
81
|
+
[max]="maxDate()"
|
|
82
|
+
[value]="endDate()"
|
|
83
|
+
(inputChange)="handleEndDateChange($event)"
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
</demo-example>
|
|
87
|
+
|
|
88
|
+
<demo-example
|
|
89
|
+
title="Feedback Messages"
|
|
90
|
+
description="Display validation feedback with different severity levels."
|
|
91
|
+
>
|
|
92
|
+
<div class="flex flex-col gap-4">
|
|
93
|
+
<modus-date
|
|
94
|
+
label="Date with Success Feedback"
|
|
95
|
+
[feedback]="{
|
|
96
|
+
level: 'success',
|
|
97
|
+
message: 'Date is valid'
|
|
98
|
+
}"
|
|
99
|
+
/>
|
|
100
|
+
<modus-date
|
|
101
|
+
label="Date with Warning Feedback"
|
|
102
|
+
[feedback]="{
|
|
103
|
+
level: 'warning',
|
|
104
|
+
message: 'Please verify the date'
|
|
105
|
+
}"
|
|
106
|
+
/>
|
|
107
|
+
<modus-date
|
|
108
|
+
label="Date with Error Feedback"
|
|
109
|
+
[feedback]="{
|
|
110
|
+
level: 'error',
|
|
111
|
+
message: 'Invalid date format'
|
|
112
|
+
}"
|
|
113
|
+
/>
|
|
114
|
+
<modus-date
|
|
115
|
+
label="Date with Info Feedback"
|
|
116
|
+
[feedback]="{
|
|
117
|
+
level: 'info',
|
|
118
|
+
message: 'Select a date within the next 30 days'
|
|
119
|
+
}"
|
|
120
|
+
/>
|
|
121
|
+
</div>
|
|
122
|
+
</demo-example>
|
|
123
|
+
|
|
124
|
+
<demo-example
|
|
125
|
+
title="Disabled and Read-Only States"
|
|
126
|
+
description="Date inputs in disabled and read-only states."
|
|
127
|
+
>
|
|
128
|
+
<div class="flex flex-col gap-4">
|
|
129
|
+
<modus-date label="Disabled Date Input" [disabled]="true" value="2024-01-15" />
|
|
130
|
+
<modus-date label="Read-Only Date Input" [readOnly]="true" value="2024-06-20" />
|
|
131
|
+
</div>
|
|
132
|
+
</demo-example>
|
|
133
|
+
|
|
134
|
+
<demo-example
|
|
135
|
+
title="Required Field"
|
|
136
|
+
description="Mark date inputs as required for form validation."
|
|
137
|
+
>
|
|
138
|
+
<div class="flex flex-col gap-4">
|
|
139
|
+
<modus-date label="Birth Date (Required)" [required]="true" />
|
|
140
|
+
<modus-date label="Appointment Date (Required)" [required]="true" />
|
|
141
|
+
</div>
|
|
142
|
+
</demo-example>
|
|
143
|
+
|
|
144
|
+
<demo-example
|
|
145
|
+
title="Bordered and Borderless"
|
|
146
|
+
description="Date inputs with and without borders."
|
|
147
|
+
>
|
|
148
|
+
<div class="flex flex-col gap-4">
|
|
149
|
+
<modus-date label="Bordered Date Input (Default)" [bordered]="true" />
|
|
150
|
+
<modus-date label="Borderless Date Input" [bordered]="false" />
|
|
151
|
+
</div>
|
|
152
|
+
</demo-example>
|
|
153
|
+
</demo-page>
|
|
154
|
+
`,
|
|
155
|
+
})
|
|
156
|
+
export class DateDemoPageComponent {
|
|
157
|
+
readonly selectedDate = signal<string>('');
|
|
158
|
+
readonly startDate = signal<string>('');
|
|
159
|
+
readonly endDate = signal<string>('');
|
|
160
|
+
|
|
161
|
+
readonly minDate = signal<string>(this.getTodayDate());
|
|
162
|
+
readonly maxDate = signal<string>(this.getOneYearFromNowDate());
|
|
163
|
+
|
|
164
|
+
private getTodayDate(): string {
|
|
165
|
+
const today = new Date();
|
|
166
|
+
return today.toISOString().split('T')[0];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
private getOneYearFromNowDate(): string {
|
|
170
|
+
const oneYearFromNow = new Date();
|
|
171
|
+
oneYearFromNow.setFullYear(oneYearFromNow.getFullYear() + 1);
|
|
172
|
+
return oneYearFromNow.toISOString().split('T')[0];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
handleDateChange(event: InputEvent): void {
|
|
176
|
+
const target = event.target as HTMLInputElement;
|
|
177
|
+
this.selectedDate.set(target.value);
|
|
178
|
+
console.log('Date changed:', target.value);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
handleStartDateChange(event: InputEvent): void {
|
|
182
|
+
const target = event.target as HTMLInputElement;
|
|
183
|
+
this.startDate.set(target.value);
|
|
184
|
+
console.log('Start date changed:', target.value);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
handleEndDateChange(event: InputEvent): void {
|
|
188
|
+
const target = event.target as HTMLInputElement;
|
|
189
|
+
this.endDate.set(target.value);
|
|
190
|
+
console.log('End date changed:', target.value);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { DemoPageComponent } from '../shared/demo-page.component';
|
|
4
|
+
import { DemoExampleComponent } from '../shared/demo-example.component';
|
|
5
|
+
import { ModusDropdownMenuComponent } from '../../components/modus-dropdown-menu.component';
|
|
6
|
+
import { ModusMenuComponent } from '../../components/modus-menu.component';
|
|
7
|
+
import { ModusMenuItemComponent } from '../../components/modus-menu-item.component';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Demo page showcasing the Modus Dropdown Menu component.
|
|
11
|
+
*
|
|
12
|
+
* Demonstrates dropdown menu features including:
|
|
13
|
+
* - Basic dropdown menu
|
|
14
|
+
* - Custom button styling
|
|
15
|
+
* - Menu placement options
|
|
16
|
+
* - Different button colors and variants
|
|
17
|
+
* - Menu with icons
|
|
18
|
+
* - Event handling
|
|
19
|
+
*/
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'app-dropdown-demo-page',
|
|
22
|
+
standalone: true,
|
|
23
|
+
imports: [
|
|
24
|
+
CommonModule,
|
|
25
|
+
DemoPageComponent,
|
|
26
|
+
DemoExampleComponent,
|
|
27
|
+
ModusDropdownMenuComponent,
|
|
28
|
+
ModusMenuComponent,
|
|
29
|
+
ModusMenuItemComponent,
|
|
30
|
+
],
|
|
31
|
+
template: `
|
|
32
|
+
<demo-page
|
|
33
|
+
title="Modus Dropdown Menu"
|
|
34
|
+
description="Dropdown menus provide a compact way to display multiple actions or options in a menu that opens on demand."
|
|
35
|
+
>
|
|
36
|
+
<demo-example
|
|
37
|
+
title="Button Colors"
|
|
38
|
+
description="Dropdown menus with different button colors."
|
|
39
|
+
>
|
|
40
|
+
<div class="flex flex-wrap gap-4">
|
|
41
|
+
<modus-dropdown-menu buttonAriaLabel="Primary menu" [buttonColor]="'primary'">
|
|
42
|
+
<span slot="button">Primary</span>
|
|
43
|
+
<div slot="menu">
|
|
44
|
+
<modus-menu>
|
|
45
|
+
<modus-menu-item label="Option 1" value="option1" />
|
|
46
|
+
<modus-menu-item label="Option 2" value="option2" />
|
|
47
|
+
</modus-menu>
|
|
48
|
+
</div>
|
|
49
|
+
</modus-dropdown-menu>
|
|
50
|
+
|
|
51
|
+
<modus-dropdown-menu buttonAriaLabel="Secondary menu" [buttonColor]="'secondary'">
|
|
52
|
+
<span slot="button">Secondary</span>
|
|
53
|
+
<div slot="menu">
|
|
54
|
+
<modus-menu>
|
|
55
|
+
<modus-menu-item label="Option 1" value="option1" />
|
|
56
|
+
<modus-menu-item label="Option 2" value="option2" />
|
|
57
|
+
</modus-menu>
|
|
58
|
+
</div>
|
|
59
|
+
</modus-dropdown-menu>
|
|
60
|
+
|
|
61
|
+
<modus-dropdown-menu buttonAriaLabel="Tertiary menu" [buttonColor]="'tertiary'">
|
|
62
|
+
<span slot="button">Tertiary</span>
|
|
63
|
+
<div slot="menu">
|
|
64
|
+
<modus-menu>
|
|
65
|
+
<modus-menu-item label="Option 1" value="option1" />
|
|
66
|
+
<modus-menu-item label="Option 2" value="option2" />
|
|
67
|
+
</modus-menu>
|
|
68
|
+
</div>
|
|
69
|
+
</modus-dropdown-menu>
|
|
70
|
+
</div>
|
|
71
|
+
</demo-example>
|
|
72
|
+
|
|
73
|
+
<demo-example
|
|
74
|
+
title="Button Variants"
|
|
75
|
+
description="Dropdown menus with different button visual styles."
|
|
76
|
+
>
|
|
77
|
+
<div class="flex flex-wrap gap-4">
|
|
78
|
+
<modus-dropdown-menu buttonAriaLabel="Filled menu" [buttonVariant]="'filled'">
|
|
79
|
+
<span slot="button">Filled</span>
|
|
80
|
+
<div slot="menu">
|
|
81
|
+
<modus-menu>
|
|
82
|
+
<modus-menu-item label="Action 1" value="action1" />
|
|
83
|
+
<modus-menu-item label="Action 2" value="action2" />
|
|
84
|
+
</modus-menu>
|
|
85
|
+
</div>
|
|
86
|
+
</modus-dropdown-menu>
|
|
87
|
+
|
|
88
|
+
<modus-dropdown-menu buttonAriaLabel="Outlined menu" [buttonVariant]="'outlined'">
|
|
89
|
+
<span slot="button">Outlined</span>
|
|
90
|
+
<div slot="menu">
|
|
91
|
+
<modus-menu>
|
|
92
|
+
<modus-menu-item label="Action 1" value="action1" />
|
|
93
|
+
<modus-menu-item label="Action 2" value="action2" />
|
|
94
|
+
</modus-menu>
|
|
95
|
+
</div>
|
|
96
|
+
</modus-dropdown-menu>
|
|
97
|
+
|
|
98
|
+
<modus-dropdown-menu buttonAriaLabel="Borderless menu" [buttonVariant]="'borderless'">
|
|
99
|
+
<span slot="button">Borderless</span>
|
|
100
|
+
<div slot="menu">
|
|
101
|
+
<modus-menu>
|
|
102
|
+
<modus-menu-item label="Action 1" value="action1" />
|
|
103
|
+
<modus-menu-item label="Action 2" value="action2" />
|
|
104
|
+
</modus-menu>
|
|
105
|
+
</div>
|
|
106
|
+
</modus-dropdown-menu>
|
|
107
|
+
</div>
|
|
108
|
+
</demo-example>
|
|
109
|
+
|
|
110
|
+
<demo-example
|
|
111
|
+
title="Custom Button Content"
|
|
112
|
+
description="Dropdown menus with custom button content including icons."
|
|
113
|
+
>
|
|
114
|
+
<div class="flex flex-wrap gap-4">
|
|
115
|
+
<modus-dropdown-menu buttonAriaLabel="Icon menu">
|
|
116
|
+
<div slot="button" class="flex items-center gap-2">
|
|
117
|
+
<i class="modus-icons text-lg">settings</i>
|
|
118
|
+
<span>Settings</span>
|
|
119
|
+
</div>
|
|
120
|
+
<div slot="menu">
|
|
121
|
+
<modus-menu>
|
|
122
|
+
<modus-menu-item label="Preferences" value="prefs" />
|
|
123
|
+
<modus-menu-item label="Account" value="account" />
|
|
124
|
+
</modus-menu>
|
|
125
|
+
</div>
|
|
126
|
+
</modus-dropdown-menu>
|
|
127
|
+
|
|
128
|
+
<modus-dropdown-menu buttonAriaLabel="User menu">
|
|
129
|
+
<div slot="button" class="flex items-center gap-2">
|
|
130
|
+
<i class="modus-icons text-lg">user_account</i>
|
|
131
|
+
<span>User Menu</span>
|
|
132
|
+
<i class="modus-icons text-sm">expand_more</i>
|
|
133
|
+
</div>
|
|
134
|
+
<div slot="menu">
|
|
135
|
+
<modus-menu>
|
|
136
|
+
<modus-menu-item label="Profile" value="profile" />
|
|
137
|
+
<modus-menu-item label="Settings" value="settings" />
|
|
138
|
+
<modus-menu-item label="Log out" value="logout" />
|
|
139
|
+
</modus-menu>
|
|
140
|
+
</div>
|
|
141
|
+
</modus-dropdown-menu>
|
|
142
|
+
</div>
|
|
143
|
+
</demo-example>
|
|
144
|
+
|
|
145
|
+
<demo-example
|
|
146
|
+
title="Menu Placement"
|
|
147
|
+
description="Different menu placement options relative to the button."
|
|
148
|
+
>
|
|
149
|
+
<div class="flex flex-wrap gap-4">
|
|
150
|
+
<modus-dropdown-menu buttonAriaLabel="Bottom start menu" [menuPlacement]="'bottom-start'">
|
|
151
|
+
<span slot="button">Bottom Start</span>
|
|
152
|
+
<div slot="menu">
|
|
153
|
+
<modus-menu>
|
|
154
|
+
<modus-menu-item label="Item 1" value="item1" />
|
|
155
|
+
<modus-menu-item label="Item 2" value="item2" />
|
|
156
|
+
</modus-menu>
|
|
157
|
+
</div>
|
|
158
|
+
</modus-dropdown-menu>
|
|
159
|
+
|
|
160
|
+
<modus-dropdown-menu buttonAriaLabel="Bottom end menu" [menuPlacement]="'bottom-end'">
|
|
161
|
+
<span slot="button">Bottom End</span>
|
|
162
|
+
<div slot="menu">
|
|
163
|
+
<modus-menu>
|
|
164
|
+
<modus-menu-item label="Item 1" value="item1" />
|
|
165
|
+
<modus-menu-item label="Item 2" value="item2" />
|
|
166
|
+
</modus-menu>
|
|
167
|
+
</div>
|
|
168
|
+
</modus-dropdown-menu>
|
|
169
|
+
|
|
170
|
+
<modus-dropdown-menu buttonAriaLabel="Top start menu" [menuPlacement]="'top-start'">
|
|
171
|
+
<span slot="button">Top Start</span>
|
|
172
|
+
<div slot="menu">
|
|
173
|
+
<modus-menu>
|
|
174
|
+
<modus-menu-item label="Item 1" value="item1" />
|
|
175
|
+
<modus-menu-item label="Item 2" value="item2" />
|
|
176
|
+
</modus-menu>
|
|
177
|
+
</div>
|
|
178
|
+
</modus-dropdown-menu>
|
|
179
|
+
</div>
|
|
180
|
+
</demo-example>
|
|
181
|
+
|
|
182
|
+
<demo-example title="Disabled State" description="Dropdown menu in disabled state.">
|
|
183
|
+
<modus-dropdown-menu buttonAriaLabel="Disabled menu" [disabled]="true">
|
|
184
|
+
<span slot="button">Disabled Menu</span>
|
|
185
|
+
<div slot="menu">
|
|
186
|
+
<modus-menu>
|
|
187
|
+
<modus-menu-item label="Item 1" value="item1" />
|
|
188
|
+
<modus-menu-item label="Item 2" value="item2" />
|
|
189
|
+
</modus-menu>
|
|
190
|
+
</div>
|
|
191
|
+
</modus-dropdown-menu>
|
|
192
|
+
</demo-example>
|
|
193
|
+
</demo-page>
|
|
194
|
+
`,
|
|
195
|
+
})
|
|
196
|
+
export class DropdownDemoPageComponent {}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { Component, ViewChild, signal } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { DemoPageComponent } from '../shared/demo-page.component';
|
|
4
|
+
import { DemoExampleComponent } from '../shared/demo-example.component';
|
|
5
|
+
import { ModusFileDropzoneComponent } from '../../components/modus-file-dropzone.component';
|
|
6
|
+
import { ModusButtonComponent } from '../../components/modus-button.component';
|
|
7
|
+
import { ModusProgressComponent } from '../../components/modus-progress.component';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Demo page showcasing the Modus File Dropzone component.
|
|
11
|
+
*/
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'app-file-dropzone-demo-page',
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [
|
|
16
|
+
CommonModule,
|
|
17
|
+
DemoPageComponent,
|
|
18
|
+
DemoExampleComponent,
|
|
19
|
+
ModusFileDropzoneComponent,
|
|
20
|
+
ModusButtonComponent,
|
|
21
|
+
ModusProgressComponent,
|
|
22
|
+
],
|
|
23
|
+
template: `
|
|
24
|
+
<demo-page
|
|
25
|
+
title="Modus File Dropzone"
|
|
26
|
+
description="File dropzone allows users to drag and drop files for upload, with built-in validation for file types, sizes, counts, and filename lengths."
|
|
27
|
+
>
|
|
28
|
+
<demo-example title="Basic File Dropzone" description="A simple file dropzone accepting document files.">
|
|
29
|
+
<modus-file-dropzone
|
|
30
|
+
acceptFileTypes=".doc, .docx, .pdf"
|
|
31
|
+
instructions="Drag files here or browse to upload (.doc, .docx, .pdf)"
|
|
32
|
+
(fileSelect)="handleFileSelect($event)"
|
|
33
|
+
/>
|
|
34
|
+
@if (selectedFiles().length > 0) {
|
|
35
|
+
<div class="mt-4 p-4 bg-muted rounded-lg border-default">
|
|
36
|
+
<div class="text-sm font-medium text-foreground mb-2">Selected Files:</div>
|
|
37
|
+
<div class="text-sm text-muted-foreground space-y-1">
|
|
38
|
+
@for (file of selectedFiles(); track file) {
|
|
39
|
+
<div>{{ file }}</div>
|
|
40
|
+
}
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
}
|
|
44
|
+
</demo-example>
|
|
45
|
+
|
|
46
|
+
<demo-example title="Multiple File Selection" description="Allow users to select multiple files at once.">
|
|
47
|
+
<modus-file-dropzone
|
|
48
|
+
acceptFileTypes="image/*"
|
|
49
|
+
[multiple]="true"
|
|
50
|
+
instructions="Select multiple image files (drag or click)"
|
|
51
|
+
/>
|
|
52
|
+
</demo-example>
|
|
53
|
+
|
|
54
|
+
<demo-example
|
|
55
|
+
title="With Validation Constraints"
|
|
56
|
+
description="Set limits on file count, total size, and filename length."
|
|
57
|
+
>
|
|
58
|
+
<modus-file-dropzone
|
|
59
|
+
acceptFileTypes=".doc, .docx, .pdf"
|
|
60
|
+
[multiple]="true"
|
|
61
|
+
[maxFileCount]="3"
|
|
62
|
+
[maxFileNameLength]="20"
|
|
63
|
+
[maxTotalFileSizeBytes]="10485760"
|
|
64
|
+
invalidFileTypeMessage="Invalid file format. Please upload .doc, .docx, or .pdf files."
|
|
65
|
+
instructions="Upload files (max 3 files, 10MB total, filename max 20 chars)"
|
|
66
|
+
/>
|
|
67
|
+
</demo-example>
|
|
68
|
+
|
|
69
|
+
<demo-example title="Custom Messages" description="Customize success, error, and drag-over messages.">
|
|
70
|
+
<modus-file-dropzone
|
|
71
|
+
acceptFileTypes=".jpg, .jpeg, .png, .gif"
|
|
72
|
+
[multiple]="true"
|
|
73
|
+
instructions="Upload your images here"
|
|
74
|
+
fileDraggedOverInstructions="Release to upload your images"
|
|
75
|
+
successMessage="Images uploaded successfully!"
|
|
76
|
+
invalidFileTypeMessage="Only image files (.jpg, .png, .gif) are allowed"
|
|
77
|
+
/>
|
|
78
|
+
</demo-example>
|
|
79
|
+
|
|
80
|
+
<demo-example title="With Progress Indicator" description="Add custom content like progress bars.">
|
|
81
|
+
<div class="flex flex-col gap-4">
|
|
82
|
+
<modus-file-dropzone
|
|
83
|
+
acceptFileTypes=".pdf, .doc, .docx"
|
|
84
|
+
successMessage="Files ready for upload!"
|
|
85
|
+
instructions="Drag files here or browse to upload"
|
|
86
|
+
(fileSelect)="simulateUpload()"
|
|
87
|
+
>
|
|
88
|
+
@if (uploadProgress() > 0 && uploadProgress() < 100) {
|
|
89
|
+
<div slot="dropzone" class="w-64 mt-4">
|
|
90
|
+
<modus-progress [value]="uploadProgress()" [label]="uploadProgress() + '% Uploaded'" />
|
|
91
|
+
</div>
|
|
92
|
+
}
|
|
93
|
+
</modus-file-dropzone>
|
|
94
|
+
@if (uploadProgress() === 100) {
|
|
95
|
+
<div class="text-sm text-success">Upload complete!</div>
|
|
96
|
+
}
|
|
97
|
+
</div>
|
|
98
|
+
</demo-example>
|
|
99
|
+
|
|
100
|
+
<demo-example title="Without State Icon" description="Hide the state icons for a minimal appearance.">
|
|
101
|
+
<modus-file-dropzone
|
|
102
|
+
acceptFileTypes=".csv, .xlsx"
|
|
103
|
+
[includeStateIcon]="false"
|
|
104
|
+
instructions="Drop spreadsheet files here (.csv, .xlsx)"
|
|
105
|
+
/>
|
|
106
|
+
</demo-example>
|
|
107
|
+
|
|
108
|
+
<demo-example title="Disabled State" description="Disable the dropzone when file upload is not available.">
|
|
109
|
+
<modus-file-dropzone [disabled]="true" instructions="File upload is currently disabled" />
|
|
110
|
+
</demo-example>
|
|
111
|
+
|
|
112
|
+
<demo-example title="Programmatic Reset" description="Reset the dropzone state using a reference.">
|
|
113
|
+
<div class="flex flex-col gap-4">
|
|
114
|
+
<modus-file-dropzone
|
|
115
|
+
#resetDropzone
|
|
116
|
+
acceptFileTypes=".txt, .md"
|
|
117
|
+
instructions="Upload text files, then use the reset button"
|
|
118
|
+
/>
|
|
119
|
+
<modus-button variant="outlined" color="secondary" (buttonClick)="handleReset()">
|
|
120
|
+
Reset Dropzone
|
|
121
|
+
</modus-button>
|
|
122
|
+
</div>
|
|
123
|
+
</demo-example>
|
|
124
|
+
</demo-page>
|
|
125
|
+
`,
|
|
126
|
+
})
|
|
127
|
+
export class FileDropzoneDemoPageComponent {
|
|
128
|
+
@ViewChild('resetDropzone') private readonly resetDropzone?: ModusFileDropzoneComponent;
|
|
129
|
+
|
|
130
|
+
readonly selectedFiles = signal<string[]>([]);
|
|
131
|
+
readonly uploadProgress = signal<number>(0);
|
|
132
|
+
|
|
133
|
+
private uploadIntervalId: number | undefined;
|
|
134
|
+
|
|
135
|
+
handleFileSelect(files: FileList): void {
|
|
136
|
+
const fileNames: string[] = [];
|
|
137
|
+
for (let i = 0; i < files.length; i += 1) {
|
|
138
|
+
fileNames.push(`${files[i].name} (${this.formatFileSize(files[i].size)})`);
|
|
139
|
+
}
|
|
140
|
+
this.selectedFiles.set(fileNames);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async handleReset(): Promise<void> {
|
|
144
|
+
await this.resetDropzone?.reset();
|
|
145
|
+
this.selectedFiles.set([]);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
simulateUpload(): void {
|
|
149
|
+
this.uploadProgress.set(0);
|
|
150
|
+
if (this.uploadIntervalId) {
|
|
151
|
+
window.clearInterval(this.uploadIntervalId);
|
|
152
|
+
}
|
|
153
|
+
this.uploadIntervalId = window.setInterval(() => {
|
|
154
|
+
this.uploadProgress.update((value) => {
|
|
155
|
+
if (value >= 100) {
|
|
156
|
+
if (this.uploadIntervalId) {
|
|
157
|
+
window.clearInterval(this.uploadIntervalId);
|
|
158
|
+
this.uploadIntervalId = undefined;
|
|
159
|
+
}
|
|
160
|
+
return 100;
|
|
161
|
+
}
|
|
162
|
+
return value + 10;
|
|
163
|
+
});
|
|
164
|
+
}, 300);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
private formatFileSize(bytes: number): string {
|
|
168
|
+
if (bytes === 0) {
|
|
169
|
+
return '0 Bytes';
|
|
170
|
+
}
|
|
171
|
+
const kilo = 1024;
|
|
172
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
|
|
173
|
+
const index = Math.floor(Math.log(bytes) / Math.log(kilo));
|
|
174
|
+
return `${parseFloat((bytes / Math.pow(kilo, index)).toFixed(2))} ${sizes[index]}`;
|
|
175
|
+
}
|
|
176
|
+
}
|