elbe-ui 1.0.8 → 2.0.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.
Files changed (141) hide show
  1. package/dist/elbe.css +150 -562
  2. package/dist/elbe.css.map +1 -1
  3. package/dist/index.d.ts +188 -46
  4. package/dist/index.js +8 -6
  5. package/dist/ui/app/app.d.ts +12 -0
  6. package/dist/ui/{components/layout/app_base.js → app/app.js} +24 -31
  7. package/dist/ui/app/app_ctxt.d.ts +35 -0
  8. package/dist/ui/app/app_ctxt.js +10 -0
  9. package/dist/ui/components/badge.d.ts +3 -3
  10. package/dist/ui/components/badge.js +16 -5
  11. package/dist/ui/components/banner.d.ts +3 -3
  12. package/dist/ui/components/banner.js +1 -1
  13. package/dist/ui/components/base/box.d.ts +82 -35
  14. package/dist/ui/components/base/box.js +56 -8
  15. package/dist/ui/components/base/card.d.ts +11 -12
  16. package/dist/ui/components/base/card.js +36 -19
  17. package/dist/ui/components/base/padded.d.ts +2 -4
  18. package/dist/ui/components/base/state_builder.d.ts +9 -0
  19. package/dist/ui/components/base/state_builder.js +33 -0
  20. package/dist/ui/components/button/button.d.ts +8 -6
  21. package/dist/ui/components/button/button.js +27 -16
  22. package/dist/ui/components/button/choose_button.d.ts +5 -3
  23. package/dist/ui/components/button/choose_button.js +9 -6
  24. package/dist/ui/components/button/icon_button.d.ts +6 -5
  25. package/dist/ui/components/button/icon_button.js +33 -23
  26. package/dist/ui/components/button/toggle_button.d.ts +5 -5
  27. package/dist/ui/components/button/toggle_button.js +13 -7
  28. package/dist/ui/components/dialog/dialog.d.ts +13 -0
  29. package/dist/ui/components/dialog/dialog.js +69 -0
  30. package/dist/ui/components/dialog/dialog_ctx.d.ts +34 -0
  31. package/dist/ui/components/dialog/dialog_ctx.js +44 -0
  32. package/dist/ui/components/dialog/dialogs/_alert.d.ts +7 -0
  33. package/dist/ui/components/dialog/dialogs/_alert.js +9 -0
  34. package/dist/ui/components/dialog/dialogs/_confirm.d.ts +9 -0
  35. package/dist/ui/components/dialog/dialogs/_confirm.js +21 -0
  36. package/dist/ui/components/error_view.js +3 -3
  37. package/dist/ui/components/footer.js +7 -7
  38. package/dist/ui/components/input/_labeled_input.d.ts +21 -0
  39. package/dist/ui/components/input/_labeled_input.js +21 -0
  40. package/dist/ui/components/input/checkbox.d.ts +4 -2
  41. package/dist/ui/components/input/checkbox.js +16 -8
  42. package/dist/ui/components/input/range.d.ts +5 -3
  43. package/dist/ui/components/input/range.js +20 -13
  44. package/dist/ui/components/input/select.d.ts +4 -3
  45. package/dist/ui/components/input/select.js +13 -40
  46. package/dist/ui/components/input/switch.d.ts +4 -2
  47. package/dist/ui/components/input/switch.js +30 -40
  48. package/dist/ui/components/input/text/input_field.d.ts +14 -19
  49. package/dist/ui/components/input/text/input_field.js +63 -61
  50. package/dist/ui/components/input/text/single_line.d.ts +11 -9
  51. package/dist/ui/components/input/text/single_line.js +15 -21
  52. package/dist/ui/components/layout/flex.d.ts +7 -3
  53. package/dist/ui/components/layout/flex.js +15 -12
  54. package/dist/ui/components/layout/header.d.ts +2 -2
  55. package/dist/ui/components/layout/header.js +25 -18
  56. package/dist/ui/components/layout/menu.js +74 -49
  57. package/dist/ui/components/layout/scroll.d.ts +1 -0
  58. package/dist/ui/components/layout/scroll.js +3 -1
  59. package/dist/ui/components/layout/toolbar.js +9 -6
  60. package/dist/ui/components/link.d.ts +4 -2
  61. package/dist/ui/components/link.js +24 -11
  62. package/dist/ui/components/progress_bar.d.ts +2 -2
  63. package/dist/ui/components/progress_bar.js +12 -9
  64. package/dist/ui/components/spinner.d.ts +2 -7
  65. package/dist/ui/components/spinner.js +15 -16
  66. package/dist/ui/components/text.d.ts +5 -6
  67. package/dist/ui/components/text.js +34 -21
  68. package/dist/ui/components/tooltip.d.ts +5 -0
  69. package/dist/ui/components/tooltip.js +48 -0
  70. package/dist/ui/theme/subthemes/_theme_geometry.d.ts +9 -0
  71. package/dist/ui/theme/subthemes/_theme_geometry.js +22 -0
  72. package/dist/ui/theme/subthemes/_theme_menu.d.ts +9 -0
  73. package/dist/ui/theme/subthemes/_theme_menu.js +12 -0
  74. package/dist/ui/theme/subthemes/_theme_motion.d.ts +9 -0
  75. package/dist/ui/theme/subthemes/_theme_motion.js +13 -0
  76. package/dist/ui/theme/subthemes/_theme_toast.d.ts +8 -0
  77. package/dist/ui/theme/subthemes/_theme_toast.js +11 -0
  78. package/dist/ui/theme/subthemes/_theme_type.d.ts +49 -0
  79. package/dist/ui/theme/subthemes/_theme_type.js +73 -0
  80. package/dist/ui/theme/subthemes/color/_seed.d.ts +2 -0
  81. package/dist/ui/theme/subthemes/color/_seed.js +105 -0
  82. package/dist/ui/theme/subthemes/color/_theme_color.d.ts +865 -0
  83. package/dist/ui/theme/subthemes/color/_theme_color.js +83 -0
  84. package/dist/ui/theme/subthemes/color/colors/_color_contrast.d.ts +284 -0
  85. package/dist/ui/theme/subthemes/color/colors/_color_contrast.js +17 -0
  86. package/dist/ui/theme/subthemes/color/colors/_color_kind.d.ts +242 -0
  87. package/dist/ui/theme/subthemes/color/colors/_color_kind.js +45 -0
  88. package/dist/ui/theme/subthemes/color/colors/_color_layer.d.ts +226 -0
  89. package/dist/ui/theme/subthemes/color/colors/_color_layer.js +95 -0
  90. package/dist/ui/theme/subthemes/color/colors/_color_manner.d.ts +280 -0
  91. package/dist/ui/theme/subthemes/color/colors/_color_manner.js +17 -0
  92. package/dist/ui/theme/subthemes/color/colors/_color_mode.d.ts +269 -0
  93. package/dist/ui/theme/subthemes/color/colors/_color_mode.js +16 -0
  94. package/dist/ui/theme/subthemes/color/colors/_color_rgba.d.ts +166 -0
  95. package/dist/ui/theme/subthemes/color/colors/_color_rgba.js +86 -0
  96. package/dist/ui/theme/subthemes/color/colors/_color_scheme.d.ts +256 -0
  97. package/dist/ui/theme/subthemes/color/colors/_color_scheme.js +17 -0
  98. package/dist/ui/theme/subthemes/color/colors/_color_state.d.ts +252 -0
  99. package/dist/ui/theme/subthemes/color/colors/_color_state.js +49 -0
  100. package/dist/ui/theme/subthemes/color/colors/_colordef.d.ts +22 -0
  101. package/dist/ui/theme/subthemes/color/colors/_colordef.js +34 -0
  102. package/dist/ui/theme/subthemes/color/colors/colors.d.ts +511 -0
  103. package/dist/ui/theme/subthemes/color/colors/colors.js +24 -0
  104. package/dist/ui/theme/theme.d.ts +984 -30
  105. package/dist/ui/theme/theme.js +14 -82
  106. package/dist/ui/theme/theme_context.d.ts +15 -17
  107. package/dist/ui/theme/theme_context.js +79 -18
  108. package/dist/ui/util/_util.d.ts +1 -0
  109. package/dist/ui/util/_util.js +3 -0
  110. package/dist/ui/util/error_view.js +3 -3
  111. package/dist/ui/util/merge_deep.d.ts +1 -0
  112. package/dist/ui/util/merge_deep.js +18 -0
  113. package/dist/ui/util/root.d.ts +17 -0
  114. package/dist/ui/util/root.js +23 -0
  115. package/dist/ui/util/toast/_toast.d.ts +5 -0
  116. package/dist/ui/util/toast/_toast.js +7 -0
  117. package/dist/ui/util/toast/toast_ctx.d.ts +28 -0
  118. package/dist/ui/util/toast/toast_ctx.js +62 -0
  119. package/dist/ui/util/toast/toast_legacy.d.ts +5 -0
  120. package/dist/ui/util/{toast.js → toast/toast_legacy.js} +4 -4
  121. package/dist/ui/util/util.d.ts +8 -0
  122. package/dist/ui/util/util.js +54 -1
  123. package/package.json +10 -8
  124. package/dist/ui/components/dialog.d.ts +0 -10
  125. package/dist/ui/components/dialog.js +0 -35
  126. package/dist/ui/components/layout/app_base.d.ts +0 -15
  127. package/dist/ui/components/layout/ctx_app_base.d.ts +0 -19
  128. package/dist/ui/components/layout/ctx_app_base.js +0 -12
  129. package/dist/ui/theme/color_theme.d.ts +0 -2
  130. package/dist/ui/theme/color_theme.js +0 -92
  131. package/dist/ui/theme/colors.d.ts +0 -133
  132. package/dist/ui/theme/colors.js +0 -309
  133. package/dist/ui/theme/geometry_theme.d.ts +0 -16
  134. package/dist/ui/theme/geometry_theme.js +0 -28
  135. package/dist/ui/theme/seed.d.ts +0 -53
  136. package/dist/ui/theme/seed.js +0 -4
  137. package/dist/ui/theme/type_theme.d.ts +0 -38
  138. package/dist/ui/theme/type_theme.js +0 -73
  139. package/dist/ui/util/confirm_dialog.d.ts +0 -10
  140. package/dist/ui/util/confirm_dialog.js +0 -46
  141. package/dist/ui/util/toast.d.ts +0 -5
@@ -0,0 +1,48 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useRef, useState } from "react";
3
+ import { createPortal } from "react-dom";
4
+ import { useApp } from "../app/app_ctxt";
5
+ import { getRootElement } from "../util/root";
6
+ export function WithTooltip(p) {
7
+ const rootDOM = useMemo(() => getRootElement("elbe_tooltip"), []);
8
+ const timeoutRef = useRef(null);
9
+ const [visible, setVisible] = useState(false);
10
+ const [coords, setCoords] = useState({ x: 0, y: 0, top: false, left: false });
11
+ const { _appThemeContext } = useApp();
12
+ const { theme } = _appThemeContext.useTheme().useWith((c) => ({
13
+ color: Object.assign(Object.assign({}, c.color), { selection: Object.assign(Object.assign({}, c.color.selection), { scheme: "inverse", kind: "accent", manner: "plain", state: "neutral" }) }),
14
+ }), []);
15
+ if (!p.tooltip)
16
+ return _jsx(_Fragment, { children: p.children });
17
+ return (_jsxs("span", { onMouseEnter: () => {
18
+ timeoutRef.current = window.setTimeout(() => setVisible(true), 1000);
19
+ }, onMouseLeave: () => {
20
+ console.log("leave");
21
+ if (timeoutRef.current) {
22
+ clearTimeout(timeoutRef.current);
23
+ timeoutRef.current = null;
24
+ }
25
+ setVisible(false);
26
+ }, onMouseMove: (e) => {
27
+ setCoords({
28
+ x: e.clientX,
29
+ y: e.clientY,
30
+ top: e.clientY > window.innerHeight / 2,
31
+ left: e.clientX > window.innerWidth / 2,
32
+ });
33
+ }, style: { display: "contents" }, children: [p.children, visible &&
34
+ createPortal(_jsx("div", { role: "tooltip", className: "elbe_tooltip", style: {
35
+ position: "fixed",
36
+ pointerEvents: "none",
37
+ zIndex: 1001,
38
+ top: coords.y + (coords.top ? -12 : 12), // offset below cursor
39
+ left: coords.x + (coords.left ? -12 : 12), // offset right of cursor
40
+ background: theme.color.currentColor.back
41
+ .inter(theme.color.currentColor.front, 0.2)
42
+ .asCss(),
43
+ color: theme.color.currentColor.front.asCss(),
44
+ padding: ".125rem .3rem",
45
+ borderRadius: ".25rem",
46
+ transform: `translate(${coords.left ? "-100%" : "0"}, ${coords.top ? "-100%" : "0"})`,
47
+ }, children: p.tooltip }), rootDOM)] }));
48
+ }
@@ -0,0 +1,9 @@
1
+ import { ElbeSubThemeData } from "../theme";
2
+ declare const _data: {
3
+ size: number;
4
+ radius: number;
5
+ padding: number;
6
+ borderWidth: number;
7
+ };
8
+ export declare const geometryThemeData: ElbeSubThemeData<typeof _data>;
9
+ export {};
@@ -0,0 +1,22 @@
1
+ const _data = {
2
+ size: 16,
3
+ radius: 0.75,
4
+ padding: 1,
5
+ borderWidth: 0.125,
6
+ };
7
+ export const geometryThemeData = {
8
+ seed: _data,
9
+ _configType: _data,
10
+ compute: (c) => c,
11
+ asCss: (c) => ({}),
12
+ asCssContext(c) {
13
+ document.documentElement.style.fontSize = `${c.size}px`;
14
+ return {
15
+ size: `${c.size}px`,
16
+ padding: `${c.padding}rem`,
17
+ "border-radius": `${c.radius}rem`,
18
+ "border-width": `${c.borderWidth}rem`,
19
+ };
20
+ },
21
+ fromSeed: (seed) => seed,
22
+ };
@@ -0,0 +1,9 @@
1
+ import { ElbeSubThemeData } from "../theme";
2
+ import { ColorSelection } from "./color/colors/colors";
3
+ declare const _theme: {
4
+ scheme: ColorSelection.Schemes;
5
+ elevated: boolean;
6
+ sharp: boolean;
7
+ };
8
+ export declare const menuThemeData: ElbeSubThemeData<typeof _theme, typeof _theme>;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ const _theme = {
2
+ scheme: "secondary",
3
+ elevated: false,
4
+ sharp: false,
5
+ };
6
+ export const menuThemeData = {
7
+ seed: _theme,
8
+ _configType: _theme,
9
+ compute: (c) => c,
10
+ asCss: (c) => ({}),
11
+ fromSeed: (seed) => seed,
12
+ };
@@ -0,0 +1,9 @@
1
+ import { ElbeSubThemeData } from "../theme";
2
+ declare const _seed: {
3
+ reduced: boolean;
4
+ };
5
+ declare const _theme: {
6
+ reduced: boolean;
7
+ };
8
+ export declare const motionThemeData: ElbeSubThemeData<typeof _theme, typeof _seed>;
9
+ export {};
@@ -0,0 +1,13 @@
1
+ const _seed = {
2
+ reduced: false,
3
+ };
4
+ const _theme = {
5
+ reduced: false,
6
+ };
7
+ export const motionThemeData = {
8
+ seed: _seed,
9
+ _configType: _theme,
10
+ compute: (c) => c,
11
+ asCss: (c) => ({}),
12
+ fromSeed: (seed) => seed,
13
+ };
@@ -0,0 +1,8 @@
1
+ import { ElbeSubThemeData } from "../theme";
2
+ type _ToastAlignment = "top_start" | "top_center" | "top_end" | "bottom_start" | "bottom_center" | "bottom_end";
3
+ declare const _theme: {
4
+ alignment: _ToastAlignment;
5
+ duration: number;
6
+ };
7
+ export declare const toastThemeData: ElbeSubThemeData<typeof _theme, typeof _theme>;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ const _theme = {
2
+ alignment: "bottom_center",
3
+ duration: 3000,
4
+ };
5
+ export const toastThemeData = {
6
+ seed: _theme,
7
+ _configType: _theme,
8
+ compute: (c) => c,
9
+ asCss: (c) => ({}),
10
+ fromSeed: (seed) => seed,
11
+ };
@@ -0,0 +1,49 @@
1
+ import { ElbeSubThemeData } from "../theme";
2
+ export type TypeStyle<T extends Dict<any> = {}> = T & {
3
+ bold?: boolean;
4
+ italic?: boolean;
5
+ underline?: boolean;
6
+ family: string[];
7
+ size: number;
8
+ };
9
+ export declare function typeStyleAsCss(style: TypeStyle | undefined): React.CSSProperties;
10
+ type _VariantSelector<T> = (style: TypeStyle, variant: T) => TypeStyle;
11
+ declare const _seed: {
12
+ heading: {
13
+ bold: boolean;
14
+ family: string[];
15
+ size: number;
16
+ };
17
+ body: {
18
+ bold: boolean;
19
+ family: string[];
20
+ size: number;
21
+ };
22
+ code: {
23
+ bold: boolean;
24
+ family: string[];
25
+ size: number;
26
+ };
27
+ headingVariants: _VariantSelector<2 | 1 | 3 | 4 | 5 | 6>;
28
+ bodyVariants: _VariantSelector<"s" | "l">;
29
+ };
30
+ declare const _data: {
31
+ h1: TypeStyle;
32
+ h2: TypeStyle;
33
+ h3: TypeStyle;
34
+ h4: TypeStyle;
35
+ h5: TypeStyle;
36
+ h6: TypeStyle;
37
+ bodyL: TypeStyle;
38
+ bodyM: TypeStyle;
39
+ bodyS: TypeStyle;
40
+ code: TypeStyle;
41
+ };
42
+ type _Computed = {
43
+ [key in keyof typeof _data]: TypeStyle<{
44
+ asCss: (override?: Partial<TypeStyle>) => React.CSSProperties;
45
+ }>;
46
+ };
47
+ export type ElbeTypeVariants = keyof typeof _data;
48
+ export declare const typeThemeData: ElbeSubThemeData<_Computed, typeof _seed, typeof _data>;
49
+ export {};
@@ -0,0 +1,73 @@
1
+ import { dictMap, dictWithoutUndefined } from "../../util/util";
2
+ export function typeStyleAsCss(style) {
3
+ var _a, _b;
4
+ if (!style)
5
+ return {};
6
+ return {
7
+ fontFamily: (_a = style.family.join(", ")) !== null && _a !== void 0 ? _a : "sans-serif",
8
+ fontWeight: style.bold ? "bold" : "normal",
9
+ fontSize: `${(_b = style.size) !== null && _b !== void 0 ? _b : 1}rem`,
10
+ fontStyle: style.italic ? "italic" : "normal",
11
+ textDecoration: style.underline ? "underline" : "none",
12
+ };
13
+ }
14
+ const _headingVariants = (style, variant) => {
15
+ const reg = 1;
16
+ const diff = style.size - reg;
17
+ const varFac = (4 - (variant - 2)) / 6;
18
+ const size = reg + diff * Math.pow(varFac, 1.5);
19
+ return Object.assign(Object.assign({}, style), { size });
20
+ };
21
+ const _bodyVariants = (style, variant) => {
22
+ const size = style.size * (variant === "s" ? 0.8 : 1.2);
23
+ return Object.assign(Object.assign({}, style), { size });
24
+ };
25
+ const _seed = {
26
+ heading: {
27
+ bold: true,
28
+ family: ["Calistoga", "Arial", "sans-serif"],
29
+ size: 2,
30
+ },
31
+ body: {
32
+ bold: false,
33
+ family: ["Helvetica", "Arial", "sans-serif"],
34
+ size: 1,
35
+ },
36
+ code: {
37
+ bold: false,
38
+ family: ["Courier", "monospace"],
39
+ size: 1,
40
+ },
41
+ headingVariants: _headingVariants,
42
+ bodyVariants: _bodyVariants,
43
+ };
44
+ const _data = {
45
+ h1: {},
46
+ h2: {},
47
+ h3: {},
48
+ h4: {},
49
+ h5: {},
50
+ h6: {},
51
+ bodyL: {},
52
+ bodyM: {},
53
+ bodyS: {},
54
+ code: {},
55
+ };
56
+ export const typeThemeData = {
57
+ seed: _seed,
58
+ _configType: _data,
59
+ compute: (c) => dictMap(c, (v) => (Object.assign(Object.assign({}, v), { asCss: (override) => typeStyleAsCss(Object.assign(Object.assign({}, v), dictWithoutUndefined(override))) }))),
60
+ asCss: (c) => typeStyleAsCss(c.bodyM),
61
+ fromSeed: (seed) => ({
62
+ h1: seed.heading,
63
+ h2: seed.headingVariants(seed.heading, 2),
64
+ h3: seed.headingVariants(seed.heading, 3),
65
+ h4: seed.headingVariants(seed.heading, 4),
66
+ h5: seed.headingVariants(seed.heading, 5),
67
+ h6: seed.headingVariants(seed.heading, 6),
68
+ bodyL: seed.bodyVariants(seed.body, "l"),
69
+ bodyM: seed.body,
70
+ bodyS: seed.bodyVariants(seed.body, "s"),
71
+ code: seed.code,
72
+ }),
73
+ };
@@ -0,0 +1,2 @@
1
+ import { ColorThemeSeed } from "./colors/colors";
2
+ export declare const _seed: ColorThemeSeed;
@@ -0,0 +1,105 @@
1
+ import { LayerColor } from "./colors/_color_layer";
2
+ import { RGBAColor } from "./colors/_color_rgba";
3
+ import { colors, } from "./colors/colors";
4
+ const _styleSel = ({ base, style }) => {
5
+ const bL = base.luminance();
6
+ if (bL === 1)
7
+ return style;
8
+ //if (bL === 0) return s.mirrorBrightness();
9
+ if (style.luminance() == 0)
10
+ return style.mirrorBrightnessLayer();
11
+ return style.interLayerLayer(LayerColor.fromBack(bL > 0.5 ? colors.black : colors.white), 0.1);
12
+ };
13
+ const _makePrimary = (p) => p.base;
14
+ const _makeSecondary = ({ base, seed }) => LayerColor.new({
15
+ back: base.back
16
+ .inter(LayerColor.fromBack(seed.accent).back, base.back.luminance() < 0.3 ? 0.2 : 0.1)
17
+ .desaturated(0.5),
18
+ front: base.front,
19
+ border: base.border,
20
+ });
21
+ const _makeInverse = ({ base }) => base.mirrorBrightnessLayer();
22
+ const _makeMajor = ({ style, path }) => {
23
+ return LayerColor.fromBack(style.back, { border: style.back });
24
+ };
25
+ const _makeMinor = ({ base, style }) => {
26
+ const b = base.back;
27
+ const backIn = b.mirrorBrightness();
28
+ const major = style.back;
29
+ const minor = style.back.inter(b, 0.8);
30
+ const minorFront = minor.hasWCAGContrast(major) ? major : null;
31
+ return LayerColor.new({
32
+ back: minor, //.back.withAlpha(0.25),
33
+ front: minorFront !== null && minorFront !== void 0 ? minorFront : major.inter(backIn, 0.6),
34
+ border: minorFront !== null && minorFront !== void 0 ? minorFront : major.inter(backIn, 0.3),
35
+ });
36
+ };
37
+ const _makeFlat = ({ path, style, base }) => {
38
+ const highVis = path.includes("highvis");
39
+ const front = !style
40
+ ? base.front
41
+ : base.back.hasWCAGContrast(style === null || style === void 0 ? void 0 : style.back)
42
+ ? style === null || style === void 0 ? void 0 : style.back
43
+ : style === null || style === void 0 ? void 0 : style.back.inter(base.front, 0.6);
44
+ const isDark = base.back.luminance() < 0.3;
45
+ const border = !highVis && !style
46
+ ? base.front.inter(base.back, isDark ? 0.75 : 0.9)
47
+ : base.front;
48
+ return LayerColor.new({
49
+ back: base.back, //.withAlpha(0),
50
+ front,
51
+ border: front,
52
+ });
53
+ };
54
+ export const _seed = {
55
+ base: LayerColor.fromBack(colors.white, {
56
+ border: RGBAColor.fromHex("#ccc"),
57
+ }),
58
+ accent: LayerColor.fromBack(colors.accent.blue),
59
+ info: LayerColor.fromBack(colors.blue),
60
+ success: LayerColor.fromBack(colors.green),
61
+ warning: LayerColor.fromBack(colors.yellow),
62
+ error: LayerColor.fromBack(colors.red),
63
+ selection: {
64
+ contrast: "normal",
65
+ mode: "light",
66
+ scheme: "primary",
67
+ kind: "accent",
68
+ manner: "plain",
69
+ state: "neutral",
70
+ },
71
+ contrast: {
72
+ highvis: ({ seed }) => {
73
+ const base = LayerColor.fromBack(seed.base);
74
+ return Object.assign(Object.assign({}, seed), { base: base.withBorder(base.front), accent: LayerColor.fromBack(colors.black) });
75
+ },
76
+ normal: ({ seed }) => seed,
77
+ },
78
+ mode: {
79
+ light: ({ base }) => base,
80
+ dark: ({ base }) => base.mirrorBrightnessLayer(),
81
+ },
82
+ scheme: {
83
+ primary: _makePrimary,
84
+ secondary: (p) => {
85
+ const highVis = p.path.includes("highvis");
86
+ return (highVis ? _makePrimary : _makeSecondary)(p);
87
+ },
88
+ inverse: _makeInverse,
89
+ },
90
+ kind: {
91
+ accent: _styleSel,
92
+ info: _styleSel,
93
+ success: _styleSel,
94
+ warning: _styleSel,
95
+ error: _styleSel,
96
+ },
97
+ manner: {
98
+ major: _makeMajor,
99
+ minor: (p) => {
100
+ const highVis = p.path.includes("highvis");
101
+ return highVis ? _makeMajor(p) : _makeMinor(p);
102
+ },
103
+ flat: _makeFlat,
104
+ },
105
+ };