@linzjs/lui 11.3.0 → 11.3.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 +7 -0
- package/dist/components/LuiFormElements/{RadioInput → LuiRadioInput}/LuiRadioInput.d.ts +6 -5
- package/dist/components/LuiFormElements/{RadioInput → LuiRadioInput}/LuiRadioInput.stories.d.ts +1 -1
- package/dist/components/LuiFormElements/{RadioInput → LuiRadioInput}/LuiRadioInputWithFormik.stories.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lui.cjs.development.js +26 -25
- 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.esm.js +26 -25
- package/dist/lui.esm.js.map +1 -1
- package/dist/scss/base.scss +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [11.3.1](https://github.com/linz/lui/compare/v11.3.0...v11.3.1) (2021-12-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Adds Styles for LuiRadioInput ([#500](https://github.com/linz/lui/issues/500)) ([038434e](https://github.com/linz/lui/commit/038434e19e449ae8946d6dc389bd5037b9be0f1f))
|
|
7
|
+
|
|
1
8
|
# [11.3.0](https://github.com/linz/lui/compare/v11.2.2...v11.3.0) (2021-12-20)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ChangeEventHandler, InputHTMLAttributes } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
onChange
|
|
2
|
+
import './LuiRadioInput.scss';
|
|
3
|
+
export interface LuiRadioProps {
|
|
4
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
5
|
+
selectedValue: string;
|
|
5
6
|
options: string[];
|
|
7
|
+
legend?: JSX.Element | string;
|
|
6
8
|
error?: string;
|
|
7
|
-
selectedValue: string;
|
|
8
9
|
isOptionDisabled?: (index: number) => boolean;
|
|
9
10
|
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
10
11
|
renderLabelFor?: (value: string) => JSX.Element;
|
|
11
12
|
}
|
|
12
|
-
export declare const LuiRadioInput: (props:
|
|
13
|
+
export declare const LuiRadioInput: (props: LuiRadioProps) => JSX.Element;
|
package/dist/components/LuiFormElements/{RadioInput → LuiRadioInput}/LuiRadioInput.stories.d.ts
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { BADGE } from '@geometricpanda/storybook-addon-badges';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: (props: import("./LuiRadioInput").
|
|
5
|
+
component: (props: import("./LuiRadioInput").LuiRadioProps) => JSX.Element;
|
|
6
6
|
parameters: {
|
|
7
7
|
badges: BADGE[];
|
|
8
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: (props: import("./LuiRadioInput").
|
|
4
|
+
component: (props: import("./LuiRadioInput").LuiRadioProps) => JSX.Element;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
export declare const LuiRadioButtonInputWithFormikHooks: {
|
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export { LuiFileInputBox } from './components/LuiFormElements/LuiFileInputBox/Lu
|
|
|
18
18
|
export { LuiSelectInput } from './components/LuiFormElements/LuiSelectInput/LuiSelectInput';
|
|
19
19
|
export { LuiTextAreaInput } from './components/LuiFormElements/LuiTextAreaInput/LuiTextAreaInput';
|
|
20
20
|
export { LuiTextInput } from './components/LuiFormElements/LuiTextInput/LuiTextInput';
|
|
21
|
-
export { LuiRadioInput } from './components/LuiFormElements/
|
|
21
|
+
export { LuiRadioInput } from './components/LuiFormElements/LuiRadioInput/LuiRadioInput';
|
|
22
22
|
export { LuiFormikCheckbox } from './components/LuiFormikForms/LuiFormikCheckbox/LuiFormikCheckbox';
|
|
23
23
|
export { LuiFormikTextInput } from './components/LuiFormikForms/LuiFormikTextInput/LuiFormikTextInput';
|
|
24
24
|
export { LuiFormikFormLabel } from './components/LuiFormikForms/LuiFormikFormLabel/LuiFormikFormLabel';
|
|
@@ -1245,49 +1245,50 @@ var LuiTextAreaInput = function LuiTextAreaInput(props) {
|
|
|
1245
1245
|
}), props.error));
|
|
1246
1246
|
};
|
|
1247
1247
|
|
|
1248
|
+
var css$5 = ":root {\n --grey-80: #2a292c;\n --grey-60: #6b6966;\n --$gray: #989189;\n --grey-20: #beb9b4;\n --grey-10: #eaeaea;\n --grey-05: #f9f9f9;\n --teal: #00425d;\n --sea: #007198;\n --electric: #0096cc;\n --spray: #73c8e1;\n --polar: #e2f3f7;\n --sherpa: #004b50;\n --surfie: #017a76;\n --persian: #00a599;\n --downy: #73cdc8;\n --iceberg: #dcf5f0;\n --sacramento: #004e32;\n --salem: #08814d;\n --pigment: #0aa245;\n --granny: #9bd79b;\n --panache: #e9fae7;\n --brand-primary: #004b50;\n --brand-secondary: #017a76;\n --success: #0aa245;\n --success-bg: #e9fae7;\n --info: #3a7cdf;\n --info-bg: #d8e5f9;\n --warning: #ea6a2e;\n --warning-bg: #fbdfd2;\n --error: #cc0000;\n --error-focus: #5a0000;\n --error-bg: #f5cccc;\n --visited: #00425d;\n --green-hover: #08814d;\n --color-green-active: #004e32;\n --green-btn: #0aa245;\n --txt-link: #0096cc;\n --color-primary-hover-btn: #007198;\n --color-selection: #c7e9f3;\n --heading-color: #017a76;\n --heading-color--secondary: #2a292c;\n --base-type-color: #2a292c;\n --base-icon-color: #007198;\n --disabled-color: #989189;\n --disabled-color-dark: #6b6966;\n --linz-color-primary: #023d48;\n --linz-color-primary-hover: #01818a;\n --linz-color-tertiary: #e1e44a;\n --linz-color-tertiary-hover: #cdcf59;\n --color-test-pink: #f09;\n --linz-linear-gradient-blue: linear-gradient(70deg, #00425d 12%, #007198 100%);\n --linz-linear-gradient-teal: linear-gradient(270deg, #00a599 1%, #73cdc8 100%);\n}\n\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiRadioInput_LuiRadioInputFieldset__c10e594c {\n border: none;\n padding: 0;\n}\n\n.LuiRadioInput_LuiRadioInputInput__c10e594c {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n margin: 0 !important;\n padding: 0 !important;\n overflow: hidden !important;\n clip: rect(0 0 0 0) !important;\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n border: 0 !important;\n white-space: nowrap !important;\n}\n\n.LuiRadioInput_LuiRadioInputLegend__c10e594c {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: 600;\n}\n\n.LuiRadioInput_LuiRadioInputLabel__c10e594c {\n position: relative;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n cursor: pointer;\n padding: 0.5rem 0 0.5rem 2rem;\n}\n.LuiRadioInput_LuiRadioInputLabel__c10e594c:before {\n content: \"\";\n height: 1.5rem;\n min-width: 1.5rem;\n width: 1.5rem;\n border: 2px solid #007198;\n border-radius: 50%;\n background-color: transparent;\n position: absolute;\n left: 0;\n top: 8px;\n margin-right: 0.75rem;\n}\n.LuiRadioInput_LuiRadioInputLabel__c10e594c:after {\n content: \"\";\n position: absolute;\n left: 5px;\n top: 13px;\n background-color: #007198;\n height: 14px;\n min-width: 14px;\n width: 14px;\n border-radius: 50%;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n}\n.LuiRadioInput_LuiRadioInputLabel_IsSelected__c10e594c:after {\n opacity: 1;\n}\n.LuiRadioInput_LuiRadioInputLabel_IsDisabled__c10e594c {\n color: #989189;\n}\n.LuiRadioInput_LuiRadioInputLabel_IsDisabled__c10e594c:before {\n background-color: #eaeaea;\n border-color: #989189;\n}\n\n.LuiRadioInput_LuiRadioInput_HasError__c10e594c .LuiRadioInput_LuiRadioInputLabel__c10e594c:before {\n border-color: #cc0000;\n}\n\n.LuiRadioInput_LuiRadioInputErrorMsg__c10e594c {\n display: flex;\n margin-top: 0.5rem;\n}\n.LuiRadioInput_LuiRadioInputErrorMsg__c10e594c .LuiRadioInput_LuiIcon_Error__c10e594c {\n margin-right: 0.5rem;\n}\n.LuiRadioInput_LuiRadioInputErrorMsg__c10e594c p {\n margin: 0;\n}";
|
|
1249
|
+
n(css$5,{});
|
|
1250
|
+
|
|
1248
1251
|
var LuiRadioInput = function LuiRadioInput(props) {
|
|
1249
1252
|
var _props$inputProps;
|
|
1250
1253
|
|
|
1251
1254
|
var id = useGenerateOrDefaultId((_props$inputProps = props.inputProps) == null ? void 0 : _props$inputProps.id);
|
|
1252
|
-
return React__default.createElement("
|
|
1253
|
-
className: 'LuiRadioInput'
|
|
1255
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
1256
|
+
className: clsx('LuiRadioInput', {
|
|
1257
|
+
'LuiRadioInput--hasError': props.error
|
|
1258
|
+
})
|
|
1259
|
+
}, React__default.createElement("fieldset", {
|
|
1260
|
+
className: 'LuiRadioInput-fieldset'
|
|
1254
1261
|
}, props.legend && React__default.createElement("legend", {
|
|
1255
1262
|
className: "LuiRadioInput-legend"
|
|
1256
1263
|
}, props.legend), props.options.map(function (option, index) {
|
|
1257
1264
|
var radioId = id + "-" + index;
|
|
1258
|
-
var
|
|
1265
|
+
var isSelected = props.selectedValue === option;
|
|
1259
1266
|
var isDisabled = props.isOptionDisabled && props.isOptionDisabled(index);
|
|
1260
|
-
return React__default.createElement("
|
|
1261
|
-
className: clsx('LuiRadioInput-option', {
|
|
1262
|
-
isDisabled: isDisabled
|
|
1263
|
-
}),
|
|
1264
|
-
key: radioId
|
|
1265
|
-
}, React__default.createElement("label", {
|
|
1267
|
+
return React__default.createElement("label", {
|
|
1266
1268
|
htmlFor: radioId,
|
|
1267
|
-
className:
|
|
1269
|
+
className: clsx('LuiRadioInput-label', {
|
|
1270
|
+
'LuiRadioInput-label--isDisabled': isDisabled,
|
|
1271
|
+
'LuiRadioInput-label--isSelected': isSelected
|
|
1272
|
+
}),
|
|
1268
1273
|
key: radioId
|
|
1269
1274
|
}, React__default.createElement("input", Object.assign({
|
|
1270
1275
|
disabled: isDisabled,
|
|
1271
|
-
className: "LuiRadioInput-
|
|
1276
|
+
className: "LuiRadioInput-input",
|
|
1272
1277
|
type: "radio",
|
|
1273
1278
|
id: radioId,
|
|
1274
1279
|
name: option,
|
|
1275
1280
|
value: option,
|
|
1276
|
-
checked:
|
|
1281
|
+
checked: isSelected,
|
|
1277
1282
|
onChange: props.onChange
|
|
1278
|
-
}, props.inputProps)),
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
})
|
|
1282
|
-
}), props.renderLabelFor ? props.renderLabelFor(option) : option));
|
|
1283
|
-
}), props.error && React__default.createElement("div", {
|
|
1284
|
-
className: "LuiRadioInput-error"
|
|
1283
|
+
}, props.inputProps)), props.renderLabelFor ? props.renderLabelFor(option) : option);
|
|
1284
|
+
})), props.error && React__default.createElement("div", {
|
|
1285
|
+
className: "LuiRadioInput-errorMsg"
|
|
1285
1286
|
}, React__default.createElement(LuiIcon, {
|
|
1286
1287
|
alt: 'error',
|
|
1287
1288
|
name: "ic_error",
|
|
1288
|
-
size: "
|
|
1289
|
+
size: "md",
|
|
1289
1290
|
status: "error"
|
|
1290
|
-
}), React__default.createElement("
|
|
1291
|
+
}), React__default.createElement("p", null, props.error))));
|
|
1291
1292
|
};
|
|
1292
1293
|
|
|
1293
1294
|
function LuiFormikCheckbox(props) {
|
|
@@ -18115,9 +18116,9 @@ function isChromatic() {
|
|
|
18115
18116
|
return !!((_window = window) != null && _window.navigator.userAgent.match(/Chromatic/) || (_window2 = window) != null && _window2.location.href.match(/chromatic=true/));
|
|
18116
18117
|
}
|
|
18117
18118
|
|
|
18118
|
-
var css$
|
|
18119
|
+
var css$6 = ":root {\n --grey-80: #2a292c;\n --grey-60: #6b6966;\n --$gray: #989189;\n --grey-20: #beb9b4;\n --grey-10: #eaeaea;\n --grey-05: #f9f9f9;\n --teal: #00425d;\n --sea: #007198;\n --electric: #0096cc;\n --spray: #73c8e1;\n --polar: #e2f3f7;\n --sherpa: #004b50;\n --surfie: #017a76;\n --persian: #00a599;\n --downy: #73cdc8;\n --iceberg: #dcf5f0;\n --sacramento: #004e32;\n --salem: #08814d;\n --pigment: #0aa245;\n --granny: #9bd79b;\n --panache: #e9fae7;\n --brand-primary: #004b50;\n --brand-secondary: #017a76;\n --success: #0aa245;\n --success-bg: #e9fae7;\n --info: #3a7cdf;\n --info-bg: #d8e5f9;\n --warning: #ea6a2e;\n --warning-bg: #fbdfd2;\n --error: #cc0000;\n --error-focus: #5a0000;\n --error-bg: #f5cccc;\n --visited: #00425d;\n --green-hover: #08814d;\n --color-green-active: #004e32;\n --green-btn: #0aa245;\n --txt-link: #0096cc;\n --color-primary-hover-btn: #007198;\n --color-selection: #c7e9f3;\n --heading-color: #017a76;\n --heading-color--secondary: #2a292c;\n --base-type-color: #2a292c;\n --base-icon-color: #007198;\n --disabled-color: #989189;\n --disabled-color-dark: #6b6966;\n --linz-color-primary: #023d48;\n --linz-color-primary-hover: #01818a;\n --linz-color-tertiary: #e1e44a;\n --linz-color-tertiary-hover: #cdcf59;\n --color-test-pink: #f09;\n --linz-linear-gradient-blue: linear-gradient(70deg, #00425d 12%, #007198 100%);\n --linz-linear-gradient-teal: linear-gradient(270deg, #00a599 1%, #73cdc8 100%);\n}";
|
|
18119
18120
|
var modules_5b17bb95 = {"charcoal":"#2a292c","fuscous":"#6b6966","gray":"#989189","silver":"#beb9b4","lily":"#eaeaea","hint":"#f9f9f9","snow":"#ffffff","white":"#ffffff","teal":"#00425d","sea":"#007198","electric":"#0096cc","spray":"#73c8e1","polar":"#e2f3f7","sherpa":"#004b50","surfie":"#017a76","persian":"#00a599","downy":"#73cdc8","iceberg":"#dcf5f0","sacramento":"#004e32","salem":"#08814d","pigment":"#0aa245","granny":"#9bd79b","panache":"#e9fae7","brand-primary":"#004b50","brand-secondary":"#017a76","error":"#cc0000","error-bg":"#f5cccc","error-focus":"#5a0000","warning":"#ea6a2e","warning-bg":"#fbdfd2","warning-focus":"#b33a01","success":"#0aa245","success-bg":"#e9fae7","info":"#3a7cdf","info-bg":"#d8e5f9","visited":"#00425d","green-hover":"#08814d","green-active":"#004e32","green-btn":"#0aa245","txt-link":"#0096cc","primary-hover-btn":"#007198","selection":"#c7e9f3","heading-color":"#017a76","heading-color--secondary":"#2a292c","base-type-color":"#2a292c","base-icon-color":"#007198","disabled-color":"#989189","disabled-color-dark":"#6b6966","linz-color-primary":"#023d48","linz-color-primary-hover":"#01818a","linz-color-tertiary":"#e1e44a","linz-color-tertiary-hover":"#cdcf59","color-test-pink":"#f09","linz-linear-gradient-blue":"linear-gradient(70deg, #00425d 12%, #007198 100%)","linz-linear-gradient-teal":"linear-gradient(270deg, #00a599 1%, #73cdc8 100%)"};
|
|
18120
|
-
n(css$
|
|
18121
|
+
n(css$6,{});
|
|
18121
18122
|
|
|
18122
18123
|
/**
|
|
18123
18124
|
* A wrapper around React Select with Lui styling
|
|
@@ -18199,8 +18200,8 @@ function LuiComboSelectActual(givenProps, ref) {
|
|
|
18199
18200
|
}));
|
|
18200
18201
|
}
|
|
18201
18202
|
|
|
18202
|
-
var css$
|
|
18203
|
-
n(css$
|
|
18203
|
+
var css$7 = ":root {\n --grey-80: #2a292c;\n --grey-60: #6b6966;\n --$gray: #989189;\n --grey-20: #beb9b4;\n --grey-10: #eaeaea;\n --grey-05: #f9f9f9;\n --teal: #00425d;\n --sea: #007198;\n --electric: #0096cc;\n --spray: #73c8e1;\n --polar: #e2f3f7;\n --sherpa: #004b50;\n --surfie: #017a76;\n --persian: #00a599;\n --downy: #73cdc8;\n --iceberg: #dcf5f0;\n --sacramento: #004e32;\n --salem: #08814d;\n --pigment: #0aa245;\n --granny: #9bd79b;\n --panache: #e9fae7;\n --brand-primary: #004b50;\n --brand-secondary: #017a76;\n --success: #0aa245;\n --success-bg: #e9fae7;\n --info: #3a7cdf;\n --info-bg: #d8e5f9;\n --warning: #ea6a2e;\n --warning-bg: #fbdfd2;\n --error: #cc0000;\n --error-focus: #5a0000;\n --error-bg: #f5cccc;\n --visited: #00425d;\n --green-hover: #08814d;\n --color-green-active: #004e32;\n --green-btn: #0aa245;\n --txt-link: #0096cc;\n --color-primary-hover-btn: #007198;\n --color-selection: #c7e9f3;\n --heading-color: #017a76;\n --heading-color--secondary: #2a292c;\n --base-type-color: #2a292c;\n --base-icon-color: #007198;\n --disabled-color: #989189;\n --disabled-color-dark: #6b6966;\n --linz-color-primary: #023d48;\n --linz-color-primary-hover: #01818a;\n --linz-color-tertiary: #e1e44a;\n --linz-color-tertiary-hover: #cdcf59;\n --color-test-pink: #f09;\n --linz-linear-gradient-blue: linear-gradient(70deg, #00425d 12%, #007198 100%);\n --linz-linear-gradient-teal: linear-gradient(270deg, #00a599 1%, #73cdc8 100%);\n}\n\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiShadow_LuiShadow__a0705fc2 {\n box-shadow: 0 0 1.5rem 1px rgba(0, 113, 152, 0.1);\n border-radius: 5px;\n padding: 1.5rem;\n margin-top: 0.75rem;\n background-color: #ffffff;\n}";
|
|
18204
|
+
n(css$7,{});
|
|
18204
18205
|
|
|
18205
18206
|
var LuiShadow = function LuiShadow(props) {
|
|
18206
18207
|
return React__default.createElement("div", {
|