@baseline-ui/css 0.0.0-nightly-20250121000655
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/Acknowledgements.md +49604 -0
- package/dist/index.d.mts +64 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +18 -0
- package/dist/index.mjs +15 -0
- package/package.json +29 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Sprinkles } from '@baseline-ui/tokens';
|
|
2
|
+
import { StyleRule } from '@vanilla-extract/css';
|
|
3
|
+
|
|
4
|
+
declare type _StyleRule = StyleRule | ReturnType<typeof recipeSprinkles>;
|
|
5
|
+
declare type ClassNames = string | ClassNames[];
|
|
6
|
+
declare type _ComplexStyleRule = _StyleRule | (_StyleRule | ClassNames)[];
|
|
7
|
+
declare type _RecipeStyleRule = _ComplexStyleRule | string;
|
|
8
|
+
declare type VariantDefinitions = Record<string, _RecipeStyleRule>;
|
|
9
|
+
declare type VariantGroups = Record<string, VariantDefinitions>;
|
|
10
|
+
declare type BooleanMap<T> = T extends "true" | "false" ? boolean : T;
|
|
11
|
+
declare type VariantSelection<Variants extends VariantGroups> = {
|
|
12
|
+
[VariantGroup in keyof Variants]?: BooleanMap<keyof Variants[VariantGroup]>;
|
|
13
|
+
};
|
|
14
|
+
interface CompoundVariant<Variants extends VariantGroups> {
|
|
15
|
+
variants: VariantSelection<Variants>;
|
|
16
|
+
style: _RecipeStyleRule;
|
|
17
|
+
}
|
|
18
|
+
interface PatternOptions<Variants extends VariantGroups> {
|
|
19
|
+
base?: _RecipeStyleRule;
|
|
20
|
+
variants?: Variants;
|
|
21
|
+
defaultVariants?: VariantSelection<Variants>;
|
|
22
|
+
compoundVariants?: CompoundVariant<Variants>[];
|
|
23
|
+
}
|
|
24
|
+
declare type VariantsClassNames<Variants extends VariantGroups> = {
|
|
25
|
+
[P in keyof Variants]: {
|
|
26
|
+
[PP in keyof Variants[P]]: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
interface RecipeClassNames<Variants extends VariantGroups> {
|
|
30
|
+
base: string;
|
|
31
|
+
variants: VariantsClassNames<Variants>;
|
|
32
|
+
}
|
|
33
|
+
declare type RuntimeFn<Variants extends VariantGroups> = ((options?: VariantSelection<Variants>) => string) & {
|
|
34
|
+
variants: () => (keyof Variants)[];
|
|
35
|
+
classNames: RecipeClassNames<Variants>;
|
|
36
|
+
};
|
|
37
|
+
declare type CleanedVariants<Variants extends VariantGroups> = {
|
|
38
|
+
[P in keyof Variants]: {
|
|
39
|
+
[PP in keyof Variants[P]]: PP extends keyof ReturnType<typeof recipeSprinkles> ? never : Variants[P][PP];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Function to generate component sprinkles. This is used to generate the
|
|
45
|
+
* sprinkles for the base, variants, and compound variants which are self-aware
|
|
46
|
+
* of their layer. This is useful for when you want to override the base
|
|
47
|
+
* sprinkles with a variant or compound variant in a more predictable way.
|
|
48
|
+
*/
|
|
49
|
+
declare function recipeSprinkles(options: Parameters<Sprinkles["base"]>[0]): {
|
|
50
|
+
"__@@Component_Sprinkles__": boolean;
|
|
51
|
+
baseSprinkles: string;
|
|
52
|
+
variantSprinkles: string;
|
|
53
|
+
compoundVariantSprinkles: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Function to generate a layered recipe.
|
|
57
|
+
*
|
|
58
|
+
* @param {object} params - The parameters for the recipe.
|
|
59
|
+
* @param {string | undefined} debugId - The debug ID.
|
|
60
|
+
* @returns {object} The generated recipe.
|
|
61
|
+
*/
|
|
62
|
+
declare function layeredRecipe<Variants extends VariantGroups>(params: PatternOptions<Variants>, debugId?: string): RuntimeFn<CleanedVariants<Variants>>;
|
|
63
|
+
|
|
64
|
+
export { type RecipeClassNames, layeredRecipe, recipeSprinkles };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Sprinkles } from '@baseline-ui/tokens';
|
|
2
|
+
import { StyleRule } from '@vanilla-extract/css';
|
|
3
|
+
|
|
4
|
+
declare type _StyleRule = StyleRule | ReturnType<typeof recipeSprinkles>;
|
|
5
|
+
declare type ClassNames = string | ClassNames[];
|
|
6
|
+
declare type _ComplexStyleRule = _StyleRule | (_StyleRule | ClassNames)[];
|
|
7
|
+
declare type _RecipeStyleRule = _ComplexStyleRule | string;
|
|
8
|
+
declare type VariantDefinitions = Record<string, _RecipeStyleRule>;
|
|
9
|
+
declare type VariantGroups = Record<string, VariantDefinitions>;
|
|
10
|
+
declare type BooleanMap<T> = T extends "true" | "false" ? boolean : T;
|
|
11
|
+
declare type VariantSelection<Variants extends VariantGroups> = {
|
|
12
|
+
[VariantGroup in keyof Variants]?: BooleanMap<keyof Variants[VariantGroup]>;
|
|
13
|
+
};
|
|
14
|
+
interface CompoundVariant<Variants extends VariantGroups> {
|
|
15
|
+
variants: VariantSelection<Variants>;
|
|
16
|
+
style: _RecipeStyleRule;
|
|
17
|
+
}
|
|
18
|
+
interface PatternOptions<Variants extends VariantGroups> {
|
|
19
|
+
base?: _RecipeStyleRule;
|
|
20
|
+
variants?: Variants;
|
|
21
|
+
defaultVariants?: VariantSelection<Variants>;
|
|
22
|
+
compoundVariants?: CompoundVariant<Variants>[];
|
|
23
|
+
}
|
|
24
|
+
declare type VariantsClassNames<Variants extends VariantGroups> = {
|
|
25
|
+
[P in keyof Variants]: {
|
|
26
|
+
[PP in keyof Variants[P]]: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
interface RecipeClassNames<Variants extends VariantGroups> {
|
|
30
|
+
base: string;
|
|
31
|
+
variants: VariantsClassNames<Variants>;
|
|
32
|
+
}
|
|
33
|
+
declare type RuntimeFn<Variants extends VariantGroups> = ((options?: VariantSelection<Variants>) => string) & {
|
|
34
|
+
variants: () => (keyof Variants)[];
|
|
35
|
+
classNames: RecipeClassNames<Variants>;
|
|
36
|
+
};
|
|
37
|
+
declare type CleanedVariants<Variants extends VariantGroups> = {
|
|
38
|
+
[P in keyof Variants]: {
|
|
39
|
+
[PP in keyof Variants[P]]: PP extends keyof ReturnType<typeof recipeSprinkles> ? never : Variants[P][PP];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Function to generate component sprinkles. This is used to generate the
|
|
45
|
+
* sprinkles for the base, variants, and compound variants which are self-aware
|
|
46
|
+
* of their layer. This is useful for when you want to override the base
|
|
47
|
+
* sprinkles with a variant or compound variant in a more predictable way.
|
|
48
|
+
*/
|
|
49
|
+
declare function recipeSprinkles(options: Parameters<Sprinkles["base"]>[0]): {
|
|
50
|
+
"__@@Component_Sprinkles__": boolean;
|
|
51
|
+
baseSprinkles: string;
|
|
52
|
+
variantSprinkles: string;
|
|
53
|
+
compoundVariantSprinkles: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Function to generate a layered recipe.
|
|
57
|
+
*
|
|
58
|
+
* @param {object} params - The parameters for the recipe.
|
|
59
|
+
* @param {string | undefined} debugId - The debug ID.
|
|
60
|
+
* @returns {object} The generated recipe.
|
|
61
|
+
*/
|
|
62
|
+
declare function layeredRecipe<Variants extends VariantGroups>(params: PatternOptions<Variants>, debugId?: string): RuntimeFn<CleanedVariants<Variants>>;
|
|
63
|
+
|
|
64
|
+
export { type RecipeClassNames, layeredRecipe, recipeSprinkles };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tokens = require('@baseline-ui/tokens');
|
|
4
|
+
var recipes = require('@vanilla-extract/recipes');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
8
|
+
*
|
|
9
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
10
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
11
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
12
|
+
* This notice may not be removed from this file.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
var{base:f,variants:V,compoundVariants:S}=tokens.sprinkles,o="__@@Component_Sprinkles__";function k(e){return {[o]:!0,baseSprinkles:f(e),variantSprinkles:V(e),compoundVariantSprinkles:S(e)}}function d(e){switch(e){case"base":return tokens.Layers.BASE;case"variant":return tokens.Layers.VARIANTS;case"compoundVariant":return tokens.Layers.COMPOUND_VARIANTS}}function n(e,a){return e&&(Array.isArray(e)?e.map(r=>typeof r=="object"?n(r,a):r):typeof e=="object"?o in e?e[`${a}Sprinkles`]:e["@layer"]?e:{"@layer":{[d(a)]:e}}:e)}function l(e){return e&&Object.fromEntries(Object.entries(e).map(([a,r])=>[a,Object.fromEntries(Object.entries(r).map(([t,i])=>[t,n(i,"variant")]))]))}function N(e,a){let{base:r,variants:t,compoundVariants:i,defaultVariants:c}=e;return recipes.recipe({base:n(r,"base"),compoundVariants:i?.map(p=>({...p,style:n(p.style,"compoundVariant")})),variants:l(t),defaultVariants:c},a)}
|
|
16
|
+
|
|
17
|
+
exports.layeredRecipe = N;
|
|
18
|
+
exports.recipeSprinkles = k;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { sprinkles, Layers } from '@baseline-ui/tokens';
|
|
2
|
+
import { recipe } from '@vanilla-extract/recipes';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
8
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
9
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
10
|
+
* This notice may not be removed from this file.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
var{base:f,variants:V,compoundVariants:S}=sprinkles,o="__@@Component_Sprinkles__";function k(e){return {[o]:!0,baseSprinkles:f(e),variantSprinkles:V(e),compoundVariantSprinkles:S(e)}}function d(e){switch(e){case"base":return Layers.BASE;case"variant":return Layers.VARIANTS;case"compoundVariant":return Layers.COMPOUND_VARIANTS}}function n(e,a){return e&&(Array.isArray(e)?e.map(r=>typeof r=="object"?n(r,a):r):typeof e=="object"?o in e?e[`${a}Sprinkles`]:e["@layer"]?e:{"@layer":{[d(a)]:e}}:e)}function l(e){return e&&Object.fromEntries(Object.entries(e).map(([a,r])=>[a,Object.fromEntries(Object.entries(r).map(([t,i])=>[t,n(i,"variant")]))]))}function N(e,a){let{base:r,variants:t,compoundVariants:i,defaultVariants:c}=e;return recipe({base:n(r,"base"),compoundVariants:i?.map(p=>({...p,style:n(p.style,"compoundVariant")})),variants:l(t),defaultVariants:c},a)}
|
|
14
|
+
|
|
15
|
+
export { N as layeredRecipe, k as recipeSprinkles };
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@baseline-ui/css",
|
|
3
|
+
"version": "0.0.0-nightly-20250121000655",
|
|
4
|
+
"description": "The styling library for Baseline UI",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"style": "dist/index.css",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"License.md",
|
|
12
|
+
"Acknowledgements.md"
|
|
13
|
+
],
|
|
14
|
+
"source": "./src/index.ts",
|
|
15
|
+
"author": "",
|
|
16
|
+
"license": "SEE LICENSE IN https://pspdfkit.com/legal/License.pdf",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@vanilla-extract/recipes": "0.5.3",
|
|
19
|
+
"@vanilla-extract/css": "^1.15.3",
|
|
20
|
+
"@baseline-ui/tokens": "0.0.0-nightly-20250121000655"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup src/index.ts --minify --format cjs,esm --dts --treeshake",
|
|
27
|
+
"acknowledgements": "pnpm-licenses generate-disclaimer --prod --output-file=Acknowledgements.md"
|
|
28
|
+
}
|
|
29
|
+
}
|