@scripso-homepad/ui 0.4.1 → 0.4.3
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/{chunk-C7GHBVMM.js → chunk-66WR57JJ.js} +53 -10
- package/dist/chunk-66WR57JJ.js.map +1 -0
- package/dist/index.cjs +2297 -391
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +144 -2
- package/dist/index.d.ts +144 -2
- package/dist/index.js +1978 -96
- package/dist/index.js.map +1 -1
- package/dist/web/index.cjs +30411 -759
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.css +78 -0
- package/dist/web/index.css.map +1 -0
- package/dist/web/index.d.cts +267 -6
- package/dist/web/index.d.ts +267 -6
- package/dist/web/index.js +30179 -601
- package/dist/web/index.js.map +1 -1
- package/package.json +5 -4
- package/src/components/Calendar.stories.tsx +337 -0
- package/src/components/Calendar.tsx +441 -0
- package/src/components/DatePicker.stories.tsx +219 -0
- package/src/components/DatePicker.tsx +366 -0
- package/src/components/Input.tsx +5 -1
- package/src/components/Select.stories.tsx +134 -0
- package/src/components/Select.tsx +462 -0
- package/src/css.d.ts +1 -0
- package/src/icons/CalendarIcon.tsx +28 -0
- package/src/icons/CalendarIcon.web.tsx +34 -0
- package/src/icons/ChevronDownIcon.tsx +11 -4
- package/src/icons/ChevronDownIcon.web.tsx +6 -4
- package/src/icons/ChevronNavIcons.tsx +44 -0
- package/src/icons/ChevronNavIcons.web.tsx +57 -0
- package/src/icons/LockIcon.tsx +30 -0
- package/src/icons/LockIcon.web.tsx +35 -0
- package/src/icons/calendarIconPaths.ts +2 -0
- package/src/icons/chevronDownPath.ts +1 -0
- package/src/icons/chevronNavPaths.ts +2 -0
- package/src/icons/lockIconPaths.ts +2 -0
- package/src/index.ts +43 -0
- package/src/theme/calendar.ts +357 -0
- package/src/theme/input.ts +16 -6
- package/src/theme/select.ts +249 -0
- package/src/utils/calendarDays.ts +273 -0
- package/src/utils/calendarLocaleContext.tsx +95 -0
- package/src/utils/calendarLocalization.ts +187 -0
- package/src/utils/countryDropdownScrollStyles.ts +53 -13
- package/src/utils/formatMultiSelectDisplay.ts +56 -0
- package/src/web/components/Badge.stories.tsx +43 -0
- package/src/web/components/Badge.tsx +35 -0
- package/src/web/components/Pagination.stories.tsx +78 -0
- package/src/web/components/Pagination.tsx +153 -0
- package/src/web/components/StatusBadge.tsx +20 -0
- package/src/web/components/Table.stories.tsx +415 -0
- package/src/web/components/Table.tsx +3 -0
- package/src/web/components/TableActionButton.tsx +67 -0
- package/src/web/components/TableActionsMenu.tsx +208 -0
- package/src/web/components/TableIconText.tsx +23 -0
- package/src/web/components/TableRowStatusActions.tsx +33 -0
- package/src/web/components/TableStatusActionsCell.tsx +29 -0
- package/src/web/components/pagination-utils.ts +39 -0
- package/src/web/components/table/DataTable.tsx +123 -0
- package/src/web/components/table/TablePrimitives.tsx +214 -0
- package/src/web/components/table/TableScrollArea.tsx +51 -0
- package/src/web/components/table/constants.ts +59 -0
- package/src/web/components/table/data-table-class-names.ts +26 -0
- package/src/web/components/table/index.ts +44 -0
- package/src/web/components/table/table-row-context.tsx +19 -0
- package/src/web/components/table/use-horizontal-scroll-state.ts +72 -0
- package/src/web/components/table-scroll.css +81 -0
- package/src/web/hooks/useOnClickOutside.ts +20 -5
- package/src/web/icons/TableMenuActivateIcon.tsx +27 -0
- package/src/web/icons/TableMenuCheckIcon.tsx +27 -0
- package/src/web/icons/TableMenuCloseIcon.tsx +27 -0
- package/src/web/icons/TableMenuEditIcon.tsx +27 -0
- package/src/web/icons/TableMenuInfoIcon.tsx +27 -0
- package/src/web/icons/TableMenuRefreshIcon.tsx +27 -0
- package/src/web/icons/TableMenuSuspendIcon.tsx +34 -0
- package/src/web/icons/TableMenuTrashIcon.tsx +27 -0
- package/src/web/icons/TableMoreIcon.tsx +41 -0
- package/src/web/icons/TableSortIcon.tsx +37 -0
- package/src/web/index.ts +74 -0
- package/src/web/layout/AppHeader.stories.tsx +2 -0
- package/src/web/layout/AppHeader.tsx +18 -14
- package/src/web/layout/DashboardLayout.stories.tsx +1 -0
- package/src/web/layout/DashboardLayout.tsx +8 -4
- package/src/web/layout/story-helpers.tsx +10 -2
- package/dist/chunk-C7GHBVMM.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -28,6 +28,8 @@ interface InputProps extends TextInputProps {
|
|
|
28
28
|
rightIcon?: ReactNode;
|
|
29
29
|
/** Validation or helper error message. Shown instead of `hint` when set. */
|
|
30
30
|
error?: string;
|
|
31
|
+
/** Applies error field styling without showing a message (use with a form-level error). */
|
|
32
|
+
invalid?: boolean;
|
|
31
33
|
/** Helper text shown below the input when there is no error. */
|
|
32
34
|
hint?: string;
|
|
33
35
|
containerStyle?: StyleProp<ViewStyle>;
|
|
@@ -44,7 +46,42 @@ interface InputProps extends TextInputProps {
|
|
|
44
46
|
/** When `secureTextEntry` is set, show a toggleable eye icon. Pass `false` to disable. */
|
|
45
47
|
showPasswordToggle?: boolean;
|
|
46
48
|
}
|
|
47
|
-
declare function Input({ label, leftIcon, rightIcon, error, hint, containerStyle, style, className, fieldClassName, fieldStyle, labelClassName, inputClassName, errorClassName, hintClassName, editable, secureTextEntry, showPasswordToggle, onFocus, onBlur, ...props }: InputProps): react.JSX.Element;
|
|
49
|
+
declare function Input({ label, leftIcon, rightIcon, error, invalid, hint, containerStyle, style, className, fieldClassName, fieldStyle, labelClassName, inputClassName, errorClassName, hintClassName, editable, secureTextEntry, showPasswordToggle, onFocus, onBlur, ...props }: InputProps): react.JSX.Element;
|
|
50
|
+
|
|
51
|
+
type SelectOption = {
|
|
52
|
+
value: string;
|
|
53
|
+
label: string;
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
};
|
|
56
|
+
interface SelectBaseProps {
|
|
57
|
+
label?: string;
|
|
58
|
+
placeholder?: string;
|
|
59
|
+
options: SelectOption[];
|
|
60
|
+
leftIcon?: ReactNode;
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
error?: string;
|
|
63
|
+
invalid?: boolean;
|
|
64
|
+
hint?: string;
|
|
65
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
66
|
+
className?: string;
|
|
67
|
+
fieldClassName?: string;
|
|
68
|
+
menuClassName?: string;
|
|
69
|
+
labelClassName?: string;
|
|
70
|
+
errorClassName?: string;
|
|
71
|
+
hintClassName?: string;
|
|
72
|
+
}
|
|
73
|
+
interface SingleSelectProps extends SelectBaseProps {
|
|
74
|
+
multiple?: false;
|
|
75
|
+
value?: string;
|
|
76
|
+
onValueChange?: (value: string) => void;
|
|
77
|
+
}
|
|
78
|
+
interface MultipleSelectProps extends SelectBaseProps {
|
|
79
|
+
multiple: true;
|
|
80
|
+
value?: string[];
|
|
81
|
+
onValueChange?: (value: string[]) => void;
|
|
82
|
+
}
|
|
83
|
+
type SelectProps = SingleSelectProps | MultipleSelectProps;
|
|
84
|
+
declare function Select({ label, placeholder, value, onValueChange, options, leftIcon, multiple, disabled, error, invalid, hint, containerStyle, className, fieldClassName, menuClassName, labelClassName, errorClassName, hintClassName, }: SelectProps): react.JSX.Element;
|
|
48
85
|
|
|
49
86
|
interface PhoneInputProps extends Omit<TextInputProps, "style"> {
|
|
50
87
|
label?: string;
|
|
@@ -82,6 +119,103 @@ interface CountryCodeSelectorProps {
|
|
|
82
119
|
}
|
|
83
120
|
declare function CountryCodeSelector({ value, onValueChange, options, disabled, style, className, }: CountryCodeSelectorProps): react.JSX.Element;
|
|
84
121
|
|
|
122
|
+
type DateRange = {
|
|
123
|
+
start: Date;
|
|
124
|
+
end?: Date;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
type CalendarLocale = "hy-AM" | "en-US" | "ru-RU";
|
|
128
|
+
type CalendarTranslationKey$1 = "datePlaceholder" | "rangePlaceholder" | "previousMonth" | "nextMonth" | "previousYear" | "nextYear" | "previousYears" | "nextYears" | "selectMonth" | "selectYear" | "closeCalendar";
|
|
129
|
+
type CalendarTranslations = Record<CalendarTranslationKey$1, string> & {
|
|
130
|
+
/** Weekday labels in Monday-first order. */
|
|
131
|
+
weekdays: string[];
|
|
132
|
+
/** Short month labels used in compact calendar headers and month picker cells. */
|
|
133
|
+
monthsShort: string[];
|
|
134
|
+
/** Full month labels available for consumers that need long-form display. */
|
|
135
|
+
monthsLong: string[];
|
|
136
|
+
};
|
|
137
|
+
declare const calendarTranslations: Record<CalendarLocale, CalendarTranslations>;
|
|
138
|
+
declare function resolveCalendarLocale(locale: string): CalendarLocale;
|
|
139
|
+
declare function getCalendarTranslations(locale: string): CalendarTranslations;
|
|
140
|
+
declare function resolveWeekdayLabels(locale: string): string[];
|
|
141
|
+
declare function getCalendarMonthLabels(locale: string, width?: "short" | "long"): string[];
|
|
142
|
+
declare function formatLocalizedCalendarMonthYear(date: Date, locale: string): string;
|
|
143
|
+
|
|
144
|
+
type CalendarLabels = Partial<Pick<CalendarTranslations, CalendarTranslationKey>> & {
|
|
145
|
+
weekdays?: string[];
|
|
146
|
+
formatMonthYear?: (date: Date) => string;
|
|
147
|
+
};
|
|
148
|
+
type CalendarTranslationKey = "previousMonth" | "nextMonth" | "previousYear" | "nextYear" | "previousYears" | "nextYears" | "selectMonth" | "selectYear" | "closeCalendar";
|
|
149
|
+
type CalendarBaseProps = {
|
|
150
|
+
viewDate?: Date;
|
|
151
|
+
defaultViewDate?: Date;
|
|
152
|
+
onViewDateChange?: (date: Date) => void;
|
|
153
|
+
locale?: string;
|
|
154
|
+
labels?: CalendarLabels;
|
|
155
|
+
minDate?: Date;
|
|
156
|
+
maxDate?: Date;
|
|
157
|
+
today?: Date;
|
|
158
|
+
style?: StyleProp<ViewStyle>;
|
|
159
|
+
className?: string;
|
|
160
|
+
};
|
|
161
|
+
type CalendarSingleProps = CalendarBaseProps & {
|
|
162
|
+
mode?: "single";
|
|
163
|
+
value?: Date;
|
|
164
|
+
onChange?: (date: Date) => void;
|
|
165
|
+
};
|
|
166
|
+
type CalendarRangeProps = CalendarBaseProps & {
|
|
167
|
+
mode: "range";
|
|
168
|
+
value?: DateRange;
|
|
169
|
+
onChange?: (range: DateRange) => void;
|
|
170
|
+
};
|
|
171
|
+
type CalendarProps = CalendarSingleProps | CalendarRangeProps;
|
|
172
|
+
declare function Calendar(props: CalendarProps): react.JSX.Element;
|
|
173
|
+
|
|
174
|
+
type CalendarLocaleProviderProps = {
|
|
175
|
+
locale: string;
|
|
176
|
+
children: ReactNode;
|
|
177
|
+
};
|
|
178
|
+
declare function CalendarLocaleProvider({ locale, children }: CalendarLocaleProviderProps): react.JSX.Element;
|
|
179
|
+
declare function useCalendarLocale(locale?: string): CalendarLocale;
|
|
180
|
+
|
|
181
|
+
type DatePickerFieldProps = {
|
|
182
|
+
label?: string;
|
|
183
|
+
placeholder?: string;
|
|
184
|
+
disabled?: boolean;
|
|
185
|
+
error?: string;
|
|
186
|
+
invalid?: boolean;
|
|
187
|
+
hint?: string;
|
|
188
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
189
|
+
className?: string;
|
|
190
|
+
fieldClassName?: string;
|
|
191
|
+
panelClassName?: string;
|
|
192
|
+
labelClassName?: string;
|
|
193
|
+
errorClassName?: string;
|
|
194
|
+
hintClassName?: string;
|
|
195
|
+
/** Opens the calendar popup on mount (useful for Storybook previews). */
|
|
196
|
+
defaultOpen?: boolean;
|
|
197
|
+
/** Closes the popup after a complete range is selected. Defaults to true in range mode. */
|
|
198
|
+
closeOnRangeComplete?: boolean;
|
|
199
|
+
};
|
|
200
|
+
type DatePickerSingleProps = Omit<CalendarSingleProps, "style" | "className"> & DatePickerFieldProps & {
|
|
201
|
+
mode?: "single";
|
|
202
|
+
formatDate?: (date: Date) => string;
|
|
203
|
+
};
|
|
204
|
+
type DatePickerRangeProps = Omit<CalendarRangeProps, "style" | "className"> & DatePickerFieldProps & {
|
|
205
|
+
mode: "range";
|
|
206
|
+
formatRange?: (range: DateRange) => string;
|
|
207
|
+
rangeSeparator?: string;
|
|
208
|
+
};
|
|
209
|
+
type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps;
|
|
210
|
+
declare function DatePicker(props: DatePickerProps): react.JSX.Element;
|
|
211
|
+
|
|
212
|
+
interface CalendarIconProps {
|
|
213
|
+
size?: number;
|
|
214
|
+
color?: string;
|
|
215
|
+
strokeWidth?: number;
|
|
216
|
+
}
|
|
217
|
+
declare function CalendarIcon({ size, color, strokeWidth, }: CalendarIconProps): react.JSX.Element;
|
|
218
|
+
|
|
85
219
|
interface LabelProps extends TextProps {
|
|
86
220
|
children: ReactNode;
|
|
87
221
|
/** Render as a required field indicator. */
|
|
@@ -92,6 +226,14 @@ interface LabelProps extends TextProps {
|
|
|
92
226
|
}
|
|
93
227
|
declare function Label({ children, required, disabled, style, className, ...props }: LabelProps): react.JSX.Element;
|
|
94
228
|
|
|
229
|
+
interface LockIconProps {
|
|
230
|
+
size?: number;
|
|
231
|
+
color?: string;
|
|
232
|
+
strokeWidth?: number;
|
|
233
|
+
}
|
|
234
|
+
/** Native — react-native-svg (peer dependency). */
|
|
235
|
+
declare function LockIcon({ size, color, strokeWidth, }: LockIconProps): react.JSX.Element;
|
|
236
|
+
|
|
95
237
|
/**
|
|
96
238
|
* HomePad design tokens — aligned with the Figma design system
|
|
97
239
|
* (navy / storm gray / slate-blue palette from HomePad brand).
|
|
@@ -338,4 +480,4 @@ declare const shadows: {
|
|
|
338
480
|
};
|
|
339
481
|
};
|
|
340
482
|
|
|
341
|
-
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, type Country, CountryCodeSelector, type CountryCodeSelectorProps, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, type StormGrayStep, brand, buttonTypography, colors, countries, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, labelTypography, navy, radii, rubyRed, shadows, spacing, stormGray };
|
|
483
|
+
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, CalendarIcon, type CalendarLabels, type CalendarLocale, CalendarLocaleProvider, type CalendarLocaleProviderProps, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps, type CalendarTranslationKey$1 as CalendarTranslationKey, type CalendarTranslations, type Country, CountryCodeSelector, type CountryCodeSelectorProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, LockIcon, type MultipleSelectProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, Select, type SelectOption, type SelectProps, type SingleSelectProps, type StormGrayStep, brand, buttonTypography, calendarTranslations, colors, countries, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, labelTypography, navy, radii, resolveCalendarLocale, resolveWeekdayLabels, rubyRed, shadows, spacing, stormGray, useCalendarLocale };
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ interface InputProps extends TextInputProps {
|
|
|
28
28
|
rightIcon?: ReactNode;
|
|
29
29
|
/** Validation or helper error message. Shown instead of `hint` when set. */
|
|
30
30
|
error?: string;
|
|
31
|
+
/** Applies error field styling without showing a message (use with a form-level error). */
|
|
32
|
+
invalid?: boolean;
|
|
31
33
|
/** Helper text shown below the input when there is no error. */
|
|
32
34
|
hint?: string;
|
|
33
35
|
containerStyle?: StyleProp<ViewStyle>;
|
|
@@ -44,7 +46,42 @@ interface InputProps extends TextInputProps {
|
|
|
44
46
|
/** When `secureTextEntry` is set, show a toggleable eye icon. Pass `false` to disable. */
|
|
45
47
|
showPasswordToggle?: boolean;
|
|
46
48
|
}
|
|
47
|
-
declare function Input({ label, leftIcon, rightIcon, error, hint, containerStyle, style, className, fieldClassName, fieldStyle, labelClassName, inputClassName, errorClassName, hintClassName, editable, secureTextEntry, showPasswordToggle, onFocus, onBlur, ...props }: InputProps): react.JSX.Element;
|
|
49
|
+
declare function Input({ label, leftIcon, rightIcon, error, invalid, hint, containerStyle, style, className, fieldClassName, fieldStyle, labelClassName, inputClassName, errorClassName, hintClassName, editable, secureTextEntry, showPasswordToggle, onFocus, onBlur, ...props }: InputProps): react.JSX.Element;
|
|
50
|
+
|
|
51
|
+
type SelectOption = {
|
|
52
|
+
value: string;
|
|
53
|
+
label: string;
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
};
|
|
56
|
+
interface SelectBaseProps {
|
|
57
|
+
label?: string;
|
|
58
|
+
placeholder?: string;
|
|
59
|
+
options: SelectOption[];
|
|
60
|
+
leftIcon?: ReactNode;
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
error?: string;
|
|
63
|
+
invalid?: boolean;
|
|
64
|
+
hint?: string;
|
|
65
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
66
|
+
className?: string;
|
|
67
|
+
fieldClassName?: string;
|
|
68
|
+
menuClassName?: string;
|
|
69
|
+
labelClassName?: string;
|
|
70
|
+
errorClassName?: string;
|
|
71
|
+
hintClassName?: string;
|
|
72
|
+
}
|
|
73
|
+
interface SingleSelectProps extends SelectBaseProps {
|
|
74
|
+
multiple?: false;
|
|
75
|
+
value?: string;
|
|
76
|
+
onValueChange?: (value: string) => void;
|
|
77
|
+
}
|
|
78
|
+
interface MultipleSelectProps extends SelectBaseProps {
|
|
79
|
+
multiple: true;
|
|
80
|
+
value?: string[];
|
|
81
|
+
onValueChange?: (value: string[]) => void;
|
|
82
|
+
}
|
|
83
|
+
type SelectProps = SingleSelectProps | MultipleSelectProps;
|
|
84
|
+
declare function Select({ label, placeholder, value, onValueChange, options, leftIcon, multiple, disabled, error, invalid, hint, containerStyle, className, fieldClassName, menuClassName, labelClassName, errorClassName, hintClassName, }: SelectProps): react.JSX.Element;
|
|
48
85
|
|
|
49
86
|
interface PhoneInputProps extends Omit<TextInputProps, "style"> {
|
|
50
87
|
label?: string;
|
|
@@ -82,6 +119,103 @@ interface CountryCodeSelectorProps {
|
|
|
82
119
|
}
|
|
83
120
|
declare function CountryCodeSelector({ value, onValueChange, options, disabled, style, className, }: CountryCodeSelectorProps): react.JSX.Element;
|
|
84
121
|
|
|
122
|
+
type DateRange = {
|
|
123
|
+
start: Date;
|
|
124
|
+
end?: Date;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
type CalendarLocale = "hy-AM" | "en-US" | "ru-RU";
|
|
128
|
+
type CalendarTranslationKey$1 = "datePlaceholder" | "rangePlaceholder" | "previousMonth" | "nextMonth" | "previousYear" | "nextYear" | "previousYears" | "nextYears" | "selectMonth" | "selectYear" | "closeCalendar";
|
|
129
|
+
type CalendarTranslations = Record<CalendarTranslationKey$1, string> & {
|
|
130
|
+
/** Weekday labels in Monday-first order. */
|
|
131
|
+
weekdays: string[];
|
|
132
|
+
/** Short month labels used in compact calendar headers and month picker cells. */
|
|
133
|
+
monthsShort: string[];
|
|
134
|
+
/** Full month labels available for consumers that need long-form display. */
|
|
135
|
+
monthsLong: string[];
|
|
136
|
+
};
|
|
137
|
+
declare const calendarTranslations: Record<CalendarLocale, CalendarTranslations>;
|
|
138
|
+
declare function resolveCalendarLocale(locale: string): CalendarLocale;
|
|
139
|
+
declare function getCalendarTranslations(locale: string): CalendarTranslations;
|
|
140
|
+
declare function resolveWeekdayLabels(locale: string): string[];
|
|
141
|
+
declare function getCalendarMonthLabels(locale: string, width?: "short" | "long"): string[];
|
|
142
|
+
declare function formatLocalizedCalendarMonthYear(date: Date, locale: string): string;
|
|
143
|
+
|
|
144
|
+
type CalendarLabels = Partial<Pick<CalendarTranslations, CalendarTranslationKey>> & {
|
|
145
|
+
weekdays?: string[];
|
|
146
|
+
formatMonthYear?: (date: Date) => string;
|
|
147
|
+
};
|
|
148
|
+
type CalendarTranslationKey = "previousMonth" | "nextMonth" | "previousYear" | "nextYear" | "previousYears" | "nextYears" | "selectMonth" | "selectYear" | "closeCalendar";
|
|
149
|
+
type CalendarBaseProps = {
|
|
150
|
+
viewDate?: Date;
|
|
151
|
+
defaultViewDate?: Date;
|
|
152
|
+
onViewDateChange?: (date: Date) => void;
|
|
153
|
+
locale?: string;
|
|
154
|
+
labels?: CalendarLabels;
|
|
155
|
+
minDate?: Date;
|
|
156
|
+
maxDate?: Date;
|
|
157
|
+
today?: Date;
|
|
158
|
+
style?: StyleProp<ViewStyle>;
|
|
159
|
+
className?: string;
|
|
160
|
+
};
|
|
161
|
+
type CalendarSingleProps = CalendarBaseProps & {
|
|
162
|
+
mode?: "single";
|
|
163
|
+
value?: Date;
|
|
164
|
+
onChange?: (date: Date) => void;
|
|
165
|
+
};
|
|
166
|
+
type CalendarRangeProps = CalendarBaseProps & {
|
|
167
|
+
mode: "range";
|
|
168
|
+
value?: DateRange;
|
|
169
|
+
onChange?: (range: DateRange) => void;
|
|
170
|
+
};
|
|
171
|
+
type CalendarProps = CalendarSingleProps | CalendarRangeProps;
|
|
172
|
+
declare function Calendar(props: CalendarProps): react.JSX.Element;
|
|
173
|
+
|
|
174
|
+
type CalendarLocaleProviderProps = {
|
|
175
|
+
locale: string;
|
|
176
|
+
children: ReactNode;
|
|
177
|
+
};
|
|
178
|
+
declare function CalendarLocaleProvider({ locale, children }: CalendarLocaleProviderProps): react.JSX.Element;
|
|
179
|
+
declare function useCalendarLocale(locale?: string): CalendarLocale;
|
|
180
|
+
|
|
181
|
+
type DatePickerFieldProps = {
|
|
182
|
+
label?: string;
|
|
183
|
+
placeholder?: string;
|
|
184
|
+
disabled?: boolean;
|
|
185
|
+
error?: string;
|
|
186
|
+
invalid?: boolean;
|
|
187
|
+
hint?: string;
|
|
188
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
189
|
+
className?: string;
|
|
190
|
+
fieldClassName?: string;
|
|
191
|
+
panelClassName?: string;
|
|
192
|
+
labelClassName?: string;
|
|
193
|
+
errorClassName?: string;
|
|
194
|
+
hintClassName?: string;
|
|
195
|
+
/** Opens the calendar popup on mount (useful for Storybook previews). */
|
|
196
|
+
defaultOpen?: boolean;
|
|
197
|
+
/** Closes the popup after a complete range is selected. Defaults to true in range mode. */
|
|
198
|
+
closeOnRangeComplete?: boolean;
|
|
199
|
+
};
|
|
200
|
+
type DatePickerSingleProps = Omit<CalendarSingleProps, "style" | "className"> & DatePickerFieldProps & {
|
|
201
|
+
mode?: "single";
|
|
202
|
+
formatDate?: (date: Date) => string;
|
|
203
|
+
};
|
|
204
|
+
type DatePickerRangeProps = Omit<CalendarRangeProps, "style" | "className"> & DatePickerFieldProps & {
|
|
205
|
+
mode: "range";
|
|
206
|
+
formatRange?: (range: DateRange) => string;
|
|
207
|
+
rangeSeparator?: string;
|
|
208
|
+
};
|
|
209
|
+
type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps;
|
|
210
|
+
declare function DatePicker(props: DatePickerProps): react.JSX.Element;
|
|
211
|
+
|
|
212
|
+
interface CalendarIconProps {
|
|
213
|
+
size?: number;
|
|
214
|
+
color?: string;
|
|
215
|
+
strokeWidth?: number;
|
|
216
|
+
}
|
|
217
|
+
declare function CalendarIcon({ size, color, strokeWidth, }: CalendarIconProps): react.JSX.Element;
|
|
218
|
+
|
|
85
219
|
interface LabelProps extends TextProps {
|
|
86
220
|
children: ReactNode;
|
|
87
221
|
/** Render as a required field indicator. */
|
|
@@ -92,6 +226,14 @@ interface LabelProps extends TextProps {
|
|
|
92
226
|
}
|
|
93
227
|
declare function Label({ children, required, disabled, style, className, ...props }: LabelProps): react.JSX.Element;
|
|
94
228
|
|
|
229
|
+
interface LockIconProps {
|
|
230
|
+
size?: number;
|
|
231
|
+
color?: string;
|
|
232
|
+
strokeWidth?: number;
|
|
233
|
+
}
|
|
234
|
+
/** Native — react-native-svg (peer dependency). */
|
|
235
|
+
declare function LockIcon({ size, color, strokeWidth, }: LockIconProps): react.JSX.Element;
|
|
236
|
+
|
|
95
237
|
/**
|
|
96
238
|
* HomePad design tokens — aligned with the Figma design system
|
|
97
239
|
* (navy / storm gray / slate-blue palette from HomePad brand).
|
|
@@ -338,4 +480,4 @@ declare const shadows: {
|
|
|
338
480
|
};
|
|
339
481
|
};
|
|
340
482
|
|
|
341
|
-
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, type Country, CountryCodeSelector, type CountryCodeSelectorProps, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, type StormGrayStep, brand, buttonTypography, colors, countries, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, labelTypography, navy, radii, rubyRed, shadows, spacing, stormGray };
|
|
483
|
+
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, CalendarIcon, type CalendarLabels, type CalendarLocale, CalendarLocaleProvider, type CalendarLocaleProviderProps, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps, type CalendarTranslationKey$1 as CalendarTranslationKey, type CalendarTranslations, type Country, CountryCodeSelector, type CountryCodeSelectorProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, LockIcon, type MultipleSelectProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, Select, type SelectOption, type SelectProps, type SingleSelectProps, type StormGrayStep, brand, buttonTypography, calendarTranslations, colors, countries, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, labelTypography, navy, radii, resolveCalendarLocale, resolveWeekdayLabels, rubyRed, shadows, spacing, stormGray, useCalendarLocale };
|