@krizaka/ui 3.5.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/app-shell.d.ts +24 -22
- package/dist/app-shell.js +9 -3
- package/dist/app-shell.js.map +1 -1
- package/dist/chat.js +2 -1
- package/dist/chat.js.map +1 -1
- package/dist/chunk-3GODX3D6.js +25 -0
- package/dist/chunk-3GODX3D6.js.map +1 -0
- package/dist/{chunk-F2GKFIYK.js → chunk-CURW36FI.js} +1 -1
- package/dist/chunk-JXLDUDTD.js +2 -0
- package/dist/chunk-JXLDUDTD.js.map +1 -0
- package/dist/{chunk-R6SDS7JM.js → chunk-ND3L5VHT.js} +25 -2
- package/dist/chunk-ND3L5VHT.js.map +1 -0
- package/dist/chunk-NPF3OHE2.js +2 -0
- package/dist/chunk-NPF3OHE2.js.map +1 -0
- package/dist/{chunk-ECSCA3CN.js → chunk-UOMP6VOZ.js} +1 -1
- package/dist/command.js +1 -1
- package/dist/data-table.js +2 -1
- package/dist/data-table.js.map +1 -1
- package/dist/dialog.js +7 -3
- package/dist/dialog.js.map +1 -1
- package/dist/loader.d.ts +21 -1
- package/dist/loader.js +7 -3
- package/dist/loader.js.map +1 -1
- package/dist/map.js +7 -1
- package/dist/map.js.map +1 -1
- package/dist/marketing-layout.d.ts +3 -9
- package/dist/marketing-layout.js +24 -7
- package/dist/marketing-layout.js.map +1 -1
- package/dist/match-dialog.d.ts +3 -1
- package/dist/match-dialog.js +29 -5
- package/dist/match-dialog.js.map +1 -1
- package/dist/native/vertical-video.d.ts +102 -0
- package/dist/native/vertical-video.js +163 -0
- package/dist/native/vertical-video.js.map +1 -0
- package/dist/native.d.ts +65 -2
- package/dist/native.js +960 -878
- package/dist/native.js.map +1 -1
- package/dist/skip-link.d.ts +15 -0
- package/dist/skip-link.js +10 -0
- package/dist/skip-link.js.map +1 -0
- package/dist/tree-view.d.ts +2 -0
- package/dist/tree-view.js.map +1 -1
- package/dist/vertical-video.d.ts +112 -0
- package/dist/vertical-video.js +307 -0
- package/dist/vertical-video.js.map +1 -0
- package/package.json +56 -8
- package/registry/achievement.json +2 -1
- package/registry/action-bar.json +2 -1
- package/registry/action-sheet.json +1 -0
- package/registry/activity-feed.json +2 -1
- package/registry/alert.json +2 -1
- package/registry/app-shell.json +27 -5
- package/registry/argument-card.json +2 -1
- package/registry/audio-player.json +2 -1
- package/registry/auth-layout.json +7 -2
- package/registry/avatar.json +7 -6
- package/registry/badge.json +2 -1
- package/registry/button.json +2 -1
- package/registry/card-grid.json +2 -1
- package/registry/card.json +2 -1
- package/registry/catalogue-page.json +5 -2
- package/registry/changelog-page.json +5 -2
- package/registry/chat.json +2 -1
- package/registry/checkbox.json +2 -1
- package/registry/chip-link.json +2 -1
- package/registry/chip.json +2 -1
- package/registry/choice-grid.json +2 -1
- package/registry/cn.json +1 -0
- package/registry/code-block.json +2 -1
- package/registry/combobox.json +2 -1
- package/registry/command.json +2 -1
- package/registry/component-page.json +5 -2
- package/registry/confirm-button.json +2 -1
- package/registry/contact-page.json +5 -2
- package/registry/continue-prompt.json +2 -1
- package/registry/countdown.json +2 -1
- package/registry/cta-panel.json +2 -1
- package/registry/dashboard-layout.json +5 -2
- package/registry/data-table.json +2 -1
- package/registry/date-picker.json +3 -2
- package/registry/decision-list.json +2 -1
- package/registry/description-list.json +2 -1
- package/registry/detail-layout.json +16 -2
- package/registry/dialog.json +10 -4
- package/registry/docs-article-page.json +16 -2
- package/registry/docs-hub-page.json +5 -2
- package/registry/docs-layout.json +2 -1
- package/registry/dropdown-menu.json +2 -1
- package/registry/empty-state.json +14 -2
- package/registry/error-page.json +5 -2
- package/registry/examples/avatar/group.js +4 -7
- package/registry/examples/avatar/group.tsx +4 -11
- package/registry/examples/avatar/native/group.dark.png +0 -0
- package/registry/examples/avatar/native/group.js +4 -4
- package/registry/examples/avatar/native/group.light.png +0 -0
- package/registry/examples/avatar/native/group.tsx +4 -4
- package/registry/examples/avatar/native/presence.dark.png +0 -0
- package/registry/examples/avatar/native/presence.js +8 -5
- package/registry/examples/avatar/native/presence.light.png +0 -0
- package/registry/examples/avatar/native/presence.tsx +9 -5
- package/registry/examples/avatar/with-image.js +1 -4
- package/registry/examples/avatar/with-image.tsx +2 -9
- package/registry/examples/detail-layout/checkout.d.ts +4 -0
- package/registry/examples/detail-layout/checkout.js +37 -0
- package/registry/examples/detail-layout/checkout.tsx +44 -0
- package/registry/examples/docs-article-page/faq.d.ts +4 -0
- package/registry/examples/docs-article-page/faq.js +31 -0
- package/registry/examples/docs-article-page/faq.tsx +40 -0
- package/registry/examples/empty-state/library.d.ts +4 -0
- package/registry/examples/empty-state/library.js +25 -0
- package/registry/examples/empty-state/library.tsx +20 -0
- package/registry/examples/loader/branded.d.ts +4 -0
- package/registry/examples/loader/branded.js +12 -0
- package/registry/examples/loader/branded.tsx +7 -0
- package/registry/examples/loader/native/branded.d.ts +4 -0
- package/registry/examples/loader/native/branded.dark.png +0 -0
- package/registry/examples/loader/native/branded.js +12 -0
- package/registry/examples/loader/native/branded.light.png +0 -0
- package/registry/examples/loader/native/branded.tsx +11 -0
- package/registry/examples/longform-page/case-study.d.ts +4 -0
- package/registry/examples/longform-page/case-study.js +41 -0
- package/registry/examples/longform-page/case-study.tsx +40 -0
- package/registry/examples/profile-card/creator.js +2 -2
- package/registry/examples/profile-card/creator.tsx +2 -2
- package/registry/examples/profile-card/match.js +2 -2
- package/registry/examples/profile-card/match.tsx +2 -2
- package/registry/examples/profile-card/native/default.dark.png +0 -0
- package/registry/examples/profile-card/native/default.js +2 -2
- package/registry/examples/profile-card/native/default.light.png +0 -0
- package/registry/examples/profile-card/native/default.tsx +2 -2
- package/registry/examples/pull-to-refresh/native/branded.d.ts +4 -0
- package/registry/examples/pull-to-refresh/native/branded.dark.png +0 -0
- package/registry/examples/pull-to-refresh/native/branded.js +14 -0
- package/registry/examples/pull-to-refresh/native/branded.light.png +0 -0
- package/registry/examples/pull-to-refresh/native/branded.tsx +23 -0
- package/registry/examples/screen/native/app-shell.dark.png +0 -0
- package/registry/examples/screen/native/app-shell.js +1 -1
- package/registry/examples/screen/native/app-shell.light.png +0 -0
- package/registry/examples/screen/native/app-shell.tsx +1 -1
- package/registry/examples/screen/native/feed.dark.png +0 -0
- package/registry/examples/screen/native/feed.js +31 -14
- package/registry/examples/screen/native/feed.light.png +0 -0
- package/registry/examples/screen/native/feed.tsx +28 -24
- package/registry/examples/screen/native/map.d.ts +4 -0
- package/registry/examples/screen/native/map.dark.png +0 -0
- package/registry/examples/screen/native/map.js +26 -0
- package/registry/examples/screen/native/map.light.png +0 -0
- package/registry/examples/screen/native/map.tsx +31 -0
- package/registry/examples/screen/native/notifications.d.ts +4 -0
- package/registry/examples/screen/native/notifications.dark.png +0 -0
- package/registry/examples/screen/native/notifications.js +21 -0
- package/registry/examples/screen/native/notifications.light.png +0 -0
- package/registry/examples/screen/native/notifications.tsx +21 -0
- package/registry/examples/screen/native/profile.dark.png +0 -0
- package/registry/examples/screen/native/profile.js +2 -2
- package/registry/examples/screen/native/profile.light.png +0 -0
- package/registry/examples/screen/native/profile.tsx +2 -2
- package/registry/examples/skip-link/default.d.ts +4 -0
- package/registry/examples/skip-link/default.js +19 -0
- package/registry/examples/skip-link/default.tsx +12 -0
- package/registry/examples/splash-handoff/native/default.d.ts +4 -0
- package/registry/examples/splash-handoff/native/default.dark.png +0 -0
- package/registry/examples/splash-handoff/native/default.js +12 -0
- package/registry/examples/splash-handoff/native/default.light.png +0 -0
- package/registry/examples/splash-handoff/native/default.tsx +11 -0
- package/registry/examples/split-view/nearby.d.ts +4 -0
- package/registry/examples/split-view/nearby.js +33 -0
- package/registry/examples/split-view/nearby.tsx +45 -0
- package/registry/examples/split-view/notifications.d.ts +4 -0
- package/registry/examples/split-view/notifications.js +33 -0
- package/registry/examples/split-view/notifications.tsx +31 -0
- package/registry/examples/status-page/maintenance.d.ts +4 -0
- package/registry/examples/status-page/maintenance.js +29 -0
- package/registry/examples/status-page/maintenance.tsx +24 -0
- package/registry/examples/swipe-deck/discover.js +2 -3
- package/registry/examples/swipe-deck/discover.tsx +2 -3
- package/registry/examples/swipe-deck/native/discover.dark.png +0 -0
- package/registry/examples/swipe-deck/native/discover.js +2 -3
- package/registry/examples/swipe-deck/native/discover.light.png +0 -0
- package/registry/examples/swipe-deck/native/discover.tsx +2 -3
- package/registry/examples/vertical-video/feed.d.ts +4 -0
- package/registry/examples/vertical-video/feed.js +40 -0
- package/registry/examples/vertical-video/feed.tsx +36 -0
- package/registry/examples/vertical-video/native/rail.d.ts +4 -0
- package/registry/examples/vertical-video/native/rail.dark.png +0 -0
- package/registry/examples/vertical-video/native/rail.js +39 -0
- package/registry/examples/vertical-video/native/rail.light.png +0 -0
- package/registry/examples/vertical-video/native/rail.tsx +37 -0
- package/registry/examples/vertical-video/rail.d.ts +4 -0
- package/registry/examples/vertical-video/rail.js +39 -0
- package/registry/examples/vertical-video/rail.tsx +39 -0
- package/registry/fab.json +1 -0
- package/registry/field.json +2 -1
- package/registry/file-upload.json +3 -2
- package/registry/filter-bar.json +2 -1
- package/registry/form.json +3 -2
- package/registry/gallery-page.json +5 -2
- package/registry/glow-card.json +2 -1
- package/registry/goal-gauge.json +2 -1
- package/registry/header.json +1 -0
- package/registry/how-it-works-page.json +5 -2
- package/registry/image-cropper.json +2 -1
- package/registry/image-viewer.json +1 -0
- package/registry/index.json +492 -22
- package/registry/iso.json +2 -1
- package/registry/kanban.json +2 -1
- package/registry/kbd.json +2 -1
- package/registry/landing-page.json +5 -2
- package/registry/landscape.json +2 -1
- package/registry/legal-page.json +5 -2
- package/registry/link-card.json +2 -1
- package/registry/list.json +2 -1
- package/registry/loader.json +47 -3
- package/registry/longform-page.json +16 -2
- package/registry/map.json +4 -3
- package/registry/marketing-layout.json +13 -4
- package/registry/marquee.json +2 -1
- package/registry/mascot-quote.json +2 -1
- package/registry/mascot-state.json +2 -1
- package/registry/mascots.json +2 -1
- package/registry/match-dialog.json +17 -2
- package/registry/media-capture.json +2 -1
- package/registry/media-picker.json +1 -0
- package/registry/meter.json +2 -1
- package/registry/nav-bar.json +2 -1
- package/registry/number-ticker.json +2 -1
- package/registry/onboarding.json +1 -0
- package/registry/otp-input.json +1 -0
- package/registry/page-header.json +2 -1
- package/registry/page-hero.json +2 -1
- package/registry/page.json +2 -1
- package/registry/pagination.json +2 -1
- package/registry/permission-prompt.json +1 -0
- package/registry/photo-grid.json +2 -1
- package/registry/pointer-light.json +2 -1
- package/registry/popover.json +2 -1
- package/registry/pricing-page.json +5 -2
- package/registry/product-page.json +5 -2
- package/registry/profile-card.json +6 -5
- package/registry/progress.json +2 -1
- package/registry/promise-card.json +2 -1
- package/registry/pull-to-refresh.json +68 -4
- package/registry/radio-group.json +2 -1
- package/registry/screen.json +55 -6
- package/registry/scroll-stage.json +2 -1
- package/registry/search-field.json +2 -1
- package/registry/section-backdrop.json +2 -1
- package/registry/segmented.json +1 -0
- package/registry/separator.json +2 -1
- package/registry/settings-layout.json +5 -2
- package/registry/skeleton.json +2 -1
- package/registry/skip-link.json +122 -0
- package/registry/slider.json +2 -1
- package/registry/slot.json +2 -1
- package/registry/spinner.json +2 -1
- package/registry/splash-handoff.json +138 -0
- package/registry/split-view.json +27 -2
- package/registry/stage-banner.json +2 -1
- package/registry/stat.json +2 -1
- package/registry/status-page.json +18 -2
- package/registry/step-progress.json +2 -1
- package/registry/stepper.json +2 -1
- package/registry/swipe-deck.json +5 -4
- package/registry/swipeable-row.json +1 -0
- package/registry/switch.json +2 -1
- package/registry/tab-bar.json +1 -0
- package/registry/tabs.json +2 -1
- package/registry/tag-input.json +2 -1
- package/registry/tag-selector.json +2 -1
- package/registry/terminal-replay.json +2 -1
- package/registry/theme.json +2 -1
- package/registry/toast.json +2 -1
- package/registry/toc.json +2 -1
- package/registry/tooltip.json +2 -1
- package/registry/tree-view.json +10 -4
- package/registry/txt.json +1 -0
- package/registry/verified-badge.json +2 -1
- package/registry/vertical-video.json +871 -0
- package/registry/video-player.json +2 -1
- package/registry/video-trimmer.json +2 -1
- package/registry/virtual.json +2 -1
- package/dist/chunk-R6SDS7JM.js.map +0 -1
- /package/dist/{chunk-F2GKFIYK.js.map → chunk-CURW36FI.js.map} +0 -0
- /package/dist/{chunk-ECSCA3CN.js.map → chunk-UOMP6VOZ.js.map} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
declare const skipLink: tailwind_variants.TVReturnType<{} | {} | {}, undefined, string, {} | {}, undefined, tailwind_variants.TVReturnTypeLike<unknown, undefined>>;
|
|
5
|
+
type SkipLinkProps = Omit<React.ComponentProps<"a">, "href"> & {
|
|
6
|
+
/**
|
|
7
|
+
* The content to land on: `#` and its `id`. The element becomes focusable (`tabindex="-1"`) when it is not.
|
|
8
|
+
* @default "#content"
|
|
9
|
+
*/
|
|
10
|
+
href?: `#${string}`;
|
|
11
|
+
};
|
|
12
|
+
/** A "skip to content" link: the first tab stop, hidden until focused; Enter moves focus to the target. */
|
|
13
|
+
declare function SkipLink({ href, className, onClick, children, ...props }: SkipLinkProps): React.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { SkipLink, type SkipLinkProps, skipLink };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/tree-view.d.ts
CHANGED
|
@@ -105,6 +105,8 @@ type TreeViewProps = {
|
|
|
105
105
|
/**
|
|
106
106
|
* A hierarchy to browse — documentation sections, a studio's datasets, folders: one tab stop, the arrows walk it (→
|
|
107
107
|
* opens, ← closes or goes up), Home/End, a letter jumps to the next name; branches can load their children on demand.
|
|
108
|
+
*
|
|
109
|
+
* @deprecated Since 3.6.0, removed in 4.0.0: no product uses it. Drill down with `List` instead.
|
|
108
110
|
*/
|
|
109
111
|
declare function TreeView({ nodes, "aria-label": label, expanded: expandedProp, defaultExpanded, onExpandedChange, selected: selectedProp, defaultSelected, onSelect, onLoadChildren, loadingLabel, className, }: TreeViewProps): React.JSX.Element;
|
|
110
112
|
|
package/dist/tree-view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tree-view/tree-view.tsx"],"sourcesContent":["// Client (expansion, selection, the roving focus). A hierarchy the keyboard walks — the ARIA tree pattern: one tab\n// stop, the arrows move and open, Home/End, typing a letter jumps; children loaded on demand when a branch opens.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { ChevronGlyph } from \"../glyphs\";\nimport { useControllable } from \"../media\";\n\nexport const treeView = tv({\n slots: {\n root: \"m-0 list-none p-0 text-sm\",\n group: \"m-0 list-none p-0\",\n row:\n \"flex min-h-8 cursor-pointer select-none items-center gap-1.5 rounded-md pr-2 text-fg outline-hidden \" +\n \"hover:bg-surface-2 data-[selected]:bg-accent-soft data-[selected]:font-semibold data-[disabled]:cursor-default data-[disabled]:opacity-50\",\n toggle: \"flex h-5 w-5 shrink-0 items-center justify-center text-fg-secondary [&>svg]:h-3.5 [&>svg]:w-3.5 [&>svg]:transition-transform motion-reduce:[&>svg]:transition-none\",\n icon: \"flex shrink-0 items-center text-fg-secondary [&>svg]:h-4 [&>svg]:w-4\",\n label: \"min-w-0 flex-1 truncate\",\n meta: \"shrink-0 text-xs tabular-nums text-fg-secondary\",\n },\n});\n\nexport type TreeNode = {\n /** A stable id. */\n id: string;\n /** Its name — passed translated. */\n label: string;\n /** A decorative icon before the name. */\n icon?: React.ReactNode;\n /** A detail after the name (a count, a size). */\n meta?: React.ReactNode;\n /** Its children; `undefined` for a leaf. With `hasChildren`, they load when it opens (`onLoadChildren`). */\n children?: readonly TreeNode[];\n /** A branch whose children are not loaded yet. */\n hasChildren?: boolean;\n /** Cannot be selected. */\n disabled?: boolean;\n};\n\nexport type TreeViewProps = {\n /** The roots. */\n nodes: readonly TreeNode[];\n /** The tree's accessible name (“Documentation”). */\n \"aria-label\": string;\n /** The ids of the open branches (controlled). */\n expanded?: readonly string[];\n /** The ids open at first, uncontrolled. */\n defaultExpanded?: readonly string[];\n /** Called with the open branches. */\n onExpandedChange?: (expanded: string[]) => void;\n /** The selected node (controlled). */\n selected?: string | null;\n /** The selected node at first, uncontrolled. */\n defaultSelected?: string | null;\n /** Called when a node is chosen (click, Enter or Space): navigate, open the file. */\n onSelect?: (node: TreeNode) => void;\n /** Called when a branch with `hasChildren` and no `children` opens: fetch them, then pass them in `nodes`. */\n onLoadChildren?: (node: TreeNode) => void;\n /** The words of a branch that is loading (“Loading”). */\n loadingLabel?: string;\n /** Classes merged on the tree. */\n className?: string;\n};\n\ntype Flat = { node: TreeNode; level: number; parent: string | null; posinset: number; setsize: number };\n\nconst isBranch = (node: TreeNode) => Boolean(node.children?.length || node.hasChildren);\n\nfunction flatten(nodes: readonly TreeNode[], open: Set<string>, level = 1, parent: string | null = null, out: Flat[] = []): Flat[] {\n nodes.forEach((node, i) => {\n out.push({ node, level, parent, posinset: i + 1, setsize: nodes.length });\n if (open.has(node.id) && node.children) flatten(node.children, open, level + 1, node.id, out);\n });\n return out;\n}\n\n/**\n * A hierarchy to browse — documentation sections, a studio's datasets, folders: one tab stop, the arrows walk it (→\n * opens, ← closes or goes up), Home/End, a letter jumps to the next name; branches can load their children on demand.\n */\nexport function TreeView({\n nodes,\n \"aria-label\": label,\n expanded: expandedProp,\n defaultExpanded = [],\n onExpandedChange,\n selected: selectedProp,\n defaultSelected = null,\n onSelect,\n onLoadChildren,\n loadingLabel = \"Loading\",\n className,\n}: TreeViewProps) {\n const s = treeView();\n const uid = React.useId();\n const [expanded, setExpanded] = useControllable<readonly string[]>(expandedProp, defaultExpanded, onExpandedChange as (next: readonly string[]) => void);\n const [selected, setSelected] = useControllable<string | null>(selectedProp, defaultSelected);\n const open = new Set(expanded);\n const rows = flatten(nodes, open);\n const [active, setActive] = React.useState<string | null>(null);\n const focusId = active && rows.some((r) => r.node.id === active) ? active : (selected ?? rows[0]?.node.id ?? null);\n const refs = React.useRef(new Map<string, HTMLDivElement>());\n const move = (id: string | undefined) => {\n if (!id) return;\n setActive(id);\n refs.current.get(id)?.focus();\n };\n const toggle = (node: TreeNode, to = !open.has(node.id)) => {\n if (!isBranch(node)) return;\n if (to && node.hasChildren && !node.children) onLoadChildren?.(node);\n setExpanded(to ? [...expanded, node.id] : expanded.filter((id) => id !== node.id));\n };\n const choose = (node: TreeNode) => {\n if (node.disabled) return;\n setSelected(node.id);\n onSelect?.(node);\n };\n const onKeyDown = (event: React.KeyboardEvent, i: number) => {\n const row = rows[i]!;\n const { node } = row;\n const keys: Record<string, () => void> = {\n ArrowDown: () => move(rows[i + 1]?.node.id),\n ArrowUp: () => move(rows[i - 1]?.node.id),\n Home: () => move(rows[0]?.node.id),\n End: () => move(rows[rows.length - 1]?.node.id),\n ArrowRight: () => (isBranch(node) && !open.has(node.id) ? toggle(node, true) : isBranch(node) ? move(rows[i + 1]?.node.id) : undefined),\n ArrowLeft: () => (open.has(node.id) ? toggle(node, false) : move(row.parent ?? undefined)),\n Enter: () => choose(node),\n \" \": () => choose(node),\n };\n const run = keys[event.key];\n if (run) {\n event.preventDefault();\n run();\n return;\n }\n if (event.key.length === 1 && /\\S/.test(event.key)) {\n const letter = event.key.toLowerCase();\n const next = [...rows.slice(i + 1), ...rows.slice(0, i)].find((r) => r.node.label.toLowerCase().startsWith(letter));\n move(next?.node.id);\n }\n };\n\n const render = (list: readonly TreeNode[], level: number): React.ReactNode =>\n list.map((node) => {\n const i = rows.findIndex((r) => r.node.id === node.id);\n const row = rows[i]!;\n const branch = isBranch(node);\n const isOpen = open.has(node.id);\n const loading = isOpen && node.hasChildren && !node.children;\n return (\n // The row is the treeitem (its name is its own words, never its children's); the group of children hangs\n // from it with aria-owns, in the `li` that holds both.\n <li key={node.id} role=\"none\">\n <div\n ref={(el) => {\n if (el) refs.current.set(node.id, el);\n else refs.current.delete(node.id);\n }}\n role=\"treeitem\"\n aria-level={level}\n aria-posinset={row.posinset}\n aria-setsize={row.setsize}\n aria-expanded={branch ? isOpen : undefined}\n aria-selected={selected === node.id}\n aria-disabled={node.disabled || undefined}\n aria-busy={loading || undefined}\n aria-owns={branch && isOpen ? `${uid}-${node.id}-group` : undefined}\n tabIndex={node.id === focusId ? 0 : -1}\n onKeyDown={(e) => {\n if (e.target === e.currentTarget) onKeyDown(e, i);\n }}\n onFocus={(e) => {\n if (e.target === e.currentTarget) setActive(node.id);\n }}\n className={s.row({ className: \"outline-hidden focus-visible:ring-2 focus-visible:ring-ring\" })}\n data-selected={selected === node.id || undefined}\n data-disabled={node.disabled || undefined}\n style={{ paddingLeft: `${(level - 1) * 1.25 + 0.25}rem` }}\n onClick={() => {\n if (branch) toggle(node);\n choose(node);\n move(node.id);\n }}\n >\n <span className={s.toggle()} aria-hidden>\n {branch ? <ChevronGlyph direction={isOpen ? \"down\" : \"right\"} /> : null}\n </span>\n {node.icon ? <span className={s.icon()} aria-hidden>{node.icon}</span> : null}\n <span className={s.label()}>{node.label}</span>\n {node.meta ? <span className={s.meta()}>{node.meta}</span> : null}\n </div>\n {branch && isOpen ? (\n <ul role=\"group\" id={`${uid}-${node.id}-group`} className={s.group()}>\n {loading ? (\n <li role=\"none\" className=\"py-1 text-xs text-fg-secondary\" style={{ paddingLeft: `${level * 1.25 + 1.75}rem` }}>\n {loadingLabel}\n </li>\n ) : (\n render(node.children ?? [], level + 1)\n )}\n </ul>\n ) : null}\n </li>\n );\n });\n\n return (\n <ul role=\"tree\" aria-label={label} className={s.root({ className })}>\n {render(nodes, 1)}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU;AAuJT,SAgCc,KAhCd;AAlJH,IAAM,WAAW,GAAG;AAAA,EACzB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KACE;AAAA,IAEF,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AACF,CAAC;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;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/tree-view/tree-view.tsx"],"sourcesContent":["// Client (expansion, selection, the roving focus). A hierarchy the keyboard walks — the ARIA tree pattern: one tab\n// stop, the arrows move and open, Home/End, typing a letter jumps; children loaded on demand when a branch opens.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { ChevronGlyph } from \"../glyphs\";\nimport { useControllable } from \"../media\";\n\nexport const treeView = tv({\n slots: {\n root: \"m-0 list-none p-0 text-sm\",\n group: \"m-0 list-none p-0\",\n row:\n \"flex min-h-8 cursor-pointer select-none items-center gap-1.5 rounded-md pr-2 text-fg outline-hidden \" +\n \"hover:bg-surface-2 data-[selected]:bg-accent-soft data-[selected]:font-semibold data-[disabled]:cursor-default data-[disabled]:opacity-50\",\n toggle: \"flex h-5 w-5 shrink-0 items-center justify-center text-fg-secondary [&>svg]:h-3.5 [&>svg]:w-3.5 [&>svg]:transition-transform motion-reduce:[&>svg]:transition-none\",\n icon: \"flex shrink-0 items-center text-fg-secondary [&>svg]:h-4 [&>svg]:w-4\",\n label: \"min-w-0 flex-1 truncate\",\n meta: \"shrink-0 text-xs tabular-nums text-fg-secondary\",\n },\n});\n\nexport type TreeNode = {\n /** A stable id. */\n id: string;\n /** Its name — passed translated. */\n label: string;\n /** A decorative icon before the name. */\n icon?: React.ReactNode;\n /** A detail after the name (a count, a size). */\n meta?: React.ReactNode;\n /** Its children; `undefined` for a leaf. With `hasChildren`, they load when it opens (`onLoadChildren`). */\n children?: readonly TreeNode[];\n /** A branch whose children are not loaded yet. */\n hasChildren?: boolean;\n /** Cannot be selected. */\n disabled?: boolean;\n};\n\nexport type TreeViewProps = {\n /** The roots. */\n nodes: readonly TreeNode[];\n /** The tree's accessible name (“Documentation”). */\n \"aria-label\": string;\n /** The ids of the open branches (controlled). */\n expanded?: readonly string[];\n /** The ids open at first, uncontrolled. */\n defaultExpanded?: readonly string[];\n /** Called with the open branches. */\n onExpandedChange?: (expanded: string[]) => void;\n /** The selected node (controlled). */\n selected?: string | null;\n /** The selected node at first, uncontrolled. */\n defaultSelected?: string | null;\n /** Called when a node is chosen (click, Enter or Space): navigate, open the file. */\n onSelect?: (node: TreeNode) => void;\n /** Called when a branch with `hasChildren` and no `children` opens: fetch them, then pass them in `nodes`. */\n onLoadChildren?: (node: TreeNode) => void;\n /** The words of a branch that is loading (“Loading”). */\n loadingLabel?: string;\n /** Classes merged on the tree. */\n className?: string;\n};\n\ntype Flat = { node: TreeNode; level: number; parent: string | null; posinset: number; setsize: number };\n\nconst isBranch = (node: TreeNode) => Boolean(node.children?.length || node.hasChildren);\n\nfunction flatten(nodes: readonly TreeNode[], open: Set<string>, level = 1, parent: string | null = null, out: Flat[] = []): Flat[] {\n nodes.forEach((node, i) => {\n out.push({ node, level, parent, posinset: i + 1, setsize: nodes.length });\n if (open.has(node.id) && node.children) flatten(node.children, open, level + 1, node.id, out);\n });\n return out;\n}\n\n/**\n * A hierarchy to browse — documentation sections, a studio's datasets, folders: one tab stop, the arrows walk it (→\n * opens, ← closes or goes up), Home/End, a letter jumps to the next name; branches can load their children on demand.\n *\n * @deprecated Since 3.6.0, removed in 4.0.0: no product uses it. Drill down with `List` instead.\n */\nexport function TreeView({\n nodes,\n \"aria-label\": label,\n expanded: expandedProp,\n defaultExpanded = [],\n onExpandedChange,\n selected: selectedProp,\n defaultSelected = null,\n onSelect,\n onLoadChildren,\n loadingLabel = \"Loading\",\n className,\n}: TreeViewProps) {\n const s = treeView();\n const uid = React.useId();\n const [expanded, setExpanded] = useControllable<readonly string[]>(expandedProp, defaultExpanded, onExpandedChange as (next: readonly string[]) => void);\n const [selected, setSelected] = useControllable<string | null>(selectedProp, defaultSelected);\n const open = new Set(expanded);\n const rows = flatten(nodes, open);\n const [active, setActive] = React.useState<string | null>(null);\n const focusId = active && rows.some((r) => r.node.id === active) ? active : (selected ?? rows[0]?.node.id ?? null);\n const refs = React.useRef(new Map<string, HTMLDivElement>());\n const move = (id: string | undefined) => {\n if (!id) return;\n setActive(id);\n refs.current.get(id)?.focus();\n };\n const toggle = (node: TreeNode, to = !open.has(node.id)) => {\n if (!isBranch(node)) return;\n if (to && node.hasChildren && !node.children) onLoadChildren?.(node);\n setExpanded(to ? [...expanded, node.id] : expanded.filter((id) => id !== node.id));\n };\n const choose = (node: TreeNode) => {\n if (node.disabled) return;\n setSelected(node.id);\n onSelect?.(node);\n };\n const onKeyDown = (event: React.KeyboardEvent, i: number) => {\n const row = rows[i]!;\n const { node } = row;\n const keys: Record<string, () => void> = {\n ArrowDown: () => move(rows[i + 1]?.node.id),\n ArrowUp: () => move(rows[i - 1]?.node.id),\n Home: () => move(rows[0]?.node.id),\n End: () => move(rows[rows.length - 1]?.node.id),\n ArrowRight: () => (isBranch(node) && !open.has(node.id) ? toggle(node, true) : isBranch(node) ? move(rows[i + 1]?.node.id) : undefined),\n ArrowLeft: () => (open.has(node.id) ? toggle(node, false) : move(row.parent ?? undefined)),\n Enter: () => choose(node),\n \" \": () => choose(node),\n };\n const run = keys[event.key];\n if (run) {\n event.preventDefault();\n run();\n return;\n }\n if (event.key.length === 1 && /\\S/.test(event.key)) {\n const letter = event.key.toLowerCase();\n const next = [...rows.slice(i + 1), ...rows.slice(0, i)].find((r) => r.node.label.toLowerCase().startsWith(letter));\n move(next?.node.id);\n }\n };\n\n const render = (list: readonly TreeNode[], level: number): React.ReactNode =>\n list.map((node) => {\n const i = rows.findIndex((r) => r.node.id === node.id);\n const row = rows[i]!;\n const branch = isBranch(node);\n const isOpen = open.has(node.id);\n const loading = isOpen && node.hasChildren && !node.children;\n return (\n // The row is the treeitem (its name is its own words, never its children's); the group of children hangs\n // from it with aria-owns, in the `li` that holds both.\n <li key={node.id} role=\"none\">\n <div\n ref={(el) => {\n if (el) refs.current.set(node.id, el);\n else refs.current.delete(node.id);\n }}\n role=\"treeitem\"\n aria-level={level}\n aria-posinset={row.posinset}\n aria-setsize={row.setsize}\n aria-expanded={branch ? isOpen : undefined}\n aria-selected={selected === node.id}\n aria-disabled={node.disabled || undefined}\n aria-busy={loading || undefined}\n aria-owns={branch && isOpen ? `${uid}-${node.id}-group` : undefined}\n tabIndex={node.id === focusId ? 0 : -1}\n onKeyDown={(e) => {\n if (e.target === e.currentTarget) onKeyDown(e, i);\n }}\n onFocus={(e) => {\n if (e.target === e.currentTarget) setActive(node.id);\n }}\n className={s.row({ className: \"outline-hidden focus-visible:ring-2 focus-visible:ring-ring\" })}\n data-selected={selected === node.id || undefined}\n data-disabled={node.disabled || undefined}\n style={{ paddingLeft: `${(level - 1) * 1.25 + 0.25}rem` }}\n onClick={() => {\n if (branch) toggle(node);\n choose(node);\n move(node.id);\n }}\n >\n <span className={s.toggle()} aria-hidden>\n {branch ? <ChevronGlyph direction={isOpen ? \"down\" : \"right\"} /> : null}\n </span>\n {node.icon ? <span className={s.icon()} aria-hidden>{node.icon}</span> : null}\n <span className={s.label()}>{node.label}</span>\n {node.meta ? <span className={s.meta()}>{node.meta}</span> : null}\n </div>\n {branch && isOpen ? (\n <ul role=\"group\" id={`${uid}-${node.id}-group`} className={s.group()}>\n {loading ? (\n <li role=\"none\" className=\"py-1 text-xs text-fg-secondary\" style={{ paddingLeft: `${level * 1.25 + 1.75}rem` }}>\n {loadingLabel}\n </li>\n ) : (\n render(node.children ?? [], level + 1)\n )}\n </ul>\n ) : null}\n </li>\n );\n });\n\n return (\n <ul role=\"tree\" aria-label={label} className={s.root({ className })}>\n {render(nodes, 1)}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU;AAyJT,SAgCc,KAhCd;AApJH,IAAM,WAAW,GAAG;AAAA,EACzB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KACE;AAAA,IAEF,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AACF,CAAC;AA8CD,IAAM,WAAW,CAAC,SAAmB,QAAQ,KAAK,UAAU,UAAU,KAAK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
|
2
|
+
|
|
3
|
+
interface ShortFeedProps<T> extends Omit<React.ComponentProps<"section">, "children"> {
|
|
4
|
+
/** The feed's accessible name ("Videos"), passed translated. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** The videos, in order. */
|
|
7
|
+
items: readonly T[];
|
|
8
|
+
/** A stable key for an item. */
|
|
9
|
+
getId: (item: T) => string;
|
|
10
|
+
/** One slide: `active` is true for the one in view, `preload` for the next, `near` false for the ones kept empty. */
|
|
11
|
+
renderItem: (item: T, state: {
|
|
12
|
+
active: boolean;
|
|
13
|
+
preload: "none" | "metadata" | "auto";
|
|
14
|
+
index: number;
|
|
15
|
+
}) => React.ReactNode;
|
|
16
|
+
/** The slides mounted around the one in view (before and after). Default 1; the others keep their height empty. */
|
|
17
|
+
window?: number;
|
|
18
|
+
/** Called when the slide in view changes. */
|
|
19
|
+
onActiveChange?: (index: number, item: T) => void;
|
|
20
|
+
}
|
|
21
|
+
/** A vertical snap-scrolling feed that plays the video in view, preloads the next and pauses the rest. */
|
|
22
|
+
declare function ShortFeed<T>({ label, items, getId, renderItem, window: around, onActiveChange, className, onKeyDown, ...props }: ShortFeedProps<T>): React.JSX.Element;
|
|
23
|
+
|
|
24
|
+
interface VerticalVideoLabels {
|
|
25
|
+
/** "Play" / "Pause" — the tap target over the picture. */
|
|
26
|
+
play: string;
|
|
27
|
+
pause: string;
|
|
28
|
+
/** "Like" / "Unlike" (the button's name; the state is `aria-pressed`). */
|
|
29
|
+
like: string;
|
|
30
|
+
comment: string;
|
|
31
|
+
share: string;
|
|
32
|
+
more: string;
|
|
33
|
+
/** "Follow Elena" — `{name}` is replaced by the creator's name. */
|
|
34
|
+
follow: string;
|
|
35
|
+
/** "Following Elena". */
|
|
36
|
+
following: string;
|
|
37
|
+
/** "More" / "Less" on a long caption. */
|
|
38
|
+
expand: string;
|
|
39
|
+
collapse: string;
|
|
40
|
+
/** The progress bar's name ("Progress"). */
|
|
41
|
+
progress: string;
|
|
42
|
+
/** The rail's name ("Actions"). */
|
|
43
|
+
actions: string;
|
|
44
|
+
}
|
|
45
|
+
declare const verticalVideoLabels: VerticalVideoLabels;
|
|
46
|
+
interface VerticalVideoCreator {
|
|
47
|
+
name: string;
|
|
48
|
+
/** Their portrait. */
|
|
49
|
+
avatarSrc?: string;
|
|
50
|
+
/** The seal's words ("Verified"): shows the seal beside the name. */
|
|
51
|
+
verifiedLabel?: string;
|
|
52
|
+
}
|
|
53
|
+
interface VerticalVideoProps extends Omit<React.ComponentProps<"article">, "title" | "children"> {
|
|
54
|
+
/** The video's accessible name ("Video: Night shoot, part 2"), passed translated. */
|
|
55
|
+
title: string;
|
|
56
|
+
/** The clip — absent, the poster alone shows (MP4 or WebM; an HLS address only in Safari — use the player of `@krizaka/ui/video-player` for HLS). */
|
|
57
|
+
src?: string;
|
|
58
|
+
/** The picture until the first frame, and under reduced motion. */
|
|
59
|
+
poster?: string;
|
|
60
|
+
/** Plays while `true`; a `ShortFeed` passes it for the slide in view. Default `true`. */
|
|
61
|
+
active?: boolean;
|
|
62
|
+
/** The next slide's: `auto` loads it ahead, `none` waits. Default `metadata`. */
|
|
63
|
+
preload?: "none" | "metadata" | "auto";
|
|
64
|
+
/** Plays again at the end. Default `true`. */
|
|
65
|
+
loop?: boolean;
|
|
66
|
+
/** Starts muted (autoplay needs it). Default `true`. */
|
|
67
|
+
muted?: boolean;
|
|
68
|
+
/** Who made it: name, portrait, the seal's words. */
|
|
69
|
+
creator: VerticalVideoCreator;
|
|
70
|
+
/** A pill beside the name: "AI-GENERATED" — said on the picture, never only in a page's footnote. */
|
|
71
|
+
disclosure?: string;
|
|
72
|
+
/** The caption: collapsed to two lines, expandable when long. */
|
|
73
|
+
caption?: string;
|
|
74
|
+
/** Tags under the caption (without `#`). */
|
|
75
|
+
tags?: readonly string[];
|
|
76
|
+
/** The sound or credit line ("Original sound — Elena"). */
|
|
77
|
+
credit?: string;
|
|
78
|
+
/** The like count under its button, compact (`12.4K`) in `locale`. */
|
|
79
|
+
likes?: number;
|
|
80
|
+
/** The comment count under its button. */
|
|
81
|
+
comments?: number;
|
|
82
|
+
/** The share count under its button. */
|
|
83
|
+
shares?: number;
|
|
84
|
+
/** Whether the viewer likes it: `aria-pressed` on the like button. */
|
|
85
|
+
liked?: boolean;
|
|
86
|
+
/** Whether the viewer follows the creator: the "+" on the avatar becomes a check. */
|
|
87
|
+
following?: boolean;
|
|
88
|
+
/** The viewer likes or unlikes (the button, `L`, a double tap). */
|
|
89
|
+
onLike?: (liked: boolean) => void;
|
|
90
|
+
/** Opens the comments; without it the button still shows. */
|
|
91
|
+
onComment?: () => void;
|
|
92
|
+
/** Opens the share sheet. */
|
|
93
|
+
onShare?: () => void;
|
|
94
|
+
/** The viewer follows or unfollows; without it the avatar has no "+". */
|
|
95
|
+
onFollow?: (following: boolean) => void;
|
|
96
|
+
/** The "more" button's action (report, hide); without it the button is not drawn. */
|
|
97
|
+
onMore?: () => void;
|
|
98
|
+
/** The product's own action on the rail: a tip, an unlock — a button of yours (≥ 44 px, named). */
|
|
99
|
+
tipSlot?: React.ReactNode;
|
|
100
|
+
/** Top left: a chip over the picture (an auction's time left). */
|
|
101
|
+
topStart?: React.ReactNode;
|
|
102
|
+
/** Above the caption: a goal gauge, a challenge's progress. */
|
|
103
|
+
aboveCaption?: React.ReactNode;
|
|
104
|
+
/** The locale of the counts. Default `en`. */
|
|
105
|
+
locale?: string;
|
|
106
|
+
/** Every word, passed translated. */
|
|
107
|
+
labels?: Partial<VerticalVideoLabels>;
|
|
108
|
+
}
|
|
109
|
+
/** One short video: 9:16, the rail of actions on the right, the creator's caption bottom-left, a progress hairline. */
|
|
110
|
+
declare function VerticalVideo({ title, src, poster, active, preload, loop, muted, creator, disclosure, caption, tags, credit, likes, comments, shares, liked, following, onLike, onComment, onShare, onFollow, onMore, tipSlot, topStart, aboveCaption, locale, labels: custom, className, onKeyDown, ...props }: VerticalVideoProps): React.JSX.Element;
|
|
111
|
+
|
|
112
|
+
export { ShortFeed, type ShortFeedProps, VerticalVideo, type VerticalVideoCreator, type VerticalVideoLabels, type VerticalVideoProps, verticalVideoLabels };
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Avatar
|
|
4
|
+
} from "./chunk-CURW36FI.js";
|
|
5
|
+
import {
|
|
6
|
+
IconButton
|
|
7
|
+
} from "./chunk-UOMP6VOZ.js";
|
|
8
|
+
import {
|
|
9
|
+
cn
|
|
10
|
+
} from "./chunk-2FRWNSRO.js";
|
|
11
|
+
|
|
12
|
+
// src/vertical-video/short-feed.tsx
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
function ShortFeed({ label, items, getId, renderItem, window: around = 1, onActiveChange, className, onKeyDown, ...props }) {
|
|
16
|
+
const root = React.useRef(null);
|
|
17
|
+
const [active, setActive] = React.useState(0);
|
|
18
|
+
const slides = React.useRef([]);
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
const host = root.current;
|
|
21
|
+
if (!host || typeof IntersectionObserver === "undefined") return;
|
|
22
|
+
const observer = new IntersectionObserver(
|
|
23
|
+
(entries) => {
|
|
24
|
+
for (const entry of entries) {
|
|
25
|
+
if (!entry.isIntersecting || entry.intersectionRatio < 0.6) continue;
|
|
26
|
+
const index = Number(entry.target.dataset.index);
|
|
27
|
+
setActive(index);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{ root: host, threshold: [0.6] }
|
|
31
|
+
);
|
|
32
|
+
for (const slide of slides.current) if (slide) observer.observe(slide);
|
|
33
|
+
return () => observer.disconnect();
|
|
34
|
+
}, [items.length]);
|
|
35
|
+
const first = React.useRef(true);
|
|
36
|
+
React.useEffect(() => {
|
|
37
|
+
if (first.current) {
|
|
38
|
+
first.current = false;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const item = items[active];
|
|
42
|
+
if (item !== void 0) onActiveChange?.(active, item);
|
|
43
|
+
}, [active]);
|
|
44
|
+
const go = (index) => {
|
|
45
|
+
const target = slides.current[Math.max(0, Math.min(items.length - 1, index))];
|
|
46
|
+
if (!target) return;
|
|
47
|
+
target.scrollIntoView({ behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth", block: "start" });
|
|
48
|
+
target.querySelector("article")?.focus({ preventScroll: true });
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
"section",
|
|
52
|
+
{
|
|
53
|
+
ref: root,
|
|
54
|
+
"aria-label": label,
|
|
55
|
+
"aria-roledescription": "carousel",
|
|
56
|
+
className: cn("h-dvh snap-y snap-mandatory overflow-y-auto overscroll-contain bg-surface-0 [scrollbar-width:none]", className),
|
|
57
|
+
onKeyDown: (event) => {
|
|
58
|
+
onKeyDown?.(event);
|
|
59
|
+
if (event.defaultPrevented) return;
|
|
60
|
+
if (event.key === "ArrowDown" || event.key === "PageDown") {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
go(active + 1);
|
|
63
|
+
} else if (event.key === "ArrowUp" || event.key === "PageUp") {
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
go(active - 1);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
...props,
|
|
69
|
+
children: items.map((item, index) => {
|
|
70
|
+
const near = Math.abs(index - active) <= around;
|
|
71
|
+
return /* @__PURE__ */ jsx(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
ref: (el) => {
|
|
75
|
+
slides.current[index] = el;
|
|
76
|
+
},
|
|
77
|
+
"data-index": index,
|
|
78
|
+
role: "group",
|
|
79
|
+
"aria-roledescription": "slide",
|
|
80
|
+
"aria-label": `${index + 1} / ${items.length}`,
|
|
81
|
+
className: "mx-auto flex h-dvh max-w-[calc(100dvh*9/16)] snap-start snap-always items-center",
|
|
82
|
+
children: near ? renderItem(item, { active: index === active, preload: index === active + 1 ? "auto" : index === active ? "auto" : "none", index }) : null
|
|
83
|
+
},
|
|
84
|
+
getId(item)
|
|
85
|
+
);
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// src/vertical-video/vertical-video.tsx
|
|
92
|
+
import { formatCompact } from "@krizaka/intl";
|
|
93
|
+
import * as React2 from "react";
|
|
94
|
+
|
|
95
|
+
// src/verified-badge/verified-badge.tsx
|
|
96
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
97
|
+
var SIZE = { sm: "h-3.5 w-3.5", md: "h-4 w-4", lg: "h-5 w-5" };
|
|
98
|
+
function VerifiedBadge({ label, showLabel, size = "md", onMedia, className, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsxs("span", { role: "img", "aria-label": label, className: ["inline-flex items-center gap-1 text-xs font-bold", onMedia ? "text-fg-on-media" : "text-fg-accent", className].filter(Boolean).join(" "), ...props, children: [
|
|
100
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: [SIZE[size], "shrink-0"].join(" "), "aria-hidden": true, children: [
|
|
101
|
+
/* @__PURE__ */ jsx2(
|
|
102
|
+
"path",
|
|
103
|
+
{
|
|
104
|
+
d: "M12 2.5l2.4 1.7 2.9-.1.9 2.8 2.3 1.8-.9 2.8.9 2.8-2.3 1.8-.9 2.8-2.9-.1L12 21.5l-2.4-1.7-2.9.1-.9-2.8-2.3-1.8.9-2.8-.9-2.8 2.3-1.8.9-2.8 2.9.1z",
|
|
105
|
+
className: onMedia ? "fill-accent stroke-fg-on-media" : "fill-accent",
|
|
106
|
+
strokeWidth: "1.2"
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsx2("path", { d: "M8.3 12.3l2.5 2.5 4.9-5.2", fill: "none", className: "stroke-on-accent", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
110
|
+
] }),
|
|
111
|
+
showLabel ? /* @__PURE__ */ jsx2("span", { "aria-hidden": true, children: label }) : null
|
|
112
|
+
] });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// src/vertical-video/vertical-video.tsx
|
|
116
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
117
|
+
var verticalVideoLabels = {
|
|
118
|
+
play: "Play",
|
|
119
|
+
pause: "Pause",
|
|
120
|
+
like: "Like",
|
|
121
|
+
comment: "Comments",
|
|
122
|
+
share: "Share",
|
|
123
|
+
more: "More",
|
|
124
|
+
follow: "Follow {name}",
|
|
125
|
+
following: "Following {name}",
|
|
126
|
+
expand: "More",
|
|
127
|
+
collapse: "Less",
|
|
128
|
+
progress: "Progress",
|
|
129
|
+
actions: "Actions"
|
|
130
|
+
};
|
|
131
|
+
var glyph = (d) => /* @__PURE__ */ jsx3("svg", { viewBox: "0 0 24 24", className: "h-6 w-6", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx3("path", { d }) });
|
|
132
|
+
var HEART = "M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z";
|
|
133
|
+
var COMMENT = "M4 5h16v11H9l-5 4z";
|
|
134
|
+
var SHARE = "M4 12v7h16v-7M12 3v12M7 8l5-5 5 5";
|
|
135
|
+
var MORE = "M5 12h.01M12 12h.01M19 12h.01";
|
|
136
|
+
var useReducedMotion = () => React2.useSyncExternalStore(
|
|
137
|
+
(notify) => {
|
|
138
|
+
const query = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
139
|
+
query.addEventListener("change", notify);
|
|
140
|
+
return () => query.removeEventListener("change", notify);
|
|
141
|
+
},
|
|
142
|
+
() => window.matchMedia("(prefers-reduced-motion: reduce)").matches,
|
|
143
|
+
() => false
|
|
144
|
+
);
|
|
145
|
+
function VerticalVideo({
|
|
146
|
+
title,
|
|
147
|
+
src,
|
|
148
|
+
poster,
|
|
149
|
+
active = true,
|
|
150
|
+
preload = "metadata",
|
|
151
|
+
loop = true,
|
|
152
|
+
muted = true,
|
|
153
|
+
creator,
|
|
154
|
+
disclosure,
|
|
155
|
+
caption,
|
|
156
|
+
tags = [],
|
|
157
|
+
credit,
|
|
158
|
+
likes,
|
|
159
|
+
comments,
|
|
160
|
+
shares,
|
|
161
|
+
liked = false,
|
|
162
|
+
following = false,
|
|
163
|
+
onLike,
|
|
164
|
+
onComment,
|
|
165
|
+
onShare,
|
|
166
|
+
onFollow,
|
|
167
|
+
onMore,
|
|
168
|
+
tipSlot,
|
|
169
|
+
topStart,
|
|
170
|
+
aboveCaption,
|
|
171
|
+
locale = "en",
|
|
172
|
+
labels: custom,
|
|
173
|
+
className,
|
|
174
|
+
onKeyDown,
|
|
175
|
+
...props
|
|
176
|
+
}) {
|
|
177
|
+
const labels = { ...verticalVideoLabels, ...custom };
|
|
178
|
+
const reduce = useReducedMotion();
|
|
179
|
+
const video = React2.useRef(null);
|
|
180
|
+
const [playing, setPlaying] = React2.useState(false);
|
|
181
|
+
const [paused, setPaused] = React2.useState(false);
|
|
182
|
+
const [progress, setProgress] = React2.useState(0);
|
|
183
|
+
const [open, setOpen] = React2.useState(false);
|
|
184
|
+
const [heart, setHeart] = React2.useState(0);
|
|
185
|
+
const shouldPlay = active && !paused && !reduce;
|
|
186
|
+
React2.useEffect(() => {
|
|
187
|
+
const el = video.current;
|
|
188
|
+
if (!el) return;
|
|
189
|
+
if (shouldPlay) void el.play().catch(() => void 0);
|
|
190
|
+
else el.pause();
|
|
191
|
+
}, [shouldPlay, src]);
|
|
192
|
+
const press = () => {
|
|
193
|
+
const el = video.current;
|
|
194
|
+
if (!el) return;
|
|
195
|
+
if (el.paused) {
|
|
196
|
+
setPaused(false);
|
|
197
|
+
void el.play().catch(() => void 0);
|
|
198
|
+
} else {
|
|
199
|
+
setPaused(true);
|
|
200
|
+
el.pause();
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
const like = () => onLike?.(!liked);
|
|
204
|
+
const doubleTap = () => {
|
|
205
|
+
if (!liked) like();
|
|
206
|
+
setHeart((n) => n + 1);
|
|
207
|
+
};
|
|
208
|
+
const count = (n) => n === void 0 ? void 0 : formatCompact(n, { locale });
|
|
209
|
+
const name = creator.name;
|
|
210
|
+
return /* @__PURE__ */ jsxs2(
|
|
211
|
+
"article",
|
|
212
|
+
{
|
|
213
|
+
"aria-label": title,
|
|
214
|
+
tabIndex: 0,
|
|
215
|
+
"data-playing": playing ? "" : void 0,
|
|
216
|
+
className: cn("relative isolate aspect-[9/16] w-full overflow-hidden bg-surface-0 text-fg-on-media focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring", className),
|
|
217
|
+
onKeyDown: (event) => {
|
|
218
|
+
onKeyDown?.(event);
|
|
219
|
+
if (event.defaultPrevented || event.target !== event.currentTarget) return;
|
|
220
|
+
if (event.key === " " || event.key.toLowerCase() === "k") {
|
|
221
|
+
event.preventDefault();
|
|
222
|
+
press();
|
|
223
|
+
} else if (event.key.toLowerCase() === "l") like();
|
|
224
|
+
},
|
|
225
|
+
...props,
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ jsx3(
|
|
228
|
+
"video",
|
|
229
|
+
{
|
|
230
|
+
ref: video,
|
|
231
|
+
src,
|
|
232
|
+
poster,
|
|
233
|
+
muted,
|
|
234
|
+
loop,
|
|
235
|
+
playsInline: true,
|
|
236
|
+
preload,
|
|
237
|
+
className: "absolute inset-0 -z-10 h-full w-full object-cover",
|
|
238
|
+
onPlay: () => setPlaying(true),
|
|
239
|
+
onPause: () => setPlaying(false),
|
|
240
|
+
onTimeUpdate: (event) => {
|
|
241
|
+
const el = event.currentTarget;
|
|
242
|
+
setProgress(el.duration ? el.currentTime / el.duration : 0);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
),
|
|
246
|
+
/* @__PURE__ */ jsx3("button", { type: "button", "aria-label": playing ? labels.pause : labels.play, onClick: press, onDoubleClick: doubleTap, className: "absolute inset-0 cursor-pointer bg-transparent focus-visible:outline-hidden", children: !playing && /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: "absolute left-1/2 top-1/2 grid h-16 w-16 -translate-x-1/2 -translate-y-1/2 place-items-center rounded-full bg-scrim backdrop-blur-md", children: /* @__PURE__ */ jsx3("svg", { viewBox: "0 0 24 24", className: "h-7 w-7", fill: "currentColor", children: /* @__PURE__ */ jsx3("path", { d: "M8 5v14l11-7z" }) }) }) }),
|
|
247
|
+
heart > 0 && /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: "pointer-events-none absolute left-1/2 top-1/2 grid -translate-x-1/2 -translate-y-1/2 place-items-center text-accent motion-safe:animate-ping", children: /* @__PURE__ */ jsx3("svg", { viewBox: "0 0 24 24", className: "h-20 w-20", fill: "currentColor", children: /* @__PURE__ */ jsx3("path", { d: HEART }) }) }, heart),
|
|
248
|
+
/* @__PURE__ */ jsx3("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-x-0 bottom-0 h-2/5 bg-linear-to-t from-scrim to-transparent" }),
|
|
249
|
+
topStart && /* @__PURE__ */ jsx3("div", { className: "absolute left-3 top-3", children: topStart }),
|
|
250
|
+
/* @__PURE__ */ jsxs2("div", { role: "group", "aria-label": labels.actions, className: "absolute bottom-16 right-2 flex flex-col items-center gap-3", children: [
|
|
251
|
+
/* @__PURE__ */ jsxs2("div", { className: "relative", children: [
|
|
252
|
+
/* @__PURE__ */ jsx3(Avatar, { src: creator.avatarSrc, alt: name, fallback: name.slice(0, 1), size: "md", className: "ring-2 ring-white" }),
|
|
253
|
+
onFollow && /* @__PURE__ */ jsx3(
|
|
254
|
+
IconButton,
|
|
255
|
+
{
|
|
256
|
+
label: format(following ? labels.following : labels.follow, name),
|
|
257
|
+
"aria-pressed": following,
|
|
258
|
+
size: "icon",
|
|
259
|
+
variant: following ? "secondary" : "primary",
|
|
260
|
+
shape: "pill",
|
|
261
|
+
onClick: () => onFollow(!following),
|
|
262
|
+
className: "absolute -bottom-3 left-1/2 h-6 min-h-6 w-6 min-w-6 -translate-x-1/2 p-0",
|
|
263
|
+
children: glyph(following ? "M5 12l5 5 9-10" : "M12 5v14M5 12h14")
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
] }),
|
|
267
|
+
/* @__PURE__ */ jsx3(Rail, { label: labels.like, count: count(likes), pressed: liked, onClick: like, tone: liked ? "text-accent" : void 0, children: /* @__PURE__ */ jsx3("svg", { viewBox: "0 0 24 24", className: "h-6 w-6", fill: liked ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx3("path", { d: HEART }) }) }),
|
|
268
|
+
/* @__PURE__ */ jsx3(Rail, { label: labels.comment, count: count(comments), onClick: onComment, children: glyph(COMMENT) }),
|
|
269
|
+
/* @__PURE__ */ jsx3(Rail, { label: labels.share, count: count(shares), onClick: onShare, children: glyph(SHARE) }),
|
|
270
|
+
tipSlot,
|
|
271
|
+
onMore && /* @__PURE__ */ jsx3(Rail, { label: labels.more, onClick: onMore, children: glyph(MORE) })
|
|
272
|
+
] }),
|
|
273
|
+
/* @__PURE__ */ jsxs2("div", { className: "absolute bottom-4 left-3 right-20 flex flex-col gap-1.5", children: [
|
|
274
|
+
aboveCaption,
|
|
275
|
+
/* @__PURE__ */ jsxs2("p", { className: "flex items-center gap-1.5 text-sm font-bold", children: [
|
|
276
|
+
name,
|
|
277
|
+
creator.verifiedLabel && /* @__PURE__ */ jsx3(VerifiedBadge, { label: creator.verifiedLabel, onMedia: true, size: "sm" }),
|
|
278
|
+
disclosure && /* @__PURE__ */ jsx3("span", { className: "rounded-full bg-scrim px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide text-fg-on-media backdrop-blur-md", children: disclosure })
|
|
279
|
+
] }),
|
|
280
|
+
caption && /* @__PURE__ */ jsxs2("p", { className: cn("text-sm leading-snug", !open && "line-clamp-2"), children: [
|
|
281
|
+
caption,
|
|
282
|
+
tags.length > 0 && /* @__PURE__ */ jsxs2("span", { className: "font-semibold", children: [
|
|
283
|
+
" ",
|
|
284
|
+
tags.map((tag) => `#${tag}`).join(" ")
|
|
285
|
+
] })
|
|
286
|
+
] }),
|
|
287
|
+
caption && caption.length > 90 && /* @__PURE__ */ jsx3("button", { type: "button", "aria-expanded": open, onClick: () => setOpen((v) => !v), className: "w-fit rounded text-xs font-semibold underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring", children: open ? labels.collapse : labels.expand }),
|
|
288
|
+
credit && /* @__PURE__ */ jsx3("p", { className: "text-xs opacity-90", children: credit })
|
|
289
|
+
] }),
|
|
290
|
+
/* @__PURE__ */ jsx3("div", { role: "progressbar", "aria-label": labels.progress, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(progress * 100), className: "absolute inset-x-0 bottom-0 h-1 bg-scrim", children: /* @__PURE__ */ jsx3("div", { className: "h-full bg-white", style: { width: `${progress * 100}%` } }) })
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
var format = (message, name) => message.replace("{name}", name);
|
|
296
|
+
function Rail({ label, count, pressed, onClick, tone, children }) {
|
|
297
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center gap-0.5", children: [
|
|
298
|
+
/* @__PURE__ */ jsx3(IconButton, { label, "aria-pressed": pressed, variant: "ghost", shape: "pill", onClick, className: cn("h-11 min-h-11 w-11 min-w-11 bg-scrim text-fg-on-media backdrop-blur-md hover:bg-scrim", tone), children }),
|
|
299
|
+
count !== void 0 && /* @__PURE__ */ jsx3("span", { className: "text-xs font-semibold tabular-nums", children: count })
|
|
300
|
+
] });
|
|
301
|
+
}
|
|
302
|
+
export {
|
|
303
|
+
ShortFeed,
|
|
304
|
+
VerticalVideo,
|
|
305
|
+
verticalVideoLabels
|
|
306
|
+
};
|
|
307
|
+
//# sourceMappingURL=vertical-video.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/vertical-video/short-feed.tsx","../src/vertical-video/vertical-video.tsx","../src/verified-badge/verified-badge.tsx"],"sourcesContent":["// Client (an observer, keys). A vertical feed of short videos: one slide per screen, CSS scroll-snap, the slide in view\n// plays and the others pause, the next one preloads, only the slides near the one in view are mounted (the rest keep their\n// height). ↑/↓ (and PageUp/PageDown) go to the previous / next, with the focus following.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport interface ShortFeedProps<T> extends Omit<React.ComponentProps<\"section\">, \"children\"> {\n /** The feed's accessible name (\"Videos\"), passed translated. */\n label: string;\n /** The videos, in order. */\n items: readonly T[];\n /** A stable key for an item. */\n getId: (item: T) => string;\n /** One slide: `active` is true for the one in view, `preload` for the next, `near` false for the ones kept empty. */\n renderItem: (item: T, state: { active: boolean; preload: \"none\" | \"metadata\" | \"auto\"; index: number }) => React.ReactNode;\n /** The slides mounted around the one in view (before and after). Default 1; the others keep their height empty. */\n window?: number;\n /** Called when the slide in view changes. */\n onActiveChange?: (index: number, item: T) => void;\n}\n\n/** A vertical snap-scrolling feed that plays the video in view, preloads the next and pauses the rest. */\nexport function ShortFeed<T>({ label, items, getId, renderItem, window: around = 1, onActiveChange, className, onKeyDown, ...props }: ShortFeedProps<T>) {\n const root = React.useRef<HTMLElement>(null);\n const [active, setActive] = React.useState(0);\n const slides = React.useRef<(HTMLDivElement | null)[]>([]);\n\n React.useEffect(() => {\n const host = root.current;\n if (!host || typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (!entry.isIntersecting || entry.intersectionRatio < 0.6) continue;\n const index = Number((entry.target as HTMLElement).dataset.index);\n setActive(index);\n }\n },\n { root: host, threshold: [0.6] },\n );\n for (const slide of slides.current) if (slide) observer.observe(slide);\n return () => observer.disconnect();\n }, [items.length]);\n\n const first = React.useRef(true);\n React.useEffect(() => {\n if (first.current) {\n first.current = false;\n return;\n }\n const item = items[active];\n if (item !== undefined) onActiveChange?.(active, item);\n // Only a change of the slide in view is an event.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [active]);\n\n const go = (index: number) => {\n const target = slides.current[Math.max(0, Math.min(items.length - 1, index))];\n if (!target) return;\n target.scrollIntoView({ behavior: window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches ? \"auto\" : \"smooth\", block: \"start\" });\n target.querySelector<HTMLElement>(\"article\")?.focus({ preventScroll: true });\n };\n\n return (\n <section\n ref={root}\n aria-label={label}\n aria-roledescription=\"carousel\"\n className={cn(\"h-dvh snap-y snap-mandatory overflow-y-auto overscroll-contain bg-surface-0 [scrollbar-width:none]\", className)}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) return;\n if (event.key === \"ArrowDown\" || event.key === \"PageDown\") {\n event.preventDefault();\n go(active + 1);\n } else if (event.key === \"ArrowUp\" || event.key === \"PageUp\") {\n event.preventDefault();\n go(active - 1);\n }\n }}\n {...props}\n >\n {items.map((item, index) => {\n const near = Math.abs(index - active) <= around;\n return (\n <div\n key={getId(item)}\n ref={(el) => {\n slides.current[index] = el;\n }}\n data-index={index}\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label={`${index + 1} / ${items.length}`}\n className=\"mx-auto flex h-dvh max-w-[calc(100dvh*9/16)] snap-start snap-always items-center\"\n >\n {near ? renderItem(item, { active: index === active, preload: index === active + 1 ? \"auto\" : index === active ? \"auto\" : \"none\", index }) : null}\n </div>\n );\n })}\n </section>\n );\n}\n","// Client (a video element, an observer, keys). A 9:16 clip filling its frame, with the action rail of a short-video feed on\n// the right (avatar + follow, like, comment, share, a slot for tip / unlock, more) and the caption block bottom-left. Every\n// word is a prop; counts are formatted with @krizaka/intl; everything over the picture reads on the invariant `scrim` /\n// `fg-on-media` tokens, so it is legible in both themes. Under reduced motion nothing autoplays: the poster and a play button.\nimport { formatCompact } from \"@krizaka/intl\";\nimport * as React from \"react\";\n\nimport { Avatar } from \"../avatar/avatar\";\nimport { IconButton } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { VerifiedBadge } from \"../verified-badge/verified-badge\";\n\nexport interface VerticalVideoLabels {\n /** \"Play\" / \"Pause\" — the tap target over the picture. */\n play: string;\n pause: string;\n /** \"Like\" / \"Unlike\" (the button's name; the state is `aria-pressed`). */\n like: string;\n comment: string;\n share: string;\n more: string;\n /** \"Follow Elena\" — `{name}` is replaced by the creator's name. */\n follow: string;\n /** \"Following Elena\". */\n following: string;\n /** \"More\" / \"Less\" on a long caption. */\n expand: string;\n collapse: string;\n /** The progress bar's name (\"Progress\"). */\n progress: string;\n /** The rail's name (\"Actions\"). */\n actions: string;\n}\n\nexport const verticalVideoLabels: VerticalVideoLabels = {\n play: \"Play\",\n pause: \"Pause\",\n like: \"Like\",\n comment: \"Comments\",\n share: \"Share\",\n more: \"More\",\n follow: \"Follow {name}\",\n following: \"Following {name}\",\n expand: \"More\",\n collapse: \"Less\",\n progress: \"Progress\",\n actions: \"Actions\",\n};\n\nexport interface VerticalVideoCreator {\n name: string;\n /** Their portrait. */\n avatarSrc?: string;\n /** The seal's words (\"Verified\"): shows the seal beside the name. */\n verifiedLabel?: string;\n}\n\nexport interface VerticalVideoProps extends Omit<React.ComponentProps<\"article\">, \"title\" | \"children\"> {\n /** The video's accessible name (\"Video: Night shoot, part 2\"), passed translated. */\n title: string;\n /** The clip — absent, the poster alone shows (MP4 or WebM; an HLS address only in Safari — use the player of `@krizaka/ui/video-player` for HLS). */\n src?: string;\n /** The picture until the first frame, and under reduced motion. */\n poster?: string;\n /** Plays while `true`; a `ShortFeed` passes it for the slide in view. Default `true`. */\n active?: boolean;\n /** The next slide's: `auto` loads it ahead, `none` waits. Default `metadata`. */\n preload?: \"none\" | \"metadata\" | \"auto\";\n /** Plays again at the end. Default `true`. */\n loop?: boolean;\n /** Starts muted (autoplay needs it). Default `true`. */\n muted?: boolean;\n /** Who made it: name, portrait, the seal's words. */\n creator: VerticalVideoCreator;\n /** A pill beside the name: \"AI-GENERATED\" — said on the picture, never only in a page's footnote. */\n disclosure?: string;\n /** The caption: collapsed to two lines, expandable when long. */\n caption?: string;\n /** Tags under the caption (without `#`). */\n tags?: readonly string[];\n /** The sound or credit line (\"Original sound — Elena\"). */\n credit?: string;\n /** The like count under its button, compact (`12.4K`) in `locale`. */\n likes?: number;\n /** The comment count under its button. */\n comments?: number;\n /** The share count under its button. */\n shares?: number;\n /** Whether the viewer likes it: `aria-pressed` on the like button. */\n liked?: boolean;\n /** Whether the viewer follows the creator: the \"+\" on the avatar becomes a check. */\n following?: boolean;\n /** The viewer likes or unlikes (the button, `L`, a double tap). */\n onLike?: (liked: boolean) => void;\n /** Opens the comments; without it the button still shows. */\n onComment?: () => void;\n /** Opens the share sheet. */\n onShare?: () => void;\n /** The viewer follows or unfollows; without it the avatar has no \"+\". */\n onFollow?: (following: boolean) => void;\n /** The \"more\" button's action (report, hide); without it the button is not drawn. */\n onMore?: () => void;\n /** The product's own action on the rail: a tip, an unlock — a button of yours (≥ 44 px, named). */\n tipSlot?: React.ReactNode;\n /** Top left: a chip over the picture (an auction's time left). */\n topStart?: React.ReactNode;\n /** Above the caption: a goal gauge, a challenge's progress. */\n aboveCaption?: React.ReactNode;\n /** The locale of the counts. Default `en`. */\n locale?: string;\n /** Every word, passed translated. */\n labels?: Partial<VerticalVideoLabels>;\n}\n\nconst glyph = (d: string) => (\n <svg viewBox=\"0 0 24 24\" className=\"h-6 w-6\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={d} />\n </svg>\n);\nconst HEART = \"M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z\";\nconst COMMENT = \"M4 5h16v11H9l-5 4z\";\nconst SHARE = \"M4 12v7h16v-7M12 3v12M7 8l5-5 5 5\";\nconst MORE = \"M5 12h.01M12 12h.01M19 12h.01\";\n\nconst useReducedMotion = () =>\n React.useSyncExternalStore(\n (notify) => {\n const query = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n query.addEventListener(\"change\", notify);\n return () => query.removeEventListener(\"change\", notify);\n },\n () => window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches,\n () => false,\n );\n\n/** One short video: 9:16, the rail of actions on the right, the creator's caption bottom-left, a progress hairline. */\nexport function VerticalVideo({\n title,\n src,\n poster,\n active = true,\n preload = \"metadata\",\n loop = true,\n muted = true,\n creator,\n disclosure,\n caption,\n tags = [],\n credit,\n likes,\n comments,\n shares,\n liked = false,\n following = false,\n onLike,\n onComment,\n onShare,\n onFollow,\n onMore,\n tipSlot,\n topStart,\n aboveCaption,\n locale = \"en\",\n labels: custom,\n className,\n onKeyDown,\n ...props\n}: VerticalVideoProps) {\n const labels = { ...verticalVideoLabels, ...custom };\n const reduce = useReducedMotion();\n const video = React.useRef<HTMLVideoElement>(null);\n const [playing, setPlaying] = React.useState(false);\n const [paused, setPaused] = React.useState(false); // the viewer's pause: it holds until they play again\n const [progress, setProgress] = React.useState(0);\n const [open, setOpen] = React.useState(false);\n const [heart, setHeart] = React.useState(0);\n\n const shouldPlay = active && !paused && !reduce;\n React.useEffect(() => {\n const el = video.current;\n if (!el) return;\n if (shouldPlay) void el.play().catch(() => undefined);\n else el.pause();\n }, [shouldPlay, src]);\n\n const press = () => {\n const el = video.current;\n if (!el) return;\n if (el.paused) {\n setPaused(false);\n void el.play().catch(() => undefined);\n } else {\n setPaused(true);\n el.pause();\n }\n };\n const like = () => onLike?.(!liked);\n const doubleTap = () => {\n if (!liked) like();\n setHeart((n) => n + 1); // a heart blooms over the picture (still under reduced motion: it shows and goes)\n };\n const count = (n?: number) => (n === undefined ? undefined : formatCompact(n, { locale }));\n const name = creator.name;\n\n return (\n <article\n aria-label={title}\n tabIndex={0}\n data-playing={playing ? \"\" : undefined}\n className={cn(\"relative isolate aspect-[9/16] w-full overflow-hidden bg-surface-0 text-fg-on-media focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\", className)}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || event.target !== event.currentTarget) return;\n if (event.key === \" \" || event.key.toLowerCase() === \"k\") {\n event.preventDefault();\n press();\n } else if (event.key.toLowerCase() === \"l\") like();\n }}\n {...props}\n >\n <video\n ref={video}\n src={src}\n poster={poster}\n muted={muted}\n loop={loop}\n playsInline\n preload={preload}\n className=\"absolute inset-0 -z-10 h-full w-full object-cover\"\n onPlay={() => setPlaying(true)}\n onPause={() => setPlaying(false)}\n onTimeUpdate={(event) => {\n const el = event.currentTarget;\n setProgress(el.duration ? el.currentTime / el.duration : 0);\n }}\n />\n {/* The tap target: a tap pauses or plays, a double tap likes. It is a button, so the keyboard has it too. */}\n <button type=\"button\" aria-label={playing ? labels.pause : labels.play} onClick={press} onDoubleClick={doubleTap} className=\"absolute inset-0 cursor-pointer bg-transparent focus-visible:outline-hidden\">\n {!playing && (\n <span aria-hidden className=\"absolute left-1/2 top-1/2 grid h-16 w-16 -translate-x-1/2 -translate-y-1/2 place-items-center rounded-full bg-scrim backdrop-blur-md\">\n <svg viewBox=\"0 0 24 24\" className=\"h-7 w-7\" fill=\"currentColor\"><path d=\"M8 5v14l11-7z\" /></svg>\n </span>\n )}\n </button>\n {heart > 0 && (\n <span key={heart} aria-hidden className=\"pointer-events-none absolute left-1/2 top-1/2 grid -translate-x-1/2 -translate-y-1/2 place-items-center text-accent motion-safe:animate-ping\">\n <svg viewBox=\"0 0 24 24\" className=\"h-20 w-20\" fill=\"currentColor\"><path d={HEART} /></svg>\n </span>\n )}\n <div aria-hidden className=\"pointer-events-none absolute inset-x-0 bottom-0 h-2/5 bg-linear-to-t from-scrim to-transparent\" />\n {topStart && <div className=\"absolute left-3 top-3\">{topStart}</div>}\n\n <div role=\"group\" aria-label={labels.actions} className=\"absolute bottom-16 right-2 flex flex-col items-center gap-3\">\n <div className=\"relative\">\n <Avatar src={creator.avatarSrc} alt={name} fallback={name.slice(0, 1)} size=\"md\" className=\"ring-2 ring-white\" />\n {onFollow && (\n <IconButton\n label={format(following ? labels.following : labels.follow, name)}\n aria-pressed={following}\n size=\"icon\"\n variant={following ? \"secondary\" : \"primary\"}\n shape=\"pill\"\n onClick={() => onFollow(!following)}\n className=\"absolute -bottom-3 left-1/2 h-6 min-h-6 w-6 min-w-6 -translate-x-1/2 p-0\"\n >\n {glyph(following ? \"M5 12l5 5 9-10\" : \"M12 5v14M5 12h14\")}\n </IconButton>\n )}\n </div>\n <Rail label={labels.like} count={count(likes)} pressed={liked} onClick={like} tone={liked ? \"text-accent\" : undefined}>\n <svg viewBox=\"0 0 24 24\" className=\"h-6 w-6\" fill={liked ? \"currentColor\" : \"none\"} stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden><path d={HEART} /></svg>\n </Rail>\n <Rail label={labels.comment} count={count(comments)} onClick={onComment}>{glyph(COMMENT)}</Rail>\n <Rail label={labels.share} count={count(shares)} onClick={onShare}>{glyph(SHARE)}</Rail>\n {tipSlot}\n {onMore && <Rail label={labels.more} onClick={onMore}>{glyph(MORE)}</Rail>}\n </div>\n\n <div className=\"absolute bottom-4 left-3 right-20 flex flex-col gap-1.5\">\n {aboveCaption}\n <p className=\"flex items-center gap-1.5 text-sm font-bold\">\n {name}\n {creator.verifiedLabel && <VerifiedBadge label={creator.verifiedLabel} onMedia size=\"sm\" />}\n {disclosure && <span className=\"rounded-full bg-scrim px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide text-fg-on-media backdrop-blur-md\">{disclosure}</span>}\n </p>\n {caption && (\n <p className={cn(\"text-sm leading-snug\", !open && \"line-clamp-2\")}>\n {caption}\n {tags.length > 0 && <span className=\"font-semibold\"> {tags.map((tag) => `#${tag}`).join(\" \")}</span>}\n </p>\n )}\n {caption && caption.length > 90 && (\n <button type=\"button\" aria-expanded={open} onClick={() => setOpen((v) => !v)} className=\"w-fit rounded text-xs font-semibold underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\">\n {open ? labels.collapse : labels.expand}\n </button>\n )}\n {credit && <p className=\"text-xs opacity-90\">{credit}</p>}\n </div>\n\n <div role=\"progressbar\" aria-label={labels.progress} aria-valuemin={0} aria-valuemax={100} aria-valuenow={Math.round(progress * 100)} className=\"absolute inset-x-0 bottom-0 h-1 bg-scrim\">\n <div className=\"h-full bg-white\" style={{ width: `${progress * 100}%` }} />\n </div>\n </article>\n );\n}\n\n/** \"Follow {name}\" → \"Follow Elena\". */\nconst format = (message: string, name: string) => message.replace(\"{name}\", name);\n\nfunction Rail({ label, count, pressed, onClick, tone, children }: { label: string; count?: string | undefined; pressed?: boolean; onClick?: (() => void) | undefined; tone?: string | undefined; children: React.ReactNode }) {\n return (\n <div className=\"flex flex-col items-center gap-0.5\">\n <IconButton label={label} aria-pressed={pressed} variant=\"ghost\" shape=\"pill\" onClick={onClick} className={cn(\"h-11 min-h-11 w-11 min-w-11 bg-scrim text-fg-on-media backdrop-blur-md hover:bg-scrim\", tone)}>\n {children}\n </IconButton>\n {count !== undefined && <span className=\"text-xs font-semibold tabular-nums\">{count}</span>}\n </div>\n );\n}\n","// Server-safe. A seal that says the person or the account was verified: the accent, named in words.\nimport type * as React from \"react\";\n\nexport type VerifiedBadgeProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n /** Its words (“Verified”), read — and shown with `showLabel` — passed translated. */\n label: string;\n /** Show the words beside the seal. Default false: the seal alone, named. */\n showLabel?: boolean;\n /** The seal's size: sm (14 px), md (16 px, default), lg (20 px). */\n size?: \"sm\" | \"md\" | \"lg\";\n /** On a photo: a ring of the media around the seal. */\n onMedia?: boolean;\n};\n\nconst SIZE = { sm: \"h-3.5 w-3.5\", md: \"h-4 w-4\", lg: \"h-5 w-5\" } as const;\n\n/** A seal that says the person or the account was verified (a selfie check, an ID), named in words. */\nexport function VerifiedBadge({ label, showLabel, size = \"md\", onMedia, className, ...props }: VerifiedBadgeProps) {\n return (\n <span role=\"img\" aria-label={label} className={[\"inline-flex items-center gap-1 text-xs font-bold\", onMedia ? \"text-fg-on-media\" : \"text-fg-accent\", className].filter(Boolean).join(\" \")} {...props}>\n <svg viewBox=\"0 0 24 24\" className={[SIZE[size], \"shrink-0\"].join(\" \")} aria-hidden>\n <path\n d=\"M12 2.5l2.4 1.7 2.9-.1.9 2.8 2.3 1.8-.9 2.8.9 2.8-2.3 1.8-.9 2.8-2.9-.1L12 21.5l-2.4-1.7-2.9.1-.9-2.8-2.3-1.8.9-2.8-.9-2.8 2.3-1.8.9-2.8 2.9.1z\"\n className={onMedia ? \"fill-accent stroke-fg-on-media\" : \"fill-accent\"}\n strokeWidth=\"1.2\"\n />\n <path d=\"M8.3 12.3l2.5 2.5 4.9-5.2\" fill=\"none\" className=\"stroke-on-accent\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n {showLabel ? <span aria-hidden>{label}</span> : null}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAGA,YAAY,WAAW;AAmFb;AA/DH,SAAS,UAAa,EAAE,OAAO,OAAO,OAAO,YAAY,QAAQ,SAAS,GAAG,gBAAgB,WAAW,WAAW,GAAG,MAAM,GAAsB;AACvJ,QAAM,OAAa,aAAoB,IAAI;AAC3C,QAAM,CAAC,QAAQ,SAAS,IAAU,eAAS,CAAC;AAC5C,QAAM,SAAe,aAAkC,CAAC,CAAC;AAEzD,EAAM,gBAAU,MAAM;AACpB,UAAM,OAAO,KAAK;AAClB,QAAI,CAAC,QAAQ,OAAO,yBAAyB,YAAa;AAC1D,UAAM,WAAW,IAAI;AAAA,MACnB,CAAC,YAAY;AACX,mBAAW,SAAS,SAAS;AAC3B,cAAI,CAAC,MAAM,kBAAkB,MAAM,oBAAoB,IAAK;AAC5D,gBAAM,QAAQ,OAAQ,MAAM,OAAuB,QAAQ,KAAK;AAChE,oBAAU,KAAK;AAAA,QACjB;AAAA,MACF;AAAA,MACA,EAAE,MAAM,MAAM,WAAW,CAAC,GAAG,EAAE;AAAA,IACjC;AACA,eAAW,SAAS,OAAO,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