@gardenfi/garden-book 0.2.31 → 0.3.0-beta.2
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/BulletList/BulletList.d.ts +21 -0
- package/dist/BulletList/index.d.ts +2 -0
- package/dist/BulletList/index.js +31 -0
- package/dist/CardList/CardList.d.ts +32 -0
- package/dist/CardList/index.d.ts +2 -0
- package/dist/CardList/index.js +141 -0
- package/dist/Checkbox/Checkbox.js +7 -0
- package/dist/Checkbox/RadixCheckbox.d.ts +3 -0
- package/dist/Checkbox/RadixCheckbox.js +27 -0
- package/dist/Checkbox/index.d.ts +1 -0
- package/dist/Checkbox/index.js +4 -5
- package/dist/DashboardLayout/DashboardLayout.d.ts +23 -0
- package/dist/DashboardLayout/DashboardNavbar.d.ts +11 -0
- package/dist/DashboardLayout/DashboardNavbar.js +32 -0
- package/dist/DashboardLayout/DashboardSidebar.d.ts +30 -0
- package/dist/DashboardLayout/DashboardSidebar.js +139 -0
- package/dist/DashboardLayout/MobileMenu.d.ts +11 -0
- package/dist/DashboardLayout/MobileMenu.js +126 -0
- package/dist/DashboardLayout/PageHeader.d.ts +13 -0
- package/dist/DashboardLayout/PageHeader.js +47 -0
- package/dist/DashboardLayout/index.d.ts +10 -0
- package/dist/DashboardLayout/index.js +93 -0
- package/dist/DataTable/DataTable.d.ts +50 -0
- package/dist/DataTable/Table.d.ts +7 -0
- package/dist/DataTable/Table.js +57 -0
- package/dist/DataTable/index.d.ts +2 -0
- package/dist/DataTable/index.js +269 -0
- package/dist/DataTable/useAnimatedTable.d.ts +8 -0
- package/dist/DataTable/useAnimatedTable.js +44 -0
- package/dist/DirectionalIconHover/DirectionalIconHover.d.ts +12 -0
- package/dist/DirectionalIconHover/index.d.ts +2 -0
- package/dist/DirectionalIconHover/index.js +72 -0
- package/dist/EmptyState/EmptyState.d.ts +20 -0
- package/dist/EmptyState/index.d.ts +2 -0
- package/dist/EmptyState/index.js +35 -0
- package/dist/ErrorState/ErrorState.d.ts +17 -0
- package/dist/ErrorState/errorMessages.d.ts +2 -0
- package/dist/ErrorState/errorMessages.js +13 -0
- package/dist/ErrorState/index.d.ts +2 -0
- package/dist/ErrorState/index.js +37 -0
- package/dist/Field/Field.d.ts +14 -0
- package/dist/Field/index.d.ts +2 -0
- package/dist/Field/index.js +14 -0
- package/dist/HamburgerIcon/HamburgerIcon.d.ts +5 -0
- package/dist/HamburgerIcon/index.d.ts +2 -0
- package/dist/HamburgerIcon/index.js +47 -0
- package/dist/InfoTooltip/InfoTooltip.d.ts +22 -0
- package/dist/InfoTooltip/index.d.ts +2 -0
- package/dist/InfoTooltip/index.js +81 -0
- package/dist/Input/Input.d.ts +19 -0
- package/dist/Input/index.d.ts +2 -0
- package/dist/Input/index.js +113 -0
- package/dist/Logo/index.d.ts +0 -1
- package/dist/Logo/index.js +8 -10
- package/dist/OTPInput/OTPInput.d.ts +11 -0
- package/dist/OTPInput/index.d.ts +2 -0
- package/dist/OTPInput/index.js +88 -0
- package/dist/Pagination/Pagination.d.ts +16 -0
- package/dist/Pagination/index.d.ts +2 -0
- package/dist/Pagination/index.js +111 -0
- package/dist/Portal/Portal.d.ts +8 -0
- package/dist/Portal/index.d.ts +2 -0
- package/dist/Portal/index.js +11 -0
- package/dist/ResponsiveModal/ResponsiveModal.d.ts +14 -0
- package/dist/ResponsiveModal/index.d.ts +2 -0
- package/dist/ResponsiveModal/index.js +62 -0
- package/dist/SelectDropdown/SelectDropdown.d.ts +41 -0
- package/dist/SelectDropdown/index.d.ts +2 -0
- package/dist/SelectDropdown/index.js +195 -0
- package/dist/Skeleton/Skeleton.d.ts +3 -0
- package/dist/Skeleton/index.d.ts +2 -0
- package/dist/Skeleton/index.js +12 -0
- package/dist/StatCard/StatCard.d.ts +20 -0
- package/dist/StatCard/index.d.ts +2 -0
- package/dist/StatCard/index.js +42 -0
- package/dist/StateContainer/StateContainer.d.ts +8 -0
- package/dist/StateContainer/index.d.ts +2 -0
- package/dist/StateContainer/index.js +15 -0
- package/dist/StatusChip/StatusChip.d.ts +11 -0
- package/dist/StatusChip/index.d.ts +2 -0
- package/dist/StatusChip/index.js +33 -0
- package/dist/Switch/Switch.d.ts +3 -0
- package/dist/Switch/index.d.ts +1 -0
- package/dist/Switch/index.js +31 -0
- package/dist/Toast/Toast.d.ts +15 -0
- package/dist/Toast/Toast.js +93 -0
- package/dist/Toast/Toaster.d.ts +5 -0
- package/dist/Toast/Toaster.js +30 -0
- package/dist/Toast/index.d.ts +5 -0
- package/dist/Toast/index.js +16 -0
- package/dist/Toast/useToast.d.ts +46 -0
- package/dist/Toast/useToast.js +76 -0
- package/dist/ToggleGroup/ToggleGroup.d.ts +15 -0
- package/dist/ToggleGroup/index.d.ts +2 -0
- package/dist/ToggleGroup/index.js +57 -0
- package/dist/Typography/Typography.d.ts +2 -2
- package/dist/Viewport/Viewport.d.ts +11 -0
- package/dist/Viewport/index.d.ts +2 -0
- package/dist/Viewport/index.js +7 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +386 -314
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +532 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +403 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +232 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +251 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +48 -0
- package/dist/node_modules/@radix-ui/{react-slot → react-collection/node_modules/@radix-ui/react-slot}/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +29 -26
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +208 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +624 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +221 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +183 -0
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +132 -0
- package/dist/node_modules/@radix-ui/react-toast/dist/index.js +446 -0
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +330 -0
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +8 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +32 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +40 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-down.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +13 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/eye-off.js +28 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/eye.js +20 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/log-out.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/x.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +11 -0
- package/dist/style.css +1 -1
- package/package.json +12 -3
- package/dist/Logo/Code4renaLogo.d.ts +0 -5
- package/dist/Logo/Code4renaLogo.js +0 -45
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type TypographySize = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
4
|
+
type TypographyWeight = "regular" | "medium" | "semibold" | "bold";
|
|
5
|
+
export type BulletListProps = {
|
|
6
|
+
items: ReactNode[];
|
|
7
|
+
/** Optional title rendered above the list. */
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
size?: TypographySize;
|
|
11
|
+
weight?: TypographyWeight;
|
|
12
|
+
/** Tailwind class applied to each item's typography. */
|
|
13
|
+
itemClassName?: string;
|
|
14
|
+
/** Tailwind class applied to the title typography. */
|
|
15
|
+
titleClassName?: string;
|
|
16
|
+
/** Tailwind gap class between items. Defaults to `gf-gap-3`. */
|
|
17
|
+
gapClassName?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Bulleted list with optional title. Each item gets a circular iris dot. */
|
|
20
|
+
export declare const BulletList: ({ items, title, className, size, weight, itemClassName, titleClassName, gapClassName, }: BulletListProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { Typography as g } from "../Typography/index.js";
|
|
3
|
+
import { cn as s } from "../utils/index.js";
|
|
4
|
+
const y = ({
|
|
5
|
+
items: a,
|
|
6
|
+
title: e,
|
|
7
|
+
className: i,
|
|
8
|
+
size: m = "h5",
|
|
9
|
+
weight: t = "regular",
|
|
10
|
+
itemClassName: c = "gf-text-primaryIris",
|
|
11
|
+
titleClassName: n = "gf-text-primaryIris",
|
|
12
|
+
gapClassName: o = "gf-gap-3"
|
|
13
|
+
}) => {
|
|
14
|
+
const f = /* @__PURE__ */ r("ul", { className: s("gf-flex gf-flex-col", o), children: a.map((p, d) => /* @__PURE__ */ l("li", { className: "gf-flex gf-items-start gf-gap-3", children: [
|
|
15
|
+
/* @__PURE__ */ r(
|
|
16
|
+
"span",
|
|
17
|
+
{
|
|
18
|
+
className: "gf-mt-1.5 gf-inline-block gf-h-1.5 gf-w-1.5 gf-rounded-full gf-bg-primaryIris gf-shrink-0",
|
|
19
|
+
"aria-hidden": "true"
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
/* @__PURE__ */ r(g, { size: m, weight: t, className: c, children: p })
|
|
23
|
+
] }, d)) });
|
|
24
|
+
return e ? /* @__PURE__ */ l("div", { className: s("gf-flex gf-flex-col gf-gap-3", i), children: [
|
|
25
|
+
/* @__PURE__ */ r(g, { size: "h5", weight: "medium", className: n, children: e }),
|
|
26
|
+
f
|
|
27
|
+
] }) : /* @__PURE__ */ r("div", { className: i, children: f });
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
y as BulletList
|
|
31
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type CardListColumn<T> = {
|
|
4
|
+
key: string;
|
|
5
|
+
header: string;
|
|
6
|
+
align?: "left" | "right";
|
|
7
|
+
cell: (row: T) => ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export type CardListProps<T> = {
|
|
10
|
+
rows: T[];
|
|
11
|
+
columns: CardListColumn<T>[];
|
|
12
|
+
getKey: (row: T, index: number) => string;
|
|
13
|
+
/** Min height of the loading / empty / error content area. */
|
|
14
|
+
emptyMinHeight?: number | string;
|
|
15
|
+
/** Slot rendered when `error` is truthy. */
|
|
16
|
+
error?: ReactNode;
|
|
17
|
+
/** Slot rendered when there are no rows. */
|
|
18
|
+
empty?: ReactNode;
|
|
19
|
+
/** Custom card renderer. Falls back to a label/value list using `columns`. */
|
|
20
|
+
renderCard?: (row: T, index: number) => ReactNode;
|
|
21
|
+
renderExpanded?: (row: T, index: number) => ReactNode;
|
|
22
|
+
/** Called when a non-expandable row is clicked. */
|
|
23
|
+
onRowClick?: (row: T, index: number) => void;
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
skeletonRowCount?: number;
|
|
26
|
+
/** Extra content rendered below the list (e.g. pagination). */
|
|
27
|
+
footer?: ReactNode;
|
|
28
|
+
oddRowColor?: string;
|
|
29
|
+
evenRowColor?: string;
|
|
30
|
+
className?: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const CardList: <T>({ rows, columns, getKey, emptyMinHeight, error, empty, renderCard, renderExpanded, onRowClick, loading, skeletonRowCount, footer, oddRowColor, evenRowColor, className }: CardListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import { useState as G } from "react";
|
|
3
|
+
import { AnimatePresence as H, motion as L } from "framer-motion";
|
|
4
|
+
import { Typography as O } from "../Typography/index.js";
|
|
5
|
+
import { cn as n } from "../utils/index.js";
|
|
6
|
+
const B = ({
|
|
7
|
+
rows: o,
|
|
8
|
+
columns: p,
|
|
9
|
+
getKey: K,
|
|
10
|
+
emptyMinHeight: h = "40dvh",
|
|
11
|
+
error: y,
|
|
12
|
+
empty: D,
|
|
13
|
+
renderCard: r,
|
|
14
|
+
renderExpanded: c,
|
|
15
|
+
onRowClick: i,
|
|
16
|
+
loading: E = !1,
|
|
17
|
+
skeletonRowCount: A = 6,
|
|
18
|
+
footer: x,
|
|
19
|
+
oddRowColor: v = "#f5f8fa",
|
|
20
|
+
evenRowColor: u = "#ebf0f5",
|
|
21
|
+
className: I
|
|
22
|
+
}) => {
|
|
23
|
+
const t = !!c, S = o.length === 0, s = E ? "loading" : y ? "error" : S ? "empty" : "data", [k, z] = G(null), b = (l) => z((a) => a === l ? null : l);
|
|
24
|
+
return /* @__PURE__ */ d("div", { className: n("gf-rounded-2xl gf-overflow-hidden", I), children: [
|
|
25
|
+
s === "loading" && /* @__PURE__ */ e("div", { className: "gf-flex gf-flex-col", children: Array.from({ length: A }).map((l, a) => /* @__PURE__ */ e(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: "last:gf-border-0 gf-py-4 gf-px-4 gf-flex gf-flex-col gf-gap-1",
|
|
29
|
+
style: { backgroundColor: a % 2 === 0 ? v : u },
|
|
30
|
+
children: p.map((g) => /* @__PURE__ */ e(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: "gf-flex gf-items-center gf-justify-between gf-gap-2",
|
|
34
|
+
children: /* @__PURE__ */ e("div", { className: "gf-h-3 gf-w-full gf-rounded gf-animate-pulse gf-bg-gray-200" })
|
|
35
|
+
},
|
|
36
|
+
g.key
|
|
37
|
+
))
|
|
38
|
+
},
|
|
39
|
+
a
|
|
40
|
+
)) }),
|
|
41
|
+
s === "error" && /* @__PURE__ */ e(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: "gf-flex gf-items-center gf-justify-center",
|
|
45
|
+
style: { minHeight: h },
|
|
46
|
+
children: y
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
s === "empty" && /* @__PURE__ */ e(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: "gf-flex gf-items-center gf-justify-center",
|
|
53
|
+
style: { minHeight: h },
|
|
54
|
+
children: D
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
s === "data" && /* @__PURE__ */ d(F, { children: [
|
|
58
|
+
/* @__PURE__ */ e(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: n(
|
|
62
|
+
"gf-flex gf-flex-col",
|
|
63
|
+
r && "[&>div:nth-child(odd)]:gf-bg-white/50"
|
|
64
|
+
),
|
|
65
|
+
children: o.map((l, a) => {
|
|
66
|
+
const g = K(l, a), m = t && k === g, N = t ? () => b(g) : i ? () => i(l, a) : void 0, j = t ? (f) => {
|
|
67
|
+
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), b(g));
|
|
68
|
+
} : i ? (f) => {
|
|
69
|
+
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), i(l, a));
|
|
70
|
+
} : void 0;
|
|
71
|
+
return r ? /* @__PURE__ */ e(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: n((t || i) && "gf-cursor-pointer"),
|
|
75
|
+
onClick: N,
|
|
76
|
+
role: t || i ? "button" : void 0,
|
|
77
|
+
tabIndex: t || i ? 0 : void 0,
|
|
78
|
+
onKeyDown: j,
|
|
79
|
+
"aria-expanded": t ? m : void 0,
|
|
80
|
+
children: r(l, a)
|
|
81
|
+
},
|
|
82
|
+
g
|
|
83
|
+
) : /* @__PURE__ */ d(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
className: n(
|
|
87
|
+
"gf-border-b gf-border-gray-100 last:gf-border-0 gf-py-3 gf-px-4 gf-flex gf-flex-col gf-gap-2",
|
|
88
|
+
(t || i) && "gf-cursor-pointer"
|
|
89
|
+
),
|
|
90
|
+
style: { backgroundColor: a % 2 === 0 ? v : u },
|
|
91
|
+
onClick: N,
|
|
92
|
+
role: t || i ? "button" : void 0,
|
|
93
|
+
tabIndex: t || i ? 0 : void 0,
|
|
94
|
+
onKeyDown: j,
|
|
95
|
+
"aria-expanded": t ? m : void 0,
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ e("div", { className: "gf-flex gf-flex-col gf-gap-1", children: p.map((f) => /* @__PURE__ */ d(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
className: "gf-flex gf-items-center gf-justify-between gf-gap-2",
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ e(
|
|
103
|
+
O,
|
|
104
|
+
{
|
|
105
|
+
size: "h5",
|
|
106
|
+
weight: "regular",
|
|
107
|
+
className: "gf-text-midGrey",
|
|
108
|
+
children: f.header
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ e("div", { className: "gf-min-w-0 gf-flex gf-items-center gf-justify-end", children: f.cell(l) })
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
f.key
|
|
115
|
+
)) }),
|
|
116
|
+
/* @__PURE__ */ e(H, { initial: !1, children: m && c && /* @__PURE__ */ e(
|
|
117
|
+
L.div,
|
|
118
|
+
{
|
|
119
|
+
initial: { height: 0, opacity: 0 },
|
|
120
|
+
animate: { height: "auto", opacity: 1 },
|
|
121
|
+
exit: { height: 0, opacity: 0 },
|
|
122
|
+
transition: { duration: 0.3, ease: "easeOut" },
|
|
123
|
+
className: "gf-overflow-hidden",
|
|
124
|
+
children: /* @__PURE__ */ e("div", { className: "gf-pt-2", children: c(l, a) })
|
|
125
|
+
},
|
|
126
|
+
`${g}-exp`
|
|
127
|
+
) })
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
g
|
|
131
|
+
);
|
|
132
|
+
})
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
x && /* @__PURE__ */ e("div", { className: "gf-px-4 sm:gf-px-6 gf-pb-4", children: x })
|
|
136
|
+
] })
|
|
137
|
+
] });
|
|
138
|
+
};
|
|
139
|
+
export {
|
|
140
|
+
B as CardList
|
|
141
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Checked as m } from "../Icons/Checked.js";
|
|
3
|
+
import { Unchecked as s } from "../Icons/Unchecked.js";
|
|
4
|
+
const p = ({ checked: o, color: e, ...c }) => /* @__PURE__ */ r("div", { ...c, children: o ? /* @__PURE__ */ r(m, { className: "gf-cursor-pointer", color: e }) : /* @__PURE__ */ r(s, { className: "gf-cursor-pointer" }) });
|
|
5
|
+
export {
|
|
6
|
+
p as CheckBox
|
|
7
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { Checkbox as f, CheckboxIndicator as a } from "../node_modules/@radix-ui/react-checkbox/dist/index.js";
|
|
4
|
+
import { cn as r } from "../utils/index.js";
|
|
5
|
+
import c from "../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
6
|
+
const g = t.forwardRef(({ className: i, ...o }, s) => /* @__PURE__ */ e(
|
|
7
|
+
f,
|
|
8
|
+
{
|
|
9
|
+
ref: s,
|
|
10
|
+
className: r(
|
|
11
|
+
"gf-h-4 gf-w-4 gf-shrink-0 gf-rounded-full gf-border gf-border-primaryIris focus-visible:gf-outline-none focus-visible:gf-ring-2 focus-visible:gf-ring-primaryIris focus-visible:gf-ring-offset-2 disabled:gf-cursor-not-allowed disabled:gf-opacity-50 data-[state=checked]:gf-bg-primaryIris data-[state=checked]:gf-text-white",
|
|
12
|
+
i
|
|
13
|
+
),
|
|
14
|
+
...o,
|
|
15
|
+
children: /* @__PURE__ */ e(
|
|
16
|
+
a,
|
|
17
|
+
{
|
|
18
|
+
className: r("gf-flex gf-items-center gf-justify-center gf-text-current"),
|
|
19
|
+
children: /* @__PURE__ */ e(c, { className: "gf-h-4 gf-w-4" })
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
));
|
|
24
|
+
g.displayName = f.displayName;
|
|
25
|
+
export {
|
|
26
|
+
g as Checkbox
|
|
27
|
+
};
|
package/dist/Checkbox/index.d.ts
CHANGED
package/dist/Checkbox/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Unchecked as s } from "../Icons/Unchecked.js";
|
|
4
|
-
const p = ({ checked: o, color: e, ...c }) => /* @__PURE__ */ r("div", { ...c, children: o ? /* @__PURE__ */ r(m, { className: "gf-cursor-pointer", color: e }) : /* @__PURE__ */ r(s, { className: "gf-cursor-pointer" }) });
|
|
1
|
+
import { CheckBox as r } from "./Checkbox.js";
|
|
2
|
+
import { Checkbox as c } from "./RadixCheckbox.js";
|
|
5
3
|
export {
|
|
6
|
-
|
|
4
|
+
r as CheckBox,
|
|
5
|
+
c as Checkbox
|
|
7
6
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { NavGroup, SidebarUser } from './DashboardSidebar';
|
|
3
|
+
|
|
4
|
+
export type DashboardLayoutProps = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
pageTitle: string;
|
|
7
|
+
pageDescription?: string;
|
|
8
|
+
pageCompactDescription?: string;
|
|
9
|
+
pageWidgets?: ReactNode;
|
|
10
|
+
headerAction?: ReactNode;
|
|
11
|
+
navGroups: NavGroup[];
|
|
12
|
+
activePath: string;
|
|
13
|
+
logo: ReactNode;
|
|
14
|
+
logoHref?: string;
|
|
15
|
+
user: SidebarUser;
|
|
16
|
+
onLogout: () => void;
|
|
17
|
+
showLogoutConfirm?: boolean;
|
|
18
|
+
onLogoutConfirmClose?: () => void;
|
|
19
|
+
onNavigate: (href: string) => void;
|
|
20
|
+
renderLink?: (href: string, children: ReactNode) => ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const DashboardLayout: ({ children, pageTitle, pageDescription, pageCompactDescription, pageWidgets, headerAction, navGroups, activePath, logo, logoHref, user, onLogout, showLogoutConfirm, onLogoutConfirmClose, onNavigate, renderLink, className, }: DashboardLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type DashboardNavbarProps = {
|
|
4
|
+
logo: ReactNode;
|
|
5
|
+
logoHref?: string;
|
|
6
|
+
menuSlot: ReactNode;
|
|
7
|
+
/** Force the scrolled appearance — useful for stories. */
|
|
8
|
+
initialScrolled?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const DashboardNavbar: ({ logo, logoHref, menuSlot, initialScrolled, className, }: DashboardNavbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useEffect as d } from "react";
|
|
3
|
+
import { cn as g } from "../utils/index.js";
|
|
4
|
+
const u = ({
|
|
5
|
+
logo: e,
|
|
6
|
+
logoHref: t,
|
|
7
|
+
menuSlot: s,
|
|
8
|
+
initialScrolled: o = !1,
|
|
9
|
+
className: n
|
|
10
|
+
}) => {
|
|
11
|
+
const [a, f] = c(o);
|
|
12
|
+
return d(() => {
|
|
13
|
+
const r = () => f(window.scrollY > 0);
|
|
14
|
+
return r(), window.addEventListener("scroll", r, { passive: !0 }), () => window.removeEventListener("scroll", r);
|
|
15
|
+
}, []), /* @__PURE__ */ i(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: g(
|
|
19
|
+
"gf-sticky gf-top-0 gf-z-50 gf-flex gf-items-center gf-justify-between gf-px-4 gf-py-3 gf-transition-colors gf-duration-300",
|
|
20
|
+
a ? "gf-bg-white/50 gf-backdrop-blur-xl" : "gf-bg-transparent",
|
|
21
|
+
n
|
|
22
|
+
),
|
|
23
|
+
children: [
|
|
24
|
+
t ? /* @__PURE__ */ l("a", { href: t, "aria-label": "Dashboard", children: e }) : e,
|
|
25
|
+
s
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
u as DashboardNavbar
|
|
32
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type NavItem = {
|
|
2
|
+
title: string;
|
|
3
|
+
href: string;
|
|
4
|
+
icon: React.ComponentType<{
|
|
5
|
+
className?: string;
|
|
6
|
+
}>;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type NavGroup = {
|
|
10
|
+
label?: string;
|
|
11
|
+
items: NavItem[];
|
|
12
|
+
};
|
|
13
|
+
export type SidebarUser = {
|
|
14
|
+
displayName: string;
|
|
15
|
+
initial: string;
|
|
16
|
+
avatarUrl?: string;
|
|
17
|
+
};
|
|
18
|
+
export type DashboardSidebarProps = {
|
|
19
|
+
navGroups: NavGroup[];
|
|
20
|
+
activePath: string;
|
|
21
|
+
logo: React.ReactNode;
|
|
22
|
+
logoHref?: string;
|
|
23
|
+
user: SidebarUser;
|
|
24
|
+
onLogout: () => void;
|
|
25
|
+
showLogoutConfirm?: boolean;
|
|
26
|
+
onLogoutConfirmClose?: () => void;
|
|
27
|
+
renderLink?: (href: string, children: React.ReactNode) => React.ReactNode;
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare const DashboardSidebar: ({ navGroups, activePath, logo, logoHref, user, onLogout, showLogoutConfirm, onLogoutConfirmClose, renderLink, className, }: DashboardSidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { jsxs as r, Fragment as F, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v } from "react";
|
|
3
|
+
import { Root as M, Trigger as j, Portal as z, Content as D, Item as O } from "../node_modules/@radix-ui/react-dropdown-menu/dist/index.js";
|
|
4
|
+
import { Typography as o } from "../Typography/index.js";
|
|
5
|
+
import { Button as R } from "../Button/index.js";
|
|
6
|
+
import { ResponsiveModal as S } from "../ResponsiveModal/index.js";
|
|
7
|
+
import { cn as a } from "../utils/index.js";
|
|
8
|
+
import E from "../node_modules/lucide-react/dist/esm/icons/chevron-up.js";
|
|
9
|
+
import U from "../node_modules/lucide-react/dist/esm/icons/log-out.js";
|
|
10
|
+
const T = (t, i) => /* @__PURE__ */ e("a", { href: t, children: i }), Q = ({
|
|
11
|
+
navGroups: t,
|
|
12
|
+
activePath: i,
|
|
13
|
+
logo: d,
|
|
14
|
+
logoHref: c,
|
|
15
|
+
user: g,
|
|
16
|
+
onLogout: m,
|
|
17
|
+
showLogoutConfirm: y = !1,
|
|
18
|
+
onLogoutConfirmClose: s,
|
|
19
|
+
renderLink: h = T,
|
|
20
|
+
className: N
|
|
21
|
+
}) => {
|
|
22
|
+
const [p, u] = v(!1), [w, l] = v(!1), I = () => {
|
|
23
|
+
u(!1), y ? l(!0) : m();
|
|
24
|
+
}, k = () => {
|
|
25
|
+
l(!1), s == null || s();
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ r(F, { children: [
|
|
28
|
+
/* @__PURE__ */ r(
|
|
29
|
+
"aside",
|
|
30
|
+
{
|
|
31
|
+
className: a(
|
|
32
|
+
"gf-flex gf-flex-col gf-h-screen gf-bg-white/70 gf-backdrop-blur-sm gf-z-20 gf-shrink-0 gf-w-64",
|
|
33
|
+
N
|
|
34
|
+
),
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ e("div", { className: "gf-border-b gf-border-primaryMist gf-p-3.5 gf-mt-1 gf-overflow-hidden", children: c ? h(c, /* @__PURE__ */ e("div", { className: "gf-flex gf-items-center gf-gap-3", children: d })) : /* @__PURE__ */ e("div", { className: "gf-flex gf-items-center gf-gap-3", children: d }) }),
|
|
37
|
+
/* @__PURE__ */ e("div", { className: "gf-flex-1 gf-overflow-y-auto", children: t.map((n, C) => /* @__PURE__ */ r("div", { className: "gf-px-2 gf-pt-2", children: [
|
|
38
|
+
n.label && /* @__PURE__ */ e("div", { className: "gf-px-2 gf-pb-1", children: /* @__PURE__ */ e(o, { size: "h5", weight: "regular", className: "gf-text-midGrey", children: n.label }) }),
|
|
39
|
+
/* @__PURE__ */ e("div", { className: "gf-space-y-1", children: n.items.map((f) => {
|
|
40
|
+
const x = i === f.href || i === `${f.href}/`, b = /* @__PURE__ */ r(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: a(
|
|
44
|
+
"gf-flex gf-items-center gf-gap-2 gf-rounded-lg gf-px-2 gf-py-2 gf-transition-all gf-duration-200 gf-w-full",
|
|
45
|
+
x ? "gf-bg-primaryMist gf-text-primaryIris gf-shadow-sm" : "gf-text-primaryIris hover:gf-bg-gray-100",
|
|
46
|
+
f.disabled && "gf-opacity-40 gf-pointer-events-none"
|
|
47
|
+
),
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ e(f.icon, { className: "gf-h-5 gf-w-5 gf-shrink-0" }),
|
|
50
|
+
/* @__PURE__ */ e(o, { size: "h4", weight: x ? "medium" : "regular", children: f.title })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
return /* @__PURE__ */ e("div", { className: a(f.disabled && "gf-pointer-events-none"), children: f.disabled ? b : h(f.href, b) }, f.href);
|
|
55
|
+
}) })
|
|
56
|
+
] }, C)) }),
|
|
57
|
+
/* @__PURE__ */ e("div", { className: "gf-border-t gf-border-primaryMist gf-mb-2 gf-mt-auto gf-p-1.5", children: /* @__PURE__ */ r(M, { open: p, onOpenChange: u, modal: !1, children: [
|
|
58
|
+
/* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ r(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
type: "button",
|
|
62
|
+
className: a(
|
|
63
|
+
"gf-w-full gf-flex gf-items-center gf-gap-3 gf-px-2.5 gf-py-0 gf-rounded-lg hover:gf-bg-gray-50 gf-transition-all gf-duration-150 gf-ease-in-out gf-group focus:gf-outline-none focus-visible:gf-outline-none focus:gf-ring-0"
|
|
64
|
+
),
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ e("div", { className: "gf-flex gf-items-center gf-justify-center gf-w-9 gf-h-9 gf-rounded-full gf-bg-primaryMist gf-shrink-0", children: g.avatarUrl ? /* @__PURE__ */ e(
|
|
67
|
+
"img",
|
|
68
|
+
{
|
|
69
|
+
src: g.avatarUrl,
|
|
70
|
+
alt: g.displayName,
|
|
71
|
+
className: "gf-w-full gf-h-full gf-rounded-full gf-object-cover"
|
|
72
|
+
}
|
|
73
|
+
) : /* @__PURE__ */ e("p", { className: "gf-text-sm gf-font-medium gf-text-primaryIris", children: g.initial }) }),
|
|
74
|
+
/* @__PURE__ */ e("div", { className: "gf-flex-1 gf-text-left gf-overflow-hidden", children: /* @__PURE__ */ e("p", { className: "gf-text-sm gf-font-normal gf-text-primaryIris gf-truncate", children: g.displayName }) }),
|
|
75
|
+
/* @__PURE__ */ e(
|
|
76
|
+
E,
|
|
77
|
+
{
|
|
78
|
+
className: a(
|
|
79
|
+
"gf-h-4 gf-w-4 gf-text-primaryIris gf-transition-transform gf-duration-150 gf-ease-in-out gf-shrink-0",
|
|
80
|
+
p && "gf-rotate-180"
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
) }),
|
|
87
|
+
/* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(
|
|
88
|
+
D,
|
|
89
|
+
{
|
|
90
|
+
align: "start",
|
|
91
|
+
side: "top",
|
|
92
|
+
sideOffset: 6,
|
|
93
|
+
className: "gf-z-50 gf-p-2 gf-bg-white/70 gf-border gf-border-primaryMist gf-rounded-xl gf-mb-1.5",
|
|
94
|
+
style: { width: "var(--radix-dropdown-menu-trigger-width)" },
|
|
95
|
+
children: /* @__PURE__ */ r(
|
|
96
|
+
O,
|
|
97
|
+
{
|
|
98
|
+
onSelect: I,
|
|
99
|
+
className: "gf-flex gf-items-center gf-gap-1 gf-p-1 gf-cursor-pointer hover:gf-bg-[#EDF6FC] focus:gf-bg-[#EDF6FC] data-[highlighted]:gf-bg-[#EDF6FC] gf-rounded-md gf-transition-colors focus:gf-outline-none",
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ e("div", { className: "gf-rounded-lg gf-flex gf-items-center gf-justify-center gf-shrink-0", children: /* @__PURE__ */ e(U, { className: "gf-h-4 gf-w-4 gf-text-primaryIris gf-ml-[14px] gf-mr-2" }) }),
|
|
102
|
+
/* @__PURE__ */ e("div", { className: "gf-flex-1 gf-min-w-0", children: /* @__PURE__ */ e("p", { className: "gf-font-normal gf-text-primaryIris gf-truncate gf-text-sm", children: "Log out" }) })
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
) })
|
|
108
|
+
] }) })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ r(
|
|
113
|
+
S,
|
|
114
|
+
{
|
|
115
|
+
open: w,
|
|
116
|
+
onClose: k,
|
|
117
|
+
label: "Ready to sign out?",
|
|
118
|
+
className: "gf-max-w-sm",
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ e(o, { size: "h5", weight: "regular", children: "You'll be signed out and redirected to the login page." }),
|
|
121
|
+
/* @__PURE__ */ e(
|
|
122
|
+
R,
|
|
123
|
+
{
|
|
124
|
+
variant: "primary",
|
|
125
|
+
className: "gf-w-full",
|
|
126
|
+
onClick: () => {
|
|
127
|
+
l(!1), m();
|
|
128
|
+
},
|
|
129
|
+
children: "Sign out"
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] });
|
|
136
|
+
};
|
|
137
|
+
export {
|
|
138
|
+
Q as DashboardSidebar
|
|
139
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NavGroup } from './DashboardSidebar';
|
|
2
|
+
|
|
3
|
+
export type MobileMenuProps = {
|
|
4
|
+
navGroups: NavGroup[];
|
|
5
|
+
activePath: string;
|
|
6
|
+
onNavigate: (href: string) => void;
|
|
7
|
+
onLogout: () => void;
|
|
8
|
+
showLogoutConfirm?: boolean;
|
|
9
|
+
onLogoutConfirmClose?: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const MobileMenu: ({ navGroups, activePath, onNavigate, onLogout, showLogoutConfirm, onLogoutConfirmClose, }: MobileMenuProps) => import("react/jsx-runtime").JSX.Element;
|