@propbinder/mobile-design 0.0.1 → 0.0.2

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 (123) hide show
  1. package/ng-package.json +7 -0
  2. package/package.json +12 -39
  3. package/src/animations/page-transitions.ts +86 -0
  4. package/src/assets/fonts/Brockmann-Bold.otf +0 -0
  5. package/src/assets/fonts/Brockmann-BoldItalic.otf +0 -0
  6. package/src/assets/fonts/Brockmann-Medium.otf +0 -0
  7. package/src/assets/fonts/Brockmann-MediumItalic.otf +0 -0
  8. package/src/assets/fonts/Brockmann-Regular.otf +0 -0
  9. package/src/assets/fonts/Brockmann-RegularItalic.otf +0 -0
  10. package/src/assets/fonts/Brockmann-SemiBold.otf +0 -0
  11. package/src/assets/fonts/Brockmann-SemiBoldItalic.otf +0 -0
  12. package/src/assets/fonts/Brockmann_desktop_license.pdf +0 -0
  13. package/src/assets/fonts/brockmann-medium-webfont.woff2 +0 -0
  14. package/src/assets/fonts/brockmann-regular-webfont.woff2 +0 -0
  15. package/src/assets/fonts/brockmann-semibold-webfont.woff2 +0 -0
  16. package/src/components/action-list-item/ds-mobile-action-list-item.ts +83 -0
  17. package/src/components/action-list-item/index.ts +2 -0
  18. package/src/components/app-layout/ds-mobile-app-layout.css +343 -0
  19. package/src/components/app-layout/ds-mobile-app-layout.ts +271 -0
  20. package/src/components/app-layout/index.ts +2 -0
  21. package/src/components/avatar-with-badge/ds-avatar-with-badge.ts +130 -0
  22. package/src/components/avatar-with-badge/index.ts +2 -0
  23. package/src/components/bottom-sheet/ds-mobile-actions-bottom-sheet.ts +273 -0
  24. package/src/components/bottom-sheet/ds-mobile-bottom-sheet.css +110 -0
  25. package/src/components/bottom-sheet/ds-mobile-bottom-sheet.service.ts +167 -0
  26. package/src/components/bottom-sheet/ds-mobile-post-create-bottom-sheet.ts +656 -0
  27. package/src/components/bottom-sheet/index.ts +3 -0
  28. package/src/components/comment/ds-mobile-comment.ts +516 -0
  29. package/src/components/comment/index.ts +2 -0
  30. package/src/components/contact-list-item/ds-mobile-contact-list-item.ts +182 -0
  31. package/src/components/contact-list-item/index.ts +2 -0
  32. package/src/components/content/ds-mobile-content.ts +158 -0
  33. package/src/components/content/index.ts +2 -0
  34. package/src/components/ds-mobile-tabs.css +372 -0
  35. package/src/components/ds-mobile-tabs.ts +217 -0
  36. package/src/components/file-attachment/ds-mobile-file-attachment.ts +164 -0
  37. package/src/components/file-attachment/index.ts +2 -0
  38. package/src/components/handbook-detail-modal/ds-mobile-handbook-detail-modal.service.ts +98 -0
  39. package/src/components/handbook-detail-modal/ds-mobile-handbook-detail-modal.ts +514 -0
  40. package/src/components/handbook-detail-modal/index.ts +3 -0
  41. package/src/components/handbook-folder/ds-mobile-handbook-folder-mini.ts +130 -0
  42. package/src/components/handbook-folder/ds-mobile-handbook-folder.ts +444 -0
  43. package/src/components/handbook-folder/index.ts +4 -0
  44. package/src/components/header-content/ds-mobile-header-content.ts +211 -0
  45. package/src/components/header-content/index.ts +2 -0
  46. package/src/components/index.ts +45 -0
  47. package/src/components/inline-photo/ds-mobile-inline-photo.ts +269 -0
  48. package/src/components/inline-photo/index.ts +1 -0
  49. package/src/components/interactive-list-item-inquiry/ds-mobile-interactive-list-item-inquiry.css +60 -0
  50. package/src/components/interactive-list-item-inquiry/ds-mobile-interactive-list-item-inquiry.ts +280 -0
  51. package/src/components/interactive-list-item-inquiry/index.ts +2 -0
  52. package/src/components/interactive-list-item-message/ds-mobile-interactive-list-item-message.ts +197 -0
  53. package/src/components/interactive-list-item-message/index.ts +2 -0
  54. package/src/components/interactive-list-item-post/ds-mobile-interactive-list-item-post.css +70 -0
  55. package/src/components/interactive-list-item-post/ds-mobile-interactive-list-item-post.ts +594 -0
  56. package/src/components/interactive-list-item-post/ds-mobile-post-pdf-attachment.ts +124 -0
  57. package/src/components/interactive-list-item-post/index.ts +13 -0
  58. package/src/components/lightbox/ds-mobile-lightbox-footer.ts +331 -0
  59. package/src/components/lightbox/ds-mobile-lightbox-header.ts +173 -0
  60. package/src/components/lightbox/ds-mobile-lightbox-image.ts +464 -0
  61. package/src/components/lightbox/ds-mobile-lightbox-pdf.css +375 -0
  62. package/src/components/lightbox/ds-mobile-lightbox-pdf.ts +374 -0
  63. package/src/components/lightbox/ds-mobile-lightbox.css +587 -0
  64. package/src/components/lightbox/ds-mobile-lightbox.service.ts +293 -0
  65. package/src/components/lightbox/ds-mobile-lightbox.ts +529 -0
  66. package/src/components/lightbox/index.ts +22 -0
  67. package/src/components/list-item/ds-mobile-list-item.ts +499 -0
  68. package/src/components/list-item/index.ts +2 -0
  69. package/src/components/list-item-static/ds-mobile-list-item-static.ts +133 -0
  70. package/src/components/list-item-static/index.ts +2 -0
  71. package/src/components/logo/ds-logo.ts +85 -0
  72. package/src/components/logo/index.ts +2 -0
  73. package/src/components/modal/ds-mobile-modal.css +163 -0
  74. package/src/components/modal/ds-mobile-modal.service.ts +329 -0
  75. package/src/components/modal/index.ts +8 -0
  76. package/src/components/page-details/ds-mobile-page-details.css +285 -0
  77. package/src/components/page-details/ds-mobile-page-details.ts +128 -0
  78. package/src/components/page-details/index.ts +2 -0
  79. package/src/components/page-main/ds-mobile-page-main.css +346 -0
  80. package/src/components/page-main/ds-mobile-page-main.ts +331 -0
  81. package/src/components/page-main/index.ts +2 -0
  82. package/src/components/post-card/ds-mobile-post-card.ts +685 -0
  83. package/src/components/post-card/ds-mobile-post-pdf-attachment.ts +124 -0
  84. package/src/components/post-card/index.ts +11 -0
  85. package/src/components/post-composer/ds-mobile-post-composer.ts +140 -0
  86. package/src/components/post-composer/index.ts +2 -0
  87. package/src/components/post-detail-modal/ds-mobile-post-detail-modal.service.ts +104 -0
  88. package/src/components/post-detail-modal/ds-mobile-post-detail-modal.ts +1273 -0
  89. package/src/components/post-detail-modal/index.ts +9 -0
  90. package/src/components/shared/directives/index.ts +2 -0
  91. package/src/components/shared/directives/long-press.directive.ts +208 -0
  92. package/src/components/shared/index.ts +3 -0
  93. package/src/components/shared/mobile-common.css +94 -0
  94. package/src/components/shared/mobile-page-base.css +315 -0
  95. package/src/components/shared/mobile-page-base.ts +70 -0
  96. package/src/components/swiper/ds-mobile-swiper.ts +123 -0
  97. package/src/components/swiper/index.ts +2 -0
  98. package/src/components/tab-bar/ds-mobile-tab-bar.ts +132 -0
  99. package/src/components/tab-bar/index.ts +2 -0
  100. package/src/components/tabs/ds-mobile-tabs.css +405 -0
  101. package/src/components/tabs/ds-mobile-tabs.ts +204 -0
  102. package/src/components/tabs/index.ts +2 -0
  103. package/src/pages/community.page.ts +768 -0
  104. package/src/pages/handbook.page.ts +298 -0
  105. package/src/pages/home.page.ts +192 -0
  106. package/src/pages/index.ts +9 -0
  107. package/src/pages/inquiries.example.ts +212 -0
  108. package/src/pages/inquiry-detail.example.css +434 -0
  109. package/src/pages/inquiry-detail.example.ts +416 -0
  110. package/src/pages/mobile-tabs-example.component.ts +146 -0
  111. package/src/pages/post-create.page.ts +311 -0
  112. package/src/pages/post-detail.page.ts +295 -0
  113. package/src/pages/whitelabel-demo.page.ts +548 -0
  114. package/src/public-api.ts +5 -0
  115. package/src/services/user.service.ts +35 -0
  116. package/src/services/whitelabel.service.ts +171 -0
  117. package/src/styles/ionic.css +673 -0
  118. package/tsconfig.lib.json +17 -0
  119. package/tsconfig.lib.prod.json +9 -0
  120. package/tsconfig.spec.json +13 -0
  121. package/fesm2022/propbinder-mobile-design.mjs +0 -8294
  122. package/fesm2022/propbinder-mobile-design.mjs.map +0 -1
  123. package/index.d.ts +0 -2860
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Bottom Sheet Modal Styles
3
+ * Based on Ionic 6 bottom sheet presentation
4
+ */
5
+
6
+ /* Base bottom sheet styling */
7
+ .ds-bottom-sheet {
8
+ --border-radius: 16px;
9
+ --box-shadow: 0px -2px 24px rgba(0, 0, 0, 0.12);
10
+ /* Position backdrop to start below header */
11
+ --backdrop-top: 32px;
12
+ --offset-top: 32px;
13
+ --backdrop-opacity: 0.4;
14
+ transition: --backdrop-opacity 0.3s ease;
15
+ /* Position the modal wrapper to start below header */
16
+ /* Default: 32px offset to align with header content */
17
+ top: 32px !important;
18
+ height: calc(100% - 32px) !important;
19
+ }
20
+
21
+ /* Faster animation for instant appearance */
22
+ .ds-bottom-sheet::part(content) {
23
+ transition: transform 150ms cubic-bezier(0.36, 0.66, 0.04, 1) !important;
24
+ }
25
+
26
+ .ds-bottom-sheet::part(backdrop) {
27
+ transition: opacity 150ms ease-out !important;
28
+ }
29
+
30
+ /* On iOS devices with safe area, use safe-area-inset-top to avoid status bar overlap */
31
+ @supports (padding-top: env(safe-area-inset-top)) {
32
+ .ds-bottom-sheet {
33
+ /* Use safe-area-inset-top if larger than 32px, otherwise use 32px */
34
+ /* This ensures we're always below the status bar */
35
+ top: env(safe-area-inset-top, 32px) !important;
36
+ height: calc(100% - env(safe-area-inset-top, 32px)) !important;
37
+ }
38
+ }
39
+
40
+ /* Backdrop blur effect */
41
+ .ds-bottom-sheet--blur {
42
+ --backdrop-opacity: 0.8;
43
+ }
44
+
45
+ .ds-bottom-sheet--blur::part(backdrop) {
46
+ backdrop-filter: blur(8px);
47
+ -webkit-backdrop-filter: blur(8px);
48
+ }
49
+
50
+ /* Custom backdrop styling */
51
+ .ds-bottom-sheet--custom-backdrop::part(backdrop) {
52
+ background: rgba(0, 0, 0, var(--backdrop-opacity, 0.6));
53
+ }
54
+
55
+ /* Backdrop styling */
56
+ .ds-bottom-sheet::part(backdrop) {
57
+ background: rgba(0, 0, 0, var(--backdrop-opacity, 0.6));
58
+ }
59
+
60
+ /* Handle customization */
61
+ .ds-bottom-sheet::part(handle) {
62
+ background: var(--border-color-default);
63
+ width: 36px;
64
+ height: 4px;
65
+ border-radius: 2px;
66
+ margin-top: 4px;
67
+ margin-bottom: 8px;
68
+ }
69
+
70
+ /* Content area styling - Override Ionic's bottom-based positioning */
71
+ .ds-bottom-sheet::part(content) {
72
+ border-radius: var(--border-radius);
73
+ background: var(--color-background-neutral-primary, #ffffff);
74
+ box-shadow: var(--box-shadow);
75
+ position: absolute !important;
76
+ top: 0 !important;
77
+ bottom: 0 !important;
78
+ height: 100% !important;
79
+ max-height: 100% !important;
80
+ }
81
+
82
+ /* Remove border radius when fully expanded */
83
+ @media (min-height: 768px) {
84
+ .ds-bottom-sheet.modal-sheet-expanded::part(content) {
85
+ border-radius: 0;
86
+ }
87
+ }
88
+
89
+
90
+
91
+ /* Ensure content scrolls properly */
92
+ .ds-bottom-sheet ion-content {
93
+ --background: transparent;
94
+ }
95
+
96
+ /* Better mobile experience */
97
+ @media (max-width: 768px) {
98
+ .ds-bottom-sheet::part(content) {
99
+ max-width: 100%;
100
+ }
101
+ }
102
+
103
+ /* Desktop centering */
104
+ @media (min-width: 769px) {
105
+ .ds-bottom-sheet::part(content) {
106
+ max-width: 640px;
107
+ margin: 0 auto;
108
+ }
109
+ }
110
+
@@ -0,0 +1,167 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { ModalController } from '@ionic/angular/standalone';
3
+ import { ComponentRef } from '@angular/core';
4
+
5
+ /**
6
+ * Configuration options for the bottom sheet modal
7
+ */
8
+ export interface BottomSheetOptions {
9
+ /** The component to display in the bottom sheet */
10
+ component: any;
11
+ /** Component props to pass to the modal content */
12
+ componentProps?: { [key: string]: any };
13
+ /** Breakpoints for the bottom sheet (0-1 values representing percentage of screen) */
14
+ breakpoints?: number[];
15
+ /** Initial breakpoint to open the sheet at */
16
+ initialBreakpoint?: number;
17
+ /** Show/hide the drag handle */
18
+ handle?: boolean;
19
+ /** Custom CSS class for styling */
20
+ cssClass?: string | string[];
21
+ /** Whether backdrop dismisses the modal */
22
+ backdropDismiss?: boolean;
23
+ /** Backdrop opacity (0-1) */
24
+ backdropOpacity?: number;
25
+ /** Enable backdrop blur effect */
26
+ backdropBlur?: boolean;
27
+ /** Keyboard close behavior */
28
+ keyboardClose?: boolean;
29
+ /** Auto-height mode: sheet sizes to content instead of using fixed breakpoints */
30
+ autoHeight?: boolean;
31
+ }
32
+
33
+ /**
34
+ * DsMobileBottomSheetService
35
+ *
36
+ * Service for creating and managing Ionic 6 bottom sheet modals.
37
+ * Based on the Ionic blog article: https://ionic.io/blog/5-examples-of-the-new-ionic-6-bottom-sheet-modal
38
+ *
39
+ * Features:
40
+ * - Multiple breakpoints for snap-to positions
41
+ * - Customizable initial height
42
+ * - Optional drag handle
43
+ * - Backdrop blur effect
44
+ * - Custom styling support
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * constructor(private bottomSheet: DsMobileBottomSheetService) {}
49
+ *
50
+ * async openSheet() {
51
+ * const sheet = await this.bottomSheet.create({
52
+ * component: PostCreateComponent,
53
+ * breakpoints: [0, 0.5, 0.9],
54
+ * initialBreakpoint: 0.5,
55
+ * handle: true
56
+ * });
57
+ *
58
+ * const result = await sheet.onWillDismiss();
59
+ * console.log('Sheet dismissed with:', result.data);
60
+ * }
61
+ * ```
62
+ */
63
+ @Injectable({
64
+ providedIn: 'root'
65
+ })
66
+ export class DsMobileBottomSheetService {
67
+ constructor(private modalController: ModalController) {}
68
+
69
+ /**
70
+ * Create and present a bottom sheet modal
71
+ *
72
+ * @param options Configuration options for the bottom sheet
73
+ * @returns Promise that resolves to the modal instance
74
+ */
75
+ async create(options: BottomSheetOptions): Promise<HTMLIonModalElement> {
76
+ const {
77
+ component,
78
+ componentProps = {},
79
+ breakpoints = [0, 0.5, 0.9],
80
+ initialBreakpoint = 0.5,
81
+ handle = true,
82
+ cssClass = '',
83
+ backdropDismiss = true,
84
+ backdropOpacity,
85
+ backdropBlur = false,
86
+ keyboardClose = true,
87
+ autoHeight = false
88
+ } = options;
89
+
90
+ // Build CSS classes array
91
+ const cssClasses = ['ds-bottom-sheet'];
92
+ if (backdropBlur) {
93
+ cssClasses.push('ds-bottom-sheet--blur');
94
+ }
95
+ if (autoHeight) {
96
+ cssClasses.push('auto-height');
97
+ }
98
+ if (typeof cssClass === 'string' && cssClass) {
99
+ cssClasses.push(cssClass);
100
+ } else if (Array.isArray(cssClass)) {
101
+ cssClasses.push(...cssClass);
102
+ }
103
+
104
+ const modal = await this.modalController.create({
105
+ component,
106
+ componentProps,
107
+ breakpoints: autoHeight ? undefined : breakpoints,
108
+ initialBreakpoint: autoHeight ? undefined : initialBreakpoint,
109
+ handle: autoHeight ? false : handle,
110
+ cssClass: cssClasses,
111
+ backdropDismiss,
112
+ keyboardClose,
113
+ showBackdrop: true,
114
+ canDismiss: backdropDismiss,
115
+ // Remove animation delay for instant appearance
116
+ animated: true,
117
+ enterAnimation: undefined, // Use default but we'll customize via CSS
118
+ leaveAnimation: undefined,
119
+ ...(backdropOpacity !== undefined && {
120
+ cssClass: [...cssClasses, 'ds-bottom-sheet--custom-backdrop']
121
+ })
122
+ });
123
+
124
+ // Apply custom backdrop opacity if specified
125
+ if (backdropOpacity !== undefined) {
126
+ modal.style.setProperty('--backdrop-opacity', backdropOpacity.toString());
127
+ }
128
+
129
+ // Add ESC key listener to dismiss the modal
130
+ const escKeyHandler = (event: KeyboardEvent) => {
131
+ if (event.key === 'Escape') {
132
+ modal.dismiss(undefined, 'escape');
133
+ }
134
+ };
135
+
136
+ // Add listener when modal is presented
137
+ modal.addEventListener('ionModalDidPresent', () => {
138
+ document.addEventListener('keydown', escKeyHandler);
139
+ });
140
+
141
+ // Remove listener when modal is dismissed
142
+ modal.addEventListener('ionModalDidDismiss', () => {
143
+ document.removeEventListener('keydown', escKeyHandler);
144
+ });
145
+
146
+ await modal.present();
147
+
148
+ // Don't wait - return immediately so component can try to focus
149
+ // while still in user gesture context
150
+ return modal;
151
+ }
152
+
153
+ /**
154
+ * Dismiss all open modals
155
+ */
156
+ async dismiss(data?: any, role?: string): Promise<boolean> {
157
+ return this.modalController.dismiss(data, role);
158
+ }
159
+
160
+ /**
161
+ * Get the top-most modal overlay
162
+ */
163
+ async getTop(): Promise<HTMLIonModalElement | undefined> {
164
+ return this.modalController.getTop();
165
+ }
166
+ }
167
+