magic-pill 8.1.0 → 9.0.0-next.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 (259) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/MIGRATING.md +224 -0
  3. package/README.md +309 -257
  4. package/dist/MagicPill/MagicPill.d.mts +27 -0
  5. package/dist/MagicPill/MagicPill.d.ts +27 -0
  6. package/dist/MagicPill/MagicPill.js +2 -0
  7. package/dist/MagicPill/MagicPill.js.map +1 -0
  8. package/dist/MagicPill/MagicPill.mjs +2 -0
  9. package/dist/MagicPill/MagicPill.mjs.map +1 -0
  10. package/dist/MagicPill/choreography.js +2 -0
  11. package/dist/MagicPill/choreography.js.map +1 -0
  12. package/dist/MagicPill/choreography.mjs +2 -0
  13. package/dist/MagicPill/choreography.mjs.map +1 -0
  14. package/dist/Pill/Pill.d.mts +7 -0
  15. package/dist/Pill/Pill.d.ts +7 -0
  16. package/dist/Pill/Pill.js +2 -0
  17. package/dist/Pill/Pill.js.map +1 -0
  18. package/dist/Pill/Pill.mjs +2 -0
  19. package/dist/Pill/Pill.mjs.map +1 -0
  20. package/dist/Pill/PillAction.d.mts +7 -0
  21. package/dist/Pill/PillAction.d.ts +7 -0
  22. package/dist/Pill/PillAction.js +2 -0
  23. package/dist/Pill/PillAction.js.map +1 -0
  24. package/dist/Pill/PillAction.mjs +2 -0
  25. package/dist/Pill/PillAction.mjs.map +1 -0
  26. package/dist/Pill/PillContext.d.mts +3 -0
  27. package/dist/Pill/PillContext.d.ts +3 -0
  28. package/dist/Pill/PillContext.js +2 -0
  29. package/dist/Pill/PillContext.js.map +1 -0
  30. package/dist/Pill/PillContext.mjs +2 -0
  31. package/dist/Pill/PillContext.mjs.map +1 -0
  32. package/dist/Pill/PillPanel.d.mts +9 -0
  33. package/dist/Pill/PillPanel.d.ts +9 -0
  34. package/dist/Pill/PillPanel.js +2 -0
  35. package/dist/Pill/PillPanel.js.map +1 -0
  36. package/dist/Pill/PillPanel.mjs +2 -0
  37. package/dist/Pill/PillPanel.mjs.map +1 -0
  38. package/dist/Pill/parts.d.mts +10 -0
  39. package/dist/Pill/parts.d.ts +10 -0
  40. package/dist/Pill/parts.js +2 -0
  41. package/dist/Pill/parts.js.map +1 -0
  42. package/dist/Pill/parts.mjs +2 -0
  43. package/dist/Pill/parts.mjs.map +1 -0
  44. package/dist/Pill/types.d.mts +88 -0
  45. package/dist/Pill/types.d.ts +88 -0
  46. package/dist/PillNavbar/PillNavbar.d.mts +31 -0
  47. package/dist/PillNavbar/PillNavbar.d.ts +31 -0
  48. package/dist/PillNavbar/PillNavbar.js +2 -0
  49. package/dist/PillNavbar/PillNavbar.js.map +1 -0
  50. package/dist/PillNavbar/PillNavbar.mjs +2 -0
  51. package/dist/PillNavbar/PillNavbar.mjs.map +1 -0
  52. package/dist/PillNavbar/matchPath.d.mts +2 -0
  53. package/dist/PillNavbar/matchPath.d.ts +2 -0
  54. package/dist/PillNavbar/matchPath.js +2 -0
  55. package/dist/PillNavbar/matchPath.js.map +1 -0
  56. package/dist/PillNavbar/matchPath.mjs +2 -0
  57. package/dist/PillNavbar/matchPath.mjs.map +1 -0
  58. package/dist/PillNotification/PillNotification.d.mts +51 -0
  59. package/dist/PillNotification/PillNotification.d.ts +51 -0
  60. package/dist/PillNotification/PillNotification.js +2 -0
  61. package/dist/PillNotification/PillNotification.js.map +1 -0
  62. package/dist/PillNotification/PillNotification.mjs +2 -0
  63. package/dist/PillNotification/PillNotification.mjs.map +1 -0
  64. package/dist/icons/ArrowIcon.d.mts +4 -0
  65. package/dist/icons/ArrowIcon.d.ts +4 -0
  66. package/dist/icons/ArrowIcon.js +2 -0
  67. package/dist/icons/ArrowIcon.js.map +1 -0
  68. package/dist/icons/ArrowIcon.mjs +2 -0
  69. package/dist/icons/ArrowIcon.mjs.map +1 -0
  70. package/dist/icons/BoxIcon.d.mts +4 -0
  71. package/dist/icons/BoxIcon.d.ts +4 -0
  72. package/dist/icons/BoxIcon.js +2 -0
  73. package/dist/icons/BoxIcon.js.map +1 -0
  74. package/dist/icons/BoxIcon.mjs +2 -0
  75. package/dist/icons/BoxIcon.mjs.map +1 -0
  76. package/dist/icons/CheckIcon.d.mts +4 -0
  77. package/dist/icons/CheckIcon.d.ts +4 -0
  78. package/dist/icons/CheckIcon.js +2 -0
  79. package/dist/icons/CheckIcon.js.map +1 -0
  80. package/dist/icons/CheckIcon.mjs +2 -0
  81. package/dist/icons/CheckIcon.mjs.map +1 -0
  82. package/dist/icons/CloseIcon.d.mts +4 -0
  83. package/dist/icons/CloseIcon.d.ts +4 -0
  84. package/dist/icons/CloseIcon.js +2 -0
  85. package/dist/icons/CloseIcon.js.map +1 -0
  86. package/dist/icons/CloseIcon.mjs +2 -0
  87. package/dist/icons/CloseIcon.mjs.map +1 -0
  88. package/dist/icons/CouponIcon.d.mts +4 -0
  89. package/dist/icons/CouponIcon.d.ts +4 -0
  90. package/dist/icons/CouponIcon.js +2 -0
  91. package/dist/icons/CouponIcon.js.map +1 -0
  92. package/dist/icons/CouponIcon.mjs +2 -0
  93. package/dist/icons/CouponIcon.mjs.map +1 -0
  94. package/dist/icons/DocumentIcon.d.mts +4 -0
  95. package/dist/icons/DocumentIcon.d.ts +4 -0
  96. package/dist/icons/DocumentIcon.js +2 -0
  97. package/dist/icons/DocumentIcon.js.map +1 -0
  98. package/dist/icons/DocumentIcon.mjs +2 -0
  99. package/dist/icons/DocumentIcon.mjs.map +1 -0
  100. package/dist/icons/HelpIcon.d.mts +4 -0
  101. package/dist/icons/HelpIcon.d.ts +4 -0
  102. package/dist/icons/HelpIcon.js +2 -0
  103. package/dist/icons/HelpIcon.js.map +1 -0
  104. package/dist/icons/HelpIcon.mjs +2 -0
  105. package/dist/icons/HelpIcon.mjs.map +1 -0
  106. package/dist/icons/InfoIcon.d.mts +4 -0
  107. package/dist/icons/InfoIcon.d.ts +4 -0
  108. package/dist/icons/InfoIcon.js +2 -0
  109. package/dist/icons/InfoIcon.js.map +1 -0
  110. package/dist/icons/InfoIcon.mjs +2 -0
  111. package/dist/icons/InfoIcon.mjs.map +1 -0
  112. package/dist/icons/MailIcon.d.mts +4 -0
  113. package/dist/icons/MailIcon.d.ts +4 -0
  114. package/dist/icons/MailIcon.js +2 -0
  115. package/dist/icons/MailIcon.js.map +1 -0
  116. package/dist/icons/MailIcon.mjs +2 -0
  117. package/dist/icons/MailIcon.mjs.map +1 -0
  118. package/dist/icons/PhoneIcon.d.mts +4 -0
  119. package/dist/icons/PhoneIcon.d.ts +4 -0
  120. package/dist/icons/PhoneIcon.js +2 -0
  121. package/dist/icons/PhoneIcon.js.map +1 -0
  122. package/dist/icons/PhoneIcon.mjs +2 -0
  123. package/dist/icons/PhoneIcon.mjs.map +1 -0
  124. package/dist/icons/PlusIcon.d.mts +4 -0
  125. package/dist/icons/PlusIcon.d.ts +4 -0
  126. package/dist/icons/PlusIcon.js +2 -0
  127. package/dist/icons/PlusIcon.js.map +1 -0
  128. package/dist/icons/PlusIcon.mjs +2 -0
  129. package/dist/icons/PlusIcon.mjs.map +1 -0
  130. package/dist/icons/UndoIcon.d.mts +4 -0
  131. package/dist/icons/UndoIcon.d.ts +4 -0
  132. package/dist/icons/UndoIcon.js +2 -0
  133. package/dist/icons/UndoIcon.js.map +1 -0
  134. package/dist/icons/UndoIcon.mjs +2 -0
  135. package/dist/icons/UndoIcon.mjs.map +1 -0
  136. package/dist/icons/types.d.mts +3 -0
  137. package/dist/icons/types.d.ts +3 -0
  138. package/dist/index.d.mts +25 -8
  139. package/dist/index.d.ts +25 -9
  140. package/dist/index.js +1 -1
  141. package/dist/index.mjs +1 -1
  142. package/dist/store/store.d.mts +63 -0
  143. package/dist/store/store.d.ts +63 -0
  144. package/dist/store/store.js +2 -0
  145. package/dist/store/store.js.map +1 -0
  146. package/dist/store/store.mjs +2 -0
  147. package/dist/store/store.mjs.map +1 -0
  148. package/dist/store/usePillQueue.d.mts +6 -0
  149. package/dist/store/usePillQueue.d.ts +6 -0
  150. package/dist/store/usePillQueue.js +2 -0
  151. package/dist/store/usePillQueue.js.map +1 -0
  152. package/dist/store/usePillQueue.mjs +2 -0
  153. package/dist/store/usePillQueue.mjs.map +1 -0
  154. package/dist/styles.css +427 -0
  155. package/dist/utils/react.js +2 -0
  156. package/dist/utils/react.js.map +1 -0
  157. package/dist/utils/react.mjs +2 -0
  158. package/dist/utils/react.mjs.map +1 -0
  159. package/dist/utils/url.js +2 -0
  160. package/dist/utils/url.js.map +1 -0
  161. package/dist/utils/url.mjs +2 -0
  162. package/dist/utils/url.mjs.map +1 -0
  163. package/package.json +5 -3
  164. package/dist/MagicPill.d.mts +0 -6
  165. package/dist/MagicPill.d.ts +0 -7
  166. package/dist/MagicPill.js +0 -2
  167. package/dist/MagicPill.js.map +0 -1
  168. package/dist/MagicPill.mjs +0 -2
  169. package/dist/MagicPill.mjs.map +0 -1
  170. package/dist/Navbar/Navbar.js +0 -2
  171. package/dist/Navbar/Navbar.js.map +0 -1
  172. package/dist/Navbar/Navbar.mjs +0 -2
  173. package/dist/Navbar/Navbar.mjs.map +0 -1
  174. package/dist/Notification/Notification.js +0 -2
  175. package/dist/Notification/Notification.js.map +0 -1
  176. package/dist/Notification/Notification.mjs +0 -2
  177. package/dist/Notification/Notification.mjs.map +0 -1
  178. package/dist/defaultPillData.d.mts +0 -2
  179. package/dist/defaultPillData.d.ts +0 -3
  180. package/dist/defaultPillData.js +0 -7
  181. package/dist/defaultPillData.js.map +0 -1
  182. package/dist/defaultPillData.mjs +0 -7
  183. package/dist/defaultPillData.mjs.map +0 -1
  184. package/dist/icons/arrow_label.js +0 -2
  185. package/dist/icons/arrow_label.js.map +0 -1
  186. package/dist/icons/arrow_label.mjs +0 -2
  187. package/dist/icons/arrow_label.mjs.map +0 -1
  188. package/dist/icons/box_label.js +0 -2
  189. package/dist/icons/box_label.js.map +0 -1
  190. package/dist/icons/box_label.mjs +0 -2
  191. package/dist/icons/box_label.mjs.map +0 -1
  192. package/dist/icons/checkmark.js +0 -2
  193. package/dist/icons/checkmark.js.map +0 -1
  194. package/dist/icons/checkmark.mjs +0 -2
  195. package/dist/icons/checkmark.mjs.map +0 -1
  196. package/dist/icons/checkmark_label.js +0 -2
  197. package/dist/icons/checkmark_label.js.map +0 -1
  198. package/dist/icons/checkmark_label.mjs +0 -2
  199. package/dist/icons/checkmark_label.mjs.map +0 -1
  200. package/dist/icons/coupon.js +0 -2
  201. package/dist/icons/coupon.js.map +0 -1
  202. package/dist/icons/coupon.mjs +0 -2
  203. package/dist/icons/coupon.mjs.map +0 -1
  204. package/dist/icons/cross_label.js +0 -2
  205. package/dist/icons/cross_label.js.map +0 -1
  206. package/dist/icons/cross_label.mjs +0 -2
  207. package/dist/icons/cross_label.mjs.map +0 -1
  208. package/dist/icons/info.js +0 -2
  209. package/dist/icons/info.js.map +0 -1
  210. package/dist/icons/info.mjs +0 -2
  211. package/dist/icons/info.mjs.map +0 -1
  212. package/dist/icons/info_label.js +0 -2
  213. package/dist/icons/info_label.js.map +0 -1
  214. package/dist/icons/info_label.mjs +0 -2
  215. package/dist/icons/info_label.mjs.map +0 -1
  216. package/dist/icons/mail_label.js +0 -2
  217. package/dist/icons/mail_label.js.map +0 -1
  218. package/dist/icons/mail_label.mjs +0 -2
  219. package/dist/icons/mail_label.mjs.map +0 -1
  220. package/dist/icons/plus_label.js +0 -2
  221. package/dist/icons/plus_label.js.map +0 -1
  222. package/dist/icons/plus_label.mjs +0 -2
  223. package/dist/icons/plus_label.mjs.map +0 -1
  224. package/dist/icons/questionmark.js +0 -2
  225. package/dist/icons/questionmark.js.map +0 -1
  226. package/dist/icons/questionmark.mjs +0 -2
  227. package/dist/icons/questionmark.mjs.map +0 -1
  228. package/dist/icons/quotation_label.js +0 -2
  229. package/dist/icons/quotation_label.js.map +0 -1
  230. package/dist/icons/quotation_label.mjs +0 -2
  231. package/dist/icons/quotation_label.mjs.map +0 -1
  232. package/dist/icons/tel_label.js +0 -2
  233. package/dist/icons/tel_label.js.map +0 -1
  234. package/dist/icons/tel_label.mjs +0 -2
  235. package/dist/icons/tel_label.mjs.map +0 -1
  236. package/dist/icons/undo_label.js +0 -2
  237. package/dist/icons/undo_label.js.map +0 -1
  238. package/dist/icons/undo_label.mjs +0 -2
  239. package/dist/icons/undo_label.mjs.map +0 -1
  240. package/dist/magicpill.css +0 -315
  241. package/dist/types/index.d.ts +0 -4
  242. package/dist/types/magicPill.d.mts +0 -50
  243. package/dist/types/magicPill.d.ts +0 -50
  244. package/dist/types/navbar.d.mts +0 -27
  245. package/dist/types/navbar.d.ts +0 -28
  246. package/dist/types/notification.d.mts +0 -140
  247. package/dist/types/notification.d.ts +0 -141
  248. package/dist/utils/handlers.d.mts +0 -20
  249. package/dist/utils/handlers.d.ts +0 -21
  250. package/dist/utils/handlers.js +0 -2
  251. package/dist/utils/handlers.js.map +0 -1
  252. package/dist/utils/handlers.mjs +0 -2
  253. package/dist/utils/handlers.mjs.map +0 -1
  254. package/dist/utils/icons.d.mts +0 -20
  255. package/dist/utils/icons.d.ts +0 -20
  256. package/dist/utils/icons.js +0 -2
  257. package/dist/utils/icons.js.map +0 -1
  258. package/dist/utils/icons.mjs +0 -2
  259. package/dist/utils/icons.mjs.map +0 -1
@@ -1,315 +0,0 @@
1
- /* Font import */
2
- @import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&family=Overlock:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&display=swap');
3
-
4
- /* CSS variables */
5
- :root {
6
- --mp__themeDark: #141414;
7
- --mp__themeLight: #F9F9F9;
8
- --mp__font-text: "Overlock", sans-serif;
9
- --mp__font-accent: "Lexend", sans-serif;
10
- --mp__normal: normal;
11
- --mp__italic: italic;
12
- --mp__medium: 400;
13
- --mp__bold: 700;
14
- --mp__black: 900;
15
- --mp__success: #3F7253;
16
- --mp__danger: #FC5D6A;
17
- --mp__textSize: 19.4px;
18
- --mp__titleSize: 31.42px;
19
- }
20
-
21
- html {
22
- >body {
23
-
24
- /* General */
25
- .magicPill,
26
- .magicPill::before,
27
- .magicPill::after {
28
- box-sizing: border-box;
29
- margin: 0;
30
- padding: 0;
31
- font-family: var(--mp__font-text);
32
- }
33
-
34
- .magicPill {
35
- z-index: 1;
36
- scale: 0;
37
- position: fixed;
38
- top: calc(95dvh - 110px);
39
- left: 50%;
40
- transform: translateX(-50%);
41
- padding: 25px;
42
- display: flex;
43
- gap: 25px;
44
- background-color: var(--mp__themeDark);
45
- color: var(--mp__themeLight);
46
- border-radius: 100px;
47
- align-items: center;
48
- justify-content: flex-start;
49
- max-width: 104.5px;
50
- overflow: hidden;
51
- box-shadow: 0px 8px 8px #14141473;
52
- transform-origin: left;
53
- transition: width 250ms ease-in-out, max-width 250ms ease-in-out;
54
-
55
- >svg {
56
- min-width: calc(110px / 2);
57
- width: 100%;
58
- transition: width 250ms ease-in-out, min-width 250ms ease-in-out;
59
- }
60
-
61
- >.message,
62
- .info {
63
- font-style: var(--mp__italic);
64
- font-size: var(--mp__textSize);
65
-
66
- >* {
67
- opacity: 0;
68
- transition: opacity 250ms 0ms ease-in-out;
69
- }
70
-
71
- >.title {
72
- font-weight: var(--mp__black);
73
- font-size: var(--mp__titleSize);
74
- }
75
- }
76
-
77
- >.message {
78
- padding-left: 25px;
79
- border-left: 1px solid var(--mp__themeLight);
80
- font-style: var(--mp__italic);
81
- font-size: 19.4px;
82
- min-width: max-content;
83
- }
84
-
85
- .CTA {
86
- font-family: var(--mp__font-accent);
87
- font-size: var(--mp__textSize);
88
- font-weight: var(--mp__bold);
89
- display: flex;
90
- justify-content: flex-start;
91
- align-items: center;
92
- gap: 15px;
93
- padding: 15px;
94
- max-width: 54.5px;
95
- min-width: 54.5px;
96
- overflow: hidden;
97
- background-color: var(--mp__themeLight);
98
- color: var(--mp__themeDark);
99
- text-decoration: none;
100
- border: transparent;
101
- border-radius: 100px;
102
- transition: width 250ms ease-in-out, max-width 250ms ease-in-out, left 250ms ease-in-out, transform 250ms ease-in-out;
103
- cursor: pointer;
104
-
105
- >svg {
106
- min-width: calc(54.5px / 2);
107
- width: 100%;
108
- z-index: 1;
109
- max-width: calc(54.5px / 2);
110
- }
111
-
112
- >span {
113
- z-index: 1;
114
- min-width: max-content;
115
- font-family: var(--mp__font-accent);
116
- color: var(--mp__themeDark);
117
- text-decoration: none;
118
- }
119
- }
120
-
121
- .CTA:hover {
122
- max-width: 300px;
123
- }
124
-
125
- >.info {
126
- display: grid;
127
- gap: 25px;
128
- padding: 50px 50px 85px 50px;
129
- z-index: -1;
130
- position: absolute;
131
- left: 0;
132
- width: 100%;
133
- height: 100%;
134
- background-color: var(--mp__themeDark);
135
- border-radius: 40px;
136
- bottom: 0px;
137
- transition: height 250ms 250ms ease-in-out, bottom 250ms 250ms ease-in-out, border-radius 250ms 250ms ease-in-out;
138
- }
139
-
140
- >.info.active {
141
- bottom: 0;
142
- height: fit-content !important;
143
- transition: height 250ms 0ms ease-in-out, bottom 250ms 0ms ease-in-out, border-radius 250ms 0ms ease-in-out;
144
-
145
- >* {
146
- opacity: 1;
147
- transition: opacity 250ms 250ms ease-in-out;
148
- }
149
- }
150
-
151
- >nav.navbar {
152
- >ul.navbarList {
153
- display: flex;
154
- gap: 25px;
155
- justify-content: space-between;
156
- list-style: none;
157
-
158
- >li.navbarItem {
159
- >a.CTA {
160
- font-family: var(--mp__font-accent);
161
- font-size: var(--mp__textSize);
162
- font-weight: var(--mp__bold);
163
- display: flex;
164
- justify-content: flex-start;
165
- align-items: center;
166
- gap: 15px;
167
- padding: 15px;
168
- max-width: 54.5px;
169
- min-width: 54.5px;
170
- overflow: hidden;
171
- background-color: var(--mp__themeLight);
172
- color: var(--mp__themeDark);
173
- text-decoration: none;
174
- border: transparent;
175
- border-radius: 100px;
176
- transition: width 250ms ease-in-out, max-width 250ms ease-in-out, left 250ms ease-in-out, transform 250ms ease-in-out;
177
- cursor: pointer;
178
-
179
- >svg {
180
- min-width: calc(54.5px / 2);
181
- width: 100%;
182
- z-index: 1;
183
- max-width: calc(54.5px / 2);
184
- }
185
-
186
- >span {
187
- z-index: 1;
188
- min-width: max-content;
189
- font-family: var(--mp__font-accent);
190
- color: var(--mp__themeDark);
191
- text-decoration: none;
192
- }
193
- }
194
- >a.CTA:hover, >a.CTA.active {
195
- max-width: 300px;
196
- }
197
- }
198
- }
199
- }
200
- }
201
-
202
- .magicPill:has(.navbar).out, .magicPill:has(.navbar).entry, .magicPill:has(.navbar).active {
203
- max-width: 1000px;
204
- transition: none !important;
205
- }
206
-
207
- .magicPill.active {
208
- height: 104.5px;
209
- max-width: 1000px;
210
- scale: 1;
211
-
212
- >svg {
213
- min-width: unset;
214
- width: unset;
215
- }
216
- }
217
-
218
- .magicPill.entry {
219
- max-width: 104.5px;
220
- transition: max-width 1500ms ease-in-out, width 1500ms ease-in-out;
221
- animation: magicPillEntry 2500ms ease-in-out forwards;
222
- }
223
-
224
- .magicPill.out {
225
- scale: 1;
226
- max-width: 104.5px;
227
- transition: max-width 1500ms ease-in-out, width 1500ms ease-in-out;
228
- animation: magicPillEntry 2500ms 1500ms ease-in-out reverse forwards;
229
-
230
- >svg {
231
- min-width: calc(110px / 2);
232
- width: 100%;
233
- transition: width 250ms ease-in-out, min-width 250ms ease-in-out;
234
- }
235
- }
236
-
237
- .magicPill:has(.info.active) {
238
- overflow: unset;
239
- min-width: 500px;
240
-
241
- >svg,
242
- p {
243
- z-index: -1;
244
- }
245
-
246
- >button.CTA {
247
- position: absolute;
248
- left: 50%;
249
- transform: translateX(-50%);
250
- }
251
- }
252
- }
253
- }
254
-
255
- @keyframes magicPillEntry {
256
- 0% {
257
- scale: 0;
258
- }
259
-
260
- 90% {
261
- scale: 1.2;
262
- }
263
-
264
- 100% {
265
- scale: 1;
266
- }
267
- }
268
-
269
- /* Reduced motion (Y2): no overshoot and no size or position animations,
270
- only short fades. The timings in MagicPill.tsx don't change. */
271
- @media (prefers-reduced-motion: reduce) {
272
- html > body .magicPill,
273
- html > body .magicPill * {
274
- transition-duration: 1ms !important;
275
- transition-delay: 0ms !important;
276
- }
277
-
278
- html > body .magicPill.entry {
279
- animation: magicPillFadeIn 200ms ease-out forwards;
280
- }
281
-
282
- html > body .magicPill.out {
283
- animation: magicPillFadeOut 200ms ease-in forwards;
284
- }
285
- }
286
-
287
- @keyframes magicPillFadeIn {
288
- 0% {
289
- scale: 1;
290
- opacity: 0;
291
- }
292
-
293
- 100% {
294
- scale: 1;
295
- opacity: 1;
296
- }
297
- }
298
-
299
- /* Ends at scale 0, like the default exit, so the hidden pill doesn't block clicks */
300
- @keyframes magicPillFadeOut {
301
- 0% {
302
- scale: 1;
303
- opacity: 1;
304
- }
305
-
306
- 99% {
307
- scale: 1;
308
- opacity: 0;
309
- }
310
-
311
- 100% {
312
- scale: 0;
313
- opacity: 0;
314
- }
315
- }
@@ -1,4 +0,0 @@
1
- import { MagicPillNavbar, MagicPillNavbarItem } from "./navbar.js";
2
- import { MagicPillNotification, MagicPillNotificationCTA, MagicPillNotificationInfo } from "./notification.js";
3
- import { CTAIcon, MagicPillType, Mode, NotificationIcon } from "./magicPill.js";
4
- export type { CTAIcon, MagicPillNavbar, MagicPillNavbarItem, MagicPillNotification, MagicPillNotificationCTA, MagicPillNotificationInfo, MagicPillType, Mode, NotificationIcon };
@@ -1,50 +0,0 @@
1
- import { MagicPillNotification } from "./notification.mjs";
2
- import { MagicPillNavbar } from "./navbar.mjs";
3
- export type Mode = "navbar" | "notification";
4
- export type NotificationIcon = "info" | "checkmark" | "questionmark" | "coupon" | "";
5
- export type CTAIcon = "arrow" | "box" | "checkmark" | "cross" | "info" | "mail" | "plus" | "quotation" | "tel" | "undo" | "";
6
- /**
7
- * Defines the structure of the Magic Pill component.
8
- * Magic Pill can be used in two modes:
9
- * 1. Navbar mode: Displays a navigation bar with multiple items.
10
- * 2. Notification mode: Displays a notification with an optional call to action (CTA).
11
- * Each mode has its own specific properties.
12
- * @see {@link MagicPillNotification} for the structure of the notification.
13
- * @see {@link MagicPillNavbar} for the structure of the navbar.
14
- *
15
- * @example
16
- * ```json
17
- * {
18
- * mode: "navbar",
19
- * navbar: [
20
- * { icon: "home", label: "Home", link: "/home" },
21
- * { icon: "settings", label: "Settings", link: "/settings" }
22
- * ]
23
- * }
24
- * ```
25
- * @example
26
- * ```json
27
- * {
28
- * mode: "notification",
29
- * notification: {
30
- * icon: "info",
31
- * message: "This is a notification",
32
- * cta: { icon: "action", label: "Take Action", link: "/action" },
33
- * info: {
34
- * title: "Notification Title",
35
- * content: "This is the content of the notification.",
36
- * closeLabel: "Close"
37
- * }
38
- * }
39
- * }
40
- * ```
41
- */
42
- export type MagicPillType = {
43
- mode: "navbar";
44
- navbar: MagicPillNavbar;
45
- notification?: never;
46
- } | {
47
- mode: "notification";
48
- notification: MagicPillNotification;
49
- navbar?: never;
50
- };
@@ -1,50 +0,0 @@
1
- import { MagicPillNotification } from "./notification.js";
2
- import { MagicPillNavbar } from "./navbar.js";
3
- export type Mode = "navbar" | "notification";
4
- export type NotificationIcon = "info" | "checkmark" | "questionmark" | "coupon" | "";
5
- export type CTAIcon = "arrow" | "box" | "checkmark" | "cross" | "info" | "mail" | "plus" | "quotation" | "tel" | "undo" | "";
6
- /**
7
- * Defines the structure of the Magic Pill component.
8
- * Magic Pill can be used in two modes:
9
- * 1. Navbar mode: Displays a navigation bar with multiple items.
10
- * 2. Notification mode: Displays a notification with an optional call to action (CTA).
11
- * Each mode has its own specific properties.
12
- * @see {@link MagicPillNotification} for the structure of the notification.
13
- * @see {@link MagicPillNavbar} for the structure of the navbar.
14
- *
15
- * @example
16
- * ```json
17
- * {
18
- * mode: "navbar",
19
- * navbar: [
20
- * { icon: "home", label: "Home", link: "/home" },
21
- * { icon: "settings", label: "Settings", link: "/settings" }
22
- * ]
23
- * }
24
- * ```
25
- * @example
26
- * ```json
27
- * {
28
- * mode: "notification",
29
- * notification: {
30
- * icon: "info",
31
- * message: "This is a notification",
32
- * cta: { icon: "action", label: "Take Action", link: "/action" },
33
- * info: {
34
- * title: "Notification Title",
35
- * content: "This is the content of the notification.",
36
- * closeLabel: "Close"
37
- * }
38
- * }
39
- * }
40
- * ```
41
- */
42
- export type MagicPillType = {
43
- mode: "navbar";
44
- navbar: MagicPillNavbar;
45
- notification?: never;
46
- } | {
47
- mode: "notification";
48
- notification: MagicPillNotification;
49
- navbar?: never;
50
- };
@@ -1,27 +0,0 @@
1
- import { CTAIcon } from "./magicPill.mjs";
2
- /**
3
- * Defines the structure of a navigation item in the Magic Pill navbar.
4
- * Each item has an icon, an optional label, and a link.
5
- * @example
6
- * ```ts
7
- * {
8
- * icon: "home",
9
- * label: "Home",
10
- * link: "/home"
11
- * }
12
- * ```
13
- * @see {@link MagicPillNavbar} for the structure of the navbar that contains these items.
14
- */
15
- export interface MagicPillNavbarItem {
16
- icon: CTAIcon;
17
- label?: string;
18
- link: string;
19
- }
20
- /**
21
- * Defines the structure of the navbar in the Magic Pill component.
22
- * It contains an array of navigation items.
23
- * @see {@link MagicPillNavbarItem} for the structure of each item in the navbar.
24
- */
25
- export interface MagicPillNavbar {
26
- navItems: MagicPillNavbarItem[];
27
- }
@@ -1,28 +0,0 @@
1
- import { CTAIcon } from "./magicPill.js";
2
- import "./index.js";
3
- /**
4
- * Defines the structure of a navigation item in the Magic Pill navbar.
5
- * Each item has an icon, an optional label, and a link.
6
- * @example
7
- * ```ts
8
- * {
9
- * icon: "home",
10
- * label: "Home",
11
- * link: "/home"
12
- * }
13
- * ```
14
- * @see {@link MagicPillNavbar} for the structure of the navbar that contains these items.
15
- */
16
- export interface MagicPillNavbarItem {
17
- icon: CTAIcon;
18
- label?: string;
19
- link: string;
20
- }
21
- /**
22
- * Defines the structure of the navbar in the Magic Pill component.
23
- * It contains an array of navigation items.
24
- * @see {@link MagicPillNavbarItem} for the structure of each item in the navbar.
25
- */
26
- export interface MagicPillNavbar {
27
- navItems: MagicPillNavbarItem[];
28
- }
@@ -1,140 +0,0 @@
1
- import { CTAIcon, NotificationIcon } from "./magicPill.mjs";
2
- /**
3
- * Defines the structure of a call to action (CTA) in the Magic Pill notification.
4
- * Each CTA has an icon, an optional label, and an optional link.
5
- * @example
6
- * ```ts
7
- * {
8
- * icon: "action",
9
- * label: "Take Action",
10
- * link: "/action"
11
- * }
12
- * ```
13
- * @see {@link MagicPillNotification} for the structure of the notification that contains this CTA.
14
- */
15
- export interface MagicPillNotificationCTA {
16
- icon: CTAIcon;
17
- label?: string;
18
- link?: string;
19
- }
20
- /**
21
- * Defines the structure of additional information in the Magic Pill notification.
22
- * This can include a title, content (which can contain HTML), and a close label.
23
- * @example
24
- * ```ts
25
- * {
26
- * title: "Notification Title",
27
- * content: "This is the content of the notification.",
28
- * closeLabel: "Close"
29
- * }
30
- * ```
31
- * @see {@link MagicPillNotification} for the structure of the notification that contains this information.
32
- * @see {@link MagicPillNotificationCTA} for the structure of the call to action in the notification.
33
- */
34
- export interface MagicPillNotificationInfo {
35
- title?: string;
36
- content: string;
37
- closeLabel: string;
38
- }
39
- /**
40
- * Defines the structure of a Magic Pill notification CTA with a link.
41
- * @example
42
- * ```ts
43
- * {
44
- * icon: "info",
45
- * label: "Learn More",
46
- * link: "/learn-more"
47
- * }
48
- * ```
49
- * @see {@link MagicPillNotificationWithLink} for the whole notification structure that incorporates this very type..
50
- */
51
- interface MagicPillNotificationCTAWithLink {
52
- icon: CTAIcon;
53
- label?: string;
54
- link: string;
55
- }
56
- /**
57
- * Defines the structure of a Magic Pill notification CTA without a link.
58
- * @example
59
- * ```ts
60
- * {
61
- * icon: "info",
62
- * label: "No Link Available"
63
- * }
64
- * ```
65
- * @see {@link MagicPillNotificationWithoutLink} for the whole notification structure that incorporates this very type.
66
- */
67
- interface MagicPillNotificationCTAWithoutLink {
68
- icon: CTAIcon;
69
- label?: string;
70
- link?: undefined;
71
- }
72
- /**
73
- * Defines the base structure of a Magic Pill notification.
74
- * It includes an optional icon and a mandatory message.
75
- * @example
76
- * ```ts
77
- * {
78
- * icon: "info",
79
- * message: "This is a notification message."
80
- * }
81
- * ```
82
- * @see {@link MagicPillNotificationWithLink} for notifications that include a CTA with a link.
83
- * @see {@link MagicPillNotificationWithoutLink} for notifications that include a CTA without a link.
84
- * @see {@link MagicPillNotificationWithoutCTA} for notifications that do not include a CTA.
85
- */
86
- interface MagicPillNotificationBase {
87
- icon?: NotificationIcon;
88
- message: string;
89
- cta?: MagicPillNotificationCTA;
90
- info?: MagicPillNotificationInfo;
91
- }
92
- /**
93
- * Defines the structure of a Magic Pill notification with a CTA that includes a link.
94
- * This type extends the base notification structure and includes a CTA with a mandatory link.
95
- * @example
96
- * ```ts
97
- * {
98
- * icon: "info",
99
- * message: "This is a notification with a link.",
100
- * cta: {
101
- * icon: "action",
102
- * label: "Take Action",
103
- * link: "/action"
104
- * }
105
- * }
106
- * ````
107
- * @see {@link MagicPillNotificationBase} for the base structure of the notification.
108
- * @see {@link MagicPillNotificationCTAWithLink} for the structure of the CTA with a link.
109
- */
110
- type MagicPillNotificationWithLink = MagicPillNotificationBase & {
111
- cta: MagicPillNotificationCTAWithLink;
112
- };
113
- /**
114
- * Defines the structure of a Magic Pill notification without a link in the CTA.
115
- * This type extends the base notification structure and includes a CTA without a mandatory link.
116
- * @example
117
- * ```ts
118
- * {
119
- * icon: "info",
120
- * message: "This is a notification without a link.",
121
- * cta: {
122
- * icon: "action",
123
- * label: "No Link Available"
124
- * },
125
- * info: {
126
- * title: "Notification Title",
127
- * content: "This is the content of the notification.",
128
- * closeLabel: "Close"
129
- * }
130
- * }
131
- * ```
132
- * @see {@link MagicPillNotificationBase} for the base structure of the notification.
133
- * @see {@link MagicPillNotificationCTAWithoutLink} for the structure of the CTA without a link.
134
- */
135
- type MagicPillNotificationWithoutLink = MagicPillNotificationBase & {
136
- cta: MagicPillNotificationCTAWithoutLink;
137
- info: MagicPillNotificationInfo;
138
- };
139
- export type MagicPillNotification = MagicPillNotificationWithLink | MagicPillNotificationWithoutLink | MagicPillNotificationBase;
140
- export {};