@pallasoft/ps-mobile-components 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ps-action-menu/ps-action-menu-avatar-entry.d.ts +5 -0
- package/dist/components/ps-action-menu/ps-action-menu-avatar-entry.js +16 -0
- package/dist/components/ps-action-menu/ps-action-menu-entries.js +5 -2
- package/dist/components/ps-action-menu/ps-action-menu-labelled.d.ts +2 -1
- package/dist/components/ps-action-menu/ps-action-menu-labelled.js +2 -2
- package/dist/components/ps-action-menu/ps-action-menu.android.js +19 -30
- package/dist/components/ps-action-menu/ps-action-menu.ios.js +10 -1
- package/dist/components/ps-action-menu/ps-menu-tile-canvas.d.ts +6 -0
- package/dist/components/ps-action-menu/ps-menu-tile-canvas.js +5 -0
- package/dist/components/ps-action-menu/ps-menu-tile-drawing.d.ts +6 -0
- package/dist/components/ps-action-menu/ps-menu-tile-drawing.js +34 -0
- package/dist/components/ps-action-sheet/ps-action-sheet.js +6 -4
- package/dist/components/ps-app-lock-screen/index.d.ts +2 -0
- package/dist/components/ps-app-lock-screen/index.js +2 -0
- package/dist/components/ps-app-lock-screen/ps-app-lock-screen-props.d.ts +9 -0
- package/dist/components/ps-app-lock-screen/ps-app-lock-screen-props.js +1 -0
- package/dist/components/ps-app-lock-screen/ps-app-lock-screen.d.ts +2 -0
- package/dist/components/ps-app-lock-screen/ps-app-lock-screen.js +19 -0
- package/dist/components/ps-barcode-scanner-sheet/index.d.ts +2 -0
- package/dist/components/ps-barcode-scanner-sheet/index.js +2 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet-props.d.ts +11 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet-props.js +1 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet.d.ts +2 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet.js +82 -0
- package/dist/components/ps-button/ps-button.js +4 -2
- package/dist/components/ps-cartesian-chart/ps-cartesian-chart.js +25 -19
- package/dist/components/ps-checkbox/ps-checkbox.js +5 -2
- package/dist/components/ps-chip/ps-chip.js +4 -2
- package/dist/components/ps-date-field/ps-date-field.android.js +1 -1
- package/dist/components/ps-date-field/ps-date-field.ios.js +1 -1
- package/dist/components/ps-document-page/ps-document-page-props.d.ts +3 -0
- package/dist/components/ps-document-page/ps-document-page.d.ts +1 -1
- package/dist/components/ps-document-page/ps-document-page.js +16 -7
- package/dist/components/ps-document-page-strip/index.d.ts +2 -0
- package/dist/components/ps-document-page-strip/index.js +2 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip-props.d.ts +6 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip-props.js +1 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip.d.ts +2 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip.js +43 -0
- package/dist/components/ps-document-pdf-cover/index.d.ts +2 -0
- package/dist/components/ps-document-pdf-cover/index.js +2 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover-props.d.ts +6 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover-props.js +1 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover.d.ts +2 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover.js +18 -0
- package/dist/components/ps-document-preview/ps-document-preview.js +3 -4
- package/dist/components/ps-document-preview-face/index.d.ts +2 -0
- package/dist/components/ps-document-preview-face/index.js +2 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face-props.d.ts +6 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face-props.js +1 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face.d.ts +2 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face.js +18 -0
- package/dist/components/ps-document-text-page/index.d.ts +2 -0
- package/dist/components/ps-document-text-page/index.js +2 -0
- package/dist/components/ps-document-text-page/ps-document-text-page-props.d.ts +6 -0
- package/dist/components/ps-document-text-page/ps-document-text-page-props.js +1 -0
- package/dist/components/ps-document-text-page/ps-document-text-page.d.ts +2 -0
- package/dist/components/ps-document-text-page/ps-document-text-page.js +18 -0
- package/dist/components/ps-document-unsupported/index.d.ts +2 -0
- package/dist/components/ps-document-unsupported/index.js +2 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported-props.d.ts +7 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported-props.js +1 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported.d.ts +2 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported.js +10 -0
- package/dist/components/ps-document-viewer/ps-document-viewer.js +27 -7
- package/dist/components/ps-form-sheet/ps-form-sheet-props.d.ts +2 -0
- package/dist/components/ps-form-sheet/ps-form-sheet.d.ts +1 -1
- package/dist/components/ps-form-sheet/ps-form-sheet.js +17 -7
- package/dist/components/ps-header-action/index.d.ts +2 -0
- package/dist/components/ps-header-action/index.js +2 -0
- package/dist/components/ps-header-action/ps-header-action-props.d.ts +6 -0
- package/dist/components/ps-header-action/ps-header-action-props.js +1 -0
- package/dist/components/ps-header-action/ps-header-action.android.d.ts +2 -0
- package/dist/components/ps-header-action/ps-header-action.android.js +9 -0
- package/dist/components/ps-header-action/ps-header-action.d.ts +2 -0
- package/dist/components/ps-header-action/ps-header-action.js +11 -0
- package/dist/components/ps-header-menu/index.d.ts +2 -0
- package/dist/components/ps-header-menu/index.js +2 -0
- package/dist/components/ps-header-menu/ps-header-menu-props.d.ts +7 -0
- package/dist/components/ps-header-menu/ps-header-menu-props.js +1 -0
- package/dist/components/ps-header-menu/ps-header-menu.android.d.ts +2 -0
- package/dist/components/ps-header-menu/ps-header-menu.android.js +11 -0
- package/dist/components/ps-header-menu/ps-header-menu.d.ts +2 -0
- package/dist/components/ps-header-menu/ps-header-menu.js +20 -0
- package/dist/components/ps-icon-button/ps-icon-button.js +7 -7
- package/dist/components/ps-kpi-card/ps-kpi-card.js +1 -2
- package/dist/components/ps-list/ps-list-action-row.js +6 -6
- package/dist/components/ps-list/ps-list-context-menu.android.d.ts +2 -0
- package/dist/components/ps-list/ps-list-context-menu.android.js +3 -0
- package/dist/components/ps-list/ps-list-context-menu.js +1 -1
- package/dist/components/ps-list/ps-list-link-menu-entry.d.ts +5 -0
- package/dist/components/ps-list/ps-list-link-menu-entry.js +11 -0
- package/dist/components/ps-list/ps-list-link-menu.android.d.ts +2 -0
- package/dist/components/ps-list/ps-list-link-menu.android.js +7 -0
- package/dist/components/ps-list/ps-list-link-menu.d.ts +10 -0
- package/dist/components/ps-list/ps-list-link-menu.js +16 -0
- package/dist/components/ps-list/ps-list-link-row.js +6 -6
- package/dist/components/ps-list/ps-list-props.d.ts +4 -1
- package/dist/components/ps-list/ps-list-row-body.d.ts +2 -2
- package/dist/components/ps-list/ps-list-row-body.js +9 -8
- package/dist/components/ps-list/ps-list-row-menu.d.ts +10 -0
- package/dist/components/ps-list/ps-list-row-menu.js +27 -0
- package/dist/components/ps-list/ps-list-row.d.ts +1 -1
- package/dist/components/ps-list/ps-list-row.js +4 -3
- package/dist/components/ps-list/ps-list-select-row.js +2 -1
- package/dist/components/ps-menu-popup/index.d.ts +4 -0
- package/dist/components/ps-menu-popup/index.js +4 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-divider.d.ts +1 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-divider.js +7 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-header.d.ts +5 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-header.js +8 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-row.d.ts +12 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-row.js +22 -0
- package/dist/components/ps-menu-popup/ps-menu-popup.d.ts +9 -0
- package/dist/components/ps-menu-popup/ps-menu-popup.js +35 -0
- package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider-props.d.ts +5 -2
- package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider.d.ts +1 -1
- package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider.js +27 -11
- package/dist/components/ps-native-menu/ps-native-menu-row.js +5 -5
- package/dist/components/ps-native-menu/ps-native-menu.android.js +16 -24
- package/dist/components/ps-option-picker/index.d.ts +2 -0
- package/dist/components/ps-option-picker/index.js +2 -0
- package/dist/components/ps-option-picker/ps-option-picker-props.d.ts +16 -0
- package/dist/components/ps-option-picker/ps-option-picker-props.js +1 -0
- package/dist/components/ps-option-picker/ps-option-picker.d.ts +2 -0
- package/dist/components/ps-option-picker/ps-option-picker.js +35 -0
- package/dist/components/ps-page-header/ps-page-header.js +3 -1
- package/dist/components/ps-pallasoft-sign-in-button/ps-pallasoft-sign-in-button.js +3 -1
- package/dist/components/ps-privacy-cover/index.d.ts +2 -0
- package/dist/components/ps-privacy-cover/index.js +2 -0
- package/dist/components/ps-privacy-cover/ps-privacy-cover-props.d.ts +4 -0
- package/dist/components/ps-privacy-cover/ps-privacy-cover-props.js +1 -0
- package/dist/components/ps-privacy-cover/ps-privacy-cover.d.ts +2 -0
- package/dist/components/ps-privacy-cover/ps-privacy-cover.js +17 -0
- package/dist/components/ps-screen/ps-screen.js +9 -4
- package/dist/components/ps-search-field/ps-search-field.js +3 -1
- package/dist/components/ps-search-select-field/index.d.ts +2 -0
- package/dist/components/ps-search-select-field/index.js +2 -0
- package/dist/components/ps-search-select-field/ps-search-select-field-props.d.ts +10 -0
- package/dist/components/ps-search-select-field/ps-search-select-field-props.js +1 -0
- package/dist/components/ps-search-select-field/ps-search-select-field.d.ts +2 -0
- package/dist/components/ps-search-select-field/ps-search-select-field.js +15 -0
- package/dist/components/ps-segmented-control/ps-segmented-control.android.js +4 -9
- package/dist/components/ps-selection-mode/index.d.ts +2 -0
- package/dist/components/ps-selection-mode/index.js +2 -0
- package/dist/components/ps-selection-mode/ps-selection-bar.d.ts +9 -0
- package/dist/components/ps-selection-mode/ps-selection-bar.js +49 -0
- package/dist/components/ps-selection-mode/ps-selection-mode-props.d.ts +13 -0
- package/dist/components/ps-selection-mode/ps-selection-mode-props.js +1 -0
- package/dist/components/ps-selection-mode/ps-selection-mode.android.d.ts +2 -0
- package/dist/components/ps-selection-mode/ps-selection-mode.android.js +23 -0
- package/dist/components/ps-selection-mode/ps-selection-mode.d.ts +2 -0
- package/dist/components/ps-selection-mode/ps-selection-mode.js +28 -0
- package/dist/components/ps-sheet/ps-sheet-props.d.ts +4 -1
- package/dist/components/ps-sheet/ps-sheet.d.ts +1 -1
- package/dist/components/ps-sheet/ps-sheet.js +4 -5
- package/dist/components/ps-sheet-content/ps-sheet-content.js +1 -1
- package/dist/components/ps-sheet-header/ps-sheet-header-props.d.ts +2 -0
- package/dist/components/ps-sheet-header/ps-sheet-header.d.ts +1 -1
- package/dist/components/ps-sheet-header/ps-sheet-header.js +2 -2
- package/dist/components/ps-sheet-page/ps-sheet-page-view.d.ts +8 -0
- package/dist/components/ps-sheet-page/ps-sheet-page-view.js +11 -0
- package/dist/components/ps-sheet-presenter/ps-sheet-presenter.android.js +4 -4
- package/dist/components/ps-sheet-presenter/ps-sheet-presenter.ios.js +9 -2
- package/dist/components/ps-sortable-grid/ps-sortable-item.js +2 -0
- package/dist/components/ps-spinner/ps-spinner.android.d.ts +2 -0
- package/dist/components/ps-spinner/ps-spinner.android.js +13 -0
- package/dist/components/ps-switch/ps-switch.android.d.ts +2 -0
- package/dist/components/ps-switch/ps-switch.android.js +25 -0
- package/dist/components/ps-switcher/index.d.ts +2 -0
- package/dist/components/ps-switcher/index.js +2 -0
- package/dist/components/ps-switcher/ps-switcher-panel.d.ts +10 -0
- package/dist/components/ps-switcher/ps-switcher-panel.js +17 -0
- package/dist/components/ps-switcher/ps-switcher-props.d.ts +12 -0
- package/dist/components/ps-switcher/ps-switcher-props.js +1 -0
- package/dist/components/ps-switcher/ps-switcher-row.d.ts +7 -0
- package/dist/components/ps-switcher/ps-switcher-row.js +33 -0
- package/dist/components/ps-switcher/ps-switcher-trigger.d.ts +11 -0
- package/dist/components/ps-switcher/ps-switcher-trigger.js +35 -0
- package/dist/components/ps-switcher/ps-switcher.d.ts +2 -0
- package/dist/components/ps-switcher/ps-switcher.js +21 -0
- package/dist/components/ps-tab-bar-provider/index.d.ts +2 -0
- package/dist/components/ps-tab-bar-provider/index.js +2 -0
- package/dist/components/ps-tab-bar-provider/ps-tab-bar-provider-props.d.ts +4 -0
- package/dist/components/ps-tab-bar-provider/ps-tab-bar-provider-props.js +1 -0
- package/dist/components/ps-tab-bar-provider/ps-tab-bar-provider.d.ts +2 -0
- package/dist/components/ps-tab-bar-provider/ps-tab-bar-provider.js +8 -0
- package/dist/components/ps-tabs/ps-tabs.js +4 -2
- package/dist/components/ps-text-link/ps-text-link.js +1 -1
- package/dist/components/ps-waterfall-chart/index.d.ts +2 -0
- package/dist/components/ps-waterfall-chart/index.js +2 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart-props.d.ts +9 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart-props.js +1 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart.d.ts +2 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart.js +37 -0
- package/dist/components/ps-widget-list/ps-widget-list.js +1 -1
- package/dist/constants/ps-android-state-config.d.ts +12 -0
- package/dist/constants/ps-android-state-config.js +12 -0
- package/dist/constants/ps-app-lock-config.d.ts +13 -0
- package/dist/constants/ps-app-lock-config.js +13 -0
- package/dist/constants/ps-app-lock-native-codes.d.ts +10 -0
- package/dist/constants/ps-app-lock-native-codes.js +10 -0
- package/dist/constants/ps-barcode-permission.d.ts +6 -0
- package/dist/constants/ps-barcode-permission.js +5 -0
- package/dist/constants/ps-barcode-scanner-config.d.ts +18 -0
- package/dist/constants/ps-barcode-scanner-config.js +31 -0
- package/dist/constants/ps-biometry-kind.d.ts +7 -0
- package/dist/constants/ps-biometry-kind.js +6 -0
- package/dist/constants/ps-capture-config.d.ts +12 -0
- package/dist/constants/ps-capture-config.js +22 -0
- package/dist/constants/ps-capture-source.d.ts +7 -0
- package/dist/constants/ps-capture-source.js +6 -0
- package/dist/constants/ps-cartesian-series-shape.d.ts +5 -0
- package/dist/constants/ps-cartesian-series-shape.js +4 -0
- package/dist/constants/ps-chart-brand-config.d.ts +21 -0
- package/dist/constants/ps-chart-brand-config.js +10 -0
- package/dist/constants/ps-document-config.d.ts +3 -0
- package/dist/constants/ps-document-config.js +3 -0
- package/dist/constants/ps-document-file-config.d.ts +11 -0
- package/dist/constants/ps-document-file-config.js +11 -0
- package/dist/constants/ps-document-kind.d.ts +1 -0
- package/dist/constants/ps-document-kind.js +1 -0
- package/dist/constants/ps-document-load-status.d.ts +7 -0
- package/dist/constants/ps-document-load-status.js +6 -0
- package/dist/constants/ps-document-pdf-config.d.ts +14 -0
- package/dist/constants/ps-document-pdf-config.js +14 -0
- package/dist/constants/ps-header-config.d.ts +3 -0
- package/dist/constants/ps-header-config.js +3 -0
- package/dist/constants/ps-list-config.d.ts +2 -0
- package/dist/constants/ps-list-config.js +2 -0
- package/dist/constants/ps-menu-popup-config.d.ts +10 -0
- package/dist/constants/ps-menu-popup-config.js +10 -0
- package/dist/constants/ps-menu-tile-config.d.ts +9 -0
- package/dist/constants/ps-menu-tile-config.js +9 -0
- package/dist/constants/ps-mobile-control-config.d.ts +0 -12
- package/dist/constants/ps-mobile-control-config.js +0 -6
- package/dist/constants/ps-option-picker-config.d.ts +6 -0
- package/dist/constants/ps-option-picker-config.js +6 -0
- package/dist/constants/ps-quick-action-config.d.ts +4 -0
- package/dist/constants/ps-quick-action-config.js +4 -0
- package/dist/constants/ps-ripple-kind.d.ts +8 -0
- package/dist/constants/ps-ripple-kind.js +7 -0
- package/dist/constants/ps-selection-bar-config.d.ts +4 -0
- package/dist/constants/ps-selection-bar-config.js +4 -0
- package/dist/constants/ps-sf-symbol-config.d.ts +92 -0
- package/dist/constants/ps-sf-symbol-config.js +92 -0
- package/dist/constants/ps-sheet-page-config.d.ts +4 -0
- package/dist/constants/ps-sheet-page-config.js +4 -0
- package/dist/constants/ps-sortable-grid-config.d.ts +2 -1
- package/dist/constants/ps-sortable-grid-config.js +2 -1
- package/dist/constants/ps-switcher-config.d.ts +12 -0
- package/dist/constants/ps-switcher-config.js +12 -0
- package/dist/contexts/ps-tab-bar-context.d.ts +2 -0
- package/dist/contexts/ps-tab-bar-context.js +6 -0
- package/dist/hooks/use-ps-app-lock.d.ts +3 -0
- package/dist/hooks/use-ps-app-lock.js +72 -0
- package/dist/hooks/use-ps-barcode-scanner.d.ts +2 -0
- package/dist/hooks/use-ps-barcode-scanner.js +9 -0
- package/dist/hooks/use-ps-document-open.d.ts +3 -0
- package/dist/hooks/use-ps-document-open.js +14 -0
- package/dist/hooks/use-ps-document-pdf-cover.d.ts +3 -0
- package/dist/hooks/use-ps-document-pdf-cover.js +33 -0
- package/dist/hooks/use-ps-document-pdf-pages.d.ts +3 -0
- package/dist/hooks/use-ps-document-pdf-pages.js +31 -0
- package/dist/hooks/use-ps-document-text.d.ts +3 -0
- package/dist/hooks/use-ps-document-text.js +29 -0
- package/dist/hooks/use-ps-file-upload.d.ts +3 -0
- package/dist/hooks/use-ps-file-upload.js +32 -0
- package/dist/hooks/use-ps-header-right.d.ts +2 -0
- package/dist/hooks/use-ps-header-right.js +9 -0
- package/dist/hooks/use-ps-material-scheme.d.ts +2 -0
- package/dist/hooks/use-ps-material-scheme.js +3 -0
- package/dist/hooks/use-ps-menu-anchor.d.ts +10 -0
- package/dist/hooks/use-ps-menu-anchor.js +13 -0
- package/dist/hooks/use-ps-menu-tiles.d.ts +4 -0
- package/dist/hooks/use-ps-menu-tiles.js +8 -0
- package/dist/hooks/use-ps-quick-actions.d.ts +2 -0
- package/dist/hooks/use-ps-quick-actions.js +30 -0
- package/dist/hooks/use-ps-stack-screen-options.d.ts +2 -0
- package/dist/hooks/use-ps-stack-screen-options.js +7 -0
- package/dist/hooks/use-ps-tab-bar.d.ts +2 -0
- package/dist/hooks/use-ps-tab-bar.js +3 -0
- package/dist/hooks/use-ps-top-inset.d.ts +1 -0
- package/dist/hooks/use-ps-top-inset.js +10 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.js +61 -0
- package/dist/interfaces/ps-action-menu-header.d.ts +1 -0
- package/dist/interfaces/ps-app-lock-native.d.ts +13 -0
- package/dist/interfaces/ps-app-lock-native.js +1 -0
- package/dist/interfaces/ps-app-lock-prompt.d.ts +4 -0
- package/dist/interfaces/ps-app-lock-prompt.js +1 -0
- package/dist/interfaces/ps-barcode-frame-size.d.ts +4 -0
- package/dist/interfaces/ps-barcode-frame-size.js +1 -0
- package/dist/interfaces/ps-barcode-last-read.d.ts +4 -0
- package/dist/interfaces/ps-barcode-last-read.js +1 -0
- package/dist/interfaces/ps-barcode-scan.d.ts +4 -0
- package/dist/interfaces/ps-barcode-scan.js +1 -0
- package/dist/interfaces/ps-barcode-scanner-labels.d.ts +8 -0
- package/dist/interfaces/ps-barcode-scanner-labels.js +1 -0
- package/dist/interfaces/ps-barcode-scanner-native.d.ts +23 -0
- package/dist/interfaces/ps-barcode-scanner-native.js +1 -0
- package/dist/interfaces/ps-capture-labels.d.ts +6 -0
- package/dist/interfaces/ps-capture-labels.js +1 -0
- package/dist/interfaces/ps-capture-menu-options.d.ts +6 -0
- package/dist/interfaces/ps-capture-menu-options.js +1 -0
- package/dist/interfaces/ps-capture-modules.d.ts +6 -0
- package/dist/interfaces/ps-capture-modules.js +1 -0
- package/dist/interfaces/ps-capture-options.d.ts +6 -0
- package/dist/interfaces/ps-capture-options.js +1 -0
- package/dist/interfaces/ps-cartesian-chart-series.d.ts +2 -0
- package/dist/interfaces/ps-date-dialog-colors.d.ts +19 -0
- package/dist/interfaces/ps-date-dialog-colors.js +1 -0
- package/dist/interfaces/ps-device-file.d.ts +5 -0
- package/dist/interfaces/ps-device-file.js +1 -0
- package/dist/interfaces/ps-document-file-system.d.ts +2 -0
- package/dist/interfaces/ps-document-file-system.js +1 -0
- package/dist/interfaces/ps-document-labels.d.ts +1 -0
- package/dist/interfaces/ps-document-page-image.d.ts +5 -0
- package/dist/interfaces/ps-document-page-image.js +1 -0
- package/dist/interfaces/ps-document-pdf-native.d.ts +9 -0
- package/dist/interfaces/ps-document-pdf-native.js +1 -0
- package/dist/interfaces/ps-document-pdf-options.d.ts +4 -0
- package/dist/interfaces/ps-document-pdf-options.js +1 -0
- package/dist/interfaces/ps-document-pdf-state.d.ts +6 -0
- package/dist/interfaces/ps-document-pdf-state.js +1 -0
- package/dist/interfaces/ps-document-viewer-entry.d.ts +8 -0
- package/dist/interfaces/ps-document-viewer-entry.js +1 -0
- package/dist/interfaces/ps-file-upload-options.d.ts +8 -0
- package/dist/interfaces/ps-file-upload-options.js +1 -0
- package/dist/interfaces/ps-material-scheme.d.ts +38 -0
- package/dist/interfaces/ps-material-scheme.js +1 -0
- package/dist/interfaces/ps-material-segmented-colors.d.ts +14 -0
- package/dist/interfaces/ps-material-segmented-colors.js +1 -0
- package/dist/interfaces/ps-material-switch-colors.d.ts +14 -0
- package/dist/interfaces/ps-material-switch-colors.js +1 -0
- package/dist/interfaces/ps-menu-anchor.d.ts +6 -0
- package/dist/interfaces/ps-menu-anchor.js +1 -0
- package/dist/interfaces/ps-menu-item.d.ts +3 -0
- package/dist/interfaces/ps-menu-popup-layout.d.ts +6 -0
- package/dist/interfaces/ps-menu-popup-layout.js +1 -0
- package/dist/interfaces/ps-menu-popup-window.d.ts +4 -0
- package/dist/interfaces/ps-menu-popup-window.js +1 -0
- package/dist/interfaces/ps-menu-tile-request.d.ts +7 -0
- package/dist/interfaces/ps-menu-tile-request.js +1 -0
- package/dist/interfaces/ps-menu-tile-shape.d.ts +1 -0
- package/dist/interfaces/ps-menu-tile-shape.js +1 -0
- package/dist/interfaces/ps-mobile-brand-colors.d.ts +5 -0
- package/dist/interfaces/ps-mobile-brand-colors.js +1 -0
- package/dist/interfaces/ps-mobile-brand-input.d.ts +7 -0
- package/dist/interfaces/ps-mobile-brand-input.js +1 -0
- package/dist/interfaces/ps-mobile-theme-input.d.ts +3 -1
- package/dist/interfaces/ps-mobile-theme.d.ts +32 -0
- package/dist/interfaces/ps-quick-action-native.d.ts +14 -0
- package/dist/interfaces/ps-quick-action-native.js +1 -0
- package/dist/interfaces/ps-quick-action.d.ts +7 -0
- package/dist/interfaces/ps-quick-action.js +1 -0
- package/dist/interfaces/ps-scanned-file.d.ts +2 -5
- package/dist/interfaces/ps-sheet-leading-kind.d.ts +1 -0
- package/dist/interfaces/ps-sheet-leading-kind.js +1 -0
- package/dist/interfaces/ps-sheet-page.d.ts +8 -0
- package/dist/interfaces/ps-sheet-page.js +1 -0
- package/dist/interfaces/ps-stack-screen-options.d.ts +2 -0
- package/dist/interfaces/ps-stack-screen-options.js +1 -0
- package/dist/interfaces/ps-switcher-item.d.ts +11 -0
- package/dist/interfaces/ps-switcher-item.js +1 -0
- package/dist/interfaces/ps-tab-bar-context-data.d.ts +5 -0
- package/dist/interfaces/ps-tab-bar-context-data.js +1 -0
- package/dist/interfaces/ps-tab-bar-icon-colors.d.ts +4 -0
- package/dist/interfaces/ps-tab-bar-icon-colors.js +1 -0
- package/dist/interfaces/ps-tab-bar-label-style.d.ts +5 -0
- package/dist/interfaces/ps-tab-bar-label-style.js +1 -0
- package/dist/interfaces/ps-tab-bar-label-styles.d.ts +5 -0
- package/dist/interfaces/ps-tab-bar-label-styles.js +1 -0
- package/dist/interfaces/ps-tab-bar-style.d.ts +12 -0
- package/dist/interfaces/ps-tab-bar-style.js +1 -0
- package/dist/interfaces/ps-waterfall-datum.d.ts +6 -0
- package/dist/interfaces/ps-waterfall-datum.js +1 -0
- package/dist/interfaces/ps-waterfall-step.d.ts +7 -0
- package/dist/interfaces/ps-waterfall-step.js +1 -0
- package/dist/interfaces/use-ps-app-lock-options.d.ts +6 -0
- package/dist/interfaces/use-ps-app-lock-options.js +1 -0
- package/dist/interfaces/use-ps-app-lock-result.d.ts +7 -0
- package/dist/interfaces/use-ps-app-lock-result.js +1 -0
- package/dist/interfaces/use-ps-barcode-scanner-result.d.ts +6 -0
- package/dist/interfaces/use-ps-barcode-scanner-result.js +1 -0
- package/dist/interfaces/use-ps-document-open-result.d.ts +5 -0
- package/dist/interfaces/use-ps-document-open-result.js +1 -0
- package/dist/interfaces/use-ps-document-pdf-cover-result.d.ts +7 -0
- package/dist/interfaces/use-ps-document-pdf-cover-result.js +1 -0
- package/dist/interfaces/use-ps-document-pdf-pages-result.d.ts +5 -0
- package/dist/interfaces/use-ps-document-pdf-pages-result.js +1 -0
- package/dist/interfaces/use-ps-document-text-result.d.ts +5 -0
- package/dist/interfaces/use-ps-document-text-result.js +1 -0
- package/dist/interfaces/use-ps-file-upload-result.d.ts +8 -0
- package/dist/interfaces/use-ps-file-upload-result.js +1 -0
- package/dist/interfaces/use-ps-quick-actions-options.d.ts +5 -0
- package/dist/interfaces/use-ps-quick-actions-options.js +1 -0
- package/dist/services/ps-action-menu-service.d.ts +4 -0
- package/dist/services/ps-action-menu-service.js +25 -2
- package/dist/services/ps-app-lock-grace-service.d.ts +6 -0
- package/dist/services/ps-app-lock-grace-service.js +17 -0
- package/dist/services/ps-app-lock-service.d.ts +10 -0
- package/dist/services/ps-app-lock-service.js +84 -0
- package/dist/services/ps-badge-tone-service.js +3 -3
- package/dist/services/ps-barcode-scanner-service.d.ts +14 -0
- package/dist/services/ps-barcode-scanner-service.js +53 -0
- package/dist/services/ps-button-style-service.d.ts +2 -0
- package/dist/services/ps-button-style-service.js +15 -3
- package/dist/services/ps-capture-picker-service.d.ts +11 -0
- package/dist/services/ps-capture-picker-service.js +67 -0
- package/dist/services/ps-capture-source-service.d.ts +10 -0
- package/dist/services/ps-capture-source-service.js +31 -0
- package/dist/services/ps-chart-brand-service.d.ts +4 -0
- package/dist/services/ps-chart-brand-service.js +20 -0
- package/dist/services/ps-chart-shape-service.d.ts +7 -0
- package/dist/services/ps-chart-shape-service.js +17 -0
- package/dist/services/ps-context-menu-service.d.ts +1 -0
- package/dist/services/ps-context-menu-service.js +13 -0
- package/dist/services/ps-control-style-service.js +3 -2
- package/dist/services/ps-date-picker-service.d.ts +3 -0
- package/dist/services/ps-date-picker-service.js +21 -0
- package/dist/services/ps-device-file-service.d.ts +14 -0
- package/dist/services/ps-device-file-service.js +27 -0
- package/dist/services/ps-document-file-service.d.ts +10 -0
- package/dist/services/ps-document-file-service.js +75 -0
- package/dist/services/ps-document-open-service.d.ts +5 -0
- package/dist/services/ps-document-open-service.js +16 -0
- package/dist/services/ps-document-pdf-service.d.ts +10 -0
- package/dist/services/ps-document-pdf-service.js +40 -0
- package/dist/services/ps-document-text-service.d.ts +5 -0
- package/dist/services/ps-document-text-service.js +14 -0
- package/dist/services/ps-document-viewer-entry-service.d.ts +11 -0
- package/dist/services/ps-document-viewer-entry-service.js +72 -0
- package/dist/services/ps-list-row-style-service.d.ts +4 -0
- package/dist/services/ps-list-row-style-service.js +8 -0
- package/dist/services/ps-material-control-service.d.ts +9 -0
- package/dist/services/ps-material-control-service.js +46 -0
- package/dist/services/ps-material-scheme-service.d.ts +5 -0
- package/dist/services/ps-material-scheme-service.js +42 -0
- package/dist/services/ps-menu-popup-service.d.ts +6 -0
- package/dist/services/ps-menu-popup-service.js +23 -0
- package/dist/services/ps-menu-tile-service.d.ts +16 -0
- package/dist/services/ps-menu-tile-service.js +70 -0
- package/dist/services/ps-menu-tile-style-service.d.ts +4 -0
- package/dist/services/ps-menu-tile-style-service.js +5 -0
- package/dist/services/ps-mobile-brand-service.d.ts +5 -0
- package/dist/services/ps-mobile-brand-service.js +24 -0
- package/dist/services/ps-mobile-theme-service.d.ts +1 -3
- package/dist/services/ps-mobile-theme-service.js +70 -95
- package/dist/services/ps-navigation-theme-service.d.ts +5 -0
- package/dist/services/ps-navigation-theme-service.js +21 -0
- package/dist/services/ps-option-picker-service.d.ts +8 -0
- package/dist/services/ps-option-picker-service.js +10 -0
- package/dist/services/ps-pdf-native-service.d.ts +8 -0
- package/dist/services/ps-pdf-native-service.js +33 -0
- package/dist/services/ps-quick-action-service.d.ts +9 -0
- package/dist/services/ps-quick-action-service.js +31 -0
- package/dist/services/ps-ripple-service.d.ts +7 -0
- package/dist/services/ps-ripple-service.js +26 -0
- package/dist/services/ps-screen-service.d.ts +3 -1
- package/dist/services/ps-screen-service.js +8 -2
- package/dist/services/ps-selection-service.d.ts +5 -0
- package/dist/services/ps-selection-service.js +13 -0
- package/dist/services/ps-sheet-service.d.ts +6 -0
- package/dist/services/ps-sheet-service.js +14 -0
- package/dist/services/ps-stack-options-service.d.ts +5 -0
- package/dist/services/ps-stack-options-service.js +18 -0
- package/dist/services/ps-state-service.d.ts +7 -0
- package/dist/services/ps-state-service.js +26 -0
- package/dist/services/ps-switcher-service.d.ts +6 -0
- package/dist/services/ps-switcher-service.js +15 -0
- package/dist/services/ps-tab-bar-style-service.d.ts +5 -0
- package/dist/services/ps-tab-bar-style-service.js +30 -0
- package/dist/services/ps-text-service.js +4 -4
- package/dist/services/ps-waterfall-service.d.ts +10 -0
- package/dist/services/ps-waterfall-service.js +38 -0
- package/jest-setup.js +154 -0
- package/package.json +47 -2
|
@@ -3,17 +3,17 @@ import { PsIconKey } from '@pallasoft/ps-icons';
|
|
|
3
3
|
import { Pressable } from 'react-native';
|
|
4
4
|
import { PsLayoutConfig } from '../../constants/ps-layout-config';
|
|
5
5
|
import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config';
|
|
6
|
+
import { PsRippleKind } from '../../constants/ps-ripple-kind';
|
|
6
7
|
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
7
|
-
import {
|
|
8
|
+
import { PsRippleService } from '../../services/ps-ripple-service';
|
|
9
|
+
import { PsStateService } from '../../services/ps-state-service';
|
|
8
10
|
import { PsIcon } from '../ps-icon/ps-icon';
|
|
9
11
|
import { PsText } from '../ps-text/ps-text';
|
|
10
12
|
export const PsNativeMenuRow = ({ item, onSelect }) => {
|
|
11
13
|
const theme = usePsMobileTheme();
|
|
12
|
-
return (_jsxs(Pressable, { accessibilityRole: 'menuitem', accessibilityState: { selected: item.isSelected }, onPress: () => onSelect(item.value), style: ({ pressed }) => ({
|
|
14
|
+
return (_jsxs(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Surface), accessibilityRole: 'menuitem', accessibilityState: { selected: item.isSelected }, onPress: () => onSelect(item.value), style: ({ pressed }) => ({
|
|
13
15
|
alignItems: 'center',
|
|
14
|
-
backgroundColor: pressed
|
|
15
|
-
? PsMobileColorService.withAlpha(theme.ink, PsMobileControlConfig.pressedAlpha)
|
|
16
|
-
: theme.surface,
|
|
16
|
+
backgroundColor: pressed ? PsStateService.pressedFill(theme, theme.surface) : theme.surface,
|
|
17
17
|
flexDirection: 'row',
|
|
18
18
|
gap: PsMobileControlConfig.rowSpacing,
|
|
19
19
|
minHeight: PsLayoutConfig.rowMinHeight,
|
|
@@ -1,29 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { DropdownMenu, DropdownMenuItem, RNHostView, Text } from '@expo/ui/jetpack-compose';
|
|
4
|
-
import { fillMaxWidth } from '@expo/ui/jetpack-compose/modifiers';
|
|
5
|
-
import { PsNativeMenuConfig } from '../../constants/ps-native-menu-config';
|
|
2
|
+
import { View } from 'react-native';
|
|
6
3
|
import { usePsHaptics } from '../../hooks/use-ps-haptics';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { usePsMenuAnchor } from '../../hooks/use-ps-menu-anchor';
|
|
5
|
+
import { PsMenuPopup } from '../ps-menu-popup/ps-menu-popup';
|
|
6
|
+
import { PsMenuPopupRow } from '../ps-menu-popup/ps-menu-popup-row';
|
|
9
7
|
export const PsNativeMenu = ({ children, isDisabled = false, isFullWidth = false, items, onSelect, }) => {
|
|
10
8
|
const haptic = usePsHaptics();
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
isOpen,
|
|
24
|
-
open: () => {
|
|
25
|
-
if (!isDisabled)
|
|
26
|
-
setIsOpen(true);
|
|
27
|
-
},
|
|
28
|
-
}) }) })] }) }));
|
|
9
|
+
const menu = usePsMenuAnchor();
|
|
10
|
+
return (_jsxs(View, { collapsable: false, ref: menu.ref, children: [children({
|
|
11
|
+
isOpen: menu.anchor !== undefined,
|
|
12
|
+
open: () => {
|
|
13
|
+
if (!isDisabled)
|
|
14
|
+
menu.open();
|
|
15
|
+
},
|
|
16
|
+
}), menu.anchor === undefined ? null : (_jsx(PsMenuPopup, { anchor: menu.anchor, isFullWidth: isFullWidth, onClose: menu.close, children: items.map((item) => (_jsx(PsMenuPopupRow, { isChecked: item.isSelected, label: item.label, onPress: () => {
|
|
17
|
+
menu.close();
|
|
18
|
+
haptic('selection');
|
|
19
|
+
onSelect(item.value);
|
|
20
|
+
} }, item.value))) }))] }));
|
|
29
21
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface PsOptionPickerOption {
|
|
2
|
+
label: string;
|
|
3
|
+
subtitle?: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PsOptionPickerProps {
|
|
7
|
+
emptyLabel: string;
|
|
8
|
+
limit?: number;
|
|
9
|
+
moreLabel: string;
|
|
10
|
+
onSearchChange?: (search: string) => void;
|
|
11
|
+
onSelect: (value: string) => void;
|
|
12
|
+
options: PsOptionPickerOption[];
|
|
13
|
+
searchClearLabel: string;
|
|
14
|
+
searchPlaceholder: string;
|
|
15
|
+
selectedValue: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { PsOptionPickerProps } from './ps-option-picker-props';
|
|
2
|
+
export declare const PsOptionPicker: ({ emptyLabel, limit, moreLabel, onSearchChange, onSelect, options, searchClearLabel, searchPlaceholder, selectedValue, }: PsOptionPickerProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { PsIconKey } from '@pallasoft/ps-icons';
|
|
4
|
+
import { Pressable, View } from 'react-native';
|
|
5
|
+
import { PsOptionPickerConfig } from '../../constants/ps-option-picker-config';
|
|
6
|
+
import { PsRippleKind } from '../../constants/ps-ripple-kind';
|
|
7
|
+
import { usePsHaptics } from '../../hooks/use-ps-haptics';
|
|
8
|
+
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
9
|
+
import { PsOptionPickerService } from '../../services/ps-option-picker-service';
|
|
10
|
+
import { PsRippleService } from '../../services/ps-ripple-service';
|
|
11
|
+
import { PsCard } from '../ps-card/ps-card';
|
|
12
|
+
import { PsIcon } from '../ps-icon/ps-icon';
|
|
13
|
+
import { PsSearchField } from '../ps-search-field/ps-search-field';
|
|
14
|
+
import { PsText } from '../ps-text/ps-text';
|
|
15
|
+
export const PsOptionPicker = ({ emptyLabel, limit = PsOptionPickerConfig.defaultLimit, moreLabel, onSearchChange, onSelect, options, searchClearLabel, searchPlaceholder, selectedValue, }) => {
|
|
16
|
+
const theme = usePsMobileTheme();
|
|
17
|
+
const haptic = usePsHaptics();
|
|
18
|
+
const [search, setSearch] = useState('');
|
|
19
|
+
const result = useMemo(() => PsOptionPickerService.visible(options, onSearchChange === undefined ? search : '', limit), [limit, onSearchChange, options, search]);
|
|
20
|
+
return (_jsxs(View, { style: { gap: PsOptionPickerConfig.gap }, children: [_jsx(PsSearchField, { clearLabel: searchClearLabel, onChange: (next) => {
|
|
21
|
+
setSearch(next);
|
|
22
|
+
if (onSearchChange !== undefined)
|
|
23
|
+
onSearchChange(next);
|
|
24
|
+
}, placeholder: searchPlaceholder, value: search }), result.options.length === 0 ? (_jsx(PsText, { tone: 'muted', children: emptyLabel })) : (_jsx(PsCard, { padding: 'none', children: result.options.map((option, index) => (_jsxs(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Surface), accessibilityRole: 'button', accessibilityState: { selected: option.value === selectedValue }, onPress: () => {
|
|
25
|
+
haptic('selection');
|
|
26
|
+
onSelect(option.value);
|
|
27
|
+
}, style: {
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
borderTopColor: theme.line,
|
|
30
|
+
borderTopWidth: index === 0 ? 0 : 1,
|
|
31
|
+
flexDirection: 'row',
|
|
32
|
+
gap: PsOptionPickerConfig.gap,
|
|
33
|
+
padding: PsOptionPickerConfig.rowPadding,
|
|
34
|
+
}, children: [_jsxs(View, { style: { flex: 1, gap: PsOptionPickerConfig.rowGap }, children: [_jsx(PsText, { numberOfLines: 1, weight: 'semibold', children: option.label }), option.subtitle === undefined ? null : (_jsx(PsText, { numberOfLines: 1, tone: 'muted', variant: 'caption', children: option.subtitle }))] }), option.value === selectedValue ? (_jsx(PsIcon, { color: theme.primary, iconKey: PsIconKey.Check })) : null] }, option.value))) })), result.hasMore ? (_jsx(PsText, { tone: 'muted', variant: 'caption', children: moreLabel })) : null] }));
|
|
35
|
+
};
|
|
@@ -4,10 +4,12 @@ import { Pressable, View } from 'react-native';
|
|
|
4
4
|
import { PsLayoutConfig } from '../../constants/ps-layout-config';
|
|
5
5
|
import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config';
|
|
6
6
|
import { PsPageHeaderConfig } from '../../constants/ps-page-header-config';
|
|
7
|
+
import { PsRippleKind } from '../../constants/ps-ripple-kind';
|
|
7
8
|
import { PsSkeletonShape } from '../../constants/ps-skeleton-shape';
|
|
8
9
|
import { PsPageHeaderContext } from '../../contexts/ps-page-header-context';
|
|
9
10
|
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
10
11
|
import { PsPageHeaderService } from '../../services/ps-page-header-service';
|
|
12
|
+
import { PsRippleService } from '../../services/ps-ripple-service';
|
|
11
13
|
import { PsIcon } from '../ps-icon/ps-icon';
|
|
12
14
|
import { PsSkeleton } from '../ps-skeleton/ps-skeleton';
|
|
13
15
|
import { PsText } from '../ps-text/ps-text';
|
|
@@ -23,7 +25,7 @@ export const PsPageHeader = ({ actions, isLoading = false, leading, onTitlePress
|
|
|
23
25
|
gap: PsLayoutConfig.headerGap,
|
|
24
26
|
minWidth: 0,
|
|
25
27
|
paddingTop: layout.titleOffset,
|
|
26
|
-
}, children: isLoading ? (_jsxs(_Fragment, { children: [_jsx(PsSkeleton, { height: PsPageHeaderConfig.skeletonTitleHeight, shape: PsSkeletonShape.Line, width: PsPageHeaderConfig.skeletonTitleWidth }), _jsx(PsSkeleton, { shape: PsSkeletonShape.Line, width: PsPageHeaderConfig.skeletonSubtitleWidth })] })) : (_jsxs(_Fragment, { children: [onTitlePress === undefined ? (_jsx(PsText, { accessibilityRole: 'header', numberOfLines: 1, variant: 'title', children: title })) : (_jsxs(Pressable, { accessibilityLabel: title, accessibilityRole: 'button', onPress: onTitlePress, style: {
|
|
28
|
+
}, children: isLoading ? (_jsxs(_Fragment, { children: [_jsx(PsSkeleton, { height: PsPageHeaderConfig.skeletonTitleHeight, shape: PsSkeletonShape.Line, width: PsPageHeaderConfig.skeletonTitleWidth }), _jsx(PsSkeleton, { shape: PsSkeletonShape.Line, width: PsPageHeaderConfig.skeletonSubtitleWidth })] })) : (_jsxs(_Fragment, { children: [onTitlePress === undefined ? (_jsx(PsText, { accessibilityRole: 'header', numberOfLines: 1, variant: 'title', children: title })) : (_jsxs(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Surface), accessibilityLabel: title, accessibilityRole: 'button', onPress: onTitlePress, style: {
|
|
27
29
|
alignItems: 'center',
|
|
28
30
|
flexDirection: 'row',
|
|
29
31
|
gap: PsPageHeaderConfig.actionGap,
|
|
@@ -2,13 +2,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { PallasoftControlMetric } from '@pallasoft/ps-design-system';
|
|
3
3
|
import { Pressable } from 'react-native';
|
|
4
4
|
import { PsMotionConfig } from '../../constants/ps-motion-config';
|
|
5
|
+
import { PsRippleKind } from '../../constants/ps-ripple-kind';
|
|
5
6
|
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
7
|
+
import { PsRippleService } from '../../services/ps-ripple-service';
|
|
6
8
|
import { PsSignInSurfaceService } from '../../services/ps-sign-in-surface-service';
|
|
7
9
|
import { PsPallasoftSignInContent } from './ps-pallasoft-sign-in-content';
|
|
8
10
|
export const PsPallasoftSignInButton = ({ children, isLoading = false, onPress, size = 'default', }) => {
|
|
9
11
|
const theme = usePsMobileTheme();
|
|
10
12
|
const surface = PsSignInSurfaceService.resolve(theme, size);
|
|
11
|
-
return (_jsx(Pressable, { accessibilityRole: 'button', accessibilityState: { busy: isLoading, disabled: isLoading }, disabled: isLoading, onPress: onPress, style: ({ pressed }) => ({
|
|
13
|
+
return (_jsx(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Surface), accessibilityRole: 'button', accessibilityState: { busy: isLoading, disabled: isLoading }, disabled: isLoading, onPress: onPress, style: ({ pressed }) => ({
|
|
12
14
|
alignItems: 'center',
|
|
13
15
|
alignSelf: 'stretch',
|
|
14
16
|
backgroundColor: surface.backgroundColor,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PallasoftZIndex } from '@pallasoft/ps-design-system';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
5
|
+
import { PsPageBackdrop } from '../ps-page-backdrop/ps-page-backdrop';
|
|
6
|
+
export const PsPrivacyCover = ({ children }) => {
|
|
7
|
+
const theme = usePsMobileTheme();
|
|
8
|
+
return (_jsxs(View, { accessibilityViewIsModal: true, style: [
|
|
9
|
+
StyleSheet.absoluteFill,
|
|
10
|
+
{
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
backgroundColor: theme.background,
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
zIndex: PallasoftZIndex.TopLayer,
|
|
15
|
+
},
|
|
16
|
+
], testID: 'ps-privacy-cover', children: [_jsx(PsPageBackdrop, {}), children] }));
|
|
17
|
+
};
|
|
@@ -2,18 +2,23 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Platform, RefreshControl, ScrollView, View } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
import { PsLayoutConfig } from '../../constants/ps-layout-config';
|
|
5
|
+
import { PsSelectionBarConfig } from '../../constants/ps-selection-bar-config';
|
|
5
6
|
import { PsScrollContext } from '../../contexts/ps-scroll-context';
|
|
6
7
|
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
7
8
|
import { usePsRefresh } from '../../hooks/use-ps-refresh';
|
|
8
9
|
import { usePsScrollHost } from '../../hooks/use-ps-scroll-host';
|
|
10
|
+
import { usePsTabBar } from '../../hooks/use-ps-tab-bar';
|
|
11
|
+
import { usePsTopInset } from '../../hooks/use-ps-top-inset';
|
|
9
12
|
import { PsScreenService } from '../../services/ps-screen-service';
|
|
10
13
|
export const PsScreen = ({ children, gap = PsLayoutConfig.listGap, hasGutter = true, header, onRefresh, style, }) => {
|
|
11
14
|
const theme = usePsMobileTheme();
|
|
12
15
|
const insets = useSafeAreaInsets();
|
|
16
|
+
const topInset = usePsTopInset();
|
|
17
|
+
const { hasTabBar, isHidden: isTabBarHidden } = usePsTabBar();
|
|
13
18
|
const { isRefreshing, refresh } = usePsRefresh(onRefresh);
|
|
14
19
|
const host = usePsScrollHost();
|
|
15
|
-
return (_jsxs(View, { style: { flex: 1 }, children: [_jsx(ScrollView, { contentContainerStyle: PsScreenService.content(
|
|
16
|
-
PsScreenService.
|
|
17
|
-
|
|
18
|
-
], testID: 'ps-screen-status-bar-scrim' }))] }));
|
|
20
|
+
return (_jsxs(View, { style: { flex: 1 }, children: [_jsx(ScrollView, { contentContainerStyle: PsScreenService.content({
|
|
21
|
+
bottom: PsScreenService.bottomInset(insets.bottom, hasTabBar, isTabBarHidden),
|
|
22
|
+
top: topInset,
|
|
23
|
+
}, Platform.OS === 'ios', hasGutter, gap, isTabBarHidden ? PsSelectionBarConfig.height : 0), contentInsetAdjustmentBehavior: 'automatic', keyboardDismissMode: 'interactive', onContentSizeChange: host.onContentSizeChange, onLayout: host.onLayout, onScroll: host.onScroll, keyboardShouldPersistTaps: 'handled', refreshControl: onRefresh === undefined ? undefined : (_jsx(RefreshControl, { colors: [theme.primaryText], progressBackgroundColor: theme.surface, onRefresh: () => void refresh(), refreshing: isRefreshing, tintColor: theme.primary })), ref: host.scrollRef, scrollEnabled: !host.isLocked, scrollEventThrottle: PsLayoutConfig.scrollEventThrottle, showsVerticalScrollIndicator: false, style: [{ backgroundColor: theme.background, flex: 1 }, style], testID: 'ps-screen', children: _jsxs(PsScrollContext, { value: host.context, children: [header, children] }) }), header === undefined ? null : (_jsx(View, { pointerEvents: 'none', style: [PsScreenService.statusBarScrim(topInset), { backgroundColor: theme.background }], testID: 'ps-screen-status-bar-scrim' }))] }));
|
|
19
24
|
};
|
|
@@ -3,10 +3,12 @@ import { PsIconKey } from '@pallasoft/ps-icons';
|
|
|
3
3
|
import { Pressable, TextInput, View } from 'react-native';
|
|
4
4
|
import { PsLayoutConfig } from '../../constants/ps-layout-config';
|
|
5
5
|
import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config';
|
|
6
|
+
import { PsRippleKind } from '../../constants/ps-ripple-kind';
|
|
6
7
|
import { PsSkeletonShape } from '../../constants/ps-skeleton-shape';
|
|
7
8
|
import { usePsFocus } from '../../hooks/use-ps-focus';
|
|
8
9
|
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
9
10
|
import { PsControlStyleService } from '../../services/ps-control-style-service';
|
|
11
|
+
import { PsRippleService } from '../../services/ps-ripple-service';
|
|
10
12
|
import { PsIcon } from '../ps-icon/ps-icon';
|
|
11
13
|
import { PsSkeleton } from '../ps-skeleton/ps-skeleton';
|
|
12
14
|
export const PsSearchField = ({ clearLabel, isLoading = false, onChange, placeholder, value, }) => {
|
|
@@ -21,5 +23,5 @@ export const PsSearchField = ({ clearLabel, isLoading = false, onChange, placeho
|
|
|
21
23
|
isFocused: focus.isFocused,
|
|
22
24
|
}),
|
|
23
25
|
{ gap: PsMobileControlConfig.buttonIconSpacing },
|
|
24
|
-
], children: [_jsx(PsIcon, { color: theme.muted, iconKey: PsIconKey.Search, size: PsMobileControlConfig.iconSizeInline }), _jsx(TextInput, { accessibilityLabel: placeholder, autoCorrect: false, onBlur: focus.onBlur, onChangeText: onChange, onFocus: focus.onFocus, placeholder: placeholder, placeholderTextColor: theme.muted, returnKeyType: 'search', selectionColor: theme.primary, style: PsControlStyleService.input(theme), value: value }), value === '' ? null : (_jsx(Pressable, { accessibilityLabel: clearLabel, accessibilityRole: 'button', hitSlop: PsLayoutConfig.hitSlop, onPress: () => onChange(''), children: _jsx(PsIcon, { color: theme.muted, iconKey: PsIconKey.Close, size: PsMobileControlConfig.iconSizeInline }) }))] }));
|
|
26
|
+
], children: [_jsx(PsIcon, { color: theme.muted, iconKey: PsIconKey.Search, size: PsMobileControlConfig.iconSizeInline }), _jsx(TextInput, { accessibilityLabel: placeholder, autoCorrect: false, onBlur: focus.onBlur, onChangeText: onChange, onFocus: focus.onFocus, placeholder: placeholder, placeholderTextColor: theme.muted, returnKeyType: 'search', selectionColor: theme.primary, style: PsControlStyleService.input(theme), value: value }), value === '' ? null : (_jsx(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Borderless), accessibilityLabel: clearLabel, accessibilityRole: 'button', hitSlop: PsLayoutConfig.hitSlop, onPress: () => onChange(''), children: _jsx(PsIcon, { color: theme.muted, iconKey: PsIconKey.Close, size: PsMobileControlConfig.iconSizeInline }) }))] }));
|
|
25
27
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { usePsHaptics } from '../../hooks/use-ps-haptics';
|
|
3
|
+
import { PsFieldFrame } from '../ps-field-frame/ps-field-frame';
|
|
4
|
+
import { PsFieldSkeleton } from '../ps-field-skeleton/ps-field-skeleton';
|
|
5
|
+
import { PsSelectControl } from '../ps-select/ps-select-control';
|
|
6
|
+
import { PsSelectTrigger } from '../ps-select/ps-select-trigger';
|
|
7
|
+
export const PsSearchSelectField = ({ errorText, helperText, isDisabled = false, isLoading = false, label, onPress, placeholder, selectedLabel, }) => {
|
|
8
|
+
const haptic = usePsHaptics();
|
|
9
|
+
if (isLoading)
|
|
10
|
+
return _jsx(PsFieldSkeleton, {});
|
|
11
|
+
return (_jsx(PsFieldFrame, { errorText: errorText, helperText: helperText, label: label, children: _jsx(PsSelectTrigger, { isDisabled: isDisabled, label: label, onPress: () => {
|
|
12
|
+
haptic('selection');
|
|
13
|
+
onPress();
|
|
14
|
+
}, children: _jsx(PsSelectControl, { errorText: errorText, isDisabled: isDisabled, isFocused: false, placeholder: placeholder, selectedLabel: selectedLabel, size: 'default' }) }) }));
|
|
15
|
+
};
|
|
@@ -3,23 +3,18 @@ import { SegmentedButton, SingleChoiceSegmentedButtonRow, Text } from '@expo/ui/
|
|
|
3
3
|
import { fillMaxWidth } from '@expo/ui/jetpack-compose/modifiers';
|
|
4
4
|
import { PsSkeletonShape } from '../../constants/ps-skeleton-shape';
|
|
5
5
|
import { usePsHaptics } from '../../hooks/use-ps-haptics';
|
|
6
|
-
import {
|
|
6
|
+
import { usePsMaterialScheme } from '../../hooks/use-ps-material-scheme';
|
|
7
|
+
import { PsMaterialControlService } from '../../services/ps-material-control-service';
|
|
7
8
|
import { PsHostScope } from '../ps-host-scope/ps-host-scope';
|
|
8
9
|
import { PsSkeleton } from '../ps-skeleton/ps-skeleton';
|
|
9
10
|
export const PsSegmentedControl = ({ getItemKey, getItemLabel, isLoading = false, items, onSelectionChange, selectedKey, }) => {
|
|
10
11
|
const haptic = usePsHaptics();
|
|
11
|
-
const
|
|
12
|
+
const colors = PsMaterialControlService.segmentedColors(usePsMaterialScheme());
|
|
12
13
|
if (isLoading)
|
|
13
14
|
return _jsx(PsSkeleton, { shape: PsSkeletonShape.Control });
|
|
14
15
|
return (_jsx(PsHostScope, { matchContents: { vertical: true }, children: _jsx(SingleChoiceSegmentedButtonRow, { modifiers: [fillMaxWidth()], children: items.map((item) => {
|
|
15
16
|
const key = getItemKey(item);
|
|
16
|
-
return (_jsx(SegmentedButton, { colors: {
|
|
17
|
-
activeBorderColor: theme.primary,
|
|
18
|
-
activeContainerColor: theme.primarySoft,
|
|
19
|
-
activeContentColor: theme.ink,
|
|
20
|
-
inactiveBorderColor: theme.line,
|
|
21
|
-
inactiveContentColor: theme.muted,
|
|
22
|
-
}, onClick: () => {
|
|
17
|
+
return (_jsx(SegmentedButton, { colors: colors, onClick: () => {
|
|
23
18
|
haptic('selection');
|
|
24
19
|
onSelectionChange(key);
|
|
25
20
|
}, selected: key === selectedKey, children: _jsx(SegmentedButton.Label, { children: _jsx(Text, { children: getItemLabel(item) }) }) }, key));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PsMenuItem } from '../../interfaces/ps-menu-item';
|
|
2
|
+
export interface PsSelectionBarProps {
|
|
3
|
+
actions: PsMenuItem[];
|
|
4
|
+
isAllSelected: boolean;
|
|
5
|
+
deselectAllLabel: string;
|
|
6
|
+
onSelectAll: () => void;
|
|
7
|
+
selectAllLabel: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const PsSelectionBar: ({ actions, deselectAllLabel, isAllSelected, onSelectAll, selectAllLabel, }: PsSelectionBarProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Pressable, View } from 'react-native';
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
import { PsSelectionBarConfig } from '../../constants/ps-selection-bar-config';
|
|
5
|
+
import { usePsHaptics } from '../../hooks/use-ps-haptics';
|
|
6
|
+
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
7
|
+
import { PsText } from '../ps-text/ps-text';
|
|
8
|
+
export const PsSelectionBar = ({ actions, deselectAllLabel, isAllSelected, onSelectAll, selectAllLabel, }) => {
|
|
9
|
+
const theme = usePsMobileTheme();
|
|
10
|
+
const haptic = usePsHaptics();
|
|
11
|
+
const insets = useSafeAreaInsets();
|
|
12
|
+
return (_jsx(View, { style: {
|
|
13
|
+
backgroundColor: theme.surface,
|
|
14
|
+
borderTopColor: theme.line,
|
|
15
|
+
borderTopWidth: 1,
|
|
16
|
+
bottom: 0,
|
|
17
|
+
flexDirection: 'row',
|
|
18
|
+
left: 0,
|
|
19
|
+
paddingBottom: insets.bottom,
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
right: 0,
|
|
22
|
+
}, testID: 'ps-selection-bar', children: _jsxs(View, { style: {
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
flex: 1,
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
height: PsSelectionBarConfig.height,
|
|
27
|
+
justifyContent: 'space-between',
|
|
28
|
+
paddingHorizontal: PsSelectionBarConfig.paddingHorizontal,
|
|
29
|
+
}, children: [_jsx(Pressable, { accessibilityRole: 'button', onPress: () => {
|
|
30
|
+
haptic('selection');
|
|
31
|
+
onSelectAll();
|
|
32
|
+
}, style: ({ pressed }) => ({
|
|
33
|
+
backgroundColor: pressed ? theme.primarySoft : 'transparent',
|
|
34
|
+
borderRadius: PsSelectionBarConfig.paddingHorizontal,
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
minHeight: PsSelectionBarConfig.height,
|
|
37
|
+
paddingHorizontal: PsSelectionBarConfig.paddingHorizontal,
|
|
38
|
+
}), children: _jsx(PsText, { tone: 'primary', weight: 'semibold', children: isAllSelected ? deselectAllLabel : selectAllLabel }) }), actions.map((item) => (_jsx(Pressable, { accessibilityRole: 'button', accessibilityState: { disabled: item.isDisabled === true }, disabled: item.isDisabled === true, onPress: () => {
|
|
39
|
+
haptic('medium');
|
|
40
|
+
item.onSelect();
|
|
41
|
+
}, style: ({ pressed }) => ({
|
|
42
|
+
backgroundColor: pressed ? theme.primarySoft : 'transparent',
|
|
43
|
+
borderRadius: PsSelectionBarConfig.paddingHorizontal,
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
minHeight: PsSelectionBarConfig.height,
|
|
46
|
+
opacity: item.isDisabled === true ? 0.5 : 1,
|
|
47
|
+
paddingHorizontal: PsSelectionBarConfig.paddingHorizontal,
|
|
48
|
+
}), children: _jsx(PsText, { tone: item.isDanger === true ? 'danger' : 'primary', weight: 'semibold', children: item.label }) }, item.id)))] }) }));
|
|
49
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PsMenuItem } from '../../interfaces/ps-menu-item';
|
|
2
|
+
export interface PsSelectionModeProps {
|
|
3
|
+
actions: PsMenuItem[];
|
|
4
|
+
deselectAllLabel: string;
|
|
5
|
+
doneLabel: string;
|
|
6
|
+
isAllSelected: boolean;
|
|
7
|
+
isSelecting: boolean;
|
|
8
|
+
onDone: () => void;
|
|
9
|
+
onSelectAll: () => void;
|
|
10
|
+
selectAllLabel: string;
|
|
11
|
+
selectedTitle: string;
|
|
12
|
+
title: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { PsSelectionModeProps } from './ps-selection-mode-props';
|
|
2
|
+
export declare const PsSelectionMode: ({ actions, deselectAllLabel, doneLabel, isAllSelected, isSelecting, onDone, onSelectAll, selectAllLabel, selectedTitle, title, }: PsSelectionModeProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { Stack } from 'expo-router';
|
|
4
|
+
import { PsMobileIconKey } from '../../constants/ps-mobile-icon-key';
|
|
5
|
+
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
6
|
+
import { usePsTabBar } from '../../hooks/use-ps-tab-bar';
|
|
7
|
+
import { PsIconButton } from '../ps-icon-button/ps-icon-button';
|
|
8
|
+
import { PsSelectionBar } from './ps-selection-bar';
|
|
9
|
+
export const PsSelectionMode = ({ actions, deselectAllLabel, doneLabel, isAllSelected, isSelecting, onDone, onSelectAll, selectAllLabel, selectedTitle, title, }) => {
|
|
10
|
+
const theme = usePsMobileTheme();
|
|
11
|
+
const { setIsHidden } = usePsTabBar();
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setIsHidden(isSelecting);
|
|
14
|
+
return () => setIsHidden(false);
|
|
15
|
+
}, [isSelecting, setIsHidden]);
|
|
16
|
+
if (!isSelecting)
|
|
17
|
+
return _jsx(Stack.Screen, { options: { headerBackVisible: true, headerLeft: undefined, title } });
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx(Stack.Screen, { options: {
|
|
19
|
+
headerBackVisible: false,
|
|
20
|
+
headerLeft: () => (_jsx(PsIconButton, { backgroundColor: 'transparent', color: theme.ink, iconKey: PsMobileIconKey.Close, label: doneLabel, onPress: onDone, variant: 'header' })),
|
|
21
|
+
title: selectedTitle,
|
|
22
|
+
} }), _jsx(PsSelectionBar, { actions: actions, deselectAllLabel: deselectAllLabel, isAllSelected: isAllSelected, onSelectAll: onSelectAll, selectAllLabel: selectAllLabel })] }));
|
|
23
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { PsSelectionModeProps } from './ps-selection-mode-props';
|
|
2
|
+
export declare const PsSelectionMode: ({ actions, deselectAllLabel, doneLabel, isAllSelected, isSelecting, onDone, onSelectAll, selectAllLabel, selectedTitle, title, }: PsSelectionModeProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, useEffect } from 'react';
|
|
3
|
+
import { Stack } from 'expo-router';
|
|
4
|
+
import { usePsHaptics } from '../../hooks/use-ps-haptics';
|
|
5
|
+
import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
|
|
6
|
+
import { usePsTabBar } from '../../hooks/use-ps-tab-bar';
|
|
7
|
+
import { PsActionMenuService } from '../../services/ps-action-menu-service';
|
|
8
|
+
export const PsSelectionMode = ({ actions, deselectAllLabel, doneLabel, isAllSelected, isSelecting, onDone, onSelectAll, selectAllLabel, selectedTitle, title, }) => {
|
|
9
|
+
const theme = usePsMobileTheme();
|
|
10
|
+
const haptic = usePsHaptics();
|
|
11
|
+
const { setIsHidden } = usePsTabBar();
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setIsHidden(isSelecting);
|
|
14
|
+
return () => setIsHidden(false);
|
|
15
|
+
}, [isSelecting, setIsHidden]);
|
|
16
|
+
if (!isSelecting)
|
|
17
|
+
return _jsx(Stack.Screen, { options: { headerBackVisible: true, title } });
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx(Stack.Screen, { options: { headerBackVisible: false, title: selectedTitle } }), _jsx(Stack.Toolbar, { placement: 'left', children: _jsx(Stack.Toolbar.Button, { onPress: () => {
|
|
19
|
+
haptic('selection');
|
|
20
|
+
onSelectAll();
|
|
21
|
+
}, tintColor: theme.primaryText, children: isAllSelected ? deselectAllLabel : selectAllLabel }) }), _jsx(Stack.Toolbar, { placement: 'right', children: _jsx(Stack.Toolbar.Button, { onPress: () => {
|
|
22
|
+
haptic('light');
|
|
23
|
+
onDone();
|
|
24
|
+
}, tintColor: theme.primaryText, variant: 'done', children: doneLabel }) }), _jsxs(Stack.Toolbar, { placement: 'bottom', children: [_jsx(Stack.Toolbar.Spacer, {}), actions.map((item) => (_jsxs(Fragment, { children: [_jsx(Stack.Toolbar.Button, { disabled: item.isDisabled === true, icon: PsActionMenuService.symbol(item), onPress: () => {
|
|
25
|
+
haptic('medium');
|
|
26
|
+
item.onSelect();
|
|
27
|
+
}, tintColor: item.isDanger === true ? theme.danger : theme.primaryText, children: item.label }), _jsx(Stack.Toolbar.Spacer, {})] }, item.id)))] })] }));
|
|
28
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { PsSheetAction } from '../../interfaces/ps-sheet-action';
|
|
3
|
+
import type { PsSheetLeadingKind } from '../../interfaces/ps-sheet-leading-kind';
|
|
3
4
|
export interface PsSheetProps {
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
closeLabel?: string;
|
|
@@ -8,8 +9,10 @@ export interface PsSheetProps {
|
|
|
8
9
|
isDismissBlocked?: boolean;
|
|
9
10
|
isOpen: boolean;
|
|
10
11
|
isScrollable?: boolean;
|
|
12
|
+
leadingKind?: PsSheetLeadingKind;
|
|
11
13
|
leadingLabel?: string;
|
|
12
14
|
onClose: () => void;
|
|
15
|
+
onLeadingPress?: () => void;
|
|
13
16
|
title: string;
|
|
14
|
-
trailingAction?: PsSheetAction;
|
|
17
|
+
trailingAction?: PsSheetAction | null;
|
|
15
18
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PsSheetProps } from './ps-sheet-props';
|
|
2
|
-
export declare const PsSheet: ({ children, closeLabel, eyebrow, footer, isDismissBlocked, isOpen, isScrollable, leadingLabel, onClose, title, trailingAction, }: PsSheetProps) => import("react").JSX.Element;
|
|
2
|
+
export declare const PsSheet: ({ children, closeLabel, eyebrow, footer, isDismissBlocked, isOpen, isScrollable, leadingKind, leadingLabel, onClose, onLeadingPress, title, trailingAction, }: PsSheetProps) => import("react").JSX.Element;
|
|
@@ -2,13 +2,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { PsSheetService } from '../../services/ps-sheet-service';
|
|
3
3
|
import { PsSheetContent } from '../ps-sheet-content/ps-sheet-content';
|
|
4
4
|
import { PsSheetPresenter } from '../ps-sheet-presenter/ps-sheet-presenter';
|
|
5
|
-
export const PsSheet = ({ children, closeLabel, eyebrow, footer, isDismissBlocked = false, isOpen, isScrollable = true, leadingLabel, onClose, title, trailingAction, }) => (_jsx(PsSheetPresenter, { isDismissBlocked: isDismissBlocked, isOpen: isOpen, onClose: onClose, children: _jsx(PsSheetContent, { footer: footer, header: {
|
|
5
|
+
export const PsSheet = ({ children, closeLabel, eyebrow, footer, isDismissBlocked = false, isOpen, isScrollable = true, leadingKind = 'close', leadingLabel, onClose, onLeadingPress, title, trailingAction, }) => (_jsx(PsSheetPresenter, { isDismissBlocked: isDismissBlocked, isOpen: isOpen, onClose: onClose, children: _jsx(PsSheetContent, { footer: footer, header: {
|
|
6
6
|
eyebrow,
|
|
7
7
|
isLeadingDisabled: isDismissBlocked,
|
|
8
|
+
leadingKind,
|
|
8
9
|
leadingLabel,
|
|
9
|
-
onLeadingPress: onClose,
|
|
10
|
+
onLeadingPress: onLeadingPress === undefined ? onClose : onLeadingPress,
|
|
10
11
|
title,
|
|
11
|
-
trailing: trailingAction
|
|
12
|
-
? PsSheetService.closeAction(closeLabel, onClose)
|
|
13
|
-
: trailingAction,
|
|
12
|
+
trailing: PsSheetService.trailing(trailingAction, closeLabel, onClose),
|
|
14
13
|
}, isScrollable: isScrollable, children: children }) }));
|
|
@@ -28,7 +28,7 @@ export const PsSheetContent = ({ children, footer, header, isScrollable }) => {
|
|
|
28
28
|
}, testID: 'ps-sheet-footer', children: footer }))] }));
|
|
29
29
|
const contentStyle = {
|
|
30
30
|
gap: PsLayoutConfig.gutter,
|
|
31
|
-
paddingBottom: PsSheetService.bottomPadding(Platform.OS
|
|
31
|
+
paddingBottom: PsSheetService.bottomPadding(PsSheetService.handlesInset(Platform.OS), insets.bottom),
|
|
32
32
|
paddingHorizontal: PsLayoutConfig.sheetGutter,
|
|
33
33
|
paddingTop: PsLayoutConfig.sheetHeaderPaddingVertical,
|
|
34
34
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { PsSheetAction } from '../../interfaces/ps-sheet-action';
|
|
2
|
+
import type { PsSheetLeadingKind } from '../../interfaces/ps-sheet-leading-kind';
|
|
2
3
|
export interface PsSheetHeaderProps {
|
|
3
4
|
eyebrow?: string;
|
|
4
5
|
isLeadingDisabled?: boolean;
|
|
6
|
+
leadingKind?: PsSheetLeadingKind;
|
|
5
7
|
leadingLabel?: string;
|
|
6
8
|
onLeadingPress?: () => void;
|
|
7
9
|
title: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PsSheetHeaderProps } from './ps-sheet-header-props';
|
|
2
|
-
export declare const PsSheetHeader: ({ eyebrow, isLeadingDisabled, leadingLabel, onLeadingPress, title, trailing, }: PsSheetHeaderProps) => import("react").JSX.Element;
|
|
2
|
+
export declare const PsSheetHeader: ({ eyebrow, isLeadingDisabled, leadingKind, leadingLabel, onLeadingPress, title, trailing, }: PsSheetHeaderProps) => import("react").JSX.Element;
|
|
@@ -8,7 +8,7 @@ import { PsSheetService } from '../../services/ps-sheet-service';
|
|
|
8
8
|
import { PsIconButton } from '../ps-icon-button/ps-icon-button';
|
|
9
9
|
import { PsSpinner } from '../ps-spinner/ps-spinner';
|
|
10
10
|
import { PsText } from '../ps-text/ps-text';
|
|
11
|
-
export const PsSheetHeader = ({ eyebrow, isLeadingDisabled = false, leadingLabel, onLeadingPress, title, trailing, }) => {
|
|
11
|
+
export const PsSheetHeader = ({ eyebrow, isLeadingDisabled = false, leadingKind = 'close', leadingLabel, onLeadingPress, title, trailing, }) => {
|
|
12
12
|
const theme = usePsMobileTheme();
|
|
13
13
|
const trailingColor = trailing?.tone === 'danger' ? theme.danger : theme.primary;
|
|
14
14
|
const trailingContrast = trailing?.tone === 'danger' ? theme.white : theme.primaryContrast;
|
|
@@ -21,7 +21,7 @@ export const PsSheetHeader = ({ eyebrow, isLeadingDisabled = false, leadingLabel
|
|
|
21
21
|
paddingBottom: PsSheetConfig.headerPaddingBottom,
|
|
22
22
|
paddingHorizontal: PsSheetConfig.headerPaddingHorizontal,
|
|
23
23
|
paddingTop: PsSheetConfig.headerPaddingTop,
|
|
24
|
-
}, testID: 'ps-sheet-header', children: [_jsx(View, { style: { alignItems: 'flex-start', minWidth: PsSheetConfig.actionMinWidth }, children: leadingLabel === undefined ? null : (_jsx(PsIconButton, { iconKey: PsIconKey.Close, isDisabled: isLeadingDisabled, label: leadingLabel, onPress: onLeadingPress, testID: 'ps-sheet-leading', variant: 'header' })) }), _jsxs(View, { style: { alignItems: 'center', flex: 1 }, children: [_jsx(PsText, { accessibilityRole: 'header', align: 'center', numberOfLines: 2, weight: 'bold', children: title }), eyebrow === undefined ? null : (_jsx(PsText, { align: 'center', numberOfLines: 1, tone: 'muted', variant: 'small', children: eyebrow }))] }), _jsx(View, { style: { alignItems: 'flex-end', minWidth: PsSheetConfig.actionMinWidth }, children: trailing === undefined ? null : trailing.isSubmitting === true ? (_jsx(View, { accessibilityLabel: trailing.label, accessibilityState: { busy: true }, style: {
|
|
24
|
+
}, testID: 'ps-sheet-header', children: [_jsx(View, { style: { alignItems: 'flex-start', minWidth: PsSheetConfig.actionMinWidth }, children: leadingLabel === undefined ? null : (_jsx(View, { style: PsSheetService.leadingIconStyle(leadingKind), children: _jsx(PsIconButton, { iconKey: leadingKind === 'back' ? PsIconKey.ChevronRight : PsIconKey.Close, isDisabled: isLeadingDisabled, label: leadingLabel, onPress: onLeadingPress, testID: 'ps-sheet-leading', variant: 'header' }) })) }), _jsxs(View, { style: { alignItems: 'center', flex: 1 }, children: [_jsx(PsText, { accessibilityRole: 'header', align: 'center', numberOfLines: 2, weight: 'bold', children: title }), eyebrow === undefined ? null : (_jsx(PsText, { align: 'center', numberOfLines: 1, tone: 'muted', variant: 'small', children: eyebrow }))] }), _jsx(View, { style: { alignItems: 'flex-end', minWidth: PsSheetConfig.actionMinWidth }, children: trailing === undefined ? null : trailing.isSubmitting === true ? (_jsx(View, { accessibilityLabel: trailing.label, accessibilityState: { busy: true }, style: {
|
|
25
25
|
alignItems: 'center',
|
|
26
26
|
backgroundColor: trailingColor,
|
|
27
27
|
borderRadius: PsPageHeaderConfig.buttonSize / 2,
|