@rdlabo/ionic-theme-ios27 0.1.0-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 (158) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +241 -0
  3. package/dist/css/components/ion-action-sheet.css +1 -0
  4. package/dist/css/components/ion-alert.css +1 -0
  5. package/dist/css/components/ion-button.css +1 -0
  6. package/dist/css/components/ion-card.css +1 -0
  7. package/dist/css/components/ion-content.css +1 -0
  8. package/dist/css/components/ion-datetime.css +1 -0
  9. package/dist/css/components/ion-fab.css +1 -0
  10. package/dist/css/components/ion-inputs.css +1 -0
  11. package/dist/css/components/ion-list.css +1 -0
  12. package/dist/css/components/ion-loading.css +1 -0
  13. package/dist/css/components/ion-menu.css +1 -0
  14. package/dist/css/components/ion-modal.css +1 -0
  15. package/dist/css/components/ion-picker.css +1 -0
  16. package/dist/css/components/ion-popover.css +1 -0
  17. package/dist/css/components/ion-range.css +1 -0
  18. package/dist/css/components/ion-searchbar.css +1 -0
  19. package/dist/css/components/ion-segment.css +1 -0
  20. package/dist/css/components/ion-tabs.css +1 -0
  21. package/dist/css/components/ion-toast.css +1 -0
  22. package/dist/css/components/ion-toggle.css +1 -0
  23. package/dist/css/components/ion-toolbar.css +1 -0
  24. package/dist/css/default-variables.css +1 -0
  25. package/dist/css/ionic-theme-ios26-dark-always.css +1 -0
  26. package/dist/css/ionic-theme-ios26-dark-class.css +1 -0
  27. package/dist/css/ionic-theme-ios26-dark-system.css +1 -0
  28. package/dist/css/ionic-theme-ios26.css +1 -0
  29. package/dist/css/md-ion-list-inset.css +1 -0
  30. package/dist/css/md-remove-ios-class-effect.css +1 -0
  31. package/dist/css/utils/api.css +1 -0
  32. package/dist/css/utils/dark/ion-button.css +1 -0
  33. package/dist/css/utils/dark/ion-fab.css +1 -0
  34. package/dist/css/utils/dark/ion-segment.css +1 -0
  35. package/dist/css/utils/dark/ion-tabs.css +1 -0
  36. package/dist/css/utils/searchable.css +1 -0
  37. package/dist/css/utils/structured-list.css +1 -0
  38. package/dist/css/utils/theme-dark.css +1 -0
  39. package/dist/css/utils/translucent.css +1 -0
  40. package/dist/docs.json +234 -0
  41. package/dist/focus-controller/index.d.ts +6 -0
  42. package/dist/focus-controller/index.d.ts.map +1 -0
  43. package/dist/focus-controller/index.js +62 -0
  44. package/dist/focus-controller /index.d.ts +6 -0
  45. package/dist/focus-controller /index.d.ts.map +1 -0
  46. package/dist/focus-controller /index.js +62 -0
  47. package/dist/index.d.ts +9 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +30 -0
  50. package/dist/popover/animations/ios.enter.d.ts +4 -0
  51. package/dist/popover/animations/ios.enter.d.ts.map +1 -0
  52. package/dist/popover/animations/ios.enter.js +97 -0
  53. package/dist/popover/animations/ios.leave.d.ts +3 -0
  54. package/dist/popover/animations/ios.leave.d.ts.map +1 -0
  55. package/dist/popover/animations/ios.leave.js +60 -0
  56. package/dist/popover/popover-interface.d.ts +38 -0
  57. package/dist/popover/popover-interface.d.ts.map +1 -0
  58. package/dist/popover/popover-interface.js +1 -0
  59. package/dist/popover/utils.d.ts +37 -0
  60. package/dist/popover/utils.d.ts.map +1 -0
  61. package/dist/popover/utils.js +377 -0
  62. package/dist/sheets-of-glass/animations.d.ts +8 -0
  63. package/dist/sheets-of-glass/animations.d.ts.map +1 -0
  64. package/dist/sheets-of-glass/animations.js +97 -0
  65. package/dist/sheets-of-glass/index.d.ts +3 -0
  66. package/dist/sheets-of-glass/index.d.ts.map +1 -0
  67. package/dist/sheets-of-glass/index.js +174 -0
  68. package/dist/sheets-of-glass/interfaces.d.ts +16 -0
  69. package/dist/sheets-of-glass/interfaces.d.ts.map +1 -0
  70. package/dist/sheets-of-glass/interfaces.js +1 -0
  71. package/dist/tab-bar-searchable/animations/enter.d.ts +8 -0
  72. package/dist/tab-bar-searchable/animations/enter.d.ts.map +1 -0
  73. package/dist/tab-bar-searchable/animations/enter.js +73 -0
  74. package/dist/tab-bar-searchable/animations/leave.d.ts +8 -0
  75. package/dist/tab-bar-searchable/animations/leave.d.ts.map +1 -0
  76. package/dist/tab-bar-searchable/animations/leave.js +66 -0
  77. package/dist/tab-bar-searchable/index.d.ts +4 -0
  78. package/dist/tab-bar-searchable/index.d.ts.map +1 -0
  79. package/dist/tab-bar-searchable/index.js +75 -0
  80. package/dist/tab-bar-searchable/interfaces.d.ts +41 -0
  81. package/dist/tab-bar-searchable/interfaces.d.ts.map +1 -0
  82. package/dist/tab-bar-searchable/interfaces.js +5 -0
  83. package/dist/tab-bar-searchable/utils.d.ts +12 -0
  84. package/dist/tab-bar-searchable/utils.d.ts.map +1 -0
  85. package/dist/tab-bar-searchable/utils.js +60 -0
  86. package/dist/transition/index.d.ts +19 -0
  87. package/dist/transition/index.d.ts.map +1 -0
  88. package/dist/transition/index.js +219 -0
  89. package/dist/transition/ios.transition.d.ts +5 -0
  90. package/dist/transition/ios.transition.d.ts.map +1 -0
  91. package/dist/transition/ios.transition.js +609 -0
  92. package/dist/utils.d.ts +17 -0
  93. package/dist/utils.d.ts.map +1 -0
  94. package/dist/utils.js +69 -0
  95. package/docs/e2e-testing.md +51 -0
  96. package/docs/eslint.md +73 -0
  97. package/docs/experimental-animation.md +85 -0
  98. package/docs/features.md +88 -0
  99. package/docs/feedback.md +65 -0
  100. package/docs/ios-18.md +16 -0
  101. package/docs/migration.md +94 -0
  102. package/docs/special-markup.md +145 -0
  103. package/docs/using-ion-item-group.md +47 -0
  104. package/package.json +63 -0
  105. package/src/focus-controller/index.ts +123 -0
  106. package/src/index.ts +33 -0
  107. package/src/popover/animations/ios.enter.ts +144 -0
  108. package/src/popover/animations/ios.leave.ts +76 -0
  109. package/src/popover/popover-interface.ts +44 -0
  110. package/src/popover/utils.ts +696 -0
  111. package/src/sheets-of-glass/animations.ts +120 -0
  112. package/src/sheets-of-glass/index.ts +214 -0
  113. package/src/sheets-of-glass/interfaces.ts +17 -0
  114. package/src/styles/components/ion-action-sheet.scss +85 -0
  115. package/src/styles/components/ion-alert.scss +66 -0
  116. package/src/styles/components/ion-button.scss +443 -0
  117. package/src/styles/components/ion-card.scss +7 -0
  118. package/src/styles/components/ion-content.scss +22 -0
  119. package/src/styles/components/ion-datetime.scss +9 -0
  120. package/src/styles/components/ion-fab.scss +104 -0
  121. package/src/styles/components/ion-inputs.scss +82 -0
  122. package/src/styles/components/ion-list.scss +44 -0
  123. package/src/styles/components/ion-loading.scss +11 -0
  124. package/src/styles/components/ion-menu.scss +110 -0
  125. package/src/styles/components/ion-modal.scss +42 -0
  126. package/src/styles/components/ion-picker.scss +4 -0
  127. package/src/styles/components/ion-popover.scss +33 -0
  128. package/src/styles/components/ion-range.scss +90 -0
  129. package/src/styles/components/ion-searchbar.scss +68 -0
  130. package/src/styles/components/ion-segment.scss +150 -0
  131. package/src/styles/components/ion-tabs.scss +118 -0
  132. package/src/styles/components/ion-toast.scss +35 -0
  133. package/src/styles/components/ion-toggle.scss +65 -0
  134. package/src/styles/components/ion-toolbar.scss +76 -0
  135. package/src/styles/default-variables.scss +38 -0
  136. package/src/styles/ionic-theme-ios26-dark-always.scss +6 -0
  137. package/src/styles/ionic-theme-ios26-dark-class.scss +6 -0
  138. package/src/styles/ionic-theme-ios26-dark-system.scss +8 -0
  139. package/src/styles/ionic-theme-ios26.scss +23 -0
  140. package/src/styles/md-ion-list-inset.scss +22 -0
  141. package/src/styles/md-remove-ios-class-effect.scss +14 -0
  142. package/src/styles/utils/api.scss +146 -0
  143. package/src/styles/utils/dark/ion-button.scss +58 -0
  144. package/src/styles/utils/dark/ion-fab.scss +18 -0
  145. package/src/styles/utils/dark/ion-segment.scss +12 -0
  146. package/src/styles/utils/dark/ion-tabs.scss +21 -0
  147. package/src/styles/utils/searchable.scss +0 -0
  148. package/src/styles/utils/structured-list.scss +170 -0
  149. package/src/styles/utils/theme-dark.scss +25 -0
  150. package/src/styles/utils/translucent.scss +95 -0
  151. package/src/tab-bar-searchable/animations/enter.ts +92 -0
  152. package/src/tab-bar-searchable/animations/leave.ts +89 -0
  153. package/src/tab-bar-searchable/index.ts +141 -0
  154. package/src/tab-bar-searchable/interfaces.ts +28 -0
  155. package/src/tab-bar-searchable/utils.ts +75 -0
  156. package/src/transition/index.ts +369 -0
  157. package/src/transition/ios.transition.ts +966 -0
  158. package/src/utils.ts +91 -0
package/dist/docs.json ADDED
@@ -0,0 +1,234 @@
1
+ {
2
+ "api": {
3
+ "name": "IonicThemeIos26Api",
4
+ "slug": "ionicthemeios26api",
5
+ "docs": "Documentation facade for `@rdlabo/ionic-theme-ios26`.\nNot part of the public runtime API.",
6
+ "tags": [],
7
+ "methods": [
8
+ {
9
+ "name": "registerTabBarEffect",
10
+ "signature": "(targetElement: HTMLElement) => registeredEffect | undefined",
11
+ "parameters": [
12
+ {
13
+ "name": "targetElement",
14
+ "docs": "",
15
+ "type": "HTMLElement"
16
+ }
17
+ ],
18
+ "returns": "registeredEffect",
19
+ "tags": [],
20
+ "docs": "Registers the liquid-glass selection effect for an Ionic tab bar.",
21
+ "complexTypes": [
22
+ "registeredEffect",
23
+ "HTMLElement"
24
+ ],
25
+ "slug": "registertabbareffect"
26
+ },
27
+ {
28
+ "name": "registerSegmentEffect",
29
+ "signature": "(targetElement: HTMLElement) => registeredEffect | undefined",
30
+ "parameters": [
31
+ {
32
+ "name": "targetElement",
33
+ "docs": "",
34
+ "type": "HTMLElement"
35
+ }
36
+ ],
37
+ "returns": "registeredEffect",
38
+ "tags": [],
39
+ "docs": "Registers the liquid-glass selection effect for an Ionic segment.",
40
+ "complexTypes": [
41
+ "registeredEffect",
42
+ "HTMLElement"
43
+ ],
44
+ "slug": "registersegmenteffect"
45
+ },
46
+ {
47
+ "name": "attachTabBarSearchable",
48
+ "signature": "(ionTabBar: HTMLElement, ionFabButton: HTMLElement, ionFooter: HTMLElement) => TabBarSearchableFunction",
49
+ "parameters": [
50
+ {
51
+ "name": "ionTabBar",
52
+ "docs": "",
53
+ "type": "HTMLElement"
54
+ },
55
+ {
56
+ "name": "ionFabButton",
57
+ "docs": "",
58
+ "type": "HTMLElement"
59
+ },
60
+ {
61
+ "name": "ionFooter",
62
+ "docs": "",
63
+ "type": "HTMLElement"
64
+ }
65
+ ],
66
+ "returns": "TabBarSearchableFunction",
67
+ "tags": [],
68
+ "docs": "Attaches the searchable tab-bar transition and returns its event handler.",
69
+ "complexTypes": [
70
+ "TabBarSearchableFunction",
71
+ "HTMLElement"
72
+ ],
73
+ "slug": "attachtabbarsearchable"
74
+ },
75
+ {
76
+ "name": "iosTransitionAnimation",
77
+ "signature": "(navEl: HTMLElement, opts: unknown) => unknown",
78
+ "parameters": [
79
+ {
80
+ "name": "navEl",
81
+ "docs": "",
82
+ "type": "HTMLElement"
83
+ },
84
+ {
85
+ "name": "opts",
86
+ "docs": "",
87
+ "type": "unknown"
88
+ }
89
+ ],
90
+ "returns": "unknown",
91
+ "tags": [],
92
+ "docs": "Builds the package's iOS navigation transition.",
93
+ "complexTypes": [
94
+ "HTMLElement"
95
+ ],
96
+ "slug": "iostransitionanimation"
97
+ },
98
+ {
99
+ "name": "popoverEnterAnimation",
100
+ "signature": "(baseEl: HTMLElement, opts?: unknown) => unknown",
101
+ "parameters": [
102
+ {
103
+ "name": "baseEl",
104
+ "docs": "",
105
+ "type": "HTMLElement"
106
+ },
107
+ {
108
+ "name": "opts",
109
+ "docs": "",
110
+ "type": "unknown"
111
+ }
112
+ ],
113
+ "returns": "unknown",
114
+ "tags": [],
115
+ "docs": "Builds the iOS popover enter animation.",
116
+ "complexTypes": [
117
+ "HTMLElement"
118
+ ],
119
+ "slug": "popoverenteranimation"
120
+ },
121
+ {
122
+ "name": "popoverLeaveAnimation",
123
+ "signature": "(baseEl: HTMLElement) => unknown",
124
+ "parameters": [
125
+ {
126
+ "name": "baseEl",
127
+ "docs": "",
128
+ "type": "HTMLElement"
129
+ }
130
+ ],
131
+ "returns": "unknown",
132
+ "tags": [],
133
+ "docs": "Builds the iOS popover leave animation.",
134
+ "complexTypes": [
135
+ "HTMLElement"
136
+ ],
137
+ "slug": "popoverleaveanimation"
138
+ }
139
+ ],
140
+ "properties": []
141
+ },
142
+ "interfaces": [
143
+ {
144
+ "name": "registeredEffect",
145
+ "slug": "registeredeffect",
146
+ "docs": "",
147
+ "tags": [],
148
+ "methods": [],
149
+ "properties": [
150
+ {
151
+ "name": "destroy",
152
+ "tags": [],
153
+ "docs": "Removes listeners and effect elements created by registration.",
154
+ "complexTypes": [],
155
+ "type": "() => void"
156
+ }
157
+ ]
158
+ },
159
+ {
160
+ "name": "EffectScales",
161
+ "slug": "effectscales",
162
+ "docs": "",
163
+ "tags": [],
164
+ "methods": [],
165
+ "properties": [
166
+ {
167
+ "name": "small",
168
+ "tags": [],
169
+ "docs": "Small effect scale.",
170
+ "complexTypes": [],
171
+ "type": "string"
172
+ },
173
+ {
174
+ "name": "medium",
175
+ "tags": [],
176
+ "docs": "Medium effect scale.",
177
+ "complexTypes": [],
178
+ "type": "string"
179
+ },
180
+ {
181
+ "name": "large",
182
+ "tags": [],
183
+ "docs": "Large effect scale.",
184
+ "complexTypes": [],
185
+ "type": "string"
186
+ },
187
+ {
188
+ "name": "xlarge",
189
+ "tags": [],
190
+ "docs": "Extra-large effect scale.",
191
+ "complexTypes": [],
192
+ "type": "string"
193
+ }
194
+ ]
195
+ }
196
+ ],
197
+ "enums": [
198
+ {
199
+ "name": "TabBarSearchableType",
200
+ "slug": "tabbarsearchabletype",
201
+ "members": [
202
+ {
203
+ "name": "Enter",
204
+ "value": "'enter'",
205
+ "tags": [],
206
+ "docs": "Enters searchable mode."
207
+ },
208
+ {
209
+ "name": "Leave",
210
+ "value": "'leave'",
211
+ "tags": [],
212
+ "docs": "Leaves searchable mode."
213
+ }
214
+ ]
215
+ }
216
+ ],
217
+ "typeAliases": [
218
+ {
219
+ "name": "TabBarSearchableFunction",
220
+ "slug": "tabbarsearchablefunction",
221
+ "docs": "Event handler returned by `attachTabBarSearchable`.",
222
+ "types": [
223
+ {
224
+ "text": "(event: Event, type: TabBarSearchableType): Promise<void>",
225
+ "complexTypes": [
226
+ "Event",
227
+ "TabBarSearchableType"
228
+ ]
229
+ }
230
+ ]
231
+ }
232
+ ],
233
+ "pluginConfigs": []
234
+ }
@@ -0,0 +1,6 @@
1
+ export declare const createFocusController: () => FocusController;
2
+ export type FocusController = {
3
+ saveViewFocus: (referenceEl?: HTMLElement) => void;
4
+ setViewFocus: (referenceEl: HTMLElement) => void;
5
+ };
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/focus-controller/index.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,qBAAqB,QAAO,eAsFxC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IACnD,YAAY,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;CAClD,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { config } from '../utils';
2
+ const moveFocus = (el) => {
3
+ el.tabIndex = -1;
4
+ el.focus();
5
+ };
6
+ const isVisible = (el) => {
7
+ return el.offsetParent !== null;
8
+ };
9
+ export const createFocusController = () => {
10
+ const saveViewFocus = (referenceEl) => {
11
+ const focusManagerEnabled = config.get('focusManagerPriority', false);
12
+ if (focusManagerEnabled) {
13
+ const activeEl = document.activeElement;
14
+ if (activeEl !== null && referenceEl?.contains(activeEl)) {
15
+ activeEl.setAttribute(LAST_FOCUS, 'true');
16
+ }
17
+ }
18
+ };
19
+ const setViewFocus = (referenceEl) => {
20
+ const focusManagerPriorities = config.get('focusManagerPriority', false);
21
+ if (Array.isArray(focusManagerPriorities) && !referenceEl.contains(document.activeElement)) {
22
+ const lastFocus = referenceEl.querySelector(`[${LAST_FOCUS}]`);
23
+ if (lastFocus && isVisible(lastFocus)) {
24
+ moveFocus(lastFocus);
25
+ return;
26
+ }
27
+ for (const priority of focusManagerPriorities) {
28
+ switch (priority) {
29
+ case 'content':
30
+ const content = referenceEl.querySelector('main, [role="main"]');
31
+ if (content && isVisible(content)) {
32
+ moveFocus(content);
33
+ return;
34
+ }
35
+ break;
36
+ case 'heading':
37
+ const headingOne = referenceEl.querySelector('h1, [role="heading"][aria-level="1"]');
38
+ if (headingOne && isVisible(headingOne)) {
39
+ moveFocus(headingOne);
40
+ return;
41
+ }
42
+ break;
43
+ case 'banner':
44
+ const header = referenceEl.querySelector('header, [role="banner"]');
45
+ if (header && isVisible(header)) {
46
+ moveFocus(header);
47
+ return;
48
+ }
49
+ break;
50
+ default:
51
+ break;
52
+ }
53
+ }
54
+ moveFocus(referenceEl);
55
+ }
56
+ };
57
+ return {
58
+ saveViewFocus,
59
+ setViewFocus,
60
+ };
61
+ };
62
+ const LAST_FOCUS = 'ion-last-focus';
@@ -0,0 +1,6 @@
1
+ export declare const createFocusController: () => FocusController;
2
+ export type FocusController = {
3
+ saveViewFocus: (referenceEl?: HTMLElement) => void;
4
+ setViewFocus: (referenceEl: HTMLElement) => void;
5
+ };
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/focus-controller /index.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,qBAAqB,QAAO,eAsFxC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IACnD,YAAY,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;CAClD,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { config } from '../utils';
2
+ const moveFocus = (el) => {
3
+ el.tabIndex = -1;
4
+ el.focus();
5
+ };
6
+ const isVisible = (el) => {
7
+ return el.offsetParent !== null;
8
+ };
9
+ export const createFocusController = () => {
10
+ const saveViewFocus = (referenceEl) => {
11
+ const focusManagerEnabled = config.get('focusManagerPriority', false);
12
+ if (focusManagerEnabled) {
13
+ const activeEl = document.activeElement;
14
+ if (activeEl !== null && referenceEl?.contains(activeEl)) {
15
+ activeEl.setAttribute(LAST_FOCUS, 'true');
16
+ }
17
+ }
18
+ };
19
+ const setViewFocus = (referenceEl) => {
20
+ const focusManagerPriorities = config.get('focusManagerPriority', false);
21
+ if (Array.isArray(focusManagerPriorities) && !referenceEl.contains(document.activeElement)) {
22
+ const lastFocus = referenceEl.querySelector(`[${LAST_FOCUS}]`);
23
+ if (lastFocus && isVisible(lastFocus)) {
24
+ moveFocus(lastFocus);
25
+ return;
26
+ }
27
+ for (const priority of focusManagerPriorities) {
28
+ switch (priority) {
29
+ case 'content':
30
+ const content = referenceEl.querySelector('main, [role="main"]');
31
+ if (content && isVisible(content)) {
32
+ moveFocus(content);
33
+ return;
34
+ }
35
+ break;
36
+ case 'heading':
37
+ const headingOne = referenceEl.querySelector('h1, [role="heading"][aria-level="1"]');
38
+ if (headingOne && isVisible(headingOne)) {
39
+ moveFocus(headingOne);
40
+ return;
41
+ }
42
+ break;
43
+ case 'banner':
44
+ const header = referenceEl.querySelector('header, [role="banner"]');
45
+ if (header && isVisible(header)) {
46
+ moveFocus(header);
47
+ return;
48
+ }
49
+ break;
50
+ default:
51
+ break;
52
+ }
53
+ }
54
+ moveFocus(referenceEl);
55
+ }
56
+ };
57
+ return {
58
+ saveViewFocus,
59
+ setViewFocus,
60
+ };
61
+ };
62
+ const LAST_FOCUS = 'ion-last-focus';
@@ -0,0 +1,9 @@
1
+ import { registeredEffect } from './sheets-of-glass/interfaces';
2
+ export * from './sheets-of-glass/interfaces';
3
+ export { iosEnterAnimation as popoverEnterAnimation } from './popover/animations/ios.enter';
4
+ export { iosLeaveAnimation as popoverLeaveAnimation } from './popover/animations/ios.leave';
5
+ export * from './tab-bar-searchable';
6
+ export * from './transition/ios.transition';
7
+ export declare const registerTabBarEffect: (targetElement: HTMLElement) => registeredEffect | undefined;
8
+ export declare const registerSegmentEffect: (targetElement: HTMLElement) => registeredEffect | undefined;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAE5C,eAAO,MAAM,oBAAoB,GAAI,eAAe,WAAW,KAAG,gBAAgB,GAAG,SAOpF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,eAAe,WAAW,KAAG,gBAAgB,GAAG,SAerF,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,30 @@
1
+ import { registerEffect } from './sheets-of-glass';
2
+ export * from './sheets-of-glass/interfaces';
3
+ export { iosEnterAnimation as popoverEnterAnimation } from './popover/animations/ios.enter';
4
+ export { iosLeaveAnimation as popoverLeaveAnimation } from './popover/animations/ios.leave';
5
+ export * from './tab-bar-searchable';
6
+ export * from './transition/ios.transition';
7
+ export const registerTabBarEffect = (targetElement) => {
8
+ return registerEffect(targetElement, 'ion-tab-button', 'tab-selected', {
9
+ small: 'scale(1.1, 1)',
10
+ medium: 'scale(1.2)',
11
+ large: 'scale(1.3)',
12
+ xlarge: 'scale(1.15, 1.4)',
13
+ });
14
+ };
15
+ export const registerSegmentEffect = (targetElement) => {
16
+ const scale = !targetElement.classList.contains('segment-expand')
17
+ ? {
18
+ small: 'scale(1.35)',
19
+ medium: 'scale(1.45)',
20
+ large: 'scale(1.55)',
21
+ xlarge: 'scale(1.55, 1.65)',
22
+ }
23
+ : {
24
+ small: 'scale(1.02, 1.35)',
25
+ medium: 'scale(1.03, 1.45)',
26
+ large: 'scale(1.04, 1.55)',
27
+ xlarge: 'scale(1.05, 1.65)',
28
+ };
29
+ return registerEffect(targetElement, 'ion-segment-button', 'segment-button-checked', scale);
30
+ };
@@ -0,0 +1,4 @@
1
+ import type { Animation } from '@ionic/core';
2
+ export declare const POPOVER_IOS_BODY_MARGIN = 8;
3
+ export declare const iosEnterAnimation: (baseEl: HTMLElement, opts?: any) => Animation;
4
+ //# sourceMappingURL=ios.enter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ios.enter.d.ts","sourceRoot":"","sources":["../../../src/popover/animations/ios.enter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAK7C,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAMzC,eAAO,MAAM,iBAAiB,GAAI,QAAQ,WAAW,EAAE,OAAO,GAAG,KAAG,SAmInE,CAAC"}
@@ -0,0 +1,97 @@
1
+ import { createAnimation } from '@ionic/core';
2
+ import { getElementRoot } from '../../utils';
3
+ import { calculateWindowAdjustment, getPopoverDimensions, getPopoverPosition } from '../utils';
4
+ const POPOVER_IOS_BODY_PADDING = 5;
5
+ export const POPOVER_IOS_BODY_MARGIN = 8;
6
+ export const iosEnterAnimation = (baseEl, opts) => {
7
+ const { event: ev, size, trigger, reference, side, align } = opts;
8
+ const doc = baseEl.ownerDocument;
9
+ const isRTL = doc.dir === 'rtl';
10
+ const bodyWidth = doc.defaultView.innerWidth;
11
+ const bodyHeight = doc.defaultView.innerHeight;
12
+ const root = getElementRoot(baseEl);
13
+ const contentEl = root.querySelector('.popover-content');
14
+ const referenceSizeEl = trigger || ev?.detail?.ionShadowTarget || ev?.target;
15
+ const { contentWidth, contentHeight } = getPopoverDimensions(size, contentEl, referenceSizeEl);
16
+ const isReplace = (() => {
17
+ if (!['ion-button', 'ion-buttons'].includes(referenceSizeEl.localName)) {
18
+ return false;
19
+ }
20
+ if (referenceSizeEl.classList.contains('ios26-disabled')) {
21
+ return false;
22
+ }
23
+ return true;
24
+ })();
25
+ const defaultPosition = {
26
+ top: bodyHeight / 2 - contentHeight / 2,
27
+ left: bodyWidth / 2 - contentWidth / 2,
28
+ originX: isRTL ? 'right' : 'left',
29
+ originY: 'top',
30
+ };
31
+ const results = getPopoverPosition(isRTL, contentWidth, contentHeight, reference, side, align, defaultPosition, trigger, ev);
32
+ const padding = size === 'cover' ? 0 : POPOVER_IOS_BODY_PADDING;
33
+ const margin = size === 'cover' ? 0 : POPOVER_IOS_BODY_MARGIN;
34
+ const { originX, originY, top, left, bottom, checkSafeAreaLeft, checkSafeAreaRight, addPopoverBottomClass } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, margin, results.originX, results.originY, results.referenceCoordinates, referenceSizeEl.getBoundingClientRect(), isReplace);
35
+ const baseAnimation = createAnimation();
36
+ const backdropAnimation = createAnimation();
37
+ const contentAnimation = createAnimation();
38
+ const targetAnimation = createAnimation();
39
+ backdropAnimation
40
+ .delay(100)
41
+ .duration(300)
42
+ .addElement(root.querySelector('ion-backdrop'))
43
+ .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
44
+ .beforeStyles({
45
+ 'pointer-events': 'none',
46
+ })
47
+ .afterClearStyles(['pointer-events']);
48
+ contentAnimation
49
+ .easing('cubic-bezier(0, 1, 0.22, 1)')
50
+ .delay(100)
51
+ .duration(400)
52
+ .addElement(root.querySelector('.popover-content'))
53
+ .beforeStyles({ 'transform-origin': `${originY} ${originX}` })
54
+ .beforeAddWrite(() => {
55
+ root.querySelector('.popover-content').dataset['transformOrigin'] = `${originY} ${originX}`;
56
+ })
57
+ .fromTo('transform', 'scale(0)', 'scale(1)')
58
+ .fromTo('opacity', 0.01, 1);
59
+ if (isReplace) {
60
+ targetAnimation
61
+ .delay(0)
62
+ .duration(200)
63
+ .addElement(referenceSizeEl)
64
+ .beforeStyles({ 'transform-origin': `${originY} ${originX}` })
65
+ .beforeAddClass('ios26-replace-element')
66
+ .fromTo('transform', 'scale(1)', 'scale(1.05)')
67
+ .fromTo('opacity', 1, 0);
68
+ }
69
+ return baseAnimation
70
+ .easing('ease')
71
+ .delay(100)
72
+ .duration(100)
73
+ .beforeAddWrite(() => {
74
+ if (size === 'cover') {
75
+ baseEl.style.setProperty('--width', `${contentWidth}px`);
76
+ }
77
+ if (addPopoverBottomClass) {
78
+ baseEl.classList.add('popover-bottom');
79
+ }
80
+ if (bottom !== undefined) {
81
+ contentEl.style.setProperty('bottom', `${bottom}px`);
82
+ }
83
+ const safeAreaLeft = ' + var(--ion-safe-area-left, 0)';
84
+ const safeAreaRight = ' - var(--ion-safe-area-right, 0)';
85
+ let leftValue = `${left}px`;
86
+ if (checkSafeAreaLeft) {
87
+ leftValue = `${left}px${safeAreaLeft}`;
88
+ }
89
+ if (checkSafeAreaRight) {
90
+ leftValue = `${left}px${safeAreaRight}`;
91
+ }
92
+ contentEl.style.setProperty('top', `calc(${top}px + var(--offset-y, 0))`);
93
+ contentEl.style.setProperty('left', `calc(${leftValue} + var(--offset-x, 0))`);
94
+ contentEl.style.setProperty('transform-origin', `${originY} ${originX}`);
95
+ })
96
+ .addAnimation([backdropAnimation, contentAnimation, targetAnimation]);
97
+ };
@@ -0,0 +1,3 @@
1
+ import type { Animation } from '@ionic/core';
2
+ export declare const iosLeaveAnimation: (baseEl: HTMLElement) => Animation;
3
+ //# sourceMappingURL=ios.leave.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ios.leave.d.ts","sourceRoot":"","sources":["../../../src/popover/animations/ios.leave.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAK7C,eAAO,MAAM,iBAAiB,GAAI,QAAQ,WAAW,KAAG,SAmEvD,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { createAnimation } from '@ionic/core';
2
+ import { getElementRoot } from '../../utils';
3
+ export const iosLeaveAnimation = (baseEl) => {
4
+ const root = getElementRoot(baseEl);
5
+ const contentEl = root.querySelector('.popover-content');
6
+ const arrowEl = root.querySelector('.popover-arrow');
7
+ const baseAnimation = createAnimation();
8
+ const backdropAnimation = createAnimation();
9
+ const contentAnimation = createAnimation();
10
+ const targetAnimation = createAnimation();
11
+ const doc = baseEl.ownerDocument;
12
+ const replaceElement = doc.querySelector('.ios26-replace-element');
13
+ if (replaceElement) {
14
+ const ratio = contentEl.getBoundingClientRect().width / contentEl.getBoundingClientRect().height;
15
+ const scale = ratio > 1 ? `${Math.min(1.2, 1.05 * ratio)}, 1.05` : `1.05, ${Math.min(1.2, 1.05 * ratio)}`;
16
+ targetAnimation
17
+ .addElement(replaceElement)
18
+ .delay(100)
19
+ .duration(300)
20
+ .afterRemoveClass('ios26-replace-element')
21
+ .fromTo('transform', `scale(${scale})`, 'scale(1)')
22
+ .fromTo('opacity', 0, 0.9);
23
+ }
24
+ backdropAnimation.addElement(root.querySelector('ion-backdrop')).fromTo('opacity', 'var(--backdrop-opacity)', 0);
25
+ contentAnimation
26
+ .duration(400)
27
+ .easing('ease')
28
+ .addElement(root.querySelector('.popover-arrow'))
29
+ .addElement(root.querySelector('.popover-content'))
30
+ .fromTo('opacity', 0.99, 0);
31
+ const popoverContentDataset = root.querySelector('.popover-content').dataset['transformOrigin'];
32
+ if (popoverContentDataset) {
33
+ contentAnimation.beforeStyles({ 'transform-origin': popoverContentDataset }).afterAddRead(() => {
34
+ root.querySelector('.popover-content').dataset['transformOrigin'] = '';
35
+ });
36
+ if (replaceElement) {
37
+ contentAnimation.fromTo('transform', 'scale(1)', 'scale(0.55)');
38
+ }
39
+ else {
40
+ contentAnimation.fromTo('transform', 'scale(1)', 'scale(0)');
41
+ }
42
+ }
43
+ return baseAnimation
44
+ .easing('ease')
45
+ .afterAddWrite(() => {
46
+ baseEl.style.removeProperty('--width');
47
+ baseEl.classList.remove('popover-bottom');
48
+ contentEl.style.removeProperty('top');
49
+ contentEl.style.removeProperty('left');
50
+ contentEl.style.removeProperty('bottom');
51
+ contentEl.style.removeProperty('transform-origin');
52
+ if (arrowEl) {
53
+ arrowEl.style.removeProperty('top');
54
+ arrowEl.style.removeProperty('left');
55
+ arrowEl.style.removeProperty('display');
56
+ }
57
+ })
58
+ .duration(300)
59
+ .addAnimation([backdropAnimation, contentAnimation, targetAnimation]);
60
+ };
@@ -0,0 +1,38 @@
1
+ import type { AnimationBuilder, ComponentProps, ComponentRef, FrameworkDelegate, Mode, OverlayInterface } from '@ionic/core';
2
+ export interface PopoverInterface extends OverlayInterface {
3
+ present: (event?: MouseEvent | TouchEvent | PointerEvent) => Promise<void>;
4
+ }
5
+ export interface PopoverOptions<T extends ComponentRef = ComponentRef> {
6
+ component: T;
7
+ componentProps?: ComponentProps<T>;
8
+ showBackdrop?: boolean;
9
+ backdropDismiss?: boolean;
10
+ translucent?: boolean;
11
+ cssClass?: string | string[];
12
+ event?: Event;
13
+ delegate?: FrameworkDelegate;
14
+ animated?: boolean;
15
+ focusTrap?: boolean;
16
+ mode?: Mode;
17
+ keyboardClose?: boolean;
18
+ id?: string;
19
+ htmlAttributes?: {
20
+ [key: string]: any;
21
+ };
22
+ enterAnimation?: AnimationBuilder;
23
+ leaveAnimation?: AnimationBuilder;
24
+ size?: PopoverSize;
25
+ dismissOnSelect?: boolean;
26
+ reference?: PositionReference;
27
+ side?: PositionSide;
28
+ alignment?: PositionAlign;
29
+ arrow?: boolean;
30
+ trigger?: string;
31
+ triggerAction?: string;
32
+ }
33
+ export type PopoverSize = 'cover' | 'auto';
34
+ export type TriggerAction = 'click' | 'hover' | 'context-menu';
35
+ export type PositionReference = 'trigger' | 'event';
36
+ export type PositionSide = 'top' | 'right' | 'bottom' | 'left' | 'start' | 'end';
37
+ export type PositionAlign = 'start' | 'center' | 'end';
38
+ //# sourceMappingURL=popover-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover-interface.d.ts","sourceRoot":"","sources":["../../src/popover/popover-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE7H,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IACnE,SAAS,EAAE,CAAC,CAAC;IACb,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAExC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAElC,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,cAAc,CAAC;AAE/D,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AACjF,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC"}
@@ -0,0 +1 @@
1
+ export {};