@krizaka/ui 3.63.1 → 3.64.1
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 +206 -44
- package/dist/account-settings.js.map +1 -1
- 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/blocks.css +41 -0
- package/dist/chat.js +1 -1
- package/dist/chunk-5D7NMUF6.js +35 -0
- package/dist/chunk-5D7NMUF6.js.map +1 -0
- package/dist/chunk-A7MQPIEG.js +31 -0
- package/dist/chunk-A7MQPIEG.js.map +1 -0
- package/dist/chunk-B47WSPMP.js +60 -0
- package/dist/chunk-B47WSPMP.js.map +1 -0
- package/dist/chunk-EUJ7337V.js +137 -0
- package/dist/chunk-EUJ7337V.js.map +1 -0
- package/dist/chunk-HK525THY.js +139 -0
- package/dist/chunk-HK525THY.js.map +1 -0
- package/dist/chunk-HKEAYSFS.js +19 -0
- package/dist/chunk-HKEAYSFS.js.map +1 -0
- 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-ZYHWJ7U5.js +20 -0
- package/dist/chunk-ZYHWJ7U5.js.map +1 -0
- package/dist/cover-hero.d.ts +4 -0
- package/dist/cover-hero.js +5 -2
- package/dist/cover-hero.js.map +1 -1
- package/dist/dashboard-layout.js +2 -1
- package/dist/dashboard-layout.js.map +1 -1
- package/dist/docs-layout.js +1 -1
- package/dist/filter-bar.d.ts +3 -3
- package/dist/frame-D6Xv83t8.d.ts +52 -0
- package/dist/match-dialog.js +1 -1
- package/dist/media-grid.d.ts +8 -3
- package/dist/media-grid.js +1 -1
- package/dist/native.d.ts +8 -3
- package/dist/native.js +51 -0
- package/dist/native.js.map +1 -1
- package/dist/service-card.d.ts +25 -1
- package/dist/service-card.js +7 -3
- package/dist/service-card.js.map +1 -1
- package/dist/shop/booking.d.ts +36 -0
- package/dist/shop/booking.js +37 -0
- package/dist/shop/booking.js.map +1 -0
- package/dist/shop/bulletin.d.ts +28 -0
- package/dist/shop/bulletin.js +29 -0
- package/dist/shop/bulletin.js.map +1 -0
- package/dist/shop/demo.d.ts +135 -0
- package/dist/shop/demo.js +141 -0
- package/dist/shop/demo.js.map +1 -0
- package/dist/shop/faq.d.ts +20 -0
- package/dist/shop/faq.js +33 -0
- package/dist/shop/faq.js.map +1 -0
- package/dist/shop/gallery.d.ts +46 -0
- package/dist/shop/gallery.js +76 -0
- package/dist/shop/gallery.js.map +1 -0
- package/dist/shop/hero.d.ts +36 -0
- package/dist/shop/hero.js +70 -0
- package/dist/shop/hero.js.map +1 -0
- package/dist/shop/map-gate.d.ts +22 -0
- package/dist/shop/map-gate.js +34 -0
- package/dist/shop/map-gate.js.map +1 -0
- package/dist/shop/policies.d.ts +18 -0
- package/dist/shop/policies.js +16 -0
- package/dist/shop/policies.js.map +1 -0
- package/dist/shop/reviews.d.ts +25 -0
- package/dist/shop/reviews.js +47 -0
- package/dist/shop/reviews.js.map +1 -0
- package/dist/shop/services.d.ts +57 -0
- package/dist/shop/services.js +118 -0
- package/dist/shop/services.js.map +1 -0
- package/dist/shop/social.d.ts +27 -0
- package/dist/shop/social.js +27 -0
- package/dist/shop/social.js.map +1 -0
- package/dist/shop/story.d.ts +24 -0
- package/dist/shop/story.js +26 -0
- package/dist/shop/story.js.map +1 -0
- package/dist/shop/team.d.ts +24 -0
- package/dist/shop/team.js +26 -0
- package/dist/shop/team.js.map +1 -0
- package/dist/shop/video.d.ts +40 -0
- package/dist/shop/video.js +33 -0
- package/dist/shop/video.js.map +1 -0
- package/dist/shop/visit.d.ts +29 -0
- package/dist/shop/visit.js +38 -0
- package/dist/shop/visit.js.map +1 -0
- package/dist/shop-composer.d.ts +490 -0
- package/dist/shop-composer.js +2061 -0
- package/dist/shop-composer.js.map +1 -0
- package/dist/shop.d.ts +316 -0
- package/dist/shop.js +389 -0
- package/dist/shop.js.map +1 -0
- package/dist/vertical-video.js +1 -1
- package/package.json +267 -9
- 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 +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 +6 -5
- 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 +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 +2 -2
- 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 +1 -1
- 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/shop/booking-panel.d.ts +4 -0
- package/registry/examples/shop/booking-panel.js +12 -0
- package/registry/examples/shop/booking-panel.tsx +11 -0
- package/registry/examples/shop/booking-sticky.d.ts +4 -0
- package/registry/examples/shop/booking-sticky.js +15 -0
- package/registry/examples/shop/booking-sticky.tsx +12 -0
- package/registry/examples/shop/booking-strip.d.ts +4 -0
- package/registry/examples/shop/booking-strip.js +13 -0
- package/registry/examples/shop/booking-strip.tsx +12 -0
- package/registry/examples/shop/bulletin-banner.d.ts +4 -0
- package/registry/examples/shop/bulletin-banner.js +13 -0
- package/registry/examples/shop/bulletin-banner.tsx +12 -0
- package/registry/examples/shop/bulletin-board.d.ts +4 -0
- package/registry/examples/shop/bulletin-board.js +13 -0
- package/registry/examples/shop/bulletin-board.tsx +12 -0
- package/registry/examples/shop/cards.d.ts +4 -0
- package/registry/examples/shop/cards.js +13 -0
- package/registry/examples/shop/cards.tsx +12 -0
- package/registry/examples/shop/carousel.d.ts +4 -0
- package/registry/examples/shop/carousel.js +13 -0
- package/registry/examples/shop/carousel.tsx +12 -0
- package/registry/examples/shop/document.d.ts +4 -0
- package/registry/examples/shop/document.js +20 -0
- package/registry/examples/shop/document.tsx +13 -0
- package/registry/examples/shop/faq.d.ts +4 -0
- package/registry/examples/shop/faq.js +13 -0
- package/registry/examples/shop/faq.tsx +12 -0
- package/registry/examples/shop/gallery-filmstrip.d.ts +4 -0
- package/registry/examples/shop/gallery-filmstrip.js +13 -0
- package/registry/examples/shop/gallery-filmstrip.tsx +12 -0
- package/registry/examples/shop/gallery-grid.d.ts +4 -0
- package/registry/examples/shop/gallery-grid.js +13 -0
- package/registry/examples/shop/gallery-grid.tsx +12 -0
- package/registry/examples/shop/gallery-mosaic.d.ts +4 -0
- package/registry/examples/shop/gallery-mosaic.js +13 -0
- package/registry/examples/shop/gallery-mosaic.tsx +12 -0
- package/registry/examples/shop/gallery-wall.d.ts +4 -0
- package/registry/examples/shop/gallery-wall.js +13 -0
- package/registry/examples/shop/gallery-wall.tsx +12 -0
- package/registry/examples/shop/hero-banner.d.ts +4 -0
- package/registry/examples/shop/hero-banner.js +15 -0
- package/registry/examples/shop/hero-banner.tsx +14 -0
- package/registry/examples/shop/hero-poster.d.ts +4 -0
- package/registry/examples/shop/hero-poster.js +15 -0
- package/registry/examples/shop/hero-poster.tsx +14 -0
- package/registry/examples/shop/hero-split.d.ts +4 -0
- package/registry/examples/shop/hero-split.js +15 -0
- package/registry/examples/shop/hero-split.tsx +14 -0
- package/registry/examples/shop/hero-tv.d.ts +4 -0
- package/registry/examples/shop/hero-tv.js +15 -0
- package/registry/examples/shop/hero-tv.tsx +14 -0
- package/registry/examples/shop/index.d.ts +4 -0
- package/registry/examples/shop/index.js +13 -0
- package/registry/examples/shop/index.tsx +12 -0
- package/registry/examples/shop/menu-columns.d.ts +4 -0
- package/registry/examples/shop/menu-columns.js +13 -0
- package/registry/examples/shop/menu-columns.tsx +12 -0
- package/registry/examples/shop/menu.d.ts +4 -0
- package/registry/examples/shop/menu.js +25 -0
- package/registry/examples/shop/menu.tsx +21 -0
- package/registry/examples/shop/page.d.ts +4 -0
- package/registry/examples/shop/page.js +32 -0
- package/registry/examples/shop/page.tsx +27 -0
- package/registry/examples/shop/policies.d.ts +4 -0
- package/registry/examples/shop/policies.js +13 -0
- package/registry/examples/shop/policies.tsx +12 -0
- package/registry/examples/shop/reviews-quote.d.ts +4 -0
- package/registry/examples/shop/reviews-quote.js +13 -0
- package/registry/examples/shop/reviews-quote.tsx +12 -0
- package/registry/examples/shop/reviews-strip.d.ts +4 -0
- package/registry/examples/shop/reviews-strip.js +13 -0
- package/registry/examples/shop/reviews-strip.tsx +12 -0
- package/registry/examples/shop/reviews-summary-cards.d.ts +4 -0
- package/registry/examples/shop/reviews-summary-cards.js +13 -0
- package/registry/examples/shop/reviews-summary-cards.tsx +12 -0
- package/registry/examples/shop/social-facade.d.ts +4 -0
- package/registry/examples/shop/social-facade.js +13 -0
- package/registry/examples/shop/social-facade.tsx +12 -0
- package/registry/examples/shop/social-links.d.ts +4 -0
- package/registry/examples/shop/social-links.js +12 -0
- package/registry/examples/shop/social-links.tsx +11 -0
- package/registry/examples/shop/story-owner.d.ts +4 -0
- package/registry/examples/shop/story-owner.js +13 -0
- package/registry/examples/shop/story-owner.tsx +12 -0
- package/registry/examples/shop/story-quote.d.ts +4 -0
- package/registry/examples/shop/story-quote.js +13 -0
- package/registry/examples/shop/story-quote.tsx +12 -0
- package/registry/examples/shop/team-cards.d.ts +4 -0
- package/registry/examples/shop/team-cards.js +13 -0
- package/registry/examples/shop/team-cards.tsx +12 -0
- package/registry/examples/shop/team-row.d.ts +4 -0
- package/registry/examples/shop/team-row.js +13 -0
- package/registry/examples/shop/team-row.tsx +12 -0
- package/registry/examples/shop/video-shorts.d.ts +4 -0
- package/registry/examples/shop/video-shorts.js +14 -0
- package/registry/examples/shop/video-shorts.tsx +13 -0
- package/registry/examples/shop/video-tv.d.ts +4 -0
- package/registry/examples/shop/video-tv.js +13 -0
- package/registry/examples/shop/video-tv.tsx +12 -0
- package/registry/examples/shop/visit-card.d.ts +4 -0
- package/registry/examples/shop/visit-card.js +13 -0
- package/registry/examples/shop/visit-card.tsx +12 -0
- package/registry/examples/shop/visit-map.d.ts +4 -0
- package/registry/examples/shop/visit-map.js +13 -0
- package/registry/examples/shop/visit-map.tsx +12 -0
- package/registry/examples/shop/visit-split.d.ts +4 -0
- package/registry/examples/shop/visit-split.js +13 -0
- package/registry/examples/shop/visit-split.tsx +12 -0
- package/registry/examples/shop-composer/composer.d.ts +4 -0
- package/registry/examples/shop-composer/composer.js +17 -0
- package/registry/examples/shop-composer/composer.tsx +21 -0
- 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 +98 -7
- 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 +1 -1
- 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/reviews.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 +24 -6
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +424 -0
- package/registry/shop.json +776 -0
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/registry/virtual.json +1 -1
- package/registry/wall.json +3 -3
- 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/match-dialog.js
CHANGED
package/dist/media-grid.d.ts
CHANGED
|
@@ -71,8 +71,12 @@ declare function ShortsShelf<T>({ label, title, hint, items, getId, renderItem,
|
|
|
71
71
|
|
|
72
72
|
/** A brand of the default avatars. `orochia`, `yasakia`, `yororis` and `kachizaka` are deprecated: paused products (2026-10-25), removed in the next major; their pictures stay served until then. */
|
|
73
73
|
type DefaultAvatarBrand = "krizaka" | "orazaka" | "orochia" | "yasakia" | "yororis" | "yomizaka" | "kachizaka" | "akinaza";
|
|
74
|
-
/**
|
|
75
|
-
|
|
74
|
+
/**
|
|
75
|
+
* What the picture is of. `person`: a neutral silhouette. `plain`: the brand's gradient alone, ready for initials.
|
|
76
|
+
* `folder`, `organisation` and `shop` are the pictures of a thing that is not a person (a folder or collection, a company, a shop):
|
|
77
|
+
* a glyph on the gradient, never a silhouette. The central sets of these kinds are in the Krizaka org JSON (`defaults`, `@krizaka/org`).
|
|
78
|
+
*/
|
|
79
|
+
type DefaultAvatarKind = "person" | "plain" | "folder" | "organisation" | "shop";
|
|
76
80
|
interface DefaultAvatar {
|
|
77
81
|
/** The brand of the product showing the avatar: its gradient, its hues. */
|
|
78
82
|
brand: DefaultAvatarBrand;
|
|
@@ -81,7 +85,8 @@ interface DefaultAvatar {
|
|
|
81
85
|
/** Force a tone, 1 to 6, instead of deriving it from `seed`. */
|
|
82
86
|
tone?: number;
|
|
83
87
|
/**
|
|
84
|
-
* `person` (default): a silhouette. `plain`: the gradient alone.
|
|
88
|
+
* `person` (default): a silhouette. `plain`: the gradient alone. `folder`, `organisation`, `shop`: that thing's glyph, drawn here
|
|
89
|
+
* (a data URL, no request) — a folder is never given a person.
|
|
85
90
|
* @default "person"
|
|
86
91
|
*/
|
|
87
92
|
kind?: DefaultAvatarKind;
|
package/dist/media-grid.js
CHANGED
package/dist/native.d.ts
CHANGED
|
@@ -5,8 +5,12 @@ import { Label, TagPreset, StatusTone, Marker as Marker$1, StatusSet } from '@kr
|
|
|
5
5
|
|
|
6
6
|
/** A brand of the default avatars. `orochia`, `yasakia`, `yororis` and `kachizaka` are deprecated: paused products (2026-10-25), removed in the next major; their pictures stay served until then. */
|
|
7
7
|
type DefaultAvatarBrand = "krizaka" | "orazaka" | "orochia" | "yasakia" | "yororis" | "yomizaka" | "kachizaka" | "akinaza";
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* What the picture is of. `person`: a neutral silhouette. `plain`: the brand's gradient alone, ready for initials.
|
|
10
|
+
* `folder`, `organisation` and `shop` are the pictures of a thing that is not a person (a folder or collection, a company, a shop):
|
|
11
|
+
* a glyph on the gradient, never a silhouette. The central sets of these kinds are in the Krizaka org JSON (`defaults`, `@krizaka/org`).
|
|
12
|
+
*/
|
|
13
|
+
type DefaultAvatarKind = "person" | "plain" | "folder" | "organisation" | "shop";
|
|
10
14
|
type DefaultAvatarSize = 256 | 512;
|
|
11
15
|
interface DefaultAvatar {
|
|
12
16
|
/** The brand of the product showing the avatar: its gradient, its hues. */
|
|
@@ -16,7 +20,8 @@ interface DefaultAvatar {
|
|
|
16
20
|
/** Force a tone, 1 to 6, instead of deriving it from `seed`. */
|
|
17
21
|
tone?: number;
|
|
18
22
|
/**
|
|
19
|
-
* `person` (default): a silhouette. `plain`: the gradient alone.
|
|
23
|
+
* `person` (default): a silhouette. `plain`: the gradient alone. `folder`, `organisation`, `shop`: that thing's glyph, drawn here
|
|
24
|
+
* (a data URL, no request) — a folder is never given a person.
|
|
20
25
|
* @default "person"
|
|
21
26
|
*/
|
|
22
27
|
kind?: DefaultAvatarKind;
|
package/dist/native.js
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
// src/avatar/default-avatar.ts
|
|
2
2
|
var DEFAULT_AVATAR_TONES = 6;
|
|
3
3
|
var DEFAULT_AVATAR_BASE = "https://krizaka-assets.b-cdn.net/people/defaults/v1";
|
|
4
|
+
var BRANDS = {
|
|
5
|
+
krizaka: { from: [217, 92, 53], to: [217, 92, 68], spread: 14 },
|
|
6
|
+
orazaka: { from: [26, 90.5, 37.1], to: [26, 92, 45], spread: 7 },
|
|
7
|
+
orochia: { from: [262.1, 83.3, 57.8], to: [328.6, 85.5, 70.2], spread: 12 },
|
|
8
|
+
yasakia: { from: [156, 92, 32], to: [178, 90, 32], spread: 12 },
|
|
9
|
+
yororis: { from: [34, 46, 44], to: [104, 28, 42], spread: 10 },
|
|
10
|
+
yomizaka: { from: [232, 50, 55], to: [248, 50, 58], spread: 10 },
|
|
11
|
+
kachizaka: { from: [226, 80, 56], to: [44, 92, 33], spread: 10 },
|
|
12
|
+
akinaza: { from: [140, 48, 34], to: [22, 60, 46], spread: 10 }
|
|
13
|
+
};
|
|
14
|
+
var MIN_CONTRAST = 3.2;
|
|
15
|
+
var OFFSETS = [0, -1, 1, -2, 2, 3];
|
|
16
|
+
function hslToHex([h, s, l]) {
|
|
17
|
+
const sat = s / 100;
|
|
18
|
+
const light = l / 100;
|
|
19
|
+
const k = (n) => (n + (h % 360 + 360) % 360 / 30) % 12;
|
|
20
|
+
const a = sat * Math.min(light, 1 - light);
|
|
21
|
+
const channel = (n) => Math.round(255 * (light - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)))));
|
|
22
|
+
return `#${[0, 8, 4].map((n) => channel(n).toString(16).padStart(2, "0")).join("")}`;
|
|
23
|
+
}
|
|
24
|
+
var channelLuminance = (v) => v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
|
|
25
|
+
var whiteContrast = (hex) => {
|
|
26
|
+
const [r, g, b] = [1, 3, 5].map((i) => channelLuminance(Number.parseInt(hex.slice(i, i + 2), 16) / 255));
|
|
27
|
+
return 1.05 / (0.2126 * r + 0.7152 * g + 0.0722 * b + 0.05);
|
|
28
|
+
};
|
|
29
|
+
function readable([h, s, l]) {
|
|
30
|
+
let hex = hslToHex([h, s, l]);
|
|
31
|
+
for (let light = l; whiteContrast(hex) < MIN_CONTRAST && light > 10; light -= 1) hex = hslToHex([h, s, light]);
|
|
32
|
+
return hex;
|
|
33
|
+
}
|
|
34
|
+
function defaultAvatarTone(brand, tone3) {
|
|
35
|
+
const b = BRANDS[brand];
|
|
36
|
+
const o = OFFSETS[(clampTone(tone3) - 1) % OFFSETS.length] * b.spread;
|
|
37
|
+
return [readable([b.from[0] + o, b.from[1], b.from[2]]), readable([b.to[0] + o, b.to[1], b.to[2]])];
|
|
38
|
+
}
|
|
4
39
|
var clampTone = (tone3) => Math.min(DEFAULT_AVATAR_TONES, Math.max(1, Math.round(tone3)));
|
|
5
40
|
function defaultAvatarToneOf(seed) {
|
|
6
41
|
if (seed === void 0) return 1;
|
|
@@ -21,8 +56,24 @@ function trimTrailingSlashes(value) {
|
|
|
21
56
|
return value.slice(0, end);
|
|
22
57
|
}
|
|
23
58
|
function defaultAvatarUrl(avatar, { size = 256, base = DEFAULT_AVATAR_BASE } = {}) {
|
|
59
|
+
if (isGlyphKind(avatar.kind)) return defaultAvatarDataUrl(avatar);
|
|
24
60
|
return `${trimTrailingSlashes(base)}/${avatar.brand}/${defaultAvatarFile(avatar.kind ?? "person", resolveTone(avatar), size)}`;
|
|
25
61
|
}
|
|
62
|
+
var GLYPHS = {
|
|
63
|
+
folder: () => `<path d="M96 176a28 28 0 0 1 28-28h92l40 44h132a28 28 0 0 1 28 28v152a28 28 0 0 1-28 28H124a28 28 0 0 1-28-28z" fill="#fff" fill-opacity=".92"/>`,
|
|
64
|
+
organisation: (from) => `<rect x="136" y="104" width="240" height="304" rx="16" fill="#fff" fill-opacity=".92"/>${[160, 226, 292].flatMap((y) => [168, 236, 304].map((x) => `<rect x="${x}" y="${y}" width="40" height="40" rx="6" fill="${from}"/>`)).join("")}<rect x="232" y="352" width="48" height="56" rx="6" fill="${from}"/>`,
|
|
65
|
+
shop: (from) => `<path d="M112 132h288l24 84a56 56 0 0 1-112 0 56 56 0 0 1-112 0 56 56 0 0 1-112 0z" fill="#fff" fill-opacity=".92"/><rect x="136" y="292" width="240" height="116" rx="12" fill="#fff" fill-opacity=".92"/><rect x="226" y="326" width="60" height="82" rx="8" fill="${from}"/><rect x="156" y="318" width="48" height="44" rx="6" fill="${from}"/><rect x="308" y="318" width="48" height="44" rx="6" fill="${from}"/>`
|
|
66
|
+
};
|
|
67
|
+
var isGlyphKind = (kind) => kind === "folder" || kind === "organisation" || kind === "shop";
|
|
68
|
+
function defaultAvatarDataUrl(avatar) {
|
|
69
|
+
return `data:image/svg+xml,${encodeURIComponent(defaultAvatarSvg(avatar))}`;
|
|
70
|
+
}
|
|
71
|
+
function defaultAvatarSvg(avatar) {
|
|
72
|
+
const [from, to] = defaultAvatarTone(avatar.brand, resolveTone(avatar));
|
|
73
|
+
const kind = avatar.kind ?? "person";
|
|
74
|
+
const person = isGlyphKind(kind) ? GLYPHS[kind](from) : kind === "person" ? `<circle cx="256" cy="200" r="86" fill="#fff" fill-opacity=".92"/><path d="M84 512c0-108 78-182 172-182s172 74 172 182z" fill="#fff" fill-opacity=".92"/>` : "";
|
|
75
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="${from}"/><stop offset="1" stop-color="${to}"/></linearGradient><radialGradient id="l" cx=".28" cy=".18" r=".85"><stop offset="0" stop-color="#fff" stop-opacity=".24"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></radialGradient></defs><rect width="512" height="512" fill="url(#g)"/><rect width="512" height="512" fill="url(#l)"/>${person}</svg>`;
|
|
76
|
+
}
|
|
26
77
|
|
|
27
78
|
// src/countdown/core.ts
|
|
28
79
|
import { useSyncExternalStore } from "react";
|