@yuno-payments/dashboard-design-system 2.0.2 → 2.0.4-beta.0
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/atoms/icon/directional-icons.d.ts +12 -0
- package/dist/components/atoms/icon/directional-icons.js +38 -0
- package/dist/components/atoms/icon/icon.d.ts +6 -0
- package/dist/components/atoms/icon/icon.js +27 -21
- package/dist/components/atoms/icon/index.d.ts +1 -0
- package/dist/components/atoms/radio-group/radio-group-option.js +7 -7
- package/dist/components/organisms/data-table/utils/data-table-styles.d.ts +3 -3
- package/dist/components/organisms/data-table/utils/data-table-styles.js +20 -23
- package/dist/components/organisms/data-table/utils/data-table-utils.js +11 -8
- package/dist/dashboard-design-system.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.min.js +1656 -1617
- package/dist/index.umd.min.js +12 -12
- package/dist/vendor/shadcn/switch.js +1 -1
- package/package.json +4 -2
- package/registry/components-registry.json +9 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List of icon names that represent directional concepts and should be
|
|
3
|
+
* automatically mirrored in RTL (right-to-left) layouts.
|
|
4
|
+
*
|
|
5
|
+
* These icons point left/right or imply horizontal direction, so they need
|
|
6
|
+
* to be flipped when the UI direction changes from LTR to RTL.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* - ArrowLeft in LTR → points left (back)
|
|
10
|
+
* - ArrowLeft in RTL → should point right (still means "back")
|
|
11
|
+
*/
|
|
12
|
+
export declare const DIRECTIONAL_ICONS: Set<string>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const r = /* @__PURE__ */ new Set([
|
|
2
|
+
// Arrows - horizontal direction
|
|
3
|
+
"ArrowLeft",
|
|
4
|
+
"ArrowRight",
|
|
5
|
+
"ArrowCircleLeft",
|
|
6
|
+
"ArrowCircleRight",
|
|
7
|
+
"ArrowCircleUpLeft",
|
|
8
|
+
"ArrowBendUpLeft",
|
|
9
|
+
"ArrowBendUpRight",
|
|
10
|
+
"ArrowElbowDownRight",
|
|
11
|
+
"ArrowUpRight",
|
|
12
|
+
"ArrowSquareIn",
|
|
13
|
+
// Carets - horizontal direction
|
|
14
|
+
"CaretLeft",
|
|
15
|
+
"CaretRight",
|
|
16
|
+
"CaretDoubleLeft",
|
|
17
|
+
"CaretDoubleRight",
|
|
18
|
+
"CaretCircleRight",
|
|
19
|
+
// Actions with implied direction
|
|
20
|
+
"SignOut",
|
|
21
|
+
"Export",
|
|
22
|
+
"PhoneOutgoing",
|
|
23
|
+
// Toggle switches (thumb position implies direction)
|
|
24
|
+
"ToggleLeft",
|
|
25
|
+
"ToggleRight",
|
|
26
|
+
// Trend indicators (arrow direction)
|
|
27
|
+
"TrendUp",
|
|
28
|
+
"TrendDown",
|
|
29
|
+
// Sort indicators
|
|
30
|
+
"SortAscending",
|
|
31
|
+
"SortDescending",
|
|
32
|
+
// Play control (points right in LTR)
|
|
33
|
+
"Play",
|
|
34
|
+
"PlayCircle"
|
|
35
|
+
]);
|
|
36
|
+
export {
|
|
37
|
+
r as DIRECTIONAL_ICONS
|
|
38
|
+
};
|
|
@@ -30,6 +30,12 @@ interface IconProps extends Omit<PhosphorIconProps, "size">, VariantProps<typeof
|
|
|
30
30
|
* Additional props to pass to the Tooltip component
|
|
31
31
|
*/
|
|
32
32
|
tooltipProps?: Partial<TooltipProps>;
|
|
33
|
+
/**
|
|
34
|
+
* Auto-mirror icon in RTL layouts.
|
|
35
|
+
* Defaults to `true` for directional icons (arrows, chevrons, carets, etc.)
|
|
36
|
+
* Set to `false` to disable auto-mirroring for a specific icon.
|
|
37
|
+
*/
|
|
38
|
+
autoMirrorRtl?: boolean;
|
|
33
39
|
}
|
|
34
40
|
/**
|
|
35
41
|
* Icon component using Phosphor Icons with size variants and optional tooltip.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { IconList as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
|
|
1
|
+
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { cva as z } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { cn as I } from "../../../lib/utils.js";
|
|
5
|
+
import { IconList as h } from "./icon-list.js";
|
|
6
|
+
import { Tooltip as j } from "../tooltip/tooltip.js";
|
|
7
|
+
import { DIRECTIONAL_ICONS as C } from "./directional-icons.js";
|
|
8
|
+
const N = z("inline-flex items-center justify-center shrink-0", {
|
|
8
9
|
variants: {
|
|
9
10
|
size: {
|
|
10
11
|
xs: "size-3",
|
|
@@ -17,34 +18,39 @@ const j = u("inline-flex items-center justify-center shrink-0", {
|
|
|
17
18
|
defaultVariants: {
|
|
18
19
|
size: "md"
|
|
19
20
|
}
|
|
20
|
-
}), g =
|
|
21
|
+
}), g = d(
|
|
21
22
|
({
|
|
22
23
|
name: r,
|
|
23
|
-
weight:
|
|
24
|
+
weight: n = "light",
|
|
24
25
|
size: e,
|
|
25
26
|
className: c,
|
|
26
27
|
color: l,
|
|
27
|
-
tooltip:
|
|
28
|
+
tooltip: o,
|
|
28
29
|
tooltipProps: m,
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
autoMirrorRtl: a,
|
|
31
|
+
...f
|
|
32
|
+
}, u) => {
|
|
31
33
|
if (!r)
|
|
32
34
|
return null;
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
35
|
+
const i = h?.[r];
|
|
36
|
+
if (!i)
|
|
35
37
|
return console.error("Missing icon", r), null;
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
+
const p = C.has(r), x = a ?? p, s = /* @__PURE__ */ t.jsx(
|
|
39
|
+
i,
|
|
38
40
|
{
|
|
39
|
-
ref:
|
|
41
|
+
ref: u,
|
|
40
42
|
"aria-label": r,
|
|
41
|
-
className:
|
|
43
|
+
className: I(
|
|
44
|
+
N({ size: e }),
|
|
45
|
+
x && "rtl:scale-x-[-1]",
|
|
46
|
+
c
|
|
47
|
+
),
|
|
42
48
|
color: l || "currentColor",
|
|
43
|
-
weight:
|
|
44
|
-
...
|
|
49
|
+
weight: n,
|
|
50
|
+
...f
|
|
45
51
|
}
|
|
46
52
|
);
|
|
47
|
-
return
|
|
53
|
+
return o ? /* @__PURE__ */ t.jsx(j, { content: o, ...m, children: s }) : s;
|
|
48
54
|
}
|
|
49
55
|
);
|
|
50
56
|
g.displayName = "Icon";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as r } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { RadioGroupItem as d } from "../../../vendor/shadcn/radio-group.js";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Label as
|
|
3
|
+
import { cn as a } from "../../../lib/utils.js";
|
|
4
|
+
import { Label as l } from "../label/label.js";
|
|
5
5
|
const o = ({
|
|
6
6
|
option: e,
|
|
7
7
|
radioId: s,
|
|
@@ -22,23 +22,23 @@ const o = ({
|
|
|
22
22
|
),
|
|
23
23
|
t ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
24
24
|
/* @__PURE__ */ r.jsx(
|
|
25
|
-
|
|
25
|
+
l,
|
|
26
26
|
{
|
|
27
27
|
htmlFor: s,
|
|
28
|
-
className:
|
|
28
|
+
className: a(
|
|
29
29
|
"cursor-pointer",
|
|
30
30
|
e.disabled && "text-muted-foreground"
|
|
31
31
|
),
|
|
32
32
|
children: e.label
|
|
33
33
|
}
|
|
34
34
|
),
|
|
35
|
-
e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-muted-foreground
|
|
35
|
+
e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-muted-foreground ms-auto", children: e.description })
|
|
36
36
|
] }) : /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col gap-1.5 flex-1", children: [
|
|
37
37
|
/* @__PURE__ */ r.jsx(
|
|
38
|
-
|
|
38
|
+
l,
|
|
39
39
|
{
|
|
40
40
|
htmlFor: s,
|
|
41
|
-
className:
|
|
41
|
+
className: a(
|
|
42
42
|
"cursor-pointer",
|
|
43
43
|
e.disabled && "text-muted-foreground"
|
|
44
44
|
),
|
|
@@ -222,7 +222,7 @@ export declare function getCellStyles<TData, TValue>(column: Column<TData, TValu
|
|
|
222
222
|
maxHeight?: import("csstype").Property.MaxHeight<string | number> | undefined;
|
|
223
223
|
maxInlineSize?: import("csstype").Property.MaxInlineSize<string | number> | undefined;
|
|
224
224
|
maxLines?: import("csstype").Property.MaxLines | undefined;
|
|
225
|
-
maxWidth?:
|
|
225
|
+
maxWidth?: string | number | undefined;
|
|
226
226
|
minBlockSize?: import("csstype").Property.MinBlockSize<string | number> | undefined;
|
|
227
227
|
minHeight?: import("csstype").Property.MinHeight<string | number> | undefined;
|
|
228
228
|
minInlineSize?: import("csstype").Property.MinInlineSize<string | number> | undefined;
|
|
@@ -1874,11 +1874,11 @@ export declare function getCellStyles<TData, TValue>(column: Column<TData, TValu
|
|
|
1874
1874
|
maxHeight?: import("csstype").Property.MaxHeight<string | number> | undefined;
|
|
1875
1875
|
maxInlineSize?: import("csstype").Property.MaxInlineSize<string | number> | undefined;
|
|
1876
1876
|
maxLines?: import("csstype").Property.MaxLines | undefined;
|
|
1877
|
-
maxWidth?:
|
|
1877
|
+
maxWidth?: string | number | undefined;
|
|
1878
1878
|
minBlockSize?: import("csstype").Property.MinBlockSize<string | number> | undefined;
|
|
1879
1879
|
minHeight?: import("csstype").Property.MinHeight<string | number> | undefined;
|
|
1880
1880
|
minInlineSize?: import("csstype").Property.MinInlineSize<string | number> | undefined;
|
|
1881
|
-
minWidth?:
|
|
1881
|
+
minWidth?: string | number | undefined;
|
|
1882
1882
|
mixBlendMode?: import("csstype").Property.MixBlendMode | undefined;
|
|
1883
1883
|
motionDistance?: import("csstype").Property.OffsetDistance<string | number> | undefined;
|
|
1884
1884
|
motionPath?: import("csstype").Property.OffsetPath | undefined;
|
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
import { cn as o } from "../../../../lib/utils.js";
|
|
2
|
-
import { getPinnedStyles as
|
|
3
|
-
import { PINNED_SHADOW_CLASS as
|
|
4
|
-
function
|
|
5
|
-
|
|
2
|
+
import { getPinnedStyles as f } from "./data-table-utils.js";
|
|
3
|
+
import { PINNED_SHADOW_CLASS as p } from "./data-table-constants.js";
|
|
4
|
+
function l(t, i, e) {
|
|
5
|
+
return t ? { width: "auto", minWidth: 0 } : i ? {
|
|
6
|
+
width: `${e}px`,
|
|
7
|
+
minWidth: `${e}px`,
|
|
8
|
+
maxWidth: `${e}px`
|
|
9
|
+
} : { width: `${e}px` };
|
|
10
|
+
}
|
|
11
|
+
function m(t, i, e) {
|
|
12
|
+
const s = t.getIsPinned(), d = t.getSize(), n = t.id === "_spacer", a = t.columnDef.enableResizing === !1 && !n;
|
|
6
13
|
return {
|
|
7
14
|
style: {
|
|
8
|
-
|
|
9
|
-
...
|
|
10
|
-
width: "auto",
|
|
11
|
-
minWidth: 0
|
|
12
|
-
} : a ? {
|
|
13
|
-
width: `${e}px`,
|
|
14
|
-
minWidth: `${e}px`,
|
|
15
|
-
maxWidth: `${e}px`
|
|
16
|
-
} : {
|
|
17
|
-
width: `${e}px`
|
|
18
|
-
},
|
|
19
|
-
...p(
|
|
15
|
+
...l(n, a, d),
|
|
16
|
+
...f(
|
|
20
17
|
s,
|
|
21
|
-
(
|
|
22
|
-
(
|
|
23
|
-
|
|
18
|
+
(r) => t.getStart(r),
|
|
19
|
+
(r) => t.getAfter(r),
|
|
20
|
+
e
|
|
24
21
|
)
|
|
25
22
|
},
|
|
26
23
|
className: o(
|
|
27
|
-
|
|
28
|
-
s &&
|
|
24
|
+
i,
|
|
25
|
+
s && p,
|
|
29
26
|
// Add a class to identify fixed-size columns
|
|
30
27
|
a && "data-table-fixed-column",
|
|
31
28
|
// Hide spacer column visually
|
|
32
|
-
|
|
29
|
+
n && "data-table-spacer"
|
|
33
30
|
)
|
|
34
31
|
};
|
|
35
32
|
}
|
|
36
33
|
export {
|
|
37
|
-
|
|
34
|
+
m as getCellStyles
|
|
38
35
|
};
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
function
|
|
1
|
+
function r(e) {
|
|
2
2
|
return typeof e == "object" && e !== null && "title" in e && typeof e.title == "string";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function f(e) {
|
|
5
5
|
return typeof e.columnDef.header == "string" ? e.columnDef.header : e.columnDef.header && typeof e.columnDef.header == "object" && "title" in e.columnDef.header ? e.columnDef.header.title : e.id;
|
|
6
6
|
}
|
|
7
|
-
function o(e, t, i,
|
|
7
|
+
function o(e, t, i, n) {
|
|
8
8
|
return e ? {
|
|
9
9
|
position: "sticky",
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
// Use logical properties so pinned columns work in both LTR and RTL.
|
|
11
|
+
// "left"-pinned columns stick to the inline-start edge,
|
|
12
|
+
// "right"-pinned columns (e.g. actions) stick to the inline-end edge.
|
|
13
|
+
insetInlineStart: e === "left" ? `${t("left")}px` : void 0,
|
|
14
|
+
insetInlineEnd: e === "right" ? `${i("right")}px` : void 0,
|
|
12
15
|
zIndex: 10,
|
|
13
|
-
backgroundColor:
|
|
16
|
+
backgroundColor: n
|
|
14
17
|
} : {};
|
|
15
18
|
}
|
|
16
19
|
export {
|
|
17
|
-
|
|
20
|
+
f as getColumnDisplayName,
|
|
18
21
|
o as getPinnedStyles,
|
|
19
|
-
|
|
22
|
+
r as isHeaderConfig
|
|
20
23
|
};
|