@luscii-healthtech/web-ui 58.17.0 → 58.18.0
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/dist/esm/components/Input/LabeledInput.js +5 -2
- package/dist/esm/components/Input/LabeledInput.js.map +1 -1
- package/dist/index.development.js +3 -2
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/Input/LabeledInput.d.ts +14 -3
- package/dist/src/generated/components/Input/LabeledInput.d.ts +14 -3
- package/dist/stories/LabeledInput.stories.d.ts +16 -0
- package/dist/web-ui-tailwind.css +3 -0
- package/package.json +1 -1
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { __rest } from '../../vendor/tslib/tslib.es6.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { calculateResponsiveWidthClasses } from '../../utils/responsiveness.utils.js';
|
|
4
6
|
import { Stack } from '../Stack/Stack.js';
|
|
5
7
|
import { HelperAndErrorText } from '../forms/shared/HelperAndErrorText.js';
|
|
6
8
|
import { LabelText } from '../forms/shared/LabelText.js';
|
|
7
9
|
import { StyledInput } from './StyledInput.js';
|
|
8
10
|
|
|
9
11
|
const LabeledInput = React__default.forwardRef((props, ref) => {
|
|
10
|
-
const { className, helperText, errorText, label, fullWidth, "aria-describedby": ariaDescribedBy } = props, rest = __rest(props, ["className", "helperText", "errorText", "label", "fullWidth", "aria-describedby"]);
|
|
12
|
+
const { className, helperText, errorText, label, width, fullWidth, "aria-describedby": ariaDescribedBy } = props, rest = __rest(props, ["className", "helperText", "errorText", "label", "width", "fullWidth", "aria-describedby"]);
|
|
11
13
|
const helperErrorTextId = React__default.useId();
|
|
12
|
-
|
|
14
|
+
const fieldWidth = width !== null && width !== void 0 ? width : fullWidth ? "full" : void 0;
|
|
15
|
+
return jsxs(Stack, { as: "label", _gap: "s", align: fieldWidth ? "stretch" : void 0, className: classNames(fieldWidth && calculateResponsiveWidthClasses(fieldWidth), className), children: [label && jsx(LabelText, { children: props.label }), jsx(StyledInput, Object.assign({}, rest, { ref, isError: Boolean(errorText), "aria-describedby": [ariaDescribedBy, helperErrorTextId].join(" ") })), jsx(HelperAndErrorText, { helperText, errorText, describingId: helperErrorTextId })] });
|
|
13
16
|
});
|
|
14
17
|
|
|
15
18
|
export { LabeledInput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabeledInput.js","sources":["../../../../../../src/components/Input/LabeledInput.tsx"],"sourcesContent":[null],"names":["React","_jsxs","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"LabeledInput.js","sources":["../../../../../../src/components/Input/LabeledInput.tsx"],"sourcesContent":[null],"names":["React","_jsxs","_jsx"],"mappings":";;;;;;;;;;AA0EO,MAAM,YAAA,GAAeA,cAAA,CAAM,UAAA,CAChC,CAAC,OAAO,GAAA,KAAO;AAIb,EAAA,MAAM,EACJ,WACA,UAAA,EACA,SAAA,EACA,OACA,KAAA,EACA,SAAA,EACA,kBAAA,EAAoB,eAAA,EAAe,GAEjC,KAAA,EADC,OAAI,MAAA,CACL,KAAA,EATE,CAAA,WAAA,EAAA,YAAA,EAAA,aAAA,OAAA,EAAA,OAAA,EAAA,WAAA,EAAA,kBAAA,CASL,CAAA;AAED,EAAA,MAAM,iBAAA,GAAoBA,eAAM,KAAA;AAChC,EAAA,MAAM,aAAa,KAAA,aAAA,UAAK,MAAA,GAAL,KAAA,GAAU,YAAY,MAAA,GAAS,MAAA;AAElD,EAAA,OACEC,IAAA,CAAC,KAAA,EAAK,EACJ,EAAA,EAAG,OAAA,EACH,IAAA,EAAK,GAAA,EACL,KAAA,EAAO,UAAA,GAAa,SAAA,GAAY,MAAA,EAChC,SAAA,EAAW,WACT,UAAA,IAAc,+BAAA,CAAgC,UAAU,CAAA,EACxD,SAAS,CAAA,aAGV,KAAA,IAASC,GAAA,CAAC,SAAA,EAAS,EAAA,QAAA,EAAE,KAAA,CAAM,KAAA,KAC5BA,GAAA,CAAC,WAAA,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EACN,IAAA,IACJ,GAAA,EACA,OAAA,EAAS,OAAA,CAAQ,SAAS,CAAA,EAAC,kBAAA,EACT,CAAC,eAAA,EAAiB,iBAAiB,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA,EAAC,CAAA,CAAA,EAGlEA,GAAA,CAAC,kBAAA,EAAkB,EACjB,UAAA,EACA,SAAA,EACA,YAAA,EAAc,iBAAA,EAAiB,CAC/B,GAAA,CAAA;AAGR,CAAC;;"}
|
|
@@ -3177,9 +3177,10 @@ const LabeledDatePicker = (_a) => {
|
|
|
3177
3177
|
};
|
|
3178
3178
|
|
|
3179
3179
|
const LabeledInput = React__namespace.default.forwardRef((props, ref) => {
|
|
3180
|
-
const { className, helperText, errorText, label, fullWidth, "aria-describedby": ariaDescribedBy } = props, rest = __rest(props, ["className", "helperText", "errorText", "label", "fullWidth", "aria-describedby"]);
|
|
3180
|
+
const { className, helperText, errorText, label, width, fullWidth, "aria-describedby": ariaDescribedBy } = props, rest = __rest(props, ["className", "helperText", "errorText", "label", "width", "fullWidth", "aria-describedby"]);
|
|
3181
3181
|
const helperErrorTextId = React__namespace.default.useId();
|
|
3182
|
-
|
|
3182
|
+
const fieldWidth = width !== null && width !== void 0 ? width : fullWidth ? "full" : void 0;
|
|
3183
|
+
return jsxRuntime.jsxs(Stack, { as: "label", _gap: "s", align: fieldWidth ? "stretch" : void 0, className: classNames__default.default(fieldWidth && calculateResponsiveWidthClasses(fieldWidth), className), children: [label && jsxRuntime.jsx(LabelText, { children: props.label }), jsxRuntime.jsx(StyledInput, Object.assign({}, rest, { ref, isError: Boolean(errorText), "aria-describedby": [ariaDescribedBy, helperErrorTextId].join(" ") })), jsxRuntime.jsx(HelperAndErrorText, { helperText, errorText, describingId: helperErrorTextId })] });
|
|
3183
3184
|
});
|
|
3184
3185
|
|
|
3185
3186
|
const LabeledRadio = React__namespace.default.forwardRef((props, ref) => {
|