@geomak/ui 6.11.0 → 6.12.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.d.cts CHANGED
@@ -1331,6 +1331,69 @@ interface CalendarProps {
1331
1331
  */
1332
1332
  declare function Calendar({ value, onChange, month, defaultMonth, onMonthChange, events, min, max, weekStartsOn, className, style, }: CalendarProps): react_jsx_runtime.JSX.Element;
1333
1333
 
1334
+ interface CartLineItem {
1335
+ id: string | number;
1336
+ /** Product name. */
1337
+ name: React__default.ReactNode;
1338
+ /** Unit price. */
1339
+ price: number;
1340
+ /** Quantity in the cart. */
1341
+ quantity: number;
1342
+ /** Optional thumbnail URL. */
1343
+ image?: string;
1344
+ /** Optional secondary line (variant, SKU). */
1345
+ meta?: React__default.ReactNode;
1346
+ /** Per-line quantity ceiling. */
1347
+ max?: number;
1348
+ }
1349
+ interface CartSummaryRow {
1350
+ label: React__default.ReactNode;
1351
+ /** Signed amount — negative for discounts. */
1352
+ value: number;
1353
+ /** Render in muted/normal style instead of emphasised. */
1354
+ muted?: boolean;
1355
+ }
1356
+ interface CartProps {
1357
+ /** Line items. */
1358
+ items: CartLineItem[];
1359
+ /** Fires when a line's stepper changes (clamped to 1..max). */
1360
+ onQuantityChange?: (id: CartLineItem['id'], quantity: number) => void;
1361
+ /** Fires when a line's remove button is pressed. */
1362
+ onRemove?: (id: CartLineItem['id']) => void;
1363
+ /** Extra summary rows (shipping, tax, discount) added to the subtotal for the total. */
1364
+ summaryRows?: CartSummaryRow[];
1365
+ /** Price formatter. Default `'$' + value.toFixed(2)`. */
1366
+ formatPrice?: (value: number) => string;
1367
+ /** Checkout button label. Default `'Checkout'`. */
1368
+ checkoutLabel?: React__default.ReactNode;
1369
+ /** Checkout handler. Omit to hide the button. */
1370
+ onCheckout?: () => void;
1371
+ /** Shown when there are no items. */
1372
+ emptyState?: React__default.ReactNode;
1373
+ className?: string;
1374
+ style?: React__default.CSSProperties;
1375
+ }
1376
+ /**
1377
+ * A shopping-cart panel: line items with thumbnail, quantity stepper, and
1378
+ * remove, plus a summary that totals the subtotal with any extra rows
1379
+ * (shipping, tax, discount) and an optional checkout button.
1380
+ *
1381
+ * Stateless and controlled — you own the items array and react to
1382
+ * `onQuantityChange` / `onRemove`.
1383
+ *
1384
+ * @example
1385
+ * ```tsx
1386
+ * <Cart
1387
+ * items={items}
1388
+ * onQuantityChange={(id, q) => setQty(id, q)}
1389
+ * onRemove={removeItem}
1390
+ * summaryRows={[{ label: 'Shipping', value: 9.5 }]}
1391
+ * onCheckout={checkout}
1392
+ * />
1393
+ * ```
1394
+ */
1395
+ declare function Cart({ items, onQuantityChange, onRemove, summaryRows, formatPrice, checkoutLabel, onCheckout, emptyState, className, style, }: CartProps): react_jsx_runtime.JSX.Element;
1396
+
1334
1397
  /** ─────────────────── types ─────────────────── */
1335
1398
  type NotificationType = 'info' | 'success' | 'warning' | 'danger';
1336
1399
  type NotificationPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
@@ -4399,4 +4462,4 @@ declare function expiryError(value: string, now?: Date): string | undefined;
4399
4462
  /** Validate the CVV against the detected brand's expected length. */
4400
4463
  declare function cvvError(value: string, cardNumber: string): string | undefined;
4401
4464
 
4402
- 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, 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, 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, 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, PopConfirm, type PopConfirmProps, type PopConfirmTone, 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 };
4465
+ 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, type CartLineItem, type CartProps, type CartSummaryRow, 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, 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, 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, PopConfirm, type PopConfirmProps, type PopConfirmTone, 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
@@ -1331,6 +1331,69 @@ interface CalendarProps {
1331
1331
  */
1332
1332
  declare function Calendar({ value, onChange, month, defaultMonth, onMonthChange, events, min, max, weekStartsOn, className, style, }: CalendarProps): react_jsx_runtime.JSX.Element;
1333
1333
 
1334
+ interface CartLineItem {
1335
+ id: string | number;
1336
+ /** Product name. */
1337
+ name: React__default.ReactNode;
1338
+ /** Unit price. */
1339
+ price: number;
1340
+ /** Quantity in the cart. */
1341
+ quantity: number;
1342
+ /** Optional thumbnail URL. */
1343
+ image?: string;
1344
+ /** Optional secondary line (variant, SKU). */
1345
+ meta?: React__default.ReactNode;
1346
+ /** Per-line quantity ceiling. */
1347
+ max?: number;
1348
+ }
1349
+ interface CartSummaryRow {
1350
+ label: React__default.ReactNode;
1351
+ /** Signed amount — negative for discounts. */
1352
+ value: number;
1353
+ /** Render in muted/normal style instead of emphasised. */
1354
+ muted?: boolean;
1355
+ }
1356
+ interface CartProps {
1357
+ /** Line items. */
1358
+ items: CartLineItem[];
1359
+ /** Fires when a line's stepper changes (clamped to 1..max). */
1360
+ onQuantityChange?: (id: CartLineItem['id'], quantity: number) => void;
1361
+ /** Fires when a line's remove button is pressed. */
1362
+ onRemove?: (id: CartLineItem['id']) => void;
1363
+ /** Extra summary rows (shipping, tax, discount) added to the subtotal for the total. */
1364
+ summaryRows?: CartSummaryRow[];
1365
+ /** Price formatter. Default `'$' + value.toFixed(2)`. */
1366
+ formatPrice?: (value: number) => string;
1367
+ /** Checkout button label. Default `'Checkout'`. */
1368
+ checkoutLabel?: React__default.ReactNode;
1369
+ /** Checkout handler. Omit to hide the button. */
1370
+ onCheckout?: () => void;
1371
+ /** Shown when there are no items. */
1372
+ emptyState?: React__default.ReactNode;
1373
+ className?: string;
1374
+ style?: React__default.CSSProperties;
1375
+ }
1376
+ /**
1377
+ * A shopping-cart panel: line items with thumbnail, quantity stepper, and
1378
+ * remove, plus a summary that totals the subtotal with any extra rows
1379
+ * (shipping, tax, discount) and an optional checkout button.
1380
+ *
1381
+ * Stateless and controlled — you own the items array and react to
1382
+ * `onQuantityChange` / `onRemove`.
1383
+ *
1384
+ * @example
1385
+ * ```tsx
1386
+ * <Cart
1387
+ * items={items}
1388
+ * onQuantityChange={(id, q) => setQty(id, q)}
1389
+ * onRemove={removeItem}
1390
+ * summaryRows={[{ label: 'Shipping', value: 9.5 }]}
1391
+ * onCheckout={checkout}
1392
+ * />
1393
+ * ```
1394
+ */
1395
+ declare function Cart({ items, onQuantityChange, onRemove, summaryRows, formatPrice, checkoutLabel, onCheckout, emptyState, className, style, }: CartProps): react_jsx_runtime.JSX.Element;
1396
+
1334
1397
  /** ─────────────────── types ─────────────────── */
1335
1398
  type NotificationType = 'info' | 'success' | 'warning' | 'danger';
1336
1399
  type NotificationPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
@@ -4399,4 +4462,4 @@ declare function expiryError(value: string, now?: Date): string | undefined;
4399
4462
  /** Validate the CVV against the detected brand's expected length. */
4400
4463
  declare function cvvError(value: string, cardNumber: string): string | undefined;
4401
4464
 
4402
- 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, 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, 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, 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, PopConfirm, type PopConfirmProps, type PopConfirmTone, 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 };
4465
+ 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, type CartLineItem, type CartProps, type CartSummaryRow, 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, 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, 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, PopConfirm, type PopConfirmProps, type PopConfirmTone, 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
@@ -2118,6 +2118,81 @@ function Calendar2({
2118
2118
  }) })
2119
2119
  ] });
2120
2120
  }
2121
+ var defaultFormat = (v) => `${v < 0 ? "-" : ""}$${Math.abs(v).toFixed(2)}`;
2122
+ var Stepper = ({
2123
+ quantity,
2124
+ max,
2125
+ onChange
2126
+ }) => {
2127
+ const btn = "flex h-7 w-7 items-center justify-center text-foreground-secondary hover:bg-surface-raised disabled:opacity-40 disabled:hover:bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset transition-colors";
2128
+ return /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center rounded-md border border-border overflow-hidden", children: [
2129
+ /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Decrease quantity", disabled: quantity <= 1, onClick: () => onChange?.(quantity - 1), className: btn, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-3.5 w-3.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", d: "M5 12h14" }) }) }),
2130
+ /* @__PURE__ */ jsx("span", { className: "w-8 text-center text-sm tabular-nums text-foreground select-none", children: quantity }),
2131
+ /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Increase quantity", disabled: max != null && quantity >= max, onClick: () => onChange?.(quantity + 1), className: btn, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-3.5 w-3.5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", d: "M12 5v14M5 12h14" }) }) })
2132
+ ] });
2133
+ };
2134
+ function Cart({
2135
+ items,
2136
+ onQuantityChange,
2137
+ onRemove,
2138
+ summaryRows = [],
2139
+ formatPrice = defaultFormat,
2140
+ checkoutLabel = "Checkout",
2141
+ onCheckout,
2142
+ emptyState,
2143
+ className = "",
2144
+ style
2145
+ }) {
2146
+ const subtotal = items.reduce((sum, it) => sum + it.price * it.quantity, 0);
2147
+ const total = subtotal + summaryRows.reduce((sum, r) => sum + r.value, 0);
2148
+ return /* @__PURE__ */ jsxs("div", { className: ["flex flex-col rounded-xl border border-border bg-surface", className].filter(Boolean).join(" "), style, children: [
2149
+ items.length === 0 ? /* @__PURE__ */ jsx("div", { className: "p-8 text-center text-sm text-foreground-muted", children: emptyState ?? "Your cart is empty." }) : /* @__PURE__ */ jsx("ul", { className: "divide-y divide-border", children: items.map((it) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-3 p-3", children: [
2150
+ /* @__PURE__ */ jsx("div", { className: "h-14 w-14 flex-shrink-0 overflow-hidden rounded-md bg-surface-raised", children: it.image && /* @__PURE__ */ jsx("img", { src: it.image, alt: "", className: "h-full w-full object-cover" }) }),
2151
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
2152
+ /* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium text-foreground", children: it.name }),
2153
+ it.meta && /* @__PURE__ */ jsx("div", { className: "truncate text-xs text-foreground-muted mt-0.5", children: it.meta }),
2154
+ /* @__PURE__ */ jsxs("div", { className: "mt-1.5 flex items-center gap-3", children: [
2155
+ /* @__PURE__ */ jsx(Stepper, { quantity: it.quantity, max: it.max, onChange: (q) => onQuantityChange?.(it.id, Math.max(1, q)) }),
2156
+ onRemove && /* @__PURE__ */ jsx(
2157
+ "button",
2158
+ {
2159
+ type: "button",
2160
+ onClick: () => onRemove(it.id),
2161
+ className: "text-xs text-foreground-muted hover:text-status-error transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent rounded px-1",
2162
+ children: "Remove"
2163
+ }
2164
+ )
2165
+ ] })
2166
+ ] }),
2167
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 text-sm font-semibold text-foreground tabular-nums", children: formatPrice(it.price * it.quantity) })
2168
+ ] }, it.id)) }),
2169
+ items.length > 0 && /* @__PURE__ */ jsxs("div", { className: "border-t border-border p-4", children: [
2170
+ /* @__PURE__ */ jsxs("dl", { className: "space-y-1.5", children: [
2171
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm", children: [
2172
+ /* @__PURE__ */ jsx("dt", { className: "text-foreground-secondary", children: "Subtotal" }),
2173
+ /* @__PURE__ */ jsx("dd", { className: "tabular-nums text-foreground", children: formatPrice(subtotal) })
2174
+ ] }),
2175
+ summaryRows.map((r, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm", children: [
2176
+ /* @__PURE__ */ jsx("dt", { className: r.muted ? "text-foreground-muted" : "text-foreground-secondary", children: r.label }),
2177
+ /* @__PURE__ */ jsx("dd", { className: `tabular-nums ${r.value < 0 ? "text-status-success" : "text-foreground"}`, children: formatPrice(r.value) })
2178
+ ] }, i)),
2179
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-t border-border pt-2 mt-1 text-base font-semibold", children: [
2180
+ /* @__PURE__ */ jsx("dt", { className: "text-foreground", children: "Total" }),
2181
+ /* @__PURE__ */ jsx("dd", { className: "tabular-nums text-foreground", children: formatPrice(total) })
2182
+ ] })
2183
+ ] }),
2184
+ onCheckout && /* @__PURE__ */ jsx(
2185
+ "button",
2186
+ {
2187
+ type: "button",
2188
+ onClick: onCheckout,
2189
+ className: "mt-4 w-full rounded-lg bg-accent px-4 py-2.5 text-sm font-semibold text-accent-fg transition-colors hover:bg-accent-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2",
2190
+ children: checkoutLabel
2191
+ }
2192
+ )
2193
+ ] })
2194
+ ] });
2195
+ }
2121
2196
  var NotificationContext = createContext({
2122
2197
  open: () => void 0,
2123
2198
  close: () => void 0
@@ -5791,7 +5866,7 @@ function addMonths2(d, n) {
5791
5866
  c.setMonth(c.getMonth() + n);
5792
5867
  return c;
5793
5868
  }
5794
- function defaultFormat(d) {
5869
+ function defaultFormat2(d) {
5795
5870
  const y = d.getFullYear().toString().padStart(4, "0");
5796
5871
  const m = (d.getMonth() + 1).toString().padStart(2, "0");
5797
5872
  const day = d.getDate().toString().padStart(2, "0");
@@ -5825,7 +5900,7 @@ function DatePicker({
5825
5900
  min,
5826
5901
  max,
5827
5902
  style,
5828
- format = defaultFormat,
5903
+ format = defaultFormat2,
5829
5904
  weekStartsOn = 0,
5830
5905
  clearable = true,
5831
5906
  size = "md",
@@ -5847,7 +5922,7 @@ function DatePicker({
5847
5922
  }, [open, value]);
5848
5923
  useEffect(() => {
5849
5924
  if (!open) return;
5850
- const cell = gridRef.current?.querySelector(`[data-day="${defaultFormat(focusDate)}"]`);
5925
+ const cell = gridRef.current?.querySelector(`[data-day="${defaultFormat2(focusDate)}"]`);
5851
5926
  cell?.focus();
5852
5927
  }, [open, focusDate]);
5853
5928
  const weekdays = useMemo(() => {
@@ -6059,8 +6134,8 @@ function DatePicker({
6059
6134
  type: "button",
6060
6135
  disabled: dis,
6061
6136
  tabIndex: focused ? 0 : -1,
6062
- "data-day": defaultFormat(date),
6063
- "aria-label": defaultFormat(date),
6137
+ "data-day": defaultFormat2(date),
6138
+ "aria-label": defaultFormat2(date),
6064
6139
  "aria-selected": sel || void 0,
6065
6140
  onClick: () => selectDate(date),
6066
6141
  className: [
@@ -6071,7 +6146,7 @@ function DatePicker({
6071
6146
  ].join(" "),
6072
6147
  children: date.getDate()
6073
6148
  }
6074
- ) }, defaultFormat(date));
6149
+ ) }, defaultFormat2(date));
6075
6150
  }) }, ri)) })
6076
6151
  ]
6077
6152
  }
@@ -7817,6 +7892,6 @@ function CreditCardForm({
7817
7892
  );
7818
7893
  }
7819
7894
 
7820
- export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Box, Breadcrumbs, Button, CARD_BRANDS, Calendar2 as Calendar, Card_default as Card, CardCarousel, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ColorPicker, ContextMenu, CreditCardForm, DateRangePicker, Drawer, Dropdown, FAB, 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, PopConfirm, 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 };
7895
+ export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Box, Breadcrumbs, Button, CARD_BRANDS, Calendar2 as Calendar, Card_default as Card, CardCarousel, Cart, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ColorPicker, ContextMenu, CreditCardForm, DateRangePicker, Drawer, Dropdown, FAB, 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, PopConfirm, 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 };
7821
7896
  //# sourceMappingURL=index.js.map
7822
7897
  //# sourceMappingURL=index.js.map