@veladent/booking-widget 0.0.0-stage → 1.0.4-dev.11

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.
Files changed (60) hide show
  1. package/README.md +38 -2
  2. package/index.js +5888 -0
  3. package/package.json +51 -4
  4. package/styles.css +1 -0
  5. package/types/booking/core/src/client.d.ts +21 -0
  6. package/types/booking/core/src/index.d.ts +5 -0
  7. package/types/booking/core/src/locale.d.ts +113 -0
  8. package/types/booking/core/src/timezone.d.ts +10 -0
  9. package/types/booking/core/src/types.d.ts +135 -0
  10. package/types/booking/core/src/validation.d.ts +9 -0
  11. package/types/booking/react/src/booking-context.d.ts +70 -0
  12. package/types/booking/react/src/booking-parts-context.d.ts +7 -0
  13. package/types/booking/react/src/booking-parts.d.ts +148 -0
  14. package/types/booking/react/src/booking-widget.d.ts +19 -0
  15. package/types/booking/react/src/component-types.d.ts +33 -0
  16. package/types/booking/react/src/components/card-arrow.d.ts +4 -0
  17. package/types/booking/react/src/components/date-step.d.ts +2 -0
  18. package/types/booking/react/src/components/details-step.d.ts +2 -0
  19. package/types/booking/react/src/components/doctor-step.d.ts +2 -0
  20. package/types/booking/react/src/components/existing-phone-step.d.ts +2 -0
  21. package/types/booking/react/src/components/existing-record-step.d.ts +4 -0
  22. package/types/booking/react/src/components/gate-step.d.ts +2 -0
  23. package/types/booking/react/src/components/index.d.ts +15 -0
  24. package/types/booking/react/src/components/option-card.d.ts +8 -0
  25. package/types/booking/react/src/components/otp-step.d.ts +2 -0
  26. package/types/booking/react/src/components/payment-step.d.ts +2 -0
  27. package/types/booking/react/src/components/phone-input.d.ts +16 -0
  28. package/types/booking/react/src/components/service-step.d.ts +2 -0
  29. package/types/booking/react/src/components/step-header.d.ts +2 -0
  30. package/types/booking/react/src/components/summary-modal.d.ts +2 -0
  31. package/types/booking/react/src/components/treatment-step.d.ts +2 -0
  32. package/types/booking/react/src/components/utils.d.ts +8 -0
  33. package/types/booking/react/src/environment.d.ts +16 -0
  34. package/types/booking/react/src/index.d.ts +6 -0
  35. package/types/booking/react/src/verification-session.d.ts +12 -0
  36. package/types/ui/src/components/application/date-picker/calendar.d.ts +14 -0
  37. package/types/ui/src/components/application/date-picker/cell.d.ts +11 -0
  38. package/types/ui/src/components/application/date-picker/date-picker.d.ts +20 -0
  39. package/types/ui/src/components/base/avatar/avatar.d.ts +64 -0
  40. package/types/ui/src/components/base/avatar/base-components/avatar-add-button.d.ts +8 -0
  41. package/types/ui/src/components/base/avatar/base-components/avatar-company-icon.d.ts +7 -0
  42. package/types/ui/src/components/base/avatar/base-components/avatar-count.d.ts +6 -0
  43. package/types/ui/src/components/base/avatar/base-components/avatar-online-indicator.d.ts +7 -0
  44. package/types/ui/src/components/base/avatar/base-components/index.d.ts +4 -0
  45. package/types/ui/src/components/base/avatar/base-components/verified-tick.d.ts +6 -0
  46. package/types/ui/src/components/base/buttons/button.d.ts +104 -0
  47. package/types/ui/src/components/base/checkbox/checkbox.d.ts +26 -0
  48. package/types/ui/src/components/base/input/hint-text.d.ts +14 -0
  49. package/types/ui/src/components/base/input/input-date.d.ts +41 -0
  50. package/types/ui/src/components/base/input/input.d.ts +63 -0
  51. package/types/ui/src/components/base/input/label.d.ts +15 -0
  52. package/types/ui/src/components/base/input/pin-input.d.ts +55 -0
  53. package/types/ui/src/components/base/select/combobox.d.ts +14 -0
  54. package/types/ui/src/components/base/select/popover.d.ts +7 -0
  55. package/types/ui/src/components/base/select/select-item.d.ts +10 -0
  56. package/types/ui/src/components/base/select/select-shared.d.ts +58 -0
  57. package/types/ui/src/components/base/select/select.d.ts +19 -0
  58. package/types/ui/src/components/base/tooltip/tooltip.d.ts +29 -0
  59. package/types/ui/src/utils/cx.d.ts +11 -0
  60. package/types/ui/src/utils/is-react-component.d.ts +19 -0
@@ -0,0 +1,2 @@
1
+ import type { BookingStepComponentProps } from "../component-types.js";
2
+ export declare function ServiceStep({ classNames }: BookingStepComponentProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { StepHeaderProps } from "../component-types.js";
2
+ export declare function StepHeader({ backLabel, className, direction, hideBack, onBack, step, title, }: StepHeaderProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { BookingStepComponentProps } from "../component-types.js";
2
+ export declare function SummaryModal({ classNames }: BookingStepComponentProps): import("react").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import type { BookingStepComponentProps } from "../component-types.js";
2
+ export declare function TreatmentStep({ classNames }: BookingStepComponentProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export declare function cx(...values: Array<string | undefined | false>): string;
2
+ export declare function formatMoney(value: number | null | undefined, currencyCode: string, locale: string): string;
3
+ export declare function parseBookingDate(value: string): import("@internationalized/date").CalendarDate | null;
4
+ export declare function formatBookingDateTimeSafe(value: string, locale: string, timeZone: string): string;
5
+ export declare function formatBookingTimeSafe(value: string, locale: string, timeZone: string): string;
6
+ export declare function formatBookingDateSafe(value: string, locale: string, timeZone: string): string;
7
+ export declare function dateDistance(first: string, second: string): number;
8
+ export declare function getInitials(value: string): string;
@@ -0,0 +1,16 @@
1
+ declare global {
2
+ interface ImportMetaEnv {
3
+ readonly VITE_VELADENT_BOOKING_API_KEY?: string;
4
+ readonly VITE_VELADENT_BOOKING_API_URL?: string;
5
+ }
6
+ interface ImportMeta {
7
+ readonly env: ImportMetaEnv;
8
+ }
9
+ }
10
+ export declare function resolveBookingConnection(props: {
11
+ baseUrl?: string;
12
+ publishableKey?: string;
13
+ }): {
14
+ baseUrl: string;
15
+ publishableKey: string | undefined;
16
+ };
@@ -0,0 +1,6 @@
1
+ export * from "./booking-context.js";
2
+ export { useVeladantBooking as useVeladentBooking } from "./booking-context.js";
3
+ export * from "./booking-parts.js";
4
+ export * from "./booking-widget.js";
5
+ export * from "./component-types.js";
6
+ export * from "./components/index.js";
@@ -0,0 +1,12 @@
1
+ export interface VerifiedBookingSession {
2
+ expiresAt: number;
3
+ mode: "existing" | "new";
4
+ phone: string;
5
+ token: string;
6
+ }
7
+ export declare function readVerifiedSession(key?: string): VerifiedBookingSession | null;
8
+ export declare function writeVerifiedSession(key: string | undefined, session: VerifiedBookingSession | null): void;
9
+ export declare function readPendingCheckout(key?: string): BookingResult | null;
10
+ export declare function writePendingCheckout(key: string | undefined, result: BookingResult | null, paymentStarted?: boolean): void;
11
+ export declare function readPendingPaymentStarted(key: string | undefined, sessionId: string): boolean;
12
+ import type { BookingResult } from "@veladent/booking-core";
@@ -0,0 +1,14 @@
1
+ import type { PropsWithChildren, ReactNode } from "react";
2
+ import type { CalendarProps as AriaCalendarProps, DateValue } from "react-aria-components";
3
+ export declare const CalendarContextProvider: ({ children }: PropsWithChildren) => import("react").JSX.Element;
4
+ interface CalendarProps extends AriaCalendarProps<DateValue> {
5
+ /**
6
+ * The content to render between the header and the calendar grid.
7
+ * If not provided, a default layout will be rendered with a date input and a today button.
8
+ */
9
+ children?: ReactNode;
10
+ /** The dates to highlight. */
11
+ highlightedDates?: DateValue[];
12
+ }
13
+ export declare const Calendar: ({ highlightedDates, className, children, ...props }: CalendarProps) => import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { CalendarCellProps as AriaCalendarCellProps } from "react-aria-components";
2
+ interface CalendarCellProps extends AriaCalendarCellProps {
3
+ /** Whether the cell is highlighted. */
4
+ isHighlighted?: boolean;
5
+ /** Whether the calendar is a range calendar. */
6
+ isRangeCalendar?: boolean;
7
+ /** Whether to show out of range dates. */
8
+ showOutOfRangeDates?: boolean;
9
+ }
10
+ export declare const CalendarCell: ({ date, isHighlighted, showOutOfRangeDates, ...props }: CalendarCellProps) => import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from "react";
2
+ import type { DatePickerProps as AriaDatePickerProps, PopoverProps as AriaPopoverProps, DateValue } from "react-aria-components";
3
+ import { type ButtonProps } from "../../base/buttons/button.js";
4
+ interface DatePickerProps extends AriaDatePickerProps<DateValue> {
5
+ /** The function to call when the apply button is clicked. */
6
+ onApply?: () => void;
7
+ /** The function to call when the cancel button is clicked. */
8
+ onCancel?: () => void;
9
+ placeholder?: string;
10
+ popoverClassName?: string;
11
+ popoverProps?: Omit<AriaPopoverProps, "children" | "className">;
12
+ showFooter?: boolean;
13
+ showToday?: boolean;
14
+ size?: ButtonProps["size"];
15
+ timeZone?: string;
16
+ /** Custom trigger rendered inside the accessible date picker group. */
17
+ trigger?: ReactNode;
18
+ }
19
+ export declare const DatePicker: ({ value: valueProp, defaultValue, onChange, onApply, onCancel, size, showFooter, showToday, timeZone, trigger, placeholder, popoverClassName, popoverProps, ...props }: DatePickerProps) => import("react").JSX.Element;
20
+ export {};
@@ -0,0 +1,64 @@
1
+ import { type FC, type ReactNode } from "react";
2
+ export interface AvatarProps {
3
+ alt?: string;
4
+ /**
5
+ * Display a badge (i.e. company logo).
6
+ */
7
+ badge?: ReactNode;
8
+ /**
9
+ * Display an outer border around the avatar.
10
+ */
11
+ border?: boolean;
12
+ className?: string;
13
+ /**
14
+ * The class name for the main child of the avatar.
15
+ */
16
+ contentClassName?: string;
17
+ /**
18
+ * Display an inner contrast border around the avatar image.
19
+ */
20
+ contrastBorder?: boolean;
21
+ /**
22
+ * Display a count badge.
23
+ */
24
+ count?: number;
25
+ /**
26
+ * Whether the avatar should show a focus ring when the parent group is in focus.
27
+ * For example, when the avatar is wrapped inside a link.
28
+ *
29
+ * @default false
30
+ */
31
+ focusable?: boolean;
32
+ /**
33
+ * The initials of the user to display if no image is available.
34
+ */
35
+ initials?: string;
36
+ /**
37
+ * A placeholder to display if no image is available.
38
+ */
39
+ placeholder?: ReactNode;
40
+ /**
41
+ * An icon to display if no image is available.
42
+ */
43
+ placeholderIcon?: FC<{
44
+ className?: string;
45
+ }>;
46
+ /**
47
+ * Whether the avatar should be rounded.
48
+ * @default true
49
+ */
50
+ rounded?: boolean;
51
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
52
+ src?: string | null;
53
+ /**
54
+ * Display a status indicator.
55
+ */
56
+ status?: "online" | "offline";
57
+ /**
58
+ * Display a verified tick icon.
59
+ *
60
+ * @default false
61
+ */
62
+ verified?: boolean;
63
+ }
64
+ export declare const Avatar: ({ size, src, alt, initials, placeholder, placeholderIcon: PlaceholderIcon, border, badge, status, verified, count, focusable, rounded, className, contentClassName, }: AvatarProps) => import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { ButtonProps as AriaButtonProps } from "react-aria-components";
2
+ interface AvatarAddButtonProps extends AriaButtonProps {
3
+ className?: string;
4
+ size: "xs" | "sm" | "md";
5
+ title?: string;
6
+ }
7
+ export declare const AvatarAddButton: ({ size, className, title, ...props }: AvatarAddButtonProps) => import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ interface AvatarCompanyIconProps {
2
+ alt?: string;
3
+ size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
4
+ src: string;
5
+ }
6
+ export declare const AvatarCompanyIcon: ({ size, src, alt, }: AvatarCompanyIconProps) => import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ interface AvatarCountProps {
2
+ className?: string;
3
+ count: number;
4
+ }
5
+ export declare const AvatarCount: ({ count, className }: AvatarCountProps) => import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ interface AvatarOnlineIndicatorProps {
2
+ className?: string;
3
+ size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
4
+ status: "online" | "offline";
5
+ }
6
+ export declare const AvatarOnlineIndicator: ({ size, status, className, }: AvatarOnlineIndicatorProps) => import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from "./avatar-add-button.js";
2
+ export * from "./avatar-company-icon.js";
3
+ export * from "./avatar-online-indicator.js";
4
+ export * from "./verified-tick.js";
@@ -0,0 +1,6 @@
1
+ interface VerifiedTickProps {
2
+ className?: string;
3
+ size: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
4
+ }
5
+ export declare const VerifiedTick: ({ size, className }: VerifiedTickProps) => import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,104 @@
1
+ import type { AnchorHTMLAttributes, ButtonHTMLAttributes, DetailedHTMLProps, FC, ReactNode } from "react";
2
+ import type { ButtonProps as AriaButtonProps, LinkProps as AriaLinkProps } from "react-aria-components";
3
+ export declare const styles: {
4
+ colors: {
5
+ "link-color": {
6
+ root: string;
7
+ };
8
+ "link-destructive": {
9
+ root: string;
10
+ };
11
+ "link-gray": {
12
+ root: string;
13
+ };
14
+ primary: {
15
+ root: string;
16
+ };
17
+ "primary-destructive": {
18
+ root: string;
19
+ };
20
+ secondary: {
21
+ root: string;
22
+ };
23
+ "secondary-destructive": {
24
+ root: string;
25
+ };
26
+ tertiary: {
27
+ root: string;
28
+ };
29
+ "tertiary-destructive": {
30
+ root: string;
31
+ };
32
+ };
33
+ common: {
34
+ icon: string;
35
+ root: string;
36
+ };
37
+ sizes: {
38
+ lg: {
39
+ linkRoot: string;
40
+ root: string;
41
+ };
42
+ md: {
43
+ linkRoot: string;
44
+ root: string;
45
+ };
46
+ sm: {
47
+ linkRoot: string;
48
+ root: string;
49
+ };
50
+ xl: {
51
+ linkRoot: string;
52
+ root: string;
53
+ };
54
+ xs: {
55
+ linkRoot: string;
56
+ root: string;
57
+ };
58
+ };
59
+ };
60
+ /**
61
+ * Common props shared between button and anchor variants
62
+ */
63
+ export interface CommonProps {
64
+ /** The color variant of the button */
65
+ color?: keyof typeof styles.colors;
66
+ /** Icon component or element to show before the text */
67
+ iconLeading?: FC<{
68
+ className?: string;
69
+ }> | ReactNode;
70
+ /** Icon component or element to show after the text */
71
+ iconTrailing?: FC<{
72
+ className?: string;
73
+ }> | ReactNode;
74
+ /** Disables the button and shows a disabled state */
75
+ isDisabled?: boolean;
76
+ /** Shows a loading spinner and disables the button */
77
+ isLoading?: boolean;
78
+ /** Removes horizontal padding from the text content */
79
+ noTextPadding?: boolean;
80
+ /** When true, keeps the text visible during loading state */
81
+ showTextWhileLoading?: boolean;
82
+ /** The size variant of the button */
83
+ size?: keyof typeof styles.sizes;
84
+ }
85
+ /**
86
+ * Props for the button variant (non-link)
87
+ */
88
+ export interface ButtonProps extends CommonProps, DetailedHTMLProps<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "color" | "slot">, HTMLButtonElement> {
89
+ /** Press handler for React Aria button */
90
+ onPress?: AriaButtonProps["onPress"];
91
+ /** Slot name for react-aria component */
92
+ slot?: AriaButtonProps["slot"];
93
+ }
94
+ /**
95
+ * Props for the link variant (anchor tag)
96
+ */
97
+ interface LinkProps extends CommonProps, DetailedHTMLProps<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "color">, HTMLAnchorElement> {
98
+ /** Options for the configured client side router. */
99
+ routerOptions?: AriaLinkProps["routerOptions"];
100
+ }
101
+ /** Union type of button and link props */
102
+ export type Props = ButtonProps | LinkProps;
103
+ export declare const Button: ({ size, color, children, className, noTextPadding, iconLeading: IconLeading, iconTrailing: IconTrailing, isDisabled: disabled, isLoading: loading, showTextWhileLoading, ...otherProps }: Props) => import("react").JSX.Element;
104
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { ReactNode, Ref } from "react";
2
+ import { type CheckboxProps as AriaCheckboxProps } from "react-aria-components";
3
+ export interface CheckboxBaseProps {
4
+ className?: string;
5
+ isDisabled?: boolean;
6
+ isFocusVisible?: boolean;
7
+ isIndeterminate?: boolean;
8
+ isSelected?: boolean;
9
+ size?: "sm" | "md";
10
+ }
11
+ export declare function CheckboxBase({ className, isSelected, isDisabled, isIndeterminate, size, isFocusVisible, }: CheckboxBaseProps): import("react").JSX.Element;
12
+ export declare namespace CheckboxBase {
13
+ var displayName: string;
14
+ }
15
+ interface CheckboxProps extends AriaCheckboxProps {
16
+ hint?: ReactNode;
17
+ label?: ReactNode;
18
+ ref?: Ref<HTMLLabelElement>;
19
+ size?: "sm" | "md";
20
+ tabIndex?: number;
21
+ }
22
+ export declare function Checkbox({ label, hint, size, className, ...ariaCheckboxProps }: CheckboxProps): import("react").JSX.Element;
23
+ export declare namespace Checkbox {
24
+ var displayName: string;
25
+ }
26
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { ReactNode, Ref } from "react";
2
+ import type { TextProps as AriaTextProps } from "react-aria-components";
3
+ interface HintTextProps extends AriaTextProps {
4
+ children: ReactNode;
5
+ /** Indicates that the hint text is an error message. */
6
+ isInvalid?: boolean;
7
+ ref?: Ref<HTMLElement>;
8
+ size?: "sm" | "md";
9
+ }
10
+ export declare function HintText({ isInvalid, className, size, ...props }: HintTextProps): import("react").JSX.Element;
11
+ export declare namespace HintText {
12
+ var displayName: string;
13
+ }
14
+ export {};
@@ -0,0 +1,41 @@
1
+ import { type ComponentType, type HTMLAttributes, type ReactNode, type Ref } from "react";
2
+ import type { DateInputProps as AriaDateInputProps } from "react-aria-components";
3
+ import { type DateFieldProps as AriaDateFieldProps, type DateValue } from "react-aria-components";
4
+ export interface InputDateBaseProps extends Omit<AriaDateInputProps, "children"> {
5
+ groupRef?: Ref<HTMLDivElement>;
6
+ /** Icon component to display on the left side of the input. */
7
+ icon?: ComponentType<HTMLAttributes<HTMLOrSVGElement>>;
8
+ /** Class name for the icon. */
9
+ iconClassName?: string;
10
+ isDisabled?: boolean;
11
+ isInvalid?: boolean;
12
+ /** Placeholder text. */
13
+ placeholder?: string;
14
+ ref?: Ref<HTMLInputElement>;
15
+ /** Keyboard shortcut to display. */
16
+ shortcut?: string | boolean;
17
+ /**
18
+ * Input size.
19
+ * @default "sm"
20
+ */
21
+ size?: "sm" | "md" | "lg";
22
+ /** Tooltip message on hover. */
23
+ tooltip?: string;
24
+ /** Class name for the tooltip. */
25
+ tooltipClassName?: string;
26
+ /** Class name for the input wrapper. */
27
+ wrapperClassName?: string;
28
+ }
29
+ export declare const InputDateBase: ({ tooltip, shortcut, groupRef, size, isInvalid, isDisabled, icon: Icon, wrapperClassName, tooltipClassName, iconClassName, ...inputProps }: Omit<InputDateBaseProps, "label" | "hint">) => import("react").JSX.Element;
30
+ interface InputProps extends AriaDateFieldProps<DateValue>, Pick<InputDateBaseProps, "ref" | "size" | "placeholder" | "icon" | "shortcut" | "tooltip" | "groupRef" | "iconClassName" | "wrapperClassName" | "tooltipClassName"> {
31
+ /** Whether to hide required indicator from label */
32
+ hideRequiredIndicator?: boolean;
33
+ /** Helper text displayed below the input */
34
+ hint?: ReactNode;
35
+ /** Class name for the input. */
36
+ inputClassName?: string;
37
+ /** Label text for the input */
38
+ label?: string;
39
+ }
40
+ export declare const InputDate: ({ size, placeholder, icon: Icon, label, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, ...props }: InputProps) => import("react").JSX.Element;
41
+ export {};
@@ -0,0 +1,63 @@
1
+ import { type ComponentType, type HTMLAttributes, type ReactNode, type Ref } from "react";
2
+ import type { InputProps as AriaInputProps, TextFieldProps as AriaTextFieldProps } from "react-aria-components";
3
+ export interface InputBaseProps extends Omit<AriaInputProps, "size"> {
4
+ groupRef?: Ref<HTMLDivElement>;
5
+ /** Icon component to display on the left side of the input. */
6
+ icon?: ComponentType<HTMLAttributes<HTMLOrSVGElement>>;
7
+ /** Class name for the icon. */
8
+ iconClassName?: string;
9
+ /** Class name for the input. */
10
+ inputClassName?: string;
11
+ /** Whether the input is disabled. */
12
+ isDisabled?: boolean;
13
+ /** Whether the input is invalid. */
14
+ isInvalid?: boolean;
15
+ /** Whether the input is required. */
16
+ isRequired?: boolean;
17
+ /** Placeholder text. */
18
+ placeholder?: string;
19
+ ref?: Ref<HTMLInputElement>;
20
+ /** Keyboard shortcut to display. */
21
+ shortcut?: string | boolean;
22
+ /**
23
+ * Input size.
24
+ * @default "sm"
25
+ */
26
+ size?: "sm" | "md" | "lg";
27
+ /** Tooltip message on hover. */
28
+ tooltip?: string;
29
+ /** Class name for the tooltip. */
30
+ tooltipClassName?: string;
31
+ /** Class name for the input wrapper. */
32
+ wrapperClassName?: string;
33
+ }
34
+ export declare function InputBase({ ref, tooltip, shortcut, groupRef, size, isInvalid, isDisabled, isRequired, icon: Icon, placeholder, wrapperClassName, tooltipClassName, inputClassName, iconClassName, type, ...inputProps }: InputBaseProps): import("react").JSX.Element;
35
+ export declare namespace InputBase {
36
+ var displayName: string;
37
+ }
38
+ interface TextFieldContextProps extends Partial<Pick<InputBaseProps, "size" | "wrapperClassName" | "inputClassName" | "iconClassName" | "tooltipClassName">> {
39
+ }
40
+ export interface TextFieldProps extends Omit<AriaTextFieldProps, "autoComplete" | "spellCheck">, TextFieldContextProps {
41
+ autoComplete?: string;
42
+ spellCheck?: boolean | "true" | "false" | string;
43
+ }
44
+ export declare function TextField({ className, size, inputClassName, wrapperClassName, iconClassName, tooltipClassName, spellCheck, ...props }: TextFieldProps): import("react").JSX.Element;
45
+ export declare namespace TextField {
46
+ var displayName: string;
47
+ }
48
+ export interface InputProps extends Omit<AriaTextFieldProps, "autoComplete" | "spellCheck" | "onInput" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "onPaste">, Pick<InputBaseProps, "ref" | "placeholder" | "icon" | "shortcut" | "tooltip" | "groupRef" | "size" | "wrapperClassName" | "inputClassName" | "iconClassName" | "tooltipClassName" | "autoComplete" | "autoFocus" | "inputMode" | "pattern" | "spellCheck" | "autoCapitalize" | "autoCorrect" | "onInput" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "onPaste" | "name" | "id" | "tabIndex" | "form"> {
49
+ /** Whether to hide required indicator from label */
50
+ hideRequiredIndicator?: boolean;
51
+ /** Helper text displayed below the input */
52
+ hint?: ReactNode;
53
+ /** Label text for the input */
54
+ label?: string;
55
+ max?: string | number;
56
+ min?: string | number;
57
+ step?: string | number;
58
+ }
59
+ export declare function Input({ size, placeholder, icon: Icon, label, hint, shortcut, hideRequiredIndicator, className, ref, groupRef, tooltip, iconClassName, inputClassName, wrapperClassName, tooltipClassName, type, min, max, step, name, autoComplete, autoFocus, inputMode, pattern, spellCheck, autoCapitalize, autoCorrect, onInput, onFocus, onBlur, onKeyDown, onKeyUp, onPaste, id, tabIndex, form, ...props }: InputProps): import("react").JSX.Element;
60
+ export declare namespace Input {
61
+ var displayName: string;
62
+ }
63
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { ReactNode, Ref } from "react";
2
+ import type { LabelProps as AriaLabelProps } from "react-aria-components";
3
+ interface LabelProps extends AriaLabelProps {
4
+ children: ReactNode;
5
+ isInvalid?: boolean;
6
+ isRequired?: boolean;
7
+ ref?: Ref<HTMLLabelElement>;
8
+ tooltip?: string;
9
+ tooltipDescription?: string;
10
+ }
11
+ export declare function Label({ isInvalid, isRequired, tooltip, tooltipDescription, className, ...props }: LabelProps): import("react").JSX.Element;
12
+ export declare namespace Label {
13
+ var displayName: string;
14
+ }
15
+ export {};
@@ -0,0 +1,55 @@
1
+ import { OTPInput } from "input-otp";
2
+ import type { ComponentPropsWithRef } from "react";
3
+ import { HintText } from "./hint-text.js";
4
+ import { Label as LabelBase } from "./label.js";
5
+ type PinInputSize = "xxxs" | "xxs" | "xs" | "sm" | "md" | "lg";
6
+ interface PinInputContextType {
7
+ disabled: boolean;
8
+ id: string;
9
+ invalid: boolean;
10
+ size: PinInputSize;
11
+ }
12
+ export declare const usePinInputContext: () => PinInputContextType;
13
+ interface RootProps extends ComponentPropsWithRef<"div"> {
14
+ disabled?: boolean;
15
+ invalid?: boolean;
16
+ size?: PinInputSize;
17
+ }
18
+ declare const Root: {
19
+ ({ className, size, disabled, invalid, ...props }: RootProps): import("react").JSX.Element;
20
+ displayName: string;
21
+ };
22
+ type GroupProps = ComponentPropsWithRef<typeof OTPInput> & {
23
+ width?: number;
24
+ inputClassName?: string;
25
+ };
26
+ declare const Group: {
27
+ ({ inputClassName, containerClassName, width, maxLength, ...props }: GroupProps): import("react").JSX.Element;
28
+ displayName: string;
29
+ };
30
+ declare const Slot: {
31
+ ({ index, className, ...props }: ComponentPropsWithRef<"div"> & {
32
+ index: number;
33
+ }): import("react").JSX.Element;
34
+ displayName: string;
35
+ };
36
+ declare const Separator: {
37
+ (props: ComponentPropsWithRef<"div">): import("react").JSX.Element;
38
+ displayName: string;
39
+ };
40
+ declare const Label: {
41
+ (props: ComponentPropsWithRef<typeof LabelBase>): import("react").JSX.Element;
42
+ displayName: string;
43
+ };
44
+ declare const Description: {
45
+ (props: ComponentPropsWithRef<typeof HintText>): import("react").JSX.Element;
46
+ displayName: string;
47
+ };
48
+ declare const PinInput: typeof Root & {
49
+ Slot: typeof Slot;
50
+ Label: typeof Label;
51
+ Group: typeof Group;
52
+ Separator: typeof Separator;
53
+ Description: typeof Description;
54
+ };
55
+ export { PinInput };
@@ -0,0 +1,14 @@
1
+ import type { FC, ReactNode, RefAttributes } from "react";
2
+ import type { ComboBoxProps as AriaComboBoxProps, ListBoxProps as AriaListBoxProps } from "react-aria-components";
3
+ import { type CommonProps, type SelectItemType } from "./select-shared.js";
4
+ interface ComboBoxProps extends Omit<AriaComboBoxProps<SelectItemType>, "children" | "items">, RefAttributes<HTMLDivElement>, CommonProps {
5
+ children: AriaListBoxProps<SelectItemType>["children"];
6
+ /** Leading icon component displayed before the input. */
7
+ icon?: FC | ReactNode;
8
+ items?: SelectItemType[];
9
+ popoverClassName?: string;
10
+ shortcut?: boolean;
11
+ shortcutClassName?: string;
12
+ }
13
+ export declare const ComboBox: ({ placeholder, shortcut, size, children, items, shortcutClassName, icon, hideRequiredIndicator, menuTrigger, ...otherProps }: ComboBoxProps) => import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { RefAttributes } from "react";
2
+ import type { PopoverProps as AriaPopoverProps } from "react-aria-components";
3
+ interface PopoverProps extends AriaPopoverProps, RefAttributes<HTMLElement> {
4
+ size: "sm" | "md" | "lg";
5
+ }
6
+ export declare const Popover: (props: PopoverProps) => import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ListBoxItemProps as AriaListBoxItemProps } from "react-aria-components";
2
+ import type { SelectItemType } from "./select-shared.js";
3
+ interface SelectItemProps extends Omit<AriaListBoxItemProps<SelectItemType>, "id">, SelectItemType {
4
+ /** The selection indicator to be displayed on the item. */
5
+ selectionIndicator?: "checkmark" | "checkbox" | "none";
6
+ /** The alignment of the selection indicator. */
7
+ selectionIndicatorAlign?: "left" | "right";
8
+ }
9
+ export declare const SelectItem: ({ label, id, value, avatarUrl, supportingText, isDisabled, icon: Icon, className, children, selectionIndicator, selectionIndicatorAlign, ...props }: SelectItemProps) => import("react").JSX.Element;
10
+ export {};
@@ -0,0 +1,58 @@
1
+ import type { FC, ReactNode } from "react";
2
+ export interface SelectItemType {
3
+ /** Avatar image URL. */
4
+ avatarUrl?: string;
5
+ /** Leading icon component or element. */
6
+ icon?: FC | ReactNode;
7
+ /** Unique identifier for the item. */
8
+ id: string | number;
9
+ /** Whether the item is disabled. */
10
+ isDisabled?: boolean;
11
+ /** The primary display text. */
12
+ label?: string;
13
+ /** Secondary text displayed alongside the label. */
14
+ supportingText?: string;
15
+ }
16
+ export interface CommonProps {
17
+ /** Whether to hide the required indicator from the label. */
18
+ hideRequiredIndicator?: boolean;
19
+ /** Helper text displayed below the input. */
20
+ hint?: string;
21
+ /** Field label displayed above the input. */
22
+ label?: string;
23
+ /** Placeholder text when no value is selected. */
24
+ placeholder?: string;
25
+ /**
26
+ * The size of the component.
27
+ * @default "md"
28
+ */
29
+ size?: "sm" | "md" | "lg";
30
+ /** Tooltip text for the help icon next to the label. */
31
+ tooltip?: string;
32
+ }
33
+ export declare const sizes: {
34
+ lg: {
35
+ root: string;
36
+ shortcut: string;
37
+ text: string;
38
+ textContainer: string;
39
+ withIcon: string;
40
+ };
41
+ md: {
42
+ root: string;
43
+ shortcut: string;
44
+ text: string;
45
+ textContainer: string;
46
+ withIcon: string;
47
+ };
48
+ sm: {
49
+ root: string;
50
+ shortcut: string;
51
+ text: string;
52
+ textContainer: string;
53
+ withIcon: string;
54
+ };
55
+ };
56
+ export declare const SelectContext: import("react").Context<{
57
+ size: "sm" | "md" | "lg";
58
+ }>;