@codeleap/styles 4.2.9 → 4.2.11

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 (67) hide show
  1. package/package.json +4 -5
  2. package/package.json.bak +3 -4
  3. package/src/lib/borderCreator.ts +5 -3
  4. package/src/lib/constants.ts +3 -0
  5. package/src/lib/dynamicVariants.ts +28 -13
  6. package/dist/index.d.ts +0 -5
  7. package/dist/index.js +0 -26
  8. package/dist/lib/Cacher.d.ts +0 -37
  9. package/dist/lib/Cacher.js +0 -104
  10. package/dist/lib/StaleControl.d.ts +0 -21
  11. package/dist/lib/StaleControl.js +0 -78
  12. package/dist/lib/StyleCache.d.ts +0 -20
  13. package/dist/lib/StyleCache.js +0 -83
  14. package/dist/lib/StylePersistor.d.ts +0 -13
  15. package/dist/lib/StylePersistor.js +0 -22
  16. package/dist/lib/StyleRegistry.d.ts +0 -47
  17. package/dist/lib/StyleRegistry.js +0 -513
  18. package/dist/lib/borderCreator.d.ts +0 -11
  19. package/dist/lib/borderCreator.js +0 -44
  20. package/dist/lib/constants.d.ts +0 -5
  21. package/dist/lib/constants.js +0 -8
  22. package/dist/lib/createAppVariants.d.ts +0 -6
  23. package/dist/lib/createAppVariants.js +0 -9
  24. package/dist/lib/createStyles.d.ts +0 -4
  25. package/dist/lib/createStyles.js +0 -27
  26. package/dist/lib/createTheme.d.ts +0 -7
  27. package/dist/lib/createTheme.js +0 -74
  28. package/dist/lib/defaultVariants.d.ts +0 -178
  29. package/dist/lib/defaultVariants.js +0 -179
  30. package/dist/lib/dynamicVariants.d.ts +0 -12
  31. package/dist/lib/dynamicVariants.js +0 -88
  32. package/dist/lib/hashKey.d.ts +0 -1
  33. package/dist/lib/hashKey.js +0 -14
  34. package/dist/lib/hooks.d.ts +0 -8
  35. package/dist/lib/hooks.js +0 -76
  36. package/dist/lib/index.d.ts +0 -10
  37. package/dist/lib/index.js +0 -37
  38. package/dist/lib/mediaQuery.d.ts +0 -11
  39. package/dist/lib/mediaQuery.js +0 -65
  40. package/dist/lib/minifier.d.ts +0 -6
  41. package/dist/lib/minifier.js +0 -21
  42. package/dist/lib/multiplierProperty.d.ts +0 -3
  43. package/dist/lib/multiplierProperty.js +0 -13
  44. package/dist/lib/spacing.d.ts +0 -11
  45. package/dist/lib/spacing.js +0 -104
  46. package/dist/lib/themeStore.d.ts +0 -7
  47. package/dist/lib/themeStore.js +0 -9
  48. package/dist/lib/utils.d.ts +0 -8
  49. package/dist/lib/utils.js +0 -177
  50. package/dist/lib/validateTheme.d.ts +0 -2
  51. package/dist/lib/validateTheme.js +0 -68
  52. package/dist/types/cache.d.ts +0 -1
  53. package/dist/types/cache.js +0 -2
  54. package/dist/types/component.d.ts +0 -25
  55. package/dist/types/component.js +0 -2
  56. package/dist/types/core.d.ts +0 -20
  57. package/dist/types/core.js +0 -2
  58. package/dist/types/icon.d.ts +0 -4
  59. package/dist/types/icon.js +0 -3
  60. package/dist/types/index.d.ts +0 -5
  61. package/dist/types/index.js +0 -21
  62. package/dist/types/spacing.d.ts +0 -6
  63. package/dist/types/spacing.js +0 -21
  64. package/dist/types/style.d.ts +0 -14
  65. package/dist/types/style.js +0 -2
  66. package/dist/types/theme.d.ts +0 -67
  67. package/dist/types/theme.js +0 -2
@@ -1,11 +0,0 @@
1
- import { Breakpoint } from '../types';
2
- export type Queries = {
3
- up: (breakpoint: string) => string;
4
- down: (breakpoint: Breakpoint) => string;
5
- is: (breakpoint: string) => string;
6
- not: (breakpoint: string) => string;
7
- };
8
- export type MediaQueries = Queries & {
9
- renderToPlatformQuery: (props: Record<keyof Queries, any>) => string;
10
- };
11
- export declare function createMediaQueries<T extends any>(breakpoints: T): MediaQueries;
@@ -1,65 +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
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.createMediaQueries = void 0;
15
- function getBreakpointValue(breakpoint, breakpoints) {
16
- if (breakpoints[breakpoint]) {
17
- return breakpoints[breakpoint];
18
- }
19
- return Infinity;
20
- }
21
- function createMediaQueries(breakpoints) {
22
- function getBreakpoint(breakpoint) {
23
- return getBreakpointValue(breakpoint, breakpoints);
24
- }
25
- var queries = {
26
- up: function (breakpoint) {
27
- // Upwards of... (excluding)
28
- var min = getBreakpoint(breakpoint);
29
- return "@media screen and (min-width:".concat(min, "px)");
30
- },
31
- down: function (breakpoint) {
32
- // Downwards of... (excluding)
33
- var max = getBreakpoint(breakpoint);
34
- return "@media screen and (max-width:".concat(max, "px)");
35
- },
36
- is: function (breakpoint) {
37
- // Is media... (exact)
38
- var value = getBreakpoint(breakpoint);
39
- return "@media screen and (min-width:".concat(value, "px) and (max-width:").concat(value, "px)");
40
- },
41
- not: function (breakpoint) {
42
- // Is NOT media... (exact)
43
- var value = getBreakpoint(breakpoint);
44
- return "@media not screen and (min-width:".concat(value, "px) and (max-width:").concat(value, "px)");
45
- },
46
- };
47
- var renderToPlatformQuery = function (props) {
48
- var query = '';
49
- if (props === null || props === void 0 ? void 0 : props.is) {
50
- query = queries.not(props.is);
51
- }
52
- else if (props === null || props === void 0 ? void 0 : props.not) {
53
- query = queries.is(props.not);
54
- }
55
- else if (props === null || props === void 0 ? void 0 : props.up) {
56
- query = queries.down(props.up);
57
- }
58
- else if (props === null || props === void 0 ? void 0 : props.down) {
59
- query = queries.up(props.down);
60
- }
61
- return query;
62
- };
63
- return __assign(__assign({}, queries), { renderToPlatformQuery: renderToPlatformQuery });
64
- }
65
- exports.createMediaQueries = createMediaQueries;
@@ -1,6 +0,0 @@
1
- export declare function compress(value: any): any;
2
- export declare function decompress(value: any): any;
3
- export declare const minifier: {
4
- compress: typeof compress;
5
- decompress: typeof decompress;
6
- };
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.minifier = exports.decompress = exports.compress = void 0;
4
- var lz_string_1 = require("lz-string");
5
- function compress(value) {
6
- if (!value)
7
- return value;
8
- return (0, lz_string_1.compressToBase64)(JSON.stringify(value));
9
- }
10
- exports.compress = compress;
11
- function decompress(value) {
12
- if (!value)
13
- return value;
14
- var decoded = (0, lz_string_1.decompressFromBase64)(value);
15
- return JSON.parse(decoded);
16
- }
17
- exports.decompress = decompress;
18
- exports.minifier = {
19
- compress: compress,
20
- decompress: decompress,
21
- };
@@ -1,3 +0,0 @@
1
- export declare function multiplierProperty<T extends string>(base: number, property: T): (multiplier: number | string) => {
2
- [x: string]: number;
3
- };
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.multiplierProperty = void 0;
4
- function multiplierProperty(base, property) {
5
- return function (multiplier) {
6
- var _a;
7
- var value = base * Number(multiplier);
8
- return _a = {},
9
- _a[property] = value,
10
- _a;
11
- };
12
- }
13
- exports.multiplierProperty = multiplierProperty;
@@ -1,11 +0,0 @@
1
- import { ICSS } from '../types';
2
- import { SpacingVariants, SpacingShortVariants } from '../types/spacing';
3
- export type MultiplierFunction = (multiplier: number | string) => ICSS;
4
- export type Spacings<T extends string, S = boolean> = {
5
- [Property in (S extends boolean ? SpacingVariants : SpacingShortVariants) as `${T}${string & Property}`]: MultiplierFunction;
6
- } & {
7
- [Property in T]: (multiplier: number) => ICSS;
8
- } & {
9
- value: (multiplier: number) => number;
10
- };
11
- export declare function spacingFactory<T extends string>(base: number, spacingProperty: T, isShort?: boolean): any;
@@ -1,104 +0,0 @@
1
- "use strict";
2
- var __values = (this && this.__values) || function(o) {
3
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
- if (m) return m.call(o);
5
- if (o && typeof o.length === "number") return {
6
- next: function () {
7
- if (o && i >= o.length) o = void 0;
8
- return { value: o && o[i++], done: !o };
9
- }
10
- };
11
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.spacingFactory = void 0;
15
- var spacing_1 = require("../types/spacing");
16
- var shortMapValues = {
17
- 'x': 'Horizontal',
18
- 'y': 'Vertical',
19
- 'l': 'Left',
20
- 'r': 'Right',
21
- 't': 'Top',
22
- 'b': 'Bottom',
23
- 'm': 'margin',
24
- 'p': 'padding'
25
- };
26
- function spacingFactory(base, spacingProperty, isShort) {
27
- var _a, e_1, _b;
28
- if (isShort === void 0) { isShort = false; }
29
- var property = isShort ? shortMapValues[spacingProperty] : spacingProperty;
30
- var positions = isShort ? spacing_1.spacingShortVariants : spacing_1.spacingVariants;
31
- var spacings = (_a = {},
32
- _a["".concat(spacingProperty)] = function (n) {
33
- var _a;
34
- return (_a = {},
35
- _a["".concat(property)] = base * Number(n),
36
- _a);
37
- },
38
- _a);
39
- var _loop_1 = function (_position) {
40
- var position = isShort ? shortMapValues[_position] : _position;
41
- var key = "".concat(spacingProperty).concat(_position);
42
- var getter = null;
43
- switch (position) {
44
- case 'Horizontal':
45
- getter = function (value) {
46
- var _a;
47
- return (_a = {},
48
- _a["".concat(property, "Left")] = value,
49
- _a["".concat(property, "Right")] = value,
50
- _a);
51
- };
52
- break;
53
- case 'Vertical':
54
- getter = function (value) {
55
- var _a;
56
- return (_a = {},
57
- _a["".concat(property, "Top")] = value,
58
- _a["".concat(property, "Bottom")] = value,
59
- _a);
60
- };
61
- break;
62
- case '':
63
- getter = function (value) {
64
- var _a;
65
- return (_a = {},
66
- _a["".concat(property, "Top")] = value,
67
- _a["".concat(property, "Left")] = value,
68
- _a["".concat(property, "Right")] = value,
69
- _a["".concat(property, "Bottom")] = value,
70
- _a);
71
- };
72
- break;
73
- default:
74
- getter = function (value) {
75
- var _a;
76
- return (_a = {},
77
- _a["".concat(property).concat(position)] = value,
78
- _a);
79
- };
80
- break;
81
- }
82
- spacings[key] = function (n) {
83
- if (n == 'auto')
84
- return getter('auto');
85
- var value = base * Number(n);
86
- return getter(value);
87
- };
88
- };
89
- try {
90
- for (var positions_1 = __values(positions), positions_1_1 = positions_1.next(); !positions_1_1.done; positions_1_1 = positions_1.next()) {
91
- var _position = positions_1_1.value;
92
- _loop_1(_position);
93
- }
94
- }
95
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
96
- finally {
97
- try {
98
- if (positions_1_1 && !positions_1_1.done && (_b = positions_1.return)) _b.call(positions_1);
99
- }
100
- finally { if (e_1) throw e_1.error; }
101
- }
102
- return spacings;
103
- }
104
- exports.spacingFactory = spacingFactory;
@@ -1,7 +0,0 @@
1
- import { IAppVariants, ITheme } from '../types';
2
- export type ThemeStore = {
3
- colorScheme: string | null;
4
- current: ITheme | null;
5
- variants: IAppVariants;
6
- };
7
- export declare const themeStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ThemeStore>>;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.themeStore = void 0;
4
- var zustand_1 = require("zustand");
5
- exports.themeStore = (0, zustand_1.create)(function () { return ({
6
- colorScheme: null,
7
- current: null,
8
- variants: {},
9
- }); });
@@ -1,8 +0,0 @@
1
- import { ICSS, StyledProp } from '../types';
2
- export declare function capitalize(str: string, reverse?: boolean): string;
3
- export declare const spacingKeys: string[];
4
- export declare function isSpacingKey(key: string): boolean;
5
- export declare function getNestedStylesByKey<T extends string>(match: string, styles: Partial<Record<T, ICSS>>): {};
6
- export declare const mergeStyles: (styles: Array<any>) => {};
7
- export declare const ignoredStyleKeys: string[];
8
- export declare const concatStyles: <T extends string>(styles: StyledProp<T>[]) => StyledProp<T>;
package/dist/lib/utils.js DELETED
@@ -1,177 +0,0 @@
1
- "use strict";
2
- var __values = (this && this.__values) || function(o) {
3
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
- if (m) return m.call(o);
5
- if (o && typeof o.length === "number") return {
6
- next: function () {
7
- if (o && i >= o.length) o = void 0;
8
- return { value: o && o[i++], done: !o };
9
- }
10
- };
11
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
- };
13
- var __read = (this && this.__read) || function (o, n) {
14
- var m = typeof Symbol === "function" && o[Symbol.iterator];
15
- if (!m) return o;
16
- var i = m.call(o), r, ar = [], e;
17
- try {
18
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
19
- }
20
- catch (error) { e = { error: error }; }
21
- finally {
22
- try {
23
- if (r && !r.done && (m = i["return"])) m.call(i);
24
- }
25
- finally { if (e) throw e.error; }
26
- }
27
- return ar;
28
- };
29
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
30
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
31
- if (ar || !(i in from)) {
32
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
33
- ar[i] = from[i];
34
- }
35
- }
36
- return to.concat(ar || Array.prototype.slice.call(from));
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
42
- Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.concatStyles = exports.ignoredStyleKeys = exports.mergeStyles = exports.getNestedStylesByKey = exports.isSpacingKey = exports.spacingKeys = exports.capitalize = void 0;
44
- var deepmerge_1 = __importDefault(require("@fastify/deepmerge"));
45
- var spacing_1 = require("../types/spacing");
46
- function capitalize(str, reverse) {
47
- if (reverse === void 0) { reverse = false; }
48
- if (!str.length)
49
- return str;
50
- var firstChar = reverse ? str[0].toLowerCase() : str[0].toUpperCase();
51
- return firstChar + str.substring(1);
52
- }
53
- exports.capitalize = capitalize;
54
- exports.spacingKeys = [
55
- 'gap',
56
- 'top',
57
- 'left',
58
- 'right',
59
- 'bottom',
60
- ];
61
- try {
62
- for (var _e = __values(['padding', 'margin']), _f = _e.next(); !_f.done; _f = _e.next()) {
63
- var longProperty = _f.value;
64
- try {
65
- for (var spacingVariants_1 = (e_2 = void 0, __values(spacing_1.spacingVariants)), spacingVariants_1_1 = spacingVariants_1.next(); !spacingVariants_1_1.done; spacingVariants_1_1 = spacingVariants_1.next()) {
66
- var variant = spacingVariants_1_1.value;
67
- exports.spacingKeys.push("".concat(longProperty).concat(capitalize(variant)));
68
- }
69
- }
70
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
71
- finally {
72
- try {
73
- if (spacingVariants_1_1 && !spacingVariants_1_1.done && (_b = spacingVariants_1.return)) _b.call(spacingVariants_1);
74
- }
75
- finally { if (e_2) throw e_2.error; }
76
- }
77
- }
78
- }
79
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
80
- finally {
81
- try {
82
- if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
83
- }
84
- finally { if (e_1) throw e_1.error; }
85
- }
86
- try {
87
- for (var _g = __values(['p', 'm']), _h = _g.next(); !_h.done; _h = _g.next()) {
88
- var shortProperty = _h.value;
89
- try {
90
- for (var spacingShortVariants_1 = (e_4 = void 0, __values(spacing_1.spacingShortVariants)), spacingShortVariants_1_1 = spacingShortVariants_1.next(); !spacingShortVariants_1_1.done; spacingShortVariants_1_1 = spacingShortVariants_1.next()) {
91
- var shortVariant = spacingShortVariants_1_1.value;
92
- exports.spacingKeys.push(shortProperty + shortVariant);
93
- }
94
- }
95
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
96
- finally {
97
- try {
98
- if (spacingShortVariants_1_1 && !spacingShortVariants_1_1.done && (_d = spacingShortVariants_1.return)) _d.call(spacingShortVariants_1);
99
- }
100
- finally { if (e_4) throw e_4.error; }
101
- }
102
- }
103
- }
104
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
105
- finally {
106
- try {
107
- if (_h && !_h.done && (_c = _g.return)) _c.call(_g);
108
- }
109
- finally { if (e_3) throw e_3.error; }
110
- }
111
- function isSpacingKey(key) {
112
- if (!key)
113
- return false;
114
- return exports.spacingKeys === null || exports.spacingKeys === void 0 ? void 0 : exports.spacingKeys.includes(key);
115
- }
116
- exports.isSpacingKey = isSpacingKey;
117
- function getNestedStylesByKey(match, styles) {
118
- var e_5, _a;
119
- var stylesByKey = {};
120
- try {
121
- for (var _b = __values(Object.entries(styles)), _c = _b.next(); !_c.done; _c = _b.next()) {
122
- var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
123
- if (key.startsWith(match)) {
124
- var partName = capitalize(key.replace(match, ''), true);
125
- stylesByKey[partName] = value;
126
- }
127
- }
128
- }
129
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
130
- finally {
131
- try {
132
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
133
- }
134
- finally { if (e_5) throw e_5.error; }
135
- }
136
- return stylesByKey;
137
- }
138
- exports.getNestedStylesByKey = getNestedStylesByKey;
139
- var mergeStyles = function (styles) {
140
- var style = styles === null || styles === void 0 ? void 0 : styles.filter(function (s) { return !!s; });
141
- return (0, deepmerge_1.default)({ all: true }).apply(void 0, __spreadArray([], __read(style), false));
142
- };
143
- exports.mergeStyles = mergeStyles;
144
- // @note these words are reserved by css
145
- exports.ignoredStyleKeys = [
146
- 'textAlign',
147
- 'textDecoration',
148
- 'textOverflow',
149
- 'left',
150
- 'top',
151
- 'right',
152
- 'bottom',
153
- ];
154
- var concatStyles = function (styles) {
155
- var e_6, _a;
156
- var results = [];
157
- try {
158
- for (var styles_1 = __values(styles), styles_1_1 = styles_1.next(); !styles_1_1.done; styles_1_1 = styles_1.next()) {
159
- var style = styles_1_1.value;
160
- if (Array.isArray(style)) {
161
- results.push.apply(results, __spreadArray([], __read(style), false));
162
- }
163
- else {
164
- results.push(style);
165
- }
166
- }
167
- }
168
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
169
- finally {
170
- try {
171
- if (styles_1_1 && !styles_1_1.done && (_a = styles_1.return)) _a.call(styles_1);
172
- }
173
- finally { if (e_6) throw e_6.error; }
174
- }
175
- return results;
176
- };
177
- exports.concatStyles = concatStyles;
@@ -1,2 +0,0 @@
1
- import { Theme } from '../types/theme';
2
- export declare function validateTheme<T extends Theme>(theme: T): T;
@@ -1,68 +0,0 @@
1
- "use strict";
2
- var __values = (this && this.__values) || function(o) {
3
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
- if (m) return m.call(o);
5
- if (o && typeof o.length === "number") return {
6
- next: function () {
7
- if (o && i >= o.length) o = void 0;
8
- return { value: o && o[i++], done: !o };
9
- }
10
- };
11
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
- };
13
- var __read = (this && this.__read) || function (o, n) {
14
- var m = typeof Symbol === "function" && o[Symbol.iterator];
15
- if (!m) return o;
16
- var i = m.call(o), r, ar = [], e;
17
- try {
18
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
19
- }
20
- catch (error) { e = { error: error }; }
21
- finally {
22
- try {
23
- if (r && !r.done && (m = i["return"])) m.call(i);
24
- }
25
- finally { if (e) throw e.error; }
26
- }
27
- return ar;
28
- };
29
- Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.validateTheme = void 0;
31
- function validateTheme(theme) {
32
- var e_1, _a, e_2, _b;
33
- var colors = theme.colors;
34
- var requiredColors = Object.keys(colors);
35
- var alternateColors = theme.alternateColors;
36
- if (alternateColors) {
37
- try {
38
- for (var _c = __values(Object.entries(alternateColors)), _d = _c.next(); !_d.done; _d = _c.next()) {
39
- var _e = __read(_d.value, 2), colorSchemeName = _e[0], colorSchemeColors = _e[1];
40
- var colorSchemeColorNames = Object.keys(colorSchemeColors);
41
- try {
42
- for (var requiredColors_1 = (e_2 = void 0, __values(requiredColors)), requiredColors_1_1 = requiredColors_1.next(); !requiredColors_1_1.done; requiredColors_1_1 = requiredColors_1.next()) {
43
- var requiredColor = requiredColors_1_1.value;
44
- if (!colorSchemeColorNames.includes(requiredColor)) {
45
- throw new Error("Alternate color scheme ".concat(colorSchemeName, " is missing color ").concat(requiredColor));
46
- }
47
- }
48
- }
49
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
50
- finally {
51
- try {
52
- if (requiredColors_1_1 && !requiredColors_1_1.done && (_b = requiredColors_1.return)) _b.call(requiredColors_1);
53
- }
54
- finally { if (e_2) throw e_2.error; }
55
- }
56
- }
57
- }
58
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
59
- finally {
60
- try {
61
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
62
- }
63
- finally { if (e_1) throw e_1.error; }
64
- }
65
- }
66
- return theme;
67
- }
68
- exports.validateTheme = validateTheme;
@@ -1 +0,0 @@
1
- export type CacheType = 'variants' | 'common' | 'styles' | 'compositions' | 'responsive' | 'components';
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,25 +0,0 @@
1
- /// <reference types="react" />
2
- import { AnyRecord, IJSX } from './core';
3
- import { StyleProp, VariantStyleSheet } from './style';
4
- export type PropsWithVariants<Props extends AnyRecord, VariantStyles extends AnyRecord> = Omit<Props, 'style'> & {
5
- style?: StyleProp<Extract<keyof Props, 'style'> extends never ? VariantStyles[keyof VariantStyles] : (Props['style'] extends StyleProp<infer C> ? C : VariantStyles[keyof VariantStyles]), keyof VariantStyles>;
6
- };
7
- export type AnyFunction = (...args: any[]) => any;
8
- export type StyledComponentProps<Props extends AnyRecord, VariantStyles> = PropsWithVariants<Props, VariantStyles>;
9
- export type StyledComponent<VariantStyles, Props extends AnyRecord = AnyRecord> = ((props: StyledComponentProps<Props, VariantStyles>) => IJSX) & {
10
- styleRegistryName?: string;
11
- elements?: string[];
12
- rootElement?: string;
13
- };
14
- export type GenericStyledComponentAttributes<Props> = {
15
- styleRegistryName?: string;
16
- withVariantTypes?: <VariantStyles extends VariantStyleSheet>(variants: VariantStyles) => StyledComponent<VariantStyles, Props>;
17
- elements?: string[];
18
- rootElement?: string;
19
- };
20
- export type GenericStyledComponent<Props extends AnyRecord> = ((props: Props) => IJSX) & GenericStyledComponentAttributes<Props>;
21
- export type AnyStyledComponent = GenericStyledComponent<any>;
22
- export type ComponentWithDefaultProps<P> = ((props: P) => JSX.Element) & {
23
- defaultProps?: Partial<P>;
24
- };
25
- export type StyledComponentWithProps<Props> = ComponentWithDefaultProps<Props> & GenericStyledComponentAttributes<Props>;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,20 +0,0 @@
1
- export interface ICSS {
2
- }
3
- export interface ITheme {
4
- }
5
- export interface IJSX {
6
- }
7
- export interface IBreakpoints {
8
- }
9
- export interface IColors {
10
- }
11
- export interface IBorderRadius {
12
- }
13
- export interface IAppVariants {
14
- }
15
- export interface IEffect {
16
- }
17
- export interface IEffects {
18
- }
19
- export type AnyRecord = Record<string, any>;
20
- export type Breakpoint = keyof IBreakpoints;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- export interface AppIcons {
2
- }
3
- export type AppIcon = keyof AppIcons;
4
- export type IconProp = AppIcon | `url:${string}`;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/no-empty-interface */
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +0,0 @@
1
- export * from './core';
2
- export * from './style';
3
- export * from './theme';
4
- export * from './icon';
5
- export * from './component';
@@ -1,21 +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
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./core"), exports);
18
- __exportStar(require("./style"), exports);
19
- __exportStar(require("./theme"), exports);
20
- __exportStar(require("./icon"), exports);
21
- __exportStar(require("./component"), exports);
@@ -1,6 +0,0 @@
1
- export declare const spacingVariants: readonly ["Vertical", "Horizontal", "Bottom", "Top", "Left", "Right", ""];
2
- export declare const spacingShortVariants: readonly ["y", "x", "b", "t", "l", "r", ""];
3
- export type SpacingVariants = typeof spacingVariants[number];
4
- export type SpacingShortVariants = typeof spacingShortVariants[number];
5
- export type Multiplier = 'auto' | number | '';
6
- export type Spacing = `padding${SpacingVariants}:${Multiplier}` | `margin${SpacingVariants}:${Multiplier}` | `p${SpacingShortVariants}:${Multiplier}` | `m${SpacingShortVariants}:${Multiplier}` | `gap:${Multiplier}`;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.spacingShortVariants = exports.spacingVariants = void 0;
4
- exports.spacingVariants = [
5
- 'Vertical',
6
- 'Horizontal',
7
- 'Bottom',
8
- 'Top',
9
- 'Left',
10
- 'Right',
11
- '',
12
- ];
13
- exports.spacingShortVariants = [
14
- 'y',
15
- 'x',
16
- 'b',
17
- 't',
18
- 'l',
19
- 'r',
20
- '',
21
- ];