@pallasoft/ps-mobile-components 1.1.0 → 1.3.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 +4 -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 +1 -1
- 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-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-chip/ps-chip.js +1 -1
- package/dist/components/ps-count-badge/index.d.ts +2 -0
- package/dist/components/ps-count-badge/index.js +2 -0
- package/dist/components/ps-count-badge/ps-count-badge-props.d.ts +5 -0
- package/dist/components/ps-count-badge/ps-count-badge-props.js +1 -0
- package/dist/components/ps-count-badge/ps-count-badge.d.ts +2 -0
- package/dist/components/ps-count-badge/ps-count-badge.js +25 -0
- 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-list/index.d.ts +2 -0
- package/dist/components/ps-list/index.js +2 -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.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-props.d.ts +11 -0
- package/dist/components/ps-list/ps-list-link-row-props.js +1 -0
- package/dist/components/ps-list/ps-list-link-row-skeleton.d.ts +1 -0
- package/dist/components/ps-list/ps-list-link-row-skeleton.js +14 -0
- package/dist/components/ps-list/ps-list-link-row.d.ts +2 -0
- package/dist/components/ps-list/ps-list-link-row.js +40 -0
- package/dist/components/ps-list/ps-list-props.d.ts +3 -1
- package/dist/components/ps-list/ps-list-row-body.js +2 -4
- package/dist/components/ps-list/ps-list-row.d.ts +1 -1
- package/dist/components/ps-list/ps-list-row.js +3 -2
- package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider-props.d.ts +4 -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 +20 -10
- package/dist/components/ps-native-menu/ps-native-menu.android.js +1 -1
- 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 +33 -0
- 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-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-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-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.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-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.ios.js +9 -2
- 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 +1 -1
- package/dist/components/ps-text-link/ps-text-link.js +1 -1
- 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-biometry-kind.d.ts +7 -0
- package/dist/constants/ps-biometry-kind.js +6 -0
- package/dist/constants/ps-count-badge-config.d.ts +6 -0
- package/dist/constants/ps-count-badge-config.js +6 -0
- package/dist/constants/ps-layout-config.d.ts +4 -0
- package/dist/constants/ps-layout-config.js +4 -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-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-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/contexts/ps-tab-bar-context.d.ts +2 -0
- package/dist/contexts/ps-tab-bar-context.js +5 -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-menu-tiles.d.ts +4 -0
- package/dist/hooks/use-ps-menu-tiles.js +8 -0
- package/dist/hooks/use-ps-tab-bar.d.ts +2 -0
- package/dist/hooks/use-ps-tab-bar.js +3 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +19 -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-menu-item.d.ts +2 -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 +1 -1
- package/dist/interfaces/ps-mobile-theme.d.ts +32 -0
- 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-tab-bar-context-data.d.ts +4 -0
- package/dist/interfaces/ps-tab-bar-context-data.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/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-button-style-service.js +2 -2
- 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-count-badge-service.d.ts +3 -0
- package/dist/services/ps-count-badge-service.js +6 -0
- package/dist/services/ps-list-row-style-service.d.ts +4 -0
- package/dist/services/ps-list-row-style-service.js +11 -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 +0 -2
- package/dist/services/ps-mobile-theme-service.js +64 -94
- 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-selection-service.d.ts +5 -0
- package/dist/services/ps-selection-service.js +13 -0
- package/dist/services/ps-sheet-service.d.ts +5 -0
- package/dist/services/ps-sheet-service.js +11 -0
- package/dist/services/ps-text-service.js +4 -4
- package/jest-setup.js +71 -0
- package/package.json +14 -2
|
@@ -1,104 +1,74 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PallasoftThemeService } from '@pallasoft/ps-design-system';
|
|
2
2
|
import { PsFontConfig } from '../constants/ps-font-config';
|
|
3
|
-
import { PsMobileControlConfig } from '../constants/ps-mobile-control-config';
|
|
4
|
-
import { PsMobileColorService } from './ps-mobile-color-service';
|
|
5
3
|
export class PsMobileThemeService {
|
|
6
4
|
static create({ chart, hasHaptics, isDark, isReduceMotion, primary, primaryContrast, secondary, }) {
|
|
7
|
-
const
|
|
8
|
-
? PsMobileThemeService.dark(primary, primaryContrast)
|
|
9
|
-
: PsMobileThemeService.light(primary, primaryContrast);
|
|
10
|
-
const base = {
|
|
11
|
-
...scheme,
|
|
12
|
-
chart: chart === undefined || chart.length === 0 ? scheme.chart : chart,
|
|
13
|
-
hasHaptics: hasHaptics === undefined ? true : hasHaptics,
|
|
14
|
-
isReduceMotion: isReduceMotion === undefined ? false : isReduceMotion,
|
|
15
|
-
};
|
|
16
|
-
const fallback = isDark ? PallasoftDarkColor.Accent : PallasoftColor.Accent;
|
|
17
|
-
const palette = PallasoftBrandColorService.palette(secondary === undefined ? fallback : secondary);
|
|
18
|
-
if (palette === null)
|
|
19
|
-
return base;
|
|
20
|
-
return {
|
|
21
|
-
...base,
|
|
22
|
-
secondary: palette.primary,
|
|
23
|
-
secondaryContrast: palette.contrast,
|
|
24
|
-
secondarySoft: isDark ? palette.softDark : palette.softLight,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
static light(primary, primaryContrast) {
|
|
28
|
-
return {
|
|
29
|
-
accent: PallasoftColor.Accent,
|
|
30
|
-
accentSoft: PallasoftColor.Mist,
|
|
31
|
-
background: PallasoftColor.Background,
|
|
32
|
-
chart: [
|
|
33
|
-
PallasoftChartColor.Chart1,
|
|
34
|
-
PallasoftChartColor.Chart2,
|
|
35
|
-
PallasoftChartColor.Chart3,
|
|
36
|
-
PallasoftChartColor.Chart4,
|
|
37
|
-
PallasoftChartColor.Chart5,
|
|
38
|
-
],
|
|
39
|
-
danger: PallasoftColor.Danger,
|
|
40
|
-
dangerSoft: PallasoftColor.DangerSoft,
|
|
41
|
-
fonts: PsFontConfig,
|
|
42
|
-
ink: PallasoftColor.Ink,
|
|
43
|
-
hasHaptics: true,
|
|
44
|
-
isDark: false,
|
|
45
|
-
isReduceMotion: false,
|
|
46
|
-
line: PallasoftColor.Line,
|
|
47
|
-
muted: PallasoftColor.Muted,
|
|
48
|
-
overlay: PsMobileColorService.withAlpha(PallasoftColor.Ink, PsMobileControlConfig.overlayAlpha),
|
|
5
|
+
const tokens = PallasoftThemeService.build({
|
|
49
6
|
primary,
|
|
50
7
|
primaryContrast,
|
|
51
|
-
|
|
52
|
-
secondary
|
|
53
|
-
|
|
54
|
-
secondarySoft: PallasoftColor.Mist,
|
|
55
|
-
skeletonBase: PsMobileColorService.withAlpha(PallasoftColor.Ink, PsMobileControlConfig.skeletonBaseAlpha.light),
|
|
56
|
-
skeletonSweep: PsMobileColorService.withAlpha(PallasoftColor.Ink, PsMobileControlConfig.skeletonSweepAlpha.light),
|
|
57
|
-
success: PallasoftColor.Success,
|
|
58
|
-
successSoft: PallasoftColor.SuccessSoft,
|
|
59
|
-
surface: PallasoftColor.White,
|
|
60
|
-
warning: PallasoftColor.Warning,
|
|
61
|
-
warningSoft: PallasoftColor.WarningSoft,
|
|
62
|
-
white: PallasoftColor.White,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
static dark(primary, primaryContrast) {
|
|
66
|
-
const alpha = PsMobileControlConfig.softAlphaDark;
|
|
8
|
+
scheme: isDark ? 'dark' : 'light',
|
|
9
|
+
secondary,
|
|
10
|
+
});
|
|
67
11
|
return {
|
|
68
|
-
accent:
|
|
69
|
-
accentSoft:
|
|
70
|
-
background:
|
|
71
|
-
chart:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
PallasoftDarkChartColor.Chart4,
|
|
76
|
-
PallasoftDarkChartColor.Chart5,
|
|
77
|
-
],
|
|
78
|
-
danger: PallasoftDarkColor.Danger,
|
|
79
|
-
dangerSoft: PallasoftDarkColor.DangerSoft,
|
|
12
|
+
accent: tokens.accent,
|
|
13
|
+
accentSoft: tokens.accentSoft,
|
|
14
|
+
background: tokens.background,
|
|
15
|
+
chart: chart === undefined || chart.length === 0 ? tokens.chart : chart,
|
|
16
|
+
danger: tokens.danger,
|
|
17
|
+
dangerSoft: tokens.dangerSoft,
|
|
18
|
+
dangerText: tokens.dangerText,
|
|
80
19
|
fonts: PsFontConfig,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
20
|
+
hasHaptics: hasHaptics === undefined ? true : hasHaptics,
|
|
21
|
+
info: tokens.info,
|
|
22
|
+
infoSoft: tokens.infoSoft,
|
|
23
|
+
infoText: tokens.infoText,
|
|
24
|
+
ink: tokens.ink,
|
|
25
|
+
isDark,
|
|
26
|
+
isReduceMotion: isReduceMotion === undefined ? false : isReduceMotion,
|
|
27
|
+
line: tokens.line,
|
|
28
|
+
muted: tokens.muted,
|
|
29
|
+
overlay: tokens.overlay,
|
|
30
|
+
primary: tokens.primary,
|
|
31
|
+
primary100: tokens.primary100,
|
|
32
|
+
primary200: tokens.primary200,
|
|
33
|
+
primary300: tokens.primary300,
|
|
34
|
+
primary400: tokens.primary400,
|
|
35
|
+
primary50: tokens.primary50,
|
|
36
|
+
primary500: tokens.primary500,
|
|
37
|
+
primary600: tokens.primary600,
|
|
38
|
+
primary700: tokens.primary700,
|
|
39
|
+
primary800: tokens.primary800,
|
|
40
|
+
primary900: tokens.primary900,
|
|
41
|
+
primaryContrast: tokens.primaryContrast,
|
|
42
|
+
primaryPressed: tokens.primaryPressed,
|
|
43
|
+
primarySoft: tokens.primarySoft,
|
|
44
|
+
primarySoftStrong: tokens.primarySoftStrong,
|
|
45
|
+
primaryText: tokens.primaryText,
|
|
46
|
+
secondary: tokens.secondary,
|
|
47
|
+
secondary100: tokens.secondary100,
|
|
48
|
+
secondary200: tokens.secondary200,
|
|
49
|
+
secondary300: tokens.secondary300,
|
|
50
|
+
secondary400: tokens.secondary400,
|
|
51
|
+
secondary50: tokens.secondary50,
|
|
52
|
+
secondary500: tokens.secondary500,
|
|
53
|
+
secondary600: tokens.secondary600,
|
|
54
|
+
secondary700: tokens.secondary700,
|
|
55
|
+
secondary800: tokens.secondary800,
|
|
56
|
+
secondary900: tokens.secondary900,
|
|
57
|
+
secondaryContrast: tokens.secondaryContrast,
|
|
58
|
+
secondaryPressed: tokens.secondaryPressed,
|
|
59
|
+
secondarySoft: tokens.secondarySoft,
|
|
60
|
+
secondarySoftStrong: tokens.secondarySoftStrong,
|
|
61
|
+
secondaryText: tokens.secondaryText,
|
|
62
|
+
skeletonBase: tokens.skeletonBase,
|
|
63
|
+
skeletonSweep: tokens.skeletonSweep,
|
|
64
|
+
success: tokens.success,
|
|
65
|
+
successSoft: tokens.successSoft,
|
|
66
|
+
successText: tokens.successText,
|
|
67
|
+
surface: tokens.surface,
|
|
68
|
+
warning: tokens.warning,
|
|
69
|
+
warningSoft: tokens.warningSoft,
|
|
70
|
+
warningText: tokens.warningText,
|
|
71
|
+
white: tokens.white,
|
|
102
72
|
};
|
|
103
73
|
}
|
|
104
74
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PsOptionPickerOption } from '../components/ps-option-picker/ps-option-picker-props';
|
|
2
|
+
export interface PsOptionPickerResult {
|
|
3
|
+
hasMore: boolean;
|
|
4
|
+
options: PsOptionPickerOption[];
|
|
5
|
+
}
|
|
6
|
+
export declare class PsOptionPickerService {
|
|
7
|
+
static visible(options: PsOptionPickerOption[], search: string, limit: number): PsOptionPickerResult;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class PsOptionPickerService {
|
|
2
|
+
static visible(options, search, limit) {
|
|
3
|
+
const needle = search.trim().toLowerCase();
|
|
4
|
+
const matches = needle === ''
|
|
5
|
+
? options
|
|
6
|
+
: options.filter((option) => option.label.toLowerCase().includes(needle) ||
|
|
7
|
+
(option.subtitle !== undefined && option.subtitle.toLowerCase().includes(needle)));
|
|
8
|
+
return { hasMore: matches.length > limit, options: matches.slice(0, limit) };
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class PsSelectionService {
|
|
2
|
+
static toggle(selectedIds, id) {
|
|
3
|
+
return selectedIds.includes(id)
|
|
4
|
+
? selectedIds.filter((selectedId) => selectedId !== id)
|
|
5
|
+
: [...selectedIds, id];
|
|
6
|
+
}
|
|
7
|
+
static isAll(selectableIds, selectedIds) {
|
|
8
|
+
return selectableIds.length > 0 && selectableIds.every((id) => selectedIds.includes(id));
|
|
9
|
+
}
|
|
10
|
+
static toggleAll(selectableIds, selectedIds) {
|
|
11
|
+
return PsSelectionService.isAll(selectableIds, selectedIds) ? [] : [...selectableIds];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native';
|
|
1
2
|
import type { PsSheetAction } from '../interfaces/ps-sheet-action';
|
|
3
|
+
import type { PsSheetLeadingKind } from '../interfaces/ps-sheet-leading-kind';
|
|
2
4
|
export declare class PsSheetService {
|
|
3
5
|
static maxHeight(windowHeight: number): number;
|
|
4
6
|
static bottomPadding(isFloating: boolean, bottomInset: number): number;
|
|
@@ -6,5 +8,8 @@ export declare class PsSheetService {
|
|
|
6
8
|
static closeAction(label: string | undefined, onPress: () => void): PsSheetAction | undefined;
|
|
7
9
|
static isActionInactive(action: PsSheetAction): boolean;
|
|
8
10
|
static actionOpacity(action: PsSheetAction, isPressed: boolean): number;
|
|
11
|
+
static trailing(action: PsSheetAction | null | undefined, closeLabel: string | undefined, onClose: () => void): PsSheetAction | undefined;
|
|
12
|
+
static leadingIconStyle(kind: PsSheetLeadingKind): ViewStyle;
|
|
13
|
+
static grownHeight(previous: number, measured: number, isOpen: boolean): number;
|
|
9
14
|
static shouldClose(isPresented: boolean, isOpen: boolean, isDismissBlocked: boolean): boolean;
|
|
10
15
|
}
|
|
@@ -22,6 +22,17 @@ export class PsSheetService {
|
|
|
22
22
|
}
|
|
23
23
|
return isPressed ? PsSheetConfig.pressedOpacity : 1;
|
|
24
24
|
}
|
|
25
|
+
static trailing(action, closeLabel, onClose) {
|
|
26
|
+
if (action === null)
|
|
27
|
+
return undefined;
|
|
28
|
+
return action === undefined ? PsSheetService.closeAction(closeLabel, onClose) : action;
|
|
29
|
+
}
|
|
30
|
+
static leadingIconStyle(kind) {
|
|
31
|
+
return kind === 'back' ? { transform: [{ scaleX: -1 }] } : {};
|
|
32
|
+
}
|
|
33
|
+
static grownHeight(previous, measured, isOpen) {
|
|
34
|
+
return isOpen ? Math.max(previous, measured) : measured;
|
|
35
|
+
}
|
|
25
36
|
static shouldClose(isPresented, isOpen, isDismissBlocked) {
|
|
26
37
|
return !isPresented && isOpen && !isDismissBlocked;
|
|
27
38
|
}
|
|
@@ -3,15 +3,15 @@ export class PsTextService {
|
|
|
3
3
|
static color(tone, theme) {
|
|
4
4
|
switch (tone) {
|
|
5
5
|
case 'danger':
|
|
6
|
-
return theme.
|
|
6
|
+
return theme.dangerText;
|
|
7
7
|
case 'muted':
|
|
8
8
|
return theme.muted;
|
|
9
9
|
case 'primary':
|
|
10
|
-
return theme.
|
|
10
|
+
return theme.primaryText;
|
|
11
11
|
case 'success':
|
|
12
|
-
return theme.
|
|
12
|
+
return theme.successText;
|
|
13
13
|
case 'warning':
|
|
14
|
-
return theme.
|
|
14
|
+
return theme.warningText;
|
|
15
15
|
case 'white':
|
|
16
16
|
return theme.white;
|
|
17
17
|
default:
|
package/jest-setup.js
CHANGED
|
@@ -16,6 +16,8 @@ jest.mock('react-native-reanimated', () => {
|
|
|
16
16
|
interpolate: (value, input, output) => output[0],
|
|
17
17
|
withRepeat: (value) => value,
|
|
18
18
|
FadeInUp: builder,
|
|
19
|
+
SlideInLeft: builder,
|
|
20
|
+
SlideInRight: builder,
|
|
19
21
|
FadeOutUp: builder,
|
|
20
22
|
useAnimatedProps: (props) => props(),
|
|
21
23
|
useAnimatedStyle: (style) => style(),
|
|
@@ -57,3 +59,72 @@ jest.mock('@react-native-menu/menu', () => {
|
|
|
57
59
|
React.createElement(View, { actions, onPressAction, testID }, children),
|
|
58
60
|
};
|
|
59
61
|
});
|
|
62
|
+
|
|
63
|
+
jest.mock('expo-router', () => {
|
|
64
|
+
const React = require('react');
|
|
65
|
+
const { View } = require('react-native');
|
|
66
|
+
const Link = ({ children, href }) =>
|
|
67
|
+
React.createElement(View, { href, testID: 'ps-list-link' }, children);
|
|
68
|
+
const Pass = ({ children }) => React.createElement(React.Fragment, null, children);
|
|
69
|
+
const MenuAction = ({ onPress, title }) =>
|
|
70
|
+
React.createElement(View, {
|
|
71
|
+
accessibilityLabel: title,
|
|
72
|
+
onPress,
|
|
73
|
+
testID: 'ps-list-link-action',
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
Link.Trigger = Pass;
|
|
77
|
+
Link.Preview = ({ children, style }) =>
|
|
78
|
+
children === undefined
|
|
79
|
+
? null
|
|
80
|
+
: React.createElement(View, { style, testID: 'ps-list-link-preview' }, children);
|
|
81
|
+
const Menu = ({ children }) =>
|
|
82
|
+
React.createElement(
|
|
83
|
+
React.Fragment,
|
|
84
|
+
null,
|
|
85
|
+
React.Children.toArray(children).filter(
|
|
86
|
+
(child) =>
|
|
87
|
+
React.isValidElement(child) && (child.type === MenuAction || child.type === Menu)
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
Link.Menu = Menu;
|
|
92
|
+
Link.MenuAction = MenuAction;
|
|
93
|
+
|
|
94
|
+
const Stack = () => null;
|
|
95
|
+
|
|
96
|
+
Stack.Screen = ({ options }) =>
|
|
97
|
+
React.createElement(View, {
|
|
98
|
+
accessibilityLabel: options.title,
|
|
99
|
+
headerBackVisible: options.headerBackVisible,
|
|
100
|
+
testID: 'stack-screen',
|
|
101
|
+
});
|
|
102
|
+
Stack.Toolbar = ({ children, placement }) =>
|
|
103
|
+
React.createElement(View, { testID: `stack-toolbar-${placement}` }, children);
|
|
104
|
+
Stack.Toolbar.Button = ({ children, disabled, onPress }) =>
|
|
105
|
+
React.createElement(View, { accessibilityLabel: children, disabled, onPress });
|
|
106
|
+
Stack.Toolbar.Spacer = () => null;
|
|
107
|
+
|
|
108
|
+
return { __esModule: true, Link, Stack };
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
jest.mock(
|
|
112
|
+
'expo-local-authentication',
|
|
113
|
+
() => ({
|
|
114
|
+
__esModule: true,
|
|
115
|
+
authenticateAsync: jest.fn(() => Promise.resolve({ success: true })),
|
|
116
|
+
getEnrolledLevelAsync: jest.fn(() => Promise.resolve(3)),
|
|
117
|
+
supportedAuthenticationTypesAsync: jest.fn(() => Promise.resolve([2])),
|
|
118
|
+
}),
|
|
119
|
+
{ virtual: true }
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
jest.mock('expo', () => {
|
|
123
|
+
const actual = jest.requireActual('expo');
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
...actual,
|
|
127
|
+
requireOptionalNativeModule: (name) =>
|
|
128
|
+
name === 'ExpoLocalAuthentication' ? {} : actual.requireOptionalNativeModule(name),
|
|
129
|
+
};
|
|
130
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pallasoft/ps-mobile-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Native iOS (SwiftUI) and Android (Jetpack Compose) Ps components for Pallasoft mobile apps",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"test": "jest"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@pallasoft/ps-design-system": "^1.
|
|
37
|
+
"@pallasoft/ps-design-system": "^1.18.0",
|
|
38
38
|
"@pallasoft/ps-icons": "^1.11.0",
|
|
39
39
|
"@pallasoft/ps-utilities": "^2.27.0"
|
|
40
40
|
},
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
"expo": "~58.0.0",
|
|
45
45
|
"expo-haptics": "~58.0.7",
|
|
46
46
|
"expo-linear-gradient": "~58.0.3",
|
|
47
|
+
"expo-local-authentication": "~58.0.0",
|
|
48
|
+
"expo-router": "~58.0.0",
|
|
47
49
|
"react": "^19.3.0",
|
|
48
50
|
"react-native": "~0.88.0",
|
|
49
51
|
"react-native-document-scanner-plugin": "^2.0.4",
|
|
@@ -55,6 +57,12 @@
|
|
|
55
57
|
"peerDependenciesMeta": {
|
|
56
58
|
"react-native-document-scanner-plugin": {
|
|
57
59
|
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"expo-local-authentication": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"expo-router": {
|
|
65
|
+
"optional": true
|
|
58
66
|
}
|
|
59
67
|
},
|
|
60
68
|
"devDependencies": {
|
|
@@ -67,6 +75,7 @@
|
|
|
67
75
|
"@expo/ui": "~58.0.21",
|
|
68
76
|
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
|
69
77
|
"@react-native-menu/menu": "^2.0.0",
|
|
78
|
+
"@react-native/jest-preset": "^0.88.0",
|
|
70
79
|
"@semantic-release/changelog": "^6.0.3",
|
|
71
80
|
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
72
81
|
"@semantic-release/git": "^10.0.1",
|
|
@@ -88,6 +97,9 @@
|
|
|
88
97
|
"expo": "~58.0.16",
|
|
89
98
|
"expo-haptics": "~58.0.7",
|
|
90
99
|
"expo-linear-gradient": "~58.0.3",
|
|
100
|
+
"expo-local-authentication": "~58.0.2",
|
|
101
|
+
"expo-router": "~58.0.24",
|
|
102
|
+
"hono": "^4.13.13",
|
|
91
103
|
"husky": "^9.1.7",
|
|
92
104
|
"jest": "^30.5.2",
|
|
93
105
|
"jest-expo": "~58.0.11",
|