@l3mpire/ui 2.5.3 → 2.6.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/USAGE.md CHANGED
@@ -286,6 +286,66 @@ import { faMagnifyingGlassSolid, faEnvelopeSolid } from "@l3mpire/icons";
286
286
 
287
287
  ---
288
288
 
289
+ ### ChipInput
290
+
291
+ ```tsx
292
+ import { ChipInput } from "@l3mpire/ui";
293
+
294
+ const [values, setValues] = useState<string[]>([]);
295
+
296
+ <ChipInput values={values} onChange={setValues} label="Does contain" placeholder="Write your value and press Enter" />
297
+ <ChipInput values={values} onChange={setValues} label="Tags" error errorMessage="At least one value required" />
298
+ <ChipInput values={values} onChange={setValues} label="Filter" size="sm" />
299
+ ```
300
+
301
+ | Prop | Values |
302
+ |---|---|
303
+ | `size` | `"sm"`, `"md"` |
304
+ | `values` | `string[]` (controlled) |
305
+ | `onChange` | `(values: string[]) => void` |
306
+ | `placeholder` | `string` |
307
+ | `label` | `string` |
308
+ | `error` | `boolean` |
309
+ | `errorMessage` | `string` |
310
+ | `disabled` | `boolean` |
311
+ | `iconLeft` | `IconDefinition` |
312
+ | `max` | `number` (max chips, 0 = unlimited) |
313
+
314
+ Type a value and press Enter to create a chip. Backspace on empty input removes the last chip. Duplicate values are ignored.
315
+
316
+ ---
317
+
318
+ ### NumberInput
319
+
320
+ ```tsx
321
+ import { NumberInput } from "@l3mpire/ui";
322
+
323
+ const [value, setValue] = useState(1);
324
+
325
+ <NumberInput value={value} onChange={setValue} label="Quantity" />
326
+ <NumberInput value={value} onChange={setValue} label="Quantity" min={0} max={100} step={5} />
327
+ <NumberInput value={value} onChange={setValue} label="Quantity" size="sm" />
328
+ <NumberInput value={value} onChange={setValue} label="Quantity" error errorMessage="Value out of range" />
329
+ ```
330
+
331
+ | Prop | Values |
332
+ |---|---|
333
+ | `size` | `"sm"`, `"md"` |
334
+ | `value` | `number` (controlled) |
335
+ | `defaultValue` | `number` (uncontrolled, default `0`) |
336
+ | `onChange` | `(value: number) => void` |
337
+ | `min` | `number` |
338
+ | `max` | `number` |
339
+ | `step` | `number` (default `1`) |
340
+ | `label` | `string` |
341
+ | `error` | `boolean` |
342
+ | `errorMessage` | `string` |
343
+ | `disabled` | `boolean` |
344
+
345
+ Buttons disable automatically at min/max. Input auto-resizes for large numbers (>3 digits).
346
+
347
+ ---
348
+
289
349
  ### TextArea
290
350
 
291
351
  ```tsx
@@ -368,6 +428,9 @@ import { Select } from "@l3mpire/ui";
368
428
  | `error` | `boolean` |
369
429
  | `errorMessage` | `string` |
370
430
  | `icon` | `IconDefinition` |
431
+ | `tags` | `string[]` (shows selected values as chips with overflow +X) |
432
+ | `onTagRemove` | `(tag: string) => void` (remove chip callback) |
433
+ | `multiCount` | `number` (shows "+N others" text, non-tags mode) |
371
434
  | `isOpen` | `boolean` (controlled) |
372
435
  | `onOpenChange` | `(open: boolean) => void` |
373
436
  | `disabled` | `boolean` |
@@ -972,6 +1035,8 @@ import { faUsersSolid } from "@l3mpire/icons";
972
1035
  | Tag | x | x | | |
973
1036
  | Link | x | x | | |
974
1037
  | TextInput | x | x | | |
1038
+ | ChipInput | x | x | | |
1039
+ | NumberInput | x | x | | |
975
1040
  | Select | x | x | | |
976
1041
  | SearchBar | x | x | | |
977
1042
  | Avatar | x | x | x | x |
package/dist/index.d.mts CHANGED
@@ -243,6 +243,8 @@ interface SelectProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
243
243
  placeholder?: string;
244
244
  value?: string;
245
245
  multiCount?: number;
246
+ tags?: string[];
247
+ onTagRemove?: (tag: string) => void;
246
248
  icon?: IconDefinition;
247
249
  avatar?: React.ReactNode;
248
250
  flag?: React.ReactNode;
@@ -308,9 +310,44 @@ interface TextInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement
308
310
  }
309
311
  declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
310
312
 
313
+ declare const chipInputVariants: (props?: ({
314
+ size?: "sm" | "md" | null | undefined;
315
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
316
+ interface ChipInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange">, VariantProps<typeof chipInputVariants> {
317
+ values: string[];
318
+ onChange: (values: string[]) => void;
319
+ placeholder?: string;
320
+ label?: string;
321
+ labelType?: InputLabelProps["type"];
322
+ error?: boolean;
323
+ errorMessage?: string;
324
+ disabled?: boolean;
325
+ iconLeft?: IconDefinition;
326
+ /** Max number of chips (0 = unlimited) */
327
+ max?: number;
328
+ }
329
+ declare const ChipInput: React.ForwardRefExoticComponent<ChipInputProps & React.RefAttributes<HTMLDivElement>>;
330
+
331
+ declare const inputVariants: (props?: ({
332
+ size?: "sm" | "md" | null | undefined;
333
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
334
+ interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "onChange">, VariantProps<typeof inputVariants> {
335
+ value?: number;
336
+ defaultValue?: number;
337
+ onChange?: (value: number) => void;
338
+ min?: number;
339
+ max?: number;
340
+ step?: number;
341
+ label?: string;
342
+ labelType?: InputLabelProps["type"];
343
+ error?: boolean;
344
+ errorMessage?: string;
345
+ }
346
+ declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<HTMLInputElement>>;
347
+
311
348
  declare const typographyVariants: (props?: ({
312
349
  variant?: "xs" | "sm" | "md" | "lg" | "h2" | "h3" | "h1" | null | undefined;
313
- weight?: "bold" | "regular" | "medium" | null | undefined;
350
+ weight?: "bold" | "medium" | "regular" | null | undefined;
314
351
  } & class_variance_authority_types.ClassProp) | undefined) => string;
315
352
  interface TypographyProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof typographyVariants> {
316
353
  as?: React.ElementType;
@@ -581,4 +618,4 @@ interface SidePanelContentProps extends React.ComponentPropsWithoutRef<typeof Di
581
618
  }
582
619
  declare const SidePanelContent: React.ForwardRefExoticComponent<SidePanelContentProps & React.RefAttributes<HTMLDivElement>>;
583
620
 
584
- export { Avatar, AvatarCell, type AvatarCellProps, type AvatarProps, Badge, type BadgeProps, BrowserTab, BrowserTabItem, type BrowserTabItemProps, type BrowserTabProps, Button, ButtonCell, type ButtonCellProps, type ButtonProps, Checkbox, type CheckboxProps, DataTable, DataTablePagination, type DataTablePaginationProps, type DataTableProps, DateCell, type DateCellProps, Dialog, type DialogProps, DropdownMenu, DropdownMenuClear, type DropdownMenuClearProps, DropdownMenuContent, DropdownMenuHeading, type DropdownMenuHeadingProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuList, type DropdownMenuListProps, type DropdownMenuProps, DropdownMenuRadixItem, type DropdownMenuRadixItemProps, DropdownMenuRoot, DropdownMenuTrigger, EditableCell, type EditableCellProps, EmailCell, type EmailCellProps, EmptyState, type EmptyStateProps, type FilterOperator, InfoMessage, type InfoMessageProps, InputLabel, type InputLabelProps, Link, LinkCell, type LinkCellProps, type LinkProps, Modal, ModalBody, ModalClose, ModalContent, type ModalContentProps, ModalDescription, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalOverlay, ModalTitle, ModalTrigger, NumberCell, type NumberCellProps, type Product, ProductLogo, type ProductLogoProps, RowActions, type RowActionsProps, SearchBar, type SearchBarProps, Select, type SelectProps, SidePanel, SidePanelClose, SidePanelContent, type SidePanelContentProps, SidePanelTrigger, Sidebar, SidebarFooter, type SidebarFooterProps, SidebarHeader, SidebarHeadingItem, type SidebarHeadingItemProps, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatusCell, type StatusCellProps, Switch, type SwitchProps, TabContent, type TabContentProps, TabList, type TabListProps, TabTrigger, type TabTriggerProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, type TabsProps, Tag, type TagProps, TextArea, type TextAreaProps, TextCell, type TextCellProps, TextInput, type TextInputProps, Toast, type ToastProps, ToastProvider, ToastViewport, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, Typography, type TypographyProps, UserMenu, UserMenuInfoRow, type UserMenuInfoRowProps, type UserMenuProps, UserMenuSection, type UserMenuSectionProps, avatarVariants, badgeVariants, buttonVariants, cn, emptyStateVariants, infoMessageVariants, linkVariants, modalVariants, productLogoVariants, searchBarVariants, selectVariants, sidebarItemVariants, tagVariants, textInputVariants, toastVariants, tooltipContentVariants, typographyVariants, useSidebarContext };
621
+ export { Avatar, AvatarCell, type AvatarCellProps, type AvatarProps, Badge, type BadgeProps, BrowserTab, BrowserTabItem, type BrowserTabItemProps, type BrowserTabProps, Button, ButtonCell, type ButtonCellProps, type ButtonProps, Checkbox, type CheckboxProps, ChipInput, type ChipInputProps, DataTable, DataTablePagination, type DataTablePaginationProps, type DataTableProps, DateCell, type DateCellProps, Dialog, type DialogProps, DropdownMenu, DropdownMenuClear, type DropdownMenuClearProps, DropdownMenuContent, DropdownMenuHeading, type DropdownMenuHeadingProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuList, type DropdownMenuListProps, type DropdownMenuProps, DropdownMenuRadixItem, type DropdownMenuRadixItemProps, DropdownMenuRoot, DropdownMenuTrigger, EditableCell, type EditableCellProps, EmailCell, type EmailCellProps, EmptyState, type EmptyStateProps, type FilterOperator, InfoMessage, type InfoMessageProps, InputLabel, type InputLabelProps, Link, LinkCell, type LinkCellProps, type LinkProps, Modal, ModalBody, ModalClose, ModalContent, type ModalContentProps, ModalDescription, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalOverlay, ModalTitle, ModalTrigger, NumberCell, type NumberCellProps, NumberInput, type NumberInputProps, type Product, ProductLogo, type ProductLogoProps, RowActions, type RowActionsProps, SearchBar, type SearchBarProps, Select, type SelectProps, SidePanel, SidePanelClose, SidePanelContent, type SidePanelContentProps, SidePanelTrigger, Sidebar, SidebarFooter, type SidebarFooterProps, SidebarHeader, SidebarHeadingItem, type SidebarHeadingItemProps, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatusCell, type StatusCellProps, Switch, type SwitchProps, TabContent, type TabContentProps, TabList, type TabListProps, TabTrigger, type TabTriggerProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, type TabsProps, Tag, type TagProps, TextArea, type TextAreaProps, TextCell, type TextCellProps, TextInput, type TextInputProps, Toast, type ToastProps, ToastProvider, ToastViewport, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, Typography, type TypographyProps, UserMenu, UserMenuInfoRow, type UserMenuInfoRowProps, type UserMenuProps, UserMenuSection, type UserMenuSectionProps, avatarVariants, badgeVariants, buttonVariants, chipInputVariants, cn, emptyStateVariants, infoMessageVariants, linkVariants, modalVariants, productLogoVariants, searchBarVariants, selectVariants, sidebarItemVariants, tagVariants, textInputVariants, toastVariants, tooltipContentVariants, typographyVariants, useSidebarContext };
package/dist/index.d.ts CHANGED
@@ -243,6 +243,8 @@ interface SelectProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
243
243
  placeholder?: string;
244
244
  value?: string;
245
245
  multiCount?: number;
246
+ tags?: string[];
247
+ onTagRemove?: (tag: string) => void;
246
248
  icon?: IconDefinition;
247
249
  avatar?: React.ReactNode;
248
250
  flag?: React.ReactNode;
@@ -308,9 +310,44 @@ interface TextInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement
308
310
  }
309
311
  declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
310
312
 
313
+ declare const chipInputVariants: (props?: ({
314
+ size?: "sm" | "md" | null | undefined;
315
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
316
+ interface ChipInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange">, VariantProps<typeof chipInputVariants> {
317
+ values: string[];
318
+ onChange: (values: string[]) => void;
319
+ placeholder?: string;
320
+ label?: string;
321
+ labelType?: InputLabelProps["type"];
322
+ error?: boolean;
323
+ errorMessage?: string;
324
+ disabled?: boolean;
325
+ iconLeft?: IconDefinition;
326
+ /** Max number of chips (0 = unlimited) */
327
+ max?: number;
328
+ }
329
+ declare const ChipInput: React.ForwardRefExoticComponent<ChipInputProps & React.RefAttributes<HTMLDivElement>>;
330
+
331
+ declare const inputVariants: (props?: ({
332
+ size?: "sm" | "md" | null | undefined;
333
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
334
+ interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "onChange">, VariantProps<typeof inputVariants> {
335
+ value?: number;
336
+ defaultValue?: number;
337
+ onChange?: (value: number) => void;
338
+ min?: number;
339
+ max?: number;
340
+ step?: number;
341
+ label?: string;
342
+ labelType?: InputLabelProps["type"];
343
+ error?: boolean;
344
+ errorMessage?: string;
345
+ }
346
+ declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<HTMLInputElement>>;
347
+
311
348
  declare const typographyVariants: (props?: ({
312
349
  variant?: "xs" | "sm" | "md" | "lg" | "h2" | "h3" | "h1" | null | undefined;
313
- weight?: "bold" | "regular" | "medium" | null | undefined;
350
+ weight?: "bold" | "medium" | "regular" | null | undefined;
314
351
  } & class_variance_authority_types.ClassProp) | undefined) => string;
315
352
  interface TypographyProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof typographyVariants> {
316
353
  as?: React.ElementType;
@@ -581,4 +618,4 @@ interface SidePanelContentProps extends React.ComponentPropsWithoutRef<typeof Di
581
618
  }
582
619
  declare const SidePanelContent: React.ForwardRefExoticComponent<SidePanelContentProps & React.RefAttributes<HTMLDivElement>>;
583
620
 
584
- export { Avatar, AvatarCell, type AvatarCellProps, type AvatarProps, Badge, type BadgeProps, BrowserTab, BrowserTabItem, type BrowserTabItemProps, type BrowserTabProps, Button, ButtonCell, type ButtonCellProps, type ButtonProps, Checkbox, type CheckboxProps, DataTable, DataTablePagination, type DataTablePaginationProps, type DataTableProps, DateCell, type DateCellProps, Dialog, type DialogProps, DropdownMenu, DropdownMenuClear, type DropdownMenuClearProps, DropdownMenuContent, DropdownMenuHeading, type DropdownMenuHeadingProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuList, type DropdownMenuListProps, type DropdownMenuProps, DropdownMenuRadixItem, type DropdownMenuRadixItemProps, DropdownMenuRoot, DropdownMenuTrigger, EditableCell, type EditableCellProps, EmailCell, type EmailCellProps, EmptyState, type EmptyStateProps, type FilterOperator, InfoMessage, type InfoMessageProps, InputLabel, type InputLabelProps, Link, LinkCell, type LinkCellProps, type LinkProps, Modal, ModalBody, ModalClose, ModalContent, type ModalContentProps, ModalDescription, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalOverlay, ModalTitle, ModalTrigger, NumberCell, type NumberCellProps, type Product, ProductLogo, type ProductLogoProps, RowActions, type RowActionsProps, SearchBar, type SearchBarProps, Select, type SelectProps, SidePanel, SidePanelClose, SidePanelContent, type SidePanelContentProps, SidePanelTrigger, Sidebar, SidebarFooter, type SidebarFooterProps, SidebarHeader, SidebarHeadingItem, type SidebarHeadingItemProps, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatusCell, type StatusCellProps, Switch, type SwitchProps, TabContent, type TabContentProps, TabList, type TabListProps, TabTrigger, type TabTriggerProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, type TabsProps, Tag, type TagProps, TextArea, type TextAreaProps, TextCell, type TextCellProps, TextInput, type TextInputProps, Toast, type ToastProps, ToastProvider, ToastViewport, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, Typography, type TypographyProps, UserMenu, UserMenuInfoRow, type UserMenuInfoRowProps, type UserMenuProps, UserMenuSection, type UserMenuSectionProps, avatarVariants, badgeVariants, buttonVariants, cn, emptyStateVariants, infoMessageVariants, linkVariants, modalVariants, productLogoVariants, searchBarVariants, selectVariants, sidebarItemVariants, tagVariants, textInputVariants, toastVariants, tooltipContentVariants, typographyVariants, useSidebarContext };
621
+ export { Avatar, AvatarCell, type AvatarCellProps, type AvatarProps, Badge, type BadgeProps, BrowserTab, BrowserTabItem, type BrowserTabItemProps, type BrowserTabProps, Button, ButtonCell, type ButtonCellProps, type ButtonProps, Checkbox, type CheckboxProps, ChipInput, type ChipInputProps, DataTable, DataTablePagination, type DataTablePaginationProps, type DataTableProps, DateCell, type DateCellProps, Dialog, type DialogProps, DropdownMenu, DropdownMenuClear, type DropdownMenuClearProps, DropdownMenuContent, DropdownMenuHeading, type DropdownMenuHeadingProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuList, type DropdownMenuListProps, type DropdownMenuProps, DropdownMenuRadixItem, type DropdownMenuRadixItemProps, DropdownMenuRoot, DropdownMenuTrigger, EditableCell, type EditableCellProps, EmailCell, type EmailCellProps, EmptyState, type EmptyStateProps, type FilterOperator, InfoMessage, type InfoMessageProps, InputLabel, type InputLabelProps, Link, LinkCell, type LinkCellProps, type LinkProps, Modal, ModalBody, ModalClose, ModalContent, type ModalContentProps, ModalDescription, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalOverlay, ModalTitle, ModalTrigger, NumberCell, type NumberCellProps, NumberInput, type NumberInputProps, type Product, ProductLogo, type ProductLogoProps, RowActions, type RowActionsProps, SearchBar, type SearchBarProps, Select, type SelectProps, SidePanel, SidePanelClose, SidePanelContent, type SidePanelContentProps, SidePanelTrigger, Sidebar, SidebarFooter, type SidebarFooterProps, SidebarHeader, SidebarHeadingItem, type SidebarHeadingItemProps, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, StatusCell, type StatusCellProps, Switch, type SwitchProps, TabContent, type TabContentProps, TabList, type TabListProps, TabTrigger, type TabTriggerProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, type TabsProps, Tag, type TagProps, TextArea, type TextAreaProps, TextCell, type TextCellProps, TextInput, type TextInputProps, Toast, type ToastProps, ToastProvider, ToastViewport, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, Typography, type TypographyProps, UserMenu, UserMenuInfoRow, type UserMenuInfoRowProps, type UserMenuProps, UserMenuSection, type UserMenuSectionProps, avatarVariants, badgeVariants, buttonVariants, chipInputVariants, cn, emptyStateVariants, infoMessageVariants, linkVariants, modalVariants, productLogoVariants, searchBarVariants, selectVariants, sidebarItemVariants, tagVariants, textInputVariants, toastVariants, tooltipContentVariants, typographyVariants, useSidebarContext };