@korsolutions/ui 0.0.28 → 0.0.30
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/babel.config.js +12 -0
- package/bob.config.js +13 -0
- package/dist/module/components/avatar/avatar.js +21 -0
- package/dist/module/components/avatar/avatar.js.map +1 -0
- package/dist/module/components/avatar/variants/default.js +33 -0
- package/dist/module/components/avatar/variants/default.js.map +1 -0
- package/dist/module/components/avatar/variants/index.js +7 -0
- package/dist/module/components/avatar/variants/index.js.map +1 -0
- package/dist/module/components/badge/badge.js +23 -0
- package/dist/module/components/badge/badge.js.map +1 -0
- package/dist/module/components/badge/variants/default.js +30 -0
- package/dist/module/components/badge/variants/default.js.map +1 -0
- package/dist/module/components/badge/variants/index.js +9 -0
- package/dist/module/components/badge/variants/index.js.map +1 -0
- package/dist/module/components/badge/variants/secondary.js +30 -0
- package/dist/module/components/badge/variants/secondary.js.map +1 -0
- package/dist/module/components/button/button.js +23 -0
- package/dist/module/components/button/button.js.map +1 -0
- package/dist/module/components/button/variants/default.js +62 -0
- package/dist/module/components/button/variants/default.js.map +1 -0
- package/dist/module/components/button/variants/index.js +9 -0
- package/dist/module/components/button/variants/index.js.map +1 -0
- package/dist/module/components/button/variants/secondary.js +62 -0
- package/dist/module/components/button/variants/secondary.js.map +1 -0
- package/dist/module/components/calendar/calendar.js +29 -0
- package/dist/module/components/calendar/calendar.js.map +1 -0
- package/dist/module/components/calendar/index.js +4 -0
- package/dist/module/components/calendar/index.js.map +1 -0
- package/dist/module/components/calendar/variants/default.js +131 -0
- package/dist/module/components/calendar/variants/default.js.map +1 -0
- package/dist/module/components/calendar/variants/index.js +7 -0
- package/dist/module/components/calendar/variants/index.js.map +1 -0
- package/dist/module/components/card/card.js +21 -0
- package/dist/module/components/card/card.js.map +1 -0
- package/dist/module/components/card/variants/default.js +42 -0
- package/dist/module/components/card/variants/default.js.map +1 -0
- package/dist/module/components/card/variants/index.js +7 -0
- package/dist/module/components/card/variants/index.js.map +1 -0
- package/dist/module/components/dropdown-menu/dropdown-menu.js +34 -0
- package/dist/module/components/dropdown-menu/dropdown-menu.js.map +1 -0
- package/dist/module/components/dropdown-menu/variants/default.js +47 -0
- package/dist/module/components/dropdown-menu/variants/default.js.map +1 -0
- package/dist/module/components/dropdown-menu/variants/index.js +7 -0
- package/dist/module/components/dropdown-menu/variants/index.js.map +1 -0
- package/dist/module/components/empty/empty.js +21 -0
- package/dist/module/components/empty/empty.js.map +1 -0
- package/dist/module/components/empty/variants/default.js +38 -0
- package/dist/module/components/empty/variants/default.js.map +1 -0
- package/dist/module/components/empty/variants/index.js +7 -0
- package/dist/module/components/empty/variants/index.js.map +1 -0
- package/dist/module/components/field/field.js +22 -0
- package/dist/module/components/field/field.js.map +1 -0
- package/dist/module/components/field/variants/default.js +32 -0
- package/dist/module/components/field/variants/default.js.map +1 -0
- package/dist/module/components/field/variants/index.js +7 -0
- package/dist/module/components/field/variants/index.js.map +1 -0
- package/dist/module/components/index.js +18 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/input/index.js +5 -0
- package/dist/module/components/input/index.js.map +1 -0
- package/dist/module/components/input/input.js +15 -0
- package/dist/module/components/input/input.js.map +1 -0
- package/dist/module/components/input/numeric-input.js +57 -0
- package/dist/module/components/input/numeric-input.js.map +1 -0
- package/dist/module/components/input/variants/default.js +41 -0
- package/dist/module/components/input/variants/default.js.map +1 -0
- package/dist/module/components/input/variants/index.js +7 -0
- package/dist/module/components/input/variants/index.js.map +1 -0
- package/dist/module/components/link/link.js +25 -0
- package/dist/module/components/link/link.js.map +1 -0
- package/dist/module/components/link/variants/default.js +18 -0
- package/dist/module/components/link/variants/default.js.map +1 -0
- package/dist/module/components/link/variants/index.js +7 -0
- package/dist/module/components/link/variants/index.js.map +1 -0
- package/dist/module/components/popover/popover.js +39 -0
- package/dist/module/components/popover/popover.js.map +1 -0
- package/dist/module/components/popover/variants/default.js +30 -0
- package/dist/module/components/popover/variants/default.js.map +1 -0
- package/dist/module/components/popover/variants/index.js +9 -0
- package/dist/module/components/popover/variants/index.js.map +1 -0
- package/dist/module/components/popover/variants/unstyled.js +12 -0
- package/dist/module/components/popover/variants/unstyled.js.map +1 -0
- package/dist/module/components/select/select.js +25 -0
- package/dist/module/components/select/select.js.map +1 -0
- package/dist/module/components/select/variants/default.js +85 -0
- package/dist/module/components/select/variants/default.js.map +1 -0
- package/dist/module/components/select/variants/index.js +7 -0
- package/dist/module/components/select/variants/index.js.map +1 -0
- package/dist/module/components/textarea/textarea.js +15 -0
- package/dist/module/components/textarea/textarea.js.map +1 -0
- package/dist/module/components/textarea/variants/default.js +42 -0
- package/dist/module/components/textarea/variants/default.js.map +1 -0
- package/dist/module/components/textarea/variants/index.js +7 -0
- package/dist/module/components/textarea/variants/index.js.map +1 -0
- package/dist/module/components/toast/index.js +9 -0
- package/dist/module/components/toast/index.js.map +1 -0
- package/dist/module/components/toast/toast-manager.js +78 -0
- package/dist/module/components/toast/toast-manager.js.map +1 -0
- package/dist/module/components/toast/toast.js +19 -0
- package/dist/module/components/toast/toast.js.map +1 -0
- package/dist/module/components/toast/variants/danger.js +35 -0
- package/dist/module/components/toast/variants/danger.js.map +1 -0
- package/dist/module/components/toast/variants/default.js +34 -0
- package/dist/module/components/toast/variants/default.js.map +1 -0
- package/dist/module/components/toast/variants/index.js +11 -0
- package/dist/module/components/toast/variants/index.js.map +1 -0
- package/dist/module/components/toast/variants/success.js +35 -0
- package/dist/module/components/toast/variants/success.js.map +1 -0
- package/dist/module/components/typography/typography.js +15 -0
- package/dist/module/components/typography/typography.js.map +1 -0
- package/dist/module/components/typography/variants/body-lg.js +17 -0
- package/dist/module/components/typography/variants/body-lg.js.map +1 -0
- package/dist/module/components/typography/variants/body-md.js +17 -0
- package/dist/module/components/typography/variants/body-md.js.map +1 -0
- package/dist/module/components/typography/variants/body-sm.js +17 -0
- package/dist/module/components/typography/variants/body-sm.js.map +1 -0
- package/dist/module/components/typography/variants/heading-lg.js +18 -0
- package/dist/module/components/typography/variants/heading-lg.js.map +1 -0
- package/dist/module/components/typography/variants/heading-md.js +18 -0
- package/dist/module/components/typography/variants/heading-md.js.map +1 -0
- package/dist/module/components/typography/variants/heading-sm.js +18 -0
- package/dist/module/components/typography/variants/heading-sm.js.map +1 -0
- package/dist/module/components/typography/variants/index.js +17 -0
- package/dist/module/components/typography/variants/index.js.map +1 -0
- package/dist/module/hooks/index.js +7 -0
- package/dist/module/hooks/index.js.map +1 -0
- package/dist/module/hooks/use-currency-mask.js +101 -0
- package/dist/module/hooks/use-currency-mask.js.map +1 -0
- package/dist/module/hooks/use-numeric-mask.js +154 -0
- package/dist/module/hooks/use-numeric-mask.js.map +1 -0
- package/dist/module/hooks/use-relative-position.js +155 -0
- package/dist/module/hooks/use-relative-position.js.map +1 -0
- package/dist/module/hooks/use-screen-size.js +30 -0
- package/dist/module/hooks/use-screen-size.js.map +1 -0
- package/dist/module/index.js +20 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/primitives/avatar/avatar-fallback.js +16 -0
- package/dist/module/primitives/avatar/avatar-fallback.js.map +1 -0
- package/dist/module/primitives/avatar/avatar-image.js +16 -0
- package/dist/module/primitives/avatar/avatar-image.js.map +1 -0
- package/dist/module/primitives/avatar/avatar-root.js +20 -0
- package/dist/module/primitives/avatar/avatar-root.js.map +1 -0
- package/dist/module/primitives/avatar/context.js +12 -0
- package/dist/module/primitives/avatar/context.js.map +1 -0
- package/dist/module/primitives/avatar/index.js +11 -0
- package/dist/module/primitives/avatar/index.js.map +1 -0
- package/dist/module/primitives/avatar/types.js +4 -0
- package/dist/module/primitives/avatar/types.js.map +1 -0
- package/dist/module/primitives/badge/badge-label.js +17 -0
- package/dist/module/primitives/badge/badge-label.js.map +1 -0
- package/dist/module/primitives/badge/badge-root.js +22 -0
- package/dist/module/primitives/badge/badge-root.js.map +1 -0
- package/dist/module/primitives/badge/context.js +12 -0
- package/dist/module/primitives/badge/context.js.map +1 -0
- package/dist/module/primitives/badge/index.js +9 -0
- package/dist/module/primitives/badge/index.js.map +1 -0
- package/dist/module/primitives/badge/types.js +4 -0
- package/dist/module/primitives/badge/types.js.map +1 -0
- package/dist/module/primitives/button/button-context.js +12 -0
- package/dist/module/primitives/button/button-context.js.map +1 -0
- package/dist/module/primitives/button/button-label.js +17 -0
- package/dist/module/primitives/button/button-label.js.map +1 -0
- package/dist/module/primitives/button/button-root.js +38 -0
- package/dist/module/primitives/button/button-root.js.map +1 -0
- package/dist/module/primitives/button/button-spinner.js +15 -0
- package/dist/module/primitives/button/button-spinner.js.map +1 -0
- package/dist/module/primitives/button/index.js +12 -0
- package/dist/module/primitives/button/index.js.map +1 -0
- package/dist/module/primitives/button/types.js +4 -0
- package/dist/module/primitives/button/types.js.map +1 -0
- package/dist/module/primitives/calendar/calendar-day.js +45 -0
- package/dist/module/primitives/calendar/calendar-day.js.map +1 -0
- package/dist/module/primitives/calendar/calendar-header.js +23 -0
- package/dist/module/primitives/calendar/calendar-header.js.map +1 -0
- package/dist/module/primitives/calendar/calendar-nav-button.js +61 -0
- package/dist/module/primitives/calendar/calendar-nav-button.js.map +1 -0
- package/dist/module/primitives/calendar/calendar-root.js +38 -0
- package/dist/module/primitives/calendar/calendar-root.js.map +1 -0
- package/dist/module/primitives/calendar/calendar-title.js +26 -0
- package/dist/module/primitives/calendar/calendar-title.js.map +1 -0
- package/dist/module/primitives/calendar/calendar-week-labels.js +36 -0
- package/dist/module/primitives/calendar/calendar-week-labels.js.map +1 -0
- package/dist/module/primitives/calendar/calendar-weeks.js +48 -0
- package/dist/module/primitives/calendar/calendar-weeks.js.map +1 -0
- package/dist/module/primitives/calendar/context.js +12 -0
- package/dist/module/primitives/calendar/context.js.map +1 -0
- package/dist/module/primitives/calendar/index.js +19 -0
- package/dist/module/primitives/calendar/index.js.map +1 -0
- package/dist/module/primitives/calendar/types.js +4 -0
- package/dist/module/primitives/calendar/types.js.map +1 -0
- package/dist/module/primitives/card/card-body.js +17 -0
- package/dist/module/primitives/card/card-body.js.map +1 -0
- package/dist/module/primitives/card/card-footer.js +17 -0
- package/dist/module/primitives/card/card-footer.js.map +1 -0
- package/dist/module/primitives/card/card-header.js +17 -0
- package/dist/module/primitives/card/card-header.js.map +1 -0
- package/dist/module/primitives/card/card-root.js +22 -0
- package/dist/module/primitives/card/card-root.js.map +1 -0
- package/dist/module/primitives/card/card-title.js +17 -0
- package/dist/module/primitives/card/card-title.js.map +1 -0
- package/dist/module/primitives/card/context.js +12 -0
- package/dist/module/primitives/card/context.js.map +1 -0
- package/dist/module/primitives/card/index.js +15 -0
- package/dist/module/primitives/card/index.js.map +1 -0
- package/dist/module/primitives/card/types.js +4 -0
- package/dist/module/primitives/card/types.js.map +1 -0
- package/dist/module/primitives/dropdown-menu/context.js +12 -0
- package/dist/module/primitives/dropdown-menu/context.js.map +1 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-button.js +32 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-button.js.map +1 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-content.js +29 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-content.js.map +1 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-divider.js +16 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-divider.js.map +1 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-overlay.js +19 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-overlay.js.map +1 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-portal.js +20 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-portal.js.map +1 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-root.js +24 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-root.js.map +1 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-trigger.js +36 -0
- package/dist/module/primitives/dropdown-menu/dropdown-menu-trigger.js.map +1 -0
- package/dist/module/primitives/dropdown-menu/index.js +19 -0
- package/dist/module/primitives/dropdown-menu/index.js.map +1 -0
- package/dist/module/primitives/dropdown-menu/types.js +4 -0
- package/dist/module/primitives/dropdown-menu/types.js.map +1 -0
- package/dist/module/primitives/empty/context.js +12 -0
- package/dist/module/primitives/empty/context.js.map +1 -0
- package/dist/module/primitives/empty/empty-description.js +16 -0
- package/dist/module/primitives/empty/empty-description.js.map +1 -0
- package/dist/module/primitives/empty/empty-media.js +16 -0
- package/dist/module/primitives/empty/empty-media.js.map +1 -0
- package/dist/module/primitives/empty/empty-root.js +20 -0
- package/dist/module/primitives/empty/empty-root.js.map +1 -0
- package/dist/module/primitives/empty/empty-title.js +16 -0
- package/dist/module/primitives/empty/empty-title.js.map +1 -0
- package/dist/module/primitives/empty/index.js +13 -0
- package/dist/module/primitives/empty/index.js.map +1 -0
- package/dist/module/primitives/empty/types.js +4 -0
- package/dist/module/primitives/empty/types.js.map +1 -0
- package/dist/module/primitives/field/context.js +15 -0
- package/dist/module/primitives/field/context.js.map +1 -0
- package/dist/module/primitives/field/field-description.js +15 -0
- package/dist/module/primitives/field/field-description.js.map +1 -0
- package/dist/module/primitives/field/field-error.js +15 -0
- package/dist/module/primitives/field/field-error.js.map +1 -0
- package/dist/module/primitives/field/field-label.js +16 -0
- package/dist/module/primitives/field/field-label.js.map +1 -0
- package/dist/module/primitives/field/field-root.js +22 -0
- package/dist/module/primitives/field/field-root.js.map +1 -0
- package/dist/module/primitives/field/index.js +13 -0
- package/dist/module/primitives/field/index.js.map +1 -0
- package/dist/module/primitives/field/types.js +4 -0
- package/dist/module/primitives/field/types.js.map +1 -0
- package/dist/module/primitives/index.js +17 -0
- package/dist/module/primitives/index.js.map +1 -0
- package/dist/module/primitives/input/index.js +4 -0
- package/dist/module/primitives/input/index.js.map +1 -0
- package/dist/module/primitives/input/input.js +46 -0
- package/dist/module/primitives/input/input.js.map +1 -0
- package/dist/module/primitives/input/types.js +4 -0
- package/dist/module/primitives/input/types.js.map +1 -0
- package/dist/module/primitives/popover/context.js +12 -0
- package/dist/module/primitives/popover/context.js.map +1 -0
- package/dist/module/primitives/popover/index.js +18 -0
- package/dist/module/primitives/popover/index.js.map +1 -0
- package/dist/module/primitives/popover/popover-close.js +19 -0
- package/dist/module/primitives/popover/popover-close.js.map +1 -0
- package/dist/module/primitives/popover/popover-content.js +30 -0
- package/dist/module/primitives/popover/popover-content.js.map +1 -0
- package/dist/module/primitives/popover/popover-overlay.js +27 -0
- package/dist/module/primitives/popover/popover-overlay.js.map +1 -0
- package/dist/module/primitives/popover/popover-portal.js +20 -0
- package/dist/module/primitives/popover/popover-portal.js.map +1 -0
- package/dist/module/primitives/popover/popover-root.js +24 -0
- package/dist/module/primitives/popover/popover-root.js.map +1 -0
- package/dist/module/primitives/popover/popover-trigger.js +36 -0
- package/dist/module/primitives/popover/popover-trigger.js.map +1 -0
- package/dist/module/primitives/popover/types.js +4 -0
- package/dist/module/primitives/popover/types.js.map +1 -0
- package/dist/module/primitives/portal/index.js +5 -0
- package/dist/module/primitives/portal/index.js.map +1 -0
- package/dist/module/primitives/portal/portal.constants.js +4 -0
- package/dist/module/primitives/portal/portal.constants.js.map +1 -0
- package/dist/module/primitives/portal/portal.js +112 -0
- package/dist/module/primitives/portal/portal.js.map +1 -0
- package/dist/module/primitives/select/context.js +12 -0
- package/dist/module/primitives/select/context.js.map +1 -0
- package/dist/module/primitives/select/index.js +19 -0
- package/dist/module/primitives/select/index.js.map +1 -0
- package/dist/module/primitives/select/select-content.js +22 -0
- package/dist/module/primitives/select/select-content.js.map +1 -0
- package/dist/module/primitives/select/select-option.js +50 -0
- package/dist/module/primitives/select/select-option.js.map +1 -0
- package/dist/module/primitives/select/select-overlay.js +20 -0
- package/dist/module/primitives/select/select-overlay.js.map +1 -0
- package/dist/module/primitives/select/select-portal.js +25 -0
- package/dist/module/primitives/select/select-portal.js.map +1 -0
- package/dist/module/primitives/select/select-root.js +42 -0
- package/dist/module/primitives/select/select-root.js.map +1 -0
- package/dist/module/primitives/select/select-trigger.js +26 -0
- package/dist/module/primitives/select/select-trigger.js.map +1 -0
- package/dist/module/primitives/select/select-value.js +19 -0
- package/dist/module/primitives/select/select-value.js.map +1 -0
- package/dist/module/primitives/select/types.js +4 -0
- package/dist/module/primitives/select/types.js.map +1 -0
- package/dist/module/primitives/textarea/index.js +4 -0
- package/dist/module/primitives/textarea/index.js.map +1 -0
- package/dist/module/primitives/textarea/textarea.js +42 -0
- package/dist/module/primitives/textarea/textarea.js.map +1 -0
- package/dist/module/primitives/textarea/types.js +4 -0
- package/dist/module/primitives/textarea/types.js.map +1 -0
- package/dist/module/primitives/toast/context.js +12 -0
- package/dist/module/primitives/toast/context.js.map +1 -0
- package/dist/module/primitives/toast/index.js +11 -0
- package/dist/module/primitives/toast/index.js.map +1 -0
- package/dist/module/primitives/toast/toast-description.js +16 -0
- package/dist/module/primitives/toast/toast-description.js.map +1 -0
- package/dist/module/primitives/toast/toast-root.js +20 -0
- package/dist/module/primitives/toast/toast-root.js.map +1 -0
- package/dist/module/primitives/toast/toast-title.js +16 -0
- package/dist/module/primitives/toast/toast-title.js.map +1 -0
- package/dist/module/primitives/toast/types.js +4 -0
- package/dist/module/primitives/toast/types.js.map +1 -0
- package/dist/module/themes/adapters/index.js +4 -0
- package/dist/module/themes/adapters/index.js.map +1 -0
- package/dist/module/themes/adapters/react-navigation.js +52 -0
- package/dist/module/themes/adapters/react-navigation.js.map +1 -0
- package/dist/module/themes/default/colors.js +35 -0
- package/dist/module/themes/default/colors.js.map +1 -0
- package/dist/module/themes/default/index.js +14 -0
- package/dist/module/themes/default/index.js.map +1 -0
- package/dist/module/themes/index.js +6 -0
- package/dist/module/themes/index.js.map +1 -0
- package/dist/module/themes/provider.js +41 -0
- package/dist/module/themes/provider.js.map +1 -0
- package/dist/module/themes/themes.js +7 -0
- package/dist/module/themes/themes.js.map +1 -0
- package/dist/module/themes/types.js +2 -0
- package/dist/module/themes/types.js.map +1 -0
- package/dist/module/types/element.types.js +4 -0
- package/dist/module/types/element.types.js.map +1 -0
- package/dist/module/utils/calculate-styles.js +17 -0
- package/dist/module/utils/calculate-styles.js.map +1 -0
- package/dist/module/utils/date-utils.js +95 -0
- package/dist/module/utils/date-utils.js.map +1 -0
- package/dist/module/utils/hsla-utils.js +33 -0
- package/dist/module/utils/hsla-utils.js.map +1 -0
- package/dist/module/utils/normalize-layout.js +16 -0
- package/dist/module/utils/normalize-layout.js.map +1 -0
- package/dist/module/utils/use-themed-styles.js +14 -0
- package/dist/module/utils/use-themed-styles.js.map +1 -0
- package/dist/typescript/babel.config.d.ts +10 -0
- package/dist/typescript/babel.config.d.ts.map +1 -0
- package/dist/typescript/bob.config.d.ts +6 -0
- package/dist/typescript/bob.config.d.ts.map +1 -0
- package/dist/typescript/package.json +1 -0
- package/dist/typescript/src/components/avatar/avatar.d.ts +10 -0
- package/dist/typescript/src/components/avatar/avatar.d.ts.map +1 -0
- package/dist/typescript/src/components/avatar/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/avatar/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/avatar/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/avatar/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/badge/badge.d.ts +10 -0
- package/dist/typescript/src/components/badge/badge.d.ts.map +1 -0
- package/dist/typescript/src/components/badge/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/badge/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/badge/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/badge/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/badge/variants/secondary.d.ts +3 -0
- package/dist/typescript/src/components/badge/variants/secondary.d.ts.map +1 -0
- package/dist/typescript/src/components/button/button.d.ts +14 -0
- package/dist/typescript/src/components/button/button.d.ts.map +1 -0
- package/dist/typescript/src/components/button/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/button/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/button/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/button/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/button/variants/secondary.d.ts +3 -0
- package/dist/typescript/src/components/button/variants/secondary.d.ts.map +1 -0
- package/dist/typescript/src/components/calendar/calendar.d.ts +14 -0
- package/dist/typescript/src/components/calendar/calendar.d.ts.map +1 -0
- package/dist/typescript/src/components/calendar/index.d.ts +2 -0
- package/dist/typescript/src/components/calendar/index.d.ts.map +1 -0
- package/dist/typescript/src/components/calendar/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/calendar/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/calendar/variants/index.d.ts +4 -0
- package/dist/typescript/src/components/calendar/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/card/card.d.ts +10 -0
- package/dist/typescript/src/components/card/card.d.ts.map +1 -0
- package/dist/typescript/src/components/card/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/card/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/card/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/card/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/dropdown-menu/dropdown-menu.d.ts +18 -0
- package/dist/typescript/src/components/dropdown-menu/dropdown-menu.d.ts.map +1 -0
- package/dist/typescript/src/components/dropdown-menu/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/dropdown-menu/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/dropdown-menu/variants/index.d.ts +4 -0
- package/dist/typescript/src/components/dropdown-menu/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/empty/empty.d.ts +11 -0
- package/dist/typescript/src/components/empty/empty.d.ts.map +1 -0
- package/dist/typescript/src/components/empty/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/empty/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/empty/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/empty/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/field/field.d.ts +12 -0
- package/dist/typescript/src/components/field/field.d.ts.map +1 -0
- package/dist/typescript/src/components/field/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/field/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/field/variants/index.d.ts +4 -0
- package/dist/typescript/src/components/field/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/index.d.ts +16 -0
- package/dist/typescript/src/components/index.d.ts.map +1 -0
- package/dist/typescript/src/components/input/index.d.ts +3 -0
- package/dist/typescript/src/components/input/index.d.ts.map +1 -0
- package/dist/typescript/src/components/input/input.d.ts +9 -0
- package/dist/typescript/src/components/input/input.d.ts.map +1 -0
- package/dist/typescript/src/components/input/numeric-input.d.ts +17 -0
- package/dist/typescript/src/components/input/numeric-input.d.ts.map +1 -0
- package/dist/typescript/src/components/input/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/input/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/input/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/input/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/link/link.d.ts +9 -0
- package/dist/typescript/src/components/link/link.d.ts.map +1 -0
- package/dist/typescript/src/components/link/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/link/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/link/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/link/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/popover/popover.d.ts +16 -0
- package/dist/typescript/src/components/popover/popover.d.ts.map +1 -0
- package/dist/typescript/src/components/popover/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/popover/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/popover/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/popover/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/popover/variants/unstyled.d.ts +3 -0
- package/dist/typescript/src/components/popover/variants/unstyled.d.ts.map +1 -0
- package/dist/typescript/src/components/select/select.d.ts +13 -0
- package/dist/typescript/src/components/select/select.d.ts.map +1 -0
- package/dist/typescript/src/components/select/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/select/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/select/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/select/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/textarea/textarea.d.ts +9 -0
- package/dist/typescript/src/components/textarea/textarea.d.ts.map +1 -0
- package/dist/typescript/src/components/textarea/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/textarea/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/textarea/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/textarea/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/toast/index.d.ts +6 -0
- package/dist/typescript/src/components/toast/index.d.ts.map +1 -0
- package/dist/typescript/src/components/toast/toast-manager.d.ts +19 -0
- package/dist/typescript/src/components/toast/toast-manager.d.ts.map +1 -0
- package/dist/typescript/src/components/toast/toast.d.ts +10 -0
- package/dist/typescript/src/components/toast/toast.d.ts.map +1 -0
- package/dist/typescript/src/components/toast/variants/danger.d.ts +3 -0
- package/dist/typescript/src/components/toast/variants/danger.d.ts.map +1 -0
- package/dist/typescript/src/components/toast/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/toast/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/toast/variants/index.d.ts +6 -0
- package/dist/typescript/src/components/toast/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/toast/variants/success.d.ts +3 -0
- package/dist/typescript/src/components/toast/variants/success.d.ts.map +1 -0
- package/dist/typescript/src/components/typography/typography.d.ts +8 -0
- package/dist/typescript/src/components/typography/typography.d.ts.map +1 -0
- package/dist/typescript/src/components/typography/variants/body-lg.d.ts +3 -0
- package/dist/typescript/src/components/typography/variants/body-lg.d.ts.map +1 -0
- package/dist/typescript/src/components/typography/variants/body-md.d.ts +3 -0
- package/dist/typescript/src/components/typography/variants/body-md.d.ts.map +1 -0
- package/dist/typescript/src/components/typography/variants/body-sm.d.ts +3 -0
- package/dist/typescript/src/components/typography/variants/body-sm.d.ts.map +1 -0
- package/dist/typescript/src/components/typography/variants/heading-lg.d.ts +3 -0
- package/dist/typescript/src/components/typography/variants/heading-lg.d.ts.map +1 -0
- package/dist/typescript/src/components/typography/variants/heading-md.d.ts +3 -0
- package/dist/typescript/src/components/typography/variants/heading-md.d.ts.map +1 -0
- package/dist/typescript/src/components/typography/variants/heading-sm.d.ts +3 -0
- package/dist/typescript/src/components/typography/variants/heading-sm.d.ts.map +1 -0
- package/dist/typescript/src/components/typography/variants/index.d.ts +15 -0
- package/dist/typescript/src/components/typography/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/hooks/index.d.ts +5 -0
- package/dist/typescript/src/hooks/index.d.ts.map +1 -0
- package/dist/typescript/src/hooks/use-currency-mask.d.ts +19 -0
- package/dist/typescript/src/hooks/use-currency-mask.d.ts.map +1 -0
- package/dist/typescript/src/hooks/use-numeric-mask.d.ts +22 -0
- package/dist/typescript/src/hooks/use-numeric-mask.d.ts.map +1 -0
- package/dist/typescript/src/hooks/use-relative-position.d.ts +50 -0
- package/dist/typescript/src/hooks/use-relative-position.d.ts.map +1 -0
- package/dist/typescript/src/hooks/use-screen-size.d.ts +22 -0
- package/dist/typescript/src/hooks/use-screen-size.d.ts.map +1 -0
- package/dist/typescript/src/index.d.ts +10 -0
- package/dist/typescript/src/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/avatar/avatar-fallback.d.ts +9 -0
- package/dist/typescript/src/primitives/avatar/avatar-fallback.d.ts.map +1 -0
- package/dist/typescript/src/primitives/avatar/avatar-image.d.ts +10 -0
- package/dist/typescript/src/primitives/avatar/avatar-image.d.ts.map +1 -0
- package/dist/typescript/src/primitives/avatar/avatar-root.d.ts +11 -0
- package/dist/typescript/src/primitives/avatar/avatar-root.d.ts.map +1 -0
- package/dist/typescript/src/primitives/avatar/context.d.ts +7 -0
- package/dist/typescript/src/primitives/avatar/context.d.ts.map +1 -0
- package/dist/typescript/src/primitives/avatar/index.d.ts +13 -0
- package/dist/typescript/src/primitives/avatar/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/avatar/types.d.ts +9 -0
- package/dist/typescript/src/primitives/avatar/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/badge/badge-label.d.ts +9 -0
- package/dist/typescript/src/primitives/badge/badge-label.d.ts.map +1 -0
- package/dist/typescript/src/primitives/badge/badge-root.d.ts +11 -0
- package/dist/typescript/src/primitives/badge/badge-root.d.ts.map +1 -0
- package/dist/typescript/src/primitives/badge/context.d.ts +8 -0
- package/dist/typescript/src/primitives/badge/context.d.ts.map +1 -0
- package/dist/typescript/src/primitives/badge/index.d.ts +10 -0
- package/dist/typescript/src/primitives/badge/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/badge/types.d.ts +8 -0
- package/dist/typescript/src/primitives/badge/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/button/button-context.d.ts +9 -0
- package/dist/typescript/src/primitives/button/button-context.d.ts.map +1 -0
- package/dist/typescript/src/primitives/button/button-label.d.ts +9 -0
- package/dist/typescript/src/primitives/button/button-label.d.ts.map +1 -0
- package/dist/typescript/src/primitives/button/button-root.d.ts +13 -0
- package/dist/typescript/src/primitives/button/button-root.d.ts.map +1 -0
- package/dist/typescript/src/primitives/button/button-spinner.d.ts +8 -0
- package/dist/typescript/src/primitives/button/button-spinner.d.ts.map +1 -0
- package/dist/typescript/src/primitives/button/index.d.ts +12 -0
- package/dist/typescript/src/primitives/button/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/button/types.d.ts +9 -0
- package/dist/typescript/src/primitives/button/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/calendar/calendar-day.d.ts +10 -0
- package/dist/typescript/src/primitives/calendar/calendar-day.d.ts.map +1 -0
- package/dist/typescript/src/primitives/calendar/calendar-header.d.ts +8 -0
- package/dist/typescript/src/primitives/calendar/calendar-header.d.ts.map +1 -0
- package/dist/typescript/src/primitives/calendar/calendar-nav-button.d.ts +10 -0
- package/dist/typescript/src/primitives/calendar/calendar-nav-button.d.ts.map +1 -0
- package/dist/typescript/src/primitives/calendar/calendar-root.d.ts +15 -0
- package/dist/typescript/src/primitives/calendar/calendar-root.d.ts.map +1 -0
- package/dist/typescript/src/primitives/calendar/calendar-title.d.ts +9 -0
- package/dist/typescript/src/primitives/calendar/calendar-title.d.ts.map +1 -0
- package/dist/typescript/src/primitives/calendar/calendar-week-labels.d.ts +12 -0
- package/dist/typescript/src/primitives/calendar/calendar-week-labels.d.ts.map +1 -0
- package/dist/typescript/src/primitives/calendar/calendar-weeks.d.ts +11 -0
- package/dist/typescript/src/primitives/calendar/calendar-weeks.d.ts.map +1 -0
- package/dist/typescript/src/primitives/calendar/context.d.ts +14 -0
- package/dist/typescript/src/primitives/calendar/context.d.ts.map +1 -0
- package/dist/typescript/src/primitives/calendar/index.d.ts +25 -0
- package/dist/typescript/src/primitives/calendar/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/calendar/types.d.ts +37 -0
- package/dist/typescript/src/primitives/calendar/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/card/card-body.d.ts +9 -0
- package/dist/typescript/src/primitives/card/card-body.d.ts.map +1 -0
- package/dist/typescript/src/primitives/card/card-footer.d.ts +9 -0
- package/dist/typescript/src/primitives/card/card-footer.d.ts.map +1 -0
- package/dist/typescript/src/primitives/card/card-header.d.ts +9 -0
- package/dist/typescript/src/primitives/card/card-header.d.ts.map +1 -0
- package/dist/typescript/src/primitives/card/card-root.d.ts +11 -0
- package/dist/typescript/src/primitives/card/card-root.d.ts.map +1 -0
- package/dist/typescript/src/primitives/card/card-title.d.ts +9 -0
- package/dist/typescript/src/primitives/card/card-title.d.ts.map +1 -0
- package/dist/typescript/src/primitives/card/context.d.ts +8 -0
- package/dist/typescript/src/primitives/card/context.d.ts.map +1 -0
- package/dist/typescript/src/primitives/card/index.d.ts +19 -0
- package/dist/typescript/src/primitives/card/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/card/types.d.ts +14 -0
- package/dist/typescript/src/primitives/card/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/dropdown-menu/context.d.ts +16 -0
- package/dist/typescript/src/primitives/dropdown-menu/context.d.ts.map +1 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-button.d.ts +12 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-button.d.ts.map +1 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-content.d.ts +9 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-content.d.ts.map +1 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-divider.d.ts +8 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-divider.d.ts.map +1 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-overlay.d.ts +9 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-overlay.d.ts.map +1 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-portal.d.ts +6 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-portal.d.ts.map +1 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-root.d.ts +9 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-root.d.ts.map +1 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-trigger.d.ts +12 -0
- package/dist/typescript/src/primitives/dropdown-menu/dropdown-menu-trigger.d.ts.map +1 -0
- package/dist/typescript/src/primitives/dropdown-menu/index.d.ts +24 -0
- package/dist/typescript/src/primitives/dropdown-menu/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/dropdown-menu/types.d.ts +12 -0
- package/dist/typescript/src/primitives/dropdown-menu/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/empty/context.d.ts +7 -0
- package/dist/typescript/src/primitives/empty/context.d.ts.map +1 -0
- package/dist/typescript/src/primitives/empty/empty-description.d.ts +9 -0
- package/dist/typescript/src/primitives/empty/empty-description.d.ts.map +1 -0
- package/dist/typescript/src/primitives/empty/empty-media.d.ts +9 -0
- package/dist/typescript/src/primitives/empty/empty-media.d.ts.map +1 -0
- package/dist/typescript/src/primitives/empty/empty-root.d.ts +11 -0
- package/dist/typescript/src/primitives/empty/empty-root.d.ts.map +1 -0
- package/dist/typescript/src/primitives/empty/empty-title.d.ts +9 -0
- package/dist/typescript/src/primitives/empty/empty-title.d.ts.map +1 -0
- package/dist/typescript/src/primitives/empty/index.d.ts +16 -0
- package/dist/typescript/src/primitives/empty/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/empty/types.d.ts +11 -0
- package/dist/typescript/src/primitives/empty/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/field/context.d.ts +9 -0
- package/dist/typescript/src/primitives/field/context.d.ts.map +1 -0
- package/dist/typescript/src/primitives/field/field-description.d.ts +9 -0
- package/dist/typescript/src/primitives/field/field-description.d.ts.map +1 -0
- package/dist/typescript/src/primitives/field/field-error.d.ts +9 -0
- package/dist/typescript/src/primitives/field/field-error.d.ts.map +1 -0
- package/dist/typescript/src/primitives/field/field-label.d.ts +10 -0
- package/dist/typescript/src/primitives/field/field-label.d.ts.map +1 -0
- package/dist/typescript/src/primitives/field/field-root.d.ts +11 -0
- package/dist/typescript/src/primitives/field/field-root.d.ts.map +1 -0
- package/dist/typescript/src/primitives/field/index.d.ts +16 -0
- package/dist/typescript/src/primitives/field/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/field/types.d.ts +11 -0
- package/dist/typescript/src/primitives/field/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/index.d.ts +15 -0
- package/dist/typescript/src/primitives/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/input/index.d.ts +3 -0
- package/dist/typescript/src/primitives/input/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/input/input.d.ts +14 -0
- package/dist/typescript/src/primitives/input/input.d.ts.map +1 -0
- package/dist/typescript/src/primitives/input/types.d.ts +4 -0
- package/dist/typescript/src/primitives/input/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/popover/context.d.ts +16 -0
- package/dist/typescript/src/primitives/popover/context.d.ts.map +1 -0
- package/dist/typescript/src/primitives/popover/index.d.ts +22 -0
- package/dist/typescript/src/primitives/popover/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/popover/popover-close.d.ts +10 -0
- package/dist/typescript/src/primitives/popover/popover-close.d.ts.map +1 -0
- package/dist/typescript/src/primitives/popover/popover-content.d.ts +9 -0
- package/dist/typescript/src/primitives/popover/popover-content.d.ts.map +1 -0
- package/dist/typescript/src/primitives/popover/popover-overlay.d.ts +10 -0
- package/dist/typescript/src/primitives/popover/popover-overlay.d.ts.map +1 -0
- package/dist/typescript/src/primitives/popover/popover-portal.d.ts +6 -0
- package/dist/typescript/src/primitives/popover/popover-portal.d.ts.map +1 -0
- package/dist/typescript/src/primitives/popover/popover-root.d.ts +9 -0
- package/dist/typescript/src/primitives/popover/popover-root.d.ts.map +1 -0
- package/dist/typescript/src/primitives/popover/popover-trigger.d.ts +12 -0
- package/dist/typescript/src/primitives/popover/popover-trigger.d.ts.map +1 -0
- package/dist/typescript/src/primitives/popover/types.d.ts +7 -0
- package/dist/typescript/src/primitives/popover/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/portal/index.d.ts +3 -0
- package/dist/typescript/src/primitives/portal/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/portal/portal.constants.d.ts +14 -0
- package/dist/typescript/src/primitives/portal/portal.constants.d.ts.map +1 -0
- package/dist/typescript/src/primitives/portal/portal.d.ts +7 -0
- package/dist/typescript/src/primitives/portal/portal.d.ts.map +1 -0
- package/dist/typescript/src/primitives/select/context.d.ts +20 -0
- package/dist/typescript/src/primitives/select/context.d.ts.map +1 -0
- package/dist/typescript/src/primitives/select/index.d.ts +25 -0
- package/dist/typescript/src/primitives/select/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/select/select-content.d.ts +9 -0
- package/dist/typescript/src/primitives/select/select-content.d.ts.map +1 -0
- package/dist/typescript/src/primitives/select/select-option.d.ts +11 -0
- package/dist/typescript/src/primitives/select/select-option.d.ts.map +1 -0
- package/dist/typescript/src/primitives/select/select-overlay.d.ts +10 -0
- package/dist/typescript/src/primitives/select/select-overlay.d.ts.map +1 -0
- package/dist/typescript/src/primitives/select/select-portal.d.ts +6 -0
- package/dist/typescript/src/primitives/select/select-portal.d.ts.map +1 -0
- package/dist/typescript/src/primitives/select/select-root.d.ts +21 -0
- package/dist/typescript/src/primitives/select/select-root.d.ts.map +1 -0
- package/dist/typescript/src/primitives/select/select-trigger.d.ts +13 -0
- package/dist/typescript/src/primitives/select/select-trigger.d.ts.map +1 -0
- package/dist/typescript/src/primitives/select/select-value.d.ts +8 -0
- package/dist/typescript/src/primitives/select/select-value.d.ts.map +1 -0
- package/dist/typescript/src/primitives/select/types.d.ts +22 -0
- package/dist/typescript/src/primitives/select/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/textarea/index.d.ts +3 -0
- package/dist/typescript/src/primitives/textarea/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/textarea/textarea.d.ts +12 -0
- package/dist/typescript/src/primitives/textarea/textarea.d.ts.map +1 -0
- package/dist/typescript/src/primitives/textarea/types.d.ts +4 -0
- package/dist/typescript/src/primitives/textarea/types.d.ts.map +1 -0
- package/dist/typescript/src/primitives/toast/context.d.ts +7 -0
- package/dist/typescript/src/primitives/toast/context.d.ts.map +1 -0
- package/dist/typescript/src/primitives/toast/index.d.ts +13 -0
- package/dist/typescript/src/primitives/toast/index.d.ts.map +1 -0
- package/dist/typescript/src/primitives/toast/toast-description.d.ts +9 -0
- package/dist/typescript/src/primitives/toast/toast-description.d.ts.map +1 -0
- package/dist/typescript/src/primitives/toast/toast-root.d.ts +11 -0
- package/dist/typescript/src/primitives/toast/toast-root.d.ts.map +1 -0
- package/dist/typescript/src/primitives/toast/toast-title.d.ts +9 -0
- package/dist/typescript/src/primitives/toast/toast-title.d.ts.map +1 -0
- package/dist/typescript/src/primitives/toast/types.d.ts +9 -0
- package/dist/typescript/src/primitives/toast/types.d.ts.map +1 -0
- package/dist/typescript/src/themes/adapters/index.d.ts +2 -0
- package/dist/typescript/src/themes/adapters/index.d.ts.map +1 -0
- package/dist/typescript/src/themes/adapters/react-navigation.d.ts +3 -0
- package/dist/typescript/src/themes/adapters/react-navigation.d.ts.map +1 -0
- package/dist/typescript/src/themes/default/colors.d.ts +4 -0
- package/dist/typescript/src/themes/default/colors.d.ts.map +1 -0
- package/dist/typescript/src/themes/default/index.d.ts +3 -0
- package/dist/typescript/src/themes/default/index.d.ts.map +1 -0
- package/dist/typescript/src/themes/index.d.ts +4 -0
- package/dist/typescript/src/themes/index.d.ts.map +1 -0
- package/dist/typescript/src/themes/provider.d.ts +18 -0
- package/dist/typescript/src/themes/provider.d.ts.map +1 -0
- package/dist/typescript/src/themes/themes.d.ts +3 -0
- package/dist/typescript/src/themes/themes.d.ts.map +1 -0
- package/dist/typescript/src/themes/types.d.ts +32 -0
- package/dist/typescript/src/themes/types.d.ts.map +1 -0
- package/dist/typescript/src/types/element.types.d.ts +4 -0
- package/dist/typescript/src/types/element.types.d.ts.map +1 -0
- package/dist/typescript/src/utils/calculate-styles.d.ts +2 -0
- package/dist/typescript/src/utils/calculate-styles.d.ts.map +1 -0
- package/dist/typescript/src/utils/date-utils.d.ts +19 -0
- package/dist/typescript/src/utils/date-utils.d.ts.map +1 -0
- package/dist/typescript/src/utils/hsla-utils.d.ts +5 -0
- package/dist/typescript/src/utils/hsla-utils.d.ts.map +1 -0
- package/dist/typescript/src/utils/normalize-layout.d.ts +8 -0
- package/dist/typescript/src/utils/normalize-layout.d.ts.map +1 -0
- package/dist/typescript/src/utils/use-themed-styles.d.ts +11 -0
- package/dist/typescript/src/utils/use-themed-styles.d.ts.map +1 -0
- package/package.json +31 -32
- package/src/components/avatar/avatar.tsx +1 -1
- package/src/components/avatar/variants/default.tsx +1 -1
- package/src/components/badge/variants/default.tsx +1 -1
- package/src/components/badge/variants/secondary.tsx +1 -1
- package/src/components/button/button.tsx +1 -1
- package/src/components/button/variants/default.tsx +1 -1
- package/src/components/button/variants/secondary.tsx +1 -1
- package/src/components/calendar/calendar.tsx +1 -1
- package/src/components/calendar/variants/default.tsx +1 -1
- package/src/components/card/variants/default.tsx +1 -1
- package/src/components/dropdown-menu/dropdown-menu.tsx +3 -1
- package/src/components/dropdown-menu/variants/default.tsx +1 -1
- package/src/components/empty/variants/default.tsx +1 -1
- package/src/components/field/variants/default.tsx +1 -1
- package/src/components/input/input.tsx +1 -1
- package/src/components/input/numeric-input.tsx +2 -2
- package/src/components/input/variants/default.tsx +1 -1
- package/src/components/link/link.tsx +1 -1
- package/src/components/link/variants/default.tsx +1 -1
- package/src/components/popover/popover.tsx +4 -5
- package/src/components/popover/variants/default.tsx +2 -1
- package/src/components/popover/variants/unstyled.tsx +1 -1
- package/src/components/select/select.tsx +1 -1
- package/src/components/select/variants/default.tsx +1 -1
- package/src/components/textarea/textarea.tsx +1 -1
- package/src/components/textarea/variants/default.tsx +1 -1
- package/src/components/toast/variants/danger.tsx +1 -1
- package/src/components/toast/variants/default.tsx +1 -1
- package/src/components/toast/variants/success.tsx +1 -1
- package/src/components/typography/typography.tsx +1 -1
- package/src/components/typography/variants/body-lg.tsx +1 -1
- package/src/components/typography/variants/body-md.tsx +1 -1
- package/src/components/typography/variants/body-sm.tsx +1 -1
- package/src/components/typography/variants/heading-lg.tsx +1 -1
- package/src/components/typography/variants/heading-md.tsx +1 -1
- package/src/components/typography/variants/heading-sm.tsx +1 -1
- package/src/index.tsx +3 -3
- package/src/primitives/avatar/avatar-fallback.tsx +1 -1
- package/src/primitives/avatar/avatar-image.tsx +1 -1
- package/src/primitives/avatar/avatar-root.tsx +2 -2
- package/src/primitives/avatar/context.ts +1 -1
- package/src/primitives/avatar/types.ts +3 -3
- package/src/primitives/badge/badge-label.tsx +2 -2
- package/src/primitives/badge/badge-root.tsx +3 -3
- package/src/primitives/badge/context.ts +1 -1
- package/src/primitives/badge/types.ts +2 -2
- package/src/primitives/button/button-context.tsx +1 -1
- package/src/primitives/button/button-label.tsx +2 -2
- package/src/primitives/button/button-root.tsx +2 -2
- package/src/primitives/button/button-spinner.tsx +2 -2
- package/src/primitives/button/types.ts +2 -2
- package/src/primitives/calendar/calendar-day.tsx +3 -3
- package/src/primitives/calendar/calendar-header.tsx +1 -1
- package/src/primitives/calendar/calendar-nav-button.tsx +2 -2
- package/src/primitives/calendar/calendar-root.tsx +2 -2
- package/src/primitives/calendar/calendar-title.tsx +1 -1
- package/src/primitives/calendar/calendar-week-labels.tsx +1 -1
- package/src/primitives/calendar/calendar-weeks.tsx +3 -3
- package/src/primitives/calendar/context.ts +1 -1
- package/src/primitives/calendar/types.ts +7 -7
- package/src/primitives/card/card-body.tsx +2 -2
- package/src/primitives/card/card-footer.tsx +2 -2
- package/src/primitives/card/card-header.tsx +2 -2
- package/src/primitives/card/card-root.tsx +3 -3
- package/src/primitives/card/card-title.tsx +2 -2
- package/src/primitives/card/context.ts +1 -1
- package/src/primitives/card/types.ts +5 -5
- package/src/primitives/dropdown-menu/context.ts +4 -4
- package/src/primitives/dropdown-menu/dropdown-menu-button.tsx +2 -2
- package/src/primitives/dropdown-menu/dropdown-menu-content.tsx +2 -2
- package/src/primitives/dropdown-menu/dropdown-menu-divider.tsx +1 -1
- package/src/primitives/dropdown-menu/dropdown-menu-overlay.tsx +1 -1
- package/src/primitives/dropdown-menu/dropdown-menu-root.tsx +3 -3
- package/src/primitives/dropdown-menu/dropdown-menu-trigger.tsx +6 -5
- package/src/primitives/dropdown-menu/types.ts +4 -4
- package/src/primitives/empty/context.ts +1 -1
- package/src/primitives/empty/empty-description.tsx +1 -1
- package/src/primitives/empty/empty-media.tsx +1 -1
- package/src/primitives/empty/empty-root.tsx +2 -2
- package/src/primitives/empty/empty-title.tsx +1 -1
- package/src/primitives/empty/types.ts +4 -4
- package/src/primitives/field/context.ts +1 -1
- package/src/primitives/field/field-description.tsx +1 -1
- package/src/primitives/field/field-error.tsx +1 -1
- package/src/primitives/field/field-label.tsx +1 -1
- package/src/primitives/field/field-root.tsx +2 -2
- package/src/primitives/field/types.ts +4 -4
- package/src/primitives/input/input.tsx +6 -5
- package/src/primitives/input/types.ts +1 -1
- package/src/primitives/popover/context.ts +4 -4
- package/src/primitives/popover/popover-close.tsx +1 -1
- package/src/primitives/popover/popover-content.tsx +2 -1
- package/src/primitives/popover/popover-overlay.tsx +3 -6
- package/src/primitives/popover/popover-root.tsx +3 -3
- package/src/primitives/popover/popover-trigger.tsx +5 -4
- package/src/primitives/popover/types.ts +2 -2
- package/src/primitives/portal/portal.tsx +6 -5
- package/src/primitives/select/context.ts +3 -3
- package/src/primitives/select/select-content.tsx +2 -2
- package/src/primitives/select/select-option.tsx +3 -3
- package/src/primitives/select/select-overlay.tsx +2 -2
- package/src/primitives/select/select-root.tsx +3 -3
- package/src/primitives/select/select-trigger.tsx +3 -3
- package/src/primitives/select/select-value.tsx +2 -2
- package/src/primitives/select/types.ts +6 -6
- package/src/primitives/textarea/textarea.tsx +2 -2
- package/src/primitives/textarea/types.ts +1 -1
- package/src/primitives/toast/context.ts +1 -1
- package/src/primitives/toast/toast-description.tsx +1 -1
- package/src/primitives/toast/toast-root.tsx +2 -2
- package/src/primitives/toast/toast-title.tsx +1 -1
- package/src/primitives/toast/types.ts +3 -3
- package/src/themes/adapters/react-navigation.ts +2 -1
- package/src/themes/default/colors.ts +1 -1
- package/src/themes/default/index.ts +1 -1
- package/src/themes/provider.tsx +5 -5
- package/src/themes/themes.ts +1 -1
- package/src/types/element.types.ts +4 -0
- package/src/utils/hsla-utils.ts +6 -9
- package/src/utils/normalize-layout.ts +5 -4
- package/src/utils/use-themed-styles.ts +1 -1
- package/tsconfig.json +22 -3
- package/dist/components/index.d.mts +0 -315
- package/dist/components/index.mjs +0 -978
- package/dist/hooks/index.d.mts +0 -47
- package/dist/hooks/index.mjs +0 -103
- package/dist/index-j_OCsdsx.d.mts +0 -704
- package/dist/index.d.mts +0 -65
- package/dist/index.mjs +0 -16
- package/dist/portal.constants-ClRV24_C.d.mts +0 -16
- package/dist/primitives/index.d.mts +0 -4
- package/dist/primitives/index.mjs +0 -4
- package/dist/primitives-8eataXpJ.mjs +0 -1437
- package/dist/toast-manager-q0YV3t3j.mjs +0 -321
- package/dist/use-numeric-mask-BQlz1Pus.mjs +0 -113
- package/dist/use-numeric-mask-D4zqPOnE.d.mts +0 -33
- package/dist/use-relative-position-BTKEyT1F.mjs +0 -106
- package/dist/use-relative-position-DBzhrBU7.d.mts +0 -61
- package/src/utils/get-ref-layout.ts +0 -16
- package/tsdown.config.ts +0 -8
|
@@ -1,1437 +0,0 @@
|
|
|
1
|
-
import { n as DEFAULT_POSITION, r as useRelativePosition, t as DEFAULT_LAYOUT } from "./use-relative-position-BTKEyT1F.mjs";
|
|
2
|
-
import React, { createContext, forwardRef, useContext, useEffect, useId, useImperativeHandle, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
3
|
-
import { ActivityIndicator, Image, Platform, Pressable, StyleSheet, Text, TextInput, View } from "react-native";
|
|
4
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
5
|
-
import { createPortal } from "react-dom";
|
|
6
|
-
|
|
7
|
-
//#region src/primitives/portal/portal.constants.tsx
|
|
8
|
-
const DEFAULT_PORTAL_HOST = "__KOR_PORTAL_HOST__";
|
|
9
|
-
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/primitives/portal/portal.tsx
|
|
12
|
-
const store = {
|
|
13
|
-
map: (/* @__PURE__ */ new Map()).set(DEFAULT_PORTAL_HOST, /* @__PURE__ */ new Map()),
|
|
14
|
-
listeners: /* @__PURE__ */ new Set()
|
|
15
|
-
};
|
|
16
|
-
function emit() {
|
|
17
|
-
for (const cb of store.listeners) cb();
|
|
18
|
-
}
|
|
19
|
-
function getSnapshot() {
|
|
20
|
-
return store.map;
|
|
21
|
-
}
|
|
22
|
-
function subscribe(cb) {
|
|
23
|
-
store.listeners.add(cb);
|
|
24
|
-
return () => {
|
|
25
|
-
store.listeners.delete(cb);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function updatePortal(hostName, name, children) {
|
|
29
|
-
const next = new Map(store.map);
|
|
30
|
-
const portal = next.get(hostName) ?? /* @__PURE__ */ new Map();
|
|
31
|
-
portal.set(name, children);
|
|
32
|
-
next.set(hostName, portal);
|
|
33
|
-
store.map = next;
|
|
34
|
-
emit();
|
|
35
|
-
}
|
|
36
|
-
function removePortal(hostName, name) {
|
|
37
|
-
const next = new Map(store.map);
|
|
38
|
-
const portal = next.get(hostName) ?? /* @__PURE__ */ new Map();
|
|
39
|
-
portal.delete(name);
|
|
40
|
-
next.set(hostName, portal);
|
|
41
|
-
store.map = next;
|
|
42
|
-
emit();
|
|
43
|
-
}
|
|
44
|
-
function NativePortalHost({ name = DEFAULT_PORTAL_HOST, container }) {
|
|
45
|
-
const portalMap = useSyncExternalStore(subscribe, getSnapshot, getSnapshot).get(name) ?? /* @__PURE__ */ new Map();
|
|
46
|
-
if (portalMap.size === 0) return null;
|
|
47
|
-
return /* @__PURE__ */ jsx(Platform.select({
|
|
48
|
-
default: (props) => /* @__PURE__ */ jsx(View, {
|
|
49
|
-
...props,
|
|
50
|
-
style: {
|
|
51
|
-
position: "absolute",
|
|
52
|
-
top: 0,
|
|
53
|
-
left: 0,
|
|
54
|
-
right: 0,
|
|
55
|
-
bottom: 0,
|
|
56
|
-
elevation: 999,
|
|
57
|
-
zIndex: 999,
|
|
58
|
-
pointerEvents: "box-none"
|
|
59
|
-
}
|
|
60
|
-
}),
|
|
61
|
-
ios: container?.ios,
|
|
62
|
-
android: container?.android
|
|
63
|
-
}), { children: Array.from(portalMap.values()) });
|
|
64
|
-
}
|
|
65
|
-
function WebPortalHost() {
|
|
66
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
67
|
-
}
|
|
68
|
-
const PortalHost = Platform.select({
|
|
69
|
-
default: NativePortalHost,
|
|
70
|
-
web: WebPortalHost
|
|
71
|
-
});
|
|
72
|
-
function NativePortal({ name, hostName = DEFAULT_PORTAL_HOST, children }) {
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
updatePortal(hostName, name, children);
|
|
75
|
-
}, [
|
|
76
|
-
hostName,
|
|
77
|
-
name,
|
|
78
|
-
children
|
|
79
|
-
]);
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
return () => {
|
|
82
|
-
removePortal(hostName, name);
|
|
83
|
-
};
|
|
84
|
-
}, [hostName, name]);
|
|
85
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
86
|
-
}
|
|
87
|
-
function WebPortal({ name, hostName = DEFAULT_PORTAL_HOST, children }) {
|
|
88
|
-
const [container] = useState(() => {
|
|
89
|
-
let container$1 = document.getElementById(hostName);
|
|
90
|
-
if (!container$1) {
|
|
91
|
-
container$1 = document.createElement("div");
|
|
92
|
-
container$1.id = hostName;
|
|
93
|
-
document.body.appendChild(container$1);
|
|
94
|
-
}
|
|
95
|
-
return container$1;
|
|
96
|
-
});
|
|
97
|
-
return /* @__PURE__ */ jsx(Fragment, { children: createPortal(children, container, name) });
|
|
98
|
-
}
|
|
99
|
-
const Portal = Platform.select({
|
|
100
|
-
default: NativePortal,
|
|
101
|
-
web: WebPortal
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region src/primitives/field/context.ts
|
|
106
|
-
const FieldContext = createContext(void 0);
|
|
107
|
-
const useField = () => {
|
|
108
|
-
const context = useContext(FieldContext);
|
|
109
|
-
if (!context) throw new Error("useField must be used within a FieldProvider");
|
|
110
|
-
return context;
|
|
111
|
-
};
|
|
112
|
-
const useFieldOptional = () => {
|
|
113
|
-
return useContext(FieldContext);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/primitives/field/field-root.tsx
|
|
118
|
-
function FieldRoot(props) {
|
|
119
|
-
const id = useId();
|
|
120
|
-
const composedStyles = [props.styles?.root, props.style];
|
|
121
|
-
const Component = props.render ?? View;
|
|
122
|
-
return /* @__PURE__ */ jsx(FieldContext.Provider, {
|
|
123
|
-
value: {
|
|
124
|
-
styles: props.styles,
|
|
125
|
-
id
|
|
126
|
-
},
|
|
127
|
-
children: /* @__PURE__ */ jsx(Component, {
|
|
128
|
-
...props,
|
|
129
|
-
style: composedStyles
|
|
130
|
-
})
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region src/primitives/field/field-label.tsx
|
|
136
|
-
function FieldLabel(props) {
|
|
137
|
-
const field = useField();
|
|
138
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
139
|
-
...props,
|
|
140
|
-
for: props.for ?? field.id,
|
|
141
|
-
style: [field.styles?.label, props.style]
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region src/primitives/field/field-description.tsx
|
|
147
|
-
function FieldDescription(props) {
|
|
148
|
-
const field = useField();
|
|
149
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
150
|
-
...props,
|
|
151
|
-
style: [field.styles?.description, props.style]
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
//#endregion
|
|
156
|
-
//#region src/primitives/field/field-error.tsx
|
|
157
|
-
function FieldError(props) {
|
|
158
|
-
const field = useField();
|
|
159
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
160
|
-
...props,
|
|
161
|
-
style: [field.styles?.error, props.style]
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
//#endregion
|
|
166
|
-
//#region src/primitives/field/index.ts
|
|
167
|
-
const FieldPrimitive = {
|
|
168
|
-
Root: FieldRoot,
|
|
169
|
-
Label: FieldLabel,
|
|
170
|
-
Description: FieldDescription,
|
|
171
|
-
Error: FieldError
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
//#endregion
|
|
175
|
-
//#region src/primitives/input/input.tsx
|
|
176
|
-
const calculateState$7 = (props, isFocused) => {
|
|
177
|
-
if (props.isDisabled) return "disabled";
|
|
178
|
-
if (isFocused) return "focused";
|
|
179
|
-
return "default";
|
|
180
|
-
};
|
|
181
|
-
const InputPrimitive = forwardRef((props, ref) => {
|
|
182
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
183
|
-
const state = calculateState$7(props, isFocused);
|
|
184
|
-
const field = useFieldOptional();
|
|
185
|
-
const composedStyles = [
|
|
186
|
-
props.styles?.default?.style,
|
|
187
|
-
props.styles?.[state]?.style,
|
|
188
|
-
props.style
|
|
189
|
-
];
|
|
190
|
-
const composedProps = {
|
|
191
|
-
...props.styles?.default,
|
|
192
|
-
...props.styles?.[state],
|
|
193
|
-
...props
|
|
194
|
-
};
|
|
195
|
-
return /* @__PURE__ */ jsx(props.render ?? TextInput, {
|
|
196
|
-
...composedProps,
|
|
197
|
-
ref,
|
|
198
|
-
id: field?.id,
|
|
199
|
-
onChange: void 0,
|
|
200
|
-
onChangeText: props.onChange,
|
|
201
|
-
onFocus: (e) => {
|
|
202
|
-
setIsFocused(true);
|
|
203
|
-
props.onFocus?.(e);
|
|
204
|
-
},
|
|
205
|
-
onBlur: (e) => {
|
|
206
|
-
setIsFocused(false);
|
|
207
|
-
props.onBlur?.(e);
|
|
208
|
-
},
|
|
209
|
-
readOnly: props.isDisabled || props.readOnly,
|
|
210
|
-
style: composedStyles
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
InputPrimitive.displayName = "InputPrimitive";
|
|
214
|
-
|
|
215
|
-
//#endregion
|
|
216
|
-
//#region src/primitives/button/button-context.tsx
|
|
217
|
-
const ButtonPrimitiveContext = createContext(void 0);
|
|
218
|
-
const useButtonPrimitive = () => {
|
|
219
|
-
const context = useContext(ButtonPrimitiveContext);
|
|
220
|
-
if (!context) throw new Error("useButtonPrimitive must be used within a ButtonPrimitiveProvider");
|
|
221
|
-
return context;
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
//#endregion
|
|
225
|
-
//#region src/primitives/button/button-root.tsx
|
|
226
|
-
const calculateState$6 = (props, isHovered) => {
|
|
227
|
-
if (props.isDisabled) return "disabled";
|
|
228
|
-
if (props.isLoading) return "loading";
|
|
229
|
-
if (isHovered) return "hovered";
|
|
230
|
-
return "default";
|
|
231
|
-
};
|
|
232
|
-
function ButtonRoot(props) {
|
|
233
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
234
|
-
const state = calculateState$6(props, isHovered);
|
|
235
|
-
const calculatedStyle = [
|
|
236
|
-
props.styles?.root?.default,
|
|
237
|
-
props.styles?.root?.[state],
|
|
238
|
-
props.style
|
|
239
|
-
];
|
|
240
|
-
const Container = props.render ?? Pressable;
|
|
241
|
-
return /* @__PURE__ */ jsx(ButtonPrimitiveContext.Provider, {
|
|
242
|
-
value: {
|
|
243
|
-
disabled: props.isDisabled,
|
|
244
|
-
state,
|
|
245
|
-
styles: props.styles
|
|
246
|
-
},
|
|
247
|
-
children: /* @__PURE__ */ jsx(Container, {
|
|
248
|
-
...props,
|
|
249
|
-
onHoverIn: () => setIsHovered(true),
|
|
250
|
-
onHoverOut: () => setIsHovered(false),
|
|
251
|
-
style: calculatedStyle
|
|
252
|
-
})
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
//#endregion
|
|
257
|
-
//#region src/utils/calculate-styles.ts
|
|
258
|
-
const calculateComposedStyles = (styles = {}, state, component, style) => {
|
|
259
|
-
const result = [];
|
|
260
|
-
const componentStyles = styles?.[component];
|
|
261
|
-
if (componentStyles && "default" in componentStyles && componentStyles["default"]) result.push(componentStyles["default"]);
|
|
262
|
-
if (componentStyles?.[state]) result.push(componentStyles[state]);
|
|
263
|
-
if (style) result.push(style);
|
|
264
|
-
return result;
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
//#endregion
|
|
268
|
-
//#region src/primitives/button/button-label.tsx
|
|
269
|
-
function ButtonLabel(props) {
|
|
270
|
-
const button = useButtonPrimitive();
|
|
271
|
-
const calculatedStyle = calculateComposedStyles(button.styles, button.state, "label", props.style);
|
|
272
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
273
|
-
style: calculatedStyle,
|
|
274
|
-
children: props.children
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
//#endregion
|
|
279
|
-
//#region src/primitives/button/button-spinner.tsx
|
|
280
|
-
function ButtonSpinner(props) {
|
|
281
|
-
const button = useButtonPrimitive();
|
|
282
|
-
return /* @__PURE__ */ jsx(ActivityIndicator, { style: calculateComposedStyles(button.styles, button.state, "spinner", props.style) });
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
//#endregion
|
|
286
|
-
//#region src/primitives/button/index.ts
|
|
287
|
-
const ButtonPrimitive = {
|
|
288
|
-
Root: ButtonRoot,
|
|
289
|
-
Label: ButtonLabel,
|
|
290
|
-
Spinner: ButtonSpinner
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
//#endregion
|
|
294
|
-
//#region src/primitives/select/context.ts
|
|
295
|
-
const SelectContext = createContext(void 0);
|
|
296
|
-
const useSelect = () => {
|
|
297
|
-
const context = useContext(SelectContext);
|
|
298
|
-
if (!context) throw new Error("useSelect must be used within a SelectProvider");
|
|
299
|
-
return context;
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
//#endregion
|
|
303
|
-
//#region src/primitives/select/select-root.tsx
|
|
304
|
-
const calculateState$5 = (props) => {
|
|
305
|
-
if (props.isDisabled) return "disabled";
|
|
306
|
-
return "default";
|
|
307
|
-
};
|
|
308
|
-
function SelectRoot(props) {
|
|
309
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
310
|
-
const [triggerLayout, setTriggerLayout] = useState(null);
|
|
311
|
-
const [options, setOptions] = useState([]);
|
|
312
|
-
const state = calculateState$5(props);
|
|
313
|
-
const composedStyles = calculateComposedStyles(props.styles, state, "root", props.style);
|
|
314
|
-
const Component = props.render ?? View;
|
|
315
|
-
return /* @__PURE__ */ jsx(SelectContext.Provider, {
|
|
316
|
-
value: {
|
|
317
|
-
value: props.value,
|
|
318
|
-
onChange: props.onChange,
|
|
319
|
-
placeholder: props.placeholder,
|
|
320
|
-
isOpen,
|
|
321
|
-
setIsOpen,
|
|
322
|
-
triggerLayout,
|
|
323
|
-
setTriggerLayout,
|
|
324
|
-
options,
|
|
325
|
-
setOptions,
|
|
326
|
-
state,
|
|
327
|
-
isDisabled: props.isDisabled ?? false,
|
|
328
|
-
styles: props.styles ?? null
|
|
329
|
-
},
|
|
330
|
-
children: /* @__PURE__ */ jsx(Component, {
|
|
331
|
-
style: composedStyles,
|
|
332
|
-
children: props.children
|
|
333
|
-
})
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
//#endregion
|
|
338
|
-
//#region src/utils/normalize-layout.ts
|
|
339
|
-
const normalizeLayout = (layout) => {
|
|
340
|
-
if (!layout.y && "top" in layout && typeof layout.top === "number") layout.y = layout.top;
|
|
341
|
-
if (!layout.x && "left" in layout && typeof layout.left === "number") layout.x = layout.left;
|
|
342
|
-
return layout;
|
|
343
|
-
};
|
|
344
|
-
|
|
345
|
-
//#endregion
|
|
346
|
-
//#region src/primitives/select/select-trigger.tsx
|
|
347
|
-
function SelectTrigger(props) {
|
|
348
|
-
const select = useSelect();
|
|
349
|
-
const composedStyles = calculateComposedStyles(select.styles, select.state, "trigger", props.style);
|
|
350
|
-
return /* @__PURE__ */ jsx(props.render ?? Pressable, {
|
|
351
|
-
onPress: () => {
|
|
352
|
-
select.setIsOpen((prev) => !prev);
|
|
353
|
-
},
|
|
354
|
-
onLayout: (e) => {
|
|
355
|
-
const layout = normalizeLayout(e.nativeEvent.layout);
|
|
356
|
-
select.setTriggerLayout(layout);
|
|
357
|
-
},
|
|
358
|
-
disabled: select.isDisabled,
|
|
359
|
-
style: composedStyles,
|
|
360
|
-
children: props.children
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
//#endregion
|
|
365
|
-
//#region src/primitives/select/select-value.tsx
|
|
366
|
-
function SelectValue(props) {
|
|
367
|
-
const select = useSelect();
|
|
368
|
-
const selectedOption = select.options.find((option) => option.value === select.value);
|
|
369
|
-
const selectedOptionLabel = selectedOption?.label;
|
|
370
|
-
const composedStyles = calculateComposedStyles(select.styles, select.state, selectedOptionLabel ? "value" : "placeholder", props.style);
|
|
371
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
372
|
-
style: composedStyles,
|
|
373
|
-
children: selectedOption?.label ?? select.placeholder
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
//#endregion
|
|
378
|
-
//#region src/primitives/select/select-portal.tsx
|
|
379
|
-
function SelectPortal(props) {
|
|
380
|
-
const select = useSelect();
|
|
381
|
-
useEffect(() => {
|
|
382
|
-
return () => {
|
|
383
|
-
select.setOptions([]);
|
|
384
|
-
};
|
|
385
|
-
}, []);
|
|
386
|
-
if (!select.isOpen) return null;
|
|
387
|
-
return /* @__PURE__ */ jsx(Portal, {
|
|
388
|
-
name: "select-portal",
|
|
389
|
-
children: /* @__PURE__ */ jsx(SelectContext.Provider, {
|
|
390
|
-
value: select,
|
|
391
|
-
children: props.children
|
|
392
|
-
})
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
//#endregion
|
|
397
|
-
//#region src/primitives/select/select-overlay.tsx
|
|
398
|
-
function SelectOverlay(props) {
|
|
399
|
-
const select = useSelect();
|
|
400
|
-
const composedStyles = calculateComposedStyles(select.styles, select.state, "overlay", props.style);
|
|
401
|
-
return /* @__PURE__ */ jsx(props.render ?? Pressable, {
|
|
402
|
-
onPress: () => {
|
|
403
|
-
select.setIsOpen(false);
|
|
404
|
-
},
|
|
405
|
-
style: [StyleSheet.absoluteFill, composedStyles],
|
|
406
|
-
children: props.children
|
|
407
|
-
});
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
//#endregion
|
|
411
|
-
//#region src/primitives/select/select-content.tsx
|
|
412
|
-
function SelectContent(props) {
|
|
413
|
-
const select = useSelect();
|
|
414
|
-
const composedStyles = calculateComposedStyles(select.styles, select.state, "content", props.style);
|
|
415
|
-
return /* @__PURE__ */ jsx(props.render ?? View, {
|
|
416
|
-
style: [composedStyles, {
|
|
417
|
-
position: "absolute",
|
|
418
|
-
top: select.triggerLayout?.y + select.triggerLayout?.height,
|
|
419
|
-
left: select.triggerLayout?.x,
|
|
420
|
-
width: select.triggerLayout?.width
|
|
421
|
-
}],
|
|
422
|
-
children: props.children
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
//#endregion
|
|
427
|
-
//#region src/primitives/select/select-option.tsx
|
|
428
|
-
const calculateState$4 = (selectState, hovered, selected) => {
|
|
429
|
-
if (selectState === "disabled") return "disabled";
|
|
430
|
-
if (selected) return "selected";
|
|
431
|
-
if (hovered) return "hovered";
|
|
432
|
-
return "default";
|
|
433
|
-
};
|
|
434
|
-
function SelectOption(props) {
|
|
435
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
436
|
-
const select = useSelect();
|
|
437
|
-
const isSelected = select.value === props.value;
|
|
438
|
-
const optionState = calculateState$4(select.state, isHovered, isSelected);
|
|
439
|
-
const composedStyles = calculateComposedStyles(select.styles, optionState, "option", props.style);
|
|
440
|
-
useEffect(() => {
|
|
441
|
-
select.setOptions((prev) => {
|
|
442
|
-
if (prev.find((option) => option.value === props.value)) return prev;
|
|
443
|
-
return [...prev, {
|
|
444
|
-
value: props.value,
|
|
445
|
-
label: props.children
|
|
446
|
-
}];
|
|
447
|
-
});
|
|
448
|
-
}, [props.value, props.children]);
|
|
449
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
450
|
-
value: props.value,
|
|
451
|
-
onPress: () => {
|
|
452
|
-
select.onChange?.(props.value);
|
|
453
|
-
select.setIsOpen(false);
|
|
454
|
-
},
|
|
455
|
-
onMouseEnter: () => setIsHovered(true),
|
|
456
|
-
onMouseLeave: () => setIsHovered(false),
|
|
457
|
-
style: composedStyles,
|
|
458
|
-
children: props.children
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
//#endregion
|
|
463
|
-
//#region src/primitives/select/index.ts
|
|
464
|
-
const SelectPrimitive = {
|
|
465
|
-
Root: SelectRoot,
|
|
466
|
-
Trigger: SelectTrigger,
|
|
467
|
-
Value: SelectValue,
|
|
468
|
-
Portal: SelectPortal,
|
|
469
|
-
Overlay: SelectOverlay,
|
|
470
|
-
Content: SelectContent,
|
|
471
|
-
Option: SelectOption
|
|
472
|
-
};
|
|
473
|
-
|
|
474
|
-
//#endregion
|
|
475
|
-
//#region src/primitives/card/context.ts
|
|
476
|
-
const CardContext = createContext(void 0);
|
|
477
|
-
const useCard = () => {
|
|
478
|
-
const context = useContext(CardContext);
|
|
479
|
-
if (!context) throw new Error("useCard must be used within a CardProvider");
|
|
480
|
-
return context;
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
//#endregion
|
|
484
|
-
//#region src/primitives/card/card-root.tsx
|
|
485
|
-
function CardRoot(props) {
|
|
486
|
-
const composedStyle = calculateComposedStyles(props.styles, "default", "root", props.style);
|
|
487
|
-
const Component = props.render ?? View;
|
|
488
|
-
return /* @__PURE__ */ jsx(CardContext.Provider, {
|
|
489
|
-
value: {
|
|
490
|
-
state: "default",
|
|
491
|
-
styles: props.styles
|
|
492
|
-
},
|
|
493
|
-
children: /* @__PURE__ */ jsx(Component, {
|
|
494
|
-
...props,
|
|
495
|
-
style: composedStyle
|
|
496
|
-
})
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
//#endregion
|
|
501
|
-
//#region src/primitives/card/card-header.tsx
|
|
502
|
-
function CardHeader(props) {
|
|
503
|
-
const card = useCard();
|
|
504
|
-
const composedStyle = calculateComposedStyles(card.styles, card.state, "header", props.style);
|
|
505
|
-
return /* @__PURE__ */ jsx(props.render ?? View, {
|
|
506
|
-
...props,
|
|
507
|
-
style: composedStyle
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
//#endregion
|
|
512
|
-
//#region src/primitives/card/card-title.tsx
|
|
513
|
-
function CardTitle(props) {
|
|
514
|
-
const card = useCard();
|
|
515
|
-
const composedStyle = calculateComposedStyles(card.styles, card.state, "title", props.style);
|
|
516
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
517
|
-
...props,
|
|
518
|
-
style: composedStyle
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
//#endregion
|
|
523
|
-
//#region src/primitives/card/card-body.tsx
|
|
524
|
-
function CardBody(props) {
|
|
525
|
-
const card = useCard();
|
|
526
|
-
const composedStyle = calculateComposedStyles(card.styles, card.state, "body", props.style);
|
|
527
|
-
return /* @__PURE__ */ jsx(props.render ?? View, {
|
|
528
|
-
...props,
|
|
529
|
-
style: composedStyle
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
//#endregion
|
|
534
|
-
//#region src/primitives/card/card-footer.tsx
|
|
535
|
-
function CardFooter(props) {
|
|
536
|
-
const card = useCard();
|
|
537
|
-
const composedStyle = calculateComposedStyles(card.styles, card.state, "footer", props.style);
|
|
538
|
-
return /* @__PURE__ */ jsx(props.render ?? View, {
|
|
539
|
-
...props,
|
|
540
|
-
style: composedStyle
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
//#endregion
|
|
545
|
-
//#region src/primitives/card/index.ts
|
|
546
|
-
const CardPrimitive = {
|
|
547
|
-
Root: CardRoot,
|
|
548
|
-
Header: CardHeader,
|
|
549
|
-
Title: CardTitle,
|
|
550
|
-
Body: CardBody,
|
|
551
|
-
Footer: CardFooter
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
//#endregion
|
|
555
|
-
//#region src/primitives/empty/context.ts
|
|
556
|
-
const EmptyContext = createContext({});
|
|
557
|
-
const useEmpty = () => {
|
|
558
|
-
const context = useContext(EmptyContext);
|
|
559
|
-
if (!context) throw new Error("useEmptyContext must be used within a EmptyProvider");
|
|
560
|
-
return context;
|
|
561
|
-
};
|
|
562
|
-
|
|
563
|
-
//#endregion
|
|
564
|
-
//#region src/primitives/empty/empty-root.tsx
|
|
565
|
-
function EmptyRoot(props) {
|
|
566
|
-
const composedStyles = [props.styles?.root, props.style];
|
|
567
|
-
const Component = props.render ?? View;
|
|
568
|
-
return /* @__PURE__ */ jsx(EmptyContext.Provider, {
|
|
569
|
-
value: { styles: props.styles },
|
|
570
|
-
children: /* @__PURE__ */ jsx(Component, {
|
|
571
|
-
...props,
|
|
572
|
-
style: composedStyles
|
|
573
|
-
})
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
//#endregion
|
|
578
|
-
//#region src/primitives/empty/empty-media.tsx
|
|
579
|
-
function EmptyMedia(props) {
|
|
580
|
-
const composedStyles = [useEmpty().styles?.media, props.style];
|
|
581
|
-
return /* @__PURE__ */ jsx(props.render ?? View, {
|
|
582
|
-
...props,
|
|
583
|
-
style: composedStyles
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
//#endregion
|
|
588
|
-
//#region src/primitives/empty/empty-title.tsx
|
|
589
|
-
function EmptyTitle(props) {
|
|
590
|
-
const composedStyles = [useEmpty().styles?.title, props.style];
|
|
591
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
592
|
-
...props,
|
|
593
|
-
style: composedStyles
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
//#endregion
|
|
598
|
-
//#region src/primitives/empty/empty-description.tsx
|
|
599
|
-
function EmptyDescription(props) {
|
|
600
|
-
const composedStyles = [useEmpty().styles?.description, props.style];
|
|
601
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
602
|
-
...props,
|
|
603
|
-
style: composedStyles
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
//#endregion
|
|
608
|
-
//#region src/primitives/empty/index.ts
|
|
609
|
-
const EmptyPrimitive = {
|
|
610
|
-
Root: EmptyRoot,
|
|
611
|
-
Media: EmptyMedia,
|
|
612
|
-
Title: EmptyTitle,
|
|
613
|
-
Description: EmptyDescription
|
|
614
|
-
};
|
|
615
|
-
|
|
616
|
-
//#endregion
|
|
617
|
-
//#region src/primitives/avatar/context.ts
|
|
618
|
-
const AvatarContext = createContext(void 0);
|
|
619
|
-
const useAvatar = () => {
|
|
620
|
-
const context = useContext(AvatarContext);
|
|
621
|
-
if (!context) throw new Error("useAvatarContext must be used within a AvatarProvider");
|
|
622
|
-
return context;
|
|
623
|
-
};
|
|
624
|
-
|
|
625
|
-
//#endregion
|
|
626
|
-
//#region src/primitives/avatar/avatar-root.tsx
|
|
627
|
-
function AvatarRoot(props) {
|
|
628
|
-
const composedStyles = [props.styles?.root, props.style];
|
|
629
|
-
const Component = props.render ?? View;
|
|
630
|
-
return /* @__PURE__ */ jsx(AvatarContext.Provider, {
|
|
631
|
-
value: { styles: props.styles },
|
|
632
|
-
children: /* @__PURE__ */ jsx(Component, {
|
|
633
|
-
...props,
|
|
634
|
-
style: composedStyles
|
|
635
|
-
})
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
//#endregion
|
|
640
|
-
//#region src/primitives/avatar/avatar-fallback.tsx
|
|
641
|
-
function AvatarFallback(props) {
|
|
642
|
-
const composedStyles = [useAvatar().styles?.fallback, props.style];
|
|
643
|
-
return /* @__PURE__ */ jsx(props.render ?? View, {
|
|
644
|
-
...props,
|
|
645
|
-
style: composedStyles
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
//#endregion
|
|
650
|
-
//#region src/primitives/avatar/avatar-image.tsx
|
|
651
|
-
function AvatarImage(props) {
|
|
652
|
-
const composedStyles = [useAvatar().styles?.image, props.style];
|
|
653
|
-
return /* @__PURE__ */ jsx(props.render ?? Image, {
|
|
654
|
-
...props,
|
|
655
|
-
style: composedStyles
|
|
656
|
-
});
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
//#endregion
|
|
660
|
-
//#region src/primitives/avatar/index.ts
|
|
661
|
-
const AvatarPrimitive = {
|
|
662
|
-
Root: AvatarRoot,
|
|
663
|
-
Image: AvatarImage,
|
|
664
|
-
Fallback: AvatarFallback
|
|
665
|
-
};
|
|
666
|
-
|
|
667
|
-
//#endregion
|
|
668
|
-
//#region src/primitives/toast/context.ts
|
|
669
|
-
const ToastContext = createContext(void 0);
|
|
670
|
-
const useToast = () => {
|
|
671
|
-
const context = useContext(ToastContext);
|
|
672
|
-
if (!context) throw new Error("useToast must be used within a ToastProvider");
|
|
673
|
-
return context;
|
|
674
|
-
};
|
|
675
|
-
|
|
676
|
-
//#endregion
|
|
677
|
-
//#region src/primitives/toast/toast-root.tsx
|
|
678
|
-
function ToastRoot(props) {
|
|
679
|
-
const composedStyle = [props.styles?.root, props.style];
|
|
680
|
-
const Component = props.render ?? View;
|
|
681
|
-
return /* @__PURE__ */ jsx(ToastContext.Provider, {
|
|
682
|
-
value: { styles: props.styles },
|
|
683
|
-
children: /* @__PURE__ */ jsx(Component, {
|
|
684
|
-
...props,
|
|
685
|
-
style: composedStyle
|
|
686
|
-
})
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
//#endregion
|
|
691
|
-
//#region src/primitives/toast/toast-title.tsx
|
|
692
|
-
function ToastTitle(props) {
|
|
693
|
-
const composedStyle = [useToast().styles?.title, props.style];
|
|
694
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
695
|
-
...props,
|
|
696
|
-
style: composedStyle
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
//#endregion
|
|
701
|
-
//#region src/primitives/toast/toast-description.tsx
|
|
702
|
-
function ToastDescription(props) {
|
|
703
|
-
const composedStyle = [useToast().styles?.description, props.style];
|
|
704
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
705
|
-
...props,
|
|
706
|
-
style: composedStyle
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
//#endregion
|
|
711
|
-
//#region src/primitives/toast/index.ts
|
|
712
|
-
const ToastPrimitive = {
|
|
713
|
-
Root: ToastRoot,
|
|
714
|
-
Title: ToastTitle,
|
|
715
|
-
Description: ToastDescription
|
|
716
|
-
};
|
|
717
|
-
|
|
718
|
-
//#endregion
|
|
719
|
-
//#region src/primitives/badge/context.ts
|
|
720
|
-
const BadgeContext = createContext(void 0);
|
|
721
|
-
const useBadge = () => {
|
|
722
|
-
const context = useContext(BadgeContext);
|
|
723
|
-
if (!context) throw new Error("useBadge must be used within a BadgeProvider");
|
|
724
|
-
return context;
|
|
725
|
-
};
|
|
726
|
-
|
|
727
|
-
//#endregion
|
|
728
|
-
//#region src/primitives/badge/badge-root.tsx
|
|
729
|
-
function BadgeRoot(props) {
|
|
730
|
-
const composedStyle = calculateComposedStyles(props.styles, "default", "root", props.style);
|
|
731
|
-
const Component = props.render ?? View;
|
|
732
|
-
return /* @__PURE__ */ jsx(BadgeContext.Provider, {
|
|
733
|
-
value: {
|
|
734
|
-
state: "default",
|
|
735
|
-
styles: props.styles
|
|
736
|
-
},
|
|
737
|
-
children: /* @__PURE__ */ jsx(Component, {
|
|
738
|
-
...props,
|
|
739
|
-
style: composedStyle
|
|
740
|
-
})
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
//#endregion
|
|
745
|
-
//#region src/primitives/badge/badge-label.tsx
|
|
746
|
-
function BadgeLabel(props) {
|
|
747
|
-
const badge = useBadge();
|
|
748
|
-
const composedStyle = calculateComposedStyles(badge.styles, badge.state, "label", props.style);
|
|
749
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
750
|
-
...props,
|
|
751
|
-
style: composedStyle
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
//#endregion
|
|
756
|
-
//#region src/primitives/badge/index.ts
|
|
757
|
-
const BadgePrimitive = {
|
|
758
|
-
Root: BadgeRoot,
|
|
759
|
-
Label: BadgeLabel
|
|
760
|
-
};
|
|
761
|
-
|
|
762
|
-
//#endregion
|
|
763
|
-
//#region src/primitives/textarea/textarea.tsx
|
|
764
|
-
const calculateState$3 = (props, isFocused) => {
|
|
765
|
-
if (props.isDisabled) return "disabled";
|
|
766
|
-
if (isFocused) return "focused";
|
|
767
|
-
return "default";
|
|
768
|
-
};
|
|
769
|
-
function TextareaPrimitive(props) {
|
|
770
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
771
|
-
const state = calculateState$3(props, isFocused);
|
|
772
|
-
const composedStyles = [
|
|
773
|
-
props.styles?.default?.style,
|
|
774
|
-
props.styles?.[state]?.style,
|
|
775
|
-
props.style
|
|
776
|
-
];
|
|
777
|
-
const composedProps = {
|
|
778
|
-
...props.styles?.default,
|
|
779
|
-
...props.styles?.[state],
|
|
780
|
-
...props
|
|
781
|
-
};
|
|
782
|
-
return /* @__PURE__ */ jsx(props.render ?? TextInput, {
|
|
783
|
-
...composedProps,
|
|
784
|
-
multiline: true,
|
|
785
|
-
onChange: void 0,
|
|
786
|
-
onChangeText: props.onChange,
|
|
787
|
-
onFocus: (e) => {
|
|
788
|
-
setIsFocused(true);
|
|
789
|
-
props.onFocus?.(e);
|
|
790
|
-
},
|
|
791
|
-
onBlur: (e) => {
|
|
792
|
-
setIsFocused(false);
|
|
793
|
-
props.onBlur?.(e);
|
|
794
|
-
},
|
|
795
|
-
readOnly: props.isDisabled || props.readOnly,
|
|
796
|
-
style: composedStyles
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
//#endregion
|
|
801
|
-
//#region src/primitives/dropdown-menu/context.ts
|
|
802
|
-
const DropdownMenuContext = createContext(void 0);
|
|
803
|
-
const useDropdownMenu = () => {
|
|
804
|
-
const context = useContext(DropdownMenuContext);
|
|
805
|
-
if (!context) throw new Error("useDropdownMenu must be used within a DropdownMenuRoot");
|
|
806
|
-
return context;
|
|
807
|
-
};
|
|
808
|
-
|
|
809
|
-
//#endregion
|
|
810
|
-
//#region src/primitives/dropdown-menu/dropdown-menu-root.tsx
|
|
811
|
-
function DropdownMenuRoot(props) {
|
|
812
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
813
|
-
const [triggerPosition, setTriggerPosition] = useState(DEFAULT_POSITION);
|
|
814
|
-
const [contentLayout, setContentLayout] = useState(DEFAULT_LAYOUT);
|
|
815
|
-
return /* @__PURE__ */ jsx(DropdownMenuContext.Provider, {
|
|
816
|
-
value: {
|
|
817
|
-
isOpen,
|
|
818
|
-
setIsOpen,
|
|
819
|
-
triggerPosition,
|
|
820
|
-
setTriggerPosition,
|
|
821
|
-
contentLayout,
|
|
822
|
-
setContentLayout,
|
|
823
|
-
styles: props.styles
|
|
824
|
-
},
|
|
825
|
-
children: props.children
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
//#endregion
|
|
830
|
-
//#region src/primitives/dropdown-menu/dropdown-menu-trigger.tsx
|
|
831
|
-
const DropdownMenuTrigger = forwardRef((props, ref) => {
|
|
832
|
-
const dropdownMenu = useDropdownMenu();
|
|
833
|
-
const triggerRef = useRef(null);
|
|
834
|
-
const onTriggerPress = async () => {
|
|
835
|
-
triggerRef.current?.measure((_x, _y, width, height, pageX, pageY) => {
|
|
836
|
-
dropdownMenu.setTriggerPosition({
|
|
837
|
-
height,
|
|
838
|
-
width,
|
|
839
|
-
pageX,
|
|
840
|
-
pageY
|
|
841
|
-
});
|
|
842
|
-
});
|
|
843
|
-
dropdownMenu.setIsOpen((prev) => !prev);
|
|
844
|
-
};
|
|
845
|
-
useImperativeHandle(ref, () => ({
|
|
846
|
-
open: () => dropdownMenu.setIsOpen(true),
|
|
847
|
-
close: () => dropdownMenu.setIsOpen(false)
|
|
848
|
-
}));
|
|
849
|
-
return React.cloneElement(props.children, {
|
|
850
|
-
ref: triggerRef,
|
|
851
|
-
onPress: onTriggerPress,
|
|
852
|
-
role: "button",
|
|
853
|
-
accessible: true,
|
|
854
|
-
accessibilityRole: "button",
|
|
855
|
-
accessibilityState: { expanded: dropdownMenu.isOpen },
|
|
856
|
-
...props.children.props
|
|
857
|
-
});
|
|
858
|
-
});
|
|
859
|
-
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
860
|
-
|
|
861
|
-
//#endregion
|
|
862
|
-
//#region src/primitives/dropdown-menu/dropdown-menu-content.tsx
|
|
863
|
-
function DropdownMenuContent(props) {
|
|
864
|
-
const menu = useDropdownMenu();
|
|
865
|
-
const composedStyle = [
|
|
866
|
-
useRelativePosition({
|
|
867
|
-
align: "start",
|
|
868
|
-
avoidCollisions: true,
|
|
869
|
-
triggerPosition: menu.triggerPosition,
|
|
870
|
-
contentLayout: menu.contentLayout,
|
|
871
|
-
alignOffset: 0,
|
|
872
|
-
side: "bottom",
|
|
873
|
-
sideOffset: 0
|
|
874
|
-
}),
|
|
875
|
-
menu.styles?.content,
|
|
876
|
-
props.style
|
|
877
|
-
];
|
|
878
|
-
return /* @__PURE__ */ jsx(props.render ?? View, {
|
|
879
|
-
...props,
|
|
880
|
-
onLayout: (e) => {
|
|
881
|
-
menu.setContentLayout(e.nativeEvent.layout);
|
|
882
|
-
},
|
|
883
|
-
style: composedStyle
|
|
884
|
-
});
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
//#endregion
|
|
888
|
-
//#region src/primitives/dropdown-menu/dropdown-menu-button.tsx
|
|
889
|
-
const calculateState$2 = (isHovered) => {
|
|
890
|
-
if (isHovered) return "hovered";
|
|
891
|
-
return "default";
|
|
892
|
-
};
|
|
893
|
-
function DropdownMenuButton(props) {
|
|
894
|
-
const menu = useDropdownMenu();
|
|
895
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
896
|
-
const state = calculateState$2(isHovered);
|
|
897
|
-
const composedStyle = [
|
|
898
|
-
menu.styles?.button?.default,
|
|
899
|
-
menu.styles?.button?.[state],
|
|
900
|
-
props.style
|
|
901
|
-
];
|
|
902
|
-
const handlePress = () => {
|
|
903
|
-
props.onPress?.();
|
|
904
|
-
menu.setIsOpen((prev) => !prev);
|
|
905
|
-
};
|
|
906
|
-
return /* @__PURE__ */ jsx(props.render ?? Text, {
|
|
907
|
-
...props,
|
|
908
|
-
onPress: handlePress,
|
|
909
|
-
onMouseEnter: () => setIsHovered(true),
|
|
910
|
-
onMouseLeave: () => setIsHovered(false),
|
|
911
|
-
style: composedStyle,
|
|
912
|
-
children: props.children
|
|
913
|
-
});
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
//#endregion
|
|
917
|
-
//#region src/primitives/dropdown-menu/dropdown-menu-divider.tsx
|
|
918
|
-
function DropdownMenuDivider(props) {
|
|
919
|
-
const composedStyle = [useDropdownMenu().styles?.divider, props.style];
|
|
920
|
-
return /* @__PURE__ */ jsx(props.render ?? View, {
|
|
921
|
-
...props,
|
|
922
|
-
style: composedStyle
|
|
923
|
-
});
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
//#endregion
|
|
927
|
-
//#region src/primitives/dropdown-menu/dropdown-menu-portal.tsx
|
|
928
|
-
function DropdownMenuPortal(props) {
|
|
929
|
-
const menu = useDropdownMenu();
|
|
930
|
-
if (!menu.isOpen) return null;
|
|
931
|
-
return /* @__PURE__ */ jsx(Portal, {
|
|
932
|
-
name: "dropdown-menu-portal",
|
|
933
|
-
children: /* @__PURE__ */ jsx(DropdownMenuContext.Provider, {
|
|
934
|
-
value: menu,
|
|
935
|
-
children: props.children
|
|
936
|
-
})
|
|
937
|
-
});
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
//#endregion
|
|
941
|
-
//#region src/primitives/dropdown-menu/dropdown-menu-overlay.tsx
|
|
942
|
-
function DropdownMenuOverlay(props) {
|
|
943
|
-
const menu = useDropdownMenu();
|
|
944
|
-
const composedStyle = [
|
|
945
|
-
StyleSheet.absoluteFill,
|
|
946
|
-
menu.styles?.overlay,
|
|
947
|
-
props.style
|
|
948
|
-
];
|
|
949
|
-
return /* @__PURE__ */ jsx(props.render ?? Pressable, {
|
|
950
|
-
onPress: () => {
|
|
951
|
-
menu.setIsOpen(false);
|
|
952
|
-
},
|
|
953
|
-
style: composedStyle,
|
|
954
|
-
children: props.children
|
|
955
|
-
});
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
//#endregion
|
|
959
|
-
//#region src/primitives/dropdown-menu/index.ts
|
|
960
|
-
const DropdownMenuPrimitive = {
|
|
961
|
-
Root: DropdownMenuRoot,
|
|
962
|
-
Trigger: DropdownMenuTrigger,
|
|
963
|
-
Portal: DropdownMenuPortal,
|
|
964
|
-
Overlay: DropdownMenuOverlay,
|
|
965
|
-
Content: DropdownMenuContent,
|
|
966
|
-
Button: DropdownMenuButton,
|
|
967
|
-
Divider: DropdownMenuDivider
|
|
968
|
-
};
|
|
969
|
-
|
|
970
|
-
//#endregion
|
|
971
|
-
//#region src/primitives/popover/context.ts
|
|
972
|
-
const PopoverContext = createContext(void 0);
|
|
973
|
-
const usePopover = () => {
|
|
974
|
-
const context = useContext(PopoverContext);
|
|
975
|
-
if (!context) throw new Error("usePopover must be used within a PopoverRoot");
|
|
976
|
-
return context;
|
|
977
|
-
};
|
|
978
|
-
|
|
979
|
-
//#endregion
|
|
980
|
-
//#region src/primitives/popover/popover-root.tsx
|
|
981
|
-
function PopoverRoot(props) {
|
|
982
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
983
|
-
const [contentLayout, setContentLayout] = useState(DEFAULT_LAYOUT);
|
|
984
|
-
const [triggerPosition, setTriggerPosition] = useState(DEFAULT_POSITION);
|
|
985
|
-
return /* @__PURE__ */ jsx(PopoverContext.Provider, {
|
|
986
|
-
value: {
|
|
987
|
-
isOpen,
|
|
988
|
-
setIsOpen,
|
|
989
|
-
contentLayout,
|
|
990
|
-
setContentLayout,
|
|
991
|
-
triggerPosition,
|
|
992
|
-
setTriggerPosition,
|
|
993
|
-
styles: props.styles
|
|
994
|
-
},
|
|
995
|
-
children: props.children
|
|
996
|
-
});
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
//#endregion
|
|
1000
|
-
//#region src/primitives/popover/popover-trigger.tsx
|
|
1001
|
-
const PopoverTrigger = forwardRef((props, ref) => {
|
|
1002
|
-
const popover = usePopover();
|
|
1003
|
-
const triggerRef = useRef(null);
|
|
1004
|
-
const onTriggerPress = async () => {
|
|
1005
|
-
triggerRef.current?.measureInWindow((pageX, pageY, width, height) => {
|
|
1006
|
-
popover.setTriggerPosition({
|
|
1007
|
-
height,
|
|
1008
|
-
width,
|
|
1009
|
-
pageX,
|
|
1010
|
-
pageY
|
|
1011
|
-
});
|
|
1012
|
-
});
|
|
1013
|
-
popover.setIsOpen((prev) => !prev);
|
|
1014
|
-
};
|
|
1015
|
-
useImperativeHandle(ref, () => ({
|
|
1016
|
-
open: () => popover.setIsOpen(true),
|
|
1017
|
-
close: () => popover.setIsOpen(false)
|
|
1018
|
-
}));
|
|
1019
|
-
return React.cloneElement(props.children, {
|
|
1020
|
-
ref: triggerRef,
|
|
1021
|
-
onPress: onTriggerPress,
|
|
1022
|
-
role: "button",
|
|
1023
|
-
accessible: true,
|
|
1024
|
-
accessibilityRole: "button",
|
|
1025
|
-
accessibilityState: { expanded: popover.isOpen },
|
|
1026
|
-
...props.children.props
|
|
1027
|
-
});
|
|
1028
|
-
});
|
|
1029
|
-
PopoverTrigger.displayName = "PopoverTrigger";
|
|
1030
|
-
|
|
1031
|
-
//#endregion
|
|
1032
|
-
//#region src/primitives/popover/popover-portal.tsx
|
|
1033
|
-
function PopoverPortal(props) {
|
|
1034
|
-
const popover = usePopover();
|
|
1035
|
-
if (!popover.isOpen) return null;
|
|
1036
|
-
return /* @__PURE__ */ jsx(Portal, {
|
|
1037
|
-
name: "popover-portal",
|
|
1038
|
-
children: /* @__PURE__ */ jsx(PopoverContext.Provider, {
|
|
1039
|
-
value: popover,
|
|
1040
|
-
children: props.children
|
|
1041
|
-
})
|
|
1042
|
-
});
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
//#endregion
|
|
1046
|
-
//#region src/primitives/popover/popover-overlay.tsx
|
|
1047
|
-
function PopoverOverlay(props) {
|
|
1048
|
-
const { closeOnPress = true, ...restProps } = props;
|
|
1049
|
-
const popover = usePopover();
|
|
1050
|
-
const composedStyle = [
|
|
1051
|
-
StyleSheet.absoluteFill,
|
|
1052
|
-
popover.styles?.overlay,
|
|
1053
|
-
props.style
|
|
1054
|
-
];
|
|
1055
|
-
return /* @__PURE__ */ jsx(props.render ?? Pressable, {
|
|
1056
|
-
...restProps,
|
|
1057
|
-
onPress: () => {
|
|
1058
|
-
if (closeOnPress) popover.setIsOpen(false);
|
|
1059
|
-
props.onPress?.();
|
|
1060
|
-
},
|
|
1061
|
-
style: composedStyle,
|
|
1062
|
-
children: props.children
|
|
1063
|
-
});
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
//#endregion
|
|
1067
|
-
//#region src/primitives/popover/popover-content.tsx
|
|
1068
|
-
function PopoverContent(props) {
|
|
1069
|
-
const popover = usePopover();
|
|
1070
|
-
const composedStyle = [
|
|
1071
|
-
useRelativePosition({
|
|
1072
|
-
align: "start",
|
|
1073
|
-
avoidCollisions: true,
|
|
1074
|
-
triggerPosition: popover.triggerPosition,
|
|
1075
|
-
contentLayout: popover.contentLayout,
|
|
1076
|
-
alignOffset: 0,
|
|
1077
|
-
side: "bottom",
|
|
1078
|
-
sideOffset: 0
|
|
1079
|
-
}),
|
|
1080
|
-
popover.styles?.content,
|
|
1081
|
-
props.style
|
|
1082
|
-
];
|
|
1083
|
-
return /* @__PURE__ */ jsx(props.render ?? View, {
|
|
1084
|
-
...props,
|
|
1085
|
-
onLayout: (e) => {
|
|
1086
|
-
popover.setContentLayout(e.nativeEvent.layout);
|
|
1087
|
-
},
|
|
1088
|
-
style: composedStyle
|
|
1089
|
-
});
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
//#endregion
|
|
1093
|
-
//#region src/primitives/popover/popover-close.tsx
|
|
1094
|
-
function PopoverClose(props) {
|
|
1095
|
-
const popover = usePopover();
|
|
1096
|
-
return /* @__PURE__ */ jsx(props.render ?? Pressable, {
|
|
1097
|
-
...props,
|
|
1098
|
-
onPress: () => {
|
|
1099
|
-
popover.setIsOpen(false);
|
|
1100
|
-
props.onPress?.();
|
|
1101
|
-
},
|
|
1102
|
-
style: props.style
|
|
1103
|
-
});
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
//#endregion
|
|
1107
|
-
//#region src/primitives/popover/index.ts
|
|
1108
|
-
const PopoverPrimitive = {
|
|
1109
|
-
Root: PopoverRoot,
|
|
1110
|
-
Trigger: PopoverTrigger,
|
|
1111
|
-
Portal: PopoverPortal,
|
|
1112
|
-
Overlay: PopoverOverlay,
|
|
1113
|
-
Content: PopoverContent,
|
|
1114
|
-
Close: PopoverClose
|
|
1115
|
-
};
|
|
1116
|
-
|
|
1117
|
-
//#endregion
|
|
1118
|
-
//#region src/primitives/calendar/context.ts
|
|
1119
|
-
const CalendarContext = React.createContext(void 0);
|
|
1120
|
-
const useCalendarContext = () => {
|
|
1121
|
-
const context = React.useContext(CalendarContext);
|
|
1122
|
-
if (!context) throw new Error("Calendar components must be used within CalendarRoot");
|
|
1123
|
-
return context;
|
|
1124
|
-
};
|
|
1125
|
-
|
|
1126
|
-
//#endregion
|
|
1127
|
-
//#region src/primitives/calendar/calendar-root.tsx
|
|
1128
|
-
function CalendarRoot(props) {
|
|
1129
|
-
const { children, value, onChange, defaultMonth = /* @__PURE__ */ new Date(), minDate, maxDate, style, styles, ...viewProps } = props;
|
|
1130
|
-
const [currentMonth, setCurrentMonth] = useState(defaultMonth);
|
|
1131
|
-
const containerStyle = [styles?.root, style];
|
|
1132
|
-
return /* @__PURE__ */ jsx(CalendarContext.Provider, {
|
|
1133
|
-
value: {
|
|
1134
|
-
value,
|
|
1135
|
-
onChange,
|
|
1136
|
-
currentMonth,
|
|
1137
|
-
setCurrentMonth,
|
|
1138
|
-
styles,
|
|
1139
|
-
minDate,
|
|
1140
|
-
maxDate
|
|
1141
|
-
},
|
|
1142
|
-
children: /* @__PURE__ */ jsx(View, {
|
|
1143
|
-
...viewProps,
|
|
1144
|
-
style: containerStyle,
|
|
1145
|
-
children
|
|
1146
|
-
})
|
|
1147
|
-
});
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
//#endregion
|
|
1151
|
-
//#region src/primitives/calendar/calendar-header.tsx
|
|
1152
|
-
function CalendarHeader(props) {
|
|
1153
|
-
const { children, style, ...viewProps } = props;
|
|
1154
|
-
const { styles } = useCalendarContext();
|
|
1155
|
-
const headerStyle = [styles?.header, style];
|
|
1156
|
-
return /* @__PURE__ */ jsx(View, {
|
|
1157
|
-
...viewProps,
|
|
1158
|
-
style: headerStyle,
|
|
1159
|
-
children
|
|
1160
|
-
});
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
//#endregion
|
|
1164
|
-
//#region src/utils/date-utils.ts
|
|
1165
|
-
const formatDate = (date, format) => {
|
|
1166
|
-
const months = [
|
|
1167
|
-
"January",
|
|
1168
|
-
"February",
|
|
1169
|
-
"March",
|
|
1170
|
-
"April",
|
|
1171
|
-
"May",
|
|
1172
|
-
"June",
|
|
1173
|
-
"July",
|
|
1174
|
-
"August",
|
|
1175
|
-
"September",
|
|
1176
|
-
"October",
|
|
1177
|
-
"November",
|
|
1178
|
-
"December"
|
|
1179
|
-
];
|
|
1180
|
-
const day = date.getDate();
|
|
1181
|
-
const month = months[date.getMonth()];
|
|
1182
|
-
const year = date.getFullYear();
|
|
1183
|
-
if (format === "MMMM yyyy") return `${month} ${year}`;
|
|
1184
|
-
if (format === "d") return day.toString();
|
|
1185
|
-
return date.toLocaleDateString();
|
|
1186
|
-
};
|
|
1187
|
-
const isDateSameDay = (date1, date2) => {
|
|
1188
|
-
return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
|
|
1189
|
-
};
|
|
1190
|
-
const isDateToday = (date) => {
|
|
1191
|
-
return isDateSameDay(date, /* @__PURE__ */ new Date());
|
|
1192
|
-
};
|
|
1193
|
-
const isDateBefore = (date1, date2) => {
|
|
1194
|
-
const d1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());
|
|
1195
|
-
const d2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
|
|
1196
|
-
return d1.getTime() < d2.getTime();
|
|
1197
|
-
};
|
|
1198
|
-
const isDateAfter = (date1, date2) => {
|
|
1199
|
-
const d1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());
|
|
1200
|
-
const d2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
|
|
1201
|
-
return d1.getTime() > d2.getTime();
|
|
1202
|
-
};
|
|
1203
|
-
const addMonths = (date, months) => {
|
|
1204
|
-
const newDate = new Date(date);
|
|
1205
|
-
newDate.setMonth(newDate.getMonth() + months);
|
|
1206
|
-
return newDate;
|
|
1207
|
-
};
|
|
1208
|
-
const subMonths = (date, months) => {
|
|
1209
|
-
return addMonths(date, -months);
|
|
1210
|
-
};
|
|
1211
|
-
const startOfMonth = (date) => {
|
|
1212
|
-
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
1213
|
-
};
|
|
1214
|
-
const endOfMonth = (date) => {
|
|
1215
|
-
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
1216
|
-
};
|
|
1217
|
-
const getDaysInMonth = (date) => {
|
|
1218
|
-
return endOfMonth(date).getDate();
|
|
1219
|
-
};
|
|
1220
|
-
const getFirstDayOfMonth = (date) => {
|
|
1221
|
-
return startOfMonth(date).getDay();
|
|
1222
|
-
};
|
|
1223
|
-
const isSameMonth = (date1, date2) => {
|
|
1224
|
-
return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth();
|
|
1225
|
-
};
|
|
1226
|
-
const getWeekDays = (month, year, week) => {
|
|
1227
|
-
const days = [];
|
|
1228
|
-
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
1229
|
-
const daysInMonth = getDaysInMonth(new Date(year, month));
|
|
1230
|
-
const startDay = week * 7 - (firstDayOfMonth === 0 ? 6 : firstDayOfMonth - 1);
|
|
1231
|
-
for (let i = 0; i < 7; i++) {
|
|
1232
|
-
const day = startDay + i;
|
|
1233
|
-
let date;
|
|
1234
|
-
if (day < 1) {
|
|
1235
|
-
const prevMonth = month === 0 ? 11 : month - 1;
|
|
1236
|
-
const prevYear = month === 0 ? year - 1 : year;
|
|
1237
|
-
const daysInPrevMonth = getDaysInMonth(new Date(prevYear, prevMonth));
|
|
1238
|
-
date = new Date(prevYear, prevMonth, daysInPrevMonth + day);
|
|
1239
|
-
} else if (day > daysInMonth) {
|
|
1240
|
-
const nextMonth = month === 11 ? 0 : month + 1;
|
|
1241
|
-
const nextYear = month === 11 ? year + 1 : year;
|
|
1242
|
-
date = new Date(nextYear, nextMonth, day - daysInMonth);
|
|
1243
|
-
} else date = new Date(year, month, day);
|
|
1244
|
-
days.push(date);
|
|
1245
|
-
}
|
|
1246
|
-
return days;
|
|
1247
|
-
};
|
|
1248
|
-
const getWeeksInMonth = (date) => {
|
|
1249
|
-
const firstDayOfMonth = getFirstDayOfMonth(date);
|
|
1250
|
-
const daysInMonth = getDaysInMonth(date);
|
|
1251
|
-
return Math.ceil((firstDayOfMonth + daysInMonth) / 7);
|
|
1252
|
-
};
|
|
1253
|
-
|
|
1254
|
-
//#endregion
|
|
1255
|
-
//#region src/primitives/calendar/calendar-title.tsx
|
|
1256
|
-
function CalendarTitle(props) {
|
|
1257
|
-
const { children, style, formatStr = "MMMM yyyy", ...textProps } = props;
|
|
1258
|
-
const { currentMonth, styles } = useCalendarContext();
|
|
1259
|
-
const titleStyle = [styles?.headerTitle, style];
|
|
1260
|
-
return /* @__PURE__ */ jsx(Text, {
|
|
1261
|
-
...textProps,
|
|
1262
|
-
style: titleStyle,
|
|
1263
|
-
children: children ?? formatDate(currentMonth, formatStr)
|
|
1264
|
-
});
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
//#endregion
|
|
1268
|
-
//#region src/primitives/calendar/calendar-nav-button.tsx
|
|
1269
|
-
const calculateState$1 = (isDisabled, isHovered) => {
|
|
1270
|
-
if (isDisabled) return "disabled";
|
|
1271
|
-
if (isHovered) return "hovered";
|
|
1272
|
-
return "default";
|
|
1273
|
-
};
|
|
1274
|
-
function CalendarNavButton(props) {
|
|
1275
|
-
const { children = props.direction === "prev" ? "‹" : "›", direction, style, textStyle, ...pressableProps } = props;
|
|
1276
|
-
const { currentMonth, setCurrentMonth, minDate, maxDate, styles } = useCalendarContext();
|
|
1277
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
1278
|
-
const isDisabled = React.useMemo(() => {
|
|
1279
|
-
if (direction === "prev" && minDate) return subMonths(currentMonth, 1) < minDate;
|
|
1280
|
-
if (direction === "next" && maxDate) return addMonths(currentMonth, 1) > maxDate;
|
|
1281
|
-
return false;
|
|
1282
|
-
}, [
|
|
1283
|
-
direction,
|
|
1284
|
-
currentMonth,
|
|
1285
|
-
minDate,
|
|
1286
|
-
maxDate
|
|
1287
|
-
]);
|
|
1288
|
-
const state = calculateState$1(isDisabled, isHovered);
|
|
1289
|
-
const handlePress = () => {
|
|
1290
|
-
if (isDisabled) return;
|
|
1291
|
-
setCurrentMonth(direction === "prev" ? subMonths(currentMonth, 1) : addMonths(currentMonth, 1));
|
|
1292
|
-
};
|
|
1293
|
-
const buttonStyle = [
|
|
1294
|
-
styles?.navButton?.default,
|
|
1295
|
-
styles?.navButton?.[state],
|
|
1296
|
-
style
|
|
1297
|
-
];
|
|
1298
|
-
const textStyleCombined = [
|
|
1299
|
-
styles?.navButtonText?.default,
|
|
1300
|
-
styles?.navButtonText?.[state],
|
|
1301
|
-
textStyle
|
|
1302
|
-
];
|
|
1303
|
-
return /* @__PURE__ */ jsx(Pressable, {
|
|
1304
|
-
...pressableProps,
|
|
1305
|
-
onPress: handlePress,
|
|
1306
|
-
onHoverIn: () => setIsHovered(true),
|
|
1307
|
-
onHoverOut: () => setIsHovered(false),
|
|
1308
|
-
disabled: isDisabled,
|
|
1309
|
-
style: buttonStyle,
|
|
1310
|
-
children: /* @__PURE__ */ jsx(Text, {
|
|
1311
|
-
style: textStyleCombined,
|
|
1312
|
-
children
|
|
1313
|
-
})
|
|
1314
|
-
});
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
//#endregion
|
|
1318
|
-
//#region src/primitives/calendar/calendar-week-labels.tsx
|
|
1319
|
-
function CalendarWeekLabel(props) {
|
|
1320
|
-
const { styles } = useCalendarContext();
|
|
1321
|
-
return /* @__PURE__ */ jsx(Text, {
|
|
1322
|
-
numberOfLines: 1,
|
|
1323
|
-
style: [styles?.weekLabel, props.style],
|
|
1324
|
-
children: props.children
|
|
1325
|
-
});
|
|
1326
|
-
}
|
|
1327
|
-
const DEFAULT_WEEK_DAYS = [
|
|
1328
|
-
"Su",
|
|
1329
|
-
"Mo",
|
|
1330
|
-
"Tu",
|
|
1331
|
-
"We",
|
|
1332
|
-
"Th",
|
|
1333
|
-
"Fr",
|
|
1334
|
-
"Sa"
|
|
1335
|
-
];
|
|
1336
|
-
function CalendarWeekLabels(props) {
|
|
1337
|
-
const { weekDays = DEFAULT_WEEK_DAYS, style } = props;
|
|
1338
|
-
const { styles } = useCalendarContext();
|
|
1339
|
-
return /* @__PURE__ */ jsx(View, {
|
|
1340
|
-
style: [styles?.weekLabels, style],
|
|
1341
|
-
children: weekDays.map((day, index) => /* @__PURE__ */ jsx(CalendarWeekLabel, {
|
|
1342
|
-
style: styles?.weekLabel,
|
|
1343
|
-
children: day
|
|
1344
|
-
}, index))
|
|
1345
|
-
});
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1348
|
-
//#endregion
|
|
1349
|
-
//#region src/primitives/calendar/calendar-day.tsx
|
|
1350
|
-
const calculateState = (date, selected, isCurrentMonth, isDisabled, isHovered) => {
|
|
1351
|
-
if (isDisabled) return "disabled";
|
|
1352
|
-
if (selected && isDateSameDay(date, selected)) return "selected";
|
|
1353
|
-
if (isDateToday(date)) return "today";
|
|
1354
|
-
if (isHovered) return "hovered";
|
|
1355
|
-
if (!isCurrentMonth) return "deprioritized";
|
|
1356
|
-
return "default";
|
|
1357
|
-
};
|
|
1358
|
-
function CalendarDay(props) {
|
|
1359
|
-
const calendar = useCalendarContext();
|
|
1360
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
1361
|
-
const isCurrentMonth = isSameMonth(props.date, calendar.currentMonth);
|
|
1362
|
-
const isDisabled = useMemo(() => {
|
|
1363
|
-
if (calendar.minDate && isDateBefore(props.date, calendar.minDate)) return true;
|
|
1364
|
-
if (calendar.maxDate && isDateAfter(props.date, calendar.maxDate)) return true;
|
|
1365
|
-
return false;
|
|
1366
|
-
}, [
|
|
1367
|
-
props.date,
|
|
1368
|
-
calendar.minDate,
|
|
1369
|
-
calendar.maxDate
|
|
1370
|
-
]);
|
|
1371
|
-
const state = calculateState(props.date, calendar.value, isCurrentMonth, isDisabled, isHovered);
|
|
1372
|
-
const handlePress = () => {
|
|
1373
|
-
console.log("Day pressed:", isDisabled, calendar.onChange);
|
|
1374
|
-
if (isDisabled || !calendar.onChange) return;
|
|
1375
|
-
calendar.onChange(props.date);
|
|
1376
|
-
};
|
|
1377
|
-
return /* @__PURE__ */ jsx(Pressable, {
|
|
1378
|
-
onPress: handlePress,
|
|
1379
|
-
onHoverIn: () => setIsHovered(true),
|
|
1380
|
-
onHoverOut: () => setIsHovered(false),
|
|
1381
|
-
disabled: isDisabled,
|
|
1382
|
-
style: [
|
|
1383
|
-
calendar.styles?.dayButton?.default,
|
|
1384
|
-
calendar.styles?.dayButton?.[state],
|
|
1385
|
-
props.style
|
|
1386
|
-
],
|
|
1387
|
-
children: /* @__PURE__ */ jsx(Text, {
|
|
1388
|
-
style: [
|
|
1389
|
-
calendar.styles?.dayText?.default,
|
|
1390
|
-
calendar.styles?.dayText?.[state],
|
|
1391
|
-
props.textStyle
|
|
1392
|
-
],
|
|
1393
|
-
children: formatDate(props.date, "d")
|
|
1394
|
-
})
|
|
1395
|
-
});
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
//#endregion
|
|
1399
|
-
//#region src/primitives/calendar/calendar-weeks.tsx
|
|
1400
|
-
function CalendarWeek(props) {
|
|
1401
|
-
const { style, ...viewProps } = props;
|
|
1402
|
-
const { currentMonth, styles } = useCalendarContext();
|
|
1403
|
-
const days = getWeekDays(currentMonth.getMonth(), currentMonth.getFullYear(), props.index);
|
|
1404
|
-
const composedStyle = [styles?.week, style];
|
|
1405
|
-
return /* @__PURE__ */ jsx(View, {
|
|
1406
|
-
...viewProps,
|
|
1407
|
-
style: composedStyle,
|
|
1408
|
-
children: days.map((day, index) => {
|
|
1409
|
-
return /* @__PURE__ */ jsx(CalendarDay, { date: day }, index);
|
|
1410
|
-
})
|
|
1411
|
-
});
|
|
1412
|
-
}
|
|
1413
|
-
function CalendarWeeks(props) {
|
|
1414
|
-
const { currentMonth, styles } = useCalendarContext();
|
|
1415
|
-
const weeks = getWeeksInMonth(currentMonth);
|
|
1416
|
-
return /* @__PURE__ */ jsx(View, {
|
|
1417
|
-
style: [styles?.weeks, props.style],
|
|
1418
|
-
children: Array.from({ length: weeks }).map((_, index) => {
|
|
1419
|
-
return /* @__PURE__ */ jsx(CalendarWeek, { index }, index);
|
|
1420
|
-
})
|
|
1421
|
-
});
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
//#endregion
|
|
1425
|
-
//#region src/primitives/calendar/index.ts
|
|
1426
|
-
const CalendarPrimitive = {
|
|
1427
|
-
Root: CalendarRoot,
|
|
1428
|
-
Header: CalendarHeader,
|
|
1429
|
-
Title: CalendarTitle,
|
|
1430
|
-
NavButton: CalendarNavButton,
|
|
1431
|
-
CalendarWeekLabels,
|
|
1432
|
-
Weeks: CalendarWeeks,
|
|
1433
|
-
Day: CalendarDay
|
|
1434
|
-
};
|
|
1435
|
-
|
|
1436
|
-
//#endregion
|
|
1437
|
-
export { DEFAULT_PORTAL_HOST as _, TextareaPrimitive as a, AvatarPrimitive as c, SelectPrimitive as d, ButtonPrimitive as f, PortalHost as g, Portal as h, DropdownMenuPrimitive as i, EmptyPrimitive as l, FieldPrimitive as m, PopoverPrimitive as n, BadgePrimitive as o, InputPrimitive as p, usePopover as r, ToastPrimitive as s, CalendarPrimitive as t, CardPrimitive as u };
|