@teammodlr/ui-kit 2.1.41 → 2.1.44

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 (326) hide show
  1. package/env.d.ts +1 -1
  2. package/lib/components/avatar/Avatar.vue.d.ts +1 -1
  3. package/lib/components/avatargroup/AvatarGroup.vue.d.ts +1 -1
  4. package/lib/components/badge/Badge.vue.d.ts +1 -1
  5. package/lib/components/breadcrumb/Breadcrumb.vue.d.ts +1 -1
  6. package/lib/components/breadcrumb/BreadcrumbItem.vue.d.ts +1 -1
  7. package/lib/components/button/Button.vue.d.ts +1 -1
  8. package/lib/components/buttongroup/ButtonGroup.vue.d.ts +1 -1
  9. package/lib/components/checkbox/Checkbox.vue.d.ts +4 -3
  10. package/lib/components/checkbox/style/Checkbox.css.d.ts +1 -0
  11. package/lib/components/colorpicker/ColorPicker.vue.d.ts +1 -1
  12. package/lib/components/configprovider/ConfigProvider.vue.d.ts +35 -0
  13. package/lib/components/configprovider/types.d.ts +3 -0
  14. package/lib/components/confirm/Confirm.vue.d.ts +1 -1
  15. package/lib/components/confirm/ConfirmProvider.vue.d.ts +1 -1
  16. package/lib/components/dialog/Dialog.vue.d.ts +1 -1
  17. package/lib/components/dropdown/Dropdown.vue.d.ts +1 -1
  18. package/lib/components/dropdown/DropdownHeading.vue.d.ts +1 -1
  19. package/lib/components/dropdown/DropdownItem.vue.d.ts +1 -1
  20. package/lib/components/dropdown/DropdownList.vue.d.ts +1 -1
  21. package/lib/components/dropdown/DropdownSeperator.vue.d.ts +1 -1
  22. package/lib/components/dropdown/DropdownWrapper.vue.d.ts +1 -1
  23. package/lib/components/form/Form.vue.d.ts +1 -1
  24. package/lib/components/image/Image.vue.d.ts +1 -1
  25. package/lib/components/index.d.ts +1 -0
  26. package/lib/components/input/Input.vue.d.ts +2 -2
  27. package/lib/components/link/Link.vue.d.ts +1 -1
  28. package/lib/components/messageprovider/Message.vue.d.ts +1 -1
  29. package/lib/components/messageprovider/MessageProvider.vue.d.ts +1 -1
  30. package/lib/components/modal/Modal.vue.d.ts +1 -1
  31. package/lib/components/pagination/Pagination.vue.d.ts +1 -1
  32. package/lib/components/radio/Radio.vue.d.ts +3 -3
  33. package/lib/components/radiobutton/RadioButton.vue.d.ts +1 -1
  34. package/lib/components/radiobuttongroup/RadioButtonGroup.vue.d.ts +1 -1
  35. package/lib/components/renderer/examlpes/basic.vue.d.ts +1 -1
  36. package/lib/components/renderer/renderer.d.ts +1 -1
  37. package/lib/components/select/Select.vue.d.ts +2 -2
  38. package/lib/components/skeleton/Skeleton.vue.d.ts +1 -1
  39. package/lib/components/slider/Slider.vue.d.ts +1 -1
  40. package/lib/components/switch/Switch.vue.d.ts +3 -3
  41. package/lib/components/tab/Tab.vue.d.ts +1 -1
  42. package/lib/components/tab/TabGroup.vue.d.ts +1 -1
  43. package/lib/components/table/Table.vue.d.ts +1 -1
  44. package/lib/components/table/TableBody.vue.d.ts +1 -1
  45. package/lib/components/table/TableCell.vue.d.ts +1 -1
  46. package/lib/components/table/TableHead.vue.d.ts +1 -1
  47. package/lib/components/table/TableHeadRow.vue.d.ts +1 -1
  48. package/lib/components/table/TableRow.vue.d.ts +1 -1
  49. package/lib/components/tag/Tag.vue.d.ts +1 -1
  50. package/lib/components/textarea/Textarea.vue.d.ts +2 -2
  51. package/lib/components/tooltip/Tooltip.vue.d.ts +1 -1
  52. package/lib/components/transfer/Transfer.vue.d.ts +1 -1
  53. package/lib/components/tree/Tree.vue.d.ts +1 -1
  54. package/lib/components/tree/TreeNode.vue.d.ts +1 -1
  55. package/lib/components/tree/TreeNodeToggle.vue.d.ts +1 -1
  56. package/lib/components/virtualscroll/VirtualScroll.vue.d.ts +1 -1
  57. package/lib/composables/useCachedUid.d.ts +1 -13
  58. package/lib/composables/useInput.d.ts +3 -3
  59. package/lib/index.cjs.js +10 -10
  60. package/lib/index.es.js +1347 -1338
  61. package/lib/nuxt.js +35 -35
  62. package/lib/nuxt.plugin.js +8 -8
  63. package/lib/style.css +1 -1
  64. package/lib/styles/theme.css.d.ts +1 -1
  65. package/package.json +89 -89
  66. package/src/__storybook__/argTypes.ts +53 -53
  67. package/src/__storybook__/createStory.ts +15 -15
  68. package/src/__storybook__/index.ts +2 -2
  69. package/src/call.ts +34 -34
  70. package/src/components/avatar/Avatar.vue +110 -110
  71. package/src/components/avatar/examples/basic.vue +6 -6
  72. package/src/components/avatar/examples/custom-size.vue +7 -7
  73. package/src/components/avatar/examples/index.ts +5 -5
  74. package/src/components/avatar/examples/sizes.vue +33 -33
  75. package/src/components/avatar/examples/slots.vue +8 -8
  76. package/src/components/avatar/examples/variants.vue +18 -18
  77. package/src/components/avatar/style/Avatar.css.ts +92 -92
  78. package/src/components/avatar/style/index.ts +1 -1
  79. package/src/components/avatargroup/AvatarGroup.vue +72 -72
  80. package/src/components/avatargroup/examples/basic.vue +37 -37
  81. package/src/components/avatargroup/examples/index.ts +1 -1
  82. package/src/components/avatargroup/style/AvatarGroup.css.ts +26 -26
  83. package/src/components/avatargroup/style/index.ts +1 -1
  84. package/src/components/avatargroup/symbol.ts +17 -17
  85. package/src/components/badge/Badge.vue +43 -43
  86. package/src/components/badge/examples/basic.vue +10 -10
  87. package/src/components/badge/examples/index.ts +1 -1
  88. package/src/components/badge/style/Badge.css.ts +135 -135
  89. package/src/components/badge/style/index.ts +1 -1
  90. package/src/components/breadcrumb/Breadcrumb.vue +54 -54
  91. package/src/components/breadcrumb/BreadcrumbItem.vue +72 -72
  92. package/src/components/breadcrumb/examples/basic.vue +7 -7
  93. package/src/components/breadcrumb/examples/index.ts +1 -1
  94. package/src/components/breadcrumb/style/Breadcrumb.css.ts +40 -40
  95. package/src/components/breadcrumb/style/index.ts +1 -1
  96. package/src/components/breadcrumb/symbol.ts +18 -18
  97. package/src/components/button/Button.vue +203 -203
  98. package/src/components/button/examples/basic.vue +3 -3
  99. package/src/components/button/examples/disabled.vue +3 -3
  100. package/src/components/button/examples/icon-left.vue +12 -12
  101. package/src/components/button/examples/icon.vue +9 -9
  102. package/src/components/button/examples/index.ts +9 -9
  103. package/src/components/button/examples/link.vue +3 -3
  104. package/src/components/button/examples/rounded.vue +7 -7
  105. package/src/components/button/examples/size.vue +7 -7
  106. package/src/components/button/examples/variants-secondary.vue +10 -10
  107. package/src/components/button/examples/variants.vue +10 -10
  108. package/src/components/button/style/Button.css.ts +695 -695
  109. package/src/components/button/style/index.ts +1 -1
  110. package/src/components/buttongroup/ButtonGroup.vue +36 -36
  111. package/src/components/buttongroup/examples/basic.vue +9 -9
  112. package/src/components/buttongroup/examples/icon-group.vue +21 -21
  113. package/src/components/buttongroup/examples/index.ts +2 -2
  114. package/src/components/buttongroup/style/ButtonGroup.css.ts +42 -42
  115. package/src/components/buttongroup/style/index.ts +1 -1
  116. package/src/components/buttongroup/symbol.ts +9 -9
  117. package/src/components/checkbox/Checkbox.vue +149 -145
  118. package/src/components/checkbox/examples/basic.vue +9 -9
  119. package/src/components/checkbox/examples/index.ts +2 -2
  120. package/src/components/checkbox/examples/slot.vue +14 -11
  121. package/src/components/checkbox/style/Checkbox.css.ts +178 -161
  122. package/src/components/checkbox/style/index.ts +1 -1
  123. package/src/components/colorpicker/ColorPicker.vue +333 -333
  124. package/src/components/colorpicker/examples/basic.vue +2 -2
  125. package/src/components/colorpicker/examples/index.ts +1 -1
  126. package/src/components/colorpicker/style/ColorPicker.css.ts +127 -127
  127. package/src/components/colorpicker/style/index.ts +1 -1
  128. package/src/components/colorpicker/utils.ts +206 -206
  129. package/src/components/configprovider/ConfigProvider.vue +26 -0
  130. package/src/components/configprovider/types.ts +3 -0
  131. package/src/components/confirm/Confirm.vue +65 -65
  132. package/src/components/confirm/ConfirmProvider.vue +83 -83
  133. package/src/components/confirm/examples/basic.vue +48 -48
  134. package/src/components/confirm/examples/index.ts +1 -1
  135. package/src/components/confirm/examples/wrapper.vue +9 -9
  136. package/src/components/confirm/props.ts +24 -24
  137. package/src/components/confirm/providerProps.ts +10 -10
  138. package/src/components/confirm/types.ts +33 -33
  139. package/src/components/confirm/useConfirm.ts +14 -14
  140. package/src/components/dialog/Dialog.vue +118 -118
  141. package/src/components/dialog/examples/basic.vue +16 -16
  142. package/src/components/dialog/examples/index.ts +1 -1
  143. package/src/components/dialog/style/Dialog.css.ts +100 -100
  144. package/src/components/dialog/style/index.ts +1 -1
  145. package/src/components/dropdown/Dropdown.vue +308 -308
  146. package/src/components/dropdown/DropdownHeading.vue +23 -23
  147. package/src/components/dropdown/DropdownItem.vue +151 -151
  148. package/src/components/dropdown/DropdownList.vue +20 -20
  149. package/src/components/dropdown/DropdownSeperator.vue +22 -22
  150. package/src/components/dropdown/DropdownWrapper.vue +18 -18
  151. package/src/components/dropdown/examples/basic.vue +119 -119
  152. package/src/components/dropdown/examples/context.vue +71 -71
  153. package/src/components/dropdown/examples/index.ts +3 -3
  154. package/src/components/dropdown/hooks.ts +30 -30
  155. package/src/components/dropdown/style/Dropdown.css.ts +158 -158
  156. package/src/components/dropdown/style/index.ts +1 -1
  157. package/src/components/dropdown/symbol.ts +9 -9
  158. package/src/components/form/Form.vue +153 -153
  159. package/src/components/form/examples/basic.vue +75 -75
  160. package/src/components/form/examples/index.ts +1 -1
  161. package/src/components/form/style/Form.css.ts +28 -28
  162. package/src/components/form/style/index.ts +2 -2
  163. package/src/components/form/symbol.ts +16 -16
  164. package/src/components/image/Image.vue +71 -71
  165. package/src/components/image/examples/basic.vue +5 -5
  166. package/src/components/image/examples/index.ts +1 -1
  167. package/src/components/index.ts +48 -47
  168. package/src/components/input/Input.vue +233 -233
  169. package/src/components/input/examples/basic.vue +21 -21
  170. package/src/components/input/examples/index.ts +6 -6
  171. package/src/components/input/examples/left-icon.vue +9 -9
  172. package/src/components/input/examples/prefix.vue +5 -5
  173. package/src/components/input/examples/right-icon.vue +9 -9
  174. package/src/components/input/examples/sizes.vue +9 -9
  175. package/src/components/input/examples/suffix.vue +7 -7
  176. package/src/components/input/style/Input.css.ts +294 -294
  177. package/src/components/input/style/index.ts +1 -1
  178. package/src/components/link/Link.vue +53 -53
  179. package/src/components/link/examples/basic.vue +3 -3
  180. package/src/components/link/examples/index.ts +1 -1
  181. package/src/components/messageprovider/Message.vue +135 -135
  182. package/src/components/messageprovider/MessageProvider.vue +156 -156
  183. package/src/components/messageprovider/examples/basic.vue +70 -70
  184. package/src/components/messageprovider/examples/index.ts +2 -2
  185. package/src/components/messageprovider/examples/update.vue +34 -34
  186. package/src/components/messageprovider/examples/wrapper.vue +9 -9
  187. package/src/components/messageprovider/style/Message.css.ts +111 -111
  188. package/src/components/messageprovider/style/index.ts +1 -1
  189. package/src/components/messageprovider/types.ts +56 -56
  190. package/src/components/messageprovider/useMessage.ts +14 -14
  191. package/src/components/modal/Modal.vue +310 -310
  192. package/src/components/modal/examples/basic.vue +80 -80
  193. package/src/components/modal/examples/index.ts +3 -3
  194. package/src/components/modal/examples/modal-form.vue +99 -99
  195. package/src/components/modal/examples/sidebar.vue +79 -79
  196. package/src/components/modal/style/Modal.css.ts +318 -318
  197. package/src/components/modal/style/index.ts +1 -1
  198. package/src/components/pagination/Pagination.vue +296 -296
  199. package/src/components/pagination/examples/basic.vue +17 -17
  200. package/src/components/pagination/examples/index.ts +1 -1
  201. package/src/components/pagination/style/Pagination.css.ts +93 -93
  202. package/src/components/pagination/style/index.ts +1 -1
  203. package/src/components/radio/Radio.vue +136 -136
  204. package/src/components/radio/examples/basic.vue +8 -8
  205. package/src/components/radio/examples/group.vue +15 -15
  206. package/src/components/radio/examples/index.ts +2 -2
  207. package/src/components/radio/style/Checkbox.css.ts +130 -130
  208. package/src/components/radio/style/index.ts +1 -1
  209. package/src/components/radiobutton/RadioButton.vue +131 -131
  210. package/src/components/radiobutton/style/RadioButton.css.ts +189 -189
  211. package/src/components/radiobutton/style/index.ts +1 -1
  212. package/src/components/radiobuttongroup/RadioButtonGroup.vue +74 -74
  213. package/src/components/radiobuttongroup/examples/basic.vue +16 -16
  214. package/src/components/radiobuttongroup/examples/index.ts +1 -1
  215. package/src/components/radiobuttongroup/style/RadioButtonGroup.css.ts +37 -37
  216. package/src/components/radiobuttongroup/style/index.ts +1 -1
  217. package/src/components/radiobuttongroup/symbol.ts +12 -12
  218. package/src/components/renderer/examlpes/basic.vue +23 -23
  219. package/src/components/renderer/examlpes/index.ts +1 -1
  220. package/src/components/renderer/props.ts +14 -14
  221. package/src/components/renderer/renderer.ts +16 -16
  222. package/src/components/select/Select.vue +781 -781
  223. package/src/components/select/examples/basic.vue +21 -21
  224. package/src/components/select/examples/index.ts +3 -3
  225. package/src/components/select/examples/multiple.vue +21 -21
  226. package/src/components/select/examples/searchable.vue +20 -20
  227. package/src/components/select/style/Select.css.ts +368 -368
  228. package/src/components/select/style/index.ts +1 -1
  229. package/src/components/skeleton/Skeleton.vue +55 -55
  230. package/src/components/skeleton/examples/basic.vue +3 -3
  231. package/src/components/skeleton/examples/index.ts +2 -2
  232. package/src/components/skeleton/examples/post.vue +8 -8
  233. package/src/components/skeleton/style/Skeleton.css.ts +72 -72
  234. package/src/components/skeleton/style/index.ts +2 -2
  235. package/src/components/slider/Slider.vue +76 -76
  236. package/src/components/slider/style/Slider.css.ts +50 -50
  237. package/src/components/slider/style/index.ts +1 -1
  238. package/src/components/switch/Switch.vue +132 -132
  239. package/src/components/switch/examples/basic.vue +9 -9
  240. package/src/components/switch/examples/index.ts +2 -2
  241. package/src/components/switch/examples/slot.vue +11 -11
  242. package/src/components/switch/style/Switch.css.ts +135 -135
  243. package/src/components/switch/style/index.ts +1 -1
  244. package/src/components/tab/Tab.css +113 -113
  245. package/src/components/tab/Tab.vue +98 -98
  246. package/src/components/tab/TabGroup.vue +90 -90
  247. package/src/components/tab/examples/basic.vue +19 -19
  248. package/src/components/tab/examples/index.ts +2 -2
  249. package/src/components/tab/examples/vertical.vue +19 -19
  250. package/src/components/table/Table.vue +198 -198
  251. package/src/components/table/TableBody.vue +13 -13
  252. package/src/components/table/TableCell.vue +13 -13
  253. package/src/components/table/TableHead.vue +46 -46
  254. package/src/components/table/TableHeadRow.vue +15 -15
  255. package/src/components/table/TableRow.vue +19 -19
  256. package/src/components/table/examples/basic.vue +61 -61
  257. package/src/components/table/examples/empty.vue +44 -44
  258. package/src/components/table/examples/index.ts +3 -3
  259. package/src/components/table/examples/selected.vue +68 -68
  260. package/src/components/table/style/Table.css.ts +62 -62
  261. package/src/components/table/style/index.ts +1 -1
  262. package/src/components/table/types/index.ts +6 -6
  263. package/src/components/tag/Tag.vue +72 -72
  264. package/src/components/tag/examples/basic.vue +5 -5
  265. package/src/components/tag/examples/index.ts +1 -1
  266. package/src/components/tag/style/Tag.css.ts +83 -83
  267. package/src/components/tag/style/index.ts +1 -1
  268. package/src/components/textarea/Textarea.vue +180 -180
  269. package/src/components/textarea/examples/basic.vue +8 -8
  270. package/src/components/textarea/examples/index.ts +1 -1
  271. package/src/components/textarea/style/Textarea.css.ts +191 -191
  272. package/src/components/textarea/style/index.ts +1 -1
  273. package/src/components/tooltip/Tooltip.vue +196 -196
  274. package/src/components/tooltip/examples/basic.vue +5 -5
  275. package/src/components/tooltip/examples/index.ts +2 -2
  276. package/src/components/tooltip/examples/placement.vue +9 -9
  277. package/src/components/tooltip/style/Tooltip.css.ts +90 -90
  278. package/src/components/tooltip/style/index.ts +1 -1
  279. package/src/components/transfer/Transfer.vue +145 -145
  280. package/src/components/transfer/examples/basic.vue +21 -21
  281. package/src/components/transfer/examples/index.ts +1 -1
  282. package/src/components/transfer/style/Transfer.css.ts +81 -81
  283. package/src/components/transfer/style/index.ts +1 -1
  284. package/src/components/tree/Tree.vue +138 -138
  285. package/src/components/tree/TreeNode.vue +109 -109
  286. package/src/components/tree/TreeNodeToggle.vue +48 -48
  287. package/src/components/tree/examples/basic.vue +458 -458
  288. package/src/components/tree/examples/index.ts +1 -1
  289. package/src/components/tree/props.ts +97 -97
  290. package/src/components/tree/style/Tree.css.ts +75 -75
  291. package/src/components/tree/style/index.ts +1 -1
  292. package/src/components/tree/types.ts +103 -103
  293. package/src/components/virtualscroll/VirtualScroll.css +13 -13
  294. package/src/components/virtualscroll/VirtualScroll.vue +166 -166
  295. package/src/components/virtualscroll/examples/basic.vue +31 -31
  296. package/src/components/virtualscroll/examples/index.ts +1 -1
  297. package/src/components/virtualscroll/style/VirtualScroll.css.ts +17 -17
  298. package/src/components/virtualscroll/style/index.ts +1 -1
  299. package/src/composables/element.ts +13 -13
  300. package/src/composables/index.ts +4 -4
  301. package/src/composables/useCachedUid.ts +17 -49
  302. package/src/composables/useEventListener.ts +19 -19
  303. package/src/composables/useInput.ts +151 -151
  304. package/src/composables/useInteractive.ts +19 -19
  305. package/src/composables/useIsServer.ts +7 -7
  306. package/src/composables/useMergedState.ts +18 -18
  307. package/src/composables/useMount.ts +43 -43
  308. package/src/composables/usePopper.ts +215 -215
  309. package/src/composables/useZIndex.ts +33 -33
  310. package/src/create.ts +38 -38
  311. package/src/css/components.css +16 -16
  312. package/src/css/index.css +4 -4
  313. package/src/css/transitions.css +40 -40
  314. package/src/css/variables.css +80 -80
  315. package/src/examples/cards/sidebar.vue +262 -262
  316. package/src/examples/modal/modal.vue +52 -52
  317. package/src/exports/nuxt.js +35 -35
  318. package/src/exports/nuxt.plugin.js +8 -8
  319. package/src/index.ts +5 -5
  320. package/src/install.ts +8 -8
  321. package/src/shims-vue.d.ts +6 -6
  322. package/src/styles/theme.css.ts +181 -181
  323. package/src/styles/transitions.css.ts +97 -97
  324. package/src/types/props.ts +19 -19
  325. package/src/utils/injection.ts +5 -5
  326. package/volar.d.ts +16 -16
@@ -1,695 +1,695 @@
1
- import {
2
- createVar,
3
- globalKeyframes,
4
- globalStyle,
5
- style,
6
- styleVariants
7
- } from '@vanilla-extract/css';
8
- import { themeVars } from '../../../styles/theme.css';
9
-
10
- const sizes = {
11
- xs: '22px',
12
- sm: '28px',
13
- md: '36px',
14
- lg: '40px',
15
- xl: '45px'
16
- };
17
-
18
- const borderRadiuses = {
19
- xs: '2px',
20
- sm: '3px',
21
- md: '4px',
22
- lg: '6px',
23
- xl: '8px'
24
- };
25
-
26
- const padding = {
27
- xs: `0 ${themeVars.space[1]}`,
28
- sm: `0 ${themeVars.space[2]}`,
29
- md: `0 ${themeVars.space[3]}`,
30
- lg: `0 ${themeVars.space[3]}`,
31
- xl: `0 ${themeVars.space[4]}`
32
- };
33
-
34
- export const vars = {
35
- height: createVar(),
36
- radius: createVar(),
37
- padding: createVar(),
38
- backgroundColor: createVar(),
39
- borderColor: createVar(),
40
- boxShadowColor: createVar(),
41
- color: createVar()
42
- };
43
-
44
- export const base = style({
45
- alignItems: 'center',
46
- boxSizing: 'border-box',
47
- display: 'inline-flex',
48
- fontSize: themeVars.fontSize.base,
49
- fontWeight: '500',
50
- maxWidth: '100%',
51
- width: 'auto',
52
- position: 'relative',
53
- textAlign: 'center',
54
- textDecoration: 'none',
55
- verticalAlign: 'middle',
56
- whiteSpace: 'nowrap',
57
- justifyContent: 'center',
58
- height: vars.height,
59
- lineHeight: vars.height,
60
- borderRadius: vars.radius,
61
- padding: vars.padding,
62
- zIndex: 'auto',
63
- backgroundColor: vars.backgroundColor,
64
- border: 0,
65
- color: vars.color,
66
- transition: `color .2s ${themeVars.transition.default},
67
- background-color .25s ${themeVars.transition.default},
68
- box-shadow .25s ${themeVars.transition.default},
69
- border-color .25s ${themeVars.transition.default}`,
70
- fontFamily: 'inherit',
71
- ':hover': {
72
- cursor: 'pointer'
73
- },
74
- ':focus': {
75
- outline: 'none'
76
- },
77
- selectors: {
78
- [`a&:hover`]: {
79
- textDecoration: 'none',
80
- color: vars.color
81
- }
82
- }
83
- });
84
-
85
- export const variant = styleVariants({
86
- primary: {
87
- vars: {
88
- [vars.backgroundColor]: themeVars.color.blue[500],
89
- [vars.borderColor]: themeVars.color.blue[500],
90
- [vars.boxShadowColor]: themeVars.color.blue[500],
91
- [vars.color]: '#FFFFFF'
92
- },
93
- ':hover': {
94
- vars: {
95
- [vars.backgroundColor]: themeVars.color.blue[600],
96
- [vars.borderColor]: themeVars.color.blue[600]
97
- }
98
- },
99
- ':focus': {
100
- vars: {
101
- [vars.backgroundColor]: themeVars.color.blue[600],
102
- [vars.borderColor]: themeVars.color.blue[600]
103
- }
104
- }
105
- },
106
- dark: {
107
- vars: {
108
- [vars.backgroundColor]: themeVars.color.saxe[700],
109
- [vars.borderColor]: themeVars.color.saxe[700],
110
- [vars.boxShadowColor]: themeVars.color.saxe[700],
111
- [vars.color]: '#FFFFFF'
112
- },
113
- ':hover': {
114
- vars: {
115
- [vars.backgroundColor]: themeVars.color.saxe[800],
116
- [vars.borderColor]: themeVars.color.saxe[800]
117
- }
118
- },
119
- ':focus': {
120
- vars: {
121
- [vars.backgroundColor]: themeVars.color.saxe[900],
122
- [vars.borderColor]: themeVars.color.saxe[900]
123
- }
124
- }
125
- },
126
- default: {
127
- vars: {
128
- [vars.color]: themeVars.color.font.text,
129
- [vars.backgroundColor]: 'white',
130
- [vars.boxShadowColor]: themeVars.color.blue[500],
131
- [vars.borderColor]: themeVars.color.gray[300]
132
- },
133
- ':hover': {
134
- vars: {
135
- [vars.color]: themeVars.color.blue[500],
136
- [vars.borderColor]: themeVars.color.blue[500]
137
- }
138
- },
139
- ':focus': {
140
- vars: {
141
- [vars.color]: themeVars.color.blue[500],
142
- [vars.borderColor]: themeVars.color.blue[500]
143
- }
144
- }
145
- },
146
- tertiary: {
147
- vars: {
148
- [vars.color]: themeVars.color.font.default,
149
- [vars.backgroundColor]: themeVars.color.gray[100],
150
- [vars.boxShadowColor]: themeVars.color.blue[100],
151
- [vars.borderColor]: themeVars.color.gray[300]
152
- },
153
- ':hover': {
154
- vars: {
155
- [vars.color]: themeVars.color.font.default,
156
- [vars.backgroundColor]: themeVars.color.gray[250],
157
- [vars.borderColor]: themeVars.color.gray[300]
158
- }
159
- },
160
- ':focus': {
161
- vars: {
162
- [vars.color]: themeVars.color.font.text,
163
- [vars.backgroundColor]: themeVars.color.gray[200],
164
- [vars.borderColor]: themeVars.color.gray[300]
165
- }
166
- }
167
- },
168
- success: {
169
- vars: {
170
- [vars.backgroundColor]: themeVars.color.green[500],
171
- [vars.borderColor]: themeVars.color.green[500],
172
- [vars.boxShadowColor]: themeVars.color.green[500],
173
- [vars.color]: '#FFFFFF'
174
- },
175
- ':hover': {
176
- vars: {
177
- [vars.backgroundColor]: themeVars.color.green[600],
178
- [vars.borderColor]: themeVars.color.green[600],
179
- [vars.color]: '#FFFFFF'
180
- }
181
- },
182
- ':focus': {
183
- vars: {
184
- [vars.borderColor]: themeVars.color.green[600],
185
- [vars.backgroundColor]: themeVars.color.green[600]
186
- }
187
- }
188
- },
189
- warning: {
190
- vars: {
191
- [vars.backgroundColor]: themeVars.color.amber[400],
192
- [vars.borderColor]: themeVars.color.amber[400],
193
- [vars.boxShadowColor]: themeVars.color.amber[400],
194
- [vars.color]: themeVars.color.gray[800]
195
- },
196
- ':hover': {
197
- vars: {
198
- [vars.backgroundColor]: themeVars.color.amber[500],
199
- [vars.borderColor]: themeVars.color.amber[500],
200
- [vars.color]: themeVars.color.gray[900]
201
- }
202
- },
203
- ':focus': {
204
- vars: {
205
- [vars.borderColor]: themeVars.color.amber[500],
206
- [vars.backgroundColor]: themeVars.color.amber[500]
207
- }
208
- }
209
- },
210
- error: {
211
- vars: {
212
- [vars.backgroundColor]: themeVars.color.red[500],
213
- [vars.borderColor]: themeVars.color.red[500],
214
- [vars.boxShadowColor]: themeVars.color.red[500],
215
- [vars.color]: '#FFFFFF'
216
- },
217
- ':hover': {
218
- vars: {
219
- [vars.backgroundColor]: themeVars.color.red[600],
220
- [vars.borderColor]: themeVars.color.red[600]
221
- }
222
- },
223
- ':focus': {
224
- vars: {
225
- [vars.borderColor]: themeVars.color.red[600],
226
- [vars.backgroundColor]: themeVars.color.red[600]
227
- }
228
- }
229
- }
230
- });
231
-
232
- export const secondary = styleVariants({
233
- primary: {
234
- vars: {
235
- [vars.backgroundColor]: themeVars.color.blue[100],
236
- [vars.borderColor]: themeVars.color.blue[100],
237
- [vars.color]: themeVars.color.blue[500]
238
- },
239
- ':hover': {
240
- vars: {
241
- [vars.backgroundColor]: themeVars.color.blue[200],
242
- [vars.borderColor]: themeVars.color.blue[200],
243
- [vars.color]: themeVars.color.blue[600]
244
- }
245
- },
246
- ':focus': {
247
- vars: {
248
- [vars.backgroundColor]: themeVars.color.blue[200],
249
- [vars.borderColor]: themeVars.color.blue[200],
250
- [vars.color]: themeVars.color.blue[600]
251
- }
252
- }
253
- },
254
- dark: {
255
- vars: {
256
- [vars.backgroundColor]: themeVars.color.saxe[100],
257
- [vars.borderColor]: themeVars.color.saxe[100],
258
- [vars.color]: themeVars.color.saxe[700]
259
- },
260
- ':hover': {
261
- vars: {
262
- [vars.backgroundColor]: themeVars.color.saxe[200],
263
- [vars.borderColor]: themeVars.color.saxe[200],
264
- [vars.color]: themeVars.color.saxe[800]
265
- }
266
- },
267
- ':focus': {
268
- vars: {
269
- [vars.backgroundColor]: themeVars.color.saxe[200],
270
- [vars.borderColor]: themeVars.color.saxe[200],
271
- [vars.color]: themeVars.color.saxe[800]
272
- }
273
- }
274
- },
275
- default: {
276
- vars: {
277
- [vars.backgroundColor]: themeVars.color.gray[100],
278
- [vars.borderColor]: themeVars.color.gray[100],
279
- [vars.color]: themeVars.color.gray[500]
280
- },
281
- ':hover': {
282
- vars: {
283
- [vars.backgroundColor]: themeVars.color.gray[200],
284
- [vars.borderColor]: themeVars.color.gray[200],
285
- [vars.color]: themeVars.color.gray[600]
286
- }
287
- },
288
- ':focus': {
289
- vars: {
290
- [vars.backgroundColor]: themeVars.color.gray[200],
291
- [vars.borderColor]: themeVars.color.gray[200],
292
- [vars.color]: themeVars.color.gray[600]
293
- }
294
- }
295
- },
296
- tertiary: {
297
- vars: {
298
- [vars.backgroundColor]: themeVars.color.gray[100],
299
- [vars.borderColor]: themeVars.color.gray[100],
300
- [vars.color]: themeVars.color.gray[400]
301
- },
302
- ':hover': {
303
- vars: {
304
- [vars.backgroundColor]: themeVars.color.gray[200],
305
- [vars.borderColor]: themeVars.color.gray[200],
306
- [vars.color]: themeVars.color.gray[500]
307
- }
308
- },
309
- ':focus': {
310
- vars: {
311
- [vars.backgroundColor]: themeVars.color.gray[200],
312
- [vars.borderColor]: themeVars.color.gray[200],
313
- [vars.color]: themeVars.color.gray[500]
314
- }
315
- }
316
- },
317
- success: {
318
- vars: {
319
- [vars.backgroundColor]: themeVars.color.green[100],
320
- [vars.borderColor]: themeVars.color.green[100],
321
- [vars.color]: themeVars.color.green[600]
322
- },
323
- ':hover': {
324
- vars: {
325
- [vars.backgroundColor]: themeVars.color.green[200],
326
- [vars.borderColor]: themeVars.color.green[200],
327
- [vars.color]: themeVars.color.green[700]
328
- }
329
- },
330
- ':focus': {
331
- vars: {
332
- [vars.backgroundColor]: themeVars.color.green[200],
333
- [vars.borderColor]: themeVars.color.green[200],
334
- [vars.color]: themeVars.color.green[700]
335
- }
336
- }
337
- },
338
- warning: {
339
- vars: {
340
- [vars.backgroundColor]: themeVars.color.amber[100],
341
- [vars.borderColor]: themeVars.color.amber[100],
342
- [vars.color]: themeVars.color.amber[600]
343
- },
344
- ':hover': {
345
- vars: {
346
- [vars.backgroundColor]: themeVars.color.amber[200],
347
- [vars.borderColor]: themeVars.color.amber[200],
348
- [vars.color]: themeVars.color.amber[700]
349
- }
350
- },
351
- ':focus': {
352
- vars: {
353
- [vars.backgroundColor]: themeVars.color.amber[200],
354
- [vars.borderColor]: themeVars.color.amber[200],
355
- [vars.color]: themeVars.color.amber[700]
356
- }
357
- }
358
- },
359
- error: {
360
- vars: {
361
- [vars.backgroundColor]: themeVars.color.red[100],
362
- [vars.borderColor]: themeVars.color.red[100],
363
- [vars.color]: themeVars.color.red[500]
364
- },
365
- ':hover': {
366
- vars: {
367
- [vars.backgroundColor]: themeVars.color.red[200],
368
- [vars.borderColor]: themeVars.color.red[200],
369
- [vars.color]: themeVars.color.red[600]
370
- }
371
- },
372
- ':focus': {
373
- vars: {
374
- [vars.backgroundColor]: themeVars.color.red[200],
375
- [vars.borderColor]: themeVars.color.red[200],
376
- [vars.color]: themeVars.color.red[600]
377
- }
378
- }
379
- }
380
- });
381
-
382
- export const link = styleVariants({
383
- primary: {
384
- vars: {
385
- [vars.backgroundColor]: 'transparent',
386
- [vars.borderColor]: 'transparent',
387
- [vars.color]: themeVars.color.blue[500]
388
- },
389
- ':hover': {
390
- vars: {
391
- [vars.backgroundColor]: 'transparent',
392
- [vars.borderColor]: 'transparent',
393
- [vars.color]: themeVars.color.blue[600]
394
- },
395
- textDecoration: 'underline'
396
- }
397
- },
398
- dark: {
399
- vars: {
400
- [vars.backgroundColor]: 'transparent',
401
- [vars.borderColor]: 'transparent',
402
- [vars.color]: themeVars.color.saxe[800]
403
- },
404
- ':hover': {
405
- vars: {
406
- [vars.backgroundColor]: 'transparent',
407
- [vars.borderColor]: 'transparent',
408
- [vars.color]: themeVars.color.saxe[900]
409
- },
410
- textDecoration: 'underline'
411
- }
412
- },
413
- default: {
414
- vars: {
415
- [vars.backgroundColor]: 'transparent',
416
- [vars.borderColor]: 'transparent',
417
- [vars.color]: themeVars.color.gray[500]
418
- },
419
- ':hover': {
420
- vars: {
421
- [vars.backgroundColor]: 'transparent',
422
- [vars.borderColor]: 'transparent',
423
- [vars.color]: themeVars.color.gray[600]
424
- },
425
- textDecoration: 'underline'
426
- }
427
- },
428
- tertiary: {
429
- vars: {
430
- [vars.backgroundColor]: 'transparent',
431
- [vars.borderColor]: 'transparent',
432
- [vars.color]: themeVars.color.gray[400]
433
- },
434
- ':hover': {
435
- vars: {
436
- [vars.backgroundColor]: 'transparent',
437
- [vars.borderColor]: 'transparent',
438
- [vars.color]: themeVars.color.gray[500]
439
- },
440
- textDecoration: 'underline'
441
- }
442
- },
443
- success: {
444
- vars: {
445
- [vars.backgroundColor]: 'transparent',
446
- [vars.borderColor]: 'transparent',
447
- [vars.color]: themeVars.color.green[500]
448
- },
449
- ':hover': {
450
- vars: {
451
- [vars.backgroundColor]: 'transparent',
452
- [vars.borderColor]: 'transparent',
453
- [vars.color]: themeVars.color.green[600]
454
- },
455
- textDecoration: 'underline'
456
- }
457
- },
458
- warning: {
459
- vars: {
460
- [vars.backgroundColor]: 'transparent',
461
- [vars.borderColor]: 'transparent',
462
- [vars.color]: themeVars.color.amber[600]
463
- },
464
- ':hover': {
465
- vars: {
466
- [vars.backgroundColor]: 'transparent',
467
- [vars.borderColor]: 'transparent',
468
- [vars.color]: themeVars.color.amber[700]
469
- },
470
- textDecoration: 'underline'
471
- }
472
- },
473
- error: {
474
- vars: {
475
- [vars.backgroundColor]: 'transparent',
476
- [vars.borderColor]: 'transparent',
477
- [vars.color]: themeVars.color.red[500]
478
- },
479
- ':hover': {
480
- vars: {
481
- [vars.backgroundColor]: 'transparent',
482
- [vars.borderColor]: 'transparent',
483
- [vars.color]: themeVars.color.red[600]
484
- },
485
- textDecoration: 'underline'
486
- }
487
- }
488
- });
489
-
490
- export const size = styleVariants({
491
- xs: {
492
- vars: {
493
- [vars.height]: sizes.xs,
494
- [vars.radius]: borderRadiuses.xs,
495
- [vars.padding]: padding.xs
496
- },
497
- fontSize: themeVars.fontSize.small
498
- },
499
- sm: {
500
- vars: {
501
- [vars.height]: sizes.sm,
502
- [vars.radius]: borderRadiuses.sm,
503
- [vars.padding]: padding.sm
504
- },
505
- fontSize: themeVars.fontSize.small
506
- },
507
- md: {
508
- vars: {
509
- [vars.height]: sizes.md,
510
- [vars.radius]: borderRadiuses.md,
511
- [vars.padding]: padding.md
512
- }
513
- },
514
- lg: {
515
- vars: {
516
- [vars.height]: sizes.lg,
517
- [vars.radius]: borderRadiuses.lg,
518
- [vars.padding]: padding.lg
519
- },
520
- fontSize: themeVars.fontSize.large
521
- },
522
- xl: {
523
- vars: {
524
- [vars.height]: sizes.xl,
525
- [vars.radius]: borderRadiuses.xl,
526
- [vars.padding]: padding.xl
527
- },
528
- fontSize: themeVars.fontSize.large
529
- }
530
- });
531
-
532
- const baseBorder = style({
533
- position: 'absolute',
534
- top: 0,
535
- left: 0,
536
- bottom: 0,
537
- right: 0,
538
- pointerEvents: 'none',
539
- borderRadius: 'inherit',
540
- transition: 'border-color 0.2s ease-in-out'
541
- });
542
-
543
- export const border = style([
544
- baseBorder,
545
- {
546
- border: `1px solid ${vars.borderColor}`
547
- }
548
- ]);
549
-
550
- export const borderState = style([
551
- baseBorder,
552
- {
553
- border: `1px solid transparent`,
554
- zIndex: 1
555
- }
556
- ]);
557
-
558
- globalStyle(`${base}:hover ${border}, ${base}:focus ${border}`, {
559
- borderColor: 'transparent'
560
- });
561
-
562
- globalStyle(`${base}:hover ${borderState}, ${base}:focus ${borderState}`, {
563
- borderColor: vars.borderColor
564
- });
565
-
566
- export const wave = style({
567
- position: 'absolute',
568
- top: 0,
569
- left: 0,
570
- bottom: 0,
571
- right: 0,
572
- pointerEvents: 'none',
573
- borderRadius: 'inherit',
574
- animationIterationCount: 1,
575
- animationDuration: '0.5s',
576
- zIndex: 1,
577
- animationTimingFunction:
578
- 'cubic-bezier(0.4, 0, 0.15, 1), cubic-bezier(0.4, 0, 0.4, 1)'
579
- });
580
-
581
- const buttonWaveGrow = 'button-wave-grow';
582
-
583
- globalKeyframes(buttonWaveGrow, {
584
- from: {
585
- boxShadow: `0 0 0.5px 0 ${vars.boxShadowColor}`
586
- },
587
- to: {
588
- boxShadow: `0 0 0.5px 4.4px ${vars.boxShadowColor}`
589
- }
590
- });
591
-
592
- const buttonWaveOpacity = 'button-wave-opacity';
593
-
594
- globalKeyframes(buttonWaveOpacity, {
595
- '0%': {
596
- opacity: 0.5
597
- },
598
- '90%': {
599
- opacity: 0
600
- },
601
- '100%': {
602
- opacity: 0
603
- }
604
- });
605
-
606
- export const waveActive = style({
607
- zIndex: 1,
608
- animationName: `${buttonWaveGrow}, ${buttonWaveOpacity}`
609
- });
610
-
611
- export const iconButton = style({
612
- display: 'flex',
613
- flexGrow: 0,
614
- flexShrink: 0,
615
- fontSize: 0,
616
- lineHeight: 0,
617
- userSelect: 'none',
618
- padding: 'initial',
619
- height: vars.height,
620
- width: vars.height
621
- });
622
-
623
- export const icon = style({
624
- display: 'flex',
625
- flexGrow: 0,
626
- flexShrink: 0,
627
- fontSize: 0,
628
- lineHeight: 0,
629
- userSelect: 'none'
630
- });
631
-
632
- globalStyle(`${icon} > svg`, {
633
- overflow: 'hidden',
634
- pointerEvents: 'none',
635
- maxWidth: '100%',
636
- maxHeight: '100%',
637
- verticalAlign: 'middle'
638
- });
639
-
640
- export const iconLeft = style([
641
- icon,
642
- {
643
- marginRight: themeVars.space[2],
644
- position: 'relative'
645
- }
646
- ]);
647
-
648
- export const iconRight = style({
649
- marginLeft: themeVars.space[2]
650
- });
651
-
652
- export const rounded = style({
653
- borderRadius: '9999px'
654
- });
655
-
656
- export const block = style({
657
- display: 'flex',
658
- width: '100%'
659
- });
660
-
661
- const spinAround = 'spin-around';
662
-
663
- globalKeyframes(spinAround, {
664
- '0%': {
665
- transform: 'rotate(0deg)'
666
- },
667
- '100%': {
668
- transform: 'rotate(360deg)'
669
- }
670
- });
671
-
672
- export const loading = style({
673
- pointerEvents: 'none',
674
- color: 'transparent',
675
- userSelect: 'none',
676
- opacity: 0.75,
677
- selectors: {
678
- [`&:after`]: {
679
- transition: 'all 0.2s ease-in-out',
680
- position: 'absolute',
681
- animationIterationCount: 'infinite',
682
- animationDuration: '0.75s',
683
- animationTimingFunction: 'cubic-bezier(0.8, 0.5, 0.4, 0)',
684
- animationName: spinAround,
685
- borderRadius: themeVars.rounded.full,
686
- borderColor: `transparent transparent ${vars.color} ${vars.color}`,
687
- borderStyle: `solid`,
688
- borderWidth: `2px`,
689
- content: '',
690
- display: `block`,
691
- height: `1em`,
692
- width: `1em`
693
- }
694
- }
695
- });
1
+ import {
2
+ createVar,
3
+ globalKeyframes,
4
+ globalStyle,
5
+ style,
6
+ styleVariants
7
+ } from '@vanilla-extract/css';
8
+ import { themeVars } from '../../../styles/theme.css';
9
+
10
+ const sizes = {
11
+ xs: '22px',
12
+ sm: '28px',
13
+ md: '36px',
14
+ lg: '40px',
15
+ xl: '45px'
16
+ };
17
+
18
+ const borderRadiuses = {
19
+ xs: '2px',
20
+ sm: '3px',
21
+ md: '4px',
22
+ lg: '6px',
23
+ xl: '8px'
24
+ };
25
+
26
+ const padding = {
27
+ xs: `0 ${themeVars.space[1]}`,
28
+ sm: `0 ${themeVars.space[2]}`,
29
+ md: `0 ${themeVars.space[3]}`,
30
+ lg: `0 ${themeVars.space[3]}`,
31
+ xl: `0 ${themeVars.space[4]}`
32
+ };
33
+
34
+ export const vars = {
35
+ height: createVar(),
36
+ radius: createVar(),
37
+ padding: createVar(),
38
+ backgroundColor: createVar(),
39
+ borderColor: createVar(),
40
+ boxShadowColor: createVar(),
41
+ color: createVar()
42
+ };
43
+
44
+ export const base = style({
45
+ alignItems: 'center',
46
+ boxSizing: 'border-box',
47
+ display: 'inline-flex',
48
+ fontSize: themeVars.fontSize.base,
49
+ fontWeight: '500',
50
+ maxWidth: '100%',
51
+ width: 'auto',
52
+ position: 'relative',
53
+ textAlign: 'center',
54
+ textDecoration: 'none',
55
+ verticalAlign: 'middle',
56
+ whiteSpace: 'nowrap',
57
+ justifyContent: 'center',
58
+ height: vars.height,
59
+ lineHeight: vars.height,
60
+ borderRadius: vars.radius,
61
+ padding: vars.padding,
62
+ zIndex: 'auto',
63
+ backgroundColor: vars.backgroundColor,
64
+ border: 0,
65
+ color: vars.color,
66
+ transition: `color .2s ${themeVars.transition.default},
67
+ background-color .25s ${themeVars.transition.default},
68
+ box-shadow .25s ${themeVars.transition.default},
69
+ border-color .25s ${themeVars.transition.default}`,
70
+ fontFamily: 'inherit',
71
+ ':hover': {
72
+ cursor: 'pointer'
73
+ },
74
+ ':focus': {
75
+ outline: 'none'
76
+ },
77
+ selectors: {
78
+ [`a&:hover`]: {
79
+ textDecoration: 'none',
80
+ color: vars.color
81
+ }
82
+ }
83
+ });
84
+
85
+ export const variant = styleVariants({
86
+ primary: {
87
+ vars: {
88
+ [vars.backgroundColor]: themeVars.color.blue[500],
89
+ [vars.borderColor]: themeVars.color.blue[500],
90
+ [vars.boxShadowColor]: themeVars.color.blue[500],
91
+ [vars.color]: '#FFFFFF'
92
+ },
93
+ ':hover': {
94
+ vars: {
95
+ [vars.backgroundColor]: themeVars.color.blue[600],
96
+ [vars.borderColor]: themeVars.color.blue[600]
97
+ }
98
+ },
99
+ ':focus': {
100
+ vars: {
101
+ [vars.backgroundColor]: themeVars.color.blue[600],
102
+ [vars.borderColor]: themeVars.color.blue[600]
103
+ }
104
+ }
105
+ },
106
+ dark: {
107
+ vars: {
108
+ [vars.backgroundColor]: themeVars.color.saxe[700],
109
+ [vars.borderColor]: themeVars.color.saxe[700],
110
+ [vars.boxShadowColor]: themeVars.color.saxe[700],
111
+ [vars.color]: '#FFFFFF'
112
+ },
113
+ ':hover': {
114
+ vars: {
115
+ [vars.backgroundColor]: themeVars.color.saxe[800],
116
+ [vars.borderColor]: themeVars.color.saxe[800]
117
+ }
118
+ },
119
+ ':focus': {
120
+ vars: {
121
+ [vars.backgroundColor]: themeVars.color.saxe[900],
122
+ [vars.borderColor]: themeVars.color.saxe[900]
123
+ }
124
+ }
125
+ },
126
+ default: {
127
+ vars: {
128
+ [vars.color]: themeVars.color.font.text,
129
+ [vars.backgroundColor]: 'white',
130
+ [vars.boxShadowColor]: themeVars.color.blue[500],
131
+ [vars.borderColor]: themeVars.color.gray[300]
132
+ },
133
+ ':hover': {
134
+ vars: {
135
+ [vars.color]: themeVars.color.blue[500],
136
+ [vars.borderColor]: themeVars.color.blue[500]
137
+ }
138
+ },
139
+ ':focus': {
140
+ vars: {
141
+ [vars.color]: themeVars.color.blue[500],
142
+ [vars.borderColor]: themeVars.color.blue[500]
143
+ }
144
+ }
145
+ },
146
+ tertiary: {
147
+ vars: {
148
+ [vars.color]: themeVars.color.font.default,
149
+ [vars.backgroundColor]: themeVars.color.gray[100],
150
+ [vars.boxShadowColor]: themeVars.color.blue[100],
151
+ [vars.borderColor]: themeVars.color.gray[300]
152
+ },
153
+ ':hover': {
154
+ vars: {
155
+ [vars.color]: themeVars.color.font.default,
156
+ [vars.backgroundColor]: themeVars.color.gray[250],
157
+ [vars.borderColor]: themeVars.color.gray[300]
158
+ }
159
+ },
160
+ ':focus': {
161
+ vars: {
162
+ [vars.color]: themeVars.color.font.text,
163
+ [vars.backgroundColor]: themeVars.color.gray[200],
164
+ [vars.borderColor]: themeVars.color.gray[300]
165
+ }
166
+ }
167
+ },
168
+ success: {
169
+ vars: {
170
+ [vars.backgroundColor]: themeVars.color.green[500],
171
+ [vars.borderColor]: themeVars.color.green[500],
172
+ [vars.boxShadowColor]: themeVars.color.green[500],
173
+ [vars.color]: '#FFFFFF'
174
+ },
175
+ ':hover': {
176
+ vars: {
177
+ [vars.backgroundColor]: themeVars.color.green[600],
178
+ [vars.borderColor]: themeVars.color.green[600],
179
+ [vars.color]: '#FFFFFF'
180
+ }
181
+ },
182
+ ':focus': {
183
+ vars: {
184
+ [vars.borderColor]: themeVars.color.green[600],
185
+ [vars.backgroundColor]: themeVars.color.green[600]
186
+ }
187
+ }
188
+ },
189
+ warning: {
190
+ vars: {
191
+ [vars.backgroundColor]: themeVars.color.amber[400],
192
+ [vars.borderColor]: themeVars.color.amber[400],
193
+ [vars.boxShadowColor]: themeVars.color.amber[400],
194
+ [vars.color]: themeVars.color.gray[800]
195
+ },
196
+ ':hover': {
197
+ vars: {
198
+ [vars.backgroundColor]: themeVars.color.amber[500],
199
+ [vars.borderColor]: themeVars.color.amber[500],
200
+ [vars.color]: themeVars.color.gray[900]
201
+ }
202
+ },
203
+ ':focus': {
204
+ vars: {
205
+ [vars.borderColor]: themeVars.color.amber[500],
206
+ [vars.backgroundColor]: themeVars.color.amber[500]
207
+ }
208
+ }
209
+ },
210
+ error: {
211
+ vars: {
212
+ [vars.backgroundColor]: themeVars.color.red[500],
213
+ [vars.borderColor]: themeVars.color.red[500],
214
+ [vars.boxShadowColor]: themeVars.color.red[500],
215
+ [vars.color]: '#FFFFFF'
216
+ },
217
+ ':hover': {
218
+ vars: {
219
+ [vars.backgroundColor]: themeVars.color.red[600],
220
+ [vars.borderColor]: themeVars.color.red[600]
221
+ }
222
+ },
223
+ ':focus': {
224
+ vars: {
225
+ [vars.borderColor]: themeVars.color.red[600],
226
+ [vars.backgroundColor]: themeVars.color.red[600]
227
+ }
228
+ }
229
+ }
230
+ });
231
+
232
+ export const secondary = styleVariants({
233
+ primary: {
234
+ vars: {
235
+ [vars.backgroundColor]: themeVars.color.blue[100],
236
+ [vars.borderColor]: themeVars.color.blue[100],
237
+ [vars.color]: themeVars.color.blue[500]
238
+ },
239
+ ':hover': {
240
+ vars: {
241
+ [vars.backgroundColor]: themeVars.color.blue[200],
242
+ [vars.borderColor]: themeVars.color.blue[200],
243
+ [vars.color]: themeVars.color.blue[600]
244
+ }
245
+ },
246
+ ':focus': {
247
+ vars: {
248
+ [vars.backgroundColor]: themeVars.color.blue[200],
249
+ [vars.borderColor]: themeVars.color.blue[200],
250
+ [vars.color]: themeVars.color.blue[600]
251
+ }
252
+ }
253
+ },
254
+ dark: {
255
+ vars: {
256
+ [vars.backgroundColor]: themeVars.color.saxe[100],
257
+ [vars.borderColor]: themeVars.color.saxe[100],
258
+ [vars.color]: themeVars.color.saxe[700]
259
+ },
260
+ ':hover': {
261
+ vars: {
262
+ [vars.backgroundColor]: themeVars.color.saxe[200],
263
+ [vars.borderColor]: themeVars.color.saxe[200],
264
+ [vars.color]: themeVars.color.saxe[800]
265
+ }
266
+ },
267
+ ':focus': {
268
+ vars: {
269
+ [vars.backgroundColor]: themeVars.color.saxe[200],
270
+ [vars.borderColor]: themeVars.color.saxe[200],
271
+ [vars.color]: themeVars.color.saxe[800]
272
+ }
273
+ }
274
+ },
275
+ default: {
276
+ vars: {
277
+ [vars.backgroundColor]: themeVars.color.gray[100],
278
+ [vars.borderColor]: themeVars.color.gray[100],
279
+ [vars.color]: themeVars.color.gray[500]
280
+ },
281
+ ':hover': {
282
+ vars: {
283
+ [vars.backgroundColor]: themeVars.color.gray[200],
284
+ [vars.borderColor]: themeVars.color.gray[200],
285
+ [vars.color]: themeVars.color.gray[600]
286
+ }
287
+ },
288
+ ':focus': {
289
+ vars: {
290
+ [vars.backgroundColor]: themeVars.color.gray[200],
291
+ [vars.borderColor]: themeVars.color.gray[200],
292
+ [vars.color]: themeVars.color.gray[600]
293
+ }
294
+ }
295
+ },
296
+ tertiary: {
297
+ vars: {
298
+ [vars.backgroundColor]: themeVars.color.gray[100],
299
+ [vars.borderColor]: themeVars.color.gray[100],
300
+ [vars.color]: themeVars.color.gray[400]
301
+ },
302
+ ':hover': {
303
+ vars: {
304
+ [vars.backgroundColor]: themeVars.color.gray[200],
305
+ [vars.borderColor]: themeVars.color.gray[200],
306
+ [vars.color]: themeVars.color.gray[500]
307
+ }
308
+ },
309
+ ':focus': {
310
+ vars: {
311
+ [vars.backgroundColor]: themeVars.color.gray[200],
312
+ [vars.borderColor]: themeVars.color.gray[200],
313
+ [vars.color]: themeVars.color.gray[500]
314
+ }
315
+ }
316
+ },
317
+ success: {
318
+ vars: {
319
+ [vars.backgroundColor]: themeVars.color.green[100],
320
+ [vars.borderColor]: themeVars.color.green[100],
321
+ [vars.color]: themeVars.color.green[600]
322
+ },
323
+ ':hover': {
324
+ vars: {
325
+ [vars.backgroundColor]: themeVars.color.green[200],
326
+ [vars.borderColor]: themeVars.color.green[200],
327
+ [vars.color]: themeVars.color.green[700]
328
+ }
329
+ },
330
+ ':focus': {
331
+ vars: {
332
+ [vars.backgroundColor]: themeVars.color.green[200],
333
+ [vars.borderColor]: themeVars.color.green[200],
334
+ [vars.color]: themeVars.color.green[700]
335
+ }
336
+ }
337
+ },
338
+ warning: {
339
+ vars: {
340
+ [vars.backgroundColor]: themeVars.color.amber[100],
341
+ [vars.borderColor]: themeVars.color.amber[100],
342
+ [vars.color]: themeVars.color.amber[600]
343
+ },
344
+ ':hover': {
345
+ vars: {
346
+ [vars.backgroundColor]: themeVars.color.amber[200],
347
+ [vars.borderColor]: themeVars.color.amber[200],
348
+ [vars.color]: themeVars.color.amber[700]
349
+ }
350
+ },
351
+ ':focus': {
352
+ vars: {
353
+ [vars.backgroundColor]: themeVars.color.amber[200],
354
+ [vars.borderColor]: themeVars.color.amber[200],
355
+ [vars.color]: themeVars.color.amber[700]
356
+ }
357
+ }
358
+ },
359
+ error: {
360
+ vars: {
361
+ [vars.backgroundColor]: themeVars.color.red[100],
362
+ [vars.borderColor]: themeVars.color.red[100],
363
+ [vars.color]: themeVars.color.red[500]
364
+ },
365
+ ':hover': {
366
+ vars: {
367
+ [vars.backgroundColor]: themeVars.color.red[200],
368
+ [vars.borderColor]: themeVars.color.red[200],
369
+ [vars.color]: themeVars.color.red[600]
370
+ }
371
+ },
372
+ ':focus': {
373
+ vars: {
374
+ [vars.backgroundColor]: themeVars.color.red[200],
375
+ [vars.borderColor]: themeVars.color.red[200],
376
+ [vars.color]: themeVars.color.red[600]
377
+ }
378
+ }
379
+ }
380
+ });
381
+
382
+ export const link = styleVariants({
383
+ primary: {
384
+ vars: {
385
+ [vars.backgroundColor]: 'transparent',
386
+ [vars.borderColor]: 'transparent',
387
+ [vars.color]: themeVars.color.blue[500]
388
+ },
389
+ ':hover': {
390
+ vars: {
391
+ [vars.backgroundColor]: 'transparent',
392
+ [vars.borderColor]: 'transparent',
393
+ [vars.color]: themeVars.color.blue[600]
394
+ },
395
+ textDecoration: 'underline'
396
+ }
397
+ },
398
+ dark: {
399
+ vars: {
400
+ [vars.backgroundColor]: 'transparent',
401
+ [vars.borderColor]: 'transparent',
402
+ [vars.color]: themeVars.color.saxe[800]
403
+ },
404
+ ':hover': {
405
+ vars: {
406
+ [vars.backgroundColor]: 'transparent',
407
+ [vars.borderColor]: 'transparent',
408
+ [vars.color]: themeVars.color.saxe[900]
409
+ },
410
+ textDecoration: 'underline'
411
+ }
412
+ },
413
+ default: {
414
+ vars: {
415
+ [vars.backgroundColor]: 'transparent',
416
+ [vars.borderColor]: 'transparent',
417
+ [vars.color]: themeVars.color.gray[500]
418
+ },
419
+ ':hover': {
420
+ vars: {
421
+ [vars.backgroundColor]: 'transparent',
422
+ [vars.borderColor]: 'transparent',
423
+ [vars.color]: themeVars.color.gray[600]
424
+ },
425
+ textDecoration: 'underline'
426
+ }
427
+ },
428
+ tertiary: {
429
+ vars: {
430
+ [vars.backgroundColor]: 'transparent',
431
+ [vars.borderColor]: 'transparent',
432
+ [vars.color]: themeVars.color.gray[400]
433
+ },
434
+ ':hover': {
435
+ vars: {
436
+ [vars.backgroundColor]: 'transparent',
437
+ [vars.borderColor]: 'transparent',
438
+ [vars.color]: themeVars.color.gray[500]
439
+ },
440
+ textDecoration: 'underline'
441
+ }
442
+ },
443
+ success: {
444
+ vars: {
445
+ [vars.backgroundColor]: 'transparent',
446
+ [vars.borderColor]: 'transparent',
447
+ [vars.color]: themeVars.color.green[500]
448
+ },
449
+ ':hover': {
450
+ vars: {
451
+ [vars.backgroundColor]: 'transparent',
452
+ [vars.borderColor]: 'transparent',
453
+ [vars.color]: themeVars.color.green[600]
454
+ },
455
+ textDecoration: 'underline'
456
+ }
457
+ },
458
+ warning: {
459
+ vars: {
460
+ [vars.backgroundColor]: 'transparent',
461
+ [vars.borderColor]: 'transparent',
462
+ [vars.color]: themeVars.color.amber[600]
463
+ },
464
+ ':hover': {
465
+ vars: {
466
+ [vars.backgroundColor]: 'transparent',
467
+ [vars.borderColor]: 'transparent',
468
+ [vars.color]: themeVars.color.amber[700]
469
+ },
470
+ textDecoration: 'underline'
471
+ }
472
+ },
473
+ error: {
474
+ vars: {
475
+ [vars.backgroundColor]: 'transparent',
476
+ [vars.borderColor]: 'transparent',
477
+ [vars.color]: themeVars.color.red[500]
478
+ },
479
+ ':hover': {
480
+ vars: {
481
+ [vars.backgroundColor]: 'transparent',
482
+ [vars.borderColor]: 'transparent',
483
+ [vars.color]: themeVars.color.red[600]
484
+ },
485
+ textDecoration: 'underline'
486
+ }
487
+ }
488
+ });
489
+
490
+ export const size = styleVariants({
491
+ xs: {
492
+ vars: {
493
+ [vars.height]: sizes.xs,
494
+ [vars.radius]: borderRadiuses.xs,
495
+ [vars.padding]: padding.xs
496
+ },
497
+ fontSize: themeVars.fontSize.small
498
+ },
499
+ sm: {
500
+ vars: {
501
+ [vars.height]: sizes.sm,
502
+ [vars.radius]: borderRadiuses.sm,
503
+ [vars.padding]: padding.sm
504
+ },
505
+ fontSize: themeVars.fontSize.small
506
+ },
507
+ md: {
508
+ vars: {
509
+ [vars.height]: sizes.md,
510
+ [vars.radius]: borderRadiuses.md,
511
+ [vars.padding]: padding.md
512
+ }
513
+ },
514
+ lg: {
515
+ vars: {
516
+ [vars.height]: sizes.lg,
517
+ [vars.radius]: borderRadiuses.lg,
518
+ [vars.padding]: padding.lg
519
+ },
520
+ fontSize: themeVars.fontSize.large
521
+ },
522
+ xl: {
523
+ vars: {
524
+ [vars.height]: sizes.xl,
525
+ [vars.radius]: borderRadiuses.xl,
526
+ [vars.padding]: padding.xl
527
+ },
528
+ fontSize: themeVars.fontSize.large
529
+ }
530
+ });
531
+
532
+ const baseBorder = style({
533
+ position: 'absolute',
534
+ top: 0,
535
+ left: 0,
536
+ bottom: 0,
537
+ right: 0,
538
+ pointerEvents: 'none',
539
+ borderRadius: 'inherit',
540
+ transition: 'border-color 0.2s ease-in-out'
541
+ });
542
+
543
+ export const border = style([
544
+ baseBorder,
545
+ {
546
+ border: `1px solid ${vars.borderColor}`
547
+ }
548
+ ]);
549
+
550
+ export const borderState = style([
551
+ baseBorder,
552
+ {
553
+ border: `1px solid transparent`,
554
+ zIndex: 1
555
+ }
556
+ ]);
557
+
558
+ globalStyle(`${base}:hover ${border}, ${base}:focus ${border}`, {
559
+ borderColor: 'transparent'
560
+ });
561
+
562
+ globalStyle(`${base}:hover ${borderState}, ${base}:focus ${borderState}`, {
563
+ borderColor: vars.borderColor
564
+ });
565
+
566
+ export const wave = style({
567
+ position: 'absolute',
568
+ top: 0,
569
+ left: 0,
570
+ bottom: 0,
571
+ right: 0,
572
+ pointerEvents: 'none',
573
+ borderRadius: 'inherit',
574
+ animationIterationCount: 1,
575
+ animationDuration: '0.5s',
576
+ zIndex: 1,
577
+ animationTimingFunction:
578
+ 'cubic-bezier(0.4, 0, 0.15, 1), cubic-bezier(0.4, 0, 0.4, 1)'
579
+ });
580
+
581
+ const buttonWaveGrow = 'button-wave-grow';
582
+
583
+ globalKeyframes(buttonWaveGrow, {
584
+ from: {
585
+ boxShadow: `0 0 0.5px 0 ${vars.boxShadowColor}`
586
+ },
587
+ to: {
588
+ boxShadow: `0 0 0.5px 4.4px ${vars.boxShadowColor}`
589
+ }
590
+ });
591
+
592
+ const buttonWaveOpacity = 'button-wave-opacity';
593
+
594
+ globalKeyframes(buttonWaveOpacity, {
595
+ '0%': {
596
+ opacity: 0.5
597
+ },
598
+ '90%': {
599
+ opacity: 0
600
+ },
601
+ '100%': {
602
+ opacity: 0
603
+ }
604
+ });
605
+
606
+ export const waveActive = style({
607
+ zIndex: 1,
608
+ animationName: `${buttonWaveGrow}, ${buttonWaveOpacity}`
609
+ });
610
+
611
+ export const iconButton = style({
612
+ display: 'flex',
613
+ flexGrow: 0,
614
+ flexShrink: 0,
615
+ fontSize: 0,
616
+ lineHeight: 0,
617
+ userSelect: 'none',
618
+ padding: 'initial',
619
+ height: vars.height,
620
+ width: vars.height
621
+ });
622
+
623
+ export const icon = style({
624
+ display: 'flex',
625
+ flexGrow: 0,
626
+ flexShrink: 0,
627
+ fontSize: 0,
628
+ lineHeight: 0,
629
+ userSelect: 'none'
630
+ });
631
+
632
+ globalStyle(`${icon} > svg`, {
633
+ overflow: 'hidden',
634
+ pointerEvents: 'none',
635
+ maxWidth: '100%',
636
+ maxHeight: '100%',
637
+ verticalAlign: 'middle'
638
+ });
639
+
640
+ export const iconLeft = style([
641
+ icon,
642
+ {
643
+ marginRight: themeVars.space[2],
644
+ position: 'relative'
645
+ }
646
+ ]);
647
+
648
+ export const iconRight = style({
649
+ marginLeft: themeVars.space[2]
650
+ });
651
+
652
+ export const rounded = style({
653
+ borderRadius: '9999px'
654
+ });
655
+
656
+ export const block = style({
657
+ display: 'flex',
658
+ width: '100%'
659
+ });
660
+
661
+ const spinAround = 'spin-around';
662
+
663
+ globalKeyframes(spinAround, {
664
+ '0%': {
665
+ transform: 'rotate(0deg)'
666
+ },
667
+ '100%': {
668
+ transform: 'rotate(360deg)'
669
+ }
670
+ });
671
+
672
+ export const loading = style({
673
+ pointerEvents: 'none',
674
+ color: 'transparent',
675
+ userSelect: 'none',
676
+ opacity: 0.75,
677
+ selectors: {
678
+ [`&:after`]: {
679
+ transition: 'all 0.2s ease-in-out',
680
+ position: 'absolute',
681
+ animationIterationCount: 'infinite',
682
+ animationDuration: '0.75s',
683
+ animationTimingFunction: 'cubic-bezier(0.8, 0.5, 0.4, 0)',
684
+ animationName: spinAround,
685
+ borderRadius: themeVars.rounded.full,
686
+ borderColor: `transparent transparent ${vars.color} ${vars.color}`,
687
+ borderStyle: `solid`,
688
+ borderWidth: `2px`,
689
+ content: '',
690
+ display: `block`,
691
+ height: `1em`,
692
+ width: `1em`
693
+ }
694
+ }
695
+ });