@stll/ui 0.65.0 → 0.66.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/dist/calendar/day-calendar.d.ts +8 -3
- package/dist/calendar/day-calendar.js +7 -10
- package/dist/calendar/day-calendar.logic.d.ts +0 -2
- package/dist/calendar/day-calendar.logic.js +1 -2
- package/dist/calendar/primitives.d.ts +1 -3
- package/dist/calendar/primitives.js +1 -2
- package/dist/calendar/resource-calendar.d.ts +0 -2
- package/dist/calendar/resource-calendar.js +1 -2
- package/dist/calendar/resource-calendar.logic.d.ts +1 -3
- package/dist/calendar/resource-calendar.logic.js +1 -2
- package/dist/components/accordion.d.ts +18 -4
- package/dist/components/accordion.js +25 -9
- package/dist/components/ai-label.d.ts +0 -2
- package/dist/components/ai-label.js +1 -2
- package/dist/components/alert-dialog.d.ts +0 -2
- package/dist/components/alert-dialog.js +1 -2
- package/dist/components/animated-count.d.ts +0 -2
- package/dist/components/animated-count.js +1 -2
- package/dist/components/animated-preview.css +152 -0
- package/dist/components/animated-preview.d.ts +75 -0
- package/dist/components/animated-preview.js +105 -0
- package/dist/components/application-rail.d.ts +1 -3
- package/dist/components/application-rail.js +1 -2
- package/dist/components/avatar.d.ts +0 -2
- package/dist/components/avatar.js +1 -2
- package/dist/components/badge.d.ts +0 -2
- package/dist/components/badge.js +1 -2
- package/dist/components/bidi-text.d.ts +0 -2
- package/dist/components/bidi-text.js +1 -2
- package/dist/components/brand-icons.d.ts +0 -2
- package/dist/components/brand-icons.js +1 -2
- package/dist/components/breadcrumb.d.ts +0 -2
- package/dist/components/breadcrumb.js +1 -2
- package/dist/components/button.d.ts +0 -2
- package/dist/components/button.js +35 -13
- package/dist/components/button.native-classes.d.ts +0 -2
- package/dist/components/button.native-classes.js +1 -2
- package/dist/components/button.native.d.ts +0 -2
- package/dist/components/button.native.js +1 -2
- package/dist/components/button.shared.d.ts +1 -3
- package/dist/components/button.shared.js +1 -2
- package/dist/components/checkbox.d.ts +0 -2
- package/dist/components/checkbox.js +1 -2
- package/dist/components/collapsible.d.ts +10 -6
- package/dist/components/collapsible.js +12 -6
- package/dist/components/color-picker.d.ts +12 -5
- package/dist/components/color-picker.js +4 -6
- package/dist/components/combobox.d.ts +0 -2
- package/dist/components/combobox.js +1 -2
- package/dist/components/command.d.ts +0 -2
- package/dist/components/command.js +1 -2
- package/dist/components/composer-tokens.d.ts +1 -3
- package/dist/components/composer-tokens.js +1 -2
- package/dist/components/composer.d.ts +0 -2
- package/dist/components/composer.js +1 -2
- package/dist/components/context-menu.d.ts +1 -3
- package/dist/components/context-menu.js +1 -2
- package/dist/components/copy-button.d.ts +0 -2
- package/dist/components/copy-button.js +1 -2
- package/dist/components/court-badge.d.ts +0 -2
- package/dist/components/court-badge.js +1 -2
- package/dist/components/court-filter.d.ts +0 -2
- package/dist/components/court-filter.js +1 -2
- package/dist/components/date-picker-popover.d.ts +0 -2
- package/dist/components/date-picker-popover.js +4 -68
- package/dist/components/date-picker-popover.logic.d.ts +1 -3
- package/dist/components/date-picker-popover.logic.js +1 -2
- package/dist/components/date-range-filter.d.ts +0 -2
- package/dist/components/date-range-filter.js +1 -2
- package/dist/components/destructive-action-confirmation.d.ts +0 -2
- package/dist/components/destructive-action-confirmation.js +1 -2
- package/dist/components/destructive-confirm-dialog.d.ts +0 -2
- package/dist/components/destructive-confirm-dialog.js +1 -2
- package/dist/components/details-grid.d.ts +13 -5
- package/dist/components/details-grid.js +69 -14
- package/dist/components/dialog-form-state.d.ts +1 -3
- package/dist/components/dialog-form-state.js +1 -2
- package/dist/components/dialog.d.ts +0 -2
- package/dist/components/dialog.js +1 -2
- package/dist/components/directional-icon.d.ts +0 -2
- package/dist/components/directional-icon.js +1 -2
- package/dist/components/document-identity-badge.d.ts +0 -2
- package/dist/components/document-identity-badge.js +1 -2
- package/dist/components/document-identity-badge.logic.d.ts +1 -3
- package/dist/components/document-identity-badge.logic.js +1 -2
- package/dist/components/document-mark.d.ts +9 -0
- package/dist/components/document-mark.js +29 -0
- package/dist/components/document-mark.native.d.ts +11 -0
- package/dist/components/document-mark.native.js +36 -0
- package/dist/components/document-mark.shared.d.ts +378 -0
- package/dist/components/document-mark.shared.js +756 -0
- package/dist/components/field.d.ts +0 -2
- package/dist/components/field.js +1 -2
- package/dist/components/file-input.d.ts +0 -2
- package/dist/components/file-input.js +1 -2
- package/dist/components/form.d.ts +0 -2
- package/dist/components/form.js +1 -2
- package/dist/components/frame.d.ts +0 -2
- package/dist/components/frame.js +1 -2
- package/dist/components/hex-color-picker.d.ts +0 -2
- package/dist/components/hex-color-picker.js +1 -2
- package/dist/components/horizontal-scroller.d.ts +0 -2
- package/dist/components/horizontal-scroller.js +1 -2
- package/dist/components/identity-text.d.ts +0 -2
- package/dist/components/identity-text.js +1 -2
- package/dist/components/inline-drop-indicator.d.ts +1 -3
- package/dist/components/inline-drop-indicator.js +1 -2
- package/dist/components/inline-rename.d.ts +0 -2
- package/dist/components/inline-rename.js +1 -2
- package/dist/components/input-control.d.ts +1 -3
- package/dist/components/input-control.js +1 -2
- package/dist/components/input-group.d.ts +0 -2
- package/dist/components/input-group.js +1 -2
- package/dist/components/input-otp.d.ts +0 -2
- package/dist/components/input-otp.js +1 -2
- package/dist/components/input.d.ts +0 -2
- package/dist/components/input.js +1 -2
- package/dist/components/input.native.d.ts +0 -2
- package/dist/components/input.native.js +1 -2
- package/dist/components/input.shared.d.ts +1 -3
- package/dist/components/kbd.d.ts +58 -0
- package/dist/components/kbd.js +90 -0
- package/dist/components/label.d.ts +0 -2
- package/dist/components/label.js +1 -2
- package/dist/components/landing.d.ts +0 -2
- package/dist/components/landing.js +1 -2
- package/dist/components/list.d.ts +0 -2
- package/dist/components/list.js +1 -2
- package/dist/components/loader.d.ts +0 -2
- package/dist/components/loader.js +1 -2
- package/dist/components/loader.native.d.ts +0 -2
- package/dist/components/loader.native.js +1 -2
- package/dist/components/loader.shared.d.ts +1 -3
- package/dist/components/loader.shared.js +1 -2
- package/dist/components/matter-icon.d.ts +0 -2
- package/dist/components/matter-icon.js +1 -2
- package/dist/components/matter-icon.native.d.ts +0 -2
- package/dist/components/matter-icon.native.js +2 -3
- package/dist/components/matter-icon.shared.d.ts +1 -3
- package/dist/components/matter-icon.shared.js +1 -2
- package/dist/components/menu-section.d.ts +0 -2
- package/dist/components/menu-section.js +1 -2
- package/dist/components/menu.d.ts +18 -4
- package/dist/components/menu.js +27 -7
- package/dist/components/middle-truncate.d.ts +0 -2
- package/dist/components/middle-truncate.js +1 -2
- package/dist/components/middle-truncate.logic.d.ts +0 -2
- package/dist/components/middle-truncate.logic.js +1 -2
- package/dist/components/number-input.d.ts +0 -2
- package/dist/components/number-input.js +1 -2
- package/dist/components/outline-rail.d.ts +12 -3
- package/dist/components/outline-rail.js +61 -9
- package/dist/components/outline-rail.logic.d.ts +0 -2
- package/dist/components/outline-rail.logic.js +7 -3
- package/dist/components/pagination.d.ts +0 -2
- package/dist/components/pagination.js +1 -2
- package/dist/components/popover.d.ts +0 -2
- package/dist/components/popover.js +1 -2
- package/dist/components/preview-card.d.ts +0 -2
- package/dist/components/preview-card.js +1 -2
- package/dist/components/preview-pane.d.ts +0 -2
- package/dist/components/preview-pane.js +1 -2
- package/dist/components/prose.d.ts +0 -2
- package/dist/components/prose.js +1 -2
- package/dist/components/scroll-area.d.ts +0 -2
- package/dist/components/scroll-area.js +1 -2
- package/dist/components/scroll-to-top.d.ts +1 -3
- package/dist/components/scroll-to-top.js +1 -2
- package/dist/components/search-field.d.ts +0 -2
- package/dist/components/search-field.js +1 -2
- package/dist/components/secret-input.d.ts +0 -2
- package/dist/components/secret-input.js +1 -2
- package/dist/components/segmented-icon-toggle.d.ts +0 -2
- package/dist/components/segmented-icon-toggle.js +1 -2
- package/dist/components/select.d.ts +0 -2
- package/dist/components/select.js +1 -2
- package/dist/components/separator.d.ts +0 -2
- package/dist/components/separator.js +1 -2
- package/dist/components/separator.native.d.ts +1 -3
- package/dist/components/separator.native.js +1 -2
- package/dist/components/separator.shared.d.ts +1 -3
- package/dist/components/sheet.d.ts +0 -2
- package/dist/components/sheet.js +1 -2
- package/dist/components/sheet.native.d.ts +1 -3
- package/dist/components/sheet.native.js +1 -2
- package/dist/components/sheet.shared.d.ts +1 -3
- package/dist/components/sidebar.d.ts +0 -2
- package/dist/components/sidebar.js +1 -2
- package/dist/components/sidebar.logic.d.ts +1 -3
- package/dist/components/sidebar.logic.js +1 -2
- package/dist/components/skeleton.d.ts +0 -2
- package/dist/components/skeleton.js +1 -2
- package/dist/components/split-button.d.ts +0 -2
- package/dist/components/split-button.js +1 -2
- package/dist/components/status-mark.d.ts +0 -2
- package/dist/components/status-mark.js +1 -2
- package/dist/components/stella-mark.d.ts +1 -3
- package/dist/components/stella-mark.js +1 -2
- package/dist/components/stella-mark.native.d.ts +1 -3
- package/dist/components/stella-mark.native.js +1 -2
- package/dist/components/stella-mark.shared.d.ts +1 -3
- package/dist/components/stella-mark.shared.js +1 -2
- package/dist/components/stella-wordmark.d.ts +1 -3
- package/dist/components/stella-wordmark.js +1 -2
- package/dist/components/stella-wordmark.native.d.ts +1 -3
- package/dist/components/stella-wordmark.native.js +1 -2
- package/dist/components/stella-wordmark.shared.d.ts +1 -3
- package/dist/components/stella-wordmark.shared.js +1 -2
- package/dist/components/steps.d.ts +0 -2
- package/dist/components/steps.js +1 -2
- package/dist/components/swap-text.d.ts +0 -2
- package/dist/components/swap-text.js +1 -2
- package/dist/components/switch.d.ts +0 -2
- package/dist/components/switch.js +1 -2
- package/dist/components/switch.native.d.ts +0 -2
- package/dist/components/switch.native.js +1 -2
- package/dist/components/switch.shared.d.ts +1 -3
- package/dist/components/table-chart.d.ts +1 -3
- package/dist/components/table-chart.js +1 -2
- package/dist/components/table.d.ts +0 -2
- package/dist/components/table.js +1 -2
- package/dist/components/tabs.d.ts +0 -2
- package/dist/components/tabs.js +1 -2
- package/dist/components/text.d.ts +0 -2
- package/dist/components/text.js +1 -2
- package/dist/components/text.native.d.ts +0 -2
- package/dist/components/text.native.js +1 -2
- package/dist/components/text.shared.d.ts +1 -3
- package/dist/components/text.shared.js +1 -2
- package/dist/components/textarea.d.ts +11 -3
- package/dist/components/textarea.js +51 -13
- package/dist/components/textarea.native.d.ts +1 -3
- package/dist/components/textarea.native.js +1 -2
- package/dist/components/textarea.shared.d.ts +1 -3
- package/dist/components/time-field.d.ts +25 -0
- package/dist/components/time-field.js +108 -0
- package/dist/components/toast.d.ts +0 -2
- package/dist/components/toast.js +1 -2
- package/dist/components/toggle-group.d.ts +0 -2
- package/dist/components/toggle-group.js +1 -2
- package/dist/components/toggle.d.ts +0 -2
- package/dist/components/toggle.js +1 -2
- package/dist/components/toolbar-icon-action.d.ts +0 -2
- package/dist/components/toolbar-icon-action.js +1 -2
- package/dist/components/tooltip-trigger-helper.d.ts +0 -2
- package/dist/components/tooltip-trigger-helper.js +1 -2
- package/dist/components/tooltip.d.ts +7 -3
- package/dist/components/tooltip.js +9 -5
- package/dist/components/truncated-text.d.ts +0 -2
- package/dist/components/truncated-text.js +1 -2
- package/dist/components/view-toolbar.d.ts +0 -2
- package/dist/components/view-toolbar.js +1 -2
- package/dist/components/workspace-shell.d.ts +0 -2
- package/dist/components/workspace-shell.js +1 -2
- package/dist/css.d.ts +0 -1
- package/dist/data-table/schema.d.ts +1 -3
- package/dist/data-table/schema.js +1 -2
- package/dist/data-table/table.d.ts +0 -2
- package/dist/data-table/table.js +1 -2
- package/dist/hooks/use-contained-handler.d.ts +0 -2
- package/dist/hooks/use-contained-handler.js +1 -2
- package/dist/hooks/use-content-dir.d.ts +0 -2
- package/dist/hooks/use-content-dir.js +1 -2
- package/dist/hooks/use-latest.d.ts +1 -3
- package/dist/hooks/use-latest.js +1 -2
- package/dist/hooks/use-mobile.d.ts +1 -3
- package/dist/hooks/use-mobile.js +1 -2
- package/dist/hooks/use-prefers-reduced-motion.d.ts +6 -0
- package/dist/hooks/use-prefers-reduced-motion.js +17 -0
- package/dist/hooks/use-viewport-width.d.ts +1 -3
- package/dist/hooks/use-viewport-width.js +1 -2
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/inspector/chrome.d.ts +1 -3
- package/dist/inspector/chrome.js +1 -2
- package/dist/inspector/dock.d.ts +0 -2
- package/dist/inspector/dock.js +1 -2
- package/dist/inspector/entity-tab.d.ts +0 -2
- package/dist/inspector/entity-tab.js +1 -2
- package/dist/inspector/entity-tab.logic.d.ts +1 -3
- package/dist/inspector/entity-tab.logic.js +1 -2
- package/dist/inspector/facet-bar.d.ts +1 -3
- package/dist/inspector/facet-bar.js +1 -2
- package/dist/inspector/facet-bar.logic.d.ts +1 -3
- package/dist/inspector/facet-bar.logic.js +1 -2
- package/dist/inspector/layout-tokens.d.ts +1 -3
- package/dist/inspector/layout-tokens.js +1 -2
- package/dist/inspector/pane-width.d.ts +0 -2
- package/dist/inspector/pane-width.js +1 -2
- package/dist/inspector/use-pane-width.d.ts +0 -2
- package/dist/inspector/use-pane-width.js +1 -2
- package/dist/kanban/band-peek.d.ts +1 -3
- package/dist/kanban/band-peek.js +1 -2
- package/dist/kanban/card-properties.d.ts +1 -3
- package/dist/kanban/card-properties.js +1 -2
- package/dist/kanban/card-shell.d.ts +1 -3
- package/dist/kanban/card-shell.js +1 -2
- package/dist/kanban/cell-action.d.ts +1 -3
- package/dist/kanban/cell-action.js +1 -2
- package/dist/kanban/column-band-header.d.ts +1 -3
- package/dist/kanban/column-band-header.js +1 -2
- package/dist/kanban/column-bands.d.ts +1 -3
- package/dist/kanban/column-bands.js +1 -2
- package/dist/kanban/column-header.d.ts +1 -3
- package/dist/kanban/column-header.js +1 -2
- package/dist/kanban/drag-interactions.d.ts +0 -2
- package/dist/kanban/drag-interactions.js +1 -2
- package/dist/kanban/grouping.d.ts +1 -3
- package/dist/kanban/grouping.js +1 -2
- package/dist/kanban/layout-tokens.d.ts +1 -3
- package/dist/kanban/layout-tokens.js +1 -2
- package/dist/kanban/matrix.d.ts +1 -3
- package/dist/kanban/matrix.js +1 -2
- package/dist/kanban/sortable-edge.d.ts +0 -2
- package/dist/kanban/sortable-edge.js +1 -2
- package/dist/kanban/sortable-interactions.d.ts +0 -2
- package/dist/kanban/sortable-interactions.js +1 -2
- package/dist/kanban/sortable-interactions.logic.d.ts +0 -2
- package/dist/kanban/sortable-interactions.logic.js +1 -2
- package/dist/kanban/sticky-lane.d.ts +0 -2
- package/dist/kanban/sticky-lane.js +1 -2
- package/dist/kanban/subgroup-board.d.ts +0 -2
- package/dist/kanban/subgroup-board.js +1 -2
- package/dist/kanban/touch-identity.d.ts +0 -2
- package/dist/kanban/touch-identity.js +1 -2
- package/dist/kanban/virtual-cell.d.ts +1 -3
- package/dist/kanban/virtual-cell.js +1 -2
- package/dist/lib/button-disposition.d.ts +0 -2
- package/dist/lib/button-disposition.js +1 -2
- package/dist/lib/control-size.d.ts +0 -2
- package/dist/lib/control-size.js +1 -2
- package/dist/lib/field-trigger.d.ts +1 -3
- package/dist/lib/field-trigger.js +1 -2
- package/dist/lib/file-picker.d.ts +0 -2
- package/dist/lib/file-picker.js +1 -2
- package/dist/lib/initials.d.ts +1 -3
- package/dist/lib/initials.js +1 -2
- package/dist/lib/inline-reorder.d.ts +0 -2
- package/dist/lib/inline-reorder.js +1 -2
- package/dist/lib/matter-colors.d.ts +0 -2
- package/dist/lib/matter-colors.js +1 -2
- package/dist/lib/menu-row.d.ts +1 -3
- package/dist/lib/menu-row.js +1 -2
- package/dist/lib/option-color.d.ts +1 -3
- package/dist/lib/option-color.js +1 -2
- package/dist/lib/overlay-layer.d.ts +1 -3
- package/dist/lib/overlay-layer.js +1 -2
- package/dist/lib/panel-inset.d.ts +1 -3
- package/dist/lib/panel-inset.js +1 -2
- package/dist/lib/positioner-sizing.d.ts +1 -3
- package/dist/lib/positioner-sizing.js +1 -2
- package/dist/lib/renders-nothing.d.ts +8 -0
- package/dist/lib/renders-nothing.js +14 -0
- package/dist/lib/safe-area.d.ts +1 -3
- package/dist/lib/safe-area.js +1 -2
- package/dist/lib/scroll-edge-fade.d.ts +1 -3
- package/dist/lib/scroll-edge-fade.js +1 -2
- package/dist/lib/slot.d.ts +0 -2
- package/dist/lib/slot.js +1 -2
- package/dist/lib/tab-order.d.ts +0 -2
- package/dist/lib/tab-order.js +1 -2
- package/dist/lib/tooltip-content.d.ts +1 -3
- package/dist/lib/tooltip-content.js +1 -2
- package/dist/lib/typed-character.d.ts +1 -3
- package/dist/lib/typed-character.js +1 -2
- package/dist/lib/utils.d.ts +1 -3
- package/dist/lib/utils.js +1 -2
- package/dist/lib/week.d.ts +1 -3
- package/dist/lib/week.js +1 -2
- package/dist/review/review-author-avatar.d.ts +0 -2
- package/dist/review/review-author-avatar.js +1 -2
- package/dist/review/review-comment-card.d.ts +0 -2
- package/dist/review/review-comment-card.js +1 -2
- package/dist/review/review-decision-actions.d.ts +0 -2
- package/dist/review/review-decision-actions.js +1 -2
- package/dist/review/review-diff-text.d.ts +0 -2
- package/dist/review/review-diff-text.js +1 -2
- package/dist/review/review-out-of-date-notice.d.ts +0 -2
- package/dist/review/review-out-of-date-notice.js +1 -2
- package/dist/review/review-severity-dot.d.ts +0 -2
- package/dist/review/review-severity-dot.js +1 -2
- package/dist/review/review-status-badge.d.ts +0 -2
- package/dist/review/review-status-badge.js +1 -2
- package/dist/review/review-word-diff.d.ts +1 -3
- package/dist/review/review-word-diff.js +1 -2
- package/dist/review/text-mark.d.ts +0 -2
- package/dist/review/text-mark.js +1 -2
- package/dist/styles/theme.css +27 -0
- package/dist/testing/browser-clock.d.ts +1 -3
- package/dist/testing/browser-clock.js +1 -2
- package/package.json +37 -5
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { DayCalendarGranularity, DayCalendarRange } from "./day-calendar.logic.js";
|
|
2
2
|
import { ReactElement, ReactNode } from "react";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* A block paints in its matter's colour; in a topic's colour, a lighter tint
|
|
5
|
+
* from the same palette keyed by a stable topic key and without the matter's
|
|
6
|
+
* edge; or in the neutral surface tone.
|
|
7
|
+
*/
|
|
5
8
|
export type DayCalendarTone = {
|
|
6
9
|
color: string | null;
|
|
7
10
|
matterId: string;
|
|
8
11
|
type: "matter";
|
|
12
|
+
} | {
|
|
13
|
+
key: string;
|
|
14
|
+
type: "topic";
|
|
9
15
|
} | {
|
|
10
16
|
type: "neutral";
|
|
11
17
|
};
|
|
@@ -91,5 +97,4 @@ type DayCalendarProps = {
|
|
|
91
97
|
timeZone: string;
|
|
92
98
|
};
|
|
93
99
|
export declare const DayCalendar: ({ ariaLabel, columns, date, granularity, hours, locale, nowMs, onSelectRange, selection, timeZone }: DayCalendarProps) => ReactElement;
|
|
94
|
-
//#endregion
|
|
95
100
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { Tooltip, TooltipContent as TooltipPopup, TooltipTrigger } from "../components/tooltip.js";
|
|
3
3
|
import { DAY_CALENDAR_SLOT_HEIGHT_PX, boundsHeight, extendRange, getDayBounds, getHourTicks, isRepeatedWallTime, layoutOverlaps, moveRange, offsetToTime, rangeFromDrag, slotAt, timeToOffset } from "./day-calendar.logic.js";
|
|
4
|
-
import { resolveMatterColor } from "../lib/matter-colors.js";
|
|
4
|
+
import { getMatterColor, resolveMatterColor } from "../lib/matter-colors.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { panic } from "better-result";
|
|
8
8
|
import { Temporal } from "temporal-polyfill/full";
|
|
9
|
-
|
|
9
|
+
// src/calendar/day-calendar.tsx
|
|
10
10
|
const isSameDraftView = (left, right) => left.date === right.date && left.endHour === right.endHour && left.granularity === right.granularity && left.startHour === right.startHour && left.timeZone === right.timeZone;
|
|
11
11
|
/**
|
|
12
12
|
* A draft's range belongs to the day and grid it was made on; once they
|
|
@@ -367,27 +367,25 @@ const DayCalendarBlockView = ({ block, grid, lane, range }) => {
|
|
|
367
367
|
})] })
|
|
368
368
|
});
|
|
369
369
|
};
|
|
370
|
-
const MIXED_STRIPES = "repeating-linear-gradient(135deg, var(--muted) 0 6px, transparent 6px 12px)";
|
|
371
370
|
/** A suggestion's tint is half an entry's, so proposed time reads lighter. */
|
|
372
371
|
const TONE_TINT_PERCENT = {
|
|
373
372
|
entry: 16,
|
|
374
373
|
suggestion: 8
|
|
375
374
|
};
|
|
375
|
+
/** A topic is not a matter yet: its tint sits between a suggestion's and an
|
|
376
|
+
* entry's. */
|
|
377
|
+
const TOPIC_TINT_PERCENT = 12;
|
|
376
378
|
function blockSurfaceStyle(block) {
|
|
377
379
|
const tone = block.tone;
|
|
378
|
-
const stripes = block.kind === "mixed" ? MIXED_STRIPES : void 0;
|
|
379
380
|
const suggestion = block.kind === "entry" && block.state === "suggestion";
|
|
380
381
|
switch (tone.type) {
|
|
381
|
-
case "neutral": return {
|
|
382
|
-
|
|
383
|
-
backgroundImage: stripes
|
|
384
|
-
};
|
|
382
|
+
case "neutral": return { backgroundColor: suggestion ? "transparent" : void 0 };
|
|
383
|
+
case "topic": return { backgroundColor: `color-mix(in srgb, ${getMatterColor(tone.key)} ${String(TOPIC_TINT_PERCENT)}%, var(--card))` };
|
|
385
384
|
case "matter": {
|
|
386
385
|
const color = resolveMatterColor(tone.matterId, tone.color);
|
|
387
386
|
const tint = suggestion ? TONE_TINT_PERCENT.suggestion : TONE_TINT_PERCENT.entry;
|
|
388
387
|
return {
|
|
389
388
|
backgroundColor: `color-mix(in srgb, ${color} ${String(tint)}%, var(--card))`,
|
|
390
|
-
backgroundImage: stripes,
|
|
391
389
|
borderColor: suggestion ? color : void 0,
|
|
392
390
|
borderInlineStartColor: color
|
|
393
391
|
};
|
|
@@ -493,5 +491,4 @@ const LockedColumnBody = ({ action }) => /* @__PURE__ */ jsxs("div", {
|
|
|
493
491
|
function assertDayCalendarContract(columns) {
|
|
494
492
|
if (new Set(columns.map(({ id }) => id)).size !== columns.length) panic("Day calendar column ids must be unique");
|
|
495
493
|
}
|
|
496
|
-
//#endregion
|
|
497
494
|
export { DayCalendar };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/calendar/day-calendar.logic.d.ts
|
|
2
1
|
export declare const DAY_CALENDAR_GRANULARITIES: readonly [15, 30, 60];
|
|
3
2
|
export type DayCalendarGranularity = (typeof DAY_CALENDAR_GRANULARITIES)[number];
|
|
4
3
|
/** Below this height a block cannot hold one line of its label, so it draws
|
|
@@ -112,5 +111,4 @@ export declare const mergeShortSegments: <Segment extends DayCalendarRange & {
|
|
|
112
111
|
}>(segments: readonly Segment[], { thresholdMs }: {
|
|
113
112
|
thresholdMs: number;
|
|
114
113
|
}) => MergedSegment<Segment>[];
|
|
115
|
-
//#endregion
|
|
116
114
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Result, panic } from "better-result";
|
|
2
2
|
import { Temporal } from "temporal-polyfill/full";
|
|
3
|
-
|
|
3
|
+
// src/calendar/day-calendar.logic.ts
|
|
4
4
|
const DAY_CALENDAR_GRANULARITIES = [
|
|
5
5
|
15,
|
|
6
6
|
30,
|
|
@@ -234,5 +234,4 @@ function compareIds(left, right) {
|
|
|
234
234
|
if (left < right) return -1;
|
|
235
235
|
return left > right ? 1 : 0;
|
|
236
236
|
}
|
|
237
|
-
//#endregion
|
|
238
237
|
export { DAY_CALENDAR_GRANULARITIES, DAY_CALENDAR_ONE_LINE_BLOCK_MIN_PX, DAY_CALENDAR_SLOT_HEIGHT_PX, boundsHeight, clampToBounds, extendRange, getDayBounds, getHourTicks, granularityMs, isRepeatedWallTime, layoutOverlaps, mergeShortSegments, moveRange, offsetToTime, rangeFromDrag, slotAt, snapToGrid, timeToOffset };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
//#region src/calendar/primitives.d.ts
|
|
3
2
|
export declare const CalendarGrid: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
4
3
|
export declare const CalendarHeaderRow: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
5
4
|
export declare const CalendarHeaderCell: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
6
5
|
export declare const CalendarCell: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
7
6
|
export declare const CalendarEntryButton: ({ className, ...props }: React$1.ComponentProps<"button">) => React$1.JSX.Element;
|
|
8
|
-
export declare const CalendarEntrySurface: ({ className, ...props }: React$1.ComponentProps<"article">) => React$1.JSX.Element;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare const CalendarEntrySurface: ({ className, ...props }: React$1.ComponentProps<"article">) => React$1.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/calendar/primitives.tsx
|
|
4
4
|
const CalendarGrid = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
5
5
|
className: cn("grid", className),
|
|
6
6
|
"data-slot": "calendar-grid",
|
|
@@ -32,5 +32,4 @@ const CalendarEntrySurface = ({ className, ...props }) => /* @__PURE__ */ jsx("a
|
|
|
32
32
|
"data-slot": "calendar-entry",
|
|
33
33
|
...props
|
|
34
34
|
});
|
|
35
|
-
//#endregion
|
|
36
35
|
export { CalendarCell, CalendarEntryButton, CalendarEntrySurface, CalendarGrid, CalendarHeaderCell, CalendarHeaderRow };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from "react";
|
|
2
|
-
//#region src/calendar/resource-calendar.d.ts
|
|
3
2
|
export type ResourceCalendarColumn = {
|
|
4
3
|
date: string;
|
|
5
4
|
label: ReactNode;
|
|
@@ -31,5 +30,4 @@ type ResourceCalendarProps = {
|
|
|
31
30
|
resources: readonly ResourceCalendarResource[];
|
|
32
31
|
};
|
|
33
32
|
export declare const ResourceCalendar: ({ ariaLabel, columns, empty, entries, onSelectEntry, resourceHeader, resources }: ResourceCalendarProps) => ReactElement;
|
|
34
|
-
//#endregion
|
|
35
33
|
export {};
|
|
@@ -4,7 +4,7 @@ import { assertConsecutiveCalendarDates, layoutResourceCalendarEntries, nextCale
|
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useId } from "react";
|
|
6
6
|
import { panic } from "better-result";
|
|
7
|
-
|
|
7
|
+
// src/calendar/resource-calendar.tsx
|
|
8
8
|
const ResourceCalendar = ({ ariaLabel, columns, empty, entries, onSelectEntry, resourceHeader, resources }) => {
|
|
9
9
|
assertResourceCalendarContract({
|
|
10
10
|
columns,
|
|
@@ -181,5 +181,4 @@ const assertResourceCalendarContract = ({ columns, entries, resources }) => {
|
|
|
181
181
|
const orphan = entries.find(({ resourceId }) => !resourceIds.has(resourceId));
|
|
182
182
|
if (orphan !== void 0) panic(`Resource calendar entry ${orphan.id} references an unknown resource`);
|
|
183
183
|
};
|
|
184
|
-
//#endregion
|
|
185
184
|
export { ResourceCalendar };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/calendar/resource-calendar.logic.d.ts
|
|
2
1
|
export type CalendarDateRange = {
|
|
3
2
|
endDateExclusive: string;
|
|
4
3
|
startDate: string;
|
|
@@ -23,5 +22,4 @@ export declare const assertConsecutiveCalendarDates: (dates: readonly string[])
|
|
|
23
22
|
export declare const nextCalendarDate: (value: string) => string;
|
|
24
23
|
export declare const layoutResourceCalendarEntries: (entries: readonly (CalendarDateRange & {
|
|
25
24
|
id: string;
|
|
26
|
-
})[], visibleRange: CalendarDateRange) => ResourceCalendarLaneLayout;
|
|
27
|
-
//#endregion
|
|
25
|
+
})[], visibleRange: CalendarDateRange) => ResourceCalendarLaneLayout;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Result, panic } from "better-result";
|
|
2
2
|
import { Temporal } from "temporal-polyfill/full";
|
|
3
|
-
|
|
3
|
+
// src/calendar/resource-calendar.logic.ts
|
|
4
4
|
const ISO_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/u;
|
|
5
5
|
const toPlainDate = (value) => {
|
|
6
6
|
if (!ISO_DATE_PATTERN.test(value)) return null;
|
|
@@ -83,5 +83,4 @@ const layoutResourceCalendarEntries = (entries, visibleRange) => {
|
|
|
83
83
|
rowCount: Math.max(1, laneEnds.length)
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
-
//#endregion
|
|
87
86
|
export { assertConsecutiveCalendarDates, getResourceCalendarPlacement, layoutResourceCalendarEntries, nextCalendarDate };
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Closed panels stay in the document. Once mounted they are
|
|
4
|
+
* `hidden="until-found"`, so find-in-page reaches their content and opens
|
|
5
|
+
* the section, as it would a native `<details>`; server-rendered markup
|
|
6
|
+
* carries a plain `hidden` until hydration. Pass `hiddenUntilFound={false}` (here, or on one
|
|
7
|
+
* `AccordionPanel`) to unmount closed content instead: a heavy panel that
|
|
8
|
+
* should not render until asked for.
|
|
9
|
+
*/
|
|
10
|
+
declare const Accordion: <Value = unknown>({ hiddenUntilFound, ...props }: Accordion$1.Root.Props<Value>) => import("react").JSX.Element;
|
|
4
11
|
declare const AccordionItem: ({ className, ...props }: Accordion$1.Item.Props) => import("react").JSX.Element;
|
|
5
12
|
/**
|
|
6
13
|
* - `default`: a section heading of a page or panel.
|
|
@@ -15,12 +22,19 @@ type AccordionSize = "default" | "sm" | "compact";
|
|
|
15
22
|
* hover, for a disclosure that is secondary to what is around it.
|
|
16
23
|
*/
|
|
17
24
|
type AccordionTriggerVariant = "default" | "muted";
|
|
18
|
-
declare const AccordionTrigger: ({ className, children, size, variant, ...props }: Accordion$1.Trigger.Props & {
|
|
25
|
+
declare const AccordionTrigger: ({ className, children, size, variant, trailing, ...props }: Accordion$1.Trigger.Props & {
|
|
19
26
|
size?: AccordionSize;
|
|
20
27
|
variant?: AccordionTriggerVariant;
|
|
28
|
+
/**
|
|
29
|
+
* Status at the end of the row, before the chevron: a count, "2 unsaved",
|
|
30
|
+
* a last-updated date. It is part of the trigger, so it is read with the
|
|
31
|
+
* heading. It is typed as text so it can never be a control: a button
|
|
32
|
+
* inside the trigger's button is unreachable and its click would toggle
|
|
33
|
+
* the panel.
|
|
34
|
+
*/
|
|
35
|
+
trailing?: string | number;
|
|
21
36
|
}) => import("react").JSX.Element;
|
|
22
37
|
declare const AccordionPanel: ({ className, children, size, ...props }: Accordion$1.Panel.Props & {
|
|
23
38
|
size?: AccordionSize;
|
|
24
39
|
}) => import("react").JSX.Element;
|
|
25
|
-
//#endregion
|
|
26
40
|
export { Accordion, AccordionPanel as AccordionContent, AccordionPanel, AccordionItem, AccordionTrigger };
|
|
@@ -3,9 +3,18 @@ import { ChevronDownIcon } from "../icons.js";
|
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// src/components/accordion.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Closed panels stay in the document. Once mounted they are
|
|
9
|
+
* `hidden="until-found"`, so find-in-page reaches their content and opens
|
|
10
|
+
* the section, as it would a native `<details>`; server-rendered markup
|
|
11
|
+
* carries a plain `hidden` until hydration. Pass `hiddenUntilFound={false}` (here, or on one
|
|
12
|
+
* `AccordionPanel`) to unmount closed content instead: a heavy panel that
|
|
13
|
+
* should not render until asked for.
|
|
14
|
+
*/
|
|
15
|
+
const Accordion = ({ hiddenUntilFound = true, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Root, {
|
|
8
16
|
"data-slot": "accordion",
|
|
17
|
+
hiddenUntilFound,
|
|
9
18
|
...props
|
|
10
19
|
});
|
|
11
20
|
const AccordionItem = ({ className, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Item, {
|
|
@@ -27,20 +36,28 @@ const TRIGGER_VARIANT_CLASS_NAME = {
|
|
|
27
36
|
default: "font-medium",
|
|
28
37
|
muted: "text-muted-foreground hover:text-foreground font-normal"
|
|
29
38
|
};
|
|
30
|
-
const AccordionTrigger = ({ className, children, size = "default", variant = "default", ...props }) => /* @__PURE__ */ jsx(Accordion$1.Header, {
|
|
39
|
+
const AccordionTrigger = ({ className, children, size = "default", variant = "default", trailing, ...props }) => /* @__PURE__ */ jsx(Accordion$1.Header, {
|
|
31
40
|
className: "flex",
|
|
32
41
|
children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
|
|
33
42
|
className: cn("focus-visible:ring-ring flex flex-1 cursor-pointer items-start justify-between gap-4 rounded-md text-start outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-64 data-panel-open:*:data-[slot=accordion-indicator]:rotate-180", TRIGGER_SIZE_CLASS_NAME[size], TRIGGER_VARIANT_CLASS_NAME[variant], className),
|
|
34
43
|
"data-slot": "accordion-trigger",
|
|
35
44
|
...props,
|
|
36
|
-
children: [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
children: [
|
|
46
|
+
children,
|
|
47
|
+
trailing === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
48
|
+
className: "text-muted-foreground ms-auto min-w-0 text-end text-xs font-normal tabular-nums",
|
|
49
|
+
"data-slot": "accordion-trigger-trailing",
|
|
50
|
+
children: trailing
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
53
|
+
className: "pointer-events-none size-4 shrink-0 translate-y-0.5 opacity-80 transition-transform duration-200 ease-in-out",
|
|
54
|
+
"data-slot": "accordion-indicator"
|
|
55
|
+
})
|
|
56
|
+
]
|
|
40
57
|
})
|
|
41
58
|
});
|
|
42
59
|
const AccordionPanel = ({ className, children, size = "default", ...props }) => /* @__PURE__ */ jsx(Accordion$1.Panel, {
|
|
43
|
-
className: "text-muted-foreground h-(--accordion-panel-height) overflow-hidden text-sm transition-[height] duration-200 ease-in-out data-ending-style:h-0 data-starting-style:h-0",
|
|
60
|
+
className: "text-muted-foreground h-(--accordion-panel-height) overflow-hidden text-sm transition-[height] duration-200 ease-in-out data-ending-style:h-0 data-starting-style:h-0 motion-reduce:transition-none [&[hidden]:not([hidden=until-found])]:hidden",
|
|
44
61
|
"data-slot": "accordion-panel",
|
|
45
62
|
...props,
|
|
46
63
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -48,5 +65,4 @@ const AccordionPanel = ({ className, children, size = "default", ...props }) =>
|
|
|
48
65
|
children
|
|
49
66
|
})
|
|
50
67
|
});
|
|
51
|
-
//#endregion
|
|
52
68
|
export { Accordion, AccordionPanel as AccordionContent, AccordionPanel, AccordionItem, AccordionTrigger };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/ai-label.d.ts
|
|
2
1
|
type AiLabelProps = {
|
|
3
2
|
/**
|
|
4
3
|
* The words the mark shows ("AI", "AI topics"), already translated. They
|
|
@@ -30,5 +29,4 @@ type AiLabelProps = {
|
|
|
30
29
|
* technology.
|
|
31
30
|
*/
|
|
32
31
|
export declare const AiLabel: ({ label, disclosure, className }: AiLabelProps) => import("react").JSX.Element;
|
|
33
|
-
//#endregion
|
|
34
32
|
export {};
|
|
@@ -3,7 +3,7 @@ import { SparklesIcon } from "../icons.js";
|
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
import { Popover, PopoverContent as PopoverPopup, PopoverDescription, PopoverTrigger } from "./popover.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/components/ai-label.tsx
|
|
7
7
|
/**
|
|
8
8
|
* The mark on content a model wrote, and the one place a reader learns what
|
|
9
9
|
* that means.
|
|
@@ -38,5 +38,4 @@ const AiLabel = ({ label, disclosure, className }) => /* @__PURE__ */ jsxs(Popov
|
|
|
38
38
|
children: disclosure
|
|
39
39
|
})
|
|
40
40
|
})] });
|
|
41
|
-
//#endregion
|
|
42
41
|
export { AiLabel };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
3
3
|
import { OverlayLayer } from "../lib/overlay-layer.js";
|
|
4
|
-
//#region src/components/alert-dialog.d.ts
|
|
5
4
|
declare const AlertDialogCreateHandle: typeof AlertDialog$1.createHandle;
|
|
6
5
|
declare const AlertDialog: typeof AlertDialog$1.Root;
|
|
7
6
|
declare const AlertDialogPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
@@ -28,5 +27,4 @@ declare const AlertDialogDescription: ({ className, ...props }: AlertDialog$1.De
|
|
|
28
27
|
declare function AlertDialogClose({ tooltip, ...props }: AlertDialog$1.Close.Props & {
|
|
29
28
|
tooltip?: React$1.ReactNode;
|
|
30
29
|
}): React$1.JSX.Element;
|
|
31
|
-
//#endregion
|
|
32
30
|
export { AlertDialog, AlertDialogBackdrop, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogPopup, AlertDialogCreateHandle, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPanel, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport };
|
|
@@ -5,7 +5,7 @@ import { SAFE_AREA_OVERLAY_GUTTER_CLASS_NAME } from "../lib/safe-area.js";
|
|
|
5
5
|
import { renderTooltipTrigger } from "./tooltip-trigger-helper.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
8
|
-
|
|
8
|
+
// src/components/alert-dialog.tsx
|
|
9
9
|
const AlertDialogCreateHandle = AlertDialog$1.createHandle;
|
|
10
10
|
const AlertDialog = AlertDialog$1.Root;
|
|
11
11
|
const AlertDialogPortal = AlertDialog$1.Portal;
|
|
@@ -72,5 +72,4 @@ function AlertDialogClose({ tooltip, ...props }) {
|
|
|
72
72
|
})
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
//#endregion
|
|
76
75
|
export { AlertDialog, AlertDialogBackdrop, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogPopup, AlertDialogCreateHandle, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPanel, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/animated-count.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* A formatted number whose changed characters fade in. The caller formats
|
|
4
3
|
* (locale digits, units); the glyphs stay plain inline text so bidirectional
|
|
@@ -9,5 +8,4 @@ declare const AnimatedCount: ({ className, value }: {
|
|
|
9
8
|
className?: string;
|
|
10
9
|
value: string;
|
|
11
10
|
}) => import("react").JSX.Element;
|
|
12
|
-
//#endregion
|
|
13
11
|
export { AnimatedCount };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { useState } from "react";
|
|
5
|
-
|
|
5
|
+
// src/components/animated-count.tsx
|
|
6
6
|
/**
|
|
7
7
|
* Aligns characters from the end, where digits keep their place value, so
|
|
8
8
|
* 99 → 100 changes every glyph but 120 → 121 only the last one. An unchanged
|
|
@@ -59,5 +59,4 @@ const AnimatedCount = ({ className, value }) => {
|
|
|
59
59
|
})]
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
|
-
//#endregion
|
|
63
62
|
export { AnimatedCount };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* AnimatedPreview (animated-preview.tsx): the one animation system for
|
|
3
|
+
* previews that explain a feature by playing it.
|
|
4
|
+
*
|
|
5
|
+
* A frame stacks its stages in one grid cell. Stage `i` comes in at
|
|
6
|
+
* `i * hold` after the frame starts and goes out one hold later, cross-fading
|
|
7
|
+
* with its neighbour. A frame starts with the stage that holds it (plus its
|
|
8
|
+
* own stagger), so nested frames play inside their stage. Everything runs on
|
|
9
|
+
* CSS time; only a looping frame restarts itself, from JavaScript, once its
|
|
10
|
+
* last stage has gone out. With reduced motion nothing animates and the
|
|
11
|
+
* component renders only the final stage.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
[data-slot="animated-preview"] {
|
|
15
|
+
--animated-preview-crossfade: 208ms;
|
|
16
|
+
--animated-preview-frame-start: calc(
|
|
17
|
+
var(--animated-preview-stage-start, 0ms) +
|
|
18
|
+
var(--animated-preview-stagger, 0) * 160ms
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
display: grid;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
span[data-slot="animated-preview"] {
|
|
25
|
+
display: inline-grid;
|
|
26
|
+
justify-items: start;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-slot="animated-preview-stage"] {
|
|
30
|
+
--animated-preview-stage-start: calc(
|
|
31
|
+
var(--animated-preview-frame-start) + var(--animated-preview-stage-index) *
|
|
32
|
+
var(--animated-preview-hold)
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
grid-area: 1 / 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-pace="glance"] {
|
|
39
|
+
--animated-preview-hold: 1664ms;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[data-pace="read"] {
|
|
43
|
+
--animated-preview-hold: 2600ms;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[data-pace="beat"] {
|
|
47
|
+
--animated-preview-hold: 640ms;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
51
|
+
[data-slot="animated-preview-stage"][data-incoming] {
|
|
52
|
+
animation: animated-preview-fade-in var(--animated-preview-crossfade) linear
|
|
53
|
+
var(--animated-preview-stage-start) both;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* `forwards` only: a backwards fill would hold the stage visible before
|
|
57
|
+
it has come in. */
|
|
58
|
+
[data-slot="animated-preview-stage"][data-outgoing] {
|
|
59
|
+
animation: animated-preview-fade-out var(--animated-preview-crossfade)
|
|
60
|
+
linear
|
|
61
|
+
calc(var(--animated-preview-stage-start) + var(--animated-preview-hold))
|
|
62
|
+
forwards;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[data-slot="animated-preview-stage"][data-incoming][data-outgoing] {
|
|
66
|
+
animation:
|
|
67
|
+
animated-preview-fade-in var(--animated-preview-crossfade) linear
|
|
68
|
+
var(--animated-preview-stage-start) both,
|
|
69
|
+
animated-preview-fade-out var(--animated-preview-crossfade) linear
|
|
70
|
+
calc(var(--animated-preview-stage-start) + var(--animated-preview-hold))
|
|
71
|
+
forwards;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* The carry lands as the frame inside crosses from its first stage to its
|
|
75
|
+
second: that crossover sits at 64% of the gesture. */
|
|
76
|
+
[data-slot="animated-preview-motion"][data-motion="full"] {
|
|
77
|
+
animation: animated-preview-carry calc(var(--animated-preview-hold) / 0.64)
|
|
78
|
+
ease-in-out var(--animated-preview-stage-start, 0ms) forwards;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[data-slot="animated-preview-motion"][data-motion="reduced"] {
|
|
83
|
+
transform: translate(
|
|
84
|
+
var(--animated-preview-carry-x),
|
|
85
|
+
var(--animated-preview-carry-y)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@keyframes animated-preview-fade-in {
|
|
90
|
+
from {
|
|
91
|
+
opacity: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
to {
|
|
95
|
+
opacity: 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@keyframes animated-preview-fade-out {
|
|
100
|
+
from {
|
|
101
|
+
opacity: 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
to {
|
|
105
|
+
opacity: 0;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/*
|
|
110
|
+
* Picked up (a small nudge, a 0.375rem lift, tilt and shadow), carried to the
|
|
111
|
+
* caller's target, and put down there. The caller sets
|
|
112
|
+
* `--animated-preview-carry-x` and `--animated-preview-carry-y`.
|
|
113
|
+
*/
|
|
114
|
+
@keyframes animated-preview-carry {
|
|
115
|
+
0%,
|
|
116
|
+
28% {
|
|
117
|
+
transform: none;
|
|
118
|
+
filter: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
38% {
|
|
122
|
+
transform: translate(
|
|
123
|
+
0.25rem,
|
|
124
|
+
calc(var(--animated-preview-carry-y) - 0.375rem)
|
|
125
|
+
)
|
|
126
|
+
rotate(2.5deg) scale(1.05);
|
|
127
|
+
filter: drop-shadow(
|
|
128
|
+
0 8px 10px color-mix(in srgb, var(--color-black) 28%, transparent)
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
64% {
|
|
133
|
+
transform: translate(
|
|
134
|
+
var(--animated-preview-carry-x),
|
|
135
|
+
calc(var(--animated-preview-carry-y) - 0.375rem)
|
|
136
|
+
)
|
|
137
|
+
rotate(2.5deg) scale(1.05);
|
|
138
|
+
filter: drop-shadow(
|
|
139
|
+
0 8px 10px color-mix(in srgb, var(--color-black) 28%, transparent)
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
74%,
|
|
144
|
+
100% {
|
|
145
|
+
transform: translate(
|
|
146
|
+
var(--animated-preview-carry-x),
|
|
147
|
+
var(--animated-preview-carry-y)
|
|
148
|
+
)
|
|
149
|
+
rotate(0deg) scale(1);
|
|
150
|
+
filter: none;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The one animation system for previews that explain a feature by playing it:
|
|
4
|
+
* a frame of ordered stages that cross-fade into each other, an optional
|
|
5
|
+
* carry gesture around a frame, and a hover card that hosts a preview beside
|
|
6
|
+
* the control it explains.
|
|
7
|
+
*
|
|
8
|
+
* The styles live in `animated-preview.css`, shipped through
|
|
9
|
+
* `@stll/ui/theme.css`. A stage's clock is CSS only: stage `i` comes in at
|
|
10
|
+
* `i` holds after its frame starts and goes out one hold later, so a frame
|
|
11
|
+
* nested inside a stage starts when that stage does. With reduced motion a
|
|
12
|
+
* frame renders only its final stage, statically.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* `once` plays the stages through and rests on the last one. `loop` lets the
|
|
16
|
+
* last stage go out and starts again from the first.
|
|
17
|
+
*/
|
|
18
|
+
export type AnimatedPreviewPlayback = "once" | "loop";
|
|
19
|
+
/**
|
|
20
|
+
* How long each stage holds before the next one crosses over: `glance` for a
|
|
21
|
+
* gesture read at a glance, `read` for a stage carrying a sentence, `beat` for
|
|
22
|
+
* a step inside a stage.
|
|
23
|
+
*/
|
|
24
|
+
export type AnimatedPreviewPace = "glance" | "read" | "beat";
|
|
25
|
+
export type AnimatedPreviewStage = {
|
|
26
|
+
id: string;
|
|
27
|
+
content: React$1.ReactNode;
|
|
28
|
+
};
|
|
29
|
+
type AnimatedPreviewProps = {
|
|
30
|
+
stages: readonly [AnimatedPreviewStage, ...AnimatedPreviewStage[]];
|
|
31
|
+
playback?: AnimatedPreviewPlayback;
|
|
32
|
+
pace?: AnimatedPreviewPace;
|
|
33
|
+
/**
|
|
34
|
+
* Steps this frame waits after the stage holding it comes in, so frames
|
|
35
|
+
* nested in one stage can follow each other.
|
|
36
|
+
*/
|
|
37
|
+
stagger?: number;
|
|
38
|
+
/** Lays the frame out inline, to sit inside a sentence. */
|
|
39
|
+
inline?: boolean;
|
|
40
|
+
className?: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const AnimatedPreview: ({ stages, playback, pace, stagger, inline, className }: AnimatedPreviewProps) => React$1.JSX.Element;
|
|
43
|
+
type AnimatedPreviewMotionProps = React$1.ComponentProps<"div"> & {
|
|
44
|
+
pace?: AnimatedPreviewPace;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Carries its content along: picked up (lift, tilt, shadow), moved, and put
|
|
48
|
+
* down as the frame inside it crosses from its first stage to its second.
|
|
49
|
+
* The caller places the drop with `--animated-preview-carry-x` and
|
|
50
|
+
* `--animated-preview-carry-y`; with reduced motion the content rests there.
|
|
51
|
+
*/
|
|
52
|
+
export declare const AnimatedPreviewMotion: ({ className, pace, ...props }: AnimatedPreviewMotionProps) => React$1.JSX.Element;
|
|
53
|
+
/** How long a pointer or keyboard focus rests on the trigger before the card opens. */
|
|
54
|
+
export declare const ANIMATED_PREVIEW_CARD_DELAY_MS = 400;
|
|
55
|
+
type AnimatedPreviewCardProps = React$1.PropsWithChildren<{
|
|
56
|
+
/**
|
|
57
|
+
* The control the card explains. It must take the props it is handed, as a
|
|
58
|
+
* `Button` does: the card opens from its hover and focus events.
|
|
59
|
+
*/
|
|
60
|
+
trigger: React$1.ReactElement;
|
|
61
|
+
/**
|
|
62
|
+
* One line on what the control does. Shown under the preview and read as
|
|
63
|
+
* the control's description, so the moving preview itself stays out of the
|
|
64
|
+
* accessibility tree.
|
|
65
|
+
*/
|
|
66
|
+
description: React$1.ReactNode;
|
|
67
|
+
className?: string;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* A preview card opened by hovering or focusing a control. It takes no focus
|
|
71
|
+
* and traps none: the card describes the control, and the control stays the
|
|
72
|
+
* thing that is used.
|
|
73
|
+
*/
|
|
74
|
+
export declare const AnimatedPreviewCard: ({ trigger, description, className, children }: AnimatedPreviewCardProps) => React$1.JSX.Element;
|
|
75
|
+
export {};
|