@weser/style 1.0.0

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/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/dist/core/createRenderer.d.ts +21 -0
  4. package/dist/core/createRenderer.d.ts.map +1 -0
  5. package/dist/core/createRenderer.js +23 -0
  6. package/dist/core/createRenderer.js.map +1 -0
  7. package/dist/core/extend.d.ts +3 -0
  8. package/dist/core/extend.d.ts.map +1 -0
  9. package/dist/core/extend.js +4 -0
  10. package/dist/core/extend.js.map +1 -0
  11. package/dist/core/fallbackValue.d.ts +7 -0
  12. package/dist/core/fallbackValue.d.ts.map +1 -0
  13. package/dist/core/fallbackValue.js +8 -0
  14. package/dist/core/fallbackValue.js.map +1 -0
  15. package/dist/core/fallbackValuePlugin.d.ts +3 -0
  16. package/dist/core/fallbackValuePlugin.d.ts.map +1 -0
  17. package/dist/core/fallbackValuePlugin.js +30 -0
  18. package/dist/core/fallbackValuePlugin.js.map +1 -0
  19. package/dist/core/getFallbackCSS.d.ts +3 -0
  20. package/dist/core/getFallbackCSS.d.ts.map +1 -0
  21. package/dist/core/getFallbackCSS.js +27 -0
  22. package/dist/core/getFallbackCSS.js.map +1 -0
  23. package/dist/core/getFallbackVariable.d.ts +2 -0
  24. package/dist/core/getFallbackVariable.d.ts.map +1 -0
  25. package/dist/core/getFallbackVariable.js +4 -0
  26. package/dist/core/getFallbackVariable.js.map +1 -0
  27. package/dist/helpers/useCSSVariable.d.ts +2 -0
  28. package/dist/helpers/useCSSVariable.d.ts.map +1 -0
  29. package/dist/helpers/useCSSVariable.js +11 -0
  30. package/dist/helpers/useCSSVariable.js.map +1 -0
  31. package/dist/index.d.ts +12 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +11 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/modules/fela.d.ts +126 -0
  36. package/dist/plugins/debug.d.ts +6 -0
  37. package/dist/plugins/debug.d.ts.map +1 -0
  38. package/dist/plugins/debug.js +15 -0
  39. package/dist/plugins/debug.js.map +1 -0
  40. package/dist/plugins/enforceLonghand.d.ts +5 -0
  41. package/dist/plugins/enforceLonghand.d.ts.map +1 -0
  42. package/dist/plugins/enforceLonghand.js +108 -0
  43. package/dist/plugins/enforceLonghand.js.map +1 -0
  44. package/dist/plugins/extend.d.ts +15 -0
  45. package/dist/plugins/extend.js +59 -0
  46. package/dist/plugins/prefixer.d.ts +4 -0
  47. package/dist/plugins/prefixer.d.ts.map +1 -0
  48. package/dist/plugins/prefixer.js +90 -0
  49. package/dist/plugins/prefixer.js.map +1 -0
  50. package/dist/plugins/responsiveValue.d.ts +8 -0
  51. package/dist/plugins/responsiveValue.d.ts.map +1 -0
  52. package/dist/plugins/responsiveValue.js +37 -0
  53. package/dist/plugins/responsiveValue.js.map +1 -0
  54. package/dist/plugins/sortProperty.d.ts +6 -0
  55. package/dist/plugins/sortProperty.d.ts.map +1 -0
  56. package/dist/plugins/sortProperty.js +24 -0
  57. package/dist/plugins/sortProperty.js.map +1 -0
  58. package/dist/plugins/unit.d.ts +5 -0
  59. package/dist/plugins/unit.d.ts.map +1 -0
  60. package/dist/plugins/unit.js +37 -0
  61. package/dist/plugins/unit.js.map +1 -0
  62. package/dist/tsconfig.tsbuildinfo +1 -0
  63. package/dist/types.d.ts +13 -0
  64. package/dist/types.d.ts.map +1 -0
  65. package/dist/types.js +2 -0
  66. package/dist/types.js.map +1 -0
  67. package/package.json +61 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022-present Robin Weser
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @weser/style
2
+
3
+ [Documentation](https://stack.weser.io/style)
@@ -0,0 +1,21 @@
1
+ import { createHooks as baseCreateHooks } from '@css-hooks/react';
2
+ import { WithHooks as BaseWithHooks } from '@css-hooks/core';
3
+ import { assignStyle } from 'css-in-js-utils';
4
+ import { type T_Fallback, type T_RawStyle, type T_Style } from '../types';
5
+ type WithHooks<Hooks, T> = BaseWithHooks<Hooks, T>;
6
+ type Plugin<T> = (style: T) => T;
7
+ type HookOptions<Hooks extends string> = Parameters<typeof baseCreateHooks<Hooks>>[0];
8
+ type Config<T, Hooks extends string> = {
9
+ hooks: HookOptions<Hooks>;
10
+ fallbacks?: Array<T_Fallback>;
11
+ plugins?: Array<Plugin<T>>;
12
+ mergeStyle?: typeof assignStyle;
13
+ };
14
+ export type Properties<T, Hooks> = Array<Properties<T, Hooks>> | WithHooks<Hooks, T> | undefined;
15
+ export type CSSFunction<T, Hooks> = (...style: Array<Properties<T, Hooks>>) => T_RawStyle;
16
+ export default function createRenderer<Hooks extends Record<string, string>, T extends Record<string, any> = T_Style>({ hooks, fallbacks, plugins, mergeStyle, }: Config<T, keyof Hooks & string>): [
17
+ string,
18
+ CSSFunction<T, keyof Hooks & string>
19
+ ];
20
+ export {};
21
+ //# sourceMappingURL=createRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRenderer.d.ts","sourceRoot":"","sources":["../../src/core/createRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAK7C,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AAEzE,KAAK,SAAS,CAAC,KAAK,EAAE,CAAC,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;AAElD,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAA;AAEhC,KAAK,WAAW,CAAC,KAAK,SAAS,MAAM,IAAI,UAAU,CACjD,OAAO,eAAe,CAAC,KAAK,CAAC,CAC9B,CAAC,CAAC,CAAC,CAAA;AAEJ,KAAK,MAAM,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,IAAI;IACrC,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,CAAA;IACzB,SAAS,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;IAC7B,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1B,UAAU,CAAC,EAAE,OAAO,WAAW,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,KAAK,IAC3B,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAC3B,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,GACnB,SAAS,CAAA;AACb,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,KAAK,IAAI,CAClC,GAAG,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,KAClC,UAAU,CAAA;AACf,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,EACvC,EACA,KAAK,EACL,SAAc,EACd,OAAY,EACZ,UAAwB,GACzB,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG;IACnC,MAAM;IACN,WAAW,CAAC,CAAC,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC;CACrC,CA2BA"}
@@ -0,0 +1,23 @@
1
+ import { createHooks as baseCreateHooks } from '@css-hooks/react';
2
+ import { assignStyle } from 'css-in-js-utils';
3
+ import fallbackValuePlugin from './fallbackValuePlugin';
4
+ import getFallbackCSS from './getFallbackCSS';
5
+ export default function createRenderer({ hooks, fallbacks = [], plugins = [], mergeStyle = assignStyle, }) {
6
+ if (fallbacks.length > 0) {
7
+ plugins.unshift(fallbackValuePlugin(fallbacks));
8
+ }
9
+ const fallbackCSS = getFallbackCSS(fallbacks);
10
+ const [baseCSS, fn] = baseCreateHooks(hooks);
11
+ const staticCSS = [baseCSS, fallbackCSS].join('');
12
+ function css(...style) {
13
+ // we ignore the "Type instantiation is excessively deep and possibly infinite."
14
+ // @ts-ignore
15
+ const flattened = style.flat(Infinity);
16
+ const filtered = flattened.filter(Boolean);
17
+ const merged = mergeStyle({}, ...filtered);
18
+ const processed = plugins.reduce((processed, plugin) => plugin(processed), merged);
19
+ return fn(processed);
20
+ }
21
+ return [staticCSS, css];
22
+ }
23
+ //# sourceMappingURL=createRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRenderer.js","sourceRoot":"","sources":["../../src/core/createRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE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T = T_Style>(condition: boolean, style: T): T_Style;
3
+ //# sourceMappingURL=extend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../../src/core/extend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC,GAAG,OAAO,EACxC,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,CAAC,GACP,OAAO,CAET"}
@@ -0,0 +1,4 @@
1
+ export default function extend(condition, style) {
2
+ return (condition ? style : {});
3
+ }
4
+ //# sourceMappingURL=extend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extend.js","sourceRoot":"","sources":["../../src/core/extend.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,MAAM,CAC5B,SAAkB,EAClB,KAAQ;IAER,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAY,CAAA;AAC5C,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { T_Fallback } from '../types';
2
+ export default function fallbackValue(property: T_Fallback['property'], values: T_Fallback['values'], match?: T_Fallback['match']): {
3
+ property: string | string[];
4
+ values: string[];
5
+ match: string | undefined;
6
+ };
7
+ //# sourceMappingURL=fallbackValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fallbackValue.d.ts","sourceRoot":"","sources":["../../src/core/fallbackValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,EAChC,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAC5B,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC;;;;EAO5B"}
@@ -0,0 +1,8 @@
1
+ export default function fallbackValue(property, values, match) {
2
+ return {
3
+ property,
4
+ values,
5
+ match,
6
+ };
7
+ }
8
+ //# sourceMappingURL=fallbackValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fallbackValue.js","sourceRoot":"","sources":["../../src/core/fallbackValue.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,QAAgC,EAChC,MAA4B,EAC5B,KAA2B;IAE3B,OAAO;QACL,QAAQ;QACR,MAAM;QACN,KAAK;KACN,CAAA;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type T_Fallback } from '../types';
2
+ export default function fallbackValuePlugin(fallbacks?: Array<T_Fallback>): <T extends Record<string, any>>(style: T) => T;
3
+ //# sourceMappingURL=fallbackValuePlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fallbackValuePlugin.d.ts","sourceRoot":"","sources":["../../src/core/fallbackValuePlugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,SAAS,GAAE,KAAK,CAAC,UAAU,CAAM,IAYtC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAChE,OAAO,CAAC,OAmBX"}
@@ -0,0 +1,30 @@
1
+ // @ts-nocheck
2
+ import isPlainObject from 'isobject';
3
+ import getFallbackVariable from './getFallbackVariable';
4
+ export default function fallbackValuePlugin(fallbacks = []) {
5
+ const fallbackMap = fallbacks.reduce((map, { property, values, match }) => {
6
+ // use the last value as a default matcher if no match is provided
7
+ const actualMatch = match || values[values.length - 1];
8
+ [].concat(property).forEach((prop) => {
9
+ map[prop] = actualMatch;
10
+ });
11
+ return map;
12
+ }, {});
13
+ return function resolveFallbackValue(style) {
14
+ for (let property in style) {
15
+ const value = style[property];
16
+ if (isPlainObject(value)) {
17
+ style[property] = resolveFallbackValue(value);
18
+ }
19
+ else {
20
+ const fallback = fallbackMap[property];
21
+ if (fallback && fallback === value) {
22
+ style[property] =
23
+ 'var(' + getFallbackVariable(property, fallback) + ')';
24
+ }
25
+ }
26
+ }
27
+ return style;
28
+ };
29
+ }
30
+ //# sourceMappingURL=fallbackValuePlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fallbackValuePlugin.js","sourceRoot":"","sources":["../../src/core/fallbackValuePlugin.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,aAAa,MAAM,UAAU,CAAA;AAEpC,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AAIvD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,YAA+B,EAAE;IAC3E,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QACxE,kEAAkE;QAClE,MAAM,WAAW,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAErD;QAAA,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACpC,GAAG,CAAC,IAAI,CAAC,GAAG,WAAW,CAAA;QACzB,CAAC,CAAC,CAAA;QAEF,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,SAAS,oBAAoB,CAClC,KAAQ;QAER,KAAK,IAAI,QAAQ,IAAI,KAAK,EAAE,CAAC;YAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA;YAE7B,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,KAAK,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAA;YAC/C,CAAC;iBAAM,CAAC;gBACN,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAA;gBAEtC,IAAI,QAAQ,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;oBACnC,KAAK,CAAC,QAAQ,CAAC;wBACb,MAAM,GAAG,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,GAAG,CAAA;gBAC1D,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAA;IACd,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type T_Fallback } from '../types';
2
+ export default function getFallbackCSS(fallbacks: Array<T_Fallback>): string;
3
+ //# sourceMappingURL=getFallbackCSS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFallbackCSS.d.ts","sourceRoot":"","sources":["../../src/core/getFallbackCSS.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,UAkClE"}
@@ -0,0 +1,27 @@
1
+ import { hyphenateProperty } from 'css-in-js-utils';
2
+ import getFallbackVariable from './getFallbackVariable';
3
+ export default function getFallbackCSS(fallbacks) {
4
+ const rootCSS = fallbacks.reduce((css, { property, values = [], match }) => {
5
+ // use the last value as a default matcher if no match is provided
6
+ const actualMatch = match || values[values.length - 1];
7
+ return (css +
8
+ []
9
+ // @ts-ignore
10
+ .concat(property)
11
+ .map((prop) => `${getFallbackVariable(prop, actualMatch)}:;`)
12
+ .join(''));
13
+ }, '');
14
+ const supportsCSS = fallbacks.map(({ property, values = [], match }) => {
15
+ // use the last value as a default matcher if no match is provided
16
+ const actualMatch = match || values[values.length - 1];
17
+ return values
18
+ .map((value) => []
19
+ // @ts-ignore
20
+ .concat(property)
21
+ .map((prop) => `@supports (${hyphenateProperty(prop)}:${value}){:root{${getFallbackVariable(prop, actualMatch)}:${value}}}`)
22
+ .join(''))
23
+ .join('');
24
+ });
25
+ return (rootCSS ? `:root {${rootCSS}}` : '') + supportsCSS.join('');
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CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,KAAK,IAAI,CAC/G;aACA,IAAI,CAAC,EAAE,CAAC,CACZ;aACA,IAAI,CAAC,EAAE,CAAC,CAAA;IACb,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACrE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export default function getFallbackVariable(property: string, value: string): string;
2
+ //# sourceMappingURL=getFallbackVariable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFallbackVariable.d.ts","sourceRoot":"","sources":["../../src/core/getFallbackVariable.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAE1E"}
@@ -0,0 +1,4 @@
1
+ export default function getFallbackVariable(property, value) {
2
+ return '--' + property + '-' + value;
3
+ }
4
+ //# sourceMappingURL=getFallbackVariable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFallbackVariable.js","sourceRoot":"","sources":["../../src/core/getFallbackVariable.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,QAAgB,EAAE,KAAa;IACzE,OAAO,IAAI,GAAG,QAAQ,GAAG,GAAG,GAAG,KAAK,CAAA;AACtC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export default function useCSSVariable(fallbackValue?: string): [`--${string}`, string];
2
+ //# sourceMappingURL=useCSSVariable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCSSVariable.d.ts","sourceRoot":"","sources":["../../src/helpers/useCSSVariable.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,aAAa,CAAC,EAAE,MAAM,GACrB,CAAC,KAAK,MAAM,EAAE,EAAE,MAAM,CAAC,CAWzB"}
@@ -0,0 +1,11 @@
1
+ import { useId } from 'react';
2
+ export default function useCSSVariable(fallbackValue) {
3
+ const id = useId();
4
+ const name = id.replace(/:/g, '_');
5
+ const variable = `--${name}`;
6
+ if (fallbackValue) {
7
+ return [variable, `var(${variable}, ${fallbackValue})`];
8
+ }
9
+ return [variable, `var(${variable})`];
10
+ }
11
+ //# sourceMappingURL=useCSSVariable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCSSVariable.js","sourceRoot":"","sources":["../../src/helpers/useCSSVariable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,aAAsB;IAEtB,MAAM,EAAE,GAAG,KAAK,EAAE,CAAA;IAElB,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAClC,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAW,CAAA;IAErC,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CAAC,QAAQ,EAAE,OAAO,QAAQ,KAAK,aAAa,GAAG,CAAC,CAAA;IACzD,CAAC;IAED,OAAO,CAAC,QAAQ,EAAE,OAAO,QAAQ,GAAG,CAAC,CAAA;AACvC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export { default as createRenderer, type Properties, type CSSFunction, } from './core/createRenderer';
2
+ export { default as fallbackValue } from './core/fallbackValue';
3
+ export { default as extend } from './core/extend';
4
+ export { default as responsiveValuePlugin, responsiveValue, type T_ResponsiveStyle, type T_ResponsiveValue, } from './plugins/responsiveValue';
5
+ export { default as prefixerPlugin, fallbacks as prefixerFallbacks, } from './plugins/prefixer';
6
+ export { default as debugPlugin } from './plugins/debug';
7
+ export { default as enforceLonghandPlugin } from './plugins/enforceLonghand';
8
+ export { default as sortPropertyPlugin } from './plugins/sortProperty';
9
+ export { default as unitPlugin } from './plugins/unit';
10
+ export { default as useCSSVariable } from './helpers/useCSSVariable';
11
+ export { type T_Fallback, type T_Style } from './types';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,cAAc,EACzB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EACL,OAAO,IAAI,qBAAqB,EAChC,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,OAAO,IAAI,cAAc,EACzB,SAAS,IAAI,iBAAiB,GAC/B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAC5E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEpE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ export { default as createRenderer, } from './core/createRenderer';
2
+ export { default as fallbackValue } from './core/fallbackValue';
3
+ export { default as extend } from './core/extend';
4
+ export { default as responsiveValuePlugin, responsiveValue, } from './plugins/responsiveValue';
5
+ export { default as prefixerPlugin, fallbacks as prefixerFallbacks, } from './plugins/prefixer';
6
+ export { default as debugPlugin } from './plugins/debug';
7
+ export { default as enforceLonghandPlugin } from './plugins/enforceLonghand';
8
+ export { default as sortPropertyPlugin } from './plugins/sortProperty';
9
+ export { default as unitPlugin } from './plugins/unit';
10
+ export { default as useCSSVariable } from './helpers/useCSSVariable';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,cAAc,GAG1B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EACL,OAAO,IAAI,qBAAqB,EAChC,eAAe,GAGhB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,OAAO,IAAI,cAAc,EACzB,SAAS,IAAI,iBAAiB,GAC/B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAC5E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,126 @@
1
+ declare module 'fela-plugin-bidi' {
2
+ import { T_Style } from '@weser/styling'
3
+
4
+ export default function bidi<T = T_Style>(
5
+ direction?: 'ltr' | 'rtl'
6
+ ): (style: T) => T
7
+ }
8
+
9
+ declare module 'fela-plugin-custom-property' {
10
+ import { T_Style } from '@weser/styling'
11
+
12
+ export default function customProperty<P extends Record<string, any>>(
13
+ properties: P
14
+ ): (
15
+ style: Partial<{
16
+ [Property in keyof P]: Parameters<P[Property]>[0]
17
+ }>
18
+ ) => T_Style
19
+ }
20
+
21
+ declare module 'fela-plugin-expand-shorthand' {
22
+ import { T_Style } from '@weser/styling'
23
+
24
+ export default function expandShorthand<T = T_Style>(): (style: T) => T
25
+ }
26
+
27
+ declare module 'fela-plugin-extend' {
28
+ import { T_Style } from '@weser/styling'
29
+ import { WithHooks } from '@css-hooks/core'
30
+
31
+ type Extension<T, Hooks> = {
32
+ condition: boolean | undefined
33
+ style: ExtendStyle<T, Hooks>
34
+ }
35
+
36
+ export type ExtendStyle<T, Hooks> = WithHooks<keyof Hooks, T> & {
37
+ extend?: Extension<T, Hooks> | Array<Extension<T, Hooks>>
38
+ }
39
+
40
+ export default function extend<Hooks, T = T_Style>(): (
41
+ style: ExtendStyle<T, Hooks>
42
+ ) => T_Style
43
+ }
44
+
45
+ declare module 'fela-plugin-hover-media' {
46
+ import { T_Style } from '@weser/styling'
47
+
48
+ export default function hoverMedia(): (style: T_Style) => T_Style
49
+ }
50
+
51
+ declare module 'fela-plugin-important' {
52
+ import { T_Style } from '@weser/styling'
53
+
54
+ export default function important(): (style: T_Style) => T_Style
55
+ }
56
+
57
+ declare module 'fela-plugin-isolation' {
58
+ import { T_RawStyle, T_Style } from '@weser/styling'
59
+
60
+ type Config = {
61
+ exclude: Array<keyof T_RawStyle>
62
+ }
63
+ export default function isolation<T = T_Style>(
64
+ config?: Config
65
+ ): (style: T) => T
66
+ }
67
+
68
+ declare module 'fela-plugin-kebab-case' {
69
+ import { T_Style } from '@weser/styling'
70
+
71
+ export default function kebabCase<T = T_Style>(): (style: T) => T
72
+ }
73
+
74
+ declare module 'fela-plugin-logger' {
75
+ import { T_Style } from '@weser/styling'
76
+
77
+ export default function logger<T = T_Style>(): (style: T) => T
78
+ }
79
+
80
+ declare module 'fela-plugin-rtl' {
81
+ import { T_Style } from '@weser/styling'
82
+
83
+ export default function rtl<T = T_Style>(
84
+ direction?: 'ltr' | 'rtl'
85
+ ): (style: T) => T
86
+ }
87
+
88
+ declare module 'fela-plugin-unit' {
89
+ import { T_RawStyle, T_Style } from '@weser/styling'
90
+
91
+ type Unit =
92
+ | 'ch'
93
+ | 'em'
94
+ | 'ex'
95
+ | 'rem'
96
+ | 'vh'
97
+ | 'vw'
98
+ | 'vmin'
99
+ | 'vmax'
100
+ | 'px'
101
+ | 'cm'
102
+ | 'mm'
103
+ | 'in'
104
+ | 'pc'
105
+ | 'pt'
106
+ | 'mozmm'
107
+
108
+ export default function unit<T = T_Style>(
109
+ unit?: Unit,
110
+ unitPerProperty?: { [P in keyof T_RawStyle]: Unit },
111
+ isUnitlessProperty?: (property: string) => boolean
112
+ ): (style: T) => T
113
+ }
114
+
115
+ declare module 'fela-plugin-validator' {
116
+ import { T_Style } from '@weser/styling'
117
+
118
+ type Config = {
119
+ logInvalid?: boolean
120
+ deleteInvalid?: boolean
121
+ useCSSLint?: boolean
122
+ }
123
+ export default function validator<T = T_Style>(
124
+ config?: Config
125
+ ): (style: T) => T
126
+ }
@@ -0,0 +1,6 @@
1
+ import { Config } from 'styles-debugger';
2
+ import { type T_Style } from '../types';
3
+ export default function debugPlugin<T = T_Style>(autoActive?: boolean, config?: Config): (style: T & {
4
+ debug?: boolean;
5
+ }) => any;
6
+ //# sourceMappingURL=debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/plugins/debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACP,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,GAAG,OAAO,EAC7C,UAAU,UAAO,EACjB,MAAM,GAAE,MAAW,IAIG,OAAO,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,SAYrD"}
@@ -0,0 +1,15 @@
1
+ import { CreateStylesDebugger as createStylesDebugger, } from 'styles-debugger';
2
+ export default function debugPlugin(autoActive = true, config = {}) {
3
+ const debugStyle = createStylesDebugger(config);
4
+ return function debug(style) {
5
+ if (autoActive || style?.debug) {
6
+ const { debug, ...rest } = style;
7
+ return {
8
+ ...rest,
9
+ ...debugStyle(),
10
+ };
11
+ }
12
+ return style;
13
+ };
14
+ }
15
+ //# sourceMappingURL=debug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/plugins/debug.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,IAAI,oBAAoB,GAE7C,MAAM,iBAAiB,CAAA;AAGxB,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,UAAU,GAAG,IAAI,EACjB,SAAiB,EAAE;IAEnB,MAAM,UAAU,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAA;IAE/C,OAAO,SAAS,KAAK,CAAC,KAA8B;QAClD,IAAI,UAAU,IAAI,KAAK,EAAE,KAAK,EAAE,CAAC;YAC/B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;YAEhC,OAAO;gBACL,GAAG,IAAI;gBACP,GAAG,UAAU,EAAE;aAChB,CAAA;QACH,CAAC;QAED,OAAO,KAAK,CAAA;IACd,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type T_Style } from '../types';
2
+ type BorderMode = 'none' | 'longhand' | 'directional';
3
+ export default function enforceLonghandPlugin<T extends Record<string, any> = T_Style>(borderMode?: BorderMode): (style: T) => T;
4
+ export {};
5
+ //# sourceMappingURL=enforceLonghand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforceLonghand.d.ts","sourceRoot":"","sources":["../../src/plugins/enforceLonghand.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AAsHvC,KAAK,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,aAAa,CAAA;AACrD,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,EACvC,UAAU,GAAE,UAAmB,mBAQhC"}
@@ -0,0 +1,108 @@
1
+ import sortProperty from './sortProperty';
2
+ function capitalize(str) {
3
+ return str.charAt(0).toUpperCase() + str.slice(1);
4
+ }
5
+ function getPropertyPriority({ borderLonghand, borderDirectional, borderDirectionalLonghand, }) {
6
+ const propertyPriority = {
7
+ marginLeft: 2,
8
+ marginRight: 2,
9
+ marginTop: 2,
10
+ marginBottom: 2,
11
+ marginInline: 2,
12
+ marginBlock: 2,
13
+ marginInlineStart: 3,
14
+ marginInlineEnd: 3,
15
+ marginBlockStart: 3,
16
+ marginBlockEnd: 3,
17
+ paddingLeft: 2,
18
+ paddingRight: 2,
19
+ paddingBottom: 2,
20
+ paddingTop: 2,
21
+ paddingInline: 2,
22
+ paddingBlock: 2,
23
+ paddingInlineStart: 3,
24
+ paddingInlineEnd: 3,
25
+ paddingBlockStart: 3,
26
+ paddingBlockEnd: 3,
27
+ flexWrap: 2,
28
+ flexShrink: 2,
29
+ flexBasis: 2,
30
+ backgroundColor: 2,
31
+ backgroundRepeat: 2,
32
+ backgroundPosition: 2,
33
+ backgroundImage: 2,
34
+ backgroundOrigin: 2,
35
+ backgroundClip: 2,
36
+ backgroundSize: 2,
37
+ transitionProperty: 2,
38
+ transitionTimingFunction: 2,
39
+ transitionDuration: 2,
40
+ transitionDelay: 2,
41
+ animationDelay: 2,
42
+ animationDirection: 2,
43
+ animationDuration: 2,
44
+ animationFillMode: 2,
45
+ animationIterationCount: 2,
46
+ animationName: 2,
47
+ animationPlayState: 2,
48
+ animationTimingFunction: 2,
49
+ borderWidth: borderLonghand,
50
+ borderStyle: borderLonghand,
51
+ borderColor: borderLonghand,
52
+ // these conflict with the longhands above
53
+ borderTop: borderDirectional,
54
+ borderRight: borderDirectional,
55
+ borderBottom: borderDirectional,
56
+ borderLeft: borderDirectional,
57
+ borderTopWidth: borderDirectionalLonghand,
58
+ borderTopStyle: borderDirectionalLonghand,
59
+ borderTopColor: borderDirectionalLonghand,
60
+ borderRightWidth: borderDirectionalLonghand,
61
+ borderRightStyle: borderDirectionalLonghand,
62
+ borderRightColor: borderDirectionalLonghand,
63
+ borderBottomWidth: borderDirectionalLonghand,
64
+ borderBottomStyle: borderDirectionalLonghand,
65
+ borderBottomColor: borderDirectionalLonghand,
66
+ borderLeftWidth: borderDirectionalLonghand,
67
+ borderLeftStyle: borderDirectionalLonghand,
68
+ borderLeftColor: borderDirectionalLonghand,
69
+ borderBottomLeftRadius: 2,
70
+ borderBottomRightRadius: 2,
71
+ borderTopLeftRadius: 2,
72
+ borderTopRightRadius: 2,
73
+ borderImageOutset: 2,
74
+ borderImageRepeat: 2,
75
+ borderImageSlice: 2,
76
+ borderImageSource: 2,
77
+ borderImageWidth: 2,
78
+ columnWidth: 2,
79
+ columnCount: 2,
80
+ listStyleImage: 2,
81
+ listStylePosition: 2,
82
+ listStyleType: 2,
83
+ outlineWidth: 2,
84
+ outlineStyle: 2,
85
+ outlineColor: 2,
86
+ overflowX: 2,
87
+ overflowY: 2,
88
+ textDecorationLine: 2,
89
+ textDecorationStyle: 2,
90
+ textDecorationColor: 2,
91
+ };
92
+ // Add all possible vendor prefixes to all properties
93
+ // prefixerPlugin converts properties to prefixed ones like `WebkitBackgroundColor`
94
+ return Object.entries(propertyPriority).reduce((acc, [property, priority]) => {
95
+ // @ts-ignore
96
+ acc['Webkit' + capitalize(property)] = priority;
97
+ return acc;
98
+ }, propertyPriority);
99
+ }
100
+ export default function enforceLonghandPlugin(borderMode = 'none') {
101
+ const propertyPriority = getPropertyPriority({
102
+ borderDirectional: borderMode === 'directional' ? 3 : 2,
103
+ borderLonghand: borderMode === 'longhand' ? 3 : 2,
104
+ borderDirectionalLonghand: borderMode === 'none' ? 3 : 4,
105
+ });
106
+ return sortProperty(propertyPriority);
107
+ }
108
+ //# sourceMappingURL=enforceLonghand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforceLonghand.js","sourceRoot":"","sources":["../../src/plugins/enforceLonghand.ts"],"names":[],"mappings":"AAAA,OAAO,YAAuC,MAAM,gBAAgB,CAAA;AAIpE,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACnD,CAAC;AAOD,SAAS,mBAAmB,CAAI,EAC9B,cAAc,EACd,iBAAiB,EACjB,yBAAyB,GACV;IACf,MAAM,gBAAgB,GAAG;QACvB,UAAU,EAAE,CAAC;QACb,WAAW,EAAE,CAAC;QACd,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,CAAC;QACd,iBAAiB,EAAE,CAAC;QACpB,eAAe,EAAE,CAAC;QAClB,gBAAgB,EAAE,CAAC;QACnB,cAAc,EAAE,CAAC;QAEjB,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;QACf,aAAa,EAAE,CAAC;QAChB,UAAU,EAAE,CAAC;QACb,aAAa,EAAE,CAAC;QAChB,YAAY,EAAE,CAAC;QACf,kBAAkB,EAAE,CAAC;QACrB,gBAAgB,EAAE,CAAC;QACnB,iBAAiB,EAAE,CAAC;QACpB,eAAe,EAAE,CAAC;QAElB,QAAQ,EAAE,CAAC;QACX,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,CAAC;QACZ,eAAe,EAAE,CAAC;QAClB,gBAAgB,EAAE,CAAC;QACnB,kBAAkB,EAAE,CAAC;QACrB,eAAe,EAAE,CAAC;QAClB,gBAAgB,EAAE,CAAC;QACnB,cAAc,EAAE,CAAC;QACjB,cAAc,EAAE,CAAC;QACjB,kBAAkB,EAAE,CAAC;QACrB,wBAAwB,EAAE,CAAC;QAC3B,kBAAkB,EAAE,CAAC;QACrB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SAAS,EAAE,CAAC;QACZ,kBAAkB,EAAE,CAAC;QACrB,mBAAmB,EAAE,CAAC;QACtB,mBAAmB,EAAE,CAAC;KACvB,CAAA;IAED,qDAAqD;IACrD,mFAAmF;IACnF,OAAO,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAC5C,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE;QAC5B,aAAa;QACb,GAAG,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,GAAG,QAAQ,CAAA;QAE/C,OAAO,GAAG,CAAA;IACZ,CAAC,EACD,gBAAgB,CACM,CAAA;AAC1B,CAAC;AAGD,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAE3C,aAAyB,MAAM;IAC/B,MAAM,gBAAgB,GAAG,mBAAmB,CAAI;QAC9C,iBAAiB,EAAE,UAAU,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,cAAc,EAAE,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,yBAAyB,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACzD,CAAC,CAAA;IAEF,OAAO,YAAY,CAAI,gBAAgB,CAAC,CAAA;AAC1C,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { WithHooks } from '@css-hooks/core';
2
+ type Extension<T, Hooks> = {
3
+ condition: boolean | undefined;
4
+ style: T_ExtendStyle<T, Hooks>;
5
+ };
6
+ export type T_ExtendStyle<T, Hooks> = WithHooks<keyof Hooks & string, T> & {
7
+ extend?: Extension<T, Hooks> | T_ExtendStyle<T, Hooks> | Array<Extension<T, Hooks>>;
8
+ };
9
+ type T_Extend = Record<string, any> & {
10
+ condition?: never;
11
+ style?: never;
12
+ };
13
+ export default function extendPlugin(): typeof extend;
14
+ declare function extend<T extends T_Extend>(style: T): T;
15
+ export {};
@@ -0,0 +1,59 @@
1
+ import isPlainObject from 'isobject';
2
+ import { assignStyle } from 'css-in-js-utils';
3
+ export default function extendPlugin() {
4
+ return extend;
5
+ }
6
+ function extend(style) {
7
+ for (const property in style) {
8
+ const value = style[property];
9
+ if (property === 'extend') {
10
+ // @ts-ignore
11
+ const extensions = [].concat(value);
12
+ extensions.forEach((extension) => extendStyle(style, extension));
13
+ delete style[property];
14
+ // support nested extend as well
15
+ }
16
+ else if (isPlainObject(value)) {
17
+ // @ts-ignore
18
+ style[property] = extend(value);
19
+ }
20
+ }
21
+ return style;
22
+ }
23
+ function extendStyle(style, extension) {
24
+ // extend conditional style objects
25
+ if ('condition' in extension) {
26
+ if (extension.condition) {
27
+ assignStyle(style, extend(extension.style));
28
+ }
29
+ }
30
+ else {
31
+ // extend basic style objects
32
+ assignStyle(style, removeUndefined(extend(extension)));
33
+ }
34
+ }
35
+ function removeUndefined(style) {
36
+ for (const property in style) {
37
+ const value = style[property];
38
+ if (isPlainObject(value)) {
39
+ // @ts-ignore
40
+ style[property] = removeUndefined(value);
41
+ }
42
+ else if (Array.isArray(value)) {
43
+ style[property] = value.filter((item) => !isUndefinedValue(item));
44
+ }
45
+ else if (isUndefinedValue(value)) {
46
+ delete style[property];
47
+ }
48
+ }
49
+ return style;
50
+ }
51
+ const FALSY_REGEX = /undefined|null/;
52
+ const URL_REGEX = /url/;
53
+ function isUndefinedValue(value) {
54
+ return (value === undefined ||
55
+ value === null ||
56
+ (typeof value === 'string' &&
57
+ FALSY_REGEX.test(value) &&
58
+ !URL_REGEX.test(value)));
59
+ }
@@ -0,0 +1,4 @@
1
+ import { type T_Fallback, type T_Style } from '../types';
2
+ export default function prefixerPlugin<T = T_Style>(): (style: T) => {};
3
+ export declare const fallbacks: Array<T_Fallback>;
4
+ //# sourceMappingURL=prefixer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefixer.d.ts","sourceRoot":"","sources":["../../src/plugins/prefixer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AA+CxD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,GAAG,OAAO,MACd,OAAO,CAAC,QAuB3C;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,UAAU,CAuBvC,CAAA"}
@@ -0,0 +1,90 @@
1
+ import isObject from 'isobject';
2
+ function capitalize(str) {
3
+ return str.charAt(0).toUpperCase() + str.slice(1);
4
+ }
5
+ const w = 'Webkit';
6
+ const m = 'Moz';
7
+ const prefixes = {
8
+ textEmphasisPosition: w,
9
+ textEmphasis: w,
10
+ textEmphasisStyle: w,
11
+ textEmphasisColor: w,
12
+ boxDecorationBreak: w,
13
+ maskImage: w,
14
+ maskMode: w,
15
+ maskRepeat: w,
16
+ maskPosition: w,
17
+ maskClip: w,
18
+ maskOrigin: w,
19
+ maskSize: w,
20
+ maskComposite: w,
21
+ mask: w,
22
+ maskBorderSource: w,
23
+ maskBorderMode: w,
24
+ maskBorderSlice: w,
25
+ maskBorderWidth: w,
26
+ maskBorderOutset: w,
27
+ maskBorderRepeat: w,
28
+ maskBorder: w,
29
+ maskType: w,
30
+ appearance: w,
31
+ userSelect: w,
32
+ backdropFilter: w,
33
+ clipPath: w,
34
+ hyphens: w,
35
+ textOrientation: w,
36
+ tabSize: m,
37
+ fontKerning: w,
38
+ textSizeAdjust: w,
39
+ textDecorationStyle: w,
40
+ textDecorationSkip: w,
41
+ textDecorationLine: w,
42
+ textDecorationColor: w,
43
+ };
44
+ export default function prefixerPlugin() {
45
+ return function addVendorPrefixes(style) {
46
+ const prefixed = {};
47
+ for (const property in style) {
48
+ const value = style[property];
49
+ if (isObject(value)) {
50
+ // @ts-ignore
51
+ prefixed[property] = addVendorPrefixes(value);
52
+ }
53
+ else {
54
+ // @ts-ignore
55
+ if (prefixes[property]) {
56
+ // @ts-ignore
57
+ prefixed[prefixes[property] + capitalize(property)] = value;
58
+ }
59
+ // @ts-ignore
60
+ prefixed[property] = value;
61
+ }
62
+ }
63
+ return prefixed;
64
+ };
65
+ }
66
+ export const fallbacks = [
67
+ {
68
+ property: [
69
+ 'width',
70
+ 'minWidth',
71
+ 'maxWidth',
72
+ 'height',
73
+ 'minHeight',
74
+ 'maxHeight',
75
+ ],
76
+ values: ['-webkit-min-content', 'min-content'],
77
+ },
78
+ {
79
+ property: [
80
+ 'width',
81
+ 'minWidth',
82
+ 'maxWidth',
83
+ 'height',
84
+ 'minHeight',
85
+ 'maxHeight',
86
+ ],
87
+ values: ['-webkit-max-content', 'max-content'],
88
+ },
89
+ ];
90
+ //# sourceMappingURL=prefixer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefixer.js","sourceRoot":"","sources":["../../src/plugins/prefixer.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAI/B,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACnD,CAAC;AAED,MAAM,CAAC,GAAG,QAAQ,CAAA;AAClB,MAAM,CAAC,GAAG,KAAK,CAAA;AAEf,MAAM,QAAQ,GAAG;IACf,oBAAoB,EAAE,CAAC;IACvB,YAAY,EAAE,CAAC;IACf,iBAAiB,EAAE,CAAC;IACpB,iBAAiB,EAAE,CAAC;IACpB,kBAAkB,EAAE,CAAC;IACrB,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC;IACX,UAAU,EAAE,CAAC;IACb,YAAY,EAAE,CAAC;IACf,QAAQ,EAAE,CAAC;IACX,UAAU,EAAE,CAAC;IACb,QAAQ,EAAE,CAAC;IACX,aAAa,EAAE,CAAC;IAChB,IAAI,EAAE,CAAC;IACP,gBAAgB,EAAE,CAAC;IACnB,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE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YACR,OAAO;YACP,UAAU;YACV,UAAU;YACV,QAAQ;YACR,WAAW;YACX,WAAW;SACZ;QACD,MAAM,EAAE,CAAC,qBAAqB,EAAE,aAAa,CAAC;KAC/C;IACD;QACE,QAAQ,EAAE;YACR,OAAO;YACP,UAAU;YACV,UAAU;YACV,QAAQ;YACR,WAAW;YACX,WAAW;SACZ;QACD,MAAM,EAAE,CAAC,qBAAqB,EAAE,aAAa,CAAC;KAC/C;CACF,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { type T_Style } from '../types';
2
+ export type T_ResponsiveValue<T> = T | (T | undefined)[];
3
+ export type T_ResponsiveStyle<T = T_Style> = {
4
+ [P in keyof T]: T_ResponsiveValue<T[P]>;
5
+ };
6
+ export declare function responsiveValue<T>(value: T_ResponsiveValue<T>): T;
7
+ export default function responsiveValuePlugin<T = T_Style>(mediaQueries: Array<string>): (style: T) => T;
8
+ //# sourceMappingURL=responsiveValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responsiveValue.d.ts","sourceRoot":"","sources":["../../src/plugins/responsiveValue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAA;AAExD,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,OAAO,IAAI;KAC1C,CAAC,IAAI,MAAM,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACxC,CAAA;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAEjE;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,CAAC,GAAG,OAAO,EACvD,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,IAEK,OAAO,CAAC,OAGzC"}
@@ -0,0 +1,37 @@
1
+ import isPlainObject from 'isobject';
2
+ import { assignStyle } from 'css-in-js-utils';
3
+ export function responsiveValue(value) {
4
+ return value;
5
+ }
6
+ export default function responsiveValuePlugin(mediaQueries) {
7
+ return function responsiveValue(style) {
8
+ return resolveResponsiveValues(style, mediaQueries);
9
+ };
10
+ }
11
+ function resolveResponsiveValues(style, mediaQueries) {
12
+ for (const key in style) {
13
+ const property = key;
14
+ const value = style[property];
15
+ if (isPlainObject(value)) {
16
+ // @ts-ignore
17
+ style[property] = resolveResponsiveValues(value, mediaQueries);
18
+ }
19
+ if (Array.isArray(value)) {
20
+ const [defaultValue, ...mediaValues] = value;
21
+ // @ts-ignore
22
+ style[property] = defaultValue;
23
+ mediaQueries.slice(0, mediaValues.length).forEach((query, index) => {
24
+ if (mediaValues[index] !== null && mediaValues[index] !== undefined) {
25
+ // @ts-ignore
26
+ assignStyle(style, {
27
+ [query]: {
28
+ [property]: mediaValues[index],
29
+ },
30
+ });
31
+ }
32
+ });
33
+ }
34
+ }
35
+ return style;
36
+ }
37
+ //# sourceMappingURL=responsiveValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responsiveValue.js","sourceRoot":"","sources":["../../src/plugins/responsiveValue.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,UAAU,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAU7C,MAAM,UAAU,eAAe,CAAI,KAA2B;IAC5D,OAAO,KAAU,CAAA;AACnB,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,YAA2B;IAE3B,OAAO,SAAS,eAAe,CAAC,KAAQ;QACtC,OAAO,uBAAuB,CAAI,KAAK,EAAE,YAAY,CAAC,CAAA;IACxD,CAAC,CAAA;AACH,CAAC;AAED,SAAS,uBAAuB,CAC9B,KAAQ,EACR,YAA2B;IAE3B,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,GAAyB,CAAA;QAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA;QAE7B,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,aAAa;YACb,KAAK,CAAC,QAAQ,CAAC,GAAG,uBAAuB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;QAChE,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,YAAY,EAAE,GAAG,WAAW,CAAC,GAAG,KAAK,CAAA;YAC5C,aAAa;YACb,KAAK,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAA;YAE9B,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;gBACjE,IAAI,WAAW,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,KAAK,SAAS,EAAE,CAAC;oBACpE,aAAa;oBACb,WAAW,CAAC,KAAK,EAAE;wBACjB,CAAC,KAAK,CAAC,EAAE;4BACP,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC;yBAC/B;qBACF,CAAC,CAAA;gBACJ,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type T_Style } from '../types';
2
+ export type PropertyPriority<T = T_Style> = {
3
+ [Property in keyof T]: number;
4
+ };
5
+ export default function sortPropertyPlugin<T extends Record<string, any> = T_Style>(propertyPriority: PropertyPriority<T>): (style: T) => T;
6
+ //# sourceMappingURL=sortProperty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortProperty.d.ts","sourceRoot":"","sources":["../../src/plugins/sortProperty.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,OAAO,IAAI;KACzC,QAAQ,IAAI,MAAM,CAAC,GAAG,MAAM;CAC9B,CAAA;AACD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,EACvC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,IAKR,OAAO,CAAC,KAAG,CAAC,CAmB1C"}
@@ -0,0 +1,24 @@
1
+ import isPlainObject from 'isobject';
2
+ export default function sortPropertyPlugin(propertyPriority) {
3
+ function getPriority(property) {
4
+ return propertyPriority[property] || 0;
5
+ }
6
+ return function sortProperty(style) {
7
+ return Object.keys(style)
8
+ .sort((a, b) => getPriority(a) - getPriority(b))
9
+ .reduce((out, property) => {
10
+ const value = style[property];
11
+ if (isPlainObject(value)) {
12
+ return {
13
+ ...out,
14
+ [property]: sortProperty(value),
15
+ };
16
+ }
17
+ return {
18
+ ...out,
19
+ [property]: value,
20
+ };
21
+ }, {});
22
+ };
23
+ }
24
+ //# sourceMappingURL=sortProperty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortProperty.js","sourceRoot":"","sources":["../../src/plugins/sortProperty.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,UAAU,CAAA;AAOpC,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAExC,gBAAqC;IACrC,SAAS,WAAW,CAAC,QAAmC;QACtD,OAAO,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;IAED,OAAO,SAAS,YAAY,CAAC,KAAQ;QACnC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;aACtB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;aAC/C,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;YACxB,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA;YAE7B,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO;oBACL,GAAG,GAAG;oBACN,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;iBAChC,CAAA;YACH,CAAC;YAED,OAAO;gBACL,GAAG,GAAG;gBACN,CAAC,QAAQ,CAAC,EAAE,KAAK;aAClB,CAAA;QACH,CAAC,EAAE,EAAO,CAAC,CAAA;IACf,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type T_RawStyle, type T_Style } from '../types';
2
+ type PropertyMap<T = T_RawStyle> = Partial<Record<keyof T, string>>;
3
+ export default function unitPlugin<T = T_Style>(defaultUnit?: string, propertyMap?: PropertyMap, isUnitlessProperty?: (property: string) => boolean): (style: T) => T;
4
+ export {};
5
+ //# sourceMappingURL=unit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unit.d.ts","sourceRoot":"","sources":["../../src/plugins/unit.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AAExD,KAAK,WAAW,CAAC,CAAC,GAAG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;AAEnE,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,GAAG,OAAO,EAC5C,WAAW,CAAC,EAAE,MAAM,EACpB,WAAW,CAAC,EAAE,WAAW,EACzB,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,IAE7B,OAAO,CAAC,OAG9B"}
@@ -0,0 +1,37 @@
1
+ import { isUnitlessProperty as defaultIsUnitlessProperty } from 'css-in-js-utils';
2
+ import isPlainObject from 'isobject';
3
+ export default function unitPlugin(defaultUnit, propertyMap, isUnitlessProperty) {
4
+ return function unit(style) {
5
+ return addUnit(style, defaultUnit, propertyMap, isUnitlessProperty);
6
+ };
7
+ }
8
+ function addUnit(style, defaultUnit = 'px', propertyMap = {}, isUnitlessProperty = defaultIsUnitlessProperty) {
9
+ for (const property in style) {
10
+ if (!isUnitlessProperty(property)) {
11
+ const cssValue = style[property];
12
+ const propertyUnit = propertyMap[property] || defaultUnit;
13
+ if (isPlainObject(cssValue)) {
14
+ // @ts-ignore
15
+ style[property] = addUnit(cssValue, defaultUnit, propertyMap, isUnitlessProperty);
16
+ }
17
+ else if (Array.isArray(cssValue)) {
18
+ // @ts-ignore
19
+ style[property] = cssValue.map((val) => addUnitIfNeeded(val, propertyUnit));
20
+ }
21
+ else {
22
+ style[property] = addUnitIfNeeded(cssValue, propertyUnit);
23
+ }
24
+ }
25
+ }
26
+ return style;
27
+ }
28
+ function addUnitIfNeeded(value, propertyUnit) {
29
+ const valueType = typeof value;
30
+ if ((valueType === 'number' ||
31
+ (valueType === 'string' && value == parseFloat(value))) &&
32
+ value != 0) {
33
+ return value + propertyUnit;
34
+ }
35
+ return value;
36
+ }
37
+ //# sourceMappingURL=unit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unit.js","sourceRoot":"","sources":["../../src/plugins/unit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AACjF,OAAO,aAAa,MAAM,UAAU,CAAA;AAMpC,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,WAAoB,EACpB,WAAyB,EACzB,kBAAkD;IAElD,OAAO,SAAS,IAAI,CAAC,KAAQ;QAC3B,OAAO,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAA;IACrE,CAAC,CAAA;AACH,CAAC;AAED,SAAS,OAAO,CACd,KAAQ,EACR,cAAsB,IAAI,EAC1B,cAA2B,EAAE,EAC7B,kBAAkB,GAAG,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/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2024.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.full.d.ts","../../../node_modules/.pnpm/@types+react@18.2.55/node_modules/@types/react/global.d.ts","../../../node_modules/.pnpm/csstype@3.2.3/node_modules/csstype/index.d.ts","../../../node_modules/.pnpm/@types+prop-types@15.7.15/node_modules/@types/prop-types/index.d.ts","../../../node_modules/.pnpm/@types+react@18.2.55/node_modules/@types/react/index.d.ts","../../../node_modules/.pnpm/@css-hooks+core@1.8.2/node_modules/@css-hooks/core/types/index.d.ts","../../../node_modules/.pnpm/@css-hooks+react@1.8.2_@types+react@18.2.55/node_modules/@css-hooks/react/types/index.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/assignstyle.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/camelcaseproperty.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/cssifydeclaration.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/cssifyobject.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/hyphenateproperty.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/isprefixedproperty.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/isprefixedvalue.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/isunitlessproperty.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/normalizeproperty.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/resolvearrayvalue.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/unprefixproperty.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/unprefixvalue.d.ts","../../../node_modules/.pnpm/css-in-js-utils@3.1.0/node_modules/css-in-js-utils/es/index.d.ts","../../../node_modules/.pnpm/isobject@4.0.0/node_modules/isobject/index.d.ts","../src/core/getfallbackvariable.ts","../src/types.ts","../src/core/fallbackvalueplugin.ts","../src/core/getfallbackcss.ts","../src/core/createrenderer.ts","../src/core/fallbackvalue.ts","../src/core/extend.ts","../src/plugins/responsivevalue.ts","../src/plugins/prefixer.ts","../src/plugins/debug.ts","../src/plugins/sortproperty.ts","../src/plugins/enforcelonghand.ts","../src/plugins/unit.ts","../src/helpers/usecssvariable.ts","../src/index.ts","../src/modules/css-in-js-utils.d.ts","../src/modules/styles-debugger.d.ts"],"fileIdsList":[[90,91],[87,88,89],[93,94,95,96,97,98,99,100,101,102,103,104],[91,92,108,109,110,122],[108],[106,107,108],[107,108,122],[90],[108,111,112,113,114,115,116,117,118,119,120],[108,123],[108,117],[106,108],[106,108,122]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"2ab096661c711e4a81cc464fa1e6feb929a54f5340b46b0a07ac6bbf857471f0","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"60037901da1a425516449b9a20073aa03386cce92f7a1fd902d7602be3a7c2e9","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"22adec94ef7047a6c9d1af3cb96be87a335908bf9ef386ae9fd50eeb37f44c47","affectsGlobalScope":true,"impliedFormat":1},{"version":"196cb558a13d4533a5163286f30b0509ce0210e4b316c56c38d4c0fd2fb38405","affectsGlobalScope":true,"impliedFormat":1},{"version":"73f78680d4c08509933daf80947902f6ff41b6230f94dd002ae372620adb0f60","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5239f5c01bcfa9cd32f37c496cf19c61d69d37e48be9de612b541aac915805b","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"bde31fd423cd93b0eff97197a3f66df7c93e8c0c335cbeb113b7ff1ac35c23f4","impliedFormat":1},{"version":"0bd5e7096c7bc02bf70b2cc017fc45ef489cb19bd2f32a71af39ff5787f1b56a","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"87d9d29dbc745f182683f63187bf3d53fd8673e5fca38ad5eaab69798ed29fbc","impliedFormat":1},{"version":"10226abba5bd3b4b72c261c1b7fcde317927a80283eb5026889b3a14a2dd958e","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e4d50c970f7986615f02d13123c5be25d80ab06353182c3a26bdbfa2672ed14","impliedFormat":99},{"version":"9891f35220afdf715edd11ad4f0eb44ca6d94c442d8a567b2a9bd290abb43998","impliedFormat":99},{"version":"9f658852d5c5e0de212eb8854d7f7d0df84ab6b777507e10f2d225edd1bd2e9b","impliedFormat":1},{"version":"1114bda5d5253a5cf96b4a276576ad1d1a87aa10f9b06abfdbf3e38f89fd5f1c","impliedFormat":1},{"version":"09984dc20dff652c460b4ec54feb622508fd1b126e43b975135db2a8d6ac9a44","impliedFormat":1},{"version":"97a16d086ae30e98360ce6c22d7bb5d32f24d27e67e27f3092f9c235f420bf68","impliedFormat":1},{"version":"c388b919e55d1ed6d8b4764d52ba7020a6a17f49bd9ccb2bd6e8ff09c4bb86a3","impliedFormat":1},{"version":"de7866bd352b2db6ff3f716eb6b139814f1b09873f23071f64f9996bd02b48a8","impliedFormat":1},{"version":"144901f08fb71a4e4041c176a5261c587a05b96bbd50b52502b11255f6000f2f","impliedFormat":1},{"version":"c2464a470bb6f3a05c3d4a8a150b2069c8fc4ed47ead8390477eb3fcb404796f","impliedFormat":1},{"version":"31b610d18c5c3576a648ac874335f6bb17c4fbb969ffa077ba3b5f573f41f176","impliedFormat":1},{"version":"3ff5a7764d453e9918ca6af22e3f6590fda86e0295940444d49fc6f31c899e71","impliedFormat":1},{"version":"7606b348226860a2523ea5068c4baf460405e8bd548842dd72820c6b70b2dabf","impliedFormat":1},{"version":"a8b5050d3f7a873d3c7f286482ca7c7e142b2c630af25889eb83e1a53588b8e3","impliedFormat":1},{"version":"73d28fc8400b0a12c4fd6cb129f9370d0cb16c129239df84811c962296b1ff45","impliedFormat":1},{"version":"b65c1a7e4cf317a02461ba3b2b5161141ca10288b89f822f7f7f3154277e0769","impliedFormat":1},{"version":"9830036f4ecae20d51e322a98ba45d4743fdf10b0ce3b33692cde971eae31d78","signature":"e782a8268b6ae23848c624cbc6f1deae05728388af6d7e55f2ebb53d49161496"},{"version":"43a85c8de1e5812c5683324a31a5cfc56a76221cf41a6d7a0dd7fe17bc570770","signature":"d6f04c1041876b52fdf402094ecf1b7a100ffb88769bea8280c63cf7106778e7"},{"version":"bea4c00934d6818071c061a49deff7b191770b70faffa52b51a7d3e175744a24","signature":"c88aacf4a452fe5f808fbff57646437c7e35c08c24a8439727c37a972c2a1310"},{"version":"14be1e3c480e136de140f30cf98ceebb4aa1b10b8fb15a55aee65e3c921b5ca0","signature":"6ceeb3d877da5f920f5fe62c9dbc9d448b6403e5ed6078b171143b32c8633651"},{"version":"3a34b33c2e747cf154a13edc4c1457844449abaf515df3c4180ba21098e7046e","signature":"625f281837a0d31b61b147e332fe98dd844da3ece53d045a7ba35bdf0333fb2f"},{"version":"95d304783ff940c2f4aadb61ecc4733d6a30f37d0b002569872df67238a0cb8e","signature":"fdfb12f8bec65fee47cf54b09ffe6a453e1d0f51896545578619ebcb83dafd46"},{"version":"35d7af7dc69d302bedfbb9c8e033b8d18c0d10140b32486cd9dd5e5193d1c5ac","signature":"5b6cef0800eed187112acef4fee48a5f7d8a78b6ead57cd3c982f1873dc30566"},{"version":"79ff217bf750be9132aff79e9012bd3ec3321d87a30ebe560bc05c52febbe556","signature":"20df5315485a98d51f86c860fbd2c6053c4a478aeb2d40d5811231fb76f124ff"},{"version":"ab89778d2a9a4f87ac2bcbf5f4d55bc2044add41fd88836622e4a2d33a8b4365","signature":"a261f1fa521b666bb9845467db450ab8bc4308b908bced5824c5af106a70e1c9"},{"version":"4d19d4d81d68869d3672f30cef86d0d416d58c53ad5956d67778434dcecadaf0","signature":"ed98b3f74a0202e6ea414bcea736fcadf789d9f135ac05eff7aee77c1892af6e"},{"version":"f8a6eea9259ed21d67d4edbe02a7fc6c50593fa700bdb1aa1aa1e487aac10564","signature":"71e2b29d13fc045c67f130658a100a743bbe595d0e13833aac4c72bffe685b75"},{"version":"aede8a4f72ab25e92048e25555675a95865537e8ef473d8999cadf7a8ff0a983","signature":"c9e1949a4fde6a69c935d99616a4966296314f6898d6fe38532a85c876aa142e"},{"version":"b0d4c1b09ebf81bb5b5fe6bfe173fbe2a108a51783e2729f9a710e42b00ddbdd","signature":"565892fe3486aac7ba0020de9ae9c888975986bdd9061b87fe6d8ca738861f6e"},{"version":"536571f5eb974c149b62f60c499a91f7a1d4134468c6b212fd67dd713675b8f1","signature":"d71e3466767c51b2a7cedd8e5994ce73fc758c52b5f0ccd81c6d8960d2ce9268"},{"version":"8b717a498f62af21e194b3ae1392268a6432bfca0cb3ad7d5b202ee7b014e73d","signature":"735093e15eb4edac377aa71a669a3eef86b2e92e9a1a10d7186031f7068119d5"},"970849802943644f01059c1afe0bc16a14381d3c22734b554de2bdc528a0cd24","178a763ee9d7b3ee8f1d3c49338dad3b27eb7341e6ccdb6efb7afc0a393f8e74"],"root":[[107,123]],"options":{"declaration":true,"declarationMap":true,"esModuleInterop":true,"jsx":1,"module":99,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"target":99},"referencedMap":[[92,1],[90,2],[105,3],[111,4],[113,5],[112,5],[109,6],[110,7],[120,8],[121,9],[116,10],[118,11],[115,12],[114,13],[117,12],[119,13],[108,8]],"version":"5.9.3"}
@@ -0,0 +1,13 @@
1
+ import { CSSProperties } from 'react';
2
+ export type T_Fallback = {
3
+ property: string | Array<string>;
4
+ values: Array<string>;
5
+ match?: string;
6
+ };
7
+ type T_VariableStyle = {
8
+ [key: `--${string}`]: any;
9
+ };
10
+ export type T_RawStyle = CSSProperties;
11
+ export type T_Style = T_RawStyle & T_VariableStyle;
12
+ export {};
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;IAChC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,CAAC,GAAG,EAAE,KAAK,MAAM,EAAE,GAAG,GAAG,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,aAAa,CAAA;AAEtC,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,eAAe,CAAA"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@weser/style",
3
+ "version": "1.0.0",
4
+ "description": "Utils for styling with CSS hooks",
5
+ "author": "Robin Weser <robin@weser.io>",
6
+ "license": "MIT",
7
+ "homepage": "https://github.com/robinweser/weserstack.git",
8
+ "repository": "https://github.com/robinweser/weserstack.git",
9
+ "type": "module",
10
+ "main": "dist/index.js",
11
+ "module": "dist/index.js",
12
+ "types": "dist/index.d.ts",
13
+ "sideEffects": false,
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "files": [
18
+ "LICENSE",
19
+ "README.md",
20
+ "dist/**"
21
+ ],
22
+ "browserslist": [
23
+ "IE >= 11",
24
+ "Firefox >= 60",
25
+ "Safari >= 11.1",
26
+ "Chrome >= 66",
27
+ "ChromeAndroid >= 66",
28
+ "iOS >= 11.3",
29
+ "Edge >= 15"
30
+ ],
31
+ "scripts": {
32
+ "setup": "pnpm build",
33
+ "clean": "rimraf dist",
34
+ "build": "tsc -b",
35
+ "dev": "pnpm build -w",
36
+ "test": "echo 1"
37
+ },
38
+ "keywords": [],
39
+ "dependencies": {
40
+ "css-in-js-utils": "^3.1.0",
41
+ "isobject": "^4.0.0"
42
+ },
43
+ "peerDependencies": {
44
+ "@css-hooks/core": "^1.0.0",
45
+ "@css-hooks/react": "^1.0.0"
46
+ },
47
+ "optionalDependencies": {
48
+ "styles-debugger": "^1.0.0"
49
+ },
50
+ "devDependencies": {
51
+ "@css-hooks/core": "1.8.2",
52
+ "@css-hooks/react": "1.8.2",
53
+ "@types/react": "18.2.55",
54
+ "ava": "^6.1.3",
55
+ "react": "^19.1.0",
56
+ "rimraf": "^3.0.2",
57
+ "styles-debugger": "^1.0.0",
58
+ "typescript": "^5.9.2"
59
+ },
60
+ "gitHead": "45f425a5a38595dcf1553593c97ea5ffc9fd0c25"
61
+ }