cekat-ui 1.1.0 → 1.2.0
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.
- package/dist/components/Avatar/Avatar.d.ts +6 -0
- package/dist/components/Avatar/AvatarIcons.d.ts +8 -0
- package/dist/components/Avatar/avatar.styles.d.ts +12 -0
- package/dist/components/Avatar/avatar.types.d.ts +16 -0
- package/dist/components/Avatar/index.d.ts +3 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +6 -0
- package/dist/components/AvatarGroup/avatargroup.styles.d.ts +8 -0
- package/dist/components/AvatarGroup/avatargroup.types.d.ts +16 -0
- package/dist/components/AvatarGroup/index.d.ts +3 -0
- package/dist/components/AvatarLabelGroup/AvatarLabelGroup.d.ts +6 -0
- package/dist/components/AvatarLabelGroup/avatarlabelgroup.styles.d.ts +5 -0
- package/dist/components/AvatarLabelGroup/avatarlabelgroup.types.d.ts +14 -0
- package/dist/components/AvatarLabelGroup/index.d.ts +3 -0
- package/dist/components/AvatarProfilePhoto/AvatarProfilePhoto.d.ts +6 -0
- package/dist/components/AvatarProfilePhoto/avatarprofilephoto.styles.d.ts +10 -0
- package/dist/components/AvatarProfilePhoto/avatarprofilephoto.types.d.ts +12 -0
- package/dist/components/AvatarProfilePhoto/index.d.ts +3 -0
- package/dist/components/Badge/Badge.d.ts +6 -0
- package/dist/components/Badge/badge.styles.d.ts +20 -0
- package/dist/components/Badge/badge.types.d.ts +23 -0
- package/dist/components/Badge/index.d.ts +3 -0
- package/dist/components/BadgeGroup/BadgeGroup.d.ts +6 -0
- package/dist/components/BadgeGroup/badgegroup.styles.d.ts +28 -0
- package/dist/components/BadgeGroup/badgegroup.types.d.ts +19 -0
- package/dist/components/BadgeGroup/index.d.ts +3 -0
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/button.styles.d.ts +2 -1
- package/dist/components/Button/button.types.d.ts +2 -1
- package/dist/components/Checkbox/checkbox.types.d.ts +3 -1
- package/dist/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/components/Dropdown/dropdown.styles.d.ts +19 -0
- package/dist/components/Dropdown/dropdown.types.d.ts +44 -0
- package/dist/components/Dropdown/index.d.ts +3 -0
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/input.styles.d.ts +21 -3
- package/dist/components/Input/input.types.d.ts +24 -1
- package/dist/components/InputDropdown/InputDropdown.d.ts +2 -0
- package/dist/components/InputDropdown/index.d.ts +3 -0
- package/dist/components/InputDropdown/inputDropdown.styles.d.ts +15 -0
- package/dist/components/InputDropdown/inputDropdown.types.d.ts +45 -0
- package/dist/components/Loading/Loading.d.ts +6 -0
- package/dist/components/Loading/LoadingSpinner.d.ts +9 -0
- package/dist/components/Loading/index.d.ts +3 -0
- package/dist/components/Loading/loading.styles.d.ts +6 -0
- package/dist/components/Loading/loading.types.d.ts +10 -0
- package/dist/components/Radio/radio.types.d.ts +3 -1
- package/dist/components/Tab/Tab.d.ts +6 -0
- package/dist/components/Tab/TabList.d.ts +6 -0
- package/dist/components/Tab/index.d.ts +4 -0
- package/dist/components/Tab/tab.styles.d.ts +15 -0
- package/dist/components/Tab/tab.types.d.ts +24 -0
- package/dist/components/Tag/Tag.d.ts +6 -0
- package/dist/components/Tag/index.d.ts +3 -0
- package/dist/components/Tag/tag.styles.d.ts +19 -0
- package/dist/components/Tag/tag.types.d.ts +21 -0
- package/dist/components/Textarea/Textarea.d.ts +4 -0
- package/dist/components/Textarea/index.d.ts +3 -0
- package/dist/components/Textarea/textarea.styles.d.ts +14 -0
- package/dist/components/Textarea/textarea.types.d.ts +17 -0
- package/dist/components/Toggle/toggle.styles.d.ts +2 -1
- package/dist/components/Toggle/toggle.types.d.ts +5 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/tooltip.styles.d.ts +2 -0
- package/dist/components/Tooltip/tooltip.types.d.ts +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.es.js +2688 -649
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1904 -416
- package/dist/utils/color.d.ts +4 -0
- package/package.json +4 -4
- package/tailwind.preset.cjs +137 -39
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const UserPlaceholderIcon: ({ className, style, }: {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const VerifiedTickIcon: ({ className }: {
|
|
7
|
+
className?: string;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AvatarSize } from './avatar.types';
|
|
2
|
+
export declare const avatarSizeMap: Record<AvatarSize, {
|
|
3
|
+
box: number;
|
|
4
|
+
borderWidth: string;
|
|
5
|
+
statusSize: number;
|
|
6
|
+
badgeSize: number;
|
|
7
|
+
textClass: string;
|
|
8
|
+
}>;
|
|
9
|
+
/** Figma's online-indicator green (fg-success-secondary) — noticeably brighter
|
|
10
|
+
* than this repo's `success-500` token, kept exact since it's a recognizable,
|
|
11
|
+
* standardized "online status" color. */
|
|
12
|
+
export declare const AVATAR_ONLINE_COLOR = "#17B26A";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
|
+
export type AvatarStatus = 'none' | 'online' | 'company' | 'verified';
|
|
4
|
+
export interface AvatarProps {
|
|
5
|
+
/** Image URL. When provided, renders the photo. */
|
|
6
|
+
src?: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
/** Renders centered initials instead of a photo/placeholder icon. */
|
|
9
|
+
initials?: React.ReactNode;
|
|
10
|
+
size?: AvatarSize;
|
|
11
|
+
status?: AvatarStatus;
|
|
12
|
+
/** Custom content for the "company" status badge (e.g. a logo image). */
|
|
13
|
+
statusIcon?: React.ReactNode;
|
|
14
|
+
contrastBorder?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type AvatarGroupSize = 'xs' | 'sm' | 'md';
|
|
3
|
+
export interface AvatarGroupItem {
|
|
4
|
+
src?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
initials?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface AvatarGroupProps {
|
|
9
|
+
avatars: AvatarGroupItem[];
|
|
10
|
+
/** Max avatars to show before collapsing the rest into a "+N" badge. */
|
|
11
|
+
max?: number;
|
|
12
|
+
size?: AvatarGroupSize;
|
|
13
|
+
/** Shows a dashed "add" button after the avatars when provided. */
|
|
14
|
+
onAdd?: () => void;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AvatarLabelGroupProps } from './avatarlabelgroup.types';
|
|
2
|
+
declare const AvatarLabelGroup: {
|
|
3
|
+
({ name, subtitle, src, initials, size, status, statusIcon, className, }: AvatarLabelGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default AvatarLabelGroup;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AvatarStatus } from '../Avatar/avatar.types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type AvatarLabelGroupSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
export interface AvatarLabelGroupProps {
|
|
5
|
+
name: React.ReactNode;
|
|
6
|
+
subtitle?: React.ReactNode;
|
|
7
|
+
src?: string;
|
|
8
|
+
initials?: React.ReactNode;
|
|
9
|
+
size?: AvatarLabelGroupSize;
|
|
10
|
+
status?: AvatarStatus;
|
|
11
|
+
/** Custom content for the "company" status badge (e.g. a logo image). */
|
|
12
|
+
statusIcon?: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AvatarProfilePhotoProps } from './avatarprofilephoto.types';
|
|
2
|
+
declare const AvatarProfilePhoto: {
|
|
3
|
+
({ src, alt, initials, size, verified, contrastBorder, className, }: AvatarProfilePhotoProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default AvatarProfilePhoto;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AvatarProfilePhotoSize } from './avatarprofilephoto.types';
|
|
2
|
+
export declare const avatarProfilePhotoSizeMap: Record<AvatarProfilePhotoSize, {
|
|
3
|
+
box: number;
|
|
4
|
+
ringWidth: number;
|
|
5
|
+
shadowClass: string;
|
|
6
|
+
iconSize: number;
|
|
7
|
+
textClass: string;
|
|
8
|
+
verifiedSize: number;
|
|
9
|
+
verifiedOffset: number;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type AvatarProfilePhotoSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export interface AvatarProfilePhotoProps {
|
|
4
|
+
src?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
/** Renders centered initials instead of a photo/placeholder icon. */
|
|
7
|
+
initials?: React.ReactNode;
|
|
8
|
+
size?: AvatarProfilePhotoSize;
|
|
9
|
+
verified?: boolean;
|
|
10
|
+
contrastBorder?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BadgeProps } from './badge.types';
|
|
2
|
+
declare const Badge: {
|
|
3
|
+
({ children, size, shape, variant, color, customColor, modern, icon, trailingIcon, checked, onCheckedChange, onClose, iconOnly, disabled, className, }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default Badge;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BadgeColor } from './badge.types';
|
|
2
|
+
export declare const badgeColorStyles: Record<BadgeColor, {
|
|
3
|
+
solidBg: string;
|
|
4
|
+
solidBorder: string;
|
|
5
|
+
solidText: string;
|
|
6
|
+
outlineBorder: string;
|
|
7
|
+
outlineText: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const badgeStyles: (props?: {
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
shape?: "pill" | "badge";
|
|
12
|
+
modern?: boolean;
|
|
13
|
+
hasLeading?: boolean;
|
|
14
|
+
hasTrailing?: boolean;
|
|
15
|
+
iconOnly?: boolean;
|
|
16
|
+
interactive?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
19
|
+
export declare const badgeCheckboxStyles = "size-4 shrink-0 rounded border bg-white";
|
|
20
|
+
export declare const badgeCloseButtonStyles = "shrink-0 rounded p-0.5 hover:bg-black/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type BadgeSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export type BadgeShape = 'pill' | 'badge';
|
|
4
|
+
export type BadgeVariant = 'solid' | 'outline';
|
|
5
|
+
export type BadgeColor = 'brand' | 'gray' | 'error' | 'warning' | 'success' | 'blue-gray' | 'blue-light' | 'indigo' | 'purple' | 'blue' | 'pink' | 'orange';
|
|
6
|
+
export interface BadgeProps {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
size?: BadgeSize;
|
|
9
|
+
shape?: BadgeShape;
|
|
10
|
+
variant?: BadgeVariant;
|
|
11
|
+
color?: BadgeColor;
|
|
12
|
+
/** Custom accent color as a 6-digit hex (e.g. "#13a8bf"), applied to border, background/tint and text. Overrides `color` when set. Ignored if not a valid 6-digit hex. */
|
|
13
|
+
customColor?: string;
|
|
14
|
+
modern?: boolean;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
trailingIcon?: React.ReactNode;
|
|
17
|
+
checked?: boolean;
|
|
18
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
iconOnly?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BadgeGroupProps } from './badgegroup.types';
|
|
2
|
+
declare const BadgeGroup: {
|
|
3
|
+
({ badgeLabel, children, size, theme, color, badgePosition, icon, onClick, className, }: BadgeGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default BadgeGroup;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BadgeGroupColor } from './badgegroup.types';
|
|
2
|
+
export declare const badgeGroupColorStyles: Record<BadgeGroupColor, {
|
|
3
|
+
bg50: string;
|
|
4
|
+
hoverBg100: string;
|
|
5
|
+
border200: string;
|
|
6
|
+
border500: string;
|
|
7
|
+
text500: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const badgeGroupSizeStyles: {
|
|
10
|
+
readonly md: {
|
|
11
|
+
readonly outerPad: {
|
|
12
|
+
readonly leading: "pl-1 pr-2.5 py-1";
|
|
13
|
+
readonly trailing: "pl-3 pr-1 py-1";
|
|
14
|
+
};
|
|
15
|
+
readonly gap: "gap-2";
|
|
16
|
+
readonly chipPad: "px-2 py-0.5";
|
|
17
|
+
readonly text: "text-caption-lg";
|
|
18
|
+
};
|
|
19
|
+
readonly lg: {
|
|
20
|
+
readonly outerPad: {
|
|
21
|
+
readonly leading: "pl-1.5 pr-3 py-1.5";
|
|
22
|
+
readonly trailing: "pl-3 pr-1.5 py-1.5";
|
|
23
|
+
};
|
|
24
|
+
readonly gap: "gap-2";
|
|
25
|
+
readonly chipPad: "px-2.5 py-[3px]";
|
|
26
|
+
readonly text: "text-body-sm";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type BadgeGroupSize = 'md' | 'lg';
|
|
3
|
+
export type BadgeGroupTheme = 'light' | 'outline' | 'modern';
|
|
4
|
+
export type BadgeGroupBadgePosition = 'leading' | 'trailing';
|
|
5
|
+
export type BadgeGroupColor = 'brand' | 'gray' | 'error' | 'warning' | 'success';
|
|
6
|
+
export interface BadgeGroupProps {
|
|
7
|
+
/** Text shown inside the small inner chip, e.g. "New" */
|
|
8
|
+
badgeLabel: React.ReactNode;
|
|
9
|
+
/** The announcement message */
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
size?: BadgeGroupSize;
|
|
12
|
+
theme?: BadgeGroupTheme;
|
|
13
|
+
color?: BadgeGroupColor;
|
|
14
|
+
badgePosition?: BadgeGroupBadgePosition;
|
|
15
|
+
/** Optional trailing icon (e.g. an arrow) */
|
|
16
|
+
icon?: React.ReactNode;
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ButtonProps } from './button.types';
|
|
2
|
-
declare const ButtonBase: ({ children, className, tone, variant, size, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const ButtonBase: ({ children, className, tone, variant, size, iconOnly, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default ButtonBase;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const buttonStyles: (props?: {
|
|
2
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl";
|
|
2
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
3
3
|
tone?: "primary" | "destructive";
|
|
4
|
+
iconOnly?: boolean;
|
|
4
5
|
variant?: "solid" | "outline" | "ghost" | "outline-primary" | "ghost-primary" | "plain" | "plain-black";
|
|
5
6
|
} & import('class-variance-authority/types').ClassProp) => string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export type ButtonTone = "primary" | "destructive";
|
|
3
3
|
export type ButtonVariant = "solid" | "outline" | "outline-primary" | "ghost" | "ghost-primary" | "plain" | "plain-black";
|
|
4
|
-
export type ButtonSize = "sm" | "md" | "lg" | "xl" | "2xl";
|
|
4
|
+
export type ButtonSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
5
5
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
6
|
tone?: ButtonTone;
|
|
7
7
|
size?: ButtonSize;
|
|
8
8
|
variant?: ButtonVariant;
|
|
9
|
+
iconOnly?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export interface ButtonSubComponentProps {
|
|
11
12
|
children: React.ReactNode;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export type CheckboxSize = 'sm' | 'md'
|
|
1
|
+
export type CheckboxSize = 'sm' | 'md'
|
|
2
|
+
/** @deprecated `lg` is no longer a distinct size — it now renders identically to `md` and will be removed in a future major version. Migrate to `md`. */
|
|
3
|
+
| 'lg';
|
|
2
4
|
export interface CheckboxProps {
|
|
3
5
|
id?: string;
|
|
4
6
|
checked: boolean;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { DropdownProps } from './dropdown.types';
|
|
2
|
+
export default function Dropdown({ trigger, label, icon, avatarSrc, avatarInitials, header, items, open: openProp, defaultOpen, onOpenChange, disabled, align, className, menuClassName, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const dropdownButtonTriggerStyles: (props?: {
|
|
2
|
+
open?: boolean;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
5
|
+
export declare const dropdownIconTriggerStyles: (props?: {
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
8
|
+
export declare const dropdownAvatarTriggerStyles: (props?: {
|
|
9
|
+
open?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
12
|
+
export declare const dropdownMenuStyles: (props?: import('class-variance-authority/types').ClassProp) => string;
|
|
13
|
+
export declare const dropdownHeaderStyles: (props?: import('class-variance-authority/types').ClassProp) => string;
|
|
14
|
+
export declare const dropdownItemsWrapperStyles: (props?: import('class-variance-authority/types').ClassProp) => string;
|
|
15
|
+
export declare const dropdownItemStyles: (props?: {
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
18
|
+
export declare const dropdownShortcutStyles: (props?: import('class-variance-authority/types').ClassProp) => string;
|
|
19
|
+
export declare const dropdownDividerStyles: (props?: import('class-variance-authority/types').ClassProp) => string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import { AvatarStatus } from '../Avatar/avatar.types';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export type DropdownTriggerType = "button" | "icon" | "avatar";
|
|
5
|
+
export interface DropdownMenuItem {
|
|
6
|
+
id: string;
|
|
7
|
+
/** Renders a horizontal divider instead of an item when true. */
|
|
8
|
+
divider?: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
/** Trailing shortcut hint (e.g. "⌘C"). */
|
|
12
|
+
shortcut?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface DropdownHeader {
|
|
17
|
+
name: React.ReactNode;
|
|
18
|
+
subtitle?: React.ReactNode;
|
|
19
|
+
avatarSrc?: string;
|
|
20
|
+
avatarInitials?: React.ReactNode;
|
|
21
|
+
status?: AvatarStatus;
|
|
22
|
+
}
|
|
23
|
+
export interface DropdownProps {
|
|
24
|
+
/** "button" shows a labeled trigger, "icon" a kebab trigger, "avatar" the user's avatar. */
|
|
25
|
+
trigger?: DropdownTriggerType;
|
|
26
|
+
/** Label for the "button" trigger. */
|
|
27
|
+
label?: string;
|
|
28
|
+
/** Custom icon for the "icon" trigger (defaults to a vertical-dots icon). */
|
|
29
|
+
icon?: React.ReactNode;
|
|
30
|
+
/** Avatar image for the "avatar" trigger. */
|
|
31
|
+
avatarSrc?: string;
|
|
32
|
+
avatarInitials?: React.ReactNode;
|
|
33
|
+
/** Optional user summary rendered at the top of the menu. */
|
|
34
|
+
header?: DropdownHeader;
|
|
35
|
+
items: DropdownMenuItem[];
|
|
36
|
+
open?: boolean;
|
|
37
|
+
defaultOpen?: boolean;
|
|
38
|
+
onOpenChange?: (open: boolean) => void;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/** Which edge of the trigger the menu aligns to. */
|
|
41
|
+
align?: "start" | "end";
|
|
42
|
+
className?: ClassValue;
|
|
43
|
+
menuClassName?: ClassValue;
|
|
44
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { InputProps } from './input.types';
|
|
2
|
-
export default function Input({ label, required, hint, rightIcon, size, error, disabled, prefix, suffix, maxLength, value, className, wrapperClassName, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function Input({ label, required, hint, rightIcon, size, error, disabled, compact, hideCalendarIcon, type, prefix, suffix, leadingAddon, leadingDropdown, trailingDropdown, trailingButton, maxLength, value, className, wrapperClassName, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
export declare const inputWrapperStyles: (props?: {
|
|
2
|
-
size?: "sm" | "md";
|
|
2
|
+
size?: "xs" | "sm" | "md";
|
|
3
3
|
} & import('class-variance-authority/types').ClassProp) => string;
|
|
4
4
|
export declare const labelStyles: (props?: {
|
|
5
5
|
error?: boolean;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) => string;
|
|
7
7
|
export declare const inputContainerStyles: (props?: {
|
|
8
|
-
size?: "sm" | "md";
|
|
8
|
+
size?: "xs" | "sm" | "md";
|
|
9
9
|
error?: boolean;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
} & import('class-variance-authority/types').ClassProp) => string;
|
|
12
12
|
export declare const inputStyles: (props?: {
|
|
13
|
-
size?: "sm" | "md";
|
|
13
|
+
size?: "xs" | "sm" | "md";
|
|
14
14
|
error?: boolean;
|
|
15
15
|
} & import('class-variance-authority/types').ClassProp) => string;
|
|
16
16
|
export declare const hintStyles: (props?: {
|
|
17
17
|
error?: boolean;
|
|
18
18
|
} & import('class-variance-authority/types').ClassProp) => string;
|
|
19
|
+
export declare const inputGroupWrapperStyles: (props?: {
|
|
20
|
+
size?: "xs" | "sm" | "md";
|
|
21
|
+
error?: boolean;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
24
|
+
export declare const inputGroupFieldStyles: (props?: {
|
|
25
|
+
size?: "xs" | "sm" | "md";
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
28
|
+
export declare const inputAddonStyles: (props?: {
|
|
29
|
+
size?: "xs" | "sm" | "md";
|
|
30
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
31
|
+
export declare const inputDropdownStyles: (props?: {
|
|
32
|
+
size?: "xs" | "sm" | "md";
|
|
33
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
34
|
+
export declare const inputTrailingButtonStyles: (props?: {
|
|
35
|
+
size?: "xs" | "sm" | "md";
|
|
36
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
export type InputSize = "sm" | "md";
|
|
3
|
+
export type InputSize = "xs" | "sm" | "md";
|
|
4
|
+
export interface InputDropdownSlot {
|
|
5
|
+
value: React.ReactNode;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface InputTrailingButtonSlot {
|
|
10
|
+
label: React.ReactNode;
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
4
15
|
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "className"> {
|
|
5
16
|
label?: string;
|
|
6
17
|
required?: boolean;
|
|
@@ -8,8 +19,20 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
8
19
|
rightIcon?: React.ReactNode;
|
|
9
20
|
size?: InputSize;
|
|
10
21
|
error?: boolean;
|
|
22
|
+
/** Tighter padding/height/radius and a smaller semibold label, independent of `size`'s font scale. Opt-in, does not affect default styling. */
|
|
23
|
+
compact?: boolean;
|
|
24
|
+
/** Hides the browser-native calendar icon on `type="date"` inputs (e.g. when a custom `prefix` icon already covers that affordance). Opt-in, no effect on other input types or existing consumers. */
|
|
25
|
+
hideCalendarIcon?: boolean;
|
|
11
26
|
prefix?: React.ReactNode;
|
|
12
27
|
suffix?: React.ReactNode;
|
|
28
|
+
/** Renders a separately-boxed add-on (e.g. "http://") divided from the input by its own border. */
|
|
29
|
+
leadingAddon?: React.ReactNode;
|
|
30
|
+
/** Renders a clickable value+chevron trigger sharing the input's border, no divider (e.g. country code). */
|
|
31
|
+
leadingDropdown?: InputDropdownSlot;
|
|
32
|
+
/** Renders a clickable value+chevron trigger sharing the input's border, no divider (e.g. currency). */
|
|
33
|
+
trailingDropdown?: InputDropdownSlot;
|
|
34
|
+
/** Renders a button fused to the input's trailing edge, sharing the outer border (e.g. "Copy"). */
|
|
35
|
+
trailingButton?: InputTrailingButtonSlot;
|
|
13
36
|
maxLength?: number;
|
|
14
37
|
className?: ClassValue;
|
|
15
38
|
wrapperClassName?: ClassValue;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { InputDropdownProps } from './inputDropdown.types';
|
|
2
|
+
export default function InputDropdown({ size, type, label, required, helpIcon, hint, placeholder, disabled, compact, leadingIcon, options, value, onChange, values, onValuesChange, className, wrapperClassName, }: InputDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const dropdownWrapperStyles: (props?: import('class-variance-authority/types').ClassProp) => string;
|
|
2
|
+
export declare const dropdownLabelStyles: (props?: import('class-variance-authority/types').ClassProp) => string;
|
|
3
|
+
export declare const dropdownTriggerStyles: (props?: {
|
|
4
|
+
size?: "xs" | "sm" | "md";
|
|
5
|
+
open?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
8
|
+
export declare const dropdownMenuStyles: (props?: {
|
|
9
|
+
size?: "xs" | "sm" | "md";
|
|
10
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
11
|
+
export declare const dropdownItemStyles: (props?: {
|
|
12
|
+
size?: "xs" | "sm" | "md";
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
15
|
+
export declare const dropdownHintStyles: (props?: import('class-variance-authority/types').ClassProp) => string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type InputDropdownSize = "xs" | "sm" | "md";
|
|
4
|
+
export type InputDropdownType = "default" | "search" | "tags";
|
|
5
|
+
export interface InputDropdownOption {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
/** Muted secondary text rendered after the label (e.g. "@nicholas"). */
|
|
9
|
+
supportingText?: string;
|
|
10
|
+
/** Leading icon rendered before the label. */
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
/** Avatar image URL rendered before the label. */
|
|
13
|
+
avatar?: string;
|
|
14
|
+
/** Dot color rendered before the label (any CSS color). */
|
|
15
|
+
dot?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface InputDropdownProps {
|
|
19
|
+
size?: InputDropdownSize;
|
|
20
|
+
/**
|
|
21
|
+
* "default" is a click-to-select dropdown, "search" adds a filter input,
|
|
22
|
+
* "tags" is a searchable multi-select with removable tags.
|
|
23
|
+
*/
|
|
24
|
+
type?: InputDropdownType;
|
|
25
|
+
label?: string;
|
|
26
|
+
required?: boolean;
|
|
27
|
+
/** Tighter padding/height/radius and a smaller semibold label, independent of `size`'s font scale. Opt-in, does not affect default styling. */
|
|
28
|
+
compact?: boolean;
|
|
29
|
+
/** Rendered after the label (e.g. a help tooltip icon). */
|
|
30
|
+
helpIcon?: React.ReactNode;
|
|
31
|
+
hint?: string;
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** Leading ornament shown on the trigger while no option is selected (e.g. a user icon or dot). */
|
|
35
|
+
leadingIcon?: React.ReactNode;
|
|
36
|
+
options: InputDropdownOption[];
|
|
37
|
+
/** Selected option id ("default" / "search" types). */
|
|
38
|
+
value?: string | null;
|
|
39
|
+
onChange?: (option: InputDropdownOption) => void;
|
|
40
|
+
/** Selected option ids ("tags" type). */
|
|
41
|
+
values?: string[];
|
|
42
|
+
onValuesChange?: (ids: string[]) => void;
|
|
43
|
+
className?: ClassValue;
|
|
44
|
+
wrapperClassName?: ClassValue;
|
|
45
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const LineSimpleSpinner: ({ size }: {
|
|
2
|
+
size: number;
|
|
3
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const LineSpinnerSpinner: ({ size }: {
|
|
5
|
+
size: number;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const DotCircleSpinner: ({ size }: {
|
|
8
|
+
size: number;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type LoadingSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type LoadingStyle = 'line-simple' | 'line-spinner' | 'dot-circle';
|
|
4
|
+
export interface LoadingProps {
|
|
5
|
+
size?: LoadingSize;
|
|
6
|
+
style?: LoadingStyle;
|
|
7
|
+
supportingText?: boolean;
|
|
8
|
+
label?: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export type RadioSize = 'sm' | 'md'
|
|
1
|
+
export type RadioSize = 'sm' | 'md'
|
|
2
|
+
/** @deprecated `lg` is no longer a distinct size — it now renders identically to `md` and will be removed in a future major version. Migrate to `md`. */
|
|
3
|
+
| 'lg';
|
|
2
4
|
export interface RadioGroupProps {
|
|
3
5
|
value?: string;
|
|
4
6
|
defaultValue?: string;
|