uibee 3.2.0 → 3.3.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/alert/alert.d.ts +15 -0
- package/dist/components/alert/alert.js +29 -0
- package/dist/components/badge/badge.d.ts +16 -0
- package/dist/components/badge/badge.js +26 -0
- package/dist/components/buttons/button.d.ts +25 -0
- package/dist/components/buttons/button.js +44 -0
- package/dist/components/code/code.d.ts +23 -0
- package/dist/components/code/code.js +39 -0
- package/dist/components/confirm/confirmPopup.d.ts +23 -0
- package/dist/components/confirm/confirmPopup.js +52 -0
- package/dist/components/container/accordion.d.ts +25 -0
- package/dist/components/container/accordion.js +41 -0
- package/dist/components/container/card.d.ts +13 -0
- package/dist/components/container/card.js +10 -0
- package/dist/components/container/expandableCard.d.ts +32 -0
- package/dist/components/container/expandableCard.js +70 -0
- package/dist/components/container/glassCard.d.ts +13 -0
- package/dist/components/container/glassCard.js +10 -0
- package/dist/components/container/highlight.d.ts +10 -0
- package/dist/components/container/highlight.js +10 -0
- package/dist/components/container/iconBubble.d.ts +25 -0
- package/dist/components/container/iconBubble.js +21 -0
- package/dist/components/container/leftBarPanel.d.ts +15 -0
- package/dist/components/container/leftBarPanel.js +10 -0
- package/dist/components/container/page.d.ts +15 -0
- package/dist/components/container/page.js +16 -0
- package/dist/components/container/pulseDot.d.ts +12 -0
- package/dist/components/container/pulseDot.js +23 -0
- package/dist/components/container/statCard.d.ts +18 -0
- package/dist/components/container/statCard.js +25 -0
- package/dist/components/container/tabs.d.ts +35 -0
- package/dist/components/container/tabs.js +36 -0
- package/dist/components/empty/emptyState.d.ts +19 -0
- package/dist/components/empty/emptyState.js +27 -0
- package/dist/components/footer/footer.d.ts +49 -0
- package/dist/components/footer/footer.js +109 -0
- package/dist/components/footer/loginContent.d.ts +18 -0
- package/dist/components/footer/loginContent.js +138 -0
- package/dist/components/inputs/checkbox.d.ts +20 -0
- package/dist/components/inputs/checkbox.js +76 -0
- package/dist/components/inputs/fileInput.d.ts +19 -0
- package/dist/components/inputs/fileInput.js +108 -0
- package/dist/components/inputs/input.d.ts +16 -0
- package/dist/components/inputs/input.js +157 -0
- package/dist/components/inputs/multiSelect.d.ts +37 -0
- package/dist/components/inputs/multiSelect.js +99 -0
- package/dist/components/inputs/radio.d.ts +20 -0
- package/dist/components/inputs/radio.js +70 -0
- package/dist/components/inputs/range.d.ts +14 -0
- package/dist/components/inputs/range.js +60 -0
- package/dist/components/inputs/searchInput.d.ts +11 -0
- package/dist/components/inputs/searchInput.js +56 -0
- package/dist/components/inputs/select.d.ts +42 -0
- package/dist/components/inputs/select.js +164 -0
- package/dist/components/inputs/shared/colorPickerPopup.js +293 -0
- package/dist/components/inputs/shared/dateTimePickerPopup.js +225 -0
- package/dist/components/inputs/shared/fieldWrapper.js +33 -0
- package/dist/components/inputs/shared/index.js +6 -0
- package/dist/components/inputs/shared/inputError.js +17 -0
- package/dist/components/inputs/shared/inputInfo.js +13 -0
- package/dist/components/inputs/shared/inputLabel.js +19 -0
- package/dist/components/inputs/switch.d.ts +14 -0
- package/dist/components/inputs/switch.js +37 -0
- package/dist/components/inputs/tagInput.d.ts +31 -0
- package/dist/components/inputs/tagInput.js +72 -0
- package/dist/components/inputs/textarea.d.ts +14 -0
- package/dist/components/inputs/textarea.js +76 -0
- package/dist/components/inputs/toggle.d.ts +21 -0
- package/dist/components/inputs/toggle.js +33 -0
- package/dist/components/login/loginPage.d.ts +15 -0
- package/dist/components/login/loginPage.js +80 -0
- package/dist/components/logo/logo.d.ts +9 -0
- package/dist/components/logo/logo.js +138 -0
- package/dist/components/logo/logoSmall.d.ts +4 -0
- package/dist/components/logo/logoSmall.js +56 -0
- package/dist/components/markdownrender/markdownRender.d.ts +16 -0
- package/dist/components/markdownrender/markdownRender.js +59 -0
- package/dist/components/modal/modal.d.ts +22 -0
- package/dist/components/modal/modal.js +59 -0
- package/dist/components/navbar/bubble.js +36 -0
- package/dist/components/navbar/navbar.d.ts +50 -0
- package/dist/components/navbar/navbar.js +99 -0
- package/dist/components/navbar/navbarDropdown.d.ts +15 -0
- package/dist/components/navbar/navbarDropdown.js +63 -0
- package/dist/components/navbar/navbarItem.d.ts +23 -0
- package/dist/components/navbar/navbarItem.js +38 -0
- package/dist/components/sidebar/sidebar.d.ts +34 -0
- package/dist/components/sidebar/sidebar.js +135 -0
- package/dist/components/spinner/spinner.d.ts +11 -0
- package/dist/components/spinner/spinner.js +16 -0
- package/dist/components/table/body.js +253 -0
- package/dist/components/table/constants.js +58 -0
- package/dist/components/table/empty.js +24 -0
- package/dist/components/table/format.js +39 -0
- package/dist/components/table/header.js +109 -0
- package/dist/components/table/menu.d.ts +18 -0
- package/dist/components/table/menu.js +76 -0
- package/dist/components/table/pagination.d.ts +14 -0
- package/dist/components/table/pagination.js +130 -0
- package/dist/components/table/skeleton.js +39 -0
- package/dist/components/table/table.d.ts +7 -0
- package/dist/components/table/table.js +213 -0
- package/dist/components/table/types.d.ts +52 -0
- package/dist/components/table/utils.js +9 -0
- package/dist/components/toast/toastItem.js +61 -0
- package/dist/components/toast/toaster.d.ts +13 -0
- package/dist/components/toast/toaster.js +117 -0
- package/dist/components/toggle/language.d.ts +10 -0
- package/dist/components/toggle/language.js +34 -0
- package/dist/components/toggle/theme.d.ts +8 -0
- package/dist/components/toggle/theme.js +135 -0
- package/dist/components/version/version.d.ts +13 -0
- package/dist/components/version/version.js +19 -0
- package/dist/components/vulnerability/constants.d.ts +4 -0
- package/dist/components/vulnerability/constants.js +17 -0
- package/dist/components/vulnerability/severityPill.d.ts +15 -0
- package/dist/components/vulnerability/severityPill.js +20 -0
- package/dist/{style.css → globals.css} +155 -226
- package/dist/hooks/useClickOutside.d.ts +6 -0
- package/dist/{useClickOutside-Cmp-RsP3.js → hooks/useClickOutside.js} +1 -1
- package/dist/hooks/useDarkMode.d.ts +4 -0
- package/dist/hooks/useDarkMode.js +19 -0
- package/dist/hooks/useVisibility.d.ts +7 -0
- package/dist/hooks/useVisibility.js +25 -0
- package/dist/icons/icons.d.ts +420 -0
- package/dist/{icons-lZYQ6Vlr.js → icons/icons.js} +1 -1
- package/dist/src/components/index.d.ts +51 -901
- package/dist/src/components/index.js +49 -4160
- package/dist/src/hooks/index.d.ts +3 -14
- package/dist/src/hooks/index.js +3 -42
- package/dist/src/icons/index.d.ts +1 -419
- package/dist/src/icons/index.js +1 -1
- package/dist/src/styles/index.js +1 -1
- package/dist/src/utils/index.d.ts +5 -37
- package/dist/src/utils/index.js +5 -124
- package/dist/utils/auth/callback.d.ts +14 -0
- package/dist/utils/auth/callback.js +53 -0
- package/dist/utils/auth/getDomain.js +6 -0
- package/dist/utils/auth/login.d.ts +12 -0
- package/dist/utils/auth/login.js +17 -0
- package/dist/utils/auth/logout.d.ts +10 -0
- package/dist/utils/auth/logout.js +20 -0
- package/dist/utils/auth/token.d.ts +10 -0
- package/dist/utils/auth/token.js +30 -0
- package/dist/utils/logoConsoleOutput/logoConsoleOutput.d.ts +4 -0
- package/dist/utils/logoConsoleOutput/logoConsoleOutput.js +11 -0
- package/package.json +1 -1
- package/src/components/buttons/button.tsx +2 -0
- package/src/components/footer/footer.tsx +65 -28
- package/src/components/index.ts +0 -1
- package/src/components/inputs/checkbox.tsx +2 -0
- package/src/components/inputs/input.tsx +2 -0
- package/src/components/inputs/radio.tsx +2 -0
- package/src/components/inputs/range.tsx +2 -0
- package/src/components/inputs/shared/colorPickerPopup.tsx +2 -0
- package/src/components/inputs/shared/dateTimePickerPopup.tsx +2 -0
- package/src/components/inputs/textarea.tsx +2 -0
- package/src/components/inputs/toggle.tsx +2 -0
- package/src/components/sidebar/sidebar.tsx +37 -10
- package/src/components/toast/toastItem.tsx +2 -0
- package/src/globals.css +6 -1
- package/tsdown.config.ts +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/components/container/pulseDot.d.ts
|
|
2
|
+
type PulseDotVariant = 'online' | 'offline' | 'warning' | 'unknown';
|
|
3
|
+
type PulseDotProps = {
|
|
4
|
+
variant?: PulseDotVariant;
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
};
|
|
7
|
+
declare function PulseDot({
|
|
8
|
+
variant,
|
|
9
|
+
size
|
|
10
|
+
}: PulseDotProps): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PulseDot as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/container/pulseDot.tsx
|
|
3
|
+
const variantColor = {
|
|
4
|
+
online: "bg-green-500",
|
|
5
|
+
offline: "bg-red-500",
|
|
6
|
+
warning: "bg-login",
|
|
7
|
+
unknown: "bg-login-400"
|
|
8
|
+
};
|
|
9
|
+
const sizeClass = {
|
|
10
|
+
sm: "w-1.5 h-1.5",
|
|
11
|
+
md: "w-2 h-2",
|
|
12
|
+
lg: "w-3 h-3"
|
|
13
|
+
};
|
|
14
|
+
function PulseDot({ variant = "online", size = "md" }) {
|
|
15
|
+
const color = variantColor[variant];
|
|
16
|
+
const dotSize = sizeClass[size];
|
|
17
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
18
|
+
className: `relative grid place-items-center ${dotSize}`,
|
|
19
|
+
children: [/* @__PURE__ */ jsx("span", { className: `absolute inline-flex h-full w-full rounded-full ${color} opacity-50 animate-ping` }), /* @__PURE__ */ jsx("span", { className: `relative inline-flex rounded-full ${dotSize} ${color}` })]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { PulseDot as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IconBubbleTone } from "./iconBubble.js";
|
|
2
|
+
import { ElementType } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/container/statCard.d.ts
|
|
5
|
+
type StatCardProps = {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
icon: ElementType;
|
|
9
|
+
tone?: IconBubbleTone;
|
|
10
|
+
};
|
|
11
|
+
declare function StatCard({
|
|
12
|
+
label,
|
|
13
|
+
value,
|
|
14
|
+
icon,
|
|
15
|
+
tone
|
|
16
|
+
}: StatCardProps): import("react").JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { StatCard as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Card from "./card.js";
|
|
2
|
+
import IconBubble from "./iconBubble.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/container/statCard.tsx
|
|
5
|
+
function StatCard({ label, value, icon, tone = "slate" }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
7
|
+
className: "p-4",
|
|
8
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
9
|
+
className: "mb-3 flex items-center gap-3",
|
|
10
|
+
children: [/* @__PURE__ */ jsx(IconBubble, {
|
|
11
|
+
icon,
|
|
12
|
+
tone
|
|
13
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
14
|
+
className: "text-sm font-medium text-login-200",
|
|
15
|
+
children: label
|
|
16
|
+
})]
|
|
17
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: "truncate text-lg font-semibold text-login-50",
|
|
19
|
+
title: value,
|
|
20
|
+
children: value
|
|
21
|
+
})]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { StatCard as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/container/tabs.d.ts
|
|
4
|
+
type Tab = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
type TabsProps = {
|
|
9
|
+
tabs: Tab[];
|
|
10
|
+
defaultTab?: string;
|
|
11
|
+
activeTab?: string;
|
|
12
|
+
onTabChange?: (id: string) => void;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
type TabPanelProps = {
|
|
17
|
+
id: string;
|
|
18
|
+
activeTab: string;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
declare function Tabs({
|
|
22
|
+
tabs,
|
|
23
|
+
defaultTab,
|
|
24
|
+
activeTab: controlledTab,
|
|
25
|
+
onTabChange,
|
|
26
|
+
children,
|
|
27
|
+
className
|
|
28
|
+
}: TabsProps): import("react").JSX.Element;
|
|
29
|
+
declare function TabPanel({
|
|
30
|
+
id,
|
|
31
|
+
activeTab,
|
|
32
|
+
children
|
|
33
|
+
}: TabPanelProps): import("react").JSX.Element | null;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { TabPanel, Tabs };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/container/tabs.tsx
|
|
5
|
+
function Tabs({ tabs, defaultTab, activeTab: controlledTab, onTabChange, children, className = "" }) {
|
|
6
|
+
const [internalTab, setInternalTab] = useState(defaultTab ?? tabs[0]?.id ?? "");
|
|
7
|
+
const activeTab = controlledTab ?? internalTab;
|
|
8
|
+
function handleTabChange(id) {
|
|
9
|
+
if (!controlledTab) setInternalTab(id);
|
|
10
|
+
onTabChange?.(id);
|
|
11
|
+
}
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
className,
|
|
14
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
15
|
+
className: "flex gap-1 rounded-md bg-login-500/50 border border-login-500/40 p-1 w-fit",
|
|
16
|
+
children: tabs.map((tab) => /* @__PURE__ */ jsx("button", {
|
|
17
|
+
type: "button",
|
|
18
|
+
onClick: () => handleTabChange(tab.id),
|
|
19
|
+
className: `
|
|
20
|
+
px-3 py-1.5 rounded text-sm font-medium transition-all duration-150 cursor-pointer select-none
|
|
21
|
+
${activeTab === tab.id ? "bg-login text-white shadow-sm" : "text-login-200 hover:text-login-50 hover:bg-login-600"}
|
|
22
|
+
`,
|
|
23
|
+
children: tab.label
|
|
24
|
+
}, tab.id))
|
|
25
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
26
|
+
className: "mt-3",
|
|
27
|
+
children
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function TabPanel({ id, activeTab, children }) {
|
|
32
|
+
if (activeTab !== id) return null;
|
|
33
|
+
return /* @__PURE__ */ jsx("div", { children });
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { TabPanel, Tabs };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ElementType, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/empty/emptyState.d.ts
|
|
4
|
+
type EmptyStateProps = {
|
|
5
|
+
icon?: ElementType;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
action?: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
declare function EmptyState({
|
|
12
|
+
icon: Icon,
|
|
13
|
+
title,
|
|
14
|
+
description,
|
|
15
|
+
action,
|
|
16
|
+
className
|
|
17
|
+
}: EmptyStateProps): import("react").JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { EmptyState as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/empty/emptyState.tsx
|
|
3
|
+
function EmptyState({ icon: Icon, title, description, action, className = "" }) {
|
|
4
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
5
|
+
className: `flex flex-col items-center justify-center gap-3 py-12 text-center ${className}`,
|
|
6
|
+
children: [
|
|
7
|
+
Icon && /* @__PURE__ */ jsx("div", {
|
|
8
|
+
className: "mb-1 rounded-xl bg-login-600/30 p-3 text-login-400",
|
|
9
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "h-7 w-7" })
|
|
10
|
+
}),
|
|
11
|
+
/* @__PURE__ */ jsx("p", {
|
|
12
|
+
className: "text-sm font-semibold text-login-100",
|
|
13
|
+
children: title
|
|
14
|
+
}),
|
|
15
|
+
description && /* @__PURE__ */ jsx("p", {
|
|
16
|
+
className: "max-w-xs text-xs leading-relaxed text-login-400",
|
|
17
|
+
children: description
|
|
18
|
+
}),
|
|
19
|
+
action && /* @__PURE__ */ jsx("div", {
|
|
20
|
+
className: "mt-2",
|
|
21
|
+
children: action
|
|
22
|
+
})
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { EmptyState as default };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/footer/footer.d.ts
|
|
4
|
+
type Lang = 'no' | 'en';
|
|
5
|
+
type BilingualString = string | {
|
|
6
|
+
no: string;
|
|
7
|
+
en: string;
|
|
8
|
+
};
|
|
9
|
+
type FooterColumn = {
|
|
10
|
+
heading: BilingualString;
|
|
11
|
+
items: {
|
|
12
|
+
label: BilingualString;
|
|
13
|
+
href?: string;
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
16
|
+
type FooterSocialLink = {
|
|
17
|
+
title: string;
|
|
18
|
+
href: string;
|
|
19
|
+
icon: ReactNode;
|
|
20
|
+
hoverClass?: string;
|
|
21
|
+
};
|
|
22
|
+
type FooterProps = {
|
|
23
|
+
logo: ReactNode;
|
|
24
|
+
sponsor?: {
|
|
25
|
+
node: ReactNode;
|
|
26
|
+
label?: BilingualString;
|
|
27
|
+
};
|
|
28
|
+
columns?: FooterColumn[];
|
|
29
|
+
socialLinks?: FooterSocialLink[];
|
|
30
|
+
copyright: BilingualString;
|
|
31
|
+
version?: {
|
|
32
|
+
tag: string;
|
|
33
|
+
href: string;
|
|
34
|
+
};
|
|
35
|
+
lang?: Lang;
|
|
36
|
+
className?: string;
|
|
37
|
+
};
|
|
38
|
+
declare function Footer({
|
|
39
|
+
logo,
|
|
40
|
+
sponsor,
|
|
41
|
+
columns,
|
|
42
|
+
socialLinks,
|
|
43
|
+
copyright,
|
|
44
|
+
version,
|
|
45
|
+
lang,
|
|
46
|
+
className
|
|
47
|
+
}: FooterProps): import("react").JSX.Element;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { BilingualString, FooterColumn, FooterProps, FooterSocialLink, Lang, Footer as default };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import VersionTag from "../version/version.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "next/link.js";
|
|
4
|
+
//#region src/components/footer/footer.tsx
|
|
5
|
+
function t(s, lang) {
|
|
6
|
+
return typeof s === "string" ? s : s[lang];
|
|
7
|
+
}
|
|
8
|
+
function Column({ col, lang }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h4", {
|
|
10
|
+
className: "pb-2 text-sm font-medium tracking-widest text-login-100",
|
|
11
|
+
children: t(col.heading, lang)
|
|
12
|
+
}), col.items.map((item, j) => item.href ? item.href.startsWith("/") ? /* @__PURE__ */ jsx(Link, {
|
|
13
|
+
className: "link--underscore-hover block text-login-50",
|
|
14
|
+
href: item.href,
|
|
15
|
+
children: t(item.label, lang)
|
|
16
|
+
}, j) : /* @__PURE__ */ jsx("a", {
|
|
17
|
+
className: "link--underscore-hover block text-login-50",
|
|
18
|
+
href: item.href,
|
|
19
|
+
children: t(item.label, lang)
|
|
20
|
+
}, j) : /* @__PURE__ */ jsx("p", {
|
|
21
|
+
className: "text-login-50",
|
|
22
|
+
children: t(item.label, lang)
|
|
23
|
+
}, j))] });
|
|
24
|
+
}
|
|
25
|
+
function Footer({ logo, sponsor, columns, socialLinks, copyright, version, lang = "no", className }) {
|
|
26
|
+
const year = (/* @__PURE__ */ new Date()).getFullYear();
|
|
27
|
+
const [firstColumn, ...restColumns] = columns ?? [];
|
|
28
|
+
const hasRight = columns && columns.length > 0 || socialLinks && socialLinks.length > 0;
|
|
29
|
+
return /* @__PURE__ */ jsx("div", {
|
|
30
|
+
className: `max-md:mt-24 bg-login-950 md:mt-40 ${className || ""}`,
|
|
31
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
32
|
+
className: `
|
|
33
|
+
mx-auto w-full pb-4 max-md:px-4 max-md:pt-16 md:max-w-304 md:px-12 md:pt-20
|
|
34
|
+
${hasRight ? "md:grid md:grid-cols-[18rem_1fr] md:gap-x-12" : ""}
|
|
35
|
+
`,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsxs("div", {
|
|
38
|
+
className: "mx-auto grid w-full max-md:max-w-60 max-md:gap-16 md:row-span-2 md:max-w-72 md:gap-20",
|
|
39
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: "block w-full",
|
|
41
|
+
children: logo
|
|
42
|
+
}), sponsor && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
|
|
43
|
+
className: "block w-full",
|
|
44
|
+
children: sponsor.node
|
|
45
|
+
}), sponsor.label && /* @__PURE__ */ jsx("p", {
|
|
46
|
+
className: "pt-8 text-center text-login-100",
|
|
47
|
+
children: t(sponsor.label, lang)
|
|
48
|
+
})] })]
|
|
49
|
+
}),
|
|
50
|
+
firstColumn && /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: "\n grid w-full self-start max-md:mt-16\n max-sm:max-w-60 sm:max-md:max-w-88\n md:col-start-2 md:row-start-1 md:max-w-136 md:justify-self-center\n ",
|
|
52
|
+
children: /* @__PURE__ */ jsx(Column, {
|
|
53
|
+
col: firstColumn,
|
|
54
|
+
lang
|
|
55
|
+
})
|
|
56
|
+
}),
|
|
57
|
+
restColumns.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
58
|
+
className: `
|
|
59
|
+
grid w-full self-start max-md:mt-16 max-md:gap-8
|
|
60
|
+
max-sm:max-w-60 sm:max-md:max-w-88 sm:justify-items-end sm:justify-self-end
|
|
61
|
+
md:col-start-2 md:row-start-1 md:max-w-136 md:justify-self-end
|
|
62
|
+
${restColumns.length > 1 ? "sm:grid-cols-2" : ""}
|
|
63
|
+
`,
|
|
64
|
+
children: restColumns.map((col, i) => /* @__PURE__ */ jsx("div", {
|
|
65
|
+
className: "sm:justify-self-center md:justify-self-end",
|
|
66
|
+
children: /* @__PURE__ */ jsx(Column, {
|
|
67
|
+
col,
|
|
68
|
+
lang
|
|
69
|
+
})
|
|
70
|
+
}, i))
|
|
71
|
+
}),
|
|
72
|
+
socialLinks && socialLinks.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
73
|
+
className: "md:col-start-2 md:row-start-2 md:justify-self-end",
|
|
74
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
75
|
+
className: "mx-auto mt-20 mb-12 grid w-fit gap-6 max-sm:grid-cols-3 sm:grid-flow-col",
|
|
76
|
+
children: socialLinks.map((link, i) => /* @__PURE__ */ jsx("a", {
|
|
77
|
+
className: `group mx-auto flex h-8 w-8 items-center justify-center
|
|
78
|
+
text-login-100 transition-all duration-200
|
|
79
|
+
${link.hoverClass ?? "hover:text-login-50"}`,
|
|
80
|
+
title: link.title,
|
|
81
|
+
href: link.href,
|
|
82
|
+
target: "_blank",
|
|
83
|
+
rel: "noreferrer",
|
|
84
|
+
children: link.icon
|
|
85
|
+
}, i))
|
|
86
|
+
})
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ jsxs("div", {
|
|
89
|
+
className: "mt-24 grid grid-cols-[auto_min-content] items-end gap-8 md:col-span-2 md:row-start-3",
|
|
90
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
91
|
+
className: "text-xs wrap-break-word text-login-100",
|
|
92
|
+
children: [
|
|
93
|
+
lang === "no" ? "Opphavsrett" : "Copyright",
|
|
94
|
+
" © ",
|
|
95
|
+
year,
|
|
96
|
+
" ",
|
|
97
|
+
t(copyright, lang)
|
|
98
|
+
]
|
|
99
|
+
}), version && /* @__PURE__ */ jsx(VersionTag, {
|
|
100
|
+
version: version.tag,
|
|
101
|
+
url: version.href
|
|
102
|
+
})]
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
export { Footer as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FooterColumn, FooterSocialLink } from "./footer.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/footer/loginContent.d.ts
|
|
4
|
+
declare const loginAddress: FooterColumn;
|
|
5
|
+
declare const loginEmail: (email: string) => FooterColumn;
|
|
6
|
+
declare const loginCopyright: {
|
|
7
|
+
readonly no: "Login - Linjeforeningen for IT, NO 811 940 372";
|
|
8
|
+
readonly en: "Login - Association for IT, NO 811 940 372";
|
|
9
|
+
};
|
|
10
|
+
declare const loginSponsor: {
|
|
11
|
+
readonly label: {
|
|
12
|
+
readonly no: "Hovedsamarbeidspartner";
|
|
13
|
+
readonly en: "Main partner";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
declare const loginSocialLinks: FooterSocialLink[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { type FooterSocialLink as LoginSocialLinkData, loginAddress, loginCopyright, loginEmail, loginSocialLinks, loginSponsor };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { Discord, Facebook, Github, Linkedin, Wikijs } from "../../icons/icons.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/footer/loginContent.tsx
|
|
5
|
+
const INSTAGRAM_PATH = "M512 960Q408 960 375.0 959.5Q342 959 301 957Q260 955 230.5 949.0Q201 943 177 933Q151 923 129.0 909.0Q107 895 86 874Q65 853 51.0 831.0Q37 809 27 783Q17 759 11.0 729.5Q5 700 3 659Q1 618 0.5 585.0Q0 552 0 448Q0 344 0.5 311.0Q1 278 3 237Q5 196 11.0 166.5Q17 137 27 113Q37 87 51.0 65.0Q65 43 86 22Q107 1 129.0 -13.0Q151 -27 177 -37Q201 -47 230.5 -53.0Q260 -59 301 -61Q342 -63 375.0 -63.5Q408 -64 512 -64Q616 -64 649.0 -63.5Q682 -63 723 -61Q764 -59 793.5 -53.0Q823 -47 847 -37Q873 -27 895.0 -13.0Q917 1 938 22Q959 43 973.0 65.0Q987 87 997 113Q1007 137 1013.0 166.5Q1019 196 1021 237Q1023 278 1023.5 311.0Q1024 344 1024 448Q1024 552 1023.5 585.0Q1023 618 1021 659Q1019 700 1013.0 729.5Q1007 759 997 783Q987 809 973.0 831.0Q959 853 938 874Q917 895 895.0 909.0Q873 923 847 933Q823 943 793.5 949.0Q764 955 723 957Q682 959 649.0 959.5Q616 960 512 960ZM512 868Q614 868 646.0 867.5Q678 867 719 865Q756 863 778.0 857.5Q800 852 814 847Q832 840 845.5 831.0Q859 822 873 809Q886 795 895.0 781.5Q904 768 911 750Q916 736 921.5 714.0Q927 692 929 655Q931 614 931.5 582.5Q932 551 932 448Q932 345 931.0 313.5Q930 282 929 241Q927 204 921.5 182.0Q916 160 911 146Q903 128 894.5 114.5Q886 101 872 87Q859 74 845.0 65.0Q831 56 813 49Q800 44 777.5 38.5Q755 33 718 31Q677 29 645.0 28.5Q613 28 511 28Q408 28 376.0 29.0Q344 30 303 31Q266 33 243.5 38.5Q221 44 208 49Q190 57 176.5 65.5Q163 74 149 88Q136 101 126.5 115.0Q117 129 111 147Q105 160 100.0 182.5Q95 205 93 242Q91 282 90.5 314.0Q90 346 90 449Q90 551 90.5 583.0Q91 615 93 656Q95 693 100.0 715.5Q105 738 111 751Q117 770 126.5 783.5Q136 797 149 810Q163 824 176.5 833.0Q190 842 208 849Q221 854 243.0 859.5Q265 865 303 867Q344 868 375.5 868.5Q407 869 510 869ZM512 711Q458 711 410 690Q362 670 326.0 634.0Q290 598 270 550Q249 502 249 448Q249 394 270 346Q290 298 326.0 262.0Q362 226 410 206Q458 185 512 185Q566 185 614 206Q662 226 698.0 262.0Q734 298 754 346Q775 394 775 448Q775 502 754 550Q734 598 698.0 634.0Q662 670 614 690Q566 711 512 711ZM512 277Q441 277 391.0 327.0Q341 377 341 448Q341 519 391.0 569.0Q441 619 512 619Q583 619 633.0 569.0Q683 519 683 448Q683 377 633.0 327.0Q583 277 512 277ZM847 721Q847 696 829.0 678.0Q811 660 785 660Q760 660 742.0 678.0Q724 696 724 721Q724 747 742.0 765.0Q760 783 785 783Q811 783 829.0 765.0Q847 747 847 721Z";
|
|
6
|
+
function InstagramIcon({ size = 24 }) {
|
|
7
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
8
|
+
className: "relative block",
|
|
9
|
+
style: {
|
|
10
|
+
width: size,
|
|
11
|
+
height: size
|
|
12
|
+
},
|
|
13
|
+
children: [/* @__PURE__ */ jsx("svg", {
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
viewBox: "0 0 1024 1024",
|
|
16
|
+
width: size,
|
|
17
|
+
height: size,
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
className: "absolute inset-0 transition-opacity duration-200 opacity-100 group-hover:opacity-0",
|
|
20
|
+
children: /* @__PURE__ */ jsx("g", {
|
|
21
|
+
transform: "translate(0 960) scale(1 -1)",
|
|
22
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
23
|
+
fill: "currentColor",
|
|
24
|
+
d: INSTAGRAM_PATH
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
}), /* @__PURE__ */ jsxs("svg", {
|
|
28
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
29
|
+
viewBox: "0 0 1024 1024",
|
|
30
|
+
width: size,
|
|
31
|
+
height: size,
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
className: "absolute inset-0 transition-opacity duration-200 opacity-0 group-hover:opacity-100",
|
|
34
|
+
children: [/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
|
|
35
|
+
id: "ig-grad",
|
|
36
|
+
x1: "0%",
|
|
37
|
+
y1: "100%",
|
|
38
|
+
x2: "100%",
|
|
39
|
+
y2: "0%",
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx("stop", {
|
|
42
|
+
offset: "0%",
|
|
43
|
+
stopColor: "#fff695"
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx("stop", {
|
|
46
|
+
offset: "45%",
|
|
47
|
+
stopColor: "#ff5445"
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ jsx("stop", {
|
|
50
|
+
offset: "60%",
|
|
51
|
+
stopColor: "#ff37c0"
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ jsx("stop", {
|
|
54
|
+
offset: "90%",
|
|
55
|
+
stopColor: "#3d6dff"
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
}) }), /* @__PURE__ */ jsx("g", {
|
|
59
|
+
transform: "translate(0 960) scale(1 -1)",
|
|
60
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
61
|
+
fill: "url(#ig-grad)",
|
|
62
|
+
d: INSTAGRAM_PATH
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const loginAddress = {
|
|
69
|
+
heading: {
|
|
70
|
+
no: "Adresse",
|
|
71
|
+
en: "Address"
|
|
72
|
+
},
|
|
73
|
+
items: [
|
|
74
|
+
{ label: "Teknologivegen 22" },
|
|
75
|
+
{ label: {
|
|
76
|
+
no: "Bygg A, rom 155",
|
|
77
|
+
en: "Building A, room 155"
|
|
78
|
+
} },
|
|
79
|
+
{ label: "2815 GJØVIK" }
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
const loginEmail = (email) => ({
|
|
83
|
+
heading: {
|
|
84
|
+
no: "E-post",
|
|
85
|
+
en: "Email"
|
|
86
|
+
},
|
|
87
|
+
items: [{
|
|
88
|
+
label: email,
|
|
89
|
+
href: `mailto:${email}`
|
|
90
|
+
}]
|
|
91
|
+
});
|
|
92
|
+
const loginCopyright = {
|
|
93
|
+
no: "Login - Linjeforeningen for IT, NO 811 940 372",
|
|
94
|
+
en: "Login - Association for IT, NO 811 940 372"
|
|
95
|
+
};
|
|
96
|
+
const loginSponsor = { label: {
|
|
97
|
+
no: "Hovedsamarbeidspartner",
|
|
98
|
+
en: "Main partner"
|
|
99
|
+
} };
|
|
100
|
+
const loginSocialLinks = [
|
|
101
|
+
{
|
|
102
|
+
title: "Discord",
|
|
103
|
+
href: "https://discord.gg/login-ntnu",
|
|
104
|
+
icon: /* @__PURE__ */ jsx(Discord, { size: 24 }),
|
|
105
|
+
hoverClass: "hover:text-[#6571fd]"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
title: "Instagram",
|
|
109
|
+
href: "https://www.instagram.com/login_linjeforening/",
|
|
110
|
+
icon: /* @__PURE__ */ jsx(InstagramIcon, { size: 24 })
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
title: "Facebook",
|
|
114
|
+
href: "https://facebook.com/LogNTNU",
|
|
115
|
+
icon: /* @__PURE__ */ jsx(Facebook, { size: 24 }),
|
|
116
|
+
hoverClass: "hover:text-[#2c87ff]"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
title: "LinkedIn",
|
|
120
|
+
href: "https://www.linkedin.com/company/linjeforeningen-login/about",
|
|
121
|
+
icon: /* @__PURE__ */ jsx(Linkedin, { size: 24 }),
|
|
122
|
+
hoverClass: "hover:text-[#1a7bdd]"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
title: "GitHub",
|
|
126
|
+
href: "https://github.com/login-linjeforeningen-for-it",
|
|
127
|
+
icon: /* @__PURE__ */ jsx(Github, { size: 24 }),
|
|
128
|
+
hoverClass: "hover:text-white"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
title: "Wiki",
|
|
132
|
+
href: "https://outline.login.no/s/doc",
|
|
133
|
+
icon: /* @__PURE__ */ jsx(Wikijs, { size: 24 }),
|
|
134
|
+
hoverClass: "hover:text-login-50"
|
|
135
|
+
}
|
|
136
|
+
];
|
|
137
|
+
//#endregion
|
|
138
|
+
export { loginAddress, loginCopyright, loginEmail, loginSocialLinks, loginSponsor };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/components/inputs/checkbox.d.ts
|
|
2
|
+
type CheckboxOption = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string | number;
|
|
5
|
+
};
|
|
6
|
+
type CheckboxProps = Omit<React.ComponentProps<'input'>, 'name' | 'onChange' | 'value'> & {
|
|
7
|
+
name: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
info?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
options: CheckboxOption[];
|
|
14
|
+
value?: (string | number)[];
|
|
15
|
+
onChange?: (value: (string | number)[]) => void;
|
|
16
|
+
textSize?: 'sm' | 'md';
|
|
17
|
+
};
|
|
18
|
+
declare function Checkbox(props: CheckboxProps): import("react").JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { CheckboxOption, CheckboxProps, Checkbox as default };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import InputLabel from "./shared/inputLabel.js";
|
|
3
|
+
import FieldWrapper from "./shared/fieldWrapper.js";
|
|
4
|
+
import "./shared/index.js";
|
|
5
|
+
import { Check } from "lucide-react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/inputs/checkbox.tsx
|
|
8
|
+
function Checkbox(props) {
|
|
9
|
+
const { options, onChange, value, label, description, error, info, name, className, textSize = "sm", ...rest } = props;
|
|
10
|
+
const selectedValues = Array.isArray(value) ? value : [];
|
|
11
|
+
return /* @__PURE__ */ jsx(FieldWrapper, {
|
|
12
|
+
label,
|
|
13
|
+
name,
|
|
14
|
+
required: rest.required,
|
|
15
|
+
info,
|
|
16
|
+
description,
|
|
17
|
+
error,
|
|
18
|
+
textSize,
|
|
19
|
+
className,
|
|
20
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: "flex flex-col gap-2",
|
|
22
|
+
children: options.map((option) => /* @__PURE__ */ jsx(CheckboxItem, {
|
|
23
|
+
name,
|
|
24
|
+
value: option.value,
|
|
25
|
+
label: option.label,
|
|
26
|
+
checked: selectedValues.includes(option.value),
|
|
27
|
+
disabled: rest.disabled,
|
|
28
|
+
onChange: (e) => {
|
|
29
|
+
if (!onChange) return;
|
|
30
|
+
const isChecked = e.target.checked;
|
|
31
|
+
let newValues = [...selectedValues];
|
|
32
|
+
if (isChecked) newValues.push(option.value);
|
|
33
|
+
else newValues = newValues.filter((v) => v !== option.value);
|
|
34
|
+
onChange(newValues);
|
|
35
|
+
},
|
|
36
|
+
className: "mb-0"
|
|
37
|
+
}, option.value))
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function CheckboxItem(props) {
|
|
42
|
+
const { name, label, error, ...inputProps } = props;
|
|
43
|
+
const id = inputProps.value ? `${name}-${inputProps.value}` : name;
|
|
44
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: "flex items-center gap-2",
|
|
46
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
47
|
+
className: "relative w-5 h-5 shrink-0",
|
|
48
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
49
|
+
...inputProps,
|
|
50
|
+
id,
|
|
51
|
+
name,
|
|
52
|
+
type: "checkbox",
|
|
53
|
+
className: `
|
|
54
|
+
peer appearance-none rounded border border-login-500 bg-login-500/50
|
|
55
|
+
checked:bg-login checked:border-login
|
|
56
|
+
focus:outline-none focus:ring-1 focus:ring-login/30
|
|
57
|
+
disabled:opacity-40 disabled:cursor-not-allowed
|
|
58
|
+
cursor-pointer transition-all duration-150
|
|
59
|
+
w-5 h-5 absolute inset-0
|
|
60
|
+
${error ? "border-red-500/70" : ""}
|
|
61
|
+
`
|
|
62
|
+
}), /* @__PURE__ */ jsx(Check, { className: `
|
|
63
|
+
absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2
|
|
64
|
+
w-3.5 h-3.5 pointer-events-none text-white opacity-0
|
|
65
|
+
peer-checked:opacity-100 transition-opacity duration-200
|
|
66
|
+
` })]
|
|
67
|
+
}), label && /* @__PURE__ */ jsx(InputLabel, {
|
|
68
|
+
label,
|
|
69
|
+
name,
|
|
70
|
+
disabled: inputProps.disabled,
|
|
71
|
+
className: "select-none cursor-pointer"
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { Checkbox as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/components/inputs/fileInput.d.ts
|
|
2
|
+
type FileInputProps = {
|
|
3
|
+
name: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
accept?: string;
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
onChange: (files: File[]) => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
declare function FileInput({
|
|
11
|
+
name,
|
|
12
|
+
label,
|
|
13
|
+
accept,
|
|
14
|
+
multiple,
|
|
15
|
+
onChange,
|
|
16
|
+
className
|
|
17
|
+
}: FileInputProps): import("react").JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { FileInput as default };
|