@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
|
@@ -9,11 +9,7 @@ import React, {
|
|
|
9
9
|
import { Platform, View, type HostInstance } from "react-native";
|
|
10
10
|
import { measureLayoutPosition } from "../../utils/normalize-layout";
|
|
11
11
|
import { PortalOffsetContext, type PortalOffset } from "./portal-offset";
|
|
12
|
-
import {
|
|
13
|
-
DEFAULT_PORTAL_HOST,
|
|
14
|
-
type PortalHostProps,
|
|
15
|
-
type PortalProps,
|
|
16
|
-
} from "./portal.constants";
|
|
12
|
+
import { DEFAULT_PORTAL_HOST, type PortalHostProps, type PortalProps } from "./portal.constants";
|
|
17
13
|
|
|
18
14
|
type PortalMap = Map<string, React.ReactNode>;
|
|
19
15
|
type PortalHostMap = Map<string, PortalMap>;
|
|
@@ -24,10 +20,7 @@ type PortalStore = {
|
|
|
24
20
|
};
|
|
25
21
|
|
|
26
22
|
const store: PortalStore = {
|
|
27
|
-
map: new Map<string, PortalMap>().set(
|
|
28
|
-
DEFAULT_PORTAL_HOST,
|
|
29
|
-
new Map<string, React.ReactNode>(),
|
|
30
|
-
),
|
|
23
|
+
map: new Map<string, PortalMap>().set(DEFAULT_PORTAL_HOST, new Map<string, React.ReactNode>()),
|
|
31
24
|
listeners: new Set(),
|
|
32
25
|
};
|
|
33
26
|
|
|
@@ -46,11 +39,7 @@ function subscribe(cb: () => void) {
|
|
|
46
39
|
};
|
|
47
40
|
}
|
|
48
41
|
|
|
49
|
-
function updatePortal(
|
|
50
|
-
hostName: string,
|
|
51
|
-
name: string,
|
|
52
|
-
children: React.ReactNode,
|
|
53
|
-
) {
|
|
42
|
+
function updatePortal(hostName: string, name: string, children: React.ReactNode) {
|
|
54
43
|
const next = new Map(store.map);
|
|
55
44
|
const portal = next.get(hostName) ?? new Map<string, React.ReactNode>();
|
|
56
45
|
portal.set(name, children);
|
|
@@ -96,17 +85,12 @@ function DefaultContainer(props: React.PropsWithChildren) {
|
|
|
96
85
|
pointerEvents: "box-none",
|
|
97
86
|
}}
|
|
98
87
|
>
|
|
99
|
-
<PortalOffsetContext.Provider value={offset}>
|
|
100
|
-
{props.children}
|
|
101
|
-
</PortalOffsetContext.Provider>
|
|
88
|
+
<PortalOffsetContext.Provider value={offset}>{props.children}</PortalOffsetContext.Provider>
|
|
102
89
|
</View>
|
|
103
90
|
);
|
|
104
91
|
}
|
|
105
92
|
|
|
106
|
-
export function PortalHost({
|
|
107
|
-
name = DEFAULT_PORTAL_HOST,
|
|
108
|
-
container,
|
|
109
|
-
}: PortalHostProps) {
|
|
93
|
+
export function PortalHost({ name = DEFAULT_PORTAL_HOST, container }: PortalHostProps) {
|
|
110
94
|
const map = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
111
95
|
const portalMap = map.get(name) ?? new Map<string, React.ReactNode>();
|
|
112
96
|
const Container = useMemo(
|
|
@@ -122,11 +106,7 @@ export function PortalHost({
|
|
|
122
106
|
return <Container>{Array.from(portalMap.values())}</Container>;
|
|
123
107
|
}
|
|
124
108
|
|
|
125
|
-
export function Portal({
|
|
126
|
-
name,
|
|
127
|
-
hostName = DEFAULT_PORTAL_HOST,
|
|
128
|
-
children,
|
|
129
|
-
}: PortalProps) {
|
|
109
|
+
export function Portal({ name, hostName = DEFAULT_PORTAL_HOST, children }: PortalProps) {
|
|
130
110
|
useEffect(() => {
|
|
131
111
|
updatePortal(hostName, name, children);
|
|
132
112
|
}, [hostName, name, children]);
|
|
@@ -14,8 +14,19 @@ export function ProgressIndicator(props: ProgressIndicatorProps) {
|
|
|
14
14
|
|
|
15
15
|
const percentage = Math.min(Math.max((progress.value / progress.max) * 100, 0), 100);
|
|
16
16
|
|
|
17
|
-
const composedStyle = calculateComposedStyles(
|
|
17
|
+
const composedStyle = calculateComposedStyles(
|
|
18
|
+
progress.styles,
|
|
19
|
+
progress.state,
|
|
20
|
+
"indicator",
|
|
21
|
+
props.style,
|
|
22
|
+
);
|
|
18
23
|
|
|
19
24
|
const Component = props.render ?? View;
|
|
20
|
-
return
|
|
25
|
+
return (
|
|
26
|
+
<Component
|
|
27
|
+
{...props}
|
|
28
|
+
percentage={percentage}
|
|
29
|
+
style={[composedStyle, { width: `${percentage}%` }]}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
21
32
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
3
|
+
import { useComponentConfig } from "../../../themes/provider";
|
|
4
|
+
import { calculateComposedStyles, mergeStyles } from "../../../utils/calculate-styles";
|
|
4
5
|
import { ProgressContext } from "../context";
|
|
5
6
|
import { ProgressVariants } from "../variants";
|
|
6
7
|
|
|
@@ -19,14 +20,16 @@ export interface ProgressRootProps {
|
|
|
19
20
|
export function ProgressRoot(props: ProgressRootProps) {
|
|
20
21
|
const { value = 0, max = 100 } = props;
|
|
21
22
|
const variantStyles = ProgressVariants[props.variant || "default"]();
|
|
22
|
-
const
|
|
23
|
+
const componentConfig = useComponentConfig("progress");
|
|
24
|
+
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
25
|
+
const composedStyle = calculateComposedStyles(mergedStyles, "default", "root", props.style);
|
|
23
26
|
|
|
24
27
|
const Component = props.render ?? View;
|
|
25
28
|
return (
|
|
26
29
|
<ProgressContext.Provider
|
|
27
30
|
value={{
|
|
28
31
|
state: "default",
|
|
29
|
-
styles:
|
|
32
|
+
styles: mergedStyles,
|
|
30
33
|
value,
|
|
31
34
|
max,
|
|
32
35
|
}}
|
|
@@ -30,11 +30,7 @@ export function RadioGroupItem(props: RadioGroupItemProps) {
|
|
|
30
30
|
const itemDisabled = isDisabled ?? group.isDisabled;
|
|
31
31
|
const state = calculateState(isSelected, itemDisabled, isHovered);
|
|
32
32
|
|
|
33
|
-
const composedStyle = [
|
|
34
|
-
group.styles?.item?.default,
|
|
35
|
-
group.styles?.item?.[state],
|
|
36
|
-
style,
|
|
37
|
-
];
|
|
33
|
+
const composedStyle = [group.styles?.item?.default, group.styles?.item?.[state], style];
|
|
38
34
|
|
|
39
35
|
return (
|
|
40
36
|
<RadioGroupItemContext.Provider value={{ value, state, isSelected }}>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, type StyleProp, type ViewProps, type ViewStyle } from "react-native";
|
|
3
|
+
import { useComponentConfig } from "../../../themes/provider";
|
|
4
|
+
import { mergeStyles } from "../../../utils/calculate-styles";
|
|
3
5
|
import { RadioGroupContext } from "../context";
|
|
4
6
|
import type { RadioGroupState } from "../types";
|
|
5
7
|
import { RadioGroupVariants } from "../variants";
|
|
@@ -21,9 +23,11 @@ const calculateState = (isDisabled: boolean | undefined): RadioGroupState => {
|
|
|
21
23
|
export function RadioGroupRoot(props: RadioGroupRootProps) {
|
|
22
24
|
const { children, value, onChange, isDisabled, style, variant, ...viewProps } = props;
|
|
23
25
|
const variantStyles = RadioGroupVariants[variant ?? "default"]();
|
|
26
|
+
const componentConfig = useComponentConfig("radioGroup");
|
|
27
|
+
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
24
28
|
|
|
25
29
|
const state = calculateState(isDisabled);
|
|
26
|
-
const composedStyle = [
|
|
30
|
+
const composedStyle = [mergedStyles.root?.default, mergedStyles.root?.[state], style];
|
|
27
31
|
|
|
28
32
|
const contextValue = React.useMemo(
|
|
29
33
|
() => ({
|
|
@@ -31,9 +35,9 @@ export function RadioGroupRoot(props: RadioGroupRootProps) {
|
|
|
31
35
|
onChange,
|
|
32
36
|
isDisabled,
|
|
33
37
|
state,
|
|
34
|
-
styles:
|
|
38
|
+
styles: mergedStyles,
|
|
35
39
|
}),
|
|
36
|
-
[value, onChange, isDisabled, state,
|
|
40
|
+
[value, onChange, isDisabled, state, mergedStyles],
|
|
37
41
|
);
|
|
38
42
|
|
|
39
43
|
return (
|
|
@@ -33,11 +33,7 @@ export function SelectContent(props: SelectContentProps) {
|
|
|
33
33
|
const Component = props.render ?? View;
|
|
34
34
|
return (
|
|
35
35
|
<Component
|
|
36
|
-
style={[
|
|
37
|
-
positionStyle,
|
|
38
|
-
composedStyles,
|
|
39
|
-
{ width: select.triggerPosition.width },
|
|
40
|
-
]}
|
|
36
|
+
style={[positionStyle, composedStyles, { width: select.triggerPosition.width }]}
|
|
41
37
|
onLayout={(e) => {
|
|
42
38
|
select.setContentLayout(e.nativeEvent.layout);
|
|
43
39
|
}}
|
|
@@ -9,7 +9,11 @@ export type SelectOptionProps = {
|
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const calculateState = (
|
|
12
|
+
const calculateState = (
|
|
13
|
+
selectState: SelectState,
|
|
14
|
+
hovered: boolean,
|
|
15
|
+
selected: boolean,
|
|
16
|
+
): SelectOptionState => {
|
|
13
17
|
if (selectState === "disabled") {
|
|
14
18
|
return "disabled";
|
|
15
19
|
}
|
|
@@ -16,7 +16,12 @@ export interface SelectOverlayProps {
|
|
|
16
16
|
export function SelectOverlay(props: SelectOverlayProps) {
|
|
17
17
|
const select = useSelect();
|
|
18
18
|
|
|
19
|
-
const composedStyles = calculateComposedStyles(
|
|
19
|
+
const composedStyles = calculateComposedStyles(
|
|
20
|
+
select.styles,
|
|
21
|
+
select.state,
|
|
22
|
+
"overlay",
|
|
23
|
+
props.style,
|
|
24
|
+
);
|
|
20
25
|
|
|
21
26
|
const Component = props.render ?? Pressable;
|
|
22
27
|
return (
|
|
@@ -31,9 +31,7 @@ export function SelectPortal(props: SelectPortalProps) {
|
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<Portal name="select-portal">
|
|
34
|
-
<SelectContext.Provider value={select}>
|
|
35
|
-
{props.children}
|
|
36
|
-
</SelectContext.Provider>
|
|
34
|
+
<SelectContext.Provider value={select}>{props.children}</SelectContext.Provider>
|
|
37
35
|
</Portal>
|
|
38
36
|
);
|
|
39
37
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { DEFAULT_LAYOUT, DEFAULT_POSITION, type LayoutPosition } from "../../../hooks";
|
|
2
|
-
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
3
1
|
import React, { useState } from "react";
|
|
4
2
|
import { type LayoutRectangle, type StyleProp, View, type ViewStyle } from "react-native";
|
|
3
|
+
import { DEFAULT_LAYOUT, DEFAULT_POSITION, type LayoutPosition } from "../../../hooks";
|
|
4
|
+
import { useComponentConfig } from "../../../themes/provider";
|
|
5
|
+
import { calculateComposedStyles, mergeStyles } from "../../../utils/calculate-styles";
|
|
5
6
|
import { SelectContext } from "../context";
|
|
6
7
|
import type { SelectOption, SelectState } from "../types";
|
|
7
8
|
import { SelectVariants } from "../variants";
|
|
@@ -36,6 +37,8 @@ const calculateState = (props: SelectRootProps): SelectState => {
|
|
|
36
37
|
|
|
37
38
|
export function SelectRoot(props: SelectRootProps) {
|
|
38
39
|
const variantStyles = SelectVariants[props.variant ?? "default"]();
|
|
40
|
+
const componentConfig = useComponentConfig("select");
|
|
41
|
+
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
39
42
|
|
|
40
43
|
const [isOpen, setIsOpen] = useState(false);
|
|
41
44
|
const [contentLayout, setContentLayout] = useState<LayoutRectangle>(DEFAULT_LAYOUT);
|
|
@@ -43,7 +46,7 @@ export function SelectRoot(props: SelectRootProps) {
|
|
|
43
46
|
const [options, setOptions] = useState<Array<SelectOption>>([]);
|
|
44
47
|
|
|
45
48
|
const state = calculateState(props);
|
|
46
|
-
const composedStyles = calculateComposedStyles(
|
|
49
|
+
const composedStyles = calculateComposedStyles(mergedStyles, state, "root", props.style);
|
|
47
50
|
|
|
48
51
|
const Component = props.render ?? View;
|
|
49
52
|
return (
|
|
@@ -61,7 +64,7 @@ export function SelectRoot(props: SelectRootProps) {
|
|
|
61
64
|
setOptions,
|
|
62
65
|
state,
|
|
63
66
|
isDisabled: props.isDisabled ?? false,
|
|
64
|
-
styles:
|
|
67
|
+
styles: mergedStyles,
|
|
65
68
|
}}
|
|
66
69
|
>
|
|
67
70
|
<Component style={composedStyles}>{props.children}</Component>
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import React, { useRef } from "react";
|
|
2
|
-
import {
|
|
3
|
-
Pressable,
|
|
4
|
-
Text,
|
|
5
|
-
type StyleProp,
|
|
6
|
-
type TextStyle,
|
|
7
|
-
type ViewStyle,
|
|
8
|
-
} from "react-native";
|
|
2
|
+
import { Pressable, Text, type StyleProp, type TextStyle, type ViewStyle } from "react-native";
|
|
9
3
|
import type { ViewRef } from "../../../types/element.types";
|
|
10
4
|
import { calculateComposedStyles } from "../../../utils/calculate-styles";
|
|
11
5
|
import { measureLayoutPosition } from "../../../utils/normalize-layout";
|
|
@@ -58,9 +52,7 @@ export interface SelectValueProps {
|
|
|
58
52
|
export function SelectValue(props: SelectValueProps) {
|
|
59
53
|
const select = useSelect();
|
|
60
54
|
|
|
61
|
-
const selectedOption = select.options.find(
|
|
62
|
-
(option) => option.value === select.value,
|
|
63
|
-
);
|
|
55
|
+
const selectedOption = select.options.find((option) => option.value === select.value);
|
|
64
56
|
const selectedOptionLabel = selectedOption?.label;
|
|
65
57
|
const displayValue = selectedOptionLabel ?? select.value;
|
|
66
58
|
|
|
@@ -72,7 +64,5 @@ export function SelectValue(props: SelectValueProps) {
|
|
|
72
64
|
if (!!displayValue && typeof displayValue !== "string") {
|
|
73
65
|
return <>{displayValue}</>;
|
|
74
66
|
}
|
|
75
|
-
return
|
|
76
|
-
<Text style={composedStyles}>{displayValue ?? props.placeholder}</Text>
|
|
77
|
-
);
|
|
67
|
+
return <Text style={composedStyles}>{displayValue ?? props.placeholder}</Text>;
|
|
78
68
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React 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 { SeparatorVariants } from "./variants";
|
|
4
6
|
|
|
5
7
|
export interface SeparatorProps {
|
|
@@ -10,6 +12,8 @@ export interface SeparatorProps {
|
|
|
10
12
|
export function Separator(props: SeparatorProps) {
|
|
11
13
|
const { variant = "horizontal", style } = props;
|
|
12
14
|
const variantStyles = SeparatorVariants[variant]();
|
|
15
|
+
const componentConfig = useComponentConfig("separator");
|
|
16
|
+
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
13
17
|
|
|
14
|
-
return <View style={[
|
|
18
|
+
return <View style={[mergedStyles.root, style]} />;
|
|
15
19
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type StyleProp,
|
|
6
|
-
type ViewStyle,
|
|
7
|
-
} from "react-native";
|
|
2
|
+
import { ActivityIndicator, type ColorValue, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import { useComponentConfig } from "../../themes/provider";
|
|
4
|
+
import { mergeStyles } from "../../utils/calculate-styles";
|
|
8
5
|
import { SpinnerVariants } from "./variants";
|
|
9
6
|
|
|
10
7
|
export interface SpinnerProps {
|
|
@@ -17,12 +14,14 @@ export interface SpinnerProps {
|
|
|
17
14
|
export function Spinner(props: SpinnerProps) {
|
|
18
15
|
const { size, variant = "default", color, style } = props;
|
|
19
16
|
const styles = SpinnerVariants[variant]();
|
|
17
|
+
const componentConfig = useComponentConfig("spinner");
|
|
18
|
+
const mergedStyles = mergeStyles(styles, componentConfig?.styles);
|
|
20
19
|
|
|
21
20
|
return (
|
|
22
21
|
<ActivityIndicator
|
|
23
|
-
size={size ??
|
|
24
|
-
color={color ??
|
|
25
|
-
style={[
|
|
22
|
+
size={size ?? mergedStyles.size}
|
|
23
|
+
color={color ?? mergedStyles.color}
|
|
24
|
+
style={[mergedStyles, style]}
|
|
26
25
|
/>
|
|
27
26
|
);
|
|
28
27
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
import type { TableState, TableStyles } from "./types";
|
|
3
|
+
|
|
4
|
+
export interface TableContext {
|
|
5
|
+
state: TableState;
|
|
6
|
+
styles?: TableStyles;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const TableContext = createContext<TableContext | undefined>(undefined);
|
|
10
|
+
|
|
11
|
+
export const useTable = () => {
|
|
12
|
+
const context = useContext(TableContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error("useTable must be used within a Table.Root");
|
|
15
|
+
}
|
|
16
|
+
return context;
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TableBody } from "./table-body";
|
|
2
|
+
import { TableCell } from "./table-cell";
|
|
3
|
+
import { TableHead } from "./table-head";
|
|
4
|
+
import { TableHeader } from "./table-header";
|
|
5
|
+
import { TableRoot } from "./table-root";
|
|
6
|
+
import { TableRow } from "./table-row";
|
|
7
|
+
|
|
8
|
+
export const Table = {
|
|
9
|
+
Root: TableRoot,
|
|
10
|
+
Header: TableHeader,
|
|
11
|
+
Body: TableBody,
|
|
12
|
+
Row: TableRow,
|
|
13
|
+
Head: TableHead,
|
|
14
|
+
Cell: TableCell,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type { TableBodyProps } from "./table-body";
|
|
18
|
+
export type { TableCellProps } from "./table-cell";
|
|
19
|
+
export type { TableHeadProps } from "./table-head";
|
|
20
|
+
export type { TableHeaderProps } from "./table-header";
|
|
21
|
+
export type { TableRootProps } from "./table-root";
|
|
22
|
+
export type { TableRowProps } from "./table-row";
|
|
23
|
+
export type { TableStyles } from "./types";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
3
|
+
import type { PropsWithRender } from "../../types/props.types";
|
|
4
|
+
import { calculateComposedStyles } from "../../utils/calculate-styles";
|
|
5
|
+
import { useTable } from "./context";
|
|
6
|
+
|
|
7
|
+
export interface TableBodyProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function TableBody(props: PropsWithRender<TableBodyProps>) {
|
|
14
|
+
const table = useTable();
|
|
15
|
+
|
|
16
|
+
const composedStyle = calculateComposedStyles(table.styles, table.state, "body", props.style);
|
|
17
|
+
|
|
18
|
+
const Component = props.render ?? View;
|
|
19
|
+
return <Component {...props} style={composedStyle} />;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
3
|
+
import type { PropsWithRender } from "../../types/props.types";
|
|
4
|
+
import { calculateComposedStyles } from "../../utils/calculate-styles";
|
|
5
|
+
import { useTable } from "./context";
|
|
6
|
+
|
|
7
|
+
export interface TableCellProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function TableCell(props: PropsWithRender<TableCellProps>) {
|
|
14
|
+
const table = useTable();
|
|
15
|
+
|
|
16
|
+
const composedStyle = calculateComposedStyles(table.styles, table.state, "cell", props.style);
|
|
17
|
+
|
|
18
|
+
const Component = props.render ?? View;
|
|
19
|
+
return <Component {...props} style={composedStyle} />;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
3
|
+
import type { PropsWithRender } from "../../types/props.types";
|
|
4
|
+
import { calculateComposedStyles } from "../../utils/calculate-styles";
|
|
5
|
+
import { useTable } from "./context";
|
|
6
|
+
|
|
7
|
+
export interface TableHeadProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function TableHead(props: PropsWithRender<TableHeadProps>) {
|
|
14
|
+
const table = useTable();
|
|
15
|
+
|
|
16
|
+
const composedStyle = calculateComposedStyles(table.styles, table.state, "head", props.style);
|
|
17
|
+
|
|
18
|
+
const Component = props.render ?? View;
|
|
19
|
+
return <Component {...props} style={composedStyle} />;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
3
|
+
import type { PropsWithRender } from "../../types/props.types";
|
|
4
|
+
import { calculateComposedStyles } from "../../utils/calculate-styles";
|
|
5
|
+
import { useTable } from "./context";
|
|
6
|
+
|
|
7
|
+
export interface TableHeaderProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function TableHeader(props: PropsWithRender<TableHeaderProps>) {
|
|
14
|
+
const table = useTable();
|
|
15
|
+
|
|
16
|
+
const composedStyle = calculateComposedStyles(table.styles, table.state, "header", props.style);
|
|
17
|
+
|
|
18
|
+
const Component = props.render ?? View;
|
|
19
|
+
return <Component {...props} style={composedStyle} />;
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
3
|
+
import { useComponentConfig } from "../../themes/provider";
|
|
4
|
+
import type { PropsWithRender } from "../../types/props.types";
|
|
5
|
+
import { calculateComposedStyles, mergeStyles } from "../../utils/calculate-styles";
|
|
6
|
+
import { TableContext } from "./context";
|
|
7
|
+
import { TableVariants } from "./variants";
|
|
8
|
+
|
|
9
|
+
export interface TableRootProps {
|
|
10
|
+
variant?: keyof typeof TableVariants;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
|
|
13
|
+
style?: StyleProp<ViewStyle>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function TableRoot(props: PropsWithRender<TableRootProps>) {
|
|
17
|
+
const variantStyles = TableVariants[props.variant || "default"]();
|
|
18
|
+
const componentConfig = useComponentConfig("table");
|
|
19
|
+
|
|
20
|
+
const mergedStyles = mergeStyles(variantStyles, componentConfig?.styles);
|
|
21
|
+
|
|
22
|
+
const composedStyle = calculateComposedStyles(mergedStyles, "default", "root", props.style);
|
|
23
|
+
|
|
24
|
+
const Component = props.render ?? View;
|
|
25
|
+
return (
|
|
26
|
+
<TableContext.Provider
|
|
27
|
+
value={{
|
|
28
|
+
state: "default",
|
|
29
|
+
styles: mergedStyles,
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
<Component {...props} style={composedStyle} />
|
|
33
|
+
</TableContext.Provider>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, View, type ViewStyle } from "react-native";
|
|
3
|
+
import type { PropsWithRender } from "../../types/props.types";
|
|
4
|
+
import { calculateComposedStyles } from "../../utils/calculate-styles";
|
|
5
|
+
import { useTable } from "./context";
|
|
6
|
+
|
|
7
|
+
export interface TableRowProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function TableRow(props: PropsWithRender<TableRowProps>) {
|
|
14
|
+
const table = useTable();
|
|
15
|
+
|
|
16
|
+
const composedStyle = calculateComposedStyles(table.styles, table.state, "row", props.style);
|
|
17
|
+
|
|
18
|
+
const Component = props.render ?? View;
|
|
19
|
+
return <Component {...props} style={composedStyle} />;
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TableBodyProps } from "./table-body";
|
|
2
|
+
import type { TableCellProps } from "./table-cell";
|
|
3
|
+
import type { TableHeadProps } from "./table-head";
|
|
4
|
+
import type { TableHeaderProps } from "./table-header";
|
|
5
|
+
import type { TableRootProps } from "./table-root";
|
|
6
|
+
import type { TableRowProps } from "./table-row";
|
|
7
|
+
|
|
8
|
+
export type TableState = "default";
|
|
9
|
+
|
|
10
|
+
export interface TableStyles {
|
|
11
|
+
root?: Partial<Record<TableState, TableRootProps["style"]>>;
|
|
12
|
+
header?: Partial<Record<TableState, TableHeaderProps["style"]>>;
|
|
13
|
+
body?: Partial<Record<TableState, TableBodyProps["style"]>>;
|
|
14
|
+
row?: Partial<Record<TableState, TableRowProps["style"]>>;
|
|
15
|
+
head?: Partial<Record<TableState, TableHeadProps["style"]>>;
|
|
16
|
+
cell?: Partial<Record<TableState, TableCellProps["style"]>>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
2
|
+
import type { TableStyles } from "../types";
|
|
3
|
+
|
|
4
|
+
export function useTableVariantDefault(): TableStyles {
|
|
5
|
+
return useThemedStyles(
|
|
6
|
+
({ colors, radius }): TableStyles => ({
|
|
7
|
+
root: {
|
|
8
|
+
default: {
|
|
9
|
+
borderWidth: 1,
|
|
10
|
+
borderColor: colors.border,
|
|
11
|
+
borderRadius: radius,
|
|
12
|
+
overflow: "hidden",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
header: {
|
|
16
|
+
default: {
|
|
17
|
+
backgroundColor: colors.muted,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
body: {
|
|
21
|
+
default: {},
|
|
22
|
+
},
|
|
23
|
+
row: {
|
|
24
|
+
default: {
|
|
25
|
+
flexDirection: "row",
|
|
26
|
+
borderBottomWidth: 1,
|
|
27
|
+
borderBottomColor: colors.border,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
head: {
|
|
31
|
+
default: {
|
|
32
|
+
flex: 1,
|
|
33
|
+
paddingHorizontal: 16,
|
|
34
|
+
paddingVertical: 12,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
cell: {
|
|
38
|
+
default: {
|
|
39
|
+
flex: 1,
|
|
40
|
+
paddingHorizontal: 16,
|
|
41
|
+
paddingVertical: 12,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -35,13 +35,7 @@ const calculateState = (
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export function TabsItem(props: TabsItemProps) {
|
|
38
|
-
const {
|
|
39
|
-
children,
|
|
40
|
-
value: triggerValue,
|
|
41
|
-
isDisabled = false,
|
|
42
|
-
style,
|
|
43
|
-
...pressableProps
|
|
44
|
-
} = props;
|
|
38
|
+
const { children, value: triggerValue, isDisabled = false, style, ...pressableProps } = props;
|
|
45
39
|
const { value, onChange, styles } = useTabsContext();
|
|
46
40
|
const [isHovered, setIsHovered] = useState(false);
|
|
47
41
|
const isActive = value === triggerValue;
|
|
@@ -53,27 +47,13 @@ export function TabsItem(props: TabsItemProps) {
|
|
|
53
47
|
}
|
|
54
48
|
};
|
|
55
49
|
|
|
56
|
-
const calculatedStyle = StyleSheet.flatten([
|
|
57
|
-
styles?.item?.default,
|
|
58
|
-
styles?.item?.[state],
|
|
59
|
-
style,
|
|
60
|
-
]);
|
|
50
|
+
const calculatedStyle = StyleSheet.flatten([styles?.item?.default, styles?.item?.[state], style]);
|
|
61
51
|
|
|
62
|
-
const textStyles = StyleSheet.flatten([
|
|
63
|
-
styles?.itemText?.default,
|
|
64
|
-
styles?.itemText?.[state],
|
|
65
|
-
]);
|
|
52
|
+
const textStyles = StyleSheet.flatten([styles?.itemText?.default, styles?.itemText?.[state]]);
|
|
66
53
|
|
|
67
|
-
const iconStyles = StyleSheet.flatten([
|
|
68
|
-
styles?.itemIcon?.default,
|
|
69
|
-
styles?.itemIcon?.[state],
|
|
70
|
-
]);
|
|
54
|
+
const iconStyles = StyleSheet.flatten([styles?.itemIcon?.default, styles?.itemIcon?.[state]]);
|
|
71
55
|
|
|
72
|
-
const organizedChildren = useOrganizedChildren(
|
|
73
|
-
children,
|
|
74
|
-
textStyles,
|
|
75
|
-
iconStyles ?? undefined,
|
|
76
|
-
);
|
|
56
|
+
const organizedChildren = useOrganizedChildren(children, textStyles, iconStyles ?? undefined);
|
|
77
57
|
|
|
78
58
|
return (
|
|
79
59
|
<Pressable
|