@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,50 +0,0 @@
1
- import { contrast } from './pressedEnter.js';
2
-
3
- /**
4
- * Validates that a color has sufficient contrast against a background color
5
- * according to WCAG AA accessibility standards (4.5:1 ratio for normal text).
6
- *
7
- * @param color - The foreground color (hex format, e.g., "#ff0000")
8
- * @param backgroundColor - The background color to check against (hex format, defaults to "#ffffff")
9
- * @returns boolean - true if the contrast ratio is >= 4.5:1, false otherwise
10
- */
11
- var validateColorContrast = function (color, backgroundColor) {
12
- if (backgroundColor === void 0) { backgroundColor = "#ffffff"; }
13
- if (!color) {
14
- return true; // Allow empty values, let required validation handle this
15
- }
16
- try {
17
- var contrastRatio = contrast(color, backgroundColor);
18
- // WCAG AA requires 4.5:1 for normal text, 3:1 for large text
19
- // Using 4.5 as the threshold for accessibility compliance
20
- return contrastRatio >= 4.5;
21
- }
22
- catch (error) {
23
- // If there's an error in contrast calculation (invalid color format, etc.)
24
- // return true to avoid blocking the form, let other validation handle format issues
25
- return true;
26
- }
27
- };
28
- /**
29
- * Validates that a color has sufficient contrast against a background color
30
- * and returns an error message if validation fails.
31
- *
32
- * @param color - The foreground color (hex format, e.g., "#ff0000")
33
- * @param backgroundColor - The background color to check against (hex format, defaults to "#ffffff")
34
- * @param errorMessage - Custom error message (optional)
35
- * @returns string | null - Error message if validation fails, null if valid
36
- */
37
- var validateColorContrastWithMessage = function (color, backgroundColor, errorMessage) {
38
- if (backgroundColor === void 0) { backgroundColor = "#ffffff"; }
39
- if (!color) {
40
- return null; // Allow empty values, let required validation handle this
41
- }
42
- var isValid = validateColorContrast(color, backgroundColor);
43
- if (!isValid) {
44
- return errorMessage || "This color does not have sufficient contrast for accessibility";
45
- }
46
- return null;
47
- };
48
-
49
- export { validateColorContrast, validateColorContrastWithMessage };
50
- //# sourceMappingURL=validateColorContrast.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateColorContrast.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,3 +0,0 @@
1
- import './pressedEnter.js';
2
- export { validateColorContrast, validateColorContrastWithMessage } from './validateColorContrast.js';
3
- //# sourceMappingURL=validateColorContrastWithMessage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateColorContrastWithMessage.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,3 +0,0 @@
1
- import { FC } from "react";
2
- import { ColorPickerInputType } from "./types";
3
- export declare const ColorPickerInput: FC<ColorPickerInputType>;
@@ -1,3 +0,0 @@
1
- import { FC } from "react";
2
- import { InlineColorPickerInputType } from "./types";
3
- export declare const InlineColorPickerInput: FC<InlineColorPickerInputType>;
@@ -1,3 +0,0 @@
1
- export { ColorPickerInput } from "./ColorPickerInput";
2
- export { InlineColorPickerInput } from "./InlineColorPickerInput";
3
- export type { ColorPickerInputType, InlineColorPickerInputType, ThemeOverride, ColorPickerInputThemeOverride } from "./types";
@@ -1,48 +0,0 @@
1
- import { ReactElement, ReactNode } from "react";
2
- import { InlineInputType } from "../InlineInput";
3
- export interface InlineColorPickerInputType extends Omit<InlineInputType, "activeColor" | "characterLimit" | "clearButton" | "failColor" | "failColorSecondary" | "inputMode" | "LeadingIcon" | "lookLikeAButton" | "numberArrows" | "onValueChange" | "placeholder" | "placeholderColor" | "required" | "step" | "textColor" | "TrailingIcon" | "trailingIconColor" | "trailingIconFunction" | "trailingText" | "type" | "value"> {
4
- /** If true, checks if the color is legible against the background color */
5
- checkLegible?: boolean;
6
- /** The background color to check legibility against. Defaults to #ffffff (white) */
7
- legibleAgainst?: string;
8
- /** Called when the value is changed & returns the new value. Required if you want to update `value`. If not present, `InlineColorPickerInput` becomes a display only component */
9
- onValueChange?: (value: string) => void;
10
- /** You can override the theme by passing a `themeOverride` object. */
11
- themeOverride?: ThemeOverride;
12
- /** Input value - a hex color string (e.g., "#ff0000") */
13
- value: string;
14
- }
15
- export interface ColorPickerInputType extends Omit<InlineColorPickerInputType, "themeOverride"> {
16
- /** Descriptive text for your input. Keep it short & concise */
17
- helperText?: string | ReactElement;
18
- /** A label for your input. Not required, but strongly recommended. */
19
- inputLabel?: ReactNode;
20
- /** Instructional text, that goes between the label and the color picker. */
21
- instructionalText?: string;
22
- /** You can override the theme by passing a `themeOverride` object. */
23
- themeOverride?: ColorPickerInputThemeOverride;
24
- /** A message for when the input fails validation. Only displays if `showValidationMessage: true` */
25
- validationMessage?: string;
26
- }
27
- export interface ThemeOverride {
28
- activeBackgroundColor?: string;
29
- activeBorderColor?: string;
30
- activeColor?: string;
31
- disabledBorderColor?: string;
32
- disabledColor?: string;
33
- failColor?: string;
34
- failColorSecondary?: string;
35
- hoverBorderColor?: string;
36
- inactiveBorderColor?: string;
37
- inputBackgroundColor?: string;
38
- inputBorderRadius?: number;
39
- inputHeight?: number;
40
- inputPadding?: number;
41
- }
42
- export interface ColorPickerInputThemeOverride extends ThemeOverride {
43
- helperTextColor?: string;
44
- instructionalTextColor?: string;
45
- instructionalTextFontSize?: number;
46
- labelColor?: string;
47
- legibilityFontSize?: number;
48
- }
@@ -1,4 +0,0 @@
1
- import { FC } from "react";
2
- import { ColorPickerFieldProps } from "../../types";
3
- export declare const ColorPickerField: FC<ColorPickerFieldProps>;
4
- export default ColorPickerField;
@@ -1 +0,0 @@
1
- export { ColorPickerField } from "./ColorPickerField";
@@ -1,19 +0,0 @@
1
- /**
2
- * Validates that a color has sufficient contrast against a background color
3
- * according to WCAG AA accessibility standards (4.5:1 ratio for normal text).
4
- *
5
- * @param color - The foreground color (hex format, e.g., "#ff0000")
6
- * @param backgroundColor - The background color to check against (hex format, defaults to "#ffffff")
7
- * @returns boolean - true if the contrast ratio is >= 4.5:1, false otherwise
8
- */
9
- export declare const validateColorContrast: (color: string, backgroundColor?: string) => boolean;
10
- /**
11
- * Validates that a color has sufficient contrast against a background color
12
- * and returns an error message if validation fails.
13
- *
14
- * @param color - The foreground color (hex format, e.g., "#ff0000")
15
- * @param backgroundColor - The background color to check against (hex format, defaults to "#ffffff")
16
- * @param errorMessage - Custom error message (optional)
17
- * @returns string | null - Error message if validation fails, null if valid
18
- */
19
- export declare const validateColorContrastWithMessage: (color: string, backgroundColor?: string, errorMessage?: string) => string | null;