@blueprintjs/icons 5.0.0-alpha.4 → 5.0.0-alpha.5
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/lib/cjs/generated/16px/blueprint-icons-16.d.ts +2 -2
- package/lib/cjs/generated/20px/blueprint-icons-20.d.ts +2 -2
- package/lib/cjs/iconLoader.d.ts +2 -2
- package/lib/cjs/iconLoader.js +3 -2
- package/lib/cjs/iconLoader.js.map +1 -1
- package/lib/cjs/type-utils/camel-case.d.ts +3 -3
- package/lib/cjs/type-utils/delimiter-case.d.ts +4 -4
- package/lib/cjs/type-utils/includes.d.ts +2 -2
- package/lib/cjs/type-utils/pascal-case.d.ts +1 -1
- package/lib/cjs/type-utils/screaming-snake-case.d.ts +2 -2
- package/lib/cjs/type-utils/snake-case.d.ts +1 -1
- package/lib/cjs/type-utils/sourceUtilities.d.ts +3 -3
- package/lib/cjs/type-utils/utilities.d.ts +1 -1
- package/lib/esm/generated/16px/blueprint-icons-16.d.ts +2 -2
- package/lib/esm/generated/20px/blueprint-icons-20.d.ts +2 -2
- package/lib/esm/iconLoader.d.ts +2 -2
- package/lib/esm/type-utils/camel-case.d.ts +3 -3
- package/lib/esm/type-utils/delimiter-case.d.ts +4 -4
- package/lib/esm/type-utils/includes.d.ts +2 -2
- package/lib/esm/type-utils/pascal-case.d.ts +1 -1
- package/lib/esm/type-utils/screaming-snake-case.d.ts +2 -2
- package/lib/esm/type-utils/snake-case.d.ts +1 -1
- package/lib/esm/type-utils/sourceUtilities.d.ts +3 -3
- package/lib/esm/type-utils/utilities.d.ts +1 -1
- package/lib/esnext/generated/16px/blueprint-icons-16.d.ts +2 -2
- package/lib/esnext/generated/20px/blueprint-icons-20.d.ts +2 -2
- package/lib/esnext/iconLoader.d.ts +2 -2
- package/lib/esnext/type-utils/camel-case.d.ts +3 -3
- package/lib/esnext/type-utils/delimiter-case.d.ts +4 -4
- package/lib/esnext/type-utils/includes.d.ts +2 -2
- package/lib/esnext/type-utils/pascal-case.d.ts +1 -1
- package/lib/esnext/type-utils/screaming-snake-case.d.ts +2 -2
- package/lib/esnext/type-utils/snake-case.d.ts +1 -1
- package/lib/esnext/type-utils/sourceUtilities.d.ts +3 -3
- package/lib/esnext/type-utils/utilities.d.ts +1 -1
- package/package.json +12 -6
|
@@ -4,7 +4,7 @@ Unlike a simpler split, this one includes the delimiter splitted on in the resul
|
|
|
4
4
|
|
|
5
5
|
@category Template Literals
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type SplitIncludingDelimiters<Source extends string, Delimiter extends string> = Source extends "" ? [] : Source extends `${infer FirstPart}${Delimiter}${infer SecondPart}` ? Source extends `${FirstPart}${infer UsedDelimiter}${SecondPart}` ? UsedDelimiter extends Delimiter ? Source extends `${infer FirstPart}${UsedDelimiter}${infer SecondPart}` ? [
|
|
8
8
|
...SplitIncludingDelimiters<FirstPart, Delimiter>,
|
|
9
9
|
UsedDelimiter,
|
|
10
10
|
...SplitIncludingDelimiters<SecondPart, Delimiter>
|
|
@@ -14,7 +14,7 @@ Format a specific part of the splitted string literal that `StringArrayToDelimit
|
|
|
14
14
|
|
|
15
15
|
@see StringArrayToDelimiterCase
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
type StringPartToDelimiterCase<StringPart extends string, UsedWordSeparators extends string, UsedUpperCaseCharacters extends string, Delimiter extends string> = StringPart extends UsedWordSeparators ? Delimiter : StringPart extends UsedUpperCaseCharacters ? `${Delimiter}${Lowercase<StringPart>}` : StringPart;
|
|
18
18
|
/**
|
|
19
19
|
Takes the result of a splitted string literal and recursively concatenates it together into the desired casing.
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ It receives `UsedWordSeparators` and `UsedUpperCaseCharacters` as input to ensur
|
|
|
22
22
|
|
|
23
23
|
@see SplitIncludingDelimiters
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
type StringArrayToDelimiterCase<Parts extends any[], UsedWordSeparators extends string, UsedUpperCaseCharacters extends string, Delimiter extends string> = Parts extends [`${infer FirstPart}`, ...infer RemainingParts] ? `${StringPartToDelimiterCase<FirstPart, UsedWordSeparators, UsedUpperCaseCharacters, Delimiter>}${StringArrayToDelimiterCase<RemainingParts, UsedWordSeparators, UsedUpperCaseCharacters, Delimiter>}` : "";
|
|
26
26
|
/**
|
|
27
27
|
Convert a string literal to a custom string delimiter casing.
|
|
28
28
|
|
|
@@ -60,5 +60,5 @@ const rawCliOptions: OddlyCasedProperties<SomeOptions> = {
|
|
|
60
60
|
|
|
61
61
|
@category Template Literals
|
|
62
62
|
*/
|
|
63
|
-
export
|
|
63
|
+
export type DelimiterCase<Value, Delimiter extends string> = Value extends string ? StringArrayToDelimiterCase<SplitIncludingDelimiters<Value, WordSeparators | UpperCaseCharacters>, WordSeparators, UpperCaseCharacters, Delimiter> : Value;
|
|
64
64
|
export {};
|
|
@@ -3,7 +3,7 @@ Returns a boolean for whether given two types are equal.
|
|
|
3
3
|
|
|
4
4
|
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
type IsEqual<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? true : false;
|
|
7
7
|
/**
|
|
8
8
|
Returns a boolean for whether the given array includes the given item.
|
|
9
9
|
|
|
@@ -18,5 +18,5 @@ type hasRed<array extends any[]> = Includes<array, 'red'>;
|
|
|
18
18
|
|
|
19
19
|
@category Utilities
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export type Includes<Value extends any[], Item> = IsEqual<Value[0], Item> extends true ? true : Value extends [Value[0], ...infer rest] ? Includes<rest, Item> : false;
|
|
22
22
|
export {};
|
|
@@ -31,4 +31,4 @@ const dbResult: CamelCasedProperties<ModelProps> = {
|
|
|
31
31
|
|
|
32
32
|
@category Template Literals
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type PascalCase<Value> = CamelCase<Value> extends string ? Capitalize<CamelCase<Value>> : CamelCase<Value>;
|
|
@@ -4,7 +4,7 @@ import { Includes } from "./includes";
|
|
|
4
4
|
/**
|
|
5
5
|
Returns a boolean for whether the string is screaming snake case.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
type IsScreamingSnakeCase<Value extends string> = Value extends Uppercase<Value> ? Includes<SplitIncludingDelimiters<Lowercase<Value>, "_">, "_"> extends true ? true : false : false;
|
|
8
8
|
/**
|
|
9
9
|
Convert a string literal to screaming-snake-case.
|
|
10
10
|
|
|
@@ -19,5 +19,5 @@ const someVariable: ScreamingSnakeCase<'fooBar'> = 'FOO_BAR';
|
|
|
19
19
|
|
|
20
20
|
@category Template Literals
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export type ScreamingSnakeCase<Value> = Value extends string ? IsScreamingSnakeCase<Value> extends true ? Value : Uppercase<SnakeCase<Value>> : Value;
|
|
23
23
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type UpperCaseCharacters = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z";
|
|
2
|
+
export type WordSeparators = "-" | "_" | " ";
|
|
3
|
+
export type StringDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
Recursively split a string literal into two parts on the first occurence of the given string, returning an array literal of all the separate parts.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type Split<S extends string, D extends string> = string extends S ? string[] : S extends "" ? [] : S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] : [S];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueprintjs/icons",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.5",
|
|
4
4
|
"description": "Components, fonts, icons, and css files for creating and displaying icons.",
|
|
5
5
|
"main": "lib/cjs/generated/index.js",
|
|
6
6
|
"module": "lib/esm/generated/index.js",
|
|
@@ -47,12 +47,18 @@
|
|
|
47
47
|
"tslib": "~2.5.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"react": "^16.
|
|
51
|
-
"react
|
|
50
|
+
"@types/react": "^16.14.32 || 17 || 18",
|
|
51
|
+
"react": "^16.8 || 17 || 18",
|
|
52
|
+
"react-dom": "^16.8 || 17 || 18"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"@types/react": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
52
58
|
},
|
|
53
59
|
"devDependencies": {
|
|
54
|
-
"@blueprintjs/node-build-scripts": "^8.0.0-alpha.
|
|
55
|
-
"@blueprintjs/test-commons": "^2.0.0-alpha.
|
|
60
|
+
"@blueprintjs/node-build-scripts": "^8.0.0-alpha.4",
|
|
61
|
+
"@blueprintjs/test-commons": "^2.0.0-alpha.4",
|
|
56
62
|
"@types/handlebars": "^4.1.0",
|
|
57
63
|
"enzyme": "^3.11.0",
|
|
58
64
|
"fantasticon": "^1.2.3",
|
|
@@ -63,7 +69,7 @@
|
|
|
63
69
|
"react-dom": "^16.14.0",
|
|
64
70
|
"react-test-renderer": "^16.14.0",
|
|
65
71
|
"svg-parser": "^2.0.4",
|
|
66
|
-
"typescript": "~4.
|
|
72
|
+
"typescript": "~4.9.5",
|
|
67
73
|
"webpack-cli": "^5.0.1"
|
|
68
74
|
},
|
|
69
75
|
"repository": {
|