@dfds-ui/forms 2.0.13-alpha.387f7b2c → 2.0.13-alpha.a1d278ee

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 (58) hide show
  1. package/checkbox/Checkbox.d.ts +0 -6
  2. package/checkbox/Checkbox.js +8 -13
  3. package/checkbox/CheckboxGroup.d.ts +2 -2
  4. package/checkbox/CheckboxGroup.js +6 -14
  5. package/cjs/assistive-text/AssistiveText.d.ts +8 -0
  6. package/cjs/asterisk/Asterisk.d.ts +11 -0
  7. package/cjs/checkbox/Checkbox.d.ts +59 -0
  8. package/cjs/checkbox/Checkbox.js +8 -13
  9. package/cjs/checkbox/CheckboxContext.d.ts +13 -0
  10. package/cjs/checkbox/CheckboxGroup.d.ts +20 -0
  11. package/cjs/checkbox/CheckboxGroup.js +6 -14
  12. package/cjs/checkbox/index.d.ts +2 -0
  13. package/cjs/counter/Counter.d.ts +66 -0
  14. package/cjs/counter/index.d.ts +1 -0
  15. package/cjs/enhanced/EnhancedField.d.ts +20 -0
  16. package/cjs/enhanced/index.d.ts +1 -0
  17. package/cjs/error-text/ErrorText.d.ts +8 -0
  18. package/cjs/field-wrap/FieldWrap.d.ts +9 -0
  19. package/cjs/field-wrap/FieldWrap.js +3 -3
  20. package/cjs/field-wrap/index.d.ts +1 -0
  21. package/cjs/help-icon/HelpIcon.d.ts +7 -0
  22. package/cjs/index.d.ts +15 -0
  23. package/cjs/label/Label.d.ts +10 -0
  24. package/cjs/password-field/PasswordField.d.ts +4 -0
  25. package/cjs/radio/Radio.d.ts +51 -0
  26. package/cjs/radio/RadioContext.d.ts +13 -0
  27. package/cjs/radio/RadioGroup.d.ts +12 -0
  28. package/cjs/radio/RadioGroup.js +4 -10
  29. package/cjs/radio/index.d.ts +2 -0
  30. package/cjs/rating/Rating.d.ts +55 -0
  31. package/cjs/rating/index.d.ts +1 -0
  32. package/cjs/select-field/NativeSelectField.d.ts +8 -0
  33. package/cjs/select-field/SelectField.d.ts +83 -0
  34. package/cjs/select-field/SelectField.js +44 -86
  35. package/cjs/switch/Switch.d.ts +32 -0
  36. package/cjs/switch/SwitchContext.d.ts +11 -0
  37. package/cjs/switch/SwitchGroup.d.ts +10 -0
  38. package/cjs/switch/SwitchGroup.js +1 -11
  39. package/cjs/switch/index.d.ts +1 -0
  40. package/cjs/switch/index.js +6 -21
  41. package/cjs/tel-field/TelField.d.ts +67 -0
  42. package/cjs/text-field/TextField.d.ts +47 -0
  43. package/cjs/text-field/TextField.js +4 -4
  44. package/cjs/textarea-field/TextareaField.d.ts +44 -0
  45. package/cjs/types/field.d.ts +52 -0
  46. package/cjs/types/index.d.ts +2 -0
  47. package/cjs/types/size.d.ts +1 -0
  48. package/field-wrap/FieldWrap.js +3 -3
  49. package/package.json +7 -7
  50. package/radio/RadioGroup.d.ts +2 -2
  51. package/radio/RadioGroup.js +4 -10
  52. package/select-field/SelectField.d.ts +1 -11
  53. package/select-field/SelectField.js +45 -87
  54. package/switch/SwitchGroup.js +12 -22
  55. package/switch/index.d.ts +1 -2
  56. package/switch/index.js +1 -2
  57. package/text-field/TextField.d.ts +2 -10
  58. package/text-field/TextField.js +4 -4
@@ -0,0 +1,83 @@
1
+ import React from 'react';
2
+ import Select, { createFilter, GroupBase, OptionsOrGroups, SingleValue } from 'react-select';
3
+ import { BaseFieldProps } from '../types';
4
+ export declare type BaseReactSelectProps = Omit<React.PropsWithRef<Select>, 'size' | 'css'>;
5
+ export declare type Size = 'small' | 'medium' | 'large';
6
+ export declare const ReactSelectWrapper: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: React.ElementType<any> | undefined;
9
+ } & {
10
+ error?: boolean | undefined;
11
+ size?: string | undefined;
12
+ arrow?: boolean | undefined;
13
+ selected?: boolean | undefined;
14
+ }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
15
+ export declare const Menu: (props: any) => JSX.Element;
16
+ export declare type SelectFieldProps<T = string> = BaseFieldProps & {
17
+ defaultValue?: SingleValue<T>;
18
+ className?: string;
19
+ components?: any;
20
+ value?: SingleValue<T>;
21
+ visualSize?: Size;
22
+ options?: OptionsOrGroups<T, GroupBase<T>>;
23
+ isSearchable?: boolean;
24
+ onSelect?: (value: SingleValue<T>) => void;
25
+ onChange?: (value: SingleValue<T>) => void;
26
+ onBlur?: (value: any) => void;
27
+ menuIsOpen?: boolean;
28
+ placeholder?: string;
29
+ assistiveText?: string;
30
+ errorMessage?: string;
31
+ /**
32
+ * Indicates that the Select can be cleared after selecting an Option.
33
+ *
34
+ * Setting this to true will display a small dismiss cross when a value is selected
35
+ */
36
+ isClearable?: boolean;
37
+ /**
38
+ * Configuration object passed to react-select createFilter function to create [custom filter
39
+ * logic](https://react-select.com/advanced#custom-filter-logic)
40
+ * @param ignoreCase - boolean (optional)
41
+ * @param ignoreAccents - boolean (optional)
42
+ * @param stringify (obj: any) => string (optional)
43
+ * @param trim - boolean (optional)
44
+ * @param matchForm - 'any' | 'start'
45
+ */
46
+ filterConfig?: Parameters<typeof createFilter>[0];
47
+ };
48
+ declare function SelectFieldInner<T>({ components, name, label, defaultValue, value, placeholder, onSelect, onChange, isSearchable, onBlur, assistiveText, options, errorMessage, isClearable, disabled, visualSize, required, hideAsterisk, filterConfig, ...rest }: SelectFieldProps<T>, ref: React.ForwardedRef<any>): JSX.Element;
49
+ export declare const SelectField: <T>(props: BaseFieldProps & {
50
+ defaultValue?: SingleValue<T> | undefined;
51
+ className?: string | undefined;
52
+ components?: any;
53
+ value?: SingleValue<T> | undefined;
54
+ visualSize?: Size | undefined;
55
+ options?: OptionsOrGroups<T, GroupBase<T>> | undefined;
56
+ isSearchable?: boolean | undefined;
57
+ onSelect?: ((value: SingleValue<T>) => void) | undefined;
58
+ onChange?: ((value: SingleValue<T>) => void) | undefined;
59
+ onBlur?: ((value: any) => void) | undefined;
60
+ menuIsOpen?: boolean | undefined;
61
+ placeholder?: string | undefined;
62
+ assistiveText?: string | undefined;
63
+ errorMessage?: string | undefined;
64
+ /**
65
+ * Indicates that the Select can be cleared after selecting an Option.
66
+ *
67
+ * Setting this to true will display a small dismiss cross when a value is selected
68
+ */
69
+ isClearable?: boolean | undefined;
70
+ /**
71
+ * Configuration object passed to react-select createFilter function to create [custom filter
72
+ * logic](https://react-select.com/advanced#custom-filter-logic)
73
+ * @param ignoreCase - boolean (optional)
74
+ * @param ignoreAccents - boolean (optional)
75
+ * @param stringify (obj: any) => string (optional)
76
+ * @param trim - boolean (optional)
77
+ * @param matchForm - 'any' | 'start'
78
+ */
79
+ filterConfig?: Parameters<typeof createFilter>[0];
80
+ } & {
81
+ ref?: React.ForwardedRef<any> | undefined;
82
+ }) => ReturnType<typeof SelectFieldInner>;
83
+ export default SelectField;