@rjsf/chakra-ui 5.24.10 → 6.0.0-beta.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/dist/chakra-ui.esm.js +664 -700
- package/dist/chakra-ui.esm.js.map +4 -4
- package/dist/chakra-ui.umd.js +488 -579
- package/dist/index.js +670 -708
- package/dist/index.js.map +4 -4
- package/lib/AddButton/AddButton.js +3 -3
- package/lib/AddButton/AddButton.js.map +1 -1
- package/lib/AltDateWidget/AltDateWidget.js.map +1 -1
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +2 -2
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +5 -8
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -1
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +2 -2
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +4 -5
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/ChakraFrameProvider.js +3 -4
- package/lib/ChakraFrameProvider.js.map +1 -1
- package/lib/CheckboxWidget/CheckboxWidget.js +5 -5
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -1
- package/lib/CheckboxesWidget/CheckboxesWidget.js +10 -13
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -1
- package/lib/DescriptionField/DescriptionField.js.map +1 -1
- package/lib/ErrorList/ErrorList.js +4 -3
- package/lib/ErrorList/ErrorList.js.map +1 -1
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +3 -3
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -1
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +2 -2
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -1
- package/lib/FieldTemplate/FieldTemplate.js +2 -2
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -1
- package/lib/GridTemplate/GridTemplate.d.ts +7 -0
- package/lib/GridTemplate/GridTemplate.js +15 -0
- package/lib/GridTemplate/GridTemplate.js.map +1 -0
- package/lib/GridTemplate/index.d.ts +2 -0
- package/lib/GridTemplate/index.js +3 -0
- package/lib/GridTemplate/index.js.map +1 -0
- package/lib/IconButton/ChakraIconButton.js +1 -1
- package/lib/IconButton/ChakraIconButton.js.map +1 -1
- package/lib/IconButton/IconButton.js +1 -1
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +2 -2
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -1
- package/lib/RadioWidget/RadioWidget.d.ts +1 -1
- package/lib/RadioWidget/RadioWidget.js +11 -11
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/RangeWidget/RangeWidget.d.ts +1 -1
- package/lib/RangeWidget/RangeWidget.js +6 -8
- package/lib/RangeWidget/RangeWidget.js.map +1 -1
- package/lib/SelectNativeWidget/NativeSelectWidget.d.ts +12 -0
- package/lib/SelectNativeWidget/NativeSelectWidget.js +60 -0
- package/lib/SelectNativeWidget/NativeSelectWidget.js.map +1 -0
- package/lib/SelectNativeWidget/index.d.ts +2 -0
- package/lib/SelectNativeWidget/index.js +3 -0
- package/lib/SelectNativeWidget/index.js.map +1 -0
- package/lib/SelectWidget/SelectWidget.js +30 -23
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/SubmitButton/SubmitButton.js.map +1 -1
- package/lib/Templates/Templates.js +2 -0
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/TextareaWidget/TextareaWidget.d.ts +1 -1
- package/lib/TextareaWidget/TextareaWidget.js +5 -6
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -1
- package/lib/TitleField/TitleField.js +2 -2
- package/lib/TitleField/TitleField.js.map +1 -1
- package/lib/UpDownWidget/UpDownWidget.js +6 -7
- package/lib/UpDownWidget/UpDownWidget.js.map +1 -1
- package/lib/Widgets/Widgets.js +2 -0
- package/lib/Widgets/Widgets.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +4 -3
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/components/ui/alert.d.ts +24 -0
- package/lib/components/ui/alert.js +9 -0
- package/lib/components/ui/alert.js.map +1 -0
- package/lib/components/ui/checkbox.d.ts +17 -0
- package/lib/components/ui/checkbox.js +17 -0
- package/lib/components/ui/checkbox.js.map +1 -0
- package/lib/components/ui/close-button.d.ts +10 -0
- package/lib/components/ui/close-button.js +16 -0
- package/lib/components/ui/close-button.js.map +1 -0
- package/lib/components/ui/field.d.ts +20 -0
- package/lib/components/ui/field.js +19 -0
- package/lib/components/ui/field.js.map +1 -0
- package/lib/components/ui/number-input.d.ts +10 -0
- package/lib/components/ui/number-input.js +20 -0
- package/lib/components/ui/number-input.js.map +1 -0
- package/lib/components/ui/radio.d.ts +16 -0
- package/lib/components/ui/radio.js +17 -0
- package/lib/components/ui/radio.js.map +1 -0
- package/lib/components/ui/select.d.ts +73 -0
- package/lib/components/ui/select.js +99 -0
- package/lib/components/ui/select.js.map +1 -0
- package/lib/components/ui/slider.d.ts +18 -0
- package/lib/components/ui/slider.js +55 -0
- package/lib/components/ui/slider.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils.d.ts +3 -6
- package/lib/utils.js +6 -7
- package/lib/utils.js.map +1 -1
- package/package.json +52 -47
- package/src/AddButton/AddButton.tsx +3 -2
- package/src/AltDateTimeWidget/AltDateTimeWidget.tsx +1 -1
- package/src/AltDateWidget/AltDateWidget.tsx +3 -3
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +18 -60
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +9 -7
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +11 -18
- package/src/ChakraFrameProvider.tsx +3 -4
- package/src/CheckboxWidget/CheckboxWidget.tsx +13 -12
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +14 -29
- package/src/DescriptionField/DescriptionField.tsx +1 -1
- package/src/ErrorList/ErrorList.tsx +16 -7
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +5 -5
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +3 -3
- package/src/FieldTemplate/FieldTemplate.tsx +8 -8
- package/src/Form/Form.tsx +1 -1
- package/src/GridTemplate/GridTemplate.tsx +15 -0
- package/src/GridTemplate/index.ts +2 -0
- package/src/IconButton/ChakraIconButton.tsx +7 -3
- package/src/IconButton/IconButton.tsx +5 -5
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +6 -4
- package/src/RadioWidget/RadioWidget.tsx +15 -14
- package/src/RangeWidget/RangeWidget.tsx +13 -20
- package/src/SelectNativeWidget/NativeSelectWidget.tsx +134 -0
- package/src/SelectNativeWidget/index.ts +2 -0
- package/src/SelectWidget/SelectWidget.tsx +74 -46
- package/src/SubmitButton/SubmitButton.tsx +1 -1
- package/src/Templates/Templates.ts +3 -1
- package/src/TextareaWidget/TextareaWidget.tsx +11 -14
- package/src/Theme/Theme.tsx +1 -1
- package/src/TitleField/TitleField.tsx +2 -2
- package/src/UpDownWidget/UpDownWidget.tsx +21 -34
- package/src/Widgets/Widgets.ts +3 -1
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +9 -7
- package/src/components/ui/alert.tsx +47 -0
- package/src/components/ui/checkbox.tsx +28 -0
- package/src/components/ui/close-button.tsx +21 -0
- package/src/components/ui/field.tsx +37 -0
- package/src/components/ui/number-input.tsx +31 -0
- package/src/components/ui/radio.tsx +28 -0
- package/src/components/ui/select.tsx +171 -0
- package/src/components/ui/slider.tsx +100 -0
- package/src/tsconfig.json +3 -4
- package/src/utils.ts +8 -12
- package/LICENSE.md +0 -201
- package/lib/CssReset.d.ts +0 -23
- package/lib/CssReset.js +0 -266
- package/lib/CssReset.js.map +0 -1
- package/src/CssReset.tsx +0 -270
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/SelectNativeWidget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { FormControl, FormLabel } from '@chakra-ui/react';
|
|
2
|
+
import { useMemo, useRef } from 'react';
|
|
4
3
|
import { ariaDescribedByIds, enumOptionsIndexForValue, enumOptionsValueForIndex, labelValue, } from '@rjsf/utils';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { createListCollection, Select as ChakraSelect } from '@chakra-ui/react';
|
|
5
|
+
import { Field } from '../components/ui/field.js';
|
|
6
|
+
import { SelectRoot, SelectTrigger, SelectValueText } from '../components/ui/select.js';
|
|
7
7
|
export default function SelectWidget(props) {
|
|
8
|
-
const { id, options, label, hideLabel, placeholder, multiple, required, disabled, readonly, value, autofocus, onChange, onBlur, onFocus, rawErrors = [],
|
|
8
|
+
const { id, options, label, hideLabel, placeholder, multiple, required, disabled, readonly, value, autofocus, onChange, onBlur, onFocus, rawErrors = [], schema, } = props;
|
|
9
9
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return v.value;
|
|
10
|
+
const _onMultiChange = ({ value }) => {
|
|
11
|
+
return onChange(enumOptionsValueForIndex(value.map((item) => {
|
|
12
|
+
return item;
|
|
14
13
|
}), enumOptions, emptyValue));
|
|
15
14
|
};
|
|
16
|
-
const _onChange = (
|
|
17
|
-
return onChange(enumOptionsValueForIndex(
|
|
15
|
+
const _onChange = ({ value }) => {
|
|
16
|
+
return onChange(enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
18
17
|
};
|
|
19
18
|
const _onBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
|
|
20
19
|
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, emptyValue));
|
|
@@ -29,7 +28,7 @@ export default function SelectWidget(props) {
|
|
|
29
28
|
return {
|
|
30
29
|
label,
|
|
31
30
|
value: String(index),
|
|
32
|
-
|
|
31
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
|
|
33
32
|
};
|
|
34
33
|
});
|
|
35
34
|
if (showPlaceholderOption) {
|
|
@@ -40,17 +39,25 @@ export default function SelectWidget(props) {
|
|
|
40
39
|
}, [enumDisabled, enumOptions, placeholder, showPlaceholderOption]);
|
|
41
40
|
const isMultiple = typeof multiple !== 'undefined' && multiple !== false && Boolean(enumOptions);
|
|
42
41
|
const selectedIndex = enumOptionsIndexForValue(value, enumOptions, isMultiple);
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
value: i,
|
|
48
|
-
};
|
|
49
|
-
})
|
|
50
|
-
: {
|
|
51
|
-
label: valueLabelMap[selectedIndex] || '',
|
|
52
|
-
selectedIndex,
|
|
42
|
+
const getMultiValue = () => (selectedIndex || []).map((i) => {
|
|
43
|
+
return {
|
|
44
|
+
label: valueLabelMap[i],
|
|
45
|
+
value: i.toString(),
|
|
53
46
|
};
|
|
54
|
-
|
|
47
|
+
});
|
|
48
|
+
const getSingleValue = () => typeof selectedIndex !== 'undefined'
|
|
49
|
+
? [
|
|
50
|
+
{
|
|
51
|
+
label: valueLabelMap[selectedIndex] || '',
|
|
52
|
+
value: selectedIndex.toString(),
|
|
53
|
+
},
|
|
54
|
+
]
|
|
55
|
+
: [];
|
|
56
|
+
const formValue = (isMultiple ? getMultiValue() : getSingleValue()).map((item) => item.value);
|
|
57
|
+
const selectOptions = createListCollection({
|
|
58
|
+
items: displayEnumOptions.filter((item) => item.value),
|
|
59
|
+
});
|
|
60
|
+
const containerRef = useRef(null);
|
|
61
|
+
return (_jsx(Field, { ref: containerRef, mb: 1, disabled: disabled || readonly, required: required, readOnly: readonly, invalid: rawErrors && rawErrors.length > 0, label: labelValue(label, hideLabel || !label), position: 'relative', children: _jsxs(SelectRoot, { collection: selectOptions, id: id, name: id, multiple: isMultiple, closeOnSelect: !isMultiple, onBlur: _onBlur, onValueChange: isMultiple ? _onMultiChange : _onChange, onFocus: _onFocus, autoFocus: autofocus, value: formValue, "aria-describedby": ariaDescribedByIds(id), positioning: { placement: 'bottom' }, children: [_jsx(ChakraSelect.Control, { children: _jsx(SelectTrigger, { children: _jsx(SelectValueText, { placeholder: placeholder }) }) }), _jsx(ChakraSelect.Positioner, { minWidth: '100% !important', zIndex: '2 !important', top: 'calc(100% + 5px) !important', children: _jsx(ChakraSelect.Content, { children: selectOptions.items.map((item) => (_jsxs(ChakraSelect.Item, { item: item, children: [item.label, _jsx(ChakraSelect.ItemIndicator, {})] }, item.value))) }) })] }) }));
|
|
55
62
|
}
|
|
56
63
|
//# sourceMappingURL=SelectWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectWidget.js","sourceRoot":"","sources":["../../src/SelectWidget/SelectWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"SelectWidget.js","sourceRoot":"","sources":["../../src/SelectWidget/SelectWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EACL,kBAAkB,EAElB,wBAAwB,EACxB,wBAAwB,EACxB,UAAU,GAKX,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,oBAAoB,EAA4B,MAAM,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE1G,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,UAAU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sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAC5F,IAAI,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"SubmitButton.js","sourceRoot":"","sources":["../../src/SubmitButton/SubmitButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAmB,sBAAsB,EAAmD,MAAM,aAAa,CAAC;AAEvH,MAAM,CAAC,OAAO,UAAU,YAAY,CAIlC,EAAE,QAAQ,EAA8B;IACxC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAC5F,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,OAAO,KAAK,iBAAiB,YACxD,UAAU,GACJ,GACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { CopyButton, MoveDownButton, MoveUpButton, RemoveButton } from '../IconB
|
|
|
8
8
|
import FieldErrorTemplate from '../FieldErrorTemplate/index.js';
|
|
9
9
|
import FieldHelpTemplate from '../FieldHelpTemplate/index.js';
|
|
10
10
|
import FieldTemplate from '../FieldTemplate/index.js';
|
|
11
|
+
import GridTemplate from '../GridTemplate/index.js';
|
|
11
12
|
import ObjectFieldTemplate from '../ObjectFieldTemplate/index.js';
|
|
12
13
|
import SubmitButton from '../SubmitButton/index.js';
|
|
13
14
|
import TitleField from '../TitleField/index.js';
|
|
@@ -30,6 +31,7 @@ export function generateTemplates() {
|
|
|
30
31
|
FieldErrorTemplate,
|
|
31
32
|
FieldHelpTemplate,
|
|
32
33
|
FieldTemplate,
|
|
34
|
+
GridTemplate,
|
|
33
35
|
ObjectFieldTemplate,
|
|
34
36
|
TitleFieldTemplate: TitleField,
|
|
35
37
|
WrapIfAdditionalTemplate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Templates.js","sourceRoot":"","sources":["../../src/Templates/Templates.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAC/D,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AACzD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,wBAAwB,MAAM,6BAA6B,CAAC;AAGnE,MAAM,UAAU,iBAAiB;IAK/B,OAAO;QACL,sBAAsB;QACtB,kBAAkB;QAClB,iBAAiB;QACjB,eAAe,EAAE;YACf,UAAU;YACV,SAAS;YACT,cAAc;YACd,YAAY;YACZ,YAAY;YACZ,YAAY;SACb;QACD,wBAAwB,EAAE,gBAAgB;QAC1C,iBAAiB,EAAE,SAAS;QAC5B,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;QACb,mBAAmB;QACnB,kBAAkB,EAAE,UAAU;QAC9B,wBAAwB;KACzB,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"Templates.js","sourceRoot":"","sources":["../../src/Templates/Templates.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAC/D,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AACzD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,wBAAwB,MAAM,6BAA6B,CAAC;AAGnE,MAAM,UAAU,iBAAiB;IAK/B,OAAO;QACL,sBAAsB;QACtB,kBAAkB;QAClB,iBAAiB;QACjB,eAAe,EAAE;YACf,UAAU;YACV,SAAS;YACT,cAAc;YACd,YAAY;YACZ,YAAY;YACZ,YAAY;SACb;QACD,wBAAwB,EAAE,gBAAgB;QAC1C,iBAAiB,EAAE,SAAS;QAC5B,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;QACb,YAAY;QACZ,mBAAmB;QACnB,kBAAkB,EAAE,UAAU;QAC9B,wBAAwB;KACzB,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils';
|
|
2
|
-
export default function TextareaWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, placeholder, value, label, hideLabel, disabled, autofocus, readonly, onBlur, onFocus, onChange, options,
|
|
2
|
+
export default function TextareaWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ id, placeholder, value, label, hideLabel, disabled, autofocus, readonly, onBlur, onFocus, onChange, options, required, rawErrors, }: WidgetProps<T, S, F>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Textarea } from '@chakra-ui/react';
|
|
3
3
|
import { ariaDescribedByIds, labelValue, } from '@rjsf/utils';
|
|
4
|
-
import {
|
|
5
|
-
export default function TextareaWidget({ id, placeholder, value, label, hideLabel, disabled, autofocus, readonly, onBlur, onFocus, onChange, options,
|
|
6
|
-
const chakraProps = getChakra({ uiSchema });
|
|
4
|
+
import { Field } from '../components/ui/field.js';
|
|
5
|
+
export default function TextareaWidget({ id, placeholder, value, label, hideLabel, disabled, autofocus, readonly, onBlur, onFocus, onChange, options, required, rawErrors, }) {
|
|
7
6
|
const _onChange = ({ target: { value } }) => onChange(value === '' ? options.emptyValue : value);
|
|
8
7
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
9
8
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
10
|
-
return (
|
|
9
|
+
return (_jsx(Field, { mb: 1, disabled: disabled || readonly, required: required, readOnly: readonly, invalid: rawErrors && rawErrors.length > 0, label: labelValue(label, hideLabel || !label), children: _jsx(Textarea, { id: id, name: id, value: value !== null && value !== void 0 ? value : '', placeholder: placeholder, autoFocus: autofocus, onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, rows: options.rows, "aria-describedby": ariaDescribedByIds(id) }) }));
|
|
11
10
|
}
|
|
12
11
|
//# sourceMappingURL=TextareaWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextareaWidget.js","sourceRoot":"","sources":["../../src/TextareaWidget/TextareaWid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AAC,KAAK,CAAC,YAE7C,KAAC,QAAQ,IACP,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,EAAE,EACR,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,EAClB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,OAAO,CAAC,IAAI,sBACA,kBAAkB,CAAI,EAAE,CAAC,GAC3C,GACI,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box,
|
|
2
|
+
import { Box, Separator, Heading } from '@chakra-ui/react';
|
|
3
3
|
export default function TitleField({ id, title, }) {
|
|
4
|
-
return (_jsxs(Box, { id: id, mt: 1, mb: 4, children: [_jsx(Heading, { as: 'h5', children: title }), _jsx(
|
|
4
|
+
return (_jsxs(Box, { id: id, mt: 1, mb: 4, children: [_jsx(Heading, { as: 'h5', children: title }), _jsx(Separator, {})] }));
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=TitleField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleField.js","sourceRoot":"","sources":["../../src/TitleField/TitleField.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"TitleField.js","sourceRoot":"","sources":["../../src/TitleField/TitleField.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,CAAC,OAAO,UAAU,UAAU,CAAoF,EACpH,EAAE,EACF,KAAK,GACoB;IACzB,OAAO,CACL,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,aACvB,KAAC,OAAO,IAAC,EAAE,EAAC,IAAI,YAAE,KAAK,GAAW,EAClC,KAAC,SAAS,KAAG,IACT,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { NumberInput, NumberDecrementStepper, NumberIncrementStepper, NumberInputField, NumberInputStepper, FormControl, FormLabel, } from '@chakra-ui/react';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { ariaDescribedByIds, labelValue, } from '@rjsf/utils';
|
|
4
|
-
import {
|
|
3
|
+
import { Field } from '../components/ui/field.js';
|
|
4
|
+
import { NumberInputRoot } from '../components/ui/number-input.js';
|
|
5
5
|
export default function UpDownWidget(props) {
|
|
6
|
-
const { id,
|
|
7
|
-
const
|
|
8
|
-
const _onChange = (value) => onChange(value);
|
|
6
|
+
const { id, readonly, disabled, label, hideLabel, value, onChange, onBlur, onFocus, rawErrors, required } = props;
|
|
7
|
+
const _onChange = ({ value }) => onChange(value);
|
|
9
8
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
10
9
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
11
|
-
return (
|
|
10
|
+
return (_jsx(Field, { mb: 1, disabled: disabled || readonly, required: required, readOnly: readonly, invalid: rawErrors && rawErrors.length > 0, label: labelValue(label, hideLabel || !label), children: _jsx(NumberInputRoot, { value: value, onValueChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, "aria-describedby": ariaDescribedByIds(id), id: id, name: id }) }));
|
|
12
11
|
}
|
|
13
12
|
//# sourceMappingURL=UpDownWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpDownWidget.js","sourceRoot":"","sources":["../../src/UpDownWidget/UpDownWidget.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"UpDownWidget.js","sourceRoot":"","sources":["../../src/UpDownWidget/UpDownWidget.tsx"],"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EAAE,EAAE,GACR,GACI,CACT,CAAC;AACJ,CAAC"}
|
package/lib/Widgets/Widgets.js
CHANGED
|
@@ -5,6 +5,7 @@ import CheckboxesWidget from '../CheckboxesWidget/CheckboxesWidget.js';
|
|
|
5
5
|
import RadioWidget from '../RadioWidget/RadioWidget.js';
|
|
6
6
|
import RangeWidget from '../RangeWidget/RangeWidget.js';
|
|
7
7
|
import SelectWidget from '../SelectWidget/SelectWidget.js';
|
|
8
|
+
import NativeSelectWidget from '../SelectNativeWidget/NativeSelectWidget.js';
|
|
8
9
|
import TextareaWidget from '../TextareaWidget/TextareaWidget.js';
|
|
9
10
|
import UpDownWidget from '../UpDownWidget/UpDownWidget.js';
|
|
10
11
|
export function generateWidgets() {
|
|
@@ -16,6 +17,7 @@ export function generateWidgets() {
|
|
|
16
17
|
RadioWidget,
|
|
17
18
|
RangeWidget,
|
|
18
19
|
SelectWidget,
|
|
20
|
+
NativeSelectWidget,
|
|
19
21
|
TextareaWidget,
|
|
20
22
|
UpDownWidget,
|
|
21
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Widgets.js","sourceRoot":"","sources":["../../src/Widgets/Widgets.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,YAAY,MAAM,8BAA8B,CAAC;AACxD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,YAAY,MAAM,8BAA8B,CAAC;AAGxD,MAAM,UAAU,eAAe;IAK7B,OAAO;QACL,iBAAiB;QACjB,aAAa;QACb,cAAc;QACd,gBAAgB;QAChB,WAAW;QACX,WAAW;QACX,YAAY;QACZ,cAAc;QACd,YAAY;KACb,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"Widgets.js","sourceRoot":"","sources":["../../src/Widgets/Widgets.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,YAAY,MAAM,8BAA8B,CAAC;AACxD,OAAO,kBAAkB,MAAM,0CAA0C,CAAC;AAC1E,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,YAAY,MAAM,8BAA8B,CAAC;AAGxD,MAAM,UAAU,eAAe;IAK7B,OAAO;QACL,iBAAiB;QACjB,aAAa;QACb,cAAc;QACd,gBAAgB;QAChB,WAAW;QACX,WAAW;QACX,YAAY;QACZ,kBAAkB;QAClB,cAAc;QACd,YAAY;KACb,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,EAAE,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ADDITIONAL_PROPERTY_FLAG, TranslatableString, } from '@rjsf/utils';
|
|
3
|
-
import {
|
|
2
|
+
import { ADDITIONAL_PROPERTY_FLAG, buttonId, TranslatableString, } from '@rjsf/utils';
|
|
3
|
+
import { Grid, GridItem, Input } from '@chakra-ui/react';
|
|
4
|
+
import { Field } from '../components/ui/field.js';
|
|
4
5
|
export default function WrapIfAdditionalTemplate(props) {
|
|
5
6
|
const { children, classNames, style, disabled, id, label, onDropPropertyClick, onKeyChange, readonly, registry, required, schema, uiSchema, } = props;
|
|
6
7
|
const { templates, translateString } = registry;
|
|
@@ -12,6 +13,6 @@ export default function WrapIfAdditionalTemplate(props) {
|
|
|
12
13
|
return (_jsx("div", { className: classNames, style: style, children: children }));
|
|
13
14
|
}
|
|
14
15
|
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
15
|
-
return (_jsxs(Grid, { className: classNames, style: style, alignItems: 'center', gap: 2, children: [_jsx(GridItem, { children:
|
|
16
|
+
return (_jsxs(Grid, { className: classNames, style: style, alignItems: 'center', gap: 2, children: [_jsx(GridItem, { children: _jsx(Field, { required: required, label: keyLabel, children: _jsx(Input, { defaultValue: label, disabled: disabled || readonly, id: `${id}-key`, name: `${id}-key`, onBlur: !readonly ? handleBlur : undefined, type: 'text', mb: 1 }) }) }), _jsx(GridItem, { children: children }), _jsx(GridItem, { children: _jsx(RemoveButton, { id: buttonId(id, 'remove'), className: 'rjsf-object-property-remove', disabled: disabled || readonly, onClick: onDropPropertyClick(label), uiSchema: uiSchema, registry: registry }) })] }, `${id}-key`));
|
|
16
17
|
}
|
|
17
18
|
//# sourceMappingURL=WrapIfAdditionalTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrapIfAdditionalTemplate.js","sourceRoot":"","sources":["../../src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,wBAAwB,
|
|
1
|
+
{"version":3,"file":"WrapIfAdditionalTemplate.js","sourceRoot":"","sources":["../../src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,wBAAwB,EACxB,QAAQ,EAIR,kBAAkB,GAEnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAI9C,KAA6C;IAC7C,MAAM,EACJ,QAAQ,EACR,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GAAY,EAC/B,KAAC,QAAQ,cACP,KAAC,YAAY,IACX,EAAE,EAAE,QAAQ,CAAI,EAAE,EAAE,QAAQ,CAAC,EAC7B,SAAS,EAAC,6BAA6B,EACvC,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,EACnC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACO,KAxBF,GAAG,EAAE,MAAM,CAyBf,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { Alert as ChakraAlert } from '@chakra-ui/react';
|
|
3
|
+
/**
|
|
4
|
+
* Alert component that displays a message with an optional icon and close button.
|
|
5
|
+
*
|
|
6
|
+
* @param {AlertProps} props - The properties for the alert component.
|
|
7
|
+
* @param {ReactNode} [props.startElement] - The element to display at the start of the alert.
|
|
8
|
+
* @param {ReactNode} [props.endElement] - The element to display at the end of the alert.
|
|
9
|
+
* @param {ReactNode} [props.title] - The title of the alert.
|
|
10
|
+
* @param {ReactElement} [props.icon] - The icon to display in the alert.
|
|
11
|
+
* @param {boolean} [props.closable] - Whether to show the close button.
|
|
12
|
+
* @param {function} [props.onClose] - The function to call when the close button is clicked.
|
|
13
|
+
*
|
|
14
|
+
* @returns {JSX.Element} The rendered alert component.
|
|
15
|
+
*/
|
|
16
|
+
export interface AlertProps extends Omit<ChakraAlert.RootProps, 'title'> {
|
|
17
|
+
startElement?: ReactNode;
|
|
18
|
+
endElement?: ReactNode;
|
|
19
|
+
title?: ReactNode;
|
|
20
|
+
icon?: ReactElement;
|
|
21
|
+
closable?: boolean;
|
|
22
|
+
onClose?: () => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const Alert: import("react").ForwardRefExoticComponent<AlertProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { Alert as ChakraAlert } from '@chakra-ui/react';
|
|
4
|
+
import { CloseButton } from './close-button.js';
|
|
5
|
+
export const Alert = forwardRef(function Alert(props, ref) {
|
|
6
|
+
const { title, children, icon, closable, onClose, startElement, endElement, ...rest } = props;
|
|
7
|
+
return (_jsxs(ChakraAlert.Root, { ref: ref, ...rest, children: [startElement || _jsx(ChakraAlert.Indicator, { children: icon }), children ? (_jsxs(ChakraAlert.Content, { children: [_jsx(ChakraAlert.Title, { children: title }), _jsx(ChakraAlert.Description, { children: children })] })) : (_jsx(ChakraAlert.Title, { flex: '1', children: title })), endElement, closable && (_jsx(CloseButton, { size: 'sm', pos: 'relative', top: '-2', insetEnd: '-2', alignSelf: 'flex-start', onClick: onClose }))] }));
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../src/components/ui/alert.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2B,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAwB7C,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAA6B,SAAS,KAAK,CAAC,KAAK,EAAE,GAAG;IACnF,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC9F,OAAO,CACL,MAAC,WAAW,CAAC,IAAI,IAAC,GAAG,EAAE,GAAG,KAAM,IAAI,aACjC,YAAY,IAAI,KAAC,WAAW,CAAC,SAAS,cAAE,IAAI,GAAyB,EACrE,QAAQ,CAAC,CAAC,CAAC,CACV,MAAC,WAAW,CAAC,OAAO,eAClB,KAAC,WAAW,CAAC,KAAK,cAAE,KAAK,GAAqB,EAC9C,KAAC,WAAW,CAAC,WAAW,cAAE,QAAQ,GAA2B,IACzC,CACvB,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,CAAC,KAAK,IAAC,IAAI,EAAC,GAAG,YAAE,KAAK,GAAqB,CACxD,EACA,UAAU,EACV,QAAQ,IAAI,CACX,KAAC,WAAW,IAAC,IAAI,EAAC,IAAI,EAAC,GAAG,EAAC,UAAU,EAAC,GAAG,EAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,SAAS,EAAC,YAAY,EAAC,OAAO,EAAE,OAAO,GAAI,CACzG,IACgB,CACpB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
import { Checkbox as ChakraCheckbox } from '@chakra-ui/react';
|
|
3
|
+
export interface CheckboxProps extends ChakraCheckbox.RootProps {
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
6
|
+
rootRef?: Ref<HTMLLabelElement>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Checkbox component that allows users to select or deselect an option.
|
|
10
|
+
*
|
|
11
|
+
* @param {CheckboxProps} props - The properties for the checkbox component.
|
|
12
|
+
* @param {ReactNode} [props.icon] - The icon to display in the checkbox.
|
|
13
|
+
* @param {InputHTMLAttributes<HTMLInputElement>} [props.inputProps] - Additional props for the input element.
|
|
14
|
+
* @param {Ref<HTMLLabelElement>} [props.rootRef] - Ref for the root element of the checkbox.
|
|
15
|
+
* @returns {JSX.Element} The rendered checkbox component.
|
|
16
|
+
*/
|
|
17
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { Checkbox as ChakraCheckbox } from '@chakra-ui/react';
|
|
4
|
+
/**
|
|
5
|
+
* Checkbox component that allows users to select or deselect an option.
|
|
6
|
+
*
|
|
7
|
+
* @param {CheckboxProps} props - The properties for the checkbox component.
|
|
8
|
+
* @param {ReactNode} [props.icon] - The icon to display in the checkbox.
|
|
9
|
+
* @param {InputHTMLAttributes<HTMLInputElement>} [props.inputProps] - Additional props for the input element.
|
|
10
|
+
* @param {Ref<HTMLLabelElement>} [props.rootRef] - Ref for the root element of the checkbox.
|
|
11
|
+
* @returns {JSX.Element} The rendered checkbox component.
|
|
12
|
+
*/
|
|
13
|
+
export const Checkbox = forwardRef(function Checkbox(props, ref) {
|
|
14
|
+
const { icon, children, inputProps, rootRef, ...rest } = props;
|
|
15
|
+
return (_jsxs(ChakraCheckbox.Root, { ref: rootRef, ...rest, children: [_jsx(ChakraCheckbox.HiddenInput, { ref: ref, ...inputProps }), _jsx(ChakraCheckbox.Control, { children: icon || _jsx(ChakraCheckbox.Indicator, {}) }), children != null && _jsx(ChakraCheckbox.Label, { children: children })] }));
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/components/ui/checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAuC,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQ9D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAkC,SAAS,QAAQ,CAAC,KAAK,EAAE,GAAG;IAC9F,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC/D,OAAO,CACL,MAAC,cAAc,CAAC,IAAI,IAAC,GAAG,EAAE,OAAO,KAAM,IAAI,aACzC,KAAC,cAAc,CAAC,WAAW,IAAC,GAAG,EAAE,GAAG,KAAM,UAAU,GAAI,EACxD,KAAC,cAAc,CAAC,OAAO,cAAE,IAAI,IAAI,KAAC,cAAc,CAAC,SAAS,KAAG,GAA0B,EACtF,QAAQ,IAAI,IAAI,IAAI,KAAC,cAAc,CAAC,KAAK,cAAE,QAAQ,GAAwB,IACxD,CACvB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ButtonProps } from '@chakra-ui/react';
|
|
2
|
+
export type CloseButtonProps = ButtonProps;
|
|
3
|
+
/**
|
|
4
|
+
* CloseButton component that renders a button with a close icon.
|
|
5
|
+
*
|
|
6
|
+
* @param {CloseButtonProps} props - The properties for the close button component.
|
|
7
|
+
* @param {ReactNode} [props.children] - The content to display inside the button.
|
|
8
|
+
* @returns {JSX.Element} The rendered close button component.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CloseButton: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { IconButton as ChakraIconButton } from '@chakra-ui/react';
|
|
4
|
+
import { LuX } from 'react-icons/lu';
|
|
5
|
+
/**
|
|
6
|
+
* CloseButton component that renders a button with a close icon.
|
|
7
|
+
*
|
|
8
|
+
* @param {CloseButtonProps} props - The properties for the close button component.
|
|
9
|
+
* @param {ReactNode} [props.children] - The content to display inside the button.
|
|
10
|
+
* @returns {JSX.Element} The rendered close button component.
|
|
11
|
+
*/
|
|
12
|
+
export const CloseButton = forwardRef(function CloseButton(props, ref) {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_jsx(ChakraIconButton, { variant: 'ghost', "aria-label": 'Close', ref: ref, ...props, children: (_a = props.children) !== null && _a !== void 0 ? _a : _jsx(LuX, {}) }));
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=close-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"close-button.js","sourceRoot":"","sources":["../../../src/components/ui/close-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAIrC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAsC,SAAS,WAAW,CAAC,KAAK,EAAE,GAAG;;IACxG,OAAO,CACL,KAAC,gBAAgB,IAAC,OAAO,EAAC,OAAO,gBAAY,OAAO,EAAC,GAAG,EAAE,GAAG,KAAM,KAAK,YACrE,MAAA,KAAK,CAAC,QAAQ,mCAAI,KAAC,GAAG,KAAG,GACT,CACpB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Field as ChakraField } from '@chakra-ui/react';
|
|
3
|
+
export interface FieldProps extends Omit<ChakraField.RootProps, 'label'> {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
helperText?: ReactNode;
|
|
6
|
+
errorText?: ReactNode;
|
|
7
|
+
optionalText?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Field component that serves as a wrapper for form fields, providing
|
|
11
|
+
* additional functionality such as labels, helper text, and error messages.
|
|
12
|
+
*
|
|
13
|
+
* @param {FieldProps} props - The properties for the field component.
|
|
14
|
+
* @param {ReactNode} [props.label] - The label for the field.
|
|
15
|
+
* @param {ReactNode} [props.helperText] - Helper text to display below the field.
|
|
16
|
+
* @param {ReactNode} [props.errorText] - Error message to display below the field.
|
|
17
|
+
* @param {ReactNode} [props.optionalText] - Text to indicate that the field is optional.
|
|
18
|
+
* @returns {JSX.Element} The rendered field component.
|
|
19
|
+
*/
|
|
20
|
+
export declare const Field: import("react").ForwardRefExoticComponent<FieldProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { Field as ChakraField } from '@chakra-ui/react';
|
|
4
|
+
/**
|
|
5
|
+
* Field component that serves as a wrapper for form fields, providing
|
|
6
|
+
* additional functionality such as labels, helper text, and error messages.
|
|
7
|
+
*
|
|
8
|
+
* @param {FieldProps} props - The properties for the field component.
|
|
9
|
+
* @param {ReactNode} [props.label] - The label for the field.
|
|
10
|
+
* @param {ReactNode} [props.helperText] - Helper text to display below the field.
|
|
11
|
+
* @param {ReactNode} [props.errorText] - Error message to display below the field.
|
|
12
|
+
* @param {ReactNode} [props.optionalText] - Text to indicate that the field is optional.
|
|
13
|
+
* @returns {JSX.Element} The rendered field component.
|
|
14
|
+
*/
|
|
15
|
+
export const Field = forwardRef(function Field(props, ref) {
|
|
16
|
+
const { label, children, helperText, errorText, optionalText, ...rest } = props;
|
|
17
|
+
return (_jsxs(ChakraField.Root, { ref: ref, ...rest, children: [label && (_jsxs(ChakraField.Label, { children: [label, _jsx(ChakraField.RequiredIndicator, { fallback: optionalText })] })), children, helperText && _jsx(ChakraField.HelperText, { children: helperText }), errorText && _jsx(ChakraField.ErrorText, { children: errorText })] }));
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../../src/components/ui/field.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AASxD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAA6B,SAAS,KAAK,CAAC,KAAK,EAAE,GAAG;IACnF,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAChF,OAAO,CACL,MAAC,WAAW,CAAC,IAAI,IAAC,GAAG,EAAE,GAAG,KAAM,IAAI,aACjC,KAAK,IAAI,CACR,MAAC,WAAW,CAAC,KAAK,eACf,KAAK,EACN,KAAC,WAAW,CAAC,iBAAiB,IAAC,QAAQ,EAAE,YAAY,GAAI,IACvC,CACrB,EACA,QAAQ,EACR,UAAU,IAAI,KAAC,WAAW,CAAC,UAAU,cAAE,UAAU,GAA0B,EAC3E,SAAS,IAAI,KAAC,WAAW,CAAC,SAAS,cAAE,SAAS,GAAyB,IACvD,CACpB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NumberInput as ChakraNumberInput } from '@chakra-ui/react';
|
|
2
|
+
export type NumberInputProps = ChakraNumberInput.RootProps;
|
|
3
|
+
/**
|
|
4
|
+
* NumberInput component that allows users to input numeric values.
|
|
5
|
+
*
|
|
6
|
+
* @param {NumberInputProps} props - The properties for the number input component.
|
|
7
|
+
* @param {ReactNode} [props.children] - The content to display inside the number input.
|
|
8
|
+
* @returns {JSX.Element} The rendered number input component.
|
|
9
|
+
*/
|
|
10
|
+
export declare const NumberInputRoot: import("react").ForwardRefExoticComponent<ChakraNumberInput.RootProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useRef } from 'react';
|
|
3
|
+
import { NumberInput as ChakraNumberInput } from '@chakra-ui/react';
|
|
4
|
+
/**
|
|
5
|
+
* NumberInput component that allows users to input numeric values.
|
|
6
|
+
*
|
|
7
|
+
* @param {NumberInputProps} props - The properties for the number input component.
|
|
8
|
+
* @param {ReactNode} [props.children] - The content to display inside the number input.
|
|
9
|
+
* @returns {JSX.Element} The rendered number input component.
|
|
10
|
+
*/
|
|
11
|
+
export const NumberInputRoot = forwardRef(function NumberInput(props, ref) {
|
|
12
|
+
const inputRef = useRef(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (inputRef.current) {
|
|
15
|
+
inputRef.current.value = props.value || '';
|
|
16
|
+
}
|
|
17
|
+
}, [props.value]);
|
|
18
|
+
return (_jsxs(ChakraNumberInput.Root, { ref: ref, variant: 'outline', ...props, children: [_jsxs(ChakraNumberInput.Control, { children: [_jsx(ChakraNumberInput.IncrementTrigger, {}), _jsx(ChakraNumberInput.DecrementTrigger, {})] }), _jsx(ChakraNumberInput.Input, { ref: inputRef })] }));
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=number-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-input.js","sourceRoot":"","sources":["../../../src/components/ui/number-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIpE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAmC,SAAS,WAAW,CAAC,KAAK,EAAE,GAAG;IACzG,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAEhD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;YACrB,QAAQ,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7C,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAElB,OAAO,CACL,MAAC,iBAAiB,CAAC,IAAI,IAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAC,SAAS,KAAK,KAAK,aAC3D,MAAC,iBAAiB,CAAC,OAAO,eACxB,KAAC,iBAAiB,CAAC,gBAAgB,KAAG,EACtC,KAAC,iBAAiB,CAAC,gBAAgB,KAAG,IACZ,EAC5B,KAAC,iBAAiB,CAAC,KAAK,IAAC,GAAG,EAAE,QAAQ,GAAI,IACnB,CAC1B,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InputHTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { RadioGroup as ChakraRadioGroup } from '@chakra-ui/react';
|
|
3
|
+
export interface RadioProps extends ChakraRadioGroup.ItemProps {
|
|
4
|
+
rootRef?: Ref<HTMLDivElement>;
|
|
5
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Radio component that allows users to select a single option from a set.
|
|
9
|
+
*
|
|
10
|
+
* @param {RadioProps} props - The properties for the radio component.
|
|
11
|
+
* @param {InputHTMLAttributes<HTMLInputElement>} [props.inputProps] - Additional props for the input element.
|
|
12
|
+
* @param {Ref<HTMLDivElement>} [props.rootRef] - Ref for the root element of the radio.
|
|
13
|
+
* @returns {JSX.Element} The rendered radio component.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Radio: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
16
|
+
export declare const RadioGroup: import("react").ForwardRefExoticComponent<ChakraRadioGroup.RootProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { RadioGroup as ChakraRadioGroup } from '@chakra-ui/react';
|
|
4
|
+
/**
|
|
5
|
+
* Radio component that allows users to select a single option from a set.
|
|
6
|
+
*
|
|
7
|
+
* @param {RadioProps} props - The properties for the radio component.
|
|
8
|
+
* @param {InputHTMLAttributes<HTMLInputElement>} [props.inputProps] - Additional props for the input element.
|
|
9
|
+
* @param {Ref<HTMLDivElement>} [props.rootRef] - Ref for the root element of the radio.
|
|
10
|
+
* @returns {JSX.Element} The rendered radio component.
|
|
11
|
+
*/
|
|
12
|
+
export const Radio = forwardRef(function Radio(props, ref) {
|
|
13
|
+
const { children, inputProps, rootRef, ...rest } = props;
|
|
14
|
+
return (_jsxs(ChakraRadioGroup.Item, { ref: rootRef, ...rest, children: [_jsx(ChakraRadioGroup.ItemHiddenInput, { ref: ref, ...inputProps }), _jsx(ChakraRadioGroup.ItemIndicator, {}), children && _jsx(ChakraRadioGroup.ItemText, { children: children })] }));
|
|
15
|
+
});
|
|
16
|
+
export const RadioGroup = ChakraRadioGroup.Root;
|
|
17
|
+
//# sourceMappingURL=radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../src/components/ui/radio.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA4B,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOlE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAA+B,SAAS,KAAK,CAAC,KAAK,EAAE,GAAG;IACrF,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACzD,OAAO,CACL,MAAC,gBAAgB,CAAC,IAAI,IAAC,GAAG,EAAE,OAAO,KAAM,IAAI,aAC3C,KAAC,gBAAgB,CAAC,eAAe,IAAC,GAAG,EAAE,GAAG,KAAM,UAAU,GAAI,EAC9D,KAAC,gBAAgB,CAAC,aAAa,KAAG,EACjC,QAAQ,IAAI,KAAC,gBAAgB,CAAC,QAAQ,cAAE,QAAQ,GAA6B,IACxD,CACzB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC"}
|