@mt-gloss/ui 0.0.6 → 0.0.8
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/index.d.ts +77 -75
- package/index.js +13027 -12107
- package/lib/composites/cards/BarChartCard.d.ts +43 -0
- package/lib/composites/cards/ComparisonCard.d.ts +46 -0
- package/lib/composites/cards/DirectionCard.d.ts +43 -0
- package/lib/composites/cards/DistributionCard.d.ts +45 -0
- package/lib/composites/cards/HighlightCard.d.ts +41 -0
- package/lib/composites/cards/ProgressCard.d.ts +43 -0
- package/lib/composites/cards/SegmentCard.d.ts +45 -0
- package/lib/composites/cards/SimpleMetricCard.d.ts +39 -0
- package/lib/composites/cards/TrendCard.d.ts +43 -0
- package/lib/composites/cards/index.d.ts +18 -0
- package/lib/composites/forms/PasswordInput.d.ts +79 -0
- package/lib/{composed → composites/forms}/PhoneInput.d.ts +26 -28
- package/lib/composites/forms/SearchInput.d.ts +89 -0
- package/lib/composites/index.d.ts +2 -0
- package/lib/compositions/index.d.ts +3 -0
- package/lib/{Button.d.ts → primitives/Button.d.ts} +1 -1
- package/lib/{Link.d.ts → primitives/Link.d.ts} +1 -1
- package/lib/{SegmentedControl.d.ts → primitives/SegmentedControl.d.ts} +1 -1
- package/lib/{Select.d.ts → primitives/Select.d.ts} +1 -1
- package/lib/{SplitButton.d.ts → primitives/SplitButton.d.ts} +1 -1
- package/lib/{Transition.d.ts → primitives/Transition.d.ts} +1 -1
- package/lib/{dashboard → primitives/dashboard}/ChartControlBar/types.d.ts +4 -1
- package/lib/primitives/dashboard/MetricCard/CardBack.d.ts +31 -0
- package/lib/primitives/dashboard/MetricCard/CardShell.d.ts +22 -0
- package/lib/{dashboard → primitives/dashboard}/MetricCard/index.d.ts +2 -0
- package/lib/{dashboard → primitives/dashboard}/MetricCard/types.d.ts +17 -0
- package/lib/{dashboard → primitives/dashboard}/UnifiedContextMenu/UnifiedContextMenu.d.ts +1 -1
- package/lib/primitives/dashboard/UnifiedContextMenu/config.d.ts +42 -0
- package/lib/{dashboard → primitives/dashboard}/UnifiedContextMenu/index.d.ts +2 -0
- package/lib/{dashboard → primitives/dashboard}/UnifiedContextMenu/types.d.ts +24 -4
- package/package.json +10 -2
- package/lib/composed/PasswordInput.d.ts +0 -75
- package/lib/composed/SearchInput.d.ts +0 -80
- package/lib/dashboard/MetricCard/CardShell.d.ts +0 -22
- package/lib/patterns/index.d.ts +0 -14
- /package/lib/{composed → composites/forms}/AddressSelect.d.ts +0 -0
- /package/lib/{composed → composites/forms}/PaymentMethodSelect.d.ts +0 -0
- /package/lib/{composed → composites/forms}/TagInput.d.ts +0 -0
- /package/lib/{composed → composites/forms}/index.d.ts +0 -0
- /package/lib/{patterns → compositions}/feedback/DestructiveModal.d.ts +0 -0
- /package/lib/{patterns → compositions}/feedback/index.d.ts +0 -0
- /package/lib/{patterns → compositions}/forms/AddressGroup.d.ts +0 -0
- /package/lib/{patterns → compositions}/forms/CreditCardForm.d.ts +0 -0
- /package/lib/{patterns → compositions}/forms/LoginForm.d.ts +0 -0
- /package/lib/{patterns → compositions}/forms/index.d.ts +0 -0
- /package/lib/{patterns → compositions}/types.d.ts +0 -0
- /package/lib/{Accordion.d.ts → primitives/Accordion.d.ts} +0 -0
- /package/lib/{AsyncLoader.d.ts → primitives/AsyncLoader.d.ts} +0 -0
- /package/lib/{Badge.d.ts → primitives/Badge.d.ts} +0 -0
- /package/lib/{ButtonGroup.d.ts → primitives/ButtonGroup.d.ts} +0 -0
- /package/lib/{Card.d.ts → primitives/Card.d.ts} +0 -0
- /package/lib/{Checkbox.d.ts → primitives/Checkbox.d.ts} +0 -0
- /package/lib/{CheckboxGroup.d.ts → primitives/CheckboxGroup.d.ts} +0 -0
- /package/lib/{Chip.d.ts → primitives/Chip.d.ts} +0 -0
- /package/lib/{ColorPicker.d.ts → primitives/ColorPicker.d.ts} +0 -0
- /package/lib/{DatePicker.d.ts → primitives/DatePicker.d.ts} +0 -0
- /package/lib/{DateRangePicker.d.ts → primitives/DateRangePicker.d.ts} +0 -0
- /package/lib/{Dropdown.d.ts → primitives/Dropdown.d.ts} +0 -0
- /package/lib/{FileUpload.d.ts → primitives/FileUpload.d.ts} +0 -0
- /package/lib/{Form.d.ts → primitives/Form.d.ts} +0 -0
- /package/lib/{FormField.d.ts → primitives/FormField.d.ts} +0 -0
- /package/lib/{Input.d.ts → primitives/Input.d.ts} +0 -0
- /package/lib/{InputGroup.d.ts → primitives/InputGroup.d.ts} +0 -0
- /package/lib/{MaskedInput.d.ts → primitives/MaskedInput.d.ts} +0 -0
- /package/lib/{Menu.d.ts → primitives/Menu.d.ts} +0 -0
- /package/lib/{NumberInput.d.ts → primitives/NumberInput.d.ts} +0 -0
- /package/lib/{Radio.d.ts → primitives/Radio.d.ts} +0 -0
- /package/lib/{RadioGroup.d.ts → primitives/RadioGroup.d.ts} +0 -0
- /package/lib/{RangeSlider.d.ts → primitives/RangeSlider.d.ts} +0 -0
- /package/lib/{Rating.d.ts → primitives/Rating.d.ts} +0 -0
- /package/lib/{Slider.d.ts → primitives/Slider.d.ts} +0 -0
- /package/lib/{Textarea.d.ts → primitives/Textarea.d.ts} +0 -0
- /package/lib/{TimePicker.d.ts → primitives/TimePicker.d.ts} +0 -0
- /package/lib/{Toggle.d.ts → primitives/Toggle.d.ts} +0 -0
- /package/lib/{Tooltip.d.ts → primitives/Tooltip.d.ts} +0 -0
- /package/lib/{dashboard → primitives/dashboard}/ChartControlBar/ChartControlBar.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/ChartControlBar/FilterInput.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/ChartControlBar/FusedShape.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/ChartControlBar/Row1Controls.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/ChartControlBar/Row2FilterTray.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/ChartControlBar/fixtures/controlBarStates.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/ChartControlBar/index.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/ChartControlBar/useFilterLayout.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/FilterChip/FilterChip.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/FilterChip/fixtures/filterChips.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/FilterChip/index.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/FilterChip/types.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/GutterActions.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/MetricCard.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/StackedGroupCard.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/TrendIndicator.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/fixtures/allVariants.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/fixtures/sparklineCard.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/fixtures/standardCard.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/fixtures/states.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/useSlideOutReveal.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/utils/formatTrend.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/utils/formatValue.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/visualizations/BarsBg.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/visualizations/DonutChart.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/visualizations/ObjectArrow.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCard/visualizations/SparklineBg.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCardGrid/MetricCardGrid.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCardGrid/fixtures/gridCards.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCardGrid/fixtures/layouts.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCardGrid/index.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/MetricCardGrid/types.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/Skeleton/Skeleton.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/Skeleton/SkeletonCard.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/Skeleton/SkeletonChart.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/Skeleton/SkeletonTable.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/Skeleton/fixtures/skeletonSamples.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/Skeleton/index.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/Skeleton/types.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TabGroup/TabGroup.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TabGroup/fixtures/tabGroups.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TabGroup/index.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TabGroup/types.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TabbedDataView/TabbedDataView.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TabbedDataView/fixtures/tabConfigs.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TabbedDataView/index.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TabbedDataView/types.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TimeFrame/ExpandableChip.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TimeFrame/HybridDatePicker.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TimeFrame/MarketPresetRow.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TimeFrame/MiniCalendar.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TimeFrame/TimeFrame.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TimeFrame/fixtures/timeFrameSamples.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TimeFrame/index.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TimeFrame/types.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TimeFrame/utils/dateHelpers.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TimeFrame/utils/presets.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/TimeFrame/utils/smartDateFormat.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/UnifiedBreakdownTable/UnifiedBreakdownTable.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/UnifiedBreakdownTable/fixtures/columns.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/UnifiedBreakdownTable/fixtures/itemRows.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/UnifiedBreakdownTable/fixtures/orderRows.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/UnifiedBreakdownTable/index.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/UnifiedBreakdownTable/types.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/UnifiedContextMenu/fixtures/menuActions.d.ts +0 -0
- /package/lib/{dashboard → primitives/dashboard}/index.d.ts +0 -0
|
@@ -2,7 +2,10 @@ import { TabGroupProps } from '../TabGroup/types';
|
|
|
2
2
|
/** A selectable filter option for entity/item dropdowns. */
|
|
3
3
|
export interface FilterOption {
|
|
4
4
|
id: string;
|
|
5
|
-
|
|
5
|
+
/** Display text (dashboard convention) */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** Display text (gloss-ui convention) */
|
|
8
|
+
label?: string;
|
|
6
9
|
type?: string;
|
|
7
10
|
group?: string;
|
|
8
11
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface CardBackProps {
|
|
2
|
+
currentTimeframe?: string;
|
|
3
|
+
onSelectTimeframe?: (presetId: string) => void;
|
|
4
|
+
title?: string;
|
|
5
|
+
mode?: 'single' | 'stacked';
|
|
6
|
+
currentStackedTimeframes?: string[];
|
|
7
|
+
onSelectStackedTimeframes?: (timeframes: string[]) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* CardBack - Back face of the 3D flipped card.
|
|
11
|
+
* Shows timeframe preset grid for quick configuration.
|
|
12
|
+
*
|
|
13
|
+
* Supports two modes:
|
|
14
|
+
* - `single`: select one timeframe preset
|
|
15
|
+
* - `stacked`: select 2-3 timeframes for stacked group cards
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { CardBack } from '@mt-gloss/ui';
|
|
20
|
+
*
|
|
21
|
+
* <CardBack
|
|
22
|
+
* mode="single"
|
|
23
|
+
* currentTimeframe="MTD"
|
|
24
|
+
* onSelectTimeframe={(presetId) => console.log(presetId)}
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const CardBack: {
|
|
29
|
+
({ currentTimeframe, onSelectTimeframe, title, mode, currentStackedTimeframes, onSelectStackedTimeframes, }: CardBackProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CardShellProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* CardShell - Shared card wrapper with hover states, 180ms leave timeout,
|
|
4
|
+
* 3D perspective container, and GutterActions integration.
|
|
5
|
+
*
|
|
6
|
+
* Supports 3D flip to a CardBack panel for quick timeframe settings when
|
|
7
|
+
* `enableQuickSettings` is true. Stacked group cards can flip to select
|
|
8
|
+
* multiple timeframes.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { CardShell, MetricCard } from '@mt-gloss/ui';
|
|
13
|
+
*
|
|
14
|
+
* <CardShell colSpan={1} enableQuickSettings onUpdateTimeframe={handleTimeframe}>
|
|
15
|
+
* <MetricCard variant="standard" label="Revenue" value={125430} />
|
|
16
|
+
* </CardShell>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const CardShell: {
|
|
20
|
+
({ children, colSpan, isStale, isRetrying, beta, disabled, style, onGraph, onDetails, onCustomize, onRemove, onWhatsThis, onExpand, onShrink, onMove, onReplace, onNavigate, onRetry, onRefresh, enableQuickSettings, onUpdateTimeframe, instanceTimeframe, cardTitle, onViewAsStack, onUnstack, isStackedGroup, onUpdateStackedTimeframes, instanceStackedTimeframes, isGraphActive, isTableActive, isGraphCard, canExpand, cardRef: externalCardRef, }: CardShellProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { MetricCard } from './MetricCard';
|
|
2
2
|
export { CardShell } from './CardShell';
|
|
3
|
+
export { CardBack } from './CardBack';
|
|
3
4
|
export { TrendIndicator } from './TrendIndicator';
|
|
4
5
|
export { GutterActions } from './GutterActions';
|
|
5
6
|
export { StackedGroupCard } from './StackedGroupCard';
|
|
6
7
|
export { useSlideOutReveal } from './useSlideOutReveal';
|
|
7
8
|
export * from './types';
|
|
9
|
+
export type { CardBackProps } from './CardBack';
|
|
8
10
|
export type { GutterActionsProps } from './GutterActions';
|
|
9
11
|
export type { StackedGroupCardProps, StackedValueEntry } from './StackedGroupCard';
|
|
10
12
|
export type { SlideOutRevealConfig, SlideOutRevealReturn } from './useSlideOutReveal';
|
|
@@ -80,6 +80,14 @@ export interface SegmentedVariant extends BaseMetricCardProps {
|
|
|
80
80
|
}
|
|
81
81
|
/** Discriminated union of all MetricCard variant props. */
|
|
82
82
|
export type MetricCardProps = StandardVariant | SparklineVariant | BarsVariant | DonutVariant | HighlightVariant | ArrowVariant | ObjectArrowVariant | VersusVariant | SegmentedVariant;
|
|
83
|
+
/**
|
|
84
|
+
* All card type identifiers for type-guard compatibility.
|
|
85
|
+
* The 9 renderable variants (standard through segmented) map to MetricCardProps discriminated union.
|
|
86
|
+
* The 4 additional types (name, ratio, action, stacked-group) are handled by separate
|
|
87
|
+
* dashboard-specific components (NameCard, RatioCard, ErrorCard, StackedGroupCard).
|
|
88
|
+
* INTEG-10: 'action' variant rendering is intentionally out of scope -- ErrorCard handles it.
|
|
89
|
+
*/
|
|
90
|
+
export type MetricCardType = 'standard' | 'sparkline' | 'bars' | 'donut' | 'highlight' | 'arrow' | 'object-arrow' | 'versus' | 'segmented' | 'name' | 'ratio' | 'action' | 'stacked-group';
|
|
83
91
|
/** Props for the CardShell wrapper component. */
|
|
84
92
|
export interface CardShellProps {
|
|
85
93
|
children: ReactNode;
|
|
@@ -101,6 +109,15 @@ export interface CardShellProps {
|
|
|
101
109
|
onRetry?: () => void;
|
|
102
110
|
onRefresh?: () => void;
|
|
103
111
|
onWhatsThis?: () => void;
|
|
112
|
+
enableQuickSettings?: boolean;
|
|
113
|
+
onUpdateTimeframe?: (presetId: string) => void;
|
|
114
|
+
instanceTimeframe?: string;
|
|
115
|
+
cardTitle?: string;
|
|
116
|
+
onViewAsStack?: () => void;
|
|
117
|
+
onUnstack?: () => void;
|
|
118
|
+
isStackedGroup?: boolean;
|
|
119
|
+
onUpdateStackedTimeframes?: (timeframes: string[]) => void;
|
|
120
|
+
instanceStackedTimeframes?: string[];
|
|
104
121
|
isGraphActive?: boolean;
|
|
105
122
|
isTableActive?: boolean;
|
|
106
123
|
isGraphCard?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { UnifiedContextMenuProps } from './types';
|
|
3
|
-
declare function UnifiedContextMenuInner({ anchorEl, open, onClose, actions, row, entityType, dispatch, onAddTab, onFilter, onUpdateViz, onActionClick, }: UnifiedContextMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function UnifiedContextMenuInner({ anchorEl, open, onClose, actions: actionsProp, cellKind, row, entityType, entityId, entityName, timeFrame, userType, tableType, field, syncTimeFrame, dispatch, onAddTab, onFilter, onUpdateViz, onActionClick, }: UnifiedContextMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const UnifiedContextMenu: React.MemoExoticComponent<typeof UnifiedContextMenuInner>;
|
|
5
5
|
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CellKind, UnifiedMenuAction, MenuFilterOptions, EntityType } from './types';
|
|
2
|
+
/** Maps entity type to profile navigation route key and param key */
|
|
3
|
+
export declare const ENTITY_PROFILE_ROUTES: Record<EntityType, {
|
|
4
|
+
routeKey: string;
|
|
5
|
+
paramKey: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
}>;
|
|
8
|
+
/** Maps singular entity type to filter key for tab creation */
|
|
9
|
+
export declare const ENTITY_FILTER_KEYS: Record<EntityType, string>;
|
|
10
|
+
/** Maps singular entity type to plural form */
|
|
11
|
+
export declare const ENTITY_TYPE_PLURAL: Record<EntityType, string>;
|
|
12
|
+
export declare const MENU_ACTIONS: UnifiedMenuAction[];
|
|
13
|
+
/**
|
|
14
|
+
* Get filtered menu actions for a given cell kind and context.
|
|
15
|
+
*
|
|
16
|
+
* Filters by: cellKind, entityType, userType, orderStatus, tableType, field.
|
|
17
|
+
* Actions are returned in registry order (sections are grouped).
|
|
18
|
+
*/
|
|
19
|
+
export declare function getMenuActions(cellKind: CellKind, options?: MenuFilterOptions): UnifiedMenuAction[];
|
|
20
|
+
/**
|
|
21
|
+
* Tab ID generation context -- data needed to construct backward-compatible tab IDs.
|
|
22
|
+
*/
|
|
23
|
+
export interface TabIdContext {
|
|
24
|
+
entityType?: string;
|
|
25
|
+
entityId?: string;
|
|
26
|
+
pluralEntityType?: string;
|
|
27
|
+
itemNumber?: string;
|
|
28
|
+
orderId?: string;
|
|
29
|
+
instanceId?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Generate a backward-compatible tab ID for a given action.
|
|
33
|
+
*
|
|
34
|
+
* Patterns:
|
|
35
|
+
* Entity tabs: ${pluralEntityType}-${entityId}
|
|
36
|
+
* Item orders: item-orders-${itemNumber}
|
|
37
|
+
* Item customers: item-customers-${itemNumber}
|
|
38
|
+
* Item customers (revenue): item-customers-${itemNumber}-revenue
|
|
39
|
+
* Order items: order-items-${orderId}
|
|
40
|
+
* Metric tabs: metric-${instanceId}
|
|
41
|
+
*/
|
|
42
|
+
export declare function generateTabId(actionId: string, context: TabIdContext): string;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { UnifiedContextMenu } from './UnifiedContextMenu';
|
|
2
|
+
export { getMenuActions, generateTabId, ENTITY_PROFILE_ROUTES, ENTITY_FILTER_KEYS, ENTITY_TYPE_PLURAL } from './config';
|
|
3
|
+
export type { TabIdContext } from './config';
|
|
2
4
|
export type { UnifiedContextMenuProps, UnifiedMenuAction, MenuActionContext, MenuFilterOptions, CellKind, MenuSection, EntityType, } from './types';
|
|
3
5
|
export { entityNameActions, orderIdActions, numericActions, allFixtures as contextMenuFixtures } from './fixtures/menuActions';
|
|
@@ -101,8 +101,12 @@ export interface MenuFilterOptions {
|
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Props for the glossui UnifiedContextMenu component.
|
|
104
|
-
*
|
|
105
|
-
* Supports dual-mode:
|
|
104
|
+
*
|
|
105
|
+
* Supports dual-mode input:
|
|
106
|
+
* - Mode 1 (pre-filtered): Pass `actions` array directly
|
|
107
|
+
* - Mode 2 (cellKind-based): Pass `cellKind` and let the component compute actions via getMenuActions
|
|
108
|
+
*
|
|
109
|
+
* Supports dual-mode dispatch: `dispatch` prop OR individual callbacks.
|
|
106
110
|
*/
|
|
107
111
|
export interface UnifiedContextMenuProps {
|
|
108
112
|
/** Anchor element for menu positioning */
|
|
@@ -111,12 +115,28 @@ export interface UnifiedContextMenuProps {
|
|
|
111
115
|
open: boolean;
|
|
112
116
|
/** Close handler */
|
|
113
117
|
onClose: () => void;
|
|
114
|
-
/** Pre-filtered actions from container */
|
|
115
|
-
actions: UnifiedMenuAction[];
|
|
116
118
|
/** The data row that triggered the menu */
|
|
117
119
|
row: Record<string, unknown>;
|
|
118
120
|
/** Entity type context */
|
|
119
121
|
entityType?: string;
|
|
122
|
+
/** Pre-filtered actions from container */
|
|
123
|
+
actions?: UnifiedMenuAction[];
|
|
124
|
+
/** Cell kind for automatic action filtering via getMenuActions */
|
|
125
|
+
cellKind?: CellKind;
|
|
126
|
+
/** Entity ID from the row */
|
|
127
|
+
entityId?: string;
|
|
128
|
+
/** Entity display name from the row */
|
|
129
|
+
entityName?: string;
|
|
130
|
+
/** Current timeframe for the table/context */
|
|
131
|
+
timeFrame?: unknown;
|
|
132
|
+
/** Current user type (sales-agency, manufacturer, buyer) */
|
|
133
|
+
userType?: string;
|
|
134
|
+
/** Current table type */
|
|
135
|
+
tableType?: string;
|
|
136
|
+
/** Clicked field name */
|
|
137
|
+
field?: string;
|
|
138
|
+
/** Sync timeframe flag for leaderboard tabs */
|
|
139
|
+
syncTimeFrame?: boolean;
|
|
120
140
|
/** Dashboard dispatch function (if available) */
|
|
121
141
|
dispatch?: (action: Record<string, unknown>) => void;
|
|
122
142
|
/** Callback for tab creation actions */
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mt-gloss/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
5
8
|
"main": "./index.js",
|
|
6
9
|
"module": "./index.js",
|
|
7
10
|
"types": "./index.d.ts",
|
|
@@ -10,7 +13,12 @@
|
|
|
10
13
|
"import": {
|
|
11
14
|
"types": "./index.d.ts",
|
|
12
15
|
"default": "./index.js"
|
|
13
|
-
}
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"types": "./index.d.ts",
|
|
19
|
+
"default": "./index.js"
|
|
20
|
+
},
|
|
21
|
+
"default": "./index.js"
|
|
14
22
|
},
|
|
15
23
|
"./styles.css": "./index.css"
|
|
16
24
|
},
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { InputProps } from '../Input';
|
|
3
|
-
export interface PasswordStrengthRule {
|
|
4
|
-
/**
|
|
5
|
-
* Unique identifier for the rule
|
|
6
|
-
*/
|
|
7
|
-
id: string;
|
|
8
|
-
/**
|
|
9
|
-
* Display label for the rule
|
|
10
|
-
*/
|
|
11
|
-
label: string;
|
|
12
|
-
/**
|
|
13
|
-
* Validation function
|
|
14
|
-
*/
|
|
15
|
-
validate: (password: string) => boolean;
|
|
16
|
-
}
|
|
17
|
-
export type PasswordStrength = 'weak' | 'fair' | 'good' | 'strong';
|
|
18
|
-
export interface PasswordInputProps extends Omit<InputProps, 'type' | 'rightIcon'> {
|
|
19
|
-
/**
|
|
20
|
-
* Whether to show the visibility toggle button
|
|
21
|
-
* @default true
|
|
22
|
-
*/
|
|
23
|
-
showToggle?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Whether to show the password strength indicator
|
|
26
|
-
* @default false
|
|
27
|
-
*/
|
|
28
|
-
showStrength?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Pre-calculated password strength (if you want to control it externally)
|
|
31
|
-
*/
|
|
32
|
-
strength?: PasswordStrength;
|
|
33
|
-
/**
|
|
34
|
-
* Custom strength calculation rules
|
|
35
|
-
* If not provided, uses default rules
|
|
36
|
-
*/
|
|
37
|
-
strengthRules?: PasswordStrengthRule[];
|
|
38
|
-
/**
|
|
39
|
-
* Whether to show a generate password button
|
|
40
|
-
* @default false
|
|
41
|
-
*/
|
|
42
|
-
showGenerate?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Callback when generate button is clicked
|
|
45
|
-
* If not provided, uses built-in generator
|
|
46
|
-
*/
|
|
47
|
-
onGenerate?: (password: string) => void;
|
|
48
|
-
/**
|
|
49
|
-
* Length of generated password
|
|
50
|
-
* @default 16
|
|
51
|
-
*/
|
|
52
|
-
generateLength?: number;
|
|
53
|
-
/**
|
|
54
|
-
* Whether to show rule checklist
|
|
55
|
-
* @default false
|
|
56
|
-
*/
|
|
57
|
-
showRules?: boolean;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* PasswordInput - Specialized input for password entry
|
|
61
|
-
*
|
|
62
|
-
* Features visibility toggle, strength indicator, rule checklist,
|
|
63
|
-
* and password generation.
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```tsx
|
|
67
|
-
* <PasswordInput
|
|
68
|
-
* label="Password"
|
|
69
|
-
* showStrength
|
|
70
|
-
* showRules
|
|
71
|
-
* showGenerate
|
|
72
|
-
* />
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
export declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { InputProps } from '../Input';
|
|
3
|
-
export interface SearchSuggestion {
|
|
4
|
-
/**
|
|
5
|
-
* Unique identifier for the suggestion
|
|
6
|
-
*/
|
|
7
|
-
id: string;
|
|
8
|
-
/**
|
|
9
|
-
* Display text for the suggestion
|
|
10
|
-
*/
|
|
11
|
-
label: string;
|
|
12
|
-
/**
|
|
13
|
-
* Optional description text
|
|
14
|
-
*/
|
|
15
|
-
description?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Optional icon name
|
|
18
|
-
*/
|
|
19
|
-
icon?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface SearchInputProps extends Omit<InputProps, 'leftIcon' | 'rightIcon' | 'clearable'> {
|
|
22
|
-
/**
|
|
23
|
-
* Callback when search is triggered (Enter key or search button)
|
|
24
|
-
*/
|
|
25
|
-
onSearch?: (value: string) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Debounce delay in milliseconds for onChange
|
|
28
|
-
* @default 0
|
|
29
|
-
*/
|
|
30
|
-
debounce?: number;
|
|
31
|
-
/**
|
|
32
|
-
* Whether a search is currently in progress
|
|
33
|
-
*/
|
|
34
|
-
isSearching?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* List of suggestions to display in dropdown
|
|
37
|
-
*/
|
|
38
|
-
suggestions?: SearchSuggestion[];
|
|
39
|
-
/**
|
|
40
|
-
* Callback when a suggestion is selected
|
|
41
|
-
*/
|
|
42
|
-
onSuggestionSelect?: (suggestion: SearchSuggestion) => void;
|
|
43
|
-
/**
|
|
44
|
-
* Whether to show suggestions dropdown
|
|
45
|
-
* @default false
|
|
46
|
-
*/
|
|
47
|
-
showSuggestions?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Show keyboard shortcut hint (e.g., Cmd+K)
|
|
50
|
-
*/
|
|
51
|
-
showShortcut?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Keyboard shortcut key (works with Cmd/Ctrl)
|
|
54
|
-
* @default 'k'
|
|
55
|
-
*/
|
|
56
|
-
shortcutKey?: string;
|
|
57
|
-
/**
|
|
58
|
-
* Whether the search input should always show clear button when has value
|
|
59
|
-
* @default true
|
|
60
|
-
*/
|
|
61
|
-
clearable?: boolean;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* SearchInput - Specialized input for search functionality
|
|
65
|
-
*
|
|
66
|
-
* Features search icon, debounced onChange, suggestions dropdown,
|
|
67
|
-
* keyboard shortcut support, and loading state.
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```tsx
|
|
71
|
-
* <SearchInput
|
|
72
|
-
* placeholder="Search..."
|
|
73
|
-
* onSearch={(query) => searchProducts(query)}
|
|
74
|
-
* suggestions={suggestions}
|
|
75
|
-
* onSuggestionSelect={handleSelect}
|
|
76
|
-
* showShortcut
|
|
77
|
-
* />
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
export declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CardShellProps } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* CardShell - Shared card wrapper with hover states, 180ms leave timeout,
|
|
4
|
-
* and perspective container.
|
|
5
|
-
*
|
|
6
|
-
* GlossUI version: accepts `gutterContent` as a ReactNode slot instead of
|
|
7
|
-
* importing GutterActions directly. This keeps CardShell free of dashboard-
|
|
8
|
-
* specific UI dependencies.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* import { CardShell, MetricCard } from '@mt-gloss/ui';
|
|
13
|
-
*
|
|
14
|
-
* <CardShell colSpan={1}>
|
|
15
|
-
* <MetricCard variant="standard" label="Revenue" value={125430} />
|
|
16
|
-
* </CardShell>
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare const CardShell: {
|
|
20
|
-
({ children, colSpan, isStale, isRetrying, beta, disabled, style, onGraph, onDetails, onCustomize, onRemove, onWhatsThis, onExpand, onShrink, onMove, onReplace, onNavigate, onRetry, onRefresh, isGraphActive, isTableActive, isGraphCard, canExpand, cardRef: externalCardRef, }: CardShellProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
displayName: string;
|
|
22
|
-
};
|
package/lib/patterns/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gloss UI Patterns
|
|
3
|
-
*
|
|
4
|
-
* Composite, pre-configured component groupings for common use cases.
|
|
5
|
-
* Each pattern exports:
|
|
6
|
-
* - Default: The React component
|
|
7
|
-
* - metadata: PatternMetadata for database sync
|
|
8
|
-
* - schema (optional): Zod validation schema
|
|
9
|
-
*/
|
|
10
|
-
export type { PatternMetadata, PatternPropDefinition, PatternCategory, PatternRecord, } from './types';
|
|
11
|
-
export { default as LoginForm, metadata as loginFormMetadata, loginSchema, type LoginFormProps, } from './forms/LoginForm';
|
|
12
|
-
export { default as AddressGroup, metadata as addressGroupMetadata, addressSchema, type AddressGroupProps, } from './forms/AddressGroup';
|
|
13
|
-
export { default as CreditCardForm, metadata as creditCardFormMetadata, creditCardSchema, type CreditCardFormProps, } from './forms/CreditCardForm';
|
|
14
|
-
export { default as DestructiveModal, metadata as destructiveModalMetadata, type DestructiveModalProps, } from './feedback/DestructiveModal';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/{dashboard → primitives/dashboard}/ChartControlBar/fixtures/controlBarStates.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|