@krizaka/ui 3.63.0 → 3.64.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/dist/account-menu.d.ts +1 -1
- package/dist/account-menu.js +1 -1
- package/dist/account-settings.d.ts +61 -4
- package/dist/account-settings.js +207 -45
- package/dist/account-settings.js.map +1 -1
- package/dist/action-bar.js +4 -4
- package/dist/analysis-report.d.ts +274 -0
- package/dist/analysis-report.js +207 -0
- package/dist/analysis-report.js.map +1 -0
- package/dist/app-header.d.ts +3 -3
- package/dist/argument-card.d.ts +1 -1
- package/dist/argument-card.js +5 -5
- package/dist/avatar/defaults.d.ts +16 -5
- package/dist/avatar/defaults.js +15 -1
- package/dist/avatar/defaults.js.map +1 -1
- package/dist/{avatar-BL2iG_Js.d.ts → avatar-BdZcfkWR.d.ts} +11 -4
- package/dist/avatar.d.ts +16 -5
- package/dist/avatar.js +15 -1
- package/dist/avatar.js.map +1 -1
- package/dist/badge.js +4 -34
- package/dist/badge.js.map +1 -1
- package/dist/blocks.css +99 -8
- package/dist/button.js +1 -1
- package/dist/captcha.js +1 -1
- package/dist/chat.js +1 -1
- package/dist/chunk-5PFCELGW.js +41 -0
- package/dist/chunk-5PFCELGW.js.map +1 -0
- package/dist/chunk-5RWHDX5J.js +37 -0
- package/dist/chunk-5RWHDX5J.js.map +1 -0
- package/dist/{chunk-5LANVCK7.js → chunk-BG5APGX6.js} +2 -2
- package/dist/{chunk-WOZP3JLW.js → chunk-DJ5ZPPWL.js} +1 -1
- package/dist/chunk-DJ5ZPPWL.js.map +1 -0
- package/dist/{chunk-UV4HBVH7.js → chunk-EB45EVPJ.js} +2 -2
- package/dist/{chunk-SJS6RJIT.js.map → chunk-EB45EVPJ.js.map} +1 -1
- package/dist/chunk-EUJ7337V.js +137 -0
- package/dist/chunk-EUJ7337V.js.map +1 -0
- package/dist/{chunk-6EAHUURY.js → chunk-GHAN7OOE.js} +2 -2
- package/dist/chunk-HK525THY.js +139 -0
- package/dist/chunk-HK525THY.js.map +1 -0
- package/dist/chunk-JT7ZKZT5.js +1 -0
- package/dist/chunk-JT7ZKZT5.js.map +1 -0
- package/dist/{chunk-3DHNN5V7.js → chunk-M3GEYLMR.js} +2 -2
- package/dist/{chunk-3DHNN5V7.js.map → chunk-M3GEYLMR.js.map} +1 -1
- package/dist/{chunk-7J2L4HOD.js → chunk-MTVX4RRF.js} +2 -2
- package/dist/{chunk-7J2L4HOD.js.map → chunk-MTVX4RRF.js.map} +1 -1
- package/dist/{chunk-YKEIOYJ5.js → chunk-NPMGYLJV.js} +1 -1
- package/dist/chunk-NPMGYLJV.js.map +1 -0
- package/dist/{chunk-HEKDKM5Y.js → chunk-QVHSV6RA.js} +1 -1
- package/dist/{chunk-7JG3VR4C.js → chunk-RCKXJEDQ.js} +5 -5
- package/dist/{chunk-3D2YI63L.js → chunk-SHBYNQFS.js} +7 -2
- package/dist/{chunk-3D2YI63L.js.map → chunk-SHBYNQFS.js.map} +1 -1
- package/dist/chunk-U4XTZMB7.js +103 -0
- package/dist/chunk-U4XTZMB7.js.map +1 -0
- package/dist/{chunk-SJS6RJIT.js → chunk-V7W4RLRW.js} +2 -2
- package/dist/{chunk-UV4HBVH7.js.map → chunk-V7W4RLRW.js.map} +1 -1
- package/dist/command.js +2 -2
- package/dist/confirm-button.js +1 -1
- package/dist/continue-prompt.js +1 -1
- package/dist/continue-prompt.js.map +1 -1
- package/dist/cover-hero.js +1 -1
- package/dist/dashboard-layout.js +2 -1
- package/dist/dashboard-layout.js.map +1 -1
- package/dist/data-table.js +2 -2
- package/dist/date-picker.d.ts +15 -15
- package/dist/dialog.js +2 -2
- package/dist/docs-layout.js +1 -1
- package/dist/embed-facade.d.ts +37 -0
- package/dist/embed-facade.js +96 -0
- package/dist/embed-facade.js.map +1 -0
- package/dist/file-upload.d.ts +2 -2
- package/dist/force-update-screen.js +1 -1
- package/dist/genui.js +2 -2
- package/dist/kind-config-editor.js +1 -1
- package/dist/link-card.js +2 -2
- package/dist/maintenance-screen.js +1 -1
- package/dist/map.js +6 -0
- package/dist/map.js.map +1 -1
- package/dist/margin-layout.d.ts +71 -0
- package/dist/margin-layout.js +29 -0
- package/dist/margin-layout.js.map +1 -0
- package/dist/match-dialog.js +2 -2
- package/dist/media-grid.d.ts +8 -3
- package/dist/media-grid.js +2 -2
- package/dist/meter.js +2 -1
- package/dist/native/map.js +6 -0
- package/dist/native/map.js.map +1 -1
- package/dist/native.d.ts +96 -5
- package/dist/native.js +1718 -1529
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.js +1 -1
- package/dist/page-DPHDmDAQ.d.ts +131 -0
- package/dist/page-hero.js +4 -4
- package/dist/page.d.ts +7 -125
- package/dist/page.js +13 -1
- package/dist/page.js.map +1 -1
- package/dist/quota-meter.js +2 -1
- package/dist/quota-meter.js.map +1 -1
- package/dist/retro-tv.d.ts +6 -3
- package/dist/retro-tv.js +6 -5
- package/dist/retro-tv.js.map +1 -1
- package/dist/reviews.d.ts +49 -0
- package/dist/reviews.js +66 -0
- package/dist/reviews.js.map +1 -0
- package/dist/separator.d.ts +26 -3
- package/dist/separator.js +19 -1
- package/dist/separator.js.map +1 -1
- package/dist/service-card.d.ts +56 -63
- package/dist/service-card.js +49 -10
- package/dist/service-card.js.map +1 -1
- package/dist/settings-layout.js +1 -1
- package/dist/site-cahier.js +1 -1
- package/dist/specimen-tag.d.ts +15 -3
- package/dist/specimen-tag.js +4 -27
- package/dist/specimen-tag.js.map +1 -1
- package/dist/stat.d.ts +87 -5
- package/dist/stat.js +9 -53
- package/dist/stat.js.map +1 -1
- package/dist/sticky-action.d.ts +7 -2
- package/dist/sticky-action.js +24 -3
- package/dist/sticky-action.js.map +1 -1
- package/dist/theme.js +1 -1
- package/dist/update-prompt.js +1 -1
- package/dist/usage.d.ts +229 -0
- package/dist/usage.js +189 -0
- package/dist/usage.js.map +1 -0
- package/dist/vertical-video.js +2 -2
- package/dist/wall.d.ts +24 -12
- package/dist/wall.js +106 -43
- package/dist/wall.js.map +1 -1
- package/package.json +92 -13
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +67 -6
- 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/analysis-report.json +445 -0
- 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 +3 -3
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +6 -5
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +2 -2
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- 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 +1 -1
- 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 +2 -2
- package/registry/data-table.json +1 -1
- 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 +1 -1
- 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 +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/embed-facade.json +243 -0
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/account-settings/avatar-picker-folder.d.ts +4 -0
- package/registry/examples/account-settings/avatar-picker-folder.js +27 -0
- package/registry/examples/account-settings/avatar-picker-folder.tsx +23 -0
- package/registry/examples/analysis-report/document-validation.d.ts +4 -0
- package/registry/examples/analysis-report/document-validation.js +47 -0
- package/registry/examples/analysis-report/document-validation.tsx +29 -0
- package/registry/examples/analysis-report/native/document-validation.d.ts +4 -0
- package/registry/examples/analysis-report/native/document-validation.dark.png +0 -0
- package/registry/examples/analysis-report/native/document-validation.js +48 -0
- package/registry/examples/analysis-report/native/document-validation.light.png +0 -0
- package/registry/examples/analysis-report/native/document-validation.tsx +32 -0
- package/registry/examples/analysis-report/streaming.d.ts +4 -0
- package/registry/examples/analysis-report/streaming.js +42 -0
- package/registry/examples/analysis-report/streaming.tsx +23 -0
- package/registry/examples/embed-facade/tiktok.d.ts +4 -0
- package/registry/examples/embed-facade/tiktok.js +20 -0
- package/registry/examples/embed-facade/tiktok.tsx +16 -0
- package/registry/examples/embed-facade/youtube.d.ts +4 -0
- package/registry/examples/embed-facade/youtube.js +22 -0
- package/registry/examples/embed-facade/youtube.tsx +20 -0
- package/registry/examples/margin-layout/findings.d.ts +4 -0
- package/registry/examples/margin-layout/findings.js +15 -0
- package/registry/examples/margin-layout/findings.tsx +18 -0
- package/registry/examples/margin-layout/steps.d.ts +4 -0
- package/registry/examples/margin-layout/steps.js +15 -0
- package/registry/examples/margin-layout/steps.tsx +16 -0
- package/registry/examples/page/kraft.d.ts +4 -0
- package/registry/examples/page/kraft.js +14 -0
- package/registry/examples/page/kraft.tsx +12 -0
- package/registry/examples/page/papers.d.ts +4 -0
- package/registry/examples/page/papers.js +14 -0
- package/registry/examples/page/papers.tsx +13 -0
- package/registry/examples/retro-tv/facade.d.ts +4 -0
- package/registry/examples/retro-tv/facade.js +12 -0
- package/registry/examples/retro-tv/facade.tsx +13 -0
- package/registry/examples/reviews/card.d.ts +4 -0
- package/registry/examples/reviews/card.js +23 -0
- package/registry/examples/reviews/card.tsx +19 -0
- package/registry/examples/reviews/summary.d.ts +4 -0
- package/registry/examples/reviews/summary.js +23 -0
- package/registry/examples/reviews/summary.tsx +17 -0
- package/registry/examples/separator/hand.d.ts +4 -0
- package/registry/examples/separator/hand.js +19 -0
- package/registry/examples/separator/hand.tsx +16 -0
- package/registry/examples/service-card/index-card.d.ts +4 -0
- package/registry/examples/service-card/index-card.js +15 -0
- package/registry/examples/service-card/index-card.tsx +12 -0
- package/registry/examples/service-card/index-list.d.ts +4 -0
- package/registry/examples/service-card/index-list.js +14 -0
- package/registry/examples/service-card/index-list.tsx +11 -0
- package/registry/examples/specimen-tag/facts.d.ts +4 -0
- package/registry/examples/specimen-tag/facts.js +23 -0
- package/registry/examples/specimen-tag/facts.tsx +18 -0
- package/registry/examples/stat/strip.d.ts +4 -0
- package/registry/examples/stat/strip.js +25 -0
- package/registry/examples/stat/strip.tsx +25 -0
- package/registry/examples/sticky-action/hide-while-visible.d.ts +4 -0
- package/registry/examples/sticky-action/hide-while-visible.js +16 -0
- package/registry/examples/sticky-action/hide-while-visible.tsx +17 -0
- package/registry/examples/usage/credits-page.d.ts +4 -0
- package/registry/examples/usage/credits-page.js +45 -0
- package/registry/examples/usage/credits-page.tsx +40 -0
- package/registry/examples/usage/empty.d.ts +4 -0
- package/registry/examples/usage/empty.js +15 -0
- package/registry/examples/usage/empty.tsx +12 -0
- package/registry/examples/wall/brick.js +1 -1
- package/registry/examples/wall/brick.tsx +1 -1
- package/registry/examples/wall/composition-fr.js +1 -1
- package/registry/examples/wall/composition-fr.tsx +1 -1
- package/registry/examples/wall/composition.js +1 -1
- package/registry/examples/wall/composition.tsx +1 -1
- package/registry/examples/wall/pinned-note.js +2 -2
- package/registry/examples/wall/pinned-note.tsx +3 -2
- package/registry/examples/wall/plaster.js +1 -1
- package/registry/examples/wall/plaster.tsx +1 -1
- package/registry/examples/wall/ridge.js +1 -1
- package/registry/examples/wall/ridge.tsx +1 -1
- package/registry/examples/wall/shop-sign.js +5 -4
- package/registry/examples/wall/shop-sign.tsx +7 -4
- package/registry/examples/wall/zellige.js +1 -1
- package/registry/examples/wall/zellige.tsx +1 -1
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- 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 +1 -1
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +186 -18
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- 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/margin-layout.json +200 -0
- 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 +53 -11
- 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 +45 -29
- package/registry/reviews.json +361 -0
- 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 +71 -6
- package/registry/service-card.json +55 -6
- package/registry/settings-layout.json +1 -1
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- 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 +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +57 -5
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +61 -9
- package/registry/status-chip.json +1 -1
- 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 +27 -4
- 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 +1 -1
- 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 +1 -1
- 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/usage.json +542 -0
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +3 -3
- package/registry/virtual.json +1 -1
- package/registry/wall.json +128 -40
- package/registry/waveform.json +1 -1
- package/dist/chunk-7AZ23BUX.js +0 -88
- package/dist/chunk-7AZ23BUX.js.map +0 -1
- package/dist/chunk-PW2FVPTV.js +0 -85
- package/dist/chunk-PW2FVPTV.js.map +0 -1
- package/dist/chunk-WOZP3JLW.js.map +0 -1
- package/dist/chunk-YKEIOYJ5.js.map +0 -1
- /package/dist/{chunk-5LANVCK7.js.map → chunk-BG5APGX6.js.map} +0 -0
- /package/dist/{chunk-6EAHUURY.js.map → chunk-GHAN7OOE.js.map} +0 -0
- /package/dist/{chunk-HEKDKM5Y.js.map → chunk-QVHSV6RA.js.map} +0 -0
- /package/dist/{chunk-7JG3VR4C.js.map → chunk-RCKXJEDQ.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/reviews/reviews.tsx"],"sourcesContent":["// Server-safe. The clients' word on a shop (krizaka-ui#606): a score you can trust. `ReviewSummary` — the score as a stamp,\n// the count with « verified », five meters for the distribution and the text equivalent — and `ReviewCard`, one review with\n// the owner's reply indented. All words are props. Never a « /20 »: that is `GradeStamp`'s school register.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Meter } from \"../meter/meter\";\nimport { Stamp } from \"../specimen-tag/specimen-tag\";\n\nexport interface ReviewSummaryProps extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n /** The score, 0 to 5 (the host's, already fair: the Bayesian average of the verified reviews). Drawn by `scoreText`. */\n score: number;\n /** How many verified reviews stand behind it. */\n count: number;\n /** How many reviews per rating, `[1 star … 5 stars]`. */\n distribution: readonly [number, number, number, number, number];\n /** Renders nothing under this many reviews: a score from two people is not a score. @default 1 */\n minCount?: number;\n /** The stamp's text, formatted for the reader (\"4,8 / 5\"). */\n scoreText: string;\n /** The count with its « verified » (\"27 avis vérifiés\"). */\n countText: string;\n /** The whole thing in one sentence, for assistive technology (\"4,8 sur 5, 27 avis vérifiés\"). */\n summaryText: string;\n /** The name and value of one distribution meter (\"5 étoiles : 20 avis\"). */\n starText: (stars: number, count: number) => string;\n}\n\n/** The score of a shop as a stamp, with the distribution of its verified reviews: nothing under the host's minimum. */\nexport function ReviewSummary({ score, count, distribution, minCount = 1, scoreText, countText, summaryText, starText, className, ...props }: ReviewSummaryProps) {\n const id = React.useId();\n if (count < Math.max(1, minCount) || Number.isNaN(count)) return null;\n return (\n <div role=\"group\" aria-labelledby={id} data-score={score} className={cn(\"kz-reviews\", className)} {...props}>\n <span id={id} className=\"sr-only\">{summaryText}</span>\n <p className=\"kz-reviews-visual\" aria-hidden=\"true\">\n <Stamp tone=\"ink\" data-figure=\"\">{scoreText}</Stamp>\n <span className=\"kz-reviews-count\">{countText}</span>\n </p>\n <ul className=\"kz-reviews-bars\">\n {[5, 4, 3, 2, 1].map((stars) => {\n const n = distribution[stars - 1] ?? 0;\n return (\n <li key={stars}>\n <span className=\"kz-reviews-rank\" aria-hidden=\"true\">{stars} ★</span>\n <Meter label={starText(stars, n)} value={n} min={0} max={count} valueText={starText(stars, n)} size=\"sm\" />\n <span className=\"kz-reviews-n\" aria-hidden=\"true\">{n}</span>\n </li>\n );\n })}\n </ul>\n </div>\n );\n}\n\nexport interface ReviewCardProps extends Omit<React.ComponentProps<\"article\">, \"children\"> {\n /** First name and initial (\"Camille L.\"). */\n author: string;\n /** The month, formatted for the reader (\"octobre 2026\"). */\n date: string;\n /** The machine-readable date of `date` (\"2026-10\"). */\n dateTime: string;\n /** The service reviewed. */\n service?: string;\n /** The rating, 1 to 5. */\n rating: number;\n /** The rating in words (\"5 sur 5\"). */\n ratingText: string;\n /** The review. */\n text: string;\n /** The owner's reply, indented under the review. */\n reply?: { label: string; author: string; text: string };\n}\n\nconst STAR = \"M8 1.6l1.9 4.1 4.5.5-3.3 3 .9 4.4L8 11.4 4 13.6l.9-4.4-3.3-3 4.5-.5Z\";\n\n/** One review: who, when, which service, the rating and the words — and the owner's reply. */\nexport function ReviewCard({ author, date, dateTime, service, rating, ratingText, text, reply, className, ...props }: ReviewCardProps) {\n const filled = Math.min(5, Math.max(0, Math.round(rating)));\n return (\n <article className={cn(\"kz-review\", className)} {...props}>\n <header className=\"kz-review-head\">\n <p className=\"kz-review-author\">{author}</p>\n <p className=\"kz-review-meta\">\n <time dateTime={dateTime}>{date}</time>\n {service && <span>{service}</span>}\n </p>\n <p className=\"kz-review-rating\">\n <span className=\"kz-review-stars\" aria-hidden=\"true\">\n {[1, 2, 3, 4, 5].map((n) => (\n <svg key={n} viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" focusable=\"false\" data-filled={n <= filled ? \"\" : undefined}><path d={STAR} /></svg>\n ))}\n </span>\n <span className=\"sr-only\">{ratingText}</span>\n </p>\n </header>\n <p className=\"kz-review-text\">{text}</p>\n {reply && (\n <div className=\"kz-review-reply\">\n <p className=\"kz-review-reply-label\">{reply.label} · {reply.author}</p>\n <p className=\"kz-review-reply-text\">{reply.text}</p>\n </div>\n )}\n </article>\n );\n}\n"],"mappings":";;;;;;;;;;;AAGA,YAAY,WAAW;AA+BjB,cACA,YADA;AALC,SAAS,cAAc,EAAE,OAAO,OAAO,cAAc,WAAW,GAAG,WAAW,WAAW,aAAa,UAAU,WAAW,GAAG,MAAM,GAAuB;AAChK,QAAM,KAAW,YAAM;AACvB,MAAI,QAAQ,KAAK,IAAI,GAAG,QAAQ,KAAK,OAAO,MAAM,KAA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B,gBAAK;AAAA,QAC/B,WAAW,oBAAC,UAAM,mBAAQ;AAAA,SAC7B;AAAA,MACA,qBAAC,OAAE,WAAU,oBACX;AAAA,4BAAC,UAAK,WAAU,mBAAkB,eAAY,QAC3C,WAAC,GAAG,GAAG,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MACpB,oBAAC,SAAY,SAAQ,aAAY,OAAM,MAAK,QAAO,MAAK,WAAU,SAAQ,eAAa,KAAK,SAAS,KAAK,QAAW,8BAAC,UAAK,GAAG,MAAM,KAA1H,CAA4H,CACvI,GACH;AAAA,QACA,oBAAC,UAAK,WAAU,WAAW,sBAAW;AAAA,SACxC;AAAA,OACF;AAAA,IACA,oBAAC,OAAE,WAAU,kBAAkB,gBAAK;AAAA,IACnC,SACC,qBAAC,SAAI,WAAU,mBACb;AAAA,2BAAC,OAAE,WAAU,yBAAyB;AAAA,cAAM;AAAA,QAAM;AAAA,QAAI,MAAM;AAAA,SAAO;AAAA,MACnE,oBAAC,OAAE,WAAU,wBAAwB,gBAAM,MAAK;AAAA,OAClD;AAAA,KAEJ;AAEJ;","names":[]}
|
package/dist/separator.d.ts
CHANGED
|
@@ -18,8 +18,31 @@ declare const separatorVariants: tailwind_variants.TVReturnType<{
|
|
|
18
18
|
vertical: "h-full w-px self-stretch";
|
|
19
19
|
};
|
|
20
20
|
}, undefined>>;
|
|
21
|
-
|
|
22
|
-
declare
|
|
21
|
+
/** The three hand-drawn shapes, in a 100 x 6 box that is stretched to the width: fixed paths, so the same shape always draws the same line. */
|
|
22
|
+
declare const HAND_SHAPES: {
|
|
23
|
+
readonly stroke: "M0 3.4C9 2.1 17 4.4 28 3.2S47 1.9 58 3.3 79 4.4 89 2.9L100 3.1";
|
|
24
|
+
readonly wave: "M0 3Q4 0.6 8 3T16 3 24 3 32 3 40 3 48 3 56 3 64 3 72 3 80 3 88 3 96 3 100 3";
|
|
25
|
+
readonly dash: "M1 3.2H11M16 2.8H31M36 3.3H44M50 2.9H67M72 3.2H80M86 2.8H99";
|
|
26
|
+
};
|
|
27
|
+
type HandShape = keyof typeof HAND_SHAPES;
|
|
28
|
+
type SeparatorProps = React.ComponentProps<typeof Separator$1.Root> & {
|
|
29
|
+
/**
|
|
30
|
+
* `line` — a hairline; `hand` — drawn by hand (horizontal only).
|
|
31
|
+
* @default "line"
|
|
32
|
+
*/
|
|
33
|
+
variant?: "line" | "hand";
|
|
34
|
+
/**
|
|
35
|
+
* `variant="hand"`: the stroke's shape.
|
|
36
|
+
* @default "stroke"
|
|
37
|
+
*/
|
|
38
|
+
shape?: HandShape;
|
|
39
|
+
/**
|
|
40
|
+
* `variant="hand"`: the page's hue at 60 %, or the ink.
|
|
41
|
+
* @default "hue"
|
|
42
|
+
*/
|
|
43
|
+
tone?: "hue" | "ink";
|
|
44
|
+
};
|
|
45
|
+
declare function Separator({ orientation, decorative, variant, shape, tone, className, ...props }: SeparatorProps): React.JSX.Element;
|
|
23
46
|
|
|
24
47
|
export { Separator, separatorVariants };
|
|
25
|
-
export type { SeparatorProps };
|
|
48
|
+
export type { HandShape, SeparatorProps };
|
package/dist/separator.js
CHANGED
|
@@ -7,7 +7,25 @@ var separatorVariants = tv({
|
|
|
7
7
|
variants: { orientation: { horizontal: "h-px w-full", vertical: "h-full w-px self-stretch" } },
|
|
8
8
|
defaultVariants: { orientation: "horizontal" }
|
|
9
9
|
});
|
|
10
|
-
|
|
10
|
+
var handVariants = tv({
|
|
11
|
+
base: "block h-1.5 w-full shrink-0 overflow-hidden",
|
|
12
|
+
variants: {
|
|
13
|
+
tone: {
|
|
14
|
+
hue: "text-[color-mix(in_srgb,var(--kz-hue,var(--kz-accent))_60%,transparent)]",
|
|
15
|
+
ink: "text-fg"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: { tone: "hue" }
|
|
19
|
+
});
|
|
20
|
+
var HAND_SHAPES = {
|
|
21
|
+
stroke: "M0 3.4C9 2.1 17 4.4 28 3.2S47 1.9 58 3.3 79 4.4 89 2.9L100 3.1",
|
|
22
|
+
wave: "M0 3Q4 0.6 8 3T16 3 24 3 32 3 40 3 48 3 56 3 64 3 72 3 80 3 88 3 96 3 100 3",
|
|
23
|
+
dash: "M1 3.2H11M16 2.8H31M36 3.3H44M50 2.9H67M72 3.2H80M86 2.8H99"
|
|
24
|
+
};
|
|
25
|
+
function Separator({ orientation = "horizontal", decorative = true, variant = "line", shape = "stroke", tone = "hue", className, ...props }) {
|
|
26
|
+
if (variant === "hand") {
|
|
27
|
+
return /* @__PURE__ */ jsx(SeparatorPrimitive.Root, { orientation: "horizontal", decorative, "data-variant": "hand", "data-shape": shape, "data-tone": tone, className: handVariants({ tone, className }), ...props, children: /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 100 6", preserveAspectRatio: "none", width: "100%", height: "6", className: "block h-1.5 w-full", children: /* @__PURE__ */ jsx("path", { d: HAND_SHAPES[shape], fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "square", strokeLinejoin: "miter", vectorEffect: "non-scaling-stroke" }) }) });
|
|
28
|
+
}
|
|
11
29
|
return /* @__PURE__ */ jsx(SeparatorPrimitive.Root, { orientation, decorative, className: separatorVariants({ orientation, className }), ...props });
|
|
12
30
|
}
|
|
13
31
|
export {
|
package/dist/separator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/separator/separator.tsx"],"sourcesContent":["// Server-safe. A line between groups: decorative by default (hidden from assistive technology), or a real\n// `role=\"separator\"` with `decorative={false}
|
|
1
|
+
{"version":3,"sources":["../src/separator/separator.tsx"],"sourcesContent":["// Server-safe. A line between groups: decorative by default (hidden from assistive technology), or a real\n// `role=\"separator\"` with `decorative={false}`. `variant=\"hand\"` draws it by hand (Cahier): three shapes, one inline SVG\n// path stretched to the width, 6 px tall.\nimport { Separator as SeparatorPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const separatorVariants = tv({\n base: \"shrink-0 bg-border-default\",\n variants: { orientation: { horizontal: \"h-px w-full\", vertical: \"h-full w-px self-stretch\" } },\n defaultVariants: { orientation: \"horizontal\" },\n});\n\nconst handVariants = tv({\n base: \"block h-1.5 w-full shrink-0 overflow-hidden\",\n variants: {\n tone: {\n hue: \"text-[color-mix(in_srgb,var(--kz-hue,var(--kz-accent))_60%,transparent)]\",\n ink: \"text-fg\",\n },\n },\n defaultVariants: { tone: \"hue\" },\n});\n\n/** The three hand-drawn shapes, in a 100 x 6 box that is stretched to the width: fixed paths, so the same shape always draws the same line. */\nexport const HAND_SHAPES = {\n stroke: \"M0 3.4C9 2.1 17 4.4 28 3.2S47 1.9 58 3.3 79 4.4 89 2.9L100 3.1\",\n wave: \"M0 3Q4 0.6 8 3T16 3 24 3 32 3 40 3 48 3 56 3 64 3 72 3 80 3 88 3 96 3 100 3\",\n dash: \"M1 3.2H11M16 2.8H31M36 3.3H44M50 2.9H67M72 3.2H80M86 2.8H99\",\n} as const;\nexport type HandShape = keyof typeof HAND_SHAPES;\n\nexport type SeparatorProps = React.ComponentProps<typeof SeparatorPrimitive.Root> & {\n /**\n * `line` — a hairline; `hand` — drawn by hand (horizontal only).\n * @default \"line\"\n */\n variant?: \"line\" | \"hand\";\n /**\n * `variant=\"hand\"`: the stroke's shape.\n * @default \"stroke\"\n */\n shape?: HandShape;\n /**\n * `variant=\"hand\"`: the page's hue at 60 %, or the ink.\n * @default \"hue\"\n */\n tone?: \"hue\" | \"ink\";\n};\n\nexport function Separator({ orientation = \"horizontal\", decorative = true, variant = \"line\", shape = \"stroke\", tone = \"hue\", className, ...props }: SeparatorProps) {\n if (variant === \"hand\") {\n return (\n <SeparatorPrimitive.Root orientation=\"horizontal\" decorative={decorative} data-variant=\"hand\" data-shape={shape} data-tone={tone} className={handVariants({ tone, className })} {...props}>\n <svg aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 100 6\" preserveAspectRatio=\"none\" width=\"100%\" height=\"6\" className=\"block h-1.5 w-full\">\n <path d={HAND_SHAPES[shape]} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"square\" strokeLinejoin=\"miter\" vectorEffect=\"non-scaling-stroke\" />\n </svg>\n </SeparatorPrimitive.Root>\n );\n }\n return <SeparatorPrimitive.Root orientation={orientation} decorative={decorative} className={separatorVariants({ orientation, className })} {...props} />;\n}\n"],"mappings":";AAGA,SAAS,aAAa,0BAA0B;AAEhD,SAAS,UAAU;AAkDT;AAhDH,IAAM,oBAAoB,GAAG;AAAA,EAClC,MAAM;AAAA,EACN,UAAU,EAAE,aAAa,EAAE,YAAY,eAAe,UAAU,2BAA2B,EAAE;AAAA,EAC7F,iBAAiB,EAAE,aAAa,aAAa;AAC/C,CAAC;AAED,IAAM,eAAe,GAAG;AAAA,EACtB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,KAAK;AAAA,MACL,KAAK;AAAA,IACP;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,MAAM,MAAM;AACjC,CAAC;AAGM,IAAM,cAAc;AAAA,EACzB,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AACR;AAqBO,SAAS,UAAU,EAAE,cAAc,cAAc,aAAa,MAAM,UAAU,QAAQ,QAAQ,UAAU,OAAO,OAAO,WAAW,GAAG,MAAM,GAAmB;AAClK,MAAI,YAAY,QAAQ;AACtB,WACE,oBAAC,mBAAmB,MAAnB,EAAwB,aAAY,cAAa,YAAwB,gBAAa,QAAO,cAAY,OAAO,aAAW,MAAM,WAAW,aAAa,EAAE,MAAM,UAAU,CAAC,GAAI,GAAG,OAClL,8BAAC,SAAI,eAAY,QAAO,WAAU,SAAQ,SAAQ,aAAY,qBAAoB,QAAO,OAAM,QAAO,QAAO,KAAI,WAAU,sBACzH,8BAAC,UAAK,GAAG,YAAY,KAAK,GAAG,MAAK,QAAO,QAAO,gBAAe,aAAY,OAAM,eAAc,UAAS,gBAAe,SAAQ,cAAa,sBAAqB,GACnK,GACF;AAAA,EAEJ;AACA,SAAO,oBAAC,mBAAmB,MAAnB,EAAwB,aAA0B,YAAwB,WAAW,kBAAkB,EAAE,aAAa,UAAU,CAAC,GAAI,GAAG,OAAO;AACzJ;","names":[]}
|
package/dist/service-card.d.ts
CHANGED
|
@@ -3,50 +3,22 @@ import * as React from 'react';
|
|
|
3
3
|
import { LinkComponent } from './chapter.js';
|
|
4
4
|
|
|
5
5
|
declare const serviceCard: tailwind_variants.TVReturnType<{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
tag?: tailwind_variants.ClassValue;
|
|
16
|
-
description?: tailwind_variants.ClassValue;
|
|
17
|
-
included?: tailwind_variants.ClassValue;
|
|
18
|
-
includedItem?: tailwind_variants.ClassValue;
|
|
19
|
-
foot?: tailwind_variants.ClassValue;
|
|
20
|
-
priceBlock?: tailwind_variants.ClassValue;
|
|
21
|
-
from?: tailwind_variants.ClassValue;
|
|
22
|
-
price?: tailwind_variants.ClassValue;
|
|
23
|
-
root?: tailwind_variants.ClassValue;
|
|
24
|
-
action?: tailwind_variants.ClassValue;
|
|
6
|
+
variant: {
|
|
7
|
+
default: {};
|
|
8
|
+
index: {
|
|
9
|
+
root: string;
|
|
10
|
+
body: string;
|
|
11
|
+
head: string;
|
|
12
|
+
name: string;
|
|
13
|
+
facts: string;
|
|
14
|
+
foot: string;
|
|
25
15
|
};
|
|
26
16
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
media?: tailwind_variants.ClassValue;
|
|
31
|
-
body?: tailwind_variants.ClassValue;
|
|
32
|
-
head?: tailwind_variants.ClassValue;
|
|
33
|
-
icon?: tailwind_variants.ClassValue;
|
|
34
|
-
titles?: tailwind_variants.ClassValue;
|
|
35
|
-
name?: tailwind_variants.ClassValue;
|
|
36
|
-
facts?: tailwind_variants.ClassValue;
|
|
37
|
-
tag?: tailwind_variants.ClassValue;
|
|
38
|
-
description?: tailwind_variants.ClassValue;
|
|
39
|
-
included?: tailwind_variants.ClassValue;
|
|
40
|
-
includedItem?: tailwind_variants.ClassValue;
|
|
41
|
-
foot?: tailwind_variants.ClassValue;
|
|
42
|
-
priceBlock?: tailwind_variants.ClassValue;
|
|
43
|
-
from?: tailwind_variants.ClassValue;
|
|
44
|
-
price?: tailwind_variants.ClassValue;
|
|
45
|
-
root?: tailwind_variants.ClassValue;
|
|
46
|
-
action?: tailwind_variants.ClassValue;
|
|
47
|
-
};
|
|
17
|
+
density: {
|
|
18
|
+
grid: {};
|
|
19
|
+
list: {};
|
|
48
20
|
};
|
|
49
|
-
}
|
|
21
|
+
}, {
|
|
50
22
|
root: string;
|
|
51
23
|
media: string;
|
|
52
24
|
body: string;
|
|
@@ -65,28 +37,22 @@ declare const serviceCard: tailwind_variants.TVReturnType<{
|
|
|
65
37
|
price: string;
|
|
66
38
|
action: string;
|
|
67
39
|
}, undefined, {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
tag?: tailwind_variants.ClassValue;
|
|
78
|
-
description?: tailwind_variants.ClassValue;
|
|
79
|
-
included?: tailwind_variants.ClassValue;
|
|
80
|
-
includedItem?: tailwind_variants.ClassValue;
|
|
81
|
-
foot?: tailwind_variants.ClassValue;
|
|
82
|
-
priceBlock?: tailwind_variants.ClassValue;
|
|
83
|
-
from?: tailwind_variants.ClassValue;
|
|
84
|
-
price?: tailwind_variants.ClassValue;
|
|
85
|
-
root?: tailwind_variants.ClassValue;
|
|
86
|
-
action?: tailwind_variants.ClassValue;
|
|
40
|
+
variant: {
|
|
41
|
+
default: {};
|
|
42
|
+
index: {
|
|
43
|
+
root: string;
|
|
44
|
+
body: string;
|
|
45
|
+
head: string;
|
|
46
|
+
name: string;
|
|
47
|
+
facts: string;
|
|
48
|
+
foot: string;
|
|
87
49
|
};
|
|
88
50
|
};
|
|
89
|
-
|
|
51
|
+
density: {
|
|
52
|
+
grid: {};
|
|
53
|
+
list: {};
|
|
54
|
+
};
|
|
55
|
+
}, {
|
|
90
56
|
root: string;
|
|
91
57
|
media: string;
|
|
92
58
|
body: string;
|
|
@@ -104,7 +70,23 @@ declare const serviceCard: tailwind_variants.TVReturnType<{
|
|
|
104
70
|
from: string;
|
|
105
71
|
price: string;
|
|
106
72
|
action: string;
|
|
107
|
-
}, tailwind_variants.TVReturnTypeLike<
|
|
73
|
+
}, tailwind_variants.TVReturnTypeLike<{
|
|
74
|
+
variant: {
|
|
75
|
+
default: {};
|
|
76
|
+
index: {
|
|
77
|
+
root: string;
|
|
78
|
+
body: string;
|
|
79
|
+
head: string;
|
|
80
|
+
name: string;
|
|
81
|
+
facts: string;
|
|
82
|
+
foot: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
density: {
|
|
86
|
+
grid: {};
|
|
87
|
+
list: {};
|
|
88
|
+
};
|
|
89
|
+
}, {
|
|
108
90
|
root: string;
|
|
109
91
|
media: string;
|
|
110
92
|
body: string;
|
|
@@ -154,6 +136,17 @@ type ServiceCardProps = Omit<React.ComponentProps<"article">, "title" | "childre
|
|
|
154
136
|
linkAs?: LinkComponent;
|
|
155
137
|
/** The way in, as a press (a client parent). Ignored when `href` is set. */
|
|
156
138
|
onSelect?: () => void;
|
|
139
|
+
/**
|
|
140
|
+
* `index` — the Cahier's stamped index card: a ruled card with a punched hole, straight, the duration and the price as
|
|
141
|
+
* stamps, a secondary button. The same props and the same accessible output; only the drawing changes.
|
|
142
|
+
* @default "default"
|
|
143
|
+
*/
|
|
144
|
+
variant?: "default" | "index";
|
|
145
|
+
/**
|
|
146
|
+
* `variant="index"`: `list` lays the card out as a row for a single column (the media on the left from `sm`).
|
|
147
|
+
* @default "grid"
|
|
148
|
+
*/
|
|
149
|
+
density?: "grid" | "list";
|
|
157
150
|
/**
|
|
158
151
|
* The heading level of the name.
|
|
159
152
|
* @default "h3"
|
|
@@ -163,7 +156,7 @@ type ServiceCardProps = Omit<React.ComponentProps<"article">, "title" | "childre
|
|
|
163
156
|
reveal?: number;
|
|
164
157
|
};
|
|
165
158
|
/** A service as a card: icon or photo, duration, price, what is included, the capacity, a tag — one way in. */
|
|
166
|
-
declare function ServiceCard({ name, price, priceFrom, duration, capacity, description, included, tag, icon, media, selected, actionLabel, href, linkAs, onSelect, titleAs: Title, reveal, className, style, ...props }: ServiceCardProps): React.JSX.Element;
|
|
159
|
+
declare function ServiceCard({ name, price, priceFrom, duration, capacity, description, included, tag, icon, media, selected, actionLabel, href, linkAs, onSelect, titleAs: Title, reveal, variant, density, className, style, ...props }: ServiceCardProps): React.JSX.Element;
|
|
167
160
|
|
|
168
161
|
export { ServiceCard, serviceCard };
|
|
169
162
|
export type { ServiceCardProps };
|
package/dist/service-card.js
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CheckGlyph
|
|
3
|
+
} from "./chunk-XCBVFMNV.js";
|
|
4
|
+
import {
|
|
5
|
+
Stamp
|
|
6
|
+
} from "./chunk-5RWHDX5J.js";
|
|
1
7
|
import {
|
|
2
8
|
BlockLink
|
|
3
9
|
} from "./chunk-FVGFPB73.js";
|
|
4
10
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
11
|
+
buttonVariants
|
|
12
|
+
} from "./chunk-EB45EVPJ.js";
|
|
13
|
+
import "./chunk-43PTCDTL.js";
|
|
14
|
+
import "./chunk-2VNYHG4E.js";
|
|
15
|
+
import {
|
|
16
|
+
cn
|
|
17
|
+
} from "./chunk-W675RFOA.js";
|
|
7
18
|
|
|
8
19
|
// src/service-card/service-card.tsx
|
|
9
20
|
import * as React from "react";
|
|
10
21
|
import { tv } from "tailwind-variants";
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
23
|
var serviceCard = tv({
|
|
13
24
|
slots: {
|
|
14
25
|
root: "group relative flex h-full min-w-0 flex-col overflow-hidden rounded-xl border border-border-default bg-surface-1 text-fg transition-colors duration-150 hover:border-border-strong hover:bg-surface-2 hover:border-accent/50 focus-within:ring-2 focus-within:ring-ring data-[selected]:border-accent data-[selected]:bg-accent-soft",
|
|
@@ -28,9 +39,29 @@ var serviceCard = tv({
|
|
|
28
39
|
from: "mb-1 text-[11px] font-semibold text-fg-secondary",
|
|
29
40
|
price: "font-display text-2xl font-black tabular-nums text-fg",
|
|
30
41
|
action: "inline-flex min-h-9 items-center gap-1 rounded-sm text-sm font-bold text-fg-accent no-underline after:absolute after:inset-0 after:content-[''] focus-visible:outline-hidden group-data-[selected]:text-fg"
|
|
31
|
-
}
|
|
42
|
+
},
|
|
43
|
+
variants: {
|
|
44
|
+
// The Cahier's stamped index card (krizaka-ui#603): ruled, straight, a punched hole, the facts stamped, a secondary Button.
|
|
45
|
+
// Same elements and same accessible output as the default card; only the drawing changes. The card is not the link, so
|
|
46
|
+
// the name stays selectable.
|
|
47
|
+
variant: {
|
|
48
|
+
default: {},
|
|
49
|
+
index: {
|
|
50
|
+
root: "rounded-none border-border-default bg-surface-1 shadow-[4px_5px_0_-2px_var(--kz-border-default)] transition-[transform,box-shadow,border-color] duration-120 hover:border-border-strong hover:bg-surface-1 hover:-translate-y-0.5 hover:shadow-[6px_7px_0_-2px_var(--kz-border-default)] focus-within:-translate-y-0.5 focus-within:shadow-[6px_7px_0_-2px_var(--kz-border-default)] motion-reduce:transition-none motion-reduce:hover:translate-y-0 motion-reduce:focus-within:translate-y-0",
|
|
51
|
+
body: "relative pt-8 sm:pt-9",
|
|
52
|
+
head: "border-b border-(--kz-paper-rule-major) pb-3",
|
|
53
|
+
name: "font-display font-normal",
|
|
54
|
+
facts: "gap-2 text-fg",
|
|
55
|
+
foot: "border-t-0 pt-1"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
density: { grid: {}, list: {} }
|
|
59
|
+
},
|
|
60
|
+
compoundVariants: [
|
|
61
|
+
{ variant: "index", density: "list", class: { root: "sm:flex-row", media: "sm:aspect-auto sm:w-1/3 sm:shrink-0", body: "sm:flex-1" } }
|
|
62
|
+
],
|
|
63
|
+
defaultVariants: { variant: "default", density: "grid" }
|
|
32
64
|
});
|
|
33
|
-
var s = serviceCard();
|
|
34
65
|
function ServiceCard({
|
|
35
66
|
name,
|
|
36
67
|
price,
|
|
@@ -49,12 +80,17 @@ function ServiceCard({
|
|
|
49
80
|
onSelect,
|
|
50
81
|
titleAs: Title = "h3",
|
|
51
82
|
reveal,
|
|
83
|
+
variant = "default",
|
|
84
|
+
density = "grid",
|
|
52
85
|
className,
|
|
53
86
|
style,
|
|
54
87
|
...props
|
|
55
88
|
}) {
|
|
89
|
+
const s = serviceCard({ variant, density });
|
|
90
|
+
const index = variant === "index";
|
|
56
91
|
const id = React.useId();
|
|
57
92
|
const facts = [duration, capacity].filter(Boolean);
|
|
93
|
+
const actionClass = index ? cn(buttonVariants({ variant: "secondary", size: "md" }), "min-h-11 rounded-none no-underline") : s.action();
|
|
58
94
|
const arrow = /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2192" });
|
|
59
95
|
const revealStyle = reveal === void 0 ? style : { ...style, "--kz-delay": `${Math.min(Math.max(reveal, 0), 8) * 50}ms` };
|
|
60
96
|
return /* @__PURE__ */ jsxs(
|
|
@@ -62,6 +98,8 @@ function ServiceCard({
|
|
|
62
98
|
{
|
|
63
99
|
"aria-labelledby": id,
|
|
64
100
|
"data-selected": selected ? "" : void 0,
|
|
101
|
+
"data-variant": variant,
|
|
102
|
+
"data-density": index ? density : void 0,
|
|
65
103
|
"data-reveal": reveal === void 0 ? void 0 : "",
|
|
66
104
|
style: revealStyle,
|
|
67
105
|
className: s.root({ className }),
|
|
@@ -69,14 +107,15 @@ function ServiceCard({
|
|
|
69
107
|
children: [
|
|
70
108
|
media && /* @__PURE__ */ jsx("div", { className: s.media(), children: media }),
|
|
71
109
|
/* @__PURE__ */ jsxs("div", { className: s.body(), children: [
|
|
110
|
+
index && /* @__PURE__ */ jsx("svg", { "data-hole": true, "aria-hidden": "true", focusable: "false", viewBox: "0 0 16 16", className: "absolute start-3 top-3 h-4 w-4", children: /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "5.5", fill: "var(--kz-surface-0)", stroke: "var(--kz-border-strong)", strokeWidth: "1.5" }) }),
|
|
72
111
|
/* @__PURE__ */ jsxs("div", { className: s.head(), children: [
|
|
73
112
|
icon && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: s.icon(), children: icon }),
|
|
74
113
|
/* @__PURE__ */ jsxs("div", { className: s.titles(), children: [
|
|
75
114
|
/* @__PURE__ */ jsx(Title, { id, className: s.name(), children: name }),
|
|
76
|
-
facts.length > 0 && /* @__PURE__ */ jsx("ul", { className: s.facts(), children: facts.map((fact, i) => /* @__PURE__ */
|
|
115
|
+
facts.length > 0 && /* @__PURE__ */ jsx("ul", { className: s.facts(), children: facts.map((fact, i) => /* @__PURE__ */ jsx("li", { children: index ? /* @__PURE__ */ jsx(Stamp, { tone: "ink", size: "sm", children: fact }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
77
116
|
i > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\xB7 " }),
|
|
78
117
|
fact
|
|
79
|
-
] }, i)) })
|
|
118
|
+
] }) }, i)) })
|
|
80
119
|
] }),
|
|
81
120
|
tag && /* @__PURE__ */ jsx("span", { className: s.tag(), children: tag })
|
|
82
121
|
] }),
|
|
@@ -88,13 +127,13 @@ function ServiceCard({
|
|
|
88
127
|
/* @__PURE__ */ jsxs("div", { className: s.foot(), children: [
|
|
89
128
|
/* @__PURE__ */ jsxs("p", { className: s.priceBlock(), children: [
|
|
90
129
|
priceFrom && /* @__PURE__ */ jsx("span", { className: s.from(), children: priceFrom }),
|
|
91
|
-
/* @__PURE__ */ jsx("span", { className: s.price(), children: price })
|
|
130
|
+
index ? /* @__PURE__ */ jsx(Stamp, { tone: "ink", size: "sm", "data-figure": "", className: "tabular-nums", children: price }) : /* @__PURE__ */ jsx("span", { className: s.price(), children: price })
|
|
92
131
|
] }),
|
|
93
|
-
href ? /* @__PURE__ */ jsxs(BlockLink, { href, linkAs, className:
|
|
132
|
+
href ? /* @__PURE__ */ jsxs(BlockLink, { href, linkAs, className: actionClass, "aria-describedby": id, children: [
|
|
94
133
|
actionLabel,
|
|
95
134
|
" ",
|
|
96
135
|
arrow
|
|
97
|
-
] }) : onSelect ? /* @__PURE__ */ jsxs("button", { type: "button", onClick: onSelect, "aria-pressed": selected ?? false, "aria-describedby": id, className:
|
|
136
|
+
] }) : onSelect ? /* @__PURE__ */ jsxs("button", { type: "button", onClick: onSelect, "aria-pressed": selected ?? false, "aria-describedby": id, className: actionClass, children: [
|
|
98
137
|
actionLabel,
|
|
99
138
|
" ",
|
|
100
139
|
arrow
|
package/dist/service-card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/service-card/service-card.tsx"],"sourcesContent":["// Server-safe: no hook, no context. A service a shop sells, as a card that argues: icon or photo, name, duration, price\n// (« from » when it varies), what is included, the capacity, a « Popular » tag — and one way in: a link (the booking page\n// with this service chosen) or a button (`onSelect`, from a client parent). The whole card takes the press.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\nimport { CheckGlyph } from \"../glyphs\";\n\nexport const serviceCard = tv({\n slots: {\n root:\n \"group relative flex h-full min-w-0 flex-col overflow-hidden rounded-xl border border-border-default bg-surface-1 text-fg transition-colors duration-150 hover:border-border-strong hover:bg-surface-2 \" +\n \"hover:border-accent/50 focus-within:ring-2 focus-within:ring-ring data-[selected]:border-accent data-[selected]:bg-accent-soft\",\n media: \"relative aspect-[16/9] w-full overflow-hidden bg-media [&>img]:h-full [&>img]:w-full [&>img]:object-cover\",\n body: \"flex flex-1 flex-col gap-3 p-4 sm:p-5\",\n head: \"flex items-start gap-3\",\n icon: \"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-fg-accent [&>svg]:h-5 [&>svg]:w-5\",\n titles: \"flex min-w-0 flex-1 flex-col gap-1\",\n name: \"m-0 font-display text-lg font-bold leading-tight tracking-tight text-fg\",\n facts: \"m-0 flex list-none flex-wrap gap-x-2 gap-y-0.5 p-0 text-xs text-fg-secondary\",\n tag: \"shrink-0 rounded-sm bg-accent px-2 py-0.5 text-[10px] font-extrabold text-on-accent\",\n description: \"m-0 text-sm leading-relaxed text-fg-secondary\",\n included: \"m-0 flex list-none flex-col gap-1.5 p-0 text-sm text-fg-secondary\",\n includedItem: \"flex items-start gap-2 [&>svg]:mt-0.5 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0 [&>svg]:text-fg-accent\",\n foot: \"mt-auto flex items-end justify-between gap-3 border-t border-border-subtle pt-3\",\n priceBlock: \"flex flex-col leading-none\",\n from: \"mb-1 text-[11px] font-semibold text-fg-secondary\",\n price: \"font-display text-2xl font-black tabular-nums text-fg\",\n action:\n \"inline-flex min-h-9 items-center gap-1 rounded-sm text-sm font-bold text-fg-accent no-underline \" +\n \"after:absolute after:inset-0 after:content-[''] focus-visible:outline-hidden group-data-[selected]:text-fg\",\n },\n});\nconst s = serviceCard();\n\nexport type ServiceCardProps = Omit<React.ComponentProps<\"article\">, \"title\" | \"children\"> & {\n /** The service's name (the heading). */\n name: string;\n /** Its price, formatted by the app (`22,00 $`): the card never formats money. */\n price: string;\n /** The words before the price when it varies (`From`, `À partir de`), passed translated. */\n priceFrom?: string;\n /** How long it takes (`30 min`) — the first fact. */\n duration?: string;\n /** How many it takes (`Up to 5 dogs`, `1 person`) — the second fact. */\n capacity?: string;\n /** One or two sentences: what it is. */\n description?: string;\n /** What is included, one short line each (a check precedes it). */\n included?: readonly string[];\n /** A tag on the top right (`Popular`): only from real data, never decoration. */\n tag?: string;\n /** An icon tile before the name (a signature icon): decorative. */\n icon?: React.ReactNode;\n /** A photo or a loop above the card (an `img`, a `video`): fills a 16:9 band. */\n media?: React.ReactNode;\n /** This service is the chosen one (the accent, `data-selected`). */\n selected?: boolean;\n /** The words of the way in (`Book`, `Choose`): the accessible name of the press. */\n actionLabel: string;\n /** The way in, as an address (the booking page with this service preselected). */\n href?: string;\n /** The app's link component for internal addresses (Next's `Link`). */\n linkAs?: LinkComponent;\n /** The way in, as a press (a client parent). Ignored when `href` is set. */\n onSelect?: () => void;\n /**\n * The heading level of the name.\n * @default \"h3\"\n */\n titleAs?: \"h2\" | \"h3\" | \"h4\";\n /** Enters on scroll (MotionObserver): the index in the grid becomes the delay. */\n reveal?: number;\n};\n\n/** A service as a card: icon or photo, duration, price, what is included, the capacity, a tag — one way in. */\nexport function ServiceCard({\n name, price, priceFrom, duration, capacity, description, included, tag, icon, media, selected, actionLabel, href, linkAs, onSelect, titleAs: Title = \"h3\", reveal, className, style, ...props\n}: ServiceCardProps) {\n const id = React.useId();\n const facts = [duration, capacity].filter(Boolean);\n const arrow = <span aria-hidden>→</span>;\n const revealStyle = reveal === undefined ? style : ({ ...style, \"--kz-delay\": `${Math.min(Math.max(reveal, 0), 8) * 50}ms` } as React.CSSProperties);\n return (\n <article\n aria-labelledby={id}\n data-selected={selected ? \"\" : undefined}\n data-reveal={reveal === undefined ? undefined : \"\"}\n style={revealStyle}\n className={s.root({ className })}\n {...props}\n >\n {media && <div className={s.media()}>{media}</div>}\n <div className={s.body()}>\n <div className={s.head()}>\n {icon && <span aria-hidden className={s.icon()}>{icon}</span>}\n <div className={s.titles()}>\n <Title id={id} className={s.name()}>{name}</Title>\n {facts.length > 0 && (\n <ul className={s.facts()}>\n {facts.map((fact, i) => (\n <li key={i}>{i > 0 && <span aria-hidden>· </span>}{fact}</li>\n ))}\n </ul>\n )}\n </div>\n {tag && <span className={s.tag()}>{tag}</span>}\n </div>\n {description && <p className={s.description()}>{description}</p>}\n {included && included.length > 0 && (\n <ul className={s.included()}>\n {included.map((line) => (\n <li key={line} className={s.includedItem()}>\n <CheckGlyph />\n <span>{line}</span>\n </li>\n ))}\n </ul>\n )}\n <div className={s.foot()}>\n <p className={s.priceBlock()}>\n {priceFrom && <span className={s.from()}>{priceFrom}</span>}\n <span className={s.price()}>{price}</span>\n </p>\n {href ? (\n <BlockLink href={href} linkAs={linkAs} className={s.action()} aria-describedby={id}>\n {actionLabel} {arrow}\n </BlockLink>\n ) : onSelect ? (\n <button type=\"button\" onClick={onSelect} aria-pressed={selected ?? false} aria-describedby={id} className={s.action()}>\n {actionLabel} {arrow}\n </button>\n ) : null}\n </div>\n </div>\n </article>\n );\n}\n"],"mappings":";;;;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AA8EH,cAoBE,YApBF;AAzET,IAAM,cAAc,GAAG;AAAA,EAC5B,OAAO;AAAA,IACL,MACE;AAAA,IAEF,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,IACb,UAAU;AAAA,IACV,cAAc;AAAA,IACd,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QACE;AAAA,EAEJ;AACF,CAAC;AACD,IAAM,IAAI,YAAY;AA2Cf,SAAS,YAAY;AAAA,EAC1B;AAAA,EAAM;AAAA,EAAO;AAAA,EAAW;AAAA,EAAU;AAAA,EAAU;AAAA,EAAa;AAAA,EAAU;AAAA,EAAK;AAAA,EAAM;AAAA,EAAO;AAAA,EAAU;AAAA,EAAa;AAAA,EAAM;AAAA,EAAQ;AAAA,EAAU,SAAS,QAAQ;AAAA,EAAM;AAAA,EAAQ;AAAA,EAAW;AAAA,EAAO,GAAG;AAC1L,GAAqB;AACnB,QAAM,KAAW,YAAM;AACvB,QAAM,QAAQ,CAAC,UAAU,QAAQ,EAAE,OAAO,OAAO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AC,cAAW;AAAA,YACZ,oBAAC,UAAM,gBAAK;AAAA,eAFL,IAGT,CACD,GACH;AAAA,UAEF,qBAAC,SAAI,WAAW,EAAE,KAAK,GACrB;AAAA,iCAAC,OAAE,WAAW,EAAE,WAAW,GACxB;AAAA,2BAAa,oBAAC,UAAK,WAAW,EAAE,KAAK,GAAI,qBAAU;AAAA,cACpD,oBAAC,UAAK,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,eACrC;AAAA,YACC,OACC,qBAAC,aAAU,MAAY,QAAgB,WAAW,EAAE,OAAO,GAAG,oBAAkB,IAC7E;AAAA;AAAA,cAAY;AAAA,cAAE;AAAA,eACjB,IACE,WACF,qBAAC,YAAO,MAAK,UAAS,SAAS,UAAU,gBAAc,YAAY,OAAO,oBAAkB,IAAI,WAAW,EAAE,OAAO,GACjH;AAAA;AAAA,cAAY;AAAA,cAAE;AAAA,eACjB,IACE;AAAA,aACN;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/service-card/service-card.tsx"],"sourcesContent":["// Server-safe: no hook, no context. A service a shop sells, as a card that argues: icon or photo, name, duration, price\n// (« from » when it varies), what is included, the capacity, a « Popular » tag — and one way in: a link (the booking page\n// with this service chosen) or a button (`onSelect`, from a client parent). The whole card takes the press.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\nimport { buttonVariants } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { CheckGlyph } from \"../glyphs\";\nimport { Stamp } from \"../specimen-tag/specimen-tag\";\n\nexport const serviceCard = tv({\n slots: {\n root:\n \"group relative flex h-full min-w-0 flex-col overflow-hidden rounded-xl border border-border-default bg-surface-1 text-fg transition-colors duration-150 hover:border-border-strong hover:bg-surface-2 \" +\n \"hover:border-accent/50 focus-within:ring-2 focus-within:ring-ring data-[selected]:border-accent data-[selected]:bg-accent-soft\",\n media: \"relative aspect-[16/9] w-full overflow-hidden bg-media [&>img]:h-full [&>img]:w-full [&>img]:object-cover\",\n body: \"flex flex-1 flex-col gap-3 p-4 sm:p-5\",\n head: \"flex items-start gap-3\",\n icon: \"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-fg-accent [&>svg]:h-5 [&>svg]:w-5\",\n titles: \"flex min-w-0 flex-1 flex-col gap-1\",\n name: \"m-0 font-display text-lg font-bold leading-tight tracking-tight text-fg\",\n facts: \"m-0 flex list-none flex-wrap gap-x-2 gap-y-0.5 p-0 text-xs text-fg-secondary\",\n tag: \"shrink-0 rounded-sm bg-accent px-2 py-0.5 text-[10px] font-extrabold text-on-accent\",\n description: \"m-0 text-sm leading-relaxed text-fg-secondary\",\n included: \"m-0 flex list-none flex-col gap-1.5 p-0 text-sm text-fg-secondary\",\n includedItem: \"flex items-start gap-2 [&>svg]:mt-0.5 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0 [&>svg]:text-fg-accent\",\n foot: \"mt-auto flex items-end justify-between gap-3 border-t border-border-subtle pt-3\",\n priceBlock: \"flex flex-col leading-none\",\n from: \"mb-1 text-[11px] font-semibold text-fg-secondary\",\n price: \"font-display text-2xl font-black tabular-nums text-fg\",\n action:\n \"inline-flex min-h-9 items-center gap-1 rounded-sm text-sm font-bold text-fg-accent no-underline \" +\n \"after:absolute after:inset-0 after:content-[''] focus-visible:outline-hidden group-data-[selected]:text-fg\",\n },\n variants: {\n // The Cahier's stamped index card (krizaka-ui#603): ruled, straight, a punched hole, the facts stamped, a secondary Button.\n // Same elements and same accessible output as the default card; only the drawing changes. The card is not the link, so\n // the name stays selectable.\n variant: {\n default: {},\n index: {\n root:\n \"rounded-none border-border-default bg-surface-1 shadow-[4px_5px_0_-2px_var(--kz-border-default)] \" +\n \"transition-[transform,box-shadow,border-color] duration-120 hover:border-border-strong hover:bg-surface-1 hover:-translate-y-0.5 \" +\n \"hover:shadow-[6px_7px_0_-2px_var(--kz-border-default)] focus-within:-translate-y-0.5 focus-within:shadow-[6px_7px_0_-2px_var(--kz-border-default)] \" +\n \"motion-reduce:transition-none motion-reduce:hover:translate-y-0 motion-reduce:focus-within:translate-y-0\",\n body: \"relative pt-8 sm:pt-9\",\n head: \"border-b border-(--kz-paper-rule-major) pb-3\",\n name: \"font-display font-normal\",\n facts: \"gap-2 text-fg\",\n foot: \"border-t-0 pt-1\",\n },\n },\n density: { grid: {}, list: {} },\n },\n compoundVariants: [\n { variant: \"index\", density: \"list\", class: { root: \"sm:flex-row\", media: \"sm:aspect-auto sm:w-1/3 sm:shrink-0\", body: \"sm:flex-1\" } },\n ],\n defaultVariants: { variant: \"default\", density: \"grid\" },\n});\n\nexport type ServiceCardProps = Omit<React.ComponentProps<\"article\">, \"title\" | \"children\"> & {\n /** The service's name (the heading). */\n name: string;\n /** Its price, formatted by the app (`22,00 $`): the card never formats money. */\n price: string;\n /** The words before the price when it varies (`From`, `À partir de`), passed translated. */\n priceFrom?: string;\n /** How long it takes (`30 min`) — the first fact. */\n duration?: string;\n /** How many it takes (`Up to 5 dogs`, `1 person`) — the second fact. */\n capacity?: string;\n /** One or two sentences: what it is. */\n description?: string;\n /** What is included, one short line each (a check precedes it). */\n included?: readonly string[];\n /** A tag on the top right (`Popular`): only from real data, never decoration. */\n tag?: string;\n /** An icon tile before the name (a signature icon): decorative. */\n icon?: React.ReactNode;\n /** A photo or a loop above the card (an `img`, a `video`): fills a 16:9 band. */\n media?: React.ReactNode;\n /** This service is the chosen one (the accent, `data-selected`). */\n selected?: boolean;\n /** The words of the way in (`Book`, `Choose`): the accessible name of the press. */\n actionLabel: string;\n /** The way in, as an address (the booking page with this service preselected). */\n href?: string;\n /** The app's link component for internal addresses (Next's `Link`). */\n linkAs?: LinkComponent;\n /** The way in, as a press (a client parent). Ignored when `href` is set. */\n onSelect?: () => void;\n /**\n * `index` — the Cahier's stamped index card: a ruled card with a punched hole, straight, the duration and the price as\n * stamps, a secondary button. The same props and the same accessible output; only the drawing changes.\n * @default \"default\"\n */\n variant?: \"default\" | \"index\";\n /**\n * `variant=\"index\"`: `list` lays the card out as a row for a single column (the media on the left from `sm`).\n * @default \"grid\"\n */\n density?: \"grid\" | \"list\";\n /**\n * The heading level of the name.\n * @default \"h3\"\n */\n titleAs?: \"h2\" | \"h3\" | \"h4\";\n /** Enters on scroll (MotionObserver): the index in the grid becomes the delay. */\n reveal?: number;\n};\n\n/** A service as a card: icon or photo, duration, price, what is included, the capacity, a tag — one way in. */\nexport function ServiceCard({\n name, price, priceFrom, duration, capacity, description, included, tag, icon, media, selected, actionLabel, href, linkAs, onSelect, titleAs: Title = \"h3\", reveal, variant = \"default\", density = \"grid\", className, style, ...props\n}: ServiceCardProps) {\n const s = serviceCard({ variant, density });\n const index = variant === \"index\";\n const id = React.useId();\n const facts = [duration, capacity].filter(Boolean);\n const actionClass = index ? cn(buttonVariants({ variant: \"secondary\", size: \"md\" }), \"min-h-11 rounded-none no-underline\") : s.action();\n const arrow = <span aria-hidden>→</span>;\n const revealStyle = reveal === undefined ? style : ({ ...style, \"--kz-delay\": `${Math.min(Math.max(reveal, 0), 8) * 50}ms` } as React.CSSProperties);\n return (\n <article\n aria-labelledby={id}\n data-selected={selected ? \"\" : undefined}\n data-variant={variant}\n data-density={index ? density : undefined}\n data-reveal={reveal === undefined ? undefined : \"\"}\n style={revealStyle}\n className={s.root({ className })}\n {...props}\n >\n {media && <div className={s.media()}>{media}</div>}\n <div className={s.body()}>\n {index && (\n <svg data-hole aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 16 16\" className=\"absolute start-3 top-3 h-4 w-4\">\n <circle cx=\"8\" cy=\"8\" r=\"5.5\" fill=\"var(--kz-surface-0)\" stroke=\"var(--kz-border-strong)\" strokeWidth=\"1.5\" />\n </svg>\n )}\n <div className={s.head()}>\n {icon && <span aria-hidden className={s.icon()}>{icon}</span>}\n <div className={s.titles()}>\n <Title id={id} className={s.name()}>{name}</Title>\n {facts.length > 0 && (\n <ul className={s.facts()}>\n {facts.map((fact, i) => (\n <li key={i}>\n {index ? <Stamp tone=\"ink\" size=\"sm\">{fact}</Stamp> : <>{i > 0 && <span aria-hidden>· </span>}{fact}</>}\n </li>\n ))}\n </ul>\n )}\n </div>\n {tag && <span className={s.tag()}>{tag}</span>}\n </div>\n {description && <p className={s.description()}>{description}</p>}\n {included && included.length > 0 && (\n <ul className={s.included()}>\n {included.map((line) => (\n <li key={line} className={s.includedItem()}>\n <CheckGlyph />\n <span>{line}</span>\n </li>\n ))}\n </ul>\n )}\n <div className={s.foot()}>\n <p className={s.priceBlock()}>\n {priceFrom && <span className={s.from()}>{priceFrom}</span>}\n {index ? <Stamp tone=\"ink\" size=\"sm\" data-figure=\"\" className=\"tabular-nums\">{price}</Stamp> : <span className={s.price()}>{price}</span>}\n </p>\n {href ? (\n <BlockLink href={href} linkAs={linkAs} className={actionClass} aria-describedby={id}>\n {actionLabel} {arrow}\n </BlockLink>\n ) : onSelect ? (\n <button type=\"button\" onClick={onSelect} aria-pressed={selected ?? false} aria-describedby={id} className={actionClass}>\n {actionLabel} {arrow}\n </button>\n ) : null}\n </div>\n </div>\n </article>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAuHH,SA4B0D,UA5B1D,KA4B0D,YA5B1D;AA/GT,IAAM,cAAc,GAAG;AAAA,EAC5B,OAAO;AAAA,IACL,MACE;AAAA,IAEF,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,IACb,UAAU;AAAA,IACV,cAAc;AAAA,IACd,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QACE;AAAA,EAEJ;AAAA,EACA,UAAU;AAAA;AAAA;AAAA;AAAA,IAIR,SAAS;AAAA,MACP,SAAS,CAA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S,GACvB,mBAAS,IAAI,CAAC,SACb,qBAAC,QAAc,WAAW,EAAE,aAAa,GACvC;AAAA,gCAAC,cAAW;AAAA,YACZ,oBAAC,UAAM,gBAAK;AAAA,eAFL,IAGT,CACD,GACH;AAAA,UAEF,qBAAC,SAAI,WAAW,EAAE,KAAK,GACrB;AAAA,iCAAC,OAAE,WAAW,EAAE,WAAW,GACxB;AAAA,2BAAa,oBAAC,UAAK,WAAW,EAAE,KAAK,GAAI,qBAAU;AAAA,cACnD,QAAQ,oBAAC,SAAM,MAAK,OAAM,MAAK,MAAK,eAAY,IAAG,WAAU,gBAAgB,iBAAM,IAAW,oBAAC,UAAK,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,eACpI;AAAA,YACC,OACC,qBAAC,aAAU,MAAY,QAAgB,WAAW,aAAa,oBAAkB,IAC9E;AAAA;AAAA,cAAY;AAAA,cAAE;AAAA,eACjB,IACE,WACF,qBAAC,YAAO,MAAK,UAAS,SAAS,UAAU,gBAAc,YAAY,OAAO,oBAAkB,IAAI,WAAW,aACxG;AAAA;AAAA,cAAY;AAAA,cAAE;AAAA,eACjB,IACE;AAAA,aACN;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/dist/settings-layout.js
CHANGED
package/dist/site-cahier.js
CHANGED
package/dist/specimen-tag.d.ts
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
type StampTone = "ok" | "wip" | "construction" | "neutral";
|
|
3
|
+
type StampTone = "ok" | "wip" | "construction" | "neutral" | "ink" | "hue";
|
|
4
4
|
type StampProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
5
5
|
/**
|
|
6
6
|
* `ok` — released or usable today (green ink); `wip` — in development (pencil); `construction` — not open yet (the
|
|
7
|
-
* margin's red); `neutral` — a fact
|
|
7
|
+
* margin's red); `neutral` — a fact; `ink` — the page's ink (a price, a duration); `hue` — the page's hue text
|
|
8
|
+
* (`--kz-hue-text`: a vibe, an area).
|
|
8
9
|
* @default "neutral"
|
|
9
10
|
*/
|
|
10
11
|
tone?: StampTone;
|
|
12
|
+
/** A glyph before the text (a `@krizaka/icons` icon): decorative, hidden from assistive technology. */
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* `sm` — a stamp among facts; `md` — a status on its own.
|
|
16
|
+
* @default "md"
|
|
17
|
+
*/
|
|
18
|
+
size?: "sm" | "md";
|
|
19
|
+
/**
|
|
20
|
+
* The border keeps its tilt and the text is straight: a price or a time is read, not admired. Defaults to `true` for `size="sm"`.
|
|
21
|
+
*/
|
|
22
|
+
straightText?: boolean;
|
|
11
23
|
};
|
|
12
24
|
/** A rubber stamp: a short status pressed on a tag or a page, double-ruled, slightly askew. */
|
|
13
|
-
declare function Stamp({ tone, className, ...props }: StampProps): React.JSX.Element;
|
|
25
|
+
declare function Stamp({ tone, icon, size, straightText, className, children, ...props }: StampProps): React.JSX.Element;
|
|
14
26
|
interface SpecimenField {
|
|
15
27
|
/** The field's name, typed in lower case: `seen on`, `since`. */
|
|
16
28
|
label: React.ReactNode;
|
package/dist/specimen-tag.js
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
function Stamp({ tone = "neutral", className, ...props }) {
|
|
8
|
-
return /* @__PURE__ */ jsx("span", { className: cn("kz-stamp", className), "data-tone": tone, ...props });
|
|
9
|
-
}
|
|
10
|
-
function SpecimenTag({ code, title, titleAs: Title = "h3", mark, status, fields, children, footer, mount = "pin", className, ...props }) {
|
|
11
|
-
return /* @__PURE__ */ jsxs("article", { className: cn("kz-tag", className), "data-mount": mount, ...props, children: [
|
|
12
|
-
/* @__PURE__ */ jsx("span", { className: "kz-tag-eyelet", "aria-hidden": true }),
|
|
13
|
-
(code || status) && /* @__PURE__ */ jsxs("div", { className: "kz-tag-head", children: [
|
|
14
|
-
code && /* @__PURE__ */ jsx("span", { className: "kz-tag-code", children: code }),
|
|
15
|
-
status && /* @__PURE__ */ jsx(Stamp, { tone: status.tone, children: status.label })
|
|
16
|
-
] }),
|
|
17
|
-
title && /* @__PURE__ */ jsxs(Title, { className: "kz-tag-title", children: [
|
|
18
|
-
/* @__PURE__ */ jsx("span", { children: title }),
|
|
19
|
-
mark && /* @__PURE__ */ jsx("span", { className: "kz-tag-mark", "aria-hidden": true, children: mark })
|
|
20
|
-
] }),
|
|
21
|
-
children && /* @__PURE__ */ jsx("div", { className: "kz-tag-body", children }),
|
|
22
|
-
fields && fields.length > 0 && /* @__PURE__ */ jsx("dl", { className: "kz-tag-fields", children: fields.map((f, i) => /* @__PURE__ */ jsxs("div", { children: [
|
|
23
|
-
/* @__PURE__ */ jsx("dt", { children: f.label }),
|
|
24
|
-
/* @__PURE__ */ jsx("dd", { children: f.value })
|
|
25
|
-
] }, i)) }),
|
|
26
|
-
footer && /* @__PURE__ */ jsx("div", { className: "kz-tag-foot", children: footer })
|
|
27
|
-
] });
|
|
28
|
-
}
|
|
2
|
+
SpecimenTag,
|
|
3
|
+
Stamp
|
|
4
|
+
} from "./chunk-5RWHDX5J.js";
|
|
5
|
+
import "./chunk-W675RFOA.js";
|
|
29
6
|
export {
|
|
30
7
|
SpecimenTag,
|
|
31
8
|
Stamp
|
package/dist/specimen-tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|