@krizaka/ui 3.55.0 → 3.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{RotatingWord-D9s7FXFD.d.ts → RotatingWord-COSabR2c.d.ts} +2 -1
- package/dist/account-menu.d.ts +2 -1
- package/dist/account-settings.d.ts +153 -61
- package/dist/account-settings.js +240 -97
- package/dist/account-settings.js.map +1 -1
- package/dist/achievement.d.ts +2 -1
- package/dist/action-bar.d.ts +3 -2
- package/dist/activity-feed.d.ts +2 -1
- package/dist/agenda.d.ts +2 -1
- package/dist/alert.d.ts +2 -1
- package/dist/anatomy-plate.d.ts +2 -1
- package/dist/app-header/search.d.ts +8 -7
- package/dist/app-header.d.ts +2 -1
- package/dist/app-shell.d.ts +26 -25
- package/dist/argument-card.d.ts +3 -2
- package/dist/audio-player.d.ts +2 -1
- package/dist/auth-layout.d.ts +11 -10
- package/dist/avatar/defaults.d.ts +2 -1
- package/dist/avatar.d.ts +2 -1
- package/dist/badge.d.ts +2 -1
- package/dist/bird-plate.d.ts +4 -2
- package/dist/blocks.css +183 -4
- package/dist/button.d.ts +2 -1
- package/dist/captcha.d.ts +2 -1
- package/dist/captcha.js +1 -0
- package/dist/captcha.js.map +1 -1
- package/dist/card-grid.d.ts +2 -1
- package/dist/card.d.ts +2 -1
- package/dist/catalogue-page.d.ts +82 -2
- package/dist/catalogue-page.js +156 -13
- package/dist/catalogue-page.js.map +1 -1
- package/dist/changelog-page.d.ts +2 -1
- package/dist/chapter.d.ts +2 -1
- package/dist/chat.d.ts +14 -13
- package/dist/checkbox.d.ts +2 -1
- package/dist/chip-link.d.ts +2 -1
- package/dist/chip-row.d.ts +8 -7
- package/dist/chip.d.ts +55 -1
- package/dist/chip.js +10 -1
- package/dist/choice-grid.d.ts +3 -2
- package/dist/chunk-27AWSJTK.js +46 -0
- package/dist/chunk-27AWSJTK.js.map +1 -0
- package/dist/chunk-44FU32KP.js +2 -0
- package/dist/chunk-44FU32KP.js.map +1 -0
- package/dist/{chunk-AEP3K4YD.js → chunk-4GQH27IT.js} +2 -2
- package/dist/{chunk-QWKCNSPF.js → chunk-5LANVCK7.js} +125 -73
- package/dist/chunk-5LANVCK7.js.map +1 -0
- package/dist/{chunk-KDXRYUD3.js → chunk-5QEXOGO2.js} +3 -1
- package/dist/{chunk-KDXRYUD3.js.map → chunk-5QEXOGO2.js.map} +1 -1
- package/dist/chunk-7J2L4HOD.js +340 -0
- package/dist/chunk-7J2L4HOD.js.map +1 -0
- package/dist/{chunk-7U5TXA5Q.js → chunk-BQ4EOR2O.js} +74 -2
- package/dist/chunk-BQ4EOR2O.js.map +1 -0
- package/dist/chunk-F6JTHPHE.js +399 -0
- package/dist/chunk-F6JTHPHE.js.map +1 -0
- package/dist/chunk-OGWB76BR.js +90 -0
- package/dist/chunk-OGWB76BR.js.map +1 -0
- package/dist/{chunk-VIPSZXO4.js → chunk-UYGUSYIC.js} +72 -2
- package/dist/chunk-UYGUSYIC.js.map +1 -0
- package/dist/chunk-WOZP3JLW.js +51 -0
- package/dist/chunk-WOZP3JLW.js.map +1 -0
- package/dist/chunk-XVXFMVG3.js +27 -0
- package/dist/chunk-XVXFMVG3.js.map +1 -0
- package/dist/code-block.d.ts +2 -1
- package/dist/combobox.d.ts +20 -19
- package/dist/combobox.js +3 -2
- package/dist/command.d.ts +21 -20
- package/dist/comparison-table.d.ts +2 -1
- package/dist/component-page.d.ts +2 -1
- package/dist/confirm-button.d.ts +2 -1
- package/dist/contact-page.d.ts +2 -1
- package/dist/continue-prompt.d.ts +2 -1
- package/dist/countdown.d.ts +2 -1
- package/dist/cover-hero.d.ts +20 -19
- package/dist/cover-hero.js +25 -42
- package/dist/cover-hero.js.map +1 -1
- package/dist/cta-panel.d.ts +2 -1
- package/dist/dashboard-layout.d.ts +50 -2
- package/dist/dashboard-layout.js +66 -11
- package/dist/dashboard-layout.js.map +1 -1
- package/dist/data-table.d.ts +45 -2
- package/dist/data-table.js +7 -3
- package/dist/date-picker.d.ts +29 -28
- package/dist/decision-list.d.ts +2 -1
- package/dist/description-list.d.ts +2 -1
- package/dist/detail-layout.d.ts +153 -20
- package/dist/detail-layout.js +73 -4
- package/dist/detail-layout.js.map +1 -1
- package/dist/{dialog-D42QwYb_.d.ts → dialog-DpUwec2g.d.ts} +2 -1
- package/dist/dialog.d.ts +3 -2
- package/dist/docs-article-page.d.ts +2 -1
- package/dist/docs-hub-page.d.ts +2 -1
- package/dist/docs-layout.d.ts +2 -1
- package/dist/docs-nav.d.ts +3 -10
- package/dist/document-viewer.d.ts +5 -4
- package/dist/doodle.d.ts +17 -6
- package/dist/doodle.js +40 -9
- package/dist/doodle.js.map +1 -1
- package/dist/drop-overlay.d.ts +2 -1
- package/dist/dropdown-menu.d.ts +2 -1
- package/dist/dropdown-menu.js +13 -74
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/elephant.d.ts +2 -1
- package/dist/empty-state.d.ts +2 -1
- package/dist/engine-flow.d.ts +2 -1
- package/dist/error-page.d.ts +2 -1
- package/dist/file-upload.d.ts +16 -15
- package/dist/filter-bar.d.ts +84 -11
- package/dist/filter-bar.js +6 -2
- package/dist/flock.d.ts +3 -2
- package/dist/footnote.d.ts +2 -1
- package/dist/force-update-screen.d.ts +8 -7
- package/dist/form/server.d.ts +2 -1
- package/dist/form.d.ts +2 -1
- package/dist/gallery-page.d.ts +2 -1
- package/dist/genui.d.ts +2 -1
- package/dist/genui.js +3 -3
- package/dist/{geometry-DX-W-Yyf.d.ts → geometry-DZ4Q3hDQ.d.ts} +2 -1
- package/dist/glossary-term.d.ts +2 -1
- package/dist/glossary.d.ts +2 -1
- package/dist/glow-card.d.ts +2 -1
- package/dist/goal-gauge.d.ts +2 -1
- package/dist/grade-stamp.d.ts +23 -0
- package/dist/grade-stamp.js +42 -0
- package/dist/grade-stamp.js.map +1 -0
- package/dist/how-it-works-page.d.ts +2 -1
- package/dist/image-cropper.d.ts +5 -4
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -4
- package/dist/iso.d.ts +2 -1
- package/dist/kanban.d.ts +2 -1
- package/dist/kbd.d.ts +2 -1
- package/dist/kind-config-editor.d.ts +152 -0
- package/dist/kind-config-editor.js +574 -0
- package/dist/kind-config-editor.js.map +1 -0
- package/dist/kpi-explained.d.ts +2 -1
- package/dist/landing-page.d.ts +2 -1
- package/dist/landscape.d.ts +2 -1
- package/dist/language-switch/server.d.ts +2 -1
- package/dist/language-switch.d.ts +11 -10
- package/dist/legal-page.d.ts +2 -1
- package/dist/link-card.d.ts +2 -1
- package/dist/list.d.ts +2 -1
- package/dist/loader.d.ts +2 -1
- package/dist/longform-page.d.ts +2 -1
- package/dist/maintenance-screen.d.ts +5 -4
- package/dist/map.d.ts +14 -13
- package/dist/map.js +24 -0
- package/dist/map.js.map +1 -1
- package/dist/markdown.d.ts +2 -1
- package/dist/marketing-layout.d.ts +5 -4
- package/dist/marquee.d.ts +2 -1
- package/dist/mascot-quote.d.ts +2 -1
- package/dist/mascot-state.d.ts +3 -2
- package/dist/mascots.d.ts +4 -3
- package/dist/match-dialog.d.ts +2 -1
- package/dist/media-capture.d.ts +5 -4
- package/dist/media-gallery.d.ts +2 -1
- package/dist/media-grid.d.ts +3 -10
- package/dist/meta-row.d.ts +2 -1
- package/dist/meter.d.ts +2 -1
- package/dist/motion.d.ts +3 -2
- package/dist/native/form.d.ts +2 -1
- package/dist/native/list.d.ts +2 -1
- package/dist/native/map.d.ts +2 -1
- package/dist/native/map.js +24 -0
- package/dist/native/map.js.map +1 -1
- package/dist/native/markdown.d.ts +2 -1
- package/dist/native/media-capture.d.ts +2 -1
- package/dist/native/media-picker.d.ts +2 -1
- package/dist/native/vertical-video.d.ts +2 -1
- package/dist/native/video-player.d.ts +2 -1
- package/dist/native.d.ts +230 -1
- package/dist/native.js +1465 -965
- package/dist/native.js.map +1 -1
- package/dist/nav-bar/me.d.ts +2 -1
- package/dist/nav-bar.d.ts +2 -1
- package/dist/next-actions.d.ts +2 -1
- package/dist/notification-preferences.d.ts +23 -22
- package/dist/notification-preferences.js +4 -3
- package/dist/notification-preferences.js.map +1 -1
- package/dist/number-ticker.d.ts +2 -1
- package/dist/opening-hours.d.ts +2 -1
- package/dist/page-header.d.ts +2 -1
- package/dist/page-hero.d.ts +2 -1
- package/dist/page-index.d.ts +2 -1
- package/dist/page.d.ts +2 -1
- package/dist/pagination.d.ts +2 -1
- package/dist/photo-grid.d.ts +2 -1
- package/dist/pointer-light.d.ts +2 -1
- package/dist/popover.d.ts +2 -1
- package/dist/pricing-page.d.ts +2 -1
- package/dist/product-page.d.ts +2 -1
- package/dist/profile-card.d.ts +2 -1
- package/dist/progress.d.ts +2 -1
- package/dist/promise-card.d.ts +2 -1
- package/dist/quota-meter.d.ts +2 -1
- package/dist/radio-group.d.ts +2 -1
- package/dist/radio-group.js +3 -3
- package/dist/rail-nav.d.ts +17 -16
- package/dist/rail-nav.js +22 -56
- package/dist/rail-nav.js.map +1 -1
- package/dist/recipes.d.ts +2 -1
- package/dist/retro-tv.d.ts +2 -1
- package/dist/router.d.ts +2 -1
- package/dist/scroll-stage.d.ts +2 -1
- package/dist/search-field.d.ts +2 -1
- package/dist/section-backdrop.d.ts +2 -1
- package/dist/separator.d.ts +2 -1
- package/dist/service-card.d.ts +9 -8
- package/dist/settings-layout.d.ts +2 -1
- package/dist/settings-layout.js +10 -324
- package/dist/settings-layout.js.map +1 -1
- package/dist/showcase.d.ts +2 -1
- package/dist/signature.d.ts +2 -1
- package/dist/site-cahier.d.ts +187 -0
- package/dist/site-cahier.js +844 -0
- package/dist/site-cahier.js.map +1 -0
- package/dist/site-footer.d.ts +2 -1
- package/dist/sites.d.ts +2 -1
- package/dist/skeleton.d.ts +2 -1
- package/dist/skip-link.d.ts +2 -1
- package/dist/slider.d.ts +2 -1
- package/dist/slot-picker.d.ts +86 -13
- package/dist/slot-picker.js +98 -16
- package/dist/slot-picker.js.map +1 -1
- package/dist/specimen-tag.d.ts +2 -1
- package/dist/speed-lines.d.ts +19 -0
- package/dist/speed-lines.js +45 -0
- package/dist/speed-lines.js.map +1 -0
- package/dist/spinner.d.ts +2 -1
- package/dist/split-view.d.ts +2 -1
- package/dist/stage-banner.d.ts +2 -1
- package/dist/stat.d.ts +2 -1
- package/dist/status-chip.d.ts +44 -0
- package/dist/status-chip.js +137 -0
- package/dist/status-chip.js.map +1 -0
- package/dist/status-page.d.ts +2 -1
- package/dist/step-progress.d.ts +2 -1
- package/dist/step-showcase.d.ts +2 -1
- package/dist/stepper.d.ts +2 -1
- package/dist/sticky-action.d.ts +28 -5
- package/dist/sticky-action.js +10 -4
- package/dist/sticky-action.js.map +1 -1
- package/dist/stuck.d.ts +2 -1
- package/dist/swipe-deck.d.ts +2 -1
- package/dist/switch.d.ts +2 -1
- package/dist/tabs.d.ts +2 -1
- package/dist/tag-input.d.ts +2 -1
- package/dist/tag-input.js +3 -2
- package/dist/tag-input.js.map +1 -1
- package/dist/tag-selector.d.ts +30 -4
- package/dist/tag-selector.js +90 -8
- package/dist/tag-selector.js.map +1 -1
- package/dist/taped-photo.d.ts +2 -1
- package/dist/taped-photo.js +4 -20
- package/dist/taped-photo.js.map +1 -1
- package/dist/terminal-replay.d.ts +2 -1
- package/dist/terminal-replay.js +1 -1
- package/dist/text-style/server.d.ts +2 -1
- package/dist/text-style.d.ts +2 -1
- package/dist/theme.d.ts +21 -1
- package/dist/theme.js +37 -1
- package/dist/theme.js.map +1 -1
- package/dist/toast.d.ts +2 -1
- package/dist/toc.d.ts +2 -1
- package/dist/tooltip.d.ts +2 -1
- package/dist/tree-view.d.ts +2 -1
- package/dist/update-prompt.d.ts +11 -10
- package/dist/upload-queue.d.ts +2 -1
- package/dist/verified-badge.d.ts +2 -1
- package/dist/versus-card.d.ts +40 -0
- package/dist/versus-card.js +40 -0
- package/dist/versus-card.js.map +1 -0
- package/dist/vertical-video.d.ts +2 -1
- package/dist/video-player.d.ts +20 -19
- package/dist/video-trimmer.d.ts +2 -1
- package/dist/virtual.d.ts +8 -7
- package/dist/wall.d.ts +79 -0
- package/dist/wall.js +127 -0
- package/dist/wall.js.map +1 -0
- package/dist/waveform.d.ts +2 -1
- package/package.json +140 -41
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +257 -5
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-header.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +116 -6
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +386 -11
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +91 -5
- package/registry/data-table.json +156 -5
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/detail-layout.json +199 -5
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +115 -22
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/account-settings/appearance.d.ts +4 -0
- package/registry/examples/account-settings/appearance.js +40 -0
- package/registry/examples/account-settings/appearance.tsx +30 -0
- package/registry/examples/catalogue-page/clients.d.ts +4 -0
- package/registry/examples/catalogue-page/clients.js +49 -0
- package/registry/examples/catalogue-page/clients.tsx +61 -0
- package/registry/examples/chip/marker-picker.d.ts +4 -0
- package/registry/examples/chip/marker-picker.js +17 -0
- package/registry/examples/chip/marker-picker.tsx +17 -0
- package/registry/examples/chip/native/marker-picker.d.ts +4 -0
- package/registry/examples/chip/native/marker-picker.dark.png +0 -0
- package/registry/examples/chip/native/marker-picker.js +18 -0
- package/registry/examples/chip/native/marker-picker.light.png +0 -0
- package/registry/examples/chip/native/marker-picker.tsx +16 -0
- package/registry/examples/chip/native/tags.d.ts +4 -0
- package/registry/examples/chip/native/tags.dark.png +0 -0
- package/registry/examples/chip/native/tags.js +22 -0
- package/registry/examples/chip/native/tags.light.png +0 -0
- package/registry/examples/chip/native/tags.tsx +20 -0
- package/registry/examples/chip/tags.d.ts +4 -0
- package/registry/examples/chip/tags.js +26 -0
- package/registry/examples/chip/tags.tsx +23 -0
- package/registry/examples/dashboard-layout/today.d.ts +4 -0
- package/registry/examples/dashboard-layout/today.js +54 -0
- package/registry/examples/dashboard-layout/today.tsx +63 -0
- package/registry/examples/data-table/bulk.d.ts +4 -0
- package/registry/examples/data-table/bulk.js +45 -0
- package/registry/examples/data-table/bulk.tsx +34 -0
- package/registry/examples/detail-layout/client.d.ts +4 -0
- package/registry/examples/detail-layout/client.js +40 -0
- package/registry/examples/detail-layout/client.tsx +39 -0
- package/registry/examples/detail-layout/new-invoice.d.ts +4 -0
- package/registry/examples/detail-layout/new-invoice.js +44 -0
- package/registry/examples/detail-layout/new-invoice.tsx +34 -0
- package/registry/examples/doodle/bird-sketch.d.ts +4 -0
- package/registry/examples/doodle/bird-sketch.js +11 -0
- package/registry/examples/doodle/bird-sketch.tsx +12 -0
- package/registry/examples/doodle/margin-marks.d.ts +4 -0
- package/registry/examples/doodle/margin-marks.js +27 -0
- package/registry/examples/doodle/margin-marks.tsx +19 -0
- package/registry/examples/filter-bar/views.d.ts +4 -0
- package/registry/examples/filter-bar/views.js +39 -0
- package/registry/examples/filter-bar/views.tsx +30 -0
- package/registry/examples/grade-stamp/coverage.d.ts +4 -0
- package/registry/examples/grade-stamp/coverage.js +12 -0
- package/registry/examples/grade-stamp/coverage.tsx +8 -0
- package/registry/examples/grade-stamp/lighthouse.d.ts +4 -0
- package/registry/examples/grade-stamp/lighthouse.js +12 -0
- package/registry/examples/grade-stamp/lighthouse.tsx +14 -0
- package/registry/examples/kind-config-editor/derived.d.ts +4 -0
- package/registry/examples/kind-config-editor/derived.js +26 -0
- package/registry/examples/kind-config-editor/derived.tsx +16 -0
- package/registry/examples/kind-config-editor/native/status-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/native/status-set.dark.png +0 -0
- package/registry/examples/kind-config-editor/native/status-set.js +22 -0
- package/registry/examples/kind-config-editor/native/status-set.light.png +0 -0
- package/registry/examples/kind-config-editor/native/status-set.tsx +19 -0
- package/registry/examples/kind-config-editor/native/tag-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/native/tag-set.dark.png +0 -0
- package/registry/examples/kind-config-editor/native/tag-set.js +20 -0
- package/registry/examples/kind-config-editor/native/tag-set.light.png +0 -0
- package/registry/examples/kind-config-editor/native/tag-set.tsx +18 -0
- package/registry/examples/kind-config-editor/status-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/status-set.js +29 -0
- package/registry/examples/kind-config-editor/status-set.tsx +25 -0
- package/registry/examples/kind-config-editor/tag-set.d.ts +4 -0
- package/registry/examples/kind-config-editor/tag-set.js +20 -0
- package/registry/examples/kind-config-editor/tag-set.tsx +18 -0
- package/registry/examples/site-cahier/java-releases.d.ts +4 -0
- package/registry/examples/site-cahier/java-releases.js +33 -0
- package/registry/examples/site-cahier/java-releases.tsx +32 -0
- package/registry/examples/site-cahier/motion-lab.d.ts +4 -0
- package/registry/examples/site-cahier/motion-lab.js +32 -0
- package/registry/examples/site-cahier/motion-lab.tsx +29 -0
- package/registry/examples/site-cahier/ts-changelog.d.ts +4 -0
- package/registry/examples/site-cahier/ts-changelog.js +24 -0
- package/registry/examples/site-cahier/ts-changelog.tsx +20 -0
- package/registry/examples/site-cahier/ts-doc.d.ts +4 -0
- package/registry/examples/site-cahier/ts-doc.js +38 -0
- package/registry/examples/site-cahier/ts-doc.tsx +27 -0
- package/registry/examples/site-cahier/ui-home.d.ts +4 -0
- package/registry/examples/site-cahier/ui-home.js +46 -0
- package/registry/examples/site-cahier/ui-home.tsx +40 -0
- package/registry/examples/slot-picker/weeks.d.ts +4 -0
- package/registry/examples/slot-picker/weeks.js +45 -0
- package/registry/examples/slot-picker/weeks.tsx +28 -0
- package/registry/examples/speed-lines/hero.d.ts +4 -0
- package/registry/examples/speed-lines/hero.js +11 -0
- package/registry/examples/speed-lines/hero.tsx +12 -0
- package/registry/examples/speed-lines/streaks.d.ts +4 -0
- package/registry/examples/speed-lines/streaks.js +11 -0
- package/registry/examples/speed-lines/streaks.tsx +12 -0
- package/registry/examples/status-chip/default.d.ts +4 -0
- package/registry/examples/status-chip/default.js +35 -0
- package/registry/examples/status-chip/default.tsx +32 -0
- package/registry/examples/status-chip/native/default.d.ts +4 -0
- package/registry/examples/status-chip/native/default.dark.png +0 -0
- package/registry/examples/status-chip/native/default.js +26 -0
- package/registry/examples/status-chip/native/default.light.png +0 -0
- package/registry/examples/status-chip/native/default.tsx +20 -0
- package/registry/examples/tag-selector/creatable.d.ts +4 -0
- package/registry/examples/tag-selector/creatable.js +41 -0
- package/registry/examples/tag-selector/creatable.tsx +29 -0
- package/registry/examples/tag-selector/native/tags.d.ts +4 -0
- package/registry/examples/tag-selector/native/tags.dark.png +0 -0
- package/registry/examples/tag-selector/native/tags.js +19 -0
- package/registry/examples/tag-selector/native/tags.light.png +0 -0
- package/registry/examples/tag-selector/native/tags.tsx +19 -0
- package/registry/examples/versus-card/alternatives.d.ts +4 -0
- package/registry/examples/versus-card/alternatives.js +20 -0
- package/registry/examples/versus-card/alternatives.tsx +14 -0
- package/registry/examples/versus-card/releases.d.ts +4 -0
- package/registry/examples/versus-card/releases.js +35 -0
- package/registry/examples/versus-card/releases.tsx +29 -0
- package/registry/examples/wall/brick.d.ts +4 -0
- package/registry/examples/wall/brick.js +14 -0
- package/registry/examples/wall/brick.tsx +8 -0
- package/registry/examples/wall/composition-fr.d.ts +4 -0
- package/registry/examples/wall/composition-fr.js +37 -0
- package/registry/examples/wall/composition-fr.tsx +18 -0
- package/registry/examples/wall/composition.d.ts +4 -0
- package/registry/examples/wall/composition.js +38 -0
- package/registry/examples/wall/composition.tsx +18 -0
- package/registry/examples/wall/pinned-note.d.ts +4 -0
- package/registry/examples/wall/pinned-note.js +15 -0
- package/registry/examples/wall/pinned-note.tsx +9 -0
- package/registry/examples/wall/plaster.d.ts +4 -0
- package/registry/examples/wall/plaster.js +14 -0
- package/registry/examples/wall/plaster.tsx +8 -0
- package/registry/examples/wall/polaroid.d.ts +4 -0
- package/registry/examples/wall/polaroid.js +19 -0
- package/registry/examples/wall/polaroid.tsx +10 -0
- package/registry/examples/wall/ridge.d.ts +4 -0
- package/registry/examples/wall/ridge.js +14 -0
- package/registry/examples/wall/ridge.tsx +8 -0
- package/registry/examples/wall/shop-sign.d.ts +4 -0
- package/registry/examples/wall/shop-sign.js +16 -0
- package/registry/examples/wall/shop-sign.tsx +10 -0
- package/registry/examples/wall/zellige.d.ts +4 -0
- package/registry/examples/wall/zellige.js +14 -0
- package/registry/examples/wall/zellige.tsx +8 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +208 -8
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +227 -0
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +355 -30
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +565 -0
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +2 -2
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +1 -1
- package/registry/router.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +548 -0
- package/registry/site-footer.json +2 -2
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +156 -10
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +174 -0
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +350 -0
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +38 -8
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +189 -12
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/theme.json +3 -3
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +194 -0
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +2 -2
- package/registry/wall.json +511 -0
- package/registry/waveform.json +1 -1
- package/dist/chunk-7U5TXA5Q.js.map +0 -1
- package/dist/chunk-OIMXKRXF.js +0 -179
- package/dist/chunk-OIMXKRXF.js.map +0 -1
- package/dist/chunk-QWKCNSPF.js.map +0 -1
- package/dist/chunk-VIPSZXO4.js.map +0 -1
- /package/dist/{chunk-AEP3K4YD.js.map → chunk-4GQH27IT.js.map} +0 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-S6NYGOJT.js";
|
|
4
|
+
|
|
5
|
+
// src/settings-layout/save-status.ts
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
var SaveStatus = { Idle: "idle", Saving: "saving", Saved: "saved", Error: "error" };
|
|
8
|
+
var SAVED_VISIBLE_MS = 4e3;
|
|
9
|
+
function useSaveStatus() {
|
|
10
|
+
const [status, setStatus] = React.useState(SaveStatus.Idle);
|
|
11
|
+
const [error, setError] = React.useState(void 0);
|
|
12
|
+
const timer = React.useRef(void 0);
|
|
13
|
+
const clear = React.useCallback(() => {
|
|
14
|
+
if (timer.current) clearTimeout(timer.current);
|
|
15
|
+
timer.current = void 0;
|
|
16
|
+
}, []);
|
|
17
|
+
React.useEffect(() => clear, [clear]);
|
|
18
|
+
const reset = React.useCallback(() => {
|
|
19
|
+
clear();
|
|
20
|
+
setStatus(SaveStatus.Idle);
|
|
21
|
+
setError(void 0);
|
|
22
|
+
}, [clear]);
|
|
23
|
+
const track = React.useCallback(
|
|
24
|
+
async (save) => {
|
|
25
|
+
clear();
|
|
26
|
+
setStatus(SaveStatus.Saving);
|
|
27
|
+
setError(void 0);
|
|
28
|
+
try {
|
|
29
|
+
await save();
|
|
30
|
+
setStatus(SaveStatus.Saved);
|
|
31
|
+
timer.current = setTimeout(() => setStatus(SaveStatus.Idle), SAVED_VISIBLE_MS);
|
|
32
|
+
return true;
|
|
33
|
+
} catch (failure) {
|
|
34
|
+
setError(failure);
|
|
35
|
+
setStatus(SaveStatus.Error);
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
[clear]
|
|
40
|
+
);
|
|
41
|
+
return { status, error, track, reset };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/settings-layout/settings-layout.tsx
|
|
45
|
+
import * as React2 from "react";
|
|
46
|
+
import { tv as tv2 } from "tailwind-variants";
|
|
47
|
+
|
|
48
|
+
// src/button/button.tsx
|
|
49
|
+
import { Slot } from "radix-ui";
|
|
50
|
+
import { tv } from "tailwind-variants";
|
|
51
|
+
|
|
52
|
+
// src/spinner/glyph.tsx
|
|
53
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
54
|
+
var HEX = "M12 3 19.79 7.5 19.79 16.5 12 21 4.21 16.5 4.21 7.5Z";
|
|
55
|
+
function LoaderGlyph({ state = "loading", value, ...props }) {
|
|
56
|
+
const known = typeof value === "number" && Number.isFinite(value);
|
|
57
|
+
const fill = state !== "loading" ? 100 : known ? Math.round(Math.min(1, Math.max(0, value)) * 100) : null;
|
|
58
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": true, "data-state": state, "data-progress": fill === null ? void 0 : fill, ...props, children: [
|
|
59
|
+
/* @__PURE__ */ jsx("path", { d: HEX, stroke: "currentColor", strokeOpacity: "0.22", strokeWidth: "2.2", strokeLinejoin: "round" }),
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
"path",
|
|
62
|
+
{
|
|
63
|
+
d: HEX,
|
|
64
|
+
pathLength: 100,
|
|
65
|
+
stroke: "currentColor",
|
|
66
|
+
strokeWidth: "2.2",
|
|
67
|
+
strokeLinejoin: "round",
|
|
68
|
+
strokeLinecap: "round",
|
|
69
|
+
className: "kz-loader-trace",
|
|
70
|
+
strokeDasharray: fill === null ? void 0 : `${fill} ${100 - fill}`
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
state === "loading" && /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "2.6", fill: "currentColor", className: "kz-loader-node" }),
|
|
74
|
+
state === "success" && /* @__PURE__ */ jsx("path", { d: "M8.3 12.3l2.6 2.6 4.9-5.3", pathLength: 20, stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", className: "kz-loader-mark" }),
|
|
75
|
+
state === "error" && /* @__PURE__ */ jsx("path", { d: "M9.4 9.4l5.2 5.2M14.6 9.4l-5.2 5.2", pathLength: 20, stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", className: "kz-loader-mark" })
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/recipes/define.ts
|
|
80
|
+
function defineRecipe(config) {
|
|
81
|
+
return config;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// src/button/recipe.ts
|
|
85
|
+
var buttonRecipe = defineRecipe({
|
|
86
|
+
base: "inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition duration-150 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 disabled:pointer-events-none disabled:opacity-40 data-loading:cursor-progress active:scale-[0.98] [&[data-loading]]:opacity-100",
|
|
87
|
+
variants: {
|
|
88
|
+
variant: {
|
|
89
|
+
primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover",
|
|
90
|
+
// The brand's signature: accent → accent-2 (on-accent reads on both stops, tested in @krizaka/tokens).
|
|
91
|
+
gradient: "bg-linear-to-r from-accent to-accent-2 text-on-accent shadow-sm hover:brightness-110",
|
|
92
|
+
secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3",
|
|
93
|
+
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent",
|
|
94
|
+
ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg",
|
|
95
|
+
// The border and the tint carry the danger; the label stays the primary text role, legible on the tint at rest
|
|
96
|
+
// and hovered over every surface (`text-fg-danger` is for text set directly on a surface).
|
|
97
|
+
danger: "border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20"
|
|
98
|
+
},
|
|
99
|
+
size: { sm: "h-8 px-3 text-xs", md: "h-10 px-4 text-sm", lg: "h-12 px-6 text-sm", icon: "h-10 w-10" },
|
|
100
|
+
// One clean shape (krizaka-ui#393): an 8 px radius (`--kz-radius-sm`, the radius of a field — a button beside an
|
|
101
|
+
// input lines up with it), the pill on demand. `cut` (the retired chamfer) is a deprecated alias of `rounded`.
|
|
102
|
+
shape: { rounded: "rounded-sm", pill: "rounded-full", cut: "rounded-sm" }
|
|
103
|
+
},
|
|
104
|
+
defaultVariants: { variant: "secondary", size: "md", shape: "rounded" }
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// src/button/button.tsx
|
|
108
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
109
|
+
var buttonVariants = tv(buttonRecipe);
|
|
110
|
+
var STATUS_TEXT = { success: "text-fg-success", error: "text-fg-danger" };
|
|
111
|
+
var warnedCut = false;
|
|
112
|
+
function warnCut() {
|
|
113
|
+
if (warnedCut || typeof process === "undefined" || process.env.NODE_ENV === "production") return;
|
|
114
|
+
warnedCut = true;
|
|
115
|
+
console.warn('@krizaka/ui/button: shape="cut" is deprecated (krizaka-ui#393) and now draws the default rounded shape. Remove the prop.');
|
|
116
|
+
}
|
|
117
|
+
function Button({
|
|
118
|
+
asChild,
|
|
119
|
+
loading,
|
|
120
|
+
progress,
|
|
121
|
+
status,
|
|
122
|
+
announce,
|
|
123
|
+
indicator = true,
|
|
124
|
+
shimmer: _shimmer,
|
|
125
|
+
magnetic: _magnetic,
|
|
126
|
+
variant,
|
|
127
|
+
size,
|
|
128
|
+
shape,
|
|
129
|
+
className,
|
|
130
|
+
disabled,
|
|
131
|
+
children,
|
|
132
|
+
...props
|
|
133
|
+
}) {
|
|
134
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
135
|
+
if (shape === "cut") warnCut();
|
|
136
|
+
const known = loading && typeof progress === "number" && Number.isFinite(progress);
|
|
137
|
+
const ratio = known ? Math.min(1, Math.max(0, progress)) : 0;
|
|
138
|
+
const glyph = indicator && !asChild && (loading || status) ? status ?? "loading" : null;
|
|
139
|
+
const filled = variant === "primary" || variant === "gradient";
|
|
140
|
+
const button = /* @__PURE__ */ jsx2(
|
|
141
|
+
Comp,
|
|
142
|
+
{
|
|
143
|
+
type: asChild ? void 0 : "button",
|
|
144
|
+
"aria-busy": loading || void 0,
|
|
145
|
+
"data-loading": loading ? "" : void 0,
|
|
146
|
+
"data-variant": variant ?? "secondary",
|
|
147
|
+
"data-kz-status": status ?? void 0,
|
|
148
|
+
disabled: asChild ? void 0 : disabled || loading,
|
|
149
|
+
"aria-disabled": asChild && (disabled || loading) ? true : void 0,
|
|
150
|
+
className: buttonVariants({
|
|
151
|
+
variant,
|
|
152
|
+
size,
|
|
153
|
+
shape,
|
|
154
|
+
className: cn(known && "relative isolate overflow-hidden", className)
|
|
155
|
+
}),
|
|
156
|
+
...props,
|
|
157
|
+
children: asChild ? children : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
158
|
+
known && /* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: "absolute inset-y-0 left-0 -z-10 bg-current opacity-15 transition-[width] duration-500", style: { width: `${ratio * 100}%` } }),
|
|
159
|
+
glyph && /* @__PURE__ */ jsx2(
|
|
160
|
+
"span",
|
|
161
|
+
{
|
|
162
|
+
"aria-hidden": true,
|
|
163
|
+
"data-slot": "indicator",
|
|
164
|
+
className: "-my-1 grid grid-cols-[1fr] transition-[grid-template-columns,margin,opacity] duration-300 starting:-mr-2 starting:grid-cols-[0fr] starting:opacity-0",
|
|
165
|
+
children: /* @__PURE__ */ jsx2("span", { className: "overflow-hidden", children: /* @__PURE__ */ jsx2(LoaderGlyph, { state: glyph, value: known ? ratio : null, className: cn("h-4 w-4", glyph !== "loading" && !filled && STATUS_TEXT[glyph]) }) })
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
children
|
|
169
|
+
] })
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
if (announce === void 0 || asChild) return button;
|
|
173
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
174
|
+
button,
|
|
175
|
+
/* @__PURE__ */ jsx2("span", { role: "status", className: "sr-only", children: announce })
|
|
176
|
+
] });
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// src/settings-layout/settings-layout.tsx
|
|
180
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
181
|
+
var settingsLayout = tv2({
|
|
182
|
+
slots: {
|
|
183
|
+
root: "flex w-full flex-col gap-6",
|
|
184
|
+
head: "flex flex-col gap-1",
|
|
185
|
+
title: "font-display text-2xl font-extrabold tracking-tight text-fg",
|
|
186
|
+
description: "max-w-2xl text-sm text-fg-secondary",
|
|
187
|
+
columns: "grid grid-cols-1 gap-6 lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-10",
|
|
188
|
+
nav: "-mx-4 overflow-x-auto overflow-y-hidden px-4 py-1 -my-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden lg:mx-0 lg:overflow-visible lg:px-0 lg:py-0 lg:my-0",
|
|
189
|
+
navList: "flex w-max gap-2 lg:sticky lg:top-20 lg:w-auto lg:flex-col lg:gap-0.5",
|
|
190
|
+
navLink: "flex h-9 items-center gap-2.5 whitespace-nowrap rounded-sm border border-border-default bg-surface-1 px-3.5 text-sm font-medium text-fg-secondary no-underline hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current]:border-accent aria-[current]:text-fg lg:rounded-lg lg:border-transparent lg:bg-transparent lg:px-3 lg:hover:bg-surface-2 lg:aria-[current]:bg-accent-soft [&>svg]:h-4 [&>svg]:w-4",
|
|
191
|
+
// Past five sections a strip of chips is a puzzle: the sidebar groups them, a phone gets one menu (a disclosure: no script).
|
|
192
|
+
sidebar: "hidden lg:block",
|
|
193
|
+
sidebarList: "flex flex-col gap-6 lg:sticky lg:top-20",
|
|
194
|
+
group: "flex flex-col gap-1",
|
|
195
|
+
groupLabel: "px-3 text-xs font-semibold text-fg-secondary",
|
|
196
|
+
groupLink: "flex h-9 items-center gap-2.5 whitespace-nowrap rounded-lg px-3 text-sm font-medium text-fg-secondary no-underline hover:bg-surface-2 hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current]:bg-accent-soft aria-[current]:text-fg [&>svg]:h-4 [&>svg]:w-4",
|
|
197
|
+
groupItems: "m-0 flex list-none flex-col gap-0.5 p-0",
|
|
198
|
+
menu: "group lg:hidden",
|
|
199
|
+
menuSummary: "flex h-11 cursor-pointer list-none items-center justify-between gap-3 rounded-lg border border-border-default bg-surface-1 px-3.5 text-sm font-medium text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden group-open:border-accent",
|
|
200
|
+
menuChevron: "h-4 w-4 shrink-0 text-fg-secondary transition-transform group-open:rotate-180 motion-reduce:transition-none",
|
|
201
|
+
menuPanel: "mt-2 rounded-lg border border-border-default bg-surface-1 p-2",
|
|
202
|
+
navBadge: "ml-auto font-mono text-[11px] text-fg-secondary",
|
|
203
|
+
header: "flex flex-wrap items-center gap-x-4 gap-y-3 border-b border-border-subtle pb-5",
|
|
204
|
+
content: "flex min-w-0 flex-col gap-6",
|
|
205
|
+
section: "rounded-xl border border-border-default bg-surface-1",
|
|
206
|
+
sectionHead: "flex flex-col gap-1 px-5 pt-5",
|
|
207
|
+
sectionTitle: "text-base font-bold text-fg",
|
|
208
|
+
sectionDescription: "text-sm text-fg-secondary",
|
|
209
|
+
sectionBody: "flex flex-col gap-4 px-5 py-5",
|
|
210
|
+
sectionFooter: "flex flex-wrap items-center justify-end gap-2 border-t border-border-subtle bg-surface-2/40 px-5 py-3 rounded-b-xl",
|
|
211
|
+
// The flat look: no card, hairline-divided rows (Linear / Vercel / GitHub settings).
|
|
212
|
+
rows: "flex flex-col divide-y divide-border-subtle border-y border-border-subtle",
|
|
213
|
+
row: "flex flex-col gap-2 py-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6",
|
|
214
|
+
rowText: "flex min-w-0 flex-col gap-0.5",
|
|
215
|
+
rowLabel: "text-sm font-medium text-fg",
|
|
216
|
+
rowDescription: "text-sm text-fg-secondary",
|
|
217
|
+
rowControl: "flex min-w-0 shrink-0 items-center gap-2 text-sm text-fg sm:max-w-[60%] sm:justify-end"
|
|
218
|
+
},
|
|
219
|
+
variants: {
|
|
220
|
+
variant: {
|
|
221
|
+
card: {},
|
|
222
|
+
flat: {
|
|
223
|
+
content: "max-w-[45rem] gap-10",
|
|
224
|
+
section: "rounded-none border-0 bg-transparent",
|
|
225
|
+
sectionHead: "gap-0.5 px-0 pb-3 pt-0",
|
|
226
|
+
sectionBody: "gap-0 px-0 py-0",
|
|
227
|
+
sectionFooter: "justify-start border-t-0 bg-transparent px-0 pb-0 pt-4"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
defaultVariants: { variant: "card" }
|
|
232
|
+
});
|
|
233
|
+
var SETTINGS_CHIPS_MAX = 5;
|
|
234
|
+
var isGrouped = (nav) => nav.length > 0 && "items" in nav[0];
|
|
235
|
+
function NavLink({ item, Link, className }) {
|
|
236
|
+
const s = settingsLayout();
|
|
237
|
+
return /* @__PURE__ */ jsxs3(Link, { href: item.href, className, "aria-current": item.current ? item.href.startsWith("#") ? "location" : "page" : void 0, children: [
|
|
238
|
+
item.icon,
|
|
239
|
+
item.label,
|
|
240
|
+
item.badge !== void 0 && /* @__PURE__ */ jsx3("span", { className: s.navBadge(), children: item.badge })
|
|
241
|
+
] });
|
|
242
|
+
}
|
|
243
|
+
function NavGroups({ groups, Link }) {
|
|
244
|
+
const s = settingsLayout();
|
|
245
|
+
return /* @__PURE__ */ jsx3("div", { className: s.sidebarList(), children: groups.map((group) => /* @__PURE__ */ jsxs3("div", { className: s.group(), children: [
|
|
246
|
+
/* @__PURE__ */ jsx3("h2", { className: s.groupLabel(), children: group.label }),
|
|
247
|
+
/* @__PURE__ */ jsx3("ul", { className: s.groupItems(), children: group.items.map((item) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsx3(NavLink, { item, Link, className: s.groupLink() }) }, item.id)) })
|
|
248
|
+
] }, group.id)) });
|
|
249
|
+
}
|
|
250
|
+
function SettingsLayout({ title, description, header, nav, navLabel, linkAs: Link = "a", variant = "card", className, children, ...props }) {
|
|
251
|
+
const s = settingsLayout({ variant });
|
|
252
|
+
const groups = isGrouped(nav) ? nav : [{ id: "sections", label: "", items: nav }];
|
|
253
|
+
const items = groups.flatMap((g) => g.items);
|
|
254
|
+
const asMenu = items.length > SETTINGS_CHIPS_MAX;
|
|
255
|
+
const current = items.find((i) => i.current);
|
|
256
|
+
return /* @__PURE__ */ jsxs3("div", { className: s.root({ className }), ...props, children: [
|
|
257
|
+
header ? /* @__PURE__ */ jsx3("div", { className: s.header(), children: header }) : (title || description) && /* @__PURE__ */ jsxs3("div", { className: s.head(), children: [
|
|
258
|
+
title && /* @__PURE__ */ jsx3("h1", { className: s.title(), children: title }),
|
|
259
|
+
description && /* @__PURE__ */ jsx3("p", { className: s.description(), children: description })
|
|
260
|
+
] }),
|
|
261
|
+
/* @__PURE__ */ jsxs3("div", { className: s.columns(), children: [
|
|
262
|
+
asMenu ? /* @__PURE__ */ jsxs3("nav", { "aria-label": navLabel, children: [
|
|
263
|
+
/* @__PURE__ */ jsxs3("details", { className: s.menu(), "data-settings-menu": "", children: [
|
|
264
|
+
/* @__PURE__ */ jsxs3("summary", { className: s.menuSummary(), children: [
|
|
265
|
+
/* @__PURE__ */ jsx3("span", { className: "truncate", children: current?.label ?? navLabel }),
|
|
266
|
+
/* @__PURE__ */ jsx3("svg", { "aria-hidden": true, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", className: s.menuChevron(), children: /* @__PURE__ */ jsx3("path", { d: "m4 6 4 4 4-4" }) })
|
|
267
|
+
] }),
|
|
268
|
+
/* @__PURE__ */ jsx3("div", { className: s.menuPanel(), children: /* @__PURE__ */ jsx3(NavGroups, { groups, Link }) })
|
|
269
|
+
] }),
|
|
270
|
+
/* @__PURE__ */ jsx3("div", { className: s.sidebar(), children: /* @__PURE__ */ jsx3(NavGroups, { groups, Link }) })
|
|
271
|
+
] }) : /* @__PURE__ */ jsx3("nav", { "aria-label": navLabel, className: s.nav(), children: /* @__PURE__ */ jsx3("ul", { className: s.navList(), children: items.map((item) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsx3(NavLink, { item, Link, className: s.navLink() }) }, item.id)) }) }),
|
|
272
|
+
/* @__PURE__ */ jsx3("div", { className: s.content(), children })
|
|
273
|
+
] })
|
|
274
|
+
] });
|
|
275
|
+
}
|
|
276
|
+
function SettingsSection({ title, description, footer, save, variant = "card", id, className, children, ...props }) {
|
|
277
|
+
const s = settingsLayout({ variant });
|
|
278
|
+
const auto = React2.useId();
|
|
279
|
+
const titleId = `${id ?? auto}-title`;
|
|
280
|
+
const head = /* @__PURE__ */ jsxs3("div", { className: s.sectionHead(), children: [
|
|
281
|
+
/* @__PURE__ */ jsx3("h2", { id: titleId, className: s.sectionTitle(), children: title }),
|
|
282
|
+
description && /* @__PURE__ */ jsx3("p", { className: s.sectionDescription(), children: description })
|
|
283
|
+
] });
|
|
284
|
+
const body = children === void 0 ? null : /* @__PURE__ */ jsx3("div", { className: variant === "flat" ? s.rows() : s.sectionBody(), "data-settings-rows": variant === "flat" ? "" : void 0, children });
|
|
285
|
+
return /* @__PURE__ */ jsx3("section", { id, "aria-labelledby": titleId, "data-dirty": save?.dirty ? "" : void 0, className: s.section({ className }), ...props, children: save ? /* @__PURE__ */ jsxs3(
|
|
286
|
+
"form",
|
|
287
|
+
{
|
|
288
|
+
noValidate: true,
|
|
289
|
+
onSubmit: (event) => {
|
|
290
|
+
event.preventDefault();
|
|
291
|
+
if (save.dirty && save.status !== SaveStatus.Saving) save.onSave();
|
|
292
|
+
},
|
|
293
|
+
children: [
|
|
294
|
+
head,
|
|
295
|
+
body,
|
|
296
|
+
/* @__PURE__ */ jsxs3("div", { className: s.sectionFooter(), children: [
|
|
297
|
+
/* @__PURE__ */ jsx3(SaveFeedback, { save }),
|
|
298
|
+
save.onDiscard && save.dirty ? /* @__PURE__ */ jsx3(Button, { type: "button", variant: "ghost", onClick: save.onDiscard, children: save.labels.discard }) : null,
|
|
299
|
+
/* @__PURE__ */ jsx3(Button, { type: "submit", variant: "primary", disabled: !save.dirty || save.status === SaveStatus.Saving, loading: save.status === SaveStatus.Saving, children: save.labels.save })
|
|
300
|
+
] })
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
) : /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
304
|
+
head,
|
|
305
|
+
body,
|
|
306
|
+
footer && /* @__PURE__ */ jsx3("div", { className: s.sectionFooter(), children: footer })
|
|
307
|
+
] }) });
|
|
308
|
+
}
|
|
309
|
+
function SaveFeedback({ save }) {
|
|
310
|
+
const failed = save.status === SaveStatus.Error;
|
|
311
|
+
const saved = save.status === SaveStatus.Saved;
|
|
312
|
+
return /* @__PURE__ */ jsxs3("div", { className: "mr-auto flex min-w-0 items-center gap-2 text-sm", children: [
|
|
313
|
+
/* @__PURE__ */ jsx3("span", { role: failed ? "alert" : "status", "aria-live": failed ? "assertive" : "polite", className: failed ? "text-danger-text" : "text-fg-secondary", children: failed ? save.labels.error : saved ? save.labels.saved : save.status === SaveStatus.Saving ? save.labels.saving : "" }),
|
|
314
|
+
saved && save.onUndo ? /* @__PURE__ */ jsx3(Button, { type: "button", variant: "ghost", size: "sm", onClick: save.onUndo, children: save.labels.undo }) : null
|
|
315
|
+
] });
|
|
316
|
+
}
|
|
317
|
+
function SettingsRow({ label, description, htmlFor, className, children, ...props }) {
|
|
318
|
+
const s = settingsLayout();
|
|
319
|
+
const Label = htmlFor ? "label" : "span";
|
|
320
|
+
return /* @__PURE__ */ jsxs3("div", { className: s.row({ className }), ...props, children: [
|
|
321
|
+
/* @__PURE__ */ jsxs3("div", { className: s.rowText(), children: [
|
|
322
|
+
/* @__PURE__ */ jsx3(Label, { className: s.rowLabel(), ...htmlFor ? { htmlFor } : {}, children: label }),
|
|
323
|
+
description && /* @__PURE__ */ jsx3("span", { className: s.rowDescription(), children: description })
|
|
324
|
+
] }),
|
|
325
|
+
children !== void 0 && /* @__PURE__ */ jsx3("div", { className: s.rowControl(), children })
|
|
326
|
+
] });
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export {
|
|
330
|
+
defineRecipe,
|
|
331
|
+
SaveStatus,
|
|
332
|
+
SAVED_VISIBLE_MS,
|
|
333
|
+
useSaveStatus,
|
|
334
|
+
settingsLayout,
|
|
335
|
+
SETTINGS_CHIPS_MAX,
|
|
336
|
+
SettingsLayout,
|
|
337
|
+
SettingsSection,
|
|
338
|
+
SettingsRow
|
|
339
|
+
};
|
|
340
|
+
//# sourceMappingURL=chunk-7J2L4HOD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/settings-layout/save-status.ts","../src/settings-layout/settings-layout.tsx","../src/button/button.tsx","../src/spinner/glyph.tsx","../src/recipes/define.ts","../src/button/recipe.ts"],"sourcesContent":["import * as React from \"react\";\n\n/** Where an inline save is: nothing to say, in flight, done (for a moment), or failed. */\nexport const SaveStatus = { Idle: \"idle\", Saving: \"saving\", Saved: \"saved\", Error: \"error\" } as const;\nexport type SaveStatus = (typeof SaveStatus)[keyof typeof SaveStatus];\n\n/** How long « Saved » stays before the section goes quiet again. */\n// @fixed: an interface timing (how long a confirmation reads), not a business setting.\nexport const SAVED_VISIBLE_MS = 4000;\n\nexport interface SaveTracker {\n status: SaveStatus;\n /** The failure of the last try, for the message beside the button. */\n error: unknown;\n /** Runs a save: `saving`, then `saved` (back to `idle` after a moment) or `error`. Never rejects. */\n track: (save: () => Promise<unknown>) => Promise<boolean>;\n /** Clears the status (the form was edited again, or the save was undone). */\n reset: () => void;\n}\n\n/** The status of one section's save. Feed it to `SettingsSection`'s `save.status`. */\nexport function useSaveStatus(): SaveTracker {\n const [status, setStatus] = React.useState<SaveStatus>(SaveStatus.Idle);\n const [error, setError] = React.useState<unknown>(undefined);\n const timer = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const clear = React.useCallback(() => {\n if (timer.current) clearTimeout(timer.current);\n timer.current = undefined;\n }, []);\n React.useEffect(() => clear, [clear]);\n const reset = React.useCallback(() => {\n clear();\n setStatus(SaveStatus.Idle);\n setError(undefined);\n }, [clear]);\n const track = React.useCallback(\n async (save: () => Promise<unknown>) => {\n clear();\n setStatus(SaveStatus.Saving);\n setError(undefined);\n try {\n await save();\n setStatus(SaveStatus.Saved);\n timer.current = setTimeout(() => setStatus(SaveStatus.Idle), SAVED_VISIBLE_MS);\n return true;\n } catch (failure) {\n setError(failure);\n setStatus(SaveStatus.Error);\n return false;\n }\n },\n [clear],\n );\n return { status, error, track, reset };\n}\n","// Server-safe. Settings, read from the products' account and administration screens: a list of sections on the left\n// (a row of chips that scrolls on a phone, a disclosure menu past five), the current section's forms on the right, each\n// form a titled card with its own save at the foot. The sections are links (one page each) or anchors (one long page),\n// alone or in titled groups.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { Button } from \"../button/button\";\nimport { SaveStatus } from \"./save-status\";\n\nexport const settingsLayout = tv({\n slots: {\n root: \"flex w-full flex-col gap-6\",\n head: \"flex flex-col gap-1\",\n title: \"font-display text-2xl font-extrabold tracking-tight text-fg\",\n description: \"max-w-2xl text-sm text-fg-secondary\",\n columns: \"grid grid-cols-1 gap-6 lg:grid-cols-[13rem_minmax(0,1fr)] lg:gap-10\",\n nav: \"-mx-4 overflow-x-auto overflow-y-hidden px-4 py-1 -my-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden lg:mx-0 lg:overflow-visible lg:px-0 lg:py-0 lg:my-0\",\n navList: \"flex w-max gap-2 lg:sticky lg:top-20 lg:w-auto lg:flex-col lg:gap-0.5\",\n navLink:\n \"flex h-9 items-center gap-2.5 whitespace-nowrap rounded-sm border border-border-default bg-surface-1 px-3.5 text-sm font-medium text-fg-secondary no-underline \" +\n \"hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current]:border-accent aria-[current]:text-fg \" +\n \"lg:rounded-lg lg:border-transparent lg:bg-transparent lg:px-3 lg:hover:bg-surface-2 lg:aria-[current]:bg-accent-soft [&>svg]:h-4 [&>svg]:w-4\",\n // Past five sections a strip of chips is a puzzle: the sidebar groups them, a phone gets one menu (a disclosure: no script).\n sidebar: \"hidden lg:block\",\n sidebarList: \"flex flex-col gap-6 lg:sticky lg:top-20\",\n group: \"flex flex-col gap-1\",\n groupLabel: \"px-3 text-xs font-semibold text-fg-secondary\",\n groupLink:\n \"flex h-9 items-center gap-2.5 whitespace-nowrap rounded-lg px-3 text-sm font-medium text-fg-secondary no-underline hover:bg-surface-2 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current]:bg-accent-soft aria-[current]:text-fg [&>svg]:h-4 [&>svg]:w-4\",\n groupItems: \"m-0 flex list-none flex-col gap-0.5 p-0\",\n menu: \"group lg:hidden\",\n menuSummary:\n \"flex h-11 cursor-pointer list-none items-center justify-between gap-3 rounded-lg border border-border-default bg-surface-1 px-3.5 text-sm font-medium text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden group-open:border-accent\",\n menuChevron: \"h-4 w-4 shrink-0 text-fg-secondary transition-transform group-open:rotate-180 motion-reduce:transition-none\",\n menuPanel: \"mt-2 rounded-lg border border-border-default bg-surface-1 p-2\",\n navBadge: \"ml-auto font-mono text-[11px] text-fg-secondary\",\n header: \"flex flex-wrap items-center gap-x-4 gap-y-3 border-b border-border-subtle pb-5\",\n content: \"flex min-w-0 flex-col gap-6\",\n section: \"rounded-xl border border-border-default bg-surface-1\",\n sectionHead: \"flex flex-col gap-1 px-5 pt-5\",\n sectionTitle: \"text-base font-bold text-fg\",\n sectionDescription: \"text-sm text-fg-secondary\",\n sectionBody: \"flex flex-col gap-4 px-5 py-5\",\n sectionFooter: \"flex flex-wrap items-center justify-end gap-2 border-t border-border-subtle bg-surface-2/40 px-5 py-3 rounded-b-xl\",\n // The flat look: no card, hairline-divided rows (Linear / Vercel / GitHub settings).\n rows: \"flex flex-col divide-y divide-border-subtle border-y border-border-subtle\",\n row: \"flex flex-col gap-2 py-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6\",\n rowText: \"flex min-w-0 flex-col gap-0.5\",\n rowLabel: \"text-sm font-medium text-fg\",\n rowDescription: \"text-sm text-fg-secondary\",\n rowControl: \"flex min-w-0 shrink-0 items-center gap-2 text-sm text-fg sm:max-w-[60%] sm:justify-end\",\n },\n variants: {\n variant: {\n card: {},\n flat: {\n content: \"max-w-[45rem] gap-10\",\n section: \"rounded-none border-0 bg-transparent\",\n sectionHead: \"gap-0.5 px-0 pb-3 pt-0\",\n sectionBody: \"gap-0 px-0 py-0\",\n sectionFooter: \"justify-start border-t-0 bg-transparent px-0 pb-0 pt-4\",\n },\n },\n },\n defaultVariants: { variant: \"card\" },\n});\n\nexport interface SettingsNavItem {\n /** Its id (the anchor of a section on one long page). */\n id: string;\n /** Its words. */\n label: string;\n /** Where it leads: a page (`/settings/billing`) or an anchor (`#billing`). */\n href: string;\n /** Its icon (a signature icon). */\n icon?: React.ReactNode;\n /** The section shown now: `aria-current`. */\n current?: boolean;\n /** A small count or status after the label (`3`, `New`). */\n badge?: React.ReactNode;\n}\n\nexport interface SettingsNavGroup {\n /** Its id. */\n id: string;\n /** The group's title (`Library`, `Money`). */\n label: string;\n items: readonly SettingsNavItem[];\n}\n\n/** Past this many sections a phone gets one menu instead of a strip of chips (« never more than about 5 items in a horizontal tab bar »). */\nexport const SETTINGS_CHIPS_MAX = 5;\n\nconst isGrouped = (nav: readonly SettingsNavItem[] | readonly SettingsNavGroup[]): nav is readonly SettingsNavGroup[] => nav.length > 0 && \"items\" in nav[0]!;\n\nexport type SettingsLayoutProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The screen's title (`Settings`). */\n title?: React.ReactNode;\n /** One sentence under it. */\n description?: React.ReactNode;\n /** What the screen is about, above the sections: who the account is, with their actions. Replaces `title` and `description`. */\n header?: React.ReactNode;\n /** The sections, alone or in titled groups. */\n nav: readonly SettingsNavItem[] | readonly SettingsNavGroup[];\n /** The navigation's accessible name (`Settings sections`). */\n navLabel: string;\n /** The app's link component for the sections (Next's `Link`); an `<a>` otherwise. */\n linkAs?: React.ElementType;\n /**\n * `card` (each form a titled card) or `flat` (one calm column of at most 45rem, rows divided by hairlines).\n * @default \"card\"\n */\n variant?: \"card\" | \"flat\";\n /** The current section's forms (`SettingsSection`). */\n children: React.ReactNode;\n};\n\nfunction NavLink({ item, Link, className }: { item: SettingsNavItem; Link: React.ElementType; className: string }) {\n const s = settingsLayout();\n return (\n <Link href={item.href} className={className} aria-current={item.current ? (item.href.startsWith(\"#\") ? \"location\" : \"page\") : undefined}>\n {item.icon}\n {item.label}\n {item.badge !== undefined && <span className={s.navBadge()}>{item.badge}</span>}\n </Link>\n );\n}\n\nfunction NavGroups({ groups, Link }: { groups: readonly SettingsNavGroup[]; Link: React.ElementType }) {\n const s = settingsLayout();\n return (\n <div className={s.sidebarList()}>\n {groups.map((group) => (\n <div key={group.id} className={s.group()}>\n <h2 className={s.groupLabel()}>{group.label}</h2>\n <ul className={s.groupItems()}>\n {group.items.map((item) => (\n <li key={item.id}>\n <NavLink item={item} Link={Link} className={s.groupLink()} />\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n );\n}\n\n/** A settings screen: sections on the left (chips on a phone, one menu past five), forms on the right. */\nexport function SettingsLayout({ title, description, header, nav, navLabel, linkAs: Link = \"a\", variant = \"card\", className, children, ...props }: SettingsLayoutProps) {\n const s = settingsLayout({ variant });\n const groups: readonly SettingsNavGroup[] = isGrouped(nav) ? nav : [{ id: \"sections\", label: \"\", items: nav }];\n const items = groups.flatMap((g) => g.items);\n const asMenu = items.length > SETTINGS_CHIPS_MAX;\n const current = items.find((i) => i.current);\n return (\n <div className={s.root({ className })} {...props}>\n {header ? (\n <div className={s.header()}>{header}</div>\n ) : (\n (title || description) && (\n <div className={s.head()}>\n {title && <h1 className={s.title()}>{title}</h1>}\n {description && <p className={s.description()}>{description}</p>}\n </div>\n )\n )}\n <div className={s.columns()}>\n {asMenu ? (\n <nav aria-label={navLabel}>\n <details className={s.menu()} data-settings-menu=\"\">\n <summary className={s.menuSummary()}>\n <span className=\"truncate\">{current?.label ?? navLabel}</span>\n <svg aria-hidden viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" className={s.menuChevron()}>\n <path d=\"m4 6 4 4 4-4\" />\n </svg>\n </summary>\n <div className={s.menuPanel()}>\n <NavGroups groups={groups} Link={Link} />\n </div>\n </details>\n <div className={s.sidebar()}>\n <NavGroups groups={groups} Link={Link} />\n </div>\n </nav>\n ) : (\n <nav aria-label={navLabel} className={s.nav()}>\n <ul className={s.navList()}>\n {items.map((item) => (\n <li key={item.id}>\n <NavLink item={item} Link={Link} className={s.navLink()} />\n </li>\n ))}\n </ul>\n </nav>\n )}\n <div className={s.content()}>{children}</div>\n </div>\n </div>\n );\n}\n\nexport interface SectionSaveLabels {\n /** “Save”. */\n save: string;\n /** “Saving…”. */\n saving: string;\n /** “Saved”. */\n saved: string;\n /** What failed, one sentence (“Could not save. Try again.”). */\n error: string;\n /** “Undo” — only shown after a save, when `onUndo` is given. */\n undo: string;\n /** “Discard changes” — only shown while dirty, when `onDiscard` is given. */\n discard: string;\n}\n\n/** The one save of a section: its dirty state, its status, its words. */\nexport interface SectionSave {\n /** Whether a field differs from what is saved: the save is enabled only then. */\n dirty: boolean;\n /** Where the save is (`useSaveStatus().status`). */\n status: SaveStatus;\n /** Saves the section (the form's submit, Enter included). */\n onSave: () => void;\n /** Puts the previous values back after a save, optimistic update included. */\n onUndo?: () => void;\n /** Throws the edits away while dirty. */\n onDiscard?: () => void;\n labels: SectionSaveLabels;\n}\n\nexport type SettingsSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /**\n * One save for the whole section: the section becomes a form, the foot shows the Save (enabled while dirty), the\n * result in a live region (saved, or the error as an alert) and an undo after a save. Replaces `footer`.\n */\n save?: SectionSave;\n /** The section's title: it names the region (and is its anchor's target when `id` is set). */\n title: React.ReactNode;\n /** What these settings change, in one sentence. */\n description?: React.ReactNode;\n /** At the foot: the section's own save (a Button), a note. */\n footer?: React.ReactNode;\n /**\n * `card` (a titled card) or `flat` (no card: a title, then hairline-divided `SettingsRow`s).\n * @default \"card\"\n */\n variant?: \"card\" | \"flat\";\n /** The fields (or, flat, the `SettingsRow`s). A section of a title, a sentence and a foot action has none. */\n children?: React.ReactNode;\n};\n\n/** A group of settings: a titled card with its fields and its own save, or flat rows under a title. */\nexport function SettingsSection({ title, description, footer, save, variant = \"card\", id, className, children, ...props }: SettingsSectionProps) {\n const s = settingsLayout({ variant });\n const auto = React.useId();\n const titleId = `${id ?? auto}-title`;\n const head = (\n <div className={s.sectionHead()}>\n <h2 id={titleId} className={s.sectionTitle()}>\n {title}\n </h2>\n {description && <p className={s.sectionDescription()}>{description}</p>}\n </div>\n );\n const body = children === undefined ? null : (\n <div className={variant === \"flat\" ? s.rows() : s.sectionBody()} data-settings-rows={variant === \"flat\" ? \"\" : undefined}>\n {children}\n </div>\n );\n return (\n <section id={id} aria-labelledby={titleId} data-dirty={save?.dirty ? \"\" : undefined} className={s.section({ className })} {...props}>\n {save ? (\n <form\n noValidate\n onSubmit={(event) => {\n event.preventDefault();\n if (save.dirty && save.status !== SaveStatus.Saving) save.onSave();\n }}\n >\n {head}\n {body}\n <div className={s.sectionFooter()}>\n <SaveFeedback save={save} />\n {save.onDiscard && save.dirty ? (\n <Button type=\"button\" variant=\"ghost\" onClick={save.onDiscard}>\n {save.labels.discard}\n </Button>\n ) : null}\n <Button type=\"submit\" variant=\"primary\" disabled={!save.dirty || save.status === SaveStatus.Saving} loading={save.status === SaveStatus.Saving}>\n {save.labels.save}\n </Button>\n </div>\n </form>\n ) : (\n <>\n {head}\n {body}\n {footer && <div className={s.sectionFooter()}>{footer}</div>}\n </>\n )}\n </section>\n );\n}\n\n/** The result of the last save: « Saved » (with Undo) in a polite live region, a failure as an alert. The region stays mounted so the change is announced. */\nfunction SaveFeedback({ save }: { save: SectionSave }) {\n const failed = save.status === SaveStatus.Error;\n const saved = save.status === SaveStatus.Saved;\n return (\n <div className=\"mr-auto flex min-w-0 items-center gap-2 text-sm\">\n <span role={failed ? \"alert\" : \"status\"} aria-live={failed ? \"assertive\" : \"polite\"} className={failed ? \"text-danger-text\" : \"text-fg-secondary\"}>\n {failed ? save.labels.error : saved ? save.labels.saved : save.status === SaveStatus.Saving ? save.labels.saving : \"\"}\n </span>\n {saved && save.onUndo ? (\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={save.onUndo}>\n {save.labels.undo}\n </Button>\n ) : null}\n </div>\n );\n}\n\nexport type SettingsRowProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** What the setting is (`Username`). */\n label: React.ReactNode;\n /** The help text under it, one sentence. */\n description?: React.ReactNode;\n /** The id of the control, so the label names it (a `<label htmlFor>`). Leave out for a plain value. */\n htmlFor?: string;\n /** The control or the value, on the right (stacked under the label on a phone). */\n children?: React.ReactNode;\n};\n\n/** One setting: its label and help on the left, its control or value on the right. Put rows in a flat `SettingsSection`. */\nexport function SettingsRow({ label, description, htmlFor, className, children, ...props }: SettingsRowProps) {\n const s = settingsLayout();\n const Label = htmlFor ? \"label\" : \"span\";\n return (\n <div className={s.row({ className })} {...props}>\n <div className={s.rowText()}>\n <Label className={s.rowLabel()} {...(htmlFor ? { htmlFor } : {})}>\n {label}\n </Label>\n {description && <span className={s.rowDescription()}>{description}</span>}\n </div>\n {children !== undefined && <div className={s.rowControl()}>{children}</div>}\n </div>\n );\n}\n","// Server-safe: no hook, no context. `buttonVariants` styles a <Link> or a Server Component without the component.\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { LoaderGlyph } from \"../spinner/glyph\";\nimport { buttonRecipe } from \"./recipe\";\n\nexport const buttonVariants = tv(buttonRecipe);\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\n\nexport type ButtonProps = React.ComponentProps<\"button\"> &\n ButtonVariants & {\n /**\n * The look: `primary` (the accent), `gradient` (accent → accent-2), `secondary` (a raised surface), `outline`,\n * `ghost`, `danger`.\n * @default \"secondary\"\n */\n variant?: ButtonVariants[\"variant\"];\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"md\"\n */\n size?: ButtonVariants[\"size\"];\n /**\n * `rounded` (an 8 px radius, the radius of a field) · `pill`. `cut` is deprecated (krizaka-ui#393: the chamfer is\n * retired) — it draws `rounded` and warns in development; it will be removed in 4.0.\n * @default \"rounded\"\n */\n shape?: ButtonVariants[\"shape\"];\n /** Renders the child (e.g. a <Link>) instead of the <button>, with props, classes and ref merged. */\n asChild?: boolean;\n /**\n * Disables and signals the wait (aria-busy, data-loading) and shows the Krizaka loader glyph before the label; the\n * button keeps its colour.\n */\n loading?: boolean;\n /**\n * Between 0 and 1, while `loading`: the glyph's trace and a light fill across the button grow to the value (an\n * upload, an export).\n */\n progress?: number | null;\n /**\n * How the action ended: `success` draws a check, `error` a cross (and the button shakes its head once); a ring of\n * the status colour opens around it. Clear it to return to rest.\n */\n status?: \"success\" | \"error\" | null;\n /** A message announced politely by assistive technology when it changes (“Saved”, “Upload failed”) — passed translated. */\n announce?: string;\n /**\n * Shows the glyph while `loading` / with a `status`. `false`: you draw your own.\n * @default true\n */\n indicator?: boolean;\n /** @deprecated Since 3.31 (krizaka-ui#393): does nothing — the hover is quiet. Removed in 4.0. */\n shimmer?: boolean;\n /** @deprecated Since 3.31 (krizaka-ui#393): does nothing — a button never moves under the pointer. Removed in 4.0. */\n magnetic?: boolean;\n };\n\nconst STATUS_TEXT = { success: \"text-fg-success\", error: \"text-fg-danger\" } as const;\n\nlet warnedCut = false;\n/** `shape=\"cut\"` (the chamfer) is retired: one warning per page in development, never in production. */\nfunction warnCut() {\n if (warnedCut || typeof process === \"undefined\" || process.env.NODE_ENV === \"production\") return;\n warnedCut = true;\n console.warn('@krizaka/ui/button: shape=\"cut\" is deprecated (krizaka-ui#393) and now draws the default rounded shape. Remove the prop.');\n}\n\nexport function Button({\n asChild,\n loading,\n progress,\n status,\n announce,\n indicator = true,\n shimmer: _shimmer,\n magnetic: _magnetic,\n variant,\n size,\n shape,\n className,\n disabled,\n children,\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot.Root : \"button\";\n if (shape === \"cut\") warnCut();\n const known = loading && typeof progress === \"number\" && Number.isFinite(progress);\n const ratio = known ? Math.min(1, Math.max(0, progress)) : 0;\n const glyph = indicator && !asChild && (loading || status) ? (status ?? \"loading\") : null;\n // On a filled variant the glyph stays in the label's colour; on the others it takes the status colour.\n const filled = variant === \"primary\" || variant === \"gradient\";\n const button = (\n <Comp\n type={asChild ? undefined : \"button\"}\n aria-busy={loading || undefined}\n data-loading={loading ? \"\" : undefined}\n data-variant={variant ?? \"secondary\"}\n data-kz-status={status ?? undefined}\n disabled={asChild ? undefined : disabled || loading}\n aria-disabled={asChild && (disabled || loading) ? true : undefined}\n className={buttonVariants({\n variant,\n size,\n shape,\n className: cn(known && \"relative isolate overflow-hidden\", className),\n })}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {known && (\n <span aria-hidden className=\"absolute inset-y-0 left-0 -z-10 bg-current opacity-15 transition-[width] duration-500\" style={{ width: `${ratio * 100}%` }} />\n )}\n {glyph && (\n <span\n aria-hidden\n data-slot=\"indicator\"\n className=\"-my-1 grid grid-cols-[1fr] transition-[grid-template-columns,margin,opacity] duration-300 starting:-mr-2 starting:grid-cols-[0fr] starting:opacity-0\"\n >\n <span className=\"overflow-hidden\">\n <LoaderGlyph state={glyph} value={known ? ratio : null} className={cn(\"h-4 w-4\", glyph !== \"loading\" && !filled && STATUS_TEXT[glyph])} />\n </span>\n </span>\n )}\n {children}\n </>\n )}\n </Comp>\n );\n if (announce === undefined || asChild) return button;\n return (\n <>\n {button}\n <span role=\"status\" className=\"sr-only\">\n {announce}\n </span>\n </>\n );\n}\n\nexport type IconButtonProps = Omit<ButtonProps, \"size\"> & {\n /** The accessible name (and tooltip) of the button — required, passed translated. */\n label: string;\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"icon\"\n */\n size?: ButtonProps[\"size\"];\n};\n\n/** An icon-only button: `label` is required, it is its accessible name. Loading or with a status, the glyph takes the icon's place. */\nexport function IconButton({ label, size = \"icon\", children, ...props }: IconButtonProps) {\n const swap = props.indicator !== false && !props.asChild && (props.loading || props.status);\n return (\n <Button aria-label={label} title={label} size={size} {...props}>\n {swap ? null : children}\n </Button>\n );\n}\n","// The Krizaka loader glyph, server-safe: a hexagon (the marks' shape) traced by a segment of light around a node that\n// breathes; determinate, it fills to its value; done, the trace closes and a check (or a cross) draws itself. Animated by\n// motion.css (`kz-loader-*`); still under prefers-reduced-motion — a segment at rest and the node lit, never blank.\nimport type * as React from \"react\";\n\n/** The hexagon, pointy top, radius 9 around (12, 12). */\nconst HEX = \"M12 3 19.79 7.5 19.79 16.5 12 21 4.21 16.5 4.21 7.5Z\";\n\n/** What the glyph shows: a wait (with an optional value), or how it ended. */\nexport type LoaderGlyphState = \"loading\" | \"success\" | \"error\";\n\nexport interface LoaderGlyphProps extends Omit<React.ComponentProps<\"svg\">, \"children\"> {\n /** loading · success · error. */\n state?: LoaderGlyphState;\n /** Between 0 and 1: a determinate wait, the trace grows to it. Absent: indeterminate. */\n value?: number | null;\n}\n\n/** The glyph alone (decorative): the Spinner, the Loader and the Button's `loading` draw it. */\nexport function LoaderGlyph({ state = \"loading\", value, ...props }: LoaderGlyphProps) {\n const known = typeof value === \"number\" && Number.isFinite(value);\n const fill = state !== \"loading\" ? 100 : known ? Math.round(Math.min(1, Math.max(0, value)) * 100) : null;\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden data-state={state} data-progress={fill === null ? undefined : fill} {...props}>\n <path d={HEX} stroke=\"currentColor\" strokeOpacity=\"0.22\" strokeWidth=\"2.2\" strokeLinejoin=\"round\" />\n <path\n d={HEX}\n pathLength={100}\n stroke=\"currentColor\"\n strokeWidth=\"2.2\"\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n className=\"kz-loader-trace\"\n strokeDasharray={fill === null ? undefined : `${fill} ${100 - fill}`}\n />\n {state === \"loading\" && <circle cx=\"12\" cy=\"12\" r=\"2.6\" fill=\"currentColor\" className=\"kz-loader-node\" />}\n {state === \"success\" && <path d=\"M8.3 12.3l2.6 2.6 4.9-5.3\" pathLength={20} stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" className=\"kz-loader-mark\" />}\n {state === \"error\" && <path d=\"M9.4 9.4l5.2 5.2M14.6 9.4l-5.2 5.2\" pathLength={20} stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" className=\"kz-loader-mark\" />}\n </svg>\n );\n}\n","import type { TV } from \"tailwind-variants\";\n\n/** What a recipe is made of: the `tv()` options — `base`, `slots`, `variants`, `defaultVariants`, `compoundVariants`. */\nexport type RecipeConfig = Parameters<TV>[0];\n\n/**\n * A recipe is data: the variants of a component (a `variant`, a `size`, a `tone`…) as classes of the Krizaka tokens.\n * `defineRecipe` only keeps the literal types, so `tv(recipe)` is typed exactly as `tv({ … })` would be (the web side) and\n * `nativeRecipe(recipe)` reads the same classes into styles on the theme's roles (the native side, `./native`).\n *\n * Sizes are a variant dimension (`size: { sm: \"h-8 px-3 text-xs\" }`); states are the prefixes (`hover:`, `disabled:`,\n * `data-[state=on]:`). Write colours as roles (`bg-accent`, `text-fg-secondary`, `border-border-default`, `ring-accent/40`),\n * spacing as Tailwind units (`h-10`, `px-4`), type as `text-sm` / `text-[11px]` / `font-semibold`.\n */\nexport function defineRecipe<const C extends RecipeConfig>(config: C): C {\n return config;\n}\n","// The button's variants, written once as classes of the Krizaka tokens: the web wears them with `tv(buttonRecipe)`\n// (button.tsx), React Native reads the same classes into styles (native/button.tsx, `nativeRecipe`).\nimport { defineRecipe } from \"../recipes/define\";\n\nexport const buttonRecipe = defineRecipe({\n base:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition duration-150 \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 \" +\n \"disabled:pointer-events-none disabled:opacity-40 data-loading:cursor-progress active:scale-[0.98] \" +\n // Busy is not unavailable: a loading button keeps its colour (it is disabled only so it is not pressed twice).\n \"[&[data-loading]]:opacity-100\",\n variants: {\n variant: {\n primary: \"bg-accent text-on-accent shadow-sm hover:bg-accent-hover\",\n // The brand's signature: accent → accent-2 (on-accent reads on both stops, tested in @krizaka/tokens).\n gradient: \"bg-linear-to-r from-accent to-accent-2 text-on-accent shadow-sm hover:brightness-110\",\n secondary: \"border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3\",\n outline: \"border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent\",\n ghost: \"text-fg-secondary hover:bg-surface-2 hover:text-fg\",\n // The border and the tint carry the danger; the label stays the primary text role, legible on the tint at rest\n // and hovered over every surface (`text-fg-danger` is for text set directly on a surface).\n danger: \"border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20\",\n },\n size: { sm: \"h-8 px-3 text-xs\", md: \"h-10 px-4 text-sm\", lg: \"h-12 px-6 text-sm\", icon: \"h-10 w-10\" },\n // One clean shape (krizaka-ui#393): an 8 px radius (`--kz-radius-sm`, the radius of a field — a button beside an\n // input lines up with it), the pill on demand. `cut` (the retired chamfer) is a deprecated alias of `rounded`.\n shape: { rounded: \"rounded-sm\", pill: \"rounded-full\", cut: \"rounded-sm\" },\n },\n defaultVariants: { variant: \"secondary\", size: \"md\", shape: \"rounded\" },\n});\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AAGhB,IAAM,aAAa,EAAE,MAAM,QAAQ,QAAQ,UAAU,OAAO,SAAS,OAAO,QAAQ;AAKpF,IAAM,mBAAmB;AAazB,SAAS,gBAA6B;AAC3C,QAAM,CAAC,QAAQ,SAAS,IAAU,eAAqB,WAAW,IAAI;AACtE,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAkB,MAAS;AAC3D,QAAM,QAAc,aAAkD,MAAS;AAC/E,QAAM,QAAc,kBAAY,MAAM;AACpC,QAAI,MAAM,QAAS,cAAa,MAAM,OAAO;AAC7C,UAAM,UAAU;AAAA,EAClB,GAAG,CAAC,CAAC;AACL,EAAM,gBAAU,MAAM,OAAO,CAAC,KAAK,CAAC;AACpC,QAAM,QAAc,kBAAY,MAAM;AACpC,UAAM;AACN,cAAU,WAAW,IAAI;AACzB,aAAS,MAAS;AAAA,EACpB,GAAG,CAAC,KAAK,CAAC;AACV,QAAM,QAAc;AAAA,IAClB,OAAO,SAAiC;AACtC,YAAM;AACN,gBAAU,WAAW,MAAM;AAC3B,eAAS,MAAS;AAClB,UAAI;AACF,cAAM,KAAK;AACX,kBAAU,WAAW,KAAK;AAC1B,cAAM,UAAU,WAAW,MAAM,UAAU,WAAW,IAAI,GAAG,gBAAgB;AAC7E,eAAO;AAAA,MACT,SAAS,SAAS;AAChB,iBAAS,OAAO;AAChB,kBAAU,WAAW,KAAK;AAC1B,eAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,CAAC,KAAK;AAAA,EACR;AACA,SAAO,EAAE,QAAQ,OAAO,OA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6
|
+
cn
|
|
7
|
+
} from "./chunk-NSLXEDIS.js";
|
|
5
8
|
|
|
6
9
|
// src/chip/chip.tsx
|
|
7
10
|
import { Toggle as TogglePrimitive, ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
@@ -97,9 +100,78 @@ function SingleGroup({
|
|
|
97
100
|
}
|
|
98
101
|
var Chip = Object.assign(ChipBase, { Group: ChipGroup });
|
|
99
102
|
|
|
103
|
+
// src/chip/tag-chip.tsx
|
|
104
|
+
import { RadioGroup as RadioPrimitive } from "radix-ui";
|
|
105
|
+
|
|
106
|
+
// src/chip/markers.ts
|
|
107
|
+
var TAG_MARKERS = ["blue", "green", "amber", "red", "violet", "gray"];
|
|
108
|
+
|
|
109
|
+
// src/chip/tag-chip.tsx
|
|
110
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
111
|
+
var MARKERS = TAG_MARKERS;
|
|
112
|
+
var markerVar = (marker) => `var(--kz-tag-${marker})`;
|
|
113
|
+
function TagMarker({ marker, shape = "dot", className, style, ...props }) {
|
|
114
|
+
return /* @__PURE__ */ jsx2(
|
|
115
|
+
"span",
|
|
116
|
+
{
|
|
117
|
+
"aria-hidden": true,
|
|
118
|
+
"data-marker": marker,
|
|
119
|
+
"data-shape": shape,
|
|
120
|
+
className: cn(
|
|
121
|
+
"inline-block shrink-0 bg-(--kz-marker) data-[shape=dot]:h-2.5 data-[shape=dot]:w-2.5 data-[shape=dot]:rounded-full",
|
|
122
|
+
"data-[shape=ribbon]:h-3.5 data-[shape=ribbon]:w-2.5 data-[shape=ribbon]:[clip-path:polygon(0_0,100%_0,100%_100%,50%_72%,0_100%)]",
|
|
123
|
+
className
|
|
124
|
+
),
|
|
125
|
+
style: { ...style, ["--kz-marker"]: markerVar(marker) },
|
|
126
|
+
...props
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
function TagChip({ marker, shape, children, ...props }) {
|
|
131
|
+
const content = /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
132
|
+
/* @__PURE__ */ jsx2(TagMarker, { marker, shape }),
|
|
133
|
+
children
|
|
134
|
+
] });
|
|
135
|
+
return /* @__PURE__ */ jsx2(Chip, { ...props, children: content });
|
|
136
|
+
}
|
|
137
|
+
function MarkerPicker({ label, names, value, defaultValue, onValueChange, markers = MARKERS, disabled, className }) {
|
|
138
|
+
return /* @__PURE__ */ jsx2(
|
|
139
|
+
RadioPrimitive.Root,
|
|
140
|
+
{
|
|
141
|
+
"aria-label": label,
|
|
142
|
+
value,
|
|
143
|
+
defaultValue,
|
|
144
|
+
onValueChange: (next) => onValueChange?.(next),
|
|
145
|
+
disabled,
|
|
146
|
+
orientation: "horizontal",
|
|
147
|
+
className: cn("flex flex-wrap items-center gap-1.5", className),
|
|
148
|
+
children: markers.map((marker) => /* @__PURE__ */ jsx2(
|
|
149
|
+
RadioPrimitive.Item,
|
|
150
|
+
{
|
|
151
|
+
value: marker,
|
|
152
|
+
"aria-label": names[marker],
|
|
153
|
+
title: names[marker],
|
|
154
|
+
className: cn(
|
|
155
|
+
"inline-flex h-8 w-8 items-center justify-center rounded-full border border-border-default bg-surface-1 transition-colors",
|
|
156
|
+
"hover:border-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40",
|
|
157
|
+
"data-[state=checked]:border-(--kz-marker) data-[state=checked]:bg-surface-2"
|
|
158
|
+
),
|
|
159
|
+
style: { ["--kz-marker"]: markerVar(marker) },
|
|
160
|
+
children: /* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: "relative inline-flex h-4 w-4 items-center justify-center rounded-full bg-(--kz-marker)", children: /* @__PURE__ */ jsx2(RadioPrimitive.Indicator, { forceMount: true, className: "hidden h-full w-full items-center justify-center data-[state=checked]:flex", children: /* @__PURE__ */ jsx2("svg", { viewBox: "0 0 24 24", className: "h-3 w-3 text-surface-0", fill: "none", stroke: "currentColor", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx2("path", { d: "M20 6 9 17l-5-5" }) }) }) })
|
|
161
|
+
},
|
|
162
|
+
marker
|
|
163
|
+
))
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
100
168
|
export {
|
|
101
169
|
chip,
|
|
102
170
|
ChipGroup,
|
|
103
|
-
Chip
|
|
171
|
+
Chip,
|
|
172
|
+
MARKERS,
|
|
173
|
+
TagMarker,
|
|
174
|
+
TagChip,
|
|
175
|
+
MarkerPicker
|
|
104
176
|
};
|
|
105
|
-
//# sourceMappingURL=chunk-
|
|
177
|
+
//# sourceMappingURL=chunk-BQ4EOR2O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/chip/chip.tsx","../src/chip/recipe.ts","../src/chip/tag-chip.tsx","../src/chip/markers.ts"],"sourcesContent":["// Client (a context). A chip is a pressable pill: alone it is a Radix Toggle (aria-pressed), inside `Chip.Group` an\n// item of a Radix Toggle Group (roving focus with the arrows; `single` = radio semantics, `multiple` = pressed\n// buttons). A `removable` chip is a static label with its own remove button (two buttons cannot nest).\nimport { Toggle as TogglePrimitive, ToggleGroup as ToggleGroupPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { useRouteBinding } from \"../router\";\nimport { chipRecipe } from \"./recipe\";\n\nexport const chip = tv(chipRecipe);\n\nexport type ChipVariants = VariantProps<typeof chip>;\n\ntype GroupContext = { size: ChipVariants[\"size\"] };\nconst ChipGroupContext = React.createContext<GroupContext | null>(null);\n\nfunction RemoveIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" className=\"h-3.5 w-3.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n );\n}\n\ntype ToggleChipProps = Omit<React.ComponentProps<\"button\">, \"value\" | \"defaultValue\"> &\n ChipVariants & {\n /**\n * sm · md (inside `Chip.Group`, the group's size by default).\n * @default \"md\"\n */\n size?: ChipVariants[\"size\"];\n /** Inside `Chip.Group`: the value this chip stands for (required there, ignored alone). */\n value?: string;\n /** Alone: pressed or not (`defaultSelected` uncontrolled), `onSelectedChange` on every press. */\n selected?: boolean;\n /** Alone: pressed at first, uncontrolled. */\n defaultSelected?: boolean;\n /** Alone: called with the new state on every press. */\n onSelectedChange?: (selected: boolean) => void;\n /** A pressable chip (the default); `true` makes it a static chip with a remove button. */\n removable?: false;\n };\n\ntype RemovableChipProps = Omit<React.ComponentProps<\"span\">, \"onSelect\"> &\n ChipVariants & {\n /** A static chip (a chosen tag, an applied filter) with a remove button. */\n removable: true;\n /** The accessible name of the remove button — passed translated, e.g. \"Remove #night\". */\n removeLabel: string;\n /** Runs when the remove button is pressed. */\n onRemove: () => void;\n /** Disables the remove button. */\n disabled?: boolean;\n };\n\nexport type ChipProps = ToggleChipProps | RemovableChipProps;\n\n/** A selectable pill (`selected` / `onSelectedChange`), an item of `Chip.Group` (`value`), or `removable`. */\nfunction ChipBase(props: ChipProps) {\n const group = React.useContext(ChipGroupContext);\n if (props.removable) {\n const { removable: _removable, removeLabel, onRemove, disabled, size, className, children, ...rest } = props;\n const s = chip({ size: size ?? group?.size });\n return (\n <span data-removable=\"\" className={s.base({ className })} {...rest}>\n {children}\n <button type=\"button\" aria-label={removeLabel} title={removeLabel} disabled={disabled} onClick={onRemove} className={s.remove()}>\n <RemoveIcon />\n </button>\n </span>\n );\n }\n const { removable: _removable, value, selected, defaultSelected, onSelectedChange, size, className, ...rest } = props;\n const s = chip({ size: size ?? group?.size });\n if (group) {\n if (value === undefined) throw new Error(\"Chip: a chip inside Chip.Group needs a `value`.\");\n return <ToggleGroupPrimitive.Item value={value} className={s.base({ className })} {...rest} />;\n }\n return (\n <TogglePrimitive.Root\n pressed={selected}\n defaultPressed={defaultSelected}\n onPressedChange={onSelectedChange}\n className={s.base({ className })}\n {...rest}\n />\n );\n}\n\ntype GroupBase = Omit<React.ComponentProps<\"div\">, \"defaultValue\" | \"dir\"> &\n ChipVariants & {\n /**\n * sm · md: the size of every chip of the group.\n * @default \"md\"\n */\n size?: ChipVariants[\"size\"];\n /** The group's accessible name — passed translated (\"Filter by format\"). */\n label?: string;\n /** The arrow keys that move: left / right (horizontal, a row) or up / down (vertical, a column). */\n orientation?: \"horizontal\" | \"vertical\";\n /** Arrow keys wrap from the last chip to the first (default `true`). */\n loop?: boolean;\n /** Disables every chip of the group. */\n disabled?: boolean;\n };\n\nexport type ChipGroupProps =\n | (GroupBase & {\n /** One choice: the chips behave as radios. */\n type: \"single\";\n /** The chosen value (controlled), `\"\"` when none. */\n value?: string;\n /** The value chosen at first, uncontrolled. */\n defaultValue?: string;\n /** Called with the new value on every choice. */\n onValueChange?: (value: string) => void;\n /** Keeps one chip selected: pressing the selected chip does not clear it (default `false`). */\n required?: boolean;\n /** Binds the choice to this search parameter of the URL (`?type=…`): the URL is the state. Without it the state is local — only for an ephemeral choice. */\n routeKey?: string;\n /** The values the parameter may hold (the chips' `value`s). */\n routeValues?: readonly string[];\n })\n | (GroupBase & {\n /** Any number of choices: the chips are pressed buttons. */\n type: \"multiple\";\n /** The chosen values (controlled). */\n value?: string[];\n /** The values chosen at first, uncontrolled. */\n defaultValue?: string[];\n /** Called with the new values on every press. */\n onValueChange?: (value: string[]) => void;\n required?: never;\n routeKey?: never;\n routeValues?: never;\n });\n\n/** Chips that choose together: `type` single · multiple, `value`/`defaultValue` + `onValueChange`. */\nexport function ChipGroup({ label, size, className, children, ...props }: ChipGroupProps) {\n const single = props.type === \"single\" ? props : undefined;\n const routed = useRouteBinding(single?.routeKey, single?.routeValues, { value: single?.value, defaultValue: single?.defaultValue, onValueChange: single?.onValueChange });\n const s = chip({ size });\n const context = React.useMemo(() => ({ size }), [size]);\n const common = { \"aria-label\": label, className: s.group({ className }) };\n let group: React.ReactNode;\n if (props.type === \"single\") {\n const { type: _type, value: _value, defaultValue: _defaultValue, onValueChange: _onValueChange, required, routeKey: _routeKey, routeValues: _routeValues, ...rest } = props;\n group = <SingleGroup {...rest} {...common} value={routed.value} defaultValue={routed.defaultValue} onValueChange={routed.onValueChange} required={required}>{children}</SingleGroup>;\n } else {\n const { type: _type, required: _required, ...rest } = props;\n group = (\n <ToggleGroupPrimitive.Root type=\"multiple\" {...rest} {...common}>\n {children}\n </ToggleGroupPrimitive.Root>\n );\n }\n return <ChipGroupContext.Provider value={context}>{group}</ChipGroupContext.Provider>;\n}\n\n/** Radix's single group, plus `required`: the value is held here so that an empty change can be refused. */\nfunction SingleGroup({\n value,\n defaultValue,\n onValueChange,\n required,\n ...props\n}: Omit<GroupBase, \"size\" | \"label\"> & {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n required?: boolean;\n}) {\n const [inner, setInner] = React.useState(defaultValue ?? \"\");\n const current = value ?? inner;\n return (\n <ToggleGroupPrimitive.Root\n type=\"single\"\n value={current}\n onValueChange={(next) => {\n if (required && !next) return;\n if (value === undefined) setInner(next);\n onValueChange?.(next);\n }}\n {...props}\n />\n );\n}\n\n/** `Chip` (selectable, removable) and `Chip.Group` (single · multiple). */\nexport const Chip = Object.assign(ChipBase, { Group: ChipGroup });\n","// The chip's parts and sizes, written once as classes of the Krizaka tokens: the web wears them with `tv(chipRecipe)`,\n// React Native reads the same classes into styles (native/chip.tsx). `data-[state=on]:` is the chosen chip.\nimport { defineRecipe } from \"../recipes/define\";\n\nexport const chipRecipe = defineRecipe({\n slots: {\n group: \"flex flex-wrap items-center gap-2 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch\",\n base:\n \"inline-flex shrink-0 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-sm border font-semibold transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40 \" +\n \"border-border-default bg-surface-1 text-fg-secondary hover:border-border-strong hover:text-fg \" +\n \"data-[state=on]:border-accent data-[state=on]:bg-accent-soft data-[state=on]:text-fg\",\n remove:\n \"-mr-1.5 inline-flex h-6 w-6 items-center justify-center rounded-full text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n variants: {\n size: { sm: { base: \"h-7 px-3 text-xs\" }, md: { base: \"h-9 px-3.5 text-xs\" } },\n },\n defaultVariants: { size: \"md\" },\n});\n","// Client (a Radix radio group, and `Chip`'s context). The tags of a workspace (krizaka-ts#89, `@krizaka/organize`): a name\n// with a colour marker beside it. The marker is a NAME of the closed palette (`MARKERS`: blue · green · amber · red ·\n// violet · gray), mapped to `--kz-tag-<name>` — a dot (≥ 3:1) or Yomizaka's bookmark ribbon. It sits beside the name and\n// never fills the chip, and the name is always written: the colour is never the only signal.\nimport type { Marker } from \"@krizaka/organize/contract\";\nimport { RadioGroup as RadioPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Chip, type ChipProps } from \"./chip\";\nimport { TAG_MARKERS } from \"./markers\";\n\n/** The six names of the closed palette (`@krizaka/organize` `MARKERS`; a test keeps them equal). */\nexport const MARKERS: readonly Marker[] = TAG_MARKERS;\nexport type { Marker };\n\n/** The marker's shape: a `dot`, or the `ribbon` (a bookmark: a rectangle with a notch at the bottom). */\nexport type MarkerShape = \"dot\" | \"ribbon\";\n\n/** The CSS custom property the marker reads its colour from: `--kz-tag-<name>`. */\nconst markerVar = (marker: Marker) => `var(--kz-tag-${marker})`;\n\nexport type TagMarkerProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n /** A name of the closed palette. */\n marker: Marker;\n /**\n * dot · ribbon.\n * @default \"dot\"\n */\n shape?: MarkerShape;\n};\n\n/** The marker alone, decorative (`aria-hidden`): put the tag's name beside it. */\nexport function TagMarker({ marker, shape = \"dot\", className, style, ...props }: TagMarkerProps) {\n return (\n <span\n aria-hidden\n data-marker={marker}\n data-shape={shape}\n className={cn(\n \"inline-block shrink-0 bg-(--kz-marker) data-[shape=dot]:h-2.5 data-[shape=dot]:w-2.5 data-[shape=dot]:rounded-full\",\n \"data-[shape=ribbon]:h-3.5 data-[shape=ribbon]:w-2.5 data-[shape=ribbon]:[clip-path:polygon(0_0,100%_0,100%_100%,50%_72%,0_100%)]\",\n className,\n )}\n style={{ ...style, [\"--kz-marker\" as string]: markerVar(marker) }}\n {...props}\n />\n );\n}\n\nexport type TagChipProps = ChipProps & {\n /** The tag's marker: a name of the closed palette (`blue · green · amber · red · violet · gray`). */\n marker: Marker;\n /**\n * dot · ribbon.\n * @default \"dot\"\n */\n shape?: MarkerShape;\n};\n\n/**\n * A tag: its marker and its name. Alone a toggle (a filter), inside `Chip.Group` an item, or `removable` (a tag worn by a\n * file) — the behaviour of `Chip`, with the marker before the name.\n */\nexport function TagChip({ marker, shape, children, ...props }: TagChipProps) {\n const content = (\n <>\n <TagMarker marker={marker} shape={shape} />\n {children}\n </>\n );\n return <Chip {...(props as ChipProps)}>{content}</Chip>;\n}\n\nexport type MarkerPickerProps = {\n /** The group's accessible name (\"Colour of the tag\"), passed translated. */\n label: string;\n /** The name of each colour, passed translated: `{ blue: \"Blue\", … }`. The swatches are named, never colour alone. */\n names: Readonly<Record<Marker, string>>;\n /** The colour chosen (controlled). */\n value?: Marker;\n /** The colour chosen at first, uncontrolled. */\n defaultValue?: Marker;\n /** Called with the colour chosen. */\n onValueChange?: (value: Marker) => void;\n /** The colours offered (default: the six). */\n markers?: readonly Marker[];\n /** Not available. */\n disabled?: boolean;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** Recolours a tag from the closed palette: a radio group of swatches (arrow keys), the chosen one ticked and named. */\nexport function MarkerPicker({ label, names, value, defaultValue, onValueChange, markers = MARKERS, disabled, className }: MarkerPickerProps) {\n return (\n <RadioPrimitive.Root\n aria-label={label}\n value={value}\n defaultValue={defaultValue}\n onValueChange={(next) => onValueChange?.(next as Marker)}\n disabled={disabled}\n orientation=\"horizontal\"\n className={cn(\"flex flex-wrap items-center gap-1.5\", className)}\n >\n {markers.map((marker) => (\n <RadioPrimitive.Item\n key={marker}\n value={marker}\n aria-label={names[marker]}\n title={names[marker]}\n className={cn(\n \"inline-flex h-8 w-8 items-center justify-center rounded-full border border-border-default bg-surface-1 transition-colors\",\n \"hover:border-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40\",\n \"data-[state=checked]:border-(--kz-marker) data-[state=checked]:bg-surface-2\",\n )}\n style={{ [\"--kz-marker\" as string]: markerVar(marker) }}\n >\n <span aria-hidden className=\"relative inline-flex h-4 w-4 items-center justify-center rounded-full bg-(--kz-marker)\">\n <RadioPrimitive.Indicator forceMount className=\"hidden h-full w-full items-center justify-center data-[state=checked]:flex\">\n {/* The tick is the second signal: a shape, not a colour (it reads in the page's text colour on the swatch's ring). */}\n <svg viewBox=\"0 0 24 24\" className=\"h-3 w-3 text-surface-0\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"4\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </RadioPrimitive.Indicator>\n </span>\n </RadioPrimitive.Item>\n ))}\n </RadioPrimitive.Root>\n );\n}\n","// The six names of the closed palette of tag markers, written once for the platforms that cannot import\n// `@krizaka/organize/contract` (/native adds no dependency). A test keeps them equal to the contract's `MARKERS`.\nexport const TAG_MARKERS = [\"blue\", \"green\", \"amber\", \"red\", \"violet\", \"gray\"] as const;\n"],"mappings":";;;;;;;;;AAGA,SAAS,UAAU,iBAAiB,eAAe,4BAA4B;AAC/E,YAAY,WAAW;AACvB,SAAS,UAA6B;AAEtC,SAAS,uBAAuB;;;ACHzB,IAAM,aAAa,aAAa;AAAA,EACrC,OAAO;AAAA,IACL,OAAO;AAAA,IACP,MACE;AAAA,IAIF,QACE;AAAA,EAEJ;AAAA,EACA,UAAU;AAAA,IACR,MAAM,EAAE,IAAI,EAAE,MAAM,mBAAmB,GAA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