@stll/ui 0.65.1 → 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 +0 -2
- package/dist/components/accordion.js +1 -2
- 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 +0 -2
- package/dist/components/collapsible.js +1 -2
- 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
package/dist/components/list.js
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
6
6
|
import { useRender } from "@base-ui/react/use-render";
|
|
7
7
|
import { cva } from "class-variance-authority";
|
|
8
|
-
|
|
8
|
+
// src/components/list.tsx
|
|
9
9
|
/**
|
|
10
10
|
* Grouped list: a titled section holding one surface of hairline-divided
|
|
11
11
|
* rows. Use it for settings and inventories of named things (connections,
|
|
@@ -162,5 +162,4 @@ const ListItemStatus = ({ tone = "neutral", className, children, ...props }) =>
|
|
|
162
162
|
className: cn("size-1.5 shrink-0 rounded-full", STATUS_DOT_CLASS[tone])
|
|
163
163
|
}), children]
|
|
164
164
|
});
|
|
165
|
-
//#endregion
|
|
166
165
|
export { List, ListEmpty, ListGroup, ListGroupAction, ListGroupCount, ListGroupDescription, ListGroupHeader, ListGroupHeading, ListGroupTitle, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemMedia, ListItemStatus, ListItemTitle };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
2
|
import { LoaderSize } from "./loader.shared.js";
|
|
3
|
-
//#region src/components/loader.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* The indeterminate loading indicator for a control or a row: a plain
|
|
6
5
|
* spinner. Inline (`sm`) next to a control that is busy, `md` in a row or a
|
|
@@ -37,5 +36,4 @@ type LoaderStateProps = {
|
|
|
37
36
|
hint?: string | undefined;
|
|
38
37
|
className?: string | undefined;
|
|
39
38
|
};
|
|
40
|
-
//#endregion
|
|
41
39
|
export { Loader, LoaderState };
|
|
@@ -2,7 +2,7 @@ import { LoaderCircleIcon } from "../icons.js";
|
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { StellaMark } from "./stella-mark.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components/loader.tsx
|
|
6
6
|
/**
|
|
7
7
|
* The indeterminate loading indicator for a control or a row: a plain
|
|
8
8
|
* spinner. Inline (`sm`) next to a control that is busy, `md` in a row or a
|
|
@@ -58,5 +58,4 @@ const LOADER_SIZE = {
|
|
|
58
58
|
lg: "size-8"
|
|
59
59
|
};
|
|
60
60
|
const LoaderMark = () => /* @__PURE__ */ jsx(StellaMark, { className: "animate-loader text-muted-foreground size-full motion-reduce:animate-none motion-reduce:opacity-70" });
|
|
61
|
-
//#endregion
|
|
62
61
|
export { Loader, LoaderState };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ActivityIndicatorProps } from "react-native";
|
|
2
2
|
import { LoaderContract, LoaderSize } from "./loader.shared.js";
|
|
3
|
-
//#region src/components/loader.native.d.ts
|
|
4
3
|
type LoaderProps = Omit<ActivityIndicatorProps, "size"> & {
|
|
5
4
|
className?: string | undefined;
|
|
6
5
|
/** The colour is the loader's own: the muted foreground, as on the web. */
|
|
@@ -24,5 +23,4 @@ type LoaderProps = Omit<ActivityIndicatorProps, "size"> & {
|
|
|
24
23
|
* the platform's spinner in the muted foreground, at the web's sizes.
|
|
25
24
|
*/
|
|
26
25
|
export declare const Loader: ({ label, size, variant, ...props }: LoaderProps) => import("react").JSX.Element;
|
|
27
|
-
//#endregion
|
|
28
26
|
export type { LoaderContract };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ActivityIndicator } from "react-native";
|
|
3
|
-
|
|
3
|
+
// src/components/loader.native.tsx
|
|
4
4
|
/** The platform's indicator comes in two sizes; `lg` is a region's. */
|
|
5
5
|
const INDICATOR_SIZE = {
|
|
6
6
|
sm: "small",
|
|
@@ -19,5 +19,4 @@ const Loader = ({ label, size = "md", variant = "status", ...props }) => /* @__P
|
|
|
19
19
|
importantForAccessibility: variant === "decorative" ? "no-hide-descendants" : "auto",
|
|
20
20
|
size: INDICATOR_SIZE[size]
|
|
21
21
|
});
|
|
22
|
-
//#endregion
|
|
23
22
|
export { Loader };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/loader.shared.d.ts
|
|
2
1
|
/** Inline beside a busy control (`sm`), in a row or panel (`md`), or a region (`lg`). */
|
|
3
2
|
export declare const LOADER_SIZES: readonly ["sm", "md", "lg"];
|
|
4
3
|
export type LoaderSize = (typeof LOADER_SIZES)[number];
|
|
@@ -13,5 +12,4 @@ export type LoaderContract = {
|
|
|
13
12
|
/** The surrounding control or text announces the pending state. */
|
|
14
13
|
variant: "decorative";
|
|
15
14
|
label?: never;
|
|
16
|
-
});
|
|
17
|
-
//#endregion
|
|
15
|
+
});
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/loader.shared.ts
|
|
2
2
|
/** Inline beside a busy control (`sm`), in a row or panel (`md`), or a region (`lg`). */
|
|
3
3
|
const LOADER_SIZES = [
|
|
4
4
|
"sm",
|
|
5
5
|
"md",
|
|
6
6
|
"lg"
|
|
7
7
|
];
|
|
8
|
-
//#endregion
|
|
9
8
|
export { LOADER_SIZES };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { MatterIconContract } from "./matter-icon.shared.js";
|
|
2
|
-
//#region src/components/matter-icon.d.ts
|
|
3
2
|
type MatterIconProps = {
|
|
4
3
|
className?: string | undefined;
|
|
5
4
|
} & MatterIconContract;
|
|
@@ -7,5 +6,4 @@ export declare const MatterIcon: (props: MatterIconProps) => import("react").JSX
|
|
|
7
6
|
export declare const MattersNavIcon: ({ className }: {
|
|
8
7
|
className?: string | undefined;
|
|
9
8
|
}) => import("react").JSX.Element;
|
|
10
|
-
//#endregion
|
|
11
9
|
export {};
|
|
@@ -3,7 +3,7 @@ import { cn } from "../lib/utils.js";
|
|
|
3
3
|
import { resolveMatterColor } from "../lib/matter-colors.js";
|
|
4
4
|
import { ALL_MATTERS_STACK } from "./matter-icon.shared.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/components/matter-icon.tsx
|
|
7
7
|
const MatterIcon = (props) => {
|
|
8
8
|
if ("matter" in props) return /* @__PURE__ */ jsx(LayersIcon, {
|
|
9
9
|
"aria-hidden": "true",
|
|
@@ -32,5 +32,4 @@ const MattersNavIcon = ({ className }) => /* @__PURE__ */ jsx(MatterIcon, {
|
|
|
32
32
|
className,
|
|
33
33
|
variant: "none"
|
|
34
34
|
});
|
|
35
|
-
//#endregion
|
|
36
35
|
export { MatterIcon, MattersNavIcon };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { MatterIconContract } from "./matter-icon.shared.js";
|
|
2
|
-
//#region src/components/matter-icon.native.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The shared contract, with a matter's colour optional: the app's matter
|
|
5
4
|
* records leave it out when none is stored, which the web reads as null.
|
|
@@ -21,5 +20,4 @@ type MatterIconProps = ({
|
|
|
21
20
|
* matter; the tri-plane stack for all of them.
|
|
22
21
|
*/
|
|
23
22
|
export declare const MatterIcon: (props: MatterIconProps) => import("react").JSX.Element;
|
|
24
|
-
//#endregion
|
|
25
23
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { resolveMatterColor } from "../lib/matter-colors.js";
|
|
2
2
|
import { ALL_MATTERS_STACK } from "./matter-icon.shared.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { LayersIcon } from "lucide-react-native";
|
|
5
4
|
import Svg, { Path } from "react-native-svg";
|
|
5
|
+
import { LayersIcon } from "lucide-react-native";
|
|
6
6
|
import { useCSSVariable } from "uniwind";
|
|
7
|
-
|
|
7
|
+
// src/components/matter-icon.native.tsx
|
|
8
8
|
/**
|
|
9
9
|
* Every palette option a matter can be painted in, as a class. uniwind keeps
|
|
10
10
|
* only the theme variables some class uses, so naming each option here keeps
|
|
@@ -74,5 +74,4 @@ const MatterIcon = (props) => {
|
|
|
74
74
|
size
|
|
75
75
|
});
|
|
76
76
|
};
|
|
77
|
-
//#endregion
|
|
78
77
|
export { MatterIcon };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/matter-icon.shared.d.ts
|
|
2
1
|
export type MatterIconContract = {
|
|
3
2
|
matter: {
|
|
4
3
|
id: string;
|
|
@@ -17,5 +16,4 @@ export declare const ALL_MATTERS_STACK: readonly [{
|
|
|
17
16
|
}, {
|
|
18
17
|
readonly d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17";
|
|
19
18
|
readonly option: "green";
|
|
20
|
-
}];
|
|
21
|
-
//#endregion
|
|
19
|
+
}];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/matter-icon.shared.ts
|
|
2
2
|
/** The three planes of the "all matters" glyph, top to bottom, in their tints. */
|
|
3
3
|
const ALL_MATTERS_STACK = [
|
|
4
4
|
{
|
|
@@ -14,5 +14,4 @@ const ALL_MATTERS_STACK = [
|
|
|
14
14
|
option: "green"
|
|
15
15
|
}
|
|
16
16
|
];
|
|
17
|
-
//#endregion
|
|
18
17
|
export { ALL_MATTERS_STACK };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
|
-
//#region src/components/menu-section.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* A titled group of menu rows. Owns the group's inset, its heading and the
|
|
5
4
|
* stack the rows sit in, so sibling lists in one panel share a rhythm; the rows
|
|
@@ -8,5 +7,4 @@ import { PropsWithChildren } from "react";
|
|
|
8
7
|
declare const MenuSection: ({ children, title }: PropsWithChildren<{
|
|
9
8
|
title: string;
|
|
10
9
|
}>) => import("react").JSX.Element;
|
|
11
|
-
//#endregion
|
|
12
10
|
export { MenuSection };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
// src/components/menu-section.tsx
|
|
3
3
|
/**
|
|
4
4
|
* A titled group of menu rows. Owns the group's inset, its heading and the
|
|
5
5
|
* stack the rows sit in, so sibling lists in one panel share a rhythm; the rows
|
|
@@ -16,5 +16,4 @@ const MenuSection = ({ children, title }) => /* @__PURE__ */ jsxs("section", {
|
|
|
16
16
|
children
|
|
17
17
|
})]
|
|
18
18
|
});
|
|
19
|
-
//#endregion
|
|
20
19
|
export { MenuSection };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
+
import { Kbd } from "./kbd.js";
|
|
2
3
|
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
3
|
-
//#region src/components/menu.d.ts
|
|
4
4
|
declare const MenuCreateHandle: typeof Menu$1.createHandle;
|
|
5
5
|
declare const Menu: typeof Menu$1.Root;
|
|
6
6
|
declare const MenuPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").MenuPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
@@ -27,6 +27,16 @@ declare const MenuItem: ({ className, inset, variant, ...props }: Menu$1.Item.Pr
|
|
|
27
27
|
inset?: boolean;
|
|
28
28
|
variant?: "default" | "destructive";
|
|
29
29
|
}) => React$1.JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* A menu row that navigates: an `<a>` with the item's look, so it opens in a
|
|
32
|
+
* new tab on a modified click, shows its URL on hover and is announced as a
|
|
33
|
+
* link. Use it for "Open in new tab", "View invoice", help pages; a `MenuItem`
|
|
34
|
+
* with an `onClick` that navigates loses all of that. Pass a router link
|
|
35
|
+
* through `render` to keep client-side navigation.
|
|
36
|
+
*/
|
|
37
|
+
declare const MenuLinkItem: ({ className, inset, ...props }: Menu$1.LinkItem.Props & {
|
|
38
|
+
inset?: boolean;
|
|
39
|
+
}) => React$1.JSX.Element;
|
|
30
40
|
declare const MenuCheckboxItem: ({ className, children, checked, variant, ...props }: Menu$1.CheckboxItem.Props & {
|
|
31
41
|
variant?: "default" | "switch";
|
|
32
42
|
}) => React$1.JSX.Element;
|
|
@@ -38,7 +48,12 @@ declare const MenuGroupLabel: ({ className, inset, ...props }: Menu$1.GroupLabel
|
|
|
38
48
|
inset?: boolean;
|
|
39
49
|
}) => React$1.JSX.Element;
|
|
40
50
|
declare const MenuSeparator: ({ className, ...props }: Menu$1.Separator.Props) => React$1.JSX.Element;
|
|
41
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The shortcut at the end of a menu row. Pass `keys` (`["mod", "K"]`) to have
|
|
53
|
+
* it spelled for the reader's platform; see `Kbd`. It is the `plain` `Kbd`,
|
|
54
|
+
* with no key-cap box, which would crowd a row of labels.
|
|
55
|
+
*/
|
|
56
|
+
declare const MenuShortcut: ({ className, ...props }: Omit<React$1.ComponentProps<typeof Kbd>, "variant">) => React$1.JSX.Element;
|
|
42
57
|
declare const MenuSub: (props: Menu$1.SubmenuRoot.Props) => React$1.JSX.Element;
|
|
43
58
|
declare const MenuSubTrigger: ({ className, inset, children, ...props }: Menu$1.SubmenuTrigger.Props & {
|
|
44
59
|
inset?: boolean;
|
|
@@ -50,5 +65,4 @@ declare const MenuSubPopup: ({ className, sideOffset, alignOffset, align, ...pro
|
|
|
50
65
|
sideOffset?: Menu$1.Positioner.Props["sideOffset"];
|
|
51
66
|
alignOffset?: Menu$1.Positioner.Props["alignOffset"];
|
|
52
67
|
}) => React$1.JSX.Element;
|
|
53
|
-
|
|
54
|
-
export { Menu as DropdownMenu, Menu, MenuCheckboxItem as DropdownMenuCheckboxItem, MenuCheckboxItem, MenuPopup as DropdownMenuContent, MenuPopup, MenuCreateHandle as DropdownMenuCreateHandle, MenuCreateHandle, MenuGroup as DropdownMenuGroup, MenuGroup, MenuItem as DropdownMenuItem, MenuItem, MenuGroupLabel as DropdownMenuLabel, MenuGroupLabel, MenuPortal as DropdownMenuPortal, MenuPortal, MenuRadioGroup as DropdownMenuRadioGroup, MenuRadioGroup, MenuRadioItem as DropdownMenuRadioItem, MenuRadioItem, MenuSeparator as DropdownMenuSeparator, MenuSeparator, MenuShortcut as DropdownMenuShortcut, MenuShortcut, MenuSub as DropdownMenuSub, MenuSub, MenuSubPopup as DropdownMenuSubContent, MenuSubPopup, MenuSubTrigger as DropdownMenuSubTrigger, MenuSubTrigger, MenuTrigger as DropdownMenuTrigger, MenuTrigger, MenuAnchor };
|
|
68
|
+
export { Menu as DropdownMenu, Menu, MenuCheckboxItem as DropdownMenuCheckboxItem, MenuCheckboxItem, MenuPopup as DropdownMenuContent, MenuPopup, MenuCreateHandle as DropdownMenuCreateHandle, MenuCreateHandle, MenuGroup as DropdownMenuGroup, MenuGroup, MenuItem as DropdownMenuItem, MenuItem, MenuGroupLabel as DropdownMenuLabel, MenuGroupLabel, MenuLinkItem as DropdownMenuLinkItem, MenuLinkItem, MenuPortal as DropdownMenuPortal, MenuPortal, MenuRadioGroup as DropdownMenuRadioGroup, MenuRadioGroup, MenuRadioItem as DropdownMenuRadioItem, MenuRadioItem, MenuSeparator as DropdownMenuSeparator, MenuSeparator, MenuShortcut as DropdownMenuShortcut, MenuShortcut, MenuSub as DropdownMenuSub, MenuSub, MenuSubPopup as DropdownMenuSubContent, MenuSubPopup, MenuSubTrigger as DropdownMenuSubTrigger, MenuSubTrigger, MenuTrigger as DropdownMenuTrigger, MenuTrigger, MenuAnchor };
|
package/dist/components/menu.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import { ChevronRightIcon } from "../icons.js";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
import { OVERLAY_LAYER_CLASS_NAMES } from "../lib/overlay-layer.js";
|
|
5
|
+
import { Kbd } from "./kbd.js";
|
|
5
6
|
import { renderTooltipTrigger } from "./tooltip-trigger-helper.js";
|
|
6
7
|
import { DirectionalIcon } from "./directional-icon.js";
|
|
7
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
9
|
-
|
|
10
|
+
// src/components/menu.tsx
|
|
10
11
|
const MenuCreateHandle = Menu$1.createHandle;
|
|
11
12
|
const Menu = Menu$1.Root;
|
|
12
13
|
const MenuPortal = Menu$1.Portal;
|
|
@@ -50,13 +51,27 @@ const MenuGroup = (props) => /* @__PURE__ */ jsx(Menu$1.Group, {
|
|
|
50
51
|
"data-slot": "menu-group",
|
|
51
52
|
...props
|
|
52
53
|
});
|
|
54
|
+
const MENU_ITEM_CLASS_NAME = "text-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive-foreground flex min-h-8 cursor-pointer items-center gap-2 rounded-sm px-2 py-1 text-base outline-none select-none data-disabled:pointer-events-none data-disabled:opacity-64 data-inset:ps-8 sm:min-h-7 sm:text-sm pointer-coarse:min-h-11 [&>svg]:pointer-events-none [&>svg]:-mx-0.5 [&>svg]:shrink-0 [&>svg:not([class*='opacity-'])]:opacity-80 [&>svg:not([class*='size-'])]:size-4.5 sm:[&>svg:not([class*='size-'])]:size-4";
|
|
53
55
|
const MenuItem = ({ className, inset, variant = "default", ...props }) => /* @__PURE__ */ jsx(Menu$1.Item, {
|
|
54
|
-
className: cn(
|
|
56
|
+
className: cn(MENU_ITEM_CLASS_NAME, className),
|
|
55
57
|
"data-inset": inset,
|
|
56
58
|
"data-slot": "menu-item",
|
|
57
59
|
"data-variant": variant,
|
|
58
60
|
...props
|
|
59
61
|
});
|
|
62
|
+
/**
|
|
63
|
+
* A menu row that navigates: an `<a>` with the item's look, so it opens in a
|
|
64
|
+
* new tab on a modified click, shows its URL on hover and is announced as a
|
|
65
|
+
* link. Use it for "Open in new tab", "View invoice", help pages; a `MenuItem`
|
|
66
|
+
* with an `onClick` that navigates loses all of that. Pass a router link
|
|
67
|
+
* through `render` to keep client-side navigation.
|
|
68
|
+
*/
|
|
69
|
+
const MenuLinkItem = ({ className, inset, ...props }) => /* @__PURE__ */ jsx(Menu$1.LinkItem, {
|
|
70
|
+
className: cn(MENU_ITEM_CLASS_NAME, className),
|
|
71
|
+
"data-inset": inset,
|
|
72
|
+
"data-slot": "menu-link-item",
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
60
75
|
const MenuCheckboxItem = ({ className, children, checked, variant = "default", ...props }) => /* @__PURE__ */ jsx(Menu$1.CheckboxItem, {
|
|
61
76
|
checked,
|
|
62
77
|
className: cn("text-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground grid min-h-8 cursor-pointer items-center gap-2 rounded-sm py-1 ps-2 text-base outline-none in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] data-disabled:pointer-events-none data-disabled:opacity-64 sm:min-h-7 sm:text-sm pointer-coarse:min-h-11 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4", variant === "switch" ? "grid-cols-[1fr_auto] gap-4 pe-1.5" : "grid-cols-[1rem_minmax(0,1fr)] pe-4", className),
|
|
@@ -126,10 +141,16 @@ const MenuSeparator = ({ className, ...props }) => /* @__PURE__ */ jsx(Menu$1.Se
|
|
|
126
141
|
"data-slot": "menu-separator",
|
|
127
142
|
...props
|
|
128
143
|
});
|
|
129
|
-
|
|
130
|
-
|
|
144
|
+
/**
|
|
145
|
+
* The shortcut at the end of a menu row. Pass `keys` (`["mod", "K"]`) to have
|
|
146
|
+
* it spelled for the reader's platform; see `Kbd`. It is the `plain` `Kbd`,
|
|
147
|
+
* with no key-cap box, which would crowd a row of labels.
|
|
148
|
+
*/
|
|
149
|
+
const MenuShortcut = ({ className, ...props }) => /* @__PURE__ */ jsx(Kbd, {
|
|
150
|
+
className: cn("ms-auto", className),
|
|
131
151
|
"data-slot": "menu-shortcut",
|
|
132
|
-
...props
|
|
152
|
+
...props,
|
|
153
|
+
variant: "plain"
|
|
133
154
|
});
|
|
134
155
|
const MenuSub = (props) => /* @__PURE__ */ jsx(Menu$1.SubmenuRoot, {
|
|
135
156
|
"data-slot": "menu-sub",
|
|
@@ -156,5 +177,4 @@ const MenuSubPopup = ({ className, sideOffset = 0, alignOffset, align = "start",
|
|
|
156
177
|
...props
|
|
157
178
|
});
|
|
158
179
|
};
|
|
159
|
-
|
|
160
|
-
export { Menu as DropdownMenu, Menu, MenuCheckboxItem as DropdownMenuCheckboxItem, MenuCheckboxItem, MenuPopup as DropdownMenuContent, MenuPopup, MenuCreateHandle as DropdownMenuCreateHandle, MenuCreateHandle, MenuGroup as DropdownMenuGroup, MenuGroup, MenuItem as DropdownMenuItem, MenuItem, MenuGroupLabel as DropdownMenuLabel, MenuGroupLabel, MenuPortal as DropdownMenuPortal, MenuPortal, MenuRadioGroup as DropdownMenuRadioGroup, MenuRadioGroup, MenuRadioItem as DropdownMenuRadioItem, MenuRadioItem, MenuSeparator as DropdownMenuSeparator, MenuSeparator, MenuShortcut as DropdownMenuShortcut, MenuShortcut, MenuSub as DropdownMenuSub, MenuSub, MenuSubPopup as DropdownMenuSubContent, MenuSubPopup, MenuSubTrigger as DropdownMenuSubTrigger, MenuSubTrigger, MenuTrigger as DropdownMenuTrigger, MenuTrigger, MenuAnchor };
|
|
180
|
+
export { Menu as DropdownMenu, Menu, MenuCheckboxItem as DropdownMenuCheckboxItem, MenuCheckboxItem, MenuPopup as DropdownMenuContent, MenuPopup, MenuCreateHandle as DropdownMenuCreateHandle, MenuCreateHandle, MenuGroup as DropdownMenuGroup, MenuGroup, MenuItem as DropdownMenuItem, MenuItem, MenuGroupLabel as DropdownMenuLabel, MenuGroupLabel, MenuLinkItem as DropdownMenuLinkItem, MenuLinkItem, MenuPortal as DropdownMenuPortal, MenuPortal, MenuRadioGroup as DropdownMenuRadioGroup, MenuRadioGroup, MenuRadioItem as DropdownMenuRadioItem, MenuRadioItem, MenuSeparator as DropdownMenuSeparator, MenuSeparator, MenuShortcut as DropdownMenuShortcut, MenuShortcut, MenuSub as DropdownMenuSub, MenuSub, MenuSubPopup as DropdownMenuSubContent, MenuSubPopup, MenuSubTrigger as DropdownMenuSubTrigger, MenuSubTrigger, MenuTrigger as DropdownMenuTrigger, MenuTrigger, MenuAnchor };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/middle-truncate.d.ts
|
|
2
1
|
type MiddleTruncateProps = {
|
|
3
2
|
value: string;
|
|
4
3
|
className?: string;
|
|
@@ -15,5 +14,4 @@ type MiddleTruncateProps = {
|
|
|
15
14
|
* text: the element's text and accessible name stay the full value.
|
|
16
15
|
*/
|
|
17
16
|
export declare const MiddleTruncate: ({ value, className }: MiddleTruncateProps) => import("react").JSX.Element;
|
|
18
|
-
//#endregion
|
|
19
17
|
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { graphemesOf, splitForMiddleTruncate } from "./middle-truncate.logic.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components/middle-truncate.tsx
|
|
6
6
|
/**
|
|
7
7
|
* One line of text that, when it does not fit, gives up its middle and keeps
|
|
8
8
|
* its end: `Smlouva o dílo – revize…klienta.docx`. For names whose end tells
|
|
@@ -108,5 +108,4 @@ function fitHead(head) {
|
|
|
108
108
|
head.style.clipPath = rtl ? `inset(-0.25em 0 -0.25em ${String(slack)}px)` : `inset(-0.25em ${String(slack)}px -0.25em 0)`;
|
|
109
109
|
tail.style.translate = `${String(rtl ? slack : -slack)}px 0`;
|
|
110
110
|
}
|
|
111
|
-
//#endregion
|
|
112
111
|
export { MiddleTruncate };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/middle-truncate.logic.d.ts
|
|
2
1
|
/** The value's user-perceived characters, so a cut never splits one. */
|
|
3
2
|
export declare const graphemesOf: (value: string) => string[];
|
|
4
3
|
type MiddleTruncateSplit = {
|
|
@@ -7,5 +6,4 @@ type MiddleTruncateSplit = {
|
|
|
7
6
|
};
|
|
8
7
|
/** The head and tail of `value`, or null when it should stay in one piece. */
|
|
9
8
|
export declare const splitForMiddleTruncate: (value: string) => MiddleTruncateSplit | null;
|
|
10
|
-
//#endregion
|
|
11
9
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/middle-truncate.logic.ts
|
|
2
2
|
/** The tail aimed for, in graphemes; a word start nearby moves it. */
|
|
3
3
|
const TAIL = 10;
|
|
4
4
|
/** The shortest tail a word start may shrink it to. */
|
|
@@ -59,5 +59,4 @@ function tailStart(characters) {
|
|
|
59
59
|
for (let index = aimed - 1; index >= longest; index--) if (startsWord(index)) return index;
|
|
60
60
|
return aimed;
|
|
61
61
|
}
|
|
62
|
-
//#endregion
|
|
63
62
|
export { graphemesOf, splitForMiddleTruncate };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ControlSize } from "../lib/control-size.js";
|
|
2
2
|
import { NumberField } from "@base-ui/react/number-field";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
|
-
//#region src/components/number-input.d.ts
|
|
5
4
|
type NumberInputProps = Omit<NumberField.Root.Props, "children" | "className" | "render"> & {
|
|
6
5
|
className?: string;
|
|
7
6
|
inputClassName?: string;
|
|
@@ -20,5 +19,4 @@ type NumberInputProps = Omit<NumberField.Root.Props, "children" | "className" |
|
|
|
20
19
|
* formatting and clamping happen only at Base UI's commit boundaries.
|
|
21
20
|
*/
|
|
22
21
|
declare const NumberInput: ({ className, inputClassName, inputProps, dir, size, suffix, ...props }: NumberInputProps) => import("react").JSX.Element;
|
|
23
|
-
//#endregion
|
|
24
22
|
export { NumberInput, type NumberInputProps };
|
|
@@ -4,7 +4,7 @@ import { CONTROL_SIZE } from "../lib/control-size.js";
|
|
|
4
4
|
import { INPUT_CONTROL_CLASS_NAME, INPUT_ELEMENT_CLASS_NAME, INPUT_SIZE_CLASS_NAMES } from "./input-control.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { NumberField } from "@base-ui/react/number-field";
|
|
7
|
-
|
|
7
|
+
// src/components/number-input.tsx
|
|
8
8
|
/**
|
|
9
9
|
* A numeric control that keeps the user's editable text separate from its
|
|
10
10
|
* canonical numeric value. Parsed changes are reported through `onValueChange`;
|
|
@@ -35,5 +35,4 @@ const NumberInput = ({ className, inputClassName, inputProps, dir = "ltr", size
|
|
|
35
35
|
children: suffix
|
|
36
36
|
})]
|
|
37
37
|
});
|
|
38
|
-
//#endregion
|
|
39
38
|
export { NumberInput };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReactNode, RefObject } from "react";
|
|
2
|
-
//#region src/components/outline-rail.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* How prominently an entry reads next to the entries around it. A caller
|
|
5
4
|
* that ranks its entries (a list of search results) steps the near-misses
|
|
@@ -26,6 +25,17 @@ export type OutlineItem = {
|
|
|
26
25
|
color?: string;
|
|
27
26
|
/** How prominently the row reads. Defaults to `primary`. */
|
|
28
27
|
emphasis?: OutlineEmphasis;
|
|
28
|
+
/** The people the entry is about. Its tick stays a tick and shows them on
|
|
29
|
+
* hover or focus; an entry with people stays on the rail however dense the
|
|
30
|
+
* outline gets. */
|
|
31
|
+
portraits?: readonly OutlinePortrait[];
|
|
32
|
+
/** Where the portraits come from, said under them in the tick's card. */
|
|
33
|
+
portraitCredit?: string;
|
|
34
|
+
};
|
|
35
|
+
/** A person an entry is about; `image` null draws their initials. */
|
|
36
|
+
export type OutlinePortrait = {
|
|
37
|
+
image: string | null;
|
|
38
|
+
name: string;
|
|
29
39
|
};
|
|
30
40
|
export type OutlineRailProps = {
|
|
31
41
|
items: OutlineItem[];
|
|
@@ -59,5 +69,4 @@ export type OutlineRailProps = {
|
|
|
59
69
|
export declare const OUTLINE_CONTROL_MIN_SIZE = 32;
|
|
60
70
|
/** The entry as one line of text: label, then its title when it has one. */
|
|
61
71
|
export declare const outlineEntryText: (item: OutlineItem) => string;
|
|
62
|
-
export declare const OutlineRail: ({ items: itemsProp, scrollContainerRef, resolvePct, onJump, activeId, header, formatMetaLabel, collapsedFromLevel, presentation, bottomInset, topOffset, panelWidth, ariaLabel }: OutlineRailProps) => import("react").JSX.Element | null;
|
|
63
|
-
//#endregion
|
|
72
|
+
export declare const OutlineRail: ({ items: itemsProp, scrollContainerRef, resolvePct, onJump, activeId, header, formatMetaLabel, collapsedFromLevel, presentation, bottomInset, topOffset, panelWidth, ariaLabel }: OutlineRailProps) => import("react").JSX.Element | null;
|
|
@@ -5,11 +5,12 @@ import { Tooltip, TooltipContent as TooltipPopup, TooltipTrigger } from "./toolt
|
|
|
5
5
|
import { ScrollArea } from "./scroll-area.js";
|
|
6
6
|
import { DirectionalIcon } from "./directional-icon.js";
|
|
7
7
|
import "../lib/panel-inset.js";
|
|
8
|
+
import { ReviewAuthorAvatar } from "../review/review-author-avatar.js";
|
|
8
9
|
import { reconcileOutlineItems, retainOutlineIdSet } from "./outline-rail.logic.js";
|
|
9
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
import { memo, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
11
12
|
import { Temporal } from "temporal-polyfill/full";
|
|
12
|
-
|
|
13
|
+
// src/components/outline-rail.tsx
|
|
13
14
|
/**
|
|
14
15
|
* Outline navigation: an embedded panel, a host-owned rail, or a disclosure.
|
|
15
16
|
*
|
|
@@ -43,6 +44,46 @@ const HOVER_OPEN_DWELL_MS = 150;
|
|
|
43
44
|
const ACTIVE_ROW_ATTRIBUTE = "data-outline-active";
|
|
44
45
|
/** The entry as one line of text: label, then its title when it has one. */
|
|
45
46
|
const outlineEntryText = (item) => item.title === void 0 ? item.label : `${item.label} ${item.title}`;
|
|
47
|
+
const MAX_ROW_PORTRAITS = 3;
|
|
48
|
+
const HEAD_FRAME_CLASS = "[&_img]:origin-[50%_26%] [&_img]:scale-200 [&_img]:object-top";
|
|
49
|
+
/** A row's faces, decorative: the row's text carries the names. */
|
|
50
|
+
const OutlineRowPortraits = ({ portraits }) => /* @__PURE__ */ jsx("span", {
|
|
51
|
+
"aria-hidden": true,
|
|
52
|
+
className: "me-1.5 flex shrink-0 -space-x-1.5 rtl:space-x-reverse",
|
|
53
|
+
children: portraits.slice(0, MAX_ROW_PORTRAITS).map((portrait) => /* @__PURE__ */ jsx(ReviewAuthorAvatar, {
|
|
54
|
+
className: cn("ring-background size-6 ring-2", HEAD_FRAME_CLASS),
|
|
55
|
+
fallbackClassName: "text-[10px]",
|
|
56
|
+
image: portrait.image,
|
|
57
|
+
name: portrait.name
|
|
58
|
+
}, portrait.name))
|
|
59
|
+
});
|
|
60
|
+
/** What a tick with people opens: each of them, face and name. The tick's
|
|
61
|
+
* accessible name already says all this, so the card adds only the faces. */
|
|
62
|
+
const OutlinePeopleCard = ({ credit, portraits, title }) => /* @__PURE__ */ jsxs("span", {
|
|
63
|
+
className: "flex max-w-64 flex-col gap-2 py-1",
|
|
64
|
+
children: [
|
|
65
|
+
title !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
66
|
+
className: "text-muted-foreground",
|
|
67
|
+
children: title
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ jsx("span", {
|
|
70
|
+
className: "flex flex-col gap-2",
|
|
71
|
+
children: portraits.map((portrait) => /* @__PURE__ */ jsxs("span", {
|
|
72
|
+
className: "flex items-center gap-2 font-medium",
|
|
73
|
+
children: [/* @__PURE__ */ jsx(ReviewAuthorAvatar, {
|
|
74
|
+
"aria-hidden": true,
|
|
75
|
+
className: cn("size-10", HEAD_FRAME_CLASS),
|
|
76
|
+
image: portrait.image,
|
|
77
|
+
name: portrait.name
|
|
78
|
+
}), portrait.name]
|
|
79
|
+
}, portrait.name))
|
|
80
|
+
}),
|
|
81
|
+
credit !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
82
|
+
className: "text-muted-foreground text-2xs",
|
|
83
|
+
children: credit
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
});
|
|
46
87
|
const tickWidth = (level) => {
|
|
47
88
|
return TICK_BASE_WIDTH + (TICK_MAX_LEVEL - Math.min(Math.max(level, 0), TICK_MAX_LEVEL)) * TICK_LEVEL_STEP;
|
|
48
89
|
};
|
|
@@ -119,6 +160,7 @@ const OutlineRowView = ({ item, hasChildren, isCollapsed, isActive, isHovered, i
|
|
|
119
160
|
className: "me-1.5 size-1.5 shrink-0 rounded-full",
|
|
120
161
|
style: { background: `var(${item.color})` }
|
|
121
162
|
}),
|
|
163
|
+
item.portraits !== void 0 && /* @__PURE__ */ jsx(OutlineRowPortraits, { portraits: item.portraits }),
|
|
122
164
|
/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
123
165
|
render: /* @__PURE__ */ jsx("button", {
|
|
124
166
|
"aria-current": isActive ? "true" : void 0,
|
|
@@ -392,12 +434,13 @@ const OutlineRail = ({ items: itemsProp, scrollContainerRef, resolvePct, onJump,
|
|
|
392
434
|
}, []);
|
|
393
435
|
const visibleTicks = items.flatMap((item) => {
|
|
394
436
|
const pct = pctById.get(item.id);
|
|
395
|
-
return pct !== void 0 && item.level <= railLevelCap ? [{
|
|
437
|
+
return pct !== void 0 && (item.portraits !== void 0 || item.level <= railLevelCap) ? [{
|
|
396
438
|
item,
|
|
397
439
|
pct
|
|
398
440
|
}] : [];
|
|
399
441
|
});
|
|
400
|
-
|
|
442
|
+
const hasPanel = items.length >= 2 || header !== void 0;
|
|
443
|
+
if (!hasPanel && !items.some((item) => item.portraits !== void 0)) return null;
|
|
401
444
|
const visibleTickIds = new Set(visibleTicks.map(({ item }) => item.id));
|
|
402
445
|
const ghostPct = hoveredId !== null && !visibleTickIds.has(hoveredId) ? pctById.get(hoveredId) : void 0;
|
|
403
446
|
const ghostItem = ghostPct === void 0 ? void 0 : items.find((item) => item.id === hoveredId);
|
|
@@ -428,14 +471,16 @@ const OutlineRail = ({ items: itemsProp, scrollContainerRef, resolvePct, onJump,
|
|
|
428
471
|
children: [visibleTicks.map(({ item, pct }) => {
|
|
429
472
|
const isActive = active === item.id;
|
|
430
473
|
const isHovered = hoveredId === item.id;
|
|
474
|
+
const portraits = item.portraits;
|
|
475
|
+
const tickLabel = portraits === void 0 ? item.label : outlineEntryText(item);
|
|
431
476
|
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx("button", {
|
|
432
|
-
...presentation === "popover" ? {
|
|
477
|
+
...presentation === "popover" && hasPanel ? {
|
|
433
478
|
"aria-controls": panelId,
|
|
434
479
|
"aria-expanded": panelOpen
|
|
435
480
|
} : {},
|
|
436
481
|
"aria-current": isActive ? "true" : void 0,
|
|
437
|
-
"aria-label":
|
|
438
|
-
className: cn("absolute end-0 rounded-full transition-[width,height,opacity] duration-150", isHovered || isActive ? "opacity-100" : "opacity-45 hover:opacity-90"),
|
|
482
|
+
"aria-label": tickLabel,
|
|
483
|
+
className: cn("absolute end-0 rounded-full transition-[width,height,opacity] duration-150", isHovered || isActive ? "opacity-100" : "opacity-45 hover:opacity-90", portraits !== void 0 && "focus-visible:outline-ring z-10 after:absolute after:-inset-x-2 after:-inset-y-2.5 focus-visible:outline-2 focus-visible:outline-offset-2 pointer-coarse:after:-inset-x-3.5 pointer-coarse:after:-inset-y-5"),
|
|
439
484
|
onBlur: (event) => {
|
|
440
485
|
if (!railRef.current?.contains(event.relatedTarget)) closePanel();
|
|
441
486
|
},
|
|
@@ -457,7 +502,15 @@ const OutlineRail = ({ items: itemsProp, scrollContainerRef, resolvePct, onJump,
|
|
|
457
502
|
background: tickBackground(item.color, isHovered)
|
|
458
503
|
},
|
|
459
504
|
type: "button"
|
|
460
|
-
}) }), /* @__PURE__ */ jsx(TooltipPopup, { children: item.label })
|
|
505
|
+
}) }), portraits === void 0 ? /* @__PURE__ */ jsx(TooltipPopup, { children: item.label }) : /* @__PURE__ */ jsx(TooltipPopup, {
|
|
506
|
+
side: "inline-start",
|
|
507
|
+
sideOffset: presentation === "popover" && hasPanel ? 44 + panelWidth - tickWidth(item.level) : void 0,
|
|
508
|
+
children: /* @__PURE__ */ jsx(OutlinePeopleCard, {
|
|
509
|
+
credit: item.portraitCredit,
|
|
510
|
+
portraits,
|
|
511
|
+
title: item.title
|
|
512
|
+
})
|
|
513
|
+
})] }, item.id);
|
|
461
514
|
}), ghostItem && ghostPct !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
462
515
|
"aria-hidden": true,
|
|
463
516
|
className: "absolute end-0 rounded-full opacity-100",
|
|
@@ -469,7 +522,7 @@ const OutlineRail = ({ items: itemsProp, scrollContainerRef, resolvePct, onJump,
|
|
|
469
522
|
background: ghostItem.color ? `var(${ghostItem.color})` : "var(--option-blue)"
|
|
470
523
|
}
|
|
471
524
|
})]
|
|
472
|
-
}), presentation !== "rail" && /* @__PURE__ */ jsxs("nav", {
|
|
525
|
+
}), presentation !== "rail" && hasPanel && /* @__PURE__ */ jsxs("nav", {
|
|
473
526
|
"aria-label": ariaLabel,
|
|
474
527
|
"aria-hidden": !panelOpen,
|
|
475
528
|
id: panelId,
|
|
@@ -541,5 +594,4 @@ function outlinePanelVisibilityClass(presentation, open) {
|
|
|
541
594
|
if (presentation === "panel") return "flex-1";
|
|
542
595
|
return open ? "translate-x-0 opacity-100" : "pointer-events-none translate-x-2 opacity-0";
|
|
543
596
|
}
|
|
544
|
-
//#endregion
|
|
545
597
|
export { OUTLINE_CONTROL_MIN_SIZE, OUTLINE_EMPHASIS, OutlineRail, outlineEntryText };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { OutlineItem } from "./outline-rail.js";
|
|
2
|
-
//#region src/components/outline-rail.logic.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* `next` with every entry whose content `previous` already holds under the
|
|
5
4
|
* same id replaced by that earlier object, and `previous` itself when nothing
|
|
@@ -22,5 +21,4 @@ type RetainKnownIdsOptions = {
|
|
|
22
21
|
* seen for the first time gets `seed`, and a removed entry drops out.
|
|
23
22
|
*/
|
|
24
23
|
export declare const retainOutlineIdSet: ({ ids, knownIds, seed, items }: RetainKnownIdsOptions) => ReadonlySet<string>;
|
|
25
|
-
//#endregion
|
|
26
24
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/outline-rail.logic.ts
|
|
2
2
|
const OUTLINE_ITEM_EQUALS = Object.values({
|
|
3
3
|
id: (a, b) => a.id === b.id,
|
|
4
4
|
label: (a, b) => a.label === b.label,
|
|
@@ -6,7 +6,12 @@ const OUTLINE_ITEM_EQUALS = Object.values({
|
|
|
6
6
|
level: (a, b) => a.level === b.level,
|
|
7
7
|
meta: (a, b) => a.meta === b.meta,
|
|
8
8
|
color: (a, b) => a.color === b.color,
|
|
9
|
-
emphasis: (a, b) => a.emphasis === b.emphasis
|
|
9
|
+
emphasis: (a, b) => a.emphasis === b.emphasis,
|
|
10
|
+
portraits: (a, b) => a.portraits?.length === b.portraits?.length && (a.portraits ?? []).every((portrait, index) => {
|
|
11
|
+
const other = b.portraits?.[index];
|
|
12
|
+
return other !== void 0 && other.image === portrait.image && other.name === portrait.name;
|
|
13
|
+
}),
|
|
14
|
+
portraitCredit: (a, b) => a.portraitCredit === b.portraitCredit
|
|
10
15
|
});
|
|
11
16
|
const sameOutlineItem = (a, b) => OUTLINE_ITEM_EQUALS.every((equals) => equals(a, b));
|
|
12
17
|
/**
|
|
@@ -36,5 +41,4 @@ const retainOutlineIdSet = ({ ids, knownIds, seed, items }) => {
|
|
|
36
41
|
for (const item of items) if (knownIds.has(item.id) ? ids.has(item.id) : seed(item)) next.add(item.id);
|
|
37
42
|
return next.size === ids.size && [...next].every((id) => ids.has(id)) ? ids : next;
|
|
38
43
|
};
|
|
39
|
-
//#endregion
|
|
40
44
|
export { reconcileOutlineItems, retainOutlineIdSet };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import { Button } from "./button.js";
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
-
//#region src/components/pagination.d.ts
|
|
5
4
|
declare const Pagination: ({ className, ...props }: React$1.ComponentProps<"nav">) => React$1.JSX.Element;
|
|
6
5
|
declare const PaginationContent: ({ className, ...props }: React$1.ComponentProps<"ul">) => React$1.JSX.Element;
|
|
7
6
|
declare const PaginationItem: ({ ...props }: React$1.ComponentProps<"li">) => React$1.JSX.Element;
|
|
@@ -13,5 +12,4 @@ declare function PaginationLink({ className, isActive, size, render, ...props }:
|
|
|
13
12
|
declare const PaginationPrevious: ({ className, ...props }: React$1.ComponentProps<typeof PaginationLink>) => React$1.JSX.Element;
|
|
14
13
|
declare const PaginationNext: ({ className, ...props }: React$1.ComponentProps<typeof PaginationLink>) => React$1.JSX.Element;
|
|
15
14
|
declare const PaginationEllipsis: ({ className, ...props }: React$1.ComponentProps<"span">) => React$1.JSX.Element;
|
|
16
|
-
//#endregion
|
|
17
15
|
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|