@nild/components 0.0.9 → 0.0.11

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.
@@ -1,5 +1,5 @@
1
1
  import { ReactElement, ButtonHTMLAttributes, HTMLAttributes, RefAttributes, ForwardRefExoticComponent } from 'react';
2
- import { ButtonVariant, ButtonSize, ButtonShape } from './style';
2
+ import { ButtonVariant, ButtonSize, ButtonShape, GroupDirection } from './style';
3
3
  export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
4
  variant?: ButtonVariant;
5
5
  size?: ButtonSize;
@@ -8,12 +8,15 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
8
8
  disabled?: boolean;
9
9
  block?: boolean;
10
10
  }
11
+ /**
12
+ * @category Components
13
+ */
11
14
  declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>> & {
12
15
  Group: typeof Group;
13
16
  };
14
17
  export interface GroupProps extends HTMLAttributes<HTMLDivElement>, Pick<ButtonProps, 'variant' | 'size' | 'disabled'> {
15
18
  children?: ReactElement<ButtonProps> | ReactElement<ButtonProps>[];
16
- direction?: 'horizontal' | 'vertical';
19
+ direction?: GroupDirection;
17
20
  }
18
21
  declare const Group: ForwardRefExoticComponent<GroupProps & RefAttributes<HTMLDivElement>>;
19
22
  export default Button;
@@ -1,3 +1,4 @@
1
- import { default as Button, ButtonProps } from './Button';
2
- export type { ButtonProps };
1
+ import { default as Button, ButtonProps, GroupProps } from './Button';
2
+ import { ButtonVariant, ButtonShape, ButtonSize, GroupDirection } from './style';
3
+ export type { ButtonProps, ButtonVariant, ButtonShape, ButtonSize, GroupProps, GroupDirection };
3
4
  export default Button;
@@ -5,7 +5,7 @@ export declare const SHAPE_CLS_MAP: Record<ButtonShape, string[]>;
5
5
  export type ButtonSize = 'small' | 'medium' | 'large';
6
6
  export declare const SIZE_CLS_MAP: Record<ButtonSize, Record<'true' | 'false', string[]>>;
7
7
  export declare const EQUAL_CLS_MAP: Record<ButtonSize, string[]>;
8
- export type ButtonGroupDirection = 'horizontal' | 'vertical';
9
- export declare const GROUP_FIRST_CLS_MAP: Record<ButtonGroupDirection, string[]>;
10
- export declare const GROUP_LAST_CLS_MAP: Record<ButtonGroupDirection, string[]>;
11
- export declare const GROUP_DIVIDER_CLS_MAP: Record<ButtonGroupDirection, Record<ButtonVariant, string[]>>;
8
+ export type GroupDirection = 'horizontal' | 'vertical';
9
+ export declare const GROUP_FIRST_CLS_MAP: Record<GroupDirection, string[]>;
10
+ export declare const GROUP_LAST_CLS_MAP: Record<GroupDirection, string[]>;
11
+ export declare const GROUP_DIVIDER_CLS_MAP: Record<GroupDirection, Record<ButtonVariant, string[]>>;
@@ -5,5 +5,8 @@ export interface DividerProps extends HTMLAttributes<HTMLDivElement> {
5
5
  direction?: DividerDirection;
6
6
  align?: DividerAlign;
7
7
  }
8
+ /**
9
+ * @category Components
10
+ */
8
11
  declare const Divider: import('react').ForwardRefExoticComponent<DividerProps & import('react').RefAttributes<HTMLDivElement>>;
9
12
  export default Divider;
@@ -1,3 +1,4 @@
1
1
  import { default as Divider, DividerProps } from './Divider';
2
- export type { DividerProps };
2
+ import { DividerVariant, DividerDirection, DividerAlign } from './style';
3
+ export type { DividerProps, DividerVariant, DividerDirection, DividerAlign };
3
4
  export default Divider;
@@ -2,7 +2,7 @@ import { FC, ReactNode } from 'react';
2
2
  import { default as Portal } from '../portal';
3
3
  import { default as Trigger, TriggerAction } from '../trigger';
4
4
  import { Placement, OffsetOptions } from '@floating-ui/dom';
5
- interface PopoverProps {
5
+ export interface PopoverProps {
6
6
  children?: ReactNode;
7
7
  placement?: Placement;
8
8
  offset?: OffsetOptions;
@@ -11,6 +11,9 @@ interface PopoverProps {
11
11
  defaultOpen?: boolean;
12
12
  onChange?: (open: boolean) => void;
13
13
  }
14
+ /**
15
+ * @category Components
16
+ */
14
17
  declare const Popover: FC<PopoverProps> & {
15
18
  Trigger: typeof Trigger;
16
19
  Portal: typeof Portal;
@@ -1,2 +1,3 @@
1
- import { default as Popover } from './Popover';
1
+ import { default as Popover, PopoverProps } from './Popover';
2
+ export type { PopoverProps };
2
3
  export default Popover;
@@ -1,7 +1,7 @@
1
1
  import { HTMLAttributes, Ref } from 'react';
2
2
  import { ArrowProps } from './Arrow';
3
3
  import { PaddingSize } from './style';
4
- interface ArrowOptions extends ArrowProps {
4
+ export interface ArrowOptions extends ArrowProps {
5
5
  ref: Ref<HTMLDivElement>;
6
6
  }
7
7
  export interface PortalProps extends HTMLAttributes<HTMLDivElement> {
@@ -9,5 +9,8 @@ export interface PortalProps extends HTMLAttributes<HTMLDivElement> {
9
9
  paddingSize?: PaddingSize;
10
10
  arrow?: ArrowOptions | false;
11
11
  }
12
+ /**
13
+ * @category Components
14
+ */
12
15
  declare const Portal: import('react').ForwardRefExoticComponent<PortalProps & import('react').RefAttributes<HTMLDivElement>>;
13
16
  export default Portal;
@@ -1,5 +1,6 @@
1
1
  import { default as Arrow, ArrowProps } from './Arrow';
2
- import { default as Portal, PortalProps } from './Portal';
3
- export type { ArrowProps, PortalProps };
2
+ import { default as Portal, PortalProps, ArrowOptions } from './Portal';
3
+ import { PaddingSize } from './style';
4
+ export type { ArrowProps, PortalProps, PaddingSize, ArrowOptions };
4
5
  export { Arrow };
5
6
  export default Portal;
@@ -11,6 +11,9 @@ export interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement
11
11
  disabled?: boolean;
12
12
  onChange?: (checked: boolean) => void;
13
13
  }
14
+ /**
15
+ * @category Components
16
+ */
14
17
  declare const Switch: ForwardRefExoticComponent<SwitchProps & RefAttributes<HTMLButtonElement>> & {
15
18
  Checked: typeof Checked;
16
19
  Unchecked: typeof Unchecked;
@@ -1,2 +1,4 @@
1
- import { default as Switch } from './Switch';
1
+ import { SwitchVariant, SwitchSize, SwitchShape } from './style';
2
+ import { default as Switch, SwitchProps } from './Switch';
3
+ export type { SwitchProps, SwitchVariant, SwitchSize, SwitchShape };
2
4
  export default Switch;
@@ -1,8 +1,11 @@
1
1
  import { FC, ReactNode } from 'react';
2
- interface TransitionProps {
2
+ export interface TransitionProps {
3
3
  className?: string;
4
4
  children?: ReactNode;
5
5
  visible?: boolean;
6
6
  }
7
+ /**
8
+ * @category Components
9
+ */
7
10
  declare const Transition: FC<TransitionProps>;
8
11
  export default Transition;
@@ -1,2 +1,3 @@
1
- import { default as Transition } from './Transition';
1
+ import { default as Transition, TransitionProps } from './Transition';
2
+ export type { TransitionProps };
2
3
  export default Transition;
@@ -7,5 +7,8 @@ export interface TriggerProps {
7
7
  onOpen?: () => void;
8
8
  onClose?: () => void;
9
9
  }
10
+ /**
11
+ * @category Components
12
+ */
10
13
  declare const Trigger: import('react').ForwardRefExoticComponent<TriggerProps & import('react').RefAttributes<Element>>;
11
14
  export default Trigger;
@@ -4,6 +4,9 @@ import { default as Paragraph } from './Paragraph';
4
4
  import { default as Text } from './Text';
5
5
  import { default as Title } from './Title';
6
6
  export type TypographyProps = HTMLAttributes<HTMLElement>;
7
+ /**
8
+ * @category Components
9
+ */
7
10
  declare const Typography: ForwardRefExoticComponent<TypographyProps> & {
8
11
  Link: typeof Link;
9
12
  Paragraph: typeof Paragraph;
@@ -1,3 +1,8 @@
1
+ import { LinkProps } from './Link';
2
+ import { ParagraphProps } from './Paragraph';
3
+ import { HeadingLevel } from './style';
4
+ import { TextProps } from './Text';
5
+ import { TitleProps } from './Title';
1
6
  import { default as Typography, TypographyProps } from './Typography';
2
- export type { TypographyProps };
7
+ export type { TypographyProps, LinkProps, ParagraphProps, TextProps, TitleProps, HeadingLevel };
3
8
  export default Typography;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nild/components",
3
3
  "private": false,
4
- "version": "0.0.9",
4
+ "version": "0.0.11",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
7
7
  "exports": {
@@ -31,12 +31,13 @@
31
31
  "peerDependencies": {
32
32
  "react": ">=18.2.0",
33
33
  "react-dom": ">=18.2.0",
34
- "@nild/shared": "0.0.6",
35
- "@nild/hooks": "0.0.8"
34
+ "@nild/hooks": "0.0.9",
35
+ "@nild/shared": "0.0.7"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "vite build --mode PROD",
39
39
  "dev": "vite build --mode DEV --watch",
40
+ "api": "node scripts/generate-api.js",
40
41
  "test": "vitest run --environment jsdom --globals",
41
42
  "test:coverage": "vitest run --environment jsdom --globals --coverage"
42
43
  }