bitboss-ui 2.0.5 → 2.0.8

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 (431) hide show
  1. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +1 -3
  2. package/dist/composables/useOptions.d.ts +1 -1
  3. package/dist/index.js +89 -87
  4. package/dist/index.js.map +1 -1
  5. package/dist/index10.js +7 -39
  6. package/dist/index10.js.map +1 -1
  7. package/dist/index101.js +60 -87
  8. package/dist/index101.js.map +1 -1
  9. package/dist/index103.js +113 -258
  10. package/dist/index103.js.map +1 -1
  11. package/dist/index105.js +254 -388
  12. package/dist/index105.js.map +1 -1
  13. package/dist/index107.js +387 -98
  14. package/dist/index107.js.map +1 -1
  15. package/dist/index109.js +52 -48
  16. package/dist/index109.js.map +1 -1
  17. package/dist/index11.js +74 -188
  18. package/dist/index11.js.map +1 -1
  19. package/dist/index111.js +35 -34
  20. package/dist/index111.js.map +1 -1
  21. package/dist/index113.js +105 -23
  22. package/dist/index113.js.map +1 -1
  23. package/dist/index115.js +23 -156
  24. package/dist/index115.js.map +1 -1
  25. package/dist/index117.js +153 -112
  26. package/dist/index117.js.map +1 -1
  27. package/dist/index119.js +115 -39
  28. package/dist/index119.js.map +1 -1
  29. package/dist/index12.js +38 -80
  30. package/dist/index12.js.map +1 -1
  31. package/dist/index121.js +36 -40
  32. package/dist/index121.js.map +1 -1
  33. package/dist/index122.js +34 -37
  34. package/dist/index122.js.map +1 -1
  35. package/dist/index123.js +30 -21
  36. package/dist/index123.js.map +1 -1
  37. package/dist/index124.js +47 -2
  38. package/dist/index124.js.map +1 -1
  39. package/dist/index125.js +35 -21
  40. package/dist/index125.js.map +1 -1
  41. package/dist/index126.js +2 -2
  42. package/dist/index126.js.map +1 -1
  43. package/dist/index127.js +21 -312
  44. package/dist/index127.js.map +1 -1
  45. package/dist/index128.js +2 -24
  46. package/dist/index128.js.map +1 -1
  47. package/dist/index129.js +312 -2
  48. package/dist/index129.js.map +1 -1
  49. package/dist/index13.js +196 -0
  50. package/dist/index13.js.map +1 -0
  51. package/dist/index130.js +24 -5
  52. package/dist/index130.js.map +1 -1
  53. package/dist/index131.js +2 -9
  54. package/dist/index131.js.map +1 -1
  55. package/dist/index132.js +5 -6
  56. package/dist/index132.js.map +1 -1
  57. package/dist/index133.js +9 -3
  58. package/dist/index133.js.map +1 -1
  59. package/dist/index134.js +6 -3
  60. package/dist/index134.js.map +1 -1
  61. package/dist/index135.js +1 -1
  62. package/dist/index136.js +1 -1
  63. package/dist/index137.js +1 -1
  64. package/dist/index138.js +1 -1
  65. package/dist/index139.js +1 -1
  66. package/dist/index14.js +73 -121
  67. package/dist/index14.js.map +1 -1
  68. package/dist/index140.js +1 -1
  69. package/dist/index141.js +1 -1
  70. package/dist/index142.js +1 -1
  71. package/dist/index143.js +1 -1
  72. package/dist/index144.js +1 -1
  73. package/dist/index145.js +1 -1
  74. package/dist/index146.js +1 -1
  75. package/dist/index147.js +1 -1
  76. package/dist/index148.js +1 -1
  77. package/dist/index149.js +1 -1
  78. package/dist/index150.js +1 -1
  79. package/dist/index151.js +1 -1
  80. package/dist/index152.js +1 -1
  81. package/dist/index153.js +1 -1
  82. package/dist/index154.js +1 -1
  83. package/dist/index155.js +1 -1
  84. package/dist/index156.js +1 -1
  85. package/dist/index157.js +1 -1
  86. package/dist/index158.js +1 -1
  87. package/dist/index159.js +2 -2
  88. package/dist/index16.js +119 -118
  89. package/dist/index16.js.map +1 -1
  90. package/dist/index160.js +6 -0
  91. package/dist/index160.js.map +1 -0
  92. package/dist/index161.js +1 -1
  93. package/dist/index163.js +2 -2
  94. package/dist/index165.js +1 -1
  95. package/dist/index166.js +1 -1
  96. package/dist/index167.js +1 -1
  97. package/dist/index168.js +1 -1
  98. package/dist/index169.js +2 -2
  99. package/dist/index170.js +6 -0
  100. package/dist/index170.js.map +1 -0
  101. package/dist/index171.js +3 -2
  102. package/dist/index171.js.map +1 -1
  103. package/dist/index173.js +2 -3
  104. package/dist/index173.js.map +1 -1
  105. package/dist/index174.js +1 -1
  106. package/dist/index175.js +1 -1
  107. package/dist/index176.js +1 -1
  108. package/dist/index177.js +1 -1
  109. package/dist/index178.js +1 -1
  110. package/dist/index179.js +1 -1
  111. package/dist/index18.js +120 -208
  112. package/dist/index18.js.map +1 -1
  113. package/dist/index180.js +1 -1
  114. package/dist/index181.js +1 -1
  115. package/dist/index182.js +1 -1
  116. package/dist/index183.js +2 -2
  117. package/dist/index184.js +6 -0
  118. package/dist/index184.js.map +1 -0
  119. package/dist/index185.js +1 -1
  120. package/dist/index187.js +1 -1
  121. package/dist/index189.js +1 -1
  122. package/dist/index190.js +1 -1
  123. package/dist/index191.js +1 -1
  124. package/dist/index192.js +1 -1
  125. package/dist/index193.js +1 -1
  126. package/dist/index194.js +1 -1
  127. package/dist/index195.js +1 -1
  128. package/dist/index196.js +1 -1
  129. package/dist/index197.js +3 -81
  130. package/dist/index197.js.map +1 -1
  131. package/dist/index198.js +3 -3
  132. package/dist/index198.js.map +1 -1
  133. package/dist/index199.js +81 -5
  134. package/dist/index199.js.map +1 -1
  135. package/dist/index20.js +193 -275
  136. package/dist/index20.js.map +1 -1
  137. package/dist/index200.js +2 -16
  138. package/dist/index200.js.map +1 -1
  139. package/dist/index201.js +3 -16
  140. package/dist/index201.js.map +1 -1
  141. package/dist/index202.js +124 -17
  142. package/dist/index202.js.map +1 -1
  143. package/dist/index203.js +5 -19
  144. package/dist/index203.js.map +1 -1
  145. package/dist/index204.js +119 -23
  146. package/dist/index204.js.map +1 -1
  147. package/dist/index205.js +19 -3
  148. package/dist/index205.js.map +1 -1
  149. package/dist/index206.js +16 -2
  150. package/dist/index206.js.map +1 -1
  151. package/dist/index207.js +16 -8
  152. package/dist/index207.js.map +1 -1
  153. package/dist/index208.js +2 -249
  154. package/dist/index208.js.map +1 -1
  155. package/dist/index209.js +5 -0
  156. package/dist/index209.js.map +1 -0
  157. package/dist/index210.js +35 -52
  158. package/dist/index210.js.map +1 -1
  159. package/dist/index211.js +173 -36
  160. package/dist/index211.js.map +1 -1
  161. package/dist/index212.js +6 -5
  162. package/dist/index212.js.map +1 -1
  163. package/dist/index213.js +39 -36
  164. package/dist/index213.js.map +1 -1
  165. package/dist/index215.js +13 -4
  166. package/dist/index215.js.map +1 -1
  167. package/dist/index216.js +5 -2
  168. package/dist/index216.js.map +1 -1
  169. package/dist/index217.js +369 -2
  170. package/dist/index217.js.map +1 -1
  171. package/dist/index218.js +6 -40
  172. package/dist/index218.js.map +1 -1
  173. package/dist/{index214.js → index219.js} +1 -1
  174. package/dist/{index214.js.map → index219.js.map} +1 -1
  175. package/dist/index22.js +287 -247
  176. package/dist/index22.js.map +1 -1
  177. package/dist/index220.js +4 -13
  178. package/dist/index220.js.map +1 -1
  179. package/dist/index221.js +2 -158
  180. package/dist/index221.js.map +1 -1
  181. package/dist/index222.js +3 -84
  182. package/dist/index222.js.map +1 -1
  183. package/dist/index223.js +10 -0
  184. package/dist/index223.js.map +1 -0
  185. package/dist/index224.js +19 -3
  186. package/dist/index224.js.map +1 -1
  187. package/dist/index225.js +26 -34
  188. package/dist/index225.js.map +1 -1
  189. package/dist/index226.js +3 -6
  190. package/dist/index226.js.map +1 -1
  191. package/dist/index227.js +249 -7
  192. package/dist/index227.js.map +1 -1
  193. package/dist/index228.js +49 -123
  194. package/dist/index228.js.map +1 -1
  195. package/dist/index229.js +44 -123
  196. package/dist/index229.js.map +1 -1
  197. package/dist/index230.js +5 -2
  198. package/dist/index230.js.map +1 -1
  199. package/dist/index231.js +49 -174
  200. package/dist/index231.js.map +1 -1
  201. package/dist/index232.js +158 -5
  202. package/dist/index232.js.map +1 -1
  203. package/dist/index233.js +83 -368
  204. package/dist/index233.js.map +1 -1
  205. package/dist/index235.js +2 -18
  206. package/dist/index235.js.map +1 -1
  207. package/dist/index236.js +17 -105
  208. package/dist/index236.js.map +1 -1
  209. package/dist/index237.js +109 -0
  210. package/dist/index237.js.map +1 -0
  211. package/dist/{index238.js → index239.js} +3 -3
  212. package/dist/{index238.js.map → index239.js.map} +1 -1
  213. package/dist/index24.js +249 -120
  214. package/dist/index24.js.map +1 -1
  215. package/dist/index241.js +2 -10
  216. package/dist/index241.js.map +1 -1
  217. package/dist/index242.js +9 -2
  218. package/dist/index242.js.map +1 -1
  219. package/dist/index243.js +3 -224
  220. package/dist/index243.js.map +1 -1
  221. package/dist/index244.js +9 -281
  222. package/dist/index244.js.map +1 -1
  223. package/dist/index245.js +23 -6
  224. package/dist/index245.js.map +1 -1
  225. package/dist/index246.js +6 -2
  226. package/dist/index246.js.map +1 -1
  227. package/dist/index247.js +16 -2
  228. package/dist/index247.js.map +1 -1
  229. package/dist/index248.js +224 -2
  230. package/dist/index248.js.map +1 -1
  231. package/dist/index249.js +281 -2
  232. package/dist/index249.js.map +1 -1
  233. package/dist/index250.js +6 -2
  234. package/dist/index250.js.map +1 -1
  235. package/dist/index251.js +2 -2
  236. package/dist/index252.js +2 -3
  237. package/dist/index252.js.map +1 -1
  238. package/dist/index253.js +2 -2
  239. package/dist/index254.js +2 -2
  240. package/dist/index255.js +2 -2
  241. package/dist/index256.js +122 -24
  242. package/dist/index256.js.map +1 -1
  243. package/dist/index257.js +429 -20
  244. package/dist/index257.js.map +1 -1
  245. package/dist/index258.js +6 -0
  246. package/dist/index258.js.map +1 -0
  247. package/dist/index26.js +119 -142
  248. package/dist/index26.js.map +1 -1
  249. package/dist/index260.js +6 -3
  250. package/dist/index260.js.map +1 -1
  251. package/dist/index261.js +21 -8
  252. package/dist/index261.js.map +1 -1
  253. package/dist/index263.js +9 -3
  254. package/dist/index263.js.map +1 -1
  255. package/dist/index264.js +439 -0
  256. package/dist/index264.js.map +1 -0
  257. package/dist/index265.js +127 -6
  258. package/dist/index265.js.map +1 -1
  259. package/dist/index266.js +199 -15
  260. package/dist/index266.js.map +1 -1
  261. package/dist/index267.js +4 -9
  262. package/dist/index267.js.map +1 -1
  263. package/dist/index268.js +89 -3
  264. package/dist/index268.js.map +1 -1
  265. package/dist/index269.js +2 -12
  266. package/dist/index269.js.map +1 -1
  267. package/dist/index270.js +2 -9
  268. package/dist/index270.js.map +1 -1
  269. package/dist/index271.js +2 -9
  270. package/dist/index271.js.map +1 -1
  271. package/dist/index272.js +2 -17
  272. package/dist/index272.js.map +1 -1
  273. package/dist/index273.js +2 -431
  274. package/dist/index273.js.map +1 -1
  275. package/dist/index274.js +2 -89
  276. package/dist/index274.js.map +1 -1
  277. package/dist/index275.js +28 -2
  278. package/dist/index275.js.map +1 -1
  279. package/dist/index276.js +17 -64
  280. package/dist/index276.js.map +1 -1
  281. package/dist/index278.js +3 -200
  282. package/dist/index278.js.map +1 -1
  283. package/dist/index279.js +12 -2
  284. package/dist/index279.js.map +1 -1
  285. package/dist/index28.js +138 -83
  286. package/dist/index28.js.map +1 -1
  287. package/dist/index280.js +7 -124
  288. package/dist/index280.js.map +1 -1
  289. package/dist/index281.js +7 -20
  290. package/dist/index281.js.map +1 -1
  291. package/dist/index282.js +20 -0
  292. package/dist/index282.js.map +1 -0
  293. package/dist/index283.js +2 -436
  294. package/dist/index283.js.map +1 -1
  295. package/dist/index284.js +68 -126
  296. package/dist/index284.js.map +1 -1
  297. package/dist/index285.js +5 -3
  298. package/dist/index285.js.map +1 -1
  299. package/dist/index286.js +1 -1
  300. package/dist/index287.js +3 -211
  301. package/dist/index287.js.map +1 -1
  302. package/dist/index288.js +214 -0
  303. package/dist/index288.js.map +1 -0
  304. package/dist/index290.js +4 -7
  305. package/dist/index290.js.map +1 -1
  306. package/dist/index291.js +4 -19
  307. package/dist/index291.js.map +1 -1
  308. package/dist/index292.js +58 -6
  309. package/dist/index292.js.map +1 -1
  310. package/dist/index293.js +35 -4
  311. package/dist/index293.js.map +1 -1
  312. package/dist/index294.js +7 -4
  313. package/dist/index294.js.map +1 -1
  314. package/dist/index295.js +6 -58
  315. package/dist/index295.js.map +1 -1
  316. package/dist/index296.js +18 -34
  317. package/dist/index296.js.map +1 -1
  318. package/dist/index297.js +2 -11
  319. package/dist/index297.js.map +1 -1
  320. package/dist/index298.js +47 -2
  321. package/dist/index298.js.map +1 -1
  322. package/dist/index299.js +10 -46
  323. package/dist/index299.js.map +1 -1
  324. package/dist/index30.js +85 -115
  325. package/dist/index30.js.map +1 -1
  326. package/dist/index32.js +111 -112
  327. package/dist/index32.js.map +1 -1
  328. package/dist/index34.js +114 -365
  329. package/dist/index34.js.map +1 -1
  330. package/dist/index36.js +361 -283
  331. package/dist/index36.js.map +1 -1
  332. package/dist/index38.js +288 -106
  333. package/dist/index38.js.map +1 -1
  334. package/dist/index40.js +114 -121
  335. package/dist/index40.js.map +1 -1
  336. package/dist/index42.js +113 -200
  337. package/dist/index42.js.map +1 -1
  338. package/dist/index44.js +180 -90
  339. package/dist/index44.js.map +1 -1
  340. package/dist/index46.js +110 -78
  341. package/dist/index46.js.map +1 -1
  342. package/dist/index48.js +89 -54
  343. package/dist/index48.js.map +1 -1
  344. package/dist/index5.js +14 -78
  345. package/dist/index5.js.map +1 -1
  346. package/dist/index50.js +54 -84
  347. package/dist/index50.js.map +1 -1
  348. package/dist/index52.js +86 -60
  349. package/dist/index52.js.map +1 -1
  350. package/dist/index54.js +59 -40
  351. package/dist/index54.js.map +1 -1
  352. package/dist/index56.js +42 -55
  353. package/dist/index56.js.map +1 -1
  354. package/dist/index58.js +53 -103
  355. package/dist/index58.js.map +1 -1
  356. package/dist/index6.js +36 -58
  357. package/dist/index6.js.map +1 -1
  358. package/dist/index60.js +103 -89
  359. package/dist/index60.js.map +1 -1
  360. package/dist/index62.js +61 -88
  361. package/dist/index62.js.map +1 -1
  362. package/dist/index64.js +119 -77
  363. package/dist/index64.js.map +1 -1
  364. package/dist/index66.js +77 -91
  365. package/dist/index66.js.map +1 -1
  366. package/dist/index68.js +88 -49
  367. package/dist/index68.js.map +1 -1
  368. package/dist/index7.js +78 -20
  369. package/dist/index7.js.map +1 -1
  370. package/dist/index70.js +51 -304
  371. package/dist/index70.js.map +1 -1
  372. package/dist/index72.js +299 -115
  373. package/dist/index72.js.map +1 -1
  374. package/dist/index74.js +120 -214
  375. package/dist/index74.js.map +1 -1
  376. package/dist/index76.js +213 -36
  377. package/dist/index76.js.map +1 -1
  378. package/dist/index78.js +47 -0
  379. package/dist/index78.js.map +1 -0
  380. package/dist/index79.js +119 -230
  381. package/dist/index79.js.map +1 -1
  382. package/dist/index8.js +61 -7
  383. package/dist/index8.js.map +1 -1
  384. package/dist/index81.js +227 -154
  385. package/dist/index81.js.map +1 -1
  386. package/dist/index83.js +154 -207
  387. package/dist/index83.js.map +1 -1
  388. package/dist/index85.js +215 -26
  389. package/dist/index85.js.map +1 -1
  390. package/dist/index87.js +27 -88
  391. package/dist/index87.js.map +1 -1
  392. package/dist/index89.js +53 -88
  393. package/dist/index89.js.map +1 -1
  394. package/dist/index9.js +17 -76
  395. package/dist/index9.js.map +1 -1
  396. package/dist/index91.js +75 -44
  397. package/dist/index91.js.map +1 -1
  398. package/dist/index93.js +89 -15
  399. package/dist/index93.js.map +1 -1
  400. package/dist/index95.js +15 -166
  401. package/dist/index95.js.map +1 -1
  402. package/dist/index97.js +120 -59
  403. package/dist/index97.js.map +1 -1
  404. package/dist/index99.js +66 -52
  405. package/dist/index99.js.map +1 -1
  406. package/dist/style.css +1 -1
  407. package/package.json +2 -2
  408. package/dist/index120.js +0 -47
  409. package/dist/index120.js.map +0 -1
  410. package/dist/index164.js +0 -6
  411. package/dist/index164.js.map +0 -1
  412. package/dist/index172.js +0 -6
  413. package/dist/index172.js.map +0 -1
  414. package/dist/index188.js +0 -6
  415. package/dist/index188.js.map +0 -1
  416. package/dist/index234.js +0 -6
  417. package/dist/index234.js.map +0 -1
  418. package/dist/index240.js +0 -5
  419. package/dist/index240.js.map +0 -1
  420. package/dist/index259.js +0 -10
  421. package/dist/index259.js.map +0 -1
  422. package/dist/index262.js +0 -26
  423. package/dist/index262.js.map +0 -1
  424. package/dist/index277.js +0 -8
  425. package/dist/index277.js.map +0 -1
  426. package/dist/index3.js +0 -17
  427. package/dist/index3.js.map +0 -1
  428. package/dist/index4.js +0 -43
  429. package/dist/index4.js.map +0 -1
  430. package/dist/index77.js +0 -130
  431. package/dist/index77.js.map +0 -1
package/dist/index52.js CHANGED
@@ -1,69 +1,95 @@
1
- import { defineComponent as z, computed as b, ref as o, onMounted as g, openBlock as l, createElementBlock as i, normalizeProps as h, guardReactiveProps as k, renderSlot as y } from "vue";
2
- import { isCssColor as _ } from "./index214.js";
3
- import { wait as C } from "./index126.js";
4
- const w = ["alt", "sizes", "src", "srcset"], B = {
5
- key: 1,
6
- class: "bb-avatar__fallback"
7
- }, P = /* @__PURE__ */ z({
8
- __name: "BbAvatar",
1
+ import { defineComponent as h, ref as f, watch as v, openBlock as s, createBlock as a, normalizeClass as k, withCtx as C, createElementVNode as t, createCommentVNode as i, renderSlot as n, normalizeProps as r, guardReactiveProps as c, createTextVNode as d, toDisplayString as m, createElementBlock as w } from "vue";
2
+ import V from "./index122.js";
3
+ /* empty css */
4
+ import y from "./index123.js";
5
+ /* empty css */
6
+ const z = {
7
+ class: "bb-alert__inner-container",
8
+ role: "alert"
9
+ }, B = { class: "bb-alert__icon-container" }, g = { class: "bb-alert__content" }, $ = { class: "bb-alert__title" }, L = {
10
+ key: 0,
11
+ class: "bb-alert__close"
12
+ }, S = ["aria-label"], N = /* @__PURE__ */ t("svg", {
13
+ fill: "none",
14
+ viewBox: "0 0 24 24",
15
+ xmlns: "http://www.w3.org/2000/svg"
16
+ }, [
17
+ /* @__PURE__ */ t("path", {
18
+ d: "M23 23L1 1M23 1L1 23",
19
+ stroke: "currentColor",
20
+ "stroke-linecap": "round",
21
+ "stroke-width": "2"
22
+ })
23
+ ], -1), E = [
24
+ N
25
+ ], M = { class: "bb-alert__text" }, q = /* @__PURE__ */ h({
26
+ __name: "BbAlert",
9
27
  props: {
10
- color: {},
11
- size: {},
12
- alt: {},
13
- src: {},
14
- srcset: {},
15
- sizes: {},
16
- timeout: { default: 400 }
28
+ closeLabel: { default: "Chiudi" },
29
+ showClose: { type: Boolean },
30
+ text: {},
31
+ theme: { default: "default" },
32
+ title: {},
33
+ icon: {},
34
+ iconSize: {},
35
+ modelValue: {}
17
36
  },
18
- setup(u) {
19
- const s = u, f = {
20
- xs: 24,
21
- sm: 32,
22
- md: 40,
23
- lg: 56,
24
- xl: 80,
25
- xxl: 104
26
- }, m = b(() => {
27
- const e = {
28
- "bb-avatar": !0
29
- };
30
- let r;
31
- s.size && (typeof s.size == "string" ? r = f[s.size] ?? parseInt(s.size, 10) : r = s.size, r += "px");
32
- let c = {
33
- width: r,
34
- height: r
35
- };
36
- return s.color && (_(s.color) ? c.backgroundColor = s.color : e[`bb-avatar--${s.color}`] = !0), {
37
- class: e,
38
- style: c
39
- };
40
- }), d = (e) => !(!e || !e.complete || e.naturalWidth === 0), a = o(), n = o(!1), t = o(!1);
41
- g(async () => {
42
- !t.value && !n.value && a.value && (await C(s.timeout), t.value = !d(a.value));
43
- });
37
+ emits: ["update:modelValue"],
38
+ setup(u, { emit: _ }) {
39
+ const l = u, b = _, o = f(
40
+ l.modelValue === void 0 ? !0 : !!l.modelValue
41
+ );
42
+ v(
43
+ () => l.modelValue,
44
+ (e) => {
45
+ o.value !== !!e && (o.value = !!e);
46
+ }
47
+ );
44
48
  const p = () => {
45
- n.value = !0;
46
- }, v = () => {
47
- t.value = !0;
49
+ o.value = !1, b("update:modelValue", !1);
48
50
  };
49
- return (e, r) => (l(), i("span", h(k(m.value)), [
50
- (e.src || e.srcset) && !t.value ? (l(), i("img", {
51
- key: 0,
52
- ref_key: "image",
53
- ref: a,
54
- alt: e.alt,
55
- sizes: e.sizes,
56
- src: e.src,
57
- srcset: e.srcset,
58
- onError: v,
59
- onLoad: p
60
- }, null, 40, w)) : (l(), i("span", B, [
61
- y(e.$slots, "default")
62
- ]))
63
- ], 16));
51
+ return (e, P) => (s(), a(V, {
52
+ class: k(["bb-alert", { [`bb-alert--${e.theme}`]: e.theme }]),
53
+ "model-value": o.value
54
+ }, {
55
+ default: C(() => [
56
+ t("div", z, [
57
+ t("div", B, [
58
+ e.icon ? (s(), a(y, {
59
+ key: 0,
60
+ class: "bb-alert__icon",
61
+ size: e.iconSize,
62
+ type: e.icon
63
+ }, null, 8, ["size", "type"])) : i("", !0)
64
+ ]),
65
+ t("div", g, [
66
+ t("div", $, [
67
+ n(e.$slots, "title", r(c({ text: e.title })), () => [
68
+ d(m(e.title), 1)
69
+ ]),
70
+ e.showClose ? (s(), w("div", L, [
71
+ t("button", {
72
+ "aria-label": e.closeLabel,
73
+ block: "",
74
+ class: "bb-alert__close-btn",
75
+ type: "button",
76
+ onClick: p
77
+ }, E, 8, S)
78
+ ])) : i("", !0)
79
+ ]),
80
+ t("p", M, [
81
+ n(e.$slots, "text", r(c({ text: e.text })), () => [
82
+ d(m(e.text), 1)
83
+ ])
84
+ ])
85
+ ])
86
+ ])
87
+ ]),
88
+ _: 3
89
+ }, 8, ["class", "model-value"]));
64
90
  }
65
91
  });
66
92
  export {
67
- P as default
93
+ q as default
68
94
  };
69
95
  //# sourceMappingURL=index52.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index52.js","sources":["../src/components/BbAvatar/BbAvatar.vue"],"sourcesContent":["<template>\n\t<span v-bind=\"attributes\">\n\t\t<img\n\t\t\tv-if=\"(src || srcset) && !imageErrored\"\n\t\t\tref=\"image\"\n\t\t\t:alt=\"alt\"\n\t\t\t:sizes=\"sizes\"\n\t\t\t:src=\"src\"\n\t\t\t:srcset=\"srcset\"\n\t\t\t@error=\"onError\"\n\t\t\t@load=\"onLoad\"\n\t\t/>\n\t\t<span v-else class=\"bb-avatar__fallback\">\n\t\t\t<slot></slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, type ImgHTMLAttributes, onMounted } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport type { Classes } from '@/types/Classes';\nimport type { CommonProps } from '@/types/CommonProps';\nimport type { BbIconProps, Size } from '../BbIcon/BbIcon.vue';\nimport { wait } from '@/utilities/functions/wait';\n\nexport type BbAvatarProps = Pick<CommonProps, 'color'> &\n\tPick<BbIconProps, 'size'> & {\n\t\talt?: ImgHTMLAttributes['alt'];\n\t\tsrc?: ImgHTMLAttributes['src'];\n\t\tsrcset?: ImgHTMLAttributes['srcset'];\n\t\tsizes?: ImgHTMLAttributes['sizes'];\n\t\ttimeout?: number;\n\t};\n\nconst props = withDefaults(defineProps<BbAvatarProps>(), {\n\ttimeout: 400,\n});\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n}>();\n\nconst sizeMap: Size = {\n\txs: 24,\n\tsm: 32,\n\tmd: 40,\n\tlg: 56,\n\txl: 80,\n\txxl: 104,\n};\n\nconst attributes = computed(() => {\n\tconst classes: Classes = {\n\t\t'bb-avatar': true,\n\t};\n\tlet dimension: any;\n\tif (props.size) {\n\t\tif (typeof props.size === 'string') {\n\t\t\tdimension = sizeMap[props.size as keyof Size] ?? parseInt(props.size, 10);\n\t\t} else {\n\t\t\tdimension = props.size;\n\t\t}\n\t\tdimension += `px`;\n\t}\n\n\tlet style: { [key: string]: any } = {\n\t\twidth: dimension,\n\t\theight: dimension,\n\t};\n\tif (props.color) {\n\t\tif (isCssColor(props.color)) {\n\t\t\tstyle.backgroundColor = props.color;\n\t\t} else {\n\t\t\tclasses[`bb-avatar--${props.color}`] = true;\n\t\t}\n\t}\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n\nconst imageHasLoadedCorrectly = (img: HTMLImageElement) => {\n\tif (!img) return false;\n\t// During the onload event, IE correctly identifies any images that\n\t// weren’t downloaded as not complete. Others should too. Gecko-based\n\t// browsers act like NS4 in that they report this incorrectly.\n\tif (!img.complete) {\n\t\treturn false;\n\t}\n\n\t// However, they do have two very useful properties: naturalWidth and\n\t// naturalHeight. These give the true size of the image. If it failed\n\t// to load, either of these should be zero.\n\tif (img.naturalWidth === 0) {\n\t\treturn false;\n\t}\n\n\t// No other way of checking: assume it’s ok.\n\treturn true;\n};\n\nconst image = ref<HTMLImageElement | null>();\nconst imageLoaded = ref(false);\nconst imageErrored = ref(false);\n\nonMounted(async () => {\n\t// Only run when events don't fire (when the page is SSR)\n\tif (!imageErrored.value && !imageLoaded.value) {\n\t\tif (image.value) {\n\t\t\tawait wait(props.timeout);\n\t\t\timageErrored.value = !imageHasLoadedCorrectly(image.value);\n\t\t}\n\t}\n});\nconst onLoad = () => {\n\timageLoaded.value = true;\n};\nconst onError = () => {\n\timageErrored.value = true;\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbAvatar';\n</style>\n"],"names":["props","__props","sizeMap","attributes","computed","classes","dimension","style","isCssColor","imageHasLoadedCorrectly","img","image","ref","imageLoaded","imageErrored","onMounted","wait","onLoad","onError"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,UAAMA,IAAQC,GAQRC,IAAgB;AAAA,MACrB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGAC,IAAaC,EAAS,MAAM;AACjC,YAAMC,IAAmB;AAAA,QACxB,aAAa;AAAA,MAAA;AAEV,UAAAC;AACJ,MAAIN,EAAM,SACL,OAAOA,EAAM,QAAS,WACzBM,IAAYJ,EAAQF,EAAM,IAAkB,KAAK,SAASA,EAAM,MAAM,EAAE,IAExEM,IAAYN,EAAM,MAENM,KAAA;AAGd,UAAIC,IAAgC;AAAA,QACnC,OAAOD;AAAA,QACP,QAAQA;AAAA,MAAA;AAET,aAAIN,EAAM,UACLQ,EAAWR,EAAM,KAAK,IACzBO,EAAM,kBAAkBP,EAAM,QAE9BK,EAAQ,cAAcL,EAAM,KAAK,EAAE,IAAI,KAGlC;AAAA,QACN,OAAOK;AAAA,QACP,OAAAE;AAAA,MAAA;AAAA,IACD,CACA,GAEKE,IAA0B,CAACC,MAC5B,GAACA,KAID,CAACA,EAAI,YAOLA,EAAI,iBAAiB,IAQpBC,IAAQC,KACRC,IAAcD,EAAI,EAAK,GACvBE,IAAeF,EAAI,EAAK;AAE9B,IAAAG,EAAU,YAAY;AAErB,MAAI,CAACD,EAAa,SAAS,CAACD,EAAY,SACnCF,EAAM,UACH,MAAAK,EAAKhB,EAAM,OAAO,GACxBc,EAAa,QAAQ,CAACL,EAAwBE,EAAM,KAAK;AAAA,IAE3D,CACA;AACD,UAAMM,IAAS,MAAM;AACpB,MAAAJ,EAAY,QAAQ;AAAA,IAAA,GAEfK,IAAU,MAAM;AACrB,MAAAJ,EAAa,QAAQ;AAAA,IAAA;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index52.js","sources":["../src/components/BbAlert/BbAlert.vue"],"sourcesContent":["<template>\n\t<BbCollapsible\n\t\tclass=\"bb-alert\"\n\t\t:class=\"{ [`bb-alert--${theme}`]: theme }\"\n\t\t:model-value=\"innerValue\"\n\t>\n\t\t<div class=\"bb-alert__inner-container\" role=\"alert\">\n\t\t\t<div class=\"bb-alert__icon-container\">\n\t\t\t\t<BbIcon\n\t\t\t\t\tv-if=\"icon\"\n\t\t\t\t\tclass=\"bb-alert__icon\"\n\t\t\t\t\t:size=\"iconSize\"\n\t\t\t\t\t:type=\"icon\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div class=\"bb-alert__content\">\n\t\t\t\t<div class=\"bb-alert__title\">\n\t\t\t\t\t<slot name=\"title\" v-bind=\"{ text: title }\">{{ title }}</slot>\n\t\t\t\t\t<div v-if=\"showClose\" class=\"bb-alert__close\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t:aria-label=\"closeLabel\"\n\t\t\t\t\t\t\tblock\n\t\t\t\t\t\t\tclass=\"bb-alert__close-btn\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t@click=\"onClickClose\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td=\"M23 23L1 1M23 1L1 23\"\n\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<p class=\"bb-alert__text\">\n\t\t\t\t\t<slot name=\"text\" v-bind=\"{ text: text }\">{{ text }}</slot>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\t</BbCollapsible>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BbCollapsible from '../BbCollapsible/BbCollapsible.vue';\nimport BbIcon from '../BbIcon/BbIcon.vue';\nimport type { BbIconProps } from '../BbIcon/BbIcon.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbAlertProps = Pick<\n\tCommonProps,\n\t'closeLabel' | 'showClose' | 'text' | 'theme' | 'title'\n> & {\n\t/**\n\t * Name of the icon to use\n\t */\n\ticon?: BbIconProps['type'];\n\t/**\n\t * Size of the icon to use\n\t */\n\ticonSize?: BbIconProps['size'];\n\t/**\n\t * Used by v-model, set type to any to avoid Vue casting it as false\n\t */\n\tmodelValue?: any;\n};\n\nconst props = withDefaults(defineProps<BbAlertProps>(), {\n\tcloseLabel: 'Chiudi',\n\ttheme: 'default',\n});\n\nexport type BbAlertEvents = {\n\t(e: 'update:modelValue', value: boolean): void;\n};\nconst emit = defineEmits<BbAlertEvents>();\n\ndefineSlots<{\n\ttitle?: (props: { text: BbAlertProps['title'] }) => any;\n\ttext?: (props: { text: BbAlertProps['title'] }) => any;\n}>();\n\nconst innerValue = ref(\n\tprops.modelValue === undefined ? true : !!props.modelValue\n);\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tif (innerValue.value !== !!value) {\n\t\t\tinnerValue.value = !!value;\n\t\t}\n\t}\n);\n\nconst onClickClose = () => {\n\tinnerValue.value = false;\n\temit('update:modelValue', false);\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbAlert';\n</style>\n"],"names":["props","__props","emit","__emit","innerValue","ref","watch","value","onClickClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,UAAMA,IAAQC,GAQRC,IAAOC,GAOPC,IAAaC;AAAA,MAClBL,EAAM,eAAe,SAAY,KAAO,CAAC,CAACA,EAAM;AAAA,IAAA;AAGjD,IAAAM;AAAA,MACC,MAAMN,EAAM;AAAA,MACZ,CAACO,MAAU;AACV,QAAIH,EAAW,UAAU,CAAC,CAACG,MACfH,EAAA,QAAQ,CAAC,CAACG;AAAA,MAEvB;AAAA,IAAA;AAGD,UAAMC,IAAe,MAAM;AAC1B,MAAAJ,EAAW,QAAQ,IACnBF,EAAK,qBAAqB,EAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index54.js CHANGED
@@ -1,50 +1,69 @@
1
- import { defineComponent as p, useSlots as d, computed as n, openBlock as m, createElementBlock as u, normalizeClass as g, createElementVNode as s, renderSlot as l, mergeProps as f, createTextVNode as _, toDisplayString as y } from "vue";
2
- import { isCssColor as r } from "./index214.js";
3
- import { isNil as B } from "./index124.js";
4
- const C = { class: "bb-badge__wrapper" }, h = { class: "bb-badge__content-inner" }, S = /* @__PURE__ */ p({
5
- __name: "BbBadge",
1
+ import { defineComponent as z, computed as b, ref as o, onMounted as g, openBlock as l, createElementBlock as i, normalizeProps as h, guardReactiveProps as k, renderSlot as y } from "vue";
2
+ import { isCssColor as _ } from "./index219.js";
3
+ import { wait as C } from "./index128.js";
4
+ const w = ["alt", "sizes", "src", "srcset"], B = {
5
+ key: 1,
6
+ class: "bb-avatar__fallback"
7
+ }, P = /* @__PURE__ */ z({
8
+ __name: "BbAvatar",
6
9
  props: {
7
10
  color: {},
8
- bottom: { type: Boolean },
9
- content: {},
10
- floating: { type: Boolean },
11
- left: { type: Boolean }
11
+ size: {},
12
+ alt: {},
13
+ src: {},
14
+ srcset: {},
15
+ sizes: {},
16
+ timeout: { default: 400 }
12
17
  },
13
- setup(b) {
14
- const a = d(), e = b, c = n(() => ({
15
- "bb-badge": !0,
16
- "bb-badge--bottom": e.bottom,
17
- "bb-badge--left": e.left,
18
- "bb-badge--positioned": a.default,
19
- "bb-badge--floating": e.floating,
20
- "bb-badge--empty": B(e.content),
21
- [`bb-badge--${e.color}`]: e.color && !r(e.color)
22
- })), i = n(() => {
23
- let t = {};
24
- e.color && r(e.color) && (t.backgroundColor = e.color);
25
- let o = {};
26
- return a.wrap && (o["aria-atomic"] = !0, o["aria-live"] = "polite", o.role = "status"), {
27
- style: t,
28
- ...o
18
+ setup(u) {
19
+ const s = u, f = {
20
+ xs: 24,
21
+ sm: 32,
22
+ md: 40,
23
+ lg: 56,
24
+ xl: 80,
25
+ xxl: 104
26
+ }, m = b(() => {
27
+ const e = {
28
+ "bb-avatar": !0
29
29
  };
30
+ let r;
31
+ s.size && (typeof s.size == "string" ? r = f[s.size] ?? parseInt(s.size, 10) : r = s.size, r += "px");
32
+ let c = {
33
+ width: r,
34
+ height: r
35
+ };
36
+ return s.color && (_(s.color) ? c.backgroundColor = s.color : e[`bb-avatar--${s.color}`] = !0), {
37
+ class: e,
38
+ style: c
39
+ };
40
+ }), d = (e) => !(!e || !e.complete || e.naturalWidth === 0), a = o(), n = o(!1), t = o(!1);
41
+ g(async () => {
42
+ !t.value && !n.value && a.value && (await C(s.timeout), t.value = !d(a.value));
30
43
  });
31
- return (t, o) => (m(), u("span", {
32
- class: g(c.value)
33
- }, [
34
- s("span", C, [
35
- l(t.$slots, "default"),
36
- s("span", f({ class: "bb-badge__content-container" }, i.value), [
37
- s("span", h, [
38
- l(t.$slots, "content", {}, () => [
39
- _(y(t.content), 1)
40
- ])
41
- ])
42
- ], 16)
43
- ])
44
- ], 2));
44
+ const p = () => {
45
+ n.value = !0;
46
+ }, v = () => {
47
+ t.value = !0;
48
+ };
49
+ return (e, r) => (l(), i("span", h(k(m.value)), [
50
+ (e.src || e.srcset) && !t.value ? (l(), i("img", {
51
+ key: 0,
52
+ ref_key: "image",
53
+ ref: a,
54
+ alt: e.alt,
55
+ sizes: e.sizes,
56
+ src: e.src,
57
+ srcset: e.srcset,
58
+ onError: v,
59
+ onLoad: p
60
+ }, null, 40, w)) : (l(), i("span", B, [
61
+ y(e.$slots, "default")
62
+ ]))
63
+ ], 16));
45
64
  }
46
65
  });
47
66
  export {
48
- S as default
67
+ P as default
49
68
  };
50
69
  //# sourceMappingURL=index54.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index54.js","sources":["../src/components/BbBadge/BbBadge.vue"],"sourcesContent":["<template>\n\t<span :class=\"classes\">\n\t\t<span class=\"bb-badge__wrapper\">\n\t\t\t<slot></slot>\n\t\t\t<span class=\"bb-badge__content-container\" v-bind=\"contentAttributes\">\n\t\t\t\t<span class=\"bb-badge__content-inner\"\n\t\t\t\t\t><slot name=\"content\">{{ content }}</slot></span\n\t\t\t\t>\n\t\t\t</span>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport { isNil } from '@/utilities/functions/isNil';\nimport type { CommonProps } from '@/types/CommonProps';\n\nconst slots = useSlots();\n\nexport type BbBadgeProps = Pick<CommonProps, 'color'> & {\n\t/**\n\t * Displays the badge on the bottom of the wrapped component.\n\t */\n\tbottom?: boolean;\n\t/**\n\t * Text content of the badge\n\t */\n\tcontent?: string | number | null;\n\t/**\n\t * Renders the badge i little further from the wrapped\n\t * component making it look like it's floating\n\t * and not stacked.\n\t */\n\tfloating?: boolean;\n\t/**\n\t * Displays the badge on the left of the wrapped component.\n\t */\n\tleft?: boolean;\n};\n\nconst props = withDefaults(defineProps<BbBadgeProps>(), {});\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n\tcontent?: (props: object) => any;\n}>();\n\nconst classes = computed(() => {\n\treturn {\n\t\t'bb-badge': true,\n\t\t'bb-badge--bottom': props.bottom,\n\t\t'bb-badge--left': props.left,\n\t\t'bb-badge--positioned': slots.default,\n\t\t'bb-badge--floating': props.floating,\n\t\t'bb-badge--empty': isNil(props.content),\n\t\t[`bb-badge--${props.color}`]: props.color && !isCssColor(props.color),\n\t};\n});\n\nconst contentAttributes = computed(() => {\n\tlet style: Record<string, string> = {};\n\tif (props.color && isCssColor(props.color)) {\n\t\tstyle.backgroundColor = props.color;\n\t}\n\n\tlet accessibilityAttributes: Record<string, string | boolean> = {};\n\tif (slots.wrap) {\n\t\taccessibilityAttributes['aria-atomic'] = true;\n\t\taccessibilityAttributes['aria-live'] = 'polite';\n\t\taccessibilityAttributes['role'] = 'status';\n\t}\n\treturn {\n\t\tstyle,\n\t\t...accessibilityAttributes,\n\t};\n});\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BbBadge';\n</style>\n"],"names":["slots","useSlots","props","__props","classes","computed","isNil","isCssColor","contentAttributes","style","accessibilityAttributes"],"mappings":";;;;;;;;;;;;;AAmBA,UAAMA,IAAQC,KAuBRC,IAAQC,GAORC,IAAUC,EAAS,OACjB;AAAA,MACN,YAAY;AAAA,MACZ,oBAAoBH,EAAM;AAAA,MAC1B,kBAAkBA,EAAM;AAAA,MACxB,wBAAwBF,EAAM;AAAA,MAC9B,sBAAsBE,EAAM;AAAA,MAC5B,mBAAmBI,EAAMJ,EAAM,OAAO;AAAA,MACtC,CAAC,aAAaA,EAAM,KAAK,EAAE,GAAGA,EAAM,SAAS,CAACK,EAAWL,EAAM,KAAK;AAAA,IAAA,EAErE,GAEKM,IAAoBH,EAAS,MAAM;AACxC,UAAII,IAAgC,CAAA;AACpC,MAAIP,EAAM,SAASK,EAAWL,EAAM,KAAK,MACxCO,EAAM,kBAAkBP,EAAM;AAG/B,UAAIQ,IAA4D,CAAA;AAChE,aAAIV,EAAM,SACTU,EAAwB,aAAa,IAAI,IACzCA,EAAwB,WAAW,IAAI,UACvCA,EAAwB,OAAU,WAE5B;AAAA,QACN,OAAAD;AAAA,QACA,GAAGC;AAAA,MAAA;AAAA,IACJ,CACA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index54.js","sources":["../src/components/BbAvatar/BbAvatar.vue"],"sourcesContent":["<template>\n\t<span v-bind=\"attributes\">\n\t\t<img\n\t\t\tv-if=\"(src || srcset) && !imageErrored\"\n\t\t\tref=\"image\"\n\t\t\t:alt=\"alt\"\n\t\t\t:sizes=\"sizes\"\n\t\t\t:src=\"src\"\n\t\t\t:srcset=\"srcset\"\n\t\t\t@error=\"onError\"\n\t\t\t@load=\"onLoad\"\n\t\t/>\n\t\t<span v-else class=\"bb-avatar__fallback\">\n\t\t\t<slot></slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, type ImgHTMLAttributes, onMounted } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport type { Classes } from '@/types/Classes';\nimport type { CommonProps } from '@/types/CommonProps';\nimport type { BbIconProps, Size } from '../BbIcon/BbIcon.vue';\nimport { wait } from '@/utilities/functions/wait';\n\nexport type BbAvatarProps = Pick<CommonProps, 'color'> &\n\tPick<BbIconProps, 'size'> & {\n\t\talt?: ImgHTMLAttributes['alt'];\n\t\tsrc?: ImgHTMLAttributes['src'];\n\t\tsrcset?: ImgHTMLAttributes['srcset'];\n\t\tsizes?: ImgHTMLAttributes['sizes'];\n\t\ttimeout?: number;\n\t};\n\nconst props = withDefaults(defineProps<BbAvatarProps>(), {\n\ttimeout: 400,\n});\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n}>();\n\nconst sizeMap: Size = {\n\txs: 24,\n\tsm: 32,\n\tmd: 40,\n\tlg: 56,\n\txl: 80,\n\txxl: 104,\n};\n\nconst attributes = computed(() => {\n\tconst classes: Classes = {\n\t\t'bb-avatar': true,\n\t};\n\tlet dimension: any;\n\tif (props.size) {\n\t\tif (typeof props.size === 'string') {\n\t\t\tdimension = sizeMap[props.size as keyof Size] ?? parseInt(props.size, 10);\n\t\t} else {\n\t\t\tdimension = props.size;\n\t\t}\n\t\tdimension += `px`;\n\t}\n\n\tlet style: { [key: string]: any } = {\n\t\twidth: dimension,\n\t\theight: dimension,\n\t};\n\tif (props.color) {\n\t\tif (isCssColor(props.color)) {\n\t\t\tstyle.backgroundColor = props.color;\n\t\t} else {\n\t\t\tclasses[`bb-avatar--${props.color}`] = true;\n\t\t}\n\t}\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n\nconst imageHasLoadedCorrectly = (img: HTMLImageElement) => {\n\tif (!img) return false;\n\t// During the onload event, IE correctly identifies any images that\n\t// weren’t downloaded as not complete. Others should too. Gecko-based\n\t// browsers act like NS4 in that they report this incorrectly.\n\tif (!img.complete) {\n\t\treturn false;\n\t}\n\n\t// However, they do have two very useful properties: naturalWidth and\n\t// naturalHeight. These give the true size of the image. If it failed\n\t// to load, either of these should be zero.\n\tif (img.naturalWidth === 0) {\n\t\treturn false;\n\t}\n\n\t// No other way of checking: assume it’s ok.\n\treturn true;\n};\n\nconst image = ref<HTMLImageElement | null>();\nconst imageLoaded = ref(false);\nconst imageErrored = ref(false);\n\nonMounted(async () => {\n\t// Only run when events don't fire (when the page is SSR)\n\tif (!imageErrored.value && !imageLoaded.value) {\n\t\tif (image.value) {\n\t\t\tawait wait(props.timeout);\n\t\t\timageErrored.value = !imageHasLoadedCorrectly(image.value);\n\t\t}\n\t}\n});\nconst onLoad = () => {\n\timageLoaded.value = true;\n};\nconst onError = () => {\n\timageErrored.value = true;\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbAvatar';\n</style>\n"],"names":["props","__props","sizeMap","attributes","computed","classes","dimension","style","isCssColor","imageHasLoadedCorrectly","img","image","ref","imageLoaded","imageErrored","onMounted","wait","onLoad","onError"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,UAAMA,IAAQC,GAQRC,IAAgB;AAAA,MACrB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGAC,IAAaC,EAAS,MAAM;AACjC,YAAMC,IAAmB;AAAA,QACxB,aAAa;AAAA,MAAA;AAEV,UAAAC;AACJ,MAAIN,EAAM,SACL,OAAOA,EAAM,QAAS,WACzBM,IAAYJ,EAAQF,EAAM,IAAkB,KAAK,SAASA,EAAM,MAAM,EAAE,IAExEM,IAAYN,EAAM,MAENM,KAAA;AAGd,UAAIC,IAAgC;AAAA,QACnC,OAAOD;AAAA,QACP,QAAQA;AAAA,MAAA;AAET,aAAIN,EAAM,UACLQ,EAAWR,EAAM,KAAK,IACzBO,EAAM,kBAAkBP,EAAM,QAE9BK,EAAQ,cAAcL,EAAM,KAAK,EAAE,IAAI,KAGlC;AAAA,QACN,OAAOK;AAAA,QACP,OAAAE;AAAA,MAAA;AAAA,IACD,CACA,GAEKE,IAA0B,CAACC,MAC5B,GAACA,KAID,CAACA,EAAI,YAOLA,EAAI,iBAAiB,IAQpBC,IAAQC,KACRC,IAAcD,EAAI,EAAK,GACvBE,IAAeF,EAAI,EAAK;AAE9B,IAAAG,EAAU,YAAY;AAErB,MAAI,CAACD,EAAa,SAAS,CAACD,EAAY,SACnCF,EAAM,UACH,MAAAK,EAAKhB,EAAM,OAAO,GACxBc,EAAa,QAAQ,CAACL,EAAwBE,EAAM,KAAK;AAAA,IAE3D,CACA;AACD,UAAMM,IAAS,MAAM;AACpB,MAAAJ,EAAY,QAAQ;AAAA,IAAA,GAEfK,IAAU,MAAM;AACrB,MAAAJ,EAAa,QAAQ;AAAA,IAAA;;;;;;;;;;;;;;;;;;"}
package/dist/index56.js CHANGED
@@ -1,63 +1,50 @@
1
- import { defineComponent as n, openBlock as a, createElementBlock as t, Fragment as b, renderList as m, createElementVNode as l, renderSlot as r, createVNode as p, mergeProps as u, withCtx as c, createTextVNode as f, toDisplayString as _ } from "vue";
2
- import h from "./index12.js";
3
- /* empty css */
4
- const B = {
5
- "aria-label": "Breadcrumbs",
6
- class: "bb-breadcrumbs"
7
- }, $ = { class: "bb-breadcrumbs__breadcrumb-container" }, k = {
8
- "aria-hidden": "true",
9
- class: "bb-breadcrumbs__divider"
10
- }, V = /* @__PURE__ */ n({
11
- __name: "BbBreadcrumbs",
1
+ import { defineComponent as p, useSlots as d, computed as n, openBlock as m, createElementBlock as u, normalizeClass as g, createElementVNode as s, renderSlot as l, mergeProps as f, createTextVNode as _, toDisplayString as y } from "vue";
2
+ import { isCssColor as r } from "./index219.js";
3
+ import { isNil as B } from "./index126.js";
4
+ const C = { class: "bb-badge__wrapper" }, h = { class: "bb-badge__content-inner" }, S = /* @__PURE__ */ p({
5
+ __name: "BbBadge",
12
6
  props: {
13
- disabled: { type: Boolean },
14
- items: {},
15
- divider: { default: "/" }
7
+ color: {},
8
+ bottom: { type: Boolean },
9
+ content: {},
10
+ floating: { type: Boolean },
11
+ left: { type: Boolean }
16
12
  },
17
- setup(i) {
18
- const o = i;
19
- return (e, v) => (a(), t("nav", B, [
20
- (a(!0), t(b, null, m(e.items, (s, d) => (a(), t(b, {
21
- key: s.key
22
- }, [
23
- l("span", $, [
24
- r(e.$slots, "item:prepend", {
25
- disabled: !!(s.disabled || e.disabled),
26
- index: d,
27
- item: e.items[d],
28
- text: s.text
29
- }),
30
- p(h, u({ ref_for: !0 }, s, {
31
- class: "bb-breadcrumbs__breadcrumb",
32
- disabled: s.disabled || e.disabled
33
- }), {
34
- default: c(() => [
35
- r(e.$slots, `${s.key}`, {
36
- disabled: !!(s.disabled || e.disabled),
37
- index: d,
38
- item: e.items[d],
39
- text: s.text
40
- })
41
- ]),
42
- _: 2
43
- }, 1040, ["disabled"]),
44
- r(e.$slots, "item:append", {
45
- disabled: !!(s.disabled || e.disabled),
46
- index: d,
47
- item: e.items[d],
48
- text: s.text
49
- })
50
- ]),
51
- l("span", k, [
52
- r(e.$slots, "divider", {}, () => [
53
- f(_(o.divider), 1)
13
+ setup(b) {
14
+ const a = d(), e = b, c = n(() => ({
15
+ "bb-badge": !0,
16
+ "bb-badge--bottom": e.bottom,
17
+ "bb-badge--left": e.left,
18
+ "bb-badge--positioned": a.default,
19
+ "bb-badge--floating": e.floating,
20
+ "bb-badge--empty": B(e.content),
21
+ [`bb-badge--${e.color}`]: e.color && !r(e.color)
22
+ })), i = n(() => {
23
+ let t = {};
24
+ e.color && r(e.color) && (t.backgroundColor = e.color);
25
+ let o = {};
26
+ return a.wrap && (o["aria-atomic"] = !0, o["aria-live"] = "polite", o.role = "status"), {
27
+ style: t,
28
+ ...o
29
+ };
30
+ });
31
+ return (t, o) => (m(), u("span", {
32
+ class: g(c.value)
33
+ }, [
34
+ s("span", C, [
35
+ l(t.$slots, "default"),
36
+ s("span", f({ class: "bb-badge__content-container" }, i.value), [
37
+ s("span", h, [
38
+ l(t.$slots, "content", {}, () => [
39
+ _(y(t.content), 1)
40
+ ])
54
41
  ])
55
- ])
56
- ], 64))), 128))
57
- ]));
42
+ ], 16)
43
+ ])
44
+ ], 2));
58
45
  }
59
46
  });
60
47
  export {
61
- V as default
48
+ S as default
62
49
  };
63
50
  //# sourceMappingURL=index56.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index56.js","sources":["../src/components/BbBreadcrumbs/BbBreadcrumbs.vue"],"sourcesContent":["<template>\n\t<nav aria-label=\"Breadcrumbs\" class=\"bb-breadcrumbs\">\n\t\t<template v-for=\"(item, index) in items\" :key=\"item.key\">\n\t\t\t<span class=\"bb-breadcrumbs__breadcrumb-container\">\n\t\t\t\t<slot\n\t\t\t\t\t:disabled=\"!!(item.disabled || disabled)\"\n\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t:item=\"items[index]\"\n\t\t\t\t\t:name=\"`item:prepend`\"\n\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t></slot>\n\t\t\t\t<BaseButton\n\t\t\t\t\tv-bind=\"item\"\n\t\t\t\t\tclass=\"bb-breadcrumbs__breadcrumb\"\n\t\t\t\t\t:disabled=\"item.disabled || disabled\"\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:disabled=\"!!(item.disabled || disabled)\"\n\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t:item=\"items[index]\"\n\t\t\t\t\t\t:name=\"`${item.key}`\"\n\t\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t\t></slot>\n\t\t\t\t</BaseButton>\n\t\t\t\t<slot\n\t\t\t\t\t:disabled=\"!!(item.disabled || disabled)\"\n\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t:item=\"items[index]\"\n\t\t\t\t\t:name=\"`item:append`\"\n\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t></slot>\n\t\t\t</span>\n\t\t\t<span aria-hidden=\"true\" class=\"bb-breadcrumbs__divider\"\n\t\t\t\t><slot name=\"divider\">{{ props.divider }}</slot></span\n\t\t\t>\n\t\t</template>\n\t</nav>\n</template>\n\n<script setup lang=\"ts\">\nimport type { CommonProps } from '@/types/CommonProps';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport type { BaseButtonProps } from '../BaseButton/BaseButton.vue';\n\nexport type Item = Omit<BaseButtonProps, 'block' | 'tag' | 'type'> & {\n\t/**\n\t * Click handler of the button\n\t */\n\tonClick?: (...args: any[]) => any;\n\t/**\n\t * Key that uniquely identifies the breadcrumb\n\t */\n\tkey: string | number;\n};\n\nexport type BbBreadcrumbsProps = Pick<CommonProps, 'disabled'> & {\n\t/**\n\t * Array of items that describe how the breadcrumbs\n\t * should behave. It is compatible with navigating\n\t * through `a` or `router-link`.\n\t */\n\titems: Item[];\n\t/**\n\t * Text content of the divider\n\t */\n\tdivider?: string;\n};\n\nconst props = withDefaults(defineProps<BbBreadcrumbsProps>(), {\n\tdivider: '/',\n});\n\ndefineSlots<\n\t{\n\t\t'item:prepend'?: (props: {\n\t\t\tdisabled: boolean;\n\t\t\tindex: number;\n\t\t\titem: Item;\n\t\t\ttext?: string;\n\t\t}) => any;\n\t\t'item:append'?: (props: {\n\t\t\tdisabled: boolean;\n\t\t\tindex: number;\n\t\t\titem: Item;\n\t\t\ttext?: string;\n\t\t}) => any;\n\t\tdivider?: (props: object) => any;\n\t} & {\n\t\t[key: string]: (props: {\n\t\t\tdisabled: boolean;\n\t\t\tindex: number;\n\t\t\titem: Item;\n\t\t\ttext?: string;\n\t\t}) => any;\n\t}\n>();\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbBreadcrumbs';\n</style>\n"],"names":["props","__props"],"mappings":";;;;;;;;;;;;;;;;;AAoEA,UAAMA,IAAQC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index56.js","sources":["../src/components/BbBadge/BbBadge.vue"],"sourcesContent":["<template>\n\t<span :class=\"classes\">\n\t\t<span class=\"bb-badge__wrapper\">\n\t\t\t<slot></slot>\n\t\t\t<span class=\"bb-badge__content-container\" v-bind=\"contentAttributes\">\n\t\t\t\t<span class=\"bb-badge__content-inner\"\n\t\t\t\t\t><slot name=\"content\">{{ content }}</slot></span\n\t\t\t\t>\n\t\t\t</span>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport { isNil } from '@/utilities/functions/isNil';\nimport type { CommonProps } from '@/types/CommonProps';\n\nconst slots = useSlots();\n\nexport type BbBadgeProps = Pick<CommonProps, 'color'> & {\n\t/**\n\t * Displays the badge on the bottom of the wrapped component.\n\t */\n\tbottom?: boolean;\n\t/**\n\t * Text content of the badge\n\t */\n\tcontent?: string | number | null;\n\t/**\n\t * Renders the badge i little further from the wrapped\n\t * component making it look like it's floating\n\t * and not stacked.\n\t */\n\tfloating?: boolean;\n\t/**\n\t * Displays the badge on the left of the wrapped component.\n\t */\n\tleft?: boolean;\n};\n\nconst props = withDefaults(defineProps<BbBadgeProps>(), {});\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n\tcontent?: (props: object) => any;\n}>();\n\nconst classes = computed(() => {\n\treturn {\n\t\t'bb-badge': true,\n\t\t'bb-badge--bottom': props.bottom,\n\t\t'bb-badge--left': props.left,\n\t\t'bb-badge--positioned': slots.default,\n\t\t'bb-badge--floating': props.floating,\n\t\t'bb-badge--empty': isNil(props.content),\n\t\t[`bb-badge--${props.color}`]: props.color && !isCssColor(props.color),\n\t};\n});\n\nconst contentAttributes = computed(() => {\n\tlet style: Record<string, string> = {};\n\tif (props.color && isCssColor(props.color)) {\n\t\tstyle.backgroundColor = props.color;\n\t}\n\n\tlet accessibilityAttributes: Record<string, string | boolean> = {};\n\tif (slots.wrap) {\n\t\taccessibilityAttributes['aria-atomic'] = true;\n\t\taccessibilityAttributes['aria-live'] = 'polite';\n\t\taccessibilityAttributes['role'] = 'status';\n\t}\n\treturn {\n\t\tstyle,\n\t\t...accessibilityAttributes,\n\t};\n});\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BbBadge';\n</style>\n"],"names":["slots","useSlots","props","__props","classes","computed","isNil","isCssColor","contentAttributes","style","accessibilityAttributes"],"mappings":";;;;;;;;;;;;;AAmBA,UAAMA,IAAQC,KAuBRC,IAAQC,GAORC,IAAUC,EAAS,OACjB;AAAA,MACN,YAAY;AAAA,MACZ,oBAAoBH,EAAM;AAAA,MAC1B,kBAAkBA,EAAM;AAAA,MACxB,wBAAwBF,EAAM;AAAA,MAC9B,sBAAsBE,EAAM;AAAA,MAC5B,mBAAmBI,EAAMJ,EAAM,OAAO;AAAA,MACtC,CAAC,aAAaA,EAAM,KAAK,EAAE,GAAGA,EAAM,SAAS,CAACK,EAAWL,EAAM,KAAK;AAAA,IAAA,EAErE,GAEKM,IAAoBH,EAAS,MAAM;AACxC,UAAII,IAAgC,CAAA;AACpC,MAAIP,EAAM,SAASK,EAAWL,EAAM,KAAK,MACxCO,EAAM,kBAAkBP,EAAM;AAG/B,UAAIQ,IAA4D,CAAA;AAChE,aAAIV,EAAM,SACTU,EAAwB,aAAa,IAAI,IACzCA,EAAwB,WAAW,IAAI,UACvCA,EAAwB,OAAU,WAE5B;AAAA,QACN,OAAAD;AAAA,QACA,GAAGC;AAAA,MAAA;AAAA,IACJ,CACA;;;;;;;;;;;;;;;;;"}