@linzjs/lui 17.49.0 → 17.49.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 +16 -0
- package/dist/components/LuiFormElements/LuiCheckboxInput/LuiCheckboxInput.d.ts +1 -1
- package/dist/components/LuiIcon/LuiIcon.d.ts +2 -2
- package/dist/components/LuiTooltip/LuiTooltip.d.ts +3 -3
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/lui.css +7 -0
- package/dist/lui.css.map +1 -1
- package/dist/lui.esm.js +11 -10
- package/dist/lui.esm.js.map +1 -1
- package/dist/scss/Elements/Tooltips/tippy.scss +9 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [17.49.2](https://github.com/linz/lui/compare/v17.49.1...v17.49.2) (2023-04-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* expose refs to allow for using tooltips with icons and checkboxes ([3c5ebd3](https://github.com/linz/lui/commit/3c5ebd3580547029d4b54647d766e0bd9ea7afa0))
|
|
7
|
+
|
|
8
|
+
## [17.49.1](https://github.com/linz/lui/compare/v17.49.0...v17.49.1) (2023-04-04)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* do not use React's PropsWithChildren and make message optional so people can just use the standard Tippy property "content" ([a750a47](https://github.com/linz/lui/commit/a750a47a1f46079686ae0d186a3be0ccf87207f3))
|
|
14
|
+
* ensure backward compatibility ([ffbb5ab](https://github.com/linz/lui/commit/ffbb5ab631a3ae9aa5a01941d29ac5043409fe7b))
|
|
15
|
+
* style paragraphs in tooltip ([1d4d3ad](https://github.com/linz/lui/commit/1d4d3ad717cc2372c883d7a946c0a7a9d6e251e3))
|
|
16
|
+
|
|
1
17
|
# [17.49.0](https://github.com/linz/lui/compare/v17.48.0...v17.49.0) (2023-04-04)
|
|
2
18
|
|
|
3
19
|
|
|
@@ -12,4 +12,4 @@ export interface LuiCheckboxProps {
|
|
|
12
12
|
titleAttribute?: string;
|
|
13
13
|
mandatory?: boolean;
|
|
14
14
|
}
|
|
15
|
-
export declare const LuiCheckboxInput:
|
|
15
|
+
export declare const LuiCheckboxInput: React.ForwardRefExoticComponent<LuiCheckboxProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICONS } from '../../assets/svg-content';
|
|
2
|
-
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import React, { InputHTMLAttributes } from 'react';
|
|
3
3
|
export declare type IconSize = keyof typeof ICON_SIZES;
|
|
4
4
|
export declare type IconStatus = keyof typeof ICON_STATUS;
|
|
5
5
|
export declare type IconName = keyof typeof ICONS;
|
|
@@ -32,4 +32,4 @@ export declare const ICON_STATUS: {
|
|
|
32
32
|
interactive: string;
|
|
33
33
|
disabled: string;
|
|
34
34
|
};
|
|
35
|
-
export declare const LuiIcon:
|
|
35
|
+
export declare const LuiIcon: React.ForwardRefExoticComponent<LuiIconProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { TippyProps } from '@tippyjs/react';
|
|
3
|
-
export declare type ILuiTooltipProperties =
|
|
4
|
-
message
|
|
3
|
+
export declare type ILuiTooltipProperties = TippyProps & {
|
|
4
|
+
message?: TippyProps['content'];
|
|
5
5
|
mode?: 'default' | 'info' | 'error';
|
|
6
6
|
};
|
|
7
7
|
export declare const LuiTooltip: (props: ILuiTooltipProperties) => JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -570,8 +570,8 @@ var ICON_STATUS = {
|
|
|
570
570
|
interactive: 'LuiIcon--interactive',
|
|
571
571
|
disabled: 'LuiIcon--disabled'
|
|
572
572
|
};
|
|
573
|
-
var LuiIcon = function (
|
|
574
|
-
var name =
|
|
573
|
+
var LuiIcon = React.forwardRef(function (props, ref) {
|
|
574
|
+
var name = props.name, className = props.className, _a = props.size, size = _a === void 0 ? 'ns' : _a, title = props.title, alt = props.alt, _b = props.status, status = _b === void 0 ? 'none' : _b, spanProps = props.spanProps, color = props.color;
|
|
575
575
|
var iconSVG = ICONS[name];
|
|
576
576
|
if (!iconSVG) {
|
|
577
577
|
console.warn("<LuiIcon>: No icon found for: ".concat(iconSVG));
|
|
@@ -579,8 +579,8 @@ var LuiIcon = function (_a) {
|
|
|
579
579
|
}
|
|
580
580
|
var customStyle = color
|
|
581
581
|
? __assign(__assign({}, spanProps === null || spanProps === void 0 ? void 0 : spanProps.style), { fill: color }) : spanProps === null || spanProps === void 0 ? void 0 : spanProps.style;
|
|
582
|
-
return (
|
|
583
|
-
};
|
|
582
|
+
return (React__default["default"].createElement("span", __assign({ ref: ref, className: clsx('LuiIcon', className, size && ICON_SIZES[size], status && ICON_STATUS[status]), "data-icon": name, title: title, "aria-label": alt }, spanProps, { style: customStyle }), iconSVG));
|
|
583
|
+
});
|
|
584
584
|
|
|
585
585
|
function getMaterialIconForLevel(level) {
|
|
586
586
|
switch (level) {
|
|
@@ -28181,10 +28181,10 @@ var LuiTextInput = React.forwardRef(function (props, ref) {
|
|
|
28181
28181
|
props.warning)))));
|
|
28182
28182
|
});
|
|
28183
28183
|
|
|
28184
|
-
var LuiCheckboxInput = function (props) {
|
|
28184
|
+
var LuiCheckboxInput = React.forwardRef(function (props, ref) {
|
|
28185
28185
|
var _a;
|
|
28186
28186
|
var id = useGenerateOrDefaultId((_a = props.inputProps) === null || _a === void 0 ? void 0 : _a.id);
|
|
28187
|
-
return (React__default["default"].createElement("div", { className: clsx('LuiCheckboxInput', {
|
|
28187
|
+
return (React__default["default"].createElement("div", { ref: ref, className: clsx('LuiCheckboxInput', {
|
|
28188
28188
|
'LuiCheckboxInput--isChecked': props.isChecked,
|
|
28189
28189
|
'LuiCheckboxInput--hasError': !!props.error,
|
|
28190
28190
|
'LuiCheckboxInput--isDisabled': !!props.isDisabled
|
|
@@ -28196,7 +28196,7 @@ var LuiCheckboxInput = function (props) {
|
|
|
28196
28196
|
props.label,
|
|
28197
28197
|
React__default["default"].createElement(LuiIcon, { name: props.isIndeterminate ? 'ic_zoom_out' : 'ic_check', size: "md", alt: props.isIndeterminate ? 'Indeterminate Check' : 'Check', className: "LuiCheckboxInput-labelCheck", title: props.titleAttribute }))),
|
|
28198
28198
|
props.error && (React__default["default"].createElement(LuiError, { className: "LuiCheckboxInput", error: props.error }))));
|
|
28199
|
-
};
|
|
28199
|
+
});
|
|
28200
28200
|
|
|
28201
28201
|
var LuiFileInputBox = function (props) {
|
|
28202
28202
|
var _a = React.useState(), file = _a[0], setFile = _a[1];
|
|
@@ -60178,8 +60178,9 @@ var index = /*#__PURE__*/forwardRef( /*#__PURE__*/TippyGenerator(tippy));
|
|
|
60178
60178
|
var Tippy = index;
|
|
60179
60179
|
|
|
60180
60180
|
var LuiTooltip = function (props) {
|
|
60181
|
-
var
|
|
60182
|
-
var
|
|
60181
|
+
var _a;
|
|
60182
|
+
var children = props.children, _b = props.content, content = _b === void 0 ? props.message : _b, _c = props.theme, theme = _c === void 0 ? (_a = props.mode) !== null && _a !== void 0 ? _a : 'default' : _c, _d = props.offset, offset = _d === void 0 ? [0, 18] : _d, _e = props.arrow, arrow = _e === void 0 ? false : _e, plugins = props.plugins, rest = __rest(props, ["children", "content", "theme", "offset", "arrow", "plugins"]);
|
|
60183
|
+
var tippyProps = __assign(__assign({}, rest), { content: content, theme: theme, offset: offset, arrow: arrow, plugins: __spreadArray(__spreadArray([], (plugins || []), true), [followCursor], false) });
|
|
60183
60184
|
return React__default["default"].createElement(Tippy, __assign({}, tippyProps), children);
|
|
60184
60185
|
};
|
|
60185
60186
|
|