@gearbox-protocol/permissionless-ui 1.22.7 → 1.23.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/cjs/components/assets-list-cell/assets-list-cell.cjs +1 -1
- package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
- package/dist/cjs/components/buttons/range-buttons/range-buttons.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/graph/graph-tooltip.cjs +1 -1
- package/dist/cjs/components/graph/graph-view.cjs +1 -1
- package/dist/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/components/graph/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
- package/dist/cjs/components/percent-indicator/percent-indicator.cjs +1 -1
- package/dist/cjs/components/progress/progress.cjs +1 -1
- package/dist/cjs/components/tab-control/tab-control.cjs +1 -1
- package/dist/cjs/components/table/index.cjs +1 -1
- package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
- package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -1
- package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/utils/colors.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +1 -1
- package/dist/esm/components/block-sync/block-sync.js +1 -1
- package/dist/esm/components/buttons/range-buttons/range-buttons.js +1 -1
- package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
- package/dist/esm/components/complex-input/complex-input.js +1 -1
- package/dist/esm/components/compound-apy/compound-apy.js +1 -1
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +1 -1
- package/dist/esm/components/graph/graph-tooltip.js +17 -17
- package/dist/esm/components/graph/graph-view.js +21 -21
- package/dist/esm/components/graph/graph.js +286 -224
- package/dist/esm/components/graph/index.js +11 -10
- package/dist/esm/components/index.js +439 -440
- package/dist/esm/components/markdown-viewer/markdown-viewer.js +1 -1
- package/dist/esm/components/percent-indicator/percent-indicator.js +24 -9
- package/dist/esm/components/progress/progress.js +16 -15
- package/dist/esm/components/tab-control/tab-control.js +49 -49
- package/dist/esm/components/table/index.js +28 -30
- package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +1 -1
- package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +1 -1
- package/dist/esm/components/trading-view/trading-view.js +70 -70
- package/dist/esm/components/with-copy/with-copy.js +1 -1
- package/dist/esm/index.js +482 -482
- package/dist/esm/utils/colors.js +40 -28
- package/dist/esm/utils/index.js +78 -77
- package/dist/globals.css +1 -1
- package/dist/types/components/graph/graph.d.ts +12 -0
- package/dist/types/components/percent-indicator/percent-indicator.d.ts +6 -11
- package/dist/types/components/progress/progress.d.ts +1 -1
- package/dist/types/components/tab-control/tab-control.d.ts +1 -1
- package/dist/types/components/table/index.d.ts +0 -1
- package/dist/types/utils/colors.d.ts +8 -0
- package/package.json +1 -1
- package/dist/cjs/components/table/sortable-head-cell.cjs +0 -1
- package/dist/esm/components/table/sortable-head-cell.js +0 -25
- package/dist/types/components/table/sortable-head-cell.d.ts +0 -36
|
@@ -18,11 +18,23 @@ type VerticalLineOptions = Partial<{
|
|
|
18
18
|
labelTextColor: string;
|
|
19
19
|
showLabel: boolean;
|
|
20
20
|
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Palette ordered for maximum contrast; first color is the original teal.
|
|
23
|
+
* Greens/teals are spread out so that when only a subset of series is visible,
|
|
24
|
+
* similar colors are not repeated.
|
|
25
|
+
*/
|
|
21
26
|
export declare const DEFAULT_SERIES_COLORS: {
|
|
22
27
|
line: string;
|
|
23
28
|
top: string;
|
|
24
29
|
bottom: string;
|
|
25
30
|
}[];
|
|
31
|
+
export type SeriesColorPalette = (typeof DEFAULT_SERIES_COLORS)[number];
|
|
32
|
+
/**
|
|
33
|
+
* Returns a color palette for a series by index. Uses predefined palette for
|
|
34
|
+
* the first N series; generates distinct colors for additional series so they
|
|
35
|
+
* never repeat.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getSeriesColorPalette(index: number): SeriesColorPalette;
|
|
26
38
|
export interface GraphProps {
|
|
27
39
|
/** Series configuration - can be single or multiple series */
|
|
28
40
|
series: Array<SeriesConfig>;
|
|
@@ -14,15 +14,10 @@ export interface PercentIndicatorProps extends React.HTMLAttributes<HTMLDivEleme
|
|
|
14
14
|
* @default true
|
|
15
15
|
*/
|
|
16
16
|
showColor?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Show progress bar below the value
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
showProgressBar?: boolean;
|
|
17
22
|
}
|
|
18
|
-
|
|
19
|
-
* PercentIndicator component for displaying percentage values with optional color coding
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```tsx
|
|
23
|
-
* <PercentIndicator percent={75} /> // Shows "75.00%"
|
|
24
|
-
* <PercentIndicator percent={50} decimals={1} /> // Shows "50.0%"
|
|
25
|
-
* <PercentIndicator percent={95} showColor={false} /> // No color coding
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare function PercentIndicator({ percent, decimals, showColor, className, ...props }: PercentIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function PercentIndicator({ percent, decimals, showColor, showProgressBar, className, ...props }: PercentIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,7 @@ export interface ProgressProps extends React.ComponentPropsWithoutRef<typeof Pro
|
|
|
4
4
|
/**
|
|
5
5
|
* Visual variant based on progress status
|
|
6
6
|
*/
|
|
7
|
-
variant?: "default" | "success" | "warning" | "danger";
|
|
7
|
+
variant?: "default" | "success" | "warning" | "danger" | "info";
|
|
8
8
|
/**
|
|
9
9
|
* Size of the progress bar
|
|
10
10
|
*/
|
|
@@ -10,7 +10,7 @@ export interface TabControlProps<T extends string> {
|
|
|
10
10
|
variant?: "equal" | "auto";
|
|
11
11
|
tabItemWrapPadding?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare function TabControl<T extends string>({ tabs, state: controlState,
|
|
13
|
+
export declare function TabControl<T extends string>({ tabs, state: controlState, showBorder, tabItemWrapPadding, variant, }: TabControlProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
interface TabItemProps {
|
|
15
15
|
icon?: React.ReactNode;
|
|
16
16
|
label: React.ReactNode;
|
|
@@ -5,7 +5,6 @@ export * from './grid-error-line';
|
|
|
5
5
|
export * from './grid-loading-line';
|
|
6
6
|
export * from './grid-table';
|
|
7
7
|
export * from './grid-table-loader';
|
|
8
|
-
export * from './sortable-head-cell';
|
|
9
8
|
export * from './table';
|
|
10
9
|
export * from './table-loader';
|
|
11
10
|
export * from './table-loader-guard';
|
|
@@ -27,3 +27,11 @@ export declare function generateColorsFromBase(color: string): {
|
|
|
27
27
|
topColor: string;
|
|
28
28
|
bottomColor: string;
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Converts HSL to hex color.
|
|
32
|
+
* @param h - Hue 0-360
|
|
33
|
+
* @param s - Saturation 0-100
|
|
34
|
+
* @param l - Lightness 0-100
|
|
35
|
+
* @returns Hex color string
|
|
36
|
+
*/
|
|
37
|
+
export declare function hslToHex(h: number, s: number, l: number): string;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@fortawesome/free-solid-svg-icons"),n=require("../icons/fa-icon.cjs");function a({title:r,sortType:s,onSort:c,className:t}){return e.jsxs("button",{type:"button",onClick:c,className:`flex items-center justify-end gap-1 hover:text-foreground transition-colors cursor-pointer ${t||""}`,children:[r,s==="asc"?e.jsx(n.FaIcon,{icon:o.faArrowUp,className:"size-3.5"}):s==="desc"?e.jsx(n.FaIcon,{icon:o.faArrowDown,className:"size-3.5"}):e.jsx(n.FaIcon,{icon:o.faArrowsUpDown,className:"size-3.5 opacity-50"})]})}exports.SortableHeadCell=a;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { faArrowUp as i, faArrowDown as c, faArrowsUpDown as l } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
-
import { FaIcon as r } from "../icons/fa-icon.js";
|
|
4
|
-
function u({
|
|
5
|
-
title: s,
|
|
6
|
-
sortType: e,
|
|
7
|
-
onSort: t,
|
|
8
|
-
className: n
|
|
9
|
-
}) {
|
|
10
|
-
return /* @__PURE__ */ a(
|
|
11
|
-
"button",
|
|
12
|
-
{
|
|
13
|
-
type: "button",
|
|
14
|
-
onClick: t,
|
|
15
|
-
className: `flex items-center justify-end gap-1 hover:text-foreground transition-colors cursor-pointer ${n || ""}`,
|
|
16
|
-
children: [
|
|
17
|
-
s,
|
|
18
|
-
e === "asc" ? /* @__PURE__ */ o(r, { icon: i, className: "size-3.5" }) : e === "desc" ? /* @__PURE__ */ o(r, { icon: c, className: "size-3.5" }) : /* @__PURE__ */ o(r, { icon: l, className: "size-3.5 opacity-50" })
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
export {
|
|
24
|
-
u as SortableHeadCell
|
|
25
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { SortType } from '../../utils/sort';
|
|
2
|
-
import type * as React from "react";
|
|
3
|
-
/**
|
|
4
|
-
* SortableHeadCellProps — props for SortableHeadCell component.
|
|
5
|
-
*/
|
|
6
|
-
export interface SortableHeadCellProps {
|
|
7
|
-
title: React.ReactNode;
|
|
8
|
-
sortType?: SortType;
|
|
9
|
-
onSort: () => void;
|
|
10
|
-
className?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* SortableHeadCell — sortable table header cell component with sort indicators.
|
|
14
|
-
*
|
|
15
|
-
* @usage
|
|
16
|
-
* Use SortableHeadCell to create clickable, sortable table column headers:
|
|
17
|
-
* sortable data tables, sortable lists, interactive table headers with sort direction indicators.
|
|
18
|
-
*
|
|
19
|
-
* Props:
|
|
20
|
-
* - `title` — header content/title (required).
|
|
21
|
-
* - `sortType` — current sort type: "asc", "desc", or undefined (no sort).
|
|
22
|
-
* - `onSort` — callback function to toggle sort (required).
|
|
23
|
-
* - `className` — additional CSS classes for styling.
|
|
24
|
-
*
|
|
25
|
-
* Note: Displays ArrowUp for ascending, ArrowDown for descending, or ArrowUpDown (faded) when not sorted. Clicking toggles sort direction.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```tsx
|
|
29
|
-
* <SortableHeadCell
|
|
30
|
-
* title="Name"
|
|
31
|
-
* sortType={getSortForField("name", currentSort)}
|
|
32
|
-
* onSort={() => setSortField("name")}
|
|
33
|
-
* />
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export declare function SortableHeadCell({ title, sortType, onSort, className, }: SortableHeadCellProps): React.ReactElement;
|