@geomak/ui 6.6.0 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +387 -195
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +156 -1
- package/dist/index.d.ts +156 -1
- package/dist/index.js +200 -11
- package/dist/index.js.map +1 -1
- package/dist/styles.css +78 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1043,6 +1043,161 @@ interface KbdProps {
|
|
|
1043
1043
|
*/
|
|
1044
1044
|
declare function Kbd({ children, keys, separator, size, className, style, }: KbdProps): react_jsx_runtime.JSX.Element;
|
|
1045
1045
|
|
|
1046
|
+
type Pad = 'none' | 'sm' | 'md' | 'lg';
|
|
1047
|
+
interface CardProps {
|
|
1048
|
+
children: React__default.ReactNode;
|
|
1049
|
+
/**
|
|
1050
|
+
* Make the whole card a single interactive surface: hover lift, pointer
|
|
1051
|
+
* cursor, focus ring, and (with `onClick`) button semantics + Enter/Space
|
|
1052
|
+
* activation.
|
|
1053
|
+
*/
|
|
1054
|
+
interactive?: boolean;
|
|
1055
|
+
/** Click handler. With `interactive`, the card becomes keyboard-activatable. */
|
|
1056
|
+
onClick?: React__default.MouseEventHandler;
|
|
1057
|
+
/**
|
|
1058
|
+
* Padding on the root. Leave `'none'` (default) when composing with
|
|
1059
|
+
* `Card.Header` / `Card.Body` / `Card.Footer` (they bring their own); set a
|
|
1060
|
+
* value for a quick flat card.
|
|
1061
|
+
*/
|
|
1062
|
+
padding?: Pad;
|
|
1063
|
+
/** Drop the border + shadow for a flat, borderless surface. */
|
|
1064
|
+
flush?: boolean;
|
|
1065
|
+
className?: string;
|
|
1066
|
+
style?: React__default.CSSProperties;
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* A surface container with optional header / media / body / footer sections.
|
|
1070
|
+
*
|
|
1071
|
+
* @example Composed
|
|
1072
|
+
* ```tsx
|
|
1073
|
+
* <Card>
|
|
1074
|
+
* <Card.Media><img src={cover} alt="" /></Card.Media>
|
|
1075
|
+
* <Card.Header title="Aurora" subtitle="Bulk carrier" action={<IconButton … />} />
|
|
1076
|
+
* <Card.Body>Last seen off the North Sea, en route to Rotterdam.</Card.Body>
|
|
1077
|
+
* <Card.Footer><Button content="Track" /></Card.Footer>
|
|
1078
|
+
* </Card>
|
|
1079
|
+
* ```
|
|
1080
|
+
*
|
|
1081
|
+
* @example Quick flat card
|
|
1082
|
+
* ```tsx
|
|
1083
|
+
* <Card padding="md" interactive onClick={open}>Click me</Card>
|
|
1084
|
+
* ```
|
|
1085
|
+
*/
|
|
1086
|
+
declare function Card({ children, interactive, onClick, padding, flush, className, style }: CardProps): react_jsx_runtime.JSX.Element;
|
|
1087
|
+
declare namespace Card {
|
|
1088
|
+
var Media: typeof CardMedia;
|
|
1089
|
+
var Header: typeof CardHeader;
|
|
1090
|
+
var Body: typeof CardBody;
|
|
1091
|
+
var Footer: typeof CardFooter;
|
|
1092
|
+
}
|
|
1093
|
+
interface CardMediaProps {
|
|
1094
|
+
children: React__default.ReactNode;
|
|
1095
|
+
className?: string;
|
|
1096
|
+
}
|
|
1097
|
+
declare function CardMedia({ children, className }: CardMediaProps): react_jsx_runtime.JSX.Element;
|
|
1098
|
+
interface CardHeaderProps {
|
|
1099
|
+
title?: React__default.ReactNode;
|
|
1100
|
+
subtitle?: React__default.ReactNode;
|
|
1101
|
+
/** Trailing slot — actions, menu, badge. */
|
|
1102
|
+
action?: React__default.ReactNode;
|
|
1103
|
+
/** Leading slot — avatar / icon. */
|
|
1104
|
+
avatar?: React__default.ReactNode;
|
|
1105
|
+
children?: React__default.ReactNode;
|
|
1106
|
+
className?: string;
|
|
1107
|
+
}
|
|
1108
|
+
declare function CardHeader({ title, subtitle, action, avatar, children, className }: CardHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1109
|
+
interface CardBodyProps {
|
|
1110
|
+
children: React__default.ReactNode;
|
|
1111
|
+
className?: string;
|
|
1112
|
+
}
|
|
1113
|
+
declare function CardBody({ children, className }: CardBodyProps): react_jsx_runtime.JSX.Element;
|
|
1114
|
+
interface CardFooterProps {
|
|
1115
|
+
children: React__default.ReactNode;
|
|
1116
|
+
/** Drop the top divider. */
|
|
1117
|
+
noDivider?: boolean;
|
|
1118
|
+
className?: string;
|
|
1119
|
+
}
|
|
1120
|
+
declare function CardFooter({ children, noDivider, className }: CardFooterProps): react_jsx_runtime.JSX.Element;
|
|
1121
|
+
|
|
1122
|
+
interface CardCarouselProps {
|
|
1123
|
+
/** The slides — typically `Card`s. Each becomes a snap target. */
|
|
1124
|
+
children: React__default.ReactNode;
|
|
1125
|
+
/** Width of each slide. Number → px. Default `280`. */
|
|
1126
|
+
itemWidth?: number | string;
|
|
1127
|
+
/** Gap between slides in px. Default `16`. */
|
|
1128
|
+
gap?: number;
|
|
1129
|
+
/** Show prev / next arrow buttons. Default `true`. */
|
|
1130
|
+
showArrows?: boolean;
|
|
1131
|
+
/** Show position dots. Default `false`. */
|
|
1132
|
+
showDots?: boolean;
|
|
1133
|
+
/** Accessible label for the region. Default `'Carousel'`. */
|
|
1134
|
+
'aria-label'?: string;
|
|
1135
|
+
className?: string;
|
|
1136
|
+
style?: React__default.CSSProperties;
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* A horizontal, scroll-snap carousel for cards. Native scrolling drives it
|
|
1140
|
+
* (trackpad / touch / wheel), with optional arrow buttons and position dots.
|
|
1141
|
+
* Arrows disable at the ends; the scrollbar is hidden but scrolling is intact.
|
|
1142
|
+
*
|
|
1143
|
+
* @example
|
|
1144
|
+
* ```tsx
|
|
1145
|
+
* <CardCarousel itemWidth={300} showDots>
|
|
1146
|
+
* {vessels.map((v) => <Card key={v.id}>…</Card>)}
|
|
1147
|
+
* </CardCarousel>
|
|
1148
|
+
* ```
|
|
1149
|
+
*/
|
|
1150
|
+
declare function CardCarousel({ children, itemWidth, gap, showArrows, showDots, 'aria-label': ariaLabel, className, style, }: CardCarouselProps): react_jsx_runtime.JSX.Element;
|
|
1151
|
+
|
|
1152
|
+
type StatisticSize = 'sm' | 'md' | 'lg';
|
|
1153
|
+
type DeltaDirection = 'up' | 'down' | 'neutral';
|
|
1154
|
+
interface StatisticDelta {
|
|
1155
|
+
/** The change to show beside the arrow, e.g. `'12%'` or `+340`. */
|
|
1156
|
+
value: React__default.ReactNode;
|
|
1157
|
+
/** Arrow + colour direction. Default inferred `'neutral'`. */
|
|
1158
|
+
direction?: DeltaDirection;
|
|
1159
|
+
/**
|
|
1160
|
+
* Whether an `up` direction is a good thing (green) or bad (red). For
|
|
1161
|
+
* metrics like churn or latency, set `false` so a rise reads red.
|
|
1162
|
+
* Default `true`.
|
|
1163
|
+
*/
|
|
1164
|
+
positiveIsGood?: boolean;
|
|
1165
|
+
/** Optional trailing context, e.g. `'vs last month'`. */
|
|
1166
|
+
label?: React__default.ReactNode;
|
|
1167
|
+
}
|
|
1168
|
+
interface StatisticProps {
|
|
1169
|
+
/** Caption above the value. */
|
|
1170
|
+
label: React__default.ReactNode;
|
|
1171
|
+
/** The metric itself. */
|
|
1172
|
+
value: React__default.ReactNode;
|
|
1173
|
+
/** Rendered before the value (currency symbol, etc.). */
|
|
1174
|
+
prefix?: React__default.ReactNode;
|
|
1175
|
+
/** Rendered after the value (unit, %). */
|
|
1176
|
+
suffix?: React__default.ReactNode;
|
|
1177
|
+
/** Leading icon in a tinted square. */
|
|
1178
|
+
icon?: React__default.ReactNode;
|
|
1179
|
+
/** Trend indicator under the value. */
|
|
1180
|
+
delta?: StatisticDelta;
|
|
1181
|
+
/** Secondary help text under everything. */
|
|
1182
|
+
helpText?: React__default.ReactNode;
|
|
1183
|
+
/** Size preset. Default `'md'`. */
|
|
1184
|
+
size?: StatisticSize;
|
|
1185
|
+
/** Text alignment. Default `'left'`. */
|
|
1186
|
+
align?: 'left' | 'center';
|
|
1187
|
+
className?: string;
|
|
1188
|
+
style?: React__default.CSSProperties;
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* A single metric: caption, value (with optional prefix/suffix and icon), and an
|
|
1192
|
+
* optional trend delta whose colour follows direction — flipped for metrics
|
|
1193
|
+
* where a rise is bad via `positiveIsGood: false`.
|
|
1194
|
+
*
|
|
1195
|
+
* @example
|
|
1196
|
+
* <Statistic label="Revenue" value="48,210" prefix="$" delta={{ value: '12%', direction: 'up', label: 'vs last month' }} />
|
|
1197
|
+
* <Statistic label="Churn" value="3.1" suffix="%" delta={{ value: '0.4pt', direction: 'up', positiveIsGood: false }} />
|
|
1198
|
+
*/
|
|
1199
|
+
declare function Statistic({ label, value, prefix, suffix, icon, delta, helpText, size, align, className, style, }: StatisticProps): react_jsx_runtime.JSX.Element;
|
|
1200
|
+
|
|
1046
1201
|
/** ─────────────────── types ─────────────────── */
|
|
1047
1202
|
type NotificationType = 'info' | 'success' | 'warning' | 'danger';
|
|
1048
1203
|
type NotificationPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
@@ -4111,4 +4266,4 @@ declare function expiryError(value: string, now?: Date): string | undefined;
|
|
|
4111
4266
|
/** Validate the CVV against the detected brand's expected length. */
|
|
4112
4267
|
declare function cvvError(value: string, cardNumber: string): string | undefined;
|
|
4113
4268
|
|
|
4114
|
-
export { Accordion, type AccordionItemProps, type AccordionProps, AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CARD_BRANDS, type CardBrand, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ColorPicker, type ColorPickerProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, Drawer, type DrawerProps, Dropdown, type DropdownItem, type DropdownProps, type ErrorMap, type ExpandRowOptions, FadingBase, type FadingBaseProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridProps, Icon, IconButton, type IconButtonProps, Kbd, type KbdProps, type KbdSize, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Slider, type SliderMark, type SliderProps, type SliderValue, type Spacing, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type ValidateTrigger, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
|
4269
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CARD_BRANDS, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ColorPicker, type ColorPickerProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DeltaDirection, Drawer, type DrawerProps, Dropdown, type DropdownItem, type DropdownProps, type ErrorMap, type ExpandRowOptions, FadingBase, type FadingBaseProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridProps, Icon, IconButton, type IconButtonProps, Kbd, type KbdProps, type KbdSize, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Slider, type SliderMark, type SliderProps, type SliderValue, type Spacing, Statistic, type StatisticDelta, type StatisticProps, type StatisticSize, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type ValidateTrigger, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
package/dist/index.d.ts
CHANGED
|
@@ -1043,6 +1043,161 @@ interface KbdProps {
|
|
|
1043
1043
|
*/
|
|
1044
1044
|
declare function Kbd({ children, keys, separator, size, className, style, }: KbdProps): react_jsx_runtime.JSX.Element;
|
|
1045
1045
|
|
|
1046
|
+
type Pad = 'none' | 'sm' | 'md' | 'lg';
|
|
1047
|
+
interface CardProps {
|
|
1048
|
+
children: React__default.ReactNode;
|
|
1049
|
+
/**
|
|
1050
|
+
* Make the whole card a single interactive surface: hover lift, pointer
|
|
1051
|
+
* cursor, focus ring, and (with `onClick`) button semantics + Enter/Space
|
|
1052
|
+
* activation.
|
|
1053
|
+
*/
|
|
1054
|
+
interactive?: boolean;
|
|
1055
|
+
/** Click handler. With `interactive`, the card becomes keyboard-activatable. */
|
|
1056
|
+
onClick?: React__default.MouseEventHandler;
|
|
1057
|
+
/**
|
|
1058
|
+
* Padding on the root. Leave `'none'` (default) when composing with
|
|
1059
|
+
* `Card.Header` / `Card.Body` / `Card.Footer` (they bring their own); set a
|
|
1060
|
+
* value for a quick flat card.
|
|
1061
|
+
*/
|
|
1062
|
+
padding?: Pad;
|
|
1063
|
+
/** Drop the border + shadow for a flat, borderless surface. */
|
|
1064
|
+
flush?: boolean;
|
|
1065
|
+
className?: string;
|
|
1066
|
+
style?: React__default.CSSProperties;
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* A surface container with optional header / media / body / footer sections.
|
|
1070
|
+
*
|
|
1071
|
+
* @example Composed
|
|
1072
|
+
* ```tsx
|
|
1073
|
+
* <Card>
|
|
1074
|
+
* <Card.Media><img src={cover} alt="" /></Card.Media>
|
|
1075
|
+
* <Card.Header title="Aurora" subtitle="Bulk carrier" action={<IconButton … />} />
|
|
1076
|
+
* <Card.Body>Last seen off the North Sea, en route to Rotterdam.</Card.Body>
|
|
1077
|
+
* <Card.Footer><Button content="Track" /></Card.Footer>
|
|
1078
|
+
* </Card>
|
|
1079
|
+
* ```
|
|
1080
|
+
*
|
|
1081
|
+
* @example Quick flat card
|
|
1082
|
+
* ```tsx
|
|
1083
|
+
* <Card padding="md" interactive onClick={open}>Click me</Card>
|
|
1084
|
+
* ```
|
|
1085
|
+
*/
|
|
1086
|
+
declare function Card({ children, interactive, onClick, padding, flush, className, style }: CardProps): react_jsx_runtime.JSX.Element;
|
|
1087
|
+
declare namespace Card {
|
|
1088
|
+
var Media: typeof CardMedia;
|
|
1089
|
+
var Header: typeof CardHeader;
|
|
1090
|
+
var Body: typeof CardBody;
|
|
1091
|
+
var Footer: typeof CardFooter;
|
|
1092
|
+
}
|
|
1093
|
+
interface CardMediaProps {
|
|
1094
|
+
children: React__default.ReactNode;
|
|
1095
|
+
className?: string;
|
|
1096
|
+
}
|
|
1097
|
+
declare function CardMedia({ children, className }: CardMediaProps): react_jsx_runtime.JSX.Element;
|
|
1098
|
+
interface CardHeaderProps {
|
|
1099
|
+
title?: React__default.ReactNode;
|
|
1100
|
+
subtitle?: React__default.ReactNode;
|
|
1101
|
+
/** Trailing slot — actions, menu, badge. */
|
|
1102
|
+
action?: React__default.ReactNode;
|
|
1103
|
+
/** Leading slot — avatar / icon. */
|
|
1104
|
+
avatar?: React__default.ReactNode;
|
|
1105
|
+
children?: React__default.ReactNode;
|
|
1106
|
+
className?: string;
|
|
1107
|
+
}
|
|
1108
|
+
declare function CardHeader({ title, subtitle, action, avatar, children, className }: CardHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1109
|
+
interface CardBodyProps {
|
|
1110
|
+
children: React__default.ReactNode;
|
|
1111
|
+
className?: string;
|
|
1112
|
+
}
|
|
1113
|
+
declare function CardBody({ children, className }: CardBodyProps): react_jsx_runtime.JSX.Element;
|
|
1114
|
+
interface CardFooterProps {
|
|
1115
|
+
children: React__default.ReactNode;
|
|
1116
|
+
/** Drop the top divider. */
|
|
1117
|
+
noDivider?: boolean;
|
|
1118
|
+
className?: string;
|
|
1119
|
+
}
|
|
1120
|
+
declare function CardFooter({ children, noDivider, className }: CardFooterProps): react_jsx_runtime.JSX.Element;
|
|
1121
|
+
|
|
1122
|
+
interface CardCarouselProps {
|
|
1123
|
+
/** The slides — typically `Card`s. Each becomes a snap target. */
|
|
1124
|
+
children: React__default.ReactNode;
|
|
1125
|
+
/** Width of each slide. Number → px. Default `280`. */
|
|
1126
|
+
itemWidth?: number | string;
|
|
1127
|
+
/** Gap between slides in px. Default `16`. */
|
|
1128
|
+
gap?: number;
|
|
1129
|
+
/** Show prev / next arrow buttons. Default `true`. */
|
|
1130
|
+
showArrows?: boolean;
|
|
1131
|
+
/** Show position dots. Default `false`. */
|
|
1132
|
+
showDots?: boolean;
|
|
1133
|
+
/** Accessible label for the region. Default `'Carousel'`. */
|
|
1134
|
+
'aria-label'?: string;
|
|
1135
|
+
className?: string;
|
|
1136
|
+
style?: React__default.CSSProperties;
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* A horizontal, scroll-snap carousel for cards. Native scrolling drives it
|
|
1140
|
+
* (trackpad / touch / wheel), with optional arrow buttons and position dots.
|
|
1141
|
+
* Arrows disable at the ends; the scrollbar is hidden but scrolling is intact.
|
|
1142
|
+
*
|
|
1143
|
+
* @example
|
|
1144
|
+
* ```tsx
|
|
1145
|
+
* <CardCarousel itemWidth={300} showDots>
|
|
1146
|
+
* {vessels.map((v) => <Card key={v.id}>…</Card>)}
|
|
1147
|
+
* </CardCarousel>
|
|
1148
|
+
* ```
|
|
1149
|
+
*/
|
|
1150
|
+
declare function CardCarousel({ children, itemWidth, gap, showArrows, showDots, 'aria-label': ariaLabel, className, style, }: CardCarouselProps): react_jsx_runtime.JSX.Element;
|
|
1151
|
+
|
|
1152
|
+
type StatisticSize = 'sm' | 'md' | 'lg';
|
|
1153
|
+
type DeltaDirection = 'up' | 'down' | 'neutral';
|
|
1154
|
+
interface StatisticDelta {
|
|
1155
|
+
/** The change to show beside the arrow, e.g. `'12%'` or `+340`. */
|
|
1156
|
+
value: React__default.ReactNode;
|
|
1157
|
+
/** Arrow + colour direction. Default inferred `'neutral'`. */
|
|
1158
|
+
direction?: DeltaDirection;
|
|
1159
|
+
/**
|
|
1160
|
+
* Whether an `up` direction is a good thing (green) or bad (red). For
|
|
1161
|
+
* metrics like churn or latency, set `false` so a rise reads red.
|
|
1162
|
+
* Default `true`.
|
|
1163
|
+
*/
|
|
1164
|
+
positiveIsGood?: boolean;
|
|
1165
|
+
/** Optional trailing context, e.g. `'vs last month'`. */
|
|
1166
|
+
label?: React__default.ReactNode;
|
|
1167
|
+
}
|
|
1168
|
+
interface StatisticProps {
|
|
1169
|
+
/** Caption above the value. */
|
|
1170
|
+
label: React__default.ReactNode;
|
|
1171
|
+
/** The metric itself. */
|
|
1172
|
+
value: React__default.ReactNode;
|
|
1173
|
+
/** Rendered before the value (currency symbol, etc.). */
|
|
1174
|
+
prefix?: React__default.ReactNode;
|
|
1175
|
+
/** Rendered after the value (unit, %). */
|
|
1176
|
+
suffix?: React__default.ReactNode;
|
|
1177
|
+
/** Leading icon in a tinted square. */
|
|
1178
|
+
icon?: React__default.ReactNode;
|
|
1179
|
+
/** Trend indicator under the value. */
|
|
1180
|
+
delta?: StatisticDelta;
|
|
1181
|
+
/** Secondary help text under everything. */
|
|
1182
|
+
helpText?: React__default.ReactNode;
|
|
1183
|
+
/** Size preset. Default `'md'`. */
|
|
1184
|
+
size?: StatisticSize;
|
|
1185
|
+
/** Text alignment. Default `'left'`. */
|
|
1186
|
+
align?: 'left' | 'center';
|
|
1187
|
+
className?: string;
|
|
1188
|
+
style?: React__default.CSSProperties;
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* A single metric: caption, value (with optional prefix/suffix and icon), and an
|
|
1192
|
+
* optional trend delta whose colour follows direction — flipped for metrics
|
|
1193
|
+
* where a rise is bad via `positiveIsGood: false`.
|
|
1194
|
+
*
|
|
1195
|
+
* @example
|
|
1196
|
+
* <Statistic label="Revenue" value="48,210" prefix="$" delta={{ value: '12%', direction: 'up', label: 'vs last month' }} />
|
|
1197
|
+
* <Statistic label="Churn" value="3.1" suffix="%" delta={{ value: '0.4pt', direction: 'up', positiveIsGood: false }} />
|
|
1198
|
+
*/
|
|
1199
|
+
declare function Statistic({ label, value, prefix, suffix, icon, delta, helpText, size, align, className, style, }: StatisticProps): react_jsx_runtime.JSX.Element;
|
|
1200
|
+
|
|
1046
1201
|
/** ─────────────────── types ─────────────────── */
|
|
1047
1202
|
type NotificationType = 'info' | 'success' | 'warning' | 'danger';
|
|
1048
1203
|
type NotificationPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
@@ -4111,4 +4266,4 @@ declare function expiryError(value: string, now?: Date): string | undefined;
|
|
|
4111
4266
|
/** Validate the CVV against the detected brand's expected length. */
|
|
4112
4267
|
declare function cvvError(value: string, cardNumber: string): string | undefined;
|
|
4113
4268
|
|
|
4114
|
-
export { Accordion, type AccordionItemProps, type AccordionProps, AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CARD_BRANDS, type CardBrand, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ColorPicker, type ColorPickerProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, Drawer, type DrawerProps, Dropdown, type DropdownItem, type DropdownProps, type ErrorMap, type ExpandRowOptions, FadingBase, type FadingBaseProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridProps, Icon, IconButton, type IconButtonProps, Kbd, type KbdProps, type KbdSize, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Slider, type SliderMark, type SliderProps, type SliderValue, type Spacing, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type ValidateTrigger, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
|
4269
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CARD_BRANDS, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ColorPicker, type ColorPickerProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DeltaDirection, Drawer, type DrawerProps, Dropdown, type DropdownItem, type DropdownProps, type ErrorMap, type ExpandRowOptions, FadingBase, type FadingBaseProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridProps, Icon, IconButton, type IconButtonProps, Kbd, type KbdProps, type KbdSize, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Slider, type SliderMark, type SliderProps, type SliderValue, type Spacing, Statistic, type StatisticDelta, type StatisticProps, type StatisticSize, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type ValidateTrigger, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { colors_default } from './chunk-GKXP6OJJ.js';
|
|
2
2
|
export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } from './chunk-GKXP6OJJ.js';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import
|
|
4
|
+
import React16, { createContext, useState, useEffect, useMemo, useId, useCallback, useRef, useContext, useLayoutEffect, useSyncExternalStore } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
7
7
|
import * as Dialog from '@radix-ui/react-dialog';
|
|
@@ -1630,13 +1630,202 @@ function Kbd({
|
|
|
1630
1630
|
style
|
|
1631
1631
|
}) {
|
|
1632
1632
|
if (keys && keys.length > 0) {
|
|
1633
|
-
return /* @__PURE__ */ jsx("span", { className: ["inline-flex items-center gap-1", className].filter(Boolean).join(" "), style, children: keys.map((k, i) => /* @__PURE__ */ jsxs(
|
|
1633
|
+
return /* @__PURE__ */ jsx("span", { className: ["inline-flex items-center gap-1", className].filter(Boolean).join(" "), style, children: keys.map((k, i) => /* @__PURE__ */ jsxs(React16.Fragment, { children: [
|
|
1634
1634
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "text-foreground-muted text-xs select-none", children: separator }),
|
|
1635
1635
|
/* @__PURE__ */ jsx("kbd", { className: [cap, SIZE3[size]].join(" "), children: k })
|
|
1636
1636
|
] }, `${k}-${i}`)) });
|
|
1637
1637
|
}
|
|
1638
1638
|
return /* @__PURE__ */ jsx("kbd", { className: [cap, SIZE3[size], className].filter(Boolean).join(" "), style, children });
|
|
1639
1639
|
}
|
|
1640
|
+
var PAD = { none: "", sm: "p-3", md: "p-5", lg: "p-6" };
|
|
1641
|
+
function Card({ children, interactive, onClick, padding: padding2 = "none", flush, className = "", style }) {
|
|
1642
|
+
const base = [
|
|
1643
|
+
"rounded-xl overflow-hidden bg-surface",
|
|
1644
|
+
flush ? "" : "border border-border shadow-sm",
|
|
1645
|
+
PAD[padding2],
|
|
1646
|
+
interactive ? "transition-[transform,box-shadow] duration-200 ease-out hover:-translate-y-0.5 hover:shadow-md cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-accent" : "",
|
|
1647
|
+
className
|
|
1648
|
+
].filter(Boolean).join(" ");
|
|
1649
|
+
if (interactive && onClick) {
|
|
1650
|
+
return /* @__PURE__ */ jsx(
|
|
1651
|
+
"div",
|
|
1652
|
+
{
|
|
1653
|
+
role: "button",
|
|
1654
|
+
tabIndex: 0,
|
|
1655
|
+
onClick,
|
|
1656
|
+
onKeyDown: (e) => {
|
|
1657
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1658
|
+
e.preventDefault();
|
|
1659
|
+
onClick(e);
|
|
1660
|
+
}
|
|
1661
|
+
},
|
|
1662
|
+
className: base,
|
|
1663
|
+
style,
|
|
1664
|
+
children
|
|
1665
|
+
}
|
|
1666
|
+
);
|
|
1667
|
+
}
|
|
1668
|
+
return /* @__PURE__ */ jsx("div", { onClick, className: base, style, children });
|
|
1669
|
+
}
|
|
1670
|
+
function CardMedia({ children, className = "" }) {
|
|
1671
|
+
return /* @__PURE__ */ jsx("div", { className: ["[&>img]:block [&>img]:w-full [&>img]:object-cover", className].filter(Boolean).join(" "), children });
|
|
1672
|
+
}
|
|
1673
|
+
function CardHeader({ title, subtitle, action, avatar, children, className = "" }) {
|
|
1674
|
+
return /* @__PURE__ */ jsxs("div", { className: ["flex items-start gap-3 px-5 pt-5", children ? "pb-0" : "pb-3", className].filter(Boolean).join(" "), children: [
|
|
1675
|
+
avatar && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: avatar }),
|
|
1676
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1677
|
+
title && /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold text-foreground leading-snug", children: title }),
|
|
1678
|
+
subtitle && /* @__PURE__ */ jsx("div", { className: "text-xs text-foreground-muted leading-snug mt-0.5", children: subtitle }),
|
|
1679
|
+
children
|
|
1680
|
+
] }),
|
|
1681
|
+
action && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 -mt-1 -mr-1", children: action })
|
|
1682
|
+
] });
|
|
1683
|
+
}
|
|
1684
|
+
function CardBody({ children, className = "" }) {
|
|
1685
|
+
return /* @__PURE__ */ jsx("div", { className: ["px-5 py-4 text-sm text-foreground-secondary leading-relaxed", className].filter(Boolean).join(" "), children });
|
|
1686
|
+
}
|
|
1687
|
+
function CardFooter({ children, noDivider, className = "" }) {
|
|
1688
|
+
return /* @__PURE__ */ jsx("div", { className: ["flex items-center gap-2 px-5 py-3", noDivider ? "" : "border-t border-border", className].filter(Boolean).join(" "), children });
|
|
1689
|
+
}
|
|
1690
|
+
Card.Media = CardMedia;
|
|
1691
|
+
Card.Header = CardHeader;
|
|
1692
|
+
Card.Body = CardBody;
|
|
1693
|
+
Card.Footer = CardFooter;
|
|
1694
|
+
var Card_default = Card;
|
|
1695
|
+
var Arrow2 = ({ dir }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", className: "h-5 w-5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: dir === "left" ? "M15 19l-7-7 7-7" : "M9 5l7 7-7 7" }) });
|
|
1696
|
+
function CardCarousel({
|
|
1697
|
+
children,
|
|
1698
|
+
itemWidth = 280,
|
|
1699
|
+
gap = 16,
|
|
1700
|
+
showArrows = true,
|
|
1701
|
+
showDots = false,
|
|
1702
|
+
"aria-label": ariaLabel = "Carousel",
|
|
1703
|
+
className = "",
|
|
1704
|
+
style
|
|
1705
|
+
}) {
|
|
1706
|
+
const scrollerRef = useRef(null);
|
|
1707
|
+
const slides = React16.Children.toArray(children);
|
|
1708
|
+
const [active, setActive] = useState(0);
|
|
1709
|
+
const [atStart, setAtStart] = useState(true);
|
|
1710
|
+
const [atEnd, setAtEnd] = useState(false);
|
|
1711
|
+
const width = typeof itemWidth === "number" ? `${itemWidth}px` : itemWidth;
|
|
1712
|
+
const update = useCallback(() => {
|
|
1713
|
+
const el = scrollerRef.current;
|
|
1714
|
+
if (!el) return;
|
|
1715
|
+
el.clientWidth;
|
|
1716
|
+
setAtStart(el.scrollLeft <= 1);
|
|
1717
|
+
setAtEnd(el.scrollLeft + el.clientWidth >= el.scrollWidth - 1);
|
|
1718
|
+
const first = el.firstElementChild;
|
|
1719
|
+
const slideW = first ? first.getBoundingClientRect().width + gap : el.clientWidth;
|
|
1720
|
+
setActive(Math.round(el.scrollLeft / slideW));
|
|
1721
|
+
}, [gap]);
|
|
1722
|
+
useEffect(() => {
|
|
1723
|
+
update();
|
|
1724
|
+
const el = scrollerRef.current;
|
|
1725
|
+
if (!el) return;
|
|
1726
|
+
el.addEventListener("scroll", update, { passive: true });
|
|
1727
|
+
window.addEventListener("resize", update);
|
|
1728
|
+
return () => {
|
|
1729
|
+
el.removeEventListener("scroll", update);
|
|
1730
|
+
window.removeEventListener("resize", update);
|
|
1731
|
+
};
|
|
1732
|
+
}, [update]);
|
|
1733
|
+
const scrollByDir = (dir) => {
|
|
1734
|
+
const el = scrollerRef.current;
|
|
1735
|
+
if (!el) return;
|
|
1736
|
+
const first = el.firstElementChild;
|
|
1737
|
+
const slideW = first ? first.getBoundingClientRect().width + gap : el.clientWidth;
|
|
1738
|
+
el.scrollBy({ left: dir * slideW, behavior: "smooth" });
|
|
1739
|
+
};
|
|
1740
|
+
const scrollTo = (i) => {
|
|
1741
|
+
const el = scrollerRef.current;
|
|
1742
|
+
if (!el) return;
|
|
1743
|
+
const first = el.firstElementChild;
|
|
1744
|
+
const slideW = first ? first.getBoundingClientRect().width + gap : el.clientWidth;
|
|
1745
|
+
el.scrollTo({ left: i * slideW, behavior: "smooth" });
|
|
1746
|
+
};
|
|
1747
|
+
const arrowBtn = "absolute top-1/2 -translate-y-1/2 z-10 flex h-9 w-9 items-center justify-center rounded-full border border-border bg-surface text-foreground-secondary shadow-md transition hover:text-foreground hover:bg-surface-raised disabled:opacity-0 disabled:pointer-events-none focus:outline-none focus-visible:ring-2 focus-visible:ring-accent";
|
|
1748
|
+
return /* @__PURE__ */ jsxs("section", { "aria-label": ariaLabel, className: ["relative", className].filter(Boolean).join(" "), style, children: [
|
|
1749
|
+
showArrows && /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Previous", onClick: () => scrollByDir(-1), disabled: atStart, className: `${arrowBtn} left-1`, children: /* @__PURE__ */ jsx(Arrow2, { dir: "left" }) }),
|
|
1750
|
+
/* @__PURE__ */ jsx(
|
|
1751
|
+
"div",
|
|
1752
|
+
{
|
|
1753
|
+
ref: scrollerRef,
|
|
1754
|
+
className: "flex overflow-x-auto snap-x snap-mandatory hidden-scrollbar scroll-smooth",
|
|
1755
|
+
style: { gap },
|
|
1756
|
+
children: slides.map((slide, i) => /* @__PURE__ */ jsx("div", { className: "snap-start flex-shrink-0", style: { width }, children: slide }, i))
|
|
1757
|
+
}
|
|
1758
|
+
),
|
|
1759
|
+
showArrows && /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Next", onClick: () => scrollByDir(1), disabled: atEnd, className: `${arrowBtn} right-1`, children: /* @__PURE__ */ jsx(Arrow2, { dir: "right" }) }),
|
|
1760
|
+
showDots && slides.length > 1 && /* @__PURE__ */ jsx("div", { className: "mt-3 flex items-center justify-center gap-1.5", children: slides.map((_, i) => /* @__PURE__ */ jsx(
|
|
1761
|
+
"button",
|
|
1762
|
+
{
|
|
1763
|
+
type: "button",
|
|
1764
|
+
"aria-label": `Go to slide ${i + 1}`,
|
|
1765
|
+
"aria-current": i === active,
|
|
1766
|
+
onClick: () => scrollTo(i),
|
|
1767
|
+
className: [
|
|
1768
|
+
"h-1.5 rounded-full transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
1769
|
+
i === active ? "w-5 bg-accent" : "w-1.5 bg-border hover:bg-foreground-muted"
|
|
1770
|
+
].join(" ")
|
|
1771
|
+
},
|
|
1772
|
+
i
|
|
1773
|
+
)) })
|
|
1774
|
+
] });
|
|
1775
|
+
}
|
|
1776
|
+
var VALUE_SIZE = {
|
|
1777
|
+
sm: "text-xl",
|
|
1778
|
+
md: "text-3xl",
|
|
1779
|
+
lg: "text-4xl"
|
|
1780
|
+
};
|
|
1781
|
+
var TONE2 = {
|
|
1782
|
+
good: "text-status-success",
|
|
1783
|
+
bad: "text-status-error",
|
|
1784
|
+
neutral: "text-foreground-muted"
|
|
1785
|
+
};
|
|
1786
|
+
var ArrowUp = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.2, "aria-hidden": "true", className: "h-3.5 w-3.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19V5M5 12l7-7 7 7" }) });
|
|
1787
|
+
var ArrowDown = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.2, "aria-hidden": "true", className: "h-3.5 w-3.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 5v14M5 12l7 7 7-7" }) });
|
|
1788
|
+
function Statistic({
|
|
1789
|
+
label,
|
|
1790
|
+
value,
|
|
1791
|
+
prefix,
|
|
1792
|
+
suffix,
|
|
1793
|
+
icon,
|
|
1794
|
+
delta,
|
|
1795
|
+
helpText,
|
|
1796
|
+
size = "md",
|
|
1797
|
+
align = "left",
|
|
1798
|
+
className = "",
|
|
1799
|
+
style
|
|
1800
|
+
}) {
|
|
1801
|
+
const dir = delta?.direction ?? "neutral";
|
|
1802
|
+
const positiveIsGood = delta?.positiveIsGood ?? true;
|
|
1803
|
+
const deltaTone = dir === "neutral" ? "neutral" : dir === "up" === positiveIsGood ? "good" : "bad";
|
|
1804
|
+
return /* @__PURE__ */ jsxs(
|
|
1805
|
+
"div",
|
|
1806
|
+
{
|
|
1807
|
+
className: ["flex gap-3", align === "center" ? "flex-col items-center text-center" : "items-start", className].filter(Boolean).join(" "),
|
|
1808
|
+
style,
|
|
1809
|
+
children: [
|
|
1810
|
+
icon && align === "left" && /* @__PURE__ */ jsx("span", { className: "flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-accent/10 text-accent", children: /* @__PURE__ */ jsx("span", { className: "h-5 w-5 inline-flex items-center justify-center", children: icon }) }),
|
|
1811
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
1812
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs font-medium uppercase tracking-wide text-foreground-muted", children: label }),
|
|
1813
|
+
/* @__PURE__ */ jsxs("div", { className: `mt-1 flex items-baseline gap-0.5 font-semibold text-foreground tabular-nums ${VALUE_SIZE[size]} ${align === "center" ? "justify-center" : ""}`, children: [
|
|
1814
|
+
prefix && /* @__PURE__ */ jsx("span", { className: "text-foreground-muted text-[0.6em] font-medium self-center", children: prefix }),
|
|
1815
|
+
/* @__PURE__ */ jsx("span", { className: "leading-none", children: value }),
|
|
1816
|
+
suffix && /* @__PURE__ */ jsx("span", { className: "text-foreground-muted text-[0.5em] font-medium self-center", children: suffix })
|
|
1817
|
+
] }),
|
|
1818
|
+
delta && /* @__PURE__ */ jsxs("div", { className: `mt-1.5 flex items-center gap-1 text-sm font-medium ${align === "center" ? "justify-center" : ""} ${TONE2[deltaTone]}`, children: [
|
|
1819
|
+
dir === "up" ? ArrowUp : dir === "down" ? ArrowDown : null,
|
|
1820
|
+
/* @__PURE__ */ jsx("span", { children: delta.value }),
|
|
1821
|
+
delta.label && /* @__PURE__ */ jsx("span", { className: "text-foreground-muted font-normal", children: delta.label })
|
|
1822
|
+
] }),
|
|
1823
|
+
helpText && /* @__PURE__ */ jsx("div", { className: "mt-1 text-xs text-foreground-muted", children: helpText })
|
|
1824
|
+
] })
|
|
1825
|
+
]
|
|
1826
|
+
}
|
|
1827
|
+
);
|
|
1828
|
+
}
|
|
1640
1829
|
var NotificationContext = createContext({
|
|
1641
1830
|
open: () => void 0,
|
|
1642
1831
|
close: () => void 0
|
|
@@ -2740,7 +2929,7 @@ function Field({
|
|
|
2740
2929
|
);
|
|
2741
2930
|
}
|
|
2742
2931
|
var SearchIcon = /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10.5 3.75a6.75 6.75 0 100 13.5 6.75 6.75 0 000-13.5zM2.25 10.5a8.25 8.25 0 1114.59 5.28l4.69 4.69a.75.75 0 11-1.06 1.06l-4.69-4.69A8.25 8.25 0 012.25 10.5z", clipRule: "evenodd" }) });
|
|
2743
|
-
var SearchInput =
|
|
2932
|
+
var SearchInput = React16.forwardRef(function SearchInput2({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout = "vertical", size = "md", icon, helperText, className }, ref) {
|
|
2744
2933
|
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, layout, helperText, children: /* @__PURE__ */ jsxs(
|
|
2745
2934
|
"div",
|
|
2746
2935
|
{
|
|
@@ -3241,7 +3430,7 @@ function TableBody({
|
|
|
3241
3430
|
return /* @__PURE__ */ jsx("tbody", { children: rows.map((row, i) => {
|
|
3242
3431
|
const rowKey = getRowKey(row, i);
|
|
3243
3432
|
const isExpanded = expanded.has(rowKey);
|
|
3244
|
-
return /* @__PURE__ */ jsxs(
|
|
3433
|
+
return /* @__PURE__ */ jsxs(React16.Fragment, { children: [
|
|
3245
3434
|
/* @__PURE__ */ jsxs(
|
|
3246
3435
|
"tr",
|
|
3247
3436
|
{
|
|
@@ -3785,8 +3974,8 @@ function MegaMenuLink({ href, icon, description, active, onClick, children, clas
|
|
|
3785
3974
|
function MegaMenuFeatured({ children, className = "" }) {
|
|
3786
3975
|
return /* @__PURE__ */ jsx("div", { className: ["min-w-0 rounded-lg bg-surface-raised border border-border p-4 flex flex-col", className].filter(Boolean).join(" "), children });
|
|
3787
3976
|
}
|
|
3788
|
-
var elementsOfType = (children, type) =>
|
|
3789
|
-
(c) =>
|
|
3977
|
+
var elementsOfType = (children, type) => React16.Children.toArray(children).filter(
|
|
3978
|
+
(c) => React16.isValidElement(c) && c.type === type
|
|
3790
3979
|
);
|
|
3791
3980
|
var MOBILE_CHEVRON = /* @__PURE__ */ jsx(
|
|
3792
3981
|
"svg",
|
|
@@ -3823,9 +4012,9 @@ function MobileLinkRow({ link, onNavigate }) {
|
|
|
3823
4012
|
);
|
|
3824
4013
|
}
|
|
3825
4014
|
function MobilePanel({ panel, onNavigate }) {
|
|
3826
|
-
const nodes =
|
|
4015
|
+
const nodes = React16.Children.toArray(panel.props.children);
|
|
3827
4016
|
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 px-2 pb-3 pt-1", children: nodes.map((node, i) => {
|
|
3828
|
-
if (!
|
|
4017
|
+
if (!React16.isValidElement(node)) return null;
|
|
3829
4018
|
const el = node;
|
|
3830
4019
|
if (el.type === MegaMenuSection) {
|
|
3831
4020
|
const { title, children } = el.props;
|
|
@@ -4118,7 +4307,7 @@ function ThemeProvider({
|
|
|
4118
4307
|
className = "",
|
|
4119
4308
|
style
|
|
4120
4309
|
}) {
|
|
4121
|
-
const id =
|
|
4310
|
+
const id = React16.useId().replace(/:/g, "");
|
|
4122
4311
|
const scopeClass = `geo-th-${id}`;
|
|
4123
4312
|
const divRef = useRef(null);
|
|
4124
4313
|
useEffect(() => {
|
|
@@ -6122,7 +6311,7 @@ function OtpInput({
|
|
|
6122
6311
|
emit(valid.join(""));
|
|
6123
6312
|
focusBox(valid.length);
|
|
6124
6313
|
};
|
|
6125
|
-
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxs(
|
|
6314
|
+
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxs(React16.Fragment, { children: [
|
|
6126
6315
|
/* @__PURE__ */ jsx(
|
|
6127
6316
|
"input",
|
|
6128
6317
|
{
|
|
@@ -7336,6 +7525,6 @@ function CreditCardForm({
|
|
|
7336
7525
|
);
|
|
7337
7526
|
}
|
|
7338
7527
|
|
|
7339
|
-
export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Box, Breadcrumbs, Button, CARD_BRANDS, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ColorPicker, ContextMenu, CreditCardForm, DateRangePicker, Drawer, Dropdown, FadingBase, Field, FieldHelpIcon, FieldLabel, FileInput, Flex, Form, FormContext, FormField, FormStore, Grid2 as Grid, GridCard, icons_default as Icon, IconButton, Kbd, List2 as List, LoadingSpinner, MegaMenu_default as MegaMenu, Modal, NotificationProvider, NumberInput, OpaqueGridCard, OtpInput, Password, Portal, RadioGroup, Rating, ScalableContainer, SearchInput_default as SearchInput, SegmentedControl, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, Slider, Switch, Table, Tabs_default as Tabs, TagsInput, DatePicker as Temporal, TextArea, TextInput, ThemeProvider, ThemeSwitch, TimePicker, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Typography, Wizard, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
|
7528
|
+
export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Box, Breadcrumbs, Button, CARD_BRANDS, Card_default as Card, CardCarousel, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ColorPicker, ContextMenu, CreditCardForm, DateRangePicker, Drawer, Dropdown, FadingBase, Field, FieldHelpIcon, FieldLabel, FileInput, Flex, Form, FormContext, FormField, FormStore, Grid2 as Grid, GridCard, icons_default as Icon, IconButton, Kbd, List2 as List, LoadingSpinner, MegaMenu_default as MegaMenu, Modal, NotificationProvider, NumberInput, OpaqueGridCard, OtpInput, Password, Portal, RadioGroup, Rating, ScalableContainer, SearchInput_default as SearchInput, SegmentedControl, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, Slider, Statistic, Switch, Table, Tabs_default as Tabs, TagsInput, DatePicker as Temporal, TextArea, TextInput, ThemeProvider, ThemeSwitch, TimePicker, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Typography, Wizard, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
|
7340
7529
|
//# sourceMappingURL=index.js.map
|
|
7341
7530
|
//# sourceMappingURL=index.js.map
|