@adamjanicki/ui 1.8.3 → 1.8.4

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 (264) hide show
  1. package/build/components/Accordion/Accordion.js +1 -0
  2. package/build/components/Accordion/index.d.ts +1 -0
  3. package/build/components/Accordion/index.js +1 -0
  4. package/build/components/Alert/Alert.js +1 -0
  5. package/build/components/Alert/index.d.ts +1 -0
  6. package/build/components/Alert/index.js +1 -0
  7. package/build/components/Animated/Animated.js +1 -0
  8. package/build/components/Animated/index.d.ts +1 -0
  9. package/build/components/Animated/index.js +1 -0
  10. package/build/components/Avatar/Avatar.js +1 -0
  11. package/build/components/Avatar/index.d.ts +1 -0
  12. package/build/components/Avatar/index.js +1 -0
  13. package/build/components/Badge/Badge.js +1 -0
  14. package/build/components/Badge/index.d.ts +1 -0
  15. package/build/components/Badge/index.js +1 -0
  16. package/build/components/Banner/Banner.js +1 -0
  17. package/build/components/Banner/index.d.ts +1 -0
  18. package/build/components/Banner/index.js +1 -0
  19. package/build/components/Box/Box.js +1 -0
  20. package/build/components/Box/index.d.ts +1 -0
  21. package/build/components/Box/index.js +1 -0
  22. package/{components → build/components}/Button/Button.d.ts +0 -21
  23. package/build/components/Button/Button.js +1 -0
  24. package/build/components/Button/IconButton.d.ts +25 -0
  25. package/build/components/Button/IconButton.js +1 -0
  26. package/build/components/Button/index.d.ts +3 -0
  27. package/build/components/Button/index.js +1 -0
  28. package/build/components/Carousel/Carousel.js +1 -0
  29. package/build/components/Carousel/index.d.ts +1 -0
  30. package/build/components/Carousel/index.js +1 -0
  31. package/build/components/ClickOutside/ClickOutside.js +1 -0
  32. package/build/components/ClickOutside/index.d.ts +1 -0
  33. package/build/components/ClickOutside/index.js +1 -0
  34. package/build/components/ErrorBoundary/ErrorBoundary.js +1 -0
  35. package/build/components/ErrorBoundary/index.d.ts +1 -0
  36. package/build/components/ErrorBoundary/index.js +1 -0
  37. package/build/components/Hamburger/DoubleCross.js +1 -0
  38. package/build/components/Hamburger/DoubleFlip.js +1 -0
  39. package/build/components/Hamburger/DoubleSpin.js +1 -0
  40. package/build/components/Hamburger/Hamburger.js +1 -0
  41. package/build/components/Hamburger/TripleFade.js +1 -0
  42. package/build/components/Hamburger/TripleFlip.js +1 -0
  43. package/build/components/Hamburger/TriplePrestige.js +1 -0
  44. package/build/components/Hamburger/TripleSpin.js +1 -0
  45. package/{components → build/components}/Hamburger/index.d.ts +2 -3
  46. package/build/components/Hamburger/index.js +1 -0
  47. package/build/components/Icon/Icon.js +1 -0
  48. package/build/components/Icon/icons.js +1 -0
  49. package/build/components/Icon/index.d.ts +1 -0
  50. package/build/components/Icon/index.js +1 -0
  51. package/build/components/Input/IconInput.js +1 -0
  52. package/build/components/Input/Input.js +1 -0
  53. package/build/components/Input/TextArea.js +1 -0
  54. package/build/components/Input/index.d.ts +3 -0
  55. package/build/components/Input/index.js +1 -0
  56. package/build/components/Layer/Layer.js +1 -0
  57. package/build/components/Layer/index.d.ts +1 -0
  58. package/build/components/Layer/index.js +1 -0
  59. package/build/components/Modal/Modal.js +1 -0
  60. package/build/components/Modal/index.d.ts +1 -0
  61. package/build/components/Modal/index.js +1 -0
  62. package/build/components/Select/Select.js +1 -0
  63. package/build/components/Select/index.d.ts +1 -0
  64. package/build/components/Select/index.js +1 -0
  65. package/build/components/Spinner/Spinner.js +1 -0
  66. package/build/components/Spinner/index.d.ts +1 -0
  67. package/build/components/Spinner/index.js +1 -0
  68. package/build/components/ui.js +1 -0
  69. package/build/functions/assertDefined.js +1 -0
  70. package/build/functions/classNames.js +1 -0
  71. package/build/functions/getDeviceType.js +1 -0
  72. package/build/functions/index.d.ts +4 -0
  73. package/build/functions/index.js +1 -0
  74. package/build/functions/scrollToId.js +1 -0
  75. package/build/hooks/index.js +1 -0
  76. package/build/hooks/useFocusTrap.js +1 -0
  77. package/build/hooks/useMediaQuery.js +1 -0
  78. package/build/hooks/useMergeRefs.js +1 -0
  79. package/build/hooks/useScroll.js +1 -0
  80. package/build/hooks/useScrollLock.js +1 -0
  81. package/build/hooks/useScrollToHash.js +1 -0
  82. package/build/hooks/useWindowResize.js +1 -0
  83. package/{index.d.ts → build/index.d.ts} +1 -3
  84. package/build/index.js +1 -0
  85. package/{components/Link → build/navigation}/Link.d.ts +4 -4
  86. package/build/navigation/Link.js +1 -0
  87. package/build/navigation/PathParamsContext.js +1 -0
  88. package/build/navigation/Route.js +1 -0
  89. package/build/navigation/Router.js +1 -0
  90. package/build/navigation/RouterContext.js +1 -0
  91. package/{router → build/navigation}/Routes.d.ts +1 -1
  92. package/build/navigation/Routes.js +1 -0
  93. package/build/navigation/history.js +1 -0
  94. package/build/navigation/hooks/useLocation.js +1 -0
  95. package/build/navigation/hooks/useNavigate.js +1 -0
  96. package/build/navigation/hooks/usePathParams.js +1 -0
  97. package/build/navigation/hooks/useRouterContext.js +1 -0
  98. package/build/navigation/hooks/useSearchParams.js +1 -0
  99. package/build/navigation/href.js +1 -0
  100. package/{router → build/navigation}/index.d.ts +1 -0
  101. package/build/navigation/index.js +1 -0
  102. package/build/navigation/path.js +1 -0
  103. package/build/navigation/string.js +1 -0
  104. package/build/navigation/types.js +0 -0
  105. package/build/utils/transformVfx.js +1 -0
  106. package/{utils → build/utils}/types.d.ts +1 -1
  107. package/build/utils/types.js +0 -0
  108. package/package.json +19 -8
  109. package/components/Accordion/Accordion.js +0 -56
  110. package/components/Accordion/index.d.ts +0 -2
  111. package/components/Accordion/index.js +0 -2
  112. package/components/Alert/Alert.js +0 -31
  113. package/components/Alert/index.d.ts +0 -2
  114. package/components/Alert/index.js +0 -2
  115. package/components/Animated/Animated.js +0 -94
  116. package/components/Animated/index.d.ts +0 -2
  117. package/components/Animated/index.js +0 -2
  118. package/components/Avatar/Avatar.js +0 -57
  119. package/components/Avatar/index.d.ts +0 -2
  120. package/components/Avatar/index.js +0 -2
  121. package/components/Badge/Badge.js +0 -31
  122. package/components/Badge/index.d.ts +0 -2
  123. package/components/Badge/index.js +0 -2
  124. package/components/Banner/Banner.js +0 -31
  125. package/components/Banner/index.d.ts +0 -2
  126. package/components/Banner/index.js +0 -2
  127. package/components/Box/Box.js +0 -3
  128. package/components/Box/index.d.ts +0 -2
  129. package/components/Box/index.js +0 -2
  130. package/components/Button/Button.js +0 -52
  131. package/components/Button/index.d.ts +0 -3
  132. package/components/Button/index.js +0 -3
  133. package/components/Carousel/Carousel.js +0 -106
  134. package/components/Carousel/index.d.ts +0 -2
  135. package/components/Carousel/index.js +0 -2
  136. package/components/ClickOutside/ClickOutside.js +0 -55
  137. package/components/ClickOutside/index.d.ts +0 -2
  138. package/components/ClickOutside/index.js +0 -2
  139. package/components/ErrorBoundary/ErrorBoundary.js +0 -61
  140. package/components/ErrorBoundary/index.d.ts +0 -2
  141. package/components/ErrorBoundary/index.js +0 -2
  142. package/components/Hamburger/DoubleCross.js +0 -39
  143. package/components/Hamburger/DoubleFlip.js +0 -39
  144. package/components/Hamburger/DoubleSpin.js +0 -40
  145. package/components/Hamburger/Hamburger.js +0 -66
  146. package/components/Hamburger/TripleFade.js +0 -40
  147. package/components/Hamburger/TripleFlip.js +0 -40
  148. package/components/Hamburger/TriplePrestige.js +0 -40
  149. package/components/Hamburger/TripleSpin.js +0 -41
  150. package/components/Hamburger/index.js +0 -9
  151. package/components/Icon/Icon.js +0 -32
  152. package/components/Icon/icons.js +0 -179
  153. package/components/Icon/index.d.ts +0 -2
  154. package/components/Icon/index.js +0 -2
  155. package/components/Input/IconInput.js +0 -33
  156. package/components/Input/Input.js +0 -31
  157. package/components/Input/TextArea.js +0 -31
  158. package/components/Input/index.d.ts +0 -5
  159. package/components/Input/index.js +0 -5
  160. package/components/Layer/Layer.js +0 -63
  161. package/components/Layer/index.d.ts +0 -2
  162. package/components/Layer/index.js +0 -2
  163. package/components/Link/Link.js +0 -75
  164. package/components/Link/index.d.ts +0 -3
  165. package/components/Link/index.js +0 -3
  166. package/components/Modal/Modal.js +0 -48
  167. package/components/Modal/index.d.ts +0 -2
  168. package/components/Modal/index.js +0 -2
  169. package/components/Select/Select.js +0 -34
  170. package/components/Select/index.d.ts +0 -2
  171. package/components/Select/index.js +0 -2
  172. package/components/Spinner/Spinner.js +0 -31
  173. package/components/Spinner/index.d.ts +0 -2
  174. package/components/Spinner/index.js +0 -2
  175. package/components/ui.js +0 -44
  176. package/functions/assertDefined.js +0 -13
  177. package/functions/classNames.js +0 -16
  178. package/functions/getDeviceType.js +0 -17
  179. package/functions/index.d.ts +0 -5
  180. package/functions/index.js +0 -5
  181. package/functions/scrollToId.js +0 -17
  182. package/hooks/index.js +0 -7
  183. package/hooks/useFocusTrap.js +0 -48
  184. package/hooks/useMediaQuery.js +0 -28
  185. package/hooks/useMergeRefs.js +0 -24
  186. package/hooks/useScroll.js +0 -23
  187. package/hooks/useScrollLock.js +0 -45
  188. package/hooks/useScrollToHash.js +0 -21
  189. package/hooks/useWindowResize.js +0 -13
  190. package/index.js +0 -31
  191. package/router/PathParamsContext.js +0 -3
  192. package/router/Route.js +0 -6
  193. package/router/Router.js +0 -36
  194. package/router/RouterContext.js +0 -3
  195. package/router/Routes.js +0 -31
  196. package/router/history.js +0 -46
  197. package/router/hooks/useLocation.js +0 -10
  198. package/router/hooks/useNavigate.js +0 -10
  199. package/router/hooks/usePathParams.js +0 -15
  200. package/router/hooks/useRouterContext.js +0 -9
  201. package/router/hooks/useSearchParams.js +0 -47
  202. package/router/href.js +0 -43
  203. package/router/index.js +0 -7
  204. package/router/path.js +0 -38
  205. package/router/string.js +0 -6
  206. package/router/types.js +0 -1
  207. package/utils/transformVfx.js +0 -212
  208. package/utils/types.js +0 -1
  209. /package/{components → build/components}/Accordion/Accordion.d.ts +0 -0
  210. /package/{components → build/components}/Alert/Alert.d.ts +0 -0
  211. /package/{components → build/components}/Animated/Animated.d.ts +0 -0
  212. /package/{components → build/components}/Avatar/Avatar.d.ts +0 -0
  213. /package/{components → build/components}/Badge/Badge.d.ts +0 -0
  214. /package/{components → build/components}/Banner/Banner.d.ts +0 -0
  215. /package/{components → build/components}/Box/Box.d.ts +0 -0
  216. /package/{components → build/components}/Carousel/Carousel.d.ts +0 -0
  217. /package/{components → build/components}/ClickOutside/ClickOutside.d.ts +0 -0
  218. /package/{components → build/components}/ErrorBoundary/ErrorBoundary.d.ts +0 -0
  219. /package/{components → build/components}/Hamburger/DoubleCross.d.ts +0 -0
  220. /package/{components → build/components}/Hamburger/DoubleFlip.d.ts +0 -0
  221. /package/{components → build/components}/Hamburger/DoubleSpin.d.ts +0 -0
  222. /package/{components → build/components}/Hamburger/Hamburger.d.ts +0 -0
  223. /package/{components → build/components}/Hamburger/TripleFade.d.ts +0 -0
  224. /package/{components → build/components}/Hamburger/TripleFlip.d.ts +0 -0
  225. /package/{components → build/components}/Hamburger/TriplePrestige.d.ts +0 -0
  226. /package/{components → build/components}/Hamburger/TripleSpin.d.ts +0 -0
  227. /package/{components → build/components}/Icon/Icon.d.ts +0 -0
  228. /package/{components → build/components}/Icon/icons.d.ts +0 -0
  229. /package/{components → build/components}/Input/IconInput.d.ts +0 -0
  230. /package/{components → build/components}/Input/Input.d.ts +0 -0
  231. /package/{components → build/components}/Input/TextArea.d.ts +0 -0
  232. /package/{components → build/components}/Layer/Layer.d.ts +0 -0
  233. /package/{components → build/components}/Modal/Modal.d.ts +0 -0
  234. /package/{components → build/components}/Select/Select.d.ts +0 -0
  235. /package/{components → build/components}/Spinner/Spinner.d.ts +0 -0
  236. /package/{components → build/components}/ui.d.ts +0 -0
  237. /package/{functions → build/functions}/assertDefined.d.ts +0 -0
  238. /package/{functions → build/functions}/classNames.d.ts +0 -0
  239. /package/{functions → build/functions}/getDeviceType.d.ts +0 -0
  240. /package/{functions → build/functions}/scrollToId.d.ts +0 -0
  241. /package/{hooks → build/hooks}/index.d.ts +0 -0
  242. /package/{hooks → build/hooks}/useFocusTrap.d.ts +0 -0
  243. /package/{hooks → build/hooks}/useMediaQuery.d.ts +0 -0
  244. /package/{hooks → build/hooks}/useMergeRefs.d.ts +0 -0
  245. /package/{hooks → build/hooks}/useScroll.d.ts +0 -0
  246. /package/{hooks → build/hooks}/useScrollLock.d.ts +0 -0
  247. /package/{hooks → build/hooks}/useScrollToHash.d.ts +0 -0
  248. /package/{hooks → build/hooks}/useWindowResize.d.ts +0 -0
  249. /package/{router → build/navigation}/PathParamsContext.d.ts +0 -0
  250. /package/{router → build/navigation}/Route.d.ts +0 -0
  251. /package/{router → build/navigation}/Router.d.ts +0 -0
  252. /package/{router → build/navigation}/RouterContext.d.ts +0 -0
  253. /package/{router → build/navigation}/history.d.ts +0 -0
  254. /package/{router → build/navigation}/hooks/useLocation.d.ts +0 -0
  255. /package/{router → build/navigation}/hooks/useNavigate.d.ts +0 -0
  256. /package/{router → build/navigation}/hooks/usePathParams.d.ts +0 -0
  257. /package/{router → build/navigation}/hooks/useRouterContext.d.ts +0 -0
  258. /package/{router → build/navigation}/hooks/useSearchParams.d.ts +0 -0
  259. /package/{router → build/navigation}/href.d.ts +0 -0
  260. /package/{router → build/navigation}/path.d.ts +0 -0
  261. /package/{router → build/navigation}/string.d.ts +0 -0
  262. /package/{router → build/navigation}/types.d.ts +0 -0
  263. /package/{style.css → build/style.css} +0 -0
  264. /package/{utils → build/utils}/transformVfx.d.ts +0 -0
@@ -1,47 +0,0 @@
1
- import React from "react";
2
- import useRouterContext from "./useRouterContext";
3
- function deserialize(search) {
4
- var urlSearchParams = new URLSearchParams(search);
5
- var searchParams = {};
6
- urlSearchParams.forEach(function (value, key) {
7
- var existing = searchParams[key];
8
- if (existing === undefined) {
9
- searchParams[key] = value;
10
- }
11
- else if (Array.isArray(existing)) {
12
- existing.push(value);
13
- }
14
- else {
15
- searchParams[key] = [existing, value];
16
- }
17
- });
18
- return searchParams;
19
- }
20
- function serialize(params) {
21
- var urlSearchParams = new URLSearchParams();
22
- Object.entries(params).forEach(function (_a) {
23
- var key = _a[0], value = _a[1];
24
- if (value !== undefined) {
25
- if (Array.isArray(value)) {
26
- value.forEach(function (subvalue) { return urlSearchParams.append(key, subvalue); });
27
- }
28
- else {
29
- urlSearchParams.set(key, value);
30
- }
31
- }
32
- });
33
- var stringified = urlSearchParams.toString();
34
- return stringified ? "?".concat(stringified) : "";
35
- }
36
- export default function useSearchParams() {
37
- var router = useRouterContext("useSearchParams()");
38
- var location = router.location, navigate = router.navigate;
39
- var pathname = location.pathname, hash = location.hash, search = location.search;
40
- var params = React.useMemo(function () { return deserialize(search); }, [search]);
41
- var setSearchParams = React.useCallback(function (next) {
42
- var nextParams = typeof next === "function" ? next(params) : next;
43
- var url = pathname + serialize(nextParams) + hash;
44
- navigate(url);
45
- }, [navigate, pathname, hash, params]);
46
- return [params, setSearchParams];
47
- }
package/router/href.js DELETED
@@ -1,43 +0,0 @@
1
- import { popSlash, prependSlash } from "./string";
2
- // computes href given to, current pathname, and optional basename
3
- export function getHref(to, pathname, normalizedBasename) {
4
- // external
5
- if (isExternal(to))
6
- return { type: "external", url: to };
7
- // hash only
8
- if (to.startsWith("#"))
9
- return { type: "octo", url: to };
10
- var type = "internal";
11
- // absolute
12
- if (to.startsWith("/")) {
13
- return { type: type, url: normalizedBasename + to };
14
- }
15
- // relative
16
- pathname = stripBasename(prependSlash(pathname), normalizedBasename);
17
- if (!to || to.startsWith("#"))
18
- return { type: type, url: normalizedBasename + pathname + to };
19
- return {
20
- type: type,
21
- url: normalizedBasename + popSlash(pathname) + prependSlash(to),
22
- };
23
- }
24
- // formats with a starting slash and removes trailing slash
25
- export function normalizeBasename(basename) {
26
- if (!basename || basename === "/")
27
- return "";
28
- return prependSlash(popSlash(basename));
29
- }
30
- // simple heuristic check
31
- export function isExternal(to) {
32
- return /^(https?:\/\/|mailto:|tel:)/i.test(to);
33
- }
34
- export function stripBasename(pathname, basename) {
35
- if (!basename)
36
- return pathname;
37
- if (pathname === basename)
38
- return "/";
39
- if (pathname.startsWith(basename + "/")) {
40
- return pathname.slice(basename.length);
41
- }
42
- return pathname;
43
- }
package/router/index.js DELETED
@@ -1,7 +0,0 @@
1
- export { default as useLocation } from "./hooks/useLocation";
2
- export { default as useNavigate } from "./hooks/useNavigate";
3
- export { default as usePathParams } from "./hooks/usePathParams";
4
- export { default as useSearchParams } from "./hooks/useSearchParams";
5
- export { default as Router } from "./Router";
6
- export { default as Route } from "./Route";
7
- export { default as Routes } from "./Routes";
package/router/path.js DELETED
@@ -1,38 +0,0 @@
1
- import { popSlash, prependSlash } from "./string";
2
- function normalizePath(path) {
3
- path = prependSlash(path);
4
- if (path.length > 1) {
5
- path = popSlash(path);
6
- }
7
- return path;
8
- }
9
- // false == no match
10
- export function matchPath(pattern, pathname) {
11
- var normalizedPattern = normalizePath(pattern);
12
- var normalizedPathname = normalizePath(pathname);
13
- if (!normalizedPattern.includes(":")) {
14
- return normalizedPattern === normalizedPathname ? {} : false;
15
- }
16
- var patternSegments = normalizedPattern.split("/").filter(Boolean);
17
- var pathSegments = normalizedPathname.split("/").filter(Boolean);
18
- if (patternSegments.length !== pathSegments.length) {
19
- return false;
20
- }
21
- var params = {};
22
- for (var i = 0; i < patternSegments.length; i++) {
23
- var patternSegment = patternSegments[i];
24
- var pathSegment = pathSegments[i];
25
- // dynamic
26
- if (patternSegment.startsWith(":")) {
27
- var paramName = patternSegment.slice(1).trim();
28
- if (!paramName)
29
- return false;
30
- params[paramName] = pathSegment;
31
- }
32
- // static
33
- else if (patternSegment !== pathSegment) {
34
- return false;
35
- }
36
- }
37
- return params;
38
- }
package/router/string.js DELETED
@@ -1,6 +0,0 @@
1
- export function prependSlash(str) {
2
- return str.startsWith("/") ? str : "/".concat(str);
3
- }
4
- export function popSlash(str) {
5
- return str.replace(/\/$/, "");
6
- }
package/router/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,212 +0,0 @@
1
- var transformers = {
2
- // --- Layout ---
3
- pos: function (_a) {
4
- var pos = _a.pos;
5
- return "aui-pos-".concat(pos);
6
- },
7
- axis: function (_a) {
8
- var axis = _a.axis;
9
- return "aui-flex-".concat(axis);
10
- },
11
- gap: function (_a) {
12
- var gap = _a.gap;
13
- return "aui-gap-".concat(gap);
14
- },
15
- align: function (_a) {
16
- var align = _a.align;
17
- return "aui-align-".concat(align);
18
- },
19
- justify: function (_a) {
20
- var justify = _a.justify;
21
- return "aui-justify-".concat(justify);
22
- },
23
- stretch: function (_a) {
24
- var stretch = _a.stretch;
25
- return "aui-stretch-".concat(stretch);
26
- },
27
- wrap: function () { return "aui-flex-wrap"; },
28
- overflow: function (_a) {
29
- var overflow = _a.overflow;
30
- return "aui-ov-".concat(overflow);
31
- },
32
- overflowX: function (_a) {
33
- var overflowX = _a.overflowX;
34
- return "aui-ov-x-".concat(overflowX);
35
- },
36
- overflowY: function (_a) {
37
- var overflowY = _a.overflowY;
38
- return "aui-ov-y-".concat(overflowY);
39
- },
40
- z: function (_a) {
41
- var z = _a.z;
42
- return "aui-z-".concat(z);
43
- },
44
- // --- Spacing ---
45
- padding: function (_a) {
46
- var padding = _a.padding;
47
- return "aui-pa-".concat(padding);
48
- },
49
- paddingX: function (_a) {
50
- var paddingX = _a.paddingX, paddingLeft = _a.paddingLeft, paddingRight = _a.paddingRight;
51
- var result = [];
52
- if (!paddingLeft)
53
- result.push("aui-pl-".concat(paddingX));
54
- if (!paddingRight)
55
- result.push("aui-pr-".concat(paddingX));
56
- return result.join(" ");
57
- },
58
- paddingY: function (_a) {
59
- var paddingY = _a.paddingY, paddingTop = _a.paddingTop, paddingBottom = _a.paddingBottom;
60
- var result = [];
61
- if (!paddingTop)
62
- result.push("aui-pt-".concat(paddingY));
63
- if (!paddingBottom)
64
- result.push("aui-pb-".concat(paddingY));
65
- return result.join(" ");
66
- },
67
- paddingTop: function (_a) {
68
- var paddingTop = _a.paddingTop;
69
- return "aui-pt-".concat(paddingTop);
70
- },
71
- paddingBottom: function (_a) {
72
- var paddingBottom = _a.paddingBottom;
73
- return "aui-pb-".concat(paddingBottom);
74
- },
75
- paddingLeft: function (_a) {
76
- var paddingLeft = _a.paddingLeft;
77
- return "aui-pl-".concat(paddingLeft);
78
- },
79
- paddingRight: function (_a) {
80
- var paddingRight = _a.paddingRight;
81
- return "aui-pr-".concat(paddingRight);
82
- },
83
- margin: function (_a) {
84
- var margin = _a.margin;
85
- return "aui-ma-".concat(margin);
86
- },
87
- marginX: function (_a) {
88
- var marginX = _a.marginX, marginLeft = _a.marginLeft, marginRight = _a.marginRight;
89
- var result = [];
90
- if (!marginLeft)
91
- result.push("aui-ml-".concat(marginX));
92
- if (!marginRight)
93
- result.push("aui-mr-".concat(marginX));
94
- return result.join(" ");
95
- },
96
- marginY: function (_a) {
97
- var marginY = _a.marginY, marginTop = _a.marginTop, marginBottom = _a.marginBottom;
98
- var result = [];
99
- if (!marginTop)
100
- result.push("aui-mt-".concat(marginY));
101
- if (!marginBottom)
102
- result.push("aui-mb-".concat(marginY));
103
- return result.join(" ");
104
- },
105
- marginTop: function (_a) {
106
- var marginTop = _a.marginTop;
107
- return "aui-mt-".concat(marginTop);
108
- },
109
- marginBottom: function (_a) {
110
- var marginBottom = _a.marginBottom;
111
- return "aui-mb-".concat(marginBottom);
112
- },
113
- marginLeft: function (_a) {
114
- var marginLeft = _a.marginLeft;
115
- return "aui-ml-".concat(marginLeft);
116
- },
117
- marginRight: function (_a) {
118
- var marginRight = _a.marginRight;
119
- return "aui-mr-".concat(marginRight);
120
- },
121
- // --- Dimensions ---
122
- width: function (_a) {
123
- var width = _a.width;
124
- return "aui-w-".concat(width);
125
- },
126
- maxWidth: function (_a) {
127
- var maxWidth = _a.maxWidth;
128
- return "aui-mw-".concat(maxWidth);
129
- },
130
- height: function (_a) {
131
- var height = _a.height;
132
- return "aui-h-".concat(height);
133
- },
134
- maxHeight: function (_a) {
135
- var maxHeight = _a.maxHeight;
136
- return "aui-mh-".concat(maxHeight);
137
- },
138
- // --- Borders ---
139
- radius: function (_a) {
140
- var radius = _a.radius;
141
- return "aui-radius-".concat(radius);
142
- },
143
- border: function () { return "aui-ba"; },
144
- borderTop: function () { return "aui-bt"; },
145
- borderBottom: function () { return "aui-bb"; },
146
- borderLeft: function () { return "aui-bl"; },
147
- borderRight: function () { return "aui-br"; },
148
- borderWidth: function (_a) {
149
- var borderWidth = _a.borderWidth;
150
- return "aui-bw-".concat(borderWidth);
151
- },
152
- borderStyle: function (_a) {
153
- var borderStyle = _a.borderStyle;
154
- return "aui-bs-".concat(borderStyle);
155
- },
156
- borderColor: function (_a) {
157
- var borderColor = _a.borderColor;
158
- return "aui-bc-".concat(borderColor);
159
- },
160
- // --- Effects ---
161
- shadow: function (_a) {
162
- var shadow = _a.shadow;
163
- return "aui-shadow-".concat(shadow);
164
- },
165
- opacity: function (_a) {
166
- var opacity = _a.opacity;
167
- return "aui-op-".concat(opacity);
168
- },
169
- // --- Typography ---
170
- fontSize: function (_a) {
171
- var fontSize = _a.fontSize;
172
- return "aui-f-".concat(fontSize);
173
- },
174
- fontWeight: function (_a) {
175
- var fontWeight = _a.fontWeight;
176
- return "aui-fw-".concat(fontWeight);
177
- },
178
- textAlign: function (_a) {
179
- var textAlign = _a.textAlign;
180
- return "aui-ta-".concat(textAlign);
181
- },
182
- italics: function () { return "aui-it"; },
183
- // --- Colors ---
184
- color: function (_a) {
185
- var color = _a.color;
186
- return "aui-c-".concat(color);
187
- },
188
- backgroundColor: function (_a) {
189
- var backgroundColor = _a.backgroundColor;
190
- return "aui-bg-".concat(backgroundColor);
191
- },
192
- // --- Misc ---
193
- cursor: function (_a) {
194
- var cursor = _a.cursor;
195
- return "aui-cursor-".concat(cursor);
196
- },
197
- };
198
- // Main function
199
- export default function transformVfx(vfx) {
200
- if (!vfx)
201
- return null;
202
- var classes = [];
203
- Object.entries(vfx).forEach(function (_a) {
204
- var key = _a[0], value = _a[1];
205
- var transformer = transformers[key];
206
- var result = transformer(vfx);
207
- if (value && result) {
208
- classes.push(result);
209
- }
210
- });
211
- return classes.join(" ") || null;
212
- }
package/utils/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes