yummies 4.6.0 → 4.7.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.
- package/complex/counter.d.ts +3 -1
- package/complex/counter.d.ts.map +1 -1
- package/complex/counter.js +10 -10
- package/css.d.ts +21 -3
- package/css.d.ts.map +1 -1
- package/package.json +1 -1
package/complex/counter.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface CounterFn<TProcessedValue = number> {
|
|
2
2
|
(): TProcessedValue;
|
|
3
|
+
counter: number;
|
|
4
|
+
value: TProcessedValue;
|
|
3
5
|
reset(): void;
|
|
4
6
|
}
|
|
5
|
-
export declare const createCounter: <TProcessedValue = number>(processValue?: (value: number) => TProcessedValue) => CounterFn<TProcessedValue>;
|
|
7
|
+
export declare const createCounter: <TProcessedValue = number>(processValue?: (value: number) => TProcessedValue, initial?: number) => CounterFn<TProcessedValue>;
|
|
6
8
|
//# sourceMappingURL=counter.d.ts.map
|
package/complex/counter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../src/complex/counter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS,CAAC,eAAe,GAAG,MAAM;IACjD,IAAI,eAAe,CAAC;IACpB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,eAAO,MAAM,aAAa,GAAI,eAAe,GAAG,MAAM,EACpD,eAAe,CAAC,KAAK,EAAE,MAAM,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../src/complex/counter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS,CAAC,eAAe,GAAG,MAAM;IACjD,IAAI,eAAe,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,eAAO,MAAM,aAAa,GAAI,eAAe,GAAG,MAAM,EACpD,eAAe,CAAC,KAAK,EAAE,MAAM,KAAK,eAAe,EACjD,UAAS,MAAU,KAClB,SAAS,CAAC,eAAe,CAgB3B,CAAC"}
|
package/complex/counter.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export const createCounter = (processValue) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
incrementFn = () => counter++;
|
|
9
|
-
}
|
|
1
|
+
export const createCounter = (processValue, initial = 0) => {
|
|
2
|
+
const incrementFn = (() => {
|
|
3
|
+
const nextCounter = incrementFn.counter++;
|
|
4
|
+
incrementFn.value =
|
|
5
|
+
processValue?.(nextCounter) ?? nextCounter;
|
|
6
|
+
return incrementFn.value;
|
|
7
|
+
});
|
|
10
8
|
incrementFn.reset = () => {
|
|
11
|
-
counter =
|
|
9
|
+
incrementFn.counter = initial;
|
|
10
|
+
incrementFn.value = processValue?.(initial) ?? initial;
|
|
12
11
|
};
|
|
12
|
+
incrementFn.reset();
|
|
13
13
|
return incrementFn;
|
|
14
14
|
};
|
package/css.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import clsx, { ClassValue } from 'clsx';
|
|
2
|
+
type ClassProp = {
|
|
3
|
+
class?: ClassValue;
|
|
4
|
+
className?: ClassValue;
|
|
5
|
+
};
|
|
6
|
+
type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T;
|
|
3
7
|
/**
|
|
4
8
|
* Перевод значения в пикселях в rem строковое
|
|
5
9
|
*/
|
|
@@ -8,11 +12,25 @@ export declare const toRem: (px: number, remValue?: number) => string;
|
|
|
8
12
|
* classNames/clsx но с примесями tailwind-merge
|
|
9
13
|
*/
|
|
10
14
|
export declare const cx: (...args: Parameters<typeof clsx>) => string;
|
|
15
|
+
type ConfigSchema = Record<string, Record<string, ClassValue>>;
|
|
16
|
+
type ConfigVariants<T extends ConfigSchema> = {
|
|
17
|
+
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined;
|
|
18
|
+
};
|
|
19
|
+
type ConfigVariantsMulti<T extends ConfigSchema> = {
|
|
20
|
+
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | StringToBoolean<keyof T[Variant]>[] | undefined;
|
|
21
|
+
};
|
|
22
|
+
type Config<T> = T extends ConfigSchema ? {
|
|
23
|
+
variants?: T;
|
|
24
|
+
defaultVariants?: ConfigVariants<T>;
|
|
25
|
+
compoundVariants?: (T extends ConfigSchema ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp : ClassProp)[];
|
|
26
|
+
} : never;
|
|
27
|
+
type Props<T> = T extends ConfigSchema ? ConfigVariants<T> & ClassProp : ClassProp;
|
|
11
28
|
/**
|
|
12
29
|
* Class Variance Authority но с примесями tailwind-merge
|
|
13
30
|
*
|
|
14
31
|
* https://cva.style/docs
|
|
15
32
|
*/
|
|
16
|
-
export declare const cva:
|
|
33
|
+
export declare const cva: <T>(base?: ClassValue, config?: Config<T>) => (props?: Props<T>) => string;
|
|
17
34
|
export type { VariantProps } from 'class-variance-authority';
|
|
35
|
+
export type { ClassValue } from 'clsx';
|
|
18
36
|
//# sourceMappingURL=css.d.ts.map
|
package/css.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGxC,KAAK,SAAS,GAAG;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,KAAK,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,CA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