@krizaka/ui 2.8.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -1
- package/dist/achievement.d.ts +54 -0
- package/dist/achievement.js +73 -0
- package/dist/achievement.js.map +1 -0
- package/dist/app-shell.d.ts +203 -0
- package/dist/app-shell.js +137 -0
- package/dist/app-shell.js.map +1 -0
- package/dist/auth-layout.d.ts +136 -0
- package/dist/auth-layout.js +75 -0
- package/dist/auth-layout.js.map +1 -0
- package/dist/choice-grid.d.ts +84 -0
- package/dist/choice-grid.js +141 -0
- package/dist/choice-grid.js.map +1 -0
- package/dist/chunk-555LWYIN.js +11 -0
- package/dist/chunk-555LWYIN.js.map +1 -0
- package/dist/chunk-AZPKXP3O.js +36 -0
- package/dist/chunk-AZPKXP3O.js.map +1 -0
- package/dist/chunk-VCAAHCHL.js +17 -0
- package/dist/chunk-VCAAHCHL.js.map +1 -0
- package/dist/code-block.js +23 -44
- package/dist/code-block.js.map +1 -1
- package/dist/continue-prompt.d.ts +48 -0
- package/dist/continue-prompt.js +200 -0
- package/dist/continue-prompt.js.map +1 -0
- package/dist/dashboard-layout.d.ts +139 -0
- package/dist/dashboard-layout.js +68 -0
- package/dist/dashboard-layout.js.map +1 -0
- package/dist/detail-layout.d.ts +126 -0
- package/dist/detail-layout.js +48 -0
- package/dist/detail-layout.js.map +1 -0
- package/dist/docs-layout.d.ts +78 -0
- package/dist/docs-layout.js +60 -0
- package/dist/docs-layout.js.map +1 -0
- package/dist/goal-gauge.d.ts +38 -0
- package/dist/goal-gauge.js +53 -0
- package/dist/goal-gauge.js.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +22 -19
- package/dist/index.js.map +1 -1
- package/dist/landscape.d.ts +41 -0
- package/dist/landscape.js +836 -0
- package/dist/landscape.js.map +1 -0
- package/dist/marketing-layout.d.ts +60 -0
- package/dist/marketing-layout.js +25 -0
- package/dist/marketing-layout.js.map +1 -0
- package/dist/mascots.d.ts +14 -1
- package/dist/mascots.js +86 -1
- package/dist/mascots.js.map +1 -1
- package/dist/native.d.ts +73 -3
- package/dist/native.js +530 -296
- package/dist/native.js.map +1 -1
- package/dist/profile-card.d.ts +85 -0
- package/dist/profile-card.js +87 -0
- package/dist/profile-card.js.map +1 -0
- package/dist/promise-card.d.ts +28 -0
- package/dist/promise-card.js +29 -0
- package/dist/promise-card.js.map +1 -0
- package/dist/scroll-stage.d.ts +603 -0
- package/dist/scroll-stage.js +59 -0
- package/dist/scroll-stage.js.map +1 -0
- package/dist/settings-layout.d.ts +154 -0
- package/dist/settings-layout.js +57 -0
- package/dist/settings-layout.js.map +1 -0
- package/dist/split-view.d.ts +106 -0
- package/dist/split-view.js +41 -0
- package/dist/split-view.js.map +1 -0
- package/dist/stage-banner.d.ts +34 -0
- package/dist/stage-banner.js +26 -0
- package/dist/stage-banner.js.map +1 -0
- package/dist/story-variant-CLn4H5Nt.d.ts +4 -0
- package/dist/story.css +432 -0
- package/package.json +250 -8
- package/registry/achievement.json +322 -0
- package/registry/action-bar.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/app-shell.json +451 -0
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +230 -0
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +5 -5
- package/registry/card-grid.json +5 -5
- package/registry/card.json +3 -3
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +318 -0
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/confirm-button.json +3 -3
- package/registry/continue-prompt.json +312 -0
- package/registry/countdown.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +273 -0
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/detail-layout.json +233 -0
- package/registry/dialog.json +1 -1
- package/registry/docs-layout.json +148 -0
- package/registry/dropdown-menu.json +3 -3
- package/registry/empty-state.json +1 -1
- package/registry/examples/achievement/arcade.d.ts +4 -0
- package/registry/examples/achievement/arcade.js +15 -0
- package/registry/examples/achievement/arcade.tsx +12 -0
- package/registry/examples/achievement/milestones.d.ts +4 -0
- package/registry/examples/achievement/milestones.js +15 -0
- package/registry/examples/achievement/milestones.tsx +12 -0
- package/registry/examples/app-shell/admin-console.d.ts +4 -0
- package/registry/examples/app-shell/admin-console.js +52 -0
- package/registry/examples/app-shell/admin-console.tsx +64 -0
- package/registry/examples/app-shell/basic.d.ts +4 -0
- package/registry/examples/app-shell/basic.js +37 -0
- package/registry/examples/app-shell/basic.tsx +31 -0
- package/registry/examples/app-shell/orochia-studio.d.ts +4 -0
- package/registry/examples/app-shell/orochia-studio.js +89 -0
- package/registry/examples/app-shell/orochia-studio.tsx +101 -0
- package/registry/examples/auth-layout/onboarding.d.ts +4 -0
- package/registry/examples/auth-layout/onboarding.js +56 -0
- package/registry/examples/auth-layout/onboarding.tsx +47 -0
- package/registry/examples/auth-layout/sign-in.d.ts +4 -0
- package/registry/examples/auth-layout/sign-in.js +55 -0
- package/registry/examples/auth-layout/sign-in.tsx +47 -0
- package/registry/examples/auth-layout/verify.d.ts +4 -0
- package/registry/examples/auth-layout/verify.js +23 -0
- package/registry/examples/auth-layout/verify.tsx +19 -0
- package/registry/examples/choice-grid/line-up.d.ts +4 -0
- package/registry/examples/choice-grid/line-up.js +37 -0
- package/registry/examples/choice-grid/line-up.tsx +32 -0
- package/registry/examples/choice-grid/plans.d.ts +4 -0
- package/registry/examples/choice-grid/plans.js +28 -0
- package/registry/examples/choice-grid/plans.tsx +24 -0
- package/registry/examples/continue-prompt/arcade.d.ts +4 -0
- package/registry/examples/continue-prompt/arcade.js +28 -0
- package/registry/examples/continue-prompt/arcade.tsx +25 -0
- package/registry/examples/continue-prompt/offer.d.ts +4 -0
- package/registry/examples/continue-prompt/offer.js +24 -0
- package/registry/examples/continue-prompt/offer.tsx +19 -0
- package/registry/examples/dashboard-layout/orazaka-eric.d.ts +4 -0
- package/registry/examples/dashboard-layout/orazaka-eric.js +58 -0
- package/registry/examples/dashboard-layout/orazaka-eric.tsx +80 -0
- package/registry/examples/dashboard-layout/widgets.d.ts +4 -0
- package/registry/examples/dashboard-layout/widgets.js +17 -0
- package/registry/examples/dashboard-layout/widgets.tsx +22 -0
- package/registry/examples/detail-layout/job.d.ts +4 -0
- package/registry/examples/detail-layout/job.js +25 -0
- package/registry/examples/detail-layout/job.tsx +20 -0
- package/registry/examples/detail-layout/video.d.ts +4 -0
- package/registry/examples/detail-layout/video.js +44 -0
- package/registry/examples/detail-layout/video.tsx +53 -0
- package/registry/examples/docs-layout/page.d.ts +4 -0
- package/registry/examples/docs-layout/page.js +26 -0
- package/registry/examples/docs-layout/page.tsx +30 -0
- package/registry/examples/goal-gauge/arcade.d.ts +4 -0
- package/registry/examples/goal-gauge/arcade.js +11 -0
- package/registry/examples/goal-gauge/arcade.tsx +10 -0
- package/registry/examples/goal-gauge/challenge.d.ts +4 -0
- package/registry/examples/goal-gauge/challenge.js +11 -0
- package/registry/examples/goal-gauge/challenge.tsx +10 -0
- package/registry/examples/goal-gauge/drain.d.ts +4 -0
- package/registry/examples/goal-gauge/drain.js +11 -0
- package/registry/examples/goal-gauge/drain.tsx +10 -0
- package/registry/examples/goal-gauge/native/default.d.ts +4 -0
- package/registry/examples/goal-gauge/native/default.dark.png +0 -0
- package/registry/examples/goal-gauge/native/default.js +15 -0
- package/registry/examples/goal-gauge/native/default.light.png +0 -0
- package/registry/examples/goal-gauge/native/default.tsx +12 -0
- package/registry/examples/landscape/backdrop.d.ts +4 -0
- package/registry/examples/landscape/backdrop.js +14 -0
- package/registry/examples/landscape/backdrop.tsx +11 -0
- package/registry/examples/landscape/brand.d.ts +4 -0
- package/registry/examples/landscape/brand.js +11 -0
- package/registry/examples/landscape/brand.tsx +10 -0
- package/registry/examples/marketing-layout/basic.d.ts +4 -0
- package/registry/examples/marketing-layout/basic.js +31 -0
- package/registry/examples/marketing-layout/basic.tsx +28 -0
- package/registry/examples/marketing-layout/docs-hub.d.ts +4 -0
- package/registry/examples/marketing-layout/docs-hub.js +37 -0
- package/registry/examples/marketing-layout/docs-hub.tsx +44 -0
- package/registry/examples/marketing-layout/pricing.d.ts +4 -0
- package/registry/examples/marketing-layout/pricing.js +45 -0
- package/registry/examples/marketing-layout/pricing.tsx +55 -0
- package/registry/examples/marketing-layout/product-page.d.ts +4 -0
- package/registry/examples/marketing-layout/product-page.js +79 -0
- package/registry/examples/marketing-layout/product-page.tsx +83 -0
- package/registry/examples/mascots/native/phoenix.d.ts +4 -0
- package/registry/examples/mascots/native/phoenix.dark.png +0 -0
- package/registry/examples/mascots/native/phoenix.js +21 -0
- package/registry/examples/mascots/native/phoenix.light.png +0 -0
- package/registry/examples/mascots/native/phoenix.tsx +18 -0
- package/registry/examples/mascots/phoenix.d.ts +4 -0
- package/registry/examples/mascots/phoenix.js +14 -0
- package/registry/examples/mascots/phoenix.tsx +11 -0
- package/registry/examples/profile-card/arcade.d.ts +4 -0
- package/registry/examples/profile-card/arcade.js +25 -0
- package/registry/examples/profile-card/arcade.tsx +19 -0
- package/registry/examples/profile-card/creator.d.ts +4 -0
- package/registry/examples/profile-card/creator.js +31 -0
- package/registry/examples/profile-card/creator.tsx +26 -0
- package/registry/examples/profile-card/match.d.ts +4 -0
- package/registry/examples/profile-card/match.js +25 -0
- package/registry/examples/profile-card/match.tsx +19 -0
- package/registry/examples/profile-card/native/default.d.ts +4 -0
- package/registry/examples/profile-card/native/default.dark.png +0 -0
- package/registry/examples/profile-card/native/default.js +27 -0
- package/registry/examples/profile-card/native/default.light.png +0 -0
- package/registry/examples/profile-card/native/default.tsx +22 -0
- package/registry/examples/promise-card/arcade.d.ts +4 -0
- package/registry/examples/promise-card/arcade.js +25 -0
- package/registry/examples/promise-card/arcade.tsx +19 -0
- package/registry/examples/promise-card/guarantee.d.ts +4 -0
- package/registry/examples/promise-card/guarantee.js +23 -0
- package/registry/examples/promise-card/guarantee.tsx +17 -0
- package/registry/examples/scroll-stage/arcade.d.ts +4 -0
- package/registry/examples/scroll-stage/arcade.js +16 -0
- package/registry/examples/scroll-stage/arcade.tsx +15 -0
- package/registry/examples/scroll-stage/chapters.d.ts +4 -0
- package/registry/examples/scroll-stage/chapters.js +25 -0
- package/registry/examples/scroll-stage/chapters.tsx +22 -0
- package/registry/examples/settings-layout/account.d.ts +4 -0
- package/registry/examples/settings-layout/account.js +51 -0
- package/registry/examples/settings-layout/account.tsx +50 -0
- package/registry/examples/settings-layout/sections.d.ts +4 -0
- package/registry/examples/settings-layout/sections.js +27 -0
- package/registry/examples/settings-layout/sections.tsx +24 -0
- package/registry/examples/split-view/empty.d.ts +4 -0
- package/registry/examples/split-view/empty.js +19 -0
- package/registry/examples/split-view/empty.tsx +13 -0
- package/registry/examples/split-view/messages.d.ts +4 -0
- package/registry/examples/split-view/messages.js +49 -0
- package/registry/examples/split-view/messages.tsx +52 -0
- package/registry/examples/stage-banner/round.d.ts +4 -0
- package/registry/examples/stage-banner/round.js +14 -0
- package/registry/examples/stage-banner/round.tsx +11 -0
- package/registry/examples/stage-banner/steps.d.ts +4 -0
- package/registry/examples/stage-banner/steps.js +14 -0
- package/registry/examples/stage-banner/steps.tsx +11 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +322 -0
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +317 -5
- package/registry/iso.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/landscape.json +189 -0
- package/registry/link-card.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/marketing-layout.json +172 -0
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +104 -7
- package/registry/media-capture.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +3 -3
- package/registry/page.json +5 -5
- package/registry/pagination.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/profile-card.json +501 -0
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +228 -0
- package/registry/radio-group.json +1 -1
- package/registry/scroll-stage.json +197 -0
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/settings-layout.json +231 -0
- package/registry/skeleton.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +233 -0
- package/registry/stage-banner.json +221 -0
- package/registry/stat.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/terminal-replay.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/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { S as StoryVariant } from './story-variant-CLn4H5Nt.js';
|
|
3
|
+
|
|
4
|
+
interface ProfileStat {
|
|
5
|
+
/** What it measures (“Response rate”) — passed translated. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** The value, between 0 and `max`. */
|
|
8
|
+
value: number;
|
|
9
|
+
/** The top of the range (default 100). */
|
|
10
|
+
max?: number;
|
|
11
|
+
/** The value in words (“92 %”, “4.8 / 5”); default: the percentage. */
|
|
12
|
+
valueText?: string;
|
|
13
|
+
}
|
|
14
|
+
type ProfileCardProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
15
|
+
/** The portrait: an image, an avatar, a mark. Decorative — the name carries the meaning. */
|
|
16
|
+
visual: React.ReactNode;
|
|
17
|
+
/** The name (the card's heading). */
|
|
18
|
+
name: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* The level of the name.
|
|
21
|
+
* @default "h3"
|
|
22
|
+
*/
|
|
23
|
+
nameAs?: "h2" | "h3" | "h4" | "p";
|
|
24
|
+
/** A small glyph before the name (decorative): a verified mark, an emblem. */
|
|
25
|
+
icon?: React.ReactNode;
|
|
26
|
+
/** The headline gauge's label (“Profile complete”, arcade “Power”); without it, no headline gauge. */
|
|
27
|
+
statLabel?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The headline gauge's value, 0–100.
|
|
30
|
+
* @default 100
|
|
31
|
+
*/
|
|
32
|
+
value?: number;
|
|
33
|
+
/** The headline value in words; default: the percentage. */
|
|
34
|
+
valueText?: string;
|
|
35
|
+
/** What shows as the headline figure instead of `valueText`: a `NumberTicker` that climbs. Decorative. */
|
|
36
|
+
figure?: React.ReactNode;
|
|
37
|
+
/** More gauges under the headline one: two to four, each with its value in words. */
|
|
38
|
+
stats?: readonly ProfileStat[];
|
|
39
|
+
/** One line under the gauges: where they come from, what they do. */
|
|
40
|
+
caption?: React.ReactNode;
|
|
41
|
+
/** Under everything: actions (follow, message), chips. */
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* The diameter of the portrait, in pixels.
|
|
45
|
+
* @default 132 (arcade 196)
|
|
46
|
+
*/
|
|
47
|
+
visualSize?: number;
|
|
48
|
+
/**
|
|
49
|
+
* `default`: a sober card. `arcade`: the fighter card — the brand's light, a ring and a breathing aura, a skewed gauge.
|
|
50
|
+
* @default "default"
|
|
51
|
+
*/
|
|
52
|
+
variant?: StoryVariant;
|
|
53
|
+
/** A brand scope (`orochia` → `.brand-orochia`): the accent and gradient become that brand's. */
|
|
54
|
+
brand?: string;
|
|
55
|
+
};
|
|
56
|
+
/** A profile at a glance: portrait, name, a headline gauge, stats with their values in words, a line and actions. */
|
|
57
|
+
declare function ProfileCard({ visual, name, nameAs: Name, icon, statLabel, value, valueText, figure, stats, caption, children, visualSize, variant, brand, className, style, ...props }: ProfileCardProps): React.JSX.Element;
|
|
58
|
+
|
|
59
|
+
type StatGaugeProps = Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
60
|
+
/** What it measures (“Profile complete”, “Creator share”) — passed translated; the meter's accessible name. */
|
|
61
|
+
label: string;
|
|
62
|
+
/**
|
|
63
|
+
* The value, between 0 and `max`.
|
|
64
|
+
* @default 100
|
|
65
|
+
*/
|
|
66
|
+
value?: number;
|
|
67
|
+
/**
|
|
68
|
+
* The top of the range.
|
|
69
|
+
* @default 100
|
|
70
|
+
*/
|
|
71
|
+
max?: number;
|
|
72
|
+
/** The value in words (“12 of 15”); default: the percentage. Read by assistive technology, shown without `figure`. */
|
|
73
|
+
valueText?: string;
|
|
74
|
+
/** What shows as the figure instead of `valueText`: a `NumberTicker` that climbs, a formatted amount. Decorative. */
|
|
75
|
+
figure?: React.ReactNode;
|
|
76
|
+
/**
|
|
77
|
+
* Hides the label and the figure (the bar alone, named for assistive technology).
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
hideLabel?: boolean;
|
|
81
|
+
};
|
|
82
|
+
/** A measured strength: label, figure and bar; `role="meter"` with `aria-valuetext`. */
|
|
83
|
+
declare function StatGauge({ label, value, max, valueText, figure, hideLabel, className, style, ...props }: StatGaugeProps): React.JSX.Element;
|
|
84
|
+
|
|
85
|
+
export { ProfileCard, type ProfileCardProps, type ProfileStat, StatGauge, type StatGaugeProps };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
brandClass,
|
|
3
|
+
cn,
|
|
4
|
+
storyVariantClass
|
|
5
|
+
} from "./chunk-VCAAHCHL.js";
|
|
6
|
+
|
|
7
|
+
// src/profile-card/stat-gauge.tsx
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var clamp = (n) => Math.min(1, Math.max(0, n));
|
|
10
|
+
function StatGauge({ label, value = 100, max = 100, valueText, figure, hideLabel, className, style, ...props }) {
|
|
11
|
+
const ratio = clamp(value / (max || 1));
|
|
12
|
+
const words = valueText ?? `${Math.round(ratio * 100)} %`;
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
role: "meter",
|
|
17
|
+
"aria-label": label,
|
|
18
|
+
"aria-valuemin": 0,
|
|
19
|
+
"aria-valuemax": 100,
|
|
20
|
+
"aria-valuenow": Math.round(ratio * 100),
|
|
21
|
+
"aria-valuetext": words,
|
|
22
|
+
className: cn("kzs-stat", className),
|
|
23
|
+
style: { "--kzs-ratio": ratio, ...style },
|
|
24
|
+
...props,
|
|
25
|
+
children: [
|
|
26
|
+
!hideLabel && /* @__PURE__ */ jsxs("span", { className: "kzs-stat-head", "aria-hidden": true, children: [
|
|
27
|
+
/* @__PURE__ */ jsx("span", { className: "kzs-stat-label", children: label }),
|
|
28
|
+
/* @__PURE__ */ jsx("span", { className: "kzs-stat-value", children: figure ?? words })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: "kzs-bar", "aria-hidden": true, children: /* @__PURE__ */ jsx("span", { className: "kzs-bar-fill" }) })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/profile-card/profile-card.tsx
|
|
37
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
38
|
+
function ProfileCard({
|
|
39
|
+
visual,
|
|
40
|
+
name,
|
|
41
|
+
nameAs: Name = "h3",
|
|
42
|
+
icon,
|
|
43
|
+
statLabel,
|
|
44
|
+
value = 100,
|
|
45
|
+
valueText,
|
|
46
|
+
figure,
|
|
47
|
+
stats,
|
|
48
|
+
caption,
|
|
49
|
+
children,
|
|
50
|
+
visualSize,
|
|
51
|
+
variant,
|
|
52
|
+
brand,
|
|
53
|
+
className,
|
|
54
|
+
style,
|
|
55
|
+
...props
|
|
56
|
+
}) {
|
|
57
|
+
return /* @__PURE__ */ jsxs2(
|
|
58
|
+
"article",
|
|
59
|
+
{
|
|
60
|
+
className: cn("kzs-profile", storyVariantClass(variant), brandClass(brand), className),
|
|
61
|
+
style: visualSize ? { "--kzs-disc": `${visualSize}px`, ...style } : style,
|
|
62
|
+
...props,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx2("span", { className: "kzs-texture", "aria-hidden": true }),
|
|
65
|
+
/* @__PURE__ */ jsxs2("div", { className: "kzs-profile-disc", "aria-hidden": true, children: [
|
|
66
|
+
/* @__PURE__ */ jsx2("span", { className: "kzs-profile-ring" }),
|
|
67
|
+
/* @__PURE__ */ jsx2("span", { className: "kzs-profile-aura kzs-loop" }),
|
|
68
|
+
/* @__PURE__ */ jsx2("span", { className: "kzs-profile-flash" }),
|
|
69
|
+
/* @__PURE__ */ jsx2("span", { className: "kzs-profile-visual", children: visual })
|
|
70
|
+
] }),
|
|
71
|
+
/* @__PURE__ */ jsxs2(Name, { className: "kzs-profile-name", children: [
|
|
72
|
+
icon && /* @__PURE__ */ jsx2("span", { "aria-hidden": true, children: icon }),
|
|
73
|
+
name
|
|
74
|
+
] }),
|
|
75
|
+
statLabel && /* @__PURE__ */ jsx2(StatGauge, { label: statLabel, value, valueText, figure }),
|
|
76
|
+
stats && stats.length > 0 && /* @__PURE__ */ jsx2("ul", { className: "kzs-profile-stats", children: stats.map((s) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsx2(StatGauge, { label: s.label, value: s.value, max: s.max, valueText: s.valueText }) }, s.label)) }),
|
|
77
|
+
caption && /* @__PURE__ */ jsx2("p", { className: "kzs-profile-caption", children: caption }),
|
|
78
|
+
children && /* @__PURE__ */ jsx2("div", { className: "kzs-profile-extra", children })
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
ProfileCard,
|
|
85
|
+
StatGauge
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=profile-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/profile-card/stat-gauge.tsx","../src/profile-card/profile-card.tsx"],"sourcesContent":["// Server-safe. One measured strength: a label, its figure, a bar (story.css) — the gauge of a ProfileCard, also usable\n// alone (in a ChoiceGrid tile, a list). A `meter` with its value in words.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type StatGaugeProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> & {\n /** What it measures (“Profile complete”, “Creator share”) — passed translated; the meter's accessible name. */\n label: string;\n /**\n * The value, between 0 and `max`.\n * @default 100\n */\n value?: number;\n /**\n * The top of the range.\n * @default 100\n */\n max?: number;\n /** The value in words (“12 of 15”); default: the percentage. Read by assistive technology, shown without `figure`. */\n valueText?: string;\n /** What shows as the figure instead of `valueText`: a `NumberTicker` that climbs, a formatted amount. Decorative. */\n figure?: React.ReactNode;\n /**\n * Hides the label and the figure (the bar alone, named for assistive technology).\n * @default false\n */\n hideLabel?: boolean;\n};\n\nconst clamp = (n: number) => Math.min(1, Math.max(0, n));\n\n/** A measured strength: label, figure and bar; `role=\"meter\"` with `aria-valuetext`. */\nexport function StatGauge({ label, value = 100, max = 100, valueText, figure, hideLabel, className, style, ...props }: StatGaugeProps) {\n const ratio = clamp(value / (max || 1));\n const words = valueText ?? `${Math.round(ratio * 100)} %`;\n return (\n <div\n role=\"meter\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(ratio * 100)}\n aria-valuetext={words}\n className={cn(\"kzs-stat\", className)}\n style={{ \"--kzs-ratio\": ratio, ...style } as React.CSSProperties}\n {...props}\n >\n {!hideLabel && (\n <span className=\"kzs-stat-head\" aria-hidden>\n <span className=\"kzs-stat-label\">{label}</span>\n <span className=\"kzs-stat-value\">{figure ?? words}</span>\n </span>\n )}\n <span className=\"kzs-bar\" aria-hidden>\n <span className=\"kzs-bar-fill\" />\n </span>\n </div>\n );\n}\n","// Server-safe. A profile at a glance (story.css): a portrait, a name, one headline gauge, a few stats, a line — a creator,\n// a match, a plan, a team member. In a `Scene` of a `ScrollStage` the card arrives and its gauges fill, once.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { brandClass, type StoryVariant, storyVariantClass } from \"../story-variant\";\nimport { StatGauge } from \"./stat-gauge\";\n\nexport interface ProfileStat {\n /** What it measures (“Response rate”) — passed translated. */\n label: string;\n /** The value, between 0 and `max`. */\n value: number;\n /** The top of the range (default 100). */\n max?: number;\n /** The value in words (“92 %”, “4.8 / 5”); default: the percentage. */\n valueText?: string;\n}\n\nexport type ProfileCardProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The portrait: an image, an avatar, a mark. Decorative — the name carries the meaning. */\n visual: React.ReactNode;\n /** The name (the card's heading). */\n name: React.ReactNode;\n /**\n * The level of the name.\n * @default \"h3\"\n */\n nameAs?: \"h2\" | \"h3\" | \"h4\" | \"p\";\n /** A small glyph before the name (decorative): a verified mark, an emblem. */\n icon?: React.ReactNode;\n /** The headline gauge's label (“Profile complete”, arcade “Power”); without it, no headline gauge. */\n statLabel?: string;\n /**\n * The headline gauge's value, 0–100.\n * @default 100\n */\n value?: number;\n /** The headline value in words; default: the percentage. */\n valueText?: string;\n /** What shows as the headline figure instead of `valueText`: a `NumberTicker` that climbs. Decorative. */\n figure?: React.ReactNode;\n /** More gauges under the headline one: two to four, each with its value in words. */\n stats?: readonly ProfileStat[];\n /** One line under the gauges: where they come from, what they do. */\n caption?: React.ReactNode;\n /** Under everything: actions (follow, message), chips. */\n children?: React.ReactNode;\n /**\n * The diameter of the portrait, in pixels.\n * @default 132 (arcade 196)\n */\n visualSize?: number;\n /**\n * `default`: a sober card. `arcade`: the fighter card — the brand's light, a ring and a breathing aura, a skewed gauge.\n * @default \"default\"\n */\n variant?: StoryVariant;\n /** A brand scope (`orochia` → `.brand-orochia`): the accent and gradient become that brand's. */\n brand?: string;\n};\n\n/** A profile at a glance: portrait, name, a headline gauge, stats with their values in words, a line and actions. */\nexport function ProfileCard({\n visual,\n name,\n nameAs: Name = \"h3\",\n icon,\n statLabel,\n value = 100,\n valueText,\n figure,\n stats,\n caption,\n children,\n visualSize,\n variant,\n brand,\n className,\n style,\n ...props\n}: ProfileCardProps) {\n return (\n <article\n className={cn(\"kzs-profile\", storyVariantClass(variant), brandClass(brand), className)}\n style={visualSize ? ({ \"--kzs-disc\": `${visualSize}px`, ...style } as React.CSSProperties) : style}\n {...props}\n >\n <span className=\"kzs-texture\" aria-hidden />\n <div className=\"kzs-profile-disc\" aria-hidden>\n <span className=\"kzs-profile-ring\" />\n <span className=\"kzs-profile-aura kzs-loop\" />\n <span className=\"kzs-profile-flash\" />\n <span className=\"kzs-profile-visual\">{visual}</span>\n </div>\n <Name className=\"kzs-profile-name\">\n {icon && <span aria-hidden>{icon}</span>}\n {name}\n </Name>\n {statLabel && <StatGauge label={statLabel} value={value} valueText={valueText} figure={figure} />}\n {stats && stats.length > 0 && (\n <ul className=\"kzs-profile-stats\">\n {stats.map((s) => (\n <li key={s.label}>\n <StatGauge label={s.label} value={s.value} max={s.max} valueText={s.valueText} />\n </li>\n ))}\n </ul>\n )}\n {caption && <p className=\"kzs-profile-caption\">{caption}</p>}\n {children && <div className=\"kzs-profile-extra\">{children}</div>}\n </article>\n );\n}\n"],"mappings":";;;;;;;AAiDQ,SACE,KADF;AAnBR,IAAM,QAAQ,CAAC,MAAc,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;AAGhD,SAAS,UAAU,EAAE,OAAO,QAAQ,KAAK,MAAM,KAAK,WAAW,QAAQ,WAAW,WAAW,OAAO,GAAG,MAAM,GAAmB;AACrI,QAAM,QAAQ,MAAM,SAAS,OAAO,EAAE;AACtC,QAAM,QAAQ,aAAa,GAAG,KAAK,MAAM,QAAQ,GAAG,CAAC;AACrD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAY;AAAA,MACZ,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,iBAAe,KAAK,MAAM,QAAQ,GAAG;AAAA,MACrC,kBAAgB;AAAA,MAChB,WAAW,GAAG,YAAY,SAAS;AAAA,MACnC,OAAO,EAAE,eAAe,OAAO,GAAG,MAAM;AAAA,MACvC,GAAG;AAAA,MAEH;AAAA,SAAC,aACA,qBAAC,UAAK,WAAU,iBAAgB,eAAW,MACzC;AAAA,8BAAC,UAAK,WAAU,kBAAkB,iBAAM;AAAA,UACxC,oBAAC,UAAK,WAAU,kBAAkB,oBAAU,OAAM;AAAA,WACpD;AAAA,QAEF,oBAAC,UAAK,WAAU,WAAU,eAAW,MACnC,8BAAC,UAAK,WAAU,gBAAe,GACjC;AAAA;AAAA;AAAA,EACF;AAEJ;;;AC6BM,gBAAAA,MACA,QAAAC,aADA;AAzBC,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA,QAAQ,OAAO;AAAA,EACf;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAqB;AACnB,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,eAAe,kBAAkB,OAAO,GAAG,WAAW,KAAK,GAAG,SAAS;AAAA,MACrF,OAAO,aAAc,EAAE,cAAc,GAAG,UAAU,MAAM,GAAG,MAAM,IAA4B;AAAA,MAC5F,GAAG;AAAA,MAEJ;AAAA,wBAAAD,KAAC,UAAK,WAAU,eAAc,eAAW,MAAC;AAAA,QAC1C,gBAAAC,MAAC,SAAI,WAAU,oBAAmB,eAAW,MAC3C;AAAA,0BAAAD,KAAC,UAAK,WAAU,oBAAmB;AAAA,UACnC,gBAAAA,KAAC,UAAK,WAAU,6BAA4B;AAAA,UAC5C,gBAAAA,KAAC,UAAK,WAAU,qBAAoB;AAAA,UACpC,gBAAAA,KAAC,UAAK,WAAU,sBAAsB,kBAAO;AAAA,WAC/C;AAAA,QACA,gBAAAC,MAAC,QAAK,WAAU,oBACb;AAAA,kBAAQ,gBAAAD,KAAC,UAAK,eAAW,MAAE,gBAAK;AAAA,UAChC;AAAA,WACH;AAAA,QACC,aAAa,gBAAAA,KAAC,aAAU,OAAO,WAAW,OAAc,WAAsB,QAAgB;AAAA,QAC9F,SAAS,MAAM,SAAS,KACvB,gBAAAA,KAAC,QAAG,WAAU,qBACX,gBAAM,IAAI,CAAC,MACV,gBAAAA,KAAC,QACC,0BAAAA,KAAC,aAAU,OAAO,EAAE,OAAO,OAAO,EAAE,OAAO,KAAK,EAAE,KAAK,WAAW,EAAE,WAAW,KADxE,EAAE,KAEX,CACD,GACH;AAAA,QAED,WAAW,gBAAAA,KAAC,OAAE,WAAU,uBAAuB,mBAAQ;AAAA,QACvD,YAAY,gBAAAA,KAAC,SAAI,WAAU,qBAAqB,UAAS;AAAA;AAAA;AAAA,EAC5D;AAEJ;","names":["jsx","jsxs"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { S as StoryVariant } from './story-variant-CLn4H5Nt.js';
|
|
3
|
+
|
|
4
|
+
type PromiseCardProps = Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
5
|
+
/** What kind of promise (“Our promise”, “Shortcut”, arcade “Special move”). */
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/** The promise itself, in a few words. */
|
|
8
|
+
promise: React.ReactNode;
|
|
9
|
+
/** The keys that call it, in order (`["⌘", "K"]`); in a stage they light one by one before the promise lands. Decorative. */
|
|
10
|
+
keys?: readonly string[];
|
|
11
|
+
/** Who carries it: a bird of the flock (`Mascot`, 48 px), an avatar. Decorative. */
|
|
12
|
+
bearer?: React.ReactNode;
|
|
13
|
+
/** Above the bearer's name (“In the corner”, “Kept by”). */
|
|
14
|
+
bearerLabel?: React.ReactNode;
|
|
15
|
+
/** The bearer's name and role. */
|
|
16
|
+
bearerName?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* `default`: a calm card with its keys as key-caps. `arcade`: the combo card — the keys pressed one by one, a flash.
|
|
19
|
+
* @default "default"
|
|
20
|
+
*/
|
|
21
|
+
variant?: StoryVariant;
|
|
22
|
+
/** A brand scope (`orazaka` → `.brand-orazaka`). */
|
|
23
|
+
brand?: string;
|
|
24
|
+
};
|
|
25
|
+
/** A promise, the keys that call it and who carries it. */
|
|
26
|
+
declare function PromiseCard({ label, promise, keys, bearer, bearerLabel, bearerName, variant, brand, className, ...props }: PromiseCardProps): React.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { PromiseCard, type PromiseCardProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
brandClass,
|
|
3
|
+
cn,
|
|
4
|
+
storyVariantClass
|
|
5
|
+
} from "./chunk-VCAAHCHL.js";
|
|
6
|
+
|
|
7
|
+
// src/promise-card/promise-card.tsx
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function PromiseCard({ label, promise, keys, bearer, bearerLabel, bearerName, variant, brand, className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("kzs-promise", storyVariantClass(variant), brandClass(brand), className), ...props, children: [
|
|
11
|
+
/* @__PURE__ */ jsx("span", { className: "kzs-promise-flash", "aria-hidden": true }),
|
|
12
|
+
/* @__PURE__ */ jsxs("div", { className: "kzs-promise-head", children: [
|
|
13
|
+
/* @__PURE__ */ jsx("span", { className: "kzs-promise-label", children: label }),
|
|
14
|
+
keys && keys.length > 0 && /* @__PURE__ */ jsx("span", { className: "kzs-promise-keys", "aria-hidden": true, children: keys.map((k, i) => /* @__PURE__ */ jsx("kbd", { className: "kzs-key", style: { "--k": i }, children: k }, i)) })
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ jsx("p", { className: "kzs-promise-text", children: promise }),
|
|
17
|
+
(bearer || bearerName) && /* @__PURE__ */ jsxs("div", { className: "kzs-promise-bearer", children: [
|
|
18
|
+
bearer && /* @__PURE__ */ jsx("span", { className: "kzs-promise-bird", "aria-hidden": true, children: bearer }),
|
|
19
|
+
/* @__PURE__ */ jsxs("span", { className: "kzs-promise-who", children: [
|
|
20
|
+
bearerLabel && /* @__PURE__ */ jsx("span", { className: "kzs-promise-bearer-label", children: bearerLabel }),
|
|
21
|
+
bearerName && /* @__PURE__ */ jsx("span", { className: "kzs-promise-name", children: bearerName })
|
|
22
|
+
] })
|
|
23
|
+
] })
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
PromiseCard
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=promise-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/promise-card/promise-card.tsx"],"sourcesContent":["// Server-safe. A promise, the keys that call it, and who carries it (story.css): a product's guarantee, a shortcut and\n// what it does, a rule of the house — “Your data never leaves home”, called by ← ↙ ↓ ↘ → K, carried by the owl.\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { brandClass, type StoryVariant, storyVariantClass } from \"../story-variant\";\n\nexport type PromiseCardProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> & {\n /** What kind of promise (“Our promise”, “Shortcut”, arcade “Special move”). */\n label: React.ReactNode;\n /** The promise itself, in a few words. */\n promise: React.ReactNode;\n /** The keys that call it, in order (`[\"⌘\", \"K\"]`); in a stage they light one by one before the promise lands. Decorative. */\n keys?: readonly string[];\n /** Who carries it: a bird of the flock (`Mascot`, 48 px), an avatar. Decorative. */\n bearer?: React.ReactNode;\n /** Above the bearer's name (“In the corner”, “Kept by”). */\n bearerLabel?: React.ReactNode;\n /** The bearer's name and role. */\n bearerName?: React.ReactNode;\n /**\n * `default`: a calm card with its keys as key-caps. `arcade`: the combo card — the keys pressed one by one, a flash.\n * @default \"default\"\n */\n variant?: StoryVariant;\n /** A brand scope (`orazaka` → `.brand-orazaka`). */\n brand?: string;\n};\n\n/** A promise, the keys that call it and who carries it. */\nexport function PromiseCard({ label, promise, keys, bearer, bearerLabel, bearerName, variant, brand, className, ...props }: PromiseCardProps) {\n return (\n <div className={cn(\"kzs-promise\", storyVariantClass(variant), brandClass(brand), className)} {...props}>\n <span className=\"kzs-promise-flash\" aria-hidden />\n <div className=\"kzs-promise-head\">\n <span className=\"kzs-promise-label\">{label}</span>\n {keys && keys.length > 0 && (\n <span className=\"kzs-promise-keys\" aria-hidden>\n {keys.map((k, i) => (\n <kbd key={i} className=\"kzs-key\" style={{ \"--k\": i } as React.CSSProperties}>\n {k}\n </kbd>\n ))}\n </span>\n )}\n </div>\n <p className=\"kzs-promise-text\">{promise}</p>\n {(bearer || bearerName) && (\n <div className=\"kzs-promise-bearer\">\n {bearer && (\n <span className=\"kzs-promise-bird\" aria-hidden>\n {bearer}\n </span>\n )}\n <span className=\"kzs-promise-who\">\n {bearerLabel && <span className=\"kzs-promise-bearer-label\">{bearerLabel}</span>}\n {bearerName && <span className=\"kzs-promise-name\">{bearerName}</span>}\n </span>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAiCM,cACA,YADA;AAHC,SAAS,YAAY,EAAE,OAAO,SAAS,MAAM,QAAQ,aAAa,YAAY,SAAS,OAAO,WAAW,GAAG,MAAM,GAAqB;AAC5I,SACE,qBAAC,SAAI,WAAW,GAAG,eAAe,kBAAkB,OAAO,GAAG,WAAW,KAAK,GAAG,SAAS,GAAI,GAAG,OAC/F;AAAA,wBAAC,UAAK,WAAU,qBAAoB,eAAW,MAAC;AAAA,IAChD,qBAAC,SAAI,WAAU,oBACb;AAAA,0BAAC,UAAK,WAAU,qBAAqB,iBAAM;AAAA,MAC1C,QAAQ,KAAK,SAAS,KACrB,oBAAC,UAAK,WAAU,oBAAmB,eAAW,MAC3C,eAAK,IAAI,CAAC,GAAG,MACZ,oBAAC,SAAY,WAAU,WAAU,OAAO,EAAE,OAAO,EAAE,GAChD,eADO,CAEV,CACD,GACH;AAAA,OAEJ;AAAA,IACA,oBAAC,OAAE,WAAU,oBAAoB,mBAAQ;AAAA,KACvC,UAAU,eACV,qBAAC,SAAI,WAAU,sBACZ;AAAA,gBACC,oBAAC,UAAK,WAAU,oBAAmB,eAAW,MAC3C,kBACH;AAAA,MAEF,qBAAC,UAAK,WAAU,mBACb;AAAA,uBAAe,oBAAC,UAAK,WAAU,4BAA4B,uBAAY;AAAA,QACvE,cAAc,oBAAC,UAAK,WAAU,oBAAoB,sBAAW;AAAA,SAChE;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
|