@empreint/ui 1.3.0 → 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.module.js +3 -2
- 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 +69 -26
- package/dist/index.js +33 -30
- 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';
|
|
@@ -99,11 +99,6 @@ export declare type CollapsibleTriggerProps = ComponentProps<"button"> & {
|
|
|
99
99
|
icon?: ElementType;
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
export declare type Column = {
|
|
103
|
-
name: string;
|
|
104
|
-
label: string;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
102
|
export declare const Container: ({ children, size, className, ...rest }: ContainerProps) => JSX.Element;
|
|
108
103
|
|
|
109
104
|
export declare type ContainerProps = ComponentProps<"div"> & {
|
|
@@ -168,6 +163,25 @@ export declare type DropzoneRemoveProps = HTMLAttributes<HTMLElement> & {
|
|
|
168
163
|
children: ReactElement;
|
|
169
164
|
};
|
|
170
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
|
+
|
|
171
185
|
export declare const Flex: ({ children, direction, justify, align, wrap, gap, inline, className, ...rest }: FlexProps) => JSX.Element;
|
|
172
186
|
|
|
173
187
|
export declare type FlexProps = ComponentProps<"div"> & {
|
|
@@ -248,10 +262,6 @@ export declare type ModalTriggerProps = HTMLAttributes<HTMLElement> & {
|
|
|
248
262
|
children: ReactElement;
|
|
249
263
|
};
|
|
250
264
|
|
|
251
|
-
export declare type ObjectLiteral<T = Primitive> = {
|
|
252
|
-
[field: string]: T;
|
|
253
|
-
};
|
|
254
|
-
|
|
255
265
|
declare type Option_2 = {
|
|
256
266
|
label: ReactNode;
|
|
257
267
|
value: string;
|
|
@@ -303,8 +313,6 @@ export declare type PopoverTriggerProps = HTMLAttributes<HTMLElement> & {
|
|
|
303
313
|
children: ReactElement;
|
|
304
314
|
};
|
|
305
315
|
|
|
306
|
-
export declare type Primitive = string | number | boolean | undefined | null;
|
|
307
|
-
|
|
308
316
|
export declare const RadioGroup: ({ children, onChange, defaultValue, orientation, className, ...rest }: RadioGroupProps) => JSX.Element;
|
|
309
317
|
|
|
310
318
|
export declare const RadioGroupItem: ({ children, value, className, ...rest }: RadioGroupItemProps) => JSX.Element;
|
|
@@ -390,30 +398,51 @@ export declare type SlotProps = HTMLAttributes<HTMLElement> & {
|
|
|
390
398
|
ref?: Ref<HTMLElement>;
|
|
391
399
|
};
|
|
392
400
|
|
|
401
|
+
export declare type SortDirection = "ascending" | "descending";
|
|
402
|
+
|
|
403
|
+
export declare type SortState<T> = {
|
|
404
|
+
key: keyof T;
|
|
405
|
+
direction: SortDirection;
|
|
406
|
+
};
|
|
407
|
+
|
|
393
408
|
export declare type Step = {
|
|
394
409
|
name: string;
|
|
395
410
|
title: string;
|
|
396
411
|
};
|
|
397
412
|
|
|
398
|
-
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;
|
|
416
|
+
|
|
417
|
+
export declare const TableCell: ({ className, ...rest }: ComponentProps<"td">) => JSX.Element;
|
|
418
|
+
|
|
419
|
+
export declare const TableFooter: ({ className, ...rest }: ComponentProps<"tfoot">) => JSX.Element;
|
|
399
420
|
|
|
400
|
-
export declare
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
renderRecordsCell?: (cell: Primitive, key: string) => ReactNode;
|
|
408
|
-
renderRecordsEmptyCell?: (key: string) => ReactNode;
|
|
409
|
-
renderNoRecords?: () => ReactNode;
|
|
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;
|
|
410
428
|
};
|
|
411
429
|
|
|
412
|
-
export declare
|
|
430
|
+
export declare type TableProps = ComponentProps<"table"> & {
|
|
431
|
+
layout?: "auto" | "fixed";
|
|
432
|
+
};
|
|
413
433
|
|
|
414
|
-
export declare const
|
|
434
|
+
export declare const TableRow: ({ className, separator, ...rest }: TableRowProps) => JSX.Element;
|
|
415
435
|
|
|
416
|
-
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
|
+
};
|
|
417
446
|
|
|
418
447
|
export declare const Tabs: ({ children, defaultValue, onChange, className, ...rest }: TabsProps) => JSX.Element;
|
|
419
448
|
|
|
@@ -476,6 +505,14 @@ export declare type useDisclosureOptions = {
|
|
|
476
505
|
closeOnOutsideClick?: boolean;
|
|
477
506
|
};
|
|
478
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
|
+
|
|
479
516
|
export declare const useMatchDevice: (UA: string) => Device;
|
|
480
517
|
|
|
481
518
|
export declare const useMatchResolution: (UA: string, breakpoints?: Breakpoints) => MatchResolution;
|
|
@@ -506,6 +543,12 @@ export declare type usePaginationProps = {
|
|
|
506
543
|
|
|
507
544
|
export declare const useScrollTo: (target: RefObject<HTMLElement | null>) => ScrollEvents;
|
|
508
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
|
+
|
|
509
552
|
export declare const useVisible: (target: RefObject<HTMLElement | null>) => boolean;
|
|
510
553
|
|
|
511
554
|
export declare const useWizard: ({ totalSteps, step }: useWizardOptions) => {
|
package/dist/index.js
CHANGED
|
@@ -9,33 +9,36 @@ import { Chip as u } from "./components/chip/chip.js";
|
|
|
9
9
|
import { useBreadcrumb as d } from "./hooks/use-breadcrumb/use-breadcrumb.js";
|
|
10
10
|
import { useOutsideAlerter as f } from "./hooks/use-outside-alerter/use-outside-alerter.js";
|
|
11
11
|
import { useDisclosure as p } from "./hooks/use-disclosure/use-disclosure.js";
|
|
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
|
-
import {
|
|
41
|
-
|
|
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 };
|