beesoft-components 0.9.1 → 0.9.3

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.3",
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.9",
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
@@ -14,6 +14,7 @@ import { ReactElement } from 'react';
14
14
  import { ReactNode } from 'react';
15
15
  import { ReactPortal } from 'react';
16
16
  import { RefAttributes } from 'react';
17
+ import { ReplacePropertyType } from '@beesoft/common';
17
18
  import { TypeOrArray } from '@beesoft/common';
18
19
 
19
20
  export declare function applyBeeSoftTheme(theme: Record<string, unknown>): void;
@@ -97,9 +98,7 @@ declare interface CheckboxGroupProps extends MakeRequired<FormInputControlData<A
97
98
  orientation?: FormGroupItemOrientation;
98
99
  }
99
100
 
100
- declare interface CheckboxProps extends FormInputControl<unknown, CheckboxChangeEvent>, ComponentAnimationProps {
101
- checked?: boolean;
102
- partial?: boolean;
101
+ declare interface CheckboxProps extends ReplacePropertyType<HeadlessCheckboxProps, 'onChange', (value?: CheckboxChangeEvent) => void>, ComponentAnimationProps {
103
102
  labelLocation?: SelectionLabelLocation;
104
103
  }
105
104
 
@@ -183,7 +182,7 @@ export declare enum DateSelectionType {
183
182
  DateRange = 3
184
183
  }
185
184
 
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;
185
+ 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
186
 
188
187
  declare type DateTimeCalendarTemplate = TemplateFunction<DateTimeCalendarTemplateProps>;
189
188
 
@@ -247,6 +246,7 @@ declare interface DateTimeProps extends FormInputControl<string | TypeOrArray<Da
247
246
  calendarTemplate?: DateTimeCalendarTemplate;
248
247
  dateScrollerTemplate?: DateTimeScrollerTemplate;
249
248
  inputTemplate?: DateTimeInputTemplate;
249
+ wrapperTemplate?: DateTimeWrapperTemplate;
250
250
  }
251
251
 
252
252
  declare type DateTimeScrollerTemplate = TemplateFunction<DateTimeScrollerTemplateProps>;
@@ -259,6 +259,12 @@ export declare interface DateTimeScrollerTemplateProps {
259
259
  onMoveNext: () => void;
260
260
  }
261
261
 
262
+ declare type DateTimeWrapperTemplate = TemplateFunction<DateTimeWrapperTemplateProps>;
263
+
264
+ declare interface DateTimeWrapperTemplateProps {
265
+ setDateSelector: (selector: DateSelectionType) => void;
266
+ }
267
+
262
268
  declare type DayType = {
263
269
  dayValue: Date | null;
264
270
  isCurrent: boolean;
@@ -358,6 +364,7 @@ export declare enum FormGroupItemOrientation {
358
364
  }
359
365
 
360
366
  declare interface FormInputControl<V = unknown, C = undefined> {
367
+ id?: string;
361
368
  label?: string;
362
369
  name?: string;
363
370
  value?: V;
@@ -404,6 +411,25 @@ export declare interface GroupChangeEvent {
404
411
  value: TypeOrArray<unknown>;
405
412
  }
406
413
 
414
+ declare interface HeadlessCheckboxChangeEvent {
415
+ name?: string;
416
+ value: unknown;
417
+ checked: boolean;
418
+ originalEvent?: ChangeEvent<HTMLInputElement>;
419
+ }
420
+
421
+ declare interface HeadlessCheckboxProps extends FormInputControl<unknown, HeadlessCheckboxChangeEvent> {
422
+ checked?: boolean;
423
+ partial?: boolean;
424
+ labelStyles?: string;
425
+ children?: (props: HeadlessCheckboxRenderProps) => React_2.JSX.Element;
426
+ }
427
+
428
+ declare interface HeadlessCheckboxRenderProps {
429
+ checked: boolean;
430
+ partial: boolean;
431
+ }
432
+
407
433
  declare interface IncrementConstraint {
408
434
  min: number;
409
435
  max: number;
@@ -539,7 +565,7 @@ declare interface TimeConstraints {
539
565
 
540
566
  export declare const Toggle: MemoExoticComponent<({ name, label, value, checked, readOnly, useAnimation, className, onChange, }: ToggleProps) => JSX_2.Element>;
541
567
 
542
- declare interface ToggleProps extends FormInputControl<string | number, CheckboxChangeEvent>, ComponentAnimationProps {
568
+ declare interface ToggleProps extends FormInputControl<string | number, HeadlessCheckboxChangeEvent>, ComponentAnimationProps {
543
569
  checked?: boolean;
544
570
  }
545
571