@linzjs/lui 21.38.0 → 21.38.2
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/CHANGELOG.md +14 -0
- package/dist/components/LuiColourPicker/ColorInput.d.ts +2 -2
- package/dist/index.js +14 -8
- package/dist/index.js.map +1 -1
- package/dist/lui.esm.js +14 -8
- package/dist/lui.esm.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [21.38.2](https://github.com/linz/lui/compare/v21.38.1...v21.38.2) (2024-07-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **LuiModalV2:** only call setAppElement when modal mounts ([#1131](https://github.com/linz/lui/issues/1131)) ([10bea9a](https://github.com/linz/lui/commit/10bea9ab56258dec28aba99634bb0240bf52d92c))
|
|
7
|
+
|
|
8
|
+
## [21.38.1](https://github.com/linz/lui/compare/v21.38.0...v21.38.1) (2024-07-01)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **ColorPalette:** prevent id errors ([#1130](https://github.com/linz/lui/issues/1130)) ([1925e57](https://github.com/linz/lui/commit/1925e576760f523e2b3170ff3a9263b1d1c9bb07))
|
|
14
|
+
|
|
1
15
|
# [21.38.0](https://github.com/linz/lui/compare/v21.37.0...v21.38.0) (2024-07-01)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -5,5 +5,5 @@ export declare const ColorInput: React.ForwardRefExoticComponent<{
|
|
|
5
5
|
name: string;
|
|
6
6
|
color: string;
|
|
7
7
|
description?: string | undefined;
|
|
8
|
-
label?: Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "aria-label" | "htmlFor"> | undefined;
|
|
9
|
-
} & Omit<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "
|
|
8
|
+
label?: Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "title" | "aria-label" | "htmlFor"> | undefined;
|
|
9
|
+
} & Omit<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "name" | "type" | "value"> & React.RefAttributes<HTMLInputElement>>;
|
package/dist/index.js
CHANGED
|
@@ -42264,6 +42264,11 @@ var LuiModalV2 = function (props) {
|
|
|
42264
42264
|
var showHelpButton = Boolean(props.helpLink);
|
|
42265
42265
|
var showButtons = showCloseButton || showHelpButton;
|
|
42266
42266
|
var showHeadingIcon = props.headingIcon && !props.isLoading;
|
|
42267
|
+
// this is here for the tests
|
|
42268
|
+
React.useEffect(function () {
|
|
42269
|
+
if (isProcess && !isTest)
|
|
42270
|
+
Modal.setAppElement('#root');
|
|
42271
|
+
}, []);
|
|
42267
42272
|
return (React__default["default"].createElement(Modal, { key: props.key, isOpen: true,
|
|
42268
42273
|
// disble the `shouldClose` props as we handle them ourselves
|
|
42269
42274
|
shouldCloseOnOverlayClick: false, shouldCloseOnEsc: false, overlayClassName: "modal", className: props.lowContrast ? 'lui-scrim-low-contrast' : 'lui-scrim',
|
|
@@ -42304,10 +42309,8 @@ var HeaderTitle = function (props) {
|
|
|
42304
42309
|
return ReactDOM.createPortal(React__default["default"].createElement("h2", { className: clsx('lui-modal-v2-header-title lui-modal-v2-header-title-portal', props.className) }, props.children), target);
|
|
42305
42310
|
};
|
|
42306
42311
|
LuiModalV2.HeaderTitle = HeaderTitle;
|
|
42307
|
-
|
|
42308
|
-
var isTest =
|
|
42309
|
-
if (!isTest)
|
|
42310
|
-
Modal.setAppElement('#root');
|
|
42312
|
+
var isProcess = typeof process !== 'undefined';
|
|
42313
|
+
var isTest = isProcess && ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'test';
|
|
42311
42314
|
|
|
42312
42315
|
var LuiAlertModalV2 = function (props) {
|
|
42313
42316
|
var level = props.level, className = props.className, children = props.children, rest = __rest(props, ["level", "className", "children"]);
|
|
@@ -59351,10 +59354,13 @@ var ColorInputGroup = React.forwardRef(function (props, ref) {
|
|
|
59351
59354
|
return (React__default["default"].createElement("div", __assign({ ref: ref }, props, { role: (_a = props.role) !== null && _a !== void 0 ? _a : 'lui-input-color-group', className: clsx('lui-input-color-group', props.className) })));
|
|
59352
59355
|
});
|
|
59353
59356
|
var ColorInput = React.forwardRef(function (props, ref) {
|
|
59354
|
-
var
|
|
59357
|
+
var _a;
|
|
59358
|
+
var randomId = $bdb11010cef70236$export$f680877a34711e37();
|
|
59359
|
+
var name = props.name, color = props.color, description = props.description, label = props.label, _b = props.id, id = _b === void 0 ? randomId : _b, input = __rest(props, ["name", "color", "description", "label", "id"]);
|
|
59360
|
+
var title = description || color;
|
|
59355
59361
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
59356
|
-
React__default["default"].createElement("input", __assign({ ref: ref }, input, { name: name, type: "radio", id:
|
|
59357
|
-
React__default["default"].createElement("label", __assign({}, label, { htmlFor:
|
|
59362
|
+
React__default["default"].createElement("input", __assign({ ref: ref }, input, { title: (_a = input.title) !== null && _a !== void 0 ? _a : title, name: name, type: "radio", id: id, value: color, className: clsx('lui-input-color-radio', input.className) })),
|
|
59363
|
+
React__default["default"].createElement("label", __assign({}, label, { htmlFor: id, style: __assign(__assign({}, label === null || label === void 0 ? void 0 : label.style), { color: color, backgroundColor: color }), className: clsx('lui-input-colour-label', label === null || label === void 0 ? void 0 : label.className), "aria-label": description || color, title: description }))));
|
|
59358
59364
|
});
|
|
59359
59365
|
|
|
59360
59366
|
/**
|
|
@@ -59367,7 +59373,7 @@ var ColorInput = React.forwardRef(function (props, ref) {
|
|
|
59367
59373
|
var ColorPalette = React.forwardRef(function (_a, ref) {
|
|
59368
59374
|
var _b;
|
|
59369
59375
|
var _c = _a.selected, selected = _c === void 0 ? (_b = defaultColours[0]) === null || _b === void 0 ? void 0 : _b.color : _c, onSelect = _a.onSelect; _a.children; var name = _a.name, className = _a.className, divProps = __rest(_a, ["selected", "onSelect", "children", "name", "className"]);
|
|
59370
|
-
var colourGroupIdentifier =
|
|
59376
|
+
var colourGroupIdentifier = $bdb11010cef70236$export$f680877a34711e37();
|
|
59371
59377
|
return (React__default["default"].createElement(ColorInputGroup, __assign({ ref: ref }, divProps, { className: clsx('lui-color-picker', className) }), defaultColours.map(function (_a) {
|
|
59372
59378
|
var color = _a.color, description = _a.description;
|
|
59373
59379
|
return (React__default["default"].createElement(ColorInput, __assign({ key: color, name: name !== null && name !== void 0 ? name : colourGroupIdentifier }, { color: color, description: description }, { checked: color === selected, onChange: function () { return onSelect(color); } })));
|