@dinofront/design_system 1.2.0 → 1.2.1

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.
@@ -18,6 +18,18 @@ export interface DatePickerProps extends BaseProps {
18
18
  /** Fill the parent's width (like Input/Select) instead of the intrinsic
19
19
  * min-width. Use inside form grids so dates line up with other fields. */
20
20
  fullWidth?: boolean;
21
+ /** Disable the trigger entirely — blocks both mouse and keyboard activation. */
22
+ disabled?: boolean;
23
+ /** Earliest selectable day, inclusive. Earlier days render disabled. Time-of-day is ignored. */
24
+ minDate?: Date;
25
+ /** Latest selectable day, inclusive. Later days render disabled. Time-of-day is ignored. */
26
+ maxDate?: Date;
27
+ /** Individual days that can't be picked. Matched by calendar day; time-of-day is ignored. */
28
+ excludeDates?: Date[];
29
+ /** Switch the trigger to the danger border/ring styles. */
30
+ error?: boolean;
31
+ /** Message rendered below the control; also switches the trigger to the danger styles. */
32
+ errorText?: ReactNode;
21
33
  id?: string;
22
34
  className?: string;
23
35
  wrapperClassName?: string;
@@ -1,5 +1,5 @@
1
1
  import { HTMLAttributes, ReactElement } from 'react';
2
- import { RefCallBack } from 'react-hook-form';
2
+ import { RefCallBack, SetValueConfig } from 'react-hook-form';
3
3
  import { BaseProps } from '../../types';
4
4
  /** Deliberately untyped `value`/`onChange`: this render prop feeds whichever
5
5
  * input the consumer wires up (native `value`, Select's `string`, Checkbox's
@@ -13,6 +13,13 @@ export interface FormFieldRenderProps {
13
13
  error: boolean;
14
14
  errorText?: string;
15
15
  dataTestId?: string;
16
+ /** Imperatively set this field's value, pre-bound to this FormField's
17
+ * `name` — for a component whose own change contract doesn't fit RHF's
18
+ * field bindings. Defaults `shouldValidate`/`shouldDirty`/`shouldTouch`
19
+ * to `true`, overridable via `options`. */
20
+ setFieldValue: (value: unknown, options?: SetValueConfig) => void;
21
+ /** True once the field has been touched, changed from its default value, and currently passes validation. */
22
+ isValid: boolean;
16
23
  }
17
24
  export interface FormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue'>, BaseProps {
18
25
  name: string;
@@ -3,6 +3,7 @@ import { BaseProps } from '../../types';
3
3
  export type RadioSize = 'md' | 'sm';
4
4
  export interface RadioGroupProps extends BaseProps {
5
5
  name?: string;
6
+ label?: ReactNode;
6
7
  value?: string;
7
8
  defaultValue?: string;
8
9
  onChange?: (value: string) => void;
@@ -5,6 +5,13 @@ export interface SelectOption {
5
5
  value: string;
6
6
  label: ReactNode;
7
7
  disabled?: boolean;
8
+ /** Group heading this option belongs under. Options sharing a group MUST be
9
+ * contiguous in the `options` array — the heading is emitted whenever this
10
+ * value changes between consecutive options, so a non-contiguous group
11
+ * renders its heading more than once. */
12
+ group?: string;
13
+ /** Text used for `searchable` matching when `label` isn't a plain string. */
14
+ searchText?: string;
8
15
  }
9
16
  export interface SelectProps extends BaseProps {
10
17
  options: SelectOption[];
@@ -20,6 +27,16 @@ export interface SelectProps extends BaseProps {
20
27
  error?: boolean;
21
28
  size?: SelectSize;
22
29
  disabled?: boolean;
30
+ /** Renders a red asterisk next to the label and sets `aria-required` on the trigger. */
31
+ required?: boolean;
32
+ /** Shows a spinner in place of the chevron and blocks opening the list. Does not set the native `disabled` attribute. */
33
+ loading?: boolean;
34
+ /** Renders a text filter pinned above the open list. */
35
+ searchable?: boolean;
36
+ /** Placeholder for the `searchable` filter input. Defaults to `'Search…'`. */
37
+ searchPlaceholder?: string;
38
+ /** Shown in place of the list when the filter matches nothing. Defaults to `'No results'`. */
39
+ emptyText?: string;
23
40
  id?: string;
24
41
  className?: string;
25
42
  wrapperClassName?: string;
@@ -6,7 +6,7 @@ export interface UploadRejection {
6
6
  file: File;
7
7
  reason: UploadRejectionReason;
8
8
  }
9
- export interface UploadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'onDrop' | 'onDragEnter' | 'onDragOver' | 'onDragLeave' | 'onKeyDown' | 'role' | 'tabIndex' | 'aria-disabled'>, BaseProps {
9
+ export interface UploadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'onDrop' | 'onDragEnter' | 'onDragOver' | 'onDragLeave' | 'onKeyDown' | 'role' | 'tabIndex' | 'aria-disabled' | 'aria-invalid'>, BaseProps {
10
10
  /** Forwarded to the hidden native `<input type="file">`, e.g. `"image/png,image/jpeg"`. */
11
11
  accept?: string;
12
12
  multiple?: boolean;
@@ -35,6 +35,10 @@ export interface UploadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onCli
35
35
  triggerIcon?: ReactNode;
36
36
  label?: ReactNode;
37
37
  required?: boolean;
38
+ /** Switches the dropzone (or, in `button`/`icon` mode, just the message below) to the danger styles. */
39
+ error?: boolean;
40
+ /** Message rendered below the control; also switches dropzone mode to the danger styles. */
41
+ errorText?: ReactNode;
38
42
  /** Content rendered on the label row, right of the label text and required marker — e.g. an info tooltip trigger. */
39
43
  labelAddons?: ReactNode;
40
44
  }