@geomak/ui 6.15.0 → 6.17.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
@@ -626,21 +626,23 @@ interface IconButtonProps {
626
626
  * <IconButton icon={<Icon.Search />} onClick={doSearch} />
627
627
  * <IconButton type="bordered" icon={<Icon.Edit />} />
628
628
  */
629
- declare function IconButton({ icon, onClick, type, buttonType, disabled, size, loading, loadingIcon, className, style, }: IconButtonProps): react_jsx_runtime.JSX.Element;
629
+ declare function IconButton({ icon, onClick, type, buttonType, disabled, size, loading, loadingIcon, title, className, style, }: IconButtonProps): react_jsx_runtime.JSX.Element;
630
630
 
631
+ type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
631
632
  interface ModalProps {
632
633
  /**
633
- * Max width of the modal panel in pixels (default 600).
634
- * On narrow viewports the panel fills the screen minus 1 rem on each side.
635
- * Height is always content-driven (max 90 dvh).
634
+ * Named width scale (default `'md'`). Keeps modals consistent across the
635
+ * app: sm 400 · md 600 · lg 800 · xl 1000 · full (viewport − 2rem).
636
636
  */
637
- width?: number;
637
+ size?: ModalSize;
638
638
  /**
639
- * @deprecated Use `width` instead. The second tuple value (height) was
640
- * never honoured and is silently ignored. Kept for backwards
641
- * compatibility — will be removed in a future major version.
639
+ * Explicit max-width escape hatch a number (px) or any CSS length
640
+ * (e.g. `'48rem'`). Overrides `size` when set.
641
+ *
642
+ * Height is always content-driven (max 90 dvh): modals grow with their
643
+ * content and scroll internally rather than taking a fixed height.
642
644
  */
643
- size?: [number, number] | [number];
645
+ width?: number | string;
644
646
  isOpen?: boolean;
645
647
  onClose?: () => void;
646
648
  onOk?: () => void;
@@ -667,13 +669,23 @@ interface ModalProps {
667
669
  */
668
670
  declare function Modal({ width, size, isOpen, onClose, onOk, onCancel, okText, cancelText, hasFooter, title, children, className, }: ModalProps): react_jsx_runtime.JSX.Element;
669
671
 
672
+ type DrawerSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
670
673
  interface DrawerProps {
671
674
  isOpen?: boolean;
672
675
  onClose?: () => void;
673
676
  hasFooter?: boolean;
674
677
  /** 'left' | 'right' — which edge the panel slides from */
675
678
  placement?: 'left' | 'right';
676
- width?: number;
679
+ /**
680
+ * Named width scale (default `'md'`): sm 280 · md 320 · lg 480 · xl 640 ·
681
+ * full (viewport − 1rem). The panel always spans the full viewport height.
682
+ */
683
+ size?: DrawerSize;
684
+ /**
685
+ * Explicit width escape hatch — a number (px) or any CSS length
686
+ * (e.g. `'30rem'`). Overrides `size` when set.
687
+ */
688
+ width?: number | string;
677
689
  okText?: string;
678
690
  cancelText?: string;
679
691
  onOk?: () => void;
@@ -695,7 +707,7 @@ interface DrawerProps {
695
707
  * <FilterForm />
696
708
  * </Drawer>
697
709
  */
698
- declare function Drawer({ isOpen, onClose, hasFooter, placement, width, okText, cancelText, onOk, onCancel, title, children, className, }: DrawerProps): react_jsx_runtime.JSX.Element;
710
+ declare function Drawer({ isOpen, onClose, hasFooter, placement, size, width, okText, cancelText, onOk, onCancel, title, children, className, }: DrawerProps): react_jsx_runtime.JSX.Element;
699
711
 
700
712
  interface TooltipProps {
701
713
  children: React__default.ReactNode;
@@ -1394,6 +1406,335 @@ interface CartProps {
1394
1406
  */
1395
1407
  declare function Cart({ items, onQuantityChange, onRemove, summaryRows, formatPrice, checkoutLabel, onCheckout, emptyState, className, style, }: CartProps): react_jsx_runtime.JSX.Element;
1396
1408
 
1409
+ /** Shape accepted by `addToCart` — quantity is optional (defaults to 1). */
1410
+ type CartItemInput = Omit<CartLineItem, 'quantity'> & {
1411
+ quantity?: number;
1412
+ };
1413
+ interface CartContextValue {
1414
+ /** Current line items. */
1415
+ items: CartLineItem[];
1416
+ /**
1417
+ * Add an item to the cart. If an item with the same `id` is already
1418
+ * present, its quantity is increased (clamped to the line's `max`).
1419
+ */
1420
+ addToCart: (item: CartItemInput, quantity?: number) => void;
1421
+ /** Remove a line entirely by id. */
1422
+ removeFromCart: (id: CartLineItem['id']) => void;
1423
+ /** Set an exact quantity for a line (clamped to `1..max`). */
1424
+ updateQuantity: (id: CartLineItem['id'], quantity: number) => void;
1425
+ /** Empty the cart. */
1426
+ clearCart: () => void;
1427
+ /** Whether a line with this id exists. */
1428
+ isInCart: (id: CartLineItem['id']) => boolean;
1429
+ /** Total number of units across all lines (sum of quantities). */
1430
+ getItemCount: () => number;
1431
+ /** Subtotal — sum of `price × quantity` across all lines. */
1432
+ getCartTotal: () => number;
1433
+ }
1434
+ interface CartProviderProps {
1435
+ children: React__default.ReactNode;
1436
+ /** Seed the cart with these lines. */
1437
+ initialItems?: CartLineItem[];
1438
+ /** Called whenever the items change (add / remove / quantity / clear). */
1439
+ onChange?: (items: CartLineItem[]) => void;
1440
+ }
1441
+ /**
1442
+ * Provides a robust, app-wide cart API. Wrap any subtree and call
1443
+ * {@link useCart} from anywhere inside to add, remove, and total items —
1444
+ * the cart panel, a product grid, and a topbar badge all stay in sync off the
1445
+ * same store.
1446
+ *
1447
+ * The store is uncontrolled (owns its own state, seeded by `initialItems`);
1448
+ * subscribe to mutations via `onChange` to persist or sync externally.
1449
+ *
1450
+ * @example
1451
+ * <CartProvider>
1452
+ * <App />
1453
+ * </CartProvider>
1454
+ *
1455
+ * // anywhere inside:
1456
+ * const { addToCart, getItemCount } = useCart()
1457
+ * addToCart({ id: 1, name: 'Radar unit', price: 1290 })
1458
+ */
1459
+ declare function CartProvider({ children, initialItems, onChange }: CartProviderProps): react_jsx_runtime.JSX.Element;
1460
+ /**
1461
+ * Read the enclosing {@link CartProvider}'s store. Throws if used outside a
1462
+ * `<CartProvider>`.
1463
+ *
1464
+ * @example
1465
+ * const { items, addToCart, removeFromCart, getCartTotal } = useCart()
1466
+ */
1467
+ declare function useCart(): CartContextValue;
1468
+
1469
+ interface CartButtonProps {
1470
+ /** Click handler — typically opens the cart drawer / navigates to checkout. */
1471
+ onClick?: React__default.MouseEventHandler<HTMLButtonElement>;
1472
+ /** Icon-button style. Default `'bordered'`. */
1473
+ variant?: 'primary' | 'bordered';
1474
+ /** Badge colour. Default `'accent'`. */
1475
+ badgeTone?: BadgeTone;
1476
+ /** Cap the badge number (e.g. `9+`). Default `99`. */
1477
+ max?: number;
1478
+ /** Accessible label. Default `'Cart'` (with the live count appended). */
1479
+ title?: string;
1480
+ /** Override the cart glyph. */
1481
+ icon?: React__default.ReactNode;
1482
+ className?: string;
1483
+ }
1484
+ /**
1485
+ * A cart trigger for the app TopBar: an {@link IconButton} with a live count
1486
+ * {@link Badge} overlaid on its top-right corner. Reads the count straight from
1487
+ * the {@link useCart} store, so it must be rendered inside a `<CartProvider>`.
1488
+ *
1489
+ * @example
1490
+ * <TopBar actions={<CartButton onClick={() => setCartOpen(true)} />} />
1491
+ */
1492
+ declare function CartButton({ onClick, variant, badgeTone, max, title, icon, className, }: CartButtonProps): react_jsx_runtime.JSX.Element;
1493
+
1494
+ interface EmptyCartProps {
1495
+ /**
1496
+ * Illustration shown above the text. Pass your own node to fully replace
1497
+ * the default line-art cart. Set to `null` to hide it.
1498
+ */
1499
+ illustration?: React__default.ReactNode;
1500
+ /** Headline. Default `'Your cart is empty'`. */
1501
+ title?: React__default.ReactNode;
1502
+ /** Secondary line under the title. */
1503
+ description?: React__default.ReactNode;
1504
+ /** Optional call-to-action (e.g. a "Browse products" button). */
1505
+ action?: React__default.ReactNode;
1506
+ className?: string;
1507
+ style?: React__default.CSSProperties;
1508
+ }
1509
+ /**
1510
+ * The empty state for a shopping cart — a configurable illustration with a
1511
+ * title, optional description, and an optional call-to-action.
1512
+ *
1513
+ * Pass a custom `illustration` to match your brand, or override `title` /
1514
+ * `description` / `action` for the messaging.
1515
+ *
1516
+ * @example
1517
+ * <EmptyCart
1518
+ * title="Nothing here yet"
1519
+ * description="Browse the catalog to add items."
1520
+ * action={<Button content="Browse products" onClick={goShop} />}
1521
+ * />
1522
+ *
1523
+ * @example
1524
+ * // Drop it straight into the Cart panel's empty slot
1525
+ * <Cart items={[]} emptyState={<EmptyCart illustration={<MyArt />} />} />
1526
+ */
1527
+ declare function EmptyCart({ illustration, title, description, action, className, style, }: EmptyCartProps): react_jsx_runtime.JSX.Element;
1528
+
1529
+ /**
1530
+ * Shared field foundation for all oxygen-ui inputs.
1531
+ *
1532
+ * Centralises the things every input must agree on:
1533
+ * - the **size scale** (sm / md / lg) → control height + text size + padding
1534
+ * - the **refined focus treatment** — a crisp 1px accent border plus a soft
1535
+ * 3px low-opacity halo (NOT a heavy solid ring band)
1536
+ * - the **resting / hover / error / disabled** border + background states
1537
+ * - a **`<Field>` wrapper** handling label, error region, layout
1538
+ * (horizontal / vertical) and `aria` linkage consistently
1539
+ *
1540
+ * All values map to design-system tokens (control heights, semantic colours,
1541
+ * radii) so a consumer's ThemeProvider override flows straight through.
1542
+ */
1543
+ type FieldSize = 'sm' | 'md' | 'lg';
1544
+ interface FieldShellOptions {
1545
+ size?: FieldSize;
1546
+ hasError?: boolean;
1547
+ disabled?: boolean;
1548
+ /**
1549
+ * `true` for wrapper elements that hold a real `<input>` inside
1550
+ * (focus-within), `false` for elements that are themselves focusable
1551
+ * like `<button>` triggers (focus-visible). Default `false`.
1552
+ */
1553
+ focusWithin?: boolean;
1554
+ /** Append height/padding utilities (for single-line inputs). Default `true`. */
1555
+ sized?: boolean;
1556
+ }
1557
+ /**
1558
+ * Compose the className for an input's outer "shell" — the bordered, rounded
1559
+ * box that carries the focus ring. Apply to the `<input>` directly, or to a
1560
+ * wrapper `<div>` that contains an input plus adornments (pass
1561
+ * `focusWithin: true` in that case).
1562
+ */
1563
+ declare function fieldShell({ size, hasError, disabled, focusWithin, sized, }?: FieldShellOptions): string;
1564
+ /**
1565
+ * Small themed "info" affordance shown beside a field label. Hovering or
1566
+ * focusing it reveals `helperText` in a tooltip. Rendered as a `type="button"`
1567
+ * so it never submits an enclosing form, and coloured from semantic tokens so
1568
+ * it follows the active theme.
1569
+ */
1570
+ declare function FieldHelpIcon({ text }: {
1571
+ text: React__default.ReactNode;
1572
+ }): react_jsx_runtime.JSX.Element;
1573
+ interface FieldLabelProps {
1574
+ label?: React__default.ReactNode;
1575
+ htmlFor?: string;
1576
+ required?: boolean;
1577
+ /** Reveals an info icon + tooltip beside the label. */
1578
+ helperText?: React__default.ReactNode;
1579
+ /** Apply horizontal-layout spacing (no-wrap, shrink). */
1580
+ horizontal?: boolean;
1581
+ /**
1582
+ * Vertical alignment of the label against the control in horizontal layout.
1583
+ * `'start'` (default) nudges the label down to meet a standard ~36px input's
1584
+ * first line; `'center'` removes that offset so the label centres against a
1585
+ * short control (Switch, SegmentedControl).
1586
+ */
1587
+ align?: 'start' | 'center';
1588
+ style?: React__default.CSSProperties;
1589
+ /** Label column width in horizontal layout. */
1590
+ width?: string | number;
1591
+ className?: string;
1592
+ }
1593
+ /**
1594
+ * The label row shared by every input — label text + required asterisk +
1595
+ * optional `helperText` info icon. Components that render their own label
1596
+ * outside `<Field>` (Dropdown, DatePicker, Switch, SegmentedControl) use this
1597
+ * so the affordance is pixel-identical everywhere.
1598
+ *
1599
+ * Returns `null` when there's nothing to show (no label and no helperText).
1600
+ */
1601
+ declare function FieldLabel({ label, htmlFor, required, helperText, horizontal, align, style, width, className, }: FieldLabelProps): react_jsx_runtime.JSX.Element;
1602
+ interface FieldProps {
1603
+ label?: React__default.ReactNode;
1604
+ /** `id` of the control — links the `<label htmlFor>`. */
1605
+ htmlFor?: string;
1606
+ /** `id` for the error region — pair with `aria-describedby` on the control. */
1607
+ errorId?: string;
1608
+ errorMessage?: React__default.ReactNode;
1609
+ /** Orientation of label vs control. Default `'vertical'`. */
1610
+ layout?: 'horizontal' | 'vertical';
1611
+ /** Show a required asterisk after the label. */
1612
+ required?: boolean;
1613
+ /** Contextual help revealed via an info icon + tooltip beside the label. */
1614
+ helperText?: React__default.ReactNode;
1615
+ /**
1616
+ * Label alignment against the control in horizontal layout. `'start'`
1617
+ * (default) for standard-height inputs; `'center'` for short controls
1618
+ * (Switch) so the label lines up with the control's centre.
1619
+ */
1620
+ labelAlign?: 'start' | 'center';
1621
+ labelStyle?: React__default.CSSProperties;
1622
+ /** Width of the label column in horizontal layout (CSS length). */
1623
+ labelWidth?: string | number;
1624
+ className?: string;
1625
+ /** The control itself (input / trigger / dropzone). */
1626
+ children: React__default.ReactNode;
1627
+ }
1628
+ /**
1629
+ * Layout wrapper shared by every input. Renders:
1630
+ *
1631
+ * ```
1632
+ * vertical: horizontal:
1633
+ * [label] [label] [ control ]
1634
+ * [ control ] [ error message ]
1635
+ * [ error ]
1636
+ * ```
1637
+ *
1638
+ * The error message always sits under the **control only** (never spanning
1639
+ * the label in horizontal layout). Label uses full-contrast foreground +
1640
+ * medium weight so it reads as the anchor, while the input's placeholder is
1641
+ * muted — establishing hierarchy without making the label tiny.
1642
+ */
1643
+ declare function Field({ label, htmlFor, errorId, errorMessage, layout, required, helperText, labelAlign, labelStyle, labelWidth, className, children, }: FieldProps): react_jsx_runtime.JSX.Element;
1644
+
1645
+ /** The normalised value emitted on change / submit. */
1646
+ interface CreditCardValue {
1647
+ /** Digits only (no spaces). */
1648
+ number: string;
1649
+ /** Cardholder name. */
1650
+ name: string;
1651
+ /** `MM/YY`. */
1652
+ expiry: string;
1653
+ /** Digits only. */
1654
+ cvv: string;
1655
+ /** Detected brand id (`'visa'`, `'amex'`…) or `null`. */
1656
+ brand: string | null;
1657
+ }
1658
+ interface CreditCardFormProps {
1659
+ /** Called with the validated card once every field passes on submit. */
1660
+ onSubmit?: (card: CreditCardValue) => void | Promise<void>;
1661
+ /** Called on every keystroke with the current (possibly invalid) card. */
1662
+ onChange?: (card: CreditCardValue) => void;
1663
+ /** Seed the fields (uncontrolled). Number/expiry are auto-formatted. */
1664
+ defaultValue?: Partial<CreditCardValue>;
1665
+ /** Size preset for the inner fields. Default `'md'`. */
1666
+ size?: FieldSize;
1667
+ /** Disable every field + the submit button. */
1668
+ disabled?: boolean;
1669
+ /**
1670
+ * Disable only the submit button, leaving the fields editable. Useful to
1671
+ * gate payment on an external condition (e.g. an empty cart) while still
1672
+ * letting the user fill in their card. Combined with `disabled` (either
1673
+ * disables the button).
1674
+ */
1675
+ submitDisabled?: boolean;
1676
+ /** Require the cardholder name. Default `true`. */
1677
+ requireName?: boolean;
1678
+ /** Hide the built-in submit button (when embedding in a larger form). */
1679
+ hideSubmit?: boolean;
1680
+ /** Submit button label. Default `'Pay'`. */
1681
+ submitLabel?: React__default.ReactNode;
1682
+ /** Extra classes on the root `<form>`. */
1683
+ className?: string;
1684
+ /** Inline style on the root `<form>`. */
1685
+ style?: React__default.CSSProperties;
1686
+ }
1687
+ /**
1688
+ * Unified credit-card form built on the oxygen-ui {@link useForm} Form API.
1689
+ *
1690
+ * One component owns all four fields and their cross-field rules — card number
1691
+ * (brand detection + grouping + Luhn), expiry (`MM/YY`, real month, not past),
1692
+ * CVV (brand-aware length), and cardholder name. It is deliberately NOT shipped
1693
+ * as separate inputs: a CVV or expiry field has no meaning outside a card form.
1694
+ *
1695
+ * Self-contained: render it and handle `onSubmit(card)`; the card is only
1696
+ * delivered once everything validates. Use `onChange` for live updates (e.g. a
1697
+ * card preview) and `hideSubmit` to embed it inside a larger form.
1698
+ *
1699
+ * @example
1700
+ * <CreditCardForm onSubmit={(card) => pay(card)} submitLabel="Pay $49" />
1701
+ */
1702
+ declare function CreditCardForm({ onSubmit, onChange, defaultValue, size, disabled, submitDisabled, requireName, hideSubmit, submitLabel, className, style, }: CreditCardFormProps): react_jsx_runtime.JSX.Element;
1703
+
1704
+ interface CheckoutProps {
1705
+ /** Page heading. Default `'Checkout'`. */
1706
+ title?: React__default.ReactNode;
1707
+ /** Extra summary rows (shipping, tax, discount) added to the cart subtotal. */
1708
+ summaryRows?: CartSummaryRow[];
1709
+ /** Price formatter. Default `'$' + value.toFixed(2)`. */
1710
+ formatPrice?: (value: number) => string;
1711
+ /** Heading above the payment form. Default `'Payment'`. */
1712
+ paymentTitle?: React__default.ReactNode;
1713
+ /**
1714
+ * Pay button label. Defaults to `Pay <total>`. The button is always
1715
+ * disabled while the cart is empty.
1716
+ */
1717
+ submitLabel?: React__default.ReactNode;
1718
+ /** Fired with the validated card once the form passes and the cart is non-empty. */
1719
+ onPaid?: (card: CreditCardValue) => void | Promise<void>;
1720
+ className?: string;
1721
+ }
1722
+ /**
1723
+ * A complete two-column checkout page: the {@link Cart} on the left and the
1724
+ * {@link CreditCardForm} on the right. Reads live items from the
1725
+ * {@link useCart} store, so it must be rendered inside a `<CartProvider>`.
1726
+ *
1727
+ * The pay button is disabled whenever the cart is empty (via the form's
1728
+ * `submitDisabled`) — the card fields stay editable, but payment can't be
1729
+ * submitted with nothing to buy. Stacks to a single column below `lg`.
1730
+ *
1731
+ * @example
1732
+ * <CartProvider initialItems={items}>
1733
+ * <Checkout summaryRows={[{ label: 'Shipping', value: 9.5 }]} onPaid={pay} />
1734
+ * </CartProvider>
1735
+ */
1736
+ declare function Checkout({ title, summaryRows, formatPrice, paymentTitle, submitLabel, onPaid, className, }: CheckoutProps): react_jsx_runtime.JSX.Element;
1737
+
1397
1738
  /** ─────────────────── types ─────────────────── */
1398
1739
  type NotificationType = 'info' | 'success' | 'warning' | 'danger';
1399
1740
  type NotificationPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
@@ -2557,122 +2898,6 @@ interface ButtonProps extends Omit<React__default.ButtonHTMLAttributes<HTMLButto
2557
2898
  */
2558
2899
  declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
2559
2900
 
2560
- /**
2561
- * Shared field foundation for all oxygen-ui inputs.
2562
- *
2563
- * Centralises the things every input must agree on:
2564
- * - the **size scale** (sm / md / lg) → control height + text size + padding
2565
- * - the **refined focus treatment** — a crisp 1px accent border plus a soft
2566
- * 3px low-opacity halo (NOT a heavy solid ring band)
2567
- * - the **resting / hover / error / disabled** border + background states
2568
- * - a **`<Field>` wrapper** handling label, error region, layout
2569
- * (horizontal / vertical) and `aria` linkage consistently
2570
- *
2571
- * All values map to design-system tokens (control heights, semantic colours,
2572
- * radii) so a consumer's ThemeProvider override flows straight through.
2573
- */
2574
- type FieldSize = 'sm' | 'md' | 'lg';
2575
- interface FieldShellOptions {
2576
- size?: FieldSize;
2577
- hasError?: boolean;
2578
- disabled?: boolean;
2579
- /**
2580
- * `true` for wrapper elements that hold a real `<input>` inside
2581
- * (focus-within), `false` for elements that are themselves focusable
2582
- * like `<button>` triggers (focus-visible). Default `false`.
2583
- */
2584
- focusWithin?: boolean;
2585
- /** Append height/padding utilities (for single-line inputs). Default `true`. */
2586
- sized?: boolean;
2587
- }
2588
- /**
2589
- * Compose the className for an input's outer "shell" — the bordered, rounded
2590
- * box that carries the focus ring. Apply to the `<input>` directly, or to a
2591
- * wrapper `<div>` that contains an input plus adornments (pass
2592
- * `focusWithin: true` in that case).
2593
- */
2594
- declare function fieldShell({ size, hasError, disabled, focusWithin, sized, }?: FieldShellOptions): string;
2595
- /**
2596
- * Small themed "info" affordance shown beside a field label. Hovering or
2597
- * focusing it reveals `helperText` in a tooltip. Rendered as a `type="button"`
2598
- * so it never submits an enclosing form, and coloured from semantic tokens so
2599
- * it follows the active theme.
2600
- */
2601
- declare function FieldHelpIcon({ text }: {
2602
- text: React__default.ReactNode;
2603
- }): react_jsx_runtime.JSX.Element;
2604
- interface FieldLabelProps {
2605
- label?: React__default.ReactNode;
2606
- htmlFor?: string;
2607
- required?: boolean;
2608
- /** Reveals an info icon + tooltip beside the label. */
2609
- helperText?: React__default.ReactNode;
2610
- /** Apply horizontal-layout spacing (no-wrap, shrink). */
2611
- horizontal?: boolean;
2612
- /**
2613
- * Vertical alignment of the label against the control in horizontal layout.
2614
- * `'start'` (default) nudges the label down to meet a standard ~36px input's
2615
- * first line; `'center'` removes that offset so the label centres against a
2616
- * short control (Switch, SegmentedControl).
2617
- */
2618
- align?: 'start' | 'center';
2619
- style?: React__default.CSSProperties;
2620
- /** Label column width in horizontal layout. */
2621
- width?: string | number;
2622
- className?: string;
2623
- }
2624
- /**
2625
- * The label row shared by every input — label text + required asterisk +
2626
- * optional `helperText` info icon. Components that render their own label
2627
- * outside `<Field>` (Dropdown, DatePicker, Switch, SegmentedControl) use this
2628
- * so the affordance is pixel-identical everywhere.
2629
- *
2630
- * Returns `null` when there's nothing to show (no label and no helperText).
2631
- */
2632
- declare function FieldLabel({ label, htmlFor, required, helperText, horizontal, align, style, width, className, }: FieldLabelProps): react_jsx_runtime.JSX.Element;
2633
- interface FieldProps {
2634
- label?: React__default.ReactNode;
2635
- /** `id` of the control — links the `<label htmlFor>`. */
2636
- htmlFor?: string;
2637
- /** `id` for the error region — pair with `aria-describedby` on the control. */
2638
- errorId?: string;
2639
- errorMessage?: React__default.ReactNode;
2640
- /** Orientation of label vs control. Default `'vertical'`. */
2641
- layout?: 'horizontal' | 'vertical';
2642
- /** Show a required asterisk after the label. */
2643
- required?: boolean;
2644
- /** Contextual help revealed via an info icon + tooltip beside the label. */
2645
- helperText?: React__default.ReactNode;
2646
- /**
2647
- * Label alignment against the control in horizontal layout. `'start'`
2648
- * (default) for standard-height inputs; `'center'` for short controls
2649
- * (Switch) so the label lines up with the control's centre.
2650
- */
2651
- labelAlign?: 'start' | 'center';
2652
- labelStyle?: React__default.CSSProperties;
2653
- /** Width of the label column in horizontal layout (CSS length). */
2654
- labelWidth?: string | number;
2655
- className?: string;
2656
- /** The control itself (input / trigger / dropzone). */
2657
- children: React__default.ReactNode;
2658
- }
2659
- /**
2660
- * Layout wrapper shared by every input. Renders:
2661
- *
2662
- * ```
2663
- * vertical: horizontal:
2664
- * [label] [label] [ control ]
2665
- * [ control ] [ error message ]
2666
- * [ error ]
2667
- * ```
2668
- *
2669
- * The error message always sits under the **control only** (never spanning
2670
- * the label in horizontal layout). Label uses full-contrast foreground +
2671
- * medium weight so it reads as the anchor, while the input's placeholder is
2672
- * muted — establishing hierarchy without making the label tiny.
2673
- */
2674
- declare function Field({ label, htmlFor, errorId, errorMessage, layout, required, helperText, labelAlign, labelStyle, labelWidth, className, children, }: FieldProps): react_jsx_runtime.JSX.Element;
2675
-
2676
2901
  interface TextInputProps {
2677
2902
  /** Controlled string value. */
2678
2903
  value?: string;
@@ -4361,58 +4586,6 @@ declare const FormContext: React$1.Context<FormStore>;
4361
4586
  /** Read the enclosing `<Form>`'s store. Throws if used outside a `<Form>`. */
4362
4587
  declare function useFormStore(): FormStore;
4363
4588
 
4364
- /** The normalised value emitted on change / submit. */
4365
- interface CreditCardValue {
4366
- /** Digits only (no spaces). */
4367
- number: string;
4368
- /** Cardholder name. */
4369
- name: string;
4370
- /** `MM/YY`. */
4371
- expiry: string;
4372
- /** Digits only. */
4373
- cvv: string;
4374
- /** Detected brand id (`'visa'`, `'amex'`…) or `null`. */
4375
- brand: string | null;
4376
- }
4377
- interface CreditCardFormProps {
4378
- /** Called with the validated card once every field passes on submit. */
4379
- onSubmit?: (card: CreditCardValue) => void | Promise<void>;
4380
- /** Called on every keystroke with the current (possibly invalid) card. */
4381
- onChange?: (card: CreditCardValue) => void;
4382
- /** Seed the fields (uncontrolled). Number/expiry are auto-formatted. */
4383
- defaultValue?: Partial<CreditCardValue>;
4384
- /** Size preset for the inner fields. Default `'md'`. */
4385
- size?: FieldSize;
4386
- /** Disable every field + the submit button. */
4387
- disabled?: boolean;
4388
- /** Require the cardholder name. Default `true`. */
4389
- requireName?: boolean;
4390
- /** Hide the built-in submit button (when embedding in a larger form). */
4391
- hideSubmit?: boolean;
4392
- /** Submit button label. Default `'Pay'`. */
4393
- submitLabel?: React__default.ReactNode;
4394
- /** Extra classes on the root `<form>`. */
4395
- className?: string;
4396
- /** Inline style on the root `<form>`. */
4397
- style?: React__default.CSSProperties;
4398
- }
4399
- /**
4400
- * Unified credit-card form built on the oxygen-ui {@link useForm} Form API.
4401
- *
4402
- * One component owns all four fields and their cross-field rules — card number
4403
- * (brand detection + grouping + Luhn), expiry (`MM/YY`, real month, not past),
4404
- * CVV (brand-aware length), and cardholder name. It is deliberately NOT shipped
4405
- * as separate inputs: a CVV or expiry field has no meaning outside a card form.
4406
- *
4407
- * Self-contained: render it and handle `onSubmit(card)`; the card is only
4408
- * delivered once everything validates. Use `onChange` for live updates (e.g. a
4409
- * card preview) and `hideSubmit` to embed it inside a larger form.
4410
- *
4411
- * @example
4412
- * <CreditCardForm onSubmit={(card) => pay(card)} submitLabel="Pay $49" />
4413
- */
4414
- declare function CreditCardForm({ onSubmit, onChange, defaultValue, size, disabled, requireName, hideSubmit, submitLabel, className, style, }: CreditCardFormProps): react_jsx_runtime.JSX.Element;
4415
-
4416
4589
  /**
4417
4590
  * Zero-dependency credit-card helpers: brand detection, Luhn checksum, and
4418
4591
  * display formatting. Pure functions — no React, no deps — so they're unit
@@ -4455,4 +4628,4 @@ declare function expiryError(value: string, now?: Date): string | undefined;
4455
4628
  /** Validate the CVV against the detected brand's expected length. */
4456
4629
  declare function cvvError(value: string, cardNumber: string): string | undefined;
4457
4630
 
4458
- 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 };
4631
+ 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, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, 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, 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, useCart, useFieldArray, useForm, useFormField, useFormStore, useNotification };