@seekalfred/primitives 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -11
- package/dist/activity-heatmap/activity-heatmap.d.ts +92 -0
- package/dist/activity-heatmap/activity-heatmap.js +699 -0
- package/dist/activity-heatmap/activity-heatmap.js.map +1 -0
- package/dist/activity-heatmap/index.d.ts +2 -0
- package/dist/activity-heatmap/index.js +2 -0
- package/dist/alert/alert.d.ts +5 -1
- package/dist/alert/alert.js +68 -7
- package/dist/alert/alert.js.map +1 -1
- package/dist/alert-dialog/alert-dialog.d.ts +45 -18
- package/dist/alert-dialog/alert-dialog.js +128 -9
- package/dist/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/alert-dialog/index.d.ts +2 -2
- package/dist/alert-dialog/index.js +2 -2
- package/dist/animated-counter/animated-counter.d.ts +38 -0
- package/dist/animated-counter/animated-counter.js +230 -0
- package/dist/animated-counter/animated-counter.js.map +1 -0
- package/dist/animated-counter/index.d.ts +2 -0
- package/dist/animated-counter/index.js +2 -0
- package/dist/announcement-bar/announcement-bar.d.ts +67 -0
- package/dist/announcement-bar/announcement-bar.js +364 -0
- package/dist/announcement-bar/announcement-bar.js.map +1 -0
- package/dist/announcement-bar/index.d.ts +2 -0
- package/dist/announcement-bar/index.js +2 -0
- package/dist/badge/badge.d.ts +1 -1
- package/dist/bar-chart/bar-chart.d.ts +51 -0
- package/dist/bar-chart/bar-chart.js +565 -0
- package/dist/bar-chart/bar-chart.js.map +1 -0
- package/dist/bar-chart/index.d.ts +2 -0
- package/dist/bar-chart/index.js +2 -0
- package/dist/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/breadcrumb/breadcrumb.js +12 -3
- package/dist/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/brush-chart/brush-chart.d.ts +64 -0
- package/dist/brush-chart/brush-chart.js +1056 -0
- package/dist/brush-chart/brush-chart.js.map +1 -0
- package/dist/brush-chart/index.d.ts +2 -0
- package/dist/brush-chart/index.js +2 -0
- package/dist/button/button.d.ts +2 -2
- package/dist/button/button.js +31 -21
- package/dist/button/button.js.map +1 -1
- package/dist/button-group/button-group.js +3 -4
- package/dist/button-group/button-group.js.map +1 -1
- package/dist/card/card.js +1 -1
- package/dist/card/card.js.map +1 -1
- package/dist/card-stack/card-stack.d.ts +54 -0
- package/dist/card-stack/card-stack.js +492 -0
- package/dist/card-stack/card-stack.js.map +1 -0
- package/dist/card-stack/index.d.ts +2 -0
- package/dist/card-stack/index.js +2 -0
- package/dist/carousel/carousel.d.ts +56 -0
- package/dist/carousel/carousel.js +389 -0
- package/dist/carousel/carousel.js.map +1 -0
- package/dist/carousel/index.d.ts +2 -0
- package/dist/carousel/index.js +2 -0
- package/dist/checkbox/checkbox.js +4 -4
- package/dist/checkbox/checkbox.js.map +1 -1
- package/dist/chip-group/chip-group.d.ts +37 -0
- package/dist/chip-group/chip-group.js +148 -0
- package/dist/chip-group/chip-group.js.map +1 -0
- package/dist/chip-group/index.d.ts +2 -0
- package/dist/chip-group/index.js +2 -0
- package/dist/countdown/countdown.d.ts +45 -0
- package/dist/countdown/countdown.js +298 -0
- package/dist/countdown/countdown.js.map +1 -0
- package/dist/countdown/index.d.ts +2 -0
- package/dist/countdown/index.js +2 -0
- package/dist/date-picker/picker-parts.js +1 -1
- package/dist/date-picker/picker-parts.js.map +1 -1
- package/dist/dialog/dialog.js +1 -1
- package/dist/dialog/dialog.js.map +1 -1
- package/dist/donut-chart/donut-chart.d.ts +64 -0
- package/dist/donut-chart/donut-chart.js +576 -0
- package/dist/donut-chart/donut-chart.js.map +1 -0
- package/dist/donut-chart/index.d.ts +2 -0
- package/dist/donut-chart/index.js +2 -0
- package/dist/empty-state/empty-state.d.ts +21 -10
- package/dist/empty-state/empty-state.js +32 -26
- package/dist/empty-state/empty-state.js.map +1 -1
- package/dist/empty-state/index.d.ts +2 -2
- package/dist/empty-state/index.js +2 -2
- package/dist/file-drop-zone/file-drop-zone.js +1 -1
- package/dist/file-drop-zone/file-drop-zone.js.map +1 -1
- package/dist/filter-bar/filter-bar.d.ts +47 -26
- package/dist/filter-bar/filter-bar.js +272 -156
- package/dist/filter-bar/filter-bar.js.map +1 -1
- package/dist/gauge/gauge.d.ts +45 -0
- package/dist/gauge/gauge.js +219 -0
- package/dist/gauge/gauge.js.map +1 -0
- package/dist/gauge/index.d.ts +2 -0
- package/dist/gauge/index.js +2 -0
- package/dist/in-view-title/in-view-title.d.ts +33 -0
- package/dist/in-view-title/in-view-title.js +119 -0
- package/dist/in-view-title/in-view-title.js.map +1 -0
- package/dist/in-view-title/index.d.ts +2 -0
- package/dist/in-view-title/index.js +2 -0
- package/dist/index.d.ts +49 -6
- package/dist/index.js +48 -8
- package/dist/lib/cn.js +11 -1
- package/dist/lib/cn.js.map +1 -1
- package/dist/lib/field-message.js +28 -10
- package/dist/lib/field-message.js.map +1 -1
- package/dist/lib/field-surface.js +9 -8
- package/dist/lib/field-surface.js.map +1 -1
- package/dist/lib/flag-emoji.js +50 -0
- package/dist/lib/flag-emoji.js.map +1 -0
- package/dist/lib/flip.js +11 -3
- package/dist/lib/flip.js.map +1 -1
- package/dist/lib/menu-highlight.js +64 -0
- package/dist/lib/menu-highlight.js.map +1 -0
- package/dist/lib/motion.js +9 -2
- package/dist/lib/motion.js.map +1 -1
- package/dist/lib/rolling-value.js +1 -1
- package/dist/lib/rolling-value.js.map +1 -1
- package/dist/lib/spring-tween.js +500 -0
- package/dist/lib/spring-tween.js.map +1 -0
- package/dist/lib/swap-text.js +3 -1
- package/dist/lib/swap-text.js.map +1 -1
- package/dist/line-chart/index.d.ts +2 -0
- package/dist/line-chart/index.js +2 -0
- package/dist/line-chart/line-chart.d.ts +76 -0
- package/dist/line-chart/line-chart.js +611 -0
- package/dist/line-chart/line-chart.js.map +1 -0
- package/dist/mention-input/index.d.ts +2 -0
- package/dist/mention-input/index.js +2 -0
- package/dist/mention-input/mention-input.d.ts +98 -0
- package/dist/mention-input/mention-input.js +576 -0
- package/dist/mention-input/mention-input.js.map +1 -0
- package/dist/menu/menu.d.ts +2 -0
- package/dist/menu/menu.js +23 -12
- package/dist/menu/menu.js.map +1 -1
- package/dist/money-input/index.d.ts +2 -0
- package/dist/money-input/index.js +2 -0
- package/dist/money-input/money-input.d.ts +65 -0
- package/dist/money-input/money-input.js +607 -0
- package/dist/money-input/money-input.js.map +1 -0
- package/dist/morph-select/index.d.ts +2 -0
- package/dist/morph-select/index.js +2 -0
- package/dist/morph-select/morph-select.d.ts +71 -0
- package/dist/morph-select/morph-select.js +693 -0
- package/dist/morph-select/morph-select.js.map +1 -0
- package/dist/multi-select/index.d.ts +2 -0
- package/dist/multi-select/index.js +2 -0
- package/dist/multi-select/multi-select.d.ts +36 -0
- package/dist/multi-select/multi-select.js +152 -0
- package/dist/multi-select/multi-select.js.map +1 -0
- package/dist/number-field/index.d.ts +2 -0
- package/dist/number-field/index.js +2 -0
- package/dist/number-field/number-field.d.ts +42 -0
- package/dist/number-field/number-field.js +199 -0
- package/dist/number-field/number-field.js.map +1 -0
- package/dist/onboarding-checklist/index.d.ts +2 -0
- package/dist/onboarding-checklist/index.js +2 -0
- package/dist/onboarding-checklist/onboarding-checklist.d.ts +55 -0
- package/dist/onboarding-checklist/onboarding-checklist.js +577 -0
- package/dist/onboarding-checklist/onboarding-checklist.js.map +1 -0
- package/dist/password-field/password-field.js +2 -2
- package/dist/password-field/password-field.js.map +1 -1
- package/dist/phone-input/index.d.ts +3 -0
- package/dist/phone-input/index.js +3 -0
- package/dist/phone-input/phone-countries.d.ts +29 -0
- package/dist/phone-input/phone-countries.js +170 -0
- package/dist/phone-input/phone-countries.js.map +1 -0
- package/dist/phone-input/phone-input.d.ts +66 -0
- package/dist/phone-input/phone-input.js +440 -0
- package/dist/phone-input/phone-input.js.map +1 -0
- package/dist/popover/popover.d.ts +12 -0
- package/dist/popover/popover.js +31 -7
- package/dist/popover/popover.js.map +1 -1
- package/dist/progress/progress.js +1 -1
- package/dist/radio-group/radio-group.js +1 -1
- package/dist/radio-group/radio-group.js.map +1 -1
- package/dist/reactions/index.d.ts +2 -0
- package/dist/reactions/index.js +2 -0
- package/dist/reactions/reactions.d.ts +50 -0
- package/dist/reactions/reactions.js +315 -0
- package/dist/reactions/reactions.js.map +1 -0
- package/dist/rich-text-editor/index.d.ts +3 -0
- package/dist/rich-text-editor/index.js +2 -0
- package/dist/rich-text-editor/rich-text-editor.d.ts +70 -0
- package/dist/rich-text-editor/rich-text-editor.js +909 -0
- package/dist/rich-text-editor/rich-text-editor.js.map +1 -0
- package/dist/rich-text-editor/rich-text-engine.d.ts +16 -0
- package/dist/rich-text-editor/rich-text-engine.js +366 -0
- package/dist/rich-text-editor/rich-text-engine.js.map +1 -0
- package/dist/rich-text-editor/rich-text-html.js +174 -0
- package/dist/rich-text-editor/rich-text-html.js.map +1 -0
- package/dist/rich-text-editor/rich-text-icons.js +43 -0
- package/dist/rich-text-editor/rich-text-icons.js.map +1 -0
- package/dist/ridgeline/index.d.ts +2 -0
- package/dist/ridgeline/index.js +2 -0
- package/dist/ridgeline/ridgeline.d.ts +55 -0
- package/dist/ridgeline/ridgeline.js +701 -0
- package/dist/ridgeline/ridgeline.js.map +1 -0
- package/dist/scroll-area/index.d.ts +2 -2
- package/dist/scroll-area/index.js +2 -2
- package/dist/scroll-area/scroll-area.d.ts +68 -31
- package/dist/scroll-area/scroll-area.js +208 -59
- package/dist/scroll-area/scroll-area.js.map +1 -1
- package/dist/scrub-input/evaluate.d.ts +14 -0
- package/dist/scrub-input/evaluate.js +72 -0
- package/dist/scrub-input/evaluate.js.map +1 -0
- package/dist/scrub-input/index.d.ts +3 -0
- package/dist/scrub-input/index.js +3 -0
- package/dist/scrub-input/scrub-input.d.ts +74 -0
- package/dist/scrub-input/scrub-input.js +486 -0
- package/dist/scrub-input/scrub-input.js.map +1 -0
- package/dist/search-field/search-field.d.ts +2 -1
- package/dist/search-field/search-field.js +4 -4
- package/dist/search-field/search-field.js.map +1 -1
- package/dist/select/select.d.ts +3 -1
- package/dist/select/select.js +20 -8
- package/dist/select/select.js.map +1 -1
- package/dist/separator/separator.d.ts +1 -1
- package/dist/sheet/sheet.js +2 -1
- package/dist/sheet/sheet.js.map +1 -1
- package/dist/shortcut-recorder/index.d.ts +3 -0
- package/dist/shortcut-recorder/index.js +3 -0
- package/dist/shortcut-recorder/shortcut-model.d.ts +27 -0
- package/dist/shortcut-recorder/shortcut-model.js +206 -0
- package/dist/shortcut-recorder/shortcut-model.js.map +1 -0
- package/dist/shortcut-recorder/shortcut-recorder.d.ts +93 -0
- package/dist/shortcut-recorder/shortcut-recorder.js +489 -0
- package/dist/shortcut-recorder/shortcut-recorder.js.map +1 -0
- package/dist/slider/index.d.ts +2 -2
- package/dist/slider/slider.d.ts +46 -14
- package/dist/slider/slider.js +151 -67
- package/dist/slider/slider.js.map +1 -1
- package/dist/slope-chart/index.d.ts +2 -0
- package/dist/slope-chart/index.js +2 -0
- package/dist/slope-chart/slope-chart.d.ts +54 -0
- package/dist/slope-chart/slope-chart.js +568 -0
- package/dist/slope-chart/slope-chart.js.map +1 -0
- package/dist/sparkline/index.d.ts +2 -0
- package/dist/sparkline/index.js +2 -0
- package/dist/sparkline/sparkline.d.ts +46 -0
- package/dist/sparkline/sparkline.js +390 -0
- package/dist/sparkline/sparkline.js.map +1 -0
- package/dist/split-bar/index.d.ts +2 -0
- package/dist/split-bar/index.js +2 -0
- package/dist/split-bar/split-bar.d.ts +62 -0
- package/dist/split-bar/split-bar.js +513 -0
- package/dist/split-bar/split-bar.js.map +1 -0
- package/dist/split-button/split-button.d.ts +1 -1
- package/dist/split-button/split-button.js +12 -11
- package/dist/split-button/split-button.js.map +1 -1
- package/dist/stat-card/index.d.ts +2 -2
- package/dist/stat-card/index.js +2 -2
- package/dist/stat-card/stat-card.d.ts +24 -4
- package/dist/stat-card/stat-card.js +114 -17
- package/dist/stat-card/stat-card.js.map +1 -1
- package/dist/stepper/index.d.ts +2 -0
- package/dist/stepper/index.js +2 -0
- package/dist/stepper/stepper.d.ts +51 -0
- package/dist/stepper/stepper.js +215 -0
- package/dist/stepper/stepper.js.map +1 -0
- package/dist/streamgraph/index.d.ts +2 -0
- package/dist/streamgraph/index.js +2 -0
- package/dist/streamgraph/streamgraph.d.ts +70 -0
- package/dist/streamgraph/streamgraph.js +613 -0
- package/dist/streamgraph/streamgraph.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/swipe-actions/index.d.ts +2 -0
- package/dist/swipe-actions/index.js +2 -0
- package/dist/swipe-actions/swipe-actions.d.ts +67 -0
- package/dist/swipe-actions/swipe-actions.js +552 -0
- package/dist/swipe-actions/swipe-actions.js.map +1 -0
- package/dist/switch/switch.js +2 -2
- package/dist/switch/switch.js.map +1 -1
- package/dist/table/index.d.ts +2 -2
- package/dist/table/index.js +2 -2
- package/dist/table/table.d.ts +56 -4
- package/dist/table/table.js +340 -165
- package/dist/table/table.js.map +1 -1
- package/dist/tabs/tabs.js +2 -2
- package/dist/tabs/tabs.js.map +1 -1
- package/dist/tag-input/index.d.ts +2 -0
- package/dist/tag-input/index.js +2 -0
- package/dist/tag-input/tag-input.d.ts +40 -0
- package/dist/tag-input/tag-input.js +269 -0
- package/dist/tag-input/tag-input.js.map +1 -0
- package/dist/text-morph/index.d.ts +2 -0
- package/dist/text-morph/index.js +2 -0
- package/dist/text-morph/text-morph.d.ts +23 -0
- package/dist/text-morph/text-morph.js +21 -0
- package/dist/text-morph/text-morph.js.map +1 -0
- package/dist/text-reveal/index.d.ts +2 -0
- package/dist/text-reveal/index.js +2 -0
- package/dist/text-reveal/text-reveal.d.ts +27 -0
- package/dist/text-reveal/text-reveal.js +51 -0
- package/dist/text-reveal/text-reveal.js.map +1 -0
- package/dist/text-shimmer/index.d.ts +2 -0
- package/dist/text-shimmer/index.js +2 -0
- package/dist/text-shimmer/text-shimmer.d.ts +29 -0
- package/dist/text-shimmer/text-shimmer.js +29 -0
- package/dist/text-shimmer/text-shimmer.js.map +1 -0
- package/dist/time-picker/time-picker.js +2 -2
- package/dist/time-picker/time-picker.js.map +1 -1
- package/dist/toast/index.d.ts +2 -2
- package/dist/toast/index.js +2 -2
- package/dist/toast/toast.d.ts +6 -0
- package/dist/toast/toast.js +82 -40
- package/dist/toast/toast.js.map +1 -1
- package/dist/tooltip/tooltip.d.ts +9 -2
- package/dist/tooltip/tooltip.js +7 -7
- package/dist/tooltip/tooltip.js.map +1 -1
- package/dist/treemap/index.d.ts +2 -0
- package/dist/treemap/index.js +2 -0
- package/dist/treemap/treemap.d.ts +53 -0
- package/dist/treemap/treemap.js +699 -0
- package/dist/treemap/treemap.js.map +1 -0
- package/dist/usage-meter/index.d.ts +2 -0
- package/dist/usage-meter/index.js +2 -0
- package/dist/usage-meter/usage-meter.d.ts +50 -0
- package/dist/usage-meter/usage-meter.js +440 -0
- package/dist/usage-meter/usage-meter.js.map +1 -0
- package/dist/waffle-chart/index.d.ts +2 -0
- package/dist/waffle-chart/index.js +2 -0
- package/dist/waffle-chart/waffle-chart.d.ts +57 -0
- package/dist/waffle-chart/waffle-chart.js +426 -0
- package/dist/waffle-chart/waffle-chart.js.map +1 -0
- package/package.json +165 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
//#region src/gauge/gauge.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Gauge: one value against a range, as a ring open at the bottom with the
|
|
5
|
+
* number at its centre. Use it for a score or a fill level; use Progress for a
|
|
6
|
+
* task that finishes.
|
|
7
|
+
*
|
|
8
|
+
* The ring fills the first time it is seen, slowly and without overshoot, like
|
|
9
|
+
* a ring closing. After that it springs to each new value with a little life
|
|
10
|
+
* while the count follows without overshooting. A band that starts at
|
|
11
|
+
* `from` sets the colour and names the state ("Healthy", "At risk"): the
|
|
12
|
+
* highest band the value reaches wins, and it changes exactly as the count
|
|
13
|
+
* crosses the threshold, so state never rests on colour alone. The label,
|
|
14
|
+
* status and detail rise in when they change, from the side the value moved
|
|
15
|
+
* toward.
|
|
16
|
+
*
|
|
17
|
+
* Plain SVG and CSS. One small spring tween writes the ring and the count
|
|
18
|
+
* straight to the DOM. The ring is a `meter` for assistive technology.
|
|
19
|
+
*/
|
|
20
|
+
export type GaugeTone = "primary" | "success" | "warning" | "danger";
|
|
21
|
+
export interface GaugeThreshold {
|
|
22
|
+
/** The band starts at this value (in the same unit as `value`). */
|
|
23
|
+
from: number;
|
|
24
|
+
tone: GaugeTone;
|
|
25
|
+
/** Names the state. Shown under the number and announced with the value. */
|
|
26
|
+
label: string;
|
|
27
|
+
}
|
|
28
|
+
export interface GaugeProps extends Omit<ComponentPropsWithoutRef<"figure">, "children"> {
|
|
29
|
+
value: number;
|
|
30
|
+
/** @default 0 */
|
|
31
|
+
min?: number;
|
|
32
|
+
/** @default 100 */
|
|
33
|
+
max?: number;
|
|
34
|
+
/** What is measured. Names the meter. */
|
|
35
|
+
label: string;
|
|
36
|
+
/** A line under the label, such as "Up 4 from last week". */
|
|
37
|
+
detail?: string;
|
|
38
|
+
/** The colour when no band applies. @default "primary" */
|
|
39
|
+
tone?: GaugeTone;
|
|
40
|
+
/** Bands that set the tone and name the state. */
|
|
41
|
+
thresholds?: GaugeThreshold[];
|
|
42
|
+
}
|
|
43
|
+
export declare const Gauge: import("react").ForwardRefExoticComponent<GaugeProps & import("react").RefAttributes<HTMLElement>>;
|
|
44
|
+
//#endregion
|
|
45
|
+
//# sourceMappingURL=gauge.d.ts.map
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { mergeRefs } from "../lib/merge-refs.js";
|
|
4
|
+
import { prefersReducedMotion, useIsomorphicLayoutEffect } from "../lib/motion.js";
|
|
5
|
+
import { SwapText } from "../lib/swap-text.js";
|
|
6
|
+
import { MORPH, REVEAL, SMOOTH, live, retarget } from "../lib/spring-tween.js";
|
|
7
|
+
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/gauge/gauge.tsx
|
|
10
|
+
/** A 270 degree ring open at the bottom, drawn clockwise from its lower left end. Redrawn from the sweep every frame so the round cap stays exact. */
|
|
11
|
+
const RADIUS = 42;
|
|
12
|
+
const START = -135;
|
|
13
|
+
const SPAN = 270;
|
|
14
|
+
const clamp = (value, low, high) => Math.min(high, Math.max(low, value));
|
|
15
|
+
function ringFor(sweep) {
|
|
16
|
+
const end = START + SPAN * clamp(sweep, 0, 1);
|
|
17
|
+
const at = (angle) => `${(50 + RADIUS * Math.sin(angle * Math.PI / 180)).toFixed(3)} ${(50 - RADIUS * Math.cos(angle * Math.PI / 180)).toFixed(3)}`;
|
|
18
|
+
return `M ${at(START)} A ${RADIUS} ${RADIUS} 0 ${end - START > 180 ? 1 : 0} 1 ${at(end)}`;
|
|
19
|
+
}
|
|
20
|
+
const TRACK = ringFor(1);
|
|
21
|
+
const Gauge = forwardRef(function Gauge({ value, min = 0, max = 100, label, detail, tone = "primary", thresholds, className, ...props }, ref) {
|
|
22
|
+
const safeMax = max > min ? max : min + 1;
|
|
23
|
+
const percentage = clamp((value - min) / (safeMax - min), 0, 1);
|
|
24
|
+
const displayValue = Math.round(percentage * 100);
|
|
25
|
+
const bands = [...thresholds ?? []].sort((a, b) => a.from - b.from);
|
|
26
|
+
const bandAt = (at) => bands.filter((band) => at >= band.from - 1e-6).pop();
|
|
27
|
+
const band = bandAt(value);
|
|
28
|
+
const figure = useRef(null);
|
|
29
|
+
const refs = useMemo(() => mergeRefs(ref, figure), [ref]);
|
|
30
|
+
const ring = useRef(null);
|
|
31
|
+
const digits = useRef(null);
|
|
32
|
+
const sizer = useRef(null);
|
|
33
|
+
const sweep = useRef(live(0));
|
|
34
|
+
const count = useRef(live(0));
|
|
35
|
+
const [seen, setSeen] = useState(false);
|
|
36
|
+
const [filled, setFilled] = useState(false);
|
|
37
|
+
const [shownBand, setShownBand] = useState(band);
|
|
38
|
+
const [moved, setMoved] = useState({
|
|
39
|
+
value: displayValue,
|
|
40
|
+
direction: 1
|
|
41
|
+
});
|
|
42
|
+
if (moved.value !== displayValue) setMoved({
|
|
43
|
+
value: displayValue,
|
|
44
|
+
direction: displayValue < moved.value ? -1 : 1
|
|
45
|
+
});
|
|
46
|
+
const latest = useRef({
|
|
47
|
+
bandAt,
|
|
48
|
+
min,
|
|
49
|
+
span: safeMax - min,
|
|
50
|
+
filled
|
|
51
|
+
});
|
|
52
|
+
useIsomorphicLayoutEffect(() => {
|
|
53
|
+
latest.current = {
|
|
54
|
+
bandAt,
|
|
55
|
+
min,
|
|
56
|
+
span: safeMax - min,
|
|
57
|
+
filled
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
const shownRef = useRef(shownBand);
|
|
61
|
+
useIsomorphicLayoutEffect(() => {
|
|
62
|
+
shownRef.current = shownBand;
|
|
63
|
+
});
|
|
64
|
+
/** One writer: the ring, its fade-in over the first sliver, and the count. */
|
|
65
|
+
const paint = useCallback(() => {
|
|
66
|
+
const to = clamp(sweep.current.value, 0, 1);
|
|
67
|
+
ring.current?.setAttribute("d", ringFor(to));
|
|
68
|
+
if (ring.current) ring.current.style.opacity = String(clamp(to / .02, 0, 1));
|
|
69
|
+
const shown = clamp(count.current.value, 0, 100);
|
|
70
|
+
if (digits.current) digits.current.textContent = String(Math.round(shown));
|
|
71
|
+
const { bandAt: pick, min: lo, span, filled: done } = latest.current;
|
|
72
|
+
if (done) {
|
|
73
|
+
const next = pick(lo + shown / 100 * span);
|
|
74
|
+
const current = shownRef.current;
|
|
75
|
+
if (next?.from !== current?.from || next?.label !== current?.label) {
|
|
76
|
+
shownRef.current = next;
|
|
77
|
+
setShownBand(next);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, []);
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
const node = figure.current;
|
|
83
|
+
if (!node || prefersReducedMotion() || typeof IntersectionObserver === "undefined") {
|
|
84
|
+
setSeen(true);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
88
|
+
if (!entry?.isIntersecting) return;
|
|
89
|
+
observer.disconnect();
|
|
90
|
+
setSeen(true);
|
|
91
|
+
}, { threshold: .5 });
|
|
92
|
+
observer.observe(node);
|
|
93
|
+
return () => observer.disconnect();
|
|
94
|
+
}, []);
|
|
95
|
+
const bandRef = useRef(band);
|
|
96
|
+
useIsomorphicLayoutEffect(() => {
|
|
97
|
+
bandRef.current = band;
|
|
98
|
+
});
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (!seen) return;
|
|
101
|
+
const first = !latest.current.filled;
|
|
102
|
+
retarget(sweep.current, percentage, first ? REVEAL : MORPH, paint);
|
|
103
|
+
retarget(count.current, percentage * 100, first ? REVEAL : SMOOTH, paint, 0, first ? () => {
|
|
104
|
+
latest.current.filled = true;
|
|
105
|
+
shownRef.current = bandRef.current;
|
|
106
|
+
setShownBand(bandRef.current);
|
|
107
|
+
setFilled(true);
|
|
108
|
+
} : void 0);
|
|
109
|
+
}, [
|
|
110
|
+
percentage,
|
|
111
|
+
seen,
|
|
112
|
+
paint
|
|
113
|
+
]);
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
const sweeping = sweep.current;
|
|
116
|
+
const number = count.current;
|
|
117
|
+
return () => {
|
|
118
|
+
sweeping.stop();
|
|
119
|
+
number.stop();
|
|
120
|
+
};
|
|
121
|
+
}, []);
|
|
122
|
+
useIsomorphicLayoutEffect(paint, [paint]);
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
const node = sizer.current;
|
|
125
|
+
const box = digits.current;
|
|
126
|
+
if (!node || !box || typeof ResizeObserver === "undefined") return;
|
|
127
|
+
const observer = new ResizeObserver(([entry]) => {
|
|
128
|
+
if (!entry) return;
|
|
129
|
+
box.style.width = `${entry.borderBoxSize?.[0]?.inlineSize ?? node.offsetWidth}px`;
|
|
130
|
+
});
|
|
131
|
+
observer.observe(node);
|
|
132
|
+
return () => observer.disconnect();
|
|
133
|
+
}, []);
|
|
134
|
+
const shown = filled ? shownBand : band;
|
|
135
|
+
const activeTone = (filled ? shownBand : band)?.tone ?? tone;
|
|
136
|
+
const clampedValue = clamp(value, min, safeMax);
|
|
137
|
+
return /* @__PURE__ */ jsxs("figure", {
|
|
138
|
+
ref: refs,
|
|
139
|
+
...props,
|
|
140
|
+
"data-slot": "gauge",
|
|
141
|
+
"data-tone": activeTone,
|
|
142
|
+
className: cn("gauge", className),
|
|
143
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
144
|
+
"data-slot": "gauge-visual",
|
|
145
|
+
role: "meter",
|
|
146
|
+
"aria-label": label,
|
|
147
|
+
"aria-valuemin": min,
|
|
148
|
+
"aria-valuemax": safeMax,
|
|
149
|
+
"aria-valuenow": clampedValue,
|
|
150
|
+
"aria-valuetext": `${displayValue}%${band ? `, ${band.label}` : ""}`,
|
|
151
|
+
className: "gauge-visual",
|
|
152
|
+
children: [/* @__PURE__ */ jsxs("svg", {
|
|
153
|
+
viewBox: "0 0 100 90",
|
|
154
|
+
"aria-hidden": "true",
|
|
155
|
+
focusable: "false",
|
|
156
|
+
className: "block size-full overflow-visible",
|
|
157
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
158
|
+
d: TRACK,
|
|
159
|
+
className: "gauge-track"
|
|
160
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
161
|
+
ref: ring,
|
|
162
|
+
className: "gauge-fill",
|
|
163
|
+
style: { opacity: 0 }
|
|
164
|
+
})]
|
|
165
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
166
|
+
"aria-hidden": "true",
|
|
167
|
+
className: "gauge-readout",
|
|
168
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
169
|
+
className: "gauge-number",
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ jsx("span", {
|
|
172
|
+
ref: digits,
|
|
173
|
+
className: "gauge-digits"
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ jsx("span", {
|
|
176
|
+
className: "gauge-unit",
|
|
177
|
+
children: "%"
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ jsx("span", {
|
|
180
|
+
ref: sizer,
|
|
181
|
+
className: "gauge-sizer",
|
|
182
|
+
children: displayValue
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
}), thresholds ? /* @__PURE__ */ jsx("span", {
|
|
186
|
+
className: "gauge-status",
|
|
187
|
+
children: /* @__PURE__ */ jsx(SwapText, {
|
|
188
|
+
swapKey: filled ? shown?.label ?? "" : "",
|
|
189
|
+
dir: moved.direction,
|
|
190
|
+
className: "block",
|
|
191
|
+
children: shown?.label
|
|
192
|
+
})
|
|
193
|
+
}) : null]
|
|
194
|
+
})]
|
|
195
|
+
}), /* @__PURE__ */ jsxs("figcaption", {
|
|
196
|
+
className: "grid min-w-0 gap-0.5",
|
|
197
|
+
children: [/* @__PURE__ */ jsx("strong", {
|
|
198
|
+
className: "text-sm font-medium text-foreground",
|
|
199
|
+
children: /* @__PURE__ */ jsx(SwapText, {
|
|
200
|
+
swapKey: label,
|
|
201
|
+
className: "block",
|
|
202
|
+
children: label
|
|
203
|
+
})
|
|
204
|
+
}), detail ? /* @__PURE__ */ jsx("span", {
|
|
205
|
+
className: "text-xs tabular-nums text-text-secondary",
|
|
206
|
+
children: /* @__PURE__ */ jsx(SwapText, {
|
|
207
|
+
swapKey: detail,
|
|
208
|
+
dir: moved.direction,
|
|
209
|
+
className: "block",
|
|
210
|
+
children: detail
|
|
211
|
+
})
|
|
212
|
+
}) : null]
|
|
213
|
+
})]
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
//#endregion
|
|
217
|
+
export { Gauge };
|
|
218
|
+
|
|
219
|
+
//# sourceMappingURL=gauge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gauge.js","names":[],"sources":["../../src/gauge/gauge.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from \"react\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { mergeRefs } from \"../lib/merge-refs.js\";\nimport { prefersReducedMotion, useIsomorphicLayoutEffect } from \"../lib/motion.js\";\nimport { live, MORPH, retarget, REVEAL, SMOOTH } from \"../lib/spring-tween.js\";\nimport { SwapText } from \"../lib/swap-text.js\";\n\n/**\n * Gauge: one value against a range, as a ring open at the bottom with the\n * number at its centre. Use it for a score or a fill level; use Progress for a\n * task that finishes.\n *\n * The ring fills the first time it is seen, slowly and without overshoot, like\n * a ring closing. After that it springs to each new value with a little life\n * while the count follows without overshooting. A band that starts at\n * `from` sets the colour and names the state (\"Healthy\", \"At risk\"): the\n * highest band the value reaches wins, and it changes exactly as the count\n * crosses the threshold, so state never rests on colour alone. The label,\n * status and detail rise in when they change, from the side the value moved\n * toward.\n *\n * Plain SVG and CSS. One small spring tween writes the ring and the count\n * straight to the DOM. The ring is a `meter` for assistive technology.\n */\nexport type GaugeTone = \"primary\" | \"success\" | \"warning\" | \"danger\";\n\nexport interface GaugeThreshold {\n /** The band starts at this value (in the same unit as `value`). */\n from: number;\n tone: GaugeTone;\n /** Names the state. Shown under the number and announced with the value. */\n label: string;\n}\n\nexport interface GaugeProps extends Omit<ComponentPropsWithoutRef<\"figure\">, \"children\"> {\n value: number;\n /** @default 0 */\n min?: number;\n /** @default 100 */\n max?: number;\n /** What is measured. Names the meter. */\n label: string;\n /** A line under the label, such as \"Up 4 from last week\". */\n detail?: string;\n /** The colour when no band applies. @default \"primary\" */\n tone?: GaugeTone;\n /** Bands that set the tone and name the state. */\n thresholds?: GaugeThreshold[];\n}\n\n/** A 270 degree ring open at the bottom, drawn clockwise from its lower left end. Redrawn from the sweep every frame so the round cap stays exact. */\nconst RADIUS = 42;\nconst START = -135;\nconst SPAN = 270;\nconst clamp = (value: number, low: number, high: number) => Math.min(high, Math.max(low, value));\n\nfunction ringFor(sweep: number) {\n const end = START + SPAN * clamp(sweep, 0, 1);\n const at = (angle: number) =>\n `${(50 + RADIUS * Math.sin((angle * Math.PI) / 180)).toFixed(3)} ${(50 - RADIUS * Math.cos((angle * Math.PI) / 180)).toFixed(3)}`;\n return `M ${at(START)} A ${RADIUS} ${RADIUS} 0 ${end - START > 180 ? 1 : 0} 1 ${at(end)}`;\n}\nconst TRACK = ringFor(1);\n\nexport const Gauge = forwardRef<HTMLElement, GaugeProps>(function Gauge(\n { value, min = 0, max = 100, label, detail, tone = \"primary\", thresholds, className, ...props },\n ref,\n) {\n const safeMax = max > min ? max : min + 1;\n const percentage = clamp((value - min) / (safeMax - min), 0, 1);\n const displayValue = Math.round(percentage * 100);\n const bands = [...(thresholds ?? [])].sort((a, b) => a.from - b.from);\n const bandAt = (at: number) => bands.filter((band) => at >= band.from - 1e-6).pop();\n const band = bandAt(value);\n\n const figure = useRef<HTMLElement | null>(null);\n const refs = useMemo(() => mergeRefs(ref, figure), [ref]);\n const ring = useRef<SVGPathElement>(null);\n const digits = useRef<HTMLSpanElement>(null);\n const sizer = useRef<HTMLSpanElement>(null);\n const sweep = useRef(live(0));\n const count = useRef(live(0));\n\n const [seen, setSeen] = useState(false);\n const [filled, setFilled] = useState(false);\n // The band on screen: after the first fill it follows the number as it counts.\n const [shownBand, setShownBand] = useState(band);\n const [moved, setMoved] = useState({ value: displayValue, direction: 1 });\n if (moved.value !== displayValue) {\n setMoved({ value: displayValue, direction: displayValue < moved.value ? -1 : 1 });\n }\n\n const latest = useRef({ bandAt, min, span: safeMax - min, filled });\n useIsomorphicLayoutEffect(() => {\n latest.current = { bandAt, min, span: safeMax - min, filled };\n });\n const shownRef = useRef(shownBand);\n useIsomorphicLayoutEffect(() => {\n shownRef.current = shownBand;\n });\n\n /** One writer: the ring, its fade-in over the first sliver, and the count. */\n const paint = useCallback(() => {\n const to = clamp(sweep.current.value, 0, 1);\n ring.current?.setAttribute(\"d\", ringFor(to));\n if (ring.current) ring.current.style.opacity = String(clamp(to / 0.02, 0, 1));\n const shown = clamp(count.current.value, 0, 100);\n if (digits.current) digits.current.textContent = String(Math.round(shown));\n // After the first fill the state follows the number on screen, so the colour and label change as the count crosses a threshold.\n const { bandAt: pick, min: lo, span, filled: done } = latest.current;\n if (done) {\n const next = pick(lo + (shown / 100) * span);\n const current = shownRef.current;\n if (next?.from !== current?.from || next?.label !== current?.label) {\n shownRef.current = next;\n setShownBand(next);\n }\n }\n }, []);\n\n // The ring fills once half of it is in view.\n useEffect(() => {\n const node = figure.current;\n if (!node || prefersReducedMotion() || typeof IntersectionObserver === \"undefined\") {\n setSeen(true);\n return;\n }\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (!entry?.isIntersecting) return;\n observer.disconnect();\n setSeen(true);\n },\n { threshold: 0.5 },\n );\n observer.observe(node);\n return () => observer.disconnect();\n }, []);\n\n // The first fill is slower and never overshoots; later values spring to place, the count a beat calmer.\n const bandRef = useRef(band);\n useIsomorphicLayoutEffect(() => {\n bandRef.current = band;\n });\n useEffect(() => {\n if (!seen) return;\n const first = !latest.current.filled;\n retarget(sweep.current, percentage, first ? REVEAL : MORPH, paint);\n retarget(\n count.current,\n percentage * 100,\n first ? REVEAL : SMOOTH,\n paint,\n 0,\n first\n ? () => {\n latest.current.filled = true;\n shownRef.current = bandRef.current;\n setShownBand(bandRef.current);\n setFilled(true);\n }\n : undefined,\n );\n }, [percentage, seen, paint]);\n useEffect(() => {\n const sweeping = sweep.current;\n const number = count.current;\n return () => {\n sweeping.stop();\n number.stop();\n };\n }, []);\n useIsomorphicLayoutEffect(paint, [paint]);\n\n // The digits sit right aligned in a box sized to the target number, so the ones column never jumps while counting and the group recentres when the number gains or loses a digit.\n useEffect(() => {\n const node = sizer.current;\n const box = digits.current;\n if (!node || !box || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(([entry]) => {\n if (!entry) return;\n box.style.width = `${entry.borderBoxSize?.[0]?.inlineSize ?? node.offsetWidth}px`;\n });\n observer.observe(node);\n return () => observer.disconnect();\n }, []);\n\n const shown = filled ? shownBand : band;\n const activeTone = (filled ? shownBand : band)?.tone ?? tone;\n const clampedValue = clamp(value, min, safeMax);\n\n return (\n <figure\n ref={refs}\n {...props}\n data-slot=\"gauge\"\n data-tone={activeTone}\n className={cn(\"gauge\", className)}\n >\n <div\n data-slot=\"gauge-visual\"\n role=\"meter\"\n aria-label={label}\n aria-valuemin={min}\n aria-valuemax={safeMax}\n aria-valuenow={clampedValue}\n aria-valuetext={`${displayValue}%${band ? `, ${band.label}` : \"\"}`}\n className=\"gauge-visual\"\n >\n <svg\n viewBox=\"0 0 100 90\"\n aria-hidden=\"true\"\n focusable=\"false\"\n className=\"block size-full overflow-visible\"\n >\n <path d={TRACK} className=\"gauge-track\" />\n <path ref={ring} className=\"gauge-fill\" style={{ opacity: 0 }} />\n </svg>\n <div aria-hidden=\"true\" className=\"gauge-readout\">\n <span className=\"gauge-number\">\n <span ref={digits} className=\"gauge-digits\" />\n <span className=\"gauge-unit\">%</span>\n <span ref={sizer} className=\"gauge-sizer\">\n {displayValue}\n </span>\n </span>\n {thresholds ? (\n <span className=\"gauge-status\">\n <SwapText\n swapKey={filled ? (shown?.label ?? \"\") : \"\"}\n dir={moved.direction}\n className=\"block\"\n >\n {shown?.label}\n </SwapText>\n </span>\n ) : null}\n </div>\n </div>\n <figcaption className=\"grid min-w-0 gap-0.5\">\n <strong className=\"text-sm font-medium text-foreground\">\n <SwapText swapKey={label} className=\"block\">\n {label}\n </SwapText>\n </strong>\n {detail ? (\n <span className=\"text-xs tabular-nums text-text-secondary\">\n <SwapText swapKey={detail} dir={moved.direction} className=\"block\">\n {detail}\n </SwapText>\n </span>\n ) : null}\n </figcaption>\n </figure>\n );\n});\n"],"mappings":";;;;;;;;;;AA8DA,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,OAAO;AACb,MAAM,SAAS,OAAe,KAAa,SAAiB,KAAK,IAAI,MAAM,KAAK,IAAI,KAAK,KAAK,C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,UAAA,oBAAC,UAAD;KAAU,SAAS;KAAO,WAAU;KACjC,UAAA;IACO,CAAA;GACJ,CAAA,GACP,SACC,oBAAC,QAAD;IAAM,WAAU;IACd,UAAA,oBAAC,UAAD;KAAU,SAAS;KAAQ,KAAK,MAAM;KAAW,WAAU;KACxD,UAAA;IACO,CAAA;GACN,CAAA,IACJ,IACM;EACN,CAAA,CAAA;;AAEZ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/in-view-title/in-view-title.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* How the title reveals. `blur` sharpens word by word and suits most headings.
|
|
4
|
+
* `word` and `line` rise out of a clip, for editorial pages. `tracking` opens
|
|
5
|
+
* tight letter spacing. `wipe` uncovers the title from left to right through a
|
|
6
|
+
* soft edge.
|
|
7
|
+
*/
|
|
8
|
+
export type InViewTitleVariant = "word" | "line" | "blur" | "tracking" | "wipe";
|
|
9
|
+
/**
|
|
10
|
+
* InViewTitle: a section title that reveals itself when it scrolls into view,
|
|
11
|
+
* once. A title already above the viewport shows at once, and a title rendered
|
|
12
|
+
* on a server appears on its own if scripts are slow, so text is never left
|
|
13
|
+
* hidden. The title is spoken as one heading (the pieces are a picture); reduced
|
|
14
|
+
* motion shows it at once.
|
|
15
|
+
*/
|
|
16
|
+
export interface InViewTitleProps {
|
|
17
|
+
/** The title. */
|
|
18
|
+
text: string;
|
|
19
|
+
/** How it reveals. @default "blur" */
|
|
20
|
+
variant?: InViewTitleVariant;
|
|
21
|
+
/** The element to render. @default "h2" */
|
|
22
|
+
as?: "h1" | "h2" | "h3";
|
|
23
|
+
/** The breaks for the `line` variant. Without them the whole title is one line. */
|
|
24
|
+
lines?: string[];
|
|
25
|
+
/** Reveal only the first time it enters. With false it hides again when it leaves below and replays. @default true */
|
|
26
|
+
once?: boolean;
|
|
27
|
+
id?: string;
|
|
28
|
+
/** Extra classes for the wrapper. Merged last. */
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const InViewTitle: import("react").ForwardRefExoticComponent<InViewTitleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//# sourceMappingURL=in-view-title.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { mergeRefs } from "../lib/merge-refs.js";
|
|
4
|
+
import { Fragment, forwardRef, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/in-view-title/in-view-title.tsx
|
|
7
|
+
const TYPE = {
|
|
8
|
+
h1: "font-display text-h1 leading-(--leading-snug) m-0 font-semibold",
|
|
9
|
+
h2: "font-display text-h2 leading-(--leading-snug) m-0 font-semibold",
|
|
10
|
+
h3: "font-display text-h3 leading-(--leading-snug) m-0 font-semibold"
|
|
11
|
+
};
|
|
12
|
+
/** A title is revealed when this much of it is on screen. */
|
|
13
|
+
const THRESHOLD = .45;
|
|
14
|
+
const lateBoot = typeof window !== "undefined" && performance.now() > 2400;
|
|
15
|
+
/** Stagger between words (ms): 60 at most, and 400 in all. Lines stagger 80. Letters of the tracking variant move with their word. */
|
|
16
|
+
const WORD_STEP_MS = 60;
|
|
17
|
+
const WORD_MAX_MS = 400;
|
|
18
|
+
const LINE_STEP_MS = 80;
|
|
19
|
+
const TRACKING_STEP_MS = 32;
|
|
20
|
+
/** How far each letter travels per step from its word's centre in the tracking variant. */
|
|
21
|
+
const TRACK_EM = .06;
|
|
22
|
+
const subscribeNothing = () => () => {};
|
|
23
|
+
const delayOf = (ms) => ({ "--part-delay": `${ms}ms` });
|
|
24
|
+
const InViewTitle = forwardRef(function InViewTitle({ text, variant = "blur", as = "h2", lines, once = true, id, className }, ref) {
|
|
25
|
+
const root = useRef(null);
|
|
26
|
+
const refs = useMemo(() => mergeRefs(ref, root), [ref]);
|
|
27
|
+
const hydrated = useSyncExternalStore(subscribeNothing, () => true, () => false);
|
|
28
|
+
const [serverRendered] = useState(!hydrated);
|
|
29
|
+
const late = serverRendered && lateBoot;
|
|
30
|
+
const [seen, setSeen] = useState(false);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
const node = root.current;
|
|
33
|
+
if (!node) return;
|
|
34
|
+
if (typeof IntersectionObserver === "undefined") {
|
|
35
|
+
setSeen(true);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
39
|
+
if (!entry) return;
|
|
40
|
+
const passed = !entry.isIntersecting && entry.boundingClientRect.top < 0;
|
|
41
|
+
if (entry.isIntersecting || passed) {
|
|
42
|
+
setSeen(true);
|
|
43
|
+
if (once) observer.disconnect();
|
|
44
|
+
} else if (!once) setSeen(false);
|
|
45
|
+
}, { threshold: THRESHOLD });
|
|
46
|
+
observer.observe(node);
|
|
47
|
+
return () => observer.disconnect();
|
|
48
|
+
}, [once]);
|
|
49
|
+
const Tag = as;
|
|
50
|
+
const words = text.split(" ").filter(Boolean);
|
|
51
|
+
const step = Math.min(WORD_STEP_MS, WORD_MAX_MS / Math.max(words.length, 1));
|
|
52
|
+
const space = (index, total) => index < total - 1 ? " " : null;
|
|
53
|
+
let body = null;
|
|
54
|
+
if (variant === "word") body = words.map((word, index) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
55
|
+
className: "in-view-title-clip",
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
58
|
+
"data-part": "",
|
|
59
|
+
style: delayOf(index * step),
|
|
60
|
+
children: word
|
|
61
|
+
})
|
|
62
|
+
}), space(index, words.length)] }, `${word}-${index}`));
|
|
63
|
+
else if (variant === "line") body = (lines?.length ? lines : [text]).map((line, index) => /* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: "in-view-title-line-clip",
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
67
|
+
"data-part": "",
|
|
68
|
+
style: delayOf(index * LINE_STEP_MS),
|
|
69
|
+
children: line
|
|
70
|
+
})
|
|
71
|
+
}, `${line}-${index}`));
|
|
72
|
+
else if (variant === "blur") body = words.map((word, index) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
73
|
+
"data-part": "",
|
|
74
|
+
"aria-hidden": "true",
|
|
75
|
+
style: delayOf(index * step),
|
|
76
|
+
children: word
|
|
77
|
+
}), space(index, words.length)] }, `${word}-${index}`));
|
|
78
|
+
else if (variant === "tracking") body = words.map((word, index) => {
|
|
79
|
+
const letters = Array.from(word);
|
|
80
|
+
const centre = (letters.length - 1) / 2;
|
|
81
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
82
|
+
className: "whitespace-nowrap",
|
|
83
|
+
"data-part": "",
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
style: delayOf(index * TRACKING_STEP_MS),
|
|
86
|
+
children: letters.map((letter, letterIndex) => /* @__PURE__ */ jsx("span", {
|
|
87
|
+
"data-letter": "",
|
|
88
|
+
style: { "--track-x": `${(centre - letterIndex) * TRACK_EM}em` },
|
|
89
|
+
children: letter
|
|
90
|
+
}, letterIndex))
|
|
91
|
+
}), space(index, words.length)] }, `${word}-${index}`);
|
|
92
|
+
});
|
|
93
|
+
return /* @__PURE__ */ jsx("div", {
|
|
94
|
+
ref: refs,
|
|
95
|
+
"data-slot": "in-view-title",
|
|
96
|
+
"data-variant": variant,
|
|
97
|
+
"data-visible": seen || late ? "" : void 0,
|
|
98
|
+
"data-instant": late ? "" : void 0,
|
|
99
|
+
"data-pending": hydrated ? void 0 : "",
|
|
100
|
+
className: cn("in-view-title", className),
|
|
101
|
+
children: variant === "wipe" ? /* @__PURE__ */ jsx("div", {
|
|
102
|
+
"data-part": "",
|
|
103
|
+
children: /* @__PURE__ */ jsx(Tag, {
|
|
104
|
+
id,
|
|
105
|
+
className: TYPE[as],
|
|
106
|
+
children: text
|
|
107
|
+
})
|
|
108
|
+
}) : /* @__PURE__ */ jsx(Tag, {
|
|
109
|
+
id,
|
|
110
|
+
"aria-label": text,
|
|
111
|
+
className: TYPE[as],
|
|
112
|
+
children: body
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
//#endregion
|
|
117
|
+
export { InViewTitle };
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=in-view-title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-view-title.js","names":[],"sources":["../../src/in-view-title/in-view-title.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Fragment,\n forwardRef,\n useEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { mergeRefs } from \"../lib/merge-refs.js\";\n\n/**\n * How the title reveals. `blur` sharpens word by word and suits most headings.\n * `word` and `line` rise out of a clip, for editorial pages. `tracking` opens\n * tight letter spacing. `wipe` uncovers the title from left to right through a\n * soft edge.\n */\nexport type InViewTitleVariant = \"word\" | \"line\" | \"blur\" | \"tracking\" | \"wipe\";\n\n/**\n * InViewTitle: a section title that reveals itself when it scrolls into view,\n * once. A title already above the viewport shows at once, and a title rendered\n * on a server appears on its own if scripts are slow, so text is never left\n * hidden. The title is spoken as one heading (the pieces are a picture); reduced\n * motion shows it at once.\n */\nexport interface InViewTitleProps {\n /** The title. */\n text: string;\n /** How it reveals. @default \"blur\" */\n variant?: InViewTitleVariant;\n /** The element to render. @default \"h2\" */\n as?: \"h1\" | \"h2\" | \"h3\";\n /** The breaks for the `line` variant. Without them the whole title is one line. */\n lines?: string[];\n /** Reveal only the first time it enters. With false it hides again when it leaves below and replays. @default true */\n once?: boolean;\n id?: string;\n /** Extra classes for the wrapper. Merged last. */\n className?: string;\n}\n\n// Static strings: Tailwind scans source text, so a class built at runtime would never be emitted.\nconst TYPE = {\n h1: \"font-display text-h1 leading-(--leading-snug) m-0 font-semibold\",\n h2: \"font-display text-h2 leading-(--leading-snug) m-0 font-semibold\",\n h3: \"font-display text-h3 leading-(--leading-snug) m-0 font-semibold\",\n} as const;\n\n/** A title is revealed when this much of it is on screen. */\nconst THRESHOLD = 0.45;\n/** Matches the stylesheet fallback: a server-rendered title that scripts reach later than this is already showing, so it stays put. */\nconst FALLBACK_MS = 2400;\nconst lateBoot = typeof window !== \"undefined\" && performance.now() > FALLBACK_MS;\n/** Stagger between words (ms): 60 at most, and 400 in all. Lines stagger 80. Letters of the tracking variant move with their word. */\nconst WORD_STEP_MS = 60;\nconst WORD_MAX_MS = 400;\nconst LINE_STEP_MS = 80;\nconst TRACKING_STEP_MS = 32;\n/** How far each letter travels per step from its word's centre in the tracking variant. */\nconst TRACK_EM = 0.06;\n\nconst subscribeNothing = () => () => {};\nconst delayOf = (ms: number) => ({ \"--part-delay\": `${ms}ms` }) as CSSProperties;\n\nexport const InViewTitle = forwardRef<HTMLDivElement, InViewTitleProps>(function InViewTitle(\n { text, variant = \"blur\", as = \"h2\", lines, once = true, id, className },\n ref,\n) {\n const root = useRef<HTMLDivElement | null>(null);\n const refs = useMemo(() => mergeRefs(ref, root), [ref]);\n const hydrated = useSyncExternalStore(\n subscribeNothing,\n () => true,\n () => false,\n );\n // Rendered on a server, and scripts arrived after the stylesheet fallback had already shown it: nothing to reveal.\n const [serverRendered] = useState(!hydrated);\n const late = serverRendered && lateBoot;\n const [seen, setSeen] = useState(false);\n\n useEffect(() => {\n const node = root.current;\n if (!node) return;\n if (typeof IntersectionObserver === \"undefined\") {\n setSeen(true);\n return;\n }\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (!entry) return;\n // Above the viewport (scrolled past, or restored mid-page) counts as seen: there is nothing to scroll to.\n const passed = !entry.isIntersecting && entry.boundingClientRect.top < 0;\n if (entry.isIntersecting || passed) {\n setSeen(true);\n if (once) observer.disconnect();\n } else if (!once) setSeen(false);\n },\n { threshold: THRESHOLD },\n );\n observer.observe(node);\n return () => observer.disconnect();\n }, [once]);\n\n const Tag = as;\n const words = text.split(\" \").filter(Boolean);\n const step = Math.min(WORD_STEP_MS, WORD_MAX_MS / Math.max(words.length, 1));\n const space = (index: number, total: number) => (index < total - 1 ? \" \" : null);\n\n let body: ReactNode = null;\n if (variant === \"word\") {\n body = words.map((word, index) => (\n <Fragment key={`${word}-${index}`}>\n <span className=\"in-view-title-clip\" aria-hidden=\"true\">\n <span data-part=\"\" style={delayOf(index * step)}>\n {word}\n </span>\n </span>\n {space(index, words.length)}\n </Fragment>\n ));\n } else if (variant === \"line\") {\n body = (lines?.length ? lines : [text]).map((line, index) => (\n <span className=\"in-view-title-line-clip\" aria-hidden=\"true\" key={`${line}-${index}`}>\n <span data-part=\"\" style={delayOf(index * LINE_STEP_MS)}>\n {line}\n </span>\n </span>\n ));\n } else if (variant === \"blur\") {\n body = words.map((word, index) => (\n <Fragment key={`${word}-${index}`}>\n <span data-part=\"\" aria-hidden=\"true\" style={delayOf(index * step)}>\n {word}\n </span>\n {space(index, words.length)}\n </Fragment>\n ));\n } else if (variant === \"tracking\") {\n body = words.map((word, index) => {\n const letters = Array.from(word);\n const centre = (letters.length - 1) / 2;\n return (\n <Fragment key={`${word}-${index}`}>\n <span\n className=\"whitespace-nowrap\"\n data-part=\"\"\n aria-hidden=\"true\"\n style={delayOf(index * TRACKING_STEP_MS)}\n >\n {letters.map((letter, letterIndex) => (\n <span\n key={letterIndex}\n data-letter=\"\"\n style={{ \"--track-x\": `${(centre - letterIndex) * TRACK_EM}em` } as CSSProperties}\n >\n {letter}\n </span>\n ))}\n </span>\n {space(index, words.length)}\n </Fragment>\n );\n });\n }\n\n return (\n <div\n ref={refs}\n data-slot=\"in-view-title\"\n data-variant={variant}\n data-visible={seen || late ? \"\" : undefined}\n data-instant={late ? \"\" : undefined}\n data-pending={hydrated ? undefined : \"\"}\n className={cn(\"in-view-title\", className)}\n >\n {variant === \"wipe\" ? (\n <div data-part=\"\">\n <Tag id={id} className={TYPE[as]}>\n {text}\n </Tag>\n </div>\n ) : (\n <Tag id={id} aria-label={text} className={TYPE[as]}>\n {body}\n </Tag>\n )}\n </div>\n );\n});\n"],"mappings":";;;;;;AAiDA,MAAM,OAAO;CACX,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;;AAGA,MAAM,YAAY;AAGlB,MAAM,WAAW,OAAO,WAAW,eAAe,YAAY,IAAI,IAAI;;AAEtE,MAAM,eAAe;AACrB,MAAM,cAAc;AACpB,MAAM,eAAe;AACrB,MAAM,mBAAmB;;AAEzB,MAAM,WAAW;AAEjB,MAAM,+BAA+B,CAAC;AACtC,MAAM,WAAW,QAAgB,EAAE,gBAAgB,GAAG,GAAG,IAAI;AAE7D,MAAa,cAAc,WAA6C,SAAS,YAC/E,EAAE,MAAM,UAAU,QAAQ,KAAK,MAAM,OAAO,OAAO,MAAM,IAAI,aAC7D,KACA;CACA,MAAM,OAAO,OAA8B,IAAI;CAC/C,MAAM,OAAO,cAAc,UAAU,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC;CACtD,MAAM,WAAW,qBACf,wBACM,YACA,KACR;CAEA,MAAM,CAAC,kBAAkB,SAAS,CAAC,QAAQ;CAC3C,MAAM,OAAO,kBAAkB;CAC/B,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CAEtC,gBAAgB;EACd,MAAM,OAAO,KAAK;EAClB,IAAI,CAAC,MAAM;EACX,IAAI,OAAO,yBAAyB,aAAa;GAC/C,QAAQ,IAAI;GACZ;EACF;EACA,MAAM,WAAW,IAAI,sBAClB,CAAC,WAAW;GACX,IAAI,CAAC,OAAO;GAEZ,MAAM,SAAS,CAAC,MAAM,kBAAkB,MAAM,mBAAmB,MAAM;GACvE,IAAI,MAAM,kBAAkB,QAAQ;IAClC,QAAQ,IAAI;IACZ,IAAI,MAAM,SAAS,WAAW;GAChC,OAAO,IAAI,CAAC,MAAM,QAAQ,KA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AChC,MAAM,UAAU,MAAM,KAAK,IAAI;EAC/B,MAAM,UAAU,QAAQ,SAAS,KAAK;EACtC,OACE,qBAAC,UAAD,EAAA,UAAA,CACE,oBAAC,QAAD;GACE,WAAU;GACV,aAAU;GACV,eAAY;GACZ,OAAO,QAAQ,QAAQ,gBAAgB;GAEtC,UAAA,QAAQ,KAAK,QAAQ,gBACpB,oBAAC,QAAD;IAEE,eAAY;IACZ,OAAO,EAAE,aAAa,IAAI,SAAS,eAAe,SAAS,IAAI;IAE9D,UAAA;GACG,GALC,WAKD,CACP;EACG,CAAA,GACL,MAAM,OAAO,MAAM,MAAM,CAClB,EAAA,GAlBK,GAAG,KAAK,GAAG,OAkBhB;CAEd,CAAC;CAGH,OACE,oBAAC,OAAD;EACE,KAAK;EACL,aAAU;EACV,gBAAc;EACd,gBAAc,QAAQ,OAAO,KAAK,KAAA;EAClC,gBAAc,OAAO,KAAK,KAAA;EAC1B,gBAAc,WAAW,KAAA,IAAY;EACrC,WAAW,GAAG,iBAAiB,SAAS;EAEvC,UAAA,YAAY,SACX,oBAAC,OAAD;GAAK,aAAU;GACb,UAAA,oBAAC,KAAD;IAAS;IAAI,WAAW,KAAK;IAC1B,UAAA;GACE,CAAA;EACF,CAAA,IAEL,oBAAC,KAAD;GAAS;GAAI,cAAY;GAAM,WAAW,KAAK;GAC5C,UAAA;EACE,CAAA;CAEJ,CAAA;AAET,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,54 +1,97 @@
|
|
|
1
1
|
import { Accordion, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, AccordionProps, AccordionTrigger, AccordionTriggerProps } from "./accordion/accordion.js";
|
|
2
2
|
import { Button, ButtonProps, buttonVariants } from "./button/button.js";
|
|
3
3
|
import { ActionButton, ActionButtonProps } from "./action-button/action-button.js";
|
|
4
|
+
import { ActivityDay, ActivityDayDetail, ActivityHeatmap, ActivityHeatmapProps } from "./activity-heatmap/activity-heatmap.js";
|
|
4
5
|
import { Dialog, DialogFooter, DialogFooterProps, DialogProps, DialogTrigger, dialogDescriptionVariants, dialogFooterVariants, dialogOverlayVariants, dialogPanelVariants, dialogTitleVariants } from "./dialog/dialog.js";
|
|
5
|
-
import { AlertDialog, AlertDialogProps } from "./alert-dialog/alert-dialog.js";
|
|
6
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogProps } from "./alert-dialog/alert-dialog.js";
|
|
6
7
|
import { Alert, AlertProps, alertVariants } from "./alert/alert.js";
|
|
8
|
+
import { AnimatedCounter, AnimatedCounterProps } from "./animated-counter/animated-counter.js";
|
|
9
|
+
import { Announcement, AnnouncementAction, AnnouncementBar, AnnouncementBarProps, clearAnnouncementDismissal } from "./announcement-bar/announcement-bar.js";
|
|
7
10
|
import { Avatar, AvatarProps, avatarVariants } from "./avatar/avatar.js";
|
|
8
11
|
import { Badge, BadgeProps, badgeVariants } from "./badge/badge.js";
|
|
12
|
+
import { BarChart, BarChartDatum, BarChartProps } from "./bar-chart/bar-chart.js";
|
|
9
13
|
import { BreadcrumbItem, BreadcrumbItemProps, Breadcrumbs, BreadcrumbsProps, breadcrumbItemVariants, breadcrumbLinkVariants, breadcrumbsVariants } from "./breadcrumb/breadcrumb.js";
|
|
14
|
+
import { BrushChart, BrushChartAnnotation, BrushChartDatum, BrushChartProps } from "./brush-chart/brush-chart.js";
|
|
10
15
|
import { ButtonGroup, ButtonGroupItem, ButtonGroupMenu, ButtonGroupMenuItem, ButtonGroupOrientation, ButtonGroupProps, ButtonGroupSize, ButtonGroupVariant } from "./button-group/button-group.js";
|
|
11
16
|
import { Calendar, CalendarProps, CalendarRange, CalendarRangeProps, calendarCellVariants, calendarClearVariants, calendarGridVariants, calendarHeaderCellVariants, calendarHeaderVariants, calendarHeadingVariants, calendarLabelVariants, calendarMonthsVariants, calendarNavVariants, calendarVariants } from "./calendar/calendar.js";
|
|
17
|
+
import { CardDecision, CardStack, CardStackProps } from "./card-stack/card-stack.js";
|
|
12
18
|
import { Card, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardVariants } from "./card/card.js";
|
|
19
|
+
import { Carousel, CarouselProps } from "./carousel/carousel.js";
|
|
13
20
|
import { Checkbox, CheckboxProps, checkboxBoxVariants, checkboxVariants } from "./checkbox/checkbox.js";
|
|
21
|
+
import { ChipGroup, ChipGroupProps, ChipOption } from "./chip-group/chip-group.js";
|
|
14
22
|
import { ConfirmMorph, ConfirmMorphMode, ConfirmMorphProps, ConfirmMorphState } from "./confirm-morph/confirm-morph.js";
|
|
15
23
|
import { CopyButton, CopyButtonProps } from "./copy-button/copy-button.js";
|
|
24
|
+
import { Countdown, CountdownProps, CountdownUnit } from "./countdown/countdown.js";
|
|
16
25
|
import { datePickerInputVariants, datePickerLabelVariants, datePickerSegmentVariants, datePickerTriggerVariants, datePickerVariants } from "./date-picker/picker-parts.js";
|
|
17
26
|
import { DateRangePicker, DateRangePickerMessages, DateRangePickerProps, DateRangePickerValue, DateRangePreset, defaultDateRangePresets } from "./date-picker/date-range-picker.js";
|
|
18
27
|
import { DatePicker, DatePickerProps } from "./date-picker/date-picker.js";
|
|
28
|
+
import { DonutChart, DonutChartDatum, DonutChartProps } from "./donut-chart/donut-chart.js";
|
|
19
29
|
import { EmptyState, EmptyStateProps, emptyStateActionVariants, emptyStateTextVariants, emptyStateVariants } from "./empty-state/empty-state.js";
|
|
20
30
|
import { ExpandingButtonGroup, ExpandingButtonGroupItem, ExpandingButtonGroupProps, ExpandingButtonGroupSize, ExpandingButtonGroupTone } from "./expanding-button-group/expanding-button-group.js";
|
|
21
31
|
import { FileDropZone, FileDropZoneProps, fileDropZoneHintVariants, fileDropZonePromptVariants, fileDropZoneVariants } from "./file-drop-zone/file-drop-zone.js";
|
|
22
32
|
import { FilterBar, FilterBarCustomField, FilterBarField, FilterBarOption, FilterBarProps, FilterBarSelectField, filterBarChipVariants, filterBarRowVariants, filterBarVariants } from "./filter-bar/filter-bar.js";
|
|
23
33
|
import { FloatingButtonGroup, FloatingButtonGroupAction, FloatingButtonGroupItem, FloatingButtonGroupOrientation, FloatingButtonGroupProps, FloatingButtonGroupSeparator, FloatingButtonGroupSize, FloatingButtonGroupVariant } from "./floating-button-group/floating-button-group.js";
|
|
34
|
+
import { Gauge, GaugeProps, GaugeThreshold, GaugeTone } from "./gauge/gauge.js";
|
|
24
35
|
import { BellIcon, ChevronIcon, ChevronIconProps, CopyCheckIcon, HeartIcon, IconMorph, IconMorphIconProps, IconMorphName, IconMorphProps, MenuIcon, PlayPauseIcon, PlusCheckIcon, SunMoonIcon } from "./icon-morph/icon-morph.js";
|
|
36
|
+
import { InViewTitle, InViewTitleProps, InViewTitleVariant } from "./in-view-title/in-view-title.js";
|
|
25
37
|
import { Input, InputProps, inputVariants } from "./input/input.js";
|
|
26
38
|
import { Label, LabelProps, labelVariants } from "./label/label.js";
|
|
27
39
|
import { cn, cnAll } from "./lib/cn.js";
|
|
40
|
+
import { LINE_CHART_DRAW_MS, LineChart, LineChartDatum, LineChartProps, LineChartSeries } from "./line-chart/line-chart.js";
|
|
41
|
+
import { Mention, MentionChannel, MentionInput, MentionInputHandle, MentionInputProps, MentionKind, MentionPerson, MentionValue, mentionText, serializeMentions } from "./mention-input/mention-input.js";
|
|
28
42
|
import { Menu, MenuItem, MenuItemProps, MenuProps, MenuSeparator, MenuTrigger, menuItemVariants, menuPopoverVariants, menuSeparatorVariants, menuVariants } from "./menu/menu.js";
|
|
43
|
+
import { MoneyInput, MoneyInputDetails, MoneyInputProps } from "./money-input/money-input.js";
|
|
44
|
+
import { MorphSelect, MorphSelectGroup, MorphSelectItem, MorphSelectOption, MorphSelectProps } from "./morph-select/morph-select.js";
|
|
45
|
+
import { MultiSelect, MultiSelectProps } from "./multi-select/multi-select.js";
|
|
46
|
+
import { NumberField, NumberFieldProps } from "./number-field/number-field.js";
|
|
47
|
+
import { OnboardingChecklist, OnboardingChecklistProps, OnboardingStep } from "./onboarding-checklist/onboarding-checklist.js";
|
|
29
48
|
import { PageHeader, PageHeaderProps, pageHeaderActionsVariants, pageHeaderBackVariants, pageHeaderDescriptionVariants, pageHeaderMetaVariants, pageHeaderRowVariants, pageHeaderTitleVariants, pageHeaderVariants } from "./page-header/page-header.js";
|
|
30
49
|
import { PasswordField, PasswordFieldMessages, PasswordFieldProps, defaultPasswordFieldMessages } from "./password-field/password-field.js";
|
|
31
50
|
import { EstimateStrengthOptions, PasswordRule, PasswordRuleLabels, PasswordRuleOptions, PasswordStrength, PasswordStrengthLevels, PasswordStrengthMessages, PasswordStrengthMessagesInput, PasswordStrengthProps, PasswordStrengthResult, countCodePoints, createPasswordRules, defaultPasswordRules, defaultPasswordStrengthMessages, estimateStrength } from "./password-strength/password-strength.js";
|
|
51
|
+
import { PHONE_COUNTRIES, PhoneCountry, PhoneStatus, formatNational, formatPhoneNumber, parsePhoneNumber } from "./phone-input/phone-countries.js";
|
|
52
|
+
import { PhoneInput, PhoneInputDetails, PhoneInputProps } from "./phone-input/phone-input.js";
|
|
32
53
|
import { Popover, PopoverProps, PopoverTrigger, popoverVariants } from "./popover/popover.js";
|
|
33
54
|
import { Progress, ProgressProps, progressFillVariants, progressTrackVariants, progressVariants } from "./progress/progress.js";
|
|
34
55
|
import { Radio, RadioGroup, RadioGroupProps, RadioProps, radioGroupVariants, radioVariants } from "./radio-group/radio-group.js";
|
|
35
|
-
import {
|
|
56
|
+
import { Reaction, ReactionOption, Reactions, ReactionsProps } from "./reactions/reactions.js";
|
|
57
|
+
import { Ridgeline, RidgelineProps, RidgelineSeries } from "./ridgeline/ridgeline.js";
|
|
58
|
+
import { ScrollArea, ScrollAreaProps, scrollAreaRootVariants, scrollAreaVariants } from "./scroll-area/scroll-area.js";
|
|
59
|
+
import { ScrubInput, ScrubInputChangeDetails, ScrubInputProps, ScrubInputSource } from "./scrub-input/scrub-input.js";
|
|
60
|
+
import { evaluateScrubExpression } from "./scrub-input/evaluate.js";
|
|
61
|
+
import "./scrub-input/index.js";
|
|
36
62
|
import { SearchField, SearchFieldProps } from "./search-field/search-field.js";
|
|
37
63
|
import { Select, SelectItem, SelectItemProps, SelectProps, selectItemVariants, selectPopoverVariants, selectTriggerVariants, selectVariants } from "./select/select.js";
|
|
38
64
|
import { Separator, SeparatorProps, separatorVariants } from "./separator/separator.js";
|
|
39
65
|
import { Sheet, SheetProps, sheetOverlayVariants, sheetPanelVariants } from "./sheet/sheet.js";
|
|
66
|
+
import { Platform, ShortcutToken, formatShortcut, matchesShortcut, normalizeShortcut, shortcutFromEvent, shortcutTokens } from "./shortcut-recorder/shortcut-model.js";
|
|
67
|
+
import { ShortcutBinding, ShortcutKbd, ShortcutKbdProps, ShortcutKeys, ShortcutKeysProps, ShortcutRecorder, ShortcutRecorderProps, usePlatform, usePressedKeys } from "./shortcut-recorder/shortcut-recorder.js";
|
|
68
|
+
import "./shortcut-recorder/index.js";
|
|
40
69
|
import { SideNav, SideNavGroup, SideNavProps, SideNavSection, sideNavHeaderVariants, sideNavItemVariants, sideNavMenuVariants, sideNavVariants } from "./side-nav/side-nav.js";
|
|
41
70
|
import { Skeleton, SkeletonProps, skeletonVariants } from "./skeleton/skeleton.js";
|
|
42
|
-
import { Slider, SliderProps, sliderBarVariants, sliderFillVariants, sliderThumbVariants, sliderTrackVariants, sliderVariants } from "./slider/slider.js";
|
|
71
|
+
import { Slider, SliderMark, SliderProps, SliderValue, sliderBarVariants, sliderFillVariants, sliderThumbVariants, sliderTrackVariants, sliderVariants } from "./slider/slider.js";
|
|
72
|
+
import { SlopeChart, SlopeChartProps, SlopeItem } from "./slope-chart/slope-chart.js";
|
|
43
73
|
import { Spinner, SpinnerProps, spinnerVariants } from "./spinner/spinner.js";
|
|
74
|
+
import { SplitBar, SplitBarProps, SplitSegment } from "./split-bar/split-bar.js";
|
|
44
75
|
import { SplitButton, SplitButtonAction, SplitButtonProps } from "./split-button/split-button.js";
|
|
45
|
-
import {
|
|
76
|
+
import { SPARKLINE_DRAW_MS, Sparkline, SparklineProps, SparklineTone, sparklineVariants } from "./sparkline/sparkline.js";
|
|
77
|
+
import { StatCard, StatCardProps, StatCardTone, statCardHeaderVariants, statCardLabelVariants, statCardSubVariants, statCardValueVariants, statCardVariants } from "./stat-card/stat-card.js";
|
|
78
|
+
import { Stepper, StepperOrientation, StepperProps, StepperStatus, StepperStep } from "./stepper/stepper.js";
|
|
79
|
+
import { Streamgraph, StreamgraphDatum, StreamgraphProps, StreamgraphSeries } from "./streamgraph/streamgraph.js";
|
|
80
|
+
import { SwipeAction, SwipeActions, SwipeActionsProps, SwipeActionsRow, SwipeActionsRowProps } from "./swipe-actions/swipe-actions.js";
|
|
81
|
+
import "./swipe-actions/index.js";
|
|
46
82
|
import { Switch, SwitchProps, switchThumbVariants, switchTrackVariants } from "./switch/switch.js";
|
|
47
|
-
import { Column, RowKey, Table, TableProps, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableVariants } from "./table/table.js";
|
|
83
|
+
import { Column, RowKey, Table, TableProps, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableEmptyVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableSelectionBarVariants, tableVariants } from "./table/table.js";
|
|
48
84
|
import { Tab, TabList, TabListProps, TabPanel, TabPanelProps, TabProps, Tabs, TabsProps, tabListVariants, tabPanelVariants, tabVariants, tabsVariants } from "./tabs/tabs.js";
|
|
85
|
+
import { TextShimmer, TextShimmerProps } from "./text-shimmer/text-shimmer.js";
|
|
86
|
+
import { TagInput, TagInputProps } from "./tag-input/tag-input.js";
|
|
87
|
+
import { TextMorph, TextMorphProps } from "./text-morph/text-morph.js";
|
|
88
|
+
import { TextReveal, TextRevealProps } from "./text-reveal/text-reveal.js";
|
|
49
89
|
import { Textarea, TextareaProps, textareaVariants } from "./textarea/textarea.js";
|
|
50
90
|
import { Theme, ThemeSwitch, ThemeSwitchProps, ThemeSwitchVariant } from "./theme-switch/theme-switch.js";
|
|
51
91
|
import { TimePicker, TimePickerProps, timePickerItemVariants, timePickerListVariants } from "./time-picker/time-picker.js";
|
|
52
92
|
import { ToastContent, ToastRegion, ToastRegionProps, toast, toastCloseVariants, toastQueue, toastRegionVariants, toastVariants } from "./toast/toast.js";
|
|
53
93
|
import { Tooltip, TooltipProps, TooltipTrigger, TooltipTriggerProps, tooltipVariants } from "./tooltip/tooltip.js";
|
|
54
|
-
|
|
94
|
+
import { Treemap, TreemapNode, TreemapProps } from "./treemap/treemap.js";
|
|
95
|
+
import { UsageMeter, UsageMeterProps, UsageMeterSegment } from "./usage-meter/usage-meter.js";
|
|
96
|
+
import { WaffleCategory, WaffleChart, WaffleChartProps } from "./waffle-chart/waffle-chart.js";
|
|
97
|
+
export { Accordion, AccordionItem, type AccordionItemProps, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, ActionButton, type ActionButtonProps, type ActivityDay, type ActivityDayDetail, ActivityHeatmap, type ActivityHeatmapProps, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, type AlertDialogProps, type AlertProps, AnimatedCounter, type AnimatedCounterProps, type Announcement, type AnnouncementAction, AnnouncementBar, type AnnouncementBarProps, Avatar, type AvatarProps, Badge, type BadgeProps, BarChart, type BarChartDatum, type BarChartProps, BellIcon, BreadcrumbItem, type BreadcrumbItemProps, Breadcrumbs, type BreadcrumbsProps, BrushChart, type BrushChartAnnotation, type BrushChartDatum, type BrushChartProps, Button, ButtonGroup, type ButtonGroupItem, type ButtonGroupMenu, type ButtonGroupMenuItem, type ButtonGroupOrientation, type ButtonGroupProps, type ButtonGroupSize, type ButtonGroupVariant, type ButtonProps, Calendar, type CalendarProps, CalendarRange, type CalendarRangeProps, Card, CardContent, type CardContentProps, type CardDecision, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardStack, type CardStackProps, CardTitle, type CardTitleProps, Carousel, type CarouselProps, Checkbox, type CheckboxProps, ChevronIcon, type ChevronIconProps, ChipGroup, type ChipGroupProps, type ChipOption, type Column, ConfirmMorph, type ConfirmMorphMode, type ConfirmMorphProps, type ConfirmMorphState, CopyButton, type CopyButtonProps, CopyCheckIcon, Countdown, type CountdownProps, type CountdownUnit, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerMessages, type DateRangePickerProps, type DateRangePickerValue, type DateRangePreset, Dialog, DialogFooter, type DialogFooterProps, type DialogProps, DialogTrigger, DonutChart, type DonutChartDatum, type DonutChartProps, EmptyState, type EmptyStateProps, type EstimateStrengthOptions, ExpandingButtonGroup, type ExpandingButtonGroupItem, type ExpandingButtonGroupProps, type ExpandingButtonGroupSize, type ExpandingButtonGroupTone, FileDropZone, type FileDropZoneProps, FilterBar, type FilterBarCustomField, type FilterBarField, type FilterBarOption, type FilterBarProps, type FilterBarSelectField, FloatingButtonGroup, type FloatingButtonGroupAction, type FloatingButtonGroupItem, type FloatingButtonGroupOrientation, type FloatingButtonGroupProps, type FloatingButtonGroupSeparator, type FloatingButtonGroupSize, type FloatingButtonGroupVariant, Gauge, type GaugeProps, type GaugeThreshold, type GaugeTone, HeartIcon, IconMorph, type IconMorphIconProps, type IconMorphName, type IconMorphProps, InViewTitle, type InViewTitleProps, type InViewTitleVariant, Input, type InputProps, LINE_CHART_DRAW_MS, Label, type LabelProps, LineChart, type LineChartDatum, type LineChartProps, type LineChartSeries, type Mention, type MentionChannel, MentionInput, type MentionInputHandle, type MentionInputProps, type MentionKind, type MentionPerson, type MentionValue, Menu, MenuIcon, MenuItem, type MenuItemProps, type MenuProps, MenuSeparator, MenuTrigger, MoneyInput, type MoneyInputDetails, type MoneyInputProps, MorphSelect, type MorphSelectGroup, type MorphSelectItem, type MorphSelectOption, type MorphSelectProps, MultiSelect, type MultiSelectProps, NumberField, type NumberFieldProps, OnboardingChecklist, type OnboardingChecklistProps, type OnboardingStep, PHONE_COUNTRIES, PageHeader, type PageHeaderProps, PasswordField, type PasswordFieldMessages, type PasswordFieldProps, type PasswordRule, type PasswordRuleLabels, type PasswordRuleOptions, PasswordStrength, type PasswordStrengthLevels, type PasswordStrengthMessages, type PasswordStrengthMessagesInput, type PasswordStrengthProps, type PasswordStrengthResult, type PhoneCountry, PhoneInput, type PhoneInputDetails, type PhoneInputProps, type PhoneStatus, type Platform, PlayPauseIcon, PlusCheckIcon, Popover, type PopoverProps, PopoverTrigger, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type Reaction, type ReactionOption, Reactions, type ReactionsProps, Ridgeline, type RidgelineProps, type RidgelineSeries, type RowKey, SPARKLINE_DRAW_MS, ScrollArea, type ScrollAreaProps, ScrubInput, type ScrubInputChangeDetails, type ScrubInputProps, type ScrubInputSource, SearchField, type SearchFieldProps, Select, SelectItem, type SelectItemProps, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, type ShortcutBinding, ShortcutKbd, type ShortcutKbdProps, ShortcutKeys, type ShortcutKeysProps, ShortcutRecorder, type ShortcutRecorderProps, type ShortcutToken, SideNav, type SideNavGroup, type SideNavProps, type SideNavSection, Skeleton, type SkeletonProps, Slider, type SliderMark, type SliderProps, type SliderValue, SlopeChart, type SlopeChartProps, type SlopeItem, Sparkline, type SparklineProps, type SparklineTone, Spinner, type SpinnerProps, SplitBar, type SplitBarProps, SplitButton, type SplitButtonAction, type SplitButtonProps, type SplitSegment, StatCard, type StatCardProps, type StatCardTone, Stepper, type StepperOrientation, type StepperProps, type StepperStatus, type StepperStep, Streamgraph, type StreamgraphDatum, type StreamgraphProps, type StreamgraphSeries, SunMoonIcon, type SwipeAction, SwipeActions, type SwipeActionsProps, SwipeActionsRow, type SwipeActionsRowProps, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, type TableProps, Tabs, type TabsProps, TagInput, type TagInputProps, TextMorph, type TextMorphProps, TextReveal, type TextRevealProps, TextShimmer, type TextShimmerProps, Textarea, type TextareaProps, type Theme, ThemeSwitch, type ThemeSwitchProps, type ThemeSwitchVariant, TimePicker, type TimePickerProps, type ToastContent, ToastRegion, type ToastRegionProps, Tooltip, type TooltipProps, TooltipTrigger, type TooltipTriggerProps, Treemap, type TreemapNode, type TreemapProps, UsageMeter, type UsageMeterProps, type UsageMeterSegment, type WaffleCategory, WaffleChart, type WaffleChartProps, alertVariants, avatarVariants, badgeVariants, breadcrumbItemVariants, breadcrumbLinkVariants, breadcrumbsVariants, buttonVariants, calendarCellVariants, calendarClearVariants, calendarGridVariants, calendarHeaderCellVariants, calendarHeaderVariants, calendarHeadingVariants, calendarLabelVariants, calendarMonthsVariants, calendarNavVariants, calendarVariants, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardVariants, checkboxBoxVariants, checkboxVariants, clearAnnouncementDismissal, cn, cnAll, countCodePoints, createColumns, createPasswordRules, datePickerInputVariants, datePickerLabelVariants, datePickerSegmentVariants, datePickerTriggerVariants, datePickerVariants, defaultDateRangePresets, defaultPasswordFieldMessages, defaultPasswordRules, defaultPasswordStrengthMessages, dialogDescriptionVariants, dialogFooterVariants, dialogOverlayVariants, dialogPanelVariants, dialogTitleVariants, emptyStateActionVariants, emptyStateTextVariants, emptyStateVariants, estimateStrength, evaluateScrubExpression, fileDropZoneHintVariants, fileDropZonePromptVariants, fileDropZoneVariants, filterBarChipVariants, filterBarRowVariants, filterBarVariants, formatNational, formatPhoneNumber, formatShortcut, inputVariants, labelVariants, matchesShortcut, mentionText, menuItemVariants, menuPopoverVariants, menuSeparatorVariants, menuVariants, normalizeShortcut, pageHeaderActionsVariants, pageHeaderBackVariants, pageHeaderDescriptionVariants, pageHeaderMetaVariants, pageHeaderRowVariants, pageHeaderTitleVariants, pageHeaderVariants, parsePhoneNumber, popoverVariants, progressFillVariants, progressTrackVariants, progressVariants, radioGroupVariants, radioVariants, scrollAreaRootVariants, scrollAreaVariants, selectItemVariants, selectPopoverVariants, selectTriggerVariants, selectVariants, separatorVariants, serializeMentions, sheetOverlayVariants, sheetPanelVariants, shortcutFromEvent, shortcutTokens, sideNavHeaderVariants, sideNavItemVariants, sideNavMenuVariants, sideNavVariants, skeletonVariants, sliderBarVariants, sliderFillVariants, sliderThumbVariants, sliderTrackVariants, sliderVariants, sparklineVariants, spinnerVariants, statCardHeaderVariants, statCardLabelVariants, statCardSubVariants, statCardValueVariants, statCardVariants, switchThumbVariants, switchTrackVariants, tabListVariants, tabPanelVariants, tabVariants, tableCardVariants, tableCellVariants, tableColumnVariants, tableEmptyVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableSelectionBarVariants, tableVariants, tabsVariants, textareaVariants, timePickerItemVariants, timePickerListVariants, toast, toastCloseVariants, toastQueue, toastRegionVariants, toastVariants, tooltipVariants, usePlatform, usePressedKeys };
|