@aciole/acyon 0.0.2 → 0.0.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.
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { AlertProps } from './types';
3
+ export type { AlertProps, AlertVariant } from './types';
4
+ export declare const Alert: React.FC<AlertProps>;
@@ -0,0 +1,8 @@
1
+ import type * as React from 'react';
2
+ export type AlertVariant = 'primary' | 'neutral' | 'success' | 'warning' | 'error';
3
+ export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ variant?: AlertVariant;
5
+ title?: string;
6
+ icon?: React.ReactNode;
7
+ action?: React.ReactNode;
8
+ }
@@ -1,5 +1,5 @@
1
1
  import type * as React from 'react';
2
- export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
2
+ export type AvatarSize = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge';
3
3
  export type AvatarStatus = 'online' | 'offline' | 'away' | 'busy';
4
4
  export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  src?: string;
@@ -2,7 +2,7 @@ import { ColorValue, TokenSize } from '../../utils/styleTokens';
2
2
  import type * as React from 'react';
3
3
  export type BadgeVariant = 'solid' | 'outline' | 'soft';
4
4
  export type BadgeColor = ColorValue;
5
- export type BadgeSize = Extract<TokenSize, 'sm' | 'md' | 'lg'>;
5
+ export type BadgeSize = Extract<TokenSize, 'small' | 'medium' | 'large'>;
6
6
  export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
7
7
  variant?: BadgeVariant;
8
8
  color?: BadgeColor;
@@ -1,8 +1,8 @@
1
1
  import { ColorValue } from '../../utils/styleTokens';
2
2
  import type * as React from 'react';
3
3
  export type ButtonVariant = 'solid' | 'soft' | 'ghost' | 'outline';
4
- export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
- export type ButtonColor = ColorValue | 'default';
4
+ export type ButtonSize = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge';
5
+ export type ButtonColor = ColorValue;
6
6
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
7
7
  variant?: ButtonVariant;
8
8
  size?: ButtonSize;
@@ -1,5 +1,5 @@
1
1
  import type * as React from 'react';
2
- export type ContainerSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
2
+ export type ContainerSize = 'small' | 'medium' | 'large' | 'extraLarge' | 'full';
3
3
  export interface ContainerProps {
4
4
  children: React.ReactNode;
5
5
  size?: ContainerSize;
@@ -1,6 +1,6 @@
1
1
  import type * as React from 'react';
2
2
  export type DrawerPlacement = 'left' | 'right';
3
- export type DrawerSize = 'sm' | 'md' | 'lg' | 'full';
3
+ export type DrawerSize = 'small' | 'medium' | 'large' | 'full';
4
4
  export interface DrawerProps {
5
5
  isOpen: boolean;
6
6
  onClose: () => void;
@@ -0,0 +1,7 @@
1
+ import { DropdownItemProps, DropdownProps } from './types';
2
+ export type { DropdownItemProps, DropdownPlacement, DropdownProps } from './types';
3
+ declare function DropdownRoot({ children, content, open, defaultOpen, onOpenChange, placement, offset, disabled, matchTriggerWidth, closeOnClickOutside, className, ...props }: DropdownProps): import("react/jsx-runtime").JSX.Element;
4
+ declare function DropdownItem({ children, className, inset, destructive, keepOpen, leftContent, rightContent, onClick, onSelect, ...props }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare const Dropdown: typeof DropdownRoot & {
6
+ Item: typeof DropdownItem;
7
+ };
@@ -0,0 +1,22 @@
1
+ import type * as React from 'react';
2
+ export type DropdownPlacement = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
3
+ export interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'content'> {
4
+ children: React.ReactElement;
5
+ content: React.ReactNode;
6
+ open?: boolean;
7
+ defaultOpen?: boolean;
8
+ onOpenChange?: (open: boolean) => void;
9
+ placement?: DropdownPlacement;
10
+ offset?: number;
11
+ disabled?: boolean;
12
+ matchTriggerWidth?: boolean;
13
+ closeOnClickOutside?: boolean;
14
+ }
15
+ export interface DropdownItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
16
+ inset?: boolean;
17
+ destructive?: boolean;
18
+ keepOpen?: boolean;
19
+ leftContent?: React.ReactNode;
20
+ rightContent?: React.ReactNode;
21
+ onSelect?: () => void;
22
+ }
@@ -1,7 +1,7 @@
1
1
  import { ButtonProps, ButtonSize, ButtonVariant } from '../Button/types';
2
2
  import type * as React from 'react';
3
3
  export type IconButtonVariant = ButtonVariant;
4
- export type IconButtonSize = Extract<ButtonSize, 'sm' | 'md' | 'lg'>;
4
+ export type IconButtonSize = Extract<ButtonSize, 'small' | 'medium' | 'large'>;
5
5
  export interface IconButtonProps extends Omit<ButtonProps, 'children' | 'leftIcon' | 'rightIcon'> {
6
6
  icon: React.ReactNode | JSX.Element;
7
7
  label?: string;
@@ -1,6 +1,6 @@
1
1
  import type * as React from 'react';
2
- export type ImageObjectFit = 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
3
- export type ImageRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
2
+ export type ImageObjectFit = 'cover' | 'contain' | 'fill' | 'none' | 'scaleDown';
3
+ export type ImageRadius = 'small' | 'medium' | 'large' | 'full';
4
4
  export interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
5
5
  objectFit?: ImageObjectFit;
6
6
  radius?: ImageRadius;
@@ -1,9 +1,9 @@
1
1
  import type * as React from 'react';
2
- export type InputSize = 'sm' | 'md' | 'lg';
2
+ export type InputSize = 'small' | 'medium' | 'large';
3
3
  export interface InputProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'size' | 'prefix' | 'suffix'> {
4
4
  label?: string;
5
5
  error?: string;
6
- supportText?: string;
6
+ hint?: string;
7
7
  prefix?: React.ReactNode;
8
8
  suffix?: React.ReactNode;
9
9
  clearable?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { ColorValue } from '../../utils/styleTokens';
2
- export type LoaderSize = 'xs' | 'sm' | 'md' | 'lg';
2
+ export type LoaderSize = 'extraSmall' | 'small' | 'medium' | 'large';
3
3
  export interface LoaderProps {
4
4
  size?: LoaderSize;
5
5
  color?: ColorValue;
@@ -1,5 +1,5 @@
1
1
  import type * as React from 'react';
2
- export type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
2
+ export type ModalSize = 'small' | 'medium' | 'large' | 'extraLarge' | 'full';
3
3
  export interface ModalProps {
4
4
  open: boolean;
5
5
  onClose: () => void;
@@ -1,6 +1,6 @@
1
1
  import { ColorValue } from '../../utils/styleTokens';
2
2
  import type * as React from 'react';
3
- export type ProgressSize = 'sm' | 'md' | 'lg';
3
+ export type ProgressSize = 'small' | 'medium' | 'large';
4
4
  export interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  value: number;
6
6
  max?: number;
@@ -5,7 +5,7 @@ export interface SelectOption {
5
5
  searchValue?: string;
6
6
  disabled?: boolean;
7
7
  }
8
- export type SelectSize = 'sm' | 'md' | 'lg';
8
+ export type SelectSize = 'small' | 'medium' | 'large';
9
9
  export interface SelectProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
10
10
  options: SelectOption[];
11
11
  value?: string;
@@ -1,8 +1,6 @@
1
- import type * as React from 'react';
2
- export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
1
+ export interface SkeletonProps {
3
2
  width?: string | number;
4
3
  height?: string | number;
5
- circle?: boolean;
6
- radius?: string | number;
7
4
  animated?: boolean;
5
+ rounded?: boolean;
8
6
  }
@@ -1,5 +1,5 @@
1
1
  import type * as React from 'react';
2
- export type SwitchSize = 'sm' | 'md';
2
+ export type SwitchSize = 'small' | 'medium';
3
3
  export interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
4
4
  label?: string;
5
5
  size?: SwitchSize;
@@ -7,7 +7,7 @@ export interface TabItem {
7
7
  href?: string;
8
8
  }
9
9
  export type TabsVariant = 'default' | 'pills';
10
- export type TabsSize = 'sm' | 'md' | 'lg';
10
+ export type TabsSize = 'small' | 'medium' | 'large';
11
11
  export interface TabsProps {
12
12
  tabs: TabItem[];
13
13
  defaultValue?: string;
@@ -1,7 +1,7 @@
1
1
  import { ColorValue, TokenSize } from '../../utils/styleTokens';
2
2
  import type * as React from 'react';
3
3
  export type TagVariant = 'soft' | 'outline';
4
- export type TagSize = Extract<TokenSize, 'xs' | 'sm' | 'md' | 'lg' | 'xl'>;
4
+ export type TagSize = Extract<TokenSize, 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge'>;
5
5
  export interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {
6
6
  variant?: TagVariant;
7
7
  size?: TagSize;
@@ -3,7 +3,7 @@ export type TextAreaResize = 'none' | 'vertical' | 'horizontal' | 'both';
3
3
  export interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
4
4
  label?: string;
5
5
  error?: string;
6
- supportText?: string;
6
+ hint?: string;
7
7
  full?: boolean;
8
8
  resize?: TextAreaResize;
9
9
  }
@@ -7,6 +7,7 @@ export * from './Search/Search';
7
7
  export * from './DatePicker/DatePicker';
8
8
  export * from './Select/Select';
9
9
  export * from './MultiSelect/MultiSelect';
10
+ export * from './Dropdown/Dropdown';
10
11
  export * from './Checkbox/Checkbox';
11
12
  export * from './Radio/Radio';
12
13
  export * from './Slider/Slider';
@@ -25,6 +26,7 @@ export * from './Heading/Heading';
25
26
  export * from './Code/Code';
26
27
  export * from './Link/Link';
27
28
  export * from './Badge/Badge';
29
+ export * from './Alert/Alert';
28
30
  export * from './Tag/Tag';
29
31
  export * from './Avatar/Avatar';
30
32
  export * from './Image/Image';
@@ -1,9 +1,9 @@
1
1
  import { LooseStringUnion } from '../components/types';
2
- export type TokenColor = 'primary' | 'success' | 'danger' | 'warning' | 'info' | 'neutral';
2
+ export type TokenColor = 'primary' | 'neutral' | 'success' | 'warning' | 'error';
3
3
  export type ColorValue = LooseStringUnion<TokenColor>;
4
- export type TokenTextColor = LooseStringUnion<TokenColor | 'default' | 'subtle' | 'muted' | 'inverse' | 'disabled'>;
4
+ export type TokenTextColor = LooseStringUnion<TokenColor | 'default' | 'inverse' | 'disabled'>;
5
5
  export type TokenIconColor = LooseStringUnion<TokenColor | 'default' | 'disabled'>;
6
- export type TokenSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ export type TokenSize = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge';
7
7
  export type TokenWeight = 'normal' | 'medium' | 'semibold' | 'bold';
8
8
  export declare function isTokenColor(color?: string): color is TokenColor;
9
9
  export declare function colorVar(color?: ColorValue): string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aciole/acyon",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Acyon React component library",
5
5
  "keywords": [
6
6
  "react",