@geomak/ui 6.27.3 → 6.29.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 +685 -404
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +142 -1
- package/dist/index.d.ts +142 -1
- package/dist/index.js +430 -154
- package/dist/index.js.map +1 -1
- package/dist/styles.css +40 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1347,6 +1347,67 @@ interface CardCarouselProps {
|
|
|
1347
1347
|
*/
|
|
1348
1348
|
declare function CardCarousel(props: CardCarouselProps): react_jsx_runtime.JSX.Element;
|
|
1349
1349
|
|
|
1350
|
+
interface ChatMessage {
|
|
1351
|
+
id: string | number;
|
|
1352
|
+
/** Author id — compared to `currentUserId` to decide own vs. incoming. */
|
|
1353
|
+
authorId: string | number;
|
|
1354
|
+
/** Display name (shown above the first bubble of an incoming group). */
|
|
1355
|
+
authorName?: string;
|
|
1356
|
+
/** Avatar image URL (falls back to initials of `authorName`). */
|
|
1357
|
+
avatar?: string;
|
|
1358
|
+
/** Message body. */
|
|
1359
|
+
text: string;
|
|
1360
|
+
/** Timestamp — Date or ISO string. */
|
|
1361
|
+
timestamp?: Date | string;
|
|
1362
|
+
/** Delivery status for own messages. */
|
|
1363
|
+
status?: 'sent' | 'delivered' | 'read';
|
|
1364
|
+
}
|
|
1365
|
+
interface ChatProps {
|
|
1366
|
+
messages: ChatMessage[];
|
|
1367
|
+
/** The viewer's id — their messages align right with the accent bubble. */
|
|
1368
|
+
currentUserId: string | number;
|
|
1369
|
+
/** Fires when the composer sends a non-empty trimmed message. */
|
|
1370
|
+
onSend?: (text: string) => void;
|
|
1371
|
+
/** Names currently typing — shows an animated indicator at the bottom. */
|
|
1372
|
+
typingNames?: string[];
|
|
1373
|
+
/** Header: title, subtitle, avatar, trailing actions. Omit for no header. */
|
|
1374
|
+
title?: React__default.ReactNode;
|
|
1375
|
+
subtitle?: React__default.ReactNode;
|
|
1376
|
+
avatar?: string;
|
|
1377
|
+
headerActions?: React__default.ReactNode;
|
|
1378
|
+
/** Composer placeholder. */
|
|
1379
|
+
placeholder?: string;
|
|
1380
|
+
/** Disable the composer. */
|
|
1381
|
+
disabled?: boolean;
|
|
1382
|
+
/** Hide the composer entirely (read-only transcript). */
|
|
1383
|
+
hideComposer?: boolean;
|
|
1384
|
+
/** Shown when there are no messages. */
|
|
1385
|
+
emptyState?: React__default.ReactNode;
|
|
1386
|
+
/** Overall height — the message list scrolls within it. Default `480`. */
|
|
1387
|
+
height?: number | string;
|
|
1388
|
+
className?: string;
|
|
1389
|
+
style?: React__default.CSSProperties;
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* A chat / messaging surface: a scrollable transcript of message bubbles plus a
|
|
1393
|
+
* composer. Own messages (matching `currentUserId`) align right in the accent
|
|
1394
|
+
* colour; incoming messages align left on a raised surface with an avatar and
|
|
1395
|
+
* name. Consecutive messages from one author group together; the list
|
|
1396
|
+
* auto-scrolls to the newest message (with a "jump to latest" affordance when
|
|
1397
|
+
* you've scrolled up), and a typing indicator can be shown.
|
|
1398
|
+
*
|
|
1399
|
+
* Controlled: you own `messages`; the composer reports text via `onSend`.
|
|
1400
|
+
*
|
|
1401
|
+
* @example
|
|
1402
|
+
* <Chat
|
|
1403
|
+
* currentUserId="me"
|
|
1404
|
+
* messages={messages}
|
|
1405
|
+
* typingNames={['Maria']}
|
|
1406
|
+
* onSend={(text) => send(text)}
|
|
1407
|
+
* />
|
|
1408
|
+
*/
|
|
1409
|
+
declare function Chat({ messages, currentUserId, onSend, typingNames, title, subtitle, avatar, headerActions, placeholder, disabled, hideComposer, emptyState, height, className, style, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
1410
|
+
|
|
1350
1411
|
type StatisticSize = 'sm' | 'md' | 'lg';
|
|
1351
1412
|
type DeltaDirection = 'up' | 'down' | 'neutral';
|
|
1352
1413
|
interface StatisticDelta {
|
|
@@ -4941,6 +5002,86 @@ declare const FormContext: React$1.Context<FormStore>;
|
|
|
4941
5002
|
/** Read the enclosing `<Form>`'s store. Throws if used outside a `<Form>`. */
|
|
4942
5003
|
declare function useFormStore(): FormStore;
|
|
4943
5004
|
|
|
5005
|
+
type SetValue<T> = (value: T | ((prev: T) => T)) => void;
|
|
5006
|
+
/**
|
|
5007
|
+
* Persist React state to `localStorage`, JSON-serialised. SSR-safe (falls back
|
|
5008
|
+
* to `initialValue` when `window` is absent), and synced both **across tabs**
|
|
5009
|
+
* (the native `storage` event) and **across hook instances in the same tab**
|
|
5010
|
+
* (a custom event), so two components on the same key stay consistent.
|
|
5011
|
+
*
|
|
5012
|
+
* @returns `[value, setValue, remove]` — `setValue` accepts a value or an
|
|
5013
|
+
* updater, like `useState`; `remove` deletes the key and resets to initial.
|
|
5014
|
+
*
|
|
5015
|
+
* @example
|
|
5016
|
+
* const [theme, setTheme, clearTheme] = useLocalStorage('theme', 'system')
|
|
5017
|
+
* setTheme('dark')
|
|
5018
|
+
* setTheme((t) => (t === 'dark' ? 'light' : 'dark'))
|
|
5019
|
+
*/
|
|
5020
|
+
declare function useLocalStorage<T>(key: string, initialValue: T): [T, SetValue<T>, () => void];
|
|
5021
|
+
|
|
5022
|
+
/**
|
|
5023
|
+
* Track a CSS media query reactively. SSR-safe (returns `false` until mounted /
|
|
5024
|
+
* when `matchMedia` is unavailable) and updates as the match changes.
|
|
5025
|
+
*
|
|
5026
|
+
* @example
|
|
5027
|
+
* const isWide = useMediaQuery('(min-width: 1024px)')
|
|
5028
|
+
* const reduced = useMediaQuery('(prefers-reduced-motion: reduce)')
|
|
5029
|
+
* const dark = useMediaQuery('(prefers-color-scheme: dark)')
|
|
5030
|
+
*/
|
|
5031
|
+
declare function useMediaQuery(query: string): boolean;
|
|
5032
|
+
declare const BREAKPOINTS: {
|
|
5033
|
+
readonly sm: 480;
|
|
5034
|
+
readonly md: 768;
|
|
5035
|
+
readonly lg: 976;
|
|
5036
|
+
readonly xl: 1440;
|
|
5037
|
+
};
|
|
5038
|
+
type Breakpoint = keyof typeof BREAKPOINTS;
|
|
5039
|
+
interface BreakpointState {
|
|
5040
|
+
/** ≥ 480px */ sm: boolean;
|
|
5041
|
+
/** ≥ 768px */ md: boolean;
|
|
5042
|
+
/** ≥ 976px */ lg: boolean;
|
|
5043
|
+
/** ≥ 1440px */ xl: boolean;
|
|
5044
|
+
/** The largest matched breakpoint, or `'base'` below `sm`. */
|
|
5045
|
+
active: 'base' | Breakpoint;
|
|
5046
|
+
}
|
|
5047
|
+
/**
|
|
5048
|
+
* Reactive view of the library's responsive breakpoints (matching the Tailwind
|
|
5049
|
+
* `screens`). Each flag is a min-width match; `active` is the largest one met.
|
|
5050
|
+
*
|
|
5051
|
+
* @example
|
|
5052
|
+
* const { md, active } = useBreakpoint()
|
|
5053
|
+
* if (!md) return <MobileNav /> // below 768px
|
|
5054
|
+
*/
|
|
5055
|
+
declare function useBreakpoint(): BreakpointState;
|
|
5056
|
+
|
|
5057
|
+
interface JwtResult<T> {
|
|
5058
|
+
/** Decoded claims (payload), or `null` if absent / unparseable. */
|
|
5059
|
+
payload: T | null;
|
|
5060
|
+
/** Decoded header, or `null`. */
|
|
5061
|
+
header: Record<string, unknown> | null;
|
|
5062
|
+
/** Expiry as a Date (from the `exp` claim), or `null` if none. */
|
|
5063
|
+
expiresAt: Date | null;
|
|
5064
|
+
/** True once `exp` is in the past. `false` when there's no `exp`. */
|
|
5065
|
+
isExpired: boolean;
|
|
5066
|
+
/** Parseable payload AND not expired. */
|
|
5067
|
+
isValid: boolean;
|
|
5068
|
+
/** The original token. */
|
|
5069
|
+
raw: string | null;
|
|
5070
|
+
}
|
|
5071
|
+
/**
|
|
5072
|
+
* Decode a JWT client-side and track its expiry reactively. The hook
|
|
5073
|
+
* re-renders exactly when the token crosses its `exp`, so `isExpired` / `isValid`
|
|
5074
|
+
* flip on their own without polling.
|
|
5075
|
+
*
|
|
5076
|
+
* Decodes only — it never verifies the signature. Treat the result as a UI hint;
|
|
5077
|
+
* real authorization belongs on the server. Pairs with `SecureLayout`.
|
|
5078
|
+
*
|
|
5079
|
+
* @example
|
|
5080
|
+
* const { payload, isValid, expiresAt } = useJwt(token)
|
|
5081
|
+
* if (!isValid) redirectToLogin()
|
|
5082
|
+
*/
|
|
5083
|
+
declare function useJwt<T = Record<string, unknown>>(token: string | null | undefined): JwtResult<T>;
|
|
5084
|
+
|
|
4944
5085
|
/**
|
|
4945
5086
|
* Zero-dependency credit-card helpers: brand detection, Luhn checksum, and
|
|
4946
5087
|
* display formatting. Pure functions — no React, no deps — so they're unit
|
|
@@ -4983,4 +5124,4 @@ declare function expiryError(value: string, now?: Date): string | undefined;
|
|
|
4983
5124
|
/** Validate the CVV against the detected brand's expected length. */
|
|
4984
5125
|
declare function cvvError(value: string, cardNumber: string): string | undefined;
|
|
4985
5126
|
|
|
4986
|
-
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, Calendar, type CalendarEvent, type CalendarProps, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Cart, CartButton, type CartButtonProps, type CartContextValue, type CartItemInput, type CartLineItem, type CartProps, CartProvider, type CartProviderProps, type CartSummaryRow, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, Checkout, type CheckoutProps, 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, type DrawerSize, Dropdown, type DropdownItem, type DropdownProps, EmptyCart, type EmptyCartProps, type ErrorMap, type ExpandRowOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, 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, LogoutTimer, type LogoutTimerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, MenuButton, type MenuButtonItem, type MenuButtonProps, Modal, type ModalProps, type ModalSize, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, Scheduler, type SchedulerEvent, type SchedulerProps, type SchedulerRange, type SchedulerView, SearchInput, type SearchInputProps, SecureLayout, type SecureLayoutProps, 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, Stepper, type StepperActiveStatus, type StepperProps, type StepperStep, 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, Timeline, type TimelineEvent, type TimelineProps, type TimelineStatus, 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, useCart, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
|
5127
|
+
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, type Breakpoint, type BreakpointState, Button, type ButtonProps, CARD_BRANDS, Calendar, type CalendarEvent, type CalendarProps, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Cart, CartButton, type CartButtonProps, type CartContextValue, type CartItemInput, type CartLineItem, type CartProps, CartProvider, type CartProviderProps, type CartSummaryRow, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Chat, type ChatMessage, type ChatProps, Checkbox, type CheckboxProps, Checkout, type CheckoutProps, 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, type DrawerSize, Dropdown, type DropdownItem, type DropdownProps, EmptyCart, type EmptyCartProps, type ErrorMap, type ExpandRowOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, 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, type JwtResult, Kbd, type KbdProps, type KbdSize, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, LogoutTimer, type LogoutTimerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, MenuButton, type MenuButtonItem, type MenuButtonProps, Modal, type ModalProps, type ModalSize, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, Scheduler, type SchedulerEvent, type SchedulerProps, type SchedulerRange, type SchedulerView, SearchInput, type SearchInputProps, SecureLayout, type SecureLayoutProps, 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, Stepper, type StepperActiveStatus, type StepperProps, type StepperStep, 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, Timeline, type TimelineEvent, type TimelineProps, type TimelineStatus, 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, useBreakpoint, useCart, useFieldArray, useForm, useFormField, useFormStore, useJwt, useLocalStorage, useMediaQuery, useNotification };
|
package/dist/index.d.ts
CHANGED
|
@@ -1347,6 +1347,67 @@ interface CardCarouselProps {
|
|
|
1347
1347
|
*/
|
|
1348
1348
|
declare function CardCarousel(props: CardCarouselProps): react_jsx_runtime.JSX.Element;
|
|
1349
1349
|
|
|
1350
|
+
interface ChatMessage {
|
|
1351
|
+
id: string | number;
|
|
1352
|
+
/** Author id — compared to `currentUserId` to decide own vs. incoming. */
|
|
1353
|
+
authorId: string | number;
|
|
1354
|
+
/** Display name (shown above the first bubble of an incoming group). */
|
|
1355
|
+
authorName?: string;
|
|
1356
|
+
/** Avatar image URL (falls back to initials of `authorName`). */
|
|
1357
|
+
avatar?: string;
|
|
1358
|
+
/** Message body. */
|
|
1359
|
+
text: string;
|
|
1360
|
+
/** Timestamp — Date or ISO string. */
|
|
1361
|
+
timestamp?: Date | string;
|
|
1362
|
+
/** Delivery status for own messages. */
|
|
1363
|
+
status?: 'sent' | 'delivered' | 'read';
|
|
1364
|
+
}
|
|
1365
|
+
interface ChatProps {
|
|
1366
|
+
messages: ChatMessage[];
|
|
1367
|
+
/** The viewer's id — their messages align right with the accent bubble. */
|
|
1368
|
+
currentUserId: string | number;
|
|
1369
|
+
/** Fires when the composer sends a non-empty trimmed message. */
|
|
1370
|
+
onSend?: (text: string) => void;
|
|
1371
|
+
/** Names currently typing — shows an animated indicator at the bottom. */
|
|
1372
|
+
typingNames?: string[];
|
|
1373
|
+
/** Header: title, subtitle, avatar, trailing actions. Omit for no header. */
|
|
1374
|
+
title?: React__default.ReactNode;
|
|
1375
|
+
subtitle?: React__default.ReactNode;
|
|
1376
|
+
avatar?: string;
|
|
1377
|
+
headerActions?: React__default.ReactNode;
|
|
1378
|
+
/** Composer placeholder. */
|
|
1379
|
+
placeholder?: string;
|
|
1380
|
+
/** Disable the composer. */
|
|
1381
|
+
disabled?: boolean;
|
|
1382
|
+
/** Hide the composer entirely (read-only transcript). */
|
|
1383
|
+
hideComposer?: boolean;
|
|
1384
|
+
/** Shown when there are no messages. */
|
|
1385
|
+
emptyState?: React__default.ReactNode;
|
|
1386
|
+
/** Overall height — the message list scrolls within it. Default `480`. */
|
|
1387
|
+
height?: number | string;
|
|
1388
|
+
className?: string;
|
|
1389
|
+
style?: React__default.CSSProperties;
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* A chat / messaging surface: a scrollable transcript of message bubbles plus a
|
|
1393
|
+
* composer. Own messages (matching `currentUserId`) align right in the accent
|
|
1394
|
+
* colour; incoming messages align left on a raised surface with an avatar and
|
|
1395
|
+
* name. Consecutive messages from one author group together; the list
|
|
1396
|
+
* auto-scrolls to the newest message (with a "jump to latest" affordance when
|
|
1397
|
+
* you've scrolled up), and a typing indicator can be shown.
|
|
1398
|
+
*
|
|
1399
|
+
* Controlled: you own `messages`; the composer reports text via `onSend`.
|
|
1400
|
+
*
|
|
1401
|
+
* @example
|
|
1402
|
+
* <Chat
|
|
1403
|
+
* currentUserId="me"
|
|
1404
|
+
* messages={messages}
|
|
1405
|
+
* typingNames={['Maria']}
|
|
1406
|
+
* onSend={(text) => send(text)}
|
|
1407
|
+
* />
|
|
1408
|
+
*/
|
|
1409
|
+
declare function Chat({ messages, currentUserId, onSend, typingNames, title, subtitle, avatar, headerActions, placeholder, disabled, hideComposer, emptyState, height, className, style, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
1410
|
+
|
|
1350
1411
|
type StatisticSize = 'sm' | 'md' | 'lg';
|
|
1351
1412
|
type DeltaDirection = 'up' | 'down' | 'neutral';
|
|
1352
1413
|
interface StatisticDelta {
|
|
@@ -4941,6 +5002,86 @@ declare const FormContext: React$1.Context<FormStore>;
|
|
|
4941
5002
|
/** Read the enclosing `<Form>`'s store. Throws if used outside a `<Form>`. */
|
|
4942
5003
|
declare function useFormStore(): FormStore;
|
|
4943
5004
|
|
|
5005
|
+
type SetValue<T> = (value: T | ((prev: T) => T)) => void;
|
|
5006
|
+
/**
|
|
5007
|
+
* Persist React state to `localStorage`, JSON-serialised. SSR-safe (falls back
|
|
5008
|
+
* to `initialValue` when `window` is absent), and synced both **across tabs**
|
|
5009
|
+
* (the native `storage` event) and **across hook instances in the same tab**
|
|
5010
|
+
* (a custom event), so two components on the same key stay consistent.
|
|
5011
|
+
*
|
|
5012
|
+
* @returns `[value, setValue, remove]` — `setValue` accepts a value or an
|
|
5013
|
+
* updater, like `useState`; `remove` deletes the key and resets to initial.
|
|
5014
|
+
*
|
|
5015
|
+
* @example
|
|
5016
|
+
* const [theme, setTheme, clearTheme] = useLocalStorage('theme', 'system')
|
|
5017
|
+
* setTheme('dark')
|
|
5018
|
+
* setTheme((t) => (t === 'dark' ? 'light' : 'dark'))
|
|
5019
|
+
*/
|
|
5020
|
+
declare function useLocalStorage<T>(key: string, initialValue: T): [T, SetValue<T>, () => void];
|
|
5021
|
+
|
|
5022
|
+
/**
|
|
5023
|
+
* Track a CSS media query reactively. SSR-safe (returns `false` until mounted /
|
|
5024
|
+
* when `matchMedia` is unavailable) and updates as the match changes.
|
|
5025
|
+
*
|
|
5026
|
+
* @example
|
|
5027
|
+
* const isWide = useMediaQuery('(min-width: 1024px)')
|
|
5028
|
+
* const reduced = useMediaQuery('(prefers-reduced-motion: reduce)')
|
|
5029
|
+
* const dark = useMediaQuery('(prefers-color-scheme: dark)')
|
|
5030
|
+
*/
|
|
5031
|
+
declare function useMediaQuery(query: string): boolean;
|
|
5032
|
+
declare const BREAKPOINTS: {
|
|
5033
|
+
readonly sm: 480;
|
|
5034
|
+
readonly md: 768;
|
|
5035
|
+
readonly lg: 976;
|
|
5036
|
+
readonly xl: 1440;
|
|
5037
|
+
};
|
|
5038
|
+
type Breakpoint = keyof typeof BREAKPOINTS;
|
|
5039
|
+
interface BreakpointState {
|
|
5040
|
+
/** ≥ 480px */ sm: boolean;
|
|
5041
|
+
/** ≥ 768px */ md: boolean;
|
|
5042
|
+
/** ≥ 976px */ lg: boolean;
|
|
5043
|
+
/** ≥ 1440px */ xl: boolean;
|
|
5044
|
+
/** The largest matched breakpoint, or `'base'` below `sm`. */
|
|
5045
|
+
active: 'base' | Breakpoint;
|
|
5046
|
+
}
|
|
5047
|
+
/**
|
|
5048
|
+
* Reactive view of the library's responsive breakpoints (matching the Tailwind
|
|
5049
|
+
* `screens`). Each flag is a min-width match; `active` is the largest one met.
|
|
5050
|
+
*
|
|
5051
|
+
* @example
|
|
5052
|
+
* const { md, active } = useBreakpoint()
|
|
5053
|
+
* if (!md) return <MobileNav /> // below 768px
|
|
5054
|
+
*/
|
|
5055
|
+
declare function useBreakpoint(): BreakpointState;
|
|
5056
|
+
|
|
5057
|
+
interface JwtResult<T> {
|
|
5058
|
+
/** Decoded claims (payload), or `null` if absent / unparseable. */
|
|
5059
|
+
payload: T | null;
|
|
5060
|
+
/** Decoded header, or `null`. */
|
|
5061
|
+
header: Record<string, unknown> | null;
|
|
5062
|
+
/** Expiry as a Date (from the `exp` claim), or `null` if none. */
|
|
5063
|
+
expiresAt: Date | null;
|
|
5064
|
+
/** True once `exp` is in the past. `false` when there's no `exp`. */
|
|
5065
|
+
isExpired: boolean;
|
|
5066
|
+
/** Parseable payload AND not expired. */
|
|
5067
|
+
isValid: boolean;
|
|
5068
|
+
/** The original token. */
|
|
5069
|
+
raw: string | null;
|
|
5070
|
+
}
|
|
5071
|
+
/**
|
|
5072
|
+
* Decode a JWT client-side and track its expiry reactively. The hook
|
|
5073
|
+
* re-renders exactly when the token crosses its `exp`, so `isExpired` / `isValid`
|
|
5074
|
+
* flip on their own without polling.
|
|
5075
|
+
*
|
|
5076
|
+
* Decodes only — it never verifies the signature. Treat the result as a UI hint;
|
|
5077
|
+
* real authorization belongs on the server. Pairs with `SecureLayout`.
|
|
5078
|
+
*
|
|
5079
|
+
* @example
|
|
5080
|
+
* const { payload, isValid, expiresAt } = useJwt(token)
|
|
5081
|
+
* if (!isValid) redirectToLogin()
|
|
5082
|
+
*/
|
|
5083
|
+
declare function useJwt<T = Record<string, unknown>>(token: string | null | undefined): JwtResult<T>;
|
|
5084
|
+
|
|
4944
5085
|
/**
|
|
4945
5086
|
* Zero-dependency credit-card helpers: brand detection, Luhn checksum, and
|
|
4946
5087
|
* display formatting. Pure functions — no React, no deps — so they're unit
|
|
@@ -4983,4 +5124,4 @@ declare function expiryError(value: string, now?: Date): string | undefined;
|
|
|
4983
5124
|
/** Validate the CVV against the detected brand's expected length. */
|
|
4984
5125
|
declare function cvvError(value: string, cardNumber: string): string | undefined;
|
|
4985
5126
|
|
|
4986
|
-
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, Calendar, type CalendarEvent, type CalendarProps, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Cart, CartButton, type CartButtonProps, type CartContextValue, type CartItemInput, type CartLineItem, type CartProps, CartProvider, type CartProviderProps, type CartSummaryRow, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, Checkout, type CheckoutProps, 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, type DrawerSize, Dropdown, type DropdownItem, type DropdownProps, EmptyCart, type EmptyCartProps, type ErrorMap, type ExpandRowOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, 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, LogoutTimer, type LogoutTimerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, MenuButton, type MenuButtonItem, type MenuButtonProps, Modal, type ModalProps, type ModalSize, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, Scheduler, type SchedulerEvent, type SchedulerProps, type SchedulerRange, type SchedulerView, SearchInput, type SearchInputProps, SecureLayout, type SecureLayoutProps, 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, Stepper, type StepperActiveStatus, type StepperProps, type StepperStep, 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, Timeline, type TimelineEvent, type TimelineProps, type TimelineStatus, 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, useCart, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
|
5127
|
+
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, type Breakpoint, type BreakpointState, Button, type ButtonProps, CARD_BRANDS, Calendar, type CalendarEvent, type CalendarProps, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Cart, CartButton, type CartButtonProps, type CartContextValue, type CartItemInput, type CartLineItem, type CartProps, CartProvider, type CartProviderProps, type CartSummaryRow, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Chat, type ChatMessage, type ChatProps, Checkbox, type CheckboxProps, Checkout, type CheckoutProps, 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, type DrawerSize, Dropdown, type DropdownItem, type DropdownProps, EmptyCart, type EmptyCartProps, type ErrorMap, type ExpandRowOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, 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, type JwtResult, Kbd, type KbdProps, type KbdSize, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, LogoutTimer, type LogoutTimerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, MenuButton, type MenuButtonItem, type MenuButtonProps, Modal, type ModalProps, type ModalSize, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, Scheduler, type SchedulerEvent, type SchedulerProps, type SchedulerRange, type SchedulerView, SearchInput, type SearchInputProps, SecureLayout, type SecureLayoutProps, 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, Stepper, type StepperActiveStatus, type StepperProps, type StepperStep, 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, Timeline, type TimelineEvent, type TimelineProps, type TimelineStatus, 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, useBreakpoint, useCart, useFieldArray, useForm, useFormField, useFormStore, useJwt, useLocalStorage, useMediaQuery, useNotification };
|