@sharadox/graphical-user-interface-web-library 0.0.0-stage → 0.1.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/LICENCA.md +76 -0
- package/LICENSE.md +76 -0
- package/NOTICE.md +3 -0
- package/README.md +151 -2
- package/distribution/box/index.d.ts +14 -0
- package/distribution/box/index.d.ts.map +1 -0
- package/distribution/box/index.js +49 -0
- package/distribution/box/index.js.map +1 -0
- package/distribution/box/index.module.css +1 -0
- package/distribution/box/index.module.scss +102 -0
- package/distribution/box/type.d.ts +51 -0
- package/distribution/box/type.d.ts.map +1 -0
- package/distribution/box/type.js +2 -0
- package/distribution/box/type.js.map +1 -0
- package/distribution/box-axis/index.d.ts +24 -0
- package/distribution/box-axis/index.d.ts.map +1 -0
- package/distribution/box-axis/index.js +114 -0
- package/distribution/box-axis/index.js.map +1 -0
- package/distribution/box-axis/type.d.ts +15 -0
- package/distribution/box-axis/type.d.ts.map +1 -0
- package/distribution/box-axis/type.js +2 -0
- package/distribution/box-axis/type.js.map +1 -0
- package/distribution/button/index.d.ts +15 -0
- package/distribution/button/index.d.ts.map +1 -0
- package/distribution/button/index.js +42 -0
- package/distribution/button/index.js.map +1 -0
- package/distribution/button/type.d.ts +37 -0
- package/distribution/button/type.d.ts.map +1 -0
- package/distribution/button/type.js +2 -0
- package/distribution/button/type.js.map +1 -0
- package/distribution/button-axis/index.d.ts +13 -0
- package/distribution/button-axis/index.d.ts.map +1 -0
- package/distribution/button-axis/index.js +13 -0
- package/distribution/button-axis/index.js.map +1 -0
- package/distribution/choice/index.d.ts +11 -0
- package/distribution/choice/index.d.ts.map +1 -0
- package/distribution/choice/index.js +35 -0
- package/distribution/choice/index.js.map +1 -0
- package/distribution/choice/type.d.ts +19 -0
- package/distribution/choice/type.d.ts.map +1 -0
- package/distribution/choice/type.js +2 -0
- package/distribution/choice/type.js.map +1 -0
- package/distribution/interface-configuration/index.d.ts +23 -0
- package/distribution/interface-configuration/index.d.ts.map +1 -0
- package/distribution/interface-configuration/index.js +160 -0
- package/distribution/interface-configuration/index.js.map +1 -0
- package/distribution/interface-configuration/type.d.ts +83 -0
- package/distribution/interface-configuration/type.d.ts.map +1 -0
- package/distribution/interface-configuration/type.js +2 -0
- package/distribution/interface-configuration/type.js.map +1 -0
- package/distribution/interface-style/index.d.ts +11 -0
- package/distribution/interface-style/index.d.ts.map +1 -0
- package/distribution/interface-style/index.js +14 -0
- package/distribution/interface-style/index.js.map +1 -0
- package/distribution/interface-style/type.d.ts +6 -0
- package/distribution/interface-style/type.d.ts.map +1 -0
- package/distribution/interface-style/type.js +2 -0
- package/distribution/interface-style/type.js.map +1 -0
- package/distribution/interface-styles/index.d.ts +13 -0
- package/distribution/interface-styles/index.d.ts.map +1 -0
- package/distribution/interface-styles/index.js +37 -0
- package/distribution/interface-styles/index.js.map +1 -0
- package/distribution/responsive/index.d.ts +10 -0
- package/distribution/responsive/index.d.ts.map +1 -0
- package/distribution/responsive/index.js +23 -0
- package/distribution/responsive/index.js.map +1 -0
- package/distribution/responsive/type.d.ts +12 -0
- package/distribution/responsive/type.d.ts.map +1 -0
- package/distribution/responsive/type.js +2 -0
- package/distribution/responsive/type.js.map +1 -0
- package/distribution/spinner/index.d.ts +11 -0
- package/distribution/spinner/index.d.ts.map +1 -0
- package/distribution/spinner/index.js +16 -0
- package/distribution/spinner/index.js.map +1 -0
- package/distribution/spinner/index.module.css +1 -0
- package/distribution/spinner/index.module.scss +41 -0
- package/distribution/spinner/type.d.ts +4 -0
- package/distribution/spinner/type.d.ts.map +1 -0
- package/distribution/spinner/type.js +2 -0
- package/distribution/spinner/type.js.map +1 -0
- package/distribution/style-sheet/index.d.ts +18 -0
- package/distribution/style-sheet/index.d.ts.map +1 -0
- package/distribution/style-sheet/index.js +166 -0
- package/distribution/style-sheet/index.js.map +1 -0
- package/distribution/style-switch/index.d.ts +10 -0
- package/distribution/style-switch/index.d.ts.map +1 -0
- package/distribution/style-switch/index.js +16 -0
- package/distribution/style-switch/index.js.map +1 -0
- package/distribution/style-switch/type.d.ts +15 -0
- package/distribution/style-switch/type.d.ts.map +1 -0
- package/distribution/style-switch/type.js +2 -0
- package/distribution/style-switch/type.js.map +1 -0
- package/package.json +102 -4
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/** Where every box value starts: a plain, centered flex box with nothing around it. */
|
|
2
|
+
export const BOX_INITIAL_VALUES = {
|
|
3
|
+
"box-display": "flex",
|
|
4
|
+
"box-direction": "row",
|
|
5
|
+
"box-justify": "center",
|
|
6
|
+
"box-align": "center",
|
|
7
|
+
"box-text-align": "center",
|
|
8
|
+
"box-wrap": "nowrap",
|
|
9
|
+
"box-gap": "0px",
|
|
10
|
+
"box-padding": "0px",
|
|
11
|
+
"box-minimum-size": "0px",
|
|
12
|
+
"box-section-padding": "0px",
|
|
13
|
+
"box-border-thickness": "0px",
|
|
14
|
+
"box-border-color": "transparent",
|
|
15
|
+
"box-background": "transparent",
|
|
16
|
+
"box-text-color": "currentcolor",
|
|
17
|
+
"box-backdrop": "none",
|
|
18
|
+
};
|
|
19
|
+
/** What every variant sets, so one variant replaces another whole, at any breakpoint. */
|
|
20
|
+
const SIZED = {
|
|
21
|
+
"box-display": "flex",
|
|
22
|
+
"box-section-padding": "var(--current-section-padding)",
|
|
23
|
+
"box-minimum-size": "var(--current-minimum-size)",
|
|
24
|
+
"box-border-thickness": "var(--line-thickness)",
|
|
25
|
+
};
|
|
26
|
+
const GLASS = "blur(var(--glass-blur))";
|
|
27
|
+
/** Outlined and transparent: the color's transparent background while hovered and pressed; middleground's text turns. */
|
|
28
|
+
const tinted = (border) => ({
|
|
29
|
+
rest: {
|
|
30
|
+
...SIZED,
|
|
31
|
+
"box-background": "transparent",
|
|
32
|
+
"box-text-color": "var(--current-color)",
|
|
33
|
+
"box-border-color": border,
|
|
34
|
+
"box-backdrop": GLASS,
|
|
35
|
+
},
|
|
36
|
+
hover: { "box-background": "var(--current-transparent-hover-color)", "box-text-color": "var(--current-hover-color)" },
|
|
37
|
+
active: {
|
|
38
|
+
"box-background": "var(--current-transparent-active-color)",
|
|
39
|
+
"box-text-color": "var(--current-hover-color)",
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
/** The variants: filled, outlined, transparent and inline (a box that sits in running text, like a link). */
|
|
43
|
+
export const VARIANT_AXIS = {
|
|
44
|
+
attribute: "data-variant",
|
|
45
|
+
values: {
|
|
46
|
+
filled: {
|
|
47
|
+
rest: {
|
|
48
|
+
...SIZED,
|
|
49
|
+
"box-background": "var(--current-color-paint)",
|
|
50
|
+
"box-text-color": "var(--current-on-color)",
|
|
51
|
+
"box-border-color": "transparent",
|
|
52
|
+
"box-backdrop": "none",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
outlined: tinted("var(--current-border-color)"),
|
|
56
|
+
transparent: tinted("transparent"),
|
|
57
|
+
inline: {
|
|
58
|
+
rest: {
|
|
59
|
+
"box-display": "inline-flex",
|
|
60
|
+
"box-section-padding": "0px",
|
|
61
|
+
"box-minimum-size": "0px",
|
|
62
|
+
"box-border-thickness": "0px",
|
|
63
|
+
"box-background": "transparent",
|
|
64
|
+
"box-text-color": "var(--current-color)",
|
|
65
|
+
"box-border-color": "transparent",
|
|
66
|
+
"box-backdrop": "none",
|
|
67
|
+
},
|
|
68
|
+
hover: { "box-text-color": "var(--current-hover-color)" },
|
|
69
|
+
active: { "box-text-color": "var(--current-hover-color)" },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
const simple = (attribute, property, values) => ({
|
|
74
|
+
attribute,
|
|
75
|
+
values: Object.fromEntries(Object.entries(values).map(([name, value]) => [name, { rest: { [property]: value } }])),
|
|
76
|
+
});
|
|
77
|
+
const same = (...names) => Object.fromEntries(names.map((name) => [name, name]));
|
|
78
|
+
/** The direction sections and children follow; left to right follows the reading direction (it flips in Arabic). */
|
|
79
|
+
export const DIRECTION_AXIS = simple("data-direction", "box-direction", {
|
|
80
|
+
"left-to-right": "row",
|
|
81
|
+
"right-to-left": "row-reverse",
|
|
82
|
+
"top-to-bottom": "column",
|
|
83
|
+
"bottom-to-top": "column-reverse",
|
|
84
|
+
});
|
|
85
|
+
/** Along the direction: start, center (the default), end; left and right only where a side must be fixed. */
|
|
86
|
+
export const JUSTIFY_AXIS = simple("data-justify", "box-justify", same("start", "center", "end", "left", "right", "space-between"));
|
|
87
|
+
/** Across the direction. */
|
|
88
|
+
export const ALIGN_AXIS = simple("data-align", "box-align", same("start", "center", "end", "stretch", "baseline"));
|
|
89
|
+
/** The text inside, centered by default. */
|
|
90
|
+
export const TEXT_ALIGN_AXIS = simple("data-text-align", "box-text-align", same("start", "center", "end", "left", "right"));
|
|
91
|
+
/** Whether children wrap onto more lines when they don't fit. */
|
|
92
|
+
export const WRAP_AXIS = simple("data-wrap", "box-wrap", same("wrap", "nowrap"));
|
|
93
|
+
/** Spaces from the scale: `data-gap="8"` is `var(--scale-8)`. */
|
|
94
|
+
const spaced = (attribute, property, scale) => simple(attribute, property, Object.fromEntries(scale.map((step) => [String(step), `var(--scale-${step})`])));
|
|
95
|
+
/**
|
|
96
|
+
* Every axis of a box, in the order their rules are written: variant, direction, justify, align, text align, and the
|
|
97
|
+
* gap and padding from the scale.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* boxAxes(DEFAULT_INTERFACE.scale).map((axis) => axis.attribute); // ["data-variant", "data-direction", …]
|
|
101
|
+
*/
|
|
102
|
+
export function boxAxes(scale) {
|
|
103
|
+
return [
|
|
104
|
+
VARIANT_AXIS,
|
|
105
|
+
DIRECTION_AXIS,
|
|
106
|
+
JUSTIFY_AXIS,
|
|
107
|
+
ALIGN_AXIS,
|
|
108
|
+
TEXT_ALIGN_AXIS,
|
|
109
|
+
WRAP_AXIS,
|
|
110
|
+
spaced("data-gap", "box-gap", scale),
|
|
111
|
+
spaced("data-padding", "box-padding", scale),
|
|
112
|
+
];
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=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AC,KAAwB;IAC9C,OAAO;QACL,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,UAAU;QACV,eAAe;QACf,SAAS;QACT,MAAM,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC;QACpC,MAAM,CAAC,cAAc,EAAE,aAAa,EAAE,KAAK,CAAC;KAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** CSS custom properties by name (without dashes) and their values. */
|
|
2
|
+
export type AxisDeclarations = Readonly<Record<string, string>>;
|
|
3
|
+
/** What one value of an axis sets: at rest, and over it while hovered and while pressed (interactive boxes). */
|
|
4
|
+
export interface AxisValue {
|
|
5
|
+
rest: AxisDeclarations;
|
|
6
|
+
hover?: AxisDeclarations;
|
|
7
|
+
active?: AxisDeclarations;
|
|
8
|
+
}
|
|
9
|
+
/** One way a box can vary (its variant, direction, gap…): the attribute that carries it and each value's look. */
|
|
10
|
+
export interface Axis {
|
|
11
|
+
/** The attribute, such as `data-variant` (and `data-variant-960` per breakpoint). */
|
|
12
|
+
attribute: string;
|
|
13
|
+
values: Readonly<Record<string, AxisValue>>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/box-axis/type.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhE,gHAAgH;AAChH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED,kHAAkH;AAClH,MAAM,WAAW,IAAI;IACnB,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/box-axis/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ButtonProperties } from "@sharadox/graphical-user-interface-web-library/button/type";
|
|
2
|
+
/**
|
|
3
|
+
* The button: a `<button>`, or with `href` a link (next/link's `Link`, or the site's own `link`) that looks the same,
|
|
4
|
+
* so the two can never drift apart. Filled in the brand color by default; any variant, color, color style, corner,
|
|
5
|
+
* line and size (each per breakpoint too), a prefix and a suffix section, or one square icon. While `loading` it
|
|
6
|
+
* shows the spinner, is marked busy and ignores clicks, so an action never runs twice; disabled, a link loses its
|
|
7
|
+
* address. It is a client component (it handles clicks), so a server page can use it with serializable properties.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <Button type="submit" loading={saving}>Save</Button>
|
|
11
|
+
* <Button href="/en/contact" variant="outlined">Contact</Button>
|
|
12
|
+
* <Button square icon="close" variant="transparent" aria-label="Close" />
|
|
13
|
+
*/
|
|
14
|
+
export declare function Button(properties: ButtonProperties): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/button/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AAEnG;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,UAAU,EAAE,gBAAgB,+BAiDlD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { Icon } from "@sharadox/icon-web-library/icon";
|
|
5
|
+
import { Box } from "@sharadox/graphical-user-interface-web-library/box";
|
|
6
|
+
/**
|
|
7
|
+
* The button: a `<button>`, or with `href` a link (next/link's `Link`, or the site's own `link`) that looks the same,
|
|
8
|
+
* so the two can never drift apart. Filled in the brand color by default; any variant, color, color style, corner,
|
|
9
|
+
* line and size (each per breakpoint too), a prefix and a suffix section, or one square icon. While `loading` it
|
|
10
|
+
* shows the spinner, is marked busy and ignores clicks, so an action never runs twice; disabled, a link loses its
|
|
11
|
+
* address. It is a client component (it handles clicks), so a server page can use it with serializable properties.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <Button type="submit" loading={saving}>Save</Button>
|
|
15
|
+
* <Button href="/en/contact" variant="outlined">Contact</Button>
|
|
16
|
+
* <Button square icon="close" variant="transparent" aria-label="Close" />
|
|
17
|
+
*/
|
|
18
|
+
export function Button(properties) {
|
|
19
|
+
const { variant = "filled", color = "brand", state, loading = false, disabled = false, icon, square, children, onClick, ...rest } = properties;
|
|
20
|
+
const currentState = state ?? (disabled ? "disabled" : loading ? "loading" : "enabled");
|
|
21
|
+
const ignored = currentState === "loading" || currentState === "disabled";
|
|
22
|
+
const click = (event) => {
|
|
23
|
+
if (ignored)
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
else
|
|
26
|
+
onClick?.(event);
|
|
27
|
+
};
|
|
28
|
+
const content = (_jsxs(_Fragment, { children: [icon && _jsx(Icon, { name: icon }), children] }));
|
|
29
|
+
const box = { ...rest, variant, color, square, interactive: true, state: currentState, onClick: click };
|
|
30
|
+
if (rest.href !== undefined) {
|
|
31
|
+
const { link: Anchor = Link, href, ...anchor } = box;
|
|
32
|
+
if (currentState === "disabled") {
|
|
33
|
+
// A disabled link goes nowhere: no address, still announced as a link that is disabled.
|
|
34
|
+
return (_jsx(Box, { ...anchor, as: "a", role: "link", children: content }));
|
|
35
|
+
}
|
|
36
|
+
return (_jsx(Box, { ...anchor, as: Anchor, href: href, children: content }));
|
|
37
|
+
}
|
|
38
|
+
const { type = "button", link: _link, ...button } = box;
|
|
39
|
+
void _link;
|
|
40
|
+
return (_jsx(Box, { ...button, as: "button", type: type, disabled: currentState === "disabled", children: content }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/button/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC;AAIzE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,MAAM,CAAC,UAA4B;IACjD,MAAM,EACJ,OAAO,GAAG,QAAQ,EAClB,KAAK,GAAG,OAAO,EACf,KAAK,EACL,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,GAAG,IAAI,EACR,GAAG,UAAU,CAAC;IACf,MAAM,YAAY,GAAa,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAClG,MAAM,OAAO,GAAG,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,UAAU,CAAC;IAC1E,MAAM,KAAK,GAAG,CAAC,KAA8B,EAAE,EAAE;QAC/C,IAAI,OAAO;YAAE,KAAK,CAAC,cAAc,EAAE,CAAC;;YAC9B,OAAkE,EAAE,CAAC,KAAK,CAAC,CAAC;IACpF,CAAC,CAAC;IACF,MAAM,OAAO,GAAG,CACd,8BACG,IAAI,IAAI,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,EAC5B,QAAQ,IACR,CACJ,CAAC;IACF,MAAM,GAAG,GAAG,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACxG,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,GAAG,GAAwD,CAAC;QAC1G,IAAI,YAAY,KAAK,UAAU,EAAE,CAAC;YAChC,wFAAwF;YACxF,OAAO,CACL,KAAC,GAAG,OAAK,MAAM,EAAE,EAAE,EAAC,GAAG,EAAC,IAAI,EAAC,MAAM,YAChC,OAAO,GACJ,CACP,CAAC;QACJ,CAAC;QACD,OAAO,CACL,KAAC,GAAG,OAAK,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,YACpC,OAAO,GACJ,CACP,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,IAAI,GAAG,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,GAAG,GAAuD,CAAC;IAC5G,KAAK,KAAK,CAAC;IACX,OAAO,CACL,KAAC,GAAG,OAAK,MAAM,EAAE,EAAE,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,KAAK,UAAU,YAC3E,OAAO,GACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ComponentType, ReactNode } from "react";
|
|
2
|
+
import type { IconName } from "@sharadox/icon-web-library/icon/type";
|
|
3
|
+
import type { BoxLook, BoxState } from "@sharadox/graphical-user-interface-web-library/box/type";
|
|
4
|
+
/** What a link component receives to draw a button-looking link (next/link's `Link` by default). */
|
|
5
|
+
export interface ButtonLinkProperties extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> {
|
|
6
|
+
href: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** What every button shares, a link or not. */
|
|
10
|
+
interface ButtonLook extends Omit<BoxLook, "direction" | "justify" | "align" | "textAlign" | "gap" | "padding"> {
|
|
11
|
+
/** Forces a state (for the design system); otherwise it follows the pointer, `disabled` and `loading`. */
|
|
12
|
+
state?: BoxState;
|
|
13
|
+
/** Shows the spinner instead of the words and ignores clicks while an action runs. */
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** A section before the words. */
|
|
17
|
+
prefix?: ReactNode;
|
|
18
|
+
/** A section after the words. */
|
|
19
|
+
suffix?: ReactNode;
|
|
20
|
+
/** An icon as the whole content (with `square`) or before the words. */
|
|
21
|
+
icon?: IconName;
|
|
22
|
+
/** Holds one icon or character: square, with no padding. Name it with `aria-label`. */
|
|
23
|
+
square?: boolean;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/** A button, or a link that looks like one (with `href`). */
|
|
27
|
+
export type ButtonProperties = (ButtonLook & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "color" | "prefix" | "disabled"> & {
|
|
28
|
+
href?: undefined;
|
|
29
|
+
link?: undefined;
|
|
30
|
+
}) | (ButtonLook & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "color" | "prefix"> & {
|
|
31
|
+
/** Where the link leads. */
|
|
32
|
+
href: string;
|
|
33
|
+
/** The link component (a site's own, such as one gliding to sections): next/link's `Link` by default. */
|
|
34
|
+
link?: ComponentType<ButtonLinkProperties>;
|
|
35
|
+
});
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/button/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,aAAa,EAAE,SAAS,EAA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I,EAAE,MAAM,CAAC;IACb,yGAAyG;IACzG,IAAI,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CAC5C,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/button/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every value the design system shows a button in. It sits apart from the (client) button, so server code can read
|
|
3
|
+
* it.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* BUTTON_AXES.variant; // ["filled", "outlined", "transparent", "inline"]
|
|
7
|
+
*/
|
|
8
|
+
export declare const BUTTON_AXES: {
|
|
9
|
+
readonly variant: readonly ["filled", "outlined", "transparent", "inline"];
|
|
10
|
+
readonly state: readonly ["enabled", "hover", "active", "loading", "disabled"];
|
|
11
|
+
readonly size: readonly ["small", "medium", "large"];
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/button-axis/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;;;CAId,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every value the design system shows a button in. It sits apart from the (client) button, so server code can read
|
|
3
|
+
* it.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* BUTTON_AXES.variant; // ["filled", "outlined", "transparent", "inline"]
|
|
7
|
+
*/
|
|
8
|
+
export const BUTTON_AXES = {
|
|
9
|
+
variant: ["filled", "outlined", "transparent", "inline"],
|
|
10
|
+
state: ["enabled", "hover", "active", "loading", "disabled"],
|
|
11
|
+
size: ["small", "medium", "large"],
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/button-axis/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,CAAC;IACxD,KAAK,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;IAC5D,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChoiceProperties } from "@sharadox/graphical-user-interface-web-library/choice/type";
|
|
2
|
+
/**
|
|
3
|
+
* A segmented choice: one radio button per option in a row, the chosen one filled. It is one stop in the tab order
|
|
4
|
+
* (the chosen option); the arrow keys move and choose, wrapping around, and Home and End jump to the ends, as a radio
|
|
5
|
+
* group does.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <Choice label="Size" options={[{ value: "small", label: "Small" }, …]} value={size} onChange={setSize} />
|
|
9
|
+
*/
|
|
10
|
+
export declare function Choice({ label, options, value, onChange, size, color, className }: ChoiceProperties): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/choice/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AAInG;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAoB,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BAwClH"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { Box } from "@sharadox/graphical-user-interface-web-library/box";
|
|
5
|
+
import { Button } from "@sharadox/graphical-user-interface-web-library/button";
|
|
6
|
+
const STEPS = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 };
|
|
7
|
+
/**
|
|
8
|
+
* A segmented choice: one radio button per option in a row, the chosen one filled. It is one stop in the tab order
|
|
9
|
+
* (the chosen option); the arrow keys move and choose, wrapping around, and Home and End jump to the ends, as a radio
|
|
10
|
+
* group does.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <Choice label="Size" options={[{ value: "small", label: "Small" }, …]} value={size} onChange={setSize} />
|
|
14
|
+
*/
|
|
15
|
+
export function Choice({ label, options, value, onChange, size, color = "foreground", className }) {
|
|
16
|
+
const group = useRef(null);
|
|
17
|
+
const chosen = Math.max(0, options.findIndex((option) => option.value === value));
|
|
18
|
+
const move = (event) => {
|
|
19
|
+
const step = STEPS[event.key];
|
|
20
|
+
const next = event.key === "Home"
|
|
21
|
+
? 0
|
|
22
|
+
: event.key === "End"
|
|
23
|
+
? options.length - 1
|
|
24
|
+
: step === undefined
|
|
25
|
+
? undefined
|
|
26
|
+
: (chosen + step + options.length) % options.length;
|
|
27
|
+
if (next === undefined)
|
|
28
|
+
return;
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
onChange(options[next].value);
|
|
31
|
+
group.current?.querySelectorAll('[role="radio"]')[next]?.focus();
|
|
32
|
+
};
|
|
33
|
+
return (_jsx(Box, { role: "radiogroup", "aria-label": label, gap: 4, wrap: "wrap", className: className, ref: group, children: options.map((option, index) => (_jsx(Button, { role: "radio", "aria-checked": option.value === value, tabIndex: index === chosen ? 0 : -1, variant: option.value === value ? "filled" : "transparent", color: color, size: size, onClick: () => onChange(option.value), onKeyDown: move, children: option.label }, option.value))) }));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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AK,SAAS;YAAE,OAAO;QAC/B,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAE,CAAC,KAAK,CAAC,CAAC;QAC/B,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAc,gBAAgB,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IAChF,CAAC,CAAC;IACF,OAAO,CACL,KAAC,GAAG,IAAC,IAAI,EAAC,YAAY,gBAAa,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAC,MAAM,EAAC,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,YAC3F,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,KAAC,MAAM,IAEL,IAAI,EAAC,OAAO,kBACE,MAAM,CAAC,KAAK,KAAK,KAAK,EACpC,QAAQ,EAAE,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACnC,OAAO,EAAE,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,EAC1D,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EACrC,SAAS,EAAE,IAAI,YAEd,MAAM,CAAC,KAAK,IAVR,MAAM,CAAC,KAAK,CAWV,CACV,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Responsive } from "@sharadox/graphical-user-interface-web-library/responsive/type";
|
|
2
|
+
/** One option: what it stores and the words it shows. */
|
|
3
|
+
export interface ChoiceOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ChoiceProperties {
|
|
8
|
+
/** The group's name for assistive technology. */
|
|
9
|
+
label: string;
|
|
10
|
+
options: readonly ChoiceOption[];
|
|
11
|
+
/** The chosen option's value. */
|
|
12
|
+
value: string;
|
|
13
|
+
onChange: (value: string) => void;
|
|
14
|
+
size?: Responsive<string>;
|
|
15
|
+
/** The chosen option's fill, and the others' words (`foreground` by default). */
|
|
16
|
+
color?: Responsive<string>;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/choice/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gEAAgE,CAAC;AAEjG,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IACjC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC1B,iFAAiF;IACjF,KAAK,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/choice/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ColorDefinition, ColorReference, InterfaceConfiguration, InterfaceOverrides } from "@sharadox/graphical-user-interface-web-library/interface-configuration/type";
|
|
2
|
+
/** The color style that follows the device's light or dark preference. */
|
|
3
|
+
export declare const INHERIT_COLOR_STYLE = "inherit";
|
|
4
|
+
/**
|
|
5
|
+
* The generic interface: white and black color styles (and `inherit`), the constant colors with their RGB channels,
|
|
6
|
+
* the colors that refer to them, three corner styles, three line styles, the scale, the breakpoints, three
|
|
7
|
+
* interactive sizes and every shared value, each pointing to its source.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_INTERFACE: InterfaceConfiguration;
|
|
10
|
+
/** Whether a color is a reference to another color rather than constant RGB channels. */
|
|
11
|
+
export declare function isReference(color: ColorDefinition): color is ColorReference;
|
|
12
|
+
/**
|
|
13
|
+
* A brand's interface: the defaults with its changes (each color, style, size and value merged one level deep),
|
|
14
|
+
* checked so every name it uses exists. A new color needs only its RGB channels; every value of it is derived.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* export const INTERFACE = defineInterface({
|
|
18
|
+
* colors: { gold: { rgb: { white: "180 140 60", black: "212 175 90" } }, brand: { of: "gold" } },
|
|
19
|
+
* defaultCornerStyle: "circle",
|
|
20
|
+
* });
|
|
21
|
+
*/
|
|
22
|
+
export declare function defineInterface(overrides?: InterfaceOverrides): InterfaceConfiguration;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/interface-configuration/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,6EAA6E,CAAC;AAErF,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAW7C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,sBAuD/B,CAAC;AAEF,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,IAAI,cAAc,CAE3E;AAsDD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,SAAS,GAAE,kBAAuB,GAAG,sBAAsB,CAe1F"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/** The color style that follows the device's light or dark preference. */
|
|
2
|
+
export const INHERIT_COLOR_STYLE = "inherit";
|
|
3
|
+
const both = (rgb) => ({ white: rgb, black: rgb });
|
|
4
|
+
const interactiveSize = (minimum, font) => ({
|
|
5
|
+
"minimum-size": minimum,
|
|
6
|
+
"font-size": font,
|
|
7
|
+
"font-weight": "var(--interactive-font-weight)",
|
|
8
|
+
"field-font-weight": "var(--field-font-weight)",
|
|
9
|
+
"section-padding": "var(--scale-8)",
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* The generic interface: white and black color styles (and `inherit`), the constant colors with their RGB channels,
|
|
13
|
+
* the colors that refer to them, three corner styles, three line styles, the scale, the breakpoints, three
|
|
14
|
+
* interactive sizes and every shared value, each pointing to its source.
|
|
15
|
+
*/
|
|
16
|
+
export const DEFAULT_INTERFACE = {
|
|
17
|
+
colorStyles: { white: { scheme: "light" }, black: { scheme: "dark" } },
|
|
18
|
+
inheritColorStyles: { light: "white", dark: "black" },
|
|
19
|
+
defaultColorStyle: INHERIT_COLOR_STYLE,
|
|
20
|
+
colors: {
|
|
21
|
+
black: { rgb: both("0 0 0"), on: "white" },
|
|
22
|
+
white: { rgb: both("255 255 255"), on: "black" },
|
|
23
|
+
red: { rgb: { white: "220 38 38", black: "255 69 58" } },
|
|
24
|
+
green: { rgb: { white: "22 163 74", black: "48 209 88" } },
|
|
25
|
+
blue: { rgb: { white: "37 99 235", black: "10 132 255" } },
|
|
26
|
+
cyan: { rgb: { white: "8 145 178", black: "0 255 255" } },
|
|
27
|
+
magenta: { rgb: { white: "192 38 211", black: "255 0 255" } },
|
|
28
|
+
yellow: { rgb: { white: "202 138 4", black: "255 214 10" } },
|
|
29
|
+
foreground: { of: { white: "black", black: "white" }, on: "background" },
|
|
30
|
+
middleground: { rgb: { white: "94 94 94", black: "161 161 161" }, transparent: "foreground", hover: "foreground" },
|
|
31
|
+
background: { of: { white: "white", black: "black" } },
|
|
32
|
+
brand: { of: "foreground", on: "background" },
|
|
33
|
+
information: { of: "blue" },
|
|
34
|
+
success: { of: "green" },
|
|
35
|
+
warn: { of: "yellow" },
|
|
36
|
+
error: { of: "red" },
|
|
37
|
+
},
|
|
38
|
+
cornerStyles: { square: "0px", "rounded-square": "4px", circle: "10000px" },
|
|
39
|
+
defaultCornerStyle: "rounded-square",
|
|
40
|
+
lineStyles: { line: "solid", dotted: "dotted", dashed: "dashed" },
|
|
41
|
+
defaultLineStyle: "line",
|
|
42
|
+
scale: [0, 4, 8, 12, 14, 16, 24, 32, 64, 128],
|
|
43
|
+
breakpoints: [640, 960, 1280],
|
|
44
|
+
sizes: {
|
|
45
|
+
small: interactiveSize("var(--scale-16)", "var(--scale-12)"),
|
|
46
|
+
medium: interactiveSize("var(--scale-32)", "var(--scale-14)"),
|
|
47
|
+
large: interactiveSize("48px", "var(--scale-16)"),
|
|
48
|
+
},
|
|
49
|
+
defaultSize: "medium",
|
|
50
|
+
values: {
|
|
51
|
+
"color-rgb-alpha": "100%",
|
|
52
|
+
"transparent-color-rgb-alpha": "10%",
|
|
53
|
+
"transparent-hover-color-rgb-alpha": "var(--transparent-color-rgb-alpha)",
|
|
54
|
+
"transparent-active-color-rgb-alpha": "var(--transparent-hover-color-rgb-alpha)",
|
|
55
|
+
"disabled-opacity": "50%",
|
|
56
|
+
"line-thickness": "1px",
|
|
57
|
+
"focus-thickness": "2px",
|
|
58
|
+
"focus-offset": "var(--scale-4)",
|
|
59
|
+
"quick-duration": "0.1s",
|
|
60
|
+
duration: "0.25s",
|
|
61
|
+
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
62
|
+
"glass-blur": "var(--scale-16)",
|
|
63
|
+
"interactive-font-weight": "500",
|
|
64
|
+
"field-font-weight": "400",
|
|
65
|
+
"line-height": "1.25",
|
|
66
|
+
"font-family": "system-ui, sans-serif",
|
|
67
|
+
"wrapper-width": "1280px",
|
|
68
|
+
"wrapper-padding": "var(--scale-16)",
|
|
69
|
+
"spinner-duration": "0.8s",
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
/** Whether a color is a reference to another color rather than constant RGB channels. */
|
|
73
|
+
export function isReference(color) {
|
|
74
|
+
return "of" in color;
|
|
75
|
+
}
|
|
76
|
+
const KEBAB_CASE = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
|
|
77
|
+
/** Every color a color refers to in each color style, for checks. */
|
|
78
|
+
function referencesOf(color, styles) {
|
|
79
|
+
const own = [color.on, color.transparent, color.hover].filter((name) => name !== undefined);
|
|
80
|
+
if (!isReference(color))
|
|
81
|
+
return own;
|
|
82
|
+
return [...own, ...(typeof color.of === "string" ? [color.of] : styles.map((style) => color.of[style]))];
|
|
83
|
+
}
|
|
84
|
+
/** Checks that every name a configuration uses exists, and that no color refers back to itself. */
|
|
85
|
+
function check(configuration) {
|
|
86
|
+
const styles = Object.keys(configuration.colorStyles);
|
|
87
|
+
if (styles.includes(INHERIT_COLOR_STYLE))
|
|
88
|
+
throw new Error(`"${INHERIT_COLOR_STYLE}" is not a color style`);
|
|
89
|
+
for (const style of [configuration.defaultColorStyle, ...Object.values(configuration.inheritColorStyles)]) {
|
|
90
|
+
if (style !== INHERIT_COLOR_STYLE && !styles.includes(style))
|
|
91
|
+
throw new Error(`no color style "${style}"`);
|
|
92
|
+
}
|
|
93
|
+
const { colors } = configuration;
|
|
94
|
+
for (const [name, color] of Object.entries(colors)) {
|
|
95
|
+
if (!KEBAB_CASE.test(name))
|
|
96
|
+
throw new Error(`"${name}" is not a kebab-case name`);
|
|
97
|
+
for (const style of styles) {
|
|
98
|
+
if (isReference(color) && typeof color.of !== "string" && !color.of[style])
|
|
99
|
+
throw new Error(`color "${name}" has no color for the "${style}" style`);
|
|
100
|
+
if (!isReference(color) && !color.rgb[style])
|
|
101
|
+
throw new Error(`color "${name}" has no rgb for the "${style}" style`);
|
|
102
|
+
}
|
|
103
|
+
for (const reference of referencesOf(color, styles)) {
|
|
104
|
+
if (!colors[reference])
|
|
105
|
+
throw new Error(`color "${name}" refers to "${reference}"`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// A reference that, followed, comes back to where it started would never resolve in CSS.
|
|
109
|
+
for (const start of Object.keys(colors)) {
|
|
110
|
+
for (const style of styles) {
|
|
111
|
+
const seen = new Set();
|
|
112
|
+
let current = colors[start];
|
|
113
|
+
let name = start;
|
|
114
|
+
while (isReference(current)) {
|
|
115
|
+
if (seen.has(name))
|
|
116
|
+
throw new Error(`color "${start}" refers to itself`);
|
|
117
|
+
seen.add(name);
|
|
118
|
+
name = typeof current.of === "string" ? current.of : current.of[style];
|
|
119
|
+
current = colors[name];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const named = [
|
|
124
|
+
["corner style", configuration.cornerStyles, configuration.defaultCornerStyle],
|
|
125
|
+
["line style", configuration.lineStyles, configuration.defaultLineStyle],
|
|
126
|
+
["size", configuration.sizes, configuration.defaultSize],
|
|
127
|
+
];
|
|
128
|
+
for (const [kind, options, chosen] of named)
|
|
129
|
+
if (!(chosen in options))
|
|
130
|
+
throw new Error(`no ${kind} "${chosen}"`);
|
|
131
|
+
return configuration;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A brand's interface: the defaults with its changes (each color, style, size and value merged one level deep),
|
|
135
|
+
* checked so every name it uses exists. A new color needs only its RGB channels; every value of it is derived.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* export const INTERFACE = defineInterface({
|
|
139
|
+
* colors: { gold: { rgb: { white: "180 140 60", black: "212 175 90" } }, brand: { of: "gold" } },
|
|
140
|
+
* defaultCornerStyle: "circle",
|
|
141
|
+
* });
|
|
142
|
+
*/
|
|
143
|
+
export function defineInterface(overrides = {}) {
|
|
144
|
+
const base = DEFAULT_INTERFACE;
|
|
145
|
+
const sizes = { ...base.sizes };
|
|
146
|
+
for (const [name, size] of Object.entries(overrides.sizes ?? {}))
|
|
147
|
+
sizes[name] = { ...sizes[name], ...size };
|
|
148
|
+
return check({
|
|
149
|
+
...base,
|
|
150
|
+
...overrides,
|
|
151
|
+
colorStyles: { ...base.colorStyles, ...overrides.colorStyles },
|
|
152
|
+
inheritColorStyles: { ...base.inheritColorStyles, ...overrides.inheritColorStyles },
|
|
153
|
+
colors: { ...base.colors, ...overrides.colors },
|
|
154
|
+
cornerStyles: { ...base.cornerStyles, ...overrides.cornerStyles },
|
|
155
|
+
lineStyles: { ...base.lineStyles, ...overrides.lineStyles },
|
|
156
|
+
sizes,
|
|
157
|
+
values: { ...base.values, ...overrides.values },
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/interface-configuration/index.ts"],"names":[],"mappings":"AAOA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAE7C,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;AAC3D,MAAM,eAAe,GAAG,CAAC,OAAe,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC;IAC1D,cAAc,EAAE,OAAO;IACvB,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,gCAAgC;IAC/C,mBAAmB,EAAE,0BAA0B;IAC/C,iBAAiB,EAAE,gBAAgB;CACpC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,WAAW,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;IACtE,kBAAkB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;IACrD,iBAAiB,EAAE,mBA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