beesoft-components 0.9.1 → 0.9.2

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beesoft-components",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "author": {
@@ -34,7 +34,8 @@
34
34
  "chromatic": "chromatic --project-token $CHROMATIC_PROJECT_TOKEN"
35
35
  },
36
36
  "dependencies": {
37
- "@beesoft/common": "^0.1.6",
37
+ "@beesoft/common": "^0.1.8",
38
+ "@preact/signals": "^1.2.3",
38
39
  "@react-hook/media-query": "^1.1.1",
39
40
  "classnames": "^2.3.2",
40
41
  "date-fns": "^3.3.1",
@@ -59,7 +60,7 @@
59
60
  "@testing-library/jest-dom": "^6.1.4",
60
61
  "@testing-library/react": "^14.1.0",
61
62
  "@testing-library/user-event": "^14.5.1",
62
- "@types/bun": "^1.0.4",
63
+ "@types/bun": "^1.0.12",
63
64
  "@types/dot-object": "^2.1.6",
64
65
  "@types/lodash-es": "^4.17.11",
65
66
  "@types/react": "^18.2.15",
package/types/index.d.ts CHANGED
@@ -82,14 +82,7 @@ declare enum CalendarSelectionMode {
82
82
  Range = 1
83
83
  }
84
84
 
85
- export declare const Checkbox: MemoExoticComponent<ForwardRefExoticComponent<CheckboxProps & RefAttributes<CheckboxRef>>>;
86
-
87
- export declare interface CheckboxChangeEvent {
88
- name?: string;
89
- value: unknown;
90
- checked: boolean;
91
- originalEvent?: ChangeEvent<HTMLInputElement>;
92
- }
85
+ export declare const Checkbox: MemoExoticComponent<ForwardRefExoticComponent<CheckboxProps & RefAttributes<HeadlessCheckboxRef>>>;
93
86
 
94
87
  export declare const CheckboxGroup: MemoExoticComponent<({ name, label, value, data, textField, valueField, readOnly, orientation, className, onChange, }: CheckboxGroupProps) => JSX_2.Element>;
95
88
 
@@ -97,17 +90,10 @@ declare interface CheckboxGroupProps extends MakeRequired<FormInputControlData<A
97
90
  orientation?: FormGroupItemOrientation;
98
91
  }
99
92
 
100
- declare interface CheckboxProps extends FormInputControl<unknown, CheckboxChangeEvent>, ComponentAnimationProps {
101
- checked?: boolean;
102
- partial?: boolean;
93
+ declare interface CheckboxProps extends HeadlessCheckboxProps, ComponentAnimationProps {
103
94
  labelLocation?: SelectionLabelLocation;
104
95
  }
105
96
 
106
- export declare interface CheckboxRef {
107
- setPartiallyChecked: (partiallyChecked: boolean) => void;
108
- setChecked: (checked: boolean) => void;
109
- }
110
-
111
97
  declare interface ComponentAnimationProps {
112
98
  useAnimation?: boolean;
113
99
  }
@@ -183,7 +169,7 @@ export declare enum DateSelectionType {
183
169
  DateRange = 3
184
170
  }
185
171
 
186
- export declare const DateTime: ({ value, readOnly, label, useDefaultDateValue, useFormattedInput, allowClear, closeSelector, locale, className, dateSelection, dateFormat, timeConstraints, icon, iconPosition, inputElement, selectableDate, isValidDate, onChange, calendarTemplate, dateScrollerTemplate, inputTemplate, }: DateTimeProps) => JSX_2.Element;
172
+ export declare const DateTime: ({ value, readOnly, label, useDefaultDateValue, useFormattedInput, allowClear, closeSelector, locale, className, dateSelection, dateFormat, timeConstraints, icon, iconPosition, inputElement, selectableDate, isValidDate, onChange, calendarTemplate, dateScrollerTemplate, inputTemplate, wrapperTemplate, }: DateTimeProps) => JSX_2.Element;
187
173
 
188
174
  declare type DateTimeCalendarTemplate = TemplateFunction<DateTimeCalendarTemplateProps>;
189
175
 
@@ -247,6 +233,7 @@ declare interface DateTimeProps extends FormInputControl<string | TypeOrArray<Da
247
233
  calendarTemplate?: DateTimeCalendarTemplate;
248
234
  dateScrollerTemplate?: DateTimeScrollerTemplate;
249
235
  inputTemplate?: DateTimeInputTemplate;
236
+ wrapperTemplate?: DateTimeWrapperTemplate;
250
237
  }
251
238
 
252
239
  declare type DateTimeScrollerTemplate = TemplateFunction<DateTimeScrollerTemplateProps>;
@@ -259,6 +246,12 @@ export declare interface DateTimeScrollerTemplateProps {
259
246
  onMoveNext: () => void;
260
247
  }
261
248
 
249
+ declare type DateTimeWrapperTemplate = TemplateFunction<DateTimeWrapperTemplateProps>;
250
+
251
+ declare interface DateTimeWrapperTemplateProps {
252
+ setDateSelector: (selector: DateSelectionType) => void;
253
+ }
254
+
262
255
  declare type DayType = {
263
256
  dayValue: Date | null;
264
257
  isCurrent: boolean;
@@ -358,6 +351,7 @@ export declare enum FormGroupItemOrientation {
358
351
  }
359
352
 
360
353
  declare interface FormInputControl<V = unknown, C = undefined> {
354
+ id?: string;
361
355
  label?: string;
362
356
  name?: string;
363
357
  value?: V;
@@ -404,6 +398,30 @@ export declare interface GroupChangeEvent {
404
398
  value: TypeOrArray<unknown>;
405
399
  }
406
400
 
401
+ export declare interface HeadlessCheckboxChangeEvent {
402
+ name?: string;
403
+ value: unknown;
404
+ checked: boolean;
405
+ originalEvent?: ChangeEvent<HTMLInputElement>;
406
+ }
407
+
408
+ declare interface HeadlessCheckboxProps extends FormInputControl<unknown, HeadlessCheckboxChangeEvent> {
409
+ checked?: boolean;
410
+ partial?: boolean;
411
+ labelStyles?: string;
412
+ children?: (props: HeadlessCheckboxRenderProps) => React_2.JSX.Element;
413
+ }
414
+
415
+ export declare interface HeadlessCheckboxRef {
416
+ setPartiallyChecked: (partiallyChecked: boolean) => void;
417
+ setChecked: (checked: boolean) => void;
418
+ }
419
+
420
+ declare interface HeadlessCheckboxRenderProps {
421
+ checked: boolean;
422
+ partial: boolean;
423
+ }
424
+
407
425
  declare interface IncrementConstraint {
408
426
  min: number;
409
427
  max: number;
@@ -539,7 +557,7 @@ declare interface TimeConstraints {
539
557
 
540
558
  export declare const Toggle: MemoExoticComponent<({ name, label, value, checked, readOnly, useAnimation, className, onChange, }: ToggleProps) => JSX_2.Element>;
541
559
 
542
- declare interface ToggleProps extends FormInputControl<string | number, CheckboxChangeEvent>, ComponentAnimationProps {
560
+ declare interface ToggleProps extends FormInputControl<string | number, HeadlessCheckboxChangeEvent>, ComponentAnimationProps {
543
561
  checked?: boolean;
544
562
  }
545
563