@geomak/ui 6.10.0 → 6.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +342 -222
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -1
- package/dist/index.d.ts +43 -1
- package/dist/index.js +149 -30
- package/dist/index.js.map +1 -1
- package/dist/styles.css +6 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1289,6 +1289,48 @@ interface PopConfirmProps {
|
|
|
1289
1289
|
*/
|
|
1290
1290
|
declare function PopConfirm({ children, title, description, onConfirm, onCancel, confirmText, cancelText, tone, icon, side, open, onOpenChange, className, }: PopConfirmProps): react_jsx_runtime.JSX.Element;
|
|
1291
1291
|
|
|
1292
|
+
interface CalendarEvent {
|
|
1293
|
+
/** The day this event lands on (time ignored). */
|
|
1294
|
+
date: Date;
|
|
1295
|
+
/** Optional dot colour (any CSS colour). Defaults to the accent token. */
|
|
1296
|
+
color?: string;
|
|
1297
|
+
/** Optional label (used as the dot's title tooltip). */
|
|
1298
|
+
label?: string;
|
|
1299
|
+
}
|
|
1300
|
+
interface CalendarProps {
|
|
1301
|
+
/** Selected day. */
|
|
1302
|
+
value?: Date | null;
|
|
1303
|
+
/** Fires with the clicked day. */
|
|
1304
|
+
onChange?: (date: Date) => void;
|
|
1305
|
+
/** Controlled visible month (any day within it). */
|
|
1306
|
+
month?: Date;
|
|
1307
|
+
/** Uncontrolled initial visible month. */
|
|
1308
|
+
defaultMonth?: Date;
|
|
1309
|
+
/** Fires when the user pages months. */
|
|
1310
|
+
onMonthChange?: (month: Date) => void;
|
|
1311
|
+
/** Event markers — rendered as up to three dots beneath the day. */
|
|
1312
|
+
events?: CalendarEvent[];
|
|
1313
|
+
/** Earliest / latest selectable day. */
|
|
1314
|
+
min?: Date;
|
|
1315
|
+
max?: Date;
|
|
1316
|
+
/** First column: 0 Sunday (default), 1 Monday. */
|
|
1317
|
+
weekStartsOn?: 0 | 1;
|
|
1318
|
+
className?: string;
|
|
1319
|
+
style?: React__default.CSSProperties;
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* A month-grid calendar — dependency-free date math, optional event dots, and
|
|
1323
|
+
* `min`/`max` bounds. Display + single-day selection; pair with your own state
|
|
1324
|
+
* for the value. For a popover date *field*, use **Temporal** (DatePicker).
|
|
1325
|
+
*
|
|
1326
|
+
* @example
|
|
1327
|
+
* ```tsx
|
|
1328
|
+
* const [day, setDay] = useState<Date | null>(null)
|
|
1329
|
+
* <Calendar value={day} onChange={setDay} events={[{ date: new Date(), label: 'Today' }]} />
|
|
1330
|
+
* ```
|
|
1331
|
+
*/
|
|
1332
|
+
declare function Calendar({ value, onChange, month, defaultMonth, onMonthChange, events, min, max, weekStartsOn, className, style, }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
1333
|
+
|
|
1292
1334
|
/** ─────────────────── types ─────────────────── */
|
|
1293
1335
|
type NotificationType = 'info' | 'success' | 'warning' | 'danger';
|
|
1294
1336
|
type NotificationPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
@@ -4357,4 +4399,4 @@ declare function expiryError(value: string, now?: Date): string | undefined;
|
|
|
4357
4399
|
/** Validate the CVV against the detected brand's expected length. */
|
|
4358
4400
|
declare function cvvError(value: string, cardNumber: string): string | undefined;
|
|
4359
4401
|
|
|
4360
|
-
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, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ColorPicker, type ColorPickerProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DeltaDirection, Drawer, type DrawerProps, Dropdown, type DropdownItem, type DropdownProps, type ErrorMap, type ExpandRowOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, FadingBase, type FadingBaseProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridProps, Icon, IconButton, type IconButtonProps, Kbd, type KbdProps, type KbdSize, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Slider, type SliderMark, type SliderProps, type SliderValue, type Spacing, Statistic, type StatisticDelta, type StatisticProps, type StatisticSize, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type ValidateTrigger, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
|
4402
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CARD_BRANDS, Calendar, type CalendarEvent, type CalendarProps, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ColorPicker, type ColorPickerProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DeltaDirection, Drawer, type DrawerProps, Dropdown, type DropdownItem, type DropdownProps, type ErrorMap, type ExpandRowOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, FadingBase, type FadingBaseProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridProps, Icon, IconButton, type IconButtonProps, Kbd, type KbdProps, type KbdSize, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Slider, type SliderMark, type SliderProps, type SliderValue, type Spacing, Statistic, type StatisticDelta, type StatisticProps, type StatisticSize, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type ValidateTrigger, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
package/dist/index.d.ts
CHANGED
|
@@ -1289,6 +1289,48 @@ interface PopConfirmProps {
|
|
|
1289
1289
|
*/
|
|
1290
1290
|
declare function PopConfirm({ children, title, description, onConfirm, onCancel, confirmText, cancelText, tone, icon, side, open, onOpenChange, className, }: PopConfirmProps): react_jsx_runtime.JSX.Element;
|
|
1291
1291
|
|
|
1292
|
+
interface CalendarEvent {
|
|
1293
|
+
/** The day this event lands on (time ignored). */
|
|
1294
|
+
date: Date;
|
|
1295
|
+
/** Optional dot colour (any CSS colour). Defaults to the accent token. */
|
|
1296
|
+
color?: string;
|
|
1297
|
+
/** Optional label (used as the dot's title tooltip). */
|
|
1298
|
+
label?: string;
|
|
1299
|
+
}
|
|
1300
|
+
interface CalendarProps {
|
|
1301
|
+
/** Selected day. */
|
|
1302
|
+
value?: Date | null;
|
|
1303
|
+
/** Fires with the clicked day. */
|
|
1304
|
+
onChange?: (date: Date) => void;
|
|
1305
|
+
/** Controlled visible month (any day within it). */
|
|
1306
|
+
month?: Date;
|
|
1307
|
+
/** Uncontrolled initial visible month. */
|
|
1308
|
+
defaultMonth?: Date;
|
|
1309
|
+
/** Fires when the user pages months. */
|
|
1310
|
+
onMonthChange?: (month: Date) => void;
|
|
1311
|
+
/** Event markers — rendered as up to three dots beneath the day. */
|
|
1312
|
+
events?: CalendarEvent[];
|
|
1313
|
+
/** Earliest / latest selectable day. */
|
|
1314
|
+
min?: Date;
|
|
1315
|
+
max?: Date;
|
|
1316
|
+
/** First column: 0 Sunday (default), 1 Monday. */
|
|
1317
|
+
weekStartsOn?: 0 | 1;
|
|
1318
|
+
className?: string;
|
|
1319
|
+
style?: React__default.CSSProperties;
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* A month-grid calendar — dependency-free date math, optional event dots, and
|
|
1323
|
+
* `min`/`max` bounds. Display + single-day selection; pair with your own state
|
|
1324
|
+
* for the value. For a popover date *field*, use **Temporal** (DatePicker).
|
|
1325
|
+
*
|
|
1326
|
+
* @example
|
|
1327
|
+
* ```tsx
|
|
1328
|
+
* const [day, setDay] = useState<Date | null>(null)
|
|
1329
|
+
* <Calendar value={day} onChange={setDay} events={[{ date: new Date(), label: 'Today' }]} />
|
|
1330
|
+
* ```
|
|
1331
|
+
*/
|
|
1332
|
+
declare function Calendar({ value, onChange, month, defaultMonth, onMonthChange, events, min, max, weekStartsOn, className, style, }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
1333
|
+
|
|
1292
1334
|
/** ─────────────────── types ─────────────────── */
|
|
1293
1335
|
type NotificationType = 'info' | 'success' | 'warning' | 'danger';
|
|
1294
1336
|
type NotificationPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
@@ -4357,4 +4399,4 @@ declare function expiryError(value: string, now?: Date): string | undefined;
|
|
|
4357
4399
|
/** Validate the CVV against the detected brand's expected length. */
|
|
4358
4400
|
declare function cvvError(value: string, cardNumber: string): string | undefined;
|
|
4359
4401
|
|
|
4360
|
-
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, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ColorPicker, type ColorPickerProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DeltaDirection, Drawer, type DrawerProps, Dropdown, type DropdownItem, type DropdownProps, type ErrorMap, type ExpandRowOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, FadingBase, type FadingBaseProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridProps, Icon, IconButton, type IconButtonProps, Kbd, type KbdProps, type KbdSize, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Slider, type SliderMark, type SliderProps, type SliderValue, type Spacing, Statistic, type StatisticDelta, type StatisticProps, type StatisticSize, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type ValidateTrigger, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
|
4402
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, AppShell, type AppShellProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant, Box, type BoxBackground, type BoxBorder, type BoxProps, type BoxRadius, type BoxShadow, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CARD_BRANDS, Calendar, type CalendarEvent, type CalendarProps, Card, type CardBodyProps, type CardBrand, CardCarousel, type CardCarouselProps, type CardFooterProps, type CardHeaderProps, type CardMediaProps, type CardProps, Catalog, CatalogCarousel, type CatalogCarouselProps, CatalogGrid, type CatalogGridProps, type CatalogProps, Checkbox, type CheckboxProps, ColorPicker, type ColorPickerProps, ContextMenu, type ContextMenuActionItem, type ContextMenuPosition, type ContextMenuProps, CreditCardForm, type CreditCardFormProps, type CreditCardValue, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateRangePreset, type DeltaDirection, Drawer, type DrawerProps, Dropdown, type DropdownItem, type DropdownProps, type ErrorMap, type ExpandRowOptions, FAB, type FABAction, type FABPosition, type FABProps, type FABSize, type FABTone, FadingBase, type FadingBaseProps, Field, type FieldArrayItem, type FieldBindings, FieldHelpIcon, type FieldKind, FieldLabel, type FieldLabelProps, type FieldProps, type FieldRule, type FieldRules, type FieldShellOptions, type FieldSize, type FieldSnapshot, FileInput, type FileInputProps, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexProps, type FlexWrap, Form, FormContext, FormField, type FormFieldProps, type FormProps, FormStore, type FormStoreOptions, type FormValues, Grid, GridCard, type GridCardItem, type GridCardProps, type GridProps, Icon, IconButton, type IconButtonProps, Kbd, type KbdProps, type KbdSize, List, type ListItem, type ListProps, LoadingSpinner, type LoadingSpinnerProps, MegaMenu, type MegaMenuFeaturedProps, type MegaMenuItemProps, type MegaMenuLinkProps, type MegaMenuPanelProps, type MegaMenuProps, type MegaMenuSectionProps, Modal, type ModalProps, type NotificationPayload, NotificationProvider, NumberInput, type NumberInputProps, OpaqueGridCard, type OpaqueGridCardProps, OtpInput, type OtpInputProps, type PaginationOptions, Password, type PasswordProps, PopConfirm, type PopConfirmProps, type PopConfirmTone, Portal, type PortalProps, RadioGroup, type RadioGroupProps, type RadioOption, Rating, type RatingProps, type RulesMap, ScalableContainer, type ScalableContainerProps, SearchInput, type SearchInputProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Sidebar, type SidebarItem, type SidebarProps, type SidebarSection, SkeletonBox, type SkeletonBoxProps, SkeletonCard, type SkeletonCardProps, SkeletonCircle, type SkeletonCircleProps, SkeletonText, type SkeletonTextProps, Slider, type SliderMark, type SliderProps, type SliderValue, type Spacing, Statistic, type StatisticDelta, type StatisticProps, type StatisticSize, Switch, type SwitchInputProps, Table, type TableColumn, type TableProps, Tabs, type TabsAddProps, type TabsListProps, type TabsOrientation, type TabsPanelProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsVariant, TagsInput, type TagsInputProps, DatePicker as Temporal, type TemporalPickerProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, type ThemeColors, type ThemeConfig, type ThemeDensity, type ThemeMotion, ThemeProvider, type ThemeProviderProps, type ThemeRadius, type ThemeShadows, ThemeSwitch, type ThemeSwitchProps, type ThemeTypography, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, TooltipProvider, TopBar, type TopBarProps, Tree, type TreeItemClickPayload, type TreeNode, type TreeProps, TreeSelect, type TreeSelectProps, Typography, type TypographyAlign, type TypographyColor, type TypographyProps, type TypographyVariant, type TypographyWeight, type UseFieldArrayReturn, type UseFormFieldOptions, type UseFormReturn, type ValidateTrigger, Wizard, type WizardProps, type WizardStep, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { colors_default } from './chunk-GKXP6OJJ.js';
|
|
2
2
|
export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } from './chunk-GKXP6OJJ.js';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import
|
|
4
|
+
import React19, { createContext, useState, useEffect, useMemo, useId, useCallback, useRef, useContext, useLayoutEffect, useSyncExternalStore } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
7
7
|
import * as Dialog from '@radix-ui/react-dialog';
|
|
@@ -1630,7 +1630,7 @@ function Kbd({
|
|
|
1630
1630
|
style
|
|
1631
1631
|
}) {
|
|
1632
1632
|
if (keys && keys.length > 0) {
|
|
1633
|
-
return /* @__PURE__ */ jsx("span", { className: ["inline-flex items-center gap-1", className].filter(Boolean).join(" "), style, children: keys.map((k, i) => /* @__PURE__ */ jsxs(
|
|
1633
|
+
return /* @__PURE__ */ jsx("span", { className: ["inline-flex items-center gap-1", className].filter(Boolean).join(" "), style, children: keys.map((k, i) => /* @__PURE__ */ jsxs(React19.Fragment, { children: [
|
|
1634
1634
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "text-foreground-muted text-xs select-none", children: separator }),
|
|
1635
1635
|
/* @__PURE__ */ jsx("kbd", { className: [cap, SIZE3[size]].join(" "), children: k })
|
|
1636
1636
|
] }, `${k}-${i}`)) });
|
|
@@ -1704,7 +1704,7 @@ function CardCarousel({
|
|
|
1704
1704
|
style
|
|
1705
1705
|
}) {
|
|
1706
1706
|
const scrollerRef = useRef(null);
|
|
1707
|
-
const slides =
|
|
1707
|
+
const slides = React19.Children.toArray(children);
|
|
1708
1708
|
const [active, setActive] = useState(0);
|
|
1709
1709
|
const [atStart, setAtStart] = useState(true);
|
|
1710
1710
|
const [atEnd, setAtEnd] = useState(false);
|
|
@@ -1999,6 +1999,125 @@ function PopConfirm({
|
|
|
1999
1999
|
) })
|
|
2000
2000
|
] });
|
|
2001
2001
|
}
|
|
2002
|
+
var WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
2003
|
+
var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
2004
|
+
var startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
2005
|
+
var sameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
2006
|
+
var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
2007
|
+
function buildGrid(month, weekStartsOn) {
|
|
2008
|
+
const first = new Date(month.getFullYear(), month.getMonth(), 1);
|
|
2009
|
+
const offset = (first.getDay() - weekStartsOn + 7) % 7;
|
|
2010
|
+
const start = new Date(first);
|
|
2011
|
+
start.setDate(first.getDate() - offset);
|
|
2012
|
+
return Array.from({ length: 42 }, (_, i) => {
|
|
2013
|
+
const d = new Date(start);
|
|
2014
|
+
d.setDate(start.getDate() + i);
|
|
2015
|
+
return d;
|
|
2016
|
+
});
|
|
2017
|
+
}
|
|
2018
|
+
var NavIcon = ({ dir }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", className: "h-4 w-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: dir === "left" ? "M15 19l-7-7 7-7" : "M9 5l7 7-7 7" }) });
|
|
2019
|
+
function Calendar2({
|
|
2020
|
+
value,
|
|
2021
|
+
onChange,
|
|
2022
|
+
month,
|
|
2023
|
+
defaultMonth,
|
|
2024
|
+
onMonthChange,
|
|
2025
|
+
events,
|
|
2026
|
+
min,
|
|
2027
|
+
max,
|
|
2028
|
+
weekStartsOn = 0,
|
|
2029
|
+
className = "",
|
|
2030
|
+
style
|
|
2031
|
+
}) {
|
|
2032
|
+
const today = useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
2033
|
+
const [internalMonth, setInternalMonth] = useState(() => month ?? defaultMonth ?? value ?? today);
|
|
2034
|
+
const visible = month ?? internalMonth;
|
|
2035
|
+
const setMonth = (next) => {
|
|
2036
|
+
onMonthChange?.(next);
|
|
2037
|
+
if (month === void 0) setInternalMonth(next);
|
|
2038
|
+
};
|
|
2039
|
+
const grid = useMemo(() => buildGrid(visible, weekStartsOn), [visible, weekStartsOn]);
|
|
2040
|
+
const weekdays = useMemo(() => Array.from({ length: 7 }, (_, i) => WEEKDAYS[(i + weekStartsOn) % 7]), [weekStartsOn]);
|
|
2041
|
+
const eventsByDay = useMemo(() => {
|
|
2042
|
+
const map = /* @__PURE__ */ new Map();
|
|
2043
|
+
for (const ev of events ?? []) {
|
|
2044
|
+
const key = startOfDay(ev.date).toDateString();
|
|
2045
|
+
const arr = map.get(key) ?? [];
|
|
2046
|
+
arr.push(ev);
|
|
2047
|
+
map.set(key, arr);
|
|
2048
|
+
}
|
|
2049
|
+
return map;
|
|
2050
|
+
}, [events]);
|
|
2051
|
+
const disabled = (d) => min && d < startOfDay(min) || max && d > startOfDay(max);
|
|
2052
|
+
return /* @__PURE__ */ jsxs("div", { className: ["inline-block rounded-lg border border-border bg-surface p-3 select-none", className].filter(Boolean).join(" "), style, children: [
|
|
2053
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between px-1", children: [
|
|
2054
|
+
/* @__PURE__ */ jsx(
|
|
2055
|
+
"button",
|
|
2056
|
+
{
|
|
2057
|
+
type: "button",
|
|
2058
|
+
"aria-label": "Previous month",
|
|
2059
|
+
onClick: () => setMonth(addMonths(visible, -1)),
|
|
2060
|
+
className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground-secondary hover:bg-surface-raised hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
2061
|
+
children: /* @__PURE__ */ jsx(NavIcon, { dir: "left" })
|
|
2062
|
+
}
|
|
2063
|
+
),
|
|
2064
|
+
/* @__PURE__ */ jsxs("div", { className: "text-sm font-semibold text-foreground", "aria-live": "polite", children: [
|
|
2065
|
+
MONTHS[visible.getMonth()],
|
|
2066
|
+
" ",
|
|
2067
|
+
visible.getFullYear()
|
|
2068
|
+
] }),
|
|
2069
|
+
/* @__PURE__ */ jsx(
|
|
2070
|
+
"button",
|
|
2071
|
+
{
|
|
2072
|
+
type: "button",
|
|
2073
|
+
"aria-label": "Next month",
|
|
2074
|
+
onClick: () => setMonth(addMonths(visible, 1)),
|
|
2075
|
+
className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground-secondary hover:bg-surface-raised hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
2076
|
+
children: /* @__PURE__ */ jsx(NavIcon, { dir: "right" })
|
|
2077
|
+
}
|
|
2078
|
+
)
|
|
2079
|
+
] }),
|
|
2080
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 mb-1", children: weekdays.map((w) => /* @__PURE__ */ jsx("div", { className: "text-center text-[11px] font-medium uppercase tracking-wide text-foreground-muted py-1", children: w }, w)) }),
|
|
2081
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-0.5", role: "grid", children: grid.map((d, i) => {
|
|
2082
|
+
const inMonth = d.getMonth() === visible.getMonth();
|
|
2083
|
+
const isSelected = value != null && sameDay(d, value);
|
|
2084
|
+
const isToday = sameDay(d, today);
|
|
2085
|
+
const isDisabled = disabled(d);
|
|
2086
|
+
const dayEvents = eventsByDay.get(d.toDateString()) ?? [];
|
|
2087
|
+
return /* @__PURE__ */ jsxs(
|
|
2088
|
+
"button",
|
|
2089
|
+
{
|
|
2090
|
+
type: "button",
|
|
2091
|
+
role: "gridcell",
|
|
2092
|
+
"aria-selected": isSelected,
|
|
2093
|
+
"aria-current": isToday ? "date" : void 0,
|
|
2094
|
+
disabled: isDisabled,
|
|
2095
|
+
onClick: () => onChange?.(startOfDay(d)),
|
|
2096
|
+
className: [
|
|
2097
|
+
"relative flex h-9 w-9 flex-col items-center justify-center rounded-md text-sm transition-colors",
|
|
2098
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
2099
|
+
isSelected ? "bg-accent text-accent-fg font-semibold" : inMonth ? "text-foreground hover:bg-surface-raised" : "text-foreground-muted hover:bg-surface-raised",
|
|
2100
|
+
isDisabled ? "opacity-40 cursor-not-allowed hover:bg-transparent" : "",
|
|
2101
|
+
!isSelected && isToday ? "ring-1 ring-inset ring-accent/60" : ""
|
|
2102
|
+
].filter(Boolean).join(" "),
|
|
2103
|
+
children: [
|
|
2104
|
+
/* @__PURE__ */ jsx("span", { className: "leading-none", children: d.getDate() }),
|
|
2105
|
+
dayEvents.length > 0 && /* @__PURE__ */ jsx("span", { className: "absolute bottom-1 flex gap-0.5", children: dayEvents.slice(0, 3).map((ev, j) => /* @__PURE__ */ jsx(
|
|
2106
|
+
"span",
|
|
2107
|
+
{
|
|
2108
|
+
title: ev.label,
|
|
2109
|
+
className: "h-1 w-1 rounded-full",
|
|
2110
|
+
style: { backgroundColor: ev.color ?? (isSelected ? "var(--color-accent-fg)" : "var(--color-accent)") }
|
|
2111
|
+
},
|
|
2112
|
+
j
|
|
2113
|
+
)) })
|
|
2114
|
+
]
|
|
2115
|
+
},
|
|
2116
|
+
i
|
|
2117
|
+
);
|
|
2118
|
+
}) })
|
|
2119
|
+
] });
|
|
2120
|
+
}
|
|
2002
2121
|
var NotificationContext = createContext({
|
|
2003
2122
|
open: () => void 0,
|
|
2004
2123
|
close: () => void 0
|
|
@@ -3102,7 +3221,7 @@ function Field({
|
|
|
3102
3221
|
);
|
|
3103
3222
|
}
|
|
3104
3223
|
var SearchIcon = /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10.5 3.75a6.75 6.75 0 100 13.5 6.75 6.75 0 000-13.5zM2.25 10.5a8.25 8.25 0 1114.59 5.28l4.69 4.69a.75.75 0 11-1.06 1.06l-4.69-4.69A8.25 8.25 0 012.25 10.5z", clipRule: "evenodd" }) });
|
|
3105
|
-
var SearchInput =
|
|
3224
|
+
var SearchInput = React19.forwardRef(function SearchInput2({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout = "vertical", size = "md", icon, helperText, className }, ref) {
|
|
3106
3225
|
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, layout, helperText, children: /* @__PURE__ */ jsxs(
|
|
3107
3226
|
"div",
|
|
3108
3227
|
{
|
|
@@ -3603,7 +3722,7 @@ function TableBody({
|
|
|
3603
3722
|
return /* @__PURE__ */ jsx("tbody", { children: rows.map((row, i) => {
|
|
3604
3723
|
const rowKey = getRowKey(row, i);
|
|
3605
3724
|
const isExpanded = expanded.has(rowKey);
|
|
3606
|
-
return /* @__PURE__ */ jsxs(
|
|
3725
|
+
return /* @__PURE__ */ jsxs(React19.Fragment, { children: [
|
|
3607
3726
|
/* @__PURE__ */ jsxs(
|
|
3608
3727
|
"tr",
|
|
3609
3728
|
{
|
|
@@ -4147,8 +4266,8 @@ function MegaMenuLink({ href, icon, description, active, onClick, children, clas
|
|
|
4147
4266
|
function MegaMenuFeatured({ children, className = "" }) {
|
|
4148
4267
|
return /* @__PURE__ */ jsx("div", { className: ["min-w-0 rounded-lg bg-surface-raised border border-border p-4 flex flex-col", className].filter(Boolean).join(" "), children });
|
|
4149
4268
|
}
|
|
4150
|
-
var elementsOfType = (children, type) =>
|
|
4151
|
-
(c) =>
|
|
4269
|
+
var elementsOfType = (children, type) => React19.Children.toArray(children).filter(
|
|
4270
|
+
(c) => React19.isValidElement(c) && c.type === type
|
|
4152
4271
|
);
|
|
4153
4272
|
var MOBILE_CHEVRON = /* @__PURE__ */ jsx(
|
|
4154
4273
|
"svg",
|
|
@@ -4185,9 +4304,9 @@ function MobileLinkRow({ link, onNavigate }) {
|
|
|
4185
4304
|
);
|
|
4186
4305
|
}
|
|
4187
4306
|
function MobilePanel({ panel, onNavigate }) {
|
|
4188
|
-
const nodes =
|
|
4307
|
+
const nodes = React19.Children.toArray(panel.props.children);
|
|
4189
4308
|
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 px-2 pb-3 pt-1", children: nodes.map((node, i) => {
|
|
4190
|
-
if (!
|
|
4309
|
+
if (!React19.isValidElement(node)) return null;
|
|
4191
4310
|
const el = node;
|
|
4192
4311
|
if (el.type === MegaMenuSection) {
|
|
4193
4312
|
const { title, children } = el.props;
|
|
@@ -4480,7 +4599,7 @@ function ThemeProvider({
|
|
|
4480
4599
|
className = "",
|
|
4481
4600
|
style
|
|
4482
4601
|
}) {
|
|
4483
|
-
const id =
|
|
4602
|
+
const id = React19.useId().replace(/:/g, "");
|
|
4484
4603
|
const scopeClass = `geo-th-${id}`;
|
|
4485
4604
|
const divRef = useRef(null);
|
|
4486
4605
|
useEffect(() => {
|
|
@@ -5667,7 +5786,7 @@ function addDays(d, n) {
|
|
|
5667
5786
|
c.setDate(c.getDate() + n);
|
|
5668
5787
|
return c;
|
|
5669
5788
|
}
|
|
5670
|
-
function
|
|
5789
|
+
function addMonths2(d, n) {
|
|
5671
5790
|
const c = new Date(d);
|
|
5672
5791
|
c.setMonth(c.getMonth() + n);
|
|
5673
5792
|
return c;
|
|
@@ -5678,7 +5797,7 @@ function defaultFormat(d) {
|
|
|
5678
5797
|
const day = d.getDate().toString().padStart(2, "0");
|
|
5679
5798
|
return `${y}-${m}-${day}`;
|
|
5680
5799
|
}
|
|
5681
|
-
function
|
|
5800
|
+
function buildGrid2(viewMonth, weekStartsOn) {
|
|
5682
5801
|
const first = startOfMonth(viewMonth);
|
|
5683
5802
|
const startOffset = (first.getDay() - weekStartsOn + 7) % 7;
|
|
5684
5803
|
const gridStart = addDays(first, -startOffset);
|
|
@@ -5735,7 +5854,7 @@ function DatePicker({
|
|
|
5735
5854
|
const ordered = WEEKDAY_SHORT.slice(weekStartsOn).concat(WEEKDAY_SHORT.slice(0, weekStartsOn));
|
|
5736
5855
|
return ordered;
|
|
5737
5856
|
}, [weekStartsOn]);
|
|
5738
|
-
const grid = useMemo(() =>
|
|
5857
|
+
const grid = useMemo(() => buildGrid2(viewMonth, weekStartsOn), [viewMonth, weekStartsOn]);
|
|
5739
5858
|
const isDisabled = (d) => {
|
|
5740
5859
|
if (min && d < min) return true;
|
|
5741
5860
|
if (max && d > max) return true;
|
|
@@ -5766,14 +5885,14 @@ function DatePicker({
|
|
|
5766
5885
|
next(7);
|
|
5767
5886
|
} else if (e.key === "PageUp") {
|
|
5768
5887
|
e.preventDefault();
|
|
5769
|
-
const nm =
|
|
5888
|
+
const nm = addMonths2(viewMonth, -1);
|
|
5770
5889
|
setViewMonth(nm);
|
|
5771
|
-
setFocusDate((d) =>
|
|
5890
|
+
setFocusDate((d) => addMonths2(d, -1));
|
|
5772
5891
|
} else if (e.key === "PageDown") {
|
|
5773
5892
|
e.preventDefault();
|
|
5774
|
-
const nm =
|
|
5893
|
+
const nm = addMonths2(viewMonth, 1);
|
|
5775
5894
|
setViewMonth(nm);
|
|
5776
|
-
setFocusDate((d) =>
|
|
5895
|
+
setFocusDate((d) => addMonths2(d, 1));
|
|
5777
5896
|
} else if (e.key === "Home") {
|
|
5778
5897
|
e.preventDefault();
|
|
5779
5898
|
const dow = (focusDate.getDay() - weekStartsOn + 7) % 7;
|
|
@@ -5838,7 +5957,7 @@ function DatePicker({
|
|
|
5838
5957
|
{
|
|
5839
5958
|
type: "button",
|
|
5840
5959
|
onClick: () => {
|
|
5841
|
-
if (view === "days") setViewMonth(
|
|
5960
|
+
if (view === "days") setViewMonth(addMonths2(viewMonth, -1));
|
|
5842
5961
|
else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() - 1, viewMonth.getMonth(), 1));
|
|
5843
5962
|
else setViewMonth(new Date(viewMonth.getFullYear() - 10, viewMonth.getMonth(), 1));
|
|
5844
5963
|
},
|
|
@@ -5873,7 +5992,7 @@ function DatePicker({
|
|
|
5873
5992
|
{
|
|
5874
5993
|
type: "button",
|
|
5875
5994
|
onClick: () => {
|
|
5876
|
-
if (view === "days") setViewMonth(
|
|
5995
|
+
if (view === "days") setViewMonth(addMonths2(viewMonth, 1));
|
|
5877
5996
|
else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() + 1, viewMonth.getMonth(), 1));
|
|
5878
5997
|
else setViewMonth(new Date(viewMonth.getFullYear() + 10, viewMonth.getMonth(), 1));
|
|
5879
5998
|
},
|
|
@@ -6484,7 +6603,7 @@ function OtpInput({
|
|
|
6484
6603
|
emit(valid.join(""));
|
|
6485
6604
|
focusBox(valid.length);
|
|
6486
6605
|
};
|
|
6487
|
-
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxs(
|
|
6606
|
+
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxs(React19.Fragment, { children: [
|
|
6488
6607
|
/* @__PURE__ */ jsx(
|
|
6489
6608
|
"input",
|
|
6490
6609
|
{
|
|
@@ -6755,16 +6874,16 @@ function TimePicker({
|
|
|
6755
6874
|
var MONTH_NAMES2 = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
6756
6875
|
var WEEKDAY = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
6757
6876
|
var startOfMonth2 = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
|
|
6758
|
-
var
|
|
6877
|
+
var addMonths3 = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
6759
6878
|
var addDays2 = (d, n) => {
|
|
6760
6879
|
const c = new Date(d);
|
|
6761
6880
|
c.setDate(c.getDate() + n);
|
|
6762
6881
|
return c;
|
|
6763
6882
|
};
|
|
6764
6883
|
var isSameDay2 = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
6765
|
-
var
|
|
6884
|
+
var startOfDay2 = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
6766
6885
|
var defaultFmt = (d) => `${d.getFullYear()}-${`${d.getMonth() + 1}`.padStart(2, "0")}-${`${d.getDate()}`.padStart(2, "0")}`;
|
|
6767
|
-
function
|
|
6886
|
+
function buildGrid3(viewMonth, weekStartsOn) {
|
|
6768
6887
|
const first = startOfMonth2(viewMonth);
|
|
6769
6888
|
const offset = (first.getDay() - weekStartsOn + 7) % 7;
|
|
6770
6889
|
const gridStart = addDays2(first, -offset);
|
|
@@ -6803,13 +6922,13 @@ function DateRangePicker({
|
|
|
6803
6922
|
() => WEEKDAY.slice(weekStartsOn).concat(WEEKDAY.slice(0, weekStartsOn)),
|
|
6804
6923
|
[weekStartsOn]
|
|
6805
6924
|
);
|
|
6806
|
-
const isDisabled = (d) => min && d <
|
|
6925
|
+
const isDisabled = (d) => min && d < startOfDay2(min) || max && d > startOfDay2(max);
|
|
6807
6926
|
const effective = pendingStart ? { start: pendingStart, end: hoverDate } : value;
|
|
6808
6927
|
const inRange = (d) => {
|
|
6809
6928
|
const { start, end } = effective;
|
|
6810
6929
|
if (!start || !end) return false;
|
|
6811
6930
|
const [a, b] = start <= end ? [start, end] : [end, start];
|
|
6812
|
-
return d >=
|
|
6931
|
+
return d >= startOfDay2(a) && d <= startOfDay2(b);
|
|
6813
6932
|
};
|
|
6814
6933
|
const onDayClick = (d) => {
|
|
6815
6934
|
if (isDisabled(d)) return;
|
|
@@ -6827,7 +6946,7 @@ function DateRangePicker({
|
|
|
6827
6946
|
};
|
|
6828
6947
|
const triggerText = value.start && value.end ? `${format(value.start)} \u2013 ${format(value.end)}` : value.start ? `${format(value.start)} \u2013 \u2026` : "";
|
|
6829
6948
|
const renderMonth = (viewMonth) => {
|
|
6830
|
-
const cells =
|
|
6949
|
+
const cells = buildGrid3(viewMonth, weekStartsOn);
|
|
6831
6950
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
6832
6951
|
/* @__PURE__ */ jsxs("div", { className: "text-sm font-semibold text-center mb-2 select-none", children: [
|
|
6833
6952
|
MONTH_NAMES2[viewMonth.getMonth()],
|
|
@@ -6916,7 +7035,7 @@ function DateRangePicker({
|
|
|
6916
7035
|
"button",
|
|
6917
7036
|
{
|
|
6918
7037
|
type: "button",
|
|
6919
|
-
onClick: () => setLeftMonth(
|
|
7038
|
+
onClick: () => setLeftMonth(addMonths3(leftMonth, -1)),
|
|
6920
7039
|
"aria-label": "Previous month",
|
|
6921
7040
|
className: "absolute -top-1 left-0 w-7 h-7 inline-flex items-center justify-center rounded-md hover:bg-surface-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
6922
7041
|
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) })
|
|
@@ -6929,13 +7048,13 @@ function DateRangePicker({
|
|
|
6929
7048
|
"button",
|
|
6930
7049
|
{
|
|
6931
7050
|
type: "button",
|
|
6932
|
-
onClick: () => setLeftMonth(
|
|
7051
|
+
onClick: () => setLeftMonth(addMonths3(leftMonth, 1)),
|
|
6933
7052
|
"aria-label": "Next month",
|
|
6934
7053
|
className: "absolute -top-1 right-0 w-7 h-7 inline-flex items-center justify-center rounded-md hover:bg-surface-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
6935
7054
|
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) })
|
|
6936
7055
|
}
|
|
6937
7056
|
),
|
|
6938
|
-
renderMonth(
|
|
7057
|
+
renderMonth(addMonths3(leftMonth, 1))
|
|
6939
7058
|
] })
|
|
6940
7059
|
] })
|
|
6941
7060
|
]
|
|
@@ -7698,6 +7817,6 @@ function CreditCardForm({
|
|
|
7698
7817
|
);
|
|
7699
7818
|
}
|
|
7700
7819
|
|
|
7701
|
-
export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Box, Breadcrumbs, Button, CARD_BRANDS, Card_default as Card, CardCarousel, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ColorPicker, ContextMenu, CreditCardForm, DateRangePicker, Drawer, Dropdown, FAB, FadingBase, Field, FieldHelpIcon, FieldLabel, FileInput, Flex, Form, FormContext, FormField, FormStore, Grid2 as Grid, GridCard, icons_default as Icon, IconButton, Kbd, List2 as List, LoadingSpinner, MegaMenu_default as MegaMenu, Modal, NotificationProvider, NumberInput, OpaqueGridCard, OtpInput, Password, PopConfirm, Portal, RadioGroup, Rating, ScalableContainer, SearchInput_default as SearchInput, SegmentedControl, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, Slider, Statistic, Switch, Table, Tabs_default as Tabs, TagsInput, DatePicker as Temporal, TextArea, TextInput, ThemeProvider, ThemeSwitch, TimePicker, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Typography, Wizard, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
|
7820
|
+
export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Box, Breadcrumbs, Button, CARD_BRANDS, Calendar2 as Calendar, Card_default as Card, CardCarousel, Catalog, CatalogCarousel, CatalogGrid, Checkbox, ColorPicker, ContextMenu, CreditCardForm, DateRangePicker, Drawer, Dropdown, FAB, FadingBase, Field, FieldHelpIcon, FieldLabel, FileInput, Flex, Form, FormContext, FormField, FormStore, Grid2 as Grid, GridCard, icons_default as Icon, IconButton, Kbd, List2 as List, LoadingSpinner, MegaMenu_default as MegaMenu, Modal, NotificationProvider, NumberInput, OpaqueGridCard, OtpInput, Password, PopConfirm, Portal, RadioGroup, Rating, ScalableContainer, SearchInput_default as SearchInput, SegmentedControl, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, Slider, Statistic, Switch, Table, Tabs_default as Tabs, TagsInput, DatePicker as Temporal, TextArea, TextInput, ThemeProvider, ThemeSwitch, TimePicker, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Typography, Wizard, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useFieldArray, useForm, useFormField, useFormStore, useNotification };
|
|
7702
7821
|
//# sourceMappingURL=index.js.map
|
|
7703
7822
|
//# sourceMappingURL=index.js.map
|