magnaui 0.1.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/LICENSE +38 -0
- package/LICENSES/Apache-2.0.txt +202 -0
- package/LICENSES/Libraries.dev-MIT.txt +21 -0
- package/LICENSES/Tiptap-MIT.txt +21 -0
- package/LICENSES/metal-fx-NOTICE.txt +22 -0
- package/LICENSES/three-MIT.txt +21 -0
- package/README.md +73 -0
- package/THIRD_PARTY_NOTICES.md +72 -0
- package/dist/assets/agent-studio.png +0 -0
- package/dist/assets/api-studio.png +0 -0
- package/dist/assets/app-store.png +0 -0
- package/dist/assets/approvals.png +0 -0
- package/dist/assets/assistant.png +0 -0
- package/dist/assets/brain.png +0 -0
- package/dist/assets/browser.png +0 -0
- package/dist/assets/checkbox/check.svg +3 -0
- package/dist/assets/checkbox/indeterminate.svg +3 -0
- package/dist/assets/code.png +0 -0
- package/dist/assets/connect-ai.png +0 -0
- package/dist/assets/connections.png +0 -0
- package/dist/assets/database.png +0 -0
- package/dist/assets/display/06153.svg +5 -0
- package/dist/assets/display/106a6.svg +22 -0
- package/dist/assets/display/16525.svg +5 -0
- package/dist/assets/display/18a45.svg +5 -0
- package/dist/assets/display/1c133.svg +5 -0
- package/dist/assets/display/1c6fa.svg +5 -0
- package/dist/assets/display/1db47.svg +5 -0
- package/dist/assets/display/237a6.svg +5 -0
- package/dist/assets/display/27ca8.svg +5 -0
- package/dist/assets/display/347ef.svg +22 -0
- package/dist/assets/display/35edd.svg +5 -0
- package/dist/assets/display/38def.svg +5 -0
- package/dist/assets/display/3a834.svg +5 -0
- package/dist/assets/display/3e51d.svg +5 -0
- package/dist/assets/display/3f95e.svg +5 -0
- package/dist/assets/display/400d1.svg +5 -0
- package/dist/assets/display/4239a.svg +5 -0
- package/dist/assets/display/4477e.svg +22 -0
- package/dist/assets/display/46574.svg +5 -0
- package/dist/assets/display/469e4.svg +5 -0
- package/dist/assets/display/48559.svg +22 -0
- package/dist/assets/display/4e103.svg +22 -0
- package/dist/assets/display/4ef80.svg +5 -0
- package/dist/assets/display/51b32.svg +22 -0
- package/dist/assets/display/5320a.svg +5 -0
- package/dist/assets/display/56a7a.svg +22 -0
- package/dist/assets/display/56cab.svg +5 -0
- package/dist/assets/display/5fc70.svg +22 -0
- package/dist/assets/display/60ab5.svg +22 -0
- package/dist/assets/display/60c44.svg +5 -0
- package/dist/assets/display/61721.svg +5 -0
- package/dist/assets/display/648b1.svg +5 -0
- package/dist/assets/display/65aad.svg +5 -0
- package/dist/assets/display/665bc.svg +5 -0
- package/dist/assets/display/691ac.svg +22 -0
- package/dist/assets/display/6a48e.svg +5 -0
- package/dist/assets/display/6af80.svg +22 -0
- package/dist/assets/display/6c384.svg +5 -0
- package/dist/assets/display/6c7fb.svg +5 -0
- package/dist/assets/display/6ce08.svg +22 -0
- package/dist/assets/display/76be1.svg +5 -0
- package/dist/assets/display/79287.svg +5 -0
- package/dist/assets/display/7ea85.svg +5 -0
- package/dist/assets/display/7eeaf.svg +5 -0
- package/dist/assets/display/82602.svg +5 -0
- package/dist/assets/display/8a43e.svg +5 -0
- package/dist/assets/display/8bdb8.svg +22 -0
- package/dist/assets/display/8d235.svg +5 -0
- package/dist/assets/display/90498.svg +22 -0
- package/dist/assets/display/908e9.svg +5 -0
- package/dist/assets/display/90942.svg +5 -0
- package/dist/assets/display/943fb.svg +5 -0
- package/dist/assets/display/96ddd.svg +22 -0
- package/dist/assets/display/9e5a0.svg +22 -0
- package/dist/assets/display/9e9ac.svg +5 -0
- package/dist/assets/display/a35a7.svg +22 -0
- package/dist/assets/display/af15f.svg +5 -0
- package/dist/assets/display/b04fe.svg +5 -0
- package/dist/assets/display/b0925.svg +5 -0
- package/dist/assets/display/b464b.svg +5 -0
- package/dist/assets/display/b8efe.svg +5 -0
- package/dist/assets/display/bbddb.svg +5 -0
- package/dist/assets/display/bd61c.svg +5 -0
- package/dist/assets/display/be577.svg +5 -0
- package/dist/assets/display/bf02d.svg +5 -0
- package/dist/assets/display/bf1dc.svg +5 -0
- package/dist/assets/display/c70b6.svg +5 -0
- package/dist/assets/display/c8a01.svg +5 -0
- package/dist/assets/display/cb00b.svg +22 -0
- package/dist/assets/display/cecfd.svg +5 -0
- package/dist/assets/display/d2cc2.svg +5 -0
- package/dist/assets/display/d428d.svg +22 -0
- package/dist/assets/display/d71e2.svg +22 -0
- package/dist/assets/display/d8f1d.svg +22 -0
- package/dist/assets/display/d92e5.svg +5 -0
- package/dist/assets/display/d9698.svg +5 -0
- package/dist/assets/display/e542b.svg +5 -0
- package/dist/assets/display/e59af.svg +5 -0
- package/dist/assets/display/e5a41.svg +5 -0
- package/dist/assets/display/e894a.svg +5 -0
- package/dist/assets/display/ea9e5.svg +5 -0
- package/dist/assets/display/eac01.svg +5 -0
- package/dist/assets/display/ec734.svg +5 -0
- package/dist/assets/display/edb55.svg +5 -0
- package/dist/assets/display/ee164.svg +5 -0
- package/dist/assets/display/f01d5.svg +5 -0
- package/dist/assets/display/f479a.svg +22 -0
- package/dist/assets/display/f8ebb.svg +22 -0
- package/dist/assets/display/fb8ab.svg +5 -0
- package/dist/assets/display/fbdce.svg +5 -0
- package/dist/assets/docs.png +0 -0
- package/dist/assets/editor/align-left.svg +5 -0
- package/dist/assets/editor/arrow-down.svg +5 -0
- package/dist/assets/editor/arrow-up.svg +5 -0
- package/dist/assets/editor/at.svg +5 -0
- package/dist/assets/editor/bold-active.svg +5 -0
- package/dist/assets/editor/bold-strong.svg +5 -0
- package/dist/assets/editor/bold.svg +5 -0
- package/dist/assets/editor/comment.svg +5 -0
- package/dist/assets/editor/divider-more.svg +5 -0
- package/dist/assets/editor/divider.svg +5 -0
- package/dist/assets/editor/duration-check.svg +3 -0
- package/dist/assets/editor/italic.svg +5 -0
- package/dist/assets/editor/link.svg +5 -0
- package/dist/assets/editor/more.svg +5 -0
- package/dist/assets/editor/status-available.svg +5 -0
- package/dist/assets/editor/status-busy.svg +5 -0
- package/dist/assets/editor/status-disabled.svg +5 -0
- package/dist/assets/editor/status-in-meeting.svg +5 -0
- package/dist/assets/editor/status-offline.svg +5 -0
- package/dist/assets/editor/strike.svg +5 -0
- package/dist/assets/editor/time-check.svg +3 -0
- package/dist/assets/editor/underline.svg +5 -0
- package/dist/assets/expenses.png +0 -0
- package/dist/assets/feeds/activity-more.svg +5 -0
- package/dist/assets/feeds/activity-user.svg +5 -0
- package/dist/assets/feeds/attachment.svg +5 -0
- package/dist/assets/feeds/calendar.svg +5 -0
- package/dist/assets/feeds/comment.svg +5 -0
- package/dist/assets/feeds/download-hover.svg +5 -0
- package/dist/assets/feeds/download.svg +5 -0
- package/dist/assets/feeds/filter.svg +5 -0
- package/dist/assets/feeds/header-calendar.svg +5 -0
- package/dist/assets/feeds/notification-attachment.svg +5 -0
- package/dist/assets/feeds/notification-company.svg +17 -0
- package/dist/assets/feeds/notification-filter.svg +5 -0
- package/dist/assets/feeds/notification-more.svg +5 -0
- package/dist/assets/feeds/search.svg +5 -0
- package/dist/assets/feeds/selected-filter-active.svg +5 -0
- package/dist/assets/feeds/selected-filter.svg +5 -0
- package/dist/assets/feeds/settings.svg +5 -0
- package/dist/assets/feeds/sort.svg +5 -0
- package/dist/assets/feeds/status-error.svg +5 -0
- package/dist/assets/feeds/status-pending.svg +5 -0
- package/dist/assets/feeds/status-success.svg +5 -0
- package/dist/assets/feeds/status-warning.svg +5 -0
- package/dist/assets/feeds/upload-avatar-empty56.svg +13 -0
- package/dist/assets/feeds/upload-avatar-empty64.svg +13 -0
- package/dist/assets/feeds/upload-cancel.svg +5 -0
- package/dist/assets/feeds/upload-company-empty.svg +42 -0
- package/dist/assets/feeds/upload-company.svg +17 -0
- package/dist/assets/feeds/upload-delete-error.svg +5 -0
- package/dist/assets/feeds/upload-delete.svg +5 -0
- package/dist/assets/feeds/upload-error.svg +5 -0
- package/dist/assets/feeds/upload-loading.svg +5 -0
- package/dist/assets/feeds/upload-success.svg +5 -0
- package/dist/assets/feeds/vertical-arrow.svg +5 -0
- package/dist/assets/feeds/vertical-calendar-active.svg +5 -0
- package/dist/assets/feeds/vertical-calendar-hover.svg +5 -0
- package/dist/assets/feeds/vertical-calendar.svg +5 -0
- package/dist/assets/file.png +0 -0
- package/dist/assets/folder.png +0 -0
- package/dist/assets/forms/07b3a.png +0 -0
- package/dist/assets/forms/09fe0.svg +5 -0
- package/dist/assets/forms/11a76.svg +5 -0
- package/dist/assets/forms/185ae.svg +5 -0
- package/dist/assets/forms/1f174.svg +5 -0
- package/dist/assets/forms/29541.svg +5 -0
- package/dist/assets/forms/2b6f8.svg +5 -0
- package/dist/assets/forms/36c22.svg +5 -0
- package/dist/assets/forms/4cb9a.svg +5 -0
- package/dist/assets/forms/4ff30.png +0 -0
- package/dist/assets/forms/537d2.svg +5 -0
- package/dist/assets/forms/60456.svg +5 -0
- package/dist/assets/forms/657e1.svg +5 -0
- package/dist/assets/forms/73539.svg +5 -0
- package/dist/assets/forms/76214.svg +5 -0
- package/dist/assets/forms/7bd9a.svg +5 -0
- package/dist/assets/forms/7c034.svg +5 -0
- package/dist/assets/forms/86e36.svg +5 -0
- package/dist/assets/forms/8d97b.svg +5 -0
- package/dist/assets/forms/90a18.svg +5 -0
- package/dist/assets/forms/939c2.png +0 -0
- package/dist/assets/forms/95ae4.svg +5 -0
- package/dist/assets/forms/970af.svg +5 -0
- package/dist/assets/forms/a119e.svg +5 -0
- package/dist/assets/forms/a521c.svg +5 -0
- package/dist/assets/forms/a74b0.svg +5 -0
- package/dist/assets/forms/baff4.svg +5 -0
- package/dist/assets/forms/c64ff.svg +5 -0
- package/dist/assets/forms/ca66f.svg +5 -0
- package/dist/assets/forms/e0344.svg +5 -0
- package/dist/assets/forms/e5b24.png +0 -0
- package/dist/assets/forms/e687f.svg +5 -0
- package/dist/assets/forms/eceaf.svg +5 -0
- package/dist/assets/forms/eed5c.png +0 -0
- package/dist/assets/forms/f26ce.svg +5 -0
- package/dist/assets/forms/f79d5.svg +5 -0
- package/dist/assets/habits.png +0 -0
- package/dist/assets/hackify.png +0 -0
- package/dist/assets/icons/add.svg +5 -0
- package/dist/assets/icons/apps.svg +5 -0
- package/dist/assets/icons/book.svg +5 -0
- package/dist/assets/icons/chat.svg +5 -0
- package/dist/assets/icons/folder.svg +5 -0
- package/dist/assets/icons/mic.svg +5 -0
- package/dist/assets/icons/notifications.svg +5 -0
- package/dist/assets/icons/shield.svg +5 -0
- package/dist/assets/icons/store.svg +5 -0
- package/dist/assets/icons/voice.svg +5 -0
- package/dist/assets/ledger.png +0 -0
- package/dist/assets/logos/glyph-black.svg +3 -0
- package/dist/assets/logos/glyph-color.svg +26 -0
- package/dist/assets/logos/glyph-white.svg +3 -0
- package/dist/assets/logos/horizontal-black.svg +5 -0
- package/dist/assets/logos/horizontal-color-black.svg +28 -0
- package/dist/assets/logos/horizontal-color-white.svg +28 -0
- package/dist/assets/logos/horizontal-white.svg +5 -0
- package/dist/assets/logos/stacked-black.svg +5 -0
- package/dist/assets/logos/stacked-color-black.svg +28 -0
- package/dist/assets/logos/stacked-color-white.svg +28 -0
- package/dist/assets/logos/stacked-white.svg +5 -0
- package/dist/assets/logos/tagline-horizontal-black.svg +6 -0
- package/dist/assets/logos/tagline-horizontal-color-black.svg +29 -0
- package/dist/assets/logos/tagline-horizontal-color-white.svg +29 -0
- package/dist/assets/logos/tagline-horizontal-white.svg +6 -0
- package/dist/assets/logos/tagline-inline-black.svg +7 -0
- package/dist/assets/logos/tagline-inline-color-black.svg +30 -0
- package/dist/assets/logos/tagline-inline-color-white-alt.svg +30 -0
- package/dist/assets/logos/tagline-inline-color-white.svg +30 -0
- package/dist/assets/logos/tagline-inline-white.svg +7 -0
- package/dist/assets/logos/tagline-stacked-black.svg +6 -0
- package/dist/assets/logos/tagline-stacked-color-black.svg +29 -0
- package/dist/assets/logos/tagline-stacked-color-white.svg +29 -0
- package/dist/assets/logos/tagline-stacked-white.svg +6 -0
- package/dist/assets/magna-brief.png +0 -0
- package/dist/assets/magna-ide.png +0 -0
- package/dist/assets/magna-logo-dark.svg +5 -0
- package/dist/assets/magna-logo-stacked.svg +29 -0
- package/dist/assets/magna-logo.svg +3 -0
- package/dist/assets/magna-music.png +0 -0
- package/dist/assets/magna-studio.png +0 -0
- package/dist/assets/magna-voice.png +0 -0
- package/dist/assets/mail.png +0 -0
- package/dist/assets/models.png +0 -0
- package/dist/assets/notes.png +0 -0
- package/dist/assets/notifications.png +0 -0
- package/dist/assets/salis-verify.png +0 -0
- package/dist/assets/salis.png +0 -0
- package/dist/assets/settings.png +0 -0
- package/dist/assets/sheets.png +0 -0
- package/dist/assets/sledes.png +0 -0
- package/dist/assets/spaces.png +0 -0
- package/dist/assets/task-manager.png +0 -0
- package/dist/assets/tasks.png +0 -0
- package/dist/assets/terminal.png +0 -0
- package/dist/assets/today.png +0 -0
- package/dist/assets/trajectory.png +0 -0
- package/dist/assets/vault.png +0 -0
- package/dist/assets/wafir.png +0 -0
- package/dist/assets/what-can-i-do.png +0 -0
- package/dist/assets/workflow.png +0 -0
- package/dist/components/interactions/border-beam.d.ts +5 -0
- package/dist/components/interactions/border-beam.js +15 -0
- package/dist/components/interactions/bot-avatar.d.ts +5 -0
- package/dist/components/interactions/bot-avatar.js +10 -0
- package/dist/components/interactions/image-generation.d.ts +58 -0
- package/dist/components/interactions/image-generation.js +86 -0
- package/dist/components/interactions/index.d.ts +7 -0
- package/dist/components/interactions/index.js +7 -0
- package/dist/components/interactions/liquid.d.ts +8 -0
- package/dist/components/interactions/liquid.js +19 -0
- package/dist/components/interactions/metal-fx.d.ts +6 -0
- package/dist/components/interactions/metal-fx.js +51 -0
- package/dist/components/interactions/preferences.d.ts +5 -0
- package/dist/components/interactions/preferences.js +55 -0
- package/dist/components/interactions/thinking-orb.d.ts +4 -0
- package/dist/components/interactions/thinking-orb.js +9 -0
- package/dist/components/interactions/voice-beam.d.ts +5 -0
- package/dist/components/interactions/voice-beam.js +33 -0
- package/dist/components/magna/app-icon.d.ts +13 -0
- package/dist/components/magna/app-icon.js +15 -0
- package/dist/components/magna/apps.d.ts +202 -0
- package/dist/components/magna/apps.js +243 -0
- package/dist/components/magna/chat-activity.d.ts +12 -0
- package/dist/components/magna/chat-activity.js +29 -0
- package/dist/components/magna/chat-composer.d.ts +31 -0
- package/dist/components/magna/chat-composer.js +122 -0
- package/dist/components/magna/chat-composer.module.css +36 -0
- package/dist/components/magna/desktop-button.d.ts +8 -0
- package/dist/components/magna/desktop-button.js +10 -0
- package/dist/components/magna/desktop-switch.d.ts +4 -0
- package/dist/components/magna/desktop-switch.js +8 -0
- package/dist/components/magna/file-tile.d.ts +9 -0
- package/dist/components/magna/file-tile.js +11 -0
- package/dist/components/magna/index.d.ts +11 -0
- package/dist/components/magna/index.js +11 -0
- package/dist/components/magna/logo-variants.d.ts +243 -0
- package/dist/components/magna/logo-variants.js +268 -0
- package/dist/components/magna/logo.d.ts +11 -0
- package/dist/components/magna/logo.js +42 -0
- package/dist/components/magna/navigation.d.ts +15 -0
- package/dist/components/magna/navigation.js +16 -0
- package/dist/components/magna/project-context.d.ts +11 -0
- package/dist/components/magna/project-context.js +8 -0
- package/dist/components/magna/voice-orb.d.ts +7 -0
- package/dist/components/magna/voice-orb.js +49 -0
- package/dist/components/magna/voice-orb.module.css +146 -0
- package/dist/components/theme-switch.d.ts +1 -0
- package/dist/components/theme-switch.js +14 -0
- package/dist/components/ui/accordion.d.ts +13 -0
- package/dist/components/ui/accordion.js +24 -0
- package/dist/components/ui/activity-feed.d.ts +64 -0
- package/dist/components/ui/activity-feed.js +40 -0
- package/dist/components/ui/alert.d.ts +31 -0
- package/dist/components/ui/alert.js +73 -0
- package/dist/components/ui/avatar-empty-icons.d.ts +3 -0
- package/dist/components/ui/avatar-empty-icons.js +14 -0
- package/dist/components/ui/avatar-group-compact.d.ts +140 -0
- package/dist/components/ui/avatar-group-compact.js +41 -0
- package/dist/components/ui/avatar-group.d.ts +237 -0
- package/dist/components/ui/avatar-group.js +37 -0
- package/dist/components/ui/avatar.d.ts +420 -0
- package/dist/components/ui/avatar.js +107 -0
- package/dist/components/ui/badge.d.ts +29 -0
- package/dist/components/ui/badge.js +67 -0
- package/dist/components/ui/banner.d.ts +26 -0
- package/dist/components/ui/banner.js +41 -0
- package/dist/components/ui/breadcrumb.d.ts +14 -0
- package/dist/components/ui/breadcrumb.js +23 -0
- package/dist/components/ui/button-group.d.ts +23 -0
- package/dist/components/ui/button-group.js +39 -0
- package/dist/components/ui/button.d.ts +22 -0
- package/dist/components/ui/button.js +62 -0
- package/dist/components/ui/chart-legend.d.ts +21 -0
- package/dist/components/ui/chart-legend.js +14 -0
- package/dist/components/ui/checkbox.d.ts +41 -0
- package/dist/components/ui/checkbox.js +42 -0
- package/dist/components/ui/color-picker.d.ts +13 -0
- package/dist/components/ui/color-picker.js +65 -0
- package/dist/components/ui/command-menu.d.ts +55 -0
- package/dist/components/ui/command-menu.js +33 -0
- package/dist/components/ui/compact-button.d.ts +22 -0
- package/dist/components/ui/compact-button.js +39 -0
- package/dist/components/ui/content-card.d.ts +22 -0
- package/dist/components/ui/content-card.js +11 -0
- package/dist/components/ui/content-label.d.ts +22 -0
- package/dist/components/ui/content-label.js +9 -0
- package/dist/components/ui/counter-input.d.ts +26 -0
- package/dist/components/ui/counter-input.js +47 -0
- package/dist/components/ui/datepicker.d.ts +9 -0
- package/dist/components/ui/datepicker.js +48 -0
- package/dist/components/ui/digit-input.d.ts +11 -0
- package/dist/components/ui/digit-input.js +98 -0
- package/dist/components/ui/display-asset.d.ts +3 -0
- package/dist/components/ui/display-asset.js +9 -0
- package/dist/components/ui/display-assets.d.ts +193 -0
- package/dist/components/ui/display-assets.js +195 -0
- package/dist/components/ui/divider.d.ts +13 -0
- package/dist/components/ui/divider.js +22 -0
- package/dist/components/ui/dot-stepper.d.ts +96 -0
- package/dist/components/ui/dot-stepper.js +29 -0
- package/dist/components/ui/drawer.d.ts +12 -0
- package/dist/components/ui/drawer.js +25 -0
- package/dist/components/ui/dropdown.d.ts +29 -0
- package/dist/components/ui/dropdown.js +74 -0
- package/dist/components/ui/fancy-button.d.ts +21 -0
- package/dist/components/ui/fancy-button.js +43 -0
- package/dist/components/ui/file-format-icon.d.ts +19 -0
- package/dist/components/ui/file-format-icon.js +48 -0
- package/dist/components/ui/file-upload-compositions.d.ts +32 -0
- package/dist/components/ui/file-upload-compositions.js +88 -0
- package/dist/components/ui/file-upload.d.ts +11 -0
- package/dist/components/ui/file-upload.js +20 -0
- package/dist/components/ui/filter.d.ts +53 -0
- package/dist/components/ui/filter.js +90 -0
- package/dist/components/ui/form-asset.d.ts +5 -0
- package/dist/components/ui/form-asset.js +10 -0
- package/dist/components/ui/hint.d.ts +22 -0
- package/dist/components/ui/hint.js +33 -0
- package/dist/components/ui/horizontal-stepper.d.ts +16 -0
- package/dist/components/ui/horizontal-stepper.js +28 -0
- package/dist/components/ui/inline-input.d.ts +24 -0
- package/dist/components/ui/inline-input.js +60 -0
- package/dist/components/ui/input.d.ts +205 -0
- package/dist/components/ui/input.js +69 -0
- package/dist/components/ui/kbd.d.ts +5 -0
- package/dist/components/ui/kbd.js +6 -0
- package/dist/components/ui/key-icon.d.ts +14 -0
- package/dist/components/ui/key-icon.js +35 -0
- package/dist/components/ui/label.d.ts +7 -0
- package/dist/components/ui/label.js +15 -0
- package/dist/components/ui/link-button.d.ts +22 -0
- package/dist/components/ui/link-button.js +38 -0
- package/dist/components/ui/magna-recipe.d.ts +83 -0
- package/dist/components/ui/magna-recipe.js +99 -0
- package/dist/components/ui/modal.d.ts +21 -0
- package/dist/components/ui/modal.js +35 -0
- package/dist/components/ui/notification-feed.d.ts +63 -0
- package/dist/components/ui/notification-feed.js +31 -0
- package/dist/components/ui/notification-provider.d.ts +1 -0
- package/dist/components/ui/notification-provider.js +13 -0
- package/dist/components/ui/notification.d.ts +24 -0
- package/dist/components/ui/notification.js +23 -0
- package/dist/components/ui/pagination.d.ts +19 -0
- package/dist/components/ui/pagination.js +38 -0
- package/dist/components/ui/password-strength.d.ts +16 -0
- package/dist/components/ui/password-strength.js +27 -0
- package/dist/components/ui/payment-icon.d.ts +11 -0
- package/dist/components/ui/payment-icon.js +19 -0
- package/dist/components/ui/popover.d.ts +36 -0
- package/dist/components/ui/popover.js +27 -0
- package/dist/components/ui/progress-bar.d.ts +35 -0
- package/dist/components/ui/progress-bar.js +32 -0
- package/dist/components/ui/progress-circle.d.ts +16 -0
- package/dist/components/ui/progress-circle.js +29 -0
- package/dist/components/ui/radio.d.ts +37 -0
- package/dist/components/ui/radio.js +39 -0
- package/dist/components/ui/rating.d.ts +62 -0
- package/dist/components/ui/rating.js +65 -0
- package/dist/components/ui/rich-editor.d.ts +77 -0
- package/dist/components/ui/rich-editor.js +248 -0
- package/dist/components/ui/rich-editor.module.css +58 -0
- package/dist/components/ui/scroll-area.d.ts +14 -0
- package/dist/components/ui/scroll-area.js +34 -0
- package/dist/components/ui/segmented-control.d.ts +8 -0
- package/dist/components/ui/segmented-control.js +30 -0
- package/dist/components/ui/select.d.ts +212 -0
- package/dist/components/ui/select.js +129 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.js +16 -0
- package/dist/components/ui/social-button.d.ts +22 -0
- package/dist/components/ui/social-button.js +47 -0
- package/dist/components/ui/status-badge.d.ts +25 -0
- package/dist/components/ui/status-badge.js +51 -0
- package/dist/components/ui/status-modal.d.ts +26 -0
- package/dist/components/ui/status-modal.js +21 -0
- package/dist/components/ui/svg-rating-icons.d.ts +11 -0
- package/dist/components/ui/svg-rating-icons.js +33 -0
- package/dist/components/ui/switch-compositions.d.ts +46 -0
- package/dist/components/ui/switch-compositions.js +51 -0
- package/dist/components/ui/switch.d.ts +14 -0
- package/dist/components/ui/switch.js +17 -0
- package/dist/components/ui/tab-menu-horizontal.d.ts +11 -0
- package/dist/components/ui/tab-menu-horizontal.js +49 -0
- package/dist/components/ui/tab-menu-vertical.d.ts +9 -0
- package/dist/components/ui/tab-menu-vertical.js +23 -0
- package/dist/components/ui/table.d.ts +23 -0
- package/dist/components/ui/table.js +46 -0
- package/dist/components/ui/tag-input.d.ts +18 -0
- package/dist/components/ui/tag-input.js +57 -0
- package/dist/components/ui/tag.d.ts +28 -0
- package/dist/components/ui/tag.js +67 -0
- package/dist/components/ui/textarea.d.ts +21 -0
- package/dist/components/ui/textarea.js +32 -0
- package/dist/components/ui/time-picker.d.ts +35 -0
- package/dist/components/ui/time-picker.js +46 -0
- package/dist/components/ui/tooltip.d.ts +318 -0
- package/dist/components/ui/tooltip.js +56 -0
- package/dist/components/ui/vertical-stepper.d.ts +16 -0
- package/dist/components/ui/vertical-stepper.js +30 -0
- package/dist/design/figma-styles.d.ts +2 -0
- package/dist/design/figma-styles.js +2106 -0
- package/dist/design/theme.d.ts +18 -0
- package/dist/design/theme.js +185 -0
- package/dist/fonts/DM-Mono-OFL.txt +93 -0
- package/dist/fonts/Inter-OFL.txt +93 -0
- package/dist/fonts/README.md +23 -0
- package/dist/fonts/SHA256SUMS +11 -0
- package/dist/fonts/dm-mono-400-latin-ext.woff2 +0 -0
- package/dist/fonts/dm-mono-400-latin.woff2 +0 -0
- package/dist/fonts/dm-mono-500-latin-ext.woff2 +0 -0
- package/dist/fonts/dm-mono-500-latin.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext.woff2 +0 -0
- package/dist/fonts/inter-cyrillic.woff2 +0 -0
- package/dist/fonts/inter-greek-ext.woff2 +0 -0
- package/dist/fonts/inter-greek.woff2 +0 -0
- package/dist/fonts/inter-latin-ext.woff2 +0 -0
- package/dist/fonts/inter-latin.woff2 +0 -0
- package/dist/fonts/inter-vietnamese.woff2 +0 -0
- package/dist/hooks/use-notification.d.ts +36 -0
- package/dist/hooks/use-notification.js +86 -0
- package/dist/hooks/use-tab-observer.d.ts +8 -0
- package/dist/hooks/use-tab-observer.js +72 -0
- package/dist/magna-assets.d.ts +2 -0
- package/dist/magna-assets.js +273 -0
- package/dist/magnaui.d.ts +77 -0
- package/dist/magnaui.js +77 -0
- package/dist/styles.css +2665 -0
- package/dist/utils/cn.d.ts +18 -0
- package/dist/utils/cn.js +14 -0
- package/dist/utils/polymorphic.d.ts +10 -0
- package/dist/utils/polymorphic.js +1 -0
- package/dist/utils/tv.d.ts +18 -0
- package/dist/utils/tv.js +5 -0
- package/dist/vendor/tailwind-variants/LICENSE +21 -0
- package/dist/vendor/tailwind-variants/config.d.ts +38 -0
- package/dist/vendor/tailwind-variants/generated.d.ts +3 -0
- package/dist/vendor/tailwind-variants/index.d.ts +370 -0
- package/docs/implementation-provenance.md +96 -0
- package/package.json +108 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as Primitive from "@radix-ui/react-select";
|
|
5
|
+
import * as ScrollArea from "@radix-ui/react-scroll-area";
|
|
6
|
+
import { Slottable } from "@radix-ui/react-slot";
|
|
7
|
+
import { RiArrowDownSLine, RiCheckLine } from "@remixicon/react";
|
|
8
|
+
import { tv } from "../../utils/tv.js";
|
|
9
|
+
import { cn } from "../../utils/cn.js";
|
|
10
|
+
export const selectVariants = tv({
|
|
11
|
+
slots: {
|
|
12
|
+
triggerRoot: 'group/trigger flex min-w-0 shrink-0 items-center bg-bg-white-0 text-left text-paragraph-sm text-text-strong-950 shadow-regular-xs outline-none ring-1 ring-inset ring-stroke-soft-200 transition-all duration-200 hover:bg-bg-weak-50 hover:ring-transparent focus:text-text-strong-950 focus:shadow-button-important-focus focus:ring-stroke-strong-950 disabled:pointer-events-none disabled:bg-bg-weak-50 disabled:text-text-disabled-300 disabled:shadow-none disabled:ring-transparent data-[placeholder]:text-text-sub-600 data-[placeholder]:focus:text-text-strong-950 data-[placeholder]:disabled:text-text-disabled-300',
|
|
13
|
+
triggerArrow: 'ml-auto size-5 shrink-0 text-text-sub-600 transition-all duration-200 group-hover/trigger:text-text-sub-600 group-focus/trigger:text-text-strong-950 group-disabled/trigger:text-text-disabled-300 group-data-[state=open]/trigger:rotate-180 group-data-[placeholder]/trigger:text-text-soft-400',
|
|
14
|
+
triggerIcon: 'h-5 w-auto min-w-0 shrink-0 object-contain text-text-sub-600 transition-colors group-hover/trigger:text-text-sub-600 group-disabled/trigger:text-text-disabled-300 group-data-[placeholder]/trigger:text-text-soft-400 group-disabled/trigger:[&:not(.remixicon)]:opacity-[.48]',
|
|
15
|
+
selectItemIcon: 'size-5 shrink-0 bg-[length:1.25rem] text-text-sub-600 [[data-disabled]_&:not(.remixicon)]:opacity-[.48] [[data-disabled]_&]:text-text-disabled-300',
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
size: { medium: {}, small: {}, xsmall: {} },
|
|
19
|
+
hasError: {
|
|
20
|
+
true: {
|
|
21
|
+
triggerRoot: 'ring-error-base focus:shadow-button-error-focus focus:ring-error-base',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
variant: {
|
|
25
|
+
default: { triggerRoot: 'w-full rounded-full' },
|
|
26
|
+
compact: {
|
|
27
|
+
triggerRoot: 'w-auto rounded-full',
|
|
28
|
+
triggerIcon: '-ml-0.5',
|
|
29
|
+
selectItemIcon: 'group-has-[&]/trigger:-ml-0.5',
|
|
30
|
+
},
|
|
31
|
+
compactForInput: {
|
|
32
|
+
triggerRoot: 'w-auto rounded-none shadow-none ring-0 focus:bg-bg-weak-50 focus:shadow-none focus:ring-0',
|
|
33
|
+
triggerArrow: 'ml-0.5',
|
|
34
|
+
},
|
|
35
|
+
inline: {
|
|
36
|
+
triggerRoot: 'h-5 min-h-5 w-auto gap-0 rounded-none bg-transparent p-0 text-text-sub-600 shadow-none ring-0 hover:bg-transparent hover:text-text-strong-950 focus:shadow-none data-[state=open]:text-text-strong-950',
|
|
37
|
+
triggerIcon: 'mr-1.5 text-text-soft-400 group-hover/trigger:text-text-sub-600 group-data-[state=open]/trigger:text-text-sub-600',
|
|
38
|
+
triggerArrow: 'ml-0.5 group-hover/trigger:text-text-strong-950 group-data-[state=open]/trigger:text-text-strong-950',
|
|
39
|
+
selectItemIcon: 'text-text-soft-400',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
compoundVariants: [
|
|
44
|
+
{
|
|
45
|
+
size: 'medium',
|
|
46
|
+
variant: 'default',
|
|
47
|
+
class: { triggerRoot: 'h-10 min-h-10 gap-2 pl-3 pr-2.5' },
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
size: 'small',
|
|
51
|
+
variant: 'default',
|
|
52
|
+
class: { triggerRoot: 'h-9 min-h-9 gap-2 pl-2.5 pr-2' },
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
size: 'xsmall',
|
|
56
|
+
variant: 'default',
|
|
57
|
+
class: { triggerRoot: 'h-8 min-h-8 gap-1.5 pl-2 pr-1.5' },
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
size: 'medium',
|
|
61
|
+
variant: 'compact',
|
|
62
|
+
class: { triggerRoot: 'h-10 gap-1 pl-3 pr-2.5' },
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
size: 'small',
|
|
66
|
+
variant: 'compact',
|
|
67
|
+
class: { triggerRoot: 'h-9 gap-1 pl-3 pr-2' },
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
size: 'xsmall',
|
|
71
|
+
variant: 'compact',
|
|
72
|
+
class: {
|
|
73
|
+
triggerRoot: 'h-8 gap-0.5 pl-2.5 pr-1.5',
|
|
74
|
+
triggerIcon: 'size-4',
|
|
75
|
+
selectItemIcon: 'size-4 bg-[length:1rem]',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
size: 'medium',
|
|
80
|
+
variant: 'compactForInput',
|
|
81
|
+
class: { triggerRoot: 'pl-2.5 pr-2', triggerIcon: 'mr-2' },
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
size: 'small',
|
|
85
|
+
variant: 'compactForInput',
|
|
86
|
+
class: { triggerRoot: 'px-2', triggerIcon: 'mr-2' },
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
size: 'xsmall',
|
|
90
|
+
variant: 'compactForInput',
|
|
91
|
+
class: {
|
|
92
|
+
triggerRoot: 'pl-2 pr-1.5',
|
|
93
|
+
triggerIcon: 'mr-1.5 size-4',
|
|
94
|
+
selectItemIcon: 'size-4 bg-[length:1rem]',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
defaultVariants: { variant: 'default', size: 'medium' },
|
|
99
|
+
});
|
|
100
|
+
const AppearanceContext = React.createContext({});
|
|
101
|
+
function Root({ size, variant, hasError, children, ...props }) {
|
|
102
|
+
return (_jsx(AppearanceContext.Provider, { value: { size, variant, hasError }, children: _jsx(Primitive.Root, { ...props, children: children }) }));
|
|
103
|
+
}
|
|
104
|
+
const Trigger = React.forwardRef(function Trigger({ className, children, ...props }, ref) {
|
|
105
|
+
const styles = selectVariants(React.useContext(AppearanceContext));
|
|
106
|
+
return (_jsxs(Primitive.Trigger, { ...props, ref: ref, className: styles.triggerRoot({ className }), children: [_jsx(Slottable, { children: children }), _jsx(Primitive.Icon, { asChild: true, children: _jsx(RiArrowDownSLine, { className: styles.triggerArrow() }) })] }));
|
|
107
|
+
});
|
|
108
|
+
function TriggerIcon({ as, className, ...props }) {
|
|
109
|
+
const Tag = as || 'div';
|
|
110
|
+
return (_jsx(Tag, { ...props, className: selectVariants(React.useContext(AppearanceContext)).triggerIcon({ className }) }));
|
|
111
|
+
}
|
|
112
|
+
function ItemIcon({ as, className, ...props }) {
|
|
113
|
+
const Tag = as || 'div';
|
|
114
|
+
return (_jsx(Tag, { ...props, className: selectVariants(React.useContext(AppearanceContext)).selectItemIcon({ className }) }));
|
|
115
|
+
}
|
|
116
|
+
const Content = React.forwardRef(function Content({ children, className, position = 'popper', sideOffset = 8, collisionPadding = 8, ...props }, ref) {
|
|
117
|
+
return (_jsx(Primitive.Portal, { children: _jsx(Primitive.Content, { ...props, ref: ref, position: position, sideOffset: sideOffset, collisionPadding: collisionPadding, className: cn('relative z-50 max-h-[--radix-select-content-available-height] min-w-[--radix-select-trigger-width] max-w-[max(var(--radix-select-trigger-width),320px)] overflow-hidden rounded-2xl bg-bg-white-0 shadow-regular-md ring-1 ring-inset ring-stroke-soft-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2', className), children: _jsxs(ScrollArea.Root, { type: 'auto', children: [_jsx(Primitive.Viewport, { asChild: true, children: _jsx(ScrollArea.Viewport, { className: 'max-h-[196px] w-full scroll-py-2 overflow-auto p-2', style: { overflowY: undefined }, children: children }) }), _jsx(ScrollArea.Scrollbar, { orientation: 'vertical', children: _jsx(ScrollArea.Thumb, { className: '!w-1 rounded bg-bg-soft-200' }) })] }) }) }));
|
|
118
|
+
});
|
|
119
|
+
const Item = React.forwardRef(function Item({ className, children, ...props }, ref) {
|
|
120
|
+
const small = React.useContext(AppearanceContext).size === 'xsmall';
|
|
121
|
+
return (_jsxs(Primitive.Item, { ...props, ref: ref, className: cn('group relative flex cursor-pointer select-none items-center rounded-lg p-2 text-paragraph-sm text-text-strong-950 transition-colors data-[disabled]:pointer-events-none data-[highlighted]:bg-bg-weak-50 data-[disabled]:text-text-disabled-300 data-[highlighted]:outline-none', small ? 'gap-1.5 pr-[34px]' : 'gap-2 pr-9', className), children: [_jsx(Primitive.ItemText, { asChild: true, children: _jsx("span", { className: cn('flex flex-1 items-center', small ? 'gap-1.5' : 'gap-2'), children: typeof children === 'string' ? (_jsx("span", { className: 'line-clamp-1', children: children })) : (children) }) }), _jsx(Primitive.ItemIndicator, { className: 'absolute right-2 top-1/2 -translate-y-1/2', children: _jsx(RiCheckLine, { className: 'size-5 text-text-sub-600' }) })] }));
|
|
122
|
+
});
|
|
123
|
+
Root.displayName = 'SelectRoot';
|
|
124
|
+
Trigger.displayName = 'SelectTrigger';
|
|
125
|
+
TriggerIcon.displayName = 'SelectTriggerIcon';
|
|
126
|
+
Content.displayName = 'SelectContent';
|
|
127
|
+
Item.displayName = 'SelectItem';
|
|
128
|
+
const { Group, Label: GroupLabel, Separator, Value } = Primitive;
|
|
129
|
+
export { Root, Trigger, TriggerIcon, Content, Item, ItemIcon, Group, GroupLabel, Separator, Value, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Primitive from "@radix-ui/react-slider";
|
|
3
|
+
declare const Root: React.ForwardRefExoticComponent<Omit<Primitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
declare const Thumb: React.ForwardRefExoticComponent<Omit<Primitive.SliderThumbProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
export { Root, Thumb };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Slottable } from "@radix-ui/react-slot";
|
|
5
|
+
import * as Primitive from "@radix-ui/react-slider";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
const Root = React.forwardRef(function Root({ children, className, orientation = 'horizontal', ...props }, ref) {
|
|
8
|
+
const vertical = orientation === 'vertical';
|
|
9
|
+
return (_jsxs(Primitive.Root, { ...props, orientation: orientation, ref: ref, className: cn('relative flex touch-none select-none items-center', vertical ? 'h-full w-4 flex-col' : 'h-4 w-full', className), children: [_jsx(Primitive.Track, { className: cn('relative overflow-hidden rounded-full bg-bg-soft-200', vertical ? 'h-full w-1.5' : 'h-1.5 w-full'), children: _jsx(Primitive.Range, { className: cn('absolute bg-primary-base', vertical ? 'w-full' : 'h-full') }) }), _jsx(Slottable, { children: children })] }));
|
|
10
|
+
});
|
|
11
|
+
const Thumb = React.forwardRef(function Thumb({ className, ...props }, ref) {
|
|
12
|
+
return (_jsx(Primitive.Thumb, { ...props, ref: ref, className: cn('box-content block size-1.5 shrink-0 cursor-pointer rounded-full border-[5px] border-static-white bg-primary-base shadow-toggle-switch outline-none focus-visible:ring-2 focus-visible:ring-primary-alpha-24 data-[disabled]:cursor-default', className) }));
|
|
13
|
+
});
|
|
14
|
+
Root.displayName = 'SliderRoot';
|
|
15
|
+
Thumb.displayName = 'SliderThumb';
|
|
16
|
+
export { Root, Thumb };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PolymorphicComponentProps } from "../../utils/polymorphic.js";
|
|
3
|
+
type Brand = 'apple' | 'twitter' | 'google' | 'facebook' | 'linkedin' | 'github' | 'dropbox';
|
|
4
|
+
type Appearance = {
|
|
5
|
+
brand?: Brand;
|
|
6
|
+
mode: 'filled' | 'stroke';
|
|
7
|
+
};
|
|
8
|
+
export declare const socialButtonVariants: (options?: Partial<Appearance> & {
|
|
9
|
+
class?: import("tailwind-merge").ClassNameValue;
|
|
10
|
+
className?: import("tailwind-merge").ClassNameValue;
|
|
11
|
+
}) => Record<"root" | "icon", (overrides?: (Partial<Appearance> & {
|
|
12
|
+
class?: import("tailwind-merge").ClassNameValue;
|
|
13
|
+
className?: import("tailwind-merge").ClassNameValue;
|
|
14
|
+
}) | undefined) => string>;
|
|
15
|
+
export declare const Root: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & Partial<Appearance> & {
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
export declare function Icon<T extends React.ElementType = 'div'>({ as, className, brand, mode, ...props }: PolymorphicComponentProps<T, Partial<Appearance>>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare namespace Icon {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
5
|
+
import { mergeOptions, slotRecipe } from "./magna-recipe.js";
|
|
6
|
+
const appearance = React.createContext({});
|
|
7
|
+
const filled = {
|
|
8
|
+
apple: 'bg-static-black before:bg-white-alpha-16',
|
|
9
|
+
twitter: 'bg-static-black before:bg-white-alpha-16',
|
|
10
|
+
google: 'bg-[#f14336] before:bg-static-black/[.16]',
|
|
11
|
+
facebook: 'bg-[#1977f3] before:bg-static-black/[.16]',
|
|
12
|
+
linkedin: 'bg-[#0077b5] before:bg-static-black/[.16]',
|
|
13
|
+
github: 'bg-[#24292f] before:bg-white-alpha-16',
|
|
14
|
+
dropbox: 'bg-[#3984ff] before:bg-static-black/[.16]',
|
|
15
|
+
};
|
|
16
|
+
export const socialButtonVariants = slotRecipe({ mode: 'filled' }, ({ brand, mode }) => ({
|
|
17
|
+
root: [
|
|
18
|
+
'relative inline-flex h-10 items-center justify-center gap-3.5 rounded-full px-4 whitespace-nowrap text-label-sm outline-none transition duration-200 ease-out focus-visible:shadow-button-important-focus',
|
|
19
|
+
mode === 'filled'
|
|
20
|
+
? [
|
|
21
|
+
'text-static-white before:pointer-events-none before:absolute before:inset-0 before:rounded-full before:opacity-0 before:transition-opacity before:duration-200 before:ease-out hover:before:opacity-100',
|
|
22
|
+
brand && filled[brand],
|
|
23
|
+
]
|
|
24
|
+
: [
|
|
25
|
+
'bg-bg-white-0 text-text-strong-950 shadow-regular-xs ring-inset ring-1 ring-stroke-soft-200 hover:bg-bg-weak-50 hover:shadow-none hover:ring-transparent focus-visible:ring-stroke-strong-950',
|
|
26
|
+
brand === 'apple' && 'text-social-apple',
|
|
27
|
+
brand === 'twitter' && 'text-social-twitter',
|
|
28
|
+
brand === 'github' && 'text-social-github',
|
|
29
|
+
],
|
|
30
|
+
],
|
|
31
|
+
icon: 'relative z-10 shrink-0 -mx-1.5 size-5',
|
|
32
|
+
}));
|
|
33
|
+
export const Root = React.forwardRef(function SocialButton({ brand, mode, asChild, className, children, ...props }, ref) {
|
|
34
|
+
const options = { brand, mode };
|
|
35
|
+
const Element = asChild ? Slot : 'button';
|
|
36
|
+
return (_jsx(appearance.Provider, { value: options, children: _jsx(Element, { ref: ref, className: socialButtonVariants(options).root({ className }), ...props, children: children }) }));
|
|
37
|
+
});
|
|
38
|
+
Root.displayName = 'SocialButtonRoot';
|
|
39
|
+
export function Icon({ as, className, brand, mode, ...props }) {
|
|
40
|
+
const options = mergeOptions(React.useContext(appearance), {
|
|
41
|
+
brand,
|
|
42
|
+
mode,
|
|
43
|
+
});
|
|
44
|
+
const Element = as || 'div';
|
|
45
|
+
return (_jsx(Element, { className: socialButtonVariants(options).icon({ className }), ...props }));
|
|
46
|
+
}
|
|
47
|
+
Icon.displayName = 'SocialButtonIcon';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PolymorphicComponentProps } from "../../utils/polymorphic.js";
|
|
3
|
+
type Appearance = {
|
|
4
|
+
variant: 'stroke' | 'light';
|
|
5
|
+
status: 'completed' | 'pending' | 'failed' | 'disabled';
|
|
6
|
+
};
|
|
7
|
+
export declare const statusBadgeVariants: (options?: Partial<Appearance> & {
|
|
8
|
+
class?: import("tailwind-merge").ClassNameValue;
|
|
9
|
+
className?: import("tailwind-merge").ClassNameValue;
|
|
10
|
+
}) => Record<"root" | "icon" | "dot", (overrides?: (Partial<Appearance> & {
|
|
11
|
+
class?: import("tailwind-merge").ClassNameValue;
|
|
12
|
+
className?: import("tailwind-merge").ClassNameValue;
|
|
13
|
+
}) | undefined) => string>;
|
|
14
|
+
export declare const Root: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & Partial<Appearance> & {
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export declare function Icon<T extends React.ElementType = 'div'>({ as, className, variant, status, ...props }: PolymorphicComponentProps<T, Partial<Appearance>>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare namespace Icon {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function Dot({ className, variant, status, ...props }: React.HTMLAttributes<HTMLDivElement> & Partial<Appearance>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare namespace Dot {
|
|
23
|
+
var displayName: string;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
5
|
+
import { mergeOptions, slotRecipe, toneClasses } from "./magna-recipe.js";
|
|
6
|
+
const appearance = React.createContext({});
|
|
7
|
+
const tones = {
|
|
8
|
+
completed: toneClasses.green,
|
|
9
|
+
pending: toneClasses.orange,
|
|
10
|
+
failed: toneClasses.red,
|
|
11
|
+
disabled: toneClasses.gray,
|
|
12
|
+
};
|
|
13
|
+
export const statusBadgeVariants = slotRecipe({ variant: 'stroke', status: 'disabled' }, ({ variant, status }) => ({
|
|
14
|
+
root: [
|
|
15
|
+
'inline-flex h-6 gap-2 items-center justify-center rounded-full px-2 text-label-xs whitespace-nowrap has-[>.dot]:gap-1.5',
|
|
16
|
+
variant === 'stroke'
|
|
17
|
+
? 'bg-bg-white-0 text-text-sub-600 ring-1 ring-inset ring-stroke-soft-200'
|
|
18
|
+
: [
|
|
19
|
+
tones[status].pale,
|
|
20
|
+
status === 'disabled' ? 'text-text-sub-600' : tones[status].ink,
|
|
21
|
+
],
|
|
22
|
+
],
|
|
23
|
+
icon: ['size-4 -mx-1', tones[status].ink],
|
|
24
|
+
dot: [
|
|
25
|
+
'dot grid size-4 -mx-1 place-items-center before:block before:size-1.5 before:rounded-full before:bg-current',
|
|
26
|
+
tones[status].ink,
|
|
27
|
+
],
|
|
28
|
+
}));
|
|
29
|
+
export const Root = React.forwardRef(function StatusBadge({ variant, status, asChild, children, className, ...props }, ref) {
|
|
30
|
+
const options = { variant, status };
|
|
31
|
+
const Element = asChild ? Slot : 'div';
|
|
32
|
+
return (_jsx(appearance.Provider, { value: options, children: _jsx(Element, { ref: ref, className: statusBadgeVariants(options).root({ className }), ...props, children: children }) }));
|
|
33
|
+
});
|
|
34
|
+
Root.displayName = 'StatusBadgeRoot';
|
|
35
|
+
export function Icon({ as, className, variant, status, ...props }) {
|
|
36
|
+
const options = mergeOptions(React.useContext(appearance), {
|
|
37
|
+
variant,
|
|
38
|
+
status,
|
|
39
|
+
});
|
|
40
|
+
const Element = as || 'div';
|
|
41
|
+
return (_jsx(Element, { className: statusBadgeVariants(options).icon({ className }), ...props }));
|
|
42
|
+
}
|
|
43
|
+
Icon.displayName = 'StatusBadgeIcon';
|
|
44
|
+
export function Dot({ className, variant, status, ...props }) {
|
|
45
|
+
const options = mergeOptions(React.useContext(appearance), {
|
|
46
|
+
variant,
|
|
47
|
+
status,
|
|
48
|
+
});
|
|
49
|
+
return (_jsx("div", { className: statusBadgeVariants(options).dot({ className }), ...props }));
|
|
50
|
+
}
|
|
51
|
+
Dot.displayName = 'StatusBadgeDot';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Modal from "./modal.js";
|
|
3
|
+
import { statusModalAssets } from "./display-assets.js";
|
|
4
|
+
export declare const Root: React.FC<import("@radix-ui/react-dialog").DialogProps>;
|
|
5
|
+
export declare const Trigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const Close: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export type StatusModalStatus = keyof typeof statusModalAssets;
|
|
8
|
+
export type StatusModalProps = Omit<React.ComponentPropsWithoutRef<typeof Modal.Content>, 'title'> & {
|
|
9
|
+
status?: StatusModalStatus;
|
|
10
|
+
alignment?: 'horizontal' | 'vertical';
|
|
11
|
+
title: React.ReactNode;
|
|
12
|
+
description: React.ReactNode;
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
footer?: React.ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export declare const Content: React.ForwardRefExoticComponent<Omit<Omit<Omit<import("@radix-ui/react-dialog").DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
17
|
+
overlayClassName?: string;
|
|
18
|
+
showClose?: boolean;
|
|
19
|
+
} & React.RefAttributes<HTMLDivElement>, "ref">, "title"> & {
|
|
20
|
+
status?: StatusModalStatus;
|
|
21
|
+
alignment?: "horizontal" | "vertical";
|
|
22
|
+
title: React.ReactNode;
|
|
23
|
+
description: React.ReactNode;
|
|
24
|
+
icon?: React.ReactNode;
|
|
25
|
+
footer?: React.ReactNode;
|
|
26
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.js";
|
|
5
|
+
import * as Modal from "./modal.js";
|
|
6
|
+
import { DisplayAsset } from "./display-asset.js";
|
|
7
|
+
import { statusModalAssets } from "./display-assets.js";
|
|
8
|
+
export const Root = Modal.Root;
|
|
9
|
+
export const Trigger = Modal.Trigger;
|
|
10
|
+
export const Close = Modal.Close;
|
|
11
|
+
const backgrounds = {
|
|
12
|
+
error: 'bg-error-lighter',
|
|
13
|
+
warning: 'bg-warning-lighter',
|
|
14
|
+
success: 'bg-success-lighter',
|
|
15
|
+
information: 'bg-information-lighter',
|
|
16
|
+
};
|
|
17
|
+
export const Content = React.forwardRef(function StatusModalContent({ status = 'information', alignment = 'horizontal', title, description, icon, footer, children, className, showClose = false, ...props }, ref) {
|
|
18
|
+
return (_jsxs(Modal.Content, { ref: ref, ...props, showClose: showClose, className: cn('max-w-[440px] overflow-hidden ring-1 ring-inset ring-stroke-soft-200', className), children: [_jsxs("div", { className: cn('flex gap-4 p-5', alignment === 'vertical'
|
|
19
|
+
? 'flex-col items-center text-center'
|
|
20
|
+
: 'items-start'), children: [_jsx("span", { "aria-hidden": 'true', className: cn('flex size-10 shrink-0 items-center justify-center rounded-[10px]', backgrounds[status]), children: icon ?? _jsx(DisplayAsset, { src: statusModalAssets[status] }) }), _jsxs("div", { className: 'min-w-0 space-y-1', children: [_jsx(Modal.Title, { className: 'text-label-md', children: title }), _jsx(Modal.Description, { className: 'text-paragraph-sm', children: description }), children] })] }), footer && _jsx(Modal.Footer, { className: 'flex-wrap', children: footer })] }));
|
|
21
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** ======== STAR ======== */
|
|
2
|
+
export declare function SVGStarFill(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function SVGStarHalf(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function SVGStarLine(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function StarRating({ rating }: {
|
|
6
|
+
rating: number;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
/** ======== HEART ======== */
|
|
9
|
+
export declare function SVGHeartFill(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function SVGHeartHalf(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function SVGHeartLine(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** ======== STAR ======== */
|
|
3
|
+
export function SVGStarFill(props) {
|
|
4
|
+
return (_jsx("svg", { viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', ...props, children: _jsx("path", { d: 'M18.75 7.69221L12.5925 6.95272L9.99671 1.25L7.40096 6.95272L1.25 7.69221L5.7975 11.9626L4.59491 18.125L9.99671 15.0538L15.4051 18.125L14.2025 11.9626L18.75 7.69221Z', fill: 'currentColor' }) }));
|
|
5
|
+
}
|
|
6
|
+
export function SVGStarHalf(props) {
|
|
7
|
+
return (_jsx("svg", { viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', ...props, children: _jsx("path", { d: 'M18.75 7.69476L12.5925 6.95497L9.99671 1.25L7.40096 6.95497L1.25 7.69476L5.7975 11.9602L4.58834 18.125L9.99671 15.0526L15.4051 18.125L14.1959 11.9602L18.7434 7.69476H18.75ZM10.0033 13.533V4.43572L11.7119 8.19461L15.7665 8.68113L12.7699 11.4936L13.5651 15.5524L10.0033 13.533Z', fill: 'currentColor' }) }));
|
|
8
|
+
}
|
|
9
|
+
export function SVGStarLine(props) {
|
|
10
|
+
return (_jsx("svg", { viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', ...props, children: _jsx("path", { d: 'M15.4117 18.125L10.0033 15.0526L4.59491 18.125L5.80407 11.9602L1.25 7.69476L7.40096 6.95498L9.99671 1.25L12.5925 6.95498L18.75 7.69476L14.2025 11.9602L15.4117 18.125ZM10.0033 13.5264L13.5651 15.5458L12.7699 11.487L15.7665 8.67447L11.7119 8.18794L10.0033 4.42906L8.29469 8.18794L4.24005 8.67447L7.23667 11.487L6.44151 15.5458L10.0033 13.5264Z', fill: 'currentColor' }) }));
|
|
11
|
+
}
|
|
12
|
+
export function StarRating({ rating }) {
|
|
13
|
+
const getStarIcon = (i) => {
|
|
14
|
+
if (rating >= i + 1) {
|
|
15
|
+
return _jsx(SVGStarFill, { className: 'size-5 text-yellow-500' }, i);
|
|
16
|
+
}
|
|
17
|
+
else if (rating >= i + 0.5) {
|
|
18
|
+
return _jsx(SVGStarHalf, { className: 'size-5 text-yellow-500' }, i);
|
|
19
|
+
}
|
|
20
|
+
return _jsx(SVGStarLine, { className: 'size-5 text-stroke-sub-300' }, i);
|
|
21
|
+
};
|
|
22
|
+
return (_jsx("div", { className: 'flex gap-0.5', children: Array.from({ length: 5 }, (_, i) => getStarIcon(i)) }));
|
|
23
|
+
}
|
|
24
|
+
/** ======== HEART ======== */
|
|
25
|
+
export function SVGHeartFill(props) {
|
|
26
|
+
return (_jsx("svg", { viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', ...props, children: _jsx("path", { d: 'M13.375 3.125C15.6535 3.125 17.5 4.98311 17.5 7.58446C17.5 12.7872 11.875 15.7601 10 16.875C8.125 15.7601 2.5 12.7872 2.5 7.58446C2.5 4.98311 4.375 3.125 6.625 3.125C8.02 3.125 9.25 3.86824 10 4.61149C10.75 3.86824 11.98 3.125 13.375 3.125Z', fill: 'currentColor' }) }));
|
|
27
|
+
}
|
|
28
|
+
export function SVGHeartHalf(props) {
|
|
29
|
+
return (_jsx("svg", { viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', ...props, children: _jsx("path", { d: 'M13.375 3.125C12.2 3.125 10.9438 3.68226 10.0063 4.61521C9.06875 3.68226 7.8 3.125 6.625 3.125C4.3125 3.125 2.5 5.08481 2.5 7.59563C2.5 9.81216 3.525 11.8909 5.55 13.7881C7 15.1469 8.5875 16.0798 9.6875 16.7185L10.0437 16.875L10.3562 16.6934C11.3438 16.1174 13 15.1469 14.45 13.7881C16.475 11.8972 17.5 9.81216 17.5 7.59563C17.5 5.04724 15.725 3.125 13.375 3.125ZM13.6 12.8677C12.4 13.9948 11.0312 14.815 10.0063 15.4224C10.0438 13.688 10.0312 8.6538 10.0063 6.36214L10.8813 5.50433C11.15 5.24135 12.1125 4.37728 13.375 4.37728C15.0125 4.37728 16.25 5.76104 16.25 7.59563C16.25 9.43021 15.3562 11.221 13.6 12.8677Z', fill: 'currentColor' }) }));
|
|
30
|
+
}
|
|
31
|
+
export function SVGHeartLine(props) {
|
|
32
|
+
return (_jsx("svg", { viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', ...props, children: _jsx("path", { d: 'M10.0437 16.875L9.6875 16.7185C8.5875 16.0735 7 15.1406 5.55 13.7881C3.525 11.8909 2.5 9.8059 2.5 7.59563C2.5 5.08481 4.3125 3.125 6.625 3.125C7.8 3.125 9.0625 3.68226 10 4.61521C10.9375 3.68226 12.2 3.125 13.375 3.125C15.725 3.125 17.5 5.04724 17.5 7.59563C17.5 9.81216 16.475 11.8909 14.45 13.7881C13 15.1469 11.3438 16.1174 10.3562 16.6934L10.0437 16.875ZM6.625 4.37728C4.9875 4.37728 3.75 5.76104 3.75 7.59563C3.75 9.43021 4.64375 11.221 6.4 12.8677C7.63125 14.0198 9.00625 14.8651 10 15.4474C11.0312 14.8401 12.3813 14.0073 13.6 12.8677C15.3562 11.221 16.25 9.449 16.25 7.59563C16.25 5.74226 15.0125 4.37728 13.375 4.37728C12.1125 4.37728 11.1438 5.24135 10.8813 5.50433L10 6.37466L9.11875 5.50433C8.85 5.24135 7.8875 4.37728 6.625 4.37728Z', fill: 'currentColor' }) }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SwitchProps } from "./switch.js";
|
|
3
|
+
type ContentProps = {
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
sublabel?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
badge?: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export type SwitchLabelProps = Omit<SwitchProps, 'children' | 'asChild'> & ContentProps & {
|
|
10
|
+
flip?: boolean;
|
|
11
|
+
action?: React.ReactNode;
|
|
12
|
+
switchClassName?: string;
|
|
13
|
+
};
|
|
14
|
+
export type SwitchCardProps = Omit<SwitchLabelProps, 'flip' | 'action'> & {
|
|
15
|
+
variant?: 'basic' | 'icon' | 'avatar' | 'card-provider' | 'brand' | 'company';
|
|
16
|
+
/** Supply an icon, avatar, payment-provider mark, brand, or company logo. */
|
|
17
|
+
leading?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
export type IntegrationSwitchProps = Omit<SwitchLabelProps, 'flip'> & {
|
|
20
|
+
orientation?: 'horizontal' | 'vertical';
|
|
21
|
+
appearance?: 'card' | 'list';
|
|
22
|
+
/** Brand mark. Card and list slots are 24 and 32 px respectively. */
|
|
23
|
+
leading?: React.ReactNode;
|
|
24
|
+
showSwitch?: boolean;
|
|
25
|
+
};
|
|
26
|
+
/** Figma Switch Label: 8 px control gap, optional supporting copy and action. */
|
|
27
|
+
export declare const Label: React.ForwardRefExoticComponent<Omit<SwitchProps, "children" | "asChild"> & ContentProps & {
|
|
28
|
+
flip?: boolean;
|
|
29
|
+
action?: React.ReactNode;
|
|
30
|
+
switchClassName?: string;
|
|
31
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
/** Figma Switch Card: 12 px corners, 16 px inset, 14 px leading-content gap. */
|
|
33
|
+
export declare const Card: React.ForwardRefExoticComponent<Omit<SwitchLabelProps, "action" | "flip"> & {
|
|
34
|
+
variant?: "basic" | "icon" | "avatar" | "card-provider" | "brand" | "company";
|
|
35
|
+
/** Supply an icon, avatar, payment-provider mark, brand, or company logo. */
|
|
36
|
+
leading?: React.ReactNode;
|
|
37
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
/** Integration composition: horizontal/vertical, card/list, optional brand/action/control. */
|
|
39
|
+
export declare const Integration: React.ForwardRefExoticComponent<Omit<SwitchLabelProps, "flip"> & {
|
|
40
|
+
orientation?: "horizontal" | "vertical";
|
|
41
|
+
appearance?: "card" | "list";
|
|
42
|
+
/** Brand mark. Card and list slots are 24 and 32 px respectively. */
|
|
43
|
+
leading?: React.ReactNode;
|
|
44
|
+
showSwitch?: boolean;
|
|
45
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.js";
|
|
5
|
+
import * as FieldLabel from "./label.js";
|
|
6
|
+
import { Root } from "./switch.js";
|
|
7
|
+
function TextContent({ label, sublabel, description, badge, id, disabled, card, large, showSwitch = true, fullWidth, className, }) {
|
|
8
|
+
return (_jsxs("div", { className: cn('min-w-0 flex-1 space-y-1', fullWidth && 'w-full', className), children: [_jsxs("div", { className: 'flex min-h-5 flex-wrap items-center gap-1', children: [_jsx(FieldLabel.Root, { asChild: !showSwitch, id: `${id}-label`, htmlFor: showSwitch ? id : undefined, className: cn('min-w-0 text-start', large
|
|
9
|
+
? 'text-label-md'
|
|
10
|
+
: description
|
|
11
|
+
? 'text-label-sm'
|
|
12
|
+
: 'text-paragraph-sm', disabled ? 'text-text-sub-600' : 'text-text-strong-950', card && 'after:absolute after:inset-0 after:rounded-xl', disabled && 'cursor-not-allowed', !showSwitch && 'cursor-default'), children: _jsx("span", { children: label }) }), sublabel && (_jsx("span", { className: cn('text-paragraph-xs', disabled ? 'text-text-soft-400' : 'text-text-sub-600'), children: sublabel })), badge] }), description && (_jsx("p", { id: `${id}-description`, className: cn(large ? 'text-paragraph-sm' : 'text-paragraph-xs', disabled ? 'text-text-soft-400' : 'text-text-sub-600'), children: description }))] }));
|
|
13
|
+
}
|
|
14
|
+
const descriptionIds = (id, description, additional) => [description ? `${id}-description` : undefined, additional]
|
|
15
|
+
.filter(Boolean)
|
|
16
|
+
.join(' ') || undefined;
|
|
17
|
+
/** Figma Switch Label: 8 px control gap, optional supporting copy and action. */
|
|
18
|
+
export const Label = React.forwardRef(function SwitchLabel({ id: providedId, label, sublabel, description, badge, flip = false, action, disabled, dir, className, switchClassName, ...props }, ref) {
|
|
19
|
+
const generatedId = React.useId();
|
|
20
|
+
const id = providedId ?? generatedId;
|
|
21
|
+
return (_jsxs("div", { dir: dir, className: cn('flex w-[300px] max-w-full items-start gap-2', flip && 'flex-row-reverse', className), children: [_jsx(Root, { ...props, ref: ref, id: id, disabled: disabled, dir: dir, "aria-labelledby": props['aria-labelledby'] ?? `${id}-label`, "aria-describedby": descriptionIds(id, description, props['aria-describedby']), className: switchClassName }), _jsxs("div", { className: 'min-w-0 flex-1 space-y-2.5', children: [_jsx(TextContent, { id, label, sublabel, description, badge, disabled }), action] })] }));
|
|
22
|
+
});
|
|
23
|
+
Label.displayName = 'SwitchLabel';
|
|
24
|
+
/** Figma Switch Card: 12 px corners, 16 px inset, 14 px leading-content gap. */
|
|
25
|
+
export const Card = React.forwardRef(function SwitchCard({ id: providedId, label, sublabel, description, badge, leading, variant = 'basic', disabled, dir, className, switchClassName, state = 'default', ...props }, ref) {
|
|
26
|
+
const generatedId = React.useId();
|
|
27
|
+
const id = providedId ?? generatedId;
|
|
28
|
+
return (_jsxs("div", { dir: dir, "data-disabled": disabled || undefined, "data-visual-state": state, className: cn('group/switch-card relative flex w-[360px] max-w-full items-start gap-3.5 rounded-xl bg-bg-white-0 p-4 ring-1 ring-inset ring-stroke-soft-200 transition-colors motion-reduce:transition-none', disabled
|
|
29
|
+
? 'cursor-not-allowed'
|
|
30
|
+
: 'shadow-regular-xs hover:bg-bg-weak-50 hover:shadow-none hover:ring-transparent has-[[data-state=checked]]:!bg-bg-white-0 has-[[data-state=checked]]:!shadow-none has-[[data-state=checked]]:!ring-primary-base data-[visual-state=hover]:bg-bg-weak-50 data-[visual-state=hover]:shadow-none data-[visual-state=hover]:ring-transparent', className), children: [variant !== 'basic' && leading && (_jsx("div", { className: cn('pointer-events-none flex shrink-0 items-center justify-center', (variant === 'icon' ||
|
|
31
|
+
variant === 'avatar' ||
|
|
32
|
+
variant === 'company') &&
|
|
33
|
+
'size-10 rounded-full', variant === 'icon' &&
|
|
34
|
+
'bg-bg-white-0 text-text-sub-600 shadow-regular-xs ring-1 ring-inset ring-stroke-soft-200 [&>svg]:size-5', variant === 'avatar' && 'overflow-hidden', variant === 'card-provider' && 'h-6 w-8', variant === 'brand' && 'size-8', variant === 'company' && 'bg-bg-white-0'), children: leading })), _jsx(TextContent, { id, label, sublabel, description, badge, disabled, card: true }), _jsx(Root, { ...props, ref: ref, id: id, disabled: disabled, dir: dir, state: state, "aria-labelledby": props['aria-labelledby'] ?? `${id}-label`, "aria-describedby": descriptionIds(id, description, props['aria-describedby']), className: cn('relative z-[1]', switchClassName) })] }));
|
|
35
|
+
});
|
|
36
|
+
Card.displayName = 'SwitchCard';
|
|
37
|
+
/** Integration composition: horizontal/vertical, card/list, optional brand/action/control. */
|
|
38
|
+
export const Integration = React.forwardRef(function IntegrationSwitch({ id: providedId, label, sublabel, description, badge, leading, action, orientation = 'horizontal', appearance = 'card', showSwitch = true, disabled, dir, className, switchClassName, ...props }, ref) {
|
|
39
|
+
const generatedId = React.useId();
|
|
40
|
+
const id = providedId ?? generatedId;
|
|
41
|
+
const vertical = orientation === 'vertical';
|
|
42
|
+
const card = appearance === 'card';
|
|
43
|
+
return (_jsxs("div", { dir: dir, className: cn('relative flex max-w-full gap-3.5', vertical
|
|
44
|
+
? 'w-[378px] flex-col items-start'
|
|
45
|
+
: 'w-[613px] flex-wrap items-center', card &&
|
|
46
|
+
'rounded-xl bg-bg-white-0 p-4 shadow-regular-xs ring-1 ring-inset ring-stroke-soft-200', className), children: [(leading || (vertical && showSwitch)) && (_jsx("div", { className: cn('shrink-0', card ? 'size-10' : 'size-12'), children: leading && (_jsx("div", { className: 'flex size-full items-center justify-center rounded-full bg-bg-white-0 p-2 shadow-regular-xs ring-1 ring-inset ring-stroke-soft-200', children: leading })) })), _jsx(TextContent, { id, label, sublabel, description, badge, disabled, showSwitch, large: !card, fullWidth: vertical, className: !vertical ? 'min-w-[min(100%,10rem)]' : undefined }), action && (_jsx("div", { className: cn('shrink-0', vertical && 'w-full [&>*]:w-full'), children: action })), showSwitch && (_jsx(Root, { ...props, ref: ref, id: id, disabled: disabled, dir: dir, "aria-labelledby": props['aria-labelledby'] ?? `${id}-label`, "aria-describedby": descriptionIds(id, description, props['aria-describedby']), className: cn(!vertical && 'ms-auto', vertical &&
|
|
47
|
+
(card
|
|
48
|
+
? 'absolute end-[19px] top-[19px]'
|
|
49
|
+
: 'absolute end-3 top-3'), switchClassName) }))] }));
|
|
50
|
+
});
|
|
51
|
+
Integration.displayName = 'IntegrationSwitch';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Primitive from "@radix-ui/react-switch";
|
|
3
|
+
export type SwitchProps = React.ComponentPropsWithoutRef<typeof Primitive.Root> & {
|
|
4
|
+
/** Optional design-state preview; normal pointer and keyboard states still work. */
|
|
5
|
+
state?: 'default' | 'hover' | 'pressed';
|
|
6
|
+
};
|
|
7
|
+
/** Figma Switch [1.1]: 38 × 20 control, 34 × 16 track, 18 × 14 thumb. */
|
|
8
|
+
declare const Root: React.ForwardRefExoticComponent<Omit<Primitive.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
9
|
+
/** Optional design-state preview; normal pointer and keyboard states still work. */
|
|
10
|
+
state?: "default" | "hover" | "pressed";
|
|
11
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export { Root };
|
|
13
|
+
export { Label, Card, Integration } from "./switch-compositions.js";
|
|
14
|
+
export type { SwitchLabelProps, SwitchCardProps, IntegrationSwitchProps, } from "./switch-compositions.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Slottable } from "@radix-ui/react-slot";
|
|
5
|
+
import * as Primitive from "@radix-ui/react-switch";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
/** Figma Switch [1.1]: 38 × 20 control, 34 × 16 track, 18 × 14 thumb. */
|
|
8
|
+
const Root = React.forwardRef(function Root({ disabled, state = 'default', className, children, ...props }, ref) {
|
|
9
|
+
return (_jsxs(Primitive.Root, { ...props, disabled: disabled, "data-visual-state": state, ref: ref, className: cn('group/switch relative block h-5 w-[38px] shrink-0 rounded-full p-0 outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base disabled:cursor-not-allowed', className), children: [_jsx("span", { "aria-hidden": 'true', className: cn('pointer-events-none absolute inset-x-0.5 top-0.5 block h-4 rounded-full transition-colors duration-200 motion-reduce:transition-none', disabled
|
|
10
|
+
? 'bg-bg-white-0 ring-1 ring-inset ring-stroke-soft-200'
|
|
11
|
+
: 'bg-bg-soft-200 group-hover/switch-card:bg-bg-sub-300 group-hover/switch:bg-bg-sub-300 group-active/switch:!bg-bg-soft-200 group-data-[state=checked]/switch:bg-primary-base group-data-[state=checked]/switch:group-data-[visual-state=hover]/switch:bg-[--primary-dark] group-data-[state=checked]/switch:group-data-[visual-state=pressed]/switch:!bg-primary-base group-data-[visual-state=hover]/switch:bg-bg-sub-300 group-data-[visual-state=pressed]/switch:!bg-bg-soft-200 group-data-[state=checked]/switch:group-hover/switch-card:bg-[--primary-dark] group-data-[state=checked]/switch:group-hover/switch:bg-[--primary-dark] group-data-[state=checked]/switch:group-active/switch:!bg-primary-base') }), _jsx(Primitive.Thumb, { className: cn('pointer-events-none absolute start-[3px] top-[3px] block h-[14px] w-[18px] rounded-full transition-transform duration-200 data-[state=checked]:translate-x-[14px] motion-reduce:transition-none rtl:data-[state=checked]:-translate-x-[14px]', disabled
|
|
12
|
+
? 'border border-static-white bg-bg-soft-200'
|
|
13
|
+
: 'bg-static-white shadow-switch-thumb') }), _jsx(Slottable, { children: children })] }));
|
|
14
|
+
});
|
|
15
|
+
Root.displayName = 'Switch';
|
|
16
|
+
export { Root };
|
|
17
|
+
export { Label, Card, Integration } from "./switch-compositions.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Tabs from "@radix-ui/react-tabs";
|
|
3
|
+
import type { PolymorphicComponentProps } from "../../utils/polymorphic.js";
|
|
4
|
+
export declare const Content: React.ForwardRefExoticComponent<Tabs.TabsContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const Root: React.ForwardRefExoticComponent<Omit<Omit<Tabs.TabsProps & React.RefAttributes<HTMLDivElement>, "ref">, "orientation"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const List: React.ForwardRefExoticComponent<Omit<Tabs.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
7
|
+
wrapperClassName?: string;
|
|
8
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const Trigger: React.ForwardRefExoticComponent<Omit<Tabs.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export declare function Icon<T extends React.ElementType = 'div'>({ as, className, ...props }: PolymorphicComponentProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function ArrowIcon<T extends React.ElementType = 'div'>({ as, className, ...props }: PolymorphicComponentProps<T, React.HTMLAttributes<HTMLDivElement>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as Tabs from "@radix-ui/react-tabs";
|
|
5
|
+
import { Slottable } from "@radix-ui/react-slot";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
import { useTabObserver } from "../../hooks/use-tab-observer.js";
|
|
8
|
+
export const Content = Tabs.Content;
|
|
9
|
+
export const Root = React.forwardRef(function Root({ className, ...props }, ref) {
|
|
10
|
+
return (_jsx(Tabs.Root, { ...props, ref: ref, orientation: 'horizontal', className: cn('w-full', className) }));
|
|
11
|
+
});
|
|
12
|
+
export const List = React.forwardRef(function List({ children, className, wrapperClassName, ...props }, ref) {
|
|
13
|
+
const scroll = React.useRef(null);
|
|
14
|
+
const [position, setPosition] = React.useState({ left: 0, width: 0 });
|
|
15
|
+
const { listRef, mounted } = useTabObserver({
|
|
16
|
+
onActiveTabChange: (_index, tab) => {
|
|
17
|
+
setPosition({ left: tab.offsetLeft, width: tab.offsetWidth });
|
|
18
|
+
const container = scroll.current;
|
|
19
|
+
if (container)
|
|
20
|
+
container.scrollTo({
|
|
21
|
+
left: tab.offsetLeft + (tab.offsetWidth - container.clientWidth) / 2,
|
|
22
|
+
behavior: 'smooth',
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const connect = React.useCallback((node) => {
|
|
27
|
+
listRef.current = node;
|
|
28
|
+
if (typeof ref === 'function')
|
|
29
|
+
ref(node);
|
|
30
|
+
else if (ref)
|
|
31
|
+
ref.current = node;
|
|
32
|
+
}, [listRef, ref]);
|
|
33
|
+
return (_jsx("div", { ref: scroll, className: cn('relative grid overflow-x-auto overflow-y-hidden overscroll-contain', wrapperClassName), children: _jsxs(Tabs.List, { ...props, ref: connect, className: cn('group/tab-list relative flex h-12 items-center gap-6 whitespace-nowrap border-y border-stroke-soft-200', className), children: [_jsx(Slottable, { children: children }), _jsx("span", { "aria-hidden": 'true', className: cn('pointer-events-none absolute -bottom-px left-0 h-0.5 bg-primary-base opacity-0 transition-all duration-300 group-has-[[data-state=active]]/tab-list:opacity-100', !mounted && 'hidden'), style: {
|
|
34
|
+
transform: `translateX(${position.left}px)`,
|
|
35
|
+
width: position.width,
|
|
36
|
+
transitionTimingFunction: 'cubic-bezier(.65,0,.35,1)',
|
|
37
|
+
} })] }) }));
|
|
38
|
+
});
|
|
39
|
+
export const Trigger = React.forwardRef(function Trigger({ className, ...props }, ref) {
|
|
40
|
+
return (_jsx(Tabs.Trigger, { ...props, ref: ref, className: cn('group/tab-item inline-flex h-12 items-center justify-center gap-1.5 py-3.5 text-label-sm text-text-sub-600 outline-none transition duration-200 ease-out data-[state=active]:text-text-strong-950', className) }));
|
|
41
|
+
});
|
|
42
|
+
export function Icon({ as, className, ...props }) {
|
|
43
|
+
const Element = as ?? 'div';
|
|
44
|
+
return (_jsx(Element, { ...props, className: cn('size-5 text-text-sub-600 transition-colors duration-200 ease-out group-data-[state=active]/tab-item:text-primary-base', className) }));
|
|
45
|
+
}
|
|
46
|
+
export function ArrowIcon({ as, className, ...props }) {
|
|
47
|
+
const Element = as ?? 'div';
|
|
48
|
+
return (_jsx(Element, { ...props, className: cn('size-5 text-text-sub-600', className) }));
|
|
49
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Tabs from "@radix-ui/react-tabs";
|
|
3
|
+
import type { PolymorphicComponentProps } from "../../utils/polymorphic.js";
|
|
4
|
+
export declare const Content: React.ForwardRefExoticComponent<Tabs.TabsContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const Root: React.ForwardRefExoticComponent<Omit<Omit<Tabs.TabsProps & React.RefAttributes<HTMLDivElement>, "ref">, "orientation"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const List: React.ForwardRefExoticComponent<Omit<Tabs.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const Trigger: React.ForwardRefExoticComponent<Omit<Tabs.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export declare function Icon<T extends React.ElementType = 'div'>({ as, className, ...props }: PolymorphicComponentProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function ArrowIcon<T extends React.ElementType = 'div'>({ as, className, ...props }: PolymorphicComponentProps<T>): import("react/jsx-runtime").JSX.Element;
|