@umituz/web-design-system 5.3.0 → 5.3.1
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/styles.css +1 -1
- package/package.json +1 -1
- package/src/__tests__/cn.test.ts +0 -3
- package/src/__tests__/component-slots.test.tsx +0 -4
- package/src/__tests__/components.smoke.test.tsx +3 -11
- package/src/__tests__/money.test.tsx +0 -3
- package/src/__tests__/styles.contract.test.ts +0 -13
- package/src/domain/tokens/index.ts +0 -7
- package/src/domain/tokens/responsive-map.tokens.ts +18 -107
- package/src/domain/types/breakpoint.types.ts +9 -13
- package/src/domain/types/component.types.ts +0 -4
- package/src/domain/types/index.ts +0 -5
- package/src/global.d.ts +0 -4
- package/src/index.ts +0 -21
- package/src/infrastructure/constants/breakpoint.constants.ts +0 -31
- package/src/infrastructure/constants/component.constants.ts +0 -4
- package/src/infrastructure/constants/index.ts +0 -5
- package/src/infrastructure/constants/size-variant.constants.ts +0 -33
- package/src/infrastructure/constants/spacing.constants.ts +34 -63
- package/src/infrastructure/constants/timing.constants.ts +0 -18
- package/src/infrastructure/constants/typography.constants.ts +22 -54
- package/src/infrastructure/utils/calculation.utils.ts +0 -9
- package/src/infrastructure/utils/cn.util.ts +0 -18
- package/src/infrastructure/utils/hash.util.ts +0 -5
- package/src/infrastructure/utils/index.ts +0 -5
- package/src/infrastructure/utils/money.utils.ts +0 -7
- package/src/infrastructure/utils/responsive.utils.ts +0 -66
- package/src/presentation/atoms/AspectRatio.tsx +0 -10
- package/src/presentation/atoms/Badge.tsx +0 -5
- package/src/presentation/atoms/BatteryPill.tsx +0 -5
- package/src/presentation/atoms/Button.tsx +0 -2
- package/src/presentation/atoms/Checkbox.tsx +0 -4
- package/src/presentation/atoms/Divider.tsx +0 -4
- package/src/presentation/atoms/HeatmapStrip.tsx +0 -10
- package/src/presentation/atoms/Hide.tsx +0 -24
- package/src/presentation/atoms/Icon.tsx +0 -4
- package/src/presentation/atoms/IconButton.tsx +0 -4
- package/src/presentation/atoms/Input.tsx +0 -4
- package/src/presentation/atoms/Kbd.tsx +0 -4
- package/src/presentation/atoms/Label.tsx +0 -4
- package/src/presentation/atoms/Link.tsx +0 -4
- package/src/presentation/atoms/Money.tsx +0 -6
- package/src/presentation/atoms/Progress.tsx +0 -6
- package/src/presentation/atoms/Radio.tsx +0 -4
- package/src/presentation/atoms/Separator.tsx +0 -4
- package/src/presentation/atoms/Show.tsx +0 -24
- package/src/presentation/atoms/Skeleton.tsx +0 -4
- package/src/presentation/atoms/Slider.tsx +0 -4
- package/src/presentation/atoms/Sparkline.tsx +0 -4
- package/src/presentation/atoms/Spinner.tsx +0 -4
- package/src/presentation/atoms/Switch.tsx +0 -4
- package/src/presentation/atoms/Text.tsx +0 -4
- package/src/presentation/atoms/Textarea.tsx +0 -4
- package/src/presentation/atoms/Toggle.tsx +0 -4
- package/src/presentation/atoms/Tooltip.tsx +0 -4
- package/src/presentation/atoms/index.ts +0 -5
- package/src/presentation/hooks/index.ts +0 -5
- package/src/presentation/hooks/useClickOutside.ts +0 -6
- package/src/presentation/hooks/useClipboard.ts +0 -4
- package/src/presentation/hooks/useDebounce.ts +0 -8
- package/src/presentation/hooks/useKeyboard.ts +0 -6
- package/src/presentation/hooks/useLocalStorage.ts +0 -4
- package/src/presentation/hooks/useMediaQuery.ts +0 -37
- package/src/presentation/hooks/useScrollLock.ts +0 -5
- package/src/presentation/hooks/useTheme.ts +9 -13
- package/src/presentation/hooks/useToggle.ts +0 -4
- package/src/presentation/molecules/ActiveFilterTags.tsx +0 -4
- package/src/presentation/molecules/Avatar.tsx +0 -5
- package/src/presentation/molecules/BookmarkButton.tsx +0 -15
- package/src/presentation/molecules/CheckboxGroup.tsx +0 -4
- package/src/presentation/molecules/Chip.tsx +0 -5
- package/src/presentation/molecules/CodeBlock.tsx +0 -5
- package/src/presentation/molecules/Field.tsx +0 -7
- package/src/presentation/molecules/FormField.tsx +1 -5
- package/src/presentation/molecules/InputGroup.tsx +0 -4
- package/src/presentation/molecules/ListItem.tsx +0 -4
- package/src/presentation/molecules/OptionTile.tsx +0 -10
- package/src/presentation/molecules/RadioGroup.tsx +0 -4
- package/src/presentation/molecules/RatingStars.tsx +0 -8
- package/src/presentation/molecules/ScrollArea.tsx +0 -4
- package/src/presentation/molecules/SearchBox.tsx +0 -4
- package/src/presentation/molecules/Select.tsx +0 -4
- package/src/presentation/molecules/StatPill.tsx +0 -5
- package/src/presentation/molecules/TagInput.tsx +0 -7
- package/src/presentation/molecules/Textarea.tsx +0 -4
- package/src/presentation/molecules/Toggle.tsx +0 -4
- package/src/presentation/molecules/index.ts +0 -6
- package/src/presentation/organisms/Accordion.tsx +0 -4
- package/src/presentation/organisms/Alert.tsx +0 -4
- package/src/presentation/organisms/AvatarStack.tsx +0 -5
- package/src/presentation/organisms/Breadcrumb.tsx +0 -7
- package/src/presentation/organisms/Card.tsx +0 -6
- package/src/presentation/organisms/Checklist.tsx +0 -4
- package/src/presentation/organisms/Collapsible.tsx +0 -4
- package/src/presentation/organisms/ConfirmDialog.tsx +0 -8
- package/src/presentation/organisms/CoverArt.tsx +0 -9
- package/src/presentation/organisms/DataTable.tsx +0 -8
- package/src/presentation/organisms/DateRangePicker.tsx +0 -9
- package/src/presentation/organisms/Dialog.tsx +0 -4
- package/src/presentation/organisms/Drawer.tsx +0 -6
- package/src/presentation/organisms/DropdownMenu.tsx +0 -4
- package/src/presentation/organisms/ErrorBoundary.tsx +0 -12
- package/src/presentation/organisms/FileUploader.tsx +0 -9
- package/src/presentation/organisms/FilterPopover.tsx +0 -8
- package/src/presentation/organisms/FormModal.tsx +0 -5
- package/src/presentation/organisms/HoverCard.tsx +0 -4
- package/src/presentation/organisms/KeyValueList.tsx +0 -4
- package/src/presentation/organisms/KpiCard.tsx +0 -6
- package/src/presentation/organisms/Lightbox.tsx +0 -7
- package/src/presentation/organisms/LoadingState.tsx +0 -4
- package/src/presentation/organisms/MapPreview.tsx +0 -9
- package/src/presentation/organisms/MetricCard.tsx +1 -5
- package/src/presentation/organisms/Modal.tsx +0 -4
- package/src/presentation/organisms/PhotoGallery.tsx +0 -9
- package/src/presentation/organisms/PlanPicker.tsx +0 -5
- package/src/presentation/organisms/Popover.tsx +0 -4
- package/src/presentation/organisms/Sheet.tsx +0 -4
- package/src/presentation/organisms/StatCard.tsx +0 -5
- package/src/presentation/organisms/StatusBadge.tsx +0 -12
- package/src/presentation/organisms/Stepper.tsx +0 -5
- package/src/presentation/organisms/Table.tsx +0 -4
- package/src/presentation/organisms/Tabs.tsx +0 -7
- package/src/presentation/organisms/Timeline.tsx +0 -8
- package/src/presentation/organisms/Toaster.tsx +0 -9
- package/src/presentation/organisms/ToggleGroup.tsx +0 -4
- package/src/presentation/organisms/index.ts +0 -5
- package/src/presentation/templates/Form.tsx +0 -4
- package/src/presentation/templates/List.tsx +0 -4
- package/src/presentation/templates/PageHeader.tsx +0 -4
- package/src/presentation/templates/PageLayout.tsx +0 -4
- package/src/presentation/templates/ProjectSkeleton.tsx +0 -4
- package/src/presentation/templates/ResponsiveContainer.tsx +0 -43
- package/src/presentation/templates/Section.tsx +0 -4
- package/src/presentation/templates/index.ts +0 -5
- package/src/styles/app.css +0 -18
- package/src/styles/bridge.css +0 -34
- package/src/styles/compile.css +0 -13
- package/src/styles/source.css +0 -12
- package/src/styles/theme.css +0 -27
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Molecules Export
|
|
3
|
-
* @description Molecule components - combinations of atoms
|
|
4
|
-
* Subpath: @umituz/web-design-system/molecules
|
|
5
|
-
*/
|
|
6
1
|
|
|
7
2
|
export { FormField } from './FormField';
|
|
8
3
|
export type { FormFieldProps } from './FormField';
|
|
@@ -41,7 +36,6 @@ export { ScrollArea, ScrollBar } from './ScrollArea';
|
|
|
41
36
|
export { ListItem } from './ListItem';
|
|
42
37
|
export type { ListItemProps } from './ListItem';
|
|
43
38
|
|
|
44
|
-
// NEW: Filter & Navigation Components
|
|
45
39
|
export { ActiveFilterTags } from './ActiveFilterTags';
|
|
46
40
|
export type { ActiveFilterTagsProps } from './ActiveFilterTags';
|
|
47
41
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AvatarStack Component (Organism)
|
|
3
|
-
* @description Overlapping avatar row built on the Avatar molecule with an overflow count badge
|
|
4
|
-
*/
|
|
5
1
|
|
|
6
2
|
import { forwardRef } from 'react';
|
|
7
3
|
import { cn } from '../../infrastructure/utils';
|
|
@@ -16,7 +12,6 @@ export interface AvatarPerson {
|
|
|
16
12
|
|
|
17
13
|
export interface AvatarStackProps extends BaseProps {
|
|
18
14
|
people: AvatarPerson[];
|
|
19
|
-
/** Avatars shown before the +N badge (default 4). */
|
|
20
15
|
max?: number;
|
|
21
16
|
size?: ExtendedSizes;
|
|
22
17
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Breadcrumb Component (Organism)
|
|
3
|
-
* @description Navigation breadcrumb trail
|
|
4
|
-
*/
|
|
5
1
|
|
|
6
2
|
import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';
|
|
7
3
|
import { cn } from '../../infrastructure/utils';
|
|
@@ -13,9 +9,6 @@ export interface BreadcrumbItem {
|
|
|
13
9
|
label: string;
|
|
14
10
|
href?: string;
|
|
15
11
|
icon?: ReactNode;
|
|
16
|
-
/** Renders this node instead of the default anchor — for hosts that need
|
|
17
|
-
* SPA router links (react-router `Link`, Next `Link`, …). When set, label
|
|
18
|
-
* and href are ignored for rendering. */
|
|
19
12
|
content?: ReactNode;
|
|
20
13
|
}
|
|
21
14
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Card Component (Organism)
|
|
3
|
-
* @description Content container with header, body, footer
|
|
4
|
-
*/
|
|
5
1
|
|
|
6
2
|
import { forwardRef, type HTMLAttributes } from 'react';
|
|
7
3
|
import React from 'react';
|
|
@@ -11,9 +7,7 @@ import type { BaseProps } from '../../domain/types';
|
|
|
11
7
|
|
|
12
8
|
export interface CardProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
13
9
|
variant?: 'default' | 'outlined' | 'elevated';
|
|
14
|
-
/** Render as the single child element (e.g. a router Link) instead of a div. */
|
|
15
10
|
asChild?: boolean;
|
|
16
|
-
/** Interactive card: pointer cursor, hover border and a visible focus ring. */
|
|
17
11
|
interactive?: boolean;
|
|
18
12
|
}
|
|
19
13
|
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ConfirmDialog Component (Organism)
|
|
3
|
-
* @description Destructive/primary confirmation built on Modal: title, body and
|
|
4
|
-
* Cancel + confirm actions; unmounts itself after confirming
|
|
5
|
-
*/
|
|
6
1
|
|
|
7
2
|
import type { ReactNode } from 'react';
|
|
8
3
|
import { Button } from '../atoms/Button';
|
|
@@ -13,11 +8,8 @@ export interface ConfirmDialogProps {
|
|
|
13
8
|
body?: ReactNode;
|
|
14
9
|
confirmLabel?: string;
|
|
15
10
|
cancelLabel?: string;
|
|
16
|
-
/** Visual weight of the confirm action; defaults to danger. */
|
|
17
11
|
tone?: 'danger' | 'primary' | 'success';
|
|
18
|
-
/** Renders nothing when false; defaults to true (conditional mounting also works). */
|
|
19
12
|
open?: boolean;
|
|
20
|
-
/** While true the confirm action is locked and shows its loading state; the caller owns dismissal. */
|
|
21
13
|
busy?: boolean;
|
|
22
14
|
onConfirm: () => void;
|
|
23
15
|
onClose: () => void;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CoverArt Component (Organism)
|
|
3
|
-
* @description Deterministic generated artwork for entities without
|
|
4
|
-
* photography — the seed always resolves to the same gradient, replaced by
|
|
5
|
-
* real imagery once a media service exists
|
|
6
|
-
*/
|
|
7
1
|
|
|
8
2
|
import type { ReactNode } from 'react';
|
|
9
3
|
import { cn } from '../../infrastructure/utils';
|
|
@@ -11,13 +5,10 @@ import { hashSeed } from '../../infrastructure/utils/hash.util';
|
|
|
11
5
|
import type { BaseProps } from '../../domain/types';
|
|
12
6
|
|
|
13
7
|
export interface CoverArtProps extends BaseProps {
|
|
14
|
-
/** Any stable entity id/name — the same seed always renders the same gradient. */
|
|
15
8
|
seed: string;
|
|
16
9
|
ratio?: '16/9' | '3/2' | '4/3' | '1/1' | '21/9';
|
|
17
10
|
rounded?: 'none' | 'md' | 'lg' | 'top';
|
|
18
|
-
/** Brand palette override ([from, to]); wins over the seeded gradient. */
|
|
19
11
|
colors?: readonly [string, string];
|
|
20
|
-
/** Accessible description; omit for purely decorative usage. */
|
|
21
12
|
alt?: string;
|
|
22
13
|
children?: ReactNode;
|
|
23
14
|
}
|
|
@@ -51,17 +51,14 @@ export interface SortState {
|
|
|
51
51
|
export interface Column<T> {
|
|
52
52
|
id: string;
|
|
53
53
|
header: ReactNode;
|
|
54
|
-
/** Data source; optional when the column renders through `cell` only. */
|
|
55
54
|
accessor?: keyof T | ((row: T) => ReactNode);
|
|
56
55
|
cell?: (row: T) => ReactNode;
|
|
57
56
|
sortValue?: (row: T) => string | number;
|
|
58
57
|
sortable?: boolean;
|
|
59
58
|
align?: ColumnAlign;
|
|
60
59
|
hideBelow?: ColumnHideBelow;
|
|
61
|
-
/** Pixels when numeric. */
|
|
62
60
|
width?: string | number;
|
|
63
61
|
className?: string;
|
|
64
|
-
/** Hidden until the reader enables it from the built-in columns menu. */
|
|
65
62
|
optional?: boolean;
|
|
66
63
|
}
|
|
67
64
|
|
|
@@ -71,12 +68,9 @@ export interface TablePaginationProps extends BaseProps {
|
|
|
71
68
|
onPage: (page: number) => void;
|
|
72
69
|
label?: ReactNode;
|
|
73
70
|
hideWhenSingle?: boolean;
|
|
74
|
-
/** Page-size choices offered in the rows-per-page select. */
|
|
75
71
|
pageSizeOptions?: readonly number[];
|
|
76
|
-
/** Currently selected page size; required with `pageSizeOptions`. */
|
|
77
72
|
pageSize?: number;
|
|
78
73
|
onPageSize?: (size: number) => void;
|
|
79
|
-
/** Accessible label for the rows-per-page select (default "Rows per page"). */
|
|
80
74
|
pageSizeLabel?: ReactNode;
|
|
81
75
|
}
|
|
82
76
|
|
|
@@ -103,7 +97,6 @@ export interface DataTableProps<T> extends BaseProps {
|
|
|
103
97
|
stackable?: boolean;
|
|
104
98
|
paginated?: boolean;
|
|
105
99
|
pageSize?: number;
|
|
106
|
-
/** Page-size choices offered in the footer rows-per-page select. */
|
|
107
100
|
pageSizeOptions?: readonly number[];
|
|
108
101
|
onPageSizeChange?: (size: number) => void;
|
|
109
102
|
emptyState?: {
|
|
@@ -112,7 +105,6 @@ export interface DataTableProps<T> extends BaseProps {
|
|
|
112
105
|
};
|
|
113
106
|
onRowClick?: (row: T) => void;
|
|
114
107
|
rowLabel?: (row: T) => string;
|
|
115
|
-
/** Row-level class, e.g. a tone accent for overdue rows. */
|
|
116
108
|
rowClass?: (row: T) => string | undefined;
|
|
117
109
|
}
|
|
118
110
|
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DateRangePicker Component (Organism)
|
|
3
|
-
* @description Compact preset-driven date range picker with custom date
|
|
4
|
-
* inputs, built on the DropdownMenu + Input atoms.
|
|
5
|
-
*/
|
|
6
1
|
|
|
7
2
|
import { useState } from 'react';
|
|
8
3
|
import { CalendarRange } from 'lucide-react';
|
|
@@ -20,7 +15,6 @@ import {
|
|
|
20
15
|
export interface DateRange {
|
|
21
16
|
from: string;
|
|
22
17
|
to: string;
|
|
23
|
-
/** preset id when the range was chosen from the preset list */
|
|
24
18
|
preset?: RangePreset;
|
|
25
19
|
}
|
|
26
20
|
|
|
@@ -56,7 +50,6 @@ function shiftMonths(iso: string, months: number): string {
|
|
|
56
50
|
return d.toISOString().slice(0, 10);
|
|
57
51
|
}
|
|
58
52
|
|
|
59
|
-
/** Resolve a preset id into a concrete range around `today` (ISO date). */
|
|
60
53
|
export function presetRange(preset: RangePreset, today: string = isoToday()): DateRange {
|
|
61
54
|
switch (preset) {
|
|
62
55
|
case '7d':
|
|
@@ -79,9 +72,7 @@ export function presetRange(preset: RangePreset, today: string = isoToday()): Da
|
|
|
79
72
|
export interface DateRangePickerProps {
|
|
80
73
|
value: DateRange;
|
|
81
74
|
onChange: (range: DateRange) => void;
|
|
82
|
-
/** Preset list shown above the custom inputs; defaults to DEFAULT_RANGE_PRESETS. */
|
|
83
75
|
presets?: readonly RangePresetOption[];
|
|
84
|
-
/** Day formatter for the trigger label; defaults to the raw ISO date. */
|
|
85
76
|
formatDay?: (iso: string) => string;
|
|
86
77
|
'aria-label'?: string;
|
|
87
78
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Drawer Component (Organism)
|
|
3
|
-
* @description Slide-over panel built on the Sheet compound with a
|
|
4
|
-
* Modal-like prop surface (title, footer, side presets, wide variant)
|
|
5
|
-
*/
|
|
6
1
|
|
|
7
2
|
import type { ReactNode } from 'react';
|
|
8
3
|
import { cn } from '../../infrastructure/utils';
|
|
@@ -21,7 +16,6 @@ export interface DrawerProps {
|
|
|
21
16
|
open: boolean;
|
|
22
17
|
onClose: () => void;
|
|
23
18
|
title?: ReactNode;
|
|
24
|
-
/** Small overline above the title, e.g. an entity code. */
|
|
25
19
|
eyebrow?: ReactNode;
|
|
26
20
|
subtitle?: ReactNode;
|
|
27
21
|
description?: ReactNode;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ErrorBoundary Component (Organism)
|
|
3
|
-
* @description Route/tree-level crash catcher — catches render errors and
|
|
4
|
-
* shows an honest recovery screen instead of a blank page.
|
|
5
|
-
*/
|
|
6
1
|
|
|
7
2
|
import { Component, type ErrorInfo, type ReactNode } from 'react';
|
|
8
3
|
import { AlertTriangle } from 'lucide-react';
|
|
@@ -10,19 +5,12 @@ import { Button } from '../atoms/Button';
|
|
|
10
5
|
|
|
11
6
|
export interface ErrorBoundaryProps {
|
|
12
7
|
children: ReactNode;
|
|
13
|
-
/** Small kicker line above the title (e.g. "Something broke"). */
|
|
14
8
|
kicker?: string;
|
|
15
|
-
/** Heading on the crash screen. */
|
|
16
9
|
title?: string;
|
|
17
|
-
/** Secondary line — defaults to the caught error's message. */
|
|
18
10
|
description?: ReactNode;
|
|
19
|
-
/** Reset (retry) button label; omit to hide the button. */
|
|
20
11
|
resetLabel?: string;
|
|
21
|
-
/** Extra action rendered next to reset (e.g. a link back home). */
|
|
22
12
|
action?: ReactNode;
|
|
23
|
-
/** Fully custom crash screen — receives the error and the reset handler. */
|
|
24
13
|
fallback?: (error: Error, reset: () => void) => ReactNode;
|
|
25
|
-
/** Side-channel for logging services (defaults to console.error). */
|
|
26
14
|
onError?: (error: Error, info: ErrorInfo) => void;
|
|
27
15
|
}
|
|
28
16
|
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FileUploader Component (Organism)
|
|
3
|
-
* @description Keyboard-accessible drag-and-drop file picker with a queued
|
|
4
|
-
* file preview list. Visual only — storage wiring belongs to the host.
|
|
5
|
-
*/
|
|
6
1
|
|
|
7
2
|
import { useRef, useState, type DragEvent } from 'react';
|
|
8
3
|
import { UploadCloud } from 'lucide-react';
|
|
@@ -10,15 +5,11 @@ import { Button } from '../atoms/Button';
|
|
|
10
5
|
import { cn } from '../../infrastructure/utils';
|
|
11
6
|
|
|
12
7
|
export interface FileUploaderProps {
|
|
13
|
-
/** Drop-zone headline. */
|
|
14
8
|
label?: string;
|
|
15
|
-
/** Secondary line under the headline. */
|
|
16
9
|
hint?: string;
|
|
17
10
|
accept?: string;
|
|
18
11
|
multiple?: boolean;
|
|
19
|
-
/** Called with the picked/dropped files. */
|
|
20
12
|
onFiles?: (files: File[]) => void;
|
|
21
|
-
/** How many queued names to list before stopping (visual cap only). */
|
|
22
13
|
maxPreview?: number;
|
|
23
14
|
}
|
|
24
15
|
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FilterPopover Component (Organism)
|
|
3
|
-
* @description List-toolbar filter trigger with an active-filter count badge;
|
|
4
|
-
* hosts arbitrary filter controls inside a Popover
|
|
5
|
-
*/
|
|
6
1
|
|
|
7
2
|
import { useState, type ReactNode } from 'react';
|
|
8
3
|
import { Filter } from 'lucide-react';
|
|
@@ -11,11 +6,8 @@ import { Button } from '../atoms/Button';
|
|
|
11
6
|
import { Popover, PopoverContent, PopoverTrigger } from './Popover';
|
|
12
7
|
|
|
13
8
|
export interface FilterPopoverProps {
|
|
14
|
-
/** Trigger caption; defaults to "Filters". */
|
|
15
9
|
label?: string;
|
|
16
|
-
/** Active filter count; rendered as a badge when greater than zero. */
|
|
17
10
|
count?: number;
|
|
18
|
-
/** Popover alignment relative to the trigger; defaults to "start". */
|
|
19
11
|
align?: 'start' | 'center' | 'end';
|
|
20
12
|
children: ReactNode;
|
|
21
13
|
className?: string;
|
|
@@ -65,8 +65,6 @@ export interface FormModalMessages {
|
|
|
65
65
|
invalidNumber: string;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
/** Resolves a field's options — static arrays pass through, functions
|
|
69
|
-
* receive the current values so a select can depend on earlier fields. */
|
|
70
68
|
function fieldOptions(f: FormModalField, values: FormModalValues): FormModalOption[] {
|
|
71
69
|
return typeof f.options === 'function' ? f.options(values) : (f.options ?? []);
|
|
72
70
|
}
|
|
@@ -118,8 +116,6 @@ export function FormModal(
|
|
|
118
116
|
const set = (name: string, val: string | number | boolean) => {
|
|
119
117
|
const next: FormModalValues = { ...values, [name]: val };
|
|
120
118
|
const cleared = [name];
|
|
121
|
-
// A dependent select must never hold a value its resolved options no
|
|
122
|
-
// longer contain — snap it to the first option (or '') and clear its error.
|
|
123
119
|
for (const s of steps) {
|
|
124
120
|
for (const f of s.fields) {
|
|
125
121
|
if (f.type !== 'select' || typeof f.options !== 'function') continue;
|
|
@@ -215,7 +211,6 @@ export function FormModal(
|
|
|
215
211
|
{f.label}
|
|
216
212
|
{f.required && (
|
|
217
213
|
<span className="ml-0.5 text-destructive" aria-hidden="true">
|
|
218
|
-
*
|
|
219
214
|
</span>
|
|
220
215
|
)}
|
|
221
216
|
</label>
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* KpiCard Component (Organism)
|
|
3
|
-
* @description Compact key-metric card: label, value, delta badge, hint and sparkline
|
|
4
|
-
*/
|
|
5
1
|
|
|
6
2
|
import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';
|
|
7
3
|
import { TrendingUp, TrendingDown } from 'lucide-react';
|
|
@@ -34,11 +30,9 @@ export interface KpiCardProps extends HTMLAttributes<HTMLDivElement>, BaseProps
|
|
|
34
30
|
hint?: ReactNode;
|
|
35
31
|
icon?: ReactNode;
|
|
36
32
|
iconTone?: KpiIconTone;
|
|
37
|
-
/** Paints the metric value itself, e.g. red for an over-budget figure. */
|
|
38
33
|
valueTone?: KpiIconTone;
|
|
39
34
|
spark?: readonly number[];
|
|
40
35
|
sparkTone?: KpiIconTone;
|
|
41
|
-
/** Danger emphasis for metrics that need attention, e.g. open incidents. */
|
|
42
36
|
alert?: boolean;
|
|
43
37
|
onClick?: () => void;
|
|
44
38
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lightbox Component (Organism)
|
|
3
|
-
* @description Media overlay on the Dialog primitives — click to zoom,
|
|
4
|
-
* caption below, close button in the corner.
|
|
5
|
-
*/
|
|
6
1
|
|
|
7
2
|
import { useState } from 'react';
|
|
8
3
|
import type { ReactNode } from 'react';
|
|
@@ -12,10 +7,8 @@ import { Dialog, DialogContent, DialogTitle } from './Dialog';
|
|
|
12
7
|
export interface LightboxProps {
|
|
13
8
|
open: boolean;
|
|
14
9
|
onClose: () => void;
|
|
15
|
-
/** Accessible name for the media being shown. */
|
|
16
10
|
alt: string;
|
|
17
11
|
caption?: ReactNode;
|
|
18
|
-
/** Toggle zoom on media click; default true. */
|
|
19
12
|
zoomable?: boolean;
|
|
20
13
|
children?: ReactNode;
|
|
21
14
|
className?: string;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MapPreview Component (Organism)
|
|
3
|
-
* @description Static map stand-in drawn with a contour motif — a neutral
|
|
4
|
-
* placeholder for locations until a real GIS integration exists. Colors
|
|
5
|
-
* come from the semantic tokens, so it adapts to every host theme.
|
|
6
|
-
*/
|
|
7
1
|
|
|
8
2
|
import { MapPin } from 'lucide-react';
|
|
9
3
|
|
|
10
4
|
export interface MapPreviewProps {
|
|
11
|
-
/** Location caption, e.g. "Torba, Bodrum". */
|
|
12
5
|
label: string;
|
|
13
6
|
coordinates?: { lat: number; lng: number };
|
|
14
7
|
height?: number;
|
|
15
|
-
/** Secondary caption line, e.g. an integration note. */
|
|
16
8
|
hint?: string;
|
|
17
|
-
/** Degrees formatting for the coordinate readout; defaults to 4 decimals. */
|
|
18
9
|
formatCoordinate?: (value: number) => string;
|
|
19
10
|
}
|
|
20
11
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MetricCard Component (Organism)
|
|
3
|
-
* @description Card component for displaying metrics and statistics with trend indicators (Responsive)
|
|
4
|
-
*/
|
|
5
1
|
|
|
6
2
|
import { forwardRef } from 'react';
|
|
7
3
|
import { cn, getSpacing, getIconSize, getTextSize, getGap } from '../../infrastructure/utils';
|
|
@@ -21,7 +17,7 @@ export interface MetricCardProps extends BaseProps {
|
|
|
21
17
|
variant?: ColorVariant;
|
|
22
18
|
trendValueFormatter?: (value: number) => string;
|
|
23
19
|
onClick?: () => void;
|
|
24
|
-
responsiveLayout?: boolean;
|
|
20
|
+
responsiveLayout?: boolean;
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
const trendColors: Record<ColorVariant, { positive: string; negative: string; bg: string }> = {
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PhotoGallery Component (Organism)
|
|
3
|
-
* @description Placeholder photo gallery — renders tinted tiles with a
|
|
4
|
-
* caption bar for photos that have no storage backend yet. When a host
|
|
5
|
-
* wires real image URLs it can render them inside the same tile frame.
|
|
6
|
-
*/
|
|
7
1
|
|
|
8
2
|
import { Image as ImageIcon, ImageOff } from 'lucide-react';
|
|
9
3
|
import { cn } from '../../infrastructure/utils';
|
|
10
4
|
|
|
11
5
|
export interface PhotoTile {
|
|
12
6
|
id: string;
|
|
13
|
-
/** Primary caption, e.g. the photo title. */
|
|
14
7
|
label?: string;
|
|
15
|
-
/** Secondary caption line, e.g. a kind tag or a date. */
|
|
16
8
|
meta?: string;
|
|
17
|
-
/** Optional image URL — rendered in place of the placeholder mark. */
|
|
18
9
|
src?: string;
|
|
19
10
|
}
|
|
20
11
|
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PlanPicker Component (Organism)
|
|
3
|
-
* @description Pricing plan card group with an optional billing cycle switch;
|
|
4
|
-
* money stays caller-computed — price and features are plain nodes
|
|
5
|
-
*/
|
|
6
1
|
|
|
7
2
|
import type { KeyboardEvent, ReactNode } from 'react';
|
|
8
3
|
import { Check } from 'lucide-react';
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* StatCard Component (Organism)
|
|
3
|
-
* @description Enhanced metric card with progress bar and target tracking (Responsive)
|
|
4
|
-
*/
|
|
5
1
|
|
|
6
2
|
import { forwardRef, type ComponentType } from 'react';
|
|
7
3
|
import { cn, getSpacing, getIconSize, getContainerSize, getTextSize, getSpaceY, getGap } from '../../infrastructure/utils';
|
|
@@ -20,7 +16,6 @@ export interface StatCardProps extends BaseProps {
|
|
|
20
16
|
value: number;
|
|
21
17
|
label?: string;
|
|
22
18
|
};
|
|
23
|
-
/** Secondary context line rendered under the title. */
|
|
24
19
|
meta?: string;
|
|
25
20
|
target?: {
|
|
26
21
|
value: string;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* StatusBadge Component (Organism)
|
|
3
|
-
* @description Vocab-driven status badge — resolves a raw value against a
|
|
4
|
-
* status map (label + tone), falling back to a neutral badge with the
|
|
5
|
-
* raw value as its label.
|
|
6
|
-
*/
|
|
7
1
|
|
|
8
2
|
import type { ReactNode } from 'react';
|
|
9
3
|
import { Badge } from '../atoms/Badge';
|
|
@@ -17,11 +11,6 @@ export interface StatusEntry {
|
|
|
17
11
|
|
|
18
12
|
export type StatusVocab = Record<string, StatusEntry>;
|
|
19
13
|
|
|
20
|
-
/**
|
|
21
|
-
* Status vocab fabric — build a vocab from a domain label map (raw value →
|
|
22
|
-
* display label) plus an optional tone table (raw value → badge tone).
|
|
23
|
-
* Entries without a tone render neutral.
|
|
24
|
-
*/
|
|
25
14
|
export function statusVocab(
|
|
26
15
|
labels: Record<string, string>,
|
|
27
16
|
tones: Record<string, BadgeVariant> = {},
|
|
@@ -36,7 +25,6 @@ export function statusVocab(
|
|
|
36
25
|
export interface StatusBadgeProps {
|
|
37
26
|
vocab: StatusVocab;
|
|
38
27
|
value: string;
|
|
39
|
-
/** Render text in place of the vocab entry's label (tone still comes from the vocab). */
|
|
40
28
|
label?: ReactNode;
|
|
41
29
|
dot?: boolean;
|
|
42
30
|
mono?: boolean;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stepper Component (Organism)
|
|
3
|
-
* @description Horizontal or vertical step indicator with derived status,
|
|
4
|
-
* optional click navigation and per-step override/lock control
|
|
5
|
-
*/
|
|
6
1
|
|
|
7
2
|
import type { ReactNode } from 'react';
|
|
8
3
|
import { Check } from 'lucide-react';
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tabs Component (Organism)
|
|
3
|
-
* @description Tabbed interface
|
|
4
|
-
*/
|
|
5
1
|
|
|
6
2
|
import { useRef, useState, useCallback, type KeyboardEvent, type ReactNode, type HTMLAttributes } from 'react';
|
|
7
3
|
import { cn } from '../../infrastructure/utils';
|
|
@@ -23,7 +19,6 @@ export interface TabsProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
|
23
19
|
variant?: 'default' | 'pills' | 'underline';
|
|
24
20
|
ariaLabel?: string;
|
|
25
21
|
panelId?: string;
|
|
26
|
-
/** Render only the tab list (e.g. URL-driven tabs whose content lives elsewhere). */
|
|
27
22
|
showPanel?: boolean;
|
|
28
23
|
}
|
|
29
24
|
|
|
@@ -95,7 +90,6 @@ export function Tabs({ tabs, defaultValue, value, onValueChange, variant = 'defa
|
|
|
95
90
|
|
|
96
91
|
return (
|
|
97
92
|
<div className={cn('w-full', className)} {...props}>
|
|
98
|
-
{/* Tab List */}
|
|
99
93
|
<div
|
|
100
94
|
ref={listRef}
|
|
101
95
|
role="tablist"
|
|
@@ -138,7 +132,6 @@ export function Tabs({ tabs, defaultValue, value, onValueChange, variant = 'defa
|
|
|
138
132
|
})}
|
|
139
133
|
</div>
|
|
140
134
|
|
|
141
|
-
{/* Tab Content */}
|
|
142
135
|
{showPanel && (
|
|
143
136
|
<div
|
|
144
137
|
role="tabpanel"
|