@andrilla/mado-ui 1.0.8 → 1.0.10

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.
@@ -5,18 +5,21 @@ export type CheckboxProps = Omit<HeadlessCheckboxProps, 'children'> & {
5
5
  descriptionProps?: Omit<DescriptionProps, 'children'> & {
6
6
  /** @deprecated use `description` prop instead */
7
7
  children?: never;
8
+ ref?: RefObject<HTMLParagraphElement | null>;
8
9
  };
9
10
  fieldProps?: Omit<FieldProps, 'children'> & {
10
11
  /** @deprecated use `children` prop instead */
11
12
  children?: never;
13
+ ref?: RefObject<HTMLDivElement | null>;
12
14
  };
13
15
  labelProps?: Omit<LabelProps, 'children'> & {
14
16
  /** @deprecated use `children` prop instead */
15
17
  children?: never;
18
+ ref?: RefObject<HTMLLabelElement | null>;
16
19
  };
17
20
  inputContainerProps?: ComponentPropsWithRef<'div'>;
18
21
  required?: boolean;
19
22
  };
20
- import { type ComponentPropsWithRef, type JSX, type ReactNode } from 'react';
23
+ import { type ComponentPropsWithRef, type JSX, type ReactNode, type RefObject } from 'react';
21
24
  import { type CheckboxProps as HeadlessCheckboxProps, type DescriptionProps, type FieldProps, type LabelProps } from '@headlessui/react';
22
25
  export declare function Checkbox({ checkmark, children, className, description, descriptionProps: { className: descriptionClassName, ...descriptionProps }, fieldProps: { className: fieldClassName, ...fieldProps }, labelProps: { className: labelClassName, ...labelProps }, inputContainerProps: { className: inputContainerClassName, ...inputContainerProps }, onChange, required, value, ...props }: CheckboxProps): JSX.Element;
@@ -1,16 +1,16 @@
1
- import type { AnyElementProps } from '../types';
2
- import type { ElementType, JSX, ReactNode } from 'react';
3
- export type DropDownButtonProps<TTag extends ElementType = 'button'> = Omit<MenuButtonProps<TTag>, 'as' | 'className'> & {
1
+ import type { AsElement } from '../types';
2
+ import type { ElementType, JSX, ReactNode, RefObject } from 'react';
3
+ export type DropDownButtonProps<TTag extends ElementType = 'button'> = Omit<MenuButtonProps<TTag>, 'as' | 'className'> & AsElement<TTag | ElementType> & {
4
4
  arrow?: boolean | ReactNode;
5
- as?: TTag | ElementType;
6
5
  className?: string;
6
+ ref?: RefObject<HTMLButtonElement | null>;
7
7
  };
8
- export type DropDownItemProps<TTag extends ElementType = 'div'> = Omit<MenuItemProps<TTag>, 'as'> & AnyElementProps<TTag>;
9
- export type DropDownItemsProps = Omit<MenuItemsProps, 'className' | 'transition'> & {
8
+ export type DropDownItemProps<TTag extends ElementType = 'div'> = Omit<MenuItemProps<TTag>, 'as'> & AsElement<TTag>;
9
+ export type DropDownItemsProps = Omit<MenuItemsProps, 'as' | 'className' | 'transition'> & {
10
10
  className?: string;
11
11
  containerClassName?: string;
12
12
  };
13
- export type DropDownProps = MenuProps;
13
+ export type DropDownProps<TTag extends ElementType = 'div'> = Omit<MenuProps, 'as'> & AsElement<TTag>;
14
14
  export type DropDownSectionProps = MenuSectionProps & {
15
15
  label?: ReactNode;
16
16
  labelProps?: Omit<MenuHeadingProps, 'children'> & {
@@ -20,7 +20,7 @@ export type DropDownSectionProps = MenuSectionProps & {
20
20
  separatorAbove?: boolean;
21
21
  separatorBelow?: boolean;
22
22
  };
23
- export type DropDownSeparatorProps<TTag extends ElementType = 'div'> = Omit<MenuSeparatorProps<TTag>, 'as'> & AnyElementProps<TTag> & {
23
+ export type DropDownSeparatorProps<TTag extends ElementType = 'div'> = Omit<MenuSeparatorProps<TTag>, 'as' | 'className'> & AsElement<TTag> & {
24
24
  className?: MenuSeparatorProps['className'];
25
25
  };
26
26
  import { type MenuButtonProps, type MenuHeadingProps, type MenuItemProps, type MenuItemsProps, type MenuProps, type MenuSectionProps, type MenuSeparatorProps } from '@headlessui/react';
@@ -29,4 +29,4 @@ export declare function DropDownItem<TTag extends ElementType = 'div'>({ as, ...
29
29
  export declare function DropDownItems({ anchor, children, className, containerClassName, style, ...props }: DropDownItemsProps): JSX.Element;
30
30
  export declare function DropDownSection({ children, label, labelProps, separatorAbove, separatorBelow, ...props }: DropDownSectionProps): JSX.Element;
31
31
  export declare function DropDownSeparator<TTag extends ElementType = 'div'>({ as, className, ...props }: DropDownSeparatorProps<TTag>): JSX.Element;
32
- export declare function DropDown(props: DropDownProps): JSX.Element;
32
+ export declare function DropDown<TTag extends ElementType = 'div'>({ as, ...props }: DropDownProps<TTag>): JSX.Element;
@@ -1,18 +1,28 @@
1
1
  import type { OneOf } from '../types';
2
- import type { JSX } from 'react';
2
+ import type { JSX, RefObject } from 'react';
3
3
  type NameOrLegend = OneOf<[
4
4
  {
5
5
  legend: string;
6
6
  legendProps?: Omit<LegendProps, 'children'> & {
7
7
  /** @deprecated Use the `legend` prop instead. */
8
8
  children?: never;
9
+ ref?: RefObject<HTMLLegendElement | null>;
9
10
  };
10
11
  },
11
12
  {
12
13
  name: string;
13
14
  }
14
15
  ]>;
15
- export type FieldsetProps = Omit<HeadlessFieldsetProps, 'name'> & NameOrLegend;
16
+ export type FieldsetProps = Omit<HeadlessFieldsetProps, 'name'> & NameOrLegend & {
17
+ ref?: RefObject<HTMLFieldSetElement | null>;
18
+ };
16
19
  import { type FieldsetProps as HeadlessFieldsetProps, type LegendProps } from '@headlessui/react';
20
+ /**
21
+ * # Fieldset
22
+ *
23
+ * @prop legend - The legend text to display above the fieldset.
24
+ * @prop legendProps - Additional props to pass to the legend component.
25
+ * @prop className - GOTCHA: The default className includes `contents`, to effectively remove it from the layout. Be sure to change the display style if you want to modify any other styles.
26
+ */
17
27
  export declare function Fieldset({ children, className, legend, legendProps, name, ...props }: FieldsetProps): JSX.Element;
18
28
  export {};
@@ -8,9 +8,8 @@ export type HeadingProps = ComponentPropsWithRef<'h1' | 'h2' | 'h3' | 'h4' | 'h5
8
8
  h5: string;
9
9
  h6: string;
10
10
  }>;
11
- ref?: RefObject<HTMLHeadingElement | null>;
12
11
  };
13
- import { type ComponentPropsWithRef, type JSX, type RefObject } from 'react';
12
+ import { type ComponentPropsWithRef, type JSX } from 'react';
14
13
  /**
15
14
  * # Heading
16
15
  * A heading component that renders HTML heading elements (h1-h6) with appropriate styling.
@@ -2,13 +2,14 @@ import type { OneOf } from '../types';
2
2
  type HumanVerificationProps = {
3
3
  children?: string;
4
4
  className?: string;
5
+ ref?: RefObject<HTMLButtonElement | null>;
5
6
  };
6
- import { type JSX } from 'react';
7
+ import { type JSX, type RefObject } from 'react';
7
8
  export declare function validateHuman(token: string): OneOf<[{
8
9
  success: true;
9
10
  }, {
10
11
  error: string;
11
12
  }]>;
12
13
  export declare function generateHumanValidationToken(): string;
13
- export declare function HumanVerification({ children, className, }: HumanVerificationProps): JSX.Element;
14
+ export declare function HumanVerification({ children, className, ref, }: HumanVerificationProps): JSX.Element;
14
15
  export {};