@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
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/court-badge.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* How a court's abbreviation is drawn: a firm edge for the apex, then lighter
|
|
4
3
|
* treatments down the instances.
|
|
@@ -30,5 +29,4 @@ type CourtBadgeProps = {
|
|
|
30
29
|
* abbreviates gets no chip.
|
|
31
30
|
*/
|
|
32
31
|
export declare const CourtBadge: ({ abbreviation, className, size, weight }: CourtBadgeProps) => import("react").JSX.Element;
|
|
33
|
-
//#endregion
|
|
34
32
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/components/court-badge.tsx
|
|
4
4
|
const COURT_BADGE_BASE_CLASS = "inline-flex shrink-0 items-center rounded-sm border font-mono font-semibold tracking-wide whitespace-nowrap";
|
|
5
5
|
/**
|
|
6
6
|
* The line box runs a third taller than the type, because these capitals
|
|
@@ -47,5 +47,4 @@ const CourtBadge = ({ abbreviation, className, size = "default", weight }) => /*
|
|
|
47
47
|
dir: "ltr",
|
|
48
48
|
children: abbreviation
|
|
49
49
|
});
|
|
50
|
-
//#endregion
|
|
51
50
|
export { CourtBadge };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/court-filter.d.ts
|
|
2
1
|
type CourtOption = {
|
|
3
2
|
value: string;
|
|
4
3
|
label?: string;
|
|
@@ -38,5 +37,4 @@ export declare const toggleCourtSelection: (selected: readonly string[], values:
|
|
|
38
37
|
*/
|
|
39
38
|
export declare const MultipleCourtFilter: (options: MultipleCourtFilterProps) => import("react").JSX.Element;
|
|
40
39
|
export declare const SingleCourtFilter: (props: SingleCourtFilterProps) => import("react").JSX.Element;
|
|
41
|
-
//#endregion
|
|
42
40
|
export {};
|
|
@@ -9,7 +9,7 @@ import { Field, FieldLabel } from "./field.js";
|
|
|
9
9
|
import { SearchField } from "./search-field.js";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useId, useState } from "react";
|
|
12
|
-
|
|
12
|
+
// src/components/court-filter.tsx
|
|
13
13
|
const toggleCourtSelection = (selected, values) => {
|
|
14
14
|
return values.every((value) => selected.includes(value)) ? selected.filter((value) => !values.includes(value)) : [.../* @__PURE__ */ new Set([...selected, ...values])];
|
|
15
15
|
};
|
|
@@ -206,5 +206,4 @@ const SingleCourtFilter = (props) => /* @__PURE__ */ jsx("div", {
|
|
|
206
206
|
options: props
|
|
207
207
|
}, group.value))
|
|
208
208
|
});
|
|
209
|
-
//#endregion
|
|
210
209
|
export { MultipleCourtFilter, SingleCourtFilter, toggleCourtSelection };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DatePickerMode } from "./date-picker-popover.logic.js";
|
|
2
2
|
import { OverlayLayer } from "../lib/overlay-layer.js";
|
|
3
|
-
//#region src/components/date-picker-popover.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* `compact` keeps the dense 32px day cells everywhere. `touch` grows day,
|
|
6
5
|
* month, and year cells to 44px targets under a coarse pointer and leaves a
|
|
@@ -75,5 +74,4 @@ type DatePickerPopoverProps = {
|
|
|
75
74
|
layer?: OverlayLayer;
|
|
76
75
|
};
|
|
77
76
|
declare const DatePickerPopover: (props: DatePickerPopoverProps) => import("react").JSX.Element;
|
|
78
|
-
//#endregion
|
|
79
77
|
export { DatePickerPopover, type DatePickerPopoverProps };
|
|
@@ -6,14 +6,14 @@ import { DirectionalIcon } from "./directional-icon.js";
|
|
|
6
6
|
import { FIELD_TRIGGER_CLASS_NAME } from "../lib/field-trigger.js";
|
|
7
7
|
import { Input } from "./input.js";
|
|
8
8
|
import { getLocaleWeekInfo, getWeekendDays } from "../lib/week.js";
|
|
9
|
-
import { DATE_PICKER_MODE, formatDateTimeValue,
|
|
9
|
+
import { DATE_PICKER_MODE, formatDateTimeValue, joinPickerTime, localDateFromTimestamp, millisecondsUntilNextLocalDate, parseDateTimeValue, resolveCalendarViewMonth, shiftCalendarDate } from "./date-picker-popover.logic.js";
|
|
10
10
|
import { Popover, PopoverContent as PopoverPopup, PopoverTrigger } from "./popover.js";
|
|
11
|
-
import {
|
|
11
|
+
import { TimeField } from "./time-field.js";
|
|
12
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
14
14
|
import { Result, panic } from "better-result";
|
|
15
15
|
import { Temporal } from "temporal-polyfill/full";
|
|
16
|
-
|
|
16
|
+
// src/components/date-picker-popover.tsx
|
|
17
17
|
const toISODate = (date) => date.toString();
|
|
18
18
|
const toUTCDateTime = (date) => date.toZonedDateTime({
|
|
19
19
|
plainTime: Temporal.PlainTime.from("00:00"),
|
|
@@ -552,6 +552,7 @@ const DatePickerPopoverContent = (props) => {
|
|
|
552
552
|
today
|
|
553
553
|
}),
|
|
554
554
|
selection.mode === DATE_PICKER_MODE.dateTime && /* @__PURE__ */ jsx(TimeField, {
|
|
555
|
+
className: "mt-1 border-t pt-1",
|
|
555
556
|
disabled: value === "",
|
|
556
557
|
label: labels.time,
|
|
557
558
|
locale,
|
|
@@ -638,70 +639,6 @@ const PickerHeader = ({ headingClassName, label, labels, onHeadingClick, onNext,
|
|
|
638
639
|
]
|
|
639
640
|
});
|
|
640
641
|
};
|
|
641
|
-
/**
|
|
642
|
-
* Hour and minute selects in the locale's own clock and numerals. Inert
|
|
643
|
-
* until a day is picked, since a time alone is not a value.
|
|
644
|
-
*/
|
|
645
|
-
const TimeField = ({ disabled, label, locale, onChange, time }) => {
|
|
646
|
-
const labelId = useId();
|
|
647
|
-
const hourOptions = useMemo(() => getHourOptions(locale), [locale]);
|
|
648
|
-
const minuteOptions = useMemo(() => getMinuteOptions(locale), [locale]);
|
|
649
|
-
const fieldNames = useMemo(() => getTimeFieldNames(locale), [locale]);
|
|
650
|
-
const clock = time === null ? null : splitPickerTime(time);
|
|
651
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
652
|
-
"aria-labelledby": labelId,
|
|
653
|
-
className: "mt-1 flex items-center gap-1.5 border-t pt-1",
|
|
654
|
-
role: "group",
|
|
655
|
-
children: [
|
|
656
|
-
/* @__PURE__ */ jsx("span", {
|
|
657
|
-
className: "text-foreground-label shrink-0 text-xs",
|
|
658
|
-
id: labelId,
|
|
659
|
-
children: label
|
|
660
|
-
}),
|
|
661
|
-
/* @__PURE__ */ jsx(TimePartSelect, {
|
|
662
|
-
disabled,
|
|
663
|
-
label: fieldNames.hour,
|
|
664
|
-
onChange: (hour) => onChange({
|
|
665
|
-
hour,
|
|
666
|
-
minute: clock?.minute ?? 0
|
|
667
|
-
}),
|
|
668
|
-
options: hourOptions,
|
|
669
|
-
value: clock?.hour ?? null
|
|
670
|
-
}),
|
|
671
|
-
/* @__PURE__ */ jsx("span", {
|
|
672
|
-
"aria-hidden": "true",
|
|
673
|
-
className: "text-muted-foreground text-xs",
|
|
674
|
-
children: ":"
|
|
675
|
-
}),
|
|
676
|
-
/* @__PURE__ */ jsx(TimePartSelect, {
|
|
677
|
-
disabled,
|
|
678
|
-
label: fieldNames.minute,
|
|
679
|
-
onChange: (minute) => onChange({
|
|
680
|
-
hour: clock?.hour ?? 0,
|
|
681
|
-
minute
|
|
682
|
-
}),
|
|
683
|
-
options: minuteOptions,
|
|
684
|
-
value: clock?.minute ?? null
|
|
685
|
-
})
|
|
686
|
-
]
|
|
687
|
-
});
|
|
688
|
-
};
|
|
689
|
-
const TimePartSelect = ({ disabled, label, onChange, options, value }) => /* @__PURE__ */ jsxs(Select, {
|
|
690
|
-
disabled,
|
|
691
|
-
onValueChange: (next) => {
|
|
692
|
-
if (typeof next === "number") onChange(next);
|
|
693
|
-
},
|
|
694
|
-
value,
|
|
695
|
-
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
696
|
-
"aria-label": label,
|
|
697
|
-
className: "min-w-0 flex-1",
|
|
698
|
-
size: "sm",
|
|
699
|
-
children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "—" })
|
|
700
|
-
}), /* @__PURE__ */ jsx(SelectPopup, { children: options.map((option) => /* @__PURE__ */ jsx(SelectItem, {
|
|
701
|
-
value: option.value,
|
|
702
|
-
children: option.label
|
|
703
|
-
}, option.value)) })]
|
|
704
|
-
});
|
|
705
642
|
const MONTHS_PER_ROW = 3;
|
|
706
643
|
const MonthGrid = ({ locale, viewYear, currentMonth, currentYear, cellClassName, onSelect, today }) => {
|
|
707
644
|
const labels = useMemo(() => getMonthLabels(locale, "short"), [locale]);
|
|
@@ -836,5 +773,4 @@ const TypedDateField = ({ mode, label, value, invalid, errorLabel = "Choose a da
|
|
|
836
773
|
]
|
|
837
774
|
});
|
|
838
775
|
};
|
|
839
|
-
//#endregion
|
|
840
776
|
export { DatePickerPopover };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/date-picker-popover.logic.d.ts
|
|
2
1
|
export type CalendarMonth = {
|
|
3
2
|
month: number;
|
|
4
3
|
year: number;
|
|
@@ -52,5 +51,4 @@ export declare const getHourOptions: (locale: string) => PickerTimeOption[];
|
|
|
52
51
|
/** Two-digit minute choices in the locale's numbering system. */
|
|
53
52
|
export declare const getMinuteOptions: (locale: string) => PickerTimeOption[];
|
|
54
53
|
/** Accessible names of the hour and minute fields, from the locale itself. */
|
|
55
|
-
export declare const getTimeFieldNames: (locale: string) => Record<keyof PickerClock, string>;
|
|
56
|
-
//#endregion
|
|
54
|
+
export declare const getTimeFieldNames: (locale: string) => Record<keyof PickerClock, string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill/full";
|
|
2
|
-
|
|
2
|
+
// src/components/date-picker-popover.logic.ts
|
|
3
3
|
const DATE_ROLLOVER_EPSILON_MS = 50;
|
|
4
4
|
const padDatePart = (value) => value.toString().padStart(2, "0");
|
|
5
5
|
const localDateFromTimestamp = (timestamp) => {
|
|
@@ -96,5 +96,4 @@ const getTimeFieldNames = (locale) => {
|
|
|
96
96
|
minute: capitalize(locale, names.of("minute") ?? "minute")
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
|
-
//#endregion
|
|
100
99
|
export { DATE_PICKER_MODE, DEFAULT_PICKER_TIME, formatDateTimeValue, getHourOptions, getMinuteOptions, getTimeFieldNames, joinPickerTime, localDateFromTimestamp, millisecondsUntilNextLocalDate, parseDateTimeValue, resolveCalendarViewMonth, shiftCalendarDate, splitPickerTime };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DatePickerPopoverProps } from "./date-picker-popover.js";
|
|
2
|
-
//#region src/components/date-range-filter.d.ts
|
|
3
2
|
type DateRangeFilterProps = Omit<DatePickerPopoverProps, "value" | "onChange" | "minDate" | "open" | "defaultOpen" | "onOpenChange" | "triggerRef" | "focusTriggerOnOpen" | "id" | "labelledBy" | "mode"> & {
|
|
4
3
|
from: string | null;
|
|
5
4
|
to: string | null;
|
|
@@ -10,5 +9,4 @@ type DateRangeFilterProps = Omit<DatePickerPopoverProps, "value" | "onChange" |
|
|
|
10
9
|
};
|
|
11
10
|
/** Both calendar bounds and the focus handoff belong to the range. */
|
|
12
11
|
declare const DateRangeFilter: ({ from, to, onFromChange, onToChange, fromLabel, toLabel, className, maxDate, ...pickerProps }: DateRangeFilterProps) => import("react").JSX.Element;
|
|
13
|
-
//#endregion
|
|
14
12
|
export { DateRangeFilter, type DateRangeFilterProps };
|
|
@@ -3,7 +3,7 @@ import { cn } from "../lib/utils.js";
|
|
|
3
3
|
import { DatePickerPopover } from "./date-picker-popover.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useId, useRef, useState } from "react";
|
|
6
|
-
|
|
6
|
+
// src/components/date-range-filter.tsx
|
|
7
7
|
/** Both calendar bounds and the focus handoff belong to the range. */
|
|
8
8
|
const DateRangeFilter = ({ from, to, onFromChange, onToChange, fromLabel, toLabel, className, maxDate, ...pickerProps }) => {
|
|
9
9
|
const id = useId();
|
|
@@ -70,5 +70,4 @@ const DateRangeFilter = ({ from, to, onFromChange, onToChange, fromLabel, toLabe
|
|
|
70
70
|
})]
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
|
-
//#endregion
|
|
74
73
|
export { DateRangeFilter };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import { InputProps } from "./input.js";
|
|
3
|
-
//#region src/components/destructive-action-confirmation.d.ts
|
|
4
3
|
type DestructiveActionConfirmationProps = Omit<InputProps, "onChange" | "type" | "value"> & {
|
|
5
4
|
confirmation: string;
|
|
6
5
|
description?: React$1.ReactNode;
|
|
@@ -17,5 +16,4 @@ declare function useDestructiveActionConfirmation(confirmation: string): {
|
|
|
17
16
|
reset: () => void;
|
|
18
17
|
value: string;
|
|
19
18
|
};
|
|
20
|
-
//#endregion
|
|
21
19
|
export { DestructiveActionConfirmation, useDestructiveActionConfirmation };
|
|
@@ -4,7 +4,7 @@ import { Input } from "./input.js";
|
|
|
4
4
|
import { Field, FieldDescription, FieldLabel } from "./field.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import * as React$1 from "react";
|
|
7
|
-
|
|
7
|
+
// src/components/destructive-action-confirmation.tsx
|
|
8
8
|
const DestructiveActionConfirmation = ({ className, confirmation, description, fieldClassName, inputClassName, label, onValueChange, value, ...props }) => {
|
|
9
9
|
const confirmed = isDestructiveActionConfirmed({
|
|
10
10
|
confirmation,
|
|
@@ -56,5 +56,4 @@ function useDestructiveActionConfirmation(confirmation) {
|
|
|
56
56
|
function isDestructiveActionConfirmed({ confirmation, value }) {
|
|
57
57
|
return value === confirmation;
|
|
58
58
|
}
|
|
59
|
-
//#endregion
|
|
60
59
|
export { DestructiveActionConfirmation, useDestructiveActionConfirmation };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
//#region src/components/destructive-confirm-dialog.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* What a settled confirm asks of the dialog: `keep-open` when the action was
|
|
5
4
|
* refused and the dialog shows why, so the caller need not throw to keep it.
|
|
@@ -19,5 +18,4 @@ type DestructiveConfirmDialogProps = {
|
|
|
19
18
|
title: React$1.ReactNode;
|
|
20
19
|
};
|
|
21
20
|
declare const DestructiveConfirmDialog: ({ cancelLabel, confirmLabel, confirmation, description, inputLabel, loading, onConfirm, onOpenChange, open, title }: DestructiveConfirmDialogProps) => React$1.JSX.Element;
|
|
22
|
-
//#endregion
|
|
23
21
|
export { DestructiveConfirmDialog, type DestructiveConfirmDialogProps, type DestructiveConfirmOutcome };
|
|
@@ -3,7 +3,7 @@ import { AlertDialog, AlertDialogClose, AlertDialogContent as AlertDialogPopup,
|
|
|
3
3
|
import { Button } from "./button.js";
|
|
4
4
|
import { DestructiveActionConfirmation, useDestructiveActionConfirmation } from "./destructive-action-confirmation.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/components/destructive-confirm-dialog.tsx
|
|
7
7
|
const DestructiveConfirmDialog = ({ cancelLabel, confirmLabel, confirmation, description, inputLabel, loading = false, onConfirm, onOpenChange, open, title }) => {
|
|
8
8
|
const typedConfirmation = useDestructiveActionConfirmation(confirmation);
|
|
9
9
|
const handleOpenChange = (nextOpen) => {
|
|
@@ -44,5 +44,4 @@ const DestructiveConfirmDialog = ({ cancelLabel, confirmLabel, confirmation, des
|
|
|
44
44
|
] })
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
-
//#endregion
|
|
48
47
|
export { DestructiveConfirmDialog };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
//#region src/components/details-grid.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* - `sheet`: a fact sheet; small uppercase labels, up to three pairs per row
|
|
5
4
|
* as the container widens.
|
|
@@ -12,18 +11,27 @@ type DetailsVariant = "sheet" | "list";
|
|
|
12
11
|
* shares one column sized to the longest.
|
|
13
12
|
* - `vertical`: each label above its value, for values too long to share a
|
|
14
13
|
* row (a server address, a list of origins).
|
|
14
|
+
* - `auto`: vertical in a narrow container (a phone, a side panel under
|
|
15
|
+
* 24rem) and horizontal once there is room, measured on the grid's own
|
|
16
|
+
* container rather than the viewport.
|
|
15
17
|
*/
|
|
16
|
-
type DetailsOrientation = "horizontal" | "vertical";
|
|
18
|
+
type DetailsOrientation = "horizontal" | "vertical" | "auto";
|
|
19
|
+
/**
|
|
20
|
+
* How wide the label column of a horizontal grid is. `auto` sizes it to the
|
|
21
|
+
* longest label (the list default); `sm`, `md` (the sheet default, 7rem) and
|
|
22
|
+
* `lg` fix it, so several grids on one page line their values up.
|
|
23
|
+
*/
|
|
24
|
+
type DetailsLabelWidth = "auto" | "sm" | "md" | "lg";
|
|
17
25
|
type DetailsGridProps = React$1.ComponentProps<"dl"> & {
|
|
26
|
+
labelWidth?: DetailsLabelWidth;
|
|
18
27
|
orientation?: DetailsOrientation;
|
|
19
28
|
variant?: DetailsVariant;
|
|
20
29
|
};
|
|
21
|
-
declare const DetailsGrid: ({ className, orientation, variant, ...props }: DetailsGridProps) => React$1.JSX.Element;
|
|
30
|
+
declare const DetailsGrid: ({ className, labelWidth, orientation, variant, ...props }: DetailsGridProps) => React$1.JSX.Element;
|
|
22
31
|
type DetailsItemProps = React$1.ComponentProps<"div"> & {
|
|
23
32
|
label: React$1.ReactNode;
|
|
24
33
|
/** `wide` spans every pair column of a `sheet`. */
|
|
25
34
|
span?: "wide";
|
|
26
35
|
};
|
|
27
36
|
declare const DetailsItem: ({ label, children, span, className, ...props }: DetailsItemProps) => React$1.JSX.Element;
|
|
28
|
-
|
|
29
|
-
export { DetailsGrid, DetailsItem, type DetailsOrientation, type DetailsVariant };
|
|
37
|
+
export { DetailsGrid, DetailsItem, type DetailsLabelWidth, type DetailsOrientation, type DetailsVariant };
|
|
@@ -1,31 +1,65 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { rendersNothing } from "../lib/renders-nothing.js";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { createContext, useContext } from "react";
|
|
4
|
-
|
|
5
|
+
// src/components/details-grid.tsx
|
|
5
6
|
const DetailsShapeContext = createContext({
|
|
7
|
+
labelWidth: "md",
|
|
6
8
|
orientation: "horizontal",
|
|
7
9
|
variant: "sheet"
|
|
8
10
|
});
|
|
9
11
|
const LIST_CLASS_NAME = {
|
|
10
|
-
|
|
12
|
+
auto: "flex min-w-0 flex-col gap-2 text-sm @min-[24rem]:grid @min-[24rem]:items-center @min-[24rem]:gap-x-4 @min-[24rem]:gap-y-1",
|
|
13
|
+
horizontal: "grid items-center gap-x-4 gap-y-1 text-sm",
|
|
11
14
|
vertical: "flex min-w-0 flex-col gap-2 text-sm"
|
|
12
15
|
};
|
|
16
|
+
/** The list's label and value tracks, per label width. */
|
|
17
|
+
const LIST_COLUMNS_CLASS_NAME = {
|
|
18
|
+
auto: "grid-cols-[auto_minmax(0,1fr)]",
|
|
19
|
+
lg: "grid-cols-[10rem_minmax(0,1fr)]",
|
|
20
|
+
md: "grid-cols-[7rem_minmax(0,1fr)]",
|
|
21
|
+
sm: "grid-cols-[5rem_minmax(0,1fr)]"
|
|
22
|
+
};
|
|
23
|
+
/** The same tracks, applied only once an `auto` list turns horizontal. */
|
|
24
|
+
const LIST_AUTO_COLUMNS_CLASS_NAME = {
|
|
25
|
+
auto: "@min-[24rem]:grid-cols-[auto_minmax(0,1fr)]",
|
|
26
|
+
lg: "@min-[24rem]:grid-cols-[10rem_minmax(0,1fr)]",
|
|
27
|
+
md: "@min-[24rem]:grid-cols-[7rem_minmax(0,1fr)]",
|
|
28
|
+
sm: "@min-[24rem]:grid-cols-[5rem_minmax(0,1fr)]"
|
|
29
|
+
};
|
|
30
|
+
/** A sheet pair's label and value tracks; `auto` keeps the 7rem default. */
|
|
31
|
+
const SHEET_ITEM_COLUMNS_CLASS_NAME = {
|
|
32
|
+
auto: "grid-cols-[minmax(0,7rem)_minmax(0,1fr)]",
|
|
33
|
+
lg: "grid-cols-[minmax(0,10rem)_minmax(0,1fr)]",
|
|
34
|
+
md: "grid-cols-[minmax(0,7rem)_minmax(0,1fr)]",
|
|
35
|
+
sm: "grid-cols-[minmax(0,5rem)_minmax(0,1fr)]"
|
|
36
|
+
};
|
|
37
|
+
const SHEET_AUTO_ITEM_COLUMNS_CLASS_NAME = {
|
|
38
|
+
auto: "@min-[20rem]:grid-cols-[minmax(0,7rem)_minmax(0,1fr)]",
|
|
39
|
+
lg: "@min-[20rem]:grid-cols-[minmax(0,10rem)_minmax(0,1fr)]",
|
|
40
|
+
md: "@min-[20rem]:grid-cols-[minmax(0,7rem)_minmax(0,1fr)]",
|
|
41
|
+
sm: "@min-[20rem]:grid-cols-[minmax(0,5rem)_minmax(0,1fr)]"
|
|
42
|
+
};
|
|
13
43
|
const ITEM_CLASS_NAME = {
|
|
14
44
|
list: {
|
|
45
|
+
auto: "flex min-w-0 flex-col gap-0.5 @min-[24rem]:col-span-full @min-[24rem]:grid @min-[24rem]:grid-cols-subgrid @min-[24rem]:items-center",
|
|
15
46
|
horizontal: "col-span-full grid grid-cols-subgrid items-center",
|
|
16
47
|
vertical: "flex min-w-0 flex-col gap-2"
|
|
17
48
|
},
|
|
18
49
|
sheet: {
|
|
19
|
-
|
|
50
|
+
auto: "flex min-w-0 flex-col gap-1 text-xs @min-[20rem]:grid @min-[20rem]:items-start @min-[20rem]:gap-x-4",
|
|
51
|
+
horizontal: "grid min-w-0 items-start gap-x-4 text-xs",
|
|
20
52
|
vertical: "flex min-w-0 flex-col gap-1 text-xs"
|
|
21
53
|
}
|
|
22
54
|
};
|
|
23
55
|
const LABEL_CLASS_NAME = {
|
|
24
56
|
list: {
|
|
57
|
+
auto: "text-muted-foreground min-w-0",
|
|
25
58
|
horizontal: "text-muted-foreground min-w-0",
|
|
26
59
|
vertical: "font-medium"
|
|
27
60
|
},
|
|
28
61
|
sheet: {
|
|
62
|
+
auto: "text-foreground-disabled min-w-0 font-medium tracking-wide wrap-anywhere uppercase",
|
|
29
63
|
horizontal: "text-foreground-disabled min-w-0 font-medium tracking-wide wrap-anywhere uppercase",
|
|
30
64
|
vertical: "text-foreground-disabled min-w-0 font-medium tracking-wide wrap-anywhere uppercase"
|
|
31
65
|
}
|
|
@@ -34,21 +68,29 @@ const VALUE_CLASS_NAME = {
|
|
|
34
68
|
list: "min-w-0 wrap-anywhere",
|
|
35
69
|
sheet: "text-foreground-strong-muted min-w-0 wrap-anywhere"
|
|
36
70
|
};
|
|
37
|
-
const DetailsGrid = ({ className, orientation = "horizontal", variant = "sheet", ...props }) => {
|
|
71
|
+
const DetailsGrid = ({ className, labelWidth, orientation = "horizontal", variant = "sheet", ...props }) => {
|
|
38
72
|
const shape = {
|
|
73
|
+
labelWidth: labelWidth ?? (variant === "list" ? "auto" : "md"),
|
|
39
74
|
orientation,
|
|
40
75
|
variant
|
|
41
76
|
};
|
|
42
|
-
if (variant === "list")
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
className: cn(LIST_CLASS_NAME[orientation], className),
|
|
77
|
+
if (variant === "list") {
|
|
78
|
+
const list = /* @__PURE__ */ jsx("dl", {
|
|
79
|
+
className: cn(LIST_CLASS_NAME[orientation], orientation === "horizontal" && LIST_COLUMNS_CLASS_NAME[shape.labelWidth], orientation === "auto" && LIST_AUTO_COLUMNS_CLASS_NAME[shape.labelWidth], className),
|
|
46
80
|
"data-orientation": orientation,
|
|
47
81
|
"data-slot": "details-grid",
|
|
48
82
|
"data-variant": variant,
|
|
49
83
|
...props
|
|
50
|
-
})
|
|
51
|
-
|
|
84
|
+
});
|
|
85
|
+
return /* @__PURE__ */ jsx(DetailsShapeContext.Provider, {
|
|
86
|
+
value: shape,
|
|
87
|
+
children: orientation === "auto" ? /* @__PURE__ */ jsx("div", {
|
|
88
|
+
className: "@container min-w-0",
|
|
89
|
+
"data-slot": "details-grid-container",
|
|
90
|
+
children: list
|
|
91
|
+
}) : list
|
|
92
|
+
});
|
|
93
|
+
}
|
|
52
94
|
return /* @__PURE__ */ jsx(DetailsShapeContext.Provider, {
|
|
53
95
|
value: shape,
|
|
54
96
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -63,9 +105,9 @@ const DetailsGrid = ({ className, orientation = "horizontal", variant = "sheet",
|
|
|
63
105
|
});
|
|
64
106
|
};
|
|
65
107
|
const DetailsItem = ({ label, children, span, className, ...props }) => {
|
|
66
|
-
const { orientation, variant } = useContext(DetailsShapeContext);
|
|
108
|
+
const { labelWidth, orientation, variant } = useContext(DetailsShapeContext);
|
|
67
109
|
return /* @__PURE__ */ jsxs("div", {
|
|
68
|
-
className: cn(ITEM_CLASS_NAME[variant][orientation], variant === "sheet" && span === "wide" && "col-span-full", className),
|
|
110
|
+
className: cn(ITEM_CLASS_NAME[variant][orientation], variant === "sheet" && orientation === "horizontal" && SHEET_ITEM_COLUMNS_CLASS_NAME[labelWidth], variant === "sheet" && orientation === "auto" && SHEET_AUTO_ITEM_COLUMNS_CLASS_NAME[labelWidth], variant === "sheet" && span === "wide" && "col-span-full", className),
|
|
69
111
|
"data-slot": "details-item",
|
|
70
112
|
...props,
|
|
71
113
|
children: [/* @__PURE__ */ jsx("dt", {
|
|
@@ -73,9 +115,22 @@ const DetailsItem = ({ label, children, span, className, ...props }) => {
|
|
|
73
115
|
children: label
|
|
74
116
|
}), /* @__PURE__ */ jsx("dd", {
|
|
75
117
|
className: VALUE_CLASS_NAME[variant],
|
|
76
|
-
children
|
|
118
|
+
children: isEmptyValue(children) ? /* @__PURE__ */ jsx("span", {
|
|
119
|
+
"aria-hidden": "true",
|
|
120
|
+
className: "text-foreground-disabled",
|
|
121
|
+
"data-slot": "details-empty",
|
|
122
|
+
children: "—"
|
|
123
|
+
}) : children
|
|
77
124
|
})]
|
|
78
125
|
});
|
|
79
126
|
};
|
|
80
|
-
|
|
127
|
+
/**
|
|
128
|
+
* No value to show: what React draws nothing for (see `rendersNothing`),
|
|
129
|
+
* only whitespace, or a list of only those.
|
|
130
|
+
*/
|
|
131
|
+
function isEmptyValue(value) {
|
|
132
|
+
if (typeof value === "string") return value.trim() === "";
|
|
133
|
+
if (Array.isArray(value)) return value.every((item) => isEmptyValue(item));
|
|
134
|
+
return rendersNothing(value);
|
|
135
|
+
}
|
|
81
136
|
export { DetailsGrid, DetailsItem };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/dialog-form-state.d.ts
|
|
2
1
|
export type DialogFormSource = {
|
|
3
2
|
dirty: boolean;
|
|
4
3
|
onDiscard?: (() => void) | undefined;
|
|
@@ -12,5 +11,4 @@ export declare const DialogFormContext: import("react").Context<DialogFormRegist
|
|
|
12
11
|
export declare const DialogFormState: ({ dirty, onDiscard }: {
|
|
13
12
|
dirty: boolean;
|
|
14
13
|
onDiscard?: (() => void) | undefined;
|
|
15
|
-
}) => null;
|
|
16
|
-
//#endregion
|
|
14
|
+
}) => null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createContext, useContext, useId, useLayoutEffect } from "react";
|
|
3
|
-
|
|
3
|
+
// src/components/dialog-form-state.tsx
|
|
4
4
|
const DialogFormContext = createContext(null);
|
|
5
5
|
/** Forms report semantic changes, including edits made by custom controls. */
|
|
6
6
|
const DialogFormState = ({ dirty, onDiscard }) => {
|
|
@@ -24,5 +24,4 @@ const DialogFormState = ({ dirty, onDiscard }) => {
|
|
|
24
24
|
}, [id, registry]);
|
|
25
25
|
return null;
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
export { DialogFormContext, DialogFormState };
|
|
@@ -2,7 +2,6 @@ import * as React$1 from "react";
|
|
|
2
2
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
3
3
|
import { DialogFormState } from "./dialog-form-state.js";
|
|
4
4
|
import { OverlayLayer } from "../lib/overlay-layer.js";
|
|
5
|
-
//#region src/components/dialog.d.ts
|
|
6
5
|
declare const DialogCreateHandle: typeof Dialog$1.createHandle;
|
|
7
6
|
type DialogLabels = {
|
|
8
7
|
close: string;
|
|
@@ -72,5 +71,4 @@ declare const DialogDescription: ({ className, ...props }: Dialog$1.Description.
|
|
|
72
71
|
declare const DialogPanel: ({ className, scrollFade, ...props }: React$1.ComponentProps<"div"> & {
|
|
73
72
|
scrollFade?: boolean;
|
|
74
73
|
}) => React$1.JSX.Element;
|
|
75
|
-
//#endregion
|
|
76
74
|
export { DIALOG_MOBILE_LAYOUT, DIALOG_SIZE_CLASS_NAMES, Dialog, DialogBackdrop, DialogBackdrop as DialogOverlay, DialogClose, DialogPopup as DialogContent, DialogPopup, DialogCreateHandle, DialogDescription, DialogFooter, DialogFormState, DialogHeader, type DialogLabels, type DialogMobileLayout, DialogPanel, DialogPortal, DialogProvider, type DialogSize, DialogTitle, DialogTrigger, DialogViewport };
|
|
@@ -10,7 +10,7 @@ import { DialogFormContext, DialogFormState } from "./dialog-form-state.js";
|
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { createContext, useContext, useRef, useState } from "react";
|
|
12
12
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
13
|
-
|
|
13
|
+
// src/components/dialog.tsx
|
|
14
14
|
const DialogCreateHandle = Dialog$1.createHandle;
|
|
15
15
|
const DialogLabelsContext = createContext({
|
|
16
16
|
close: "Close",
|
|
@@ -197,5 +197,4 @@ const DialogPanel = ({ className, scrollFade = true, ...props }) => /* @__PURE__
|
|
|
197
197
|
...props
|
|
198
198
|
})
|
|
199
199
|
});
|
|
200
|
-
//#endregion
|
|
201
200
|
export { DIALOG_MOBILE_LAYOUT, DIALOG_SIZE_CLASS_NAMES, Dialog, DialogBackdrop, DialogBackdrop as DialogOverlay, DialogClose, DialogPopup as DialogContent, DialogPopup, DialogCreateHandle, DialogDescription, DialogFooter, DialogFormState, DialogHeader, DialogPanel, DialogPortal, DialogProvider, DialogTitle, DialogTrigger, DialogViewport };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LucideIcon } from "../icons.js";
|
|
2
|
-
//#region src/components/directional-icon.d.ts
|
|
3
2
|
type DirectionalIconProps = {
|
|
4
3
|
/**
|
|
5
4
|
* A horizontally-directional lucide icon (chevron / arrow / caret /
|
|
@@ -26,5 +25,4 @@ type DirectionalIconProps = {
|
|
|
26
25
|
* icon). See `/conventions-ux` → Right-to-Left & Bidirectional.
|
|
27
26
|
*/
|
|
28
27
|
export declare const DirectionalIcon: ({ icon: Icon, className, flip }: DirectionalIconProps) => import("react").JSX.Element;
|
|
29
|
-
//#endregion
|
|
30
28
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/components/directional-icon.tsx
|
|
4
4
|
/**
|
|
5
5
|
* Single sanctioned way to render a direction-bearing icon. Centralizes
|
|
6
6
|
* the `rtl:-scale-x-100` mirror so individual call sites can't get RTL
|
|
@@ -8,5 +8,4 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
* icon). See `/conventions-ux` → Right-to-Left & Bidirectional.
|
|
9
9
|
*/
|
|
10
10
|
const DirectionalIcon = ({ icon: Icon, className, flip = true }) => /* @__PURE__ */ jsx(Icon, { className: cn(flip && "rtl:-scale-x-100", className) });
|
|
11
|
-
//#endregion
|
|
12
11
|
export { DirectionalIcon };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CourtBadgeSize } from "./court-badge.js";
|
|
2
2
|
import { DocumentIdentity } from "./document-identity-badge.logic.js";
|
|
3
|
-
//#region src/components/document-identity-badge.d.ts
|
|
4
3
|
export declare const DocumentIdentityBadge: ({ identity, size, title }: DocumentIdentityBadgeProps) => import("react").JSX.Element;
|
|
5
4
|
type DocumentIdentityBadgeProps = {
|
|
6
5
|
identity: DocumentIdentity;
|
|
@@ -9,5 +8,4 @@ type DocumentIdentityBadgeProps = {
|
|
|
9
8
|
/** Omit when the enclosing tab already supplies the full-title tooltip. */
|
|
10
9
|
title?: string | undefined;
|
|
11
10
|
};
|
|
12
|
-
//#endregion
|
|
13
11
|
export {};
|
|
@@ -5,7 +5,7 @@ import { CourtBadge } from "./court-badge.js";
|
|
|
5
5
|
import { COURT_TIER_WEIGHT, caseNumberIdentityLabels, statuteIdentityLabels } from "./document-identity-badge.logic.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { panic } from "better-result";
|
|
8
|
-
|
|
8
|
+
// src/components/document-identity-badge.tsx
|
|
9
9
|
const DocumentIdentityBadge = ({ identity, size, title }) => {
|
|
10
10
|
const content = documentIdentityMark(identity, size);
|
|
11
11
|
if (title === void 0) return content;
|
|
@@ -104,5 +104,4 @@ function statuteLabelClasses(length) {
|
|
|
104
104
|
if (length === 9) return STATUTE_LABEL_CLASSES[9];
|
|
105
105
|
return STATUTE_LABEL_CLASSES[10];
|
|
106
106
|
}
|
|
107
|
-
//#endregion
|
|
108
107
|
export { DocumentIdentityBadge };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/document-identity-badge.logic.d.ts
|
|
2
1
|
export declare const COURT_TIER_WEIGHT: {
|
|
3
2
|
readonly constitutional: "solid";
|
|
4
3
|
readonly supreme: "tinted";
|
|
@@ -40,5 +39,4 @@ export declare const statuteIdentityLabels: ({ number, year }: Extract<DocumentI
|
|
|
40
39
|
*/
|
|
41
40
|
export declare const caseNumberIdentityLabels: ({ caseNumber }: Extract<DocumentIdentity, {
|
|
42
41
|
kind: "caseNumber";
|
|
43
|
-
}>) => IdentityLabels | null;
|
|
44
|
-
//#endregion
|
|
42
|
+
}>) => IdentityLabels | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/document-identity-badge.logic.ts
|
|
2
2
|
const COURT_TIER_WEIGHT = {
|
|
3
3
|
constitutional: "solid",
|
|
4
4
|
supreme: "tinted",
|
|
@@ -37,5 +37,4 @@ const caseNumberIdentityLabels = ({ caseNumber }) => {
|
|
|
37
37
|
long
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
//#endregion
|
|
41
40
|
export { COURT_TIER_WEIGHT, caseNumberIdentityLabels, statuteIdentityLabels };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DocumentMarkContract, DocumentMarkKind, isDocumentMarkKind } from "./document-mark.shared.js";
|
|
2
|
+
import { SVGProps } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* A file format's mark (the Word, Excel or PDF page), drawn from the artwork
|
|
5
|
+
* the apps share. Decorative: the file's name says what it is.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DocumentMark: ({ kind, ...props }: DocumentMarkProps) => import("react").ReactSVGElement;
|
|
8
|
+
type DocumentMarkProps = DocumentMarkContract & Omit<SVGProps<SVGSVGElement>, "children" | "viewBox">;
|
|
9
|
+
export { type DocumentMarkKind, isDocumentMarkKind };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DOCUMENT_MARKS, GRADIENT_REFERENCE, isDocumentMarkKind } from "./document-mark.shared.js";
|
|
2
|
+
import { createElement, useId } from "react";
|
|
3
|
+
// src/components/document-mark.tsx
|
|
4
|
+
/**
|
|
5
|
+
* A file format's mark (the Word, Excel or PDF page), drawn from the artwork
|
|
6
|
+
* the apps share. Decorative: the file's name says what it is.
|
|
7
|
+
*/
|
|
8
|
+
const DocumentMark = ({ kind, ...props }) => {
|
|
9
|
+
const scope = useId();
|
|
10
|
+
const mark = DOCUMENT_MARKS[kind];
|
|
11
|
+
const gradients = mark.gradients.map((gradient) => createElement("linearGradient", {
|
|
12
|
+
...gradient.attrs,
|
|
13
|
+
id: `${scope}-${gradient.id}`
|
|
14
|
+
}, ...gradient.stops.map((stop) => createElement("stop", stop))));
|
|
15
|
+
return createElement("svg", {
|
|
16
|
+
"aria-hidden": true,
|
|
17
|
+
fill: mark.fill ?? "none",
|
|
18
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
+
...props,
|
|
20
|
+
viewBox: mark.viewBox
|
|
21
|
+
}, ...gradients.length === 0 ? [] : [createElement("defs", {}, ...gradients)], ...mark.shapes.map((shape) => draw(shape, scope)));
|
|
22
|
+
};
|
|
23
|
+
/** A gradient id or paint reference, namespaced to one drawn mark. */
|
|
24
|
+
const scoped = (attrs, scope) => Object.fromEntries(Object.entries(attrs).map(([name, value]) => {
|
|
25
|
+
const id = GRADIENT_REFERENCE.exec(value)?.[1];
|
|
26
|
+
return [name, id === void 0 ? value : `url(#${scope}-${id})`];
|
|
27
|
+
}));
|
|
28
|
+
const draw = (shape, scope) => createElement(shape.tag, scoped(shape.attrs, scope), ...(shape.children ?? []).map((child) => draw(child, scope)));
|
|
29
|
+
export { DocumentMark, isDocumentMarkKind };
|