@7pmlabs/design-system 2.0.9 → 2.1.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 (377) hide show
  1. package/README.md +4 -4
  2. package/dist/design-system.css +1 -1
  3. package/dist/design-system.js +65 -59
  4. package/dist/design-system100.js +1 -1
  5. package/dist/design-system100.js.map +1 -1
  6. package/dist/design-system101.js +87 -53
  7. package/dist/design-system101.js.map +1 -1
  8. package/dist/design-system103.js +5 -13
  9. package/dist/design-system103.js.map +1 -1
  10. package/dist/design-system104.js +53 -108
  11. package/dist/design-system104.js.map +1 -1
  12. package/dist/{design-system102.js → design-system105.js} +1 -1
  13. package/dist/{design-system102.js.map → design-system105.js.map} +1 -1
  14. package/dist/design-system106.js +13 -6
  15. package/dist/design-system106.js.map +1 -1
  16. package/dist/design-system107.js +93 -190
  17. package/dist/design-system107.js.map +1 -1
  18. package/dist/design-system109.js +2 -2
  19. package/dist/design-system109.js.map +1 -1
  20. package/dist/design-system110.js +183 -484
  21. package/dist/design-system110.js.map +1 -1
  22. package/dist/design-system112.js +5 -4
  23. package/dist/design-system112.js.map +1 -1
  24. package/dist/design-system113.js +507 -7
  25. package/dist/design-system113.js.map +1 -1
  26. package/dist/design-system115.js +8 -0
  27. package/dist/design-system115.js.map +1 -0
  28. package/dist/design-system116.js +7 -6
  29. package/dist/design-system116.js.map +1 -1
  30. package/dist/design-system117.js +154 -169
  31. package/dist/design-system117.js.map +1 -1
  32. package/dist/design-system119.js +2 -2
  33. package/dist/design-system119.js.map +1 -1
  34. package/dist/design-system120.js +210 -149
  35. package/dist/design-system120.js.map +1 -1
  36. package/dist/design-system122.js +5 -4
  37. package/dist/design-system122.js.map +1 -1
  38. package/dist/design-system123.js +160 -9
  39. package/dist/design-system123.js.map +1 -1
  40. package/dist/design-system125.js +8 -0
  41. package/dist/design-system125.js.map +1 -0
  42. package/dist/design-system126.js +176 -6
  43. package/dist/design-system126.js.map +1 -1
  44. package/dist/design-system128.js +8 -0
  45. package/dist/design-system128.js.map +1 -0
  46. package/dist/design-system129.js +213 -5
  47. package/dist/design-system129.js.map +1 -1
  48. package/dist/design-system131.js +5 -90
  49. package/dist/design-system131.js.map +1 -1
  50. package/dist/design-system132.js +166 -0
  51. package/dist/design-system132.js.map +1 -0
  52. package/dist/design-system134.js +5 -42
  53. package/dist/design-system134.js.map +1 -1
  54. package/dist/design-system135.js +12 -0
  55. package/dist/design-system135.js.map +1 -0
  56. package/dist/design-system136.js +274 -5
  57. package/dist/design-system136.js.map +1 -1
  58. package/dist/design-system138.js +9 -0
  59. package/dist/{design-system124.js.map → design-system138.js.map} +1 -1
  60. package/dist/design-system139.js +16 -5
  61. package/dist/design-system139.js.map +1 -1
  62. package/dist/design-system141.js +8 -0
  63. package/dist/{design-system127.js.map → design-system141.js.map} +1 -1
  64. package/dist/design-system142.js +12 -5
  65. package/dist/design-system142.js.map +1 -1
  66. package/dist/design-system143.js +78 -83
  67. package/dist/design-system143.js.map +1 -1
  68. package/dist/design-system145.js +1 -1
  69. package/dist/design-system145.js.map +1 -1
  70. package/dist/design-system146.js +42 -9
  71. package/dist/design-system146.js.map +1 -1
  72. package/dist/design-system148.js +3 -2
  73. package/dist/design-system148.js.map +1 -1
  74. package/dist/design-system149.js +230 -18
  75. package/dist/design-system149.js.map +1 -1
  76. package/dist/design-system151.js +5 -158
  77. package/dist/design-system151.js.map +1 -1
  78. package/dist/{design-system140.js → design-system152.js} +6 -6
  79. package/dist/{design-system140.js.map → design-system152.js.map} +1 -1
  80. package/dist/design-system154.js +5 -307
  81. package/dist/design-system154.js.map +1 -1
  82. package/dist/design-system155.js +98 -0
  83. package/dist/design-system155.js.map +1 -0
  84. package/dist/design-system157.js +5 -240
  85. package/dist/design-system157.js.map +1 -1
  86. package/dist/design-system158.js +12 -0
  87. package/dist/design-system158.js.map +1 -0
  88. package/dist/design-system159.js +37 -5
  89. package/dist/design-system159.js.map +1 -1
  90. package/dist/design-system160.js +4 -189
  91. package/dist/design-system160.js.map +1 -1
  92. package/dist/design-system161.js +24 -0
  93. package/dist/{design-system150.js.map → design-system161.js.map} +1 -1
  94. package/dist/design-system162.js +2 -3
  95. package/dist/design-system162.js.map +1 -1
  96. package/dist/design-system163.js +158 -3
  97. package/dist/design-system163.js.map +1 -1
  98. package/dist/{design-system153.js → design-system165.js} +2 -2
  99. package/dist/{design-system153.js.map → design-system165.js.map} +1 -1
  100. package/dist/design-system166.js +307 -6
  101. package/dist/design-system166.js.map +1 -1
  102. package/dist/{design-system156.js → design-system168.js} +2 -2
  103. package/dist/{design-system156.js.map → design-system168.js.map} +1 -1
  104. package/dist/design-system169.js +167 -6
  105. package/dist/design-system169.js.map +1 -1
  106. package/dist/design-system171.js +8 -0
  107. package/dist/design-system171.js.map +1 -0
  108. package/dist/design-system172.js +240 -6
  109. package/dist/design-system172.js.map +1 -1
  110. package/dist/design-system174.js +8 -0
  111. package/dist/design-system174.js.map +1 -0
  112. package/dist/design-system175.js +189 -6
  113. package/dist/design-system175.js.map +1 -1
  114. package/dist/design-system177.js +8 -0
  115. package/dist/design-system177.js.map +1 -0
  116. package/dist/design-system178.js +3 -5
  117. package/dist/design-system178.js.map +1 -1
  118. package/dist/design-system179.js +58 -11
  119. package/dist/design-system179.js.map +1 -1
  120. package/dist/design-system181.js +9 -0
  121. package/dist/design-system181.js.map +1 -0
  122. package/dist/design-system182.js +56 -6
  123. package/dist/design-system182.js.map +1 -1
  124. package/dist/design-system184.js +9 -0
  125. package/dist/{design-system167.js.map → design-system184.js.map} +1 -1
  126. package/dist/design-system185.js +69 -5
  127. package/dist/design-system185.js.map +1 -1
  128. package/dist/design-system187.js +9 -0
  129. package/dist/{design-system170.js.map → design-system187.js.map} +1 -1
  130. package/dist/design-system188.js +182 -5
  131. package/dist/design-system188.js.map +1 -1
  132. package/dist/design-system190.js +9 -0
  133. package/dist/design-system190.js.map +1 -0
  134. package/dist/design-system191.js +115 -5
  135. package/dist/design-system191.js.map +1 -1
  136. package/dist/design-system193.js +8 -0
  137. package/dist/{design-system176.js.map → design-system193.js.map} +1 -1
  138. package/dist/design-system194.js +11 -5
  139. package/dist/design-system194.js.map +1 -1
  140. package/dist/design-system195.js +453 -24
  141. package/dist/design-system195.js.map +1 -1
  142. package/dist/design-system197.js +5 -4
  143. package/dist/design-system197.js.map +1 -1
  144. package/dist/design-system198.js +20 -16
  145. package/dist/design-system198.js.map +1 -1
  146. package/dist/design-system200.js +1 -1
  147. package/dist/design-system200.js.map +1 -1
  148. package/dist/design-system201.js +70 -314
  149. package/dist/design-system201.js.map +1 -1
  150. package/dist/design-system203.js +1 -1
  151. package/dist/design-system203.js.map +1 -1
  152. package/dist/design-system204.js +24 -89
  153. package/dist/design-system204.js.map +1 -1
  154. package/dist/design-system206.js +1 -1
  155. package/dist/design-system206.js.map +1 -1
  156. package/dist/design-system207.js +26 -17
  157. package/dist/design-system207.js.map +1 -1
  158. package/dist/design-system209.js +5 -3
  159. package/dist/design-system209.js.map +1 -1
  160. package/dist/design-system210.js +22 -408
  161. package/dist/design-system210.js.map +1 -1
  162. package/dist/design-system212.js +1 -1
  163. package/dist/design-system212.js.map +1 -1
  164. package/dist/design-system213.js +24 -52
  165. package/dist/design-system213.js.map +1 -1
  166. package/dist/design-system215.js +1 -1
  167. package/dist/design-system215.js.map +1 -1
  168. package/dist/design-system216.js +329 -85
  169. package/dist/design-system216.js.map +1 -1
  170. package/dist/design-system218.js +5 -108
  171. package/dist/design-system218.js.map +1 -1
  172. package/dist/design-system219.js +103 -0
  173. package/dist/design-system219.js.map +1 -0
  174. package/dist/design-system221.js +5 -106
  175. package/dist/design-system221.js.map +1 -1
  176. package/dist/design-system222.js +22 -0
  177. package/dist/{design-system208.js.map → design-system222.js.map} +1 -1
  178. package/dist/design-system223.js +4 -6
  179. package/dist/design-system223.js.map +1 -1
  180. package/dist/design-system224.js +3 -737
  181. package/dist/design-system224.js.map +1 -1
  182. package/dist/design-system225.js +422 -0
  183. package/dist/design-system225.js.map +1 -0
  184. package/dist/design-system227.js +5 -11
  185. package/dist/design-system227.js.map +1 -1
  186. package/dist/design-system228.js +51 -517
  187. package/dist/design-system228.js.map +1 -1
  188. package/dist/design-system230.js +1 -1
  189. package/dist/design-system230.js.map +1 -1
  190. package/dist/design-system231.js +88 -3
  191. package/dist/design-system231.js.map +1 -1
  192. package/dist/design-system232.js +4 -46
  193. package/dist/design-system232.js.map +1 -1
  194. package/dist/design-system233.js +108 -4
  195. package/dist/design-system233.js.map +1 -1
  196. package/dist/{design-system220.js → design-system235.js} +2 -2
  197. package/dist/{design-system220.js.map → design-system235.js.map} +1 -1
  198. package/dist/design-system236.js +106 -5
  199. package/dist/design-system236.js.map +1 -1
  200. package/dist/design-system238.js +9 -0
  201. package/dist/design-system238.js.map +1 -0
  202. package/dist/design-system239.js +737 -5
  203. package/dist/design-system239.js.map +1 -1
  204. package/dist/{design-system226.js → design-system241.js} +2 -2
  205. package/dist/{design-system226.js.map → design-system241.js.map} +1 -1
  206. package/dist/design-system242.js +3 -5
  207. package/dist/design-system242.js.map +1 -1
  208. package/dist/design-system243.js +42 -50
  209. package/dist/design-system243.js.map +1 -1
  210. package/dist/design-system244.js +1 -1
  211. package/dist/design-system244.js.map +1 -1
  212. package/dist/design-system245.js +254 -141
  213. package/dist/design-system245.js.map +1 -1
  214. package/dist/design-system247.js +1 -1
  215. package/dist/design-system247.js.map +1 -1
  216. package/dist/design-system248.js +119 -7
  217. package/dist/design-system248.js.map +1 -1
  218. package/dist/design-system250.js +8 -0
  219. package/dist/design-system250.js.map +1 -0
  220. package/dist/design-system251.js +172 -5
  221. package/dist/design-system251.js.map +1 -1
  222. package/dist/design-system253.js +8 -0
  223. package/dist/design-system253.js.map +1 -0
  224. package/dist/design-system254.js +11 -6
  225. package/dist/design-system254.js.map +1 -1
  226. package/dist/design-system255.js +525 -9
  227. package/dist/design-system255.js.map +1 -1
  228. package/dist/design-system257.js +8 -0
  229. package/dist/design-system257.js.map +1 -0
  230. package/dist/design-system258.js +112 -6
  231. package/dist/design-system258.js.map +1 -1
  232. package/dist/design-system260.js +5 -374
  233. package/dist/design-system260.js.map +1 -1
  234. package/dist/design-system261.js +57 -0
  235. package/dist/design-system261.js.map +1 -0
  236. package/dist/design-system262.js +4 -6
  237. package/dist/design-system262.js.map +1 -1
  238. package/dist/design-system263.js +173 -0
  239. package/dist/design-system263.js.map +1 -0
  240. package/dist/design-system265.js +8 -0
  241. package/dist/design-system265.js.map +1 -0
  242. package/dist/design-system266.js +10 -0
  243. package/dist/design-system266.js.map +1 -0
  244. package/dist/{design-system249.js → design-system267.js} +2 -2
  245. package/dist/{design-system249.js.map → design-system267.js.map} +1 -1
  246. package/dist/design-system269.js +8 -0
  247. package/dist/design-system269.js.map +1 -0
  248. package/dist/{design-system252.js → design-system270.js} +1 -1
  249. package/dist/{design-system252.js.map → design-system270.js.map} +1 -1
  250. package/dist/design-system272.js +9 -0
  251. package/dist/design-system272.js.map +1 -0
  252. package/dist/design-system273.js +12 -0
  253. package/dist/design-system273.js.map +1 -0
  254. package/dist/{design-system256.js → design-system274.js} +2 -2
  255. package/dist/{design-system256.js.map → design-system274.js.map} +1 -1
  256. package/dist/design-system276.js +9 -0
  257. package/dist/design-system276.js.map +1 -0
  258. package/dist/{design-system259.js → design-system277.js} +1 -1
  259. package/dist/{design-system259.js.map → design-system277.js.map} +1 -1
  260. package/dist/design-system278.js +377 -0
  261. package/dist/design-system278.js.map +1 -0
  262. package/dist/design-system280.js +9 -0
  263. package/dist/design-system280.js.map +1 -0
  264. package/dist/design-system69.js +182 -13
  265. package/dist/design-system69.js.map +1 -1
  266. package/dist/design-system71.js +8 -0
  267. package/dist/design-system71.js.map +1 -0
  268. package/dist/design-system72.js +13 -5
  269. package/dist/design-system72.js.map +1 -1
  270. package/dist/design-system73.js +677 -139
  271. package/dist/design-system73.js.map +1 -1
  272. package/dist/design-system75.js +1 -1
  273. package/dist/design-system75.js.map +1 -1
  274. package/dist/design-system76.js +152 -23
  275. package/dist/design-system76.js.map +1 -1
  276. package/dist/design-system78.js +5 -49
  277. package/dist/design-system78.js.map +1 -1
  278. package/dist/design-system79.js +32 -0
  279. package/dist/design-system79.js.map +1 -0
  280. package/dist/design-system80.js +2 -3
  281. package/dist/design-system80.js.map +1 -1
  282. package/dist/design-system81.js +38 -188
  283. package/dist/design-system81.js.map +1 -1
  284. package/dist/design-system83.js +1 -1
  285. package/dist/design-system83.js.map +1 -1
  286. package/dist/design-system84.js +199 -7
  287. package/dist/design-system84.js.map +1 -1
  288. package/dist/design-system86.js +8 -0
  289. package/dist/design-system86.js.map +1 -0
  290. package/dist/design-system87.js +7 -5
  291. package/dist/design-system87.js.map +1 -1
  292. package/dist/design-system88.js +264 -48
  293. package/dist/design-system88.js.map +1 -1
  294. package/dist/design-system90.js +1 -1
  295. package/dist/design-system90.js.map +1 -1
  296. package/dist/design-system91.js +57 -11
  297. package/dist/design-system91.js.map +1 -1
  298. package/dist/design-system93.js +8 -0
  299. package/dist/design-system93.js.map +1 -0
  300. package/dist/design-system94.js +11 -5
  301. package/dist/design-system94.js.map +1 -1
  302. package/dist/design-system95.js +92 -59
  303. package/dist/design-system95.js.map +1 -1
  304. package/dist/design-system97.js +1 -1
  305. package/dist/design-system97.js.map +1 -1
  306. package/dist/design-system98.js +56 -78
  307. package/dist/design-system98.js.map +1 -1
  308. package/dist/types/components/BContextMenu/BContextMenu.spec.d.ts +1 -0
  309. package/dist/types/components/BContextMenu/BContextMenu.vue.d.ts +42 -0
  310. package/dist/types/components/BContextMenu/index.d.ts +2 -0
  311. package/dist/types/components/BContextMenu/types.d.ts +23 -0
  312. package/dist/types/components/BInputTags/BInputTags.spec.d.ts +1 -0
  313. package/dist/types/components/BInputTags/BInputTags.vue.d.ts +54 -0
  314. package/dist/types/components/BInputTags/index.d.ts +1 -0
  315. package/dist/types/components/BLink/BLink.spec.d.ts +1 -0
  316. package/dist/types/components/BLink/BLink.vue.d.ts +100 -0
  317. package/dist/types/components/BLink/index.d.ts +1 -0
  318. package/dist/types/components/BListbox/BListbox.spec.d.ts +1 -0
  319. package/dist/types/components/BListbox/BListbox.vue.d.ts +52 -0
  320. package/dist/types/components/BListbox/index.d.ts +1 -0
  321. package/dist/types/components/BModal/BModal.spec.d.ts +1 -0
  322. package/dist/types/components/BPinInput/BPinInput.spec.d.ts +1 -0
  323. package/dist/types/components/BPinInput/BPinInput.vue.d.ts +43 -0
  324. package/dist/types/components/BPinInput/index.d.ts +1 -0
  325. package/dist/types/components/BProgress/BProgress.vue.d.ts +47 -2
  326. package/dist/types/components/BTextarea/BTextarea.spec.d.ts +1 -0
  327. package/dist/types/components/BTextarea/BTextarea.vue.d.ts +77 -0
  328. package/dist/types/components/BTextarea/index.d.ts +1 -0
  329. package/dist/types/components/index.d.ts +7 -1
  330. package/package.json +1 -1
  331. package/dist/design-system114.js +0 -212
  332. package/dist/design-system114.js.map +0 -1
  333. package/dist/design-system124.js +0 -277
  334. package/dist/design-system127.js +0 -19
  335. package/dist/design-system130.js +0 -15
  336. package/dist/design-system130.js.map +0 -1
  337. package/dist/design-system133.js +0 -8
  338. package/dist/design-system133.js.map +0 -1
  339. package/dist/design-system137.js +0 -236
  340. package/dist/design-system137.js.map +0 -1
  341. package/dist/design-system147.js +0 -40
  342. package/dist/design-system147.js.map +0 -1
  343. package/dist/design-system150.js +0 -7
  344. package/dist/design-system164.js +0 -61
  345. package/dist/design-system164.js.map +0 -1
  346. package/dist/design-system167.js +0 -59
  347. package/dist/design-system170.js +0 -72
  348. package/dist/design-system173.js +0 -185
  349. package/dist/design-system173.js.map +0 -1
  350. package/dist/design-system176.js +0 -118
  351. package/dist/design-system180.js +0 -465
  352. package/dist/design-system180.js.map +0 -1
  353. package/dist/design-system183.js +0 -38
  354. package/dist/design-system183.js.map +0 -1
  355. package/dist/design-system186.js +0 -91
  356. package/dist/design-system186.js.map +0 -1
  357. package/dist/design-system189.js +0 -38
  358. package/dist/design-system189.js.map +0 -1
  359. package/dist/design-system192.js +0 -31
  360. package/dist/design-system192.js.map +0 -1
  361. package/dist/design-system208.js +0 -7
  362. package/dist/design-system217.js +0 -7
  363. package/dist/design-system217.js.map +0 -1
  364. package/dist/design-system234.js +0 -286
  365. package/dist/design-system234.js.map +0 -1
  366. package/dist/design-system237.js +0 -122
  367. package/dist/design-system237.js.map +0 -1
  368. package/dist/design-system240.js +0 -115
  369. package/dist/design-system240.js.map +0 -1
  370. package/dist/design-system70.js +0 -699
  371. package/dist/design-system70.js.map +0 -1
  372. package/dist/design-system77.js +0 -7
  373. package/dist/design-system77.js.map +0 -1
  374. package/dist/design-system85.js +0 -276
  375. package/dist/design-system85.js.map +0 -1
  376. package/dist/design-system92.js +0 -102
  377. package/dist/design-system92.js.map +0 -1
@@ -1,6 +1,161 @@
1
- //#region src/components/BRadio/types.ts
2
- var e = Symbol("BRadioGroup");
1
+ import { BNotificationPlacement as e, BNotificationType as t } from "./design-system3.js";
2
+ import { Teleport as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, nextTick as f, normalizeClass as p, onUnmounted as m, openBlock as h, ref as g, renderSlot as _, toDisplayString as v, unref as y, useId as b, watch as x, withCtx as S } from "vue";
3
+ //#region src/components/BNotification/BNotification.vue?vue&type=script&setup=true&lang.ts
4
+ var C = [
5
+ "id",
6
+ "role",
7
+ "aria-live",
8
+ "aria-describedby"
9
+ ], w = {
10
+ key: 0,
11
+ class: "b-notification__icon",
12
+ "aria-hidden": "true"
13
+ }, T = ["innerHTML"], E = {
14
+ key: 1,
15
+ class: "b-notification__icon-svg",
16
+ viewBox: "0 0 24 24",
17
+ xmlns: "http://www.w3.org/2000/svg",
18
+ focusable: "false",
19
+ "aria-hidden": "true"
20
+ }, D = ["d"], O = { class: "b-notification__body" }, k = {
21
+ key: 1,
22
+ class: "b-notification__btn"
23
+ }, A = ["innerHTML"], j = {
24
+ key: 1,
25
+ class: "b-notification__close-svg",
26
+ viewBox: "0 0 24 24",
27
+ xmlns: "http://www.w3.org/2000/svg",
28
+ focusable: "false",
29
+ "aria-hidden": "true"
30
+ }, M = "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z", N = /* @__PURE__ */ d({
31
+ __name: "BNotification",
32
+ props: {
33
+ type: { default: () => void 0 },
34
+ message: { default: "" },
35
+ description: { default: "" },
36
+ placement: { default: () => e.TopRight },
37
+ duration: { default: 4.5 },
38
+ closable: {
39
+ type: Boolean,
40
+ default: !0
41
+ },
42
+ showIcon: {
43
+ type: Boolean,
44
+ default: !0
45
+ },
46
+ icon: {},
47
+ closeIcon: {},
48
+ btn: {},
49
+ modelValue: {
50
+ type: Boolean,
51
+ default: () => void 0
52
+ }
53
+ },
54
+ emits: [
55
+ "close",
56
+ "afterClose",
57
+ "update:modelValue"
58
+ ],
59
+ setup(e, { expose: d, emit: N }) {
60
+ let P = N, F = b(), I = `${F}-title`, L = `${F}-desc`, R = g(!1), z = g(null), B = g(null), V = i(() => e.modelValue === void 0 ? R.value : e.modelValue), H = i(() => e.modelValue !== void 0), U = i(() => e.type === t.Error || e.type === t.Warning ? "alert" : "status"), W = i(() => U.value === "alert" ? "assertive" : "polite"), G = i(() => !!(e.type && e.showIcon) || !!e.icon || !1), K = i(() => !!e.description), q = i(() => {
61
+ switch (e.type) {
62
+ case t.Success: return "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z";
63
+ case t.Warning: return "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z";
64
+ case t.Error: return "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z";
65
+ default: return "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z";
66
+ }
67
+ }), J = null;
68
+ function Y() {
69
+ X(), e.duration > 0 && (J = setTimeout(() => {
70
+ Q();
71
+ }, e.duration * 1e3));
72
+ }
73
+ function X() {
74
+ J !== null && (clearTimeout(J), J = null);
75
+ }
76
+ function Z() {
77
+ H.value ? P("update:modelValue", !0) : R.value = !0;
78
+ }
79
+ function Q() {
80
+ P("close"), H.value ? P("update:modelValue", !1) : R.value = !1;
81
+ }
82
+ function $() {
83
+ B.value && document.contains(B.value) && (B.value.focus(), B.value = null), P("afterClose");
84
+ }
85
+ function ee() {
86
+ X();
87
+ }
88
+ function te() {
89
+ Y();
90
+ }
91
+ function ne(t) {
92
+ t.key === "Escape" && e.closable && (t.stopPropagation(), Q());
93
+ }
94
+ return x(V, async (t) => {
95
+ t ? (B.value = document.activeElement, Y(), e.closable && (await f(), (z.value?.querySelector(".b-notification__close"))?.focus())) : X();
96
+ }, { immediate: !0 }), m(() => {
97
+ X();
98
+ }), d({
99
+ open: Z,
100
+ close: Q
101
+ }), (t, i) => (h(), a(n, { to: "body" }, [u(r, {
102
+ name: "b-notification-fade",
103
+ onAfterLeave: $
104
+ }, {
105
+ default: S(() => [V.value ? (h(), s("div", {
106
+ key: 0,
107
+ id: y(F),
108
+ ref_key: "notificationRef",
109
+ ref: z,
110
+ class: p(["b-notification", [
111
+ e.placement && `b-notification--${e.placement}`,
112
+ e.type && `b-notification--${e.type}`,
113
+ {
114
+ "b-notification--with-icon": G.value,
115
+ "b-notification--with-description": K.value
116
+ }
117
+ ]]),
118
+ role: U.value,
119
+ "aria-live": W.value,
120
+ "aria-atomic": !0,
121
+ "aria-labelledby": I,
122
+ "aria-describedby": K.value ? L : void 0,
123
+ onMouseenter: ee,
124
+ onMouseleave: te,
125
+ onKeydown: ne
126
+ }, [
127
+ G.value ? (h(), s("span", w, [_(t.$slots, "icon", {}, () => [e.icon ? (h(), s("span", {
128
+ key: 0,
129
+ innerHTML: e.icon
130
+ }, null, 8, T)) : e.type ? (h(), s("svg", E, [c("path", { d: q.value }, null, 8, D)])) : o("", !0)])])) : o("", !0),
131
+ c("div", O, [
132
+ c("div", {
133
+ id: I,
134
+ class: "b-notification__message"
135
+ }, [_(t.$slots, "message", {}, () => [l(v(e.message), 1)])]),
136
+ K.value || t.$slots.description ? (h(), s("div", {
137
+ key: 0,
138
+ id: L,
139
+ class: "b-notification__description"
140
+ }, [_(t.$slots, "description", {}, () => [l(v(e.description), 1)])])) : o("", !0),
141
+ e.btn || t.$slots.btn ? (h(), s("div", k, [_(t.$slots, "btn", {}, () => [l(v(e.btn), 1)])])) : o("", !0)
142
+ ]),
143
+ e.closable ? (h(), s("button", {
144
+ key: 1,
145
+ type: "button",
146
+ class: "b-notification__close",
147
+ "aria-label": "Close notification",
148
+ onClick: Q
149
+ }, [_(t.$slots, "closeIcon", {}, () => [e.closeIcon ? (h(), s("span", {
150
+ key: 0,
151
+ innerHTML: e.closeIcon
152
+ }, null, 8, A)) : (h(), s("svg", j, [c("path", { d: M })]))])])) : o("", !0)
153
+ ], 42, C)) : o("", !0)]),
154
+ _: 3
155
+ })]));
156
+ }
157
+ });
3
158
  //#endregion
4
- export { e as B_RADIO_GROUP_KEY };
159
+ export { N as default };
5
160
 
6
161
  //# sourceMappingURL=design-system163.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"design-system163.js","names":[],"sources":["../src/components/BRadio/types.ts"],"sourcesContent":["import type { InjectionKey, Ref } from 'vue';\n\nexport interface BRadioOption {\n /** Display label for the radio */\n label: string;\n /** Value associated with this radio */\n value: string | number;\n /** Whether this specific radio is disabled */\n disabled?: boolean;\n}\n\nexport interface BRadioGroupContext {\n modelValue: Ref<string | number | undefined>;\n disabled: Ref<boolean>;\n name: Ref<string>;\n size: Ref<'large' | 'middle' | 'small'>;\n optionType: Ref<'default' | 'button'>;\n buttonStyle: Ref<'outline' | 'solid'>;\n setValue: (val: string | number) => void;\n}\n\nexport const B_RADIO_GROUP_KEY: InjectionKey<BRadioGroupContext> = Symbol('BRadioGroup');\n"],"mappings":";AAqBA,IAAa,IAAsD,OAAO,cAAc"}
1
+ {"version":3,"file":"design-system163.js","names":["$slots"],"sources":["../src/components/BNotification/BNotification.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { BNotificationPlacement, BNotificationType } from '@/types.ts';\nimport { computed, nextTick, onUnmounted, ref, useId, watch } from 'vue';\n\n// ─────────────────────────────────────────────\n// Props & emits\n// ─────────────────────────────────────────────\nconst {\n type = undefined,\n message = '',\n description = '',\n placement = BNotificationPlacement.TopRight,\n duration = 4.5,\n closable = true,\n showIcon = true,\n icon,\n closeIcon,\n btn,\n modelValue = undefined,\n} = defineProps<{\n /**\n * Notification type - controls the icon and colour scheme.\n * When omitted no type-colour is applied (plain notification).\n */\n type?: `${BNotificationType}`;\n /** Short title / heading of the notification. */\n message?: string;\n /** Optional detailed description below the title. */\n description?: string;\n /**\n * Placement of the notification on the viewport.\n * @default 'top-right'\n */\n placement?: `${BNotificationPlacement}`;\n /**\n * Auto-close delay in seconds. Set to `0` to disable auto-close.\n * @default 4.5\n */\n duration?: number;\n /** Show the close button. @default true */\n closable?: boolean;\n /** Show the built-in status icon when `type` is set. @default true */\n showIcon?: boolean;\n /**\n * Custom icon content - overrides the built-in type icon.\n * Also accepts the `icon` slot.\n */\n icon?: string;\n /**\n * Custom close-icon content.\n * Also accepts the `closeIcon` slot.\n */\n closeIcon?: string;\n /**\n * Custom action button area content.\n * Also accepts the `btn` slot.\n */\n btn?: string;\n /**\n * Controlled visibility - when provided the component operates in\n * controlled mode; otherwise it manages its own visibility.\n * Bind with `v-model`.\n */\n modelValue?: boolean;\n}>();\n\nconst emit = defineEmits<{\n /** Fired synchronously when the notification starts closing. */\n (e: 'close'): void;\n /** Fired after the leave-transition fully completes. */\n (e: 'afterClose'): void;\n /** v-model support */\n (e: 'update:modelValue', value: boolean): void;\n}>();\n\ndefineSlots<{\n /** Overrides the `message` prop - the notification title. */\n message?(): unknown;\n /** Overrides the `description` prop. */\n description?(): unknown;\n /** Overrides the built-in status icon. */\n icon?(): unknown;\n /** Overrides the default close icon. */\n closeIcon?(): unknown;\n /** Action button area rendered below the description. */\n btn?(): unknown;\n}>();\n\n// ─────────────────────────────────────────────\n// Internal state\n// ─────────────────────────────────────────────\nconst notificationId = useId();\nconst titleId = `${notificationId}-title`;\nconst descId = `${notificationId}-desc`;\n\n/** Uncontrolled visibility flag - default closed. */\nconst internalVisible = ref(false);\n\n/** Ref to the notification DOM element for focus return. */\nconst notificationRef = ref<HTMLElement | null>(null);\n\n/** Element that had focus before the notification appeared. */\nconst previousFocusRef = ref<HTMLElement | null>(null);\n\n/**\n * Effective visibility:\n * - controlled → honour `modelValue`\n * - uncontrolled → use `internalVisible`\n */\nconst isVisible = computed(() => (modelValue !== undefined ? modelValue : internalVisible.value));\n\nconst isControlled = computed(() => modelValue !== undefined);\n\n// ─────────────────────────────────────────────\n// Derived state\n// ─────────────────────────────────────────────\n/** ARIA role: 'alert' for error/warning (assertive), 'status' for others. */\nconst ariaRole = computed<'alert' | 'status'>(() =>\n type === BNotificationType.Error || type === BNotificationType.Warning ? 'alert' : 'status',\n);\n\n/** aria-live polarity mirrors the role. */\nconst ariaLive = computed(() => (ariaRole.value === 'alert' ? 'assertive' : 'polite'));\n\n/** Whether to show the icon area (needs type and showIcon). */\nconst showIconArea = computed(() => Boolean(type && showIcon) || Boolean(icon) || false);\n\n/** Whether the description is provided via prop or slot. */\nconst hasDescription = computed(() => Boolean(description));\n\n/** Built-in SVG path for the status icon. */\nconst iconPath = computed(() => {\n switch (type) {\n case BNotificationType.Success:\n return 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z';\n case BNotificationType.Warning:\n return 'M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z';\n case BNotificationType.Error:\n return 'M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z';\n default:\n // info (also fallback)\n return 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z';\n }\n});\n\n// Close icon SVG path (× mark)\nconst closeIconPath =\n 'M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z';\n\n// ─────────────────────────────────────────────\n// Auto-close timer\n// ─────────────────────────────────────────────\nlet timer: ReturnType<typeof setTimeout> | null = null;\n\nfunction startTimer() {\n clearTimer();\n if (duration > 0) {\n timer = setTimeout(() => {\n close();\n }, duration * 1000);\n }\n}\n\nfunction clearTimer() {\n if (timer !== null) {\n clearTimeout(timer);\n timer = null;\n }\n}\n\n// ─────────────────────────────────────────────\n// Behaviour\n// ─────────────────────────────────────────────\nfunction open() {\n if (isControlled.value) {\n emit('update:modelValue', true);\n } else {\n internalVisible.value = true;\n }\n}\n\nfunction close() {\n emit('close');\n if (isControlled.value) {\n emit('update:modelValue', false);\n } else {\n internalVisible.value = false;\n }\n}\n\nfunction onAfterLeave() {\n // Return focus to the previously-focused element\n if (previousFocusRef.value && document.contains(previousFocusRef.value)) {\n previousFocusRef.value.focus();\n previousFocusRef.value = null;\n }\n emit('afterClose');\n}\n\nfunction onMouseEnter() {\n clearTimer();\n}\n\nfunction onMouseLeave() {\n startTimer();\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape' && closable) {\n event.stopPropagation();\n close();\n }\n}\n\n// ─────────────────────────────────────────────\n// Visibility watcher - manage timer + focus\n// ─────────────────────────────────────────────\nwatch(\n isVisible,\n async (visible) => {\n if (visible) {\n // Capture current focus for return-on-close\n previousFocusRef.value = document.activeElement as HTMLElement | null;\n startTimer();\n // Focus the close button (if closable) once the DOM updates\n if (closable) {\n await nextTick();\n const closeBtn =\n notificationRef.value?.querySelector<HTMLElement>('.b-notification__close');\n closeBtn?.focus();\n }\n } else {\n clearTimer();\n }\n },\n { immediate: true },\n);\n\n// ─────────────────────────────────────────────\n// Lifecycle\n// ─────────────────────────────────────────────\nonUnmounted(() => {\n clearTimer();\n});\n\n// Expose open & close for imperative usage\ndefineExpose({ open, close });\n</script>\n\n<template>\n <Teleport to=\"body\">\n <Transition name=\"b-notification-fade\" @after-leave=\"onAfterLeave\">\n <div\n v-if=\"isVisible\"\n :id=\"notificationId\"\n ref=\"notificationRef\"\n class=\"b-notification\"\n :class=\"[\n placement && `b-notification--${placement}`,\n type && `b-notification--${type}`,\n {\n 'b-notification--with-icon': showIconArea,\n 'b-notification--with-description': hasDescription,\n },\n ]\"\n :role=\"ariaRole\"\n :aria-live=\"ariaLive\"\n :aria-atomic=\"true\"\n :aria-labelledby=\"titleId\"\n :aria-describedby=\"hasDescription ? descId : undefined\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n @keydown=\"onKeydown\"\n >\n <!-- Icon area -->\n <span v-if=\"showIconArea\" class=\"b-notification__icon\" aria-hidden=\"true\">\n <slot name=\"icon\">\n <!-- Custom icon prop as raw HTML (consumer's responsibility) -->\n <span v-if=\"icon\" v-html=\"icon\" />\n <!-- Built-in type icon -->\n <svg\n v-else-if=\"type\"\n class=\"b-notification__icon-svg\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n >\n <path :d=\"iconPath\" />\n </svg>\n </slot>\n </span>\n\n <!-- Body -->\n <div class=\"b-notification__body\">\n <!-- Title -->\n <div :id=\"titleId\" class=\"b-notification__message\">\n <slot name=\"message\">{{ message }}</slot>\n </div>\n\n <!-- Description -->\n <div\n v-if=\"hasDescription || $slots.description\"\n :id=\"descId\"\n class=\"b-notification__description\"\n >\n <slot name=\"description\">{{ description }}</slot>\n </div>\n\n <!-- Action button area -->\n <div v-if=\"btn || $slots.btn\" class=\"b-notification__btn\">\n <slot name=\"btn\">{{ btn }}</slot>\n </div>\n </div>\n\n <!-- Close button -->\n <button\n v-if=\"closable\"\n type=\"button\"\n class=\"b-notification__close\"\n aria-label=\"Close notification\"\n @click=\"close\"\n >\n <slot name=\"closeIcon\">\n <span v-if=\"closeIcon\" v-html=\"closeIcon\" />\n <svg\n v-else\n class=\"b-notification__close-svg\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n >\n <path :d=\"closeIconPath\" />\n </svg>\n </slot>\n </button>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style>\n/* ────────────────────────────────────────────\n CSS Custom Properties (tokens)\n ──────────────────────────────────────────── */\n.b-notification {\n /* Layout */\n --b-notification-width: 22rem;\n --b-notification-padding-v: 1rem;\n --b-notification-padding-h: 1.5rem;\n --b-notification-border-radius: 0.5rem;\n --b-notification-icon-size: 1.5rem;\n --b-notification-gap: 0.75rem;\n --b-notification-close-size: 1rem;\n --b-notification-font-size-title: 1rem;\n --b-notification-font-size-desc: 0.875rem;\n --b-notification-line-height: 1.5;\n --b-notification-z-index: 1010;\n\n /* Offset from viewport edge */\n --b-notification-offset: 1.5rem;\n\n /* Colours (default / plain) */\n --b-notification-bg: #ffffff;\n --b-notification-border-color: oklch(90% 0.02 240);\n --b-notification-title-color: oklch(20% 0.02 240);\n --b-notification-desc-color: oklch(45% 0.02 240);\n --b-notification-close-color: oklch(50% 0.02 240);\n --b-notification-close-hover-color: oklch(20% 0.02 240);\n --b-notification-icon-color: oklch(62.3% 0.214 259.815);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05);\n\n /* Animation */\n --b-notification-transition-duration: 300ms;\n}\n\n/* ── Variant colour tokens ── */\n.b-notification--success {\n --b-notification-icon-color: oklch(72.3% 0.219 149.579);\n}\n\n.b-notification--info {\n --b-notification-icon-color: oklch(62.3% 0.214 259.815);\n}\n\n.b-notification--warning {\n --b-notification-icon-color: oklch(75% 0.183 55.934);\n}\n\n.b-notification--error {\n --b-notification-icon-color: oklch(63.7% 0.237 25.331);\n}\n\n/* ── Dark mode ── */\n[data-prefers-color='dark'] .b-notification {\n --b-notification-bg: oklch(22% 0.02 240);\n --b-notification-border-color: oklch(35% 0.03 240);\n --b-notification-title-color: oklch(92% 0.02 240);\n --b-notification-desc-color: oklch(70% 0.02 240);\n --b-notification-close-color: oklch(60% 0.02 240);\n --b-notification-close-hover-color: oklch(90% 0.02 240);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 3px 6px -4px rgba(0, 0, 0, 0.48),\n 0 9px 28px 8px rgba(0, 0, 0, 0.2);\n}\n\n@media (prefers-color-scheme: dark) {\n [data-prefers-color='system'] .b-notification {\n --b-notification-bg: oklch(22% 0.02 240);\n --b-notification-border-color: oklch(35% 0.03 240);\n --b-notification-title-color: oklch(92% 0.02 240);\n --b-notification-desc-color: oklch(70% 0.02 240);\n --b-notification-close-color: oklch(60% 0.02 240);\n --b-notification-close-hover-color: oklch(90% 0.02 240);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 3px 6px -4px rgba(0, 0, 0, 0.48),\n 0 9px 28px 8px rgba(0, 0, 0, 0.2);\n }\n}\n\n/* ─────────────────────────────────────────────\n Base layout\n ───────────────────────────────────────────── */\n.b-notification {\n position: fixed;\n z-index: var(--b-notification-z-index);\n display: flex;\n align-items: flex-start;\n gap: var(--b-notification-gap);\n width: var(--b-notification-width);\n max-width: calc(100vw - 2 * var(--b-notification-offset));\n padding: var(--b-notification-padding-v) var(--b-notification-padding-h);\n border-radius: var(--b-notification-border-radius);\n background-color: var(--b-notification-bg);\n box-shadow: var(--b-notification-shadow);\n box-sizing: border-box;\n word-break: break-word;\n pointer-events: auto;\n outline: none;\n}\n\n/* ── Placement ── */\n.b-notification--top-right {\n top: var(--b-notification-offset);\n right: var(--b-notification-offset);\n}\n\n.b-notification--top-left {\n top: var(--b-notification-offset);\n left: var(--b-notification-offset);\n}\n\n.b-notification--bottom-right {\n bottom: var(--b-notification-offset);\n right: var(--b-notification-offset);\n}\n\n.b-notification--bottom-left {\n bottom: var(--b-notification-offset);\n left: var(--b-notification-offset);\n}\n\n/* ── Icon area ── */\n.b-notification__icon {\n display: inline-flex;\n flex-shrink: 0;\n align-items: flex-start;\n padding-top: 0.125rem;\n color: var(--b-notification-icon-color);\n line-height: 1;\n}\n\n.b-notification__icon-svg {\n width: var(--b-notification-icon-size);\n height: var(--b-notification-icon-size);\n fill: currentColor;\n display: block;\n}\n\n/* ── Body ── */\n.b-notification__body {\n flex: 1;\n min-width: 0;\n}\n\n/* ── Title ── */\n.b-notification__message {\n font-size: var(--b-notification-font-size-title);\n font-weight: 600;\n line-height: var(--b-notification-line-height);\n color: var(--b-notification-title-color);\n padding-right: 1.5rem; /* space for close button */\n}\n\n/* When no close button, remove the padding */\n.b-notification:not(:has(.b-notification__close)) .b-notification__message {\n padding-right: 0;\n}\n\n/* ── Description ── */\n.b-notification__description {\n margin-top: 0.375rem;\n font-size: var(--b-notification-font-size-desc);\n line-height: var(--b-notification-line-height);\n color: var(--b-notification-desc-color);\n}\n\n/* ── Action button area ── */\n.b-notification__btn {\n margin-top: 0.75rem;\n}\n\n/* ── Close button ── */\n.b-notification__close {\n position: absolute;\n top: 0.875rem;\n right: 1rem;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.125rem;\n background: transparent;\n border: none;\n border-radius: 0.25rem;\n cursor: pointer;\n color: var(--b-notification-close-color);\n line-height: 1;\n transition: color var(--b-notification-transition-duration) ease;\n}\n\n.b-notification__close:hover {\n color: var(--b-notification-close-hover-color);\n}\n\n.b-notification__close:focus-visible {\n outline: 2px solid oklch(62.3% 0.214 259.815);\n outline-offset: 2px;\n}\n\n.b-notification__close-svg {\n width: var(--b-notification-close-size);\n height: var(--b-notification-close-size);\n fill: currentColor;\n display: block;\n}\n\n/* ─────────────────────────────────────────────\n Transition – slide-in + fade per placement\n ───────────────────────────────────────────── */\n.b-notification-fade-enter-active,\n.b-notification-fade-leave-active {\n transition:\n opacity var(--b-notification-transition-duration, 300ms) ease,\n transform var(--b-notification-transition-duration, 300ms) ease;\n}\n\n/* top-right / bottom-right - slide in from right */\n.b-notification--top-right.b-notification-fade-enter-from,\n.b-notification--bottom-right.b-notification-fade-enter-from {\n opacity: 0;\n transform: translateX(100%);\n}\n\n.b-notification--top-right.b-notification-fade-enter-to,\n.b-notification--bottom-right.b-notification-fade-enter-to,\n.b-notification--top-right.b-notification-fade-leave-from,\n.b-notification--bottom-right.b-notification-fade-leave-from {\n opacity: 1;\n transform: translateX(0);\n}\n\n.b-notification--top-right.b-notification-fade-leave-to,\n.b-notification--bottom-right.b-notification-fade-leave-to {\n opacity: 0;\n transform: translateX(100%);\n}\n\n/* top-left / bottom-left - slide in from left */\n.b-notification--top-left.b-notification-fade-enter-from,\n.b-notification--bottom-left.b-notification-fade-enter-from {\n opacity: 0;\n transform: translateX(-100%);\n}\n\n.b-notification--top-left.b-notification-fade-enter-to,\n.b-notification--bottom-left.b-notification-fade-enter-to,\n.b-notification--top-left.b-notification-fade-leave-from,\n.b-notification--bottom-left.b-notification-fade-leave-from {\n opacity: 1;\n transform: translateX(0);\n}\n\n.b-notification--top-left.b-notification-fade-leave-to,\n.b-notification--bottom-left.b-notification-fade-leave-to {\n opacity: 0;\n transform: translateX(-100%);\n}\n\n/* Respect prefers-reduced-motion */\n@media (prefers-reduced-motion: reduce) {\n .b-notification-fade-enter-active,\n .b-notification-fade-leave-active {\n transition: opacity var(--b-notification-transition-duration, 300ms) ease;\n }\n\n .b-notification--top-right.b-notification-fade-enter-from,\n .b-notification--bottom-right.b-notification-fade-enter-from,\n .b-notification--top-left.b-notification-fade-enter-from,\n .b-notification--bottom-left.b-notification-fade-enter-from,\n .b-notification--top-right.b-notification-fade-leave-to,\n .b-notification--bottom-right.b-notification-fade-leave-to,\n .b-notification--top-left.b-notification-fade-leave-to,\n .b-notification--bottom-left.b-notification-fade-leave-to {\n transform: none;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkJM,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAjFF,IAAM,IAAO,GAyBP,IAAiB,GAAO,EACxB,IAAU,GAAG,EAAe,SAC5B,IAAS,GAAG,EAAe,QAG3B,IAAkB,EAAI,GAAM,EAG5B,IAAkB,EAAwB,KAAK,EAG/C,IAAmB,EAAwB,KAAK,EAOhD,IAAY,QAAgB,EAAA,eAAe,KAAA,IAAyB,EAAgB,QAA7B,EAAA,WAAoC,EAE3F,IAAe,QAAe,EAAA,eAAe,KAAA,EAAU,EAMvD,IAAW,QACf,EAAA,SAAS,EAAkB,SAAS,EAAA,SAAS,EAAkB,UAAU,UAAU,SACpF,EAGK,IAAW,QAAgB,EAAS,UAAU,UAAU,cAAc,SAAU,EAGhF,IAAe,QAAe,GAAQ,EAAA,QAAQ,EAAA,aAAa,EAAQ,EAAA,QAAS,GAAM,EAGlF,IAAiB,QAAe,EAAQ,EAAA,YAAa,EAGrD,IAAW,QAAe;AAC9B,WAAQ,EAAA,MAAR;IACE,KAAK,EAAkB,QACrB,QAAO;IACT,KAAK,EAAkB,QACrB,QAAO;IACT,KAAK,EAAkB,MACrB,QAAO;IACT,QAEE,QAAO;;IAEX,EASE,IAA8C;EAElD,SAAS,IAAa;AAEpB,GADA,GAAY,EACR,EAAA,WAAW,MACb,IAAQ,iBAAiB;AACvB,OAAO;MACN,EAAA,WAAW,IAAK;;EAIvB,SAAS,IAAa;AACpB,GAAI,MAAU,SACZ,aAAa,EAAM,EACnB,IAAQ;;EAOZ,SAAS,IAAO;AACd,GAAI,EAAa,QACf,EAAK,qBAAqB,GAAK,GAE/B,EAAgB,QAAQ;;EAI5B,SAAS,IAAQ;AAEf,GADA,EAAK,QAAQ,EACT,EAAa,QACf,EAAK,qBAAqB,GAAM,GAEhC,EAAgB,QAAQ;;EAI5B,SAAS,IAAe;AAMtB,GAJI,EAAiB,SAAS,SAAS,SAAS,EAAiB,MAAM,KACrE,EAAiB,MAAM,OAAO,EAC9B,EAAiB,QAAQ,OAE3B,EAAK,aAAa;;EAGpB,SAAS,KAAe;AACtB,MAAY;;EAGd,SAAS,KAAe;AACtB,MAAY;;EAGd,SAAS,GAAU,GAAsB;AACvC,GAAI,EAAM,QAAQ,YAAY,EAAA,aAC5B,EAAM,iBAAiB,EACvB,GAAO;;SAOX,EACE,GACA,OAAO,MAAY;AACjB,GAAI,KAEF,EAAiB,QAAQ,SAAS,eAClC,GAAY,EAER,EAAA,aACF,MAAM,GAAU,GAEd,EAAgB,OAAO,cAA2B,yBAAyB,GACnE,OAAO,KAGnB,GAAY;KAGhB,EAAE,WAAW,IAAM,CACpB,EAKD,QAAkB;AAChB,MAAY;IACZ,EAGF,EAAa;GAAE;GAAM;GAAO,CAAC,kBAI3B,EAyFW,GAAA,EAzFD,IAAG,QAAM,EAAA,CACjB,EAuFa,GAAA;GAvFD,MAAK;GAAoC;;oBAsF7C,CApFE,EAAA,SAAA,GAAA,EADR,EAqFM,OAAA;;IAnFH,IAAI,EAAA,EAAc;aACf;IAAJ,KAAI;IACJ,OAAK,EAAA,CAAC,kBAAgB;KACF,EAAA,aAAS,mBAAuB,EAAA;KAAuB,EAAA,QAAI,mBAAuB,EAAA;;mCAA6D,EAAA;0CAA8D,EAAA;;;IAQhO,MAAM,EAAA;IACN,aAAW,EAAA;IACX,eAAa;IACb,mBAAiB;IACjB,oBAAkB,EAAA,QAAiB,IAAS,KAAA;IAC5C,cAAY;IACZ,cAAY;IACH;;IAGE,EAAA,SAAA,GAAA,EAAZ,EAgBO,QAhBP,GAgBO,CAfL,EAcO,EAAA,QAAA,QAAA,EAAA,QAAA,CAZO,EAAA,QAAA,GAAA,EAAZ,EAAkC,QAAA;;KAAhB,WAAQ,EAAA;sBAGb,EAAA,QAAA,GAAA,EADb,EASM,OATN,GASM,CADJ,EAAsB,QAAA,EAAf,GAAG,EAAA,OAAQ,EAAA,MAAA,GAAA,EAAA,CAAA,CAAA,IAAA,EAAA,IAAA,GAAA,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,IAAA,GAAA;IAMxB,EAmBM,OAnBN,GAmBM;KAjBJ,EAEM,OAAA;MAFA,IAAI;MAAS,OAAM;SACvB,EAAyC,EAAA,QAAA,WAAA,EAAA,QAAA,CAAA,EAAA,EAAjB,EAAA,QAAO,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;KAKzB,EAAA,SAAkBA,EAAAA,OAAO,eAAA,GAAA,EADjC,EAMM,OAAA;;MAJH,IAAI;MACL,OAAM;SAEN,EAAiD,EAAA,QAAA,eAAA,EAAA,QAAA,CAAA,EAAA,EAArB,EAAA,YAAW,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,IAAA,GAAA;KAI9B,EAAA,OAAOA,EAAAA,OAAO,OAAA,GAAA,EAAzB,EAEM,OAFN,GAEM,CADJ,EAAiC,EAAA,QAAA,OAAA,EAAA,QAAA,CAAA,EAAA,EAAb,EAAA,IAAG,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,IAAA,GAAA;;IAMnB,EAAA,YAAA,GAAA,EADR,EAoBS,UAAA;;KAlBP,MAAK;KACL,OAAM;KACN,cAAW;KACV,SAAO;QAER,EAYO,EAAA,QAAA,aAAA,EAAA,QAAA,CAXO,EAAA,aAAA,GAAA,EAAZ,EAA4C,QAAA;;KAArB,WAAQ,EAAA;4BAC/B,EASM,OATN,GASM,CADJ,EAA2B,QAAA,EAApB,GAAG,GAAa,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,IAAA,EAAA,IAAA,GAAA"}
@@ -1,8 +1,8 @@
1
- import e from "./design-system151.js";
1
+ import e from "./design-system163.js";
2
2
  /* empty css */
3
3
  //#region src/components/BNotification/BNotification.vue
4
4
  var t = e;
5
5
  //#endregion
6
6
  export { t as default };
7
7
 
8
- //# sourceMappingURL=design-system153.js.map
8
+ //# sourceMappingURL=design-system165.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"design-system153.js","names":[],"sources":["../src/components/BNotification/BNotification.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { BNotificationPlacement, BNotificationType } from '@/types.ts';\nimport { computed, nextTick, onUnmounted, ref, useId, watch } from 'vue';\n\n// ─────────────────────────────────────────────\n// Props & emits\n// ─────────────────────────────────────────────\nconst {\n type = undefined,\n message = '',\n description = '',\n placement = BNotificationPlacement.TopRight,\n duration = 4.5,\n closable = true,\n showIcon = true,\n icon,\n closeIcon,\n btn,\n modelValue = undefined,\n} = defineProps<{\n /**\n * Notification type - controls the icon and colour scheme.\n * When omitted no type-colour is applied (plain notification).\n */\n type?: `${BNotificationType}`;\n /** Short title / heading of the notification. */\n message?: string;\n /** Optional detailed description below the title. */\n description?: string;\n /**\n * Placement of the notification on the viewport.\n * @default 'top-right'\n */\n placement?: `${BNotificationPlacement}`;\n /**\n * Auto-close delay in seconds. Set to `0` to disable auto-close.\n * @default 4.5\n */\n duration?: number;\n /** Show the close button. @default true */\n closable?: boolean;\n /** Show the built-in status icon when `type` is set. @default true */\n showIcon?: boolean;\n /**\n * Custom icon content - overrides the built-in type icon.\n * Also accepts the `icon` slot.\n */\n icon?: string;\n /**\n * Custom close-icon content.\n * Also accepts the `closeIcon` slot.\n */\n closeIcon?: string;\n /**\n * Custom action button area content.\n * Also accepts the `btn` slot.\n */\n btn?: string;\n /**\n * Controlled visibility - when provided the component operates in\n * controlled mode; otherwise it manages its own visibility.\n * Bind with `v-model`.\n */\n modelValue?: boolean;\n}>();\n\nconst emit = defineEmits<{\n /** Fired synchronously when the notification starts closing. */\n (e: 'close'): void;\n /** Fired after the leave-transition fully completes. */\n (e: 'afterClose'): void;\n /** v-model support */\n (e: 'update:modelValue', value: boolean): void;\n}>();\n\ndefineSlots<{\n /** Overrides the `message` prop - the notification title. */\n message?(): unknown;\n /** Overrides the `description` prop. */\n description?(): unknown;\n /** Overrides the built-in status icon. */\n icon?(): unknown;\n /** Overrides the default close icon. */\n closeIcon?(): unknown;\n /** Action button area rendered below the description. */\n btn?(): unknown;\n}>();\n\n// ─────────────────────────────────────────────\n// Internal state\n// ─────────────────────────────────────────────\nconst notificationId = useId();\nconst titleId = `${notificationId}-title`;\nconst descId = `${notificationId}-desc`;\n\n/** Uncontrolled visibility flag - default closed. */\nconst internalVisible = ref(false);\n\n/** Ref to the notification DOM element for focus return. */\nconst notificationRef = ref<HTMLElement | null>(null);\n\n/** Element that had focus before the notification appeared. */\nconst previousFocusRef = ref<HTMLElement | null>(null);\n\n/**\n * Effective visibility:\n * - controlled → honour `modelValue`\n * - uncontrolled → use `internalVisible`\n */\nconst isVisible = computed(() => (modelValue !== undefined ? modelValue : internalVisible.value));\n\nconst isControlled = computed(() => modelValue !== undefined);\n\n// ─────────────────────────────────────────────\n// Derived state\n// ─────────────────────────────────────────────\n/** ARIA role: 'alert' for error/warning (assertive), 'status' for others. */\nconst ariaRole = computed<'alert' | 'status'>(() =>\n type === BNotificationType.Error || type === BNotificationType.Warning ? 'alert' : 'status',\n);\n\n/** aria-live polarity mirrors the role. */\nconst ariaLive = computed(() => (ariaRole.value === 'alert' ? 'assertive' : 'polite'));\n\n/** Whether to show the icon area (needs type and showIcon). */\nconst showIconArea = computed(() => Boolean(type && showIcon) || Boolean(icon) || false);\n\n/** Whether the description is provided via prop or slot. */\nconst hasDescription = computed(() => Boolean(description));\n\n/** Built-in SVG path for the status icon. */\nconst iconPath = computed(() => {\n switch (type) {\n case BNotificationType.Success:\n return 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z';\n case BNotificationType.Warning:\n return 'M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z';\n case BNotificationType.Error:\n return 'M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z';\n default:\n // info (also fallback)\n return 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z';\n }\n});\n\n// Close icon SVG path (× mark)\nconst closeIconPath =\n 'M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z';\n\n// ─────────────────────────────────────────────\n// Auto-close timer\n// ─────────────────────────────────────────────\nlet timer: ReturnType<typeof setTimeout> | null = null;\n\nfunction startTimer() {\n clearTimer();\n if (duration > 0) {\n timer = setTimeout(() => {\n close();\n }, duration * 1000);\n }\n}\n\nfunction clearTimer() {\n if (timer !== null) {\n clearTimeout(timer);\n timer = null;\n }\n}\n\n// ─────────────────────────────────────────────\n// Behaviour\n// ─────────────────────────────────────────────\nfunction open() {\n if (isControlled.value) {\n emit('update:modelValue', true);\n } else {\n internalVisible.value = true;\n }\n}\n\nfunction close() {\n emit('close');\n if (isControlled.value) {\n emit('update:modelValue', false);\n } else {\n internalVisible.value = false;\n }\n}\n\nfunction onAfterLeave() {\n // Return focus to the previously-focused element\n if (previousFocusRef.value && document.contains(previousFocusRef.value)) {\n previousFocusRef.value.focus();\n previousFocusRef.value = null;\n }\n emit('afterClose');\n}\n\nfunction onMouseEnter() {\n clearTimer();\n}\n\nfunction onMouseLeave() {\n startTimer();\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape' && closable) {\n event.stopPropagation();\n close();\n }\n}\n\n// ─────────────────────────────────────────────\n// Visibility watcher - manage timer + focus\n// ─────────────────────────────────────────────\nwatch(\n isVisible,\n async (visible) => {\n if (visible) {\n // Capture current focus for return-on-close\n previousFocusRef.value = document.activeElement as HTMLElement | null;\n startTimer();\n // Focus the close button (if closable) once the DOM updates\n if (closable) {\n await nextTick();\n const closeBtn =\n notificationRef.value?.querySelector<HTMLElement>('.b-notification__close');\n closeBtn?.focus();\n }\n } else {\n clearTimer();\n }\n },\n { immediate: true },\n);\n\n// ─────────────────────────────────────────────\n// Lifecycle\n// ─────────────────────────────────────────────\nonUnmounted(() => {\n clearTimer();\n});\n\n// Expose open & close for imperative usage\ndefineExpose({ open, close });\n</script>\n\n<template>\n <Teleport to=\"body\">\n <Transition name=\"b-notification-fade\" @after-leave=\"onAfterLeave\">\n <div\n v-if=\"isVisible\"\n :id=\"notificationId\"\n ref=\"notificationRef\"\n class=\"b-notification\"\n :class=\"[\n placement && `b-notification--${placement}`,\n type && `b-notification--${type}`,\n {\n 'b-notification--with-icon': showIconArea,\n 'b-notification--with-description': hasDescription,\n },\n ]\"\n :role=\"ariaRole\"\n :aria-live=\"ariaLive\"\n :aria-atomic=\"true\"\n :aria-labelledby=\"titleId\"\n :aria-describedby=\"hasDescription ? descId : undefined\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n @keydown=\"onKeydown\"\n >\n <!-- Icon area -->\n <span v-if=\"showIconArea\" class=\"b-notification__icon\" aria-hidden=\"true\">\n <slot name=\"icon\">\n <!-- Custom icon prop as raw HTML (consumer's responsibility) -->\n <span v-if=\"icon\" v-html=\"icon\" />\n <!-- Built-in type icon -->\n <svg\n v-else-if=\"type\"\n class=\"b-notification__icon-svg\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n >\n <path :d=\"iconPath\" />\n </svg>\n </slot>\n </span>\n\n <!-- Body -->\n <div class=\"b-notification__body\">\n <!-- Title -->\n <div :id=\"titleId\" class=\"b-notification__message\">\n <slot name=\"message\">{{ message }}</slot>\n </div>\n\n <!-- Description -->\n <div\n v-if=\"hasDescription || $slots.description\"\n :id=\"descId\"\n class=\"b-notification__description\"\n >\n <slot name=\"description\">{{ description }}</slot>\n </div>\n\n <!-- Action button area -->\n <div v-if=\"btn || $slots.btn\" class=\"b-notification__btn\">\n <slot name=\"btn\">{{ btn }}</slot>\n </div>\n </div>\n\n <!-- Close button -->\n <button\n v-if=\"closable\"\n type=\"button\"\n class=\"b-notification__close\"\n aria-label=\"Close notification\"\n @click=\"close\"\n >\n <slot name=\"closeIcon\">\n <span v-if=\"closeIcon\" v-html=\"closeIcon\" />\n <svg\n v-else\n class=\"b-notification__close-svg\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n >\n <path :d=\"closeIconPath\" />\n </svg>\n </slot>\n </button>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style>\n/* ────────────────────────────────────────────\n CSS Custom Properties (tokens)\n ──────────────────────────────────────────── */\n.b-notification {\n /* Layout */\n --b-notification-width: 22rem;\n --b-notification-padding-v: 1rem;\n --b-notification-padding-h: 1.5rem;\n --b-notification-border-radius: 0.5rem;\n --b-notification-icon-size: 1.5rem;\n --b-notification-gap: 0.75rem;\n --b-notification-close-size: 1rem;\n --b-notification-font-size-title: 1rem;\n --b-notification-font-size-desc: 0.875rem;\n --b-notification-line-height: 1.5;\n --b-notification-z-index: 1010;\n\n /* Offset from viewport edge */\n --b-notification-offset: 1.5rem;\n\n /* Colours (default / plain) */\n --b-notification-bg: #ffffff;\n --b-notification-border-color: oklch(90% 0.02 240);\n --b-notification-title-color: oklch(20% 0.02 240);\n --b-notification-desc-color: oklch(45% 0.02 240);\n --b-notification-close-color: oklch(50% 0.02 240);\n --b-notification-close-hover-color: oklch(20% 0.02 240);\n --b-notification-icon-color: oklch(62.3% 0.214 259.815);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05);\n\n /* Animation */\n --b-notification-transition-duration: 300ms;\n}\n\n/* ── Variant colour tokens ── */\n.b-notification--success {\n --b-notification-icon-color: oklch(72.3% 0.219 149.579);\n}\n\n.b-notification--info {\n --b-notification-icon-color: oklch(62.3% 0.214 259.815);\n}\n\n.b-notification--warning {\n --b-notification-icon-color: oklch(75% 0.183 55.934);\n}\n\n.b-notification--error {\n --b-notification-icon-color: oklch(63.7% 0.237 25.331);\n}\n\n/* ── Dark mode ── */\n[data-prefers-color='dark'] .b-notification {\n --b-notification-bg: oklch(22% 0.02 240);\n --b-notification-border-color: oklch(35% 0.03 240);\n --b-notification-title-color: oklch(92% 0.02 240);\n --b-notification-desc-color: oklch(70% 0.02 240);\n --b-notification-close-color: oklch(60% 0.02 240);\n --b-notification-close-hover-color: oklch(90% 0.02 240);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 3px 6px -4px rgba(0, 0, 0, 0.48),\n 0 9px 28px 8px rgba(0, 0, 0, 0.2);\n}\n\n@media (prefers-color-scheme: dark) {\n [data-prefers-color='system'] .b-notification {\n --b-notification-bg: oklch(22% 0.02 240);\n --b-notification-border-color: oklch(35% 0.03 240);\n --b-notification-title-color: oklch(92% 0.02 240);\n --b-notification-desc-color: oklch(70% 0.02 240);\n --b-notification-close-color: oklch(60% 0.02 240);\n --b-notification-close-hover-color: oklch(90% 0.02 240);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 3px 6px -4px rgba(0, 0, 0, 0.48),\n 0 9px 28px 8px rgba(0, 0, 0, 0.2);\n }\n}\n\n/* ─────────────────────────────────────────────\n Base layout\n ───────────────────────────────────────────── */\n.b-notification {\n position: fixed;\n z-index: var(--b-notification-z-index);\n display: flex;\n align-items: flex-start;\n gap: var(--b-notification-gap);\n width: var(--b-notification-width);\n max-width: calc(100vw - 2 * var(--b-notification-offset));\n padding: var(--b-notification-padding-v) var(--b-notification-padding-h);\n border-radius: var(--b-notification-border-radius);\n background-color: var(--b-notification-bg);\n box-shadow: var(--b-notification-shadow);\n box-sizing: border-box;\n word-break: break-word;\n pointer-events: auto;\n outline: none;\n}\n\n/* ── Placement ── */\n.b-notification--top-right {\n top: var(--b-notification-offset);\n right: var(--b-notification-offset);\n}\n\n.b-notification--top-left {\n top: var(--b-notification-offset);\n left: var(--b-notification-offset);\n}\n\n.b-notification--bottom-right {\n bottom: var(--b-notification-offset);\n right: var(--b-notification-offset);\n}\n\n.b-notification--bottom-left {\n bottom: var(--b-notification-offset);\n left: var(--b-notification-offset);\n}\n\n/* ── Icon area ── */\n.b-notification__icon {\n display: inline-flex;\n flex-shrink: 0;\n align-items: flex-start;\n padding-top: 0.125rem;\n color: var(--b-notification-icon-color);\n line-height: 1;\n}\n\n.b-notification__icon-svg {\n width: var(--b-notification-icon-size);\n height: var(--b-notification-icon-size);\n fill: currentColor;\n display: block;\n}\n\n/* ── Body ── */\n.b-notification__body {\n flex: 1;\n min-width: 0;\n}\n\n/* ── Title ── */\n.b-notification__message {\n font-size: var(--b-notification-font-size-title);\n font-weight: 600;\n line-height: var(--b-notification-line-height);\n color: var(--b-notification-title-color);\n padding-right: 1.5rem; /* space for close button */\n}\n\n/* When no close button, remove the padding */\n.b-notification:not(:has(.b-notification__close)) .b-notification__message {\n padding-right: 0;\n}\n\n/* ── Description ── */\n.b-notification__description {\n margin-top: 0.375rem;\n font-size: var(--b-notification-font-size-desc);\n line-height: var(--b-notification-line-height);\n color: var(--b-notification-desc-color);\n}\n\n/* ── Action button area ── */\n.b-notification__btn {\n margin-top: 0.75rem;\n}\n\n/* ── Close button ── */\n.b-notification__close {\n position: absolute;\n top: 0.875rem;\n right: 1rem;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.125rem;\n background: transparent;\n border: none;\n border-radius: 0.25rem;\n cursor: pointer;\n color: var(--b-notification-close-color);\n line-height: 1;\n transition: color var(--b-notification-transition-duration) ease;\n}\n\n.b-notification__close:hover {\n color: var(--b-notification-close-hover-color);\n}\n\n.b-notification__close:focus-visible {\n outline: 2px solid oklch(62.3% 0.214 259.815);\n outline-offset: 2px;\n}\n\n.b-notification__close-svg {\n width: var(--b-notification-close-size);\n height: var(--b-notification-close-size);\n fill: currentColor;\n display: block;\n}\n\n/* ─────────────────────────────────────────────\n Transition – slide-in + fade per placement\n ───────────────────────────────────────────── */\n.b-notification-fade-enter-active,\n.b-notification-fade-leave-active {\n transition:\n opacity var(--b-notification-transition-duration, 300ms) ease,\n transform var(--b-notification-transition-duration, 300ms) ease;\n}\n\n/* top-right / bottom-right - slide in from right */\n.b-notification--top-right.b-notification-fade-enter-from,\n.b-notification--bottom-right.b-notification-fade-enter-from {\n opacity: 0;\n transform: translateX(100%);\n}\n\n.b-notification--top-right.b-notification-fade-enter-to,\n.b-notification--bottom-right.b-notification-fade-enter-to,\n.b-notification--top-right.b-notification-fade-leave-from,\n.b-notification--bottom-right.b-notification-fade-leave-from {\n opacity: 1;\n transform: translateX(0);\n}\n\n.b-notification--top-right.b-notification-fade-leave-to,\n.b-notification--bottom-right.b-notification-fade-leave-to {\n opacity: 0;\n transform: translateX(100%);\n}\n\n/* top-left / bottom-left - slide in from left */\n.b-notification--top-left.b-notification-fade-enter-from,\n.b-notification--bottom-left.b-notification-fade-enter-from {\n opacity: 0;\n transform: translateX(-100%);\n}\n\n.b-notification--top-left.b-notification-fade-enter-to,\n.b-notification--bottom-left.b-notification-fade-enter-to,\n.b-notification--top-left.b-notification-fade-leave-from,\n.b-notification--bottom-left.b-notification-fade-leave-from {\n opacity: 1;\n transform: translateX(0);\n}\n\n.b-notification--top-left.b-notification-fade-leave-to,\n.b-notification--bottom-left.b-notification-fade-leave-to {\n opacity: 0;\n transform: translateX(-100%);\n}\n\n/* Respect prefers-reduced-motion */\n@media (prefers-reduced-motion: reduce) {\n .b-notification-fade-enter-active,\n .b-notification-fade-leave-active {\n transition: opacity var(--b-notification-transition-duration, 300ms) ease;\n }\n\n .b-notification--top-right.b-notification-fade-enter-from,\n .b-notification--bottom-right.b-notification-fade-enter-from,\n .b-notification--top-left.b-notification-fade-enter-from,\n .b-notification--bottom-left.b-notification-fade-enter-from,\n .b-notification--top-right.b-notification-fade-leave-to,\n .b-notification--bottom-right.b-notification-fade-leave-to,\n .b-notification--top-left.b-notification-fade-leave-to,\n .b-notification--bottom-left.b-notification-fade-leave-to {\n transform: none;\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"design-system165.js","names":[],"sources":["../src/components/BNotification/BNotification.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { BNotificationPlacement, BNotificationType } from '@/types.ts';\nimport { computed, nextTick, onUnmounted, ref, useId, watch } from 'vue';\n\n// ─────────────────────────────────────────────\n// Props & emits\n// ─────────────────────────────────────────────\nconst {\n type = undefined,\n message = '',\n description = '',\n placement = BNotificationPlacement.TopRight,\n duration = 4.5,\n closable = true,\n showIcon = true,\n icon,\n closeIcon,\n btn,\n modelValue = undefined,\n} = defineProps<{\n /**\n * Notification type - controls the icon and colour scheme.\n * When omitted no type-colour is applied (plain notification).\n */\n type?: `${BNotificationType}`;\n /** Short title / heading of the notification. */\n message?: string;\n /** Optional detailed description below the title. */\n description?: string;\n /**\n * Placement of the notification on the viewport.\n * @default 'top-right'\n */\n placement?: `${BNotificationPlacement}`;\n /**\n * Auto-close delay in seconds. Set to `0` to disable auto-close.\n * @default 4.5\n */\n duration?: number;\n /** Show the close button. @default true */\n closable?: boolean;\n /** Show the built-in status icon when `type` is set. @default true */\n showIcon?: boolean;\n /**\n * Custom icon content - overrides the built-in type icon.\n * Also accepts the `icon` slot.\n */\n icon?: string;\n /**\n * Custom close-icon content.\n * Also accepts the `closeIcon` slot.\n */\n closeIcon?: string;\n /**\n * Custom action button area content.\n * Also accepts the `btn` slot.\n */\n btn?: string;\n /**\n * Controlled visibility - when provided the component operates in\n * controlled mode; otherwise it manages its own visibility.\n * Bind with `v-model`.\n */\n modelValue?: boolean;\n}>();\n\nconst emit = defineEmits<{\n /** Fired synchronously when the notification starts closing. */\n (e: 'close'): void;\n /** Fired after the leave-transition fully completes. */\n (e: 'afterClose'): void;\n /** v-model support */\n (e: 'update:modelValue', value: boolean): void;\n}>();\n\ndefineSlots<{\n /** Overrides the `message` prop - the notification title. */\n message?(): unknown;\n /** Overrides the `description` prop. */\n description?(): unknown;\n /** Overrides the built-in status icon. */\n icon?(): unknown;\n /** Overrides the default close icon. */\n closeIcon?(): unknown;\n /** Action button area rendered below the description. */\n btn?(): unknown;\n}>();\n\n// ─────────────────────────────────────────────\n// Internal state\n// ─────────────────────────────────────────────\nconst notificationId = useId();\nconst titleId = `${notificationId}-title`;\nconst descId = `${notificationId}-desc`;\n\n/** Uncontrolled visibility flag - default closed. */\nconst internalVisible = ref(false);\n\n/** Ref to the notification DOM element for focus return. */\nconst notificationRef = ref<HTMLElement | null>(null);\n\n/** Element that had focus before the notification appeared. */\nconst previousFocusRef = ref<HTMLElement | null>(null);\n\n/**\n * Effective visibility:\n * - controlled → honour `modelValue`\n * - uncontrolled → use `internalVisible`\n */\nconst isVisible = computed(() => (modelValue !== undefined ? modelValue : internalVisible.value));\n\nconst isControlled = computed(() => modelValue !== undefined);\n\n// ─────────────────────────────────────────────\n// Derived state\n// ─────────────────────────────────────────────\n/** ARIA role: 'alert' for error/warning (assertive), 'status' for others. */\nconst ariaRole = computed<'alert' | 'status'>(() =>\n type === BNotificationType.Error || type === BNotificationType.Warning ? 'alert' : 'status',\n);\n\n/** aria-live polarity mirrors the role. */\nconst ariaLive = computed(() => (ariaRole.value === 'alert' ? 'assertive' : 'polite'));\n\n/** Whether to show the icon area (needs type and showIcon). */\nconst showIconArea = computed(() => Boolean(type && showIcon) || Boolean(icon) || false);\n\n/** Whether the description is provided via prop or slot. */\nconst hasDescription = computed(() => Boolean(description));\n\n/** Built-in SVG path for the status icon. */\nconst iconPath = computed(() => {\n switch (type) {\n case BNotificationType.Success:\n return 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z';\n case BNotificationType.Warning:\n return 'M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z';\n case BNotificationType.Error:\n return 'M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z';\n default:\n // info (also fallback)\n return 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z';\n }\n});\n\n// Close icon SVG path (× mark)\nconst closeIconPath =\n 'M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z';\n\n// ─────────────────────────────────────────────\n// Auto-close timer\n// ─────────────────────────────────────────────\nlet timer: ReturnType<typeof setTimeout> | null = null;\n\nfunction startTimer() {\n clearTimer();\n if (duration > 0) {\n timer = setTimeout(() => {\n close();\n }, duration * 1000);\n }\n}\n\nfunction clearTimer() {\n if (timer !== null) {\n clearTimeout(timer);\n timer = null;\n }\n}\n\n// ─────────────────────────────────────────────\n// Behaviour\n// ─────────────────────────────────────────────\nfunction open() {\n if (isControlled.value) {\n emit('update:modelValue', true);\n } else {\n internalVisible.value = true;\n }\n}\n\nfunction close() {\n emit('close');\n if (isControlled.value) {\n emit('update:modelValue', false);\n } else {\n internalVisible.value = false;\n }\n}\n\nfunction onAfterLeave() {\n // Return focus to the previously-focused element\n if (previousFocusRef.value && document.contains(previousFocusRef.value)) {\n previousFocusRef.value.focus();\n previousFocusRef.value = null;\n }\n emit('afterClose');\n}\n\nfunction onMouseEnter() {\n clearTimer();\n}\n\nfunction onMouseLeave() {\n startTimer();\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape' && closable) {\n event.stopPropagation();\n close();\n }\n}\n\n// ─────────────────────────────────────────────\n// Visibility watcher - manage timer + focus\n// ─────────────────────────────────────────────\nwatch(\n isVisible,\n async (visible) => {\n if (visible) {\n // Capture current focus for return-on-close\n previousFocusRef.value = document.activeElement as HTMLElement | null;\n startTimer();\n // Focus the close button (if closable) once the DOM updates\n if (closable) {\n await nextTick();\n const closeBtn =\n notificationRef.value?.querySelector<HTMLElement>('.b-notification__close');\n closeBtn?.focus();\n }\n } else {\n clearTimer();\n }\n },\n { immediate: true },\n);\n\n// ─────────────────────────────────────────────\n// Lifecycle\n// ─────────────────────────────────────────────\nonUnmounted(() => {\n clearTimer();\n});\n\n// Expose open & close for imperative usage\ndefineExpose({ open, close });\n</script>\n\n<template>\n <Teleport to=\"body\">\n <Transition name=\"b-notification-fade\" @after-leave=\"onAfterLeave\">\n <div\n v-if=\"isVisible\"\n :id=\"notificationId\"\n ref=\"notificationRef\"\n class=\"b-notification\"\n :class=\"[\n placement && `b-notification--${placement}`,\n type && `b-notification--${type}`,\n {\n 'b-notification--with-icon': showIconArea,\n 'b-notification--with-description': hasDescription,\n },\n ]\"\n :role=\"ariaRole\"\n :aria-live=\"ariaLive\"\n :aria-atomic=\"true\"\n :aria-labelledby=\"titleId\"\n :aria-describedby=\"hasDescription ? descId : undefined\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n @keydown=\"onKeydown\"\n >\n <!-- Icon area -->\n <span v-if=\"showIconArea\" class=\"b-notification__icon\" aria-hidden=\"true\">\n <slot name=\"icon\">\n <!-- Custom icon prop as raw HTML (consumer's responsibility) -->\n <span v-if=\"icon\" v-html=\"icon\" />\n <!-- Built-in type icon -->\n <svg\n v-else-if=\"type\"\n class=\"b-notification__icon-svg\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n >\n <path :d=\"iconPath\" />\n </svg>\n </slot>\n </span>\n\n <!-- Body -->\n <div class=\"b-notification__body\">\n <!-- Title -->\n <div :id=\"titleId\" class=\"b-notification__message\">\n <slot name=\"message\">{{ message }}</slot>\n </div>\n\n <!-- Description -->\n <div\n v-if=\"hasDescription || $slots.description\"\n :id=\"descId\"\n class=\"b-notification__description\"\n >\n <slot name=\"description\">{{ description }}</slot>\n </div>\n\n <!-- Action button area -->\n <div v-if=\"btn || $slots.btn\" class=\"b-notification__btn\">\n <slot name=\"btn\">{{ btn }}</slot>\n </div>\n </div>\n\n <!-- Close button -->\n <button\n v-if=\"closable\"\n type=\"button\"\n class=\"b-notification__close\"\n aria-label=\"Close notification\"\n @click=\"close\"\n >\n <slot name=\"closeIcon\">\n <span v-if=\"closeIcon\" v-html=\"closeIcon\" />\n <svg\n v-else\n class=\"b-notification__close-svg\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n >\n <path :d=\"closeIconPath\" />\n </svg>\n </slot>\n </button>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style>\n/* ────────────────────────────────────────────\n CSS Custom Properties (tokens)\n ──────────────────────────────────────────── */\n.b-notification {\n /* Layout */\n --b-notification-width: 22rem;\n --b-notification-padding-v: 1rem;\n --b-notification-padding-h: 1.5rem;\n --b-notification-border-radius: 0.5rem;\n --b-notification-icon-size: 1.5rem;\n --b-notification-gap: 0.75rem;\n --b-notification-close-size: 1rem;\n --b-notification-font-size-title: 1rem;\n --b-notification-font-size-desc: 0.875rem;\n --b-notification-line-height: 1.5;\n --b-notification-z-index: 1010;\n\n /* Offset from viewport edge */\n --b-notification-offset: 1.5rem;\n\n /* Colours (default / plain) */\n --b-notification-bg: #ffffff;\n --b-notification-border-color: oklch(90% 0.02 240);\n --b-notification-title-color: oklch(20% 0.02 240);\n --b-notification-desc-color: oklch(45% 0.02 240);\n --b-notification-close-color: oklch(50% 0.02 240);\n --b-notification-close-hover-color: oklch(20% 0.02 240);\n --b-notification-icon-color: oklch(62.3% 0.214 259.815);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05);\n\n /* Animation */\n --b-notification-transition-duration: 300ms;\n}\n\n/* ── Variant colour tokens ── */\n.b-notification--success {\n --b-notification-icon-color: oklch(72.3% 0.219 149.579);\n}\n\n.b-notification--info {\n --b-notification-icon-color: oklch(62.3% 0.214 259.815);\n}\n\n.b-notification--warning {\n --b-notification-icon-color: oklch(75% 0.183 55.934);\n}\n\n.b-notification--error {\n --b-notification-icon-color: oklch(63.7% 0.237 25.331);\n}\n\n/* ── Dark mode ── */\n[data-prefers-color='dark'] .b-notification {\n --b-notification-bg: oklch(22% 0.02 240);\n --b-notification-border-color: oklch(35% 0.03 240);\n --b-notification-title-color: oklch(92% 0.02 240);\n --b-notification-desc-color: oklch(70% 0.02 240);\n --b-notification-close-color: oklch(60% 0.02 240);\n --b-notification-close-hover-color: oklch(90% 0.02 240);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 3px 6px -4px rgba(0, 0, 0, 0.48),\n 0 9px 28px 8px rgba(0, 0, 0, 0.2);\n}\n\n@media (prefers-color-scheme: dark) {\n [data-prefers-color='system'] .b-notification {\n --b-notification-bg: oklch(22% 0.02 240);\n --b-notification-border-color: oklch(35% 0.03 240);\n --b-notification-title-color: oklch(92% 0.02 240);\n --b-notification-desc-color: oklch(70% 0.02 240);\n --b-notification-close-color: oklch(60% 0.02 240);\n --b-notification-close-hover-color: oklch(90% 0.02 240);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 3px 6px -4px rgba(0, 0, 0, 0.48),\n 0 9px 28px 8px rgba(0, 0, 0, 0.2);\n }\n}\n\n/* ─────────────────────────────────────────────\n Base layout\n ───────────────────────────────────────────── */\n.b-notification {\n position: fixed;\n z-index: var(--b-notification-z-index);\n display: flex;\n align-items: flex-start;\n gap: var(--b-notification-gap);\n width: var(--b-notification-width);\n max-width: calc(100vw - 2 * var(--b-notification-offset));\n padding: var(--b-notification-padding-v) var(--b-notification-padding-h);\n border-radius: var(--b-notification-border-radius);\n background-color: var(--b-notification-bg);\n box-shadow: var(--b-notification-shadow);\n box-sizing: border-box;\n word-break: break-word;\n pointer-events: auto;\n outline: none;\n}\n\n/* ── Placement ── */\n.b-notification--top-right {\n top: var(--b-notification-offset);\n right: var(--b-notification-offset);\n}\n\n.b-notification--top-left {\n top: var(--b-notification-offset);\n left: var(--b-notification-offset);\n}\n\n.b-notification--bottom-right {\n bottom: var(--b-notification-offset);\n right: var(--b-notification-offset);\n}\n\n.b-notification--bottom-left {\n bottom: var(--b-notification-offset);\n left: var(--b-notification-offset);\n}\n\n/* ── Icon area ── */\n.b-notification__icon {\n display: inline-flex;\n flex-shrink: 0;\n align-items: flex-start;\n padding-top: 0.125rem;\n color: var(--b-notification-icon-color);\n line-height: 1;\n}\n\n.b-notification__icon-svg {\n width: var(--b-notification-icon-size);\n height: var(--b-notification-icon-size);\n fill: currentColor;\n display: block;\n}\n\n/* ── Body ── */\n.b-notification__body {\n flex: 1;\n min-width: 0;\n}\n\n/* ── Title ── */\n.b-notification__message {\n font-size: var(--b-notification-font-size-title);\n font-weight: 600;\n line-height: var(--b-notification-line-height);\n color: var(--b-notification-title-color);\n padding-right: 1.5rem; /* space for close button */\n}\n\n/* When no close button, remove the padding */\n.b-notification:not(:has(.b-notification__close)) .b-notification__message {\n padding-right: 0;\n}\n\n/* ── Description ── */\n.b-notification__description {\n margin-top: 0.375rem;\n font-size: var(--b-notification-font-size-desc);\n line-height: var(--b-notification-line-height);\n color: var(--b-notification-desc-color);\n}\n\n/* ── Action button area ── */\n.b-notification__btn {\n margin-top: 0.75rem;\n}\n\n/* ── Close button ── */\n.b-notification__close {\n position: absolute;\n top: 0.875rem;\n right: 1rem;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.125rem;\n background: transparent;\n border: none;\n border-radius: 0.25rem;\n cursor: pointer;\n color: var(--b-notification-close-color);\n line-height: 1;\n transition: color var(--b-notification-transition-duration) ease;\n}\n\n.b-notification__close:hover {\n color: var(--b-notification-close-hover-color);\n}\n\n.b-notification__close:focus-visible {\n outline: 2px solid oklch(62.3% 0.214 259.815);\n outline-offset: 2px;\n}\n\n.b-notification__close-svg {\n width: var(--b-notification-close-size);\n height: var(--b-notification-close-size);\n fill: currentColor;\n display: block;\n}\n\n/* ─────────────────────────────────────────────\n Transition – slide-in + fade per placement\n ───────────────────────────────────────────── */\n.b-notification-fade-enter-active,\n.b-notification-fade-leave-active {\n transition:\n opacity var(--b-notification-transition-duration, 300ms) ease,\n transform var(--b-notification-transition-duration, 300ms) ease;\n}\n\n/* top-right / bottom-right - slide in from right */\n.b-notification--top-right.b-notification-fade-enter-from,\n.b-notification--bottom-right.b-notification-fade-enter-from {\n opacity: 0;\n transform: translateX(100%);\n}\n\n.b-notification--top-right.b-notification-fade-enter-to,\n.b-notification--bottom-right.b-notification-fade-enter-to,\n.b-notification--top-right.b-notification-fade-leave-from,\n.b-notification--bottom-right.b-notification-fade-leave-from {\n opacity: 1;\n transform: translateX(0);\n}\n\n.b-notification--top-right.b-notification-fade-leave-to,\n.b-notification--bottom-right.b-notification-fade-leave-to {\n opacity: 0;\n transform: translateX(100%);\n}\n\n/* top-left / bottom-left - slide in from left */\n.b-notification--top-left.b-notification-fade-enter-from,\n.b-notification--bottom-left.b-notification-fade-enter-from {\n opacity: 0;\n transform: translateX(-100%);\n}\n\n.b-notification--top-left.b-notification-fade-enter-to,\n.b-notification--bottom-left.b-notification-fade-enter-to,\n.b-notification--top-left.b-notification-fade-leave-from,\n.b-notification--bottom-left.b-notification-fade-leave-from {\n opacity: 1;\n transform: translateX(0);\n}\n\n.b-notification--top-left.b-notification-fade-leave-to,\n.b-notification--bottom-left.b-notification-fade-leave-to {\n opacity: 0;\n transform: translateX(-100%);\n}\n\n/* Respect prefers-reduced-motion */\n@media (prefers-reduced-motion: reduce) {\n .b-notification-fade-enter-active,\n .b-notification-fade-leave-active {\n transition: opacity var(--b-notification-transition-duration, 300ms) ease;\n }\n\n .b-notification--top-right.b-notification-fade-enter-from,\n .b-notification--bottom-right.b-notification-fade-enter-from,\n .b-notification--top-left.b-notification-fade-enter-from,\n .b-notification--bottom-left.b-notification-fade-enter-from,\n .b-notification--top-right.b-notification-fade-leave-to,\n .b-notification--bottom-right.b-notification-fade-leave-to,\n .b-notification--top-left.b-notification-fade-leave-to,\n .b-notification--bottom-left.b-notification-fade-leave-to {\n transform: none;\n }\n}\n</style>\n"],"mappings":""}