@empreint/ui 1.2.3 → 1.5.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/badge/badge.js +12 -0
- package/dist/components/badge/badge.module.js +4 -0
- package/dist/components/breadcrumb/breadcrumb.module.js +7 -6
- package/dist/components/button/button.module.js +3 -2
- package/dist/components/card/card.module.js +7 -6
- package/dist/components/checkbox/checkbox.module.js +6 -5
- package/dist/components/chip/chip.module.js +5 -4
- package/dist/components/collapsible/collapsible.module.js +8 -7
- package/dist/components/container/container.module.js +3 -2
- package/dist/components/dropdown-menu/dropdown-menu.module.js +6 -5
- package/dist/components/dropzone/dropzone.module.js +8 -7
- package/dist/components/filters/filters.js +29 -0
- package/dist/components/filters/filters.module.js +10 -0
- package/dist/components/flex/flex.module.js +3 -2
- package/dist/components/grid/grid.module.js +3 -2
- package/dist/components/input/input.module.js +7 -6
- package/dist/components/language-selector/language-selector.module.js +3 -2
- package/dist/components/list/list.module.js +5 -4
- package/dist/components/loader/loader.module.js +7 -6
- package/dist/components/modal/modal.module.js +9 -8
- package/dist/components/pagination/pagination.module.js +5 -4
- package/dist/components/popover/popover.module.js +6 -5
- package/dist/components/radio-group/radio-group.module.js +7 -6
- package/dist/components/select/select.module.js +9 -8
- package/dist/components/separator/separator.module.js +3 -2
- package/dist/components/sidebar/sidebar.module.js +8 -7
- package/dist/components/table/table.js +39 -38
- package/dist/components/table/table.module.js +10 -8
- package/dist/components/tabs/tabs.module.js +7 -6
- package/dist/components/text/text.module.js +3 -2
- package/dist/components/title/title.module.js +3 -2
- package/dist/components/wizard/wizard.module.js +8 -7
- package/dist/hooks/use-filters/use-filters.js +23 -0
- package/dist/hooks/use-sort/use-sort.js +25 -0
- package/dist/index.d.ts +77 -26
- package/dist/index.js +42 -38
- package/dist/styles.css +1 -1
- package/package.json +22 -21
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { ElementType } from 'react';
|
|
3
3
|
import { HTMLAttributes } from 'react';
|
|
4
|
-
import { JSX } from 'react
|
|
4
|
+
import { JSX } from 'react';
|
|
5
5
|
import { JSXElementConstructor } from 'react';
|
|
6
6
|
import { ReactElement } from 'react';
|
|
7
7
|
import { ReactNode } from 'react';
|
|
@@ -11,6 +11,14 @@ import { SVGAttributes } from 'react';
|
|
|
11
11
|
|
|
12
12
|
declare type AnyProps = Record<string, unknown>;
|
|
13
13
|
|
|
14
|
+
export declare const Badge: ({ children, variant, className, ...rest }: BadgeProps) => JSX.Element;
|
|
15
|
+
|
|
16
|
+
export declare type BadgeProps = ComponentProps<"span"> & {
|
|
17
|
+
variant?: BadgeVariant;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export declare type BadgeVariant = "solid" | "soft" | "outline";
|
|
21
|
+
|
|
14
22
|
export declare const Breadcrumb: ({ children, className, ...rest }: ComponentProps<"nav">) => JSX.Element;
|
|
15
23
|
|
|
16
24
|
export declare const BreadcrumbItem: ({ children, current, className, ...rest }: BreadcrumbItemProps) => JSX.Element;
|
|
@@ -91,11 +99,6 @@ export declare type CollapsibleTriggerProps = ComponentProps<"button"> & {
|
|
|
91
99
|
icon?: ElementType;
|
|
92
100
|
};
|
|
93
101
|
|
|
94
|
-
export declare type Column = {
|
|
95
|
-
name: string;
|
|
96
|
-
label: string;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
102
|
export declare const Container: ({ children, size, className, ...rest }: ContainerProps) => JSX.Element;
|
|
100
103
|
|
|
101
104
|
export declare type ContainerProps = ComponentProps<"div"> & {
|
|
@@ -160,6 +163,25 @@ export declare type DropzoneRemoveProps = HTMLAttributes<HTMLElement> & {
|
|
|
160
163
|
children: ReactElement;
|
|
161
164
|
};
|
|
162
165
|
|
|
166
|
+
export declare type Filter = {
|
|
167
|
+
id: string;
|
|
168
|
+
column: string;
|
|
169
|
+
operator: string;
|
|
170
|
+
value: string;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export declare const FilterAdd: ({ className, children, "aria-label": ariaLabel, ...rest }: ComponentProps<"button">) => JSX.Element;
|
|
174
|
+
|
|
175
|
+
export declare const FilterHeader: ({ className, ...rest }: ComponentProps<"div">) => JSX.Element;
|
|
176
|
+
|
|
177
|
+
export declare type FilterInput = Partial<Omit<Filter, "id">>;
|
|
178
|
+
|
|
179
|
+
export declare const FilterRemove: ({ className, children, "aria-label": ariaLabel, ...rest }: ComponentProps<"button">) => JSX.Element;
|
|
180
|
+
|
|
181
|
+
export declare const FilterRow: ({ className, ...rest }: ComponentProps<"fieldset">) => JSX.Element;
|
|
182
|
+
|
|
183
|
+
export declare const Filters: ({ className, ...rest }: ComponentProps<"div">) => JSX.Element;
|
|
184
|
+
|
|
163
185
|
export declare const Flex: ({ children, direction, justify, align, wrap, gap, inline, className, ...rest }: FlexProps) => JSX.Element;
|
|
164
186
|
|
|
165
187
|
export declare type FlexProps = ComponentProps<"div"> & {
|
|
@@ -240,10 +262,6 @@ export declare type ModalTriggerProps = HTMLAttributes<HTMLElement> & {
|
|
|
240
262
|
children: ReactElement;
|
|
241
263
|
};
|
|
242
264
|
|
|
243
|
-
export declare type ObjectLiteral<T = Primitive> = {
|
|
244
|
-
[field: string]: T;
|
|
245
|
-
};
|
|
246
|
-
|
|
247
265
|
declare type Option_2 = {
|
|
248
266
|
label: ReactNode;
|
|
249
267
|
value: string;
|
|
@@ -295,8 +313,6 @@ export declare type PopoverTriggerProps = HTMLAttributes<HTMLElement> & {
|
|
|
295
313
|
children: ReactElement;
|
|
296
314
|
};
|
|
297
315
|
|
|
298
|
-
export declare type Primitive = string | number | boolean | undefined | null;
|
|
299
|
-
|
|
300
316
|
export declare const RadioGroup: ({ children, onChange, defaultValue, orientation, className, ...rest }: RadioGroupProps) => JSX.Element;
|
|
301
317
|
|
|
302
318
|
export declare const RadioGroupItem: ({ children, value, className, ...rest }: RadioGroupItemProps) => JSX.Element;
|
|
@@ -382,30 +398,51 @@ export declare type SlotProps = HTMLAttributes<HTMLElement> & {
|
|
|
382
398
|
ref?: Ref<HTMLElement>;
|
|
383
399
|
};
|
|
384
400
|
|
|
401
|
+
export declare type SortDirection = "ascending" | "descending";
|
|
402
|
+
|
|
403
|
+
export declare type SortState<T> = {
|
|
404
|
+
key: keyof T;
|
|
405
|
+
direction: SortDirection;
|
|
406
|
+
};
|
|
407
|
+
|
|
385
408
|
export declare type Step = {
|
|
386
409
|
name: string;
|
|
387
410
|
title: string;
|
|
388
411
|
};
|
|
389
412
|
|
|
390
|
-
export declare const Table:
|
|
413
|
+
export declare const Table: ({ className, layout, ...rest }: TableProps) => JSX.Element;
|
|
414
|
+
|
|
415
|
+
export declare const TableBody: ({ className, ...rest }: ComponentProps<"tbody">) => JSX.Element;
|
|
391
416
|
|
|
392
|
-
export declare
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
417
|
+
export declare const TableCell: ({ className, ...rest }: ComponentProps<"td">) => JSX.Element;
|
|
418
|
+
|
|
419
|
+
export declare const TableFooter: ({ className, ...rest }: ComponentProps<"tfoot">) => JSX.Element;
|
|
420
|
+
|
|
421
|
+
export declare const TableHeader: ({ className, ...rest }: ComponentProps<"thead">) => JSX.Element;
|
|
422
|
+
|
|
423
|
+
export declare const TableHeaderCell: ({ className, scope, sort, ...rest }: TableHeaderCellProps) => JSX.Element;
|
|
424
|
+
|
|
425
|
+
export declare type TableHeaderCellProps = ComponentProps<"th"> & {
|
|
426
|
+
scope?: "col" | "row";
|
|
427
|
+
sort?: SortDirection;
|
|
402
428
|
};
|
|
403
429
|
|
|
404
|
-
export declare
|
|
430
|
+
export declare type TableProps = ComponentProps<"table"> & {
|
|
431
|
+
layout?: "auto" | "fixed";
|
|
432
|
+
};
|
|
405
433
|
|
|
406
|
-
export declare const
|
|
434
|
+
export declare const TableRow: ({ className, separator, ...rest }: TableRowProps) => JSX.Element;
|
|
407
435
|
|
|
408
|
-
export declare
|
|
436
|
+
export declare type TableRowProps = ComponentProps<"tr"> & {
|
|
437
|
+
separator?: boolean;
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
export declare const TableSortTrigger: ({ className, direction, icon: Icon, children, ...rest }: TableSortTriggerProps) => JSX.Element;
|
|
441
|
+
|
|
442
|
+
export declare type TableSortTriggerProps = ComponentProps<"button"> & {
|
|
443
|
+
direction?: SortDirection;
|
|
444
|
+
icon?: ElementType;
|
|
445
|
+
};
|
|
409
446
|
|
|
410
447
|
export declare const Tabs: ({ children, defaultValue, onChange, className, ...rest }: TabsProps) => JSX.Element;
|
|
411
448
|
|
|
@@ -468,6 +505,14 @@ export declare type useDisclosureOptions = {
|
|
|
468
505
|
closeOnOutsideClick?: boolean;
|
|
469
506
|
};
|
|
470
507
|
|
|
508
|
+
export declare const useFilters: (initial?: FilterInput[]) => {
|
|
509
|
+
filters: Filter[];
|
|
510
|
+
addFilter: (filter?: FilterInput) => void;
|
|
511
|
+
updateFilter: (id: string, patch: FilterInput) => void;
|
|
512
|
+
removeFilter: (id: string) => void;
|
|
513
|
+
reset: () => void;
|
|
514
|
+
};
|
|
515
|
+
|
|
471
516
|
export declare const useMatchDevice: (UA: string) => Device;
|
|
472
517
|
|
|
473
518
|
export declare const useMatchResolution: (UA: string, breakpoints?: Breakpoints) => MatchResolution;
|
|
@@ -498,6 +543,12 @@ export declare type usePaginationProps = {
|
|
|
498
543
|
|
|
499
544
|
export declare const useScrollTo: (target: RefObject<HTMLElement | null>) => ScrollEvents;
|
|
500
545
|
|
|
546
|
+
export declare const useSort: <T>(initial?: SortState<T> | null) => {
|
|
547
|
+
sort: SortState<T> | null;
|
|
548
|
+
toggle: (key: keyof T) => void;
|
|
549
|
+
sortData: (data: T[]) => T[];
|
|
550
|
+
};
|
|
551
|
+
|
|
501
552
|
export declare const useVisible: (target: RefObject<HTMLElement | null>) => boolean;
|
|
502
553
|
|
|
503
554
|
export declare const useWizard: ({ totalSteps, step }: useWizardOptions) => {
|
package/dist/index.js
CHANGED
|
@@ -1,40 +1,44 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
/* empty css */
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
|
|
3
|
+
import { Badge as e } from "./components/badge/badge.js";
|
|
4
|
+
import { Breadcrumb as t, BreadcrumbItem as n, BreadcrumbSeparator as r } from "./components/breadcrumb/breadcrumb.js";
|
|
5
|
+
import { Button as i } from "./components/button/button.js";
|
|
6
|
+
import { Card as a, CardBody as o, CardFooter as s, CardHeader as c } from "./components/card/card.js";
|
|
7
|
+
import { Checkbox as l } from "./components/checkbox/checkbox.js";
|
|
8
|
+
import { Chip as u } from "./components/chip/chip.js";
|
|
9
|
+
import { useBreadcrumb as d } from "./hooks/use-breadcrumb/use-breadcrumb.js";
|
|
10
|
+
import { useOutsideAlerter as f } from "./hooks/use-outside-alerter/use-outside-alerter.js";
|
|
11
|
+
import { useDisclosure as p } from "./hooks/use-disclosure/use-disclosure.js";
|
|
12
|
+
import { useFilters as m } from "./hooks/use-filters/use-filters.js";
|
|
13
|
+
import { useMatchDevice as h } from "./hooks/use-match-device/use-match-device.js";
|
|
14
|
+
import { defaultBreakpoints as g, useMatchResolution as _ } from "./hooks/use-match-resolution/use-match-resolution.js";
|
|
15
|
+
import { usePagination as v } from "./hooks/use-pagination/use-pagination.js";
|
|
16
|
+
import { useScrollTo as y } from "./hooks/use-scroll-to/use-scroll-to.js";
|
|
17
|
+
import { useSort as b } from "./hooks/use-sort/use-sort.js";
|
|
18
|
+
import { useVisible as x } from "./hooks/use-visible/use-visible.js";
|
|
19
|
+
import { useWizard as S } from "./hooks/use-wizard/use-wizard.js";
|
|
20
|
+
import { Collapsible as C, CollapsibleContent as w, CollapsibleItem as T, CollapsibleTrigger as E } from "./components/collapsible/collapsible.js";
|
|
21
|
+
import { Container as D } from "./components/container/container.js";
|
|
22
|
+
import { Slot as O } from "./components/slot/slot.js";
|
|
23
|
+
import { DropdownMenu as k, DropdownMenuContent as A, DropdownMenuIcon as j, DropdownMenuItem as M, DropdownMenuTrigger as N } from "./components/dropdown-menu/dropdown-menu.js";
|
|
24
|
+
import { Dropzone as P, DropzoneArea as F, DropzoneEmpty as I, DropzoneLabel as L, DropzonePreview as R, DropzoneRemove as z } from "./components/dropzone/dropzone.js";
|
|
25
|
+
import { FilterAdd as B, FilterHeader as V, FilterRemove as H, FilterRow as U, Filters as W } from "./components/filters/filters.js";
|
|
26
|
+
import { Flex as G } from "./components/flex/flex.js";
|
|
27
|
+
import { Grid as K } from "./components/grid/grid.js";
|
|
28
|
+
import { Input as q, InputField as J, InputLabel as Y, InputMessage as X } from "./components/input/input.js";
|
|
29
|
+
import { LanguageSelector as Z } from "./components/language-selector/language-selector.js";
|
|
30
|
+
import { List as Q, ListItem as $ } from "./components/list/list.js";
|
|
31
|
+
import { Loader as ee, LoaderSpinner as te } from "./components/loader/loader.js";
|
|
32
|
+
import { Modal as ne, ModalBody as re, ModalClose as ie, ModalContent as ae, ModalFooter as oe, ModalHeader as se, ModalOverlay as ce, ModalTrigger as le } from "./components/modal/modal.js";
|
|
33
|
+
import { Pagination as ue, PaginationFirst as de, PaginationItems as fe, PaginationLast as pe, PaginationNext as me, PaginationPrevious as he } from "./components/pagination/pagination.js";
|
|
34
|
+
import { Popover as ge, PopoverContent as _e, PopoverTrigger as ve } from "./components/popover/popover.js";
|
|
35
|
+
import { RadioGroup as ye, RadioGroupItem as be } from "./components/radio-group/radio-group.js";
|
|
36
|
+
import { Select as xe, SelectContent as Se, SelectItem as Ce, SelectTrigger as we } from "./components/select/select.js";
|
|
37
|
+
import { Separator as Te } from "./components/separator/separator.js";
|
|
38
|
+
import { Sidebar as Ee, SidebarGroup as De, SidebarHeader as Oe, SidebarItem as ke, SidebarLink as Ae } from "./components/sidebar/sidebar.js";
|
|
39
|
+
import { Table as je, TableBody as Me, TableCell as Ne, TableFooter as Pe, TableHeader as Fe, TableHeaderCell as Ie, TableRow as Le, TableSortTrigger as Re } from "./components/table/table.js";
|
|
40
|
+
import { Tabs as ze, TabsContent as Be, TabsItem as Ve, TabsItems as He } from "./components/tabs/tabs.js";
|
|
41
|
+
import { Text as Ue } from "./components/text/text.js";
|
|
42
|
+
import { Title as We } from "./components/title/title.js";
|
|
43
|
+
import { Wizard as Ge, WizardFinalize as Ke, WizardFooter as qe, WizardHeader as Je, WizardIndicator as Ye, WizardNext as Xe, WizardPrevious as Ze, WizardStep as Qe, WizardTitle as $e } from "./components/wizard/wizard.js";
|
|
44
|
+
export { e as Badge, t as Breadcrumb, n as BreadcrumbItem, r as BreadcrumbSeparator, i as Button, a as Card, o as CardBody, s as CardFooter, c as CardHeader, l as Checkbox, u as Chip, C as Collapsible, w as CollapsibleContent, T as CollapsibleItem, E as CollapsibleTrigger, D as Container, k as DropdownMenu, A as DropdownMenuContent, j as DropdownMenuIcon, M as DropdownMenuItem, N as DropdownMenuTrigger, P as Dropzone, F as DropzoneArea, I as DropzoneEmpty, L as DropzoneLabel, R as DropzonePreview, z as DropzoneRemove, B as FilterAdd, V as FilterHeader, H as FilterRemove, U as FilterRow, W as Filters, G as Flex, K as Grid, q as Input, J as InputField, Y as InputLabel, X as InputMessage, Z as LanguageSelector, Q as List, $ as ListItem, ee as Loader, te as LoaderSpinner, ne as Modal, re as ModalBody, ie as ModalClose, ae as ModalContent, oe as ModalFooter, se as ModalHeader, ce as ModalOverlay, le as ModalTrigger, ue as Pagination, de as PaginationFirst, fe as PaginationItems, pe as PaginationLast, me as PaginationNext, he as PaginationPrevious, ge as Popover, _e as PopoverContent, ve as PopoverTrigger, ye as RadioGroup, be as RadioGroupItem, xe as Select, Se as SelectContent, Ce as SelectItem, we as SelectTrigger, Te as Separator, Ee as Sidebar, De as SidebarGroup, Oe as SidebarHeader, ke as SidebarItem, Ae as SidebarLink, O as Slot, je as Table, Me as TableBody, Ne as TableCell, Pe as TableFooter, Fe as TableHeader, Ie as TableHeaderCell, Le as TableRow, Re as TableSortTrigger, ze as Tabs, Be as TabsContent, Ve as TabsItem, He as TabsItems, Ue as Text, We as Title, Ge as Wizard, Ke as WizardFinalize, qe as WizardFooter, Je as WizardHeader, Ye as WizardIndicator, Xe as WizardNext, Ze as WizardPrevious, Qe as WizardStep, $e as WizardTitle, g as defaultBreakpoints, d as useBreadcrumb, p as useDisclosure, m as useFilters, h as useMatchDevice, _ as useMatchResolution, f as useOutsideAlerter, v as usePagination, y as useScrollTo, b as useSort, x as useVisible, S as useWizard };
|