@linzjs/lui 11.10.3 → 12.0.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.
- package/CHANGELOG.md +34 -0
- package/dist/assets/icons/lock.svg +1 -0
- package/dist/components/LuiFormElements/LuiTextInput/LuiTextInput.d.ts +4 -0
- package/dist/components/LuiFormElements/LuiTextInput/LuiTextInput.stories.d.ts +4 -0
- package/dist/components/LuiForms/LuiComboSelect/LuiComboSelect.d.ts +8 -2
- package/dist/components/LuiForms/LuiComboSelect/LuiComboSelect.stories.d.ts +68 -15
- package/dist/lui.cjs.development.js +22 -14
- package/dist/lui.cjs.development.js.map +1 -1
- package/dist/lui.cjs.production.min.js +1 -1
- package/dist/lui.cjs.production.min.js.map +1 -1
- package/dist/lui.css +98 -58
- package/dist/lui.css.map +1 -1
- package/dist/lui.esm.js +22 -14
- package/dist/lui.esm.js.map +1 -1
- package/dist/scss/Components/LuiFormElements/LuiSelectInput/LuiSelectInput.scss +40 -23
- package/dist/scss/Components/LuiFormElements/LuiTextAreaInput/LuiTextAreaInput.scss +47 -24
- package/dist/scss/Components/LuiFormElements/LuiTextInput/LuiTextInput.scss +21 -17
- package/dist/scss/Components/LuiForms/LuiComboSelect/LuiComboSelect.scss +5 -0
- package/dist/scss/Foundation/Variables/_LuiColors.scss +2 -1
- package/dist/scss/base.scss +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
## [12.0.1](https://github.com/linz/lui/compare/v12.0.0...v12.0.1) (2022-01-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* replaced colours with variables, fixed error classes not appeari… ([#518](https://github.com/linz/lui/issues/518)) ([e1651fa](https://github.com/linz/lui/commit/e1651fa5d5c0f244b36ac79a4b78d32c83c42949))
|
|
7
|
+
|
|
8
|
+
# [12.0.0](https://github.com/linz/lui/compare/v11.12.0...v12.0.0) (2022-01-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
* feat!(LuiComboSelect): Adds a required label prop to LuiComboSelect (#516) ([d8747f4](https://github.com/linz/lui/commit/d8747f46551e01d625f745fcea48cdf64691aeb5)), closes [#516](https://github.com/linz/lui/issues/516)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* Adds a required "label" prop to LuiComboSelect
|
|
17
|
+
Also exposes an optional "hideLabel" prop to not render a label (labels are still available to screen readers)
|
|
18
|
+
|
|
19
|
+
* Resolves conflict with new LuiComboSelect story
|
|
20
|
+
|
|
21
|
+
# [11.12.0](https://github.com/linz/lui/compare/v11.11.0...v11.12.0) (2022-01-13)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* **LuiSelectInput:** Update dropdown icon ([#515](https://github.com/linz/lui/issues/515)) ([322bc0f](https://github.com/linz/lui/commit/322bc0faf839e4f36ed24551bf069a6c6863f3cd))
|
|
27
|
+
|
|
28
|
+
# [11.11.0](https://github.com/linz/lui/compare/v11.10.3...v11.11.0) (2022-01-12)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* **LuiTextInput:** Add option for padlock icon ([#514](https://github.com/linz/lui/issues/514)) ([654f913](https://github.com/linz/lui/commit/654f9132b5f43b93cb9f57ef7b81fd0f01a0e18c))
|
|
34
|
+
|
|
1
35
|
## [11.10.3](https://github.com/linz/lui/compare/v11.10.2...v11.10.3) (2022-01-12)
|
|
2
36
|
|
|
3
37
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 22"><path d="M14 7.5H13V5.5C13 2.74 10.76 0.5 8 0.5C5.24 0.5 3 2.74 3 5.5V7.5H2C0.9 7.5 0 8.4 0 9.5V19.5C0 20.6 0.9 21.5 2 21.5H14C15.1 21.5 16 20.6 16 19.5V9.5C16 8.4 15.1 7.5 14 7.5ZM8 16.5C6.9 16.5 6 15.6 6 14.5C6 13.4 6.9 12.5 8 12.5C9.1 12.5 10 13.4 10 14.5C10 15.6 9.1 16.5 8 16.5ZM11.1 7.5H4.9V5.5C4.9 3.79 6.29 2.4 8 2.4C9.71 2.4 11.1 3.79 11.1 5.5V7.5Z" fill="#6B6966" /></svg>
|
|
@@ -9,6 +9,10 @@ export interface LuiTextInputProps {
|
|
|
9
9
|
* A red star will be shown next to the label, no validation will be performed based on this prop.
|
|
10
10
|
*/
|
|
11
11
|
mandatory?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* A padlock will be displayed on right side of input
|
|
14
|
+
*/
|
|
15
|
+
showPadlockIcon?: boolean;
|
|
12
16
|
value: string;
|
|
13
17
|
}
|
|
14
18
|
export declare function useGenerateOrDefaultId(idFromProps?: string): string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { GroupBase, Props, SelectInstance } from 'react-select';
|
|
3
|
-
export declare type LuiComboSelectProps<Option extends LuiComboSelectOption = LuiComboSelectOption, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> = Partial<Props<Option, IsMulti, Group>> & {
|
|
3
|
+
export declare type LuiComboSelectProps<Option extends LuiComboSelectOption = LuiComboSelectOption, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> = Partial<Props<Option, IsMulti, Group>> & {
|
|
4
|
+
label: JSX.Element | string;
|
|
5
|
+
hideLabel?: boolean;
|
|
6
|
+
};
|
|
4
7
|
export declare type LuiComboSelectOption = {
|
|
5
8
|
label: string;
|
|
6
9
|
value: string;
|
|
@@ -8,4 +11,7 @@ export declare type LuiComboSelectOption = {
|
|
|
8
11
|
/**
|
|
9
12
|
* A wrapper around React Select with Lui styling
|
|
10
13
|
*/
|
|
11
|
-
export declare const LuiComboSelect: React.ForwardRefExoticComponent<Partial<Props<LuiComboSelectOption, boolean, GroupBase<any>>> &
|
|
14
|
+
export declare const LuiComboSelect: React.ForwardRefExoticComponent<Partial<Props<LuiComboSelectOption, boolean, GroupBase<any>>> & {
|
|
15
|
+
label: JSX.Element | string;
|
|
16
|
+
hideLabel?: boolean | undefined;
|
|
17
|
+
} & React.RefAttributes<SelectInstance<LuiComboSelectOption, boolean, GroupBase<any>>>>;
|
|
@@ -1,17 +1,70 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const _default: import("@storybook/react").Meta<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> &
|
|
2
|
+
declare const _default: import("@storybook/react").Meta<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
3
|
+
label: string | JSX.Element;
|
|
4
|
+
hideLabel?: boolean | undefined;
|
|
5
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
3
6
|
export default _default;
|
|
4
|
-
export declare const blank: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> &
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export declare const
|
|
17
|
-
|
|
7
|
+
export declare const blank: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
8
|
+
label: string | JSX.Element;
|
|
9
|
+
hideLabel?: boolean | undefined;
|
|
10
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
11
|
+
export declare const withoutLabel: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
12
|
+
label: string | JSX.Element;
|
|
13
|
+
hideLabel?: boolean | undefined;
|
|
14
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
15
|
+
export declare const focus: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
16
|
+
label: string | JSX.Element;
|
|
17
|
+
hideLabel?: boolean | undefined;
|
|
18
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
19
|
+
export declare const open: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
20
|
+
label: string | JSX.Element;
|
|
21
|
+
hideLabel?: boolean | undefined;
|
|
22
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
23
|
+
export declare const autocomplete: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
24
|
+
label: string | JSX.Element;
|
|
25
|
+
hideLabel?: boolean | undefined;
|
|
26
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
27
|
+
export declare const foundNone: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
28
|
+
label: string | JSX.Element;
|
|
29
|
+
hideLabel?: boolean | undefined;
|
|
30
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
31
|
+
export declare const loadingSpinner: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
32
|
+
label: string | JSX.Element;
|
|
33
|
+
hideLabel?: boolean | undefined;
|
|
34
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
35
|
+
export declare const selected: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
36
|
+
label: string | JSX.Element;
|
|
37
|
+
hideLabel?: boolean | undefined;
|
|
38
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
39
|
+
export declare const selectedOpen: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
40
|
+
label: string | JSX.Element;
|
|
41
|
+
hideLabel?: boolean | undefined;
|
|
42
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
43
|
+
export declare const disabledBlank: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
44
|
+
label: string | JSX.Element;
|
|
45
|
+
hideLabel?: boolean | undefined;
|
|
46
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
47
|
+
export declare const disabledSelected: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
48
|
+
label: string | JSX.Element;
|
|
49
|
+
hideLabel?: boolean | undefined;
|
|
50
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
51
|
+
export declare const disabledWhileLoading: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
52
|
+
label: string | JSX.Element;
|
|
53
|
+
hideLabel?: boolean | undefined;
|
|
54
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
55
|
+
export declare const groupedOptions: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
56
|
+
label: string | JSX.Element;
|
|
57
|
+
hideLabel?: boolean | undefined;
|
|
58
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
59
|
+
export declare const isMulti: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & {
|
|
60
|
+
label: string | JSX.Element;
|
|
61
|
+
hideLabel?: boolean | undefined;
|
|
62
|
+
} & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
|
|
63
|
+
export declare const compareToInput: {
|
|
64
|
+
(): JSX.Element;
|
|
65
|
+
storyName: string;
|
|
66
|
+
};
|
|
67
|
+
export declare const CompareToLuiSelectInput: {
|
|
68
|
+
(): JSX.Element;
|
|
69
|
+
storyName: string;
|
|
70
|
+
};
|
|
@@ -989,7 +989,7 @@ var LuiTextInput = function LuiTextInput(props) {
|
|
|
989
989
|
className: "LuiTextInput-inputWrapper"
|
|
990
990
|
}, React__default.createElement("input", Object.assign({
|
|
991
991
|
type: 'text',
|
|
992
|
-
className: clsx('LuiTextInput-input'),
|
|
992
|
+
className: (props.showPadlockIcon ? 'LuiTextInput-padlock-icon ' : '') + clsx('LuiTextInput-input'),
|
|
993
993
|
min: "0",
|
|
994
994
|
value: props.value,
|
|
995
995
|
onChange: props.onChange
|
|
@@ -1166,11 +1166,11 @@ var extensionsAsHumanReadableList = function extensionsAsHumanReadableList(exten
|
|
|
1166
1166
|
};
|
|
1167
1167
|
|
|
1168
1168
|
var LuiSelectInput = function LuiSelectInput(props) {
|
|
1169
|
-
var _props$selectProps;
|
|
1169
|
+
var _props$selectProps, _props$selectProps2;
|
|
1170
1170
|
|
|
1171
1171
|
var id = useGenerateOrDefaultId((_props$selectProps = props.selectProps) == null ? void 0 : _props$selectProps.id);
|
|
1172
1172
|
return React__default.createElement("div", {
|
|
1173
|
-
className: 'LuiSelect'
|
|
1173
|
+
className: clsx('LuiSelect', (_props$selectProps2 = props.selectProps) != null && _props$selectProps2.disabled ? 'isDisabled' : '', props.error ? 'hasError' : '')
|
|
1174
1174
|
}, React__default.createElement("label", {
|
|
1175
1175
|
htmlFor: id,
|
|
1176
1176
|
className: "LuiSelect-label"
|
|
@@ -1195,9 +1195,9 @@ var LuiSelectInput = function LuiSelectInput(props) {
|
|
|
1195
1195
|
}, selection.label);
|
|
1196
1196
|
})), React__default.createElement(LuiIcon, {
|
|
1197
1197
|
alt: 'Error',
|
|
1198
|
-
name: "
|
|
1198
|
+
name: "ic_keyboard_arrow_down",
|
|
1199
1199
|
className: "LuiSelect-chevron-icon",
|
|
1200
|
-
size: "
|
|
1200
|
+
size: "md"
|
|
1201
1201
|
})), props.error && React__default.createElement("span", {
|
|
1202
1202
|
className: "LuiSelect-error"
|
|
1203
1203
|
}, React__default.createElement(LuiIcon, {
|
|
@@ -1210,23 +1210,25 @@ var LuiSelectInput = function LuiSelectInput(props) {
|
|
|
1210
1210
|
};
|
|
1211
1211
|
|
|
1212
1212
|
var LuiTextAreaInput = function LuiTextAreaInput(props) {
|
|
1213
|
-
var _props$inputProps;
|
|
1213
|
+
var _props$inputProps, _props$inputProps2;
|
|
1214
1214
|
|
|
1215
1215
|
var id = useGenerateOrDefaultId((_props$inputProps = props.inputProps) == null ? void 0 : _props$inputProps.id);
|
|
1216
1216
|
return React__default.createElement("div", {
|
|
1217
|
-
className: clsx('LuiTextAreaInput')
|
|
1217
|
+
className: clsx('LuiTextAreaInput', (_props$inputProps2 = props.inputProps) != null && _props$inputProps2.disabled ? 'isDisabled' : '', props != null && props.error ? 'hasError' : '')
|
|
1218
1218
|
}, React__default.createElement("label", {
|
|
1219
1219
|
htmlFor: id
|
|
1220
1220
|
}, props.mandatory && React__default.createElement("span", {
|
|
1221
1221
|
className: "LuiTextAreaInput-mandatory"
|
|
1222
1222
|
}, "*"), React__default.createElement("span", {
|
|
1223
1223
|
className: "LuiTextAreaInput-label"
|
|
1224
|
-
}, props.label), React__default.createElement("
|
|
1224
|
+
}, props.label), React__default.createElement("div", {
|
|
1225
|
+
className: "LuiTextAreaInput-wrapper"
|
|
1226
|
+
}, ' ', React__default.createElement("textarea", Object.assign({
|
|
1225
1227
|
id: id,
|
|
1226
1228
|
value: props.value,
|
|
1227
1229
|
onChange: props.onChange,
|
|
1228
1230
|
rows: 5
|
|
1229
|
-
}, props.inputProps))), props.error && React__default.createElement("span", {
|
|
1231
|
+
}, props.inputProps)))), props.error && React__default.createElement("span", {
|
|
1230
1232
|
className: "LuiTextAreaInput-error"
|
|
1231
1233
|
}, React__default.createElement(LuiIcon, {
|
|
1232
1234
|
alt: "error",
|
|
@@ -18123,16 +18125,22 @@ var LuiLoadingIndicator = function LuiLoadingIndicator() {
|
|
|
18123
18125
|
};
|
|
18124
18126
|
|
|
18125
18127
|
function LuiComboSelectActual(givenProps, ref) {
|
|
18126
|
-
var
|
|
18128
|
+
var props = Object.assign({
|
|
18127
18129
|
noOptionsMessage: function noOptionsMessage(i) {
|
|
18128
18130
|
return "No options found containing '" + i.inputValue + "'";
|
|
18129
18131
|
}
|
|
18130
|
-
};
|
|
18131
|
-
var props = Object.assign({}, defaultProps, givenProps);
|
|
18132
|
+
}, givenProps);
|
|
18132
18133
|
props.components = _extends({
|
|
18133
18134
|
LoadingIndicator: LuiLoadingIndicator
|
|
18134
18135
|
}, props.components);
|
|
18135
|
-
|
|
18136
|
+
var id = useGenerateOrDefaultId(props == null ? void 0 : props.id);
|
|
18137
|
+
return React__default.createElement("label", {
|
|
18138
|
+
htmlFor: id,
|
|
18139
|
+
className: "LuiComboSelect-label"
|
|
18140
|
+
}, React__default.createElement("span", {
|
|
18141
|
+
className: clsx('LuiSelect-label-text', props.hideLabel ? 'LuiScreenReadersOnly' : '')
|
|
18142
|
+
}, props.label), React__default.createElement(Select, Object.assign({
|
|
18143
|
+
inputId: id,
|
|
18136
18144
|
ref: ref
|
|
18137
18145
|
}, props, {
|
|
18138
18146
|
classNamePrefix: "LuiComboSelect",
|
|
@@ -18205,7 +18213,7 @@ function LuiComboSelectActual(givenProps, ref) {
|
|
|
18205
18213
|
});
|
|
18206
18214
|
}
|
|
18207
18215
|
}
|
|
18208
|
-
}));
|
|
18216
|
+
})));
|
|
18209
18217
|
}
|
|
18210
18218
|
|
|
18211
18219
|
var LuiShadow = function LuiShadow(props) {
|