@cerebruminc/cerebellum 16.1.1 → 16.2.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/lib/cjs/ColorPickerInput-CBPI8IJ-.js +187 -0
- package/lib/cjs/ColorPickerInput-CBPI8IJ-.js.map +1 -0
- package/lib/cjs/ColorPickerInput.cjs +25 -0
- package/lib/cjs/ColorPickerInput.cjs.map +1 -0
- package/lib/cjs/DatePicker.cjs +1 -1
- package/lib/cjs/Form.cjs +7 -4
- package/lib/cjs/Form.cjs.map +1 -1
- package/lib/cjs/FormFieldTypeEnum.cjs +5 -0
- package/lib/cjs/FormFieldTypeEnum.cjs.map +1 -1
- package/lib/cjs/FormSeparator.cjs +3 -1
- package/lib/cjs/FormSeparator.cjs.map +1 -1
- package/lib/cjs/{FormStyles-CxgYRZOl.js → FormStyles-CM25rbhG.js} +38 -21
- package/lib/cjs/{FormStyles-CxgYRZOl.js.map → FormStyles-CM25rbhG.js.map} +1 -1
- package/lib/cjs/FormWrapper.cjs +3 -1
- package/lib/cjs/FormWrapper.cjs.map +1 -1
- package/lib/cjs/{FormikContainer-CY2nLsAs.js → FormikContainer-DVL86Jri.js} +33 -3
- package/lib/cjs/{FormikContainer-CY2nLsAs.js.map → FormikContainer-DVL86Jri.js.map} +1 -1
- package/lib/cjs/InlineColorPickerInput.cjs +25 -0
- package/lib/cjs/InlineColorPickerInput.cjs.map +1 -0
- package/lib/cjs/{InlineDatePicker-DFv_uHo9.js → InlineDatePicker-B7DTwvhv.js} +344 -176
- package/lib/cjs/InlineDatePicker-B7DTwvhv.js.map +1 -0
- package/lib/cjs/InlineDatePicker.cjs +1 -1
- package/lib/cjs/TitleGroup.cjs +3 -1
- package/lib/cjs/TitleGroup.cjs.map +1 -1
- package/lib/cjs/cerebellumTheme.cjs +5 -0
- package/lib/cjs/cerebellumTheme.cjs.map +1 -1
- package/lib/cjs/index.cjs +9 -3
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/validateColorContrast.cjs +53 -0
- package/lib/cjs/validateColorContrast.cjs.map +1 -0
- package/lib/cjs/validateColorContrastWithMessage.cjs +10 -0
- package/lib/cjs/validateColorContrastWithMessage.cjs.map +1 -0
- package/lib/esm/ColorPickerInput-S8X2gIA5.js +180 -0
- package/lib/esm/ColorPickerInput-S8X2gIA5.js.map +1 -0
- package/lib/esm/ColorPickerInput.js +18 -0
- package/lib/esm/ColorPickerInput.js.map +1 -0
- package/lib/esm/DatePicker.js +1 -1
- package/lib/esm/Form.js +7 -5
- package/lib/esm/Form.js.map +1 -1
- package/lib/esm/FormFieldTypeEnum.js +5 -1
- package/lib/esm/FormFieldTypeEnum.js.map +1 -1
- package/lib/esm/FormSeparator.js +3 -1
- package/lib/esm/FormSeparator.js.map +1 -1
- package/lib/esm/{FormStyles-BQJPyTS0.js → FormStyles-CyqyMC1o.js} +39 -22
- package/lib/esm/{FormStyles-BQJPyTS0.js.map → FormStyles-CyqyMC1o.js.map} +1 -1
- package/lib/esm/FormWrapper.js +3 -1
- package/lib/esm/FormWrapper.js.map +1 -1
- package/lib/esm/{FormikContainer-SJPYfIkF.js → FormikContainer-uI5oe1px.js} +34 -4
- package/lib/esm/{FormikContainer-SJPYfIkF.js.map → FormikContainer-uI5oe1px.js.map} +1 -1
- package/lib/esm/InlineColorPickerInput.js +18 -0
- package/lib/esm/InlineColorPickerInput.js.map +1 -0
- package/lib/esm/{InlineDatePicker-ClVBWEzW.js → InlineDatePicker-BuxjkoV0.js} +345 -177
- package/lib/esm/InlineDatePicker-BuxjkoV0.js.map +1 -0
- package/lib/esm/InlineDatePicker.js +1 -1
- package/lib/esm/TitleGroup.js +3 -1
- package/lib/esm/TitleGroup.js.map +1 -1
- package/lib/esm/cerebellumTheme.js +5 -0
- package/lib/esm/cerebellumTheme.js.map +1 -1
- package/lib/esm/index.js +6 -4
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/validateColorContrast.js +50 -0
- package/lib/esm/validateColorContrast.js.map +1 -0
- package/lib/esm/validateColorContrastWithMessage.js +3 -0
- package/lib/esm/validateColorContrastWithMessage.js.map +1 -0
- package/lib/types/src/components/ColorPickerInput/ColorPickerInput.d.ts +3 -0
- package/lib/types/src/components/ColorPickerInput/InlineColorPickerInput.d.ts +3 -0
- package/lib/types/src/components/ColorPickerInput/index.d.ts +3 -0
- package/lib/types/src/components/ColorPickerInput/types.d.ts +48 -0
- package/lib/types/src/components/Form/fields/ColorPickerField/ColorPickerField.d.ts +4 -0
- package/lib/types/src/components/Form/fields/ColorPickerField/index.d.ts +1 -0
- package/lib/types/src/components/Form/fields/index.d.ts +2 -1
- package/lib/types/src/components/Form/index.d.ts +3 -3
- package/lib/types/src/components/Form/mocks/fields.d.ts +62 -0
- package/lib/types/src/components/Form/types.d.ts +36 -2
- package/lib/types/src/helpers/colorValidators.d.ts +19 -0
- package/lib/types/src/index.d.ts +5 -1
- package/lib/types/src/theme.d.ts +6 -0
- package/package.json +1 -1
- package/lib/cjs/InlineDatePicker-DFv_uHo9.js.map +0 -1
- package/lib/esm/InlineDatePicker-ClVBWEzW.js.map +0 -1
|
@@ -20,12 +20,13 @@ var useMeasure = require('./useMeasure-CDq3dPfD.js');
|
|
|
20
20
|
var usePrevious = require('./usePrevious.cjs');
|
|
21
21
|
require('./Loading.cjs');
|
|
22
22
|
var Scroller = require('./Scroller.cjs');
|
|
23
|
-
var FormWrapper = require('./FormStyles-
|
|
23
|
+
var FormWrapper = require('./FormStyles-CM25rbhG.js');
|
|
24
24
|
var AddressInput = require('./AddressInput-BwC_Fa3a.js');
|
|
25
25
|
var Inputs = require('./Inputs-IaHMnBKw.js');
|
|
26
26
|
var ReactDOM = require('react-dom');
|
|
27
27
|
var CheckboxItem = require('./CheckboxItem-Bjn6vej0.js');
|
|
28
28
|
var CheckboxGroup = require('./CheckboxGroup-BeBI_kWP.js');
|
|
29
|
+
var ColorPickerInput = require('./ColorPickerInput-CBPI8IJ-.js');
|
|
29
30
|
var ConfigurableInput = require('./ConfigurableInput-naz2E_Pb.js');
|
|
30
31
|
var FormFieldTypeEnum = require('./FormFieldTypeEnum.cjs');
|
|
31
32
|
var CountryDropdown = require('./CountryDropdown-CoeXr-MI.js');
|
|
@@ -39,7 +40,7 @@ var CurrencyInput = require('./CurrencyInput-D_QGbxkC.js');
|
|
|
39
40
|
var InlineCurrencyInput = require('./InlineCurrencyInput-UjEz4U3A.js');
|
|
40
41
|
var formatBytesToString = require('./formatBytesToString.cjs');
|
|
41
42
|
var DatePicker = require('./DatePicker.cjs');
|
|
42
|
-
var InlineDatePicker = require('./InlineDatePicker-
|
|
43
|
+
var InlineDatePicker = require('./InlineDatePicker-B7DTwvhv.js');
|
|
43
44
|
require('./CheckboxStyles-CAzemGXD.js');
|
|
44
45
|
require('./RadioStyles-2mVDOf96.js');
|
|
45
46
|
require('./ToggleStyles-DsqemdEf.js');
|
|
@@ -193,6 +194,32 @@ var CheckboxGroupField = function (_a) {
|
|
|
193
194
|
}, required: required && !disabled, showValidationMessage: !leftLabels && showValidationMessage, validationMessage: validationMessage })) })), leftLabels && (jsxRuntime.jsx(FormWrapper.RightGutter, { "$switchSpacing": true, children: jsxRuntime.jsx(FormWrapper.ValidationTextGrid, { "$showValidationMessage": showValidationMessage, "$switchSpacing": true, children: validationMessage }) }))] }));
|
|
194
195
|
};
|
|
195
196
|
|
|
197
|
+
var ColorPickerField = function (_a) {
|
|
198
|
+
var fade = _a.fade, field = _a.field, formikProps = _a.formikProps, leftLabels = _a.leftLabels, leftLabelsRightGutter = _a.leftLabelsRightGutter, leftLabelWidth = _a.leftLabelWidth, rowGap = _a.rowGap, setHasValues = _a.setHasValues, setSubmitAttempt = _a.setSubmitAttempt, submitAttempt = _a.submitAttempt, submitOnBlur = _a.submitOnBlur;
|
|
199
|
+
var theme = styled.useTheme();
|
|
200
|
+
var values = formikProps.values, errors = formikProps.errors, touched = formikProps.touched, handleBlur = formikProps.handleBlur, handleChange = formikProps.handleChange, submitForm = formikProps.submitForm;
|
|
201
|
+
var _b = field.disabled, disabled = _b === void 0 ? false : _b, fieldLabel = field.fieldLabel, name = field.name, nextGap = field.nextGap, _c = field.options, options = _c === void 0 ? {} : _c, width = field.width;
|
|
202
|
+
var helperText = options.helperText, onInputBlur = options.onInputBlur, onChange = options.onChange;
|
|
203
|
+
var showValidationMessage = (touched[name] || submitAttempt) && !!errors[name];
|
|
204
|
+
var validationMessage = errors[name];
|
|
205
|
+
var InputComponent = leftLabels ? ColorPickerInput.InlineColorPickerInput : ColorPickerInput.ColorPickerInput;
|
|
206
|
+
var InputWrap = leftLabels ? FormWrapper.InputBox : React.Fragment;
|
|
207
|
+
return (jsxRuntime.jsxs(FormWrapper.FieldBox, { "$fade": fade, "$fieldWidth": leftLabels ? undefined : width, "$leftLabelLayout": leftLabels, "$leftLabelWidth": leftLabelWidth, "$leftLabelsRightGutter": leftLabelsRightGutter, "$rowGap": nextGap !== null && nextGap !== void 0 ? nextGap : rowGap, children: [leftLabels && (jsxRuntime.jsxs(FormWrapper.LeftGutter, { children: [jsxRuntime.jsx(FormWrapper.LeftLabel, { "$textColor": disabled ? theme.input.disabledLabelColor : theme.input.leftLabelColor, "data-sentry-unmask": true, children: fieldLabel || name }), helperText && jsxRuntime.jsx(FormWrapper.HelperTextGrid, { "data-sentry-unmask": true, children: helperText })] })), jsxRuntime.jsx(InputWrap, { children: jsxRuntime.jsx(InputComponent, _tslib.__assign({}, options, { disabled: disabled }, (leftLabels ? {} : { inputLabel: fieldLabel || name }), { name: name, onChange: function (event) {
|
|
208
|
+
handleChange(event);
|
|
209
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
210
|
+
}, onInputBlur: function (event) {
|
|
211
|
+
ReactDOM.flushSync(function () {
|
|
212
|
+
setSubmitAttempt(false);
|
|
213
|
+
handleBlur(event);
|
|
214
|
+
onInputBlur === null || onInputBlur === void 0 ? void 0 : onInputBlur(event);
|
|
215
|
+
setHasValues(FormWrapper.formHasValues(values));
|
|
216
|
+
});
|
|
217
|
+
if (submitOnBlur) {
|
|
218
|
+
submitForm(event);
|
|
219
|
+
}
|
|
220
|
+
}, showValidationMessage: showValidationMessage }, (leftLabels ? {} : { validationMessage: validationMessage }), { value: values[name] || "#000000" })) }), leftLabels && (jsxRuntime.jsx(FormWrapper.RightGutter, { children: jsxRuntime.jsx(FormWrapper.ValidationTextGrid, { "$showValidationMessage": showValidationMessage, children: validationMessage }) }))] }));
|
|
221
|
+
};
|
|
222
|
+
|
|
196
223
|
var ConfigurableInputField = function (_a) {
|
|
197
224
|
var configurableInputFieldActiveIds = _a.configurableInputFieldActiveIds, fade = _a.fade, field = _a.field, formikProps = _a.formikProps, leftLabels = _a.leftLabels, leftLabelsRightGutter = _a.leftLabelsRightGutter, leftLabelWidth = _a.leftLabelWidth, rowGap = _a.rowGap, submitAttempt = _a.submitAttempt, setConfigurableInputFieldActiveIds = _a.setConfigurableInputFieldActiveIds, setHasValues = _a.setHasValues, setSubmitAttempt = _a.setSubmitAttempt, submitOnBlur = _a.submitOnBlur;
|
|
198
225
|
var theme = styled.useTheme();
|
|
@@ -1461,6 +1488,9 @@ var Form = function (_a) {
|
|
|
1461
1488
|
else if (FormFieldTypeEnum.isCheckboxGroup(field) && (!field.showIf || field.showIf({ values: values }))) {
|
|
1462
1489
|
return (jsxRuntime.jsx(CheckboxGroupField, { fade: FormWrapper.shouldFade({ isDeleting: isDeleting, index: index }), field: field, formikProps: formikProps, leftLabels: leftLabels, leftLabelWidth: leftLabelWidth, leftLabelsRightGutter: leftLabelsRightGutter, rowGap: rowGap, setHasValues: setHasValues, submitAttempt: submitAttempt, submitOnBlur: submitOnBlur }, name_1));
|
|
1463
1490
|
}
|
|
1491
|
+
else if (FormFieldTypeEnum.isColorPicker(field) && (!field.showIf || field.showIf({ values: values }))) {
|
|
1492
|
+
return (jsxRuntime.jsx(ColorPickerField, { fade: FormWrapper.shouldFade({ isDeleting: isDeleting, index: index }), field: field, formikProps: formikProps, leftLabels: leftLabels, leftLabelWidth: leftLabelWidth, leftLabelsRightGutter: leftLabelsRightGutter, rowGap: rowGap, setHasValues: setHasValues, setSubmitAttempt: setSubmitAttempt, submitAttempt: submitAttempt, submitOnBlur: submitOnBlur }, name_1));
|
|
1493
|
+
}
|
|
1464
1494
|
else if (FormFieldTypeEnum.isConfigurableInput(field) && (!field.showIf || field.showIf({ values: values }))) {
|
|
1465
1495
|
return (jsxRuntime.jsx(ConfigurableInputField, { configurableInputFieldActiveIds: configurableInputFieldActiveIds, fade: FormWrapper.shouldFade({ isDeleting: isDeleting, index: index }), field: field, formikProps: formikProps, leftLabels: leftLabels, leftLabelWidth: leftLabelWidth, leftLabelsRightGutter: leftLabelsRightGutter, rowGap: rowGap, setConfigurableInputFieldActiveIds: setConfigurableInputFieldActiveIds, setHasValues: setHasValues, setSubmitAttempt: setSubmitAttempt, submitAttempt: submitAttempt, submitOnBlur: submitOnBlur }, name_1));
|
|
1466
1496
|
}
|
|
@@ -1580,4 +1610,4 @@ var FormikContainer = function (props) {
|
|
|
1580
1610
|
exports.FormikContainer = FormikContainer;
|
|
1581
1611
|
exports.NationalityDropdown = NationalityDropdown;
|
|
1582
1612
|
exports.nationalityList = nationalityList;
|
|
1583
|
-
//# sourceMappingURL=FormikContainer-
|
|
1613
|
+
//# sourceMappingURL=FormikContainer-DVL86Jri.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormikContainer-
|
|
1
|
+
{"version":3,"file":"FormikContainer-DVL86Jri.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ColorPickerInput = require('./ColorPickerInput-CBPI8IJ-.js');
|
|
4
|
+
require('./_tslib-ByDtMVOd.js');
|
|
5
|
+
require('react/jsx-runtime');
|
|
6
|
+
require('react');
|
|
7
|
+
require('styled-components');
|
|
8
|
+
require('./BodyLEmphasis.cjs');
|
|
9
|
+
require('./useMeasure-CDq3dPfD.js');
|
|
10
|
+
require('./addOrRemoveById.cjs');
|
|
11
|
+
require('dayjs');
|
|
12
|
+
require('./isEmptyObject.cjs');
|
|
13
|
+
require('./useIsomorphicLayoutEffect-kdlV9QVN.js');
|
|
14
|
+
require('./showLabel-BkZISyqw.js');
|
|
15
|
+
require('./Inputs-IaHMnBKw.js');
|
|
16
|
+
require('./colors.cjs');
|
|
17
|
+
require('./IconComponentStyles-oUWNoaaH.js');
|
|
18
|
+
require('./pressedEnter.cjs');
|
|
19
|
+
require('./validateColorContrast.cjs');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
exports.ColorPickerInput = ColorPickerInput.ColorPickerInput;
|
|
24
|
+
exports.InlineColorPickerInput = ColorPickerInput.InlineColorPickerInput;
|
|
25
|
+
//# sourceMappingURL=InlineColorPickerInput.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineColorPickerInput.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|