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,53 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ItemProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> & {
|
|
3
|
+
selected?: boolean;
|
|
4
|
+
defaultSelected?: boolean;
|
|
5
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
showIcon?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const Item: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> & {
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
defaultSelected?: boolean;
|
|
12
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
showIcon?: boolean;
|
|
15
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
export type HeaderProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
17
|
+
icon?: React.ReactNode;
|
|
18
|
+
showIcon?: boolean;
|
|
19
|
+
onClear?: () => void;
|
|
20
|
+
clearLabel?: string;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare function Header({ children, icon, showIcon, onClear, clearLabel, disabled, className, ...props }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export type FooterProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
25
|
+
onClear?: () => void;
|
|
26
|
+
onApply?: () => void;
|
|
27
|
+
clearLabel?: string;
|
|
28
|
+
applyLabel?: string;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare function Footer({ onClear, onApply, clearLabel, applyLabel, disabled, className, ...props }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export type HorizontalValue = {
|
|
33
|
+
query: string;
|
|
34
|
+
segment: string;
|
|
35
|
+
range: string;
|
|
36
|
+
from: string;
|
|
37
|
+
to: string;
|
|
38
|
+
sort: string;
|
|
39
|
+
};
|
|
40
|
+
export type HorizontalProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> & {
|
|
41
|
+
variant?: 'calendar' | 'table';
|
|
42
|
+
value?: HorizontalValue;
|
|
43
|
+
defaultValue?: Partial<HorizontalValue>;
|
|
44
|
+
onValueChange?: (value: HorizontalValue) => void;
|
|
45
|
+
showSearch?: boolean;
|
|
46
|
+
showFilter?: boolean;
|
|
47
|
+
showSettings?: boolean;
|
|
48
|
+
showSort?: boolean;
|
|
49
|
+
onFilter?: () => void;
|
|
50
|
+
onSettings?: () => void;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
};
|
|
53
|
+
export declare function Horizontal({ variant, value, defaultValue, onValueChange, showSearch, showFilter, showSettings, showSort, onFilter, onSettings, disabled, className, onKeyDown, ...props }: HorizontalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { resolveMagnaAsset as __resolveMagnaAsset_1 } from "../../magna-assets.js";
|
|
4
|
+
/* eslint-disable @next/next/no-img-element */
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
import * as Button from "./button.js";
|
|
8
|
+
import * as Input from "./input.js";
|
|
9
|
+
import * as Select from "./select.js";
|
|
10
|
+
import * as SegmentedControl from "./segmented-control.js";
|
|
11
|
+
import * as Popover from "./popover.js";
|
|
12
|
+
import * as LinkButton from "./link-button.js";
|
|
13
|
+
import * as Kbd from "./kbd.js";
|
|
14
|
+
const image = (name, className) => (_jsx("img", { src: __resolveMagnaAsset_1(`/magna/feeds/${name}.svg`), alt: '', "aria-hidden": 'true', className: cn('block max-w-none shrink-0', className) }));
|
|
15
|
+
export const Item = React.forwardRef(function Item({ selected, defaultSelected = false, onSelectedChange, icon, showIcon = true, children = 'Date', className, onClick, ...props }, ref) {
|
|
16
|
+
const [internal, setInternal] = React.useState(defaultSelected);
|
|
17
|
+
const active = selected ?? internal;
|
|
18
|
+
return (_jsxs(Button.Root, { ...props, ref: ref, type: 'button', variant: 'neutral', mode: 'ghost', size: 'small', "aria-pressed": active, className: cn('group/filter-item w-full max-w-[200px] justify-start gap-2 rounded-lg p-2', active && 'bg-bg-weak-50 text-text-strong-950', className), onClick: (event) => {
|
|
19
|
+
onClick?.(event);
|
|
20
|
+
if (!event.defaultPrevented) {
|
|
21
|
+
if (selected === undefined)
|
|
22
|
+
setInternal(!active);
|
|
23
|
+
onSelectedChange?.(!active);
|
|
24
|
+
}
|
|
25
|
+
}, children: [showIcon &&
|
|
26
|
+
(icon ??
|
|
27
|
+
(active ? (image('vertical-calendar-active')) : (_jsxs(_Fragment, { children: [image('vertical-calendar', 'group-hover/filter-item:hidden'), image('vertical-calendar-hover', 'hidden group-hover/filter-item:block')] })))), _jsx("span", { className: 'min-w-0 flex-1 truncate text-start', children: children }), active && image('vertical-arrow', 'rtl:rotate-180')] }));
|
|
28
|
+
});
|
|
29
|
+
export function Header({ children = 'Label', icon, showIcon = true, onClear, clearLabel = 'Clear', disabled = false, className, ...props }) {
|
|
30
|
+
return (_jsxs("div", { ...props, className: cn('flex w-full items-center gap-2 border-b border-stroke-soft-200 bg-bg-white-0 px-5 pb-[15px] pt-4', className), children: [showIcon && (icon ?? image('header-calendar')), _jsx("div", { className: 'min-w-0 flex-1 text-label-sm text-text-strong-950', children: children }), onClear && (_jsx(LinkButton.Root, { type: 'button', underline: true, onClick: onClear, disabled: disabled, children: clearLabel }))] }));
|
|
31
|
+
}
|
|
32
|
+
export function Footer({ onClear, onApply, clearLabel = 'Clear', applyLabel = 'Apply', disabled = false, className, ...props }) {
|
|
33
|
+
return (_jsxs("div", { ...props, className: cn('flex w-full items-center gap-4 border-t border-stroke-soft-200 bg-bg-white-0 px-5 pb-4 pt-[15px]', className), children: [_jsx(Button.Root, { type: 'button', size: 'small', variant: 'neutral', mode: 'stroke', className: 'flex-1', disabled: disabled || !onClear, onClick: onClear, children: clearLabel }), _jsx(Button.Root, { type: 'button', size: 'small', className: 'flex-1', disabled: disabled || !onApply, onClick: onApply, children: applyLabel })] }));
|
|
34
|
+
}
|
|
35
|
+
const defaults = {
|
|
36
|
+
query: '',
|
|
37
|
+
segment: 'all',
|
|
38
|
+
range: '7d',
|
|
39
|
+
from: '2023-08-04',
|
|
40
|
+
to: '2023-08-11',
|
|
41
|
+
sort: '',
|
|
42
|
+
};
|
|
43
|
+
const dateText = (date) => {
|
|
44
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(date))
|
|
45
|
+
return date;
|
|
46
|
+
const [year, month, day] = date.split('-');
|
|
47
|
+
return `${['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][Number(month) - 1]} ${day} ${year}`;
|
|
48
|
+
};
|
|
49
|
+
export function Horizontal({ variant = 'calendar', value, defaultValue, onValueChange, showSearch = true, showFilter = true, showSettings = true, showSort = true, onFilter, onSettings, disabled = false, className, onKeyDown, ...props }) {
|
|
50
|
+
const searchInput = React.useRef(null);
|
|
51
|
+
const [internal, setInternal] = React.useState(() => ({
|
|
52
|
+
...defaults,
|
|
53
|
+
...defaultValue,
|
|
54
|
+
}));
|
|
55
|
+
const current = value ?? internal;
|
|
56
|
+
const update = (next) => {
|
|
57
|
+
const merged = { ...current, ...next };
|
|
58
|
+
if (value === undefined)
|
|
59
|
+
setInternal(merged);
|
|
60
|
+
onValueChange?.(merged);
|
|
61
|
+
};
|
|
62
|
+
const chooseRange = (range) => {
|
|
63
|
+
if (range === 'custom') {
|
|
64
|
+
update({ range });
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const now = new Date();
|
|
68
|
+
const to = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;
|
|
69
|
+
const start = new Date(now);
|
|
70
|
+
start.setDate(start.getDate() - (range === '30d' ? 29 : range === '7d' ? 6 : 0));
|
|
71
|
+
const from = `${start.getFullYear()}-${String(start.getMonth() + 1).padStart(2, '0')}-${String(start.getDate()).padStart(2, '0')}`;
|
|
72
|
+
update({ range, from, to });
|
|
73
|
+
};
|
|
74
|
+
return (_jsxs("div", { ...props, className: cn('flex w-full flex-wrap items-start gap-3', className), onKeyDown: (event) => {
|
|
75
|
+
onKeyDown?.(event);
|
|
76
|
+
if (!event.defaultPrevented &&
|
|
77
|
+
!disabled &&
|
|
78
|
+
showSearch &&
|
|
79
|
+
(event.metaKey || event.ctrlKey) &&
|
|
80
|
+
event.key === '1') {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
searchInput.current?.focus();
|
|
83
|
+
}
|
|
84
|
+
}, children: [variant === 'calendar' ? (_jsxs("div", { className: 'flex max-w-full flex-wrap items-center gap-[11px]', children: [_jsx(Button.Root, { type: 'button', size: 'small', variant: 'neutral', mode: 'stroke', disabled: disabled, onClick: () => chooseRange('today'), children: "Today" }), _jsxs("div", { className: 'flex max-w-full items-center overflow-hidden rounded-full ring-1 ring-inset ring-stroke-soft-200', children: [_jsxs(Select.Root, { value: current.range, onValueChange: chooseRange, disabled: disabled, size: 'small', children: [_jsx(Select.Trigger, { "aria-label": 'Date range preset', className: 'rounded-none shadow-none ring-0', children: _jsx(Select.Value, {}) }), _jsxs(Select.Content, { children: [_jsx(Select.Item, { value: 'today', children: "Today" }), _jsx(Select.Item, { value: '7d', children: "Last 7 days" }), _jsx(Select.Item, { value: '30d', children: "Last 30 days" }), _jsx(Select.Item, { value: 'custom', children: "Custom" })] })] }), _jsxs(Popover.Root, { children: [_jsx(Popover.Trigger, { asChild: true, children: _jsxs(Button.Root, { type: 'button', size: 'small', variant: 'neutral', mode: 'ghost', disabled: disabled, className: 'min-w-0 gap-2 rounded-none border-s border-stroke-soft-200 px-3.5', children: [image('calendar'), _jsxs("span", { className: 'truncate', children: [current.from.slice(0, 4) === current.to.slice(0, 4)
|
|
85
|
+
? dateText(current.from).slice(0, -5)
|
|
86
|
+
: dateText(current.from), ' ', "\u2013 ", dateText(current.to)] })] }) }), _jsxs(Popover.Content, { showArrow: false, className: 'w-[min(320px,calc(100vw-32px))] space-y-3', children: [_jsx("div", { className: 'text-label-sm text-text-strong-950', children: "Date range" }), ['from', 'to'].map((field) => (_jsx(Input.Root, { size: 'small', children: _jsxs(Input.Wrapper, { children: [_jsx("span", { className: 'text-paragraph-sm text-text-sub-600', children: field === 'from' ? 'From' : 'To' }), _jsx(Input.Input, { type: 'date', "aria-label": field === 'from' ? 'Start date' : 'End date', value: current[field], max: field === 'from' ? current.to : undefined, min: field === 'to' ? current.from : undefined, onChange: (event) => update({
|
|
87
|
+
[field]: event.target.value,
|
|
88
|
+
range: 'custom',
|
|
89
|
+
}) })] }) }, field))), _jsx(Popover.Close, { asChild: true, children: _jsx(Button.Root, { type: 'button', size: 'small', className: 'w-full', children: "Done" }) })] })] })] })] })) : (_jsx(SegmentedControl.Root, { value: current.segment, onValueChange: (segment) => update({ segment }), className: 'w-full max-w-[320px]', children: _jsxs(SegmentedControl.List, { "aria-label": 'Transaction type', className: 'h-9 p-px', floatingBgClassName: 'inset-y-px border-[0.4px] border-stroke-soft-200 shadow-none', children: [_jsx(SegmentedControl.Trigger, { value: 'all', disabled: disabled, className: 'h-[34px]', children: "All" }), _jsx(SegmentedControl.Trigger, { value: 'income', disabled: disabled, className: 'h-[34px]', children: "Income" }), _jsx(SegmentedControl.Trigger, { value: 'expenses', disabled: disabled, className: 'h-[34px]', children: "Expenses" })] }) })), _jsxs("div", { className: 'ms-auto flex max-w-full flex-1 flex-wrap items-center justify-end gap-3', children: [showSearch && (_jsx(Input.Root, { size: 'small', className: 'min-w-[160px] max-w-[300px] flex-1', children: _jsxs(Input.Wrapper, { children: [image('search'), _jsx(Input.Input, { ref: searchInput, type: 'search', "aria-label": 'Search records', "aria-keyshortcuts": 'Meta+1 Control+1', placeholder: 'Search...', disabled: disabled, value: current.query, onChange: (event) => update({ query: event.target.value }) }), _jsx(Kbd.Root, { className: 'shrink-0 rounded-full', children: "\u23181" })] }) })), showFilter && (_jsxs(Button.Root, { type: 'button', size: 'small', variant: 'neutral', mode: 'stroke', className: 'gap-2', disabled: disabled || !onFilter, onClick: onFilter, children: [image('filter'), "Filter"] })), showSettings && (_jsx(Button.Root, { type: 'button', size: 'small', variant: 'neutral', mode: 'stroke', className: 'size-9 p-2', "aria-label": 'Filter display settings', disabled: disabled || !onSettings, onClick: onSettings, children: image('settings') })), variant === 'table' && showSort && (_jsxs(Select.Root, { value: current.sort, onValueChange: (sort) => update({ sort }), disabled: disabled, size: 'small', children: [_jsxs(Select.Trigger, { "aria-label": 'Sort records', className: 'w-auto gap-2', children: [image('sort'), _jsx(Select.Value, { placeholder: 'Sort by' })] }), _jsxs(Select.Content, { children: [_jsx(Select.Item, { value: 'newest', children: "Newest first" }), _jsx(Select.Item, { value: 'oldest', children: "Oldest first" }), _jsx(Select.Item, { value: 'amount', children: "Amount" })] })] }))] })] }));
|
|
90
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { resolveMagnaAsset as __resolveMagnaAsset_1 } from "../../magna-assets.js";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
/** A themeable mask using an unmodified Figma glyph export. */
|
|
5
|
+
export function FormAsset({ file, className, }) {
|
|
6
|
+
return (_jsx("span", { "aria-hidden": 'true', className: cn('block size-5 shrink-0 bg-current', className), style: {
|
|
7
|
+
mask: `url(${__resolveMagnaAsset_1(`/magna/forms/${file}`)}) center / contain no-repeat`,
|
|
8
|
+
WebkitMask: `url(${__resolveMagnaAsset_1(`/magna/forms/${file}`)}) center / contain no-repeat`,
|
|
9
|
+
} }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PolymorphicComponentProps } from "../../utils/polymorphic.js";
|
|
3
|
+
type Appearance = {
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
hasError: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const hintVariants: (options?: Partial<Appearance> & {
|
|
8
|
+
class?: import("tailwind-merge").ClassNameValue;
|
|
9
|
+
className?: import("tailwind-merge").ClassNameValue;
|
|
10
|
+
}) => Record<"root" | "icon", (overrides?: (Partial<Appearance> & {
|
|
11
|
+
class?: import("tailwind-merge").ClassNameValue;
|
|
12
|
+
className?: import("tailwind-merge").ClassNameValue;
|
|
13
|
+
}) | undefined) => string>;
|
|
14
|
+
export declare function Root({ disabled, hasError, children, className, ...props }: React.HTMLAttributes<HTMLDivElement> & Partial<Appearance>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace Root {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function Icon<T extends React.ElementType = 'div'>({ as, className, disabled, hasError, ...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,33 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { mergeOptions, slotRecipe } from "./magna-recipe.js";
|
|
5
|
+
const appearance = React.createContext({});
|
|
6
|
+
export const hintVariants = slotRecipe({ disabled: false, hasError: false }, ({ disabled, hasError }) => {
|
|
7
|
+
const state = hasError
|
|
8
|
+
? 'text-error-base'
|
|
9
|
+
: disabled
|
|
10
|
+
? 'text-text-disabled-300'
|
|
11
|
+
: undefined;
|
|
12
|
+
return {
|
|
13
|
+
root: [
|
|
14
|
+
'group flex items-center gap-1 text-paragraph-xs',
|
|
15
|
+
state ?? 'text-text-sub-600',
|
|
16
|
+
],
|
|
17
|
+
icon: ['size-4 shrink-0', state ?? 'text-text-soft-400'],
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
export function Root({ disabled, hasError, children, className, ...props }) {
|
|
21
|
+
const options = { disabled, hasError };
|
|
22
|
+
return (_jsx(appearance.Provider, { value: options, children: _jsx("div", { className: hintVariants(options).root({ className }), ...props, children: children }) }));
|
|
23
|
+
}
|
|
24
|
+
Root.displayName = 'HintRoot';
|
|
25
|
+
export function Icon({ as, className, disabled, hasError, ...props }) {
|
|
26
|
+
const options = mergeOptions(React.useContext(appearance), {
|
|
27
|
+
disabled,
|
|
28
|
+
hasError,
|
|
29
|
+
});
|
|
30
|
+
const Element = as || 'div';
|
|
31
|
+
return (_jsx(Element, { className: hintVariants(options).icon({ className }), ...props }));
|
|
32
|
+
}
|
|
33
|
+
Icon.displayName = 'HintIcon';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { RiArrowRightSLine } from "@remixicon/react";
|
|
3
|
+
import type { PolymorphicComponentProps } from "../../utils/polymorphic.js";
|
|
4
|
+
type StepState = 'default' | 'active' | 'completed';
|
|
5
|
+
export declare function Root({ asChild, className, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function SeparatorIcon<T extends React.ElementType = typeof RiArrowRightSLine>({ as, className, ...props }: PolymorphicComponentProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const Item: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
state?: StepState;
|
|
12
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
export declare function ItemIndicator({ state: override, className, children, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
14
|
+
state?: StepState;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { RiArrowRightSLine } from "@remixicon/react";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
const Step = React.createContext('default');
|
|
8
|
+
export function Root({ asChild, className, ...props }) {
|
|
9
|
+
const Element = asChild ? Slot : 'div';
|
|
10
|
+
return (_jsx(Element, { ...props, className: cn('flex flex-wrap justify-center gap-4', className) }));
|
|
11
|
+
}
|
|
12
|
+
export function SeparatorIcon({ as, className, ...props }) {
|
|
13
|
+
const Element = as ?? RiArrowRightSLine;
|
|
14
|
+
return (_jsx(Element, { ...props, className: cn('size-5 shrink-0 text-text-soft-400', className) }));
|
|
15
|
+
}
|
|
16
|
+
export const Item = React.forwardRef(function Item({ asChild, state = 'default', className, ...props }, ref) {
|
|
17
|
+
const Element = asChild ? Slot : 'button';
|
|
18
|
+
return (_jsx(Step.Provider, { value: state, children: _jsx(Element, { type: asChild ? undefined : 'button', ...props, ref: ref, "aria-current": state === 'active' ? 'step' : undefined, className: cn('flex items-center gap-2 text-paragraph-sm', state === 'default' ? 'text-text-sub-600' : 'text-text-strong-950', className) }) }));
|
|
19
|
+
});
|
|
20
|
+
export function ItemIndicator({ state: override, className, children, ...props }) {
|
|
21
|
+
const inherited = React.useContext(Step);
|
|
22
|
+
const state = override ?? inherited;
|
|
23
|
+
return (_jsx("div", { ...props, className: cn('flex size-5 shrink-0 items-center justify-center rounded-full text-label-xs', state === 'completed'
|
|
24
|
+
? 'bg-success-base text-static-white'
|
|
25
|
+
: state === 'active'
|
|
26
|
+
? 'bg-primary-base text-static-white'
|
|
27
|
+
: 'bg-bg-white-0 text-text-sub-600 ring-1 ring-inset ring-stroke-soft-200', className), children: state === 'completed' ? (_jsx("svg", { className: 'size-5', viewBox: '0 0 20 20', "aria-hidden": 'true', fill: 'none', children: _jsx("polyline", { points: '5.54,9.36 8.73,12.55 14.46,6.82', stroke: 'currentColor', strokeWidth: '1.8' }) })) : (children) }));
|
|
28
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type InlineInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'value' | 'defaultValue' | 'onChange'> & {
|
|
3
|
+
value?: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onValueChange?: (value: string) => void;
|
|
6
|
+
onCancel?: () => void;
|
|
7
|
+
leading?: React.ReactNode;
|
|
8
|
+
hasError?: boolean;
|
|
9
|
+
editLabel?: string;
|
|
10
|
+
saveLabel?: string;
|
|
11
|
+
cancelLabel?: string;
|
|
12
|
+
};
|
|
13
|
+
declare const Root: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "defaultValue" | "value"> & {
|
|
14
|
+
value?: string;
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
onValueChange?: (value: string) => void;
|
|
17
|
+
onCancel?: () => void;
|
|
18
|
+
leading?: React.ReactNode;
|
|
19
|
+
hasError?: boolean;
|
|
20
|
+
editLabel?: string;
|
|
21
|
+
saveLabel?: string;
|
|
22
|
+
cancelLabel?: string;
|
|
23
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
24
|
+
export { Root };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as CompactButton from "./compact-button.js";
|
|
5
|
+
import { FormAsset } from "./form-asset.js";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
const Root = React.forwardRef(function InlineInput({ value, defaultValue = '', onValueChange, onCancel, leading, hasError, className, disabled, readOnly, editLabel = 'Edit value', saveLabel = 'Save value', cancelLabel = 'Cancel editing', onKeyDown, ...props }, forwardedRef) {
|
|
8
|
+
const [internal, setInternal] = React.useState(defaultValue);
|
|
9
|
+
const current = value ?? internal;
|
|
10
|
+
const [editing, setEditing] = React.useState(false);
|
|
11
|
+
const [draft, setDraft] = React.useState(current);
|
|
12
|
+
const inputRef = React.useRef(null);
|
|
13
|
+
React.useImperativeHandle(forwardedRef, () => inputRef.current);
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
if (!editing)
|
|
16
|
+
setDraft(current);
|
|
17
|
+
}, [current, editing]);
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
if (disabled || readOnly)
|
|
20
|
+
setEditing(false);
|
|
21
|
+
}, [disabled, readOnly]);
|
|
22
|
+
const begin = () => {
|
|
23
|
+
setDraft(current);
|
|
24
|
+
setEditing(true);
|
|
25
|
+
requestAnimationFrame(() => inputRef.current?.focus());
|
|
26
|
+
};
|
|
27
|
+
const save = () => {
|
|
28
|
+
if (!inputRef.current?.reportValidity())
|
|
29
|
+
return;
|
|
30
|
+
if (value === undefined)
|
|
31
|
+
setInternal(draft);
|
|
32
|
+
onValueChange?.(draft);
|
|
33
|
+
setEditing(false);
|
|
34
|
+
inputRef.current?.focus();
|
|
35
|
+
};
|
|
36
|
+
const cancel = () => {
|
|
37
|
+
setDraft(current);
|
|
38
|
+
setEditing(false);
|
|
39
|
+
onCancel?.();
|
|
40
|
+
inputRef.current?.focus();
|
|
41
|
+
};
|
|
42
|
+
return (_jsxs("div", { className: cn('flex h-9 w-full items-center gap-2 rounded-full py-1.5 pe-1.5 ps-2.5 text-text-sub-600 hover:bg-bg-weak-50', editing &&
|
|
43
|
+
'bg-bg-white-0 shadow-button-important-focus ring-1 ring-stroke-strong-950 hover:bg-bg-white-0', hasError && 'bg-bg-white-0 shadow-regular-xs ring-1 ring-error-base', disabled && 'pointer-events-none text-text-disabled-300', className), children: [leading && (_jsx("span", { "aria-hidden": 'true', className: 'flex size-5 shrink-0 items-center justify-center', children: leading })), _jsx("input", { ...props, ref: inputRef, value: editing ? draft : current, disabled: disabled, readOnly: !editing || readOnly, "aria-invalid": hasError || props['aria-invalid'], className: 'min-w-0 flex-1 bg-transparent text-paragraph-sm text-text-strong-950 outline-none placeholder:text-text-soft-400 disabled:text-text-disabled-300', onChange: (event) => setDraft(event.target.value), onKeyDown: (event) => {
|
|
44
|
+
onKeyDown?.(event);
|
|
45
|
+
if (event.defaultPrevented ||
|
|
46
|
+
event.nativeEvent.isComposing ||
|
|
47
|
+
!editing)
|
|
48
|
+
return;
|
|
49
|
+
if (event.key === 'Enter') {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
save();
|
|
52
|
+
}
|
|
53
|
+
if (event.key === 'Escape') {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
cancel();
|
|
56
|
+
}
|
|
57
|
+
} }), !readOnly &&
|
|
58
|
+
(editing ? (_jsxs(_Fragment, { children: [_jsx(CompactButton.Root, { type: 'button', variant: 'ghost', fullRadius: false, "aria-label": cancelLabel, onClick: cancel, children: _jsx(FormAsset, { file: 'baff4.svg' }) }), _jsx(CompactButton.Root, { type: 'button', variant: 'ghost', fullRadius: false, "aria-label": saveLabel, onClick: save, children: _jsx(FormAsset, { file: '537d2.svg' }) })] })) : (_jsx(CompactButton.Root, { type: 'button', variant: 'ghost', fullRadius: false, disabled: disabled, "aria-label": editLabel, onClick: begin, children: _jsx(FormAsset, { file: '09fe0.svg' }) })))] }));
|
|
59
|
+
});
|
|
60
|
+
export { Root };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "../../utils/tv.js";
|
|
3
|
+
import type { PolymorphicComponentProps } from "../../utils/polymorphic.js";
|
|
4
|
+
export declare const inputVariants: import("../../vendor/tailwind-variants/index.js").TVReturnType<{
|
|
5
|
+
size: {
|
|
6
|
+
medium: {
|
|
7
|
+
wrapper: string;
|
|
8
|
+
input: string;
|
|
9
|
+
affix: string;
|
|
10
|
+
};
|
|
11
|
+
small: {
|
|
12
|
+
wrapper: string;
|
|
13
|
+
input: string;
|
|
14
|
+
affix: string;
|
|
15
|
+
};
|
|
16
|
+
xsmall: {
|
|
17
|
+
wrapper: string;
|
|
18
|
+
input: string;
|
|
19
|
+
affix: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
hasError: {
|
|
23
|
+
true: {
|
|
24
|
+
root: string;
|
|
25
|
+
};
|
|
26
|
+
false: {
|
|
27
|
+
root: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}, {
|
|
31
|
+
root: string;
|
|
32
|
+
wrapper: string;
|
|
33
|
+
input: string;
|
|
34
|
+
icon: string;
|
|
35
|
+
affix: string;
|
|
36
|
+
inlineAffix: string;
|
|
37
|
+
}, undefined, {
|
|
38
|
+
responsiveVariants?: boolean | ("xl" | "lg" | "md" | "sm" | "2xl")[] | {
|
|
39
|
+
size?: boolean | ("xl" | "lg" | "md" | "sm" | "2xl")[] | undefined;
|
|
40
|
+
hasError?: boolean | ("xl" | "lg" | "md" | "sm" | "2xl")[] | undefined;
|
|
41
|
+
} | undefined;
|
|
42
|
+
} & import("../../vendor/tailwind-variants/config.js").TWMConfig & {
|
|
43
|
+
twMergeConfig: {
|
|
44
|
+
extend: {
|
|
45
|
+
classGroups: {
|
|
46
|
+
'font-size': {
|
|
47
|
+
text: string[];
|
|
48
|
+
}[];
|
|
49
|
+
shadow: {
|
|
50
|
+
shadow: string[];
|
|
51
|
+
}[];
|
|
52
|
+
rounded: {
|
|
53
|
+
rounded: string[];
|
|
54
|
+
}[];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}, {
|
|
59
|
+
size: {
|
|
60
|
+
medium: {
|
|
61
|
+
wrapper: string;
|
|
62
|
+
input: string;
|
|
63
|
+
affix: string;
|
|
64
|
+
};
|
|
65
|
+
small: {
|
|
66
|
+
wrapper: string;
|
|
67
|
+
input: string;
|
|
68
|
+
affix: string;
|
|
69
|
+
};
|
|
70
|
+
xsmall: {
|
|
71
|
+
wrapper: string;
|
|
72
|
+
input: string;
|
|
73
|
+
affix: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
hasError: {
|
|
77
|
+
true: {
|
|
78
|
+
root: string;
|
|
79
|
+
};
|
|
80
|
+
false: {
|
|
81
|
+
root: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}, {
|
|
85
|
+
root: string;
|
|
86
|
+
wrapper: string;
|
|
87
|
+
input: string;
|
|
88
|
+
icon: string;
|
|
89
|
+
affix: string;
|
|
90
|
+
inlineAffix: string;
|
|
91
|
+
}, import("../../vendor/tailwind-variants/index.js").TVReturnType<{
|
|
92
|
+
size: {
|
|
93
|
+
medium: {
|
|
94
|
+
wrapper: string;
|
|
95
|
+
input: string;
|
|
96
|
+
affix: string;
|
|
97
|
+
};
|
|
98
|
+
small: {
|
|
99
|
+
wrapper: string;
|
|
100
|
+
input: string;
|
|
101
|
+
affix: string;
|
|
102
|
+
};
|
|
103
|
+
xsmall: {
|
|
104
|
+
wrapper: string;
|
|
105
|
+
input: string;
|
|
106
|
+
affix: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
hasError: {
|
|
110
|
+
true: {
|
|
111
|
+
root: string;
|
|
112
|
+
};
|
|
113
|
+
false: {
|
|
114
|
+
root: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
}, {
|
|
118
|
+
root: string;
|
|
119
|
+
wrapper: string;
|
|
120
|
+
input: string;
|
|
121
|
+
icon: string;
|
|
122
|
+
affix: string;
|
|
123
|
+
inlineAffix: string;
|
|
124
|
+
}, undefined, import("../../vendor/tailwind-variants/config.js").TVConfig<{
|
|
125
|
+
size: {
|
|
126
|
+
medium: {
|
|
127
|
+
wrapper: string;
|
|
128
|
+
input: string;
|
|
129
|
+
affix: string;
|
|
130
|
+
};
|
|
131
|
+
small: {
|
|
132
|
+
wrapper: string;
|
|
133
|
+
input: string;
|
|
134
|
+
affix: string;
|
|
135
|
+
};
|
|
136
|
+
xsmall: {
|
|
137
|
+
wrapper: string;
|
|
138
|
+
input: string;
|
|
139
|
+
affix: string;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
hasError: {
|
|
143
|
+
true: {
|
|
144
|
+
root: string;
|
|
145
|
+
};
|
|
146
|
+
false: {
|
|
147
|
+
root: string;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
}, {
|
|
151
|
+
size: {
|
|
152
|
+
medium: {
|
|
153
|
+
wrapper: string;
|
|
154
|
+
input: string;
|
|
155
|
+
affix: string;
|
|
156
|
+
};
|
|
157
|
+
small: {
|
|
158
|
+
wrapper: string;
|
|
159
|
+
input: string;
|
|
160
|
+
affix: string;
|
|
161
|
+
};
|
|
162
|
+
xsmall: {
|
|
163
|
+
wrapper: string;
|
|
164
|
+
input: string;
|
|
165
|
+
affix: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
hasError: {
|
|
169
|
+
true: {
|
|
170
|
+
root: string;
|
|
171
|
+
};
|
|
172
|
+
false: {
|
|
173
|
+
root: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
}>, unknown, unknown, undefined>>;
|
|
177
|
+
type FieldStyle = VariantProps<typeof inputVariants>;
|
|
178
|
+
declare function Root({ size, hasError, asChild, className, children, ...props }: React.HTMLAttributes<HTMLDivElement> & FieldStyle & {
|
|
179
|
+
asChild?: boolean;
|
|
180
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
181
|
+
declare namespace Root {
|
|
182
|
+
var displayName: string;
|
|
183
|
+
}
|
|
184
|
+
declare function Wrapper({ size, hasError, asChild, className, ...props }: React.LabelHTMLAttributes<HTMLLabelElement> & FieldStyle & {
|
|
185
|
+
asChild?: boolean;
|
|
186
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
187
|
+
declare namespace Wrapper {
|
|
188
|
+
var displayName: string;
|
|
189
|
+
}
|
|
190
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & FieldStyle & {
|
|
191
|
+
asChild?: boolean;
|
|
192
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
193
|
+
declare function Icon<T extends React.ElementType = 'div'>({ as, size, hasError, className, ...props }: PolymorphicComponentProps<T, FieldStyle>): import("react/jsx-runtime").JSX.Element;
|
|
194
|
+
declare namespace Icon {
|
|
195
|
+
var displayName: string;
|
|
196
|
+
}
|
|
197
|
+
declare function Affix({ size, hasError, className, ...props }: React.HTMLAttributes<HTMLDivElement> & FieldStyle): import("react/jsx-runtime").JSX.Element;
|
|
198
|
+
declare namespace Affix {
|
|
199
|
+
var displayName: string;
|
|
200
|
+
}
|
|
201
|
+
declare function InlineAffix({ size, hasError, className, ...props }: React.HTMLAttributes<HTMLSpanElement> & FieldStyle): import("react/jsx-runtime").JSX.Element;
|
|
202
|
+
declare namespace InlineAffix {
|
|
203
|
+
var displayName: string;
|
|
204
|
+
}
|
|
205
|
+
export { Root, Wrapper, Input, Icon, Affix, InlineAffix };
|
|
@@ -0,0 +1,69 @@
|
|
|
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 { tv } from "../../utils/tv.js";
|
|
6
|
+
// Field parts inherit their presentation through context, including across custom wrappers.
|
|
7
|
+
export const inputVariants = tv({
|
|
8
|
+
slots: {
|
|
9
|
+
root: 'group relative flex w-full divide-x divide-stroke-soft-200 overflow-hidden rounded-full bg-bg-white-0 text-text-strong-950 shadow-regular-xs transition-all duration-200 before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:ring-1 before:ring-inset before:ring-stroke-soft-200 hover:shadow-none has-[input:disabled]:shadow-none has-[input:focus]:shadow-button-important-focus has-[input:disabled]:before:ring-transparent has-[input:focus]:before:ring-stroke-strong-950',
|
|
10
|
+
wrapper: 'group/input-wrapper flex w-full cursor-text items-center bg-bg-white-0 transition-colors duration-200 has-[input:disabled]:pointer-events-none has-[input:disabled]:bg-bg-weak-50 hover:[&:not(:has(input:focus))]:bg-bg-weak-50',
|
|
11
|
+
input: 'w-full bg-transparent bg-none text-paragraph-sm text-text-strong-950 outline-none placeholder:select-none placeholder:text-text-soft-400 placeholder:transition-colors focus:placeholder:text-text-sub-600 disabled:text-text-disabled-300 disabled:placeholder:text-text-disabled-300 group-hover/input-wrapper:placeholder:text-text-sub-600',
|
|
12
|
+
icon: 'flex size-5 shrink-0 select-none items-center justify-center text-text-sub-600 transition-colors group-hover/input-wrapper:text-text-sub-600 group-has-[:placeholder-shown]:text-text-soft-400 group-has-[input:disabled]:text-text-disabled-300 group-has-[input:focus]:text-text-sub-600',
|
|
13
|
+
affix: 'flex shrink-0 items-center justify-center truncate bg-bg-white-0 text-paragraph-sm text-text-sub-600 group-has-[:placeholder-shown]:text-text-soft-400 group-has-[input:focus]:text-text-sub-600',
|
|
14
|
+
inlineAffix: 'text-paragraph-sm text-text-sub-600 group-has-[:placeholder-shown]:text-text-soft-400 group-has-[input:focus]:text-text-sub-600',
|
|
15
|
+
},
|
|
16
|
+
variants: {
|
|
17
|
+
size: {
|
|
18
|
+
medium: { wrapper: 'gap-2 px-3', input: 'h-10', affix: 'px-3' },
|
|
19
|
+
small: { wrapper: 'gap-2 px-2.5', input: 'h-9', affix: 'px-2.5' },
|
|
20
|
+
xsmall: { wrapper: 'gap-1.5 px-2', input: 'h-8', affix: 'px-2.5' },
|
|
21
|
+
},
|
|
22
|
+
hasError: {
|
|
23
|
+
true: {
|
|
24
|
+
root: 'before:ring-error-base hover:before:ring-error-base has-[input:focus]:shadow-button-error-focus has-[input:focus]:before:ring-error-base',
|
|
25
|
+
},
|
|
26
|
+
false: {
|
|
27
|
+
root: 'hover:[&:not(:has(input:focus)):has(>:only-child)]:before:ring-transparent',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: { size: 'medium' },
|
|
32
|
+
});
|
|
33
|
+
const FieldContext = React.createContext({});
|
|
34
|
+
function useFieldStyle(options) {
|
|
35
|
+
const parent = React.useContext(FieldContext);
|
|
36
|
+
return inputVariants({
|
|
37
|
+
size: options.size ?? parent.size,
|
|
38
|
+
hasError: options.hasError ?? parent.hasError,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function Root({ size, hasError, asChild, className, children, ...props }) {
|
|
42
|
+
const Tag = asChild ? Slot : 'div';
|
|
43
|
+
return (_jsx(FieldContext.Provider, { value: { size, hasError }, children: _jsx(Tag, { ...props, className: inputVariants({ size, hasError }).root({ className }), children: children }) }));
|
|
44
|
+
}
|
|
45
|
+
function Wrapper({ size, hasError, asChild, className, ...props }) {
|
|
46
|
+
const Tag = asChild ? Slot : 'label';
|
|
47
|
+
return (_jsx(Tag, { ...props, className: useFieldStyle({ size, hasError }).wrapper({ className }) }));
|
|
48
|
+
}
|
|
49
|
+
const Input = React.forwardRef(function Input({ size, hasError, asChild, className, type = 'text', ...props }, ref) {
|
|
50
|
+
const Tag = asChild ? Slot : 'input';
|
|
51
|
+
return (_jsx(Tag, { ...props, type: type, ref: ref, className: useFieldStyle({ size, hasError }).input({ className }) }));
|
|
52
|
+
});
|
|
53
|
+
function Icon({ as, size, hasError, className, ...props }) {
|
|
54
|
+
const Tag = as || 'div';
|
|
55
|
+
return (_jsx(Tag, { ...props, className: useFieldStyle({ size, hasError }).icon({ className }) }));
|
|
56
|
+
}
|
|
57
|
+
function Affix({ size, hasError, className, ...props }) {
|
|
58
|
+
return (_jsx("div", { ...props, className: useFieldStyle({ size, hasError }).affix({ className }) }));
|
|
59
|
+
}
|
|
60
|
+
function InlineAffix({ size, hasError, className, ...props }) {
|
|
61
|
+
return (_jsx("span", { ...props, className: useFieldStyle({ size, hasError }).inlineAffix({ className }) }));
|
|
62
|
+
}
|
|
63
|
+
Root.displayName = 'InputRoot';
|
|
64
|
+
Wrapper.displayName = 'InputWrapper';
|
|
65
|
+
Input.displayName = 'InputEl';
|
|
66
|
+
Icon.displayName = 'InputIcon';
|
|
67
|
+
Affix.displayName = 'InputAffixButton';
|
|
68
|
+
InlineAffix.displayName = 'InputInlineAffixButton';
|
|
69
|
+
export { Root, Wrapper, Input, Icon, Affix, InlineAffix };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
export function Root({ className, children, ...props }) {
|
|
4
|
+
return (_jsx("kbd", { ...props, className: cn('flex h-5 items-center gap-0.5 whitespace-nowrap rounded bg-bg-white-0 px-1.5 text-subheading-xs text-text-soft-400 ring-1 ring-inset ring-stroke-soft-200 [font-family:inherit]', className), children: children }));
|
|
5
|
+
}
|
|
6
|
+
Root.displayName = 'KbdRoot';
|