@homebound/beam 2.323.0 → 2.324.1

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.
@@ -20,6 +20,8 @@ export interface RichTextFieldProps {
20
20
  onFocus?: () => void;
21
21
  /** For rendering formatted text */
22
22
  readOnly?: boolean;
23
+ /** Will set width to: 100% */
24
+ fullWidth?: boolean;
23
25
  }
24
26
  /**
25
27
  * Provides a simple rich text editor based on trix.
@@ -23,7 +23,7 @@ require("trix/dist/trix.css");
23
23
  * We also integrate [tributejs]{@link https://github.com/zurb/tribute} for @ mentions.
24
24
  */
25
25
  function RichTextField(props) {
26
- const { mergeTags, label, value = "", onChange, onBlur = utils_1.noop, onFocus = utils_1.noop, readOnly } = props;
26
+ const { mergeTags, label, value = "", onChange, onBlur = utils_1.noop, onFocus = utils_1.noop, readOnly, fullWidth } = props;
27
27
  // We get a reference to the Editor instance after trix-init fires
28
28
  const [editor, setEditor] = (0, react_2.useState)();
29
29
  const editorElement = (0, react_2.useRef)();
@@ -98,7 +98,7 @@ function RichTextField(props) {
98
98
  }, [value, readOnly, editor]);
99
99
  const { placeholder, autoFocus } = props;
100
100
  if (!readOnly) {
101
- return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.w100.maxw("550px").$, children: [label && (0, jsx_runtime_1.jsx)(Label_1.Label, { labelProps: {}, label: label }), (0, jsx_runtime_1.jsxs)("div", { css: { ...Css_1.Css.br4.bgWhite.$, ...trixCssOverrides }, children: [(0, jsx_runtime_1.jsx)("input", { type: "hidden", id: `input-${id}`, value: value }), (0, react_2.createElement)("trix-editor", {
101
+ return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.w100.if(!fullWidth).maxw("550px").$, children: [label && (0, jsx_runtime_1.jsx)(Label_1.Label, { labelProps: {}, label: label }), (0, jsx_runtime_1.jsxs)("div", { css: { ...Css_1.Css.br4.bgWhite.$, ...trixCssOverrides }, children: [(0, jsx_runtime_1.jsx)("input", { type: "hidden", id: `input-${id}`, value: value }), (0, react_2.createElement)("trix-editor", {
102
102
  id: id,
103
103
  input: `input-${id}`,
104
104
  // Autofocus attribute is case sensitive since this is standard HTML
@@ -107,7 +107,7 @@ function RichTextField(props) {
107
107
  })] }), (0, jsx_runtime_1.jsx)(react_1.Global, { styles: [tributeOverrides] })] }));
108
108
  }
109
109
  else {
110
- return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.w100.maxw("550px").$, children: [label && (0, jsx_runtime_1.jsx)(Label_1.Label, { label: label }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mh("120px").bgWhite.sm.gray900.bn.p1.br4.bGray300.ba.$, dangerouslySetInnerHTML: { __html: dompurify_1.default.sanitize(value) || placeholder || "" }, "data-readonly": "true" })] }));
110
+ return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.w100.if(!fullWidth).maxw("550px").$, children: [label && (0, jsx_runtime_1.jsx)(Label_1.Label, { label: label }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mh("120px").bgWhite.sm.gray900.bn.p1.br4.bGray300.ba.$, dangerouslySetInnerHTML: { __html: dompurify_1.default.sanitize(value) || placeholder || "" }, "data-readonly": "true" })] }));
111
111
  }
112
112
  }
113
113
  exports.RichTextField = RichTextField;
package/dist/utils/rtl.js CHANGED
@@ -188,6 +188,9 @@ function selectOption(select, optionValue) {
188
188
  if (!optionToSelect) {
189
189
  throw new Error(`Could not find option with value or text content of ${optionValue}`);
190
190
  }
191
+ if (optionToSelect.getAttribute("aria-disabled")) {
192
+ throw new Error(`Cannot select disabled option ${optionValue}`);
193
+ }
191
194
  (0, rtl_utils_1.click)(optionToSelect);
192
195
  }
193
196
  function getSelected(select) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.323.0",
3
+ "version": "2.324.1",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",