shelving 1.252.0 → 1.253.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/package.json
CHANGED
|
@@ -16,7 +16,7 @@ export interface DocumentationKindProps extends TagProps {
|
|
|
16
16
|
*
|
|
17
17
|
* @param kind The documented symbol's kind (e.g. `"function"`, `"class"`, `"method"`).
|
|
18
18
|
* @returns The matching `ColorVariant`, or `undefined` when the kind is unrecognised.
|
|
19
|
-
* @example getDocumentationKindColor("class") // "
|
|
19
|
+
* @example getDocumentationKindColor("class") // "pink"
|
|
20
20
|
* @see https://dhoulb.github.io/shelving/ui/docs/DocumentationKind/getDocumentationKindColor
|
|
21
21
|
*/
|
|
22
22
|
export declare function getDocumentationKindColor(kind: string): ColorVariant | undefined;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Tag } from "../misc/Tag.js";
|
|
3
3
|
/**
|
|
4
|
-
* Mapping from a documented symbol's `kind` to its
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
4
|
+
* Mapping from a documented symbol's `kind` to its colour variant.
|
|
5
|
+
* - Each mapped kind gets its own hue, except `method` and `static method`, which share `aqua`.
|
|
6
|
+
* - `property` is intentionally absent — it falls through to `undefined` and renders untinted.
|
|
7
|
+
* - The mapped kinds fit inside the eight raw hues plus `gray`; the brand aliases stay free for future kinds.
|
|
7
8
|
*/
|
|
8
9
|
const KIND_COLOR = {
|
|
9
10
|
module: "red",
|
|
10
11
|
component: "purple",
|
|
11
|
-
class: "
|
|
12
|
+
class: "pink",
|
|
12
13
|
function: "blue",
|
|
13
|
-
method: "
|
|
14
|
-
"static method": "
|
|
15
|
-
interface: "
|
|
16
|
-
type: "
|
|
17
|
-
constant: "
|
|
18
|
-
property: "
|
|
19
|
-
"static property": "yellow",
|
|
14
|
+
method: "aqua",
|
|
15
|
+
"static method": "aqua",
|
|
16
|
+
interface: "green",
|
|
17
|
+
type: "yellow",
|
|
18
|
+
constant: "orange",
|
|
19
|
+
"static property": "gray",
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Get the raw colour variant for a documented symbol's `kind`, or `undefined` for an unknown kind.
|
|
@@ -24,7 +24,7 @@ const KIND_COLOR = {
|
|
|
24
24
|
*
|
|
25
25
|
* @param kind The documented symbol's kind (e.g. `"function"`, `"class"`, `"method"`).
|
|
26
26
|
* @returns The matching `ColorVariant`, or `undefined` when the kind is unrecognised.
|
|
27
|
-
* @example getDocumentationKindColor("class") // "
|
|
27
|
+
* @example getDocumentationKindColor("class") // "pink"
|
|
28
28
|
* @see https://dhoulb.github.io/shelving/ui/docs/DocumentationKind/getDocumentationKindColor
|
|
29
29
|
*/
|
|
30
30
|
export function getDocumentationKindColor(kind) {
|
|
@@ -13,22 +13,22 @@ export interface DocumentationKindProps extends TagProps {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Mapping from a documented symbol's `kind` to its
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
16
|
+
* Mapping from a documented symbol's `kind` to its colour variant.
|
|
17
|
+
* - Each mapped kind gets its own hue, except `method` and `static method`, which share `aqua`.
|
|
18
|
+
* - `property` is intentionally absent — it falls through to `undefined` and renders untinted.
|
|
19
|
+
* - The mapped kinds fit inside the eight raw hues plus `gray`; the brand aliases stay free for future kinds.
|
|
19
20
|
*/
|
|
20
21
|
const KIND_COLOR: { readonly [K in string]?: ColorVariant } = {
|
|
21
22
|
module: "red",
|
|
22
23
|
component: "purple",
|
|
23
|
-
class: "
|
|
24
|
+
class: "pink",
|
|
24
25
|
function: "blue",
|
|
25
|
-
method: "
|
|
26
|
-
"static method": "
|
|
27
|
-
interface: "
|
|
28
|
-
type: "
|
|
29
|
-
constant: "
|
|
30
|
-
property: "
|
|
31
|
-
"static property": "yellow",
|
|
26
|
+
method: "aqua",
|
|
27
|
+
"static method": "aqua",
|
|
28
|
+
interface: "green",
|
|
29
|
+
type: "yellow",
|
|
30
|
+
constant: "orange",
|
|
31
|
+
"static property": "gray",
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -37,7 +37,7 @@ const KIND_COLOR: { readonly [K in string]?: ColorVariant } = {
|
|
|
37
37
|
*
|
|
38
38
|
* @param kind The documented symbol's kind (e.g. `"function"`, `"class"`, `"method"`).
|
|
39
39
|
* @returns The matching `ColorVariant`, or `undefined` when the kind is unrecognised.
|
|
40
|
-
* @example getDocumentationKindColor("class") // "
|
|
40
|
+
* @example getDocumentationKindColor("class") // "pink"
|
|
41
41
|
* @see https://dhoulb.github.io/shelving/ui/docs/DocumentationKind/getDocumentationKindColor
|
|
42
42
|
*/
|
|
43
43
|
export function getDocumentationKindColor(kind: string): ColorVariant | undefined {
|