@cerebruminc/cerebellum 16.1.1-beta.dangerous.94a8f04 → 16.1.1-beta.dangerous.bc77c27

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.
Files changed (80) hide show
  1. package/lib/cjs/DatePicker.cjs +1 -1
  2. package/lib/cjs/Form.cjs +4 -7
  3. package/lib/cjs/Form.cjs.map +1 -1
  4. package/lib/cjs/FormFieldTypeEnum.cjs +0 -5
  5. package/lib/cjs/FormFieldTypeEnum.cjs.map +1 -1
  6. package/lib/cjs/FormSeparator.cjs +1 -3
  7. package/lib/cjs/FormSeparator.cjs.map +1 -1
  8. package/lib/cjs/{FormStyles-CM25rbhG.js → FormStyles-CxgYRZOl.js} +21 -38
  9. package/lib/cjs/{FormStyles-CM25rbhG.js.map → FormStyles-CxgYRZOl.js.map} +1 -1
  10. package/lib/cjs/FormWrapper.cjs +1 -3
  11. package/lib/cjs/FormWrapper.cjs.map +1 -1
  12. package/lib/cjs/{FormikContainer-DVL86Jri.js → FormikContainer-CY2nLsAs.js} +3 -33
  13. package/lib/{esm/FormikContainer-uI5oe1px.js.map → cjs/FormikContainer-CY2nLsAs.js.map} +1 -1
  14. package/lib/cjs/{InlineDatePicker-B7DTwvhv.js → InlineDatePicker-DFv_uHo9.js} +176 -344
  15. package/lib/cjs/InlineDatePicker-DFv_uHo9.js.map +1 -0
  16. package/lib/cjs/InlineDatePicker.cjs +1 -1
  17. package/lib/cjs/TitleGroup.cjs +1 -3
  18. package/lib/cjs/TitleGroup.cjs.map +1 -1
  19. package/lib/cjs/cerebellumTheme.cjs +0 -5
  20. package/lib/cjs/cerebellumTheme.cjs.map +1 -1
  21. package/lib/cjs/index.cjs +3 -9
  22. package/lib/cjs/index.cjs.map +1 -1
  23. package/lib/esm/DatePicker.js +1 -1
  24. package/lib/esm/Form.js +5 -7
  25. package/lib/esm/Form.js.map +1 -1
  26. package/lib/esm/FormFieldTypeEnum.js +1 -5
  27. package/lib/esm/FormFieldTypeEnum.js.map +1 -1
  28. package/lib/esm/FormSeparator.js +1 -3
  29. package/lib/esm/FormSeparator.js.map +1 -1
  30. package/lib/esm/{FormStyles-CyqyMC1o.js → FormStyles-BQJPyTS0.js} +22 -39
  31. package/lib/esm/{FormStyles-CyqyMC1o.js.map → FormStyles-BQJPyTS0.js.map} +1 -1
  32. package/lib/esm/FormWrapper.js +1 -3
  33. package/lib/esm/FormWrapper.js.map +1 -1
  34. package/lib/esm/{FormikContainer-uI5oe1px.js → FormikContainer-SJPYfIkF.js} +4 -34
  35. package/lib/{cjs/FormikContainer-DVL86Jri.js.map → esm/FormikContainer-SJPYfIkF.js.map} +1 -1
  36. package/lib/esm/{InlineDatePicker-BuxjkoV0.js → InlineDatePicker-ClVBWEzW.js} +177 -345
  37. package/lib/esm/InlineDatePicker-ClVBWEzW.js.map +1 -0
  38. package/lib/esm/InlineDatePicker.js +1 -1
  39. package/lib/esm/TitleGroup.js +1 -3
  40. package/lib/esm/TitleGroup.js.map +1 -1
  41. package/lib/esm/cerebellumTheme.js +0 -5
  42. package/lib/esm/cerebellumTheme.js.map +1 -1
  43. package/lib/esm/index.js +4 -6
  44. package/lib/esm/index.js.map +1 -1
  45. package/lib/types/src/components/Form/fields/index.d.ts +1 -2
  46. package/lib/types/src/components/Form/index.d.ts +3 -3
  47. package/lib/types/src/components/Form/mocks/fields.d.ts +0 -62
  48. package/lib/types/src/components/Form/types.d.ts +2 -36
  49. package/lib/types/src/index.d.ts +1 -5
  50. package/lib/types/src/theme.d.ts +0 -6
  51. package/package.json +2 -2
  52. package/lib/cjs/ColorPickerInput-CBPI8IJ-.js +0 -187
  53. package/lib/cjs/ColorPickerInput-CBPI8IJ-.js.map +0 -1
  54. package/lib/cjs/ColorPickerInput.cjs +0 -25
  55. package/lib/cjs/ColorPickerInput.cjs.map +0 -1
  56. package/lib/cjs/InlineColorPickerInput.cjs +0 -25
  57. package/lib/cjs/InlineColorPickerInput.cjs.map +0 -1
  58. package/lib/cjs/InlineDatePicker-B7DTwvhv.js.map +0 -1
  59. package/lib/cjs/validateColorContrast.cjs +0 -53
  60. package/lib/cjs/validateColorContrast.cjs.map +0 -1
  61. package/lib/cjs/validateColorContrastWithMessage.cjs +0 -10
  62. package/lib/cjs/validateColorContrastWithMessage.cjs.map +0 -1
  63. package/lib/esm/ColorPickerInput-S8X2gIA5.js +0 -180
  64. package/lib/esm/ColorPickerInput-S8X2gIA5.js.map +0 -1
  65. package/lib/esm/ColorPickerInput.js +0 -18
  66. package/lib/esm/ColorPickerInput.js.map +0 -1
  67. package/lib/esm/InlineColorPickerInput.js +0 -18
  68. package/lib/esm/InlineColorPickerInput.js.map +0 -1
  69. package/lib/esm/InlineDatePicker-BuxjkoV0.js.map +0 -1
  70. package/lib/esm/validateColorContrast.js +0 -50
  71. package/lib/esm/validateColorContrast.js.map +0 -1
  72. package/lib/esm/validateColorContrastWithMessage.js +0 -3
  73. package/lib/esm/validateColorContrastWithMessage.js.map +0 -1
  74. package/lib/types/src/components/ColorPickerInput/ColorPickerInput.d.ts +0 -3
  75. package/lib/types/src/components/ColorPickerInput/InlineColorPickerInput.d.ts +0 -3
  76. package/lib/types/src/components/ColorPickerInput/index.d.ts +0 -3
  77. package/lib/types/src/components/ColorPickerInput/types.d.ts +0 -48
  78. package/lib/types/src/components/Form/fields/ColorPickerField/ColorPickerField.d.ts +0 -4
  79. package/lib/types/src/components/Form/fields/ColorPickerField/index.d.ts +0 -1
  80. package/lib/types/src/helpers/colorValidators.d.ts +0 -19
@@ -1,7 +1,6 @@
1
1
  import { AddressField } from "./AddressField/AddressField";
2
2
  import { CheckboxField } from "./CheckboxField/CheckboxField";
3
3
  import { CheckboxGroupField } from "./CheckboxGroupField/CheckboxGroupField";
4
- import { ColorPickerField } from "./ColorPickerField/ColorPickerField";
5
4
  import { ConfigurableInputField } from "./ConfigurableInputField/ConfigurableInputField";
6
5
  import { CountrySelectField } from "./CountrySelectField/CountrySelectField";
7
6
  import { CountySelectField } from "./CountySelectField/CountySelectField";
@@ -29,4 +28,4 @@ import { TextareaField } from "./TextareaField/TextareaField";
29
28
  import { ToggleField } from "./ToggleField/ToggleField";
30
29
  import { ToggleGroupField } from "./ToggleGroupField/ToggleGroupField";
31
30
  import { ZipCodeField } from "./ZipCodeField/ZipCodeField";
32
- export { AddressField, CheckboxField, CheckboxGroupField, ColorPickerField, ConfigurableInputField, CountySelectField, CountrySelectField, CreditCardField, CurrencyField, DatePickerField, DescriptiveDropdownInputField, EmailField, HiddenField, ImagePickerField, MultiSelectField, NationalitySelectField, NumberField, PasswordField, PhoneField, RadioGroupField, RemovableField, SectionHeader, SelectField, SocialSecurityField, SplitLineField, StateSelectField, TextField, TextareaField, ToggleField, ToggleGroupField, ZipCodeField, };
31
+ export { AddressField, CheckboxField, CheckboxGroupField, ConfigurableInputField, CountySelectField, CountrySelectField, CreditCardField, CurrencyField, DatePickerField, DescriptiveDropdownInputField, EmailField, HiddenField, ImagePickerField, MultiSelectField, NationalitySelectField, NumberField, PasswordField, PhoneField, RadioGroupField, RemovableField, SectionHeader, SelectField, SocialSecurityField, SplitLineField, StateSelectField, TextField, TextareaField, ToggleField, ToggleGroupField, ZipCodeField, };
@@ -1,5 +1,5 @@
1
1
  import { FormWrapper } from "./FormStyles";
2
2
  import { FormikContainer as Form } from "./FormikContainer";
3
- import { AddressOptionsType, CheckboxGroupOptionsType, CheckboxOptionsType, ColorPickerOptionsType, CountySelectOptionsType, CreditCardOptionsType, CurrencyOptionsType, DatePickerOptionsType, EmailOptionsType, FormFieldType, FormFieldTypeEnum, FormReturnType, FormWrapperType, IconCheckboxesOptionsType, MultiSelectOptionsType, NationalitySelectOptionsType, NumberOptionsType, PasswordOptionsType, PhoneOptionsType, RadioGroupOptionsType, RemovableFieldType, RemovableFieldTypeEnum, SelectOptionType, SelectOptionsType, ShowIfType, SingleOrMultipleFieldType, SocialSecurityOptionsType, SplitLineFieldType, StateSelectOptionsType, TextOptionsType, TextareaOptionsType, ToggleGroupOptionsType, ToggleOptionsType, ZipCodeOptionsType, isAddress, isCheckbox, isCheckboxGroup, isColorPicker, isConfigurableInput, isCountrySelect, isCountySelect, isCreditCard, isCurrency, isDatePicker, isDescriptiveDropdownInput, isEmail, isFormFieldType, isImagePicker, isMultiSelect, isNationalitySelect, isNumber, isPassword, isPhone, isRadioGroup, isRemovable, isSectionHeader, isSelect, isSocialSecurity, isSplitLine, isStateSelect, isTextarea, isToggle, isToggleGroup, isZipCode } from "./types";
4
- export { Form, FormFieldTypeEnum, FormWrapper, RemovableFieldTypeEnum, isAddress, isCheckbox, isCheckboxGroup, isColorPicker, isConfigurableInput, isCountrySelect, isCountySelect, isCreditCard, isCurrency, isDatePicker, isDescriptiveDropdownInput, isEmail, isFormFieldType, isImagePicker, isMultiSelect, isNationalitySelect, isNumber, isPassword, isPhone, isRadioGroup, isRemovable, isSectionHeader, isSelect, isSocialSecurity, isSplitLine, isStateSelect, isTextarea, isToggle, isToggleGroup, isZipCode, };
5
- export type { AddressOptionsType, CheckboxOptionsType, CheckboxGroupOptionsType, ColorPickerOptionsType, CountySelectOptionsType, CreditCardOptionsType, CurrencyOptionsType, DatePickerOptionsType, EmailOptionsType, FormFieldType, FormReturnType, FormWrapperType, IconCheckboxesOptionsType, MultiSelectOptionsType, NationalitySelectOptionsType, NumberOptionsType, PasswordOptionsType, PhoneOptionsType, RadioGroupOptionsType, RemovableFieldType, SelectOptionType, SelectOptionsType, ShowIfType, SingleOrMultipleFieldType, SocialSecurityOptionsType, SplitLineFieldType, StateSelectOptionsType, TextOptionsType, TextareaOptionsType, ToggleOptionsType, ToggleGroupOptionsType, ZipCodeOptionsType, };
3
+ import { AddressOptionsType, CheckboxGroupOptionsType, CheckboxOptionsType, CountySelectOptionsType, CreditCardOptionsType, CurrencyOptionsType, DatePickerOptionsType, EmailOptionsType, FormFieldType, FormFieldTypeEnum, FormReturnType, FormWrapperType, IconCheckboxesOptionsType, MultiSelectOptionsType, NationalitySelectOptionsType, NumberOptionsType, PasswordOptionsType, PhoneOptionsType, RadioGroupOptionsType, RemovableFieldType, RemovableFieldTypeEnum, SelectOptionType, SelectOptionsType, ShowIfType, SingleOrMultipleFieldType, SocialSecurityOptionsType, SplitLineFieldType, StateSelectOptionsType, TextOptionsType, TextareaOptionsType, ToggleGroupOptionsType, ToggleOptionsType, ZipCodeOptionsType, isAddress, isCheckbox, isCheckboxGroup, isConfigurableInput, isCountrySelect, isCountySelect, isCreditCard, isCurrency, isDatePicker, isDescriptiveDropdownInput, isEmail, isFormFieldType, isImagePicker, isMultiSelect, isNationalitySelect, isNumber, isPassword, isPhone, isRadioGroup, isRemovable, isSectionHeader, isSelect, isSocialSecurity, isSplitLine, isStateSelect, isTextarea, isToggle, isToggleGroup, isZipCode } from "./types";
4
+ export { Form, FormFieldTypeEnum, FormWrapper, RemovableFieldTypeEnum, isAddress, isCheckbox, isCheckboxGroup, isConfigurableInput, isCountrySelect, isCountySelect, isCreditCard, isCurrency, isDatePicker, isDescriptiveDropdownInput, isEmail, isFormFieldType, isImagePicker, isMultiSelect, isNationalitySelect, isNumber, isPassword, isPhone, isRadioGroup, isRemovable, isSectionHeader, isSelect, isSocialSecurity, isSplitLine, isStateSelect, isTextarea, isToggle, isToggleGroup, isZipCode, };
5
+ export type { AddressOptionsType, CheckboxOptionsType, CheckboxGroupOptionsType, CountySelectOptionsType, CreditCardOptionsType, CurrencyOptionsType, DatePickerOptionsType, EmailOptionsType, FormFieldType, FormReturnType, FormWrapperType, IconCheckboxesOptionsType, MultiSelectOptionsType, NationalitySelectOptionsType, NumberOptionsType, PasswordOptionsType, PhoneOptionsType, RadioGroupOptionsType, RemovableFieldType, SelectOptionType, SelectOptionsType, ShowIfType, SingleOrMultipleFieldType, SocialSecurityOptionsType, SplitLineFieldType, StateSelectOptionsType, TextOptionsType, TextareaOptionsType, ToggleOptionsType, ToggleGroupOptionsType, ZipCodeOptionsType, };
@@ -104,7 +104,6 @@ export declare const allFieldTypes: ({
104
104
  stateFieldName?: undefined;
105
105
  center?: undefined;
106
106
  leftLabel?: undefined;
107
- checkLegible?: undefined;
108
107
  placeholderInitials?: undefined;
109
108
  menuOptions?: undefined;
110
109
  switchType?: undefined;
@@ -144,7 +143,6 @@ export declare const allFieldTypes: ({
144
143
  stateFieldName?: undefined;
145
144
  center?: undefined;
146
145
  leftLabel?: undefined;
147
- checkLegible?: undefined;
148
146
  placeholderInitials?: undefined;
149
147
  menuOptions?: undefined;
150
148
  switchType?: undefined;
@@ -183,7 +181,6 @@ export declare const allFieldTypes: ({
183
181
  stateFieldName?: undefined;
184
182
  center?: undefined;
185
183
  leftLabel?: undefined;
186
- checkLegible?: undefined;
187
184
  placeholderInitials?: undefined;
188
185
  menuOptions?: undefined;
189
186
  switchType?: undefined;
@@ -222,7 +219,6 @@ export declare const allFieldTypes: ({
222
219
  stateFieldName?: undefined;
223
220
  center?: undefined;
224
221
  leftLabel?: undefined;
225
- checkLegible?: undefined;
226
222
  placeholderInitials?: undefined;
227
223
  menuOptions?: undefined;
228
224
  switchType?: undefined;
@@ -261,7 +257,6 @@ export declare const allFieldTypes: ({
261
257
  stateFieldName?: undefined;
262
258
  center?: undefined;
263
259
  leftLabel?: undefined;
264
- checkLegible?: undefined;
265
260
  placeholderInitials?: undefined;
266
261
  menuOptions?: undefined;
267
262
  switchType?: undefined;
@@ -300,7 +295,6 @@ export declare const allFieldTypes: ({
300
295
  stateFieldName?: undefined;
301
296
  center?: undefined;
302
297
  leftLabel?: undefined;
303
- checkLegible?: undefined;
304
298
  placeholderInitials?: undefined;
305
299
  menuOptions?: undefined;
306
300
  switchType?: undefined;
@@ -341,7 +335,6 @@ export declare const allFieldTypes: ({
341
335
  stateFieldName?: undefined;
342
336
  center?: undefined;
343
337
  leftLabel?: undefined;
344
- checkLegible?: undefined;
345
338
  placeholderInitials?: undefined;
346
339
  menuOptions?: undefined;
347
340
  switchType?: undefined;
@@ -385,7 +378,6 @@ export declare const allFieldTypes: ({
385
378
  stateFieldName?: undefined;
386
379
  center?: undefined;
387
380
  leftLabel?: undefined;
388
- checkLegible?: undefined;
389
381
  placeholderInitials?: undefined;
390
382
  menuOptions?: undefined;
391
383
  switchType?: undefined;
@@ -424,7 +416,6 @@ export declare const allFieldTypes: ({
424
416
  stateFieldName?: undefined;
425
417
  center?: undefined;
426
418
  leftLabel?: undefined;
427
- checkLegible?: undefined;
428
419
  placeholderInitials?: undefined;
429
420
  menuOptions?: undefined;
430
421
  switchType?: undefined;
@@ -463,7 +454,6 @@ export declare const allFieldTypes: ({
463
454
  stateFieldName?: undefined;
464
455
  center?: undefined;
465
456
  leftLabel?: undefined;
466
- checkLegible?: undefined;
467
457
  placeholderInitials?: undefined;
468
458
  menuOptions?: undefined;
469
459
  switchType?: undefined;
@@ -502,7 +492,6 @@ export declare const allFieldTypes: ({
502
492
  stateFieldName?: undefined;
503
493
  center?: undefined;
504
494
  leftLabel?: undefined;
505
- checkLegible?: undefined;
506
495
  placeholderInitials?: undefined;
507
496
  menuOptions?: undefined;
508
497
  switchType?: undefined;
@@ -541,7 +530,6 @@ export declare const allFieldTypes: ({
541
530
  countyFieldName?: undefined;
542
531
  center?: undefined;
543
532
  leftLabel?: undefined;
544
- checkLegible?: undefined;
545
533
  placeholderInitials?: undefined;
546
534
  menuOptions?: undefined;
547
535
  switchType?: undefined;
@@ -579,7 +567,6 @@ export declare const allFieldTypes: ({
579
567
  maxDateUnix?: undefined;
580
568
  countyFieldName?: undefined;
581
569
  stateFieldName?: undefined;
582
- checkLegible?: undefined;
583
570
  placeholderInitials?: undefined;
584
571
  menuOptions?: undefined;
585
572
  switchType?: undefined;
@@ -618,46 +605,6 @@ export declare const allFieldTypes: ({
618
605
  stateFieldName?: undefined;
619
606
  center?: undefined;
620
607
  leftLabel?: undefined;
621
- checkLegible?: undefined;
622
- placeholderInitials?: undefined;
623
- menuOptions?: undefined;
624
- switchType?: undefined;
625
- selectOptions?: undefined;
626
- label?: undefined;
627
- toggles?: undefined;
628
- region?: undefined;
629
- checkboxes?: undefined;
630
- maskedRadios?: undefined;
631
- };
632
- initialValue?: undefined;
633
- required?: undefined;
634
- width?: undefined;
635
- header?: undefined;
636
- separator?: undefined;
637
- subHeader?: undefined;
638
- text?: undefined;
639
- validationMessage?: undefined;
640
- inlineFields?: undefined;
641
- } | {
642
- fieldLabel: string;
643
- name: string;
644
- type: FormFieldTypeEnum;
645
- options: {
646
- helperText: string;
647
- checkLegible: boolean;
648
- placeholder?: undefined;
649
- disabled?: undefined;
650
- showIcon?: undefined;
651
- clearButton?: undefined;
652
- showFlag?: undefined;
653
- radios?: undefined;
654
- characterLimit?: undefined;
655
- initialValue?: undefined;
656
- maxDateUnix?: undefined;
657
- countyFieldName?: undefined;
658
- stateFieldName?: undefined;
659
- center?: undefined;
660
- leftLabel?: undefined;
661
608
  placeholderInitials?: undefined;
662
609
  menuOptions?: undefined;
663
610
  switchType?: undefined;
@@ -698,7 +645,6 @@ export declare const allFieldTypes: ({
698
645
  stateFieldName?: undefined;
699
646
  center?: undefined;
700
647
  leftLabel?: undefined;
701
- checkLegible?: undefined;
702
648
  menuOptions?: undefined;
703
649
  switchType?: undefined;
704
650
  selectOptions?: undefined;
@@ -738,7 +684,6 @@ export declare const allFieldTypes: ({
738
684
  stateFieldName?: undefined;
739
685
  center?: undefined;
740
686
  leftLabel?: undefined;
741
- checkLegible?: undefined;
742
687
  placeholderInitials?: undefined;
743
688
  selectOptions?: undefined;
744
689
  label?: undefined;
@@ -786,7 +731,6 @@ export declare const allFieldTypes: ({
786
731
  stateFieldName?: undefined;
787
732
  center?: undefined;
788
733
  leftLabel?: undefined;
789
- checkLegible?: undefined;
790
734
  placeholderInitials?: undefined;
791
735
  menuOptions?: undefined;
792
736
  switchType?: undefined;
@@ -826,7 +770,6 @@ export declare const allFieldTypes: ({
826
770
  stateFieldName?: undefined;
827
771
  center?: undefined;
828
772
  leftLabel?: undefined;
829
- checkLegible?: undefined;
830
773
  placeholderInitials?: undefined;
831
774
  menuOptions?: undefined;
832
775
  switchType?: undefined;
@@ -878,7 +821,6 @@ export declare const allFieldTypes: ({
878
821
  stateFieldName?: undefined;
879
822
  center?: undefined;
880
823
  leftLabel?: undefined;
881
- checkLegible?: undefined;
882
824
  placeholderInitials?: undefined;
883
825
  menuOptions?: undefined;
884
826
  switchType?: undefined;
@@ -915,7 +857,6 @@ export declare const allFieldTypes: ({
915
857
  stateFieldName?: undefined;
916
858
  center?: undefined;
917
859
  leftLabel?: undefined;
918
- checkLegible?: undefined;
919
860
  placeholderInitials?: undefined;
920
861
  menuOptions?: undefined;
921
862
  switchType?: undefined;
@@ -983,7 +924,6 @@ export declare const allFieldTypes: ({
983
924
  countyFieldName?: undefined;
984
925
  stateFieldName?: undefined;
985
926
  center?: undefined;
986
- checkLegible?: undefined;
987
927
  placeholderInitials?: undefined;
988
928
  menuOptions?: undefined;
989
929
  switchType?: undefined;
@@ -1030,7 +970,6 @@ export declare const allFieldTypes: ({
1030
970
  stateFieldName?: undefined;
1031
971
  center?: undefined;
1032
972
  leftLabel?: undefined;
1033
- checkLegible?: undefined;
1034
973
  placeholderInitials?: undefined;
1035
974
  menuOptions?: undefined;
1036
975
  switchType?: undefined;
@@ -1091,7 +1030,6 @@ export declare const allFieldTypes: ({
1091
1030
  stateFieldName?: undefined;
1092
1031
  center?: undefined;
1093
1032
  leftLabel?: undefined;
1094
- checkLegible?: undefined;
1095
1033
  placeholderInitials?: undefined;
1096
1034
  menuOptions?: undefined;
1097
1035
  switchType?: undefined;
@@ -151,7 +151,7 @@ export interface ValuesType {
151
151
  export interface ShowIfType {
152
152
  values: ValuesType;
153
153
  }
154
- type OptionTypes = AddressOptionsType | CheckboxOptionsType | CheckboxGroupOptionsType | ColorPickerOptionsType | CountySelectOptionsType | CountrySelectOptionsType | CreditCardOptionsType | CurrencyOptionsType | DatePickerOptionsType | DescriptiveDropdownInputOptionsType | EmailOptionsType | HiddenOptionsType | ImagePickerOptionsType | IconCheckboxesOptionsType | MultiSelectOptionsType | NumberOptionsType | PasswordOptionsType | PhoneOptionsType | RadioGroupOptionsType | SelectOptionsType | SocialSecurityOptionsType | StateSelectOptionsType | TextOptionsType | TextareaOptionsType | ToggleOptionsType | ToggleGroupOptionsType | ZipCodeOptionsType;
154
+ type OptionTypes = AddressOptionsType | CheckboxOptionsType | CheckboxGroupOptionsType | CountySelectOptionsType | CountrySelectOptionsType | CreditCardOptionsType | CurrencyOptionsType | DatePickerOptionsType | DescriptiveDropdownInputOptionsType | EmailOptionsType | HiddenOptionsType | ImagePickerOptionsType | IconCheckboxesOptionsType | MultiSelectOptionsType | NumberOptionsType | PasswordOptionsType | PhoneOptionsType | RadioGroupOptionsType | SelectOptionsType | SocialSecurityOptionsType | StateSelectOptionsType | TextOptionsType | TextareaOptionsType | ToggleOptionsType | ToggleGroupOptionsType | ZipCodeOptionsType;
155
155
  export interface AddButtonType {
156
156
  addFunction: () => void;
157
157
  color?: ButtonColorFamilyEnum;
@@ -193,22 +193,6 @@ export interface CheckboxGroupOptionsType {
193
193
  breakText?: boolean;
194
194
  onCheckboxClick?: (event: ChangeEvent<HTMLInputElement>) => void;
195
195
  }
196
- export interface ColorPickerOptionsType {
197
- checkLegible?: boolean;
198
- helperText?: string | ReactElement;
199
- innerRef?: RefObject<HTMLInputElement>;
200
- instructionalText?: string;
201
- legibleAgainst?: string;
202
- onEnter?: () => void;
203
- onInputBlur?: (event: FocusEvent<HTMLInputElement>) => void;
204
- onInputFocus?: () => void;
205
- onChange?: (event: {
206
- target: {
207
- value: string;
208
- name?: string;
209
- };
210
- }) => void;
211
- }
212
196
  export interface ConfigurableInputOptionsType {
213
197
  clearButton?: boolean;
214
198
  defaultId?: string;
@@ -616,7 +600,6 @@ export declare enum FormFieldTypeEnum {
616
600
  Address = "ADDRESS",
617
601
  Checkbox = "CHECKBOX",
618
602
  CheckboxGroup = "CHECKBOX_GROUP",
619
- ColorPicker = "COLOR_PICKER",
620
603
  ConfigurableInput = "CONFIGURABLE_INPUT",
621
604
  CountySelect = "COUNTY_SELECT",
622
605
  CountrySelect = "COUNTRY_SELECT",
@@ -701,23 +684,6 @@ export interface CheckboxGroupFieldProps {
701
684
  submitAttempt: boolean;
702
685
  submitOnBlur?: boolean;
703
686
  }
704
- export interface ColorPickerFieldType extends Omit<FormFieldType, "options"> {
705
- options?: ColorPickerOptionsType;
706
- }
707
- export declare const isColorPicker: (field: FormFieldType) => field is ColorPickerFieldType;
708
- export interface ColorPickerFieldProps {
709
- fade?: boolean;
710
- field: ColorPickerFieldType;
711
- formikProps: any;
712
- leftLabels?: boolean;
713
- leftLabelWidth?: number;
714
- leftLabelsRightGutter?: number;
715
- rowGap?: number;
716
- setHasValues: Dispatch<SetStateAction<boolean>>;
717
- setSubmitAttempt: Dispatch<SetStateAction<boolean>>;
718
- submitAttempt: boolean;
719
- submitOnBlur?: boolean;
720
- }
721
687
  export interface ConfigurableInputFieldType extends Omit<FormFieldType, "options"> {
722
688
  options: ConfigurableInputOptionsType;
723
689
  }
@@ -1116,7 +1082,7 @@ export interface InlineFieldType {
1116
1082
  validationFunction?: YupSchema;
1117
1083
  nextGap?: number;
1118
1084
  }
1119
- type SplitLineOptionTypes = AddressOptionsType | CheckboxOptionsType | ColorPickerOptionsType | CountySelectOptionsType | CountrySelectOptionsType | CreditCardOptionsType | CurrencyOptionsType | DatePickerOptionsType | DescriptiveDropdownInputOptionsType | EmailOptionsType | ImagePickerOptionsType | MultiSelectOptionsType | NumberOptionsType | PasswordOptionsType | PhoneOptionsType | SelectOptionsType | SocialSecurityOptionsType | StateSelectOptionsType | TextOptionsType | ToggleOptionsType | ZipCodeOptionsType;
1085
+ type SplitLineOptionTypes = AddressOptionsType | CheckboxOptionsType | CountySelectOptionsType | CountrySelectOptionsType | CreditCardOptionsType | CurrencyOptionsType | DatePickerOptionsType | DescriptiveDropdownInputOptionsType | EmailOptionsType | ImagePickerOptionsType | MultiSelectOptionsType | NumberOptionsType | PasswordOptionsType | PhoneOptionsType | SelectOptionsType | SocialSecurityOptionsType | StateSelectOptionsType | TextOptionsType | ToggleOptionsType | ZipCodeOptionsType;
1120
1086
  export declare const isSplitLine: (field: SingleOrMultipleFieldType) => field is SplitLineFieldType;
1121
1087
  export interface SplitLineFieldProps {
1122
1088
  fade?: boolean;
@@ -9,7 +9,6 @@ export { CheckboxGroup } from "./components/CheckboxGroup";
9
9
  export { ClearableTag } from "./components/ClearableTag";
10
10
  export { ClickOutHandler } from "./components/ClickOutHandler";
11
11
  export { ColorButton } from "./components/ColorButton";
12
- export { ColorPickerInput, InlineColorPickerInput } from "./components/ColorPickerInput";
13
12
  export { ColorPickerMenu } from "./components/ColorPickerMenu";
14
13
  export { ConfigurableInput } from "./components/ConfigurableInput";
15
14
  export { ConfirmModal } from "./components/ConfirmModal";
@@ -102,7 +101,6 @@ export { usStates } from "./const/usStates";
102
101
  export { addOrRemoveById, addOrRemoveString, getObjectById, makeIdString, removeById, removeByIdArray, removeString, replaceObjectById, setAllKeysToValue, setObjectById, toggleObjectById, } from "./helpers/arrays";
103
102
  export { getPosition } from "./helpers/position";
104
103
  export { pressedEnter, higherContrast } from "./helpers/accessibility";
105
- export { validateColorContrast, validateColorContrastWithMessage } from "./helpers/colorValidators";
106
104
  export { northAmericanPhoneMask, colombianPhoneMask, brazilianPhoneMask, mexicanPhoneMask } from "./helpers/inputMasks";
107
105
  export { formatBytesToString, formatNumberToString } from "./helpers/numbers";
108
106
  export { northAmericanNumberingPlanRegex, validateRegex } from "./helpers/phoneValidators";
@@ -138,7 +136,6 @@ export type { CheckboxItemType } from "./components/CheckboxItem";
138
136
  export type { ClearableTagType } from "./components/ClearableTag";
139
137
  export type { ClickOutHandlerType } from "./components/ClickOutHandler";
140
138
  export type { ColorButtonType } from "./components/ColorButton";
141
- export type { ColorPickerInputType, ColorPickerInputThemeOverride, ThemeOverride as InlineColorPickerInputThemeOverride, } from "./components/ColorPickerInput";
142
139
  export type { ColorPickerMenuType } from "./components/ColorPickerMenu";
143
140
  export type { ConfigurableInputType, MaskedRadioType } from "./components/ConfigurableInput";
144
141
  export type { ConfirmModalType } from "./components/ConfirmModal";
@@ -152,13 +149,12 @@ export type { DrawerDividerType } from "./components/Drawer/DrawerDivider";
152
149
  export type { EmailInputType } from "./components/EmailInput";
153
150
  export type { FiltersBarType } from "./components/FiltersBar";
154
151
  export type { FooterProps } from "./components/Footer";
155
- export type { AddressOptionsType, CheckboxOptionsType, CheckboxGroupOptionsType, ColorPickerOptionsType, CountySelectOptionsType, CreditCardOptionsType, CurrencyOptionsType, DatePickerOptionsType, EmailOptionsType, FormFieldType, FormReturnType, FormWrapperType, IconCheckboxesOptionsType, MultiSelectOptionsType, NationalitySelectOptionsType, NumberOptionsType, PasswordOptionsType, PhoneOptionsType, RadioGroupOptionsType, RemovableFieldType, SelectOptionType, SelectOptionsType, ShowIfType, SingleOrMultipleFieldType, SocialSecurityOptionsType, SplitLineFieldType, StateSelectOptionsType, TextOptionsType, TextareaOptionsType, ToggleOptionsType, ToggleGroupOptionsType, ZipCodeOptionsType, } from "./components/Form";
152
+ export type { AddressOptionsType, CheckboxOptionsType, CheckboxGroupOptionsType, CountySelectOptionsType, CreditCardOptionsType, CurrencyOptionsType, DatePickerOptionsType, EmailOptionsType, FormFieldType, FormReturnType, FormWrapperType, IconCheckboxesOptionsType, MultiSelectOptionsType, NationalitySelectOptionsType, NumberOptionsType, PasswordOptionsType, PhoneOptionsType, RadioGroupOptionsType, RemovableFieldType, SelectOptionType, SelectOptionsType, ShowIfType, SingleOrMultipleFieldType, SocialSecurityOptionsType, SplitLineFieldType, StateSelectOptionsType, TextOptionsType, TextareaOptionsType, ToggleOptionsType, ToggleGroupOptionsType, ZipCodeOptionsType, } from "./components/Form";
156
153
  export type { HorizontalTabMenuType } from "./components/HorizontalTabMenu";
157
154
  export type { IconButtonType } from "./components/IconButton";
158
155
  export type { IconProps, IconType } from "./components/Icons";
159
156
  export type { IconTileType } from "./components/IconTile";
160
157
  export type { ImagePickerType } from "./components/ImagePicker";
161
- export type { InlineColorPickerInputType } from "./components/ColorPickerInput";
162
158
  export type { InlineEmailInputType } from "./components/InlineEmailInput";
163
159
  export type { InlineCreditCardInputType } from "./components/InlineCreditCardInput";
164
160
  export type { InlineCurrencyInputType } from "./components/InlineCurrencyInput";
@@ -53,11 +53,6 @@ interface ColorButtonTheme {
53
53
  focusColor: string;
54
54
  borderColor: string;
55
55
  }
56
- interface ColorPickerInputTheme {
57
- instructionalTextColor: string;
58
- instructionalTextFontSize: number;
59
- padding: number;
60
- }
61
56
  interface ColorPickerTheme {
62
57
  borderColor: string;
63
58
  buttonSize: number;
@@ -589,7 +584,6 @@ interface CustomTheme {
589
584
  colorButton: ColorButtonTheme;
590
585
  colorFamilies: ColorFamilyTheme;
591
586
  colorPicker: ColorPickerTheme;
592
- colorPickerInput: ColorPickerInputTheme;
593
587
  colorPickerMenu: ColorPickerMenuTheme;
594
588
  configurableInput: ConfigurableInputTheme;
595
589
  confirmModal: ConfirmModalTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerebruminc/cerebellum",
3
- "version": "16.1.1-beta.dangerous.94a8f04",
3
+ "version": "16.1.1-beta.dangerous.bc77c27",
4
4
  "description": "Cerebrum's React Component Library",
5
5
  "type": "module",
6
6
  "main": "lib/cjs/index.cjs",
@@ -114,7 +114,7 @@
114
114
  "rollup-plugin-typescript2": "^0.36.0",
115
115
  "rollup-plugin-visualizer": "^5.12.0",
116
116
  "storybook": "^9.0.0",
117
- "ts-jest": "29.3.4",
117
+ "ts-jest": "29.4.5",
118
118
  "ts-patch": "^3.2.1",
119
119
  "typescript": "^5.8.3",
120
120
  "typescript-transform-paths": "^3.4.6",
@@ -1,187 +0,0 @@
1
- 'use strict';
2
-
3
- var _tslib = require('./_tslib-ByDtMVOd.js');
4
- var jsxRuntime = require('react/jsx-runtime');
5
- var React = require('react');
6
- var styled = require('styled-components');
7
- var BodyLEmphasis = require('./BodyLEmphasis.cjs');
8
- var useMeasure = require('./useMeasure-CDq3dPfD.js');
9
- var showLabel = require('./showLabel-BkZISyqw.js');
10
- var Inputs = require('./Inputs-IaHMnBKw.js');
11
- var pressedEnter = require('./pressedEnter.cjs');
12
- var validateColorContrast = require('./validateColorContrast.cjs');
13
-
14
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
15
-
16
- var styled__default = /*#__PURE__*/_interopDefault(styled);
17
-
18
- // Container that holds both the input and the text side by side
19
- var ColorPickerContainer = styled__default.default.div(templateObject_1$1 || (templateObject_1$1 = _tslib.__makeTemplateObject(["\n align-items: center;\n display: flex;\n flex-wrap: nowrap;\n gap: 12px;\n"], ["\n align-items: center;\n display: flex;\n flex-wrap: nowrap;\n gap: 12px;\n"])));
20
- var ColorInputWrapper = styled__default.default.div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n align-items: center;\n background: ", ";\n border: solid 1px ", ";\n border-radius: ", "px;\n display: flex;\n flex-shrink: 0; /* Prevent the square from shrinking */\n height: ", "px;\n justify-content: center;\n min-width: ", "px;\n padding: ", "px;\n position: relative;\n transition: border-color 350ms ease-out 50ms, background-color 350ms ease-out 50ms;\n /* Make the wrapper square based on inputHeight, with a larger default for color pickers */\n width: ", "px;\n \n &:hover {\n border-color: ", ";\n }\n \n &:focus-within {\n border-color: ", ";\n }\n"], ["\n align-items: center;\n background: ", ";\n border: solid 1px ", ";\n border-radius: ", "px;\n display: flex;\n flex-shrink: 0; /* Prevent the square from shrinking */\n height: ", "px;\n justify-content: center;\n min-width: ", "px;\n padding: ", "px;\n position: relative;\n transition: border-color 350ms ease-out 50ms, background-color 350ms ease-out 50ms;\n /* Make the wrapper square based on inputHeight, with a larger default for color pickers */\n width: ", "px;\n \n &:hover {\n border-color: ", ";\n }\n \n &:focus-within {\n border-color: ", ";\n }\n"])), function (_a) {
21
- var _b;
22
- var $themeOverride = _a.$themeOverride, theme = _a.theme;
23
- return ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.inputBackgroundColor) || ((_b = theme.input) === null || _b === void 0 ? void 0 : _b.inputBackgroundColor);
24
- }, function (_a) {
25
- var _b, _c, _d;
26
- var $disabled = _a.$disabled, theme = _a.theme, $showValidationMessage = _a.$showValidationMessage, $themeOverride = _a.$themeOverride;
27
- return $showValidationMessage
28
- ? ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.failColor) || ((_b = theme.input) === null || _b === void 0 ? void 0 : _b.failColor)
29
- : $disabled
30
- ? ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.disabledBorderColor) || ((_c = theme.input) === null || _c === void 0 ? void 0 : _c.disabledBorderColor)
31
- : ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.inactiveBorderColor) || ((_d = theme.input) === null || _d === void 0 ? void 0 : _d.inactiveBorderColor);
32
- }, function (_a) {
33
- var $themeOverride = _a.$themeOverride, theme = _a.theme;
34
- return ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.inputBorderRadius) || theme.input.inputBorderRadius;
35
- }, function (_a) {
36
- var $themeOverride = _a.$themeOverride, theme = _a.theme;
37
- return ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.inputHeight) || theme.input.inputHeight;
38
- }, function (_a) {
39
- var $themeOverride = _a.$themeOverride, theme = _a.theme;
40
- return ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.inputHeight) || theme.input.inputHeight;
41
- }, function (_a) {
42
- var _b;
43
- var $themeOverride = _a.$themeOverride, theme = _a.theme;
44
- return (_b = $themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.inputPadding) !== null && _b !== void 0 ? _b : theme.colorPickerInput.padding;
45
- }, function (_a) {
46
- var $themeOverride = _a.$themeOverride, theme = _a.theme;
47
- return ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.inputHeight) || theme.input.inputHeight;
48
- }, function (_a) {
49
- var _b, _c, _d;
50
- var $disabled = _a.$disabled, theme = _a.theme, $showValidationMessage = _a.$showValidationMessage, $themeOverride = _a.$themeOverride;
51
- return $showValidationMessage
52
- ? ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.failColor) || ((_b = theme.input) === null || _b === void 0 ? void 0 : _b.failColor)
53
- : $disabled
54
- ? ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.disabledBorderColor) || ((_c = theme.input) === null || _c === void 0 ? void 0 : _c.disabledBorderColor)
55
- : ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.hoverBorderColor) || ((_d = theme.input) === null || _d === void 0 ? void 0 : _d.hoverBorderColor);
56
- }, function (_a) {
57
- var _b, _c, _d;
58
- var $disabled = _a.$disabled, theme = _a.theme, $showValidationMessage = _a.$showValidationMessage, $themeOverride = _a.$themeOverride;
59
- return $showValidationMessage
60
- ? ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.failColor) || ((_b = theme.input) === null || _b === void 0 ? void 0 : _b.failColor)
61
- : $disabled
62
- ? ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.disabledBorderColor) || ((_c = theme.input) === null || _c === void 0 ? void 0 : _c.disabledBorderColor)
63
- : ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.activeBorderColor) || ((_d = theme.input) === null || _d === void 0 ? void 0 : _d.activeBorderColor);
64
- });
65
- // Custom styled color input that is 90% of the wrapper size and centered
66
- var ColorInput = styled__default.default.input(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n background: none;\n border-radius: 4px;\n border: none;\n cursor: ", ";\n height: 90%;\n opacity: ", ";\n outline: none;\n width: 90%;\n \n /* Remove the default color input outline/border and ensure color is visible */\n &::-webkit-color-swatch-wrapper {\n border-radius: 4px;\n border: none;\n padding: 0;\n }\n \n &::-webkit-color-swatch {\n border: none;\n border-radius: 4px;\n outline: none;\n }\n \n &::-moz-color-swatch {\n border: none;\n border-radius: 4px;\n outline: none;\n }\n \n /* Firefox specific fixes */\n &::-moz-focus-inner {\n border: none;\n padding: 0;\n }\n \n &:focus {\n outline: none;\n }\n"], ["\n background: none;\n border-radius: 4px;\n border: none;\n cursor: ", ";\n height: 90%;\n opacity: ", ";\n outline: none;\n width: 90%;\n \n /* Remove the default color input outline/border and ensure color is visible */\n &::-webkit-color-swatch-wrapper {\n border-radius: 4px;\n border: none;\n padding: 0;\n }\n \n &::-webkit-color-swatch {\n border: none;\n border-radius: 4px;\n outline: none;\n }\n \n &::-moz-color-swatch {\n border: none;\n border-radius: 4px;\n outline: none;\n }\n \n /* Firefox specific fixes */\n &::-moz-focus-inner {\n border: none;\n padding: 0;\n }\n \n &:focus {\n outline: none;\n }\n"])), function (_a) {
67
- var $disabled = _a.$disabled;
68
- return ($disabled ? "not-allowed" : "pointer");
69
- }, function (_a) {
70
- var $disabled = _a.$disabled;
71
- return ($disabled ? 0.5 : 1);
72
- });
73
- // Legibility text component that displays to the right, vertically centered
74
- var LegibilityText = styled__default.default.div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n color: ", ";\n font-size: ", "px;\n opacity: ", ";\n white-space: nowrap;\n"], ["\n color: ", ";\n font-size: ", "px;\n opacity: ", ";\n white-space: nowrap;\n"])), function (_a) {
75
- var _b, _c;
76
- var $disabled = _a.$disabled, $themeOverride = _a.$themeOverride, theme = _a.theme;
77
- return $disabled ? ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.disabledColor) || ((_b = theme.input) === null || _b === void 0 ? void 0 : _b.disabledColor) : (_c = theme.input) === null || _c === void 0 ? void 0 : _c.helperTextColor;
78
- }, function (_a) {
79
- var _b;
80
- var theme = _a.theme;
81
- return (((_b = theme.input) === null || _b === void 0 ? void 0 : _b.textFontSize) || 14) - 2;
82
- }, function (_a) {
83
- var $disabled = _a.$disabled;
84
- return ($disabled ? 0.5 : 1);
85
- });
86
- var InlineColorPickerInput = function (_a) {
87
- var _b = _a.checkLegible, checkLegible = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, focus = _a.focus, innerRef = _a.innerRef, inputLabel = _a.inputLabel, _d = _a.legibleAgainst, legibleAgainst = _d === void 0 ? "#ffffff" : _d, name = _a.name, onChange = _a.onChange, onEnter = _a.onEnter, onInputBlur = _a.onInputBlur, onInputFocus = _a.onInputFocus, onValueChange = _a.onValueChange, _e = _a.showValidationMessage, showValidationMessage = _e === void 0 ? false : _e, themeOverride = _a.themeOverride, value = _a.value;
88
- var inputRef = innerRef || React.useRef(null);
89
- // Calculate legibility and dynamic text
90
- var legibilityInfo = React.useMemo(function () {
91
- if (!checkLegible || !value) {
92
- return { isLegible: true, legibilityText: undefined };
93
- }
94
- try {
95
- var isLegible = validateColorContrast.validateColorContrast(value, legibleAgainst);
96
- var legibilityText = void 0;
97
- if (isLegible) {
98
- legibilityText = "✅ Looks good";
99
- }
100
- else {
101
- // Determine if we need lighter or darker
102
- // If contrast with black is greater, the color is light and needs to be darker
103
- // If contrast with white is greater, the color is dark and needs to be lighter
104
- var needsDarker = pressedEnter.contrast(value, "#000000") > pressedEnter.contrast(value, "#ffffff");
105
- legibilityText = needsDarker ? "⚠️ Too light" : "⚠️ Too dark";
106
- }
107
- return { isLegible: isLegible, legibilityText: legibilityText };
108
- }
109
- catch (error) {
110
- // If there's an error in contrast calculation, assume it's legible
111
- return { isLegible: true, legibilityText: undefined };
112
- }
113
- }, [checkLegible, value, legibleAgainst]);
114
- React.useEffect(function () {
115
- var _a;
116
- if (focus) {
117
- (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
118
- }
119
- }, [focus]);
120
- return (jsxRuntime.jsxs(ColorPickerContainer, { children: [jsxRuntime.jsx(ColorInputWrapper, { "$disabled": disabled, "$showValidationMessage": showValidationMessage || (checkLegible && !legibilityInfo.isLegible), "$themeOverride": themeOverride, children: jsxRuntime.jsx(ColorInput, _tslib.__assign({ ref: inputRef, type: "color", value: value, disabled: disabled, "$disabled": disabled, "$themeOverride": themeOverride }, (name ? { name: name } : {}), { onChange: function (event) {
121
- onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(event.target.value);
122
- onChange === null || onChange === void 0 ? void 0 : onChange({
123
- target: {
124
- value: event.target.value,
125
- name: name,
126
- selectionStart: event.target.selectionStart || undefined,
127
- selectionEnd: event.target.selectionEnd || undefined,
128
- },
129
- nativeEvent: event.nativeEvent,
130
- });
131
- }, onBlur: function (event) {
132
- if (onInputBlur) {
133
- onInputBlur(event);
134
- }
135
- }, onFocus: function (event) {
136
- if (onInputFocus) {
137
- onInputFocus(event);
138
- }
139
- }, onKeyDown: function (event) {
140
- if (event.key === "Enter" && onEnter) {
141
- onEnter(value);
142
- }
143
- }, "aria-label": typeof inputLabel === "string" ? inputLabel : undefined })) }), checkLegible && legibilityInfo.legibilityText && (jsxRuntime.jsx(LegibilityText, { "$isLegible": legibilityInfo.isLegible, "$disabled": disabled, "$themeOverride": themeOverride, children: legibilityInfo.legibilityText }))] }));
144
- };
145
- var templateObject_1$1, templateObject_2, templateObject_3, templateObject_4;
146
-
147
- var InstructionalText = styled__default.default(BodyLEmphasis.BodyXSPrimary)(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n\tcolor: ", ";\n\tfont-size: ", "px;\n\tmargin-bottom: ", "px;\n"], ["\n\tcolor: ", ";\n\tfont-size: ", "px;\n\tmargin-bottom: ", "px;\n"])), function (_a) {
148
- var theme = _a.theme, $themeOverride = _a.$themeOverride;
149
- return ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.instructionalTextColor) || theme.colorPickerInput.instructionalTextColor;
150
- }, function (_a) {
151
- var theme = _a.theme, $themeOverride = _a.$themeOverride;
152
- return ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.instructionalTextFontSize) || theme.colorPickerInput.instructionalTextFontSize;
153
- }, function (_a) {
154
- var theme = _a.theme, $themeOverride = _a.$themeOverride;
155
- return ($themeOverride === null || $themeOverride === void 0 ? void 0 : $themeOverride.instructionalTextFontSize) || theme.colorPickerInput.instructionalTextFontSize;
156
- });
157
- var ColorPickerInput = function (props) {
158
- var _a = props.checkLegible, checkLegible = _a === void 0 ? false : _a, _b = props.disabled, disabled = _b === void 0 ? false : _b, helperText = props.helperText, inputLabel = props.inputLabel, inputWidth = props.inputWidth, instructionalText = props.instructionalText, _c = props.showValidationMessage, showValidationMessage = _c === void 0 ? false : _c, themeOverride = props.themeOverride, validationMessage = props.validationMessage;
159
- var labelBoxRef = React.useRef(null);
160
- var _d = useMeasure.useMeasure(), inputGroupRef = _d[0], inputGroupMeasure = _d[1];
161
- var validationRef = React.useRef(null);
162
- var _e = React.useState(false), designSwitch = _e[0], setDesignSwitch = _e[1];
163
- var helperTextVisible = !showValidationMessage || !designSwitch;
164
- React.useEffect(function () {
165
- var _a, _b;
166
- var validationWidth = ((_a = validationRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0;
167
- var labelWidth = ((_b = labelBoxRef.current) === null || _b === void 0 ? void 0 : _b.clientWidth) || 0;
168
- var noRoomForTopLabel = validationWidth + labelWidth >= inputGroupMeasure.width;
169
- if (noRoomForTopLabel) {
170
- setDesignSwitch(true);
171
- }
172
- else {
173
- setDesignSwitch(false);
174
- }
175
- }, [inputGroupMeasure.width, showValidationMessage, inputLabel, validationMessage]);
176
- return (jsxRuntime.jsxs(Inputs.InputGroup, { ref: inputGroupRef, "$inputWidth": inputWidth, "$roomForError": showValidationMessage && !inputLabel, children: [jsxRuntime.jsx(Inputs.LabelBox, { ref: labelBoxRef, children: showLabel.showLabel({
177
- inputLabel: inputLabel,
178
- disabled: disabled,
179
- disabledColor: themeOverride === null || themeOverride === void 0 ? void 0 : themeOverride.disabledColor,
180
- labelColor: themeOverride === null || themeOverride === void 0 ? void 0 : themeOverride.labelColor,
181
- }) }), instructionalText && jsxRuntime.jsx(InstructionalText, { "$themeOverride": themeOverride, children: instructionalText }), jsxRuntime.jsx(InlineColorPickerInput, _tslib.__assign({}, props, { checkLegible: checkLegible, themeOverride: themeOverride })), jsxRuntime.jsx(Inputs.ValidationText, { ref: validationRef, "$showValidationMessage": showValidationMessage, "$disabled": disabled, "$failColor": themeOverride === null || themeOverride === void 0 ? void 0 : themeOverride.failColor, "$disabledColor": themeOverride === null || themeOverride === void 0 ? void 0 : themeOverride.disabledColor, "$designSwitch": designSwitch && showValidationMessage, children: validationMessage }), helperTextVisible && (jsxRuntime.jsx(Inputs.HelperText, { "$disabled": disabled, "$helperTextColor": themeOverride === null || themeOverride === void 0 ? void 0 : themeOverride.helperTextColor, "$disabledColor": themeOverride === null || themeOverride === void 0 ? void 0 : themeOverride.disabledColor, "data-sentry-unmask": true, children: helperText }))] }));
182
- };
183
- var templateObject_1;
184
-
185
- exports.ColorPickerInput = ColorPickerInput;
186
- exports.InlineColorPickerInput = InlineColorPickerInput;
187
- //# sourceMappingURL=ColorPickerInput-CBPI8IJ-.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ColorPickerInput-CBPI8IJ-.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,25 +0,0 @@
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=ColorPickerInput.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ColorPickerInput.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}