@cystackapp/ui 2.0.0 → 2.0.1
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/dropdown/DropdownMenu.js +1 -1
- package/dist/components/sidebar/SidebarSecondMenu.d.ts +38 -0
- package/dist/components/sidebar/SidebarSecondMenu.js +50 -0
- package/dist/components/stat-banner-card/StatBannerCard.d.ts +24 -0
- package/dist/components/stat-banner-card/StatBannerCard.js +49 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +51 -47
- package/package.json +6 -6
|
@@ -26,7 +26,7 @@ const z = ({
|
|
|
26
26
|
role: "menu",
|
|
27
27
|
"aria-activedescendant": e ?? void 0,
|
|
28
28
|
className: $(
|
|
29
|
-
"z-
|
|
29
|
+
"z-50 rounded-lg border border-gray-v2-200 bg-white p-1 shadow-lg transition-all",
|
|
30
30
|
"max-h-[40vh] overflow-auto",
|
|
31
31
|
!c && "invisible pointer-events-none scale-95 opacity-0",
|
|
32
32
|
b
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SidebarSecondMenuItem {
|
|
3
|
+
key: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
to: string;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface SidebarSecondMenuProps {
|
|
9
|
+
/** Where the back button navigates to (e.g. the product dashboard). */
|
|
10
|
+
backTo: string;
|
|
11
|
+
backLabel: ReactNode;
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
items: SidebarSecondMenuItem[];
|
|
14
|
+
/** Called on every link click — lets a mobile drawer close on navigation. */
|
|
15
|
+
onNavigate?: () => void;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Contextual second-level sidebar panel — the settings-style menu used by the
|
|
20
|
+
* CyStack platform when entering an area with its own sub-navigation (account
|
|
21
|
+
* settings, workspace settings…). Renders a back link, a panel title and a
|
|
22
|
+
* vertical list of sub-pages. Pair it with a collapsed icon rail on the left.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <SidebarSecondMenu
|
|
27
|
+
* backTo="/"
|
|
28
|
+
* backLabel="Dashboard"
|
|
29
|
+
* title="Account settings"
|
|
30
|
+
* items={[
|
|
31
|
+
* { key: "profile", label: "Personal details", to: "/settings/account", active: true },
|
|
32
|
+
* { key: "security", label: "Security", to: "/settings/security" },
|
|
33
|
+
* ]}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const SidebarSecondMenu: ({ backTo, backLabel, title, items, onNavigate, className, }: SidebarSecondMenuProps) => import("react").JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { FlipBackward as m } from "@untitled-ui/icons-react";
|
|
3
|
+
import { Link as r } from "react-router-dom";
|
|
4
|
+
import { cn as a } from "../../utils/cn.js";
|
|
5
|
+
const b = ({
|
|
6
|
+
backTo: n,
|
|
7
|
+
backLabel: d,
|
|
8
|
+
title: i,
|
|
9
|
+
items: s,
|
|
10
|
+
onNavigate: t,
|
|
11
|
+
className: c
|
|
12
|
+
}) => /* @__PURE__ */ l(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
className: a(
|
|
16
|
+
"px-4 py-6 flex flex-col gap-4 w-full overflow-y-auto overflow-x-hidden",
|
|
17
|
+
c
|
|
18
|
+
),
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ e(r, { to: n, onClick: t, className: "no-underline", children: /* @__PURE__ */ l(
|
|
21
|
+
"button",
|
|
22
|
+
{
|
|
23
|
+
type: "button",
|
|
24
|
+
className: "flex items-center gap-2 w-fit rounded-lg font-semibold text-md text-brand-v2-700 hover:text-brand-v2-800 whitespace-nowrap",
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ e(m, { className: "h-5 w-5 min-w-5" }),
|
|
27
|
+
d
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
) }),
|
|
31
|
+
/* @__PURE__ */ e("span", { className: "text-lg font-semibold text-gray-v2-900 whitespace-nowrap", children: i }),
|
|
32
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-0.5", children: s.map((o) => /* @__PURE__ */ e(
|
|
33
|
+
r,
|
|
34
|
+
{
|
|
35
|
+
to: o.to,
|
|
36
|
+
onClick: t,
|
|
37
|
+
className: a(
|
|
38
|
+
"py-2 pl-3 pr-3 my-0.5 no-underline text-md font-semibold rounded-md transition-all",
|
|
39
|
+
o.active ? "bg-brand-v2-50 text-brand-v2-700" : "hover:bg-gray-v2-50 text-gray-v2-700 hover:text-gray-v2-700"
|
|
40
|
+
),
|
|
41
|
+
children: o.label
|
|
42
|
+
},
|
|
43
|
+
o.key
|
|
44
|
+
)) })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
export {
|
|
49
|
+
b as SidebarSecondMenu
|
|
50
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type StatBannerColor = "blue" | "success" | "warning" | "error";
|
|
3
|
+
interface StatBannerCardProps {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** `null` renders as "--" (no data). */
|
|
6
|
+
value: number | null;
|
|
7
|
+
color: StatBannerColor;
|
|
8
|
+
isPercentage?: boolean;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Colored stat banner — the tinted hero card with a big number and a small
|
|
14
|
+
* accent marker on the right edge, used at the top of asset list pages on the
|
|
15
|
+
* CyStack platform (e.g. "Tổng số tên miền 1839").
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <StatBannerCard label="Total domains" value={1839} color="blue" />
|
|
20
|
+
* <StatBannerCard label="Vulnerable" value={0} color="success" isPercentage />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const StatBannerCard: ({ label, value, color, isPercentage, isLoading, className, }: StatBannerCardProps) => import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { cn as t } from "../../utils/cn.js";
|
|
3
|
+
import { Loader as m } from "../loading-state/Loader.js";
|
|
4
|
+
const d = {
|
|
5
|
+
blue: "bg-blue-v2-100",
|
|
6
|
+
success: "bg-success-v2-100",
|
|
7
|
+
warning: "bg-warning-v2-100",
|
|
8
|
+
error: "bg-error-v2-100"
|
|
9
|
+
}, g = {
|
|
10
|
+
blue: "bg-blue-v2",
|
|
11
|
+
success: "bg-success-v2",
|
|
12
|
+
warning: "bg-warning-v2",
|
|
13
|
+
error: "bg-error-v2"
|
|
14
|
+
}, x = ({
|
|
15
|
+
label: a,
|
|
16
|
+
value: s,
|
|
17
|
+
color: r,
|
|
18
|
+
isPercentage: l = !1,
|
|
19
|
+
isLoading: i = !1,
|
|
20
|
+
className: o
|
|
21
|
+
}) => /* @__PURE__ */ n(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: t(
|
|
25
|
+
"flex items-center justify-between rounded-xl text-gray-v2-900 transition-colors shadow-xs overflow-hidden relative",
|
|
26
|
+
d[r],
|
|
27
|
+
o
|
|
28
|
+
),
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ e("span", { className: "px-3 lg:px-6 text-lg font-medium", children: a }),
|
|
31
|
+
/* @__PURE__ */ e("span", { className: "px-3 lg:px-6 py-3 text-display-sm font-semibold", children: i ? /* @__PURE__ */ e("span", { className: "h-9.5 w-9.5 min-w-9.5 flex items-center justify-center", children: /* @__PURE__ */ e(m, { baseSize: 1.25, particleCount: 24 }) }) : s === null ? "--" : /* @__PURE__ */ n(c, { children: [
|
|
32
|
+
s.toFixed(),
|
|
33
|
+
l ? /* @__PURE__ */ e("span", { className: "text-display-xs", children: "%" }) : null
|
|
34
|
+
] }) }),
|
|
35
|
+
/* @__PURE__ */ e(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
className: t(
|
|
39
|
+
"absolute right-0 top-0 bottom-0 my-auto h-10 w-1.5 rounded-l-full",
|
|
40
|
+
g[r]
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
export {
|
|
48
|
+
x as StatBannerCard
|
|
49
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -70,6 +70,10 @@ export { Tabs } from './components/tabs/Tabs';
|
|
|
70
70
|
export type { TabItem, TabsVariant } from './components/tabs/Tabs';
|
|
71
71
|
export { Avatar } from './components/avatar/Avatar';
|
|
72
72
|
export type { AvatarSize } from './components/avatar/Avatar';
|
|
73
|
+
export { SidebarSecondMenu } from './components/sidebar/SidebarSecondMenu';
|
|
74
|
+
export type { SidebarSecondMenuItem } from './components/sidebar/SidebarSecondMenu';
|
|
75
|
+
export { StatBannerCard } from './components/stat-banner-card/StatBannerCard';
|
|
76
|
+
export type { StatBannerColor } from './components/stat-banner-card/StatBannerCard';
|
|
73
77
|
export { Alert } from './components/alert/Alert';
|
|
74
78
|
export type { AlertType } from './components/alert/Alert';
|
|
75
79
|
export { Banner } from './components/banner/Banner';
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Button as e } from "./components/button/Button.js";
|
|
2
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
|
|
4
|
+
import { BadgeMore as i } from "./components/badge/variants/BadgeMore.js";
|
|
5
|
+
import { useResizeObserver as s } from "./hooks/element-shift/use-resize-observer.js";
|
|
6
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
|
|
9
|
-
import { useTransitionEndListener as
|
|
8
|
+
import { useMutationObserver as S } from "./hooks/element-shift/use-mutation-observer.js";
|
|
9
|
+
import { useTransitionEndListener as g } from "./hooks/element-shift/use-transition-end-listener.js";
|
|
10
10
|
import { useAnimationFrame as L } from "./hooks/element-shift/use-animation-frame.js";
|
|
11
11
|
import { useElementShift as v } from "./hooks/element-shift/use-element-shift.js";
|
|
12
|
-
import { Combobox as
|
|
12
|
+
import { Combobox as M } from "./components/combobox/Combobox.js";
|
|
13
13
|
import { useValidatedCombobox as w } from "./components/combobox/use-validated-combobox.js";
|
|
14
14
|
import { ErrorState as E } from "./components/error-state/ErrorState.js";
|
|
15
15
|
import { PageTitle as I } from "./components/page-title/PageTitle.js";
|
|
@@ -27,14 +27,14 @@ import { ModalHeaderIcon as ro } from "./components/modal/helpers/HeaderIcon.js"
|
|
|
27
27
|
import { ModalTitle as to } from "./components/modal/helpers/Title.js";
|
|
28
28
|
import { useClickOutsideModal as mo } from "./components/modal/use-click-outside-modal.js";
|
|
29
29
|
import { Accordion as fo } from "./components/accordion/Accordion.js";
|
|
30
|
-
import { BackgroundPatternGrid as
|
|
30
|
+
import { BackgroundPatternGrid as no } from "./components/background-pattern/BackgroundPatternGrid.js";
|
|
31
31
|
import { Breadcrumb as so } from "./components/breadcrumb/Breadcrumb.js";
|
|
32
32
|
import { Dropdown as co } from "./components/dropdown/Dropdown.js";
|
|
33
33
|
import { Select as bo } from "./components/select/Select.js";
|
|
34
|
-
import { FormField as
|
|
35
|
-
import { FilterDropdown as
|
|
34
|
+
import { FormField as So } from "./components/form-field/FormField.js";
|
|
35
|
+
import { FilterDropdown as go } from "./filters/FilterDropdown.js";
|
|
36
36
|
import { useFilters as Lo } from "./filters/use-filters.js";
|
|
37
|
-
import { csvCodec as vo, numberCodec as Ao, searchCodec as
|
|
37
|
+
import { csvCodec as vo, numberCodec as Ao, searchCodec as Mo, stringCodec as Oo } from "./filters/url-params.js";
|
|
38
38
|
import { Searchbox as Do } from "./components/searchbox/Searchbox.js";
|
|
39
39
|
import { OperatingSystemIcon as Fo } from "./components/operating-system-icon/OperatingSystemIcon.js";
|
|
40
40
|
import { EmptyState as Po } from "./components/empty-state/EmptyState.js";
|
|
@@ -52,48 +52,50 @@ import { Radio as er } from "./components/radio/Radio.js";
|
|
|
52
52
|
import { Textarea as pr } from "./components/textarea/Textarea.js";
|
|
53
53
|
import { Tabs as xr } from "./components/tabs/Tabs.js";
|
|
54
54
|
import { Avatar as ar } from "./components/avatar/Avatar.js";
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
55
|
+
import { SidebarSecondMenu as ir } from "./components/sidebar/SidebarSecondMenu.js";
|
|
56
|
+
import { StatBannerCard as sr } from "./components/stat-banner-card/StatBannerCard.js";
|
|
57
|
+
import { Alert as cr } from "./components/alert/Alert.js";
|
|
58
|
+
import { Banner as br } from "./components/banner/Banner.js";
|
|
59
|
+
import { FeaturedIcon as Sr } from "./components/featured-icon/FeaturedIcon.js";
|
|
60
|
+
import { Skeleton as gr } from "./components/skeleton/Skeleton.js";
|
|
61
|
+
import { ProgressBar as Lr } from "./components/progress-bar/ProgressBar.js";
|
|
62
|
+
import { Divider as vr } from "./components/divider/Divider.js";
|
|
63
|
+
import { TagsInput as Mr } from "./components/tags-input/TagsInput.js";
|
|
64
|
+
import { KeyboardShortcutLabel as wr } from "./components/keyboard-shortcut-label/KeyboardShortcutLabel.js";
|
|
65
|
+
import { useCountdown as Er } from "./hooks/use-countdown.js";
|
|
66
|
+
import { useDebounce as Ir } from "./utils/use-debounce.js";
|
|
67
|
+
import { useToastList as kr } from "./components/toast/use-toast-list.js";
|
|
68
|
+
import { resources as yr } from "./i18n/resources.js";
|
|
69
|
+
import { cn as _r } from "./utils/cn.js";
|
|
70
|
+
import { Observable as Gr } from "./utils/observable.js";
|
|
69
71
|
export {
|
|
70
72
|
fo as Accordion,
|
|
71
|
-
|
|
73
|
+
cr as Alert,
|
|
72
74
|
ar as Avatar,
|
|
73
|
-
|
|
75
|
+
no as BackgroundPatternGrid,
|
|
74
76
|
p as Badge,
|
|
75
|
-
|
|
77
|
+
i as BadgeMore,
|
|
76
78
|
x as BadgeTag,
|
|
77
|
-
|
|
79
|
+
br as Banner,
|
|
78
80
|
so as Breadcrumb,
|
|
79
81
|
e as Button,
|
|
80
82
|
q as Card,
|
|
81
83
|
Zo as ChartLegend,
|
|
82
84
|
_ as Checkbox,
|
|
83
85
|
W as Collapsible,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
M as Combobox,
|
|
87
|
+
vr as Divider,
|
|
86
88
|
Xo as DonutChart,
|
|
87
89
|
or as Drawer,
|
|
88
90
|
co as Dropdown,
|
|
89
91
|
Po as EmptyState,
|
|
90
92
|
E as ErrorState,
|
|
91
93
|
Vo as ExpandableTable,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
Sr as FeaturedIcon,
|
|
95
|
+
go as FilterDropdown,
|
|
96
|
+
So as FormField,
|
|
95
97
|
Q as Input,
|
|
96
|
-
|
|
98
|
+
wr as KeyboardShortcutLabel,
|
|
97
99
|
Ro as Loader,
|
|
98
100
|
No as LoadingState,
|
|
99
101
|
jo as Media,
|
|
@@ -101,45 +103,47 @@ export {
|
|
|
101
103
|
ro as ModalHeaderIcon,
|
|
102
104
|
to as ModalTitle,
|
|
103
105
|
Jo as NotificationBox,
|
|
104
|
-
|
|
106
|
+
Gr as Observable,
|
|
105
107
|
Fo as OperatingSystemIcon,
|
|
106
108
|
I as PageTitle,
|
|
107
109
|
k as Popover,
|
|
108
|
-
|
|
110
|
+
Lr as ProgressBar,
|
|
109
111
|
er as Radio,
|
|
110
112
|
Do as Searchbox,
|
|
111
113
|
bo as Select,
|
|
112
|
-
|
|
114
|
+
ir as SidebarSecondMenu,
|
|
115
|
+
gr as Skeleton,
|
|
116
|
+
sr as StatBannerCard,
|
|
113
117
|
G as Switch,
|
|
114
118
|
f as TAG_ICON_COLOR_CLASSES,
|
|
115
119
|
zo as Table,
|
|
116
120
|
Ho as TableActionButton,
|
|
117
121
|
xr as Tabs,
|
|
118
|
-
|
|
122
|
+
Mr as TagsInput,
|
|
119
123
|
pr as Textarea,
|
|
120
124
|
X as Toaster,
|
|
121
125
|
K as Tooltip,
|
|
122
|
-
|
|
126
|
+
_r as cn,
|
|
123
127
|
Qo as createNotification,
|
|
124
128
|
Y as createToast,
|
|
125
129
|
vo as csvCodec,
|
|
126
130
|
a as getBadgeAutoColor,
|
|
127
131
|
Ao as numberCodec,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
yr as resources,
|
|
133
|
+
Mo as searchCodec,
|
|
134
|
+
Oo as stringCodec,
|
|
131
135
|
L as useAnimationFrame,
|
|
132
136
|
mo as useClickOutsideModal,
|
|
133
|
-
|
|
134
|
-
|
|
137
|
+
Er as useCountdown,
|
|
138
|
+
Ir as useDebounce,
|
|
135
139
|
v as useElementShift,
|
|
136
140
|
Lo as useFilters,
|
|
137
|
-
|
|
141
|
+
S as useMutationObserver,
|
|
138
142
|
y as usePopoverCoord,
|
|
139
|
-
|
|
143
|
+
s as useResizeObserver,
|
|
140
144
|
c as useScrollListener,
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
kr as useToastList,
|
|
146
|
+
g as useTransitionEndListener,
|
|
143
147
|
w as useValidatedCombobox,
|
|
144
148
|
b as useWindowResizeListener
|
|
145
149
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cystackapp/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "CyStack design system — reusable React UI components built with Tailwind CSS v4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://
|
|
8
|
+
"url": "https://github.com/cystack/ui.git"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"main": "./dist/index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@untitled-ui/icons-react": "^0.1.4",
|
|
42
42
|
"i18next": ">=23.0.0",
|
|
43
|
-
"react": "^18.0.0",
|
|
44
|
-
"react-dom": "^18.0.0",
|
|
45
|
-
"react-i18next": "^15.0.0",
|
|
46
|
-
"react-router-dom": "^6.0.0"
|
|
43
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
44
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
45
|
+
"react-i18next": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
46
|
+
"react-router-dom": "^6.0.0 || ^7.0.0"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"clsx": "^2.1.1",
|