@cystackapp/ui 1.5.0 → 2.0.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/LICENSE +21 -0
- package/README.md +77 -47
- package/dist/assets/background-pattern-grid.svg.js +7 -0
- package/dist/assets/empty-cloud.svg.js +5 -0
- package/dist/components/accordion/Accordion.d.ts +20 -0
- package/dist/components/accordion/Accordion.js +36 -0
- package/dist/components/accordion/AccordionTestStory.d.ts +3 -0
- package/dist/components/alert/Alert.d.ts +15 -0
- package/dist/components/alert/Alert.js +54 -0
- package/dist/components/avatar/Avatar.d.ts +13 -0
- package/dist/components/avatar/Avatar.js +64 -0
- package/dist/components/background-pattern/BackgroundPatternGrid.d.ts +1 -0
- package/dist/components/background-pattern/BackgroundPatternGrid.js +6 -0
- package/dist/components/badge/Badge.d.ts +1 -1
- package/dist/components/badge/BadgeTestStory.d.ts +1 -1
- package/dist/components/badge/variants/BadgeMore.d.ts +1 -1
- package/dist/components/badge/variants/BadgeMoreTestStory.d.ts +1 -1
- package/dist/components/badge/variants/BadgeTag.d.ts +1 -1
- package/dist/components/banner/Banner.d.ts +9 -0
- package/dist/components/banner/Banner.js +21 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +13 -0
- package/dist/components/breadcrumb/Breadcrumb.js +36 -0
- package/dist/components/button/ButtonLoader.d.ts +1 -1
- package/dist/components/button/ButtonTestStory.d.ts +5 -5
- package/dist/components/card/Card.d.ts +1 -1
- package/dist/components/card/Card.stories-ct.d.ts +1 -1
- package/dist/components/card/CardBody.d.ts +1 -1
- package/dist/components/card/CardHeader.d.ts +1 -1
- package/dist/components/chart/chart-legend/ChartLegend.d.ts +38 -0
- package/dist/components/chart/chart-legend/ChartLegend.js +57 -0
- package/dist/components/chart/chart-legend/ChartLegendItem.d.ts +19 -0
- package/dist/components/chart/chart-legend/ChartLegendItem.js +30 -0
- package/dist/components/chart/chart-legend/types.d.ts +49 -0
- package/dist/components/chart/donut-chart/DonutChart.d.ts +55 -0
- package/dist/components/chart/donut-chart/DonutChart.js +110 -0
- package/dist/components/chart/donut-chart/DonutSegments.d.ts +25 -0
- package/dist/components/chart/donut-chart/DonutSegments.js +51 -0
- package/dist/components/chart/donut-chart/donut-tooltip.d.ts +20 -0
- package/dist/components/chart/donut-chart/donut-tooltip.js +37 -0
- package/dist/components/chart/types.d.ts +8 -0
- package/dist/components/checkbox/CheckboxTestStory.d.ts +7 -7
- package/dist/components/collapsible/Collapsible.d.ts +1 -1
- package/dist/components/combobox/Combobox.d.ts +1 -1
- package/dist/components/divider/Divider.d.ts +9 -0
- package/dist/components/divider/Divider.js +28 -0
- package/dist/components/drawer/Drawer.d.ts +8 -0
- package/dist/components/drawer/Drawer.js +68 -0
- package/dist/components/dropdown/Dropdown.d.ts +45 -0
- package/dist/components/dropdown/Dropdown.js +133 -0
- package/dist/components/dropdown/DropdownMenu.d.ts +20 -0
- package/dist/components/dropdown/DropdownMenu.js +78 -0
- package/dist/components/dropdown/DropdownMenuItem.d.ts +13 -0
- package/dist/components/dropdown/DropdownMenuItem.js +49 -0
- package/dist/components/dropdown/DropdownTestStory.d.ts +5 -0
- package/dist/components/dropdown/dropdown-utils.d.ts +4 -0
- package/dist/components/dropdown/dropdown-utils.js +14 -0
- package/dist/components/dropdown/types.d.ts +48 -0
- package/dist/components/dropdown/use-dropdown-keyboard.d.ts +12 -0
- package/dist/components/dropdown/use-dropdown-keyboard.js +49 -0
- package/dist/components/empty-state/EmptyState.d.ts +26 -0
- package/dist/components/empty-state/EmptyState.js +36 -0
- package/dist/components/error-state/ErrorState.d.ts +1 -1
- package/dist/components/featured-icon/FeaturedIcon.d.ts +12 -0
- package/dist/components/featured-icon/FeaturedIcon.js +44 -0
- package/dist/components/form-field/FormField.d.ts +13 -0
- package/dist/components/form-field/FormField.js +21 -0
- package/dist/components/keyboard-shortcut-label/KeyboardShortcutLabel.d.ts +8 -0
- package/dist/components/keyboard-shortcut-label/KeyboardShortcutLabel.js +18 -0
- package/dist/components/loading-state/Loader.d.ts +20 -0
- package/dist/components/loading-state/Loader.js +38 -0
- package/dist/components/loading-state/LoadingState.d.ts +15 -0
- package/dist/components/loading-state/LoadingState.js +47 -0
- package/dist/components/loading-state/locale/en.json.d.ts +6 -0
- package/dist/components/loading-state/locale/en.json.js +7 -0
- package/dist/components/loading-state/locale/vi.json.d.ts +6 -0
- package/dist/components/loading-state/locale/vi.json.js +7 -0
- package/dist/components/media/Media.d.ts +7 -0
- package/dist/components/media/Media.js +25 -0
- package/dist/components/modal/helpers/HeaderIcon.d.ts +1 -1
- package/dist/components/modal/helpers/Title.d.ts +1 -1
- package/dist/components/notification/NotificationBanner.d.ts +9 -0
- package/dist/components/notification/NotificationBanner.js +97 -0
- package/dist/components/notification/icons.d.ts +5 -0
- package/dist/components/notification/icons.js +29 -0
- package/dist/components/notification/index.d.ts +4 -0
- package/dist/components/notification/index.js +26 -0
- package/dist/components/notification/locale/en.json.d.ts +8 -0
- package/dist/components/notification/locale/en.json.js +7 -0
- package/dist/components/notification/locale/vi.json.d.ts +8 -0
- package/dist/components/notification/locale/vi.json.js +7 -0
- package/dist/components/operating-system-icon/OperatingSystemIcon.d.ts +6 -0
- package/dist/components/operating-system-icon/OperatingSystemIcon.js +19 -0
- package/dist/components/operating-system-icon/assets/logo-android.svg.js +5 -0
- package/dist/components/operating-system-icon/assets/logo-apple.svg.js +5 -0
- package/dist/components/operating-system-icon/assets/logo-ubuntu.svg.js +5 -0
- package/dist/components/operating-system-icon/assets/logo-windows-10.svg.js +5 -0
- package/dist/components/page-title/PageTitle.d.ts +1 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/progress-bar/ProgressBar.d.ts +9 -0
- package/dist/components/progress-bar/ProgressBar.js +31 -0
- package/dist/components/radio/Radio.d.ts +4 -0
- package/dist/components/radio/Radio.js +55 -0
- package/dist/components/searchbox/Searchbox.d.ts +7 -0
- package/dist/components/searchbox/Searchbox.js +15 -0
- package/dist/components/select/Select.d.ts +11 -0
- package/dist/components/select/Select.js +44 -0
- package/dist/components/skeleton/Skeleton.d.ts +14 -0
- package/dist/components/skeleton/Skeleton.js +12 -0
- package/dist/components/switch/Switch.d.ts +1 -1
- package/dist/components/table/Table.d.ts +32 -0
- package/dist/components/table/Table.js +128 -0
- package/dist/components/table/TableActionButton.d.ts +15 -0
- package/dist/components/table/TableActionButton.js +50 -0
- package/dist/components/table/TableCell.d.ts +8 -0
- package/dist/components/table/TableCell.js +26 -0
- package/dist/components/table/TableHeader.d.ts +15 -0
- package/dist/components/table/TableHeader.js +36 -0
- package/dist/components/table/TableHeaderCell.d.ts +10 -0
- package/dist/components/table/TableHeaderCell.js +35 -0
- package/dist/components/table/TablePagination.d.ts +6 -0
- package/dist/components/table/TablePagination.js +69 -0
- package/dist/components/table/TableRow.d.ts +12 -0
- package/dist/components/table/TableRow.js +9 -0
- package/dist/components/table/expandable/ExpandableTable.d.ts +30 -0
- package/dist/components/table/expandable/ExpandableTable.js +156 -0
- package/dist/components/table/hooks/use-fit-page-height.d.ts +14 -0
- package/dist/components/table/hooks/use-fit-page-height.js +21 -0
- package/dist/components/table/hooks/use-row-selection.d.ts +27 -0
- package/dist/components/table/hooks/use-row-selection.js +35 -0
- package/dist/components/table/locale/en.json.d.ts +13 -0
- package/dist/components/table/locale/en.json.js +21 -0
- package/dist/components/table/locale/vi.json.d.ts +13 -0
- package/dist/components/table/locale/vi.json.js +21 -0
- package/dist/components/table/table-utils.d.ts +10 -0
- package/dist/components/table/table-utils.js +10 -0
- package/dist/components/table/types.d.ts +84 -0
- package/dist/components/tabs/Tabs.d.ts +27 -0
- package/dist/components/tabs/Tabs.js +75 -0
- package/dist/components/tabs/TabsTestStory.d.ts +4 -0
- package/dist/components/tags-input/TagsInput.d.ts +18 -0
- package/dist/components/tags-input/TagsInput.js +78 -0
- package/dist/components/tags-input/TagsInputTestStory.d.ts +3 -0
- package/dist/components/textarea/Textarea.d.ts +7 -0
- package/dist/components/textarea/Textarea.js +36 -0
- package/dist/components/toast/ToastSlice.d.ts +1 -1
- package/dist/components/toast/index.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/filters/FilterDropdown.d.ts +9 -0
- package/dist/filters/FilterDropdown.js +57 -0
- package/dist/filters/types.d.ts +11 -0
- package/dist/filters/url-params.d.ts +5 -0
- package/dist/filters/url-params.js +20 -0
- package/dist/filters/use-filters.d.ts +13 -0
- package/dist/filters/use-filters.js +63 -0
- package/dist/hooks/use-countdown.d.ts +4 -0
- package/dist/hooks/use-countdown.js +18 -0
- package/dist/i18n/resources.js +23 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +122 -40
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +421 -350
- package/dist/utils/key-typeguard.d.ts +5 -0
- package/dist/utils/key-typeguard.js +6 -0
- package/dist/utils/use-debounce.d.ts +1 -0
- package/dist/utils/use-debounce.js +11 -0
- package/package.json +28 -6
- package/theme.css +4 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
3
|
+
import { cn as s } from "../../utils/cn.js";
|
|
4
|
+
const e = {
|
|
5
|
+
default: "border-gray-v2-300 focus-within:border-brand-v2 focus-within:outline-brand-v2",
|
|
6
|
+
invalid: "border-error-v2-300 focus-within:border-error-v2 focus-within:outline-error-v2",
|
|
7
|
+
disabled: "bg-gray-v2-50 border-gray-v2-300 cursor-not-allowed"
|
|
8
|
+
}, c = l(
|
|
9
|
+
({ invalid: a, className: i, disabled: r, rows: n = 4, ...o }, d) => /* @__PURE__ */ t(
|
|
10
|
+
"span",
|
|
11
|
+
{
|
|
12
|
+
className: s(
|
|
13
|
+
"bg-white rounded-lg border shadow-xs flex px-3 py-2.5 text-md transition-all outline outline-transparent",
|
|
14
|
+
a ? e.invalid : e.default,
|
|
15
|
+
{ [e.disabled]: r },
|
|
16
|
+
i
|
|
17
|
+
),
|
|
18
|
+
children: /* @__PURE__ */ t(
|
|
19
|
+
"textarea",
|
|
20
|
+
{
|
|
21
|
+
ref: d,
|
|
22
|
+
disabled: r,
|
|
23
|
+
"aria-invalid": a,
|
|
24
|
+
rows: n,
|
|
25
|
+
className: "flex-1 min-w-0 bg-transparent outline-none resize-y text-gray-v2-900 placeholder:text-gray-v2-500 disabled:text-gray-v2-400 disabled:cursor-not-allowed disabled:resize-none",
|
|
26
|
+
...o,
|
|
27
|
+
placeholder: r ? void 0 : o.placeholder
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
c.displayName = "Textarea";
|
|
34
|
+
export {
|
|
35
|
+
c as Textarea
|
|
36
|
+
};
|
|
@@ -7,5 +7,5 @@ interface Props {
|
|
|
7
7
|
/** A slice of toast. Freshly out of the toaster, crunchy on the outside, soft and tender on the inside.
|
|
8
8
|
* Or is it just notification's UI.
|
|
9
9
|
*/
|
|
10
|
-
export declare const ToastSlice: ({ toast, observable }: Props) => import("react
|
|
10
|
+
export declare const ToastSlice: ({ toast, observable }: Props) => import("react").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { WrittenOnTheToast } from './types';
|
|
2
2
|
/** Where we store the newly cooked toasts. When a toast is created, it will appear here. */
|
|
3
|
-
export declare const Toaster: () => import("react
|
|
3
|
+
export declare const Toaster: () => import("react").JSX.Element;
|
|
4
4
|
export declare const createToast: (newToast: WrittenOnTheToast) => void;
|
|
@@ -7,5 +7,5 @@ interface Props {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const Tooltip: ({ content, children, position, disabled, className, }: Props) => import("react
|
|
10
|
+
export declare const Tooltip: ({ content, children, position, disabled, className, }: Props) => import("react").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FilterOption } from './types';
|
|
2
|
+
export interface FilterDropdownProps {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string | undefined;
|
|
5
|
+
options: FilterOption[];
|
|
6
|
+
onChange: (value: string | undefined) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const FilterDropdown: ({ label, value, options, onChange, disabled, }: FilterDropdownProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { XClose as b, ChevronDown as v } from "@untitled-ui/icons-react";
|
|
3
|
+
import { cn as g } from "../utils/cn.js";
|
|
4
|
+
import { Dropdown as p } from "../components/dropdown/Dropdown.js";
|
|
5
|
+
const u = ({
|
|
6
|
+
label: n,
|
|
7
|
+
value: t,
|
|
8
|
+
options: i,
|
|
9
|
+
onChange: a,
|
|
10
|
+
disabled: o = !1
|
|
11
|
+
}) => {
|
|
12
|
+
var s;
|
|
13
|
+
const c = i.map((e) => ({
|
|
14
|
+
id: e.value,
|
|
15
|
+
label: e.label,
|
|
16
|
+
icon: e.icon
|
|
17
|
+
})), d = ((s = i.find((e) => e.value === t)) == null ? void 0 : s.label) ?? t, l = t !== void 0;
|
|
18
|
+
return /* @__PURE__ */ r(
|
|
19
|
+
p,
|
|
20
|
+
{
|
|
21
|
+
items: c,
|
|
22
|
+
selected: t,
|
|
23
|
+
onSelect: (e) => a(e.id),
|
|
24
|
+
disabled: o,
|
|
25
|
+
children: /* @__PURE__ */ m(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
type: "button",
|
|
29
|
+
disabled: o,
|
|
30
|
+
className: g(
|
|
31
|
+
"inline-flex items-center justify-between gap-2 min-h-10 rounded-lg border border-gray-v2-300 bg-white px-3 py-2 text-sm font-semibold text-gray-v2-700 shadow-xs transition-all outline-2 outline-transparent hover:bg-gray-v2-50 focus:outline-brand-v2-400",
|
|
32
|
+
o && "cursor-not-allowed bg-gray-v2-50 text-gray-v2-400 border-gray-v2-200"
|
|
33
|
+
),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ r("span", { children: l ? `${n}: ${d}` : n }),
|
|
36
|
+
l ? /* @__PURE__ */ r(
|
|
37
|
+
"span",
|
|
38
|
+
{
|
|
39
|
+
role: "button",
|
|
40
|
+
"aria-label": "Clear filter",
|
|
41
|
+
tabIndex: -1,
|
|
42
|
+
onClick: (e) => {
|
|
43
|
+
e.stopPropagation(), a(void 0);
|
|
44
|
+
},
|
|
45
|
+
className: "inline-flex shrink-0 items-center rounded text-gray-v2-500 hover:text-gray-v2-700",
|
|
46
|
+
children: /* @__PURE__ */ r(b, { className: "h-5 w-5" })
|
|
47
|
+
}
|
|
48
|
+
) : /* @__PURE__ */ r(v, { className: "h-5 w-5 shrink-0 text-gray-v2-500" })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
u as FilterDropdown
|
|
57
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface FilterOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface ParamCodec<T> {
|
|
8
|
+
serialize: (value: T) => string | null;
|
|
9
|
+
deserialize: (raw: string) => T;
|
|
10
|
+
debounceMs?: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ParamCodec } from './types';
|
|
2
|
+
export declare const stringCodec: ParamCodec<string | undefined>;
|
|
3
|
+
export declare const numberCodec: ParamCodec<number | undefined>;
|
|
4
|
+
export declare const csvCodec: ParamCodec<string[]>;
|
|
5
|
+
export declare const searchCodec: ParamCodec<string | undefined>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
serialize: (e) => e !== void 0 ? e : null,
|
|
3
|
+
deserialize: (e) => e
|
|
4
|
+
}, s = {
|
|
5
|
+
serialize: (e) => e !== void 0 ? String(e) : null,
|
|
6
|
+
deserialize: (e) => Number(e)
|
|
7
|
+
}, l = {
|
|
8
|
+
serialize: (e) => e.length > 0 ? e.join(",") : null,
|
|
9
|
+
deserialize: (e) => e.split(",")
|
|
10
|
+
}, n = {
|
|
11
|
+
serialize: (e) => e || null,
|
|
12
|
+
deserialize: (e) => e,
|
|
13
|
+
debounceMs: 300
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
l as csvCodec,
|
|
17
|
+
s as numberCodec,
|
|
18
|
+
n as searchCodec,
|
|
19
|
+
i as stringCodec
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ParamCodec } from './types';
|
|
2
|
+
interface UseFiltersOptions<T extends Record<string, unknown>> {
|
|
3
|
+
urlSync?: {
|
|
4
|
+
[K in keyof T]?: ParamCodec<T[K]>;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export declare function useFilters<T extends Record<string, unknown>>(defaults: T, options?: UseFiltersOptions<T>): {
|
|
8
|
+
params: T;
|
|
9
|
+
debouncedParams: T;
|
|
10
|
+
setParam: <K extends keyof T>(key: K, value: T[K]) => void;
|
|
11
|
+
reset: (keys?: Array<keyof T>) => void;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useState as f, useRef as y } from "react";
|
|
2
|
+
function d(r, e, i) {
|
|
3
|
+
return e ? Object.fromEntries(
|
|
4
|
+
Object.keys(r).map((n) => {
|
|
5
|
+
const S = e[n], m = i.get(n), w = S && m !== null ? S.deserialize(m) : r[n];
|
|
6
|
+
return [n, w];
|
|
7
|
+
})
|
|
8
|
+
) : r;
|
|
9
|
+
}
|
|
10
|
+
function h(r, e) {
|
|
11
|
+
const i = new URLSearchParams(window.location.search);
|
|
12
|
+
e !== null ? i.set(r, e) : i.delete(r);
|
|
13
|
+
const n = i.toString(), S = n ? `${window.location.pathname}?${n}` : window.location.pathname;
|
|
14
|
+
window.history.replaceState(null, "", S);
|
|
15
|
+
}
|
|
16
|
+
function R(r, e) {
|
|
17
|
+
const [i, n] = f(
|
|
18
|
+
() => d(
|
|
19
|
+
r,
|
|
20
|
+
e == null ? void 0 : e.urlSync,
|
|
21
|
+
new URLSearchParams(window.location.search)
|
|
22
|
+
)
|
|
23
|
+
), [S, m] = f(
|
|
24
|
+
() => d(
|
|
25
|
+
r,
|
|
26
|
+
e == null ? void 0 : e.urlSync,
|
|
27
|
+
new URLSearchParams(window.location.search)
|
|
28
|
+
)
|
|
29
|
+
), w = y({});
|
|
30
|
+
function b(l, s) {
|
|
31
|
+
var a;
|
|
32
|
+
n((o) => ({ ...o, [l]: s }));
|
|
33
|
+
const u = (a = e == null ? void 0 : e.urlSync) == null ? void 0 : a[l], c = u == null ? void 0 : u.debounceMs, t = String(l);
|
|
34
|
+
c !== void 0 ? (clearTimeout(w.current[t]), w.current[t] = setTimeout(() => {
|
|
35
|
+
m((o) => ({ ...o, [l]: s }));
|
|
36
|
+
}, c)) : m((o) => ({ ...o, [l]: s })), u && h(t, u.serialize(s));
|
|
37
|
+
}
|
|
38
|
+
function P(l) {
|
|
39
|
+
const s = l ?? Object.keys(r);
|
|
40
|
+
n((c) => {
|
|
41
|
+
const t = { ...c };
|
|
42
|
+
for (const a of s) t[a] = r[a];
|
|
43
|
+
return t;
|
|
44
|
+
}), m((c) => {
|
|
45
|
+
const t = { ...c };
|
|
46
|
+
for (const a of s) {
|
|
47
|
+
const o = String(a);
|
|
48
|
+
clearTimeout(w.current[o]), delete w.current[o], t[a] = r[a];
|
|
49
|
+
}
|
|
50
|
+
return t;
|
|
51
|
+
});
|
|
52
|
+
const u = e == null ? void 0 : e.urlSync;
|
|
53
|
+
if (u)
|
|
54
|
+
for (const c of s) {
|
|
55
|
+
const t = u[c];
|
|
56
|
+
t && h(String(c), t.serialize(r[c]));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return { params: i, debouncedParams: S, setParam: b, reset: P };
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
R as useFilters
|
|
63
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useState as u, useEffect as c, useCallback as f } from "react";
|
|
2
|
+
function l(e) {
|
|
3
|
+
const [t, r] = u(e);
|
|
4
|
+
c(() => {
|
|
5
|
+
if (t === 0) return;
|
|
6
|
+
const n = setInterval(() => {
|
|
7
|
+
r((o) => o - 1);
|
|
8
|
+
}, 1e3);
|
|
9
|
+
return () => clearInterval(n);
|
|
10
|
+
}, [t]);
|
|
11
|
+
const s = f(() => {
|
|
12
|
+
r(e);
|
|
13
|
+
}, [e]);
|
|
14
|
+
return { secondsLeft: t, reset: s };
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
l as useCountdown
|
|
18
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import o from "../components/loading-state/locale/en.json.js";
|
|
2
|
+
import n from "../components/notification/locale/en.json.js";
|
|
3
|
+
import t from "../components/table/locale/en.json.js";
|
|
4
|
+
import e from "../components/loading-state/locale/vi.json.js";
|
|
5
|
+
import i from "../components/notification/locale/vi.json.js";
|
|
6
|
+
import m from "../components/table/locale/vi.json.js";
|
|
7
|
+
const l = {
|
|
8
|
+
en: {
|
|
9
|
+
// --- Flat namespace keys matching folder paths (for i18n-ally) ---
|
|
10
|
+
"components/loading-state": o,
|
|
11
|
+
"components/notification": n,
|
|
12
|
+
"components/table": t
|
|
13
|
+
},
|
|
14
|
+
vi: {
|
|
15
|
+
// --- Flat namespace keys matching folder paths (for i18n-ally) ---
|
|
16
|
+
"components/loading-state": e,
|
|
17
|
+
"components/notification": i,
|
|
18
|
+
"components/table": m
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
l as resources
|
|
23
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -34,4 +34,56 @@ export { Modal } from './components/modal/Modal';
|
|
|
34
34
|
export { ModalHeaderIcon } from './components/modal/helpers/HeaderIcon';
|
|
35
35
|
export { ModalTitle } from './components/modal/helpers/Title';
|
|
36
36
|
export { useClickOutsideModal } from './components/modal/use-click-outside-modal';
|
|
37
|
+
export { Accordion } from './components/accordion/Accordion';
|
|
38
|
+
export { BackgroundPatternGrid } from './components/background-pattern/BackgroundPatternGrid';
|
|
39
|
+
export { Breadcrumb } from './components/breadcrumb/Breadcrumb';
|
|
40
|
+
export { Dropdown } from './components/dropdown/Dropdown';
|
|
41
|
+
export type { DropdownItem, DropdownEntry } from './components/dropdown/types';
|
|
42
|
+
export { Select } from './components/select/Select';
|
|
43
|
+
export { FormField } from './components/form-field/FormField';
|
|
44
|
+
export { FilterDropdown } from './filters/FilterDropdown';
|
|
45
|
+
export type { FilterDropdownProps } from './filters/FilterDropdown';
|
|
46
|
+
export type { FilterOption } from './filters/types';
|
|
47
|
+
export { useFilters } from './filters/use-filters';
|
|
48
|
+
export { stringCodec, searchCodec, numberCodec, csvCodec, } from './filters/url-params';
|
|
49
|
+
export { Searchbox } from './components/searchbox/Searchbox';
|
|
50
|
+
export { OperatingSystemIcon } from './components/operating-system-icon/OperatingSystemIcon';
|
|
51
|
+
export { EmptyState } from './components/empty-state/EmptyState';
|
|
52
|
+
export { Loader } from './components/loading-state/Loader';
|
|
53
|
+
export { LoadingState } from './components/loading-state/LoadingState';
|
|
54
|
+
export { Table } from './components/table/Table';
|
|
55
|
+
export type { ColumnDef, PaginationState, SelectionState, SortState, } from './components/table/types';
|
|
56
|
+
export { TableActionButton } from './components/table/TableActionButton';
|
|
57
|
+
export type { TableActionItem } from './components/table/TableActionButton';
|
|
58
|
+
export { ExpandableTable } from './components/table/expandable/ExpandableTable';
|
|
59
|
+
export { Media } from './components/media/Media';
|
|
60
|
+
export { NotificationBox, createNotification, } from './components/notification/index';
|
|
61
|
+
export { DonutChart } from './components/chart/donut-chart/DonutChart';
|
|
62
|
+
export { ChartLegend } from './components/chart/chart-legend/ChartLegend';
|
|
63
|
+
export type { ChartDataItem } from './components/chart/types';
|
|
64
|
+
export type { DonutTooltipPayload } from './components/chart/donut-chart/donut-tooltip';
|
|
65
|
+
export { Drawer } from './components/drawer/Drawer';
|
|
66
|
+
export type { DrawerProps } from './components/drawer/Drawer';
|
|
67
|
+
export { Radio } from './components/radio/Radio';
|
|
68
|
+
export { Textarea } from './components/textarea/Textarea';
|
|
69
|
+
export { Tabs } from './components/tabs/Tabs';
|
|
70
|
+
export type { TabItem, TabsVariant } from './components/tabs/Tabs';
|
|
71
|
+
export { Avatar } from './components/avatar/Avatar';
|
|
72
|
+
export type { AvatarSize } from './components/avatar/Avatar';
|
|
73
|
+
export { Alert } from './components/alert/Alert';
|
|
74
|
+
export type { AlertType } from './components/alert/Alert';
|
|
75
|
+
export { Banner } from './components/banner/Banner';
|
|
76
|
+
export { FeaturedIcon } from './components/featured-icon/FeaturedIcon';
|
|
77
|
+
export { Skeleton } from './components/skeleton/Skeleton';
|
|
78
|
+
export { ProgressBar } from './components/progress-bar/ProgressBar';
|
|
79
|
+
export { Divider } from './components/divider/Divider';
|
|
80
|
+
export { TagsInput } from './components/tags-input/TagsInput';
|
|
81
|
+
export type { TagsInputProps } from './components/tags-input/TagsInput';
|
|
82
|
+
export { KeyboardShortcutLabel } from './components/keyboard-shortcut-label/KeyboardShortcutLabel';
|
|
83
|
+
export { useCountdown } from './hooks/use-countdown';
|
|
84
|
+
export { useDebounce } from './utils/use-debounce';
|
|
85
|
+
export { useToastList } from './components/toast/use-toast-list';
|
|
86
|
+
export type { InternalToastProps } from './components/toast/types';
|
|
87
|
+
export { resources } from './i18n/resources';
|
|
37
88
|
export { cn } from './utils/cn';
|
|
89
|
+
export { Observable } from './utils/observable';
|
package/dist/index.js
CHANGED
|
@@ -1,63 +1,145 @@
|
|
|
1
1
|
import { Button as e } from "./components/button/Button.js";
|
|
2
|
-
import { Badge as
|
|
2
|
+
import { Badge as p } from "./components/badge/Badge.js";
|
|
3
3
|
import { BadgeTag as x, TAG_ICON_COLOR_CLASSES as f, getBadgeAutoColor as a } from "./components/badge/variants/BadgeTag.js";
|
|
4
|
-
import { BadgeMore as
|
|
5
|
-
import { useResizeObserver as
|
|
6
|
-
import { useScrollListener as
|
|
4
|
+
import { BadgeMore as n } from "./components/badge/variants/BadgeMore.js";
|
|
5
|
+
import { useResizeObserver as d } from "./hooks/element-shift/use-resize-observer.js";
|
|
6
|
+
import { useScrollListener as c } from "./hooks/element-shift/use-scroll-listener.js";
|
|
7
7
|
import { useWindowResizeListener as b } from "./hooks/element-shift/use-window-resize-listener.js";
|
|
8
|
-
import { useMutationObserver as
|
|
8
|
+
import { useMutationObserver as T } from "./hooks/element-shift/use-mutation-observer.js";
|
|
9
9
|
import { useTransitionEndListener as S } from "./hooks/element-shift/use-transition-end-listener.js";
|
|
10
|
-
import { useAnimationFrame as
|
|
11
|
-
import { useElementShift as
|
|
12
|
-
import { Combobox as
|
|
13
|
-
import { useValidatedCombobox as
|
|
14
|
-
import { ErrorState as
|
|
15
|
-
import { PageTitle as
|
|
16
|
-
import { Popover as
|
|
17
|
-
import { usePopoverCoord as
|
|
18
|
-
import { Checkbox as
|
|
19
|
-
import { Switch as
|
|
20
|
-
import { Tooltip as
|
|
21
|
-
import { Collapsible as
|
|
22
|
-
import { Card as
|
|
10
|
+
import { useAnimationFrame as L } from "./hooks/element-shift/use-animation-frame.js";
|
|
11
|
+
import { useElementShift as v } from "./hooks/element-shift/use-element-shift.js";
|
|
12
|
+
import { Combobox as O } from "./components/combobox/Combobox.js";
|
|
13
|
+
import { useValidatedCombobox as w } from "./components/combobox/use-validated-combobox.js";
|
|
14
|
+
import { ErrorState as E } from "./components/error-state/ErrorState.js";
|
|
15
|
+
import { PageTitle as I } from "./components/page-title/PageTitle.js";
|
|
16
|
+
import { Popover as k } from "./components/popover/Popover.js";
|
|
17
|
+
import { usePopoverCoord as y } from "./components/popover/use-popover-coord.js";
|
|
18
|
+
import { Checkbox as _ } from "./components/checkbox/Checkbox.js";
|
|
19
|
+
import { Switch as G } from "./components/switch/Switch.js";
|
|
20
|
+
import { Tooltip as K } from "./components/tooltip/Tooltip.js";
|
|
21
|
+
import { Collapsible as W } from "./components/collapsible/Collapsible.js";
|
|
22
|
+
import { Card as q } from "./components/card/Card.js";
|
|
23
23
|
import { Input as Q } from "./components/input/Input.js";
|
|
24
24
|
import { Toaster as X, createToast as Y } from "./components/toast/index.js";
|
|
25
25
|
import { Modal as $ } from "./components/modal/Modal.js";
|
|
26
26
|
import { ModalHeaderIcon as ro } from "./components/modal/helpers/HeaderIcon.js";
|
|
27
27
|
import { ModalTitle as to } from "./components/modal/helpers/Title.js";
|
|
28
|
-
import { useClickOutsideModal as
|
|
29
|
-
import {
|
|
28
|
+
import { useClickOutsideModal as mo } from "./components/modal/use-click-outside-modal.js";
|
|
29
|
+
import { Accordion as fo } from "./components/accordion/Accordion.js";
|
|
30
|
+
import { BackgroundPatternGrid as io } from "./components/background-pattern/BackgroundPatternGrid.js";
|
|
31
|
+
import { Breadcrumb as so } from "./components/breadcrumb/Breadcrumb.js";
|
|
32
|
+
import { Dropdown as co } from "./components/dropdown/Dropdown.js";
|
|
33
|
+
import { Select as bo } from "./components/select/Select.js";
|
|
34
|
+
import { FormField as To } from "./components/form-field/FormField.js";
|
|
35
|
+
import { FilterDropdown as So } from "./filters/FilterDropdown.js";
|
|
36
|
+
import { useFilters as Lo } from "./filters/use-filters.js";
|
|
37
|
+
import { csvCodec as vo, numberCodec as Ao, searchCodec as Oo, stringCodec as Mo } from "./filters/url-params.js";
|
|
38
|
+
import { Searchbox as Do } from "./components/searchbox/Searchbox.js";
|
|
39
|
+
import { OperatingSystemIcon as Fo } from "./components/operating-system-icon/OperatingSystemIcon.js";
|
|
40
|
+
import { EmptyState as Po } from "./components/empty-state/EmptyState.js";
|
|
41
|
+
import { Loader as Ro } from "./components/loading-state/Loader.js";
|
|
42
|
+
import { LoadingState as No } from "./components/loading-state/LoadingState.js";
|
|
43
|
+
import { Table as zo } from "./components/table/Table.js";
|
|
44
|
+
import { TableActionButton as Ho } from "./components/table/TableActionButton.js";
|
|
45
|
+
import { ExpandableTable as Vo } from "./components/table/expandable/ExpandableTable.js";
|
|
46
|
+
import { Media as jo } from "./components/media/Media.js";
|
|
47
|
+
import { NotificationBox as Jo, createNotification as Qo } from "./components/notification/index.js";
|
|
48
|
+
import { DonutChart as Xo } from "./components/chart/donut-chart/DonutChart.js";
|
|
49
|
+
import { ChartLegend as Zo } from "./components/chart/chart-legend/ChartLegend.js";
|
|
50
|
+
import { Drawer as or } from "./components/drawer/Drawer.js";
|
|
51
|
+
import { Radio as er } from "./components/radio/Radio.js";
|
|
52
|
+
import { Textarea as pr } from "./components/textarea/Textarea.js";
|
|
53
|
+
import { Tabs as xr } from "./components/tabs/Tabs.js";
|
|
54
|
+
import { Avatar as ar } from "./components/avatar/Avatar.js";
|
|
55
|
+
import { Alert as nr } from "./components/alert/Alert.js";
|
|
56
|
+
import { Banner as dr } from "./components/banner/Banner.js";
|
|
57
|
+
import { FeaturedIcon as cr } from "./components/featured-icon/FeaturedIcon.js";
|
|
58
|
+
import { Skeleton as br } from "./components/skeleton/Skeleton.js";
|
|
59
|
+
import { ProgressBar as Tr } from "./components/progress-bar/ProgressBar.js";
|
|
60
|
+
import { Divider as Sr } from "./components/divider/Divider.js";
|
|
61
|
+
import { TagsInput as Lr } from "./components/tags-input/TagsInput.js";
|
|
62
|
+
import { KeyboardShortcutLabel as vr } from "./components/keyboard-shortcut-label/KeyboardShortcutLabel.js";
|
|
63
|
+
import { useCountdown as Or } from "./hooks/use-countdown.js";
|
|
64
|
+
import { useDebounce as wr } from "./utils/use-debounce.js";
|
|
65
|
+
import { useToastList as Er } from "./components/toast/use-toast-list.js";
|
|
66
|
+
import { resources as Ir } from "./i18n/resources.js";
|
|
67
|
+
import { cn as kr } from "./utils/cn.js";
|
|
68
|
+
import { Observable as yr } from "./utils/observable.js";
|
|
30
69
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
70
|
+
fo as Accordion,
|
|
71
|
+
nr as Alert,
|
|
72
|
+
ar as Avatar,
|
|
73
|
+
io as BackgroundPatternGrid,
|
|
74
|
+
p as Badge,
|
|
75
|
+
n as BadgeMore,
|
|
33
76
|
x as BadgeTag,
|
|
77
|
+
dr as Banner,
|
|
78
|
+
so as Breadcrumb,
|
|
34
79
|
e as Button,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
80
|
+
q as Card,
|
|
81
|
+
Zo as ChartLegend,
|
|
82
|
+
_ as Checkbox,
|
|
83
|
+
W as Collapsible,
|
|
84
|
+
O as Combobox,
|
|
85
|
+
Sr as Divider,
|
|
86
|
+
Xo as DonutChart,
|
|
87
|
+
or as Drawer,
|
|
88
|
+
co as Dropdown,
|
|
89
|
+
Po as EmptyState,
|
|
90
|
+
E as ErrorState,
|
|
91
|
+
Vo as ExpandableTable,
|
|
92
|
+
cr as FeaturedIcon,
|
|
93
|
+
So as FilterDropdown,
|
|
94
|
+
To as FormField,
|
|
40
95
|
Q as Input,
|
|
96
|
+
vr as KeyboardShortcutLabel,
|
|
97
|
+
Ro as Loader,
|
|
98
|
+
No as LoadingState,
|
|
99
|
+
jo as Media,
|
|
41
100
|
$ as Modal,
|
|
42
101
|
ro as ModalHeaderIcon,
|
|
43
102
|
to as ModalTitle,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
103
|
+
Jo as NotificationBox,
|
|
104
|
+
yr as Observable,
|
|
105
|
+
Fo as OperatingSystemIcon,
|
|
106
|
+
I as PageTitle,
|
|
107
|
+
k as Popover,
|
|
108
|
+
Tr as ProgressBar,
|
|
109
|
+
er as Radio,
|
|
110
|
+
Do as Searchbox,
|
|
111
|
+
bo as Select,
|
|
112
|
+
br as Skeleton,
|
|
113
|
+
G as Switch,
|
|
47
114
|
f as TAG_ICON_COLOR_CLASSES,
|
|
115
|
+
zo as Table,
|
|
116
|
+
Ho as TableActionButton,
|
|
117
|
+
xr as Tabs,
|
|
118
|
+
Lr as TagsInput,
|
|
119
|
+
pr as Textarea,
|
|
48
120
|
X as Toaster,
|
|
49
|
-
|
|
50
|
-
|
|
121
|
+
K as Tooltip,
|
|
122
|
+
kr as cn,
|
|
123
|
+
Qo as createNotification,
|
|
51
124
|
Y as createToast,
|
|
125
|
+
vo as csvCodec,
|
|
52
126
|
a as getBadgeAutoColor,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
127
|
+
Ao as numberCodec,
|
|
128
|
+
Ir as resources,
|
|
129
|
+
Oo as searchCodec,
|
|
130
|
+
Mo as stringCodec,
|
|
131
|
+
L as useAnimationFrame,
|
|
132
|
+
mo as useClickOutsideModal,
|
|
133
|
+
Or as useCountdown,
|
|
134
|
+
wr as useDebounce,
|
|
135
|
+
v as useElementShift,
|
|
136
|
+
Lo as useFilters,
|
|
137
|
+
T as useMutationObserver,
|
|
138
|
+
y as usePopoverCoord,
|
|
139
|
+
d as useResizeObserver,
|
|
140
|
+
c as useScrollListener,
|
|
141
|
+
Er as useToastList,
|
|
60
142
|
S as useTransitionEndListener,
|
|
61
|
-
|
|
143
|
+
w as useValidatedCombobox,
|
|
62
144
|
b as useWindowResizeListener
|
|
63
145
|
};
|