@mt-gloss/ui 0.0.8 → 0.0.10
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/catalog.d.ts +7 -0
- package/catalog.js +614 -0
- package/index.d.ts +274 -2
- package/index.js +2217 -18330
- package/internals.d.ts +64 -0
- package/internals.js +279 -0
- package/lib/base/BaseAccordion/BaseAccordion.d.ts +51 -0
- package/lib/base/BaseAlert/BaseAlert.d.ts +28 -0
- package/lib/base/BaseAsyncButton/BaseAsyncButton.d.ts +22 -0
- package/lib/base/BaseAvatar/BaseAvatar.d.ts +28 -0
- package/lib/base/BaseBadge/BaseBadge.d.ts +31 -0
- package/lib/base/BaseBox/BaseBox.d.ts +35 -0
- package/lib/base/BaseBreadcrumbs/BaseBreadcrumbs.d.ts +26 -0
- package/lib/base/BaseButton/BaseButton.d.ts +38 -0
- package/lib/base/BaseCard/BaseCard.d.ts +109 -0
- package/lib/base/BaseCheckbox/BaseCheckbox.d.ts +23 -0
- package/lib/base/BaseChip/BaseChip.d.ts +38 -0
- package/lib/base/BaseColorPicker/BaseColorPicker.d.ts +77 -0
- package/lib/base/BaseDatePicker/BaseDatePicker.d.ts +76 -0
- package/lib/base/BaseDateRangePicker/BaseDateRangePicker.d.ts +47 -0
- package/lib/base/BaseDialog/BaseDialog.d.ts +54 -0
- package/lib/base/BaseDivider/BaseDivider.d.ts +24 -0
- package/lib/base/BaseFileUpload/BaseFileUpload.d.ts +57 -0
- package/lib/base/BaseIcon/BaseIcon.d.ts +23 -0
- package/lib/base/BaseInput/BaseInput.d.ts +34 -0
- package/lib/base/BaseLabel/BaseLabel.d.ts +21 -0
- package/lib/base/BaseLink/BaseLink.d.ts +29 -0
- package/lib/base/BaseMaskedInput/BaseMaskedInput.d.ts +31 -0
- package/lib/base/BaseMenu/BaseMenu.d.ts +70 -0
- package/lib/base/BaseNumberInput/BaseNumberInput.d.ts +31 -0
- package/lib/base/BaseOverlay/BaseOverlay.d.ts +39 -0
- package/lib/base/BaseOverlay/useOverlayDismiss.d.ts +15 -0
- package/lib/base/BaseOverlay/useOverlayPositioning.d.ts +13 -0
- package/lib/base/BasePopover/BasePopover.d.ts +40 -0
- package/lib/base/BaseProgressBar/BaseProgressBar.d.ts +27 -0
- package/lib/base/BaseRadio/BaseRadio.d.ts +20 -0
- package/lib/base/BaseRangeSlider/BaseRangeSlider.d.ts +31 -0
- package/lib/base/BaseRating/BaseRating.d.ts +25 -0
- package/lib/base/BaseSegmentedControl/BaseSegmentedControl.d.ts +26 -0
- package/lib/base/BaseSelect/BaseSelect.d.ts +83 -0
- package/lib/base/BaseSlider/BaseSlider.d.ts +29 -0
- package/lib/base/BaseStack/BaseStack.d.ts +26 -0
- package/lib/base/BaseTable/BaseTable.d.ts +97 -0
- package/lib/base/BaseText/BaseText.d.ts +19 -0
- package/lib/base/BaseTextarea/BaseTextarea.d.ts +37 -0
- package/lib/base/BaseTimePicker/BaseTimePicker.d.ts +55 -0
- package/lib/base/BaseTitle/BaseTitle.d.ts +22 -0
- package/lib/base/BaseToast/BaseToast.d.ts +35 -0
- package/lib/base/BaseToggle/BaseToggle.d.ts +22 -0
- package/lib/base/BaseTooltip/BaseTooltip.d.ts +27 -0
- package/lib/base/BaseTypography/BaseTypography.d.ts +30 -0
- package/lib/base/BaseValue/BaseValue.d.ts +20 -0
- package/lib/base/index.d.ts +65 -0
- package/lib/base/types.d.ts +9 -0
- package/lib/base/utils.d.ts +18 -0
- package/lib/composites/controls/ThresholdRamp/ThresholdRamp.d.ts +24 -0
- package/lib/composites/controls/ThresholdRamp/index.d.ts +2 -0
- package/lib/composites/controls/index.d.ts +1 -0
- package/lib/composites/dashboard/QuickConfigPanel/QuickConfigPanel.d.ts +14 -0
- package/lib/composites/dashboard/QuickConfigPanel/index.d.ts +2 -0
- package/lib/composites/dashboard/QuickConfigPanel/types.d.ts +38 -0
- package/lib/composites/data/DataTable.d.ts +61 -0
- package/lib/composites/data/PinToMetric/PinToMetric.d.ts +11 -0
- package/lib/composites/data/PinToMetric/index.d.ts +2 -0
- package/lib/composites/data/PinToMetric/types.d.ts +17 -0
- package/lib/composites/data/index.d.ts +4 -0
- package/lib/composites/index.d.ts +5 -0
- package/lib/composites/inputs/Autocomplete.d.ts +36 -0
- package/lib/composites/inputs/EntityPicker.d.ts +36 -0
- package/lib/composites/inputs/FilterChip.d.ts +29 -0
- package/lib/composites/inputs/MultiSelect.d.ts +38 -0
- package/lib/composites/inputs/index.d.ts +8 -0
- package/lib/composites/navigation/Stepper.d.ts +40 -0
- package/lib/composites/navigation/index.d.ts +2 -0
- package/lib/composites/overlay/Dropdown/Dropdown.d.ts +22 -0
- package/lib/composites/overlay/Dropdown/index.d.ts +2 -0
- package/lib/composites/overlay/FormDialog.d.ts +38 -0
- package/lib/composites/overlay/InlineNudge/InlineNudge.d.ts +26 -0
- package/lib/composites/overlay/InlineNudge/index.d.ts +12 -0
- package/lib/composites/overlay/MergePrompt/MergePrompt.d.ts +16 -0
- package/lib/composites/overlay/MergePrompt/index.d.ts +2 -0
- package/lib/composites/overlay/MergePrompt/types.d.ts +15 -0
- package/lib/composites/overlay/SplitButton/SplitButton.d.ts +27 -0
- package/lib/composites/overlay/SplitButton/index.d.ts +2 -0
- package/lib/composites/overlay/index.d.ts +6 -0
- package/lib/compositions/feedback/DestructiveModal.d.ts +1 -1
- package/lib/compositions/filters/OrderFilterBar.d.ts +35 -0
- package/lib/compositions/filters/index.d.ts +2 -0
- package/lib/compositions/forms/AddressGroup.d.ts +13 -1
- package/lib/compositions/forms/ContactForm.d.ts +31 -0
- package/lib/compositions/forms/CreditCardForm.d.ts +3 -1
- package/lib/compositions/forms/LoginForm.d.ts +3 -1
- package/lib/compositions/forms/PaymentForm.d.ts +50 -0
- package/lib/compositions/forms/RegistrationForm.d.ts +39 -0
- package/lib/compositions/forms/index.d.ts +3 -0
- package/lib/compositions/index.d.ts +3 -0
- package/lib/compositions/navigation/ImportWizard.d.ts +28 -0
- package/lib/compositions/navigation/index.d.ts +2 -0
- package/lib/compositions/panels/EntitySearchPanel.d.ts +41 -0
- package/lib/compositions/panels/ProfileCard.d.ts +34 -0
- package/lib/compositions/panels/index.d.ts +4 -0
- package/lib/containers/ContainerCard/ContainerCard.d.ts +13 -0
- package/lib/containers/ContainerDialog/ContainerDialog.d.ts +27 -0
- package/lib/containers/ContainerForm/ContainerForm.d.ts +45 -0
- package/lib/containers/ContainerFormField/ContainerFormField.d.ts +31 -0
- package/lib/containers/ContainerFormSection/ContainerFormSection.d.ts +13 -0
- package/lib/containers/ContainerPanel/ContainerPanel.d.ts +14 -0
- package/lib/containers/ContainerTable/ContainerTable.d.ts +12 -0
- package/lib/containers/ContainerToolbar/ContainerToolbar.d.ts +11 -0
- package/lib/containers/UIContext.d.ts +26 -0
- package/lib/containers/index.d.ts +18 -0
- package/lib/dictionary/border.d.ts +11 -0
- package/lib/dictionary/breakpoint.d.ts +12 -0
- package/lib/dictionary/color.d.ts +67 -0
- package/lib/dictionary/elevation.d.ts +16 -0
- package/lib/dictionary/index.d.ts +14 -0
- package/lib/dictionary/motion.d.ts +13 -0
- package/lib/dictionary/opacity.d.ts +11 -0
- package/lib/dictionary/radius.d.ts +14 -0
- package/lib/dictionary/spacing.d.ts +18 -0
- package/lib/dictionary/typography.d.ts +25 -0
- package/lib/dictionary/z-index.d.ts +13 -0
- package/lib/facade/composites.d.ts +56 -0
- package/lib/facade/compositions.d.ts +27 -0
- package/lib/facade/containers.d.ts +8 -0
- package/lib/facade/data-display.d.ts +41 -0
- package/lib/facade/display.d.ts +50 -0
- package/lib/facade/feedback.d.ts +6 -0
- package/lib/facade/index.d.ts +17 -0
- package/lib/facade/inputs.d.ts +43 -0
- package/lib/facade/layout.d.ts +8 -0
- package/lib/facade/overlay.d.ts +26 -0
- package/lib/facade/typography.d.ts +12 -0
- package/lib/facade/wrappers.d.ts +26 -0
- package/lib/presets/PresetAccordion/PresetAccordion.d.ts +21 -0
- package/lib/presets/PresetAlert/PresetAlert.d.ts +17 -0
- package/lib/presets/PresetAsyncButton/PresetAsyncButton.d.ts +22 -0
- package/lib/presets/PresetAsyncLoader/PresetAsyncLoader.d.ts +6 -0
- package/lib/presets/PresetAvatar/PresetAvatar.d.ts +18 -0
- package/lib/presets/PresetBadge/PresetBadge.d.ts +15 -0
- package/lib/presets/PresetBreadcrumbs/PresetBreadcrumbs.d.ts +15 -0
- package/lib/presets/PresetButton/PresetButton.d.ts +27 -0
- package/lib/presets/PresetButtonGroup/PresetButtonGroup.d.ts +6 -0
- package/lib/presets/PresetCard/PresetCard.d.ts +45 -0
- package/lib/presets/PresetCheckbox/PresetCheckbox.d.ts +23 -0
- package/lib/presets/PresetCheckboxGroup/PresetCheckboxGroup.d.ts +6 -0
- package/lib/presets/PresetChip/PresetChip.d.ts +22 -0
- package/lib/presets/PresetColorPicker/PresetColorPicker.d.ts +22 -0
- package/lib/presets/PresetDatePicker/PresetDatePicker.d.ts +29 -0
- package/lib/presets/PresetDateRangePicker/PresetDateRangePicker.d.ts +37 -0
- package/lib/presets/PresetDialog/PresetDialog.d.ts +46 -0
- package/lib/presets/PresetDivider/PresetDivider.d.ts +13 -0
- package/lib/presets/PresetDropdown/PresetDropdown.d.ts +6 -0
- package/lib/presets/PresetFileUpload/PresetFileUpload.d.ts +35 -0
- package/lib/presets/PresetForm/PresetForm.d.ts +6 -0
- package/lib/presets/PresetFormField/PresetFormField.d.ts +6 -0
- package/lib/presets/PresetInput/PresetInput.d.ts +24 -0
- package/lib/presets/PresetInputGroup/PresetInputGroup.d.ts +6 -0
- package/lib/presets/PresetLabel/PresetLabel.d.ts +18 -0
- package/lib/presets/PresetLink/PresetLink.d.ts +21 -0
- package/lib/presets/PresetMaskedInput/PresetMaskedInput.d.ts +41 -0
- package/lib/presets/PresetMenu/PresetMenu.d.ts +33 -0
- package/lib/presets/PresetNumberInput/PresetNumberInput.d.ts +26 -0
- package/lib/presets/PresetPopover/PresetPopover.d.ts +17 -0
- package/lib/presets/PresetProgressBar/PresetProgressBar.d.ts +19 -0
- package/lib/presets/PresetRadio/PresetRadio.d.ts +21 -0
- package/lib/presets/PresetRadioGroup/PresetRadioGroup.d.ts +6 -0
- package/lib/presets/PresetRangeSlider/PresetRangeSlider.d.ts +30 -0
- package/lib/presets/PresetRating/PresetRating.d.ts +19 -0
- package/lib/presets/PresetSegmentedControl/PresetSegmentedControl.d.ts +28 -0
- package/lib/presets/PresetSelect/PresetSelect.d.ts +63 -0
- package/lib/presets/PresetSlider/PresetSlider.d.ts +29 -0
- package/lib/presets/PresetSplitButton/PresetSplitButton.d.ts +6 -0
- package/lib/presets/PresetSwatchRow/PresetSwatchRow.d.ts +28 -0
- package/lib/presets/PresetSwatchRow/index.d.ts +2 -0
- package/lib/presets/PresetText/PresetText.d.ts +17 -0
- package/lib/presets/PresetTextarea/PresetTextarea.d.ts +25 -0
- package/lib/presets/PresetTimePicker/PresetTimePicker.d.ts +27 -0
- package/lib/presets/PresetTitle/PresetTitle.d.ts +19 -0
- package/lib/presets/PresetToast/PresetToast.d.ts +19 -0
- package/lib/presets/PresetToggle/PresetToggle.d.ts +21 -0
- package/lib/presets/PresetTooltip/PresetTooltip.d.ts +20 -0
- package/lib/presets/PresetTransition/PresetTransition.d.ts +6 -0
- package/lib/presets/PresetValue/PresetValue.d.ts +15 -0
- package/lib/presets/createPreset.d.ts +64 -0
- package/lib/presets/index.d.ts +86 -0
- package/lib/presets/types.d.ts +13 -0
- package/lib/primitives/Accordion.d.ts +12 -102
- package/lib/primitives/AsyncLoader.d.ts +4 -39
- package/lib/primitives/Badge.d.ts +5 -40
- package/lib/primitives/Button.d.ts +4 -71
- package/lib/primitives/ButtonGroup.d.ts +4 -70
- package/lib/primitives/Card.d.ts +20 -138
- package/lib/primitives/Checkbox.d.ts +4 -68
- package/lib/primitives/CheckboxGroup.d.ts +4 -160
- package/lib/primitives/Chip.d.ts +5 -66
- package/lib/primitives/ColorPicker.d.ts +4 -80
- package/lib/primitives/DatePicker.d.ts +4 -100
- package/lib/primitives/DateRangePicker.d.ts +4 -107
- package/lib/primitives/Dropdown.d.ts +4 -63
- package/lib/primitives/FileUpload.d.ts +4 -107
- package/lib/primitives/Form.d.ts +4 -117
- package/lib/primitives/FormField.d.ts +4 -67
- package/lib/primitives/Input.d.ts +4 -87
- package/lib/primitives/InputGroup.d.ts +4 -57
- package/lib/primitives/Link.d.ts +4 -67
- package/lib/primitives/MaskedInput.d.ts +4 -93
- package/lib/primitives/Menu.d.ts +12 -131
- package/lib/primitives/NumberInput.d.ts +4 -79
- package/lib/primitives/Radio.d.ts +4 -58
- package/lib/primitives/RadioGroup.d.ts +4 -161
- package/lib/primitives/RangeSlider.d.ts +4 -103
- package/lib/primitives/Rating.d.ts +4 -113
- package/lib/primitives/SegmentedControl.d.ts +4 -94
- package/lib/primitives/Select.d.ts +5 -203
- package/lib/primitives/Slider.d.ts +4 -109
- package/lib/primitives/SplitButton.d.ts +4 -82
- package/lib/primitives/Textarea.d.ts +4 -57
- package/lib/primitives/TimePicker.d.ts +4 -91
- package/lib/primitives/Toggle.d.ts +4 -66
- package/lib/primitives/Tooltip.d.ts +6 -86
- package/lib/primitives/Transition.d.ts +4 -105
- package/lib/primitives/dashboard/MetricCard/CardBack.d.ts +17 -2
- package/lib/primitives/dashboard/MetricCard/CardShell.d.ts +1 -1
- package/lib/primitives/dashboard/MetricCard/EdgeHoverHandle.d.ts +20 -0
- package/lib/primitives/dashboard/MetricCard/GhostPreview.d.ts +24 -0
- package/lib/primitives/dashboard/MetricCard/GutterActions.d.ts +12 -2
- package/lib/primitives/dashboard/MetricCard/MetricCard.d.ts +0 -28
- package/lib/primitives/dashboard/MetricCard/StatusModeCard.d.ts +5 -0
- package/lib/primitives/dashboard/MetricCard/StatusSlotChipMenu.d.ts +28 -0
- package/lib/primitives/dashboard/MetricCard/flipAndStage/FlipAndStageProvider.d.ts +29 -0
- package/lib/primitives/dashboard/MetricCard/flipAndStage/index.d.ts +15 -0
- package/lib/primitives/dashboard/MetricCard/flipAndStage/types.d.ts +83 -0
- package/lib/primitives/dashboard/MetricCard/flipAndStage/useFlipAndStage.d.ts +10 -0
- package/lib/primitives/dashboard/MetricCard/index.d.ts +10 -0
- package/lib/primitives/dashboard/MetricCard/types.d.ts +48 -4
- package/lib/primitives/dashboard/MetricCard/useEdgeHoverResize.d.ts +52 -0
- package/lib/primitives/dashboard/MetricCard/useSlotCapacity.d.ts +12 -0
- package/lib/primitives/dashboard/MetricCardGrid/MetricCardGrid.d.ts +21 -19
- package/lib/primitives/dashboard/MetricCardGrid/types.d.ts +8 -1
- package/lib/primitives/dashboard/MetricGroupContainer/MetricGroupContainer.d.ts +5 -0
- package/lib/primitives/dashboard/MetricGroupContainer/__tests__/fixtures.d.ts +13 -0
- package/lib/primitives/dashboard/MetricGroupContainer/index.d.ts +2 -0
- package/lib/primitives/dashboard/MetricGroupContainer/types.d.ts +34 -0
- package/lib/primitives/dashboard/PageChip/PageChip.d.ts +27 -0
- package/lib/primitives/dashboard/PageChip/PageDropdown.d.ts +29 -0
- package/lib/primitives/dashboard/PageChip/index.d.ts +3 -0
- package/lib/primitives/dashboard/PageChip/types.d.ts +36 -0
- package/lib/primitives/dashboard/TimeFrame/SimpleSelector.d.ts +9 -0
- package/lib/primitives/dashboard/TimeFrame/index.d.ts +2 -0
- package/lib/primitives/dashboard/TimeFrame/types.d.ts +8 -0
- package/lib/primitives/dashboard/UnifiedContextMenu/types.d.ts +2 -0
- package/lib/primitives/dashboard/index.d.ts +2 -0
- package/lib/wrappers/Actionable/Actionable.d.ts +17 -0
- package/lib/wrappers/AsyncLoader/AsyncLoader.d.ts +13 -0
- package/lib/wrappers/ButtonGroup/ButtonGroup.d.ts +23 -0
- package/lib/wrappers/CheckboxGroup/CheckboxGroup.d.ts +52 -0
- package/lib/wrappers/Dismissible/Dismissible.d.ts +24 -0
- package/lib/wrappers/Expandable/Expandable.d.ts +23 -0
- package/lib/wrappers/InputGroup/InputGroup.d.ts +20 -0
- package/lib/wrappers/RadioGroup/RadioGroup.d.ts +52 -0
- package/lib/wrappers/Selectable/Selectable.d.ts +19 -0
- package/lib/wrappers/Sortable/Sortable.d.ts +27 -0
- package/lib/wrappers/SortableZones/SortableZones.d.ts +32 -0
- package/lib/wrappers/SortableZones/index.d.ts +4 -0
- package/lib/wrappers/SortableZones/useSortableZones.d.ts +66 -0
- package/lib/wrappers/Transition/Transition.d.ts +49 -0
- package/lib/wrappers/index.d.ts +25 -0
- package/lib/wrappers/utils.d.ts +10 -0
- package/package.json +37 -3
- package/index.css +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** A single overflow action entry (opaque — consumer fills these). */
|
|
3
|
+
export interface ChipMenuAction {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
onSelect: (statusId: string) => void;
|
|
7
|
+
}
|
|
8
|
+
/** Props for StatusSlotChipMenu. */
|
|
9
|
+
export interface StatusSlotChipMenuProps {
|
|
10
|
+
/** Whether the menu is visible. */
|
|
11
|
+
open: boolean;
|
|
12
|
+
/** The slot element that was clicked — used as anchor for positioning. */
|
|
13
|
+
anchorEl: HTMLElement | null;
|
|
14
|
+
/** Status identifier for callback identity only — not treated as domain data. */
|
|
15
|
+
statusId: string;
|
|
16
|
+
/** Primary action: open the associated data table. */
|
|
17
|
+
onOpenInTable: (statusId: string) => void;
|
|
18
|
+
/** Standard action: show this status on the graph. Always present. */
|
|
19
|
+
onShowOnGraph: (statusId: string) => void;
|
|
20
|
+
/** Overflow actions (opaque — reptime-supplied, e.g. Angular deep-links). */
|
|
21
|
+
overflowActions?: ReadonlyArray<ChipMenuAction>;
|
|
22
|
+
/** Called when menu should close (Escape, outside click, or after action). */
|
|
23
|
+
onClose: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function StatusSlotChipMenu({ open, anchorEl, statusId, onOpenInTable, onShowOnGraph, overflowActions, onClose, }: StatusSlotChipMenuProps): React.ReactPortal | null;
|
|
26
|
+
export declare namespace StatusSlotChipMenu {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FlipAndStageValue } from './types';
|
|
3
|
+
export interface FlipAndStageProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Context provider for flip-and-stage config mode.
|
|
8
|
+
*
|
|
9
|
+
* Mount once at MetricCardGrid scope. All descendant cards that call
|
|
10
|
+
* useFlipAndStageContext() share the same state instance, enforcing the
|
|
11
|
+
* one-card-at-a-time invariant automatically.
|
|
12
|
+
*/
|
|
13
|
+
export declare function FlipAndStageProvider({ children }: FlipAndStageProviderProps): JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Access the flip-and-stage context value.
|
|
16
|
+
*
|
|
17
|
+
* Must be called inside a <FlipAndStageProvider> — throws an invariant error otherwise.
|
|
18
|
+
*
|
|
19
|
+
* @throws {Error} When called outside a FlipAndStageProvider
|
|
20
|
+
*/
|
|
21
|
+
export declare function useFlipAndStageContext(): FlipAndStageValue;
|
|
22
|
+
/**
|
|
23
|
+
* Optional variant of useFlipAndStageContext that returns null instead of throwing
|
|
24
|
+
* when called outside a FlipAndStageProvider.
|
|
25
|
+
*
|
|
26
|
+
* Used by MetricCardGrid for graceful degradation — the grid renders normally
|
|
27
|
+
* without config-mode panel when no provider is present.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useFlipAndStageContextOptional(): FlipAndStageValue | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 13, Plan 01: flipAndStage barrel export.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports everything needed by consumers of the flip-and-stage feature:
|
|
5
|
+
* - useFlipAndStage hook
|
|
6
|
+
* - FlipAndStageProvider context provider
|
|
7
|
+
* - useFlipAndStageContext consumer hook
|
|
8
|
+
* - FLIP_AND_STAGE_TIMINGS animation contract
|
|
9
|
+
* - All public types
|
|
10
|
+
*/
|
|
11
|
+
export { useFlipAndStage } from './useFlipAndStage';
|
|
12
|
+
export { FlipAndStageProvider, useFlipAndStageContext, useFlipAndStageContextOptional } from './FlipAndStageProvider';
|
|
13
|
+
export type { FlipAndStageProviderProps } from './FlipAndStageProvider';
|
|
14
|
+
export { FLIP_AND_STAGE_TIMINGS, } from './types';
|
|
15
|
+
export type { FlipAndStageState, FlipAndStageValue, FlipAndStageInternalState, UseFlipAndStageOptions, } from './types';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 13, Plan 01: useFlipAndStage type contracts.
|
|
3
|
+
*
|
|
4
|
+
* State machine: idle → configuring → idle
|
|
5
|
+
* One card at a time; switching cards silently discards prior dirty state (D-06).
|
|
6
|
+
* No framer-motion dependency — purely JS state.
|
|
7
|
+
*
|
|
8
|
+
* @module flipAndStage/types
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Animation timing contract for the flip-and-stage choreography.
|
|
12
|
+
*
|
|
13
|
+
* Phase: flip-start → panel-extrude → settle
|
|
14
|
+
* Total: 350ms
|
|
15
|
+
*
|
|
16
|
+
* @see D-05 (Phase 13 context)
|
|
17
|
+
*/
|
|
18
|
+
export declare const FLIP_AND_STAGE_TIMINGS: {
|
|
19
|
+
/** Delay before flip animation begins (ms). */
|
|
20
|
+
readonly flipStart: 50;
|
|
21
|
+
/** Duration of panel extrude animation (ms). */
|
|
22
|
+
readonly extrude: 200;
|
|
23
|
+
/** Duration of settle animation (ms). */
|
|
24
|
+
readonly settle: 100;
|
|
25
|
+
/** Total choreography duration (ms). */
|
|
26
|
+
readonly total: 350;
|
|
27
|
+
};
|
|
28
|
+
/** The two machine states for flip-and-stage config mode. */
|
|
29
|
+
export type FlipAndStageState = 'idle' | 'configuring';
|
|
30
|
+
/**
|
|
31
|
+
* Internal state managed by the useReducer inside useFlipAndStage.
|
|
32
|
+
* Not exposed directly — consumers use FlipAndStageValue.
|
|
33
|
+
*/
|
|
34
|
+
export interface FlipAndStageInternalState {
|
|
35
|
+
state: FlipAndStageState;
|
|
36
|
+
activeCardId: string | null;
|
|
37
|
+
activeDimensionId: string | null;
|
|
38
|
+
dirtyState: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The full value exposed by useFlipAndStage and FlipAndStageContext.
|
|
42
|
+
*
|
|
43
|
+
* - `activeCardId` — which card is in config mode (null = none)
|
|
44
|
+
* - `activeDimensionId` — optional dimension chosen from CardBack chooser
|
|
45
|
+
* - `state` — machine state ('idle' | 'configuring')
|
|
46
|
+
* - `dirtyState` — accumulated unsaved field edits
|
|
47
|
+
* - `beginConfig` — enter config mode for a card; silently replaces prior active card
|
|
48
|
+
* - `commitConfig` — persist edits and return to idle; optional patch merged into dirty
|
|
49
|
+
* - `cancelConfig` — discard edits and return to idle
|
|
50
|
+
* - `setDirty` — merge additional edits into dirtyState
|
|
51
|
+
*/
|
|
52
|
+
export interface FlipAndStageValue {
|
|
53
|
+
activeCardId: string | null;
|
|
54
|
+
activeDimensionId: string | null;
|
|
55
|
+
state: FlipAndStageState;
|
|
56
|
+
dirtyState: Record<string, unknown>;
|
|
57
|
+
/**
|
|
58
|
+
* Enter config mode for the given card.
|
|
59
|
+
* @param cardId - must be a non-empty string; null/empty is rejected with console.warn
|
|
60
|
+
* @param dimensionId - optional dimension for CardBack chooser
|
|
61
|
+
*/
|
|
62
|
+
beginConfig: (cardId: string, dimensionId?: string) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Commit edits and return to idle.
|
|
65
|
+
* No-op when state is 'idle'.
|
|
66
|
+
* @param patch - optional extra fields merged into dirtyState before onCommit fires
|
|
67
|
+
*/
|
|
68
|
+
commitConfig: (patch?: Record<string, unknown>) => void;
|
|
69
|
+
/** Discard edits and return to idle. No-op when state is 'idle'. */
|
|
70
|
+
cancelConfig: () => void;
|
|
71
|
+
/** Merge additional dirty fields. Successive calls accumulate (not replace). */
|
|
72
|
+
setDirty: (patch: Record<string, unknown>) => void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Options for useFlipAndStage.
|
|
76
|
+
*/
|
|
77
|
+
export interface UseFlipAndStageOptions {
|
|
78
|
+
/**
|
|
79
|
+
* Called when commitConfig fires.
|
|
80
|
+
* Receives the merged dirty state (existing + commit patch).
|
|
81
|
+
*/
|
|
82
|
+
onCommit?: (merged: Record<string, unknown>) => void;
|
|
83
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FlipAndStageValue, UseFlipAndStageOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* State machine hook for the flip-and-stage config mode choreography.
|
|
4
|
+
*
|
|
5
|
+
* Provides begin/commit/cancel/setDirty actions with stable useCallback references.
|
|
6
|
+
* Suitable for use as the inner implementation behind FlipAndStageProvider.
|
|
7
|
+
*
|
|
8
|
+
* @param options.onCommit - fired when commitConfig() is called; receives merged dirty state
|
|
9
|
+
*/
|
|
10
|
+
export declare function useFlipAndStage(options?: UseFlipAndStageOptions): FlipAndStageValue;
|
|
@@ -4,12 +4,22 @@ export { CardBack } from './CardBack';
|
|
|
4
4
|
export { TrendIndicator } from './TrendIndicator';
|
|
5
5
|
export { GutterActions } from './GutterActions';
|
|
6
6
|
export { StackedGroupCard } from './StackedGroupCard';
|
|
7
|
+
export { StatusModeCard } from './StatusModeCard';
|
|
8
|
+
export { StatusSlotChipMenu } from './StatusSlotChipMenu';
|
|
9
|
+
export type { StatusSlotChipMenuProps, ChipMenuAction } from './StatusSlotChipMenu';
|
|
10
|
+
export { EdgeHoverHandle } from './EdgeHoverHandle';
|
|
11
|
+
export { GhostPreview } from './GhostPreview';
|
|
7
12
|
export { useSlideOutReveal } from './useSlideOutReveal';
|
|
13
|
+
export { useEdgeHoverResize } from './useEdgeHoverResize';
|
|
14
|
+
export * from './flipAndStage';
|
|
8
15
|
export * from './types';
|
|
9
16
|
export type { CardBackProps } from './CardBack';
|
|
10
17
|
export type { GutterActionsProps } from './GutterActions';
|
|
11
18
|
export type { StackedGroupCardProps, StackedValueEntry } from './StackedGroupCard';
|
|
12
19
|
export type { SlideOutRevealConfig, SlideOutRevealReturn } from './useSlideOutReveal';
|
|
20
|
+
export type { ResizeState, ResizeDirection, ResizeMode, ResizeCommit, UseEdgeHoverResizeArgs, UseEdgeHoverResizeReturn, } from './useEdgeHoverResize';
|
|
21
|
+
export type { EdgeHoverHandleProps } from './EdgeHoverHandle';
|
|
22
|
+
export type { GhostPreviewProps } from './GhostPreview';
|
|
13
23
|
export { SparklineBg } from './visualizations/SparklineBg';
|
|
14
24
|
export { BarsBg } from './visualizations/BarsBg';
|
|
15
25
|
export { DonutChart } from './visualizations/DonutChart';
|
|
@@ -24,6 +24,10 @@ export interface VersusData {
|
|
|
24
24
|
currentLabel?: string;
|
|
25
25
|
priorLabel?: string;
|
|
26
26
|
}
|
|
27
|
+
/** Card display mode — default 'time-period' is back-compat with all existing variants. */
|
|
28
|
+
export type MetricCardMode = 'time-period' | 'status';
|
|
29
|
+
/** Slot capacity for Status Mode width-driven rendering (Plan 02). */
|
|
30
|
+
export type SlotCapacity = 1 | 3 | 5;
|
|
27
31
|
/** Base props shared by all MetricCard variants. */
|
|
28
32
|
export interface BaseMetricCardProps {
|
|
29
33
|
label: string;
|
|
@@ -31,11 +35,20 @@ export interface BaseMetricCardProps {
|
|
|
31
35
|
valueFormat?: ValueFormat;
|
|
32
36
|
trend?: TrendData | null;
|
|
33
37
|
subtitle?: string;
|
|
34
|
-
colSpan?: 1 | 2;
|
|
38
|
+
colSpan?: 1 | 2 | 3;
|
|
35
39
|
isStale?: boolean;
|
|
36
40
|
isLoading?: boolean;
|
|
37
41
|
isError?: boolean;
|
|
38
42
|
isEmpty?: boolean;
|
|
43
|
+
/** Display mode — undefined is equivalent to 'time-period' for back-compat. */
|
|
44
|
+
mode?: MetricCardMode;
|
|
45
|
+
/**
|
|
46
|
+
* Phase 15 — threshold visual breach treatment (D-06).
|
|
47
|
+
* 'warn' → amber border tint + WarningIcon (NEVER color-only, D-28)
|
|
48
|
+
* 'critical' → red border tint + CriticalIcon + pulse animation
|
|
49
|
+
* 'none' → no treatment (default)
|
|
50
|
+
*/
|
|
51
|
+
thresholdBreach?: 'none' | 'warn' | 'critical';
|
|
39
52
|
}
|
|
40
53
|
export interface StandardVariant extends BaseMetricCardProps {
|
|
41
54
|
variant: 'standard';
|
|
@@ -78,8 +91,31 @@ export interface SegmentedVariant extends BaseMetricCardProps {
|
|
|
78
91
|
variant: 'segmented';
|
|
79
92
|
segments: SegmentEntry[];
|
|
80
93
|
}
|
|
94
|
+
/** A single status slot entry for Status Mode cards (Phase 10). */
|
|
95
|
+
export interface StatusEntry {
|
|
96
|
+
id: string;
|
|
97
|
+
label: string;
|
|
98
|
+
value: number | string;
|
|
99
|
+
accentColor?: string;
|
|
100
|
+
}
|
|
101
|
+
/** Status Mode variant — flag-gated; renders status slots instead of time-period value. */
|
|
102
|
+
export interface StatusModeVariant extends BaseMetricCardProps {
|
|
103
|
+
variant: 'status-mode';
|
|
104
|
+
statuses: ReadonlyArray<StatusEntry>;
|
|
105
|
+
activeStatusId?: string;
|
|
106
|
+
/** Per-status sparkline data keyed by status.id (Plan 02). */
|
|
107
|
+
sparklinePerStatus?: Record<string, ReadonlyArray<number>>;
|
|
108
|
+
/** Override computed slot capacity — test hook / opt-out (Plan 02). */
|
|
109
|
+
maxSlots?: SlotCapacity;
|
|
110
|
+
/**
|
|
111
|
+
* Called when a status slot is clicked (Plan 04 — chip-menu wiring).
|
|
112
|
+
* statusId: the clicked slot's status id.
|
|
113
|
+
* anchorEl: the slot DOM element — used to anchor the chip menu.
|
|
114
|
+
*/
|
|
115
|
+
onStatusSlotClick?: (statusId: string, anchorEl: HTMLElement) => void;
|
|
116
|
+
}
|
|
81
117
|
/** Discriminated union of all MetricCard variant props. */
|
|
82
|
-
export type MetricCardProps = StandardVariant | SparklineVariant | BarsVariant | DonutVariant | HighlightVariant | ArrowVariant | ObjectArrowVariant | VersusVariant | SegmentedVariant;
|
|
118
|
+
export type MetricCardProps = StandardVariant | SparklineVariant | BarsVariant | DonutVariant | HighlightVariant | ArrowVariant | ObjectArrowVariant | VersusVariant | SegmentedVariant | StatusModeVariant;
|
|
83
119
|
/**
|
|
84
120
|
* All card type identifiers for type-guard compatibility.
|
|
85
121
|
* The 9 renderable variants (standard through segmented) map to MetricCardProps discriminated union.
|
|
@@ -90,13 +126,21 @@ export type MetricCardProps = StandardVariant | SparklineVariant | BarsVariant |
|
|
|
90
126
|
export type MetricCardType = 'standard' | 'sparkline' | 'bars' | 'donut' | 'highlight' | 'arrow' | 'object-arrow' | 'versus' | 'segmented' | 'name' | 'ratio' | 'action' | 'stacked-group';
|
|
91
127
|
/** Props for the CardShell wrapper component. */
|
|
92
128
|
export interface CardShellProps {
|
|
93
|
-
children
|
|
94
|
-
|
|
129
|
+
/** Preferred slot for card content. Use this instead of children. */
|
|
130
|
+
contentSlot?: ReactNode;
|
|
131
|
+
/** @deprecated Use contentSlot instead. */
|
|
132
|
+
children?: ReactNode;
|
|
133
|
+
colSpan?: 1 | 2 | 3;
|
|
95
134
|
isStale?: boolean;
|
|
96
135
|
isRetrying?: boolean;
|
|
97
136
|
beta?: boolean;
|
|
98
137
|
disabled?: boolean;
|
|
99
138
|
style?: CSSProperties;
|
|
139
|
+
/**
|
|
140
|
+
* When true, renders a 2px accent ring around the card shell using box-shadow
|
|
141
|
+
* (NOT border, to avoid reflow). Used to indicate config mode is active (D-09).
|
|
142
|
+
*/
|
|
143
|
+
accentRing?: boolean;
|
|
100
144
|
onGraph?: () => void;
|
|
101
145
|
onDetails?: () => void;
|
|
102
146
|
onCustomize?: ((ref: RefObject<HTMLDivElement | null>) => void) | (() => void);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type ResizeState = 'idle' | 'dwelling' | 'handle-visible' | 'dragging' | 'committed' | 'cancelled';
|
|
2
|
+
export type ResizeDirection = 'grow' | 'shrink';
|
|
3
|
+
export type ResizeMode = 'slot-fill' | 'sparkline-fidelity';
|
|
4
|
+
export interface ResizeCommit {
|
|
5
|
+
direction: ResizeDirection;
|
|
6
|
+
targetColSpan: 1 | 2 | 3;
|
|
7
|
+
mode: ResizeMode;
|
|
8
|
+
}
|
|
9
|
+
export interface UseEdgeHoverResizeArgs {
|
|
10
|
+
currentColSpan: 1 | 2 | 3;
|
|
11
|
+
stackable: boolean;
|
|
12
|
+
onResize: (commit: ResizeCommit) => void;
|
|
13
|
+
onCancel?: () => void;
|
|
14
|
+
/** Hover dwell time before handle appears. Default: 120ms */
|
|
15
|
+
dwellMs?: number;
|
|
16
|
+
/** AN-06 enter motion duration exposed for consumer CSS. Default: 180ms */
|
|
17
|
+
enterMs?: number;
|
|
18
|
+
/** AN-06 exit motion duration exposed for consumer CSS. Default: 120ms */
|
|
19
|
+
exitMs?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface UseEdgeHoverResizeReturn {
|
|
22
|
+
state: ResizeState;
|
|
23
|
+
enterEdgeZone: () => void;
|
|
24
|
+
leaveEdgeZone: () => void;
|
|
25
|
+
handleProps: {
|
|
26
|
+
onPointerDown: (e: React.PointerEvent) => void;
|
|
27
|
+
onPointerUp: (e: React.PointerEvent) => void;
|
|
28
|
+
};
|
|
29
|
+
ghostProps: {
|
|
30
|
+
visible: boolean;
|
|
31
|
+
enterMs: number;
|
|
32
|
+
exitMs: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* useEdgeHoverResize — State machine for edge-hover-to-resize gesture.
|
|
37
|
+
*
|
|
38
|
+
* State flow:
|
|
39
|
+
* idle → dwelling (hover dwell 120ms) → handle-visible → dragging (pointerdown) → committed (pointerup) | cancelled
|
|
40
|
+
* dwelling | handle-visible → idle (pointer leaves edge zone)
|
|
41
|
+
* dragging | handle-visible → cancelled (Escape key)
|
|
42
|
+
*
|
|
43
|
+
* The hook does NOT inspect any reptime-domain data. The consumer passes `stackable`
|
|
44
|
+
* (from metricInfo) and the hook emits the correct mode string — no cross-domain leakage.
|
|
45
|
+
*
|
|
46
|
+
* Threat mitigations:
|
|
47
|
+
* T-10.03-01: clearDwell() in cleanup useEffect prevents timer leak on unmount
|
|
48
|
+
* T-10.03-02: Math.min/max clamp keeps targetColSpan ∈ {1,2,3}
|
|
49
|
+
*
|
|
50
|
+
* Motion contract (AN-06): enterMs=180, exitMs=120 (defaults)
|
|
51
|
+
*/
|
|
52
|
+
export declare function useEdgeHoverResize({ currentColSpan, stackable, onResize, onCancel, dwellMs, enterMs, exitMs, }: UseEdgeHoverResizeArgs): UseEdgeHoverResizeReturn;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export type SlotCapacity = 1 | 3 | 5;
|
|
3
|
+
export declare function useSlotCapacity(ref: RefObject<HTMLElement | null>, opts?: {
|
|
4
|
+
thresholds?: {
|
|
5
|
+
slot3: number;
|
|
6
|
+
slot5: number;
|
|
7
|
+
};
|
|
8
|
+
debounceMs?: number;
|
|
9
|
+
}): {
|
|
10
|
+
capacity: SlotCapacity;
|
|
11
|
+
onPointerUp: () => void;
|
|
12
|
+
};
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { MetricCardGridProps } from './types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Finds the best adjacent slot to extrude the QuickConfigPanel into.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `renderEmptySlot`. The grid manages DnD interaction internally and reports
|
|
9
|
-
* order changes via `onReorder`.
|
|
6
|
+
* Priority: right → below → left → above.
|
|
7
|
+
* Returns null if activeIndex is invalid or no candidates exist.
|
|
10
8
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* import type { GridCardData, GridLayout } from '@mt-gloss/ui';
|
|
9
|
+
* When all neighbors are occupied (packed grid), returns the right neighbor
|
|
10
|
+
* index for dim-cover fallback — the caller distinguishes empty vs occupied
|
|
11
|
+
* by checking if extrudeIndex >= cardCount.
|
|
15
12
|
*
|
|
16
|
-
*
|
|
13
|
+
* @param activeIndex Index of the active card in the ordered visible-cards array (0-based)
|
|
14
|
+
* @param cardCount Total number of cards in the visible page
|
|
15
|
+
* @param columns Grid column count
|
|
16
|
+
*/
|
|
17
|
+
export declare function findExtrudeSlot(activeIndex: number, cardCount: number, columns: number): number | null;
|
|
18
|
+
/**
|
|
19
|
+
* MetricCardGrid - CSS grid layout with @dnd-kit drag-and-drop reordering.
|
|
17
20
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* ```
|
|
21
|
+
* Config-mode extension (Phase 13, D-07):
|
|
22
|
+
* - Reads activeCardId from FlipAndStageProvider via useFlipAndStageContextOptional
|
|
23
|
+
* - When activeCardId is set, places QuickConfigPanel adjacent to active card
|
|
24
|
+
* - Extrude-first: empty neighbor gets panel (right→below→left→above priority)
|
|
25
|
+
* - Packed grid: dims right neighbor (opacity:0.3, pointer-events:none, aria-hidden)
|
|
26
|
+
* - Source card stays full opacity, never aria-hidden (D-08)
|
|
27
|
+
* - AnimatePresence wraps panel: transform+opacity only (AN-01)
|
|
28
|
+
* - Graceful degradation: no FlipAndStageProvider → null context → no panel, no crash
|
|
27
29
|
*/
|
|
28
30
|
export declare const MetricCardGrid: React.NamedExoticComponent<MetricCardGridProps>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { QuickConfigSection } from '../../../composites/dashboard/QuickConfigPanel/types';
|
|
2
3
|
/** Data for a single card slot in the grid. */
|
|
3
4
|
export interface GridCardData {
|
|
4
5
|
id: string;
|
|
5
|
-
colSpan: 1 | 2;
|
|
6
|
+
colSpan: 1 | 2 | 3;
|
|
6
7
|
content: ReactNode;
|
|
7
8
|
}
|
|
8
9
|
/** Grid layout configuration. */
|
|
@@ -25,4 +26,10 @@ export interface MetricCardGridProps {
|
|
|
25
26
|
onShrink?: (cardId: string) => void;
|
|
26
27
|
renderCard: (card: GridCardData) => ReactNode;
|
|
27
28
|
renderEmptySlot?: (index: number) => ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Sections passed through to QuickConfigPanel when config mode is active.
|
|
31
|
+
* Required for panel to render meaningful content during flip-and-stage.
|
|
32
|
+
* D-07: panel renders adjacent to active card slot.
|
|
33
|
+
*/
|
|
34
|
+
configSections?: QuickConfigSection[];
|
|
28
35
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MetricGroupContainerProps } from '../types';
|
|
2
|
+
export declare const DISCRETE_2: Extract<MetricGroupContainerProps, {
|
|
3
|
+
renderMode: 'discrete';
|
|
4
|
+
}>;
|
|
5
|
+
export declare const DISCRETE_4: Extract<MetricGroupContainerProps, {
|
|
6
|
+
renderMode: 'discrete';
|
|
7
|
+
}>;
|
|
8
|
+
export declare const COMPOSITE_2_NO_CHROME: Extract<MetricGroupContainerProps, {
|
|
9
|
+
renderMode: 'composite';
|
|
10
|
+
}>;
|
|
11
|
+
export declare const COMPOSITE_2_WITH_CHROME: Extract<MetricGroupContainerProps, {
|
|
12
|
+
renderMode: 'composite';
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Opaque slot data consumed by {@link MetricGroupContainer}.
|
|
4
|
+
* The container never introspects `children` — the consumer (e.g. reptime MetricGroupHost)
|
|
5
|
+
* materializes any React content it wants into each slot.
|
|
6
|
+
*
|
|
7
|
+
* VO-01-A: this file's exported fields are the strict subset
|
|
8
|
+
* {renderMode, cards, composite} — no metricId, groupId, dataSource, cardType, or
|
|
9
|
+
* reptime entity-type strings. Enforced by Plan 03 ESLint rule + vitest source-grep.
|
|
10
|
+
*/
|
|
11
|
+
export interface GroupSlot {
|
|
12
|
+
key: string;
|
|
13
|
+
gridPosition: {
|
|
14
|
+
col: number;
|
|
15
|
+
row: number;
|
|
16
|
+
};
|
|
17
|
+
size: 'standard' | 'wide' | 'tall';
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export type MetricGroupContainerProps = {
|
|
21
|
+
renderMode: 'discrete';
|
|
22
|
+
cards: GroupSlot[];
|
|
23
|
+
} | {
|
|
24
|
+
renderMode: 'composite';
|
|
25
|
+
cards: GroupSlot[];
|
|
26
|
+
composite?: {
|
|
27
|
+
label?: string;
|
|
28
|
+
accentColor?: string;
|
|
29
|
+
trend?: {
|
|
30
|
+
direction: 'up' | 'down' | 'flat';
|
|
31
|
+
delta?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PageChipProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* PageChip -- Corner-mounted page navigation chip.
|
|
4
|
+
*
|
|
5
|
+
* Renders with `position: absolute` at top-right of its container (AP-06
|
|
6
|
+
* compliant: zero grid-cell occupancy). Displays a "{current} / {total}"
|
|
7
|
+
* label and opens a PageDropdown on click.
|
|
8
|
+
*
|
|
9
|
+
* The nuzzle mask creates a concave cutout via `mask-image: radial-gradient`,
|
|
10
|
+
* matching the production-proven technique from FusedShape.tsx.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <PageChip
|
|
15
|
+
* currentIndex={0}
|
|
16
|
+
* total={3}
|
|
17
|
+
* pages={pages}
|
|
18
|
+
* onPageChange={handleSwitch}
|
|
19
|
+
* onCreatePage={handleCreate}
|
|
20
|
+
* onManagePages={handleManage}
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const PageChip: {
|
|
25
|
+
({ currentIndex, total, pages, onPageChange, onCreatePage, onManagePages, maskRadius, }: PageChipProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PageDropdownProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* PageDropdown -- Page navigation dropdown composed on BasePopover.
|
|
4
|
+
*
|
|
5
|
+
* Renders exactly one `[role=menu]` element (AP-04 compliant: no nested
|
|
6
|
+
* overlays or sub-views). Lists pages with filled/hollow dot indicators,
|
|
7
|
+
* muted metric count, and italic styling for unnamed pages.
|
|
8
|
+
*
|
|
9
|
+
* Contains two action rows: "+ New page" and "Manage pages", separated
|
|
10
|
+
* by horizontal rules.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <PageDropdown
|
|
15
|
+
* open={isOpen}
|
|
16
|
+
* onDismiss={close}
|
|
17
|
+
* anchorRef={chipRef}
|
|
18
|
+
* pages={pages}
|
|
19
|
+
* activePageId="p1"
|
|
20
|
+
* onPageChange={handleSwitch}
|
|
21
|
+
* onCreatePage={handleCreate}
|
|
22
|
+
* onManagePages={handleManage}
|
|
23
|
+
* />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function PageDropdown({ open, onDismiss, anchorRef, pages, activePageId, onPageChange, onCreatePage, onManagePages, }: PageDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare namespace PageDropdown {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/** Describes a single page entry in the dropdown list. */
|
|
3
|
+
export interface PageInfo {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
named: boolean;
|
|
7
|
+
cardCount: number;
|
|
8
|
+
}
|
|
9
|
+
/** Props for the PageChip corner navigation element. */
|
|
10
|
+
export interface PageChipProps {
|
|
11
|
+
/** 0-based index of the active page. */
|
|
12
|
+
currentIndex: number;
|
|
13
|
+
/** Total page count. */
|
|
14
|
+
total: number;
|
|
15
|
+
/** Array of page info objects for the dropdown. */
|
|
16
|
+
pages: PageInfo[];
|
|
17
|
+
/** Callback when user selects a different page. */
|
|
18
|
+
onPageChange: (pageId: string) => void;
|
|
19
|
+
/** Callback when user clicks "+ New page". */
|
|
20
|
+
onCreatePage: () => void;
|
|
21
|
+
/** Callback when user clicks "Manage pages". */
|
|
22
|
+
onManagePages: () => void;
|
|
23
|
+
/** CSS value for nuzzle mask radius; defaults to 'var(--gloss-radius-md)'. */
|
|
24
|
+
maskRadius?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Props for the PageDropdown popover. */
|
|
27
|
+
export interface PageDropdownProps {
|
|
28
|
+
open: boolean;
|
|
29
|
+
onDismiss: () => void;
|
|
30
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
31
|
+
pages: PageInfo[];
|
|
32
|
+
activePageId: string;
|
|
33
|
+
onPageChange: (pageId: string) => void;
|
|
34
|
+
onCreatePage: () => void;
|
|
35
|
+
onManagePages: () => void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DateRangeValue } from './types';
|
|
3
|
+
export interface SimpleSelectorProps {
|
|
4
|
+
value: DateRangeValue;
|
|
5
|
+
onChange: (value: DateRangeValue) => void;
|
|
6
|
+
onPresetChange?: (presetId: string) => void;
|
|
7
|
+
activePresetId?: string | null;
|
|
8
|
+
}
|
|
9
|
+
export declare const SimpleSelector: React.FC<SimpleSelectorProps>;
|
|
@@ -8,6 +8,8 @@ export { TimeFrame } from './TimeFrame';
|
|
|
8
8
|
export { MiniCalendar } from './MiniCalendar';
|
|
9
9
|
export { ExpandableChip } from './ExpandableChip';
|
|
10
10
|
export { MarketPresetRow } from './MarketPresetRow';
|
|
11
|
+
export { SimpleSelector } from './SimpleSelector';
|
|
12
|
+
export type { SimpleSelectorProps } from './SimpleSelector';
|
|
11
13
|
export type { HybridDatePickerProps, TimeFrameProps, MiniCalendarProps, ExpandableChipProps, MarketPresetRowProps, MarketPresetData, DateRangeValue, CompareValue, DateChangePayload, DatePreferences, ComparePreferences, MarketEvent, PresetDefinition, MarketPreset, DateRange, CalendarSize, RangeColor, MarketDateInfo, } from './types';
|
|
12
14
|
export { formatDateRange, formatMarketDates, isMarketActive, isSameDay, isInRange, generateMarketId } from './utils/dateHelpers';
|
|
13
15
|
export { getDateRangeForPreset, findPreset, getPresetLabel, normalizePresetId, toUppercasePresetId, getAllPresets, ROLLING_OPTIONS, PERIOD_OPTIONS, TODAY_PRESET, DEFAULT_MARKET_PRESETS, DEFAULT_PINNED, } from './utils/presets';
|
|
@@ -199,4 +199,12 @@ export interface TimeFrameProps {
|
|
|
199
199
|
onMarketDelete?: (marketId: string) => void;
|
|
200
200
|
/** MUI sx prop for container styling */
|
|
201
201
|
sx?: SxProps<Theme>;
|
|
202
|
+
/**
|
|
203
|
+
* Render variant.
|
|
204
|
+
* 'full' = existing HybridDatePicker with calendar (default).
|
|
205
|
+
* 'simple-selector' = compact sectioned dropdown of preset shortcuts for reconfig panel.
|
|
206
|
+
*/
|
|
207
|
+
variant?: 'full' | 'simple-selector';
|
|
208
|
+
/** Currently active preset ID — used by simple-selector to highlight active option */
|
|
209
|
+
activePresetId?: string | null;
|
|
202
210
|
}
|
|
@@ -61,6 +61,8 @@ export interface UnifiedMenuAction {
|
|
|
61
61
|
subtitle?: string;
|
|
62
62
|
/** Dynamic label function based on row and entity context */
|
|
63
63
|
labelFn?: (row: Record<string, unknown>, entityType?: string) => string;
|
|
64
|
+
/** Visual variant (e.g., 'destructive' for delete actions) */
|
|
65
|
+
variant?: 'default' | 'destructive';
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
66
68
|
* Context provided to menu action handlers.
|
|
@@ -2,9 +2,11 @@ export * from './FilterChip';
|
|
|
2
2
|
export * from './TabGroup';
|
|
3
3
|
export * from './Skeleton';
|
|
4
4
|
export * from './MetricCard';
|
|
5
|
+
export * from './PageChip';
|
|
5
6
|
export * from './UnifiedBreakdownTable';
|
|
6
7
|
export * from './ChartControlBar';
|
|
7
8
|
export * from './UnifiedContextMenu';
|
|
8
9
|
export * from './TimeFrame';
|
|
9
10
|
export * from './MetricCardGrid';
|
|
10
11
|
export * from './TabbedDataView';
|
|
12
|
+
export * from './MetricGroupContainer';
|