@socprime/react-ui 0.0.5
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/CHANGELOG.md +56 -0
- package/LICENSE +21 -0
- package/README.md +537 -0
- package/attack-flow.d.ts +16 -0
- package/charts.d.ts +32 -0
- package/decorators/index.js +8 -0
- package/decorators/withRouter.js +10 -0
- package/decorators/withTheme.js +10 -0
- package/decorators.d.ts +10 -0
- package/domain.d.ts +23 -0
- package/editor.d.ts +25 -0
- package/index.d.ts +702 -0
- package/lib/cn.js +8 -0
- package/lib/theme.js +26 -0
- package/lib/useFullscreen.js +52 -0
- package/lib/useListenOnResizeDebounce.js +22 -0
- package/lib/useThemeColors.js +39 -0
- package/package.json +113 -0
- package/preset/createConfig.js +98 -0
- package/preset/createPreview.js +53 -0
- package/preset/index.js +6 -0
- package/preset/restoreNativeFocus.js +33 -0
- package/preset/types.js +0 -0
- package/preset.d.ts +27 -0
- package/theme-9m7j1UoI.d.ts +5 -0
- package/ui/Accordion/Accordion.js +82 -0
- package/ui/Accordion/AccordionSection.js +41 -0
- package/ui/Accordion/FolderTreeExpandTrigger.js +29 -0
- package/ui/Accordion/chevronVariants.js +31 -0
- package/ui/Accordion/index.js +16 -0
- package/ui/AnimatedDots/AnimatedDots.js +10 -0
- package/ui/AnimatedDots/index.js +4 -0
- package/ui/Aside/Aside.js +34 -0
- package/ui/Aside/index.js +4 -0
- package/ui/AttackFlow/AttackFlow.js +9 -0
- package/ui/AttackFlow/AttackFlowLayout.js +63 -0
- package/ui/AttackFlow/Controls.js +42 -0
- package/ui/AttackFlow/Node.js +47 -0
- package/ui/AttackFlow/OtherNode.js +44 -0
- package/ui/AttackFlow/index.js +4 -0
- package/ui/AttackFlow/prependData.js +153 -0
- package/ui/AttackFlow/types.js +0 -0
- package/ui/AttackFlow/useAttackFlow.js +193 -0
- package/ui/Badge/Badge.js +57 -0
- package/ui/Badge/index.js +5 -0
- package/ui/Button/Button.css +1 -0
- package/ui/Button/Button.js +109 -0
- package/ui/Button/index.js +5 -0
- package/ui/Charts/AreaChartWithGradient.js +79 -0
- package/ui/Charts/index.js +4 -0
- package/ui/Checkbox/Checkbox.js +31 -0
- package/ui/Checkbox/index.js +4 -0
- package/ui/ConditionalContent/ConditionalContent.js +10 -0
- package/ui/ConditionalContent/index.js +4 -0
- package/ui/CorrelationTimer/CorrelationTimer.js +62 -0
- package/ui/CorrelationTimer/index.js +4 -0
- package/ui/DeleteButtonConfirm/DeleteButtonConfirm.js +65 -0
- package/ui/DeleteButtonConfirm/index.js +4 -0
- package/ui/Dialog/ConfirmDialog.js +54 -0
- package/ui/Dialog/DefaultDialog.js +82 -0
- package/ui/Dialog/Dialog.js +120 -0
- package/ui/Dialog/index.js +32 -0
- package/ui/Dropdown/Dropdown.js +204 -0
- package/ui/Dropdown/DropdownsCheckbox.js +102 -0
- package/ui/Dropdown/DropdownsSelect.js +97 -0
- package/ui/Dropdown/index.js +38 -0
- package/ui/Editor/Editor.js +97 -0
- package/ui/Editor/index.js +4 -0
- package/ui/Editor/monacoSetup.js +38 -0
- package/ui/Editor/theme.js +50 -0
- package/ui/Editor/types.js +0 -0
- package/ui/EmptyState/EmptyState.js +26 -0
- package/ui/EmptyState/index.js +4 -0
- package/ui/Field/Field.js +204 -0
- package/ui/Field/index.js +24 -0
- package/ui/HelperText/HelperText.js +7 -0
- package/ui/HelperText/index.js +4 -0
- package/ui/Input/Input.js +40 -0
- package/ui/Input/index.js +4 -0
- package/ui/InputNumber/InputNumber.js +90 -0
- package/ui/InputNumber/index.js +4 -0
- package/ui/InputPassword/InputPassword.js +30 -0
- package/ui/InputPassword/index.js +4 -0
- package/ui/Label/Label.js +13 -0
- package/ui/Label/LabelInfo.js +14 -0
- package/ui/Label/index.js +6 -0
- package/ui/MultiSelect/MultiSelect.js +163 -0
- package/ui/MultiSelect/index.js +4 -0
- package/ui/PageHeader/PageHeader.js +51 -0
- package/ui/PageHeader/index.js +4 -0
- package/ui/Pagination/Pagination.js +97 -0
- package/ui/Pagination/PaginationWrap.js +149 -0
- package/ui/Pagination/index.js +20 -0
- package/ui/RadioGroup/RadioGroup.js +45 -0
- package/ui/RadioGroup/index.js +5 -0
- package/ui/ScrollArea/ScrollArea.js +57 -0
- package/ui/ScrollArea/index.js +5 -0
- package/ui/SearchInput/SearchInput.js +38 -0
- package/ui/SearchInput/index.js +4 -0
- package/ui/SearchInputFields/SearchInputFields.js +53 -0
- package/ui/SearchInputFields/index.js +4 -0
- package/ui/Select/Select.js +155 -0
- package/ui/Select/SelectDefault.js +43 -0
- package/ui/Select/index.js +26 -0
- package/ui/Separator/Separator.js +26 -0
- package/ui/Separator/index.js +4 -0
- package/ui/Severity/Severity.js +11 -0
- package/ui/Severity/index.js +4 -0
- package/ui/Severity/utils.js +53 -0
- package/ui/Skeleton/Skeleton.js +25 -0
- package/ui/Skeleton/index.js +5 -0
- package/ui/Slider/Slider.js +50 -0
- package/ui/Slider/index.js +4 -0
- package/ui/Spinner/Spinner.js +21 -0
- package/ui/Spinner/index.js +5 -0
- package/ui/SpinnerSquare/SpinnerSquare.css +1 -0
- package/ui/SpinnerSquare/SpinnerSquare.js +22 -0
- package/ui/SpinnerSquare/index.js +4 -0
- package/ui/StatisticCard/StatisticCard.js +27 -0
- package/ui/StatisticCard/index.js +4 -0
- package/ui/StatisticCard/types.js +0 -0
- package/ui/Suggestions/Suggestions.js +244 -0
- package/ui/Suggestions/index.js +4 -0
- package/ui/Switch/Switch.js +64 -0
- package/ui/Switch/index.js +4 -0
- package/ui/SyncProcessBar/SyncProcessBar.js +14 -0
- package/ui/SyncProcessBar/index.js +4 -0
- package/ui/Table/GroupHeaderRow.js +36 -0
- package/ui/Table/RowGrouped.js +19 -0
- package/ui/Table/ServerGroupedTableBody.js +89 -0
- package/ui/Table/SortableHeader.js +46 -0
- package/ui/Table/Table.js +110 -0
- package/ui/Table/TableWrap.js +124 -0
- package/ui/Table/columnStyle.js +14 -0
- package/ui/Table/index.js +28 -0
- package/ui/Tabs/Tabs.js +76 -0
- package/ui/Tabs/index.js +4 -0
- package/ui/TextTruncate/TextTruncate.js +107 -0
- package/ui/TextTruncate/index.js +4 -0
- package/ui/Textarea/Textarea.js +20 -0
- package/ui/Textarea/index.js +4 -0
- package/ui/ThemeToggle/ThemeToggle.js +23 -0
- package/ui/ThemeToggle/index.js +4 -0
- package/ui/Toast/Toast.js +23 -0
- package/ui/Toast/index.js +4 -0
- package/ui/Tooltip/Tooltip.js +17 -0
- package/ui/Tooltip/TooltipLayout.js +60 -0
- package/ui/Tooltip/index.js +14 -0
- package/ui/TreeGuide/TreeGuide.js +23 -0
- package/ui/TreeGuide/index.js +5 -0
- package/ui/entries/charts.js +2 -0
- package/ui/entries/domain.js +3 -0
- package/ui/index.js +45 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DropdownsSelect } from "../Dropdown/DropdownsSelect.js";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
import { SearchIcon, XIcon } from "lucide-react";
|
|
5
|
+
import { Input } from "../Input/Input.js";
|
|
6
|
+
const SearchInputFields = ({
|
|
7
|
+
loading,
|
|
8
|
+
className,
|
|
9
|
+
classNamesInput,
|
|
10
|
+
value,
|
|
11
|
+
placeholder,
|
|
12
|
+
options,
|
|
13
|
+
valueSelect,
|
|
14
|
+
onChangeSelect,
|
|
15
|
+
onChange,
|
|
16
|
+
...props
|
|
17
|
+
}) => {
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
19
|
+
/* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute top-1/2 left-2 z-1 flex size-4 -translate-y-[60%] items-center", children: /* @__PURE__ */ jsx(SearchIcon, { className: "text-subdued h-4 w-4" }) }),
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-1/2 left-8 z-1 flex h-10 w-26 -translate-y-1/2 items-center", children: /* @__PURE__ */ jsx(
|
|
21
|
+
DropdownsSelect,
|
|
22
|
+
{
|
|
23
|
+
className: "border-r-border w-inherit h-6 rounded-none border-0 border-r bg-transparent px-2 text-xs shadow-none hover:bg-transparent",
|
|
24
|
+
options,
|
|
25
|
+
value: valueSelect,
|
|
26
|
+
onChange: onChangeSelect
|
|
27
|
+
}
|
|
28
|
+
) }),
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
Input,
|
|
31
|
+
{
|
|
32
|
+
loading,
|
|
33
|
+
type: "text",
|
|
34
|
+
className: cn("pr-7 pl-40", classNamesInput),
|
|
35
|
+
placeholder: placeholder || "Search...",
|
|
36
|
+
...props,
|
|
37
|
+
value,
|
|
38
|
+
onChange
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
value && /* @__PURE__ */ jsx(
|
|
42
|
+
"button",
|
|
43
|
+
{
|
|
44
|
+
className: "absolute inset-y-0 right-2 flex cursor-pointer items-center",
|
|
45
|
+
onClick: () => onChange?.({ target: { value: "" } }),
|
|
46
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "text-subdued hover:text-foreground h-4 w-4" })
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] });
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
SearchInputFields
|
|
53
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon, Loader2 } from "lucide-react";
|
|
4
|
+
import { cn } from "../../lib/cn.js";
|
|
5
|
+
function Select({ ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
7
|
+
}
|
|
8
|
+
function SelectGroup({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
|
|
10
|
+
}
|
|
11
|
+
function SelectValue({ ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
13
|
+
}
|
|
14
|
+
function SelectTrigger({
|
|
15
|
+
className,
|
|
16
|
+
size = "default",
|
|
17
|
+
children,
|
|
18
|
+
loading,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsxs(
|
|
22
|
+
SelectPrimitive.Trigger,
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "select-trigger",
|
|
25
|
+
"data-size": size,
|
|
26
|
+
className: cn(
|
|
27
|
+
"border-border data-[placeholder]:text-gray-chateau bg-secondary [&_svg:not([class*='text-'])]:text-gray-chateau focus-visible:border-success focus-visible:ring-success/40 aria-invalid:ring-critical/40 aria-invalid:border-destructive flex h-[36px] w-full items-center justify-between gap-2 rounded-md border px-3 py-1 text-xs font-normal whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...props,
|
|
31
|
+
children: [
|
|
32
|
+
children,
|
|
33
|
+
loading ? /* @__PURE__ */ jsx(Loader2, { className: "text-gray-chateau size-4 animate-spin" }) : /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-75 text-inherit" }) })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function SelectContent({
|
|
39
|
+
className,
|
|
40
|
+
children,
|
|
41
|
+
position = "popper",
|
|
42
|
+
...props
|
|
43
|
+
}) {
|
|
44
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
45
|
+
SelectPrimitive.Content,
|
|
46
|
+
{
|
|
47
|
+
"data-slot": "select-content",
|
|
48
|
+
className: cn(
|
|
49
|
+
"bg-secondary border-border text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
50
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
position,
|
|
54
|
+
...props,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
SelectPrimitive.Viewport,
|
|
59
|
+
{
|
|
60
|
+
className: cn(
|
|
61
|
+
"p-1",
|
|
62
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
63
|
+
),
|
|
64
|
+
children
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
) });
|
|
71
|
+
}
|
|
72
|
+
function SelectLabel({ className, ...props }) {
|
|
73
|
+
return /* @__PURE__ */ jsx(
|
|
74
|
+
SelectPrimitive.Label,
|
|
75
|
+
{
|
|
76
|
+
"data-slot": "select-label",
|
|
77
|
+
className: cn("text-subdued px-2 py-1.5 text-xs", className),
|
|
78
|
+
...props
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
function SelectItem({
|
|
83
|
+
className,
|
|
84
|
+
children,
|
|
85
|
+
...props
|
|
86
|
+
}) {
|
|
87
|
+
return /* @__PURE__ */ jsxs(
|
|
88
|
+
SelectPrimitive.Item,
|
|
89
|
+
{
|
|
90
|
+
"data-slot": "select-item",
|
|
91
|
+
className: cn(
|
|
92
|
+
"focus:text-default [&_svg:not([class*='text-'])]:text-subdued focus:bg-hover relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-xs outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
93
|
+
className
|
|
94
|
+
),
|
|
95
|
+
...props,
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
98
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
function SelectSeparator({
|
|
104
|
+
className,
|
|
105
|
+
...props
|
|
106
|
+
}) {
|
|
107
|
+
return /* @__PURE__ */ jsx(
|
|
108
|
+
SelectPrimitive.Separator,
|
|
109
|
+
{
|
|
110
|
+
"data-slot": "select-separator",
|
|
111
|
+
className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
112
|
+
...props
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
function SelectScrollUpButton({
|
|
117
|
+
className,
|
|
118
|
+
...props
|
|
119
|
+
}) {
|
|
120
|
+
return /* @__PURE__ */ jsx(
|
|
121
|
+
SelectPrimitive.ScrollUpButton,
|
|
122
|
+
{
|
|
123
|
+
"data-slot": "select-scroll-up-button",
|
|
124
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
125
|
+
...props,
|
|
126
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
function SelectScrollDownButton({
|
|
131
|
+
className,
|
|
132
|
+
...props
|
|
133
|
+
}) {
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
SelectPrimitive.ScrollDownButton,
|
|
136
|
+
{
|
|
137
|
+
"data-slot": "select-scroll-down-button",
|
|
138
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
139
|
+
...props,
|
|
140
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
export {
|
|
145
|
+
Select,
|
|
146
|
+
SelectContent,
|
|
147
|
+
SelectGroup,
|
|
148
|
+
SelectItem,
|
|
149
|
+
SelectLabel,
|
|
150
|
+
SelectScrollDownButton,
|
|
151
|
+
SelectScrollUpButton,
|
|
152
|
+
SelectSeparator,
|
|
153
|
+
SelectTrigger,
|
|
154
|
+
SelectValue
|
|
155
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import {
|
|
4
|
+
Select,
|
|
5
|
+
SelectContent,
|
|
6
|
+
SelectGroup,
|
|
7
|
+
SelectItem,
|
|
8
|
+
SelectTrigger,
|
|
9
|
+
SelectValue
|
|
10
|
+
} from "./Select.js";
|
|
11
|
+
const SelectDefault = ({
|
|
12
|
+
id,
|
|
13
|
+
name,
|
|
14
|
+
options,
|
|
15
|
+
placeholder,
|
|
16
|
+
className,
|
|
17
|
+
value,
|
|
18
|
+
loading,
|
|
19
|
+
disabled,
|
|
20
|
+
style,
|
|
21
|
+
renderItemLabel,
|
|
22
|
+
renderTriggerLabel,
|
|
23
|
+
onChange
|
|
24
|
+
}) => {
|
|
25
|
+
return /* @__PURE__ */ jsxs(Select, { value, onValueChange: onChange, children: [
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
SelectTrigger,
|
|
28
|
+
{
|
|
29
|
+
id,
|
|
30
|
+
name,
|
|
31
|
+
className: cn("relative w-full", className),
|
|
32
|
+
disabled,
|
|
33
|
+
loading,
|
|
34
|
+
style,
|
|
35
|
+
children: /* @__PURE__ */ jsx(SelectValue, { placeholder, children: value && renderTriggerLabel ? renderTriggerLabel(value) : void 0 })
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ jsx(SelectContent, { children: /* @__PURE__ */ jsx(SelectGroup, { children: options.filter((option) => option.value !== "").map((option) => /* @__PURE__ */ jsx(SelectItem, { className: "cursor-pointer", value: option.value, children: renderItemLabel ? renderItemLabel(option.value) : option.label }, option.value)) }) })
|
|
39
|
+
] });
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
SelectDefault
|
|
43
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Select as Select2,
|
|
3
|
+
SelectContent as SelectContent2,
|
|
4
|
+
SelectGroup as SelectGroup2,
|
|
5
|
+
SelectItem as SelectItem2,
|
|
6
|
+
SelectLabel as SelectLabel2,
|
|
7
|
+
SelectScrollDownButton as SelectScrollDownButton2,
|
|
8
|
+
SelectScrollUpButton as SelectScrollUpButton2,
|
|
9
|
+
SelectSeparator as SelectSeparator2,
|
|
10
|
+
SelectTrigger as SelectTrigger2,
|
|
11
|
+
SelectValue as SelectValue2
|
|
12
|
+
} from "./Select.js";
|
|
13
|
+
import { SelectDefault } from "./SelectDefault.js";
|
|
14
|
+
export {
|
|
15
|
+
Select2 as Select,
|
|
16
|
+
SelectContent2 as SelectContent,
|
|
17
|
+
SelectDefault,
|
|
18
|
+
SelectGroup2 as SelectGroup,
|
|
19
|
+
SelectItem2 as SelectItem,
|
|
20
|
+
SelectLabel2 as SelectLabel,
|
|
21
|
+
SelectScrollDownButton2 as SelectScrollDownButton,
|
|
22
|
+
SelectScrollUpButton2 as SelectScrollUpButton,
|
|
23
|
+
SelectSeparator2 as SelectSeparator,
|
|
24
|
+
SelectTrigger2 as SelectTrigger,
|
|
25
|
+
SelectValue2 as SelectValue
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Separator as SeparatorPrimitive } from "@radix-ui/react-separator";
|
|
3
|
+
import { cn } from "../../lib/cn.js";
|
|
4
|
+
function Separator({
|
|
5
|
+
className,
|
|
6
|
+
orientation = "horizontal",
|
|
7
|
+
decorative = true,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
SeparatorPrimitive,
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "separator",
|
|
14
|
+
decorative,
|
|
15
|
+
orientation,
|
|
16
|
+
className: cn(
|
|
17
|
+
"bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
...props
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
Separator
|
|
26
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import { arrowIcon, severityTextColor } from "./utils.js";
|
|
4
|
+
const Severity = ({ severity, className, arrowClassName }) => {
|
|
5
|
+
const Arrow = arrowIcon(severity);
|
|
6
|
+
const localArrowClassName = cn("size-3.5", arrowClassName, severityTextColor(severity));
|
|
7
|
+
return /* @__PURE__ */ jsx("div", { className: cn("inline-flex", className), children: /* @__PURE__ */ jsx(Arrow, { className: localArrowClassName }) });
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
Severity
|
|
11
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ArrowDownRightIcon,
|
|
3
|
+
ArrowRightIcon,
|
|
4
|
+
ArrowUpIcon,
|
|
5
|
+
ArrowUpRightIcon
|
|
6
|
+
} from "lucide-react";
|
|
7
|
+
const severityColor = (severity) => {
|
|
8
|
+
switch (severity) {
|
|
9
|
+
case "Low":
|
|
10
|
+
return "success";
|
|
11
|
+
case "Medium":
|
|
12
|
+
return "yellow";
|
|
13
|
+
case "High":
|
|
14
|
+
return "warning";
|
|
15
|
+
case "Critical":
|
|
16
|
+
return "critical";
|
|
17
|
+
default:
|
|
18
|
+
return "success";
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const severityTextColor = (severity) => {
|
|
22
|
+
switch (severity) {
|
|
23
|
+
case "Low":
|
|
24
|
+
return "text-light-blue";
|
|
25
|
+
case "Medium":
|
|
26
|
+
return "text-yellow";
|
|
27
|
+
case "High":
|
|
28
|
+
return "text-warning";
|
|
29
|
+
case "Critical":
|
|
30
|
+
return "text-critical";
|
|
31
|
+
default:
|
|
32
|
+
return "text-gray-chateau";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const arrowIcon = (severity) => {
|
|
36
|
+
switch (severity) {
|
|
37
|
+
case "Low":
|
|
38
|
+
return ArrowDownRightIcon;
|
|
39
|
+
case "Medium":
|
|
40
|
+
return ArrowRightIcon;
|
|
41
|
+
case "High":
|
|
42
|
+
return ArrowUpRightIcon;
|
|
43
|
+
case "Critical":
|
|
44
|
+
return ArrowUpIcon;
|
|
45
|
+
default:
|
|
46
|
+
return ArrowDownRightIcon;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
arrowIcon,
|
|
51
|
+
severityColor,
|
|
52
|
+
severityTextColor
|
|
53
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import { Fragment } from "react/jsx-runtime";
|
|
4
|
+
import { TableBody, TableCell, TableRow } from "../Table/Table.js";
|
|
5
|
+
const Skeleton = ({ className, rows, ...props }) => {
|
|
6
|
+
const content = /* @__PURE__ */ jsx(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
"data-slot": "skeleton",
|
|
10
|
+
className: cn("bg-hover animate-pulse rounded-md", className),
|
|
11
|
+
...props
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
if (rows) {
|
|
15
|
+
return Array.from({ length: rows }).map((_, row) => /* @__PURE__ */ jsx(Fragment, { children: content }, row.toString()));
|
|
16
|
+
}
|
|
17
|
+
return content;
|
|
18
|
+
};
|
|
19
|
+
const SkeletonTable = ({ className, rows = 10, columns = 5 }) => {
|
|
20
|
+
return /* @__PURE__ */ jsx(TableBody, { className, children: Array.from({ length: rows }).map((_, row) => /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: Array.from({ length: columns }).map((_2, column) => /* @__PURE__ */ jsx(TableCell, { className: "border-transparent px-6 py-4", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }, column.toString()) }, column.toString())) }, row.toString())) });
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
Skeleton,
|
|
24
|
+
SkeletonTable
|
|
25
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
4
|
+
const Slider = ({
|
|
5
|
+
className,
|
|
6
|
+
label,
|
|
7
|
+
min = 0,
|
|
8
|
+
max = 100,
|
|
9
|
+
step = 1,
|
|
10
|
+
value = [50],
|
|
11
|
+
showValue = true,
|
|
12
|
+
unit = "",
|
|
13
|
+
onValueChange,
|
|
14
|
+
formatValue,
|
|
15
|
+
...props
|
|
16
|
+
}) => {
|
|
17
|
+
const displayValue = formatValue ? formatValue(value[0]) : `${value[0]}${unit}`;
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
19
|
+
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
20
|
+
label && /* @__PURE__ */ jsx("label", { className: "text-subdued text-xs font-medium", children: label }),
|
|
21
|
+
showValue && /* @__PURE__ */ jsx("span", { className: "text-default text-xs font-semibold", children: displayValue })
|
|
22
|
+
] }),
|
|
23
|
+
/* @__PURE__ */ jsxs(
|
|
24
|
+
SliderPrimitive.Root,
|
|
25
|
+
{
|
|
26
|
+
className: cn("relative flex w-full touch-none items-center select-none", className),
|
|
27
|
+
min,
|
|
28
|
+
max,
|
|
29
|
+
step,
|
|
30
|
+
value,
|
|
31
|
+
onValueChange,
|
|
32
|
+
...props,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx(SliderPrimitive.Track, { className: "bg-border relative h-1.5 w-full grow overflow-hidden rounded-full", children: /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: "bg-btn-primary absolute h-full" }) }),
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
SliderPrimitive.Thumb,
|
|
37
|
+
{
|
|
38
|
+
className: cn(
|
|
39
|
+
"border-primary bg-success ring-offset-secondary focus-visible:ring-btn-primary block h-3.5 w-3.5 rounded-full border border-2 transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] });
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
Slider
|
|
50
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import { LoaderIcon } from "lucide-react";
|
|
4
|
+
const Spinner = ({ className, size = 4, ...props }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
LoaderIcon,
|
|
7
|
+
{
|
|
8
|
+
role: "status",
|
|
9
|
+
"aria-label": "Loading",
|
|
10
|
+
className: cn(`size-${size} animate-spin`, className),
|
|
11
|
+
...props
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
const SpinnerCustom = ({ className, size = 4, ...props }) => {
|
|
16
|
+
return /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center gap-4", children: /* @__PURE__ */ jsx(Spinner, { className, size, ...props }) });
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
Spinner,
|
|
20
|
+
SpinnerCustom
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.square-spinner::before{display:none}.square-spinner.fixed{position:fixed;top:0;right:0;bottom:0;left:0;height:100vh}.square-spinner.absolute{position:absolute;top:0;right:0;bottom:0;left:0}.square-spinner.default{width:100%;height:100%}.square-spinner__main{position:absolute;top:50%;left:52%;width:86px;height:64px;margin:0;transform:translate(-50%, -50%)}.square-spinner__square{position:relative}.square-spinner__square:nth-child(1){margin-left:0}.square-spinner__square:nth-child(1) span{animation:animSquare1 2s infinite ease-in}.square-spinner__square:nth-child(2){margin-left:22px}.square-spinner__square:nth-child(2) span{animation:animSquare2 2s infinite ease-in}.square-spinner__square:nth-child(3){margin-left:44px}.square-spinner__square:nth-child(3) span{animation:animSquare3 2s infinite ease-in}.square-spinner__square span{position:absolute;top:0;left:10px;height:16px;width:16px;border-radius:2px;background-color:#4e5060}.square-spinner__square span:nth-child(1){top:0;animation-delay:0s}.square-spinner__square span:nth-child(2){top:22px;animation-delay:.15s}.square-spinner__square span:nth-child(3){top:44px;animation-delay:.3s}@keyframes animSquare1{0%,5%,95%,100%{transform:translate(0px, 0px) rotate(0deg)}30%,70%{transform:translate(-40px, 0px) rotate(-90deg)}}@keyframes animSquare2{0%,10%,90%,100%{transform:translate(0px, 0px) rotate(0deg)}35%,65%{transform:translate(-40px, 0px) rotate(-90deg)}}@keyframes animSquare3{0%,15%,85%,100%{transform:translate(0px, 0px) rotate(0deg)}40%,60%{transform:translate(-40px, 0px) rotate(-90deg)}}@media(max-width: 550px){.square-spinner{transform:scale(0.75)}}@media(max-width: 440px){.square-spinner{transform:scale(0.5)}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "./SpinnerSquare.css";
|
|
3
|
+
const SpinnerSquare = ({ variant = "default" }) => /* @__PURE__ */ jsx("div", { className: `square-spinner ${variant}`, children: /* @__PURE__ */ jsxs("div", { className: "square-spinner__main", children: [
|
|
4
|
+
/* @__PURE__ */ jsxs("div", { className: "square-spinner__square", children: [
|
|
5
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
6
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
7
|
+
/* @__PURE__ */ jsx("span", {})
|
|
8
|
+
] }),
|
|
9
|
+
/* @__PURE__ */ jsxs("div", { className: "square-spinner__square", children: [
|
|
10
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
11
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
12
|
+
/* @__PURE__ */ jsx("span", {})
|
|
13
|
+
] }),
|
|
14
|
+
/* @__PURE__ */ jsxs("div", { className: "square-spinner__square", children: [
|
|
15
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
16
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
17
|
+
/* @__PURE__ */ jsx("span", {})
|
|
18
|
+
] })
|
|
19
|
+
] }) });
|
|
20
|
+
export {
|
|
21
|
+
SpinnerSquare
|
|
22
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AreaChartWithGradient } from "../Charts/AreaChartWithGradient.js";
|
|
3
|
+
const StatisticCard = ({
|
|
4
|
+
title,
|
|
5
|
+
color = "#ef4444",
|
|
6
|
+
data
|
|
7
|
+
}) => {
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", { className: "group border-border bg-secondary relative flex flex-1 flex-col rounded-lg border shadow-md transition-all duration-200 hover:-translate-y-[2px]", children: [
|
|
9
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col justify-between gap-2 p-5 pb-2", children: [
|
|
10
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11
|
+
/* @__PURE__ */ jsx("div", { className: "h-2 w-2 rounded-full", style: { backgroundColor: color } }),
|
|
12
|
+
/* @__PURE__ */ jsx("span", { className: "text-gray-chateau text-2xs font-semibold tracking-wider uppercase", children: title })
|
|
13
|
+
] }),
|
|
14
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2", children: [
|
|
15
|
+
/* @__PURE__ */ jsx("span", { className: "text-default text-3xl font-bold", children: data?.activeCount != null ? data.activeCount : data?.totalCount ?? 0 }),
|
|
16
|
+
data?.activeCount != null && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
/* @__PURE__ */ jsx("span", { className: "text-dark-gray text-xs font-bold", children: "/" }),
|
|
18
|
+
/* @__PURE__ */ jsx("span", { className: "text-dark-gray text-xs font-bold", children: data.totalCount })
|
|
19
|
+
] })
|
|
20
|
+
] })
|
|
21
|
+
] }),
|
|
22
|
+
data && /* @__PURE__ */ jsx("div", { className: "-m-1 flex min-h-[60px] flex-col justify-end", children: /* @__PURE__ */ jsx(AreaChartWithGradient, { data: data.points, color, height: 60 }) })
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
StatisticCard
|
|
27
|
+
};
|
|
File without changes
|