@zonsh/ui 0.0.0 → 0.2.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/LICENSE +21 -0
- package/README.md +75 -1
- package/assets/illustrations/drawing/bracket-construction-dark.svg +77 -0
- package/assets/illustrations/drawing/bracket-construction-filled-dark.svg +50 -0
- package/assets/illustrations/drawing/bracket-construction-filled.svg +50 -0
- package/assets/illustrations/drawing/bracket-construction.svg +77 -0
- package/assets/illustrations/drawing/crescent-dark.svg +28 -0
- package/assets/illustrations/drawing/crescent-guides-dark.svg +33 -0
- package/assets/illustrations/drawing/crescent-guides.svg +33 -0
- package/assets/illustrations/drawing/crescent.svg +28 -0
- package/assets/illustrations/drawing/eclipse-dark.svg +187 -0
- package/assets/illustrations/drawing/eclipse-guides-dark.svg +191 -0
- package/assets/illustrations/drawing/eclipse-guides.svg +191 -0
- package/assets/illustrations/drawing/eclipse.svg +187 -0
- package/assets/illustrations/drawing/elevation-guides-dark.svg +31 -0
- package/assets/illustrations/drawing/elevation-guides-plain-dark.svg +9 -0
- package/assets/illustrations/drawing/elevation-guides-plain.svg +9 -0
- package/assets/illustrations/drawing/elevation-guides.svg +31 -0
- package/assets/illustrations/drawing/horizon-dark.svg +30 -0
- package/assets/illustrations/drawing/horizon.svg +30 -0
- package/assets/illustrations/drawing/nib-study-dark.svg +107 -0
- package/assets/illustrations/drawing/nib-study-plain-dark.svg +93 -0
- package/assets/illustrations/drawing/nib-study-plain.svg +93 -0
- package/assets/illustrations/drawing/nib-study.svg +107 -0
- package/assets/illustrations/editorial/assistant-640.webp +0 -0
- package/assets/illustrations/editorial/assistant.webp +0 -0
- package/assets/illustrations/editorial/automation-640.webp +0 -0
- package/assets/illustrations/editorial/automation.webp +0 -0
- package/assets/illustrations/editorial/bracket-left-640.webp +0 -0
- package/assets/illustrations/editorial/bracket-left.webp +0 -0
- package/assets/illustrations/editorial/bracket-right-640.webp +0 -0
- package/assets/illustrations/editorial/bracket-right.webp +0 -0
- package/assets/illustrations/editorial/custom-software-640.webp +0 -0
- package/assets/illustrations/editorial/custom-software.webp +0 -0
- package/assets/illustrations/editorial/digitalization-640.webp +0 -0
- package/assets/illustrations/editorial/digitalization.webp +0 -0
- package/assets/illustrations/editorial/integration-640.webp +0 -0
- package/assets/illustrations/editorial/integration.webp +0 -0
- package/assets/illustrations/editorial/problem-640.webp +0 -0
- package/assets/illustrations/editorial/problem.webp +0 -0
- package/assets/illustrations/editorial/process-analysis-640.webp +0 -0
- package/assets/illustrations/editorial/process-analysis.webp +0 -0
- package/assets/illustrations/editorial/process-concept-640.webp +0 -0
- package/assets/illustrations/editorial/process-concept.webp +0 -0
- package/assets/illustrations/editorial/process-development-640.webp +0 -0
- package/assets/illustrations/editorial/process-development.webp +0 -0
- package/assets/illustrations/editorial/process-discovery-640.webp +0 -0
- package/assets/illustrations/editorial/process-discovery.webp +0 -0
- package/assets/illustrations/editorial/process-maintenance-640.webp +0 -0
- package/assets/illustrations/editorial/process-maintenance.webp +0 -0
- package/assets/illustrations/editorial/process-prototype-640.webp +0 -0
- package/assets/illustrations/editorial/process-prototype.webp +0 -0
- package/assets/illustrations/editorial/process-testing-640.webp +0 -0
- package/assets/illustrations/editorial/process-testing.webp +0 -0
- package/assets/illustrations/iso/automation-dark.svg +6 -0
- package/assets/illustrations/iso/automation.svg +6 -0
- package/assets/illustrations/iso/bar-chart-dark.svg +6 -0
- package/assets/illustrations/iso/bar-chart.svg +6 -0
- package/assets/illustrations/iso/brackets-classic-dark.svg +6 -0
- package/assets/illustrations/iso/brackets-classic.svg +6 -0
- package/assets/illustrations/iso/brackets-dark.svg +6 -0
- package/assets/illustrations/iso/brackets.svg +6 -0
- package/assets/illustrations/iso/city-dark.svg +6 -0
- package/assets/illustrations/iso/city.svg +6 -0
- package/assets/illustrations/iso/conveyor-dark.svg +6 -0
- package/assets/illustrations/iso/conveyor.svg +6 -0
- package/assets/illustrations/iso/database-dark.svg +6 -0
- package/assets/illustrations/iso/database.svg +6 -0
- package/assets/illustrations/iso/documents-dark.svg +6 -0
- package/assets/illustrations/iso/documents.svg +6 -0
- package/assets/illustrations/iso/inbox-dark.svg +6 -0
- package/assets/illustrations/iso/inbox.svg +6 -0
- package/assets/illustrations/iso/laptop-dark.svg +6 -0
- package/assets/illustrations/iso/laptop.svg +6 -0
- package/assets/illustrations/iso/monitor-dark.svg +6 -0
- package/assets/illustrations/iso/monitor.svg +6 -0
- package/assets/illustrations/iso/pipeline-dark.svg +6 -0
- package/assets/illustrations/iso/pipeline.svg +6 -0
- package/assets/illustrations/iso/platform-dark.svg +6 -0
- package/assets/illustrations/iso/platform.svg +6 -0
- package/assets/illustrations/iso/server-dark.svg +6 -0
- package/assets/illustrations/iso/server.svg +6 -0
- package/assets/illustrations/iso/spreadsheet-dark.svg +6 -0
- package/assets/illustrations/iso/spreadsheet.svg +6 -0
- package/assets/illustrations/iso/timeline-dark.svg +6 -0
- package/assets/illustrations/iso/timeline.svg +6 -0
- package/assets/illustrations/sheet/construction.svg +115 -0
- package/assets/illustrations/sheet/crescent.svg +40 -0
- package/assets/illustrations/sheet/limb.svg +42 -0
- package/assets/illustrations/sheet/stress-axis.svg +119 -0
- package/assets/illustrations/sheet/totality.svg +215 -0
- package/assets/illustrations/sheet/vertical-metrics.svg +43 -0
- package/assets/logo-left.svg +1 -0
- package/assets/logo-right.svg +1 -0
- package/assets/logo.svg +1 -0
- package/dist/components/_overlay.d.ts +47 -0
- package/dist/components/_overlay.js +59 -0
- package/dist/components/accordion.d.ts +32 -0
- package/dist/components/accordion.js +39 -0
- package/dist/components/alert-dialog.d.ts +45 -0
- package/dist/components/alert-dialog.js +56 -0
- package/dist/components/alert.d.ts +35 -0
- package/dist/components/alert.js +42 -0
- package/dist/components/ascii-field.d.ts +34 -0
- package/dist/components/ascii-field.js +410 -0
- package/dist/components/aspect-ratio.d.ts +14 -0
- package/dist/components/aspect-ratio.js +17 -0
- package/dist/components/avatar.d.ts +42 -0
- package/dist/components/avatar.js +55 -0
- package/dist/components/badge.d.ts +70 -0
- package/dist/components/badge.js +62 -0
- package/dist/components/breadcrumb.d.ts +22 -0
- package/dist/components/breadcrumb.js +32 -0
- package/dist/components/button-group.d.ts +30 -0
- package/dist/components/button-group.js +47 -0
- package/dist/components/button.d.ts +53 -0
- package/dist/components/button.js +130 -0
- package/dist/components/calendar.d.ts +26 -0
- package/dist/components/calendar.js +164 -0
- package/dist/components/card.d.ts +42 -0
- package/dist/components/card.js +76 -0
- package/dist/components/carousel.d.ts +90 -0
- package/dist/components/carousel.js +213 -0
- package/dist/components/chart.d.ts +180 -0
- package/dist/components/chart.js +286 -0
- package/dist/components/checkbox.d.ts +23 -0
- package/dist/components/checkbox.js +43 -0
- package/dist/components/code-block.d.ts +45 -0
- package/dist/components/code-block.js +58 -0
- package/dist/components/code-highlight.d.ts +13 -0
- package/dist/components/code-highlight.js +107 -0
- package/dist/components/collapsible.d.ts +20 -0
- package/dist/components/collapsible.js +32 -0
- package/dist/components/color-picker.d.ts +85 -0
- package/dist/components/color-picker.js +407 -0
- package/dist/components/combobox.d.ts +81 -0
- package/dist/components/combobox.js +100 -0
- package/dist/components/command.d.ts +112 -0
- package/dist/components/command.js +212 -0
- package/dist/components/context-menu.d.ts +29 -0
- package/dist/components/context-menu.js +35 -0
- package/dist/components/conversation.d.ts +27 -0
- package/dist/components/conversation.js +293 -0
- package/dist/components/copy-button.d.ts +46 -0
- package/dist/components/copy-button.js +118 -0
- package/dist/components/data-table.d.ts +175 -0
- package/dist/components/data-table.js +302 -0
- package/dist/components/date-picker.d.ts +91 -0
- package/dist/components/date-picker.js +207 -0
- package/dist/components/dialog.d.ts +48 -0
- package/dist/components/dialog.js +92 -0
- package/dist/components/direction.d.ts +16 -0
- package/dist/components/direction.js +18 -0
- package/dist/components/drawer.d.ts +60 -0
- package/dist/components/drawer.js +76 -0
- package/dist/components/empty.d.ts +31 -0
- package/dist/components/empty.js +50 -0
- package/dist/components/feature-list.d.ts +54 -0
- package/dist/components/feature-list.js +43 -0
- package/dist/components/field.d.ts +15 -0
- package/dist/components/field.js +36 -0
- package/dist/components/file-drop.d.ts +55 -0
- package/dist/components/file-drop.js +197 -0
- package/dist/components/filter-bar.d.ts +106 -0
- package/dist/components/filter-bar.js +296 -0
- package/dist/components/form.d.ts +33 -0
- package/dist/components/form.js +34 -0
- package/dist/components/graph.d.ts +105 -0
- package/dist/components/graph.js +786 -0
- package/dist/components/illustration.d.ts +85 -0
- package/dist/components/illustration.js +165 -0
- package/dist/components/input-group.d.ts +127 -0
- package/dist/components/input-group.js +292 -0
- package/dist/components/input.d.ts +16 -0
- package/dist/components/input.js +25 -0
- package/dist/components/item.d.ts +64 -0
- package/dist/components/item.js +116 -0
- package/dist/components/kbd.d.ts +33 -0
- package/dist/components/kbd.js +38 -0
- package/dist/components/label.d.ts +12 -0
- package/dist/components/label.js +24 -0
- package/dist/components/layout.d.ts +136 -0
- package/dist/components/layout.js +162 -0
- package/dist/components/logo.d.ts +54 -0
- package/dist/components/logo.js +96 -0
- package/dist/components/menu.d.ts +60 -0
- package/dist/components/menu.js +138 -0
- package/dist/components/menubar.d.ts +62 -0
- package/dist/components/menubar.js +223 -0
- package/dist/components/message.d.ts +42 -0
- package/dist/components/message.js +56 -0
- package/dist/components/meter.d.ts +31 -0
- package/dist/components/meter.js +25 -0
- package/dist/components/native-select.d.ts +26 -0
- package/dist/components/native-select.js +35 -0
- package/dist/components/navigation-menu.d.ts +42 -0
- package/dist/components/navigation-menu.js +97 -0
- package/dist/components/number-field.d.ts +36 -0
- package/dist/components/number-field.js +153 -0
- package/dist/components/otp-field.d.ts +35 -0
- package/dist/components/otp-field.js +94 -0
- package/dist/components/pagination.d.ts +31 -0
- package/dist/components/pagination.js +70 -0
- package/dist/components/pdf-viewer.d.ts +69 -0
- package/dist/components/pdf-viewer.js +929 -0
- package/dist/components/popover.d.ts +33 -0
- package/dist/components/popover.js +48 -0
- package/dist/components/preview-card.d.ts +25 -0
- package/dist/components/preview-card.js +22 -0
- package/dist/components/progress.d.ts +27 -0
- package/dist/components/progress.js +23 -0
- package/dist/components/prompt-input.d.ts +131 -0
- package/dist/components/prompt-input.js +403 -0
- package/dist/components/quote.d.ts +22 -0
- package/dist/components/quote.js +15 -0
- package/dist/components/radio-group.d.ts +18 -0
- package/dist/components/radio-group.js +34 -0
- package/dist/components/reasoning.d.ts +31 -0
- package/dist/components/reasoning.js +70 -0
- package/dist/components/resizable.d.ts +38 -0
- package/dist/components/resizable.js +41 -0
- package/dist/components/response.d.ts +30 -0
- package/dist/components/response.js +538 -0
- package/dist/components/scroll-area.d.ts +33 -0
- package/dist/components/scroll-area.js +31 -0
- package/dist/components/select.d.ts +35 -0
- package/dist/components/select.js +60 -0
- package/dist/components/separator.d.ts +14 -0
- package/dist/components/separator.js +17 -0
- package/dist/components/sidebar.d.ts +147 -0
- package/dist/components/sidebar.js +489 -0
- package/dist/components/site-header.d.ts +59 -0
- package/dist/components/site-header.js +67 -0
- package/dist/components/skeleton.d.ts +31 -0
- package/dist/components/skeleton.js +29 -0
- package/dist/components/slider.d.ts +24 -0
- package/dist/components/slider.js +129 -0
- package/dist/components/sources.d.ts +25 -0
- package/dist/components/sources.js +35 -0
- package/dist/components/spinner.d.ts +36 -0
- package/dist/components/spinner.js +72 -0
- package/dist/components/suggestions.d.ts +20 -0
- package/dist/components/suggestions.js +18 -0
- package/dist/components/switch.d.ts +14 -0
- package/dist/components/switch.js +26 -0
- package/dist/components/table.d.ts +162 -0
- package/dist/components/table.js +758 -0
- package/dist/components/tabs.d.ts +25 -0
- package/dist/components/tabs.js +162 -0
- package/dist/components/tag.d.ts +41 -0
- package/dist/components/tag.js +88 -0
- package/dist/components/tags-input.d.ts +40 -0
- package/dist/components/tags-input.js +239 -0
- package/dist/components/textarea.d.ts +13 -0
- package/dist/components/textarea.js +16 -0
- package/dist/components/theme.d.ts +41 -0
- package/dist/components/theme.js +112 -0
- package/dist/components/time-field.d.ts +51 -0
- package/dist/components/time-field.js +437 -0
- package/dist/components/timeline.d.ts +76 -0
- package/dist/components/timeline.js +99 -0
- package/dist/components/toast.d.ts +72 -0
- package/dist/components/toast.js +196 -0
- package/dist/components/toggle-group.d.ts +41 -0
- package/dist/components/toggle-group.js +140 -0
- package/dist/components/toggle.d.ts +23 -0
- package/dist/components/toggle.js +35 -0
- package/dist/components/tool-call.d.ts +52 -0
- package/dist/components/tool-call.js +57 -0
- package/dist/components/toolbar.d.ts +17 -0
- package/dist/components/toolbar.js +34 -0
- package/dist/components/tooltip.d.ts +42 -0
- package/dist/components/tooltip.js +47 -0
- package/dist/components/tree.d.ts +75 -0
- package/dist/components/tree.js +636 -0
- package/dist/components/typography.d.ts +134 -0
- package/dist/components/typography.js +176 -0
- package/dist/components/video-player.d.ts +276 -0
- package/dist/components/video-player.js +1352 -0
- package/dist/components/whiteboard.d.ts +80 -0
- package/dist/components/whiteboard.js +389 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +86 -0
- package/dist/lib/cn.d.ts +20 -0
- package/dist/lib/cn.js +38 -0
- package/dist/lib/code-highlight.d.ts +31 -0
- package/dist/lib/code-highlight.js +24 -0
- package/dist/lib/code-theme.d.ts +19 -0
- package/dist/lib/code-theme.js +140 -0
- package/dist/lib/collapse-row.d.ts +9 -0
- package/dist/lib/collapse-row.js +129 -0
- package/dist/lib/digit-roll.d.ts +21 -0
- package/dist/lib/digit-roll.js +31 -0
- package/dist/lib/editorial-assets.d.ts +16 -0
- package/dist/lib/editorial-assets.js +56 -0
- package/dist/lib/figure/catalog.d.ts +127 -0
- package/dist/lib/figure/catalog.js +130 -0
- package/dist/lib/figure/figures/automation.d.ts +7 -0
- package/dist/lib/figure/figures/automation.js +143 -0
- package/dist/lib/figure/figures/bar-chart.d.ts +7 -0
- package/dist/lib/figure/figures/bar-chart.js +99 -0
- package/dist/lib/figure/figures/brackets-classic.d.ts +11 -0
- package/dist/lib/figure/figures/brackets-classic.js +170 -0
- package/dist/lib/figure/figures/brackets.d.ts +8 -0
- package/dist/lib/figure/figures/brackets.js +84 -0
- package/dist/lib/figure/figures/city.d.ts +7 -0
- package/dist/lib/figure/figures/city.js +93 -0
- package/dist/lib/figure/figures/conveyor.d.ts +7 -0
- package/dist/lib/figure/figures/conveyor.js +97 -0
- package/dist/lib/figure/figures/database.d.ts +7 -0
- package/dist/lib/figure/figures/database.js +65 -0
- package/dist/lib/figure/figures/documents.d.ts +7 -0
- package/dist/lib/figure/figures/documents.js +83 -0
- package/dist/lib/figure/figures/inbox.d.ts +7 -0
- package/dist/lib/figure/figures/inbox.js +92 -0
- package/dist/lib/figure/figures/laptop.d.ts +7 -0
- package/dist/lib/figure/figures/laptop.js +67 -0
- package/dist/lib/figure/figures/monitor.d.ts +7 -0
- package/dist/lib/figure/figures/monitor.js +59 -0
- package/dist/lib/figure/figures/pipeline.d.ts +8 -0
- package/dist/lib/figure/figures/pipeline.js +117 -0
- package/dist/lib/figure/figures/platform.d.ts +7 -0
- package/dist/lib/figure/figures/platform.js +117 -0
- package/dist/lib/figure/figures/server.d.ts +7 -0
- package/dist/lib/figure/figures/server.js +115 -0
- package/dist/lib/figure/figures/spreadsheet.d.ts +7 -0
- package/dist/lib/figure/figures/spreadsheet.js +87 -0
- package/dist/lib/figure/figures/timeline.d.ts +7 -0
- package/dist/lib/figure/figures/timeline.js +65 -0
- package/dist/lib/figure/kernel.d.ts +152 -0
- package/dist/lib/figure/kernel.js +576 -0
- package/dist/lib/figure/parts.d.ts +42 -0
- package/dist/lib/figure/parts.js +126 -0
- package/dist/lib/form-reset.d.ts +11 -0
- package/dist/lib/form-reset.js +22 -0
- package/dist/lib/glide.d.ts +53 -0
- package/dist/lib/glide.js +138 -0
- package/dist/lib/graph-layout.d.ts +58 -0
- package/dist/lib/graph-layout.js +200 -0
- package/dist/lib/illustration-drawings.d.ts +89 -0
- package/dist/lib/illustration-drawings.js +539 -0
- package/dist/lib/illustration-info.d.ts +37 -0
- package/dist/lib/illustration-info.js +22 -0
- package/dist/lib/illustration-library.d.ts +87 -0
- package/dist/lib/illustration-library.js +352 -0
- package/dist/lib/logo-geometry.d.ts +29 -0
- package/dist/lib/logo-geometry.js +67 -0
- package/dist/lib/markdown-guard.d.ts +16 -0
- package/dist/lib/markdown-guard.js +123 -0
- package/dist/lib/merge-refs.d.ts +10 -0
- package/dist/lib/merge-refs.js +26 -0
- package/dist/lib/motion.d.ts +6 -0
- package/dist/lib/motion.js +12 -0
- package/dist/lib/pdf-worker.d.ts +1 -0
- package/dist/lib/pdf-worker.js +6 -0
- package/dist/lib/pdf.d.ts +19 -0
- package/dist/lib/pdf.js +58 -0
- package/dist/lib/platform.d.ts +33 -0
- package/dist/lib/platform.js +68 -0
- package/dist/lib/room.d.ts +25 -0
- package/dist/lib/room.js +46 -0
- package/dist/lib/table-fit.d.ts +143 -0
- package/dist/lib/table-fit.js +577 -0
- package/dist/lib/theme-script.d.ts +18 -0
- package/dist/lib/theme-script.js +29 -0
- package/dist/styles/expressive.css +188 -0
- package/dist/styles/fonts.css +145 -0
- package/dist/styles/index.css +206 -0
- package/dist/styles/material.css +313 -0
- package/dist/styles/parts/ai.css +360 -0
- package/dist/styles/parts/brand.css +75 -0
- package/dist/styles/parts/controls.css +725 -0
- package/dist/styles/parts/data.css +222 -0
- package/dist/styles/parts/editorial.css +120 -0
- package/dist/styles/parts/feedback.css +273 -0
- package/dist/styles/parts/foundations.css +166 -0
- package/dist/styles/parts/graph.css +214 -0
- package/dist/styles/parts/inputs.css +261 -0
- package/dist/styles/parts/isometric.css +124 -0
- package/dist/styles/parts/navigation.css +232 -0
- package/dist/styles/parts/overlays.css +250 -0
- package/dist/styles/parts/pdf.css +154 -0
- package/dist/styles/parts/react-flow.css +519 -0
- package/dist/styles/parts/whiteboard.css +855 -0
- package/dist/styles/tokens.css +290 -0
- package/dist/vite.d.ts +116 -0
- package/dist/vite.js +129 -0
- package/package.json +188 -5
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
+
type HeadingTag = "h1" | "h2" | "h3" | "h4" | "p" | "div" | "span";
|
|
3
|
+
type BlockTag = "p" | "div" | "span";
|
|
4
|
+
export interface DisplayProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Element to render. Defaults to `h1`: one Display per page, carrying the page. */
|
|
6
|
+
as?: HeadingTag;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Display — the hero headline in Licht Light. 48px, 60px at `sm`, 72px at `md`; line height
|
|
10
|
+
* 1.03, tracking -0.02em, balanced wrapping.
|
|
11
|
+
*
|
|
12
|
+
* Use it once per page for the statement that carries it.
|
|
13
|
+
* The rule people break: making it bold. Licht has a single Light (300) face — `font-bold`
|
|
14
|
+
* only synthesises a smeared fake. Hierarchy comes from scale, not weight.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Display({ as: Tag, className, ...props }: DisplayProps): import("react").JSX.Element;
|
|
17
|
+
declare const headingLevels: {
|
|
18
|
+
readonly 2: "text-[30px] leading-[1.1] sm:text-[36px] md:text-[48px] md:leading-[1.05]";
|
|
19
|
+
readonly 3: "text-[24px] leading-[1.15] md:text-[28px] md:leading-[1.1]";
|
|
20
|
+
readonly 4: "text-[20px] leading-[1.25]";
|
|
21
|
+
};
|
|
22
|
+
export type HeadingLevel = keyof typeof headingLevels;
|
|
23
|
+
export interface HeadingProps extends HTMLAttributes<HTMLElement> {
|
|
24
|
+
/** Outline level: `2` section title (30–48px), `3` sub-section (24–28px), `4` group title (20px). */
|
|
25
|
+
level?: HeadingLevel;
|
|
26
|
+
/** Override the tag while keeping the level's size (e.g. a visual h2 that is an `h3` in the outline). */
|
|
27
|
+
as?: HeadingTag;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Heading — section and sub-section titles in Licht Light, mixed case, -0.02em.
|
|
31
|
+
*
|
|
32
|
+
* `level` sets both the tag and the size so the outline and the visual hierarchy agree.
|
|
33
|
+
* The rule people break: skipping levels for size. Pick the level the outline needs and use
|
|
34
|
+
* `as` only when the two genuinely differ.
|
|
35
|
+
*/
|
|
36
|
+
export declare function Heading({ level, as, className, ...props }: HeadingProps): import("react").JSX.Element;
|
|
37
|
+
export interface TwoToneProps extends HTMLAttributes<HTMLElement> {
|
|
38
|
+
/** Each child is one line. The first is foreground, every following line is muted. */
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
/** `section` uses the h2 scale (30–48px); `display` uses the hero scale (48–72px). */
|
|
41
|
+
size?: "section" | "display";
|
|
42
|
+
as?: HeadingTag;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* TwoTone — the two-line headline: a statement, then its counterpart in muted ink.
|
|
46
|
+
* "less noise." / "more signal."
|
|
47
|
+
*
|
|
48
|
+
* Use it where a headline is a pair of short, parallel phrases.
|
|
49
|
+
* The rule people break: muting the line that carries the meaning. The muted line is the
|
|
50
|
+
* echo; the first line must make sense on its own.
|
|
51
|
+
*/
|
|
52
|
+
export declare function TwoTone({ children, size, as: Tag, className, ...props }: TwoToneProps): import("react").JSX.Element;
|
|
53
|
+
export interface EyebrowProps extends HTMLAttributes<HTMLElement> {
|
|
54
|
+
as?: BlockTag;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Eyebrow — the small label above a heading: 12px Licht Mono, uppercase, 0.18em tracking,
|
|
58
|
+
* muted.
|
|
59
|
+
*
|
|
60
|
+
* Use it to name a section or category in two to four words.
|
|
61
|
+
* The rule people break: writing a sentence in it. All caps is for short labels only.
|
|
62
|
+
*/
|
|
63
|
+
export declare function Eyebrow({ as: Tag, className, ...props }: EyebrowProps): import("react").JSX.Element;
|
|
64
|
+
export interface LeadProps extends HTMLAttributes<HTMLElement> {
|
|
65
|
+
as?: BlockTag;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Lead — the supporting paragraph under a Display or section heading: 18px, 20px at `md`,
|
|
69
|
+
* Licht Sans in `foreground-soft`, held to about 60 characters per line.
|
|
70
|
+
*
|
|
71
|
+
* The rule people break: using it for body copy. One Lead per heading; everything after it
|
|
72
|
+
* is `Text`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function Lead({ as: Tag, className, ...props }: LeadProps): import("react").JSX.Element;
|
|
75
|
+
declare const textTones: {
|
|
76
|
+
readonly default: "text-foreground";
|
|
77
|
+
readonly soft: "text-foreground-soft";
|
|
78
|
+
readonly muted: "text-muted-foreground";
|
|
79
|
+
};
|
|
80
|
+
declare const textSizes: {
|
|
81
|
+
readonly sm: "text-[15px] leading-[1.6]";
|
|
82
|
+
readonly base: "text-[17px] leading-[1.6]";
|
|
83
|
+
};
|
|
84
|
+
export type TextTone = keyof typeof textTones;
|
|
85
|
+
export type TextSize = keyof typeof textSizes;
|
|
86
|
+
export interface TextProps extends HTMLAttributes<HTMLElement> {
|
|
87
|
+
/** `default` foreground, `soft` secondary text, `muted` supporting notes. */
|
|
88
|
+
tone?: TextTone;
|
|
89
|
+
/** `base` 17/1.6 reading size; `sm` 15/1.6 for captions and dense notes. */
|
|
90
|
+
size?: TextSize;
|
|
91
|
+
as?: BlockTag;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Text — reading copy in Licht Sans, 17px with a 1.6 line height.
|
|
95
|
+
*
|
|
96
|
+
* The rule people break: setting long copy in Licht or mono. Paragraphs are always Licht Sans;
|
|
97
|
+
* reach for `tone="muted"` only for supporting notes, never for text people must read.
|
|
98
|
+
*/
|
|
99
|
+
export declare function Text({ tone, size, as: Tag, className, ...props }: TextProps): import("react").JSX.Element;
|
|
100
|
+
export interface MonoProps extends HTMLAttributes<HTMLElement> {
|
|
101
|
+
as?: "span" | "code" | "samp";
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Mono — inline Licht Mono for technical details: file names, commands, identifiers, values.
|
|
105
|
+
*
|
|
106
|
+
* The rule people break: setting whole paragraphs in it. Mono is a detail, not a voice.
|
|
107
|
+
*/
|
|
108
|
+
export declare function Mono({ as: Tag, className, ...props }: MonoProps): import("react").JSX.Element;
|
|
109
|
+
export interface IndexProps extends HTMLAttributes<HTMLSpanElement> {
|
|
110
|
+
/** A step number, zero-padded to two digits (`1` → "01"). Ignored when children are given. */
|
|
111
|
+
n?: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Index — a mono step index like "01": 12px Licht Mono, tabular figures, muted.
|
|
115
|
+
*
|
|
116
|
+
* Use it to number steps, sections or list rows so the figures line up.
|
|
117
|
+
* The rule people break: numbering things that have no order.
|
|
118
|
+
*/
|
|
119
|
+
export declare function Index({ n, children, className, ...props }: IndexProps): import("react").JSX.Element;
|
|
120
|
+
export interface ProseProps extends HTMLAttributes<HTMLElement> {
|
|
121
|
+
as?: "div" | "article" | "section";
|
|
122
|
+
ref?: Ref<HTMLElement>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Prose — styles rich text you do not control element by element (Markdown, CMS output):
|
|
126
|
+
* h2/h3 in Licht, paragraphs at 17/1.6, lists, links with the brand underline, inline code
|
|
127
|
+
* in mono, blockquotes behind a hairline rule. A `<pre>` wider than the column scrolls
|
|
128
|
+
* sideways, and is a tab stop while it does.
|
|
129
|
+
*
|
|
130
|
+
* The rule people break: wrapping composed layouts in it. Prose is for flowing documents;
|
|
131
|
+
* pages built from components do not need it.
|
|
132
|
+
*/
|
|
133
|
+
export declare function Prose({ as: Tag, className, ref, ...props }: ProseProps): import("react").JSX.Element;
|
|
134
|
+
export {};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Children, useEffect, useMemo, useRef, } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { mergeRefs } from "../lib/merge-refs.js";
|
|
6
|
+
/**
|
|
7
|
+
* Display — the hero headline in Licht Light. 48px, 60px at `sm`, 72px at `md`; line height
|
|
8
|
+
* 1.03, tracking -0.02em, balanced wrapping.
|
|
9
|
+
*
|
|
10
|
+
* Use it once per page for the statement that carries it.
|
|
11
|
+
* The rule people break: making it bold. Licht has a single Light (300) face — `font-bold`
|
|
12
|
+
* only synthesises a smeared fake. Hierarchy comes from scale, not weight.
|
|
13
|
+
*/
|
|
14
|
+
export function Display({ as: Tag = "h1", className, ...props }) {
|
|
15
|
+
return (_jsx(Tag, { "data-slot": "display", className: cn("display text-[48px] break-words text-foreground sm:text-[60px] md:text-[72px]", className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
/* ── Heading ───────────────────────────────────────────────────────────────── */
|
|
18
|
+
const headingLevels = {
|
|
19
|
+
2: "text-[30px] leading-[1.1] sm:text-[36px] md:text-[48px] md:leading-[1.05]",
|
|
20
|
+
3: "text-[24px] leading-[1.15] md:text-[28px] md:leading-[1.1]",
|
|
21
|
+
4: "text-[20px] leading-[1.25]",
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Heading — section and sub-section titles in Licht Light, mixed case, -0.02em.
|
|
25
|
+
*
|
|
26
|
+
* `level` sets both the tag and the size so the outline and the visual hierarchy agree.
|
|
27
|
+
* The rule people break: skipping levels for size. Pick the level the outline needs and use
|
|
28
|
+
* `as` only when the two genuinely differ.
|
|
29
|
+
*/
|
|
30
|
+
export function Heading({ level = 2, as, className, ...props }) {
|
|
31
|
+
const Tag = as ?? `h${level}`;
|
|
32
|
+
return (_jsx(Tag, { "data-slot": "heading", "data-level": level, className: cn("font-heading font-light tracking-[-0.02em] text-balance break-words text-foreground", headingLevels[level], className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* TwoTone — the two-line headline: a statement, then its counterpart in muted ink.
|
|
36
|
+
* "less noise." / "more signal."
|
|
37
|
+
*
|
|
38
|
+
* Use it where a headline is a pair of short, parallel phrases.
|
|
39
|
+
* The rule people break: muting the line that carries the meaning. The muted line is the
|
|
40
|
+
* echo; the first line must make sense on its own.
|
|
41
|
+
*/
|
|
42
|
+
export function TwoTone({ children, size = "section", as: Tag = "h2", className, ...props }) {
|
|
43
|
+
const lines = Children.toArray(children);
|
|
44
|
+
return (_jsx(Tag, { "data-slot": "two-tone", "data-size": size, className: cn("font-heading font-light tracking-[-0.02em] text-balance break-words text-foreground", size === "display" ? "display text-[48px] sm:text-[60px] md:text-[72px]" : headingLevels[2], className), ...props, children: lines.map((line, i) => (_jsxs("span", { "data-slot": "two-tone-line", className: cn("block", i > 0 && "text-muted-foreground"), children: [i > 0 && " ", line] }, i))) }));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Eyebrow — the small label above a heading: 12px Licht Mono, uppercase, 0.18em tracking,
|
|
48
|
+
* muted.
|
|
49
|
+
*
|
|
50
|
+
* Use it to name a section or category in two to four words.
|
|
51
|
+
* The rule people break: writing a sentence in it. All caps is for short labels only.
|
|
52
|
+
*/
|
|
53
|
+
export function Eyebrow({ as: Tag = "p", className, ...props }) {
|
|
54
|
+
return _jsx(Tag, { "data-slot": "eyebrow", className: cn("eyebrow break-words", className), ...props });
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Lead — the supporting paragraph under a Display or section heading: 18px, 20px at `md`,
|
|
58
|
+
* Licht Sans in `foreground-soft`, held to about 60 characters per line.
|
|
59
|
+
*
|
|
60
|
+
* The rule people break: using it for body copy. One Lead per heading; everything after it
|
|
61
|
+
* is `Text`.
|
|
62
|
+
*/
|
|
63
|
+
export function Lead({ as: Tag = "p", className, ...props }) {
|
|
64
|
+
return (_jsx(Tag, { "data-slot": "lead", className: cn("max-w-[60ch] font-body text-[18px] leading-[1.55] text-pretty break-words text-foreground-soft md:text-[20px]", className), ...props }));
|
|
65
|
+
}
|
|
66
|
+
/* ── Text ──────────────────────────────────────────────────────────────────── */
|
|
67
|
+
const textTones = {
|
|
68
|
+
default: "text-foreground",
|
|
69
|
+
soft: "text-foreground-soft",
|
|
70
|
+
muted: "text-muted-foreground",
|
|
71
|
+
};
|
|
72
|
+
const textSizes = {
|
|
73
|
+
sm: "text-[15px] leading-[1.6]",
|
|
74
|
+
base: "text-[17px] leading-[1.6]",
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Text — reading copy in Licht Sans, 17px with a 1.6 line height.
|
|
78
|
+
*
|
|
79
|
+
* The rule people break: setting long copy in Licht or mono. Paragraphs are always Licht Sans;
|
|
80
|
+
* reach for `tone="muted"` only for supporting notes, never for text people must read.
|
|
81
|
+
*/
|
|
82
|
+
export function Text({ tone = "default", size = "base", as: Tag = "p", className, ...props }) {
|
|
83
|
+
return (_jsx(Tag, { "data-slot": "text", "data-tone": tone, "data-size": size, className: cn("font-body text-pretty break-words", textSizes[size], textTones[tone], className), ...props }));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Mono — inline Licht Mono for technical details: file names, commands, identifiers, values.
|
|
87
|
+
*
|
|
88
|
+
* The rule people break: setting whole paragraphs in it. Mono is a detail, not a voice.
|
|
89
|
+
*/
|
|
90
|
+
export function Mono({ as: Tag = "span", className, ...props }) {
|
|
91
|
+
return _jsx(Tag, { "data-slot": "mono", className: cn("font-mono text-[0.94em]", className), ...props });
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Index — a mono step index like "01": 12px Licht Mono, tabular figures, muted.
|
|
95
|
+
*
|
|
96
|
+
* Use it to number steps, sections or list rows so the figures line up.
|
|
97
|
+
* The rule people break: numbering things that have no order.
|
|
98
|
+
*/
|
|
99
|
+
export function Index({ n, children, className, ...props }) {
|
|
100
|
+
return (_jsx("span", { "data-slot": "index", className: cn("font-mono text-[12px] leading-[1.4] tracking-[0.08em] text-muted-foreground tabular-nums", className), ...props, children: children ?? (n !== undefined ? String(n).padStart(2, "0") : null) }));
|
|
101
|
+
}
|
|
102
|
+
/** The `<pre>`s Prose made tab stops. One with a tabindex of its own is never touched. */
|
|
103
|
+
const scrollStops = new WeakSet();
|
|
104
|
+
/**
|
|
105
|
+
* Makes each `<pre>` inside `root` a tab stop while it scrolls, so the keyboard can scroll code
|
|
106
|
+
* that holds nothing focusable (Safari does not make a scrolling region focusable on its own).
|
|
107
|
+
* What Prose holds is anyone's markup — children, Markdown set as HTML, blocks added later — so
|
|
108
|
+
* the `<pre>`s are found in the DOM and checked again whenever the content, a size or the fonts
|
|
109
|
+
* change, once a frame at most.
|
|
110
|
+
*/
|
|
111
|
+
function useScrollStops(ref) {
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
const root = ref.current;
|
|
114
|
+
if (!root)
|
|
115
|
+
return;
|
|
116
|
+
let frame = 0;
|
|
117
|
+
const check = () => {
|
|
118
|
+
frame = 0;
|
|
119
|
+
for (const pre of root.querySelectorAll("pre")) {
|
|
120
|
+
// A tabindex set since (by its owner) takes the <pre> back.
|
|
121
|
+
if (scrollStops.has(pre) && pre.getAttribute("tabindex") !== "0")
|
|
122
|
+
scrollStops.delete(pre);
|
|
123
|
+
if (pre.hasAttribute("tabindex") && !scrollStops.has(pre))
|
|
124
|
+
continue;
|
|
125
|
+
const cs = getComputedStyle(pre);
|
|
126
|
+
const scrolls = (/auto|scroll/.test(cs.overflowX) && pre.scrollWidth > pre.clientWidth + 1) ||
|
|
127
|
+
(/auto|scroll/.test(cs.overflowY) && pre.scrollHeight > pre.clientHeight + 1);
|
|
128
|
+
if (scrolls) {
|
|
129
|
+
pre.tabIndex = 0;
|
|
130
|
+
scrollStops.add(pre);
|
|
131
|
+
}
|
|
132
|
+
else if (scrollStops.delete(pre))
|
|
133
|
+
pre.removeAttribute("tabindex");
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const schedule = () => {
|
|
137
|
+
frame ||= requestAnimationFrame(check);
|
|
138
|
+
};
|
|
139
|
+
const resize = new ResizeObserver(schedule);
|
|
140
|
+
const observe = () => {
|
|
141
|
+
resize.disconnect();
|
|
142
|
+
for (const pre of root.querySelectorAll("pre"))
|
|
143
|
+
resize.observe(pre);
|
|
144
|
+
};
|
|
145
|
+
const mutations = new MutationObserver(() => {
|
|
146
|
+
observe();
|
|
147
|
+
schedule();
|
|
148
|
+
});
|
|
149
|
+
mutations.observe(root, { childList: true, subtree: true, characterData: true });
|
|
150
|
+
observe();
|
|
151
|
+
schedule();
|
|
152
|
+
// A web font arriving widens the code without resizing its box.
|
|
153
|
+
document.fonts?.addEventListener("loadingdone", schedule);
|
|
154
|
+
return () => {
|
|
155
|
+
cancelAnimationFrame(frame);
|
|
156
|
+
resize.disconnect();
|
|
157
|
+
mutations.disconnect();
|
|
158
|
+
document.fonts?.removeEventListener("loadingdone", schedule);
|
|
159
|
+
};
|
|
160
|
+
}, [ref]);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Prose — styles rich text you do not control element by element (Markdown, CMS output):
|
|
164
|
+
* h2/h3 in Licht, paragraphs at 17/1.6, lists, links with the brand underline, inline code
|
|
165
|
+
* in mono, blockquotes behind a hairline rule. A `<pre>` wider than the column scrolls
|
|
166
|
+
* sideways, and is a tab stop while it does.
|
|
167
|
+
*
|
|
168
|
+
* The rule people break: wrapping composed layouts in it. Prose is for flowing documents;
|
|
169
|
+
* pages built from components do not need it.
|
|
170
|
+
*/
|
|
171
|
+
export function Prose({ as: Tag = "div", className, ref, ...props }) {
|
|
172
|
+
const own = useRef(null);
|
|
173
|
+
const refs = useMemo(() => mergeRefs(own, ref), [ref]);
|
|
174
|
+
useScrollStops(own);
|
|
175
|
+
return _jsx(Tag, { ref: refs, "data-slot": "prose", className: cn("ep-prose", className), ...props });
|
|
176
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** One encoding of the video. List the smaller, more modern one first: WebM, then MP4. */
|
|
3
|
+
export interface VideoSource {
|
|
4
|
+
src: string;
|
|
5
|
+
/** The MIME type, e.g. `video/webm` or `video/mp4`, so the browser skips what it cannot play. */
|
|
6
|
+
type?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* One version of the same video: a dub, a resolution, or both. The player offers an audio menu
|
|
10
|
+
* when versions differ in `audio` and a quality menu when they differ in `quality`, and switching
|
|
11
|
+
* keeps the playhead where it was.
|
|
12
|
+
*/
|
|
13
|
+
export interface VideoVersion {
|
|
14
|
+
src: string | VideoSource[];
|
|
15
|
+
/** The audio of this version, as the audio menu names it: "English", "Deutsch", "Original". */
|
|
16
|
+
audio?: string;
|
|
17
|
+
/** Its resolution, as the quality menu names it: "2160p", "1080p", "720p". */
|
|
18
|
+
quality?: string;
|
|
19
|
+
/** What the quality menu says beside it, in Licht Mono: "24 Mbit/s". */
|
|
20
|
+
qualityDetail?: string;
|
|
21
|
+
}
|
|
22
|
+
/** A WebVTT file of captions or subtitles. */
|
|
23
|
+
export interface VideoTrack {
|
|
24
|
+
src: string;
|
|
25
|
+
/** Shown in the subtitles menu: "English". */
|
|
26
|
+
label: string;
|
|
27
|
+
/** The language, e.g. `en`. */
|
|
28
|
+
srcLang: string;
|
|
29
|
+
kind?: "captions" | "subtitles";
|
|
30
|
+
/** Show this track when the video loads. */
|
|
31
|
+
default?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* For subtitles the browser can't read, such as Blu-ray PGS pictures: draws them itself while
|
|
34
|
+
* the track is chosen, into `layer` — over the picture, under the controls, and moved up out of
|
|
35
|
+
* their way while they show — and returns what stops it. The player then adds no `<track>` for
|
|
36
|
+
* it; `src` is the app's to use.
|
|
37
|
+
*/
|
|
38
|
+
render?: (video: HTMLVideoElement, layer: HTMLElement) => () => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A still of one moment, shown above the timeline under the pointer: a whole image, or one tile
|
|
42
|
+
* of a sprite sheet (`x` and `y` place the tile, in the sheet's own pixels).
|
|
43
|
+
*/
|
|
44
|
+
export interface VideoPreview {
|
|
45
|
+
src: string;
|
|
46
|
+
/** The still's size, in the image's own pixels. */
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
x?: number;
|
|
50
|
+
y?: number;
|
|
51
|
+
}
|
|
52
|
+
/** A stretch people may want to pass over — an intro, a recap — offered as a skip button while it plays. */
|
|
53
|
+
export interface VideoSegment {
|
|
54
|
+
/** Where it starts and ends, in seconds. */
|
|
55
|
+
start: number;
|
|
56
|
+
end: number;
|
|
57
|
+
/** What the button says: "Skip intro", "Next episode". */
|
|
58
|
+
label: string;
|
|
59
|
+
/** What the button does instead of jumping to `end`: playing the next episode over the credits. */
|
|
60
|
+
onSkip?: () => void;
|
|
61
|
+
/**
|
|
62
|
+
* Skip without being asked: `"now"` as playback runs into the segment (not when someone jumps
|
|
63
|
+
* into it), `"countdown"` when the button's fill has run down.
|
|
64
|
+
*/
|
|
65
|
+
auto?: "now" | "countdown";
|
|
66
|
+
}
|
|
67
|
+
/** An episode in the player's episode list. */
|
|
68
|
+
export interface VideoEpisode {
|
|
69
|
+
/** What `onEpisodeSelect` gets back. */
|
|
70
|
+
id: string;
|
|
71
|
+
/** Its number in the season. */
|
|
72
|
+
number?: number;
|
|
73
|
+
title: string;
|
|
74
|
+
/** A line or two about it. */
|
|
75
|
+
description?: string;
|
|
76
|
+
/** A still from it, 16:9. */
|
|
77
|
+
image?: string;
|
|
78
|
+
/** How long it runs, ready to read: "52 min". */
|
|
79
|
+
duration?: string;
|
|
80
|
+
/** How much of it has been watched, from 0 to 1. */
|
|
81
|
+
progress?: number;
|
|
82
|
+
}
|
|
83
|
+
/** A season in the player's episode list. */
|
|
84
|
+
export interface VideoSeason {
|
|
85
|
+
id: string;
|
|
86
|
+
/** "Season 1". */
|
|
87
|
+
label: string;
|
|
88
|
+
/** Its episodes; leave them out until they've loaded — `onSeasonOpen` asks for them. */
|
|
89
|
+
episodes?: VideoEpisode[];
|
|
90
|
+
/** How many episodes it has, for the list of seasons while they're not loaded. */
|
|
91
|
+
count?: number;
|
|
92
|
+
}
|
|
93
|
+
/** The player's words: its controls' names, tooltips and menus, and what it says in words. */
|
|
94
|
+
export interface VideoPlayerLabels {
|
|
95
|
+
/** The player's name when it has no `title`. */
|
|
96
|
+
player: string;
|
|
97
|
+
play: string;
|
|
98
|
+
pause: string;
|
|
99
|
+
playAgain: string;
|
|
100
|
+
back: string;
|
|
101
|
+
skipBack: (seconds: number) => string;
|
|
102
|
+
skipForward: (seconds: number) => string;
|
|
103
|
+
/** The `onNext` control. */
|
|
104
|
+
next: string;
|
|
105
|
+
mute: string;
|
|
106
|
+
unmute: string;
|
|
107
|
+
volume: string;
|
|
108
|
+
seek: string;
|
|
109
|
+
/** A length of time in words, for screen readers: "1 minute 15 seconds". */
|
|
110
|
+
duration: (seconds: number) => string;
|
|
111
|
+
/** The scrubber's value, from two `duration`s: "1 minute 15 seconds of 3 minutes". */
|
|
112
|
+
position: (time: string, total: string) => string;
|
|
113
|
+
/** The time left, from a `duration`: "18 minutes left". */
|
|
114
|
+
remaining: (time: string) => string;
|
|
115
|
+
subtitles: string;
|
|
116
|
+
subtitlesOff: string;
|
|
117
|
+
showSubtitles: string;
|
|
118
|
+
hideSubtitles: string;
|
|
119
|
+
audio: string;
|
|
120
|
+
audioAndSubtitles: string;
|
|
121
|
+
quality: string;
|
|
122
|
+
speed: string;
|
|
123
|
+
normalSpeed: string;
|
|
124
|
+
/** A playback rate: "1.5×". */
|
|
125
|
+
rate: (rate: number) => string;
|
|
126
|
+
/** The episode list's button. */
|
|
127
|
+
episodes: string;
|
|
128
|
+
/** Over the list of seasons in the episode list. */
|
|
129
|
+
seasons: string;
|
|
130
|
+
/** Marks the episode playing in the episode list. */
|
|
131
|
+
nowPlaying: string;
|
|
132
|
+
/** A season's size in the episode list: "10 episodes". */
|
|
133
|
+
episodeCount: (count: number) => string;
|
|
134
|
+
pictureInPicture: string;
|
|
135
|
+
leavePictureInPicture: string;
|
|
136
|
+
fullScreen: string;
|
|
137
|
+
exitFullScreen: string;
|
|
138
|
+
loading: string;
|
|
139
|
+
error: string;
|
|
140
|
+
/** Sends the video to an AirPlay screen. */
|
|
141
|
+
airPlay: string;
|
|
142
|
+
/** After an error: load the video again, where it stopped. */
|
|
143
|
+
retry: string;
|
|
144
|
+
/** After an error: the next quality in the menu, where there is one ("Try 720p"). */
|
|
145
|
+
tryQuality: (quality: string) => string;
|
|
146
|
+
/** A double tap's jump, shown where the finger was: "−10 s", "+10 s". */
|
|
147
|
+
jumped: (seconds: number) => string;
|
|
148
|
+
/** While a subtitle file takes its time to arrive. */
|
|
149
|
+
preparingSubtitles: string;
|
|
150
|
+
}
|
|
151
|
+
declare const playerVariants: {
|
|
152
|
+
readonly region: "surface-container";
|
|
153
|
+
readonly card: "rounded-card surface-card [--card-padding:0]";
|
|
154
|
+
readonly plain: "";
|
|
155
|
+
};
|
|
156
|
+
export interface VideoPlayerProps extends Omit<React.ComponentProps<"div">, "children" | "title" | "onPlay" | "onPause" | "onEnded"> {
|
|
157
|
+
/** The video: one URL, or several encodings for the browser to choose from. Or use `versions`. */
|
|
158
|
+
src?: string | VideoSource[];
|
|
159
|
+
/** Versions of the same video in other languages or resolutions, in place of `src`. */
|
|
160
|
+
versions?: VideoVersion[];
|
|
161
|
+
/** The version's `audio` to start with. Defaults to the first version's. */
|
|
162
|
+
defaultAudio?: string;
|
|
163
|
+
/** The version's `quality` to start with. Defaults to the first version's. */
|
|
164
|
+
defaultQuality?: string;
|
|
165
|
+
/** The image shown before the video plays. */
|
|
166
|
+
poster?: string;
|
|
167
|
+
/** What the video is: the player's accessible name, and the heading of the `movie` layout. */
|
|
168
|
+
title?: string;
|
|
169
|
+
/** Captions or subtitles as WebVTT. The first `default` one starts on. */
|
|
170
|
+
tracks?: VideoTrack[];
|
|
171
|
+
/**
|
|
172
|
+
* The track shown, by its place in `tracks` (-1: off), for an app that decides it: when the
|
|
173
|
+
* audio changes, say. The viewer's own choice still shows at once and comes to `onSubtitleChange`.
|
|
174
|
+
*/
|
|
175
|
+
subtitle?: number;
|
|
176
|
+
/** The viewer chose a subtitle track, by its place in `tracks` (-1: off): from a menu or with C. */
|
|
177
|
+
onSubtitleChange?: (index: number) => void;
|
|
178
|
+
/** The viewer chose another audio, by the versions' `audio`. */
|
|
179
|
+
onAudioChange?: (audio: string) => void;
|
|
180
|
+
/** The viewer chose another quality, by the versions' `quality`. */
|
|
181
|
+
onQualityChange?: (quality: string) => void;
|
|
182
|
+
/** The app is still preparing what plays next (another episode): a spinner over the picture. */
|
|
183
|
+
loading?: boolean;
|
|
184
|
+
/** The app's own prompt over the picture, above the controls ("Still watching?"); it stays in full screen. */
|
|
185
|
+
overlay?: React.ReactNode;
|
|
186
|
+
/** The still for a moment, in seconds, shown above the timeline under the pointer and while dragging. */
|
|
187
|
+
previews?: (time: number) => VideoPreview | undefined;
|
|
188
|
+
/** Stretches to offer a skip over while they play: intros, recaps. */
|
|
189
|
+
segments?: VideoSegment[];
|
|
190
|
+
/** The subtitles' size against the default: 1.25 is a quarter larger. */
|
|
191
|
+
subtitleScale?: number;
|
|
192
|
+
/**
|
|
193
|
+
* `default`: one floating bar of dense controls, for a clip on a page. `movie`: the picture
|
|
194
|
+
* under a dark fade, the title at the top, a row of controls and the timeline alone beneath
|
|
195
|
+
* them — for watching something long, often full screen.
|
|
196
|
+
*/
|
|
197
|
+
layout?: "default" | "movie";
|
|
198
|
+
/**
|
|
199
|
+
* `region` (default): a square frame, part of the page. `card`: a 20px object, for a clip that
|
|
200
|
+
* stands on its own. `plain`: no surface, for dialogs.
|
|
201
|
+
*/
|
|
202
|
+
variant?: keyof typeof playerVariants;
|
|
203
|
+
/** Width over height of the frame. Defaults to 16 / 9; the video is letterboxed inside it. */
|
|
204
|
+
aspectRatio?: number;
|
|
205
|
+
/** Where the video starts, in seconds: it loads from there, not from the beginning (to resume). */
|
|
206
|
+
startTime?: number;
|
|
207
|
+
autoPlay?: boolean;
|
|
208
|
+
loop?: boolean;
|
|
209
|
+
/** Start muted. Browsers only autoplay muted video. */
|
|
210
|
+
muted?: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Remembers the viewer's volume and mute in localStorage under this key, as
|
|
213
|
+
* `{"volume":0.8,"muted":false}`, and starts with them. Off by default. A stored value never
|
|
214
|
+
* unmutes a `muted` or `autoPlay` player.
|
|
215
|
+
*/
|
|
216
|
+
volumeStorageKey?: string;
|
|
217
|
+
/**
|
|
218
|
+
* Starting it with sound pauses the other players on the page that are playing with sound;
|
|
219
|
+
* muted ones play on. `false` keeps it out of that: it plays alongside the others, and they
|
|
220
|
+
* leave it playing.
|
|
221
|
+
*/
|
|
222
|
+
pauseOthers?: boolean;
|
|
223
|
+
/** Playback speeds in the speed menu. `false` hides the menu. */
|
|
224
|
+
speeds?: readonly number[] | false;
|
|
225
|
+
/** Controls. All on by default; each shows only where the browser supports it. */
|
|
226
|
+
pictureInPicture?: boolean;
|
|
227
|
+
fullscreen?: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Its shortcuts work while nothing on the page has focus too, not only once the player has it:
|
|
230
|
+
* for a player that is the page (a film, an episode), so keys work from the first moment.
|
|
231
|
+
*/
|
|
232
|
+
pageShortcuts?: boolean;
|
|
233
|
+
onPlay?: () => void;
|
|
234
|
+
onPause?: () => void;
|
|
235
|
+
onEnded?: () => void;
|
|
236
|
+
/** Called as the playhead moves, in seconds. */
|
|
237
|
+
onTimeChange?: (time: number) => void;
|
|
238
|
+
/** The `<video>` element, for anything the player does not wrap. */
|
|
239
|
+
videoRef?: React.Ref<HTMLVideoElement>;
|
|
240
|
+
/** Movie layout: a back arrow before the title, for a player that fills the screen. */
|
|
241
|
+
onBack?: () => void;
|
|
242
|
+
/** Movie layout: a control after the skip buttons that plays what comes next, named by `labels.next`. */
|
|
243
|
+
onNext?: () => void;
|
|
244
|
+
/**
|
|
245
|
+
* The series' episodes, by season, behind an Episodes button: a list over the picture that opens
|
|
246
|
+
* at the season of `currentEpisode`, from which `onEpisodeSelect` plays another.
|
|
247
|
+
*/
|
|
248
|
+
seasons?: VideoSeason[];
|
|
249
|
+
/** The episode playing: its season opens first, and it's marked in the list. */
|
|
250
|
+
currentEpisode?: string;
|
|
251
|
+
/** A season whose episodes aren't there yet was opened in the list: the time to load them. */
|
|
252
|
+
onSeasonOpen?: (id: string) => void;
|
|
253
|
+
onEpisodeSelect?: (id: string) => void;
|
|
254
|
+
/** The player's words, for another language. English by default; give any or all. */
|
|
255
|
+
labels?: Partial<VideoPlayerLabels>;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* VideoPlayer — a video in the zon material: the picture letterboxed on black, and over it
|
|
259
|
+
* controls set dark whatever the page's theme — play, a scrubber with the buffered range and the
|
|
260
|
+
* time under the pointer, the time in Licht Mono, volume, speed, subtitles, audio and quality
|
|
261
|
+
* versions, picture in picture and full screen.
|
|
262
|
+
*
|
|
263
|
+
* A **region** by default: a square frame, part of the page. `variant="card"` makes it a 20px
|
|
264
|
+
* object for a clip that stands on its own; `plain` has no surface, for a dialog.
|
|
265
|
+
*
|
|
266
|
+
* Two layouts. `default` floats one dense bar in the menu material, for a clip on a page.
|
|
267
|
+
* `movie` lays the controls on a dark fade with the title above them and the timeline alone on
|
|
268
|
+
* the bottom row, for watching something long. While the video plays the controls step back
|
|
269
|
+
* after a moment without input and come back with any pointer movement, key press or focus.
|
|
270
|
+
* Subtitles are drawn by the player in Licht Sans and rise above the controls when they show.
|
|
271
|
+
*
|
|
272
|
+
* The rule people break: autoplaying with sound. Browsers block it, and people leave. Autoplay
|
|
273
|
+
* only `muted`, and only where the video is the point of the page.
|
|
274
|
+
*/
|
|
275
|
+
export declare function VideoPlayer({ src, versions, defaultAudio, defaultQuality, poster, title, tracks, subtitle: subtitleProp, onSubtitleChange, onAudioChange, onQualityChange, loading: preparing, overlay, previews, segments, subtitleScale, layout, variant, aspectRatio, startTime, autoPlay, loop, muted: startMuted, volumeStorageKey, pauseOthers, speeds, pictureInPicture: allowPip, fullscreen: allowFullscreen, pageShortcuts, onPlay, onPause, onEnded, onTimeChange, videoRef, onBack, onNext, seasons, currentEpisode, onSeasonOpen, onEpisodeSelect, labels: labelOverrides, className, style, ref, onKeyDown, onPointerMove, onPointerDown, onFocus, ...props }: VideoPlayerProps): React.JSX.Element;
|
|
276
|
+
export {};
|