@fewangsit/wangsvue-presets 1.0.81-alpha.0 → 1.0.81-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (299) hide show
  1. package/build.sh +32 -0
  2. package/dev.sh +22 -0
  3. package/dist +13 -0
  4. package/fixedasset/accordion/index.js +75 -0
  5. package/fixedasset/autocomplete/index.js +280 -0
  6. package/fixedasset/avatar/index.js +42 -0
  7. package/fixedasset/avatargroup/index.js +7 -0
  8. package/fixedasset/badge/index.js +54 -0
  9. package/fixedasset/badgedirective/index.js +50 -0
  10. package/fixedasset/badgegroup/index.js +30 -0
  11. package/fixedasset/breadcrumb/index.js +29 -0
  12. package/fixedasset/button/index.js +506 -0
  13. package/fixedasset/buttonbulkaction/index.js +35 -0
  14. package/fixedasset/buttondownload/index.js +12 -0
  15. package/fixedasset/buttonfilter/index.js +12 -0
  16. package/fixedasset/buttonradio/index.js +122 -0
  17. package/fixedasset/buttonsearch/index.js +53 -0
  18. package/fixedasset/calendar/index.js +684 -0
  19. package/fixedasset/card/index.js +32 -0
  20. package/fixedasset/carousel/index.js +134 -0
  21. package/fixedasset/cascadeselect/index.js +219 -0
  22. package/fixedasset/changelog/index.js +29 -0
  23. package/fixedasset/checkbox/index.js +127 -0
  24. package/fixedasset/chip/index.js +45 -0
  25. package/fixedasset/chips/index.js +112 -0
  26. package/fixedasset/colorpicker/index.js +134 -0
  27. package/fixedasset/colors.config.json +77 -0
  28. package/fixedasset/confirmpopup/index.js +122 -0
  29. package/fixedasset/contextmenu/index.js +122 -0
  30. package/fixedasset/datatable/index.js +246 -0
  31. package/fixedasset/dataview/index.js +40 -0
  32. package/fixedasset/dataviewlayoutoptions/index.js +64 -0
  33. package/fixedasset/datepicker/index.js +39 -0
  34. package/fixedasset/daypicker/index.js +38 -0
  35. package/fixedasset/dialog/index.js +249 -0
  36. package/fixedasset/dialogconfirm/index.js +42 -0
  37. package/fixedasset/dialogform/index.js +67 -0
  38. package/fixedasset/divider/index.js +72 -0
  39. package/fixedasset/dock/index.js +97 -0
  40. package/fixedasset/dropdown/index.js +230 -0
  41. package/fixedasset/fieldset/index.js +99 -0
  42. package/fixedasset/fileupload/index.js +23 -0
  43. package/fixedasset/form/index.js +42 -0
  44. package/fixedasset/global.js +87 -0
  45. package/{wangsvue/style.css → fixedasset/icons.css} +849 -5822
  46. package/fixedasset/image/index.js +128 -0
  47. package/fixedasset/index.css +65 -0
  48. package/{wangsvue/index.d.ts → fixedasset/index.js} +211 -190
  49. package/fixedasset/inlinemessage/index.js +26 -0
  50. package/fixedasset/inputbadge/index.js +41 -0
  51. package/fixedasset/inputcurrency/index.js +12 -0
  52. package/fixedasset/inputgroup/index.js +40 -0
  53. package/fixedasset/inputgroupaddon/index.js +34 -0
  54. package/fixedasset/inputmask/index.js +30 -0
  55. package/fixedasset/inputnumber/index.js +50 -0
  56. package/fixedasset/inputotp/index.js +70 -0
  57. package/fixedasset/inputphonenumber/index.js +19 -0
  58. package/fixedasset/inputswitch/index.js +114 -0
  59. package/fixedasset/inputtext/index.js +27 -0
  60. package/fixedasset/knob/index.js +47 -0
  61. package/fixedasset/listbox/index.js +156 -0
  62. package/fixedasset/megamenu/index.js +218 -0
  63. package/fixedasset/menu/index.js +119 -0
  64. package/fixedasset/menubar/index.js +186 -0
  65. package/fixedasset/message/index.js +87 -0
  66. package/fixedasset/multiselect/index.js +360 -0
  67. package/fixedasset/orderlist/index.js +275 -0
  68. package/fixedasset/organizationchart/index.js +143 -0
  69. package/fixedasset/overlaypanel/index.js +36 -0
  70. package/fixedasset/paginator/index.js +547 -0
  71. package/fixedasset/panel/index.js +95 -0
  72. package/fixedasset/panelmenu/index.js +136 -0
  73. package/fixedasset/password/index.js +98 -0
  74. package/fixedasset/picklist/index.js +684 -0
  75. package/fixedasset/progressbar/index.js +112 -0
  76. package/fixedasset/rating/index.js +86 -0
  77. package/fixedasset/ripple/index.js +6 -0
  78. package/fixedasset/scrollpanel/index.js +77 -0
  79. package/fixedasset/scrolltop/index.js +45 -0
  80. package/fixedasset/selectbutton/index.js +59 -0
  81. package/fixedasset/sidebar/index.js +165 -0
  82. package/fixedasset/skeleton/index.js +19 -0
  83. package/fixedasset/slider/index.js +135 -0
  84. package/fixedasset/splitbutton/index.js +957 -0
  85. package/fixedasset/steps/index.js +132 -0
  86. package/fixedasset/tabmenu/index.js +84 -0
  87. package/fixedasset/tabview/index.js +168 -0
  88. package/fixedasset/tag/index.js +37 -0
  89. package/fixedasset/tailwind.config.js +20 -0
  90. package/fixedasset/terminal/index.js +60 -0
  91. package/fixedasset/textarea/index.js +44 -0
  92. package/fixedasset/tieredmenu/index.js +121 -0
  93. package/fixedasset/timeline/index.js +70 -0
  94. package/fixedasset/toast/index.js +97 -0
  95. package/fixedasset/togglebutton/index.js +87 -0
  96. package/fixedasset/toolbar/index.js +30 -0
  97. package/fixedasset/tooltip/index.js +44 -0
  98. package/fixedasset/tree/index.js +298 -0
  99. package/fixedasset/treeselect/index.js +395 -0
  100. package/fixedasset/tristatecheckbox/index.js +128 -0
  101. package/fixedasset/validatormessage/index.js +7 -0
  102. package/fixedasset/workcalendar/index.js +27 -0
  103. package/{index.d.ts → index.ts} +1 -1
  104. package/package.json +2 -2
  105. package/release.sh +7 -0
  106. package/tsconfig.json +14 -0
  107. package/vite.config.ts +17 -0
  108. package/wangsvue/accordion/index.js +75 -70
  109. package/wangsvue/autocomplete/index.js +280 -247
  110. package/wangsvue/avatar/index.js +42 -44
  111. package/wangsvue/avatargroup/index.js +7 -9
  112. package/wangsvue/badge/index.js +54 -60
  113. package/wangsvue/badgedirective/index.js +50 -49
  114. package/wangsvue/badgegroup/index.js +30 -29
  115. package/wangsvue/breadcrumb/index.js +29 -31
  116. package/wangsvue/button/index.js +506 -423
  117. package/wangsvue/buttonbulkaction/index.js +35 -35
  118. package/wangsvue/buttondownload/index.js +12 -13
  119. package/wangsvue/buttonfilter/index.js +12 -13
  120. package/wangsvue/buttonradio/index.js +122 -109
  121. package/wangsvue/buttonsearch/index.js +53 -62
  122. package/wangsvue/calendar/index.js +684 -610
  123. package/wangsvue/card/index.js +32 -32
  124. package/wangsvue/carousel/index.js +134 -129
  125. package/wangsvue/cascadeselect/index.js +219 -191
  126. package/wangsvue/changelog/index.js +29 -31
  127. package/wangsvue/checkbox/index.js +127 -107
  128. package/wangsvue/chip/index.js +45 -40
  129. package/wangsvue/chips/index.js +112 -98
  130. package/wangsvue/colorpicker/index.js +134 -118
  131. package/wangsvue/confirmpopup/index.js +122 -104
  132. package/wangsvue/contextmenu/index.js +122 -113
  133. package/wangsvue/datatable/index.js +246 -253
  134. package/wangsvue/dataview/index.js +40 -36
  135. package/wangsvue/dataviewlayoutoptions/index.js +64 -58
  136. package/wangsvue/datepicker/index.js +39 -0
  137. package/wangsvue/daypicker/index.js +38 -0
  138. package/wangsvue/dialog/index.js +249 -220
  139. package/wangsvue/dialogconfirm/index.js +42 -45
  140. package/wangsvue/dialogform/index.js +67 -68
  141. package/wangsvue/divider/index.js +72 -64
  142. package/wangsvue/dock/index.js +97 -92
  143. package/wangsvue/dropdown/index.js +230 -207
  144. package/wangsvue/fieldset/index.js +99 -87
  145. package/wangsvue/fileupload/index.js +23 -31
  146. package/wangsvue/form/index.js +42 -44
  147. package/wangsvue/global.js +87 -14
  148. package/wangsvue/icons.css +850 -0
  149. package/wangsvue/image/index.js +128 -136
  150. package/wangsvue/index.css +65 -0
  151. package/wangsvue/index.js +211 -201
  152. package/wangsvue/inlinemessage/index.js +26 -30
  153. package/wangsvue/inputbadge/index.js +41 -57
  154. package/wangsvue/inputcurrency/index.js +12 -22
  155. package/wangsvue/inputgroup/index.js +40 -37
  156. package/wangsvue/inputgroupaddon/index.js +34 -34
  157. package/wangsvue/inputmask/index.js +30 -29
  158. package/wangsvue/inputnumber/index.js +50 -58
  159. package/wangsvue/inputotp/index.js +70 -63
  160. package/wangsvue/inputphonenumber/index.js +19 -34
  161. package/wangsvue/inputswitch/index.js +114 -100
  162. package/wangsvue/inputtext/index.js +27 -28
  163. package/wangsvue/knob/index.js +47 -45
  164. package/wangsvue/listbox/index.js +156 -138
  165. package/wangsvue/megamenu/index.js +218 -202
  166. package/wangsvue/menu/index.js +119 -110
  167. package/wangsvue/menubar/index.js +186 -172
  168. package/wangsvue/message/index.js +87 -85
  169. package/wangsvue/multiselect/index.js +360 -328
  170. package/wangsvue/orderlist/index.js +275 -245
  171. package/wangsvue/organizationchart/index.js +143 -129
  172. package/wangsvue/overlaypanel/index.js +36 -34
  173. package/wangsvue/paginator/index.js +547 -474
  174. package/wangsvue/panel/index.js +95 -85
  175. package/wangsvue/panelmenu/index.js +136 -124
  176. package/wangsvue/password/index.js +98 -96
  177. package/wangsvue/picklist/index.js +684 -613
  178. package/wangsvue/progressbar/index.js +112 -102
  179. package/wangsvue/rating/index.js +86 -88
  180. package/wangsvue/ripple/index.js +6 -8
  181. package/wangsvue/scrollpanel/index.js +77 -62
  182. package/wangsvue/scrolltop/index.js +45 -42
  183. package/wangsvue/selectbutton/index.js +59 -60
  184. package/wangsvue/sidebar/index.js +165 -145
  185. package/wangsvue/skeleton/index.js +19 -22
  186. package/wangsvue/slider/index.js +135 -126
  187. package/wangsvue/splitbutton/index.js +957 -786
  188. package/wangsvue/steps/index.js +132 -119
  189. package/wangsvue/tabmenu/index.js +84 -75
  190. package/wangsvue/tabview/index.js +168 -148
  191. package/wangsvue/tag/index.js +37 -37
  192. package/wangsvue/tailwind.config.js +20 -0
  193. package/wangsvue/terminal/index.js +60 -55
  194. package/wangsvue/textarea/index.js +44 -51
  195. package/wangsvue/tieredmenu/index.js +121 -108
  196. package/wangsvue/timeline/index.js +70 -83
  197. package/wangsvue/toast/index.js +97 -95
  198. package/wangsvue/togglebutton/index.js +87 -77
  199. package/wangsvue/toolbar/index.js +30 -29
  200. package/wangsvue/tooltip/index.js +44 -42
  201. package/wangsvue/tree/index.js +298 -256
  202. package/wangsvue/treeselect/index.js +395 -338
  203. package/wangsvue/tristatecheckbox/index.js +128 -106
  204. package/wangsvue/validatormessage/index.js +7 -9
  205. package/wangsvue/workcalendar/index.js +27 -36
  206. package/index.js +0 -5
  207. package/wangsvue/accordion/index.d.ts +0 -37
  208. package/wangsvue/autocomplete/index.d.ts +0 -188
  209. package/wangsvue/avatar/index.d.ts +0 -85
  210. package/wangsvue/avatargroup/index.d.ts +0 -8
  211. package/wangsvue/badge/index.d.ts +0 -47
  212. package/wangsvue/badgedirective/index.d.ts +0 -50
  213. package/wangsvue/badgegroup/index.d.ts +0 -45
  214. package/wangsvue/breadcrumb/index.d.ts +0 -25
  215. package/wangsvue/button/index.d.ts +0 -46
  216. package/wangsvue/buttonbulkaction/index.d.ts +0 -32
  217. package/wangsvue/buttondownload/index.d.ts +0 -12
  218. package/wangsvue/buttonfilter/index.d.ts +0 -12
  219. package/wangsvue/buttonradio/index.d.ts +0 -58
  220. package/wangsvue/buttonsearch/index.d.ts +0 -65
  221. package/wangsvue/calendar/index.d.ts +0 -267
  222. package/wangsvue/card/index.d.ts +0 -31
  223. package/wangsvue/carousel/index.d.ts +0 -57
  224. package/wangsvue/cascadeselect/index.d.ts +0 -82
  225. package/wangsvue/changelog/index.d.ts +0 -32
  226. package/wangsvue/checkbox/index.d.ts +0 -81
  227. package/wangsvue/chip/index.d.ts +0 -23
  228. package/wangsvue/chips/index.d.ts +0 -38
  229. package/wangsvue/colorpicker/index.d.ts +0 -51
  230. package/wangsvue/confirmpopup/index.d.ts +0 -39
  231. package/wangsvue/contextmenu/index.d.ts +0 -63
  232. package/wangsvue/datatable/index.d.ts +0 -286
  233. package/wangsvue/dataview/index.d.ts +0 -15
  234. package/wangsvue/dataviewlayoutoptions/index.d.ts +0 -13
  235. package/wangsvue/dialog/index.d.ts +0 -87
  236. package/wangsvue/dialogconfirm/index.d.ts +0 -42
  237. package/wangsvue/dialogform/index.d.ts +0 -71
  238. package/wangsvue/divider/index.d.ts +0 -192
  239. package/wangsvue/dock/index.d.ts +0 -51
  240. package/wangsvue/dropdown/index.d.ts +0 -136
  241. package/wangsvue/fieldset/index.d.ts +0 -94
  242. package/wangsvue/fileupload/index.d.ts +0 -29
  243. package/wangsvue/form/index.d.ts +0 -40
  244. package/wangsvue/global.d.ts +0 -8
  245. package/wangsvue/image/index.d.ts +0 -88
  246. package/wangsvue/index.system.js +0 -76
  247. package/wangsvue/inlinemessage/index.d.ts +0 -20
  248. package/wangsvue/inputbadge/index.d.ts +0 -57
  249. package/wangsvue/inputcurrency/index.d.ts +0 -27
  250. package/wangsvue/inputgroup/index.d.ts +0 -9
  251. package/wangsvue/inputgroupaddon/index.d.ts +0 -17
  252. package/wangsvue/inputmask/index.d.ts +0 -11
  253. package/wangsvue/inputnumber/index.d.ts +0 -46
  254. package/wangsvue/inputotp/index.d.ts +0 -137
  255. package/wangsvue/inputphonenumber/index.d.ts +0 -37
  256. package/wangsvue/inputswitch/index.d.ts +0 -67
  257. package/wangsvue/inputtext/index.d.ts +0 -18
  258. package/wangsvue/knob/index.d.ts +0 -22
  259. package/wangsvue/listbox/index.d.ts +0 -79
  260. package/wangsvue/megamenu/index.d.ts +0 -105
  261. package/wangsvue/menu/index.d.ts +0 -49
  262. package/wangsvue/menubar/index.d.ts +0 -85
  263. package/wangsvue/message/index.d.ts +0 -41
  264. package/wangsvue/multiselect/index.d.ts +0 -243
  265. package/wangsvue/orderlist/index.d.ts +0 -99
  266. package/wangsvue/organizationchart/index.d.ts +0 -71
  267. package/wangsvue/overlaypanel/index.d.ts +0 -17
  268. package/wangsvue/paginator/index.d.ts +0 -210
  269. package/wangsvue/panel/index.d.ts +0 -43
  270. package/wangsvue/panelmenu/index.d.ts +0 -76
  271. package/wangsvue/password/index.d.ts +0 -45
  272. package/wangsvue/picklist/index.d.ts +0 -245
  273. package/wangsvue/progressbar/index.d.ts +0 -117
  274. package/wangsvue/rating/index.d.ts +0 -47
  275. package/wangsvue/ripple/index.d.ts +0 -8
  276. package/wangsvue/scrollpanel/index.d.ts +0 -19
  277. package/wangsvue/scrolltop/index.d.ts +0 -50
  278. package/wangsvue/selectbutton/index.d.ts +0 -35
  279. package/wangsvue/sidebar/index.d.ts +0 -66
  280. package/wangsvue/skeleton/index.d.ts +0 -16
  281. package/wangsvue/slider/index.d.ts +0 -55
  282. package/wangsvue/splitbutton/index.d.ts +0 -6690
  283. package/wangsvue/steps/index.d.ts +0 -108
  284. package/wangsvue/tabmenu/index.d.ts +0 -57
  285. package/wangsvue/tabview/index.d.ts +0 -67
  286. package/wangsvue/tag/index.d.ts +0 -32
  287. package/wangsvue/terminal/index.d.ts +0 -27
  288. package/wangsvue/textarea/index.d.ts +0 -12
  289. package/wangsvue/tieredmenu/index.d.ts +0 -56
  290. package/wangsvue/timeline/index.d.ts +0 -53
  291. package/wangsvue/toast/index.d.ts +0 -61
  292. package/wangsvue/togglebutton/index.d.ts +0 -42
  293. package/wangsvue/toolbar/index.d.ts +0 -19
  294. package/wangsvue/tooltip/index.d.ts +0 -22
  295. package/wangsvue/tree/index.d.ts +0 -117
  296. package/wangsvue/treeselect/index.d.ts +0 -158
  297. package/wangsvue/tristatecheckbox/index.d.ts +0 -49
  298. package/wangsvue/validatormessage/index.d.ts +0 -8
  299. package/wangsvue/workcalendar/index.d.ts +0 -27
@@ -1,423 +1,506 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- root: function (_a) {
5
- var props = _a.props, context = _a.context;
6
- return ({
7
- class: [
8
- 'relative',
9
- // Alignments
10
- 'items-center inline-flex text-center align-bottom justify-center',
11
- {
12
- 'flex-col': (props.iconPos === 'top' || props.iconPos === 'bottom') &&
13
- props.label,
14
- },
15
- props.iconPos,
16
- {
17
- 'flex-row-reverse': props.iconPos === 'right',
18
- },
19
- // Sizes & Spacing
20
- 'leading-none font-normal rounded-[50px]',
21
- {
22
- '!text-xs px-3 py-[5px]': props.size === null && props.label,
23
- '!text-xs !p-0.5': props.size === 'small',
24
- 'text-xl py-3 px-4': props.size === 'large',
25
- },
26
- { 'gap-1': props.label !== null },
27
- {
28
- 'p-[7px] w-max': props.label === null && props.icon && props.size === null,
29
- },
30
- {
31
- '!p-0.5 !h-4 !w-4': props.label === null && props.icon && props.size === 'small',
32
- },
33
- // Ring
34
- 'ring-inset ring-1 ',
35
- // Shapes
36
- { 'shadow-lg': props.raised },
37
- // Link Button
38
- {
39
- 'text-grayscale-900-600 bg-transparent ring-transparent': props.link,
40
- },
41
- // Plain Button
42
- {
43
- 'text-white bg-gray-500 ring-1 ring-gray-500': props.plain && !props.outlined && !props.text,
44
- },
45
- // Plain Text Button
46
- { 'text-primary-400': props.plain && props.text },
47
- // Plain Outlined Button
48
- {
49
- 'text-primary-400 ring-1 ring-gray-500': props.plain && props.outlined,
50
- },
51
- // Text Button
52
- { 'bg-transparent ring-transparent': props.text && !props.plain },
53
- // Outlined Button
54
- { 'bg-transparent ring-1': props.outlined && !props.plain },
55
- // --- Severity Buttons ---
56
- // Secondary Button
57
- {
58
- 'text-white': !props.link &&
59
- props.severity === 'secondary' &&
60
- !props.text &&
61
- !props.outlined &&
62
- !props.plain,
63
- 'bg-grayscale-900': !props.link &&
64
- props.severity === 'secondary' &&
65
- !props.text &&
66
- !props.outlined &&
67
- !props.plain,
68
- 'ring-1 ring-grayscale-900': !props.link &&
69
- props.severity === 'secondary' &&
70
- !props.text &&
71
- !props.outlined &&
72
- !props.plain,
73
- },
74
- // Secondary Text Button
75
- {
76
- 'text-grayscale-900': props.text && props.severity === 'secondary' && !props.plain,
77
- },
78
- // Secondary Outlined Button
79
- {
80
- 'text-grayscale-900 ring-1 ring-grayscale-900': props.outlined && props.severity === 'secondary' && !props.plain,
81
- },
82
- // Primary Gold Button
83
- {
84
- 'text-white': props.severity === null &&
85
- !props.text &&
86
- !props.outlined &&
87
- !props.plain,
88
- 'bg-primary-400': props.severity === null &&
89
- !props.text &&
90
- !props.outlined &&
91
- !props.plain,
92
- 'ring-1 ring-primary-400': props.severity === null &&
93
- !props.text &&
94
- !props.outlined &&
95
- !props.plain,
96
- },
97
- // Primary Gold Text Button
98
- {
99
- 'text-primary-400': props.text && props.severity === null && !props.plain,
100
- },
101
- // Primary Gold Outlined Button
102
- {
103
- 'text-primary-400 ring-1 ring-primary-400 hover:bg-primary-400/20': props.outlined && props.severity === null && !props.plain,
104
- },
105
- // Success Button
106
- {
107
- 'text-white': props.severity === 'success' &&
108
- !props.text &&
109
- !props.outlined &&
110
- !props.plain,
111
- 'bg-success-500': props.severity === 'success' &&
112
- !props.text &&
113
- !props.outlined &&
114
- !props.plain,
115
- 'ring-1 ring-success-500': props.severity === 'success' &&
116
- !props.text &&
117
- !props.outlined &&
118
- !props.plain,
119
- },
120
- // Success Text Button
121
- {
122
- 'text-success-500': props.text && props.severity === 'success' && !props.plain,
123
- },
124
- // Success Outlined Button
125
- {
126
- 'text-success-500 ring-1 ring-success-500 hover:bg-success-300/20': props.outlined && props.severity === 'success' && !props.plain,
127
- },
128
- // Info Button
129
- {
130
- 'text-white': props.severity === 'info' &&
131
- !props.text &&
132
- !props.outlined &&
133
- !props.plain,
134
- 'bg-blue-500': props.severity === 'info' &&
135
- !props.text &&
136
- !props.outlined &&
137
- !props.plain,
138
- 'ring-1 ring-blue-500': props.severity === 'info' &&
139
- !props.text &&
140
- !props.outlined &&
141
- !props.plain,
142
- },
143
- // Info Text Button
144
- {
145
- 'text-blue-500': props.text && props.severity === 'info' && !props.plain,
146
- },
147
- // Info Outlined Button
148
- {
149
- 'text-blue-500 ring-1 ring-blue-500 hover:bg-blue-300/20 ': props.outlined && props.severity === 'info' && !props.plain,
150
- },
151
- // Warning Button
152
- {
153
- 'text-white': props.severity === 'warning' &&
154
- !props.text &&
155
- !props.outlined &&
156
- !props.plain,
157
- 'bg-warning-500': props.severity === 'warning' &&
158
- !props.text &&
159
- !props.outlined &&
160
- !props.plain,
161
- 'ring-1 ring-warning-500': props.severity === 'warning' &&
162
- !props.text &&
163
- !props.outlined &&
164
- !props.plain,
165
- },
166
- // Warning Text Button
167
- {
168
- 'text-warning-500': props.text && props.severity === 'warning' && !props.plain,
169
- },
170
- // Warning Outlined Button
171
- {
172
- 'text-warning-500 ring-1 ring-warning-500 hover:bg-warning-300/20': props.outlined && props.severity === 'warning' && !props.plain,
173
- },
174
- // Help Button
175
- {
176
- 'text-white': props.severity === 'help' &&
177
- !props.text &&
178
- !props.outlined &&
179
- !props.plain,
180
- 'bg-purple-500': props.severity === 'help' &&
181
- !props.text &&
182
- !props.outlined &&
183
- !props.plain,
184
- 'ring-1 ring-purple-500': props.severity === 'help' &&
185
- !props.text &&
186
- !props.outlined &&
187
- !props.plain,
188
- },
189
- // Help Text Button
190
- {
191
- 'text-purple-500': props.text && props.severity === 'help' && !props.plain,
192
- },
193
- // Help Outlined Button
194
- {
195
- 'text-purple-500 ring-1 ring-purple-500 hover:bg-purple-300/20': props.outlined && props.severity === 'help' && !props.plain,
196
- },
197
- // Danger Button
198
- {
199
- 'text-white': props.severity === 'danger' &&
200
- !props.text &&
201
- !props.outlined &&
202
- !props.plain,
203
- 'bg-danger-500': props.severity === 'danger' &&
204
- !props.text &&
205
- !props.outlined &&
206
- !props.plain,
207
- 'ring-1 ring-danger-500': props.severity === 'danger' &&
208
- !props.text &&
209
- !props.outlined &&
210
- !props.plain,
211
- },
212
- // Danger Text Button
213
- {
214
- 'text-danger-500': props.text && props.severity === 'danger' && !props.plain,
215
- },
216
- // Danger Outlined Button
217
- {
218
- 'text-danger-500 ring-1 ring-danger-500 hover:bg-danger-300/20': props.outlined && props.severity === 'danger' && !props.plain,
219
- },
220
- // Contrast Button
221
- {
222
- 'text-white': props.severity === 'contrast' &&
223
- !props.text &&
224
- !props.outlined &&
225
- !props.plain,
226
- 'bg-surface-900': props.severity === 'contrast' &&
227
- !props.text &&
228
- !props.outlined &&
229
- !props.plain,
230
- 'ring-1 ring-surface-900': props.severity === 'contrast' &&
231
- !props.text &&
232
- !props.outlined &&
233
- !props.plain,
234
- },
235
- // Contrast Text Button
236
- {
237
- 'text-surface-900': props.text && props.severity === 'contrast' && !props.plain,
238
- },
239
- // Contrast Outlined Button
240
- {
241
- 'text-surface-900 ring-1 ring-surface-900': props.outlined && props.severity === 'contrast' && !props.plain,
242
- },
243
- // --- Severity Button States ---
244
- 'focus:outline-none focus:outline-offset-0',
245
- // Link
246
- { 'focus:ring-grayscale-900': props.link },
247
- // Plain
248
- {
249
- 'hover:bg-gray-600 hover:ring-gray-600': props.plain && !props.outlined && !props.text,
250
- },
251
- // Text & Outlined Button
252
- {
253
- 'hover:bg-primary-400/20': props.plain && (props.text || props.outlined),
254
- },
255
- // Secondary
256
- {
257
- 'hover:bg-grayscale-900/[8%] active:bg-grayscale-900/[12%] ': props.severity === 'secondary',
258
- 'hover:shadow-hover active:!shadow-none hover:!bg-grayscale-900/90 active:bg-grayscale-900/90 hover:ring-0': !props.link &&
259
- props.severity === 'secondary' &&
260
- !props.text &&
261
- !props.outlined &&
262
- !props.plain,
263
- },
264
- // Primary
265
- {
266
- 'hover:bg-primary-400/[8%] active:bg-primary-400/[12%] ': props.severity === null,
267
- 'hover:shadow-hover active:!shadow-none hover:!bg-primary-400/90 active:bg-primary-400/90 hover:ring-0': !props.link &&
268
- props.severity === null &&
269
- !props.text &&
270
- !props.outlined &&
271
- !context.disabled &&
272
- !props.plain,
273
- },
274
- // Success
275
- {
276
- 'hover:bg-success-500/[8%] active:bg-success-500/[12%] ': props.severity === 'success',
277
- 'hover:shadow-hover active:!shadow-none hover:!bg-success-500/90 active:bg-success-500/90 hover:ring-0': !props.link &&
278
- props.severity === 'success' &&
279
- !props.text &&
280
- !props.outlined &&
281
- !props.plain,
282
- },
283
- // Info
284
- {
285
- 'hover:bg-blue-600 hover:ring-blue-600': props.severity === 'info' &&
286
- !props.text &&
287
- !props.outlined &&
288
- !props.plain,
289
- },
290
- {
291
- 'focus:ring-blue-400/50': props.severity === 'info',
292
- },
293
- // Text & Outlined Button
294
- {
295
- 'hover:bg-blue-300/20': (props.text || props.outlined) &&
296
- props.severity === 'info' &&
297
- !props.plain,
298
- },
299
- // Warning
300
- {
301
- 'hover:bg-warning-500/[8%] active:bg-warning-500/[12%] ': props.severity === 'warning',
302
- 'hover:shadow-hover active:!shadow-none hover:!bg-warning-500/90 active:bg-warning-500/90 hover:ring-0': !props.link &&
303
- props.severity === 'warning' &&
304
- !props.text &&
305
- !props.outlined &&
306
- !props.plain,
307
- },
308
- // Text & Outlined Button
309
- {
310
- 'hover:bg-warning-300/20': (props.text || props.outlined) &&
311
- props.severity === 'warning' &&
312
- !props.plain,
313
- },
314
- // Help
315
- {
316
- 'hover:bg-purple-600 hover:ring-purple-600': props.severity === 'help' &&
317
- !props.text &&
318
- !props.outlined &&
319
- !props.plain,
320
- },
321
- {
322
- 'focus:ring-purple-400/50': props.severity === 'help',
323
- },
324
- // Text & Outlined Button
325
- {
326
- 'hover:bg-purple-300/20': (props.text || props.outlined) &&
327
- props.severity === 'help' &&
328
- !props.plain,
329
- },
330
- // Danger
331
- {
332
- 'hover:bg-danger-500/[8%] active:bg-danger-500/[12%] ': props.severity === 'danger',
333
- 'hover:shadow-hover active:!shadow-none hover:!bg-danger-500/90 active:bg-danger-500/90 hover:ring-0': !props.link &&
334
- props.severity === 'danger' &&
335
- !props.text &&
336
- !props.outlined &&
337
- !props.plain,
338
- },
339
- // Text & Outlined Button
340
- {
341
- 'hover:bg-danger-300/20': (props.text || props.outlined) &&
342
- props.severity === 'danger' &&
343
- !props.plain,
344
- },
345
- // Contrast
346
- {
347
- 'hover:bg-surface-800 hover:ring-surface-800': props.severity === 'contrast' &&
348
- !props.text &&
349
- !props.outlined &&
350
- !props.plain,
351
- },
352
- {
353
- 'focus:ring-primary-400': props.severity === 'contrast',
354
- },
355
- // Text & Outlined Button
356
- {
357
- 'hover:bg-surface-900/10': (props.text || props.outlined) &&
358
- props.severity === 'contrast' &&
359
- !props.plain,
360
- },
361
- // Disabled
362
- {
363
- 'pointer-events-none cursor-default': context.disabled,
364
- '!text-general-300': context.disabled && (props.outlined || props.text),
365
- '!ring-general-300': context.disabled && props.outlined,
366
- '!bg-general-300 !text-white !ring-0': context.disabled && !props.outlined && !props.text,
367
- },
368
- // Transitions
369
- 'transition duration-200 ease-in-out',
370
- // Misc
371
- 'cursor-pointer overflow-hidden select-none',
372
- // Badge
373
- '[&>[data-pc-name=badge]]:min-w-4 [&>[data-pc-name=badge]]:h-4 [&>[data-pc-name=badge]]:leading-4',
374
- ],
375
- });
376
- },
377
- label: function (_a) {
378
- var props = _a.props;
379
- return ({
380
- class: [
381
- 'duration-200',
382
- 'font-normal text-xs',
383
- props.label ? 'leading-5' : 'leading-4',
384
- {
385
- 'hover:underline': props.link,
386
- },
387
- { 'flex-1': props.label !== null, 'invisible w-0': props.label == null },
388
- ],
389
- });
390
- },
391
- icon: function (_a) {
392
- var props = _a.props;
393
- return ({
394
- class: ['shrink-0', { '!h-[11px] !w-[11px]': props.size === 'small' }],
395
- });
396
- },
397
- loadingIcon: function (_a) {
398
- var props = _a.props;
399
- return ({
400
- class: [
401
- 'h-4 w-4',
402
- 'mx-0',
403
- {
404
- 'mr-2': props.iconPos === 'left' && props.label != null,
405
- 'ml-2 order-1': props.iconPos === 'right' && props.label != null,
406
- 'mb-2': props.iconPos === 'top' && props.label != null,
407
- 'mt-2': props.iconPos === 'bottom' && props.label != null,
408
- },
409
- 'animate-spin',
410
- ],
411
- });
412
- },
413
- badge: function (_a) {
414
- var props = _a.props;
415
- return ({
416
- class: [
417
- {
418
- 'ml-2 w-4 h-4 leading-none flex items-center justify-center': props.badge,
419
- },
420
- ],
421
- });
422
- },
423
- };
1
+ export default {
2
+ root: ({ props, context }) => ({
3
+ class: [
4
+ 'relative',
5
+
6
+ // Alignments
7
+ 'items-center inline-flex text-center align-bottom justify-center',
8
+ {
9
+ 'flex-col':
10
+ (props.iconPos === 'top' || props.iconPos === 'bottom') &&
11
+ props.label,
12
+ },
13
+
14
+ props.iconPos,
15
+ {
16
+ 'flex-row-reverse': props.iconPos === 'right',
17
+ },
18
+
19
+ // Sizes & Spacing
20
+ 'leading-none font-normal rounded-[50px]',
21
+ {
22
+ '!text-xs px-3 py-[5px]': props.size === null && props.label,
23
+ '!text-xs !p-0.5': props.size === 'small',
24
+ 'text-xl py-3 px-4': props.size === 'large',
25
+ },
26
+ { 'gap-1': props.label !== null },
27
+
28
+ {
29
+ 'p-[7px] w-max':
30
+ props.label === null && props.icon && props.size === null,
31
+ },
32
+ {
33
+ '!p-0.5 !h-4 !w-4':
34
+ props.label === null && props.icon && props.size === 'small',
35
+ },
36
+
37
+ // Ring
38
+ 'ring-inset ring-1 ',
39
+
40
+ // Shapes
41
+ { 'shadow-lg': props.raised },
42
+
43
+ // Link Button
44
+ {
45
+ 'text-grayscale-900-600 bg-transparent ring-transparent': props.link,
46
+ },
47
+
48
+ // Plain Button
49
+ {
50
+ 'text-white bg-gray-500 ring-1 ring-gray-500':
51
+ props.plain && !props.outlined && !props.text,
52
+ },
53
+ // Plain Text Button
54
+ { 'text-primary-400': props.plain && props.text },
55
+ // Plain Outlined Button
56
+ {
57
+ 'text-primary-400 ring-1 ring-gray-500': props.plain && props.outlined,
58
+ },
59
+
60
+ // Text Button
61
+ { 'bg-transparent ring-transparent': props.text && !props.plain },
62
+
63
+ // Outlined Button
64
+ { 'bg-transparent ring-1': props.outlined && !props.plain },
65
+
66
+ // --- Severity Buttons ---
67
+
68
+ // Secondary Button
69
+ {
70
+ 'text-white':
71
+ !props.link &&
72
+ props.severity === 'secondary' &&
73
+ !props.text &&
74
+ !props.outlined &&
75
+ !props.plain,
76
+ 'bg-grayscale-900':
77
+ !props.link &&
78
+ props.severity === 'secondary' &&
79
+ !props.text &&
80
+ !props.outlined &&
81
+ !props.plain,
82
+ 'ring-1 ring-grayscale-900':
83
+ !props.link &&
84
+ props.severity === 'secondary' &&
85
+ !props.text &&
86
+ !props.outlined &&
87
+ !props.plain,
88
+ },
89
+ // Secondary Text Button
90
+ {
91
+ 'text-grayscale-900':
92
+ props.text && props.severity === 'secondary' && !props.plain,
93
+ },
94
+ // Secondary Outlined Button
95
+ {
96
+ 'text-grayscale-900 ring-1 ring-grayscale-900':
97
+ props.outlined && props.severity === 'secondary' && !props.plain,
98
+ },
99
+
100
+ // Primary Gold Button
101
+ {
102
+ 'text-white':
103
+ props.severity === null &&
104
+ !props.text &&
105
+ !props.outlined &&
106
+ !props.plain,
107
+ 'bg-primary-400':
108
+ props.severity === null &&
109
+ !props.text &&
110
+ !props.outlined &&
111
+ !props.plain,
112
+ 'ring-1 ring-primary-400':
113
+ props.severity === null &&
114
+ !props.text &&
115
+ !props.outlined &&
116
+ !props.plain,
117
+ },
118
+ // Primary Gold Text Button
119
+ {
120
+ 'text-primary-400':
121
+ props.text && props.severity === null && !props.plain,
122
+ },
123
+ // Primary Gold Outlined Button
124
+ {
125
+ 'text-primary-400 ring-1 ring-primary-400 hover:bg-primary-400/20':
126
+ props.outlined && props.severity === null && !props.plain,
127
+ },
128
+
129
+ // Success Button
130
+ {
131
+ 'text-white':
132
+ props.severity === 'success' &&
133
+ !props.text &&
134
+ !props.outlined &&
135
+ !props.plain,
136
+ 'bg-success-500':
137
+ props.severity === 'success' &&
138
+ !props.text &&
139
+ !props.outlined &&
140
+ !props.plain,
141
+ 'ring-1 ring-success-500':
142
+ props.severity === 'success' &&
143
+ !props.text &&
144
+ !props.outlined &&
145
+ !props.plain,
146
+ },
147
+ // Success Text Button
148
+ {
149
+ 'text-success-500':
150
+ props.text && props.severity === 'success' && !props.plain,
151
+ },
152
+ // Success Outlined Button
153
+ {
154
+ 'text-success-500 ring-1 ring-success-500 hover:bg-success-300/20':
155
+ props.outlined && props.severity === 'success' && !props.plain,
156
+ },
157
+
158
+ // Info Button
159
+ {
160
+ 'text-white':
161
+ props.severity === 'info' &&
162
+ !props.text &&
163
+ !props.outlined &&
164
+ !props.plain,
165
+ 'bg-blue-500':
166
+ props.severity === 'info' &&
167
+ !props.text &&
168
+ !props.outlined &&
169
+ !props.plain,
170
+ 'ring-1 ring-blue-500':
171
+ props.severity === 'info' &&
172
+ !props.text &&
173
+ !props.outlined &&
174
+ !props.plain,
175
+ },
176
+ // Info Text Button
177
+ {
178
+ 'text-blue-500':
179
+ props.text && props.severity === 'info' && !props.plain,
180
+ },
181
+ // Info Outlined Button
182
+ {
183
+ 'text-blue-500 ring-1 ring-blue-500 hover:bg-blue-300/20 ':
184
+ props.outlined && props.severity === 'info' && !props.plain,
185
+ },
186
+
187
+ // Warning Button
188
+ {
189
+ 'text-white':
190
+ props.severity === 'warning' &&
191
+ !props.text &&
192
+ !props.outlined &&
193
+ !props.plain,
194
+ 'bg-warning-500':
195
+ props.severity === 'warning' &&
196
+ !props.text &&
197
+ !props.outlined &&
198
+ !props.plain,
199
+ 'ring-1 ring-warning-500':
200
+ props.severity === 'warning' &&
201
+ !props.text &&
202
+ !props.outlined &&
203
+ !props.plain,
204
+ },
205
+ // Warning Text Button
206
+ {
207
+ 'text-warning-500':
208
+ props.text && props.severity === 'warning' && !props.plain,
209
+ },
210
+ // Warning Outlined Button
211
+ {
212
+ 'text-warning-500 ring-1 ring-warning-500 hover:bg-warning-300/20':
213
+ props.outlined && props.severity === 'warning' && !props.plain,
214
+ },
215
+
216
+ // Help Button
217
+ {
218
+ 'text-white':
219
+ props.severity === 'help' &&
220
+ !props.text &&
221
+ !props.outlined &&
222
+ !props.plain,
223
+ 'bg-purple-500':
224
+ props.severity === 'help' &&
225
+ !props.text &&
226
+ !props.outlined &&
227
+ !props.plain,
228
+ 'ring-1 ring-purple-500':
229
+ props.severity === 'help' &&
230
+ !props.text &&
231
+ !props.outlined &&
232
+ !props.plain,
233
+ },
234
+ // Help Text Button
235
+ {
236
+ 'text-purple-500':
237
+ props.text && props.severity === 'help' && !props.plain,
238
+ },
239
+ // Help Outlined Button
240
+ {
241
+ 'text-purple-500 ring-1 ring-purple-500 hover:bg-purple-300/20':
242
+ props.outlined && props.severity === 'help' && !props.plain,
243
+ },
244
+
245
+ // Danger Button
246
+ {
247
+ 'text-white':
248
+ props.severity === 'danger' &&
249
+ !props.text &&
250
+ !props.outlined &&
251
+ !props.plain,
252
+ 'bg-danger-500':
253
+ props.severity === 'danger' &&
254
+ !props.text &&
255
+ !props.outlined &&
256
+ !props.plain,
257
+ 'ring-1 ring-danger-500':
258
+ props.severity === 'danger' &&
259
+ !props.text &&
260
+ !props.outlined &&
261
+ !props.plain,
262
+ },
263
+ // Danger Text Button
264
+ {
265
+ 'text-danger-500':
266
+ props.text && props.severity === 'danger' && !props.plain,
267
+ },
268
+ // Danger Outlined Button
269
+ {
270
+ 'text-danger-500 ring-1 ring-danger-500 hover:bg-danger-300/20':
271
+ props.outlined && props.severity === 'danger' && !props.plain,
272
+ },
273
+ // Contrast Button
274
+ {
275
+ 'text-white':
276
+ props.severity === 'contrast' &&
277
+ !props.text &&
278
+ !props.outlined &&
279
+ !props.plain,
280
+ 'bg-surface-900':
281
+ props.severity === 'contrast' &&
282
+ !props.text &&
283
+ !props.outlined &&
284
+ !props.plain,
285
+ 'ring-1 ring-surface-900':
286
+ props.severity === 'contrast' &&
287
+ !props.text &&
288
+ !props.outlined &&
289
+ !props.plain,
290
+ },
291
+ // Contrast Text Button
292
+ {
293
+ 'text-surface-900':
294
+ props.text && props.severity === 'contrast' && !props.plain,
295
+ },
296
+ // Contrast Outlined Button
297
+ {
298
+ 'text-surface-900 ring-1 ring-surface-900':
299
+ props.outlined && props.severity === 'contrast' && !props.plain,
300
+ },
301
+
302
+ // --- Severity Button States ---
303
+ 'focus:outline-none focus:outline-offset-0',
304
+
305
+ // Link
306
+ { 'focus:ring-grayscale-900': props.link },
307
+
308
+ // Plain
309
+ {
310
+ 'hover:bg-gray-600 hover:ring-gray-600':
311
+ props.plain && !props.outlined && !props.text,
312
+ },
313
+ // Text & Outlined Button
314
+ {
315
+ 'hover:bg-primary-400/20':
316
+ props.plain && (props.text || props.outlined),
317
+ },
318
+
319
+ // Secondary
320
+ {
321
+ 'hover:bg-grayscale-900/[8%] active:bg-grayscale-900/[12%] ':
322
+ props.severity === 'secondary',
323
+ 'hover:shadow-hover active:!shadow-none hover:!bg-grayscale-900/90 active:bg-grayscale-900/90 hover:ring-0':
324
+ !props.link &&
325
+ props.severity === 'secondary' &&
326
+ !props.text &&
327
+ !props.outlined &&
328
+ !props.plain,
329
+ },
330
+
331
+ // Primary
332
+ {
333
+ 'hover:bg-primary-400/[8%] active:bg-primary-400/[12%] ':
334
+ props.severity === null,
335
+ 'hover:shadow-hover active:!shadow-none hover:!bg-primary-400/90 active:bg-primary-400/90 hover:ring-0':
336
+ !props.link &&
337
+ props.severity === null &&
338
+ !props.text &&
339
+ !props.outlined &&
340
+ !context.disabled &&
341
+ !props.plain,
342
+ },
343
+
344
+ // Success
345
+ {
346
+ 'hover:bg-success-500/[8%] active:bg-success-500/[12%] ':
347
+ props.severity === 'success',
348
+ 'hover:shadow-hover active:!shadow-none hover:!bg-success-500/90 active:bg-success-500/90 hover:ring-0':
349
+ !props.link &&
350
+ props.severity === 'success' &&
351
+ !props.text &&
352
+ !props.outlined &&
353
+ !props.plain,
354
+ },
355
+
356
+ // Info
357
+ {
358
+ 'hover:bg-blue-600 hover:ring-blue-600':
359
+ props.severity === 'info' &&
360
+ !props.text &&
361
+ !props.outlined &&
362
+ !props.plain,
363
+ },
364
+ {
365
+ 'focus:ring-blue-400/50': props.severity === 'info',
366
+ },
367
+ // Text & Outlined Button
368
+ {
369
+ 'hover:bg-blue-300/20':
370
+ (props.text || props.outlined) &&
371
+ props.severity === 'info' &&
372
+ !props.plain,
373
+ },
374
+
375
+ // Warning
376
+ {
377
+ 'hover:bg-warning-500/[8%] active:bg-warning-500/[12%] ':
378
+ props.severity === 'warning',
379
+
380
+ 'hover:shadow-hover active:!shadow-none hover:!bg-warning-500/90 active:bg-warning-500/90 hover:ring-0':
381
+ !props.link &&
382
+ props.severity === 'warning' &&
383
+ !props.text &&
384
+ !props.outlined &&
385
+ !props.plain,
386
+ },
387
+
388
+ // Text & Outlined Button
389
+ {
390
+ 'hover:bg-warning-300/20':
391
+ (props.text || props.outlined) &&
392
+ props.severity === 'warning' &&
393
+ !props.plain,
394
+ },
395
+
396
+ // Help
397
+ {
398
+ 'hover:bg-purple-600 hover:ring-purple-600':
399
+ props.severity === 'help' &&
400
+ !props.text &&
401
+ !props.outlined &&
402
+ !props.plain,
403
+ },
404
+ {
405
+ 'focus:ring-purple-400/50': props.severity === 'help',
406
+ },
407
+ // Text & Outlined Button
408
+ {
409
+ 'hover:bg-purple-300/20':
410
+ (props.text || props.outlined) &&
411
+ props.severity === 'help' &&
412
+ !props.plain,
413
+ },
414
+
415
+ // Danger
416
+ {
417
+ 'hover:bg-danger-500/[8%] active:bg-danger-500/[12%] ':
418
+ props.severity === 'danger',
419
+ 'hover:shadow-hover active:!shadow-none hover:!bg-danger-500/90 active:bg-danger-500/90 hover:ring-0':
420
+ !props.link &&
421
+ props.severity === 'danger' &&
422
+ !props.text &&
423
+ !props.outlined &&
424
+ !props.plain,
425
+ },
426
+
427
+ // Text & Outlined Button
428
+ {
429
+ 'hover:bg-danger-300/20':
430
+ (props.text || props.outlined) &&
431
+ props.severity === 'danger' &&
432
+ !props.plain,
433
+ },
434
+ // Contrast
435
+ {
436
+ 'hover:bg-surface-800 hover:ring-surface-800':
437
+ props.severity === 'contrast' &&
438
+ !props.text &&
439
+ !props.outlined &&
440
+ !props.plain,
441
+ },
442
+ {
443
+ 'focus:ring-primary-400': props.severity === 'contrast',
444
+ },
445
+ // Text & Outlined Button
446
+ {
447
+ 'hover:bg-surface-900/10':
448
+ (props.text || props.outlined) &&
449
+ props.severity === 'contrast' &&
450
+ !props.plain,
451
+ },
452
+ // Disabled
453
+ {
454
+ 'pointer-events-none cursor-default': context.disabled,
455
+ '!text-general-300': context.disabled && (props.outlined || props.text),
456
+ '!ring-general-300': context.disabled && props.outlined,
457
+ '!bg-general-300 !text-white !ring-0':
458
+ context.disabled && !props.outlined && !props.text,
459
+ },
460
+
461
+ // Transitions
462
+ 'transition duration-200 ease-in-out',
463
+
464
+ // Misc
465
+ 'cursor-pointer overflow-hidden select-none',
466
+
467
+ // Badge
468
+ '[&>[data-pc-name=badge]]:min-w-4 [&>[data-pc-name=badge]]:h-4 [&>[data-pc-name=badge]]:leading-4',
469
+ ],
470
+ }),
471
+ label: ({ props }) => ({
472
+ class: [
473
+ 'duration-200',
474
+ 'font-normal text-xs',
475
+ props.label ? 'leading-5' : 'leading-4',
476
+ {
477
+ 'hover:underline': props.link,
478
+ },
479
+ { 'flex-1': props.label !== null, 'invisible w-0': props.label == null },
480
+ ],
481
+ }),
482
+ icon: ({ props }) => ({
483
+ class: ['shrink-0', { '!h-[11px] !w-[11px]': props.size === 'small' }],
484
+ }),
485
+ loadingIcon: ({ props }) => ({
486
+ class: [
487
+ 'h-4 w-4',
488
+ 'mx-0',
489
+ {
490
+ 'mr-2': props.iconPos === 'left' && props.label != null,
491
+ 'ml-2 order-1': props.iconPos === 'right' && props.label != null,
492
+ 'mb-2': props.iconPos === 'top' && props.label != null,
493
+ 'mt-2': props.iconPos === 'bottom' && props.label != null,
494
+ },
495
+ 'animate-spin',
496
+ ],
497
+ }),
498
+ badge: ({ props }) => ({
499
+ class: [
500
+ {
501
+ 'ml-2 w-4 h-4 leading-none flex items-center justify-center':
502
+ props.badge,
503
+ },
504
+ ],
505
+ }),
506
+ };