@pie-lib/render-ui 6.2.0-next.41 → 6.2.0-next.42

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/dist/color.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare const defaults: {
10
10
  TEXT: string;
11
11
  DISABLED: string;
12
12
  DISABLED_SECONDARY: string;
13
+ DISABLED_TEXT: string;
13
14
  CORRECT: "#4caf50";
14
15
  CORRECT_SECONDARY: "#e8f5e9";
15
16
  CORRECT_TERTIARY: string;
@@ -65,6 +66,7 @@ export declare const v: (prefix: any) => (...args: any[]) => any;
65
66
  export declare const text: () => any;
66
67
  export declare const disabled: () => any;
67
68
  export declare const disabledSecondary: () => any;
69
+ export declare const disabledText: () => any;
68
70
  export declare const correct: () => any;
69
71
  export declare const correctSecondary: () => any;
70
72
  export declare const correctTertiary: () => any;
package/dist/color.js CHANGED
@@ -2,68 +2,70 @@ import { __exportAll as ee } from "./_virtual/_rolldown/runtime.js";
2
2
  import { green as e, indigo as t, orange as te, pink as n, red as r } from "@mui/material/colors";
3
3
  //#region src/color.ts
4
4
  var ne = /* @__PURE__ */ ee({
5
- background: () => O,
6
- backgroundDark: () => k,
7
- black: () => V,
8
- blueGrey100: () => Y,
9
- blueGrey300: () => X,
10
- blueGrey600: () => Z,
11
- blueGrey900: () => Q,
12
- border: () => P,
13
- borderDark: () => I,
14
- borderGray: () => L,
15
- borderLight: () => F,
16
- buttonBorder: () => le,
17
- buttonFocusOutline: () => J,
18
- buttonHoverBg: () => ue,
19
- correct: () => u,
20
- correctSecondary: () => d,
21
- correctTertiary: () => f,
22
- correctWithIcon: () => p,
5
+ background: () => k,
6
+ backgroundDark: () => A,
7
+ black: () => H,
8
+ blueGrey100: () => X,
9
+ blueGrey300: () => Z,
10
+ blueGrey600: () => Q,
11
+ blueGrey900: () => ie,
12
+ border: () => F,
13
+ borderDark: () => L,
14
+ borderGray: () => R,
15
+ borderLight: () => I,
16
+ buttonBorder: () => ue,
17
+ buttonFocusOutline: () => Y,
18
+ buttonHoverBg: () => de,
19
+ correct: () => d,
20
+ correctSecondary: () => f,
21
+ correctTertiary: () => p,
22
+ correctWithIcon: () => m,
23
23
  defaults: () => i,
24
24
  disabled: () => c,
25
25
  disabledSecondary: () => l,
26
- dropdownBackground: () => j,
27
- fadedPrimary: () => C,
28
- focusChecked: () => W,
29
- focusCheckedBorder: () => G,
30
- focusUnchecked: () => K,
31
- focusUncheckedBorder: () => q,
32
- incorrect: () => m,
33
- incorrectSecondary: () => g,
34
- incorrectWithIcon: () => h,
35
- keyBoardFocusIndicator: () => ce,
36
- keypadButton: () => ie,
37
- keypadButtonHover: () => $,
38
- keypadButtonOperator: () => ae,
39
- keypadButtonOperatorHover: () => se,
40
- keypadEmptyPlaceholder: () => oe,
41
- missing: () => _,
42
- missingWithIcon: () => v,
43
- primary: () => y,
44
- primaryDark: () => x,
45
- primaryLight: () => b,
46
- primaryText: () => S,
47
- secondary: () => w,
48
- secondaryBackground: () => A,
49
- secondaryDark: () => E,
50
- secondaryLight: () => T,
51
- secondaryText: () => D,
52
- surface: () => re,
53
- tableGrid: () => R,
54
- tableGridLight: () => z,
55
- tableStripe: () => B,
56
- tertiary: () => M,
57
- tertiaryLight: () => N,
26
+ disabledText: () => u,
27
+ dropdownBackground: () => re,
28
+ fadedPrimary: () => w,
29
+ focusChecked: () => G,
30
+ focusCheckedBorder: () => K,
31
+ focusUnchecked: () => q,
32
+ focusUncheckedBorder: () => J,
33
+ incorrect: () => h,
34
+ incorrectSecondary: () => _,
35
+ incorrectWithIcon: () => g,
36
+ keyBoardFocusIndicator: () => le,
37
+ keypadButton: () => ae,
38
+ keypadButtonHover: () => se,
39
+ keypadButtonOperator: () => oe,
40
+ keypadButtonOperatorHover: () => ce,
41
+ keypadEmptyPlaceholder: () => $,
42
+ missing: () => v,
43
+ missingWithIcon: () => y,
44
+ primary: () => b,
45
+ primaryDark: () => S,
46
+ primaryLight: () => x,
47
+ primaryText: () => C,
48
+ secondary: () => T,
49
+ secondaryBackground: () => j,
50
+ secondaryDark: () => D,
51
+ secondaryLight: () => E,
52
+ secondaryText: () => O,
53
+ surface: () => M,
54
+ tableGrid: () => z,
55
+ tableGridLight: () => B,
56
+ tableStripe: () => V,
57
+ tertiary: () => N,
58
+ tertiaryLight: () => P,
58
59
  text: () => s,
59
- transparent: () => U,
60
+ transparent: () => W,
60
61
  v: () => a,
61
- visualElementsColors: () => de,
62
- white: () => H
62
+ visualElementsColors: () => fe,
63
+ white: () => U
63
64
  }), i = {
64
65
  TEXT: "black",
65
66
  DISABLED: "grey",
66
67
  DISABLED_SECONDARY: "#ABABAB",
68
+ DISABLED_TEXT: "#545454",
67
69
  CORRECT: e[500],
68
70
  CORRECT_SECONDARY: e[50],
69
71
  CORRECT_TERTIARY: "#0EA449",
@@ -119,7 +121,7 @@ Object.freeze(i);
119
121
  var a = (ee) => (...e) => {
120
122
  let t = e.pop();
121
123
  return e.reduceRight((e, t) => `var(--${ee}-${t}, ${e})`, t);
122
- }, o = a("pie"), s = () => o("text", i.TEXT), c = () => o("disabled", i.DISABLED), l = () => o("disabled-secondary", i.DISABLED_SECONDARY), u = () => o("correct", i.CORRECT), d = () => o("correct-secondary", i.CORRECT_SECONDARY), f = () => o("correct-tertiary", i.CORRECT_TERTIARY), p = () => o("correct-icon", i.CORRECT_WITH_ICON), m = () => o("incorrect", i.INCORRECT), h = () => o("incorrect-icon", i.INCORRECT_WITH_ICON), g = () => o("incorrect-secondary", i.INCORRECT_SECONDARY), _ = () => o("missing", i.MISSING), v = () => o("missing-icon", i.MISSING_WITH_ICON), y = () => o("primary", i.PRIMARY), b = () => o("primary-light", i.PRIMARY_LIGHT), x = () => o("primary-dark", i.PRIMARY_DARK), S = () => o("primary-text", "text", i.TEXT), C = () => o("faded-primary", i.FADED_PRIMARY), w = () => o("secondary", i.SECONDARY), T = () => o("secondary-light", i.SECONDARY_LIGHT), E = () => o("secondary-dark", i.SECONDARY_DARK), D = () => o("secondary-text", "text", i.TEXT), O = () => o("background", i.BACKGROUND), k = () => o("background-dark", i.BACKGROUND_DARK), A = () => o("secondary-background", i.SECONDARY_BACKGROUND), j = () => o("dropdown-background", i.DROPDOWN_BACKGROUND), re = () => o("surface", i.SURFACE), M = () => o("tertiary", i.TERTIARY), N = () => o("tertiary-light", i.TERTIARY_LIGHT), P = () => o("border", i.BORDER), F = () => o("border-light", i.BORDER_LIGHT), I = () => o("border-dark", i.BORDER_DARK), L = () => o("border-gray", i.BORDER_GRAY), R = () => o("table-grid", "text", i.TABLE_GRID), z = () => o("table-grid-light", "border-light", i.TABLE_GRID_LIGHT), B = () => o("table-stripe", "background-dark", i.TABLE_STRIPE), V = () => o("black", i.BLACK), H = () => o("white", i.WHITE), U = () => i.TRANSPARENT, W = () => o("focus-checked", i.FOCUS_CHECKED), G = () => o("focus-checked-border", i.FOCUS_CHECKED_BORDER), K = () => o("focus-unchecked", i.FOCUS_UNCHECKED), q = () => o("focus-unchecked-border", i.FOCUS_UNCHECKED_BORDER), J = () => o("button-focus-outline", i.BUTTON_FOCUS_OUTLINE), Y = () => o("blue-grey-100", i.BLUE_GREY100), X = () => o("blue-grey-300", i.BLUE_GREY300), Z = () => o("blue-grey-600", i.BLUE_GREY600), Q = () => o("blue-grey-900", i.BLUE_GREY900), ie = () => o("keypad-button", i.KEYPAD_BUTTON), ae = () => o("keypad-button-operator", i.KEYPAD_BUTTON_OPERATOR), oe = () => o("keypad-empty-placeholder", i.KEYPAD_EMPTY_PLACEHOLDER), $ = () => o("keypad-button-hover", i.KEYPAD_BUTTON_HOVER), se = () => o("keypad-button-operator-hover", i.KEYPAD_BUTTON_OPERATOR_HOVER), ce = () => o("keyboard-focus-indicator", i.KEY_BOARD_FOCUS_INDICATOR), le = () => o("button-border", i.BUTTON_BORDER), ue = () => o("button-hover-bg", i.BUTTON_HOVER_BG), de = {
124
+ }, o = a("pie"), s = () => o("text", i.TEXT), c = () => o("disabled", i.DISABLED), l = () => o("disabled-secondary", i.DISABLED_SECONDARY), u = () => o("disabled-text", "text", i.DISABLED_TEXT), d = () => o("correct", i.CORRECT), f = () => o("correct-secondary", i.CORRECT_SECONDARY), p = () => o("correct-tertiary", i.CORRECT_TERTIARY), m = () => o("correct-icon", i.CORRECT_WITH_ICON), h = () => o("incorrect", i.INCORRECT), g = () => o("incorrect-icon", i.INCORRECT_WITH_ICON), _ = () => o("incorrect-secondary", i.INCORRECT_SECONDARY), v = () => o("missing", i.MISSING), y = () => o("missing-icon", i.MISSING_WITH_ICON), b = () => o("primary", i.PRIMARY), x = () => o("primary-light", i.PRIMARY_LIGHT), S = () => o("primary-dark", i.PRIMARY_DARK), C = () => o("primary-text", "text", i.TEXT), w = () => o("faded-primary", i.FADED_PRIMARY), T = () => o("secondary", i.SECONDARY), E = () => o("secondary-light", i.SECONDARY_LIGHT), D = () => o("secondary-dark", i.SECONDARY_DARK), O = () => o("secondary-text", "text", i.TEXT), k = () => o("background", i.BACKGROUND), A = () => o("background-dark", i.BACKGROUND_DARK), j = () => o("secondary-background", i.SECONDARY_BACKGROUND), re = () => o("dropdown-background", i.DROPDOWN_BACKGROUND), M = () => o("surface", i.SURFACE), N = () => o("tertiary", i.TERTIARY), P = () => o("tertiary-light", i.TERTIARY_LIGHT), F = () => o("border", i.BORDER), I = () => o("border-light", i.BORDER_LIGHT), L = () => o("border-dark", i.BORDER_DARK), R = () => o("border-gray", i.BORDER_GRAY), z = () => o("table-grid", "text", i.TABLE_GRID), B = () => o("table-grid-light", "border-light", i.TABLE_GRID_LIGHT), V = () => o("table-stripe", "background-dark", i.TABLE_STRIPE), H = () => o("black", i.BLACK), U = () => o("white", i.WHITE), W = () => i.TRANSPARENT, G = () => o("focus-checked", i.FOCUS_CHECKED), K = () => o("focus-checked-border", i.FOCUS_CHECKED_BORDER), q = () => o("focus-unchecked", i.FOCUS_UNCHECKED), J = () => o("focus-unchecked-border", i.FOCUS_UNCHECKED_BORDER), Y = () => o("button-focus-outline", i.BUTTON_FOCUS_OUTLINE), X = () => o("blue-grey-100", i.BLUE_GREY100), Z = () => o("blue-grey-300", i.BLUE_GREY300), Q = () => o("blue-grey-600", i.BLUE_GREY600), ie = () => o("blue-grey-900", i.BLUE_GREY900), ae = () => o("keypad-button", i.KEYPAD_BUTTON), oe = () => o("keypad-button-operator", i.KEYPAD_BUTTON_OPERATOR), $ = () => o("keypad-empty-placeholder", i.KEYPAD_EMPTY_PLACEHOLDER), se = () => o("keypad-button-hover", i.KEYPAD_BUTTON_HOVER), ce = () => o("keypad-button-operator-hover", i.KEYPAD_BUTTON_OPERATOR_HOVER), le = () => o("keyboard-focus-indicator", i.KEY_BOARD_FOCUS_INDICATOR), ue = () => o("button-border", i.BUTTON_BORDER), de = () => o("button-hover-bg", i.BUTTON_HOVER_BG), fe = {
123
125
  AXIS_LINE_COLOR: "#5A53C9",
124
126
  ROLLOVER_FILL_BAR_COLOR: "#050F2D",
125
127
  GRIDLINES_COLOR: "#8E88EA",
@@ -127,4 +129,4 @@ var a = (ee) => (...e) => {
127
129
  SHAPES_FILL_COLOR: "#7986cb"
128
130
  };
129
131
  //#endregion
130
- export { O as background, k as backgroundDark, V as black, Y as blueGrey100, X as blueGrey300, Z as blueGrey600, Q as blueGrey900, P as border, I as borderDark, L as borderGray, F as borderLight, le as buttonBorder, J as buttonFocusOutline, ue as buttonHoverBg, ne as color_exports, u as correct, d as correctSecondary, f as correctTertiary, p as correctWithIcon, i as defaults, c as disabled, l as disabledSecondary, j as dropdownBackground, C as fadedPrimary, W as focusChecked, G as focusCheckedBorder, K as focusUnchecked, q as focusUncheckedBorder, m as incorrect, g as incorrectSecondary, h as incorrectWithIcon, ce as keyBoardFocusIndicator, ie as keypadButton, $ as keypadButtonHover, ae as keypadButtonOperator, se as keypadButtonOperatorHover, oe as keypadEmptyPlaceholder, _ as missing, v as missingWithIcon, y as primary, x as primaryDark, b as primaryLight, S as primaryText, w as secondary, A as secondaryBackground, E as secondaryDark, T as secondaryLight, D as secondaryText, re as surface, R as tableGrid, z as tableGridLight, B as tableStripe, M as tertiary, N as tertiaryLight, s as text, U as transparent, a as v, de as visualElementsColors, H as white };
132
+ export { k as background, A as backgroundDark, H as black, X as blueGrey100, Z as blueGrey300, Q as blueGrey600, ie as blueGrey900, F as border, L as borderDark, R as borderGray, I as borderLight, ue as buttonBorder, Y as buttonFocusOutline, de as buttonHoverBg, ne as color_exports, d as correct, f as correctSecondary, p as correctTertiary, m as correctWithIcon, i as defaults, c as disabled, l as disabledSecondary, u as disabledText, re as dropdownBackground, w as fadedPrimary, G as focusChecked, K as focusCheckedBorder, q as focusUnchecked, J as focusUncheckedBorder, h as incorrect, _ as incorrectSecondary, g as incorrectWithIcon, le as keyBoardFocusIndicator, ae as keypadButton, se as keypadButtonHover, oe as keypadButtonOperator, ce as keypadButtonOperatorHover, $ as keypadEmptyPlaceholder, v as missing, y as missingWithIcon, b as primary, S as primaryDark, x as primaryLight, C as primaryText, T as secondary, j as secondaryBackground, D as secondaryDark, E as secondaryLight, O as secondaryText, M as surface, z as tableGrid, B as tableGridLight, V as tableStripe, N as tertiary, P as tertiaryLight, s as text, W as transparent, a as v, fe as visualElementsColors, U as white };
@@ -54,37 +54,37 @@ var l = o("div")(({ theme: r, tagName: i }) => ({
54
54
  static defaultProps = { onClick: () => {} };
55
55
  promptRef = r.createRef();
56
56
  parsedText = (e) => {
57
- let { customAudioButton: t } = this.props, n = document.createElement("div");
58
- n.innerHTML = e;
59
- let r = n.querySelector("audio");
60
- if (r) {
57
+ let { autoplayAudioEnabled: t, customAudioButton: n } = this.props, r = document.createElement("div");
58
+ r.innerHTML = e;
59
+ let i = r.querySelector("audio");
60
+ if (i) {
61
61
  let e = document.createElement("source");
62
- if (e.setAttribute("type", "audio/mp3"), e.setAttribute("src", r.getAttribute("src")), r.removeAttribute("src"), r.setAttribute("id", "pie-prompt-audio-player"), r.appendChild(e), t) {
63
- r.style.display = "none";
62
+ if (e.setAttribute("type", "audio/mp3"), e.setAttribute("src", i.getAttribute("src")), i.removeAttribute("src"), i.setAttribute("id", "pie-prompt-audio-player"), i.appendChild(e), n) {
63
+ i.style.display = "none";
64
64
  let e = document.createElement("div");
65
65
  e.id = "play-audio-button", Object.assign(e.style, {
66
66
  cursor: "pointer",
67
67
  display: "block",
68
68
  width: "128px",
69
69
  height: "128px",
70
- backgroundImage: `url(${t.pauseImage})`,
70
+ backgroundImage: `url(${t ? n.pauseImage : n.playImage})`,
71
71
  backgroundSize: "cover",
72
72
  borderRadius: "50%",
73
73
  border: "1px solid #326295"
74
- }), r.parentNode.insertBefore(e, r);
74
+ }), i.parentNode.insertBefore(e, i);
75
75
  }
76
76
  }
77
- return n.innerHTML;
77
+ return r.innerHTML;
78
78
  };
79
79
  addCustomAudioButtonControls() {
80
80
  let { autoplayAudioEnabled: e, customAudioButton: t } = this.props, n = document.getElementById("play-audio-button"), r = document.getElementById("pie-prompt-audio-player");
81
81
  if (e && r && r.play().then(() => {
82
82
  n && t && r.addEventListener("ended", a);
83
83
  }).catch((e) => {
84
- console.error("Error playing audio", e);
84
+ n && t && (n.style.backgroundImage = `url(${t.playImage})`), console.error("Error playing audio", e);
85
85
  }), !n || !r || !t) return;
86
86
  let i = () => {
87
- r.paused && (n.style.backgroundImage.includes(t.pauseImage) || r.play());
87
+ r.paused && r.play();
88
88
  }, a = () => {
89
89
  n.style.backgroundImage = `url(${t.playImage})`;
90
90
  }, o = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/render-ui",
3
- "version": "6.2.0-next.41",
3
+ "version": "6.2.0-next.42",
4
4
  "description": "Some shared ui elements when rendering - but not worthy of their own package yet.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,7 +13,7 @@
13
13
  "@mui/icons-material": "^7.3.4",
14
14
  "@mui/material": "^7.3.4",
15
15
  "@pie-lib/icons": "5.0.0-next.0",
16
- "@pie-lib/test-utils": "3.0.0-next.0",
16
+ "@pie-lib/test-utils": "3.0.0-next.1",
17
17
  "debug": "^4.1.1",
18
18
  "prop-types": "^15.7.2",
19
19
  "react-transition-group": "^4.4.5",