jamespot-react-components 1.0.216 → 1.0.218

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.
@@ -2,11 +2,17 @@ import * as React from 'react';
2
2
  import { ControllerRenderProps, FieldValues } from 'react-hook-form';
3
3
  import { DataCy } from 'types/dataAttributes';
4
4
  import { JRCTooltipProps } from 'components/JRCTooltip/JRCTooltip';
5
+ import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
6
+ import { ButtonColors } from '../../../JRCButton/JRCButton';
7
+ type Sizes = 's' | 'm';
5
8
  type ToggleListOption<TFieldValues> = {
6
9
  label: string | JSX.Element;
7
10
  value: string | number | TFieldValues;
11
+ color?: ButtonColors;
8
12
  };
9
13
  export type ToggleProps = DataCy & {
14
+ size?: Sizes;
15
+ width?: string;
10
16
  disabled?: boolean;
11
17
  options: Array<ToggleListOption<string>>;
12
18
  };
@@ -17,6 +23,8 @@ export type ToggleRawProps<TFieldValues extends FieldValues = FieldValues> = Tog
17
23
  tooltip?: JRCTooltipProps;
18
24
  };
19
25
  export declare const JRCInputToggleRaw: React.ForwardRefExoticComponent<Omit<DataCy & {
26
+ size?: Sizes | undefined;
27
+ width?: string | undefined;
20
28
  disabled?: boolean | undefined;
21
29
  options: Array<ToggleListOption<string>>;
22
30
  } & Omit<ControllerRenderProps<FieldValues, string>, "ref" | "value"> & {
@@ -25,4 +33,6 @@ export declare const JRCInputToggleRaw: React.ForwardRefExoticComponent<Omit<Dat
25
33
  value: string;
26
34
  tooltip?: JRCTooltipProps | undefined;
27
35
  }, "ref"> & React.RefAttributes<HTMLInputElement>>;
36
+ export type JRCInputToggleProps<TFieldValues extends FieldValues = FieldValues> = ToggleRawProps<TFieldValues> & JRCInputFieldProps<TFieldValues>;
37
+ export declare function JRCInputToggle<TFieldValues extends FieldValues = FieldValues>({ name, control, rules, label, htmlFor, labelIsLegend, description, helper, ...props }: JRCInputToggleProps<TFieldValues>): React.JSX.Element;
28
38
  export {};
@@ -1,257 +1,35 @@
1
- export declare const BUTTON_CONFIG: {
2
- contained: {
3
- primary: {
4
- color: string;
5
- background: string;
6
- border: string;
7
- active: {
8
- background: string;
9
- border: string;
10
- };
11
- hover: {
12
- background: string;
13
- border: string;
14
- };
15
- };
16
- valid: {
17
- color: string;
18
- background: string;
19
- border: string;
20
- active: {
21
- background: string;
22
- border: string;
23
- };
24
- hover: {
25
- background: string;
26
- border: string;
27
- };
28
- };
29
- danger: {
30
- color: string;
31
- background: string;
32
- border: string;
33
- active: {
34
- background: string;
35
- border: string;
36
- };
37
- hover: {
38
- background: string;
39
- border: string;
40
- };
41
- };
42
- secondary: {
43
- color: string;
44
- background: string;
45
- border: string;
46
- active: {
47
- background: string;
48
- border: string;
49
- };
50
- hover: {
51
- background: string;
52
- border: string;
53
- };
54
- };
55
- cancel: {
56
- color: string;
57
- background: string;
58
- border: string;
59
- active: {
60
- background: string;
61
- border: string;
62
- };
63
- hover: {
64
- background: string;
65
- border: string;
66
- };
67
- };
68
- disabled: {
69
- color: string;
70
- background: string;
71
- border: string;
72
- active: {
73
- background: string;
74
- border: string;
75
- };
76
- hover: {
77
- background: string;
78
- border: string;
79
- };
80
- };
1
+ import { Colors, ColorsOrShades } from '../../styles/theme';
2
+ import { ButtonColors } from './JRCButton';
3
+ declare const defaultLinkStyle: {
4
+ color: string;
5
+ background: string;
6
+ border: string;
7
+ active: {
8
+ background: string;
9
+ border: string;
10
+ 'text-decoration': string;
81
11
  };
82
- outlined: {
83
- primary: {
84
- color: string;
85
- background: string;
86
- border: string;
87
- active: {
88
- background: string;
89
- border: string;
90
- };
91
- hover: {
92
- background: string;
93
- border: string;
94
- };
95
- };
96
- valid: {
97
- color: string;
98
- background: string;
99
- border: string;
100
- active: {
101
- background: string;
102
- border: string;
103
- };
104
- hover: {
105
- background: string;
106
- border: string;
107
- };
108
- };
109
- danger: {
110
- color: string;
111
- background: string;
112
- border: string;
113
- active: {
114
- background: string;
115
- border: string;
116
- };
117
- hover: {
118
- background: string;
119
- border: string;
120
- };
121
- };
122
- secondary: {
123
- color: string;
124
- background: string;
125
- border: string;
126
- active: {
127
- background: string;
128
- border: string;
129
- };
130
- hover: {
131
- background: string;
132
- border: string;
133
- };
134
- };
135
- cancel: {
136
- color: string;
137
- background: string;
138
- border: string;
139
- active: {
140
- background: string;
141
- border: string;
142
- };
143
- hover: {
144
- background: string;
145
- border: string;
146
- };
147
- };
148
- disabled: {
149
- color: string;
150
- background: string;
151
- border: string;
152
- active: {
153
- background: string;
154
- border: string;
155
- };
156
- hover: {
157
- background: string;
158
- border: string;
159
- };
160
- };
12
+ hover: {
13
+ background: string;
14
+ border: string;
15
+ 'text-decoration': string;
16
+ };
17
+ };
18
+ type Config = {
19
+ color: Colors;
20
+ background: Colors;
21
+ border: Colors;
22
+ active: {
23
+ background: ColorsOrShades;
24
+ border: ColorsOrShades;
161
25
  };
162
- link: {
163
- primary: {
164
- color: string;
165
- background: string;
166
- border: string;
167
- active: {
168
- background: string;
169
- border: string;
170
- 'text-decoration': string;
171
- };
172
- hover: {
173
- background: string;
174
- border: string;
175
- 'text-decoration': string;
176
- };
177
- };
178
- valid: {
179
- color: string;
180
- background: string;
181
- border: string;
182
- active: {
183
- background: string;
184
- border: string;
185
- 'text-decoration': string;
186
- };
187
- hover: {
188
- background: string;
189
- border: string;
190
- 'text-decoration': string;
191
- };
192
- };
193
- danger: {
194
- color: string;
195
- background: string;
196
- border: string;
197
- active: {
198
- background: string;
199
- border: string;
200
- 'text-decoration': string;
201
- };
202
- hover: {
203
- background: string;
204
- border: string;
205
- 'text-decoration': string;
206
- };
207
- };
208
- secondary: {
209
- color: string;
210
- background: string;
211
- border: string;
212
- active: {
213
- background: string;
214
- border: string;
215
- 'text-decoration': string;
216
- };
217
- hover: {
218
- background: string;
219
- border: string;
220
- 'text-decoration': string;
221
- };
222
- };
223
- cancel: {
224
- color: string;
225
- background: string;
226
- border: string;
227
- active: {
228
- background: string;
229
- border: string;
230
- 'text-decoration': string;
231
- };
232
- hover: {
233
- background: string;
234
- border: string;
235
- 'text-decoration': string;
236
- };
237
- };
238
- disabled: {
239
- color: string;
240
- background: string;
241
- border: string;
242
- active: {
243
- background: string;
244
- border: string;
245
- 'text-decoration': string;
246
- };
247
- hover: {
248
- background: string;
249
- border: string;
250
- 'text-decoration': string;
251
- };
252
- };
26
+ hover: {
27
+ background: ColorsOrShades;
28
+ border: ColorsOrShades;
253
29
  };
254
30
  };
31
+ type ButtonConfig = Record<'contained' | 'outlined', Record<ButtonColors | 'disabled', Config>> & Record<'link', Record<ButtonColors | 'disabled', typeof defaultLinkStyle>>;
32
+ export declare const BUTTON_CONFIG: ButtonConfig;
255
33
  export type ButtonType = {
256
34
  color: string;
257
35
  background: string;
@@ -267,3 +45,4 @@ export type ButtonType = {
267
45
  'text-decoration'?: string;
268
46
  };
269
47
  };
48
+ export {};
@@ -18,5 +18,6 @@ export type JRCBaseTooltipProps = {
18
18
  delayHide?: number;
19
19
  delayShow?: number;
20
20
  events?: any;
21
+ asBlock?: boolean;
21
22
  };
22
23
  export declare const JRCBaseTooltip: (props: JRCBaseTooltipProps) => React.JSX.Element;
@@ -24,5 +24,7 @@ export interface JRCTooltipProps {
24
24
  position?: 'top' | 'bottom' | 'left' | 'right';
25
25
  /** overwrite span wrapper style */
26
26
  className?: string;
27
+ /** container as block */
28
+ asBlock?: boolean;
27
29
  }
28
30
  export declare const JRCTooltip: (props: JRCTooltipProps) => React.JSX.Element;
@@ -10,7 +10,7 @@ export declare const getVisibleColumns: (tableColumnsData: {
10
10
  dateFormat?: "time" | "date" | "date-time" | "date-time-sec" | "time-sec" | undefined;
11
11
  numberFormat?: "fr-FR" | "en-EN" | "filesize" | undefined;
12
12
  }[], columns: WidgetTableColumn[]) => {
13
- type: "number" | "select" | "title" | "text" | "url" | "email" | "date" | "file" | "uri" | "datetime" | "transient";
13
+ type: "number" | "select" | "title" | "text" | "date" | "email" | "file" | "url" | "uri" | "datetime" | "transient";
14
14
  name: string;
15
15
  label: string;
16
16
  widget: {} | {
@@ -20,7 +20,7 @@ export declare const JRCWidgetTableEditor: ({ limit, tableHeadColor, tableHeadTe
20
20
  tableSizedColumnsWidth?: number | undefined;
21
21
  } & {
22
22
  columns: {
23
- type: "number" | "select" | "title" | "text" | "url" | "email" | "date" | "file" | "uri" | "datetime" | "transient";
23
+ type: "number" | "select" | "title" | "text" | "date" | "email" | "file" | "url" | "uri" | "datetime" | "transient";
24
24
  name: string;
25
25
  label: string;
26
26
  widget: {} | {
@@ -1,7 +1,7 @@
1
1
  import { WidgetTableColumn, WidgetTableColumnsData } from 'jamespot-user-api';
2
2
  export declare function labelize(name: string, tableColumnsData: WidgetTableColumnsData, initialValue: string): string;
3
3
  export declare function updateTableColumns(columns: WidgetTableColumn[], headers: string[]): {
4
- type: "number" | "select" | "title" | "text" | "url" | "email" | "date" | "file" | "uri" | "datetime" | "transient";
4
+ type: "number" | "select" | "title" | "text" | "date" | "email" | "file" | "url" | "uri" | "datetime" | "transient";
5
5
  name: string;
6
6
  label: string;
7
7
  widget: {} | {
@@ -53,7 +53,7 @@ export { JRCFormTextField } from './components/Form/Input/Deprecated/JRCFormText
53
53
  export { JRCFormTextarea, JRCFormTextareaField, } from './components/Form/Input/Deprecated/JRCFormTextarea/JRCFormTextarea';
54
54
  export { JRCFormUrlField } from './components/Form/Input/Deprecated/JRCFormURL/JRCFormUrl';
55
55
  export { JRCInputCheckbox, JRCInputCheckboxRaw } from './components/Form/Input/JRCInputCheckbox/JRCInputCheckbox';
56
- export { JRCInputToggleRaw } from './components/Form/Input/JRCInputCheckbox/JRCInputToggle';
56
+ export { JRCInputToggle, JRCInputToggleRaw } from './components/Form/Input/JRCInputCheckbox/JRCInputToggle';
57
57
  export { JRCCheckbox } from './components/Form/Input/JRCInputCheckbox/components/JRCCheckbox';
58
58
  export { JRCInputColor } from './components/Form/Input/JRCInputColor/JRCInputColor';
59
59
  export { JRCInputColorRaw } from './components/Form/Input/JRCInputColor/JRCInputColorRaw';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.216",
3
+ "version": "1.0.218",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
@@ -80,7 +80,7 @@
80
80
  "chroma-js": "^2.1.1",
81
81
  "classnames": "^2.3.1",
82
82
  "dompurify": "^3.0.5",
83
- "jamespot-user-api": "^1.0.196",
83
+ "jamespot-user-api": "^1.0.197",
84
84
  "moment": "2.29.4",
85
85
  "react": "^17.x",
86
86
  "react-beautiful-dnd": "^13.1.1",