@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,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type DeltaTone = "positive" | "negative" | "neutral";
|
|
4
|
+
export type StatCardProps = {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
/** Reserve a skeleton slot for the change line while `loading` is true. */
|
|
9
|
+
hasChangeSlot?: boolean;
|
|
10
|
+
change?: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
tone: DeltaTone;
|
|
14
|
+
};
|
|
15
|
+
/** Subtitle rendered under the value when no `change` is provided. */
|
|
16
|
+
description?: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Metric card showing a label, value, optional change row (with tone), and a loading skeleton. */
|
|
20
|
+
export declare const StatCard: ({ label, value, loading, hasChangeSlot, change, description, className, }: StatCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Typography as f } from "../Typography/index.js";
|
|
3
|
+
import { cn as c } from "../utils/index.js";
|
|
4
|
+
const h = {
|
|
5
|
+
positive: "gf-text-primaryGreen",
|
|
6
|
+
negative: "gf-text-primaryPink",
|
|
7
|
+
neutral: "gf-text-midGrey"
|
|
8
|
+
}, x = ({
|
|
9
|
+
label: t,
|
|
10
|
+
value: m,
|
|
11
|
+
loading: g,
|
|
12
|
+
hasChangeSlot: a,
|
|
13
|
+
change: r,
|
|
14
|
+
description: i,
|
|
15
|
+
className: l
|
|
16
|
+
}) => {
|
|
17
|
+
const d = !!(r || i || a);
|
|
18
|
+
return /* @__PURE__ */ s(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
className: c(
|
|
22
|
+
"gf-bg-white/30 gf-rounded-xl gf-p-3 md:gf-p-4 gf-flex gf-flex-col gf-gap-4",
|
|
23
|
+
l
|
|
24
|
+
),
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ s("div", { className: "gf-flex gf-flex-col gf-gap-1.5", children: [
|
|
27
|
+
/* @__PURE__ */ e(f, { size: "h5", weight: "regular", children: t }),
|
|
28
|
+
g ? /* @__PURE__ */ e("div", { className: "gf-h-7 gf-w-14 sm:gf-w-20 gf-bg-primaryMist/90 gf-rounded-md gf-animate-pulse" }) : /* @__PURE__ */ e(f, { size: "h4", weight: "medium", className: "sm:gf-text-xl", children: m })
|
|
29
|
+
] }),
|
|
30
|
+
g && d && /* @__PURE__ */ e("div", { className: "gf-h-4 gf-w-24 sm:gf-w-32 gf-bg-primaryMist/90 gf-rounded-md gf-animate-pulse" }),
|
|
31
|
+
r && !g && /* @__PURE__ */ s("div", { className: "gf-flex gf-items-center gf-gap-1.5", children: [
|
|
32
|
+
/* @__PURE__ */ e(f, { size: "h5", weight: "regular", className: "gf-text-midGrey", children: r.label }),
|
|
33
|
+
/* @__PURE__ */ e(f, { size: "h5", weight: "medium", className: h[r.tone], children: r.value })
|
|
34
|
+
] }),
|
|
35
|
+
!r && !g && i && /* @__PURE__ */ e(f, { size: "h5", weight: "regular", className: "gf-text-midGrey", children: i })
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
x as StatCard
|
|
42
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type StateContainerProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
/** Full-height centered container with a frosted card shell. Used by EmptyState and ErrorState. */
|
|
8
|
+
export declare const StateContainer: ({ children, className }: StateContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { cn as t } from "../utils/index.js";
|
|
3
|
+
const i = ({ children: e, className: g }) => /* @__PURE__ */ f(
|
|
4
|
+
"div",
|
|
5
|
+
{
|
|
6
|
+
className: t(
|
|
7
|
+
"gf-flex gf-items-center gf-justify-center gf-w-full gf-min-h-[400px] gf-h-[70dvh]",
|
|
8
|
+
g
|
|
9
|
+
),
|
|
10
|
+
children: /* @__PURE__ */ f("div", { className: "gf-bg-white/50 gf-rounded-2xl gf-w-full gf-h-full gf-flex gf-flex-col gf-items-center gf-justify-center gf-gap-3 gf-text-center gf-px-12 gf-py-12", children: e })
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
export {
|
|
14
|
+
i as StateContainer
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type StatusChipTone = "success" | "info" | "warning" | "caution" | "danger" | "muted" | "mutedGrey" | "white" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
4
|
+
/** Alias for backward compatibility */
|
|
5
|
+
export type ChipTone = StatusChipTone;
|
|
6
|
+
export type StatusChipProps = {
|
|
7
|
+
tone?: StatusChipTone;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const StatusChip: ({ tone, children, className }: StatusChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Typography as t } from "../Typography/index.js";
|
|
3
|
+
import { cn as i } from "../utils/index.js";
|
|
4
|
+
const o = {
|
|
5
|
+
success: "gf-bg-lightGreen",
|
|
6
|
+
info: "gf-bg-lightBlue",
|
|
7
|
+
warning: "gf-bg-[#FFE6B2]",
|
|
8
|
+
caution: "gf-bg-orange-100",
|
|
9
|
+
danger: "gf-bg-[#FFD1DD]",
|
|
10
|
+
muted: "gf-bg-primaryMist",
|
|
11
|
+
mutedGrey: "gf-bg-midGrey/50",
|
|
12
|
+
white: "gf-bg-white/30",
|
|
13
|
+
GET: "gf-bg-lightGreen",
|
|
14
|
+
POST: "gf-bg-lightBlue",
|
|
15
|
+
PUT: "gf-bg-yellow-100",
|
|
16
|
+
PATCH: "gf-bg-orange-100",
|
|
17
|
+
DELETE: "gf-bg-red-100"
|
|
18
|
+
}, l = ({ tone: g, children: e, className: f }) => /* @__PURE__ */ r(
|
|
19
|
+
t,
|
|
20
|
+
{
|
|
21
|
+
size: "h5",
|
|
22
|
+
weight: "regular",
|
|
23
|
+
className: i(
|
|
24
|
+
"gf-rounded-full gf-px-2 gf-py-1 gf-text-xs gf-font-medium",
|
|
25
|
+
g && o[g],
|
|
26
|
+
f
|
|
27
|
+
),
|
|
28
|
+
children: e
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
export {
|
|
32
|
+
l as StatusChip
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Switch } from './Switch';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Root as g, Thumb as f } from "../node_modules/@radix-ui/react-switch/dist/index.js";
|
|
3
|
+
import { cn as e } from "../utils/index.js";
|
|
4
|
+
function o({
|
|
5
|
+
className: r,
|
|
6
|
+
...a
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ t(
|
|
9
|
+
g,
|
|
10
|
+
{
|
|
11
|
+
"data-slot": "switch",
|
|
12
|
+
className: e(
|
|
13
|
+
"gf-cursor-pointer data-[state=checked]:gf-bg-primaryIris data-[state=unchecked]:gf-bg-light-grey gf-inline-flex gf-h-[1.15rem] gf-w-8 gf-shrink-0 gf-items-center gf-rounded-full gf-border gf-border-transparent gf-shadow-sm gf-transition-all gf-outline-none focus-visible:gf-ring-2 focus-visible:gf-ring-primaryIris disabled:gf-cursor-not-allowed disabled:gf-opacity-50",
|
|
14
|
+
r
|
|
15
|
+
),
|
|
16
|
+
...a,
|
|
17
|
+
children: /* @__PURE__ */ t(
|
|
18
|
+
f,
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "switch-thumb",
|
|
21
|
+
className: e(
|
|
22
|
+
"gf-pointer-events-none gf-block gf-size-4 gf-rounded-full gf-ring-0 gf-transition-transform data-[state=checked]:gf-translate-x-[calc(100%-2px)] data-[state=unchecked]:gf-translate-x-0 data-[state=checked]:gf-bg-light-grey data-[state=unchecked]:gf-bg-dark-grey"
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
o as Switch
|
|
31
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
4
|
+
declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
|
|
5
|
+
declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
6
|
+
declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
7
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
|
|
9
|
+
declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
|
|
14
|
+
type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
|
15
|
+
export { type ToastProps, type ToastActionElement, ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction, };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { Provider as m, Root as i, Action as r, Close as g, Description as n, Title as l, Viewport as d } from "../node_modules/@radix-ui/react-toast/dist/index.js";
|
|
4
|
+
import { cva as c } from "class-variance-authority";
|
|
5
|
+
import { cn as o } from "../utils/index.js";
|
|
6
|
+
import x from "../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
7
|
+
const V = m, u = s.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ f(
|
|
8
|
+
d,
|
|
9
|
+
{
|
|
10
|
+
ref: e,
|
|
11
|
+
className: o(
|
|
12
|
+
"gf-fixed gf-text-primaryIris gf-z-[100] gf-flex gf-max-h-screen gf-w-full gf-max-w-[420px] gf-flex-col gf-p-4",
|
|
13
|
+
a
|
|
14
|
+
),
|
|
15
|
+
...t
|
|
16
|
+
}
|
|
17
|
+
));
|
|
18
|
+
u.displayName = d.displayName;
|
|
19
|
+
const w = c(
|
|
20
|
+
"gf-group gf-pointer-events-auto gf-relative gf-flex gf-w-full gf-items-center gf-justify-between gf-space-x-4 gf-overflow-hidden gf-rounded-xl gf-p-6 gf-pr-8 gf-shadow-[0_8px_24px_-12px_rgba(71,60,117,0.15)] gf-backdrop-blur-lg [-webkit-backdrop-filter:blur(12px)] gf-transition-all data-[swipe=cancel]:gf-translate-x-0 data-[swipe=end]:gf-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:gf-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:gf-transition-none data-[state=open]:gf-animate-in data-[state=closed]:gf-animate-out data-[swipe=end]:gf-animate-out data-[state=closed]:gf-fade-out-80 data-[state=closed]:gf-slide-out-to-right-full data-[state=open]:gf-slide-in-from-top-full data-[state=open]:sm:gf-slide-in-from-bottom-full",
|
|
21
|
+
{
|
|
22
|
+
variants: {
|
|
23
|
+
variant: {
|
|
24
|
+
default: "gf-bg-white/70",
|
|
25
|
+
destructive: "gf-bg-[#FFD1DD]"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
variant: "default"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
), y = s.forwardRef(({ className: a, variant: t, ...e }, p) => /* @__PURE__ */ f(
|
|
33
|
+
i,
|
|
34
|
+
{
|
|
35
|
+
ref: p,
|
|
36
|
+
className: o(w({ variant: t }), a),
|
|
37
|
+
...e
|
|
38
|
+
}
|
|
39
|
+
));
|
|
40
|
+
y.displayName = i.displayName;
|
|
41
|
+
const N = s.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ f(
|
|
42
|
+
r,
|
|
43
|
+
{
|
|
44
|
+
ref: e,
|
|
45
|
+
className: o(
|
|
46
|
+
"gf-inline-flex gf-h-8 gf-shrink-0 gf-items-center gf-justify-center gf-rounded-md gf-px-3 gf-text-sm gf-font-medium gf-transition-colors focus:gf-outline-none disabled:gf-pointer-events-none disabled:gf-opacity-50",
|
|
47
|
+
a
|
|
48
|
+
),
|
|
49
|
+
...t
|
|
50
|
+
}
|
|
51
|
+
));
|
|
52
|
+
N.displayName = r.displayName;
|
|
53
|
+
const v = s.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ f(
|
|
54
|
+
g,
|
|
55
|
+
{
|
|
56
|
+
ref: e,
|
|
57
|
+
className: o(
|
|
58
|
+
"gf-absolute gf-right-2 gf-top-2 gf-rounded-md gf-p-1 gf-text-primaryIris/50 gf-transition-opacity hover:gf-text-primaryIris focus:gf-outline-none",
|
|
59
|
+
a
|
|
60
|
+
),
|
|
61
|
+
"toast-close": "",
|
|
62
|
+
...t,
|
|
63
|
+
children: /* @__PURE__ */ f(x, { className: "gf-h-4 gf-w-4" })
|
|
64
|
+
}
|
|
65
|
+
));
|
|
66
|
+
v.displayName = g.displayName;
|
|
67
|
+
const b = s.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ f(
|
|
68
|
+
l,
|
|
69
|
+
{
|
|
70
|
+
ref: e,
|
|
71
|
+
className: o("gf-text-sm gf-font-semibold gf-text-primaryIris", a),
|
|
72
|
+
...t
|
|
73
|
+
}
|
|
74
|
+
));
|
|
75
|
+
b.displayName = l.displayName;
|
|
76
|
+
const h = s.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ f(
|
|
77
|
+
n,
|
|
78
|
+
{
|
|
79
|
+
ref: e,
|
|
80
|
+
className: o("gf-text-sm gf-opacity-90 gf-text-primaryIris", a),
|
|
81
|
+
...t
|
|
82
|
+
}
|
|
83
|
+
));
|
|
84
|
+
h.displayName = n.displayName;
|
|
85
|
+
export {
|
|
86
|
+
y as Toast,
|
|
87
|
+
N as ToastAction,
|
|
88
|
+
v as ToastClose,
|
|
89
|
+
h as ToastDescription,
|
|
90
|
+
V as ToastProvider,
|
|
91
|
+
b as ToastTitle,
|
|
92
|
+
u as ToastViewport
|
|
93
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type ToastPosition = 'bottom-right' | 'bottom-left' | 'bottom-center' | 'top-right' | 'top-left' | 'top-center';
|
|
2
|
+
export type ToasterProps = {
|
|
3
|
+
position?: ToastPosition;
|
|
4
|
+
};
|
|
5
|
+
export declare function Toaster({ position }: ToasterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useToast as n } from "./useToast.js";
|
|
3
|
+
import { ToastProvider as l, Toast as m, ToastTitle as p, ToastDescription as c, ToastClose as h, ToastViewport as T } from "./Toast.js";
|
|
4
|
+
const b = {
|
|
5
|
+
"bottom-right": "gf-bottom-6 gf-right-6",
|
|
6
|
+
"bottom-left": "gf-bottom-6 gf-left-6",
|
|
7
|
+
"bottom-center": "gf-bottom-6 gf-left-1/2 gf--translate-x-1/2",
|
|
8
|
+
"top-right": "gf-top-6 gf-right-6",
|
|
9
|
+
"top-left": "gf-top-6 gf-left-6",
|
|
10
|
+
"top-center": "gf-top-6 gf-left-1/2 gf--translate-x-1/2"
|
|
11
|
+
};
|
|
12
|
+
function j({ position: f = "bottom-right" }) {
|
|
13
|
+
const { toasts: s } = n();
|
|
14
|
+
return /* @__PURE__ */ o(l, { children: [
|
|
15
|
+
s.map(function({ id: g, title: r, description: e, action: i, ...a }) {
|
|
16
|
+
return /* @__PURE__ */ o(m, { ...a, children: [
|
|
17
|
+
/* @__PURE__ */ o("div", { className: "gf-grid gf-gap-1", children: [
|
|
18
|
+
r && /* @__PURE__ */ t(p, { children: r }),
|
|
19
|
+
e && /* @__PURE__ */ t(c, { children: e })
|
|
20
|
+
] }),
|
|
21
|
+
i,
|
|
22
|
+
/* @__PURE__ */ t(h, {})
|
|
23
|
+
] }, g);
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ t(T, { className: b[f] })
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
j as Toaster
|
|
30
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { type ToastProps, type ToastActionElement, ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction, } from './Toast';
|
|
2
|
+
export { Toaster } from './Toaster';
|
|
3
|
+
export type { ToasterProps, ToastPosition } from './Toaster';
|
|
4
|
+
export { useToast, toast, reducer } from './useToast';
|
|
5
|
+
export type { ToasterToast } from './useToast';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Toast as r, ToastAction as s, ToastClose as e, ToastDescription as a, ToastProvider as T, ToastTitle as i, ToastViewport as p } from "./Toast.js";
|
|
2
|
+
import { Toaster as f } from "./Toaster.js";
|
|
3
|
+
import { reducer as x, toast as d, useToast as l } from "./useToast.js";
|
|
4
|
+
export {
|
|
5
|
+
r as Toast,
|
|
6
|
+
s as ToastAction,
|
|
7
|
+
e as ToastClose,
|
|
8
|
+
a as ToastDescription,
|
|
9
|
+
T as ToastProvider,
|
|
10
|
+
i as ToastTitle,
|
|
11
|
+
p as ToastViewport,
|
|
12
|
+
f as Toaster,
|
|
13
|
+
x as reducer,
|
|
14
|
+
d as toast,
|
|
15
|
+
l as useToast
|
|
16
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ToastActionElement, ToastProps } from './Toast';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type ToasterToast = ToastProps & {
|
|
4
|
+
id: string;
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
action?: ToastActionElement;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const actionTypes: {
|
|
11
|
+
readonly ADD_TOAST: "ADD_TOAST";
|
|
12
|
+
readonly UPDATE_TOAST: "UPDATE_TOAST";
|
|
13
|
+
readonly DISMISS_TOAST: "DISMISS_TOAST";
|
|
14
|
+
readonly REMOVE_TOAST: "REMOVE_TOAST";
|
|
15
|
+
};
|
|
16
|
+
type ActionType = typeof actionTypes;
|
|
17
|
+
type Action = {
|
|
18
|
+
type: ActionType['ADD_TOAST'];
|
|
19
|
+
toast: ToasterToast;
|
|
20
|
+
} | {
|
|
21
|
+
type: ActionType['UPDATE_TOAST'];
|
|
22
|
+
toast: Partial<ToasterToast>;
|
|
23
|
+
} | {
|
|
24
|
+
type: ActionType['DISMISS_TOAST'];
|
|
25
|
+
toastId?: ToasterToast['id'];
|
|
26
|
+
} | {
|
|
27
|
+
type: ActionType['REMOVE_TOAST'];
|
|
28
|
+
toastId?: ToasterToast['id'];
|
|
29
|
+
};
|
|
30
|
+
type State = {
|
|
31
|
+
toasts: ToasterToast[];
|
|
32
|
+
};
|
|
33
|
+
export declare const reducer: (state: State, action: Action) => State;
|
|
34
|
+
type Toast = Omit<ToasterToast, 'id'>;
|
|
35
|
+
declare function toast({ ...props }: Toast): {
|
|
36
|
+
id: string;
|
|
37
|
+
dismiss: () => void;
|
|
38
|
+
update: (props: ToasterToast) => void;
|
|
39
|
+
};
|
|
40
|
+
declare function useToast(): {
|
|
41
|
+
toast: typeof toast;
|
|
42
|
+
dismiss: (toastId?: string) => void;
|
|
43
|
+
toasts: ToasterToast[];
|
|
44
|
+
};
|
|
45
|
+
export { useToast, toast };
|
|
46
|
+
export type { ToasterToast };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as c from "react";
|
|
2
|
+
const d = 1, p = 5e3;
|
|
3
|
+
let u = 0;
|
|
4
|
+
function A() {
|
|
5
|
+
return u = (u + 1) % Number.MAX_SAFE_INTEGER, u.toString();
|
|
6
|
+
}
|
|
7
|
+
const a = /* @__PURE__ */ new Map(), S = (t) => {
|
|
8
|
+
if (a.has(t)) return;
|
|
9
|
+
const s = setTimeout(() => {
|
|
10
|
+
a.delete(t), n({ type: "REMOVE_TOAST", toastId: t });
|
|
11
|
+
}, p);
|
|
12
|
+
a.set(t, s);
|
|
13
|
+
}, f = (t, s) => {
|
|
14
|
+
switch (s.type) {
|
|
15
|
+
case "ADD_TOAST":
|
|
16
|
+
return {
|
|
17
|
+
...t,
|
|
18
|
+
toasts: [s.toast, ...t.toasts].slice(0, d)
|
|
19
|
+
};
|
|
20
|
+
case "UPDATE_TOAST":
|
|
21
|
+
return {
|
|
22
|
+
...t,
|
|
23
|
+
toasts: t.toasts.map(
|
|
24
|
+
(e) => e.id === s.toast.id ? { ...e, ...s.toast } : e
|
|
25
|
+
)
|
|
26
|
+
};
|
|
27
|
+
case "DISMISS_TOAST": {
|
|
28
|
+
const { toastId: e } = s;
|
|
29
|
+
return e ? S(e) : t.toasts.forEach((o) => S(o.id)), {
|
|
30
|
+
...t,
|
|
31
|
+
toasts: t.toasts.map(
|
|
32
|
+
(o) => o.id === e || e === void 0 ? { ...o, open: !1 } : o
|
|
33
|
+
)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
case "REMOVE_TOAST":
|
|
37
|
+
return s.toastId === void 0 ? { ...t, toasts: [] } : {
|
|
38
|
+
...t,
|
|
39
|
+
toasts: t.toasts.filter((e) => e.id !== s.toastId)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}, r = [];
|
|
43
|
+
let T = { toasts: [] };
|
|
44
|
+
function n(t) {
|
|
45
|
+
T = f(T, t), r.forEach((s) => s(T));
|
|
46
|
+
}
|
|
47
|
+
function O({ ...t }) {
|
|
48
|
+
const s = A(), e = (i) => n({ type: "UPDATE_TOAST", toast: { ...i, id: s } }), o = () => n({ type: "DISMISS_TOAST", toastId: s });
|
|
49
|
+
return n({
|
|
50
|
+
type: "ADD_TOAST",
|
|
51
|
+
toast: {
|
|
52
|
+
...t,
|
|
53
|
+
id: s,
|
|
54
|
+
open: !0,
|
|
55
|
+
onOpenChange: (i) => {
|
|
56
|
+
i || o();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}), { id: s, dismiss: o, update: e };
|
|
60
|
+
}
|
|
61
|
+
function E() {
|
|
62
|
+
const [t, s] = c.useState(T);
|
|
63
|
+
return c.useEffect(() => (r.push(s), () => {
|
|
64
|
+
const e = r.indexOf(s);
|
|
65
|
+
e > -1 && r.splice(e, 1);
|
|
66
|
+
}), [t]), {
|
|
67
|
+
...t,
|
|
68
|
+
toast: O,
|
|
69
|
+
dismiss: (e) => n({ type: "DISMISS_TOAST", toastId: e })
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
f as reducer,
|
|
74
|
+
O as toast,
|
|
75
|
+
E as useToast
|
|
76
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ToggleOption<T extends string | number> = {
|
|
2
|
+
value: T;
|
|
3
|
+
label: string;
|
|
4
|
+
};
|
|
5
|
+
export type ToggleGroupProps<T extends string | number> = {
|
|
6
|
+
options: readonly ToggleOption<T>[];
|
|
7
|
+
value: T;
|
|
8
|
+
onChange?: (value: T) => void;
|
|
9
|
+
layoutId: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
};
|
|
14
|
+
/** Tab-style toggle with a shared framer-motion layout animation on the active indicator. `layoutId` must be unique per page instance. */
|
|
15
|
+
export declare const ToggleGroup: <T extends string | number>({ options, value, onChange, layoutId, disabled, className, ariaLabel, }: ToggleGroupProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as l, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { AnimatePresence as u, motion as m } from "framer-motion";
|
|
3
|
+
import { Typography as d } from "../Typography/index.js";
|
|
4
|
+
import { cn as f } from "../utils/index.js";
|
|
5
|
+
const x = ({
|
|
6
|
+
options: s,
|
|
7
|
+
value: a,
|
|
8
|
+
onChange: t,
|
|
9
|
+
layoutId: g,
|
|
10
|
+
disabled: i,
|
|
11
|
+
className: n,
|
|
12
|
+
ariaLabel: o
|
|
13
|
+
}) => /* @__PURE__ */ l(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
role: "tablist",
|
|
17
|
+
"aria-label": o,
|
|
18
|
+
className: f(
|
|
19
|
+
"gf-relative gf-inline-flex gf-items-center gf-rounded-full gf-bg-white/30",
|
|
20
|
+
i && "gf-opacity-70",
|
|
21
|
+
n
|
|
22
|
+
),
|
|
23
|
+
children: s.map((e) => {
|
|
24
|
+
const r = e.value === a;
|
|
25
|
+
return /* @__PURE__ */ c(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
type: "button",
|
|
29
|
+
role: "tab",
|
|
30
|
+
"aria-selected": r,
|
|
31
|
+
disabled: i,
|
|
32
|
+
onClick: () => t == null ? void 0 : t(e.value),
|
|
33
|
+
className: f(
|
|
34
|
+
"gf-relative gf-rounded-full focus:gf-outline-none gf-px-4 gf-py-2 gf-flex gf-items-center gf-justify-center",
|
|
35
|
+
"disabled:gf-cursor-not-allowed"
|
|
36
|
+
),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ l(d, { size: "h4", weight: "regular", className: "gf-relative gf-z-10", children: e.label }),
|
|
39
|
+
/* @__PURE__ */ l(u, { children: r && /* @__PURE__ */ l(
|
|
40
|
+
m.div,
|
|
41
|
+
{
|
|
42
|
+
layoutId: g,
|
|
43
|
+
className: "gf-absolute gf-inset-0 gf-rounded-full gf-bg-white/70",
|
|
44
|
+
initial: !1,
|
|
45
|
+
transition: { type: "spring", stiffness: 250, damping: 30 }
|
|
46
|
+
}
|
|
47
|
+
) })
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
String(e.value)
|
|
51
|
+
);
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
export {
|
|
56
|
+
x as ToggleGroup
|
|
57
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type SizeVariants = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
2
|
-
type WeightVariants = "thin" | "light" | "regular" | "medium" | "semibold" | "bold" | "heavy" | "black";
|
|
1
|
+
export type SizeVariants = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
2
|
+
export type WeightVariants = "thin" | "light" | "regular" | "medium" | "semibold" | "bold" | "heavy" | "black";
|
|
3
3
|
type breakpointVariants = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
4
|
type Breakpoints = {
|
|
5
5
|
[K in breakpointVariants]?: SizeVariants;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type Viewport = "mobile" | "smallTab" | "desktop";
|
|
4
|
+
/** Returns the current viewport from the nearest ViewportProvider. Defaults to `"desktop"` when no provider is present. */
|
|
5
|
+
export declare const useViewport: () => Viewport;
|
|
6
|
+
export type ViewportProviderProps = {
|
|
7
|
+
value: Viewport;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/** Provides a `Viewport` value to descendants. Wrap your app root (or a layout shell) with this. */
|
|
11
|
+
export declare const ViewportProvider: ({ value, children }: ViewportProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as i, createContext as p } from "react";
|
|
3
|
+
const o = p("desktop"), x = () => i(o), c = ({ value: t, children: e }) => /* @__PURE__ */ r(o.Provider, { value: t, children: e });
|
|
4
|
+
export {
|
|
5
|
+
c as ViewportProvider,
|
|
6
|
+
x as useViewport
|
|
7
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -11,11 +11,35 @@ export * from './components/atoms/Modal';
|
|
|
11
11
|
export * from './components/atoms/Opacity';
|
|
12
12
|
export * from './components/atoms/Sidebar';
|
|
13
13
|
export * from './components/atoms/ClientOnly';
|
|
14
|
+
export * from './components/atoms/Input';
|
|
15
|
+
export * from './components/atoms/Field';
|
|
16
|
+
export * from './components/atoms/StatCard';
|
|
17
|
+
export * from './components/atoms/ToggleGroup';
|
|
18
|
+
export * from './components/atoms/Pagination';
|
|
19
|
+
export * from './components/atoms/HamburgerIcon';
|
|
20
|
+
export * from './components/atoms/BulletList';
|
|
21
|
+
export * from './components/atoms/Portal';
|
|
22
|
+
export * from './components/atoms/Viewport';
|
|
14
23
|
export * from './components/molecules/Chip';
|
|
15
24
|
export * from './components/molecules/GradientScroll';
|
|
16
25
|
export * from './components/molecules/InfoBadge';
|
|
17
26
|
export * from './components/molecules/TokenInfo';
|
|
18
27
|
export * from './components/molecules/TokenNetworkLogos';
|
|
28
|
+
export * from './components/molecules/StatusChip';
|
|
29
|
+
export * from './components/molecules/StateContainer';
|
|
30
|
+
export * from './components/molecules/EmptyState';
|
|
31
|
+
export * from './components/molecules/ErrorState';
|
|
32
|
+
export * from './components/molecules/InfoTooltip';
|
|
33
|
+
export * from './components/molecules/SelectDropdown';
|
|
34
|
+
export * from './components/molecules/ResponsiveModal';
|
|
35
|
+
export * from './components/molecules/Toast';
|
|
19
36
|
export * from './components/organisms/BlogCard';
|
|
20
37
|
export * from './components/organisms/Footer';
|
|
21
38
|
export * from './components/organisms/QuestCard';
|
|
39
|
+
export * from './components/organisms/DataTable';
|
|
40
|
+
export * from './components/organisms/CardList';
|
|
41
|
+
export * from './components/organisms/DashboardLayout';
|
|
42
|
+
export * from './components/atoms/OTPInput';
|
|
43
|
+
export * from './components/atoms/DirectionalIconHover';
|
|
44
|
+
export * from './components/atoms/Skeleton';
|
|
45
|
+
export * from './components/atoms/Switch';
|