@gridui/data-cell 1.0.6 → 1.1.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/README.md +6 -2
- package/dist/data-value/data-value.d.ts +3 -0
- package/dist/data-value/style.d.ts +3 -2
- package/dist/index.js +17 -8
- package/dist/index.js.map +2 -2
- package/dist/styles.css +24 -5
- package/docs/catalog.json +7 -6
- package/docs/reference/data-badge.md +2 -2
- package/docs/reference/data-bar.md +2 -2
- package/docs/reference/data-value.md +20 -2
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
# @gridui/data-cell
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Data family. Public API: `DataBadge`, `DataBadgeProps`, `DataBar`, `DataBarProps`, `DataValue`, `DataValueProps`.
|
|
4
4
|
|
|
5
5
|
Import components from `@gridui/data-cell` and load `@gridui/data-cell/styles.css` after Theme.
|
|
6
6
|
Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
8
|
-
See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-
|
|
8
|
+
See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-data/data-cell/.changeset/history).
|
|
9
9
|
|
|
10
10
|
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
|
11
|
+
|
|
12
|
+
DataValue supports direction (column/row), align (start/center/end), and tabular
|
|
13
|
+
numeric typography independently from mono. Use native description lists with
|
|
14
|
+
Grid, Row or Stack to assemble labeled readouts without chart dependencies.
|
|
@@ -8,5 +8,8 @@ import type { ComponentPropsWithRef, FC, ReactNode } from "react";
|
|
|
8
8
|
export type DataValueProps = ComponentPropsWithRef<"span"> & {
|
|
9
9
|
readonly detail?: ReactNode;
|
|
10
10
|
readonly mono?: boolean;
|
|
11
|
+
readonly tabular?: boolean;
|
|
12
|
+
readonly direction?: "column" | "row";
|
|
13
|
+
readonly align?: "start" | "center" | "end";
|
|
11
14
|
};
|
|
12
15
|
export declare const DataValue: FC<DataValueProps>;
|
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
* @namespace DataValue
|
|
5
5
|
* @description Style
|
|
6
6
|
*/
|
|
7
|
-
export declare const dataValueStyles: (props?:
|
|
8
|
-
|
|
7
|
+
export declare const dataValueStyles: (props?: ({
|
|
8
|
+
mono?: boolean | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
package/dist/index.js
CHANGED
|
@@ -86,13 +86,16 @@ import { cn as cn5 } from "@gridui/style-utils";
|
|
|
86
86
|
import { cva as cva3 } from "class-variance-authority";
|
|
87
87
|
var dataValueStyles = cva3(cn5(
|
|
88
88
|
"gridui-data-value",
|
|
89
|
-
"gridui-u-data-cell--
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
"gridui-u-data-cell--[&>small]:text-muted gridui-u-data-cell--[&>small]:type-supporting"
|
|
90
|
+
), {
|
|
91
|
+
variants: {
|
|
92
|
+
mono: {
|
|
93
|
+
false: null,
|
|
94
|
+
true: "gridui-data-mono gridui-u-data-cell--type-code gridui-u-data-cell--whitespace-nowrap"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
defaultVariants: { mono: false }
|
|
98
|
+
});
|
|
96
99
|
|
|
97
100
|
// src/data-value/data-value.tsx
|
|
98
101
|
import { cn as cn6 } from "@gridui/style-utils";
|
|
@@ -102,6 +105,9 @@ var DataValue = (props) => {
|
|
|
102
105
|
children,
|
|
103
106
|
detail,
|
|
104
107
|
mono = false,
|
|
108
|
+
tabular = false,
|
|
109
|
+
direction = "column",
|
|
110
|
+
align = "start",
|
|
105
111
|
className,
|
|
106
112
|
...restProps
|
|
107
113
|
} = props;
|
|
@@ -109,7 +115,10 @@ var DataValue = (props) => {
|
|
|
109
115
|
"span",
|
|
110
116
|
{
|
|
111
117
|
...restProps,
|
|
112
|
-
|
|
118
|
+
"data-direction": direction,
|
|
119
|
+
"data-align": align,
|
|
120
|
+
"data-tabular": tabular || void 0,
|
|
121
|
+
className: cn6(dataValueStyles({ mono }), className),
|
|
113
122
|
children: [
|
|
114
123
|
/* @__PURE__ */ jsx3("span", { children }),
|
|
115
124
|
detail !== void 0 && /* @__PURE__ */ jsx3("small", { children: detail })
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/data-badge/style.ts", "../src/data-badge/data-badge.tsx", "../src/data-bar/style.ts", "../src/data-bar/data-bar.tsx", "../src/data-value/style.ts", "../src/data-value/data-value.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataBadge\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dataBadgeStyles = cva(cn(\n \"gridui-data-badge\",\n \"gridui-u-data-cell--inline-block gridui-u-data-cell--py-gridui-4 gridui-u-data-cell--px-gridui-8 gridui-u-data-cell--text-foreground gridui-u-data-cell--bg-surface gridui-u-data-cell--type-caption gridui-u-data-cell--whitespace-nowrap\",\n \"gridui-u-data-cell--data-[tone='accent']:text-foreground gridui-u-data-cell--data-[tone='accent']:bg-brand-tint\",\n));\n", "/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataBadge\n * @description Data Badge\n */\n\nimport { dataBadgeStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DataBadgeProps = ComponentPropsWithRef<\"span\"> & {\n readonly tone?: \"neutral\" | \"accent\";\n};\n\nexport const DataBadge: FC<DataBadgeProps> = (props: DataBadgeProps) => {\n const {\n children,\n tone = \"neutral\",\n className,\n ...restProps\n } = props;\n return (<span\n {...restProps}\n className={cn(dataBadgeStyles(), className)}\n data-tone={tone}\n >\n {children}\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataBar\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dataBarStyles = cva(cn(\n \"gridui-data-bar\",\n \"gridui-u-data-cell--grid gridui-u-data-cell--min-w-gridui-64 gridui-u-data-cell--gap-gridui-8 gridui-u-data-cell--tabular-nums\",\n \"gridui-u-data-cell--[&[data-partial='true']_.gridui-data-bar-track>span]:bg-transparent\",\n));\n\nexport const dataBarTrackStyles = cva(cn(\n \"gridui-data-bar-track\",\n \"gridui-u-data-cell--h-(--gridui-space-4) gridui-u-data-cell--bg-brand-tint\",\n \"gridui-u-data-cell--[&_>_span]:block gridui-u-data-cell--[&_>_span]:h-full gridui-u-data-cell--[&_>_span]:bg-accent-background\",\n));\n", "/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataBar\n * @description Data Bar\n */\n\nimport { dataBarStyles, dataBarTrackStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DataBarProps = ComponentPropsWithRef<\"span\"> & {\n readonly value: number;\n readonly maximum: number;\n readonly partial?: boolean;\n};\n\nexport const DataBar: FC<DataBarProps> = (props: DataBarProps) => {\n const {\n value,\n maximum,\n partial = false,\n children,\n className,\n ...restProps\n } = props;\n const ratio = Number.isFinite(value) && Number.isFinite(maximum) && maximum > 0\n ? Math.max(0, Math.min(1, value / maximum))\n : 0;\n return (<span\n {...restProps}\n className={cn(dataBarStyles(), className)}\n data-partial={partial}\n >\n <span>\n {children}\n </span>\n <span\n className={cn(dataBarTrackStyles())}\n aria-hidden=\"true\"\n >\n <span\n style={{ width: `${ratio * 100}%` }}\n />\n </span>\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataValue\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dataValueStyles = cva(cn(\n \"gridui-data-value\",\n \"gridui-u-data-cell--
|
|
5
|
-
"mappings": ";AAOA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,kBAAkB,IAAI;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACJ,CAAC;;;ACND,SAAS,MAAAA,WAAU;AAcP;AAPL,IAAM,YAAgC,CAAC,UAA0B;AACpE,QAAM;AAAA,IACF;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWA,IAAG,gBAAgB,GAAG,SAAS;AAAA,MAC1C,aAAW;AAAA,MAEV;AAAA;AAAA,EACL;AACJ;;;ACtBA,SAAS,MAAAC,WAAU;AACnB,SAAS,OAAAC,YAAW;AAEb,IAAM,gBAAgBA,KAAID;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,qBAAqBC,KAAID;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AACJ,CAAC;;;ACZD,SAAS,MAAAE,WAAU;AAqBP,SAKJ,OAAAC,MALI;AAZL,IAAM,UAA4B,CAAC,UAAwB;AAC9D,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,QAAM,QAAQ,OAAO,SAAS,KAAK,KAAK,OAAO,SAAS,OAAO,KAAK,UAAU,IACxE,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,QAAQ,OAAO,CAAC,IACxC;AACN,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWD,IAAG,cAAc,GAAG,SAAS;AAAA,MACxC,gBAAc;AAAA,MAEd;AAAA,wBAAAC,KAAC,UACI,UACL;AAAA,QACA,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACG,WAAWD,IAAG,mBAAmB,CAAC;AAAA,YAClC,eAAY;AAAA,YAEZ,0BAAAC;AAAA,cAAC;AAAA;AAAA,gBACG,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI;AAAA;AAAA,YACtC;AAAA;AAAA,QACJ;AAAA;AAAA;AAAA,EACJ;AACJ;;;ACvCA,SAAS,MAAAC,WAAU;AACnB,SAAS,OAAAC,YAAW;AAEb,IAAM,kBAAkBA,KAAID;AAAA,EAC/B;AAAA,EACA;AAAA,
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataBadge\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dataBadgeStyles = cva(cn(\n \"gridui-data-badge\",\n \"gridui-u-data-cell--inline-block gridui-u-data-cell--py-gridui-4 gridui-u-data-cell--px-gridui-8 gridui-u-data-cell--text-foreground gridui-u-data-cell--bg-surface gridui-u-data-cell--type-caption gridui-u-data-cell--whitespace-nowrap\",\n \"gridui-u-data-cell--data-[tone='accent']:text-foreground gridui-u-data-cell--data-[tone='accent']:bg-brand-tint\",\n));\n", "/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataBadge\n * @description Data Badge\n */\n\nimport { dataBadgeStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DataBadgeProps = ComponentPropsWithRef<\"span\"> & {\n readonly tone?: \"neutral\" | \"accent\";\n};\n\nexport const DataBadge: FC<DataBadgeProps> = (props: DataBadgeProps) => {\n const {\n children,\n tone = \"neutral\",\n className,\n ...restProps\n } = props;\n return (<span\n {...restProps}\n className={cn(dataBadgeStyles(), className)}\n data-tone={tone}\n >\n {children}\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataBar\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dataBarStyles = cva(cn(\n \"gridui-data-bar\",\n \"gridui-u-data-cell--grid gridui-u-data-cell--min-w-gridui-64 gridui-u-data-cell--gap-gridui-8 gridui-u-data-cell--tabular-nums\",\n \"gridui-u-data-cell--[&[data-partial='true']_.gridui-data-bar-track>span]:bg-transparent\",\n));\n\nexport const dataBarTrackStyles = cva(cn(\n \"gridui-data-bar-track\",\n \"gridui-u-data-cell--h-(--gridui-space-4) gridui-u-data-cell--bg-brand-tint\",\n \"gridui-u-data-cell--[&_>_span]:block gridui-u-data-cell--[&_>_span]:h-full gridui-u-data-cell--[&_>_span]:bg-accent-background\",\n));\n", "/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataBar\n * @description Data Bar\n */\n\nimport { dataBarStyles, dataBarTrackStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DataBarProps = ComponentPropsWithRef<\"span\"> & {\n readonly value: number;\n readonly maximum: number;\n readonly partial?: boolean;\n};\n\nexport const DataBar: FC<DataBarProps> = (props: DataBarProps) => {\n const {\n value,\n maximum,\n partial = false,\n children,\n className,\n ...restProps\n } = props;\n const ratio = Number.isFinite(value) && Number.isFinite(maximum) && maximum > 0\n ? Math.max(0, Math.min(1, value / maximum))\n : 0;\n return (<span\n {...restProps}\n className={cn(dataBarStyles(), className)}\n data-partial={partial}\n >\n <span>\n {children}\n </span>\n <span\n className={cn(dataBarTrackStyles())}\n aria-hidden=\"true\"\n >\n <span\n style={{ width: `${ratio * 100}%` }}\n />\n </span>\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataValue\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const dataValueStyles = cva(cn(\n \"gridui-data-value\",\n \"gridui-u-data-cell--[&>small]:text-muted gridui-u-data-cell--[&>small]:type-supporting\",\n), {\n variants: {\n mono: {\n false: null,\n true: \"gridui-data-mono gridui-u-data-cell--type-code gridui-u-data-cell--whitespace-nowrap\",\n },\n },\n defaultVariants: { mono: false },\n});\n", "/**\n * @author WMXPY\n * @package Data Cell\n * @namespace DataValue\n * @description Data Value\n */\n\nimport { dataValueStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type DataValueProps = ComponentPropsWithRef<\"span\"> & {\n readonly detail?: ReactNode;\n readonly mono?: boolean;\n readonly tabular?: boolean;\n readonly direction?: \"column\" | \"row\";\n readonly align?: \"start\" | \"center\" | \"end\";\n};\n\nexport const DataValue: FC<DataValueProps> = (props: DataValueProps) => {\n const {\n children,\n detail,\n mono = false,\n tabular = false,\n direction = \"column\",\n align = \"start\",\n className,\n ...restProps\n } = props;\n return (<span\n {...restProps}\n data-direction={direction}\n data-align={align}\n data-tabular={tabular || undefined}\n className={cn(dataValueStyles({ mono }), className)}\n >\n <span>\n {children}\n </span>\n {detail !== undefined && (<small>\n {detail}\n </small>)}\n </span>);\n};\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,kBAAkB,IAAI;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACJ,CAAC;;;ACND,SAAS,MAAAA,WAAU;AAcP;AAPL,IAAM,YAAgC,CAAC,UAA0B;AACpE,QAAM;AAAA,IACF;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWA,IAAG,gBAAgB,GAAG,SAAS;AAAA,MAC1C,aAAW;AAAA,MAEV;AAAA;AAAA,EACL;AACJ;;;ACtBA,SAAS,MAAAC,WAAU;AACnB,SAAS,OAAAC,YAAW;AAEb,IAAM,gBAAgBA,KAAID;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAEM,IAAM,qBAAqBC,KAAID;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AACJ,CAAC;;;ACZD,SAAS,MAAAE,WAAU;AAqBP,SAKJ,OAAAC,MALI;AAZL,IAAM,UAA4B,CAAC,UAAwB;AAC9D,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,QAAM,QAAQ,OAAO,SAAS,KAAK,KAAK,OAAO,SAAS,OAAO,KAAK,UAAU,IACxE,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,QAAQ,OAAO,CAAC,IACxC;AACN,SAAQ;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWD,IAAG,cAAc,GAAG,SAAS;AAAA,MACxC,gBAAc;AAAA,MAEd;AAAA,wBAAAC,KAAC,UACI,UACL;AAAA,QACA,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACG,WAAWD,IAAG,mBAAmB,CAAC;AAAA,YAClC,eAAY;AAAA,YAEZ,0BAAAC;AAAA,cAAC;AAAA;AAAA,gBACG,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI;AAAA;AAAA,YACtC;AAAA;AAAA,QACJ;AAAA;AAAA;AAAA,EACJ;AACJ;;;ACvCA,SAAS,MAAAC,WAAU;AACnB,SAAS,OAAAC,YAAW;AAEb,IAAM,kBAAkBA,KAAID;AAAA,EAC/B;AAAA,EACA;AACJ,GAAG;AAAA,EACC,UAAU;AAAA,IACN,MAAM;AAAA,MACF,OAAO;AAAA,MACP,MAAM;AAAA,IACV;AAAA,EACJ;AAAA,EACA,iBAAiB,EAAE,MAAM,MAAM;AACnC,CAAC;;;ACbD,SAAS,MAAAE,WAAU;AAsBP,SAOJ,OAAAC,MAPI,QAAAC,aAAA;AAXL,IAAM,YAAgC,CAAC,UAA0B;AACpE,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,kBAAgB;AAAA,MAChB,cAAY;AAAA,MACZ,gBAAc,WAAW;AAAA,MACzB,WAAWF,IAAG,gBAAgB,EAAE,KAAK,CAAC,GAAG,SAAS;AAAA,MAElD;AAAA,wBAAAC,KAAC,UACI,UACL;AAAA,QACC,WAAW,UAAc,gBAAAA,KAAC,WACtB,kBACL;AAAA;AAAA;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": ["cn", "cn", "cva", "cn", "jsx", "cn", "cva", "cn", "jsx", "jsxs"]
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -14,9 +14,6 @@
|
|
|
14
14
|
.gridui-u-data-cell--min-w-gridui-64 {
|
|
15
15
|
min-width: var(--gridui-space-64);
|
|
16
16
|
}
|
|
17
|
-
.gridui-u-data-cell--gap-gridui-4 {
|
|
18
|
-
gap: var(--gridui-space-4);
|
|
19
|
-
}
|
|
20
17
|
.gridui-u-data-cell--gap-gridui-8 {
|
|
21
18
|
gap: var(--gridui-space-8);
|
|
22
19
|
}
|
|
@@ -65,11 +62,11 @@
|
|
|
65
62
|
.gridui-u-data-cell--\[\&_\>_span\]\:bg-accent-background > span {
|
|
66
63
|
background-color: var(--gridui-accent-background);
|
|
67
64
|
}
|
|
68
|
-
.gridui-u-data-cell--\[
|
|
65
|
+
.gridui-u-data-cell--\[\&\>small\]\:type-supporting > small {
|
|
69
66
|
font: var(--gridui-type-supporting);
|
|
70
67
|
letter-spacing: normal;
|
|
71
68
|
}
|
|
72
|
-
.gridui-u-data-cell--\[
|
|
69
|
+
.gridui-u-data-cell--\[\&\>small\]\:text-muted > small {
|
|
73
70
|
color: var(--gridui-muted);
|
|
74
71
|
}
|
|
75
72
|
.gridui-u-data-cell--\[\&\[data-partial\=\'true\'\]_\.gridui-data-bar-track\>span\]\:bg-transparent[data-partial='true'] .gridui-data-bar-track > span {
|
|
@@ -80,6 +77,28 @@
|
|
|
80
77
|
.gridui-data-bar[data-partial="true"] .gridui-data-bar-track > span {
|
|
81
78
|
background: repeating-linear-gradient(90deg, var(--gridui-accent-background) 0 4px, transparent 4px 8px);
|
|
82
79
|
}
|
|
80
|
+
.gridui-data-value {
|
|
81
|
+
display: grid;
|
|
82
|
+
gap: 0.25rem;
|
|
83
|
+
min-width: 0;
|
|
84
|
+
}
|
|
85
|
+
.gridui-data-value[data-direction="row"] {
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: baseline;
|
|
88
|
+
flex-wrap: wrap;
|
|
89
|
+
gap: 0.5rem;
|
|
90
|
+
}
|
|
91
|
+
.gridui-data-value[data-align="center"] {
|
|
92
|
+
text-align: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
}
|
|
95
|
+
.gridui-data-value[data-align="end"] {
|
|
96
|
+
text-align: end;
|
|
97
|
+
justify-content: flex-end;
|
|
98
|
+
}
|
|
99
|
+
.gridui-data-value[data-tabular] > span {
|
|
100
|
+
font-variant-numeric: tabular-nums;
|
|
101
|
+
}
|
|
83
102
|
}
|
|
84
103
|
@property --tw-ordinal {
|
|
85
104
|
syntax: "*";
|
package/docs/catalog.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/data-cell",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"category": "
|
|
4
|
+
"version": "1.1.1",
|
|
5
|
+
"category": "data",
|
|
6
6
|
"description": "GridUI React data cell",
|
|
7
7
|
"usage": "Component reference contains focused API pages for each public component.",
|
|
8
8
|
"documentation": [
|
|
@@ -49,9 +49,10 @@
|
|
|
49
49
|
"@gridui/data-cell/styles.css"
|
|
50
50
|
],
|
|
51
51
|
"examples": [
|
|
52
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
53
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
54
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
55
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
52
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-cell/stories/getting-started.mdx",
|
|
53
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-cell/stories/values.mdx",
|
|
54
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-cell/stories/data-badge.stories.tsx",
|
|
55
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-cell/stories/data-bar.stories.tsx",
|
|
56
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-cell/stories/data-value.stories.tsx"
|
|
56
57
|
]
|
|
57
58
|
}
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/data-cell/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-cell/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-cell/stories/data-badge.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/data-cell/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-cell/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-cell/stories/data-bar.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/data-cell/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-cell/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-data/data-cell/stories/data-value.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -65,3 +65,21 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
65
65
|
|
|
66
66
|
Default: ``false``
|
|
67
67
|
|
|
68
|
+
### tabular
|
|
69
|
+
|
|
70
|
+
``boolean | undefined`` · Optional
|
|
71
|
+
|
|
72
|
+
Default: ``false``
|
|
73
|
+
|
|
74
|
+
### direction
|
|
75
|
+
|
|
76
|
+
``"row" | "column" | undefined`` · Optional
|
|
77
|
+
|
|
78
|
+
Default: ``"column"``
|
|
79
|
+
|
|
80
|
+
### align
|
|
81
|
+
|
|
82
|
+
``"center" | "end" | "start" | undefined`` · Optional
|
|
83
|
+
|
|
84
|
+
Default: ``"start"``
|
|
85
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/data-cell",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "GridUI React data cell",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -28,13 +28,14 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@gridui/style-utils": "^4.0.0",
|
|
31
|
-
"@gridui/theme": "^2.
|
|
31
|
+
"@gridui/theme": "^2.6.0",
|
|
32
32
|
"class-variance-authority": "0.7.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
36
|
+
"@gridui/grid": "3.0.1",
|
|
36
37
|
"@jest/globals": "30.5.2",
|
|
37
|
-
"@storybook/react-vite": "10.6.
|
|
38
|
+
"@storybook/react-vite": "10.6.7",
|
|
38
39
|
"@types/jest": "30.0.0",
|
|
39
40
|
"@types/node": "26.6.6",
|
|
40
41
|
"@types/react": "19.3.0",
|