@veracity/vui 0.3.1 → 0.3.2

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 (398) hide show
  1. package/avatar/avatar.d.ts +2 -2
  2. package/avatar/avatar.js +9 -29
  3. package/avatar/avatar.types.d.ts +9 -2
  4. package/avatar/helpers.d.ts +2 -0
  5. package/avatar/helpers.js +26 -0
  6. package/avatar/index.d.ts +1 -1
  7. package/avatar/index.js +1 -1
  8. package/avatar/theme.d.ts +1 -0
  9. package/avatar/theme.js +7 -0
  10. package/box/box.d.ts +2 -2
  11. package/box/box.js +9 -8
  12. package/box/box.types.d.ts +13 -2
  13. package/box/index.d.ts +1 -1
  14. package/box/index.js +1 -1
  15. package/box/theme.d.ts +1 -0
  16. package/box/theme.js +2 -0
  17. package/button/button.d.ts +7 -3
  18. package/button/button.js +24 -14
  19. package/button/button.types.d.ts +12 -30
  20. package/button/buttonIcon.d.ts +1 -0
  21. package/button/buttonIcon.js +3 -5
  22. package/button/buttonText.d.ts +1 -0
  23. package/button/buttonText.js +3 -5
  24. package/button/buttons.js +1 -1
  25. package/button/index.d.ts +2 -2
  26. package/button/index.js +3 -3
  27. package/button/theme.d.ts +1 -0
  28. package/button/theme.js +5 -3
  29. package/buttonGroup/buttonGroup.d.ts +5 -2
  30. package/buttonGroup/buttonGroup.js +12 -8
  31. package/buttonGroup/buttonGroup.types.d.ts +4 -2
  32. package/buttonGroup/helpers.d.ts +1 -1
  33. package/buttonGroup/helpers.js +1 -1
  34. package/buttonGroup/index.d.ts +1 -1
  35. package/buttonGroup/index.js +2 -2
  36. package/card/card.d.ts +4 -0
  37. package/card/card.js +8 -0
  38. package/card/card.types.d.ts +3 -2
  39. package/card/index.d.ts +1 -1
  40. package/card/index.js +1 -1
  41. package/card/theme.d.ts +1 -0
  42. package/card/theme.js +2 -0
  43. package/checkbox/checkbox.d.ts +5 -4
  44. package/checkbox/checkbox.js +20 -10
  45. package/checkbox/checkbox.types.d.ts +21 -4
  46. package/checkbox/checkboxGroup.d.ts +5 -2
  47. package/checkbox/checkboxGroup.js +11 -7
  48. package/checkbox/checkboxGroup.types.d.ts +9 -2
  49. package/checkbox/index.d.ts +1 -1
  50. package/checkbox/index.js +2 -2
  51. package/checkbox/theme.d.ts +1 -0
  52. package/checkbox/theme.js +2 -0
  53. package/core/index.d.ts +4 -5
  54. package/core/index.js +4 -12
  55. package/core/media.d.ts +38 -0
  56. package/core/media.js +79 -0
  57. package/core/styled.d.ts +3 -0
  58. package/core/styled.js +21 -3
  59. package/core/theme.d.ts +41 -0
  60. package/core/theme.js +94 -0
  61. package/core/vui.d.ts +31 -0
  62. package/core/vui.js +20 -0
  63. package/core/vuiProvider/fontFaces.js +4 -0
  64. package/core/{globalStyle.d.ts → vuiProvider/globalStyle.d.ts} +7 -0
  65. package/core/{globalStyle.js → vuiProvider/globalStyle.js} +17 -9
  66. package/core/vuiProvider/index.d.ts +5 -0
  67. package/{styles → core/vuiProvider}/index.js +8 -2
  68. package/core/{resetCSS.d.ts → vuiProvider/resetCSS.d.ts} +1 -0
  69. package/core/{resetCSS.js → vuiProvider/resetCSS.js} +2 -1
  70. package/core/vuiProvider/vuiProvider.d.ts +13 -0
  71. package/core/{vuiProvider.js → vuiProvider/vuiProvider.js} +3 -2
  72. package/divider/divider.d.ts +2 -2
  73. package/divider/divider.js +5 -4
  74. package/divider/divider.types.d.ts +5 -2
  75. package/divider/index.d.ts +1 -1
  76. package/divider/index.js +1 -1
  77. package/divider/theme.d.ts +1 -0
  78. package/divider/theme.js +2 -0
  79. package/footer/consts.d.ts +3 -0
  80. package/footer/consts.js +3 -0
  81. package/footer/footer.d.ts +3 -1
  82. package/footer/footer.js +21 -10
  83. package/footer/footer.types.d.ts +5 -0
  84. package/footer/footerColumn.d.ts +122 -121
  85. package/footer/footerColumn.js +1 -0
  86. package/footer/footerHeading.d.ts +1 -0
  87. package/footer/footerHeading.js +1 -0
  88. package/footer/footerLink.d.ts +1 -0
  89. package/footer/footerLink.js +1 -0
  90. package/footer/footerRow.d.ts +1 -0
  91. package/footer/footerRow.js +1 -0
  92. package/footer/footerSection.d.ts +1 -0
  93. package/footer/footerSection.js +2 -1
  94. package/footer/footerTrademark.d.ts +1 -0
  95. package/footer/footerTrademark.js +1 -0
  96. package/footer/index.d.ts +2 -1
  97. package/footer/index.js +2 -2
  98. package/footer/theme.d.ts +1 -0
  99. package/footer/theme.js +2 -0
  100. package/header/context.d.ts +4 -0
  101. package/header/context.js +23 -0
  102. package/header/header.d.ts +34 -0
  103. package/header/header.js +118 -0
  104. package/header/header.types.d.ts +84 -0
  105. package/header/headerContent.d.ts +4 -0
  106. package/header/headerContent.js +28 -0
  107. package/header/headerCreateAccount.d.ts +4 -0
  108. package/header/headerCreateAccount.js +44 -0
  109. package/header/headerDivider.d.ts +4 -0
  110. package/header/headerDivider.js +28 -0
  111. package/header/headerLink.d.ts +4 -0
  112. package/header/headerLink.js +43 -0
  113. package/header/headerLinks.d.ts +4 -0
  114. package/header/headerLinks.js +41 -0
  115. package/header/headerLogo.d.ts +4 -0
  116. package/header/headerLogo.js +48 -0
  117. package/header/headerMobileContent.d.ts +4 -0
  118. package/header/headerMobileContent.js +30 -0
  119. package/header/headerMobileToggle.d.ts +4 -0
  120. package/header/headerMobileToggle.js +34 -0
  121. package/header/headerNotifications.d.ts +4 -0
  122. package/header/headerNotifications.js +52 -0
  123. package/header/headerProfile.d.ts +4 -0
  124. package/header/headerProfile.js +101 -0
  125. package/header/headerProfile.types.d.ts +35 -0
  126. package/header/headerServices.d.ts +4 -0
  127. package/header/headerServices.js +51 -0
  128. package/header/headerSignIn.d.ts +4 -0
  129. package/header/headerSignIn.js +40 -0
  130. package/header/index.d.ts +17 -0
  131. package/header/index.js +34 -0
  132. package/header/loggedInHeader.d.ts +4 -0
  133. package/header/loggedInHeader.js +53 -0
  134. package/header/loggedOutHeader.d.ts +4 -0
  135. package/header/loggedOutHeader.js +54 -0
  136. package/header/theme.d.ts +32 -0
  137. package/header/theme.js +52 -0
  138. package/heading/heading.d.ts +2 -2
  139. package/heading/heading.js +5 -4
  140. package/heading/heading.types.d.ts +7 -2
  141. package/heading/headings.js +1 -1
  142. package/heading/index.d.ts +1 -1
  143. package/heading/index.js +2 -2
  144. package/heading/theme.d.ts +1 -0
  145. package/heading/theme.js +2 -0
  146. package/icon/helpers.js +2 -2
  147. package/icon/icon.d.ts +1 -0
  148. package/icon/icon.js +2 -2
  149. package/icon/icon.types.d.ts +7 -4
  150. package/icon/index.d.ts +1 -1
  151. package/icon/index.js +1 -1
  152. package/icon/theme.d.ts +1 -0
  153. package/icon/theme.js +2 -0
  154. package/icons/baseIcons/fal/falFileInvoiceDollar.d.ts +3 -0
  155. package/icons/baseIcons/fal/falFileInvoiceDollar.js +7 -0
  156. package/icons/baseIcons/icons.d.ts +1 -0
  157. package/icons/baseIcons/icons.js +5 -3
  158. package/icons/baseIcons/types.d.ts +1 -1
  159. package/icons/cache.d.ts +15 -0
  160. package/icons/{library.js → cache.js} +10 -6
  161. package/icons/index.d.ts +1 -1
  162. package/icons/index.js +3 -3
  163. package/icons/types.d.ts +10 -3
  164. package/image/image.d.ts +2 -0
  165. package/image/image.js +11 -2
  166. package/image/image.types.d.ts +3 -2
  167. package/image/index.d.ts +1 -1
  168. package/image/index.js +1 -1
  169. package/image/theme.d.ts +1 -0
  170. package/image/theme.js +2 -0
  171. package/index.d.ts +1 -1
  172. package/index.js +1 -1
  173. package/input/helpers.d.ts +1 -0
  174. package/input/helpers.js +1 -0
  175. package/input/index.d.ts +1 -1
  176. package/input/index.js +2 -2
  177. package/input/input.d.ts +7 -3
  178. package/input/input.js +17 -7
  179. package/input/input.types.d.ts +33 -4
  180. package/input/inputIcon.d.ts +1 -0
  181. package/input/inputIcon.js +2 -1
  182. package/input/inputInput.d.ts +2 -2
  183. package/input/inputInput.js +10 -5
  184. package/input/theme.d.ts +1 -0
  185. package/input/theme.js +2 -0
  186. package/link/index.d.ts +1 -1
  187. package/link/index.js +2 -2
  188. package/link/link.d.ts +6 -3
  189. package/link/link.js +15 -9
  190. package/link/link.types.d.ts +12 -4
  191. package/link/linkIcon.d.ts +1 -0
  192. package/link/linkIcon.js +3 -5
  193. package/link/linkText.d.ts +1 -0
  194. package/link/linkText.js +3 -5
  195. package/link/theme.d.ts +6 -0
  196. package/link/theme.js +9 -1
  197. package/list/index.d.ts +1 -1
  198. package/list/index.js +2 -2
  199. package/list/list.d.ts +3 -3
  200. package/list/list.js +13 -8
  201. package/list/list.types.d.ts +29 -8
  202. package/list/listDivider.d.ts +1 -0
  203. package/list/listDivider.js +3 -5
  204. package/list/listHeading.d.ts +1 -0
  205. package/list/listHeading.js +4 -6
  206. package/list/listIcon.d.ts +1 -0
  207. package/list/listIcon.js +3 -5
  208. package/list/listItem.d.ts +5 -2
  209. package/list/listItem.js +52 -19
  210. package/list/listText.d.ts +1 -0
  211. package/list/listText.js +3 -5
  212. package/list/theme.d.ts +1 -0
  213. package/list/theme.js +5 -2
  214. package/menu/menu.d.ts +1 -0
  215. package/menu/menu.js +1 -0
  216. package/menu/menu.types.d.ts +3 -0
  217. package/menu/menuButton.d.ts +1 -0
  218. package/menu/menuButton.js +3 -4
  219. package/menu/menuItem.d.ts +1 -0
  220. package/menu/menuItem.js +2 -1
  221. package/menu/menuList.d.ts +1 -0
  222. package/menu/menuList.js +3 -4
  223. package/menu/theme.d.ts +16 -2
  224. package/menu/theme.js +18 -3
  225. package/notification/index.d.ts +2 -2
  226. package/notification/index.js +3 -3
  227. package/notification/notification.d.ts +5 -1
  228. package/notification/notification.js +12 -27
  229. package/notification/notification.types.d.ts +10 -2
  230. package/notification/notificationButton.d.ts +1 -0
  231. package/notification/notificationButton.js +4 -5
  232. package/notification/notificationIcon.d.ts +1 -0
  233. package/notification/notificationIcon.js +7 -7
  234. package/notification/notificationText.d.ts +1 -0
  235. package/notification/notificationText.js +3 -5
  236. package/notification/notificationTitle.d.ts +1 -0
  237. package/notification/notificationTitle.js +3 -5
  238. package/notification/theme.d.ts +1 -0
  239. package/notification/theme.js +2 -0
  240. package/p/index.d.ts +1 -1
  241. package/p/index.js +1 -1
  242. package/p/p.d.ts +2 -2
  243. package/p/p.js +5 -4
  244. package/p/p.types.d.ts +7 -2
  245. package/p/theme.d.ts +1 -0
  246. package/p/theme.js +2 -0
  247. package/package.json +1 -1
  248. package/panel/index.d.ts +1 -1
  249. package/panel/index.js +1 -1
  250. package/panel/panel.d.ts +4 -0
  251. package/panel/panel.js +4 -0
  252. package/panel/panel.types.d.ts +1 -2
  253. package/panel/theme.d.ts +1 -0
  254. package/panel/theme.js +2 -0
  255. package/popover/consts.d.ts +6 -0
  256. package/popover/consts.js +42 -0
  257. package/popover/index.d.ts +1 -1
  258. package/popover/index.js +1 -1
  259. package/popover/popover.d.ts +5 -1
  260. package/popover/popover.js +16 -1
  261. package/popover/popover.types.d.ts +4 -1
  262. package/popover/popoverContent.d.ts +2 -1
  263. package/popover/popoverContent.js +6 -1
  264. package/popover/popoverTrigger.d.ts +4 -0
  265. package/popover/popoverTrigger.js +4 -0
  266. package/popover/theme.d.ts +1 -0
  267. package/popover/theme.js +2 -0
  268. package/popover/usePopover.d.ts +5 -0
  269. package/popover/usePopover.js +21 -11
  270. package/popover/usePopover.types.d.ts +17 -6
  271. package/radio/index.d.ts +1 -1
  272. package/radio/index.js +2 -2
  273. package/radio/radio.d.ts +5 -4
  274. package/radio/radio.js +20 -10
  275. package/radio/radio.types.d.ts +19 -4
  276. package/radio/radioGroup.d.ts +5 -2
  277. package/radio/radioGroup.js +11 -7
  278. package/radio/radioGroup.types.d.ts +10 -2
  279. package/radio/theme.d.ts +1 -0
  280. package/radio/theme.js +2 -0
  281. package/skeleton/index.d.ts +1 -1
  282. package/skeleton/index.js +1 -1
  283. package/skeleton/skeleton.d.ts +2 -2
  284. package/skeleton/skeleton.js +4 -3
  285. package/skeleton/skeleton.types.d.ts +5 -2
  286. package/skeleton/theme.d.ts +1 -0
  287. package/skeleton/theme.js +2 -0
  288. package/spinner/index.d.ts +1 -1
  289. package/spinner/index.js +1 -1
  290. package/spinner/spinner.d.ts +6 -2
  291. package/spinner/spinner.js +12 -5
  292. package/spinner/spinner.types.d.ts +10 -6
  293. package/spinner/theme.d.ts +1 -0
  294. package/spinner/theme.js +2 -0
  295. package/svg/helpers.d.ts +1 -1
  296. package/svg/index.d.ts +1 -1
  297. package/svg/index.js +1 -1
  298. package/svg/svg.d.ts +6 -1
  299. package/svg/svg.js +14 -5
  300. package/svg/svg.types.d.ts +6 -4
  301. package/switch/context.d.ts +2 -2
  302. package/switch/index.d.ts +1 -1
  303. package/switch/index.js +2 -2
  304. package/switch/switch.d.ts +6 -3
  305. package/switch/switch.js +15 -12
  306. package/switch/switch.types.d.ts +37 -4
  307. package/switch/switchButton.d.ts +5 -5
  308. package/switch/switchButton.js +34 -26
  309. package/switch/switchLabel.d.ts +1 -0
  310. package/switch/switchLabel.js +3 -5
  311. package/switch/theme.d.ts +1 -0
  312. package/switch/theme.js +2 -0
  313. package/system/animations.d.ts +3 -4
  314. package/system/backgrounds.d.ts +4 -5
  315. package/system/borders.d.ts +60 -61
  316. package/system/custom.d.ts +4 -4
  317. package/system/effects.d.ts +7 -8
  318. package/system/flexboxGrids.d.ts +5 -6
  319. package/system/flexboxes.d.ts +28 -29
  320. package/system/grids.d.ts +25 -26
  321. package/system/index.d.ts +0 -1
  322. package/system/index.js +0 -6
  323. package/system/interactivity.d.ts +11 -12
  324. package/system/layout.d.ts +31 -32
  325. package/system/sizing.d.ts +13 -14
  326. package/system/space.d.ts +37 -38
  327. package/system/system.d.ts +4 -5
  328. package/system/system.js +3 -1
  329. package/system/tables.d.ts +5 -6
  330. package/system/transforms.d.ts +22 -23
  331. package/system/transitions.d.ts +11 -12
  332. package/system/typography.d.ts +33 -34
  333. package/t/index.d.ts +1 -1
  334. package/t/index.js +1 -1
  335. package/t/t.d.ts +2 -2
  336. package/t/t.js +5 -4
  337. package/t/t.types.d.ts +8 -2
  338. package/t/theme.d.ts +1 -0
  339. package/t/theme.js +2 -0
  340. package/tag/index.d.ts +1 -1
  341. package/tag/index.js +2 -2
  342. package/tag/tag.d.ts +6 -3
  343. package/tag/tag.js +14 -7
  344. package/tag/tag.types.d.ts +16 -2
  345. package/tag/tagButton.d.ts +1 -0
  346. package/tag/tagButton.js +4 -16
  347. package/tag/tagIcon.d.ts +1 -0
  348. package/tag/tagIcon.js +3 -5
  349. package/tag/tagText.d.ts +1 -0
  350. package/tag/tagText.js +3 -5
  351. package/tag/theme.d.ts +1 -0
  352. package/tag/theme.js +8 -0
  353. package/textarea/helpers.d.ts +1 -0
  354. package/textarea/helpers.js +1 -0
  355. package/textarea/index.d.ts +1 -1
  356. package/textarea/index.js +1 -1
  357. package/textarea/textarea.d.ts +5 -3
  358. package/textarea/textarea.js +23 -10
  359. package/textarea/textarea.types.d.ts +22 -2
  360. package/textarea/theme.d.ts +1 -0
  361. package/textarea/theme.js +2 -0
  362. package/theme/components.d.ts +76 -2
  363. package/theme/components.js +38 -36
  364. package/theme/defaultTheme.d.ts +81 -2
  365. package/theme/foundations/colors.d.ts +10 -0
  366. package/theme/foundations/colors.js +8 -2
  367. package/theme/foundations/index.d.ts +5 -0
  368. package/theme/foundations/shadows.js +3 -3
  369. package/theme/foundations/transformers.js +3 -2
  370. package/theme/index.d.ts +1 -3
  371. package/theme/index.js +4 -5
  372. package/theme/types.d.ts +3 -2
  373. package/utils/assertion.d.ts +5 -5
  374. package/utils/assertion.js +8 -4
  375. package/utils/object.d.ts +2 -2
  376. package/utils/object.js +3 -1
  377. package/utils/styles.d.ts +2 -2
  378. package/utils/styles.js +4 -4
  379. package/utils/types.d.ts +8 -3
  380. package/core/types/component.d.ts +0 -25
  381. package/core/types/index.d.ts +0 -2
  382. package/core/types/index.js +0 -14
  383. package/core/types/themeGet.d.ts +0 -24
  384. package/core/utils.d.ts +0 -56
  385. package/core/utils.js +0 -194
  386. package/core/vuiProvider.d.ts +0 -20
  387. package/icons/library.d.ts +0 -11
  388. package/popover/plugins.d.ts +0 -3
  389. package/popover/plugins.js +0 -24
  390. package/styles/fontFaces.js +0 -4
  391. package/styles/helpers.d.ts +0 -4
  392. package/styles/helpers.js +0 -8
  393. package/styles/index.d.ts +0 -3
  394. /package/{styles → core/vuiProvider}/animations.d.ts +0 -0
  395. /package/{styles → core/vuiProvider}/animations.js +0 -0
  396. /package/{styles → core/vuiProvider}/fontFaces.d.ts +0 -0
  397. /package/{core/types/component.js → header/header.types.js} +0 -0
  398. /package/{core/types/themeGet.js → header/headerProfile.types.js} +0 -0
@@ -1,2 +0,0 @@
1
- export * from './component';
2
- export * from './themeGet';
@@ -1,14 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./component"), exports);
14
- __exportStar(require("./themeGet"), exports);
@@ -1,24 +0,0 @@
1
- import { IProps, ThemeGetter } from '@xstyled/styled-components';
2
- import { VuiTheme } from '../../theme';
3
- import { AnyString, AnyNumber } from '../../utils';
4
- declare type VuiThemeGetter<ThemeKey extends keyof VuiTheme> = ThemeGetter<keyof VuiTheme[ThemeKey] | AnyString | AnyNumber>;
5
- export interface ThemeGet {
6
- (path: string, defaultValue?: any): (props: IProps) => any;
7
- animation: VuiThemeGetter<'animations'>;
8
- borders: VuiThemeGetter<'borders'>;
9
- color: VuiThemeGetter<'colors'>;
10
- duration: VuiThemeGetter<'durations'>;
11
- font: VuiThemeGetter<'fonts'>;
12
- fontSize: VuiThemeGetter<'fontSizes'>;
13
- fontWeight: VuiThemeGetter<'fontWeights'>;
14
- radius: VuiThemeGetter<'radii'>;
15
- ringWidth: VuiThemeGetter<'ringWidths'>;
16
- screen: VuiThemeGetter<'screens'>;
17
- shadow: VuiThemeGetter<'shadows'>;
18
- size: VuiThemeGetter<'sizes'>;
19
- space: VuiThemeGetter<'spaces'>;
20
- transform: VuiThemeGetter<'transforms'>;
21
- transition: VuiThemeGetter<'transitions'>;
22
- zIndex: VuiThemeGetter<'zIndices'>;
23
- }
24
- export {};
package/core/utils.d.ts DELETED
@@ -1,56 +0,0 @@
1
- import { StyleGenerator } from '@xstyled/styled-components';
2
- import React from 'react';
3
- import { StyledProps } from 'styled-components';
4
- import { ThemeGet, VuiComponent, VuiComponentConfig } from './types';
5
- import { Screen, ThemingProps, VuiTheme, VuiThemeExtensions } from '../theme';
6
- import { AnyNumber, AnyString, Dict, PropsOf } from '../utils';
7
- /** Merges provided theme extensions and overrides with default VUI theme */
8
- export declare function extendTheme(extensions: VuiThemeExtensions): VuiTheme;
9
- /**
10
- * Provides configuration to the 'styled' function, which filters out xstyled system props
11
- * Return type is cast to {} in order to avoid messing up styled component's actual props definition.
12
- */
13
- export declare function forwardPropConfig(generator: StyleGenerator): {};
14
- declare type ScreenWidth = Screen | AnyNumber | AnyString;
15
- /** Returns CSS media string with appropriate min-width and max-width values */
16
- export declare const mediaBetween: (minWidth: ScreenWidth, maxWidth: ScreenWidth) => (props: StyledProps<unknown>) => string;
17
- /** Returns CSS media string with appropriate max-width value */
18
- export declare const mediaDown: (width: ScreenWidth) => (props: StyledProps<unknown>) => string;
19
- /** Returns CSS media string with appropriate min-width value */
20
- export declare const mediaUp: (width: ScreenWidth) => (props: StyledProps<unknown>) => string;
21
- /** Removes specific theming keys from the given props. */
22
- export declare function omitThemingProps<T extends ThemingProps>(props: T): Omit<T, "size" | "variant">;
23
- /**
24
- * Custom validator to prevent certain props from reaching the HTML element.
25
- * @param props - list of props to filter out
26
- */
27
- export declare function shouldForwardProp(props: string[]): (prop: string | number, defaultValidatorFn: (prop: string | number) => boolean) => boolean;
28
- /** Re-export of xstyled 'th' with custom typing and screen getter */
29
- declare const th: ThemeGet;
30
- export { th };
31
- /** Returns true of current viewport width is between provided min and max widths */
32
- export declare function useBetween(minWidth: ScreenWidth, maxWidth: ScreenWidth): boolean;
33
- /** Returns true of current viewport width is smaller than provided width */
34
- export declare function useDown(width: ScreenWidth): boolean;
35
- /** Returns viewport width and provided screen width as a number */
36
- export declare function useMedia(width: ScreenWidth): {
37
- value: number;
38
- viewportWidth: number | null;
39
- };
40
- /**
41
- * Retrieves and merges size and variant styling from a component's theme configuration.
42
- * @param component - name of any component configured in the theme
43
- * @param props - props object of the given component
44
- */
45
- export declare function useStyleConfig(component: keyof VuiTheme['components'], props?: any): Dict<any>;
46
- /** Returns theme value at the given path */
47
- export declare function useTh(path: keyof VuiTheme | AnyString, defaultValue?: any): any;
48
- /** Returns the theme object with extensions */
49
- export declare function useTheme(): VuiTheme;
50
- /** Returns true of current viewport width is larger or equal to provided width */
51
- export declare function useUp(width: ScreenWidth): boolean;
52
- /**
53
- * Component creation utility, which combines forwardRef, memo and ensures correct typing with all props included.
54
- * Config object allows toggling memoization and providing custom 'areEqual' function.
55
- */
56
- export declare function vui<C extends React.ElementType, Props = {}>(component: React.ForwardRefRenderFunction<any, PropsOf<C, Props>>, config?: VuiComponentConfig<C, Props>): VuiComponent<C, Props>;
package/core/utils.js DELETED
@@ -1,194 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- var __rest = (this && this.__rest) || function (s, e) {
33
- var t = {};
34
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
35
- t[p] = s[p];
36
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
37
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
38
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
39
- t[p[i]] = s[p[i]];
40
- }
41
- return t;
42
- };
43
- var __importDefault = (this && this.__importDefault) || function (mod) {
44
- return (mod && mod.__esModule) ? mod : { "default": mod };
45
- };
46
- Object.defineProperty(exports, "__esModule", { value: true });
47
- exports.vui = exports.useUp = exports.useTheme = exports.useTh = exports.useStyleConfig = exports.useMedia = exports.useDown = exports.useBetween = exports.th = exports.shouldForwardProp = exports.omitThemingProps = exports.mediaUp = exports.mediaDown = exports.mediaBetween = exports.forwardPropConfig = exports.extendTheme = void 0;
48
- var styled_components_1 = require("@xstyled/styled-components");
49
- var react_1 = __importStar(require("react"));
50
- var styled_components_2 = require("styled-components");
51
- var theme_1 = __importDefault(require("../theme"));
52
- var utils_1 = require("../utils");
53
- /** Merges provided theme extensions and overrides with default VUI theme */
54
- function extendTheme(extensions) {
55
- return (0, utils_1.merge)(theme_1.default, extensions);
56
- }
57
- exports.extendTheme = extendTheme;
58
- /**
59
- * Provides configuration to the 'styled' function, which filters out xstyled system props
60
- * Return type is cast to {} in order to avoid messing up styled component's actual props definition.
61
- */
62
- function forwardPropConfig(generator) {
63
- return {
64
- shouldForwardProp: function (prop, defaultValidatorFn) {
65
- if (typeof prop === 'string' && generator.meta.props.includes(prop))
66
- return false;
67
- return defaultValidatorFn(prop);
68
- }
69
- };
70
- }
71
- exports.forwardPropConfig = forwardPropConfig;
72
- /** Returns CSS media string with appropriate min-width and max-width values */
73
- var mediaBetween = function (minWidth, maxWidth) { return function (props) {
74
- return "@media (min-width: " + th.screen(minWidth)(props) + ") and (max-width: " + th.screen(maxWidth)(props) + ")";
75
- }; };
76
- exports.mediaBetween = mediaBetween;
77
- /** Returns CSS media string with appropriate max-width value */
78
- var mediaDown = function (width) { return function (props) {
79
- return "@media (max-width: " + th.screen(width)(props) + ")";
80
- }; };
81
- exports.mediaDown = mediaDown;
82
- /** Returns CSS media string with appropriate min-width value */
83
- var mediaUp = function (width) { return function (props) {
84
- return "@media (min-width: " + th.screen(width)(props) + ")";
85
- }; };
86
- exports.mediaUp = mediaUp;
87
- /** Removes specific theming keys from the given props. */
88
- function omitThemingProps(props) {
89
- var size = props.size, variant = props.variant, rest = __rest(props, ["size", "variant"]); // eslint-disable-line @typescript-eslint/no-unused-vars
90
- return rest;
91
- }
92
- exports.omitThemingProps = omitThemingProps;
93
- /**
94
- * Custom validator to prevent certain props from reaching the HTML element.
95
- * @param props - list of props to filter out
96
- */
97
- function shouldForwardProp(props) {
98
- return function (prop, defaultValidatorFn) {
99
- if (props.includes(prop.toString()))
100
- return false;
101
- return defaultValidatorFn(prop);
102
- };
103
- }
104
- exports.shouldForwardProp = shouldForwardProp;
105
- /** Re-export of xstyled 'th' with custom typing and screen getter */
106
- var th = styled_components_1.th;
107
- exports.th = th;
108
- th.screen = (0, styled_components_1.themeGetter)({
109
- name: 'screen',
110
- key: 'screens',
111
- compose: styled_components_1.getPx
112
- });
113
- /** Returns true of current viewport width is between provided min and max widths */
114
- function useBetween(minWidth, maxWidth) {
115
- var isDown = useDown(maxWidth);
116
- var isUp = useUp(minWidth);
117
- return isDown && isUp;
118
- }
119
- exports.useBetween = useBetween;
120
- /** Returns true of current viewport width is smaller than provided width */
121
- function useDown(width) {
122
- var _a = useMedia(width), value = _a.value, viewportWidth = _a.viewportWidth;
123
- return viewportWidth !== null && value !== null && viewportWidth < value;
124
- }
125
- exports.useDown = useDown;
126
- /** Returns viewport width and provided screen width as a number */
127
- function useMedia(width) {
128
- var theme = useTheme();
129
- var viewportWidth = (0, styled_components_1.useViewportWidth)();
130
- var valueString = th.screen(width)({ theme: theme });
131
- var value = Number(valueString.replace('px', ''));
132
- return { value: value, viewportWidth: viewportWidth };
133
- }
134
- exports.useMedia = useMedia;
135
- /**
136
- * Retrieves and merges size and variant styling from a component's theme configuration.
137
- * @param component - name of any component configured in the theme
138
- * @param props - props object of the given component
139
- */
140
- function useStyleConfig(component, props) {
141
- var _a;
142
- if (props === void 0) { props = {}; }
143
- var theme = useTheme();
144
- var _b = (_a = theme === null || theme === void 0 ? void 0 : theme.components[component]) !== null && _a !== void 0 ? _a : {}, baseStyle = _b.baseStyle, defaultProps = _b.defaultProps, _c = _b.parts, parts = _c === void 0 ? [] : _c, sizes = _b.sizes, variants = _b.variants;
145
- var mergedProps = __assign(__assign({}, defaultProps), props);
146
- var colorScheme = mergedProps.colorScheme, size = mergedProps.size, variant = mergedProps.variant;
147
- return (0, react_1.useMemo)(function () {
148
- var _a, _b, _c;
149
- var baseStyles = (_a = (0, utils_1.runIfFn)(baseStyle, mergedProps)) !== null && _a !== void 0 ? _a : {};
150
- var sizeStyles = (_b = (0, utils_1.runIfFn)(sizes === null || sizes === void 0 ? void 0 : sizes[size], mergedProps)) !== null && _b !== void 0 ? _b : {};
151
- var variantStyles = (_c = (0, utils_1.runIfFn)(variants === null || variants === void 0 ? void 0 : variants[variant], mergedProps)) !== null && _c !== void 0 ? _c : {};
152
- var styles = {};
153
- if (parts.length > 0) {
154
- parts.forEach(function (part) {
155
- var _a, _b, _c;
156
- styles[part] = (0, utils_1.merge)((_a = baseStyles[part]) !== null && _a !== void 0 ? _a : {}, (_b = sizeStyles[part]) !== null && _b !== void 0 ? _b : {}, (_c = variantStyles[part]) !== null && _c !== void 0 ? _c : {});
157
- });
158
- }
159
- else {
160
- styles = (0, utils_1.merge)(baseStyles, sizeStyles, variantStyles);
161
- }
162
- return styles;
163
- }, [colorScheme, size, variant]);
164
- }
165
- exports.useStyleConfig = useStyleConfig;
166
- /** Returns theme value at the given path */
167
- function useTh(path, defaultValue) {
168
- var theme = useTheme();
169
- return th(path, defaultValue)({ theme: theme });
170
- }
171
- exports.useTh = useTh;
172
- /** Returns the theme object with extensions */
173
- function useTheme() {
174
- return (0, styled_components_2.useTheme)();
175
- }
176
- exports.useTheme = useTheme;
177
- /** Returns true of current viewport width is larger or equal to provided width */
178
- function useUp(width) {
179
- var _a = useMedia(width), value = _a.value, viewportWidth = _a.viewportWidth;
180
- return viewportWidth !== null && value !== null && viewportWidth >= value;
181
- }
182
- exports.useUp = useUp;
183
- /**
184
- * Component creation utility, which combines forwardRef, memo and ensures correct typing with all props included.
185
- * Config object allows toggling memoization and providing custom 'areEqual' function.
186
- */
187
- function vui(component, config) {
188
- var _a = config !== null && config !== void 0 ? config : {}, memoCompare = _a.memoCompare, _b = _a.isMemo, isMemo = _b === void 0 ? true : _b;
189
- if (isMemo) {
190
- return react_1.default.memo(react_1.default.forwardRef(component), memoCompare);
191
- }
192
- return react_1.default.forwardRef(component);
193
- }
194
- exports.vui = vui;
@@ -1,20 +0,0 @@
1
- import { FC } from 'react';
2
- import { VuiTheme } from '../theme';
3
- declare type VuiProviderProps = {
4
- /**
5
- * Adds basic styles to body
6
- * @default true
7
- */
8
- globalStyle?: boolean;
9
- /**
10
- * Applies custom CSS reset
11
- * @default true
12
- */
13
- resetCSS?: boolean;
14
- /**
15
- * Modified theme config using 'extendTheme' utility
16
- */
17
- theme?: VuiTheme;
18
- };
19
- declare const VuiProvider: FC<VuiProviderProps>;
20
- export default VuiProvider;
@@ -1,11 +0,0 @@
1
- import { IconDefinition } from './types';
2
- declare class Library {
3
- cache: Map<string, IconDefinition>;
4
- add: (...icons: IconDefinition[]) => void;
5
- get: (name: string) => IconDefinition | undefined;
6
- has: (name: string) => boolean;
7
- init: () => void;
8
- reset: () => void;
9
- }
10
- declare const library: Library;
11
- export default library;
@@ -1,3 +0,0 @@
1
- import { Plugin } from 'tippy.js';
2
- /** Closes the popper if 'Escape' is pressed. */
3
- export declare const closeOnEscPlugin: Plugin;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.closeOnEscPlugin = void 0;
4
- /** Closes the popper if 'Escape' is pressed. */
5
- exports.closeOnEscPlugin = {
6
- name: 'closeOnEsc',
7
- defaultValue: true,
8
- fn: function (_a) {
9
- var hide = _a.hide;
10
- function onKeyDown(e) {
11
- if (e.key === 'Escape') {
12
- hide();
13
- }
14
- }
15
- return {
16
- onHide: function () {
17
- document.removeEventListener('keydown', onKeyDown);
18
- },
19
- onShow: function () {
20
- document.addEventListener('keydown', onKeyDown);
21
- }
22
- };
23
- }
24
- };
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var core_1 = require("../core");
4
- exports.default = "\n\t@font-face {\n\t\tfont-family: 'Avenir Next';\n\t\tsrc: url('" + core_1.cdnUrl + "/common/fonts/avenir-regular-lat-ext.woff');\n\t\tfont-weight: 400;\n\t}\n\n\t@font-face {\n\t\tfont-family: 'Avenir Next';\n\t\tsrc: url('" + core_1.cdnUrl + "/common/fonts/avenir-medium-lat-ext.woff');\n\t\tfont-weight: 500;\n\t}\n\n\t@font-face {\n\t\tfont-family: 'Avenir Next';\n\t\tsrc: url('" + core_1.cdnUrl + "/common/fonts/avenir-demi-lat-ext.woff');\n\t\tfont-weight: 600;\n\t}\n\n\t@font-face {\n\t\tfont-family: 'Avenir Next';\n\t\tsrc: url('" + core_1.cdnUrl + "/common/fonts/avenir-bold-lat-ext.woff');\n\t\tfont-weight: 700;\n\t}\n";
@@ -1,4 +0,0 @@
1
- export declare const lineClamp: (maxLines: number) => string;
2
- export declare const resetLink = "\n\ttext-decoration: none;\n\tcolor: inherit;\n";
3
- export declare const resetList = "\n\tlist-style: none;\n\tpadding-left: 0;\n";
4
- export declare const truncateText = "\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n";
package/styles/helpers.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.truncateText = exports.resetList = exports.resetLink = exports.lineClamp = void 0;
4
- var lineClamp = function (maxLines) { return "\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: " + maxLines + ";\n\t-webkit-box-orient: vertical; \n\toverflow: hidden;\n"; };
5
- exports.lineClamp = lineClamp;
6
- exports.resetLink = "\n\ttext-decoration: none;\n\tcolor: inherit;\n";
7
- exports.resetList = "\n\tlist-style: none;\n\tpadding-left: 0;\n";
8
- exports.truncateText = "\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n";
package/styles/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './animations';
2
- export * from './helpers';
3
- export { default as fontFaces } from './fontFaces';
File without changes
File without changes
File without changes