@odx/websites-react 1.0.75 → 1.1.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/components/actions/text-input/TextInput.d.ts +7 -0
- package/dist/components/actions/text-input/TextInput.d.ts.map +1 -1
- package/dist/components/actions/text-input/TextInput.js +16 -3
- package/dist/components/actions/text-input/TextInput.js.map +1 -1
- package/dist/components/layout/structuredList/StructuredList.d.ts +1 -0
- package/dist/components/layout/structuredList/StructuredList.d.ts.map +1 -1
- package/dist/components/layout/structuredList/StructuredList.js +4 -4
- package/dist/components/layout/structuredList/StructuredList.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type FormFieldWrapperVariants, type FormField } from '../formField';
|
|
3
|
+
import { IconProps } from '../../images-icons/icon';
|
|
3
4
|
export interface TextInputProps extends TextInputPrimitiveProps, FormField {
|
|
4
5
|
}
|
|
5
6
|
export interface TextInputPrimitiveProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, FormFieldWrapperVariants {
|
|
6
7
|
invalid?: boolean;
|
|
8
|
+
showSearchIcon?: boolean;
|
|
9
|
+
leadingIcon?: {
|
|
10
|
+
show: boolean;
|
|
11
|
+
iconName: IconProps['name'];
|
|
12
|
+
};
|
|
7
13
|
icons?: React.ReactNode;
|
|
14
|
+
iconLeft?: React.ReactNode;
|
|
8
15
|
}
|
|
9
16
|
declare const TextInputPrimitive: React.ForwardRefExoticComponent<TextInputPrimitiveProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
17
|
declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/text-input/TextInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/text-input/TextInput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAML,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAElD,MAAM,WAAW,cAAe,SAAQ,uBAAuB,EAAE,SAAS;CAAG;AAE7E,MAAM,WAAW,uBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,EAC/D,wBAAwB;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE;QAAC,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;KAAC,CAAC;IAC3D,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,kBAAkB,kGAsCvB,CAAC;AAGF,QAAA,MAAM,SAAS,yFA+Ed,CAAC;AAGF,OAAO,EAAC,SAAS,EAAE,kBAAkB,EAAC,CAAC"}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { cn } from '../../../utils';
|
|
4
5
|
import { useFieldId } from '../../../hooks';
|
|
5
6
|
import { FormFieldWrapper, FormFieldIconsContainer, FormFieldLabel, FormFieldIcon, FormFieldHelperText, } from '../formField';
|
|
6
|
-
const TextInputPrimitive = React.forwardRef(({ className, invalid, size, icons,
|
|
7
|
+
const TextInputPrimitive = React.forwardRef(({ className, invalid, size, icons, iconLeft, leadingIcon, ...inputProps }, ref) => {
|
|
8
|
+
const [hasInputText, setHasInputText] = React.useState(false);
|
|
9
|
+
const handleChange = (e) => {
|
|
10
|
+
setHasInputText(e.target.value.length > 0);
|
|
11
|
+
if (inputProps.onChange) {
|
|
12
|
+
inputProps.onChange(e);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const showLeftIcon = iconLeft && !invalid && !hasInputText && leadingIcon?.show;
|
|
16
|
+
return (_jsxs("div", { className: "inline-flex relative w-full", children: [showLeftIcon && (_jsx(FormFieldIconsContainer, { align: "left", className: "pointer-events-none", children: iconLeft })), _jsx(FormFieldWrapper, { className: cn(showLeftIcon && 'pl-16', className), size: size, invalid: invalid, children: _jsx("input", { ref: ref, ...inputProps, onChange: handleChange }) }), icons && _jsx(FormFieldIconsContainer, { children: icons })] }));
|
|
17
|
+
});
|
|
7
18
|
TextInputPrimitive.displayName = 'TextInputPrimitive';
|
|
8
|
-
const TextInput = React.forwardRef(({ className, wrapperClassName, label, required, helperText, invalidText, invalid = false, disabled, hidden, ...props }, ref) => {
|
|
19
|
+
const TextInput = React.forwardRef(({ className, wrapperClassName, label, required, helperText, invalidText, invalid = false, leadingIcon = { show: false, iconName: 'core::placeholder' }, disabled, hidden, ...props }, ref) => {
|
|
9
20
|
const { id, labelId, helperTextId } = useFieldId();
|
|
10
|
-
return (_jsxs("div", { className: cn('font-text w-full', hidden && 'hidden', wrapperClassName), children: [label && (_jsx(FormFieldLabel, { id: labelId, htmlFor: id, label: label, disabled: disabled, required: required })), _jsx(TextInputPrimitive, { id: id, ref: ref, invalid: invalid, required: required, disabled: disabled, "aria-labelledby": labelId, "aria-describedby": helperText && helperTextId, className: cn(invalid && 'pr-14', className),
|
|
21
|
+
return (_jsxs("div", { className: cn('font-text w-full', hidden && 'hidden', wrapperClassName), children: [label && (_jsx(FormFieldLabel, { id: labelId, htmlFor: id, label: label, disabled: disabled, required: required })), _jsx(TextInputPrimitive, { id: id, ref: ref, invalid: invalid, required: required, disabled: disabled, "aria-labelledby": labelId, "aria-describedby": helperText && helperTextId, className: cn(invalid && 'pr-14', className), leadingIcon: leadingIcon, iconLeft: leadingIcon?.show &&
|
|
22
|
+
leadingIcon?.iconName &&
|
|
23
|
+
!invalid && (_jsx(FormFieldIconsContainer, { align: "left", className: "-left-1", children: _jsx(FormFieldIcon, { className: "text-icon-secondary", name: leadingIcon.iconName }) })), icons: invalid && (_jsx(FormFieldIcon, { className: "text-draeger-error", name: "core::feedback-warning-filled-mono" })), ...props }), _jsx(FormFieldHelperText, { id: helperTextId, helperText: helperText, invalidText: invalidText, invalid: invalid, disabled: disabled })] }));
|
|
11
24
|
});
|
|
12
25
|
TextInput.displayName = 'Input';
|
|
13
26
|
export { TextInput, TextInputPrimitive };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../src/components/actions/text-input/TextInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../src/components/actions/text-input/TextInput.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,mBAAmB,GAGpB,MAAM,cAAc,CAAC;AAetB,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CAIzC,CACE,EAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,UAAU,EAAC,EACvE,GAAG,EACH,EAAE;IACF,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAEvE,MAAM,YAAY,GAAG,CAAC,CAAsC,EAAE,EAAE;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Attributes<HTMLDivElement> {
|
|
3
3
|
headline?: string;
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
+
paddingBottom?: 'default' | 'none';
|
|
5
6
|
}
|
|
6
7
|
export interface StructuredListProps extends StructuredListComponentProps {
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StructuredList.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/structuredList/StructuredList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,4BACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"StructuredList.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/structuredList/StructuredList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,4BACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CACpC;AAuBD,MAAM,WAAW,mBAAoB,SAAQ,4BAA4B;CAAG;AAE5E,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAUjD,CAAC;AAEF,OAAO,EAAC,cAAc,EAAC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { BodyText } from '../../typography/bodyText';
|
|
3
|
-
const StructuredListComponent = ({ headline, children, }) => {
|
|
4
|
-
return (_jsxs("div", { className:
|
|
3
|
+
const StructuredListComponent = ({ headline, children, paddingBottom = 'none', }) => {
|
|
4
|
+
return (_jsxs("div", { className: `flex flex-col gap-4 ${paddingBottom === 'default' ? 'pb-20 md:pb-10' : 'pb-0'}`, children: [headline && (_jsx(BodyText, { variant: "large", className: "text-draeger-cool-gray-750", children: headline })), _jsx("div", { className: 'flex flex-col gap-6', children: children })] }));
|
|
5
5
|
};
|
|
6
|
-
const StructuredList = ({ children, headline, }) => {
|
|
7
|
-
return (_jsx(StructuredListComponent, { headline: headline, children: children }));
|
|
6
|
+
const StructuredList = ({ children, headline, paddingBottom, }) => {
|
|
7
|
+
return (_jsx(StructuredListComponent, { headline: headline, paddingBottom: paddingBottom, children: children }));
|
|
8
8
|
};
|
|
9
9
|
export { StructuredList };
|
|
10
10
|
//# sourceMappingURL=StructuredList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StructuredList.js","sourceRoot":"","sources":["../../../../src/components/layout/structuredList/StructuredList.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"StructuredList.js","sourceRoot":"","sources":["../../../../src/components/layout/structuredList/StructuredList.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,2BAA2B,CAAC;AASnD,MAAM,uBAAuB,GAA2C,CAAC,EACvE,QAAQ,EACR,QAAQ,EACR,aAAa,GAAG,MAAM,GACvB,EAAE,EAAE;IACH,OAAO,CACL,eACE,SAAS,EAAE,uBACT,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,MACnD,EAAE,aAED,QAAQ,IAAI,CACX,KAAC,QAAQ,IAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,4BAA4B,YAC7D,QAAQ,GACA,CACZ,EACD,cAAK,SAAS,EAAE,qBAAqB,YAAG,QAAQ,GAAO,IACnD,CACP,CAAC;AACJ,CAAC,CAAC;AAIF,MAAM,cAAc,GAAkC,CAAC,EACrD,QAAQ,EACR,QAAQ,EACR,aAAa,GACd,EAAE,EAAE;IACH,OAAO,CACL,KAAC,uBAAuB,IAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,YACtE,QAAQ,GACe,CAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAC,cAAc,EAAC,CAAC"}
|
package/package.json
CHANGED