@korsolutions/ui 0.0.84 → 0.0.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/components/alert/components/alert-description.js.map +1 -1
- package/dist/module/components/alert/components/alert-icon.js.map +1 -1
- package/dist/module/components/alert/components/alert-root.js +7 -3
- package/dist/module/components/alert/components/alert-root.js.map +1 -1
- package/dist/module/components/alert-dialog/async-alert-dialog.js.map +1 -1
- package/dist/module/components/alert-dialog/components/alert-dialog-root.js +7 -3
- package/dist/module/components/alert-dialog/components/alert-dialog-root.js.map +1 -1
- package/dist/module/components/avatar/components/avatar-image.js.map +1 -1
- package/dist/module/components/avatar/components/avatar-root.js +7 -3
- package/dist/module/components/avatar/components/avatar-root.js.map +1 -1
- package/dist/module/components/badge/badge.js +11 -4
- package/dist/module/components/badge/badge.js.map +1 -1
- package/dist/module/components/button/button.js +6 -2
- package/dist/module/components/button/button.js.map +1 -1
- package/dist/module/components/calendar/calendar/calendar-root.js +6 -2
- package/dist/module/components/calendar/calendar/calendar-root.js.map +1 -1
- package/dist/module/components/calendar/calendar/calendar-weeks.js +6 -9
- package/dist/module/components/calendar/calendar/calendar-weeks.js.map +1 -1
- package/dist/module/components/calendar/shared/calendar-context.js.map +1 -1
- package/dist/module/components/calendar/shared/calendar-day.js.map +1 -1
- package/dist/module/components/calendar/shared/calendar-header.js.map +1 -1
- package/dist/module/components/calendar/shared/calendar-nav-buttons.js +4 -4
- package/dist/module/components/calendar/shared/calendar-nav-buttons.js.map +1 -1
- package/dist/module/components/calendar/shared/calendar-title.js.map +1 -1
- package/dist/module/components/calendar/shared/calendar-week-labels.js.map +1 -1
- package/dist/module/components/calendar/timeline/calendar-timeline.js.map +1 -1
- package/dist/module/components/calendar/week-calendar/week-calendar.js +4 -4
- package/dist/module/components/calendar/week-calendar/week-calendar.js.map +1 -1
- package/dist/module/components/card/card-root.js +6 -3
- package/dist/module/components/card/card-root.js.map +1 -1
- package/dist/module/components/checkbox/components/checkbox-root.js +7 -3
- package/dist/module/components/checkbox/components/checkbox-root.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-content.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-option.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-overlay.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-portal.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-root.js +7 -3
- package/dist/module/components/combobox/components/combobox-root.js.map +1 -1
- package/dist/module/components/combobox/components/combobox-trigger.js.map +1 -1
- package/dist/module/components/combobox/context.js.map +1 -1
- package/dist/module/components/empty/components/empty-root.js +6 -2
- package/dist/module/components/empty/components/empty-root.js.map +1 -1
- package/dist/module/components/field/components/field-label.js.map +1 -1
- package/dist/module/components/field/components/field-root.js +6 -2
- package/dist/module/components/field/components/field-root.js.map +1 -1
- package/dist/module/components/icon/icon.js.map +1 -1
- package/dist/module/components/icon-button/icon-button.js +7 -3
- package/dist/module/components/icon-button/icon-button.js.map +1 -1
- package/dist/module/components/index.js +1 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/input/input.js +7 -3
- package/dist/module/components/input/input.js.map +1 -1
- package/dist/module/components/input/numeric-input.js +0 -1
- package/dist/module/components/input/numeric-input.js.map +1 -1
- package/dist/module/components/menu/components/menu-checkbox-item.js.map +1 -1
- package/dist/module/components/menu/components/menu-item.js.map +1 -1
- package/dist/module/components/menu/components/menu-overlay.js.map +1 -1
- package/dist/module/components/menu/components/menu-radio-group.js.map +1 -1
- package/dist/module/components/menu/components/menu-radio-item.js.map +1 -1
- package/dist/module/components/menu/components/menu-root.js +6 -2
- package/dist/module/components/menu/components/menu-root.js.map +1 -1
- package/dist/module/components/menu/components/menu-selection-indicator.js +3 -3
- package/dist/module/components/menu/components/menu-selection-indicator.js.map +1 -1
- package/dist/module/components/menu/components/menu-trigger.js.map +1 -1
- package/dist/module/components/menu/context.js.map +1 -1
- package/dist/module/components/phone-input/components/country-picker.js.map +1 -1
- package/dist/module/components/phone-input/components/phone-input-root.js +7 -3
- package/dist/module/components/phone-input/components/phone-input-root.js.map +1 -1
- package/dist/module/components/phone-input/components/phone-input.js.map +1 -1
- package/dist/module/components/phone-input/context.js.map +1 -1
- package/dist/module/components/popover/components/popover-overlay.js.map +1 -1
- package/dist/module/components/popover/components/popover-root.js +6 -2
- package/dist/module/components/popover/components/popover-root.js.map +1 -1
- package/dist/module/components/popover/components/popover-trigger.js.map +1 -1
- package/dist/module/components/portal/portal.js.map +1 -1
- package/dist/module/components/progress/components/progress-indicator.js.map +1 -1
- package/dist/module/components/progress/components/progress-root.js +6 -3
- package/dist/module/components/progress/components/progress-root.js.map +1 -1
- package/dist/module/components/radio-group/components/radio-group-item.js.map +1 -1
- package/dist/module/components/radio-group/components/radio-group-root.js +7 -3
- package/dist/module/components/radio-group/components/radio-group-root.js.map +1 -1
- package/dist/module/components/select/components/select-content.js.map +1 -1
- package/dist/module/components/select/components/select-option.js.map +1 -1
- package/dist/module/components/select/components/select-overlay.js.map +1 -1
- package/dist/module/components/select/components/select-portal.js.map +1 -1
- package/dist/module/components/select/components/select-root.js +7 -4
- package/dist/module/components/select/components/select-root.js.map +1 -1
- package/dist/module/components/select/components/select-trigger.js.map +1 -1
- package/dist/module/components/separator/separator.js +5 -1
- package/dist/module/components/separator/separator.js.map +1 -1
- package/dist/module/components/spinner/spinner.js +7 -3
- package/dist/module/components/spinner/spinner.js.map +1 -1
- package/dist/module/components/table/context.js +12 -0
- package/dist/module/components/table/context.js.map +1 -0
- package/dist/module/components/table/index.js +17 -0
- package/dist/module/components/table/index.js.map +1 -0
- package/dist/module/components/table/table-body.js +17 -0
- package/dist/module/components/table/table-body.js.map +1 -0
- package/dist/module/components/table/table-cell.js +17 -0
- package/dist/module/components/table/table-cell.js.map +1 -0
- package/dist/module/components/table/table-head.js +17 -0
- package/dist/module/components/table/table-head.js.map +1 -0
- package/dist/module/components/table/table-header.js +17 -0
- package/dist/module/components/table/table-header.js.map +1 -0
- package/dist/module/components/table/table-root.js +27 -0
- package/dist/module/components/table/table-root.js.map +1 -0
- package/dist/module/components/table/table-row.js +17 -0
- package/dist/module/components/table/table-row.js.map +1 -0
- package/dist/module/components/table/types.js +4 -0
- package/dist/module/components/table/types.js.map +1 -0
- package/dist/module/components/table/variants/default.js +48 -0
- package/dist/module/components/table/variants/default.js.map +1 -0
- package/dist/module/components/table/variants/index.js +7 -0
- package/dist/module/components/table/variants/index.js.map +1 -0
- package/dist/module/components/tabs/components/tabs-item.js.map +1 -1
- package/dist/module/components/tabs/components/tabs-root.js +7 -3
- package/dist/module/components/tabs/components/tabs-root.js.map +1 -1
- package/dist/module/components/textarea/textarea.js +7 -3
- package/dist/module/components/textarea/textarea.js.map +1 -1
- package/dist/module/components/toast/components/toast-icon.js.map +1 -1
- package/dist/module/components/toast/components/toast-root.js +6 -2
- package/dist/module/components/toast/components/toast-root.js.map +1 -1
- package/dist/module/components/toast/manager.js +3 -3
- package/dist/module/components/toast/manager.js.map +1 -1
- package/dist/module/components/touchable/touchable.js +5 -1
- package/dist/module/components/touchable/touchable.js.map +1 -1
- package/dist/module/hooks/use-color-scheme.js.map +1 -1
- package/dist/module/hooks/use-is-react-navigation-modal.js.map +1 -1
- package/dist/module/hooks/use-numeric-mask.js.map +1 -1
- package/dist/module/hooks/use-phone-mask.js.map +1 -1
- package/dist/module/hooks/use-relative-position.js.map +1 -1
- package/dist/module/hooks/use-screen-size.js.map +1 -1
- package/dist/module/index.js +1 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/themes/index.js +2 -2
- package/dist/module/themes/index.js.map +1 -1
- package/dist/module/themes/provider.js +5 -1
- package/dist/module/themes/provider.js.map +1 -1
- package/dist/module/themes/types.js +2 -0
- package/dist/module/utils/calculate-styles.js +26 -0
- package/dist/module/utils/calculate-styles.js.map +1 -1
- package/dist/module/utils/date-utils.js.map +1 -1
- package/dist/module/utils/input-utils.js.map +1 -1
- package/dist/module/utils/normalize-layout.js.map +1 -1
- package/dist/module/utils/use-themed-styles.js.map +1 -1
- package/dist/typescript/src/components/alert/components/alert-description.d.ts.map +1 -1
- package/dist/typescript/src/components/alert/components/alert-icon.d.ts.map +1 -1
- package/dist/typescript/src/components/alert/components/alert-root.d.ts +1 -1
- package/dist/typescript/src/components/alert/components/alert-root.d.ts.map +1 -1
- package/dist/typescript/src/components/alert-dialog/async-alert-dialog.d.ts.map +1 -1
- package/dist/typescript/src/components/alert-dialog/components/alert-dialog-root.d.ts.map +1 -1
- package/dist/typescript/src/components/avatar/components/avatar-image.d.ts.map +1 -1
- package/dist/typescript/src/components/avatar/components/avatar-root.d.ts.map +1 -1
- package/dist/typescript/src/components/badge/badge.d.ts.map +1 -1
- package/dist/typescript/src/components/button/button.d.ts.map +1 -1
- package/dist/typescript/src/components/button/types.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/calendar/calendar-root.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/calendar/calendar-weeks.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/index.d.ts +1 -1
- package/dist/typescript/src/components/calendar/index.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/shared/calendar-context.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/shared/calendar-day.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/shared/calendar-header.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/shared/calendar-nav-buttons.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/shared/calendar-title.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/shared/calendar-week-labels.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/shared/types.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/timeline/calendar-timeline.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/timeline/index.d.ts +1 -1
- package/dist/typescript/src/components/calendar/timeline/index.d.ts.map +1 -1
- package/dist/typescript/src/components/calendar/week-calendar/week-calendar.d.ts.map +1 -1
- package/dist/typescript/src/components/card/card-root.d.ts +1 -1
- package/dist/typescript/src/components/card/card-root.d.ts.map +1 -1
- package/dist/typescript/src/components/checkbox/components/checkbox-root.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-content.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-option.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-overlay.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-portal.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-root.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/components/combobox-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/combobox/context.d.ts.map +1 -1
- package/dist/typescript/src/components/empty/components/empty-root.d.ts.map +1 -1
- package/dist/typescript/src/components/field/components/field-label.d.ts.map +1 -1
- package/dist/typescript/src/components/field/components/field-root.d.ts.map +1 -1
- package/dist/typescript/src/components/icon/icon.d.ts.map +1 -1
- package/dist/typescript/src/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/typescript/src/components/index.d.ts +1 -0
- package/dist/typescript/src/components/index.d.ts.map +1 -1
- package/dist/typescript/src/components/input/input.d.ts.map +1 -1
- package/dist/typescript/src/components/input/numeric-input.d.ts +1 -1
- package/dist/typescript/src/components/input/numeric-input.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-checkbox-item.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-item.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-overlay.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-radio-group.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-radio-item.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-root.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-selection-indicator.d.ts +1 -1
- package/dist/typescript/src/components/menu/components/menu-selection-indicator.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/context.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/types.d.ts.map +1 -1
- package/dist/typescript/src/components/phone-input/components/country-picker.d.ts.map +1 -1
- package/dist/typescript/src/components/phone-input/components/phone-input-root.d.ts.map +1 -1
- package/dist/typescript/src/components/phone-input/components/phone-input.d.ts +1 -1
- package/dist/typescript/src/components/phone-input/components/phone-input.d.ts.map +1 -1
- package/dist/typescript/src/components/phone-input/context.d.ts.map +1 -1
- package/dist/typescript/src/components/phone-input/types.d.ts.map +1 -1
- package/dist/typescript/src/components/popover/components/popover-overlay.d.ts.map +1 -1
- package/dist/typescript/src/components/popover/components/popover-root.d.ts.map +1 -1
- package/dist/typescript/src/components/popover/components/popover-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/portal/portal.d.ts +2 -2
- package/dist/typescript/src/components/portal/portal.d.ts.map +1 -1
- package/dist/typescript/src/components/progress/components/progress-indicator.d.ts.map +1 -1
- package/dist/typescript/src/components/progress/components/progress-root.d.ts.map +1 -1
- package/dist/typescript/src/components/radio-group/components/radio-group-item.d.ts.map +1 -1
- package/dist/typescript/src/components/radio-group/components/radio-group-root.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-content.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-option.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-overlay.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-portal.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-root.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-trigger.d.ts.map +1 -1
- package/dist/typescript/src/components/separator/separator.d.ts.map +1 -1
- package/dist/typescript/src/components/spinner/spinner.d.ts.map +1 -1
- package/dist/typescript/src/components/table/context.d.ts +8 -0
- package/dist/typescript/src/components/table/context.d.ts.map +1 -0
- package/dist/typescript/src/components/table/index.d.ts +22 -0
- package/dist/typescript/src/components/table/index.d.ts.map +1 -0
- package/dist/typescript/src/components/table/table-body.d.ts +9 -0
- package/dist/typescript/src/components/table/table-body.d.ts.map +1 -0
- package/dist/typescript/src/components/table/table-cell.d.ts +9 -0
- package/dist/typescript/src/components/table/table-cell.d.ts.map +1 -0
- package/dist/typescript/src/components/table/table-head.d.ts +9 -0
- package/dist/typescript/src/components/table/table-head.d.ts.map +1 -0
- package/dist/typescript/src/components/table/table-header.d.ts +9 -0
- package/dist/typescript/src/components/table/table-header.d.ts.map +1 -0
- package/dist/typescript/src/components/table/table-root.d.ts +11 -0
- package/dist/typescript/src/components/table/table-root.d.ts.map +1 -0
- package/dist/typescript/src/components/table/table-row.d.ts +9 -0
- package/dist/typescript/src/components/table/table-row.d.ts.map +1 -0
- package/dist/typescript/src/components/table/types.d.ts +16 -0
- package/dist/typescript/src/components/table/types.d.ts.map +1 -0
- package/dist/typescript/src/components/table/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/table/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/table/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/table/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/tabs/components/tabs-item.d.ts.map +1 -1
- package/dist/typescript/src/components/tabs/components/tabs-root.d.ts.map +1 -1
- package/dist/typescript/src/components/textarea/textarea.d.ts.map +1 -1
- package/dist/typescript/src/components/toast/components/toast-icon.d.ts.map +1 -1
- package/dist/typescript/src/components/toast/components/toast-root.d.ts.map +1 -1
- package/dist/typescript/src/components/toast/manager.d.ts.map +1 -1
- package/dist/typescript/src/components/touchable/touchable.d.ts.map +1 -1
- package/dist/typescript/src/hooks/use-color-scheme.d.ts.map +1 -1
- package/dist/typescript/src/hooks/use-is-react-navigation-modal.d.ts.map +1 -1
- package/dist/typescript/src/hooks/use-numeric-mask.d.ts.map +1 -1
- package/dist/typescript/src/hooks/use-phone-mask.d.ts.map +1 -1
- package/dist/typescript/src/hooks/use-relative-position.d.ts.map +1 -1
- package/dist/typescript/src/hooks/use-screen-size.d.ts.map +1 -1
- package/dist/typescript/src/index.d.ts +3 -2
- package/dist/typescript/src/index.d.ts.map +1 -1
- package/dist/typescript/src/themes/index.d.ts +2 -2
- package/dist/typescript/src/themes/index.d.ts.map +1 -1
- package/dist/typescript/src/themes/provider.d.ts +2 -19
- package/dist/typescript/src/themes/provider.d.ts.map +1 -1
- package/dist/typescript/src/themes/types.d.ts +123 -0
- package/dist/typescript/src/themes/types.d.ts.map +1 -1
- package/dist/typescript/src/utils/calculate-styles.d.ts +1 -0
- package/dist/typescript/src/utils/calculate-styles.d.ts.map +1 -1
- package/dist/typescript/src/utils/date-utils.d.ts.map +1 -1
- package/dist/typescript/src/utils/input-utils.d.ts.map +1 -1
- package/dist/typescript/src/utils/normalize-layout.d.ts.map +1 -1
- package/dist/typescript/src/utils/use-themed-styles.d.ts.map +1 -1
- package/package.json +8 -7
- package/src/components/alert/components/alert-description.tsx +1 -3
- package/src/components/alert/components/alert-icon.tsx +4 -1
- package/src/components/alert/components/alert-root.tsx +9 -4
- package/src/components/alert-dialog/async-alert-dialog.tsx +6 -25
- package/src/components/alert-dialog/components/alert-dialog-root.tsx +8 -3
- package/src/components/avatar/components/avatar-image.tsx +1 -6
- package/src/components/avatar/components/avatar-root.tsx +8 -3
- package/src/components/badge/badge.tsx +10 -12
- package/src/components/button/button.tsx +10 -22
- package/src/components/button/types.ts +1 -5
- package/src/components/calendar/calendar/calendar-root.tsx +6 -2
- package/src/components/calendar/calendar/calendar-weeks.tsx +7 -13
- package/src/components/calendar/index.ts +1 -5
- package/src/components/calendar/shared/calendar-context.ts +2 -6
- package/src/components/calendar/shared/calendar-day.tsx +4 -12
- package/src/components/calendar/shared/calendar-header.tsx +1 -6
- package/src/components/calendar/shared/calendar-nav-buttons.tsx +9 -28
- package/src/components/calendar/shared/calendar-title.tsx +1 -6
- package/src/components/calendar/shared/calendar-week-labels.tsx +1 -7
- package/src/components/calendar/shared/types.ts +1 -6
- package/src/components/calendar/timeline/calendar-timeline.tsx +3 -9
- package/src/components/calendar/timeline/index.ts +1 -4
- package/src/components/calendar/week-calendar/week-calendar.tsx +10 -25
- package/src/components/card/card-root.tsx +8 -4
- package/src/components/checkbox/components/checkbox-root.tsx +13 -4
- package/src/components/combobox/components/combobox-content.tsx +2 -11
- package/src/components/combobox/components/combobox-option.tsx +1 -2
- package/src/components/combobox/components/combobox-overlay.tsx +1 -6
- package/src/components/combobox/components/combobox-portal.tsx +1 -3
- package/src/components/combobox/components/combobox-root.tsx +20 -23
- package/src/components/combobox/components/combobox-trigger.tsx +2 -7
- package/src/components/combobox/context.ts +1 -3
- package/src/components/empty/components/empty-root.tsx +7 -2
- package/src/components/field/components/field-label.tsx +3 -1
- package/src/components/field/components/field-root.tsx +7 -2
- package/src/components/icon/icon.tsx +1 -4
- package/src/components/icon-button/icon-button.tsx +11 -10
- package/src/components/index.ts +1 -0
- package/src/components/input/input.tsx +8 -4
- package/src/components/input/numeric-input.tsx +2 -9
- package/src/components/menu/components/menu-checkbox-item.tsx +2 -9
- package/src/components/menu/components/menu-item.tsx +2 -10
- package/src/components/menu/components/menu-overlay.tsx +1 -6
- package/src/components/menu/components/menu-radio-group.tsx +1 -5
- package/src/components/menu/components/menu-radio-item.tsx +1 -5
- package/src/components/menu/components/menu-root.tsx +10 -2
- package/src/components/menu/components/menu-selection-indicator.tsx +4 -6
- package/src/components/menu/components/menu-trigger.tsx +32 -34
- package/src/components/menu/context.ts +3 -3
- package/src/components/menu/types.ts +1 -5
- package/src/components/phone-input/components/country-picker.tsx +6 -21
- package/src/components/phone-input/components/phone-input-root.tsx +10 -8
- package/src/components/phone-input/components/phone-input.tsx +5 -20
- package/src/components/phone-input/context.ts +1 -3
- package/src/components/phone-input/types.ts +2 -6
- package/src/components/popover/components/popover-overlay.tsx +7 -1
- package/src/components/popover/components/popover-root.tsx +10 -2
- package/src/components/popover/components/popover-trigger.tsx +1 -4
- package/src/components/portal/portal.tsx +6 -26
- package/src/components/progress/components/progress-indicator.tsx +13 -2
- package/src/components/progress/components/progress-root.tsx +6 -3
- package/src/components/radio-group/components/radio-group-item.tsx +1 -5
- package/src/components/radio-group/components/radio-group-root.tsx +7 -3
- package/src/components/select/components/select-content.tsx +1 -5
- package/src/components/select/components/select-option.tsx +5 -1
- package/src/components/select/components/select-overlay.tsx +6 -1
- package/src/components/select/components/select-portal.tsx +1 -3
- package/src/components/select/components/select-root.tsx +7 -4
- package/src/components/select/components/select-trigger.tsx +3 -13
- package/src/components/separator/separator.tsx +5 -1
- package/src/components/spinner/spinner.tsx +8 -9
- package/src/components/table/context.ts +17 -0
- package/src/components/table/index.ts +23 -0
- package/src/components/table/table-body.tsx +20 -0
- package/src/components/table/table-cell.tsx +20 -0
- package/src/components/table/table-head.tsx +20 -0
- package/src/components/table/table-header.tsx +20 -0
- package/src/components/table/table-root.tsx +35 -0
- package/src/components/table/table-row.tsx +20 -0
- package/src/components/table/types.ts +17 -0
- package/src/components/table/variants/default.tsx +46 -0
- package/src/components/table/variants/index.ts +5 -0
- package/src/components/tabs/components/tabs-item.tsx +5 -25
- package/src/components/tabs/components/tabs-root.tsx +9 -10
- package/src/components/textarea/textarea.tsx +7 -3
- package/src/components/toast/components/toast-icon.tsx +2 -8
- package/src/components/toast/components/toast-root.tsx +6 -2
- package/src/components/toast/manager.tsx +4 -6
- package/src/components/touchable/touchable.tsx +7 -7
- package/src/hooks/use-color-scheme.ts +1 -4
- package/src/hooks/use-currency-mask.ts +4 -4
- package/src/hooks/use-is-react-navigation-modal.ts +4 -13
- package/src/hooks/use-numeric-mask.ts +10 -5
- package/src/hooks/use-phone-mask.ts +6 -18
- package/src/hooks/use-relative-position.ts +8 -24
- package/src/hooks/use-screen-size.ts +8 -3
- package/src/index.tsx +3 -6
- package/src/themes/index.ts +2 -2
- package/src/themes/provider.tsx +8 -25
- package/src/themes/types.ts +125 -0
- package/src/utils/calculate-styles.ts +42 -2
- package/src/utils/date-utils.ts +23 -3
- package/src/utils/input-utils.ts +1 -4
- package/src/utils/normalize-layout.ts +3 -1
- package/src/utils/use-themed-styles.ts +2 -10
- package/tsconfig.json +5 -15
|
@@ -31,5 +31,128 @@ export type StorageClient<T> = {
|
|
|
31
31
|
set: (value: T) => void;
|
|
32
32
|
get: () => T | null;
|
|
33
33
|
};
|
|
34
|
+
import type { AlertDialogStyles } from "../components/alert-dialog/types";
|
|
35
|
+
import type { AlertStyles } from "../components/alert/types";
|
|
36
|
+
import type { AvatarStyles } from "../components/avatar/types";
|
|
37
|
+
import type { BadgeStyles } from "../components/badge/types";
|
|
38
|
+
import type { ButtonStyles } from "../components/button/types";
|
|
39
|
+
import type { CalendarStyles } from "../components/calendar/calendar/types";
|
|
40
|
+
import type { TimelineStyles } from "../components/calendar/timeline/types";
|
|
41
|
+
import type { WeekCalendarStyles } from "../components/calendar/week-calendar/types";
|
|
42
|
+
import type { CardStyles } from "../components/card/types";
|
|
43
|
+
import type { CheckboxStyles } from "../components/checkbox/types";
|
|
44
|
+
import type { ComboboxStyles } from "../components/combobox/types";
|
|
45
|
+
import type { EmptyStyles } from "../components/empty/types";
|
|
46
|
+
import type { FieldStyles } from "../components/field/types";
|
|
47
|
+
import type { IconButtonStyles } from "../components/icon-button/types";
|
|
48
|
+
import type { InputStyles } from "../components/input/types";
|
|
49
|
+
import type { MenuStyles } from "../components/menu/types";
|
|
50
|
+
import type { PhoneInputStyles } from "../components/phone-input/types";
|
|
51
|
+
import type { PopoverStyles } from "../components/popover/types";
|
|
52
|
+
import type { ProgressStyles } from "../components/progress/types";
|
|
53
|
+
import type { RadioGroupStyles } from "../components/radio-group/types";
|
|
54
|
+
import type { SelectStyles } from "../components/select/types";
|
|
55
|
+
import type { SeparatorStyles } from "../components/separator/types";
|
|
56
|
+
import type { SpinnerStyles } from "../components/spinner/types";
|
|
57
|
+
import type { TableStyles } from "../components/table/types";
|
|
58
|
+
import type { TabsStyles } from "../components/tabs/types";
|
|
59
|
+
import type { TextareaStyles } from "../components/textarea/types";
|
|
60
|
+
import type { ToastStyles } from "../components/toast/types";
|
|
61
|
+
import type { ToastVariants } from "../components/toast/variants";
|
|
62
|
+
import type { PressableStyles } from "../components/touchable/types";
|
|
63
|
+
import type { SvgProps } from "../types/props.types";
|
|
64
|
+
export interface ComponentsConfig {
|
|
65
|
+
colorScheme?: {
|
|
66
|
+
storage?: StorageClient<ColorScheme>;
|
|
67
|
+
};
|
|
68
|
+
alert?: {
|
|
69
|
+
styles?: AlertStyles;
|
|
70
|
+
};
|
|
71
|
+
alertDialog?: {
|
|
72
|
+
styles?: AlertDialogStyles;
|
|
73
|
+
};
|
|
74
|
+
avatar?: {
|
|
75
|
+
styles?: AvatarStyles;
|
|
76
|
+
};
|
|
77
|
+
badge?: {
|
|
78
|
+
styles?: BadgeStyles;
|
|
79
|
+
};
|
|
80
|
+
button?: {
|
|
81
|
+
styles?: ButtonStyles;
|
|
82
|
+
};
|
|
83
|
+
calendar?: {
|
|
84
|
+
prevIcon?: React.ComponentType<SvgProps>;
|
|
85
|
+
nextIcon?: React.ComponentType<SvgProps>;
|
|
86
|
+
styles?: CalendarStyles;
|
|
87
|
+
};
|
|
88
|
+
card?: {
|
|
89
|
+
styles?: CardStyles;
|
|
90
|
+
};
|
|
91
|
+
checkbox?: {
|
|
92
|
+
styles?: CheckboxStyles;
|
|
93
|
+
};
|
|
94
|
+
combobox?: {
|
|
95
|
+
styles?: ComboboxStyles;
|
|
96
|
+
};
|
|
97
|
+
empty?: {
|
|
98
|
+
styles?: EmptyStyles;
|
|
99
|
+
};
|
|
100
|
+
field?: {
|
|
101
|
+
styles?: FieldStyles;
|
|
102
|
+
};
|
|
103
|
+
iconButton?: {
|
|
104
|
+
styles?: IconButtonStyles;
|
|
105
|
+
};
|
|
106
|
+
input?: {
|
|
107
|
+
styles?: InputStyles;
|
|
108
|
+
};
|
|
109
|
+
menu?: {
|
|
110
|
+
selectionIcon?: React.ComponentType<SvgProps>;
|
|
111
|
+
styles?: MenuStyles;
|
|
112
|
+
};
|
|
113
|
+
phoneInput?: {
|
|
114
|
+
styles?: PhoneInputStyles;
|
|
115
|
+
};
|
|
116
|
+
popover?: {
|
|
117
|
+
styles?: PopoverStyles;
|
|
118
|
+
};
|
|
119
|
+
progress?: {
|
|
120
|
+
styles?: ProgressStyles;
|
|
121
|
+
};
|
|
122
|
+
radioGroup?: {
|
|
123
|
+
styles?: RadioGroupStyles;
|
|
124
|
+
};
|
|
125
|
+
select?: {
|
|
126
|
+
styles?: SelectStyles;
|
|
127
|
+
};
|
|
128
|
+
separator?: {
|
|
129
|
+
styles?: SeparatorStyles;
|
|
130
|
+
};
|
|
131
|
+
spinner?: {
|
|
132
|
+
styles?: SpinnerStyles;
|
|
133
|
+
};
|
|
134
|
+
table?: {
|
|
135
|
+
styles?: TableStyles;
|
|
136
|
+
};
|
|
137
|
+
tabs?: {
|
|
138
|
+
styles?: TabsStyles;
|
|
139
|
+
};
|
|
140
|
+
textarea?: {
|
|
141
|
+
styles?: TextareaStyles;
|
|
142
|
+
};
|
|
143
|
+
timeline?: {
|
|
144
|
+
styles?: TimelineStyles;
|
|
145
|
+
};
|
|
146
|
+
toast?: {
|
|
147
|
+
icons?: Partial<Record<keyof typeof ToastVariants, React.ComponentType<SvgProps>>>;
|
|
148
|
+
styles?: ToastStyles;
|
|
149
|
+
};
|
|
150
|
+
touchable?: {
|
|
151
|
+
styles?: PressableStyles;
|
|
152
|
+
};
|
|
153
|
+
weekCalendar?: {
|
|
154
|
+
styles?: WeekCalendarStyles;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
34
157
|
export {};
|
|
35
158
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/themes/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,KAAK,KAAK,GAAG,OAAO,MAAM,KAAK,MAAM,MAAM,MAAM,IAAI,CAAC;AAEtD,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,KAAK,CAAC;IAClB,UAAU,EAAE,KAAK,CAAC;IAClB,OAAO,EAAE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AE,eAAe,CAAC;KAC1B,CAAC;IACF,YAAY,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,kBAAkB,CAAC;KAC7B,CAAC;CACH"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const calculateComposedStyles: <TStyle, State extends string | "default", Component extends string>(styles: (Partial<Record<Component, Partial<Record<State, TStyle>>>> | null) | undefined, state: State, component: Component, style?: TStyle) => TStyle[];
|
|
2
|
+
export declare const mergeStyles: <TStyle extends Record<string, any>>(variantStyles: TStyle, globalStyles: TStyle | undefined) => TStyle;
|
|
2
3
|
//# sourceMappingURL=calculate-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculate-styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/calculate-styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calculate-styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/calculate-styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,GAClC,MAAM,EACN,KAAK,SAAS,MAAM,GAAG,SAAS,EAChC,SAAS,SAAS,MAAM,EAExB,SAAQ,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,aAAK,EAC9E,OAAO,KAAK,EACZ,WAAW,SAAS,EACpB,QAAQ,MAAM,KACb,MAAM,EAaR,CAAC;AAmBF,eAAO,MAAM,WAAW,GAAI,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5D,eAAe,MAAM,EACrB,cAAc,MAAM,GAAG,SAAS,KAC/B,MAYF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/date-utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,MAAM,IAAI,EAAE,QAAQ,MAAM,KA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eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,KAAG,MAM5C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,MAAM,IAAI,KAAG,IAIxC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,MAAM,IAAI,KAAG,IAItC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,MAAM,IAAI,KAAG,IAAI,EAO7C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,IAAI,EAAE,OAAO,MAAM,KAAG,IAIpD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,IAAI,EAAE,OAAO,MAAM,KAAG,IAEpD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,MAAM,IAAI,EAAE,MAAM,MAAM,KAAG,IAIlD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,MAAM,IAAI,EAAE,MAAM,MAAM,KAAG,IAElD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/input-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"input-utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/input-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,YAAY,EAAE,KAAK,EAAE,MAAM,QAMzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-layout.d.ts","sourceRoot":"","sources":["../../../../src/utils/normalize-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,eAAO,MAAM,eAAe,GAAI,QAAQ,eAAe;;;;;CAUtD,CAAC;AAUF,eAAO,MAAM,qBAAqB,GAChC,KAAK,YAAY,GAAG,IAAI,EACxB,UAAU,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"normalize-layout.d.ts","sourceRoot":"","sources":["../../../../src/utils/normalize-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,eAAO,MAAM,eAAe,GAAI,QAAQ,eAAe;;;;;CAUtD,CAAC;AAUF,eAAO,MAAM,qBAAqB,GAChC,KAAK,YAAY,GAAG,IAAI,EACxB,UAAU,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,SAsB3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-themed-styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/use-themed-styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"use-themed-styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/use-themed-styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE3F,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,UAAU,CAAC,KAAK,EAAE,aAAa,KAAK,CAAC,KAAG,CAS1E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@korsolutions/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.85",
|
|
4
|
+
"bugs": {
|
|
5
|
+
"url": "https://github.com/KorSoftwareSolutions/ui/issues"
|
|
6
|
+
},
|
|
4
7
|
"license": "MIT",
|
|
5
8
|
"repository": {
|
|
6
9
|
"type": "git",
|
|
7
10
|
"url": "https://github.com/KorSoftwareSolutions/ui"
|
|
8
11
|
},
|
|
9
|
-
"bugs": {
|
|
10
|
-
"url": "https://github.com/KorSoftwareSolutions/ui/issues"
|
|
11
|
-
},
|
|
12
12
|
"main": "dist/module/index.js",
|
|
13
13
|
"module": "dist/module/index.js",
|
|
14
14
|
"types": "dist/typescript/src/index.d.ts",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
-
"
|
|
17
|
+
"types": "./dist/typescript/src/index.d.ts",
|
|
18
18
|
"dev-source": "./src/index.ts",
|
|
19
|
-
"
|
|
19
|
+
"default": "./dist/module/index.js"
|
|
20
20
|
},
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"prepare": "bob build",
|
|
25
|
-
"lint": "tsc --noEmit"
|
|
25
|
+
"lint": "tsc --noEmit && oxlint .",
|
|
26
|
+
"fmt": "oxfmt"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@react-navigation/native": "^7.1.28",
|
|
@@ -10,9 +10,7 @@ export interface AlertDescriptionProps {
|
|
|
10
10
|
style?: StyleProp<TextStyle>;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export function AlertDescription(
|
|
14
|
-
props: PropsWithRender<AlertDescriptionProps>,
|
|
15
|
-
) {
|
|
13
|
+
export function AlertDescription(props: PropsWithRender<AlertDescriptionProps>) {
|
|
16
14
|
const alert = useAlert();
|
|
17
15
|
|
|
18
16
|
const composedStyle = [alert.styles?.description, props.style];
|
|
@@ -4,7 +4,10 @@ import { useAlert } from "../context";
|
|
|
4
4
|
|
|
5
5
|
export type AlertIconProps = SvgProps;
|
|
6
6
|
|
|
7
|
-
export function AlertIcon({
|
|
7
|
+
export function AlertIcon({
|
|
8
|
+
render: Component,
|
|
9
|
+
...props
|
|
10
|
+
}: PropsWithRequiredRender<AlertIconProps>) {
|
|
8
11
|
const alert = useAlert();
|
|
9
12
|
|
|
10
13
|
const composedProps = {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { PropsWithRender } from "../../../types/props.types";
|
|
2
1
|
import React from "react";
|
|
3
|
-
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
2
|
+
import { type StyleProp, StyleSheet, View, type ViewStyle } from "react-native";
|
|
3
|
+
import { useComponentConfig } from "../../../themes/provider";
|
|
4
|
+
import type { PropsWithRender } from "../../../types/props.types";
|
|
5
|
+
import { mergeStyles } from "../../../utils/calculate-styles";
|
|
4
6
|
import { AlertContext } from "../context";
|
|
5
7
|
import { AlertVariants } from "../variants";
|
|
6
8
|
|
|
@@ -13,13 +15,16 @@ export interface AlertRootProps {
|
|
|
13
15
|
|
|
14
16
|
export function AlertRoot(props: PropsWithRender<AlertRootProps>) {
|
|
15
17
|
const variantStyles = AlertVariants[props.variant ?? "default"]();
|
|
16
|
-
const
|
|
18
|
+
const componentConfig = useComponentConfig("alert");
|
|
19
|
+
|
|
20
|
+
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
21
|
+
const composedStyle = StyleSheet.flatten([mergedStyles.root, props.style]);
|
|
17
22
|
|
|
18
23
|
const Component = props.render ?? View;
|
|
19
24
|
return (
|
|
20
25
|
<AlertContext.Provider
|
|
21
26
|
value={{
|
|
22
|
-
styles:
|
|
27
|
+
styles: mergedStyles,
|
|
23
28
|
}}
|
|
24
29
|
>
|
|
25
30
|
<Component {...props} style={composedStyle} />
|
|
@@ -32,9 +32,7 @@ interface AsyncAlertDialogInstance {
|
|
|
32
32
|
// Global state
|
|
33
33
|
const dialogQueue: AsyncAlertDialogInstance[] = [];
|
|
34
34
|
let currentDialog: AsyncAlertDialogInstance | null = null;
|
|
35
|
-
let setCurrentDialogFn:
|
|
36
|
-
| ((dialog: AsyncAlertDialogInstance | null) => void)
|
|
37
|
-
| null = null;
|
|
35
|
+
let setCurrentDialogFn: ((dialog: AsyncAlertDialogInstance | null) => void) | null = null;
|
|
38
36
|
|
|
39
37
|
// Process next dialog in queue
|
|
40
38
|
function processQueue() {
|
|
@@ -57,17 +55,8 @@ function closeDialog(confirmed: boolean) {
|
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
// Inner component that has access to the dialog context
|
|
60
|
-
function AsyncAlertDialogContent({
|
|
61
|
-
instance
|
|
62
|
-
}: {
|
|
63
|
-
instance: AsyncAlertDialogInstance;
|
|
64
|
-
}) {
|
|
65
|
-
const {
|
|
66
|
-
title,
|
|
67
|
-
description,
|
|
68
|
-
actionLabel = "Continue",
|
|
69
|
-
cancelLabel = "Cancel",
|
|
70
|
-
} = instance.props;
|
|
58
|
+
function AsyncAlertDialogContent({ instance }: { instance: AsyncAlertDialogInstance }) {
|
|
59
|
+
const { title, description, actionLabel = "Continue", cancelLabel = "Cancel" } = instance.props;
|
|
71
60
|
const { setIsOpen } = useAlertDialog();
|
|
72
61
|
|
|
73
62
|
const handleAction = () => closeDialog(true);
|
|
@@ -85,12 +74,8 @@ function AsyncAlertDialogContent({
|
|
|
85
74
|
<AlertDialogTitle>{title}</AlertDialogTitle>
|
|
86
75
|
<AlertDialogDescription>{description}</AlertDialogDescription>
|
|
87
76
|
<AlertDialogFooter>
|
|
88
|
-
<AlertDialogCancel onPress={handleCancel}>
|
|
89
|
-
|
|
90
|
-
</AlertDialogCancel>
|
|
91
|
-
<AlertDialogAction onPress={handleAction}>
|
|
92
|
-
{actionLabel}
|
|
93
|
-
</AlertDialogAction>
|
|
77
|
+
<AlertDialogCancel onPress={handleCancel}>{cancelLabel}</AlertDialogCancel>
|
|
78
|
+
<AlertDialogAction onPress={handleAction}>{actionLabel}</AlertDialogAction>
|
|
94
79
|
</AlertDialogFooter>
|
|
95
80
|
</AlertDialogContent>
|
|
96
81
|
</AlertDialogPortal>
|
|
@@ -98,11 +83,7 @@ function AsyncAlertDialogContent({
|
|
|
98
83
|
}
|
|
99
84
|
|
|
100
85
|
// Component that renders a single dialog instance
|
|
101
|
-
function AsyncAlertDialogInstance({
|
|
102
|
-
instance,
|
|
103
|
-
}: {
|
|
104
|
-
instance: AsyncAlertDialogInstance;
|
|
105
|
-
}) {
|
|
86
|
+
function AsyncAlertDialogInstance({ instance }: { instance: AsyncAlertDialogInstance }) {
|
|
106
87
|
return (
|
|
107
88
|
<AlertDialogRoot {...instance.props}>
|
|
108
89
|
<AsyncAlertDialogContent instance={instance} />
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React, { useMemo, useState } from "react";
|
|
2
|
+
import { useComponentConfig } from "../../../themes/provider";
|
|
3
|
+
import { mergeStyles } from "../../../utils/calculate-styles";
|
|
2
4
|
import { AlertDialogContext, type AlertDialogContextValue } from "../context";
|
|
3
5
|
import { AlertDialogVariants } from "../variants";
|
|
4
6
|
|
|
@@ -8,17 +10,20 @@ export interface AlertDialogRootProps {
|
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
export function AlertDialogRoot(props: AlertDialogRootProps) {
|
|
11
|
-
const variantStyles = AlertDialogVariants[props.variant || "default"]();
|
|
12
13
|
const { children } = props;
|
|
14
|
+
const variantStyles = AlertDialogVariants[props.variant || "default"]();
|
|
15
|
+
const componentConfig = useComponentConfig("alertDialog");
|
|
13
16
|
const [isOpen, setIsOpen] = useState(false);
|
|
14
17
|
|
|
18
|
+
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
19
|
+
|
|
15
20
|
const contextValue: AlertDialogContextValue = useMemo(
|
|
16
21
|
() => ({
|
|
17
22
|
isOpen,
|
|
18
23
|
setIsOpen,
|
|
19
|
-
styles:
|
|
24
|
+
styles: mergedStyles,
|
|
20
25
|
}),
|
|
21
|
-
[isOpen,
|
|
26
|
+
[isOpen, mergedStyles],
|
|
22
27
|
);
|
|
23
28
|
|
|
24
29
|
return <AlertDialogContext.Provider value={contextValue}>{children}</AlertDialogContext.Provider>;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
Image,
|
|
4
|
-
type ImageSource,
|
|
5
|
-
type ImageStyle,
|
|
6
|
-
type StyleProp,
|
|
7
|
-
} from "react-native";
|
|
2
|
+
import { Image, type ImageSource, type ImageStyle, type StyleProp } from "react-native";
|
|
8
3
|
import { useAvatar } from "../context";
|
|
9
4
|
|
|
10
5
|
export interface AvatarImageProps {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useState } from "react";
|
|
2
2
|
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
3
|
+
import { useComponentConfig } from "../../../themes/provider";
|
|
4
|
+
import { mergeStyles } from "../../../utils/calculate-styles";
|
|
3
5
|
import { AvatarContext } from "../context";
|
|
4
6
|
import { AvatarVariants } from "../variants";
|
|
5
7
|
|
|
@@ -12,17 +14,20 @@ export interface AvatarRootProps {
|
|
|
12
14
|
|
|
13
15
|
export function AvatarRoot(props: AvatarRootProps) {
|
|
14
16
|
const variantStyles = AvatarVariants[props.variant || "default"]();
|
|
15
|
-
const
|
|
17
|
+
const componentConfig = useComponentConfig("avatar");
|
|
18
|
+
|
|
19
|
+
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
20
|
+
const composedStyles = [mergedStyles.root, props.style];
|
|
16
21
|
|
|
17
22
|
const [imageLoaded, setImageLoaded] = useState(false);
|
|
18
23
|
|
|
19
24
|
const contextValue: AvatarContext = useMemo(
|
|
20
25
|
() => ({
|
|
21
|
-
styles:
|
|
26
|
+
styles: mergedStyles,
|
|
22
27
|
imageLoaded,
|
|
23
28
|
setImageLoaded,
|
|
24
29
|
}),
|
|
25
|
-
[
|
|
30
|
+
[mergedStyles, imageLoaded],
|
|
26
31
|
);
|
|
27
32
|
|
|
28
33
|
const Component = props.render ?? View;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type StyleProp, StyleSheet, View, type ViewStyle } from "react-native";
|
|
3
3
|
import { useOrganizedChildren } from "../../hooks/use-organized-children";
|
|
4
|
+
import { useComponentConfig } from "../../themes/provider";
|
|
5
|
+
import { mergeStyles } from "../../utils/calculate-styles";
|
|
4
6
|
import { BadgeContext } from "./context";
|
|
5
7
|
import { BadgeVariants } from "./variants";
|
|
6
8
|
|
|
@@ -16,26 +18,22 @@ export interface BadgeProps {
|
|
|
16
18
|
|
|
17
19
|
export function Badge(props: BadgeProps) {
|
|
18
20
|
const variantStyles = BadgeVariants[props.variant || "default"]();
|
|
21
|
+
const componentConfig = useComponentConfig("badge");
|
|
19
22
|
|
|
20
|
-
const customStyle = props.color
|
|
21
|
-
? { backgroundColor: props.color }
|
|
22
|
-
: undefined;
|
|
23
|
+
const customStyle = props.color ? { backgroundColor: props.color } : undefined;
|
|
23
24
|
|
|
24
|
-
const
|
|
25
|
+
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
26
|
+
const composedStyle = StyleSheet.flatten([mergedStyles.root, props.style]);
|
|
25
27
|
|
|
26
|
-
const textStyle =
|
|
27
|
-
const iconStyle =
|
|
28
|
-
const organizedChildren = useOrganizedChildren(
|
|
29
|
-
props.children,
|
|
30
|
-
textStyle,
|
|
31
|
-
iconStyle,
|
|
32
|
-
);
|
|
28
|
+
const textStyle = StyleSheet.flatten([mergedStyles.text, props.style]);
|
|
29
|
+
const iconStyle = { ...mergedStyles.icon, ...props.style };
|
|
30
|
+
const organizedChildren = useOrganizedChildren(props.children, textStyle, iconStyle);
|
|
33
31
|
|
|
34
32
|
const Component = props.render ?? View;
|
|
35
33
|
return (
|
|
36
34
|
<BadgeContext.Provider
|
|
37
35
|
value={{
|
|
38
|
-
styles:
|
|
36
|
+
styles: mergedStyles,
|
|
39
37
|
}}
|
|
40
38
|
>
|
|
41
39
|
<Component {...props} style={[composedStyle, customStyle]}>
|
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
type ViewStyle,
|
|
9
9
|
} from "react-native";
|
|
10
10
|
import { useOrganizedChildren } from "../../hooks/use-organized-children";
|
|
11
|
+
import { useComponentConfig } from "../../themes/provider";
|
|
12
|
+
import { mergeStyles } from "../../utils/calculate-styles";
|
|
11
13
|
import type { ButtonState } from "./types";
|
|
12
14
|
import { ButtonVariants } from "./variants";
|
|
13
15
|
|
|
@@ -21,10 +23,7 @@ export interface ButtonProps extends Omit<PressableProps, "disabled"> {
|
|
|
21
23
|
style?: StyleProp<ViewStyle>;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
const calculateState = (
|
|
25
|
-
props: ButtonProps,
|
|
26
|
-
isHovered: boolean,
|
|
27
|
-
): ButtonState => {
|
|
26
|
+
const calculateState = (props: ButtonProps, isHovered: boolean): ButtonState => {
|
|
28
27
|
if (props.isDisabled) return "disabled";
|
|
29
28
|
if (props.isLoading) return "loading";
|
|
30
29
|
if (isHovered) return "hovered";
|
|
@@ -33,24 +32,17 @@ const calculateState = (
|
|
|
33
32
|
|
|
34
33
|
export function Button(props: ButtonProps) {
|
|
35
34
|
const variantStyles = ButtonVariants[props.variant ?? "default"]();
|
|
35
|
+
const componentConfig = useComponentConfig("button");
|
|
36
36
|
const [isHovered, setIsHovered] = useState(false);
|
|
37
37
|
|
|
38
38
|
const state = calculateState(props, isHovered);
|
|
39
39
|
|
|
40
|
-
const
|
|
41
|
-
variantStyles.text?.default,
|
|
42
|
-
variantStyles.text?.[state],
|
|
43
|
-
]);
|
|
44
|
-
const iconProps = StyleSheet.flatten([
|
|
45
|
-
variantStyles.icon?.default,
|
|
46
|
-
variantStyles.icon?.[state],
|
|
47
|
-
]);
|
|
40
|
+
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
48
41
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
42
|
+
const textStyle = StyleSheet.flatten([mergedStyles.text?.default, mergedStyles.text?.[state]]);
|
|
43
|
+
const iconProps = StyleSheet.flatten([mergedStyles.icon?.default, mergedStyles.icon?.[state]]);
|
|
44
|
+
|
|
45
|
+
const organizedChildren = useOrganizedChildren(props.children, textStyle, iconProps);
|
|
54
46
|
|
|
55
47
|
const handlePress: PressableProps["onPress"] = (event) => {
|
|
56
48
|
if (props.isDisabled || props.isLoading) {
|
|
@@ -72,11 +64,7 @@ export function Button(props: ButtonProps) {
|
|
|
72
64
|
onHoverIn={() => setIsHovered(true)}
|
|
73
65
|
onHoverOut={() => setIsHovered(false)}
|
|
74
66
|
disabled={props.isDisabled}
|
|
75
|
-
style={[
|
|
76
|
-
variantStyles.root?.default,
|
|
77
|
-
variantStyles.root?.[state],
|
|
78
|
-
props.style,
|
|
79
|
-
]}
|
|
67
|
+
style={[variantStyles.root?.default, variantStyles.root?.[state], props.style]}
|
|
80
68
|
>
|
|
81
69
|
{organizedChildren}
|
|
82
70
|
{props.isLoading && <ActivityIndicator {...spinnerProps} />}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ActivityIndicatorProps,
|
|
3
|
-
TextStyle,
|
|
4
|
-
ViewStyle,
|
|
5
|
-
} from "react-native";
|
|
1
|
+
import type { ActivityIndicatorProps, TextStyle, ViewStyle } from "react-native";
|
|
6
2
|
import type { IconProps } from "../icon";
|
|
7
3
|
|
|
8
4
|
export type ButtonState = "default" | "disabled" | "loading" | "hovered";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useState } from "react";
|
|
2
2
|
import { View, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import { useComponentConfig } from "../../../themes/provider";
|
|
4
|
+
import { mergeStyles } from "../../../utils/calculate-styles";
|
|
3
5
|
import { addMonths, subMonths } from "../../../utils/date-utils";
|
|
4
6
|
import { CalendarContext } from "../shared/calendar-context";
|
|
5
7
|
import { CalendarVariants } from "./variants";
|
|
@@ -28,6 +30,8 @@ export function CalendarRoot(props: CalendarRootProps) {
|
|
|
28
30
|
style,
|
|
29
31
|
} = props;
|
|
30
32
|
const variantStyles = CalendarVariants[props.variant || "default"]();
|
|
33
|
+
const componentConfig = useComponentConfig("calendar");
|
|
34
|
+
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
31
35
|
|
|
32
36
|
const [currentMonth, setCurrentMonth] = useState<Date>(defaultMonth);
|
|
33
37
|
|
|
@@ -49,7 +53,7 @@ export function CalendarRoot(props: CalendarRootProps) {
|
|
|
49
53
|
return addMonths(currentMonth, 1) > maxDate;
|
|
50
54
|
}, [currentMonth, maxDate]);
|
|
51
55
|
|
|
52
|
-
const containerStyle = [
|
|
56
|
+
const containerStyle = [mergedStyles.root, style];
|
|
53
57
|
|
|
54
58
|
return (
|
|
55
59
|
<CalendarContext.Provider
|
|
@@ -61,7 +65,7 @@ export function CalendarRoot(props: CalendarRootProps) {
|
|
|
61
65
|
goToNext,
|
|
62
66
|
isPrevDisabled,
|
|
63
67
|
isNextDisabled,
|
|
64
|
-
styles:
|
|
68
|
+
styles: mergedStyles,
|
|
65
69
|
minDate,
|
|
66
70
|
maxDate,
|
|
67
71
|
markedDates,
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
type StyleProp,
|
|
5
|
-
type ViewProps,
|
|
6
|
-
type ViewStyle,
|
|
7
|
-
} from "react-native";
|
|
2
|
+
import { StyleSheet, View, type StyleProp, type ViewProps, type ViewStyle } from "react-native";
|
|
8
3
|
import { getWeekDays, getWeeksInMonth } from "../../../utils/date-utils";
|
|
9
4
|
import { useCalendarContext } from "../shared/calendar-context";
|
|
10
5
|
import { CalendarDay } from "../shared/calendar-day";
|
|
@@ -17,21 +12,20 @@ export interface CalendarWeekProps extends ViewProps {
|
|
|
17
12
|
|
|
18
13
|
function CalendarWeek(props: CalendarWeekProps) {
|
|
19
14
|
const { style, ...viewProps } = props;
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
15
|
+
const calendar = useCalendarContext();
|
|
16
|
+
const calendarStyles = calendar.styles as CalendarStyles;
|
|
23
17
|
const days = getWeekDays(
|
|
24
|
-
currentMonth.getMonth(),
|
|
25
|
-
currentMonth.getFullYear(),
|
|
18
|
+
calendar.currentMonth.getMonth(),
|
|
19
|
+
calendar.currentMonth.getFullYear(),
|
|
26
20
|
props.index,
|
|
27
21
|
);
|
|
28
22
|
|
|
29
|
-
const composedStyle = [
|
|
23
|
+
const composedStyle = StyleSheet.flatten([calendarStyles?.week, style]);
|
|
30
24
|
return (
|
|
31
25
|
<View {...viewProps} style={composedStyle}>
|
|
32
26
|
{days.map((day, index) => {
|
|
33
27
|
if (!day) {
|
|
34
|
-
return <View key={index} style={
|
|
28
|
+
return <View key={index} style={calendarStyles?.dayButton?.default} />;
|
|
35
29
|
}
|
|
36
30
|
return <CalendarDay key={index} date={day} />;
|
|
37
31
|
})}
|
|
@@ -14,10 +14,6 @@ export { WeekCalendar } from "./week-calendar";
|
|
|
14
14
|
export type { WeekCalendarProps, WeekCalendarStyles } from "./week-calendar";
|
|
15
15
|
|
|
16
16
|
export { CalendarTimeline } from "./timeline";
|
|
17
|
-
export type {
|
|
18
|
-
CalendarTimelineProps,
|
|
19
|
-
TimelineEventLayout,
|
|
20
|
-
TimelineStyles,
|
|
21
|
-
} from "./timeline";
|
|
17
|
+
export type { CalendarTimelineProps, TimelineEventLayout, TimelineStyles } from "./timeline";
|
|
22
18
|
|
|
23
19
|
export type { CalendarDayState } from "./shared/types";
|
|
@@ -20,16 +20,12 @@ export interface CalendarContextValue {
|
|
|
20
20
|
styles?: BaseCalendarStyles;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export const CalendarContext = React.createContext<
|
|
24
|
-
CalendarContextValue | undefined
|
|
25
|
-
>(undefined);
|
|
23
|
+
export const CalendarContext = React.createContext<CalendarContextValue | undefined>(undefined);
|
|
26
24
|
|
|
27
25
|
export const useCalendarContext = () => {
|
|
28
26
|
const context = React.useContext(CalendarContext);
|
|
29
27
|
if (!context) {
|
|
30
|
-
throw new Error(
|
|
31
|
-
"Calendar components must be used within a Calendar or WeekCalendar Root",
|
|
32
|
-
);
|
|
28
|
+
throw new Error("Calendar components must be used within a Calendar or WeekCalendar Root");
|
|
33
29
|
}
|
|
34
30
|
return context;
|
|
35
31
|
};
|