@shibui-ui/ui 1.24.1 → 1.25.1

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 (460) hide show
  1. package/dist/components/atoms/index.d.ts +45 -16
  2. package/dist/components/atoms/index.d.ts.map +1 -1
  3. package/dist/components/molecules/index.d.ts +20 -1
  4. package/dist/components/molecules/index.d.ts.map +1 -1
  5. package/dist/components/organisms/index.d.ts +17 -1
  6. package/dist/components/organisms/index.d.ts.map +1 -1
  7. package/dist/index.d.ts +3 -82
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +79 -80
  10. package/dist/index.js.map +1 -1
  11. package/dist/index10.js +82 -18
  12. package/dist/index10.js.map +1 -1
  13. package/dist/index11.js +84 -69
  14. package/dist/index11.js.map +1 -1
  15. package/dist/index12.js +40 -26
  16. package/dist/index12.js.map +1 -1
  17. package/dist/index13.js +16 -39
  18. package/dist/index13.js.map +1 -1
  19. package/dist/index14.js +29 -44
  20. package/dist/index14.js.map +1 -1
  21. package/dist/index15.js +16 -117
  22. package/dist/index15.js.map +1 -1
  23. package/dist/index16.js +48 -40
  24. package/dist/index16.js.map +1 -1
  25. package/dist/index17.js +41 -25
  26. package/dist/index17.js.map +1 -1
  27. package/dist/index18.js +76 -49
  28. package/dist/index18.js.map +1 -1
  29. package/dist/index19.js +19 -39
  30. package/dist/index19.js.map +1 -1
  31. package/dist/index194.js +94 -24
  32. package/dist/index194.js.map +1 -1
  33. package/dist/index195.js +2 -2
  34. package/dist/index197.js +2 -24
  35. package/dist/index197.js.map +1 -1
  36. package/dist/index198.js +74 -2
  37. package/dist/index198.js.map +1 -1
  38. package/dist/index199.js +64 -35
  39. package/dist/index199.js.map +1 -1
  40. package/dist/index20.js +21 -41
  41. package/dist/index20.js.map +1 -1
  42. package/dist/index200.js +2 -2
  43. package/dist/index201.js +54 -13
  44. package/dist/index201.js.map +1 -1
  45. package/dist/index202.js +2 -2
  46. package/dist/index203.js +2 -2
  47. package/dist/index204.js +143 -157
  48. package/dist/index204.js.map +1 -1
  49. package/dist/index205.js +43 -24
  50. package/dist/index205.js.map +1 -1
  51. package/dist/index206.js +51 -2
  52. package/dist/index206.js.map +1 -1
  53. package/dist/index207.js +2 -11
  54. package/dist/index207.js.map +1 -1
  55. package/dist/index208.js +33 -2
  56. package/dist/index208.js.map +1 -1
  57. package/dist/index209.js +2 -91
  58. package/dist/index209.js.map +1 -1
  59. package/dist/index21.js +90 -26
  60. package/dist/index21.js.map +1 -1
  61. package/dist/index210.js +6 -2
  62. package/dist/index210.js.map +1 -1
  63. package/dist/index211.js +2 -41
  64. package/dist/index211.js.map +1 -1
  65. package/dist/index212.js +260 -2
  66. package/dist/index212.js.map +1 -1
  67. package/dist/index213.js +16 -5
  68. package/dist/index213.js.map +1 -1
  69. package/dist/index214.js +2 -2
  70. package/dist/index215.js +2 -35
  71. package/dist/index215.js.map +1 -1
  72. package/dist/index216.js +59 -42
  73. package/dist/index216.js.map +1 -1
  74. package/dist/index217.js +32 -2
  75. package/dist/index217.js.map +1 -1
  76. package/dist/index218.js +2 -85
  77. package/dist/index218.js.map +1 -1
  78. package/dist/index219.js +2 -2
  79. package/dist/index22.js +41 -48
  80. package/dist/index22.js.map +1 -1
  81. package/dist/index220.js +73 -65
  82. package/dist/index220.js.map +1 -1
  83. package/dist/index221.js +81 -2
  84. package/dist/index221.js.map +1 -1
  85. package/dist/index222.js +2 -10
  86. package/dist/index222.js.map +1 -1
  87. package/dist/index223.js +133 -2
  88. package/dist/index223.js.map +1 -1
  89. package/dist/index224.js +2 -26
  90. package/dist/index224.js.map +1 -1
  91. package/dist/index225.js +2 -2
  92. package/dist/index226.js +66 -12
  93. package/dist/index226.js.map +1 -1
  94. package/dist/index227.js +97 -2
  95. package/dist/index227.js.map +1 -1
  96. package/dist/index228.js +2 -2
  97. package/dist/index229.js +62 -24
  98. package/dist/index229.js.map +1 -1
  99. package/dist/index23.js +50 -94
  100. package/dist/index23.js.map +1 -1
  101. package/dist/index230.js +2 -2
  102. package/dist/index231.js +2 -2
  103. package/dist/index232.js +12 -2
  104. package/dist/index232.js.map +1 -1
  105. package/dist/index233.js +5 -16
  106. package/dist/index233.js.map +1 -1
  107. package/dist/index234.js +2 -2
  108. package/dist/index235.js +11 -9
  109. package/dist/index235.js.map +1 -1
  110. package/dist/index236.js +2 -2
  111. package/dist/index237.js +76 -34
  112. package/dist/index237.js.map +1 -1
  113. package/dist/index238.js +2 -2
  114. package/dist/index239.js +2 -27
  115. package/dist/index239.js.map +1 -1
  116. package/dist/index24.js +37 -34
  117. package/dist/index24.js.map +1 -1
  118. package/dist/index240.js +39 -2
  119. package/dist/index240.js.map +1 -1
  120. package/dist/index241.js +2 -34
  121. package/dist/index241.js.map +1 -1
  122. package/dist/index242.js +235 -12
  123. package/dist/index242.js.map +1 -1
  124. package/dist/index243.js +82 -2
  125. package/dist/index243.js.map +1 -1
  126. package/dist/index244.js +2 -9
  127. package/dist/index244.js.map +1 -1
  128. package/dist/index245.js +94 -2
  129. package/dist/index245.js.map +1 -1
  130. package/dist/index246.js +2 -5
  131. package/dist/index246.js.map +1 -1
  132. package/dist/index247.js +268 -2
  133. package/dist/index247.js.map +1 -1
  134. package/dist/index248.js +2 -36
  135. package/dist/index248.js.map +1 -1
  136. package/dist/index249.js +21 -2
  137. package/dist/index249.js.map +1 -1
  138. package/dist/index25.js +51 -32
  139. package/dist/index25.js.map +1 -1
  140. package/dist/index250.js +2 -31
  141. package/dist/index250.js.map +1 -1
  142. package/dist/index251.js +9 -2
  143. package/dist/index251.js.map +1 -1
  144. package/dist/index252.js +2 -19
  145. package/dist/index252.js.map +1 -1
  146. package/dist/index253.js +15 -2
  147. package/dist/index253.js.map +1 -1
  148. package/dist/index254.js +2 -2
  149. package/dist/index255.js +135 -69
  150. package/dist/index255.js.map +1 -1
  151. package/dist/index256.js +2 -11
  152. package/dist/index256.js.map +1 -1
  153. package/dist/index257.js +5 -2
  154. package/dist/index257.js.map +1 -1
  155. package/dist/index258.js +2 -78
  156. package/dist/index258.js.map +1 -1
  157. package/dist/index259.js +9 -2
  158. package/dist/index259.js.map +1 -1
  159. package/dist/index26.js +31 -236
  160. package/dist/index26.js.map +1 -1
  161. package/dist/index260.js +2 -32
  162. package/dist/index260.js.map +1 -1
  163. package/dist/index261.js +2 -2
  164. package/dist/index262.js +92 -9
  165. package/dist/index262.js.map +1 -1
  166. package/dist/index263.js +59 -2
  167. package/dist/index263.js.map +1 -1
  168. package/dist/index264.js +2 -16
  169. package/dist/index264.js.map +1 -1
  170. package/dist/index265.js +41 -2
  171. package/dist/index265.js.map +1 -1
  172. package/dist/index266.js +2 -16
  173. package/dist/index266.js.map +1 -1
  174. package/dist/index267.js +34 -9
  175. package/dist/index267.js.map +1 -1
  176. package/dist/index268.js +8 -54
  177. package/dist/index268.js.map +1 -1
  178. package/dist/index269.js +2 -2
  179. package/dist/index27.js +27 -58
  180. package/dist/index27.js.map +1 -1
  181. package/dist/index270.js +42 -7
  182. package/dist/index270.js.map +1 -1
  183. package/dist/index271.js +2 -2
  184. package/dist/index272.js +2 -34
  185. package/dist/index272.js.map +1 -1
  186. package/dist/index273.js +16 -2
  187. package/dist/index273.js.map +1 -1
  188. package/dist/index274.js +9 -2
  189. package/dist/index274.js.map +1 -1
  190. package/dist/index275.js +6 -13
  191. package/dist/index275.js.map +1 -1
  192. package/dist/index276.js +2 -2
  193. package/dist/index277.js +8 -15
  194. package/dist/index277.js.map +1 -1
  195. package/dist/index278.js +2 -2
  196. package/dist/index279.js +55 -2
  197. package/dist/index279.js.map +1 -1
  198. package/dist/index28.js +247 -24
  199. package/dist/index28.js.map +1 -1
  200. package/dist/index280.js +2 -42
  201. package/dist/index280.js.map +1 -1
  202. package/dist/index281.js +2 -100
  203. package/dist/index281.js.map +1 -1
  204. package/dist/index282.js +20 -2
  205. package/dist/index282.js.map +1 -1
  206. package/dist/index283.js +2 -97
  207. package/dist/index283.js.map +1 -1
  208. package/dist/index284.js +33 -2
  209. package/dist/index284.js.map +1 -1
  210. package/dist/index285.js +6 -27
  211. package/dist/index285.js.map +1 -1
  212. package/dist/index286.js +2 -2
  213. package/dist/index287.js +9 -44
  214. package/dist/index287.js.map +1 -1
  215. package/dist/index288.js +2 -2
  216. package/dist/index289.js +2 -33
  217. package/dist/index289.js.map +1 -1
  218. package/dist/index29.js +249 -39
  219. package/dist/index29.js.map +1 -1
  220. package/dist/index290.js +36 -2
  221. package/dist/index290.js.map +1 -1
  222. package/dist/index291.js +2 -57
  223. package/dist/index291.js.map +1 -1
  224. package/dist/index292.js +24 -2
  225. package/dist/index292.js.map +1 -1
  226. package/dist/index293.js +2 -2
  227. package/dist/index294.js +26 -247
  228. package/dist/index294.js.map +1 -1
  229. package/dist/index295.js +2 -2
  230. package/dist/index296.js +2 -72
  231. package/dist/index296.js.map +1 -1
  232. package/dist/index297.js +42 -2
  233. package/dist/index297.js.map +1 -1
  234. package/dist/index298.js +7 -56
  235. package/dist/index298.js.map +1 -1
  236. package/dist/index299.js +2 -133
  237. package/dist/index299.js.map +1 -1
  238. package/dist/index30.js +32 -19
  239. package/dist/index30.js.map +1 -1
  240. package/dist/index300.js +30 -2
  241. package/dist/index300.js.map +1 -1
  242. package/dist/index301.js +2 -12
  243. package/dist/index301.js.map +1 -1
  244. package/dist/index302.js +34 -2
  245. package/dist/index302.js.map +1 -1
  246. package/dist/index303.js +2 -162
  247. package/dist/index303.js.map +1 -1
  248. package/dist/index304.js +26 -42
  249. package/dist/index304.js.map +1 -1
  250. package/dist/index305.js +2 -81
  251. package/dist/index305.js.map +1 -1
  252. package/dist/index306.js +10 -2
  253. package/dist/index306.js.map +1 -1
  254. package/dist/index307.js +2 -71
  255. package/dist/index307.js.map +1 -1
  256. package/dist/index308.js +2 -2
  257. package/dist/index309.js +19 -2
  258. package/dist/index309.js.map +1 -1
  259. package/dist/index31.js +96 -11
  260. package/dist/index31.js.map +1 -1
  261. package/dist/index310.js +2 -81
  262. package/dist/index310.js.map +1 -1
  263. package/dist/index311.js +2 -2
  264. package/dist/index312.js +42 -2
  265. package/dist/index312.js.map +1 -1
  266. package/dist/index313.js +2 -74
  267. package/dist/index313.js.map +1 -1
  268. package/dist/index314.js +25 -67
  269. package/dist/index314.js.map +1 -1
  270. package/dist/index315.js +2 -2
  271. package/dist/index316.js +9 -17
  272. package/dist/index316.js.map +1 -1
  273. package/dist/index317.js +2 -2
  274. package/dist/index318.js +84 -32
  275. package/dist/index318.js.map +1 -1
  276. package/dist/index319.js +2 -2
  277. package/dist/index32.js +40 -48
  278. package/dist/index32.js.map +1 -1
  279. package/dist/index320.js +68 -77
  280. package/dist/index320.js.map +1 -1
  281. package/dist/index321.js +2 -2
  282. package/dist/index322.js +12 -148
  283. package/dist/index322.js.map +1 -1
  284. package/dist/index323.js +1 -1
  285. package/dist/index324.js +28 -6
  286. package/dist/index324.js.map +1 -1
  287. package/dist/index325.js +2 -2
  288. package/dist/index326.js +78 -87
  289. package/dist/index326.js.map +1 -1
  290. package/dist/index327.js +2 -2
  291. package/dist/index328.js +78 -2
  292. package/dist/index328.js.map +1 -1
  293. package/dist/index329.js +2 -237
  294. package/dist/index329.js.map +1 -1
  295. package/dist/index33.js +20 -56
  296. package/dist/index33.js.map +1 -1
  297. package/dist/index330.js +11 -6
  298. package/dist/index330.js.map +1 -1
  299. package/dist/index331.js +2 -2
  300. package/dist/index332.js +18 -59
  301. package/dist/index332.js.map +1 -1
  302. package/dist/index333.js +2 -2
  303. package/dist/index334.js +12 -5
  304. package/dist/index334.js.map +1 -1
  305. package/dist/index335.js +2 -2
  306. package/dist/index336.js +2 -15
  307. package/dist/index336.js.map +1 -1
  308. package/dist/index337.js +88 -2
  309. package/dist/index337.js.map +1 -1
  310. package/dist/index338.js +24 -2
  311. package/dist/index338.js.map +1 -1
  312. package/dist/index339.js +2 -92
  313. package/dist/index339.js.map +1 -1
  314. package/dist/index34.js +59 -35
  315. package/dist/index34.js.map +1 -1
  316. package/dist/index340.js +42 -14
  317. package/dist/index340.js.map +1 -1
  318. package/dist/index341.js +2 -2
  319. package/dist/index342.js +22 -80
  320. package/dist/index342.js.map +1 -1
  321. package/dist/index343.js +2 -2
  322. package/dist/index344.js +2 -18
  323. package/dist/index344.js.map +1 -1
  324. package/dist/index345.js +16 -2
  325. package/dist/index345.js.map +1 -1
  326. package/dist/index346.js +2 -268
  327. package/dist/index346.js.map +1 -1
  328. package/dist/index347.js +176 -2
  329. package/dist/index347.js.map +1 -1
  330. package/dist/index348.js +2 -2
  331. package/dist/index349.js +35 -39
  332. package/dist/index349.js.map +1 -1
  333. package/dist/index35.js +101 -28
  334. package/dist/index35.js.map +1 -1
  335. package/dist/index350.js +3 -3
  336. package/dist/index350.js.map +1 -1
  337. package/dist/index351.js +2 -2
  338. package/dist/index352.js +19 -26
  339. package/dist/index352.js.map +1 -1
  340. package/dist/index357.js +26 -19
  341. package/dist/index357.js.map +1 -1
  342. package/dist/index36.js +115 -33
  343. package/dist/index36.js.map +1 -1
  344. package/dist/index37.js +41 -115
  345. package/dist/index37.js.map +1 -1
  346. package/dist/index38.js +34 -246
  347. package/dist/index38.js.map +1 -1
  348. package/dist/index39.js +30 -137
  349. package/dist/index39.js.map +1 -1
  350. package/dist/index4.js +26 -84
  351. package/dist/index4.js.map +1 -1
  352. package/dist/index40.js +26 -400
  353. package/dist/index40.js.map +1 -1
  354. package/dist/index41.js +28 -77
  355. package/dist/index41.js.map +1 -1
  356. package/dist/index42.js +23 -26
  357. package/dist/index42.js.map +1 -1
  358. package/dist/index43.js +36 -33
  359. package/dist/index43.js.map +1 -1
  360. package/dist/index44.js +62 -16
  361. package/dist/index44.js.map +1 -1
  362. package/dist/index45.js +138 -21
  363. package/dist/index45.js.map +1 -1
  364. package/dist/index46.js +129 -22
  365. package/dist/index46.js.map +1 -1
  366. package/dist/index47.js +41 -19
  367. package/dist/index47.js.map +1 -1
  368. package/dist/index48.js +11 -82
  369. package/dist/index48.js.map +1 -1
  370. package/dist/index49.js +56 -279
  371. package/dist/index49.js.map +1 -1
  372. package/dist/index5.js +21 -34
  373. package/dist/index5.js.map +1 -1
  374. package/dist/index50.js +280 -33
  375. package/dist/index50.js.map +1 -1
  376. package/dist/index51.js +74 -94
  377. package/dist/index51.js.map +1 -1
  378. package/dist/index52.js +66 -41
  379. package/dist/index52.js.map +1 -1
  380. package/dist/index53.js +333 -62
  381. package/dist/index53.js.map +1 -1
  382. package/dist/index54.js +96 -256
  383. package/dist/index54.js.map +1 -1
  384. package/dist/index55.js +38 -130
  385. package/dist/index55.js.map +1 -1
  386. package/dist/index56.js +251 -50
  387. package/dist/index56.js.map +1 -1
  388. package/dist/index57.js +144 -115
  389. package/dist/index57.js.map +1 -1
  390. package/dist/index58.js +93 -183
  391. package/dist/index58.js.map +1 -1
  392. package/dist/index59.js +33 -339
  393. package/dist/index59.js.map +1 -1
  394. package/dist/index6.js +2 -2
  395. package/dist/index60.js +102 -66
  396. package/dist/index60.js.map +1 -1
  397. package/dist/index61.js +73 -179
  398. package/dist/index61.js.map +1 -1
  399. package/dist/index62.js +117 -97
  400. package/dist/index62.js.map +1 -1
  401. package/dist/index63.js +113 -263
  402. package/dist/index63.js.map +1 -1
  403. package/dist/index64.js +258 -251
  404. package/dist/index64.js.map +1 -1
  405. package/dist/index65.js +177 -79
  406. package/dist/index65.js.map +1 -1
  407. package/dist/index66.js +261 -140
  408. package/dist/index66.js.map +1 -1
  409. package/dist/index67.js +183 -100
  410. package/dist/index67.js.map +1 -1
  411. package/dist/index68.js +28 -89
  412. package/dist/index68.js.map +1 -1
  413. package/dist/index69.js +20 -161
  414. package/dist/index69.js.map +1 -1
  415. package/dist/index7.js +394 -32
  416. package/dist/index7.js.map +1 -1
  417. package/dist/index70.js +190 -53
  418. package/dist/index70.js.map +1 -1
  419. package/dist/index71.js +204 -112
  420. package/dist/index71.js.map +1 -1
  421. package/dist/index72.js +2 -2
  422. package/dist/index73.js +89 -28
  423. package/dist/index73.js.map +1 -1
  424. package/dist/index74.js +126 -63
  425. package/dist/index74.js.map +1 -1
  426. package/dist/index75.js +122 -111
  427. package/dist/index75.js.map +1 -1
  428. package/dist/index76.js +67 -64
  429. package/dist/index76.js.map +1 -1
  430. package/dist/index77.js +112 -88
  431. package/dist/index77.js.map +1 -1
  432. package/dist/index78.js +87 -16
  433. package/dist/index78.js.map +1 -1
  434. package/dist/index79.js +151 -79
  435. package/dist/index79.js.map +1 -1
  436. package/dist/index8.js +25 -127
  437. package/dist/index8.js.map +1 -1
  438. package/dist/index80.js +104 -186
  439. package/dist/index80.js.map +1 -1
  440. package/dist/index81.js +59 -20
  441. package/dist/index81.js.map +1 -1
  442. package/dist/index82.js +17 -129
  443. package/dist/index82.js.map +1 -1
  444. package/dist/index83.js +88 -217
  445. package/dist/index83.js.map +1 -1
  446. package/dist/index84.js +64 -112
  447. package/dist/index84.js.map +1 -1
  448. package/dist/index9.js +30 -45
  449. package/dist/index9.js.map +1 -1
  450. package/dist/src/components/atoms/index.d.ts +45 -16
  451. package/dist/src/components/atoms/index.d.ts.map +1 -1
  452. package/dist/src/components/molecules/index.d.ts +20 -1
  453. package/dist/src/components/molecules/index.d.ts.map +1 -1
  454. package/dist/src/components/organisms/index.d.ts +17 -1
  455. package/dist/src/components/organisms/index.d.ts.map +1 -1
  456. package/dist/src/index.d.ts +3 -82
  457. package/dist/src/index.d.ts.map +1 -1
  458. package/dist/tokens.css +353 -7
  459. package/dist/vite.config.d.ts.map +1 -1
  460. package/package.json +4 -4
package/dist/index28.js CHANGED
@@ -1,6 +1,8 @@
1
- import { css, LitElement, html } from "lit";
2
- import { property, customElement } from "lit/decorators.js";
3
- import { styleMap as o } from "./index241.js";
1
+ import { unsafeCSS, css, LitElement } from "lit";
2
+ import { property, query, customElement } from "lit/decorators.js";
3
+ import { counterTemplate } from "./index312.js";
4
+ import counterCss from "./index313.js";
5
+ import sharedTokens from "./index196.js";
4
6
  var __defProp = Object.defineProperty;
5
7
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
8
  var __decorateClass = (decorators, target, key, kind) => {
@@ -11,38 +13,259 @@ var __decorateClass = (decorators, target, key, kind) => {
11
13
  if (kind && result) __defProp(target, key, result);
12
14
  return result;
13
15
  };
14
- let LibSpacer = class extends LitElement {
16
+ let LibCounter = class extends LitElement {
15
17
  constructor() {
16
18
  super(...arguments);
19
+ this.value = 0;
20
+ this.prefix = "";
21
+ this.suffix = "";
22
+ this.thousands = ".";
23
+ this.decimals = null;
17
24
  this.size = "md";
18
- this.horizontal = false;
25
+ this.tone = "default";
26
+ this.label = "";
27
+ this.delta = "";
28
+ this.deltaDir = "up";
29
+ this.playOnVisible = false;
30
+ this._builtDigitCount = -1;
31
+ this._builtThousands = "";
32
+ this._hasAnimated = false;
33
+ this._firstUpdate = true;
34
+ }
35
+ /* ── Lifecycle ──────────────────────────────────────────── */
36
+ connectedCallback() {
37
+ super.connectedCallback();
38
+ if (this.playOnVisible) {
39
+ this._observer = new IntersectionObserver(
40
+ (entries) => {
41
+ var _a, _b;
42
+ if (((_a = entries[0]) == null ? void 0 : _a.isIntersecting) && !this._hasAnimated) {
43
+ this._hasAnimated = true;
44
+ this._animateTo(
45
+ this.value,
46
+ /* fromZero */
47
+ true
48
+ );
49
+ (_b = this._observer) == null ? void 0 : _b.disconnect();
50
+ }
51
+ },
52
+ { threshold: 0.2 }
53
+ );
54
+ }
55
+ }
56
+ disconnectedCallback() {
57
+ var _a;
58
+ super.disconnectedCallback();
59
+ (_a = this._observer) == null ? void 0 : _a.disconnect();
19
60
  }
20
61
  render() {
21
- const spaceValue = `var(--lib-space-${this.size}, 16px)`;
22
- const styles = this.horizontal ? { width: spaceValue, height: "100%" } : { height: spaceValue, width: "100%" };
23
- return html`<div style=${o(styles)}></div>`;
62
+ return counterTemplate({
63
+ size: this.size,
64
+ tone: this.tone,
65
+ label: this.label,
66
+ delta: this.delta,
67
+ deltaDir: this.deltaDir
68
+ });
24
69
  }
25
- };
26
- LibSpacer.styles = css`
27
- :host {
28
- display: block;
29
- flex-shrink: 0;
30
- flex-grow: 0;
70
+ updated(changed) {
71
+ var _a;
72
+ super.updated(changed);
73
+ const structureChanged = changed.has("value") || changed.has("prefix") || changed.has("suffix") || changed.has("thousands") || changed.has("decimals");
74
+ if (!structureChanged && !this._firstUpdate) return;
75
+ const needRebuild = this._needsRebuild();
76
+ if (needRebuild) {
77
+ this._buildRow();
78
+ }
79
+ if (this._firstUpdate) {
80
+ this._firstUpdate = false;
81
+ if (this.playOnVisible) {
82
+ this._setRowInstant(0);
83
+ (_a = this._observer) == null ? void 0 : _a.observe(this);
84
+ } else {
85
+ this._setRowInstant(this.value);
86
+ }
87
+ return;
88
+ }
89
+ if (changed.has("value")) {
90
+ this._animateTo(
91
+ this.value,
92
+ /* fromZero */
93
+ false
94
+ );
95
+ }
96
+ }
97
+ /* ── Motor de digit-flip ────────────────────────────────── */
98
+ _needsRebuild() {
99
+ const digitCount = Math.abs(Math.floor(this.value)).toString().length;
100
+ if (digitCount !== this._builtDigitCount) return true;
101
+ if (this.thousands !== this._builtThousands) return true;
102
+ return false;
103
+ }
104
+ _buildRow() {
105
+ const row = this._rowEl;
106
+ if (!row) return;
107
+ row.innerHTML = "";
108
+ const absVal = Math.abs(Math.floor(this.value));
109
+ const str = absVal.toString();
110
+ this._builtDigitCount = str.length;
111
+ this._builtThousands = this.thousands;
112
+ if (this.prefix) {
113
+ const p = document.createElement("span");
114
+ p.className = "cnt-prefix";
115
+ p.textContent = this.prefix;
116
+ row.appendChild(p);
31
117
  }
32
- :host([horizontal]) {
33
- display: inline-block;
118
+ const chars = this._buildCharArray(str, this.thousands);
119
+ chars.forEach((c) => {
120
+ if (c.type === "sep") {
121
+ const sep = document.createElement("span");
122
+ sep.className = "cnt-sep";
123
+ sep.textContent = c.char;
124
+ row.appendChild(sep);
125
+ } else {
126
+ row.appendChild(this._makeDigitSlot(parseInt(c.char, 10)));
127
+ }
128
+ });
129
+ if (this.decimals !== null) {
130
+ const dot = document.createElement("span");
131
+ dot.className = "cnt-sep";
132
+ dot.textContent = ",";
133
+ row.appendChild(dot);
134
+ const decStr = this.decimals.toString().padStart(2, "0");
135
+ for (const ch of decStr) {
136
+ row.appendChild(this._makeDigitSlot(parseInt(ch, 10)));
137
+ }
34
138
  }
35
- `;
139
+ if (this.suffix) {
140
+ const s = document.createElement("span");
141
+ s.className = "cnt-suffix";
142
+ s.textContent = this.suffix;
143
+ row.appendChild(s);
144
+ }
145
+ }
146
+ _buildCharArray(str, thousands) {
147
+ const result = [];
148
+ for (let i = 0; i < str.length; i++) {
149
+ const posFromRight = str.length - 1 - i;
150
+ if (i > 0 && posFromRight % 3 === 2 && thousands) {
151
+ result.push({ type: "sep", char: thousands });
152
+ }
153
+ result.push({ type: "digit", char: str[i] ?? "0" });
154
+ }
155
+ return result;
156
+ }
157
+ _makeDigitSlot(digit) {
158
+ const slot = document.createElement("span");
159
+ slot.className = "cnt-digit";
160
+ const inner = document.createElement("span");
161
+ inner.className = "cnt-digit-inner";
162
+ for (let i = 0; i <= 9; i++) {
163
+ const span = document.createElement("span");
164
+ span.textContent = String(i);
165
+ inner.appendChild(span);
166
+ }
167
+ inner.style.transition = "none";
168
+ inner.style.transform = `translateY(-${digit}em)`;
169
+ slot.appendChild(inner);
170
+ return slot;
171
+ }
172
+ _setRowInstant(value) {
173
+ var _a;
174
+ const slots = (_a = this._rowEl) == null ? void 0 : _a.querySelectorAll(".cnt-digit");
175
+ if (!slots) return;
176
+ const digits = this._extractTargetDigits(value);
177
+ slots.forEach((slot, i) => {
178
+ const inner = slot.querySelector(".cnt-digit-inner");
179
+ if (!inner) return;
180
+ inner.style.transition = "none";
181
+ inner.style.transform = `translateY(-${digits[i] ?? 0}em)`;
182
+ });
183
+ }
184
+ _animateTo(value, fromZero) {
185
+ var _a;
186
+ const slots = (_a = this._rowEl) == null ? void 0 : _a.querySelectorAll(".cnt-digit");
187
+ if (!slots || !slots.length) return;
188
+ const targetDigits = this._extractTargetDigits(value);
189
+ const total = slots.length;
190
+ slots.forEach((slot, i) => {
191
+ const inner = slot.querySelector(".cnt-digit-inner");
192
+ if (!inner) return;
193
+ const target = targetDigits[i] ?? 0;
194
+ const fromRight = total - 1 - i;
195
+ const delay = fromRight * 40;
196
+ if (fromZero) {
197
+ inner.style.transition = "none";
198
+ inner.style.transform = "translateY(0)";
199
+ }
200
+ void inner.offsetHeight;
201
+ inner.style.transition = `transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) ${delay}ms`;
202
+ inner.style.transform = `translateY(-${target}em)`;
203
+ });
204
+ }
205
+ _extractTargetDigits(value) {
206
+ const absVal = Math.abs(Math.floor(value));
207
+ let str = absVal.toString();
208
+ if (this.decimals !== null) {
209
+ const decStr = this.decimals.toString().padStart(2, "0");
210
+ str = str + decStr;
211
+ }
212
+ return str.split("").map((c) => parseInt(c, 10));
213
+ }
214
+ /* ── Public API ─────────────────────────────────────────── */
215
+ /** Anima el contador a un nuevo valor manualmente. */
216
+ animateTo(value) {
217
+ this.value = value;
218
+ }
219
+ /** Reinicia la animación desde cero al valor actual. */
220
+ replay() {
221
+ this._hasAnimated = false;
222
+ this._animateTo(this.value, true);
223
+ }
224
+ };
225
+ LibCounter.styles = [
226
+ css`${unsafeCSS(sharedTokens)}`,
227
+ css`${unsafeCSS(counterCss)}`
228
+ ];
229
+ __decorateClass([
230
+ property({ type: Number, reflect: true })
231
+ ], LibCounter.prototype, "value", 2);
232
+ __decorateClass([
233
+ property({ type: String, attribute: "prefix", reflect: true })
234
+ ], LibCounter.prototype, "prefix", 2);
235
+ __decorateClass([
236
+ property({ type: String, attribute: "suffix", reflect: true })
237
+ ], LibCounter.prototype, "suffix", 2);
238
+ __decorateClass([
239
+ property({ type: String, attribute: "thousands", reflect: true })
240
+ ], LibCounter.prototype, "thousands", 2);
241
+ __decorateClass([
242
+ property({ type: Number, attribute: "decimals", reflect: true })
243
+ ], LibCounter.prototype, "decimals", 2);
244
+ __decorateClass([
245
+ property({ type: String, reflect: true })
246
+ ], LibCounter.prototype, "size", 2);
247
+ __decorateClass([
248
+ property({ type: String, reflect: true })
249
+ ], LibCounter.prototype, "tone", 2);
36
250
  __decorateClass([
37
251
  property({ type: String })
38
- ], LibSpacer.prototype, "size", 2);
252
+ ], LibCounter.prototype, "label", 2);
253
+ __decorateClass([
254
+ property({ type: String })
255
+ ], LibCounter.prototype, "delta", 2);
256
+ __decorateClass([
257
+ property({ type: String, attribute: "delta-dir", reflect: true })
258
+ ], LibCounter.prototype, "deltaDir", 2);
259
+ __decorateClass([
260
+ property({ type: Boolean, attribute: "play-on-visible", reflect: true })
261
+ ], LibCounter.prototype, "playOnVisible", 2);
39
262
  __decorateClass([
40
- property({ type: Boolean, reflect: true })
41
- ], LibSpacer.prototype, "horizontal", 2);
42
- LibSpacer = __decorateClass([
43
- customElement("lib-spacer")
44
- ], LibSpacer);
263
+ query(".cnt-row")
264
+ ], LibCounter.prototype, "_rowEl", 2);
265
+ LibCounter = __decorateClass([
266
+ customElement("lib-counter")
267
+ ], LibCounter);
45
268
  export {
46
- LibSpacer
269
+ LibCounter
47
270
  };
48
271
  //# sourceMappingURL=index28.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index28.js","sources":["../src/components/atoms/spacer/lib-spacer.component.ts"],"sourcesContent":["// lib-spacer.component.ts\nimport { LitElement, html, css, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styleMap } from 'lit/directives/style-map.js';\n\n@customElement('lib-spacer')\nexport class LibSpacer extends LitElement {\n @property({ type: String }) size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'md';\n @property({ type: Boolean, reflect: true }) horizontal = false;\n\n static override styles = css`\n :host {\n display: block;\n flex-shrink: 0;\n flex-grow: 0;\n }\n :host([horizontal]) {\n display: inline-block;\n }\n `;\n\n protected override render():TemplateResult {\n // MAPEADO EXACTO A TUS TOKENS DE tokens.css\n const spaceValue = `var(--lib-space-${this.size}, 16px)`;\n \n const styles = this.horizontal \n ? { width: spaceValue, height: '100%' } \n : { height: spaceValue, width: '100%' };\n\n return html`<div style=${styleMap(styles)}></div>`;\n }\n}"],"names":["styleMap"],"mappings":";;;;;;;;;;;;;AAMO,IAAM,YAAN,cAAwB,WAAW;AAAA,EAAnC,cAAA;AAAA,UAAA,GAAA,SAAA;AACuB,SAAA,OAAyC;AACzB,SAAA,aAAa;AAAA,EAAA;AAAA,EAatC,SAAwB;AAEzC,UAAM,aAAa,mBAAmB,KAAK,IAAI;AAE/C,UAAM,SAAS,KAAK,aAChB,EAAE,OAAO,YAAY,QAAQ,OAAA,IAC7B,EAAE,QAAQ,YAAY,OAAO,OAAA;AAEjC,WAAO,kBAAkBA,EAAS,MAAM,CAAC;AAAA,EAC3C;AACF;AAzBa,UAIK,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAHG,gBAAA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GADf,UACiB,WAAA,QAAA,CAAA;AACgB,gBAAA;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GAF/B,UAEiC,WAAA,cAAA,CAAA;AAFjC,YAAN,gBAAA;AAAA,EADN,cAAc,YAAY;AAAA,GACd,SAAA;"}
1
+ {"version":3,"file":"index28.js","sources":["../src/components/atoms/lib-counter/lib-counter.component.ts"],"sourcesContent":["import { LitElement, css, unsafeCSS, TemplateResult, PropertyValues } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { counterTemplate } from './lib-counter.html';\nimport type { LibCounterSize, LibCounterTone, LibCounterDeltaDir } from './lib-counter.html';\nimport counterCss from './lib-counter.css?inline';\nimport sharedTokens from '../../../styles/shared/tokens.css?inline';\n\nexport type { LibCounterSize, LibCounterTone, LibCounterDeltaDir };\n\n/**\n * @element lib-counter\n *\n * Contador animado con digit-flip: cada dígito es una columna\n * de 0 a 9 que se desplaza con translateY. Los dígitos de mayor\n * peso animan antes que los de menor — efecto odómetro.\n *\n * @example — básico\n * <lib-counter value=\"24819\" label=\"Usuarios activos\" play-on-visible></lib-counter>\n *\n * @example — moneda con delta\n * <lib-counter value=\"18540\" prefix=\"€\" size=\"lg\" tone=\"kaki\"\n * label=\"Ingresos\" delta=\"+14,7%\" delta-dir=\"up\" play-on-visible>\n * </lib-counter>\n *\n * @example — porcentaje sin separador de miles\n * <lib-counter value=\"87\" suffix=\"%\" thousands=\"\" size=\"md\" play-on-visible></lib-counter>\n *\n * @example — con decimales\n * <lib-counter value=\"4\" decimals=\"73\" play-on-visible></lib-counter>\n * → renderiza 4,73\n */\n@customElement('lib-counter')\nexport class LibCounter extends LitElement {\n static override styles = [\n css`${unsafeCSS(sharedTokens)}`,\n css`${unsafeCSS(counterCss)}`,\n ];\n\n /* ── Props visuales ─────────────────────────────────────── */\n\n /** Valor numérico a mostrar. */\n @property({ type: Number, reflect: true })\n value = 0;\n\n /** Carácter prefijo (€, $, …). */\n @property({ type: String, attribute: 'prefix', reflect: true })\n override prefix = '';\n\n /** Carácter sufijo (%, k, …). */\n @property({ type: String, attribute: 'suffix', reflect: true })\n suffix = '';\n\n /** Separador de miles. Default: punto. Vacío = sin separador. */\n @property({ type: String, attribute: 'thousands', reflect: true })\n thousands = '.';\n\n /**\n * Dígitos decimales a mostrar después de coma.\n * Ejemplo: decimals=\"73\" → \",73\"\n */\n @property({ type: Number, attribute: 'decimals', reflect: true })\n decimals: number | null = null;\n\n /** Tamaño del contador. */\n @property({ type: String, reflect: true })\n size: LibCounterSize = 'md';\n\n /** Tono de color. */\n @property({ type: String, reflect: true })\n tone: LibCounterTone = 'default';\n\n /** Etiqueta inferior en font-mono uppercase. */\n @property({ type: String })\n label = '';\n\n /** Texto del indicador de variación (e.g. \"+14,7%\"). */\n @property({ type: String })\n delta = '';\n\n /** Dirección del delta — controla color e icono. */\n @property({ type: String, attribute: 'delta-dir', reflect: true })\n deltaDir: LibCounterDeltaDir = 'up';\n\n /**\n * Si está presente, el contador arranca desde 0 y anima\n * hasta `value` cuando entra en el viewport (IntersectionObserver).\n * Nombre: play-on-visible (evita colisión con HTMLElement.animate).\n */\n @property({ type: Boolean, attribute: 'play-on-visible', reflect: true })\n playOnVisible = false;\n\n /* ── Internos ───────────────────────────────────────────── */\n\n // FIX: declare evita el error de overload en decoradores strict\n @query('.cnt-row')\n declare private _rowEl: HTMLElement;\n\n private _builtDigitCount = -1;\n private _builtThousands = '';\n\n private _observer: IntersectionObserver | undefined;\n private _hasAnimated = false;\n private _firstUpdate = true;\n\n /* ── Lifecycle ──────────────────────────────────────────── */\n override connectedCallback(): void {\n super.connectedCallback();\n if (this.playOnVisible) {\n this._observer = new IntersectionObserver(\n (entries) => {\n if (entries[0]?.isIntersecting && !this._hasAnimated) {\n this._hasAnimated = true;\n this._animateTo(this.value, /* fromZero */ true);\n this._observer?.disconnect();\n }\n },\n { threshold: 0.2 }\n );\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._observer?.disconnect();\n }\n\n override render(): TemplateResult {\n return counterTemplate({\n size: this.size,\n tone: this.tone,\n label: this.label,\n delta: this.delta,\n deltaDir: this.deltaDir,\n });\n }\n\n override updated(changed: PropertyValues): void {\n super.updated(changed);\n\n const structureChanged =\n changed.has('value') ||\n changed.has('prefix') ||\n changed.has('suffix') ||\n changed.has('thousands') ||\n changed.has('decimals');\n\n if (!structureChanged && !this._firstUpdate) return;\n\n const needRebuild = this._needsRebuild();\n if (needRebuild) {\n this._buildRow();\n }\n\n if (this._firstUpdate) {\n this._firstUpdate = false;\n\n if (this.playOnVisible) {\n // Construir en 0 y esperar viewport\n this._setRowInstant(0);\n // FIX: cast a Element para satisfacer IntersectionObserver.observe()\n this._observer?.observe(this as unknown as Element);\n } else {\n this._setRowInstant(this.value);\n }\n return;\n }\n\n if (changed.has('value')) {\n this._animateTo(this.value, /* fromZero */ false);\n }\n }\n\n /* ── Motor de digit-flip ────────────────────────────────── */\n\n private _needsRebuild(): boolean {\n const digitCount = Math.abs(Math.floor(this.value)).toString().length;\n if (digitCount !== this._builtDigitCount) return true;\n if (this.thousands !== this._builtThousands) return true;\n return false;\n }\n\n private _buildRow(): void {\n const row = this._rowEl;\n if (!row) return;\n row.innerHTML = '';\n\n const absVal = Math.abs(Math.floor(this.value));\n const str = absVal.toString();\n this._builtDigitCount = str.length;\n this._builtThousands = this.thousands;\n\n if (this.prefix) {\n const p = document.createElement('span');\n p.className = 'cnt-prefix';\n p.textContent = this.prefix;\n row.appendChild(p);\n }\n\n const chars = this._buildCharArray(str, this.thousands);\n chars.forEach((c) => {\n if (c.type === 'sep') {\n const sep = document.createElement('span');\n sep.className = 'cnt-sep';\n sep.textContent = c.char;\n row.appendChild(sep);\n } else {\n row.appendChild(this._makeDigitSlot(parseInt(c.char, 10)));\n }\n });\n\n if (this.decimals !== null) {\n const dot = document.createElement('span');\n dot.className = 'cnt-sep';\n dot.textContent = ',';\n row.appendChild(dot);\n\n const decStr = this.decimals.toString().padStart(2, '0');\n for (const ch of decStr) {\n row.appendChild(this._makeDigitSlot(parseInt(ch, 10)));\n }\n }\n\n if (this.suffix) {\n const s = document.createElement('span');\n s.className = 'cnt-suffix';\n s.textContent = this.suffix;\n row.appendChild(s);\n }\n }\n\n private _buildCharArray(\n str: string,\n thousands: string\n ): Array<{ type: 'digit' | 'sep'; char: string }> {\n const result: Array<{ type: 'digit' | 'sep'; char: string }> = [];\n for (let i = 0; i < str.length; i++) {\n const posFromRight = str.length - 1 - i;\n if (i > 0 && posFromRight % 3 === 2 && thousands) {\n result.push({ type: 'sep', char: thousands });\n }\n // FIX: str[i] es string | undefined en TS estricto — asegurar con ?? '0'\n result.push({ type: 'digit', char: str[i] ?? '0' });\n }\n return result;\n }\n\n private _makeDigitSlot(digit: number): HTMLElement {\n const slot = document.createElement('span');\n slot.className = 'cnt-digit';\n\n const inner = document.createElement('span');\n inner.className = 'cnt-digit-inner';\n\n for (let i = 0; i <= 9; i++) {\n const span = document.createElement('span');\n span.textContent = String(i);\n inner.appendChild(span);\n }\n\n inner.style.transition = 'none';\n inner.style.transform = `translateY(-${digit}em)`;\n slot.appendChild(inner);\n return slot;\n }\n\n private _setRowInstant(value: number): void {\n const slots = this._rowEl?.querySelectorAll<HTMLElement>('.cnt-digit');\n if (!slots) return;\n const digits = this._extractTargetDigits(value);\n slots.forEach((slot, i) => {\n const inner = slot.querySelector<HTMLElement>('.cnt-digit-inner');\n if (!inner) return;\n inner.style.transition = 'none';\n inner.style.transform = `translateY(-${digits[i] ?? 0}em)`;\n });\n }\n\n private _animateTo(value: number, fromZero: boolean): void {\n const slots = this._rowEl?.querySelectorAll<HTMLElement>('.cnt-digit');\n if (!slots || !slots.length) return;\n\n const targetDigits = this._extractTargetDigits(value);\n const total = slots.length;\n\n slots.forEach((slot, i) => {\n const inner = slot.querySelector<HTMLElement>('.cnt-digit-inner');\n if (!inner) return;\n\n const target = targetDigits[i] ?? 0;\n const fromRight = total - 1 - i;\n const delay = fromRight * 40;\n\n if (fromZero) {\n inner.style.transition = 'none';\n inner.style.transform = 'translateY(0)';\n }\n\n void inner.offsetHeight; // forzar reflow\n\n inner.style.transition = `transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) ${delay}ms`;\n inner.style.transform = `translateY(-${target}em)`;\n });\n }\n\n private _extractTargetDigits(value: number): number[] {\n const absVal = Math.abs(Math.floor(value));\n let str = absVal.toString();\n\n if (this.decimals !== null) {\n const decStr = this.decimals.toString().padStart(2, '0');\n str = str + decStr;\n }\n\n return str.split('').map((c) => parseInt(c, 10));\n }\n\n /* ── Public API ─────────────────────────────────────────── */\n\n /** Anima el contador a un nuevo valor manualmente. */\n public animateTo(value: number): void {\n this.value = value;\n }\n\n /** Reinicia la animación desde cero al valor actual. */\n public replay(): void {\n this._hasAnimated = false;\n this._animateTo(this.value, true);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'lib-counter': LibCounter;\n }\n}"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgCO,IAAM,aAAN,cAAyB,WAAW;AAAA,EAApC,cAAA;AAAA,UAAA,GAAA,SAAA;AAUL,SAAA,QAAQ;AAIR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EAAE,MAAM,QAAQ,WAAW,aAAa,SAAS,MAAM;AAAA,GAhDtD,WAiDX,WAAA,YAAA,CAAA;AAQA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,WAAW,mBAAmB,SAAS,MAAM;AAAA,GAxD7D,WAyDX,WAAA,iBAAA,CAAA;AAMgB,gBAAA;AAAA,EADf,MAAM,UAAU;AAAA,GA9DN,WA+DK,WAAA,UAAA,CAAA;AA/DL,aAAN,gBAAA;AAAA,EADN,cAAc,aAAa;AAAA,GACf,UAAA;"}
package/dist/index280.js CHANGED
@@ -1,45 +1,5 @@
1
- import { nothing, html } from "lit";
2
- function labelColor(step) {
3
- return step <= 400 ? "rgba(26,20,14,0.45)" : "rgba(250,247,244,0.55)";
4
- }
5
- function colorScaleTemplate(ctx) {
6
- const steps = ctx.steps ?? [];
7
- const first = steps[0];
8
- const last = steps[steps.length - 1];
9
- return html`
10
- <div class="scale-wrap">
11
-
12
- <!-- Swatches -->
13
- <div class="scale-track">
14
- ${steps.map((s) => html`
15
- <div
16
- class="scale-swatch"
17
- style="background:${s.oklch ?? s.hex};"
18
- title="${ctx.name}-${s.step} · ${s.hex}"
19
- >
20
- <span class="scale-swatch-label" style="color:${labelColor(s.step)};">
21
- ${s.step}
22
- </span>
23
- </div>
24
- `)}
25
- </div>
26
-
27
- <!-- Extreme labels -->
28
- ${ctx.showLabels && first && last ? html`
29
- <div class="scale-legends">
30
- <span class="scale-legend">
31
- ${ctx.name}-${first.step} · ${first.hex}
32
- </span>
33
- <span class="scale-legend scale-legend--right">
34
- ${ctx.name}-${last.step} · ${last.hex}
35
- </span>
36
- </div>
37
- ` : nothing}
38
-
39
- </div>
40
- `;
41
- }
1
+ const burgerCss = '@layer tokens,reset,components;@layer reset{:host{display:inline-flex;align-items:center}*,*:before,*:after{box-sizing:border-box}button{font:inherit;background:none;border:none;padding:0;margin:0;cursor:pointer}}@layer components{.burger{position:relative;display:inline-flex;align-items:center;justify-content:center;border:none;background:none;cursor:pointer;padding:0;-webkit-tap-highlight-color:transparent;outline:none}.burger:focus-visible{box-shadow:0 0 0 2px var(--color-washi-50),0 0 0 4px var(--color-washi-600)}.burger-lines{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.burger-line{display:block;border-radius:var(--lib-radius-sm);background:currentcolor;transform-origin:center;will-change:transform,opacity,width}.burger-wrap{display:inline-flex;align-items:center;gap:var(--lib-space-sm);cursor:pointer}.burger-label{font-family:var(--lib-font-mono);font-size:var(--text-xs);letter-spacing:var(--tracking-widest);text-transform:uppercase;color:var(--text-muted);transition:color var(--duration-base),opacity var(--duration-base);-webkit-user-select:none;user-select:none}.burger-wrap:hover .burger-label{color:var(--text-primary)}:host([size="sm"]) .burger-lines{width:18px;height:12px}:host([size="sm"]) .burger-line{height:1px}:host([size="sm"]) .burger-line:nth-child(1){margin-bottom:5px}:host([size="sm"]) .burger-line:nth-child(2){margin-bottom:5px}:host([size="lg"]) .burger-lines{width:36px;height:24px}:host([size="lg"]) .burger-line{height:2px}:host([size="lg"]) .burger-line:nth-child(1){margin-bottom:10px}:host([size="lg"]) .burger-line:nth-child(2){margin-bottom:10px}:host([variant="ink"]) .burger{width:44px;height:44px;color:var(--text-primary);transition:color var(--duration-base)}:host([variant="ink"]) .burger:hover{color:var(--color-kaki-500)}:host([variant="ink"]) .burger:active{transform:scale(.94)}:host([variant="ink"]) .burger-lines{width:28px;height:18px}:host([variant="ink"]) .burger-line{height:1.5px;transition:transform var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out),width var(--duration-slow) var(--ease-bounce)}:host([variant="ink"]) .burger-line:nth-child(1){width:20px;margin-bottom:7px}:host([variant="ink"]) .burger-line:nth-child(2){width:28px;margin-bottom:7px}:host([variant="ink"]) .burger-line:nth-child(3){width:14px}:host([variant="ink"][open]) .burger-line:nth-child(1){transform:translateY(8.5px) rotate(45deg);width:26px;transition-delay:0ms,0ms,80ms}:host([variant="ink"][open]) .burger-line:nth-child(2){opacity:0;transform:scaleX(0);transition-delay:0ms}:host([variant="ink"][open]) .burger-line:nth-child(3){transform:translateY(-8.5px) rotate(-45deg);width:26px;transition-delay:0ms,0ms,80ms}:host([variant="kanji"]) .burger{width:48px;height:48px;color:var(--text-primary);position:relative;transition:color var(--duration-base)}:host([variant="kanji"]) .burger:hover{color:var(--color-kaki-500)}:host([variant="kanji"]) .burger:active{transform:scale(.93)}:host([variant="kanji"]) .burger:after{content:"三";position:absolute;bottom:0;left:50%;transform:translate(-50%);font-family:var(--lib-font-mono);font-size:8px;letter-spacing:0;color:var(--text-muted);transition:opacity var(--duration-base)}:host([variant="kanji"][open]) .burger:after{content:"×"}:host([variant="kanji"]) .burger-lines{width:26px;height:16px;margin-bottom:6px}:host([variant="kanji"]) .burger-line{height:1px;transition:transform var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out),width var(--duration-slow) var(--ease-bounce)}:host([variant="kanji"]) .burger-line:nth-child(1){width:26px;margin-bottom:7px}:host([variant="kanji"]) .burger-line:nth-child(2){width:18px;margin-bottom:7px}:host([variant="kanji"]) .burger-line:nth-child(3){width:26px}:host([variant="kanji"][open]) .burger-line:nth-child(1){transform:translateY(7.5px) rotate(45deg);width:24px}:host([variant="kanji"][open]) .burger-line:nth-child(2){opacity:0;width:0}:host([variant="kanji"][open]) .burger-line:nth-child(3){transform:translateY(-7.5px) rotate(-45deg);width:24px}:host([variant="washi"]) .burger{width:48px;height:48px;color:var(--text-primary);transition:color var(--duration-base)}:host([variant="washi"]) .burger:hover{color:var(--color-kaki-500)}:host([variant="washi"]) .burger:active{transform:scale(.93)}:host([variant="washi"]) .burger-lines{width:28px;height:18px}:host([variant="washi"]) .burger-line{width:28px;height:1px;transition:transform var(--duration-slow) var(--ease-bounce),width var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out)}:host([variant="washi"]) .burger-line:nth-child(1){margin-bottom:8px}:host([variant="washi"]) .burger-line:nth-child(2){margin-bottom:8px}:host([variant="washi"][open]) .burger-line:nth-child(1){transform:translateY(9px) rotate(45deg);transition-delay:60ms,0ms,0ms}:host([variant="washi"][open]) .burger-line:nth-child(2){opacity:0;width:0}:host([variant="washi"][open]) .burger-line:nth-child(3){transform:translateY(-9px) rotate(-45deg);transition-delay:60ms,0ms,0ms}:host([variant="framed"]) .burger{width:44px;height:44px;color:var(--text-primary);border:1px solid var(--border-default);transition:border-color var(--duration-base),color var(--duration-base),transform var(--duration-slow) var(--ease-bounce)}:host([variant="framed"]) .burger:hover{border-color:var(--border-strong);color:var(--color-kaki-500)}:host([variant="framed"][open]) .burger{transform:rotate(45deg);border-color:var(--color-kaki-500);color:var(--color-kaki-500)}:host([variant="framed"]) .burger-lines{width:20px;height:13px;transition:transform var(--duration-slow) var(--ease-bounce)}:host([variant="framed"][open]) .burger-lines{transform:rotate(-45deg)}:host([variant="framed"]) .burger-line{width:20px;height:1.5px;transition:transform var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out),width var(--duration-base) var(--ease-out)}:host([variant="framed"]) .burger-line:nth-child(1){margin-bottom:5px}:host([variant="framed"]) .burger-line:nth-child(2){margin-bottom:5px}:host([variant="framed"][open]) .burger-line:nth-child(1){transform:translateY(6.75px) rotate(90deg);width:14px}:host([variant="framed"][open]) .burger-line:nth-child(2){opacity:0}:host([variant="framed"][open]) .burger-line:nth-child(3){transform:translateY(-6.75px);width:14px}:host([variant="kintsugi"]) .burger{width:48px;height:48px;color:#faf7f480;position:relative;overflow:hidden;transition:color var(--duration-base)}:host([variant="kintsugi"]) .burger:hover{color:#faf7f4cc}:host([variant="kintsugi"]) .burger:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:radial-gradient(circle at center,rgb(217,114,52,.18) 0%,transparent 70%);opacity:0;transition:opacity var(--duration-slow)}:host([variant="kintsugi"][open]) .burger:before{opacity:1}:host([variant="kintsugi"][open]) .burger{color:var(--color-kaki-400)}:host([variant="kintsugi"]) .burger-lines{width:24px;height:16px}:host([variant="kintsugi"]) .burger-line{height:1px;transition:transform var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out),width var(--duration-slow) var(--ease-bounce),background var(--duration-base)}:host([variant="kintsugi"]) .burger-line:nth-child(1){width:24px;margin-bottom:7px}:host([variant="kintsugi"]) .burger-line:nth-child(2){width:16px;margin-bottom:7px}:host([variant="kintsugi"]) .burger-line:nth-child(3){width:24px}:host([variant="kintsugi"][open]) .burger-line:nth-child(1){transform:translateY(7.5px) rotate(45deg);width:22px}:host([variant="kintsugi"][open]) .burger-line:nth-child(2){opacity:0;width:0}:host([variant="kintsugi"][open]) .burger-line:nth-child(3){transform:translateY(-7.5px) rotate(-45deg);width:22px}:host([variant="glitch"]) .burger{width:52px;height:52px;color:var(--text-primary);position:relative;transition:color var(--duration-base)}:host([variant="glitch"]) .burger:hover{color:var(--color-kaki-500)}.burger-ghost{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;display:flex;align-items:center;justify-content:center;z-index:0}.burger-ghost svg{position:absolute;opacity:0}:host([variant="glitch"]) .burger:hover .ghost-a{opacity:1;animation:burger-glitch-a .32s steps(1) infinite}:host([variant="glitch"]) .burger:hover .ghost-b{opacity:1;animation:burger-glitch-b .32s steps(1) infinite;animation-delay:50ms}@keyframes burger-glitch-a{0%{clip-path:inset(0 0 70% 0);transform:translate(-3px)}25%{clip-path:inset(40% 0 40% 0);transform:translate(2px)}50%{clip-path:inset(70% 0 0 0);transform:translate(-2px)}75%{clip-path:inset(20% 0 60% 0);transform:translate(3px)}to{clip-path:inset(55% 0 20% 0);transform:translate(-3px)}}@keyframes burger-glitch-b{0%{clip-path:inset(60% 0 0 0);transform:translate(3px)}25%{clip-path:inset(0 0 60% 0);transform:translate(-2px)}50%{clip-path:inset(30% 0 50% 0);transform:translate(3px)}75%{clip-path:inset(70% 0 10% 0);transform:translate(-3px)}to{clip-path:inset(10% 0 70% 0);transform:translate(2px)}}:host([variant="glitch"]) .burger-lines{width:28px;height:18px;position:relative;z-index:1}:host([variant="glitch"]) .burger-line{width:28px;height:1.5px;position:relative;transition:transform var(--duration-slow) var(--ease-bounce),opacity var(--duration-base) var(--ease-out)}:host([variant="glitch"]) .burger-line:nth-child(1){margin-bottom:7px}:host([variant="glitch"]) .burger-line:nth-child(2){margin-bottom:7px}:host([variant="glitch"][open]) .burger-line:nth-child(1){transform:translateY(8.5px) rotate(45deg)}:host([variant="glitch"][open]) .burger-line:nth-child(2){opacity:0}:host([variant="glitch"][open]) .burger-line:nth-child(3){transform:translateY(-8.5px) rotate(-45deg)}:host([variant="glitch"]) .burger.is-scrambling .burger-line{animation:burger-scramble 80ms steps(1) 4}@keyframes burger-scramble{0%{transform:translate(-2px,1px);opacity:.7}25%{transform:translate(3px,-1px);opacity:.5}50%{transform:translate(-1px,2px);opacity:.8}75%{transform:translate(2px,-2px);opacity:.6}to{transform:translate(0);opacity:1}}}';
42
2
  export {
43
- colorScaleTemplate
3
+ burgerCss as default
44
4
  };
45
5
  //# sourceMappingURL=index280.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index280.js","sources":["../src/components/atoms/color-scale/lib-color-scale.html.ts"],"sourcesContent":["import { html, nothing, TemplateResult } from 'lit';\nimport type { LibColorScale } from './lib-color-scale.component';\nimport type { ColorStep } from './lib-color-scale.types';\n\n/**\n * Determina si el label del paso debe mostrarse en color claro u oscuro\n * según el luminance aproximado del paso (por encima de 500 → oscuro, por debajo → claro).\n */\nfunction labelColor(step: number): string {\n return step <= 400\n ? 'rgba(26,20,14,0.45)' /* sobre claro */\n : 'rgba(250,247,244,0.55)'; /* sobre oscuro */\n}\n\nexport function colorScaleTemplate(ctx: LibColorScale): TemplateResult {\n const steps = ctx.steps ?? [];\n const first = steps[0];\n const last = steps[steps.length - 1];\n\n return html`\n <div class=\"scale-wrap\">\n\n <!-- Swatches -->\n <div class=\"scale-track\">\n ${steps.map((s: ColorStep) => html`\n <div\n class=\"scale-swatch\"\n style=\"background:${s.oklch ?? s.hex};\"\n title=\"${ctx.name}-${s.step} · ${s.hex}\"\n >\n <span class=\"scale-swatch-label\" style=\"color:${labelColor(s.step)};\">\n ${s.step}\n </span>\n </div>\n `)}\n </div>\n\n <!-- Extreme labels -->\n ${ctx.showLabels && first && last ? html`\n <div class=\"scale-legends\">\n <span class=\"scale-legend\">\n ${ctx.name}-${first.step} · ${first.hex}\n </span>\n <span class=\"scale-legend scale-legend--right\">\n ${ctx.name}-${last.step} · ${last.hex}\n </span>\n </div>\n ` : nothing}\n\n </div>\n `;\n}"],"names":[],"mappings":";AAQA,SAAS,WAAW,MAAsB;AACxC,SAAO,QAAQ,MACX,wBACA;AACN;AAEO,SAAS,mBAAmB,KAAoC;AACrE,QAAM,QAAQ,IAAI,SAAS,CAAA;AAC3B,QAAM,QAAQ,MAAM,CAAC;AACrB,QAAM,OAAQ,MAAM,MAAM,SAAS,CAAC;AAEpC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA,UAKC,MAAM,IAAI,CAAC,MAAiB;AAAA;AAAA;AAAA,gCAGN,EAAE,SAAS,EAAE,GAAG;AAAA,qBAC3B,IAAI,IAAI,IAAI,EAAE,IAAI,MAAM,EAAE,GAAG;AAAA;AAAA,4DAEU,WAAW,EAAE,IAAI,CAAC;AAAA,gBAC9D,EAAE,IAAI;AAAA;AAAA;AAAA,SAGb,CAAC;AAAA;AAAA;AAAA;AAAA,QAIF,IAAI,cAAc,SAAS,OAAO;AAAA;AAAA;AAAA,cAG5B,IAAI,IAAI,IAAI,MAAM,IAAI,MAAM,MAAM,GAAG;AAAA;AAAA;AAAA,cAGrC,IAAI,IAAI,IAAI,KAAK,IAAI,MAAM,KAAK,GAAG;AAAA;AAAA;AAAA,UAGvC,OAAO;AAAA;AAAA;AAAA;AAIjB;"}
1
+ {"version":3,"file":"index280.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/dist/index281.js CHANGED
@@ -1,103 +1,5 @@
1
- import { html, nothing } from "lit";
2
- import { classMap as e } from "./index352.js";
3
- function renderSep(separator) {
4
- if (separator === "chevron") {
5
- return html`
6
- <span class="bc-sep" aria-hidden="true">
7
- <lib-icon name="caret-right" size="xs"></lib-icon>
8
- </span>
9
- `;
10
- }
11
- return html`<span class="bc-sep" aria-hidden="true"></span>`;
12
- }
13
- function renderIcon(icon) {
14
- if (!icon) return nothing;
15
- return html`<span class="bc-icon"><lib-icon name="${icon}" size="xs"></lib-icon></span>`;
16
- }
17
- function renderLink(item, index, separator, onNavigate) {
18
- return html`
19
- <li class="bc-item">
20
- <a
21
- class="bc-link"
22
- href="${item.href ?? "#"}"
23
- @click="${(e2) => {
24
- e2.preventDefault();
25
- onNavigate(item, index);
26
- }}"
27
- >
28
- ${renderIcon(item.icon)}
29
- ${item.label ? html`${item.label}` : nothing}
30
- </a>
31
- ${renderSep(separator)}
32
- </li>
33
- `;
34
- }
35
- function renderCurrent(item) {
36
- return html`
37
- <li class="bc-item">
38
- <span class="bc-current" aria-current="page">
39
- ${renderIcon(item.icon)}
40
- ${item.label ? html`${item.label}` : nothing}
41
- </span>
42
- </li>
43
- `;
44
- }
45
- function renderEllipsis(separator, onExpand) {
46
- return html`
47
- <li class="bc-item">
48
- <button
49
- class="bc-ellipsis"
50
- aria-label="Mostrar ruta completa"
51
- @click="${onExpand}"
52
- >…</button>
53
- ${renderSep(separator)}
54
- </li>
55
- `;
56
- }
57
- function renderItems(p) {
58
- const { items, separator, maxVisible, expanded, onExpand, onNavigate } = p;
59
- const shouldCollapse = maxVisible > 0 && items.length > maxVisible && !expanded;
60
- if (shouldCollapse) {
61
- const first = items[0];
62
- const last = items[items.length - 1];
63
- if (!first || !last) return [];
64
- return [
65
- renderLink(first, 0, separator, onNavigate),
66
- renderEllipsis(separator, onExpand),
67
- last.href ? renderLink(last, items.length - 1, separator, onNavigate) : renderCurrent(last)
68
- ];
69
- }
70
- return items.map((item, i) => {
71
- const isLast = i === items.length - 1;
72
- if (isLast || !item.href) return renderCurrent(item);
73
- return renderLink(item, i, separator, onNavigate);
74
- });
75
- }
76
- function breadcrumbTemplate(p) {
77
- const bcClasses = {
78
- "bc": true,
79
- "bc-slash": p.separator === "slash",
80
- "bc-chevron": p.separator === "chevron",
81
- "bc-dot": p.separator === "dot",
82
- "bc-line": p.separator === "line",
83
- "bc-sm": p.size === "sm",
84
- "bc-lg": p.size === "lg",
85
- "bc-filled": p.surface === "filled",
86
- "bc-pill": p.surface === "pill",
87
- "bc-kaki": p.accent === "kaki",
88
- "bc-celadon": p.accent === "celadon",
89
- "bc-bold": p.accent === "bold",
90
- "bc-dark": p.dark
91
- };
92
- return html`
93
- <nav class="${e(bcClasses)}" aria-label="breadcrumb">
94
- <ol class="bc-list">
95
- ${renderItems(p)}
96
- </ol>
97
- </nav>
98
- `;
99
- }
1
+ const buttonCss = '@layer tokens,reset,components;@layer reset{:host{display:inline-block;vertical-align:middle}*,*:before,*:after{box-sizing:border-box}}@layer components{.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--lib-space-sm);font-family:var(--lib-font-mono);font-size:var(--text-xs);font-weight:var(--weight-medium);letter-spacing:var(--tracking-wider);text-transform:uppercase;white-space:nowrap;line-height:1;padding:var(--lib-space-sm) var(--lib-space-md);width:100%;border:var(--lib-border-width) solid transparent;border-radius:var(--radius-none);background:transparent;cursor:pointer;outline:none;text-decoration:none;position:relative;overflow:hidden;transition:background var(--duration-base) var(--ease-default),color var(--duration-base) var(--ease-default),border-color var(--duration-base) var(--ease-default),box-shadow var(--duration-base) var(--ease-default),transform var(--duration-fast) var(--ease-default)}.btn ::slotted(*){position:relative;z-index:1}.btn:active:not(:disabled){transform:translateY(1px)}:host([size="sm"]) .btn{padding:var(--lib-space-xs) var(--lib-space-sm);font-size:10px}:host([size="lg"]) .btn{padding:var(--lib-space-md) var(--lib-space-lg);font-size:var(--text-sm);letter-spacing:var(--tracking-widest)}:host([disabled]) .btn{opacity:.38;cursor:not-allowed;pointer-events:none}:host([variant="primary"]) .btn{background:var(--color-washi-900);color:var(--color-washi-50)}:host([variant="primary"]) .btn:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:var(--color-kaki-400);transform:scaleX(0);transform-origin:left;transition:transform var(--duration-slow) var(--ease-out);z-index:0}:host([variant="primary"]) .btn:hover{box-shadow:var(--shadow-md)}:host([variant="primary"]) .btn:hover:after{transform:scaleX(1)}:host([variant="secondary"]) .btn{background:transparent;color:var(--text-primary);border-color:var(--border-strong)}:host([variant="secondary"]) .btn:hover{background:var(--color-washi-900);color:var(--color-washi-50);border-color:var(--color-washi-900)}:host([variant="ghost"]) .btn{background:transparent;color:var(--text-secondary)}:host([variant="ghost"]) .btn:hover{color:var(--text-primary);background:var(--color-ink-10)}:host([variant="accent"]) .btn{background:var(--color-kaki-400);color:var(--color-white)}:host([variant="accent"]) .btn:hover{background:var(--color-kaki-500);box-shadow:var(--shadow-md)}:host([variant="danger"]) .btn{background:transparent;color:var(--color-error);border-color:var(--color-error)}:host([variant="danger"]) .btn:hover{background:var(--color-error);color:var(--color-white)}:host([glass]) .btn{border-radius:var(--radius-md);-webkit-backdrop-filter:var(--lib-glass-filter);backdrop-filter:var(--lib-glass-filter);background:var(--lib-glass-bg);border:var(--lib-glass-border);box-shadow:var(--lib-glass-shadow);color:var(--lib-glass-text);text-shadow:var(--lib-glass-text-shadow)}:host([glass]) .btn:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;background:var(--lib-glass-shine);pointer-events:none;z-index:0}:host([glass]) .btn:hover{box-shadow:var(--lib-glass-shadow-hover);transform:translateY(-1px)}:host([glass][variant="primary"]) .btn{background:var(--lib-glass-bg-water);border-color:#ffffff40}:host([glass][variant="accent"]) .btn{background:var(--lib-glass-bg-kaki);border-color:#6d4d3e59}:host([glass][variant="primary"]) .btn:after{display:none}:host([variant="kintsugi"]) .btn{background:var(--color-washi-950);color:var(--color-washi-50);border-color:transparent}:host([variant="kintsugi"]) .btn:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;padding:1px;background:var(--lib-kintsugi-border);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none;z-index:0}@media(hover:hover){:host([variant="kintsugi"]) .btn:hover{background:var(--color-washi-900)}}:host([variant="brutal"]) .btn{background:var(--color-washi-50);color:var(--color-ink-100);border:2px solid var(--color-ink-100);box-shadow:var(--lib-shadow-brutal);border-radius:0;transition:transform var(--duration-fast) var(--ease-default),box-shadow var(--duration-fast) var(--ease-default)}@media(hover:hover){:host([variant="brutal"]) .btn:hover{transform:translate(4px,4px);box-shadow:none}}:host([variant="brutal"]) .btn:active{transform:translate(4px,4px);box-shadow:none}.spotlight-layer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--lib-spotlight-gradient-white);transition:var(--lib-spotlight-transition);pointer-events:none;z-index:0}:host([variant="brutal"]) .spotlight-layer,:host([variant="secondary"]) .spotlight-layer,:host([variant="ghost"]) .spotlight-layer{background:var(--lib-spotlight-gradient)}}';
100
2
  export {
101
- breadcrumbTemplate
3
+ buttonCss as default
102
4
  };
103
5
  //# sourceMappingURL=index281.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index281.js","sources":["../src/components/molecules/breadcrumb/lib-breadcrumb.html.ts"],"sourcesContent":["import { html, nothing, TemplateResult } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport type {\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbSize,\n BreadcrumbSurface,\n BreadcrumbAccent,\n} from './lib-breadcrumb.types';\n\nexport interface BreadcrumbTemplateProps {\n items: BreadcrumbItem[];\n separator: BreadcrumbSeparator;\n size: BreadcrumbSize;\n surface: BreadcrumbSurface;\n accent: BreadcrumbAccent;\n dark: boolean;\n /** Si > 0 y items.length > maxVisible, colapsa los crumbs intermedios. */\n maxVisible: number;\n /** Estado interno: ¿está expandido el truncado? */\n expanded: boolean;\n onExpand: () => void;\n onNavigate: (item: BreadcrumbItem, index: number) => void;\n}\n\n/* ── Separador ─────────────────────────────────────────── */\nfunction renderSep(separator: BreadcrumbSeparator): TemplateResult {\n if (separator === 'chevron') {\n return html`\n <span class=\"bc-sep\" aria-hidden=\"true\">\n <lib-icon name=\"caret-right\" size=\"xs\"></lib-icon>\n </span>\n `;\n }\n return html`<span class=\"bc-sep\" aria-hidden=\"true\"></span>`;\n}\n\n/* ── Icono opcional dentro de un crumb ─────────────────── */\nfunction renderIcon(icon?: string): TemplateResult | typeof nothing {\n if (!icon) return nothing;\n return html`<span class=\"bc-icon\"><lib-icon name=\"${icon}\" size=\"xs\"></lib-icon></span>`;\n}\n\n/* ── Crumb enlazable (ancestro) ─────────────────────────── */\nfunction renderLink(\n item: BreadcrumbItem,\n index: number,\n separator: BreadcrumbSeparator,\n onNavigate: BreadcrumbTemplateProps['onNavigate'],\n): TemplateResult {\n return html`\n <li class=\"bc-item\">\n <a\n class=\"bc-link\"\n href=\"${item.href ?? '#'}\"\n @click=\"${(e: Event):void => { e.preventDefault(); onNavigate(item, index); }}\"\n >\n ${renderIcon(item.icon)}\n ${item.label ? html`${item.label}` : nothing}\n </a>\n ${renderSep(separator)}\n </li>\n `;\n}\n\n/* ── Crumb activo (último) ──────────────────────────────── */\nfunction renderCurrent(item: BreadcrumbItem): TemplateResult {\n return html`\n <li class=\"bc-item\">\n <span class=\"bc-current\" aria-current=\"page\">\n ${renderIcon(item.icon)}\n ${item.label ? html`${item.label}` : nothing}\n </span>\n </li>\n `;\n}\n\n/* ── Botón de ellipsis (truncado) ──────────────────────── */\nfunction renderEllipsis(\n separator: BreadcrumbSeparator,\n onExpand: () => void,\n): TemplateResult {\n return html`\n <li class=\"bc-item\">\n <button\n class=\"bc-ellipsis\"\n aria-label=\"Mostrar ruta completa\"\n @click=\"${onExpand}\"\n >…</button>\n ${renderSep(separator)}\n </li>\n `;\n}\n\n/* ── Lista de ítems con lógica de collapse ─────────────── */\nfunction renderItems(p: BreadcrumbTemplateProps): TemplateResult[] {\n const { items, separator, maxVisible, expanded, onExpand, onNavigate } = p;\n\n const shouldCollapse =\n maxVisible > 0 &&\n items.length > maxVisible &&\n !expanded;\n\n if (shouldCollapse) {\n const first = items[0];\n const last = items[items.length - 1];\n\n if (!first || !last) return [];\n\n return [\n renderLink(first, 0, separator, onNavigate),\n renderEllipsis(separator, onExpand),\n last.href\n ? renderLink(last, items.length - 1, separator, onNavigate)\n : renderCurrent(last),\n ];\n }\n\n return items.map((item, i) => {\n const isLast = i === items.length - 1;\n if (isLast || !item.href) return renderCurrent(item);\n return renderLink(item, i, separator, onNavigate);\n });\n}\n\n/* ── Template principal ─────────────────────────────────── */\nexport function breadcrumbTemplate(p: BreadcrumbTemplateProps): TemplateResult {\n const bcClasses = {\n 'bc': true,\n 'bc-slash': p.separator === 'slash',\n 'bc-chevron': p.separator === 'chevron',\n 'bc-dot': p.separator === 'dot',\n 'bc-line': p.separator === 'line',\n 'bc-sm': p.size === 'sm',\n 'bc-lg': p.size === 'lg',\n 'bc-filled': p.surface === 'filled',\n 'bc-pill': p.surface === 'pill',\n 'bc-kaki': p.accent === 'kaki',\n 'bc-celadon': p.accent === 'celadon',\n 'bc-bold': p.accent === 'bold',\n 'bc-dark': p.dark,\n };\n\n return html`\n <nav class=\"${classMap(bcClasses)}\" aria-label=\"breadcrumb\">\n <ol class=\"bc-list\">\n ${renderItems(p)}\n </ol>\n </nav>\n `;\n}"],"names":["e","classMap"],"mappings":";;AA0BA,SAAS,UAAU,WAAgD;AACjE,MAAI,cAAc,WAAW;AAC3B,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKT;AACA,SAAO;AACT;AAGA,SAAS,WAAW,MAAgD;AAClE,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,6CAA6C,IAAI;AAC1D;AAGA,SAAS,WACP,MACA,OACA,WACA,YACgB;AAChB,SAAO;AAAA;AAAA;AAAA;AAAA,gBAIO,KAAK,QAAQ,GAAG;AAAA,kBACd,CAACA,OAAkB;AAAE,IAAAA,GAAE,eAAA;AAAkB,eAAW,MAAM,KAAK;AAAA,EAAG,CAAC;AAAA;AAAA,UAE3E,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AAc;AAAA,IACjC,UAAiB,EAAE,cAAc;AAAA,IACjC,WAAiB,EAAE,cAAc;AAAA,IACjC,SAAiB,EAAE,SAAS;AAAA,IAC5B,SAAiB,EAAE,SAAS;AAAA,IAC5B,aAAiB,EAAE,YAAY;AAAA,IAC/B,WAAiB,EAAE,YAAY;AAAA,IAC/B,WAAiB,EAAE,WAAW;AAAA,IAC9B,cAAiB,EAAE,WAAW;AAAA,IAC9B,WAAiB,EAAE,WAAW;AAAA,IAC9B,WAAiB,EAAE;AAAA,EAAA;AAGrB,SAAO;AAAA,kBACSC,EAAS,SAAS,CAAC;AAAA;AAAA,UAE3B,YAAY,CAAC,CAAC;AAAA;AAAA;AAAA;AAIxB;"}
1
+ {"version":3,"file":"index281.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/dist/index282.js CHANGED
@@ -1,5 +1,23 @@
1
- const componentCss = '@layer tokens,reset,components;@layer reset{:host{display:block}*,*:before,*:after{box-sizing:border-box}}@layer components{.bc{display:flex;align-items:center}.bc-list{display:flex;align-items:center;flex-wrap:wrap;list-style:none;gap:0;padding:0;margin:0}.bc-item{display:flex;align-items:center;gap:0;position:relative}.bc-link{font-family:var(--lib-font-mono);font-size:var(--text-xs);letter-spacing:var(--tracking-wide);color:var(--text-muted);text-decoration:none;padding:var(--lib-space-xs) var(--lib-space-xs);transition:color var(--duration-fast);white-space:nowrap;display:flex;align-items:center;gap:var(--lib-space-xs)}.bc-link:hover{color:var(--text-primary)}.bc-current{font-family:var(--lib-font-mono);font-size:var(--text-xs);letter-spacing:var(--tracking-wide);color:var(--text-secondary);white-space:nowrap;padding:var(--lib-space-xs) var(--lib-space-xs);display:flex;align-items:center;gap:var(--lib-space-xs)}.bc-sep{display:flex;align-items:center;padding:0 var(--lib-space-sm);color:var(--color-washi-300);-webkit-user-select:none;user-select:none;flex-shrink:0}.bc-slash .bc-sep:before{content:"/";font-family:var(--lib-font-mono);font-size:10px;line-height:1}.bc-dot .bc-sep:before{content:"·";font-family:var(--lib-font-mono);font-size:13px;line-height:1}.bc-line .bc-sep:before{content:"—";font-family:var(--lib-font-mono);font-size:10px;line-height:1}.bc-chevron .bc-sep{padding:0 var(--lib-space-xs);font-size:12px}.bc-chevron .bc-sep:before{content:none}.bc-icon{font-size:13px;display:flex;align-items:center;opacity:.7}.bc-sm .bc-link,.bc-sm .bc-current{font-size:10px;letter-spacing:var(--tracking-wide)}.bc-sm .bc-sep{padding:0 var(--lib-space-xs)}.bc-sm .bc-icon{font-size:11px}.bc-lg .bc-link,.bc-lg .bc-current{font-family:var(--lib-font-body);font-size:var(--text-sm);letter-spacing:0}.bc-lg .bc-icon{font-size:15px}.bc-filled{background:var(--bg-surface);border:1px solid var(--border-subtle);padding:var(--lib-space-sm) var(--lib-space-md)}.bc-pill .bc-link{background:var(--bg-surface);border:1px solid var(--border-subtle);padding:var(--lib-space-xs) var(--lib-space-sm);transition:background var(--duration-fast),border-color var(--duration-fast),color var(--duration-fast)}.bc-pill .bc-link:hover{background:var(--color-washi-200);border-color:var(--border-default);color:var(--text-primary)}.bc-pill .bc-current{background:var(--color-washi-900);color:var(--color-washi-50);border:1px solid var(--color-washi-900);padding:var(--lib-space-xs) var(--lib-space-sm)}.bc-pill .bc-sep{padding:0 var(--lib-space-sm)}.bc-kaki .bc-current,.bc-kaki .bc-link:hover{color:var(--color-kaki-500)}.bc-celadon .bc-current,.bc-celadon .bc-link:hover{color:var(--color-celadon-500)}.bc-bold .bc-current{color:var(--text-primary);font-weight:600}.bc-ellipsis{font-family:var(--lib-font-mono);font-size:var(--text-xs);letter-spacing:var(--tracking-wide);color:var(--text-muted);background:var(--bg-surface);border:1px solid var(--border-subtle);padding:1px var(--lib-space-sm);cursor:pointer;transition:background var(--duration-fast),color var(--duration-fast),border-color var(--duration-fast);line-height:1.6;display:inline-flex;align-items:center}.bc-ellipsis:hover{background:var(--color-washi-200);border-color:var(--border-default);color:var(--text-primary)}.bc-dropdown-wrap{position:relative}.bc-dropdown-panel{position:absolute;top:calc(100% + 4px);left:0;z-index:var(--z-dropdown, 300);background:var(--bg-elevated);border:1px solid var(--border-default);box-shadow:var(--shadow-md);min-width:180px;opacity:0;transform:translateY(-4px) scaleY(.97);transform-origin:top left;pointer-events:none;transition:opacity .16s var(--ease-out),transform .18s var(--ease-out)}.bc-dropdown-panel.is-open{opacity:1;transform:translateY(0) scaleY(1);pointer-events:auto}.bc-dropdown-item{display:flex;align-items:center;gap:var(--lib-space-sm);padding:var(--lib-space-sm) var(--lib-space-md);font-family:var(--lib-font-mono);font-size:10px;letter-spacing:var(--tracking-wide);color:var(--text-secondary);text-decoration:none;cursor:pointer;transition:background var(--duration-fast),color var(--duration-fast)}.bc-dropdown-item:hover{background:var(--bg-surface);color:var(--text-primary)}.bc-dropdown-item-icon{font-size:14px;color:var(--text-muted);display:flex;flex-shrink:0}.bc-dark .bc-link{color:#3c302a}.bc-dark .bc-link:hover{color:#998c84}.bc-dark .bc-current{color:#7b6f67}.bc-dark .bc-sep{color:#231813}.bc-dark.bc-filled{background:#100704;border-color:#1e130e}.bc-dark .bc-ellipsis{background:#100704;border-color:#1e130e;color:#433831}.bc-dark .bc-ellipsis:hover{background:#190f0a;color:#998c84}.bc-dark.bc-pill .bc-link{background:#100704;border-color:#1e130e}.bc-dark.bc-pill .bc-link:hover{background:#1e130e}.bc-dark.bc-pill .bc-current{background:#8a7d75;color:var(--color-washi-950);border-color:#8a7d75}.bc-dark .bc-dropdown-panel{background:#150a06;border-color:#231813}.bc-dark .bc-dropdown-item{color:#574a43}.bc-dark .bc-dropdown-item:hover{background:#1e130e;color:#998c84}}';
1
+ import { nothing, html } from "lit";
2
+ function buttonTemplate(props) {
3
+ return html`
4
+ <button
5
+ id="${props.buttonId}"
6
+ type="${props.type}"
7
+ ?disabled="${props.disabled}"
8
+ aria-label="${props.ariaLabel ?? nothing}"
9
+ style="${props.customPadding ? `padding: ${props.customPadding}` : nothing}"
10
+ @click="${props.handleClick}"
11
+ class="btn"
12
+ >
13
+ ${props.spotlight ? html`<span class="spotlight-layer" aria-hidden="true"></span>` : nothing}
14
+ <slot name="prefix"></slot>
15
+ <slot></slot>
16
+ <slot name="suffix"></slot>
17
+ </button>
18
+ `;
19
+ }
2
20
  export {
3
- componentCss as default
21
+ buttonTemplate
4
22
  };
5
23
  //# sourceMappingURL=index282.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index282.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index282.js","sources":["../src/components/atoms/button/lib-button.html.ts"],"sourcesContent":["import { html, nothing, TemplateResult } from 'lit';\nimport type { LibSize } from '../../../types';\nimport type { LibButtonVariant } from './lib-button.types';\n\nexport interface ButtonTemplateProps {\n buttonId: string;\n type: 'button' | 'submit' | 'reset';\n disabled: boolean;\n ariaLabel?: string | undefined;\n handleClick: (event: Event) => void;\n variant: LibButtonVariant;\n size: LibSize;\n glass: boolean;\n spotlight: boolean;\n customPadding?: string | undefined;\n}\n \n/**\n * Plantilla base para el componente lib-button.\n * Renderiza un único <button> estilizado vía :host() selectors.\n */\nexport function buttonTemplate(props: ButtonTemplateProps): TemplateResult {\n return html`\n <button\n id=\"${props.buttonId}\"\n type=\"${props.type}\"\n ?disabled=\"${props.disabled}\"\n aria-label=\"${props.ariaLabel ?? nothing}\"\n style=\"${props.customPadding ? `padding: ${props.customPadding}` : nothing}\"\n @click=\"${props.handleClick}\"\n class=\"btn\"\n >\n ${props.spotlight ? html`<span class=\"spotlight-layer\" aria-hidden=\"true\"></span>` : nothing}\n <slot name=\"prefix\"></slot>\n <slot></slot>\n <slot name=\"suffix\"></slot>\n </button>\n `;\n}"],"names":[],"mappings":";AAqBO,SAAS,eAAe,OAA4C;AACzE,SAAO;AAAA;AAAA,YAEG,MAAM,QAAQ;AAAA,cACZ,MAAM,IAAI;AAAA,mBACL,MAAM,QAAQ;AAAA,oBACb,MAAM,aAAa,OAAO;AAAA,eAC/B,MAAM,gBAAgB,YAAY,MAAM,aAAa,KAAK,OAAO;AAAA,gBAChE,MAAM,WAAW;AAAA;AAAA;AAAA,QAGzB,MAAM,YAAY,iEAAiE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAMlG;"}