@homebound/beam 3.0.0-alpha.5 → 3.0.0-alpha.6
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/README.md +5 -1
- package/dist/index.cjs +66 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +65 -32
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -69,4 +69,8 @@ In this way, Beam should be seen as a place to "copy & paste" start from, rather
|
|
|
69
69
|
|
|
70
70
|
## Alpha release
|
|
71
71
|
|
|
72
|
-
Beam
|
|
72
|
+
Beam follows [semantic releases](https://semantic-release.gitbook.io/semantic-release/recipes/release-workflow/pre-releases).
|
|
73
|
+
|
|
74
|
+
If you want to make an alpha release, just create/push to the `alpha` branch.
|
|
75
|
+
|
|
76
|
+
You don't need to create a PR for the `alpha` branch.
|
package/dist/index.cjs
CHANGED
|
@@ -221,6 +221,7 @@ __export(index_exports, {
|
|
|
221
221
|
formatValue: () => formatValue,
|
|
222
222
|
generateColumnId: () => generateColumnId,
|
|
223
223
|
getAlignment: () => getAlignment,
|
|
224
|
+
getColumnBorderCss: () => getColumnBorderCss,
|
|
224
225
|
getDateFormat: () => getDateFormat,
|
|
225
226
|
getFirstOrLastCellCss: () => getFirstOrLastCellCss,
|
|
226
227
|
getJustification: () => getJustification,
|
|
@@ -4085,6 +4086,12 @@ var CssBuilder = class _CssBuilder {
|
|
|
4085
4086
|
get onDisabled() {
|
|
4086
4087
|
return this.newCss({ selector: ":disabled" });
|
|
4087
4088
|
}
|
|
4089
|
+
get ifFirstOfType() {
|
|
4090
|
+
return this.newCss({ selector: ":first-of-type" });
|
|
4091
|
+
}
|
|
4092
|
+
get ifLastOfType() {
|
|
4093
|
+
return this.newCss({ selector: ":last-of-type" });
|
|
4094
|
+
}
|
|
4088
4095
|
/** Marks this element as a default hover marker (for ancestor pseudo selectors). */
|
|
4089
4096
|
get marker() {
|
|
4090
4097
|
return this;
|
|
@@ -4164,6 +4171,11 @@ var CssBuilder = class _CssBuilder {
|
|
|
4164
4171
|
addCss(props) {
|
|
4165
4172
|
return this.add(omitUndefinedValues(props));
|
|
4166
4173
|
}
|
|
4174
|
+
/** Marker for the build-time transform to append a raw className. */
|
|
4175
|
+
className(className) {
|
|
4176
|
+
void className;
|
|
4177
|
+
return this;
|
|
4178
|
+
}
|
|
4167
4179
|
/** Convert a style hash into `{ className, style }` props for manual spreading into non-`css=` contexts. */
|
|
4168
4180
|
props(styles) {
|
|
4169
4181
|
return (0, import_runtime.trussProps)(styles);
|
|
@@ -4191,7 +4203,7 @@ function px(pixels) {
|
|
|
4191
4203
|
return `${pixels}px`;
|
|
4192
4204
|
}
|
|
4193
4205
|
function omitUndefinedValues(value) {
|
|
4194
|
-
const entries = Object.entries(value).filter(
|
|
4206
|
+
const entries = Object.entries(value).filter(([, entryValue]) => {
|
|
4195
4207
|
return entryValue !== void 0;
|
|
4196
4208
|
});
|
|
4197
4209
|
return Object.fromEntries(entries);
|
|
@@ -5315,6 +5327,7 @@ var nonKindGridColumnKeys = [
|
|
|
5315
5327
|
"serverSideSortKey",
|
|
5316
5328
|
"clientSideSort",
|
|
5317
5329
|
"sticky",
|
|
5330
|
+
"border",
|
|
5318
5331
|
"wrapAction",
|
|
5319
5332
|
"isAction",
|
|
5320
5333
|
"id",
|
|
@@ -6035,6 +6048,19 @@ function getFirstOrLastCellCss(style, columnIndex, columns, colspan = 1) {
|
|
|
6035
6048
|
...columnIndex + colspan >= columns.length ? style.lastCellCss : {}
|
|
6036
6049
|
};
|
|
6037
6050
|
}
|
|
6051
|
+
function getColumnBorderCss(border, style) {
|
|
6052
|
+
if (!border) return {};
|
|
6053
|
+
return {
|
|
6054
|
+
...border === "left" ? {
|
|
6055
|
+
borderLeftStyle: "bl_borderLeftStyle",
|
|
6056
|
+
borderLeftWidth: "bl_borderLeftWidth"
|
|
6057
|
+
} : {
|
|
6058
|
+
borderRightStyle: "br_borderRightStyle",
|
|
6059
|
+
borderRightWidth: "br_borderRightWidth"
|
|
6060
|
+
},
|
|
6061
|
+
...style.borderStyle
|
|
6062
|
+
};
|
|
6063
|
+
}
|
|
6038
6064
|
function isJSX(content) {
|
|
6039
6065
|
return typeof content === "object" && content && "type" in content && "props" in content;
|
|
6040
6066
|
}
|
|
@@ -7314,6 +7340,9 @@ function memoizedTableStyles() {
|
|
|
7314
7340
|
borderRightWidth: "br_borderRightWidth",
|
|
7315
7341
|
borderColor: "bcGray200"
|
|
7316
7342
|
} : void 0,
|
|
7343
|
+
borderStyle: {
|
|
7344
|
+
borderColor: "bcGray200"
|
|
7345
|
+
},
|
|
7317
7346
|
firstRowCellCss: bordered ? {
|
|
7318
7347
|
borderTopStyle: "bt_borderTopStyle",
|
|
7319
7348
|
borderTopWidth: "bt_borderTopWidth",
|
|
@@ -8124,6 +8153,8 @@ function RowImpl(props) {
|
|
|
8124
8153
|
...isBodyRow && levelStyle?.cellCss,
|
|
8125
8154
|
// Level specific styling for the first content column
|
|
8126
8155
|
...applyFirstContentColumnStyles && levelStyle?.firstContentColumn,
|
|
8156
|
+
// Apply any declarative column border styling after header/body defaults.
|
|
8157
|
+
...getColumnBorderCss(column2.border, style),
|
|
8127
8158
|
// The specific cell's css (if any from GridCellContent)
|
|
8128
8159
|
...rowStyleCellCss,
|
|
8129
8160
|
// Apply active row styling for non-nested card styles.
|
|
@@ -8363,7 +8394,6 @@ function TextFieldBase(props) {
|
|
|
8363
8394
|
} = internalProps;
|
|
8364
8395
|
const errorMessageId = `${inputProps.id}-error`;
|
|
8365
8396
|
const labelSuffix = useLabelSuffix(required, inputProps.readOnly);
|
|
8366
|
-
const ElementType = multiline ? "textarea" : "input";
|
|
8367
8397
|
const tid = useTestIds(props, defaultTestId(label));
|
|
8368
8398
|
const [isFocused, setIsFocused] = (0, import_react26.useState)(false);
|
|
8369
8399
|
const {
|
|
@@ -8598,6 +8628,38 @@ function TextFieldBase(props) {
|
|
|
8598
8628
|
}
|
|
8599
8629
|
const showFocus = isFocused && !inputProps.readOnly || forceFocus;
|
|
8600
8630
|
const showHover = isHovered && !inputProps.disabled && !inputProps.readOnly && !isFocused || forceHover;
|
|
8631
|
+
const fieldElementProps = (0, import_react_aria8.mergeProps)(inputProps, {
|
|
8632
|
+
onBlur,
|
|
8633
|
+
onFocus: onFocusChained,
|
|
8634
|
+
onChange: onDomChange
|
|
8635
|
+
}, {
|
|
8636
|
+
"aria-invalid": Boolean(errorMsg),
|
|
8637
|
+
...labelStyle === "hidden" ? {
|
|
8638
|
+
"aria-label": label
|
|
8639
|
+
} : {}
|
|
8640
|
+
});
|
|
8641
|
+
const errorMessageProps = errorMsg ? {
|
|
8642
|
+
"aria-errormessage": errorMessageId
|
|
8643
|
+
} : {};
|
|
8644
|
+
const fieldElementCss = {
|
|
8645
|
+
...fieldStyles.input,
|
|
8646
|
+
...inputProps.disabled ? fieldStyles.disabled : {},
|
|
8647
|
+
...showHover ? fieldStyles.hover : {},
|
|
8648
|
+
...unfocusedPlaceholder && !isFocused && {
|
|
8649
|
+
position: "absolute",
|
|
8650
|
+
overflow: "oh",
|
|
8651
|
+
clip: "visuallyHidden_clip",
|
|
8652
|
+
clipPath: "visuallyHidden_clipPath",
|
|
8653
|
+
border: "visuallyHidden_border",
|
|
8654
|
+
height: "visuallyHidden_height",
|
|
8655
|
+
margin: "visuallyHidden_margin",
|
|
8656
|
+
width: "visuallyHidden_width",
|
|
8657
|
+
padding: "visuallyHidden_padding",
|
|
8658
|
+
whiteSpace: "wsnw",
|
|
8659
|
+
opacity: "o0"
|
|
8660
|
+
},
|
|
8661
|
+
...xss
|
|
8662
|
+
};
|
|
8601
8663
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
8602
8664
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { ...(0, import_runtime26.trussProps)(fieldStyles.container), ...groupProps, ...focusWithinProps, children: [
|
|
8603
8665
|
label && labelStyle !== "inline" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Label, { labelProps, hidden: labelStyle === "hidden" || compound, label, inline: labelStyle !== "above", suffix: labelSuffix, contrast, ...tid.label }),
|
|
@@ -8694,36 +8756,7 @@ function TextFieldBase(props) {
|
|
|
8694
8756
|
children: unfocusedPlaceholder
|
|
8695
8757
|
}
|
|
8696
8758
|
),
|
|
8697
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
8698
|
-
onBlur,
|
|
8699
|
-
onFocus: onFocusChained,
|
|
8700
|
-
onChange: onDomChange
|
|
8701
|
-
}, {
|
|
8702
|
-
"aria-invalid": Boolean(errorMsg),
|
|
8703
|
-
...labelStyle === "hidden" ? {
|
|
8704
|
-
"aria-label": label
|
|
8705
|
-
} : {}
|
|
8706
|
-
}), ...errorMsg ? {
|
|
8707
|
-
"aria-errormessage": errorMessageId
|
|
8708
|
-
} : {}, ref: fieldRef, rows: multiline ? 1 : void 0, ...(0, import_runtime26.trussProps)({
|
|
8709
|
-
...fieldStyles.input,
|
|
8710
|
-
...inputProps.disabled ? fieldStyles.disabled : {},
|
|
8711
|
-
...showHover ? fieldStyles.hover : {},
|
|
8712
|
-
...unfocusedPlaceholder && !isFocused && {
|
|
8713
|
-
position: "absolute",
|
|
8714
|
-
overflow: "oh",
|
|
8715
|
-
clip: "visuallyHidden_clip",
|
|
8716
|
-
clipPath: "visuallyHidden_clipPath",
|
|
8717
|
-
border: "visuallyHidden_border",
|
|
8718
|
-
height: "visuallyHidden_height",
|
|
8719
|
-
margin: "visuallyHidden_margin",
|
|
8720
|
-
width: "visuallyHidden_width",
|
|
8721
|
-
padding: "visuallyHidden_padding",
|
|
8722
|
-
whiteSpace: "wsnw",
|
|
8723
|
-
opacity: "o0"
|
|
8724
|
-
},
|
|
8725
|
-
...xss
|
|
8726
|
-
}), ...tid }),
|
|
8759
|
+
multiline ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("textarea", { ...fieldElementProps, ...errorMessageProps, ref: fieldRef, rows: 1, ...(0, import_runtime26.trussProps)(fieldElementCss), ...tid }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("input", { ...fieldElementProps, ...errorMessageProps, ref: fieldRef, ...(0, import_runtime26.trussProps)(fieldElementCss), ...tid }),
|
|
8727
8760
|
isFocused && clearable && onChange && inputProps.value && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(IconButton, { icon: "xCircle", color: "rgba(100, 100, 100, 1)" /* Gray700 */, onClick: () => {
|
|
8728
8761
|
onChange(void 0);
|
|
8729
8762
|
fieldRef.current?.focus();
|
|
@@ -22656,6 +22689,7 @@ function useToast() {
|
|
|
22656
22689
|
formatValue,
|
|
22657
22690
|
generateColumnId,
|
|
22658
22691
|
getAlignment,
|
|
22692
|
+
getColumnBorderCss,
|
|
22659
22693
|
getDateFormat,
|
|
22660
22694
|
getFirstOrLastCellCss,
|
|
22661
22695
|
getJustification,
|