@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
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { HoverCard as PreviewCard, HoverCardContent as PreviewCardPopup, HoverCardTrigger as PreviewCardTrigger } from "./preview-card.js";
|
|
4
|
+
import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
// src/components/animated-preview.tsx
|
|
8
|
+
/** Must match the keyframes name in `animated-preview.css`. */
|
|
9
|
+
const STAGE_OUT_KEYFRAMES = "animated-preview-fade-out";
|
|
10
|
+
const AnimatedPreview = ({ stages, playback = "once", pace = "glance", stagger = 0, inline = false, className }) => {
|
|
11
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
12
|
+
const [cycle, setCycle] = React$1.useState(0);
|
|
13
|
+
const Frame = inline ? "span" : "div";
|
|
14
|
+
const lastIndex = stages.length - 1;
|
|
15
|
+
const finalStage = stages[lastIndex] ?? stages[0];
|
|
16
|
+
const frameStyle = { "--animated-preview-stagger": stagger };
|
|
17
|
+
const restartLoop = (event) => {
|
|
18
|
+
const stage = event.target;
|
|
19
|
+
if (playback === "loop" && event.animationName === STAGE_OUT_KEYFRAMES && stage instanceof HTMLElement && stage.parentElement === event.currentTarget && stage.dataset["stageIndex"] === String(lastIndex)) setCycle((current) => current + 1);
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ jsx(Frame, {
|
|
22
|
+
className,
|
|
23
|
+
"data-motion": reducedMotion ? "reduced" : "full",
|
|
24
|
+
"data-pace": pace,
|
|
25
|
+
"data-playback": playback,
|
|
26
|
+
"data-slot": "animated-preview",
|
|
27
|
+
onAnimationEnd: reducedMotion ? void 0 : restartLoop,
|
|
28
|
+
style: frameStyle,
|
|
29
|
+
children: reducedMotion ? /* @__PURE__ */ jsx(StageFrame, {
|
|
30
|
+
incoming: false,
|
|
31
|
+
index: lastIndex,
|
|
32
|
+
inline,
|
|
33
|
+
outgoing: false,
|
|
34
|
+
children: finalStage.content
|
|
35
|
+
}) : stages.map((stage, index) => /* @__PURE__ */ jsx(StageFrame, {
|
|
36
|
+
incoming: index > 0 || playback === "loop",
|
|
37
|
+
index,
|
|
38
|
+
inline,
|
|
39
|
+
outgoing: index < lastIndex || playback === "loop",
|
|
40
|
+
children: stage.content
|
|
41
|
+
}, `${cycle}:${stage.id}`))
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const StageFrame = ({ index, incoming, outgoing, inline, children }) => {
|
|
45
|
+
return /* @__PURE__ */ jsx(inline ? "span" : "div", {
|
|
46
|
+
"data-incoming": incoming ? "" : void 0,
|
|
47
|
+
"data-outgoing": outgoing ? "" : void 0,
|
|
48
|
+
"data-slot": "animated-preview-stage",
|
|
49
|
+
"data-stage-index": index,
|
|
50
|
+
style: { "--animated-preview-stage-index": index },
|
|
51
|
+
children
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Carries its content along: picked up (lift, tilt, shadow), moved, and put
|
|
56
|
+
* down as the frame inside it crosses from its first stage to its second.
|
|
57
|
+
* The caller places the drop with `--animated-preview-carry-x` and
|
|
58
|
+
* `--animated-preview-carry-y`; with reduced motion the content rests there.
|
|
59
|
+
*/
|
|
60
|
+
const AnimatedPreviewMotion = ({ className, pace = "glance", ...props }) => {
|
|
61
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
62
|
+
return /* @__PURE__ */ jsx("div", {
|
|
63
|
+
className,
|
|
64
|
+
"data-motion": reducedMotion ? "reduced" : "full",
|
|
65
|
+
"data-pace": pace,
|
|
66
|
+
"data-slot": "animated-preview-motion",
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
/** How long a pointer or keyboard focus rests on the trigger before the card opens. */
|
|
71
|
+
const ANIMATED_PREVIEW_CARD_DELAY_MS = 400;
|
|
72
|
+
/**
|
|
73
|
+
* A preview card opened by hovering or focusing a control. It takes no focus
|
|
74
|
+
* and traps none: the card describes the control, and the control stays the
|
|
75
|
+
* thing that is used.
|
|
76
|
+
*/
|
|
77
|
+
const AnimatedPreviewCard = ({ trigger, description, className, children }) => {
|
|
78
|
+
const descriptionId = React$1.useId();
|
|
79
|
+
return /* @__PURE__ */ jsxs(PreviewCard, { children: [
|
|
80
|
+
/* @__PURE__ */ jsx(PreviewCardTrigger, {
|
|
81
|
+
"aria-describedby": descriptionId,
|
|
82
|
+
delay: 400,
|
|
83
|
+
render: trigger
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ jsx("span", {
|
|
86
|
+
className: "sr-only",
|
|
87
|
+
id: descriptionId,
|
|
88
|
+
children: description
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ jsx(PreviewCardPopup, {
|
|
91
|
+
className: cn("w-72 flex-col gap-2 p-3", className),
|
|
92
|
+
"data-slot": "animated-preview-card",
|
|
93
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
94
|
+
"aria-hidden": true,
|
|
95
|
+
className: "flex flex-col gap-2",
|
|
96
|
+
children: [children, /* @__PURE__ */ jsx("p", {
|
|
97
|
+
className: "text-muted-foreground text-xs",
|
|
98
|
+
"data-slot": "animated-preview-card-description",
|
|
99
|
+
children: description
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
] });
|
|
104
|
+
};
|
|
105
|
+
export { ANIMATED_PREVIEW_CARD_DELAY_MS, AnimatedPreview, AnimatedPreviewCard, AnimatedPreviewMotion };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
//#region src/components/application-rail.d.ts
|
|
3
2
|
export declare const APPLICATION_RAIL_WIDTH: "w-12";
|
|
4
3
|
export declare const APPLICATION_RAIL_BUTTON_SIZE: "size-11";
|
|
5
4
|
export declare const APPLICATION_RAIL_ICON_SIZE: "size-4";
|
|
@@ -15,5 +14,4 @@ export declare const ApplicationRailContent: ({ className, ...props }: React$1.C
|
|
|
15
14
|
export declare const ApplicationRailMenu: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
16
15
|
export declare const ApplicationRailButton: ({ className, ...props }: React$1.ComponentProps<"button">) => React$1.JSX.Element;
|
|
17
16
|
export declare const ApplicationRailSeparator: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
18
|
-
export declare const ApplicationRailFooter: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
19
|
-
//#endregion
|
|
17
|
+
export declare const ApplicationRailFooter: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { TOOLBAR_ROW_HEIGHT } from "../inspector/layout-tokens.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/application-rail.tsx
|
|
5
5
|
const APPLICATION_RAIL_WIDTH = "w-12";
|
|
6
6
|
const APPLICATION_RAIL_BUTTON_SIZE = "size-11";
|
|
7
7
|
const APPLICATION_RAIL_ICON_SIZE = "size-4";
|
|
@@ -48,5 +48,4 @@ const ApplicationRailFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("
|
|
|
48
48
|
"data-slot": "application-rail-footer",
|
|
49
49
|
...props
|
|
50
50
|
});
|
|
51
|
-
//#endregion
|
|
52
51
|
export { APPLICATION_RAIL_BUTTON_SIZE, APPLICATION_RAIL_ICON_SIZE, APPLICATION_RAIL_WIDTH, ApplicationRail, ApplicationRailButton, ApplicationRailContent, ApplicationRailFooter, ApplicationRailHeader, ApplicationRailMenu, ApplicationRailSeparator };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
2
|
-
//#region src/components/avatar.d.ts
|
|
3
2
|
declare const Avatar: ({ className, ...props }: Avatar$1.Root.Props) => import("react").JSX.Element;
|
|
4
3
|
declare const AvatarImage: ({ className, ...props }: Avatar$1.Image.Props) => import("react").JSX.Element;
|
|
5
4
|
declare const AvatarFallback: ({ className, ...props }: Avatar$1.Fallback.Props) => import("react").JSX.Element;
|
|
6
|
-
//#endregion
|
|
7
5
|
export { Avatar, AvatarFallback, AvatarImage };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
5
|
-
|
|
5
|
+
// src/components/avatar.tsx
|
|
6
6
|
const Avatar = ({ className, ...props }) => /* @__PURE__ */ jsx(Avatar$1.Root, {
|
|
7
7
|
className: cn("bg-background inline-flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full align-middle text-xs font-medium select-none", className),
|
|
8
8
|
"data-slot": "avatar",
|
|
@@ -18,5 +18,4 @@ const AvatarFallback = ({ className, ...props }) => /* @__PURE__ */ jsx(Avatar$1
|
|
|
18
18
|
"data-slot": "avatar-fallback",
|
|
19
19
|
...props
|
|
20
20
|
});
|
|
21
|
-
//#endregion
|
|
22
21
|
export { Avatar, AvatarFallback, AvatarImage };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { StatusTone } from "./list.js";
|
|
2
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
-
//#region src/components/badge.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* A short label that classifies the thing beside it: a status, a type, a
|
|
6
5
|
* count. The words carry the meaning; the tone and the optional dot only
|
|
@@ -24,5 +23,4 @@ declare const badgeVariants: (props?: ({
|
|
|
24
23
|
size?: "sm" | "xs" | null | undefined;
|
|
25
24
|
tone?: "destructive" | "info" | "neutral" | "success" | "warning" | null | undefined;
|
|
26
25
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
27
|
-
//#endregion
|
|
28
26
|
export { Badge, type BadgeProps, type BadgeSize, type BadgeTone, badgeVariants };
|
package/dist/components/badge.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
4
|
import { useRender } from "@base-ui/react/use-render";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
|
-
|
|
6
|
+
// src/components/badge.tsx
|
|
7
7
|
/**
|
|
8
8
|
* A short label that classifies the thing beside it: a status, a type, a
|
|
9
9
|
* count. The words carry the meaning; the tone and the optional dot only
|
|
@@ -60,5 +60,4 @@ const BADGE_DOT_CLASS = {
|
|
|
60
60
|
success: "bg-success",
|
|
61
61
|
warning: "bg-warning"
|
|
62
62
|
};
|
|
63
|
-
//#endregion
|
|
64
63
|
export { Badge, badgeVariants };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
//#region src/components/bidi-text.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Isolation shields the text around a value, not the value itself: a
|
|
5
4
|
* directional control inside it still reorders its letters, so stored text
|
|
@@ -27,5 +26,4 @@ type ParagraphTextProps = Omit<React$1.ComponentPropsWithoutRef<"p">, "dir"> & {
|
|
|
27
26
|
direction?: BidiDirection;
|
|
28
27
|
};
|
|
29
28
|
type BidiTextProps = BdiElementProps | SpanTextProps | DivTextProps | ParagraphTextProps;
|
|
30
|
-
//#endregion
|
|
31
29
|
export type { BidiDirection, BidiTextProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/bidi-text.tsx
|
|
5
5
|
/** Explicit embeddings, overrides and isolates; implicit marks stay. */
|
|
6
6
|
const DIRECTIONAL_CONTROLS = /[\u202A-\u202E\u2066-\u2069]/gu;
|
|
7
7
|
/**
|
|
@@ -47,5 +47,4 @@ const BidiText = (props) => {
|
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
49
|
const UserText = BidiText;
|
|
50
|
-
//#endregion
|
|
51
50
|
export { BidiText, UserText, stripDirectionalControls, withoutDirectionalControls };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
//#region src/components/brand-icons.d.ts
|
|
3
2
|
type BrandIconProps = React$1.ComponentProps<"svg">;
|
|
4
3
|
export declare const DiscordLogoIcon: (props: BrandIconProps) => React$1.JSX.Element;
|
|
5
4
|
export declare const GitHubLogoIcon: (props: BrandIconProps) => React$1.JSX.Element;
|
|
6
5
|
export declare const XLogoIcon: (props: BrandIconProps) => React$1.JSX.Element;
|
|
7
|
-
//#endregion
|
|
8
6
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
// src/components/brand-icons.tsx
|
|
3
3
|
const DiscordLogoIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
4
4
|
"aria-hidden": "true",
|
|
5
5
|
fill: "currentColor",
|
|
@@ -21,5 +21,4 @@ const XLogoIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
|
21
21
|
...props,
|
|
22
22
|
children: /* @__PURE__ */ jsx("path", { d: "M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.64 7.584H.47l8.6-9.835L0 1.153h7.594l5.243 6.932 6.064-6.932Zm-1.29 19.49h2.039L6.486 3.24H4.298l13.313 17.403Z" })
|
|
23
23
|
});
|
|
24
|
-
//#endregion
|
|
25
24
|
export { DiscordLogoIcon, GitHubLogoIcon, XLogoIcon };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
-
//#region src/components/breadcrumb.d.ts
|
|
4
3
|
declare const Breadcrumb: ({ ...props }: React$1.ComponentProps<"nav">) => React$1.JSX.Element;
|
|
5
4
|
declare const BreadcrumbList: ({ className, ...props }: React$1.ComponentProps<"ol">) => React$1.JSX.Element;
|
|
6
5
|
declare const BreadcrumbItem: ({ className, ...props }: React$1.ComponentProps<"li">) => React$1.JSX.Element;
|
|
@@ -8,5 +7,4 @@ declare function BreadcrumbLink({ className, render, ...props }: useRender.Compo
|
|
|
8
7
|
declare const BreadcrumbPage: ({ className, ...props }: React$1.ComponentProps<"span">) => React$1.JSX.Element;
|
|
9
8
|
declare const BreadcrumbSeparator: ({ children, className, ...props }: React$1.ComponentProps<"li">) => React$1.JSX.Element;
|
|
10
9
|
declare const BreadcrumbEllipsis: ({ className, ...props }: React$1.ComponentProps<"span">) => React$1.JSX.Element;
|
|
11
|
-
//#endregion
|
|
12
10
|
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
@@ -5,7 +5,7 @@ import { DirectionalIcon } from "./directional-icon.js";
|
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
7
|
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
-
|
|
8
|
+
// src/components/breadcrumb.tsx
|
|
9
9
|
const Breadcrumb = ({ ...props }) => /* @__PURE__ */ jsx("nav", {
|
|
10
10
|
"aria-label": "Breadcrumb",
|
|
11
11
|
"data-slot": "breadcrumb",
|
|
@@ -57,5 +57,4 @@ const BreadcrumbEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs("sp
|
|
|
57
57
|
children: "More"
|
|
58
58
|
})]
|
|
59
59
|
});
|
|
60
|
-
//#endregion
|
|
61
60
|
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ButtonContract, ButtonSize, ButtonVariant } from "./button.shared.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
-
//#region src/components/button.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Disabled styling for a button that is only `aria-disabled`.
|
|
7
6
|
*
|
|
@@ -103,5 +102,4 @@ type ButtonTextRunProps = Omit<ButtonProps, "children" | "className" | "focusRin
|
|
|
103
102
|
* `Button size="inline"` for a short action.
|
|
104
103
|
*/
|
|
105
104
|
declare const ButtonTextRun: ({ children, className, disabled, ...props }: ButtonTextRunProps) => import("react").JSX.Element;
|
|
106
|
-
//#endregion
|
|
107
105
|
export { BUTTON_CONTENT, BUTTON_SIZE_CONTENT, Button, type ButtonFocusRing, type ButtonPlainShape, type ButtonProps, type ButtonSize, ButtonTextRun, type ButtonVariant, buttonAccessibleDisabledClass, buttonVariants };
|
|
@@ -3,6 +3,7 @@ import { cn } from "../lib/utils.js";
|
|
|
3
3
|
import { renderTooltipTrigger } from "./tooltip-trigger-helper.js";
|
|
4
4
|
import { BUTTON_DISPOSITION, blockDisabledActivation, blockDisabledKeyActivation, resolveButtonDisposition } from "../lib/button-disposition.js";
|
|
5
5
|
import { MENU_ROW_CLASS_NAME } from "../lib/menu-row.js";
|
|
6
|
+
import { rendersNothing } from "../lib/renders-nothing.js";
|
|
6
7
|
import { BUTTON_PLAIN_VARIANT, BUTTON_VARIANT_TOKENS } from "./button.shared.js";
|
|
7
8
|
import { Loader } from "./loader.js";
|
|
8
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -11,7 +12,7 @@ import { mergeProps } from "@base-ui/react/merge-props";
|
|
|
11
12
|
import { useRender } from "@base-ui/react/use-render";
|
|
12
13
|
import { panic } from "better-result";
|
|
13
14
|
import { cva } from "class-variance-authority";
|
|
14
|
-
|
|
15
|
+
// src/components/button.tsx
|
|
15
16
|
/**
|
|
16
17
|
* Disabled styling for a button that is only `aria-disabled`.
|
|
17
18
|
*
|
|
@@ -218,17 +219,15 @@ function Button({ className, variant: variantProp, size, render, layout, loading
|
|
|
218
219
|
const isAccessibleDisabled = disposition === BUTTON_DISPOSITION.accessibleDisabled;
|
|
219
220
|
const isActivationPreservingDisabled = accessibleDisabled !== void 0;
|
|
220
221
|
const defaultProps = {
|
|
221
|
-
children:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
variant
|
|
231
|
-
}) ? containedLabel(children) : children] }),
|
|
222
|
+
children: buttonContent({
|
|
223
|
+
icon,
|
|
224
|
+
label: cutsLabel({
|
|
225
|
+
layout,
|
|
226
|
+
size,
|
|
227
|
+
variant
|
|
228
|
+
}) ? containedLabel(children) : children,
|
|
229
|
+
loading
|
|
230
|
+
}),
|
|
232
231
|
className: cn(variant === "plain" ? cn(BUTTON_PLAIN_CLASS, BUTTON_PLAIN_SHAPE_CLASS[shape], className) : cn(disposition === BUTTON_DISPOSITION.enabled && !isActivationPreservingDisabled && size !== "row" && size !== "inline" && variant !== "link" && buttonPressClass, buttonVariants({
|
|
233
232
|
className,
|
|
234
233
|
size,
|
|
@@ -263,6 +262,30 @@ function Button({ className, variant: variantProp, size, render, layout, loading
|
|
|
263
262
|
});
|
|
264
263
|
}
|
|
265
264
|
/**
|
|
265
|
+
* What the button shows. Loading never changes its width: with an `icon`,
|
|
266
|
+
* the loader takes the icon's place; without one, the label (already cut to
|
|
267
|
+
* the button's width where it is cut) stays in place but transparent (still
|
|
268
|
+
* the accessible name) and the loader sits over its centre, so a row of
|
|
269
|
+
* buttons does not shift when one starts saving.
|
|
270
|
+
*/
|
|
271
|
+
function buttonContent({ icon, label, loading }) {
|
|
272
|
+
if (!loading) return /* @__PURE__ */ jsxs(Fragment, { children: [icon, label] });
|
|
273
|
+
const hasIcon = !rendersNothing(icon);
|
|
274
|
+
const loader = /* @__PURE__ */ jsx(Loader, {
|
|
275
|
+
animation: "none",
|
|
276
|
+
className: cn("[transition:opacity_150ms_ease-out,scale_320ms_var(--ease-spring)] motion-reduce:transition-none starting:scale-50 starting:opacity-0", !hasIcon && "absolute inset-0 m-auto"),
|
|
277
|
+
"data-slot": "button-loader",
|
|
278
|
+
size: "sm",
|
|
279
|
+
variant: "decorative"
|
|
280
|
+
});
|
|
281
|
+
if (hasIcon) return /* @__PURE__ */ jsxs(Fragment, { children: [loader, label] });
|
|
282
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
283
|
+
className: "inline-flex min-w-0 items-center gap-[inherit] opacity-0",
|
|
284
|
+
"data-slot": "button-loading-label",
|
|
285
|
+
children: label
|
|
286
|
+
}), loader] });
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
266
289
|
* The run is the visible target: underlined like a link, ringed while its
|
|
267
290
|
* button has keyboard focus (per line, so a wrapped run rings each line).
|
|
268
291
|
*/
|
|
@@ -295,5 +318,4 @@ const ButtonTextRun = ({ children, className, disabled, ...props }) => /* @__PUR
|
|
|
295
318
|
variant: BUTTON_PLAIN_VARIANT
|
|
296
319
|
}), children]
|
|
297
320
|
});
|
|
298
|
-
//#endregion
|
|
299
321
|
export { BUTTON_CONTENT, BUTTON_SIZE_CONTENT, Button, ButtonTextRun, buttonAccessibleDisabledClass, buttonVariants };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ButtonSize, ButtonVariant } from "./button.shared.js";
|
|
2
|
-
//#region src/components/button.native-classes.d.ts
|
|
3
2
|
type NativeButtonClassNamesOptions = {
|
|
4
3
|
className?: string | undefined;
|
|
5
4
|
inactive: boolean;
|
|
@@ -13,5 +12,4 @@ export declare const nativeButtonClassNames: ({ className, inactive, selected, s
|
|
|
13
12
|
pressable: string;
|
|
14
13
|
slop: 0 | 6 | 8 | 12;
|
|
15
14
|
};
|
|
16
|
-
//#endregion
|
|
17
15
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BUTTON_PLAIN_VARIANT, BUTTON_VARIANT_TOKENS } from "./button.shared.js";
|
|
2
|
-
|
|
2
|
+
// src/components/button.native-classes.ts
|
|
3
3
|
/** A control's box: centred content inside the variant's border. */
|
|
4
4
|
const CONTROL = "items-center justify-center border";
|
|
5
5
|
/**
|
|
@@ -177,5 +177,4 @@ const nativeButtonClassNames = ({ className, inactive, selected, size, variant }
|
|
|
177
177
|
slop: shape.slop
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
|
-
//#endregion
|
|
181
180
|
export { nativeButtonClassNames };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ButtonContract } from "./button.shared.js";
|
|
2
2
|
import { PressableProps } from "react-native";
|
|
3
|
-
//#region src/components/button.native.d.ts
|
|
4
3
|
type ButtonProps = Omit<PressableProps, "children" | "disabled"> & ButtonContract & {
|
|
5
4
|
className?: string | undefined;
|
|
6
5
|
};
|
|
@@ -14,5 +13,4 @@ type ButtonProps = Omit<PressableProps, "children" | "disabled"> & ButtonContrac
|
|
|
14
13
|
* only when it is selected. Its classes come from ./button.native-classes.ts.
|
|
15
14
|
*/
|
|
16
15
|
export declare const Button: ({ accessibilityState, children, className, disabled, hitSlop, icon, loading, selected: selectedProp, size, variant: variantProp, ...props }: ButtonProps) => import("react").JSX.Element;
|
|
17
|
-
//#endregion
|
|
18
16
|
export {};
|
|
@@ -3,7 +3,7 @@ import { Loader } from "./loader.native.js";
|
|
|
3
3
|
import { Text as Text$1 } from "./text.native.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Pressable } from "react-native";
|
|
6
|
-
|
|
6
|
+
// src/components/button.native.tsx
|
|
7
7
|
/**
|
|
8
8
|
* The web's `Button` (./button.tsx) on a phone: the same variants and sizes,
|
|
9
9
|
* read from ./button.shared.ts, on a Pressable. A string child is set as the
|
|
@@ -44,5 +44,4 @@ const Button = ({ accessibilityState, children, className, disabled = false, hit
|
|
|
44
44
|
}) : children]
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
-
//#endregion
|
|
48
47
|
export { Button };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
//#region src/components/button.shared.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Each variant's colours: the box (`surface`: border and fill) and the
|
|
5
4
|
* label. Neither carries state; each renderer adds its own hover, press and
|
|
@@ -83,5 +82,4 @@ export type ButtonContract = {
|
|
|
83
82
|
*/
|
|
84
83
|
selected?: boolean | undefined;
|
|
85
84
|
children?: ReactNode;
|
|
86
|
-
};
|
|
87
|
-
//#endregion
|
|
85
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/button.shared.ts
|
|
2
2
|
/**
|
|
3
3
|
* Each variant's colours: the box (`surface`: border and fill) and the
|
|
4
4
|
* label. Neither carries state; each renderer adds its own hover, press and
|
|
@@ -72,5 +72,4 @@ const BUTTON_SIZES = [
|
|
|
72
72
|
"xl",
|
|
73
73
|
"xs"
|
|
74
74
|
];
|
|
75
|
-
//#endregion
|
|
76
75
|
export { BUTTON_PLAIN_VARIANT, BUTTON_SIZES, BUTTON_VARIANT_TOKENS };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
5
|
-
|
|
5
|
+
// src/components/checkbox.tsx
|
|
6
6
|
const Checkbox = ({ className, ...props }) => /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
7
7
|
className: cn("border-input bg-background ring-ring focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 dark:not-data-checked:bg-input/32 dark:aria-invalid:ring-destructive/24 relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[4px] border shadow-xs/5 outline-none not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 data-disabled:opacity-64 sm:size-4 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none", className),
|
|
8
8
|
"data-slot": "checkbox",
|
|
@@ -42,5 +42,4 @@ const Checkbox = ({ className, ...props }) => /* @__PURE__ */ jsx(Checkbox$1.Roo
|
|
|
42
42
|
})
|
|
43
43
|
})
|
|
44
44
|
});
|
|
45
|
-
//#endregion
|
|
46
45
|
export { Checkbox };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
|
|
2
|
-
//#region src/components/collapsible.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* One disclosure: a trigger that shows or hides a single panel ("Show
|
|
5
4
|
* details" under a card, a step list in a transcript). A set of sections
|
|
@@ -10,17 +9,22 @@ import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
|
|
|
10
9
|
* text toggle), so a disclosure reads like every other action of its size.
|
|
11
10
|
*/
|
|
12
11
|
declare const Collapsible: (props: Collapsible$1.Root.Props) => import("react").JSX.Element;
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* A bare trigger (plain text, no `render`) still gets the 44px touch target
|
|
14
|
+
* every control has under a coarse pointer, the same hit area `Button` adds.
|
|
15
|
+
*/
|
|
16
|
+
declare const CollapsibleTrigger: ({ className, ...props }: Collapsible$1.Trigger.Props) => import("react").JSX.Element;
|
|
14
17
|
/**
|
|
15
18
|
* The disclosed content. It adds no padding or type, so opening it reveals
|
|
16
19
|
* content at the rhythm of the surface around it, as a native `<details>`
|
|
17
20
|
* does. Its height eases open and shut with the accordion's timing, so the
|
|
18
21
|
* two disclosures move alike; under reduced motion it snaps.
|
|
19
22
|
*
|
|
20
|
-
* Closed, the content stays in the document
|
|
21
|
-
* native `<details>` keeps it), so find-in-page
|
|
22
|
-
* the panel
|
|
23
|
+
* Closed, the content stays in the document. Once mounted it is
|
|
24
|
+
* `hidden="until-found"` (as a native `<details>` keeps it), so find-in-page
|
|
25
|
+
* reaches it and opens the panel; server-rendered markup carries a plain
|
|
26
|
+
* `hidden` until hydration, so the search reaches it only after that. Pass
|
|
27
|
+
* `hiddenUntilFound={false}` to unmount it instead.
|
|
23
28
|
*/
|
|
24
29
|
declare const CollapsiblePanel: ({ className, hiddenUntilFound, ...props }: Collapsible$1.Panel.Props) => import("react").JSX.Element;
|
|
25
|
-
//#endregion
|
|
26
30
|
export { Collapsible, CollapsiblePanel, CollapsibleTrigger };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
|
|
5
|
-
|
|
5
|
+
// src/components/collapsible.tsx
|
|
6
6
|
/**
|
|
7
7
|
* One disclosure: a trigger that shows or hides a single panel ("Show
|
|
8
8
|
* details" under a card, a step list in a transcript). A set of sections
|
|
@@ -16,7 +16,12 @@ const Collapsible = (props) => /* @__PURE__ */ jsx(Collapsible$1.Root, {
|
|
|
16
16
|
"data-slot": "collapsible",
|
|
17
17
|
...props
|
|
18
18
|
});
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* A bare trigger (plain text, no `render`) still gets the 44px touch target
|
|
21
|
+
* every control has under a coarse pointer, the same hit area `Button` adds.
|
|
22
|
+
*/
|
|
23
|
+
const CollapsibleTrigger = ({ className, ...props }) => /* @__PURE__ */ jsx(Collapsible$1.Trigger, {
|
|
24
|
+
className: cn("relative pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11", className),
|
|
20
25
|
"data-slot": "collapsible-trigger",
|
|
21
26
|
...props
|
|
22
27
|
});
|
|
@@ -26,9 +31,11 @@ const CollapsibleTrigger = (props) => /* @__PURE__ */ jsx(Collapsible$1.Trigger,
|
|
|
26
31
|
* does. Its height eases open and shut with the accordion's timing, so the
|
|
27
32
|
* two disclosures move alike; under reduced motion it snaps.
|
|
28
33
|
*
|
|
29
|
-
* Closed, the content stays in the document
|
|
30
|
-
* native `<details>` keeps it), so find-in-page
|
|
31
|
-
* the panel
|
|
34
|
+
* Closed, the content stays in the document. Once mounted it is
|
|
35
|
+
* `hidden="until-found"` (as a native `<details>` keeps it), so find-in-page
|
|
36
|
+
* reaches it and opens the panel; server-rendered markup carries a plain
|
|
37
|
+
* `hidden` until hydration, so the search reaches it only after that. Pass
|
|
38
|
+
* `hiddenUntilFound={false}` to unmount it instead.
|
|
32
39
|
*/
|
|
33
40
|
const CollapsiblePanel = ({ className, hiddenUntilFound = true, ...props }) => /* @__PURE__ */ jsx(Collapsible$1.Panel, {
|
|
34
41
|
className: cn("h-(--collapsible-panel-height) min-w-0 overflow-hidden 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", className),
|
|
@@ -36,5 +43,4 @@ const CollapsiblePanel = ({ className, hiddenUntilFound = true, ...props }) => /
|
|
|
36
43
|
hiddenUntilFound,
|
|
37
44
|
...props
|
|
38
45
|
});
|
|
39
|
-
//#endregion
|
|
40
46
|
export { Collapsible, CollapsiblePanel, CollapsibleTrigger };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
//#region src/components/color-picker.d.ts
|
|
3
2
|
type ColorPreset = {
|
|
4
3
|
label: string;
|
|
5
4
|
/** Value emitted on select (e.g. "red" or "FF0000") */
|
|
@@ -23,8 +22,17 @@ type ColorPickerProps = {
|
|
|
23
22
|
defaultExpanded?: boolean;
|
|
24
23
|
/** Localized label for expanding the custom color controls. */
|
|
25
24
|
moreLabel: string;
|
|
26
|
-
/**
|
|
27
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The popover trigger: one focusable element (normally a named button)
|
|
27
|
+
* that becomes the trigger itself, so the picker never wraps it in a
|
|
28
|
+
* second, unnamed button.
|
|
29
|
+
*/
|
|
30
|
+
trigger: React$1.ReactElement;
|
|
31
|
+
/**
|
|
32
|
+
* Whether `trigger` renders a native `<button>` (default). Pass `false`
|
|
33
|
+
* only for a non-button element; Base UI then gives it button semantics.
|
|
34
|
+
*/
|
|
35
|
+
nativeButton?: boolean;
|
|
28
36
|
/** Popover placement side */
|
|
29
37
|
side?: "top" | "bottom" | "left" | "right";
|
|
30
38
|
/** Popover placement alignment */
|
|
@@ -52,6 +60,5 @@ type ColorPickerContentProps = ColorPickerContentBaseProps & ({
|
|
|
52
60
|
});
|
|
53
61
|
declare const DEFAULT_PRESETS: ColorPreset[];
|
|
54
62
|
declare const ColorPickerContent: ({ value, onSelect, onClear, presets, columns, defaultExpanded, moreLabel, presentation }: ColorPickerContentProps) => React$1.JSX.Element;
|
|
55
|
-
declare const ColorPicker: ({ value, onSelect, onClear, presets, columns, defaultExpanded, moreLabel,
|
|
56
|
-
//#endregion
|
|
63
|
+
declare const ColorPicker: ({ value, onSelect, onClear, presets, columns, defaultExpanded, moreLabel, nativeButton, trigger, side, align, className }: ColorPickerProps) => React$1.JSX.Element;
|
|
57
64
|
export { ColorPicker, ColorPickerContent, type ColorPickerContentProps, type ColorPickerProps, type ColorPreset, DEFAULT_PRESETS };
|
|
@@ -5,7 +5,7 @@ import { OVERLAY_LAYER_CLASS_NAMES } from "../lib/overlay-layer.js";
|
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Suspense, lazy, useState } from "react";
|
|
7
7
|
import { Popover } from "@base-ui/react/popover";
|
|
8
|
-
|
|
8
|
+
// src/components/color-picker.tsx
|
|
9
9
|
const HexColorPicker = lazy(async () => {
|
|
10
10
|
return { default: (await import("./hex-color-picker.js")).HexColorPicker };
|
|
11
11
|
});
|
|
@@ -287,11 +287,10 @@ const ColorPickerContent = ({ value, onSelect, onClear, presets, columns, defaul
|
|
|
287
287
|
]
|
|
288
288
|
});
|
|
289
289
|
};
|
|
290
|
-
const ColorPicker = ({ value, onSelect, onClear, presets = DEFAULT_PRESETS, columns = 9, defaultExpanded = false, moreLabel,
|
|
290
|
+
const ColorPicker = ({ value, onSelect, onClear, presets = DEFAULT_PRESETS, columns = 9, defaultExpanded = false, moreLabel, nativeButton = true, trigger, side = "bottom", align = "start", className }) => /* @__PURE__ */ jsxs(Popover.Root, { children: [/* @__PURE__ */ jsx(Popover.Trigger, {
|
|
291
291
|
"data-slot": "color-picker-trigger",
|
|
292
|
-
nativeButton
|
|
293
|
-
render:
|
|
294
|
-
children
|
|
292
|
+
nativeButton,
|
|
293
|
+
render: trigger
|
|
295
294
|
}), /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
296
295
|
align,
|
|
297
296
|
className: OVERLAY_LAYER_CLASS_NAMES.popup,
|
|
@@ -312,5 +311,4 @@ const ColorPicker = ({ value, onSelect, onClear, presets = DEFAULT_PRESETS, colu
|
|
|
312
311
|
})
|
|
313
312
|
})
|
|
314
313
|
}) })] });
|
|
315
|
-
//#endregion
|
|
316
314
|
export { ColorPicker, ColorPickerContent, DEFAULT_PRESETS };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
|
|
3
3
|
import { ControlSize } from "../lib/control-size.js";
|
|
4
|
-
//#region src/components/combobox.d.ts
|
|
5
4
|
declare const Combobox: <Value, Multiple extends boolean | undefined = false>(props: Combobox$1.Root.Props<Value, Multiple>) => React$1.JSX.Element;
|
|
6
5
|
declare const ComboboxChipsInput: ({ className, size, ...props }: Omit<Combobox$1.Input.Props, "size"> & {
|
|
7
6
|
size?: ControlSize | number;
|
|
@@ -38,5 +37,4 @@ declare const ComboboxChips: ({ className, children, startAddon, ...props }: Com
|
|
|
38
37
|
startAddon?: React$1.ReactNode;
|
|
39
38
|
}) => React$1.JSX.Element;
|
|
40
39
|
declare const ComboboxChip: ({ children, ...props }: Combobox$1.Chip.Props) => React$1.JSX.Element;
|
|
41
|
-
//#endregion
|
|
42
40
|
export { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxPopup, ComboboxRow, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue };
|