@pallasoft/ps-mobile-components 1.3.0 → 1.5.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.
Files changed (358) hide show
  1. package/dist/components/ps-action-menu/ps-action-menu-entries.js +1 -0
  2. package/dist/components/ps-action-menu/ps-action-menu.android.js +19 -30
  3. package/dist/components/ps-action-sheet/ps-action-sheet.js +6 -4
  4. package/dist/components/ps-barcode-scanner-sheet/index.d.ts +2 -0
  5. package/dist/components/ps-barcode-scanner-sheet/index.js +2 -0
  6. package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet-props.d.ts +11 -0
  7. package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet-props.js +1 -0
  8. package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet.d.ts +2 -0
  9. package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet.js +82 -0
  10. package/dist/components/ps-button/ps-button.js +4 -2
  11. package/dist/components/ps-cartesian-chart/ps-cartesian-chart.js +25 -19
  12. package/dist/components/ps-checkbox/ps-checkbox.js +5 -2
  13. package/dist/components/ps-chip/ps-chip.js +3 -1
  14. package/dist/components/ps-date-field/ps-date-field.android.js +1 -1
  15. package/dist/components/ps-date-field/ps-date-field.ios.js +1 -1
  16. package/dist/components/ps-document-page/ps-document-page-props.d.ts +3 -0
  17. package/dist/components/ps-document-page/ps-document-page.d.ts +1 -1
  18. package/dist/components/ps-document-page/ps-document-page.js +16 -7
  19. package/dist/components/ps-document-page-strip/index.d.ts +2 -0
  20. package/dist/components/ps-document-page-strip/index.js +2 -0
  21. package/dist/components/ps-document-page-strip/ps-document-page-strip-props.d.ts +6 -0
  22. package/dist/components/ps-document-page-strip/ps-document-page-strip-props.js +1 -0
  23. package/dist/components/ps-document-page-strip/ps-document-page-strip.d.ts +2 -0
  24. package/dist/components/ps-document-page-strip/ps-document-page-strip.js +43 -0
  25. package/dist/components/ps-document-pdf-cover/index.d.ts +2 -0
  26. package/dist/components/ps-document-pdf-cover/index.js +2 -0
  27. package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover-props.d.ts +6 -0
  28. package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover-props.js +1 -0
  29. package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover.d.ts +2 -0
  30. package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover.js +18 -0
  31. package/dist/components/ps-document-preview/ps-document-preview.js +3 -4
  32. package/dist/components/ps-document-preview-face/index.d.ts +2 -0
  33. package/dist/components/ps-document-preview-face/index.js +2 -0
  34. package/dist/components/ps-document-preview-face/ps-document-preview-face-props.d.ts +6 -0
  35. package/dist/components/ps-document-preview-face/ps-document-preview-face-props.js +1 -0
  36. package/dist/components/ps-document-preview-face/ps-document-preview-face.d.ts +2 -0
  37. package/dist/components/ps-document-preview-face/ps-document-preview-face.js +18 -0
  38. package/dist/components/ps-document-text-page/index.d.ts +2 -0
  39. package/dist/components/ps-document-text-page/index.js +2 -0
  40. package/dist/components/ps-document-text-page/ps-document-text-page-props.d.ts +6 -0
  41. package/dist/components/ps-document-text-page/ps-document-text-page-props.js +1 -0
  42. package/dist/components/ps-document-text-page/ps-document-text-page.d.ts +2 -0
  43. package/dist/components/ps-document-text-page/ps-document-text-page.js +18 -0
  44. package/dist/components/ps-document-unsupported/index.d.ts +2 -0
  45. package/dist/components/ps-document-unsupported/index.js +2 -0
  46. package/dist/components/ps-document-unsupported/ps-document-unsupported-props.d.ts +7 -0
  47. package/dist/components/ps-document-unsupported/ps-document-unsupported-props.js +1 -0
  48. package/dist/components/ps-document-unsupported/ps-document-unsupported.d.ts +2 -0
  49. package/dist/components/ps-document-unsupported/ps-document-unsupported.js +10 -0
  50. package/dist/components/ps-document-viewer/ps-document-viewer.js +27 -7
  51. package/dist/components/ps-header-action/index.d.ts +2 -0
  52. package/dist/components/ps-header-action/index.js +2 -0
  53. package/dist/components/ps-header-action/ps-header-action-props.d.ts +6 -0
  54. package/dist/components/ps-header-action/ps-header-action-props.js +1 -0
  55. package/dist/components/ps-header-action/ps-header-action.android.d.ts +2 -0
  56. package/dist/components/ps-header-action/ps-header-action.android.js +9 -0
  57. package/dist/components/ps-header-action/ps-header-action.d.ts +2 -0
  58. package/dist/components/ps-header-action/ps-header-action.js +11 -0
  59. package/dist/components/ps-header-menu/index.d.ts +2 -0
  60. package/dist/components/ps-header-menu/index.js +2 -0
  61. package/dist/components/ps-header-menu/ps-header-menu-props.d.ts +7 -0
  62. package/dist/components/ps-header-menu/ps-header-menu-props.js +1 -0
  63. package/dist/components/ps-header-menu/ps-header-menu.android.d.ts +2 -0
  64. package/dist/components/ps-header-menu/ps-header-menu.android.js +11 -0
  65. package/dist/components/ps-header-menu/ps-header-menu.d.ts +2 -0
  66. package/dist/components/ps-header-menu/ps-header-menu.js +20 -0
  67. package/dist/components/ps-icon-button/ps-icon-button.js +7 -7
  68. package/dist/components/ps-kpi-card/ps-kpi-card.js +1 -2
  69. package/dist/components/ps-list/ps-list-action-row.d.ts +1 -1
  70. package/dist/components/ps-list/ps-list-action-row.js +9 -8
  71. package/dist/components/ps-list/ps-list-context-menu.android.d.ts +2 -0
  72. package/dist/components/ps-list/ps-list-context-menu.android.js +3 -0
  73. package/dist/components/ps-list/ps-list-link-menu.android.d.ts +2 -0
  74. package/dist/components/ps-list/ps-list-link-menu.android.js +7 -0
  75. package/dist/components/ps-list/ps-list-link-row-props.d.ts +1 -0
  76. package/dist/components/ps-list/ps-list-link-row.d.ts +1 -1
  77. package/dist/components/ps-list/ps-list-link-row.js +7 -7
  78. package/dist/components/ps-list/ps-list-props.d.ts +2 -0
  79. package/dist/components/ps-list/ps-list-row-body.d.ts +2 -2
  80. package/dist/components/ps-list/ps-list-row-body.js +7 -4
  81. package/dist/components/ps-list/ps-list-row-menu.d.ts +10 -0
  82. package/dist/components/ps-list/ps-list-row-menu.js +27 -0
  83. package/dist/components/ps-list/ps-list-row.d.ts +1 -1
  84. package/dist/components/ps-list/ps-list-row.js +2 -2
  85. package/dist/components/ps-list/ps-list-select-row.js +2 -1
  86. package/dist/components/ps-menu-popup/index.d.ts +4 -0
  87. package/dist/components/ps-menu-popup/index.js +4 -0
  88. package/dist/components/ps-menu-popup/ps-menu-popup-divider.d.ts +1 -0
  89. package/dist/components/ps-menu-popup/ps-menu-popup-divider.js +7 -0
  90. package/dist/components/ps-menu-popup/ps-menu-popup-header.d.ts +5 -0
  91. package/dist/components/ps-menu-popup/ps-menu-popup-header.js +8 -0
  92. package/dist/components/ps-menu-popup/ps-menu-popup-row.d.ts +12 -0
  93. package/dist/components/ps-menu-popup/ps-menu-popup-row.js +22 -0
  94. package/dist/components/ps-menu-popup/ps-menu-popup.d.ts +9 -0
  95. package/dist/components/ps-menu-popup/ps-menu-popup.js +35 -0
  96. package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider-props.d.ts +1 -0
  97. package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider.d.ts +1 -1
  98. package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider.js +8 -2
  99. package/dist/components/ps-native-menu/ps-native-menu-row.js +5 -5
  100. package/dist/components/ps-native-menu/ps-native-menu.android.js +16 -24
  101. package/dist/components/ps-option-picker/ps-option-picker.js +3 -1
  102. package/dist/components/ps-page-header/ps-page-header.js +3 -1
  103. package/dist/components/ps-pallasoft-sign-in-button/ps-pallasoft-sign-in-button.js +3 -1
  104. package/dist/components/ps-screen/ps-screen.js +9 -4
  105. package/dist/components/ps-search-field/ps-search-field.js +3 -1
  106. package/dist/components/ps-segmented-control/ps-segmented-control.android.js +4 -9
  107. package/dist/components/ps-selection-mode/ps-selection-bar.d.ts +9 -0
  108. package/dist/components/ps-selection-mode/ps-selection-bar.js +49 -0
  109. package/dist/components/ps-selection-mode/ps-selection-mode.android.d.ts +2 -0
  110. package/dist/components/ps-selection-mode/ps-selection-mode.android.js +23 -0
  111. package/dist/components/ps-sheet-content/ps-sheet-content.js +1 -1
  112. package/dist/components/ps-sheet-presenter/ps-sheet-presenter.android.js +4 -4
  113. package/dist/components/ps-sortable-grid/ps-sortable-item.js +2 -0
  114. package/dist/components/ps-spinner/ps-spinner.android.d.ts +2 -0
  115. package/dist/components/ps-spinner/ps-spinner.android.js +13 -0
  116. package/dist/components/ps-switch/ps-switch.android.d.ts +2 -0
  117. package/dist/components/ps-switch/ps-switch.android.js +25 -0
  118. package/dist/components/ps-switcher/index.d.ts +2 -0
  119. package/dist/components/ps-switcher/index.js +2 -0
  120. package/dist/components/ps-switcher/ps-switcher-panel.d.ts +10 -0
  121. package/dist/components/ps-switcher/ps-switcher-panel.js +17 -0
  122. package/dist/components/ps-switcher/ps-switcher-props.d.ts +12 -0
  123. package/dist/components/ps-switcher/ps-switcher-props.js +1 -0
  124. package/dist/components/ps-switcher/ps-switcher-row.d.ts +7 -0
  125. package/dist/components/ps-switcher/ps-switcher-row.js +33 -0
  126. package/dist/components/ps-switcher/ps-switcher-trigger.d.ts +11 -0
  127. package/dist/components/ps-switcher/ps-switcher-trigger.js +35 -0
  128. package/dist/components/ps-switcher/ps-switcher.d.ts +2 -0
  129. package/dist/components/ps-switcher/ps-switcher.js +21 -0
  130. package/dist/components/ps-tab-bar-provider/ps-tab-bar-provider.js +1 -1
  131. package/dist/components/ps-tabs/ps-tabs.js +3 -1
  132. package/dist/components/ps-waterfall-chart/index.d.ts +2 -0
  133. package/dist/components/ps-waterfall-chart/index.js +2 -0
  134. package/dist/components/ps-waterfall-chart/ps-waterfall-chart-props.d.ts +9 -0
  135. package/dist/components/ps-waterfall-chart/ps-waterfall-chart-props.js +1 -0
  136. package/dist/components/ps-waterfall-chart/ps-waterfall-chart.d.ts +2 -0
  137. package/dist/components/ps-waterfall-chart/ps-waterfall-chart.js +37 -0
  138. package/dist/components/ps-widget-list/ps-widget-list.js +1 -1
  139. package/dist/constants/ps-android-state-config.d.ts +12 -0
  140. package/dist/constants/ps-android-state-config.js +12 -0
  141. package/dist/constants/ps-barcode-permission.d.ts +6 -0
  142. package/dist/constants/ps-barcode-permission.js +5 -0
  143. package/dist/constants/ps-barcode-scanner-config.d.ts +18 -0
  144. package/dist/constants/ps-barcode-scanner-config.js +31 -0
  145. package/dist/constants/ps-capture-config.d.ts +12 -0
  146. package/dist/constants/ps-capture-config.js +22 -0
  147. package/dist/constants/ps-capture-source.d.ts +7 -0
  148. package/dist/constants/ps-capture-source.js +6 -0
  149. package/dist/constants/ps-cartesian-series-shape.d.ts +5 -0
  150. package/dist/constants/ps-cartesian-series-shape.js +4 -0
  151. package/dist/constants/ps-chart-brand-config.d.ts +21 -0
  152. package/dist/constants/ps-chart-brand-config.js +10 -0
  153. package/dist/constants/ps-document-config.d.ts +3 -0
  154. package/dist/constants/ps-document-config.js +3 -0
  155. package/dist/constants/ps-document-file-config.d.ts +11 -0
  156. package/dist/constants/ps-document-file-config.js +11 -0
  157. package/dist/constants/ps-document-kind.d.ts +1 -0
  158. package/dist/constants/ps-document-kind.js +1 -0
  159. package/dist/constants/ps-document-load-status.d.ts +7 -0
  160. package/dist/constants/ps-document-load-status.js +6 -0
  161. package/dist/constants/ps-document-pdf-config.d.ts +14 -0
  162. package/dist/constants/ps-document-pdf-config.js +14 -0
  163. package/dist/constants/ps-header-config.d.ts +3 -0
  164. package/dist/constants/ps-header-config.js +3 -0
  165. package/dist/constants/ps-menu-popup-config.d.ts +10 -0
  166. package/dist/constants/ps-menu-popup-config.js +10 -0
  167. package/dist/constants/ps-mobile-icon-key.d.ts +1 -0
  168. package/dist/constants/ps-quick-action-config.d.ts +4 -0
  169. package/dist/constants/ps-quick-action-config.js +4 -0
  170. package/dist/constants/ps-ripple-kind.d.ts +8 -0
  171. package/dist/constants/ps-ripple-kind.js +7 -0
  172. package/dist/constants/ps-selection-bar-config.d.ts +4 -0
  173. package/dist/constants/ps-selection-bar-config.js +4 -0
  174. package/dist/constants/ps-sf-symbol-config.d.ts +1 -0
  175. package/dist/constants/ps-sf-symbol-config.js +1 -0
  176. package/dist/constants/ps-sortable-grid-config.d.ts +2 -1
  177. package/dist/constants/ps-sortable-grid-config.js +2 -1
  178. package/dist/constants/ps-switcher-config.d.ts +12 -0
  179. package/dist/constants/ps-switcher-config.js +12 -0
  180. package/dist/contexts/ps-tab-bar-context.js +1 -0
  181. package/dist/hooks/use-ps-barcode-scanner.d.ts +2 -0
  182. package/dist/hooks/use-ps-barcode-scanner.js +9 -0
  183. package/dist/hooks/use-ps-document-open.d.ts +3 -0
  184. package/dist/hooks/use-ps-document-open.js +14 -0
  185. package/dist/hooks/use-ps-document-pdf-cover.d.ts +3 -0
  186. package/dist/hooks/use-ps-document-pdf-cover.js +33 -0
  187. package/dist/hooks/use-ps-document-pdf-pages.d.ts +3 -0
  188. package/dist/hooks/use-ps-document-pdf-pages.js +31 -0
  189. package/dist/hooks/use-ps-document-text.d.ts +3 -0
  190. package/dist/hooks/use-ps-document-text.js +29 -0
  191. package/dist/hooks/use-ps-file-upload.d.ts +3 -0
  192. package/dist/hooks/use-ps-file-upload.js +32 -0
  193. package/dist/hooks/use-ps-header-right.d.ts +2 -0
  194. package/dist/hooks/use-ps-header-right.js +9 -0
  195. package/dist/hooks/use-ps-material-scheme.d.ts +2 -0
  196. package/dist/hooks/use-ps-material-scheme.js +3 -0
  197. package/dist/hooks/use-ps-menu-anchor.d.ts +10 -0
  198. package/dist/hooks/use-ps-menu-anchor.js +13 -0
  199. package/dist/hooks/use-ps-quick-actions.d.ts +2 -0
  200. package/dist/hooks/use-ps-quick-actions.js +30 -0
  201. package/dist/hooks/use-ps-stack-screen-options.d.ts +2 -0
  202. package/dist/hooks/use-ps-stack-screen-options.js +7 -0
  203. package/dist/hooks/use-ps-top-inset.d.ts +1 -0
  204. package/dist/hooks/use-ps-top-inset.js +10 -0
  205. package/dist/index.d.ts +44 -0
  206. package/dist/index.js +43 -0
  207. package/dist/interfaces/ps-barcode-frame-size.d.ts +4 -0
  208. package/dist/interfaces/ps-barcode-frame-size.js +1 -0
  209. package/dist/interfaces/ps-barcode-last-read.d.ts +4 -0
  210. package/dist/interfaces/ps-barcode-last-read.js +1 -0
  211. package/dist/interfaces/ps-barcode-scan.d.ts +4 -0
  212. package/dist/interfaces/ps-barcode-scan.js +1 -0
  213. package/dist/interfaces/ps-barcode-scanner-labels.d.ts +8 -0
  214. package/dist/interfaces/ps-barcode-scanner-labels.js +1 -0
  215. package/dist/interfaces/ps-barcode-scanner-native.d.ts +23 -0
  216. package/dist/interfaces/ps-barcode-scanner-native.js +1 -0
  217. package/dist/interfaces/ps-capture-labels.d.ts +6 -0
  218. package/dist/interfaces/ps-capture-labels.js +1 -0
  219. package/dist/interfaces/ps-capture-menu-options.d.ts +6 -0
  220. package/dist/interfaces/ps-capture-menu-options.js +1 -0
  221. package/dist/interfaces/ps-capture-modules.d.ts +6 -0
  222. package/dist/interfaces/ps-capture-modules.js +1 -0
  223. package/dist/interfaces/ps-capture-options.d.ts +6 -0
  224. package/dist/interfaces/ps-capture-options.js +1 -0
  225. package/dist/interfaces/ps-cartesian-chart-series.d.ts +2 -0
  226. package/dist/interfaces/ps-date-dialog-colors.d.ts +19 -0
  227. package/dist/interfaces/ps-date-dialog-colors.js +1 -0
  228. package/dist/interfaces/ps-device-file.d.ts +6 -0
  229. package/dist/interfaces/ps-device-file.js +1 -0
  230. package/dist/interfaces/ps-document-file-system.d.ts +2 -0
  231. package/dist/interfaces/ps-document-file-system.js +1 -0
  232. package/dist/interfaces/ps-document-labels.d.ts +1 -0
  233. package/dist/interfaces/ps-document-page-image.d.ts +5 -0
  234. package/dist/interfaces/ps-document-page-image.js +1 -0
  235. package/dist/interfaces/ps-document-pdf-native.d.ts +9 -0
  236. package/dist/interfaces/ps-document-pdf-native.js +1 -0
  237. package/dist/interfaces/ps-document-pdf-options.d.ts +4 -0
  238. package/dist/interfaces/ps-document-pdf-options.js +1 -0
  239. package/dist/interfaces/ps-document-pdf-state.d.ts +6 -0
  240. package/dist/interfaces/ps-document-pdf-state.js +1 -0
  241. package/dist/interfaces/ps-document-viewer-entry.d.ts +8 -0
  242. package/dist/interfaces/ps-document-viewer-entry.js +1 -0
  243. package/dist/interfaces/ps-file-opener.d.ts +4 -0
  244. package/dist/interfaces/ps-file-opener.js +1 -0
  245. package/dist/interfaces/ps-file-upload-options.d.ts +8 -0
  246. package/dist/interfaces/ps-file-upload-options.js +1 -0
  247. package/dist/interfaces/ps-material-scheme.d.ts +38 -0
  248. package/dist/interfaces/ps-material-scheme.js +1 -0
  249. package/dist/interfaces/ps-material-segmented-colors.d.ts +14 -0
  250. package/dist/interfaces/ps-material-segmented-colors.js +1 -0
  251. package/dist/interfaces/ps-material-switch-colors.d.ts +14 -0
  252. package/dist/interfaces/ps-material-switch-colors.js +1 -0
  253. package/dist/interfaces/ps-menu-anchor.d.ts +6 -0
  254. package/dist/interfaces/ps-menu-anchor.js +1 -0
  255. package/dist/interfaces/ps-menu-item.d.ts +1 -0
  256. package/dist/interfaces/ps-menu-popup-layout.d.ts +6 -0
  257. package/dist/interfaces/ps-menu-popup-layout.js +1 -0
  258. package/dist/interfaces/ps-menu-popup-window.d.ts +4 -0
  259. package/dist/interfaces/ps-menu-popup-window.js +1 -0
  260. package/dist/interfaces/ps-mobile-theme-input.d.ts +2 -0
  261. package/dist/interfaces/ps-quick-action-native.d.ts +14 -0
  262. package/dist/interfaces/ps-quick-action-native.js +1 -0
  263. package/dist/interfaces/ps-quick-action.d.ts +7 -0
  264. package/dist/interfaces/ps-quick-action.js +1 -0
  265. package/dist/interfaces/ps-scanned-file.d.ts +2 -5
  266. package/dist/interfaces/ps-stack-screen-options.d.ts +2 -0
  267. package/dist/interfaces/ps-stack-screen-options.js +1 -0
  268. package/dist/interfaces/ps-switcher-item.d.ts +11 -0
  269. package/dist/interfaces/ps-switcher-item.js +1 -0
  270. package/dist/interfaces/ps-tab-bar-context-data.d.ts +1 -0
  271. package/dist/interfaces/ps-tab-bar-icon-colors.d.ts +4 -0
  272. package/dist/interfaces/ps-tab-bar-icon-colors.js +1 -0
  273. package/dist/interfaces/ps-tab-bar-label-style.d.ts +5 -0
  274. package/dist/interfaces/ps-tab-bar-label-style.js +1 -0
  275. package/dist/interfaces/ps-tab-bar-label-styles.d.ts +5 -0
  276. package/dist/interfaces/ps-tab-bar-label-styles.js +1 -0
  277. package/dist/interfaces/ps-tab-bar-style.d.ts +12 -0
  278. package/dist/interfaces/ps-tab-bar-style.js +1 -0
  279. package/dist/interfaces/ps-waterfall-datum.d.ts +6 -0
  280. package/dist/interfaces/ps-waterfall-datum.js +1 -0
  281. package/dist/interfaces/ps-waterfall-step.d.ts +7 -0
  282. package/dist/interfaces/ps-waterfall-step.js +1 -0
  283. package/dist/interfaces/use-ps-barcode-scanner-result.d.ts +6 -0
  284. package/dist/interfaces/use-ps-barcode-scanner-result.js +1 -0
  285. package/dist/interfaces/use-ps-document-open-result.d.ts +5 -0
  286. package/dist/interfaces/use-ps-document-open-result.js +1 -0
  287. package/dist/interfaces/use-ps-document-pdf-cover-result.d.ts +7 -0
  288. package/dist/interfaces/use-ps-document-pdf-cover-result.js +1 -0
  289. package/dist/interfaces/use-ps-document-pdf-pages-result.d.ts +5 -0
  290. package/dist/interfaces/use-ps-document-pdf-pages-result.js +1 -0
  291. package/dist/interfaces/use-ps-document-text-result.d.ts +5 -0
  292. package/dist/interfaces/use-ps-document-text-result.js +1 -0
  293. package/dist/interfaces/use-ps-file-upload-result.d.ts +8 -0
  294. package/dist/interfaces/use-ps-file-upload-result.js +1 -0
  295. package/dist/interfaces/use-ps-quick-actions-options.d.ts +5 -0
  296. package/dist/interfaces/use-ps-quick-actions-options.js +1 -0
  297. package/dist/services/ps-barcode-scanner-service.d.ts +14 -0
  298. package/dist/services/ps-barcode-scanner-service.js +53 -0
  299. package/dist/services/ps-button-style-service.d.ts +2 -0
  300. package/dist/services/ps-button-style-service.js +13 -1
  301. package/dist/services/ps-capture-picker-service.d.ts +12 -0
  302. package/dist/services/ps-capture-picker-service.js +72 -0
  303. package/dist/services/ps-capture-source-service.d.ts +10 -0
  304. package/dist/services/ps-capture-source-service.js +31 -0
  305. package/dist/services/ps-chart-brand-service.d.ts +4 -0
  306. package/dist/services/ps-chart-brand-service.js +20 -0
  307. package/dist/services/ps-chart-shape-service.d.ts +7 -0
  308. package/dist/services/ps-chart-shape-service.js +17 -0
  309. package/dist/services/ps-control-style-service.js +3 -2
  310. package/dist/services/ps-date-picker-service.d.ts +3 -0
  311. package/dist/services/ps-date-picker-service.js +21 -0
  312. package/dist/services/ps-device-file-bytes-service.d.ts +6 -0
  313. package/dist/services/ps-device-file-bytes-service.js +19 -0
  314. package/dist/services/ps-device-file-service.d.ts +14 -0
  315. package/dist/services/ps-device-file-service.js +27 -0
  316. package/dist/services/ps-document-file-service.d.ts +10 -0
  317. package/dist/services/ps-document-file-service.js +75 -0
  318. package/dist/services/ps-document-open-service.d.ts +5 -0
  319. package/dist/services/ps-document-open-service.js +16 -0
  320. package/dist/services/ps-document-pdf-service.d.ts +10 -0
  321. package/dist/services/ps-document-pdf-service.js +40 -0
  322. package/dist/services/ps-document-text-service.d.ts +5 -0
  323. package/dist/services/ps-document-text-service.js +14 -0
  324. package/dist/services/ps-document-viewer-entry-service.d.ts +11 -0
  325. package/dist/services/ps-document-viewer-entry-service.js +72 -0
  326. package/dist/services/ps-list-row-style-service.js +2 -5
  327. package/dist/services/ps-material-control-service.d.ts +9 -0
  328. package/dist/services/ps-material-control-service.js +46 -0
  329. package/dist/services/ps-material-scheme-service.d.ts +5 -0
  330. package/dist/services/ps-material-scheme-service.js +42 -0
  331. package/dist/services/ps-menu-popup-service.d.ts +6 -0
  332. package/dist/services/ps-menu-popup-service.js +23 -0
  333. package/dist/services/ps-mobile-theme-service.d.ts +1 -1
  334. package/dist/services/ps-mobile-theme-service.js +7 -2
  335. package/dist/services/ps-navigation-theme-service.d.ts +5 -0
  336. package/dist/services/ps-navigation-theme-service.js +21 -0
  337. package/dist/services/ps-pdf-native-service.d.ts +8 -0
  338. package/dist/services/ps-pdf-native-service.js +33 -0
  339. package/dist/services/ps-quick-action-service.d.ts +9 -0
  340. package/dist/services/ps-quick-action-service.js +31 -0
  341. package/dist/services/ps-ripple-service.d.ts +7 -0
  342. package/dist/services/ps-ripple-service.js +26 -0
  343. package/dist/services/ps-screen-service.d.ts +3 -1
  344. package/dist/services/ps-screen-service.js +8 -2
  345. package/dist/services/ps-sheet-service.d.ts +1 -0
  346. package/dist/services/ps-sheet-service.js +3 -0
  347. package/dist/services/ps-stack-options-service.d.ts +5 -0
  348. package/dist/services/ps-stack-options-service.js +18 -0
  349. package/dist/services/ps-state-service.d.ts +7 -0
  350. package/dist/services/ps-state-service.js +26 -0
  351. package/dist/services/ps-switcher-service.d.ts +6 -0
  352. package/dist/services/ps-switcher-service.js +15 -0
  353. package/dist/services/ps-tab-bar-style-service.d.ts +5 -0
  354. package/dist/services/ps-tab-bar-style-service.js +30 -0
  355. package/dist/services/ps-waterfall-service.d.ts +10 -0
  356. package/dist/services/ps-waterfall-service.js +38 -0
  357. package/jest-setup.js +86 -3
  358. package/package.json +37 -4
@@ -18,6 +18,7 @@ export const PsActionMenuEntry = ({ item }) => {
18
18
  return (_jsx(Button, { modifiers: [
19
19
  disabled(item.isDisabled === true),
20
20
  ...(item.isDanger === true ? [tint(theme.danger)] : []),
21
+ ...(item.isWarning === true ? [tint(theme.warning)] : []),
21
22
  ], onPress: () => {
22
23
  haptic('selection');
23
24
  item.onSelect();
@@ -1,38 +1,27 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Fragment, useState } from 'react';
3
- import { DropdownMenu, DropdownMenuItem, HorizontalDivider, RNHostView, Text, } from '@expo/ui/jetpack-compose';
4
- import { PsNativeMenuConfig } from '../../constants/ps-native-menu-config';
2
+ import { Fragment } from 'react';
3
+ import { View } from 'react-native';
5
4
  import { usePsHaptics } from '../../hooks/use-ps-haptics';
6
- import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
5
+ import { usePsMenuAnchor } from '../../hooks/use-ps-menu-anchor';
7
6
  import { PsActionMenuService } from '../../services/ps-action-menu-service';
8
- import { PsHostScope } from '../ps-host-scope/ps-host-scope';
7
+ import { PsMenuPopup } from '../ps-menu-popup/ps-menu-popup';
8
+ import { PsMenuPopupDivider } from '../ps-menu-popup/ps-menu-popup-divider';
9
+ import { PsMenuPopupHeader } from '../ps-menu-popup/ps-menu-popup-header';
10
+ import { PsMenuPopupRow } from '../ps-menu-popup/ps-menu-popup-row';
9
11
  import { PsActionMenuTrigger } from './ps-action-menu-trigger';
10
12
  export const PsActionMenu = ({ children, header, isDisabled = false, items, label, sections, }) => {
11
13
  const haptic = usePsHaptics();
12
- const theme = usePsMobileTheme();
13
- const [isOpen, setIsOpen] = useState(false);
14
+ const menu = usePsMenuAnchor();
14
15
  const groups = PsActionMenuService.sections(items, sections);
15
- return (_jsx(PsHostScope, { matchContents: true, children: _jsxs(DropdownMenu, { color: theme.surface, expanded: isOpen, onDismissRequest: () => setIsOpen(false), children: [_jsxs(DropdownMenu.Items, { children: [header === undefined ? null : (_jsx(DropdownMenuItem, { enabled: false, children: _jsx(DropdownMenuItem.Text, { children: _jsx(Text, { style: { fontWeight: PsNativeMenuConfig.selectedWeight }, children: header.subtitle === undefined
16
- ? header.title
17
- : `${header.title}\n${header.subtitle}` }) }) }, 'header')), groups.map((group, index) => (_jsxs(Fragment, { children: [index > 0 || header !== undefined ? _jsx(HorizontalDivider, {}) : null, PsActionMenuService.flatten([group]).map((item) => (_jsx(DropdownMenuItem, { elementColors: {
18
- textColor: item.isDanger
19
- ? theme.danger
20
- : item.isChecked
21
- ? theme.primaryText
22
- : theme.ink,
23
- }, enabled: item.isDisabled !== true, onClick: () => {
24
- setIsOpen(false);
25
- haptic('selection');
26
- item.onSelect();
27
- }, children: _jsx(DropdownMenuItem.Text, { children: _jsx(Text, { style: {
28
- fontWeight: item.isChecked
29
- ? PsNativeMenuConfig.selectedWeight
30
- : PsNativeMenuConfig.unselectedWeight,
31
- }, children: item.label }) }) }, item.id)))] }, group.id)))] }), _jsx(DropdownMenu.Trigger, { children: _jsx(RNHostView, { matchContents: true, children: _jsx(PsActionMenuTrigger, { isDisabled: isDisabled, label: label, state: {
32
- isOpen,
33
- open: () => {
34
- if (!isDisabled)
35
- setIsOpen(true);
36
- },
37
- }, children: children }) }) })] }) }));
16
+ return (_jsxs(View, { collapsable: false, ref: menu.ref, children: [_jsx(PsActionMenuTrigger, { isDisabled: isDisabled, label: label, state: {
17
+ isOpen: menu.anchor !== undefined,
18
+ open: () => {
19
+ if (!isDisabled)
20
+ menu.open();
21
+ },
22
+ }, children: children }), menu.anchor === undefined ? null : (_jsxs(PsMenuPopup, { anchor: menu.anchor, onClose: menu.close, children: [header === undefined ? null : (_jsx(PsMenuPopupHeader, { subtitle: header.subtitle, title: header.title })), groups.map((group, index) => (_jsxs(Fragment, { children: [index > 0 || header !== undefined ? _jsx(PsMenuPopupDivider, {}) : null, PsActionMenuService.flatten([group]).map((item) => (_jsx(PsMenuPopupRow, { iconKey: item.iconKey, isChecked: item.isChecked, isDanger: item.isDanger, isDisabled: item.isDisabled, isWarning: item.isWarning, label: item.label, onPress: () => {
23
+ menu.close();
24
+ haptic('selection');
25
+ item.onSelect();
26
+ }, subtitle: item.subtitle }, item.id)))] }, group.id)))] }))] }));
38
27
  };
@@ -6,9 +6,11 @@ import Animated, { FadeInDown } from 'react-native-reanimated';
6
6
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
7
7
  import { PsLayoutConfig } from '../../constants/ps-layout-config';
8
8
  import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config';
9
+ import { PsRippleKind } from '../../constants/ps-ripple-kind';
9
10
  import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
10
11
  import { PsActionSheetService } from '../../services/ps-action-sheet-service';
11
- import { PsMobileColorService } from '../../services/ps-mobile-color-service';
12
+ import { PsRippleService } from '../../services/ps-ripple-service';
13
+ import { PsStateService } from '../../services/ps-state-service';
12
14
  import { PsIcon } from '../ps-icon/ps-icon';
13
15
  import { PsText } from '../ps-text/ps-text';
14
16
  export const PsActionSheet = ({ cancelLabel, isOpen, items, onClose, title, }) => {
@@ -28,7 +30,7 @@ export const PsActionSheet = ({ cancelLabel, isOpen, items, onClose, title, }) =
28
30
  borderWidth: 1,
29
31
  paddingBottom: insets.bottom + PsLayoutConfig.sheetFooterGap,
30
32
  paddingTop: PsLayoutConfig.sheetFooterGap,
31
- }, testID: 'ps-action-sheet', children: [title === undefined ? null : (_jsx(View, { style: { paddingHorizontal: PsLayoutConfig.gutter, paddingVertical: 8 }, children: _jsx(PsText, { tone: 'muted', variant: 'label', children: title }) })), items.map((item) => (_jsxs(Pressable, { accessibilityRole: 'menuitem', accessibilityState: { disabled: item.isDisabled === true }, disabled: item.isDisabled, onPress: () => {
33
+ }, testID: 'ps-action-sheet', children: [title === undefined ? null : (_jsx(View, { style: { paddingHorizontal: PsLayoutConfig.gutter, paddingVertical: 8 }, children: _jsx(PsText, { tone: 'muted', variant: 'label', children: title }) })), items.map((item) => (_jsxs(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Surface), accessibilityRole: 'menuitem', accessibilityState: { disabled: item.isDisabled === true }, disabled: item.isDisabled, onPress: () => {
32
34
  pending.current = item.onSelect;
33
35
  onClose();
34
36
  if (!PsActionSheetService.runsOnDismiss())
@@ -36,12 +38,12 @@ export const PsActionSheet = ({ cancelLabel, isOpen, items, onClose, title, }) =
36
38
  }, style: ({ pressed }) => ({
37
39
  alignItems: 'center',
38
40
  backgroundColor: pressed
39
- ? PsMobileColorService.withAlpha(theme.ink, PsMobileControlConfig.pressedAlpha)
41
+ ? PsStateService.pressedFill(theme, 'transparent')
40
42
  : 'transparent',
41
43
  flexDirection: 'row',
42
44
  gap: PsMobileControlConfig.rowSpacing,
43
45
  minHeight: PsLayoutConfig.actionSheetRowHeight,
44
- opacity: item.isDisabled === true ? PsMobileControlConfig.disabledOpacity : 1,
46
+ opacity: item.isDisabled === true ? PsStateService.disabledOpacity() : 1,
45
47
  paddingHorizontal: PsLayoutConfig.gutter,
46
48
  }), children: [item.iconKey === undefined ? null : (_jsx(PsIcon, { color: item.isDanger === true ? theme.danger : theme.ink, iconKey: item.iconKey })), _jsx(PsText, { style: { flex: 1 }, tone: item.isDanger === true ? 'danger' : 'ink', weight: 'medium', children: item.label }), item.isChecked === true ? (_jsx(PsIcon, { color: theme.primary, iconKey: PsIconKey.Check })) : null] }, item.id))), cancelLabel === undefined ? null : (_jsx(Pressable, { accessibilityRole: 'button', onPress: onClose, style: {
47
49
  alignItems: 'center',
@@ -0,0 +1,2 @@
1
+ export * from './ps-barcode-scanner-sheet';
2
+ export * from './ps-barcode-scanner-sheet-props';
@@ -0,0 +1,2 @@
1
+ export * from './ps-barcode-scanner-sheet';
2
+ export * from './ps-barcode-scanner-sheet-props';
@@ -0,0 +1,11 @@
1
+ import type { PsBarcodeScan } from '../../interfaces/ps-barcode-scan';
2
+ import type { PsBarcodeScannerLabels } from '../../interfaces/ps-barcode-scanner-labels';
3
+ export interface PsBarcodeScannerSheetProps {
4
+ barcodeTypes?: string[];
5
+ isContinuous?: boolean;
6
+ isOpen: boolean;
7
+ labels: PsBarcodeScannerLabels;
8
+ message?: string;
9
+ onClose: () => void;
10
+ onScan: (scan: PsBarcodeScan) => void;
11
+ }
@@ -0,0 +1,2 @@
1
+ import type { PsBarcodeScannerSheetProps } from './ps-barcode-scanner-sheet-props';
2
+ export declare const PsBarcodeScannerSheet: ({ barcodeTypes, isContinuous, isOpen, labels, message, onClose, onScan, }: PsBarcodeScannerSheetProps) => import("react").JSX.Element;
@@ -0,0 +1,82 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useRef, useState } from 'react';
3
+ import { PsIconKey } from '@pallasoft/ps-icons';
4
+ import { Common } from '@pallasoft/ps-utilities';
5
+ import { Linking, Modal, StatusBar, StyleSheet, View, useWindowDimensions } from 'react-native';
6
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
7
+ import { PsBarcodePermission } from '../../constants/ps-barcode-permission';
8
+ import { PsBarcodeScannerConfig } from '../../constants/ps-barcode-scanner-config';
9
+ import { usePsHaptics } from '../../hooks/use-ps-haptics';
10
+ import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
11
+ import { PsBarcodeScannerService } from '../../services/ps-barcode-scanner-service';
12
+ import { PsButton } from '../ps-button/ps-button';
13
+ import { PsIconButton } from '../ps-icon-button/ps-icon-button';
14
+ import { PsText } from '../ps-text/ps-text';
15
+ export const PsBarcodeScannerSheet = ({ barcodeTypes, isContinuous = false, isOpen, labels, message, onClose, onScan, }) => {
16
+ const theme = usePsMobileTheme();
17
+ const insets = useSafeAreaInsets();
18
+ const { width } = useWindowDimensions();
19
+ const play = usePsHaptics();
20
+ const Camera = useMemo(() => PsBarcodeScannerService.camera(), []);
21
+ const [permission, setPermission] = useState(PsBarcodePermission.checking);
22
+ const [isTorchOn, setIsTorchOn] = useState(false);
23
+ const lastRead = useRef(null);
24
+ const frame = PsBarcodeScannerService.frameSize(width);
25
+ useEffect(() => {
26
+ if (!isOpen)
27
+ return;
28
+ lastRead.current = null;
29
+ setIsTorchOn(false);
30
+ setPermission(PsBarcodePermission.checking);
31
+ void PsBarcodeScannerService.requestPermission().then((isGranted) => setPermission(isGranted ? PsBarcodePermission.granted : PsBarcodePermission.denied));
32
+ }, [isOpen]);
33
+ const read = (scan) => {
34
+ const data = PsBarcodeScannerService.normalise(scan.data);
35
+ const now = Common.DateService.nowMilliseconds();
36
+ if (!PsBarcodeScannerService.accept(lastRead.current, data, now))
37
+ return;
38
+ lastRead.current = { at: now, data };
39
+ play('success');
40
+ onScan({ data, type: scan.type });
41
+ if (!isContinuous)
42
+ onClose();
43
+ };
44
+ return (_jsxs(Modal, { animationType: 'fade', onRequestClose: onClose, presentationStyle: 'fullScreen', visible: isOpen, children: [_jsx(StatusBar, { barStyle: 'light-content' }), _jsxs(View, { style: { backgroundColor: PsBarcodeScannerConfig.backdropColor, flex: 1 }, testID: 'ps-barcode-scanner', children: [Camera !== null && permission === PsBarcodePermission.granted ? (_jsx(Camera, { barcodeScannerSettings: {
45
+ barcodeTypes: PsBarcodeScannerService.types(barcodeTypes),
46
+ }, enableTorch: isTorchOn, facing: PsBarcodeScannerConfig.facing, onBarcodeScanned: read, style: StyleSheet.absoluteFill })) : null, permission === PsBarcodePermission.granted ? (_jsx(View, { pointerEvents: 'none', style: [
47
+ StyleSheet.absoluteFill,
48
+ {
49
+ alignItems: 'center',
50
+ justifyContent: 'center',
51
+ },
52
+ ], children: _jsx(View, { style: {
53
+ borderColor: theme.primary,
54
+ borderRadius: PsBarcodeScannerConfig.frameRadius,
55
+ borderWidth: PsBarcodeScannerConfig.frameBorderWidth,
56
+ height: frame.height,
57
+ width: frame.width,
58
+ }, testID: 'ps-barcode-scanner-frame' }) })) : null, permission === PsBarcodePermission.denied ? (_jsxs(View, { style: [
59
+ StyleSheet.absoluteFill,
60
+ {
61
+ alignItems: 'center',
62
+ gap: PsBarcodeScannerConfig.barGap,
63
+ justifyContent: 'center',
64
+ padding: PsBarcodeScannerConfig.footerPadding,
65
+ },
66
+ ], children: [_jsx(PsText, { align: 'center', tone: 'white', children: labels.denied }), _jsx(PsButton, { onPress: () => void Linking.openSettings(), variant: 'secondary', children: labels.openSettings })] })) : null, _jsxs(View, { style: {
67
+ flexDirection: 'row',
68
+ justifyContent: 'space-between',
69
+ padding: PsBarcodeScannerConfig.barPadding,
70
+ paddingTop: insets.top + PsBarcodeScannerConfig.barPadding,
71
+ }, children: [_jsx(PsIconButton, { backgroundColor: theme.overlay, color: theme.white, iconKey: PsIconKey.Close, label: labels.close, onPress: onClose, testID: 'ps-barcode-scanner-close' }), permission === PsBarcodePermission.granted ? (_jsx(PsIconButton, { backgroundColor: isTorchOn ? theme.primary : theme.overlay, color: isTorchOn ? theme.primaryContrast : theme.white, iconKey: PsIconKey.Flash, label: isTorchOn ? labels.torchOff : labels.torchOn, onPress: () => setIsTorchOn((current) => !current), testID: 'ps-barcode-scanner-torch' })) : null] }), _jsx(View, { style: { flex: 1 } }), _jsxs(View, { style: {
72
+ alignItems: 'center',
73
+ gap: PsBarcodeScannerConfig.footerGap,
74
+ padding: PsBarcodeScannerConfig.footerPadding,
75
+ paddingBottom: insets.bottom + PsBarcodeScannerConfig.footerPadding,
76
+ }, children: [message === undefined ? null : (_jsx(View, { style: {
77
+ backgroundColor: theme.overlay,
78
+ borderRadius: PsBarcodeScannerConfig.pillRadius,
79
+ paddingHorizontal: PsBarcodeScannerConfig.pillPaddingHorizontal,
80
+ paddingVertical: PsBarcodeScannerConfig.pillPaddingVertical,
81
+ }, children: _jsx(PsText, { align: 'center', testID: 'ps-barcode-scanner-message', tone: 'white', weight: 'semibold', children: message }) })), permission === PsBarcodePermission.granted ? (_jsx(PsText, { align: 'center', tone: 'white', variant: 'small', children: labels.hint })) : null] })] })] }));
82
+ };
@@ -4,6 +4,8 @@ import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config'
4
4
  import { usePsHaptics } from '../../hooks/use-ps-haptics';
5
5
  import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
6
6
  import { PsButtonStyleService } from '../../services/ps-button-style-service';
7
+ import { PsRippleService } from '../../services/ps-ripple-service';
8
+ import { PsStateService } from '../../services/ps-state-service';
7
9
  import { PsIcon } from '../ps-icon/ps-icon';
8
10
  import { PsSpinner } from '../ps-spinner/ps-spinner';
9
11
  import { PsText } from '../ps-text/ps-text';
@@ -13,7 +15,7 @@ export const PsButton = ({ children, isDisabled = false, isFullWidth = false, is
13
15
  const style = PsButtonStyleService.resolve(variant, theme);
14
16
  const isInactive = isDisabled || isLoading;
15
17
  const iconSize = PsMobileControlConfig.iconSizeInline;
16
- return (_jsx(Pressable, { accessibilityLabel: isLoading && loadingLabel !== undefined ? loadingLabel : children, accessibilityRole: 'button', accessibilityState: { busy: isLoading, disabled: isInactive }, disabled: isInactive, onPress: onPress === undefined
18
+ return (_jsx(Pressable, { android_ripple: PsRippleService.resolve(theme, PsButtonStyleService.rippleKind(variant)), accessibilityLabel: isLoading && loadingLabel !== undefined ? loadingLabel : children, accessibilityRole: 'button', accessibilityState: { busy: isLoading, disabled: isInactive }, disabled: isInactive, onPress: onPress === undefined
17
19
  ? undefined
18
20
  : () => {
19
21
  haptic('light');
@@ -27,7 +29,7 @@ export const PsButton = ({ children, isDisabled = false, isFullWidth = false, is
27
29
  borderWidth: 1,
28
30
  height: PsMobileControlConfig.controlHeights[size],
29
31
  justifyContent: 'center',
30
- opacity: isDisabled ? PsMobileControlConfig.disabledOpacity : 1,
32
+ opacity: isDisabled ? PsStateService.disabledOpacity() : 1,
31
33
  paddingHorizontal: PsMobileControlConfig.controlPaddingX[size],
32
34
  }), children: isLoading ? (_jsx(PsSpinner, { color: style.foreground })) : (_jsxs(View, { style: {
33
35
  alignItems: 'center',
@@ -12,6 +12,7 @@ import { PsChartKindService } from '../../services/ps-chart-kind-service';
12
12
  import { PsChartReadoutService } from '../../services/ps-chart-readout-service';
13
13
  import { PsChartScaleService } from '../../services/ps-chart-scale-service';
14
14
  import { PsChartSeriesService } from '../../services/ps-chart-series-service';
15
+ import { PsChartShapeService } from '../../services/ps-chart-shape-service';
15
16
  import { PsChartBar } from '../ps-chart-bar/ps-chart-bar';
16
17
  import { PsChartEmptyState } from '../ps-chart-empty-state/ps-chart-empty-state';
17
18
  import { PsChartLegend } from '../ps-chart-legend/ps-chart-legend';
@@ -36,34 +37,39 @@ export const PsCartesianChart = ({ data, emptyLabel, formatTick, formatValue, he
36
37
  index: position,
37
38
  theme,
38
39
  }));
40
+ const barIndexes = PsChartShapeService.barIndexes(kind, series);
41
+ const lineIndexes = PsChartShapeService.lineIndexes(kind, series);
42
+ const barSeries = barIndexes.map((position) => series[position]);
43
+ const barColors = barIndexes.map((position) => colors[position]);
44
+ const lineSeries = lineIndexes.map((position) => series[position]);
39
45
  const domain = PsChartScaleService.domain(isStacked
40
- ? PsChartSeriesService.stackedValues(data, series)
46
+ ? [
47
+ ...PsChartSeriesService.stackedValues(data, barSeries),
48
+ ...PsChartSeriesService.values(data, lineSeries),
49
+ ]
41
50
  : PsChartSeriesService.values(data, series));
42
51
  const selected = index === null ? data.length - 1 : index;
43
52
  const datum = data[selected];
44
53
  const items = PsChartReadoutService.items(datum, series, colors, formatValue);
45
54
  const xAt = (position) => PsChartScaleService.categoryX(position, data.length, plot, isBars);
46
- const rects = isBars
47
- ? isStacked
48
- ? PsChartBarService.stacked(data, series, colors, domain, plot)
49
- : PsChartBarService.grouped(data, series, colors, domain, plot)
50
- : [];
55
+ const rects = barSeries.length === 0
56
+ ? []
57
+ : isStacked
58
+ ? PsChartBarService.stacked(data, barSeries, barColors, domain, plot)
59
+ : PsChartBarService.grouped(data, barSeries, barColors, domain, plot);
51
60
  return (_jsxs(View, { style: { gap: 8 }, children: [_jsx(PsChartReadout, { items: items, title: datum.label }), _jsx(View, { accessible: true, accessibilityLabel: PsChartReadoutService.summary(datum.label, items), accessibilityRole: 'image', onLayout: onLayout, style: { height }, children: width === 0 ? null : (_jsxs(_Fragment, { children: [_jsxs(Svg, { height: height, pointerEvents: 'none', width: width, children: [PsChartScaleService.ticks(domain).map((tick) => {
52
61
  const y = PsChartScaleService.y(tick, domain, plot);
53
62
  return (_jsxs(G, { children: [_jsx(Line, { stroke: theme.line, strokeWidth: PsChartConfig.gridLineWidth, x1: plot.left, x2: plot.right, y1: y, y2: y }), _jsx(SvgText, { fill: theme.muted, fontFamily: theme.fonts.medium, fontSize: PsChartConfig.axisLabelSize, textAnchor: 'end', x: plot.left - 6, y: y + 3, children: formatTick(tick) })] }, tick));
54
- }), PsChartScaleService.labelIndexes(data.length).map((position) => (_jsx(SvgText, { fill: theme.muted, fontFamily: theme.fonts.medium, fontSize: PsChartConfig.axisLabelSize, textAnchor: PsChartScaleService.labelAnchor(position, data.length, isBars), x: xAt(position), y: height - 6, children: data[position].label }, position))), rects.map((rect) => (_jsx(PsChartBar, { progress: progress, rect: rect }, rect.id))), isBars
55
- ? null
56
- : series.map((entry, position) => {
57
- const points = data.map((row, rowIndex) => ({
58
- x: xAt(rowIndex),
59
- y: PsChartScaleService.y(PsChartSeriesService.value(row, entry.dataKey), domain, plot),
60
- }));
61
- return (_jsx(PsChartLine, { areaBaseline: kind === PsCartesianChartKind.Area
62
- ? PsChartScaleService.y(0, domain, plot)
63
- : undefined, color: colors[position], points: points, progress: progress }, entry.dataKey));
64
- }), index === null ? null : (_jsx(Line, { stroke: theme.muted, strokeWidth: PsChartConfig.scrubLineWidth, x1: xAt(selected), x2: xAt(selected), y1: plot.top, y2: plot.bottom })), isBars
65
- ? null
66
- : series.map((entry, position) => (_jsx(Circle, { cx: xAt(selected), cy: PsChartScaleService.y(PsChartSeriesService.value(datum, entry.dataKey), domain, plot), fill: theme.surface, r: PsChartConfig.markerRadius, stroke: colors[position], strokeWidth: 2 }, entry.dataKey)))] }), _jsx(View, { ...panHandlers, style: StyleSheet.absoluteFill, testID: 'ps-chart-touch' })] })) }), showLegend && series.length > 1 ? (_jsx(PsChartLegend, { items: series.map((entry, position) => ({
63
+ }), PsChartScaleService.labelIndexes(data.length).map((position) => (_jsx(SvgText, { fill: theme.muted, fontFamily: theme.fonts.medium, fontSize: PsChartConfig.axisLabelSize, textAnchor: PsChartScaleService.labelAnchor(position, data.length, isBars), x: xAt(position), y: height - 6, children: data[position].label }, position))), rects.map((rect) => (_jsx(PsChartBar, { progress: progress, rect: rect }, rect.id))), lineSeries.map((entry, lineIndex) => {
64
+ const position = lineIndexes[lineIndex];
65
+ const points = data.map((row, rowIndex) => ({
66
+ x: xAt(rowIndex),
67
+ y: PsChartScaleService.y(PsChartSeriesService.value(row, entry.dataKey), domain, plot),
68
+ }));
69
+ return (_jsx(PsChartLine, { areaBaseline: kind === PsCartesianChartKind.Area
70
+ ? PsChartScaleService.y(0, domain, plot)
71
+ : undefined, color: colors[position], points: points, progress: progress }, entry.dataKey));
72
+ }), index === null ? null : (_jsx(Line, { stroke: theme.muted, strokeWidth: PsChartConfig.scrubLineWidth, x1: xAt(selected), x2: xAt(selected), y1: plot.top, y2: plot.bottom })), lineSeries.map((entry, lineIndex) => (_jsx(Circle, { cx: xAt(selected), cy: PsChartScaleService.y(PsChartSeriesService.value(datum, entry.dataKey), domain, plot), fill: theme.surface, r: PsChartConfig.markerRadius, stroke: colors[lineIndexes[lineIndex]], strokeWidth: 2 }, entry.dataKey)))] }), _jsx(View, { ...panHandlers, style: StyleSheet.absoluteFill, testID: 'ps-chart-touch' })] })) }), showLegend && series.length > 1 ? (_jsx(PsChartLegend, { items: series.map((entry, position) => ({
67
73
  color: colors[position],
68
74
  label: entry.label,
69
75
  })) })) : null] }));
@@ -3,16 +3,19 @@ import { PsIconKey } from '@pallasoft/ps-icons';
3
3
  import { Pressable, View } from 'react-native';
4
4
  import { PsCheckboxConfig } from '../../constants/ps-checkbox-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';
8
+ import { PsRippleService } from '../../services/ps-ripple-service';
9
+ import { PsStateService } from '../../services/ps-state-service';
7
10
  import { PsIcon } from '../ps-icon/ps-icon';
8
11
  import { PsText } from '../ps-text/ps-text';
9
12
  export const PsCheckbox = ({ description, isChecked, isDisabled = false, label, onChange, }) => {
10
13
  const theme = usePsMobileTheme();
11
- return (_jsxs(Pressable, { accessibilityRole: 'checkbox', accessibilityState: { checked: isChecked, disabled: isDisabled }, disabled: isDisabled, onPress: () => onChange?.(!isChecked), style: {
14
+ return (_jsxs(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Surface), accessibilityRole: 'checkbox', accessibilityState: { checked: isChecked, disabled: isDisabled }, disabled: isDisabled, onPress: () => onChange?.(!isChecked), style: {
12
15
  alignItems: 'center',
13
16
  flexDirection: 'row',
14
17
  gap: PsMobileControlConfig.rowSpacing,
15
- opacity: isDisabled ? PsMobileControlConfig.disabledOpacity : 1,
18
+ opacity: isDisabled ? PsStateService.disabledOpacity() : 1,
16
19
  }, children: [_jsx(View, { style: {
17
20
  alignItems: 'center',
18
21
  backgroundColor: isChecked ? theme.primary : theme.surface,
@@ -1,14 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Pressable } from 'react-native';
3
3
  import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config';
4
+ import { PsRippleKind } from '../../constants/ps-ripple-kind';
4
5
  import { usePsHaptics } from '../../hooks/use-ps-haptics';
5
6
  import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
7
+ import { PsRippleService } from '../../services/ps-ripple-service';
6
8
  import { PsIcon } from '../ps-icon/ps-icon';
7
9
  import { PsText } from '../ps-text/ps-text';
8
10
  export const PsChip = ({ children, isSelected = false, onPress, trailingIcon }) => {
9
11
  const haptic = usePsHaptics();
10
12
  const theme = usePsMobileTheme();
11
- return (_jsxs(Pressable, { accessibilityRole: 'button', accessibilityState: { selected: isSelected }, onPress: onPress === undefined
13
+ return (_jsxs(Pressable, { android_ripple: PsRippleService.resolve(theme, PsRippleKind.Surface), accessibilityRole: 'button', accessibilityState: { selected: isSelected }, onPress: onPress === undefined
12
14
  ? undefined
13
15
  : () => {
14
16
  haptic('selection');
@@ -14,7 +14,7 @@ export const PsDateField = ({ closeLabel, confirmLabel, displayValue, errorText,
14
14
  const [isOpen, setIsOpen] = useState(false);
15
15
  if (isLoading)
16
16
  return _jsx(PsFieldSkeleton, {});
17
- return (_jsxs(PsFieldFrame, { errorText: errorText, helperText: helperText, label: label, children: [_jsx(Pressable, { accessibilityLabel: label, accessibilityRole: 'button', accessibilityState: { disabled: isDisabled, expanded: isOpen }, disabled: isDisabled, onPress: () => setIsOpen(true), children: _jsx(PsDateControl, { errorText: errorText, isDisabled: isDisabled, isFocused: isOpen, text: displayValue === undefined ? value : displayValue }) }), isOpen ? (_jsx(PsHostScope, { children: _jsx(DatePickerDialog, { color: theme.primary, confirmButtonLabel: confirmLabel, dismissButtonLabel: closeLabel, initialDate: value, onDateSelected: (date) => {
17
+ return (_jsxs(PsFieldFrame, { errorText: errorText, helperText: helperText, label: label, children: [_jsx(Pressable, { accessibilityLabel: label, accessibilityRole: 'button', accessibilityState: { disabled: isDisabled, expanded: isOpen }, disabled: isDisabled, onPress: () => setIsOpen(true), children: _jsx(PsDateControl, { errorText: errorText, isDisabled: isDisabled, isFocused: isOpen, text: displayValue === undefined ? value : displayValue }) }), isOpen ? (_jsx(PsHostScope, { children: _jsx(DatePickerDialog, { color: theme.primaryText, confirmButtonLabel: confirmLabel, elementColors: PsDatePickerService.dialogColors(theme), dismissButtonLabel: closeLabel, initialDate: value, onDateSelected: (date) => {
18
18
  setIsOpen(false);
19
19
  onChange?.(PsDatePickerService.clamp(PsDateFieldService.fromUtcDate(date), min, max));
20
20
  }, onDismissRequest: () => setIsOpen(false), selectableDates: PsDatePickerService.limits(min, max), showTitle: false }) })) : null] }));
@@ -24,7 +24,7 @@ export const PsDateField = ({ displayValue, errorText, helperText, isDisabled =
24
24
  frame({ maxHeight: Infinity, maxWidth: Infinity }),
25
25
  ] }) }), _jsx(Popover.Content, { children: _jsx(DatePicker, { displayedComponents: ['date'], modifiers: [
26
26
  datePickerStyle('graphical'),
27
- tint(theme.primary),
27
+ tint(theme.isDark ? theme.primary : theme.primaryText),
28
28
  frame({ width: PsDateFieldConfig.calendarWidth }),
29
29
  padding({
30
30
  horizontal: PsDateFieldConfig.calendarPadding,
@@ -1,8 +1,11 @@
1
+ import type { PsDocumentLoadStatus } from '../../constants/ps-document-load-status';
1
2
  import type { PsDocumentItem } from '../../interfaces/ps-document-item';
2
3
  import type { PsDocumentLabels } from '../../interfaces/ps-document-labels';
3
4
  export interface PsDocumentPageProps {
4
5
  item: PsDocumentItem;
5
6
  labels: PsDocumentLabels;
6
7
  onDismiss: () => void;
8
+ onRetry?: () => void;
7
9
  onZoomChange: (isZoomed: boolean) => void;
10
+ status?: PsDocumentLoadStatus;
8
11
  }
@@ -1,2 +1,2 @@
1
1
  import type { PsDocumentPageProps } from './ps-document-page-props';
2
- export declare const PsDocumentPage: ({ item, labels, onDismiss, onZoomChange }: PsDocumentPageProps) => import("react").JSX.Element;
2
+ export declare const PsDocumentPage: ({ item, labels, onDismiss, onRetry, onZoomChange, status, }: PsDocumentPageProps) => import("react").JSX.Element;
@@ -1,22 +1,31 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import { PsIconKey } from '@pallasoft/ps-icons';
4
- import { ScrollView, View } from 'react-native';
5
- import { PsDocumentConfig } from '../../constants/ps-document-config';
4
+ import { View } from 'react-native';
6
5
  import { PsDocumentKind } from '../../constants/ps-document-kind';
6
+ import { PsDocumentLoadStatus } from '../../constants/ps-document-load-status';
7
7
  import { PsDocumentMessage } from '../ps-document-message/ps-document-message';
8
+ import { PsDocumentTextPage } from '../ps-document-text-page/ps-document-text-page';
9
+ import { PsDocumentUnsupported } from '../ps-document-unsupported/ps-document-unsupported';
8
10
  import { PsDocumentZoomImage } from '../ps-document-zoom-image/ps-document-zoom-image';
9
- import { PsText } from '../ps-text/ps-text';
10
- export const PsDocumentPage = ({ item, labels, onDismiss, onZoomChange }) => {
11
+ import { PsSpinner } from '../ps-spinner/ps-spinner';
12
+ export const PsDocumentPage = ({ item, labels, onDismiss, onRetry, onZoomChange, status = PsDocumentLoadStatus.Ready, }) => {
11
13
  const [attempt, setAttempt] = useState(0);
12
14
  const [hasFailed, setHasFailed] = useState(false);
15
+ if (item.kind === PsDocumentKind.Pdf) {
16
+ if (status === PsDocumentLoadStatus.Loading)
17
+ return (_jsx(View, { style: { alignItems: 'center', flex: 1, justifyContent: 'center' }, testID: 'ps-document-pdf-loading', children: _jsx(PsSpinner, {}) }));
18
+ if (status === PsDocumentLoadStatus.Failed)
19
+ return (_jsx(PsDocumentMessage, { actionLabel: onRetry === undefined ? undefined : labels.retry, description: item.name, iconKey: PsIconKey.Warning, isOnDark: true, onAction: onRetry, title: labels.loadFailed }));
20
+ return _jsx(PsDocumentUnsupported, { isOnDark: true, item: item, labels: labels });
21
+ }
13
22
  if (item.kind === PsDocumentKind.Image && item.source !== null) {
14
23
  return hasFailed ? (_jsx(PsDocumentMessage, { actionLabel: labels.retry, iconKey: PsIconKey.Warning, isOnDark: true, onAction: () => {
15
24
  setHasFailed(false);
16
25
  setAttempt((current) => current + 1);
17
26
  }, title: labels.loadFailed })) : (_jsx(PsDocumentZoomImage, { name: item.name, onDismiss: onDismiss, onError: () => setHasFailed(true), onZoomChange: onZoomChange, source: item.source }, attempt));
18
27
  }
19
- if (item.kind === PsDocumentKind.Text && item.text !== null)
20
- return (_jsx(View, { style: { flex: 1 }, testID: 'ps-document-text-page', children: _jsx(ScrollView, { contentContainerStyle: { padding: PsDocumentConfig.pageGutter }, showsVerticalScrollIndicator: true, children: _jsx(PsText, { isSelectable: true, tone: 'white', children: item.text }) }) }));
21
- return (_jsx(PsDocumentMessage, { description: item.name, iconKey: PsIconKey.Doc, isOnDark: true, title: labels.unsupported }));
28
+ if (item.kind === PsDocumentKind.Text)
29
+ return _jsx(PsDocumentTextPage, { item: item, labels: labels });
30
+ return _jsx(PsDocumentUnsupported, { isOnDark: true, item: item, labels: labels });
22
31
  };
@@ -0,0 +1,2 @@
1
+ export * from './ps-document-page-strip';
2
+ export * from './ps-document-page-strip-props';
@@ -0,0 +1,2 @@
1
+ export * from './ps-document-page-strip';
2
+ export * from './ps-document-page-strip-props';
@@ -0,0 +1,6 @@
1
+ import type { PsDocumentViewerEntry } from '../../interfaces/ps-document-viewer-entry';
2
+ export interface PsDocumentPageStripProps {
3
+ entries: PsDocumentViewerEntry[];
4
+ index: number;
5
+ onSelect: (index: number) => void;
6
+ }
@@ -0,0 +1,2 @@
1
+ import type { PsDocumentPageStripProps } from './ps-document-page-strip-props';
2
+ export declare const PsDocumentPageStrip: ({ entries, index, onSelect }: PsDocumentPageStripProps) => import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from 'react';
3
+ import { PsIconKey } from '@pallasoft/ps-icons';
4
+ import { FlatList, Image, Pressable, View } from 'react-native';
5
+ import { PsDocumentConfig } from '../../constants/ps-document-config';
6
+ import { PsDocumentKind } from '../../constants/ps-document-kind';
7
+ import { PsDocumentPdfConfig } from '../../constants/ps-document-pdf-config';
8
+ import { PsMobileControlConfig } from '../../constants/ps-mobile-control-config';
9
+ import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
10
+ import { PsDocumentPagerService } from '../../services/ps-document-pager-service';
11
+ import { PsMobileColorService } from '../../services/ps-mobile-color-service';
12
+ import { PsIcon } from '../ps-icon/ps-icon';
13
+ export const PsDocumentPageStrip = ({ entries, index, onSelect }) => {
14
+ const theme = usePsMobileTheme();
15
+ const list = useRef(null);
16
+ useEffect(() => {
17
+ if (index >= 0 && index < entries.length)
18
+ list.current?.scrollToIndex({
19
+ animated: true,
20
+ index,
21
+ viewPosition: PsDocumentPdfConfig.stripScrollViewPosition,
22
+ });
23
+ }, [entries.length, index]);
24
+ return (_jsx(View, { style: { paddingVertical: PsDocumentPdfConfig.stripPadding }, testID: 'ps-document-page-strip', children: _jsx(FlatList, { contentContainerStyle: {
25
+ gap: PsDocumentPdfConfig.stripGap,
26
+ paddingHorizontal: PsDocumentPdfConfig.stripPadding,
27
+ }, data: entries, getItemLayout: (_data, position) => ({
28
+ index: position,
29
+ length: PsDocumentPdfConfig.stripTileWidth + PsDocumentPdfConfig.stripGap,
30
+ offset: (PsDocumentPdfConfig.stripTileWidth + PsDocumentPdfConfig.stripGap) * position,
31
+ }), horizontal: true, keyExtractor: (entry) => entry.id, ref: list, renderItem: ({ index: position, item: entry }) => (_jsx(Pressable, { accessibilityLabel: PsDocumentPagerService.counter(position, entries.length), accessibilityRole: 'button', accessibilityState: { selected: position === index }, onPress: () => onSelect(position), style: {
32
+ alignItems: 'center',
33
+ borderColor: position === index
34
+ ? theme.primary
35
+ : PsMobileColorService.withAlpha(theme.white, PsDocumentPdfConfig.stripUnselectedAlpha),
36
+ borderRadius: PsMobileControlConfig.controlRadius,
37
+ borderWidth: PsDocumentPdfConfig.stripSelectedBorder,
38
+ height: PsDocumentPdfConfig.stripHeight,
39
+ justifyContent: 'center',
40
+ overflow: 'hidden',
41
+ width: PsDocumentPdfConfig.stripTileWidth,
42
+ }, testID: `ps-document-strip-${position}`, children: entry.item.kind === PsDocumentKind.Image && entry.item.source !== null ? (_jsx(Image, { resizeMode: 'cover', source: { uri: entry.item.source.uri }, style: { height: '100%', width: '100%' } })) : (_jsx(PsIcon, { color: theme.white, iconKey: PsIconKey.Doc, size: PsDocumentConfig.stripIconSize })) })), showsHorizontalScrollIndicator: false }) }));
43
+ };
@@ -0,0 +1,2 @@
1
+ export * from './ps-document-pdf-cover';
2
+ export * from './ps-document-pdf-cover-props';
@@ -0,0 +1,2 @@
1
+ export * from './ps-document-pdf-cover';
2
+ export * from './ps-document-pdf-cover-props';
@@ -0,0 +1,6 @@
1
+ import type { PsDocumentItem } from '../../interfaces/ps-document-item';
2
+ import type { PsDocumentLabels } from '../../interfaces/ps-document-labels';
3
+ export interface PsDocumentPdfCoverProps {
4
+ item: PsDocumentItem;
5
+ labels: PsDocumentLabels;
6
+ }
@@ -0,0 +1,2 @@
1
+ import type { PsDocumentPdfCoverProps } from './ps-document-pdf-cover-props';
2
+ export declare const PsDocumentPdfCover: ({ item, labels }: PsDocumentPdfCoverProps) => import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PsIconKey } from '@pallasoft/ps-icons';
3
+ import { Image, View } from 'react-native';
4
+ import { PsDocumentLoadStatus } from '../../constants/ps-document-load-status';
5
+ import { usePsDocumentPdfCover } from '../../hooks/use-ps-document-pdf-cover';
6
+ import { PsDocumentMessage } from '../ps-document-message/ps-document-message';
7
+ import { PsDocumentUnsupported } from '../ps-document-unsupported/ps-document-unsupported';
8
+ import { PsSpinner } from '../ps-spinner/ps-spinner';
9
+ export const PsDocumentPdfCover = ({ item, labels }) => {
10
+ const { cover, retry, status } = usePsDocumentPdfCover(item);
11
+ if (status === PsDocumentLoadStatus.Ready && cover !== null)
12
+ return (_jsx(Image, { accessibilityLabel: item.name, resizeMode: 'contain', source: { uri: cover.uri }, style: { flex: 1 } }));
13
+ if (status === PsDocumentLoadStatus.Loading)
14
+ return (_jsx(View, { style: { alignItems: 'center', flex: 1, justifyContent: 'center' }, children: _jsx(PsSpinner, {}) }));
15
+ if (status === PsDocumentLoadStatus.Failed)
16
+ return (_jsx(PsDocumentMessage, { actionLabel: labels.retry, description: item.name, iconKey: PsIconKey.Warning, onAction: retry, title: labels.loadFailed }));
17
+ return _jsx(PsDocumentUnsupported, { item: item, labels: labels });
18
+ };
@@ -1,9 +1,8 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import { PsIconKey } from '@pallasoft/ps-icons';
4
- import { Image, Pressable, View } from 'react-native';
4
+ import { Pressable, View } from 'react-native';
5
5
  import { PsDocumentConfig } from '../../constants/ps-document-config';
6
- import { PsDocumentKind } from '../../constants/ps-document-kind';
7
6
  import { PsSkeletonShape } from '../../constants/ps-skeleton-shape';
8
7
  import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
9
8
  import { PsDocumentPagerService } from '../../services/ps-document-pager-service';
@@ -11,10 +10,10 @@ import { PsMobileColorService } from '../../services/ps-mobile-color-service';
11
10
  import { PsBadge } from '../ps-badge/ps-badge';
12
11
  import { PsCard } from '../ps-card/ps-card';
13
12
  import { PsDocumentMessage } from '../ps-document-message/ps-document-message';
13
+ import { PsDocumentPreviewFace } from '../ps-document-preview-face/ps-document-preview-face';
14
14
  import { PsDocumentViewer } from '../ps-document-viewer/ps-document-viewer';
15
15
  import { PsIconButton } from '../ps-icon-button/ps-icon-button';
16
16
  import { PsSkeleton } from '../ps-skeleton/ps-skeleton';
17
- import { PsText } from '../ps-text/ps-text';
18
17
  export const PsDocumentPreview = ({ aspectRatio = PsDocumentConfig.previewAspectRatio, hasError = false, isLoading = false, items, labels, onRetry, }) => {
19
18
  const theme = usePsMobileTheme();
20
19
  const [size, setSize] = useState({ height: 0, width: 0 });
@@ -25,7 +24,7 @@ export const PsDocumentPreview = ({ aspectRatio = PsDocumentConfig.previewAspect
25
24
  setOpenCount((current) => current + 1);
26
25
  setIsOpen(true);
27
26
  };
28
- return (_jsx(PsCard, { padding: 'none', children: _jsx(View, { onLayout: (event) => setSize(event.nativeEvent.layout), style: { aspectRatio, width: '100%' }, testID: 'ps-document-preview', children: isLoading ? (_jsx(PsSkeleton, { height: size.height, shape: PsSkeletonShape.Block })) : hasError ? (_jsx(PsDocumentMessage, { actionLabel: onRetry === undefined ? undefined : labels.retry, iconKey: PsIconKey.Warning, onAction: onRetry, title: labels.error })) : first === undefined ? (_jsx(PsDocumentMessage, { iconKey: PsIconKey.Image, title: labels.empty })) : (_jsxs(_Fragment, { children: [_jsx(Pressable, { accessibilityLabel: labels.expand, accessibilityRole: 'button', onPress: open, style: { backgroundColor: theme.background, flex: 1 }, children: first.kind === PsDocumentKind.Image && first.source !== null ? (_jsx(Image, { accessibilityLabel: first.name, resizeMode: 'contain', source: { headers: first.source.headers, uri: first.source.uri }, style: { flex: 1 } })) : first.kind === PsDocumentKind.Text && first.text !== null ? (_jsx(View, { style: { flex: 1, padding: PsDocumentConfig.previewPadding }, children: _jsx(PsText, { numberOfLines: PsDocumentConfig.previewTextLines, children: first.text }) })) : (_jsx(PsDocumentMessage, { description: first.name, iconKey: PsIconKey.Doc, title: labels.unsupported })) }), _jsx(View, { style: {
27
+ return (_jsx(PsCard, { padding: 'none', children: _jsx(View, { onLayout: (event) => setSize(event.nativeEvent.layout), style: { aspectRatio, width: '100%' }, testID: 'ps-document-preview', children: isLoading ? (_jsx(PsSkeleton, { height: size.height, shape: PsSkeletonShape.Block })) : hasError ? (_jsx(PsDocumentMessage, { actionLabel: onRetry === undefined ? undefined : labels.retry, iconKey: PsIconKey.Warning, onAction: onRetry, title: labels.error })) : first === undefined ? (_jsx(PsDocumentMessage, { iconKey: PsIconKey.Image, title: labels.empty })) : (_jsxs(_Fragment, { children: [_jsx(Pressable, { accessibilityLabel: labels.expand, accessibilityRole: 'button', onPress: open, style: { backgroundColor: theme.background, flex: 1 }, children: _jsx(PsDocumentPreviewFace, { item: first, labels: labels }) }), _jsx(View, { style: {
29
28
  position: 'absolute',
30
29
  right: PsDocumentConfig.expandInset,
31
30
  top: PsDocumentConfig.expandInset,
@@ -0,0 +1,2 @@
1
+ export * from './ps-document-preview-face';
2
+ export * from './ps-document-preview-face-props';