@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.
- package/build/components/Accordion/Accordion.js +1 -0
- package/build/components/Accordion/index.d.ts +1 -0
- package/build/components/Accordion/index.js +1 -0
- package/build/components/Alert/Alert.js +1 -0
- package/build/components/Alert/index.d.ts +1 -0
- package/build/components/Alert/index.js +1 -0
- package/build/components/Animated/Animated.js +1 -0
- package/build/components/Animated/index.d.ts +1 -0
- package/build/components/Animated/index.js +1 -0
- package/build/components/Avatar/Avatar.js +1 -0
- package/build/components/Avatar/index.d.ts +1 -0
- package/build/components/Avatar/index.js +1 -0
- package/build/components/Badge/Badge.js +1 -0
- package/build/components/Badge/index.d.ts +1 -0
- package/build/components/Badge/index.js +1 -0
- package/build/components/Banner/Banner.js +1 -0
- package/build/components/Banner/index.d.ts +1 -0
- package/build/components/Banner/index.js +1 -0
- package/build/components/Box/Box.js +1 -0
- package/build/components/Box/index.d.ts +1 -0
- package/build/components/Box/index.js +1 -0
- package/{components → build/components}/Button/Button.d.ts +0 -21
- package/build/components/Button/Button.js +1 -0
- package/build/components/Button/IconButton.d.ts +25 -0
- package/build/components/Button/IconButton.js +1 -0
- package/build/components/Button/index.d.ts +3 -0
- package/build/components/Button/index.js +1 -0
- package/build/components/Carousel/Carousel.js +1 -0
- package/build/components/Carousel/index.d.ts +1 -0
- package/build/components/Carousel/index.js +1 -0
- package/build/components/ClickOutside/ClickOutside.js +1 -0
- package/build/components/ClickOutside/index.d.ts +1 -0
- package/build/components/ClickOutside/index.js +1 -0
- package/build/components/ErrorBoundary/ErrorBoundary.js +1 -0
- package/build/components/ErrorBoundary/index.d.ts +1 -0
- package/build/components/ErrorBoundary/index.js +1 -0
- package/build/components/Hamburger/DoubleCross.js +1 -0
- package/build/components/Hamburger/DoubleFlip.js +1 -0
- package/build/components/Hamburger/DoubleSpin.js +1 -0
- package/build/components/Hamburger/Hamburger.js +1 -0
- package/build/components/Hamburger/TripleFade.js +1 -0
- package/build/components/Hamburger/TripleFlip.js +1 -0
- package/build/components/Hamburger/TriplePrestige.js +1 -0
- package/build/components/Hamburger/TripleSpin.js +1 -0
- package/{components → build/components}/Hamburger/index.d.ts +2 -3
- package/build/components/Hamburger/index.js +1 -0
- package/build/components/Icon/Icon.js +1 -0
- package/build/components/Icon/icons.js +1 -0
- package/build/components/Icon/index.d.ts +1 -0
- package/build/components/Icon/index.js +1 -0
- package/build/components/Input/IconInput.js +1 -0
- package/build/components/Input/Input.js +1 -0
- package/build/components/Input/TextArea.js +1 -0
- package/build/components/Input/index.d.ts +3 -0
- package/build/components/Input/index.js +1 -0
- package/build/components/Layer/Layer.js +1 -0
- package/build/components/Layer/index.d.ts +1 -0
- package/build/components/Layer/index.js +1 -0
- package/build/components/Modal/Modal.js +1 -0
- package/build/components/Modal/index.d.ts +1 -0
- package/build/components/Modal/index.js +1 -0
- package/build/components/Select/Select.js +1 -0
- package/build/components/Select/index.d.ts +1 -0
- package/build/components/Select/index.js +1 -0
- package/build/components/Spinner/Spinner.js +1 -0
- package/build/components/Spinner/index.d.ts +1 -0
- package/build/components/Spinner/index.js +1 -0
- package/build/components/ui.js +1 -0
- package/build/functions/assertDefined.js +1 -0
- package/build/functions/classNames.js +1 -0
- package/build/functions/getDeviceType.js +1 -0
- package/build/functions/index.d.ts +4 -0
- package/build/functions/index.js +1 -0
- package/build/functions/scrollToId.js +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useFocusTrap.js +1 -0
- package/build/hooks/useMediaQuery.js +1 -0
- package/build/hooks/useMergeRefs.js +1 -0
- package/build/hooks/useScroll.js +1 -0
- package/build/hooks/useScrollLock.js +1 -0
- package/build/hooks/useScrollToHash.js +1 -0
- package/build/hooks/useWindowResize.js +1 -0
- package/{index.d.ts → build/index.d.ts} +1 -3
- package/build/index.js +1 -0
- package/{components/Link → build/navigation}/Link.d.ts +4 -4
- package/build/navigation/Link.js +1 -0
- package/build/navigation/PathParamsContext.js +1 -0
- package/build/navigation/Route.js +1 -0
- package/build/navigation/Router.js +1 -0
- package/build/navigation/RouterContext.js +1 -0
- package/{router → build/navigation}/Routes.d.ts +1 -1
- package/build/navigation/Routes.js +1 -0
- package/build/navigation/history.js +1 -0
- package/build/navigation/hooks/useLocation.js +1 -0
- package/build/navigation/hooks/useNavigate.js +1 -0
- package/build/navigation/hooks/usePathParams.js +1 -0
- package/build/navigation/hooks/useRouterContext.js +1 -0
- package/build/navigation/hooks/useSearchParams.js +1 -0
- package/build/navigation/href.js +1 -0
- package/{router → build/navigation}/index.d.ts +1 -0
- package/build/navigation/index.js +1 -0
- package/build/navigation/path.js +1 -0
- package/build/navigation/string.js +1 -0
- package/build/navigation/types.js +0 -0
- package/build/utils/transformVfx.js +1 -0
- package/{utils → build/utils}/types.d.ts +1 -1
- package/build/utils/types.js +0 -0
- package/package.json +19 -8
- package/components/Accordion/Accordion.js +0 -56
- package/components/Accordion/index.d.ts +0 -2
- package/components/Accordion/index.js +0 -2
- package/components/Alert/Alert.js +0 -31
- package/components/Alert/index.d.ts +0 -2
- package/components/Alert/index.js +0 -2
- package/components/Animated/Animated.js +0 -94
- package/components/Animated/index.d.ts +0 -2
- package/components/Animated/index.js +0 -2
- package/components/Avatar/Avatar.js +0 -57
- package/components/Avatar/index.d.ts +0 -2
- package/components/Avatar/index.js +0 -2
- package/components/Badge/Badge.js +0 -31
- package/components/Badge/index.d.ts +0 -2
- package/components/Badge/index.js +0 -2
- package/components/Banner/Banner.js +0 -31
- package/components/Banner/index.d.ts +0 -2
- package/components/Banner/index.js +0 -2
- package/components/Box/Box.js +0 -3
- package/components/Box/index.d.ts +0 -2
- package/components/Box/index.js +0 -2
- package/components/Button/Button.js +0 -52
- package/components/Button/index.d.ts +0 -3
- package/components/Button/index.js +0 -3
- package/components/Carousel/Carousel.js +0 -106
- package/components/Carousel/index.d.ts +0 -2
- package/components/Carousel/index.js +0 -2
- package/components/ClickOutside/ClickOutside.js +0 -55
- package/components/ClickOutside/index.d.ts +0 -2
- package/components/ClickOutside/index.js +0 -2
- package/components/ErrorBoundary/ErrorBoundary.js +0 -61
- package/components/ErrorBoundary/index.d.ts +0 -2
- package/components/ErrorBoundary/index.js +0 -2
- package/components/Hamburger/DoubleCross.js +0 -39
- package/components/Hamburger/DoubleFlip.js +0 -39
- package/components/Hamburger/DoubleSpin.js +0 -40
- package/components/Hamburger/Hamburger.js +0 -66
- package/components/Hamburger/TripleFade.js +0 -40
- package/components/Hamburger/TripleFlip.js +0 -40
- package/components/Hamburger/TriplePrestige.js +0 -40
- package/components/Hamburger/TripleSpin.js +0 -41
- package/components/Hamburger/index.js +0 -9
- package/components/Icon/Icon.js +0 -32
- package/components/Icon/icons.js +0 -179
- package/components/Icon/index.d.ts +0 -2
- package/components/Icon/index.js +0 -2
- package/components/Input/IconInput.js +0 -33
- package/components/Input/Input.js +0 -31
- package/components/Input/TextArea.js +0 -31
- package/components/Input/index.d.ts +0 -5
- package/components/Input/index.js +0 -5
- package/components/Layer/Layer.js +0 -63
- package/components/Layer/index.d.ts +0 -2
- package/components/Layer/index.js +0 -2
- package/components/Link/Link.js +0 -75
- package/components/Link/index.d.ts +0 -3
- package/components/Link/index.js +0 -3
- package/components/Modal/Modal.js +0 -48
- package/components/Modal/index.d.ts +0 -2
- package/components/Modal/index.js +0 -2
- package/components/Select/Select.js +0 -34
- package/components/Select/index.d.ts +0 -2
- package/components/Select/index.js +0 -2
- package/components/Spinner/Spinner.js +0 -31
- package/components/Spinner/index.d.ts +0 -2
- package/components/Spinner/index.js +0 -2
- package/components/ui.js +0 -44
- package/functions/assertDefined.js +0 -13
- package/functions/classNames.js +0 -16
- package/functions/getDeviceType.js +0 -17
- package/functions/index.d.ts +0 -5
- package/functions/index.js +0 -5
- package/functions/scrollToId.js +0 -17
- package/hooks/index.js +0 -7
- package/hooks/useFocusTrap.js +0 -48
- package/hooks/useMediaQuery.js +0 -28
- package/hooks/useMergeRefs.js +0 -24
- package/hooks/useScroll.js +0 -23
- package/hooks/useScrollLock.js +0 -45
- package/hooks/useScrollToHash.js +0 -21
- package/hooks/useWindowResize.js +0 -13
- package/index.js +0 -31
- package/router/PathParamsContext.js +0 -3
- package/router/Route.js +0 -6
- package/router/Router.js +0 -36
- package/router/RouterContext.js +0 -3
- package/router/Routes.js +0 -31
- package/router/history.js +0 -46
- package/router/hooks/useLocation.js +0 -10
- package/router/hooks/useNavigate.js +0 -10
- package/router/hooks/usePathParams.js +0 -15
- package/router/hooks/useRouterContext.js +0 -9
- package/router/hooks/useSearchParams.js +0 -47
- package/router/href.js +0 -43
- package/router/index.js +0 -7
- package/router/path.js +0 -38
- package/router/string.js +0 -6
- package/router/types.js +0 -1
- package/utils/transformVfx.js +0 -212
- package/utils/types.js +0 -1
- /package/{components → build/components}/Accordion/Accordion.d.ts +0 -0
- /package/{components → build/components}/Alert/Alert.d.ts +0 -0
- /package/{components → build/components}/Animated/Animated.d.ts +0 -0
- /package/{components → build/components}/Avatar/Avatar.d.ts +0 -0
- /package/{components → build/components}/Badge/Badge.d.ts +0 -0
- /package/{components → build/components}/Banner/Banner.d.ts +0 -0
- /package/{components → build/components}/Box/Box.d.ts +0 -0
- /package/{components → build/components}/Carousel/Carousel.d.ts +0 -0
- /package/{components → build/components}/ClickOutside/ClickOutside.d.ts +0 -0
- /package/{components → build/components}/ErrorBoundary/ErrorBoundary.d.ts +0 -0
- /package/{components → build/components}/Hamburger/DoubleCross.d.ts +0 -0
- /package/{components → build/components}/Hamburger/DoubleFlip.d.ts +0 -0
- /package/{components → build/components}/Hamburger/DoubleSpin.d.ts +0 -0
- /package/{components → build/components}/Hamburger/Hamburger.d.ts +0 -0
- /package/{components → build/components}/Hamburger/TripleFade.d.ts +0 -0
- /package/{components → build/components}/Hamburger/TripleFlip.d.ts +0 -0
- /package/{components → build/components}/Hamburger/TriplePrestige.d.ts +0 -0
- /package/{components → build/components}/Hamburger/TripleSpin.d.ts +0 -0
- /package/{components → build/components}/Icon/Icon.d.ts +0 -0
- /package/{components → build/components}/Icon/icons.d.ts +0 -0
- /package/{components → build/components}/Input/IconInput.d.ts +0 -0
- /package/{components → build/components}/Input/Input.d.ts +0 -0
- /package/{components → build/components}/Input/TextArea.d.ts +0 -0
- /package/{components → build/components}/Layer/Layer.d.ts +0 -0
- /package/{components → build/components}/Modal/Modal.d.ts +0 -0
- /package/{components → build/components}/Select/Select.d.ts +0 -0
- /package/{components → build/components}/Spinner/Spinner.d.ts +0 -0
- /package/{components → build/components}/ui.d.ts +0 -0
- /package/{functions → build/functions}/assertDefined.d.ts +0 -0
- /package/{functions → build/functions}/classNames.d.ts +0 -0
- /package/{functions → build/functions}/getDeviceType.d.ts +0 -0
- /package/{functions → build/functions}/scrollToId.d.ts +0 -0
- /package/{hooks → build/hooks}/index.d.ts +0 -0
- /package/{hooks → build/hooks}/useFocusTrap.d.ts +0 -0
- /package/{hooks → build/hooks}/useMediaQuery.d.ts +0 -0
- /package/{hooks → build/hooks}/useMergeRefs.d.ts +0 -0
- /package/{hooks → build/hooks}/useScroll.d.ts +0 -0
- /package/{hooks → build/hooks}/useScrollLock.d.ts +0 -0
- /package/{hooks → build/hooks}/useScrollToHash.d.ts +0 -0
- /package/{hooks → build/hooks}/useWindowResize.d.ts +0 -0
- /package/{router → build/navigation}/PathParamsContext.d.ts +0 -0
- /package/{router → build/navigation}/Route.d.ts +0 -0
- /package/{router → build/navigation}/Router.d.ts +0 -0
- /package/{router → build/navigation}/RouterContext.d.ts +0 -0
- /package/{router → build/navigation}/history.d.ts +0 -0
- /package/{router → build/navigation}/hooks/useLocation.d.ts +0 -0
- /package/{router → build/navigation}/hooks/useNavigate.d.ts +0 -0
- /package/{router → build/navigation}/hooks/usePathParams.d.ts +0 -0
- /package/{router → build/navigation}/hooks/useRouterContext.d.ts +0 -0
- /package/{router → build/navigation}/hooks/useSearchParams.d.ts +0 -0
- /package/{router → build/navigation}/href.d.ts +0 -0
- /package/{router → build/navigation}/path.d.ts +0 -0
- /package/{router → build/navigation}/string.d.ts +0 -0
- /package/{router → build/navigation}/types.d.ts +0 -0
- /package/{style.css → build/style.css} +0 -0
- /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
package/router/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/utils/transformVfx.js
DELETED
|
@@ -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
|
|
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
|
|
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
|