@infcss/shared 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Jackie Wong
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/dist/index.cjs ADDED
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ function isFunction(value) {
4
+ return typeof value === "function";
5
+ }
6
+ function isRegExp(value) {
7
+ return value instanceof RegExp;
8
+ }
9
+ function isArray(value) {
10
+ return Array.isArray(value);
11
+ }
12
+ function isString(value) {
13
+ return typeof value === "string";
14
+ }
15
+
16
+ const defineInfCSSConfig = (config) => config;
17
+
18
+ exports.defineInfCSSConfig = defineInfCSSConfig;
19
+ exports.isArray = isArray;
20
+ exports.isFunction = isFunction;
21
+ exports.isRegExp = isRegExp;
22
+ exports.isString = isString;
@@ -0,0 +1,24 @@
1
+ type CSSValue = string | string[];
2
+ type ParsedResult = Record<string, CSSValue | Record<string, CSSValue>>;
3
+ type Rule = [RegExp, (args: string[]) => ParsedResult];
4
+ type VariantItem = (s: string) => string;
5
+ type Variant = {
6
+ match: VariantItem;
7
+ selector?: VariantItem;
8
+ rewrite?: VariantItem;
9
+ wrapper?: VariantItem;
10
+ };
11
+ type InfCSSConfig = {
12
+ rules?: Rule[];
13
+ variants?: Variant[];
14
+ };
15
+
16
+ declare function isFunction(value: unknown): value is () => unknown;
17
+ declare function isRegExp(value: unknown): value is RegExp;
18
+ declare function isArray(value: unknown): value is unknown[];
19
+ declare function isString(value: unknown): value is string;
20
+
21
+ declare const defineInfCSSConfig: <T extends InfCSSConfig>(config: T) => T;
22
+
23
+ export { defineInfCSSConfig, isArray, isFunction, isRegExp, isString };
24
+ export type { CSSValue, InfCSSConfig, ParsedResult, Rule, Variant, VariantItem };
@@ -0,0 +1,24 @@
1
+ type CSSValue = string | string[];
2
+ type ParsedResult = Record<string, CSSValue | Record<string, CSSValue>>;
3
+ type Rule = [RegExp, (args: string[]) => ParsedResult];
4
+ type VariantItem = (s: string) => string;
5
+ type Variant = {
6
+ match: VariantItem;
7
+ selector?: VariantItem;
8
+ rewrite?: VariantItem;
9
+ wrapper?: VariantItem;
10
+ };
11
+ type InfCSSConfig = {
12
+ rules?: Rule[];
13
+ variants?: Variant[];
14
+ };
15
+
16
+ declare function isFunction(value: unknown): value is () => unknown;
17
+ declare function isRegExp(value: unknown): value is RegExp;
18
+ declare function isArray(value: unknown): value is unknown[];
19
+ declare function isString(value: unknown): value is string;
20
+
21
+ declare const defineInfCSSConfig: <T extends InfCSSConfig>(config: T) => T;
22
+
23
+ export { defineInfCSSConfig, isArray, isFunction, isRegExp, isString };
24
+ export type { CSSValue, InfCSSConfig, ParsedResult, Rule, Variant, VariantItem };
@@ -0,0 +1,24 @@
1
+ type CSSValue = string | string[];
2
+ type ParsedResult = Record<string, CSSValue | Record<string, CSSValue>>;
3
+ type Rule = [RegExp, (args: string[]) => ParsedResult];
4
+ type VariantItem = (s: string) => string;
5
+ type Variant = {
6
+ match: VariantItem;
7
+ selector?: VariantItem;
8
+ rewrite?: VariantItem;
9
+ wrapper?: VariantItem;
10
+ };
11
+ type InfCSSConfig = {
12
+ rules?: Rule[];
13
+ variants?: Variant[];
14
+ };
15
+
16
+ declare function isFunction(value: unknown): value is () => unknown;
17
+ declare function isRegExp(value: unknown): value is RegExp;
18
+ declare function isArray(value: unknown): value is unknown[];
19
+ declare function isString(value: unknown): value is string;
20
+
21
+ declare const defineInfCSSConfig: <T extends InfCSSConfig>(config: T) => T;
22
+
23
+ export { defineInfCSSConfig, isArray, isFunction, isRegExp, isString };
24
+ export type { CSSValue, InfCSSConfig, ParsedResult, Rule, Variant, VariantItem };
package/dist/index.mjs ADDED
@@ -0,0 +1,16 @@
1
+ function isFunction(value) {
2
+ return typeof value === "function";
3
+ }
4
+ function isRegExp(value) {
5
+ return value instanceof RegExp;
6
+ }
7
+ function isArray(value) {
8
+ return Array.isArray(value);
9
+ }
10
+ function isString(value) {
11
+ return typeof value === "string";
12
+ }
13
+
14
+ const defineInfCSSConfig = (config) => config;
15
+
16
+ export { defineInfCSSConfig, isArray, isFunction, isRegExp, isString };
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@infcss/shared",
3
+ "type": "module",
4
+ "version": "0.0.1",
5
+ "description": "Atom css framework",
6
+ "main": "src/index.ts",
7
+ "module": "src/index.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./src/index.ts",
11
+ "require": "./dist/index.cjs"
12
+ }
13
+ },
14
+ "files": [
15
+ "index.js",
16
+ "dist"
17
+ ],
18
+ "devDependencies": {
19
+ "unbuild": "^3.6.1"
20
+ },
21
+ "scripts": {
22
+ "build": "unbuild"
23
+ }
24
+ }
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './type.ts'
2
+ export * from './utils.ts'
3
+ export * from './config.ts'